Documentation
¶
Overview ¶
Package tool defines SuperCode's model-callable tool boundary and registry.
Index ¶
- Variables
- func CanRunInParallel(item Tool, arguments string) bool
- func ReportProgress(ctx context.Context, progress Progress)
- func SandboxStatus(root string) string
- func SandboxStatusWithOptions(root string, options SandboxOptions) string
- func WithProgressReporter(ctx context.Context, reporter func(Progress)) context.Context
- type Categorized
- type Category
- type Parallelizable
- type PermissionRequester
- type Progress
- type Registry
- type Result
- type Risk
- type SandboxOptions
- type Tool
Constants ¶
This section is empty.
Variables ¶
var ErrOutsideWorkspace = errors.New("path is outside the workspace")
Functions ¶
func CanRunInParallel ¶
func ReportProgress ¶
ReportProgress emits a bounded incremental observation from any tool. It is a no-op when the caller is not running under an Agent progress context.
func SandboxStatus ¶
SandboxStatus describes the command boundary selected for a workspace.
func SandboxStatusWithOptions ¶
func SandboxStatusWithOptions(root string, options SandboxOptions) string
func WithProgressReporter ¶
WithProgressReporter installs the agent-owned progress sink for one tool invocation. The context scope prevents background processes from retaining a stale UI callback after that invocation returns.
Types ¶
type Categorized ¶
type Categorized interface{ Category() Category }
type Parallelizable ¶
Parallelizable is an explicit opt-in for tools whose read operations are safe to overlap with other calls from the same model response. RiskRead by itself is not sufficient: process polling and stdin transport also use that risk while mutating shared runtime state.
type PermissionRequester ¶
type PermissionRequester interface {
PermissionRequest(arguments string) (permission.Request, error)
}
PermissionRequester lets the agent distinguish an access grant from a normal tool approval and apply the selected turn/session lifetime.
type Progress ¶
Progress is an incremental observation produced while a tool is still running. Delta is append-only text; callers should render it as untrusted terminal output.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry keeps tool discovery independent from execution orchestration.
func NewRegistry ¶
func (*Registry) Definitions ¶
func (r *Registry) Definitions() []provider.ToolDefinition
type SandboxOptions ¶
type SandboxOptions struct {
ReadRoots []string
WriteRoots []string
DenyRoots []string
Permissions *permission.Manager
}
type Tool ¶
type Tool interface {
Definition() provider.ToolDefinition
Risk(arguments string) Risk
Summary(arguments string) string
Execute(ctx context.Context, arguments string) (Result, error)
}
Tool is implemented by every built-in or future plugin tool.
func BuiltinsWithLifecycle ¶
BuiltinsWithLifecycle returns the standard tools together with the owner of background process resources. Long-lived hosts must close the lifecycle when shutting down; Builtins and BuiltinsWithOptions remain for compatibility.
func BuiltinsWithOptions ¶
func BuiltinsWithOptions(root string, options SandboxOptions) ([]Tool, error)
func SearchTool ¶
SearchTool exposes a compact catalog for models and users when many dynamic MCP tools are installed. Execution still goes through the original registry.