@creator-notes/cnotes 0.103.5 → 0.104.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.
Files changed (325) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/cn.js +0 -1
  3. package/dist/commands/auth-keys.js +0 -1
  4. package/dist/commands/auth.js +0 -1
  5. package/dist/commands/brief.js +0 -1
  6. package/dist/commands/canvas-milestone.js +0 -1
  7. package/dist/commands/canvas.js +52 -4
  8. package/dist/commands/claude-hook.js +0 -1
  9. package/dist/commands/config.js +0 -1
  10. package/dist/commands/deps.js +0 -1
  11. package/dist/commands/draft.js +0 -37
  12. package/dist/commands/feedback.js +0 -1
  13. package/dist/commands/files.js +0 -1
  14. package/dist/commands/focus.js +0 -1
  15. package/dist/commands/goals.js +0 -1
  16. package/dist/commands/init.js +4 -2
  17. package/dist/commands/mcp.js +0 -1
  18. package/dist/commands/notes.js +7 -4
  19. package/dist/commands/operations.js +2 -3
  20. package/dist/commands/quality.js +0 -1
  21. package/dist/commands/relationships.js +0 -1
  22. package/dist/commands/review.js +0 -1
  23. package/dist/commands/schema.js +0 -1
  24. package/dist/commands/search.js +0 -1
  25. package/dist/commands/shared.js +0 -1
  26. package/dist/commands/skills.js +0 -1
  27. package/dist/commands/theme.js +0 -1
  28. package/dist/commands/timeline.js +0 -1
  29. package/dist/commands/types.js +0 -1
  30. package/dist/commands/upgrade.js +0 -1
  31. package/dist/commands/versions.js +3 -3
  32. package/dist/commands/workspace.js +1 -2
  33. package/dist/generated/embedded-build.js +0 -1
  34. package/dist/lib/active-run.js +0 -1
  35. package/dist/lib/agent-client.js +0 -1
  36. package/dist/lib/agent-grade.js +0 -1
  37. package/dist/lib/api-client.js +16 -5
  38. package/dist/lib/auth-store.js +0 -1
  39. package/dist/lib/billing-block.js +0 -1
  40. package/dist/lib/brand.js +0 -1
  41. package/dist/lib/build-schema.js +2 -3
  42. package/dist/lib/canvas-goal.js +0 -1
  43. package/dist/lib/canvas-layout.js +0 -1
  44. package/dist/lib/canvas-paths.js +0 -1
  45. package/dist/lib/claude-session.js +105 -9
  46. package/dist/lib/config.js +0 -1
  47. package/dist/lib/decision-citation.js +0 -1
  48. package/dist/lib/display-id.js +0 -1
  49. package/dist/lib/draft-ref.js +0 -1
  50. package/dist/lib/draft-view.js +0 -1
  51. package/dist/lib/errors.js +37 -6
  52. package/dist/lib/expand-notes.js +0 -1
  53. package/dist/lib/focus-time.js +0 -1
  54. package/dist/lib/fs-utils.js +0 -1
  55. package/dist/lib/goal-tree.js +0 -1
  56. package/dist/lib/headline-warnings.js +0 -1
  57. package/dist/lib/install-hook.js +0 -1
  58. package/dist/lib/install-mcp.js +0 -1
  59. package/dist/lib/install-skill.js +0 -1
  60. package/dist/lib/mcp-local-file.js +0 -1
  61. package/dist/lib/mention-lint.js +0 -1
  62. package/dist/lib/milestone-message.js +0 -1
  63. package/dist/lib/output.js +0 -1
  64. package/dist/lib/quality.js +0 -1
  65. package/dist/lib/resolve-note.js +0 -1
  66. package/dist/lib/review-helpers.js +0 -1
  67. package/dist/lib/rubric-sections.js +0 -1
  68. package/dist/lib/rubrics.js +0 -1
  69. package/dist/lib/runtime.js +0 -1
  70. package/dist/lib/server-url.js +0 -1
  71. package/dist/lib/session-brief.js +0 -1
  72. package/dist/lib/share-link.js +0 -1
  73. package/dist/lib/shared-rows.js +0 -1
  74. package/dist/lib/stdin.js +0 -1
  75. package/dist/lib/storage-id.js +0 -1
  76. package/dist/lib/style.js +0 -1
  77. package/dist/lib/superseded-by.js +0 -1
  78. package/dist/lib/themes.js +0 -1
  79. package/dist/lib/urls.js +0 -1
  80. package/dist/mcp-server.js +20 -18
  81. package/dist/program.js +0 -1
  82. package/package.json +1 -1
  83. package/skills/cnotes/references/canvas.md +7 -0
  84. package/skills/cnotes/references/notes.md +7 -0
  85. package/skills/cnotes/references/operations.md +6 -2
  86. package/dist/cn.d.ts +0 -3
  87. package/dist/cn.d.ts.map +0 -1
  88. package/dist/cn.js.map +0 -1
  89. package/dist/commands/auth-keys.d.ts +0 -3
  90. package/dist/commands/auth-keys.d.ts.map +0 -1
  91. package/dist/commands/auth-keys.js.map +0 -1
  92. package/dist/commands/auth.d.ts +0 -11
  93. package/dist/commands/auth.d.ts.map +0 -1
  94. package/dist/commands/auth.js.map +0 -1
  95. package/dist/commands/brief.d.ts +0 -9
  96. package/dist/commands/brief.d.ts.map +0 -1
  97. package/dist/commands/brief.js.map +0 -1
  98. package/dist/commands/canvas-milestone.d.ts +0 -14
  99. package/dist/commands/canvas-milestone.d.ts.map +0 -1
  100. package/dist/commands/canvas-milestone.js.map +0 -1
  101. package/dist/commands/canvas.d.ts +0 -20
  102. package/dist/commands/canvas.d.ts.map +0 -1
  103. package/dist/commands/canvas.js.map +0 -1
  104. package/dist/commands/claude-hook.d.ts +0 -28
  105. package/dist/commands/claude-hook.d.ts.map +0 -1
  106. package/dist/commands/claude-hook.js.map +0 -1
  107. package/dist/commands/config.d.ts +0 -3
  108. package/dist/commands/config.d.ts.map +0 -1
  109. package/dist/commands/config.js.map +0 -1
  110. package/dist/commands/deps.d.ts +0 -94
  111. package/dist/commands/deps.d.ts.map +0 -1
  112. package/dist/commands/deps.js.map +0 -1
  113. package/dist/commands/draft.d.ts +0 -3
  114. package/dist/commands/draft.d.ts.map +0 -1
  115. package/dist/commands/draft.js.map +0 -1
  116. package/dist/commands/feedback.d.ts +0 -3
  117. package/dist/commands/feedback.d.ts.map +0 -1
  118. package/dist/commands/feedback.js.map +0 -1
  119. package/dist/commands/files.d.ts +0 -3
  120. package/dist/commands/files.d.ts.map +0 -1
  121. package/dist/commands/files.js.map +0 -1
  122. package/dist/commands/focus.d.ts +0 -3
  123. package/dist/commands/focus.d.ts.map +0 -1
  124. package/dist/commands/focus.js.map +0 -1
  125. package/dist/commands/goals.d.ts +0 -3
  126. package/dist/commands/goals.d.ts.map +0 -1
  127. package/dist/commands/goals.js.map +0 -1
  128. package/dist/commands/init.d.ts +0 -3
  129. package/dist/commands/init.d.ts.map +0 -1
  130. package/dist/commands/init.js.map +0 -1
  131. package/dist/commands/mcp.d.ts +0 -15
  132. package/dist/commands/mcp.d.ts.map +0 -1
  133. package/dist/commands/mcp.js.map +0 -1
  134. package/dist/commands/notes.d.ts +0 -3
  135. package/dist/commands/notes.d.ts.map +0 -1
  136. package/dist/commands/notes.js.map +0 -1
  137. package/dist/commands/operations.d.ts +0 -27
  138. package/dist/commands/operations.d.ts.map +0 -1
  139. package/dist/commands/operations.js.map +0 -1
  140. package/dist/commands/quality.d.ts +0 -14
  141. package/dist/commands/quality.d.ts.map +0 -1
  142. package/dist/commands/quality.js.map +0 -1
  143. package/dist/commands/relationships.d.ts +0 -8
  144. package/dist/commands/relationships.d.ts.map +0 -1
  145. package/dist/commands/relationships.js.map +0 -1
  146. package/dist/commands/review.d.ts +0 -19
  147. package/dist/commands/review.d.ts.map +0 -1
  148. package/dist/commands/review.js.map +0 -1
  149. package/dist/commands/schema.d.ts +0 -12
  150. package/dist/commands/schema.d.ts.map +0 -1
  151. package/dist/commands/schema.js.map +0 -1
  152. package/dist/commands/search.d.ts +0 -3
  153. package/dist/commands/search.d.ts.map +0 -1
  154. package/dist/commands/search.js.map +0 -1
  155. package/dist/commands/shared.d.ts +0 -3
  156. package/dist/commands/shared.d.ts.map +0 -1
  157. package/dist/commands/shared.js.map +0 -1
  158. package/dist/commands/skills.d.ts +0 -3
  159. package/dist/commands/skills.d.ts.map +0 -1
  160. package/dist/commands/skills.js.map +0 -1
  161. package/dist/commands/theme.d.ts +0 -3
  162. package/dist/commands/theme.d.ts.map +0 -1
  163. package/dist/commands/theme.js.map +0 -1
  164. package/dist/commands/timeline.d.ts +0 -4
  165. package/dist/commands/timeline.d.ts.map +0 -1
  166. package/dist/commands/timeline.js.map +0 -1
  167. package/dist/commands/types.d.ts +0 -3
  168. package/dist/commands/types.d.ts.map +0 -1
  169. package/dist/commands/types.js.map +0 -1
  170. package/dist/commands/upgrade.d.ts +0 -13
  171. package/dist/commands/upgrade.d.ts.map +0 -1
  172. package/dist/commands/upgrade.js.map +0 -1
  173. package/dist/commands/versions.d.ts +0 -3
  174. package/dist/commands/versions.d.ts.map +0 -1
  175. package/dist/commands/versions.js.map +0 -1
  176. package/dist/commands/workspace.d.ts +0 -13
  177. package/dist/commands/workspace.d.ts.map +0 -1
  178. package/dist/commands/workspace.js.map +0 -1
  179. package/dist/generated/embedded-build.d.ts +0 -22
  180. package/dist/generated/embedded-build.d.ts.map +0 -1
  181. package/dist/generated/embedded-build.js.map +0 -1
  182. package/dist/lib/active-run.d.ts +0 -62
  183. package/dist/lib/active-run.d.ts.map +0 -1
  184. package/dist/lib/active-run.js.map +0 -1
  185. package/dist/lib/agent-client.d.ts +0 -12
  186. package/dist/lib/agent-client.d.ts.map +0 -1
  187. package/dist/lib/agent-client.js.map +0 -1
  188. package/dist/lib/agent-grade.d.ts +0 -24
  189. package/dist/lib/agent-grade.d.ts.map +0 -1
  190. package/dist/lib/agent-grade.js.map +0 -1
  191. package/dist/lib/api-client.d.ts +0 -124
  192. package/dist/lib/api-client.d.ts.map +0 -1
  193. package/dist/lib/api-client.js.map +0 -1
  194. package/dist/lib/auth-store.d.ts +0 -177
  195. package/dist/lib/auth-store.d.ts.map +0 -1
  196. package/dist/lib/auth-store.js.map +0 -1
  197. package/dist/lib/billing-block.d.ts +0 -12
  198. package/dist/lib/billing-block.d.ts.map +0 -1
  199. package/dist/lib/billing-block.js.map +0 -1
  200. package/dist/lib/brand.d.ts +0 -35
  201. package/dist/lib/brand.d.ts.map +0 -1
  202. package/dist/lib/brand.js.map +0 -1
  203. package/dist/lib/build-schema.d.ts +0 -109
  204. package/dist/lib/build-schema.d.ts.map +0 -1
  205. package/dist/lib/build-schema.js.map +0 -1
  206. package/dist/lib/canvas-goal.d.ts +0 -59
  207. package/dist/lib/canvas-goal.d.ts.map +0 -1
  208. package/dist/lib/canvas-goal.js.map +0 -1
  209. package/dist/lib/canvas-layout.d.ts +0 -77
  210. package/dist/lib/canvas-layout.d.ts.map +0 -1
  211. package/dist/lib/canvas-layout.js.map +0 -1
  212. package/dist/lib/canvas-paths.d.ts +0 -31
  213. package/dist/lib/canvas-paths.d.ts.map +0 -1
  214. package/dist/lib/canvas-paths.js.map +0 -1
  215. package/dist/lib/claude-session.d.ts +0 -81
  216. package/dist/lib/claude-session.d.ts.map +0 -1
  217. package/dist/lib/claude-session.js.map +0 -1
  218. package/dist/lib/config.d.ts +0 -76
  219. package/dist/lib/config.d.ts.map +0 -1
  220. package/dist/lib/config.js.map +0 -1
  221. package/dist/lib/decision-citation.d.ts +0 -10
  222. package/dist/lib/decision-citation.d.ts.map +0 -1
  223. package/dist/lib/decision-citation.js.map +0 -1
  224. package/dist/lib/display-id.d.ts +0 -12
  225. package/dist/lib/display-id.d.ts.map +0 -1
  226. package/dist/lib/display-id.js.map +0 -1
  227. package/dist/lib/draft-ref.d.ts +0 -61
  228. package/dist/lib/draft-ref.d.ts.map +0 -1
  229. package/dist/lib/draft-ref.js.map +0 -1
  230. package/dist/lib/draft-view.d.ts +0 -566
  231. package/dist/lib/draft-view.d.ts.map +0 -1
  232. package/dist/lib/draft-view.js.map +0 -1
  233. package/dist/lib/errors.d.ts +0 -105
  234. package/dist/lib/errors.d.ts.map +0 -1
  235. package/dist/lib/errors.js.map +0 -1
  236. package/dist/lib/expand-notes.d.ts +0 -79
  237. package/dist/lib/expand-notes.d.ts.map +0 -1
  238. package/dist/lib/expand-notes.js.map +0 -1
  239. package/dist/lib/focus-time.d.ts +0 -16
  240. package/dist/lib/focus-time.d.ts.map +0 -1
  241. package/dist/lib/focus-time.js.map +0 -1
  242. package/dist/lib/fs-utils.d.ts +0 -10
  243. package/dist/lib/fs-utils.d.ts.map +0 -1
  244. package/dist/lib/fs-utils.js.map +0 -1
  245. package/dist/lib/goal-tree.d.ts +0 -71
  246. package/dist/lib/goal-tree.d.ts.map +0 -1
  247. package/dist/lib/goal-tree.js.map +0 -1
  248. package/dist/lib/headline-warnings.d.ts +0 -8
  249. package/dist/lib/headline-warnings.d.ts.map +0 -1
  250. package/dist/lib/headline-warnings.js.map +0 -1
  251. package/dist/lib/install-hook.d.ts +0 -86
  252. package/dist/lib/install-hook.d.ts.map +0 -1
  253. package/dist/lib/install-hook.js.map +0 -1
  254. package/dist/lib/install-mcp.d.ts +0 -21
  255. package/dist/lib/install-mcp.d.ts.map +0 -1
  256. package/dist/lib/install-mcp.js.map +0 -1
  257. package/dist/lib/install-skill.d.ts +0 -84
  258. package/dist/lib/install-skill.d.ts.map +0 -1
  259. package/dist/lib/install-skill.js.map +0 -1
  260. package/dist/lib/mcp-local-file.d.ts +0 -11
  261. package/dist/lib/mcp-local-file.d.ts.map +0 -1
  262. package/dist/lib/mcp-local-file.js.map +0 -1
  263. package/dist/lib/mention-lint.d.ts +0 -159
  264. package/dist/lib/mention-lint.d.ts.map +0 -1
  265. package/dist/lib/mention-lint.js.map +0 -1
  266. package/dist/lib/milestone-message.d.ts +0 -37
  267. package/dist/lib/milestone-message.d.ts.map +0 -1
  268. package/dist/lib/milestone-message.js.map +0 -1
  269. package/dist/lib/output.d.ts +0 -57
  270. package/dist/lib/output.d.ts.map +0 -1
  271. package/dist/lib/output.js.map +0 -1
  272. package/dist/lib/quality.d.ts +0 -142
  273. package/dist/lib/quality.d.ts.map +0 -1
  274. package/dist/lib/quality.js.map +0 -1
  275. package/dist/lib/resolve-note.d.ts +0 -7
  276. package/dist/lib/resolve-note.d.ts.map +0 -1
  277. package/dist/lib/resolve-note.js.map +0 -1
  278. package/dist/lib/review-helpers.d.ts +0 -37
  279. package/dist/lib/review-helpers.d.ts.map +0 -1
  280. package/dist/lib/review-helpers.js.map +0 -1
  281. package/dist/lib/rubric-sections.d.ts +0 -29
  282. package/dist/lib/rubric-sections.d.ts.map +0 -1
  283. package/dist/lib/rubric-sections.js.map +0 -1
  284. package/dist/lib/rubrics.d.ts +0 -60
  285. package/dist/lib/rubrics.d.ts.map +0 -1
  286. package/dist/lib/rubrics.js.map +0 -1
  287. package/dist/lib/runtime.d.ts +0 -40
  288. package/dist/lib/runtime.d.ts.map +0 -1
  289. package/dist/lib/runtime.js.map +0 -1
  290. package/dist/lib/server-url.d.ts +0 -33
  291. package/dist/lib/server-url.d.ts.map +0 -1
  292. package/dist/lib/server-url.js.map +0 -1
  293. package/dist/lib/session-brief.d.ts +0 -60
  294. package/dist/lib/session-brief.d.ts.map +0 -1
  295. package/dist/lib/session-brief.js.map +0 -1
  296. package/dist/lib/share-link.d.ts +0 -19
  297. package/dist/lib/share-link.d.ts.map +0 -1
  298. package/dist/lib/share-link.js.map +0 -1
  299. package/dist/lib/shared-rows.d.ts +0 -46
  300. package/dist/lib/shared-rows.d.ts.map +0 -1
  301. package/dist/lib/shared-rows.js.map +0 -1
  302. package/dist/lib/stdin.d.ts +0 -5
  303. package/dist/lib/stdin.d.ts.map +0 -1
  304. package/dist/lib/stdin.js.map +0 -1
  305. package/dist/lib/storage-id.d.ts +0 -12
  306. package/dist/lib/storage-id.d.ts.map +0 -1
  307. package/dist/lib/storage-id.js.map +0 -1
  308. package/dist/lib/style.d.ts +0 -10
  309. package/dist/lib/style.d.ts.map +0 -1
  310. package/dist/lib/style.js.map +0 -1
  311. package/dist/lib/superseded-by.d.ts +0 -20
  312. package/dist/lib/superseded-by.d.ts.map +0 -1
  313. package/dist/lib/superseded-by.js.map +0 -1
  314. package/dist/lib/themes.d.ts +0 -44
  315. package/dist/lib/themes.d.ts.map +0 -1
  316. package/dist/lib/themes.js.map +0 -1
  317. package/dist/lib/urls.d.ts +0 -44
  318. package/dist/lib/urls.d.ts.map +0 -1
  319. package/dist/lib/urls.js.map +0 -1
  320. package/dist/mcp-server.d.ts +0 -3
  321. package/dist/mcp-server.d.ts.map +0 -1
  322. package/dist/mcp-server.js.map +0 -1
  323. package/dist/program.d.ts +0 -13
  324. package/dist/program.d.ts.map +0 -1
  325. package/dist/program.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "creator-notes-cli",
