notesoup 0.53.0 → 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/dist/src/boot/render.js +5 -5
- package/dist/src/boot/text.d.ts +2 -1
- package/dist/src/boot/text.js +2 -1
- package/dist/test/model-facing-text.test.js +11 -5
- package/package.json +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/dist/claude/helper.js +6 -5
- package/plugins/codex/dist/codex/notesoup.js +6 -5
- package/src/boot/render.ts +5 -5
- package/src/boot/text.ts +2 -1
package/dist/src/boot/render.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WINDOW_IDENTITY_OPEN_TAG, WINDOW_IDENTITY_CLOSE_TAG, MAPS_BLOCK, MAP_BOOT_MAX_CHARS, SHELF_FRESH_LIMIT, renderProtocolBlock } from "./text.js";
|
|
1
|
+
import { WINDOW_IDENTITY_OPEN_TAG, WINDOW_IDENTITY_CLOSE_TAG, MAPS_BLOCK, CHEATSHEET_BOOT_MAX_CHARS, MAP_BOOT_MAX_CHARS, SHELF_FRESH_LIMIT, renderProtocolBlock } from "./text.js";
|
|
2
2
|
function relativeTime(timestamp, now) {
|
|
3
3
|
const seconds = Math.trunc((timestamp - now) / 1000);
|
|
4
4
|
if (seconds === 0)
|
|
@@ -59,7 +59,7 @@ function notesIndex(snapshot, tools, agentName, modelName) {
|
|
|
59
59
|
});
|
|
60
60
|
if (pinned.length === 0 && fresh.length === 0)
|
|
61
61
|
continue;
|
|
62
|
-
const parts = pinned.map((row) => `${row.path === "MAP.md" ? "map" : "cheatsheet"}\n\n${indent(pinnedBodyForBoot(row.address, row.body))}`);
|
|
62
|
+
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))}`);
|
|
63
63
|
if (fresh.length > 0)
|
|
64
64
|
parts.push(`recent\n\n${fresh.join("\n\n")}`);
|
|
65
65
|
shelves.push(section(home.label, parts.join("\n\n")));
|
|
@@ -69,11 +69,11 @@ function notesIndex(snapshot, tools, agentName, modelName) {
|
|
|
69
69
|
: "YOUR NOTES\n──────────\n\nNone yet. A blank slate is a fine place to start — just don't finish there.";
|
|
70
70
|
}
|
|
71
71
|
/** Each pinned page is bounded; the cut names where the rest lives. */
|
|
72
|
-
function pinnedBodyForBoot(address, body) {
|
|
72
|
+
function pinnedBodyForBoot(address, body, maxChars) {
|
|
73
73
|
const chars = Array.from(body);
|
|
74
|
-
if (chars.length <=
|
|
74
|
+
if (chars.length <= maxChars)
|
|
75
75
|
return body;
|
|
76
|
-
return `${chars.slice(0,
|
|
76
|
+
return `${chars.slice(0, maxChars).join("")}\n[truncated at ${maxChars} chars; slim this page down, full body at \`${address}\`]`;
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Render a static, once-per-window boot block from explicit data. This function does not read
|
package/dist/src/boot/text.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** Each shelf shows this many of its own freshest pages beneath its pinned pages. */
|
|
2
2
|
export declare const SHELF_FRESH_LIMIT = 3;
|
|
3
|
-
/** Each pinned page
|
|
3
|
+
/** Each pinned page has its own code-point cap; overflow keeps a lookup pointer. */
|
|
4
|
+
export declare const CHEATSHEET_BOOT_MAX_CHARS = 2048;
|
|
4
5
|
export declare const MAP_BOOT_MAX_CHARS = 4096;
|
|
5
6
|
export declare const WINDOW_IDENTITY_OPEN_TAG = "<notesoup:window_identity>";
|
|
6
7
|
export declare const WINDOW_IDENTITY_CLOSE_TAG = "</notesoup:window_identity>";
|
package/dist/src/boot/text.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** Each shelf shows this many of its own freshest pages beneath its pinned pages. */
|
|
2
2
|
export const SHELF_FRESH_LIMIT = 3;
|
|
3
|
-
/** Each pinned page
|
|
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>";
|
|
@@ -4,7 +4,7 @@ import { join } from "node:path";
|
|
|
4
4
|
import { tmpdir } from "node:os";
|
|
5
5
|
import { renderBootBlock } from "../src/boot/render.js";
|
|
6
6
|
import { loadNotesSnapshot } from "../src/boot/snapshot.js";
|
|
7
|
-
import { DEFAULT_BOOT_TOOL_NAMES, MAPS_BLOCK, MAP_BOOT_MAX_CHARS, NOTES_PROTOCOL_CLOSE_TAG, NOTES_PROTOCOL_OPEN_TAG, WINDOW_IDENTITY_CLOSE_TAG, WINDOW_IDENTITY_OPEN_TAG, renderProtocolBlock } from "../src/boot/text.js";
|
|
7
|
+
import { DEFAULT_BOOT_TOOL_NAMES, MAPS_BLOCK, CHEATSHEET_BOOT_MAX_CHARS, MAP_BOOT_MAX_CHARS, NOTES_PROTOCOL_CLOSE_TAG, NOTES_PROTOCOL_OPEN_TAG, WINDOW_IDENTITY_CLOSE_TAG, WINDOW_IDENTITY_OPEN_TAG, renderProtocolBlock } from "../src/boot/text.js";
|
|
8
8
|
import { CLAUDE_WARNING_PROMPT } from "../plugins/claude/src/text.js";
|
|
9
9
|
import { COMMAND_NOTICE, PI_PRE_RESET_HINTS, commandWarningContent, warningContent } from "../plugins/pi/text.js";
|
|
10
10
|
import { COUNTDOWN_LINE, FORCED_CONTINUATIONS, GUIDANCE_CLOSE_TAG, GUIDANCE_OPEN_TAG, NORMAL_CONTINUATIONS, WARNING_BODY, WARNING_CALL, WARNING_TIMING, selectContinuation, tokenBudgetGuidance } from "../src/budget/text.js";
|
|
@@ -153,7 +153,10 @@ test("cheatsheets and maps are independently pinned, bounded, and excluded from
|
|
|
153
153
|
...Array.from({ length: 4 }, (_, i) => note("project", `n${i}.md`, `@project/n${i}.md`, `TITLE_${i}`)),
|
|
154
154
|
]],
|
|
155
155
|
["human", [note("human", "MAP.md", "@human/MAP.md", "HUMAN_INDEX")]],
|
|
156
|
-
["agent", [
|
|
156
|
+
["agent", [
|
|
157
|
+
note("agent", "CHEATSHEET.md", "@self/CHEATSHEET.md", "🐑".repeat(CHEATSHEET_BOOT_MAX_CHARS + 1)),
|
|
158
|
+
note("agent", "MAP.md", "@self/MAP.md", "M".repeat(MAP_BOOT_MAX_CHARS + 1)),
|
|
159
|
+
]],
|
|
157
160
|
["model", [{
|
|
158
161
|
...note("model", "CHEATSHEET.md", "@model/CHEATSHEET.md", "CRUMPLED_RULE"),
|
|
159
162
|
meta: { ...note("model", "", "", "").meta, crumpledAt: "2026-10-01T00:00:00+08:00" },
|
|
@@ -166,9 +169,12 @@ test("cheatsheets and maps are independently pinned, bounded, and excluded from
|
|
|
166
169
|
assert.ok(rendered.includes("@project/n2.md ·"));
|
|
167
170
|
assert.equal(rendered.includes("TITLE_3"), false);
|
|
168
171
|
assert.equal(/(?:MAP|CHEATSHEET)\.md ·/.test(rendered), false);
|
|
169
|
-
assert.ok(rendered.includes("🐑".repeat(
|
|
170
|
-
assert.equal(rendered.includes("🐑".repeat(
|
|
171
|
-
assert.ok(rendered.includes(
|
|
172
|
+
assert.ok(rendered.includes("🐑".repeat(CHEATSHEET_BOOT_MAX_CHARS)));
|
|
173
|
+
assert.equal(rendered.includes("🐑".repeat(CHEATSHEET_BOOT_MAX_CHARS + 1)), false);
|
|
174
|
+
assert.ok(rendered.includes(`[truncated at ${CHEATSHEET_BOOT_MAX_CHARS} chars; slim this page down, full body at \`@self/CHEATSHEET.md\`]`));
|
|
175
|
+
assert.ok(rendered.includes("M".repeat(MAP_BOOT_MAX_CHARS)));
|
|
176
|
+
assert.equal(rendered.includes("M".repeat(MAP_BOOT_MAX_CHARS + 1)), false);
|
|
177
|
+
assert.ok(rendered.includes(`[truncated at ${MAP_BOOT_MAX_CHARS} chars; slim this page down, full body at \`@self/MAP.md\`]`));
|
|
172
178
|
assert.equal(rendered.includes("CRUMPLED_RULE"), false);
|
|
173
179
|
assert.equal(rendered.includes("@model —"), false);
|
|
174
180
|
});
|
package/package.json
CHANGED
|
@@ -9919,6 +9919,7 @@ async function loadNotesSnapshot(identity2, openedAt, loadHome) {
|
|
|
9919
9919
|
|
|
9920
9920
|
// src/boot/text.ts
|
|
9921
9921
|
var SHELF_FRESH_LIMIT = 3;
|
|
9922
|
+
var CHEATSHEET_BOOT_MAX_CHARS = 2048;
|
|
9922
9923
|
var MAP_BOOT_MAX_CHARS = 4096;
|
|
9923
9924
|
var WINDOW_IDENTITY_OPEN_TAG = "<notesoup:window_identity>";
|
|
9924
9925
|
var WINDOW_IDENTITY_CLOSE_TAG = "</notesoup:window_identity>";
|
|
@@ -10045,7 +10046,7 @@ function notesIndex(snapshot2, tools, agentName, modelName) {
|
|
|
10045
10046
|
if (pinned.length === 0 && fresh.length === 0) continue;
|
|
10046
10047
|
const parts = pinned.map((row) => `${row.path === "MAP.md" ? "map" : "cheatsheet"}
|
|
10047
10048
|
|
|
10048
|
-
${indent(pinnedBodyForBoot(row.address, row.body))}`);
|
|
10049
|
+
${indent(pinnedBodyForBoot(row.address, row.body, row.path === "MAP.md" ? MAP_BOOT_MAX_CHARS : CHEATSHEET_BOOT_MAX_CHARS))}`);
|
|
10049
10050
|
if (fresh.length > 0) parts.push(`recent
|
|
10050
10051
|
|
|
10051
10052
|
${fresh.join("\n\n")}`);
|
|
@@ -10053,11 +10054,11 @@ ${fresh.join("\n\n")}`);
|
|
|
10053
10054
|
}
|
|
10054
10055
|
return shelves.length > 0 ? ["YOUR NOTES\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500", ...shelves].join("\n\n\n") : "YOUR NOTES\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nNone yet. A blank slate is a fine place to start \u2014 just don't finish there.";
|
|
10055
10056
|
}
|
|
10056
|
-
function pinnedBodyForBoot(address, body) {
|
|
10057
|
+
function pinnedBodyForBoot(address, body, maxChars) {
|
|
10057
10058
|
const chars = Array.from(body);
|
|
10058
|
-
if (chars.length <=
|
|
10059
|
-
return `${chars.slice(0,
|
|
10060
|
-
[truncated at ${
|
|
10059
|
+
if (chars.length <= maxChars) return body;
|
|
10060
|
+
return `${chars.slice(0, maxChars).join("")}
|
|
10061
|
+
[truncated at ${maxChars} chars; slim this page down, full body at \`${address}\`]`;
|
|
10061
10062
|
}
|
|
10062
10063
|
function renderBootBlock(data) {
|
|
10063
10064
|
const shown2 = /* @__PURE__ */ new Set([0, data.tree.windows.length - 2, data.tree.windows.length - 1]);
|
|
@@ -27190,6 +27190,7 @@ replacement_history is an inference checkpoint, not new conversation events.`);
|
|
|
27190
27190
|
|
|
27191
27191
|
// src/boot/text.ts
|
|
27192
27192
|
var SHELF_FRESH_LIMIT = 3;
|
|
27193
|
+
var CHEATSHEET_BOOT_MAX_CHARS = 2048;
|
|
27193
27194
|
var MAP_BOOT_MAX_CHARS = 4096;
|
|
27194
27195
|
var WINDOW_IDENTITY_OPEN_TAG = "<notesoup:window_identity>";
|
|
27195
27196
|
var WINDOW_IDENTITY_CLOSE_TAG = "</notesoup:window_identity>";
|
|
@@ -27323,7 +27324,7 @@ function notesIndex(snapshot2, tools2, agentName, modelName) {
|
|
|
27323
27324
|
if (pinned.length === 0 && fresh.length === 0) continue;
|
|
27324
27325
|
const parts = pinned.map((row) => `${row.path === "MAP.md" ? "map" : "cheatsheet"}
|
|
27325
27326
|
|
|
27326
|
-
${indent(pinnedBodyForBoot(row.address, row.body))}`);
|
|
27327
|
+
${indent(pinnedBodyForBoot(row.address, row.body, row.path === "MAP.md" ? MAP_BOOT_MAX_CHARS : CHEATSHEET_BOOT_MAX_CHARS))}`);
|
|
27327
27328
|
if (fresh.length > 0) parts.push(`recent
|
|
27328
27329
|
|
|
27329
27330
|
${fresh.join("\n\n")}`);
|
|
@@ -27331,11 +27332,11 @@ ${fresh.join("\n\n")}`);
|
|
|
27331
27332
|
}
|
|
27332
27333
|
return shelves.length > 0 ? ["YOUR NOTES\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500", ...shelves].join("\n\n\n") : "YOUR NOTES\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nNone yet. A blank slate is a fine place to start \u2014 just don't finish there.";
|
|
27333
27334
|
}
|
|
27334
|
-
function pinnedBodyForBoot(address, body) {
|
|
27335
|
+
function pinnedBodyForBoot(address, body, maxChars) {
|
|
27335
27336
|
const chars = Array.from(body);
|
|
27336
|
-
if (chars.length <=
|
|
27337
|
-
return `${chars.slice(0,
|
|
27338
|
-
[truncated at ${
|
|
27337
|
+
if (chars.length <= maxChars) return body;
|
|
27338
|
+
return `${chars.slice(0, maxChars).join("")}
|
|
27339
|
+
[truncated at ${maxChars} chars; slim this page down, full body at \`${address}\`]`;
|
|
27339
27340
|
}
|
|
27340
27341
|
function renderBootBlock(data) {
|
|
27341
27342
|
const shown2 = /* @__PURE__ */ new Set([0, data.tree.windows.length - 2, data.tree.windows.length - 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);
|
|
@@ -65,7 +65,7 @@ function notesIndex(snapshot: NotesSnapshot, tools: BootToolNames, agentName: st
|
|
|
65
65
|
return title === undefined ? ` ${locator}` : ` ${title}\n ${locator}`;
|
|
66
66
|
});
|
|
67
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))}`);
|
|
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))}`);
|
|
69
69
|
if (fresh.length > 0) parts.push(`recent\n\n${fresh.join("\n\n")}`);
|
|
70
70
|
shelves.push(section(home.label, parts.join("\n\n")));
|
|
71
71
|
}
|
|
@@ -76,10 +76,10 @@ function notesIndex(snapshot: NotesSnapshot, tools: BootToolNames, agentName: st
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/** Each pinned page is bounded; the cut names where the rest lives. */
|
|
79
|
-
function pinnedBodyForBoot(address: string, body: string): string {
|
|
79
|
+
function pinnedBodyForBoot(address: string, body: string, maxChars: number): string {
|
|
80
80
|
const chars = Array.from(body);
|
|
81
|
-
if (chars.length <=
|
|
82
|
-
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}\`]`;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
export type BootWindowTree = {
|
package/src/boot/text.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** Each shelf shows this many of its own freshest pages beneath its pinned pages. */
|
|
2
2
|
export const SHELF_FRESH_LIMIT = 3;
|
|
3
|
-
/** Each pinned page
|
|
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>";
|