@dreamlake/dreamlake-cli 0.104.8 → 0.105.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 (108) hide show
  1. package/dist/api/index.d.ts +27 -17
  2. package/dist/api/index.js +25 -16
  3. package/dist/api/memo-character-plan.d.ts +2 -0
  4. package/dist/api/memo-character-plan.js +2 -0
  5. package/dist/api/memo-editing.d.ts +2 -0
  6. package/dist/api/memo-editing.js +2 -0
  7. package/dist/api/memo-edits.d.ts +63 -0
  8. package/dist/api/memo-edits.js +206 -0
  9. package/dist/api/memo-events.d.ts +44 -0
  10. package/dist/api/memo-events.js +65 -0
  11. package/dist/api/memo-facade.d.ts +294 -0
  12. package/dist/api/memo-facade.js +382 -0
  13. package/dist/api/memo-files.d.ts +111 -0
  14. package/dist/api/memo-files.js +110 -0
  15. package/dist/api/memo-html-read.d.ts +2 -0
  16. package/dist/api/memo-html-read.js +2 -0
  17. package/dist/api/memo-html.d.ts +2 -0
  18. package/dist/api/memo-html.js +2 -0
  19. package/dist/api/memo-linger.d.ts +85 -0
  20. package/dist/api/memo-linger.js +271 -0
  21. package/dist/api/memo-presence.d.ts +109 -0
  22. package/dist/api/memo-presence.js +75 -0
  23. package/dist/api/memo-reading.d.ts +55 -0
  24. package/dist/api/memo-reading.js +43 -0
  25. package/dist/api/memo-toc.d.ts +2 -0
  26. package/dist/api/memo-toc.js +2 -0
  27. package/dist/api/memo-write.d.ts +119 -0
  28. package/dist/api/memo-write.js +221 -0
  29. package/dist/api/memos.d.ts +344 -0
  30. package/dist/api/memos.js +231 -0
  31. package/dist/api/note-character-plan.d.ts +2 -2
  32. package/dist/api/note-character-plan.js +2 -2
  33. package/dist/api/note-editing.d.ts +2 -2
  34. package/dist/api/note-editing.js +2 -2
  35. package/dist/api/note-edits.d.ts +2 -59
  36. package/dist/api/note-edits.js +2 -205
  37. package/dist/api/note-events.d.ts +2 -41
  38. package/dist/api/note-events.js +2 -64
  39. package/dist/api/note-facade.d.ts +2 -268
  40. package/dist/api/note-facade.js +2 -376
  41. package/dist/api/note-files.d.ts +2 -102
  42. package/dist/api/note-files.js +2 -107
  43. package/dist/api/note-html-read.d.ts +2 -2
  44. package/dist/api/note-html-read.js +2 -2
  45. package/dist/api/note-html.d.ts +2 -2
  46. package/dist/api/note-html.js +2 -2
  47. package/dist/api/note-linger.d.ts +2 -83
  48. package/dist/api/note-linger.js +2 -270
  49. package/dist/api/note-presence.d.ts +2 -100
  50. package/dist/api/note-presence.js +2 -73
  51. package/dist/api/note-reading.d.ts +2 -51
  52. package/dist/api/note-reading.js +2 -42
  53. package/dist/api/note-toc.d.ts +2 -2
  54. package/dist/api/note-toc.js +2 -2
  55. package/dist/api/note-write.d.ts +2 -110
  56. package/dist/api/note-write.js +2 -217
  57. package/dist/api/notes.d.ts +2 -335
  58. package/dist/api/notes.js +2 -230
  59. package/dist/api/open-resources.js +3 -3
  60. package/dist/cli/folders/index.d.ts +1 -1
  61. package/dist/cli/folders/index.js +4 -4
  62. package/dist/cli/index.js +2 -2
  63. package/dist/cli/{notes → memos}/api-transport.d.ts +1 -1
  64. package/dist/cli/{notes → memos}/api-transport.js +1 -1
  65. package/dist/cli/{notes → memos}/archive-command.d.ts +1 -1
  66. package/dist/cli/{notes → memos}/archive-command.js +5 -5
  67. package/dist/cli/{notes → memos}/character-plan.d.ts +3 -1
  68. package/dist/cli/{notes → memos}/character-plan.js +7 -5
  69. package/dist/cli/{notes → memos}/document.d.ts +9 -9
  70. package/dist/cli/{notes → memos}/document.js +12 -12
  71. package/dist/cli/{notes → memos}/edit-commands.d.ts +8 -8
  72. package/dist/cli/{notes → memos}/edit-commands.js +14 -14
  73. package/dist/cli/{notes → memos}/events.d.ts +3 -3
  74. package/dist/cli/{notes → memos}/events.js +2 -2
  75. package/dist/cli/{notes → memos}/files-commands.d.ts +2 -2
  76. package/dist/cli/{notes → memos}/files-commands.js +5 -5
  77. package/dist/cli/{notes → memos}/index.d.ts +16 -16
  78. package/dist/cli/{notes → memos}/index.js +53 -53
  79. package/dist/cli/{notes → memos}/linger.d.ts +3 -3
  80. package/dist/cli/{notes → memos}/linger.js +5 -5
  81. package/dist/cli/{notes → memos}/move-command.d.ts +5 -5
  82. package/dist/cli/{notes → memos}/move-command.js +6 -6
  83. package/dist/cli/{notes → memos}/rm-command.d.ts +2 -2
  84. package/dist/cli/{notes → memos}/rm-command.js +2 -2
  85. package/dist/cli/{notes → memos}/select-command.d.ts +1 -1
  86. package/dist/cli/{notes → memos}/select-command.js +4 -4
  87. package/dist/cli/{notes → memos}/suggest-diff.d.ts +1 -1
  88. package/dist/cli/{notes → memos}/suggest-diff.js +2 -2
  89. package/dist/cli/{notes → memos}/transfer-command.d.ts +2 -2
  90. package/dist/cli/{notes → memos}/transfer-command.js +2 -2
  91. package/dist/cli/share.d.ts +1 -1
  92. package/dist/cli/share.js +1 -1
  93. package/dist/cli/update/index.js +3 -3
  94. package/dist/cli/version.d.ts +1 -1
  95. package/dist/cli/version.js +1 -1
  96. package/package.json +9 -9
  97. /package/dist/cli/{notes → memos}/editing.d.ts +0 -0
  98. /package/dist/cli/{notes → memos}/editing.js +0 -0
  99. /package/dist/cli/{notes → memos}/html-read.d.ts +0 -0
  100. /package/dist/cli/{notes → memos}/html-read.js +0 -0
  101. /package/dist/cli/{notes → memos}/html.d.ts +0 -0
  102. /package/dist/cli/{notes → memos}/html.js +0 -0
  103. /package/dist/cli/{notes → memos}/media-commands.d.ts +0 -0
  104. /package/dist/cli/{notes → memos}/media-commands.js +0 -0
  105. /package/dist/cli/{notes → memos}/toc.d.ts +0 -0
  106. /package/dist/cli/{notes → memos}/toc.js +0 -0
  107. /package/dist/cli/{notes → memos}/version-commands.d.ts +0 -0
  108. /package/dist/cli/{notes → memos}/version-commands.js +0 -0
