Expand description
File-based cross-instance agent registry.
Each AgentMux instance writes agent registrations to
{data_dir}/agents/{agent_id}.json. When a local inject fails with
“agent not found”, the inject handler looks up this registry and
HTTP-forwards the request to the owning instance.
Lifecycle:
- Register: write file (on HTTP register endpoint + shell auto-register)
- Unregister: delete file (on HTTP unregister endpoint + process exit)
- Cleanup: TTL-based removal of stale files at startup
Structs§
- Agent
Entry - One entry per registered agent in the shared data dir.
Statics§
- LOCAL_
AUTH_ 🔒KEY - Process-wide auth key for the local AgentMux instance.
Functions§
- agent_
path 🔒 - agents_
dir 🔒 - cleanup_
stale - Remove stale entries at startup.
- init_
local_ auth_ key - Initialise the process’s local auth key. Idempotent — first call wins.
- local_
auth_ 🔒key - lookup
- Look up an agent entry. Returns None if not found or file is malformed.
- remove
- Remove an agent entry from the shared registry.
- write
- Write (create or update) an agent entry in the shared registry.