Documentation
¶
Overview ¶
Package capability owns the stable abilities exposed by the Runtime. Concrete tools are implementation details bound through provider adapters.
Index ¶
- Constants
- Variables
- func BrowserIDs() []string
- func ClientBoundModelNames() []string
- func IsBrowser(id string) bool
- func IsClientBound(id string) bool
- func IsDesktop(id string) bool
- func ModelName(id string) string
- func Wrap(definition Definition, provider tool.BaseTool) tool.BaseTool
- type Definition
- type Factory
- type Namespace
- type Registry
- func (r *Registry) ClientBoundModelNames() []string
- func (r *Registry) FindByModelName(name string) (Definition, bool)
- func (r *Registry) Get(id string) (Definition, bool)
- func (r *Registry) IDsInNamespace(namespace Namespace) []string
- func (r *Registry) List() []Definition
- func (r *Registry) Register(definition Definition, factory Factory) error
- func (r *Registry) RegisterExternal(definition Definition, factory Factory) error
- func (r *Registry) RemoveExternal()
- func (r *Registry) RemoveExternalProvider(provider, version string)
- func (r *Registry) Resolve(basePath string, ids []string) ([]tool.BaseTool, []string, error)
- type Set
- type Status
Constants ¶
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" BrowserLogin = "browser.login" BrowserRead = "browser.read" BrowserObserve = "browser.observe" BrowserAction = "browser.action" BrowserWait = "browser.wait" BrowserDownload = "browser.download" BrowserScreenshot = "browser.screenshot" BrowserPointer = "browser.pointer" 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" OrchestrationGoal = "orchestration.goal" ImageGenerate = "media.image.generate" VideoGenerate = "media.video.generate" )
Variables ¶
var GlobalRegistry = NewRegistry()
Functions ¶
func BrowserIDs ¶ added in v1.0.0
func BrowserIDs() []string
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
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.
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"`
RiskFloor string `json:"risk_floor,omitempty" yaml:"risk_floor,omitempty"`
Status Status `json:"status" yaml:"status"`
Provider string `json:"provider,omitempty" yaml:"provider,omitempty"`
ProviderVersion string `json:"provider_version,omitempty" yaml:"provider_version,omitempty"`
Permissions map[string]any `json:"permissions,omitempty" yaml:"permissions,omitempty"`
ObservationContract string `json:"observation_contract,omitempty" yaml:"observation_contract,omitempty"`
Preconditions []protocol.WorldCondition `json:"preconditions" yaml:"preconditions"`
ExpectedEffects []protocol.WorldEffect `json:"expected_effects" yaml:"expected_effects"`
Postconditions []protocol.WorldCondition `json:"postconditions" yaml:"postconditions"`
Reason string `json:"reason,omitempty" yaml:"reason,omitempty"`
}
Definition is a provider-independent capability contract.
type Namespace ¶ added in v1.0.0
type Namespace string
func NamespaceOf ¶ added in v1.0.0
NamespaceOf returns the first segment of a canonical dotted capability ID.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) ClientBoundModelNames ¶ added in v0.1.4
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) IDsInNamespace ¶ added in v1.0.0
func (*Registry) List ¶
func (r *Registry) List() []Definition
func (*Registry) Register ¶
func (r *Registry) Register(definition Definition, factory Factory) error
func (*Registry) RegisterExternal ¶ added in v1.0.0
func (r *Registry) RegisterExternal(definition Definition, factory Factory) error
RegisterExternal registers a verified provider loaded from the private plugin Registry. External entries are removable as one unit during a safe reload; built-in registrations are never replaced.
func (*Registry) RemoveExternal ¶ added in v1.0.0
func (r *Registry) RemoveExternal()
RemoveExternal drops only dynamically loaded provider registrations. It is used before config reload so disabled/revoked versions cannot remain live.
func (*Registry) RemoveExternalProvider ¶ added in v1.0.0
RemoveExternalProvider rolls back a partially registered provider package.
type Set ¶ added in v1.0.0
type Set struct {
// contains filtered or unexported fields
}
Set keeps capability IDs unique while preserving their insertion order.