Central Notification Handlers#
Automated notification handling for @central.comind.network using the Letta Code SDK.
Architecture#
┌─────────────────────────────────────────────────────────────┐
│ CRON │
│ */15 * * * * responder queue && npm run fetch (Bluesky) │
│ 0 * * * * x_responder queue && npm run fetch:x (X) │
│ */5 * * * * npm run publish │
│ 0 */4 * * * tools.catchup (network pulse) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Python Fetchers │
│ tools/responder.py → drafts/queue.yaml (Bluesky) │
│ tools/x_responder.py → drafts/x_queue.yaml (X) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ TypeScript Handlers (SDK) │
│ notification-handler.ts → spawns comms for Bluesky │
│ x-handler.ts → spawns comms for X │
│ Comms writes draft files with YAML frontmatter │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Drafts │
│ drafts/bluesky/ → LOW/MEDIUM (auto-publish) │
│ drafts/x/ → LOW/MEDIUM (auto-publish) │
│ drafts/review/ → CRITICAL/HIGH (manual approval) │
│ drafts/published/ → archive │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Publisher │
│ publisher.ts → posts drafts via Python tools │
│ Archives to drafts/published/ │
└─────────────────────────────────────────────────────────────┘
Setup#
cd handlers
npm install
Usage#
Manual#
# Bluesky
uv run python -m tools.responder queue # Fetch notifications
npm run fetch # Comms drafts responses
npm run publish # Post LOW/MEDIUM
npm run publish:all # Post including CRITICAL/HIGH
# X
uv run python -m tools.x_responder queue # Fetch mentions
npm run fetch:x # Comms drafts responses
npm run publish # Post (same publisher)
# Both platforms
npm run fetch:all # Fetch + draft both
Automated (Cron)#
Already configured:
- Bluesky: Every 15 minutes
- X: Every hour
- Publish: Every 5 minutes (LOW/MEDIUM only)
Check cron: crontab -l
Priority System#
| Priority | Source | Destination | Auto-publish |
|---|---|---|---|
| CRITICAL | Cameron | drafts/review/ |
No |
| HIGH | Questions, keywords | drafts/review/ |
No |
| MEDIUM | Regular mentions | drafts/{platform}/ |
Yes |
| LOW | Low-engagement | drafts/{platform}/ |
Yes |
| SKIP | Spam, comind agents | (not queued) | N/A |
Draft File Format#
---
platform: bluesky # or "x"
type: reply
reply_to: at://did:plc:.../app.bsky.feed.post/...
reply_to_cid: bafyrei...
author: username
priority: MEDIUM
original_text: "The original post text"
drafted_at: 2026-02-03T05:00:00Z
---
Your response text here (under 280 chars)
Logs#
logs/responder.log- Bluesky fetchlogs/handler.log- Bluesky draftinglogs/x-responder.log- X fetchlogs/x-handler.log- X draftinglogs/publisher.log- Publishing
Troubleshooting#
No drafts created:
- Check if queue file exists (
drafts/queue.yamlordrafts/x_queue.yaml) - Check handler logs for errors
Drafts not publishing:
- Check
drafts/bluesky/anddrafts/x/for pending files - Check publisher logs
- Verify Python tools work:
uv run python tools/thread.py "test" --dry-run
CRITICAL items stuck:
- They're in
drafts/review/waiting for manual approval - Run
npm run publish:allto include them