@dreamlake/dreamlake-cli 0.104.8 → 0.105.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) 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/help-examples.generated.js +6 -6
  63. package/dist/cli/index.js +2 -2
  64. package/dist/cli/{notes → memos}/api-transport.d.ts +1 -1
  65. package/dist/cli/{notes → memos}/api-transport.js +1 -1
  66. package/dist/cli/{notes → memos}/archive-command.d.ts +1 -1
  67. package/dist/cli/{notes → memos}/archive-command.js +5 -5
  68. package/dist/cli/{notes → memos}/character-plan.d.ts +3 -1
  69. package/dist/cli/{notes → memos}/character-plan.js +7 -5
  70. package/dist/cli/{notes → memos}/document.d.ts +9 -9
  71. package/dist/cli/{notes → memos}/document.js +12 -12
  72. package/dist/cli/{notes → memos}/edit-commands.d.ts +8 -8
  73. package/dist/cli/{notes → memos}/edit-commands.js +14 -14
  74. package/dist/cli/{notes → memos}/events.d.ts +3 -3
  75. package/dist/cli/{notes → memos}/events.js +2 -2
  76. package/dist/cli/{notes → memos}/files-commands.d.ts +2 -2
  77. package/dist/cli/{notes → memos}/files-commands.js +5 -5
  78. package/dist/cli/{notes → memos}/index.d.ts +16 -16
  79. package/dist/cli/{notes → memos}/index.js +53 -53
  80. package/dist/cli/{notes → memos}/linger.d.ts +3 -3
  81. package/dist/cli/{notes → memos}/linger.js +5 -5
  82. package/dist/cli/{notes → memos}/move-command.d.ts +5 -5
  83. package/dist/cli/{notes → memos}/move-command.js +6 -6
  84. package/dist/cli/{notes → memos}/rm-command.d.ts +2 -2
  85. package/dist/cli/{notes → memos}/rm-command.js +2 -2
  86. package/dist/cli/{notes → memos}/select-command.d.ts +1 -1
  87. package/dist/cli/{notes → memos}/select-command.js +4 -4
  88. package/dist/cli/{notes → memos}/suggest-diff.d.ts +1 -1
  89. package/dist/cli/{notes → memos}/suggest-diff.js +2 -2
  90. package/dist/cli/{notes → memos}/transfer-command.d.ts +2 -2
  91. package/dist/cli/{notes → memos}/transfer-command.js +2 -2
  92. package/dist/cli/share.d.ts +1 -1
  93. package/dist/cli/share.js +1 -1
  94. package/dist/cli/skill/index.js +1 -1
  95. package/dist/cli/update/index.js +3 -3
  96. package/dist/cli/version.d.ts +1 -1
  97. package/dist/cli/version.js +1 -1
  98. package/package.json +9 -9
  99. /package/dist/cli/{notes → memos}/editing.d.ts +0 -0
  100. /package/dist/cli/{notes → memos}/editing.js +0 -0
  101. /package/dist/cli/{notes → memos}/html-read.d.ts +0 -0
  102. /package/dist/cli/{notes → memos}/html-read.js +0 -0
  103. /package/dist/cli/{notes → memos}/html.d.ts +0 -0
  104. /package/dist/cli/{notes → memos}/html.js +0 -0
  105. /package/dist/cli/{notes → memos}/media-commands.d.ts +0 -0
  106. /package/dist/cli/{notes → memos}/media-commands.js +0 -0
  107. /package/dist/cli/{notes → memos}/toc.d.ts +0 -0
  108. /package/dist/cli/{notes → memos}/toc.js +0 -0
  109. /package/dist/cli/{notes → memos}/version-commands.d.ts +0 -0
  110. /package/dist/cli/{notes → memos}/version-commands.js +0 -0
@@ -22,9 +22,9 @@
22
22
  */
23
23
  import { AmbiguousMatch, EditError, NoMatch, find, insert, insertPlacement, replacementPlan, removalPlan, applyEditPlan, remove, replace, } from "./editing.js";
24
24
  import { readDocumentSnapshot, documentInsertion, documentEdits, submitDocumentPatch, printPatchReceipt, documentWriteError, commandIdFlag, withCommandId, parseLines } from "./document.js";
25
- import { notesApi } from "../../api/notes.js";
26
- import { lineRange, InvalidLineRange } from "../../api/note-reading.js";
27
- import { noteTransport } from "./api-transport.js";
25
+ import { memosApi } from "../../api/memos.js";
26
+ import { lineRange, InvalidLineRange } from "../../api/memo-reading.js";
27
+ import { memoTransport } from "./api-transport.js";
28
28
  import { markdownToc, htmlToc } from "./toc.js";
29
29
  // The connection plumbing lives in the main notes module; importing it keeps