@@ -1,5 +1,5 @@
1
- import { notePresenceApi, notePresenceIntent } from '../../api/note-presence.js';
2
- import { noteTransport } from './api-transport.js';
1
+ import { memoPresenceApi, memoPresenceIntent } from '../../api/memo-presence.js';
2
+ import { memoTransport } from './api-transport.js';
3
3
  import { collectionList } from "../collection-list.js";
4
4
  import { registerVersionCommands, runSavedVersionRead } from "./version-commands.js";
5
5
  import { registerMoveCommand } from "./move-command.js";
@@ -8,7 +8,7 @@ import { registerArchiveCommands } from "./archive-command.js";
8
8
  import { registerRmCommand } from "./rm-command.js";
9
9
  import { registerSuggestDiffCommand } from "./suggest-diff.js";
10
10
  import { registerShareCommands } from "../share.js";
11
- import { runNotesTextSelect } from "./select-command.js";
11
+ import { runMemosTextSelect } from "./select-command.js";
12
12
  /**
13
13
  * Notes v2 reads carry exact source, hashes and opaque write revisions on stdout.
14
14
  * Patch uploads require the saved baseline; the backend owns parsing and RTC writes.
@@ -17,12 +17,12 @@ import { runNotesTextSelect } from "./select-command.js";
17
17
  */
18
18
  import { readFileSync } from "node:fs";
19
19
  import { runMediaUpload } from "./media-commands.js";
20
- import { runNotesLinger } from "./linger.js";
21
- import { runDocumentRead, runDocumentPatch, runNotesCommandStatus, readDocumentSnapshot, readStdinBytes, submitDocumentPatch, printPatchReceipt, documentWriteError, commandIdFlag, withCommandId, canonicalInput } from "./document.js";
22
- import { appendPlan, writePlan } from "../../api/note-write.js";
23
- import { NotePatchError } from "./character-plan.js";
20
+ import { runMemosLinger } from "./linger.js";
21
+ import { runDocumentRead, runDocumentPatch, runMemosCommandStatus, readDocumentSnapshot, readStdinBytes, submitDocumentPatch, printPatchReceipt, documentWriteError, commandIdFlag, withCommandId, canonicalInput } from "./document.js";
22
+ import { appendPlan, writePlan } from "../../api/memo-write.js";
23
+ import { MemoPatchError } from "./character-plan.js";
24
24
  import { HttpError, requestJson, requestRaw } from "../client.js";
25
- import { runNotesDelete, runNotesFind, runNotesInsert, runNotesReplace, runNotesGrep, runNotesSelect, runNotesToc, } from "./edit-commands.js";
25
+ import { runMemosDelete, runMemosFind, runMemosInsert, runMemosReplace, runMemosGrep, runMemosSelect, runMemosToc, } from "./edit-commands.js";
26
26
  import { runFilesCat, runFilesPreview, runFilesCopy, runFilesDownload, runFilesList, runFilesMove, runFilesRestore, runFilesRm, runFilesUpload, runFilesWrite, runFilesOperation, } from "./files-commands.js";
27
27
  import { resolveCtx } from "../compat/ctx.js";
28
28
  import { withConnFlags } from "../compat/flags.js";
@@ -190,7 +190,7 @@ async function validator(c, noteId, opts) {
190
190
  return { "If-Match": body.etag };
191
191
  }
192
192
  // ─── commands ─────────────────────────────────────────────────────────────────
