@tekmidian/pai 0.12.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.mjs +2 -2
- package/dist/cli/program.d.mts.map +1 -1
- package/dist/cli/program.mjs +3 -2
- package/dist/cli/program.mjs.map +1 -1
- package/dist/{config-BuhHWyOK.mjs → config-C8m-tPhP.mjs} +22 -2
- package/dist/config-C8m-tPhP.mjs.map +1 -0
- package/dist/daemon/index.mjs +3 -3
- package/dist/{daemon-BldK8-57.mjs → daemon-D2aKb4mJ.mjs} +5 -5
- package/dist/{daemon-BldK8-57.mjs.map → daemon-D2aKb4mJ.mjs.map} +1 -1
- package/dist/daemon-mcp/index.mjs +581 -2
- package/dist/daemon-mcp/index.mjs.map +1 -1
- package/dist/{pick-7Kg9DX7S.mjs → pick-CS_TmOqX.mjs} +1105 -452
- package/dist/pick-CS_TmOqX.mjs.map +1 -0
- package/dist/skills/Tasks/SKILL.md +101 -0
- package/dist/{work-queue-worker-DHOIVVQ7.mjs → work-queue-worker-0tUMEhSS.mjs} +16 -1
- package/dist/{work-queue-worker-DHOIVVQ7.mjs.map → work-queue-worker-0tUMEhSS.mjs.map} +1 -1
- package/docs/commands/README.md +6 -0
- package/docs/commands/backup.md +1 -1
- package/docs/commands/clear-names.md +1 -1
- package/docs/commands/daemon.md +1 -1
- package/docs/commands/db.md +1 -1
- package/docs/commands/end.md +1 -1
- package/docs/commands/help.md +1 -1
- package/docs/commands/kg.md +1 -1
- package/docs/commands/mcp.md +1 -1
- package/docs/commands/memory.md +1 -1
- package/docs/commands/notify.md +1 -1
- package/docs/commands/observation.md +1 -1
- package/docs/commands/obsidian.md +1 -1
- package/docs/commands/pause.md +1 -1
- package/docs/commands/project.md +2 -1
- package/docs/commands/projects.md +2 -1
- package/docs/commands/registry.md +1 -1
- package/docs/commands/restore.md +1 -1
- package/docs/commands/sessions.md +1 -1
- package/docs/commands/setup.md +1 -1
- package/docs/commands/shell-init.md +1 -1
- package/docs/commands/skill.md +1 -1
- package/docs/commands/task.md +90 -0
- package/docs/commands/topic.md +1 -1
- package/docs/commands/update.md +1 -1
- package/docs/commands/zettel.md +1 -1
- package/package.json +1 -1
- package/plugins/productivity/plugin.json +2 -2
- package/plugins/productivity/skills/Tasks/SKILL.md +126 -0
- package/dist/config-BuhHWyOK.mjs.map +0 -1
- package/dist/pick-7Kg9DX7S.mjs.map +0 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Tasks
|
|
3
|
+
description: "Run the task bus — read cross-session work from the tracker, dispatch it to the sessions that own it, and file findings. USE WHEN user says 'morning routine', 'what needs doing', 'run the routine', 'check my tasks', 'dispatch tasks', 'file a finding', 'add this to todoist', 'what did we find', OR /tasks."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Task Bus
|
|
7
|
+
|
|
8
|
+
USE WHEN user says 'morning routine', 'what needs doing', 'run the routine', 'check my tasks', 'dispatch tasks', 'file a finding', 'add this to todoist', 'what did we find', OR /tasks.
|
|
9
|
+
|
|
10
|
+
The bus is shared state that outlives any one session. Session-local work stays in each project's `Notes/TODO.md`; the bus carries work that is **broader than one session** — findings discovered sideways, and work belonging to a project other than the one you are in.
|
|
11
|
+
|
|
12
|
+
### Pre-Action Check (MANDATORY)
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pai task list --limit 1
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
If this prints "Task bus is not configured", tell the user to run `pai setup` and complete the Task Bus step, then stop. Do not work around it by calling the Todoist MCP directly — the bus resolves ownership against the PAI registry, which the raw MCP knows nothing about.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
### Workflow 1 — Morning Routine
|
|
23
|
+
|
|
24
|
+
**Trigger:** "morning routine", "what needs doing", "run the routine".
|
|
25
|
+
|
|
26
|
+
**Step 1 — Read what is open**
|
|
27
|
+
```bash
|
|
28
|
+
pai task list --today # due today or overdue; drop --today for everything
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Step 2 — Report before acting.** Group by owner, lead with overdue and `p1`. Never dispatch silently — the user sees the list before sessions start receiving work.
|
|
32
|
+
|
|
33
|
+
**Step 3 — Dispatch**
|
|
34
|
+
```bash
|
|
35
|
+
pai task dispatch --today --dry-run # always preview
|
|
36
|
+
pai task dispatch --today # then, once approved
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
| Symbol | Outcome | Meaning |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| `→` | delivered | Sent to an already-running session |
|
|
42
|
+
| `+` | spawned | None running; one was launched, then sent to |
|
|
43
|
+
| `?` | unrouted | No owner resolved — stays in the findings inbox |
|
|
44
|
+
| `!` | unlaunchable | Owner resolved but has no PAI alias to launch |
|
|
45
|
+
| `·` | skipped | Auto-dispatch off, or no transport — reported only |
|
|
46
|
+
|
|
47
|
+
On `!`: the fix is `pai project name <identifier> <shortname>`. Only aliased projects can be dispatched to — say this rather than reporting a vague failure.
|
|
48
|
+
|
|
49
|
+
On `?`: normal, not an error. Triage is pending.
|
|
50
|
+
|
|
51
|
+
**Step 4 — Report honestly.** State what actually reached a session. If nothing was dispatched because auto-dispatch is off, say so plainly rather than implying work was handed off.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### Workflow 2 — File a Finding
|
|
56
|
+
|
|
57
|
+
**Trigger:** "file a finding", "add this to todoist", or **any time you discover something outside the current task**.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pai task add "Short actionable title" \\
|
|
61
|
+
--owner <project> \\
|
|
62
|
+
--body "Full procedure AND reasoning" \\
|
|
63
|
+
--priority p2 \\
|
|
64
|
+
--url "hook://..."
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Rules:
|
|
68
|
+
- **`--body` is not optional in practice.** Enough that the task is actionable months later, or by the user alone, without re-deriving anything. A bare title is a reminder that something was once known — worthless later.
|
|
69
|
+
- **Omit `--owner` when you genuinely do not know.** It lands in the findings inbox for triage. Guessing is worse than leaving it unrouted.
|
|
70
|
+
- **Prefer `hook://` URLs over file paths** for `--url` (get one via `mcp__hook__hookmark_link`). They survive renames and open in DEVONthink To Go on iOS. Plain paths are the fallback.
|
|
71
|
+
- **No generic checklist items.** A recurring item earns its place only because something *actually failed silently*. Otherwise the routine becomes noise and gets ignored.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
### Workflow 3 — Triage
|
|
76
|
+
|
|
77
|
+
**Trigger:** "triage", "what did we find", or weekly.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pai task list --limit 100
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
For each `unrouted` item, decide with the user: assign an owner, act now, or delete. Assigning means adding a `pai:<project>` label on the tracker — authoritative, and it survives the task being moved.
|
|
84
|
+
|
|
85
|
+
**The findings inbox should normally be empty.** If it is filling up, the bus has become another place for items to rot. Say so — that is a judgement about the system, not about the user.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### Ownership
|
|
90
|
+
|
|
91
|
+
1. A `pai:<project>` label — **authoritative**
|
|
92
|
+
2. Enclosing sub-project name matched against PAI aliases — fallback
|
|
93
|
+
3. Otherwise unrouted
|
|
94
|
+
|
|
95
|
+
A label matching nothing does **not** fall through to the container. The user meant somewhere specific; quietly routing elsewhere is worse than not routing.
|
|
96
|
+
|
|
97
|
+
### Notes
|
|
98
|
+
|
|
99
|
+
- `pai task done <id>` closes a task. Dispatched tasks instruct the receiving session to do this, so work is not dispatched twice.
|
|
100
|
+
- One-way by design: PAI and its sessions write; a routine reads. Nothing reads the tracker back into PAI state.
|
|
101
|
+
- Architecture and verified API constraints: `Notes/docs/task-bus.md`.
|
|
@@ -1196,7 +1196,22 @@ const TOPIC_OVERLAP_THRESHOLD = .15;
|
|
|
1196
1196
|
* - Different topic (overlap < 30%) → create a NEW note
|
|
1197
1197
|
* - If it's from a different day, create a new note
|
|
1198
1198
|
*/
|
|
1199
|
+
/**
|
|
1200
|
+
* Return true if the summarizer output has a meaningful body — i.e. content
|
|
1201
|
+
* beyond the TOPIC:/title/metadata/horizontal-rule scaffolding.
|
|
1202
|
+
*
|
|
1203
|
+
* A summary that is only headers (no Work Done items) must NOT create or update
|
|
1204
|
+
* a note: doing so births an empty-bodied scaffold that later rename/finalize
|
|
1205
|
+
* can strip to a footer-only stub. This is the born-stub failure mode.
|
|
1206
|
+
*/
|
|
1207
|
+
function summaryHasContent(summaryText) {
|
|
1208
|
+
return summaryText.replace(/^TOPIC:.*$/m, "").replace(/^# Session:.*$/m, "").replace(/^\*\*(Date|Status|Completed):\*\*.*$/gm, "").replace(/^#{1,6}\s.*$/gm, "").replace(/^---$/gm, "").replace(/<!--[\s\S]*?-->/g, "").trim().length > 0;
|
|
1209
|
+
}
|
|
1199
1210
|
function writeSessionNote(cwd, summaryText, filesModified) {
|
|
1211
|
+
if (!summaryHasContent(summaryText)) {
|
|
1212
|
+
process.stderr.write(`[session-summary] Summary has no meaningful body — skipping note write.\n`);
|
|
1213
|
+
return null;
|
|
1214
|
+
}
|
|
1200
1215
|
const notesInfo = findNotesDir(cwd);
|
|
1201
1216
|
let notePath = getCurrentNotePath(notesInfo.path);
|
|
1202
1217
|
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
@@ -1821,4 +1836,4 @@ function extractWorkFromTranscript(lines) {
|
|
|
1821
1836
|
|
|
1822
1837
|
//#endregion
|
|
1823
1838
|
export { enqueue as a, work_queue_worker_exports as i, startWorker as n, getStats as o, stopWorker as r, loadQueue as s, notifyNewWork as t };
|
|
1824
|
-
//# sourceMappingURL=work-queue-worker-
|
|
1839
|
+
//# sourceMappingURL=work-queue-worker-0tUMEhSS.mjs.map
|