@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.
- 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 +52 -4
- 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 +7 -4
- package/dist/commands/operations.js +2 -3
- 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 +3 -3
- 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 +2 -3
- 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 +105 -9
- 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 +20 -18
- package/dist/program.js +0 -1
- package/package.json +1 -1
- package/skills/cnotes/references/canvas.md +7 -0
- package/skills/cnotes/references/notes.md +7 -0
- package/skills/cnotes/references/operations.md +6 -2
- 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 -81
- 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
|
@@ -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 {
|
|
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 =
|
|
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 =
|
|
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
|
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";
|
|
@@ -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
|
-
"
|
|
507
|
-
"
|
|
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 {
|
|
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 =
|
|
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
|
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
|
@@ -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
|
-
"
|
|
61
|
-
"
|
|
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
|
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
|
@@ -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
|
-
"
|
|
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: "
|
|
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
|
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