30
30
  // one definition of "how do I reach the server".
@@ -182,7 +182,7 @@ function reportEdit(err) {
182
182
  return report(err);
183
183
  }
184
184
  // ── Commands ─────────────────────────────────────────────────────────────────
185
- export async function runNotesFind(query, opts) {
185
+ export async function runMemosFind(query, opts) {
186
186
  const ref = requireNote(opts);
187
187
  if (!ref)
188
188
  return 1;
@@ -217,7 +217,7 @@ export async function runNotesFind(query, opts) {
217
217
  return reportEdit(e);
218
218
  }
219
219
  }
220
- export async function runNotesToc(opts) {
220
+ export async function runMemosToc(opts) {
221
221
  const ref = requireNote(opts);
222
222
  if (!ref)
223
223
  return 1;
@@ -306,12 +306,12 @@ async function editText(opts) {
306
306
  }
307
307
  /** A mapped address names the full original span of that element at the snapshot's revision. */
308
308
  async function addressSpan(c, id, source, address) {
309
- const range = await notesApi(noteTransport(c), c.ns).addressRange(id, address, source.revision);
309
+ const range = await memosApi(memoTransport(c), c.ns).addressRange(id, address, source.revision);
310
310
  return [range.start, range.end];
311
311
  }
312
312
  /** `notes replace|delete NOTE_ID --lines a:b …`: with a span selector and no --note, a
313
313
  * 24-hex positional is the note, not a query (Notes API: IDs are primary). */
314
- export function positionalNote(query, opts) {
314
+ export function positionalMemo(query, opts) {
315
315
  const selector = opts.lines !== undefined || opts.line !== undefined || opts.address !== undefined || opts.ind !== undefined;
316
316
  if (query !== undefined && opts.note === undefined && selector && /^[a-f0-9]{24}$/i.test(query))
317
317
  return [undefined, { ...opts, note: query }];
@@ -401,8 +401,8 @@ function modernFlagsCompatible(opts) {
401
401
  }
402
402
  return true;
403
403
  }
404
- export async function runNotesReplace(query, opts) {
405
- [query, opts] = positionalNote(query, opts);
404
+ export async function runMemosReplace(query, opts) {
405
+ [query, opts] = positionalMemo(query, opts);
406
406
  if (!modernFlagsCompatible(opts))
407
407
  return 1;
408
408
  const text = await editText(opts);
@@ -444,8 +444,8 @@ export async function runNotesReplace(query, opts) {
444
444
  : replacementPlan(source.content, opts.text, whereFrom(query, opts)));
445
445
  }
446
446
  /** `notes delete` and its contract alias `notes remove`: delete selected source, never the Note. */
447
- export async function runNotesDelete(query, opts) {
448
- [query, opts] = positionalNote(query, opts);
447
+ export async function runMemosDelete(query, opts) {
448
+ [query, opts] = positionalMemo(query, opts);
449
449
  if (!modernFlagsCompatible(opts))
450
450
  return 1;
451
451
  if (opts.legacy || opts.force || opts.ifMatch !== undefined)
@@ -498,7 +498,7 @@ export function setElementHtml(source, css, html) {
498
498
  return applyEditPlan(source, elementHtmlPlan(source, css, html));
499
499
  }
500
500
  /** `notes insert [NOTE] --before|--after ADDRESS | --cursor N | --line N | --ind N | --selector CSS`; the note may be positional (IDs are primary). */
501
- export async function runNotesInsert(noteOrOpts, maybeOpts) {
501
+ export async function runMemosInsert(noteOrOpts, maybeOpts) {
502
502
  let opts = typeof noteOrOpts === "object" && noteOrOpts !== null ? noteOrOpts : (maybeOpts ?? {});
503
503
  if (typeof noteOrOpts === "string") {
504
504
  if (opts.note !== undefined && opts.note !== noteOrOpts) {
@@ -630,7 +630,7 @@ async function runLegacyNotesDelete(query, opts) {
630
630
  : remove(src, whereFrom(query, opts)));
631
631
  }
632
632
  /** `dreamlake notes select "#contact" --note NOTE` */
633
- export async function runNotesSelect(css, opts) {
633
+ export async function runMemosSelect(css, opts) {
634
634
  const ref = requireNote(opts);
635
635
  if (!ref)
636
636
  return 1;
@@ -663,7 +663,7 @@ export async function runNotesSelect(css, opts) {
663
663
  return reportEdit(e);
664
664
  }
665
665
  }
666
- export async function runNotesGrep(query, opts) {
666
+ export async function runMemosGrep(query, opts) {
667
667
  const c = await ctx(opts);
668
668
  if (!c)
669
669
  return 1;
@@ -1,6 +1,6 @@
1
1
  /** CLI adapter: the parser lives in `src/api/note-events.ts`; this supplies the CLI's request. */
2
2
  import { requestRaw } from '../client.js';
3
- import { type NoteEvent } from '../../api/note-events.js';
4
- export type { Selection, Participant, NoteEvent } from '../../api/note-events.js';
3
+ import { type MemoEvent } from '../../api/memo-events.js';
4
+ export type { Selection, Participant, MemoEvent } from '../../api/memo-events.js';
5
5
  /** Fetch SSE with auth headers, abort/idle bounds, and no automatic replay across gaps. */
6
- export declare function readNoteEvents(url: string, token: string, note: string, signal: AbortSignal, receive: (event: NoteEvent) => void, request?: typeof requestRaw): Promise<void>;
6
+ export declare function readMemoEvents(url: string, token: string, note: string, signal: AbortSignal, receive: (event: MemoEvent) => void, request?: typeof requestRaw): Promise<void>;
@@ -1,7 +1,7 @@
1
1
  /** CLI adapter: the parser lives in `src/api/note-events.ts`; this supplies the CLI's request. */
2
2
  import { requestRaw } from '../client.js';
3
- import { readNoteEvents as readEvents } from '../../api/note-events.js';
3
+ import { readMemoEvents as readEvents } from '../../api/memo-events.js';
4
4
  /** Fetch SSE with auth headers, abort/idle bounds, and no automatic replay across gaps. */
5
- export function readNoteEvents(url, token, note, signal, receive, request = requestRaw) {
5
+ export function readMemoEvents(url, token, note, signal, receive, request = requestRaw) {
6
6
  return readEvents(url, token, note, signal, receive, request);
7
7
  }
@@ -1,6 +1,6 @@
1
- import { type NoteFile } from '../../api/note-files.js';
1
+ import { type MemoFile } from '../../api/memo-files.js';
2
2
  import { type ConnOpts, ctx } from "./index.js";
3
- export type FileRow = NoteFile;
3
+ export type FileRow = MemoFile;
4
4
  /** Exit code for "the file or path was wrong", distinct from a transport failure. */
5
5
  export declare const EXIT_NO_FILE = 6;
6
6
  /** Exit code for a refused overwrite — a script can branch on it and retry. */
@@ -1,5 +1,5 @@
1
- import { noteFilesApi, noteFileOperationId, validateNoteFileKey } from '../../api/note-files.js';
2
- import { noteTransport } from './api-transport.js';
1
+ import { memoFilesApi, memoFileOperationId, validateMemoFileKey } from '../../api/memo-files.js';
2
+ import { memoTransport } from './api-transport.js';
3
3
  /**
4
4
  * `dreamlake notes files …` — list, upload, download, move, copy, trash.
5
5
  *
@@ -89,11 +89,11 @@ function reportFile(err, recovery) {
89
89
  return report(err);
90
90
  }
91
91
  function operationIdOf(value) {
92
- return noteFileOperationId(value);
92
+ return memoFileOperationId(value);
93
93
  }
94
94
  function keyValid(key) {
95
95
  try {
96
- validateNoteFileKey(key);
96
+ validateMemoFileKey(key);
97
97
  return true;
98
98
  }
99
99
  catch (error) {
@@ -490,7 +490,7 @@ export async function runFilesRestore(ref, opts) {
490
490
  */
491
491
  export async function resolveFile(c, noteId, ref, opts = {}) {
492
492
  try {
493
- return await noteFilesApi(noteTransport(c), `/namespaces/${seg(c.ns)}/notes/${seg(noteId)}`).resolve(ref, opts.includeTrashed);
493
+ return await memoFilesApi(memoTransport(c), `/namespaces/${seg(c.ns)}/notes/${seg(noteId)}`).resolve(ref, opts.includeTrashed);
494
494
  }
495
495
  catch (error) {
496
496
  if (error.status !== 404)
@@ -46,23 +46,23 @@ export declare function bodyFrom(opts: {
46
46
  file?: string;
47
47
  text?: string;
48
48
  }, nativeSourceStdin?: boolean): Promise<string | null>;
49
- export declare function registerNotesCommand(program: Command): void;
50
- export declare function runNotesList(opts: ConnOpts & {
49
+ export declare function registerMemosCommand(program: Command): void;
50
+ export declare function runMemosList(opts: ConnOpts & {
51
51
  limit?: string;
52
52
  offset?: string;
53
53
  shared?: boolean;
54
54
  includeArchived?: boolean;
55
55
  json?: boolean;
56
56
  }): Promise<number>;
57
- export declare function runNotesSearch(query: string, opts: ConnOpts & {
57
+ export declare function runMemosSearch(query: string, opts: ConnOpts & {
58
58
  limit?: string;
59
59
  includeArchived?: boolean;
60
60
  json?: boolean;
61
61
  }): Promise<number>;
62
- export declare function runNotesSections(ref: string, opts: ConnOpts & {
62
+ export declare function runMemosSections(ref: string, opts: ConnOpts & {
63
63
  json?: boolean;
64
64
  }): Promise<number>;
65
- export declare function runNotesWrite(ref: string, opts: ConnOpts & {
65
+ export declare function runMemosWrite(ref: string, opts: ConnOpts & {
66
66
  section?: string;
67
67
  file?: string;
68
68
  text?: string;
@@ -75,7 +75,7 @@ export declare function runNotesWrite(ref: string, opts: ConnOpts & {
75
75
  dryRun?: boolean;
76
76
  commandId?: string;
77
77
  }): Promise<number>;
78
- export declare function runNotesAppend(ref: string, opts: ConnOpts & {
78
+ export declare function runMemosAppend(ref: string, opts: ConnOpts & {
79
79
  file?: string;
80
80
  text?: string;
81
81
  force?: boolean;
@@ -86,14 +86,14 @@ export declare function runNotesAppend(ref: string, opts: ConnOpts & {
86
86
  dryRun?: boolean;
87
87
  commandId?: string;
88
88
  }): Promise<number>;
89
- export declare function runNotesCreate(name: string | undefined, opts: ConnOpts & {
89
+ export declare function runMemosCreate(name: string | undefined, opts: ConnOpts & {
90
90
  file?: string;
91
91
  text?: string;
92
92
  public?: boolean;
93
93
  json?: boolean;
94
94
  project?: string[];
95
95
  }): Promise<number>;
96
- export declare function runNotesAddSection(ref: string, opts: ConnOpts & {
96
+ export declare function runMemosAddSection(ref: string, opts: ConnOpts & {
97
97
  before?: string;
98
98
  after?: string;
99
99
  file?: string;
@@ -103,25 +103,25 @@ export declare function runNotesAddSection(ref: string, opts: ConnOpts & {
103
103
  json?: boolean;
104
104
  dryRun?: boolean;
105
105
  }): Promise<number>;
106
- export declare function runNotesRmSection(ref: string, anchor: string, opts: ConnOpts & {
106
+ export declare function runMemosRmSection(ref: string, anchor: string, opts: ConnOpts & {
107
107
  ifMatch?: string;
108
108
  force?: boolean;
109
109
  json?: boolean;
110
110
  dryRun?: boolean;
111
111
  }): Promise<number>;
112
112
  /** Explicit compatibility keeps legacy body-only output and ETag semantics available. */
113
- export declare function runNotesRead(ref: string | undefined, opts: DocumentReadOptions): Promise<number>;
114
- export declare function runNotesDiff(ref: string | undefined, opts: DocumentReadOptions & {
113
+ export declare function runMemosRead(ref: string | undefined, opts: DocumentReadOptions): Promise<number>;
114
+ export declare function runMemosDiff(ref: string | undefined, opts: DocumentReadOptions & {
115
115
  context?: string;
116
116
  }): Promise<number>;
117
- export declare function runNotesPatch(ref: string, opts: DocumentPatchOptions): Promise<number>;
117
+ export declare function runMemosPatch(ref: string, opts: DocumentPatchOptions): Promise<number>;
118
118
  /** Reading the roster never registers presence or maintains a session. */
119
- export declare function runNotesContributors(ref: string, opts: ConnOpts & {
119
+ export declare function runMemosContributors(ref: string, opts: ConnOpts & {
120
120
  json?: boolean;
121
121
  cursor?: string;
122
122
  }): Promise<number>;
123
123
  /** Reading the roster never registers presence or maintains a session. */
124
- export declare function runNotesPresence(ref: string, opts: ConnOpts & {
124
+ export declare function runMemosPresence(ref: string, opts: ConnOpts & {
125
125
  json?: boolean;
126
126
  }): Promise<number>;
127
127
  /** The agent's self-reported purpose, validated before any presence request.
@@ -130,10 +130,10 @@ export declare function presenceIntent(value: string | undefined): {
130
130
  summary: string;
131
131
  } | undefined;
132
132
  /** One-shot participation; linger owns its own maintained lease. */
133
- export declare function runNotesVisit(ref: string, opts: ConnOpts & {
133
+ export declare function runMemosVisit(ref: string, opts: ConnOpts & {
134
134
  json?: boolean;
135
135
  intent?: string;
136
136
  }): Promise<number>;
137
137
  /** Metadata only: no body read, RTC activation, mount, or ownership mutation. */
138
- export declare function runNotesProjects(id: string, opts: ConnOpts): Promise<number>;
138
+ export declare function runMemosProjects(id: string, opts: ConnOpts): Promise<number>;
139
139
  export {};