capability

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package capability owns the stable abilities exposed by the Runtime. Concrete tools are implementation details bound through provider adapters.

Index

Constants

View Source
const (
	InternetSearch     = "internet.search"
	InternetFetch      = "internet.fetch"
	GitHubSearch       = "github.search"
	WeatherCurrent     = "weather.current"
	MapsRoute          = "maps.route"
	FilesystemList     = "filesystem.list"
	FilesystemSearch   = "filesystem.search"
	FilesystemRead     = "filesystem.read"
	FilesystemEdit     = "filesystem.edit"
	FilesystemWrite    = "filesystem.write"
	PythonExecute      = "python.execute"
	SystemShell        = "system.shell"
	SystemWait         = "system.wait"
	BrowserSearch      = "browser.search"
	BrowserTask        = "browser.task"
	BrowserOpen        = "browser.open"
	BrowserNavigate    = "browser.navigate"
	BrowserLogin       = "browser.login"
	BrowserRead        = "browser.read"
	BrowserObserve     = "browser.observe"
	BrowserAction      = "browser.action"
	BrowserWait        = "browser.wait"
	BrowserDownload    = "browser.download"
	BrowserScreenshot  = "browser.screenshot"
	BrowserAutomation  = "browser.automation"
	BrowserClose       = "browser.close"
	DesktopAction      = "desktop.action"
	PlanningTodo       = "planning.todo"
	PlanningEnter      = "planning.enter"
	PlanningExit       = "planning.exit"
	TaskCreate         = "task.create"
	TaskGet            = "task.get"
	TaskList           = "task.list"
	TaskUpdate         = "task.update"
	InteractionAsk     = "interaction.ask"
	AutomationSchedule = "automation.schedule"
	ImageGenerate      = "media.image.generate"
	VideoGenerate      = "media.video.generate"
)

Variables

View Source
var GlobalRegistry = NewRegistry()

Functions

func ClientBoundModelNames added in v0.1.4

func ClientBoundModelNames() []string

ClientBoundModelNames returns the model function names of every registered client-bound capability in the global registry.

func IsClientBound added in v0.1.4

func IsClientBound(id string) bool

IsClientBound reports whether a capability executes on the user's device rather than on the server. Client-bound tools return an actionprotocol payload that must be dispatched through an OnAction sink, so they can only be fulfilled by the streaming execution path.

func ModelName

func ModelName(id string) string

ModelName encodes a dotted capability ID as an API-compatible function name.

func Wrap

func Wrap(definition Definition, provider tool.BaseTool) tool.BaseTool

Wrap exposes a concrete provider through a capability contract.

Types

type Definition

type Definition struct {
	ID          string            `json:"id" yaml:"id"`
	Description string            `json:"description" yaml:"description"`
	Input       map[string]string `json:"input,omitempty" yaml:"input,omitempty"`
	Output      string            `json:"output,omitempty" yaml:"output,omitempty"`
	ReadOnly    bool              `json:"read_only" yaml:"read_only"`
	Risk        string            `json:"risk" yaml:"risk"`
	Status      Status            `json:"status" yaml:"status"`
	Provider    string            `json:"provider,omitempty" yaml:"provider,omitempty"`
	Reason      string            `json:"reason,omitempty" yaml:"reason,omitempty"`
}

Definition is a provider-independent capability contract.

type Factory

type Factory func(basePath string) (tool.BaseTool, error)

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry() *Registry

func (*Registry) ClientBoundModelNames added in v0.1.4

func (r *Registry) ClientBoundModelNames() []string

ClientBoundModelNames returns the model function names of every registered client-bound capability. Used to strip these tools from non-streaming runs, where their actions cannot be dispatched.

func (*Registry) FindByModelName

func (r *Registry) FindByModelName(name string) (Definition, bool)

func (*Registry) Get

func (r *Registry) Get(id string) (Definition, bool)

func (*Registry) List

func (r *Registry) List() []Definition

func (*Registry) Register

func (r *Registry) Register(definition Definition, factory Factory) error

func (*Registry) Resolve

func (r *Registry) Resolve(basePath string, ids []string) ([]tool.BaseTool, []string, error)

Resolve creates model-callable adapters for available capability IDs.

type Status

type Status string
const (
	StatusAvailable   Status = "available"
	StatusUnavailable Status = "unavailable"
)

Jump to

Keyboard shortcuts

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