@dreamlake/dreamlake-cli 0.111.1 → 0.112.0
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,5 +1,5 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
2
|
export { maybeCheckForUpdates } from "./update.js";
|
|
3
3
|
export declare function registerInstallCommand(program: Command): void;
|
|
4
|
-
/** `
|
|
4
|
+
/** `dl doctor` — read-only install diagnostics, no network. */
|
|
5
5
|
export declare function registerDoctorCommand(program: Command): void;
|
|
@@ -22,12 +22,12 @@ export function registerInstallCommand(program) {
|
|
|
22
22
|
const result = await performInstall(target, { modifyPath: opts.modifyPath });
|
|
23
23
|
process.stdout.write(`Installed dreamlake ${result.version} → ${result.launcher}\n`);
|
|
24
24
|
if (!result.launcherConflict && !result.aliasWarning)
|
|
25
|
-
process.stdout.write("
|
|
25
|
+
process.stdout.write("Use dl for commands; dreamlake remains supported.\n");
|
|
26
26
|
if (converting) {
|
|
27
27
|
process.stdout.write("This is now a native install under ~/.local; the copy you ran this from is untouched.\n");
|
|
28
28
|
}
|
|
29
29
|
if (result.pinned) {
|
|
30
|
-
process.stdout.write(`Pinned to ${result.pinned} — auto-update is paused until you run \`
|
|
30
|
+
process.stdout.write(`Pinned to ${result.pinned} — auto-update is paused until you run \`dl self-update channel latest\`.\n`);
|
|
31
31
|
}
|
|
32
32
|
for (const line of installWarnings(result))
|
|
33
33
|
process.stderr.write(`${line}\n`);
|
|
@@ -46,7 +46,7 @@ export function registerInstallCommand(program) {
|
|
|
46
46
|
process.exit(1);
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
-
// Not `update` — that belongs to `
|
|
49
|
+
// Not `update` — that belongs to `dl update bindr|dataset|project`.
|
|
50
50
|
const update = program
|
|
51
51
|
.command("self-update")
|
|
52
52
|
.description("update the CLI itself to the newest release on your channel")
|
|
@@ -79,11 +79,11 @@ export function registerInstallCommand(program) {
|
|
|
79
79
|
writeSettings({ channel: name, pinned: null });
|
|
80
80
|
process.stdout.write(`Release channel set to ${name}.`);
|
|
81
81
|
process.stdout.write(had ? ` Unpinned from ${had}.` : "");
|
|
82
|
-
process.stdout.write(" Run `
|
|
82
|
+
process.stdout.write(" Run `dl self-update` to apply.\n");
|
|
83
83
|
process.exit(0);
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
/** `
|
|
86
|
+
/** `dl doctor` — read-only install diagnostics, no network. */
|
|
87
87
|
export function registerDoctorCommand(program) {
|
|
88
88
|
program
|
|
89
89
|
.command("doctor")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl install [latest|stable|X.Y.Z]` — place a native build under
|
|
2
2
|
// ~/.local/share/dreamlake/versions and point ~/.local/bin/dreamlake at it.
|
|
3
3
|
//
|
|
4
4
|
// install.sh does the minimum needed to get *a* verified binary onto disk,
|
|
@@ -358,7 +358,7 @@ export function installWarnings(result) {
|
|
|
358
358
|
` ${tilde(result.shadowedBy)}`,
|
|
359
359
|
`Installed ${result.version} at ${tilde(result.launcher)}.`,
|
|
360
360
|
`Remove the other one (for an npm install: npm uninstall -g @dreamlake/dreamlake-cli),`,
|
|
361
|
-
`or put ~/.local/bin ahead of it in PATH. Check with:
|
|
361
|
+
`or put ~/.local/bin ahead of it in PATH. Check with: dl doctor`,
|
|
362
362
|
];
|
|
363
363
|
}
|
|
364
364
|
return aliasWarnings;
|
|
@@ -14,5 +14,5 @@ export declare function runUpdate(opts?: UpdateOptions): Promise<number>;
|
|
|
14
14
|
* terminal) solely to say that a background update has started.
|
|
15
15
|
*/
|
|
16
16
|
export declare function maybeCheckForUpdates(argv: string[]): void;
|
|
17
|
-
/** Human-readable last-check line for `
|
|
17
|
+
/** Human-readable last-check line for `dl self-update --status`. */
|
|
18
18
|
export declare function updateStatus(): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl update` — apply an update now, and the throttled background
|
|
2
2
|
// check that keeps native installs current without anyone thinking about it.
|
|
3
3
|
//
|
|
4
4
|
// The background path mirrors what the native Claude Code installer does:
|
|
@@ -67,7 +67,7 @@ export async function runUpdate(opts = {}) {
|
|
|
67
67
|
// A pin outranks the channel. Saying nothing here would let the
|
|
68
68
|
// updater quietly undo an explicit `self-update <version>`.
|
|
69
69
|
if (!opts.target && pin) {
|
|
70
|
-
say(`dreamlake is pinned to ${pin}. Run \`
|
|
70
|
+
say(`dreamlake is pinned to ${pin}. Run \`dl self-update channel ${channel}\` to resume updates.`);
|
|
71
71
|
writeState({ lastCheck: Date.now(), lastResult: `pinned ${pin}` });
|
|
72
72
|
return 0;
|
|
73
73
|
}
|
|
@@ -85,7 +85,7 @@ export async function runUpdate(opts = {}) {
|
|
|
85
85
|
// and reporting it as unreachable sends people to debug DNS.
|
|
86
86
|
const msg = err.message;
|
|
87
87
|
const detail = /→ 404/.test(msg)
|
|
88
|
-
? `Release channel "${channel}" is not published. Switch back with:
|
|
88
|
+
? `Release channel "${channel}" is not published. Switch back with: dl self-update channel latest`
|
|
89
89
|
: `Could not reach the release server: ${msg}`;
|
|
90
90
|
if (!quiet)
|
|
91
91
|
process.stderr.write(`${detail}\n`);
|
|
@@ -105,7 +105,7 @@ export async function runUpdate(opts = {}) {
|
|
|
105
105
|
// them — the leading newline breaks away from whatever the foreground
|
|
106
106
|
// command is printing right now.
|
|
107
107
|
if (quiet) {
|
|
108
|
-
announce(`\
|
|
108
|
+
announce(`\ndl ${available} is available — updating in the background (applies on your next run).\n`);
|
|
109
109
|
}
|
|
110
110
|
const result = await performInstall(opts.target ?? channel, { background: quiet });
|
|
111
111
|
writeState({
|
|
@@ -185,7 +185,7 @@ export function maybeCheckForUpdates(argv) {
|
|
|
185
185
|
// No unattended updates on Windows. The launcher is a copy rather than
|
|
186
186
|
// a symlink, and Windows locks a running .exe, so swapping it out from
|
|
187
187
|
// under a live process is not something to do behind the user's back.
|
|
188
|
-
// `
|
|
188
|
+
// `dl self-update` still works, on purpose and in the
|
|
189
189
|
// foreground, where a failure is visible.
|
|
190
190
|
if (isWindows)
|
|
191
191
|
return;
|
|
@@ -218,7 +218,7 @@ export function maybeCheckForUpdates(argv) {
|
|
|
218
218
|
// Never let the updater interfere with the command being run.
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
/** Human-readable last-check line for `
|
|
221
|
+
/** Human-readable last-check line for `dl self-update --status`. */
|
|
222
222
|
export function updateStatus() {
|
|
223
223
|
const { lastCheck, lastResult } = readState();
|
|
224
224
|
const channel = activeChannel();
|
|
@@ -231,7 +231,7 @@ export function updateStatus() {
|
|
|
231
231
|
`auto: ${!isNativeInstall()
|
|
232
232
|
? "off (not a native install)"
|
|
233
233
|
: isWindows
|
|
234
|
-
? "off on Windows — run `
|
|
234
|
+
? "off on Windows — run `dl self-update` to update"
|
|
235
235
|
: autoUpdaterDisabled()
|
|
236
236
|
? "off (disabled by environment)"
|
|
237
237
|
: pin
|
|
@@ -94,7 +94,7 @@ export function createAutoAffiliator(deps = {}) {
|
|
|
94
94
|
...(env.DREAMLAKE_SESSION_VISIBILITY === 'private' ? { visibility: 'private' } : {}) }),
|
|
95
95
|
});
|
|
96
96
|
if (!registered.ok)
|
|
97
|
-
throw new Error(`registration HTTP ${registered.status}; run
|
|
97
|
+
throw new Error(`registration HTTP ${registered.status}; run dl sessions register --provider ${context.provider} --session ${context.nativeId} --cwd <original-directory>`);
|
|
98
98
|
const row = (await registered.json()).session;
|
|
99
99
|
if (!row || row.canManage !== true || row.provider !== context.provider || row.codexSessionId !== context.nativeId ||
|
|
100
100
|
!objectId.test(row.id ?? '') || !namespace.test(row.namespaceSlug ?? ''))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** `
|
|
1
|
+
/** `dl sessions` control-plane commands: the CLI side of the same
|
|
2
2
|
* contract the built-in agent's plugins use. Each command is a thin wrapper
|
|
3
3
|
* over the TypeScript API (`src/api`), so behaviour, permissions and error
|
|
4
4
|
* codes are identical in both. */
|
|
@@ -81,9 +81,9 @@ export function registerSessionControl(group) {
|
|
|
81
81
|
const ns = await resolveHostNamespace(opts.namespace), runners = await client().sessions(ns).runners.list();
|
|
82
82
|
if (opts.json)
|
|
83
83
|
return emit({ namespace: ns, runners }, true);
|
|
84
|
-
console.log(runners.map(r => `${r.id} ${r.hostname} ${r.unixUser} ${r.online ? 'online' : 'offline'} modes=${r.capabilities.modes.join('/')} human-cap=${r.capabilities.humanPermissionCap ?? 'none'} seen ${r.lastSeenAt}`).join('\n') || 'No runners registered. Start one with:
|
|
84
|
+
console.log(runners.map(r => `${r.id} ${r.hostname} ${r.unixUser} ${r.online ? 'online' : 'offline'} modes=${r.capabilities.modes.join('/')} human-cap=${r.capabilities.humanPermissionCap ?? 'none'} seen ${r.lastSeenAt}`).join('\n') || 'No runners registered. Start one with: dl sessions serve');
|
|
85
85
|
}));
|
|
86
|
-
const control = group.command('control').description('durable session commands executed by your runner (
|
|
86
|
+
const control = group.command('control').description('durable session commands executed by your runner (dl sessions serve)');
|
|
87
87
|
const waitOption = (c) => c.option('--wait <seconds>', 'wait for the receipt (0 returns the pending command)', '60').option('--runner <id>', 'target an explicit runner id');
|
|
88
88
|
const submit = async (opts, kind, input) => {
|
|
89
89
|
const ns = await resolveHostNamespace(opts.namespace), api = client().sessions(ns);
|
|
@@ -77,10 +77,10 @@ export function registerSessionsCommand(program) {
|
|
|
77
77
|
`Session ${cell(saved.id)} saved${ns ? ` in @${cell(ns)}` : ''}: ${opts.provider} ${cell(String(saved.codexSessionId).slice(0, 8))}… · ${cell(String(saved.visibility ?? 'public')).toLowerCase()} · ${cell(saved.cwd ?? opts.cwd)}`,
|
|
78
78
|
// A registered session has no recorded permission level, and a runner refuses a turn without one;
|
|
79
79
|
// one restart records it (a raise from "unrecorded", confirmed on a terminal), then sends are plain.
|
|
80
|
-
`Message it from anywhere (needs \`
|
|
81
|
-
`
|
|
82
|
-
`
|
|
83
|
-
`
|
|
80
|
+
`Message it from anywhere (needs \`dl sessions serve --max-human-permission workspace-write\` on this machine; record the level once, on a terminal):`,
|
|
81
|
+
` dl sessions control restart ${cell(saved.id)} --permission workspace-write --raise${namespaceFlag}`,
|
|
82
|
+
` dl sessions control send ${cell(saved.id)} "Summarize your state"${namespaceFlag}`,
|
|
83
|
+
` dl sessions control status ${cell(saved.id)}${namespaceFlag}`,
|
|
84
84
|
envFile ? `Env file written: ${cell(envFile)} — \`source\` it in another shell so its memo and artifact writes link to this session.` : 'Memo and artifact writes from this Claude Code session link to it automatically (CLAUDE_CODE_SESSION_ID).',
|
|
85
85
|
].join('\n'));
|
|
86
86
|
}));
|
|
@@ -173,7 +173,7 @@ export function registerSessionsCommand(program) {
|
|
|
173
173
|
if (session.targetId !== input.targetId || session.enrollmentId !== input.enrollmentId || session.cwd !== input.cwd || session.codexSessionId !== input.codexSessionId || (session.provider ?? 'codex') !== (input.provider ?? 'codex') || (session.claudeConfigDir ?? null) !== (input.claudeConfigDir ?? null))
|
|
174
174
|
throw new Error('Saved session does not match the requested host and conversation; no attachment attempted');
|
|
175
175
|
if (!attach)
|
|
176
|
-
console.log(opts.json ? JSON.stringify({ session, executed: false }, null, 2) : `${summary(session)}\nSaved. Open with:
|
|
176
|
+
console.log(opts.json ? JSON.stringify({ session, executed: false }, null, 2) : `${summary(session)}\nSaved. Open with: dl sessions open ${session.id} --namespace ${ns}`);
|
|
177
177
|
else {
|
|
178
178
|
const kind = attachmentKind(await managedOperation(conn, endpoint, ns, session, 'start'));
|
|
179
179
|
console.error(openingMessage(session.id, kind));
|
|
@@ -73,7 +73,7 @@ export async function resolveLiveTarget(opts, hook, env = process.env, home) {
|
|
|
73
73
|
const fromFile = readSessionEnvFile(sessionEnvFilePath(native, home));
|
|
74
74
|
if (fromFile)
|
|
75
75
|
return withNamespace(fromFile);
|
|
76
|
-
throw new Error(`No saved session for native session ${native}: register it first (
|
|
76
|
+
throw new Error(`No saved session for native session ${native}: register it first (dl sessions register --provider ${env.CODEX_THREAD_ID && !env.CLAUDE_SESSION_ID && !env.CLAUDE_CODE_SESSION_ID ? 'codex' : 'claude'} --session ${native} --cwd "$PWD" --write-env "${sessionEnvFilePath(native, home)}") or pass --session <id>`);
|
|
77
77
|
}
|
|
78
78
|
const id = env.DREAMLAKE_TERMINAL_SESSION_ID, ns = env.DREAMLAKE_SESSION_NAMESPACE;
|
|
79
79
|
if (id && isObjectId(id) && ns && /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/.test(ns))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Pods } from './pod.js';
|
|
2
2
|
import { RunnerJournal } from './journal.js';
|
|
3
|
-
/** `
|
|
3
|
+
/** `dl sessions serve` — the session runner.
|
|
4
4
|
*
|
|
5
5
|
* One process per machine and Unix user. It registers itself, long-polls the
|
|
6
6
|
* owner's command queue, executes commands with the provider's own CLI
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `
|
|
2
|
+
* `dl claude …` / `dl codex …`: the stock CLI, started under DreamLake. Light integration —
|
|
3
3
|
* the wrapper mints the native session id (Claude) or discovers it afterwards (Codex), registers the
|
|
4
4
|
* session (idempotent), exports the saved-session pair so every `dreamlake` call the session makes links to
|
|
5
5
|
* it, maps `--permission` onto the provider's own flag, hands the terminal over untouched, and uploads the
|
|
@@ -31,7 +31,7 @@ export declare function discoverCodexRollout(roots: NativeRoots, cwd: string, si
|
|
|
31
31
|
ambiguous: string[];
|
|
32
32
|
} | null;
|
|
33
33
|
/** The provider child's environment: the wrapper's own saved-session pair when it is known (Claude), and
|
|
34
|
-
* never an inherited one — a `
|
|
34
|
+
* never an inherited one — a `dl claude` started from a shell that sourced another session's env
|
|
35
35
|
* file, or from inside another agent session, must not link the child's writes to that parent. Inherited
|
|
36
36
|
* provider identities go too: the child sets its own (`CLAUDE_CODE_SESSION_ID`, `CODEX_THREAD_ID`), and a
|
|
37
37
|
* stale one from a parent agent would make the child's writes ambiguous or misattributed. */
|
|
@@ -13,7 +13,7 @@ import { claudePermissionMode, codexSandbox, defaultRoots, findClaudeTranscript,
|
|
|
13
13
|
const LEVELS_HINT = 'use --permission read-only|workspace-write|full-access (the recorded level must be the level the process runs under)';
|
|
14
14
|
const RESERVED = {
|
|
15
15
|
claude: {
|
|
16
|
-
'--session-id': 'the wrapper mints the session id; use `
|
|
16
|
+
'--session-id': 'the wrapper mints the session id; use `dl sessions resume` / `claude --resume` for an existing one',
|
|
17
17
|
'--permission-mode': LEVELS_HINT, '--dangerously-skip-permissions': LEVELS_HINT, '--permission-prompt-tool': LEVELS_HINT,
|
|
18
18
|
'--allowedTools': LEVELS_HINT, '--disallowedTools': LEVELS_HINT, '--allowed-tools': LEVELS_HINT, '--disallowed-tools': LEVELS_HINT,
|
|
19
19
|
},
|
|
@@ -69,7 +69,7 @@ export function discoverCodexRollout(roots, cwd, since) {
|
|
|
69
69
|
return { path: found[0].path, nativeSessionId: found[0].nativeSessionId };
|
|
70
70
|
}
|
|
71
71
|
/** The provider child's environment: the wrapper's own saved-session pair when it is known (Claude), and
|
|
72
|
-
* never an inherited one — a `
|
|
72
|
+
* never an inherited one — a `dl claude` started from a shell that sourced another session's env
|
|
73
73
|
* file, or from inside another agent session, must not link the child's writes to that parent. Inherited
|
|
74
74
|
* provider identities go too: the child sets its own (`CLAUDE_CODE_SESSION_ID`, `CODEX_THREAD_ID`), and a
|
|
75
75
|
* stale one from a parent agent would make the child's writes ambiguous or misattributed. */
|
|
@@ -113,7 +113,7 @@ export async function wrap(provider, opts, rest, deps) {
|
|
|
113
113
|
if (opts.upload === false)
|
|
114
114
|
return false;
|
|
115
115
|
if (!path) {
|
|
116
|
-
deps.log(`transcript of ${nativeSessionId} not found under ${provider === 'claude' ? deps.roots.claude : deps.roots.codex}; upload it later with:
|
|
116
|
+
deps.log(`transcript of ${nativeSessionId} not found under ${provider === 'claude' ? deps.roots.claude : deps.roots.codex}; upload it later with: dl sessions upload-conversation ${sessionId} --namespace ${ns} --file <path>`);
|
|
117
117
|
return false;
|
|
118
118
|
}
|
|
119
119
|
try {
|
|
@@ -124,7 +124,7 @@ export async function wrap(provider, opts, rest, deps) {
|
|
|
124
124
|
return true;
|
|
125
125
|
}
|
|
126
126
|
catch (error) {
|
|
127
|
-
deps.log(`transcript not uploaded (${error instanceof ApiError ? error.code : error instanceof Error ? error.message : String(error)}); retry with:
|
|
127
|
+
deps.log(`transcript not uploaded (${error instanceof ApiError ? error.code : error instanceof Error ? error.message : String(error)}); retry with: dl sessions upload-conversation ${sessionId} --namespace ${ns} --file "${path}"`);
|
|
128
128
|
return false;
|
|
129
129
|
}
|
|
130
130
|
};
|
|
@@ -132,7 +132,7 @@ export async function wrap(provider, opts, rest, deps) {
|
|
|
132
132
|
// session without one — `--permission` on `send` does not help. The accurate path is one restart that
|
|
133
133
|
// records the level (a raise from "unrecorded": the person confirms on a terminal, the runner must allow
|
|
134
134
|
// it), then plain sends.
|
|
135
|
-
const recipe = (ns, sessionId) => `to message it from anywhere (needs \`
|
|
135
|
+
const recipe = (ns, sessionId) => `to message it from anywhere (needs \`dl sessions serve --max-human-permission ${level}\` on this machine; the level is recorded once, on a terminal):\n dl sessions control restart ${sessionId} --permission ${level} --raise --namespace ${ns}\n dl sessions control send ${sessionId} "…" --namespace ${ns}`;
|
|
136
136
|
const run = (args, env) => new Promise((resolve, reject) => {
|
|
137
137
|
const child = spawnChild(provider, args, env);
|
|
138
138
|
// Ctrl-C belongs to the provider: the wrapper stays alive to upload the transcript after it exits.
|
|
@@ -174,11 +174,11 @@ export async function wrap(provider, opts, rest, deps) {
|
|
|
174
174
|
}
|
|
175
175
|
const rollout = discoverCodexRollout(deps.roots, deps.cwd, since);
|
|
176
176
|
if (!rollout) {
|
|
177
|
-
deps.log(`no rollout created: no Codex rollout for ${deps.cwd} was created under ${deps.roots.codex} after the launch; nothing was registered. Register the thread by hand:
|
|
177
|
+
deps.log(`no rollout created: no Codex rollout for ${deps.cwd} was created under ${deps.roots.codex} after the launch; nothing was registered. Register the thread by hand: dl sessions register --provider codex --session <thread-id> --cwd "${deps.cwd}"`);
|
|
178
178
|
return { exitCode, sessionId: null, nativeSessionId: null, uploaded: false, envFile: null };
|
|
179
179
|
}
|
|
180
180
|
if ('ambiguous' in rollout) {
|
|
181
|
-
deps.log(`several Codex threads started here meanwhile (${rollout.ambiguous.join(', ')}); register the right one by hand:
|
|
181
|
+
deps.log(`several Codex threads started here meanwhile (${rollout.ambiguous.join(', ')}); register the right one by hand: dl sessions register --provider codex --session <thread-id> --cwd "${deps.cwd}"`);
|
|
182
182
|
return { exitCode, sessionId: null, nativeSessionId: null, uploaded: false, envFile: null };
|
|
183
183
|
}
|
|
184
184
|
// The provider has already run: from here on nothing may change its exit code. A refused registration
|
|
@@ -188,7 +188,7 @@ export async function wrap(provider, opts, rest, deps) {
|
|
|
188
188
|
registered = await register(rollout.nativeSessionId);
|
|
189
189
|
}
|
|
190
190
|
catch (error) {
|
|
191
|
-
deps.log(`session not registered (${error instanceof ApiError ? error.code : error instanceof Error ? error.message : String(error)}); register the thread by hand:
|
|
191
|
+
deps.log(`session not registered (${error instanceof ApiError ? error.code : error instanceof Error ? error.message : String(error)}); register the thread by hand: dl sessions register --provider codex --session ${rollout.nativeSessionId} --cwd "${deps.cwd}" --write-env "${sessionEnvFilePath(rollout.nativeSessionId, deps.home)}"`);
|
|
192
192
|
return { exitCode, sessionId: null, nativeSessionId: rollout.nativeSessionId, uploaded: false, envFile: null };
|
|
193
193
|
}
|
|
194
194
|
const { session, ns, envFile } = registered;
|
package/dist/cli/skill/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { collectionList } from "../collection-list.js";
|
|
2
|
-
// `
|
|
2
|
+
// `dl init` / `dl skill install|update|remove|list` — put agent
|
|
3
3
|
// skills from the public dreamlake-skills release where Claude Code
|
|
4
4
|
// (`.claude/skills/<name>/SKILL.md`) and Codex (`.agents/skills/<name>/`)
|
|
5
5
|
// will find them, and keep them current.
|
|
@@ -120,7 +120,7 @@ export function ownedTarget(dir, name) {
|
|
|
120
120
|
}
|
|
121
121
|
// ─── selection: agent and scope ──────────────────────────────────────────────
|
|
122
122
|
//
|
|
123
|
-
// Flags win; otherwise what `
|
|
123
|
+
// Flags win; otherwise what `dl init` saved; otherwise claude/project
|
|
124
124
|
// with a one-line hint. `--dir` beats `--project` beats `--global`.
|
|
125
125
|
export const AGENT_ERROR = "--agent must be claude, codex, all, or a comma-separated list of them";
|
|
126
126
|
function isMulti(sel) {
|
|
@@ -172,7 +172,7 @@ function selectTarget(opts) {
|
|
|
172
172
|
function printHint(sel, opts) {
|
|
173
173
|
if (!sel.hint || opts.json)
|
|
174
174
|
return;
|
|
175
|
-
process.stderr.write(` hint: no saved agent — using ${sel.agents.join(", ")}, ${sel.scope}; run '
|
|
175
|
+
process.stderr.write(` hint: no saved agent — using ${sel.agents.join(", ")}, ${sel.scope}; run 'dl init' once to remember your choice\n`);
|
|
176
176
|
}
|
|
177
177
|
// ─── prose ───────────────────────────────────────────────────────────────────
|
|
178
178
|
//
|
|
@@ -191,7 +191,7 @@ function catalogLine(info) {
|
|
|
191
191
|
}
|
|
192
192
|
/** The command that would resolve the current invocation, `--force` and `--allow-downgrade` optional. */
|
|
193
193
|
export function skillCommand(verb, names, opts, force, allowDowngrade = false) {
|
|
194
|
-
const parts = ["
|
|
194
|
+
const parts = ["dl", "skill", verb, ...(Array.isArray(names) ? names : [names])];
|
|
195
195
|
if (opts.agent)
|
|
196
196
|
parts.push("--agent", opts.agent);
|
|
197
197
|
if (opts.dir)
|
|
@@ -284,14 +284,14 @@ async function resolvePayloads(requested, ctx, bundleDir) {
|
|
|
284
284
|
return {
|
|
285
285
|
message: `'${name}' was renamed to '${renamed}' — install that instead`,
|
|
286
286
|
kind: "renamed",
|
|
287
|
-
nextAction: { kind: "run", command: `
|
|
287
|
+
nextAction: { kind: "run", command: `dl skill install ${renamed}` },
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
290
|
if (!known(name)) {
|
|
291
291
|
return {
|
|
292
292
|
message: `no skill named '${name}' — ${catalog ? "the catalog" : "this build"} has: ${available.join(", ")}`,
|
|
293
293
|
kind: "unknown-skill",
|
|
294
|
-
nextAction: { kind: "run", command: "
|
|
294
|
+
nextAction: { kind: "run", command: "dl skill list" },
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
297
|
if (!order.includes(name))
|
|
@@ -310,7 +310,7 @@ async function resolvePayloads(requested, ctx, bundleDir) {
|
|
|
310
310
|
return {
|
|
311
311
|
message: `${name} requires '${dep}', which is not in the catalog`,
|
|
312
312
|
kind: "unknown-skill",
|
|
313
|
-
nextAction: { kind: "run", command: "
|
|
313
|
+
nextAction: { kind: "run", command: "dl skill list" },
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
316
|
order.push(dep);
|
|
@@ -496,7 +496,7 @@ export function planUpdate(payload, target, force, allowDowngrade = false) {
|
|
|
496
496
|
...emptyPlan("error"),
|
|
497
497
|
error: `${payload.name} is not installed at ${target}`,
|
|
498
498
|
kind: "not-installed",
|
|
499
|
-
nextAction: { kind: "run", command: `
|
|
499
|
+
nextAction: { kind: "run", command: `dl skill install ${payload.name}` },
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
502
|
const plan = emptyPlan("installed");
|
|
@@ -803,7 +803,7 @@ export async function runSkillInstall(names, opts, internal = {}) {
|
|
|
803
803
|
}
|
|
804
804
|
else {
|
|
805
805
|
const choices = bundled.length > 1 ? bundled : Object.keys(ctx.catalog.skills).sort();
|
|
806
|
-
return reject(opts, `name a skill: ${choices.join(", ")}`, "ambiguous", { kind: "run", command: "
|
|
806
|
+
return reject(opts, `name a skill: ${choices.join(", ")}`, "ambiguous", { kind: "run", command: "dl skill list" });
|
|
807
807
|
}
|
|
808
808
|
}
|
|
809
809
|
printHint(sel, opts);
|
|
@@ -845,7 +845,7 @@ function catalogOthers(catalog, exclude) {
|
|
|
845
845
|
}
|
|
846
846
|
function printInitFooter(result) {
|
|
847
847
|
const prefs = result.preferences;
|
|
848
|
-
process.stdout.write(` saved ${preferredAgents(prefs).join(" and ")}, ${prefs.scope} as the default for '
|
|
848
|
+
process.stdout.write(` saved ${preferredAgents(prefs).join(" and ")}, ${prefs.scope} as the default for 'dl skill' → ${prefs.path}\n`);
|
|
849
849
|
const others = result.available ?? [];
|
|
850
850
|
if (others.length === 0)
|
|
851
851
|
return;
|
|
@@ -853,7 +853,7 @@ function printInitFooter(result) {
|
|
|
853
853
|
process.stdout.write(`\n more skills in the catalog${result.catalog?.version ? ` (${fmtVersion(result.catalog.version)})` : ""}:\n`);
|
|
854
854
|
for (const o of others)
|
|
855
855
|
process.stdout.write(` ${o.name.padEnd(width)} ${o.description}\n`);
|
|
856
|
-
process.stdout.write(`\n Install more with:
|
|
856
|
+
process.stdout.write(`\n Install more with: dl skill install <name>\n`);
|
|
857
857
|
}
|
|
858
858
|
// ─── update ──────────────────────────────────────────────────────────────────
|
|
859
859
|
/** Names of every manifest-bearing skill directory under one resolved skills directory. */
|
|
@@ -901,7 +901,7 @@ export async function runSkillUpdate(names, opts) {
|
|
|
901
901
|
const ctx = await loadCatalog(bundleDir, false);
|
|
902
902
|
const common = { ...agentFields(sel), scope: sel.scope, catalog: info(ctx) };
|
|
903
903
|
if (requested.length === 0) {
|
|
904
|
-
const result = { status: "exists", ...common, skills: [], nextAction: { kind: "run", command: "
|
|
904
|
+
const result = { status: "exists", ...common, skills: [], nextAction: { kind: "run", command: "dl skill list" } };
|
|
905
905
|
if (opts.json) {
|
|
906
906
|
emitJson(result);
|
|
907
907
|
return 0;
|
|
@@ -909,7 +909,7 @@ export async function runSkillUpdate(names, opts) {
|
|
|
909
909
|
process.stdout.write(`skill update\n`);
|
|
910
910
|
header([[isMulti(sel) ? "agents" : "agent", sel.agents.join(", ")], ["scope", sel.scope === "dir" ? `dir ${sel.root}` : sel.scope]]);
|
|
911
911
|
warn(`no installed skills with a manifest under ${sel.targets.map((t) => t.dir).join(" or ")}`);
|
|
912
|
-
process.stdout.write(`\n next:
|
|
912
|
+
process.stdout.write(`\n next: dl skill list\n`);
|
|
913
913
|
return 0;
|
|
914
914
|
}
|
|
915
915
|
// Offline, the embedded copy may only stand in for a skill that was itself
|
|
@@ -1015,7 +1015,7 @@ function removeFrom(sel, t, name) {
|
|
|
1015
1015
|
const rejected = (message, kind, nextAction = null) => ({ result: { ...base, status: "error", error: message, kind, nextAction } });
|
|
1016
1016
|
const kind = kindOf(target);
|
|
1017
1017
|
if (kind === "absent")
|
|
1018
|
-
return rejected(`${name} is not installed at ${target}`, "not-installed", { kind: "run", command: "
|
|
1018
|
+
return rejected(`${name} is not installed at ${target}`, "not-installed", { kind: "run", command: "dl skill list" });
|
|
1019
1019
|
if (kind !== "dir")
|
|
1020
1020
|
return rejected(`${target} exists and is not a directory — nothing to remove safely`, "not-a-directory");
|
|
1021
1021
|
let manifest;
|
|
@@ -1145,7 +1145,7 @@ export async function runSkillList(opts) {
|
|
|
1145
1145
|
return reject(opts, sel.error, "invalid-agent");
|
|
1146
1146
|
const chosen = chooseSource(opts);
|
|
1147
1147
|
if (chosen instanceof RegistryError) {
|
|
1148
|
-
return reject(opts, chosen.message, chosen.kind, chosen.kind === "not-logged-in" ? { kind: "run", command: "
|
|
1148
|
+
return reject(opts, chosen.message, chosen.kind, chosen.kind === "not-logged-in" ? { kind: "run", command: "dl login" } : null);
|
|
1149
1149
|
}
|
|
1150
1150
|
const bundleDir = resolveBundleDir();
|
|
1151
1151
|
if (process.env[SKILLS_ENV] && !bundleDir) {
|
|
@@ -1317,7 +1317,7 @@ export async function runSkillInit(opts, io = {
|
|
|
1317
1317
|
return initInstall(opts, skillPreferences(agents, opts.global && !opts.dir && !opts.project ? "global" : "project"));
|
|
1318
1318
|
}
|
|
1319
1319
|
if (!io.interactive || Object.values(opts).some((v) => v !== undefined && v !== false)) {
|
|
1320
|
-
return reject(opts, "specify --agent claude, codex or all for non-interactive setup", "agent-required", { kind: "run", command: "
|
|
1320
|
+
return reject(opts, "specify --agent claude, codex or all for non-interactive setup", "agent-required", { kind: "run", command: "dl init --agent all" });
|
|
1321
1321
|
}
|
|
1322
1322
|
let agents;
|
|
1323
1323
|
let global;
|
|
@@ -1347,14 +1347,14 @@ function initInstall(opts, preferences) {
|
|
|
1347
1347
|
//
|
|
1348
1348
|
// NO `--version` OPTION HERE, EVER. `program.version(VERSION, "-v, --version")`
|
|
1349
1349
|
// (src/cli/index.ts:61) is resolved from any descendant command, so declaring
|
|
1350
|
-
// one would make `
|
|
1350
|
+
// one would make `dl skill install --version` print 0.6.0 and exit 0
|
|
1351
1351
|
// having installed nothing — the exact failure the docs' `runnable import
|
|
1352
1352
|
// --version` drift produced.
|
|
1353
1353
|
function scopeOptions(command) {
|
|
1354
1354
|
return command
|
|
1355
|
-
.option("--agent <agent>", "target agent: claude, codex, all, or a comma list (default: what
|
|
1355
|
+
.option("--agent <agent>", "target agent: claude, codex, all, or a comma list (default: what dl init saved, else claude)")
|
|
1356
1356
|
.option("--global", "use your home directory instead of the current project")
|
|
1357
|
-
.option("--project", "use the current project even if
|
|
1357
|
+
.option("--project", "use the current project even if dl init chose global")
|
|
1358
1358
|
.option("--dir <path>", "use this project root; overrides --global and --project");
|
|
1359
1359
|
}
|
|
1360
1360
|
function installationOptions(command) {
|
|
@@ -1366,7 +1366,7 @@ function installationOptions(command) {
|
|
|
1366
1366
|
export function registerSkillCommand(program) {
|
|
1367
1367
|
program.command("init")
|
|
1368
1368
|
.description("set up agent skills: choose an agent and scope, install the embedded dreamlake-cli skill offline")
|
|
1369
|
-
.option("--agent <agent>", "claude, codex, all, or a comma list; saved as the default for '
|
|
1369
|
+
.option("--agent <agent>", "claude, codex, all, or a comma list; saved as the default for 'dl skill' and skips the prompts")
|
|
1370
1370
|
.option("--global", "install under your home directory and save global scope")
|
|
1371
1371
|
.option("--dir <path>", "install under this project root; overrides --global")
|
|
1372
1372
|
.option("--force", "overwrite files that differ; files the skill does not own are kept")
|
|
@@ -1378,7 +1378,7 @@ export function registerSkillCommand(program) {
|
|
|
1378
1378
|
.description("install, update, remove, list and read agent skills from the dreamlake-skills release")
|
|
1379
1379
|
.addHelpText("after", `
|
|
1380
1380
|
Claude Code uses .claude/skills/; Codex uses .agents/skills/. --agent all installs into both, one copy each.
|
|
1381
|
-
'
|
|
1381
|
+
'dl init' saves the default agent(s) and scope; --agent, --global, --project and --dir override it.
|
|
1382
1382
|
install and update download from the public release; dreamlake-cli is embedded and installs offline.
|
|
1383
1383
|
Every install writes <skill>/.dreamlake-skill.json; update and remove touch only files it lists.
|
|
1384
1384
|
remove never deletes a file you edited: it is kept and reported.
|
|
@@ -1416,7 +1416,7 @@ bundle; --remote and --local choose explicitly. Every answer names its source an
|
|
|
1416
1416
|
});
|
|
1417
1417
|
collectionList(skill, "list")
|
|
1418
1418
|
.description("show the catalog with project/global installation status")
|
|
1419
|
-
.option("--agent <agent>", "target agent: claude, codex, all, or a comma list (default: what
|
|
1419
|
+
.option("--agent <agent>", "target agent: claude, codex, all, or a comma list (default: what dl init saved, else claude)")
|
|
1420
1420
|
.option("--refresh", "fetch the latest catalog from the release and show it next to the installed versions")
|
|
1421
1421
|
.option("--local", "rows from the catalog snapshot embedded in this CLI, offline")
|
|
1422
1422
|
.option("--remote", "rows from the server's skills registry (needs a login)")
|
package/dist/cli/skill/prefs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The agent(s) and scope `
|
|
1
|
+
// The agent(s) and scope `dl init` chose, remembered so every later
|
|
2
2
|
// `skill` subcommand defaults to them. Lives in the CLI state directory next
|
|
3
3
|
// to `skill-reminders.json`; `--agent`, `--global`, `--project` and `--dir`
|
|
4
4
|
// override it per invocation and never rewrite it.
|
package/dist/cli/skill/read.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl skill read <name> [--file <path>] [--local|--remote] [--json]`
|
|
2
2
|
//
|
|
3
3
|
// Print one file of a skill — SKILL.md by default — from the embedded bundle
|
|
4
4
|
// or the server registry (registry.ts decides which). The body is the whole
|
|
@@ -10,10 +10,10 @@ import { emitJson, fail } from "../helpers.js";
|
|
|
10
10
|
import { chooseSource, describeVersion, readFrom, RegistryError, } from "./registry.js";
|
|
11
11
|
function nextActionFor(error, name, opts) {
|
|
12
12
|
if (error.kind === "not-logged-in")
|
|
13
|
-
return { kind: "run", command: "
|
|
13
|
+
return { kind: "run", command: "dl login" };
|
|
14
14
|
// No local copy, or a local copy that is not the pinned one: the same read from the server answers for the pin.
|
|
15
15
|
if (error.kind === "not-embedded" || error.kind === "skill-file-mismatch") {
|
|
16
|
-
const parts = ["
|
|
16
|
+
const parts = ["dl", "skill", "read", name];
|
|
17
17
|
if (opts.file)
|
|
18
18
|
parts.push("--file", opts.file);
|
|
19
19
|
parts.push("--remote");
|
|
@@ -203,7 +203,7 @@ function registryFailure(error) {
|
|
|
203
203
|
}
|
|
204
204
|
if (error instanceof ApiError) {
|
|
205
205
|
const unauthorized = error.status === 401 || error.status === 403;
|
|
206
|
-
throw new RegistryError(unauthorized ? `the server refused the saved login (${error.status} ${error.code}); run '
|
|
206
|
+
throw new RegistryError(unauthorized ? `the server refused the saved login (${error.status} ${error.code}); run 'dl login'` : `the skills registry answered (${error.status}) ${error.code}`, unauthorized ? "unauthorized" : "registry-unreachable");
|
|
207
207
|
}
|
|
208
208
|
throw new RegistryError(`cannot reach the skills registry: ${error.message}`, "registry-unreachable");
|
|
209
209
|
}
|
|
@@ -229,7 +229,7 @@ export function chooseSource(opts) {
|
|
|
229
229
|
const connection = remoteConnection();
|
|
230
230
|
if (opts.remote) {
|
|
231
231
|
if (!connection)
|
|
232
|
-
return new RegistryError("--remote needs a login: run '
|
|
232
|
+
return new RegistryError("--remote needs a login: run 'dl login', or read the embedded copy with --local", "not-logged-in");
|
|
233
233
|
return { source: "remote", explicit: true, connection };
|
|
234
234
|
}
|
|
235
235
|
return connection ? { source: "remote", explicit: false, connection } : { source: "local", explicit: false, connection: null };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl snapshot` — archive this repo, upload it, register it, print the
|
|
2
2
|
// identifier.
|
|
3
3
|
//
|
|
4
4
|
// WHY IT IS ITS OWN COMMAND and not folded into `launch`. A snapshot is
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
// a `snapshot list` exists to read it back. Deferred, not rejected.
|
|
22
22
|
//
|
|
23
23
|
// Consequence, and the reason this file imports nothing from `config.ts`: no
|
|
24
|
-
// `ctx()`, no DreamLake token, no `
|
|
24
|
+
// `ctx()`, no DreamLake token, no `dl login`. Requiring a DreamLake
|
|
25
25
|
// login to snapshot code for a job would be a false gate.
|
|
26
26
|
import { emitJson, fail, humanSize, ok, warn } from "../helpers.js";
|
|
27
27
|
import { bool, callBridge, num, NO_SERVER_MESSAGE, resolveCpNamespace, resolveServer, str, } from "../python.js";
|
|
@@ -29,7 +29,7 @@ import { bool, callBridge, num, NO_SERVER_MESSAGE, resolveCpNamespace, resolveSe
|
|
|
29
29
|
function shortCommit(commit) {
|
|
30
30
|
return commit ? commit.slice(0, 7) : "(unknown)";
|
|
31
31
|
}
|
|
32
|
-
// ───
|
|
32
|
+
// ─── dl snapshot ──────────────────────────────────────────────────────
|
|
33
33
|
export async function runSnapshot(opts, deps = {}) {
|
|
34
34
|
// ── everything that can be rejected locally is rejected before any spawn ──
|
|
35
35
|
const server = resolveServer(opts.server);
|
|
@@ -93,7 +93,7 @@ export async function runSnapshot(opts, deps = {}) {
|
|
|
93
93
|
warn(`snapshot already registered — unchanged${suffix}`);
|
|
94
94
|
process.stdout.write(` id: ${id}\n`);
|
|
95
95
|
}
|
|
96
|
-
process.stdout.write(`
|
|
96
|
+
process.stdout.write(` dl launch <script> --snapshot ${id}\n`);
|
|
97
97
|
return 0;
|
|
98
98
|
}
|
|
99
99
|
/** The one error exit: prose to stderr, or folded into the `--json` object. */
|
|
@@ -116,7 +116,7 @@ function reject(opts, message, where, kind) {
|
|
|
116
116
|
// ─── registration ────────────────────────────────────────────────────────────
|
|
117
117
|
//
|
|
118
118
|
// NO `--version` OPTION HERE, EVER. `program.version()` is resolved from any
|
|
119
|
-
// descendant command, so declaring one would make `
|
|
119
|
+
// descendant command, so declaring one would make `dl snapshot
|
|
120
120
|
// --version` print 0.6.0 and exit 0 without snapshotting anything.
|
|
121
121
|
export function registerSnapshotCommand(program) {
|
|
122
122
|
program
|
|
@@ -135,12 +135,12 @@ export function registerSnapshotCommand(program) {
|
|
|
135
135
|
"Snapshots dedupe on (remote, commit): re-running on an unchanged tree uploads",
|
|
136
136
|
"nothing and gives you back the same id.",
|
|
137
137
|
"",
|
|
138
|
-
"This talks to the control plane only — it needs no `
|
|
138
|
+
"This talks to the control plane only — it needs no `dl login`.",
|
|
139
139
|
"",
|
|
140
140
|
"Examples:",
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
141
|
+
" dl snapshot",
|
|
142
|
+
" dl snapshot --server http://localhost:8080 --namespace default",
|
|
143
|
+
" dl launch train.py --snapshot $(dl snapshot --json | jq -r .id)",
|
|
144
144
|
].join("\n"))
|
|
145
145
|
.action(async (opts) => process.exit(await runSnapshot(opts)));
|
|
146
146
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `
|
|
1
|
+
// `dl source stat | editors | editor-add | editor-remove | references`
|
|
2
2
|
//
|
|
3
3
|
// Three server surfaces that had no CLI, grouped because they answer the same
|
|
4
4
|
// two questions an operator asks before changing anything: what is actually
|
|
@@ -518,7 +518,7 @@ export async function runSourceReferences(opts) {
|
|
|
518
518
|
process.stdout.write(" Deleting this source detaches every reference, not just these.\n");
|
|
519
519
|
}
|
|
520
520
|
if (nextCursor !== null) {
|
|
521
|
-
process.stdout.write(`\n More to come. Next page:\n
|
|
521
|
+
process.stdout.write(`\n More to come. Next page:\n dl source references --source ${source.name}` +
|
|
522
522
|
` --namespace ${c.ns} --cursor ${nextCursor}\n`);
|
|
523
523
|
}
|
|
524
524
|
return 0;
|
|
@@ -533,7 +533,7 @@ export function registerSourceAccessCommands(source) {
|
|
|
533
533
|
strictArgs(source.command("stat"))
|
|
534
534
|
.description("show one exact path in the resolved view, with its metadata")
|
|
535
535
|
.argument("<path>", "path within the source")
|
|
536
|
-
.requiredOption("--source <name>", "source name (see '
|
|
536
|
+
.requiredOption("--source <name>", "source name (see 'dl source list')")
|
|
537
537
|
.option("--namespace <slug>", "namespace slug (default: active login)")
|
|
538
538
|
.option("--json", "emit JSON")
|
|
539
539
|
.action(async (p, opts) => process.exit(await runSourceStat(p, opts)));
|