notesoup 0.53.2 → 0.54.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/README.md +6 -4
- package/dist/plugins/claude/src/helper.d.ts +2 -1
- package/dist/plugins/claude/src/helper.js +21 -24
- package/dist/plugins/claude/src/history.d.ts +3 -14
- package/dist/plugins/claude/src/history.js +2 -298
- package/dist/plugins/claude/src/text.d.ts +0 -1
- package/dist/plugins/claude/src/text.js +0 -1
- package/dist/plugins/codex/src/history.d.ts +3 -8
- package/dist/plugins/codex/src/history.js +2 -238
- package/dist/plugins/codex/src/hooks.js +1 -1
- package/dist/plugins/codex/src/identity.d.ts +1 -1
- package/dist/plugins/codex/src/identity.js +3 -3
- package/dist/plugins/codex/src/mcp.js +9 -8
- package/dist/plugins/codex/src/text.d.ts +1 -1
- package/dist/plugins/codex/src/text.js +2 -2
- package/dist/plugins/codex/src/transcript.d.ts +3 -39
- package/dist/plugins/codex/src/transcript.js +2 -313
- package/dist/plugins/dsh/engine.js +2 -2
- package/dist/plugins/dsh/history.d.ts +3 -0
- package/dist/plugins/dsh/history.js +15 -0
- package/dist/plugins/dsh/tools.js +12 -12
- package/dist/plugins/dsh/window.d.ts +1 -0
- package/dist/plugins/dsh/window.js +7 -3
- package/dist/plugins/pi/history-tools.d.ts +1 -1
- package/dist/plugins/pi/history-tools.js +9 -5
- package/dist/plugins/pi/history.d.ts +2 -3
- package/dist/plugins/pi/history.js +4 -147
- package/dist/plugins/pi/notes/tools.js +8 -6
- package/dist/plugins/pi/render.js +7 -4
- package/dist/plugins/pi/runtime.js +2 -2
- package/dist/plugins/pi/window.js +21 -7
- package/dist/src/boot/render.js +9 -11
- package/dist/src/boot/snapshot.d.ts +7 -7
- package/dist/src/boot/snapshot.js +17 -17
- package/dist/src/boot/text.d.ts +5 -3
- package/dist/src/boot/text.js +18 -10
- package/dist/src/dream/git.d.ts +2 -11
- package/dist/src/dream/git.js +6 -23
- package/dist/src/dream/lock.d.ts +2 -2
- package/dist/src/dream/lock.js +3 -3
- package/dist/src/history/claude.d.ts +16 -0
- package/dist/src/history/claude.js +336 -0
- package/dist/src/history/codex-transcript.d.ts +39 -0
- package/dist/src/history/codex-transcript.js +315 -0
- package/dist/src/history/codex.d.ts +8 -0
- package/dist/src/history/codex.js +238 -0
- package/dist/src/history/corpus.d.ts +35 -0
- package/dist/src/history/corpus.js +54 -0
- package/dist/src/history/history.d.ts +4 -8
- package/dist/src/history/history.js +3 -11
- package/dist/src/history/local.d.ts +17 -0
- package/dist/src/history/local.js +101 -0
- package/dist/src/history/pi.d.ts +36 -0
- package/dist/src/history/pi.js +202 -0
- package/dist/src/history/query.d.ts +15 -5
- package/dist/src/history/query.js +42 -13
- package/dist/src/index.d.ts +6 -3
- package/dist/src/index.js +6 -4
- package/dist/src/notes/address.d.ts +8 -8
- package/dist/src/notes/address.js +13 -13
- package/dist/src/notes/errors.d.ts +1 -1
- package/dist/src/notes/frontmatter.js +2 -2
- package/dist/src/notes/index.d.ts +1 -1
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/paths.d.ts +6 -6
- package/dist/src/notes/paths.js +9 -9
- package/dist/src/notes/{project-home.d.ts → project-namespace.d.ts} +7 -7
- package/dist/src/notes/{project-home.js → project-namespace.js} +67 -25
- package/dist/src/notes/store.d.ts +4 -4
- package/dist/src/notes/store.js +55 -52
- package/dist/src/tools/dream.d.ts +21 -3
- package/dist/src/tools/dream.js +54 -16
- package/dist/src/tools/history.d.ts +7 -19
- package/dist/src/tools/history.js +80 -93
- package/dist/src/tools/notes-context.d.ts +10 -0
- package/dist/src/tools/notes-context.js +27 -0
- package/dist/src/tools/notes.d.ts +69 -20
- package/dist/src/tools/notes.js +40 -31
- package/dist/test/boot.integration.test.js +2 -3
- package/dist/test/claude-history.test.js +47 -34
- package/dist/test/claude-mod.test.js +96 -50
- package/dist/test/codex-history.test.js +4 -10
- package/dist/test/codex-plugin.test.js +50 -12
- package/dist/test/context-edit-budget.test.js +121 -0
- package/dist/test/dependencies.test.js +73 -6
- package/dist/test/dream-tools.test.js +153 -8
- package/dist/test/dsh.test.js +88 -19
- package/dist/test/helpers/dsh.d.ts +4 -1
- package/dist/test/helpers/dsh.js +20 -4
- package/dist/test/helpers/extension.d.ts +5 -1
- package/dist/test/helpers/extension.js +33 -2
- package/dist/test/helpers/history-corpus.d.ts +7 -0
- package/dist/test/helpers/history-corpus.js +26 -0
- package/dist/test/history-corpus.test.js +307 -0
- package/dist/test/history.integration.test.js +40 -48
- package/dist/test/host-neutral.test.js +20 -33
- package/dist/test/model-facing-text.test.js +14 -8
- package/dist/test/notes-cwd.test.d.ts +1 -0
- package/dist/test/notes-cwd.test.js +114 -0
- package/dist/test/notes-library.test.js +4 -4
- package/dist/test/notes-query-namespaces.test.d.ts +1 -0
- package/dist/test/{notes-query-homes.test.js → notes-query-namespaces.test.js} +13 -13
- package/dist/test/notes.integration.test.js +73 -24
- package/dist/test/notes.test.js +51 -21
- package/dist/test/pi-render.test.js +33 -1
- package/dist/test/project-namespace.test.d.ts +1 -0
- package/dist/test/project-namespace.test.js +324 -0
- package/docs/architecture.md +19 -12
- package/docs/claude-code-mod.md +7 -5
- package/docs/codex.md +6 -6
- package/docs/dsh.md +9 -9
- package/docs/history-sessions.md +52 -0
- package/docs/notes-library.md +9 -5
- package/docs/skills.md +3 -3
- package/docs/tool-results.md +14 -8
- package/package.json +4 -6
- package/playbook.md +6 -6
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/dist/claude/helper.js +2164 -1341
- package/plugins/claude/hooks/register.ts +19 -11
- package/plugins/claude/playbook.md +6 -6
- package/plugins/claude/skills/memory/SKILL.md +9 -7
- package/plugins/claude/src/helper.ts +22 -25
- package/plugins/claude/src/history.ts +3 -257
- package/plugins/claude/src/text.ts +0 -1
- package/plugins/codex/README.md +1 -1
- package/plugins/codex/dist/codex/notesoup.js +1582 -969
- package/plugins/codex/src/history.ts +3 -193
- package/plugins/codex/src/hooks.ts +1 -1
- package/plugins/codex/src/identity.ts +3 -3
- package/plugins/codex/src/mcp.ts +9 -8
- package/plugins/codex/src/text.ts +2 -2
- package/plugins/codex/src/transcript.ts +3 -275
- package/plugins/dsh/engine.ts +2 -2
- package/plugins/dsh/history.ts +17 -0
- package/plugins/dsh/tools.ts +12 -12
- package/plugins/dsh/window.ts +8 -3
- package/plugins/paseo/OVERVIEW.md +4 -4
- package/plugins/paseo/README.md +1 -1
- package/plugins/paseo/client/brain-empty-card.tsx +3 -4
- package/plugins/paseo/client/markdown.tsx +159 -0
- package/plugins/paseo/client/notes-op-card.tsx +35 -34
- package/plugins/paseo/client/notes-op-transformer.ts +17 -68
- package/plugins/paseo/client/paper-card.tsx +8 -19
- package/plugins/paseo/client/paper-palette.ts +40 -0
- package/plugins/paseo/client/sticky-card.tsx +6 -4
- package/plugins/paseo/package.json +3 -0
- package/plugins/paseo/paseo-plugin.json +2 -2
- package/plugins/paseo/shared/notes-op.ts +13 -9
- package/plugins/paseo/test/notes-op.test.ts +52 -73
- package/plugins/paseo/test/paper-palette.test.ts +54 -0
- package/plugins/pi/history-tools.ts +11 -5
- package/plugins/pi/history.ts +8 -157
- package/plugins/pi/notes/tools.ts +8 -6
- package/plugins/pi/render.ts +6 -4
- package/plugins/pi/runtime.ts +2 -2
- package/plugins/pi/window.ts +22 -7
- package/skills/memory/SKILL.md +9 -7
- package/src/boot/render.ts +10 -13
- package/src/boot/snapshot.ts +20 -20
- package/src/boot/text.ts +18 -10
- package/src/dream/git.ts +7 -24
- package/src/dream/lock.ts +3 -3
- package/src/history/claude.ts +286 -0
- package/src/history/codex-transcript.ts +276 -0
- package/src/history/codex.ts +193 -0
- package/src/history/corpus.ts +69 -0
- package/src/history/history.ts +5 -12
- package/src/history/local.ts +93 -0
- package/src/history/pi.ts +199 -0
- package/src/history/query.ts +45 -15
- package/src/index.ts +8 -5
- package/src/notes/address.ts +13 -13
- package/src/notes/errors.ts +1 -1
- package/src/notes/frontmatter.ts +2 -2
- package/src/notes/index.ts +1 -1
- package/src/notes/paths.ts +9 -9
- package/src/notes/{project-home.ts → project-namespace.ts} +59 -28
- package/src/notes/store.ts +61 -58
- package/src/tools/dream.ts +63 -16
- package/src/tools/history.ts +71 -101
- package/src/tools/notes-context.ts +29 -0
- package/src/tools/notes.ts +39 -29
- package/dist/test/project-home.test.js +0 -134
- /package/dist/test/{notes-query-homes.test.d.ts → context-edit-budget.test.d.ts} +0 -0
- /package/dist/test/{project-home.test.d.ts → history-corpus.test.d.ts} +0 -0
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { mkdirSync, mkdtempSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import test from "node:test";
|
|
6
|
-
import { Check } from "typebox/value";
|
|
7
|
-
import { createNotesStore } from "../src/notes/index.js";
|
|
8
|
-
import { assertAddress } from "../src/notes/address.js";
|
|
9
|
-
import { normalizeRemote, projectKey } from "../src/notes/project-home.js";
|
|
10
|
-
import { notesList, notesRead, notesSearch, notesUpdate, notesWrite } from "../src/tools/notes.js";
|
|
11
|
-
import { success } from "../src/tools/result.js";
|
|
12
|
-
function fixture(t) {
|
|
13
|
-
const root = realpathSync(mkdtempSync(join(tmpdir(), "notesoup-project-home-")));
|
|
14
|
-
t.after(() => rmSync(root, { recursive: true, force: true }));
|
|
15
|
-
const home = join(root, "notes");
|
|
16
|
-
const repo = (path, origin) => {
|
|
17
|
-
const cwd = join(root, path);
|
|
18
|
-
mkdirSync(join(cwd, ".git"), { recursive: true });
|
|
19
|
-
writeFileSync(join(cwd, ".git/config"), origin ? `[remote "origin"]\n\turl = ${origin}\n` : "");
|
|
20
|
-
return cwd;
|
|
21
|
-
};
|
|
22
|
-
const marker = (key) => JSON.parse(readFileSync(join(home, "project", key, ".project"), "utf8"));
|
|
23
|
-
const identity = (cwd) => ({ home, projectKey: projectKey(cwd, home), sessionId: "session", agent: "test", model: "test" });
|
|
24
|
-
return { root, home, repo, marker, identity };
|
|
25
|
-
}
|
|
26
|
-
function data(result) {
|
|
27
|
-
if (!result.ok)
|
|
28
|
-
assert.fail(result.error.message);
|
|
29
|
-
return result.data;
|
|
30
|
-
}
|
|
31
|
-
function refused(result) {
|
|
32
|
-
if (result.ok)
|
|
33
|
-
assert.fail("expected refusal");
|
|
34
|
-
return result.error.message;
|
|
35
|
-
}
|
|
36
|
-
test("origin identity normalizes https, scp and port-less ssh without invoking Git", t => {
|
|
37
|
-
const { home, repo, marker } = fixture(t);
|
|
38
|
-
for (const remote of ["https://user:secret@GitHub.COM/team/api.git/", "git@GitHub.COM:team/api.git", "ssh://git@GitHub.COM/team/api.git"]) {
|
|
39
|
-
assert.equal(normalizeRemote(remote), "github.com/team/api");
|
|
40
|
-
}
|
|
41
|
-
assert.equal(normalizeRemote("ssh://git@EXAMPLE.com:2222/team/api.git"), "example.com:2222/team/api");
|
|
42
|
-
const first = repo("one/api", "git@GitHub.COM:team/api.git");
|
|
43
|
-
const second = repo("two/renamed", "https://github.com/team/api.git");
|
|
44
|
-
assert.equal(projectKey(first, home), "api");
|
|
45
|
-
assert.equal(projectKey(second, home), "api");
|
|
46
|
-
assert.deepEqual(marker("api"), { id: "github.com/team/api", path: second });
|
|
47
|
-
});
|
|
48
|
-
test("same-basename repositories get readable suffixes and unmarked legacy names are taken", t => {
|
|
49
|
-
const { home, repo } = fixture(t);
|
|
50
|
-
const first = repo("one/x", "https://host/one/x");
|
|
51
|
-
const second = repo("two/x", "https://host/two/x");
|
|
52
|
-
assert.equal(projectKey(first, home), "x");
|
|
53
|
-
assert.equal(projectKey(second, home), "x-1");
|
|
54
|
-
mkdirSync(join(home, "project", "legacy"));
|
|
55
|
-
writeFileSync(join(home, "project", "legacy", "keep.md"), "old notes");
|
|
56
|
-
assert.equal(projectKey(repo("legacy"), home), "legacy-1");
|
|
57
|
-
assert.equal(readFileSync(join(home, "project", "legacy", "keep.md"), "utf8"), "old notes");
|
|
58
|
-
});
|
|
59
|
-
test("linked worktrees and nested directories share the main checkout home and origin", t => {
|
|
60
|
-
const { root, home, repo, marker } = fixture(t);
|
|
61
|
-
const main = repo("api", "ssh://git@HOST/team/api.git");
|
|
62
|
-
const worktree = join(root, "worktree");
|
|
63
|
-
mkdirSync(worktree);
|
|
64
|
-
mkdirSync(join(main, ".git/worktrees/wt"), { recursive: true });
|
|
65
|
-
writeFileSync(join(worktree, ".git"), `gitdir: ${join(main, ".git/worktrees/wt")}\n`);
|
|
66
|
-
writeFileSync(join(main, ".git/worktrees/wt/commondir"), "../..\n");
|
|
67
|
-
assert.equal(projectKey(main, home), "api");
|
|
68
|
-
assert.equal(projectKey(join(worktree, "missing/subdir"), home), "api");
|
|
69
|
-
assert.deepEqual(marker("api"), { id: "host/team/api", path: main });
|
|
70
|
-
});
|
|
71
|
-
test("a moved checkout reuses its remote home and updates only the display root", async (t) => {
|
|
72
|
-
const { root, home, repo, marker, identity } = fixture(t);
|
|
73
|
-
const old = repo("api", "https://host/team/api.git");
|
|
74
|
-
await createNotesStore(identity(old)).write("@project/decision", "keep me");
|
|
75
|
-
const moved = join(root, "new-name");
|
|
76
|
-
renameSync(old, moved);
|
|
77
|
-
const current = identity(moved);
|
|
78
|
-
assert.equal(current.projectKey, "api");
|
|
79
|
-
assert.deepEqual(marker("api"), { id: "host/team/api", path: moved });
|
|
80
|
-
assert.equal((await createNotesStore(current).read("@project/decision"))?.body, "keep me");
|
|
81
|
-
assert.equal(projectKey(moved, home), "api");
|
|
82
|
-
});
|
|
83
|
-
test("adding origin adopts the canonical path identity without orphaning notes", async (t) => {
|
|
84
|
-
const { home, repo, marker, identity } = fixture(t);
|
|
85
|
-
const cwd = repo("api");
|
|
86
|
-
await createNotesStore(identity(cwd)).write("@project/decision", "still here");
|
|
87
|
-
assert.deepEqual(marker("api"), { id: cwd, path: cwd });
|
|
88
|
-
writeFileSync(join(cwd, ".git/config"), '[remote "backup"]\nurl = https://host/wrong\n[remote "origin"]\nurl = git@HOST:team/api.git\n');
|
|
89
|
-
assert.equal(projectKey(cwd, home), "api");
|
|
90
|
-
assert.deepEqual(marker("api"), { id: "host/team/api", path: cwd });
|
|
91
|
-
assert.equal((await createNotesStore(identity(cwd)).read("@project/decision"))?.body, "still here");
|
|
92
|
-
});
|
|
93
|
-
test("named projects read/list/search with root and sibling receipts, without touching stored bytes", async (t) => {
|
|
94
|
-
const { home, repo, identity } = fixture(t);
|
|
95
|
-
const first = repo("one/api", "https://host/one/backend");
|
|
96
|
-
const second = repo("two/api", "https://host/two/service");
|
|
97
|
-
const own = identity(first);
|
|
98
|
-
const other = identity(second);
|
|
99
|
-
await createNotesStore(own).write("@project/decision", "needle first");
|
|
100
|
-
await createNotesStore(other).write("@project/decision", "needle second");
|
|
101
|
-
const address = "@projects/api-1/decision.md";
|
|
102
|
-
const file = join(home, "project/api-1/decision.md");
|
|
103
|
-
const before = readFileSync(file, "utf8");
|
|
104
|
-
const read = data(await notesRead.execute({ address }, own));
|
|
105
|
-
assert.equal(read.text, "needle second");
|
|
106
|
-
assert.equal(read.project_root, second);
|
|
107
|
-
assert.deepEqual(read.project_siblings, [{ name: "api", path: first }]);
|
|
108
|
-
assert.equal(Check(notesRead.outputSchema, read), true);
|
|
109
|
-
assert.match(notesRead.render(success(read)), /Same-basename projects: api \(/);
|
|
110
|
-
const listed = data(await notesList.execute({ glob: "@projects/*/**" }, own));
|
|
111
|
-
assert.deepEqual(listed.files.map(row => [row.address, row.project_root]).sort(), [["@projects/api-1/decision.md", second], ["@projects/api/decision.md", first]].sort());
|
|
112
|
-
assert.equal(Check(notesList.outputSchema, listed), true);
|
|
113
|
-
const searched = data(await notesSearch.execute({ glob: "@projects/api-1/**", query: "needle" }, own));
|
|
114
|
-
assert.equal(searched.files[0]?.project_root, second);
|
|
115
|
-
assert.equal(Check(notesSearch.outputSchema, searched), true);
|
|
116
|
-
assert.equal(readFileSync(file, "utf8"), before, "named-home reads never rewrite access metadata");
|
|
117
|
-
});
|
|
118
|
-
test("named project writes, edits, crumples and both move endpoints refuse, including the current home", async (t) => {
|
|
119
|
-
const { repo, identity } = fixture(t);
|
|
120
|
-
const own = identity(repo("api"));
|
|
121
|
-
await createNotesStore(own).write("@project/decision", "body");
|
|
122
|
-
const address = "@projects/api/decision";
|
|
123
|
-
for (const result of [
|
|
124
|
-
await notesWrite.execute({ address, content: "replacement" }, own),
|
|
125
|
-
await notesUpdate.execute({ address, edits: [{ oldText: "body", newText: "changed" }] }, own, () => ""),
|
|
126
|
-
await notesUpdate.execute({ address, crumpled: true }, own, () => ""),
|
|
127
|
-
await notesUpdate.execute({ address, rename_to: "@project/moved" }, own, () => ""),
|
|
128
|
-
await notesUpdate.execute({ address: "@project/decision", rename_to: "@projects/api/moved" }, own, () => ""),
|
|
129
|
-
])
|
|
130
|
-
assert.match(refused(result), /read-only; use @project\//);
|
|
131
|
-
assert.equal(data(await notesRead.execute({ address }, own)).text, "body");
|
|
132
|
-
assert.throws(() => assertAddress("@projects/api/../decision"));
|
|
133
|
-
assert.throws(() => assertAddress("@projects/api"));
|
|
134
|
-
});
|
|
File without changes
|
|
File without changes
|