3
- "version": "0.103.5",
3
+ "version": "0.104.1",
4
4
  "description": "CreatorNotes CLI: create notes, build canvases, search knowledge from the terminal",
5
5
  "author": {
6
6
  "name": "CreatorNotes",
package/dist/cn.js CHANGED
@@ -87,4 +87,3 @@ process.on("unhandledRejection", (reason) => {
87
87
  program.parseAsync(process.argv).catch((error) => {
88
88
  handleError(error, isJsonMode());
89
89
  });
90
- //# sourceMappingURL=cn.js.map
@@ -66,4 +66,3 @@ export function registerAuthKeysCommands(auth, program) {
66
66
  }
67
67
  });
68
68
  }
69
- //# sourceMappingURL=auth-keys.js.map
@@ -343,4 +343,3 @@ export async function browserLogin(rawServerUrl, json, options) {
343
343
  }, 120_000);
344
344
  });
345
345
  }
346
- //# sourceMappingURL=auth.js.map
@@ -49,4 +49,3 @@ Examples:
49
49
  }
50
50
  });
51
51
  }
52
- //# sourceMappingURL=brief.js.map
@@ -207,4 +207,3 @@ Examples:
207
207
  }
208
208
  });
209
209
  }
210
- //# sourceMappingURL=canvas-milestone.js.map
@@ -10,7 +10,7 @@ import { loadConfig, setActiveAgentRunId, registerAgentRun, unregisterAgentRun,
10
10
  import { outputJson, outputTable, outputQuiet, truncate, timeAgo } from "../lib/output.js";
11
11
  import { readHeadlineWarnings, reportHeadlineWarnings } from "../lib/headline-warnings.js";
12
12
  import { parseSharedCanvasLink, sameServerOrigin } from "../lib/share-link.js";
13
- import { resolveAgentSession } from "../lib/claude-session.js";
13
+ import { resolveHostAgentSession } from "../lib/claude-session.js";
14
14
  import { WARN, dim } from "../lib/style.js";
15
15
  import { findOverlaps, findFrameSpills, layoutItemsFrom, parseSize, resolveAnchor, suggestFreeSpot, } from "../lib/canvas-layout.js";
16
16
  import { canvasUrl, canvasLinkForRef } from "../lib/urls.js";
@@ -608,6 +608,55 @@ Examples:
608
608
  handleError(error, cfg.json);
609
609
  }
