notesoup 0.59.2 → 0.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +3 -17
  2. package/dist/plugins/claude/src/helper.js +1 -2
  3. package/dist/plugins/codex/src/mcp.js +1 -2
  4. package/dist/plugins/dsh/tools.js +1 -2
  5. package/dist/plugins/pi/notes/tools.d.ts +1 -1
  6. package/dist/plugins/pi/notes/tools.js +2 -3
  7. package/dist/src/history/history.d.ts +10 -11
  8. package/dist/src/history/history.js +8 -19
  9. package/dist/src/history/query.d.ts +3 -14
  10. package/dist/src/history/query.js +73 -85
  11. package/dist/src/index.d.ts +1 -1
  12. package/dist/src/index.js +1 -1
  13. package/dist/src/notes/address.js +3 -3
  14. package/dist/src/notes/store.d.ts +2 -4
  15. package/dist/src/notes/store.js +1 -2
  16. package/dist/src/tools/history.d.ts +4 -6
  17. package/dist/src/tools/history.js +69 -29
  18. package/dist/src/tools/notes.d.ts +18 -78
  19. package/dist/src/tools/notes.js +39 -50
  20. package/dist/src/tools/schema.d.ts +0 -1
  21. package/dist/src/tools/schema.js +0 -1
  22. package/dist/test/claude-history.test.js +5 -6
  23. package/dist/test/claude-mod.test.js +6 -7
  24. package/dist/test/codex-history.test.js +1 -1
  25. package/dist/test/codex-plugin.test.js +1 -2
  26. package/dist/test/dependencies.test.js +2 -2
  27. package/dist/test/dsh.test.js +2 -2
  28. package/dist/test/history-corpus.test.js +21 -36
  29. package/dist/test/history-summary-cache.test.js +3 -3
  30. package/dist/test/history.integration.test.js +53 -106
  31. package/dist/test/host-neutral.test.js +1 -1
  32. package/dist/test/note-policy.test.js +5 -5
  33. package/dist/test/notes-cwd.test.js +5 -5
  34. package/dist/test/notes-query-namespaces.test.js +2 -6
  35. package/dist/test/notes.integration.test.js +30 -35
  36. package/dist/test/notes.test.js +12 -14
  37. package/dist/test/project-namespace.test.js +3 -3
  38. package/docs/architecture.md +3 -3
  39. package/docs/claude-code-mod.md +2 -2
  40. package/docs/codex.md +1 -1
  41. package/docs/dsh.md +2 -2
  42. package/docs/history-sessions.md +8 -9
  43. package/docs/notes-library.md +3 -3
  44. package/docs/tool-results.md +12 -6
  45. package/package.json +1 -1
  46. package/plugins/claude/dist/claude/helper.js +162 -153
  47. package/plugins/claude/skills/memory/SKILL.md +6 -6
  48. package/plugins/claude/src/helper.ts +1 -2
  49. package/plugins/codex/README.md +1 -1
  50. package/plugins/codex/dist/codex/notesoup.js +161 -152
  51. package/plugins/codex/src/mcp.ts +1 -2
  52. package/plugins/dsh/tools.ts +1 -2
  53. package/plugins/pi/notes/tools.ts +2 -3
  54. package/skills/memory/SKILL.md +6 -6
  55. package/src/history/history.ts +11 -16
  56. package/src/history/query.ts +67 -99
  57. package/src/index.ts +1 -1
  58. package/src/notes/address.ts +2 -2
  59. package/src/notes/store.ts +3 -6
  60. package/src/tools/history.ts +60 -29
  61. package/src/tools/notes.ts +39 -54
  62. package/src/tools/schema.ts +0 -1
