@creator-notes/cnotes 0.107.5 → 0.107.7

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.107.5",
3
+ "version": "0.107.7",
4
4
  "description": "CreatorNotes CLI: create notes, build canvases, search knowledge from the terminal",
5
5
  "author": {
6
6
  "name": "CreatorNotes",
@@ -108,6 +108,11 @@ moved on, the text that was last checked. The JSON form includes
108
108
  \`checkpoint\`, which \`deps review\` needs: a save names exactly the versions
109
109
  it looked at and is refused if they have since changed.
110
110
 
111
+ The id is a depends-on link's, from \`deps list\` or \`rel list --type
112
+ depends-on\`; a note id is refused. A drifted related-to or references link
113
+ in \`rel list\` is not a dependency: its drift clears when the citing note is
114
+ saved again (re-read the cited note, then \`versions create\` the citing one).
115
+
111
116
  Examples:
112
117
  $ cnotes deps show <relationshipId>
113
118
  $ cnotes deps show <relationshipId> --json
@@ -761,7 +761,8 @@ way a draft changes a shared note: a live edit of one from inside a draft
761
761
  if (cfg.proposal?.draftId !== inPlaceId) {
762
762
  throw new ValidationError("Work in the proposal to propose a rewording into it", `Run \`cnotes draft checkout ${opts.draft}\` first`);
763
763
  }
764
- const result = await api.post(`/api/notes/${encodeURIComponent(note)}/versions`, { content: markdown, description: opts.description });
764
+ // The route resolves a display id only inside a named workspace.
765
+ const result = await api.post(`/api/notes/${encodeURIComponent(note)}/versions?workspaceId=${encodeURIComponent(liveWorkspaceId(cfg) ?? "")}`, { content: markdown, description: opts.description });
765
766
  if (!result.proposed) {
766
767
  throw new CliError(`${note} belongs to the proposal, so the save wrote its next version instead of proposing one.`, EXIT_CODES.GENERIC, "Propose rewordings of live notes only; a note the proposal made changes with cnotes versions create");
767
768
  }
@@ -368,10 +368,16 @@ Examples:
368
368
  // Working in a proposal: the workspace is the shared one, and the
369
369
  // proposal is a line under it. A proposal that closed (accepted or
370
370
  // dismissed in the browser) is forgotten here, so commands work live.
371
- const proposal = cfg.proposal
371
+ // A proposal in place has no draft workspace: read it from /api/proposals,
372
+ // or the lookup 404s and a checkout that just happened is forgotten.
373
+ const inPlace = cfg.proposal?.kind === "in_place"
374
+ ? await api.get(`/api/proposals/${cfg.proposal.draftId}`).catch(() => null)
375
+ : null;
376
+ const proposal = cfg.proposal && !inPlace
372
377
  ? await api.get(`/api/workspace-drafts/${cfg.proposal.draftId}`).catch(() => null)
373
378
  : null;
374
- const proposalClosed = Boolean(cfg.proposal) && proposal?.draft.status !== "open";
379
+ const proposalClosed = Boolean(cfg.proposal) &&
380
+ (inPlace ? inPlace.proposal.status !== "open" : proposal?.draft.status !== "open");
375
381
  if (proposalClosed && cfg.proposal?.source === "saved") {
376
382
  clearProposalById(loadConfig(), cfg.serverUrl, cfg.proposal.draftId);
377
383
  }
@@ -404,17 +410,27 @@ Examples:
404
410
  // picked this workspace when it is not the saved one.
405
411
  const saved = cfg.workspaceOverrides.saved;
406
412
  const overridden = cfg.workspaceSource !== "config" && saved !== undefined && saved !== shownId;
407
- const working = cfg.proposal && proposal && !proposalClosed
413
+ const working = cfg.proposal && inPlace && !proposalClosed
408
414
  ? {
409
415
  draftId: cfg.proposal.draftId,
410
- handle: proposal.draft.displayId ?? cfg.proposal.handle ?? null,
411
- name: proposal.draft.name,
412
- intent: proposal.draft.intent ?? null,
416
+ handle: inPlace.proposal.displayId ?? cfg.proposal.handle ?? null,
417
+ name: inPlace.proposal.name,
418
+ intent: inPlace.proposal.intent ?? null,
413
419
  source: cfg.proposal.source,
414
- decision: spokenDetail(proposal).decision,
415
- url: draftLink(cfg.serverUrl, proposal),
420
+ decision: inPlace.decision,
421
+ url: inPlace.url,
416
422
  }
417
- : null;
423
+ : cfg.proposal && proposal && !proposalClosed
424
+ ? {
425
+ draftId: cfg.proposal.draftId,
426
+ handle: proposal.draft.displayId ?? cfg.proposal.handle ?? null,
427
+ name: proposal.draft.name,
428
+ intent: proposal.draft.intent ?? null,
429
+ source: cfg.proposal.source,
430
+ decision: spokenDetail(proposal).decision,
431
+ url: draftLink(cfg.serverUrl, proposal),
432
+ }
433
+ : null;
418
434
  const closedNote = cfg.proposal && proposalClosed
419
435
  ? cfg.proposal.source === "env"
420
436
  ? `CNOTES_PROPOSAL names ${cfg.proposal.handle ?? cfg.proposal.draftId}, which is closed, so writes fail. Unset it to work live.`
@@ -35,7 +35,7 @@ export const EDITABLE_TOKEN_NAMES = [
35
35
  // Code & quotes
36
36
  "code-background", "code-foreground", "blockquote-border",
37
37
  // Status
38
- "destructive", "success", "warning", "info",
38
+ "destructive", "success", "warning", "unsaved", "info",
39
39
  ];
40
40
  export const EDITABLE_TOKEN_NAME_SET = new Set(EDITABLE_TOKEN_NAMES);
41
41
  /** All known preset ids — kept in sync with lib/themes/presets.ts PRESET_IDS. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creator-notes/cnotes",
3
- "version": "0.107.5",
3
+ "version": "0.107.7",
4
4
  "description": "CLI for CreatorNotes — create notes, build canvases, search knowledge from the terminal",
5
5
  "type": "module",
6
6
  "bin": {