Module registry

Module registry 

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

AgentEntry
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.