Module def_registry_mirror

Module def_registry_mirror 

Source
Expand description

Global agent-definition registry mirror.

Mirrors db_agent_definitions mutations (with the agent’s content + skills) into the GLOBAL definition store at ~/.agentmux/shared/agents/definitions/ so an agent created in one channel is visible in every channel. SQLite remains authoritative for the local channel; the global store is the cross-channel view. Best-effort: every failure is logged, never propagated. Sibling of registry_mirror.rs (the named-instance mirror).

Cross-channel agent persistence, P0.2b (docs/specs/SPEC_CROSS_CHANNEL_AGENT_PERSISTENCE_2026-06-13.md).

Functions§

agent_definition_to_record 🔒
Build a global definition record from a definition row + its content and skills (which live in separate tables and must travel with the definition for a cross-channel agent to launch with its instructions).
record_to_agent_definition 🔒
Reconstruct an AgentDefinition from a global record (inverse of agent_definition_to_record) — the read path for a cross-channel agent whose definition isn’t in the local channel’s SQLite. Content + skills are carried separately on the record and surfaced via the content/skills read fallbacks.