notesoup 0.49.0 → 0.51.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/README.md +13 -1
- package/dist/{src/claude → plugins/claude/src}/helper.js +7 -7
- package/dist/{src/claude → plugins/claude/src}/history.d.ts +1 -1
- package/dist/{src/claude → plugins/claude/src}/history.js +1 -1
- package/dist/plugins/claude/src/text.d.ts +6 -0
- package/dist/plugins/claude/src/text.js +7 -0
- package/dist/{src/claude → plugins/claude/src}/thresholds.js +3 -3
- package/dist/{src → plugins}/dsh/budget.js +1 -1
- package/dist/{src → plugins}/dsh/engine.d.ts +1 -1
- package/dist/{src → plugins}/dsh/engine.js +1 -1
- package/dist/{src → plugins}/dsh/history.d.ts +1 -1
- package/dist/{src → plugins}/dsh/history.js +1 -1
- package/dist/{src → plugins}/dsh/index.js +1 -1
- package/dist/{src → plugins}/dsh/tools.js +3 -3
- package/dist/{src → plugins}/dsh/window.d.ts +1 -1
- package/dist/{src → plugins}/dsh/window.js +5 -5
- package/dist/{src → plugins}/pi/boot.d.ts +1 -1
- package/dist/{src → plugins}/pi/boot.js +5 -4
- package/dist/{src → plugins}/pi/budget.js +4 -4
- package/dist/{src → plugins}/pi/dream/cli.d.ts +1 -1
- package/dist/{src → plugins}/pi/dream/cli.js +6 -6
- package/dist/{src → plugins}/pi/dream/runner.d.ts +1 -1
- package/dist/{src → plugins}/pi/dream/runner.js +3 -3
- package/dist/{src → plugins}/pi/dream/settings.d.ts +1 -1
- package/dist/{src → plugins}/pi/dream/settings.js +2 -2
- package/dist/{src → plugins}/pi/history-tools.js +1 -1
- package/dist/{src → plugins}/pi/history.d.ts +1 -1
- package/dist/{src → plugins}/pi/history.js +1 -1
- package/dist/plugins/pi/index.d.ts +1 -0
- package/dist/plugins/pi/index.js +1 -0
- package/dist/{src → plugins}/pi/notes/adapter.d.ts +1 -1
- package/dist/{src → plugins}/pi/notes/adapter.js +1 -1
- package/dist/{src → plugins}/pi/notes/tools.js +1 -1
- package/dist/{src → plugins}/pi/reset/artifacts.d.ts +1 -1
- package/dist/{src → plugins}/pi/reset/artifacts.js +1 -1
- package/dist/{src → plugins}/pi/reset/lifecycle.d.ts +1 -1
- package/dist/{src → plugins}/pi/reset/lifecycle.js +1 -1
- package/dist/{src → plugins}/pi/runtime.js +4 -4
- package/dist/plugins/pi/text.d.ts +23 -0
- package/dist/plugins/pi/text.js +30 -0
- package/dist/{src → plugins}/pi/thresholds.d.ts +1 -1
- package/dist/{src → plugins}/pi/thresholds.js +4 -4
- package/dist/{src → plugins}/pi/tool-result.d.ts +1 -1
- package/dist/{src → plugins}/pi/tool-result.js +1 -1
- package/dist/{src → plugins}/pi/window.d.ts +1 -1
- package/dist/src/boot/text.d.ts +4 -13
- package/dist/src/boot/text.js +1 -11
- package/dist/src/budget/policy.d.ts +2 -3
- package/dist/src/budget/policy.js +1 -1
- package/dist/src/budget/text.d.ts +1 -12
- package/dist/src/budget/text.js +2 -24
- package/dist/src/dream/settings.d.ts +1 -2
- package/dist/src/dream/settings.js +4 -2
- package/dist/src/index.d.ts +29 -1
- package/dist/src/index.js +26 -1
- package/dist/src/notes/address.d.ts +5 -4
- package/dist/src/notes/address.js +13 -7
- package/dist/src/notes/identity.js +3 -7
- package/dist/src/notes/paths.d.ts +4 -2
- package/dist/src/notes/paths.js +11 -6
- package/dist/src/notes/store.d.ts +4 -1
- package/dist/src/notes/store.js +66 -34
- package/dist/src/settings.d.ts +7 -16
- package/dist/src/settings.js +7 -10
- package/dist/src/tools/notes.d.ts +5 -5
- package/dist/src/tools/notes.js +5 -4
- package/dist/test/agent-loop.test.js +20 -19
- package/dist/test/boot.integration.test.js +9 -9
- package/dist/test/budget-settings.integration.test.js +1 -1
- package/dist/test/claude-history.test.js +2 -2
- package/dist/test/claude-mod.test.js +22 -16
- package/dist/test/claude-validation.test.js +3 -3
- package/dist/test/dependencies.test.js +53 -45
- package/dist/test/doctor.test.js +1 -1
- package/dist/test/dream-skill.test.js +4 -4
- package/dist/test/dream.test.js +2 -2
- package/dist/test/dsh-cli.test.js +2 -2
- package/dist/test/dsh-compaction-parity.test.js +1 -1
- package/dist/test/dsh.test.js +4 -4
- package/dist/test/helpers/dependency-graph.js +9 -7
- package/dist/test/helpers/dsh.d.ts +1 -1
- package/dist/test/helpers/dsh.js +2 -2
- package/dist/test/helpers/extension.js +6 -5
- package/dist/test/helpers/notes.js +1 -1
- package/dist/test/model-facing-text.test.js +6 -4
- package/dist/test/notes-query-homes.test.d.ts +1 -0
- package/dist/test/notes-query-homes.test.js +161 -0
- package/dist/test/notes.integration.test.js +3 -2
- package/dist/test/notes.test.js +1 -1
- package/dist/test/reset-lifecycle.test.js +16 -15
- package/docs/architecture.md +21 -18
- package/docs/claude-code-mod.md +3 -3
- package/docs/dsh.md +2 -2
- package/docs/dsh.profile.patch.yml +1 -1
- package/docs/notes-library.md +17 -10
- package/docs/reset-lifecycle.md +3 -3
- package/docs/sdk-integration.md +2 -2
- package/package.json +17 -13
- package/{mods/notesoup → plugins/claude}/.claude-plugin/plugin.json +1 -1
- package/{mods/notesoup → plugins/claude}/dist/claude/helper.js +565 -540
- package/{mods/notesoup → plugins/claude}/hooks/register.ts +2 -2
- package/{mods/notesoup → plugins/claude}/skills/memory/SKILL.md +3 -0
- package/{src/claude → plugins/claude/src}/helper.ts +10 -9
- package/{src/claude → plugins/claude/src}/history.ts +1 -1
- package/plugins/claude/src/text.ts +10 -0
- package/{src/claude → plugins/claude/src}/thresholds.ts +3 -3
- package/{src → plugins}/dsh/budget.ts +1 -1
- package/{src → plugins}/dsh/engine.ts +1 -1
- package/{src → plugins}/dsh/history.ts +1 -1
- package/{src → plugins}/dsh/index.ts +1 -1
- package/{src → plugins}/dsh/tools.ts +3 -3
- package/{src → plugins}/dsh/window.ts +5 -5
- package/{src → plugins}/pi/boot.ts +5 -4
- package/{src → plugins}/pi/budget.ts +4 -4
- package/{src → plugins}/pi/dream/cli.ts +8 -8
- package/{src → plugins}/pi/dream/runner.ts +4 -4
- package/{src → plugins}/pi/dream/settings.ts +2 -2
- package/{src → plugins}/pi/history-tools.ts +1 -1
- package/{src → plugins}/pi/history.ts +1 -1
- package/plugins/pi/index.ts +1 -0
- package/{src → plugins}/pi/notes/adapter.ts +1 -1
- package/{src → plugins}/pi/notes/tools.ts +2 -2
- package/{src → plugins}/pi/reset/artifacts.ts +1 -1
- package/{src → plugins}/pi/reset/lifecycle.ts +2 -2
- package/{src → plugins}/pi/runtime.ts +4 -4
- package/plugins/pi/text.ts +35 -0
- package/{src → plugins}/pi/thresholds.ts +4 -4
- package/{src → plugins}/pi/tool-result.ts +1 -1
- package/{src → plugins}/pi/window.ts +1 -1
- package/skills/memory/SKILL.md +3 -0
- package/src/boot/text.ts +5 -15
- package/src/budget/policy.ts +3 -3
- package/src/budget/text.ts +2 -30
- package/src/dream/settings.ts +6 -3
- package/src/index.ts +52 -1
- package/src/notes/address.ts +12 -8
- package/src/notes/identity.ts +2 -8
- package/src/notes/paths.ts +12 -6
- package/src/notes/store.ts +62 -29
- package/src/settings.ts +8 -24
- package/src/tools/notes.ts +5 -4
- /package/dist/{src/claude → plugins/claude/src}/helper.d.ts +0 -0
- /package/dist/{src/claude → plugins/claude/src}/thresholds.d.ts +0 -0
- /package/dist/{src → plugins}/dsh/budget.d.ts +0 -0
- /package/dist/{src → plugins}/dsh/index.d.ts +0 -0
- /package/dist/{src → plugins}/dsh/tools.d.ts +0 -0
- /package/dist/{src → plugins}/pi/anchored.d.ts +0 -0
- /package/dist/{src → plugins}/pi/anchored.js +0 -0
- /package/dist/{src → plugins}/pi/budget.d.ts +0 -0
- /package/dist/{src → plugins}/pi/entries.d.ts +0 -0
- /package/dist/{src → plugins}/pi/entries.js +0 -0
- /package/dist/{src → plugins}/pi/estimate.d.ts +0 -0
- /package/dist/{src → plugins}/pi/estimate.js +0 -0
- /package/dist/{src → plugins}/pi/extension.d.ts +0 -0
- /package/dist/{src → plugins}/pi/extension.js +0 -0
- /package/dist/{src → plugins}/pi/history-tools.d.ts +0 -0
- /package/dist/{src → plugins}/pi/notes/tools.d.ts +0 -0
- /package/dist/{src → plugins}/pi/reset/committed.d.ts +0 -0
- /package/dist/{src → plugins}/pi/reset/committed.js +0 -0
- /package/dist/{src → plugins}/pi/runtime.d.ts +0 -0
- /package/dist/{src → plugins}/pi/session-reader.d.ts +0 -0
- /package/dist/{src → plugins}/pi/session-reader.js +0 -0
- /package/dist/{src → plugins}/pi/window.js +0 -0
- /package/{mods/notesoup → plugins/claude}/hooks/hooks.json +0 -0
- /package/{mods/notesoup → plugins/claude}/playbook.md +0 -0
- /package/{mods/notesoup → plugins/claude}/skills/dream/SKILL.md +0 -0
- /package/{src → plugins}/pi/anchored.ts +0 -0
- /package/{src → plugins}/pi/entries.ts +0 -0
- /package/{src → plugins}/pi/estimate.ts +0 -0
- /package/{src → plugins}/pi/extension.ts +0 -0
- /package/{src → plugins}/pi/reset/committed.ts +0 -0
- /package/{src → plugins}/pi/session-reader.ts +0 -0
package/dist/src/settings.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
/** The one settings key every host reads its own fields from. */
|
|
1
2
|
export const NOTESOUP_SETTINGS_KEY = "notesoup";
|
|
2
|
-
/** Nested under "notesoup": the default dreamer model pattern, overridden by CLI --dreamer. */
|
|
3
|
-
export const NOTESOUP_DREAMER_KEY = "dreamer";
|
|
4
3
|
/** A plain settings object; arrays and null are not one. */
|
|
5
4
|
export function isPlainObject(value) {
|
|
6
5
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -12,13 +11,11 @@ function notesoupSettings(settings) {
|
|
|
12
11
|
const value = settings[NOTESOUP_SETTINGS_KEY];
|
|
13
12
|
return isPlainObject(value) ? value : {};
|
|
14
13
|
}
|
|
15
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Merge the global and project "notesoup" objects per key; project wins, mirroring Pi's deep
|
|
16
|
+
* merge. The record is exactly what the scopes contain: this core module owns the key and the
|
|
17
|
+
* merge, while each host names, reads and validates the fields it consumes.
|
|
18
|
+
*/
|
|
16
19
|
export function mergeNotesoupSettings(globalSettings, projectSettings) {
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
reminderMarginTokens: merged.reminderMarginTokens,
|
|
20
|
-
resetMarginTokens: merged.resetMarginTokens,
|
|
21
|
-
warningRunwayTokens: merged.warningRunwayTokens,
|
|
22
|
-
dreamer: merged.dreamer,
|
|
23
|
-
};
|
|
20
|
+
return { ...notesoupSettings(globalSettings), ...notesoupSettings(projectSettings) };
|
|
24
21
|
}
|
|
@@ -91,7 +91,7 @@ export declare const notesWriteParameters: Type.TObject<{
|
|
|
91
91
|
export declare const notesWrite: {
|
|
92
92
|
readonly name: "notes_write";
|
|
93
93
|
readonly label: "Notes write";
|
|
94
|
-
readonly description: "Create or replace a note. Name it for what it holds and when to use it. Store what git and history can't recover. Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable homes; `@projects/<name>/<path>`
|
|
94
|
+
readonly description: "Create or replace a note. Name it for what it holds and when to use it. Store what git and history can't recover. Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable homes; `@projects/<name>/<path>` and `@sessions/<id>/<path>` read named project and session notes (read-only). Not file paths: never pass them to file tools.";
|
|
95
95
|
readonly parameters: Type.TObject<{
|
|
96
96
|
address: Type.TString;
|
|
97
97
|
content: Type.TString;
|
|
@@ -126,7 +126,7 @@ export declare const DIFF_SHORTENED_MARKER = "[diff truncated; update applied]";
|
|
|
126
126
|
export declare const notesUpdate: {
|
|
127
127
|
readonly name: "notes_update";
|
|
128
128
|
readonly label: "Notes update";
|
|
129
|
-
readonly description: "Edit a note, change its origin or crumpled state, or move it. Each `oldText` must match exactly once unless `replace_all` is true. Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable homes; `@projects/<name>/<path>`
|
|
129
|
+
readonly description: "Edit a note, change its origin or crumpled state, or move it. Each `oldText` must match exactly once unless `replace_all` is true. Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable homes; `@projects/<name>/<path>` and `@sessions/<id>/<path>` read named project and session notes (read-only). Not file paths: never pass them to file tools.";
|
|
130
130
|
readonly parameters: Type.TObject<{
|
|
131
131
|
address: Type.TString;
|
|
132
132
|
edits: Type.TOptional<Type.TArray<Type.TObject<{
|
|
@@ -160,7 +160,7 @@ export declare const notesReadParameters: Type.TObject<{
|
|
|
160
160
|
export declare const notesRead: {
|
|
161
161
|
readonly name: "notes_read";
|
|
162
162
|
readonly label: "Notes read";
|
|
163
|
-
readonly description: "Read a note. Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable homes; `@projects/<name>/<path>`
|
|
163
|
+
readonly description: "Read a note. Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable homes; `@projects/<name>/<path>` and `@sessions/<id>/<path>` read named project and session notes (read-only). Not file paths: never pass them to file tools.";
|
|
164
164
|
readonly parameters: Type.TObject<{
|
|
165
165
|
offset_chars: Type.TOptional<Type.TInteger>;
|
|
166
166
|
max_chars: Type.TOptional<Type.TInteger>;
|
|
@@ -200,7 +200,7 @@ export declare const notesListParameters: Type.TObject<{
|
|
|
200
200
|
export declare const notesList: {
|
|
201
201
|
readonly name: "notes_list";
|
|
202
202
|
readonly label: "Notes list";
|
|
203
|
-
readonly description: "List notes
|
|
203
|
+
readonly description: "List notes, newest first. Not pageable; `more` counts the rest. Omit `glob` or use `@default` for this session and current shared homes; `**` searches all homes, `@sessions/*/**` searches all sessions. Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable homes; `@projects/<name>/<path>` and `@sessions/<id>/<path>` read named project and session notes (read-only). Not file paths: never pass them to file tools.";
|
|
204
204
|
readonly parameters: Type.TObject<{
|
|
205
205
|
glob: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
|
206
206
|
limit: Type.TOptional<Type.TInteger>;
|
|
@@ -239,7 +239,7 @@ export declare const MATCH_SHORTENED_MARKER = " [truncated]";
|
|
|
239
239
|
export declare const notesSearch: {
|
|
240
240
|
readonly name: "notes_search";
|
|
241
241
|
readonly label: "Notes search";
|
|
242
|
-
readonly description: "Search note bodies for literal text, case-insensitive. Without a query, lists notes with no match lines. Returns matching lines with offsets for `notes_read`. Not pageable; `more` counts the rest. Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable homes; `@projects/<name>/<path>`
|
|
242
|
+
readonly description: "Search note bodies for literal text, case-insensitive. Without a query, lists notes with no match lines. Returns matching lines with offsets for `notes_read`. Not pageable; `more` counts the rest. Omit `glob` or use `@default` for this session and current shared homes; `**` searches all homes, `@sessions/*/**` searches all sessions. Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable homes; `@projects/<name>/<path>` and `@sessions/<id>/<path>` read named project and session notes (read-only). Not file paths: never pass them to file tools.";
|
|
243
243
|
readonly parameters: Type.TObject<{
|
|
244
244
|
query: Type.TOptional<Type.TUnion<[Type.TString, Type.TArray<Type.TString>]>>;
|
|
245
245
|
glob: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
|
package/dist/src/tools/notes.js
CHANGED
|
@@ -12,8 +12,9 @@ const ORIGIN = Type.Optional(Type.Union([...ORIGIN_VALUES], {
|
|
|
12
12
|
const CRUMPLED_PARAMETER = Type.Optional(Type.Boolean({ description: "(optional) true = crumple (hide from list and search, still readable); false = restore." }));
|
|
13
13
|
const CRUMPLED_LIST_PARAMETER = Type.Optional(Type.Boolean({ description: "(optional) true = list only crumpled notes." }));
|
|
14
14
|
const FILE_LIMIT_PARAMETER = Type.Optional(Type.Integer({ minimum: 1, description: "(optional, default as many as fit) Max notes." }));
|
|
15
|
-
const GLOB_PARAMETER = nullableString("(optional) Glob over full addresses.");
|
|
16
|
-
const
|
|
15
|
+
const GLOB_PARAMETER = nullableString("(optional) Glob over full addresses, or @default for the current homes.");
|
|
16
|
+
const QUERY_HOMES_DESCRIPTION = "Omit `glob` or use `@default` for this session and current shared homes; `**` searches all homes, `@sessions/*/**` searches all sessions.";
|
|
17
|
+
const ADDRESS_DESCRIPTION = "Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable homes; `@projects/<name>/<path>` and `@sessions/<id>/<path>` read named project and session notes (read-only). Not file paths: never pass them to file tools.";
|
|
17
18
|
/**
|
|
18
19
|
* Typed refusal. Every fact a caller needs is already in the message; there is no separate context.
|
|
19
20
|
* Convert expected refusals; unexpected errors propagate unchanged.
|
|
@@ -287,7 +288,7 @@ function renderListData(data) {
|
|
|
287
288
|
}
|
|
288
289
|
export const notesList = {
|
|
289
290
|
name: "notes_list", label: "Notes list",
|
|
290
|
-
description: `List notes
|
|
291
|
+
description: `List notes, newest first. Not pageable; \`more\` counts the rest. ${QUERY_HOMES_DESCRIPTION} ${ADDRESS_DESCRIPTION}`,
|
|
291
292
|
parameters: notesListParameters, outputSchema: resultSchema(NotesListDataSchema),
|
|
292
293
|
async execute(params, identity) {
|
|
293
294
|
try {
|
|
@@ -337,7 +338,7 @@ function fitSearchFile(file, fits) {
|
|
|
337
338
|
}
|
|
338
339
|
export const notesSearch = {
|
|
339
340
|
name: "notes_search", label: "Notes search",
|
|
340
|
-
description: `Search note bodies for literal text, case-insensitive. Without a query, lists notes with no match lines. Returns matching lines with offsets for \`notes_read\`. Not pageable; \`more\` counts the rest. ${ADDRESS_DESCRIPTION}`,
|
|
341
|
+
description: `Search note bodies for literal text, case-insensitive. Without a query, lists notes with no match lines. Returns matching lines with offsets for \`notes_read\`. Not pageable; \`more\` counts the rest. ${QUERY_HOMES_DESCRIPTION} ${ADDRESS_DESCRIPTION}`,
|
|
341
342
|
parameters: notesSearchParameters, outputSchema: resultSchema(NotesSearchDataSchema),
|
|
342
343
|
async execute(params, identity) {
|
|
343
344
|
try {
|
|
@@ -5,12 +5,13 @@ import { join } from "node:path";
|
|
|
5
5
|
import test from "node:test";
|
|
6
6
|
import { createAssistantMessageEventStream, getCurrentSystemMessage } from "@earendil-works/pi-ai";
|
|
7
7
|
import { createAgentSession, createCodemodeExtension, DefaultResourceLoader, ModelRuntime, SessionManager, SettingsManager, } from "@earendil-works/pi-coding-agent";
|
|
8
|
-
import notesoup, { createNotesoup } from "../
|
|
9
|
-
import { BOOT_TYPE, CONTINUATION_TYPE, GUIDANCE_TYPE, MANUAL_WIPE_TYPE, RESET_MARKER_TYPE, WARNING_TYPE } from "../
|
|
10
|
-
import { historyFromSession } from "../
|
|
8
|
+
import notesoup, { createNotesoup } from "../plugins/pi/extension.js";
|
|
9
|
+
import { BOOT_TYPE, CONTINUATION_TYPE, GUIDANCE_TYPE, MANUAL_WIPE_TYPE, RESET_MARKER_TYPE, WARNING_TYPE } from "../plugins/pi/entries.js";
|
|
10
|
+
import { historyFromSession } from "../plugins/pi/history.js";
|
|
11
11
|
import { assertBootHistory } from "./helpers/extension.js";
|
|
12
12
|
import { NOTES_PROTOCOL_OPEN_TAG, WINDOW_IDENTITY_OPEN_TAG } from "../src/boot/text.js";
|
|
13
|
-
import { FORCED_CONTINUATIONS, GUIDANCE_OPEN_TAG, NORMAL_CONTINUATIONS,
|
|
13
|
+
import { FORCED_CONTINUATIONS, GUIDANCE_OPEN_TAG, NORMAL_CONTINUATIONS, warningPrompt } from "../src/budget/text.js";
|
|
14
|
+
import { warningContent } from "../plugins/pi/text.js";
|
|
14
15
|
async function openFixture(options) {
|
|
15
16
|
const dir = options.cwd ?? mkdtempSync(join(tmpdir(), "notesoup-agent-loop-"));
|
|
16
17
|
const ownsDir = options.cwd === undefined;
|
|
@@ -464,7 +465,7 @@ test("real AgentSession: manual command spans its tool batch and stops at settle
|
|
|
464
465
|
if (request === 1)
|
|
465
466
|
return assistant(fixture, [{ type: "text", text: "before manual reset" }]);
|
|
466
467
|
if (request === 2) {
|
|
467
|
-
assert.ok(text(context).includes(WARNING_JSON), "idle /empty
|
|
468
|
+
assert.ok(text(context).includes(WARNING_JSON), "idle /empty sends the shared checkpoint prompt");
|
|
468
469
|
return assistant(fixture, [{ type: "toolCall", id: "manual-note", name: "notes_write", arguments: { address: "manual-a.md", content: "MANUAL_NOTE_ALPHA" } }], "toolUse");
|
|
469
470
|
}
|
|
470
471
|
assert.equal(request, 3, "the close-out turn finishes in the old window");
|
|
@@ -475,7 +476,7 @@ test("real AgentSession: manual command spans its tool batch and stops at settle
|
|
|
475
476
|
try {
|
|
476
477
|
await fixture.session.prompt("MANUAL_CLOSEOUT_OLD_SENTINEL");
|
|
477
478
|
await fixture.session.waitForIdle();
|
|
478
|
-
await fixture.session.prompt("/empty
|
|
479
|
+
await fixture.session.prompt("/empty");
|
|
479
480
|
await fixture.session.waitForIdle();
|
|
480
481
|
assert.equal(fixture.requests.length, 3, "the run stops at settlement instead of continuing in the fresh window");
|
|
481
482
|
assert.equal(resetMarkers(fixture).length, 1);
|
|
@@ -504,7 +505,7 @@ test("real AgentSession: manual command spans its tool batch and stops at settle
|
|
|
504
505
|
}
|
|
505
506
|
});
|
|
506
507
|
test("real AgentSession: a clear command keeps its prompt out of the fresh window and resumes once", { timeout: 25000 }, async () => {
|
|
507
|
-
for (const mode of ["empty
|
|
508
|
+
for (const mode of ["empty", "fresh-window", "hard-reserve", "overflow"]) {
|
|
508
509
|
let fixture;
|
|
509
510
|
const prompt = 'AFTER_CLEAR_PROMPT_SENTINEL /cm "literal text"';
|
|
510
511
|
// `text()` serializes to JSON, so a quoted argument reaches the provider in its escaped form.
|
|
@@ -532,7 +533,7 @@ test("real AgentSession: a clear command keeps its prompt out of the fresh windo
|
|
|
532
533
|
});
|
|
533
534
|
try {
|
|
534
535
|
await fixture.session.prompt("PROMPT_RESET_OLD_SENTINEL");
|
|
535
|
-
await fixture.session.prompt(`/${mode === "empty
|
|
536
|
+
await fixture.session.prompt(`/${mode === "empty" ? "empty" : "fresh-window"} ${prompt} `);
|
|
536
537
|
await fixture.session.waitForIdle();
|
|
537
538
|
assert.equal(fixture.requests.length, 3);
|
|
538
539
|
assert.equal(resetMarkers(fixture).length, 1);
|
|
@@ -598,7 +599,7 @@ test("real AgentSession: streaming clear prompt keeps the first request", { time
|
|
|
598
599
|
const running = fixture.session.prompt("streaming old work");
|
|
599
600
|
await ready;
|
|
600
601
|
await fixture.session.prompt("/fresh-window FIRST_RESET_PROMPT", { streamingBehavior: "steer" });
|
|
601
|
-
await fixture.session.prompt("/empty
|
|
602
|
+
await fixture.session.prompt("/empty IGNORED_RESET_PROMPT", { streamingBehavior: "steer" });
|
|
602
603
|
release();
|
|
603
604
|
await running;
|
|
604
605
|
await fixture.session.waitForIdle();
|
|
@@ -630,7 +631,7 @@ test("real AgentSession: manual hard-reserve reset stops clean and mixed-tool tu
|
|
|
630
631
|
});
|
|
631
632
|
try {
|
|
632
633
|
await fixture.session.prompt("HARD_RESERVE_OLD_SENTINEL");
|
|
633
|
-
await fixture.session.prompt("/empty
|
|
634
|
+
await fixture.session.prompt("/empty");
|
|
634
635
|
await fixture.session.waitForIdle();
|
|
635
636
|
assert.equal(fixture.requests.length, 2);
|
|
636
637
|
assert.equal(resetMarkers(fixture).length, 1, "the safety wipe is not repeated at settlement");
|
|
@@ -678,7 +679,7 @@ test("real AgentSession: manual safety reset answers queued user input once befo
|
|
|
678
679
|
});
|
|
679
680
|
try {
|
|
680
681
|
await fixture.session.prompt("QUEUED_SAFETY_OLD_SENTINEL");
|
|
681
|
-
await fixture.session.prompt("/empty
|
|
682
|
+
await fixture.session.prompt("/empty");
|
|
682
683
|
await fixture.session.waitForIdle();
|
|
683
684
|
assert.equal(fixture.requests.length, 4, "queued input is answered once after Pi's tool follow-up, then the stop lands");
|
|
684
685
|
assert.equal(resetMarkers(fixture).length, 1);
|
|
@@ -701,7 +702,7 @@ test("real AgentSession: manual overflow wipes and stops even with automatic res
|
|
|
701
702
|
});
|
|
702
703
|
try {
|
|
703
704
|
await fixture.session.prompt("MANUAL_OVERFLOW_OLD_SENTINEL");
|
|
704
|
-
await fixture.session.prompt("/empty
|
|
705
|
+
await fixture.session.prompt("/empty");
|
|
705
706
|
await fixture.session.waitForIdle();
|
|
706
707
|
assert.equal(fixture.requests.length, 2);
|
|
707
708
|
assert.equal(resetMarkers(fixture).length, 1);
|
|
@@ -712,7 +713,7 @@ test("real AgentSession: manual overflow wipes and stops even with automatic res
|
|
|
712
713
|
fixture.close();
|
|
713
714
|
}
|
|
714
715
|
});
|
|
715
|
-
test("real AgentSession: streaming /empty
|
|
716
|
+
test("real AgentSession: streaming /empty steers a close-out and stops at settlement", { timeout: 20000 }, async () => {
|
|
716
717
|
let fixture;
|
|
717
718
|
let announceStarted;
|
|
718
719
|
let releaseResponse;
|
|
@@ -734,8 +735,8 @@ test("real AgentSession: streaming /empty-brain steers a close-out and stops at
|
|
|
734
735
|
try {
|
|
735
736
|
const running = fixture.session.prompt("STREAMING_WIPE_OLD_SENTINEL");
|
|
736
737
|
await started;
|
|
737
|
-
await fixture.session.prompt("/empty
|
|
738
|
-
await fixture.session.prompt("/empty
|
|
738
|
+
await fixture.session.prompt("/empty", { streamingBehavior: "steer" });
|
|
739
|
+
await fixture.session.prompt("/empty", { streamingBehavior: "followUp" });
|
|
739
740
|
assert.equal(fixture.notices.filter((notice) => notice.includes("Brain being emptied")).length, 1, "the user is notified once while output is ongoing");
|
|
740
741
|
assert.equal(resetMarkers(fixture).length, 0, "the ongoing turn is not interrupted");
|
|
741
742
|
releaseResponse();
|
|
@@ -769,9 +770,9 @@ test("real AgentSession: repeated manual commands share one pending window", { t
|
|
|
769
770
|
},
|
|
770
771
|
});
|
|
771
772
|
try {
|
|
772
|
-
const first = fixture.session.prompt("/empty
|
|
773
|
+
const first = fixture.session.prompt("/empty");
|
|
773
774
|
await started;
|
|
774
|
-
const second = fixture.session.prompt("/empty
|
|
775
|
+
const second = fixture.session.prompt("/empty");
|
|
775
776
|
releaseResponse();
|
|
776
777
|
await Promise.all([first, second]);
|
|
777
778
|
await fixture.session.waitForIdle();
|
|
@@ -854,7 +855,7 @@ test("real AgentSession: steering and follow-up queued during a manual reset are
|
|
|
854
855
|
},
|
|
855
856
|
});
|
|
856
857
|
try {
|
|
857
|
-
const command = fixture.session.prompt("/empty
|
|
858
|
+
const command = fixture.session.prompt("/empty");
|
|
858
859
|
await started;
|
|
859
860
|
if (delivery === "steer")
|
|
860
861
|
fixture.session.steer("QUEUED_DURING_FALLBACK");
|
|
@@ -1093,7 +1094,7 @@ test("real AgentSession: hidden or missing reset boots refuse to move the bounda
|
|
|
1093
1094
|
try {
|
|
1094
1095
|
await fixture.session.prompt("ROOT_BEFORE_HIDDEN_BOOT");
|
|
1095
1096
|
await fixture.session.waitForIdle();
|
|
1096
|
-
await fixture.session.prompt("/empty
|
|
1097
|
+
await fixture.session.prompt("/empty");
|
|
1097
1098
|
await fixture.session.waitForIdle();
|
|
1098
1099
|
await fixture.session.prompt("VALID_POST_MARKER_WORK");
|
|
1099
1100
|
await fixture.session.waitForIdle();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { resetBoundaryCommitted } from "../
|
|
2
|
-
import { inspectResetTail } from "../
|
|
1
|
+
import { resetBoundaryCommitted } from "../plugins/pi/reset/committed.js";
|
|
2
|
+
import { inspectResetTail } from "../plugins/pi/reset/artifacts.js";
|
|
3
3
|
import assert from "node:assert/strict";
|
|
4
4
|
import { rmSync, writeFileSync } from "node:fs";
|
|
5
5
|
import test from "node:test";
|
|
6
|
-
import { historyFromSession } from "../
|
|
7
|
-
import { BOOT_TYPE, GUIDANCE_TYPE, RESET_MARKER_TYPE } from "../
|
|
6
|
+
import { historyFromSession } from "../plugins/pi/history.js";
|
|
7
|
+
import { BOOT_TYPE, GUIDANCE_TYPE, RESET_MARKER_TYPE } from "../plugins/pi/entries.js";
|
|
8
8
|
import { NOTES_PROTOCOL_OPEN_TAG, WINDOW_IDENTITY_CLOSE_TAG, WINDOW_IDENTITY_OPEN_TAG } from "../src/boot/text.js";
|
|
9
9
|
import { FORCED_CONTINUATIONS, NORMAL_CONTINUATIONS } from "../src/budget/text.js";
|
|
10
10
|
import { listNotes } from "./helpers/notes.js";
|
|
11
|
-
import { CONTINUATION_TYPE, MANUAL_WIPE_TYPE } from "../
|
|
11
|
+
import { CONTINUATION_TYPE, MANUAL_WIPE_TYPE } from "../plugins/pi/entries.js";
|
|
12
12
|
import { appendText, assertBootHistory, call, commitTurnEndBoundary, context, makeExtension, manager, noticesOf, resultData, resultJson, resultRead, runContextHook, runContextWithSystemHook, runHandlers, runManualCompact, runCommand, sentOf, } from "./helpers/extension.js";
|
|
13
13
|
import { installExtensionTestHooks } from "./helpers/extension-test-environment.js";
|
|
14
14
|
const testEnvironment = installExtensionTestHooks("notesoup-integration");
|
|
@@ -316,10 +316,10 @@ test("empty_brain uses one turn boundary and never calls ctx.compact", async ()
|
|
|
316
316
|
assert.equal(sessionManager.getBranch().filter((entry) => entry.type === "custom" && entry.customType === RESET_MARKER_TYPE).length, 1);
|
|
317
317
|
assert.equal(sessionManager.getBranch().filter((entry) => entry.type === "custom_message" && entry.customType === BOOT_TYPE && entry.details && typeof entry.details === "object" && "windowId" in entry.details).length, 1);
|
|
318
318
|
});
|
|
319
|
-
test("/empty
|
|
319
|
+
test("/empty waits out non-agent busy work before starting its single-turn request", async () => {
|
|
320
320
|
const sessionManager = manager();
|
|
321
321
|
const captured = makeExtension(sessionManager);
|
|
322
|
-
const cmd = captured.commands.get("empty
|
|
322
|
+
const cmd = captured.commands.get("empty");
|
|
323
323
|
assert.ok(cmd);
|
|
324
324
|
let waits = 0;
|
|
325
325
|
const notices = [];
|
|
@@ -334,7 +334,7 @@ test("/empty-brain waits out non-agent busy work before starting its single-turn
|
|
|
334
334
|
assert.equal(captured.sent[0]?.options?.triggerTurn, true);
|
|
335
335
|
assert.equal(notices.filter((message) => message.includes("Brain being emptied")).length, 1);
|
|
336
336
|
});
|
|
337
|
-
test("notesoup command toggles future work, /empty
|
|
337
|
+
test("notesoup command toggles future work, /empty schedules a turn-end reset, and /compact remains disabled", async () => {
|
|
338
338
|
const sessionManager = manager();
|
|
339
339
|
appendText(sessionManager, "user", "hello");
|
|
340
340
|
const captured = makeExtension(sessionManager);
|
|
@@ -353,7 +353,7 @@ test("notesoup command toggles future work, /empty-brain schedules a turn-end re
|
|
|
353
353
|
assert.match(offResult.error ?? "", /off/, "empty_brain refuses while off");
|
|
354
354
|
notices = await runCommand(captured, "notesoup", "on", low);
|
|
355
355
|
assert.match(notices[0]?.message ?? "", /on/);
|
|
356
|
-
notices = await runCommand(captured, "empty
|
|
356
|
+
notices = await runCommand(captured, "empty", "", low);
|
|
357
357
|
assert.equal(notices.length, 1, "the command acknowledges the reset request");
|
|
358
358
|
assert.match(notices[0]?.message ?? "", /Brain being emptied/);
|
|
359
359
|
assert.equal(captured.sent.length, 2, "the command persists one hidden warning after the startup boot");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
3
|
import { DEFAULT_REMINDER_MARGIN_TOKENS, DEFAULT_RESERVE_TOKENS } from "../src/budget/constants.js";
|
|
4
|
-
import { GUIDANCE_TYPE, WARNING_TYPE } from "../
|
|
4
|
+
import { GUIDANCE_TYPE, WARNING_TYPE } from "../plugins/pi/entries.js";
|
|
5
5
|
import { NOTESOUP_SETTINGS_KEY } from "../src/settings.js";
|
|
6
6
|
import { appendText, call, commitTurnEndBoundary, context, makeExtension, manager, noticesOf, resultJson, runContextHook, runHandlers, sentOf, settingsFixture, } from "./helpers/extension.js";
|
|
7
7
|
import { installExtensionTestHooks } from "./helpers/extension-test-environment.js";
|
|
@@ -3,13 +3,13 @@ import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import test from "node:test";
|
|
6
|
-
import { claudeHistoryFromJsonl, readClaudeHistory } from "../
|
|
6
|
+
import { claudeHistoryFromJsonl, readClaudeHistory } from "../plugins/claude/src/history.js";
|
|
7
7
|
import { renderBootBlock } from "../src/boot/render.js";
|
|
8
8
|
import { unavailableNotesSnapshot } from "../src/boot/snapshot.js";
|
|
9
9
|
import { DEFAULT_BOOT_TOOL_NAMES } from "../src/boot/text.js";
|
|
10
10
|
import { allItems, eventDocument } from "../src/history/history.js";
|
|
11
11
|
import { historyList, historyRead, historyWindows } from "../src/tools/history.js";
|
|
12
|
-
import { dispatch } from "../
|
|
12
|
+
import { dispatch } from "../plugins/claude/src/helper.js";
|
|
13
13
|
const sessionId = "synthetic-session";
|
|
14
14
|
function row(uuid, parentUuid, type, content, extra = {}) {
|
|
15
15
|
return { uuid, parentUuid, type, sessionId, timestamp: "2026-01-01T00:00:00Z", isSidechain: false,
|
|
@@ -6,14 +6,15 @@ import { join } from "node:path";
|
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
import test from "node:test";
|
|
8
8
|
import { build } from "esbuild";
|
|
9
|
-
import { dispatch, handleLine } from "../
|
|
10
|
-
import { DEFAULT_CLAUDE_RESET_MARGIN_TOKENS, resolveClaudeLimits } from "../
|
|
9
|
+
import { dispatch, handleLine } from "../plugins/claude/src/helper.js";
|
|
10
|
+
import { DEFAULT_CLAUDE_RESET_MARGIN_TOKENS, resolveClaudeLimits } from "../plugins/claude/src/thresholds.js";
|
|
11
11
|
import { WARNING_RUNWAY_TOKENS } from "../src/budget/constants.js";
|
|
12
|
-
import { PROTOCOL_WIPE_SENTENCE,
|
|
13
|
-
import { CLAUDE_WARNING_PROMPT,
|
|
12
|
+
import { PROTOCOL_WIPE_SENTENCE, renderProtocolBlock } from "../src/boot/text.js";
|
|
13
|
+
import { CLAUDE_WARNING_PROMPT, CLAUDE_WIPE_SENTENCE } from "../plugins/claude/src/text.js";
|
|
14
|
+
import { COUNTDOWN_LINE, FORCED_CONTINUATIONS } from "../src/budget/text.js";
|
|
14
15
|
import { createNotesStore } from "../src/notes/index.js";
|
|
15
16
|
import { resolveProjectHome } from "../src/notes/project-home.js";
|
|
16
|
-
import { notesIdentityFromPi } from "../
|
|
17
|
+
import { notesIdentityFromPi } from "../plugins/pi/notes/adapter.js";
|
|
17
18
|
import { context, manager } from "./helpers/extension.js";
|
|
18
19
|
const identity = { home: mkdtempSync(join(tmpdir(), "claude-mod-")), sessionId: "session", cwd: process.cwd(), agent: "claude", model: "claude" };
|
|
19
20
|
async function callTool(tool, params) {
|
|
@@ -25,7 +26,7 @@ async function callTool(tool, params) {
|
|
|
25
26
|
* gets the real one; nothing else about the module is changed.
|
|
26
27
|
*/
|
|
27
28
|
async function loadHookModule(t) {
|
|
28
|
-
const hooksDir = join(process.cwd(), "
|
|
29
|
+
const hooksDir = join(process.cwd(), "plugins/claude/hooks");
|
|
29
30
|
const transpiled = await build({
|
|
30
31
|
stdin: { contents: readFileSync(join(hooksDir, "register.ts"), "utf8"), loader: "ts", resolveDir: hooksDir, sourcefile: "register.ts" },
|
|
31
32
|
bundle: false, format: "esm", platform: "node", target: "node22", write: false,
|
|
@@ -241,7 +242,7 @@ test("Claude Mod helper runs from a standalone copied plugin directory", () => {
|
|
|
241
242
|
const fixture = mkdtempSync(join(tmpdir(), "claude-mod-install-"));
|
|
242
243
|
try {
|
|
243
244
|
const plugin = join(fixture, "notesoup");
|
|
244
|
-
cpSync(join(process.cwd(), "
|
|
245
|
+
cpSync(join(process.cwd(), "plugins/claude"), plugin, { recursive: true });
|
|
245
246
|
const hook = readFileSync(join(plugin, "hooks/register.ts"), "utf8");
|
|
246
247
|
assert.ok(hook.includes('${import.meta.dir}/../dist/claude/helper.js'));
|
|
247
248
|
const helper = join(plugin, "dist/claude/helper.js");
|
|
@@ -463,7 +464,7 @@ test("Claude Mod headless detection skips compaction and logs once", async (t) =
|
|
|
463
464
|
await invoke("turn.complete");
|
|
464
465
|
assert.equal(attempts, 0, "headless sessions skip the unsupported capability from startup");
|
|
465
466
|
assert.deepEqual(notifications, ["🥣 No brain when headless"]);
|
|
466
|
-
const manual = await invoke("command.run", { command: "empty
|
|
467
|
+
const manual = await invoke("command.run", { command: "empty" });
|
|
467
468
|
assert.match(manual.text, /No brain when headless/);
|
|
468
469
|
assert.equal(notifications.length, 1);
|
|
469
470
|
const boot = await handlers.get("prompt.context")(host, {}, async () => ({ blocks: [] }));
|
|
@@ -522,6 +523,8 @@ test("Claude Mod manual reset uses one hidden close-out turn, then recovers its
|
|
|
522
523
|
const home = mkdtempSync(join(tmpdir(), "claude-manual-home-"));
|
|
523
524
|
t.after(() => rmSync(home, { recursive: true, force: true }));
|
|
524
525
|
const { host } = fakeEngine(home);
|
|
526
|
+
const commands = [];
|
|
527
|
+
host.command.register = async (spec) => { commands.push(spec.name); return { command: spec.name }; };
|
|
525
528
|
let handlers = new Map();
|
|
526
529
|
const invoke = (name, e = {}) => handlers.get(name)(host, e, async () => ({}));
|
|
527
530
|
const timers = [];
|
|
@@ -542,7 +545,10 @@ test("Claude Mod manual reset uses one hidden close-out turn, then recovers its
|
|
|
542
545
|
};
|
|
543
546
|
(await loadHookModule(t)).register((event, handler) => handlers.set(event, handler));
|
|
544
547
|
await invoke("session.start", { cwd: home, isInteractive: true });
|
|
545
|
-
|
|
548
|
+
assert.deepEqual(commands.sort(), ["empty", "fresh-window"], "only the new short name and the retained alias are registered");
|
|
549
|
+
assert.deepEqual(await invoke("command.run", { command: "empty-brain" }), {}, "the retired spelling passes through instead of resetting");
|
|
550
|
+
assert.equal(timers.length, 0);
|
|
551
|
+
const command = await invoke("command.run", { command: "empty" });
|
|
546
552
|
assert.match(command.text, /Brain being emptied/);
|
|
547
553
|
await Promise.resolve();
|
|
548
554
|
assert.equal(compactions, 0, "command.run must not call compact under its held turn");
|
|
@@ -560,7 +566,7 @@ test("Claude Mod manual reset uses one hidden close-out turn, then recovers its
|
|
|
560
566
|
await invoke("session.start", { cwd: home, isInteractive: true });
|
|
561
567
|
assert.deepEqual(await handlers.get("prompt.context")(host, {}, async () => ({ blocks: [] })), { blocks: [] }, "reload does not duplicate the already-retained boot");
|
|
562
568
|
await invoke("turn.start");
|
|
563
|
-
await invoke("command.run", { command: "empty
|
|
569
|
+
await invoke("command.run", { command: "empty" });
|
|
564
570
|
await invoke("turn.complete");
|
|
565
571
|
assert.equal(prompts.length, 1, "a busy manual request reuses the current turn instead of submitting another");
|
|
566
572
|
assert.match(kept[0].text, /Current context window id: claude:hook-session:2/);
|
|
@@ -631,7 +637,7 @@ test("Claude Mod stops the automatic reset and the manual command under DISABLE_
|
|
|
631
637
|
await invoke("session.start", { cwd: home, isInteractive: true });
|
|
632
638
|
assert.equal(notifications.length, 1, "one startup line");
|
|
633
639
|
assert.match(notifications[0], /DISABLE_COMPACT/);
|
|
634
|
-
const manual = await invoke("command.run", { command: "empty
|
|
640
|
+
const manual = await invoke("command.run", { command: "empty" });
|
|
635
641
|
assert.match(manual.text, /DISABLE_COMPACT/);
|
|
636
642
|
assert.equal(timers.length, 0, "no close-out turn is queued");
|
|
637
643
|
await invoke("turn.start");
|
|
@@ -661,10 +667,10 @@ test("Claude Mod skips the automatic reset when thresholds cannot be resolved",
|
|
|
661
667
|
assert.equal(notifications.filter((text) => text.includes("Brain size unknown")).length, 1, "one line, not one per turn");
|
|
662
668
|
});
|
|
663
669
|
test("Claude skill projections stay byte-identical to canonical shared files", () => {
|
|
664
|
-
assert.deepEqual(readFileSync(join(process.cwd(), "
|
|
665
|
-
assert.deepEqual(readFileSync(join(process.cwd(), "
|
|
666
|
-
assert.deepEqual(readFileSync(join(process.cwd(), "
|
|
667
|
-
const skill = readFileSync(join(process.cwd(), "
|
|
670
|
+
assert.deepEqual(readFileSync(join(process.cwd(), "plugins/claude/skills/memory/SKILL.md")), readFileSync(join(process.cwd(), "skills/memory/SKILL.md")));
|
|
671
|
+
assert.deepEqual(readFileSync(join(process.cwd(), "plugins/claude/skills/dream/SKILL.md")), readFileSync(join(process.cwd(), "skills/dream/SKILL.md")));
|
|
672
|
+
assert.deepEqual(readFileSync(join(process.cwd(), "plugins/claude/playbook.md")), readFileSync(join(process.cwd(), "playbook.md")));
|
|
673
|
+
const skill = readFileSync(join(process.cwd(), "plugins/claude/skills/dream/SKILL.md"), "utf8");
|
|
668
674
|
assert.match(skill, /\.\.\/\.\.\/playbook\.md/);
|
|
669
675
|
assert.doesNotMatch(skill, /Claude.*runner|dream runner/i);
|
|
670
676
|
});
|
|
@@ -794,7 +800,7 @@ test("Claude session.end gives /clear, /resume and /branch a fresh boot and iden
|
|
|
794
800
|
host.session.usage = async () => ({ context: { tokens: 142_424, window: 200_000 } });
|
|
795
801
|
assert.equal((await context()).blocks[0]?.name, "notesoup:warning", "the old window has already warned");
|
|
796
802
|
await invoke("turn.start");
|
|
797
|
-
await invoke("command.run", { command: "empty
|
|
803
|
+
await invoke("command.run", { command: "empty" });
|
|
798
804
|
const ended = { sentinel: action };
|
|
799
805
|
assert.equal(await invoke("session.end", { reason: action === "clear" ? "clear" : "resume", sessionId: "hook-session" }, ended), ended);
|
|
800
806
|
host.session.id = async () => `after-${action}`;
|
|
@@ -4,7 +4,7 @@ import { cpSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:f
|
|
|
4
4
|
import { tmpdir } from "node:os";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import test from "node:test";
|
|
7
|
-
const plugin = join(process.cwd(), "
|
|
7
|
+
const plugin = join(process.cwd(), "plugins/claude");
|
|
8
8
|
/** Only an absent executable may skip the real loader gate; other failures fail the suite. */
|
|
9
9
|
function validate(t, dir) {
|
|
10
10
|
const result = spawnSync("claude", ["plugin", "validate", dir, "--strict", "--json"], {
|
|
@@ -25,10 +25,10 @@ test("Claude mod passes the installed engine's strict loader validation", (t) =>
|
|
|
25
25
|
return;
|
|
26
26
|
assert.equal(result.status, 0, result.stdout + result.stderr);
|
|
27
27
|
assert.equal(result.report.success, true, result.stdout);
|
|
28
|
-
t.diagnostic("claude plugin validate
|
|
28
|
+
t.diagnostic("claude plugin validate plugins/claude --strict: passed");
|
|
29
29
|
});
|
|
30
30
|
test("Claude mod typechecks against the vendored engine contract without Node globals", () => {
|
|
31
|
-
const result = spawnSync(process.execPath, ["node_modules/typescript/bin/tsc", "-p", "
|
|
31
|
+
const result = spawnSync(process.execPath, ["node_modules/typescript/bin/tsc", "-p", "plugins/claude/tsconfig.json"], {
|
|
32
32
|
encoding: "utf8", timeout: 30_000,
|
|
33
33
|
});
|
|
34
34
|
assert.ifError(result.error);
|