toolcatalog

package
v0.9.1 Latest Latest
Warning

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

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

Documentation

Overview

Package toolcatalog provides compiled-in metadata for tools and capability tags, and renders capability surface descriptions for model-facing context and the web dashboard.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuiltinTagSpecs

func BuiltinTagSpecs() map[string]BuiltinTagSpec

BuiltinTagSpecs returns a copy of the compiled-in tag catalog.

func HasBuiltinTag

func HasBuiltinTag(name string) bool

HasBuiltinTag reports whether the name is a compiled-in tag.

func RenderCapabilityActivationDescription

func RenderCapabilityActivationDescription(entries []CapabilitySurface) string

RenderCapabilityActivationDescription renders the activate_capability tool help text from the shared capability surface.

func RenderCapabilityManifestMarkdown

func RenderCapabilityManifestMarkdown(entries []CapabilitySurface) string

RenderCapabilityManifestMarkdown renders the model-facing capability menu as a heading plus a compact JSON payload.

func RenderLoadedCapabilitySummary

func RenderLoadedCapabilitySummary(entries []CapabilitySurface, activeTags map[string]bool) string

RenderLoadedCapabilitySummary renders the currently loaded capabilities for always-on prompt context.

Types

type BuiltinTagSpec

type BuiltinTagSpec struct {
	Description  string
	AlwaysActive bool
	Menu         bool
	Protected    bool
}

BuiltinTagSpec captures compiled-in metadata for a tag/toolset.

type BuiltinToolSpec

type BuiltinToolSpec struct {
	CanonicalID string
	Source      ToolSource
	DefaultTags []string
}

BuiltinToolSpec captures compiled-in metadata for a tool.

func LookupBuiltinToolSpec

func LookupBuiltinToolSpec(name string) (BuiltinToolSpec, bool)

LookupBuiltinToolSpec returns the compiled-in tool spec for a tool name.

type CapabilityActionTools

type CapabilityActionTools struct {
	Activate   string `json:"activate"`
	Deactivate string `json:"deactivate"`
	Reset      string `json:"reset,omitempty"`
	List       string `json:"list,omitempty"`
	Delegate   string `json:"delegate,omitempty"`
}

CapabilityActionTools lists the tool names the model should use for capability lifecycle actions (activate, deactivate, reset, list).

type CapabilityCatalogEntry

type CapabilityCatalogEntry struct {
	Tag          string                    `json:"tag"`
	Status       string                    `json:"status"`
	Description  string                    `json:"description"`
	Teaser       string                    `json:"teaser,omitempty"`
	NextTags     []string                  `json:"next_tags,omitempty"`
	ToolCount    int                       `json:"tool_count,omitempty"`
	Tools        []string                  `json:"tools,omitempty"`
	AlwaysActive bool                      `json:"always_active,omitempty"`
	Protected    bool                      `json:"protected,omitempty"`
	AdHoc        bool                      `json:"ad_hoc,omitempty"`
	Context      *CapabilityContextSummary `json:"context,omitempty"`
}

CapabilityCatalogEntry is the API/model-facing representation of one capability in the full catalog view, including status and tool list.

type CapabilityCatalogView

type CapabilityCatalogView struct {
	Kind            string                   `json:"kind"`
	ActivationTools CapabilityActionTools    `json:"activation_tools"`
	Capabilities    []CapabilityCatalogEntry `json:"capabilities"`
}

CapabilityCatalogView is the top-level JSON-serializable view of the full capability catalog including activation tool names.

func BuildCapabilityCatalogView

func BuildCapabilityCatalogView(entries []CapabilitySurface, includeDelegate bool) CapabilityCatalogView

BuildCapabilityCatalogView assembles the full capability catalog view from resolved surface entries, ready for JSON serialization.

type CapabilityContextSummary

type CapabilityContextSummary struct {
	KBArticles int  `json:"kb_articles,omitempty"`
	Live       bool `json:"live,omitempty"`
}

CapabilityContextSummary describes the optional context payload associated with a capability entry (KB articles and live context).

type CapabilitySurface

type CapabilitySurface struct {
	Tag          string
	Description  string
	Teaser       string
	NextTags     []string
	Tools        []string
	AlwaysActive bool
	Menu         bool
	Protected    bool
	Loaded       bool
	KBArticles   int
	LiveContext  bool
	AdHoc        bool
}

CapabilitySurface captures the resolved model-facing view of a capability/toolset. It is intentionally transport-agnostic so prompt renderers, tool help text, and future caching/freshness policies can all work from the same semantic shape.

func BuildCapabilitySurface

func BuildCapabilitySurface(tags map[string][]string, descriptions map[string]string, alwaysActive map[string]bool, protected map[string]bool) []CapabilitySurface

BuildCapabilitySurface builds a sorted capability surface from tag membership and descriptions.

func SortCapabilitySurface

func SortCapabilitySurface(entries []CapabilitySurface) []CapabilitySurface

SortCapabilitySurface returns a sorted copy of the capability surface.

type LoadedCapabilityEntry

type LoadedCapabilityEntry struct {
	Tag          string                    `json:"tag"`
	Description  string                    `json:"description,omitempty"`
	ToolCount    int                       `json:"tool_count,omitempty"`
	AlwaysActive bool                      `json:"always_active,omitempty"`
	Protected    bool                      `json:"protected,omitempty"`
	AdHoc        bool                      `json:"ad_hoc,omitempty"`
	Context      *CapabilityContextSummary `json:"context,omitempty"`
}

LoadedCapabilityEntry is the API/model-facing representation of one currently loaded (active) capability in the session.

func BuildLoadedCapabilityEntries

func BuildLoadedCapabilityEntries(entries []CapabilitySurface, activeTags []string) []LoadedCapabilityEntry

BuildLoadedCapabilityEntries returns the loaded-capability entries for the given active tags, enriched with descriptions and context from the full surface.

type LoadedCapabilityView

type LoadedCapabilityView struct {
	Kind               string                  `json:"kind"`
	LoadedCapabilities []LoadedCapabilityEntry `json:"loaded_capabilities"`
}

LoadedCapabilityView is the JSON-serializable view of the currently loaded capabilities in a session.

func BuildLoadedCapabilityView

func BuildLoadedCapabilityView(entries []CapabilitySurface, activeTags []string, includeDelegate bool) LoadedCapabilityView

BuildLoadedCapabilityView assembles the loaded-capability JSON view for the given active tags.

type ToolSource

type ToolSource string

ToolSource identifies where a tool originates.

const (
	NativeToolSource ToolSource = "native"
	MCPToolSource    ToolSource = "mcp"
)

Jump to

Keyboard shortcuts

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