@creator-notes/cnotes 0.145.0 → 0.147.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "creator-notes-cli",
3
- "version": "0.145.0",
3
+ "version": "0.147.0",
4
4
  "description": "CreatorNotes CLI: create notes, build canvases, search knowledge from the terminal",
5
5
  "author": {
6
6
  "name": "CreatorNotes",
@@ -247,13 +247,13 @@ async function runInit(program, nonInteractive) {
247
247
  console.log(` ${WARN} ${dim("Connection")} could not reach API`);
248
248
  }
249
249
  }
250
- // ── Skill (Claude Code + Codex + Cursor) + global install ───
250
+ // ── Skill (Claude Code + Codex + Cursor + Grok) + global install ───
251
251
  await maybeInstallSkill();
252
252
  const installedGlobally = await maybeInstallGlobally();
253
253
  // ── Conversation capture (Claude Code SessionStart hook) ────
254
254
  await maybeInstallSessionHook(installedGlobally);
255
255
  // ── Optional: MCP for Claude Desktop ────────────────────────
256
- // Claude Code, Codex and Cursor use the cnotes skill (installed above), so they
256
+ // Claude Code, Codex, Cursor and Grok use the cnotes skill (installed above), so they
257
257
  // don't need MCP. Claude Desktop has no skill mechanism — MCP is how it reaches
258
258
  // CreatorNotes. Codex users who still want MCP can run `cnotes mcp setup-codex`.
259
259
  console.log();
