Documentation
¶
Index ¶
- type AgentTool
- func (t *AgentTool) BackfillInput(ctx context.Context, input map[string]any) map[string]any
- func (t *AgentTool) Call(ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn) (tool.CallResult, error)
- func (t *AgentTool) CheckPermissions(ctx context.Context, input map[string]any, toolCtx tool.ToolUseContext) types.PermissionResult
- func (t *AgentTool) Definition() tool.Definition
- func (t *AgentTool) Description(ctx context.Context) (string, error)
- func (t *AgentTool) FormatResult(data any) string
- func (t *AgentTool) GetRunner() *coreagent.Runner
- func (t *AgentTool) IsConcurrencySafe(input map[string]any) bool
- func (t *AgentTool) IsEnabled() bool
- func (t *AgentTool) IsReadOnly(input map[string]any) bool
- func (t *AgentTool) SetEngine(e *engine.Engine)
- func (t *AgentTool) SetRegistry(r *coreagent.AgentRegistry)
- func (t *AgentTool) SetRunner(runner *coreagent.Runner)
- func (t *AgentTool) ValidateInput(ctx context.Context, input map[string]any) (map[string]any, error)
- type AgentToolConfig
- type CloseAgentTool
- func (t *CloseAgentTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *CloseAgentTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *CloseAgentTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *CloseAgentTool) Definition() tool.Definition
- func (t *CloseAgentTool) Description(_ context.Context) (string, error)
- func (t *CloseAgentTool) FormatResult(data any) string
- func (t *CloseAgentTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *CloseAgentTool) IsEnabled() bool
- func (t *CloseAgentTool) IsReadOnly(_ map[string]any) bool
- func (t *CloseAgentTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
- type ListAgentsTool
- func (t *ListAgentsTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *ListAgentsTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *ListAgentsTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *ListAgentsTool) Definition() tool.Definition
- func (t *ListAgentsTool) Description(_ context.Context) (string, error)
- func (t *ListAgentsTool) FormatResult(data any) string
- func (t *ListAgentsTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *ListAgentsTool) IsEnabled() bool
- func (t *ListAgentsTool) IsReadOnly(_ map[string]any) bool
- func (t *ListAgentsTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
- type ResumeAgentTool
- func (t *ResumeAgentTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *ResumeAgentTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *ResumeAgentTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *ResumeAgentTool) Definition() tool.Definition
- func (t *ResumeAgentTool) Description(_ context.Context) (string, error)
- func (t *ResumeAgentTool) FormatResult(data any) string
- func (t *ResumeAgentTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *ResumeAgentTool) IsEnabled() bool
- func (t *ResumeAgentTool) IsReadOnly(_ map[string]any) bool
- func (t *ResumeAgentTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
- type SendAgentMessageTool
- func (t *SendAgentMessageTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *SendAgentMessageTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *SendAgentMessageTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *SendAgentMessageTool) Definition() tool.Definition
- func (t *SendAgentMessageTool) Description(_ context.Context) (string, error)
- func (t *SendAgentMessageTool) FormatResult(data any) string
- func (t *SendAgentMessageTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *SendAgentMessageTool) IsEnabled() bool
- func (t *SendAgentMessageTool) IsReadOnly(_ map[string]any) bool
- func (t *SendAgentMessageTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
- type SkillForkRunner
- type SpawnAgentTool
- func (t *SpawnAgentTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *SpawnAgentTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *SpawnAgentTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *SpawnAgentTool) Definition() tool.Definition
- func (t *SpawnAgentTool) Description(_ context.Context) (string, error)
- func (t *SpawnAgentTool) FormatResult(data any) string
- func (t *SpawnAgentTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *SpawnAgentTool) IsEnabled() bool
- func (t *SpawnAgentTool) IsReadOnly(_ map[string]any) bool
- func (t *SpawnAgentTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
- type WaitAgentTool
- func (t *WaitAgentTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *WaitAgentTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *WaitAgentTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *WaitAgentTool) Definition() tool.Definition
- func (t *WaitAgentTool) Description(_ context.Context) (string, error)
- func (t *WaitAgentTool) FormatResult(data any) string
- func (t *WaitAgentTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *WaitAgentTool) IsEnabled() bool
- func (t *WaitAgentTool) IsReadOnly(_ map[string]any) bool
- func (t *WaitAgentTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentTool ¶
type AgentTool struct {
// contains filtered or unexported fields
}
AgentTool is the agent tool
func NewAgentTool ¶
func NewAgentTool(config *AgentToolConfig) *AgentTool
NewAgentTool creates a new agent tool
func (*AgentTool) BackfillInput ¶
BackfillInput enriches input
func (*AgentTool) Call ¶
func (t *AgentTool) Call( ctx context.Context, input tool.CallInput, permissionCheck types.CanUseToolFn, ) (tool.CallResult, error)
Call executes the tool
func (*AgentTool) CheckPermissions ¶
func (t *AgentTool) CheckPermissions(ctx context.Context, input map[string]any, toolCtx tool.ToolUseContext) types.PermissionResult
CheckPermissions checks permissions
func (*AgentTool) Definition ¶
func (t *AgentTool) Definition() tool.Definition
Definition returns the tool definition
func (*AgentTool) Description ¶
Description returns description
func (*AgentTool) FormatResult ¶
FormatResult formats result
func (*AgentTool) IsConcurrencySafe ¶
IsConcurrencySafe returns whether tool is concurrency safe
func (*AgentTool) IsReadOnly ¶
IsReadOnly returns whether tool is read-only
func (*AgentTool) SetRegistry ¶
func (t *AgentTool) SetRegistry(r *coreagent.AgentRegistry)
SetRegistry sets the agent registry for resolving dynamic (skill-based) agent types.
type CloseAgentTool ¶
type CloseAgentTool struct {
// contains filtered or unexported fields
}
CloseAgentTool terminates a sub-agent and removes it from the registry.
func NewCloseAgentTool ¶
func NewCloseAgentTool() *CloseAgentTool
func (*CloseAgentTool) BackfillInput ¶
func (*CloseAgentTool) Call ¶
func (t *CloseAgentTool) Call( ctx context.Context, input tool.CallInput, _ types.CanUseToolFn, ) (tool.CallResult, error)
func (*CloseAgentTool) CheckPermissions ¶
func (t *CloseAgentTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*CloseAgentTool) Definition ¶
func (t *CloseAgentTool) Definition() tool.Definition
func (*CloseAgentTool) Description ¶
func (t *CloseAgentTool) Description(_ context.Context) (string, error)
func (*CloseAgentTool) FormatResult ¶
func (t *CloseAgentTool) FormatResult(data any) string
func (*CloseAgentTool) IsConcurrencySafe ¶
func (t *CloseAgentTool) IsConcurrencySafe(_ map[string]any) bool
func (*CloseAgentTool) IsEnabled ¶
func (t *CloseAgentTool) IsEnabled() bool
func (*CloseAgentTool) IsReadOnly ¶
func (t *CloseAgentTool) IsReadOnly(_ map[string]any) bool
func (*CloseAgentTool) ValidateInput ¶
type ListAgentsTool ¶
type ListAgentsTool struct {
// contains filtered or unexported fields
}
ListAgentsTool lists all active sub-agents. Mirrors Codex's CollabAgentTool listing + CollabAgentStatusEntry.
func NewListAgentsTool ¶
func NewListAgentsTool() *ListAgentsTool
func (*ListAgentsTool) BackfillInput ¶
func (*ListAgentsTool) Call ¶
func (t *ListAgentsTool) Call( ctx context.Context, input tool.CallInput, _ types.CanUseToolFn, ) (tool.CallResult, error)
func (*ListAgentsTool) CheckPermissions ¶
func (t *ListAgentsTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*ListAgentsTool) Definition ¶
func (t *ListAgentsTool) Definition() tool.Definition
func (*ListAgentsTool) Description ¶
func (t *ListAgentsTool) Description(_ context.Context) (string, error)
func (*ListAgentsTool) FormatResult ¶
func (t *ListAgentsTool) FormatResult(data any) string
func (*ListAgentsTool) IsConcurrencySafe ¶
func (t *ListAgentsTool) IsConcurrencySafe(_ map[string]any) bool
func (*ListAgentsTool) IsEnabled ¶
func (t *ListAgentsTool) IsEnabled() bool
func (*ListAgentsTool) IsReadOnly ¶
func (t *ListAgentsTool) IsReadOnly(_ map[string]any) bool
func (*ListAgentsTool) ValidateInput ¶
type ResumeAgentTool ¶
type ResumeAgentTool struct {
// contains filtered or unexported fields
}
ResumeAgentTool resumes a persisted sub-agent session with a new task.
func NewResumeAgentTool ¶
func NewResumeAgentTool(eng *engine.Engine, tools []tool.Tool, reg *coreagent.AgentRegistry) *ResumeAgentTool
func (*ResumeAgentTool) BackfillInput ¶
func (*ResumeAgentTool) Call ¶
func (t *ResumeAgentTool) Call( ctx context.Context, input tool.CallInput, _ types.CanUseToolFn, ) (tool.CallResult, error)
func (*ResumeAgentTool) CheckPermissions ¶
func (t *ResumeAgentTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*ResumeAgentTool) Definition ¶
func (t *ResumeAgentTool) Definition() tool.Definition
func (*ResumeAgentTool) Description ¶
func (t *ResumeAgentTool) Description(_ context.Context) (string, error)
func (*ResumeAgentTool) FormatResult ¶
func (t *ResumeAgentTool) FormatResult(data any) string
func (*ResumeAgentTool) IsConcurrencySafe ¶
func (t *ResumeAgentTool) IsConcurrencySafe(_ map[string]any) bool
func (*ResumeAgentTool) IsEnabled ¶
func (t *ResumeAgentTool) IsEnabled() bool
func (*ResumeAgentTool) IsReadOnly ¶
func (t *ResumeAgentTool) IsReadOnly(_ map[string]any) bool
func (*ResumeAgentTool) ValidateInput ¶
type SendAgentMessageTool ¶
type SendAgentMessageTool struct {
// contains filtered or unexported fields
}
SendAgentMessageTool sends a message to a running agent's continuation queue.
func NewSendAgentMessageTool ¶
func NewSendAgentMessageTool() *SendAgentMessageTool
func (*SendAgentMessageTool) BackfillInput ¶
func (*SendAgentMessageTool) Call ¶
func (t *SendAgentMessageTool) Call( ctx context.Context, input tool.CallInput, _ types.CanUseToolFn, ) (tool.CallResult, error)
func (*SendAgentMessageTool) CheckPermissions ¶
func (t *SendAgentMessageTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*SendAgentMessageTool) Definition ¶
func (t *SendAgentMessageTool) Definition() tool.Definition
func (*SendAgentMessageTool) Description ¶
func (t *SendAgentMessageTool) Description(_ context.Context) (string, error)
func (*SendAgentMessageTool) FormatResult ¶
func (t *SendAgentMessageTool) FormatResult(data any) string
func (*SendAgentMessageTool) IsConcurrencySafe ¶
func (t *SendAgentMessageTool) IsConcurrencySafe(_ map[string]any) bool
func (*SendAgentMessageTool) IsEnabled ¶
func (t *SendAgentMessageTool) IsEnabled() bool
func (*SendAgentMessageTool) IsReadOnly ¶
func (t *SendAgentMessageTool) IsReadOnly(_ map[string]any) bool
func (*SendAgentMessageTool) ValidateInput ¶
type SkillForkRunner ¶
type SkillForkRunner struct {
// contains filtered or unexported fields
}
SkillForkRunner implements skills.ForkRunner: it runs a `context: fork` skill's rendered prompt as an isolated sub-agent, reusing the same spawn-depth guard, wall-clock timeout, and permission-mode inheritance policy (subAgentPermissionMode) every other sub-agent path in this package already uses, rather than inventing a second, divergent execution policy for skills specifically.
func NewSkillForkRunner ¶
func NewSkillForkRunner(eng *engine.Engine) *SkillForkRunner
NewSkillForkRunner builds a SkillForkRunner bound to eng. Wire the result into the registered skill tool via SkillTool.SetForkRunner once eng exists (the tool itself is constructed and registered before the engine is, so this is a post-construction injection - see pkg/sdk/client.go).
func (*SkillForkRunner) RunForkedSkill ¶
func (r *SkillForkRunner) RunForkedSkill(ctx context.Context, skillName, task string, allowedTools []string, model string, parentPermissionMode types.PermissionMode) (string, error)
RunForkedSkill runs task (the skill's already-rendered prompt, arguments already substituted) as a sub-agent scoped to allowedTools and model - both straight from the skill's own frontmatter (AllowedTools/Model), which have no effect on the default, non-forked execution path. Returns the sub-agent's final text output.
type SpawnAgentTool ¶
type SpawnAgentTool struct {
// contains filtered or unexported fields
}
SpawnAgentTool launches a sub-agent asynchronously and returns immediately. Mirrors Codex's CollabAgentTool = "spawnAgent" + CollabAgentSpawnBeginEvent / CollabAgentSpawnEndEvent.
func NewSpawnAgentTool ¶
func NewSpawnAgentTool(eng *engine.Engine, tools []tool.Tool, reg *coreagent.AgentRegistry) *SpawnAgentTool
func (*SpawnAgentTool) BackfillInput ¶
func (*SpawnAgentTool) Call ¶
func (t *SpawnAgentTool) Call( ctx context.Context, input tool.CallInput, _ types.CanUseToolFn, ) (tool.CallResult, error)
func (*SpawnAgentTool) CheckPermissions ¶
func (t *SpawnAgentTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*SpawnAgentTool) Definition ¶
func (t *SpawnAgentTool) Definition() tool.Definition
func (*SpawnAgentTool) Description ¶
func (t *SpawnAgentTool) Description(_ context.Context) (string, error)
func (*SpawnAgentTool) FormatResult ¶
func (t *SpawnAgentTool) FormatResult(data any) string
func (*SpawnAgentTool) IsConcurrencySafe ¶
func (t *SpawnAgentTool) IsConcurrencySafe(_ map[string]any) bool
func (*SpawnAgentTool) IsEnabled ¶
func (t *SpawnAgentTool) IsEnabled() bool
func (*SpawnAgentTool) IsReadOnly ¶
func (t *SpawnAgentTool) IsReadOnly(_ map[string]any) bool
func (*SpawnAgentTool) ValidateInput ¶
type WaitAgentTool ¶
type WaitAgentTool struct {
// contains filtered or unexported fields
}
WaitAgentTool blocks until an agent finishes and returns its result.
func NewWaitAgentTool ¶
func NewWaitAgentTool() *WaitAgentTool
func (*WaitAgentTool) BackfillInput ¶
func (*WaitAgentTool) Call ¶
func (t *WaitAgentTool) Call( ctx context.Context, input tool.CallInput, _ types.CanUseToolFn, ) (tool.CallResult, error)
func (*WaitAgentTool) CheckPermissions ¶
func (t *WaitAgentTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*WaitAgentTool) Definition ¶
func (t *WaitAgentTool) Definition() tool.Definition
func (*WaitAgentTool) Description ¶
func (t *WaitAgentTool) Description(_ context.Context) (string, error)
func (*WaitAgentTool) FormatResult ¶
func (t *WaitAgentTool) FormatResult(data any) string
func (*WaitAgentTool) IsConcurrencySafe ¶
func (t *WaitAgentTool) IsConcurrencySafe(_ map[string]any) bool
func (*WaitAgentTool) IsEnabled ¶
func (t *WaitAgentTool) IsEnabled() bool
func (*WaitAgentTool) IsReadOnly ¶
func (t *WaitAgentTool) IsReadOnly(_ map[string]any) bool