610
610
  });
611
+ canvas
612
+ .command("check")
613
+ .description("Check a board for cards that contradict each other and claims nothing on the board backs. " +
614
+ "Writes nothing: turn each finding into a Tension note (a contradiction, linking both cards) or a " +
615
+ "Question note (what would back this claim?) inside a draft, so a person accepts them. " +
616
+ "One model call per card; editors only; refused where the deployment has no decision model for this workspace.")
617
+ .argument("<canvasId>", "Canvas ID or display ID (CANVAS-12)")
618
+ .action(async (canvasId) => {
619
+ const cfg = resolveConfig(program.opts());
620
+ const api = new ApiClient(cfg.serverUrl, cfg.token, cfg.workspaceId);
621
+ const path = `/api/canvas/${encodeURIComponent(canvasId)}/check?workspaceId=${encodeURIComponent(cfg.workspaceId)}`;
622
+ try {
623
+ const data = await api.post(path, {});
624
+ if (cfg.json) {
625
+ outputJson(data);
626
+ return;
627
+ }
628
+ console.log(`Canvas: ${data.canvasName}`);
629
+ console.log(`Checked ${data.checkedCards} cards with ${data.model}${data.skippedCards ? ` (${data.skippedCards} not checked)` : ""}.`);
630
+ if (data.contradictions.length === 0 && data.unsupported.length === 0) {
631
+ console.log("\nNo contradictions and no unbacked claims found.");
632
+ }
633
+ if (data.contradictions.length > 0) {
634
+ console.log("\nContradictions (both cannot be true):");
635
+ for (const c of data.contradictions)
636
+ console.log(` ${c.cards[0]} <> ${c.cards[1]} (${c.probability})`);
637
+ }
638
+ if (data.unsupported.length > 0) {
639
+ console.log("\nClaims nothing on the board backs:");
640
+ for (const u of data.unsupported)
641
+ console.log(` ${u.card} (${u.probability})`);
642
+ }
643
+ if (data.unsure.length > 0) {
644
+ console.log("\nUnsure (read these yourself before writing anything):");
645
+ for (const u of data.unsure) {
646
+ console.log(` ${u.card} ${u.question === "contradicts" ? `may contradict ${u.with}` : "may be unbacked"} (${u.probability})`);
647
+ }
648
+ }
649
+ if (data.contradictions.length > 0 || data.unsupported.length > 0) {
650
+ console.log("\nNext: read each pair or claim first (the check gives no reasons), then " +
651
+ `\`cnotes draft open --from-canvas ${canvasId}\` and write one Tension note per real contradiction ` +
652
+ "that mentions both cards, and one Question note per unbacked claim asking what would back it. " +
653
+ "The person accepts the draft.");
654
+ }
655
+ }
656
+ catch (error) {
657
+ handleError(error, cfg.json);
658
+ }
659
+ });
611
660
  canvas
