@creator-notes/cnotes 0.121.10 → 0.122.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/commands/canvas.js +1 -1
- package/dist/commands/draft.js +8 -2
- package/dist/commands/quality.js +55 -4
- package/dist/commands/skills.js +27 -5
- package/dist/lib/install-skill.js +62 -11
- package/dist/lib/quality.js +43 -0
- package/dist/mcp-server.js +5 -5
- package/package.json +1 -1
- package/skills/attention-planner/SKILL.md +3 -1
- package/skills/attention-planner/references/attention-type.md +5 -3
- package/skills/cnotes/SKILL.md +45 -62
- package/skills/cnotes/references/agents-together.md +1 -1
- package/skills/cnotes/references/billing.md +8 -8
- package/skills/cnotes/references/canvas-elements.md +20 -20
- package/skills/cnotes/references/canvas-layout.md +37 -29
- package/skills/cnotes/references/canvas.md +4 -2
- package/skills/cnotes/references/drafts.md +7 -5
- package/skills/cnotes/references/humanizer.md +31 -31
- package/skills/cnotes/references/more-commands.md +9 -9
- package/skills/cnotes/references/notes.md +17 -14
- package/skills/cnotes/references/operations.md +13 -12
- package/skills/cnotes/references/output.md +23 -0
- package/skills/cnotes/references/relationships.md +11 -11
- package/skills/fat-marker-flows/SKILL.md +10 -13
- package/skills/goal-tree/SKILL.md +2 -2
- package/skills/howto-filmstrips/SKILL.md +10 -10
- package/skills/teach-workspace/SKILL.md +5 -2
- package/skills/transcript-timeline/SKILL.md +7 -7
- package/skills/transcript-timeline/references/layout.md +6 -6
- package/skills/wayfind/SKILL.md +36 -33
package/dist/commands/canvas.js
CHANGED
|
@@ -1370,7 +1370,7 @@ Examples:
|
|
|
1370
1370
|
.command(name)
|
|
1371
1371
|
.description(description)
|
|
1372
1372
|
.argument("<canvasId>", "Canvas ID")
|
|
1373
|
-
.option("--content <content>", "Text content inline (markdown — headings, bold, links;
|
|
1373
|
+
.option("--content <content>", "Text content inline (markdown — headings, bold, links; a mention such as [NOTE-12: Title](relationship:verb) renders as a chip, a bare display id is a defect)")
|
|
1374
1374
|
.option("--content-file <path>", "Read text content (markdown) from a file")
|
|
1375
1375
|
.addOption(new Option("--size <size>", "Display size: small (560px), medium (1120px), large (1680px billboard)").choices(["small", "medium", "large"]))
|
|
1376
1376
|
.option("--color <hex>", "Background tint — DEFAULT IS NO BACKGROUND. Pass a ROLE hex: #3B82F6 evidence · #22C55E commitment · #EC4899 insight · #F59E0B warning · #EF4444 danger · #8B5CF6 people. Any other hex is snapped to the nearest of these at render, so an off-palette color just picks a role imprecisely. Reuse one role per meaning; omit it entirely unless the tint means something.")
|
package/dist/commands/draft.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
|
+
import { Option } from "commander";
|
|
2
3
|
import { ApiClient } from "../lib/api-client.js";
|
|
3
4
|
import { liveWorkspaceId, resolveBaseConfig, resolveConfig } from "../lib/config.js";
|
|
4
5
|
import { clearProposalById, loadConfig, setActiveProposal } from "../lib/auth-store.js";
|
|
@@ -149,7 +150,8 @@ Examples:
|
|
|
149
150
|
.description("Open a private draft of the active workspace and work in it; --from-canvas branches a shared board into it")
|
|
150
151
|
.argument("[name]", "What the draft is called (optional with --from-canvas: \"<board name> V2\")")
|
|
151
152
|
.option("--from-canvas <canvas>", "Branch this board of the active workspace (CANVAS-n): the draft holds your working copy, and a person accepts it as the board's next version")
|
|
152
|
-
.option("--
|
|
153
|
+
.option("--why <text>", "The problem it answers, in the person's words, not the task: shown to them as Why. Never opens with a verb (unlike every --intent, which is a past-tense headline)")
|
|
154
|
+
.addOption(new Option("--intent <text>", "Alias of --why, kept for older scripts").hideHelp())
|
|
153
155
|
.option("--answers <ids>", "Shared notes it answers, comma-separated (QUESTION-12,PROBLEM-3): the why, as links the person can open")
|
|
154
156
|
.option("--no-switch", "Open it without working in it (commands keep working live)")
|
|
155
157
|
.addHelpText("after", `
|
|
@@ -162,7 +164,7 @@ change until a person accepts the copy as its next version.
|
|
|
162
164
|
--json adds branch { canvasId, displayId, sourceCanvasId, sourceDisplayId,
|
|
163
165
|
sourceName, baseLabel, copied } for a branch.
|
|
164
166
|
|
|
165
|
-
Say why when you open it. --
|
|
167
|
+
Say why when you open it. --why is the problem the draft answers, in the
|
|
166
168
|
person's words, never the task: "Reviewers read IBD and controlled money as
|
|
167
169
|
two things", not "Add a glossary". The person reads it as Why, above the
|
|
168
170
|
runs, and the server refuses one that opens with a verb. --answers names the
|
|
@@ -174,6 +176,10 @@ out, so the work keeps its direction.
|
|
|
174
176
|
const cfg = resolveConfig(program.opts());
|
|
175
177
|
const api = new ApiClient(cfg.serverUrl, cfg.token, cfg.workspaceId);
|
|
176
178
|
try {
|
|
179
|
+
if (opts.why !== undefined && opts.intent !== undefined) {
|
|
180
|
+
throw new ValidationError("Pass --why once; --intent is its older name.");
|
|
181
|
+
}
|
|
182
|
+
opts.intent = opts.why ?? opts.intent;
|
|
177
183
|
if (!name?.trim() && !opts.fromCanvas?.trim()) {
|
|
178
184
|
throw new ValidationError("Name the draft, or branch a board", 'Run `cnotes draft open "<name>"`, or `cnotes draft open --from-canvas CANVAS-n`');
|
|
179
185
|
}
|
package/dist/commands/quality.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
1
2
|
import { ApiClient } from "../lib/api-client.js";
|
|
2
3
|
import { resolveConfig } from "../lib/config.js";
|
|
3
4
|
import { CliError, EXIT_CODES, handleError, ValidationError } from "../lib/errors.js";
|
|
4
5
|
import { outputJson, truncate } from "../lib/output.js";
|
|
5
6
|
import { lintPlainTextDisplayIdsBatch } from "../lib/mention-lint.js";
|
|
6
|
-
import { LADDER_LABELS, LADDER_TOP, MIN_BODY_CHARS, QUALITY_CREDIT_COST, gradeFromStored, gradeRequestFor, itemFails, parseGradeSubmission, structuralIssues, toQualityNote, typeCatalogFrom, } from "../lib/quality.js";
|
|
7
|
+
import { LADDER_LABELS, LADDER_TOP, MIN_BODY_CHARS, QUALITY_CREDIT_COST, gradeFromStored, gradeRequestFor, itemFails, parseGradeBatch, parseGradeSubmission, structuralIssues, toQualityNote, typeCatalogFrom, } from "../lib/quality.js";
|
|
7
8
|
const MAX_NOTES = 200;
|
|
8
9
|
/**
|
|
9
10
|
* `cnotes quality`: structural checks plus a hand-off so the calling agent
|
|
@@ -134,9 +135,11 @@ Examples:
|
|
|
134
135
|
quality
|
|
135
136
|
.command("record")
|
|
136
137
|
.description("Record your grade for a note (level and a reason per criterion). Free: this does not spend credits. gradedBy is the open agent run, or the agent when no run is open.")
|
|
137
|
-
.argument("
|
|
138
|
-
.
|
|
139
|
-
.
|
|
138
|
+
.argument("[displayId]", "Note display ID (e.g. INSIGHT-12). Omit it with --grades / --grades-file.")
|
|
139
|
+
.option("--level <n>", "Ladder rung 1-4")
|
|
140
|
+
.option("--criteria <json>", 'JSON array of {"criterion","reason"}. "name" is accepted as an alias for criterion.')
|
|
141
|
+
.option("--grades <json>", 'Several grades in one call: a JSON array of {"displayId","level","criteria","feedback"?,"nextStep"?,"gradedVersion"?}. Each is recorded in turn; a bad entry is reported and the rest still land.')
|
|
142
|
+
.option("--grades-file <path>", "The same array, read from a file")
|
|
140
143
|
.option("--feedback <text>", "One sentence: where the note sits")
|
|
141
144
|
.option("--next-step <text>", "The single next move. Required below 4. Empty at 4.")
|
|
142
145
|
.option("--suggestion <text>", "A further improvement (repeatable)", (value, previous) => previous.concat([value]), [])
|
|
@@ -146,11 +149,59 @@ Examples:
|
|
|
146
149
|
Examples:
|
|
147
150
|
$ cnotes quality record INSIGHT-12 --graded-version 4 --level 3 --criteria '[{"criterion":"Evidence","reason":"Grounded in two tickets."}]' --feedback "The pattern is named." --next-step "Say what would falsify it."
|
|
148
151
|
$ cnotes quality record DECISION-4 --level 4 --criteria '[{"criterion":"Revisit","reason":"Names the trigger."}]' --next-step ""
|
|
152
|
+
$ cnotes quality record --grades-file ./grades.json # every note of a board in one call
|
|
149
153
|
`)
|
|
150
154
|
.action(async (displayId, opts) => {
|
|
151
155
|
const cfg = resolveConfig(program.opts());
|
|
152
156
|
const api = new ApiClient(cfg.serverUrl, cfg.token);
|
|
153
157
|
try {
|
|
158
|
+
if (opts.grades !== undefined || opts.gradesFile !== undefined) {
|
|
159
|
+
if (displayId || opts.level !== undefined || opts.criteria !== undefined) {
|
|
160
|
+
throw new ValidationError("--grades carries every grade: pass no display id, --level or --criteria beside it.");
|
|
161
|
+
}
|
|
162
|
+
const raw = opts.gradesFile !== undefined ? readFileSync(String(opts.gradesFile), "utf8") : String(opts.grades);
|
|
163
|
+
const batch = parseGradeBatch(raw);
|
|
164
|
+
if (!batch.ok)
|
|
165
|
+
throw new ValidationError(batch.message);
|
|
166
|
+
const results = [];
|
|
167
|
+
for (const entry of batch.entries) {
|
|
168
|
+
if (!entry.ok) {
|
|
169
|
+
results.push({ displayId: entry.displayId, error: entry.message });
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
const body = await api.post(`/api/notes/${encodeURIComponent(entry.displayId)}/grade?workspaceId=${encodeURIComponent(cfg.workspaceId)}`, { ...entry.value });
|
|
174
|
+
results.push({ displayId: entry.displayId, ...body });
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
results.push({ displayId: entry.displayId, error: error instanceof Error ? error.message : String(error) });
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
const failed = results.filter((r) => r.error);
|
|
181
|
+
if (cfg.json) {
|
|
182
|
+
outputJson({ results, recorded: results.length - failed.length, failed: failed.length });
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
for (const r of results) {
|
|
186
|
+
if (r.error)
|
|
187
|
+
console.log(`✗ ${r.displayId}: ${r.error}`);
|
|
188
|
+
else {
|
|
189
|
+
const level = typeof r.level === "number" ? r.level : "?";
|
|
190
|
+
console.log(`Recorded ${r.displayId} at ${level}/${LADDER_TOP} ${LADDER_LABELS[Number(level)] ?? ""}`.trimEnd());
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
console.log(`${results.length - failed.length} of ${results.length} grades recorded. No credits spent.`);
|
|
194
|
+
}
|
|
195
|
+
if (failed.length > 0)
|
|
196
|
+
process.exitCode = EXIT_CODES.VALIDATION;
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (!displayId) {
|
|
200
|
+
throw new ValidationError("Pass a note display id, or --grades / --grades-file for several at once.");
|
|
201
|
+
}
|
|
202
|
+
if (opts.level === undefined || opts.criteria === undefined) {
|
|
203
|
+
throw new ValidationError("--level and --criteria are required for a single grade.");
|
|
204
|
+
}
|
|
154
205
|
const parsed = parseGradeSubmission({
|
|
155
206
|
level: opts.level,
|
|
156
207
|
criteria: opts.criteria,
|
package/dist/commands/skills.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveBaseConfig } from "../lib/config.js";
|
|
2
|
-
import { handleError, ValidationError } from "../lib/errors.js";
|
|
2
|
+
import { EXIT_CODES, handleError, ValidationError } from "../lib/errors.js";
|
|
3
3
|
import { outputJson } from "../lib/output.js";
|
|
4
|
-
import { SKILL_CATALOG, SKILL_TARGETS, resolveCatalogSkill, hasAgentConfigDir, installSkillFolder, skillTargetLabel, } from "../lib/install-skill.js";
|
|
4
|
+
import { SKILL_CATALOG, SKILL_TARGETS, resolveCatalogSkill, hasAgentConfigDir, installSkillFolder, installedSkillState, skillTargetLabel, } from "../lib/install-skill.js";
|
|
5
5
|
/**
|
|
6
6
|
* Decide which agents to install for. An explicit `--agent` wins; otherwise
|
|
7
7
|
* install for every agent the user already uses (its config dir exists), and
|
|
@@ -27,9 +27,11 @@ export function registerSkillsCommands(program) {
|
|
|
27
27
|
.description("Install bundled agent skills (e.g. fat-marker flows, how-to filmstrips, wayfind, goal tree, shaping, attention planner, transcript timeline, teach a workspace) into Claude Code, Codex, or Cursor");
|
|
28
28
|
skills
|
|
29
29
|
.command("list")
|
|
30
|
-
.description("List the skills this CLI can install")
|
|
30
|
+
.description("List the skills this CLI can install, and whether each agent's copy is current")
|
|
31
31
|
.action(() => {
|
|
32
32
|
const cfg = resolveBaseConfig(program.opts());
|
|
33
|
+
const agents = SKILL_TARGETS.filter(hasAgentConfigDir);
|
|
34
|
+
const states = (name) => agents.map((target) => ({ target, state: installedSkillState(name, target) }));
|
|
33
35
|
if (cfg.json) {
|
|
34
36
|
outputJson(SKILL_CATALOG.map((s) => ({
|
|
35
37
|
name: s.name,
|
|
@@ -37,16 +39,26 @@ export function registerSkillsCommands(program) {
|
|
|
37
39
|
label: s.label,
|
|
38
40
|
description: s.description,
|
|
39
41
|
auto: s.auto,
|
|
42
|
+
installs: states(s.name),
|
|
40
43
|
})));
|
|
41
44
|
return;
|
|
42
45
|
}
|
|
43
46
|
console.log("Installable skills:\n");
|
|
47
|
+
const wording = {
|
|
48
|
+
"not-installed": "not installed",
|
|
49
|
+
"up-to-date": "installed, current",
|
|
50
|
+
stale: "installed, older than this CLI (refreshes on the next cnotes command)",
|
|
51
|
+
foreign: "a different skill of this name is installed; `cnotes skills install <name> --force` replaces it",
|
|
52
|
+
};
|
|
44
53
|
for (const s of SKILL_CATALOG) {
|
|
45
54
|
const aka = s.aliases.length ? ` (aka ${s.aliases.join(", ")})` : "";
|
|
46
55
|
console.log(` ${s.name}${aka}`);
|
|
47
56
|
console.log(` ${s.description}`);
|
|
48
57
|
if (s.auto)
|
|
49
58
|
console.log(" auto-installed by `cnotes init`");
|
|
59
|
+
for (const { target, state } of states(s.name)) {
|
|
60
|
+
console.log(` ${skillTargetLabel(target)}: ${wording[state]}`);
|
|
61
|
+
}
|
|
50
62
|
console.log("");
|
|
51
63
|
}
|
|
52
64
|
console.log("Install one with: cnotes skills install <name>");
|
|
@@ -55,6 +67,7 @@ export function registerSkillsCommands(program) {
|
|
|
55
67
|
.command("install <name>")
|
|
56
68
|
.description("Install a bundled skill into your agent's skills dir")
|
|
57
69
|
.option("--agent <agent>", "Which agent to install for: claude, codex, cursor, or all (default: auto-detect)")
|
|
70
|
+
.option("--force", "Replace a folder of the same name that is not a cnotes skill (by default it is left alone)")
|
|
58
71
|
.addHelpText("after", `
|
|
59
72
|
Examples:
|
|
60
73
|
$ cnotes skills install fat-marker
|
|
@@ -74,20 +87,29 @@ Examples:
|
|
|
74
87
|
throw new ValidationError(`Unknown skill "${name}". Available: ${known}.`);
|
|
75
88
|
}
|
|
76
89
|
const targets = resolveTargets(options.agent);
|
|
77
|
-
const results = targets.map((t) => installSkillFolder(skill.name, t));
|
|
90
|
+
const results = targets.map((t) => installSkillFolder(skill.name, t, { force: options.force }));
|
|
91
|
+
const refused = results.filter((r) => r.refused);
|
|
78
92
|
if (cfg.json) {
|
|
79
93
|
outputJson({ skill: skill.name, results });
|
|
94
|
+
if (refused.length > 0)
|
|
95
|
+
process.exitCode = EXIT_CODES.CONFLICT;
|
|
80
96
|
return;
|
|
81
97
|
}
|
|
82
98
|
for (const r of results) {
|
|
83
99
|
const label = skillTargetLabel(r.target);
|
|
84
|
-
if (r.
|
|
100
|
+
if (r.refused) {
|
|
101
|
+
console.log(`✗ ${label}: ${r.destPath} holds a different skill named "${skill.name}" (not a cnotes skill), so it was left alone. ` +
|
|
102
|
+
`Re-run with --force to replace it.`);
|
|
103
|
+
}
|
|
104
|
+
else if (r.alreadyUpToDate) {
|
|
85
105
|
console.log(`✓ ${skill.label} already up to date for ${label} (${r.destPath})`);
|
|
86
106
|
}
|
|
87
107
|
else {
|
|
88
108
|
console.log(`✓ Installed ${skill.label} for ${label} → ${r.destPath}`);
|
|
89
109
|
}
|
|
90
110
|
}
|
|
111
|
+
if (refused.length > 0)
|
|
112
|
+
process.exitCode = EXIT_CODES.CONFLICT;
|
|
91
113
|
// Filmstrip skills also need an authed workspace to place canvases.
|
|
92
114
|
if (skill.name === "fat-marker-flows") {
|
|
93
115
|
console.log("");
|
|
@@ -215,19 +215,53 @@ function bundledSkillDir(name) {
|
|
|
215
215
|
function skillFolderDest(name, target) {
|
|
216
216
|
return resolve(agentConfigDir(target), "skills", name);
|
|
217
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* Whether a skill folder in an agent's skills dir is one of ours. A catalog
|
|
220
|
+
* name is a plain word (`shaping`, `teach`), and a third-party skill of the
|
|
221
|
+
* same name may already sit there: a user had another shaping skill under
|
|
222
|
+
* ~/.claude/skills/shaping, and an install would have copied over it with no
|
|
223
|
+
* warning. Ours say both `cnotes` and `CreatorNotes` in SKILL.md (every
|
|
224
|
+
* bundled skill runs through the CLI and names the product); a stale copy
|
|
225
|
+
* from any earlier version does too, so it still refreshes.
|
|
226
|
+
*/
|
|
227
|
+
export function isOurSkillFolder(dir) {
|
|
228
|
+
try {
|
|
229
|
+
const md = readFileSync(resolve(dir, "SKILL.md"), "utf8");
|
|
230
|
+
return md.includes("cnotes") && md.includes("CreatorNotes");
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
export function installedSkillState(name, target) {
|
|
237
|
+
const dest = skillFolderDest(name, target);
|
|
238
|
+
if (!existsSync(resolve(dest, "SKILL.md")))
|
|
239
|
+
return "not-installed";
|
|
240
|
+
if (!isOurSkillFolder(dest))
|
|
241
|
+
return "foreign";
|
|
242
|
+
const source = bundledSkillDir(name);
|
|
243
|
+
if (!existsSync(source))
|
|
244
|
+
return "stale";
|
|
245
|
+
return skillTreeUpToDate(source, dest) ? "up-to-date" : "stale";
|
|
246
|
+
}
|
|
218
247
|
/**
|
|
219
248
|
* Copy a bundled skill *folder* (SKILL.md plus any assets) into a target
|
|
220
|
-
* agent's skills dir. Overwrites an existing copy so re-running
|
|
221
|
-
*
|
|
222
|
-
*
|
|
249
|
+
* agent's skills dir. Overwrites an existing copy of OURS so re-running
|
|
250
|
+
* upgrades it; a folder that is not ours is left alone unless `force` says
|
|
251
|
+
* otherwise, and the result says so (`refused`). "Up to date" compares every
|
|
252
|
+
* bundled file, so a changed reference refreshes too.
|
|
223
253
|
*/
|
|
224
|
-
export function installSkillFolder(name, target) {
|
|
254
|
+
export function installSkillFolder(name, target, options = {}) {
|
|
225
255
|
const source = bundledSkillDir(name);
|
|
226
256
|
if (!existsSync(source)) {
|
|
227
257
|
throw new Error(`Bundled skill "${name}" not found at ${source}`);
|
|
228
258
|
}
|
|
229
259
|
const dest = skillFolderDest(name, target);
|
|
230
|
-
const
|
|
260
|
+
const present = existsSync(resolve(dest, "SKILL.md"));
|
|
261
|
+
if (present && !options.force && !isOurSkillFolder(dest)) {
|
|
262
|
+
return { target, installed: false, destPath: dest, refused: "foreign" };
|
|
263
|
+
}
|
|
264
|
+
const upToDate = present && skillTreeUpToDate(source, dest);
|
|
231
265
|
if (!upToDate) {
|
|
232
266
|
mkdirSync(dirname(dest), { recursive: true });
|
|
233
267
|
cpSync(source, dest, { recursive: true });
|
|
@@ -237,12 +271,17 @@ export function installSkillFolder(name, target) {
|
|
|
237
271
|
/**
|
|
238
272
|
* Refresh ALREADY-installed skill copies if the bundled copy has changed.
|
|
239
273
|
*
|
|
240
|
-
* Runs on every CLI invocation (cheap: one file compare per
|
|
241
|
-
* installs for an agent the user hasn't opted into — it
|
|
242
|
-
* that already exists, so a plain `npm update -g
|
|
243
|
-
* to get the latest
|
|
244
|
-
*
|
|
245
|
-
*
|
|
274
|
+
* Runs on every CLI invocation (cheap: one file compare per installed skill
|
|
275
|
+
* per target). It never installs for an agent the user hasn't opted into — it
|
|
276
|
+
* only updates a skill that already exists, so a plain `npm update -g
|
|
277
|
+
* @creator-notes/cnotes` is enough to get the latest skills for Claude, Codex
|
|
278
|
+
* and Cursor without re-running `cnotes init` or `cnotes skills install`.
|
|
279
|
+
* Every catalog skill is refreshed, not only the core one: the catalog copies
|
|
280
|
+
* used to be installed once and never again, so an agent could run a wayfind
|
|
281
|
+
* or attention-planner from months earlier that taught a rule the core had
|
|
282
|
+
* since reversed. A folder that is not ours (a third-party skill of the same
|
|
283
|
+
* name) is never touched. Best-effort: per-skill errors are swallowed so skill
|
|
284
|
+
* maintenance can never break a command.
|
|
246
285
|
*/
|
|
247
286
|
export function refreshInstalledSkills() {
|
|
248
287
|
const results = [];
|
|
@@ -257,6 +296,18 @@ export function refreshInstalledSkills() {
|
|
|
257
296
|
catch {
|
|
258
297
|
/* ignore this target — keep refreshing the others */
|
|
259
298
|
}
|
|
299
|
+
for (const skill of SKILL_CATALOG) {
|
|
300
|
+
if (skill.auto)
|
|
301
|
+
continue;
|
|
302
|
+
try {
|
|
303
|
+
if (installedSkillState(skill.name, target) === "stale") {
|
|
304
|
+
results.push(installSkillFolder(skill.name, target));
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
catch {
|
|
308
|
+
/* ignore this skill — keep refreshing the others */
|
|
309
|
+
}
|
|
310
|
+
}
|
|
260
311
|
}
|
|
261
312
|
return results;
|
|
262
313
|
}
|
package/dist/lib/quality.js
CHANGED
|
@@ -276,3 +276,46 @@ export function parseGradeSubmission(input) {
|
|
|
276
276
|
},
|
|
277
277
|
};
|
|
278
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* Parse the `--grades` / `--grades-file` array of `cnotes quality record`:
|
|
281
|
+
* `[{displayId, level, criteria, feedback?, nextStep?, gradedVersion?, gradedBy?}]`,
|
|
282
|
+
* `criteria` as the array itself. Each entry goes through the same checks as
|
|
283
|
+
* the single-note flags, and a bad entry comes back with its message so the
|
|
284
|
+
* command can record the rest and report that one.
|
|
285
|
+
*/
|
|
286
|
+
export function parseGradeBatch(raw) {
|
|
287
|
+
let parsed;
|
|
288
|
+
try {
|
|
289
|
+
parsed = JSON.parse(raw);
|
|
290
|
+
}
|
|
291
|
+
catch {
|
|
292
|
+
return { ok: false, message: "--grades must be a JSON array of grade objects." };
|
|
293
|
+
}
|
|
294
|
+
if (!Array.isArray(parsed) || parsed.length === 0) {
|
|
295
|
+
return { ok: false, message: "--grades needs at least one {displayId, level, criteria} object." };
|
|
296
|
+
}
|
|
297
|
+
if (parsed.length > 200) {
|
|
298
|
+
return { ok: false, message: "--grades accepts at most 200 grades per call." };
|
|
299
|
+
}
|
|
300
|
+
const entries = [];
|
|
301
|
+
parsed.forEach((item, i) => {
|
|
302
|
+
const rec = item && typeof item === "object" ? item : {};
|
|
303
|
+
const displayId = String(rec.displayId ?? "").trim();
|
|
304
|
+
if (!displayId) {
|
|
305
|
+
entries.push({ ok: false, displayId: `grades[${i}]`, message: "displayId is missing." });
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
const criteria = rec.criteria;
|
|
309
|
+
const one = parseGradeSubmission({
|
|
310
|
+
level: String(rec.level ?? ""),
|
|
311
|
+
criteria: typeof criteria === "string" ? criteria : JSON.stringify(criteria ?? null),
|
|
312
|
+
feedback: typeof rec.feedback === "string" ? rec.feedback : undefined,
|
|
313
|
+
nextStep: typeof rec.nextStep === "string" ? rec.nextStep : undefined,
|
|
314
|
+
suggestions: Array.isArray(rec.suggestions) ? rec.suggestions.map(String) : undefined,
|
|
315
|
+
gradedBy: typeof rec.gradedBy === "string" ? rec.gradedBy : undefined,
|
|
316
|
+
version: rec.gradedVersion !== undefined ? String(rec.gradedVersion) : undefined,
|
|
317
|
+
});
|
|
318
|
+
entries.push(one.ok ? { ok: true, displayId, value: one.value } : { ok: false, displayId, message: one.message });
|
|
319
|
+
});
|
|
320
|
+
return { ok: true, entries };
|
|
321
|
+
}
|
package/dist/mcp-server.js
CHANGED
|
@@ -501,7 +501,7 @@ const layoutDocArg = z
|
|
|
501
501
|
.object({
|
|
502
502
|
root: z
|
|
503
503
|
.unknown()
|
|
504
|
-
.describe("Root LayoutNode. kind is one of: 'stack' (items flow along one axis, like CSS flexbox: {kind:'stack', axis:'vertical'|'horizontal', gap?, align?:'start'|'center'|'end', items:[LayoutNode...]}), 'grid' (N columns, items wrap to new rows: {kind:'grid', columns:<n>, gap?, items:[...]}), 'anchor' (place a sub-tree relative to an EXISTING canvas node: {kind:'anchor', to:'<displayId or node id>', direction:'right'|'left'|'above'|'below' — exactly these four, NOT top/bottom/up/down, gap?, child:LayoutNode}), 'section' (a named frame that sizes itself around its content: {kind:'section', name:'<title>', key?, child:LayoutNode}), or 'item' (a leaf — one per visible thing, NO x/y: {kind:'item', type:'note'|'richtext'|'list'|'canvas'|'section', key?, ...type-specific fields}). gap accepts a preset 'tight'|'medium'|'spacious' or a raw pixel number (default 'medium')."),
|
|
504
|
+
.describe("Root LayoutNode. kind is one of: 'stack' (items flow along one axis, like CSS flexbox: {kind:'stack', axis:'vertical'|'horizontal', gap?, align?:'start'|'center'|'end', items:[LayoutNode...]}), 'grid' (N columns, items wrap to new rows: {kind:'grid', columns:<n>, gap?, items:[...]}), 'anchor' (place a sub-tree relative to an EXISTING canvas node: {kind:'anchor', to:'<displayId or node id>', direction:'right'|'left'|'above'|'below' — exactly these four, NOT top/bottom/up/down, gap?, child:LayoutNode}), 'section' (a named frame that sizes itself around its content: {kind:'section', name:'<title>', key?, child:LayoutNode}), or 'item' (a leaf — one per visible thing, NO x/y: {kind:'item', type:'note'|'richtext'|'list'|'canvas'|'quote'|'section', key?, ...type-specific fields}). gap accepts a preset 'tight'|'medium'|'spacious' or a raw pixel number (default 'medium')."),
|
|
505
505
|
edges: z
|
|
506
506
|
.array(z.unknown())
|
|
507
507
|
.optional()
|
|
@@ -615,7 +615,7 @@ server.tool("cnotes_canvas_add_node", "[Deprecated: use cnotes_canvas_place] Add
|
|
|
615
615
|
// node on the wire. The old `text` node kind (the "Heading") is LEGACY: existing ones
|
|
616
616
|
// still render / move / delete, but nothing creates them any more — a Text element with
|
|
617
617
|
// no background tint and `# Foo` inside IS a heading.
|
|
618
|
-
const TEXT_ELEMENT_CONTENT_DESC = "Text content as markdown (headings, emphasis, images all work — a heading is just `# Title`).
|
|
618
|
+
const TEXT_ELEMENT_CONTENT_DESC = "Text content as markdown (headings, emphasis, images all work — a heading is just `# Title`). Name a note with a mention ([NOTE-X: Title](relationship:verb), [[verb::NOTE-X]] or [[verb::NOTE-X|your words]]), which renders as a chip; a bare display id (\"see RISK-64\") is a defect. The chip is presentational, so a relationship that must survive off the canvas also lives in a note body. Keep it card-sized (≤ ~3 sentences): text elements are unversioned, unsearchable presentation furniture — knowledge worth keeping belongs in a typed note.";
|
|
619
619
|
const textElementSchema = {
|
|
620
620
|
canvasId: z.string().describe("Canvas ID"),
|
|
621
621
|
content: z.string().describe(TEXT_ELEMENT_CONTENT_DESC),
|
|
@@ -678,7 +678,7 @@ server.tool("cnotes_canvas_bulk_add", "LOW-LEVEL: add items at raw x/y that YOU
|
|
|
678
678
|
// `richtext` IS the Text element. There is no `text` item type any more:
|
|
679
679
|
// the legacy `text` node (the old "Heading") can no longer be created.
|
|
680
680
|
type: z.literal("richtext"),
|
|
681
|
-
content: z.string().describe("Markdown content — this is the Text element (headings, emphasis, images; a heading is just '# Title').
|
|
681
|
+
content: z.string().describe("Markdown content — this is the Text element (headings, emphasis, images; a heading is just '# Title'). Name notes with mentions ([NOTE-X: Title](relationship:verb) renders as a chip); a bare display id is a defect. Card-sized (≤ ~3 sentences); knowledge worth keeping goes in a note."),
|
|
682
682
|
x: z.number().describe("X position"),
|
|
683
683
|
y: z.number().describe("Y position"),
|
|
684
684
|
size: z.enum(["small", "medium", "large"]).optional().describe("Node size"),
|
|
@@ -686,7 +686,7 @@ server.tool("cnotes_canvas_bulk_add", "LOW-LEVEL: add items at raw x/y that YOU
|
|
|
686
686
|
}),
|
|
687
687
|
z.object({
|
|
688
688
|
type: z.literal("list"),
|
|
689
|
-
description: z.string().min(1).describe("One-line FRAME (markdown). Required. First paragraph derives the searchable title — this is the only label for list nodes. The CONTENT of a list is its member notes (noteIds), never the description: N distinct things = N typed notes grouped here.
|
|
689
|
+
description: z.string().min(1).describe("One-line FRAME (markdown). Required. First paragraph derives the searchable title — this is the only label for list nodes. The CONTENT of a list is its member notes (noteIds), never the description: N distinct things = N typed notes grouped here. A mention in it renders as a labelled span."),
|
|
690
690
|
x: z.number().describe("X position"),
|
|
691
691
|
y: z.number().describe("Y position"),
|
|
692
692
|
viewMode: z.enum(["list", "grid"]).optional(),
|
|
@@ -746,7 +746,7 @@ server.tool("cnotes_canvas_bulk_add", "LOW-LEVEL: add items at raw x/y that YOU
|
|
|
746
746
|
items: allItems,
|
|
747
747
|
}));
|
|
748
748
|
}));
|
|
749
|
-
server.tool("cnotes_canvas_place", "Place items on a canvas using a DECLARATIVE LAYOUT (no x/y math). The server measures every item, packs them with no overlaps, and inserts them in a single batch. PREFER THIS over cnotes_canvas_bulk_add whenever you can express the layout as stacks/grids/anchors — which is almost always. The agent should describe STRUCTURE (rows, columns, what's near what), not pixel coordinates.\n\nELEMENT CHOICE: default content to typed NOTES (the only versioned, searchable tier agents can read back); richtext = the Text element, card-sized framing only (a heading is just content '# Title', untinted), section = a named region frame, list = member notes behind a one-line frame, edges connect
|
|
749
|
+
server.tool("cnotes_canvas_place", "Place items on a canvas using a DECLARATIVE LAYOUT (no x/y math). The server measures every item, packs them with no overlaps, and inserts them in a single batch. PREFER THIS over cnotes_canvas_bulk_add whenever you can express the layout as stacks/grids/anchors — which is almost always. The agent should describe STRUCTURE (rows, columns, what's near what), not pixel coordinates.\n\nELEMENT CHOICE: default content to typed NOTES (the only versioned, searchable tier agents can read back); richtext = the Text element, card-sized framing only (a heading is just content '# Title', untinted), section = a named region frame, list = member notes behind a one-line frame, quote = a note's face, edges connect any two nodes on the canvas (dashed for what a card rests on).\n\nThe call is best-effort, NOT atomic: per-item failures are reported in the response (HTTP 207) but the items that succeeded stay on the canvas. Always inspect `items[].error` and `edges[].error` in the response.\n\nThe `doc` argument is a layout document:\n { root: <LayoutNode>, edges?: [{from, to, label?, lineStyle?: 'solid'|'dashed'}], origin?: {x, y} }\n\n<LayoutNode> is one of:\n • { kind: 'stack', axis: 'vertical'|'horizontal', gap?: 'tight'|'medium'|'spacious'|<px>, align?: 'start'|'center'|'end', items: [<LayoutNode>...] }\n • { kind: 'grid', columns: <n>, gap?: ..., items: [<LayoutNode>...] }\n • { kind: 'anchor', to: '<displayId or canvas node id>', direction: 'right'|'left'|'above'|'below', gap?: ..., child: <LayoutNode> }\n • { kind: 'item', type: 'note'|'richtext'|'list'|'canvas'|'quote'|'section', key?: '<name>', ...item-specific fields }\n\nLeaf item shapes (no x/y!):\n note: { kind:'item', type:'note', noteId:'NOTE-3', key?:'a' }\n richtext: { kind:'item', type:'richtext', content:'# Markdown OK', size?:'small'|'medium'|'large', colorHex?:'<role hex>' } // the Text element: card-sized framing only; a heading is just content '# Title' with no colorHex; colorHex is a ROLE tint (#3B82F6 evidence · #22C55E commitment · #EC4899 insight · #F59E0B warning · #EF4444 danger · #8B5CF6 people — anything else snaps to the nearest), default untinted; markdown, where [NOTE-X: Title](relationship:verb) renders as a mention chip (presentational: no graph edge, so the relationship also lives in a note body); knowledge worth keeping = a note\n list: { kind:'item', type:'list', description:'One-line frame — first paragraph becomes the title', noteIds?:['NOTE-1','NOTE-2'], viewMode?:'list'|'grid' } // description is REQUIRED and is a frame, never the content: N distinct things = N notes in noteIds\n canvas: { kind:'item', type:'canvas', linkedCanvasId:'<id>' }\n quote: { kind:'item', type:'quote', noteId:'DECISION-3' | '@a', text:'<exact words from its saved version>', style?:'pull'|'highlight'|'evidence', size?:'small'|'medium'|'large', colorHex?:'<role hex>', title?:'<why it matters>', key?:'f' } // a note's FACE: the Quote note (QUOTE-<n>) is made or reused and its card lands where this leaf sits, inside its frame; put it under the note it quotes\n\nEdges reference endpoints by, in priority order: `@<key>` (any item with a `key` placed in the same call), the original noteId/displayId of a note placed in this call (e.g. 'NOTE-7'), or the displayId / convex id of a node already on the canvas.\n\nNEW NOTES IN THE SAME CALL: pass `notes` (the cnotes_notes_create item shape) and place each with a note leaf whose noteId is '@<key>'. Bodies cross-link with [@<key>: Title](relationship:<verb>); edges and anchors say '@<key>'. One call replaces notes_create then place, inside the same run. The notes are created only if the layout solves, and come back under `notes`.\n\nExample (a SWOT-like quadrant):\n {\n root: {\n kind:'stack', axis:'vertical', gap:'spacious',\n items:[\n { kind:'stack', axis:'horizontal', gap:'spacious', items:[\n { kind:'grid', columns:2, items:[\n { kind:'item', type:'note', noteId:'STR-1' },\n { kind:'item', type:'note', noteId:'STR-2' },\n ]},\n { kind:'grid', columns:2, items:[\n { kind:'item', type:'note', noteId:'WEAK-1' },\n ]},\n ]},\n { kind:'stack', axis:'horizontal', gap:'spacious', items:[ /* opportunities + threats */ ]},\n ],\n },\n }", {
|
|
750
750
|
canvasId: z.string().describe("Canvas ID"),
|
|
751
751
|
doc: layoutDocArg,
|
|
752
752
|
intoSection: z
|
package/package.json
CHANGED
|
@@ -91,7 +91,9 @@ planned, never as a sweep.
|
|
|
91
91
|
intake pipeline wrote. A digest or canvas digest is orientation; open the
|
|
92
92
|
underlying notes before any consequential claim.
|
|
93
93
|
4. **Open the run.** `cnotes operations begin --prompt "Attention planner · <date> · intake"`.
|
|
94
|
-
|
|
94
|
+
If `begin` refuses with a conflict, another session holds the machine's
|
|
95
|
+
active-run slot: open yours with `--detached -q` and carry the id in
|
|
96
|
+
`CNOTES_AGENT_RUN_ID` (the cnotes skill's operations reference), or wait.
|
|
95
97
|
Hold the run only while writing.
|
|
96
98
|
5. **Do the agent-automatic work first.** Settle any `answered` card's
|
|
97
99
|
unfinished follow-through before anything new (loop 3). Then for each
|
|
@@ -27,9 +27,11 @@ unless the block moved.
|
|
|
27
27
|
|
|
28
28
|
## Apply the rubric
|
|
29
29
|
|
|
30
|
-
`types create` has no rubric flag, so apply it with `types update`.
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
`types create` has no rubric flag, so apply it with `types update`. Leave
|
|
31
|
+
`--enable-validation` off: it grades every save against the rubric (it never
|
|
32
|
+
blocks one), and a person's quick capture on a card should not be graded.
|
|
33
|
+
The rubric is the authoring spec agents read; grade the cards you write with
|
|
34
|
+
`cnotes quality`, as the cnotes skill says.
|
|
33
35
|
|
|
34
36
|
```bash
|
|
35
37
|
RUBRIC=$(cat <<'TXT'
|