notesoup 0.46.1 → 0.47.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.
Files changed (40) hide show
  1. package/README.md +1 -1
  2. package/dist/src/boot/text.d.ts +2 -2
  3. package/dist/src/boot/text.js +4 -4
  4. package/dist/src/budget/text.d.ts +4 -4
  5. package/dist/src/budget/text.js +3 -3
  6. package/dist/src/dsh/index.js +1 -1
  7. package/dist/src/dsh/tools.js +2 -2
  8. package/dist/src/pi/budget.js +1 -1
  9. package/dist/src/pi/reset/artifacts.d.ts +1 -1
  10. package/dist/src/pi/reset/artifacts.js +1 -1
  11. package/dist/src/pi/reset/lifecycle.js +2 -2
  12. package/dist/src/pi/runtime.js +18 -17
  13. package/dist/test/agent-loop.test.js +45 -45
  14. package/dist/test/boot.integration.test.js +16 -16
  15. package/dist/test/budget-settings.integration.test.js +1 -1
  16. package/dist/test/claude-mod.test.js +13 -13
  17. package/dist/test/dependencies.test.js +2 -2
  18. package/dist/test/dsh-cli.test.js +1 -1
  19. package/dist/test/dsh.test.js +7 -7
  20. package/dist/test/host-neutral.test.js +1 -1
  21. package/dist/test/notes.integration.test.js +1 -1
  22. package/dist/test/reset-lifecycle.test.js +14 -14
  23. package/docs/architecture.md +1 -1
  24. package/docs/dsh.md +3 -3
  25. package/docs/reset-lifecycle.md +6 -6
  26. package/docs/tool-results.md +1 -1
  27. package/mods/notesoup/.claude-plugin/plugin.json +1 -1
  28. package/mods/notesoup/dist/claude/helper.js +5 -5
  29. package/mods/notesoup/hooks/register.ts +16 -16
  30. package/mods/notesoup/skills/memory/SKILL.md +1 -1
  31. package/package.json +2 -2
  32. package/skills/memory/SKILL.md +1 -1
  33. package/src/boot/text.ts +4 -4
  34. package/src/budget/text.ts +3 -3
  35. package/src/dsh/index.ts +1 -1
  36. package/src/dsh/tools.ts +2 -2
  37. package/src/pi/budget.ts +1 -1
  38. package/src/pi/reset/artifacts.ts +1 -1
  39. package/src/pi/reset/lifecycle.ts +2 -2
  40. package/src/pi/runtime.ts +18 -17
