Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEnvironmentTools ¶
func NewEnvironmentTools(executeFn func(ctx context.Context, req ToolRequest, onProgress func(ToolProgress)) (*ToolResponse, error)) []agent.AgentTool
NewEnvironmentTools creates agent tools that delegate execution to the provided execute function. This is the unified factory for all environments: LocalEnvironment, NativeSandboxEnvironment, etc.
Usage:
// Local environment env := local.NewLocalEnvironment(rootDir, logger) tools := tools.NewEnvironmentTools(env.ExecuteTool) // Native sandbox environment env := native.NewNativeSandboxEnvironment(svc, logger) tools := tools.NewEnvironmentTools(env.ExecuteTool)
func NewLocalTools ¶
func NewLocalTools(rootDir string, _ LocalToolsOptions) []agent.AgentTool
NewLocalTools creates the standard set of agent tools backed by local filesystem execution. All Tier 1 tools run in-process.
Types ¶
type LocalBackend ¶
type LocalBackend struct {
// contains filtered or unexported fields
}
LocalBackend executes tools directly in-process under a workspace root.
func NewLocalBackend ¶
func NewLocalBackend(rootDir string) *LocalBackend
NewLocalBackend creates a backend that runs all built-in tools in-process.
func (*LocalBackend) ExecuteTool ¶
func (b *LocalBackend) ExecuteTool(ctx context.Context, req ToolRequest, _ func(ToolProgress)) (*ToolResponse, error)
type LocalToolsOptions ¶
type LocalToolsOptions struct {
// MaxReadFileSize overrides the default max file size for read_file.
MaxReadFileSize int64
}
LocalToolsOptions configures the local tools factory.
type ResourceSpec ¶
ResourceSpec provides optional resource hints for Tier 2 execution.
type ToolProgress ¶
ToolProgress carries incremental output during long-running tool execution.
type ToolRequest ¶
type ToolRequest struct {
SessionID string
ToolName string
ToolCallID string
Params map[string]any
Resources *ResourceSpec
}
ToolRequest carries all parameters needed to dispatch a single tool call.
type ToolResponse ¶
type ToolResponse struct {
Content []ai.ContentBlock
SnapshotID string
ExitCode *int
}
ToolResponse is the result of a tool execution.
type ToolTier ¶
type ToolTier int
ToolTier classifies tools by execution model.
func ClassifyTool ¶
ClassifyTool returns the tier for a given tool name. This classifier is centralized and shared across all backends.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package envtools bridges the circular-import gap between internal/agent, internal/tools, and internal/sandbox/environment.
|
Package envtools bridges the circular-import gap between internal/agent, internal/tools, and internal/sandbox/environment. |