@dreamlake/dreamlake-cli 0.111.2 → 0.112.1
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/skills.js +1 -1
- package/dist/cli/agents/index.js +20 -20
- package/dist/cli/agents/manage.js +1 -1
- package/dist/cli/artifact/index.js +5 -5
- package/dist/cli/artifact/meta.js +1 -1
- package/dist/cli/auth/commands.d.ts +2 -2
- package/dist/cli/auth/commands.js +9 -9
- package/dist/cli/auth/device-flow.js +2 -2
- package/dist/cli/auth/materialized.d.ts +1 -1
- package/dist/cli/auth/materialized.js +1 -1
- package/dist/cli/compat/http.js +2 -2
- package/dist/cli/compat/presignedTransfer.js +2 -2
- package/dist/cli/config.js +2 -2
- package/dist/cli/connection/index.js +8 -8
- package/dist/cli/connection/oauth.js +3 -3
- package/dist/cli/connection/write.js +6 -6
- package/dist/cli/create/index.js +2 -2
- package/dist/cli/declare/index.js +14 -14
- package/dist/cli/delete/index.js +4 -4
- package/dist/cli/download/index.js +3 -3
- package/dist/cli/env/compose.js +1 -1
- package/dist/cli/env/index.js +9 -9
- package/dist/cli/experiments/index.js +2 -2
- package/dist/cli/experiments/native-commands.js +1 -1
- package/dist/cli/experiments/native-run-data.js +1 -1
- package/dist/cli/graphql.js +1 -1
- package/dist/cli/help-examples.generated.js +253 -253
- package/dist/cli/hosts/bootstrap-source.d.ts +1 -1
- package/dist/cli/hosts/bootstrap-source.js +1 -1
- package/dist/cli/hosts/inventory.js +2 -2
- package/dist/cli/hosts/picker.js +2 -2
- package/dist/cli/hosts/ssh.js +1 -1
- package/dist/cli/hosts/upgrade.d.ts +2 -2
- package/dist/cli/hosts/upgrade.js +3 -3
- package/dist/cli/index.js +7 -3
- package/dist/cli/lakeshore/connections.js +1 -1
- package/dist/cli/lakeshore/index.d.ts +1 -1
- package/dist/cli/lakeshore/index.js +4 -4
- package/dist/cli/launch/index.js +10 -10
- package/dist/cli/library/add.js +4 -4
- package/dist/cli/library/cache.js +1 -1
- package/dist/cli/library/discover.js +1 -1
- package/dist/cli/library/freshness.js +1 -1
- package/dist/cli/library/index.js +1 -1
- package/dist/cli/library/info.js +1 -1
- package/dist/cli/library/manifest.js +1 -1
- package/dist/cli/library/pull.js +1 -1
- package/dist/cli/library/push.js +2 -2
- package/dist/cli/library/rm.js +2 -2
- package/dist/cli/library/search.js +2 -2
- package/dist/cli/library/stat.js +1 -1
- package/dist/cli/library/tools.js +1 -1
- package/dist/cli/library/wire.js +1 -1
- package/dist/cli/list/index.js +4 -4
- package/dist/cli/memos/document.d.ts +1 -1
- package/dist/cli/memos/document.js +1 -1
- package/dist/cli/memos/edit-commands.d.ts +2 -2
- package/dist/cli/memos/edit-commands.js +2 -2
- package/dist/cli/memos/files-commands.d.ts +1 -1
- package/dist/cli/memos/files-commands.js +2 -2
- package/dist/cli/memos/index.js +7 -7
- package/dist/cli/memos/media-commands.js +1 -1
- package/dist/cli/memos/move-command.js +2 -2
- package/dist/cli/memos/rm-command.d.ts +1 -1
- package/dist/cli/memos/rm-command.js +2 -2
- package/dist/cli/namespace.js +2 -2
- package/dist/cli/nymph/index.js +4 -4
- package/dist/cli/ownership/index.js +1 -1
- package/dist/cli/ownership/metadata-transfer.js +2 -2
- package/dist/cli/page/index.js +5 -5
- package/dist/cli/pipeline/index.js +5 -5
- package/dist/cli/project/attachments.js +1 -1
- package/dist/cli/project/grants.js +1 -1
- package/dist/cli/project/index.js +1 -1
- package/dist/cli/project/move.js +3 -3
- package/dist/cli/project/stream.js +2 -2
- package/dist/cli/provider/dreamdir.js +2 -2
- package/dist/cli/provider/index.js +18 -18
- package/dist/cli/provider/lifecycle.js +14 -14
- package/dist/cli/python.js +4 -4
- package/dist/cli/queues/index.js +4 -4
- package/dist/cli/queues/slurm.js +2 -2
- package/dist/cli/resources.js +2 -2
- package/dist/cli/run/index.js +1 -1
- package/dist/cli/runconfig/index.js +3 -3
- package/dist/cli/runnable/bound.js +3 -3
- package/dist/cli/runnable/index.js +14 -14
- package/dist/cli/runnable/path.d.ts +1 -1
- package/dist/cli/runnable/path.js +1 -1
- package/dist/cli/self-update/alias-migration.d.ts +11 -0
- package/dist/cli/self-update/alias-migration.js +56 -0
- package/dist/cli/self-update/index.d.ts +1 -1
- package/dist/cli/self-update/index.js +5 -5
- package/dist/cli/self-update/install.js +2 -2
- package/dist/cli/self-update/update.d.ts +1 -1
- package/dist/cli/self-update/update.js +7 -7
- package/dist/cli/session-affiliation.js +1 -1
- package/dist/cli/sessions/control.d.ts +1 -1
- package/dist/cli/sessions/control.js +2 -2
- package/dist/cli/sessions/index.js +5 -5
- package/dist/cli/sessions/live.js +1 -1
- package/dist/cli/sessions/runner/serve.js +1 -1
- package/dist/cli/sessions/wrap.d.ts +2 -2
- package/dist/cli/sessions/wrap.js +8 -8
- package/dist/cli/skill/index.js +22 -22
- package/dist/cli/skill/prefs.js +1 -1
- package/dist/cli/skill/read.js +3 -3
- package/dist/cli/skill/registry.js +2 -2
- package/dist/cli/snapshot/index.js +9 -9
- package/dist/cli/source/access.js +3 -3
- package/dist/cli/source/control.js +8 -8
- package/dist/cli/source/delete.js +6 -6
- package/dist/cli/source/index.js +14 -14
- package/dist/cli/source/share.js +8 -8
- package/dist/cli/source/upload.d.ts +1 -1
- package/dist/cli/source/upload.js +2 -2
- package/dist/cli/source/write.js +2 -2
- package/dist/cli/spawn.js +1 -1
- package/dist/cli/tasks/index.js +1 -1
- package/dist/cli/update/index.js +2 -2
- package/dist/cli/upload/index.js +3 -3
- package/dist/cli/upload/multipart.js +1 -1
- package/dist/cli/vault/index.js +1 -1
- package/dist/cli/vault/sshSync.js +1 -1
- package/dist/cli/version.d.ts +1 -1
- package/dist/cli/version.js +1 -1
- package/dist/cli/workflow/index.d.ts +1 -1
- package/dist/cli/workflow/index.js +6 -6
- package/package.json +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The engine behind `
|
|
1
|
+
// The engine behind `dl provider|storage|queue-def …` — one generic
|
|
2
2
|
// implementation of the five verbs dreamlake-server exposes for its three
|
|
3
3
|
// lakeshore resource collections.
|
|
4
4
|
//
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// (LAKESHORE_COLLECTIONS, :59-95). `declare`'s own header comment already ruled
|
|
11
11
|
// on that shape once — "Five groups would be five copies of one function."
|
|
12
12
|
//
|
|
13
|
-
// But `
|
|
13
|
+
// But `dl lakeshore lakeshore-providers list` is not a command anybody
|
|
14
14
|
// types, and every other group in this CLI is a noun: runnable, runconfig,
|
|
15
15
|
// pipeline, dataset, project, source, org, team. So the LOGIC lives here, once,
|
|
16
16
|
// and `provider/index.ts` spends its lines on help text rather than on copies.
|
|
@@ -81,13 +81,13 @@ export const COLLECTIONS = [
|
|
|
81
81
|
async function ctx(nsFlag) {
|
|
82
82
|
const token = resolveToken();
|
|
83
83
|
if (!token) {
|
|
84
|
-
fail("not authenticated — run '
|
|
84
|
+
fail("not authenticated — run 'dl login' first");
|
|
85
85
|
return null;
|
|
86
86
|
}
|
|
87
87
|
const remote = resolveRemote();
|
|
88
88
|
const ns = await resolveNamespace(nsFlag, { token, remote });
|
|
89
89
|
if (!ns) {
|
|
90
|
-
fail("could not resolve namespace — run '
|
|
90
|
+
fail("could not resolve namespace — run 'dl login' or pass --namespace");
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
93
|
return { token, remote, ns };
|
package/dist/cli/launch/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl launch <script>` — run a repo script on the fabric. The control
|
|
2
2
|
// plane picks the node; nothing here names a machine, and that is the point.
|
|
3
3
|
//
|
|
4
4
|
// The script is put on a QUEUE as an `Invocation`. A worker whose host key
|
|
@@ -43,7 +43,7 @@ export function isSnapshotRef(value) {
|
|
|
43
43
|
function noQueueMessage(script) {
|
|
44
44
|
return [
|
|
45
45
|
"no queue — a launch has to say where it runs. Any one of:",
|
|
46
|
-
`
|
|
46
|
+
` dl launch ${script} --queue cpu`,
|
|
47
47
|
" export LAKESHORE_QUEUE=cpu",
|
|
48
48
|
" queue: cpu # at the top level of .dreamrc",
|
|
49
49
|
].join("\n");
|
|
@@ -76,13 +76,13 @@ export function resolveQueue(flag) {
|
|
|
76
76
|
function shortCommit(commit) {
|
|
77
77
|
return commit ? commit.slice(0, 7) : "(unknown)";
|
|
78
78
|
}
|
|
79
|
-
// ───
|
|
79
|
+
// ─── dl launch ────────────────────────────────────────────────────────
|
|
80
80
|
export async function runLaunch(script, opts, deps = {}) {
|
|
81
81
|
// ── ALL local validation first. Each of these returns 1 having spawned
|
|
82
82
|
// nothing at all: a missing queue must not cost an upload. ──
|
|
83
83
|
const namespace = resolveCpNamespace(opts.namespace);
|
|
84
84
|
if (!script || !script.trim()) {
|
|
85
|
-
return reject(opts, "no script given — usage:
|
|
85
|
+
return reject(opts, "no script given — usage: dl launch <script>", {
|
|
86
86
|
script: script ?? "",
|
|
87
87
|
server: "",
|
|
88
88
|
namespace,
|
|
@@ -188,7 +188,7 @@ export async function runLaunch(script, opts, deps = {}) {
|
|
|
188
188
|
}
|
|
189
189
|
ok(`launched ${record.invocationId ?? "(no id)"} on queue '${record.queue}'`);
|
|
190
190
|
if (!didWait) {
|
|
191
|
-
process.stdout.write(`
|
|
191
|
+
process.stdout.write(` dl launch ${script} --queue ${record.queue} # re-run\n`);
|
|
192
192
|
return 0;
|
|
193
193
|
}
|
|
194
194
|
// The script's own streams, verbatim and unwrapped. Anything this command
|
|
@@ -227,7 +227,7 @@ function reject(opts, message, where, kind) {
|
|
|
227
227
|
// ─── registration ────────────────────────────────────────────────────────────
|
|
228
228
|
//
|
|
229
229
|
// NO `--version` OPTION HERE, EVER — `program.version()` resolves from any
|
|
230
|
-
// descendant, so one would make `
|
|
230
|
+
// descendant, so one would make `dl launch --version` print 0.6.0 and
|
|
231
231
|
// exit 0 without launching anything.
|
|
232
232
|
function collect(value, previous) {
|
|
233
233
|
return [...previous, value];
|
|
@@ -259,12 +259,12 @@ export function registerLaunchCommand(program) {
|
|
|
259
259
|
"stdout and stderr are printed through verbatim; under --json they are the",
|
|
260
260
|
"`stdout` / `stderr` fields and the real number is `exitCode`.",
|
|
261
261
|
"",
|
|
262
|
-
"This talks to the control plane only — it needs no `
|
|
262
|
+
"This talks to the control plane only — it needs no `dl login`.",
|
|
263
263
|
"",
|
|
264
264
|
"Examples:",
|
|
265
|
-
"
|
|
266
|
-
"
|
|
267
|
-
"
|
|
265
|
+
" dl launch train.py --queue cpu",
|
|
266
|
+
" dl launch train.py --arg --epochs --arg 10",
|
|
267
|
+
" dl launch eval.py --snapshot 665f0a1b2c3d4e5f60718293 --no-wait",
|
|
268
268
|
].join("\n"))
|
|
269
269
|
.action(async (script, opts) => process.exit(await runLaunch(script, opts)));
|
|
270
270
|
}
|
package/dist/cli/library/add.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl library add <spec> <path>` — add ONE asset to a remote library
|
|
2
2
|
// without holding a full local copy (RFC 0008 §5.7).
|
|
3
3
|
//
|
|
4
4
|
// The mechanism is the register contract itself: register serves whatever
|
|
@@ -41,7 +41,7 @@ const ADD_CONCURRENCY = 4;
|
|
|
41
41
|
export async function fetchRemoteLibrary(base, token, spec) {
|
|
42
42
|
const detail = await jsonRequest("GET", base, token);
|
|
43
43
|
if (detail.status === 404) {
|
|
44
|
-
return { error: `library ${spec} not found — create it with \`
|
|
44
|
+
return { error: `library ${spec} not found — create it with \`dl library push\`` };
|
|
45
45
|
}
|
|
46
46
|
if (detail.status !== 200) {
|
|
47
47
|
return { error: `could not read the library → ${detail.status}: ${errorMessage(detail)}` };
|
|
@@ -50,7 +50,7 @@ export async function fetchRemoteLibrary(base, token, spec) {
|
|
|
50
50
|
const revision = typeof rev === "number" ? rev : 0;
|
|
51
51
|
const mRes = await jsonRequest("GET", `${base}/manifest`, token);
|
|
52
52
|
if (mRes.status === 404) {
|
|
53
|
-
return { error: `library ${spec} not found — create it with \`
|
|
53
|
+
return { error: `library ${spec} not found — create it with \`dl library push\`` };
|
|
54
54
|
}
|
|
55
55
|
if (mRes.status !== 200) {
|
|
56
56
|
return { error: `could not read the remote manifest → ${mRes.status}: ${errorMessage(mRes)}` };
|
|
@@ -298,7 +298,7 @@ export async function runLibraryAdd(args, deps = {}) {
|
|
|
298
298
|
if (reg.status < 200 || reg.status >= 300) {
|
|
299
299
|
fail(`could not register the library → ${reg.status}: ${errorMessage(reg)}`);
|
|
300
300
|
if (reg.status === 409) {
|
|
301
|
-
process.stderr.write(` another writer is racing this add — re-run \`
|
|
301
|
+
process.stderr.write(` another writer is racing this add — re-run \`dl library add\`.\n`);
|
|
302
302
|
}
|
|
303
303
|
return 1;
|
|
304
304
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl library push|pull|list|search` — Asset Libraries.
|
|
2
2
|
//
|
|
3
3
|
// A library is a PLAIN local directory: the user's asset files plus one
|
|
4
4
|
// optional `dreamlake.yml` (metadata, discovery globs). Push discovers the
|
package/dist/cli/library/info.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl library info <spec>` — one library's statistical portrait, or
|
|
2
2
|
// (with --asset) one asset's full decision card.
|
|
3
3
|
//
|
|
4
4
|
// RFC 0008's `summary` and `peek` verbs, computed CLIENT-side from exactly
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Wire-manifest handling for `
|
|
1
|
+
// Wire-manifest handling for `dl library` — the dreamlake.assets/v1
|
|
2
2
|
// document the CLI GENERATES at push (into the cache dir, uploaded to
|
|
3
3
|
// `files/.dreamlake/manifest.json`) and reads back from the server for
|
|
4
4
|
// diffing and pulling. Users never author this file: their input is the
|
package/dist/cli/library/pull.js
CHANGED
package/dist/cli/library/push.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl library push <dir>` — publish an Asset Library from a PLAIN
|
|
2
2
|
// source directory.
|
|
3
3
|
//
|
|
4
4
|
// The authoring model: the user's input is their files plus one optional
|
|
@@ -579,7 +579,7 @@ export async function runLibraryPush(args, deps = {}) {
|
|
|
579
579
|
if (reg.status < 200 || reg.status >= 300) {
|
|
580
580
|
fail(`uploaded ${uploads.length} file(s) but could not register the library → ${reg.status}: ${errorMessage(reg)}`);
|
|
581
581
|
if (reg.status === 409) {
|
|
582
|
-
process.stderr.write(` another push is racing this one — re-run \`
|
|
582
|
+
process.stderr.write(` another push is racing this one — re-run \`dl library push\`.\n`);
|
|
583
583
|
}
|
|
584
584
|
return 1;
|
|
585
585
|
}
|
package/dist/cli/library/rm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl library rm <spec> <assetId...>` — remove assets from a remote
|
|
2
2
|
// library without holding a full local copy (RFC 0008 §5.7).
|
|
3
3
|
//
|
|
4
4
|
// No payload bytes move: the edit is the manifest itself. Read the remote
|
|
@@ -160,7 +160,7 @@ export async function runLibraryRm(args, deps = {}) {
|
|
|
160
160
|
if (reg.status < 200 || reg.status >= 300) {
|
|
161
161
|
fail(`could not register the library → ${reg.status}: ${errorMessage(reg)}`);
|
|
162
162
|
if (reg.status === 409) {
|
|
163
|
-
process.stderr.write(` another writer is racing this rm — re-run \`
|
|
163
|
+
process.stderr.write(` another writer is racing this rm — re-run \`dl library rm\`.\n`);
|
|
164
164
|
}
|
|
165
165
|
return 1;
|
|
166
166
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl library search <query>` — search assets across libraries.
|
|
2
2
|
//
|
|
3
3
|
// GET /library-search over an explicit `--library ns/a,ns/b` scope, or —
|
|
4
4
|
// when no scope is given — the caller's visible libraries from GET
|
|
@@ -159,7 +159,7 @@ export async function runLibrarySearch(args) {
|
|
|
159
159
|
warn(`skipped ${str(s.library)}: ${str(s.reason)}`);
|
|
160
160
|
}
|
|
161
161
|
if (hits.length > 0) {
|
|
162
|
-
process.stdout.write("download:
|
|
162
|
+
process.stdout.write("download: dl library pull <ns>/<lib> --asset <id>\n");
|
|
163
163
|
}
|
|
164
164
|
return 0;
|
|
165
165
|
}
|
package/dist/cli/library/stat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl library stat <ns>/<name>` — is my local copy current?
|
|
2
2
|
//
|
|
3
3
|
// The consumer-side freshness verb (RFC 0008 §5.5): GET the catalog row (for
|
|
4
4
|
// `revision`) and the manifest, hash the local directory through the shared
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Push-time generators for `
|
|
1
|
+
// Push-time generators for `dl library push --thumbnails/--embed` —
|
|
2
2
|
// thin shells around the Python reference tools in dreamlake-py, located and
|
|
3
3
|
// invoked EXACTLY the way `env compose` finds its engine (env/compose.ts):
|
|
4
4
|
// DREAMLAKE_PYTHON wins outright, otherwise python3 then python; the module
|
package/dist/cli/library/wire.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Wire-manifest construction for `
|
|
1
|
+
// Wire-manifest construction for `dl library push` — discovered
|
|
2
2
|
// assets + hashes + generated artifacts → the dreamlake.assets/v1 document
|
|
3
3
|
// that uploads to `files/.dreamlake/manifest.json`.
|
|
4
4
|
//
|
package/dist/cli/list/index.js
CHANGED
|
@@ -19,12 +19,12 @@ export async function runListAssets(opts) {
|
|
|
19
19
|
const remote = resolveRemote();
|
|
20
20
|
const token = resolveToken();
|
|
21
21
|
if (!token) {
|
|
22
|
-
fail("not authenticated. run '
|
|
22
|
+
fail("not authenticated. run 'dl login' first");
|
|
23
23
|
return 1;
|
|
24
24
|
}
|
|
25
25
|
const namespace = await resolveNamespace(t.namespace, { token, remote });
|
|
26
26
|
if (!namespace) {
|
|
27
|
-
fail("namespace not specified and no authenticated user found. run '
|
|
27
|
+
fail("namespace not specified and no authenticated user found. run 'dl login'");
|
|
28
28
|
return 1;
|
|
29
29
|
}
|
|
30
30
|
t.namespace = namespace;
|
|
@@ -87,12 +87,12 @@ export async function runListProjects(opts) {
|
|
|
87
87
|
const remote = resolveRemote();
|
|
88
88
|
const token = resolveToken();
|
|
89
89
|
if (!token) {
|
|
90
|
-
fail("not authenticated. run '
|
|
90
|
+
fail("not authenticated. run 'dl login' first");
|
|
91
91
|
return 1;
|
|
92
92
|
}
|
|
93
93
|
const namespace = await resolveNamespace(opts.namespace, { token, remote });
|
|
94
94
|
if (!namespace) {
|
|
95
|
-
fail("namespace not specified and no authenticated user found. run '
|
|
95
|
+
fail("namespace not specified and no authenticated user found. run 'dl login'");
|
|
96
96
|
return 1;
|
|
97
97
|
}
|
|
98
98
|
const projects = await fetchProjects(remote, token, namespace);
|
|
@@ -65,7 +65,7 @@ export declare function submitDocumentPatch(c: DocumentContext, id: string, payl
|
|
|
65
65
|
ifMatch?: string;
|
|
66
66
|
}): Promise<MemoWriteReceipt>;
|
|
67
67
|
export declare function printPatchReceipt(result: MemoWriteReceipt, json?: boolean): void;
|
|
68
|
-
/** `
|
|
68
|
+
/** `dl notes command-status NOTE COMMAND_ID`: the durable record behind one --command-id. */
|
|
69
69
|
export declare function runMemosCommandStatus(ref: string, commandId: string, opts: ConnOpts & {
|
|
70
70
|
json?: boolean;
|
|
71
71
|
}): Promise<number>;
|
|
@@ -83,7 +83,7 @@ export function printPatchReceipt(result, json) {
|
|
|
83
83
|
else
|
|
84
84
|
process.stdout.write(`${printTokens(result)}mode: ${result.mode}\nbaseRevision: ${result.baseRevision}\n${result.commandId === null ? "" : `outcome: ${result.outcome}\ncommandId: ${result.commandId}\nreplayed: ${result.replayed}\n`}`);
|
|
85
85
|
}
|
|
86
|
-
/** `
|
|
86
|
+
/** `dl notes command-status NOTE COMMAND_ID`: the durable record behind one --command-id. */
|
|
87
87
|
export async function runMemosCommandStatus(ref, commandId, opts) {
|
|
88
88
|
if (!COMMAND_ID_PATTERN.test(commandId)) {
|
|
89
89
|
fail("command id must be 8–128 characters of A-Z a-z 0-9 . _ : -");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `
|
|
2
|
+
* `dl notes find | select | replace | insert | delete | toc`
|
|
3
3
|
*
|
|
4
4
|
* The shape follows the CLI's existing convention rather than the SDK's: the
|
|
5
5
|
* thing you are looking FOR is the first positional argument, and the thing
|
|
@@ -109,7 +109,7 @@ type InsertOpts = MutateOpts & {
|
|
|
109
109
|
};
|
|
110
110
|
/** `notes insert [NOTE] --before|--after ADDRESS | --cursor N | --line N | --ind N | --selector CSS`; the note may be positional (IDs are primary). */
|
|
111
111
|
export declare function runMemosInsert(noteOrOpts: string | undefined | InsertOpts, maybeOpts?: InsertOpts): Promise<number>;
|
|
112
|
-
/** `
|
|
112
|
+
/** `dl notes select "#contact" --note NOTE` */
|
|
113
113
|
export declare function runMemosSelect(css: string, opts: ConnOpts & {
|
|
114
114
|
note?: string;
|
|
115
115
|
json?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `
|
|
2
|
+
* `dl notes find | select | replace | insert | delete | toc`
|
|
3
3
|
*
|
|
4
4
|
* The shape follows the CLI's existing convention rather than the SDK's: the
|
|
5
5
|
* thing you are looking FOR is the first positional argument, and the thing
|
|
@@ -629,7 +629,7 @@ async function runLegacyNotesDelete(query, opts) {
|
|
|
629
629
|
? replaceInElement(src, opts.selector, "", whereFrom(query, opts))
|
|
630
630
|
: remove(src, whereFrom(query, opts)));
|
|
631
631
|
}
|
|
632
|
-
/** `
|
|
632
|
+
/** `dl notes select "#contact" --note NOTE` */
|
|
633
633
|
export async function runMemosSelect(css, opts) {
|
|
634
634
|
const ref = requireNote(opts);
|
|
635
635
|
if (!ref)
|
|
@@ -78,7 +78,7 @@ export declare function resolveFile(c: Conn, noteId: string, ref: string, opts?:
|
|
|
78
78
|
includeTrashed?: boolean;
|
|
79
79
|
}): Promise<FileRow | null>;
|
|
80
80
|
/**
|
|
81
|
-
* `
|
|
81
|
+
* `dl notes files preview <file> --note N [--share] [--open]`
|
|
82
82
|
*
|
|
83
83
|
* Prints a link that renders the file. The default needs the reader signed in
|
|
84
84
|
* and grants nothing by itself; `--share` returns one that works without
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { memoFilesApi, memoFileOperationId, validateMemoFileKey } from '../../api/memo-files.js';
|
|
2
2
|
import { memoTransport } from './api-transport.js';
|
|
3
3
|
/**
|
|
4
|
-
* `
|
|
4
|
+
* `dl notes files …` — list, upload, download, move, copy, trash.
|
|
5
5
|
*
|
|
6
6
|
* Bytes are never decoded on this path. Upload reads the local file as a
|
|
7
7
|
* Buffer and sends it raw; download writes the response body straight out.
|
|
@@ -500,7 +500,7 @@ export async function resolveFile(c, noteId, ref, opts = {}) {
|
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
|
-
* `
|
|
503
|
+
* `dl notes files preview <file> --note N [--share] [--open]`
|
|
504
504
|
*
|
|
505
505
|
* Prints a link that renders the file. The default needs the reader signed in
|
|
506
506
|
* and grants nothing by itself; `--share` returns one that works without
|
package/dist/cli/memos/index.js
CHANGED
|
@@ -44,7 +44,7 @@ const EXIT_PATCH = 5;
|
|
|
44
44
|
export async function ctx(opts = {}) {
|
|
45
45
|
const c = resolveCtx(opts);
|
|
46
46
|
if (!c.token) {
|
|
47
|
-
fail("not authenticated — run '
|
|
47
|
+
fail("not authenticated — run 'dl login' first");
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
50
|
const ns = await requireNamespace(c, opts.namespace);
|
|
@@ -83,7 +83,7 @@ export function report(err) {
|
|
|
83
83
|
return EXIT_PATCH;
|
|
84
84
|
}
|
|
85
85
|
if (err.status === 401) {
|
|
86
|
-
fail("not authenticated — run '
|
|
86
|
+
fail("not authenticated — run 'dl login' first");
|
|
87
87
|
return 1;
|
|
88
88
|
}
|
|
89
89
|
if (err.status === 403) {
|
|
@@ -121,7 +121,7 @@ export async function resolveNote(c, ref) {
|
|
|
121
121
|
if (!res.notes.length || (res.total === undefined ? res.notes.length < 200 : offset >= res.total))
|
|
122
122
|
break;
|
|
123
123
|
}
|
|
124
|
-
fail(`no memo '${ref}' in namespace '${c.ns}' — '
|
|
124
|
+
fail(`no memo '${ref}' in namespace '${c.ns}' — 'dl memos list --include-archived' shows what is there, ` +
|
|
125
125
|
`and an organization's memos need --namespace <slug>`);
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
@@ -685,7 +685,7 @@ export async function runMemosList(opts) {
|
|
|
685
685
|
process.stdout.write(opts.shared
|
|
686
686
|
? "no memos shared with you\n"
|
|
687
687
|
: `no memos in '${c.ns}'\n an organization's memos are in its own namespace — ` +
|
|
688
|
-
`'
|
|
688
|
+
`'dl org list' shows yours, then --namespace <slug>\n`);
|
|
689
689
|
return 0;
|
|
690
690
|
}
|
|
691
691
|
process.stdout.write(opts.shared
|
|
@@ -720,7 +720,7 @@ export async function runMemosSearch(query, opts) {
|
|
|
720
720
|
// "not in these notes", and the reader should be able to tell that the
|
|
721
721
|
// search was scoped somewhere they may not have meant.
|
|
722
722
|
process.stdout.write(`no memo in '${c.ns}' has '${query}' in its title or body\n` +
|
|
723
|
-
` other namespaces are searched separately — '
|
|
723
|
+
` other namespaces are searched separately — 'dl org list', then --namespace <slug>\n`);
|
|
724
724
|
return 0;
|
|
725
725
|
}
|
|
726
726
|
process.stdout.write(renderTable(res.notes.map((n) => ({
|
|
@@ -908,7 +908,7 @@ export async function runMemosWrite(ref, opts) {
|
|
|
908
908
|
if (!c)
|
|
909
909
|
return 1;
|
|
910
910
|
if (looksLikeDiff(text))
|
|
911
|
-
process.stderr.write("⚠ this looks like a unified diff — '
|
|
911
|
+
process.stderr.write("⚠ this looks like a unified diff — 'dl memos patch' applies one; 'write' stores it as the body\n");
|
|
912
912
|
try {
|
|
913
913
|
const id = await resolveNote(c, ref);
|
|
914
914
|
if (!id)
|
|
@@ -955,7 +955,7 @@ async function runLegacyNotesWrite(ref, opts) {
|
|
|
955
955
|
//
|
|
956
956
|
// On stderr, and not through helpers' `warn`, which prints to stdout —
|
|
957
957
|
// that would land inside `--json` output and break anything parsing it.
|
|
958
|
-
process.stderr.write("⚠ this looks like a unified diff — '
|
|
958
|
+
process.stderr.write("⚠ this looks like a unified diff — 'dl memos patch' applies one; " +
|
|
959
959
|
"'write' stores it as the body\n");
|
|
960
960
|
}
|
|
961
961
|
try {
|
|
@@ -128,7 +128,7 @@ export async function memoProjectNode(remote, token, ns, noteId, project) {
|
|
|
128
128
|
n.path.split(",")[1] === project && (n.namespaceSlug == null || n.namespaceSlug === ns));
|
|
129
129
|
if (!hits.length)
|
|
130
130
|
throw new Error(`memo ${noteId} is not filed in project '${project}' in @${ns}; ` +
|
|
131
|
-
`see \`
|
|
131
|
+
`see \`dl memos projects ${noteId} --namespace ${ns}\``);
|
|
132
132
|
if (hits.length > 1)
|
|
133
133
|
throw new Error(`memo ${noteId} has more than one node in project '${project}'; resolve it in the UI`);
|
|
134
134
|
return hits[0];
|
|
@@ -251,7 +251,7 @@ export async function runMemosFolderMove(ref, opts) {
|
|
|
251
251
|
}
|
|
252
252
|
recordOperationFailure(code, attempted && (status === undefined || status >= 500) ? 'uncertain' : 'failed');
|
|
253
253
|
if (attempted && (status === undefined || status >= 500))
|
|
254
|
-
message += `; the outcome may be uncertain: check \`
|
|
254
|
+
message += `; the outcome may be uncertain: check \`dl list --episode <project>@<namespace>\` before resubmitting; no retry was performed`;
|
|
255
255
|
if (opts.json)
|
|
256
256
|
emitJson({ error: code, message, ...(status === undefined ? {} : { status }) });
|
|
257
257
|
else
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `
|
|
2
|
+
* `dl notes rm <note>` — delete a whole note.
|
|
3
3
|
*
|
|
4
4
|
* Named `rm` because `notes delete` removes text inside a note, following
|
|
5
5
|
* `notes files rm` and `notes rm-section`.
|
|
@@ -86,7 +86,7 @@ export async function runMemosRm(ref, opts) {
|
|
|
86
86
|
}
|
|
87
87
|
catch { /* keep the transport message */ }
|
|
88
88
|
if (status === 401)
|
|
89
|
-
message = "not authenticated — run '
|
|
89
|
+
message = "not authenticated — run 'dl login' first";
|
|
90
90
|
else if (status === 403)
|
|
91
91
|
message = "only the namespace owner or the memo's creator can delete this memo";
|
|
92
92
|
else if (status === 404)
|
package/dist/cli/namespace.js
CHANGED
|
@@ -7,13 +7,13 @@ const normalizeRemote = (remote) => remote.replace(/\/+$/, '');
|
|
|
7
7
|
export async function selectNamespace(value, options = {}) {
|
|
8
8
|
const namespace = value.replace(/^@/, '');
|
|
9
9
|
if (!slug.test(namespace))
|
|
10
|
-
throw new Error('Use
|
|
10
|
+
throw new Error('Use dl su <namespace> with an exact namespace name');
|
|
11
11
|
const remote = resolveRemote(undefined, options.dir), token = resolveToken(undefined, options.dir);
|
|
12
12
|
if (!token)
|
|
13
13
|
throw new Error('Log in to DreamLake before selecting a namespace');
|
|
14
14
|
const materialized = () => readToken(options.dir) === token && normalizeRemote(readConfig(options.dir).remote_url ?? '') === remote;
|
|
15
15
|
if (!materialized())
|
|
16
|
-
throw new Error('Select a saved login with
|
|
16
|
+
throw new Error('Select a saved login with dl auth env use before persisting a namespace; explicit connection overrides are not saved');
|
|
17
17
|
const request = options.fetch ?? fetch;
|
|
18
18
|
const get = async (path, json) => {
|
|
19
19
|
let response;
|
package/dist/cli/nymph/index.js
CHANGED
|
@@ -196,14 +196,14 @@ export async function afterLogin(deps = {}) {
|
|
|
196
196
|
try {
|
|
197
197
|
const c = (deps.getContext ?? context)();
|
|
198
198
|
if (readPrivate(locations(c).record)) {
|
|
199
|
-
output("Nymph overview:
|
|
199
|
+
output("Nymph overview: dl nymph\n");
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
202
|
// An existing daemon can have a different name: do not enroll a second one at login.
|
|
203
203
|
try {
|
|
204
204
|
const known = deps.instances ? deps.instances() : invoke(["instances", "--json"]);
|
|
205
205
|
if (JSON.stringify(known).includes('"config_path"') || (Array.isArray(known) && known.length) || known?.instances?.length) {
|
|
206
|
-
output("Existing Nymph detected. Review configuration and access with
|
|
206
|
+
output("Existing Nymph detected. Review configuration and access with dl nymph.\n");
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
@@ -211,10 +211,10 @@ export async function afterLogin(deps = {}) {
|
|
|
211
211
|
if (!await (deps.ask ?? confirm)(ENABLE_PROMPT, false))
|
|
212
212
|
return;
|
|
213
213
|
await (deps.enable ?? (c => setup(c, {})))(c);
|
|
214
|
-
output("Nymph setup requested. Upload and command execution permissions are managed separately.\nOverview:
|
|
214
|
+
output("Nymph setup requested. Upload and command execution permissions are managed separately.\nOverview: dl nymph\n");
|
|
215
215
|
}
|
|
216
216
|
catch {
|
|
217
|
-
output("Login succeeded. Nymph setup was not confirmed; run
|
|
217
|
+
output("Login succeeded. Nymph setup was not confirmed; run dl nymph setup to inspect prerequisites.\n");
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
export async function setPermission(c, tool, allow, yes = false) {
|
|
@@ -11,7 +11,7 @@ export async function runOwnership(action, argument, opts) {
|
|
|
11
11
|
try {
|
|
12
12
|
const c = resolveCtx(opts);
|
|
13
13
|
if (!c.token)
|
|
14
|
-
throw new Error("Not authenticated — run '
|
|
14
|
+
throw new Error("Not authenticated — run 'dl login' first");
|
|
15
15
|
const ns = await requireNamespace(c, opts.namespace);
|
|
16
16
|
if (!ns)
|
|
17
17
|
return 1;
|
|
@@ -73,7 +73,7 @@ export async function runMetadataTransfer(requestedType, resourceId, opts) {
|
|
|
73
73
|
throw new Error('--wait-timeout must be an integer from 0 to 60 seconds');
|
|
74
74
|
const c = resolveCtx(opts);
|
|
75
75
|
if (!c.token)
|
|
76
|
-
throw new Error("Not authenticated — run '
|
|
76
|
+
throw new Error("Not authenticated — run 'dl login' first");
|
|
77
77
|
const get = (path, timeoutMs) => requestJson(c.remote, path, { token: c.token, redirect: 'error', timeoutMs });
|
|
78
78
|
const post = (path, json) => requestJson(c.remote, path, { token: c.token, method: 'POST', json, redirect: 'error' });
|
|
79
79
|
const base = `/namespaces/${seg(source)}/ownership`;
|
|
@@ -134,7 +134,7 @@ export async function runMetadataTransfer(requestedType, resourceId, opts) {
|
|
|
134
134
|
break;
|
|
135
135
|
await new Promise(resolve => setTimeout(resolve, Math.min(1000, Math.max(0, deadline - performance.now()))));
|
|
136
136
|
}
|
|
137
|
-
const nextAction = `
|
|
137
|
+
const nextAction = `dl ownership ${operation.state === 'pending' ? 'accept' : 'status'} ${operationId} --namespace ${quoted(operation.state === 'pending' ? destination : source)}`;
|
|
138
138
|
emitProjectResult({ ...review, operation, nextAction, timedOut: !!opts.wait && busy.has(operation.state) }, () => `${adapter.label} transfer ${operationId}: ${operation.state}.\n${nextAction}`, opts.json);
|
|
139
139
|
return failed.has(operation.state) ? 3 : 0;
|
|
140
140
|
}
|
package/dist/cli/page/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl page ...` — drive the page agent through dreamlake-server.
|
|
2
2
|
//
|
|
3
3
|
// Pages are generated review/labeling UIs. Each one runs in its own container
|
|
4
4
|
// behind a vite dev server, so an edit applies over HMR: there is no build step
|
|
@@ -351,10 +351,10 @@ export function registerPageCommand(program) {
|
|
|
351
351
|
.description("generate, edit, and inspect hosted pages")
|
|
352
352
|
.addHelpText("after", `
|
|
353
353
|
Examples:
|
|
354
|
-
$
|
|
355
|
-
$
|
|
356
|
-
$
|
|
357
|
-
$
|
|
354
|
+
$ dl page generate --description "a review page with a video player and a label form"
|
|
355
|
+
$ dl page status --workspace-id 24f311c966d2
|
|
356
|
+
$ dl page edit --workspace-id 24f311c966d2 --description "make the layout two columns"
|
|
357
|
+
$ dl page delete --workspace-id 24f311c966d2
|
|
358
358
|
|
|
359
359
|
Generating runs for 60-120 s and editing for 30-100 s. Progress is printed to
|
|
360
360
|
stderr while the agent works, and generate prints the page URL as soon as it is
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { collectionList } from "../collection-list.js";
|
|
2
|
-
// `
|
|
2
|
+
// `dl pipeline ...` — pipeline management.
|
|
3
3
|
//
|
|
4
4
|
// Covers all 10 pipeline API endpoints:
|
|
5
5
|
// pipeline list / create / show / update / delete
|
|
@@ -15,13 +15,13 @@ import { confirm } from "../prompt.js";
|
|
|
15
15
|
async function ctx(nsFlag) {
|
|
16
16
|
const token = resolveToken();
|
|
17
17
|
if (!token) {
|
|
18
|
-
fail("not authenticated — run '
|
|
18
|
+
fail("not authenticated — run 'dl login' first");
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
21
|
const remote = resolveRemote();
|
|
22
22
|
const ns = await resolveNamespace(nsFlag, { token, remote });
|
|
23
23
|
if (!ns) {
|
|
24
|
-
fail("could not resolve namespace — run '
|
|
24
|
+
fail("could not resolve namespace — run 'dl login' or pass --namespace");
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
27
|
return { token, remote, ns };
|
|
@@ -380,7 +380,7 @@ export async function runNodeState(name, hash, nodeId, opts) {
|
|
|
380
380
|
export async function runWorkspaceUpload(opts) {
|
|
381
381
|
const token = resolveToken();
|
|
382
382
|
if (!token) {
|
|
383
|
-
fail("not authenticated — run '
|
|
383
|
+
fail("not authenticated — run 'dl login' first");
|
|
384
384
|
return 1;
|
|
385
385
|
}
|
|
386
386
|
const remote = resolveRemote();
|
|
@@ -431,7 +431,7 @@ export async function runWorkspaceUpload(opts) {
|
|
|
431
431
|
export async function runWorkspaceHost(opts) {
|
|
432
432
|
const token = resolveToken();
|
|
433
433
|
if (!token) {
|
|
434
|
-
fail("not authenticated — run '
|
|
434
|
+
fail("not authenticated — run 'dl login' first");
|
|
435
435
|
return 1;
|
|
436
436
|
}
|
|
437
437
|
const remote = resolveRemote();
|