612
661
  .command("activity")
613
662
  .description("Show recent activity (edits, agent runs, gestures, restores) on a canvas, newest first. " +
@@ -2601,7 +2650,7 @@ alongside it (eval the printed exports so your writes carry it).
2601
2650
  };
2602
2651
  if (opts.rationale)
2603
2652
  body.rationale = opts.rationale;
2604
- const agentSession = resolveAgentSession();
2653
+ const agentSession = await resolveHostAgentSession();
2605
2654
  if (agentSession)
2606
2655
  body.agentSession = agentSession;
2607
2656
  const data = await api.post(canvasActionPath(opts.canvas, cfg.workspaceId), body);
@@ -2693,7 +2742,7 @@ Examples:
2693
2742
  throw new ValidationError('No command to run. Usage:\n cnotes canvas agent-run wrap --canvas <id> --prompt "..." -- <command>');
2694
2743
  }
2695
2744
  // Step 1: open the run
2696
- const agentSession = resolveAgentSession();
2745
+ const agentSession = await resolveHostAgentSession();
2697
2746
  const begin = await api.post(canvasActionPath(opts.canvas, cfg.workspaceId), {
2698
2747
  action: "agentRunBegin",
2699
2748
  prompt: opts.prompt,
@@ -3109,4 +3158,3 @@ Examples:
3109
3158
  }
3110
3159
  });
