@creator-notes/cnotes 0.126.1 → 0.127.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/dist/commands/search.js
CHANGED
|
@@ -2,6 +2,31 @@ import { ApiClient } from "../lib/api-client.js";
|
|
|
2
2
|
import { resolveConfig } from "../lib/config.js";
|
|
3
3
|
import { handleError } from "../lib/errors.js";
|
|
4
4
|
import { outputJson, outputTable, truncate } from "../lib/output.js";
|
|
5
|
+
/**
|
|
6
|
+
* What the workspace does not hold, said before the results so an agent reads
|
|
7
|
+
* it first: search always returns its nearest notes, and without this line the
|
|
8
|
+
* best of them reads as an answer. Nothing is printed when every word is held
|
|
9
|
+
* in one note.
|
|
10
|
+
*/
|
|
11
|
+
export function coverageLines(coverage) {
|
|
12
|
+
if (!coverage?.verdict || coverage.verdict === "covered")
|
|
13
|
+
return [];
|
|
14
|
+
const lines = [];
|
|
15
|
+
const missing = (coverage.missing ?? []).join(", ");
|
|
16
|
+
if (coverage.verdict === "absent") {
|
|
17
|
+
lines.push(`Not in the workspace: ${missing} (no note holds any of these words)`);
|
|
18
|
+
}
|
|
19
|
+
else if (coverage.verdict === "partial") {
|
|
20
|
+
lines.push(`Not in the workspace: ${missing}`);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
lines.push("Each word is in some note, but no one note holds them all: read before combining.");
|
|
24
|
+
}
|
|
25
|
+
if (coverage.foundByMeaning) {
|
|
26
|
+
lines.push("Some notes below match by meaning alone and may say it in other words.");
|
|
27
|
+
}
|
|
28
|
+
return lines;
|
|
29
|
+
}
|
|
5
30
|
function renderNotesSection(section) {
|
|
6
31
|
const ranking = section.error ? `error — ${section.error}` : section.ranking ?? "";
|
|
7
32
|
console.log(`NOTES (${ranking})`);
|
|
@@ -81,6 +106,12 @@ export function registerSearchCommands(program) {
|
|
|
81
106
|
.option("--canvas <canvasId>", "Scope the NOTES section to notes on a canvas")
|
|
82
107
|
.addHelpText("after", `
|
|
83
108
|
Returns labeled sections — NOTES, CANVASES, IMAGES — each ranked in its own scorer (not fused).
|
|
109
|
+
Search always returns its nearest notes, so a first line says what the workspace does NOT hold:
|
|
110
|
+
Not in the workspace: refund, policy no live note holds these words; say so, don't guess
|
|
111
|
+
...no one note holds them all every word exists, but in different notes
|
|
112
|
+
...match by meaning alone a note may say a missing word differently; read it
|
|
113
|
+
No line means one note holds every word. --json carries it as \`coverage\` (verdict
|
|
114
|
+
covered | scattered | partial | absent, with \`missing\` and \`foundByMeaning\`).
|
|
84
115
|
--type all (default) all sections
|
|
85
116
|
--type Canvas canvases only (reserved corpus)
|
|
86
117
|
--type Image images only (semantic over vision captions/OCR; IMAGE-n ids)
|
|
@@ -122,6 +153,11 @@ For a single corpus you can still call the focused commands directly:
|
|
|
122
153
|
const canvases = data.sections?.canvases;
|
|
123
154
|
const images = data.sections?.images;
|
|
124
155
|
let printedAny = false;
|
|
156
|
+
const said = coverageLines(data.coverage);
|
|
157
|
+
for (const line of said)
|
|
158
|
+
console.log(line);
|
|
159
|
+
if (said.length > 0)
|
|
160
|
+
console.log("");
|
|
125
161
|
if (notes) {
|
|
126
162
|
renderNotesSection(notes);
|
|
127
163
|
printedAny = true;
|
package/dist/mcp-server.js
CHANGED
|
@@ -346,7 +346,7 @@ server.tool("cnotes_notes_retype", "Change a single note's type. Atomic operatio
|
|
|
346
346
|
// ---------------------------------------------------------------------------
|
|
347
347
|
// Search tools
|
|
348
348
|
// ---------------------------------------------------------------------------
|
|
349
|
-
server.tool("cnotes_search", "Unified search across NOTES and CANVASES in one call — returns two separately-ranked sections (notes, canvases), so you never miss a canvas by searching only notes. Default (type omitted or 'all') returns both; set type to 'Canvas' for canvases only, or a note supertag (e.g. 'Decision') for notes of that type. Prefer this when you don't already know whether the answer is a note or a canvas.", {
|
|
349
|
+
server.tool("cnotes_search", "Unified search across NOTES and CANVASES in one call — returns two separately-ranked sections (notes, canvases), so you never miss a canvas by searching only notes. Default (type omitted or 'all') returns both; set type to 'Canvas' for canvases only, or a note supertag (e.g. 'Decision') for notes of that type. Prefer this when you don't already know whether the answer is a note or a canvas. Results are always the nearest matches, so `coverage` says whether the workspace holds what you asked: on `partial` or `absent`, tell the user the `missing` words are not in the workspace instead of answering them from the nearest result; on `scattered`, read before combining; `foundByMeaning` means a result may say a missing word differently.", {
|
|
350
350
|
query: z.string().describe("Search query"),
|
|
351
351
|
type: z.string().optional().describe("Scope: omit or 'all' for both, 'Canvas' for canvases only, or a note supertag (e.g. 'Decision') for notes of that type"),
|
|
352
352
|
limit: z.number().optional().default(10).describe("Max results per section"),
|
package/package.json
CHANGED
package/skills/cnotes/SKILL.md
CHANGED
|
@@ -17,7 +17,7 @@ Every note and canvas you write is context: what the next reader, a teammate or
|
|
|
17
17
|
|
|
18
18
|
Each call costs the user a model round trip, so batch, and send independent calls together. Reads need no run.
|
|
19
19
|
|
|
20
|
-
1. **Read, in parallel.** `cnotes workspace current` names the workspace and its relationship types (`-w <id>` targets another for one command). `cnotes brief "<task>"` returns the notes, canvases and recent changes most relevant to the task, with what earlier runs made of each (`lesson:` under a note; `Start here` lists the notes runs keep finding useful): read a correction before relying on the note it sits on. `cnotes search "<topic>"` finds notes, canvases and images in one call. `cnotes notes get <id> --expand` loads a note with the notes it rests on. Before changing a canvas, `cnotes canvas read <canvasId>` (or `read-section SECTION-n` when the request names a frame). `cnotes types show <Type>` for each type you will write: author to its rubric. A Decision or Guide you find may already settle what you were about to propose.
|
|
20
|
+
1. **Read, in parallel.** `cnotes workspace current` names the workspace and its relationship types (`-w <id>` targets another for one command). `cnotes brief "<task>"` returns the notes, canvases and recent changes most relevant to the task, with what earlier runs made of each (`lesson:` under a note; `Start here` lists the notes runs keep finding useful): read a correction before relying on the note it sits on. `cnotes search "<topic>"` finds notes, canvases and images in one call; a first line `Not in the workspace: …` names words no note holds, so say that rather than answer from the nearest note. `cnotes notes get <id> --expand` loads a note with the notes it rests on. Before changing a canvas, `cnotes canvas read <canvasId>` (or `read-section SECTION-n` when the request names a frame). `cnotes types show <Type>` for each type you will write: author to its rubric. A Decision or Guide you find may already settle what you were about to propose.
|
|
21
21
|
2. **Name the kind of request.** [references/situations.md](references/situations.md) sorts it into one of 13 rows by what the person will do with the result, and each row says what to write, how to lay it out and how to check it. The first row is no board: most requests want the work done or a plain answer, and at most one note.
|
|
22
22
|
3. **Write once, with `--intent`.** `--intent "<headline>"` opens an agent run for that one command and closes it after, so the change lands on the timeline as one revertable run; a removal gets a before snapshot. When a run is already open, the write joins it. To add cards, create and place them together:
|
|
23
23
|
```json
|