Documentation
¶
Overview ¶
Package tools provides independent definition builders for Looprig's standard tools. Concrete constructors and options live in focused subpackages.
Index ¶
- func AskUserDefinition() tool.Definition
- func Bash(options ...bash.BashOption) tool.Definition
- func BashDefinition(resolver AsyncProcessRunnerResolver, options ...bash.BashOption) tool.Definition
- func EditFileDefinition(options ...editfile.Option) tool.Definition
- func FetchDefinition(client *http.Client) tool.Definition
- func GlobDefinition(readGuard loop.ReadGuard, options ...glob.GlobOption) tool.Definition
- func GrepDefinition(readGuard loop.ReadGuard, options ...grep.GrepOption) tool.Definition
- func ProcessInputDefinition() tool.Definition
- func ProcessOutputDefinition() tool.Definition
- func ProcessStopDefinition() tool.Definition
- func ReadFileDefinition(readGuard loop.ReadGuard, options ...readfile.ReadFileOption) tool.Definition
- func TaskDefinitions() tool.Definition
- func WebSearchDefinition(provider websearch.SearchProvider) tool.Definition
- func WriteFileDefinition(options ...writefile.Option) tool.Definition
- type AsyncProcessRunnerResolver
- type DefinitionBuildError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskUserDefinition ¶
func AskUserDefinition() tool.Definition
func Bash ¶
func Bash(options ...bash.BashOption) tool.Definition
func BashDefinition ¶
func BashDefinition(resolver AsyncProcessRunnerResolver, options ...bash.BashOption) tool.Definition
BashDefinition builds the session-supervised Bash tool: unlike Bash, a SUPERVISED call (background, or a present yield_time_ms — bash/prepare.go's normalizeSupervision) routes through the shared, runner-free process.Supervisor (bash/supervised.go). resolver supplies the concrete tool.AsyncProcessRunner: Build calls it exactly once, only after Harness has validated bindings, with the validated bindings.LoopID, and rejects a resolver error or a nil/typed-nil returned runner without ever producing a tool. options configure the underlying BashTool exactly like Bash's own — resolved once here, never reapplied per Build.
func EditFileDefinition ¶
func EditFileDefinition(options ...editfile.Option) tool.Definition
EditFileDefinition accepts editfile.Option values such as editfile.WithHostWrites(). Do not pass editfile.WithMutationCoordinator here: this entry point already injects the session-bound coordinator, and a caller-supplied one is applied after it and silently wins, defeating the PathMutation permit and lease-health check with no error.
func FetchDefinition ¶
func FetchDefinition(client *http.Client) tool.Definition
func GlobDefinition ¶
func GlobDefinition(readGuard loop.ReadGuard, options ...glob.GlobOption) tool.Definition
func GrepDefinition ¶
func GrepDefinition(readGuard loop.ReadGuard, options ...grep.GrepOption) tool.Definition
func ProcessInputDefinition ¶
func ProcessInputDefinition() tool.Definition
ProcessInputDefinition builds the mutating ProcessInput tool over the same shared supervisor entry ProcessOutputDefinition resolves (process/ input_tool.go). Argument-free for the identical reason.
func ProcessOutputDefinition ¶
func ProcessOutputDefinition() tool.Definition
ProcessOutputDefinition builds the read-only ProcessOutput tool bound to this session's shared, runner-free process.Supervisor (process/ output_tool.go). Argument-free: unlike BashDefinition it captures no resolver and no options — a caller's owned process is read through the same registry entry Bash and its two sibling definitions share, keyed by process.SupervisorResourceKey alone.
func ProcessStopDefinition ¶
func ProcessStopDefinition() tool.Definition
ProcessStopDefinition builds the mutating ProcessStop tool over the same shared supervisor entry (process/stop_tool.go). Argument-free for the identical reason.
func ReadFileDefinition ¶
func ReadFileDefinition(readGuard loop.ReadGuard, options ...readfile.ReadFileOption) tool.Definition
func TaskDefinitions ¶
func TaskDefinitions() tool.Definition
func WebSearchDefinition ¶
func WebSearchDefinition(provider websearch.SearchProvider) tool.Definition
func WriteFileDefinition ¶
func WriteFileDefinition(options ...writefile.Option) tool.Definition
WriteFileDefinition accepts writefile.Option values such as writefile.WithHostWrites(). Do not pass writefile.WithMutationCoordinator here: this entry point already injects the session-bound coordinator, and a caller-supplied one is applied after it and silently wins, defeating the PathMutation permit and lease-health check with no error.
Types ¶
type AsyncProcessRunnerResolver ¶
AsyncProcessRunnerResolver resolves the concrete tool.AsyncProcessRunner a session-supervised Bash definition binds to, from the Harness-validated bindings.LoopID at Build (design spec "Workspace coordination": "At definition Build, Tools invokes the resolver with the validated bindings.LoopID"). Tools owns this resolver shape; a product composition root supplies the concrete implementation over its own per-role executor set. Runner selection is therefore complete before the concrete Bash tool is ever invoked — it never derives from invocation-time provenance.
type DefinitionBuildError ¶
type DefinitionBuildError = definition.BuildError
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bash implements the Bash tool: single-command shell execution inside a workspace-contained working directory, with a bounded timeout and a capped combined-output capture.
|
Package bash implements the Bash tool: single-command shell execution inside a workspace-contained working directory, with a bounded timeout and a capped combined-output capture. |
|
Package editfile exposes the standard workspace file editor.
|
Package editfile exposes the standard workspace file editor. |
|
Package fetch implements the Fetch tool: one bounded HTTP GET or POST via an injected *http.Client, with no filesystem access.
|
Package fetch implements the Fetch tool: one bounded HTTP GET or POST via an injected *http.Client, with no filesystem access. |
|
Package glob implements the Glob tool: a workspace-contained, denied-path-excluding filename search over WalkDir-discovered entries.
|
Package glob implements the Glob tool: a workspace-contained, denied-path-excluding filename search over WalkDir-discovered entries. |
|
Package grep implements the Grep tool: a workspace-contained content search that prefers ripgrep and falls back to a stdlib scan, with two-layer denied-path enforcement.
|
Package grep implements the Grep tool: a workspace-contained content search that prefers ripgrep and falls back to a stdlib scan, with two-layer denied-path enforcement. |
|
internal
|
|
|
atomicfile
Package atomicfile provides durable, crash-safe atomic replacement of one file's contents (spec "docs/specs/long-running-command-supervision.md", "Manifests and durability": "Manifest updates use write-new, sync, and atomic replace semantics").
|
Package atomicfile provides durable, crash-safe atomic replacement of one file's contents (spec "docs/specs/long-running-command-supervision.md", "Manifests and durability": "Manifest updates use write-new, sync, and atomic replace semantics"). |
|
filemutation
Package filemutation implements the shared mechanics of the two direct mutation tools, WriteFile and EditFile: single-step preparation and canonicalization, workspace containment, atomic publication, optimistic file-freshness concurrency, and permit-scoped cross-loop serialization.
|
Package filemutation implements the shared mechanics of the two direct mutation tools, WriteFile and EditFile: single-step preparation and canonicalization, workspace containment, atomic publication, optimistic file-freshness concurrency, and permit-scoped cross-loop serialization. |
|
hashcache
Package hashcache memoizes the parse of a byte slice keyed by its SHA-256.
|
Package hashcache memoizes the parse of a byte slice keyed by its SHA-256. |
|
nofollow
Package nofollow provides one small, platform-portable primitive for opening a file while refusing to traverse a symlink (POSIX) or reparse point (Windows) at the final path component.
|
Package nofollow provides one small, platform-portable primitive for opening a file while refusing to traverse a symlink (POSIX) or reparse point (Windows) at the final path component. |
|
prepared
Package prepared holds the small helpers the direct file/context tools share at the preparation boundary: reading a call's typed prepared artifact back from the context and building the direct filesystem requirements (empty grant pair — the tool enforces the approved resolved resource itself).
|
Package prepared holds the small helpers the direct file/context tools share at the preparation boundary: reading a call's typed prepared artifact back from the context and building the direct filesystem requirements (empty grant pair — the tool enforces the approved resolved resource itself). |
|
safetext
Package safetext converts raw process output bytes into model-safe text (spec "docs/specs/long-running-command-supervision.md", "Output capture and storage": "Model-visible text passes through safe-text normalization: invalid UTF-8 is replaced deterministically; disallowed terminal control sequences are escaped or removed; binary detection is reported; normalization is reported").
|
Package safetext converts raw process output bytes into model-safe text (spec "docs/specs/long-running-command-supervision.md", "Output capture and storage": "Model-visible text passes through safe-text normalization: invalid UTF-8 is replaced deterministically; disallowed terminal control sequences are escaped or removed; binary detection is reported; normalization is reported"). |
|
workspace
Package workspace holds the shared, security-sensitive primitives the standard tools depend on: `**`-aware glob matching, workspace path containment, and typed-nil detection for injected dependencies.
|
Package workspace holds the shared, security-sensitive primitives the standard tools depend on: `**`-aware glob matching, workspace path containment, and typed-nil detection for injected dependencies. |
|
Package permission implements the single hardened workspace permission store defined by the access-profile specification.
|
Package permission implements the single hardened workspace permission store defined by the access-profile specification. |
|
Package process defines the Tools-owned long-running-command supervision domain: process identity, lifecycle state, the stable error taxonomy, and quota configuration (spec "docs/specs/long-running-command-supervision.md", sections "Identity and authorization", "State machine", "Stable errors", and "Quotas and retention").
|
Package process defines the Tools-owned long-running-command supervision domain: process identity, lifecycle state, the stable error taxonomy, and quota configuration (spec "docs/specs/long-running-command-supervision.md", sections "Identity and authorization", "State machine", "Stable errors", and "Quotas and retention"). |
|
Package readfile implements the ReadFile tool: a workspace-contained, denied-path-aware, symlink-rejecting file reader returning line-numbered text capped by the injected ReadGuard.
|
Package readfile implements the ReadFile tool: a workspace-contained, denied-path-aware, symlink-rejecting file reader returning line-numbered text capped by the injected ReadGuard. |
|
Package skill implements the Skill tool: an on-demand reader of curated embedded (and optionally untrusted workspace) SKILL.md bodies, scoped to the one agent the tool is bound to.
|
Package skill implements the Skill tool: an on-demand reader of curated embedded (and optionally untrusted workspace) SKILL.md bodies, scoped to the one agent the tool is bound to. |
|
Package websearch implements the WebSearch tool and its SearchProvider seam, with no filesystem access.
|
Package websearch implements the WebSearch tool and its SearchProvider seam, with no filesystem access. |
|
Package writefile exposes the standard workspace file writer.
|
Package writefile exposes the standard workspace file writer. |