@creator-notes/cnotes 0.136.0 → 0.137.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/README.md
CHANGED
|
@@ -52,7 +52,7 @@ cnotes search semantic "onboarding flow"
|
|
|
52
52
|
| `cnotes search semantic` | `cnotes s` | Semantic search across notes |
|
|
53
53
|
| `cnotes query` | `cnotes q` | Filter, group or run a SELECT over every note's metadata from a local SQLite copy of the workspace, synced on each call |
|
|
54
54
|
| `cnotes timeline` | `cnotes tl` | Recent activity feed |
|
|
55
|
-
| `cnotes catchup --since <when>` | `cnotes catch-up` | What changed over a window you name, as evidence for your agent to narrate: threads of work with the notes each touched and the links each note gained. Scope it with `--person`, `--type`, `--canvas`, `--topic`, `--humans-only` |
|
|
55
|
+
| `cnotes catchup --since <when>` | `cnotes catch-up` | What changed over a window you name, across every workspace you belong to unless `-w` names one, as evidence for your agent to narrate: threads of work with the notes each touched and the links each note gained. Scope it with `--person`, `--type`, `--canvas`, `--topic`, `--humans-only` |
|
|
56
56
|
| `cnotes relationships list` | `cnotes rel` | Note relationships |
|
|
57
57
|
| `cnotes brief` | | What the workspace already knows about a task: the most relevant notes, canvases and recent changes, with what earlier runs made of each note; ends on one line that says to name the kind of request before writing |
|
|
58
58
|
| `cnotes lessons record\|list` | | Say whether the notes you read were useful, a dead end or corrected (also `operations end --useful`); the next run's brief starts from them |
|
package/dist/commands/catchup.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { ApiClient } from "../lib/api-client.js";
|
|
2
|
-
import { resolveConfig } from "../lib/config.js";
|
|
3
|
-
import { handleError, ValidationError } from "../lib/errors.js";
|
|
2
|
+
import { resolveBaseConfig, resolveConfig } from "../lib/config.js";
|
|
3
|
+
import { AuthError, handleError, ValidationError } from "../lib/errors.js";
|
|
4
4
|
import { outputJson } from "../lib/output.js";
|
|
5
5
|
export const CATCHUP_SINCE_REQUIRED = "A catch-up needs a window and has no default one. Pass --since: a span back from now (36h, 7d, 2w), " +
|
|
6
6
|
"a date (2026-11-14) or a date and time (2026-11-14T09:00:00Z).";
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* The query GET /api/catchup takes. The server parses the window, so "7d"
|
|
9
|
+
* means the same on every surface. No `workspaceId` reads every workspace.
|
|
10
|
+
*/
|
|
8
11
|
export function catchupParams(workspaceId, opts) {
|
|
9
12
|
if (!opts.since?.trim())
|
|
10
13
|
throw new ValidationError(CATCHUP_SINCE_REQUIRED);
|
|
11
14
|
return {
|
|
12
|
-
workspaceId,
|
|
15
|
+
workspaceId: workspaceId || undefined,
|
|
13
16
|
since: opts.since.trim(),
|
|
14
17
|
until: opts.until?.trim() || undefined,
|
|
15
18
|
person: opts.person?.trim() || undefined,
|
|
@@ -28,7 +31,15 @@ export function catchupNoteIds(pack) {
|
|
|
28
31
|
return Array.from(seen);
|
|
29
32
|
}
|
|
30
33
|
/**
|
|
31
|
-
*
|
|
34
|
+
* Whether the caller named one workspace: `-w`, CNOTES_WORKSPACE, or a canvas
|
|
35
|
+
* (which lives in one). The workspace saved by `workspace select` does not
|
|
36
|
+
* count, so a plain `cnotes catchup` reads every workspace.
|
|
37
|
+
*/
|
|
38
|
+
export function catchupNamesWorkspace(source, opts) {
|
|
39
|
+
return source === "flag" || source === "env" || Boolean(opts.canvas?.trim());
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* `cnotes catchup --since 7d`: what changed across the caller's workspaces over a window,
|
|
32
43
|
* as evidence for the agent's own model to narrate. Nothing is summarised at
|
|
33
44
|
* read time: every line was recorded when the change was made.
|
|
34
45
|
*/
|
|
@@ -36,15 +47,16 @@ export function registerCatchupCommand(program) {
|
|
|
36
47
|
program
|
|
37
48
|
.command("catchup")
|
|
38
49
|
.alias("catch-up")
|
|
39
|
-
.description("What changed
|
|
50
|
+
.description("What changed across your workspaces over a window, as evidence for you to narrate: threads of work " +
|
|
40
51
|
"(runs, edits, milestones, approved proposals) with the notes each touched, the links each note " +
|
|
41
|
-
"gained, and where the pack stops.
|
|
52
|
+
"gained, and where the pack stops. Reads every workspace unless -w, CNOTES_WORKSPACE or --canvas " +
|
|
53
|
+
"names one. Use it when someone asks to be caught up.")
|
|
42
54
|
.option("--since <when>", "Start of the window, required: 36h, 7d, 2w, 2026-11-14 or 2026-11-14T09:00:00Z")
|
|
43
55
|
.option("--until <when>", "End of the window (default: now)")
|
|
44
56
|
.option("--person <name>", "Only changes by one member: a name, part of one, or \"me\". Their agents count as them")
|
|
45
57
|
.option("--humans-only", "Leave out agent runs and CLI, MCP and import writes")
|
|
46
58
|
.option("--type <types>", "Only these note types (comma-separated), plus notes that gained a link to one")
|
|
47
|
-
.option("--canvas <id>", "Only one canvas: its id or display id (CANVAS-12)")
|
|
59
|
+
.option("--canvas <id>", "Only one canvas of the active workspace: its id or display id (CANVAS-12)")
|
|
48
60
|
.option("--topic <words>", "Only changes about a topic, matched by meaning over the change log")
|
|
49
61
|
.option("--text", "Print the pack as text even when piped: the same evidence at about half the size of the JSON")
|
|
50
62
|
.addHelpText("after", `
|
|
@@ -52,6 +64,12 @@ Read-only and free of credits. The window is always yours to name: there is no
|
|
|
52
64
|
"since I last looked". Scopes combine, so "what has Ana done on pricing since
|
|
53
65
|
Tuesday" is --person, --topic and --since on one call.
|
|
54
66
|
|
|
67
|
+
With no workspace named, every workspace you belong to is read: each one that
|
|
68
|
+
changed gets its own section, busiest first, and the quiet ones are named on
|
|
69
|
+
one line. The workspace saved by \`workspace select\` does not narrow it; -w,
|
|
70
|
+
CNOTES_WORKSPACE or --canvas does. A note id is only unique inside its
|
|
71
|
+
workspace, so -q prints "<workspace id><TAB><note id>" when several are read.
|
|
72
|
+
|
|
55
73
|
The pack is evidence, not a summary. Tell the person what moved as a few
|
|
56
74
|
threads of work, say which closed and which are still open, and name each note
|
|
57
75
|
by its id. Every line was recorded when the change was made, so add no cause
|
|
@@ -67,22 +85,37 @@ apart by email, which --person also takes.
|
|
|
67
85
|
|
|
68
86
|
Examples:
|
|
69
87
|
$ cnotes catchup --since 7d
|
|
88
|
+
$ cnotes catchup --since 24h -w <workspace id>
|
|
70
89
|
$ cnotes catchup --since 2026-11-14 --person Ana --text
|
|
71
90
|
$ cnotes catchup --since 2w --type Decision,Question
|
|
72
91
|
$ cnotes catchup --since 7d --topic "pricing" --canvas CANVAS-12
|
|
73
92
|
`)
|
|
74
93
|
.action(async (opts) => {
|
|
75
|
-
const
|
|
94
|
+
const base = resolveBaseConfig(program.opts());
|
|
95
|
+
const named = catchupNamesWorkspace(base.workspaceSource, opts);
|
|
96
|
+
// One workspace needs a resolved one (and says so when there is none);
|
|
97
|
+
// every workspace needs only a key.
|
|
98
|
+
const cfg = named ? resolveConfig(program.opts()) : base;
|
|
99
|
+
if (!cfg.token)
|
|
100
|
+
throw new AuthError();
|
|
76
101
|
const api = new ApiClient(cfg.serverUrl, cfg.token, cfg.workspaceId);
|
|
77
102
|
try {
|
|
78
|
-
const data = await api.get("/api/catchup", catchupParams(cfg.workspaceId, opts));
|
|
103
|
+
const data = await api.get("/api/catchup", catchupParams(named ? cfg.workspaceId : undefined, opts));
|
|
79
104
|
if (cfg.quiet) {
|
|
80
|
-
|
|
81
|
-
|
|
105
|
+
if ("across" in data) {
|
|
106
|
+
for (const ws of data.across.workspaces) {
|
|
107
|
+
for (const id of catchupNoteIds(ws.pack))
|
|
108
|
+
console.log(`${ws.workspaceId}\t${id}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
for (const id of catchupNoteIds(data.pack))
|
|
113
|
+
console.log(id);
|
|
114
|
+
}
|
|
82
115
|
return;
|
|
83
116
|
}
|
|
84
117
|
if (cfg.json && !opts.text) {
|
|
85
|
-
outputJson(data.pack);
|
|
118
|
+
outputJson("across" in data ? data.across : data.pack);
|
|
86
119
|
return;
|
|
87
120
|
}
|
|
88
121
|
console.log(data.markdown);
|
package/dist/lib/mcp-spec.js
CHANGED
|
@@ -475,7 +475,7 @@ export function buildMcpSpec(z, opts) {
|
|
|
475
475
|
},
|
|
476
476
|
},
|
|
477
477
|
cnotes_catch_up: {
|
|
478
|
-
description: "Catch the user up: what changed
|
|
478
|
+
description: "Catch the user up: what changed across every workspace they belong to over a window they name, as evidence for YOU to narrate. Pass workspaceId to read one workspace; canvasId reads one canvas of the current workspace. Each workspace that changed gets its own section, busiest first, and the quiet ones are named on one line; a note id is only unique inside its workspace, so say which workspace each note is in. Returns threads of work, newest first (agent runs, edits, milestones, approved proposals), each with the notes it touched, what changed as it was recorded at the time, and the links each note gained: a line `+ answers QUESTION-12` is a question getting its answer. Use it for \"catch me up\", \"what did Ana do this week\", \"any decisions since Tuesday\", and \"did my questions get answered\" (types: [\"Question\"]). The window is required and has no default: when the user gives none, ask how far back, or offer the last 7 days. Tell them what moved as a few threads of work, say which closed and which are still open, and name each note by its id; every line was recorded when the change was made, so add no cause the lines do not state. A busy window lists its newest threads in full and older ones as headlines: when the Coverage line says where the detail or the pack stops, call again with `until` set to the instant it names.",
|
|
479
479
|
shape: {
|
|
480
480
|
since: z
|
|
481
481
|
.string()
|
|
@@ -491,8 +491,12 @@ export function buildMcpSpec(z, opts) {
|
|
|
491
491
|
.max(20)
|
|
492
492
|
.optional()
|
|
493
493
|
.describe("Only these note types (e.g. [\"Decision\", \"Question\"]), plus notes that gained a link to one"),
|
|
494
|
-
canvasId: z.string().optional().describe("Only one canvas: its ID or display ID (e.g. CANVAS-12)"),
|
|
494
|
+
canvasId: z.string().optional().describe("Only one canvas of the current workspace: its ID or display ID (e.g. CANVAS-12)"),
|
|
495
495
|
topic: z.string().optional().describe("Only changes about a topic, matched by meaning over the change log (e.g. \"pricing\")"),
|
|
496
|
+
workspaceId: z
|
|
497
|
+
.string()
|
|
498
|
+
.optional()
|
|
499
|
+
.describe("Only one workspace: its ID, as a cross-workspace catch-up prints it. Leave out to read every workspace"),
|
|
496
500
|
},
|
|
497
501
|
},
|
|
498
502
|
cnotes_types_list: {
|
|
@@ -505,17 +509,20 @@ export function buildMcpSpec(z, opts) {
|
|
|
505
509
|
/**
|
|
506
510
|
* The query GET /api/catchup takes for a cnotes_catch_up call. The server
|
|
507
511
|
* parses the window, so both MCP servers and the CLI read "7d" the same way.
|
|
512
|
+
* With no workspace named the read covers every workspace the caller belongs
|
|
513
|
+
* to; a canvas belongs to one, so `canvasId` reads the server's own.
|
|
508
514
|
*/
|
|
509
|
-
export function catchUpQuery(
|
|
515
|
+
export function catchUpQuery(serverWorkspaceId, args) {
|
|
510
516
|
const types = (args.types ?? []).map((t) => t.trim()).filter(Boolean);
|
|
517
|
+
const canvas = args.canvasId?.trim() || undefined;
|
|
511
518
|
return {
|
|
512
|
-
workspaceId,
|
|
519
|
+
workspaceId: args.workspaceId?.trim() || (canvas ? serverWorkspaceId : undefined),
|
|
513
520
|
since: args.since.trim(),
|
|
514
521
|
until: args.until?.trim() || undefined,
|
|
515
522
|
person: args.person?.trim() || undefined,
|
|
516
523
|
humansOnly: args.humansOnly ? "true" : undefined,
|
|
517
524
|
types: types.length ? types.join(",") : undefined,
|
|
518
|
-
canvas
|
|
525
|
+
canvas,
|
|
519
526
|
topic: args.topic?.trim() || undefined,
|
|
520
527
|
};
|
|
521
528
|
}
|
package/package.json
CHANGED
|
@@ -209,16 +209,18 @@ cnotes timeline --query "auth decision" --since 30d # search within a window
|
|
|
209
209
|
When a person asks to be caught up ("catch me up", "what did Ana do this week", "any decisions since Tuesday"), read one pack instead of composing `timeline`, `canvas digest` and `rel list` yourself:
|
|
210
210
|
|
|
211
211
|
```bash
|
|
212
|
-
cnotes catchup --since 7d --text # the last week, as text
|
|
212
|
+
cnotes catchup --since 7d --text # the last week, across every workspace, as text
|
|
213
|
+
cnotes catchup --since 24h -w <workspace id> # one workspace
|
|
213
214
|
cnotes catchup --since 2026-11-14 --person Ana # one member; their agents count as them
|
|
214
215
|
cnotes catchup --since 2w --type Decision,Question
|
|
215
216
|
cnotes catchup --since 7d --topic "pricing" --canvas CANVAS-12
|
|
216
217
|
```
|
|
217
218
|
|
|
218
219
|
- **The window is required.** There is no "since I last looked": when the person names none, ask how far back, or offer the last 7 days. `--since` and `--until` take a span back from now (36h, 7d, 2w), a date or a date and time.
|
|
220
|
+
- **Every workspace, unless one is named.** With no `-w`, `CNOTES_WORKSPACE` or `--canvas`, the pack covers every workspace the person belongs to: one section per workspace that changed, busiest first, and the quiet ones named on one line. The workspace saved by `workspace select` does not narrow it. A note id is only unique inside its workspace, so say which workspace each note is in, and page one workspace back with `-w <id> --until …`.
|
|
219
221
|
- **Scopes combine.** `--person` (a name, part of one, an email, or "me"; a name that fits two members is refused with the names to pick from), `--humans-only`, `--type`, `--canvas`, `--topic`.
|
|
220
222
|
- **The pack is evidence, not a summary.** It holds threads of work, newest first: agent runs, edits, milestones and approved proposals, each with the notes it touched, the change as it was recorded when it was made, and the links each note gained (`+ answers QUESTION-12` is a question getting its answer). Nothing in it summarises the window, so you narrate: say what moved as a few threads, which closed and which are still open, and name each note by its id. Add no cause or motive the lines do not state.
|
|
221
223
|
- **"Did my questions get answered?"** is `--type Question`: a note of another type that gained a link to a Question is in the pack, marked with why.
|
|
222
224
|
- **A pack says where it stops.** It lists about 80 notes in full, then names older threads by headline only. `coverage.detailedBackTo` is where the detail stops and `coverage.coveredBackTo` where the pack stops (both on the `Coverage:` line in text): run it again with `--until` set to either for what came before, and say so if you stop early.
|
|
223
|
-
- `--text` prints the same pack as text at about half the size of the JSON, which is what to read when you only narrate. `-q` prints the display id of every note the pack lists; open one with `cnotes notes get <id> --expand`.
|
|
225
|
+
- `--text` prints the same pack as text at about half the size of the JSON, which is what to read when you only narrate. `-q` prints the display id of every note the pack lists (as `<workspace id><TAB><note id>` when several workspaces are read); open one with `cnotes notes get <id> --expand`.
|
|
224
226
|
|