Documentation
¶
Overview ¶
Package subagenttool registers the delegate tool, the production caller that hands one bounded piece of work to a child agent confined to caller-declared write, delete, and move scopes.
Index ¶
- Constants
- type Deps
- type PreparationError
- type Snapshot
- type Tool
- func (t *Tool) Advertise() tools.Metadata
- func (t *Tool) Invoke(ctx context.Context, args map[string]any) (tools.Result, error)
- func (t *Tool) InvokeWithPreparedDelegate(ctx context.Context, instruction string, write, remove map[string]bool, ...) (tools.Result, error)
- func (t *Tool) Name() string
- func (t *Tool) PrepareDelegate(args map[string]any) (string, map[string]bool, map[string]bool, map[permissions.MovePair]bool, ...)
- func (t *Tool) SubjectKind() string
Constants ¶
const ToolName = "delegate"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Home string
LaunchDir string
ProjectRoot string
Snapshot func() (Snapshot, bool)
NewDispatcher func(permissions.ModeContext) turn.ToolDispatcher
// Store is the parent's session store: a child records into it rather than one of its own.
Store func() *sessions.Store
// Activity is the optional live surface for the child lifecycle. It is display-only: the
// durable record is the start/end pair below, and a nil sink changes nothing.
Activity subagent.ActivitySink
}
Deps binds the tool to the run. NewDispatcher receives the child's authorization ceiling and returns a dispatcher bound to the parent's real file tools, so this package never assembles authority of its own.
type PreparationError ¶
type PreparationError struct {
Reason string
}
A caller that prepares separately from invocation must return Result in band; a delegate call rejected on its arguments was never a permission question and must not abort the turn.
func (*PreparationError) Error ¶
func (e *PreparationError) Error() string
func (*PreparationError) Result ¶
func (e *PreparationError) Result() tools.Result
type Snapshot ¶
type Snapshot struct {
Mode string
Model model.Selection
ModelSource model.Source
SupportedEffort func(providerID, modelID string) []string
SystemPrompt string
Client provider.Client
Tools []provider.ToolDefinition
Registered []tools.Tool
}
Snapshot is the parent state one delegate call inherits, read when that call starts rather than when the tool was registered.
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}