@creator-notes/cnotes 0.107.7 → 0.107.9

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.7",
3
+ "version": "0.107.9",
4
4
  "description": "CreatorNotes CLI: create notes, build canvases, search knowledge from the terminal",
5
5
  "author": {
6
6
  "name": "CreatorNotes",
@@ -761,8 +761,9 @@ 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
- // 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 });
764
+ // Resolve a display id in the shared workspace, not a draft one.
765
+ const live = liveWorkspaceId(cfg);
766
+ const result = await api.post(`/api/notes/${encodeURIComponent(note)}/versions${live ? `?workspaceId=${encodeURIComponent(live)}` : ""}`, { content: markdown, description: opts.description });
766
767
  if (!result.proposed) {
767
768
  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");
768
769
  }
@@ -4,6 +4,7 @@ import { clearProposalById, loadConfig, setWorkspaceId } from "../lib/auth-store
4
4
  import { handleError, ApiError, AuthError, CliError, EXIT_CODES, NetworkError, ValidationError } from "../lib/errors.js";
5
5
  import { outputJson, outputTable, timeAgo } from "../lib/output.js";
6
6
  import { blockedWorkspaceNotes, workspaceListState } from "../lib/billing-block.js";
7
+ import { isNotFound } from "../lib/proposal-in-place.js";
7
8
  import { draftLink, draftOfLine, spokenDetail } from "../lib/draft-view.js";
8
9
  const CHECKOUT_POLL_INTERVAL_MS = 5000;
9
10
  /**
@@ -370,14 +371,21 @@ Examples:
370
371
  // dismissed in the browser) is forgotten here, so commands work live.
371
372
  // A proposal in place has no draft workspace: read it from /api/proposals,
372
373
  // 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)
374
+ // Only a not-found means it is gone; a blip or a 500 throws rather than
375
+ // forget a checkout the user still works in.
376
+ const isInPlace = cfg.proposal?.kind === "in_place";
377
+ const inPlace = cfg.proposal && isInPlace
378
+ ? await api.get(`/api/proposals/${cfg.proposal.draftId}`).catch((error) => {
379
+ if (isNotFound(error))
380
+ return null;
381
+ throw error;
382
+ })
375
383
  : null;
376
- const proposal = cfg.proposal && !inPlace
384
+ const proposal = cfg.proposal && !isInPlace
377
385
  ? await api.get(`/api/workspace-drafts/${cfg.proposal.draftId}`).catch(() => null)
378
386
  : null;
379
387
  const proposalClosed = Boolean(cfg.proposal) &&
380
- (inPlace ? inPlace.proposal.status !== "open" : proposal?.draft.status !== "open");
388
+ (isInPlace ? inPlace?.proposal.status !== "open" : proposal?.draft.status !== "open");
381
389
  if (proposalClosed && cfg.proposal?.source === "saved") {
382
390
  clearProposalById(loadConfig(), cfg.serverUrl, cfg.proposal.draftId);
383
391
  }
@@ -3,7 +3,7 @@ import { liveWorkspaceId } from "./config.js";
3
3
  import { proposalHandle } from "./draft-ref.js";
4
4
  const PROPOSAL_ID = /^[a-z0-9]{32}$/;
5
5
  /** Whether a 404 means "not a proposal in place" rather than a real failure. */
6
- function isNotFound(error) {
6
+ export function isNotFound(error) {
7
7
  return error instanceof ApiError && (error.status === 404 || error.status === 400);
8
8
  }
9
9
  /**
@@ -20,6 +20,7 @@ export const PRESETS = [
20
20
  { id: "dracula", name: "Dracula", isDark: true, description: "Iconic high-contrast dark with purple accent." },
21
21
  { id: "solarized-dark", name: "Solarized Dark", isDark: true, description: "Ethan Schoonover's classic teal-on-navy palette." },
22
22
  { id: "rose-pine", name: "Rosé Pine", isDark: true, description: "Soho-vibes for the pastel-loving developer." },
23
+ { id: "cursor", name: "Cursor", isDark: true, description: "Quiet graphite greys from the Cursor agents window, with a white send button and a blue focus." },
23
24
  { id: "sage", name: "Sage", isDark: false, description: "Muted greenish-grey, easy on the eyes." },
24
25
  { id: "light", name: "Light", isDark: false, description: "Clean classic light." },
25
26
  { id: "catppuccin-latte", name: "Catppuccin Latte", isDark: false, description: "Soothing pastel light from the Catppuccin family." },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creator-notes/cnotes",
3
- "version": "0.107.7",
3
+ "version": "0.107.9",
4
4
  "description": "CLI for CreatorNotes — create notes, build canvases, search knowledge from the terminal",
5
5
  "type": "module",
6
6
  "bin": {