Documentation
¶
Index ¶
- Constants
- func AllowedAgentToolNames(parent *core.ToolRegistry, capabilities []string, permissionMode string) ([]string, error)
- func AllowedAgentToolNamesForMCPServers(parent *core.ToolRegistry, capabilities []string, permissionMode string, ...) ([]string, error)
- func AllowedCapabilityToolNames(parent *core.ToolRegistry, capabilities []string) ([]string, error)
- func BuildAgentRegistry(parent *core.ToolRegistry, capabilities []string, permissionMode string) (*core.ToolRegistry, error)
- func BuildAgentRegistryForMCPServers(parent *core.ToolRegistry, capabilities []string, permissionMode string, ...) (*core.ToolRegistry, error)
- func BuildCapabilityRegistry(parent *core.ToolRegistry, capabilities []string) (*core.ToolRegistry, error)
- func BuildReadOnlyRegistry(parent *core.ToolRegistry) (*core.ToolRegistry, error)
- func CapabilityTools(parent *core.ToolRegistry, capabilities []string) ([]core.Tool, error)
- func CapabilityToolsForPermission(parent *core.ToolRegistry, capabilities []string, permissionMode string, ...) ([]core.Tool, error)
- func NewTools(r *Runner) []core.Tool
- func ReadOnlyTools(parent *core.ToolRegistry) []core.Tool
- func ResolveAgentHooks(def AgentDefinition) ([]agent.ResolvedHook, error)
- func ValidAgentDefinitionName(name string) bool
- type AgentDefinition
- type AgentDefinitionLibrary
- type AgentDefinitionRoot
- type AgentGenerationConfig
- type AgentRuntimeConfig
- type ParallelReasonRequest
- type ParallelReasonResponse
- type ParallelReasonResult
- type ProviderFactory
- type ProviderFactoryWithOptions
- type ProviderRequest
- type Runner
- func (r *Runner) AllowedSubagentTools(req SpawnSubagentRequest) ([]string, error)
- func (r *Runner) CancelBackgroundSubagent(sessionID string) (session.SessionMeta, bool, error)
- func (r *Runner) ParallelReason(ctx context.Context, req ParallelReasonRequest) (ParallelReasonResponse, error)
- func (r *Runner) SpawnSubagent(ctx context.Context, req SpawnSubagentRequest) (SpawnSubagentResponse, error)
- func (r *Runner) SpawnSubagentWithProgress(ctx context.Context, req SpawnSubagentRequest, ...) (SpawnSubagentResponse, error)
- func (r *Runner) SubagentStatus(sessionID string) (session.SessionMeta, error)
- type RunnerConfig
- type RunnerDefaults
- type SpawnSubagentError
- type SpawnSubagentRequest
- type SpawnSubagentResponse
- type SubagentBudget
- type ToolWorkspace
- type WorkspaceToolRegistryFactory
Constants ¶
View Source
const ( AgentPermissionReadOnly = "read_only" AgentPermissionAsk = "ask" AgentPermissionAuto = "auto" AgentPermissionTrusted = "trusted" AgentIsolationNone = "none" AgentIsolationWorktree = "worktree" )
View Source
const ( CapabilityWorkspaceRead = "workspace.read" CapabilityWorkspaceWrite = "workspace.write" CapabilityShellRead = "shell.read" CapabilityShellRun = "shell.run" CapabilityTerminalWrite = "terminal.write" CapabilityWebSearch = "web.search" CapabilityWebFetch = "web.fetch" CapabilityMCPRead = "mcp.read" )
View Source
const ( MaxParallelPrompts = 8 DefaultMaxTokens = 800 DefaultMaxToolIters = 12 DefaultSummaryMaxChar = 8 * 1024 )
View Source
const AgentDefinitionFileExt = ".md"
Variables ¶
This section is empty.
Functions ¶
func AllowedAgentToolNames ¶ added in v0.1.34
func AllowedAgentToolNamesForMCPServers ¶ added in v0.1.34
func AllowedCapabilityToolNames ¶ added in v0.1.30
func AllowedCapabilityToolNames(parent *core.ToolRegistry, capabilities []string) ([]string, error)
func BuildAgentRegistry ¶ added in v0.1.34
func BuildAgentRegistry(parent *core.ToolRegistry, capabilities []string, permissionMode string) (*core.ToolRegistry, error)
func BuildAgentRegistryForMCPServers ¶ added in v0.1.34
func BuildAgentRegistryForMCPServers(parent *core.ToolRegistry, capabilities []string, permissionMode string, mcpServers []string, disallowed ...[]string) (*core.ToolRegistry, error)
func BuildCapabilityRegistry ¶ added in v0.1.30
func BuildCapabilityRegistry(parent *core.ToolRegistry, capabilities []string) (*core.ToolRegistry, error)
func BuildReadOnlyRegistry ¶
func BuildReadOnlyRegistry(parent *core.ToolRegistry) (*core.ToolRegistry, error)
func CapabilityTools ¶ added in v0.1.30
func CapabilityToolsForPermission ¶ added in v0.1.34
func ReadOnlyTools ¶
func ReadOnlyTools(parent *core.ToolRegistry) []core.Tool
func ResolveAgentHooks ¶ added in v0.1.34
func ResolveAgentHooks(def AgentDefinition) ([]agent.ResolvedHook, error)
ResolveAgentHooks converts durable agent-definition hook metadata into the concrete hook runner used by child agents. It accepts Claude Code style command, shell, prompt, http, and agent hooks; runtime execution is handled by the agent hook runner plus task-runner model executors.
func ValidAgentDefinitionName ¶ added in v0.1.34
Types ¶
type AgentDefinition ¶ added in v0.1.33
type AgentDefinition struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
WhenToUse string `json:"whenToUse,omitempty"`
Prompt string `json:"prompt,omitempty"`
Tools []string `json:"tools,omitempty"`
DisallowedTools []string `json:"disallowedTools,omitempty"`
Skills []string `json:"skills,omitempty"`
MCPServers []string `json:"mcpServers,omitempty"`
Hooks any `json:"hooks,omitempty"`
Model string `json:"model,omitempty"`
Effort string `json:"effort,omitempty"`
PermissionMode string `json:"permissionMode,omitempty"`
MaxToolIters int `json:"maxToolIters,omitempty"`
MaxToolCalls int `json:"maxToolCalls,omitempty"`
MaxTurns int `json:"maxTurns,omitempty"`
InitialPrompt string `json:"initialPrompt,omitempty"`
Memory string `json:"memory,omitempty"`
Background bool `json:"background,omitempty"`
Isolation string `json:"isolation,omitempty"`
Generation AgentGenerationConfig `json:"generation,omitempty"`
}
AgentDefinition is the durable contract for child-agent execution. Workflow agent calls and spawn_subagent requests should converge here before tools, model, and runtime limits are resolved.
type AgentDefinitionLibrary ¶ added in v0.1.34
type AgentDefinitionLibrary struct {
Roots []AgentDefinitionRoot
Definitions []AgentDefinition
}
func NewAgentDefinitionLibrary ¶ added in v0.1.34
func NewAgentDefinitionLibrary(workspaceRoot string) *AgentDefinitionLibrary
func NewAgentDefinitionLibraryWithDefinitions ¶ added in v0.1.34
func NewAgentDefinitionLibraryWithDefinitions(workspaceRoot string, definitions []AgentDefinition) *AgentDefinitionLibrary
func NewAgentDefinitionLibraryWithRoots ¶ added in v0.1.34
func NewAgentDefinitionLibraryWithRoots(roots []AgentDefinitionRoot) *AgentDefinitionLibrary
func (*AgentDefinitionLibrary) List ¶ added in v0.1.34
func (l *AgentDefinitionLibrary) List(ctx context.Context) ([]AgentDefinition, error)
func (*AgentDefinitionLibrary) Resolve ¶ added in v0.1.34
func (l *AgentDefinitionLibrary) Resolve(name string) (AgentDefinition, bool, error)
type AgentDefinitionRoot ¶ added in v0.1.34
type AgentGenerationConfig ¶ added in v0.1.35
type AgentRuntimeConfig ¶ added in v0.1.34
type AgentRuntimeConfig struct {
Definition AgentDefinition
Model string
Effort string
MaxToolIters int
MaxToolCalls int
MaxTurns int
ToolSelectors []string
DisallowedTools []string
MCPServers []string
Hooks []agent.ResolvedHook
PermissionProfile string
Isolation string
Skills []string
InitialPrompt string
Memory string
Generation AgentGenerationConfig
}
func ResolveAgentRuntimeConfig ¶ added in v0.1.34
func ResolveAgentRuntimeConfig(req SpawnSubagentRequest, defaults RunnerDefaults) (AgentRuntimeConfig, error)
func ResolveAgentRuntimeConfigWithLibrary ¶ added in v0.1.34
func ResolveAgentRuntimeConfigWithLibrary(req SpawnSubagentRequest, defaults RunnerDefaults, library *AgentDefinitionLibrary) (AgentRuntimeConfig, error)
type ParallelReasonRequest ¶
type ParallelReasonResponse ¶
type ParallelReasonResponse struct {
Model string `json:"model"`
Results []ParallelReasonResult `json:"results"`
Usage llm.Usage `json:"usage"`
}
type ParallelReasonResult ¶
type ProviderFactoryWithOptions ¶ added in v0.1.34
type ProviderFactoryWithOptions func(ProviderRequest) (llm.Provider, error)
type ProviderRequest ¶ added in v0.1.34
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func NewRunner ¶
func NewRunner(cfg RunnerConfig) *Runner
func (*Runner) AllowedSubagentTools ¶ added in v0.1.30
func (r *Runner) AllowedSubagentTools(req SpawnSubagentRequest) ([]string, error)
func (*Runner) CancelBackgroundSubagent ¶ added in v0.1.34
func (*Runner) ParallelReason ¶
func (r *Runner) ParallelReason(ctx context.Context, req ParallelReasonRequest) (ParallelReasonResponse, error)
func (*Runner) SpawnSubagent ¶
func (r *Runner) SpawnSubagent(ctx context.Context, req SpawnSubagentRequest) (SpawnSubagentResponse, error)
func (*Runner) SpawnSubagentWithProgress ¶
func (r *Runner) SpawnSubagentWithProgress(ctx context.Context, req SpawnSubagentRequest, progress func(core.ToolProgress)) (SpawnSubagentResponse, error)
func (*Runner) SubagentStatus ¶ added in v0.1.34
func (r *Runner) SubagentStatus(sessionID string) (session.SessionMeta, error)
type RunnerConfig ¶
type RunnerConfig struct {
ProviderFactory ProviderFactory
ProviderFactoryWithOptions ProviderFactoryWithOptions
ParentTools *core.ToolRegistry
WorkspaceTools WorkspaceToolRegistryFactory
AgentDefinitions *AgentDefinitionLibrary
ParentPolicy policy.ToolPolicy
MessageStore store.MessageStore
SessionsDir string
ParentSessionID string
ParentSessionIDFunc func() string
WorkspaceRoot string
MemoryEnabled bool
MemoryMaxChars int
MemoryFileOrder []string
SkillsDisabled []string
ExtraSkills []*skills.Skill
AutoCompact bool
AutoCompactThreshold float64
DefaultModel string
DefaultMaxTokens int
DefaultMaxToolIters int
SummaryMaxChars int
UsageLogPath string
ApprovalFunc policy.ApprovalFunc
}
type RunnerDefaults ¶ added in v0.1.34
type SpawnSubagentError ¶
func (*SpawnSubagentError) Error ¶
func (e *SpawnSubagentError) Error() string
func (*SpawnSubagentError) Unwrap ¶
func (e *SpawnSubagentError) Unwrap() error
type SpawnSubagentRequest ¶
type SpawnSubagentRequest struct {
Task string `json:"task"`
Role string `json:"role,omitempty"`
Agent AgentDefinition `json:"agent,omitempty"`
Model string `json:"model,omitempty"`
MaxToolIters int `json:"max_tool_iters,omitempty"`
MaxToolCalls int `json:"max_tool_calls,omitempty"`
Tools []string `json:"tools,omitempty"`
OutputSchema map[string]any `json:"output_schema,omitempty"`
ParentToolCallID string `json:"-"`
WorkflowRunID string `json:"-"`
WorkflowName string `json:"-"`
WorkflowPhase string `json:"-"`
WorkflowTaskID string `json:"-"`
WorkflowTaskLabel string `json:"-"`
}
type SpawnSubagentResponse ¶
type SpawnSubagentResponse struct {
SessionID string `json:"session_id"`
Role string `json:"role"`
Model string `json:"model"`
PermissionProfile string `json:"permission_profile"`
Status string `json:"status"`
Summary string `json:"summary"`
StructuredResult any `json:"structured_result,omitempty"`
Error string `json:"error,omitempty"`
Truncated bool `json:"truncated"`
ToolCalls []string `json:"tool_calls,omitempty"`
RequestedTools []string `json:"requested_tools,omitempty"`
ResolvedTools []string `json:"resolved_tools,omitempty"`
ToolMode string `json:"tool_mode,omitempty"`
Usage llm.Usage `json:"usage,omitempty"`
SubagentBudget SubagentBudget `json:"subagent_budget,omitempty"`
DurationMS int64 `json:"duration_ms"`
CompletedAt string `json:"completed_at"`
}
type SubagentBudget ¶ added in v0.1.38
type ToolWorkspace ¶ added in v0.1.34
type WorkspaceToolRegistryFactory ¶ added in v0.1.34
type WorkspaceToolRegistryFactory func(ToolWorkspace) (*core.ToolRegistry, error)
Click to show internal directories.
Click to hide internal directories.