Documentation
¶
Overview ¶
Package capability assembles optional coding-product behavior around the reusable agent SDK. It owns registration and composition only; permissions, persistence, and execution remain responsibilities of the coding engine.
Index ¶
- type Definition
- type Manifest
- type Registry
- func (r *Registry) AfterToolCall() func(agent.AfterToolCallCtx) *agent.AfterToolCallResult
- func (r *Registry) BeforeToolCall() func(agent.BeforeToolCallCtx) (bool, string)
- func (r *Registry) Manifests() []Manifest
- func (r *Registry) PromptSections() []string
- func (r *Registry) Register(def Definition) error
- func (r *Registry) ToolSource(name string) (string, bool)
- func (r *Registry) Tools() []tools.Tool
- type ToolContribution
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Definition ¶
type Definition struct {
Manifest Manifest
Tools []ToolContribution
PromptSections []string
BeforeToolCall func(agent.BeforeToolCallCtx) (block bool, reason string)
AfterToolCall func(agent.AfterToolCallCtx) *agent.AfterToolCallResult
}
Definition is the complete, build-time contribution of one capability. Hooks execute in capability registration order.
type Manifest ¶
Manifest identifies one capability contribution. Version is informational for built-in capabilities today and becomes the compatibility surface for a future external plugin adapter.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry collects capabilities while a coding session is being constructed. It is intentionally build-time only; callers should finish registration before handing its tools and hooks to an Agent.
func (*Registry) AfterToolCall ¶
func (r *Registry) AfterToolCall() func(agent.AfterToolCallCtx) *agent.AfterToolCallResult
AfterToolCall returns a hook that applies capability overrides in registration order. Each hook observes the result produced by earlier hooks.
func (*Registry) BeforeToolCall ¶
func (r *Registry) BeforeToolCall() func(agent.BeforeToolCallCtx) (bool, string)
BeforeToolCall returns the composed capability veto hook. The first block wins; a nil return means no capability registered this hook.
func (*Registry) Manifests ¶
Manifests returns registered capability metadata in registration order.
func (*Registry) PromptSections ¶
PromptSections returns stable system-prompt sections in registration order.
func (*Registry) Register ¶
func (r *Registry) Register(def Definition) error
Register validates and atomically adds one capability definition.
func (*Registry) ToolSource ¶
ToolSource returns the capability ID that currently provides name.
type ToolContribution ¶
ToolContribution is one tool registered by a capability. Replace must be set explicitly when a capability intentionally overrides an existing tool.