@creator-notes/cnotes 0.128.0 → 0.129.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "creator-notes-cli",
3
- "version": "0.128.0",
3
+ "version": "0.129.1",
4
4
  "description": "CreatorNotes CLI: create notes, build canvases, search knowledge from the terminal",
5
5
  "author": {
6
6
  "name": "CreatorNotes",
@@ -6,6 +6,15 @@
6
6
  * The server sends only dimensions that say something, so nothing here
7
7
  * invents a reading when a field is missing.
8
8
  */
9
+ function readChecked(raw) {
10
+ if (!raw || typeof raw !== "object")
11
+ return undefined;
12
+ const c = raw;
13
+ const by = Array.isArray(c.by) ? c.by.filter((n) => typeof n === "string") : [];
14
+ if (by.length === 0 || typeof c.version !== "number" || typeof c.at !== "string")
15
+ return undefined;
16
+ return { by, at: c.at, version: c.version, current: c.current === true };
17
+ }
9
18
  /** The fields off a raw note row, or undefined when there is nothing to read. */
10
19
  export function readNoteDimensions(note) {
11
20
  const dimensions = Array.isArray(note.dimensions)
@@ -26,9 +35,10 @@ export function readNoteDimensions(note) {
26
35
  }))
27
36
  : [];
28
37
  const waitsOn = Array.isArray(note.waitsOn) ? note.waitsOn.filter((n) => typeof n === "string") : [];
29
- if (dimensions.length === 0 && waitsOn.length === 0)
38
+ const checked = readChecked(note.checked);
39
+ if (dimensions.length === 0 && waitsOn.length === 0 && !checked)
30
40
  return undefined;
31
- return { dimensions, waitsOn, waitsOnYou: note.waitsOnYou === true };
41
+ return { dimensions, waitsOn, waitsOnYou: note.waitsOnYou === true, ...(checked ? { checked } : {}) };
32
42
  }
33
43
  const refs = (notes) => notes.map((r) => (r.title ? `${r.displayId} (${r.title})` : r.displayId)).join(", ");
34
44
  /**
@@ -54,14 +64,30 @@ export function formatWaitsOn(reading) {
54
64
  * "Answered by: none yet (open)"
55
65
  * "Waits on: you"
56
66
  * "Superseded by: DECISION-117 (Wedge pivots)"
67
+ * "Checked by: Deniss · Nov 16 (v3)"
68
+ * "Checked: v3 by Ana, changed since"
57
69
  */
58
70
  export function formatNoteDimensionLines(reading) {
59
71
  const lines = reading.dimensions.map((d) => `${d.label}: ${formatDimension(d)}`);
60
72
  const waits = formatWaitsOn(reading);
61
73
  if (waits)
62
74
  lines.push(`Waits on: ${waits}`);
75
+ const checked = formatChecked(reading.checked);
76
+ if (checked)
77
+ lines.push(checked);
63
78
  return lines;
64
79
  }
80
+ const DAY = new Intl.DateTimeFormat("en-US", { month: "short", day: "numeric", timeZone: "UTC" });
81
+ /** The mark as one header line, or null when nobody checked the note. */
82
+ export function formatChecked(checked) {
83
+ if (!checked)
84
+ return null;
85
+ const who = checked.by.join(", ");
86
+ if (!checked.current)
87
+ return `Checked: v${checked.version} by ${who}, changed since`;
88
+ const day = Number.isNaN(Date.parse(checked.at)) ? "" : ` · ${DAY.format(new Date(checked.at))}`;
89
+ return `Checked by: ${who}${day} (v${checked.version})`;
90
+ }
65
91
  /**
66
92
  * `--dimension key=state` as [key, state], split on the FIRST "=" only: a
67
93
  * percentage state is itself ">=50" or "<=25". Either part is "" when missing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creator-notes/cnotes",
3
- "version": "0.128.0",
3
+ "version": "0.129.1",
4
4
  "description": "CLI for CreatorNotes — create notes, build canvases, search knowledge from the terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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. 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 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