@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.
- package/dist/api/note-events.js +7 -7
- package/dist/api/note-facade.js +8 -8
- package/dist/api/note-linger.js +4 -4
- package/dist/api/note-presence.js +1 -1
- package/dist/api/note-reading.js +3 -3
- package/dist/api/note-write.js +6 -6
- package/dist/api/notes.js +3 -3
- package/dist/cli/agents/index.js +4 -4
- package/dist/cli/failure-report.js +3 -3
- package/dist/cli/help-examples.generated.js +37 -37
- package/dist/cli/index.js +2 -2
- package/dist/cli/notes/api-transport.js +3 -3
- package/dist/cli/notes/archive-command.js +8 -8
- package/dist/cli/notes/document.js +12 -12
- package/dist/cli/notes/edit-commands.js +7 -7
- package/dist/cli/notes/files-commands.js +6 -6
- package/dist/cli/notes/html-read.js +3 -3
- package/dist/cli/notes/index.js +126 -126
- package/dist/cli/notes/linger.js +2 -2
- package/dist/cli/notes/move-command.js +21 -21
- package/dist/cli/notes/rm-command.js +10 -10
- package/dist/cli/notes/select-command.js +3 -3
- package/dist/cli/notes/suggest-diff.js +2 -2
- package/dist/cli/notes/transfer-command.js +1 -1
- package/dist/cli/notes/version-commands.js +8 -8
- package/dist/cli/ownership/metadata-transfer.js +2 -2
- package/dist/cli/project/index.js +4 -4
- package/dist/cli/project/move.js +2 -2
- package/dist/cli/project/stream.js +1 -1
- package/dist/cli/session-affiliation.js +1 -1
- package/dist/cli/sessions/affiliation.js +4 -4
- package/dist/cli/sessions/api.js +1 -1
- package/dist/cli/sessions/control.js +1 -1
- package/dist/cli/sessions/index.js +2 -2
- package/dist/cli/share.js +3 -3
- package/dist/cli/tasks/index.js +4 -4
- package/dist/cli/update/index.js +3 -3
- package/dist/cli/version.d.ts +1 -1
- package/dist/cli/version.js +1 -1
- package/package.json +9 -9
package/dist/cli/notes/index.js
CHANGED
|
@@ -67,7 +67,7 @@ export function report(err) {
|
|
|
67
67
|
if (err instanceof HttpError) {
|
|
68
68
|
const detail = err.body?.message ?? err.message;
|
|
69
69
|
if (err.status === 412) {
|
|
70
|
-
fail(`the
|
|
70
|
+
fail(`the memo changed since you read it — re-read and redo the edit (${detail})`);
|
|
71
71
|
return EXIT_STALE;
|
|
72
72
|
}
|
|
73
73
|
if (err.status === 409 || err.status === 503) {
|
|
@@ -86,7 +86,7 @@ export function report(err) {
|
|
|
86
86
|
return 1;
|
|
87
87
|
}
|
|
88
88
|
if (err.status === 403) {
|
|
89
|
-
fail("read-only access to this
|
|
89
|
+
fail("read-only access to this memo — you may read it but not write it");
|
|
90
90
|
return 1;
|
|
91
91
|
}
|
|
92
92
|
if (err.status === 404) {
|
|
@@ -120,8 +120,8 @@ export async function resolveNote(c, ref) {
|
|
|
120
120
|
if (!res.notes.length || (res.total === undefined ? res.notes.length < 200 : offset >= res.total))
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
|
-
fail(`no
|
|
124
|
-
`and an organization's
|
|
123
|
+
fail(`no memo '${ref}' in namespace '${c.ns}' — 'dreamlake memos list --include-archived' shows what is there, ` +
|
|
124
|
+
`and an organization's memos need --namespace <slug>`);
|
|
125
125
|
return null;
|
|
126
126
|
}
|
|
127
127
|
/** Body text from --file, --text, or stdin. Exactly one, so an empty write is
|
|
@@ -192,9 +192,9 @@ async function validator(c, noteId, opts) {
|
|
|
192
192
|
// ─── commands ─────────────────────────────────────────────────────────────────
|
|
193
193
|
export function registerNotesCommand(program) {
|
|
194
194
|
const notes = program
|
|
195
|
-
.command("
|
|
196
|
-
.
|
|
197
|
-
.description("read and edit collaborative
|
|
195
|
+
.command("memos")
|
|
196
|
+
.aliases(["memo", "notes", "note"])
|
|
197
|
+
.description("read and edit collaborative memos (search, sections, write, patch)");
|
|
198
198
|
registerShareCommands(notes, "notes");
|
|
199
199
|
registerVersionCommands(notes);
|
|
200
200
|
registerMoveCommand(notes);
|
|
@@ -206,74 +206,74 @@ export function registerNotesCommand(program) {
|
|
|
206
206
|
// behave identically across the CLI.
|
|
207
207
|
const strict = (cmd) => withConnFlags(cmd.allowExcessArguments(false));
|
|
208
208
|
strict(notes.command("visit"))
|
|
209
|
-
.argument("<
|
|
209
|
+
.argument("<memo>", "memo id, slug or title")
|
|
210
210
|
.description("register agent presence once without reading content")
|
|
211
|
-
.option("--namespace <slug>", "
|
|
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
214
|
.action(async (note, opts) => { process.exitCode = await runNotesVisit(note, opts); });
|
|
215
215
|
strict(notes.command("presence"))
|
|
216
|
-
.argument("<
|
|
217
|
-
.description("read who is present without joining the
|
|
218
|
-
.option("--namespace <slug>", "
|
|
216
|
+
.argument("<memo>", "memo id, slug or title")
|
|
217
|
+
.description("read who is present without joining the memo")
|
|
218
|
+
.option("--namespace <slug>", "memo owner namespace")
|
|
219
219
|
.option("--json", "emit JSON for programmatic consumers")
|
|
220
220
|
.action(async (note, opts) => { process.exitCode = await runNotesPresence(note, opts); });
|
|
221
221
|
strict(notes.command("contributors"))
|
|
222
|
-
.argument("<
|
|
222
|
+
.argument("<memo>", "memo id, slug or title")
|
|
223
223
|
.description("list durable contributing sessions and explicitly linked sessions")
|
|
224
|
-
.option("--namespace <slug>", "
|
|
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
227
|
.action(async (note, opts) => { process.exitCode = await runNotesContributors(note, opts); });
|
|
228
228
|
strict(notes.command("projects"))
|
|
229
|
-
.argument("<
|
|
229
|
+
.argument("<memo-id>", "stable Memo ID")
|
|
230
230
|
.description("inspect current project filing and server-computed filing permissions (JSON)")
|
|
231
|
-
.option("--namespace <slug>", "the
|
|
231
|
+
.option("--namespace <slug>", "the Memo's owning namespace (or --ns)")
|
|
232
232
|
.action(async (id, opts) => { process.exitCode = await runNotesProjects(id, opts); });
|
|
233
233
|
// ── notes create ──
|
|
234
234
|
strict(notes.command("create"))
|
|
235
|
-
.argument("[name]", "the
|
|
236
|
-
.description("create a
|
|
237
|
-
.option("--project <slug>", "file the new
|
|
235
|
+
.argument("[name]", "the memo's title (default: Untitled)")
|
|
236
|
+
.description("create a memo, optionally with a body")
|
|
237
|
+
.option("--project <slug>", "file the new Memo in this same-namespace project (repeatable)", (value, previous) => [...previous, value], [])
|
|
238
238
|
.option("--file <path>", "initial body from a file ('-' for stdin)")
|
|
239
239
|
.option("--text <string>", "initial body, inline")
|
|
240
240
|
.option("--public", "anyone can read it (default: private)")
|
|
241
|
-
.option("--namespace <slug>", "whose
|
|
241
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
242
242
|
.option("--json", "emit JSON")
|
|
243
243
|
.action(async (name, opts) => { process.exitCode = await runNotesCreate(name, opts); });
|
|
244
244
|
// ── notes list ──
|
|
245
245
|
strict(collectionList(notes, "list"))
|
|
246
|
-
.description("list
|
|
247
|
-
.option("--include-archived", "include archived
|
|
246
|
+
.description("list memos in one namespace")
|
|
247
|
+
.option("--include-archived", "include archived memos")
|
|
248
248
|
.option("--limit <n>", "page size", "50")
|
|
249
249
|
.option("--offset <n>", "skip this many rows first (zero-based paging: 0, 20, 40, …)")
|
|
250
|
-
.option("--namespace <slug>", "whose
|
|
251
|
-
.option("--shared", "list
|
|
250
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
251
|
+
.option("--shared", "list memos other people shared with you, across namespaces")
|
|
252
252
|
.option("--json", "emit JSON")
|
|
253
253
|
.action(async (opts) => { process.exitCode = await runNotesList(opts); });
|
|
254
254
|
// ── notes search ──
|
|
255
255
|
strict(notes.command("search"))
|
|
256
|
-
.argument("<query>", "matched against
|
|
257
|
-
.description("find
|
|
258
|
-
.option("--include-archived", "include archived
|
|
256
|
+
.argument("<query>", "matched against memo titles and bodies, case-insensitively")
|
|
257
|
+
.description("find memos by title or body text")
|
|
258
|
+
.option("--include-archived", "include archived memos")
|
|
259
259
|
.option("--limit <n>", "page size", "50")
|
|
260
|
-
.option("--namespace <slug>", "whose
|
|
260
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
261
261
|
.option("--json", "emit JSON")
|
|
262
262
|
.action(async (query, opts) => { process.exitCode = await runNotesSearch(query, opts); });
|
|
263
263
|
// ── notes grep ──
|
|
264
264
|
strict(notes.command("grep"))
|
|
265
265
|
.argument("[query]", "literal text; punctuation matches itself")
|
|
266
|
-
.description("search every
|
|
267
|
-
.option("--include-archived", "include archived
|
|
266
|
+
.description("search every memo you can see and print where each hit is")
|
|
267
|
+
.option("--include-archived", "include archived memos")
|
|
268
268
|
.option("--regex <pattern>", "search by pattern instead of literal text")
|
|
269
269
|
.option("--flags <flags>", "regex flags: any of i, m, s, u")
|
|
270
270
|
.option("--case-sensitive", "match case (the default for --regex)")
|
|
271
271
|
.option("--no-case-sensitive", "ignore case (the default for a literal query)")
|
|
272
|
-
.option("--glob <pattern>", "only
|
|
273
|
-
.option("--note <ids>", "comma-separated
|
|
272
|
+
.option("--glob <pattern>", "only memos whose name matches, e.g. 'spec-*'")
|
|
273
|
+
.option("--note <ids>", "comma-separated memo ids or slugs to search")
|
|
274
274
|
.option("-C, --context <n>", "lines of context either side")
|
|
275
275
|
.option("--limit <n>", "maximum number of hits", "50")
|
|
276
|
-
.option("--namespace <slug>", "whose
|
|
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
278
|
.action(async (query, opts) => { process.exitCode = await runNotesGrep(query, opts); });
|
|
279
279
|
const media = notes.command("media").allowExcessArguments(false)
|
|
@@ -287,45 +287,45 @@ export function registerNotesCommand(program) {
|
|
|
287
287
|
//
|
|
288
288
|
// A sub-group rather than top-level commands: these act on a note's files,
|
|
289
289
|
// and `notes upload` would read as uploading the note.
|
|
290
|
-
const files = strict(notes.command("files")).description("files attached to a
|
|
290
|
+
const files = strict(notes.command("files")).description("files attached to a memo");
|
|
291
291
|
strict(collectionList(files, "list"))
|
|
292
292
|
.argument("[glob]", "e.g. 'assets/*.png' or '**/*.json'")
|
|
293
|
-
.description("list the files attached to a
|
|
293
|
+
.description("list the files attached to a memo")
|
|
294
294
|
.option("--trashed", "list the trash instead of the live files")
|
|
295
295
|
.option("--content-type <type>", "only files stored with this exact type")
|
|
296
|
-
.option("--note <ref>", "the
|
|
297
|
-
.option("--namespace <slug>", "whose
|
|
296
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
297
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
298
298
|
.option("--json", "emit JSON")
|
|
299
299
|
.option("--limit <n>", "how many files to show")
|
|
300
300
|
.option("--offset <n>", "skip this many first")
|
|
301
301
|
.action(async (glob, opts) => { process.exitCode = await runFilesList(glob, opts); });
|
|
302
302
|
strict(files.command("upload"))
|
|
303
303
|
.argument("<local>", "path to the local file")
|
|
304
|
-
.description("upload a file to a
|
|
305
|
-
.option("--path <path>", "where to put it in the
|
|
304
|
+
.description("upload a file to a memo (any bytes; nothing is decoded)")
|
|
305
|
+
.option("--path <path>", "where to put it in the memo (default: the file's name)")
|
|
306
306
|
.option("--content-type <type>", "declare the type instead of letting it be inferred")
|
|
307
307
|
.option("--overwrite", "replace a file already at that path")
|
|
308
|
-
.option("--note <ref>", "the
|
|
309
|
-
.option("--namespace <slug>", "whose
|
|
308
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
309
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
310
310
|
.option("--json", "emit JSON")
|
|
311
311
|
.action(async (local, opts) => { process.exitCode = await runFilesUpload(local, opts); });
|
|
312
312
|
strict(files.command("download"))
|
|
313
|
-
.argument("<file>", "file id or path within the
|
|
313
|
+
.argument("<file>", "file id or path within the memo")
|
|
314
314
|
.description("download a file (exact bytes)")
|
|
315
315
|
.option("-o, --output <path>", "where to write it; '-' or omitted means stdout")
|
|
316
316
|
.option("--overwrite", "replace the local file if it exists")
|
|
317
|
-
.option("--note <ref>", "the
|
|
318
|
-
.option("--namespace <slug>", "whose
|
|
317
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
318
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
319
319
|
.action(async (file, opts) => { process.exitCode = await runFilesDownload(file, opts); });
|
|
320
320
|
strict(files.command("cat"))
|
|
321
|
-
.argument("<file>", "file id or path within the
|
|
321
|
+
.argument("<file>", "file id or path within the memo")
|
|
322
322
|
.description("print a text file; refuses a binary rather than mangling it")
|
|
323
|
-
.option("--note <ref>", "the
|
|
324
|
-
.option("--namespace <slug>", "whose
|
|
323
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
324
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
325
325
|
.option("--json", "emit JSON (includes the etag)")
|
|
326
326
|
.action(async (file, opts) => { process.exitCode = await runFilesCat(file, opts); });
|
|
327
327
|
strict(files.command("write"))
|
|
328
|
-
.argument("<path>", "where to put it in the
|
|
328
|
+
.argument("<path>", "where to put it in the memo")
|
|
329
329
|
.description("write a text file from --text or --file")
|
|
330
330
|
.option("--text <text>", "the contents")
|
|
331
331
|
.option("--file <path>", "read the contents from a local file")
|
|
@@ -333,28 +333,28 @@ export function registerNotesCommand(program) {
|
|
|
333
333
|
.option("--idempotency-key <key>", "keep one original text/copy operation for recovery")
|
|
334
334
|
.option("--overwrite", "replace a file already at that path")
|
|
335
335
|
.option("--if-match <etag>", "only write if the file is still at this revision")
|
|
336
|
-
.option("--note <ref>", "the
|
|
337
|
-
.option("--namespace <slug>", "whose
|
|
336
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
337
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
338
338
|
.option("--json", "emit JSON")
|
|
339
339
|
.action(async (p, opts) => { process.exitCode = await runFilesWrite(p, opts); });
|
|
340
340
|
strict(files.command("mv"))
|
|
341
341
|
.argument("<file>", "file id or path")
|
|
342
|
-
.argument("<to>", "new path within the
|
|
342
|
+
.argument("<to>", "new path within the memo")
|
|
343
343
|
.description("move or rename (the id and the bytes do not change)")
|
|
344
344
|
.option("--overwrite", "replace a file already at the destination")
|
|
345
345
|
.option("--if-match <etag>", "only move if the file is still at this revision")
|
|
346
|
-
.option("--note <ref>", "the
|
|
347
|
-
.option("--namespace <slug>", "whose
|
|
346
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
347
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
348
348
|
.option("--json", "emit JSON")
|
|
349
349
|
.action(async (file, to, opts) => { process.exitCode = await runFilesMove(file, to, opts); });
|
|
350
350
|
strict(files.command("cp"))
|
|
351
351
|
.argument("<file>", "file id or path")
|
|
352
|
-
.argument("<to>", "new path within the
|
|
352
|
+
.argument("<to>", "new path within the memo")
|
|
353
353
|
.description("copy to another path (its own storage, not a share)")
|
|
354
354
|
.option("--idempotency-key <key>", "keep one original text/copy operation for recovery")
|
|
355
355
|
.option("--overwrite", "replace a file already at the destination")
|
|
356
|
-
.option("--note <ref>", "the
|
|
357
|
-
.option("--namespace <slug>", "whose
|
|
356
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
357
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
358
358
|
.option("--json", "emit JSON")
|
|
359
359
|
.action(async (file, to, opts) => { process.exitCode = await runFilesCopy(file, to, opts); });
|
|
360
360
|
for (const [action, description] of [
|
|
@@ -365,8 +365,8 @@ export function registerNotesCommand(program) {
|
|
|
365
365
|
strict(files.command(action))
|
|
366
366
|
.argument("<operation>", "operation ID from the original response")
|
|
367
367
|
.description(description)
|
|
368
|
-
.option("--note <ref>", "the
|
|
369
|
-
.option("--namespace <slug>", "whose
|
|
368
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
369
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
370
370
|
.option("--json", "emit JSON")
|
|
371
371
|
.action(async (operation, opts) => { process.exitCode = await runFilesOperation(action, operation, opts); });
|
|
372
372
|
}
|
|
@@ -375,33 +375,33 @@ export function registerNotesCommand(program) {
|
|
|
375
375
|
.description("move a file to the trash; --purge deletes the bytes for good")
|
|
376
376
|
.option("--purge", "delete the stored bytes — not recoverable")
|
|
377
377
|
.option("--if-match <etag>", "only delete if the file is still at this revision")
|
|
378
|
-
.option("--note <ref>", "the
|
|
379
|
-
.option("--namespace <slug>", "whose
|
|
378
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
379
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
380
380
|
.option("--json", "emit JSON")
|
|
381
381
|
.action(async (file, opts) => { process.exitCode = await runFilesRm(file, opts); });
|
|
382
382
|
strict(files.command("restore"))
|
|
383
383
|
.argument("<file>", "file id")
|
|
384
384
|
.description("bring a file back from the trash")
|
|
385
385
|
.option("--path <path>", "restore it here instead of where it was")
|
|
386
|
-
.option("--note <ref>", "the
|
|
387
|
-
.option("--namespace <slug>", "whose
|
|
386
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
387
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
388
388
|
.option("--json", "emit JSON")
|
|
389
389
|
.action(async (file, opts) => { process.exitCode = await runFilesRestore(file, opts); });
|
|
390
390
|
strict(files.command("preview"))
|
|
391
|
-
.argument("<file>", "file id or path within the
|
|
391
|
+
.argument("<file>", "file id or path within the memo")
|
|
392
392
|
.description("print a link that renders this file")
|
|
393
393
|
.option("--share", "a link that opens without signing in, until revoked")
|
|
394
394
|
.option("--revoke", "withdraw the shared link; every copy stops working")
|
|
395
395
|
.option("--open", "open the link in a browser")
|
|
396
|
-
.option("--note <ref>", "the
|
|
397
|
-
.option("--namespace <slug>", "whose
|
|
396
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
397
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
398
398
|
.option("--json", "emit JSON")
|
|
399
399
|
.action(async (file, opts) => { process.exitCode = await runFilesPreview(file, opts); });
|
|
400
400
|
// ── notes sections ──
|
|
401
401
|
strict(notes.command("sections"))
|
|
402
|
-
.argument("<
|
|
402
|
+
.argument("<memo>", "memo id, slug or name")
|
|
403
403
|
.description("list the addressable sections (a heading plus everything under it)")
|
|
404
|
-
.option("--namespace <slug>", "whose
|
|
404
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
405
405
|
.option("--json", "emit JSON")
|
|
406
406
|
.action(async (ref, opts) => { process.exitCode = await runNotesSections(ref, opts); });
|
|
407
407
|
// ── notes read ──
|
|
@@ -413,15 +413,15 @@ export function registerNotesCommand(program) {
|
|
|
413
413
|
// edit commands; the positional came first and scripts use it. Accepting
|
|
414
414
|
// one form and rejecting the other would make half the documented recipes
|
|
415
415
|
// fail on a flag rather than on anything real.
|
|
416
|
-
.argument("[note]", "
|
|
417
|
-
.option("--note <ref>", "the
|
|
416
|
+
.argument("[note]", "memo id, slug or name (or pass --note)")
|
|
417
|
+
.option("--note <ref>", "the memo to read, as an alternative to the positional")
|
|
418
418
|
.description("read the mapped Markdown view, exact canonical source (--json, --view source) or a mapped HTML snapshot with its write revision")
|
|
419
419
|
.option("--linger", "stay present and stream batched diffs, presence and activity in the foreground")
|
|
420
420
|
.option("--debounce <duration>", "edit quiet period with --linger (default 2s; 250ms–5m)")
|
|
421
421
|
.option("--throttle <duration>", "minimum output interval with --linger (default 2s; 250ms–5m)")
|
|
422
422
|
.option("--intent <text>", "with --linger: one short sentence of purpose, shown on your presence card")
|
|
423
423
|
.option("--view <view>", "markdown with address hints (default for text), source (exact; default for --json), or html with source attributes")
|
|
424
|
-
.option("--version <version-id>", "read an immutable saved version instead of the live
|
|
424
|
+
.option("--version <version-id>", "read an immutable saved version instead of the live memo")
|
|
425
425
|
.option("--at <revision>", "read a retained snapshot without advancing to the current revision")
|
|
426
426
|
.option("--toc", "read only the heading outline as mapped HTML")
|
|
427
427
|
.option("--tag <id>", "read one mapped HTML element by its exact id")
|
|
@@ -429,43 +429,43 @@ export function registerNotesCommand(program) {
|
|
|
429
429
|
.option("--format <format>", "incremental format: diff (default) or inline-dff")
|
|
430
430
|
.option("--legacy", "use the previous body-only/etag interface")
|
|
431
431
|
.option("--section <anchor>", "print only this section")
|
|
432
|
-
.option("--namespace <slug>", "whose
|
|
432
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
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
|
-
.option("--if-match <etag>", "verify: fail unless the
|
|
435
|
+
.option("--if-match <etag>", "verify: fail unless the memo is still at this revision")
|
|
436
436
|
.action(async (ref, opts) => { process.exitCode = await runNotesRead(ref, opts); });
|
|
437
437
|
// ── notes diff ──
|
|
438
438
|
strict(notes.command("diff"))
|
|
439
|
-
.argument("[note]", "
|
|
440
|
-
.option("--note <ref>", "the
|
|
439
|
+
.argument("[note]", "memo id, slug or name (or pass --note)")
|
|
440
|
+
.option("--note <ref>", "the memo to compare, as an alternative to the positional")
|
|
441
441
|
.description("alias for read --since; does not advance an existing draft baseline")
|
|
442
442
|
.option("--format <format>", "diff (default) or inline-dff")
|
|
443
443
|
.option("--legacy", "use the previous diff/etag interface")
|
|
444
444
|
.requiredOption("--since <ref>", "retained content hash or time reference")
|
|
445
445
|
.option("--context <n>", "legacy unchanged context lines per hunk (0–100)")
|
|
446
|
-
.option("--namespace <slug>", "whose
|
|
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
448
|
.action(async (ref, opts) => { process.exitCode = await runNotesDiff(ref, opts); });
|
|
449
449
|
// ── notes write ──
|
|
450
450
|
strict(notes.command("write"))
|
|
451
|
-
.argument("<
|
|
451
|
+
.argument("<memo>", "memo id, slug or name")
|
|
452
452
|
.description("replace the whole body — or one section with --section")
|
|
453
453
|
.option("--section <anchor>", "replace only this section (heading included in the text)")
|
|
454
454
|
.option("--file <path>", "read the text from a file ('-' for stdin)")
|
|
455
455
|
.option("--text <string>", "the text, inline")
|
|
456
|
-
.option("--if-match <etag>", "only write if the
|
|
456
|
+
.option("--if-match <etag>", "only write if the memo is still at this etag")
|
|
457
457
|
.option("--force", "retained legacy write without a precondition — overwrites concurrent edits")
|
|
458
458
|
.option("--legacy", "use the retained ETag/body replacement write")
|
|
459
459
|
.option("--base-revision <revision>", "compare the target body to this original retained source snapshot")
|
|
460
460
|
.option("--exact", "require the original revision to remain current")
|
|
461
461
|
.option("--command-id <id>", "caller-stable id (8–128 chars of A-Za-z0-9._:-); a retry with the same id returns the same receipt")
|
|
462
|
-
.option("--namespace <slug>", "whose
|
|
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
465
|
.action(async (ref, opts) => { process.exitCode = await runNotesWrite(ref, opts); });
|
|
466
466
|
// ── notes append ──
|
|
467
467
|
strict(notes.command("append"))
|
|
468
|
-
.argument("<
|
|
468
|
+
.argument("<memo>", "memo id, slug or name")
|
|
469
469
|
.description("add text to the end of the body")
|
|
470
470
|
.option("--file <path>", "read the text from a file ('-' for stdin)")
|
|
471
471
|
.option("--text <string>", "the text, inline")
|
|
@@ -474,38 +474,38 @@ export function registerNotesCommand(program) {
|
|
|
474
474
|
.option("--base-revision <revision>", "append against this original retained source snapshot")
|
|
475
475
|
.option("--exact", "require the original revision to remain current")
|
|
476
476
|
.option("--command-id <id>", "caller-stable id (8–128 chars of A-Za-z0-9._:-); a retry with the same id returns the same receipt")
|
|
477
|
-
.option("--namespace <slug>", "whose
|
|
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
480
|
.action(async (ref, opts) => { process.exitCode = await runNotesAppend(ref, opts); });
|
|
481
481
|
// ── notes patch ──
|
|
482
482
|
strict(notes.command("patch"))
|
|
483
|
-
.argument("<
|
|
483
|
+
.argument("<memo>", "memo id, slug or name")
|
|
484
484
|
.description("apply a source patch to its original RTC identities; merge by default, exact revision checks opt-in (sends without reading: the reading-view header check is best-effort here, the server enforces it)")
|
|
485
485
|
.option("--format <format>", "inline-dff (default) or diff")
|
|
486
486
|
.option("--legacy", "use the previous unified diff/etag interface")
|
|
487
487
|
.option("--file <path>", "read the diff from a file ('-' for stdin)")
|
|
488
488
|
.option("--diff <string>", "the diff, inline")
|
|
489
|
-
.option("--exact", "require the current
|
|
489
|
+
.option("--exact", "require the current memo to match the original revision for this request")
|
|
490
490
|
.option("--base-revision <revision>", "original saved snapshot used to validate source and RTC identities")
|
|
491
491
|
.option("--if-match <revision>", "compatibility exact-mode token; must match --base-revision when both are given")
|
|
492
492
|
.option("--command-id <id>", "caller-stable id (8–128 chars of A-Za-z0-9._:-); a retry with the same id returns the same receipt")
|
|
493
493
|
.option("--force", "legacy only: apply without a precondition")
|
|
494
|
-
.option("--namespace <slug>", "whose
|
|
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
497
|
.action(async (ref, opts) => { process.exitCode = await runNotesPatch(ref, opts); });
|
|
498
498
|
// ── notes add-section ──
|
|
499
499
|
strict(notes.command("add-section"))
|
|
500
|
-
.argument("<
|
|
500
|
+
.argument("<memo>", "memo id, slug or name")
|
|
501
501
|
.description("add a section (default: at the end) — pairs with rm-section")
|
|
502
502
|
.option("--before <anchor>", "place it before this section")
|
|
503
503
|
.option("--after <anchor>", "place it after this section and its subsections")
|
|
504
504
|
.option("--file <path>", "the section text from a file ('-' for stdin)")
|
|
505
505
|
.option("--text <string>", "the section text, inline")
|
|
506
|
-
.option("--if-match <etag>", "only insert if the
|
|
506
|
+
.option("--if-match <etag>", "only insert if the memo is still at this etag")
|
|
507
507
|
.option("--force", "insert without a precondition")
|
|
508
|
-
.option("--namespace <slug>", "whose
|
|
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
511
|
.action(async (ref, opts) => { process.exitCode = await runNotesAddSection(ref, opts); });
|
|
@@ -516,30 +516,30 @@ export function registerNotesCommand(program) {
|
|
|
516
516
|
// deliberate difference, documented, because reversing either one would
|
|
517
517
|
// break the reading habit its own users already have.
|
|
518
518
|
strict(notes.command("find"))
|
|
519
|
-
.description("find text in a
|
|
519
|
+
.description("find text in a memo — literal by default, --regex for patterns")
|
|
520
520
|
.argument("[query]", "literal text to find")
|
|
521
|
-
.option("--note <ref>", "the
|
|
521
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
522
522
|
.option("--regex <pattern>", "search with a JavaScript regular expression")
|
|
523
523
|
.option("--flags <flags>", "regex flags: i, m, s, u (not g — see --all)")
|
|
524
524
|
.option("--limit <n>", "stop after this many matches")
|
|
525
525
|
.option("--at <revision>", "search the retained snapshot at this revision")
|
|
526
526
|
.option("--case-sensitive", "match case for a literal query (the default)")
|
|
527
527
|
.option("--no-case-sensitive", "ignore case for a literal query")
|
|
528
|
-
.option("--json", "emit matches with
|
|
529
|
-
.option("--namespace <slug>", "whose
|
|
528
|
+
.option("--json", "emit matches with memo, hash and the source revision")
|
|
529
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
530
530
|
.action(async (query, opts) => { process.exitCode = await runNotesFind(query, opts); });
|
|
531
531
|
strict(notes.command("toc"))
|
|
532
|
-
.description("the
|
|
533
|
-
.option("--note <ref>", "the
|
|
532
|
+
.description("the memo's outline, with line and character ranges")
|
|
533
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
534
534
|
.option("--html", "parse as HTML rather than Markdown")
|
|
535
535
|
.option("--at <revision>", "outline the retained snapshot at this revision")
|
|
536
|
-
.option("--json", "emit entries with
|
|
537
|
-
.option("--namespace <slug>", "whose
|
|
536
|
+
.option("--json", "emit entries with memo, hash and the source revision")
|
|
537
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
538
538
|
.action(async (opts) => { process.exitCode = await runNotesToc(opts); });
|
|
539
539
|
strict(notes.command("replace"))
|
|
540
540
|
.description("replace text; one match required unless --all or --count")
|
|
541
|
-
.argument("[query]", "literal text to replace (or the
|
|
542
|
-
.option("--note <ref>", "the
|
|
541
|
+
.argument("[query]", "literal text to replace (or the memo ID when --lines/--address select the span)")
|
|
542
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
543
543
|
.option("--text <text>", "the replacement")
|
|
544
544
|
.option("--file <path>", "the replacement from a file ('-' for stdin), exact UTF-8")
|
|
545
545
|
.option("--lines <a:b>", "replace source lines a..b (1-based, inclusive)")
|
|
@@ -551,7 +551,7 @@ export function registerNotesCommand(program) {
|
|
|
551
551
|
.option("--ind <n|n:m>", "replace a character range (0-based code points, end-exclusive)")
|
|
552
552
|
.option("--count <n>", "require exactly this many matches")
|
|
553
553
|
.option("--all", "replace every match")
|
|
554
|
-
.option("--if-match <etag>", "quoted ETag from
|
|
554
|
+
.option("--if-match <etag>", "quoted ETag from memos read --legacy --json (not an rtc: revision)")
|
|
555
555
|
.option("--force", "retained legacy replacement without a precondition")
|
|
556
556
|
.option("--legacy", "use the retained ETag/body replacement replace")
|
|
557
557
|
.option("--base-revision <revision>", "target this original retained source snapshot")
|
|
@@ -559,13 +559,13 @@ export function registerNotesCommand(program) {
|
|
|
559
559
|
.option("--command-id <id>", "caller-stable id (8–128 chars of A-Za-z0-9._:-); a retry with the same id returns the same receipt")
|
|
560
560
|
.option("--dry-run", "print what would be written and stop")
|
|
561
561
|
.option("--json", "emit the new revision")
|
|
562
|
-
.option("--namespace <slug>", "whose
|
|
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
564
|
.action(async (query, opts) => { process.exitCode = await runNotesReplace(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
|
-
.argument("[note]", "
|
|
568
|
-
.option("--note <ref>", "the
|
|
567
|
+
.argument("[note]", "memo id (alternative to --note)")
|
|
568
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
569
569
|
.option("--text <text>", "what to insert, verbatim")
|
|
570
570
|
.option("--file <path>", "what to insert from a file ('-' for stdin), exact UTF-8")
|
|
571
571
|
.option("--before <id>", "insert at the start of this mapped element's full original span")
|
|
@@ -573,7 +573,7 @@ export function registerNotesCommand(program) {
|
|
|
573
573
|
.option("--cursor <n>", "insert at this original code-point position (0-based)")
|
|
574
574
|
.option("--line <n>", "insert before this line (1-based)")
|
|
575
575
|
.option("--ind <n>", "insert at this character position (0-based code points)")
|
|
576
|
-
.option("--if-match <etag>", "quoted ETag from
|
|
576
|
+
.option("--if-match <etag>", "quoted ETag from memos read --legacy --json (not an rtc: revision)")
|
|
577
577
|
.option("--force", "retained legacy replacement without a precondition")
|
|
578
578
|
.option("--legacy", "use the retained ETag/body replacement insert")
|
|
579
579
|
.option("--base-revision <revision>", "place text in this original retained source snapshot")
|
|
@@ -581,15 +581,15 @@ export function registerNotesCommand(program) {
|
|
|
581
581
|
.option("--command-id <id>", "caller-stable id (8–128 chars of A-Za-z0-9._:-); a retry with the same id returns the same receipt")
|
|
582
582
|
.option("--dry-run", "print what would be written and stop")
|
|
583
583
|
.option("--json", "emit the new revision")
|
|
584
|
-
.option("--namespace <slug>", "whose
|
|
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
587
|
.action(async (note, opts) => { process.exitCode = await runNotesInsert(note, opts); });
|
|
588
588
|
strict(notes.command("delete"))
|
|
589
589
|
.alias("remove")
|
|
590
|
-
.description("remove text (selected source, never the
|
|
591
|
-
.argument("[query]", "literal text to remove (or the
|
|
592
|
-
.option("--note <ref>", "the
|
|
590
|
+
.description("remove text (selected source, never the memo); one match required unless --all or --count")
|
|
591
|
+
.argument("[query]", "literal text to remove (or the memo ID when --lines/--address select the span)")
|
|
592
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
593
593
|
.option("--lines <a:b>", "remove source lines a..b (1-based, inclusive)")
|
|
594
594
|
.option("--address <id>", "remove the full original span of this mapped element (e.g. s1.p2)")
|
|
595
595
|
.option("--selector <css>", "scope the query to one HTML element")
|
|
@@ -599,7 +599,7 @@ export function registerNotesCommand(program) {
|
|
|
599
599
|
.option("--ind <n|n:m>", "remove a character range (0-based code points)")
|
|
600
600
|
.option("--count <n>", "require exactly this many matches")
|
|
601
601
|
.option("--all", "remove every match")
|
|
602
|
-
.option("--if-match <etag>", "quoted ETag from
|
|
602
|
+
.option("--if-match <etag>", "quoted ETag from memos read --legacy --json (not an rtc: revision)")
|
|
603
603
|
.option("--force", "retained legacy replacement without a precondition")
|
|
604
604
|
.option("--legacy", "use the retained ETag/body replacement delete")
|
|
605
605
|
.option("--base-revision <revision>", "target this original retained source snapshot")
|
|
@@ -607,13 +607,13 @@ export function registerNotesCommand(program) {
|
|
|
607
607
|
.option("--command-id <id>", "caller-stable id (8–128 chars of A-Za-z0-9._:-); a retry with the same id returns the same receipt")
|
|
608
608
|
.option("--dry-run", "print what would be written and stop")
|
|
609
609
|
.option("--json", "emit the new revision")
|
|
610
|
-
.option("--namespace <slug>", "whose
|
|
610
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
611
611
|
.action(async (query, opts) => { process.exitCode = await runNotesDelete(query, opts); });
|
|
612
612
|
strict(notes.command("command-status"))
|
|
613
|
-
.argument("<
|
|
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
|
-
.option("--namespace <slug>", "whose
|
|
616
|
+
.option("--namespace <slug>", "whose memos (default: selected CLI namespace, otherwise personal)")
|
|
617
617
|
.option("--json", "emit JSON")
|
|
618
618
|
.action(async (ref, commandId, opts) => { process.exitCode = await runNotesCommandStatus(ref, commandId, opts); });
|
|
619
619
|
strict(notes.command("select"))
|
|
@@ -623,9 +623,9 @@ export function registerNotesCommand(program) {
|
|
|
623
623
|
.option("--section <anchor>", "match only inside this section (requires --text)")
|
|
624
624
|
.option("-o, --occurrence <n>", "occurrence within scope: 1 is first, -1 is last, -2 is second-last")
|
|
625
625
|
.option("--hash <sha256>", "require this current source hash before publishing")
|
|
626
|
-
.option("--note <ref>", "the
|
|
626
|
+
.option("--note <ref>", "the memo: slug, id or exact title")
|
|
627
627
|
.option("--json", "emit the selection receipt, or CSS element with source revision")
|
|
628
|
-
.option("--namespace <slug>", "whose
|
|
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
631
|
process.exitCode = await runNotesTextSelect(css, opts);
|
|
@@ -635,12 +635,12 @@ export function registerNotesCommand(program) {
|
|
|
635
635
|
}
|
|
636
636
|
});
|
|
637
637
|
strict(notes.command("rm-section"))
|
|
638
|
-
.argument("<
|
|
638
|
+
.argument("<memo>", "memo id, slug or name")
|
|
639
639
|
.argument("<anchor>", "the section to remove, and everything under it")
|
|
640
640
|
.description("remove a section and everything under it")
|
|
641
|
-
.option("--if-match <etag>", "only remove if the
|
|
641
|
+
.option("--if-match <etag>", "only remove if the memo is still at this etag")
|
|
642
642
|
.option("--force", "remove without a precondition")
|
|
643
|
-
.option("--namespace <slug>", "whose
|
|
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
646
|
.action(async (ref, anchor, opts) => { process.exitCode = await runNotesRmSection(ref, anchor, opts); });
|
|
@@ -679,8 +679,8 @@ export async function runNotesList(opts) {
|
|
|
679
679
|
if (rows.length === 0) {
|
|
680
680
|
// Always name the effective namespace, including a persisted `su` selection.
|
|
681
681
|
process.stdout.write(opts.shared
|
|
682
|
-
? "no
|
|
683
|
-
: `no
|
|
682
|
+
? "no memos shared with you\n"
|
|
683
|
+
: `no memos in '${c.ns}'\n an organization's memos are in its own namespace — ` +
|
|
684
684
|
`'dreamlake org list' shows yours, then --namespace <slug>\n`);
|
|
685
685
|
return 0;
|
|
686
686
|
}
|
|
@@ -715,7 +715,7 @@ export async function runNotesSearch(query, opts) {
|
|
|
715
715
|
// Name both the query and the namespace: an empty result should read as
|
|
716
716
|
// "not in these notes", and the reader should be able to tell that the
|
|
717
717
|
// search was scoped somewhere they may not have meant.
|
|
718
|
-
process.stdout.write(`no
|
|
718
|
+
process.stdout.write(`no memo in '${c.ns}' has '${query}' in its title or body\n` +
|
|
719
719
|
` other namespaces are searched separately — 'dreamlake org list', then --namespace <slug>\n`);
|
|
720
720
|
return 0;
|
|
721
721
|
}
|
|
@@ -754,7 +754,7 @@ export async function runNotesSections(ref, opts) {
|
|
|
754
754
|
if (opts.json)
|
|
755
755
|
return emitJson(res), 0;
|
|
756
756
|
if (res.sections.length === 0) {
|
|
757
|
-
process.stdout.write("no sections — the
|
|
757
|
+
process.stdout.write("no sections — the memo is empty\n");
|
|
758
758
|
return 0;
|
|
759
759
|
}
|
|
760
760
|
process.stdout.write(renderTable(res.sections.map((s) => ({
|
|
@@ -773,13 +773,13 @@ export async function runNotesSections(ref, opts) {
|
|
|
773
773
|
async function runLegacyNotesRead(ref, opts) {
|
|
774
774
|
const target = ref ?? opts.note;
|
|
775
775
|
if (!target) {
|
|
776
|
-
fail("say which
|
|
776
|
+
fail("say which memo: a memo id, slug or name, or --note <ref>");
|
|
777
777
|
return 1;
|
|
778
778
|
}
|
|
779
779
|
if (ref && opts.note && ref !== opts.note) {
|
|
780
780
|
// Two different notes named in one command. Picking either would edit
|
|
781
781
|
// something the caller did not ask for.
|
|
782
|
-
fail(`two
|
|
782
|
+
fail(`two memos given: '${ref}' and --note '${opts.note}' — give one`);
|
|
783
783
|
return 1;
|
|
784
784
|
}
|
|
785
785
|
const c = await ctx(opts);
|
|
@@ -805,7 +805,7 @@ async function runLegacyNotesRead(ref, opts) {
|
|
|
805
805
|
// survived. Without the guard it reads whatever is there NOW, the check
|
|
806
806
|
// passes, and what it checked is somebody else's document.
|
|
807
807
|
if (opts.ifMatch && res.etag !== opts.ifMatch) {
|
|
808
|
-
fail(`
|
|
808
|
+
fail(`memo is at ${res.etag}, not ${opts.ifMatch} — it changed since that revision`);
|
|
809
809
|
return EXIT_STALE;
|
|
810
810
|
}
|
|
811
811
|
if (opts.json)
|
|
@@ -835,7 +835,7 @@ async function runLegacyNotesRead(ref, opts) {
|
|
|
835
835
|
// fragment and posts it back as the whole body.
|
|
836
836
|
if (res.truncated) {
|
|
837
837
|
const r = res;
|
|
838
|
-
process.stderr.write(`note: showing lines through ${r.endLine} of ${r.totalLines} — this is not the whole
|
|
838
|
+
process.stderr.write(`note: showing lines through ${r.endLine} of ${r.totalLines} — this is not the whole memo\n`);
|
|
839
839
|
}
|
|
840
840
|
return 0;
|
|
841
841
|
}
|
|
@@ -904,7 +904,7 @@ export async function runNotesWrite(ref, opts) {
|
|
|
904
904
|
if (!c)
|
|
905
905
|
return 1;
|
|
906
906
|
if (looksLikeDiff(text))
|
|
907
|
-
process.stderr.write("⚠ this looks like a unified diff — 'dreamlake
|
|
907
|
+
process.stderr.write("⚠ this looks like a unified diff — 'dreamlake memos patch' applies one; 'write' stores it as the body\n");
|
|
908
908
|
try {
|
|
909
909
|
const id = await resolveNote(c, ref);
|
|
910
910
|
if (!id)
|
|
@@ -951,7 +951,7 @@ async function runLegacyNotesWrite(ref, opts) {
|
|
|
951
951
|
//
|
|
952
952
|
// On stderr, and not through helpers' `warn`, which prints to stdout —
|
|
953
953
|
// that would land inside `--json` output and break anything parsing it.
|
|
954
|
-
process.stderr.write("⚠ this looks like a unified diff — 'dreamlake
|
|
954
|
+
process.stderr.write("⚠ this looks like a unified diff — 'dreamlake memos patch' applies one; " +
|
|
955
955
|
"'write' stores it as the body\n");
|
|
956
956
|
}
|
|
957
957
|
try {
|
|
@@ -986,7 +986,7 @@ async function runLegacyNotesWrite(ref, opts) {
|
|
|
986
986
|
async function runLegacyNotesDiff(ref, opts) {
|
|
987
987
|
const target = ref ?? opts.note;
|
|
988
988
|
if (!target || (ref && opts.note && ref !== opts.note)) {
|
|
989
|
-
fail("give one
|
|
989
|
+
fail("give one memo id, slug or name, either positionally or with --note");
|
|
990
990
|
return 1;
|
|
991
991
|
}
|
|
992
992
|
if (!opts.since || !/^(?:[a-f0-9]{64}|"[a-f0-9]{64}")$/.test(opts.since)) {
|
|
@@ -1395,7 +1395,7 @@ export async function runNotesVisit(ref, opts) {
|
|
|
1395
1395
|
export async function runNotesProjects(id, opts) {
|
|
1396
1396
|
try {
|
|
1397
1397
|
if (!/^[a-f0-9]{24}$/i.test(id) || !opts.namespace?.trim())
|
|
1398
|
-
throw new Error('Use a stable
|
|
1398
|
+
throw new Error('Use a stable Memo ID and an explicit --namespace (or --ns)');
|
|
1399
1399
|
const c = await ctx(opts);
|
|
1400
1400
|
if (!c)
|
|
1401
1401
|
return 1;
|