Expand description
Pure config-building logic for agent definitions.
Ports the buildConfigFiles, buildMcpConfig, and expandTemplate
functions from frontend/app/view/agent/agent-model.ts.
All functions are pure — no I/O, no async.
Structs§
- Agent
Config File - A single file to be written to the agent working directory.
Functions§
- build_
config_ files - Build the list of config files to write to the agent working directory.
- build_
config_ files_ with_ bus - Build the list of config files with a known
agent_bus_id. - build_
mcp_ config - Build
.mcp.jsoncontent with the auto-injected AgentMux MCP server entry. - build_
settings_ with_ hooks - Build
.claude/settings.jsoncontent with the auto-injected PreToolUse Bash hook (under the"hooks"key) that redirects Bash invocations into the streaming wrapper (agentmux-bashwrap exec). User-supplied settings.json (from the agent’scontent_map["settings"]) is parsed and merged at the top level; user-supplied legacy hooks content (fromcontent_map["hooks"]) is merged intosettings.hooks. - expand_
template - Replace
{{VARIABLE}}placeholders incontentwith values fromvars.