Documentation
¶
Index ¶
- Constants
- Variables
- func ActiveSkillsFromHistory(history *binding.History) []string
- func ConstraintMetadata(c *Constraints) map[string]interface{}
- func ExpandDefinitionsForActiveSkills(defs []*llm.ToolDefinition, reg tool.Registry, skills []*skillproto.Skill) []*llm.ToolDefinition
- func ExpandDefinitionsForActiveSkillsWithDiag(defs []*llm.ToolDefinition, reg tool.Registry, skills []*skillproto.Skill) ([]*llm.ToolDefinition, []string)
- func ExpandDefinitionsForConstraints(defs []*llm.ToolDefinition, reg tool.Registry, c *Constraints) []*llm.ToolDefinition
- func ExpandDefinitionsForConstraintsWithDiag(defs []*llm.ToolDefinition, reg tool.Registry, c *Constraints) (out []*llm.ToolDefinition, unmatched []string)
- func InlineActiveSkillsFromHistory(history *binding.History, svc *Service, agent *agentmdl.Agent, ...) []string
- func ValidateExecution(ctx context.Context, toolName string, args map[string]interface{}) error
- func WithActivationModeOverride(ctx context.Context, name, mode string) context.Context
- func WithConstraints(ctx context.Context, c *Constraints) context.Context
- func WithRuntimeState(ctx context.Context, svc *Service, agent *agentmdl.Agent, activeNames []string) context.Context
- type ActivateInput
- type ActivateOutput
- type Constraints
- type ListInput
- type ListOutput
- type RuntimeState
- type Service
- func (s *Service) Activate(agent *agentmdl.Agent, name, args string) (string, error)
- func (s *Service) ActivateByPathForConversation(ctx context.Context, conversationID, skillPath, args string) (string, error)
- func (s *Service) ActivateForConversation(ctx context.Context, conversationID, name, args string) (string, error)
- func (s *Service) ActivateForConversationWithAgent(ctx context.Context, conversationID string, agent *agentmdl.Agent, ...) (string, error)
- func (s *Service) Diagnostics() []string
- func (s *Service) ListAll() []skillproto.Metadata
- func (s *Service) ListForConversation(ctx context.Context, conversationID string) ([]skillproto.Metadata, []string, error)
- func (s *Service) Load(ctx context.Context) error
- func (s *Service) Method(name string) (svc.Executable, error)
- func (s *Service) Methods() svc.Signatures
- func (s *Service) Name() string
- func (s *Service) Resolve(agent *agentmdl.Agent, name string) (*skillproto.Skill, error)
- func (s *Service) SetStreamPublisher(p streaming.Publisher)
- func (s *Service) Visible(agent *agentmdl.Agent) ([]skillproto.Metadata, string)
- func (s *Service) VisibleSkillsByName(agent *agentmdl.Agent, names []string) []*skillproto.Skill
- type Watcher
Constants ¶
const Name = skillproto.ServiceName
Variables ¶
"skill requested fork/detach but ExecFn (used for both llm/agents:start and llm/agents:status) is not bound")
ErrForkCapabilityUnavailable signals that a skill requested fork or detach activation but the runtime executor (ExecFn) is not bound. ExecFn is the single function-pointer dependency for both `llm/agents:start` (kicks off the child conversation) and `llm/agents:status` (polls for terminal state); when nil, neither operation can run, so the skill cannot execute in a child context.
Callers receiving this error can degrade to inline activation, surface a configuration warning to the user, or fail the turn — runtime policy decision. The error is detectable via errors.Is so it survives wrapping.
Functions ¶
func ActiveSkillsFromHistory ¶
func ConstraintMetadata ¶
func ConstraintMetadata(c *Constraints) map[string]interface{}
func ExpandDefinitionsForActiveSkills ¶
func ExpandDefinitionsForActiveSkills(defs []*llm.ToolDefinition, reg tool.Registry, skills []*skillproto.Skill) []*llm.ToolDefinition
ExpandDefinitionsForActiveSkills returns the widened tool surface for the given active skills, ignoring any unmatched-pattern diagnostics. Existing callers that don't observe diagnostics use this.
func ExpandDefinitionsForActiveSkillsWithDiag ¶
func ExpandDefinitionsForActiveSkillsWithDiag(defs []*llm.ToolDefinition, reg tool.Registry, skills []*skillproto.Skill) ([]*llm.ToolDefinition, []string)
ExpandDefinitionsForActiveSkillsWithDiag returns the widened tool surface AND a list of allowed-tools patterns from the active skills that did not resolve to any registered tool. Callers can convert the unmatched list into warn-level skillproto.Diagnostics surfaced on the activation event so the model and operators see "skill 'X' requested tool 'Y' which is not available in the current agent's tool registry."
Returns an empty unmatched slice when nothing is missing.
func ExpandDefinitionsForConstraints ¶
func ExpandDefinitionsForConstraints(defs []*llm.ToolDefinition, reg tool.Registry, c *Constraints) []*llm.ToolDefinition
ExpandDefinitionsForConstraints rewrites the tool surface for the service families named by `allowed-tools` and preserves unrelated tool families.
Example: when a skill allows only `system/exec:execute`, the parent's `system/exec:start|cancel|status` tools are removed from the presented surface and only `execute` is re-added. Unrelated tools such as `prompt:list` or `llm/skills:list` remain available.
Wraps ExpandDefinitionsForConstraintsWithDiag and discards the unmatched pattern list. Callers that want to surface "skill requested an unavailable tool" diagnostics should call the WithDiag variant directly.
func ExpandDefinitionsForConstraintsWithDiag ¶
func ExpandDefinitionsForConstraintsWithDiag(defs []*llm.ToolDefinition, reg tool.Registry, c *Constraints) (out []*llm.ToolDefinition, unmatched []string)
ExpandDefinitionsForConstraintsWithDiag is identical to ExpandDefinitionsForConstraints but additionally returns the list of allowed-tools patterns that did not match any registered tool. The runtime can convert these into warn-level skillproto.Diagnostics surfaced on the activation event so the model and operators see "skill 'X' requested tool 'Y' which is not available in the current agent's tool registry."
Returns an empty unmatched slice (not nil) when nothing is missing. Returns nil unmatched when c, reg, or c.ToolPatterns is empty (no expansion attempted).
func ValidateExecution ¶
func WithConstraints ¶
func WithConstraints(ctx context.Context, c *Constraints) context.Context
Types ¶
type ActivateInput ¶
type ActivateOutput ¶
type ActivateOutput struct {
Name string `json:"name,omitempty"`
Body string `json:"body,omitempty"`
Mode string `json:"mode,omitempty"`
Started bool `json:"started,omitempty"`
Terminal bool `json:"terminal,omitempty"`
Status string `json:"status,omitempty"`
ChildConversationID string `json:"childConversationId,omitempty"`
ChildAgentID string `json:"childAgentId,omitempty"`
}
type Constraints ¶
func BuildConstraints ¶
func BuildConstraints(skills []*skillproto.Skill) *Constraints
func ConstraintsFromContext ¶
func ConstraintsFromContext(ctx context.Context) (*Constraints, bool)
type ListOutput ¶
type ListOutput struct {
Items []skillproto.Metadata `json:"items,omitempty"`
Diagnostics []string `json:"diagnostics,omitempty"`
}
type RuntimeState ¶
type RuntimeState struct {
// contains filtered or unexported fields
}
func RuntimeStateFromContext ¶
func RuntimeStateFromContext(ctx context.Context) (*RuntimeState, bool)
func (*RuntimeState) Activate ¶
func (s *RuntimeState) Activate(name string)
func (*RuntimeState) Constraints ¶
func (s *RuntimeState) Constraints() *Constraints
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ActivateByPathForConversation ¶
func (*Service) ActivateForConversation ¶
func (*Service) ActivateForConversationWithAgent ¶
func (*Service) Diagnostics ¶
func (*Service) ListAll ¶
func (s *Service) ListAll() []skillproto.Metadata
func (*Service) ListForConversation ¶
func (*Service) Methods ¶
func (s *Service) Methods() svc.Signatures