@dreamlake/dreamlake-cli 0.104.5 → 0.104.7
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/content.d.ts +6 -0
- package/dist/api/content.js +1 -0
- package/dist/api/index.d.ts +12 -0
- 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/artifact/index.js +6 -2
- package/dist/cli/artifact/rename.d.ts +9 -0
- package/dist/cli/artifact/rename.js +45 -0
- package/dist/cli/failure-report.js +3 -3
- package/dist/cli/help-examples.generated.js +38 -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/api/content.d.ts
CHANGED
|
@@ -17,6 +17,12 @@ export declare function artifactsApi(t: Transport, namespace: string): {
|
|
|
17
17
|
deleted?: boolean;
|
|
18
18
|
}) => Promise<unknown>;
|
|
19
19
|
get: (id: string) => Promise<unknown>;
|
|
20
|
+
rename: (id: string, input: {
|
|
21
|
+
slug: string;
|
|
22
|
+
expectedResourceId: string;
|
|
23
|
+
expectedSlug: string;
|
|
24
|
+
expectedRevision: number;
|
|
25
|
+
}) => Promise<unknown>;
|
|
20
26
|
uploadCredentials: (artifactId: string) => Promise<unknown>;
|
|
21
27
|
register: (id: string, input: {
|
|
22
28
|
kind: string;
|
package/dist/api/content.js
CHANGED
|
@@ -23,6 +23,7 @@ export function artifactsApi(t, namespace) {
|
|
|
23
23
|
}),
|
|
24
24
|
list: (query = {}) => call(t, "GET", base, undefined, query),
|
|
25
25
|
get: (id) => call(t, "GET", path(id)),
|
|
26
|
+
rename: (id, input) => call(t, "PATCH", path(id) + "/slug", input),
|
|
26
27
|
uploadCredentials: (artifactId) => call(t, "POST", base + "/upload-credentials", { artifactId }),
|
|
27
28
|
register: (id, input) => call(t, "POST", path(id), input),
|
|
28
29
|
delete: (id, permanent = false) => call(t, "DELETE", path(id) + (permanent ? "/purge" : "")),
|
package/dist/api/index.d.ts
CHANGED
|
@@ -773,6 +773,12 @@ export declare function createApi(transport: Transport): {
|
|
|
773
773
|
deleted?: boolean;
|
|
774
774
|
}) => Promise<unknown>;
|
|
775
775
|
get: (id: string) => Promise<unknown>;
|
|
776
|
+
rename: (id: string, input: {
|
|
777
|
+
slug: string;
|
|
778
|
+
expectedResourceId: string;
|
|
779
|
+
expectedSlug: string;
|
|
780
|
+
expectedRevision: number;
|
|
781
|
+
}) => Promise<unknown>;
|
|
776
782
|
uploadCredentials: (artifactId: string) => Promise<unknown>;
|
|
777
783
|
register: (id: string, input: {
|
|
778
784
|
kind: string;
|
|
@@ -1858,6 +1864,12 @@ export declare function createClient(options: ClientOptions): {
|
|
|
1858
1864
|
deleted?: boolean;
|
|
1859
1865
|
}) => Promise<unknown>;
|
|
1860
1866
|
get: (id: string) => Promise<unknown>;
|
|
1867
|
+
rename: (id: string, input: {
|
|
1868
|
+
slug: string;
|
|
1869
|
+
expectedResourceId: string;
|
|
1870
|
+
expectedSlug: string;
|
|
1871
|
+
expectedRevision: number;
|
|
1872
|
+
}) => Promise<unknown>;
|
|
1861
1873
|
uploadCredentials: (artifactId: string) => Promise<unknown>;
|
|
1862
1874
|
register: (id: string, input: {
|
|
1863
1875
|
kind: string;
|
package/dist/api/note-events.js
CHANGED
|
@@ -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('
|
|
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
|
|
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('
|
|
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('
|
|
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('
|
|
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(`
|
|
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
|
|
45
|
+
throw new Error('invalid Memos event response');
|
|
46
46
|
receive(event);
|
|
47
47
|
}
|
|
48
48
|
}
|
package/dist/api/note-facade.js
CHANGED
|
@@ -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(`
|
|
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(`
|
|
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(`
|
|
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
|
|
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
|
|
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("
|
|
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("
|
|
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
|
|
308
|
+
throw new Error("invalid incremental Memos v2 response");
|
|
309
309
|
return result;
|
|
310
310
|
});
|
|
311
311
|
},
|
package/dist/api/note-linger.js
CHANGED
|
@@ -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('
|
|
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
|
|
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('
|
|
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
|
|
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
|
|
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;
|
package/dist/api/note-reading.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
}
|
package/dist/api/note-write.js
CHANGED
|
@@ -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" ? "
|
|
45
|
-
: reason === "server" ? `
|
|
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
|
-
: "
|
|
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
|
|
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 (
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,
|
package/dist/cli/agents/index.js
CHANGED
|
@@ -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("
|
|
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("
|
|
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
|
|
544
|
-
.option("--skill-note <id>", "optional skill
|
|
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")
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { registerArtifactRenameCommand } from "./rename.js";
|
|
1
2
|
import { readSiteConfig } from './siteConfig.js';
|
|
2
3
|
import { collectionList } from "../collection-list.js";
|
|
3
4
|
import { registerShareCommands } from "../share.js";
|
|
@@ -132,7 +133,7 @@ export async function runDreamlakeArtifactPush(args, deps = {}) {
|
|
|
132
133
|
const defaultTitle = directory
|
|
133
134
|
? path.basename(path.resolve(args.file))
|
|
134
135
|
: path.basename(args.file, path.extname(args.file));
|
|
135
|
-
|
|
136
|
+
let artifactId = args.artifactId ?? slugify(args.title ?? defaultTitle);
|
|
136
137
|
// Read the cover before any network call so a bad file fails fast.
|
|
137
138
|
let coverBytes = null;
|
|
138
139
|
if (args.cover) {
|
|
@@ -187,12 +188,14 @@ export async function runDreamlakeArtifactPush(args, deps = {}) {
|
|
|
187
188
|
}
|
|
188
189
|
// 1) broker: short-lived, prefix-scoped credentials + this artifact's own
|
|
189
190
|
// dataset backend. The content itself never goes through the server.
|
|
190
|
-
const cred = await jsonRequest("POST", `${ctx.remote}/namespaces/${encodeURIComponent(namespace)}/artifacts/upload-credentials`, token, { artifactId });
|
|
191
|
+
const cred = await jsonRequest("POST", `${ctx.remote}/namespaces/${encodeURIComponent(namespace)}/artifacts/upload-credentials`, token, { artifactId, resolveSlug: true });
|
|
191
192
|
if (cred.status < 200 || cred.status >= 300) {
|
|
192
193
|
fail(`could not get upload credentials → ${cred.status}: ${errorMessage(cred)}`);
|
|
193
194
|
return 1;
|
|
194
195
|
}
|
|
195
196
|
const broker = cred.body;
|
|
197
|
+
if (typeof cred.body?.artifactId === "string")
|
|
198
|
+
artifactId = cred.body.artifactId;
|
|
196
199
|
if (!broker?.credentials?.accessKeyId || !broker.backendUrl) {
|
|
197
200
|
fail("unexpected upload-credentials response (missing credentials or backendUrl)");
|
|
198
201
|
return 1;
|
|
@@ -408,6 +411,7 @@ export function registerArtifactCommand(program) {
|
|
|
408
411
|
.command("artifact")
|
|
409
412
|
.description("renderable artifacts (HTML/React/Markdown/SVG/code)");
|
|
410
413
|
registerShareCommands(artifact, "artifact");
|
|
414
|
+
registerArtifactRenameCommand(artifact);
|
|
411
415
|
withConnFlags(artifact
|
|
412
416
|
.command("push")
|
|
413
417
|
.description("push a renderable artifact — a new version of --id (written straight to storage)")
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import { type DreamlakeOpts } from '../compat/ctx.js';
|
|
3
|
+
export declare function runArtifactRename(args: DreamlakeOpts & {
|
|
4
|
+
artifactId: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
namespace?: string;
|
|
7
|
+
json?: boolean;
|
|
8
|
+
}): Promise<number>;
|
|
9
|
+
export declare function registerArtifactRenameCommand(artifact: Command): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { emitJson, fail, ok } from '../helpers.js';
|
|
2
|
+
import { resolveCtx } from '../compat/ctx.js';
|
|
3
|
+
import { errorMessage, jsonRequest, requireNamespace, requireToken } from '../compat/http.js';
|
|
4
|
+
import { withConnFlags } from '../compat/flags.js';
|
|
5
|
+
export async function runArtifactRename(args) {
|
|
6
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$/.test(args.slug)) {
|
|
7
|
+
fail('Invalid slug: use 1–128 letters, digits, dots, underscores or hyphens, starting with a letter or digit.');
|
|
8
|
+
return 1;
|
|
9
|
+
}
|
|
10
|
+
const ctx = resolveCtx(args), token = requireToken(ctx);
|
|
11
|
+
if (!token)
|
|
12
|
+
return 1;
|
|
13
|
+
const namespace = await requireNamespace(ctx, args.namespace);
|
|
14
|
+
if (!namespace)
|
|
15
|
+
return 1;
|
|
16
|
+
const url = `${ctx.remote}/namespaces/${encodeURIComponent(namespace)}/artifacts/${encodeURIComponent(args.artifactId)}`;
|
|
17
|
+
const current = await jsonRequest('GET', url, token);
|
|
18
|
+
if (current.status !== 200) {
|
|
19
|
+
fail(`Could not read artifact → ${current.status}: ${errorMessage(current)}`);
|
|
20
|
+
return 1;
|
|
21
|
+
}
|
|
22
|
+
const row = current.body;
|
|
23
|
+
if (!row.resourceId || !row.slug || !Number.isSafeInteger(row.slugRevision)) {
|
|
24
|
+
fail('This server does not support native artifact slug rename. No changes made.');
|
|
25
|
+
return 1;
|
|
26
|
+
}
|
|
27
|
+
const response = await jsonRequest('PATCH', `${url}/slug`, token, {
|
|
28
|
+
slug: args.slug, expectedResourceId: row.resourceId, expectedSlug: row.slug, expectedRevision: row.slugRevision,
|
|
29
|
+
});
|
|
30
|
+
if (response.status !== 200) {
|
|
31
|
+
fail(`Rename failed → ${response.status}: ${errorMessage(response)}${response.status === 409 ? '. Re-read the artifact and resolve the conflict before retrying.' : ''}`);
|
|
32
|
+
return 1;
|
|
33
|
+
}
|
|
34
|
+
if (args.json)
|
|
35
|
+
emitJson(response.body);
|
|
36
|
+
else
|
|
37
|
+
ok(`artifact slug: ${args.slug} (existing links and all versions preserved)`);
|
|
38
|
+
return 0;
|
|
39
|
+
}
|
|
40
|
+
export function registerArtifactRenameCommand(artifact) {
|
|
41
|
+
withConnFlags(artifact.command('rename').description('change an artifact URL slug, preserving identity, versions and old links')
|
|
42
|
+
.argument('<artifact-id>', 'current slug, old slug or immutable artifact ID')
|
|
43
|
+
.argument('<slug>', 'new URL slug').option('--namespace <slug>', 'namespace').option('--json', 'JSON output'))
|
|
44
|
+
.action(async (artifactId, slug, opts) => { process.exit(await runArtifactRename({ ...opts, artifactId, slug })); });
|
|
45
|
+
}
|
|
@@ -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
|
|
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
|
|
8
|
-
NOTE_METADATA_PRIVATE_REQUIRED: 'This transfer currently supports private
|
|
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. */
|
|
@@ -9,6 +9,7 @@ export const helpExamples = {
|
|
|
9
9
|
"artifact meta set": "# At push time:\ndreamlake artifact push ./report.html --id q1-dashboard \\\n --description \"Revenue, churn and pipeline for the quarter\" \\\n --cover ./cover.png\n\n# Or after the fact, for an artifact that already exists:\ndreamlake artifact meta set q1-dashboard --description \"Revenue, churn and pipeline\"\ndreamlake artifact meta set q1-dashboard --cover ./cover.png\ndreamlake artifact meta show q1-dashboard\n\n# Back to the automatic description / the generated cover:\ndreamlake artifact meta set q1-dashboard --clear-description --clear-cover",
|
|
10
10
|
"artifact share": "# Find the dashboard you already uploaded; no new version is needed.\ndreamlake artifact list\nARTIFACT=\"q1-dashboard\" # Replace with the id from list.\ndreamlake artifact share get \"$ARTIFACT\"\n\n# Give signed-in recipients read access, then verify the returned link.\ndreamlake artifact share create \"$ARTIFACT\"\ndreamlake artifact share get \"$ARTIFACT\"\n\n# When link access is no longer needed, revoke it and verify.\ndreamlake artifact share revoke \"$ARTIFACT\"\ndreamlake artifact share get \"$ARTIFACT\"",
|
|
11
11
|
"artifact visibility": "ARTIFACT=\"q1-dashboard\" # Your existing artifact id.\ndreamlake artifact visibility \"$ARTIFACT\" public\ndreamlake artifact visibility \"$ARTIFACT\" private",
|
|
12
|
+
"artifact rename": "dreamlake artifact rename session-work-map-20261014 session-work-map --namespace my-team",
|
|
12
13
|
"runnable bind": "dreamlake runnable bind udf/acme/recipes.process@FULL_SHA256 \\\n --snapshot CODE_REPO_ID --project recipes \\\n --server \"$LAKESHORE_URL\" --cp-namespace acme --dry-run\ndreamlake runnable bind udf/acme/recipes.process@FULL_SHA256 \\\n --snapshot CODE_REPO_ID --project recipes --server \"$LAKESHORE_URL\" --cp-namespace acme",
|
|
13
14
|
"runnable execute": "dreamlake runnable execute exec/acme/recipes.process@EXECUTION_DIGEST \\\n --queue cpu --inputs record.json --timeout-seconds 600 --json\ndreamlake runnable execute exec/acme/recipes.process@EXECUTION_DIGEST \\\n --queue cpu --inputs record.json --timeout-seconds 600 --attempt 2 --json",
|
|
14
15
|
"runnable execution-receipt": "dreamlake runnable execution-receipt exec/acme/recipes.process@EXECUTION_DIGEST \\\n --queue cpu --inputs record.json --timeout-seconds 600 --wait-seconds 30",
|
|
@@ -79,46 +80,46 @@ export const helpExamples = {
|
|
|
79
80
|
"layout apply": "dreamlake layout apply request.json --cdp http://127.0.0.1:9222 --page PAGE_ID --layout LAYOUT_ID",
|
|
80
81
|
"machine": "dreamlake machine self\ndreamlake machine host 0123456789abcdef01234567\ndreamlake machine project 0123456789abcdef01234567",
|
|
81
82
|
"auth identity": "dreamlake auth identity\ndreamlake --identity machine profile\ndreamlake --identity user profile",
|
|
82
|
-
"
|
|
83
|
-
"
|
|
83
|
+
"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",
|
|
84
|
+
"memos unarchive": "dreamlake memos unarchive NOTE_ID --json\n# Archived titles and slugs remain resolvable.\ndreamlake memos unarchive release-plan --namespace acme",
|
|
84
85
|
"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
86
|
"folders archive": "dreamlake folders archive FOLDER_ID --json",
|
|
86
87
|
"folders unarchive": "dreamlake folders unarchive FOLDER_ID --json",
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
88
|
+
"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",
|
|
89
|
+
"memos media upload": "dreamlake memos media upload ./diagram.png\nIMAGE_URL=$(dreamlake memos media upload ./diagram.png)",
|
|
90
|
+
"memos files write": "dreamlake memos files write config.json --text '{\"enabled\":true}' --note \"$NOTE_ID\" --idempotency-key config-initial-1",
|
|
91
|
+
"memos files cp": "dreamlake memos files cp config.json config-copy.json --note \"$NOTE_ID\" --idempotency-key config-copy-1",
|
|
92
|
+
"memos files status": "# OPERATION_ID is the ID from the original response.\ndreamlake memos files status \"$OPERATION_ID\" --note \"$NOTE_ID\" --json",
|
|
93
|
+
"memos files reconcile": "dreamlake memos files reconcile \"$OPERATION_ID\" --note \"$NOTE_ID\" --json",
|
|
94
|
+
"memos files cancel": "dreamlake memos files cancel \"$OPERATION_ID\" --note \"$NOTE_ID\" --json",
|
|
95
|
+
"memos visit": "# Reuse the task's DREAMLAKE_AGENT_ID and DREAMLAKE_AGENT_NAME.\nNOTE_ID=release-plan\ndreamlake memos visit \"$NOTE_ID\"",
|
|
96
|
+
"memos presence": "# Read the participant roster without joining. Text is the default.\nNOTE_ID=release-plan\ndreamlake memos presence \"$NOTE_ID\"",
|
|
97
|
+
"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",
|
|
98
|
+
"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",
|
|
99
|
+
"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",
|
|
100
|
+
"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.",
|
|
101
|
+
"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\"",
|
|
102
|
+
"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\"",
|
|
103
|
+
"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\"",
|
|
104
|
+
"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\"",
|
|
105
|
+
"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/",
|
|
106
|
+
"memos list": "dreamlake memos list --limit 10\ndreamlake memos list --shared\ndreamlake memos list --namespace acme\ndreamlake memos list --include-archived",
|
|
107
|
+
"memos search": "dreamlake memos search \"release plan\"\ndreamlake memos search deploy --namespace acme --json\ndreamlake memos search deploy --include-archived",
|
|
108
|
+
"memos create": "dreamlake memos create \"Release plan\" --text \"Draft checklist\"\nprintf '# Release plan\\n' | dreamlake memos create \"Release plan\" --file - --json",
|
|
109
|
+
"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",
|
|
110
|
+
"memos projects": "dreamlake memos projects 000000000000000000000001 --namespace acme",
|
|
111
|
+
"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",
|
|
112
|
+
"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",
|
|
113
|
+
"memos sections": "dreamlake memos sections release-plan\ndreamlake memos sections release-plan --json",
|
|
114
|
+
"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\"",
|
|
115
|
+
"memos visibility": "NOTE=\"release-plan\" # Your existing note id or slug.\ndreamlake memos visibility \"$NOTE\" public\ndreamlake memos visibility \"$NOTE\" private",
|
|
116
|
+
"memos share revoke": "NOTE=\"release-plan\" # Your existing note id or slug.\ndreamlake memos share revoke \"$NOTE\" --revoke-accepted",
|
|
117
|
+
"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\"",
|
|
118
|
+
"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\"",
|
|
119
|
+
"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",
|
|
120
|
+
"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",
|
|
121
|
+
"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",
|
|
122
|
+
"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
123
|
"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
124
|
"ownership capabilities": "dreamlake ownership capabilities --namespace acme",
|
|
124
125
|
"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,
|
|
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;
|