Versions in this module Expand all Collapse all v0 v0.0.4 Nov 26, 2026 Changes in this version + const DefaultSpillHeadLines + const DefaultSpillMaxBytes + const DefaultSpillMaxDiskBytes + const DefaultSpillMaxLines + const DefaultSpillTailLines + var ErrInvalidConfig = errors.New("tools: invalid configuration") + var ErrPermissionDenied = errors.New("tools: permission denied") + var ErrToolNotFound = errors.New("tools: tool not found") + func ActivationBlocks(container Container, cat *workspace.Catalog, resolvedTools []*warp.Tool) []message.Block + func CheckMCPResourceAllowed(ws *workspace.Workspace, serverName, uri string) error + func ReadMCPResource(ctx context.Context, ws *workspace.Workspace, caller MCPCaller, ...) (api.MCPResourceResponse, error) + func ReadOnlyExecutionFromContext(ctx context.Context) bool + func Spill(ctx context.Context, text string) string + func TruncateSkillInstructions(rendered, skillPath string) (string, bool) + func UnsandboxedExecutionFromContext(ctx context.Context) bool + func WithPlanReviewOutcome(ctx context.Context, outcome PlanReviewOutcome) context.Context + func WithReadOnlyExecution(ctx context.Context, readOnly bool) context.Context + func WithSpiller(ctx context.Context, s Spiller) context.Context + func WithUnsandboxedExecution(ctx context.Context, unsandboxed bool) context.Context + type AccessDecision string + const AccessAllow + const AccessAsk + const AccessDeny + type CommandRunner interface + Exec func(ctx context.Context, req std.ExecRequest) (*std.ExecResult, error) + type Config struct + Agent *warp.Agent + AllowedTools []string + CommandRunner CommandRunner + DeferredTools []string + Logger log.Interface + MCPCaller MCPCaller + Sandbox sandbox.Sandbox + Spiller Spiller + Tasks tasks.Store + ToolSearchFactory func(defs []tool.Definition) Tool + Tools []Tool + Workspace *workspace.Workspace + func (c Config) Validate() error + type Container interface + Definitions func() []tool.Definition + Execute func(ctx context.Context, tc *message.ToolCall) (*message.Tool, error) + Get func(name string) (Tool, bool) + List func() []Tool + Prepare func(ctx context.Context, tc *message.ToolCall) (*Plan, error) + func NewContainer(cfg Config) (Container, error) + type Handler interface + Execute func(ctx context.Context, in In) (Out, error) + Prepare func(ctx context.Context, in In) (*Plan, error) + type MCPCaller interface + CallMCPTool func(ctx context.Context, serverName, rawToolName string, args map[string]any) (tool.ToolStream, error) + GetMCPPrompt func(ctx context.Context, serverName, prompt string, args map[string]string, ...) (api.MCPPromptResponse, error) + HasAllowedMCPResources func() bool + ReadMCPResource func(ctx context.Context, serverName, uri string, allowProhibited bool) (api.MCPResourceResponse, error) + type MCPProhibitedError struct + Item string + Kind string + ManifestPath string + Section string + func (e *MCPProhibitedError) Error() string + type Metadata struct + Annotation tool.Annotation + DeferLoading bool + Description string + InputSchema map[string]any + Title string + type Plan struct + Action api.ActionType + BypassSandbox bool + Diff string + InsideWorkspace *bool + Paths []string + PlanReview *api.PlanReviewRequest + ProtectedPath bool + ReadOnly bool + Reversible bool + Safety api.SafetyLevel + ScriptPaths []string + Summary string + Target string + ToolCallID string + ToolName string + Unsandboxed bool + func PlanFromAnnotation(name string, ann tool.Annotation, target, defaultSummary string) *Plan + type PlanReviewOutcome struct + Approved bool + Feedback string + Mode api.PermissionMode + func PlanReviewOutcomeFromContext(ctx context.Context) (PlanReviewOutcome, bool) + type SafeWriter struct + func NewSafeWriter(w io.WriteCloser) *SafeWriter + func (sw *SafeWriter) Close() + func (sw *SafeWriter) Write(p []byte) (int, error) + type Spec struct + Annotation tool.Annotation + DeferLoading bool + Description string + Execute func(ctx context.Context, in In) (Out, error) + InputSchema map[string]any + Name string + Prepare func(ctx context.Context, in In) (*Plan, error) + Title string + type SpillWriter interface + Path func() string + Spilled func() bool + String func() string + func NewSpillWriter(ctx context.Context) SpillWriter + type Spiller interface + NewWriter func(ctx context.Context) SpillWriter + Spill func(ctx context.Context, text string) string + func NewSpiller(cfg SpillerConfig) (Spiller, error) + func SpillerFrom(ctx context.Context) (Spiller, bool) + type SpillerConfig struct + BaseDir string + HeadLines int + MaxBytes int + MaxDiskBytes int + MaxLines int + TailLines int + Workspace *workspace.Workspace + type Tool interface + Definition func() tool.Definition + Execute func(ctx context.Context, call *message.ToolCall) (*message.Tool, error) + Name func() string + Prepare func(ctx context.Context, args map[string]any) (*Plan, error) + SetDeferLoading func(deferLoading bool) + func NewHandler[In, Out any](name string, meta Metadata, h Handler[In, Out]) Tool + func New[In, Out any](spec Spec[In, Out]) (Tool, error)