193
- export function registerNotesCommand(program) {
193
+ export function registerMemosCommand(program) {
194
194
  const notes = program
195
195
  .command("memos")
196
196
  .aliases(["memo", "notes", "note"])
@@ -211,25 +211,25 @@ export function registerNotesCommand(program) {
211
211
  .option("--namespace <slug>", "memo owner namespace")
212
212
  .option("--intent <text>", "one short sentence of purpose, shown on your presence card")
213
213
  .option("--json", "emit JSON")
214
- .action(async (note, opts) => { process.exitCode = await runNotesVisit(note, opts); });
214
+ .action(async (note, opts) => { process.exitCode = await runMemosVisit(note, opts); });
215
215
  strict(notes.command("presence"))
216
216
  .argument("<memo>", "memo id, slug or title")
217
217
  .description("read who is present without joining the memo")
218
218
  .option("--namespace <slug>", "memo owner namespace")
219
219
  .option("--json", "emit JSON for programmatic consumers")
220
- .action(async (note, opts) => { process.exitCode = await runNotesPresence(note, opts); });
220
+ .action(async (note, opts) => { process.exitCode = await runMemosPresence(note, opts); });
221
221
  strict(notes.command("contributors"))
222
222
  .argument("<memo>", "memo id, slug or title")
223
223
  .description("list durable contributing sessions and explicitly linked sessions")
224
224
  .option("--namespace <slug>", "memo owner namespace")
225
225
  .option("--cursor <id>", "continue from the returned nextCursor")
226
226
  .option("--json", "emit JSON including evidence and pagination")
227
- .action(async (note, opts) => { process.exitCode = await runNotesContributors(note, opts); });
227
+ .action(async (note, opts) => { process.exitCode = await runMemosContributors(note, opts); });
228
228
  strict(notes.command("projects"))
229
229
  .argument("<memo-id>", "stable Memo ID")
230
230
  .description("inspect current project filing and server-computed filing permissions (JSON)")
231
231
  .option("--namespace <slug>", "the Memo's owning namespace (or --ns)")
232
- .action(async (id, opts) => { process.exitCode = await runNotesProjects(id, opts); });
232
+ .action(async (id, opts) => { process.exitCode = await runMemosProjects(id, opts); });
233
233
  // ── notes create ──
234
234
  strict(notes.command("create"))
235
235
  .argument("[name]", "the memo's title (default: Untitled)")
@@ -240,7 +240,7 @@ export function registerNotesCommand(program) {
240
240
  .option("--public", "anyone can read it (default: private)")
241
241
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
242
242
  .option("--json", "emit JSON")
243
- .action(async (name, opts) => { process.exitCode = await runNotesCreate(name, opts); });
243
+ .action(async (name, opts) => { process.exitCode = await runMemosCreate(name, opts); });
244
244
  // ── notes list ──
245
245
  strict(collectionList(notes, "list"))
246
246
  .description("list memos in one namespace")
@@ -250,7 +250,7 @@ export function registerNotesCommand(program) {
250
250
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
251
251
  .option("--shared", "list memos other people shared with you, across namespaces")
252
252
  .option("--json", "emit JSON")
253
- .action(async (opts) => { process.exitCode = await runNotesList(opts); });
253
+ .action(async (opts) => { process.exitCode = await runMemosList(opts); });
254
254
  // ── notes search ──
255
255
  strict(notes.command("search"))
256
256
  .argument("<query>", "matched against memo titles and bodies, case-insensitively")
@@ -259,7 +259,7 @@ export function registerNotesCommand(program) {
259
259
  .option("--limit <n>", "page size", "50")
260
260
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
261
261
  .option("--json", "emit JSON")
262
- .action(async (query, opts) => { process.exitCode = await runNotesSearch(query, opts); });
262
+ .action(async (query, opts) => { process.exitCode = await runMemosSearch(query, opts); });
263
263
  // ── notes grep ──
264
264
  strict(notes.command("grep"))
265
265
  .argument("[query]", "literal text; punctuation matches itself")
@@ -275,7 +275,7 @@ export function registerNotesCommand(program) {
275
275
  .option("--limit <n>", "maximum number of hits", "50")
276
276
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
277
277
  .option("--json", "emit JSON (each hit carries its etag and character range)")
278
- .action(async (query, opts) => { process.exitCode = await runNotesGrep(query, opts); });
278
+ .action(async (query, opts) => { process.exitCode = await runMemosGrep(query, opts); });
279
279
  const media = notes.command("media").allowExcessArguments(false)
280
280
  .description("image and video URLs accessible to anyone holding the URL");
281
281
  strict(media.command("upload"))
@@ -403,7 +403,7 @@ export function registerNotesCommand(program) {
403
403
  .description("list the addressable sections (a heading plus everything under it)")
404
404
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
405
405
  .option("--json", "emit JSON")
406
- .action(async (ref, opts) => { process.exitCode = await runNotesSections(ref, opts); });
406
+ .action(async (ref, opts) => { process.exitCode = await runMemosSections(ref, opts); });
407
407
  // ── notes read ──
408
408
  strict(notes.command("read"))
409
409
  .option("--lines <a:b>", "only these source lines (1-based, inclusive) with their code-point address; never a complete body")
@@ -433,7 +433,7 @@ export function registerNotesCommand(program) {
433
433
  .option("-n, --numbered", "prefix each line with its number, like `cat -n`")
434
434
  .option("--json", "emit exact content, SHA-256 hash and opaque write revision")
435
435
  .option("--if-match <etag>", "verify: fail unless the memo is still at this revision")
436
- .action(async (ref, opts) => { process.exitCode = await runNotesRead(ref, opts); });
436
+ .action(async (ref, opts) => { process.exitCode = await runMemosRead(ref, opts); });
437
437
  // ── notes diff ──
438
438
  strict(notes.command("diff"))
439
439
  .argument("[note]", "memo id, slug or name (or pass --note)")
@@ -445,7 +445,7 @@ export function registerNotesCommand(program) {
445
445
  .option("--context <n>", "legacy unchanged context lines per hunk (0–100)")
446
446
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
447
447
  .option("--json", "emit base/hash/revision and selected patch format")
448
- .action(async (ref, opts) => { process.exitCode = await runNotesDiff(ref, opts); });
448
+ .action(async (ref, opts) => { process.exitCode = await runMemosDiff(ref, opts); });
449
449
  // ── notes write ──
450
450
  strict(notes.command("write"))
451
451
  .argument("<memo>", "memo id, slug or name")
@@ -462,7 +462,7 @@ export function registerNotesCommand(program) {
462
462
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
463
463
  .option("--json", "emit JSON")
464
464
  .option("--dry-run", "show the write that would be sent, and send nothing")
465
- .action(async (ref, opts) => { process.exitCode = await runNotesWrite(ref, opts); });
465
+ .action(async (ref, opts) => { process.exitCode = await runMemosWrite(ref, opts); });
466
466
  // ── notes append ──
467
467
  strict(notes.command("append"))
468
468
  .argument("<memo>", "memo id, slug or name")
@@ -477,7 +477,7 @@ export function registerNotesCommand(program) {
477
477
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
478
478
  .option("--json", "emit JSON")
479
479
  .option("--dry-run", "show the write that would be sent, and send nothing")
480
- .action(async (ref, opts) => { process.exitCode = await runNotesAppend(ref, opts); });
480
+ .action(async (ref, opts) => { process.exitCode = await runMemosAppend(ref, opts); });
481
481
  // ── notes patch ──
482
482
  strict(notes.command("patch"))
483
483
  .argument("<memo>", "memo id, slug or name")
@@ -494,7 +494,7 @@ export function registerNotesCommand(program) {
494
494
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
495
495
  .option("--json", "emit JSON")
496
496
  .option("--dry-run", "show the write that would be sent, and send nothing")
497
- .action(async (ref, opts) => { process.exitCode = await runNotesPatch(ref, opts); });
497
+ .action(async (ref, opts) => { process.exitCode = await runMemosPatch(ref, opts); });
498
498
  // ── notes add-section ──
499
499
  strict(notes.command("add-section"))
500
500
  .argument("<memo>", "memo id, slug or name")
@@ -508,7 +508,7 @@ export function registerNotesCommand(program) {
508
508
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
509
509
  .option("--json", "emit JSON")
510
510
  .option("--dry-run", "show the write that would be sent, and send nothing")
511
- .action(async (ref, opts) => { process.exitCode = await runNotesAddSection(ref, opts); });
511
+ .action(async (ref, opts) => { process.exitCode = await runMemosAddSection(ref, opts); });
512
512
  // ── notes rm-section ──
513
513
  // ── Editing: locate, then change, as one conditional write ──────────────
514
514
  // Query stays the first positional argument, matching `search` above;
@@ -527,7 +527,7 @@ export function registerNotesCommand(program) {
527
527
  .option("--no-case-sensitive", "ignore case for a literal query")
528
528
  .option("--json", "emit matches with memo, hash and the source revision")
529
529
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
530
- .action(async (query, opts) => { process.exitCode = await runNotesFind(query, opts); });
530
+ .action(async (query, opts) => { process.exitCode = await runMemosFind(query, opts); });
531
531
  strict(notes.command("toc"))
532
532
  .description("the memo's outline, with line and character ranges")
533
533
  .option("--note <ref>", "the memo: slug, id or exact title")
@@ -535,7 +535,7 @@ export function registerNotesCommand(program) {
535
535
  .option("--at <revision>", "outline the retained snapshot at this revision")
536
536
  .option("--json", "emit entries with memo, hash and the source revision")
537
537
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
538
- .action(async (opts) => { process.exitCode = await runNotesToc(opts); });
538
+ .action(async (opts) => { process.exitCode = await runMemosToc(opts); });
539
539
  strict(notes.command("replace"))
540
540
  .description("replace text; one match required unless --all or --count")
541
541
  .argument("[query]", "literal text to replace (or the memo ID when --lines/--address select the span)")
@@ -561,7 +561,7 @@ export function registerNotesCommand(program) {
561
561
  .option("--json", "emit the new revision")
562
562
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
563
563
  .option("--html <markup>", "with --selector: replace the element's contents with markup (not escaped)")
564
- .action(async (query, opts) => { process.exitCode = await runNotesReplace(query, opts); });
564
+ .action(async (query, opts) => { process.exitCode = await runMemosReplace(query, opts); });
565
565
  strict(notes.command("insert"))
566
566
  .description("insert text before/after a mapped element, at a cursor, or at a line")
567
567
  .argument("[note]", "memo id (alternative to --note)")
@@ -584,7 +584,7 @@ export function registerNotesCommand(program) {
584
584
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
585
585
  .option("--selector <css>", "insert relative to this element instead of a line")
586
586
  .option("--position <where>", "with --selector: before | after | prepend | append", "append")
587
- .action(async (note, opts) => { process.exitCode = await runNotesInsert(note, opts); });
587
+ .action(async (note, opts) => { process.exitCode = await runMemosInsert(note, opts); });
588
588
  strict(notes.command("delete"))
589
589
  .alias("remove")
590
590
  .description("remove text (selected source, never the memo); one match required unless --all or --count")
@@ -608,14 +608,14 @@ export function registerNotesCommand(program) {
608
608
  .option("--dry-run", "print what would be written and stop")
609
609
  .option("--json", "emit the new revision")
610
610
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
611
- .action(async (query, opts) => { process.exitCode = await runNotesDelete(query, opts); });
611
+ .action(async (query, opts) => { process.exitCode = await runMemosDelete(query, opts); });
612
612
  strict(notes.command("command-status"))
613
613
  .argument("<memo>", "memo id, slug or name")
614
614
  .argument("<command-id>", "the --command-id of an earlier write")
615
615
  .description("the durable outcome of one identified write: pending, accepted, no-write or unknown")
616
616
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
617
617
  .option("--json", "emit JSON")
618
- .action(async (ref, commandId, opts) => { process.exitCode = await runNotesCommandStatus(ref, commandId, opts); });
618
+ .action(async (ref, commandId, opts) => { process.exitCode = await runMemosCommandStatus(ref, commandId, opts); });
619
619
  strict(notes.command("select"))
620
620
  .description("publish an agent selection with --text, or report one HTML element by CSS")
621
621
  .argument("[css]", "a CSS selector matching exactly one element (lookup only)")
@@ -628,10 +628,10 @@ export function registerNotesCommand(program) {
628
628
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
629
629
  .action(async (css, opts) => {
630
630
  if (opts.text !== undefined || !css || opts.section !== undefined || opts.occurrence !== undefined || opts.hash !== undefined) {
631
- process.exitCode = await runNotesTextSelect(css, opts);
631
+ process.exitCode = await runMemosTextSelect(css, opts);
632
632
  }
633
633
  else {
634
- process.exitCode = await runNotesSelect(css, opts);
634
+ process.exitCode = await runMemosSelect(css, opts);
635
635
  }
636
636
  });
637
637
  strict(notes.command("rm-section"))
@@ -643,7 +643,7 @@ export function registerNotesCommand(program) {
643
643
  .option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
644
644
  .option("--json", "emit JSON")
645
645
  .option("--dry-run", "show the write that would be sent, and send nothing")
646
- .action(async (ref, anchor, opts) => { process.exitCode = await runNotesRmSection(ref, anchor, opts); });
646
+ .action(async (ref, anchor, opts) => { process.exitCode = await runMemosRmSection(ref, anchor, opts); });
647
647
  addNamespaceAlias(notes);
648
648
  }
649
649
  /** `--ns` aliases `--namespace` on every Notes command that takes one (Notes API
@@ -666,7 +666,7 @@ function addNamespaceAlias(group) {
666
666
  }
667
667
  }
668
668
  // ─── implementations ──────────────────────────────────────────────────────────
669
- export async function runNotesList(opts) {
669
+ export async function runMemosList(opts) {
670
670
  const c = await ctx(opts);
671
671
  if (!c)
672
672
  return 1;
@@ -703,7 +703,7 @@ export async function runNotesList(opts) {
703
703
  return report(e);
704
704
  }
705
705
  }
706
- export async function runNotesSearch(query, opts) {
706
+ export async function runMemosSearch(query, opts) {
707
707
  const c = await ctx(opts);
708
708
  if (!c)
709
709
  return 1;
@@ -742,7 +742,7 @@ export async function runNotesSearch(query, opts) {
742
742
  return report(e);
743
743
  }
744
744
  }
745
- export async function runNotesSections(ref, opts) {
745
+ export async function runMemosSections(ref, opts) {
746
746
  const c = await ctx(opts);
747
747
  if (!c)
748
748
  return 1;
@@ -870,7 +870,7 @@ function previewWrite(opts, req) {
870
870
  process.stdout.write(text.endsWith("\n") ? text : text + "\n");
871
871
  return 0;
872
872
  }
873
- export async function runNotesWrite(ref, opts) {
873
+ export async function runMemosWrite(ref, opts) {
874
874
  // Section write remains its explicitly selected retained interface, not a
875
875
  // modern whole-body write with an inferred or silently changed target.
876
876
  const compatibility = opts.section !== undefined || opts.legacy || opts.force || opts.ifMatch !== undefined;
@@ -932,7 +932,7 @@ export async function runNotesWrite(ref, opts) {
932
932
  return 0;
933
933
  }
934
934
  catch (error) {
935
- if (error instanceof NotePatchError) {
935
+ if (error instanceof MemoPatchError) {
936
936
  fail(`${error.code}: ${error.message}; keep the original baseline and draft`);
937
937
  return 5;
938
938
  }
@@ -1046,7 +1046,7 @@ async function runLegacyNotesPatch(ref, opts) {
1046
1046
  return report(e);
1047
1047
  }
1048
1048
  }
1049
- export async function runNotesAppend(ref, opts) {
1049
+ export async function runMemosAppend(ref, opts) {
1050
1050
  if (opts.legacy || opts.force) {
1051
1051
  if (opts.baseRevision !== undefined || opts.exact) {
1052
1052
  fail("--legacy/--force cannot combine with --base-revision or --exact");
@@ -1138,7 +1138,7 @@ async function runLegacyNotesAppend(ref, opts) {
1138
1138
  return report(e);
1139
1139
  }
1140
1140
  }
1141
- export async function runNotesCreate(name, opts) {
1141
+ export async function runMemosCreate(name, opts) {
1142
1142
  // Notes API contract: the title is optional and an omitted one displays as Untitled.
1143
1143
  name ??= "Untitled";
1144
1144
  const c = await ctx(opts);
@@ -1175,7 +1175,7 @@ export async function runNotesCreate(name, opts) {
1175
1175
  return report(e);
1176
1176
  }
1177
1177
  }
1178
- export async function runNotesAddSection(ref, opts) {
1178
+ export async function runMemosAddSection(ref, opts) {
1179
1179
  if (opts.before && opts.after) {
1180
1180
  fail("pass --before or --after, not both");
1181
1181
  return 1;
@@ -1228,7 +1228,7 @@ export async function runNotesAddSection(ref, opts) {
1228
1228
  return report(e);
1229
1229
  }
1230
1230
  }
1231
- export async function runNotesRmSection(ref, anchor, opts) {
1231
+ export async function runMemosRmSection(ref, anchor, opts) {
1232
1232
  const c = await ctx(opts);
1233
1233
  if (!c)
1234
1234
  return 1;
@@ -1254,7 +1254,7 @@ export async function runNotesRmSection(ref, anchor, opts) {
1254
1254
  }
1255
1255
  }
1256
1256
  /** Explicit compatibility keeps legacy body-only output and ETag semantics available. */
1257
- export async function runNotesRead(ref, opts) {
1257
+ export async function runMemosRead(ref, opts) {
1258
1258
  if (opts.lines !== undefined && (opts.legacy || opts.startLine !== undefined || opts.endLine !== undefined || opts.numbered || opts.linger || opts.version !== undefined)) {
1259
1259
  fail("--lines is the v2 line range of the live source; it cannot combine with --legacy, --start-line, --end-line, --numbered, --linger or --version");
1260
1260
  return 1;
@@ -1262,7 +1262,7 @@ export async function runNotesRead(ref, opts) {
1262
1262
  if (opts.version !== undefined)
1263
1263
  return runSavedVersionRead(ref, opts);
1264
1264
  if (opts.linger)
1265
- return runNotesLinger(ref, opts);
1265
+ return runMemosLinger(ref, opts);
1266
1266
  if (opts.debounce !== undefined || opts.throttle !== undefined || opts.intent !== undefined) {
1267
1267
  fail('--debounce/--throttle/--intent require --linger');
1268
1268
  return 1;
@@ -1281,7 +1281,7 @@ export async function runNotesRead(ref, opts) {
1281
1281
  }
1282
1282
  return opts.legacy ? runLegacyNotesRead(ref, opts) : runDocumentRead(ref, opts);
1283
1283
  }
1284
- export async function runNotesDiff(ref, opts) {
1284
+ export async function runMemosDiff(ref, opts) {
1285
1285
  if (opts.legacy && opts.format !== undefined) {
1286
1286
  fail("--format requires the v2 diff contract");
1287
1287
  return 1;
@@ -1298,7 +1298,7 @@ export async function runNotesDiff(ref, opts) {
1298
1298
  }
1299
1299
  return runDocumentRead(ref, opts);
1300
1300
  }
1301
- export async function runNotesPatch(ref, opts) {
1301
+ export async function runMemosPatch(ref, opts) {
1302
1302
  if (opts.legacy && opts.commandId !== undefined) {
1303
1303
  fail("--command-id requires the v2 patch contract");
1304
1304
  return 1;
@@ -1314,7 +1314,7 @@ export async function runNotesPatch(ref, opts) {
1314
1314
  return opts.legacy ? runLegacyNotesPatch(ref, opts) : runDocumentPatch(ref, opts);
1315
1315
  }
1316
1316
  /** Reading the roster never registers presence or maintains a session. */
1317
- export async function runNotesContributors(ref, opts) {
1317
+ export async function runMemosContributors(ref, opts) {
1318
1318
  const c = await ctx(opts);
1319
1319
  if (!c)
1320
1320
  return 1;
@@ -1322,7 +1322,7 @@ export async function runNotesContributors(ref, opts) {
1322
1322
  const id = await resolveNote(c, ref);
1323
1323
  if (!id)
1324
1324
  return 1;
1325
- const result = await notePresenceApi(noteTransport(c), `/namespaces/${seg(c.ns)}/notes`).contributors(id, { cursor: opts.cursor });
1325
+ const result = await memoPresenceApi(memoTransport(c), `/namespaces/${seg(c.ns)}/notes`).contributors(id, { cursor: opts.cursor });
1326
1326
  if (opts.json)
1327
1327
  emitJson(result);
1328
1328
  else {
@@ -1340,7 +1340,7 @@ export async function runNotesContributors(ref, opts) {
1340
1340
  }
1341
1341
  }
1342
1342
  /** Reading the roster never registers presence or maintains a session. */
1343
- export async function runNotesPresence(ref, opts) {
1343
+ export async function runMemosPresence(ref, opts) {
1344
1344
  const c = await ctx(opts);
1345
1345
  if (!c)
1346
1346
  return 1;
@@ -1364,10 +1364,10 @@ export async function runNotesPresence(ref, opts) {
1364
1364
  /** The agent's self-reported purpose, validated before any presence request.
1365
1365
  * undefined means the flag was not given — the server then preserves intent. */
1366
1366
  export function presenceIntent(value) {
1367
- return notePresenceIntent(value);
1367
+ return memoPresenceIntent(value);
1368
1368
  }
1369
1369
  /** One-shot participation; linger owns its own maintained lease. */
1370
- export async function runNotesVisit(ref, opts) {
1370
+ export async function runMemosVisit(ref, opts) {
1371
1371
  if (!process.env.DREAMLAKE_AGENT_ID) {
1372
1372
  fail('set DREAMLAKE_AGENT_ID to a stable task-session ID');
1373
1373
  return 1;
@@ -1380,7 +1380,7 @@ export async function runNotesVisit(ref, opts) {
1380
1380
  const id = await resolveNote(c, ref);
1381
1381
  if (!id)
1382
1382
  return 1;
1383
- const result = await notePresenceApi(noteTransport(c), `/namespaces/${seg(c.ns)}/notes`).visit(id, { intent: opts.intent });
1383
+ const result = await memoPresenceApi(memoTransport(c), `/namespaces/${seg(c.ns)}/notes`).visit(id, { intent: opts.intent });
1384
1384
  if (opts.json)
1385
1385
  emitJson(result);
1386
1386
  else
@@ -1392,7 +1392,7 @@ export async function runNotesVisit(ref, opts) {
1392
1392
  }
1393
1393
  }
1394
1394
  /** Metadata only: no body read, RTC activation, mount, or ownership mutation. */
1395
- export async function runNotesProjects(id, opts) {
1395
+ export async function runMemosProjects(id, opts) {
1396
1396
  try {
1397
1397
  if (!/^[a-f0-9]{24}$/i.test(id) || !opts.namespace?.trim())
1398
1398
  throw new Error('Use a stable Memo ID and an explicit --namespace (or --ns)');
@@ -1,4 +1,4 @@
1
1
  import type { DocumentReadOptions } from './document.js';
2
- import { type LingerRuntime } from '../../api/note-linger.js';
3
- export { LINGER_BATCH_MS, lingerDuration, LingerBatch, type LingerRuntime } from '../../api/note-linger.js';
4
- export declare function runNotesLinger(ref: string | undefined, opts: DocumentReadOptions, clock?: LingerRuntime): Promise<number>;
2
+ import { type LingerRuntime } from '../../api/memo-linger.js';
3
+ export { LINGER_BATCH_MS, lingerDuration, LingerBatch, type LingerRuntime } from '../../api/memo-linger.js';
4
+ export declare function runMemosLinger(ref: string | undefined, opts: DocumentReadOptions, clock?: LingerRuntime): Promise<number>;
@@ -2,16 +2,16 @@
2
2
  import { once } from 'node:events';
3
3
  import { fail } from '../helpers.js';
4
4
  import { ctx, report, resolveNote, seg } from './index.js';
5
- import { watchNote } from '../../api/note-linger.js';
6
- import { noteTransport } from './api-transport.js';
7
- export { LINGER_BATCH_MS, lingerDuration, LingerBatch } from '../../api/note-linger.js';
5
+ import { watchMemo } from '../../api/memo-linger.js';
6
+ import { memoTransport } from './api-transport.js';
7
+ export { LINGER_BATCH_MS, lingerDuration, LingerBatch } from '../../api/memo-linger.js';
8
8
  const label = (value) => JSON.stringify(value).slice(1, -1);
9
9
  const participant = (p) => p.user.kind === 'agent' ? `${label(p.user.name)} (agent)` : `@${label(p.user.id)}`;
10
10
  function selectionText(p) {
11
11
  const s = p.selection;
12
12
  return !s || s.status !== 'resolved' || s.start === s.end ? '' : ` selected ${JSON.stringify(s.text)}${s.truncated ? ' [truncated]' : ''}`;
13
13
  }
14
- export async function runNotesLinger(ref, opts, clock) {
14
+ export async function runMemosLinger(ref, opts, clock) {
15
15
  const target = ref ?? opts.note;
16
16
  if (!target || (ref && opts.note && ref !== opts.note)) {
17
17
  fail('give one memo id, slug or name');
@@ -42,7 +42,7 @@ export async function runNotesLinger(ref, opts, clock) {
42
42
  if (!id)
43
43
  return 1;
44
44
  const path = `/namespaces/${seg(c.ns)}/notes/${seg(id)}`;
45
- await watchNote(noteTransport(c), path, id, { signal: abort.signal, format: opts.format, debounce: opts.debounce, throttle: opts.throttle, ifMatch: opts.ifMatch, intent: opts.intent }, async (event) => {
45
+ await watchMemo(memoTransport(c), path, id, { signal: abort.signal, format: opts.format, debounce: opts.debounce, throttle: opts.throttle, ifMatch: opts.ifMatch, intent: opts.intent }, async (event) => {
46
46
  if (event.type === 'snapshot') {
47
47
  for (const p of event.participants)
48
48
  selections.set(p.client, selectionText(p));
@@ -15,7 +15,7 @@ interface Project {
15
15
  id: string;
16
16
  slug: string;
17
17
  }
18
- export interface NoteMoveReceipt {
18
+ export interface MemoMoveReceipt {
19
19
  dryRun: boolean;
20
20
  moved: boolean;
21
21
  executable: boolean;
@@ -45,7 +45,7 @@ export interface NoteMoveReceipt {
45
45
  warnings: string[];
46
46
  }
47
47
  /** Ownership changes never read or rewrite the collaborative body, nor retry a POST. */
48
- export declare function runNotesMove(ref: string, opts: MoveOptions): Promise<number>;
48
+ export declare function runMemosMove(ref: string, opts: MoveOptions): Promise<number>;
49
49
  interface TreeNode {
50
50
  id: string;
51
51
  name: string;
@@ -56,7 +56,7 @@ interface TreeNode {
56
56
  resourceType?: string | null;
57
57
  resourceId?: string | null;
58
58
  }
59
- export interface NoteFolderMoveReceipt {
59
+ export interface MemoFolderMoveReceipt {
60
60
  dryRun: boolean;
61
61
  moved: boolean;
62
62
  note: {
@@ -76,12 +76,12 @@ export interface NoteFolderMoveReceipt {
76
76
  };
77
77
  }
78
78
  /** The note's mount in one project, from the server's authorized node view. */
79
- export declare function noteProjectNode(remote: string, token: string, ns: string, noteId: string, project: string): Promise<TreeNode>;
79
+ export declare function memoProjectNode(remote: string, token: string, ns: string, noteId: string, project: string): Promise<TreeNode>;
80
80
  /**
81
81
  * Relocate a note's node to another folder of the same project. Only the
82
82
  * node's tree position changes: the node ID is kept, so bindr tags, links,
83
83
  * attachments and access are untouched. Folders are never created here.
84
84
  */
85
- export declare function runNotesFolderMove(ref: string, opts: MoveOptions): Promise<number>;
85
+ export declare function runMemosFolderMove(ref: string, opts: MoveOptions): Promise<number>;
86
86
  export declare function registerMoveCommand(notes: Command): void;
87
87
  export {};
@@ -6,14 +6,14 @@ import { requireNamespace, requireToken } from "../compat/http.js";
6
6
  import { emitJson, fail } from "../helpers.js";
7
7
  import { resolveNote, seg } from "./index.js";
8
8
  /** Ownership changes never read or rewrite the collaborative body, nor retry a POST. */
9
- export async function runNotesMove(ref, opts) {
9
+ export async function runMemosMove(ref, opts) {
10
10
  if (opts.folder !== undefined && opts.toFolder !== undefined && opts.folder !== opts.toFolder) {
11
11
  fail("--folder and --to-folder name different folders; give one");
12
12
  return 1;
13
13
  }
14
14
  opts = { ...opts, project: [...(opts.project ?? []), ...(opts.toProject ?? [])], folder: opts.folder ?? opts.toFolder };
15
15
  if (opts.folder !== undefined)
16
- return runNotesFolderMove(ref, opts);
16
+ return runMemosFolderMove(ref, opts);
17
17
  let attempted = false;
18
18
  try {
19
19
  const destination = opts.toNamespace?.trim().replace(/^@/, "");
@@ -120,7 +120,7 @@ function folderOf(path) {
120
120
  return parts.length ? `${parts.join("/")}/` : "/";
121
121
  }
122
122
  /** The note's mount in one project, from the server's authorized node view. */
123
- export async function noteProjectNode(remote, token, ns, noteId, project) {
123
+ export async function memoProjectNode(remote, token, ns, noteId, project) {
124
124
  const res = await requestJson(remote, `/namespaces/${seg(ns)}/resources/note/${seg(noteId)}/projects?view=nodes`, { token });
125
125
  if (!Array.isArray(res?.nodes))
126
126
  throw new Error("server did not return the memo's project nodes");
@@ -149,7 +149,7 @@ async function childNamed(remote, token, scope, name) {
149
149
  * node's tree position changes: the node ID is kept, so bindr tags, links,
150
150
  * attachments and access are untouched. Folders are never created here.
151
151
  */
152
- export async function runNotesFolderMove(ref, opts) {
152
+ export async function runMemosFolderMove(ref, opts) {
153
153
  let attempted = false;
154
154
  try {
155
155
  if (!ref.trim())
@@ -174,7 +174,7 @@ export async function runNotesFolderMove(ref, opts) {
174
174
  const id = /^[a-f0-9]{24}$/i.test(ref) ? ref : await resolveNote({ remote: c.remote, token, ns }, ref);
175
175
  if (!id)
176
176
  return 1;
177
- const node = await noteProjectNode(c.remote, token, ns, id, project);
177
+ const node = await memoProjectNode(c.remote, token, ns, id, project);
178
178
  let target = null;
179
179
  let scope = `namespace=${seg(ns)}&project=${seg(project)}`;
180
180
  for (const [i, name] of segments.entries()) {
@@ -271,5 +271,5 @@ export function registerMoveCommand(notes) {
271
271
  .option("--to-folder <path>", "destination folder (contract spelling of --folder)")
272
272
  .option("--dry-run", "validate on the server and preview access changes without writing")
273
273
  .option("--json", "emit the server move receipt as JSON")
274
- .action(async (note, opts) => { process.exitCode = await runNotesMove(note, opts); });
274
+ .action(async (note, opts) => { process.exitCode = await runMemosMove(note, opts); });
275
275
  }
@@ -14,9 +14,9 @@
14
14
  */
15
15
  import type { Command } from "commander";
16
16
  import { type ConnOpts } from "./index.js";
17
- export interface NotesRmOptions extends ConnOpts {
17
+ export interface MemosRmOptions extends ConnOpts {
18
18
  yes?: boolean;
19
19
  json?: boolean;
20
20
  }
21
- export declare function runNotesRm(ref: string, opts: NotesRmOptions): Promise<number>;
21
+ export declare function runMemosRm(ref: string, opts: MemosRmOptions): Promise<number>;
22
22
  export declare function registerRmCommand(notes: Command): void;
@@ -19,7 +19,7 @@ import { requireNamespace, requireToken } from "../compat/http.js";
19
19
  import { emitJson, fail } from "../helpers.js";
20
20
  import { confirm } from "../prompt.js";
21
21
  import { resolveNote, seg } from "./index.js";
22
- export async function runNotesRm(ref, opts) {
22
+ export async function runMemosRm(ref, opts) {
23
23
  const c = resolveCtx(opts);
24
24
  const token = requireToken(c);
25
25
  if (!token)
@@ -106,5 +106,5 @@ export function registerRmCommand(notes) {
106
106
  .option("-y, --yes", "skip the confirmation prompt")
107
107
  .option("--namespace <slug>", "whose memos, for slug/title lookup; with an id, asserts the owner")
108
108
  .option("--json", "emit JSON")
109
- .action(async (note, opts) => { process.exitCode = await runNotesRm(note, opts); });
109
+ .action(async (note, opts) => { process.exitCode = await runMemosRm(note, opts); });
110
110
  }
@@ -8,5 +8,5 @@ interface SelectOptions extends ConnOpts {
8
8
  hash?: string;
9
9
  json?: boolean;
10
10
  }
11
- export declare function runNotesTextSelect(css: string | undefined, opts: SelectOptions): Promise<number>;
11
+ export declare function runMemosTextSelect(css: string | undefined, opts: SelectOptions): Promise<number>;
12
12
  export {};
@@ -3,10 +3,10 @@ import { ctx, report, resolveNote, seg } from './index.js';
3
3
  import { emitJson, fail } from '../helpers.js';
4
4
  import { HttpError } from '../client.js';
5
5
  import { ApiError } from '../../api/client.js';
6
- import { notePresenceApi } from '../../api/note-presence.js';
7
- import { noteTransport } from './api-transport.js';
6
+ import { memoPresenceApi } from '../../api/memo-presence.js';
7
+ import { memoTransport } from './api-transport.js';
8
8
  import { EXIT_NO_MATCH } from './edit-commands.js';
9
- export async function runNotesTextSelect(css, opts) {
9
+ export async function runMemosTextSelect(css, opts) {
10
10
  if (css !== undefined || !opts.text || !opts.note || opts.section === '') {
11
11
  fail('use memos select --text "exact passage" --note NOTE [--section ANCHOR]; CSS lookup and text selection are separate modes');
12
12
  return 1;
@@ -30,7 +30,7 @@ export async function runNotesTextSelect(css, opts) {
30
30
  const id = await resolveNote(c, opts.note);
31
31
  if (!id)
32
32
  return 1;
33
- const receipt = await notePresenceApi(noteTransport(c), `/namespaces/${seg(c.ns)}/notes`).selectText(id, {
33
+ const receipt = await memoPresenceApi(memoTransport(c), `/namespaces/${seg(c.ns)}/notes`).selectText(id, {
34
34
  text: opts.text, section: opts.section, occurrence: opts.occurrence === undefined ? undefined : Number(opts.occurrence), hash: opts.hash,
35
35
  });
36
36
  const range = receipt.range, scope = receipt.scope, nth = receipt.occurrence, matches = { length: receipt.matches };
@@ -51,6 +51,6 @@ export interface SuggestDiffCommandOptions {
51
51
  json?: boolean;
52
52
  }
53
53
  /** Local only: reads two files and prints a Notes body; nothing is sent anywhere. */
54
- export declare function runNotesSuggestDiff(before: string, after: string, opts: SuggestDiffCommandOptions): number;
54
+ export declare function runMemosSuggestDiff(before: string, after: string, opts: SuggestDiffCommandOptions): number;
55
55
  export declare function registerSuggestDiffCommand(notes: Command): void;
56
56
  export {};
@@ -260,7 +260,7 @@ export function suggestDiff(before, after, opts = {}) {
260
260
  return { markdown: out.join("\n\n") + "\n", stats: w.stats };
261
261
  }
262
262
  /** Local only: reads two files and prints a Notes body; nothing is sent anywhere. */
263
- export function runNotesSuggestDiff(before, after, opts) {
263
+ export function runMemosSuggestDiff(before, after, opts) {
264
264
  if (before === "-" && after === "-") {
265
265
  fail("only one of <before> and <after> can be '-' (stdin)");
266
266
  return 1;
@@ -307,5 +307,5 @@ export function registerSuggestDiffCommand(notes) {
307
307
  .option("--no-mdx", "leave component tags as written")
308
308
  .option("--in-place", "output to replace <before> in the same memo: verbatim unchanged blocks; exit 2 if code changed")
309
309
  .option("--json", "emit { markdown, stats } as JSON")
310
- .action((before, after, opts) => { process.exitCode = runNotesSuggestDiff(before, after, opts); });
310
+ .action((before, after, opts) => { process.exitCode = runMemosSuggestDiff(before, after, opts); });
311
311
  }