bcd246bf85
Anade pkg/tools/devicemesh con Client HTTP al device_agent + ToolRegistry con 16 tools standard (exec, fs.*, git.*, docker.*, proc.*, pkg.*, shell.eval). RegisterBuiltins filtra por mode user/sudo via RequiresApproval flag. Hook al pkg/decision con ActionKindDeviceMesh + DeviceMeshAction. Runner soporta dispatch via NewRunnerWithDeviceMesh (back-compat NewRunner). Tests: 25 nuevos en devicemesh + 4 en runner. Build clean.
25 lines
1002 B
Go
25 lines
1002 B
Go
// devicemesh.go: pure data type for "call a device mesh tool" actions.
|
|
//
|
|
// The runtime decides which agent has which tool registry (user vs sudo).
|
|
// The decision layer only describes *what* to call; the runner in
|
|
// shell/effects/ resolves the registry and dispatches.
|
|
package decision
|
|
|
|
// DeviceMeshAction describes an invocation of a registered devicemesh tool.
|
|
// It is a pure value — no client, no registry, just the name + input.
|
|
//
|
|
// Fields:
|
|
//
|
|
// - Tool: the registered tool name in the agent's devicemesh.ToolRegistry
|
|
// (ex "exec", "fs.read", "fs.write").
|
|
// - Input: LLM-supplied arguments. Will be validated by the registry
|
|
// before reaching the network.
|
|
// - ResultKey: optional. The runtime stores the tool result under this key
|
|
// in the conversation state so the LLM can refer to it later. Empty
|
|
// string means "do not store, just send back as a tool message".
|
|
type DeviceMeshAction struct {
|
|
Tool string
|
|
Input map[string]any
|
|
ResultKey string
|
|
}
|