@dreamlake/dreamlake-cli 0.104.4 → 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/http.d.ts +3 -3
- package/dist/api/http.js +22 -7
- 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/client.js +7 -3
- package/dist/cli/compat/http.js +4 -0
- package/dist/cli/failure-report.d.ts +6 -0
- package/dist/cli/failure-report.js +34 -0
- 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 +30 -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 +7 -3
- 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/telemetry.d.ts +12 -0
- package/dist/cli/telemetry.js +34 -2
- 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/http.d.ts
CHANGED
|
@@ -3,8 +3,7 @@ export declare class HttpError extends Error {
|
|
|
3
3
|
status: number;
|
|
4
4
|
body: string;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* shape.
|
|
6
|
+
* Typed fields from nested v1 or flat API error envelopes.
|
|
8
7
|
*
|
|
9
8
|
* Kept as fields rather than folded into the message because they are what a
|
|
10
9
|
* caller BRANCHES on. `code` is the stable identity of a failure — the
|
|
@@ -13,13 +12,14 @@ export declare class HttpError extends Error {
|
|
|
13
12
|
* help", which no client can derive from a status alone: a 503 from a rate
|
|
14
13
|
* limiter and a 503 from a misconfigured binding look the same on the wire.
|
|
15
14
|
*
|
|
16
|
-
* `undefined` means "this
|
|
15
|
+
* `undefined` means "this field was not provided", never "the server
|
|
17
16
|
* said no". A caller that must fail closed has to treat undefined as
|
|
18
17
|
* unknown rather than as false.
|
|
19
18
|
*/
|
|
20
19
|
code?: string;
|
|
21
20
|
retryable?: boolean;
|
|
22
21
|
requestId?: string;
|
|
22
|
+
details?: Record<string, unknown>;
|
|
23
23
|
constructor(status: number, body: string);
|
|
24
24
|
/**
|
|
25
25
|
* Pull a human message, and any typed fields, out of an error body.
|
package/dist/api/http.js
CHANGED
|
@@ -5,8 +5,7 @@ export class HttpError extends Error {
|
|
|
5
5
|
status;
|
|
6
6
|
body;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* shape.
|
|
8
|
+
* Typed fields from nested v1 or flat API error envelopes.
|
|
10
9
|
*
|
|
11
10
|
* Kept as fields rather than folded into the message because they are what a
|
|
12
11
|
* caller BRANCHES on. `code` is the stable identity of a failure — the
|
|
@@ -15,13 +14,14 @@ export class HttpError extends Error {
|
|
|
15
14
|
* help", which no client can derive from a status alone: a 503 from a rate
|
|
16
15
|
* limiter and a 503 from a misconfigured binding look the same on the wire.
|
|
17
16
|
*
|
|
18
|
-
* `undefined` means "this
|
|
17
|
+
* `undefined` means "this field was not provided", never "the server
|
|
19
18
|
* said no". A caller that must fail closed has to treat undefined as
|
|
20
19
|
* unknown rather than as false.
|
|
21
20
|
*/
|
|
22
21
|
code;
|
|
23
22
|
retryable;
|
|
24
23
|
requestId;
|
|
24
|
+
details;
|
|
25
25
|
constructor(status, body) {
|
|
26
26
|
const parsed = HttpError.parse(body);
|
|
27
27
|
super(`(${status}) ${parsed.message}`);
|
|
@@ -31,6 +31,7 @@ export class HttpError extends Error {
|
|
|
31
31
|
this.code = parsed.code;
|
|
32
32
|
this.retryable = parsed.retryable;
|
|
33
33
|
this.requestId = parsed.requestId;
|
|
34
|
+
this.details = parsed.details;
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
37
|
* Pull a human message, and any typed fields, out of an error body.
|
|
@@ -69,20 +70,34 @@ export class HttpError extends Error {
|
|
|
69
70
|
out.retryable = e.retryable;
|
|
70
71
|
if (typeof e.requestId === "string")
|
|
71
72
|
out.requestId = e.requestId;
|
|
73
|
+
if (e.details && typeof e.details === 'object' && !Array.isArray(e.details))
|
|
74
|
+
out.details = e.details;
|
|
72
75
|
return out;
|
|
73
76
|
}
|
|
74
77
|
// Email-allowlist rejections put the human text in `message`
|
|
75
78
|
// (`error` is just "Forbidden").
|
|
76
79
|
if (parsed.code === "email_domain_not_allowed" && parsed.message) {
|
|
77
|
-
return { message: parsed.message };
|
|
80
|
+
return { message: parsed.message, code: parsed.code };
|
|
78
81
|
}
|
|
82
|
+
// Legacy routes also carry stable codes. Do not mistake a human sentence
|
|
83
|
+
// in `error` for a code, and never infer retryability from an HTTP status.
|
|
84
|
+
const code = typeof parsed.code === 'string' ? parsed.code
|
|
85
|
+
: typeof parsed.error === 'string' && /^[A-Za-z][A-Za-z0-9]*(?:_[A-Za-z0-9]+)+$/.test(parsed.error) ? parsed.error : undefined;
|
|
86
|
+
const fields = {
|
|
87
|
+
...(code ? { code } : {}),
|
|
88
|
+
...(typeof parsed.retryable === 'boolean' ? { retryable: parsed.retryable } : {}),
|
|
89
|
+
...(typeof parsed.requestId === 'string' ? { requestId: parsed.requestId } : {}),
|
|
90
|
+
...(parsed.details && typeof parsed.details === 'object' && !Array.isArray(parsed.details) ? { details: parsed.details } : {}),
|
|
91
|
+
};
|
|
79
92
|
if (typeof parsed.error === "string" && parsed.error) {
|
|
80
93
|
const detail = typeof parsed.message === "string" && parsed.message && parsed.message !== parsed.error
|
|
81
94
|
? `: ${parsed.message}` : "";
|
|
82
|
-
return { message: parsed.error + detail };
|
|
95
|
+
return { message: parsed.error + detail, ...fields };
|
|
83
96
|
}
|
|
84
|
-
if (parsed.message)
|
|
85
|
-
return { message: parsed.message };
|
|
97
|
+
if (typeof parsed.message === 'string' && parsed.message)
|
|
98
|
+
return { message: parsed.message, ...fields };
|
|
99
|
+
if (code)
|
|
100
|
+
return { message: code, ...fields };
|
|
86
101
|
}
|
|
87
102
|
catch {
|
|
88
103
|
// not JSON
|
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")
|
package/dist/cli/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { telemetryHeaders } from './telemetry.js';
|
|
1
|
+
import { telemetryHeaders, recordHttpFailure } from './telemetry.js';
|
|
2
2
|
import { noteAgentHeaders, resourceSessionHeaders } from "./agent-identity.js";
|
|
3
3
|
import { affiliateSuccessfulWrite } from './session-affiliation.js';
|
|
4
4
|
// Thin fetch wrapper for dreamlake-server and BSS. Zero-dependency —
|
|
@@ -74,7 +74,9 @@ export async function requestJson(base, path, opts = {}) {
|
|
|
74
74
|
catch { }
|
|
75
75
|
if (!res.ok) {
|
|
76
76
|
const body = await res.text().catch(() => "");
|
|
77
|
-
|
|
77
|
+
const error = new HttpError(res.status, body);
|
|
78
|
+
recordHttpFailure(error.status, error.code);
|
|
79
|
+
throw error;
|
|
78
80
|
}
|
|
79
81
|
const text = await res.text();
|
|
80
82
|
if (!text)
|
|
@@ -123,7 +125,9 @@ export async function requestRaw(url, opts = {}) {
|
|
|
123
125
|
}
|
|
124
126
|
if (!res.ok) {
|
|
125
127
|
const body = await res.text().catch(() => "");
|
|
126
|
-
|
|
128
|
+
const error = new HttpError(res.status, body);
|
|
129
|
+
recordHttpFailure(error.status, error.code);
|
|
130
|
+
throw error;
|
|
127
131
|
}
|
|
128
132
|
return res;
|
|
129
133
|
}
|
package/dist/cli/compat/http.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
// upgrades to an Error with the server's message when the caller
|
|
6
6
|
// doesn't need the status.
|
|
7
7
|
import { fail } from "../helpers.js";
|
|
8
|
+
import { HttpError } from '../../api/http.js';
|
|
9
|
+
import { recordHttpFailure } from '../telemetry.js';
|
|
8
10
|
import { affiliateSuccessfulWrite } from '../session-affiliation.js';
|
|
9
11
|
import { noteAgentHeaders, resourceSessionHeaders } from '../agent-identity.js';
|
|
10
12
|
import { resolveNamespace } from "./ctx.js";
|
|
@@ -52,6 +54,8 @@ export async function jsonRequest(method, url, token, body) {
|
|
|
52
54
|
catch {
|
|
53
55
|
/* leave raw text */
|
|
54
56
|
}
|
|
57
|
+
if (!res.ok)
|
|
58
|
+
recordHttpFailure(res.status, new HttpError(res.status, text).code);
|
|
55
59
|
if (res.ok)
|
|
56
60
|
await affiliateSuccessfulWrite(url, method, token, parsed, body);
|
|
57
61
|
return { status: res.status, body: parsed };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Report a failure without losing its machine-readable identity or claiming an
|
|
2
|
+
* uncertain write did not happen. Never include the raw response or arguments. */
|
|
3
|
+
export declare function reportCommandFailure(error: unknown, options: {
|
|
4
|
+
json?: boolean;
|
|
5
|
+
attempted: boolean;
|
|
6
|
+
}): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { recordOperationFailure } from './telemetry.js';
|
|
2
|
+
import { HttpError } from '../api/http.js';
|
|
3
|
+
import { emitJson, fail } from './helpers.js';
|
|
4
|
+
const guidance = {
|
|
5
|
+
NOTE_TRANSFER_UNAVAILABLE: 'This move crosses workspaces. Preview the separate memos transfer workflow; ordinary memos move only files within the current workspace.',
|
|
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 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
|
+
};
|
|
10
|
+
/** Report a failure without losing its machine-readable identity or claiming an
|
|
11
|
+
* uncertain write did not happen. Never include the raw response or arguments. */
|
|
12
|
+
export function reportCommandFailure(error, options) {
|
|
13
|
+
const http = error instanceof HttpError ? error : undefined;
|
|
14
|
+
const code = http?.code ?? 'command_failed';
|
|
15
|
+
recordOperationFailure(code, options.attempted && (!http || http.status >= 500) ? 'uncertain' : 'failed');
|
|
16
|
+
const nextAction = options.attempted
|
|
17
|
+
? 'Inspect the exact saved request and operation before resubmitting; no mutation was retried.'
|
|
18
|
+
: guidance[code];
|
|
19
|
+
const message = error instanceof Error ? error.message : 'Command failed';
|
|
20
|
+
const reason = http?.details?.reason;
|
|
21
|
+
const safeReason = typeof reason === 'string' && ['grant_inventory_limit', 'team_project_grant', 'invalid_project_grant', 'service_account_project_grant'].includes(reason) ? reason : undefined;
|
|
22
|
+
if (options.json)
|
|
23
|
+
emitJson({ ok: false, error: {
|
|
24
|
+
code, message, ...(http ? { status: http.status } : {}),
|
|
25
|
+
...(http?.retryable === undefined ? {} : { retryable: http.retryable }),
|
|
26
|
+
...(http?.requestId ? { requestId: http.requestId } : {}),
|
|
27
|
+
...(safeReason ? { reason: safeReason } : {}),
|
|
28
|
+
// This is dispatch state, not a claim about whether a remote write committed.
|
|
29
|
+
submissionAttempted: options.attempted,
|
|
30
|
+
...(nextAction ? { nextAction } : {}),
|
|
31
|
+
} });
|
|
32
|
+
else
|
|
33
|
+
fail(`${message}${nextAction ? `\n${nextAction}` : ''}`);
|
|
34
|
+
}
|
|
@@ -79,46 +79,46 @@ export const helpExamples = {
|
|
|
79
79
|
"layout apply": "dreamlake layout apply request.json --cdp http://127.0.0.1:9222 --page PAGE_ID --layout LAYOUT_ID",
|
|
80
80
|
"machine": "dreamlake machine self\ndreamlake machine host 0123456789abcdef01234567\ndreamlake machine project 0123456789abcdef01234567",
|
|
81
81
|
"auth identity": "dreamlake auth identity\ndreamlake --identity machine profile\ndreamlake --identity user profile",
|
|
82
|
-
"
|
|
83
|
-
"
|
|
82
|
+
"memos archive": "dreamlake memos archive NOTE_ID --json\n# With a slug or exact title, select its owning namespace.\ndreamlake memos archive release-plan --namespace acme",
|
|
83
|
+
"memos unarchive": "dreamlake memos unarchive NOTE_ID --json\n# Archived titles and slugs remain resolvable.\ndreamlake memos unarchive release-plan --namespace acme",
|
|
84
84
|
"folders list": "# List immediate contents at a project root or inside a folder.\ndreamlake folders list --project project-slug --namespace acme --include-archived --json\ndreamlake folders list --parent-id FOLDER_ID --include-archived --page 1 --page-size 50",
|
|
85
85
|
"folders archive": "dreamlake folders archive FOLDER_ID --json",
|
|
86
86
|
"folders unarchive": "dreamlake folders unarchive FOLDER_ID --json",
|
|
87
|
-
"
|
|
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
|
-
"
|
|
87
|
+
"memos files list": "dreamlake memos files list --note release-plan\ndreamlake memos files list 'assets/*.png' --note release-plan --limit 50\ndreamlake memos files list --note release-plan --json",
|
|
88
|
+
"memos media upload": "dreamlake memos media upload ./diagram.png\nIMAGE_URL=$(dreamlake memos media upload ./diagram.png)",
|
|
89
|
+
"memos files write": "dreamlake memos files write config.json --text '{\"enabled\":true}' --note \"$NOTE_ID\" --idempotency-key config-initial-1",
|
|
90
|
+
"memos files cp": "dreamlake memos files cp config.json config-copy.json --note \"$NOTE_ID\" --idempotency-key config-copy-1",
|
|
91
|
+
"memos files status": "# OPERATION_ID is the ID from the original response.\ndreamlake memos files status \"$OPERATION_ID\" --note \"$NOTE_ID\" --json",
|
|
92
|
+
"memos files reconcile": "dreamlake memos files reconcile \"$OPERATION_ID\" --note \"$NOTE_ID\" --json",
|
|
93
|
+
"memos files cancel": "dreamlake memos files cancel \"$OPERATION_ID\" --note \"$NOTE_ID\" --json",
|
|
94
|
+
"memos visit": "# Reuse the task's DREAMLAKE_AGENT_ID and DREAMLAKE_AGENT_NAME.\nNOTE_ID=release-plan\ndreamlake memos visit \"$NOTE_ID\"",
|
|
95
|
+
"memos presence": "# Read the participant roster without joining. Text is the default.\nNOTE_ID=release-plan\ndreamlake memos presence \"$NOTE_ID\"",
|
|
96
|
+
"memos select": "export DREAMLAKE_AGENT_ID=\"review-session-42\"\nexport DREAMLAKE_AGENT_NAME=\"Codex\"\nNOTE_ID=\"your-note-id\"\ndreamlake memos select --text \"The next step is tested in simulation.\" --note \"$NOTE_ID\"\n# Select the last occurrence of a repeated passage.\ndreamlake memos select --text \"simulation\" --note \"$NOTE_ID\" -o -1",
|
|
97
|
+
"memos contributors": "dreamlake memos contributors release-plan --namespace geyang --json\n# If hasMore is true, continue with the returned nextCursor:\ndreamlake memos contributors release-plan --namespace geyang --cursor LINK_CURSOR --json",
|
|
98
|
+
"memos rm": "# Read it first and confirm it is the note you mean.\ndreamlake memos read NOTE_ID\n# Asks for confirmation, showing the title and owning namespace.\ndreamlake memos rm NOTE_ID\n# Scripts and agents: skip the prompt and take a JSON receipt.\ndreamlake memos rm NOTE_ID --yes --json\n# Afterwards a read reports not found.\ndreamlake memos read NOTE_ID",
|
|
99
|
+
"memos patch": "set -euo pipefail\ndreamlake memos create \"Patch tutorial\" --text 'Hello world.' > created.txt\nNOTE_ID=$(sed -n 's/^ id //p' created.txt)\ndreamlake memos read \"$NOTE_ID\" --view source --json > baseline.json\n# A plain text read is the mapped reading view and --view source is bytes only;\n# --json is the structured snapshot with note, hash and revision.\nBASE=$(jq -er .revision baseline.json)\ndreamlake memos patch \"$NOTE_ID\" --file - --base-revision \"$BASE\" --json > receipt.json <<'PATCH'\n@@ chars 0:12 @@\n~ Hello [-world-]{+team+}.\nPATCH\nACK=$(jq -er .revision receipt.json)\ndreamlake memos read \"$NOTE_ID\" --if-match \"$ACK\"\n# Expect Hello team. Inspect the result; do not repeat a successful patch.",
|
|
100
|
+
"memos append": "dreamlake memos append \"$NOTE_ID\" --file addition.md --base-revision \"$BASE\" --json\n# ACK is the revision in the successful append receipt.\ndreamlake memos read \"$NOTE_ID\" --at \"$ACK\"",
|
|
101
|
+
"memos insert": "dreamlake memos insert --note \"$NOTE_ID\" --ind 0 --text 'Review: ' \\\n --base-revision \"$BASE\" --json\n# ACK is the revision returned by the insertion receipt.\ndreamlake memos read \"$NOTE_ID\" --at \"$ACK\"",
|
|
102
|
+
"memos delete": "dreamlake memos delete 'obsolete paragraph' --note \"$NOTE_ID\" \\\n --base-revision \"$BASE\" --json\n# Pin verification to the receipt's acknowledged revision.\ndreamlake memos read \"$NOTE_ID\" --at \"$ACK\"",
|
|
103
|
+
"memos write": "dreamlake memos read \"$NOTE_ID\" --json > baseline.json\nBASE=$(jq -er .revision baseline.json)\njq -jr .content baseline.json > draft.md\n# Edit draft.md without changing the saved original baseline.\ndreamlake memos write \"$NOTE_ID\" --file draft.md --base-revision \"$BASE\" --json\n# ACK is the successful write receipt's revision.\ndreamlake memos read \"$NOTE_ID\" --at \"$ACK\"",
|
|
104
|
+
"memos": "# Find a note and read it directly.\ndreamlake memos search \"release plan\"\ndreamlake memos read release-plan\n\n# Preview a unique wording change, apply it, then read back.\ndreamlake memos replace \"Draft checklist\" --text \"Ready for review\" --note release-plan --dry-run\ndreamlake memos replace \"Draft checklist\" --text \"Ready for review\" --note release-plan\ndreamlake memos read release-plan\n\n# Create a private note from a Markdown file.\ndreamlake memos create \"Release plan\" --file release-plan.md\n\n# Cross-interface design (unreleased target APIs; verify installed --help):\n# https://docs.dreamlake.ai/notes/api/",
|
|
105
|
+
"memos list": "dreamlake memos list --limit 10\ndreamlake memos list --shared\ndreamlake memos list --namespace acme\ndreamlake memos list --include-archived",
|
|
106
|
+
"memos search": "dreamlake memos search \"release plan\"\ndreamlake memos search deploy --namespace acme --json\ndreamlake memos search deploy --include-archived",
|
|
107
|
+
"memos create": "dreamlake memos create \"Release plan\" --text \"Draft checklist\"\nprintf '# Release plan\\n' | dreamlake memos create \"Release plan\" --file - --json",
|
|
108
|
+
"memos read": "dreamlake memos read release-plan\n# Inspect source with generated address hints; do not write the hints back.\ndreamlake memos read release-plan --view markdown\n# Preserve exact source plus revision/hash for a programmatic edit baseline.\ndreamlake memos read release-plan --json > baseline.json\ndreamlake memos read release-plan --since \"10 minutes ago\" --format diff\n# Detailed read design (unreleased target syntax):\n# https://docs.dreamlake.ai/notes/api/reading/\n# Reuse a stable agent identity for this task.\nexport DREAMLAKE_AGENT_ID=release-reviewer-a\nexport DREAMLAKE_AGENT_NAME=\"Release reviewer A\"\ndreamlake memos read release-plan --linger\n# Ctrl-C stops following.\n\nExample notifications:\n+ @alice joined\n+ Reviewer (agent) joined\n* Reviewer (agent) read the note\n* Reviewer (agent) edited the note\n* @alice selected \"## The center\"\n- @alice left",
|
|
109
|
+
"memos projects": "dreamlake memos projects 000000000000000000000001 --namespace acme",
|
|
110
|
+
"memos move": "# Standalone cross-namespace Note transfer is unavailable (exit 3).\ndreamlake memos move NOTE_ID --to-namespace my-org --project shared-research --dry-run\n# Add a project association within the note's CURRENT workspace.\ndreamlake memos move NOTE_ID --to-namespace current-workspace --project research --dry-run\n# Apply only an executable same-workspace preview.\ndreamlake memos move NOTE_ID --to-namespace current-workspace --project research\n# Relocate the note to an existing folder of one project (CLI 0.87.0+).\ndreamlake memos move NOTE_ID --namespace acme --project research --folder reports/2026 --dry-run",
|
|
111
|
+
"memos diff": "NOTE_ID=release-plan\ndreamlake memos read \"$NOTE_ID\" --json > baseline.json\nHASH=$(jq -er .hash baseline.json)\ndreamlake memos diff \"$NOTE_ID\" --since \"$HASH\" --format diff",
|
|
112
|
+
"memos sections": "dreamlake memos sections release-plan\ndreamlake memos sections release-plan --json",
|
|
113
|
+
"memos share": "# Find the release plan and inspect its source and current sharing.\ndreamlake memos search \"release plan\"\nNOTE=\"release-plan\" # Replace with the id or slug from search.\ndreamlake memos read \"$NOTE\"\ndreamlake memos share get \"$NOTE\"\n\n# Give signed-in recipients read access, then verify the returned link.\ndreamlake memos share create \"$NOTE\" --role read\ndreamlake memos share get \"$NOTE\"\n\n# When link access is no longer needed, revoke it and verify.\ndreamlake memos share revoke \"$NOTE\"\ndreamlake memos share get \"$NOTE\"",
|
|
114
|
+
"memos visibility": "NOTE=\"release-plan\" # Your existing note id or slug.\ndreamlake memos visibility \"$NOTE\" public\ndreamlake memos visibility \"$NOTE\" private",
|
|
115
|
+
"memos share revoke": "NOTE=\"release-plan\" # Your existing note id or slug.\ndreamlake memos share revoke \"$NOTE\" --revoke-accepted",
|
|
116
|
+
"memos share access": "NOTE=\"release-plan\" # Your existing note id or slug.\n# List acceptance records and stored roles as a readable table.\ndreamlake memos share access \"$NOTE\"",
|
|
117
|
+
"memos share remove": "NOTE=\"release-plan\" # Your existing note id or slug.\nUSER_ID=\"user-id-from-access-list\"\ndreamlake memos share remove \"$NOTE\" \"$USER_ID\"",
|
|
118
|
+
"memos suggest-diff": "# Review a change as a new private note.\ndreamlake memos suggest-diff before.md after.md --user \"Docs review\" \\\n | dreamlake memos create \"Redline: release plan\" --file -\n# Propose edits inside the note itself; refuses changes it cannot express.\ndreamlake memos suggest-diff current.md edited.md --in-place --user \"$DREAMLAKE_AGENT_NAME\" > proposal.md\n# Count insertions, deletions, replacements and changed code blocks.\ndreamlake memos suggest-diff before.md after.md --json | jq .stats",
|
|
119
|
+
"memos transfer": "dreamlake memos transfer NOTE_ID --namespace alice --to acme \\\n --dry-run --out note-transfer.json\n# Submit the exact reviewed file; the authorized destination member accepts separately.\ndreamlake memos transfer NOTE_ID --namespace alice --to acme \\\n --confirm --request-file note-transfer.json\n# If you also have destination acceptance authority:\ndreamlake memos transfer NOTE_ID --namespace alice --to acme \\\n --confirm --request-file note-transfer.json --accept-if-authorized --wait",
|
|
120
|
+
"memos tag": "# Save the current content on the existing Note.\ndreamlake note tag NOTE_ID end-of-day --namespace my-org --summary \"Reviewed today's actions\"\n# Require the hash retained from a reviewed full read (not its opaque revision).\ndreamlake note tag NOTE_ID reviewed --hash sha256:CONTENT_HASH --json\n# Connect this checkpoint to an earlier version in the same Note.\ndreamlake note tag NOTE_ID next-checkpoint --parent VERSION_ID\n# Read and validate without creating a version.\ndreamlake note tag NOTE_ID preview --dry-run --json",
|
|
121
|
+
"memos hist": "dreamlake note hist NOTE_ID --namespace my-org --json\n# Continue with nextCursor returned by the previous page.\ndreamlake note hist NOTE_ID --before VERSION_ID --json",
|
|
122
122
|
"ownership transfer": "dreamlake ownership transfer artifact ARTIFACT_ID --namespace alice --to acme \\\n --dry-run --out artifact-transfer.json\n# Review the full access inventory and blockers, then submit that exact file.\ndreamlake ownership transfer artifact ARTIFACT_ID --namespace alice --to acme \\\n --confirm --request-file artifact-transfer.json --accept-if-authorized --wait\n# Scene resources use the canonical env adapter, only if advertised and enabled.\ndreamlake ownership transfer scene SCENE_ID --namespace alice --to acme --dry-run\n# Pipeline requires the separately advertised metadata adapter.\ndreamlake ownership transfer pipeline PIPELINE_ID --namespace alice --to acme \\\n --dry-run --out pipeline-transfer.json\n# Source requires its own enabled metadata-only capability.\ndreamlake ownership transfer source SOURCE_ID --namespace alice --to acme \\\n --dry-run --out source-transfer.json",
|
|
123
123
|
"ownership capabilities": "dreamlake ownership capabilities --namespace acme",
|
|
124
124
|
"ownership list": "dreamlake ownership list --namespace acme --direction incoming\ndreamlake ownership list --namespace acme --direction outgoing",
|