Expand description
Inter-project messaging primitive (issue #99).
Why: Replaces the Python /mpm-message skill (claude-mpm repo, writes
to ~/.claude-mpm/messaging.db) with a trusty-memory-native primitive.
Single-daemon-per-host architecture means cross-project messaging is
just a write to a different palace and a read at session start — no
IPC required.
What: helpers that encode messages as drawers tagged with a msg:*
namespace so we don’t have to change the Drawer schema:
msg:v1— marker tag for fast filtering / dedup.msg:from=<palace>— sender palace id.msg:to=<palace>— recipient palace id (redundant with the host palace, kept for audit + cross-palace queries).msg:purpose=<string>— free-text purpose / category set by the sender.msg:sent_at=<rfc3339>— UTC ISO 8601 timestamp when the sender wrote it.msg:read=<bool>— receiver-controlled read flag (trueafter the SessionStart hook has delivered it once).
Sub-modules:
types:Message, tag-prefix constants,build_message_tags, slug helpers.operations:send_message_to_palace,list_unread_messages,list_messages,mark_message_read,cwd_palace_slug.
Test: tests::round_trip_send_and_inbox, tests::slug_derivation_cases,
tests::mark_read_is_atomic_under_concurrency.
Structs§
- Message
- Decoded view of a message drawer.
Constants§
- MSG_
MARKER_ TAG - Tag namespace prefix marking a drawer as a v1 inter-project message.
- TAG_
FROM_ PREFIX - Tag prefix carrying the sender’s palace id (e.g.
msg:from=trusty-tools). - TAG_
PURPOSE_ PREFIX - Tag prefix carrying the sender-defined purpose (e.g.
msg:purpose=task). - TAG_
READ_ PREFIX - Tag prefix carrying the read flag (
msg:read=falseormsg:read=true). - TAG_
SENT_ AT_ PREFIX - Tag prefix carrying the RFC3339 send timestamp (e.g.
msg:sent_at=2026-05-25T12:34:56+00:00). - TAG_
TO_ PREFIX - Tag prefix carrying the recipient palace id (e.g.
msg:to=claude-mpm).
Functions§
- build_
message_ tags - Build the tag vector for a freshly-sent message.
- cwd_
palace_ slug - Resolve the calling project’s palace slug from cwd, preferring the git toplevel when available.
- cwd_
palace_ slug_ at - Variant of
cwd_palace_slugthat takes the working directory explicitly. - list_
messages - List every message drawer in
palace, optionally filtering to unread. - list_
unread_ messages - List every unread message drawer in
palace. - mark_
message_ read - Mark a message drawer as read by atomically rewriting its
msg:read=...tag. - send_
message_ to_ palace - Persist a message into the recipient palace.
- slugify_
for_ palace - Derive a palace slug from a filesystem path.
- slugify_
string - String-level slug helper used by
slugify_for_palace.