@creator-notes/cnotes 0.133.3 → 0.135.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/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -0
- package/dist/commands/brief.js +16 -6
- package/dist/commands/catchup.js +91 -0
- package/dist/commands/operations.js +21 -3
- package/dist/lib/conventions.js +62 -0
- package/dist/lib/mcp-spec.js +39 -0
- package/dist/mcp-server.js +6 -1
- package/dist/program.js +2 -0
- package/package.json +1 -1
- package/skills/cnotes/SKILL.md +2 -2
- package/skills/cnotes/references/operations.md +20 -0
- package/skills/cnotes/references/situations.md +1 -1
package/README.md
CHANGED
|
@@ -52,6 +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
56
|
| `cnotes relationships list` | `cnotes rel` | Note relationships |
|
|
56
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 |
|
|
57
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/brief.js
CHANGED
|
@@ -3,6 +3,7 @@ import { resolveConfig } from "../lib/config.js";
|
|
|
3
3
|
import { handleError, ValidationError } from "../lib/errors.js";
|
|
4
4
|
import { outputJson } from "../lib/output.js";
|
|
5
5
|
import { BEFORE_WRITING, briefIsEmpty, loadSessionBrief, renderBrief } from "../lib/session-brief.js";
|
|
6
|
+
import { conventionBriefLines, fetchConventions } from "../lib/conventions.js";
|
|
6
7
|
/**
|
|
7
8
|
* `cnotes brief "<task>"`: what the workspace already knows about a task,
|
|
8
9
|
* before you act on it. The same brief `operations begin --prompt` returns,
|
|
@@ -12,13 +13,15 @@ import { BEFORE_WRITING, briefIsEmpty, loadSessionBrief, renderBrief } from "../
|
|
|
12
13
|
export function registerBriefCommand(program) {
|
|
13
14
|
program
|
|
14
15
|
.command("brief")
|
|
15
|
-
.description("What the workspace already knows about a task:
|
|
16
|
-
"
|
|
17
|
-
"Run it before suggesting or doing anything.")
|
|
16
|
+
.description("What the workspace already knows about a task: its conventions (the standing rules " +
|
|
17
|
+
"people set), then the most relevant notes, canvases (matched by meaning through " +
|
|
18
|
+
"their digests) and recent changes on the topic. Run it before suggesting or doing anything.")
|
|
18
19
|
.argument("<task...>", "The task, in plain words")
|
|
19
20
|
.addHelpText("after", `
|
|
20
21
|
Read-only and free of credits. \`operations begin --prompt\` includes the same
|
|
21
|
-
brief, so you only need this when you are not opening a run.
|
|
22
|
+
brief, so you only need this when you are not opening a run. It opens with
|
|
23
|
+
the workspace's conventions, one title each (conventions.rules in --json): the
|
|
24
|
+
title is the rule, and \`cnotes notes get <id>\` has the why. The brief ends on
|
|
22
25
|
one line, beforeWriting in --json: name the kind of request before you write.
|
|
23
26
|
|
|
24
27
|
Examples:
|
|
@@ -32,12 +35,19 @@ Examples:
|
|
|
32
35
|
const task = words.join(" ").trim();
|
|
33
36
|
if (!task)
|
|
34
37
|
throw new ValidationError("Say what the task is, e.g. `cnotes brief \"reprice the Team plan\"`.");
|
|
35
|
-
const brief = await
|
|
38
|
+
const [brief, conventions] = await Promise.all([
|
|
39
|
+
loadSessionBrief(api, cfg.workspaceId, task),
|
|
40
|
+
fetchConventions(api, cfg.workspaceId),
|
|
41
|
+
]);
|
|
36
42
|
const result = brief ?? { query: task, notes: [], canvases: [], changes: [] };
|
|
37
43
|
if (cfg.json) {
|
|
38
|
-
outputJson({ ...result, beforeWriting: BEFORE_WRITING });
|
|
44
|
+
outputJson({ ...(conventions ? { conventions } : {}), ...result, beforeWriting: BEFORE_WRITING });
|
|
39
45
|
return;
|
|
40
46
|
}
|
|
47
|
+
// The rules hold whatever the task is, so they lead even when nothing matches it.
|
|
48
|
+
const conventionLines = conventionBriefLines(conventions);
|
|
49
|
+
if (conventionLines.length > 0)
|
|
50
|
+
console.log(`${conventionLines.join("\n")}\n`);
|
|
41
51
|
if (briefIsEmpty(result)) {
|
|
42
52
|
console.log(`Nothing in this workspace matches "${task}" yet.`);
|
|
43
53
|
console.log(`\n${BEFORE_WRITING}`);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ApiClient } from "../lib/api-client.js";
|
|
2
|
+
import { resolveConfig } from "../lib/config.js";
|
|
3
|
+
import { handleError, ValidationError } from "../lib/errors.js";
|
|
4
|
+
import { outputJson } from "../lib/output.js";
|
|
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
|
+
"a date (2026-11-14) or a date and time (2026-11-14T09:00:00Z).";
|
|
7
|
+
/** The query GET /api/catchup takes. The server parses the window, so "7d" means the same on every surface. */
|
|
8
|
+
export function catchupParams(workspaceId, opts) {
|
|
9
|
+
if (!opts.since?.trim())
|
|
10
|
+
throw new ValidationError(CATCHUP_SINCE_REQUIRED);
|
|
11
|
+
return {
|
|
12
|
+
workspaceId,
|
|
13
|
+
since: opts.since.trim(),
|
|
14
|
+
until: opts.until?.trim() || undefined,
|
|
15
|
+
person: opts.person?.trim() || undefined,
|
|
16
|
+
humansOnly: opts.humansOnly ? "true" : undefined,
|
|
17
|
+
types: opts.type?.trim() || undefined,
|
|
18
|
+
canvas: opts.canvas?.trim() || undefined,
|
|
19
|
+
topic: opts.topic?.trim() || undefined,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** Every note the pack shows, once, in the order the pack shows them. */
|
|
23
|
+
export function catchupNoteIds(pack) {
|
|
24
|
+
const seen = new Set();
|
|
25
|
+
for (const thread of pack.threads)
|
|
26
|
+
for (const note of thread.notes ?? [])
|
|
27
|
+
seen.add(note.id);
|
|
28
|
+
return Array.from(seen);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* `cnotes catchup --since 7d`: what changed in the workspace over a window,
|
|
32
|
+
* as evidence for the agent's own model to narrate. CreatorNotes writes no
|
|
33
|
+
* summary here: every line is the words of whoever made the change.
|
|
34
|
+
*/
|
|
35
|
+
export function registerCatchupCommand(program) {
|
|
36
|
+
program
|
|
37
|
+
.command("catchup")
|
|
38
|
+
.alias("catch-up")
|
|
39
|
+
.description("What changed in the workspace over a window, as evidence for you to narrate: threads of work " +
|
|
40
|
+
"(runs, edits, milestones, approved proposals) with the notes each touched, the links each note " +
|
|
41
|
+
"gained, and where the pack stops. Use it when someone asks to be caught up.")
|
|
42
|
+
.option("--since <when>", "Start of the window, required: 36h, 7d, 2w, 2026-11-14 or 2026-11-14T09:00:00Z")
|
|
43
|
+
.option("--until <when>", "End of the window (default: now)")
|
|
44
|
+
.option("--person <name>", "Only changes by one member: a name, part of one, or \"me\". Their agents count as them")
|
|
45
|
+
.option("--humans-only", "Leave out agent runs and CLI, MCP and import writes")
|
|
46
|
+
.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)")
|
|
48
|
+
.option("--topic <words>", "Only changes about a topic, matched by meaning over the change log")
|
|
49
|
+
.option("--text", "Print the pack as text even when piped: the same evidence, smaller than the JSON")
|
|
50
|
+
.addHelpText("after", `
|
|
51
|
+
Read-only and free of credits. The window is always yours to name: there is no
|
|
52
|
+
"since I last looked". Scopes combine, so "what has Ana done on pricing since
|
|
53
|
+
Tuesday" is --person, --topic and --since on one call.
|
|
54
|
+
|
|
55
|
+
The pack is evidence, not a summary. Tell the person what moved as a few
|
|
56
|
+
threads of work, say which closed and which are still open, and name each note
|
|
57
|
+
by its id. Every line was written by whoever made the change, so add no cause
|
|
58
|
+
the lines do not state. "Did any questions get answered?" is
|
|
59
|
+
--type Question: a note that gained a link to a Question is in the pack.
|
|
60
|
+
|
|
61
|
+
coverage.complete is false when the window held more than one pack: run the
|
|
62
|
+
command again with --until set to coverage.coveredBackTo for what came before.
|
|
63
|
+
-q prints the display id of every note in the pack.
|
|
64
|
+
|
|
65
|
+
Examples:
|
|
66
|
+
$ cnotes catchup --since 7d
|
|
67
|
+
$ cnotes catchup --since 2026-11-14 --person Ana --text
|
|
68
|
+
$ cnotes catchup --since 2w --type Decision,Question
|
|
69
|
+
$ cnotes catchup --since 7d --topic "pricing" --canvas CANVAS-12
|
|
70
|
+
`)
|
|
71
|
+
.action(async (opts) => {
|
|
72
|
+
const cfg = resolveConfig(program.opts());
|
|
73
|
+
const api = new ApiClient(cfg.serverUrl, cfg.token, cfg.workspaceId);
|
|
74
|
+
try {
|
|
75
|
+
const data = await api.get("/api/catchup", catchupParams(cfg.workspaceId, opts));
|
|
76
|
+
if (cfg.quiet) {
|
|
77
|
+
for (const id of catchupNoteIds(data.pack))
|
|
78
|
+
console.log(id);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (cfg.json && !opts.text) {
|
|
82
|
+
outputJson(data.pack);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
console.log(data.markdown);
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
handleError(error, cfg.json);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
@@ -9,6 +9,7 @@ import { loadConfig, setActiveAgentRunId, registerAgentRun, unregisterAgentRun,
|
|
|
9
9
|
import { resolveHostAgentSession } from "../lib/claude-session.js";
|
|
10
10
|
import { allWorkspaceRubrics, loadRubricMap } from "../lib/rubrics.js";
|
|
11
11
|
import { BEFORE_STOPPING, BEFORE_WRITING, briefIsEmpty, loadSessionBrief, renderBrief } from "../lib/session-brief.js";
|
|
12
|
+
import { conventionBriefLines, fetchConventions } from "../lib/conventions.js";
|
|
12
13
|
import { hasLessonFlags, lessonsFromFlags, postLessons, renderRecorded } from "../lib/lessons.js";
|
|
13
14
|
import { renderProposalsForCaller } from "../lib/waiting-proposals.js";
|
|
14
15
|
/**
|
|
@@ -47,7 +48,7 @@ export function registerOperationsCommands(program) {
|
|
|
47
48
|
.option("--rationale <text>", "Optional free-form rationale; shown on expand alongside the intent")
|
|
48
49
|
.option("--force", "If an active run already exists on this server, end it server-side and start a fresh one")
|
|
49
50
|
.option("--detached", "Open an independent run that does NOT become the active run on this server. Writes attach to it only while CNOTES_AGENT_RUN_ID=<its id> is set. Use when another agent may hold the active run on this machine.")
|
|
50
|
-
.option("--no-brief", "Skip the session brief (the notes, canvases and recent changes most relevant to --prompt)")
|
|
51
|
+
.option("--no-brief", "Skip the workspace's conventions and the session brief (the notes, canvases and recent changes most relevant to --prompt)")
|
|
51
52
|
.addHelpText("after", `
|
|
52
53
|
Examples:
|
|
53
54
|
$ cnotes operations begin --prompt "Drafted the Japan travel canvas" --json
|
|
@@ -77,6 +78,12 @@ that has a validationPrompt. Read the ones you will author BEFORE notes create
|
|
|
77
78
|
(or run cnotes types show <Type>). Post-write rubric echoes are too late to
|
|
78
79
|
guide the draft.
|
|
79
80
|
|
|
81
|
+
Begin also returns the workspace's conventions: the standing rules people set
|
|
82
|
+
for it, one title each (the title is the rule; \`cnotes notes get <id>\` has
|
|
83
|
+
the why). Follow them in what you write. --json carries them as
|
|
84
|
+
conventions.rules. A rule you are given that should hold for every later
|
|
85
|
+
session is a note of type Convention; see \`cnotes types show Convention\`.
|
|
86
|
+
|
|
80
87
|
With --prompt, begin also returns a brief of what the workspace already knows
|
|
81
88
|
about the task: the most relevant notes (decisions, guides, metrics, findings),
|
|
82
89
|
canvases matched by meaning through their digests, and recent changes on the
|
|
@@ -152,10 +159,14 @@ start fresh, or --detached to open your own run alongside it.
|
|
|
152
159
|
// operation, so this is the one call that already runs before authoring.
|
|
153
160
|
// Put validationPrompts in the begin response so agents see the standard
|
|
154
161
|
// before they draft — not as a post-write echo they can jq-filter away.
|
|
155
|
-
//
|
|
156
|
-
|
|
162
|
+
// The workspace's Conventions come the same way and for the same
|
|
163
|
+
// reason: a rule nobody showed the agent is a rule it breaks. They do
|
|
164
|
+
// not depend on --prompt, since they hold whatever the task is.
|
|
165
|
+
// All three lookups are best-effort and independent, so run them together.
|
|
166
|
+
const [rubricMap, brief, conventions] = await Promise.all([
|
|
157
167
|
loadRubricMap(api, cfg.workspaceId),
|
|
158
168
|
opts.brief === false ? Promise.resolve(null) : loadSessionBrief(api, cfg.workspaceId, opts.prompt),
|
|
169
|
+
opts.brief === false ? Promise.resolve(null) : fetchConventions(api, cfg.workspaceId),
|
|
159
170
|
]);
|
|
160
171
|
const typeRubrics = allWorkspaceRubrics(rubricMap);
|
|
161
172
|
reportHeadlineWarnings(readHeadlineWarnings(result));
|
|
@@ -175,6 +186,7 @@ start fresh, or --detached to open your own run alongside it.
|
|
|
175
186
|
activeRunPersisted: persisted,
|
|
176
187
|
detached: Boolean(opts.detached),
|
|
177
188
|
typeRubrics,
|
|
189
|
+
...(conventions ? { conventions } : {}),
|
|
178
190
|
...(brief ? { brief } : {}),
|
|
179
191
|
...(opts.brief === false ? {} : { beforeWriting: BEFORE_WRITING }),
|
|
180
192
|
});
|
|
@@ -202,6 +214,12 @@ start fresh, or --detached to open your own run alongside it.
|
|
|
202
214
|
for (const line of proposalLines)
|
|
203
215
|
console.log(line);
|
|
204
216
|
}
|
|
217
|
+
const conventionLines = conventionBriefLines(conventions);
|
|
218
|
+
if (conventionLines.length > 0) {
|
|
219
|
+
console.log("");
|
|
220
|
+
for (const line of conventionLines)
|
|
221
|
+
console.log(line);
|
|
222
|
+
}
|
|
205
223
|
if (brief && !briefIsEmpty(brief)) {
|
|
206
224
|
console.log("");
|
|
207
225
|
console.log("What the workspace already knows about this (read before acting):");
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export const CONVENTION_TYPE = "Convention";
|
|
2
|
+
/** The most rules one brief prints; past it the list says more exist. */
|
|
3
|
+
export const CONVENTIONS_LIMIT = 40;
|
|
4
|
+
/** The `/api/notes` query that lists a workspace's Conventions: titles, no bodies. */
|
|
5
|
+
export function conventionsQuery(workspaceId) {
|
|
6
|
+
return {
|
|
7
|
+
workspaceId,
|
|
8
|
+
types: CONVENTION_TYPE,
|
|
9
|
+
excludeContent: "true",
|
|
10
|
+
excludeDrafts: "true",
|
|
11
|
+
fields: "displayId,title,type,createdAt",
|
|
12
|
+
// One past the cap, so "more exist" is known without a count.
|
|
13
|
+
limit: String(CONVENTIONS_LIMIT + 1),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The rules in an `/api/notes` answer, oldest first so the list reads the same
|
|
18
|
+
* from one session to the next and a new rule lands at the end. Null when
|
|
19
|
+
* there are none. A row that is not a titled Convention is dropped rather than
|
|
20
|
+
* trusted: whatever this returns is printed to an agent as a rule to follow.
|
|
21
|
+
*/
|
|
22
|
+
export function conventionsFromNotes(data) {
|
|
23
|
+
const rows = Array.isArray(data) ? data : [];
|
|
24
|
+
const found = [];
|
|
25
|
+
for (const row of rows) {
|
|
26
|
+
if (!row || row.type !== CONVENTION_TYPE)
|
|
27
|
+
continue;
|
|
28
|
+
const displayId = typeof row.displayId === "string" ? row.displayId : "";
|
|
29
|
+
const title = typeof row.title === "string" ? row.title.replace(/\s+/g, " ").trim() : "";
|
|
30
|
+
if (!displayId || !title)
|
|
31
|
+
continue;
|
|
32
|
+
found.push({ displayId, title, createdAt: typeof row.createdAt === "string" ? row.createdAt : "" });
|
|
33
|
+
}
|
|
34
|
+
if (found.length === 0)
|
|
35
|
+
return null;
|
|
36
|
+
// The route answers most recently changed first, so the cap keeps those.
|
|
37
|
+
const kept = found.slice(0, CONVENTIONS_LIMIT);
|
|
38
|
+
kept.sort((a, b) => a.createdAt.localeCompare(b.createdAt) || a.displayId.localeCompare(b.displayId));
|
|
39
|
+
return {
|
|
40
|
+
rules: kept.map(({ displayId, title }) => ({ displayId, title })),
|
|
41
|
+
more: found.length > CONVENTIONS_LIMIT,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** What the list is, said once above it, in the words every surface uses. */
|
|
45
|
+
export const CONVENTIONS_LEAD = "Conventions: standing rules people set for this workspace. Follow them in what you write; open one for the why.";
|
|
46
|
+
/** The workspace's Conventions, or null when it has none or the lookup failed. Never throws. */
|
|
47
|
+
export async function fetchConventions(api, workspaceId) {
|
|
48
|
+
return api
|
|
49
|
+
.get("/api/notes", conventionsQuery(workspaceId))
|
|
50
|
+
.then(conventionsFromNotes)
|
|
51
|
+
.catch(() => null);
|
|
52
|
+
}
|
|
53
|
+
/** The block as the brief prints it. Empty when there are none. */
|
|
54
|
+
export function conventionBriefLines(conventions) {
|
|
55
|
+
if (!conventions || conventions.rules.length === 0)
|
|
56
|
+
return [];
|
|
57
|
+
return [
|
|
58
|
+
CONVENTIONS_LEAD,
|
|
59
|
+
...conventions.rules.map((rule) => ` ${rule.displayId} ${rule.title}`),
|
|
60
|
+
...(conventions.more ? [" More exist: cnotes notes list --type Convention"] : []),
|
|
61
|
+
];
|
|
62
|
+
}
|
package/dist/lib/mcp-spec.js
CHANGED
|
@@ -10,6 +10,7 @@ export const SHARED_TOOL_NAMES = [
|
|
|
10
10
|
"cnotes_canvas_search",
|
|
11
11
|
"cnotes_canvas_update",
|
|
12
12
|
"cnotes_canvas_update_section",
|
|
13
|
+
"cnotes_catch_up",
|
|
13
14
|
"cnotes_focus_cancel",
|
|
14
15
|
"cnotes_focus_list",
|
|
15
16
|
"cnotes_focus_plan",
|
|
@@ -473,6 +474,27 @@ export function buildMcpSpec(z, opts) {
|
|
|
473
474
|
unarchive: z.boolean().optional().describe("Older spelling of archived: false"),
|
|
474
475
|
},
|
|
475
476
|
},
|
|
477
|
+
cnotes_catch_up: {
|
|
478
|
+
description: "Catch the user up: what changed in the workspace over a window they name, as evidence for YOU to narrate. Returns threads of work, newest first (agent runs, edits, milestones, approved proposals), each with the notes it touched, what changed in its author's own words, 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 written by whoever made the change, so add no cause the lines do not state. When the Coverage line says the pack stops partway, call again with `until` set to the instant it names.",
|
|
479
|
+
shape: {
|
|
480
|
+
since: z
|
|
481
|
+
.string()
|
|
482
|
+
.describe("Start of the window, required: a span back from now (36h, 7d, 2w), a date (2026-11-14) or a date and time (2026-11-14T09:00:00Z)"),
|
|
483
|
+
until: z.string().optional().describe("End of the window, in the same forms (default: now)"),
|
|
484
|
+
person: z
|
|
485
|
+
.string()
|
|
486
|
+
.optional()
|
|
487
|
+
.describe("Only changes by one member: a name, part of one, or \"me\". Agents acting for them count as them. A name that fits two members is refused with the names to pick from"),
|
|
488
|
+
humansOnly: z.boolean().optional().describe("true = leave out agent runs and CLI, MCP and import writes"),
|
|
489
|
+
types: z
|
|
490
|
+
.array(z.string())
|
|
491
|
+
.max(20)
|
|
492
|
+
.optional()
|
|
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)"),
|
|
495
|
+
topic: z.string().optional().describe("Only changes about a topic, matched by meaning over the change log (e.g. \"pricing\")"),
|
|
496
|
+
},
|
|
497
|
+
},
|
|
476
498
|
cnotes_types_list: {
|
|
477
499
|
description: "List the note types (supertags) available in this workspace, with each type's validationPrompt — the rubric a note of that type is expected to meet. Read this BEFORE creating notes: cnotes_notes_create rejects a type that does not exist, and writing to the rubric is what makes a note land well-formed.",
|
|
478
500
|
shape: {},
|
|
@@ -480,6 +502,23 @@ export function buildMcpSpec(z, opts) {
|
|
|
480
502
|
};
|
|
481
503
|
return { tools, intent, layoutNode, layoutEdge };
|
|
482
504
|
}
|
|
505
|
+
/**
|
|
506
|
+
* The query GET /api/catchup takes for a cnotes_catch_up call. The server
|
|
507
|
+
* parses the window, so both MCP servers and the CLI read "7d" the same way.
|
|
508
|
+
*/
|
|
509
|
+
export function catchUpQuery(workspaceId, args) {
|
|
510
|
+
const types = (args.types ?? []).map((t) => t.trim()).filter(Boolean);
|
|
511
|
+
return {
|
|
512
|
+
workspaceId,
|
|
513
|
+
since: args.since.trim(),
|
|
514
|
+
until: args.until?.trim() || undefined,
|
|
515
|
+
person: args.person?.trim() || undefined,
|
|
516
|
+
humansOnly: args.humansOnly ? "true" : undefined,
|
|
517
|
+
types: types.length ? types.join(",") : undefined,
|
|
518
|
+
canvas: args.canvasId?.trim() || undefined,
|
|
519
|
+
topic: args.topic?.trim() || undefined,
|
|
520
|
+
};
|
|
521
|
+
}
|
|
483
522
|
/** An `arrow` argument as the canvas route's arrowStart/arrowEnd. Omitted sends neither. */
|
|
484
523
|
export function arrowToMarkers(arrow) {
|
|
485
524
|
switch (arrow) {
|
package/dist/mcp-server.js
CHANGED
|
@@ -25,7 +25,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
25
25
|
import { z } from "zod";
|
|
26
26
|
import { ApiClient } from "./lib/api-client.js";
|
|
27
27
|
import { ApiError, CliError, NotFoundError } from "./lib/errors.js";
|
|
28
|
-
import { arrowToMarkers, buildMcpSpec, notesExpandQuery, notesUpdateBody, orderByDisplayId, planSectionTool, refusalText, } from "./lib/mcp-spec.js";
|
|
28
|
+
import { arrowToMarkers, buildMcpSpec, catchUpQuery, notesExpandQuery, notesUpdateBody, orderByDisplayId, planSectionTool, refusalText, } from "./lib/mcp-spec.js";
|
|
29
29
|
import { CANVAS_GOAL_DESCRIPTION } from "./lib/canvas-goal.js";
|
|
30
30
|
import { parseStart as parseFocusStart } from "./lib/focus-time.js";
|
|
31
31
|
import { resolveNoteId } from "./lib/resolve-note.js";
|
|
@@ -412,6 +412,11 @@ sharedTool("cnotes_canvas_read", async ({ canvasId, full }) => withErrorHandling
|
|
|
412
412
|
});
|
|
413
413
|
return read.markdown;
|
|
414
414
|
}, { text: true }));
|
|
415
|
+
sharedTool("cnotes_catch_up", async (args) => withErrorHandling(async () => {
|
|
416
|
+
// The pack as text: the same evidence `cnotes catchup --text` prints.
|
|
417
|
+
const read = await api.get("/api/catchup", catchUpQuery(workspaceId, args));
|
|
418
|
+
return read.markdown;
|
|
419
|
+
}, { text: true }));
|
|
415
420
|
sharedTool("cnotes_canvas_read_section", async ({ section, full }) => withErrorHandling(async () => {
|
|
416
421
|
const read = await api.get("/api/canvas/read", {
|
|
417
422
|
section,
|
package/dist/program.js
CHANGED
|
@@ -31,6 +31,7 @@ import { registerOperationsCommands } from "./commands/operations.js";
|
|
|
31
31
|
import { registerFeedbackCommands } from "./commands/feedback.js";
|
|
32
32
|
import { registerQualityCommands } from "./commands/quality.js";
|
|
33
33
|
import { registerBriefCommand } from "./commands/brief.js";
|
|
34
|
+
import { registerCatchupCommand } from "./commands/catchup.js";
|
|
34
35
|
import { registerLessonsCommands } from "./commands/lessons.js";
|
|
35
36
|
import { registerSkillsCommands } from "./commands/skills.js";
|
|
36
37
|
import { registerClaudeHookCommand } from "./commands/claude-hook.js";
|
|
@@ -145,6 +146,7 @@ Env vars:
|
|
|
145
146
|
registerOperationsCommands(program);
|
|
146
147
|
registerQualityCommands(program);
|
|
147
148
|
registerBriefCommand(program);
|
|
149
|
+
registerCatchupCommand(program);
|
|
148
150
|
registerLessonsCommands(program);
|
|
149
151
|
registerFeedbackCommands(program);
|
|
150
152
|
registerSkillsCommands(program);
|
package/package.json
CHANGED
package/skills/cnotes/SKILL.md
CHANGED
|
@@ -17,7 +17,7 @@ Every note and canvas you write is context: what the next reader, a teammate or
|
|
|
17
17
|
|
|
18
18
|
Each call costs the user a model round trip, so batch, and send independent calls together. Reads need no run.
|
|
19
19
|
|
|
20
|
-
1. **Read, in parallel.** `cnotes workspace current` names the workspace and its relationship types (`-w <id>` targets another for one command). `cnotes brief "<task>"` returns the notes, canvases and recent changes most relevant to the task, with what earlier runs made of each (`lesson:` under a note; `Start here` lists the notes runs keep finding useful): read a correction before relying on the note it sits on. `cnotes search "<topic>"` finds notes, canvases and images in one call; a first line `Not in the workspace: …` names words no note holds, so say that rather than answer from the nearest note. `cnotes notes get <id> --expand` loads a note with the notes it rests on; a `Checked by:` line means a person confirmed that version with a passkey, so lean on it over an unchecked note. You cannot make that mark: when a decision rests on an unchecked note, ask the person in the chat to open it and choose ⋯ › Mark as checked. Before changing a canvas, `cnotes canvas read <canvasId>` (or `read-section SECTION-n` when the request names a frame). `cnotes types show <Type>` for each type you will write: author to its rubric. A Decision or Guide you find may already settle what you were about to propose.
|
|
20
|
+
1. **Read, in parallel.** `cnotes workspace current` names the workspace and its relationship types (`-w <id>` targets another for one command). `cnotes brief "<task>"` returns the workspace's conventions (standing rules people set: follow them), then the notes, canvases and recent changes most relevant to the task, with what earlier runs made of each (`lesson:` under a note; `Start here` lists the notes runs keep finding useful): read a correction before relying on the note it sits on. `cnotes search "<topic>"` finds notes, canvases and images in one call; a first line `Not in the workspace: …` names words no note holds, so say that rather than answer from the nearest note. `cnotes notes get <id> --expand` loads a note with the notes it rests on; a `Checked by:` line means a person confirmed that version with a passkey, so lean on it over an unchecked note. You cannot make that mark: when a decision rests on an unchecked note, ask the person in the chat to open it and choose ⋯ › Mark as checked. Before changing a canvas, `cnotes canvas read <canvasId>` (or `read-section SECTION-n` when the request names a frame). `cnotes types show <Type>` for each type you will write: author to its rubric. A Decision or Guide you find may already settle what you were about to propose.
|
|
21
21
|
2. **Name the kind of request.** [references/situations.md](references/situations.md) sorts it into one of 13 rows by what the person will do with the result, and each row says what to write, how to lay it out and how to check it. The first row is no board: most requests want the work done or a plain answer, and at most one note.
|
|
22
22
|
3. **Write once, with `--intent`.** `--intent "<headline>"` opens an agent run for that one command and closes it after, so the change lands on the timeline as one revertable run; a removal gets a before snapshot. When a run is already open, the write joins it. To add cards, create and place them together:
|
|
23
23
|
```json
|
|
@@ -127,7 +127,7 @@ After you create a canvas or finish changing one, end your reply with its link,
|
|
|
127
127
|
| Deciding what goes on a canvas as a note, face, text card, list, frame, edge or portal; the banner; completion tests | [references/canvas-elements.md](references/canvas-elements.md) |
|
|
128
128
|
| Placing or rearranging several items (`canvas place`, `arrange`) | [references/canvas-layout.md](references/canvas-layout.md) |
|
|
129
129
|
| Using any other canvas command: read, add, edit, move, remove, edges, templates, milestones, digest | [references/canvas.md](references/canvas.md) |
|
|
130
|
-
| Running two agents at once, bracketing canvas edits, verifying attribution, reading the timeline | [references/operations.md](references/operations.md) |
|
|
130
|
+
| Running two agents at once, bracketing canvas edits, verifying attribution, reading the timeline, catching someone up (`cnotes catchup --since 7d`) | [references/operations.md](references/operations.md) |
|
|
131
131
|
| Reworking notes or a board other people read, or asked to draft | [references/drafts.md](references/drafts.md) |
|
|
132
132
|
| Another agent works in the same workspace: handing over, reviewing its proposal, overlaps, when to stop | [references/agents-together.md](references/agents-together.md) |
|
|
133
133
|
| Reviewing (propose the fix, or comment), addressing comments, requesting or answering a review, checking what teammates shared | [references/reviews-and-comments.md](references/reviews-and-comments.md) |
|
|
@@ -12,6 +12,7 @@ Read this for the detail behind `operations begin`/`end`: when to wrap, two agen
|
|
|
12
12
|
- [Handing off mid-work](#handing-off-mid-work)
|
|
13
13
|
- [Canvas agent-runs](#canvas-agent-runs)
|
|
14
14
|
- [Timeline (`cnotes timeline` / `cnotes tl`)](#timeline-cnotes-timeline--cnotes-tl)
|
|
15
|
+
- [Catching someone up (`cnotes catchup`)](#catching-someone-up-cnotes-catchup)
|
|
15
16
|
|
|
16
17
|
When an AI agent is doing a **batch of work**, creating notes, modifying 2+ entities, or building a canvas with content, wrap it in a workspace-level **operation**. The batch then shows up in the timeline as a single legible row with intent + evidence + count, and the user can later revert the whole run as one unit. Unwrapped, each write is an isolated timeline row with no shared intent or batch revert, and on canvas and other multi-write paths nothing forces the wrap, so you must open the run yourself.
|
|
17
18
|
|
|
@@ -202,3 +203,22 @@ cnotes timeline --query "auth decision" --since 30d # search within a window
|
|
|
202
203
|
# --json returns { mode: "search", query, results: [{ displayId, versionNumber,
|
|
203
204
|
# changeDescription, snippet, createdAt, score, ... }] }
|
|
204
205
|
```
|
|
206
|
+
|
|
207
|
+
## Catching someone up (`cnotes catchup`)
|
|
208
|
+
|
|
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
|
+
|
|
211
|
+
```bash
|
|
212
|
+
cnotes catchup --since 7d --text # the last week, as text
|
|
213
|
+
cnotes catchup --since 2026-11-14 --person Ana # one member; their agents count as them
|
|
214
|
+
cnotes catchup --since 2w --type Decision,Question
|
|
215
|
+
cnotes catchup --since 7d --topic "pricing" --canvas CANVAS-12
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
- **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.
|
|
219
|
+
- **Scopes combine.** `--person` (a name, part of one, or "me"; a name that fits two members is refused with the names to pick from), `--humans-only`, `--type`, `--canvas`, `--topic`.
|
|
220
|
+
- **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 in its author's own words, and the links each note gained (`+ answers QUESTION-12` is a question getting its answer). CreatorNotes wrote none of it, 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
|
+
- **"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
|
+
- **A pack says where it stops.** `coverage.complete: false` (the `Coverage:` line in text) means the window held more than one pack. Run it again with `--until` set to `coverage.coveredBackTo` for what came before, and say so if you stop early.
|
|
223
|
+
- `--text` prints the same pack as text, smaller than the JSON, which is what to read when you only narrate. `-q` prints the display id of every note in the pack; open one with `cnotes notes get <id> --expand`.
|
|
224
|
+
|
|
@@ -95,7 +95,7 @@ The second and third questions are rarely answered in the request. Assume the ch
|
|
|
95
95
|
|
|
96
96
|
In the middle of other work, with nobody asking for a note, write one when the next session would otherwise have to be told again:
|
|
97
97
|
|
|
98
|
-
- **You were corrected**, by a person or by your own check. Write the rule that was right.
|
|
98
|
+
- **You were corrected**, by a person or by your own check. Write the rule that was right. When a person set a rule that should hold for every later session ("we write CreatorNotes as one word"), write it as a Convention: the title is the rule, the body says why and who set it. Every brief and canvas read then opens with it, for every agent in the workspace. Only a rule a person set is a Convention, never your own preference.
|
|
99
99
|
- **A decision was made** with its reasons. Write a Decision, and only what the person said.
|
|
100
100
|
- **A fact changed.** Write the new fact as a successor and link it to the note it replaces.
|
|
101
101
|
- **The work is pausing** or the context is about to reset. Write a handoff note.
|