Documentation
¶
Index ¶
- Constants
- Variables
- func AddAgentFlag(cmd *cobra.Command, dest *string)
- func AddApprovalFlag(cmd *cobra.Command, dest *string)
- func AddAutoFlag(cmd *cobra.Command, dest *bool)
- func AddCommonFlags(cmd *cobra.Command, set CommonFlagSet, b CommonFlagBindings)
- func AddDebugFlag(cmd *cobra.Command, dest *bool)
- func AddFileFlag(cmd *cobra.Command, dest *[]string, description string)
- func AddMCPFlag(cmd *cobra.Command, dest *string)
- func AddMaxOutputTokensFlag(cmd *cobra.Command, dest *int)
- func AddMaxTurnsFlag(cmd *cobra.Command, dest *int, defaultValue int)
- func AddNativeSearchFlags(cmd *cobra.Command, native, noNative *bool)
- func AddNoWebFetchFlag(cmd *cobra.Command, dest *bool)
- func AddProviderFlag(cmd *cobra.Command, dest *string)
- func AddSearchFlags(cmd *cobra.Command, search, noSearch *bool)
- func AddSkillsFlag(cmd *cobra.Command, dest *string)
- func AddSystemMessageFlag(cmd *cobra.Command, dest *string)
- func AddToolFlags(cmd *cobra.Command, tools *string, readDirs, writeDirs, shellAllow *[]string)
- func AddYoloFlag(cmd *cobra.Command, dest *bool)
- func AgentFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func AgentFlagCompletionWithPaths(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func AtAgentCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func BindRootSession(ctx context.Context, store session.Store, sess *session.Session, ...) error
- func BindWorktreeSession(ctx context.Context, store session.Store, sess *session.Session, ...) error
- func CopilotScopeFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func EmbedProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func Execute()
- func ExtractAgentFromArgs(args []string) (agentName string, filteredArgs []string)
- func ImageProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func InitSessionStore(cfg *config.Config, errWriter io.Writer) (session.Store, func())
- func InjectSkillsMetadata(instructions string, skillsSetup *skills.Setup) string
- func ListAgentNames(cfg *config.Config) ([]string, error)
- func LoadAgent(agentName string, cfg *config.Config) (*agents.Agent, error)
- func MCPFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func MCPRunArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func MCPServerArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func MCPToolsFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func RegisterSkillToolWithEngine(engine *llm.Engine, toolMgr *tools.ToolManager, skillsSetup *skills.Setup)
- func RestoreWorktreeBinding(ctx context.Context, store session.Store, sess *session.Session, ...) error
- func SetupSkills(cfg *config.SkillsConfig, skillsFlag string, agentSkills string, ...) *skills.Setup
- func SetupSkillsInDir(cfg *config.SkillsConfig, skillsFlag string, agentSkills string, ...) *skills.Setup
- func SkillFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func SkillsFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ToolsFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func UsageProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func WireSpawnAgentRunner(cfg *config.Config, toolMgr *tools.ToolManager, yoloMode bool) error
- type CLIFlags
- type CommonFlagBindings
- type CommonFlagSet
- type CommonFlags
- type MCPOptions
- type ModelLister
- type ProviderInfo
- type SessionSettings
- type SpawnAgentRunner
- func NewSpawnAgentRunner(cfg *config.Config, yoloMode bool, parentApprovalMgr *tools.ApprovalManager) (*SpawnAgentRunner, error)
- func NewSpawnAgentRunnerWithStore(cfg *config.Config, yoloMode bool, parentApprovalMgr *tools.ApprovalManager, ...) (*SpawnAgentRunner, error)
- func WireSpawnAgentRunnerWithStore(cfg *config.Config, toolMgr *tools.ToolManager, yoloMode bool, ...) (*SpawnAgentRunner, error)
- func WireSpawnAgentRunnerWithStoreAndDepth(cfg *config.Config, toolMgr *tools.ToolManager, yoloMode bool, ...) (*SpawnAgentRunner, error)
- func (r *SpawnAgentRunner) RunAgent(ctx context.Context, agentName string, prompt string, depth int) (tools.SpawnAgentRunResult, error)
- func (r *SpawnAgentRunner) RunAgentWithCallback(ctx context.Context, agentName string, prompt string, depth int, callID string, ...) (tools.SpawnAgentRunResult, error)
- func (r *SpawnAgentRunner) RunAgentWithCallbackAndOptions(ctx context.Context, agentName string, prompt string, depth int, callID string, ...) (tools.SpawnAgentRunResult, error)
- func (r *SpawnAgentRunner) RunAgentWithOptions(ctx context.Context, agentName string, prompt string, depth int, ...) (tools.SpawnAgentRunResult, error)
- func (r *SpawnAgentRunner) RunChild(ctx context.Context, request runpkg.ChildRunRequest, ...) (runpkg.ChildRunResult, error)
- func (r *SpawnAgentRunner) SetBaseDir(dir string)
- func (r *SpawnAgentRunner) SetBaseDirFunc(fn func() string)
- func (r *SpawnAgentRunner) SetWarnFunc(fn func(format string, args ...any))
- func (r *SpawnAgentRunner) Wait()
- type ToolDefinition
Constants ¶
const ( CommonCoreFlags = CommonProvider | CommonDebug | CommonMCP | CommonTools | CommonSystemMessage | CommonApproval CommonSearchFlags = CommonSearch | CommonNativeSearch | CommonNoWebFetch )
Variables ¶
var Commit = "unknown"
var Date = "unknown"
var Version = "dev"
These will be set by the linker during build
Functions ¶
func AddAgentFlag ¶ added in v0.0.34
AddAgentFlag adds the --agent/-a flag with completion
func AddApprovalFlag ¶ added in v0.0.339
AddApprovalFlag adds the canonical approval mode flag.
func AddAutoFlag ¶ added in v0.0.317
AddAutoFlag adds the --auto flag for LLM-reviewed automatic shell approvals.
func AddCommonFlags ¶ added in v0.0.196
func AddCommonFlags(cmd *cobra.Command, set CommonFlagSet, b CommonFlagBindings)
AddCommonFlags adds a set of reusable flags to cmd and records the command's flag capabilities for pre-command flag normalization.
func AddDebugFlag ¶ added in v0.0.34
AddDebugFlag adds the --debug/-d flag
func AddFileFlag ¶ added in v0.0.34
AddFileFlag adds the --file/-f flag
func AddMCPFlag ¶ added in v0.0.34
AddMCPFlag adds the --mcp flag with completion
func AddMaxOutputTokensFlag ¶ added in v0.0.100
AddMaxOutputTokensFlag adds the --max-output-tokens flag
func AddMaxTurnsFlag ¶ added in v0.0.34
AddMaxTurnsFlag adds the --max-turns flag
func AddNativeSearchFlags ¶ added in v0.0.34
AddNativeSearchFlags adds --native-search and --no-native-search flags
func AddNoWebFetchFlag ¶ added in v0.0.118
AddNoWebFetchFlag adds --no-web-fetch to disable external read_url injection.
func AddProviderFlag ¶ added in v0.0.34
AddProviderFlag adds the --provider/-p flag with completion
func AddSearchFlags ¶ added in v0.0.294
AddSearchFlags adds the --search/-s and --no-search flags.
func AddSkillsFlag ¶ added in v0.0.37
AddSkillsFlag adds the --skills flag with completion Values: "all" or "*" to enable all, "none" to disable, skill names (comma-separated), or skill,+ for explicit + auto
func AddSystemMessageFlag ¶ added in v0.0.34
AddSystemMessageFlag adds the --system-message/-m flag
func AddToolFlags ¶ added in v0.0.34
AddToolFlags adds tool-related flags (--tools, --read-dir, --write-dir, --shell-allow)
func AddYoloFlag ¶ added in v0.0.35
AddYoloFlag adds the --yolo flag for auto-approving all tool operations
func AgentFlagCompletion ¶ added in v0.0.33
func AgentFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
AgentFlagCompletion provides shell completion for the --agent flag.
func AgentFlagCompletionWithPaths ¶ added in v0.0.65
func AgentFlagCompletionWithPaths(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
AgentFlagCompletionWithPaths provides shell completion for the --agent flag. Returns agent names for plain strings, or falls back to directory completion when the input looks like a path.
func AtAgentCompletion ¶ added in v0.0.33
func AtAgentCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
AtAgentCompletion provides completions for @agent syntax in positional args. When typing "@<TAB>", completes to "@agent-builder", "@commit", etc.
func BindRootSession ¶ added in v0.0.321
func BindRootSession(ctx context.Context, store session.Store, sess *session.Session, toolMgr *tools.ToolManager, rootDir string) error
BindRootSession clears a worktree binding and roots tools at rootDir.
func BindWorktreeSession ¶ added in v0.0.321
func BindWorktreeSession(ctx context.Context, store session.Store, sess *session.Session, toolMgr *tools.ToolManager, dir string) error
BindWorktreeSession binds a session/tool manager to dir using the unified BaseDir mechanism. It never calls os.Chdir.
func CopilotScopeFlagCompletion ¶ added in v0.0.275
func CopilotScopeFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
CopilotScopeFlagCompletion handles --copilot-scope completion for the usage command.
func EmbedProviderFlagCompletion ¶ added in v0.0.83
func EmbedProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
EmbedProviderFlagCompletion handles --provider flag completion for embed commands
func ExtractAgentFromArgs ¶ added in v0.0.33
ExtractAgentFromArgs checks args for @agent-name syntax and returns the agent name and filtered args. Returns empty string if no @agent found.
func ImageProviderFlagCompletion ¶ added in v0.0.6
func ImageProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ImageProviderFlagCompletion handles --provider flag completion for image commands
func InitSessionStore ¶ added in v0.0.46
InitSessionStore creates a session store if enabled in config. Returns the store (may be nil if disabled) and a cleanup function. The cleanup function is always safe to call (handles nil store). Warnings are written to errWriter.
func InjectSkillsMetadata ¶ added in v0.0.89
InjectSkillsMetadata appends <available_skills> metadata to instructions when available.
func ListAgentNames ¶ added in v0.0.134
ListAgentNames returns all available agent names for completions.
func LoadAgent ¶ added in v0.0.34
LoadAgent loads and validates an agent by name or path. Returns nil if agentName is empty. If agentName contains a path separator, it is loaded directly from the filesystem. Otherwise, it is looked up in the agent registry.
func MCPFlagCompletion ¶ added in v0.0.15
func MCPFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
MCPFlagCompletion provides completions for --mcp flag with comma-separated support. When typing "playwright,file<TAB>", completes to "playwright,filesystem".
func MCPRunArgCompletion ¶ added in v0.0.64
func MCPRunArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
MCPRunArgCompletion provides completions for "mcp run <server> <tool> [key=val] ...". Completes server names for the first arg, tool names and key= params for subsequent args. Tool/param data comes only from the local cache populated by "mcp info" and "mcp run". Shell completion must stay fast and must not cold-start external MCP servers.
func MCPServerArgCompletion ¶ added in v0.0.23
func MCPServerArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
MCPServerArgCompletion provides completions for MCP server names as positional arguments. Used by commands like "mcp info <server>", "mcp run <server>" and "mcp remove <server>".
func MCPToolsFlagCompletion ¶ added in v0.0.128
func MCPToolsFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
MCPToolsFlagCompletion provides completions for the --tools flag on serve mcp.
func ProviderFlagCompletion ¶ added in v0.0.6
func ProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ProviderFlagCompletion handles --provider flag completion for LLM commands
func RegisterSkillToolWithEngine ¶ added in v0.0.89
func RegisterSkillToolWithEngine(engine *llm.Engine, toolMgr *tools.ToolManager, skillsSetup *skills.Setup)
RegisterSkillToolWithEngine registers activate_skill on the engine when skills are available. This is independent of local tool manager setup so skills work in both agent-only and tools modes.
func RestoreWorktreeBinding ¶ added in v0.0.321
func RestoreWorktreeBinding(ctx context.Context, store session.Store, sess *session.Session, toolMgr *tools.ToolManager) error
RestoreWorktreeBinding validates and reapplies a persisted binding. If the worktree is gone, it clears the binding and falls back to the recorded CWD/root.
func SetupSkills ¶ added in v0.0.46
func SetupSkills(cfg *config.SkillsConfig, skillsFlag string, agentSkills string, errWriter io.Writer) *skills.Setup
SetupSkills initializes the skills system if enabled. Returns the setup (may be nil) and logs warnings to errWriter on errors. Precedence: CLI --skills flag > agent skills config > global config.
func SetupSkillsInDir ¶ added in v0.0.321
func SetupSkillsInDir(cfg *config.SkillsConfig, skillsFlag string, agentSkills string, errWriter io.Writer, projectDir string) *skills.Setup
SetupSkillsInDir initializes skills relative to projectDir without changing CWD.
func SkillFlagCompletion ¶ added in v0.0.37
func SkillFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
SkillFlagCompletion provides shell completion for skill-related flags.
func SkillsFlagCompletion ¶ added in v0.0.37
func SkillsFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
SkillsFlagCompletion provides shell completion for the --skills flag.
func ToolsFlagCompletion ¶ added in v0.0.25
func ToolsFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ToolsFlagCompletion provides completions for --tools flag with comma-separated support. When typing "read_file,wr<TAB>", completes to "read_file,write_file".
func UsageProviderFlagCompletion ¶ added in v0.0.34
func UsageProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
UsageProviderFlagCompletion handles --provider flag completion for the usage command. Returns the specific providers that the usage command supports.
func WireSpawnAgentRunner ¶ added in v0.0.35
WireSpawnAgentRunner sets up the spawn_agent runner if the tool is enabled. This should be called after SetupToolManager. The toolMgr's ApprovalMgr is passed to sub-agents so they inherit session approvals and can use the parent's prompt function for interactive approvals.
Types ¶
type CLIFlags ¶ added in v0.0.34
type CLIFlags struct {
Provider string
Tools string
ReadDirs []string
WriteDirs []string
ShellAllow []string
MCP string
SystemMessage string
MaxTurns int
MaxTurnsSet bool // true if --max-turns was explicitly set
MaxOutputTokens int // 0 = use provider default
Search bool
NoSearch bool
Files []string // files passed via -f flag, used for agent template expansion (e.g., {{.Files}})
Platform string // runtime surface for template expansion (e.g., chat, console, web, telegram, jobs)
}
CLIFlags holds the CLI flag values that can override settings.
type CommonFlagBindings ¶ added in v0.0.196
type CommonFlagBindings struct {
Provider *string
Debug *bool
Search *bool
NoSearch *bool
NativeSearch *bool
NoNativeSearch *bool
NoWebFetch *bool
MCP *string
Tools *string
ReadDirs *[]string
WriteDirs *[]string
ShellAllow *[]string
SystemMessage *string
Approval *string
Yolo *bool
Auto *bool
Skills *string
MaxTurns *int
MaxTurnsDefault int
MaxOutputTokens *int
Agent *string
Files *[]string
FilesDescription string
}
CommonFlagBindings holds destinations and options for AddCommonFlags.
type CommonFlagSet ¶ added in v0.0.196
type CommonFlagSet uint64
CommonFlagSet identifies reusable groups of flags shared by LLM commands.
const ( CommonProvider CommonFlagSet = 1 << iota CommonDebug CommonSearch CommonNativeSearch CommonNoWebFetch CommonMCP CommonTools CommonSystemMessage CommonApproval CommonSkills // Tier 2 / non-position-0 flags. These can use the common registration // helper without becoming eligible for pre-command normalization. CommonMaxTurns CommonMaxOutputTokens CommonAgent CommonFiles )
type CommonFlags ¶ added in v0.0.34
type CommonFlags = CommonFlagBindings
CommonFlags is kept as a backwards-compatible alias for common flag bindings.
type MCPOptions ¶ added in v0.0.39
MCPOptions contains options for enabling MCP servers.
type ModelLister ¶ added in v0.0.8
ModelLister is an interface for providers that can list available models
type ProviderInfo ¶ added in v0.0.32
type ProviderInfo struct {
Name string `json:"name"`
Type string `json:"type"`
Credential string `json:"credential"` // "api_key", "oauth", "aws", "none"
EnvVar string `json:"env_var,omitempty"` // Environment variable for API key
RequiresKey bool `json:"requires_key"` // Whether API key is required
SupportsListModels bool `json:"supports_list_models"`
Models []string `json:"models,omitempty"` // Curated model list
Configured bool `json:"configured"` // Whether provider is in user config
IsBuiltin bool `json:"is_builtin"` // Whether this is a built-in provider
}
ProviderInfo describes a provider for external consumption
type SessionSettings ¶ added in v0.0.34
type SessionSettings struct {
// Provider/model
Provider string
Model string
// Agent name (if any)
AgentName string
PlanGuidance bool // Built-in developer's callable-only update_plan guidance
// Session ID (if any)
SessionID string
// Tool settings
Tools string
ReadDirs []string
WriteDirs []string
ShellAllow []string
ShellAutoRun bool
Scripts []string
Spawn tools.SpawnConfig
// BaseDir is the unified per-session working directory for all tools. It is
// threaded through ToolConfig and never applied with os.Chdir.
BaseDir string
// Agent directory (for run_agent_script and custom tools)
AgentDir string
// ShellWorkingDir roots the shell tool's command execution (exec.Cmd.Dir) at
// a per-run directory without a process-wide os.Chdir. Empty preserves the
// default (the process working directory).
ShellWorkingDir string
// CustomTools holds script-backed custom tool definitions from agent.yaml
CustomTools []agents.CustomToolDef
// MCP servers (comma-separated)
MCP string
// System prompt (already expanded)
SystemPrompt string
// Behavior
MaxTurns int
MaxOutputTokens int // 0 = use provider default
Search bool
// Memory / insights
InsightsExpansion bool
InsightsMaxTokens int // 0 → default 500
}
SessionSettings holds the resolved settings for a session, merged from config defaults, agent settings, and CLI flags.
func ResolveSettings ¶ added in v0.0.34
func ResolveSettings(cfg *config.Config, agent *agents.Agent, cli CLIFlags, configProvider, configModel, configInstructions string, configMaxTurns, defaultMaxTurns int) (SessionSettings, error)
ResolveSettings merges config, agent, and CLI flags into final settings. Priority: CLI > agent > config
func ResolveSettingsInDir ¶ added in v0.0.321
func ResolveSettingsInDir(cfg *config.Config, agent *agents.Agent, cli CLIFlags, configProvider, configModel, configInstructions string, configMaxTurns, defaultMaxTurns int, runtimeDir string) (SessionSettings, error)
ResolveSettingsInDir resolves settings using runtimeDir for project-sensitive template values and instruction discovery without changing process CWD.
func (*SessionSettings) SetupToolManager ¶ added in v0.0.34
func (s *SessionSettings) SetupToolManager(cfg *config.Config, engine *llm.Engine) (*tools.ToolManager, error)
SetupToolManager creates and configures a ToolManager from settings. Returns nil if no tools are enabled.
type SpawnAgentRunner ¶ added in v0.0.35
type SpawnAgentRunner struct {
// contains filtered or unexported fields
}
SpawnAgentRunner implements the tools.SpawnAgentRunner interface. It loads and runs sub-agents for the spawn_agent tool.
func NewSpawnAgentRunner ¶ added in v0.0.35
func NewSpawnAgentRunner(cfg *config.Config, yoloMode bool, parentApprovalMgr *tools.ApprovalManager) (*SpawnAgentRunner, error)
NewSpawnAgentRunner creates a new SpawnAgentRunner. parentApprovalMgr enables sub-agents to inherit parent's session approvals and prompting.
func NewSpawnAgentRunnerWithStore ¶ added in v0.0.46
func NewSpawnAgentRunnerWithStore(cfg *config.Config, yoloMode bool, parentApprovalMgr *tools.ApprovalManager, store session.Store, parentSessionID string) (*SpawnAgentRunner, error)
NewSpawnAgentRunnerWithStore creates a new SpawnAgentRunner with session tracking. store is used to save subagent turns, parentSessionID links child sessions to parent.
func WireSpawnAgentRunnerWithStore ¶ added in v0.0.46
func WireSpawnAgentRunnerWithStore(cfg *config.Config, toolMgr *tools.ToolManager, yoloMode bool, store session.Store, parentSessionID string) (*SpawnAgentRunner, error)
WireSpawnAgentRunnerWithStore sets up the spawn_agent runner with session tracking. store is used to save subagent turns, parentSessionID links child sessions to parent. Returns the runner so callers can call Wait() to drain in-flight runs before closing the store.
func WireSpawnAgentRunnerWithStoreAndDepth ¶ added in v0.0.320
func WireSpawnAgentRunnerWithStoreAndDepth(cfg *config.Config, toolMgr *tools.ToolManager, yoloMode bool, store session.Store, parentSessionID string, depth int) (*SpawnAgentRunner, error)
WireSpawnAgentRunnerWithStoreAndDepth is WireSpawnAgentRunnerWithStore with an explicit current depth for nested spawn_agent tools.
func (*SpawnAgentRunner) RunAgent ¶ added in v0.0.35
func (r *SpawnAgentRunner) RunAgent(ctx context.Context, agentName string, prompt string, depth int) (tools.SpawnAgentRunResult, error)
RunAgent loads and runs a sub-agent with the given prompt. It returns the text output from the agent.
func (*SpawnAgentRunner) RunAgentWithCallback ¶ added in v0.0.42
func (r *SpawnAgentRunner) RunAgentWithCallback(ctx context.Context, agentName string, prompt string, depth int, callID string, cb tools.SubagentEventCallback) (tools.SpawnAgentRunResult, error)
RunAgentWithCallback loads and runs a sub-agent with an event callback for progress reporting.
func (*SpawnAgentRunner) RunAgentWithCallbackAndOptions ¶ added in v0.0.250
func (r *SpawnAgentRunner) RunAgentWithCallbackAndOptions(ctx context.Context, agentName string, prompt string, depth int, callID string, cb tools.SubagentEventCallback, opts tools.SpawnAgentRunOptions) (tools.SpawnAgentRunResult, error)
RunAgentWithCallbackAndOptions loads and runs a sub-agent with an event callback and call-specific overrides.
func (*SpawnAgentRunner) RunAgentWithOptions ¶ added in v0.0.250
func (r *SpawnAgentRunner) RunAgentWithOptions(ctx context.Context, agentName string, prompt string, depth int, opts tools.SpawnAgentRunOptions) (tools.SpawnAgentRunResult, error)
RunAgentWithOptions loads and runs a sub-agent with call-specific overrides.
func (*SpawnAgentRunner) RunChild ¶ added in v0.0.337
func (r *SpawnAgentRunner) RunChild(ctx context.Context, request runpkg.ChildRunRequest, callback runpkg.ChildRunEventCallback) (runpkg.ChildRunResult, error)
RunChild executes the generic child-runtime contract used by direct isolated skills. spawn_agent is an adapter over the same internal path.
func (*SpawnAgentRunner) SetBaseDir ¶ added in v0.0.321
func (r *SpawnAgentRunner) SetBaseDir(dir string)
SetBaseDir sets the fallback per-session BaseDir inherited by spawned agents.
func (*SpawnAgentRunner) SetBaseDirFunc ¶ added in v0.0.332
func (r *SpawnAgentRunner) SetBaseDirFunc(fn func() string)
SetBaseDirFunc sets a resolver for the parent's current BaseDir. Interactive sessions can switch worktrees after the runner is wired, so a copied path is not sufficient. It must be configured before the runner is installed on a SpawnAgentTool; the resolver itself must be safe for concurrent calls.
func (*SpawnAgentRunner) SetWarnFunc ¶ added in v0.0.46
func (r *SpawnAgentRunner) SetWarnFunc(fn func(format string, args ...any))
SetWarnFunc sets a function to be called when non-fatal warnings occur (e.g., session persistence failures). If not set, warnings are logged via log.Printf.
func (*SpawnAgentRunner) Wait ¶ added in v0.0.151
func (r *SpawnAgentRunner) Wait()
Wait permanently prevents new agent runs from starting, then blocks until all admitted runs have completed. The runner cannot be reused after Wait. Call this before closing the session store.
type ToolDefinition ¶ added in v0.0.25
type ToolDefinition struct {
Name string `json:"name"`
Description string `json:"description"`
Schema json.RawMessage `json:"schema"`
}
ToolDefinition represents a tool definition passed to the MCP server
Source Files
¶
- agent_model.go
- agents.go
- approval_mode.go
- ask.go
- ask_json.go
- ask_progressive.go
- audio.go
- auth.go
- bootstrap.go
- chat.go
- child_skill.go
- completion.go
- config.go
- config_theme.go
- contain.go
- debug_log.go
- edit.go
- edit_match.go
- embed.go
- exec.go
- filetrack.go
- flags.go
- goal_runtime.go
- guardian_wiring.go
- image.go
- image_resize.go
- jobs.go
- loop.go
- mcp.go
- mcp_server.go
- memory.go
- memory_completions.go
- memory_consolidate.go
- memory_fragments.go
- memory_freshen.go
- memory_images.go
- memory_insights.go
- memory_mine.go
- memory_mine_budget.go
- memory_mine_stats.go
- memory_mine_tools_runtime.go
- memory_promote.go
- memory_recent_file.go
- memory_recent_lock_unix.go
- memory_search.go
- memory_shared.go
- memory_status.go
- models.go
- music.go
- notify.go
- notify_telegram.go
- notify_web.go
- output_tool.go
- pprof.go
- precommand_completion.go
- precommand_flags.go
- progressive.go
- providers.go
- reload_exec.go
- root.go
- runner.go
- serve.go
- serve_approval.go
- serve_approval_handler.go
- serve_ask_user.go
- serve_ask_user_handler.go
- serve_ask_user_state_handler.go
- serve_compaction.go
- serve_compaction_handler.go
- serve_file_changes.go
- serve_handlers.go
- serve_handlers_anthropic.go
- serve_handlers_chat.go
- serve_handlers_responses.go
- serve_handlers_status.go
- serve_hub.go
- serve_hub_auth.go
- serve_hub_cmd.go
- serve_hub_delegations.go
- serve_hub_delegations_jobs.go
- serve_hub_delegations_state.go
- serve_hub_index.go
- serve_hub_nodes.go
- serve_hub_prefix.go
- serve_hub_proxy.go
- serve_hub_registration.go
- serve_hub_reverse.go
- serve_hub_reverse_connector.go
- serve_jobs_v2.go
- serve_jobs_v2_notify.go
- serve_mcp.go
- serve_mcp_handler.go
- serve_model_swap.go
- serve_protocol.go
- serve_protocol_anthropic.go
- serve_protocol_chat.go
- serve_protocol_responses.go
- serve_response_runs.go
- serve_responses_durable.go
- serve_runtime.go
- serve_session.go
- serve_side_question.go
- serve_skills.go
- serve_streaming_writer.go
- serve_transcribe.go
- serve_transcript.go
- serve_ui_state.go
- serve_ui_stream.go
- serve_webrtc.go
- serve_widgets.go
- serve_worktrees.go
- session.go
- sessions.go
- sessions_autotitle.go
- skills.go
- spawn_runner.go
- stats.go
- subagent_progress_dispatcher.go
- tools.go
- transcribe.go
- upgrade.go
- usage.go
- version.go
- video.go
- worktree_binding.go