Module agent_config

Module agent_config 

Source
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§

AgentConfigFile
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.json content with the auto-injected AgentMux MCP server entry.
build_settings_with_hooks
Build .claude/settings.json content 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’s content_map["settings"]) is parsed and merged at the top level; user-supplied legacy hooks content (from content_map["hooks"]) is merged into settings.hooks.
expand_template
Replace {{VARIABLE}} placeholders in content with values from vars.