@@ -24947,6 +24947,7 @@ var HistoryFoldedRowSchema = typebox_exports.Object({
24947
24947
  var HistoryPageItemSchema = typebox_exports.Object({
24948
24948
  session: typebox_exports.Optional(typebox_exports.String()),
24949
24949
  folded_before: typebox_exports.Optional(HistoryFoldedRowSchema),
24950
+ context: typebox_exports.Optional(typebox_exports.Literal(true, { description: "A neighbor of a search hit, not a hit in this page." })),
24950
24951
  seq: typebox_exports.Integer({ minimum: 1 }),
24951
24952
  role: HistoryRoleSchema,
24952
24953
  created_at: typebox_exports.Union([typebox_exports.String(), typebox_exports.Null()]),
@@ -24976,20 +24977,17 @@ function visibleItem(event, maxChars, matchOffset) {
24976
24977
  function allItems(projection) {
24977
24978
  return projection.windows.flatMap((current) => current.items);
24978
24979
  }
24979
- function inSelection(event, params) {
24980
- if (params.after_seq !== void 0 && event.seq <= params.after_seq) return false;
24981
- if (params.before_seq !== void 0 && event.seq >= params.before_seq) return false;
24982
- if (params.sinceMs === void 0 && params.untilMs === void 0) return true;
24983
- if (event.createdAt === void 0) return false;
24984
- const at = Date.parse(event.createdAt);
24985
- return !Number.isNaN(at) && (params.sinceMs === void 0 || at >= params.sinceMs) && (params.untilMs === void 0 || at < params.untilMs);
24980
+ function compareBound(event, bound) {
24981
+ return "seq" in bound ? event.seq - bound.seq : Date.parse(event.createdAt ?? "") - bound.at;
24982
+ }
24983
+ function matchesFilter(event, { after, before, roles }) {
24984
+ return (!after || compareBound(event, after) > 0) && (!before || compareBound(event, before) < 0) && (!roles || roles.includes(event.role));
24986
24985
  }
24987
24986
  function filteredItems(projection, params) {
24988
- return allItems(projection).filter((item) => inSelection(item, params) && (!params.roles || params.roles.includes(item.role))).sort((a, b) => a.seq - b.seq);
24987
+ return allItems(projection).filter((event) => matchesFilter(event, params)).sort((a, b) => a.seq - b.seq);
24989
24988
  }
24990
24989
 
24991
24990
  // src/tools/schema.ts
24992
- var nullableString = (description) => typebox_exports.Optional(typebox_exports.Union([typebox_exports.String(), typebox_exports.Null()], description === void 0 ? {} : { description }));
24993
24991
  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
24992
  function paramProblem(schema, params) {
24995
24993
  const first = Errors2(schema, params).find((error2) => error2.keyword !== "boolean");
@@ -25097,8 +25095,8 @@ function globToRegExp(pattern) {
25097
25095
  return new RegExp(`${source}$`);
25098
25096
  }
25099
25097
  function assertGlobPattern(value) {
25100
- if (value === void 0 || value === null || value === "") return void 0;
25101
- if (typeof value !== "string") throw new NoteError("invalid_pattern", `glob ${shown(value)} must be a string.`);
25098
+ if (value === void 0) return void 0;
25099
+ if (typeof value !== "string" || !value) throw new NoteError("invalid_pattern", `glob ${shown(value)} must be a non-empty string; omit it for the current notebooks.`);
25102
25100
  if (value.includes("\0") || value.includes("\\")) throw new NoteError("invalid_pattern", `glob ${shown(value)} can't contain "\\" or NUL.`);
25103
25101
  return value;
25104
25102
  }
@@ -25952,8 +25950,7 @@ function createNotesStore(input) {
25952
25950
  }));
25953
25951
  }
25954
25952
  async function* scan(options, status) {
25955
- const glob = assertGlobPattern(options.glob);
25956
- const pattern = glob === "@default" ? void 0 : glob;
25953
+ const pattern = assertGlobPattern(options.glob);
25957
25954
  const normalized = normalizePattern(pattern, identity);
25958
25955
  const matcher = normalized === void 0 ? void 0 : globToRegExp(normalized);
25959
25956
  const namespaces = await namespacesForPattern(pattern, identity, status);
@@ -26163,7 +26160,7 @@ function withWarnings(text2, data) {
26163
26160
  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
26161
  var CRUMPLED_LIST_PARAMETER = typebox_exports.Optional(typebox_exports.Boolean({ description: "Only the crumpled balls." }));
26165
26162
  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.");
26163
+ var GLOB_PARAMETER = typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "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
26164
  var CWD_PARAMETER = typebox_exports.Optional(typebox_exports.String({ minLength: 1, description: "Treat this directory's project as `@project/`." }));
26168
26165
  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." });
26169
26166
  function failureOf(error2) {
@@ -26253,11 +26250,6 @@ var MatchSchema = typebox_exports.Object({
26253
26250
  text: typebox_exports.String(),
26254
26251
  offset_chars: typebox_exports.Integer()
26255
26252
  }, { additionalProperties: false });
26256
- var SearchedFileSchema = typebox_exports.Object({
26257
- ...ListedFileSchema.properties,
26258
- matches: typebox_exports.Array(MatchSchema),
26259
- more_matches: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1 }))
26260
- }, { additionalProperties: false });
26261
26253
  var SnapshotSchema = {
26262
26254
  more: typebox_exports.Integer({ description: "How many more were left out." }),
26263
26255
  namespaces_unavailable: typebox_exports.Array(typebox_exports.String(), { description: "Unreadable notebooks or notes." })
@@ -26282,11 +26274,11 @@ var NotesReadDataSchema = typebox_exports.Object({
26282
26274
  ...TextWindowSchema.properties
26283
26275
  }, { additionalProperties: false });
26284
26276
  var NotesListDataSchema = typebox_exports.Object({
26285
- files: typebox_exports.Array(ListedFileSchema),
26286
- ...SnapshotSchema
26287
- }, { additionalProperties: false });
26288
- var NotesSearchDataSchema = typebox_exports.Object({
26289
- files: typebox_exports.Array(SearchedFileSchema),
26277
+ files: typebox_exports.Array(typebox_exports.Object({
26278
+ ...ListedFileSchema.properties,
26279
+ matches: typebox_exports.Optional(typebox_exports.Array(MatchSchema)),
26280
+ more_matches: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1 }))
26281
+ }, { additionalProperties: false })),
26290
26282
  ...SnapshotSchema
26291
26283
  }, { additionalProperties: false });
26292
26284
  function snapshot(rows, limit, status, renderData, shrink) {
@@ -26402,41 +26394,24 @@ var notesRead = {
26402
26394
  },
26403
26395
  render: (result) => renderOutcome(result, renderReadData)
26404
26396
  };
26405
- var notesListParameters = typebox_exports.Object({ glob: GLOB_PARAMETER, limit: FILE_LIMIT_PARAMETER, crumpled: CRUMPLED_LIST_PARAMETER, cwd: CWD_PARAMETER }, { additionalProperties: false });
26397
+ var notesListParameters = typebox_exports.Object({
26398
+ glob: GLOB_PARAMETER,
26399
+ query: typebox_exports.Optional(searchQuery()),
26400
+ max_matches_per_file: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, description: "How many hit lines per note at most; requires a query." })),
26401
+ crumpled: CRUMPLED_LIST_PARAMETER,
26402
+ limit: FILE_LIMIT_PARAMETER,
26403
+ cwd: CWD_PARAMETER
26404
+ }, { additionalProperties: false });
26406
26405
  function renderListData(data) {
26407
26406
  const lines = [`${data.files.length} ${data.files.length === 1 ? "note" : "notes"}`];
26408
26407
  for (const file of data.files) {
26409
- lines.push(`- ${renderIdentity(file)} | ${renderPolicy(file)} | updated ${file.updated_at}${file.last_accessed === void 0 ? "" : ` | accessed ${file.last_accessed}`}${file.crumpled_at === void 0 ? "" : ` | crumpled ${file.crumpled_at}`}`);
26410
- lines.push(...file.warnings.map((warning) => ` ${warning}`));
26411
- }
26412
- if (data.more > 0) lines.push(`${data.more} more matching notes omitted; narrow with glob`);
26413
- for (const namespace of data.namespaces_unavailable) lines.push(`${namespace} could not be read`);
26414
- return lines.join("\n");
26415
- }
26416
- var notesList = {
26417
- name: "notes_list",
26418
- label: "Notes list",
26419
- description: "Leaf through the drawers, newest pages on top. One pass; `more` counts pages left on the pile \u2014 narrow `glob`.",
26420
- parameters: notesListParameters,
26421
- outputSchema: resultSchema(NotesListDataSchema),
26422
- async execute(params, context2) {
26423
- try {
26424
- const identity = notesIdentityForCall(context2, params.cwd);
26425
- const { rows, status } = await createNotesStore(identity).listWithStatus({ glob: params.glob ?? void 0, crumpled: params.crumpled });
26426
- return snapshot(rows.map((row) => listedFile(row, identity)), params.limit, status, renderListData);
26427
- } catch (error2) {
26428
- return failureOf(error2);
26429
- }
26430
- },
26431
- render: (result) => renderOutcome(result, renderListData)
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: "How many hit lines per page at most." })), crumpled: CRUMPLED_LIST_PARAMETER, cwd: CWD_PARAMETER }, { additionalProperties: false });
26434
- function renderSearchData(data) {
26435
- const lines = [`${data.files.length} ${data.files.length === 1 ? "note" : "notes"}`];
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"}${file.more_matches ? `, ${file.more_matches} more lines` : ""}`);
26408
+ const fields = [`- ${renderIdentity(file)}`, renderPolicy(file), `updated ${file.updated_at}`];
26409
+ if (file.last_accessed !== void 0) fields.push(`accessed ${file.last_accessed}`);
26410
+ if (file.crumpled_at !== void 0) fields.push(`crumpled ${file.crumpled_at}`);
26411
+ if (file.matches) fields.push(`${file.matches.length} ${file.matches.length === 1 ? "match" : "matches"}${file.more_matches ? `, ${file.more_matches} more lines` : ""}`);
26412
+ lines.push(fields.join(" | "));
26438
26413
  lines.push(...file.warnings.map((warning) => ` ${warning}`));
26439
- for (const match of file.matches) lines.push(` line ${match.line} at offset_chars ${match.offset_chars}: ${match.text}`);
26414
+ for (const match of file.matches ?? []) lines.push(` line ${match.line} at offset_chars ${match.offset_chars}: ${match.text}`);
26440
26415
  }
