@creator-notes/cnotes 0.86.0 → 0.87.1
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.d.ts +17 -0
- package/dist/commands/canvas.d.ts.map +1 -1
- package/dist/commands/canvas.js +87 -15
- package/dist/commands/canvas.js.map +1 -1
- package/dist/commands/deps.d.ts +1 -1
- package/dist/commands/deps.js +4 -4
- package/dist/commands/deps.js.map +1 -1
- package/dist/commands/draft.d.ts.map +1 -1
- package/dist/commands/draft.js +5 -3
- package/dist/commands/draft.js.map +1 -1
- package/package.json +1 -1
- package/skills/attention-planner/references/card-shapes.md +13 -0
- package/skills/attention-planner/references/orientation-canvas.md +10 -2
- package/skills/cnotes/SKILL.md +71 -1607
- package/skills/cnotes/references/billing.md +39 -0
- package/skills/cnotes/references/canvas-elements.md +89 -0
- package/skills/cnotes/references/canvas-layout.md +250 -0
- package/skills/cnotes/references/canvas.md +220 -0
- package/skills/cnotes/references/drafts.md +149 -0
- package/skills/cnotes/references/humanizer.md +14 -2
- package/skills/cnotes/references/more-commands.md +151 -0
- package/skills/cnotes/references/notes.md +232 -0
- package/skills/cnotes/references/operations.md +166 -0
- package/skills/cnotes/references/relationships.md +133 -0
- package/skills/cnotes/references/reviews-and-comments.md +135 -0
- package/skills/wayfind/SKILL.md +2 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Paid actions and workspaces
|
|
2
|
+
|
|
3
|
+
Read this when a write fails with exit `8` (`subscription_required`) or the user wants another workspace.
|
|
4
|
+
|
|
5
|
+
## Paid actions (writes need Pro)
|
|
6
|
+
|
|
7
|
+
Reads work on any plan. **CLI/API writes require the target workspace to be on Pro** — this is the most common wall you will hit (exit `8`, `serverCode: "subscription_required"`). There are three distinct walls, and only two of them need a human. Do not collapse them into "tell the user to go pay."
|
|
8
|
+
|
|
9
|
+
**Wall 1 — free workspace, write blocked. You can fix this yourself.**
|
|
10
|
+
|
|
11
|
+
If the caller owns the workspace and hasn't used its one-time trial, `cnotes upgrade` starts a free 7-day Pro trial and writes unlock immediately. **No credit card, no browser, no human hand-off** — it's a single command you can run.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
cnotes upgrade # start the free trial on the ACTIVE workspace, then retry the write
|
|
15
|
+
cnotes upgrade -w <id> # target a specific workspace
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Ask before running it.** The trial is one-time and cannot be restarted, so never fire it unprompted. Offer it in one line and wait for a yes:
|
|
19
|
+
|
|
20
|
+
> "This workspace is on the free plan, so I can't write to it. Want me to start your free 7-day Pro trial (no credit card)?"
|
|
21
|
+
|
|
22
|
+
On yes: run `cnotes upgrade`, then retry the write. That's the whole flow.
|
|
23
|
+
|
|
24
|
+
**Wall 2 — trial already used. A human must pay.**
|
|
25
|
+
|
|
26
|
+
`cnotes upgrade` fails with `trial_used`. Card entry is browser-only, so you cannot subscribe on the user's behalf. Surface the `upgradeUrl` from the error (the workspace's billing page, $49/mo), keep doing read-only work in the meantime, and retry the write once they confirm they've paid.
|
|
27
|
+
|
|
28
|
+
**Wall 3 — they want an ADDITIONAL workspace. Human pays at checkout.**
|
|
29
|
+
|
|
30
|
+
`cnotes workspace create` **buys a new workspace** — it is not the fix for a blocked write on the current one (that's Wall 1). Only reach for it when the user actually asks for another workspace.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
cnotes workspace create "Acme Research" --json # returns { checkoutUrl, sessionId }
|
|
34
|
+
cnotes workspace create --verify <sessionId> --json # poll after the human pays
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The CLI never charges a card: `create` returns a Stripe Checkout URL a HUMAN must open and pay. Relay `checkoutUrl` to the user, then poll `--verify` every few seconds until `status` is `"ready"` — the new workspace is set active automatically. `--trial` starts that subscription with a 7-day trial (a card is still collected at checkout).
|
|
38
|
+
|
|
39
|
+
**If the caller is not the workspace owner**, never tell them to run `cnotes upgrade` — it dead-ends on an owner-only 403. The error `hint` already branches for this case: ask the *owner* to upgrade.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Canvas elements: what goes where
|
|
2
|
+
|
|
3
|
+
Read this before building or changing a canvas. It decides which element holds what, the hard rules, the orientation banner and the three completion tests.
|
|
4
|
+
|
|
5
|
+
The vocabulary is five elements:
|
|
6
|
+
|
|
7
|
+
| Element | What it is | CLI |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| **note** | A reusable knowledge object: typed, versioned, searchable, with a display ID other notes can mention | `add-node`, `place` `type:"note"` |
|
|
10
|
+
| **text** | Free-form rich text placed directly on the canvas — markdown (headings, emphasis, images), optional background tint (none by default). Wire type is `richtext`. | `add-text`, `place` `type:"richtext"` |
|
|
11
|
+
| **list** | A container whose content is its MEMBER NOTES; the description is a one-line frame | `add-list` |
|
|
12
|
+
| **section** | A named region frame (Miro-style). Mints `SECTION-<n>`, mention-addressable | `add-section` |
|
|
13
|
+
| **canvas** | A portal to another canvas | `add-link`, `place` `type:"canvas"` |
|
|
14
|
+
|
|
15
|
+
**There is no separate heading element.** A heading is a **text** element whose content is a markdown heading and which has no background tint: `add-text <canvasId> --content '# Q1 Goals'`. (An older `text` node kind — plain string + font size — is retired: existing ones still render and can be moved or deleted, but nothing creates them any more.)
|
|
16
|
+
|
|
17
|
+
A canvas holds two tiers of content, and the difference is load-bearing:
|
|
18
|
+
|
|
19
|
+
- **Notes** are the knowledge tier: typed, versioned, searchable, citable by display ID — the only tier whose content other notes can mention, search can find, and history records. Anything a future reader must find, cite, verify, or build on lives here.
|
|
20
|
+
- **Everything else** — text elements, list containers, section frames, edges, portals — is the presentation tier: orientation, grouping, emphasis, navigation. Text elements, lists, edges and portals have no display ID (nothing can cite them), no version history (they mutate silently), and no search presence. (Sections are the one exception: a frame mints a `SECTION-<n>` you can mention — it addresses a *place*, not knowledge.) They shape how the knowledge lands; they never hold the knowledge.
|
|
21
|
+
|
|
22
|
+
**The default is a typed note.** Before reaching for any other element, apply one test: *will any future reader — a human, or the next agent session pointed at this canvas for context — need to find, cite, or trust this?* If yes, it MUST be a note. "It renders nicely on the canvas" is never a reason to put knowledge in a text element: that trades permanent legibility (versions, search, citable IDs) for screen presence now. The decision-table rows below are the sanctioned exceptions — when a row matches your content exactly, the row wins.
|
|
23
|
+
|
|
24
|
+
## Decision table
|
|
25
|
+
|
|
26
|
+
| You have | Use | NOT |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| A claim, fact, decision, risk, question, verdict, score, spec, or example worth keeping | A typed **note** (right supertag, `# h1` title) | a text element |
|
|
29
|
+
| N distinct things (questions, risks, options, findings) | **N notes** grouped in a **list**; `--description` = one-line frame | bullets in one text element or in a list `--description` |
|
|
30
|
+
| A named REGION of the canvas ("Shaping", "Open Questions") | a **section** frame (`add-section`) — draggable region, mention-addressable as `[[SECTION-<n>]]` from note bodies | a floating text heading over an implied area |
|
|
31
|
+
| A heading / one-line label where a frame is too heavy (a column header inside a frame, a lane key) | a **text** element holding a markdown heading — `add-text --content '# Q1 Goals'`, no `--color` (leave it untinted), title case | a tinted card, or a section frame for something that isn't a region |
|
|
32
|
+
| Orientation: what happened, what this board is for, and how to read it | a **text** orientation banner in the fixed shape of rule 7 (one per canvas; a band may add a short one; up to ~5 sentences) | a reading-order-only banner, or a Guide note nobody needs off-canvas |
|
|
33
|
+
| Emphasis — restating a key claim for screen presence | a **text** element that QUOTES a note (the note stays the home) | the text element as the only copy |
|
|
34
|
+
| An image tile (logo, mockup, screenshot) | a **text** element holding the image, beside the owning note; embed the same image in the note body via `cnotes files upload <path> --markdown` so the note stays self-contained | the image as the knowledge itself |
|
|
35
|
+
| A grid of images for review (mood board) | N text-element image tiles in a `grid` place spec + ONE note holding the decision criteria / rationale for the set | a caption note per tile, or rationale in the tiles |
|
|
36
|
+
| "A connects to B" between two notes | a labeled **edge** (short verb phrase), notes only | prose explaining the connection |
|
|
37
|
+
| A pointer to another canvas | a **portal** — `add-link` on the CLI, `{"type": "canvas", "linkedCanvasId": ...}` in place specs, returned as `canvasLinkNodes` by `canvas get` | a text element saying "see other canvas" |
|
|
38
|
+
| Backstage narration (scripts, speaker notes) | NOTES on a PRIVATE sibling canvas (cue-card text elements are fine there); portal FROM the private canvas TO the shared one, never the reverse | narration on the shared canvas |
|
|
39
|
+
|
|
40
|
+
## Hard rules (each one has burned a real canvas)
|
|
41
|
+
|
|
42
|
+
1. **A canvas element must never be the sole home of a claim.** Verdict tallies, dates, scan provenance, and even a moat-defining sentence have each been authored as text elements — then cited downstream while being unversioned, unsearchable, and uncitable. If a text element says something true and useful, a note says it first; the text element may quote the note. (Canvas-specific wayfinding — how to read THIS canvas — is the one exemption; it has no off-canvas value.)
|
|
43
|
+
2. **Name notes and canvases from text elements with relationship mentions, never bare ids.** `[NOTE-12: Title](relationship:references)` inside a text element renders as a mention chip carrying the target's real title (a list description renders the same mention as a labelled span). "See RISK-64" as plain prose is a defect: the reader gets no title and no link. Pick the relationship type from the verb the sentence uses and reuse the workspace vocabulary. The chip is presentational: it creates no graph relationship, is not searchable, and is not versioned, so a relationship that must survive off the canvas still lives as a mention in a NOTE body (rule 5).
|
|
44
|
+
3. **A text element is capped at card size**: at most 3 sentences, one heading at most, never a list of distinct knowledge items (questions, risks, findings — those are N notes; a 3-line color legend or lane key is fine). The one exception is the orientation banner (table row 5, up to ~5 sentences). A heading-only text element (`--content '# Q1 Goals'`) is of course fine — that is the smallest legitimate use. The cap is physical as much as doctrinal: a text element renders its full content inline, so long blocks explode the canvas — one canvas hit 43,000px tall from eight text reference blocks and had to be rebuilt as notes.
|
|
45
|
+
4. **Detail's HOME is the note body; text detail cards are projections.** Write the full spec/content INTO each note's body first. A parallel text card under a note is allowed only as a projection — it condenses or quotes a note that already contains everything, and says so ("from STAGE-3"). A detail card whose content exists nowhere else is the anti-pattern: one teaching canvas carried its entire method in text cards over one-line stub notes, and an agent reading it back got seven stubs and no method.
|
|
46
|
+
5. **Edges can connect any node type** (note, text, list, canvas-link, section — plus legacy heading nodes), as long as both endpoints are on the same canvas; labels are short verb phrases ("fixes", "grounds", "depends on"). A section endpoint is addressed by its SECTION-n handle (or the frame's node id), and the edge anchors to the frame's border — use one when the relationship's endpoint is genuinely the whole region ("this cluster feeds that stage"), not as a shortcut for a note-to-note link. `canvas read` returns edges, so they are no longer invisible on read-back — but an edge is still CANVAS-LOCAL: it is not part of the note graph, never appears in `rel list`, is not searchable, and means nothing once you leave this canvas. So any relationship **between notes** that must survive off the canvas has to ALSO exist as a mention inside the note bodies. The mention is the copy that travels; the edge is the copy you can see. Edges to text/list/canvas-link nodes are diagram decoration (pointing a label at a cluster, wiring a portal) and carry no note-to-note relationship to mirror.
|
|
47
|
+
6. **Color is a ROLE or it is absent.** Default neutral — a text element has NO background unless you pass `--color`, and that is usually the right look (an untinted heading is just type on the canvas). When a tint does mean something, pick from the six role hexes and reuse ONE role per meaning, 2–4 roles per canvas max:
|
|
48
|
+
|
|
49
|
+
| Role | Hex | Use for |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| Evidence | `#3B82F6` | input, quote, data |
|
|
52
|
+
| Commitment | `#22C55E` | decided or owned work |
|
|
53
|
+
| Insight | `#EC4899` | the aha — 1–2 per canvas |
|
|
54
|
+
| Warning | `#F59E0B` | caveat, risk |
|
|
55
|
+
| Danger | `#EF4444` | blocker |
|
|
56
|
+
| People | `#8B5CF6` | person, stakeholder |
|
|
57
|
+
|
|
58
|
+
Do not hand-pick a hex outside this table: the renderer snaps every tint to the nearest role by hue, so an off-palette color does not get you a new shade — it just picks a role imprecisely (`#c2410c` lands on Danger, not Warning). A tint colors the CARD only; text inside it keeps the normal prose colors, so the tint can never make a card harder to read. If you cannot name the role, omit the color.
|
|
59
|
+
|
|
60
|
+
7. **The orientation banner opens for a stranger, in a fixed order.** The banner is the first and often the only card a cold reader sees (the goal sits behind the (i) button; nobody reads it first), so a banner that gives only the reading order fails: one shipped as "A story in six frames, read top to bottom. Frames 1 to 3 are the events: a release note is written, an agent writes an ad from it, the scope changes" and the reader could not say which release note, whose agent, or why any of it mattered. Write it in this order, at most ~5 sentences, heading = the board's subject (the canvas title or the goal), never a clever name for the banner:
|
|
61
|
+
1. **What happened** — one dated sentence naming the people, products and events a stranger can look up ("On 19 September 2026 Deniss asked why CreatorNotes records every note a person opens but nothing an agent reads").
|
|
62
|
+
2. **What this board is for** — the goal restated in reader's words: the decision or artifact it produces.
|
|
63
|
+
3. **Who acts on it and how** — who decides, answers, or builds, and where the answer goes (as a mention chip with its real title, rule 2).
|
|
64
|
+
4. **How to read it** — reading order and what each frame holds.
|
|
65
|
+
Nothing before the banner has defined anything, so no unnamed referents in it: not "the ad", "the app", "the scope", "the card" until the thing has been named or chipped. Wayfind maps and Attention orientation canvases add their own lines (destination, block time) after these four, never instead of them.
|
|
66
|
+
|
|
67
|
+
## Three completion tests
|
|
68
|
+
|
|
69
|
+
Run all three before ending your operation:
|
|
70
|
+
|
|
71
|
+
**The read-back test (for the next agent):** run `cnotes canvas read` and check that every claim is present as a NOTE section with a display ID, and the reasoning can be followed through note bodies and their mentions. Content that appears only as anonymous text-element prose fails the test even when visible — nothing can cite, search, or version it. List members read back as ID+title links without bodies; that is fine — the IDs are citable and batch-fetchable via `cnotes notes get`. As a heuristic for working canvases, at least ~4 notes per text element (zero text elements is fine); fewer means text elements are carrying content. Explainer canvases using the projection pattern (rule 4) are exempt from the ratio, not from the test.
|
|
72
|
+
|
|
73
|
+
**The glance test (for the human):** zoomed to fit, a person should grasp what this canvas argues and where to start reading in about 10 seconds. A canvas that passes read-back but renders as an undifferentiated card grid is also not done — that is what section labels, orientation banners, projections, and layout are for.
|
|
74
|
+
|
|
75
|
+
**The cold-reader test (for the person who was not in the session):** cover everything but the banner. Can someone who never saw the conversation say what happened, what this board decides or produces, and who acts on it? If the banner only gives the reading order, or leans on "the ad" / "the app" / "the card" before naming them, it fails (rule 7). Run this on the banner text itself, not on your memory of the run.
|
|
76
|
+
|
|
77
|
+
## Worked example
|
|
78
|
+
|
|
79
|
+
Right shape (a real competitor scan): 31 typed notes (COMPETITOR profile, FACT evidence row, INSIGHT verdicts per dimension, RISK/IDEA/STRATEGY response bands, QUESTION follow-ups in a list), three short text banners framing the bands ("Threats, Steals, Response — what hurts us, what's worth taking, the plan"), and labeled edges mirrored as mentions (`FACT-44 --grounds--> INSIGHT-361`).
|
|
80
|
+
|
|
81
|
+
Wrong shape (same content): one 5,000-char text element holding a "deep scan writeup", a text scoreboard holding the verdict tally, and a few notes for leftovers. Search finds nothing, versions record nothing, nothing can cite or link any of it — and the headline verdict goes stale the first time someone edits the card.
|
|
82
|
+
|
|
83
|
+
## Current platform limitations (re-check before relying on these)
|
|
84
|
+
|
|
85
|
+
The durable rules above stand on versioning, search, and citability. Four rules also lean on today's platform behavior — if a future release changes these, the corresponding rule can relax:
|
|
86
|
+
|
|
87
|
+
- Mentions inside text elements and list descriptions are presentational chips only: no graph relationship, no search presence, no versions (motivates rule 1 and the mirror-as-mentions half of rule 5).
|
|
88
|
+
- `canvas read` returns sections, edges and portals, but list containers still read back as their one-line frame only. An edge read back is still canvas-local and ungraphed (motivates rule 5's mirror-as-mentions requirement).
|
|
89
|
+
- Text cards and section frames are edited in place (`canvas update-text`, `canvas update-section`), but neither keeps a version history. Lists have no update verb: changing one means remove and re-add. Content that evolves belongs in notes, which have versions.
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# Canvas layout with `canvas place`
|
|
2
|
+
|
|
3
|
+
Read this before putting more than one item on a canvas. Describe structure; the server measures and packs.
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- [The layout DSL](#the-layout-dsl)
|
|
8
|
+
- [Leaf item shapes](#leaf-item-shapes)
|
|
9
|
+
- [Section container (frame WITH content — preferred)](#section-container-frame-with-content--preferred)
|
|
10
|
+
- [Arrange existing nodes (reflow)](#arrange-existing-nodes-reflow)
|
|
11
|
+
- [Edges](#edges)
|
|
12
|
+
- [Examples](#examples)
|
|
13
|
+
- [Workflow](#workflow)
|
|
14
|
+
- [Constraints](#constraints)
|
|
15
|
+
- [When the layout engine isn't enough](#when-the-layout-engine-isnt-enough)
|
|
16
|
+
|
|
17
|
+
**Don't compute coordinates by hand. Use `cnotes canvas place` with a layout spec.**
|
|
18
|
+
|
|
19
|
+
The server measures every item, packs them into a no-overlap layout, and inserts them in a single batch. You describe **structure** (rows, columns, what's near what) — the server resolves pixels. This is what `cnotes canvas place` is for, and you should reach for it whenever you're adding more than one item.
|
|
20
|
+
|
|
21
|
+
The call is **best-effort, not transactional** — per-item failures are reported in the response (HTTP 207) but the items that succeeded stay on the canvas. Always inspect `items[].error` and `edges[].error` before assuming success.
|
|
22
|
+
|
|
23
|
+
**You don't have to find a free coordinate.** `place` is collision-aware against content already on the canvas. By default (`placement: "auto"`) it drops your layout in a clear band **below everything that's already there**, and if you do pass an `origin` that would overlap, it slides the whole block straight down until it's clear. So appending a new section to a non-empty canvas Just Works — no need to read existing positions and guess a safe `origin` first. Use `--placement append` to force "below everything", or `--placement exact` (or `"placement": "exact"` in the doc) to honor your `origin` verbatim for pixel-perfect templates.
|
|
24
|
+
|
|
25
|
+
Use `cnotes canvas bulk-add` with explicit `x/y` ONLY for pixel-perfect templates (e.g. demo recordings or tutorial walkthroughs that need to match a specific screenshot).
|
|
26
|
+
|
|
27
|
+
## The layout DSL
|
|
28
|
+
|
|
29
|
+
A layout document is `{ root, edges?, origin?, placement? }` where `root` is one of four node kinds:
|
|
30
|
+
|
|
31
|
+
- **`stack`** — items flow along one axis (like CSS flexbox)
|
|
32
|
+
```json
|
|
33
|
+
{ "kind": "stack", "axis": "vertical", "gap": "medium",
|
|
34
|
+
"align": "start", "items": [ /* LayoutNode */ ] }
|
|
35
|
+
```
|
|
36
|
+
- **`grid`** — N columns, items wrap to new rows (like CSS grid auto-flow)
|
|
37
|
+
```json
|
|
38
|
+
{ "kind": "grid", "columns": 3, "gap": "medium",
|
|
39
|
+
"items": [ /* LayoutNode */ ] }
|
|
40
|
+
```
|
|
41
|
+
- **`anchor`** — place a sub-tree relative to an EXISTING canvas node
|
|
42
|
+
```json
|
|
43
|
+
{ "kind": "anchor", "to": "NOTE-12", "direction": "right",
|
|
44
|
+
"gap": "medium", "child": /* LayoutNode */ }
|
|
45
|
+
```
|
|
46
|
+
`direction` is exactly one of `"right"` | `"left"` | `"above"` | `"below"` — NOT `top`/`bottom`/`up`/`down`.
|
|
47
|
+
- **`item`** — a leaf node (no x/y!). One per visible thing on the canvas.
|
|
48
|
+
|
|
49
|
+
`gap` accepts a preset (`"tight"`, `"medium"`, `"spacious"`) or a raw pixel number. Defaults to `"medium"`.
|
|
50
|
+
|
|
51
|
+
The schema is strict: an unknown or typo'd key anywhere in the doc (e.g. `gapp`, `positionx`) is rejected with the offending key named, rather than silently ignored. Validation errors return `details.issues` with the full path (`doc.root.items[2].direction`), the allowed values, and what you sent.
|
|
52
|
+
|
|
53
|
+
`placement` (top-level, optional) controls where the whole layout sits relative to existing content: `"auto"` (default, collision-aware — below existing content / de-collide), `"append"` (always below everything), `"exact"` (honor `origin` verbatim). `origin` is the top-left corner; omit it and `auto`/`append` pick a safe one for you.
|
|
54
|
+
|
|
55
|
+
## Leaf item shapes
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{ "kind": "item", "type": "note", "noteId": "NOTE-3", "key": "a" }
|
|
59
|
+
{ "kind": "item", "type": "richtext", "content": "# Q1 Goals" }
|
|
60
|
+
{ "kind": "item", "type": "richtext", "content": "Read this band left to right.", "size": "medium", "colorHex": "#F59E0B" }
|
|
61
|
+
{ "kind": "item", "type": "list", "description": "Risks tracked weekly — owner: @ana", "noteIds": ["A","B","C"], "viewMode": "list" }
|
|
62
|
+
{ "kind": "item", "type": "canvas", "linkedCanvasId": "abc..." }
|
|
63
|
+
{ "kind": "item", "type": "section", "name": "Open Questions", "width": 800, "height": 500 }
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`richtext` IS the **text** element (the CLI's `add-text`) — the only free-form text leaf. A heading is a `richtext` leaf whose content is `"# Title"` with no `colorHex`. There is no `"type": "text"` leaf: the old heading node kind is retired and the layout engine rejects it.
|
|
67
|
+
|
|
68
|
+
Leaf enums (exact values): richtext `size` = `small` | `medium` | `large`, `colorHex` = a saturated hex (omit for no background); list `viewMode` = `list` | `grid`, list `size` = `sm` | `md` | `lg` | `xl`.
|
|
69
|
+
|
|
70
|
+
A richtext `size` is not a hint — it IS the width the card paints: `small` 560px, `medium` 1120px, `large` 1680px, with the height following the content. `place` measures that box for you, which is the whole reason to prefer it over hand-picked coordinates: pitch a row of columns for `small` and then send `medium` items and every card runs 460px into its neighbour.
|
|
71
|
+
|
|
72
|
+
## Section container (frame WITH content — preferred)
|
|
73
|
+
|
|
74
|
+
Beyond the fixed-size leaf above, `section` is also a CONTAINER: wrap any
|
|
75
|
+
stack/grid in a named frame and the solver sizes the frame around the content
|
|
76
|
+
plus padding — no coordinate math, one call. This is how "create a section and
|
|
77
|
+
lay out notes in it" should be expressed:
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"kind": "section", "name": "Open Questions", "key": "oq",
|
|
82
|
+
"child": { "kind": "grid", "columns": 3, "items": [
|
|
83
|
+
{ "kind": "item", "type": "note", "noteId": "QUESTION-12" },
|
|
84
|
+
{ "kind": "item", "type": "note", "noteId": "QUESTION-14" }
|
|
85
|
+
]}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The place response's section item carries its `displayId` (SECTION-<n>) —
|
|
90
|
+
surface it and mention it as `[[SECTION-<n>]]` from note bodies. For the
|
|
91
|
+
simple case, `add-section --notes id1,id2` is the same thing as a one-liner.
|
|
92
|
+
To **reflow content that ALREADY sits on the canvas** into a section (mixed
|
|
93
|
+
kinds — notes, canvas-links, richtext, lists), use `canvas arrange` — do NOT
|
|
94
|
+
hand-compute coordinates with `bulk-move` + `update-section`. To grow or
|
|
95
|
+
rename a frame without moving its contents, use `canvas update-section` —
|
|
96
|
+
never delete + re-add, which mints a new SECTION-<n> and breaks every
|
|
97
|
+
`[[SECTION-<n>]]` mention pointing at the old one.
|
|
98
|
+
|
|
99
|
+
## Arrange existing nodes (reflow)
|
|
100
|
+
|
|
101
|
+
`place` is create-only. When the nodes are already on the canvas, use
|
|
102
|
+
`cnotes canvas arrange`:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
cnotes canvas arrange <canvasId> --section SECTION-90 \
|
|
106
|
+
--nodes '[{"nodeId":"<id>","nodeType":"canvas"},{"nodeId":"NOTE-3","nodeType":"note"}]' \
|
|
107
|
+
--layout grid --columns 4 --gap medium
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The server measures each card from its on-canvas footprint, packs them with
|
|
111
|
+
no overlap, moves them in one batch, and auto-resizes the target section in
|
|
112
|
+
place (`SECTION-<n>` stays stable). `--no-auto-resize` moves without growing
|
|
113
|
+
the frame. `--dry-run` previews positions.
|
|
114
|
+
|
|
115
|
+
Full DSL alternative: a layout doc whose leaves are
|
|
116
|
+
`{ "kind":"item", "type":"existing", "nodeId":"…", "nodeType":"note"|"text"|"richtext"|"list"|"canvas" }`
|
|
117
|
+
(plus an optional section container + `--section` / `targetSectionId`).
|
|
118
|
+
|
|
119
|
+
The optional `key` lets edges and other items reference this leaf later (`@<key>`).
|
|
120
|
+
|
|
121
|
+
`richtext.content` (the **text** element) accepts markdown directly — the server converts to TipTap before measuring. Markdown including relationship mentions: `[NOTE-X: Title](relationship:verb)` renders as a chip with the real title, so use one wherever the card names a note or canvas (a bare id is a defect), and keep it card-sized per [canvas-elements.md](canvas-elements.md).
|
|
122
|
+
|
|
123
|
+
`list.description` is a one-line **frame**; the content is `noteIds`, the member notes (N distinct things = N notes, see [canvas-elements.md](canvas-elements.md)).
|
|
124
|
+
|
|
125
|
+
## Edges
|
|
126
|
+
|
|
127
|
+
Edges live at the top level alongside `root`. Each endpoint is resolved in this priority order:
|
|
128
|
+
|
|
129
|
+
1. **`@<key>`** — any item placed in the same call that carries a matching `key`
|
|
130
|
+
2. **Original `noteId`** of a note placed in this call (e.g. `"NOTE-7"`) — no `key` needed
|
|
131
|
+
3. **Display id or convex id** of a node already on the canvas
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
"edges": [
|
|
135
|
+
{ "from": "@a", "to": "@b", "label": "depends on" },
|
|
136
|
+
{ "from": "NOTE-7", "to": "@a" }
|
|
137
|
+
]
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Examples
|
|
141
|
+
|
|
142
|
+
**Fan-out under an orientation banner** (the failure case the agent kept getting wrong):
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"root": {
|
|
146
|
+
"kind": "stack", "axis": "vertical", "gap": "medium",
|
|
147
|
+
"items": [
|
|
148
|
+
{ "kind": "item", "type": "richtext",
|
|
149
|
+
"content": "# Goals\nWhat we're committing to this quarter.",
|
|
150
|
+
"size": "medium" },
|
|
151
|
+
{ "kind": "grid", "columns": 4,
|
|
152
|
+
"items": [
|
|
153
|
+
{ "kind": "item", "type": "note", "noteId": "GOAL-1" },
|
|
154
|
+
{ "kind": "item", "type": "note", "noteId": "GOAL-2" },
|
|
155
|
+
{ "kind": "item", "type": "note", "noteId": "GOAL-3" },
|
|
156
|
+
{ "kind": "item", "type": "note", "noteId": "GOAL-4" }
|
|
157
|
+
] }
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**SWOT-style four-quadrant layout**:
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"root": {
|
|
167
|
+
"kind": "stack", "axis": "vertical", "gap": "spacious",
|
|
168
|
+
"items": [
|
|
169
|
+
{ "kind": "stack", "axis": "horizontal", "gap": "spacious", "items": [
|
|
170
|
+
{ "kind": "grid", "columns": 2, "items": [
|
|
171
|
+
{ "kind": "item", "type": "note", "noteId": "STR-1" },
|
|
172
|
+
{ "kind": "item", "type": "note", "noteId": "STR-2" }
|
|
173
|
+
] },
|
|
174
|
+
{ "kind": "grid", "columns": 2, "items": [
|
|
175
|
+
{ "kind": "item", "type": "note", "noteId": "WEAK-1" }
|
|
176
|
+
] }
|
|
177
|
+
] },
|
|
178
|
+
{ "kind": "stack", "axis": "horizontal", "gap": "spacious", "items": [
|
|
179
|
+
{ "kind": "grid", "columns": 2, "items": [
|
|
180
|
+
{ "kind": "item", "type": "note", "noteId": "OPP-1" }
|
|
181
|
+
] },
|
|
182
|
+
{ "kind": "grid", "columns": 2, "items": [
|
|
183
|
+
{ "kind": "item", "type": "note", "noteId": "THR-1" }
|
|
184
|
+
] }
|
|
185
|
+
] }
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Anchor a new column to the right of an existing note**:
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"root": {
|
|
195
|
+
"kind": "anchor", "to": "NOTE-12", "direction": "right", "gap": "medium",
|
|
196
|
+
"child": {
|
|
197
|
+
"kind": "stack", "axis": "vertical", "gap": "tight",
|
|
198
|
+
"items": [
|
|
199
|
+
{ "kind": "item", "type": "note", "noteId": "NEW-1" },
|
|
200
|
+
{ "kind": "item", "type": "note", "noteId": "NEW-2" }
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Diamond topology with edges**:
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"root": {
|
|
211
|
+
"kind": "stack", "axis": "vertical", "gap": "medium", "align": "center",
|
|
212
|
+
"items": [
|
|
213
|
+
{ "kind": "item", "type": "note", "noteId": "A", "key": "root" },
|
|
214
|
+
{ "kind": "stack", "axis": "horizontal", "gap": "medium", "items": [
|
|
215
|
+
{ "kind": "item", "type": "note", "noteId": "B", "key": "left" },
|
|
216
|
+
{ "kind": "item", "type": "note", "noteId": "C", "key": "right" }
|
|
217
|
+
] },
|
|
218
|
+
{ "kind": "item", "type": "note", "noteId": "D", "key": "tail" }
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
"edges": [
|
|
222
|
+
{ "from": "@root", "to": "@left" },
|
|
223
|
+
{ "from": "@root", "to": "@right" },
|
|
224
|
+
{ "from": "@left", "to": "@tail" },
|
|
225
|
+
{ "from": "@right", "to": "@tail" }
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Workflow
|
|
231
|
+
|
|
232
|
+
1. Write the layout doc to a temp file (`/tmp/layout.json`).
|
|
233
|
+
2. Run `cnotes canvas place <canvasId> --spec /tmp/layout.json --json`.
|
|
234
|
+
3. The response includes `items[]` (with resolved `positionX/Y`, `width`, `height`, `id`, and your `key`), `edges[]` (with resolved edge ids), and `bbox` (the bounding box of the whole layout).
|
|
235
|
+
|
|
236
|
+
## Constraints
|
|
237
|
+
|
|
238
|
+
- **Anchors take zero space in their parent** — when nested inside a `stack` or `grid`, an anchor reserves no slot, so siblings collapse together. Anchors are best used at the root or as their own top-level branch.
|
|
239
|
+
- **Anchor `to:` must be a node already on the canvas** — local `@key` refs only work for edges, not for anchor targets in this version.
|
|
240
|
+
- **Never use ALL CAPS** in a text element — headings included. Use title case (e.g., "Key Tensions" not "KEY TENSIONS").
|
|
241
|
+
- **Text-element content** is authored as markdown — the server converts it server-side. A heading is `"# Key Tensions"` with no `colorHex`. Keep it card-sized (canvas-elements.md, hard rule 3).
|
|
242
|
+
|
|
243
|
+
## When the layout engine isn't enough
|
|
244
|
+
|
|
245
|
+
A few cases still need explicit `x/y` via `bulk-add`:
|
|
246
|
+
- Reproducing a canvas pixel-for-pixel for a demo/screenshot
|
|
247
|
+
- Templates with intentional off-grid placement
|
|
248
|
+
- Adding a single item next to a known coordinate without invoking the solver
|
|
249
|
+
|
|
250
|
+
In all other cases — and especially when adding 3+ items at once — use `place`.
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# Canvas commands
|
|
2
|
+
|
|
3
|
+
Read this for the canvas commands themselves: reading, creating, adding and editing elements, moving and removing, edges, templates, milestones and the digest. Which element to use is in [canvas-elements.md](canvas-elements.md); placing many items is in [canvas-layout.md](canvas-layout.md).
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- [Read, create and edit](#read-create-and-edit)
|
|
8
|
+
- [Templates](#templates)
|
|
9
|
+
- [Milestones](#milestones)
|
|
10
|
+
- [Canvas Orientation](#canvas-orientation)
|
|
11
|
+
|
|
12
|
+
## Read, create and edit
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# List / get (archived canvases excluded by default)
|
|
16
|
+
cnotes canvas list [--include-archived]
|
|
17
|
+
# Find a canvas by name, topic, or MEANING — semantic similarity over canvas-digest
|
|
18
|
+
# embeddings blended with lexical match (name / themes / digest), so a query sharing no
|
|
19
|
+
# words with a canvas can still surface it. This is the canvas-level counterpart to
|
|
20
|
+
# `cnotes search semantic` (which searches NOTE content); they are separate corpora, so to
|
|
21
|
+
# cover both you search each. Pass '*' or 'all' to enumerate every canvas. JSON results
|
|
22
|
+
# carry id, displayId, title, matchedBy (lexical|semantic|both), relevance (0..1),
|
|
23
|
+
# purpose, themes, contains, noteCount, snippet, and `open` (deep link).
|
|
24
|
+
cnotes canvas search "<query>" [--limit <n>]
|
|
25
|
+
cnotes canvas get <canvasId>
|
|
26
|
+
# `get` returns each node kind in its own array (nodes/textNodes/richtextNodes/
|
|
27
|
+
# listNodes/canvasLinkNodes) AND a unified `allNodes` array — every node flattened
|
|
28
|
+
# to {id, kind, displayId, label, positionX, positionY, width, height} — plus
|
|
29
|
+
# `contentBounds` (the bounding box of everything). Use allNodes/contentBounds to
|
|
30
|
+
# reason about occupancy in one read instead of unioning the per-kind arrays.
|
|
31
|
+
# Portals live in canvasLinkNodes, NOT nodes: checking only `nodes` is how a card
|
|
32
|
+
# got dropped exactly on a portal. (You rarely need this for placement —
|
|
33
|
+
# `cnotes canvas place` already avoids overlaps.)
|
|
34
|
+
# See the whole layout before touching x/y: every item's box by kind, the pairs
|
|
35
|
+
# that overlap, and with --near a free spot next to an anchor.
|
|
36
|
+
cnotes canvas status <canvasId> [--near <displayId|nodeId|x,y>] [--size 280x130]
|
|
37
|
+
|
|
38
|
+
# Read a canvas as STRUCTURE, not just content — one round-trip to think across it.
|
|
39
|
+
# Returns the notes as concatenated markdown in display order (top-to-bottom, then
|
|
40
|
+
# left-to-right) GROUPED UNDER THEIR SECTION FRAME, plus the edges (the argument)
|
|
41
|
+
# and the portals (the navigation). --json gives { canvas, sections, elements,
|
|
42
|
+
# edges, portals }; every element carries the `section` it sits inside.
|
|
43
|
+
# You should not need a second `canvas get` just to see the frames or the wiring.
|
|
44
|
+
cnotes canvas read <canvasId>
|
|
45
|
+
# A share link someone sent (https://…/shared/<id>) reads directly, no workspace
|
|
46
|
+
# needed: same access the link gives this account in a browser. A 404 means it
|
|
47
|
+
# isn't shared with this account (or doesn't exist); ask the owner to share it.
|
|
48
|
+
cnotes canvas read https://creatornotes.app/shared/<canvasId>
|
|
49
|
+
|
|
50
|
+
# Read ONE section frame. Takes the SECTION-<n> handle ALONE — the canvas is resolved
|
|
51
|
+
# for you — so this is the right call whenever the user names a frame ("look at
|
|
52
|
+
# SECTION-6GC", "what's in the risks section") instead of reading a whole canvas and
|
|
53
|
+
# filtering it by eye. Returns the notes, stickies, lists and portals whose CENTER sits
|
|
54
|
+
# inside the frame, any frame nested within it (under its own heading), plus the edges it
|
|
55
|
+
# touches (an edge leaving the frame is marked with where it goes).
|
|
56
|
+
# --json gives { canvas, section, nestedSections, elements, edges, portals }.
|
|
57
|
+
cnotes canvas read-section <SECTION-n>
|
|
58
|
+
|
|
59
|
+
# AI digest of canvas: narrative summary + per-note summary list for every note on the canvas
|
|
60
|
+
cnotes canvas digest <canvasId>
|
|
61
|
+
|
|
62
|
+
# Create / update / delete
|
|
63
|
+
# NAMING: separate parts with the interpunct · (U+00B7, MIDDLE DOT, not a bullet •),
|
|
64
|
+
# never an em or en dash: "Path to Revenue · Funding strategy".
|
|
65
|
+
cnotes canvas create "<name>" --goal "<text>" [--audience "<text>"] # prints Ref (CANVAS-N) + Link; end your reply with them
|
|
66
|
+
# --goal is not optional in practice: write it FIRST, for a reader, as the decision or artifact
|
|
67
|
+
# the board exists to produce ("Decide whether X; pick the first slice"), never as a brief to
|
|
68
|
+
# yourself ("Research Tufte, diverge on..."). The goal renders only inside the (i) popover, so
|
|
69
|
+
# nobody sees it before the banner; the banner restates it (canvas-elements.md, hard rule 7).
|
|
70
|
+
cnotes canvas update <canvasId> [--title "<text>"] [--goal "<text>"] [--audience "<text>"]
|
|
71
|
+
cnotes canvas delete <canvasId>
|
|
72
|
+
cnotes canvas set-as-home <canvasId>
|
|
73
|
+
cnotes canvas archive <canvasId>
|
|
74
|
+
cnotes canvas unarchive <canvasId>
|
|
75
|
+
|
|
76
|
+
# Add nodes. Which element to use: canvas-elements.md. To put several cards on a canvas,
|
|
77
|
+
# use `canvas place` (canvas-layout.md): it packs them overlap-free. add-node is LOW-LEVEL:
|
|
78
|
+
# raw x/y, no collision check (it warns after the fact). Use it only with a spot from
|
|
79
|
+
# `canvas status --near`.
|
|
80
|
+
cnotes canvas add-node <canvasId> --note <noteId> [--x <n>] [--y <n>] # low-level; NOTE nodes only
|
|
81
|
+
# text = free-form markdown on the canvas (wire type: richtext): headings, emphasis,
|
|
82
|
+
# images, and `[NOTE-12: Title](relationship:verb)` mentions, which render as chips.
|
|
83
|
+
# No background unless you pass --color. A heading is `--content '# Q1 Goals'`.
|
|
84
|
+
cnotes canvas add-text <canvasId> --content "<markdown>" [--size small|medium|large] [--color "<hex>"] [--x <n>] [--y <n>] # inline (short only)
|
|
85
|
+
cnotes canvas add-text <canvasId> --content-file <path.md> [--size small|medium|large] [--color "<hex>"] [--x <n>] [--y <n>]
|
|
86
|
+
cnotes canvas add-richtext ... # DEPRECATED alias of add-text (identical flags). Use add-text.
|
|
87
|
+
# THE BOX IS DERIVED, NOT CHOSEN. You pick x/y; the server picks the size. WIDTH is the
|
|
88
|
+
# --size preset: small 560px, medium 1120px, large 1680px. HEIGHT follows the content,
|
|
89
|
+
# including after `canvas update-text` changes the copy. So both halves bite: columns
|
|
90
|
+
# pitched for a small card while the items are medium overlap by 460px each, and longer
|
|
91
|
+
# copy at the same x/y runs over whatever sits below. The write still succeeds either way.
|
|
92
|
+
# Longer copy is handled for you: when the card reaches DOWN into what starts below its top
|
|
93
|
+
# edge (notes, lists, section frames and their title chips), the server shifts that whole
|
|
94
|
+
# band down to clear it and says so (ripple {delta, movedNodeCount}; CLI prints "Made room"
|
|
95
|
+
# on stderr). Re-read positions with canvas get before placing next to anything it moved.
|
|
96
|
+
# What it cannot move comes back as layoutWarning (CLI also prints it to stderr): a column
|
|
97
|
+
# BESIDE the card, or siblings in the frame the card sits inside. Reflow those (bulk-move /
|
|
98
|
+
# arrange), or hand the block to `canvas place`, then re-check. Never treat "write succeeded"
|
|
99
|
+
# as "layout is fine" after a size bump or a content change.
|
|
100
|
+
# A list is a collection of member notes (--notes); --description is a one-line frame.
|
|
101
|
+
# N distinct things = N notes first, then --notes ID1,ID2,ID3 (canvas-elements.md).
|
|
102
|
+
cnotes canvas add-list <canvasId> --description "<markdown>" [--notes <id1,id2,...>] [--view list|grid] [--x <n>] [--y <n>]
|
|
103
|
+
cnotes canvas add-link <canvasId> --target <otherCanvasId> [--x <n>] [--y <n>]
|
|
104
|
+
# section = a NAMED REGION frame (Miro-style). Renders behind content; dragging the frame
|
|
105
|
+
# carries whatever sits inside it. Mints SECTION-<n>: mention [[SECTION-<n>]] from a note
|
|
106
|
+
# body to deep-link readers to that region. Name like a place ("Shaping", "Open Questions").
|
|
107
|
+
# Returns the displayId — surface it. Frames are NOT collision obstacles: content is placed
|
|
108
|
+
# INTO them (canvas get returns sectionNodes with bounds).
|
|
109
|
+
# PREFERRED: --notes creates the frame WITH those notes laid out inside it in one call
|
|
110
|
+
# (grid, frame sizes itself around them, collision-aware — no coordinate math).
|
|
111
|
+
cnotes canvas add-section <canvasId> --name "<title>" --notes <id1,id2,...> [--columns <n>] [--color "<hex>"]
|
|
112
|
+
cnotes canvas add-section <canvasId> --name "<title>" [--x <n>] [--y <n>] [--width <n>] [--height <n>] # empty frame
|
|
113
|
+
|
|
114
|
+
# Resize / rename / move / recolor an EXISTING frame, IN PLACE. Takes the SECTION-<n>
|
|
115
|
+
# display id. ALWAYS use this to grow a frame around new content — deleting and
|
|
116
|
+
# re-adding a section mints a NEW id (SECTION-51 becomes SECTION-57) and silently
|
|
117
|
+
# breaks every [[SECTION-51]] mention pointing at the old one.
|
|
118
|
+
cnotes canvas update-section <canvasId> --section SECTION-51 --height 1800
|
|
119
|
+
cnotes canvas update-section <canvasId> --section SECTION-51 --name "Open Questions" [--x <n>] [--y <n>] [--width <n>] [--color "<hex>"] [--clear-color]
|
|
120
|
+
# Edit a Text card's words IN PLACE (same node id, edges and mentions survive). This is the
|
|
121
|
+
# only way to change a card's copy; never delete and re-add it.
|
|
122
|
+
# Card ids: the `id` on kind:richtext elements in `cnotes canvas read <canvasId> --json`.
|
|
123
|
+
# --find must match exactly once.
|
|
124
|
+
cnotes canvas update-text <canvasId> --node <nodeId> --find "picks none" --replace "picks none (10 Oct 2026)"
|
|
125
|
+
cnotes canvas update-text <canvasId> --node <nodeId> --append "Answered on 10 Oct 2026."
|
|
126
|
+
cnotes canvas update-text <canvasId> --node <nodeId> --content-file ./banner.md [--size large] [--color "<hex>"]
|
|
127
|
+
|
|
128
|
+
# Place items using a declarative layout (NO x/y math — server packs them)
|
|
129
|
+
# This is the PREFERRED way to add multiple items. Spec and examples: canvas-layout.md.
|
|
130
|
+
cnotes canvas place <canvasId> --spec ./layout.json
|
|
131
|
+
cnotes canvas place <canvasId> --spec-stdin # JSON from stdin
|
|
132
|
+
cnotes canvas place <canvasId> --spec-inline '<short JSON>' # for tiny specs only
|
|
133
|
+
|
|
134
|
+
# Reflow EXISTING nodes (mixed kinds) into a section — preferred over bulk-move + update-section
|
|
135
|
+
cnotes canvas arrange <canvasId> --section SECTION-90 \
|
|
136
|
+
--nodes '[{"nodeId":"<id>","nodeType":"canvas"},{"nodeId":"NOTE-3","nodeType":"note"}]' \
|
|
137
|
+
--layout grid --columns 4 --gap medium
|
|
138
|
+
|
|
139
|
+
# Bulk add with explicit positions (escape hatch — only for pixel-perfect templates)
|
|
140
|
+
cnotes canvas bulk-add <canvasId> --notes '[{"noteId":"NOTE-1","x":100,"y":100},{"noteId":"NOTE-2","x":400,"y":100}]'
|
|
141
|
+
|
|
142
|
+
# Move / remove nodes (--type for non-note nodes, e.g. --type section)
|
|
143
|
+
# move-node is LOW-LEVEL: raw x/y, no collision check (it warns when the node lands
|
|
144
|
+
# on something). To tidy or reorganize, use `canvas arrange`; to pick a spot by
|
|
145
|
+
# hand, get one from `canvas status <canvasId> --near <ref>` first.
|
|
146
|
+
# NOTE: `text` in these type lists is the LEGACY heading kind (old canvases only). It can no
|
|
147
|
+
# longer be CREATED, but existing ones stay movable and deletable — that is why it is still
|
|
148
|
+
# accepted here. Today's Text element is `richtext`.
|
|
149
|
+
cnotes canvas move-node <canvasId> --node <nodeId> --x <n> --y <n> [--type note|richtext|list|canvas|section|text]
|
|
150
|
+
# --node takes a node id, a SECTION-<n>, or a note display id naming that note's card here.
|
|
151
|
+
cnotes canvas remove-node <canvasId> --node <ref>
|
|
152
|
+
|
|
153
|
+
# Bulk remove — the way to REVISE a canvas instead of only adding to it.
|
|
154
|
+
# --nodes entries may be a node id, a SECTION-<n>, or a note display id naming that
|
|
155
|
+
# note's card on THIS canvas. Edges on a removed node come off automatically; pass
|
|
156
|
+
# --edges only to drop an edge while keeping both of its nodes.
|
|
157
|
+
cnotes canvas bulk-remove <canvasId> --nodes '["SECTION-7","DECISION-3"]' [--edges '["edgeId1"]']
|
|
158
|
+
# Removal is PLACEMENT-ONLY: the note keeps its content, versions and display id and
|
|
159
|
+
# stays on every other canvas. It is not archiving — and archiving a note does NOT take
|
|
160
|
+
# it off a canvas, so a superseded card has to be removed here as well as archived.
|
|
161
|
+
# Run it inside an operation (or `canvas agent-run wrap`) so the removal is undoable as a unit.
|
|
162
|
+
|
|
163
|
+
# Bulk move multiple nodes at once (more efficient than repeated move-node)
|
|
164
|
+
cnotes canvas bulk-move <canvasId> --moves '[{"nodeId":"abc","nodeType":"note","x":200,"y":300},{"nodeId":"def","nodeType":"richtext","x":500,"y":300}]'
|
|
165
|
+
# nodeType: note | richtext | list | canvas | section | text (defaults to "note"; `text` = legacy)
|
|
166
|
+
|
|
167
|
+
# Connect any two nodes on the same canvas. --source/--target take a node id, a SECTION-<n>
|
|
168
|
+
# (the edge anchors to the frame's border), or a note display id for its card here.
|
|
169
|
+
# Labels are short verbs ("fixes", "grounds", "then"). Edges are canvas-local: mirror a
|
|
170
|
+
# note-to-note edge as a mention in the note body (canvas-elements.md, hard rule 5).
|
|
171
|
+
cnotes canvas add-edge <canvasId> --source <ref> --target <ref> [--label "<text>"]
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Templates
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Templates — create structured canvases from predefined layouts
|
|
178
|
+
cnotes canvas templates # List available templates
|
|
179
|
+
cnotes canvas from-template <templateId> [--title "<title>"] # Create empty skeleton
|
|
180
|
+
cnotes canvas from-template <templateId> --populate # Auto-populate zones with matching notes
|
|
181
|
+
# Templates: sprint-retrospective, swot-analysis, kanban-board, feature-prioritization, meeting-notes, product-roadmap
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Milestones
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Milestones — the same canvasSnapshots rows the web UI saves (kind "milestone").
|
|
188
|
+
# The message is one field: the first line is the timeline headline, a blank
|
|
189
|
+
# line, then the body. The headline MUST start with a past-tense verb and name a
|
|
190
|
+
# specific object in the first 40 characters ("Shipped the public comic canvas",
|
|
191
|
+
# never "V1"); the server rejects anything else with exit code 3 and saves
|
|
192
|
+
# nothing. Headline at most 110 characters. The platform may tidy an agent
|
|
193
|
+
# headline and leaves the body. `headlineWarnings` comes back on the JSON response.
|
|
194
|
+
# See https://creatornotes.app/blog/timeline-as-navigation
|
|
195
|
+
# An AI summary is stored separately and does not replace this message.
|
|
196
|
+
# If an operations run is active, the save attaches to it and records that run's
|
|
197
|
+
# actor, so an agent milestone is not labelled as a human edit.
|
|
198
|
+
cnotes canvas milestone create <canvasId> --message "Opened pricing question: charge for agents or the workspace?"
|
|
199
|
+
cnotes canvas milestone create <canvasId> --message-file ./milestone.txt
|
|
200
|
+
cnotes canvas milestone list <canvasId>
|
|
201
|
+
cnotes canvas milestone list <canvasId> --json
|
|
202
|
+
cnotes canvas milestone show <milestoneId>
|
|
203
|
+
cnotes canvas milestone rename <milestoneId> -m "Shipped the public comic canvas" # new headline, body kept
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Agents creating or editing canvas milestones (`cnotes canvas milestone create` / `rename`, the REST routes, or the web save dialog) must use a headline that starts with a past-tense verb and names a specific object, e.g. `Shipped the public comic canvas`, never `V1`. The rule is enforced: a milestone create or rename whose headline is not verb-first, or names no object, is rejected (exit code 3) and nothing is saved. Read the error, rewrite the first line, and retry. To fix a milestone that is already saved, run `cnotes canvas milestone rename <milestoneId> -m "<headline>"`; it replaces the headline and keeps the body.
|
|
207
|
+
|
|
208
|
+
- Good: `Shipped the public comic canvas`, `Narrowed pricing to per-seat`, `Dropped the onboarding survey`
|
|
209
|
+
- Rejected: `V1`, `Launch prep`, `The board after review`, `Shipped`
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
## Canvas Orientation
|
|
213
|
+
|
|
214
|
+
**On a large canvas, orient with `cnotes canvas digest <canvasId> --json` before reading note by note.** The digest returns the narrative summary, key themes, and a per-note summary list covering every note on the canvas. Use `canvas read` when you need the structure (frames, edges, portals) or are about to change the canvas.
|
|
215
|
+
|
|
216
|
+
**`--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).
|
|
217
|
+
|
|
218
|
+
The `notes` array entries have the shape `{ displayId, title, type, summary }`. When `summary` is `null`, the AI summary hasn't been generated yet (fresh note, or too short to summarize); run `cnotes notes get <displayId> [<displayId>...]` (batch-fetch in one call) if you need full content.
|
|
219
|
+
|
|
220
|
+
If `status` is `"none"` or `"stale"`, the `notes` array is still populated and accurate — you can start working immediately. Queue a fresh narrative with `cnotes canvas digest <canvasId> --refresh` (a write; needs Pro) only if you need the narrative itself.
|