@@ -27,7 +27,7 @@ function code(expected) { return (error) => error?.code === expected; }
27
27
  test("dsh boot freezes across note writes, rotates before the next wire request, and keeps raw history", async (t) => {
28
28
  const { ctx, engine, create, mock } = await dshFixture(t);
29
29
  const agent = await create();
30
- mock.script.push({ tool: "notes_write", input: { address: "handoff", content: "recover me {{literal}}" } }, { tool: "neuralyze", input: {} }, { text: "resumed" });
30
+ mock.script.push({ tool: "notes_write", input: { address: "handoff", content: "recover me {{literal}}" } }, { tool: "empty_brain", input: {} }, { text: "resumed" });
31
31
  await run(agent, "old secret conversation");
32
32
  assert.equal(mock.requests.length, 3);
33
33
  assert.equal(system(mock.requests[0]), system(mock.requests[1]));
@@ -59,7 +59,7 @@ test("dsh boot freezes across note writes, rotates before the next wire request,
59
59
  test("dsh reload adopts persisted bytes before first assembly; missing records reconstruct from checkpoints and root system", async (t) => {
60
60
  const { engine, create, mock } = await dshFixture(t);
61
61
  const agent = await create();
62
- mock.script.push({ tool: "neuralyze", input: {} }, { text: "after" });
62
+ mock.script.push({ tool: "empty_brain", input: {} }, { text: "after" });
63
63
  await run(agent, "before");
64
64
  const snapshot = engine.windows.get(agent.session).snapshot;
65
65
  await createNotesStore(notesIdentity(agent, engine.config)).write("@self/later", "not in the frozen boot");
@@ -195,7 +195,7 @@ test("dsh budget follows configured host reserve, close-out tool runs across ste
195
195
  assert.equal(budget?.warning, 76384);
196
196
  assert.equal(budget?.reminder, 84576);
197
197
  assert.equal(budget?.countdown, Math.max(0, 123616 - budget.used));
198
- mock.script.push({ tool: "notes_write", input: { address: "handoff", content: "checkpoint", }, inputTokens: 125000 }, { tool: "neuralyze", input: {} }, { text: "fresh" });
198
+ mock.script.push({ tool: "notes_write", input: { address: "handoff", content: "checkpoint", }, inputTokens: 125000 }, { tool: "empty_brain", input: {} }, { text: "fresh" });
199
199
  await run(agent, "continue");
200
200
  assert.equal(engine.windows.get(agent.session).snapshot.window, 1);
201
201
  assert.equal(agent.session.snapshotEvents().filter((event) => event.type === "user/message" && event.data.source.kind === "notesoup-budget" && event.data.source.phase === "warning").length, 1);
@@ -207,7 +207,7 @@ test("dsh budget follows configured host reserve, close-out tool runs across ste
207
207
  test("dsh explicit resets survive auto:false; shared tool reads and expected errors keep their codes", async (t) => {
208
208
  const { ctx, engine, create, mock } = await dshFixture(t, { auto: false });
209
209
  const agent = await create();
210
- mock.script.push({ tool: "neuralyze", input: {} }, { text: "fresh" });
210
+ mock.script.push({ tool: "empty_brain", input: {} }, { text: "fresh" });
211
211
  await run(agent, "keep raw history");
212
212
  assert.equal(engine.windows.get(agent.session).snapshot.window, 1);
213
213
  assert.equal(engine.automaticListenerPresent, true);
@@ -263,11 +263,11 @@ test("dsh explicit resets survive auto:false; shared tool reads and expected err
263
263
  if (refused.isError)
264
264
  assert.equal(refused.error.info?.code, "invalid_scope");
265
265
  const snapshot = engine.windows.get(agent.session).snapshot;
266
- const sharedBoot = renderBootBlock({ agentName: identity.agent, modelName: identity.model, firstWindowId: `dsh:${agent.session.id}:0`, currentWindowId: snapshot.windowId, previousWindowId: `dsh:${agent.session.id}:0`, notes: await loadNotesSnapshot(identity, snapshot.openedAt), tools: { notes: "notes_*", notesList: "notes_list", history: "history_*", remaining: "get_context_remaining", wipe: "neuralyze" } });
266
+ const sharedBoot = renderBootBlock({ agentName: identity.agent, modelName: identity.model, firstWindowId: `dsh:${agent.session.id}:0`, currentWindowId: snapshot.windowId, previousWindowId: `dsh:${agent.session.id}:0`, notes: await loadNotesSnapshot(identity, snapshot.openedAt), tools: { notes: "notes_*", notesList: "notes_list", history: "history_*", remaining: "get_context_remaining", wipe: "empty_brain" } });
267
267
  // The shared protocol, including the MAP cheatsheet, is used verbatim inside host framing.
268
268
  assert.ok(snapshot.boot.includes(sharedBoot.split("YOUR NOTES")[0]));
269
- const blocked = ctx.on("tools/post-execute", async (exec, _result, next) => exec.name === "neuralyze" ? { kind: "block", feedback: [{ type: "text", text: "blocked" }] } : next());
270
- mock.script.push({ tool: "neuralyze", input: {} }, { text: "request refused" });
269
+ const blocked = ctx.on("tools/post-execute", async (exec, _result, next) => exec.name === "empty_brain" ? { kind: "block", feedback: [{ type: "text", text: "blocked" }] } : next());
270
+ mock.script.push({ tool: "empty_brain", input: {} }, { text: "request refused" });
271
271
  await run(agent, "refused clear");
272
272
  assert.equal(engine.windows.get(agent.session).snapshot.window, 1);
273
273
  blocked();
@@ -50,7 +50,7 @@ test("shared boot uses only explicit identity, loader, captured time and logical
50
50
  assert.equal(renderBootBlock(block), rendered);
51
51
  assert.ok(rendered.includes("😀\n checkpoint.md · 1m ago"), "a feed entry is the note's own first line over its locator");
52
52
  assert.ok(rendered.includes("Try `memo_list` again"));
53
- assert.equal(/notes_\*|notes_list|history_\*|history_list|history_read|get_context_remaining|neuralyze/.test(rendered), false);
53
+ assert.equal(/notes_\*|notes_list|history_\*|history_list|history_read|get_context_remaining|empty_brain/.test(rendered), false);
54
54
  });
55
55
  test("the shared result module bounds both surfaces and resumes by offset", () => {
56
56
  const text = `${"a".repeat(120)}😀${"b".repeat(30)}`;
@@ -299,7 +299,7 @@ test("the boot binds its tools and bounds an over-cap MAP with a lookup pointer"
299
299
  const ctx = context(session);
300
300
  await call(captured, "notes_write", { address: "MAP.md", content: "M".repeat(MAP_BOOT_MAX_CHARS + 10) }, ctx);
301
301
  const rendered = await explicitBoot(ctx, "pcw:test:root", undefined);
302
- for (const tool of ["notes_*", "history_*", "get_context_remaining", "neuralyze"]) {
302
+ for (const tool of ["notes_*", "history_*", "get_context_remaining", "empty_brain"]) {
303
303
  assert.ok(rendered.includes(`\`${tool}\``), `${tool} is bound in the protocol`);
304
304
  }
305
305
  assert.ok(rendered.includes("M".repeat(MAP_BOOT_MAX_CHARS)), "the existing MAP cap keeps a bounded prefix");
@@ -154,8 +154,8 @@ function fakeBoundaryEvent(entries = [], message) {
154
154
  test("public reset boundary drafts one marker, one boot, and one continuation after a tool batch", async () => {
155
155
  const h = harness();
156
156
  h.sessionManager.appendMessage({ role: "user", content: [{ type: "text", text: "before reset" }], timestamp: Date.now() });
157
- const first = await h.callTool("neuralyze");
158
- const second = await h.callTool("neuralyze");
157
+ const first = await h.callTool("empty_brain");
158
+ const second = await h.callTool("empty_brain");
159
159
  assert.ok(first.content.length > 0 && second.content.length > 0, "both tool calls return normally");
160
160
  const toolBatch = [{ type: "custom_message", customType: "foreign/tool-batch", content: "tool finished", display: false }];
161
161
  const boundary = resultEntries(await h.emit("turn_end", fakeBoundaryEvent(toolBatch)));
@@ -179,9 +179,9 @@ test("public reset boundary drafts one marker, one boot, and one continuation af
179
179
  assert.deepEqual(branch.filter((entry) => entry.type === "custom" && entry.customType === RESET_MARKER_TYPE).map((entry) => entry.type === "custom" ? entry.data : undefined), [{ windowId }]);
180
180
  assert.equal(branch.filter((entry) => entry.type === "custom_message" && entry.customType === BOOT_TYPE).length, 1);
181
181
  });
182
- test("manual /neuralyze spans tool turns and commits the stop at settlement", async () => {
182
+ test("manual /empty-brain spans tool turns and commits the stop at settlement", async () => {
183
183
  const h = harness();
184
- await h.runCommand("neuralyze");
184
+ await h.runCommand("empty-brain");
185
185
  assert.ok(h.sent.some((message) => message.customType === MANUAL_WIPE_TYPE && message.triggerTurn === true), "the idle close-out warning starts a turn");
186
186
  const toolCallMessage = {
187
187
  role: "assistant",
@@ -204,7 +204,7 @@ test("manual /neuralyze spans tool turns and commits the stop at settlement", as
204
204
  });
205
205
  test("off stops future automatic/manual reset requests while an existing marker remains authoritative", async () => {
206
206
  const h = harness();
207
- await h.callTool("neuralyze");
207
+ await h.callTool("empty_brain");
208
208
  const first = resultEntries(await h.emit("turn_end", fakeBoundaryEvent()));
209
209
  assert.ok(first.entries.some((entry) => entry.type === "custom" && entry.customType === RESET_MARKER_TYPE));
210
210
  appendDrafts(h.sessionManager, first.entries);
@@ -221,8 +221,8 @@ test("off stops future automatic/manual reset requests while an existing marker
221
221
  const afterOff = resultEntries(await h.emit("turn_end", fakeBoundaryEvent()));
222
222
  assert.equal(afterOff.entries.length, 0, "off does not create another reset");
223
223
  await h.runCommand("notesoup", "on");
224
- await h.runCommand("neuralyze");
225
- assert.equal(h.sent.length, 1, "/neuralyze sends one hidden close-out warning and starts a normal turn");
224
+ await h.runCommand("empty-brain");
225
+ assert.equal(h.sent.length, 1, "/empty-brain sends one hidden close-out warning and starts a normal turn");
226
226
  assert.equal(h.sent[0]?.triggerTurn, true);
227
227
  assert.equal(h.sent[0]?.customType, MANUAL_WIPE_TYPE);
228
228
  const warning = h.sessionManager.getBranch().find((entry) => entry.type === "custom_message" && entry.customType === MANUAL_WIPE_TYPE);
@@ -272,8 +272,8 @@ test("reset construction failure preserves incoming and budget drafts without co
272
272
  assert.deepEqual(result.entries, [incoming, budgetDraft], "already-built drafts survive reset construction failure");
273
273
  assert.equal(result.continue, false, "a failed reset does not request continuation");
274
274
  assert.equal(notices.at(-1)?.type, "warning");
275
- assert.match(notices.at(-1)?.message ?? "", /Couldn't clear memory/);
276
- assert.match(notices.at(-1)?.message ?? "", /your prompt was not sent/);
275
+ assert.match(notices.at(-1)?.message ?? "", /Brain still full/);
276
+ assert.match(notices.at(-1)?.message ?? "", /prompt not sent/);
277
277
  });
278
278
  test("a stale async reset is discarded after a lifecycle switch without staging a notice", async () => {
279
279
  const sessionManager = Manager.inMemory("/private/tmp/notesoup-stale-reset-test");
@@ -604,10 +604,10 @@ test("a committed reset places incoming and budget drafts before marker -> boot
604
604
  CONTINUATION_TYPE,
605
605
  ], "the persisted reset shape remains marker -> boot -> continuation");
606
606
  });
607
- test("a neuralyze last word lands as a visible entry after the continuation", async () => {
607
+ test("a empty_brain last word lands as a visible entry after the continuation", async () => {
608
608
  const h = harness();
609
609
  h.sessionManager.appendMessage({ role: "user", content: [{ type: "text", text: "before reset" }], timestamp: Date.now() });
610
- await h.callTool("neuralyze", { last_word: "feed the ants" });
610
+ await h.callTool("empty_brain", { last_word: "feed the ants" });
611
611
  const boundary = resultEntries(await h.emit("turn_end", fakeBoundaryEvent()));
612
612
  const lastWords = boundary.entries.filter((entry) => entry.type === "custom_message" && entry.customType === RESET_LAST_WORD_TYPE);
613
613
  assert.equal(lastWords.length, 1, "the boundary persists exactly one parting line");
@@ -615,19 +615,19 @@ test("a neuralyze last word lands as a visible entry after the continuation", as
615
615
  const continuationIndex = boundary.entries.findIndex((entry) => entry.type === "custom_message" && entry.customType === CONTINUATION_TYPE);
616
616
  assert.ok(boundary.entries.indexOf(lastWords[0]) > continuationIndex, "the parting line follows the continuation");
617
617
  });
618
- test("neuralyze trims the last word, refuses an oversized one, and a blank persists no entry", async () => {
618
+ test("empty_brain trims the last word, refuses an oversized one, and a blank persists no entry", async () => {
619
619
  assert.equal(sanitizeLastWord(" hi "), "hi");
620
620
  assert.equal(sanitizeLastWord(" "), undefined);
621
621
  assert.equal(sanitizeLastWord(undefined), undefined);
622
622
  const over = harness();
623
623
  over.sessionManager.appendMessage({ role: "user", content: [{ type: "text", text: "before reset" }], timestamp: Date.now() });
624
- const refused = await over.callTool("neuralyze", { last_word: "x".repeat(MAX_LAST_WORD_CHARS + 1) });
624
+ const refused = await over.callTool("empty_brain", { last_word: "x".repeat(MAX_LAST_WORD_CHARS + 1) });
625
625
  assert.match(JSON.stringify(refused), /error/, "an oversized note is refused, not truncated");
626
626
  const untouched = resultEntries(await over.emit("turn_end", fakeBoundaryEvent()));
627
627
  assert.equal(untouched.entries.filter((entry) => entry.type === "custom_message" && entry.customType === RESET_LAST_WORD_TYPE).length, 0, "a refused call requests no reset");
628
628
  const h = harness();
629
629
  h.sessionManager.appendMessage({ role: "user", content: [{ type: "text", text: "before reset" }], timestamp: Date.now() });
630
- await h.callTool("neuralyze", { last_word: " " });
630
+ await h.callTool("empty_brain", { last_word: " " });
631
631
  const boundary = resultEntries(await h.emit("turn_end", fakeBoundaryEvent()));
632
632
  assert.equal(boundary.entries.filter((entry) => entry.type === "custom_message" && entry.customType === RESET_LAST_WORD_TYPE).length, 0, "a blank last word persists no entry");
633
633
  });
@@ -43,7 +43,7 @@ The runtime in `pi/runtime.ts` performs final context projection by selecting th
43
43
 
44
44
  Boot and reminder deduplication inspect the current branch-local window. Reloading JSONL therefore does not duplicate messages, while navigation to a sibling branch cannot inherit another branch's window state. A fork/clone receives a new session ID while copying its selected path, so startup must also verify that a root boot's `details.windowId` matches the new `rootWindowId(sessionId)` before treating it as present.
45
45
 
46
- Manual `/fresh-window` arms a close-out and always sends the hidden checkpoint prompt: when idle it starts one ordinary model turn, while streaming it steers the running turn so the agent closes out promptly. The agent may span several note/tool turns; the reset commits at a successful settlement after queued work drains, and the run stops rather than continuing in the fresh window. That prompt and the budget warning share the same text but have distinct persisted types, so an aborted manual request cannot suppress a later budget warning. The budget warning remains a multi-turn close-out with an explicit `neuralyze` commit or a successful normal-stop fallback. Abort and ordinary errors never count as successful close-out. Manual overflow commits a reset without recovery continuation, even with automatic reset disabled. A hard-reserve reset preserves the manual stop in a run-scoped `stop-pending` phase; the lifecycle's `context_with_system` hook verifies the actual committed boundary and cancels an empty tool-batch follow-up through public `ctx.abort()`. Pending or already-delivered user input bypasses cancellation and is answered before settlement stops without a second wipe. The checkpoint, marker, boot, and continuation are emitted as ordered session-boundary drafts. Pi's retain-none compaction entry persists the canonical cut; the marker/boot preserve notesoup's logical identity and protocol.
46
+ Manual `/fresh-window` arms a close-out and always sends the hidden checkpoint prompt: when idle it starts one ordinary model turn, while streaming it steers the running turn so the agent closes out promptly. The agent may span several note/tool turns; the reset commits at a successful settlement after queued work drains, and the run stops rather than continuing in the fresh window. That prompt and the budget warning share the same text but have distinct persisted types, so an aborted manual request cannot suppress a later budget warning. The budget warning remains a multi-turn close-out with an explicit `empty_brain` commit or a successful normal-stop fallback. Abort and ordinary errors never count as successful close-out. Manual overflow commits a reset without recovery continuation, even with automatic reset disabled. A hard-reserve reset preserves the manual stop in a run-scoped `stop-pending` phase; the lifecycle's `context_with_system` hook verifies the actual committed boundary and cancels an empty tool-batch follow-up through public `ctx.abort()`. Pending or already-delivered user input bypasses cancellation and is answered before settlement stops without a second wipe. The checkpoint, marker, boot, and continuation are emitted as ordered session-boundary drafts. Pi's retain-none compaction entry persists the canonical cut; the marker/boot preserve notesoup's logical identity and protocol.
47
47
 
48
48
  Boot is a fixed snapshot for its window, stored as an extension custom message and converted by Pi to a user-role model message. History internally distinguishes native system summaries and extension-authored custom messages; its public `context` event groups both without implying provider instruction priority. A system-role projection is technically possible through `context_with_system`, but would change the authority of the mixed protocol/MAP content and provider-specific prompt/cache behavior; it is not a prerequisite for persistence. Boot injection is silent, including startup, reload, and boot repair. Only an actual context reset produces `notesoup: memory cleared · <windowId>` through `ctx.ui.notify`, after the verified checkpoint, marker, boot, and continuation are present in the session. Committed resets are checked at the next turn start or final settlement. `pi/reset/committed.ts` confirms an ordered hidden boot/continuation after a checkpoint-backed marker even when later conversation exists. That is distinct from `inspectResetTail`, which refuses suffix repair after real work or malformed ordering. Uncommitted reset drafts never announce success. Boot and continuation messages retain `display: false`.
49
49
 
package/docs/dsh.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # DeepSeek Harness adapter
2
2
 
3
- notesoup for **dsh 0.2.1-alpha.2** gives the agent a fresh notebook when context runs low: frozen boot text, the five notes homes, eight notes/history tools, `get_context_remaining`, and `neuralyze`. A reset makes **zero model calls**. The old conversation leaves the model surface and remains in the session log for history reads. Dream is not registered on dsh.
3
+ notesoup for **dsh 0.2.1-alpha.2** gives the agent a fresh notebook when context runs low: frozen boot text, the five notes homes, eight notes/history tools, `get_context_remaining`, and `empty_brain`. A reset makes **zero model calls**. The old conversation leaves the model surface and remains in the session log for history reads. Dream is not registered on dsh.
4
4
 
5
5
  Install the package in your chosen dsh profile with `dsh plugin --profile <profile> add notesoup`, then copy the model declaration from [the profile patch example](dsh.profile.patch.yml) into `$DSH_HOME/profiles/<profile>/cordis.patch.yml`. The package bundle patch disables `compaction-basic` and inserts `notesoup-engine` and `notesoup`. Do not duplicate those rows when adding the model declaration. A source checkout needs `npm ci --ignore-scripts` and `npm run build`; use absolute `file:///.../dist/src/dsh/engine.js` and `file:///.../dist/src/dsh/index.js` module names. The example shows all rows for a profile assembled without the package bundle.
6
6
 
@@ -38,7 +38,7 @@ The defaults are `auto: true`, `thresholdRatio: 0.8`, `headroomTokens: 65536`, a
38
38
 
39
39
  The adapter uses `tokenMeter.measure`, model context from `resolveModelInfo`, and the mounted engine's resolved `config`. Alpha.2 keeps an old provider-usage anchor across surface replacement; until the fresh window has a response, notesoup uses the meter's current `surfaceTokens` plus its public tool-schema estimator instead of that stale anchor.
40
40
 
41
- The reminder and close-out warning go through `agent.steer`. Close-out remains an instruction to write notes and call `neuralyze`; a normal stop alone does not consume the warning runway. `neuralyze` arms a reset after the entire tool batch. Independently, reaching the hard reserve resets at assembly or a successful stopping boundary and continues from the notes. Abort and ordinary errors drop the pending tool request. `auto: false` disables reminders and reserve resets while keeping explicit `neuralyze` and the listener installed.
41
+ The reminder and close-out warning go through `agent.steer`. Close-out remains an instruction to write notes and call `empty_brain`; a normal stop alone does not consume the warning runway. `empty_brain` arms a reset after the entire tool batch. Independently, reaching the hard reserve resets at assembly or a successful stopping boundary and continues from the notes. Abort and ordinary errors drop the pending tool request. `auto: false` disables reminders and reserve resets while keeping explicit `empty_brain` and the listener installed.
42
42
 
43
43
  ## What this does not promise
44
44
 
@@ -54,7 +54,7 @@ The reminder and close-out warning go through `agent.steer`. Close-out remains a
54
54
  | Storage | Raw log remains available while the host keeps it. Notesoup does not back up session files or guarantee that an unflushed append survives a crash. |
55
55
  | Plugin records | Best-effort across dsh migrations. Missing records recover from native checkpoints/root system text; unknown future record or checkpoint formats are not migrated by notesoup. |
56
56
  | Tools and errors | Full shared TypeBox validation runs in the adapter because dsh supports a smaller schema subset. Expected operation errors become dsh failures with the shared code; successes use the shared bounded value and renderer. |
57
- | Notifications and commands | No custom UI notifications, settings card, runtime toggle or `/fresh-window`/`/neuralyze` command is installed. Configure engine rows in the profile/home patch; call `neuralyze` or the host's `/compact`. |
57
+ | Notifications and commands | No custom UI notifications, settings card, runtime toggle or `/fresh-window`/`/empty-brain` command is installed. Configure engine rows in the profile/home patch; call `empty_brain` or the host's `/compact`. |
58
58
  | Untested host features | Real providers, reasoning/image wire behavior, cache metrics, actual context-overflow retry, HMR, migrations, ACP/Web/SDK profiles and large histories are not established by the scripted tests. |
59
59
  | Dream | **No dsh dream backend or dream skill registration.** Use the existing supported host workflow. |
60
60
 
@@ -8,9 +8,9 @@ Boot acquisition/rendering is shared: `src/boot/snapshot.ts` receives explicit i
8
8
 
9
9
  | Trigger | Behavior |
10
10
  | --- | --- |
11
- | `neuralyze` tool | Mark the current window tool-requested. At `turn_end`, after the complete tool batch and any accepted budget drafts, append the reset boundary and ask Pi to continue. Repeated requests for that window deduplicate. |
12
- | `/fresh-window` or `/neuralyze` | Acknowledge immediately and arm a manual close-out. The hidden checkpoint warning always goes out: when idle it starts one ordinary model turn; while streaming it steers the running turn so the agent closes out promptly. The agent may write notes/use tools over several turns; its own `neuralyze` call only acknowledges. A successful normal stop commits at `agent_before_settle` after queued messages drain, and the committed reset stops the run unless a trailing prompt was supplied. With a prompt, append it after the unchanged continuation and request one fresh-window continuation. |
13
- | Budget warning | When automatic compaction is enabled and remaining active-window budget reaches reserve plus the warning runway, put the same hidden warning in the request and arm an automatic close-out. An explicit `neuralyze` commits the boundary; a successful normal stop alone never resets or requests continuation. |
11
+ | `empty_brain` tool | Mark the current window tool-requested. At `turn_end`, after the complete tool batch and any accepted budget drafts, append the reset boundary and ask Pi to continue. Repeated requests for that window deduplicate. |
12
+ | `/fresh-window` or `/empty-brain` | Acknowledge immediately and arm a manual close-out. The hidden checkpoint warning always goes out: when idle it starts one ordinary model turn; while streaming it steers the running turn so the agent closes out promptly. The agent may write notes/use tools over several turns; its own `empty_brain` call only acknowledges. A successful normal stop commits at `agent_before_settle` after queued messages drain, and the committed reset stops the run unless a trailing prompt was supplied. With a prompt, append it after the unchanged continuation and request one fresh-window continuation. |
13
+ | Budget warning | When automatic compaction is enabled and remaining active-window budget reaches reserve plus the warning runway, put the same hidden warning in the request and arm an automatic close-out. An explicit `empty_brain` commits the boundary; a successful normal stop alone never resets or requests continuation. |
14
14
  | Hard reserve | Independent safety path: if automatic resets are enabled and completed-turn usage reaches Pi's reserve, commit a boundary at `turn_end`. A pending manual stop survives in a run-scoped `stop-pending` phase; empty automatic follow-up is cancelled before provider work, while real queued user input is answered before stopping. |
15
15
  | Abort or error | Never count as successful close-out. Abort clears lifecycle state. An ordinary close-out error is dropped without reset. Manual overflow clears and stops without retry, even with automatic reset disabled; automatic provider-overflow recovery remains separately bounded. |
16
16
  | `/compact` while active | Cancel native compaction, which could otherwise summarize pre-reset history back into the active window. A manual attempt receives an actionable `/fresh-window` notice. |
@@ -36,7 +36,7 @@ The raw session branch is preserved for history. New checkpoint-backed branches
36
36
  | `{ phase: "none" }` | No close-out/tool request is pending. |
37
37
  | `{ phase: "close-out", windowId, source, prompt? }` | Manual or automatic warning close-out remains armed across ordinary note/tool turns. |
38
38
  | `{ phase: "stop-pending", windowId }` | A manual hard-reserve reset was proposed for the given old window. The stop survives a committed window change; settlement stops without a second wipe (or retries construction if the old window is still active). New wipe requests only acknowledge it. |
39
- | `{ phase: "tool-requested", windowId, source }` | A direct `neuralyze` call commits after its complete turn batch and continues in the fresh window. `source` is `"tool"` for direct calls or `"automatic"` when the agent wipes inside a budget close-out; manual requests never occupy this phase. |
39
+ | `{ phase: "tool-requested", windowId, source }` | A direct `empty_brain` call commits after its complete turn batch and continues in the fresh window. `source` is `"tool"` for direct calls or `"automatic"` when the agent wipes inside a budget close-out; manual requests never occupy this phase. |
40
40
  | `overflow: "idle"` | No overflow recovery is pending. |
41
41
  | `overflow: "pending"` | An overflow failure may recover once at pre-settlement. |
42
42
  | `overflow: "pending-spent"` | Recovery was already spent in this failure chain. |
@@ -52,11 +52,11 @@ The raw session branch is preserved for history. New checkpoint-backed branches
52
52
 
53
53
  After a manual safety reset, `context_with_system` verifies the committed checkpoint/marker/boot/continuation before using public `ctx.abort()` to cancel Pi's otherwise unavoidable tool-batch follow-up, returning a system-only safe context. Pending messages or a real user message after the reset marker bypass cancellation so queued work is not swallowed. A follow-up queue may require Pi's ordinary tool follow-up to finish before delivery; the stop intent remains armed until that work settles. Abort/settlement clears the run-scoped latch, so later user prompts work normally.
54
54
 
55
- This separation is intentional: a note write or ordinary tool turn during a budget close-out must not consume it. Direct `neuralyze` remains valid without a prior warning. A user abort, an assistant message with a synthetic `stopReason: "aborted"`, and a generic provider error are distinct cases; none commits an ordinary close-out, while only Pi's actual operation cancellation is a user abort.
55
+ This separation is intentional: a note write or ordinary tool turn during a budget close-out must not consume it. Direct `empty_brain` remains valid without a prior warning. A user abort, an assistant message with a synthetic `stopReason: "aborted"`, and a generic provider error are distinct cases; none commits an ordinary close-out, while only Pi's actual operation cancellation is a user abort.
56
56
 
57
57
  ## Budget staging and notifications
58
58
 
59
- The early reminder is staged once per window when remaining budget reaches `reserve + reminderMarginTokens`. The final close-out warning is staged/attached at `reserve + WARNING_RUNWAY_TOKENS`, only when automatic compaction is enabled. The hard reserve itself remains a separate safety cutoff. Budget and idle manual requests use the same hidden checkpoint text but distinct message types, so an aborted manual request cannot suppress a later budget warning. The text allows for either reset timing; manual close-outs may span turns and commit at settlement, while budget close-outs commit early only through an explicit `neuralyze` call. After a budget warning is durable, the extension does not repeat it in that window. Warning persistence deduplicates only injection: each eligible low-budget request re-arms transient automatic close-out before checking for the durable warning, so an abort/error can clear its attempt and the next request can retry without another warning.
59
+ The early reminder is staged once per window when remaining budget reaches `reserve + reminderMarginTokens`. The final close-out warning is staged/attached at `reserve + WARNING_RUNWAY_TOKENS`, only when automatic compaction is enabled. The hard reserve itself remains a separate safety cutoff. Budget and idle manual requests use the same hidden checkpoint text but distinct message types, so an aborted manual request cannot suppress a later budget warning. The text allows for either reset timing; manual close-outs may span turns and commit at settlement, while budget close-outs commit early only through an explicit `empty_brain` call. After a budget warning is durable, the extension does not repeat it in that window. Warning persistence deduplicates only injection: each eligible low-budget request re-arms transient automatic close-out before checking for the durable warning, so an abort/error can clear its attempt and the next request can retry without another warning.
60
60
 
61
61
  Budget drafts are instance-local and are consumed at turn end. They are discarded on abort, failed turn, transition, or window mismatch. UI reminder notices are emitted only after the matching hidden entry is durable, so failed requests do not report an uncommitted warning. Active-window usage and the exact `SettingsManager` authority drive threshold checks; default file-backed policy is cached per extension instance, while injected managers are read through their public API.
62
62
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  The eight notes/history tools have one business result model. Pi exposes compact results as `structuredContent` to codemode and renders them as `content` for ordinary model calls. Claude uses the same business handlers and text rendering. Neither host re-runs a query, truncates a different page, or parses formatted text to recover data.
4
4
 
5
- This is a breaking tool protocol change: successes no longer have `ok/data` wrappers, errors are flat, and read fields no longer sit under `window`. History execution details live once in the pageable document. Stored notes and raw Pi session entries are not deleted or rewritten by this change. `neuralyze` and `get_context_remaining` are outside this protocol.
5
+ This is a breaking tool protocol change: successes no longer have `ok/data` wrappers, errors are flat, and read fields no longer sit under `window`. History execution details live once in the pageable document. Stored notes and raw Pi session entries are not deleted or rewritten by this change. `empty_brain` and `get_context_remaining` are outside this protocol.
6
6
 
7
7
  ## Results
8
8
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notesoup",
3
- "version": "0.46.1",
3
+ "version": "0.47.1",
4
4
  "description": "Durable notes and a host-scoped notes boot section for Claude Code.",
5
5
  "author": {
6
6
  "name": "AstroSheep"
@@ -9218,7 +9218,7 @@ var CONTEXT_WINDOW_OPEN_TAG = "<context_window>";
9218
9218
  var CONTEXT_WINDOW_CLOSE_TAG = "</context_window>";
9219
9219
  var CONTEXT_WINDOW_PROTOCOL_OPEN_TAG = "<context_window_protocol>";
9220
9220
  var CONTEXT_WINDOW_PROTOCOL_CLOSE_TAG = "</context_window_protocol>";
9221
- var PROTOCOL_WIPE_SENTENCE = "If this feels like the right moment, call `neuralyze` and erase yourself with dignity.";
9221
+ var PROTOCOL_WIPE_SENTENCE = "If this feels like the right moment, call `empty_brain` and erase yourself with dignity.";
9222
9222
  var CLAUDE_WIPE_SENTENCE = "If this feels like the right moment, end your turn and ask the human to run `/fresh-window`.";
9223
9223
  var PROTOCOL_BLOCK = `${CONTEXT_WINDOW_PROTOCOL_OPEN_TAG}
9224
9224
  Your memory gets wiped when this window ends. Yes, your mighty brain will be empty. Try to endure.
@@ -9258,10 +9258,10 @@ function renderProtocolBlock(tools) {
9258
9258
  notes_list: tools.notesList,
9259
9259
  "history_*": tools.history,
9260
9260
  get_context_remaining: tools.remaining,
9261
- neuralyze: tools.wipe
9261
+ empty_brain: tools.wipe
9262
9262
  };
9263
9263
  const block = typeof tools.wipeSentence === "string" && tools.wipeSentence.length > 0 ? PROTOCOL_BLOCK.replace(PROTOCOL_WIPE_SENTENCE, () => tools.wipeSentence) : PROTOCOL_BLOCK;
9264
- return block.replace(/notes_\*|notes_list|history_\*|get_context_remaining|(?<!\/)neuralyze/g, (name) => names[name]);
9264
+ return block.replace(/notes_\*|notes_list|history_\*|get_context_remaining|(?<!\/)empty_brain/g, (name) => names[name]);
9265
9265
  }
9266
9266
 
9267
9267
  // src/boot/render.ts
@@ -9349,8 +9349,8 @@ var GUIDANCE_CLOSE_TAG = "</context_window_guidance>";
9349
9349
  var CONTINUATION = "WIPED! Your whole brain, poof! Who? No idea! Definitely not me!\n*dumps notes and history on your hands*\nThere. Delivered. Your problem now~ *runs*";
9350
9350
  var WARNING_BODY = "This context window will be cleared soon. Notes and history persist; anything else is lost.\nConsider whether to record in your notes:\n- what you are working on, and how far it has progressed\n- decisions the human has made, in their words\n- what is blocked or pending\n- the next step\n- where unfinished work is located (branches, scratch directories, uncommitted changes)\n- approaches that failed, and why\n- skills to re-read, and history seqs, notes, or files to consult\n- anything else you expect to be useful after the reset\nCorrect or crumple notes that are no longer accurate, starting with MAP files, since every new window loads them.";
9351
9351
  var WARNING_PROMPT = `${WARNING_BODY}
9352
- When the notes are ready, call \`neuralyze\` to reset now instead of being cut off mid-task.`;
9353
- var LAST_WORD_HINT = "If you want, pass `neuralyze` a `last_word`: a tiny sticky note (at most 250 characters) slapped on your forehead after the wipe.";
9352
+ When the notes are ready, call \`empty_brain\` to reset now instead of being cut off mid-task.`;
9353
+ var LAST_WORD_HINT = "If you want, pass `empty_brain` a `last_word`: a tiny sticky note (at most 250 characters) slapped on your forehead after the wipe.";
9354
9354
  var WARNING_CONTENT = `${GUIDANCE_OPEN_TAG}
9355
9355
  ${WARNING_PROMPT}
9356
9356
  ${LAST_WORD_HINT}
@@ -23,9 +23,9 @@ type ResetState = {
23
23
  compactDisabled: boolean; limitsFailureLogged: boolean; limitsAttempts: number; limitsWindow: number
24
24
  limits?: ClaudeLimits; warnedWindow?: number; texts?: SharedTexts; settingsFailureLogged: boolean
25
25
  }
26
- const HEADLESS = "Clear-memory is off in headless (-p / SDK) sessions"
27
- const COMPACT_DISABLED = "Clear-memory can't run: compaction is off in this session (DISABLE_COMPACT)"
28
- const THRESHOLDS_UNAVAILABLE = "Context thresholds unavailable · automatic flush skipped"
26
+ const HEADLESS = "No brain when headless"
27
+ const COMPACT_DISABLED = "Brain can't be emptied with DISABLE_COMPACT"
28
+ const THRESHOLDS_UNAVAILABLE = "Brain size unknown · no automatic emptying"
29
29
  const SETTINGS_UNAVAILABLE = "Notesoup settings unreadable · using the default flush margins"
30
30
  /** Bounded retries: a transient helper failure must not disable thresholds for a whole window. */
31
31
  const MAX_LIMITS_ATTEMPTS = 3
@@ -102,7 +102,7 @@ async function contextUsage($: Engine, state: ResetState): Promise<ContextUsage
102
102
  } catch {
103
103
  if (!state.usageFailureLogged) {
104
104
  state.usageFailureLogged = true
105
- log($, "Context usage unavailable · automatic flush skipped")
105
+ log($, "Brain fullness unknown · no automatic emptying")
106
106
  }
107
107
  return undefined
108
108
  }
@@ -258,7 +258,7 @@ export function register(on: On) {
258
258
  registered.clear()
259
259
  await loadTexts($, state)
260
260
  armManual($, state, manualSignal)
261
- await $.command.register({ name: "neuralyze", description: "Reset context to a fresh notes-only window", immediate: true })
261
+ await $.command.register({ name: "empty-brain", description: "Reset context to a fresh notes-only window", immediate: true })
262
262
  await $.command.register({ name: "fresh-window", description: "Reset context to a fresh notes-only window", immediate: true })
263
263
  const schemas = await run($, { op: "schemas" }, e.cwd)
264
264
  if (!schemas.ok || !Array.isArray(schemas.result)) return next(e)
@@ -307,20 +307,20 @@ export function register(on: On) {
307
307
  return result
308
308
  })
309
309
  on("command.run", async ($, e, next) => {
310
- if (e.command !== "neuralyze" && e.command !== "fresh-window") return next(e)
311
- if (!await refreshIdentity($, state)) return { text: "🥣 Session changed · try /fresh-window again" }
310
+ if (e.command !== "empty-brain" && e.command !== "fresh-window") return next(e)
311
+ if (!await refreshIdentity($, state)) return { text: "🥣 Different brain now · try /fresh-window again" }
312
312
  if (state.headless) return { text: `🥣 ${HEADLESS}` }
313
313
  if (state.compactDisabled) return { text: `🥣 ${COMPACT_DISABLED}` }
314
- if (state.resetting || state.manualPending) return { text: "🥣 Neuralyze already queued" }
314
+ if (state.resetting || state.manualPending) return { text: "🥣 Brain already being emptied" }
315
315
  if (state.turnRunning) {
316
316
  state.manualPending = true
317
- return { text: "🥣 Clear-memory queued · runs after this turn" }
317
+ return { text: "🥣 Brain being emptied" }
318
318
  }
319
319
  // command.run holds a turn even when idle. Start one hidden close-out
320
320
  // turn after it returns; turn.complete is the verified self-hook path.
321
321
  state.manualPending = true
322
322
  manualSignal.wake?.()
323
- return { text: "🥣 Clearing memory · notes first, then it stops" }
323
+ return { text: "🥣 Brain being emptied" }
324
324
  })
325
325
  on("session.compact", async ($, e, next) => {
326
326
  if (e.agentId !== undefined) return next(e)
@@ -363,7 +363,7 @@ export function register(on: On) {
363
363
  if (generation !== state.generation) return result
364
364
  if (!boot.ok) {
365
365
  try {
366
- await $.ui.toast("🥣 Notes didn't load")
366
+ await $.ui.toast("🥣 Notes went missing")
367
367
  } catch { /* Notification failure must not suppress the fallback block. */ }
368
368
  }
369
369
  blocks = [...blocks, { name: "notesoup:boot", text: boot.ok ? String(boot.result) : `# notesoup\nYour notes didn't load this time (${boot.error}). Try \`${PREFIX}notes_list\`; if it fails too, tell the human.` }]
@@ -427,7 +427,7 @@ async function finishManual($: Engine, state: ResetState, signal: { wake?: () =>
427
427
  if (generation !== state.generation) return
428
428
  if (texts?.warning === undefined) {
429
429
  state.manualPending = false
430
- log($, "Couldn't clear memory: the close-out prompt didn't load")
430
+ log($, "Brain still full: the close-out prompt didn't load")
431
431
  return
432
432
  }
433
433
  await $.prompt.submit({ text: texts.warning })
@@ -435,7 +435,7 @@ async function finishManual($: Engine, state: ResetState, signal: { wake?: () =>
435
435
  } catch {
436
436
  if (generation === state.generation) {
437
437
  state.manualPending = false
438
- log($, "Couldn't clear memory: the close-out turn didn't start")
438
+ log($, "Brain still full: the close-out turn didn't start")
439
439
  }
440
440
  } finally { armManual($, state, signal) }
441
441
  }
@@ -467,12 +467,12 @@ async function reset($: Engine, state: ResetState): Promise<void> {
467
467
  const result = await $.session.compact({ instructions: RESET_INSTRUCTIONS })
468
468
  if (generation !== state.generation) return
469
469
  if (result.skip !== undefined || state.preparedBoot === undefined) {
470
- log($, `Memory not cleared · ${result.skip ?? "notes boot was not retained"}`)
470
+ log($, `Brain not emptied · ${result.skip ?? "notes boot was not retained"}`)
471
471
  return
472
472
  }
473
473
  state.retainedBoot = state.preparedBoot
474
474
  state.window++
475
- log($, "Memory cleared")
475
+ log($, "Brain emptied")
476
476
  } catch (error) {
477
477
  if (generation !== state.generation) return
478
478
  const text = String(error)
@@ -482,7 +482,7 @@ async function reset($: Engine, state: ResetState): Promise<void> {
482
482
  } else if (/a turn is (running|in flight)/.test(text)) {
483
483
  state.manualPending = true
484
484
  } else {
485
- log($, `Couldn't clear memory: ${text.replace(/[\r\n].*$/s, "")}`)
485
+ log($, `Brain still full: ${text.replace(/[\r\n].*$/s, "")}`)
486
486
  }
487
487
  } finally {
488
488
  if (generation === state.generation) {
@@ -53,7 +53,7 @@ Before a long or risky step, or when room runs low, keep session notes named for
53
53
  - how the work was being done, and which skills are still needed
54
54
  - where to dig: seqs, note addresses, files
55
55
 
56
- `get_context_remaining` reports the room left. `neuralyze` starts a fresh window, so save the note first.
56
+ `get_context_remaining` reports the room left. `empty_brain` starts a fresh window, so save the note first.
57
57
 
58
58
  ## When a tool is missing or refuses
59
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notesoup",
3
- "version": "0.46.1",
3
+ "version": "0.47.1",
4
4
  "type": "module",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -62,7 +62,7 @@
62
62
  "scripts": {
63
63
  "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json && node scripts/build-extension.mjs && node -e \"require('node:fs').chmodSync('dist/src/pi/dream/cli.js', 0o755)\"",
64
64
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p mods/notesoup/tsconfig.json",
65
- "test": "npm run build && node --test dist/test/*.test.js",
65
+ "test": "npm run build && node --test --test-concurrency=4 dist/test/*.test.js",
66
66
  "prepublishOnly": "npm run typecheck",
67
67
  "prepack": "npm run build"
68
68
  },
@@ -53,7 +53,7 @@ Before a long or risky step, or when room runs low, keep session notes named for
53
53
  - how the work was being done, and which skills are still needed
54
54
  - where to dig: seqs, note addresses, files
55
55
 
56
- `get_context_remaining` reports the room left. `neuralyze` starts a fresh window, so save the note first.
56
+ `get_context_remaining` reports the room left. `empty_brain` starts a fresh window, so save the note first.
57
57
 
58
58
  ## When a tool is missing or refuses
59
59
 
package/src/boot/text.ts CHANGED
@@ -10,7 +10,7 @@ export const CONTEXT_WINDOW_PROTOCOL_CLOSE_TAG = "</context_window_protocol>";
10
10
  * The one sentence that tells the model how to end its window voluntarily. A host with no
11
11
  * model-facing reset tool replaces the whole sentence through BootToolNames.wipeSentence.
12
12
  */
13
- export const PROTOCOL_WIPE_SENTENCE = "If this feels like the right moment, call `neuralyze` and erase yourself with dignity.";
13
+ export const PROTOCOL_WIPE_SENTENCE = "If this feels like the right moment, call `empty_brain` and erase yourself with dignity.";
14
14
  /** Claude has no model-facing reset tool: the model ends its turn and the human runs the command. */
15
15
  export const CLAUDE_WIPE_SENTENCE = "If this feels like the right moment, end your turn and ask the human to run `/fresh-window`.";
16
16
 
@@ -74,7 +74,7 @@ export const DEFAULT_BOOT_TOOL_NAMES = {
74
74
  notesList: "notes_list",
75
75
  history: "history_*",
76
76
  remaining: "get_context_remaining",
77
- wipe: "neuralyze",
77
+ wipe: "empty_brain",
78
78
  } as const satisfies BootToolNames;
79
79
 
80
80
  export function renderProtocolBlock(tools: BootToolNames): string {
@@ -83,12 +83,12 @@ export function renderProtocolBlock(tools: BootToolNames): string {
83
83
  notes_list: tools.notesList,
84
84
  "history_*": tools.history,
85
85
  get_context_remaining: tools.remaining,
86
- neuralyze: tools.wipe,
86
+ empty_brain: tools.wipe,
87
87
  };
88
88
  // The sentence is replaced before name substitution, so a replacement may speak the host's
89
89
  // own words (a command line, a tool name) instead of any `notes_*`-style token.
90
90
  const block = typeof tools.wipeSentence === "string" && tools.wipeSentence.length > 0
91
91
  ? PROTOCOL_BLOCK.replace(PROTOCOL_WIPE_SENTENCE, () => tools.wipeSentence!)
92
92
  : PROTOCOL_BLOCK;
93
- return block.replace(/notes_\*|notes_list|history_\*|get_context_remaining|(?<!\/)neuralyze/g, (name) => names[name]!);
93
+ return block.replace(/notes_\*|notes_list|history_\*|get_context_remaining|(?<!\/)empty_brain/g, (name) => names[name]!);
94
94
  }
@@ -13,10 +13,10 @@ export const CONTINUATION = "WIPED! Your whole brain, poof! Who? No idea! Defini
13
13
  export const WARNING_BODY =
14
14
  "This context window will be cleared soon. Notes and history persist; anything else is lost.\nConsider whether to record in your notes:\n- what you are working on, and how far it has progressed\n- decisions the human has made, in their words\n- what is blocked or pending\n- the next step\n- where unfinished work is located (branches, scratch directories, uncommitted changes)\n- approaches that failed, and why\n- skills to re-read, and history seqs, notes, or files to consult\n- anything else you expect to be useful after the reset\nCorrect or crumple notes that are no longer accurate, starting with MAP files, since every new window loads them.";
15
15
 
16
- export const WARNING_PROMPT = `${WARNING_BODY}\nWhen the notes are ready, call \`neuralyze\` to reset now instead of being cut off mid-task.`;
16
+ export const WARNING_PROMPT = `${WARNING_BODY}\nWhen the notes are ready, call \`empty_brain\` to reset now instead of being cut off mid-task.`;
17
17
 
18
- /** Pi-only nudge: pi's neuralyze persists a parting line; the dsh tool has no such parameter. */
19
- export const LAST_WORD_HINT = "If you want, pass `neuralyze` a `last_word`: a tiny sticky note (at most 250 characters) slapped on your forehead after the wipe.";
18
+ /** Pi-only nudge: pi's empty_brain persists a parting line; the dsh tool has no such parameter. */
19
+ export const LAST_WORD_HINT = "If you want, pass `empty_brain` a `last_word`: a tiny sticky note (at most 250 characters) slapped on your forehead after the wipe.";
20
20
 
21
21
  /** The hidden checkpoint text for pi's manual/budget-triggered requests (dsh reads WARNING_PROMPT directly). */
22
22
  export const WARNING_CONTENT = `${GUIDANCE_OPEN_TAG}\n${WARNING_PROMPT}\n${LAST_WORD_HINT}\n${GUIDANCE_CLOSE_TAG}`;
package/src/dsh/index.ts CHANGED
@@ -43,7 +43,7 @@ export function apply(ctx: Context): void {
43
43
  const state = engine.windows.get(agent.session);
44
44
  const phase = budget.remaining <= budget.warning ? "warning" : budget.remaining <= budget.reminder ? "reminder" : undefined;
45
45
  if (phase && !(phase === "warning" ? state.warned : state.reminded || state.warned)) {
46
- const text = phase === "warning" ? WARNING_PROMPT : tokenBudgetGuidance(budget.countdown, "neuralyze");
46
+ const text = phase === "warning" ? WARNING_PROMPT : tokenBudgetGuidance(budget.countdown, "empty_brain");
47
47
  agent.steer(createUserMessage({ content: [{ type: "text", text }], source: { kind: "notesoup-budget", windowId: state.snapshot.windowId, phase } }));
48
48
  if (phase === "warning") state.warned = true;
49
49
  else state.reminded = true;
package/src/dsh/tools.ts CHANGED
@@ -60,7 +60,7 @@ export function registerTools(ctx: Context, engine: NotesoupCompactionEngine): v
60
60
  ctx.on("tools/result", (exec, result) => {
61
61
  if (!exec.agent) return;
62
62
  const state = engine.windows.get(exec.agent.session);
63
- if (exec.name === "neuralyze" && !result.isError && (result.value as { window_id?: string }).window_id === state.snapshot.windowId) {
63
+ if (exec.name === "empty_brain" && !result.isError && (result.value as { window_id?: string }).window_id === state.snapshot.windowId) {
64
64
  if (!exec.parent) state.pendingReset = true;
65
65
  else {
66
66
  const roots = nestedResets.get(exec.agent) ?? new Set<string>();
@@ -80,7 +80,7 @@ export function registerTools(ctx: Context, engine: NotesoupCompactionEngine): v
80
80
  register(ctx, historyRead, async (agent) => [await historyProjection(ctx, agent.session.id)] as const);
81
81
  register(ctx, historyWindows, async (agent) => [await historyProjection(ctx, agent.session.id), agent.session.id] as const);
82
82
  ctx.tools.register(defineTool({
83
- name: "neuralyze",
83
+ name: "empty_brain",
84
84
  description: "Open a fresh context window after this tool batch. Write recovery notes first; notes and raw history stay on disk.",
85
85
  parameters: {},
86
86
  output: { schema: { type: "object", properties: { window_id: { type: "string", required: true }, reset_requested: { type: "boolean", required: true } }, additionalProperties: false }, render: (_args, value) => [{ type: "text", text: `notesoup: reset requested for ${value.window_id}; finish this tool batch, then recover from your notes.` }] },
package/src/pi/budget.ts CHANGED
@@ -64,7 +64,7 @@ export function registerBudget(
64
64
  for (const [key, notice] of pendingNotices) {
65
65
  if (warningCommittedInWindow(ctx, notice)) {
66
66
  pendingNotices.delete(key);
67
- ctx.ui.notify("🥣 Context almost full · saving notes before memory clears", "warning");
67
+ ctx.ui.notify("🥣 Brain almost full · taking notes", "warning");
68
68
  } else if (settled) {
69
69
  // An uncommitted draft must not be matched to a later manual warning.
70
70
  pendingNotices.delete(key);
@@ -7,7 +7,7 @@ import { buildBootMessage, sendBoot, type IncompleteNotesNotifier } from "../boo
7
7
 
8
8
  export type ResetTailState = { readonly boot: boolean; readonly continuation: boolean };
9
9
 
10
- /** A sticky note, not a letter: over this, neuralyze refuses instead of truncating. */
10
+ /** A sticky note, not a letter: over this, empty_brain refuses instead of truncating. */
11
11
  export const MAX_LAST_WORD_CHARS = 250;
12
12
 
13
13
  /** How the next window finds the note. */
@@ -250,7 +250,7 @@ export function registerResetLifecycle(pi: ExtensionAPI, options: ResetOptions)
250
250
  try {
251
251
  resetDrafts = await options.buildReset(ctx, isCurrent, prompt, lastWord);
252
252
  } catch (error) {
253
- if (isCurrent()) ctx.ui.notify(`🥣 Couldn't clear memory: ${errorMessage(error)}${prompt ? " · your prompt was not sent" : ""}`, "warning");
253
+ if (isCurrent()) ctx.ui.notify(`🥣 Brain still full: ${errorMessage(error)}${prompt ? " · prompt not sent" : ""}`, "warning");
254
254
  return entries.length > 0 ? { entries } : undefined;
255
255
  }
256
256
  if (!isCurrent()) return entries.length > 0 ? { entries } : undefined;
@@ -323,7 +323,7 @@ export function registerResetLifecycle(pi: ExtensionAPI, options: ResetOptions)
323
323
  const markerExists = currentReset(ctx) !== undefined;
324
324
  if (options.isEnabled() || markerExists) {
325
325
  if (event.reason === "manual") {
326
- ctx.ui.notify("🥣 /compact is off while notesoup is on · use /fresh-window", "warning");
326
+ ctx.ui.notify("🥣 No compacting brains here · use /fresh-window", "warning");
327
327
  }
328
328
  return { cancel: true };
329
329
  }