notesoup 0.40.0 → 0.42.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.
- package/dist/src/boot/render.js +1 -1
- package/dist/src/boot/text.d.ts +12 -0
- package/dist/src/boot/text.js +25 -5
- package/dist/src/budget/policy.js +1 -1
- package/dist/src/budget/text.d.ts +12 -0
- package/dist/src/budget/text.js +13 -1
- package/dist/src/claude/helper.js +23 -2
- package/dist/src/claude/thresholds.d.ts +39 -0
- package/dist/src/claude/thresholds.js +149 -0
- package/dist/src/dream/doctor.js +3 -2
- package/dist/src/dream/git.js +2 -1
- package/dist/src/dream/jail.js +10 -10
- package/dist/src/dream/report.js +3 -2
- package/dist/src/error-message.d.ts +2 -0
- package/dist/src/error-message.js +4 -0
- package/dist/src/history/history.js +1 -1
- package/dist/src/history/query.js +6 -6
- package/dist/src/notes/address.d.ts +1 -1
- package/dist/src/notes/address.js +12 -12
- package/dist/src/notes/store.js +16 -12
- package/dist/src/pi/anchored.d.ts +16 -0
- package/dist/src/pi/anchored.js +55 -0
- package/dist/src/pi/budget.d.ts +1 -1
- package/dist/src/pi/budget.js +33 -28
- package/dist/src/pi/dream/cli.js +3 -2
- package/dist/src/pi/dream/runner.js +2 -1
- package/dist/src/pi/reset/lifecycle.d.ts +1 -1
- package/dist/src/pi/reset/lifecycle.js +4 -3
- package/dist/src/pi/reset/text.d.ts +3 -4
- package/dist/src/pi/reset/text.js +5 -4
- package/dist/src/pi/runtime.js +13 -16
- package/dist/src/pi/thresholds.js +2 -1
- package/dist/src/pi/tool-result.js +2 -2
- package/dist/src/settings.d.ts +8 -0
- package/dist/src/settings.js +6 -1
- package/dist/src/tools/history.js +12 -12
- package/dist/src/tools/notes.d.ts +3 -3
- package/dist/src/tools/notes.js +12 -11
- package/dist/src/tools/output.d.ts +2 -0
- package/dist/src/tools/output.js +2 -0
- package/dist/src/tools/result.js +2 -2
- package/dist/src/tools/schema.js +3 -3
- package/dist/test/agent-loop.test.js +78 -28
- package/dist/test/boot.integration.test.js +5 -5
- package/dist/test/budget-settings.integration.test.js +9 -8
- package/dist/test/claude-mod.test.js +213 -23
- package/dist/test/dream.test.js +3 -3
- package/dist/test/history.integration.test.js +7 -8
- package/dist/test/host-neutral.test.js +2 -2
- package/dist/test/notes-library.test.js +1 -1
- package/dist/test/notes.integration.test.js +5 -5
- package/dist/test/notes.test.js +16 -16
- package/dist/test/reset-lifecycle.test.js +2 -2
- package/docs/claude-code-mod.md +10 -2
- package/mods/notesoup/.claude-plugin/plugin.json +1 -1
- package/mods/notesoup/dist/claude/helper.js +212 -45
- package/mods/notesoup/hooks/register.ts +209 -48
- package/mods/notesoup/playbook.md +10 -10
- package/mods/notesoup/skills/dream/SKILL.md +1 -1
- package/package.json +1 -1
- package/playbook.md +10 -10
- package/skills/dream/SKILL.md +1 -1
- package/skills/memory/SKILL.md +5 -3
- package/src/boot/render.ts +1 -1
- package/src/boot/text.ts +31 -5
- package/src/budget/policy.ts +1 -1
- package/src/budget/text.ts +18 -1
- package/src/claude/helper.ts +20 -3
- package/src/claude/thresholds.ts +170 -0
- package/src/dream/doctor.ts +3 -2
- package/src/dream/git.ts +2 -1
- package/src/dream/jail.ts +10 -10
- package/src/dream/report.ts +3 -2
- package/src/error-message.ts +4 -0
- package/src/history/history.ts +1 -1
- package/src/history/query.ts +6 -6
- package/src/notes/address.ts +12 -12
- package/src/notes/store.ts +17 -12
- package/src/pi/anchored.ts +62 -0
- package/src/pi/budget.ts +27 -26
- package/src/pi/dream/cli.ts +3 -2
- package/src/pi/dream/runner.ts +2 -1
- package/src/pi/reset/lifecycle.ts +5 -4
- package/src/pi/reset/text.ts +6 -7
- package/src/pi/runtime.ts +13 -16
- package/src/pi/thresholds.ts +2 -1
- package/src/pi/tool-result.ts +2 -2
- package/src/settings.ts +18 -2
- package/src/tools/history.ts +12 -12
- package/src/tools/notes.ts +14 -12
- package/src/tools/output.ts +2 -0
- package/src/tools/result.ts +2 -2
- package/src/tools/schema.ts +3 -3
package/src/tools/result.ts
CHANGED
|
@@ -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_MAX_BYTES, withinTextBudget } from "./output.js";
|
|
3
|
+
import { DEFAULT_READ_WINDOW_CHARS, MAX_READ_WINDOW_CHARS, TOOL_OUTPUT_LIMIT, TOOL_OUTPUT_MAX_BYTES, withinTextBudget } 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({
|
|
@@ -116,7 +116,7 @@ export function readTextWindow<T>(
|
|
|
116
116
|
if (fits(mid)) low = mid;
|
|
117
117
|
else high = mid - 1;
|
|
118
118
|
}
|
|
119
|
-
if (low === 0) return failure("output_too_large",
|
|
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
120
|
return success(makeData(window(low)));
|
|
121
121
|
}
|
|
122
122
|
|
package/src/tools/schema.ts
CHANGED
|
@@ -24,8 +24,8 @@ export class InvalidQueryError extends Error {
|
|
|
24
24
|
*/
|
|
25
25
|
export function searchQueries(query: unknown): string[] {
|
|
26
26
|
const candidates = typeof query === "string" ? [query] : query;
|
|
27
|
-
if (!Array.isArray(candidates) || candidates.length === 0) throw new InvalidQueryError("query must be a string or a non-empty
|
|
28
|
-
if (!candidates.every((candidate) => typeof candidate === "string")) throw new InvalidQueryError("query
|
|
29
|
-
if (candidates.some((candidate) => candidate === "")) throw new InvalidQueryError("query
|
|
27
|
+
if (!Array.isArray(candidates) || candidates.length === 0) throw new InvalidQueryError("`query` must be a string or a non-empty list of strings.");
|
|
28
|
+
if (!candidates.every((candidate) => typeof candidate === "string")) throw new InvalidQueryError("Every item in the `query` list must be a string.");
|
|
29
|
+
if (candidates.some((candidate) => candidate === "")) throw new InvalidQueryError("`query` can't be an empty string; it would match everything.");
|
|
30
30
|
return candidates as string[];
|
|
31
31
|
}
|