Documentation
¶
Overview ¶
Package command owns session-aware slash command projection and parsing.
Index ¶
Constants ¶
const ( MaxSkillBytes = 24_000 MaxInvokedSkillBytes = 64_000 )
Variables ¶
var ( ErrUnavailable = errors.New("command: unavailable") )
Functions ¶
func BuildInvokedSkillsBlock ¶
func BuildInvokedSkillsBlock(skills []InvokedSkill) string
BuildInvokedSkillsBlock renders verified explicit skill instructions for one turn. A body above MaxSkillBytes, or one that no longer fits the remaining MaxInvokedSkillBytes turn budget, is deferred instead of inlined: its entry keeps the source-bound identity and directs the agent to read the full body through compozy__skill_view, so an oversized skill never fails the prompt.
Types ¶
type BuiltinSpec ¶
BuiltinSpec describes one daemon-owned control command.
func DefaultBuiltins ¶
func DefaultBuiltins() []BuiltinSpec
DefaultBuiltins returns the complete reserved daemon command set.
type Catalog ¶
type Catalog struct {
Commands []Descriptor
Revision string
// contains filtered or unexported fields
}
Catalog is the deterministic command projection for one session snapshot.
func BuildCatalog ¶
func BuildCatalog(builtins []BuiltinSpec, agents []AgentSpec, skills []SkillSpec) (Catalog, error)
BuildCatalog merges daemon, ACP, and skill commands using the accepted precedence rules.
func SetBuiltinAvailability ¶
SetBuiltinAvailability updates one visible daemon-owned command while preserving catalog ordering and parser refusal state.
func WithoutBuiltin ¶
type Descriptor ¶
type Descriptor struct {
ID string `json:"id"`
CanonicalToken string `json:"canonical_token"`
DisplayName string `json:"display_name"`
Description string `json:"description"`
Lane Lane `json:"lane"`
Source Source `json:"source"`
Placements []Placement `json:"placements"`
InputHint string `json:"input_hint,omitempty"`
Available bool `json:"available"`
Skill *SkillRef `json:"-"`
}
Descriptor is one available slash command.
type Invocation ¶
type Invocation struct {
Ref SkillRef `json:"ref"`
Token string `json:"token"`
Start int `json:"start"`
End int `json:"end"`
}
Invocation records one exact skill marker found in authored text.
func ParseSkillInvocations ¶
func ParseSkillInvocations(text string, catalog Catalog) ([]Invocation, error)
ParseSkillInvocations resolves skill markers anywhere at a whitespace boundary.
func ReconcileInvocations ¶
func ReconcileInvocations(text string, admitted []Invocation) []Invocation
ReconcileInvocations narrows admitted refs to markers that survive a hook rewrite.
type InvokedSkill ¶
InvokedSkill pairs an admitted reference with its verified instruction body.
type Placement ¶
type Placement string
Placement identifies where a command may be selected from authored text.
type SkillRef ¶
type SkillRef struct {
CommandID string `json:"command_id"`
Name string `json:"name"`
Source Source `json:"source"`
}
SkillRef identifies one exact skill definition without exposing its path.