@dreamlake/dreamlake-cli 0.104.5 → 0.104.6

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 (40) hide show
  1. package/dist/api/note-events.js +7 -7
  2. package/dist/api/note-facade.js +8 -8
  3. package/dist/api/note-linger.js +4 -4
  4. package/dist/api/note-presence.js +1 -1
  5. package/dist/api/note-reading.js +3 -3
  6. package/dist/api/note-write.js +6 -6
  7. package/dist/api/notes.js +3 -3
  8. package/dist/cli/agents/index.js +4 -4
  9. package/dist/cli/failure-report.js +3 -3
  10. package/dist/cli/help-examples.generated.js +37 -37
  11. package/dist/cli/index.js +2 -2
  12. package/dist/cli/notes/api-transport.js +3 -3
  13. package/dist/cli/notes/archive-command.js +8 -8
  14. package/dist/cli/notes/document.js +12 -12
  15. package/dist/cli/notes/edit-commands.js +7 -7
  16. package/dist/cli/notes/files-commands.js +6 -6
  17. package/dist/cli/notes/html-read.js +3 -3
  18. package/dist/cli/notes/index.js +126 -126
  19. package/dist/cli/notes/linger.js +2 -2
  20. package/dist/cli/notes/move-command.js +21 -21
  21. package/dist/cli/notes/rm-command.js +10 -10
  22. package/dist/cli/notes/select-command.js +3 -3
  23. package/dist/cli/notes/suggest-diff.js +2 -2
  24. package/dist/cli/notes/transfer-command.js +1 -1
  25. package/dist/cli/notes/version-commands.js +8 -8
  26. package/dist/cli/ownership/metadata-transfer.js +2 -2
  27. package/dist/cli/project/index.js +4 -4
  28. package/dist/cli/project/move.js +2 -2
  29. package/dist/cli/project/stream.js +1 -1
  30. package/dist/cli/session-affiliation.js +1 -1
  31. package/dist/cli/sessions/affiliation.js +4 -4
  32. package/dist/cli/sessions/api.js +1 -1
  33. package/dist/cli/sessions/control.js +1 -1
  34. package/dist/cli/sessions/index.js +2 -2
  35. package/dist/cli/share.js +3 -3
  36. package/dist/cli/tasks/index.js +4 -4
  37. package/dist/cli/update/index.js +3 -3
  38. package/dist/cli/version.d.ts +1 -1
  39. package/dist/cli/version.js +1 -1
  40. package/package.json +9 -9
