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 ClientBoundModelNames() []string
- func IsClientBound(id string) bool
- func ModelName(id string) string
- func Wrap(definition Definition, provider tool.BaseTool) tool.BaseTool
- type Definition
- type Factory
- 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) List() []Definition
- func (r *Registry) Register(definition Definition, factory Factory) error
- func (r *Registry) Resolve(basePath string, ids []string) ([]tool.BaseTool, []string, error)
- 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" 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 ¶
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
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"`
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 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) List ¶
func (r *Registry) List() []Definition