notesoup 0.52.7 → 0.53.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 +3 -1
- package/dist/plugins/codex/src/cli.d.ts +2 -0
- package/dist/plugins/codex/src/cli.js +25 -0
- package/dist/plugins/codex/src/history.d.ts +8 -0
- package/dist/plugins/codex/src/history.js +238 -0
- package/dist/plugins/codex/src/hooks.d.ts +9 -0
- package/dist/plugins/codex/src/hooks.js +196 -0
- package/dist/plugins/codex/src/identity.d.ts +35 -0
- package/dist/plugins/codex/src/identity.js +134 -0
- package/dist/plugins/codex/src/mcp.d.ts +7 -0
- package/dist/plugins/codex/src/mcp.js +159 -0
- package/dist/plugins/codex/src/state.d.ts +23 -0
- package/dist/plugins/codex/src/state.js +92 -0
- package/dist/plugins/codex/src/text.d.ts +14 -0
- package/dist/plugins/codex/src/text.js +25 -0
- package/dist/plugins/codex/src/transcript.d.ts +39 -0
- package/dist/plugins/codex/src/transcript.js +313 -0
- package/dist/src/boot/render.js +13 -12
- package/dist/src/boot/text.d.ts +5 -5
- package/dist/src/boot/text.js +15 -28
- package/dist/src/budget/text.d.ts +1 -1
- package/dist/src/budget/text.js +1 -1
- package/dist/test/codex-history.test.d.ts +1 -0
- package/dist/test/codex-history.test.js +330 -0
- package/dist/test/codex-plugin.test.d.ts +1 -0
- package/dist/test/codex-plugin.test.js +365 -0
- package/dist/test/dependencies.test.js +8 -2
- package/dist/test/dsh.test.js +1 -1
- package/dist/test/helpers/dependency-graph.js +1 -1
- package/dist/test/model-facing-text.test.js +47 -26
- package/dist/test/notes.integration.test.js +3 -0
- package/docs/codex.md +91 -0
- package/docs/dsh.md +1 -1
- package/docs/reset-lifecycle.md +1 -1
- package/package.json +6 -3
- package/playbook.md +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/dist/claude/helper.js +27 -37
- package/plugins/claude/playbook.md +1 -1
- package/plugins/claude/skills/dream/SKILL.md +1 -1
- package/plugins/claude/skills/memory/SKILL.md +1 -1
- package/plugins/codex/README.md +43 -0
- package/plugins/codex/dist/codex/notesoup.js +27801 -0
- package/plugins/codex/hooks/hooks.json +41 -0
- package/plugins/codex/mcp.json +10 -0
- package/plugins/codex/plugin.json +6 -0
- package/plugins/codex/src/cli.ts +26 -0
- package/plugins/codex/src/history.ts +193 -0
- package/plugins/codex/src/hooks.ts +190 -0
- package/plugins/codex/src/identity.ts +147 -0
- package/plugins/codex/src/mcp.ts +171 -0
- package/plugins/codex/src/state.ts +102 -0
- package/plugins/codex/src/text.ts +31 -0
- package/plugins/codex/src/transcript.ts +275 -0
- package/skills/dream/SKILL.md +1 -1
- package/skills/memory/SKILL.md +1 -1
- package/src/boot/render.ts +13 -11
- package/src/boot/text.ts +17 -30
- package/src/budget/text.ts +1 -1
package/src/boot/render.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NotesHome, NotesSnapshot } from "./snapshot.js";
|
|
2
|
-
import { WINDOW_IDENTITY_OPEN_TAG, WINDOW_IDENTITY_CLOSE_TAG, MAPS_BLOCK, MAP_BOOT_MAX_CHARS, SHELF_FRESH_LIMIT, renderProtocolBlock, type BootToolNames } from "./text.js";
|
|
2
|
+
import { WINDOW_IDENTITY_OPEN_TAG, WINDOW_IDENTITY_CLOSE_TAG, MAPS_BLOCK, CHEATSHEET_BOOT_MAX_CHARS, MAP_BOOT_MAX_CHARS, SHELF_FRESH_LIMIT, renderProtocolBlock, type BootToolNames } from "./text.js";
|
|
3
3
|
|
|
4
4
|
function relativeTime(timestamp: number, now: number): string {
|
|
5
5
|
const seconds = Math.trunc((timestamp - now) / 1000);
|
|
@@ -35,7 +35,7 @@ function section(label: string, body: string): string {
|
|
|
35
35
|
/** Pi's default agent slug: an unnamed agent shares its `@self` shelf with every other nameless one. */
|
|
36
36
|
const NAMELESS_AGENT = "anonymous";
|
|
37
37
|
|
|
38
|
-
/** One closed boot snapshot: five tabbed shelves, current hands first, durable last; each shelf keeps its
|
|
38
|
+
/** One closed boot snapshot: five tabbed shelves, current hands first, durable last; each shelf keeps its pinned pages and its own freshest pages. */
|
|
39
39
|
function notesIndex(snapshot: NotesSnapshot, tools: BootToolNames, agentName: string, modelName: string): string {
|
|
40
40
|
const homes: ReadonlyArray<{ scope: NotesHome["scope"]; label: string }> = [
|
|
41
41
|
{ scope: "session", label: "no @ — this session" },
|
|
@@ -52,18 +52,20 @@ function notesIndex(snapshot: NotesSnapshot, tools: BootToolNames, agentName: st
|
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
54
|
const rows = (snapshot.homes.get(home.scope) ?? []).filter((row) => row.meta.crumpledAt === undefined);
|
|
55
|
-
const
|
|
55
|
+
const pinned = ["CHEATSHEET.md", "MAP.md"].flatMap((path) => {
|
|
56
|
+
const row = rows.find((row) => row.path === path);
|
|
57
|
+
return row?.body ? [row] : [];
|
|
58
|
+
});
|
|
56
59
|
const fresh = rows
|
|
57
|
-
.filter((row) => row.path !== "MAP.md")
|
|
60
|
+
.filter((row) => row.path !== "MAP.md" && row.path !== "CHEATSHEET.md")
|
|
58
61
|
.slice(0, SHELF_FRESH_LIMIT)
|
|
59
62
|
.map((row) => {
|
|
60
63
|
const locator = `${row.address} · ${relativeTime(row.meta.updatedAt, snapshot.openedAt)}`;
|
|
61
64
|
const title = feedTitle(row.body);
|
|
62
65
|
return title === undefined ? ` ${locator}` : ` ${title}\n ${locator}`;
|
|
63
66
|
});
|
|
64
|
-
if (
|
|
65
|
-
const parts:
|
|
66
|
-
if (map?.body) parts.push(`map\n\n${indent(mapBodyForBoot(map.address, map.body))}`);
|
|
67
|
+
if (pinned.length === 0 && fresh.length === 0) continue;
|
|
68
|
+
const parts = pinned.map((row) => `${row.path === "MAP.md" ? "map" : "cheatsheet"}\n\n${indent(pinnedBodyForBoot(row.address, row.body, row.path === "MAP.md" ? MAP_BOOT_MAX_CHARS : CHEATSHEET_BOOT_MAX_CHARS))}`);
|
|
67
69
|
if (fresh.length > 0) parts.push(`recent\n\n${fresh.join("\n\n")}`);
|
|
68
70
|
shelves.push(section(home.label, parts.join("\n\n")));
|
|
69
71
|
}
|
|
@@ -73,11 +75,11 @@ function notesIndex(snapshot: NotesSnapshot, tools: BootToolNames, agentName: st
|
|
|
73
75
|
: "YOUR NOTES\n──────────\n\nNone yet. A blank slate is a fine place to start — just don't finish there.";
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
/**
|
|
77
|
-
function
|
|
78
|
+
/** Each pinned page is bounded; the cut names where the rest lives. */
|
|
79
|
+
function pinnedBodyForBoot(address: string, body: string, maxChars: number): string {
|
|
78
80
|
const chars = Array.from(body);
|
|
79
|
-
if (chars.length <=
|
|
80
|
-
return `${chars.slice(0,
|
|
81
|
+
if (chars.length <= maxChars) return body;
|
|
82
|
+
return `${chars.slice(0, maxChars).join("")}\n[truncated at ${maxChars} chars; slim this page down, full body at \`${address}\`]`;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
export type BootWindowTree = {
|
package/src/boot/text.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/** Each shelf shows this many of its own freshest pages beneath
|
|
1
|
+
/** Each shelf shows this many of its own freshest pages beneath its pinned pages. */
|
|
2
2
|
export const SHELF_FRESH_LIMIT = 3;
|
|
3
|
-
/**
|
|
3
|
+
/** Each pinned page has its own code-point cap; overflow keeps a lookup pointer. */
|
|
4
|
+
export const CHEATSHEET_BOOT_MAX_CHARS = 2048;
|
|
4
5
|
export const MAP_BOOT_MAX_CHARS = 4096;
|
|
5
6
|
export const WINDOW_IDENTITY_OPEN_TAG = "<notesoup:window_identity>";
|
|
6
7
|
export const WINDOW_IDENTITY_CLOSE_TAG = "</notesoup:window_identity>";
|
|
@@ -54,36 +55,22 @@ Any other @ address is fake. End of discussion. @ addresses are not file paths:
|
|
|
54
55
|
${NOTES_PROTOCOL_CLOSE_TAG}`;
|
|
55
56
|
|
|
56
57
|
/**
|
|
57
|
-
* The
|
|
58
|
-
* index. A MAP is the one note every waking window loads, so this block says what one holds.
|
|
58
|
+
* The two pinned pages are taught once per window between the protocol and the notes index.
|
|
59
59
|
*/
|
|
60
60
|
export const MAPS_BLOCK = `<notesoup:maps>
|
|
61
|
-
Every home's root can hold
|
|
62
|
-
|
|
63
|
-
up next reads
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
# CHEATSHEET
|
|
75
|
-
- Read the repo before asking; run it before believing it
|
|
76
|
-
- Report times in Beijing time
|
|
77
|
-
|
|
78
|
-
# INDEX
|
|
79
|
-
- release-and-local-install.md — version bump, local override install, host load timing
|
|
80
|
-
- history-api-v2-design.md — seq addressing; read before touching history
|
|
81
|
-
- current-reset-and-dream-scope.md — reset scope, dream territory, session ownership
|
|
82
|
-
\`\`\`
|
|
83
|
-
|
|
84
|
-
Every home gets one: \`@project\`, \`@human\`, \`@self\`, \`@model\`. New note, new line. New rule worth
|
|
85
|
-
remembering, new Cheatsheet line. And when a line stops being true, kill it — every window after you
|
|
86
|
-
reads that page as fact.
|
|
61
|
+
Every home's root can hold two pages that never wait on a shelf: \`CHEATSHEET.md\` and \`MAP.md\`.
|
|
62
|
+
Both get jammed straight into your brain the moment you wake up. No asking, no skipping. Whoever
|
|
63
|
+
wakes up next reads them, and next is you. So keep them short, and keep them true.
|
|
64
|
+
|
|
65
|
+
- **\`CHEATSHEET.md\`** holds what you'll want next time — a rule, a warning, a grudge, a name,
|
|
66
|
+
a phone number you'll regret losing. Nobody grades it. Keep it to five lines, or it grows fat
|
|
67
|
+
and everybody pays for it.
|
|
68
|
+
- **\`MAP.md\`** is only the note index. One line per durable note: the address, then a gist short
|
|
69
|
+
enough to tell whether the thing is worth opening. Rules belong in \`CHEATSHEET.md\`, not here.
|
|
70
|
+
|
|
71
|
+
Each home keeps its own: \`@project\`, \`@human\`, \`@self\`, \`@model\`. Missing pages are skipped;
|
|
72
|
+
no need to create empty ones. New note, new MAP line. New rule worth remembering, new Cheatsheet
|
|
73
|
+
line. And when a line stops being true, kill it — every window after you reads that page as fact.
|
|
87
74
|
</notesoup:maps>`;
|
|
88
75
|
|
|
89
76
|
/** Logical tool names are supplied by the composing host, not discovered here. */
|
package/src/budget/text.ts
CHANGED
|
@@ -33,7 +33,7 @@ export const WARNING_TIMING = "The reserve is nearly spent. The wipe lands at th
|
|
|
33
33
|
|
|
34
34
|
/** The shared handoff instructions, used for both budget and manual close-outs. */
|
|
35
35
|
export const WARNING_BODY =
|
|
36
|
-
"Stop the task. Write down what git and history can't give back:\n- where you are, and how far you got\n- what the human decided, in their words\n- what's blocked or waiting\n- the next move\n- where the half-done work sits\n- what failed, and why\n- which skills, seqs, notes, or files to reopen\n- anything else worth noting\nThen leave the shelf current: replace what's stale, a whole note or a section inside one, and crumple the dead ones. Update and trim
|
|
36
|
+
"Stop the task. Write down what git and history can't give back:\n- where you are, and how far you got\n- what the human decided, in their words\n- what's blocked or waiting\n- the next move\n- where the half-done work sits\n- what failed, and why\n- which skills, seqs, notes, or files to reopen\n- anything else worth noting\nThen leave the shelf current: replace what's stale, a whole note or a section inside one, and crumple the dead ones. Update and trim CHEATSHEET.md and MAP.md; every new window loads them. The next window gets whatever you leave, dead notes and dead sections alike.\nDon't call anything that might return a large output. One big read can spend the rest of the reserve before your notes are saved.";
|
|
37
37
|
|
|
38
38
|
export const WARNING_CALL = "Then call `empty_brain`. Nothing in between.";
|
|
39
39
|
|