@creator-notes/cnotes 0.129.1 → 0.131.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/dist/commands/canvas-milestone.js +5 -5
- package/dist/commands/canvas.js +22 -5
- package/dist/lib/mcp-spec.js +4 -2
- package/dist/lib/share-link.js +10 -0
- package/dist/mcp-server.js +13 -4
- package/package.json +1 -1
- package/skills/cnotes/SKILL.md +1 -1
- package/skills/cnotes/references/canvas.md +16 -2
- package/skills/cnotes/references/output.md +1 -1
|
@@ -76,7 +76,7 @@ Examples:
|
|
|
76
76
|
outputJson(data);
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
console.log(`Saved milestone
|
|
79
|
+
console.log(`Saved milestone M${data.snapshotNumber}`);
|
|
80
80
|
console.log(` ${data.headline}`);
|
|
81
81
|
if (typeof data.body === "string" && data.body) {
|
|
82
82
|
console.log("");
|
|
@@ -115,7 +115,7 @@ Examples:
|
|
|
115
115
|
outputJson(data);
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
console.log(`Renamed milestone
|
|
118
|
+
console.log(`Renamed milestone M${data.snapshotNumber}`);
|
|
119
119
|
if (typeof data.previousHeadline === "string" && data.previousHeadline) {
|
|
120
120
|
console.log(` was: ${data.previousHeadline}`);
|
|
121
121
|
}
|
|
@@ -156,9 +156,9 @@ Examples:
|
|
|
156
156
|
console.log("No milestones yet.");
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
outputTable(["WHEN", "
|
|
159
|
+
outputTable(["WHEN", "M", "WHO", "HEADLINE"], rows.map((row) => [
|
|
160
160
|
timeAgo(row.createdAt),
|
|
161
|
-
`
|
|
161
|
+
`M${row.snapshotNumber}`,
|
|
162
162
|
String(row.createdBySource ?? "human"),
|
|
163
163
|
truncate(String(row.headline ?? "(no description)"), 60),
|
|
164
164
|
]));
|
|
@@ -190,7 +190,7 @@ Examples:
|
|
|
190
190
|
outputJson(data);
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
console.log(`
|
|
193
|
+
console.log(`M${row.snapshotNumber} · ${row.createdBySource ?? "human"} · ${timeAgo(row.createdAt)}`);
|
|
194
194
|
console.log(String(row.headline ?? "(no description)"));
|
|
195
195
|
if (typeof row.body === "string" && row.body) {
|
|
196
196
|
console.log("");
|
package/dist/commands/canvas.js
CHANGED
|
@@ -10,7 +10,7 @@ import { loadConfig, setActiveAgentRunId, registerAgentRun, unregisterAgentRun,
|
|
|
10
10
|
import { authorLabel, outputJson, outputTable, outputQuiet, truncate, timeAgo } from "../lib/output.js";
|
|
11
11
|
import { readHeadlineWarnings, reportHeadlineWarnings } from "../lib/headline-warnings.js";
|
|
12
12
|
import { formatDoneParts } from "../lib/done-parts.js";
|
|
13
|
-
import { parseSharedCanvasLink, sameServerOrigin } from "../lib/share-link.js";
|
|
13
|
+
import { parseSharedCanvasLink, readBudgetParams, sameServerOrigin } from "../lib/share-link.js";
|
|
14
14
|
import { resolveHostAgentSession } from "../lib/claude-session.js";
|
|
15
15
|
import { WARN, dim } from "../lib/style.js";
|
|
16
16
|
import { findOverlaps, findFrameSpills, layoutItemsFrom, parseSize, resolveAnchor, suggestFreeSpot, } from "../lib/canvas-layout.js";
|
|
@@ -932,15 +932,26 @@ Examples:
|
|
|
932
932
|
registerCanvasMilestoneCommands(canvas, program);
|
|
933
933
|
canvas
|
|
934
934
|
.command("read")
|
|
935
|
-
.description("Read
|
|
936
|
-
"
|
|
937
|
-
"
|
|
935
|
+
.description("Read a canvas as one markdown document, in display order (top-to-bottom, " +
|
|
936
|
+
"then left-to-right), grouped by section frame. A board that fits one read " +
|
|
937
|
+
"comes back with every note's body. A longer one comes back as its map: one " +
|
|
938
|
+
"line per card, with the command that opens one frame.")
|
|
938
939
|
.argument("<canvas>", "Canvas ID, CANVAS-<n> display ID, or a share link (https://…/shared/<id>)")
|
|
939
940
|
.option("--shared", "Read <canvas> (a raw id) through its share link, outside your workspaces")
|
|
941
|
+
.option("--full", "Every body on the board, however long. Without it a board over 60,000 characters reads as its map.")
|
|
940
942
|
.addHelpText("after", `
|
|
941
943
|
Examples:
|
|
942
944
|
$ cnotes canvas read <canvasId>
|
|
943
945
|
$ cnotes canvas read CANVAS-12
|
|
946
|
+
$ cnotes canvas read CANVAS-12 --full # every body, for work across the whole board
|
|
947
|
+
|
|
948
|
+
A map lists each frame with its cards (id, title, version, last edit, size of
|
|
949
|
+
the body) and the edges. From it, open what the work needs:
|
|
950
|
+
$ cnotes canvas read-section SECTION-7 # one frame, bodies included
|
|
951
|
+
$ cnotes notes get DECISION-3 INSIGHT-9 # chosen notes
|
|
952
|
+
With --json (and whenever the output is piped) a map starts with level ("cards"
|
|
953
|
+
or "frames"), fullChars and next, the commands above; each frame then lists its
|
|
954
|
+
cards under lines, one string per card.
|
|
944
955
|
|
|
945
956
|
# Someone sent you a share link: no workspace needed, it may not be yours
|
|
946
957
|
$ cnotes canvas read https://creatornotes.app/shared/kh75rxrt0bt2r0rzxe7se7tajh8fjwph
|
|
@@ -964,6 +975,7 @@ workspaces. Notes inside lists or linked canvases keep their own access.
|
|
|
964
975
|
const read = await api.get("/api/canvas/read", {
|
|
965
976
|
canvas: link ? link.canvasId : canvasRef,
|
|
966
977
|
...(shared ? { shared: "true" } : { workspaceId: cfg.workspaceId }),
|
|
978
|
+
...readBudgetParams(opts.full, "cli"),
|
|
967
979
|
});
|
|
968
980
|
if (cfg.json) {
|
|
969
981
|
outputJson(read.result);
|
|
@@ -983,21 +995,26 @@ workspaces. Notes inside lists or linked canvases keep their own access.
|
|
|
983
995
|
"resolved for you, so this is the one call for \"look at SECTION-6GC\" " +
|
|
984
996
|
"rather than reading a whole canvas and filtering it by eye.")
|
|
985
997
|
.argument("<section>", "Section to read — SECTION-<n> display ID or a raw node ID")
|
|
998
|
+
.option("--full", "Every body in the frame, however long. Without it a frame over 60,000 characters reads as its list of cards.")
|
|
986
999
|
.addHelpText("after", `
|
|
987
1000
|
Examples:
|
|
988
1001
|
# Read a section without knowing which canvas holds it
|
|
989
1002
|
$ cnotes canvas read-section SECTION-6GC
|
|
990
1003
|
|
|
1004
|
+
# A frame holding a long transcript lists its cards instead; this prints every body
|
|
1005
|
+
$ cnotes canvas read-section SECTION-6GC --full
|
|
1006
|
+
|
|
991
1007
|
# Structured form, for parsing
|
|
992
1008
|
$ cnotes canvas read-section SECTION-6GC --json
|
|
993
1009
|
`)
|
|
994
|
-
.action(async (section) => {
|
|
1010
|
+
.action(async (section, opts) => {
|
|
995
1011
|
const cfg = resolveConfig(program.opts());
|
|
996
1012
|
const api = new ApiClient(cfg.serverUrl, cfg.token, cfg.workspaceId);
|
|
997
1013
|
try {
|
|
998
1014
|
const read = await api.get("/api/canvas/read", {
|
|
999
1015
|
section,
|
|
1000
1016
|
workspaceId: cfg.workspaceId,
|
|
1017
|
+
...readBudgetParams(opts.full, "cli"),
|
|
1001
1018
|
});
|
|
1002
1019
|
if (cfg.json) {
|
|
1003
1020
|
outputJson(read.result);
|
package/dist/lib/mcp-spec.js
CHANGED
|
@@ -269,15 +269,17 @@ export function buildMcpSpec(z, opts) {
|
|
|
269
269
|
},
|
|
270
270
|
},
|
|
271
271
|
cnotes_canvas_read: {
|
|
272
|
-
description: "Read
|
|
272
|
+
description: "Read a canvas as one markdown document, in display order (top-to-bottom, then left-to-right), grouped by section frame. A board that fits one read comes back with every note's body, so you can think across it in a single round-trip; prefer it over cnotes_canvas_get followed by many note fetches. A longer board comes back as its MAP: one line per card (id, title, version, last edit, size of the body) under its frame, plus the edges. From the map, open one frame with cnotes_canvas_read_section or chosen notes with cnotes_notes_get; a title is not the note, so open a body before you quote, judge or change it. Also accepts a share link (https://…/shared/<id>) someone sent the user: it is read with the access that link gives the same account in a browser, even when the canvas is outside the user's workspaces.",
|
|
273
273
|
shape: {
|
|
274
274
|
canvasId: z.string().describe("Canvas ID, display ID (e.g. CANVAS-12), or a share link (https://…/shared/<id>)"),
|
|
275
|
+
full: z.boolean().optional().describe("true = every body on the board, however long. Leave it out unless the work needs the whole board at once: a board over 60,000 characters then comes back as its map"),
|
|
275
276
|
},
|
|
276
277
|
},
|
|
277
278
|
cnotes_canvas_read_section: {
|
|
278
|
-
description: "Read ONE section frame of a canvas as markdown: every note, sticky, list and portal whose center sits inside it, any frame nested within it, plus the edges it touches (an edge leaving the frame reports where it goes). Takes the SECTION-<n> handle on its own; the canvas is resolved for you. Use it when the user names a group of cards by its frame (\"look at SECTION-6GC\", \"what's in the risks section\") instead of reading the whole canvas.",
|
|
279
|
+
description: "Read ONE section frame of a canvas as markdown: every note, sticky, list and portal whose center sits inside it, any frame nested within it, plus the edges it touches (an edge leaving the frame reports where it goes). Takes the SECTION-<n> handle on its own; the canvas is resolved for you. Use it when the user names a group of cards by its frame (\"look at SECTION-6GC\", \"what's in the risks section\") instead of reading the whole canvas, and to open one frame from a canvas map. A frame over 60,000 characters comes back as its list of cards; open the ones you need with cnotes_notes_get.",
|
|
279
280
|
shape: {
|
|
280
281
|
section: z.string().describe("Section handle: SECTION-<n> display ID, or a raw section node ID"),
|
|
282
|
+
full: z.boolean().optional().describe("true = every body in the frame, however long"),
|
|
281
283
|
},
|
|
282
284
|
},
|
|
283
285
|
cnotes_canvas_search: {
|
package/dist/lib/share-link.js
CHANGED
|
@@ -30,3 +30,13 @@ export function sameServerOrigin(linkOrigin, serverUrl) {
|
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* The most characters of markdown one read asks the server for before it
|
|
35
|
+
* answers with a map instead (lib/canvas-read/map.ts CANVAS_READ_BUDGET, which
|
|
36
|
+
* says where the number comes from; the guardrail test pins the two together).
|
|
37
|
+
*/
|
|
38
|
+
export const CANVAS_READ_BUDGET = 60_000;
|
|
39
|
+
/** The query a read sends: the budget, unless the caller asked for every body. */
|
|
40
|
+
export function readBudgetParams(full, hints) {
|
|
41
|
+
return full ? {} : { budget: String(CANVAS_READ_BUDGET), hints };
|
|
42
|
+
}
|
package/dist/mcp-server.js
CHANGED
|
@@ -29,6 +29,7 @@ import { arrowToMarkers, buildMcpSpec, notesExpandQuery, notesUpdateBody, orderB
|
|
|
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";
|
|
32
|
+
import { readBudgetParams } from "./lib/share-link.js";
|
|
32
33
|
import { findOverlaps, layoutItemsFrom, resolveAnchor, suggestFreeSpot } from "./lib/canvas-layout.js";
|
|
33
34
|
import { boardChecks } from "./lib/board-checks.js";
|
|
34
35
|
import { buildSchema } from "./lib/build-schema.js";
|
|
@@ -402,13 +403,21 @@ server.tool("cnotes_canvas_status", "See a canvas's whole layout BEFORE placing
|
|
|
402
403
|
const spot = suggestFreeSpot(items, anchor, { width, height });
|
|
403
404
|
return { items, overlaps, ...checks, freeSpot: spot ? { ...spot, width, height, near } : null };
|
|
404
405
|
}));
|
|
405
|
-
sharedTool("cnotes_canvas_read", async ({ canvasId }) => withErrorHandling(async () => {
|
|
406
|
+
sharedTool("cnotes_canvas_read", async ({ canvasId, full }) => withErrorHandling(async () => {
|
|
406
407
|
// The server reads share links too (access=shared, no workspace).
|
|
407
|
-
const read = await api.get("/api/canvas/read", {
|
|
408
|
+
const read = await api.get("/api/canvas/read", {
|
|
409
|
+
canvas: canvasId,
|
|
410
|
+
workspaceId,
|
|
411
|
+
...readBudgetParams(full, "mcp"),
|
|
412
|
+
});
|
|
408
413
|
return read.markdown;
|
|
409
414
|
}, { text: true }));
|
|
410
|
-
sharedTool("cnotes_canvas_read_section", async ({ section }) => withErrorHandling(async () => {
|
|
411
|
-
const read = await api.get("/api/canvas/read", {
|
|
415
|
+
sharedTool("cnotes_canvas_read_section", async ({ section, full }) => withErrorHandling(async () => {
|
|
416
|
+
const read = await api.get("/api/canvas/read", {
|
|
417
|
+
section,
|
|
418
|
+
workspaceId,
|
|
419
|
+
...readBudgetParams(full, "mcp"),
|
|
420
|
+
});
|
|
412
421
|
return read.markdown;
|
|
413
422
|
}, { text: true }));
|
|
414
423
|
sharedTool("cnotes_canvas_create", async ({ name, goal, targetAudience, doc, notes, intent }) => withErrorHandling(() => inRun(intent, () => api.post("/api/canvas", {
|
package/package.json
CHANGED
package/skills/cnotes/SKILL.md
CHANGED
|
@@ -48,7 +48,7 @@ When the writes belong together but cannot be one command (several notes and new
|
|
|
48
48
|
1. `cnotes operations begin --prompt "<past-tense headline, e.g. Added a risks list to the Q1 roadmap>" --json`, as its own command; check its exit code before writing (a pipe hides it). The response carries `typeRubrics`, the brief, and the proposals waiting on you (read those first, [references/drafts.md](references/drafts.md) step 8); `-q` prints only the run id. Canvas writes in one run stay on one canvas: end it and begin another before touching a second board.
|
|
49
49
|
2. Write. Audience-facing prose (note bodies, banners, pre-reads) goes through [references/humanizer.md](references/humanizer.md) first; transcripts, quotes and other raw capture are stored verbatim.
|
|
50
50
|
3. **Grade what you wrote.** `cnotes quality <displayIds...> --fail-below 4` hands back each note's rubric and body. Grade them all at once with `cnotes quality record --grades-file grades.json` (one `{displayId, level, criteria, nextStep?, gradedVersion?}` per note, one reason per rubric criterion), then revise only a note below 4 with `cnotes versions create`. A level 3 with `unsure: true` and nothing under `missing`, or a `needs_agent` answer, means the server grader abstained: read the note yourself.
|
|
51
|
-
4. **Read it back.** `cnotes canvas status <canvasId>` reports the size of the board's read and its stale links; fix what it flags. Then `cnotes canvas read <canvasId
|
|
51
|
+
4. **Read it back.** `cnotes canvas status <canvasId>` reports the size of the board's read and its stale links; fix what it flags. Then `cnotes canvas read <canvasId>` (a long board answers with its map; read the frame you changed with `read-section`): every claim appears in a note with a display ID, the spine reads at fit zoom as faces and connectives, the hero is the board's plain name and the banner carries the claim, and the banner makes sense to someone who was not in the session and never says who asked for the board. A write that touches no canvas gets the same test with `cnotes notes get <id> --expand`, read as the next session will.
|
|
52
52
|
5. **Close with what the notes were worth.** `cnotes operations end --useful <ids> --dead-end <ids>` names the notes that answered the task and the ones that led nowhere; `--corrected <id> --correction "<what was right>"` marks one that was wrong (fix it with `versions create` too, when you can). The next run's brief starts from these. Then link the result.
|
|
53
53
|
|
|
54
54
|
## Rules that hold on every task
|
|
@@ -48,7 +48,19 @@ cnotes canvas status <canvasId> [--near <displayId|nodeId|x,y>] [--size 340x130]
|
|
|
48
48
|
# and the portals (the navigation). --json gives { canvas, sections, elements,
|
|
49
49
|
# edges, portals }; every element carries the `section` it sits inside.
|
|
50
50
|
# You should not need a second `canvas get` just to see the frames or the wiring.
|
|
51
|
+
#
|
|
52
|
+
# A board over 60,000 characters comes back as its MAP instead of every body: one
|
|
53
|
+
# line per card under its frame (id, title, version, last edit, size of the body),
|
|
54
|
+
# plus the edges, and the commands that go deeper. Work from the map: read the frame
|
|
55
|
+
# the task is about with `read-section`, or chosen notes with `notes get ID ID`.
|
|
56
|
+
# A title is not the note: open a body before you quote, judge or change it.
|
|
57
|
+
# --json (what you get when piped) then starts with `level` ("cards", or "frames" on
|
|
58
|
+
# a very large board), `fullChars` and `next` (those commands), and each frame lists
|
|
59
|
+
# its cards under `lines`, one string per card.
|
|
51
60
|
cnotes canvas read <canvasId>
|
|
61
|
+
# Every body, however long: for work that spans the whole board (a review, a rewrite
|
|
62
|
+
# of every frame). Send it to a file; it can be hundreds of thousands of characters.
|
|
63
|
+
cnotes canvas read <canvasId> --full > board.json
|
|
52
64
|
# A share link someone sent (https://…/shared/<id>) reads directly, no workspace
|
|
53
65
|
# needed: same access the link gives this account in a browser. A 404 means it
|
|
54
66
|
# isn't shared with this account (or doesn't exist); ask the owner to share it.
|
|
@@ -61,7 +73,9 @@ cnotes canvas read https://creatornotes.app/shared/<canvasId>
|
|
|
61
73
|
# inside the frame, any frame nested within it (under its own heading), plus the edges it
|
|
62
74
|
# touches (an edge leaving the frame is marked with where it goes).
|
|
63
75
|
# --json gives { canvas, section, nestedSections, elements, edges, portals }.
|
|
64
|
-
|
|
76
|
+
# A frame over 60,000 characters (one holding a transcript, say) lists its cards
|
|
77
|
+
# with their sizes instead; open the ones you need with `notes get`, or pass --full.
|
|
78
|
+
cnotes canvas read-section <SECTION-n> [--full]
|
|
65
79
|
|
|
66
80
|
# AI digest of canvas: narrative summary + per-note summary list for every note on the canvas
|
|
67
81
|
cnotes canvas digest <canvasId>
|
|
@@ -275,7 +289,7 @@ Agents creating or editing canvas milestones (`cnotes canvas milestone create` /
|
|
|
275
289
|
|
|
276
290
|
## Canvas Orientation
|
|
277
291
|
|
|
278
|
-
**On a large canvas,
|
|
292
|
+
**On a large canvas, `cnotes canvas read` is already the orientation:** over 60,000 characters it returns the map (frames, one line per card, edges), and `read-section` opens the frame you came for. `cnotes canvas digest <canvasId> --json` adds what the map lacks, a narrative summary, key themes and a one-line summary of every note, when titles alone do not tell you which frame holds the answer.
|
|
279
293
|
|
|
280
294
|
**`--json` field names** (they aren't what you'd guess, the narrative is **`.digest`**, *not* `.narrative` or `.summary`). Top-level shape: `{ status, canvasName, digest, themes[], notes[], noteCount, generatedAt }`. So `--fields digest` gets the narrative, `.canvasName` the title, `.themes[]` the key themes, and `.notes[]` the per-note list (shape below).
|
|
281
295
|
|
|
@@ -8,7 +8,7 @@ The one contract every command follows is in the core skill (the flag table and
|
|
|
8
8
|
- `notes create` returns `{ results, relationshipsCreated, rubrics?, hints? }`; read new notes from `results`. Each row carries `type`, `rubric`, and `quality` where the workspace grades on save.
|
|
9
9
|
- `canvas create` returns `{ canvas: { id, displayId, url } }` with `id`, `displayId` and `url` mirrored at the top level; after `create --spec` the placement is under `layout`, and `displayId` can still be null until `canvas get` reads it.
|
|
10
10
|
- `canvas place` returns `{ items, edges, bbox, successCount, notes?, arrangedSections? }`. It is best-effort, not transactional (HTTP 207): read `items[].error` and `edges[].error` before assuming success. A `quote` item adds `quoteNoteDisplayId`, `noteDisplayId`, `versionNumber` and `placed`.
|
|
11
|
-
- A note body comes back under `markdown` from `canvas read` and under `content` from `notes get --json`; read the key for the command you ran. `notes get --content-only` prints the raw markdown with no envelope, the right read for a transcript.
|
|
11
|
+
- A note body comes back under `markdown` from `canvas read` and under `content` from `notes get --json`; read the key for the command you ran. A `canvas read` whose JSON starts with `level: "cards"` or `"frames"` is a map of a long board: each frame lists its cards under `lines`, with no bodies; `next` names the commands that open a frame, chosen notes or (`--full`) every body. `notes get --content-only` prints the raw markdown with no envelope, the right read for a transcript.
|
|
12
12
|
|
|
13
13
|
## Errors and notices go to stderr
|
|
14
14
|
|