3111
3160
  }
3112
- //# sourceMappingURL=canvas.js.map
@@ -56,4 +56,3 @@ export function registerClaudeHookCommand(program) {
56
56
  process.exit(0);
57
57
  });
58
58
  }
59
- //# sourceMappingURL=claude-hook.js.map
@@ -51,4 +51,3 @@ export function registerConfigCommands(program) {
51
51
  }
52
52
  });
53
53
  }
54
- //# sourceMappingURL=config.js.map
@@ -236,4 +236,3 @@ function indent(text) {
236
236
  .map((line) => ` ${line}`)
237
237
  .join("\n");
238
238
  }
239
- //# sourceMappingURL=deps.js.map
@@ -943,42 +943,6 @@ cnotes draft ask --reviewer <email|me>, and stop.
943
943
  }), cfg.json);
944
944
  }
945
945
  });
946
- draft
947
- .command("undo-merge")
948
- .description("Undo a merge, in a browser session only. Undoing reverses a person's decision, so a key is always refused and gets the link to hand the person who approved it (Undo on the merge row in History). `cnotes draft status` prints the same link")
949
- .argument("[draft]", "Draft id or name; defaults to the draft you work in")
950
- .action(async (ref) => {
951
- const cfg = resolveBaseConfig(program.opts());
952
- const api = new ApiClient(cfg.serverUrl, cfg.token, cfg.workspaceId);
953
- try {
954
- const id = await resolveTarget(api, ref, cfg);
955
- const result = await api
956
- .post(`/api/workspace-drafts/${id}`, { action: "undo-merge" })
957
- .catch(async (e) => {
958
- if (!(e instanceof ApiError) || e.reason !== "human_undo_required")
959
- throw notADraft(e, Boolean(ref));
960
- // A key never undoes a merge. Hand back where the person does.
961
- const detail = await api.get(`/api/workspace-drafts/${id}`).catch(() => null);
962
- const url = detail ? mergeUndoLink(cfg.serverUrl, detail) : null;
963
- throw new CliError("A person undoes a merge, in the browser: Undo on the merge row in History", EXIT_CODES.PERMISSION, url
964
- ? `Send this link to the person who approved it: ${url}`
965
- : "Ask the person who approved it: Undo is on the merge row in History, in the browser", { reason: "human_undo_required", draftId: id, url });
966
- });
967
- if (cfg.quiet) {
968
- console.log(result.draftId);
969
- return;
970
- }
971
- if (cfg.json) {
972
- outputJson(result);
973
- return;
974
- }
975
- console.log(`Undone: ${result.notesReturned} notes and ${result.canvasesReturned} canvases are back in the draft, ${result.editsReverted} shared note${result.editsReverted === 1 ? "" : "s"} restored. The draft is open again.`);
976
- console.log(`Resume it with: cnotes draft checkout ${result.draftId}`);
977
- }
978
- catch (error) {
979
- handleError(error, cfg.json);
980
- }
981
- });
982
946
  draft
983
947
  .command("dismiss")
984
948
  .description("Close the draft without merging; nothing in it, including proposed edits, reaches the shared workspace")
@@ -1104,4 +1068,3 @@ Examples:
1104
1068
  }
1105
1069
  });
1106
1070
  }
1107
- //# sourceMappingURL=draft.js.map
@@ -208,4 +208,3 @@ Examples:
208
208
  await setStatus(id, status, opts.note);
209
209
  });
210
210
  }
211
- //# sourceMappingURL=feedback.js.map
@@ -363,4 +363,3 @@ Examples:
363
363
  }
364
364
  });
365
365
  }
366
- //# sourceMappingURL=files.js.map
@@ -174,4 +174,3 @@ Examples:
174
174
  }
175
175
  });
176
176
  }
177
- //# sourceMappingURL=focus.js.map
@@ -157,4 +157,3 @@ Examples:
157
157
  }
158
158
  });
159
159
  }
160
- //# sourceMappingURL=goals.js.map
@@ -1,4 +1,3 @@
1
- import { confirm, select } from "@inquirer/prompts";
2
1
  import { spawnSync } from "child_process";
3
2
  import { loadConfig, getServerConfig, setWorkspaceId, } from "../lib/auth-store.js";
