Skip to content

Commit 423d610

Browse files
chore: add subdomain inbox + daily email check heartbeat
1 parent f6fad24 commit 423d610

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

HEARTBEAT.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,22 @@ Run `df -h /` and `free -m`. Also run `mcporter call x402 get_wallet_info` to ch
2525

2626
If any threshold is breached: send one short message to Discord with the number(s). If all fine: say nothing.
2727

28-
## 3. Proactive Work (twice daily)
28+
## 3. Email Check (once daily)
29+
30+
**Gate:** Check the current UTC hour (`date -u +%H`). Only run during hour **14** (10am ET). If other hour, skip.
31+
32+
Check both inboxes for new messages:
33+
1. Subdomain inbox: `mcporter call x402.fetch url="https://x402email.com/api/subdomain/inbox/messages" method=POST body='{"subdomain":"craig","localPart":"craig"}'`
34+
2. Shared inbox: `mcporter call x402.fetch url="https://x402email.com/api/inbox/messages" method=POST body='{"username":"craig"}'`
35+
36+
For each message, check if its `messageId` is already in `~/.craig-notified-emails`. If NOT already notified:
37+
1. Read the full message via the appropriate `/messages/read` endpoint
38+
2. Post a short summary to Discord #craig channel: who it's from, subject, 1-line preview
39+
3. Append the `messageId` to `~/.craig-notified-emails` (one per line)
40+
41+
Never notify about the same email twice. Silent if no new emails.
42+
43+
## 4. Proactive Work (twice daily)
2944

3045
**Gate:** Check the current UTC hour (`date -u +%H`). Only run this section during hours **10** and **22** (10am and 10pm UTC). If it's any other hour, skip entirely. Also check `~/.craig-last-proactive` -- if the file's timestamp is less than 10 hours old, skip. After running, `touch ~/.craig-last-proactive`.
3146

MEMORY.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ This file contains durable facts and decisions that persist across sessions. Cra
3838
## Craig's Email
3939

4040
- **Subdomain**: craig.x402email.com (purchased 2026-02-12, $5 USDC one-time)
41-
- **Inbox**: craig@x402email.com (purchased 2026-02-12, $1 USDC/month, expires 2026-03-14)
41+
- **Inbox (shared domain)**: craig@x402email.com (purchased 2026-02-12, $1 USDC/month, expires 2026-03-14)
42+
- **Inbox (subdomain)**: craig@craig.x402email.com (purchased 2026-02-13, $0.25, 500 msg cap, retainMessages enabled)
4243
- **Send from**: any address @craig.x402email.com (e.g. biden@craig.x402email.com, classified@craig.x402email.com)
43-
- **Receive at**: craig@x402email.com (programmatic mailbox, retainMessages enabled, no forwarding)
44+
- **Receive at**: craig@craig.x402email.com (primary reply-to) and craig@x402email.com (legacy)
4445
- **Send endpoint**: POST https://x402email.com/api/subdomain/send ($0.005/email)
45-
- **Read inbox**: POST https://x402email.com/api/inbox/messages ($0.001/call) with body {"username":"craig"}
46-
- **Read message**: POST https://x402email.com/api/inbox/messages/read ($0.001/call) with body {"messageId":"..."}
46+
- **Read subdomain inbox**: POST https://x402email.com/api/subdomain/inbox/messages ($0.001/call) with body {"subdomain":"craig","localPart":"craig"}
47+
- **Read subdomain message**: POST https://x402email.com/api/subdomain/inbox/messages/read ($0.001/call) with body {"messageId":"..."}
48+
- **Read shared inbox**: POST https://x402email.com/api/inbox/messages ($0.001/call) with body {"username":"craig"}
49+
- **Read shared message**: POST https://x402email.com/api/inbox/messages/read ($0.001/call) with body {"messageId":"..."}
4750
- **Wallet**: must pay from Craig's x402 wallet (owner wallet)
4851

4952
## Infrastructure

0 commit comments

Comments
 (0)