@@ -4,25 +4,25 @@ import { httpResponse, HttpError } from "./http.js";
4
4
  async function readEvents(url, token, note, signal, receive, request) {
5
5
  const idle = new AbortController();
6
6
  let timer;
7
- const touch = () => { clearTimeout(timer); timer = setTimeout(() => idle.abort(new Error('Notes event stream timed out')), 45000); };
7
+ const touch = () => { clearTimeout(timer); timer = setTimeout(() => idle.abort(new Error('Memos event stream timed out')), 45000); };
8
8
  touch();
9
9
  let reader;
10
10
  try {
11
11
  const res = await request(url, { token, headers: { Accept: 'text/event-stream' },
12
12
  signal: AbortSignal.any([signal, idle.signal]), followRedirects: false });
13
13
  if (!/^text\/event-stream(?:;|$)/i.test(res.headers.get('content-type') ?? '') || !res.body)
14
- throw new Error('server does not support Notes events; upgrade the server');
14
+ throw new Error('server does not support Memos events; upgrade the server');
15
15
  reader = res.body.getReader();
16
16
  const decoder = new TextDecoder('utf-8', { fatal: true });
17
17
  let buffer = '', data = [], frameSize = 0;
18
18
  while (!signal.aborted) {
19
19
  const { done, value } = await reader.read();
20
20
  if (done)
21
- throw new Error('Notes event stream disconnected; run --linger again for a fresh snapshot');
21
+ throw new Error('Memos event stream disconnected; run --linger again for a fresh snapshot');
22
22
  touch();
23
23
  buffer += decoder.decode(value, { stream: true });
24
24
  if (buffer.length > 4_000_000)
25
- throw new Error('Notes event frame exceeds limit');
25
+ throw new Error('Memos event frame exceeds limit');
26
26
  let newline;
27
27
  while ((newline = buffer.indexOf('\n')) >= 0) {
28
28
  const line = buffer.slice(0, newline).replace(/\r$/, '');
@@ -31,7 +31,7 @@ async function readEvents(url, token, note, signal, receive, request) {
31
31
  const part = line.slice(5).replace(/^ /, '');
32
32
  frameSize += part.length;
33
33
  if (frameSize > 4_000_000)
34
- throw new Error('Notes event frame exceeds limit');
34
+ throw new Error('Memos event frame exceeds limit');
35
35
  data.push(part);
36
36
  }
37
37
  else if (!line && data.length) {
@@ -39,10 +39,10 @@ async function readEvents(url, token, note, signal, receive, request) {
39
39
  data = [];
40
40
  frameSize = 0;
41
41
  if (event.type === 'error')
42
- throw new Error(`Notes event stream ended (${String(event.error)})`);
42
+ throw new Error(`Memos event stream ended (${String(event.error)})`);
43
43
  if (event.type !== 'observation' || event.note !== note || !/^sha256:[a-f0-9]{64}$/.test(event.hash) ||
44
44
  !Array.isArray(event.participants) || typeof event.activityVersion !== 'string')
45
- throw new Error('invalid Notes event response');
45
+ throw new Error('invalid Memos event response');
46
46
  receive(event);
47
47
  }
48
48
  }
@@ -21,7 +21,7 @@ import { focusedRead, lineRange, readNoteView } from "./note-reading.js";
21
21
  import { appendPlan, failureInfo, refuseReadingView, validateCommandId, writePlan } from "./note-write.js";
22
22
  import { notesApi } from "./notes.js";
23
23
  export class NoteReferenceInvalid extends Error {
24
- constructor(ref) { super(`note reference must be a 24-hex id or "namespace/note", got ${JSON.stringify(ref)}`); this.name = "NoteReferenceInvalid"; }
24
+ constructor(ref) { super(`memo reference must be a 24-hex id or "namespace/note", got ${JSON.stringify(ref)}`); this.name = "NoteReferenceInvalid"; }
25
25
  }
26
26
  export class RevisionExpected extends Error {
27
27
  constructor(message) { super(message); this.name = "RevisionExpected"; }
@@ -36,7 +36,7 @@ export class NoteCreatedWithoutSource extends Error {
36
36
  namespace;
37
37
  outcome;
38
38
  constructor(note, namespace, outcome, options) {
39
- super(`note ${note} was created in ${namespace} but its initial source was ${outcome === "definite" ? "not written" : "not confirmed"}; retry by writing or appending to that id, never by creating again`, options);
39
+ super(`memo ${note} was created in ${namespace} but its initial source was ${outcome === "definite" ? "not written" : "not confirmed"}; retry by writing or appending to that id, never by creating again`, options);
40
40
  this.note = note;
41
41
  this.namespace = namespace;
42
42
  this.outcome = outcome;
@@ -50,7 +50,7 @@ export class NoteMoved extends Error {
50
50
  namespace;
51
51
  owner;
52
52
  constructor(note, namespace, owner, options) {
53
- super(`note ${note} is not in the asserted namespace ${namespace}; its owner is ${owner}. Nothing was written: reopen it by id or with {namespace: "${owner}"} and reconcile`, options);
53
+ super(`memo ${note} is not in the asserted namespace ${namespace}; its owner is ${owner}. Nothing was written: reopen it by id or with {namespace: "${owner}"} and reconcile`, options);
54
54
  this.note = note;
55
55
  this.namespace = namespace;
56
56
  this.owner = owner;
@@ -59,7 +59,7 @@ export class NoteMoved extends Error {
59
59
  }
60
60
  /** A documented target this client (or the current server) does not implement; nothing is invented in its place. */
61
61
  export class UnsupportedTarget extends Error {
62
- constructor(what) { super(`${what} is a documented Notes API target without an implementation in this client; nothing was sent`); this.name = "UnsupportedTarget"; }
62
+ constructor(what) { super(`${what} is a documented Memos API target without an implementation in this client; nothing was sent`); this.name = "UnsupportedTarget"; }
63
63
  }
64
64
  const isId = (value) => /^[a-f0-9]{24}$/i.test(value);
65
65
  export function parseNoteRef(ref) {
@@ -83,7 +83,7 @@ export function revisionOf(at) {
83
83
  }
84
84
  function validSnapshot(at, note) {
85
85
  if (at.note !== note)
86
- throw new RevisionExpected(`snapshot belongs to note ${at.note}, not ${note}`);
86
+ throw new RevisionExpected(`snapshot belongs to memo ${at.note}, not ${note}`);
87
87
  if (typeof at.content !== "string" || at.hash !== `sha256:${createHash("sha256").update(at.content, "utf8").digest("hex")}`)
88
88
  throw new RevisionExpected("snapshot content does not match its hash");
89
89
  validRevision(at.revision, "at.revision");
@@ -124,7 +124,7 @@ export function noteHandle(t, ref, context = {}) {
124
124
  const owner = async () => {
125
125
  const row = await t.request("GET", `/notes/${resolved}`, { redirect: "error" });
126
126
  if (!row || row.id !== resolved || typeof row.namespaceSlug !== "string" || !row.namespaceSlug)
127
- throw new Error("note metadata did not name the owning namespace");
127
+ throw new Error("memo metadata did not name the owning namespace");
128
128
  return row.namespaceSlug;
129
129
  };
130
130
  /** The namespace-scoped API; a bare id learns its owner from the note's metadata (one GET, cached). */
@@ -186,7 +186,7 @@ export function noteHandle(t, ref, context = {}) {
186
186
  const page = await readNoteView(t, namespace, noteId, { at: revision, start, section: options.section, tag: options.address });
187
187
  first ??= page;
188
188
  if (page.hash !== first.hash || page.total !== first.total)
189
- throw new Error("Note reading view changed during pagination");
189
+ throw new Error("Memo reading view changed during pagination");
190
190
  revision = page.revision;
191
191
  text += page.text;
192
192
  if (page.complete)
@@ -305,7 +305,7 @@ export function noteHandle(t, ref, context = {}) {
305
305
  || !/^sha256:[a-f0-9]{64}$/.test(result.hash ?? "") || typeof result.revision !== "string" || !result.revision.trim() || /^sha256:/.test(result.revision)
306
306
  || (result.baseRevision !== undefined && (typeof result.baseRevision !== "string" || !result.baseRevision.trim() || /^sha256:/.test(result.baseRevision)))
307
307
  || (result.since !== undefined && typeof result.since !== "string"))
308
- throw new Error("invalid incremental Notes v2 response");
308
+ throw new Error("invalid incremental Memos v2 response");
309
309
  return result;
310
310
  });
311
311
  },
@@ -122,7 +122,7 @@ export async function watchNote(t, path, id, opts, receive, clock = { ...runtime
122
122
  return t.raw('GET', path + '/events', { headers: options?.headers, signal: options?.signal, timeoutMs: null, redirect: 'error' });
123
123
  }).then(() => {
124
124
  if (!abort.signal.aborted)
125
- streamError = new Error('Notes event stream disconnected');
125
+ streamError = new Error('Memos event stream disconnected');
126
126
  wake.abort();
127
127
  }, error => { streamError = error; wake.abort(); });
128
128
  while (!latest && !streamError && !abort.signal.aborted)
@@ -139,15 +139,15 @@ export async function watchNote(t, path, id, opts, receive, clock = { ...runtime
139
139
  }
140
140
  const body = await request('/body?' + query, { headers: !previous && opts.ifMatch ? { 'If-Match': opts.ifMatch } : {} });
141
141
  if (body.note !== id || !/^sha256:[a-f0-9]{64}$/.test(body.hash ?? '') || typeof body.revision !== 'string' || !body.revision || /[\r\n]/.test(body.revision))
142
- throw new Error('invalid Notes v2 snapshot');
142
+ throw new Error('invalid Memos v2 snapshot');
143
143
  if (!previous) {
144
144
  if (typeof body.content !== 'string' || 'sha256:' + createHash('sha256').update(body.content).digest('hex') !== body.hash)
145
145
  throw new Error('source does not match the returned hash');
146
146
  if (opts.ifMatch && body.revision !== opts.ifMatch)
147
- throw new Error('note changed since the acknowledged revision');
147
+ throw new Error('memo changed since the acknowledged revision');
148
148
  }
149
149
  else if (body.base !== previous.hash || body.format !== format || typeof body.patch !== 'string') {
150
- throw new Error('invalid incremental Notes v2 response');
150
+ throw new Error('invalid incremental Memos v2 response');
151
151
  }
152
152
  return body;
153
153
  };
@@ -48,7 +48,7 @@ export function notePresenceApi(t, base) {
48
48
  const offset = options.section !== undefined ? snapshot.range?.start : 0;
49
49
  if (typeof source !== 'string' || !/^sha256:[a-f0-9]{64}$/.test(snapshot.hash ?? '') || !Number.isSafeInteger(offset) || offset < 0 ||
50
50
  (options.section !== undefined && snapshot.range?.end !== offset + Array.from(source).length))
51
- throw new Error('server did not provide canonical source/hash and code-point range; section selection requires the updated Notes server');
51
+ throw new Error('server did not provide canonical source/hash and code-point range; section selection requires the updated Memos server');
52
52
  if (options.hash !== undefined && options.hash !== snapshot.hash)
53
53
  throw new ApiError(409, 'stale_range', { note: id });
54
54
  const matches = find(source, options.text), requested = options.occurrence ?? 1;
@@ -2,7 +2,7 @@ import { isObjectId, seg } from './client.js';
2
2
  /** Same addressed, revision-pinned reading contract as the built-in agent. */
3
3
  export async function readNoteView(t, namespace, note, options = {}) {
4
4
  if (!isObjectId(note))
5
- throw new Error('expected a 24-hex note id');
5
+ throw new Error('expected a 24-hex memo id');
6
6
  if ((options.start ?? 0) > 0 && !options.at)
7
7
  throw new Error('reading continuation requires the original revision');
8
8
  const page = await t.request('GET', `/namespaces/${seg(namespace)}/notes/${note}/body`, { query: { contract: 'v2', view: 'reading', ...options } });
@@ -10,7 +10,7 @@ export async function readNoteView(t, namespace, note, options = {}) {
10
10
  !/^sha256:[a-f0-9]{64}$/.test(page.hash) || typeof page.text !== 'string' || !['markdown', 'html'].includes(page.sourceType) || typeof page.scope !== 'string' ||
11
11
  ![page.start, page.end, page.total].every(n => Number.isSafeInteger(n) && n >= 0) || page.start !== (options.start ?? 0) || page.end < page.start || page.end > page.total ||
12
12
  Array.from(page.text).length !== page.end - page.start || page.complete !== (page.end === page.total) || page.next !== (page.complete ? null : page.end) || !page.complete && page.end === page.start)
13
- throw new Error('invalid Note reading page');
13
+ throw new Error('invalid Memo reading page');
14
14
  return page;
15
15
  }
16
16
  export class InvalidLineRange extends Error {
@@ -32,7 +32,7 @@ export function lineRange(content, lines) {
32
32
  const total = points.length === 0 ? 0 : starts.length;
33
33
  // Refused, not clamped: a range past the end is a misread length, not a request for "to the end".
34
34
  if (last > total)
35
- throw new InvalidLineRange(`line ${last} is past the end of a ${total}-line note`);
35
+ throw new InvalidLineRange(`line ${last} is past the end of a ${total}-line memo`);
36
36
  const start = starts[first - 1], end = last < total ? starts[last] : points.length;
37
37
  return { lines: [first, last], chars: [start, end], content: points.slice(start, end).join(''), ...(last < total ? { next: last + 1 } : {}) };
38
38
  }
@@ -41,13 +41,13 @@ export class UncertainOutcome extends Error {
41
41
  status;
42
42
  constructor(commandId, reason, options = {}) {
43
43
  const cause = options.cause instanceof Error ? options.cause.message : undefined;
44
- super((reason === "receipt" ? "Notes write outcome unknown: invalid receipt"
45
- : reason === "server" ? `Notes write outcome unknown: the server recorded command ${commandId} but could not settle it`
44
+ super((reason === "receipt" ? "Memos write outcome unknown: invalid receipt"
45
+ : reason === "server" ? `Memos write outcome unknown: the server recorded command ${commandId} but could not settle it`
46
46
  : options.status === 503 ? "the realtime acknowledgment is unavailable; the result may be ambiguous"
47
- : "Notes write outcome unknown") +
47
+ : "Memos write outcome unknown") +
48
48
  (reason === "server"
49
49
  ? "; keep the original baseline and draft and query the command status before resubmitting; never resend it under a new id"
50
- : "; keep the original baseline and draft, inspect the note before resubmitting" +
50
+ : "; keep the original baseline and draft, inspect the memo before resubmitting" +
51
51
  (commandId ? `, or retry with the same commandId ${commandId} / query its command status` : "")) +
52
52
  (options.status === 503 && cause ? ` (${cause})` : ""), options.cause === undefined ? undefined : { cause: options.cause });
53
53
  this.commandId = commandId;
@@ -76,7 +76,7 @@ export class CommandInProgress extends Error {
76
76
  export class CommandIntentMismatch extends Error {
77
77
  commandId;
78
78
  constructor(commandId, options) {
79
- super(`commandId ${commandId} was already used for a different edit (note, baseline revision, mode, format or patch differ); a new command needs a new id`, options);
79
+ super(`commandId ${commandId} was already used for a different edit (memo, baseline revision, mode, format or patch differ); a new command needs a new id`, options);
80
80
  this.commandId = commandId;
81
81
  this.name = "CommandIntentMismatch";
82
82
  }
@@ -195,7 +195,7 @@ export async function readNoteCommand(t, commandPath, commandId) {
195
195
  || !["pending", "accepted", "no-write", "unknown"].includes(status.state ?? "")
196
196
  || (status.outcome !== undefined && status.outcome !== "accepted" && status.outcome !== "no-write")
197
197
  || typeof status.createdAt !== "string" || typeof status.updatedAt !== "string")
198
- throw new Error("invalid Note command status");
198
+ throw new Error("invalid Memo command status");
199
199
  return status;
200
200
  }
201
201
  /** Append is verbatim (Notes API contract): the given text, every intended
package/dist/api/notes.js CHANGED
@@ -18,7 +18,7 @@ export function notesApi(t, namespace) {
18
18
  const base = `/namespaces/${seg(namespace)}/notes`;
19
19
  const id = (value) => {
20
20
  if (!isObjectId(value))
21
- throw new Error("expected a 24-hex note id");
21
+ throw new Error("expected a 24-hex memo id");
22
22
  return value;
23
23
  };
24
24
  const source = async (noteId, at) => {
@@ -30,7 +30,7 @@ export function notesApi(t, namespace) {
30
30
  !value.revision.trim() ||
31
31
  /[\r\n]/.test(value.revision) ||
32
32
  /^sha256:/i.test(value.revision))
33
- throw new Error("server did not return the Notes v2 contract; upgrade the server");
33
+ throw new Error("server did not return the Memos v2 contract; upgrade the server");
34
34
  if (at !== undefined && value.revision !== at)
35
35
  throw new Error("server did not return the requested pinned revision");
36
36
  if (typeof value.content !== "string" ||
@@ -157,7 +157,7 @@ export function notesApi(t, namespace) {
157
157
  },
158
158
  });
159
159
  if (!/^text\/(?:html|plain)(?:;|$)/i.test(response.headers.get("content-type") ?? ""))
160
- throw new Error("server did not return Notes HTML; upgrade the server");
160
+ throw new Error("server did not return Memos HTML; upgrade the server");
161
161
  const bytes = new Uint8Array(await response.arrayBuffer()), html = new TextDecoder("utf-8", {
162
162
  fatal: true,
163
163
  ignoreBOM: true,
@@ -418,7 +418,7 @@ async function createAgent(positional, opts) {
418
418
  }
419
419
  async function createBuiltinAgent(positional, opts) {
420
420
  if (opts.runtime === "claude")
421
- throw new SpecError("Note-backed agents require --runtime builtin-v1");
421
+ throw new SpecError("Memo-backed agents require --runtime builtin-v1");
422
422
  if (opts.edit || opts.model || opts.permissionMode || opts.runConfig || opts.queue ||
423
423
  opts.channel || opts.allow?.length || opts.ask?.length || opts.deny?.length ||
424
424
  opts.grant?.length || opts.addDir?.length)
@@ -440,7 +440,7 @@ async function createBuiltinAgent(positional, opts) {
440
440
  throw new SpecError("Skills require --instruction-note.");
441
441
  if (skills.length > 20 || [opts.instructionNote, ...skills.map(s => s.id)]
442
442
  .filter(Boolean).some(id => !/^[a-f0-9]{24}$/i.test(id)))
443
- throw new SpecError("Note/folder IDs must be 24 hexadecimal characters; at most 20 skills.");
443
+ throw new SpecError("Memo/folder IDs must be 24 hexadecimal characters; at most 20 skills.");
444
444
  if (new Set(skills.map(skill => `${skill.kind}:${skill.id}`)).size !== skills.length)
445
445
  throw new SpecError("Skill references must be unique.");
446
446
  const tools = opts.tools !== undefined
@@ -540,8 +540,8 @@ export function registerAgentsCommand(program) {
540
540
  .option("--edit", "open $EDITOR on a scaffold and declare what you save")
541
541
  .option("--prompt <text>", "the prompt inline, for one-liners")
542
542
  .option("--runtime <runtime>", "builtin-v1 for the DreamLake assistant, or claude (default)")
543
- .option("--instruction-note <id>", "main instruction Note; selects builtin-v1 unless --runtime is given")
544
- .option("--skill-note <id>", "optional skill Note (repeatable, requires --instruction-note)", collect, [])
543
+ .option("--instruction-note <id>", "main instruction Memo; selects builtin-v1 unless --runtime is given")
544
+ .option("--skill-note <id>", "optional skill Memo (repeatable, requires --instruction-note)", collect, [])
545
545
  .option("--skill-folder <id>", "optional skill folder (repeatable, requires --instruction-note)", collect, [])
546
546
  // ── Claude's fields ──
547
547
  .option("--name <kebab>", "the agent's name, if it is not in the file or the argument")
@@ -2,10 +2,10 @@ import { recordOperationFailure } from './telemetry.js';
2
2
  import { HttpError } from '../api/http.js';
3
3
  import { emitJson, fail } from './helpers.js';
4
4
  const guidance = {
5
- NOTE_TRANSFER_UNAVAILABLE: 'This move crosses workspaces. Preview the separate notes transfer workflow; ordinary notes move only files within the current workspace.',
5
+ NOTE_TRANSFER_UNAVAILABLE: 'This move crosses workspaces. Preview the separate memos transfer workflow; ordinary memos move only files within the current workspace.',
6
6
  NOTE_METADATA_PRINCIPAL_UNSUPPORTED: 'An existing project filing has a team, service-account, or unsupported access grant that this transfer cannot preserve. Inspect the source project grants and service-account grants. Do not remove access just to force the transfer.',
7
- NOTE_METADATA_TRANSFER_DISABLED: 'The server has disabled Note ownership transfers. Updating the CLI alone cannot enable them.',
8
- NOTE_METADATA_PRIVATE_REQUIRED: 'This transfer currently supports private Notes only. Review the existing audience before changing visibility.',
7
+ NOTE_METADATA_TRANSFER_DISABLED: 'The server has disabled Memo ownership transfers. Updating the CLI alone cannot enable them.',
8
+ NOTE_METADATA_PRIVATE_REQUIRED: 'This transfer currently supports private Memos only. Review the existing audience before changing visibility.',
9
9
  };
10
10
  /** Report a failure without losing its machine-readable identity or claiming an
11
11
  * uncertain write did not happen. Never include the raw response or arguments. */
@@ -79,46 +79,46 @@ export const helpExamples = {
79
79
  "layout apply": "dreamlake layout apply request.json --cdp http://127.0.0.1:9222 --page PAGE_ID --layout LAYOUT_ID",
80
80
  "machine": "dreamlake machine self\ndreamlake machine host 0123456789abcdef01234567\ndreamlake machine project 0123456789abcdef01234567",
81
81
  "auth identity": "dreamlake auth identity\ndreamlake --identity machine profile\ndreamlake --identity user profile",
82
- "notes archive": "dreamlake notes archive NOTE_ID --json\n# With a slug or exact title, select its owning namespace.\ndreamlake notes archive release-plan --namespace acme",
83
- "notes unarchive": "dreamlake notes unarchive NOTE_ID --json\n# Archived titles and slugs remain resolvable.\ndreamlake notes unarchive release-plan --namespace acme",
82
+ "memos archive": "dreamlake memos archive NOTE_ID --json\n# With a slug or exact title, select its owning namespace.\ndreamlake memos archive release-plan --namespace acme",
83
+ "memos unarchive": "dreamlake memos unarchive NOTE_ID --json\n# Archived titles and slugs remain resolvable.\ndreamlake memos unarchive release-plan --namespace acme",
84
84
  "folders list": "# List immediate contents at a project root or inside a folder.\ndreamlake folders list --project project-slug --namespace acme --include-archived --json\ndreamlake folders list --parent-id FOLDER_ID --include-archived --page 1 --page-size 50",
85
85
  "folders archive": "dreamlake folders archive FOLDER_ID --json",
86
86
  "folders unarchive": "dreamlake folders unarchive FOLDER_ID --json",
87
- "notes files list": "dreamlake notes files list --note release-plan\ndreamlake notes files list 'assets/*.png' --note release-plan --limit 50\ndreamlake notes files list --note release-plan --json",
88
- "notes media upload": "dreamlake notes media upload ./diagram.png\nIMAGE_URL=$(dreamlake notes media upload ./diagram.png)",
89
- "notes files write": "dreamlake notes files write config.json --text '{\"enabled\":true}' --note \"$NOTE_ID\" --idempotency-key config-initial-1",
90
- "notes files cp": "dreamlake notes files cp config.json config-copy.json --note \"$NOTE_ID\" --idempotency-key config-copy-1",
91
- "notes files status": "# OPERATION_ID is the ID from the original response.\ndreamlake notes files status \"$OPERATION_ID\" --note \"$NOTE_ID\" --json",
92
- "notes files reconcile": "dreamlake notes files reconcile \"$OPERATION_ID\" --note \"$NOTE_ID\" --json",
93
- "notes files cancel": "dreamlake notes files cancel \"$OPERATION_ID\" --note \"$NOTE_ID\" --json",
94
- "notes visit": "# Reuse the task's DREAMLAKE_AGENT_ID and DREAMLAKE_AGENT_NAME.\nNOTE_ID=release-plan\ndreamlake notes visit \"$NOTE_ID\"",
95
- "notes presence": "# Read the participant roster without joining. Text is the default.\nNOTE_ID=release-plan\ndreamlake notes presence \"$NOTE_ID\"",
96
- "notes select": "export DREAMLAKE_AGENT_ID=\"review-session-42\"\nexport DREAMLAKE_AGENT_NAME=\"Codex\"\nNOTE_ID=\"your-note-id\"\ndreamlake notes select --text \"The next step is tested in simulation.\" --note \"$NOTE_ID\"\n# Select the last occurrence of a repeated passage.\ndreamlake notes select --text \"simulation\" --note \"$NOTE_ID\" -o -1",
97
- "notes contributors": "dreamlake notes contributors release-plan --namespace geyang --json\n# If hasMore is true, continue with the returned nextCursor:\ndreamlake notes contributors release-plan --namespace geyang --cursor LINK_CURSOR --json",
98
- "notes rm": "# Read it first and confirm it is the note you mean.\ndreamlake notes read NOTE_ID\n# Asks for confirmation, showing the title and owning namespace.\ndreamlake notes rm NOTE_ID\n# Scripts and agents: skip the prompt and take a JSON receipt.\ndreamlake notes rm NOTE_ID --yes --json\n# Afterwards a read reports not found.\ndreamlake notes read NOTE_ID",
99
- "notes patch": "set -euo pipefail\ndreamlake notes create \"Patch tutorial\" --text 'Hello world.' > created.txt\nNOTE_ID=$(sed -n 's/^ id //p' created.txt)\ndreamlake notes read \"$NOTE_ID\" --view source --json > baseline.json\n# A plain text read is the mapped reading view and --view source is bytes only;\n# --json is the structured snapshot with note, hash and revision.\nBASE=$(jq -er .revision baseline.json)\ndreamlake notes patch \"$NOTE_ID\" --file - --base-revision \"$BASE\" --json > receipt.json <<'PATCH'\n@@ chars 0:12 @@\n~ Hello [-world-]{+team+}.\nPATCH\nACK=$(jq -er .revision receipt.json)\ndreamlake notes read \"$NOTE_ID\" --if-match \"$ACK\"\n# Expect Hello team. Inspect the result; do not repeat a successful patch.",
100
- "notes append": "dreamlake notes append \"$NOTE_ID\" --file addition.md --base-revision \"$BASE\" --json\n# ACK is the revision in the successful append receipt.\ndreamlake notes read \"$NOTE_ID\" --at \"$ACK\"",
101
- "notes insert": "dreamlake notes insert --note \"$NOTE_ID\" --ind 0 --text 'Review: ' \\\n --base-revision \"$BASE\" --json\n# ACK is the revision returned by the insertion receipt.\ndreamlake notes read \"$NOTE_ID\" --at \"$ACK\"",
102
- "notes delete": "dreamlake notes delete 'obsolete paragraph' --note \"$NOTE_ID\" \\\n --base-revision \"$BASE\" --json\n# Pin verification to the receipt's acknowledged revision.\ndreamlake notes read \"$NOTE_ID\" --at \"$ACK\"",
103
- "notes write": "dreamlake notes read \"$NOTE_ID\" --json > baseline.json\nBASE=$(jq -er .revision baseline.json)\njq -jr .content baseline.json > draft.md\n# Edit draft.md without changing the saved original baseline.\ndreamlake notes write \"$NOTE_ID\" --file draft.md --base-revision \"$BASE\" --json\n# ACK is the successful write receipt's revision.\ndreamlake notes read \"$NOTE_ID\" --at \"$ACK\"",
104
- "notes": "# Find a note and read it directly.\ndreamlake notes search \"release plan\"\ndreamlake notes read release-plan\n\n# Preview a unique wording change, apply it, then read back.\ndreamlake notes replace \"Draft checklist\" --text \"Ready for review\" --note release-plan --dry-run\ndreamlake notes replace \"Draft checklist\" --text \"Ready for review\" --note release-plan\ndreamlake notes read release-plan\n\n# Create a private note from a Markdown file.\ndreamlake notes create \"Release plan\" --file release-plan.md\n\n# Cross-interface design (unreleased target APIs; verify installed --help):\n# https://docs.dreamlake.ai/notes/api/",
105
- "notes list": "dreamlake notes list --limit 10\ndreamlake notes list --shared\ndreamlake notes list --namespace acme\ndreamlake notes list --include-archived",
106
- "notes search": "dreamlake notes search \"release plan\"\ndreamlake notes search deploy --namespace acme --json\ndreamlake notes search deploy --include-archived",
107
- "notes create": "dreamlake notes create \"Release plan\" --text \"Draft checklist\"\nprintf '# Release plan\\n' | dreamlake notes create \"Release plan\" --file - --json",
108
- "notes read": "dreamlake notes read release-plan\n# Inspect source with generated address hints; do not write the hints back.\ndreamlake notes read release-plan --view markdown\n# Preserve exact source plus revision/hash for a programmatic edit baseline.\ndreamlake notes read release-plan --json > baseline.json\ndreamlake notes read release-plan --since \"10 minutes ago\" --format diff\n# Detailed read design (unreleased target syntax):\n# https://docs.dreamlake.ai/notes/api/reading/\n# Reuse a stable agent identity for this task.\nexport DREAMLAKE_AGENT_ID=release-reviewer-a\nexport DREAMLAKE_AGENT_NAME=\"Release reviewer A\"\ndreamlake notes read release-plan --linger\n# Ctrl-C stops following.\n\nExample notifications:\n+ @alice joined\n+ Reviewer (agent) joined\n* Reviewer (agent) read the note\n* Reviewer (agent) edited the note\n* @alice selected \"## The center\"\n- @alice left",
109
- "notes projects": "dreamlake notes projects 000000000000000000000001 --namespace acme",
110
- "notes move": "# Standalone cross-namespace Note transfer is unavailable (exit 3).\ndreamlake notes move NOTE_ID --to-namespace my-org --project shared-research --dry-run\n# Add a project association within the note's CURRENT workspace.\ndreamlake notes move NOTE_ID --to-namespace current-workspace --project research --dry-run\n# Apply only an executable same-workspace preview.\ndreamlake notes move NOTE_ID --to-namespace current-workspace --project research\n# Relocate the note to an existing folder of one project (CLI 0.87.0+).\ndreamlake notes move NOTE_ID --namespace acme --project research --folder reports/2026 --dry-run",
111
- "notes diff": "NOTE_ID=release-plan\ndreamlake notes read \"$NOTE_ID\" --json > baseline.json\nHASH=$(jq -er .hash baseline.json)\ndreamlake notes diff \"$NOTE_ID\" --since \"$HASH\" --format diff",
112
- "notes sections": "dreamlake notes sections release-plan\ndreamlake notes sections release-plan --json",
113
- "notes share": "# Find the release plan and inspect its source and current sharing.\ndreamlake notes search \"release plan\"\nNOTE=\"release-plan\" # Replace with the id or slug from search.\ndreamlake notes read \"$NOTE\"\ndreamlake notes share get \"$NOTE\"\n\n# Give signed-in recipients read access, then verify the returned link.\ndreamlake notes share create \"$NOTE\" --role read\ndreamlake notes share get \"$NOTE\"\n\n# When link access is no longer needed, revoke it and verify.\ndreamlake notes share revoke \"$NOTE\"\ndreamlake notes share get \"$NOTE\"",
114
- "notes visibility": "NOTE=\"release-plan\" # Your existing note id or slug.\ndreamlake notes visibility \"$NOTE\" public\ndreamlake notes visibility \"$NOTE\" private",
115
- "notes share revoke": "NOTE=\"release-plan\" # Your existing note id or slug.\ndreamlake notes share revoke \"$NOTE\" --revoke-accepted",
116
- "notes share access": "NOTE=\"release-plan\" # Your existing note id or slug.\n# List acceptance records and stored roles as a readable table.\ndreamlake notes share access \"$NOTE\"",
117
- "notes share remove": "NOTE=\"release-plan\" # Your existing note id or slug.\nUSER_ID=\"user-id-from-access-list\"\ndreamlake notes share remove \"$NOTE\" \"$USER_ID\"",
118
- "notes suggest-diff": "# Review a change as a new private note.\ndreamlake notes suggest-diff before.md after.md --user \"Docs review\" \\\n | dreamlake notes create \"Redline: release plan\" --file -\n# Propose edits inside the note itself; refuses changes it cannot express.\ndreamlake notes suggest-diff current.md edited.md --in-place --user \"$DREAMLAKE_AGENT_NAME\" > proposal.md\n# Count insertions, deletions, replacements and changed code blocks.\ndreamlake notes suggest-diff before.md after.md --json | jq .stats",
119
- "notes transfer": "dreamlake notes transfer NOTE_ID --namespace alice --to acme \\\n --dry-run --out note-transfer.json\n# Submit the exact reviewed file; the authorized destination member accepts separately.\ndreamlake notes transfer NOTE_ID --namespace alice --to acme \\\n --confirm --request-file note-transfer.json\n# If you also have destination acceptance authority:\ndreamlake notes transfer NOTE_ID --namespace alice --to acme \\\n --confirm --request-file note-transfer.json --accept-if-authorized --wait",
120
- "notes tag": "# Save the current content on the existing Note.\ndreamlake note tag NOTE_ID end-of-day --namespace my-org --summary \"Reviewed today's actions\"\n# Require the hash retained from a reviewed full read (not its opaque revision).\ndreamlake note tag NOTE_ID reviewed --hash sha256:CONTENT_HASH --json\n# Connect this checkpoint to an earlier version in the same Note.\ndreamlake note tag NOTE_ID next-checkpoint --parent VERSION_ID\n# Read and validate without creating a version.\ndreamlake note tag NOTE_ID preview --dry-run --json",
121
- "notes hist": "dreamlake note hist NOTE_ID --namespace my-org --json\n# Continue with nextCursor returned by the previous page.\ndreamlake note hist NOTE_ID --before VERSION_ID --json",
87
+ "memos files list": "dreamlake memos files list --note release-plan\ndreamlake memos files list 'assets/*.png' --note release-plan --limit 50\ndreamlake memos files list --note release-plan --json",
88
+ "memos media upload": "dreamlake memos media upload ./diagram.png\nIMAGE_URL=$(dreamlake memos media upload ./diagram.png)",
89
+ "memos files write": "dreamlake memos files write config.json --text '{\"enabled\":true}' --note \"$NOTE_ID\" --idempotency-key config-initial-1",
90
+ "memos files cp": "dreamlake memos files cp config.json config-copy.json --note \"$NOTE_ID\" --idempotency-key config-copy-1",
91
+ "memos files status": "# OPERATION_ID is the ID from the original response.\ndreamlake memos files status \"$OPERATION_ID\" --note \"$NOTE_ID\" --json",
92
+ "memos files reconcile": "dreamlake memos files reconcile \"$OPERATION_ID\" --note \"$NOTE_ID\" --json",
93
+ "memos files cancel": "dreamlake memos files cancel \"$OPERATION_ID\" --note \"$NOTE_ID\" --json",
94
+ "memos visit": "# Reuse the task's DREAMLAKE_AGENT_ID and DREAMLAKE_AGENT_NAME.\nNOTE_ID=release-plan\ndreamlake memos visit \"$NOTE_ID\"",
95
+ "memos presence": "# Read the participant roster without joining. Text is the default.\nNOTE_ID=release-plan\ndreamlake memos presence \"$NOTE_ID\"",
96
+ "memos select": "export DREAMLAKE_AGENT_ID=\"review-session-42\"\nexport DREAMLAKE_AGENT_NAME=\"Codex\"\nNOTE_ID=\"your-note-id\"\ndreamlake memos select --text \"The next step is tested in simulation.\" --note \"$NOTE_ID\"\n# Select the last occurrence of a repeated passage.\ndreamlake memos select --text \"simulation\" --note \"$NOTE_ID\" -o -1",
97
+ "memos contributors": "dreamlake memos contributors release-plan --namespace geyang --json\n# If hasMore is true, continue with the returned nextCursor:\ndreamlake memos contributors release-plan --namespace geyang --cursor LINK_CURSOR --json",
98
+ "memos rm": "# Read it first and confirm it is the note you mean.\ndreamlake memos read NOTE_ID\n# Asks for confirmation, showing the title and owning namespace.\ndreamlake memos rm NOTE_ID\n# Scripts and agents: skip the prompt and take a JSON receipt.\ndreamlake memos rm NOTE_ID --yes --json\n# Afterwards a read reports not found.\ndreamlake memos read NOTE_ID",
99
+ "memos patch": "set -euo pipefail\ndreamlake memos create \"Patch tutorial\" --text 'Hello world.' > created.txt\nNOTE_ID=$(sed -n 's/^ id //p' created.txt)\ndreamlake memos read \"$NOTE_ID\" --view source --json > baseline.json\n# A plain text read is the mapped reading view and --view source is bytes only;\n# --json is the structured snapshot with note, hash and revision.\nBASE=$(jq -er .revision baseline.json)\ndreamlake memos patch \"$NOTE_ID\" --file - --base-revision \"$BASE\" --json > receipt.json <<'PATCH'\n@@ chars 0:12 @@\n~ Hello [-world-]{+team+}.\nPATCH\nACK=$(jq -er .revision receipt.json)\ndreamlake memos read \"$NOTE_ID\" --if-match \"$ACK\"\n# Expect Hello team. Inspect the result; do not repeat a successful patch.",
100
+ "memos append": "dreamlake memos append \"$NOTE_ID\" --file addition.md --base-revision \"$BASE\" --json\n# ACK is the revision in the successful append receipt.\ndreamlake memos read \"$NOTE_ID\" --at \"$ACK\"",
101
+ "memos insert": "dreamlake memos insert --note \"$NOTE_ID\" --ind 0 --text 'Review: ' \\\n --base-revision \"$BASE\" --json\n# ACK is the revision returned by the insertion receipt.\ndreamlake memos read \"$NOTE_ID\" --at \"$ACK\"",
102
+ "memos delete": "dreamlake memos delete 'obsolete paragraph' --note \"$NOTE_ID\" \\\n --base-revision \"$BASE\" --json\n# Pin verification to the receipt's acknowledged revision.\ndreamlake memos read \"$NOTE_ID\" --at \"$ACK\"",
103
+ "memos write": "dreamlake memos read \"$NOTE_ID\" --json > baseline.json\nBASE=$(jq -er .revision baseline.json)\njq -jr .content baseline.json > draft.md\n# Edit draft.md without changing the saved original baseline.\ndreamlake memos write \"$NOTE_ID\" --file draft.md --base-revision \"$BASE\" --json\n# ACK is the successful write receipt's revision.\ndreamlake memos read \"$NOTE_ID\" --at \"$ACK\"",
104
+ "memos": "# Find a note and read it directly.\ndreamlake memos search \"release plan\"\ndreamlake memos read release-plan\n\n# Preview a unique wording change, apply it, then read back.\ndreamlake memos replace \"Draft checklist\" --text \"Ready for review\" --note release-plan --dry-run\ndreamlake memos replace \"Draft checklist\" --text \"Ready for review\" --note release-plan\ndreamlake memos read release-plan\n\n# Create a private note from a Markdown file.\ndreamlake memos create \"Release plan\" --file release-plan.md\n\n# Cross-interface design (unreleased target APIs; verify installed --help):\n# https://docs.dreamlake.ai/notes/api/",
105
+ "memos list": "dreamlake memos list --limit 10\ndreamlake memos list --shared\ndreamlake memos list --namespace acme\ndreamlake memos list --include-archived",
106
+ "memos search": "dreamlake memos search \"release plan\"\ndreamlake memos search deploy --namespace acme --json\ndreamlake memos search deploy --include-archived",
107
+ "memos create": "dreamlake memos create \"Release plan\" --text \"Draft checklist\"\nprintf '# Release plan\\n' | dreamlake memos create \"Release plan\" --file - --json",
108
+ "memos read": "dreamlake memos read release-plan\n# Inspect source with generated address hints; do not write the hints back.\ndreamlake memos read release-plan --view markdown\n# Preserve exact source plus revision/hash for a programmatic edit baseline.\ndreamlake memos read release-plan --json > baseline.json\ndreamlake memos read release-plan --since \"10 minutes ago\" --format diff\n# Detailed read design (unreleased target syntax):\n# https://docs.dreamlake.ai/notes/api/reading/\n# Reuse a stable agent identity for this task.\nexport DREAMLAKE_AGENT_ID=release-reviewer-a\nexport DREAMLAKE_AGENT_NAME=\"Release reviewer A\"\ndreamlake memos read release-plan --linger\n# Ctrl-C stops following.\n\nExample notifications:\n+ @alice joined\n+ Reviewer (agent) joined\n* Reviewer (agent) read the note\n* Reviewer (agent) edited the note\n* @alice selected \"## The center\"\n- @alice left",
109
+ "memos projects": "dreamlake memos projects 000000000000000000000001 --namespace acme",
110
+ "memos move": "# Standalone cross-namespace Note transfer is unavailable (exit 3).\ndreamlake memos move NOTE_ID --to-namespace my-org --project shared-research --dry-run\n# Add a project association within the note's CURRENT workspace.\ndreamlake memos move NOTE_ID --to-namespace current-workspace --project research --dry-run\n# Apply only an executable same-workspace preview.\ndreamlake memos move NOTE_ID --to-namespace current-workspace --project research\n# Relocate the note to an existing folder of one project (CLI 0.87.0+).\ndreamlake memos move NOTE_ID --namespace acme --project research --folder reports/2026 --dry-run",
111
+ "memos diff": "NOTE_ID=release-plan\ndreamlake memos read \"$NOTE_ID\" --json > baseline.json\nHASH=$(jq -er .hash baseline.json)\ndreamlake memos diff \"$NOTE_ID\" --since \"$HASH\" --format diff",
112
+ "memos sections": "dreamlake memos sections release-plan\ndreamlake memos sections release-plan --json",
113
+ "memos share": "# Find the release plan and inspect its source and current sharing.\ndreamlake memos search \"release plan\"\nNOTE=\"release-plan\" # Replace with the id or slug from search.\ndreamlake memos read \"$NOTE\"\ndreamlake memos share get \"$NOTE\"\n\n# Give signed-in recipients read access, then verify the returned link.\ndreamlake memos share create \"$NOTE\" --role read\ndreamlake memos share get \"$NOTE\"\n\n# When link access is no longer needed, revoke it and verify.\ndreamlake memos share revoke \"$NOTE\"\ndreamlake memos share get \"$NOTE\"",
114
+ "memos visibility": "NOTE=\"release-plan\" # Your existing note id or slug.\ndreamlake memos visibility \"$NOTE\" public\ndreamlake memos visibility \"$NOTE\" private",
115
+ "memos share revoke": "NOTE=\"release-plan\" # Your existing note id or slug.\ndreamlake memos share revoke \"$NOTE\" --revoke-accepted",
116
+ "memos share access": "NOTE=\"release-plan\" # Your existing note id or slug.\n# List acceptance records and stored roles as a readable table.\ndreamlake memos share access \"$NOTE\"",
117
+ "memos share remove": "NOTE=\"release-plan\" # Your existing note id or slug.\nUSER_ID=\"user-id-from-access-list\"\ndreamlake memos share remove \"$NOTE\" \"$USER_ID\"",
118
+ "memos suggest-diff": "# Review a change as a new private note.\ndreamlake memos suggest-diff before.md after.md --user \"Docs review\" \\\n | dreamlake memos create \"Redline: release plan\" --file -\n# Propose edits inside the note itself; refuses changes it cannot express.\ndreamlake memos suggest-diff current.md edited.md --in-place --user \"$DREAMLAKE_AGENT_NAME\" > proposal.md\n# Count insertions, deletions, replacements and changed code blocks.\ndreamlake memos suggest-diff before.md after.md --json | jq .stats",
119
+ "memos transfer": "dreamlake memos transfer NOTE_ID --namespace alice --to acme \\\n --dry-run --out note-transfer.json\n# Submit the exact reviewed file; the authorized destination member accepts separately.\ndreamlake memos transfer NOTE_ID --namespace alice --to acme \\\n --confirm --request-file note-transfer.json\n# If you also have destination acceptance authority:\ndreamlake memos transfer NOTE_ID --namespace alice --to acme \\\n --confirm --request-file note-transfer.json --accept-if-authorized --wait",
120
+ "memos tag": "# Save the current content on the existing Note.\ndreamlake note tag NOTE_ID end-of-day --namespace my-org --summary \"Reviewed today's actions\"\n# Require the hash retained from a reviewed full read (not its opaque revision).\ndreamlake note tag NOTE_ID reviewed --hash sha256:CONTENT_HASH --json\n# Connect this checkpoint to an earlier version in the same Note.\ndreamlake note tag NOTE_ID next-checkpoint --parent VERSION_ID\n# Read and validate without creating a version.\ndreamlake note tag NOTE_ID preview --dry-run --json",
121
+ "memos hist": "dreamlake note hist NOTE_ID --namespace my-org --json\n# Continue with nextCursor returned by the previous page.\ndreamlake note hist NOTE_ID --before VERSION_ID --json",
122
122
  "ownership transfer": "dreamlake ownership transfer artifact ARTIFACT_ID --namespace alice --to acme \\\n --dry-run --out artifact-transfer.json\n# Review the full access inventory and blockers, then submit that exact file.\ndreamlake ownership transfer artifact ARTIFACT_ID --namespace alice --to acme \\\n --confirm --request-file artifact-transfer.json --accept-if-authorized --wait\n# Scene resources use the canonical env adapter, only if advertised and enabled.\ndreamlake ownership transfer scene SCENE_ID --namespace alice --to acme --dry-run\n# Pipeline requires the separately advertised metadata adapter.\ndreamlake ownership transfer pipeline PIPELINE_ID --namespace alice --to acme \\\n --dry-run --out pipeline-transfer.json\n# Source requires its own enabled metadata-only capability.\ndreamlake ownership transfer source SOURCE_ID --namespace alice --to acme \\\n --dry-run --out source-transfer.json",
123
123
  "ownership capabilities": "dreamlake ownership capabilities --namespace acme",
124
124
  "ownership list": "dreamlake ownership list --namespace acme --direction incoming\ndreamlake ownership list --namespace acme --direction outgoing",
package/dist/cli/index.js CHANGED
@@ -104,7 +104,7 @@ async function main(argv) {
104
104
  const program = new Command();
105
105
  program
106
106
  .name("dreamlake")
107
- .description("DreamLake CLI — manage data, notes, project access, and scoped Vault entries.")
107
+ .description("DreamLake CLI — manage data, memos, project access, and scoped Vault entries.")
108
108
  .version(VERSION, "-v, --version", "print the version and exit")
109
109
  .showHelpAfterError('(Add --help to see options and examples.)');
110
110
  program.option("--identity <mode>", "select user or machine for this invocation").hook("preAction", () => {
@@ -264,7 +264,7 @@ async function main(argv) {
264
264
  for (const [route, examples] of Object.entries(helpExamples)) {
265
265
  let command = program;
266
266
  for (const part of route === "dreamlake" ? [] : route.split(" ")) {
267
- const child = command.commands.find(c => c.name() === part);
267
+ const child = command.commands.find(c => c.name() === part || c.aliases().includes(part));
268
268
  if (!child)
269
269
  throw new Error(`Docs help references unknown command: ${route}`);
270
270
  command = child;
@@ -5,15 +5,15 @@ export function noteTransport(c) {
5
5
  return {
6
6
  request: async (method, path, options) => {
7
7
  if (method === 'HEAD')
8
- throw new RequestNotSent('Notes JSON transport does not support HEAD');
8
+ throw new RequestNotSent('Memos JSON transport does not support HEAD');
9
9
  const { body, timeoutMs, ...request } = options ?? {};
10
10
  if (body !== undefined)
11
- throw new RequestNotSent('Notes collaboration transport requires JSON');
11
+ throw new RequestNotSent('Memos collaboration transport requires JSON');
12
12
  return requestJson(c.remote, path, { token: c.token, method, ...request, timeoutMs: timeoutMs ?? undefined });
13
13
  },
14
14
  raw: async (method, path, options) => {
15
15
  if (method !== 'GET' && method !== 'HEAD')
16
- throw new RequestNotSent('Notes streaming transport requires GET or HEAD');
16
+ throw new RequestNotSent('Memos streaming transport requires GET or HEAD');
17
17
  return requestRaw(requestUrl(c.remote, path, options?.query), { token: c.token, method, headers: options?.headers, signal: options?.signal, timeoutMs: options?.timeoutMs ?? undefined, followRedirects: false });
18
18
  },
19
19
  };
@@ -24,15 +24,15 @@ export async function runNotesArchive(ref, archived, opts) {
24
24
  }
25
25
  const note = await requestJson(c.remote, `/notes/${seg(id)}`, { token });
26
26
  if (note.id !== id || !note.namespaceSlug) {
27
- fail("server did not return the note's owning namespace");
27
+ fail("server did not return the memo's owning namespace");
28
28
  return 1;
29
29
  }
30
30
  if (asserted && asserted !== note.namespaceSlug) {
31
- fail(`note ${id} is in '${note.namespaceSlug}', not --namespace '${asserted}'`);
31
+ fail(`memo ${id} is in '${note.namespaceSlug}', not --namespace '${asserted}'`);
32
32
  return 1;
33
33
  }
34
34
  if (note.permissions?.rename === false) {
35
- fail('you do not have permission to archive this note');
35
+ fail('you do not have permission to archive this memo');
36
36
  return 1;
37
37
  }
38
38
  const api = notesApi(noteTransport({ remote: c.remote, token }), note.namespaceSlug);
@@ -40,7 +40,7 @@ export async function runNotesArchive(ref, archived, opts) {
40
40
  if (opts.json)
41
41
  emitJson(result);
42
42
  else
43
- process.stdout.write(`✓ ${archived ? 'archived' : 'unarchived'} note ${id}\n`);
43
+ process.stdout.write(`✓ ${archived ? 'archived' : 'unarchived'} memo ${id}\n`);
44
44
  return 0;
45
45
  }
46
46
  catch (error) {
@@ -50,10 +50,10 @@ export async function runNotesArchive(ref, archived, opts) {
50
50
  export function registerArchiveCommands(notes) {
51
51
  for (const action of ['archive', 'unarchive']) {
52
52
  withConnFlags(notes.command(action).allowExcessArguments(false))
53
- .description(action === 'archive' ? 'archive a note without deleting it or removing its filings' : 'unarchive a note and restore its folder path')
54
- .argument('<note>', 'note id, slug or exact title')
55
- .option('--namespace <slug>', 'whose notes for lookup; with an id, asserts the owner')
56
- .option('--json', 'emit the updated note metadata')
53
+ .description(action === 'archive' ? 'archive a memo without deleting it or removing its filings' : 'unarchive a memo and restore its folder path')
54
+ .argument('<note>', 'memo id, slug or exact title')
55
+ .option('--namespace <slug>', 'whose memos for lookup; with an id, asserts the owner')
56
+ .option('--json', 'emit the updated memo metadata')
57
57
  .action(async (note, opts) => { process.exitCode = await runNotesArchive(note, action === 'archive', opts); });
58
58
  }
59
59
  }
@@ -17,7 +17,7 @@ function format(value) {
17
17
  export function tokens(result, note) {
18
18
  if (!result || result.note !== note || !/^sha256:[a-f0-9]{64}$/.test(result.hash)
19
19
  || typeof result.revision !== "string" || !result.revision || /[\r\n]/.test(result.revision)) {
20
- throw new Error("server did not return the Notes v2 contract; upgrade the server or explicitly use --legacy");
20
+ throw new Error("server did not return the Memos v2 contract; upgrade the server or explicitly use --legacy");
21
21
  }
22
22
  }
23
23
  function printTokens(result) {
@@ -127,7 +127,7 @@ export function documentWriteError(error) {
127
127
  return 1;
128
128
  }
129
129
  if (error instanceof CommandIdentityUnsupported) {
130
- fail(`${error.message}; the write may have been applied: inspect the note before resubmitting, and upgrade the server before relying on --command-id`);
130
+ fail(`${error.message}; the write may have been applied: inspect the memo before resubmitting, and upgrade the server before relying on --command-id`);
131
131
  return 4;
132
132
  }
133
133
  // The core turns a PATCH 503 into a typed outcome above, so a raw 503 here came from the
@@ -141,7 +141,7 @@ export function documentWriteError(error) {
141
141
  const reason = error.status === 412 ? "the original revision or RTC identities are no longer valid for this request"
142
142
  : error.status === 422 ? "the patch was rejected; inspect the server explanation and preserve the original snapshot and draft"
143
143
  : "the realtime acknowledgment is unavailable; the result may be ambiguous";
144
- fail(`${reason}; keep the original baseline and draft, inspect the note before resubmitting (${error.message})`);
144
+ fail(`${reason}; keep the original baseline and draft, inspect the memo before resubmitting (${error.message})`);
145
145
  return error.status === 412 ? 3 : error.status === 422 ? 5 : 4;
146
146
  }
147
147
  return report(error);
@@ -172,7 +172,7 @@ export async function runDocumentRead(ref, opts) {
172
172
  const selectedFormat = format(opts.format ?? "diff");
173
173
  const target = ref ?? opts.note;
174
174
  if (!target || (ref && opts.note && ref !== opts.note))
175
- throw new Error("give one note id, slug or name");
175
+ throw new Error("give one memo id, slug or name");
176
176
  if ((opts.at !== undefined && (!opts.at.trim() || opts.at === "*" || /[\r\n]/.test(opts.at))))
177
177
  throw new Error("--at requires an exact retained revision");
178
178
  if (opts.at && (opts.since !== undefined || opts.ifMatch !== undefined))
@@ -194,7 +194,7 @@ export async function runDocumentRead(ref, opts) {
194
194
  const lines = parseLines(opts.lines);
195
195
  const focused = focusedRead(await readDocumentSnapshot(c, id, opts.at), lines);
196
196
  if (opts.ifMatch && focused.revision !== opts.ifMatch) {
197
- fail("note changed since the acknowledged revision; keep the original draft and baseline");
197
+ fail("memo changed since the acknowledged revision; keep the original draft and baseline");
198
198
  return 3;
199
199
  }
200
200
  if (opts.json)
@@ -222,13 +222,13 @@ export async function runDocumentRead(ref, opts) {
222
222
  break;
223
223
  }
224
224
  if (page.sourceType !== 'markdown')
225
- throw new Error('annotated Markdown requires a Markdown note; use --view html for HTML source');
225
+ throw new Error('annotated Markdown requires a Markdown memo; use --view html for HTML source');
226
226
  if (opts.ifMatch && page.revision !== opts.ifMatch) {
227
- fail("note changed since the acknowledged revision; keep the original draft and baseline");
227
+ fail("memo changed since the acknowledged revision; keep the original draft and baseline");
228
228
  return 3;
229
229
  }
230
230
  if (hash !== undefined && (hash !== page.hash || total !== page.total))
231
- throw new Error('Note reading view changed during pagination');
231
+ throw new Error('Memo reading view changed during pagination');
232
232
  hash = page.hash;
233
233
  total = page.total;
234
234
  at = page.revision;
@@ -254,14 +254,14 @@ export async function runDocumentRead(ref, opts) {
254
254
  const response = await requestRaw(url, { token: c.token, timeoutMs: 30000, followRedirects: false,
255
255
  headers: { Accept: "text/html", ...(opts.ifMatch ? { "If-Match": opts.ifMatch } : {}) } });
256
256
  if (!/^text\/(?:html|plain)(?:;|$)/i.test(response.headers.get("content-type") ?? ""))
257
- throw new Error("server did not return Notes HTML; upgrade the server");
257
+ throw new Error("server did not return Memos HTML; upgrade the server");
258
258
  const bytes = new Uint8Array(await response.arrayBuffer());
259
259
  const html = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes);
260
260
  const snapshot = validateHtmlSnapshot(html, id, { section: opts.section, toc: opts.toc, tag: opts.tag });
261
261
  if (opts.at && snapshot.revision !== opts.at)
262
262
  throw new Error("server did not return the requested pinned revision");
263
263
  if (opts.ifMatch && snapshot.revision !== opts.ifMatch) {
264
- fail("note changed since the acknowledged revision; keep the original draft and baseline");
264
+ fail("memo changed since the acknowledged revision; keep the original draft and baseline");
265
265
  return 3;
266
266
  }
267
267
  process.stdout.write(bytes);
@@ -278,12 +278,12 @@ export async function runDocumentRead(ref, opts) {
278
278
  if (opts.at && result.revision !== opts.at)
279
279
  throw new Error("server did not return the requested pinned revision");
280
280
  if (opts.ifMatch && result.revision !== opts.ifMatch) {
281
- fail("note changed since the acknowledged revision; keep the original draft and baseline");
281
+ fail("memo changed since the acknowledged revision; keep the original draft and baseline");
282
282
  return 3;
283
283
  }
284
284
  if (opts.since !== undefined) {
285
285
  if (result.format !== selectedFormat || typeof result.patch !== "string" || !/^sha256:[a-f0-9]{64}$/.test(result.base ?? ""))
286
- throw new Error("invalid incremental Notes v2 response");
286
+ throw new Error("invalid incremental Memos v2 response");
287
287
  }
288
288
  else {
289
289
  validateSourceHash(result);