notesoup 0.39.0 → 0.40.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/README.md +5 -2
- package/dist/src/boot/render.js +2 -2
- package/dist/src/boot/text.d.ts +0 -4
- package/dist/src/boot/text.js +9 -13
- package/dist/src/history/history.d.ts +23 -18
- package/dist/src/history/history.js +37 -20
- package/dist/src/history/query.d.ts +37 -49
- package/dist/src/history/query.js +114 -56
- package/dist/src/notes/store.d.ts +3 -4
- package/dist/src/notes/store.js +12 -16
- package/dist/src/pi/history-tools.d.ts +1 -1
- package/dist/src/pi/history-tools.js +2 -3
- package/dist/src/pi/runtime.js +1 -1
- package/dist/src/pi/tool-names.d.ts +0 -4
- package/dist/src/pi/tool-names.js +0 -4
- package/dist/src/tools/history.d.ts +24 -33
- package/dist/src/tools/history.js +57 -98
- package/dist/src/tools/notes.d.ts +26 -58
- package/dist/src/tools/notes.js +85 -103
- package/dist/src/tools/result.d.ts +16 -13
- package/dist/src/tools/result.js +24 -50
- package/dist/src/tools/schema.d.ts +2 -2
- package/dist/src/tools/schema.js +3 -3
- package/dist/test/agent-loop.test.js +1 -1
- package/dist/test/boot.integration.test.js +1 -1
- package/dist/test/claude-mod.test.js +4 -4
- package/dist/test/dependencies.test.js +1 -1
- package/dist/test/helpers/extension.js +2 -3
- package/dist/test/history.integration.test.js +200 -123
- package/dist/test/host-neutral.test.js +32 -58
- package/dist/test/notes-library.test.js +8 -8
- package/dist/test/notes.integration.test.js +75 -57
- package/dist/test/notes.test.js +44 -42
- package/docs/architecture.md +3 -3
- package/docs/notes-library.md +6 -6
- package/docs/tool-results.md +15 -25
- package/mods/notesoup/.claude-plugin/plugin.json +1 -1
- package/mods/notesoup/dist/claude/helper.js +119 -178
- package/mods/notesoup/hooks/register.ts +1 -2
- package/package.json +1 -1
- package/skills/memory/SKILL.md +6 -6
- package/src/boot/render.ts +2 -2
- package/src/boot/text.ts +9 -17
- package/src/history/history.ts +36 -20
- package/src/history/query.ts +130 -55
- package/src/notes/store.ts +15 -18
- package/src/pi/history-tools.ts +2 -3
- package/src/pi/runtime.ts +1 -1
- package/src/pi/tool-names.ts +0 -4
- package/src/tools/history.ts +61 -100
- package/src/tools/notes.ts +84 -97
- package/src/tools/result.ts +24 -49
- package/src/tools/schema.ts +3 -3
|
@@ -46,7 +46,7 @@ test("custom reset marker removes old provider context while history remains sea
|
|
|
46
46
|
assert.ok(oldSeq);
|
|
47
47
|
const read = resultRead(await call(captured, "history_read", { seq: oldSeq }, ctx));
|
|
48
48
|
assert.match(read.content, /OLD-UNIQUE-TRANSCRIPT/);
|
|
49
|
-
const found = resultData(await call(captured, "
|
|
49
|
+
const found = resultData(await call(captured, "history_list", { query: "needle" }, ctx));
|
|
50
50
|
assert.equal(found.items.length, 1);
|
|
51
51
|
assert.equal(found.items[0]?.seq, oldSeq);
|
|
52
52
|
});
|
|
@@ -81,8 +81,8 @@ test("Claude helper refuses schema-invalid parameters before any operation runs"
|
|
|
81
81
|
const cases = [
|
|
82
82
|
{ name: "a string offset", params: { address, offset_chars: "0" } },
|
|
83
83
|
{ name: "a fractional offset", params: { address, offset_chars: 0.5 } },
|
|
84
|
-
{ name: "a zero limit", params: { address,
|
|
85
|
-
{ name: "a limit past the maximum", params: { address,
|
|
84
|
+
{ name: "a zero limit", params: { address, max_chars: 0 } },
|
|
85
|
+
{ name: "a limit past the maximum", params: { address, max_chars: 999_999_999 } },
|
|
86
86
|
];
|
|
87
87
|
for (const { name, params } of cases) {
|
|
88
88
|
const refused = JSON.parse(await handleLine(JSON.stringify({ op: "tool", tool: "notes_read", identity, params })));
|
|
@@ -95,14 +95,14 @@ test("Claude helper refuses schema-invalid parameters before any operation runs"
|
|
|
95
95
|
const absent = await callTool("notes_read", { address: "rejected.md" });
|
|
96
96
|
assert.equal(absent.outcome.ok, false);
|
|
97
97
|
assert.equal(absent.outcome.error?.code, "not_found", "the refused write never reached the store");
|
|
98
|
-
const valid = await callTool("notes_read", { address, offset_chars: 0,
|
|
98
|
+
const valid = await callTool("notes_read", { address, offset_chars: 0, max_chars: 8 });
|
|
99
99
|
assert.equal(valid.outcome.ok, true, "a schema-valid window still reads");
|
|
100
100
|
assert.match(valid.text, /^boundary\.md/);
|
|
101
101
|
});
|
|
102
102
|
test("Claude helper boot uses actual Claude note tool bindings and a fresh snapshot", async () => {
|
|
103
103
|
const boot = await dispatch({ op: "boot", identity, openedAt: 1700000000000, tools: {
|
|
104
104
|
notes: "mcp__notesoup__notes_*", notesList: "mcp__notesoup__notes_list",
|
|
105
|
-
history: "history unavailable",
|
|
105
|
+
history: "history unavailable",
|
|
106
106
|
remaining: "remaining unavailable", wipe: "wipe unavailable",
|
|
107
107
|
} });
|
|
108
108
|
assert.match(boot, /mcp__notesoup__notes_\*/);
|
|
@@ -93,7 +93,7 @@ test("configured extension source and moved dream CLI are executable current ent
|
|
|
93
93
|
registerTool(tool) { tools.push(tool); },
|
|
94
94
|
registerCommand(name) { commands.push(name); },
|
|
95
95
|
});
|
|
96
|
-
assert.deepEqual(tools.map((tool) => tool.name).sort(), ["clear_memory", "get_context_remaining", "history_list", "history_read", "
|
|
96
|
+
assert.deepEqual(tools.map((tool) => tool.name).sort(), ["clear_memory", "get_context_remaining", "history_list", "history_read", "history_windows", "notes_list", "notes_read", "notes_search", "notes_update", "notes_write"]);
|
|
97
97
|
assert.deepEqual(commands.sort(), ["clear-memory", "cm", "notesoup"]);
|
|
98
98
|
const help = execFileSync(process.execPath, [resolve(root, manifest.bin.dream), "--help"], { cwd: root, encoding: "utf8" });
|
|
99
99
|
assert.ok(help.startsWith("dream doctor [--notes-home <dir>]"));
|
|
@@ -210,8 +210,7 @@ function isTextWindow(value) {
|
|
|
210
210
|
if (typeof value !== "object" || value === null)
|
|
211
211
|
return false;
|
|
212
212
|
const candidate = value;
|
|
213
|
-
return typeof candidate.text === "string" && typeof candidate.
|
|
214
|
-
typeof candidate.total_chars === "number" &&
|
|
213
|
+
return typeof candidate.text === "string" && typeof candidate.total_chars === "number" &&
|
|
215
214
|
(candidate.next_offset_chars === null || typeof candidate.next_offset_chars === "number");
|
|
216
215
|
}
|
|
217
216
|
/** Data of a successful outcome, asserting both the structured success and the non-error result. */
|
|
@@ -225,7 +224,7 @@ export function resultData(result) {
|
|
|
225
224
|
export function resultError(result) {
|
|
226
225
|
const outcome = outcomeOf(result);
|
|
227
226
|
assert.equal(result.isError, true, "a refusal is delivered as an error result");
|
|
228
|
-
const error = { code: outcome.code, message: outcome.error
|
|
227
|
+
const error = { code: outcome.code, message: outcome.error };
|
|
229
228
|
assert.ok(isOperationError(error), "refusal carries a code and an error message");
|
|
230
229
|
return error;
|
|
231
230
|
}
|