26441
26416
  if (data.more > 0) lines.push(`${data.more} more matching notes omitted; narrow with glob`);
26442
26417
  for (const namespace of data.namespaces_unavailable) lines.push(`${namespace} could not be read`);
@@ -26460,26 +26435,34 @@ function fitSearchFile(file, fits) {
26460
26435
  const withText = (text2) => ({ ...keepMatches(file, 1), matches: [{ ...first, text: `${text2}${MATCH_SHORTENED_MARKER}` }] });
26461
26436
  return withText(prefixFit(first.text, (text2) => fits(withText(text2))));
26462
26437
  }
26463
- var notesSearch = {
26464
- name: "notes_search",
26465
- label: "Notes search",
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`.",
26467
- parameters: notesSearchParameters,
26468
- outputSchema: resultSchema(NotesSearchDataSchema),
26438
+ var notesList = {
26439
+ name: "notes_list",
26440
+ label: "Notes list",
26441
+ description: "List or search notes, newest pages on top. A query matches literal text (ignoring case) and returns hit lines and read offsets. One pass; `more` counts pages left on the pile \u2014 narrow `glob`.",
26442
+ parameters: notesListParameters,
26443
+ outputSchema: resultSchema(NotesListDataSchema),
26469
26444
  async execute(params, context2) {
26470
26445
  try {
26446
+ const queries = searchQueries(params.query);
26447
+ const { glob, crumpled, limit } = params;
26448
+ if (!queries.length && params.max_matches_per_file !== void 0) return failure2("invalid_params", "`max_matches_per_file` requires a non-empty `query`.");
26471
26449
  const identity = notesIdentityForCall(context2, params.cwd);
26472
- const { rows, status } = await createNotesStore(identity).searchWithStatus(searchQueries(params.query), { glob: params.glob ?? void 0, crumpled: params.crumpled });
26450
+ const store = createNotesStore(identity);
26451
+ if (!queries.length) {
26452
+ const { rows: rows2, status: status2 } = await store.listWithStatus({ glob, crumpled });
26453
+ return snapshot(rows2.map((row) => listedFile(row, identity)), limit, status2, renderListData);
26454
+ }
26455
+ const { rows, status } = await store.searchWithStatus(queries, { glob, crumpled });
26473
26456
  const files = rows.sort((a, b) => b.meta.updatedAt - a.meta.updatedAt || a.address.localeCompare(b.address)).map((row) => keepMatches({
26474
26457
  ...listedFile(row, identity),
26475
26458
  matches: row.matches.map((match) => ({ line: match.line, text: match.text, offset_chars: match.offsetChars }))
26476
26459
  }, params.max_matches_per_file));
26477
- return snapshot(files, params.limit, status, renderSearchData, fitSearchFile);
26460
+ return snapshot(files, limit, status, renderListData, fitSearchFile);
26478
26461
  } catch (error2) {
26479
26462
  return failureOf(error2);
26480
26463
  }
26481
26464
  },
26482
- render: (result) => renderOutcome(result, renderSearchData)
26465
+ render: (result) => renderOutcome(result, renderListData)
26483
26466
  };
26484
26467
 
26485
26468
  // src/history/query.ts
@@ -26491,23 +26474,6 @@ function markMultiPage(page) {
26491
26474
  multiPages.add(page);
26492
26475
  return page;
26493
26476
  }
26494
- var ISO_8601 = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[+-]\d{2}:?\d{2})?$/;
26495
- function timeBound(name, value) {
26496
- if (value === void 0) return success(void 0);
26497
- const match = ISO_8601.exec(value);
26498
- const at = match === null ? void 0 : Date.parse(match[1] === void 0 ? `${value}Z` : value);
26499
- return at === void 0 || Number.isNaN(at) ? failure2("invalid_time", `\`${name}\` isn't an ISO 8601 time: "${value}".`) : success(at);
26500
- }
26501
- function resolveTimeBounds(params) {
26502
- const since = timeBound("since", params.since);
26503
- if (!since.ok) return since;
26504
- const until = timeBound("until", params.until);
26505
- if (!until.ok) return until;
26506
- if (since.data !== void 0 && until.data !== void 0 && since.data >= until.data) {
26507
- return failure2("invalid_time", "`since` must be earlier than `until`.");
26508
- }
26509
- return success({ ...since.data === void 0 ? {} : { sinceMs: since.data }, ...until.data === void 0 ? {} : { untilMs: until.data } });
26510
- }
26511
26477
  var HistoryPageSchema = typebox_exports.Object({
26512
26478
  notice: typebox_exports.Optional(typebox_exports.String()),
26513
26479
  items: typebox_exports.Array(HistoryPageItemSchema),
@@ -26540,22 +26506,29 @@ function foldedRun(events, session) {
26540
26506
  const tools2 = Object.fromEntries(entries);
26541
26507
  return { ...session === void 0 ? {} : { session }, first_seq: events[0].seq, last_seq: events.at(-1).seq, count: events.length, tools: tools2 };
26542
26508
  }
26509
+ var visible = (event) => event.role !== "user" && event.role !== "assistant" || eventDocument(event) !== "";
26510
+ function* queryHits(projection, params, session) {
26511
+ const { query, context: context2 } = params;
26512
+ const events = filteredItems(projection, context2 ? {} : params).filter(visible);
26513
+ for (const [index, event] of events.entries()) {
26514
+ if (context2 && !matchesFilter(event, params)) continue;
26515
+ const matchOffset = earliestMatchOffsetChars(eventDocument(event), query);
26516
+ if (matchOffset >= 0) yield { event, session, matchOffset, neighbors: context2 ? { events, index } : void 0 };
26517
+ }
26518
+ }
26543
26519
  function prepareSelection(projection, params) {
26544
- const folds = !params.roles && params.query === void 0;
26520
+ const { query, roles, session } = params;
26521
+ if (query) return { candidates: [...queryHits(projection, params, session)] };
26545
26522
  const candidates = [];
26546
26523
  let run = [];
26547
- for (const event of filteredItems(projection, params)) {
26548
- if (folds && (event.role === "tool" || event.role === "context")) {
26549
- run.push(event);
26550
- continue;
26524
+ for (const event of filteredItems(projection, params).filter(visible)) {
26525
+ if (!roles && (event.role === "tool" || event.role === "context")) run.push(event);
26526
+ else {
26527
+ candidates.push({ event, session, before: foldedRun(run, session) });
26528
+ run = [];
26551
26529
  }
26552
- if ((event.role === "user" || event.role === "assistant") && eventDocument(event) === "") continue;
26553
- const matchOffset = params.query === void 0 ? void 0 : earliestMatchOffsetChars(eventDocument(event), params.query);
26554
- if (matchOffset !== void 0 && matchOffset < 0) continue;
26555
- candidates.push({ event, ...params.session === void 0 ? {} : { session: params.session }, matchOffset, before: foldedRun(run, params.session) });
26556
- run = [];
26557
26530
  }
26558
- return { candidates, session: params.session, tail: foldedRun(run, params.session) };
26531
+ return { candidates, tail: foldedRun(run, session) };
26559
26532
  }
26560
26533
  function pageData(prepared, start, end, maxChars, preview) {
26561
26534
  const { candidates, tail } = prepared;
@@ -26568,38 +26541,51 @@ function pageData(prepared, start, end, maxChars, preview) {
26568
26541
  const page = {
26569
26542
  items,
26570
26543
  ...end === candidates.length && tail ? { folded_after: tail } : {},
26571
- has_older: start > 0 && start < end || !!prepared.discarded && prepared.from !== "oldest",
26572
- has_newer: end < candidates.length && start < end || !!prepared.discarded && prepared.from === "oldest"
26544
+ has_older: start > 0 && start < end || !!prepared.discarded && !prepared.forward,
26545
+ has_newer: end < candidates.length && start < end || !!prepared.discarded && !!prepared.forward
26573
26546
  };
26574
26547
  return prepared.multi ? markMultiPage(page) : page;
26575
26548
  }
26576
- function resolveSelection(params) {
26577
- const bounds = resolveTimeBounds(params);
26578
- if (!bounds.ok) return bounds;
26579
- try {
26580
- const queries = searchQueries(params.query);
26581
- return success({ ...params, ...bounds.data, query: queries.length ? queries : void 0 });
26582
- } catch (error2) {
26583
- if (error2 instanceof InvalidQueryError) return failure2("invalid_query", error2.message);
26584
- throw error2;
26585
- }
26586
- }
26587
26549
  function selectPage(projection, params, fits, maxChars) {
26588
- const scoped = resolveSelection(params);
26589
- if (!scoped.ok) return scoped;
26590
- return selectPrepared(prepareSelection(projection, scoped.data), scoped.data, fits, maxChars);
26591
- }
26592
- function corpusSelection(params) {
26593
- if (params.before_seq !== void 0 || params.after_seq !== void 0) return failure2("invalid_bounds", "`before_seq` and `after_seq` are per-session; omit them for wildcard session search.");
26594
- return resolveSelection(params);
26550
+ return selectPrepared(prepareSelection(projection, params), params, fits, maxChars);
26595
26551
  }
26596
26552
  function sessionRepresentative(projection, scoped) {
26597
- const events = filteredItems(projection, scoped).filter((event) => event.role !== "user" && event.role !== "assistant" || eventDocument(event) !== "");
26553
+ const events = filteredItems(projection, scoped).filter(visible);
26598
26554
  if (scoped.roles) return events.at(-1);
26599
26555
  return events.find((event) => event.role === "user") ?? events.filter((event) => event.role === "assistant").at(-1) ?? events.at(-1);
26600
26556
  }
26601
- var eventTime = (event) => event.createdAt === void 0 || Number.isNaN(Date.parse(event.createdAt)) ? -Infinity : Date.parse(event.createdAt);
26602
- var compareCorpus = (a, b) => eventTime(a.event) - eventTime(b.event) || a.session.localeCompare(b.session) || a.event.seq - b.event.seq;
26557
+ function eventTime(timestamp) {
26558
+ const at = Date.parse(timestamp ?? "");
26559
+ return Number.isNaN(at) ? -Infinity : at;
26560
+ }
26561
+ var compareCorpus = (a, b) => eventTime(a.event.createdAt) - eventTime(b.event.createdAt) || a.session.localeCompare(b.session) || a.event.seq - b.event.seq;
26562
+ function addContext(page, hits, radius, fits, maxChars) {
26563
+ const key = (session, seq) => `${session ?? ""}\0${seq}`;
26564
+ const seen = new Set(page.items.map((item) => key(item.session, item.seq)));
26565
+ const compare = (a, b) => (isMultiPage(page) ? eventTime(a.created_at) - eventTime(b.created_at) || a.session.localeCompare(b.session) : 0) || a.seq - b.seq;
26566
+ for (let distance = 1; distance <= radius; distance++) {
26567
+ let found = false;
26568
+ for (const { neighbors, session } of hits) {
26569
+ if (!neighbors) continue;
26570
+ for (const index of [neighbors.index - distance, neighbors.index + distance]) {
26571
+ const event = neighbors.events[index];
26572
+ if (!event) continue;
26573
+ found = true;
26574
+ const id2 = key(session, event.seq);
26575
+ if (seen.has(id2)) continue;
26576
+ const item = { ...visibleItem(event, maxChars), ...session === void 0 ? {} : { session }, context: true };
26577
+ const previous = page.items;
26578
+ page.items = [...previous, item].sort(compare);
26579
+ if (!fits(page)) {
26580
+ page.items = previous;
26581
+ return;
26582
+ }
26583
+ seen.add(id2);
26584
+ }
26585
+ }
26586
+ if (!found) return;
26587
+ }
26588
+ }
26603
26589
  var CorpusCollector = class {
26604
26590
  constructor(scoped) {
26605
26591
  this.scoped = scoped;
@@ -26618,7 +26604,7 @@ var CorpusCollector = class {
26618
26604
  }
26619
26605
  if (this.candidates.length === this.limit) {
26620
26606
  this.discarded = true;
26621
- if (this.scoped.from === "oldest") {
26607
+ if (this.scoped.after) {
26622
26608
  if (low === this.limit) return;
26623
26609
  this.candidates.pop();
26624
26610
  } else {
@@ -26638,22 +26624,16 @@ var CorpusCollector = class {
26638
26624
  /** Returns whether this session contributes an overview representative. */
26639
26625
  add(session, projection) {
26640
26626
  if (this.scoped.query === void 0) return this.addRepresentative(session, sessionRepresentative(projection, this.scoped));
26641
- for (const event of filteredItems(projection, this.scoped)) {
26642
- const document = eventDocument(event);
26643
- if ((event.role === "user" || event.role === "assistant") && document === "") continue;
26644
- const matchOffset = earliestMatchOffsetChars(document, this.scoped.query);
26645
- if (matchOffset >= 0) this.admit({ session, event, matchOffset });
26646
- }
26627
+ for (const hit of queryHits(projection, this.scoped, session)) this.admit(hit);
26647
26628
  return true;
26648
26629
  }
26649
26630
  page(fits, maxChars, unvisited = false) {
26650
- return selectPrepared({ candidates: this.candidates, multi: true, discarded: this.discarded || unvisited, from: this.scoped.from }, this.scoped, fits, maxChars);
26631
+ return selectPrepared({ candidates: this.candidates, multi: true, discarded: this.discarded || unvisited, forward: !!this.scoped.after }, this.scoped, fits, maxChars);
26651
26632
  }
26652
26633
  };
26653
26634
  function selectPrepared(prepared, scoped, fits, maxChars) {
26654
26635
  const { candidates } = prepared;
26655
- const from = scoped.from ?? (scoped.after_seq !== void 0 ? "oldest" : "newest");
26656
- const newest = from === "newest";
26636
+ const newest = scoped.after === void 0;
26657
26637
  let start = newest ? candidates.length : 0;
26658
26638
  let end = start;
26659
26639
  const limit = Math.max(1, scoped.limit ?? 20);
@@ -26675,6 +26655,7 @@ function selectPrepared(prepared, scoped, fits, maxChars) {
26675
26655
  }
26676
26656
  const page = pageData(prepared, start, end, maxChars);
26677
26657
  if (!fits(page)) return { ok: false, pageTooLarge: { count: page.items.length, multi: prepared.multi === true } };
26658
+ if (scoped.context) addContext(page, candidates.slice(start, end), scoped.context, fits, maxChars);
26678
26659
  return success(page);
26679
26660
  }
26680
26661
 
@@ -26765,7 +26746,7 @@ function toolHeader(item) {
26765
26746
  }
26766
26747
  function renderPageItem(item) {
26767
26748
  const tool = toolHeader(item);
26768
- const lines = tool === void 0 ? [header(item)] : [header(item), tool];
26749
+ const lines = [header(item) + (item.context ? " | search context" : ""), ...tool ? [tool] : []];
26769
26750
  if (item.truncated) lines.push(`[truncated; from offset ${item.offset_chars ?? 0}]`);
26770
26751
  lines.push(item.content);
26771
26752
  return lines.join("\n");
@@ -26774,7 +26755,7 @@ function renderFoldedRow(row) {
26774
26755
  const tools2 = Object.entries(row.tools).map(([name, count]) => `${name} ${count}`).join(", ");
26775
26756
  const identity = row.session === void 0 ? {} : { session: row.session };
26776
26757
  const expand = `
26777
- \u2192 expand: ${JSON.stringify({ ...identity, after_seq: row.first_seq - 1, before_seq: row.last_seq + 1, roles: ["tool", "context"] })}`;
26758
+ \u2192 expand: ${JSON.stringify({ ...identity, after: row.first_seq - 1, before: row.last_seq + 1, roles: ["tool", "context"] })}`;
26778
26759
  return `${row.session === void 0 ? "" : `session ${row.session} | `}seqs ${row.first_seq}-${row.last_seq} | folded ${row.count} events${tools2 ? ` | ${tools2}` : ""}${expand}`;
26779
26760
  }
26780
26761
  function renderPage(page) {
@@ -26784,13 +26765,14 @@ function renderPage(page) {
26784
26765
  const directions = [page.has_older && "older", page.has_newer && "newer"].filter(Boolean).join("|");
26785
26766
  return (page.notice ?? "") + body + (directions ? `
26786
26767
 
26787
- \u2192 more ${directions} results: narrow with since/until, query, roles or the session pattern` : "");
26768
+ \u2192 more ${directions} results: narrow with time bounds (after/before), query, roles or the session pattern` : "");
26788
26769
  }
26789
- const first = page.items[0];
26790
- const last = page.items.at(-1);
26770
+ const hits = page.items.filter((item) => !item.context);
26771
+ const first = hits[0];
26772
+ const last = hits.at(-1);
26791
26773
  const cursors = [
26792
- page.has_older ? `\u2192 older: ${JSON.stringify({ ...first.session === void 0 ? {} : { session: first.session }, before_seq: first.seq })}` : "",
26793
- page.has_newer ? `\u2192 newer: ${JSON.stringify({ ...last.session === void 0 ? {} : { session: last.session }, after_seq: last.seq })}` : ""
26774
+ page.has_older ? `\u2192 older: ${JSON.stringify({ session: first.session, before: first.seq })}` : "",
26775
+ page.has_newer ? `\u2192 newer: ${JSON.stringify({ session: last.session, after: last.seq })}` : ""
26794
26776
  ].filter((line) => line !== "");
26795
26777
  return (page.notice ?? "") + (cursors.length === 0 ? body : `${body}
26796
26778
 
@@ -26798,28 +26780,54 @@ ${cursors.join(" | ")}`);
26798
26780
  }
26799
26781
  function renderRead(data) {
26800
26782
  const tool = toolHeader(data);
26801
- const neighborhood = `neighborhood \u2192 \`history_list\`(${JSON.stringify({ ...data.session === void 0 ? {} : { session: data.session }, after_seq: Math.max(0, data.seq - 10), before_seq: data.seq + 10 })})`;
26783
+ const neighborhood = `neighborhood \u2192 \`history_list\`(${JSON.stringify({ ...data.session === void 0 ? {} : { session: data.session }, after: Math.max(0, data.seq - 10), before: data.seq + 10 })})`;
26802
26784
  return (data.notice ?? "") + [header(data), ...tool ? [tool] : [], neighborhood, "", data.total_chars === 0 ? "No visible text recorded for this event." : renderTextWindow(data)].join("\n");
26803
26785
  }
26804
26786
  var plainText = (text2) => text2;
26805
26787
  function pageOutcome(result) {
26806
26788
  if (!("pageTooLarge" in result)) return result;
26807
26789
  const { count, multi } = result.pageTooLarge;
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";
26790
+ const narrow = multi ? "narrow the session pattern, query, roles or time bounds (`after`/`before`), or read one session/seq with `history_read`" : "narrow with `after`/`before`, pass `roles` to skip folding, or `history_read` one seq";
26809
26791
  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}.`);
26810
26792
  }
26793
+ var boundParameter = (description) => typebox_exports.Optional(typebox_exports.Union([typebox_exports.String(), typebox_exports.Number()], { description: `${description} Use a seq (number or digits) or ISO 8601 time (UTC without offset); wildcards take only times.` }));
26811
26794
  var historyListParameters = typebox_exports.Object({
26812
26795
  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.")),
26814
26796
  roles: historyRoles(),
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." })),
26797
+ query: typebox_exports.Optional(searchQuery("Text to look for, or a list (any match). Searches what was said, tool arguments and output.")),
26798
+ after: boundParameter("Start strictly after this bound, paging forward; 0 starts at the oldest event."),
26799
+ before: boundParameter("Stop strictly before this bound; without `after`, take the newest eligible events."),
26800
+ context: typebox_exports.Optional(typebox_exports.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER, description: "Neighboring events on each side of a hit in its own session; requires a query." })),
26801
+ limit: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, maximum: 500, description: "How many events or hits per page; folds and search context don't count." })),
26821
26802
  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." }))
26822
26803
  }, { additionalProperties: false });
26804
+ var ISO_8601 = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;
26805
+ function parseBound(name, value) {
26806
+ if (value === void 0) return success(void 0);
26807
+ if (typeof value === "number" || /^\d+$/.test(value)) {
26808
+ const seq = Number(value);
26809
+ if (Number.isSafeInteger(seq) && seq >= 0) return success({ seq });
26810
+ } else if (typeof value === "string") {
26811
+ const match = ISO_8601.exec(value);
26812
+ const at = match ? Date.parse(match[1] ? value : `${value}Z`) : NaN;
26813
+ if (!Number.isNaN(at) && new Date(value.slice(0, 10)).toISOString().startsWith(value.slice(0, 10))) return success({ at });
26814
+ }
26815
+ return failure2("invalid_bounds", `\`${name}\` must be a non-negative integer seq or an ISO 8601 time; got ${JSON.stringify(value)}.`);
26816
+ }
26817
+ function parseSelection(params) {
26818
+ const after = parseBound("after", params.after);
26819
+ if (!after.ok) return after;
26820
+ const before = parseBound("before", params.before);
26821
+ if (!before.ok) return before;
26822
+ try {
26823
+ const query = searchQueries(params.query);
26824
+ if (!query.length && params.context !== void 0) return failure2("invalid_params", "`context` requires a non-empty `query`.");
26825
+ return success({ after: after.data, before: before.data, query: query.length ? query : void 0, roles: params.roles, context: params.context, limit: params.limit });
26826
+ } catch (error2) {
26827
+ if (error2 instanceof InvalidQueryError) return failure2("invalid_query", error2.message);
26828
+ throw error2;
26829
+ }
26830
+ }
26823
26831
  var historyList = {
26824
26832
  name: "history_list",
26825
26833
  label: "History list items",
@@ -26827,32 +26835,34 @@ var historyList = {
26827
26835
  parameters: historyListParameters,
26828
26836
  outputSchema: resultSchema(HistoryPageSchema),
26829
26837
  async execute(params, context2, wrapText = plainText) {
26838
+ const selection = parseSelection(params);
26839
+ if (!selection.ok) return selection;
26840
+ const scoped = selection.data;
26830
26841
  const fits = (page) => fitsResult(success(page), (result2) => wrapText(renderOutcome(result2, renderPage)));
26831
26842
  const maxChars = params.max_chars_per_item ?? HISTORY_PREVIEW_CHARS;
26832
- if (params.session === void 0) return pageOutcome(selectPage(await currentHistory(context2), params, fits, maxChars));
26843
+ if (params.session === void 0) return pageOutcome(selectPage(await currentHistory(context2), scoped, fits, maxChars));
26833
26844
  const selector = parseSessionSelector(params.session);
26834
26845
  if (!selector.ok) return selector;
26835
26846
  const corpus = "corpus" in context2 ? context2.corpus : void 0;
26836
26847
  if (selector.data.wildcard) {
26837
- const scoped = corpusSelection(params);
26838
- if (!scoped.ok) return scoped;
26848
+ const { after, before, query, roles } = scoped;
26849
+ if (after && "seq" in after || before && "seq" in before) return failure2("invalid_bounds", "Wildcard history requires times, not seqs, for `after` and `before`.");
26839
26850
  if (corpus === void 0) return failure2("unknown_session", "This host supplied no cross-session history corpus.");
26840
26851
  const sessions = (await corpus.sessions(selector.data.harness)).filter((session) => matchesSession(session, selector.data));
26841
- const queries = Array.isArray(scoped.data.query) ? scoped.data.query : void 0;
26842
- if (!queries) sessions.sort((a, b) => (scoped.data.from === "oldest" ? a.modifiedAt - b.modifiedAt : b.modifiedAt - a.modifiedAt) || sessionIdentity(a).localeCompare(sessionIdentity(b)));
26843
- const representative = !queries && scoped.data.roles === void 0 && scoped.data.since === void 0 && scoped.data.until === void 0;
26844
- const collector = new CorpusCollector(scoped.data);
26852
+ if (!query) sessions.sort((a, b) => (after ? a.modifiedAt - b.modifiedAt : b.modifiedAt - a.modifiedAt) || sessionIdentity(a).localeCompare(sessionIdentity(b)));
26853
+ const representative = !query && !roles && !after && !before;
26854
+ const collector = new CorpusCollector(scoped);
26845
26855
  let qualifying = 0;
26846
26856
  const notices = [];
26847
26857
  let unvisited = false;
26848
26858
  for (const [index, session] of sessions.entries()) {
26849
- const result3 = representative ? await loadHistoryRepresentative(session) : await loadHistorySession(session, queries);
26859
+ const result3 = representative ? await loadHistoryRepresentative(session) : await loadHistorySession(session, query);
26850
26860
  if (!result3.ok || !result3.data) continue;
26851
26861
  const added = "projection" in result3.data ? collector.add(sessionIdentity(session), result3.data.projection) : collector.addRepresentative(sessionIdentity(session), result3.data.event);
26852
26862
  if (!added) continue;
26853
26863
  qualifying++;
26854
26864
  if (result3.data.notice) notices.push(`session ${sessionIdentity(session)}: ${result3.data.notice}`);
26855
- if (!queries && qualifying >= Math.min(500, Math.max(1, params.limit ?? 20))) {
26865
+ if (!query && qualifying >= Math.min(500, Math.max(1, params.limit ?? 20))) {
26856
26866
  unvisited = index + 1 < sessions.length;
26857
26867
  break;
26858
26868
  }
@@ -26866,7 +26876,7 @@ var historyList = {
26866
26876
  const loaded = await loadHistorySession(target.data);
26867
26877
  if (!loaded.ok) return loaded;
26868
26878
  const notice = loaded.data.notice === void 0 ? {} : { notice: loaded.data.notice };
26869
- const result = pageOutcome(selectPage(loaded.data.projection, { ...params, session: sessionIdentity(target.data) }, (page) => fits({ ...page, ...notice }), maxChars));
26879
+ const result = pageOutcome(selectPage(loaded.data.projection, { ...scoped, session: sessionIdentity(target.data) }, (page) => fits({ ...page, ...notice }), maxChars));
26870
26880
  return result.ok ? success({ ...result.data, ...notice }) : result;
26871
26881
  },
26872
26882
  render: (result) => renderOutcome(result, renderPage)
@@ -28517,7 +28527,6 @@ var OPERATIONS = {
28517
28527
  notes_update: { operation: notesUpdate, history: false },
28518
28528
  notes_read: { operation: notesRead, history: false },
28519
28529
  notes_list: { operation: notesList, history: false },
28520
- notes_search: { operation: notesSearch, history: false },
28521
28530
  history_list: { operation: historyList, history: true },
28522
28531
  history_read: { operation: historyRead, history: true }
28523
28532
  };
@@ -5,7 +5,7 @@ import { CallToolRequestSchema, ListToolsRequestSchema, type CallToolResult, typ
5
5
  import { Check } from "typebox/value";
6
6
  import { paramProblem } from "../../../src/tools/schema.js";
7
7
  import type { TSchema } from "typebox";
8
- import { notesList, notesRead, notesSearch, notesUpdate, notesWrite } from "../../../src/tools/notes.js";
8
+ import { notesList, notesRead, notesUpdate, notesWrite } from "../../../src/tools/notes.js";
9
9
  import { historyList, historyRead } from "../../../src/tools/history.js";
10
10
  import type { Outcome } from "../../../src/result.js";
11
11
  import { wireResult, type Operation } from "../../../src/tools/result.js";
@@ -25,7 +25,6 @@ const OPERATIONS: Record<string, Bound> = {
25
25
  notes_update: { operation: notesUpdate as unknown as Bound["operation"], history: false },
26
26
  notes_read: { operation: notesRead as unknown as Bound["operation"], history: false },
27
27
  notes_list: { operation: notesList as unknown as Bound["operation"], history: false },
28
- notes_search: { operation: notesSearch as unknown as Bound["operation"], history: false },
29
28
  history_list: { operation: historyList as unknown as Bound["operation"], history: true },
30
29
  history_read: { operation: historyRead as unknown as Bound["operation"], history: true },
31
30
  };
@@ -4,7 +4,7 @@ import { HarnessError } from "@deepseek-ai/dsh-llm";
4
4
  import { defineTool, type JsonSchemaNode, type ObjectJsonSchema, type ToolRunContext } from "@deepseek-ai/dsh-tools";
5
5
  import type { Static, TSchema } from "typebox";
6
6
  import { Check, Errors } from "typebox/value";
7
- import { notesList, notesRead, notesSearch, notesUpdate, notesWrite } from "../../src/tools/notes.js";
7
+ import { notesList, notesRead, notesUpdate, notesWrite } from "../../src/tools/notes.js";
8
8
  import { historyList, historyRead } from "../../src/tools/history.js";
9
9
  import { success } from "../../src/result.js";
10
10
  import type { Operation } from "../../src/tools/result.js";
@@ -75,7 +75,6 @@ export function registerTools(ctx: Context, engine: NotesoupCompactionEngine): v
75
75
  register(ctx, notesUpdate, (agent) => [toolContext(agent)] as const);
76
76
  register(ctx, notesRead, (agent) => [toolContext(agent)] as const);
77
77
  register(ctx, notesList, (agent) => [toolContext(agent)] as const);
78
- register(ctx, notesSearch, (agent) => [toolContext(agent)] as const);
79
78
  register(ctx, historyList, (agent) => [historyContext(ctx, agent.session.id)] as const);
80
79
  register(ctx, historyRead, (agent) => [historyContext(ctx, agent.session.id)] as const);
81
80
  ctx.tools.register(defineTool({
@@ -1,5 +1,5 @@
1
1
  import { generateDiffString, type ExtensionAPI, type ExtensionContext } from "@earendil-works/pi-coding-agent";
2
- import { notesWrite, notesUpdate, notesRead, notesList, notesSearch } from "../../../src/tools/notes.js";
2
+ import { notesWrite, notesUpdate, notesRead, notesList } from "../../../src/tools/notes.js";
3
3
  import { abandonDream, dreamBegin, dreamEnd, dreamForget, dreamingIdentity, type DreamState } from "../../../src/tools/dream.js";
4
4
  import { notesIdentityFromPi } from "./adapter.js";
5
5
  import { notesReadRenderers, notesUpdateRenderers, notesWriteRenderers } from "../render.js";
@@ -11,7 +11,7 @@ function renderDiff(change: NoteChange): string {
11
11
  return change.kind === "none" ? "" : generateDiffString(change.before, change.after, 1).diff;
12
12
  }
13
13
 
14
- /** Register the five shared note operations and the three hidden dream tools; an open dream widens the note identity. */
14
+ /** Register the shared note operations and the three hidden dream tools; an open dream widens the note identity. */
15
15
  export function registerNotesTools(pi: ExtensionAPI) {
16
16
  // One pending or open dream per session: shutdown releases ownership without the end commit.
17
17
  const dreams = new Map<string, DreamState>();
@@ -35,7 +35,6 @@ export function registerNotesTools(pi: ExtensionAPI) {
35
35
  }, NOTES_NAMESPACE, notesUpdateRenderers);
36
36
  registerOperation(pi, notesRead, (params, ctx) => notesRead.execute(params, toolContext(ctx)), NOTES_NAMESPACE, notesReadRenderers);
37
37
  registerOperation(pi, notesList, (params, ctx) => notesList.execute(params, toolContext(ctx)), NOTES_NAMESPACE);
38
- registerOperation(pi, notesSearch, (params, ctx) => notesSearch.execute(params, toolContext(ctx)), NOTES_NAMESPACE);
39
38
  registerOperation(pi, dreamBegin, (params, ctx) => dreamBegin.execute(params, notesIdentityFromPi(ctx), dreamOf(ctx)), DREAM_NAMESPACE, undefined, "deferred");
40
39
  registerOperation(pi, dreamForget, (params, ctx) => dreamForget.execute(params, notesIdentityFromPi(ctx), dreamOf(ctx)), DREAM_NAMESPACE, undefined, "deferred");
41
40
  registerOperation(pi, dreamEnd, (params, ctx) => dreamEnd.execute(params, notesIdentityFromPi(ctx), dreamOf(ctx)), DREAM_NAMESPACE, undefined, "deferred");