mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-21 09:28:14 +00:00
- Six-phase plan complete: webui/cli/healthcheck/pluginmgr/clawhubadapter now interact with the kernel exclusively via internal/sdk interfaces; all Configure() calls and package-level global injection removed - buildSDK in internal/plugin/registry.go is the single assembly point - Add internal/sdk/events.go exporting event types/constants - Fix ProviderManager cooldown sharing: LuaAdaptedProvider.Name() now returns the source name instead of lua_<adapter>, so multiple sources sharing an adapter (single script load via shared VM AdapterCache) no longer share failure-cooldown state - Verified: build/vet/tests green, deployed to homeagent.service with full plugin capability testing via local OpenAI-compatible mock
21 lines
871 B
Go
21 lines
871 B
Go
package sdk
|
||
|
||
// ToolSource 描述内核工具注册表/执行器的只读视图(由 StageHost 实现)。
|
||
// 用接口而非具体类型,避免 sdk 依赖内核包(内核包反向依赖 sdk)。
|
||
type ToolSource interface {
|
||
GetToolDefs() []ToolDef
|
||
ToolDef(name string) *ToolDef
|
||
ExecuteTool(name string, args map[string]interface{}) (interface{}, error)
|
||
}
|
||
|
||
// ToolAPI exposes the kernel tool registry and executor
|
||
// (StageHost for plugin tools + IOManager for device/channel tools).
|
||
type ToolAPI interface {
|
||
// GetToolDefs returns all tools registered on the stage host (plugin tools).
|
||
GetToolDefs() []ToolDef
|
||
// GetAllTools returns all tools exposed by IO devices/channels.
|
||
GetAllTools() []ToolDef
|
||
// ExecuteTool executes a tool by name, resolving across the stage host first.
|
||
ExecuteTool(name string, args map[string]interface{}) (interface{}, error)
|
||
}
|