@@ -306,7 +306,7 @@ async function runInit(program, nonInteractive) {
306
306
  * - hand the agent a sign-in handoff when unauthenticated
307
307
  * (open URL, user signs in, paste the key into the `auth login --token-stdin` heredoc),
308
308
  * - auto-select the workspace when there's exactly one (or list IDs to pick),
309
- * - install the cnotes skill for whichever agents are present (Claude Code, Codex, Cursor),
309
+ * - install the cnotes skill for whichever agents are present (Claude Code, Codex, Cursor, Grok),
310
310
  * and set a non-zero exit code whenever setup is NOT yet complete so the agent
311
311
  * never reports false success.
312
312
  */
@@ -439,7 +439,7 @@ async function runInitNonInteractive() {
439
439
  }
440
440
  // ── Skill install ───────────────────────────────────────────
441
441
  async function maybeInstallSkill() {
442
- // Install for whichever agents the user actually has (Claude Code, Codex, Cursor).
442
+ // Install for whichever agents the user actually has (Claude Code, Codex, Cursor, Grok).
443
443
  const targets = SKILL_TARGETS.filter(hasAgentConfigDir);
444
444
  if (targets.length === 0)
445
445
  return;
@@ -12,7 +12,7 @@ import { explainTruncation, listNotes, SERVER_LIST_CAP } from "../lib/notes-list
12
12
  import { formatLinkedItemHeading, groupLinkedByRelation, parseExpandArgs, projectExpandPayload, renderExpandContentOnly, } from "../lib/expand-notes.js";
13
13
  import { noteBatchIdempotencyKey, resolveNoteBatchItems } from "../lib/note-batch.js";
14
14
  import { describeUnresolvedMentions, lintNarratedVerbMentions, lintPlainTextDisplayIdsBatch, hasGenericMention, fetchRelationshipTypeOptions, } from "../lib/mention-lint.js";
15
- import { attachRubricsToResults, loadRubricMap, rubricsForTypes, } from "../lib/rubrics.js";
15
+ import { attachTypes, gradableIds, loadRubricMap, rubricsForTypes, } from "../lib/rubrics.js";
16
16
  import { DECISION_CARD_RULE, } from "../lib/decision-citation.js";
17
17
  import { registerNotesImport } from "./notes-import.js";
18
18
  import { orderByDisplayId } from "../lib/mcp-spec.js";
@@ -593,10 +593,10 @@ Examples:
593
593
 
594
594
  Output (--json):
595
595
  Returns an object, not an array. Created notes are under the "results" key
596
- (not "notes"/"ok"); each carries displayId, title, type, and rubric (null when
597
- the type has no validationPrompt). A top-level "rubrics" array is also present
598
- for types that have one. Prefer reading .results[].rubric — agents that jq down
599
- to only displayId will miss a sibling top-level array. "selfCheck" is the
596
+ (not "notes"/"ok"); each carries displayId, title, type and url. The
597
+ top-level "rubrics" array holds each used type's rubric once, for types that
598
+ have one: read it before revising, since a filter down to .results[] leaves
599
+ it out. "next" says how to put the notes on a canvas. "selfCheck" is the
600
600
  command that grades the new notes against those rubrics; run it and revise
601
601
  anything below 4 before ending the operation. Read results with:
602
602
  cnotes notes create --json --notes '…' | jq -r '.results[] | "\\(.displayId) \\(.type)"'
@@ -745,25 +745,22 @@ Output (--json):
745
745
  emitUnresolved();
746
746
  return;
747
747
  }
748
- // Echo rubrics for the types just used. Attach them ON EACH result so
749
- // a `.results[]` jq filter still carries the standard (a sibling
750
- // top-level `rubrics` array is invisible to agents that only extract
751
- // displayId). Zero LLM — stored validationPrompt only. Non-fatal.
748
+ // Echo the rubric of each type just used, once, under `rubrics`; each
749
+ // result carries its `type` to look it up by. Zero LLM: the stored
750
+ // validationPrompt only. Non-fatal.
752
751
  const rubricMap = await loadRubricMap(api, cfg.workspaceId);
753
752
  const typeByKey = new Map(notes.map((n) => [n.key, n.type]));
754
753
  const rawResults = (data.results || []);
755
754
  // Each new note's link, and what is left to do for a person to see it:
756
755
  // a note just created is on no canvas (the first-run walk, 29 Nov 2026).
757
- const results = attachRubricsToResults(rawResults, typeByKey, rubricMap).map((r) => r.displayId ? { ...r, url: noteUrl(cfg.serverUrl, cfg.workspaceId, String(r.displayId)) } : r);
756
+ const results = attachTypes(rawResults, typeByKey).map((r) => r.displayId ? { ...r, url: noteUrl(cfg.serverUrl, cfg.workspaceId, String(r.displayId)) } : r);
758
757
  const next = alreadyExists ? null : placeNextLine(results.filter((r) => r.displayId).map((r) => String(r.displayId)));
759
758
  const rubrics = rubricsForTypes(notes.map((n) => n.type), rubricMap);
760
759
  // The self-check closes the loop the rubric echo opens. The command
761
760
  // does not grade and does not spend credits: it returns a
762
761
  // gradeRequest (rubric + content) for each new note. The agent grades
763
762
  // that payload and records it with `cnotes quality record`.
764
- const gradable = results
765
- .filter((r) => r.rubric && r.displayId)
766
- .map((r) => String(r.displayId));
763
+ const gradable = gradableIds(results, rubricMap);
767
764
  const selfCheck = gradable.length > 0
768
765
  ? `cnotes quality ${gradable.join(" ")} --fail-below 4 --json`
769
766
  : null;
@@ -24,7 +24,7 @@ function resolveTargets(agentOpt) {
24
24
  export function registerSkillsCommands(program) {
25
25
  const skills = program
26
26
  .command("skills")
27
- .description("Install bundled agent skills (e.g. fat-marker flows, how-to filmstrips, wayfind, goal tree, shaping, attention planner, transcript timeline, teach a workspace) into Claude Code, Codex, or Cursor");
27
+ .description("Install bundled agent skills (e.g. fat-marker flows, how-to filmstrips, wayfind, goal tree, shaping, attention planner, transcript timeline, teach a workspace) into Claude Code, Codex, Cursor or Grok");
28
28
  skills
29
29
  .command("list")
30
30
  .description("List the skills this CLI can install, and whether each agent's copy is current")
@@ -66,7 +66,7 @@ export function registerSkillsCommands(program) {
66
66
  skills
67
67
  .command("install <name>")
68
68
  .description("Install a bundled skill into your agent's skills dir")
69
- .option("--agent <agent>", "Which agent to install for: claude, codex, cursor, or all (default: auto-detect)")
69
+ .option("--agent <agent>", "Which agent to install for: claude, codex, cursor, grok, or all (default: auto-detect)")
70
70
  .option("--force", "Replace a folder of the same name that is not a cnotes skill (by default it is left alone)")
71
71
  .addHelpText("after", `
72
72
  Examples:
@@ -5,6 +5,7 @@
5
5
  * - Claude Code → ~/.claude/skills/cnotes/SKILL.md
6
6
  * - OpenAI Codex → ~/.codex/skills/cnotes/SKILL.md
7
7
  * - Cursor → ~/.cursor/skills/cnotes/SKILL.md
8
+ * - Grok → ~/.grok/skills/cnotes/SKILL.md
8
9
  *
9
10
  * The skill ships inside the published package at <package>/skills/cnotes/SKILL.md.
10
11
  * At runtime this file lives at <package>/dist/lib/install-skill.js, so the
@@ -39,11 +40,20 @@ function skillsRootDir() {
39
40
  * a Cursor user who already installed for Claude Code sees the skill anyway.
40
41
  * The explicit target is for Cursor-only setups, and so `--agent cursor` names
41
42
  * the thing the user actually runs.
43
+ *
44
+ * `grok` is xAI's directory, ~/.grok/skills. xAI documents it as the
45
+ * user-level skills directory of Grok Build, its terminal agent
46
+ * (docs.x.ai/build/features/skills-plugins-marketplaces). xAI documents no
47
+ * directory for Grok Bot: a Bot's skills live in a library inside the app
48
+ * (docs.x.ai/grok-bot/skills-routines-and-automations), and whether a Bot's
49
+ * computer also reads ~/.grok/skills is not stated there. So the label is the
50
+ * directory's owner, "Grok", not one product.
42
51
  */
43
52
  const AGENTS = {
44
53
  claude: { dir: ".claude", label: "Claude Code" },
45
54
  codex: { dir: ".codex", label: "Codex" },
46
55
  cursor: { dir: ".cursor", label: "Cursor" },
56
+ grok: { dir: ".grok", label: "Grok" },
47
57
  };
48
58
  export const SKILL_TARGETS = Object.keys(AGENTS);
49
59
  /** Human-facing label for a target (used in init/output messages). */
@@ -274,8 +284,8 @@ export function installSkillFolder(name, target, options = {}) {
274
284
  * Runs on every CLI invocation (cheap: one file compare per installed skill
275
285
  * per target). It never installs for an agent the user hasn't opted into — it
276
286
  * only updates a skill that already exists, so a plain `npm update -g
277
- * @creator-notes/cnotes` is enough to get the latest skills for Claude, Codex
278
- * and Cursor without re-running `cnotes init` or `cnotes skills install`.
287
+ * @creator-notes/cnotes` is enough to get the latest skills for Claude, Codex,
288
+ * Cursor and Grok without re-running `cnotes init` or `cnotes skills install`.
279
289
  * Every catalog skill is refreshed, not only the core one: the catalog copies
280
290
  * used to be installed once and never again, so an agent could run a wayfind
281
291
  * or attention-planner from months earlier that taught a rule the core had
@@ -50,16 +50,20 @@ export function allWorkspaceRubrics(map) {
50
50
  .sort((a, b) => a.type.localeCompare(b.type));
51
51
  }
52
52
  /**
53
- * Attach `type` + `rubric` onto each create result.
54
- *
55
- * `typeByKey` maps the batch item key → type string from the create request.
56
- * Types without a validationPrompt get `rubric: null` so the gap is visible
57
- * (several default types ship without one).
53
+ * Give each create result its `type`. `typeByKey` maps the batch item key →
54
+ * type string from the create request; a result with no key keeps the type
55
+ * the server sent. The rubric is not copied here: it is in the reply's
56
+ * `rubrics` list, once per type (rubricsForTypes).
58
57
  */
59
- export function attachRubricsToResults(results, typeByKey, map) {
58
+ export function attachTypes(results, typeByKey) {
60
59
  return results.map((r) => {
61
60
  const type = (r.key ? typeByKey.get(String(r.key)) : undefined) ?? String(r.type ?? "");
62
- const rubric = type ? map.get(type.toLowerCase()) ?? null : null;
63
- return { ...r, type, rubric };
61
+ return { ...r, type };
64
62
  });
65
63
  }
64
+ /** The display ids of the new notes whose type has a rubric: what the self-check grades. */
65
+ export function gradableIds(results, map) {
66
+ return results
67
+ .filter((r) => r.displayId && typeof r.type === "string" && map.has(r.type.toLowerCase()))
68
+ .map((r) => String(r.displayId));
69
+ }
@@ -34,7 +34,7 @@ import { findOverlaps, layoutItemsFrom, resolveAnchor, suggestFreeSpot } from ".
34
34
  import { boardChecks } from "./lib/board-checks.js";
35
35
  import { buildSchema } from "./lib/build-schema.js";
36
36
  import { assertMcpLocalFileReadable, getMcpLocalFileRoots, } from "./lib/mcp-local-file.js";
37
- import { attachRubricsToResults, loadRubricMap, rubricsForTypes, } from "./lib/rubrics.js";
37
+ import { attachTypes, loadRubricMap, rubricsForTypes, } from "./lib/rubrics.js";
38
38
  import { lintNarratedVerbMentions, lintPlainTextDisplayIds, lintPlainTextDisplayIdsBatch, hasGenericMention, fetchRelationshipTypeOptions, } from "./lib/mention-lint.js";
39
39
  import { DECISION_CARD_RULE } from "./lib/decision-citation.js";
40
40
  import { parseReviewRef } from "./lib/review-helpers.js";
@@ -321,11 +321,10 @@ sharedTool("cnotes_notes_create", async ({ notes, intent }) => withErrorHandling
321
321
  workspaceId,
322
322
  notes: items,
323
323
  }));
324
- // Attach rubrics ON EACH result so filtering to results[] still carries
325
- // the standard. Top-level rubrics kept for backward compatibility.
324
+ // Each used type's rubric once, under `rubrics`; each result carries its type.
326
325
  const typeByKey = new Map(items.map((n) => [n.key, n.type]));
327
326
  const rawResults = (result.results || []);
328
- const enriched = attachRubricsToResults(rawResults, typeByKey, rubricMap);
327
+ const enriched = attachTypes(rawResults, typeByKey);
329
328
  const rubrics = rubricsForTypes(items.map((n) => String(n.type)), rubricMap);
330
329
  return {
331
330
  ...result,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creator-notes/cnotes",
3
- "version": "0.145.0",
3
+ "version": "0.147.0",
4
4
  "description": "CLI for CreatorNotes — create notes, build canvases, search knowledge from the terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -95,7 +95,7 @@ Every command follows one contract. Detail, including which key holds a note bod
95
95
  | `7` | permission denied | `cnotes workspace current` |
96
96
  | `8` | subscription required (writes on a free workspace) | [references/billing.md](references/billing.md); offer `cnotes upgrade`, never run it unasked |
97
97
 
98
- Reads return data (`notes list/get/search` emit a bare array; one note is `.[0]`); writes return an envelope (`notes create` returns `{ results, relationshipsCreated, rubrics?, hints? }`). Errors go to stderr as `{ error, code, exitCode, hint }`; read the hint before retrying. Display IDs (`DECISION-12`, `CANVAS-406`, `SECTION-7`) work everywhere a command takes an id.
98
+ Reads return data (`notes list/get/search` emit a bare array; one note is `.[0]`); writes return an envelope (`notes create` returns `{ results, relationshipsCreated, rubrics?, next?, hints? }`). Errors go to stderr as `{ error, code, exitCode, hint }`; read the hint before retrying. Display IDs (`DECISION-12`, `CANVAS-406`, `SECTION-7`) work everywhere a command takes an id.
99
99
 
100
100
  ## Getting started
101
101
 
@@ -121,7 +121,7 @@ cnotes notes create --notes '[
121
121
  # On validation failure the response lists every bad item by index + key + field
122
122
  # (and `details.items` in --json mode), so you can fix the whole batch in one shot.
123
123
  # Same batch again in the same run returns the first notes (alreadyExists: true), not a copy; after a reset or 5xx (`mayHaveCommitted: true`) re-run with the printed `--idempotency-key`.
124
- # Each .results[] item carries .type + .rubric — keep them when filtering JSON.
124
+ # Each .results[] item carries .type; each used type's rubric is under the top-level .rubrics, once. Keep both when filtering JSON.
125
125
  # Where the deployment turns the rubric check on, each item also carries
126
126
  # .quality: {level 1-4, label, missing[], nextStep, unsure}. `missing` quotes the
127
127
  # rubric clauses the note does not yet do, weakest first. Fix those with
@@ -5,7 +5,7 @@ The one contract every command follows is in the core skill (the flag table and
5
5
  ## Reads return data, writes return an envelope
6
6
 
7
7
  - `notes list`, `notes get` and `notes search` emit a bare array, so one note is `.[0]`. `notes get --expand` is the exception: an object `{ notes, linked, truncated, cap, omitted, notice }` (notes.md).
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.
8
+ - `notes create` returns `{ results, relationshipsCreated, rubrics?, hints? }`; read new notes from `results`. Each row carries `type`, `url`, and `quality` where the workspace grades on save; each used type's rubric is in `rubrics`, once.
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
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.