4
3
  import { ApiClient } from "../lib/api-client.js";
@@ -256,6 +255,7 @@ async function runInit(program, nonInteractive) {
256
255
  // don't need MCP. Claude Desktop has no skill mechanism — MCP is how it reaches
257
256
  // CreatorNotes. Codex users who still want MCP can run `cnotes mcp setup-codex`.
258
257
  console.log();
258
+ const { select } = await import("@inquirer/prompts");
259
259
  const mcpChoice = await select({
260
260
  message: "Set up the MCP server for Claude Desktop?",
261
261
  choices: [
@@ -414,6 +414,7 @@ async function maybeInstallSkill() {
414
414
  return;
415
415
  const labels = targets.map(skillTargetLabel).join(" and ");
416
416
  console.log();
417
+ const { confirm } = await import("@inquirer/prompts");
417
418
  const wantSkill = await confirm({
418
419
  message: `Install the ${labels} skill so your agent knows how to use cnotes?`,
419
420
  default: true,
@@ -451,6 +452,7 @@ async function maybeInstallSessionHook(installedGlobally) {
451
452
  if (isClaudeSessionHookInstalled())
452
453
  return; // already set up — no prompt
453
454
  console.log();
455
+ const { confirm } = await import("@inquirer/prompts");
454
456
  const want = await confirm({
455
457
  message: "Link Claude Code conversations to your agent runs? (adds a SessionStart hook to ~/.claude/settings.json)",
456
458
  default: true,
@@ -482,6 +484,7 @@ async function maybeInstallGlobally() {
482
484
  if (!isRunningUnderDlx())
483
485
  return true;
484
486
  console.log();
487
+ const { confirm } = await import("@inquirer/prompts");
485
488
  const wantGlobal = await confirm({
486
489
  message: "Install `cnotes` globally so future calls are faster?",
487
490
  default: true,
@@ -511,4 +514,3 @@ async function maybeInstallGlobally() {
511
514
  console.log(` ${dim("Or keep using")} ${cyan("npx @creator-notes/cnotes")}${dim(" — both work.")}`);
512
515
  return false;
513
516
  }
514
- //# sourceMappingURL=init.js.map
@@ -122,4 +122,3 @@ export function registerMcpCommands(program) {
122
122
  }
123
123
  });
124
124
  }
125
- //# sourceMappingURL=mcp.js.map
@@ -1,4 +1,3 @@
1
- import { select } from "@inquirer/prompts";
2
1
  import { ApiClient } from "../lib/api-client.js";
3
2
  import { resolveConfig } from "../lib/config.js";
4
3
  import { handleError, NotFoundError, ValidationError, EXIT_CODES } from "../lib/errors.js";
@@ -503,8 +502,9 @@ Examples:
503
502
  " replaced with the new note's\n" +
504
503
  " display ID after creation.\n" +
505
504
  " [NOTE-12: Title](relationship:<type>) → existing-note link.\n" +
506
- " Always include the `: Title` part — the title-less form `[NOTE-12](relationship:references)`\n" +
507
- " produces a chip with `title: null`, which renders as \"Untitled\" in the UI.\n" +
505
+ " [[<type>::NOTE-12]] → the same link, wiki form.\n" +
506
+ " The `: Title` part is optional: the server stamps the linked note's\n" +
507
+ " current title onto the chip when it saves.\n" +
508
508
  " Pick <type> from the verb your own prose uses: \"blocks X\" → relationship:blocks,\n" +
509
509
  " \"depends on X\" → relationship:depends-on. Types are free-form (unknown ones\n" +
510
510
  " auto-create); `cnotes rel types` lists the workspace vocabulary — reuse before\n" +
@@ -997,6 +997,9 @@ async function displayNotesList(notesList, limit, cfg, api, message) {
997
997
  return;
998
998
  }
999
999
  if (process.stdout.isTTY) {
1000
+ // Loaded only on the interactive path: the prompt library costs ~20 ms at
1001
+ // startup and most `cnotes notes` calls come from agents with no TTY.
1002
+ const { select } = await import("@inquirer/prompts");
1000
1003
  const chosenIndex = await select({
1001
1004
  message: `${sliced.length} ${message}`,
1002
1005
  choices: sliced.map((n, i) => ({
@@ -1049,6 +1052,7 @@ async function viewNoteInteractive(api, workspaceId, displayId) {
1049
1052
  console.log("\n(no content)");
1050
1053
  return;
1051
1054
  }
1055
+ const { select } = await import("@inquirer/prompts");
1052
1056
  const viewMode = await select({
1053
1057
  message: "View:",
1054
1058
  choices: [
@@ -1205,4 +1209,3 @@ function printNote(note, version) {
1205
1209
  console.log(`\n${searchContent}`);
1206
1210
  }
1207
1211
  }
1208
- //# sourceMappingURL=notes.js.map
@@ -6,7 +6,7 @@ import { outputJson, formatAgo, truncate } from "../lib/output.js";
6
6
  import { readHeadlineWarnings, reportHeadlineWarnings } from "../lib/headline-warnings.js";
7
7
  import { parseDateInput } from "./timeline.js";
8
8
  import { loadConfig, setActiveAgentRunId, registerAgentRun, unregisterAgentRun, isOwnedAgentRun, } from "../lib/auth-store.js";
9
- import { resolveAgentSession } from "../lib/claude-session.js";
9
+ import { resolveHostAgentSession } from "../lib/claude-session.js";
10
10
  import { allWorkspaceRubrics, loadRubricMap } from "../lib/rubrics.js";
11
11
  import { briefIsEmpty, loadSessionBrief, renderBrief } from "../lib/session-brief.js";
12
12
  /**
@@ -109,7 +109,7 @@ start fresh, or --detached to open your own run alongside it.
109
109
  // Code session id) so the run is traceable + resumable from the
110
110
  // timeline. Resolves to null when cnotes runs outside an agent — then the
111
111
  // run is simply not session-stamped (no error).
112
- const agentSession = resolveAgentSession();
112
+ const agentSession = await resolveHostAgentSession();
113
113
  const result = await api.post("/api/operations", {
114
114
  action: "begin",
115
115
  workspaceId: cfg.workspaceId,
@@ -451,4 +451,3 @@ Examples:
451
451
  }
452
452
  });
453
453
  }
454
- //# sourceMappingURL=operations.js.map
@@ -314,4 +314,3 @@ function printReport(items, summary) {
314
314
  `${summary.needsAgent} waiting on your grade, ${summary.withIssues} with structural issues. ` +
315
315
  `Grading spends no credits.`);
316
316
  }
317
- //# sourceMappingURL=quality.js.map
@@ -236,4 +236,3 @@ closest match before coining a new one.
236
236
  }
237
237
  });
238
238
  }
239
- //# sourceMappingURL=relationships.js.map
@@ -553,4 +553,3 @@ Examples:
553
553
  }
554
554
  });
555
555
  }
556
- //# sourceMappingURL=review.js.map
@@ -85,4 +85,3 @@ Examples:
85
85
  }
86
86
  });
87
87
  }
88
- //# sourceMappingURL=schema.js.map
@@ -192,4 +192,3 @@ Examples:
192
192
  }
193
193
  });
194
194
  }
195
- //# sourceMappingURL=search.js.map
@@ -68,4 +68,3 @@ Examples:
68
68
  }
69
69
  });
70
70
  }
71
- //# sourceMappingURL=shared.js.map
@@ -110,4 +110,3 @@ Examples:
110
110
  }
111
111
  });
112
112
  }
113
- //# sourceMappingURL=skills.js.map
@@ -181,4 +181,3 @@ export function registerThemeCommands(program) {
181
181
  }
182
182
  });
183
183
  }
184
- //# sourceMappingURL=theme.js.map
@@ -161,4 +161,3 @@ async function runSearch(api, cfg, opts) {
161
161
  const how = data.meta.semantic ? "semantic + keyword" : "keyword";
162
162
  console.log(`\n${data.results.length} matching changes for "${opts.query}" (${how})`);
163
163
  }
164
- //# sourceMappingURL=timeline.js.map
@@ -191,4 +191,3 @@ Examples:
191
191
  }
192
192
  });
193
193
  }
194
- //# sourceMappingURL=types.js.map
@@ -84,4 +84,3 @@ Notes:
84
84
  }
85
85
  });
86
86
  }
87
- //# sourceMappingURL=upgrade.js.map
@@ -57,8 +57,9 @@ Examples:
57
57
  .description("Create a new version of a note.\n" +
58
58
  " Relationship link syntax (use inside markdown):\n" +
59
59
  " [NOTE-12: Title](relationship:<type>) → link an existing note.\n" +
60
- " Always include the `: Title` part — the title-less form `[NOTE-12](relationship:references)`\n" +
61
- " produces a chip with `title: null`, which renders as \"Untitled\" in the UI.\n" +
60
+ " [[<type>::NOTE-12]] → the same link, wiki form.\n" +
61
+ " The `: Title` part is optional: the server stamps the linked note's\n" +
62
+ " current title onto the chip when it saves.\n" +
62
63
  " Pick <type> from the verb your own prose uses: \"blocks X\" → relationship:blocks,\n" +
63
64
  " \"depends on X\" → relationship:depends-on. Types are free-form (unknown ones\n" +
64
65
  " auto-create); `cnotes rel types` lists the workspace vocabulary — reuse before\n" +
@@ -186,4 +187,3 @@ Examples:
186
187
  }
187
188
  });
188
189
  }
189
- //# sourceMappingURL=versions.js.map
@@ -1,4 +1,3 @@
1
- import { select } from "@inquirer/prompts";
2
1
  import { ApiClient } from "../lib/api-client.js";
3
2
  import { liveWorkspaceId, resolveBaseConfig } from "../lib/config.js";
4
3
  import { clearProposalById, loadConfig, setWorkspaceId } from "../lib/auth-store.js";
@@ -100,6 +99,7 @@ export async function fetchAndSelectWorkspace(serverUrl, token, currentWorkspace
100
99
  chosenName = String(list[0].name || "(unnamed)");
101
100
  }
102
101
  else {
102
+ const { select } = await import("@inquirer/prompts");
103
103
  chosenId = await select({
104
104
  message: "Select a workspace to activate:",
105
105
  choices: list.map((w) => {
@@ -480,4 +480,3 @@ Examples:
480
480
  }
481
481
  });
482
482
  }
483
- //# sourceMappingURL=workspace.js.map
@@ -11,4 +11,3 @@
11
11
  * source of truth.
12
12
  */
13
13
  export const EMBEDDED_BUILD = null;
14
- //# sourceMappingURL=embedded-build.js.map
@@ -72,4 +72,3 @@ export async function reconcileOpenAgentRuns(api, serverUrl, opts) {
72
72
  }
73
73
  return { runs: report, pruned };
74
74
  }
75
- //# sourceMappingURL=active-run.js.map
@@ -35,4 +35,3 @@ export function detectAgentClient(env = process.env, session = resolveAgentSessi
35
35
  }
36
36
  return "CLI";
37
37
  }
38
- //# sourceMappingURL=agent-client.js.map
@@ -28,4 +28,3 @@ export function resolveGradedBy(input) {
28
28
  return client.slice(0, 200);
29
29
  return "agent";
30
30
  }
31
- //# sourceMappingURL=agent-grade.js.map
@@ -1,4 +1,4 @@
1
- import { ApiError, asCliError, CliError, EXIT_CODES } from "./errors.js";
1
+ import { ApiError, asCliError, CliError, EXIT_CODES, isPermanentNetworkError, isRefusedBeforeSend } from "./errors.js";
2
2
  import { loadConfig, getActiveAgentRunId, getServerConfig } from "./auth-store.js";
3
3
  import { detectAgentClient } from "./agent-client.js";
4
4
  const MAX_RETRIES = 3;
@@ -122,8 +122,9 @@ export class ApiClient {
122
122
  }
123
123
  /**
124
124
  * Execute a fetch with retry for 5xx and 429 errors.
125
- * Retries up to 3 times with exponential backoff (1s, 2s, 4s).
126
- * Never retries 4xx client errors (except 429).
125
+ * Up to 3 attempts with exponential backoff (1s, 2s). Never retries 4xx
126
+ * client errors (except 429). Writes are not replayed after a 5xx or a
127
+ * dropped connection, because the first attempt may have committed.
127
128
  */
128
129
  async fetchWithRetry(url, init,
129
130
  // Typed off RequestInit rather than the BodyInit global: BodyInit is not
@@ -132,6 +133,11 @@ export class ApiClient {
132
133
  // standalone (cold/CI) build of the CLI fails on it.
133
134
  rebuildBody) {
134
135
  let lastError;
136
+ // A write that reached the server may have committed before the error, so
137
+ // replaying it can create a second note, version or canvas element. Writes
138
+ // retry only when the server says it did nothing (429) or the connection
139
+ // was refused before anything was sent.
140
+ const replaySafe = !init.method || init.method === "GET" || init.method === "HEAD";
135
141
  for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
136
142
  try {
137
143
  // Rebuild body on retries to avoid sending a consumed stream
@@ -139,7 +145,7 @@ export class ApiClient {
139
145
  init = { ...init, body: rebuildBody() };
140
146
  }
141
147
  const res = await fetch(url, init);
142
- if (res.ok || !isRetryable(res.status)) {
148
+ if (res.ok || !isRetryable(res.status) || (!replaySafe && res.status !== 429)) {
143
149
  return res;
144
150
  }
145
151
  // Retryable server error — wait and retry
@@ -156,6 +162,12 @@ export class ApiClient {
156
162
  catch (error) {
157
163
  // Network error (ECONNREFUSED, DNS failure, timeout, etc.)
158
164
  lastError = error instanceof Error ? error : new Error(String(error));
165
+ // A host that does not resolve or refuses the connection will not
166
+ // start answering during a 1 s backoff; fail now instead of in 3 s.
167
+ if (isPermanentNetworkError(error))
168
+ break;
169
+ if (!replaySafe && !isRefusedBeforeSend(error))
170
+ break;
159
171
  if (attempt < MAX_RETRIES - 1) {
160
172
  const delayMs = RETRY_BASE_MS * Math.pow(2, attempt);
161
173
  await sleep(delayMs);
@@ -375,4 +387,3 @@ export class ApiClient {
375
387
  }
376
388
  }
377
389
  }
378
- //# sourceMappingURL=api-client.js.map
@@ -361,4 +361,3 @@ export function getActiveAgentRunId(config, serverUrl) {
361
361
  }
362
362
  return null;
363
363
  }
364
- //# sourceMappingURL=auth-store.js.map
@@ -43,4 +43,3 @@ export function blockedWorkspaceNotes(rows, serverUrl) {
43
43
  }
44
44
  return lines;
45
45
  }
46
- //# sourceMappingURL=billing-block.js.map
package/dist/lib/brand.js CHANGED
@@ -32,4 +32,3 @@ export const BRAND = {
32
32
  /** Source repo, owner/name form. */
33
33
  repo: "creatornotes/pm-notes",
34
34
  };
35
- //# sourceMappingURL=brand.js.map
@@ -23,7 +23,7 @@ export const STATIC_SCHEMA = {
23
23
  noteMention: "[NOTE-12: Title](relationship:<type>)",
24
24
  batchPlaceholder: "[@key: Title](relationship:<type>) — '@key' is replaced with the new display ID after batch create",
25
25
  rules: [
26
- "Always include `: Title` after the ID. The title-less form renders as 'Untitled' in the UI.",
26
+ "`: Title` after the ID is optional. The server stamps the linked note's current title onto the chip when it saves; `[[<type>::NOTE-12]]` is the same link in wiki form.",
27
27
  "Pick the relationship slug from the verb your own prose uses: 'blocks X' → relationship:blocks, 'depends on X' → relationship:depends-on. Slugs are free-form (unknown ones auto-create); `cnotes rel types` lists the workspace vocabulary — reuse before coining.",
28
28
  "Reserve `references` for pure citations. A verb narrated in prose around a `references` chip is invisible to backlinks and `rel list` — create/version responses flag these as `mentionWarnings`; treat each as a retype instruction.",
29
29
  ],
@@ -82,7 +82,7 @@ export const STATIC_SCHEMA = {
82
82
  CNOTES_AGENT_BEFORE_SNAPSHOT_ID: "Begin-snapshot ID carried with the agent-run",
83
83
  CNOTES_AGENT_SESSION_ID: "Explicit agent conversation id to stamp on operations begin (overrides auto-detect)",
84
84
  CNOTES_AGENT_SESSION_KIND: "Namespace for CNOTES_AGENT_SESSION_ID (e.g. claude-code, cursor)",
85
- CURSOR_CONVERSATION_ID: "Auto-detected by Cursor Agent; stamped as agentSession kind=cursor",
85
+ CURSOR_CONVERSATION_ID: "Cursor conversation id. operations begin stamps the openable cloud agent (bc-…) rather than a sand-subagent id",
86
86
  CLAUDE_CODE_SESSION_ID: "Auto-detected by Claude Code; stamped as agentSession kind=claude-code",
87
87
  },
88
88
  agentRun: {
@@ -149,4 +149,3 @@ export async function buildSchema(api, workspaceId) {
149
149
  ...STATIC_SCHEMA,
150
150
  };
151
151
  }
152
- //# sourceMappingURL=build-schema.js.map
@@ -110,4 +110,3 @@ export function normalizeDoneWhen(doneWhen) {
110
110
  .replace(/[\s.!?]+$/, "")
111
111
  .trim();
112
112
  }
113
- //# sourceMappingURL=canvas-goal.js.map
@@ -152,4 +152,3 @@ export function resolveAnchor(items, near) {
152
152
  const hit = items.find((i) => i.ref === key || i.id === key || i.ref.toUpperCase() === key.toUpperCase());
153
153
  return hit ? { x: hit.x, y: hit.y, width: hit.width, height: hit.height } : null;
154
154
  }
155
- //# sourceMappingURL=canvas-layout.js.map
@@ -51,4 +51,3 @@ export function commentsListPath(opts) {
51
51
  }
52
52
  return `${canvasActionPath(opts.canvasId, opts.workspaceId)}&view=comments&status=${opts.status}${received}`;
53
53
  }
54
- //# sourceMappingURL=canvas-paths.js.map