feat(tools): add spawn_status tool configuration and registration
This commit is contained in:
parent
12f570e56f
commit
70b967672a
4 changed files with 22 additions and 2 deletions
|
|
@ -233,7 +233,9 @@ func registerSharedTools(
|
||||||
return registry.CanSpawnSubagent(currentAgentID, targetAgentID)
|
return registry.CanSpawnSubagent(currentAgentID, targetAgentID)
|
||||||
})
|
})
|
||||||
agent.Tools.Register(spawnTool)
|
agent.Tools.Register(spawnTool)
|
||||||
agent.Tools.Register(tools.NewSpawnStatusTool(subagentManager))
|
if cfg.Tools.IsToolEnabled("spawn_status") {
|
||||||
|
agent.Tools.Register(tools.NewSpawnStatusTool(subagentManager))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.WarnCF("agent", "spawn tool requires subagent to be enabled", nil)
|
logger.WarnCF("agent", "spawn tool requires subagent to be enabled", nil)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -748,6 +748,7 @@ type ToolsConfig struct {
|
||||||
ReadFile ReadFileToolConfig `json:"read_file" envPrefix:"PICOCLAW_TOOLS_READ_FILE_"`
|
ReadFile ReadFileToolConfig `json:"read_file" envPrefix:"PICOCLAW_TOOLS_READ_FILE_"`
|
||||||
SendFile ToolConfig `json:"send_file" envPrefix:"PICOCLAW_TOOLS_SEND_FILE_"`
|
SendFile ToolConfig `json:"send_file" envPrefix:"PICOCLAW_TOOLS_SEND_FILE_"`
|
||||||
Spawn ToolConfig `json:"spawn" envPrefix:"PICOCLAW_TOOLS_SPAWN_"`
|
Spawn ToolConfig `json:"spawn" envPrefix:"PICOCLAW_TOOLS_SPAWN_"`
|
||||||
|
SpawnStatus ToolConfig `json:"spawn_status" envPrefix:"PICOCLAW_TOOLS_SPAWN_STATUS_"`
|
||||||
SPI ToolConfig `json:"spi" envPrefix:"PICOCLAW_TOOLS_SPI_"`
|
SPI ToolConfig `json:"spi" envPrefix:"PICOCLAW_TOOLS_SPI_"`
|
||||||
Subagent ToolConfig `json:"subagent" envPrefix:"PICOCLAW_TOOLS_SUBAGENT_"`
|
Subagent ToolConfig `json:"subagent" envPrefix:"PICOCLAW_TOOLS_SUBAGENT_"`
|
||||||
WebFetch ToolConfig `json:"web_fetch" envPrefix:"PICOCLAW_TOOLS_WEB_FETCH_"`
|
WebFetch ToolConfig `json:"web_fetch" envPrefix:"PICOCLAW_TOOLS_WEB_FETCH_"`
|
||||||
|
|
@ -1043,6 +1044,8 @@ func (t *ToolsConfig) IsToolEnabled(name string) bool {
|
||||||
return t.ReadFile.Enabled
|
return t.ReadFile.Enabled
|
||||||
case "spawn":
|
case "spawn":
|
||||||
return t.Spawn.Enabled
|
return t.Spawn.Enabled
|
||||||
|
case "spawn_status":
|
||||||
|
return t.SpawnStatus.Enabled
|
||||||
case "spi":
|
case "spi":
|
||||||
return t.SPI.Enabled
|
return t.SPI.Enabled
|
||||||
case "subagent":
|
case "subagent":
|
||||||
|
|
|
||||||
|
|
@ -512,6 +512,9 @@ func DefaultConfig() *Config {
|
||||||
Spawn: ToolConfig{
|
Spawn: ToolConfig{
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
},
|
},
|
||||||
|
SpawnStatus: ToolConfig{
|
||||||
|
Enabled: true,
|
||||||
|
},
|
||||||
SPI: ToolConfig{
|
SPI: ToolConfig{
|
||||||
Enabled: false, // Hardware tool - Linux only
|
Enabled: false, // Hardware tool - Linux only
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,12 @@ var toolCatalog = []toolCatalogEntry{
|
||||||
Category: "agents",
|
Category: "agents",
|
||||||
ConfigKey: "spawn",
|
ConfigKey: "spawn",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "spawn_status",
|
||||||
|
Description: "Query the status of spawned subagents.",
|
||||||
|
Category: "agents",
|
||||||
|
ConfigKey: "spawn_status",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "i2c",
|
Name: "i2c",
|
||||||
Description: "Interact with I2C hardware devices exposed on the host.",
|
Description: "Interact with I2C hardware devices exposed on the host.",
|
||||||
|
|
@ -205,7 +211,7 @@ func buildToolSupport(cfg *config.Config) []toolSupportItem {
|
||||||
reasonCode = "requires_skills"
|
reasonCode = "requires_skills"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "spawn":
|
case "spawn", "spawn_status":
|
||||||
if cfg.Tools.IsToolEnabled(entry.ConfigKey) {
|
if cfg.Tools.IsToolEnabled(entry.ConfigKey) {
|
||||||
if cfg.Tools.IsToolEnabled("subagent") {
|
if cfg.Tools.IsToolEnabled("subagent") {
|
||||||
status = "enabled"
|
status = "enabled"
|
||||||
|
|
@ -300,6 +306,12 @@ func applyToolState(cfg *config.Config, toolName string, enabled bool) error {
|
||||||
if enabled {
|
if enabled {
|
||||||
cfg.Tools.Subagent.Enabled = true
|
cfg.Tools.Subagent.Enabled = true
|
||||||
}
|
}
|
||||||
|
case "spawn_status":
|
||||||
|
cfg.Tools.SpawnStatus.Enabled = enabled
|
||||||
|
if enabled {
|
||||||
|
cfg.Tools.Spawn.Enabled = true
|
||||||
|
cfg.Tools.Subagent.Enabled = true
|
||||||
|
}
|
||||||
case "i2c":
|
case "i2c":
|
||||||
cfg.Tools.I2C.Enabled = enabled
|
cfg.Tools.I2C.Enabled = enabled
|
||||||
case "spi":
|
case "spi":
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue