notesoup 0.61.0 → 0.63.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/.agents/plugins/marketplace.json +15 -0
- package/README.md +14 -11
- package/dist/plugins/antigravity/src/cli.d.ts +1 -0
- package/dist/plugins/antigravity/src/cli.js +23 -0
- package/dist/plugins/antigravity/src/hooks.d.ts +18 -0
- package/dist/plugins/antigravity/src/hooks.js +53 -0
- package/dist/plugins/antigravity/src/identity.d.ts +26 -0
- package/dist/plugins/antigravity/src/identity.js +129 -0
- package/dist/plugins/claude/src/helper.js +24 -5
- package/dist/plugins/claude/src/text.d.ts +7 -0
- package/dist/plugins/claude/src/text.js +12 -1
- package/dist/plugins/codex/src/hooks.js +1 -0
- package/dist/plugins/codex/src/identity.d.ts +6 -1
- package/dist/plugins/codex/src/identity.js +13 -1
- package/dist/plugins/codex/src/mcp.d.ts +35 -7
- package/dist/plugins/codex/src/mcp.js +26 -88
- package/dist/plugins/codex/src/text.js +3 -3
- package/dist/plugins/dsh/tools.js +8 -4
- package/dist/plugins/mcp/operations.d.ts +15 -0
- package/dist/plugins/mcp/operations.js +43 -0
- package/dist/plugins/mcp/server.d.ts +14 -0
- package/dist/plugins/mcp/server.js +13 -0
- package/dist/plugins/pi/budget.d.ts +4 -1
- package/dist/plugins/pi/budget.js +35 -8
- package/dist/plugins/pi/entries.d.ts +2 -0
- package/dist/plugins/pi/entries.js +2 -0
- package/dist/plugins/pi/history-tools.js +2 -1
- package/dist/plugins/pi/history.js +18 -1
- package/dist/plugins/pi/notes/tools.js +7 -3
- package/dist/plugins/pi/render.d.ts +7 -1
- package/dist/plugins/pi/render.js +2 -2
- package/dist/plugins/pi/reset/artifacts.d.ts +1 -1
- package/dist/plugins/pi/reset/artifacts.js +4 -4
- package/dist/plugins/pi/reset/lifecycle.d.ts +9 -2
- package/dist/plugins/pi/reset/lifecycle.js +109 -31
- package/dist/plugins/pi/runtime.js +104 -63
- package/dist/plugins/pi/tool-result.js +7 -7
- package/dist/plugins/pi/window.d.ts +25 -3
- package/dist/plugins/pi/window.js +219 -9
- package/dist/src/boot/render.js +18 -15
- package/dist/src/boot/text.d.ts +3 -1
- package/dist/src/boot/text.js +22 -20
- package/dist/src/budget/text.d.ts +7 -3
- package/dist/src/budget/text.js +24 -15
- package/dist/src/history/claude.d.ts +2 -0
- package/dist/src/history/claude.js +46 -0
- package/dist/src/history/codex-transcript.js +7 -5
- package/dist/src/history/codex.js +3 -0
- package/dist/src/history/corpus.d.ts +28 -1
- package/dist/src/history/corpus.js +40 -0
- package/dist/src/history/history.d.ts +37 -46
- package/dist/src/history/history.js +21 -40
- package/dist/src/history/local.js +67 -32
- package/dist/src/history/pi.d.ts +2 -1
- package/dist/src/history/pi.js +122 -48
- package/dist/src/history/prefilter.js +76 -19
- package/dist/src/history/query.d.ts +28 -49
- package/dist/src/history/query.js +83 -68
- package/dist/src/history/summary-cache.d.ts +8 -1
- package/dist/src/history/summary-cache.js +138 -12
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +1 -1
- package/dist/src/notes/errors.d.ts +1 -1
- package/dist/src/notes/frontmatter.d.ts +0 -2
- package/dist/src/notes/frontmatter.js +0 -2
- package/dist/src/notes/index.d.ts +1 -1
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/policy.d.ts +15 -1
- package/dist/src/notes/policy.js +46 -5
- package/dist/src/notes/store.d.ts +12 -0
- package/dist/src/notes/store.js +16 -20
- package/dist/src/text-match.d.ts +10 -1
- package/dist/src/text-match.js +42 -3
- package/dist/src/tools/dream.d.ts +22 -93
- package/dist/src/tools/dream.js +30 -27
- package/dist/src/tools/history.d.ts +33 -26
- package/dist/src/tools/history.js +257 -163
- package/dist/src/tools/notes.d.ts +51 -163
- package/dist/src/tools/notes.js +146 -100
- package/dist/src/tools/output.d.ts +2 -1
- package/dist/src/tools/output.js +2 -1
- package/dist/src/tools/result.d.ts +4 -7
- package/dist/src/tools/result.js +8 -9
- package/dist/src/tools/schema.d.ts +4 -1
- package/dist/src/tools/schema.js +25 -1
- package/dist/test/agent-loop.test.js +394 -56
- package/dist/test/antigravity-live.test.d.ts +1 -0
- package/dist/test/antigravity-live.test.js +142 -0
- package/dist/test/antigravity-plugin.test.d.ts +1 -0
- package/dist/test/antigravity-plugin.test.js +101 -0
- package/dist/test/boot.integration.test.js +156 -15
- package/dist/test/budget-settings.integration.test.js +4 -4
- package/dist/test/claude-history.test.js +14 -13
- package/dist/test/claude-mod.test.js +199 -16
- package/dist/test/claude-validation.test.js +69 -2
- package/dist/test/codex-history.test.js +15 -3
- package/dist/test/codex-plugin.test.js +76 -38
- package/dist/test/dependencies.test.js +7 -3
- package/dist/test/dream-skill.test.js +3 -3
- package/dist/test/dream-tools.test.js +101 -56
- package/dist/test/dsh.test.js +34 -19
- package/dist/test/helpers/dependency-graph.js +2 -2
- package/dist/test/helpers/extension.d.ts +68 -3
- package/dist/test/helpers/extension.js +74 -5
- package/dist/test/history-corpus.test.js +79 -77
- package/dist/test/history-summary-cache.test.js +97 -9
- package/dist/test/history.integration.test.js +234 -168
- package/dist/test/host-neutral.test.js +69 -19
- package/dist/test/marker.test.js +1 -1
- package/dist/test/model-facing-text.test.js +13 -3
- package/dist/test/note-policy.test.js +96 -77
- package/dist/test/notes.integration.test.js +212 -94
- package/dist/test/notes.test.js +184 -113
- package/dist/test/pi-render.test.js +20 -12
- package/dist/test/project-namespace.test.js +3 -2
- package/dist/test/reset-lifecycle.test.js +12 -2
- package/docs/antigravity.md +44 -0
- package/docs/architecture.md +6 -4
- package/docs/claude-code-mod.md +7 -7
- package/docs/codex.md +36 -38
- package/docs/dsh.md +3 -3
- package/docs/history-sessions.md +28 -50
- package/docs/notes-library.md +4 -4
- package/docs/reset-lifecycle.md +1 -1
- package/docs/skills.md +3 -3
- package/docs/tool-results.md +47 -28
- package/package.json +3 -2
- package/playbook.md +1 -1
- package/plugins/antigravity/dist/antigravity/notesoup.js +26886 -0
- package/plugins/antigravity/hooks.json +7 -0
- package/plugins/antigravity/mcp_config.json +8 -0
- package/plugins/antigravity/plugin.json +6 -0
- package/plugins/antigravity/src/cli.ts +22 -0
- package/plugins/antigravity/src/hooks.ts +51 -0
- package/plugins/antigravity/src/identity.ts +127 -0
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/dist/claude/helper.js +1108 -539
- package/plugins/claude/hooks/register.ts +202 -62
- package/plugins/claude/playbook.md +1 -1
- package/plugins/claude/skills/dream/SKILL.md +1 -1
- package/plugins/claude/skills/notesoup-guide/SKILL.md +92 -0
- package/plugins/claude/src/helper.ts +24 -5
- package/plugins/claude/src/text.ts +14 -1
- package/plugins/codex/.codex-plugin/plugin.json +8 -0
- package/plugins/codex/.mcp.json +11 -0
- package/plugins/codex/README.md +5 -21
- package/plugins/codex/dist/codex/notesoup.js +18480 -17946
- package/plugins/codex/src/hooks.ts +1 -0
- package/plugins/codex/src/identity.ts +14 -1
- package/plugins/codex/src/mcp.ts +28 -98
- package/plugins/codex/src/text.ts +3 -3
- package/plugins/dsh/tools.ts +8 -4
- package/plugins/mcp/operations.ts +50 -0
- package/plugins/mcp/server.ts +23 -0
- package/plugins/paseo/README.md +5 -10
- package/plugins/paseo/client/brain-empty-card.tsx +3 -3
- package/plugins/paseo/client/markdown.tsx +50 -38
- package/plugins/paseo/client/notes-op-card.tsx +12 -9
- package/plugins/paseo/client/paper-card.tsx +6 -5
- package/plugins/paseo/client/paper-palette.ts +2 -9
- package/plugins/paseo/client/sticky-card.tsx +2 -2
- package/plugins/paseo/client/tool-result.ts +7 -14
- package/plugins/paseo/package-lock.json +3406 -0
- package/plugins/paseo/package.json +1 -0
- package/plugins/paseo/test/markdown-core.test.ts +73 -66
- package/plugins/pi/budget.ts +31 -8
- package/plugins/pi/entries.ts +2 -0
- package/plugins/pi/history-tools.ts +2 -1
- package/plugins/pi/history.ts +30 -1
- package/plugins/pi/notes/tools.ts +7 -3
- package/plugins/pi/render.ts +6 -6
- package/plugins/pi/reset/artifacts.ts +4 -3
- package/plugins/pi/reset/lifecycle.ts +125 -32
- package/plugins/pi/runtime.ts +98 -62
- package/plugins/pi/tool-result.ts +8 -8
- package/plugins/pi/window.ts +210 -10
- package/skills/dream/SKILL.md +1 -1
- package/skills/notesoup-guide/SKILL.md +92 -0
- package/src/boot/render.ts +18 -15
- package/src/boot/text.ts +23 -19
- package/src/budget/text.ts +27 -15
- package/src/history/claude.ts +41 -0
- package/src/history/codex-transcript.ts +6 -4
- package/src/history/codex.ts +2 -0
- package/src/history/corpus.ts +51 -2
- package/src/history/history.ts +35 -44
- package/src/history/local.ts +67 -27
- package/src/history/pi.ts +113 -35
- package/src/history/prefilter.ts +73 -15
- package/src/history/query.ts +93 -73
- package/src/history/summary-cache.ts +142 -17
- package/src/index.ts +2 -2
- package/src/notes/errors.ts +1 -1
- package/src/notes/frontmatter.ts +0 -3
- package/src/notes/index.ts +1 -1
- package/src/notes/policy.ts +44 -5
- package/src/notes/store.ts +17 -20
- package/src/text-match.ts +46 -4
- package/src/tools/dream.ts +29 -31
- package/src/tools/history.ts +249 -142
- package/src/tools/notes.ts +145 -113
- package/src/tools/output.ts +2 -1
- package/src/tools/result.ts +12 -11
- package/src/tools/schema.ts +24 -1
- package/plugins/claude/skills/memory/SKILL.md +0 -69
- package/plugins/codex/mcp.json +0 -10
- package/plugins/codex/plugin.json +0 -6
- package/plugins/paseo/client/markdown-core.tsx +0 -189
- package/plugins/paseo/client/typography.ts +0 -24
- package/skills/memory/SKILL.md +0 -69
|
@@ -7,9 +7,11 @@ import { dirname, join } from "node:path";
|
|
|
7
7
|
import { test } from "node:test";
|
|
8
8
|
import { zstdCompressSync } from "node:zlib";
|
|
9
9
|
import { localHistoryCorpus } from "../src/history/local.js";
|
|
10
|
-
import {
|
|
10
|
+
import { piHistoryFromFile, piHistoryFromJsonl } from "../src/history/pi.js";
|
|
11
|
+
import { offlineClaudeHistoryFromFile, offlineClaudeHistoryFromJsonl } from "../src/history/claude.js";
|
|
12
|
+
import { cachedSessionRepresentative, HISTORY_SUMMARY_CACHE_TTL_MS, historySummaryCacheRoot, pruneHistorySummaryCache } from "../src/history/summary-cache.js";
|
|
11
13
|
import { projectHistory } from "../src/history/history.js";
|
|
12
|
-
import { historyList, historyRead } from "../src/tools/history.js";
|
|
14
|
+
import { historyList, historySearch, historyRead } from "../src/tools/history.js";
|
|
13
15
|
const AT = "2026-10-06T01:02:03.000Z";
|
|
14
16
|
const ROOT = "019a0000-0000-7000-8000-000000000001";
|
|
15
17
|
const CHILD = "019a0000-0000-7000-8000-000000000002";
|
|
@@ -129,25 +131,63 @@ test("append, equal-size rewrite with restored mtime, and atomic replacement inv
|
|
|
129
131
|
assert.equal(replaced.items[0].content, "third");
|
|
130
132
|
assert.equal(reads.length, 5);
|
|
131
133
|
});
|
|
132
|
-
test("
|
|
134
|
+
test("roles and disjoint/contained time windows reuse the summary while partial overlaps, overlapping searches and explicit sessions decode strictly", async (t) => {
|
|
133
135
|
const f = await fixture(t);
|
|
134
136
|
await f.put(f.piPath, piText("opening", [{ type: "message", id: "a", parentId: "u", timestamp: "2026-10-07T00:00:00Z", message: { role: "assistant", content: "later" } }]));
|
|
135
137
|
const reads = transcriptReads(t, [f.piPath]);
|
|
136
138
|
const ctx = f.context();
|
|
139
|
+
const plain = {
|
|
140
|
+
current: () => projection("live"),
|
|
141
|
+
corpus: {
|
|
142
|
+
currentHarness: "dsh",
|
|
143
|
+
sessions: async (harness) => (await f.corpus().sessions(harness)).map(({ loadRepresentative: _r, loadSummary: _s, peekSummary: _p, ...session }) => session),
|
|
144
|
+
},
|
|
145
|
+
};
|
|
137
146
|
await historyList.execute({ session: "pi:*" }, ctx);
|
|
138
|
-
for (const query of ["", [], ["", ""]])
|
|
139
|
-
await historyList.execute({ session: "pi:*", query }, ctx);
|
|
140
147
|
assert.equal(reads.length, 1);
|
|
141
|
-
|
|
148
|
+
// Cache-satisfied filters: roles-only, strictly contained window, and disjoint windows (overview & query).
|
|
149
|
+
for (const filters of [
|
|
150
|
+
{ roles: ["assistant"] },
|
|
151
|
+
{ roles: ["user", "assistant"] },
|
|
152
|
+
{ roles: ["tool"] },
|
|
153
|
+
{ since: "2026-10-05", until: "2026-10-08" },
|
|
154
|
+
{ since: "2026-10-05", roles: ["assistant"] },
|
|
155
|
+
{ until: AT },
|
|
156
|
+
{ since: "2026-10-07T00:00:00Z" },
|
|
157
|
+
]) {
|
|
158
|
+
const before = reads.length;
|
|
159
|
+
const params = { session: "pi:*", ...filters };
|
|
160
|
+
const result = await historyList.execute(params, ctx);
|
|
161
|
+
assert.equal(reads.length, before, `expected cache hit for ${JSON.stringify(params)}`);
|
|
162
|
+
assert.deepEqual(result, await historyList.execute(params, plain));
|
|
163
|
+
}
|
|
164
|
+
for (const filters of [
|
|
165
|
+
{ query: "later", until: AT },
|
|
166
|
+
{ query: "later", since: "2026-10-07T00:00:00Z" },
|
|
167
|
+
]) {
|
|
168
|
+
const before = reads.length;
|
|
169
|
+
const params = { session: "pi:*", ...filters };
|
|
170
|
+
const result = await historySearch.execute(params, ctx);
|
|
171
|
+
assert.equal(reads.length, before, `expected cache hit for ${JSON.stringify(params)}`);
|
|
172
|
+
assert.deepEqual(result, await historySearch.execute(params, plain));
|
|
173
|
+
}
|
|
174
|
+
// Strict fallback filters: partial time overlaps, overlapping query, and explicit single-session reads.
|
|
175
|
+
for (const filters of [{ since: AT }, { until: "2026-10-07" }, { session: "pi:offline" }]) {
|
|
142
176
|
const before = reads.length;
|
|
143
177
|
const params = { session: "pi:*", ...filters };
|
|
144
178
|
const result = await historyList.execute(params, ctx);
|
|
145
179
|
assert.ok(reads.length > before, JSON.stringify(params));
|
|
146
|
-
const plain = { current: () => projection("live"), corpus: { currentHarness: "dsh", sessions: async (harness) => (await f.corpus().sessions(harness)).map(({ loadRepresentative: _cache, ...session }) => session) } };
|
|
147
180
|
assert.deepEqual(result, await historyList.execute(params, plain));
|
|
148
181
|
}
|
|
149
|
-
|
|
150
|
-
|
|
182
|
+
{
|
|
183
|
+
const before = reads.length;
|
|
184
|
+
const params = { session: "pi:*", query: "later" };
|
|
185
|
+
const result = await historySearch.execute(params, ctx);
|
|
186
|
+
assert.ok(reads.length > before, JSON.stringify(params));
|
|
187
|
+
assert.deepEqual(result, await historySearch.execute(params, plain));
|
|
188
|
+
}
|
|
189
|
+
assert.equal(data(await historyList.execute({ session: "pi:*", since: AT }, ctx)).items.length, 1);
|
|
190
|
+
assert.equal(data(await historyList.execute({ session: "pi:*", until: AT }, ctx)).items.length, 0, "before is exclusive");
|
|
151
191
|
});
|
|
152
192
|
test("corrupt cache/schema and unwritable roots fall back; a warm cache cannot hide malformed or unsupported transcripts", async (t) => {
|
|
153
193
|
const f = await fixture(t);
|
|
@@ -295,3 +335,51 @@ test("Codex cache fingerprints actual archived compressed ancestors and revalida
|
|
|
295
335
|
await fs.unlink(ancestorPath);
|
|
296
336
|
assert.equal(data(await historyList.execute(params, f.context())).items.length, 0);
|
|
297
337
|
});
|
|
338
|
+
test("cold partial-overlap overview reads each transcript once and populates the summary cache", async (t) => {
|
|
339
|
+
const f = await fixture(t);
|
|
340
|
+
await f.put(f.piPath, piText("opening", [{ type: "message", id: "a", parentId: "u", timestamp: "2026-10-07T00:00:00Z", message: { role: "assistant", content: "later" } }]));
|
|
341
|
+
const reads = transcriptReads(t, [f.piPath]);
|
|
342
|
+
const result = data(await historyList.execute({ session: "pi:*", since: AT }, f.context()));
|
|
343
|
+
assert.equal(result.items.length, 1);
|
|
344
|
+
assert.equal(result.items[0].content, "later");
|
|
345
|
+
assert.equal(reads.length, 1, "cold partial overlap must reuse the projection from summary load instead of decoding twice");
|
|
346
|
+
assert.equal(data(await historyList.execute({ session: "pi:*" }, f.context())).items[0].content, "opening");
|
|
347
|
+
assert.equal(reads.length, 1, "cold partial overlap also populated the summary cache");
|
|
348
|
+
});
|
|
349
|
+
test("streaming Pi and Claude file decoders match in-memory JSONL decoding", async (t) => {
|
|
350
|
+
const f = await fixture(t);
|
|
351
|
+
const piBody = piText("opening", [
|
|
352
|
+
{ type: "message", id: "a", parentId: "u", timestamp: "2026-10-07T00:00:00Z", message: { role: "assistant", content: [{ type: "thinking", thinking: "ignored" }, { type: "text", text: "visible" }] } },
|
|
353
|
+
]) + '{"unterminated":';
|
|
354
|
+
await f.put(f.piPath, piBody);
|
|
355
|
+
assert.deepEqual(await piHistoryFromFile(f.piPath, "offline", 100 * 1024 * 1024), piHistoryFromJsonl(piBody, "offline"));
|
|
356
|
+
const claudePath = join(f.roots.claude, "workspace", "offline-claude.jsonl");
|
|
357
|
+
const claudeBody = jsonl([
|
|
358
|
+
{ type: "user", uuid: "u1", parentUuid: null, sessionId: "offline-claude", timestamp: AT, message: { role: "user", content: "hello" } },
|
|
359
|
+
{ type: "assistant", uuid: "a1", parentUuid: "u1", sessionId: "offline-claude", timestamp: "2026-10-07T00:00:00Z", message: { role: "assistant", content: [{ type: "text", text: "world" }] } },
|
|
360
|
+
]) + '{"partial":';
|
|
361
|
+
await f.put(claudePath, claudeBody);
|
|
362
|
+
assert.deepEqual(await offlineClaudeHistoryFromFile(claudePath, "offline-claude", 100 * 1024 * 1024), offlineClaudeHistoryFromJsonl(claudeBody, "offline-claude"));
|
|
363
|
+
});
|
|
364
|
+
test("summary cache entries expire after 3 days and pruning removes expired and v1 files", async (t) => {
|
|
365
|
+
const f = await fixture(t);
|
|
366
|
+
await f.put(f.piPath, piText("opening"));
|
|
367
|
+
const reads = transcriptReads(t, [f.piPath]);
|
|
368
|
+
await historyList.execute({ session: "pi:*" }, f.context());
|
|
369
|
+
assert.equal(reads.length, 1);
|
|
370
|
+
const [name] = await cacheEntries(f.cacheRoot);
|
|
371
|
+
const cachePath = join(f.cacheRoot, name);
|
|
372
|
+
const expiredTime = new Date(Date.now() - HISTORY_SUMMARY_CACHE_TTL_MS - 60_000);
|
|
373
|
+
await fs.utimes(cachePath, expiredTime, expiredTime);
|
|
374
|
+
// Expired entry must miss and trigger a strict reload.
|
|
375
|
+
await historyList.execute({ session: "pi:*" }, f.context());
|
|
376
|
+
assert.equal(reads.length, 2);
|
|
377
|
+
// Pruning deletes v1 and expired files while preserving fresh v2 entries.
|
|
378
|
+
const v1Path = join(f.cacheRoot, "legacy-v1.json");
|
|
379
|
+
const expiredPath = join(f.cacheRoot, "expired-v2.json");
|
|
380
|
+
await fs.writeFile(v1Path, JSON.stringify({ version: "strict-representative-v1" }));
|
|
381
|
+
await fs.writeFile(expiredPath, await fs.readFile(cachePath, "utf8"));
|
|
382
|
+
await fs.utimes(expiredPath, expiredTime, expiredTime);
|
|
383
|
+
await pruneHistorySummaryCache(f.cacheRoot);
|
|
384
|
+
assert.deepEqual(await cacheEntries(f.cacheRoot), [name]);
|
|
385
|
+
});
|