Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultIconRef ¶
DefaultIconRef returns an iconRef for well-known built-in tool services. UI is expected to resolve these IDs to PNG assets.
func ResolveDefinitions ¶
func ResolveDefinitions(b *Bundle, matchFn func(pattern string) []*llm.ToolDefinition) []llm.ToolDefinition
ResolveDefinitions expands bundle match rules into concrete tool definitions using matchFn. It applies rule-level excludes and de-duplicates by canonical tool name.
Types ¶
type Bundle ¶
type Bundle struct {
ID string `yaml:"id" json:"id"`
Title string `yaml:"title,omitempty" json:"title,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
// IconRef refers to a built-in icon identifier (UI-owned mapping).
IconRef string `yaml:"iconRef,omitempty" json:"iconRef,omitempty"`
// IconURI references a workspace-local image (workspace://... only).
IconURI string `yaml:"iconURI,omitempty" json:"iconURI,omitempty"`
Priority int `yaml:"priority,omitempty" json:"priority,omitempty"`
Match []MatchRule `yaml:"match,omitempty" json:"match,omitempty"`
}
Bundle groups tool patterns into a selectable unit. Bundles are global (workspace) and may be referenced by ID from agents or runtime inputs.
func DeriveBundles ¶
func DeriveBundles(defs []llm.ToolDefinition) []*Bundle
DeriveBundles groups concrete tool definitions by their service name and returns a default bundle list. It is used when no workspace bundles exist.
type MatchRule ¶
type MatchRule struct {
// Name is a tool match pattern (same semantics as tool pattern matching).
Name string `yaml:"name" json:"name"`
// ApprovalQueue configures personal approval queue behavior for matched tools.
ApprovalQueue *llm.ApprovalQueue `yaml:"approvalQueue,omitempty" json:"approvalQueue,omitempty"`
// Exclude subtracts patterns from the rule match set.
Exclude []string `yaml:"exclude,omitempty" json:"exclude,omitempty"`
}
type ResolveResult ¶
type ResolveResult struct {
Definitions []llm.ToolDefinition
ApprovalQueueByID map[string]*llm.ApprovalQueue
}
func ResolveDefinitionsWithOptions ¶
func ResolveDefinitionsWithOptions(b *Bundle, matchFn func(pattern string) []*llm.ToolDefinition) ResolveResult
ResolveDefinitionsWithOptions expands bundle match rules and returns both definitions and per-tool approval-queue flags.