aboutsummaryrefslogtreecommitdiff
path: root/.ai/workflows/triage-intake.cmail.org
blob: d818c72b8734e0b7b3a14cabdb78c6c2e2ee7a5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#+TITLE: Triage Intake — cmail (Proton) Source
#+AUTHOR: Craig Jennings & Claude
#+DATE: 2026-05-26

# Source plugin for the triage-intake engine. See triage-intake.org for the
# contract and the Phase A-D orchestration. This file declares ONE source.

* Source: cmail
:PROPERTIES:
:ORDER:         25
:ENABLED:       test -f .ai/scripts/cmail-action.py
:ANCHOR:        none
:SUBAGENT_OVER: 50
:END:

** Scan

Proton (=c@cjennings.net=) via the bridge script. =ANCHOR: none= because this reports live IMAP unread *state*, not a since-window — the engine substitutes no cutoff. Phase B uses the anchor only to flag which of the current unread arrived since last check.

#+begin_src bash
python3 .ai/scripts/cmail-action.py list-unread
#+end_src

JSON output, keyed by UID. The script ignores messages already flagged =\Deleted= (those are pending-flush on the next Proton sync), so the list is the genuinely-live unread set.

** Classify

Bias: *trash-leaning*, like personal Gmail — cmail catches a lot of forwarded noise.

- *Noise-trash:* newsletters, marketing, social, automated alerts.
- *Noise-keep:* receipts, statements.
- *FYI:* substantive mail, no action owed.
- *Action:* an explicit ask or reply owed. Flag "new since last check" by comparing the message date against the engine's anchor.

** Render

#+begin_example
**cmail (Proton) — N unread.** <one-line classification summary>
- Action: <items, if any>
- FYI: <items, if any>
- Noise: N trash candidates, M keep
#+end_example

Omit if zero unread.

** Actions

All take one or more UIDs (from the =list-unread= JSON):

- mark-read :: =python3 .ai/scripts/cmail-action.py mark-read <uid>=
- star      :: =python3 .ai/scripts/cmail-action.py star <uid>=
- unstar    :: =python3 .ai/scripts/cmail-action.py unstar <uid>=
- trash     :: =python3 .ai/scripts/cmail-action.py trash <uid>=  (flags =\Deleted=; flushed on next Proton sync)