Versions in this module Expand all Collapse all v1 v1.0.0 Feb 23, 2026 Changes in this version + const DispatchSourceTaskTool + const ModelHaiku + const ModelSonnet + const TypeExplore + const TypeGeneralPurpose + const TypePlan + var ErrDispatchUnauthorized = errors.New("subagents: dispatch not authorized") + var ErrDuplicateSubagent = errors.New("subagents: duplicate registration") + var ErrEmptyInstruction = errors.New("subagents: instruction is empty") + var ErrNoMatchingSubagent = errors.New("subagents: no matching subagent") + var ErrUnknownSubagent = errors.New("subagents: unknown target") + func WithContext(ctx context.Context, subCtx Context) context.Context + func WithDispatchSource(ctx context.Context, source string) context.Context + func WithTaskDispatch(ctx context.Context) context.Context + type Context struct + Metadata map[string]any + Model string + SessionID string + ToolWhitelist []string + func FromContext(ctx context.Context) (Context, bool) + func (c Context) Allows(tool string) bool + func (c Context) Clone() Context + func (c Context) RestrictTools(tools ...string) Context + func (c Context) ToolList() []string + func (c Context) WithMetadata(meta map[string]any) Context + func (c Context) WithSession(id string) Context + type Definition struct + BaseContext Context + DefaultModel string + Description string + Matchers []skills.Matcher + MutexKey string + Name string + Priority int + func BuiltinDefinition(name string) (Definition, bool) + func BuiltinDefinitions() []Definition + func (d Definition) Validate() error + type Handler interface + Handle func(context.Context, Context, Request) (Result, error) + type HandlerFunc func(context.Context, Context, Request) (Result, error) + func (fn HandlerFunc) Handle(ctx context.Context, subCtx Context, req Request) (Result, error) + type LoaderOptions struct + EnableUser bool + FS *config.FS + ProjectRoot string + UserHome string + type Manager struct + func NewManager() *Manager + func (m *Manager) Dispatch(ctx context.Context, req Request) (Result, error) + func (m *Manager) List() []Definition + func (m *Manager) Register(def Definition, handler Handler) error + type Request struct + Activation skills.ActivationContext + Instruction string + Metadata map[string]any + Target string + ToolWhitelist []string + type Result struct + Error string + Metadata map[string]any + Output any + Subagent string + type SubagentFile struct + Body string + Metadata SubagentMetadata + Name string + Path string + type SubagentMetadata struct + Description string + Model string + Name string + PermissionMode string + Skills string + Tools string + type SubagentRegistration struct + Definition Definition + Handler Handler + func LoadFromFS(opts LoaderOptions) ([]SubagentRegistration, []error)