This module adds inter-user messaging to Datacore via shared space inboxes.
Messages are org-mode entries stored in [space]/org/inboxes/[username].org. Users send messages with /msg, read with /my-messages, and reply with /reply.
Each user configures their identity in .datacore/settings.local.yaml:
identity:
name: gregor # Canonical username
handles: ["@gregor", "@gz"] # Aliases for receiving messages[space]/org/inboxes/
├── USERS.yaml # Registry of all users and handles
├── gregor.org # Gregor's inbox
├── crt.org # Črt's inbox
└── claude.org # AI task inbox (special)
* MESSAGE [2025-12-11 Thu 13:00] :unread:
:PROPERTIES:
:ID: msg-{timestamp}-{sender}
:FROM: sender_name
:TO: recipient_name
:PRIORITY: normal|high|low
:THREAD: nil|parent_message_id
:END:
Message content here.
:unread:- Not yet viewed:read:- Viewed by recipient:replied:- Recipient has replied:from-ai:- Response from Claude:AI:- Task for AI processing (claude.org only)
Send a message to another user.
Resolution order for recipient:
- Check USERS.yaml for handle → username mapping
- If not found, treat handle as username
- If user doesn't exist, create inbox and add to USERS.yaml
Space selection:
- Explicit:
--space datafund - From settings:
messaging.default_space - Current directory detection
Display inbox for current user.
Steps:
- Read
identity.namefrom settings - Find all
*/org/inboxes/{name}.orgfiles - Parse org entries, filter by tags
- Display grouped by space, sorted by time
Reply to a message, creating a thread.
Steps:
- Find original message by ID (or "last")
- Create new message with
THREADproperty set to original ID - Append to sender's inbox (reverse direction)
- Add
:replied:tag to original message
Messages to @claude are special:
- Stored in
[space]/org/inboxes/claude.org - Tagged with
:AI:for ai-task-executor - Agent processes and sends reply to sender's inbox
- Reply tagged
:from-ai:
# Append to recipient's inbox
with open(f"{space}/org/inboxes/{recipient}.org", "a") as f:
f.write(message_org_format)Replace :unread: tag with :read: in the heading line.
# USERS.yaml
users:
username:
handles: ["@handle1", "@handle2"]
added: YYYY-MM-DDidentity:
name: string # Required
handles: [string] # Optional, defaults to ["@{name}"]
messaging:
default_space: string # Optional, defaults to first team space
show_in_today: bool # Optional, defaults to true
auto_mark_read: bool # Optional, defaults to false- Unknown recipient: Create inbox, add to USERS.yaml, warn user
- No identity configured: Prompt to add
identity.nameto settings - Space not found: List available spaces, ask user to specify