@creator-notes/cnotes 0.104.0 → 0.105.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.
- package/.claude-plugin/plugin.json +1 -1
- package/dist/cn.js +0 -1
- package/dist/commands/auth-keys.js +0 -1
- package/dist/commands/auth.js +0 -1
- package/dist/commands/brief.js +0 -1
- package/dist/commands/canvas-milestone.js +0 -1
- package/dist/commands/canvas.js +42 -2
- package/dist/commands/claude-hook.js +0 -1
- package/dist/commands/config.js +0 -1
- package/dist/commands/deps.js +0 -1
- package/dist/commands/draft.js +0 -37
- package/dist/commands/feedback.js +0 -1
- package/dist/commands/files.js +0 -1
- package/dist/commands/focus.js +0 -1
- package/dist/commands/goals.js +0 -1
- package/dist/commands/init.js +4 -2
- package/dist/commands/mcp.js +0 -1
- package/dist/commands/notes.js +4 -2
- package/dist/commands/operations.js +0 -1
- package/dist/commands/quality.js +0 -1
- package/dist/commands/relationships.js +0 -1
- package/dist/commands/review.js +0 -1
- package/dist/commands/schema.js +0 -1
- package/dist/commands/search.js +0 -1
- package/dist/commands/shared.js +0 -1
- package/dist/commands/skills.js +0 -1
- package/dist/commands/theme.js +0 -1
- package/dist/commands/timeline.js +0 -1
- package/dist/commands/types.js +0 -1
- package/dist/commands/upgrade.js +0 -1
- package/dist/commands/versions.js +0 -1
- package/dist/commands/workspace.js +1 -2
- package/dist/generated/embedded-build.js +0 -1
- package/dist/lib/active-run.js +0 -1
- package/dist/lib/agent-client.js +0 -1
- package/dist/lib/agent-grade.js +0 -1
- package/dist/lib/api-client.js +16 -5
- package/dist/lib/auth-store.js +0 -1
- package/dist/lib/billing-block.js +0 -1
- package/dist/lib/brand.js +0 -1
- package/dist/lib/build-schema.js +0 -1
- package/dist/lib/canvas-goal.js +0 -1
- package/dist/lib/canvas-layout.js +0 -1
- package/dist/lib/canvas-paths.js +0 -1
- package/dist/lib/claude-session.js +0 -1
- package/dist/lib/config.js +0 -1
- package/dist/lib/decision-citation.js +0 -1
- package/dist/lib/display-id.js +0 -1
- package/dist/lib/draft-ref.js +0 -1
- package/dist/lib/draft-view.js +0 -1
- package/dist/lib/errors.js +37 -6
- package/dist/lib/expand-notes.js +0 -1
- package/dist/lib/focus-time.js +0 -1
- package/dist/lib/fs-utils.js +0 -1
- package/dist/lib/goal-tree.js +0 -1
- package/dist/lib/headline-warnings.js +0 -1
- package/dist/lib/install-hook.js +0 -1
- package/dist/lib/install-mcp.js +0 -1
- package/dist/lib/install-skill.js +0 -1
- package/dist/lib/mcp-local-file.js +0 -1
- package/dist/lib/mention-lint.js +0 -1
- package/dist/lib/milestone-message.js +0 -1
- package/dist/lib/output.js +0 -1
- package/dist/lib/quality.js +0 -1
- package/dist/lib/resolve-note.js +0 -1
- package/dist/lib/review-helpers.js +0 -1
- package/dist/lib/rubric-sections.js +0 -1
- package/dist/lib/rubrics.js +0 -1
- package/dist/lib/runtime.js +0 -1
- package/dist/lib/server-url.js +0 -1
- package/dist/lib/session-brief.js +0 -1
- package/dist/lib/share-link.js +0 -1
- package/dist/lib/shared-rows.js +0 -1
- package/dist/lib/stdin.js +0 -1
- package/dist/lib/storage-id.js +0 -1
- package/dist/lib/style.js +0 -1
- package/dist/lib/superseded-by.js +0 -1
- package/dist/lib/themes.js +0 -1
- package/dist/lib/urls.js +0 -1
- package/dist/mcp-server.js +19 -17
- package/dist/program.js +0 -1
- package/package.json +1 -1
- package/skills/cnotes/references/canvas-elements.md +1 -0
- package/skills/cnotes/references/canvas.md +8 -1
- package/dist/cn.d.ts +0 -3
- package/dist/cn.d.ts.map +0 -1
- package/dist/cn.js.map +0 -1
- package/dist/commands/auth-keys.d.ts +0 -3
- package/dist/commands/auth-keys.d.ts.map +0 -1
- package/dist/commands/auth-keys.js.map +0 -1
- package/dist/commands/auth.d.ts +0 -11
- package/dist/commands/auth.d.ts.map +0 -1
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/brief.d.ts +0 -9
- package/dist/commands/brief.d.ts.map +0 -1
- package/dist/commands/brief.js.map +0 -1
- package/dist/commands/canvas-milestone.d.ts +0 -14
- package/dist/commands/canvas-milestone.d.ts.map +0 -1
- package/dist/commands/canvas-milestone.js.map +0 -1
- package/dist/commands/canvas.d.ts +0 -20
- package/dist/commands/canvas.d.ts.map +0 -1
- package/dist/commands/canvas.js.map +0 -1
- package/dist/commands/claude-hook.d.ts +0 -28
- package/dist/commands/claude-hook.d.ts.map +0 -1
- package/dist/commands/claude-hook.js.map +0 -1
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/deps.d.ts +0 -94
- package/dist/commands/deps.d.ts.map +0 -1
- package/dist/commands/deps.js.map +0 -1
- package/dist/commands/draft.d.ts +0 -3
- package/dist/commands/draft.d.ts.map +0 -1
- package/dist/commands/draft.js.map +0 -1
- package/dist/commands/feedback.d.ts +0 -3
- package/dist/commands/feedback.d.ts.map +0 -1
- package/dist/commands/feedback.js.map +0 -1
- package/dist/commands/files.d.ts +0 -3
- package/dist/commands/files.d.ts.map +0 -1
- package/dist/commands/files.js.map +0 -1
- package/dist/commands/focus.d.ts +0 -3
- package/dist/commands/focus.d.ts.map +0 -1
- package/dist/commands/focus.js.map +0 -1
- package/dist/commands/goals.d.ts +0 -3
- package/dist/commands/goals.d.ts.map +0 -1
- package/dist/commands/goals.js.map +0 -1
- package/dist/commands/init.d.ts +0 -3
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -15
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/notes.d.ts +0 -3
- package/dist/commands/notes.d.ts.map +0 -1
- package/dist/commands/notes.js.map +0 -1
- package/dist/commands/operations.d.ts +0 -27
- package/dist/commands/operations.d.ts.map +0 -1
- package/dist/commands/operations.js.map +0 -1
- package/dist/commands/quality.d.ts +0 -14
- package/dist/commands/quality.d.ts.map +0 -1
- package/dist/commands/quality.js.map +0 -1
- package/dist/commands/relationships.d.ts +0 -8
- package/dist/commands/relationships.d.ts.map +0 -1
- package/dist/commands/relationships.js.map +0 -1
- package/dist/commands/review.d.ts +0 -19
- package/dist/commands/review.d.ts.map +0 -1
- package/dist/commands/review.js.map +0 -1
- package/dist/commands/schema.d.ts +0 -12
- package/dist/commands/schema.d.ts.map +0 -1
- package/dist/commands/schema.js.map +0 -1
- package/dist/commands/search.d.ts +0 -3
- package/dist/commands/search.d.ts.map +0 -1
- package/dist/commands/search.js.map +0 -1
- package/dist/commands/shared.d.ts +0 -3
- package/dist/commands/shared.d.ts.map +0 -1
- package/dist/commands/shared.js.map +0 -1
- package/dist/commands/skills.d.ts +0 -3
- package/dist/commands/skills.d.ts.map +0 -1
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/theme.d.ts +0 -3
- package/dist/commands/theme.d.ts.map +0 -1
- package/dist/commands/theme.js.map +0 -1
- package/dist/commands/timeline.d.ts +0 -4
- package/dist/commands/timeline.d.ts.map +0 -1
- package/dist/commands/timeline.js.map +0 -1
- package/dist/commands/types.d.ts +0 -3
- package/dist/commands/types.d.ts.map +0 -1
- package/dist/commands/types.js.map +0 -1
- package/dist/commands/upgrade.d.ts +0 -13
- package/dist/commands/upgrade.d.ts.map +0 -1
- package/dist/commands/upgrade.js.map +0 -1
- package/dist/commands/versions.d.ts +0 -3
- package/dist/commands/versions.d.ts.map +0 -1
- package/dist/commands/versions.js.map +0 -1
- package/dist/commands/workspace.d.ts +0 -13
- package/dist/commands/workspace.d.ts.map +0 -1
- package/dist/commands/workspace.js.map +0 -1
- package/dist/generated/embedded-build.d.ts +0 -22
- package/dist/generated/embedded-build.d.ts.map +0 -1
- package/dist/generated/embedded-build.js.map +0 -1
- package/dist/lib/active-run.d.ts +0 -62
- package/dist/lib/active-run.d.ts.map +0 -1
- package/dist/lib/active-run.js.map +0 -1
- package/dist/lib/agent-client.d.ts +0 -12
- package/dist/lib/agent-client.d.ts.map +0 -1
- package/dist/lib/agent-client.js.map +0 -1
- package/dist/lib/agent-grade.d.ts +0 -24
- package/dist/lib/agent-grade.d.ts.map +0 -1
- package/dist/lib/agent-grade.js.map +0 -1
- package/dist/lib/api-client.d.ts +0 -124
- package/dist/lib/api-client.d.ts.map +0 -1
- package/dist/lib/api-client.js.map +0 -1
- package/dist/lib/auth-store.d.ts +0 -177
- package/dist/lib/auth-store.d.ts.map +0 -1
- package/dist/lib/auth-store.js.map +0 -1
- package/dist/lib/billing-block.d.ts +0 -12
- package/dist/lib/billing-block.d.ts.map +0 -1
- package/dist/lib/billing-block.js.map +0 -1
- package/dist/lib/brand.d.ts +0 -35
- package/dist/lib/brand.d.ts.map +0 -1
- package/dist/lib/brand.js.map +0 -1
- package/dist/lib/build-schema.d.ts +0 -109
- package/dist/lib/build-schema.d.ts.map +0 -1
- package/dist/lib/build-schema.js.map +0 -1
- package/dist/lib/canvas-goal.d.ts +0 -59
- package/dist/lib/canvas-goal.d.ts.map +0 -1
- package/dist/lib/canvas-goal.js.map +0 -1
- package/dist/lib/canvas-layout.d.ts +0 -77
- package/dist/lib/canvas-layout.d.ts.map +0 -1
- package/dist/lib/canvas-layout.js.map +0 -1
- package/dist/lib/canvas-paths.d.ts +0 -31
- package/dist/lib/canvas-paths.d.ts.map +0 -1
- package/dist/lib/canvas-paths.js.map +0 -1
- package/dist/lib/claude-session.d.ts +0 -112
- package/dist/lib/claude-session.d.ts.map +0 -1
- package/dist/lib/claude-session.js.map +0 -1
- package/dist/lib/config.d.ts +0 -76
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/decision-citation.d.ts +0 -10
- package/dist/lib/decision-citation.d.ts.map +0 -1
- package/dist/lib/decision-citation.js.map +0 -1
- package/dist/lib/display-id.d.ts +0 -12
- package/dist/lib/display-id.d.ts.map +0 -1
- package/dist/lib/display-id.js.map +0 -1
- package/dist/lib/draft-ref.d.ts +0 -61
- package/dist/lib/draft-ref.d.ts.map +0 -1
- package/dist/lib/draft-ref.js.map +0 -1
- package/dist/lib/draft-view.d.ts +0 -566
- package/dist/lib/draft-view.d.ts.map +0 -1
- package/dist/lib/draft-view.js.map +0 -1
- package/dist/lib/errors.d.ts +0 -105
- package/dist/lib/errors.d.ts.map +0 -1
- package/dist/lib/errors.js.map +0 -1
- package/dist/lib/expand-notes.d.ts +0 -79
- package/dist/lib/expand-notes.d.ts.map +0 -1
- package/dist/lib/expand-notes.js.map +0 -1
- package/dist/lib/focus-time.d.ts +0 -16
- package/dist/lib/focus-time.d.ts.map +0 -1
- package/dist/lib/focus-time.js.map +0 -1
- package/dist/lib/fs-utils.d.ts +0 -10
- package/dist/lib/fs-utils.d.ts.map +0 -1
- package/dist/lib/fs-utils.js.map +0 -1
- package/dist/lib/goal-tree.d.ts +0 -71
- package/dist/lib/goal-tree.d.ts.map +0 -1
- package/dist/lib/goal-tree.js.map +0 -1
- package/dist/lib/headline-warnings.d.ts +0 -8
- package/dist/lib/headline-warnings.d.ts.map +0 -1
- package/dist/lib/headline-warnings.js.map +0 -1
- package/dist/lib/install-hook.d.ts +0 -86
- package/dist/lib/install-hook.d.ts.map +0 -1
- package/dist/lib/install-hook.js.map +0 -1
- package/dist/lib/install-mcp.d.ts +0 -21
- package/dist/lib/install-mcp.d.ts.map +0 -1
- package/dist/lib/install-mcp.js.map +0 -1
- package/dist/lib/install-skill.d.ts +0 -84
- package/dist/lib/install-skill.d.ts.map +0 -1
- package/dist/lib/install-skill.js.map +0 -1
- package/dist/lib/mcp-local-file.d.ts +0 -11
- package/dist/lib/mcp-local-file.d.ts.map +0 -1
- package/dist/lib/mcp-local-file.js.map +0 -1
- package/dist/lib/mention-lint.d.ts +0 -159
- package/dist/lib/mention-lint.d.ts.map +0 -1
- package/dist/lib/mention-lint.js.map +0 -1
- package/dist/lib/milestone-message.d.ts +0 -37
- package/dist/lib/milestone-message.d.ts.map +0 -1
- package/dist/lib/milestone-message.js.map +0 -1
- package/dist/lib/output.d.ts +0 -57
- package/dist/lib/output.d.ts.map +0 -1
- package/dist/lib/output.js.map +0 -1
- package/dist/lib/quality.d.ts +0 -142
- package/dist/lib/quality.d.ts.map +0 -1
- package/dist/lib/quality.js.map +0 -1
- package/dist/lib/resolve-note.d.ts +0 -7
- package/dist/lib/resolve-note.d.ts.map +0 -1
- package/dist/lib/resolve-note.js.map +0 -1
- package/dist/lib/review-helpers.d.ts +0 -37
- package/dist/lib/review-helpers.d.ts.map +0 -1
- package/dist/lib/review-helpers.js.map +0 -1
- package/dist/lib/rubric-sections.d.ts +0 -29
- package/dist/lib/rubric-sections.d.ts.map +0 -1
- package/dist/lib/rubric-sections.js.map +0 -1
- package/dist/lib/rubrics.d.ts +0 -60
- package/dist/lib/rubrics.d.ts.map +0 -1
- package/dist/lib/rubrics.js.map +0 -1
- package/dist/lib/runtime.d.ts +0 -40
- package/dist/lib/runtime.d.ts.map +0 -1
- package/dist/lib/runtime.js.map +0 -1
- package/dist/lib/server-url.d.ts +0 -33
- package/dist/lib/server-url.d.ts.map +0 -1
- package/dist/lib/server-url.js.map +0 -1
- package/dist/lib/session-brief.d.ts +0 -60
- package/dist/lib/session-brief.d.ts.map +0 -1
- package/dist/lib/session-brief.js.map +0 -1
- package/dist/lib/share-link.d.ts +0 -19
- package/dist/lib/share-link.d.ts.map +0 -1
- package/dist/lib/share-link.js.map +0 -1
- package/dist/lib/shared-rows.d.ts +0 -46
- package/dist/lib/shared-rows.d.ts.map +0 -1
- package/dist/lib/shared-rows.js.map +0 -1
- package/dist/lib/stdin.d.ts +0 -5
- package/dist/lib/stdin.d.ts.map +0 -1
- package/dist/lib/stdin.js.map +0 -1
- package/dist/lib/storage-id.d.ts +0 -12
- package/dist/lib/storage-id.d.ts.map +0 -1
- package/dist/lib/storage-id.js.map +0 -1
- package/dist/lib/style.d.ts +0 -10
- package/dist/lib/style.d.ts.map +0 -1
- package/dist/lib/style.js.map +0 -1
- package/dist/lib/superseded-by.d.ts +0 -20
- package/dist/lib/superseded-by.d.ts.map +0 -1
- package/dist/lib/superseded-by.js.map +0 -1
- package/dist/lib/themes.d.ts +0 -44
- package/dist/lib/themes.d.ts.map +0 -1
- package/dist/lib/themes.js.map +0 -1
- package/dist/lib/urls.d.ts +0 -44
- package/dist/lib/urls.d.ts.map +0 -1
- package/dist/lib/urls.js.map +0 -1
- package/dist/mcp-server.d.ts +0 -3
- package/dist/mcp-server.d.ts.map +0 -1
- package/dist/mcp-server.js.map +0 -1
- package/dist/program.d.ts +0 -13
- package/dist/program.d.ts.map +0 -1
- package/dist/program.js.map +0 -1
package/dist/cn.js
CHANGED
package/dist/commands/auth.js
CHANGED
package/dist/commands/brief.js
CHANGED
package/dist/commands/canvas.js
CHANGED
|
@@ -613,7 +613,7 @@ Examples:
|
|
|
613
613
|
.description("Check a board for cards that contradict each other and claims nothing on the board backs. " +
|
|
614
614
|
"Writes nothing: turn each finding into a Tension note (a contradiction, linking both cards) or a " +
|
|
615
615
|
"Question note (what would back this claim?) inside a draft, so a person accepts them. " +
|
|
616
|
-
"One model call per card; editors only; the deployment
|
|
616
|
+
"One model call per card; editors only; refused where the deployment has no decision model for this workspace.")
|
|
617
617
|
.argument("<canvasId>", "Canvas ID or display ID (CANVAS-12)")
|
|
618
618
|
.action(async (canvasId) => {
|
|
619
619
|
const cfg = resolveConfig(program.opts());
|
|
@@ -1468,6 +1468,47 @@ Examples:
|
|
|
1468
1468
|
handleError(error, cfg.json);
|
|
1469
1469
|
}
|
|
1470
1470
|
});
|
|
1471
|
+
canvas
|
|
1472
|
+
.command("add-quote")
|
|
1473
|
+
.description("Quote words from a note onto a canvas as a quote card pinned to the note's saved version")
|
|
1474
|
+
.argument("<canvasId>", "Canvas ID (CANVAS-<n> or id)")
|
|
1475
|
+
.requiredOption("--note <ref>", "The note to quote (display id like TRANSCRIPT-4, or id)")
|
|
1476
|
+
.requiredOption("--text <words>", "The exact words to quote; they must appear in the note's saved version")
|
|
1477
|
+
.addOption(new Option("--style <style>", "How the card shows the words").choices(["pull", "highlight", "evidence"]))
|
|
1478
|
+
.option("--x <n>", "Raw X position (default: beside the note's card, else below everything)")
|
|
1479
|
+
.option("--y <n>", "Raw Y position")
|
|
1480
|
+
.addHelpText("after", `
|
|
1481
|
+
A quote is evidence, not a claim: the words stay pinned to the version they came
|
|
1482
|
+
from and never change. To say what a quote means, write an Insight that cites
|
|
1483
|
+
the source note.
|
|
1484
|
+
|
|
1485
|
+
Examples:
|
|
1486
|
+
$ cnotes canvas add-quote CANVAS-12 --note TRANSCRIPT-4 --text "We lose them at the invite step"
|
|
1487
|
+
$ cnotes canvas add-quote CANVAS-12 --note TRANSCRIPT-4 --text "every time" --style highlight
|
|
1488
|
+
`)
|
|
1489
|
+
.action(async (canvasId, opts) => {
|
|
1490
|
+
const cfg = resolveConfig(program.opts());
|
|
1491
|
+
const api = new ApiClient(cfg.serverUrl, cfg.token, cfg.workspaceId);
|
|
1492
|
+
try {
|
|
1493
|
+
const position = rawPosition(opts);
|
|
1494
|
+
const data = await api.post(canvasActionPath(canvasId, cfg.workspaceId), {
|
|
1495
|
+
action: "addQuote",
|
|
1496
|
+
note: opts.note,
|
|
1497
|
+
text: opts.text,
|
|
1498
|
+
...(opts.style ? { style: opts.style } : {}),
|
|
1499
|
+
...(position ? { positionX: position.x, positionY: position.y } : {}),
|
|
1500
|
+
});
|
|
1501
|
+
if (cfg.quiet)
|
|
1502
|
+
outputQuiet(String(data.nodeId ?? ""));
|
|
1503
|
+
else if (cfg.json)
|
|
1504
|
+
outputJson(data);
|
|
1505
|
+
else
|
|
1506
|
+
console.log(`Quoted ${data.noteDisplayId} v${data.versionNumber} on ${canvasId} at (${data.positionX}, ${data.positionY})`);
|
|
1507
|
+
}
|
|
1508
|
+
catch (error) {
|
|
1509
|
+
handleError(error, cfg.json);
|
|
1510
|
+
}
|
|
1511
|
+
});
|
|
1471
1512
|
canvas
|
|
1472
1513
|
.command("bulk-add")
|
|
1473
1514
|
.description("Add multiple notes to a canvas in one operation with positions")
|
|
@@ -3158,4 +3199,3 @@ Examples:
|
|
|
3158
3199
|
}
|
|
3159
3200
|
});
|
|
3160
3201
|
}
|
|
3161
|
-
//# sourceMappingURL=canvas.js.map
|
package/dist/commands/config.js
CHANGED
package/dist/commands/deps.js
CHANGED
package/dist/commands/draft.js
CHANGED
|
@@ -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
|
package/dist/commands/files.js
CHANGED
package/dist/commands/focus.js
CHANGED
package/dist/commands/goals.js
CHANGED
package/dist/commands/init.js
CHANGED
|
@@ -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
|
package/dist/commands/mcp.js
CHANGED
package/dist/commands/notes.js
CHANGED
|
@@ -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";
|
|
@@ -998,6 +997,9 @@ async function displayNotesList(notesList, limit, cfg, api, message) {
|
|
|
998
997
|
return;
|
|
999
998
|
}
|
|
1000
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");
|
|
1001
1003
|
const chosenIndex = await select({
|
|
1002
1004
|
message: `${sliced.length} ${message}`,
|
|
1003
1005
|
choices: sliced.map((n, i) => ({
|
|
@@ -1050,6 +1052,7 @@ async function viewNoteInteractive(api, workspaceId, displayId) {
|
|
|
1050
1052
|
console.log("\n(no content)");
|
|
1051
1053
|
return;
|
|
1052
1054
|
}
|
|
1055
|
+
const { select } = await import("@inquirer/prompts");
|
|
1053
1056
|
const viewMode = await select({
|
|
1054
1057
|
message: "View:",
|
|
1055
1058
|
choices: [
|
|
@@ -1206,4 +1209,3 @@ function printNote(note, version) {
|
|
|
1206
1209
|
console.log(`\n${searchContent}`);
|
|
1207
1210
|
}
|
|
1208
1211
|
}
|
|
1209
|
-
//# sourceMappingURL=notes.js.map
|
package/dist/commands/quality.js
CHANGED
package/dist/commands/review.js
CHANGED
package/dist/commands/schema.js
CHANGED
package/dist/commands/search.js
CHANGED
package/dist/commands/shared.js
CHANGED
package/dist/commands/skills.js
CHANGED
package/dist/commands/theme.js
CHANGED
package/dist/commands/types.js
CHANGED
package/dist/commands/upgrade.js
CHANGED
|
@@ -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
|
package/dist/lib/active-run.js
CHANGED
package/dist/lib/agent-client.js
CHANGED
package/dist/lib/agent-grade.js
CHANGED
package/dist/lib/api-client.js
CHANGED
|
@@ -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
|
-
*
|
|
126
|
-
*
|
|
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
|
package/dist/lib/auth-store.js
CHANGED
package/dist/lib/brand.js
CHANGED
package/dist/lib/build-schema.js
CHANGED
package/dist/lib/canvas-goal.js
CHANGED
|
@@ -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
|
package/dist/lib/canvas-paths.js
CHANGED
package/dist/lib/config.js
CHANGED
|
@@ -7,4 +7,3 @@
|
|
|
7
7
|
* surfaces quote. Keep the skill's copy in step with it.
|
|
8
8
|
*/
|
|
9
9
|
export const DECISION_CARD_RULE = "Anything settled in conversation that shapes what we build or say publicly gets its own Decision card, citing the cards it depends on (typed links such as depends-on / grounded-in). If something is stated as decided but no Decision card exists, say so and create one.";
|
|
10
|
-
//# sourceMappingURL=decision-citation.js.map
|
package/dist/lib/display-id.js
CHANGED
package/dist/lib/draft-ref.js
CHANGED
package/dist/lib/draft-view.js
CHANGED
package/dist/lib/errors.js
CHANGED
|
@@ -229,6 +229,36 @@ function extractErrorCode(err) {
|
|
|
229
229
|
}
|
|
230
230
|
return undefined;
|
|
231
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* Transport failures that will not heal within a retry's backoff: the host
|
|
234
|
+
* does not resolve, nothing is listening, the URL is malformed, or the TLS
|
|
235
|
+
* handshake is refused. Retrying these only turns a 200 ms failure into a
|
|
236
|
+
* 3 s one, which is the first thing an agent hits with a stale server URL.
|
|
237
|
+
* Resets, timeouts and resolver hiccups stay retryable.
|
|
238
|
+
*/
|
|
239
|
+
const PERMANENT_NETWORK_CODES = new Set([
|
|
240
|
+
"ENOTFOUND",
|
|
241
|
+
"ECONNREFUSED",
|
|
242
|
+
"EAI_FAIL",
|
|
243
|
+
"ERR_INVALID_URL",
|
|
244
|
+
"EHOSTUNREACH",
|
|
245
|
+
"ENETUNREACH",
|
|
246
|
+
]);
|
|
247
|
+
export function isPermanentNetworkError(err) {
|
|
248
|
+
const code = extractErrorCode(err);
|
|
249
|
+
if (!code)
|
|
250
|
+
return false;
|
|
251
|
+
return PERMANENT_NETWORK_CODES.has(code) || isTlsCode(code);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* A transient failure that happened before any byte of the request reached
|
|
255
|
+
* the server (a DNS lookup that timed out), so even a write is safe to send
|
|
256
|
+
* again. A reset or timeout mid-request is not: the server may have
|
|
257
|
+
* committed the write.
|
|
258
|
+
*/
|
|
259
|
+
export function isRefusedBeforeSend(err) {
|
|
260
|
+
return extractErrorCode(err) === "EAI_AGAIN";
|
|
261
|
+
}
|
|
232
262
|
/**
|
|
233
263
|
* True when an error means the request failed at the transport layer rather
|
|
234
264
|
* than returning an HTTP status. Node fetch raises `TypeError: fetch failed`
|
|
@@ -320,14 +350,16 @@ function hintForStatus(status, message, resource) {
|
|
|
320
350
|
}
|
|
321
351
|
if (r === "edit")
|
|
322
352
|
return "Run `cnotes draft edits` to see this draft's proposals.";
|
|
323
|
-
|
|
324
|
-
|
|
353
|
+
// Specific resources first: a message such as "Canvas not found in this
|
|
354
|
+
// workspace" must not send the agent to `workspace list`.
|
|
355
|
+
if (r === "canvas" || (!r && /canvas/i.test(message))) {
|
|
356
|
+
return "Run `cnotes canvas list` to see available canvases.";
|
|
325
357
|
}
|
|
326
|
-
if (r === "note" || (!r && /
|
|
358
|
+
if (r === "note" || r.endsWith(" note") || (!r && /\bnote\b/i.test(message))) {
|
|
327
359
|
return "Run `cnotes notes list` to see valid display IDs.";
|
|
328
360
|
}
|
|
329
|
-
if (r === "
|
|
330
|
-
return "Run `cnotes
|
|
361
|
+
if (r === "workspace" || (!r && /workspace/i.test(message))) {
|
|
362
|
+
return "Run `cnotes workspace list` to see available workspaces.";
|
|
331
363
|
}
|
|
332
364
|
return "Run `cnotes schema` to see valid resource identifiers.";
|
|
333
365
|
}
|
|
@@ -458,4 +490,3 @@ export function handleError(error, json) {
|
|
|
458
490
|
}
|
|
459
491
|
process.exit(EXIT_CODES.GENERIC);
|
|
460
492
|
}
|
|
461
|
-
//# sourceMappingURL=errors.js.map
|
package/dist/lib/expand-notes.js
CHANGED
package/dist/lib/focus-time.js
CHANGED
package/dist/lib/fs-utils.js
CHANGED
package/dist/lib/goal-tree.js
CHANGED
package/dist/lib/install-hook.js
CHANGED
package/dist/lib/install-mcp.js
CHANGED