bundle

package
v0.2.65 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultIconRef

func DefaultIconRef(service string) string

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.

func (*Bundle) Validate

func (b *Bundle) Validate() error

type MatchRule

type MatchRule struct {
	// Name is a tool match pattern (same semantics as tool pattern matching).
	Name string `yaml:"name" json:"name"`
	// Exclude subtracts patterns from the rule match set.
	Exclude []string `yaml:"exclude,omitempty" json:"exclude,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL