notesoup 0.42.0 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/src/boot/render.js +11 -20
  2. package/dist/src/boot/snapshot.js +1 -6
  3. package/dist/src/boot/text.js +1 -1
  4. package/dist/src/budget/parse.d.ts +14 -0
  5. package/dist/src/budget/parse.js +36 -0
  6. package/dist/src/budget/policy.js +2 -7
  7. package/dist/src/budget/text.d.ts +2 -0
  8. package/dist/src/budget/text.js +2 -0
  9. package/dist/src/claude/helper.js +1 -2
  10. package/dist/src/claude/thresholds.js +45 -66
  11. package/dist/src/dream/lock.js +6 -13
  12. package/dist/src/dream/report.js +5 -15
  13. package/dist/src/history/history.js +4 -2
  14. package/dist/src/history/query.js +10 -22
  15. package/dist/src/notes/address.d.ts +0 -1
  16. package/dist/src/notes/address.js +5 -17
  17. package/dist/src/notes/errors.d.ts +2 -0
  18. package/dist/src/notes/errors.js +5 -0
  19. package/dist/src/notes/frontmatter.js +16 -2
  20. package/dist/src/notes/identity.js +0 -3
  21. package/dist/src/notes/paths.d.ts +11 -1
  22. package/dist/src/notes/paths.js +28 -7
  23. package/dist/src/notes/store.d.ts +1 -0
  24. package/dist/src/notes/store.js +38 -37
  25. package/dist/src/pi/boot.js +1 -5
  26. package/dist/src/pi/budget.d.ts +3 -3
  27. package/dist/src/pi/budget.js +11 -11
  28. package/dist/src/pi/dream/cli.js +43 -11
  29. package/dist/src/pi/estimate.d.ts +1 -5
  30. package/dist/src/pi/estimate.js +4 -4
  31. package/dist/src/pi/history.js +1 -4
  32. package/dist/src/pi/notes/adapter.d.ts +1 -1
  33. package/dist/src/pi/notes/adapter.js +2 -2
  34. package/dist/src/pi/reset/artifacts.d.ts +0 -2
  35. package/dist/src/pi/reset/artifacts.js +4 -4
  36. package/dist/src/pi/reset/committed.js +2 -2
  37. package/dist/src/pi/runtime.js +8 -5
  38. package/dist/src/pi/thresholds.js +5 -9
  39. package/dist/src/pi/tool-result.d.ts +1 -4
  40. package/dist/src/pi/tool-result.js +1 -1
  41. package/dist/src/pi/window.d.ts +5 -0
  42. package/dist/src/pi/window.js +7 -0
  43. package/dist/src/settings.d.ts +2 -0
  44. package/dist/src/settings.js +4 -3
  45. package/dist/src/tools/history.js +4 -7
  46. package/dist/src/tools/notes.d.ts +0 -4
  47. package/dist/src/tools/notes.js +6 -16
  48. package/dist/src/tools/output.d.ts +0 -3
  49. package/dist/src/tools/output.js +1 -9
  50. package/dist/src/tools/result.d.ts +1 -0
  51. package/dist/src/tools/result.js +14 -20
  52. package/dist/src/tools/schema.d.ts +0 -1
  53. package/dist/src/tools/schema.js +0 -1
  54. package/dist/test/agent-loop.test.js +1 -2
  55. package/dist/test/boot.integration.test.js +1 -1
  56. package/dist/test/claude-mod.test.js +221 -9
  57. package/dist/test/claude-validation.test.d.ts +1 -0
  58. package/dist/test/claude-validation.test.js +73 -0
  59. package/dist/test/dream-skill.test.js +2 -4
  60. package/dist/test/dream.test.js +14 -0
  61. package/dist/test/helpers/extension.js +1 -1
  62. package/dist/test/history.integration.test.js +2 -1
  63. package/dist/test/host-neutral.test.js +15 -0
  64. package/dist/test/notes-library.test.js +30 -1
  65. package/dist/test/notes.integration.test.js +7 -7
  66. package/dist/test/notes.test.js +24 -5
  67. package/dist/test/reset-lifecycle.test.js +1 -1
  68. package/docs/claude-code-mod.md +5 -3
  69. package/mods/notesoup/.claude-plugin/plugin.json +1 -1
  70. package/mods/notesoup/dist/claude/helper.js +147 -173
  71. package/mods/notesoup/hooks/register.ts +158 -67
  72. package/mods/notesoup/playbook.md +1 -1
  73. package/mods/notesoup/skills/dream/SKILL.md +1 -1
  74. package/mods/notesoup/skills/memory/SKILL.md +61 -0
  75. package/package.json +5 -3
  76. package/playbook.md +1 -1
  77. package/skills/dream/SKILL.md +1 -1
  78. package/skills/memory/SKILL.md +1 -1
  79. package/src/boot/render.ts +11 -21
  80. package/src/boot/snapshot.ts +2 -7
  81. package/src/boot/text.ts +1 -1
  82. package/src/budget/parse.ts +39 -0
  83. package/src/budget/policy.ts +2 -6
  84. package/src/budget/text.ts +3 -0
  85. package/src/claude/helper.ts +2 -2
  86. package/src/claude/thresholds.ts +45 -62
  87. package/src/dream/lock.ts +3 -9
  88. package/src/dream/report.ts +5 -10
  89. package/src/history/history.ts +4 -2
  90. package/src/history/query.ts +10 -23
  91. package/src/notes/address.ts +4 -16
  92. package/src/notes/errors.ts +6 -0
  93. package/src/notes/frontmatter.ts +12 -2
  94. package/src/notes/identity.ts +0 -2
  95. package/src/notes/paths.ts +23 -5
  96. package/src/notes/store.ts +33 -36
  97. package/src/pi/boot.ts +1 -13
  98. package/src/pi/budget.ts +10 -11
  99. package/src/pi/dream/cli.ts +35 -10
  100. package/src/pi/estimate.ts +4 -4
  101. package/src/pi/history.ts +1 -5
  102. package/src/pi/notes/adapter.ts +2 -2
  103. package/src/pi/reset/artifacts.ts +4 -4
  104. package/src/pi/reset/committed.ts +2 -2
  105. package/src/pi/runtime.ts +7 -6
  106. package/src/pi/thresholds.ts +5 -11
  107. package/src/pi/tool-result.ts +1 -1
  108. package/src/pi/window.ts +8 -0
  109. package/src/settings.ts +4 -3
  110. package/src/tools/history.ts +4 -8
  111. package/src/tools/notes.ts +7 -20
  112. package/src/tools/output.ts +1 -12
  113. package/src/tools/result.ts +14 -19
  114. package/src/tools/schema.ts +0 -1
  115. package/dist/src/dream/playbook.d.ts +0 -1
  116. package/dist/src/dream/playbook.js +0 -2
  117. package/dist/src/pi/reset/text.d.ts +0 -4
  118. package/dist/src/pi/reset/text.js +0 -7
  119. package/src/dream/playbook.ts +0 -3
  120. package/src/pi/reset/text.ts +0 -9
@@ -1,6 +1,6 @@
1
1
  /** Host-neutral history operations: one bounded payload for text and structured results. */
2
2
  import { Type, type Static } from "typebox";
3
- import { HISTORY_PREVIEW_CHARS, TOOL_OUTPUT_LIMIT } from "./output.js";
3
+ import { HISTORY_PREVIEW_CHARS, MAX_READ_WINDOW_CHARS, TOOL_OUTPUT_LIMIT } from "./output.js";
4
4
  import { failure, fitsResult, resultSchema, readTextWindow, renderOutcome, renderTextWindow, success, TextWindowRequestSchema, TextWindowSchema, type Operation, type Outcome } from "./result.js";
5
5
  import { historyRoles, searchQuery } from "./schema.js";
6
6
  import { HistoryPageSchema, selectPage, type HistoryPage } from "../history/query.js";
@@ -54,10 +54,6 @@ function renderPageItem(item: HistoryPageItem): string {
54
54
  return lines.join("\n");
55
55
  }
56
56
 
57
- function isFoldedRow(item: HistoryPageItem | HistoryFoldedRow): item is HistoryFoldedRow {
58
- return "folded" in item;
59
- }
60
-
61
57
  function renderFoldedRow(row: HistoryFoldedRow): string {
62
58
  const tools = Object.entries(row.tools).map(([name, count]) => `${name} ${count}`).join(", ");
63
59
  const expand = `\n\t→ expand: {"after_seq":${row.first_seq - 1},"before_seq":${row.last_seq + 1},"from":"oldest","roles":["tool","context"]}`;
@@ -67,7 +63,7 @@ function renderFoldedRow(row: HistoryFoldedRow): string {
67
63
  function renderPage(page: HistoryPage): string {
68
64
  // An empty selection has no anchors either, so it would otherwise render as nothing at all.
69
65
  if (page.items.length === 0) return "No events match these filters.";
70
- const body = page.items.map((item) => (isFoldedRow(item) ? renderFoldedRow(item) : renderPageItem(item))).join("\n\n");
66
+ const body = page.items.map((item) => ("folded" in item ? renderFoldedRow(item) : renderPageItem(item))).join("\n\n");
71
67
  const cursors = [
72
68
  page.page_older === null ? "" : `→ older: ${JSON.stringify(page.page_older)}`,
73
69
  page.page_newer === null ? "" : `→ newer: ${JSON.stringify(page.page_newer)}`,
@@ -161,8 +157,8 @@ export const historyListParameters = Type.Object({
161
157
  until: Type.Optional(Type.String({ minLength: 1, description: "(optional) ISO 8601 time; only events before it. UTC if no offset." })),
162
158
  from: Type.Optional(Type.Union([Type.Literal("newest"), Type.Literal("oldest")], { description: "(optional, default newest) Which end `limit` counts from: newest or oldest. Results stay oldest first." })),
163
159
  window_id: Type.Optional(Type.String({ minLength: 1, description: `(optional) Only this context window. From \`history_windows\` or any event; \`${PREVIOUS_WINDOW}\` is the one before this.` })),
164
- limit: Type.Optional(Type.Integer({ description: "(optional, default 20) Max events per page; folded rows don't count." })),
165
- max_chars_per_item: Type.Optional(Type.Integer({ description: `(optional, default ${HISTORY_PREVIEW_CHARS}) Max preview chars per event.` })),
160
+ limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 500, description: "(optional, default 20) Max events per page; folded rows don't count." })),
161
+ max_chars_per_item: Type.Optional(Type.Integer({ minimum: 1, maximum: MAX_READ_WINDOW_CHARS, description: `(optional, default ${HISTORY_PREVIEW_CHARS}) Max preview chars per event.` })),
166
162
  }, { additionalProperties: false });
167
163
 
168
164
  export const historyList: Operation<typeof historyListParameters, HistoryPage, [HistoryProjection]> = {
@@ -2,7 +2,7 @@ import type { NotesIdentity } from "../notes/identity.js";
2
2
  import { Type, type Static } from "typebox";
3
3
  import { localIso } from "../notes/frontmatter.js";
4
4
  import { isFilesystemError } from "../notes/fs-error.js";
5
- import { createNotesStore, NoteError, noteIdentity, type NoteChange, type NoteMeta, type NoteQueryStatus, type NoteRow, type Scope } from "../notes/index.js";
5
+ import { createNotesStore, NoteError, noteIdentity, type NoteChange, type NoteMeta, type NoteQueryStatus, type NoteRow } from "../notes/index.js";
6
6
  import { prefixFit, TOOL_OUTPUT_LIMIT } from "./output.js";
7
7
  import { failure, fitsResult, resultSchema, readTextWindow, renderOutcome, renderTextWindow, structuredBytes, success, TextWindowRequestSchema, TextWindowSchema, type Outcome } from "./result.js";
8
8
  import { nullableString, InvalidQueryError, searchQueries, searchQuery } from "./schema.js";
@@ -17,11 +17,6 @@ const FILE_LIMIT_PARAMETER = Type.Optional(Type.Integer({ minimum: 1, descriptio
17
17
  const GLOB_PARAMETER = nullableString("(optional) Glob over full addresses.");
18
18
  const ADDRESS_DESCRIPTION = "Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable homes. Not file paths: never pass them to file tools.";
19
19
 
20
- /** The one receipt field a caller cannot derive from the address itself. */
21
- function projectKeyField(scope: Scope, projectKey: string): { project_key?: string } {
22
- return scope === "project" ? { project_key: projectKey } : {};
23
- }
24
-
25
20
  /**
26
21
  * Typed refusal. Every fact a caller needs is already in the message; there is no separate context.
27
22
  * Convert expected refusals; unexpected errors propagate unchanged.
@@ -34,22 +29,13 @@ function failureOf(error: unknown): Outcome<never> {
34
29
  throw error;
35
30
  }
36
31
 
37
- function byRecent<T extends { address: string; meta: { updatedAt: number } }>(a: T, b: T): number {
38
- return b.meta.updatedAt - a.meta.updatedAt || a.address.localeCompare(b.address);
39
- }
40
-
41
32
  /** Metadata keys this layer normalizes; everything else is exposed verbatim under `extra`. */
42
33
  const NORMALIZED_META_KEYS = new Set(["scope", "origin", "createdAt", "updatedAt", "lastAccessed", "accessCount", "crumpledAt", "project"]);
43
34
  /** One unrecognized entry, and the verbatim extras together, are bounded so `extra` cannot outgrow the read. */
44
- export const MAX_METADATA_ENTRY_BYTES = 1024;
35
+ const MAX_METADATA_ENTRY_BYTES = 1024;
45
36
  const MAX_METADATA_VERBATIM_BYTES = 2048;
46
37
  /** An extra value that cannot be carried is named in place, never silently dropped. */
47
- export const TOO_LARGE_EXTRA_VALUE = "[omitted: too large]";
48
-
49
- /** Include the key: hand-written frontmatter can have arbitrarily long keys. */
50
- function extraEntryBytes(key: string, value: unknown): number {
51
- return structuredBytes(key) + 1 + structuredBytes(value);
52
- }
38
+ const TOO_LARGE_EXTRA_VALUE = "[omitted: too large]";
53
39
 
54
40
  export const NoteMetadataSchema = Type.Object({
55
41
  origin: Type.Union([...ORIGIN_VALUES]),
@@ -73,7 +59,8 @@ function noteMetadata(meta: NoteMeta): NoteMetadata {
73
59
  if (NORMALIZED_META_KEYS.has(key) || value === undefined) continue;
74
60
  // A key too large to carry cannot be named at all; an oversized value is named in place.
75
61
  if (structuredBytes(key) > MAX_METADATA_ENTRY_BYTES) continue;
76
- const entryBytes = extraEntryBytes(key, value);
62
+ // The key counts too: hand-written frontmatter can have arbitrarily long keys.
63
+ const entryBytes = structuredBytes(key) + 1 + structuredBytes(value);
77
64
  if (entryBytes > MAX_METADATA_ENTRY_BYTES || verbatimBytes + entryBytes > MAX_METADATA_VERBATIM_BYTES) {
78
65
  put(key, TOO_LARGE_EXTRA_VALUE);
79
66
  continue;
@@ -199,7 +186,7 @@ function snapshot<T extends { address: string }>(
199
186
  }
200
187
 
201
188
  function listedFile(row: Pick<NoteRow, "address" | "scope" | "meta">, identity: NotesIdentity): NotesListData["files"][number] {
202
- return { address: row.address, ...projectKeyField(row.scope, identity.projectKey), updated_at: localIso(row.meta.updatedAt), ...(row.meta.crumpledAt === undefined ? {} : { crumpled_at: row.meta.crumpledAt }) };
189
+ return { address: row.address, ...(row.scope === "project" ? { project_key: identity.projectKey } : {}), updated_at: localIso(row.meta.updatedAt), ...(row.meta.crumpledAt === undefined ? {} : { crumpled_at: row.meta.crumpledAt }) };
203
190
  }
204
191
 
205
192
  export const notesWriteParameters = Type.Object({ address: Type.String(), content: Type.String(), origin: ORIGIN }, { additionalProperties: false });
@@ -372,7 +359,7 @@ export const notesSearch = {
372
359
  async execute(params: Static<typeof notesSearchParameters>, identity: NotesIdentity): Promise<Outcome<NotesSearchData>> {
373
360
  try {
374
361
  const { rows, status } = await createNotesStore(identity).searchWithStatus(searchQueries(params.query), { glob: params.glob ?? undefined, crumpled: params.crumpled });
375
- const files: NotesSearchData["files"] = rows.sort(byRecent).map(row => ({
362
+ const files: NotesSearchData["files"] = rows.sort((a, b) => b.meta.updatedAt - a.meta.updatedAt || a.address.localeCompare(b.address)).map(row => ({
376
363
  ...listedFile(row, identity),
377
364
  matches: row.matches.slice(0, params.max_matches_per_file).map(match => ({ line: match.line, text: match.text, offset_chars: match.offsetChars })),
378
365
  }));
@@ -1,6 +1,4 @@
1
1
  /** Budget primitives. Notes/history use result.ts; reset/budget tools retain output(). */
2
- export { earliestMatchOffsetChars } from "../text-match.js";
3
-
4
2
  export const TOOL_OUTPUT_MAX_BYTES = 32 * 1024;
5
3
  /** The per-call limit as the model reads it in refusals. */
6
4
  export const TOOL_OUTPUT_LIMIT = `${TOOL_OUTPUT_MAX_BYTES / 1024} KB`;
@@ -8,15 +6,6 @@ export const DEFAULT_READ_WINDOW_CHARS = 12000;
8
6
  export const MAX_READ_WINDOW_CHARS = 50000;
9
7
  export const HISTORY_PREVIEW_CHARS = 1200;
10
8
 
11
- function json(value: unknown): string {
12
- return JSON.stringify(value);
13
- }
14
-
15
- /** True when `text` fits the wire budget verbatim, for raw payloads with no JSON encoding. */
16
- export function withinTextBudget(text: string, budget = TOOL_OUTPUT_MAX_BYTES): boolean {
17
- return Buffer.byteLength(text, "utf8") <= budget;
18
- }
19
-
20
9
  /** Longest fitting code-point prefix, without inserted markers. Callers report omissions. */
21
10
  export function prefixFit(text: string, fits: (content: string) => boolean): string {
22
11
  if (fits(text)) return text;
@@ -39,5 +28,5 @@ export function prefixFit(text: string, fits: (content: string) => boolean): str
39
28
  * undefined unless the tool has metadata worth persisting.
40
29
  */
41
30
  export function output(value: unknown, details?: unknown, terminate = false) {
42
- return { content: [{ type: "text" as const, text: json(value) }], details, terminate };
31
+ return { content: [{ type: "text" as const, text: JSON.stringify(value) }], details, terminate };
43
32
  }
@@ -1,6 +1,6 @@
1
1
  /** Internal outcomes, compact wire results, and bounded read windows. */
2
2
  import { Type, type Static, type TSchema } from "typebox";
3
- import { DEFAULT_READ_WINDOW_CHARS, MAX_READ_WINDOW_CHARS, TOOL_OUTPUT_LIMIT, TOOL_OUTPUT_MAX_BYTES, withinTextBudget } from "./output.js";
3
+ import { DEFAULT_READ_WINDOW_CHARS, MAX_READ_WINDOW_CHARS, prefixFit, TOOL_OUTPUT_LIMIT, TOOL_OUTPUT_MAX_BYTES } from "./output.js";
4
4
 
5
5
  /** The one refusal shape: `code` is a stable internal identifier, `message` the bounded reading. */
6
6
  export const OperationErrorSchema = Type.Object({
@@ -19,13 +19,11 @@ export function success<T>(data: T): Outcome<T> {
19
19
  /** A code is an internal stable identifier and is never clipped; the dynamic message is the bounded surface. */
20
20
  export const ERROR_MESSAGE_MAX_CHARS = 2000;
21
21
 
22
- function boundedMessage(message: string): string {
23
- const chars = Array.from(message);
24
- return chars.length <= ERROR_MESSAGE_MAX_CHARS ? message : `${chars.slice(0, ERROR_MESSAGE_MAX_CHARS).join("")}…[truncated ${chars.length - ERROR_MESSAGE_MAX_CHARS} chars]`;
25
- }
26
-
22
+ /** Bounded refusal: a runaway message is clipped with a marker instead of filling the wire. */
27
23
  export function failure(code: string, message: string): Outcome<never> {
28
- return { ok: false, error: { code, message: boundedMessage(message) } };
24
+ const chars = Array.from(message);
25
+ const bounded = chars.length <= ERROR_MESSAGE_MAX_CHARS ? message : `${chars.slice(0, ERROR_MESSAGE_MAX_CHARS).join("")}…[truncated ${chars.length - ERROR_MESSAGE_MAX_CHARS} chars]`;
26
+ return { ok: false, error: { code, message: bounded } };
29
27
  }
30
28
 
31
29
  /** Public results have no success envelope. `error` is reserved for a refusal message. */
@@ -58,7 +56,7 @@ export function structuredBytes(value: unknown): number {
58
56
  * measure covers everything the renderer puts around the payload, headers and footers included.
59
57
  */
60
58
  export function fitsResult<T>(result: Outcome<T>, render: (result: Outcome<T>) => string): boolean {
61
- return withinTextBudget(render(result)) && structuredBytes(wireResult(result)) <= TOOL_OUTPUT_MAX_BYTES;
59
+ return Buffer.byteLength(render(result), "utf8") <= TOOL_OUTPUT_MAX_BYTES && structuredBytes(wireResult(result)) <= TOOL_OUTPUT_MAX_BYTES;
62
60
  }
63
61
 
64
62
  /** `text` is verbatim, with no marker inserted, so windows concatenate back into the source. */
@@ -97,7 +95,8 @@ export function readTextWindow<T>(
97
95
  const requested = offset ?? 0;
98
96
  const start = requested < 0 ? Math.max(0, chars.length + requested) : requested;
99
97
  const requestedChars = limit ?? DEFAULT_READ_WINDOW_CHARS;
100
- const range = Math.min(requestedChars, chars.length - start);
98
+ // A start past the end (a caller that skipped its own offset check) has nothing to deliver.
99
+ const range = Math.max(0, Math.min(requestedChars, chars.length - start));
101
100
  const window = (delivered: number): TextWindow => {
102
101
  const end = start + delivered;
103
102
  return {
@@ -107,17 +106,13 @@ export function readTextWindow<T>(
107
106
  };
108
107
  };
109
108
  const fits = (delivered: number): boolean => fitsResult(success(makeData(window(delivered))), render);
110
- // Test the full range first: its footer can disappear at the end of the document.
109
+ // Test the full range first: its footer can disappear at the end of the document, and an
110
+ // empty source is a complete window rather than a refusal.
111
111
  if (fits(range)) return success(makeData(window(range)));
112
- let low = 0;
113
- let high = range;
114
- while (low < high) {
115
- const mid = Math.ceil((low + high) / 2);
116
- if (fits(mid)) low = mid;
117
- else high = mid - 1;
118
- }
119
- if (low === 0) return failure("output_too_large", `Its header alone fills the ${TOOL_OUTPUT_LIMIT} a call can carry; no room left for the text.`);
120
- return success(makeData(window(low)));
112
+ // The kept count is monotone in the serialized size, so the shared prefix search owns the shrink.
113
+ const delivered = Array.from(prefixFit(window(range).text, (candidate) => fits(Array.from(candidate).length))).length;
114
+ if (delivered === 0) return failure("output_too_large", `Its header alone fills the ${TOOL_OUTPUT_LIMIT} a call can carry; no room left for the text.`);
115
+ return success(makeData(window(delivered)));
121
116
  }
122
117
 
123
118
  /** The continuation line never becomes part of `window.text`, and a complete window has none. */
@@ -1,7 +1,6 @@
1
1
  import { Type } from "typebox";
2
2
  import { HistoryRoleSchema } from "../history/history.js";
3
3
  export const nullableString = (description?: string) => Type.Optional(Type.Union([Type.String(), Type.Null()], description === undefined ? {} : { description }));
4
- export const positiveInteger = () => Type.Optional(Type.Integer({ minimum: 1 }));
5
4
  export const historyRoles = () => Type.Optional(Type.Array(HistoryRoleSchema, { minItems: 1, description: "(optional) Only these roles: user, assistant, tool, context. Omit to see the conversation with tool and context runs folded." }));
6
5
 
7
6
  /** Search query parameter: one literal, or several literals combined with OR. */
@@ -1 +0,0 @@
1
- export declare function loadPlaybook(path: string): string;
@@ -1,2 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- export function loadPlaybook(path) { return readFileSync(path, "utf8"); }
@@ -1,4 +0,0 @@
1
- import { CLAUDE_WARNING_PROMPT, CONTINUATION, WARNING_BODY, WARNING_PROMPT } from "../../budget/text.js";
2
- /** Shared hidden checkpoint text for manual and budget-triggered requests. */
3
- export declare const WARNING_CONTENT = "<context_window_guidance>\nThis 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.\nWhen the notes are ready, call `clear_memory` to reset now instead of being cut off mid-task.\n</context_window_guidance>";
4
- export { CLAUDE_WARNING_PROMPT, CONTINUATION, WARNING_BODY, WARNING_PROMPT };
@@ -1,7 +0,0 @@
1
- import { CLAUDE_WARNING_PROMPT, CONTINUATION, GUIDANCE_CLOSE_TAG, GUIDANCE_OPEN_TAG, WARNING_BODY, WARNING_PROMPT } from "../../budget/text.js";
2
- /** Shared hidden checkpoint text for manual and budget-triggered requests. */
3
- export const WARNING_CONTENT = `${GUIDANCE_OPEN_TAG}\n${WARNING_PROMPT}\n${GUIDANCE_CLOSE_TAG}`;
4
- // The reset prose lives beside the guidance text in the host-neutral budget domain, so the
5
- // Claude mod can show the same words without depending on any Pi module. Re-exported here
6
- // for the Pi-side importers that already reach for this module.
7
- export { CLAUDE_WARNING_PROMPT, CONTINUATION, WARNING_BODY, WARNING_PROMPT };
@@ -1,3 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
-
3
- export function loadPlaybook(path: string): string { return readFileSync(path, "utf8"); }
@@ -1,9 +0,0 @@
1
- import { CLAUDE_WARNING_PROMPT, CONTINUATION, GUIDANCE_CLOSE_TAG, GUIDANCE_OPEN_TAG, WARNING_BODY, WARNING_PROMPT } from "../../budget/text.js";
2
-
3
- /** Shared hidden checkpoint text for manual and budget-triggered requests. */
4
- export const WARNING_CONTENT = `${GUIDANCE_OPEN_TAG}\n${WARNING_PROMPT}\n${GUIDANCE_CLOSE_TAG}`;
5
-
6
- // The reset prose lives beside the guidance text in the host-neutral budget domain, so the
7
- // Claude mod can show the same words without depending on any Pi module. Re-exported here
8
- // for the Pi-side importers that already reach for this module.
9
- export { CLAUDE_WARNING_PROMPT, CONTINUATION, WARNING_BODY, WARNING_PROMPT };