@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
|
@@ -160,7 +160,7 @@ export function insertAtElement(source, css, text, position) {
|
|
|
160
160
|
/** The note to act on. `--note` per the documented CLI shape. */
|
|
161
161
|
function requireNote(opts) {
|
|
162
162
|
if (!opts.note) {
|
|
163
|
-
fail("say which
|
|
163
|
+
fail("say which memo: --note <id-or-slug>");
|
|
164
164
|
return null;
|
|
165
165
|
}
|
|
166
166
|
return opts.note;
|
|
@@ -250,7 +250,7 @@ async function mutate(opts, apply) {
|
|
|
250
250
|
if (!ref)
|
|
251
251
|
return 1;
|
|
252
252
|
if (opts.ifMatch?.replace(/^W\//, '').replace(/^"|"$/g, '').startsWith('rtc:')) {
|
|
253
|
-
fail('This legacy edit requires the quoted ETag from
|
|
253
|
+
fail('This legacy edit requires the quoted ETag from memos read --legacy --json, not an rtc: revision. Preserve the draft and read the legacy baseline, or use memos patch --base-revision for a modern merge edit.');
|
|
254
254
|
return 1;
|
|
255
255
|
}
|
|
256
256
|
const c = await ctx(opts);
|
|
@@ -502,7 +502,7 @@ export async function runNotesInsert(noteOrOpts, maybeOpts) {
|
|
|
502
502
|
let opts = typeof noteOrOpts === "object" && noteOrOpts !== null ? noteOrOpts : (maybeOpts ?? {});
|
|
503
503
|
if (typeof noteOrOpts === "string") {
|
|
504
504
|
if (opts.note !== undefined && opts.note !== noteOrOpts) {
|
|
505
|
-
fail(`two
|
|
505
|
+
fail(`two memos given: '${noteOrOpts}' and --note '${opts.note}' — give one`);
|
|
506
506
|
return 1;
|
|
507
507
|
}
|
|
508
508
|
opts = { ...opts, note: noteOrOpts };
|
|
@@ -734,15 +734,15 @@ export async function runNotesGrep(query, opts) {
|
|
|
734
734
|
// because a bounded answer that looks complete is how "replace them all"
|
|
735
735
|
// quietly replaces some of them.
|
|
736
736
|
if (!hits.length)
|
|
737
|
-
process.stderr.write(`no matches in ${notesSearched}
|
|
737
|
+
process.stderr.write(`no matches in ${notesSearched} memos\n`);
|
|
738
738
|
if (truncated) {
|
|
739
|
-
process.stderr.write("note: a
|
|
739
|
+
process.stderr.write("note: a memo held more matches than were returned — narrow the query\n");
|
|
740
740
|
}
|
|
741
741
|
if (partial.size) {
|
|
742
|
-
process.stderr.write(`note: ${partial.size}
|
|
742
|
+
process.stderr.write(`note: ${partial.size} memo(s) too large to index in full; their tails were not searched\n`);
|
|
743
743
|
}
|
|
744
744
|
if (stale) {
|
|
745
|
-
process.stderr.write(`note: ${stale} open
|
|
745
|
+
process.stderr.write(`note: ${stale} open memo(s) could not be flushed first; their newest edits are missing\n`);
|
|
746
746
|
}
|
|
747
747
|
return 0;
|
|
748
748
|
}
|
|
@@ -29,7 +29,7 @@ function filesBase(c, id) {
|
|
|
29
29
|
/** Resolve the note every file command needs. */
|
|
30
30
|
async function target(opts) {
|
|
31
31
|
if (!opts.note) {
|
|
32
|
-
fail("say which
|
|
32
|
+
fail("say which memo: --note <id-or-slug>");
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
35
|
const c = await ctx(opts);
|
|
@@ -56,7 +56,7 @@ function reportFile(err, recovery) {
|
|
|
56
56
|
}
|
|
57
57
|
catch { }
|
|
58
58
|
if (operationId)
|
|
59
|
-
process.stderr.write(`operation ${operationId} — inspect with
|
|
59
|
+
process.stderr.write(`operation ${operationId} — inspect with memos files status ${operationId} --note ${recovery.note}${recovery.namespace ? ` --namespace ${JSON.stringify(recovery.namespace)}` : ""}\n`);
|
|
60
60
|
process.stderr.write("Do not resend attachment bytes after an uncertain result; inspect the original operation first.\n");
|
|
61
61
|
}
|
|
62
62
|
const status = err?.status;
|
|
@@ -301,7 +301,7 @@ export async function runFilesCat(ref, opts) {
|
|
|
301
301
|
// Refused here rather than at the server, so the reason names the local
|
|
302
302
|
// alternative instead of an HTTP status.
|
|
303
303
|
fail(`${row.path} is ${row.contentType}; printing it as text would corrupt it — ` +
|
|
304
|
-
"use '
|
|
304
|
+
"use 'memos files download' instead");
|
|
305
305
|
return EXIT_NO_FILE;
|
|
306
306
|
}
|
|
307
307
|
const res = await requestJson(t.c.remote, `${filesBase(t.c, t.id)}/${seg(row.id)}/text`, { token: t.c.token });
|
|
@@ -454,7 +454,7 @@ export async function runFilesRm(ref, opts) {
|
|
|
454
454
|
return emitJson(res), 0;
|
|
455
455
|
process.stdout.write(res.purged
|
|
456
456
|
? `✓ purged ${row.path} — the bytes are gone\n`
|
|
457
|
-
: `✓ trashed ${row.path} — restore with '
|
|
457
|
+
: `✓ trashed ${row.path} — restore with 'memos files restore ${row.id}'\n`);
|
|
458
458
|
return 0;
|
|
459
459
|
}
|
|
460
460
|
catch (e) {
|
|
@@ -495,7 +495,7 @@ export async function resolveFile(c, noteId, ref, opts = {}) {
|
|
|
495
495
|
catch (error) {
|
|
496
496
|
if (error.status !== 404)
|
|
497
497
|
throw error;
|
|
498
|
-
fail(/^[a-f0-9]{24}$/i.test(ref) ? `no file with id ${ref}` : `no file at '${ref}' — '
|
|
498
|
+
fail(/^[a-f0-9]{24}$/i.test(ref) ? `no file with id ${ref}` : `no file at '${ref}' — 'memos files list --note …' shows what is there`);
|
|
499
499
|
return null;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
@@ -534,7 +534,7 @@ export async function runFilesPreview(ref, opts) {
|
|
|
534
534
|
// said rather than left to be discovered by sending the wrong one.
|
|
535
535
|
process.stderr.write(res.kind === "shared"
|
|
536
536
|
? "shared link — opens without signing in, until you revoke it\n"
|
|
537
|
-
: "session link — whoever opens it must be signed in and able to read the
|
|
537
|
+
: "session link — whoever opens it must be signed in and able to read the memo\n");
|
|
538
538
|
if (opts.open) {
|
|
539
539
|
const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
540
540
|
const { spawn } = await import("node:child_process");
|
|
@@ -17,7 +17,7 @@ function attributeValue(value) {
|
|
|
17
17
|
export function validateHtmlSnapshot(html, note, scope = {}) {
|
|
18
18
|
const root = /^<!doctype html>\s*<html\b([^>]*)>/i.exec(html);
|
|
19
19
|
if (!root || !/<\/html>\s*$/i.test(html))
|
|
20
|
-
throw new Error("server did not return a complete
|
|
20
|
+
throw new Error("server did not return a complete Memos HTML snapshot");
|
|
21
21
|
const attributes = new Map();
|
|
22
22
|
const pattern = /\s+([a-zA-Z][a-zA-Z0-9-]*)="([^"]*)"/g;
|
|
23
23
|
let end = 0;
|
|
@@ -37,7 +37,7 @@ export function validateHtmlSnapshot(html, note, scope = {}) {
|
|
|
37
37
|
|| !/^sha256:[a-f0-9]{64}$/.test(hash ?? "") || source === undefined
|
|
38
38
|
|| attributes.get("data-offset-unit") !== "unicode-code-point"
|
|
39
39
|
|| !["markdown", "html"].includes(attributes.get("data-source-type") ?? "")) {
|
|
40
|
-
throw new Error("server did not return the
|
|
40
|
+
throw new Error("server did not return the Memos HTML metadata contract; upgrade the server");
|
|
41
41
|
}
|
|
42
42
|
const returnedScope = attributes.get("data-scope");
|
|
43
43
|
let sourceHash = hash;
|
|
@@ -78,7 +78,7 @@ export function annotatedMarkdown(html) {
|
|
|
78
78
|
const attrs = (raw) => new Map(Array.from(raw.matchAll(/\s+([a-zA-Z][a-zA-Z0-9-]*)="([^"]*)"/g), m => [m[1], attributeValue(m[2])]));
|
|
79
79
|
const root = attrs(/^<!doctype html>\s*<html\b([^>]*)>/i.exec(html)[1]);
|
|
80
80
|
if (root.get('data-source-type') !== 'markdown')
|
|
81
|
-
throw new Error('annotated Markdown requires a Markdown
|
|
81
|
+
throw new Error('annotated Markdown requires a Markdown memo; use --view html for HTML source');
|
|
82
82
|
const source = root.get('data-source');
|
|
83
83
|
const origin = Number(root.get('data-source-start') ?? 0);
|
|
84
84
|
const points = Array.from(source);
|