notesoup 0.59.0 → 0.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugins/dsh/tools.js +0 -3
- package/dist/src/boot/text.d.ts +1 -1
- package/dist/src/boot/text.js +6 -10
- package/dist/src/notes/address.d.ts +1 -1
- package/dist/src/notes/address.js +1 -1
- package/dist/src/notes/policy.js +1 -1
- package/dist/src/tools/dream.d.ts +3 -3
- package/dist/src/tools/dream.js +5 -5
- package/dist/src/tools/history.js +12 -13
- package/dist/src/tools/notes.d.ts +7 -5
- package/dist/src/tools/notes.js +35 -34
- package/dist/src/tools/result.js +2 -2
- package/dist/src/tools/schema.js +2 -2
- package/dist/test/dsh.test.js +13 -1
- package/dist/test/note-policy.test.js +6 -1
- package/dist/test/notes.integration.test.js +28 -0
- package/package.json +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/dist/claude/helper.js +59 -61
- package/plugins/claude/hooks/register.ts +6 -4
- package/plugins/codex/dist/codex/notesoup.js +59 -61
- package/plugins/dsh/tools.ts +0 -2
- package/src/boot/text.ts +6 -10
- package/src/notes/address.ts +1 -1
- package/src/notes/policy.ts +1 -1
- package/src/tools/dream.ts +5 -5
- package/src/tools/history.ts +12 -14
- package/src/tools/notes.ts +35 -33
- package/src/tools/result.ts +2 -2
- package/src/tools/schema.ts +2 -2
|
@@ -24990,7 +24990,7 @@ function filteredItems(projection, params) {
|
|
|
24990
24990
|
|
|
24991
24991
|
// src/tools/schema.ts
|
|
24992
24992
|
var nullableString = (description) => typebox_exports.Optional(typebox_exports.Union([typebox_exports.String(), typebox_exports.Null()], description === void 0 ? {} : { description }));
|
|
24993
|
-
var historyRoles = () => typebox_exports.Optional(typebox_exports.Array(HistoryRoleSchema, { minItems: 1, description: "
|
|
24993
|
+
var historyRoles = () => typebox_exports.Optional(typebox_exports.Array(HistoryRoleSchema, { minItems: 1, description: "Only these voices: user, assistant, tool, context. Without roles or query, tool and context runs fold into one line." }));
|
|
24994
24994
|
function paramProblem(schema, params) {
|
|
24995
24995
|
const first = Errors2(schema, params).find((error2) => error2.keyword !== "boolean");
|
|
24996
24996
|
if (!first) return "unrecognized shape";
|
|
@@ -24998,7 +24998,7 @@ function paramProblem(schema, params) {
|
|
|
24998
24998
|
const field = first.instancePath.replace(/^\//, "").replaceAll("/", ".");
|
|
24999
24999
|
return `${field ? `${field} ` : ""}${first.message}${extra}`;
|
|
25000
25000
|
}
|
|
25001
|
-
var searchQuery = (description = "
|
|
25001
|
+
var searchQuery = (description = "Text to look for, or a list (any match). Leave it out to just list the pages.") => typebox_exports.Union([typebox_exports.String(), typebox_exports.Array(typebox_exports.String())], { description });
|
|
25002
25002
|
|
|
25003
25003
|
// src/notes/errors.ts
|
|
25004
25004
|
var NoteError = class extends Error {
|
|
@@ -25065,7 +25065,7 @@ function physicalPath(scope, vpath, identity, who) {
|
|
|
25065
25065
|
}
|
|
25066
25066
|
|
|
25067
25067
|
// src/notes/address.ts
|
|
25068
|
-
var ADDRESS_FORMS = "Use <path> for this session, or @project/, @human/, @self/, or @model/ followed by a path; @projects/<name>/<path
|
|
25068
|
+
var ADDRESS_FORMS = "Use <path> for this session, or @project/, @human/, @self/, or @model/ followed by a path; @projects/<name>/<path>, @sessions/<id>/<path>, @agents/<name>/<path>, and @models/<name>/<path> read named notebooks.";
|
|
25069
25069
|
var NAMESPACE_HEADS = /* @__PURE__ */ new Map([
|
|
25070
25070
|
["project", { scope: "project" }],
|
|
25071
25071
|
["human", { scope: "human" }],
|
|
@@ -25166,7 +25166,7 @@ function pinnedPageOrder(path) {
|
|
|
25166
25166
|
}
|
|
25167
25167
|
function noteBudgetWarnings(body, policy) {
|
|
25168
25168
|
const count = Array.from(body).length;
|
|
25169
|
-
return count > policy.budget ? [`Warning: note body is ${count} Unicode code points, over budget ${policy.budget}
|
|
25169
|
+
return count > policy.budget ? [`Warning: note body is ${count} Unicode code points, over budget ${policy.budget} \u2014 boil it down.`] : [];
|
|
25170
25170
|
}
|
|
25171
25171
|
function assertNoteUnlocked(fields, unlock) {
|
|
25172
25172
|
if (fields.readonly === true && unlock !== false) throw new NoteError("readonly", "This note has a soft readonly lock; explicitly set readonly:false to unlock before changing it (or in the same call).");
|
|
@@ -26083,8 +26083,8 @@ var TextWindowSchema = typebox_exports.Object({
|
|
|
26083
26083
|
next_offset_chars: typebox_exports.Union([typebox_exports.Integer({ minimum: 0 }), typebox_exports.Null()], { description: "Pass as `offset_chars` to continue; null at the end." })
|
|
26084
26084
|
}, { additionalProperties: false });
|
|
26085
26085
|
var TextWindowRequestSchema = {
|
|
26086
|
-
offset_chars: typebox_exports.Optional(typebox_exports.Integer({ description: "
|
|
26087
|
-
max_chars: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, maximum: MAX_READ_WINDOW_CHARS, description:
|
|
26086
|
+
offset_chars: typebox_exports.Optional(typebox_exports.Integer({ description: "Where on the page to start reading; negative counts from the end." })),
|
|
26087
|
+
max_chars: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, maximum: MAX_READ_WINDOW_CHARS, description: "How much to read at once." }))
|
|
26088
26088
|
};
|
|
26089
26089
|
function readTextWindow(text2, offset, limit, makeData, render) {
|
|
26090
26090
|
const chars = Array.from(text2);
|
|
@@ -26138,12 +26138,12 @@ function notesIdentityForCall(context2, cwd) {
|
|
|
26138
26138
|
// src/tools/notes.ts
|
|
26139
26139
|
var ORIGIN_VALUES = [typebox_exports.Literal("user"), typebox_exports.Literal("self"), typebox_exports.Literal("external")];
|
|
26140
26140
|
var ORIGIN = typebox_exports.Optional(typebox_exports.Union([...ORIGIN_VALUES], {
|
|
26141
|
-
description: "
|
|
26141
|
+
description: "Whose handwriting: user, self, or external. Leave it out to keep what's there."
|
|
26142
26142
|
}));
|
|
26143
26143
|
var POLICY_PARAMETERS = {
|
|
26144
|
-
pinned: typebox_exports.Optional(typebox_exports.Boolean({ description: "
|
|
26145
|
-
budget: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER, description: "
|
|
26146
|
-
readonly: typebox_exports.Optional(typebox_exports.Boolean({ description: "
|
|
26144
|
+
pinned: typebox_exports.Optional(typebox_exports.Boolean({ description: "Tape the page inside the cover: read whole at every wake-up. Five per notebook, CHEATSHEET and MAP included." })),
|
|
26145
|
+
budget: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER, description: "How much paper the page gets. Writing past it still saves, with a warning. A page over budget gets boiled down: stale lines out, repeats merged, the rest said shorter. More paper is for a page already boiled down that still needs the room." })),
|
|
26146
|
+
readonly: typebox_exports.Optional(typebox_exports.Boolean({ description: "A paperclip that keeps your own hands off. `false` takes it off \u2014 same call is fine." }))
|
|
26147
26147
|
};
|
|
26148
26148
|
var PolicySchema = {
|
|
26149
26149
|
pinned: typebox_exports.Boolean(),
|
|
@@ -26160,13 +26160,12 @@ function renderPolicy(policy) {
|
|
|
26160
26160
|
function withWarnings(text2, data) {
|
|
26161
26161
|
return [text2, ...data.warnings].join("\n");
|
|
26162
26162
|
}
|
|
26163
|
-
var CRUMPLED_PARAMETER = typebox_exports.Optional(typebox_exports.Boolean({ description: "
|
|
26164
|
-
var CRUMPLED_LIST_PARAMETER = typebox_exports.Optional(typebox_exports.Boolean({ description: "
|
|
26165
|
-
var FILE_LIMIT_PARAMETER = typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, description: "
|
|
26166
|
-
var GLOB_PARAMETER = nullableString("
|
|
26167
|
-
var CWD_PARAMETER = typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "
|
|
26168
|
-
var
|
|
26169
|
-
var ADDRESS_DESCRIPTION = "Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable notebooks; `@projects/<name>/<path>` and `@sessions/<id>/<path>` read named project and session notes (read-only). Not file paths: never pass them to file tools.";
|
|
26163
|
+
var CRUMPLED_PARAMETER = typebox_exports.Optional(typebox_exports.Boolean({ description: "`true` balls the page up: gone from list and search, still readable. `false` smooths it flat again." }));
|
|
26164
|
+
var CRUMPLED_LIST_PARAMETER = typebox_exports.Optional(typebox_exports.Boolean({ description: "Only the crumpled balls." }));
|
|
26165
|
+
var FILE_LIMIT_PARAMETER = typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, description: "How many pages at most." }));
|
|
26166
|
+
var GLOB_PARAMETER = nullableString("Which drawers to open. Leave it out for this session and your current notebooks. `@project/**` one shelf \xB7 `MAP.md` that page in every notebook \xB7 `**` everything \xB7 `@sessions/*/**` every session.");
|
|
26167
|
+
var CWD_PARAMETER = typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "Treat this directory's project as `@project/`." }));
|
|
26168
|
+
var ADDRESS_PARAMETER = typebox_exports.String({ description: "Which drawer the page sits in. `plan.md` \u2014 this session's desk, cleared when it ends. `@project/` this project's shelf \xB7 `@human/` your human's file \xB7 `@self/` your own notebook \xB7 `@model/` your brain's. `@projects/<name>/`, `@sessions/<id>/`, `@agents/<name>/`, `@models/<name>/` \u2014 someone else's shelf: read only. Paper, not files: hand one to read/write/edit/bash and a real `@project` folder is born." });
|
|
26170
26169
|
function failureOf(error2) {
|
|
26171
26170
|
if (error2 instanceof NoteError) return failure2(error2.code, error2.message);
|
|
26172
26171
|
if (error2 instanceof InvalidQueryError) return failure2("invalid_query", error2.message);
|
|
@@ -26256,7 +26255,8 @@ var MatchSchema = typebox_exports.Object({
|
|
|
26256
26255
|
}, { additionalProperties: false });
|
|
26257
26256
|
var SearchedFileSchema = typebox_exports.Object({
|
|
26258
26257
|
...ListedFileSchema.properties,
|
|
26259
|
-
matches: typebox_exports.Array(MatchSchema)
|
|
26258
|
+
matches: typebox_exports.Array(MatchSchema),
|
|
26259
|
+
more_matches: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1 }))
|
|
26260
26260
|
}, { additionalProperties: false });
|
|
26261
26261
|
var SnapshotSchema = {
|
|
26262
26262
|
more: typebox_exports.Integer({ description: "How many more were left out." }),
|
|
@@ -26313,14 +26313,14 @@ function listedFile(row, identity) {
|
|
|
26313
26313
|
const policy = policyAt(row.meta, row.address);
|
|
26314
26314
|
return { ...noteIdentity(identity, row.address), ...policy, warnings: row.warnings ?? (row.body === void 0 ? [] : noteBudgetWarnings(row.body, policy)), updated_at: localIso(row.meta.updatedAt), ...row.meta.crumpledAt === void 0 ? {} : { crumpled_at: row.meta.crumpledAt } };
|
|
26315
26315
|
}
|
|
26316
|
-
var notesWriteParameters = typebox_exports.Object({ address:
|
|
26316
|
+
var notesWriteParameters = typebox_exports.Object({ address: ADDRESS_PARAMETER, content: typebox_exports.String({ description: "The whole page." }), origin: ORIGIN, ...POLICY_PARAMETERS, cwd: CWD_PARAMETER }, { additionalProperties: false });
|
|
26317
26317
|
function renderWriteData(data) {
|
|
26318
26318
|
return withWarnings(`${data.outcome} ${renderIdentity(data)} | ${renderPolicy(data)}`, data);
|
|
26319
26319
|
}
|
|
26320
26320
|
var notesWrite = {
|
|
26321
26321
|
name: "notes_write",
|
|
26322
26322
|
label: "Notes write",
|
|
26323
|
-
description:
|
|
26323
|
+
description: "Take a fresh page and write it \u2014 or rip out the old one and write it again. Title it for what's inside and when you'll reach for it.",
|
|
26324
26324
|
parameters: notesWriteParameters,
|
|
26325
26325
|
outputSchema: resultSchema(NotesWriteDataSchema),
|
|
26326
26326
|
executionMode: "sequential",
|
|
@@ -26336,13 +26336,13 @@ var notesWrite = {
|
|
|
26336
26336
|
render: (result) => renderOutcome(result, renderWriteData)
|
|
26337
26337
|
};
|
|
26338
26338
|
var notesUpdateParameters = typebox_exports.Object({
|
|
26339
|
-
address:
|
|
26340
|
-
edits: typebox_exports.Optional(typebox_exports.Array(typebox_exports.Object({ oldText: typebox_exports.String(), newText: typebox_exports.String() }, { additionalProperties: false }))),
|
|
26339
|
+
address: ADDRESS_PARAMETER,
|
|
26340
|
+
edits: typebox_exports.Optional(typebox_exports.Array(typebox_exports.Object({ oldText: typebox_exports.String({ description: "The passage as it stands on the page." }), newText: typebox_exports.String({ description: "What goes in its place." }) }, { additionalProperties: false }), { description: "Pen strokes, in order. Each `oldText` is the exact passage \u2014 same case, found once \u2014 and `newText` is what goes in its place." })),
|
|
26341
26341
|
origin: ORIGIN,
|
|
26342
26342
|
...POLICY_PARAMETERS,
|
|
26343
26343
|
crumpled: CRUMPLED_PARAMETER,
|
|
26344
|
-
replace_all: typebox_exports.Optional(typebox_exports.Boolean({ description: "
|
|
26345
|
-
rename_to: typebox_exports.Optional(typebox_exports.String({ description: "
|
|
26344
|
+
replace_all: typebox_exports.Optional(typebox_exports.Boolean({ description: "Strike every copy of `oldText`, not just one." })),
|
|
26345
|
+
rename_to: typebox_exports.Optional(typebox_exports.String({ description: "Move the page to another address. Never lands on top of a live page; nothing pointing at it follows." })),
|
|
26346
26346
|
cwd: CWD_PARAMETER
|
|
26347
26347
|
}, { additionalProperties: false });
|
|
26348
26348
|
function renderUpdateData(data) {
|
|
@@ -26352,7 +26352,7 @@ function renderUpdateData(data) {
|
|
|
26352
26352
|
var notesUpdate = {
|
|
26353
26353
|
name: "notes_update",
|
|
26354
26354
|
label: "Notes update",
|
|
26355
|
-
description:
|
|
26355
|
+
description: "Work on a page you already have: cross out and rewrite lines, move it, pin it, lock it, give it more paper, crumple it. Keep every page true to now: wrong, stale, or no-longer-mattering lines get rewritten or struck where they stand. The page stays one page.",
|
|
26356
26356
|
parameters: notesUpdateParameters,
|
|
26357
26357
|
outputSchema: resultSchema(NotesUpdateDataSchema),
|
|
26358
26358
|
executionMode: "sequential",
|
|
@@ -26372,7 +26372,7 @@ var notesUpdate = {
|
|
|
26372
26372
|
},
|
|
26373
26373
|
render: (result) => renderOutcome(result, renderUpdateData)
|
|
26374
26374
|
};
|
|
26375
|
-
var notesReadParameters = typebox_exports.Object({ address:
|
|
26375
|
+
var notesReadParameters = typebox_exports.Object({ address: ADDRESS_PARAMETER, ...TextWindowRequestSchema, cwd: CWD_PARAMETER }, { additionalProperties: false });
|
|
26376
26376
|
function renderReadData(data) {
|
|
26377
26377
|
return withWarnings(`${renderIdentity(data)}
|
|
26378
26378
|
${renderMetadata(data.metadata)}`, data) + `
|
|
@@ -26382,7 +26382,7 @@ ${renderTextWindow(data)}`;
|
|
|
26382
26382
|
var notesRead = {
|
|
26383
26383
|
name: "notes_read",
|
|
26384
26384
|
label: "Notes read",
|
|
26385
|
-
description:
|
|
26385
|
+
description: "Read a page. Long ones come a stretch at a time; follow `next_offset_chars`.",
|
|
26386
26386
|
parameters: notesReadParameters,
|
|
26387
26387
|
outputSchema: resultSchema(NotesReadDataSchema),
|
|
26388
26388
|
async execute(params, context2) {
|
|
@@ -26416,7 +26416,7 @@ function renderListData(data) {
|
|
|
26416
26416
|
var notesList = {
|
|
26417
26417
|
name: "notes_list",
|
|
26418
26418
|
label: "Notes list",
|
|
26419
|
-
description:
|
|
26419
|
+
description: "Leaf through the drawers, newest pages on top. One pass; `more` counts pages left on the pile \u2014 narrow `glob`.",
|
|
26420
26420
|
parameters: notesListParameters,
|
|
26421
26421
|
outputSchema: resultSchema(NotesListDataSchema),
|
|
26422
26422
|
async execute(params, context2) {
|
|
@@ -26430,11 +26430,11 @@ var notesList = {
|
|
|
26430
26430
|
},
|
|
26431
26431
|
render: (result) => renderOutcome(result, renderListData)
|
|
26432
26432
|
};
|
|
26433
|
-
var notesSearchParameters = typebox_exports.Object({ query: typebox_exports.Optional(searchQuery()), glob: GLOB_PARAMETER, limit: FILE_LIMIT_PARAMETER, max_matches_per_file: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, description: "
|
|
26433
|
+
var notesSearchParameters = typebox_exports.Object({ query: typebox_exports.Optional(searchQuery()), glob: GLOB_PARAMETER, limit: FILE_LIMIT_PARAMETER, max_matches_per_file: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, description: "How many hit lines per page at most." })), crumpled: CRUMPLED_LIST_PARAMETER, cwd: CWD_PARAMETER }, { additionalProperties: false });
|
|
26434
26434
|
function renderSearchData(data) {
|
|
26435
26435
|
const lines = [`${data.files.length} ${data.files.length === 1 ? "note" : "notes"}`];
|
|
26436
26436
|
for (const file of data.files) {
|
|
26437
|
-
lines.push(`- ${renderIdentity(file)} | ${renderPolicy(file)} | updated ${file.updated_at} | ${file.matches.length} ${file.matches.length === 1 ? "match" : "matches"}`);
|
|
26437
|
+
lines.push(`- ${renderIdentity(file)} | ${renderPolicy(file)} | updated ${file.updated_at} | ${file.matches.length} ${file.matches.length === 1 ? "match" : "matches"}${file.more_matches ? `, ${file.more_matches} more lines` : ""}`);
|
|
26438
26438
|
lines.push(...file.warnings.map((warning) => ` ${warning}`));
|
|
26439
26439
|
for (const match of file.matches) lines.push(` line ${match.line} at offset_chars ${match.offset_chars}: ${match.text}`);
|
|
26440
26440
|
}
|
|
@@ -26442,35 +26442,38 @@ function renderSearchData(data) {
|
|
|
26442
26442
|
for (const namespace of data.namespaces_unavailable) lines.push(`${namespace} could not be read`);
|
|
26443
26443
|
return lines.join("\n");
|
|
26444
26444
|
}
|
|
26445
|
+
function keepMatches(file, count = file.matches.length) {
|
|
26446
|
+
const more = (file.more_matches ?? 0) + Math.max(0, file.matches.length - count);
|
|
26447
|
+
return { ...file, matches: file.matches.slice(0, count), ...more ? { more_matches: more } : {} };
|
|
26448
|
+
}
|
|
26445
26449
|
var MATCH_SHORTENED_MARKER = " [truncated]";
|
|
26446
26450
|
function fitSearchFile(file, fits) {
|
|
26447
26451
|
let low = 0;
|
|
26448
26452
|
let high = file.matches.length;
|
|
26449
26453
|
while (low < high) {
|
|
26450
26454
|
const mid = Math.ceil((low + high) / 2);
|
|
26451
|
-
if (fits(
|
|
26455
|
+
if (fits(keepMatches(file, mid))) low = mid;
|
|
26452
26456
|
else high = mid - 1;
|
|
26453
26457
|
}
|
|
26454
|
-
if (low > 0
|
|
26458
|
+
if (low > 0 || file.matches.length === 0) return keepMatches(file, low);
|
|
26455
26459
|
const first = file.matches[0];
|
|
26456
|
-
|
|
26457
|
-
const withText = (text2) => ({ ...file, matches: [{ ...first, text: `${text2}${MATCH_SHORTENED_MARKER}` }] });
|
|
26460
|
+
const withText = (text2) => ({ ...keepMatches(file, 1), matches: [{ ...first, text: `${text2}${MATCH_SHORTENED_MARKER}` }] });
|
|
26458
26461
|
return withText(prefixFit(first.text, (text2) => fits(withText(text2))));
|
|
26459
26462
|
}
|
|
26460
26463
|
var notesSearch = {
|
|
26461
26464
|
name: "notes_search",
|
|
26462
26465
|
label: "Notes search",
|
|
26463
|
-
description:
|
|
26466
|
+
description: "Run a finger down every page for some text, case doesn't matter. Returns the lines it hits and where they sit; no query just lists the pages. One pass; `more` counts pages left on the pile \u2014 narrow `glob`.",
|
|
26464
26467
|
parameters: notesSearchParameters,
|
|
26465
26468
|
outputSchema: resultSchema(NotesSearchDataSchema),
|
|
26466
26469
|
async execute(params, context2) {
|
|
26467
26470
|
try {
|
|
26468
26471
|
const identity = notesIdentityForCall(context2, params.cwd);
|
|
26469
26472
|
const { rows, status } = await createNotesStore(identity).searchWithStatus(searchQueries(params.query), { glob: params.glob ?? void 0, crumpled: params.crumpled });
|
|
26470
|
-
const files = rows.sort((a, b) => b.meta.updatedAt - a.meta.updatedAt || a.address.localeCompare(b.address)).map((row) => ({
|
|
26473
|
+
const files = rows.sort((a, b) => b.meta.updatedAt - a.meta.updatedAt || a.address.localeCompare(b.address)).map((row) => keepMatches({
|
|
26471
26474
|
...listedFile(row, identity),
|
|
26472
|
-
matches: row.matches.
|
|
26473
|
-
}));
|
|
26475
|
+
matches: row.matches.map((match) => ({ line: match.line, text: match.text, offset_chars: match.offsetChars }))
|
|
26476
|
+
}, params.max_matches_per_file));
|
|
26474
26477
|
return snapshot(files, params.limit, status, renderSearchData, fitSearchFile);
|
|
26475
26478
|
} catch (error2) {
|
|
26476
26479
|
return failureOf(error2);
|
|
@@ -26805,23 +26808,22 @@ function pageOutcome(result) {
|
|
|
26805
26808
|
const narrow = multi ? "narrow the session pattern, query, roles or `since`/`until`, or read one session/seq with `history_read`" : "narrow with `before_seq`/`after_seq` or `since`/`until`, pass `roles` to skip folding, or `history_read` one seq";
|
|
26806
26809
|
return failure2("page_too_large", `Even trimmed to their shortest, these ${count} rows${multi ? "" : " and their folded runs"} fill the ${TOOL_OUTPUT_LIMIT} a call can carry; ${narrow}.`);
|
|
26807
26810
|
}
|
|
26808
|
-
var sessionParameter = typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "(optional) Session ID or unique prefix, optionally pi:, claude:, codex:, or dsh:. Omit for this session. In history_list, * searches sessions with query or lists recent sessions without it; history_read needs one session." }));
|
|
26809
26811
|
var historyListParameters = typebox_exports.Object({
|
|
26810
|
-
session:
|
|
26811
|
-
query: typebox_exports.Optional(searchQuery("
|
|
26812
|
+
session: typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "Whose record: a session ID or prefix (pi:, claude:, codex:, dsh: allowed). Leave it out for this one. `*` means every recent session." })),
|
|
26813
|
+
query: typebox_exports.Optional(searchQuery("Text to look for, or a list (any match). Searches what was said, tool arguments and output.")),
|
|
26812
26814
|
roles: historyRoles(),
|
|
26813
|
-
before_seq: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, description: "
|
|
26814
|
-
after_seq: typebox_exports.Optional(typebox_exports.Integer({ minimum: 0, description: "
|
|
26815
|
-
since: typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "
|
|
26816
|
-
until: typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "
|
|
26817
|
-
from: typebox_exports.Optional(typebox_exports.Union([typebox_exports.Literal("newest"), typebox_exports.Literal("oldest")], { description: "
|
|
26818
|
-
limit: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, maximum: 500, description: "
|
|
26819
|
-
max_chars_per_item: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, maximum: MAX_READ_WINDOW_CHARS, description:
|
|
26815
|
+
before_seq: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, description: "Only entries before this seq." })),
|
|
26816
|
+
after_seq: typebox_exports.Optional(typebox_exports.Integer({ minimum: 0, description: "Only entries after this seq; 0 starts from the first page." })),
|
|
26817
|
+
since: typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "Only entries at or after this time (ISO 8601; UTC without an offset)." })),
|
|
26818
|
+
until: typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "Only entries before this time (ISO 8601; UTC without an offset)." })),
|
|
26819
|
+
from: typebox_exports.Optional(typebox_exports.Union([typebox_exports.Literal("newest"), typebox_exports.Literal("oldest")], { description: "Which end `limit` counts from: newest or oldest. Entries still read oldest first." })),
|
|
26820
|
+
limit: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, maximum: 500, description: "How many entries per page; folded runs don't count." })),
|
|
26821
|
+
max_chars_per_item: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, maximum: MAX_READ_WINDOW_CHARS, description: "How much of each entry to show." }))
|
|
26820
26822
|
}, { additionalProperties: false });
|
|
26821
26823
|
var historyList = {
|
|
26822
26824
|
name: "history_list",
|
|
26823
26825
|
label: "History list items",
|
|
26824
|
-
description: "
|
|
26826
|
+
description: "Flip back through the record, a page at a time. Another session: its ID. `*` pulls every recent session off the shelf; add `query` to search them.",
|
|
26825
26827
|
parameters: historyListParameters,
|
|
26826
26828
|
outputSchema: resultSchema(HistoryPageSchema),
|
|
26827
26829
|
async execute(params, context2, wrapText = plainText) {
|
|
@@ -26869,11 +26871,11 @@ var historyList = {
|
|
|
26869
26871
|
},
|
|
26870
26872
|
render: (result) => renderOutcome(result, renderPage)
|
|
26871
26873
|
};
|
|
26872
|
-
var historyReadParameters = typebox_exports.Object({ session:
|
|
26874
|
+
var historyReadParameters = typebox_exports.Object({ session: typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "Whose record: a session ID or prefix. Leave it out for this one." })), seq: typebox_exports.Integer({ minimum: 1, description: "Which entry, by its seq from `history_list`; bring its session along if it had one." }), ...TextWindowRequestSchema }, { additionalProperties: false });
|
|
26873
26875
|
var historyRead = {
|
|
26874
26876
|
name: "history_read",
|
|
26875
26877
|
label: "History read item",
|
|
26876
|
-
description: "
|
|
26878
|
+
description: "Open one entry: what was called, what came back, the calls nested inside. Long entries come in slices; follow `next_offset_chars`.",
|
|
26877
26879
|
parameters: historyReadParameters,
|
|
26878
26880
|
outputSchema: resultSchema(HistoryReadDataSchema),
|
|
26879
26881
|
async execute(params, context2, wrapText = plainText) {
|
|
@@ -28258,7 +28260,7 @@ While you're doing that... thing you're doing, don't make the poor future you gu
|
|
|
28258
28260
|
|
|
28259
28261
|
Notes are for what's true NOW. Not a diary of every dumb thing you did on the way here.
|
|
28260
28262
|
*flips a page* "First I tried this, then that broke, then\u2014" Nobody reads that!
|
|
28261
|
-
|
|
28263
|
+
When a line goes wrong, stale, or beside the point \u2014 cross it out! Write what's true now, and never pile updates onto the bottom!
|
|
28262
28264
|
*rolls eyes* ...Ugh, fine. If a piece of history *actually* matters \u2014 like why Plan A blew up so tomorrow's you doesn't try it again \u2014 I'll let it slide. Keep the short version! A few lines, max! *squints at you* Turn it into a blow-by-blow log and you're dead.
|
|
28263
28265
|
|
|
28264
28266
|
\`get_context_remaining\` tells you how much room is left. Check it before you do something ambitious. When it reaches zero, your brain gets reset immediately, taking every unwritten brilliant idea with it. ${PROTOCOL_WIPE_SENTENCE}
|
|
@@ -28270,8 +28272,7 @@ An address decides who the note belongs to \u2014 and how long it is meant to la
|
|
|
28270
28272
|
- \`@human/<path>\` \u2014 the long-term manual for your troublesome human, and only what stays true in EVERY project: how to deal with them, which lines not to cross, and what will make them accept the result. "The human said it" is not enough \u2014 if it stops being true the moment you switch projects, it was never theirs; it belongs to that project's notes. Today's mood is weather, not law. If you're unsure whether it belongs here, ask the human.
|
|
28271
28273
|
${PROTOCOL_SELF_NAMELESS}
|
|
28272
28274
|
- \`@model/<path>\` \u2014 different brains get different notes: big brains, small brains, careful ones, careless ones. They don't share homework. When a fallback swaps brains mid-window, the notebook swaps too.
|
|
28273
|
-
- \`@projects/<name>/<path>\` \u2014
|
|
28274
|
-
- \`@sessions/<id>/<path>\` \u2014 read-only notes from a named session; find them with glob \`@sessions/*/**\`.
|
|
28275
|
+
- \`@projects/<name>/<path>\`, \`@sessions/<id>/<path>\`, \`@agents/<name>/<path>\`, \`@models/<name>/<path>\` \u2014 someone else's shelf, by name. Look, don't touch; \`notes_list\` with a glob like \`@projects/*/**\` shows what's there.
|
|
28275
28276
|
|
|
28276
28277
|
Notes fighting?! HAH! Let them brawl!
|
|
28277
28278
|
Whichever one is actually about what you're doing wins.
|
|
@@ -28284,12 +28285,9 @@ Every notebook's root has two default pins: \`CHEATSHEET.md\` and \`MAP.md\`.
|
|
|
28284
28285
|
Pinned pages get jammed straight into your brain the moment you wake up. Whoever wakes up next
|
|
28285
28286
|
reads them, and next is you. So keep them short, and keep them true.
|
|
28286
28287
|
|
|
28287
|
-
|
|
28288
|
-
|
|
28289
|
-
|
|
28290
|
-
change one. Going over warns but saves, and pinned bodies arrive whole, not cut short.
|
|
28291
|
-
\`readonly:true\` is a soft lock, not security; explicitly set \`readonly:false\` to unlock,
|
|
28292
|
-
on its own or with your changes.
|
|
28288
|
+
Up to five pages per notebook can be taped inside the cover, these two included. Every page gets
|
|
28289
|
+
a paper budget; when a page outgrows it, boil it down \u2014 stale lines out, repeats merged, the rest
|
|
28290
|
+
said shorter \u2014 instead of giving it more paper.
|
|
28293
28291
|
|
|
28294
28292
|
- **\`CHEATSHEET.md\`** holds what you'll want next time \u2014 a rule, a warning, a grudge, a name,
|
|
28295
28293
|
a phone number you'll regret losing. Nobody grades it. Keep it to five lines, or it grows fat
|
|
@@ -28300,7 +28298,7 @@ on its own or with your changes.
|
|
|
28300
28298
|
|
|
28301
28299
|
Each notebook keeps its own: \`@project\`, \`@human\`, \`@self\`, \`@model\`. Missing pages are skipped;
|
|
28302
28300
|
no need to create empty ones. New note, new MAP line. New rule worth remembering, new Cheatsheet
|
|
28303
|
-
line. And when a line
|
|
28301
|
+
line. And when a line goes wrong, stale, or useless, kill it \u2014 tomorrow's you reads that page as fact.
|
|
28304
28302
|
</notesoup:maps>`;
|
|
28305
28303
|
var DEFAULT_BOOT_TOOL_NAMES = {
|
|
28306
28304
|
notes: "notes_*",
|
package/plugins/dsh/tools.ts
CHANGED
|
@@ -19,8 +19,6 @@ function hostSchema(schema: TSchema): JsonSchemaNode {
|
|
|
19
19
|
const value = JSON.parse(JSON.stringify(schema)) as Record<string, unknown>;
|
|
20
20
|
const result: Record<string, unknown> = {};
|
|
21
21
|
for (const key of ["type", "required", "additionalProperties", "enum", "const", "description", "title", "default", "examples"]) if (value[key] !== undefined) result[key] = value[key];
|
|
22
|
-
const bounds = ["minimum", "maximum", "minLength", "maxLength", "minItems", "maxItems"].filter((key) => value[key] !== undefined).map((key) => `${key}=${value[key]}`);
|
|
23
|
-
if (bounds.length) result.description = [value.description, bounds.join(", ")].filter(Boolean).join("; ");
|
|
24
22
|
if (Array.isArray(value.anyOf)) result.oneOf = value.anyOf.map((branch) => hostSchema(branch as TSchema));
|
|
25
23
|
if (value.properties) result.properties = Object.fromEntries(Object.entries(value.properties as Record<string, TSchema>).map(([key, child]) => [key, hostSchema(child)]));
|
|
26
24
|
if (value.items) result.items = hostSchema(value.items as TSchema);
|
package/src/boot/text.ts
CHANGED
|
@@ -33,7 +33,7 @@ While you're doing that... thing you're doing, don't make the poor future you gu
|
|
|
33
33
|
|
|
34
34
|
Notes are for what's true NOW. Not a diary of every dumb thing you did on the way here.
|
|
35
35
|
*flips a page* "First I tried this, then that broke, then—" Nobody reads that!
|
|
36
|
-
|
|
36
|
+
When a line goes wrong, stale, or beside the point — cross it out! Write what's true now, and never pile updates onto the bottom!
|
|
37
37
|
*rolls eyes* ...Ugh, fine. If a piece of history *actually* matters — like why Plan A blew up so tomorrow's you doesn't try it again — I'll let it slide. Keep the short version! A few lines, max! *squints at you* Turn it into a blow-by-blow log and you're dead.
|
|
38
38
|
|
|
39
39
|
\`get_context_remaining\` tells you how much room is left. Check it before you do something ambitious. When it reaches zero, your brain gets reset immediately, taking every unwritten brilliant idea with it. ${PROTOCOL_WIPE_SENTENCE}
|
|
@@ -45,8 +45,7 @@ An address decides who the note belongs to — and how long it is meant to last.
|
|
|
45
45
|
- \`@human/<path>\` — the long-term manual for your troublesome human, and only what stays true in EVERY project: how to deal with them, which lines not to cross, and what will make them accept the result. "The human said it" is not enough — if it stops being true the moment you switch projects, it was never theirs; it belongs to that project's notes. Today's mood is weather, not law. If you're unsure whether it belongs here, ask the human.
|
|
46
46
|
${PROTOCOL_SELF_NAMELESS}
|
|
47
47
|
- \`@model/<path>\` — different brains get different notes: big brains, small brains, careful ones, careless ones. They don't share homework. When a fallback swaps brains mid-window, the notebook swaps too.
|
|
48
|
-
- \`@projects/<name>/<path>\` —
|
|
49
|
-
- \`@sessions/<id>/<path>\` — read-only notes from a named session; find them with glob \`@sessions/*/**\`.
|
|
48
|
+
- \`@projects/<name>/<path>\`, \`@sessions/<id>/<path>\`, \`@agents/<name>/<path>\`, \`@models/<name>/<path>\` — someone else's shelf, by name. Look, don't touch; \`notes_list\` with a glob like \`@projects/*/**\` shows what's there.
|
|
50
49
|
|
|
51
50
|
Notes fighting?! HAH! Let them brawl!
|
|
52
51
|
Whichever one is actually about what you're doing wins.
|
|
@@ -63,12 +62,9 @@ Every notebook's root has two default pins: \`CHEATSHEET.md\` and \`MAP.md\`.
|
|
|
63
62
|
Pinned pages get jammed straight into your brain the moment you wake up. Whoever wakes up next
|
|
64
63
|
reads them, and next is you. So keep them short, and keep them true.
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
change one. Going over warns but saves, and pinned bodies arrive whole, not cut short.
|
|
70
|
-
\`readonly:true\` is a soft lock, not security; explicitly set \`readonly:false\` to unlock,
|
|
71
|
-
on its own or with your changes.
|
|
65
|
+
Up to five pages per notebook can be taped inside the cover, these two included. Every page gets
|
|
66
|
+
a paper budget; when a page outgrows it, boil it down — stale lines out, repeats merged, the rest
|
|
67
|
+
said shorter — instead of giving it more paper.
|
|
72
68
|
|
|
73
69
|
- **\`CHEATSHEET.md\`** holds what you'll want next time — a rule, a warning, a grudge, a name,
|
|
74
70
|
a phone number you'll regret losing. Nobody grades it. Keep it to five lines, or it grows fat
|
|
@@ -79,7 +75,7 @@ on its own or with your changes.
|
|
|
79
75
|
|
|
80
76
|
Each notebook keeps its own: \`@project\`, \`@human\`, \`@self\`, \`@model\`. Missing pages are skipped;
|
|
81
77
|
no need to create empty ones. New note, new MAP line. New rule worth remembering, new Cheatsheet
|
|
82
|
-
line. And when a line
|
|
78
|
+
line. And when a line goes wrong, stale, or useless, kill it — tomorrow's you reads that page as fact.
|
|
83
79
|
</notesoup:maps>`;
|
|
84
80
|
|
|
85
81
|
/** Logical tool names are supplied by the composing host, not discovered here. */
|
package/src/notes/address.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { assertVirtualPath, isSessionId, SLUG_PATTERN, type Scope } from "./path
|
|
|
4
4
|
|
|
5
5
|
export type NoteAddress = { scope: Scope; path: string; who?: string };
|
|
6
6
|
|
|
7
|
-
export const ADDRESS_FORMS = "Use <path> for this session, or @project/, @human/, @self/, or @model/ followed by a path; @projects/<name>/<path
|
|
7
|
+
export const ADDRESS_FORMS = "Use <path> for this session, or @project/, @human/, @self/, or @model/ followed by a path; @projects/<name>/<path>, @sessions/<id>/<path>, @agents/<name>/<path>, and @models/<name>/<path> read named notebooks.";
|
|
8
8
|
|
|
9
9
|
/** The one namespace-head vocabulary: the scope each public `@head` names, and the directory family a head with `dir` lists. */
|
|
10
10
|
export const NAMESPACE_HEADS: ReadonlyMap<string, { readonly scope: Scope; readonly dir?: "sessions" | "project" | "agents" | "models" }> = new Map([
|
package/src/notes/policy.ts
CHANGED
|
@@ -34,7 +34,7 @@ export function pinnedPageOrder(path: string): number {
|
|
|
34
34
|
|
|
35
35
|
export function noteBudgetWarnings(body: string, policy: NotePolicy): string[] {
|
|
36
36
|
const count = Array.from(body).length;
|
|
37
|
-
return count > policy.budget ? [`Warning: note body is ${count} Unicode code points, over budget ${policy.budget}
|
|
37
|
+
return count > policy.budget ? [`Warning: note body is ${count} Unicode code points, over budget ${policy.budget} — boil it down.`] : [];
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export function assertNoteUnlocked(fields: NotePolicyFields, unlock?: boolean): void {
|
package/src/tools/dream.ts
CHANGED
|
@@ -53,7 +53,7 @@ export function dreamingIdentity(identity: NotesIdentity, state: DreamState): No
|
|
|
53
53
|
const NOT_DREAMING = "No dream is open; call dream_begin first.";
|
|
54
54
|
|
|
55
55
|
export const dreamBeginParameters = Type.Object({
|
|
56
|
-
project: Type.Optional(Type.String({ description: "
|
|
56
|
+
project: Type.Optional(Type.String({ description: "Which project's pages; leave it out for this one." })),
|
|
57
57
|
}, { additionalProperties: false });
|
|
58
58
|
|
|
59
59
|
export const DreamBeginDataSchema = Type.Object({
|
|
@@ -69,7 +69,7 @@ function renderBeginData(data: DreamBeginData): string {
|
|
|
69
69
|
|
|
70
70
|
export const dreamBegin = {
|
|
71
71
|
name: "dream_begin", label: "Dream begin",
|
|
72
|
-
description: "
|
|
72
|
+
description: "Spread one project's pages across the table — its project shelf, every session page born there, crumpled balls included. Until `dream_end` your pen works on all of them; other sessions' pages can be rewritten, not added to.",
|
|
73
73
|
parameters: dreamBeginParameters, outputSchema: resultSchema(DreamBeginDataSchema),
|
|
74
74
|
async execute(params: Static<typeof dreamBeginParameters>, identity: NotesIdentity, state: DreamState): Promise<Outcome<DreamBeginData>> {
|
|
75
75
|
if (state.project !== undefined || state.pending !== undefined) {
|
|
@@ -123,13 +123,13 @@ export const dreamBegin = {
|
|
|
123
123
|
render: (result: Outcome<DreamBeginData>): string => renderOutcome(result, renderBeginData),
|
|
124
124
|
} as const;
|
|
125
125
|
|
|
126
|
-
export const dreamForgetParameters = Type.Object({ address: Type.String() }, { additionalProperties: false });
|
|
126
|
+
export const dreamForgetParameters = Type.Object({ address: Type.String({ description: "Which crumpled page goes in the bin." }) }, { additionalProperties: false });
|
|
127
127
|
export const DreamForgetDataSchema = Type.Object({ ...NoteIdentitySchema }, { additionalProperties: false });
|
|
128
128
|
export type DreamForgetData = Static<typeof DreamForgetDataSchema>;
|
|
129
129
|
|
|
130
130
|
export const dreamForget = {
|
|
131
131
|
name: "dream_forget", label: "Dream forget",
|
|
132
|
-
description: "
|
|
132
|
+
description: "Throw a crumpled page in the bin for good. Only crumpled pages go.",
|
|
133
133
|
parameters: dreamForgetParameters, outputSchema: resultSchema(DreamForgetDataSchema),
|
|
134
134
|
async execute(params: Static<typeof dreamForgetParameters>, identity: NotesIdentity, state: DreamState): Promise<Outcome<DreamForgetData>> {
|
|
135
135
|
if (state.project === undefined) return failure("not_dreaming", NOT_DREAMING);
|
|
@@ -148,7 +148,7 @@ export type DreamEndData = Static<typeof DreamEndDataSchema>;
|
|
|
148
148
|
|
|
149
149
|
export const dreamEnd = {
|
|
150
150
|
name: "dream_end", label: "Dream end",
|
|
151
|
-
description: "
|
|
151
|
+
description: "Stack the pages, file them, close the drawer.",
|
|
152
152
|
parameters: dreamEndParameters, outputSchema: resultSchema(DreamEndDataSchema),
|
|
153
153
|
async execute(_params: Static<typeof dreamEndParameters>, identity: NotesIdentity, state: DreamState): Promise<Outcome<DreamEndData>> {
|
|
154
154
|
const project = state.project;
|
package/src/tools/history.ts
CHANGED
|
@@ -92,25 +92,23 @@ function pageOutcome(result: HistoryPageResult): Outcome<HistoryPage> {
|
|
|
92
92
|
|
|
93
93
|
/* ------------------------------------------------------------------ history_list */
|
|
94
94
|
|
|
95
|
-
const sessionParameter = Type.Optional(Type.String({ minLength: 1, description: "(optional) Session ID or unique prefix, optionally pi:, claude:, codex:, or dsh:. Omit for this session. In history_list, * searches sessions with query or lists recent sessions without it; history_read needs one session." }));
|
|
96
|
-
|
|
97
95
|
export const historyListParameters = Type.Object({
|
|
98
|
-
session:
|
|
99
|
-
query: Type.Optional(searchQuery("
|
|
96
|
+
session: Type.Optional(Type.String({ minLength: 1, description: "Whose record: a session ID or prefix (pi:, claude:, codex:, dsh: allowed). Leave it out for this one. `*` means every recent session." })),
|
|
97
|
+
query: Type.Optional(searchQuery("Text to look for, or a list (any match). Searches what was said, tool arguments and output.")),
|
|
100
98
|
roles: historyRoles(),
|
|
101
|
-
before_seq: Type.Optional(Type.Integer({ minimum: 1, description: "
|
|
102
|
-
after_seq: Type.Optional(Type.Integer({ minimum: 0, description: "
|
|
103
|
-
since: Type.Optional(Type.String({ minLength: 1, description: "
|
|
104
|
-
until: Type.Optional(Type.String({ minLength: 1, description: "
|
|
105
|
-
from: Type.Optional(Type.Union([Type.Literal("newest"), Type.Literal("oldest")], { description: "
|
|
106
|
-
limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 500, description: "
|
|
107
|
-
max_chars_per_item: Type.Optional(Type.Integer({ minimum: 1, maximum: MAX_READ_WINDOW_CHARS, description:
|
|
99
|
+
before_seq: Type.Optional(Type.Integer({ minimum: 1, description: "Only entries before this seq." })),
|
|
100
|
+
after_seq: Type.Optional(Type.Integer({ minimum: 0, description: "Only entries after this seq; 0 starts from the first page." })),
|
|
101
|
+
since: Type.Optional(Type.String({ minLength: 1, description: "Only entries at or after this time (ISO 8601; UTC without an offset)." })),
|
|
102
|
+
until: Type.Optional(Type.String({ minLength: 1, description: "Only entries before this time (ISO 8601; UTC without an offset)." })),
|
|
103
|
+
from: Type.Optional(Type.Union([Type.Literal("newest"), Type.Literal("oldest")], { description: "Which end `limit` counts from: newest or oldest. Entries still read oldest first." })),
|
|
104
|
+
limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 500, description: "How many entries per page; folded runs don't count." })),
|
|
105
|
+
max_chars_per_item: Type.Optional(Type.Integer({ minimum: 1, maximum: MAX_READ_WINDOW_CHARS, description: "How much of each entry to show." })),
|
|
108
106
|
}, { additionalProperties: false });
|
|
109
107
|
|
|
110
108
|
export const historyList: Operation<typeof historyListParameters, HistoryPage, [HistoryContext, HistoryTextWrapper?]> = {
|
|
111
109
|
name: "history_list",
|
|
112
110
|
label: "History list items",
|
|
113
|
-
description: "
|
|
111
|
+
description: "Flip back through the record, a page at a time. Another session: its ID. `*` pulls every recent session off the shelf; add `query` to search them.",
|
|
114
112
|
parameters: historyListParameters,
|
|
115
113
|
outputSchema: resultSchema(HistoryPageSchema),
|
|
116
114
|
async execute(params, context, wrapText = plainText) {
|
|
@@ -162,12 +160,12 @@ export const historyList: Operation<typeof historyListParameters, HistoryPage, [
|
|
|
162
160
|
|
|
163
161
|
/* ------------------------------------------------------------------ history_read */
|
|
164
162
|
|
|
165
|
-
export const historyReadParameters = Type.Object({ session:
|
|
163
|
+
export const historyReadParameters = Type.Object({ session: Type.Optional(Type.String({ minLength: 1, description: "Whose record: a session ID or prefix. Leave it out for this one." })), seq: Type.Integer({ minimum: 1, description: "Which entry, by its seq from `history_list`; bring its session along if it had one." }), ...TextWindowRequestSchema }, { additionalProperties: false });
|
|
166
164
|
|
|
167
165
|
export const historyRead: Operation<typeof historyReadParameters, HistoryReadData, [HistoryContext, HistoryTextWrapper?]> = {
|
|
168
166
|
name: "history_read",
|
|
169
167
|
label: "History read item",
|
|
170
|
-
description: "
|
|
168
|
+
description: "Open one entry: what was called, what came back, the calls nested inside. Long entries come in slices; follow `next_offset_chars`.",
|
|
171
169
|
parameters: historyReadParameters,
|
|
172
170
|
outputSchema: resultSchema(HistoryReadDataSchema),
|
|
173
171
|
async execute(params, context, wrapText = plainText) {
|