@dreamlake/dreamlake-cli 0.88.1 → 0.90.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/access.d.ts +83 -0
- package/dist/api/access.js +77 -0
- package/dist/api/agent.d.ts +156 -0
- package/dist/api/agent.js +111 -0
- package/dist/api/browser.d.ts +90 -0
- package/dist/api/browser.js +102 -0
- package/dist/api/client.d.ts +54 -0
- package/dist/api/client.js +102 -0
- package/dist/api/common.d.ts +28 -0
- package/dist/api/common.js +16 -0
- package/dist/api/content.d.ts +195 -0
- package/dist/api/content.js +147 -0
- package/dist/api/execution.d.ts +84 -0
- package/dist/api/execution.js +73 -0
- package/dist/api/http.d.ts +19 -0
- package/dist/api/http.js +66 -0
- package/dist/api/index.d.ts +2362 -0
- package/dist/api/index.js +116 -0
- package/dist/api/infra.d.ts +2 -0
- package/dist/api/infra.js +2 -0
- package/dist/api/jobs.d.ts +2 -0
- package/dist/api/jobs.js +2 -0
- package/dist/api/layout.d.ts +2 -0
- package/dist/api/layout.js +2 -0
- package/dist/api/library-edit.d.ts +3 -0
- package/dist/api/library-edit.js +3 -0
- package/dist/api/library-manifest.d.ts +2 -0
- package/dist/api/library-manifest.js +2 -0
- package/dist/api/note-character-plan.d.ts +2 -0
- package/dist/api/note-character-plan.js +2 -0
- package/dist/api/note-editing.d.ts +2 -0
- package/dist/api/note-editing.js +2 -0
- package/dist/api/note-edits.d.ts +21 -0
- package/dist/api/note-edits.js +10 -0
- package/dist/api/note-events.d.ts +5 -0
- package/dist/api/note-events.js +11 -0
- package/dist/api/note-files.d.ts +102 -0
- package/dist/api/note-files.js +107 -0
- package/dist/api/note-html-read.d.ts +2 -0
- package/dist/api/note-html-read.js +2 -0
- package/dist/api/note-html.d.ts +2 -0
- package/dist/api/note-html.js +2 -0
- package/dist/api/note-linger.d.ts +83 -0
- package/dist/api/note-linger.js +270 -0
- package/dist/api/note-presence.d.ts +82 -0
- package/dist/api/note-presence.js +72 -0
- package/dist/api/note-toc.d.ts +2 -0
- package/dist/api/note-toc.js +2 -0
- package/dist/api/notes.d.ts +329 -0
- package/dist/api/notes.js +209 -0
- package/dist/api/open-resources.d.ts +27 -0
- package/dist/api/open-resources.js +102 -0
- package/dist/api/ownership.d.ts +12 -0
- package/dist/api/ownership.js +24 -0
- package/dist/api/platform.d.ts +83 -0
- package/dist/api/platform.js +56 -0
- package/dist/api/presigned-transfer.d.ts +2 -0
- package/dist/api/presigned-transfer.js +2 -0
- package/dist/api/registered-runs.d.ts +48 -0
- package/dist/api/registered-runs.js +33 -0
- package/dist/api/sessions.d.ts +299 -0
- package/dist/api/sessions.js +105 -0
- package/dist/api/storage.d.ts +46 -0
- package/dist/api/storage.js +34 -0
- package/dist/api/streams.d.ts +18 -0
- package/dist/api/streams.js +70 -0
- package/dist/api/vault.d.ts +93 -0
- package/dist/api/vault.js +79 -0
- package/dist/api/workspace.d.ts +180 -0
- package/dist/api/workspace.js +146 -0
- package/dist/cli/agent-identity.d.ts +4 -0
- package/dist/cli/agent-identity.js +21 -0
- package/dist/cli/agents/identity.d.ts +50 -0
- package/dist/cli/agents/identity.js +105 -0
- package/dist/cli/agents/index.d.ts +31 -0
- package/dist/cli/agents/index.js +580 -0
- package/dist/cli/agents/manage.d.ts +43 -0
- package/dist/cli/agents/manage.js +376 -0
- package/dist/cli/agents/spec.d.ts +104 -0
- package/dist/cli/agents/spec.js +280 -0
- package/dist/cli/agents/web.d.ts +7 -0
- package/dist/cli/agents/web.js +109 -0
- package/dist/cli/artifact/incremental.d.ts +21 -0
- package/dist/cli/artifact/incremental.js +80 -0
- package/dist/cli/artifact/index.d.ts +52 -0
- package/dist/cli/artifact/index.js +405 -0
- package/dist/cli/artifact/meta.d.ts +69 -0
- package/dist/cli/artifact/meta.js +189 -0
- package/dist/cli/auth/commands.d.ts +29 -0
- package/dist/cli/auth/commands.js +327 -0
- package/dist/cli/auth/constants.d.ts +13 -0
- package/dist/cli/auth/constants.js +18 -0
- package/dist/cli/auth/credentials.d.ts +37 -0
- package/dist/cli/auth/credentials.js +155 -0
- package/dist/cli/auth/device-flow.d.ts +32 -0
- package/dist/cli/auth/device-flow.js +154 -0
- package/dist/cli/auth/device-secret.d.ts +6 -0
- package/dist/cli/auth/device-secret.js +26 -0
- package/dist/cli/auth/machine.d.ts +15 -0
- package/dist/cli/auth/machine.js +126 -0
- package/dist/cli/auth/materialized.d.ts +32 -0
- package/dist/cli/auth/materialized.js +102 -0
- package/dist/cli/auth/migrate.d.ts +10 -0
- package/dist/cli/auth/migrate.js +75 -0
- package/dist/cli/client.d.ts +102 -0
- package/dist/cli/client.js +206 -0
- package/dist/cli/collection-list.d.ts +3 -0
- package/dist/cli/collection-list.js +25 -0
- package/dist/cli/compat/ctx.d.ts +26 -0
- package/dist/cli/compat/ctx.js +76 -0
- package/dist/cli/compat/dreamdb-wasm-embedded.d.ts +2 -0
- package/dist/cli/compat/dreamdb-wasm-embedded.js +8 -0
- package/dist/cli/compat/dreamdb-wasm.d.ts +1 -0
- package/dist/cli/compat/dreamdb-wasm.js +26 -0
- package/dist/cli/compat/dreamdb.d.ts +112 -0
- package/dist/cli/compat/dreamdb.js +219 -0
- package/dist/cli/compat/flags.d.ts +2 -0
- package/dist/cli/compat/flags.js +13 -0
- package/dist/cli/compat/http.d.ts +23 -0
- package/dist/cli/compat/http.js +137 -0
- package/dist/cli/compat/presignedTransfer.d.ts +139 -0
- package/dist/cli/compat/presignedTransfer.js +580 -0
- package/dist/cli/compat/s3-backend.d.ts +73 -0
- package/dist/cli/compat/s3-backend.js +132 -0
- package/dist/cli/config.d.ts +22 -0
- package/dist/cli/config.js +96 -0
- package/dist/cli/connection/dto.d.ts +159 -0
- package/dist/cli/connection/dto.js +497 -0
- package/dist/cli/connection/index.d.ts +50 -0
- package/dist/cli/connection/index.js +413 -0
- package/dist/cli/connection/oauth.d.ts +23 -0
- package/dist/cli/connection/oauth.js +290 -0
- package/dist/cli/connection/write.d.ts +47 -0
- package/dist/cli/connection/write.js +573 -0
- package/dist/cli/create/index.d.ts +19 -0
- package/dist/cli/create/index.js +209 -0
- package/dist/cli/declare/index.d.ts +29 -0
- package/dist/cli/declare/index.js +304 -0
- package/dist/cli/delete/index.d.ts +18 -0
- package/dist/cli/delete/index.js +232 -0
- package/dist/cli/download/index.d.ts +9 -0
- package/dist/cli/download/index.js +128 -0
- package/dist/cli/env/compose.d.ts +88 -0
- package/dist/cli/env/compose.js +402 -0
- package/dist/cli/env/index.d.ts +176 -0
- package/dist/cli/env/index.js +1011 -0
- package/dist/cli/experiments/index.d.ts +11 -0
- package/dist/cli/experiments/index.js +168 -0
- package/dist/cli/glob.d.ts +1 -0
- package/dist/cli/glob.js +45 -0
- package/dist/cli/graphql-helpers.d.ts +23 -0
- package/dist/cli/graphql-helpers.js +42 -0
- package/dist/cli/graphql.d.ts +10 -0
- package/dist/cli/graphql.js +47 -0
- package/dist/cli/help-examples.generated.d.ts +1 -0
- package/dist/cli/help-examples.generated.js +192 -0
- package/dist/cli/helpers.d.ts +8 -0
- package/dist/cli/helpers.js +106 -0
- package/dist/cli/hosts/api.d.ts +29 -0
- package/dist/cli/hosts/api.js +54 -0
- package/dist/cli/hosts/bootstrap-source.d.ts +1 -0
- package/dist/cli/hosts/bootstrap-source.js +2 -0
- package/dist/cli/hosts/catalog.d.ts +26 -0
- package/dist/cli/hosts/catalog.js +55 -0
- package/dist/cli/hosts/config.d.ts +45 -0
- package/dist/cli/hosts/config.js +179 -0
- package/dist/cli/hosts/credentials.d.ts +19 -0
- package/dist/cli/hosts/credentials.js +173 -0
- package/dist/cli/hosts/enroll.d.ts +17 -0
- package/dist/cli/hosts/enroll.js +109 -0
- package/dist/cli/hosts/enrollments.d.ts +25 -0
- package/dist/cli/hosts/enrollments.js +54 -0
- package/dist/cli/hosts/index.d.ts +6 -0
- package/dist/cli/hosts/index.js +279 -0
- package/dist/cli/hosts/inventory.d.ts +40 -0
- package/dist/cli/hosts/inventory.js +91 -0
- package/dist/cli/hosts/lifecycle.d.ts +15 -0
- package/dist/cli/hosts/lifecycle.js +108 -0
- package/dist/cli/hosts/metrics-source.d.ts +12 -0
- package/dist/cli/hosts/metrics-source.js +89 -0
- package/dist/cli/hosts/observations.d.ts +39 -0
- package/dist/cli/hosts/observations.js +102 -0
- package/dist/cli/hosts/remote.d.ts +5 -0
- package/dist/cli/hosts/remote.js +66 -0
- package/dist/cli/hosts/ssh.d.ts +63 -0
- package/dist/cli/hosts/ssh.js +276 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +288 -0
- package/dist/cli/infra/api.d.ts +95 -0
- package/dist/cli/infra/api.js +291 -0
- package/dist/cli/infra/index.d.ts +5 -0
- package/dist/cli/infra/index.js +102 -0
- package/dist/cli/infra/move.d.ts +15 -0
- package/dist/cli/infra/move.js +123 -0
- package/dist/cli/infra/transfer.d.ts +15 -0
- package/dist/cli/infra/transfer.js +280 -0
- package/dist/cli/jobs/api.d.ts +69 -0
- package/dist/cli/jobs/api.js +121 -0
- package/dist/cli/jobs/index.d.ts +5 -0
- package/dist/cli/jobs/index.js +140 -0
- package/dist/cli/lakeshore/index.d.ts +98 -0
- package/dist/cli/lakeshore/index.js +502 -0
- package/dist/cli/launch/index.d.ts +43 -0
- package/dist/cli/launch/index.js +270 -0
- package/dist/cli/layout/index.d.ts +2 -0
- package/dist/cli/layout/index.js +44 -0
- package/dist/cli/layout/transport.d.ts +12 -0
- package/dist/cli/layout/transport.js +70 -0
- package/dist/cli/library/add.d.ts +60 -0
- package/dist/cli/library/add.js +348 -0
- package/dist/cli/library/cache.d.ts +26 -0
- package/dist/cli/library/cache.js +88 -0
- package/dist/cli/library/config.d.ts +75 -0
- package/dist/cli/library/config.js +198 -0
- package/dist/cli/library/digest.d.ts +5 -0
- package/dist/cli/library/digest.js +19 -0
- package/dist/cli/library/discover.d.ts +87 -0
- package/dist/cli/library/discover.js +534 -0
- package/dist/cli/library/freshness.d.ts +35 -0
- package/dist/cli/library/freshness.js +109 -0
- package/dist/cli/library/generation.d.ts +35 -0
- package/dist/cli/library/generation.js +211 -0
- package/dist/cli/library/index.d.ts +2 -0
- package/dist/cli/library/index.js +36 -0
- package/dist/cli/library/info.d.ts +69 -0
- package/dist/cli/library/info.js +311 -0
- package/dist/cli/library/list.d.ts +33 -0
- package/dist/cli/library/list.js +86 -0
- package/dist/cli/library/manifest.d.ts +81 -0
- package/dist/cli/library/manifest.js +200 -0
- package/dist/cli/library/manifestCache.d.ts +45 -0
- package/dist/cli/library/manifestCache.js +169 -0
- package/dist/cli/library/pull.d.ts +30 -0
- package/dist/cli/library/pull.js +438 -0
- package/dist/cli/library/push.d.ts +72 -0
- package/dist/cli/library/push.js +642 -0
- package/dist/cli/library/rm.d.ts +31 -0
- package/dist/cli/library/rm.js +200 -0
- package/dist/cli/library/search.d.ts +18 -0
- package/dist/cli/library/search.js +181 -0
- package/dist/cli/library/stat.d.ts +15 -0
- package/dist/cli/library/stat.js +127 -0
- package/dist/cli/library/tools.d.ts +104 -0
- package/dist/cli/library/tools.js +163 -0
- package/dist/cli/library/wire.d.ts +47 -0
- package/dist/cli/library/wire.js +120 -0
- package/dist/cli/list/index.d.ts +26 -0
- package/dist/cli/list/index.js +256 -0
- package/dist/cli/notes/api-transport.d.ts +5 -0
- package/dist/cli/notes/api-transport.js +20 -0
- package/dist/cli/notes/character-plan.d.ts +22 -0
- package/dist/cli/notes/character-plan.js +232 -0
- package/dist/cli/notes/document.d.ts +73 -0
- package/dist/cli/notes/document.js +306 -0
- package/dist/cli/notes/edit-commands.d.ts +106 -0
- package/dist/cli/notes/edit-commands.js +623 -0
- package/dist/cli/notes/editing.d.ts +81 -0
- package/dist/cli/notes/editing.js +305 -0
- package/dist/cli/notes/events.d.ts +36 -0
- package/dist/cli/notes/events.js +54 -0
- package/dist/cli/notes/files-commands.d.ts +97 -0
- package/dist/cli/notes/files-commands.js +548 -0
- package/dist/cli/notes/html-read.d.ts +9 -0
- package/dist/cli/notes/html-read.js +90 -0
- package/dist/cli/notes/html.d.ts +73 -0
- package/dist/cli/notes/html.js +381 -0
- package/dist/cli/notes/index.d.ts +123 -0
- package/dist/cli/notes/index.js +1300 -0
- package/dist/cli/notes/linger.d.ts +4 -0
- package/dist/cli/notes/linger.js +96 -0
- package/dist/cli/notes/media-commands.d.ts +5 -0
- package/dist/cli/notes/media-commands.js +51 -0
- package/dist/cli/notes/move-command.d.ts +83 -0
- package/dist/cli/notes/move-command.js +259 -0
- package/dist/cli/notes/rm-command.d.ts +22 -0
- package/dist/cli/notes/rm-command.js +110 -0
- package/dist/cli/notes/select-command.d.ts +12 -0
- package/dist/cli/notes/select-command.js +63 -0
- package/dist/cli/notes/suggest-diff.d.ts +56 -0
- package/dist/cli/notes/suggest-diff.js +311 -0
- package/dist/cli/notes/toc.d.ts +38 -0
- package/dist/cli/notes/toc.js +144 -0
- package/dist/cli/notes/transfer-command.d.ts +6 -0
- package/dist/cli/notes/transfer-command.js +9 -0
- package/dist/cli/notes/version-commands.d.ts +19 -0
- package/dist/cli/notes/version-commands.js +178 -0
- package/dist/cli/nymph/index.d.ts +74 -0
- package/dist/cli/nymph/index.js +349 -0
- package/dist/cli/org/index.d.ts +34 -0
- package/dist/cli/org/index.js +341 -0
- package/dist/cli/ownership/index.d.ts +12 -0
- package/dist/cli/ownership/index.js +122 -0
- package/dist/cli/ownership/metadata-transfer.d.ts +20 -0
- package/dist/cli/ownership/metadata-transfer.js +159 -0
- package/dist/cli/page/index.d.ts +58 -0
- package/dist/cli/page/index.js +387 -0
- package/dist/cli/pipeline/index.d.ts +69 -0
- package/dist/cli/pipeline/index.js +604 -0
- package/dist/cli/progress.d.ts +60 -0
- package/dist/cli/progress.js +276 -0
- package/dist/cli/project/attachments.d.ts +10 -0
- package/dist/cli/project/attachments.js +39 -0
- package/dist/cli/project/grants.d.ts +10 -0
- package/dist/cli/project/grants.js +39 -0
- package/dist/cli/project/index.d.ts +8 -0
- package/dist/cli/project/index.js +92 -0
- package/dist/cli/project/move.d.ts +57 -0
- package/dist/cli/project/move.js +242 -0
- package/dist/cli/project/output.d.ts +2 -0
- package/dist/cli/project/output.js +29 -0
- package/dist/cli/project/stream.d.ts +55 -0
- package/dist/cli/project/stream.js +207 -0
- package/dist/cli/project/transfer-preview.d.ts +8 -0
- package/dist/cli/project/transfer-preview.js +10 -0
- package/dist/cli/prompt.d.ts +1 -0
- package/dist/cli/prompt.js +17 -0
- package/dist/cli/provider/dreamdir.d.ts +52 -0
- package/dist/cli/provider/dreamdir.js +138 -0
- package/dist/cli/provider/index.d.ts +4 -0
- package/dist/cli/provider/index.js +419 -0
- package/dist/cli/provider/jump-worker.d.ts +9 -0
- package/dist/cli/provider/jump-worker.js +141 -0
- package/dist/cli/provider/lifecycle.d.ts +149 -0
- package/dist/cli/provider/lifecycle.js +1390 -0
- package/dist/cli/provider/machine.d.ts +17 -0
- package/dist/cli/provider/machine.js +116 -0
- package/dist/cli/provider/ssh.d.ts +105 -0
- package/dist/cli/provider/ssh.js +305 -0
- package/dist/cli/provider/terraform.d.ts +140 -0
- package/dist/cli/provider/terraform.js +288 -0
- package/dist/cli/providers/index.d.ts +18 -0
- package/dist/cli/providers/index.js +422 -0
- package/dist/cli/python.d.ts +61 -0
- package/dist/cli/python.js +255 -0
- package/dist/cli/queues/index.d.ts +33 -0
- package/dist/cli/queues/index.js +248 -0
- package/dist/cli/queues/slurm.d.ts +10 -0
- package/dist/cli/queues/slurm.js +134 -0
- package/dist/cli/resources.d.ts +72 -0
- package/dist/cli/resources.js +137 -0
- package/dist/cli/run/index.d.ts +15 -0
- package/dist/cli/run/index.js +163 -0
- package/dist/cli/run/input.d.ts +34 -0
- package/dist/cli/run/input.js +135 -0
- package/dist/cli/run/recovery.d.ts +2 -0
- package/dist/cli/run/recovery.js +18 -0
- package/dist/cli/run/setup.d.ts +3 -0
- package/dist/cli/run/setup.js +62 -0
- package/dist/cli/runconfig/index.d.ts +12 -0
- package/dist/cli/runconfig/index.js +130 -0
- package/dist/cli/runnable/index.d.ts +35 -0
- package/dist/cli/runnable/index.js +575 -0
- package/dist/cli/runnable/path.d.ts +115 -0
- package/dist/cli/runnable/path.js +288 -0
- package/dist/cli/runnable/run.d.ts +91 -0
- package/dist/cli/runnable/run.js +239 -0
- package/dist/cli/runnable/upload.d.ts +43 -0
- package/dist/cli/runnable/upload.js +342 -0
- package/dist/cli/runnable/worker.d.ts +1 -0
- package/dist/cli/runnable/worker.js +44 -0
- package/dist/cli/schemas/workflow-spec.schema.json +335 -0
- package/dist/cli/self-update/index.d.ts +5 -0
- package/dist/cli/self-update/index.js +107 -0
- package/dist/cli/self-update/install.d.ts +60 -0
- package/dist/cli/self-update/install.js +428 -0
- package/dist/cli/self-update/paths.d.ts +40 -0
- package/dist/cli/self-update/paths.js +87 -0
- package/dist/cli/self-update/releases.d.ts +41 -0
- package/dist/cli/self-update/releases.js +153 -0
- package/dist/cli/self-update/settings.d.ts +16 -0
- package/dist/cli/self-update/settings.js +68 -0
- package/dist/cli/self-update/update.d.ts +18 -0
- package/dist/cli/self-update/update.js +241 -0
- package/dist/cli/service-accounts/index.d.ts +3 -0
- package/dist/cli/service-accounts/index.js +149 -0
- package/dist/cli/session-affiliation.d.ts +26 -0
- package/dist/cli/session-affiliation.js +135 -0
- package/dist/cli/sessions/affiliation.d.ts +8 -0
- package/dist/cli/sessions/affiliation.js +66 -0
- package/dist/cli/sessions/api.d.ts +55 -0
- package/dist/cli/sessions/api.js +88 -0
- package/dist/cli/sessions/control.d.ts +6 -0
- package/dist/cli/sessions/control.js +159 -0
- package/dist/cli/sessions/conversation.d.ts +15 -0
- package/dist/cli/sessions/conversation.js +118 -0
- package/dist/cli/sessions/index.d.ts +2 -0
- package/dist/cli/sessions/index.js +209 -0
- package/dist/cli/sessions/managed.d.ts +39 -0
- package/dist/cli/sessions/managed.js +63 -0
- package/dist/cli/sessions/redaction.d.ts +2 -0
- package/dist/cli/sessions/redaction.js +11 -0
- package/dist/cli/sessions/runner/exec.d.ts +108 -0
- package/dist/cli/sessions/runner/exec.js +335 -0
- package/dist/cli/sessions/runner/journal.d.ts +26 -0
- package/dist/cli/sessions/runner/journal.js +49 -0
- package/dist/cli/sessions/runner/native.d.ts +48 -0
- package/dist/cli/sessions/runner/native.js +170 -0
- package/dist/cli/sessions/runner/pod.d.ts +30 -0
- package/dist/cli/sessions/runner/pod.js +129 -0
- package/dist/cli/sessions/runner/serve.d.ts +85 -0
- package/dist/cli/sessions/runner/serve.js +558 -0
- package/dist/cli/sessions/sync.d.ts +47 -0
- package/dist/cli/sessions/sync.js +80 -0
- package/dist/cli/sessions/transport.d.ts +14 -0
- package/dist/cli/sessions/transport.js +116 -0
- package/dist/cli/share.d.ts +15 -0
- package/dist/cli/share.js +139 -0
- package/dist/cli/skill/catalog.d.ts +141 -0
- package/dist/cli/skill/catalog.js +442 -0
- package/dist/cli/skill/files.d.ts +89 -0
- package/dist/cli/skill/files.js +264 -0
- package/dist/cli/skill/index.d.ts +268 -0
- package/dist/cli/skill/index.js +1216 -0
- package/dist/cli/skill/manifest.d.ts +30 -0
- package/dist/cli/skill/manifest.js +101 -0
- package/dist/cli/skill/prefs.d.ts +9 -0
- package/dist/cli/skill/prefs.js +32 -0
- package/dist/cli/skill/reminders.d.ts +15 -0
- package/dist/cli/skill/reminders.js +105 -0
- package/dist/cli/skill/tar.d.ts +17 -0
- package/dist/cli/skill/tar.js +195 -0
- package/dist/cli/snapshot/index.d.ts +24 -0
- package/dist/cli/snapshot/index.js +146 -0
- package/dist/cli/source/access.d.ts +45 -0
- package/dist/cli/source/access.js +563 -0
- package/dist/cli/source/control.d.ts +103 -0
- package/dist/cli/source/control.js +546 -0
- package/dist/cli/source/delete.d.ts +89 -0
- package/dist/cli/source/delete.js +463 -0
- package/dist/cli/source/index.d.ts +288 -0
- package/dist/cli/source/index.js +1348 -0
- package/dist/cli/source/share.d.ts +65 -0
- package/dist/cli/source/share.js +530 -0
- package/dist/cli/source/upload.d.ts +62 -0
- package/dist/cli/source/upload.js +258 -0
- package/dist/cli/source/write.d.ts +77 -0
- package/dist/cli/source/write.js +335 -0
- package/dist/cli/spawn.d.ts +28 -0
- package/dist/cli/spawn.js +81 -0
- package/dist/cli/target.d.ts +22 -0
- package/dist/cli/target.js +85 -0
- package/dist/cli/tasks/index.d.ts +38 -0
- package/dist/cli/tasks/index.js +365 -0
- package/dist/cli/team/index.d.ts +37 -0
- package/dist/cli/team/index.js +407 -0
- package/dist/cli/telemetry.d.ts +23 -0
- package/dist/cli/telemetry.js +262 -0
- package/dist/cli/telemetryJournal.d.ts +26 -0
- package/dist/cli/telemetryJournal.js +104 -0
- package/dist/cli/update/index.d.ts +21 -0
- package/dist/cli/update/index.js +284 -0
- package/dist/cli/upload/index.d.ts +11 -0
- package/dist/cli/upload/index.js +261 -0
- package/dist/cli/upload/kinds.d.ts +10 -0
- package/dist/cli/upload/kinds.js +85 -0
- package/dist/cli/upload/multipart.d.ts +21 -0
- package/dist/cli/upload/multipart.js +248 -0
- package/dist/cli/vault/affected-preview.d.ts +15 -0
- package/dist/cli/vault/affected-preview.js +38 -0
- package/dist/cli/vault/cloud.d.ts +55 -0
- package/dist/cli/vault/cloud.js +287 -0
- package/dist/cli/vault/format.d.ts +18 -0
- package/dist/cli/vault/format.js +104 -0
- package/dist/cli/vault/hostCredentials.d.ts +21 -0
- package/dist/cli/vault/hostCredentials.js +71 -0
- package/dist/cli/vault/hostSupersessions.d.ts +18 -0
- package/dist/cli/vault/hostSupersessions.js +68 -0
- package/dist/cli/vault/import.d.ts +3 -0
- package/dist/cli/vault/import.js +79 -0
- package/dist/cli/vault/index.d.ts +14 -0
- package/dist/cli/vault/index.js +225 -0
- package/dist/cli/vault/keys.d.ts +5 -0
- package/dist/cli/vault/keys.js +165 -0
- package/dist/cli/vault/kms.d.ts +6 -0
- package/dist/cli/vault/kms.js +169 -0
- package/dist/cli/vault/list.d.ts +13 -0
- package/dist/cli/vault/list.js +60 -0
- package/dist/cli/vault/listView.d.ts +21 -0
- package/dist/cli/vault/listView.js +123 -0
- package/dist/cli/vault/managementMetadata.d.ts +2 -0
- package/dist/cli/vault/managementMetadata.js +23 -0
- package/dist/cli/vault/mutations.d.ts +8 -0
- package/dist/cli/vault/mutations.js +151 -0
- package/dist/cli/vault/otp.d.ts +6 -0
- package/dist/cli/vault/otp.js +62 -0
- package/dist/cli/vault/otpIntent.d.ts +23 -0
- package/dist/cli/vault/otpIntent.js +76 -0
- package/dist/cli/vault/passImport.d.ts +25 -0
- package/dist/cli/vault/passImport.js +129 -0
- package/dist/cli/vault/passOtp.d.ts +51 -0
- package/dist/cli/vault/passOtp.js +101 -0
- package/dist/cli/vault/passStore.d.ts +26 -0
- package/dist/cli/vault/passStore.js +134 -0
- package/dist/cli/vault/passwordCommand.d.ts +39 -0
- package/dist/cli/vault/passwordCommand.js +101 -0
- package/dist/cli/vault/passwordProbe.d.ts +27 -0
- package/dist/cli/vault/passwordProbe.js +282 -0
- package/dist/cli/vault/passwordRotation.d.ts +9 -0
- package/dist/cli/vault/passwordRotation.js +273 -0
- package/dist/cli/vault/rotationApi.d.ts +13 -0
- package/dist/cli/vault/rotationApi.js +58 -0
- package/dist/cli/vault/rotationCommand.d.ts +2 -0
- package/dist/cli/vault/rotationCommand.js +75 -0
- package/dist/cli/vault/rotationEngine.d.ts +19 -0
- package/dist/cli/vault/rotationEngine.js +65 -0
- package/dist/cli/vault/rotationHelperSource.d.ts +2 -0
- package/dist/cli/vault/rotationHelperSource.js +3 -0
- package/dist/cli/vault/rotationInput.d.ts +11 -0
- package/dist/cli/vault/rotationInput.js +48 -0
- package/dist/cli/vault/rotationJournal.d.ts +16 -0
- package/dist/cli/vault/rotationJournal.js +183 -0
- package/dist/cli/vault/rotationKeys.d.ts +4 -0
- package/dist/cli/vault/rotationKeys.js +48 -0
- package/dist/cli/vault/rotationPrepare.d.ts +17 -0
- package/dist/cli/vault/rotationPrepare.js +108 -0
- package/dist/cli/vault/rotationRemote.d.ts +33 -0
- package/dist/cli/vault/rotationRemote.js +156 -0
- package/dist/cli/vault/rotationState.d.ts +42 -0
- package/dist/cli/vault/rotationState.js +115 -0
- package/dist/cli/vault/rotationTransport.d.ts +18 -0
- package/dist/cli/vault/rotationTransport.js +71 -0
- package/dist/cli/vault/sshSource.d.ts +18 -0
- package/dist/cli/vault/sshSource.js +196 -0
- package/dist/cli/vault/sshSync.d.ts +17 -0
- package/dist/cli/vault/sshSync.js +224 -0
- package/dist/cli/vault/sshTransfer.d.ts +22 -0
- package/dist/cli/vault/sshTransfer.js +140 -0
- package/dist/cli/vault/terraformState.d.ts +66 -0
- package/dist/cli/vault/terraformState.js +252 -0
- package/dist/cli/vault/terraformStateCommand.d.ts +2 -0
- package/dist/cli/vault/terraformStateCommand.js +61 -0
- package/dist/cli/vault/tree.d.ts +43 -0
- package/dist/cli/vault/tree.js +292 -0
- package/dist/cli/version.d.ts +1 -0
- package/dist/cli/version.js +9 -0
- package/dist/cli/workflow/index.d.ts +76 -0
- package/dist/cli/workflow/index.js +826 -0
- package/dist/cli/workflow/validate.d.ts +19 -0
- package/dist/cli/workflow/validate.js +353 -0
- package/dist/package.json +1 -0
- package/package.json +28 -10
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
// `dreamlake delete bindr|dataset <name> --project <target> [--yes]`.
|
|
2
|
+
// Port of dreamlake-py's cli/commands/delete.py.
|
|
3
|
+
import { HttpError, requestJson } from "../client.js";
|
|
4
|
+
import { resolveNamespace, resolveRemote, resolveToken } from "../config.js";
|
|
5
|
+
import { fail, ok } from "../helpers.js";
|
|
6
|
+
import { confirm } from "../prompt.js";
|
|
7
|
+
import { fetchAllEpisodes, fetchProjects, lookupNode, resolveProjectCtx, } from "../resources.js";
|
|
8
|
+
import { formatProject, parseTarget } from "../target.js";
|
|
9
|
+
async function runDelete(kind, name, opts) {
|
|
10
|
+
if (!opts.project) {
|
|
11
|
+
fail("--project is required");
|
|
12
|
+
return 1;
|
|
13
|
+
}
|
|
14
|
+
const ctx = await resolveProjectCtx(opts.project);
|
|
15
|
+
if (!ctx)
|
|
16
|
+
return 1;
|
|
17
|
+
const { s, token, remote } = ctx;
|
|
18
|
+
const proj = formatProject(s);
|
|
19
|
+
if (!opts.yes) {
|
|
20
|
+
const proceed = await confirm(`Delete ${kind} '${name}' from ${proj}?`, false);
|
|
21
|
+
if (!proceed) {
|
|
22
|
+
process.stdout.write("Cancelled.\n");
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const collection = kind === "bindr" ? "bindrs" : "datasets";
|
|
27
|
+
try {
|
|
28
|
+
await requestJson(remote, `/namespaces/${s.namespace}/projects/${s.project}/${collection}/${name}`, { method: "DELETE", token });
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
if (err instanceof HttpError && err.status === 404) {
|
|
32
|
+
fail(`${kind} '${name}' not found in ${proj}`);
|
|
33
|
+
return 1;
|
|
34
|
+
}
|
|
35
|
+
fail(err.message);
|
|
36
|
+
return 1;
|
|
37
|
+
}
|
|
38
|
+
ok(`Deleted ${kind}: ${name} from ${proj}`);
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
export const runDeleteBindr = (name, opts) => runDelete("bindr", name, opts);
|
|
42
|
+
export const runDeleteDataset = (name, opts) => runDelete("dataset", name, opts);
|
|
43
|
+
// ─── node deletions (DELETE /nodes/:id) ───
|
|
44
|
+
//
|
|
45
|
+
// By stable id, so a project re-created under the same slug while the prompt
|
|
46
|
+
// was open is never the one deleted. A project node gets the server's soft
|
|
47
|
+
// delete (issue #1340); an episode or file is hard-deleted with its subtree.
|
|
48
|
+
async function deleteNodeById(remote, token, nodeId) {
|
|
49
|
+
const res = await requestJson(remote, `/nodes/${nodeId}`, {
|
|
50
|
+
method: "DELETE",
|
|
51
|
+
token,
|
|
52
|
+
});
|
|
53
|
+
return res.deleted ?? 1;
|
|
54
|
+
}
|
|
55
|
+
export async function runDeleteProject(slug, opts) {
|
|
56
|
+
const remote = resolveRemote();
|
|
57
|
+
const token = resolveToken();
|
|
58
|
+
if (!token) {
|
|
59
|
+
fail("not authenticated. run 'dreamlake login' first");
|
|
60
|
+
return 1;
|
|
61
|
+
}
|
|
62
|
+
const namespace = await resolveNamespace(opts.namespace, { token, remote });
|
|
63
|
+
if (!namespace) {
|
|
64
|
+
fail("namespace not specified and no authenticated user found. run 'dreamlake login'");
|
|
65
|
+
return 1;
|
|
66
|
+
}
|
|
67
|
+
const projects = await fetchProjects(remote, token, namespace);
|
|
68
|
+
const proj = projects.find((p) => p.slug === slug);
|
|
69
|
+
if (!proj) {
|
|
70
|
+
fail(`project '${slug}' not found in namespace ${namespace}`);
|
|
71
|
+
return 1;
|
|
72
|
+
}
|
|
73
|
+
if (!opts.yes) {
|
|
74
|
+
const proceed = await confirm(`Delete project '${slug}' (${namespace})? Its files become inaccessible, everything filed in it is unfiled (the resources are kept), its access grants are removed, and the slug becomes free. There is no restore.`, false);
|
|
75
|
+
if (!proceed) {
|
|
76
|
+
process.stdout.write("Cancelled.\n");
|
|
77
|
+
return 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
await deleteNodeById(remote, token, proj.id);
|
|
82
|
+
ok(`Deleted project: ${slug}`);
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
fail(err.message);
|
|
87
|
+
return 1;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export async function runDeleteEpisode(name, opts) {
|
|
91
|
+
if (!opts.project) {
|
|
92
|
+
fail("--project is required");
|
|
93
|
+
return 1;
|
|
94
|
+
}
|
|
95
|
+
const ctx = await resolveProjectCtx(opts.project);
|
|
96
|
+
if (!ctx)
|
|
97
|
+
return 1;
|
|
98
|
+
const { s, token, remote } = ctx;
|
|
99
|
+
const proj = formatProject(s);
|
|
100
|
+
const episodes = await fetchAllEpisodes(remote, s.namespace, s.project, token);
|
|
101
|
+
const ep = episodes.find((e) => e.name === name);
|
|
102
|
+
if (!ep) {
|
|
103
|
+
fail(`episode '${name}' not found in ${proj}`);
|
|
104
|
+
return 1;
|
|
105
|
+
}
|
|
106
|
+
if (!opts.yes) {
|
|
107
|
+
const proceed = await confirm(`HARD-DELETE episode '${name}' from ${proj} and all files inside it?`, false);
|
|
108
|
+
if (!proceed) {
|
|
109
|
+
process.stdout.write("Cancelled.\n");
|
|
110
|
+
return 0;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
const deleted = await deleteNodeById(remote, token, ep.id);
|
|
115
|
+
ok(`Deleted episode: ${name} from ${proj} (${deleted} node(s) removed)`);
|
|
116
|
+
return 0;
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
fail(err.message);
|
|
120
|
+
return 1;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
export async function runDeleteFile(filePath, opts) {
|
|
124
|
+
if (!opts.episode) {
|
|
125
|
+
fail("--episode is required");
|
|
126
|
+
return 1;
|
|
127
|
+
}
|
|
128
|
+
let t;
|
|
129
|
+
try {
|
|
130
|
+
t = parseTarget(opts.episode);
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
fail(err.message);
|
|
134
|
+
return 1;
|
|
135
|
+
}
|
|
136
|
+
const remote = resolveRemote();
|
|
137
|
+
const token = resolveToken();
|
|
138
|
+
if (!token) {
|
|
139
|
+
fail("not authenticated. run 'dreamlake login' first");
|
|
140
|
+
return 1;
|
|
141
|
+
}
|
|
142
|
+
const namespace = await resolveNamespace(t.namespace, { token, remote });
|
|
143
|
+
if (!namespace) {
|
|
144
|
+
fail("namespace not specified and no authenticated user found. run 'dreamlake login'");
|
|
145
|
+
return 1;
|
|
146
|
+
}
|
|
147
|
+
const assetPath = "/" + filePath.replace(/^\/+/, "");
|
|
148
|
+
let node;
|
|
149
|
+
try {
|
|
150
|
+
node = await lookupNode(remote, token, {
|
|
151
|
+
namespace,
|
|
152
|
+
project: t.project,
|
|
153
|
+
path: assetPath,
|
|
154
|
+
episode: t.episode,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
catch (err) {
|
|
158
|
+
if (err instanceof HttpError && err.status === 404) {
|
|
159
|
+
fail(`nothing found at ${assetPath}`);
|
|
160
|
+
return 1;
|
|
161
|
+
}
|
|
162
|
+
fail(err.message);
|
|
163
|
+
return 1;
|
|
164
|
+
}
|
|
165
|
+
if (!opts.yes) {
|
|
166
|
+
const what = node.kind === "folder" ? `folder '${assetPath}' and everything inside it` : `${node.kind} '${assetPath}'`;
|
|
167
|
+
const proceed = await confirm(`HARD-DELETE ${what}?`, false);
|
|
168
|
+
if (!proceed) {
|
|
169
|
+
process.stdout.write("Cancelled.\n");
|
|
170
|
+
return 0;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
const deleted = await deleteNodeById(remote, token, node.id);
|
|
175
|
+
ok(`Deleted: ${assetPath} (${deleted} node(s) removed)`);
|
|
176
|
+
return 0;
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
fail(err.message);
|
|
180
|
+
return 1;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
export function registerDeleteCommand(program) {
|
|
184
|
+
const del = program
|
|
185
|
+
.command("delete")
|
|
186
|
+
.description("delete a project, episode, file, bindr, or dataset");
|
|
187
|
+
del
|
|
188
|
+
.command("project")
|
|
189
|
+
.description("delete a project (soft: resources kept, files inaccessible, slug freed; no restore)")
|
|
190
|
+
.argument("<slug>", "project slug")
|
|
191
|
+
.option("--namespace <slug>", "namespace (default: your own)")
|
|
192
|
+
.option("--yes", "skip the confirmation prompt")
|
|
193
|
+
.action(async (slug, opts) => {
|
|
194
|
+
process.exit(await runDeleteProject(slug, opts));
|
|
195
|
+
});
|
|
196
|
+
del
|
|
197
|
+
.command("episode")
|
|
198
|
+
.description("HARD-delete an episode and all files inside it")
|
|
199
|
+
.argument("<name>", "episode name")
|
|
200
|
+
.requiredOption("--project <target>", "project scope: space[@namespace]")
|
|
201
|
+
.option("--yes", "skip the confirmation prompt")
|
|
202
|
+
.action(async (name, opts) => {
|
|
203
|
+
process.exit(await runDeleteEpisode(name, opts));
|
|
204
|
+
});
|
|
205
|
+
del
|
|
206
|
+
.command("file")
|
|
207
|
+
.description("HARD-delete a file (or folder, recursively) inside an episode")
|
|
208
|
+
.argument("<path>", "path within the episode, e.g. /camera/front/clip.mp4")
|
|
209
|
+
.requiredOption("--episode <target>", "episode scope: space[@namespace][:episode]")
|
|
210
|
+
.option("--yes", "skip the confirmation prompt")
|
|
211
|
+
.action(async (p, opts) => {
|
|
212
|
+
process.exit(await runDeleteFile(p, opts));
|
|
213
|
+
});
|
|
214
|
+
del
|
|
215
|
+
.command("bindr")
|
|
216
|
+
.description("delete a bindr")
|
|
217
|
+
.argument("<name>", "bindr name")
|
|
218
|
+
.requiredOption("--project <target>", "project scope: space[@namespace]")
|
|
219
|
+
.option("--yes", "skip the confirmation prompt")
|
|
220
|
+
.action(async (name, opts) => {
|
|
221
|
+
process.exit(await runDeleteBindr(name, opts));
|
|
222
|
+
});
|
|
223
|
+
del
|
|
224
|
+
.command("dataset")
|
|
225
|
+
.description("delete a dataset")
|
|
226
|
+
.argument("<name>", "dataset name")
|
|
227
|
+
.requiredOption("--project <target>", "project scope: space[@namespace]")
|
|
228
|
+
.option("--yes", "skip the confirmation prompt")
|
|
229
|
+
.action(async (name, opts) => {
|
|
230
|
+
process.exit(await runDeleteDataset(name, opts));
|
|
231
|
+
});
|
|
232
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
interface DownloadOpts {
|
|
3
|
+
episode?: string;
|
|
4
|
+
from?: string;
|
|
5
|
+
output?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function runDownload(opts: DownloadOpts): Promise<number>;
|
|
8
|
+
export declare function registerDownloadCommand(program: Command): void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// `dreamlake download --episode <target> --from <path> [-o <out>]`.
|
|
2
|
+
//
|
|
3
|
+
// Node-based download (the current server protocol):
|
|
4
|
+
// GET /nodes/lookup?namespace&project&path&episode → node record
|
|
5
|
+
// leaf → GET /nodes/:id/download → presigned URL → stream to disk
|
|
6
|
+
// container → GET /nodes/:id/contents → download every file, preserving
|
|
7
|
+
// the relative tree under the output directory
|
|
8
|
+
//
|
|
9
|
+
// (The old /assets/video/download route this command originally ported from
|
|
10
|
+
// dreamlake-py's CLI no longer exists server-side; any kind downloads now.)
|
|
11
|
+
import { createWriteStream, mkdirSync } from "node:fs";
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
import { Readable } from "node:stream";
|
|
14
|
+
import { pipeline } from "node:stream/promises";
|
|
15
|
+
import { HttpError, requestJson, requestRaw } from "../client.js";
|
|
16
|
+
import { resolveNamespace, resolveRemote, resolveToken } from "../config.js";
|
|
17
|
+
import { fail, ok } from "../helpers.js";
|
|
18
|
+
import { BytesProgress } from "../progress.js";
|
|
19
|
+
import { fetchAllContents, lookupNode, relPathUnder, } from "../resources.js";
|
|
20
|
+
import { formatTarget, parseTarget } from "../target.js";
|
|
21
|
+
const CONTAINER_KINDS = new Set(["folder", "episode", "project"]);
|
|
22
|
+
async function downloadNodeToFile(remote, token, nodeId, dest) {
|
|
23
|
+
const presigned = await requestJson(remote, `/nodes/${nodeId}/download`, { token });
|
|
24
|
+
const res = await requestRaw(presigned.url, {});
|
|
25
|
+
const total = Number(res.headers.get("content-length") ?? 0);
|
|
26
|
+
const progress = new BytesProgress(total);
|
|
27
|
+
const body = res.body;
|
|
28
|
+
if (!body)
|
|
29
|
+
throw new Error("empty response body");
|
|
30
|
+
mkdirSync(path.dirname(path.resolve(dest)), { recursive: true });
|
|
31
|
+
const nodeStream = Readable.fromWeb(body);
|
|
32
|
+
nodeStream.on("data", (chunk) => progress.advance(chunk.length));
|
|
33
|
+
await pipeline(nodeStream, createWriteStream(dest));
|
|
34
|
+
progress.finish();
|
|
35
|
+
}
|
|
36
|
+
export async function runDownload(opts) {
|
|
37
|
+
if (!opts.episode) {
|
|
38
|
+
fail("--episode is required");
|
|
39
|
+
return 1;
|
|
40
|
+
}
|
|
41
|
+
if (!opts.from) {
|
|
42
|
+
fail("--from is required");
|
|
43
|
+
return 1;
|
|
44
|
+
}
|
|
45
|
+
let t;
|
|
46
|
+
try {
|
|
47
|
+
t = parseTarget(opts.episode);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
fail(err.message);
|
|
51
|
+
return 1;
|
|
52
|
+
}
|
|
53
|
+
const remote = resolveRemote();
|
|
54
|
+
const token = resolveToken();
|
|
55
|
+
if (!token) {
|
|
56
|
+
fail("not authenticated. run 'dreamlake login' first");
|
|
57
|
+
return 1;
|
|
58
|
+
}
|
|
59
|
+
const namespace = await resolveNamespace(t.namespace, { token, remote });
|
|
60
|
+
if (!namespace) {
|
|
61
|
+
fail("namespace not specified and no authenticated user found. run 'dreamlake login'");
|
|
62
|
+
return 1;
|
|
63
|
+
}
|
|
64
|
+
t.namespace = namespace;
|
|
65
|
+
const assetPath = "/" + opts.from.replace(/^\/+/, "");
|
|
66
|
+
process.stdout.write(`Downloading ${assetPath}\n`);
|
|
67
|
+
process.stdout.write(` episode: ${formatTarget(t)}\n`);
|
|
68
|
+
// Resolve the node.
|
|
69
|
+
let node;
|
|
70
|
+
try {
|
|
71
|
+
node = await lookupNode(remote, token, {
|
|
72
|
+
namespace: t.namespace,
|
|
73
|
+
project: t.project,
|
|
74
|
+
path: assetPath,
|
|
75
|
+
episode: t.episode,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
if (err instanceof HttpError && err.status === 404) {
|
|
80
|
+
fail(`asset not found at ${assetPath}`);
|
|
81
|
+
return 1;
|
|
82
|
+
}
|
|
83
|
+
fail(err.message);
|
|
84
|
+
return 1;
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
// ── Single file ─────────────────────────────────────────────────
|
|
88
|
+
if (!CONTAINER_KINDS.has(node.kind)) {
|
|
89
|
+
const output = opts.output ?? path.basename(assetPath);
|
|
90
|
+
process.stdout.write(` output: ${output}\n`);
|
|
91
|
+
await downloadNodeToFile(remote, token, node.id, output);
|
|
92
|
+
ok(`Downloaded: ${output}`);
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
|
95
|
+
// ── Container (folder / episode / project) — recursive ──────────
|
|
96
|
+
const outDir = opts.output ?? node.name;
|
|
97
|
+
const prefix = `${node.path ?? ""}${node.name},`;
|
|
98
|
+
const files = await fetchAllContents(remote, token, node.id);
|
|
99
|
+
if (files.length === 0) {
|
|
100
|
+
process.stdout.write(` (no files under ${node.kind} '${node.name}')\n`);
|
|
101
|
+
return 0;
|
|
102
|
+
}
|
|
103
|
+
process.stdout.write(` output: ${outDir}/ (${files.length} file(s) from ${node.kind} '${node.name}')\n`);
|
|
104
|
+
for (const f of files) {
|
|
105
|
+
const rel = relPathUnder(f, prefix);
|
|
106
|
+
const dest = path.join(outDir, rel);
|
|
107
|
+
process.stdout.write(` → ${rel}\n`);
|
|
108
|
+
await downloadNodeToFile(remote, token, f.id, dest);
|
|
109
|
+
}
|
|
110
|
+
ok(`Downloaded: ${outDir} (${files.length} files)`);
|
|
111
|
+
return 0;
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
fail(err.message);
|
|
115
|
+
return 1;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
export function registerDownloadCommand(program) {
|
|
119
|
+
program
|
|
120
|
+
.command("download")
|
|
121
|
+
.description("download a file (or a whole folder/episode, recursively) from DreamLake")
|
|
122
|
+
.requiredOption("--episode <target>", "episode scope: space[@namespace][:episode]")
|
|
123
|
+
.requiredOption("--from <path>", "source path within the episode (file or folder)")
|
|
124
|
+
.option("-o, --output <path>", "output file/directory (default: derived from --from)")
|
|
125
|
+
.action(async (opts) => {
|
|
126
|
+
process.exit(await runDownload(opts));
|
|
127
|
+
});
|
|
128
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type DreamlakeCtx, type DreamlakeOpts } from "../compat/ctx.js";
|
|
2
|
+
import { type Spawn } from "../spawn.js";
|
|
3
|
+
export declare const STACK_BASENAME = "dreamlake.layers.json";
|
|
4
|
+
export declare const STACK_SCHEMA_ID = "dreamlake.env-layers/v3";
|
|
5
|
+
/** The superseded schema id — recognized only to point at the migration. */
|
|
6
|
+
export declare const STACK_SCHEMA_ID_V2 = "dreamlake.env-layers/v2";
|
|
7
|
+
export declare const ENGINE_MODULE = "dreamlake.envlayer";
|
|
8
|
+
export interface StackLayer {
|
|
9
|
+
tag: string;
|
|
10
|
+
src?: string;
|
|
11
|
+
key?: string;
|
|
12
|
+
pin?: unknown;
|
|
13
|
+
unpinned?: unknown;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface EnvStack {
|
|
17
|
+
schema: string;
|
|
18
|
+
substrate?: string;
|
|
19
|
+
entry?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
layers: StackLayer[];
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
export declare const V2_MIGRATION_HINT: string;
|
|
25
|
+
/** The ESM-style rule: local paths announce themselves; bare = registry. */
|
|
26
|
+
export declare function srcIsLocal(src: string): boolean;
|
|
27
|
+
/** `ns/name` or `ns/name@version` — the layer-source registry ref. */
|
|
28
|
+
export declare function parseLayerEnvRef(ref: string): {
|
|
29
|
+
ns: string;
|
|
30
|
+
name: string;
|
|
31
|
+
version?: number;
|
|
32
|
+
} | {
|
|
33
|
+
error: string;
|
|
34
|
+
};
|
|
35
|
+
/** Every SHAPE problem of a parsed stack, layer-indexed. Empty = usable. */
|
|
36
|
+
export declare function validateStack(value: unknown): string[];
|
|
37
|
+
export declare function envCacheDir(ns: string, name: string, version: number): string;
|
|
38
|
+
/**
|
|
39
|
+
* Resolve a registry ref to a concrete version and make sure its files are
|
|
40
|
+
* in the cache. Downloads land in a temp sibling and are renamed in, so an
|
|
41
|
+
* interrupted fill never leaves a half cache behind to be trusted later.
|
|
42
|
+
* Throws with a friendly message on resolve/download failures.
|
|
43
|
+
*/
|
|
44
|
+
export declare function ensureEnvCached(ctx: DreamlakeCtx, ref: {
|
|
45
|
+
ns: string;
|
|
46
|
+
name: string;
|
|
47
|
+
version?: number;
|
|
48
|
+
}, deps?: {
|
|
49
|
+
fetchFn?: typeof fetch;
|
|
50
|
+
}): Promise<{
|
|
51
|
+
dir: string;
|
|
52
|
+
version: number;
|
|
53
|
+
fetched: boolean;
|
|
54
|
+
}>;
|
|
55
|
+
export interface ComposeDeps {
|
|
56
|
+
/** Injected in tests — the probe and the engine run share it. */
|
|
57
|
+
spawn?: Spawn;
|
|
58
|
+
fetchFn?: typeof fetch;
|
|
59
|
+
}
|
|
60
|
+
/** DREAMLAKE_PYTHON wins outright; otherwise python3, then python. */
|
|
61
|
+
export declare function enginePythonCandidates(): string[];
|
|
62
|
+
/** First interpreter that can `import dreamlake.envlayer`. */
|
|
63
|
+
export declare function findEngine(deps?: ComposeDeps): {
|
|
64
|
+
py: string;
|
|
65
|
+
} | {
|
|
66
|
+
message: string;
|
|
67
|
+
};
|
|
68
|
+
/** The engine's machine report — the LAST stdout line, one JSON object. */
|
|
69
|
+
export interface ComposeReport {
|
|
70
|
+
ok: boolean;
|
|
71
|
+
entry?: string;
|
|
72
|
+
stats?: Record<string, unknown>;
|
|
73
|
+
warnings?: unknown[];
|
|
74
|
+
error?: string;
|
|
75
|
+
layer?: number;
|
|
76
|
+
}
|
|
77
|
+
export declare function runEngine(py: string, resolvedStackPath: string, outDir: string, deps?: ComposeDeps): {
|
|
78
|
+
report: ComposeReport;
|
|
79
|
+
} | {
|
|
80
|
+
message: string;
|
|
81
|
+
};
|
|
82
|
+
export interface EnvComposeArgs extends DreamlakeOpts {
|
|
83
|
+
/** Positional; default ./dreamlake.layers.json. */
|
|
84
|
+
stackPath?: string;
|
|
85
|
+
out?: string;
|
|
86
|
+
force?: boolean;
|
|
87
|
+
}
|
|
88
|
+
export declare function runEnvCompose(args: EnvComposeArgs, deps?: ComposeDeps): Promise<number>;
|