feat(0144c): launcher wiring + adapter al tool-use loop LLM
Schema DeviceMeshConfig en AgentConfig. Adapter ToolsForLLM convierte ToolSpec → tools.Tool transparente al LLM existente. URL via env var override. tools_allowed filter. agent-wsl-lucas blank import en launcher. LLM ve los tools como cualquier otra herramienta. Effects runner ya soporta ActionKindDeviceMesh como fallback. Build + tests verdes.
This commit is contained in:
+16
-2
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/enmanuel/agents/pkg/memory"
|
||||
"github.com/enmanuel/agents/pkg/personality"
|
||||
"github.com/enmanuel/agents/pkg/sanitize"
|
||||
devicemeshtools "github.com/enmanuel/agents/pkg/tools/devicemesh"
|
||||
"github.com/enmanuel/agents/shell/audit"
|
||||
"github.com/enmanuel/agents/shell/bus"
|
||||
shellcron "github.com/enmanuel/agents/shell/cron"
|
||||
@@ -140,8 +141,21 @@ func New(cfg *config.AgentConfig, rules []decision.Rule, agentACL acl.ACL, logge
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Effects runner
|
||||
runner := effects.NewRunner(matrixClient, sshExec, logger)
|
||||
// Effects runner — wire the device_mesh registry when the agent config
|
||||
// enables it, so decision.ActionKindDeviceMesh actions dispatched by the
|
||||
// rules layer can reach the remote device_agent. The LLM tool-use loop
|
||||
// goes through tools.Registry (see buildToolRegistry below), but the
|
||||
// Action-emitting path needs its own handle to the same registry.
|
||||
var dmRegForRunner *devicemeshtools.ToolRegistry
|
||||
if cfg.DeviceMesh != nil && cfg.DeviceMesh.Enabled {
|
||||
dmRegForRunner = buildDeviceMeshRegistry(cfg, logger)
|
||||
}
|
||||
var runner *effects.Runner
|
||||
if dmRegForRunner != nil {
|
||||
runner = effects.NewRunnerWithDeviceMesh(matrixClient, sshExec, dmRegForRunner, logger)
|
||||
} else {
|
||||
runner = effects.NewRunner(matrixClient, sshExec, logger)
|
||||
}
|
||||
|
||||
// Resolve base data path for this agent
|
||||
dataBase := resolveDataBase(cfg)
|
||||
|
||||
Reference in New Issue
Block a user