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 ExpandDefinitionsForConstraintsWithContext(ctx context.Context, defs []*llm.ToolDefinition, reg tool.Registry, ...) (out []*llm.ToolDefinition, unmatched []string)
- 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 GetInput
- type GetOutput
- type ListInput
- type ListOutput
- type MCPSource
- 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) ExportLocal(ctx context.Context, patterns []string) ([]*format.Static, error)
- func (s *Service) GetVisible(ctx context.Context, agent *agentmdl.Agent, name string) (*skillproto.Skill, error)
- func (s *Service) HasMCPSource() bool
- func (s *Service) ListAll() []skillproto.Metadata
- func (s *Service) ListForConversation(ctx context.Context, conversationID string) ([]skillproto.Metadata, []string, error)
- func (s *Service) ListForSelection(ctx context.Context, conversationID, agentID string) ([]skillproto.Metadata, []string, error)
- func (s *Service) ListVisible(ctx context.Context, agent *agentmdl.Agent) ([]skillproto.Metadata, 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) SetMCPSource(source MCPSource)
- func (s *Service) SetStreamPublisher(p streaming.Publisher)
- func (s *Service) SetToolRegistry(reg tool.Registry)
- func (s *Service) Visible(agent *agentmdl.Agent) ([]skillproto.Metadata, string)
- func (s *Service) VisibleSkillsByName(agent *agentmdl.Agent, names []string) []*skillproto.Skill
- func (s *Service) VisibleSkillsWithContext(ctx context.Context, 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 ExpandDefinitionsForConstraintsWithContext ¶ added in v0.1.40
func ExpandDefinitionsForConstraintsWithContext(ctx context.Context, defs []*llm.ToolDefinition, reg tool.Registry, c *Constraints) (out []*llm.ToolDefinition, unmatched []string)
ExpandDefinitionsForConstraintsWithContext preserves caller-scoped discovery.
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 ¶
type Constraints struct {
Denied bool
RemoteServers []string
ToolPatterns []string
ExecFirstTokenAllow []string
}
func BuildConstraints ¶
func BuildConstraints(skills []*skillproto.Skill) *Constraints
func ConstraintsFromContext ¶
func ConstraintsFromContext(ctx context.Context) (*Constraints, bool)
type GetOutput ¶ added in v0.1.51
type GetOutput struct {
Files []string `json:"files,omitempty"`
Blob string `json:"blob,omitempty"`
MimeType string `json:"mimeType,omitempty"`
RequestedTools string `json:"requestedTools,omitempty"`
Name string `json:"name"`
URI string `json:"uri,omitempty"`
Body string `json:"body"`
AllowedTools string `json:"allowedTools,omitempty"`
}
type ListOutput ¶
type ListOutput struct {
Items []skillproto.Metadata `json:"items,omitempty"`
Diagnostics []string `json:"diagnostics,omitempty"`
}
type MCPSource ¶ added in v0.1.51
type MCPSource interface {
Names(context.Context) ([]string, error)
Options(context.Context, string) (*mcpcfg.MCPClient, error)
Get(context.Context, string, string) (mcpclient.Interface, error)
WithAuthTokenContext(context.Context, string) context.Context
UseIDToken(context.Context, string) bool
}
MCPSource uses the manager's authenticated, principal-isolated connections. Implementations must resolve configuration locally in Names and Options.
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) ExportLocal ¶ added in v0.1.51
ExportLocal compiles operator-selected local skill trees. Remote skill federation is intentionally not re-exported, preventing aggregator cycles.
func (*Service) GetVisible ¶ added in v0.1.51
func (s *Service) GetVisible(ctx context.Context, agent *agentmdl.Agent, name string) (*skillproto.Skill, error)
GetVisible always re-resolves remote identity using the caller's server list. A URI is a reference, never an authorization grant or an upstream locator.
func (*Service) HasMCPSource ¶ added in v0.1.51
func (*Service) ListAll ¶
func (s *Service) ListAll() []skillproto.Metadata
func (*Service) ListForConversation ¶
func (*Service) ListForSelection ¶ added in v0.1.39
func (s *Service) ListForSelection(ctx context.Context, conversationID, agentID string) ([]skillproto.Metadata, []string, error)
ListForSelection supports the composer's selected agent before a conversation exists.
func (*Service) ListVisible ¶ added in v0.1.51
func (s *Service) ListVisible(ctx context.Context, agent *agentmdl.Agent) ([]skillproto.Metadata, error)
ListVisible is the only federated model catalog. Visible remains local-only for prompt binding so ordinary turns cause no remote discovery.
func (*Service) Methods ¶
func (s *Service) Methods() svc.Signatures
func (*Service) SetMCPSource ¶ added in v0.1.51
func (*Service) SetStreamPublisher ¶
func (*Service) SetToolRegistry ¶ added in v0.1.40
SetToolRegistry supplies request-scoped discovery for skill activation.
func (*Service) VisibleSkillsByName ¶
func (*Service) VisibleSkillsWithContext ¶ added in v0.1.51
func (s *Service) VisibleSkillsWithContext(ctx context.Context, agent *agentmdl.Agent, names []string) []*skillproto.Skill
VisibleSkillsWithContext restores identities under the current caller.