@dreamlake/dreamlake-cli 0.88.1 → 0.89.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 +53 -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 +2330 -0
- package/dist/api/index.js +114 -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 +75 -0
- package/dist/api/note-files.js +65 -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-toc.d.ts +2 -0
- package/dist/api/note-toc.js +2 -0
- package/dist/api/notes.d.ts +304 -0
- package/dist/api/notes.js +181 -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/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 +120 -0
- package/dist/cli/notes/files-commands.js +554 -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 +1303 -0
- package/dist/cli/notes/linger.d.ts +59 -0
- package/dist/cli/notes/linger.js +339 -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 +84 -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,134 @@
|
|
|
1
|
+
import { HttpError, requestJson } from "../client.js";
|
|
2
|
+
import { resolveNamespace, resolveRemote, resolveToken } from "../config.js";
|
|
3
|
+
import { emitJson, fail, renderTable } from "../helpers.js";
|
|
4
|
+
const record = (v) => v !== null && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
5
|
+
const unknown = "Unknown";
|
|
6
|
+
const text = (v) => typeof v === "string" && v.trim() && !/[\x00-\x1f\x7f-\x9f]/.test(v) ? v : unknown;
|
|
7
|
+
const detailText = (v) => typeof v === "string" && v.length <= 512 ? text(v) : unknown;
|
|
8
|
+
const count = (v, max = 4294967293, min = 0) => typeof v === "number" && Number.isSafeInteger(v) && v >= min && v <= max ? String(v) : unknown;
|
|
9
|
+
const timestamp = (v) => typeof v === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/.test(v) && Number.isFinite(Date.parse(v)) && new Date(v).toISOString() === v.replace(/(?<=:\d{2})Z$/, ".000Z") ? v : unknown;
|
|
10
|
+
const names = (v) => Array.isArray(v) && v.length && v.every(x => text(x) !== unknown) ? v.join(", ") : unknown;
|
|
11
|
+
async function context(opts) {
|
|
12
|
+
const remote = resolveRemote(), token = resolveToken();
|
|
13
|
+
if (!token)
|
|
14
|
+
throw new Error("not authenticated — run 'dreamlake login' first");
|
|
15
|
+
const namespace = await resolveNamespace(opts.namespace, { remote, token });
|
|
16
|
+
if (!namespace)
|
|
17
|
+
throw new Error("choose a DreamLake namespace with --namespace <slug>");
|
|
18
|
+
return { remote, token, path: `/namespaces/${encodeURIComponent(namespace)}/slurm-clusters` };
|
|
19
|
+
}
|
|
20
|
+
// Never echo arbitrary error bodies: collectors and proxies can include secrets.
|
|
21
|
+
const inventoryAdvice = {
|
|
22
|
+
slurm_worker_identity_denied: "check the configured worker binding, enrollment identity and heartbeat freshness",
|
|
23
|
+
slurm_identity_denied: "check the configured host, enrollment and mounted-server identity",
|
|
24
|
+
slurm_transport_credential_unavailable: "check the mounted server credential configuration",
|
|
25
|
+
slurm_transport_unavailable: "check connectivity and authorization to the mounted server",
|
|
26
|
+
slurm_controller_cache_unavailable: "inspect the controller inventory cache diagnostic receipt",
|
|
27
|
+
invalid_slurm_receipt: "inspect the collector receipt identity, completion status and schema",
|
|
28
|
+
slurm_inventory_unavailable: "inspect the configured inventory reader; scheduler state is unknown",
|
|
29
|
+
};
|
|
30
|
+
function inventoryDiagnostic(err) {
|
|
31
|
+
try {
|
|
32
|
+
const body = JSON.parse(err.body);
|
|
33
|
+
const code = body?.code ?? body?.error;
|
|
34
|
+
if (typeof code === "string" && Object.hasOwn(inventoryAdvice, code))
|
|
35
|
+
return { code, advice: inventoryAdvice[code] };
|
|
36
|
+
}
|
|
37
|
+
catch { /* Non-JSON responses retain the generic status advice. */ }
|
|
38
|
+
}
|
|
39
|
+
function error(err) {
|
|
40
|
+
if (err instanceof HttpError) {
|
|
41
|
+
const advice = err.status === 401 ? "check your DreamLake login" : err.status === 403 ? "access to this namespace or Slurm inventory is denied" : err.status === 404 ? "the cluster was not found or this deployment does not provide Slurm inventory" : "Slurm inventory could not be read";
|
|
42
|
+
const diagnostic = inventoryDiagnostic(err);
|
|
43
|
+
fail(`HTTP ${err.status}: ${advice}${diagnostic ? ` (${diagnostic.code}); ${diagnostic.advice}` : ""}`);
|
|
44
|
+
}
|
|
45
|
+
else
|
|
46
|
+
fail(err instanceof Error ? err.message : "Slurm inventory could not be read");
|
|
47
|
+
return 1;
|
|
48
|
+
}
|
|
49
|
+
export async function runSlurmClusters(opts) {
|
|
50
|
+
try {
|
|
51
|
+
const c = await context(opts);
|
|
52
|
+
const result = await requestJson(c.remote, c.path, { token: c.token });
|
|
53
|
+
if (!Array.isArray(result?.clusters) || !["configured", "unconfigured"].includes(String(result.state)))
|
|
54
|
+
throw new Error("invalid Slurm cluster list response");
|
|
55
|
+
if (opts.json)
|
|
56
|
+
emitJson(result);
|
|
57
|
+
else {
|
|
58
|
+
const rows = result.clusters.map(value => { const v = record(value); return { ID: text(v.id), Name: text(v.name), Host: text(v.hostId), Enrollment: text(v.enrollmentId) }; });
|
|
59
|
+
process.stdout.write(renderTable(rows, ["ID", "Name", "Host", "Enrollment"]) + `\n${rows.length} configured cluster(s); coverage: ${text(result.coverage)}\n`);
|
|
60
|
+
}
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
return error(err);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function jobDetails(job) {
|
|
68
|
+
const d = record(job.details);
|
|
69
|
+
const rows = [
|
|
70
|
+
["Canonical ID", text(job.id)], ["Attempt ID", text(job.attemptId)], ["Revision", text(job.revision)],
|
|
71
|
+
["User ID", count(d.userId, 4294967295)], ["Reason", detailText(d.stateReason)],
|
|
72
|
+
["Account", detailText(d.account)], ["QoS", detailText(d.qos)], ["Priority", count(d.priority)],
|
|
73
|
+
["CPUs (scheduler count)", count(d.cpus)], ["Nodes (scheduler count)", count(d.nodeCount)],
|
|
74
|
+
["Memory per CPU (MiB)", count(d.memoryPerCpuMiB, Number.MAX_SAFE_INTEGER, 1)],
|
|
75
|
+
["Memory per node (MiB)", count(d.memoryPerNodeMiB, Number.MAX_SAFE_INTEGER, 1)],
|
|
76
|
+
["TRES requested (raw)", detailText(d.tresRequested)], ["TRES allocated (raw)", detailText(d.tresAllocated)],
|
|
77
|
+
["TRES per node (raw)", detailText(d.tresPerNode)], ["Submitted at", timestamp(job.submittedAt)],
|
|
78
|
+
["Start time (scheduler; may be forecast)", timestamp(d.startTime)],
|
|
79
|
+
["End time (scheduler; may be forecast)", timestamp(d.endTime)], ["Time limit (minutes)", count(d.timeLimitMinutes)],
|
|
80
|
+
["Queue IDs", names(job.queueIds)], ["Verified allocated node IDs", names(job.allocatedNodeIds)],
|
|
81
|
+
["Array job ID", count(job.arrayJobId)], ["Array task ID", count(job.arrayTaskId)],
|
|
82
|
+
["Array task string", detailText(job.arrayTaskString)], ["Restart count", count(job.restartCount)],
|
|
83
|
+
];
|
|
84
|
+
return rows.map(([label, value]) => ` ${label}: ${value}\n`).join("");
|
|
85
|
+
}
|
|
86
|
+
export async function runSlurmJobs(clusterId, opts) {
|
|
87
|
+
try {
|
|
88
|
+
if (!clusterId.trim() || /[\x00-\x1f\x7f-\x9f]/.test(clusterId))
|
|
89
|
+
throw new Error("provide a cluster ID from 'dreamlake queues slurm clusters'");
|
|
90
|
+
const c = await context(opts);
|
|
91
|
+
const result = await requestJson(c.remote, `${c.path}/${encodeURIComponent(clusterId)}/snapshot`, { token: c.token });
|
|
92
|
+
if (result?.schemaVersion !== 1 || result.clusterId !== clusterId)
|
|
93
|
+
throw new Error("invalid Slurm snapshot response");
|
|
94
|
+
const workload = record(result.workload);
|
|
95
|
+
const available = workload.state === "available" && workload.complete === true && Array.isArray(workload.jobs);
|
|
96
|
+
if (opts.json)
|
|
97
|
+
emitJson(result);
|
|
98
|
+
else {
|
|
99
|
+
const scope = record(result.scope), cache = record(result.cache);
|
|
100
|
+
process.stdout.write(`Snapshot freshness: ${text(result.freshness)}\nObserved at: ${timestamp(result.observedAt)}\nLast success at: ${timestamp(result.lastSuccessAt)}\nRead at: ${timestamp(result.readAt)}\nScope: ${text(scope.visibility)}; effective user: ${text(scope.unixUser)}\nWorkload visibility: ${text(workload.visibility)}; complete: ${available ? "yes" : "unknown"}\n`);
|
|
101
|
+
if (result.error != null)
|
|
102
|
+
process.stdout.write(`Snapshot error: ${text(result.error)}\n`);
|
|
103
|
+
if (result.cache != null)
|
|
104
|
+
process.stdout.write(`Cache state: ${text(cache.state)}; error: ${cache.error == null ? "none" : text(cache.error)}\n`);
|
|
105
|
+
if (result.freshness !== "fresh" || result.error != null || cache.state === "stale" || cache.error != null)
|
|
106
|
+
process.stdout.write("Current scheduler state is unknown; these are the last observed values.\n");
|
|
107
|
+
if (!available)
|
|
108
|
+
process.stdout.write("Slurm workload unavailable; job count is unknown.\n");
|
|
109
|
+
else {
|
|
110
|
+
const jobs = workload.jobs.map(record);
|
|
111
|
+
const rows = jobs.map(j => { const d = record(j.details); return { Job: text(j.schedulerId), User: detailText(d.userName), Name: detailText(d.name), Partition: detailText(d.partition), State: names(j.states) }; });
|
|
112
|
+
if (opts.details)
|
|
113
|
+
jobs.forEach((job, i) => { process.stdout.write("\n" + renderTable([rows[i]], ["Job", "User", "Name", "Partition", "State"]) + "\n" + jobDetails(job)); });
|
|
114
|
+
else
|
|
115
|
+
process.stdout.write(renderTable(rows, ["Job", "User", "Name", "Partition", "State"]) + "\n");
|
|
116
|
+
process.stdout.write(`${jobs.length} observed job(s) in the authorized snapshot.\n`);
|
|
117
|
+
if (!opts.details)
|
|
118
|
+
process.stdout.write("Use --details for reasons, resources, times, arrays and allocation IDs; --json for the full snapshot.\n");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return available ? 0 : 1;
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
return error(err);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export function registerSlurmCommands(queues) {
|
|
128
|
+
const slurm = queues.command("slurm").description("read authorized Slurm scheduler snapshots");
|
|
129
|
+
const common = (cmd) => cmd.option("--namespace <slug>", "DreamLake namespace (default: active login)").option("--json", "emit the full server response including freshness");
|
|
130
|
+
common(slurm.command("clusters").description("list configured Slurm cluster IDs"))
|
|
131
|
+
.action(async (opts) => { process.exitCode = await runSlurmClusters(opts); });
|
|
132
|
+
common(slurm.command("jobs <cluster-id>").description("list observed Slurm jobs, users, names, partitions and states").option("--details", "show all observed scheduler details, resources and times"))
|
|
133
|
+
.action(async (id, opts) => { process.exitCode = await runSlurmJobs(id, opts); });
|
|
134
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type ParsedProject } from "./target.js";
|
|
2
|
+
export interface ProjectCtx {
|
|
3
|
+
s: ParsedProject;
|
|
4
|
+
token: string;
|
|
5
|
+
remote: string;
|
|
6
|
+
}
|
|
7
|
+
/** Resolve project + namespace + token, printing the standard errors on failure. */
|
|
8
|
+
export declare function resolveProjectCtx(projectStr: string): Promise<ProjectCtx | null>;
|
|
9
|
+
/** Fetch every page of a `/...?page&pageSize` collection. Returns "not-found" on 404. */
|
|
10
|
+
export declare function fetchAllPages<T>(remote: string, path: string, token: string, key: string): Promise<{
|
|
11
|
+
items: T[];
|
|
12
|
+
total: number;
|
|
13
|
+
} | "not-found">;
|
|
14
|
+
export interface EpisodeRec {
|
|
15
|
+
id: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
nodePath?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface BindrRec {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
}
|
|
23
|
+
/** Fetch all episodes in a project (throws on error). */
|
|
24
|
+
export declare function fetchAllEpisodes(remote: string, namespace: string, project: string, token: string): Promise<EpisodeRec[]>;
|
|
25
|
+
/** Fetch all bindrs in a project (throws on error). */
|
|
26
|
+
export declare function fetchAllBindrs(remote: string, namespace: string, project: string, token: string): Promise<BindrRec[]>;
|
|
27
|
+
/** Match episodes by glob against their name OR node path (leading "/" stripped). */
|
|
28
|
+
export declare function matchEpisodes(episodes: EpisodeRec[], pattern: string): EpisodeRec[];
|
|
29
|
+
/** Match bindrs by glob against their name. */
|
|
30
|
+
export declare function matchBindrs(bindrs: BindrRec[], pattern: string): BindrRec[];
|
|
31
|
+
export interface ProjectRec {
|
|
32
|
+
id: string;
|
|
33
|
+
name?: string;
|
|
34
|
+
slug: string;
|
|
35
|
+
bindrCount?: number;
|
|
36
|
+
datasetCount?: number;
|
|
37
|
+
visibility?: string;
|
|
38
|
+
createdAt?: string;
|
|
39
|
+
}
|
|
40
|
+
/** Fetch all projects in a namespace, every page (throws on error, 404 included). */
|
|
41
|
+
export declare function fetchProjects(remote: string, token: string, namespace: string): Promise<ProjectRec[]>;
|
|
42
|
+
export interface NodeRec {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
kind: string;
|
|
46
|
+
/** Comma-delimited materialized path, e.g. ",proj,episode,camera," */
|
|
47
|
+
path?: string;
|
|
48
|
+
metadata?: {
|
|
49
|
+
bssId?: string;
|
|
50
|
+
hash?: string;
|
|
51
|
+
size?: number;
|
|
52
|
+
contentType?: string;
|
|
53
|
+
};
|
|
54
|
+
createdAt?: string;
|
|
55
|
+
}
|
|
56
|
+
/** "/a/b" → ",a,b," (comma prefix used by node paths). */
|
|
57
|
+
export declare function nodePathToCommaPrefix(nodePath: string): string;
|
|
58
|
+
/** Relative display path of a file under a container's comma prefix. */
|
|
59
|
+
export declare function relPathUnder(file: NodeRec, containerCommaPrefix: string): string;
|
|
60
|
+
/** Resolve a node by namespace+project+path (+episode) via /nodes/lookup. */
|
|
61
|
+
export declare function lookupNode(remote: string, token: string, q: {
|
|
62
|
+
namespace: string;
|
|
63
|
+
project: string;
|
|
64
|
+
path: string;
|
|
65
|
+
episode?: string | null;
|
|
66
|
+
}): Promise<NodeRec>;
|
|
67
|
+
/**
|
|
68
|
+
* Fetch every file under a container node via GET /nodes/:id/contents
|
|
69
|
+
* (paginated; ?kind= filters). NOTE: /nodes/:id/descendants exists but its
|
|
70
|
+
* response schema strips the node list on the deployed server — use this.
|
|
71
|
+
*/
|
|
72
|
+
export declare function fetchAllContents(remote: string, token: string, nodeId: string, kind?: string): Promise<NodeRec[]>;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Shared helpers for project-scoped resource commands (list / create /
|
|
2
|
+
// update / delete of bindrs and datasets). Centralizes project-context
|
|
3
|
+
// resolution, paginated fetches, and glob matching.
|
|
4
|
+
import { HttpError, requestJson } from "./client.js";
|
|
5
|
+
import { resolveNamespace, resolveRemote, resolveToken } from "./config.js";
|
|
6
|
+
import { fail } from "./helpers.js";
|
|
7
|
+
import { matchGlob } from "./glob.js";
|
|
8
|
+
import { parseProject } from "./target.js";
|
|
9
|
+
/** Resolve project + namespace + token, printing the standard errors on failure. */
|
|
10
|
+
export async function resolveProjectCtx(projectStr) {
|
|
11
|
+
let s;
|
|
12
|
+
try {
|
|
13
|
+
s = parseProject(projectStr);
|
|
14
|
+
}
|
|
15
|
+
catch (err) {
|
|
16
|
+
fail(err.message);
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const remote = resolveRemote();
|
|
20
|
+
const token = resolveToken();
|
|
21
|
+
if (!token) {
|
|
22
|
+
fail("not authenticated. run 'dreamlake login' first");
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const namespace = await resolveNamespace(s.namespace, { token, remote });
|
|
26
|
+
if (!namespace) {
|
|
27
|
+
fail("namespace not specified and no authenticated user found. run 'dreamlake login'");
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
s.namespace = namespace;
|
|
31
|
+
return { s, token, remote };
|
|
32
|
+
}
|
|
33
|
+
const PAGE_SIZE = 200;
|
|
34
|
+
/** Fetch every page of a `/...?page&pageSize` collection. Returns "not-found" on 404. */
|
|
35
|
+
export async function fetchAllPages(remote, path, token, key) {
|
|
36
|
+
try {
|
|
37
|
+
return await fetchEveryPage(remote, path, token, key);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
if (err instanceof HttpError && err.status === 404)
|
|
41
|
+
return "not-found";
|
|
42
|
+
throw err;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/** As fetchAllPages, but every HTTP error (404 included) is thrown. */
|
|
46
|
+
async function fetchEveryPage(remote, path, token, key) {
|
|
47
|
+
const items = [];
|
|
48
|
+
let page = 1;
|
|
49
|
+
let total = 0;
|
|
50
|
+
for (;;) {
|
|
51
|
+
const data = await requestJson(remote, path, {
|
|
52
|
+
token,
|
|
53
|
+
query: { page: String(page), pageSize: String(PAGE_SIZE) },
|
|
54
|
+
});
|
|
55
|
+
const batch = data[key] ?? [];
|
|
56
|
+
items.push(...batch);
|
|
57
|
+
total = Number(data.total ?? items.length);
|
|
58
|
+
const totalPages = Number(data.totalPages ?? 1);
|
|
59
|
+
if (page >= totalPages || batch.length === 0)
|
|
60
|
+
break;
|
|
61
|
+
page++;
|
|
62
|
+
}
|
|
63
|
+
return { items, total };
|
|
64
|
+
}
|
|
65
|
+
/** Fetch all episodes in a project (throws on error). */
|
|
66
|
+
export async function fetchAllEpisodes(remote, namespace, project, token) {
|
|
67
|
+
const r = await fetchAllPages(remote, `/namespaces/${namespace}/projects/${project}/episodes`, token, "episodes");
|
|
68
|
+
return r === "not-found" ? [] : r.items;
|
|
69
|
+
}
|
|
70
|
+
/** Fetch all bindrs in a project (throws on error). */
|
|
71
|
+
export async function fetchAllBindrs(remote, namespace, project, token) {
|
|
72
|
+
const r = await fetchAllPages(remote, `/namespaces/${namespace}/projects/${project}/bindrs`, token, "bindrs");
|
|
73
|
+
return r === "not-found" ? [] : r.items;
|
|
74
|
+
}
|
|
75
|
+
/** Match episodes by glob against their name OR node path (leading "/" stripped). */
|
|
76
|
+
export function matchEpisodes(episodes, pattern) {
|
|
77
|
+
const pat = pattern.replace(/^\/+/, "");
|
|
78
|
+
return episodes.filter((ep) => matchGlob(ep.name ?? "", pat) ||
|
|
79
|
+
matchGlob((ep.nodePath ?? "").replace(/^\/+/, ""), pat));
|
|
80
|
+
}
|
|
81
|
+
/** Match bindrs by glob against their name. */
|
|
82
|
+
export function matchBindrs(bindrs, pattern) {
|
|
83
|
+
return bindrs.filter((b) => matchGlob(b.name ?? "", pattern));
|
|
84
|
+
}
|
|
85
|
+
/** Fetch all projects in a namespace, every page (throws on error, 404 included). */
|
|
86
|
+
export async function fetchProjects(remote, token, namespace) {
|
|
87
|
+
const r = await fetchEveryPage(remote, `/namespaces/${namespace}/projects`, token, "projects");
|
|
88
|
+
return r.items;
|
|
89
|
+
}
|
|
90
|
+
/** "/a/b" → ",a,b," (comma prefix used by node paths). */
|
|
91
|
+
export function nodePathToCommaPrefix(nodePath) {
|
|
92
|
+
const segs = nodePath.split("/").filter(Boolean);
|
|
93
|
+
return `,${segs.join(",")},`;
|
|
94
|
+
}
|
|
95
|
+
/** Relative display path of a file under a container's comma prefix. */
|
|
96
|
+
export function relPathUnder(file, containerCommaPrefix) {
|
|
97
|
+
const p = file.path ?? "";
|
|
98
|
+
let segs = [];
|
|
99
|
+
if (p.startsWith(containerCommaPrefix)) {
|
|
100
|
+
segs = p.slice(containerCommaPrefix.length).split(",").filter(Boolean);
|
|
101
|
+
}
|
|
102
|
+
return [...segs, file.name].join("/");
|
|
103
|
+
}
|
|
104
|
+
/** Resolve a node by namespace+project+path (+episode) via /nodes/lookup. */
|
|
105
|
+
export async function lookupNode(remote, token, q) {
|
|
106
|
+
return requestJson(remote, "/nodes/lookup", {
|
|
107
|
+
token,
|
|
108
|
+
query: {
|
|
109
|
+
namespace: q.namespace,
|
|
110
|
+
project: q.project,
|
|
111
|
+
path: q.path,
|
|
112
|
+
episode: q.episode ?? undefined,
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Fetch every file under a container node via GET /nodes/:id/contents
|
|
118
|
+
* (paginated; ?kind= filters). NOTE: /nodes/:id/descendants exists but its
|
|
119
|
+
* response schema strips the node list on the deployed server — use this.
|
|
120
|
+
*/
|
|
121
|
+
export async function fetchAllContents(remote, token, nodeId, kind) {
|
|
122
|
+
const files = [];
|
|
123
|
+
let page = 1;
|
|
124
|
+
for (;;) {
|
|
125
|
+
const data = await requestJson(remote, `/nodes/${nodeId}/contents`, {
|
|
126
|
+
token,
|
|
127
|
+
query: { page, pageSize: 500, kind: kind ?? undefined },
|
|
128
|
+
});
|
|
129
|
+
const batch = data.files ?? [];
|
|
130
|
+
files.push(...batch);
|
|
131
|
+
const pageCount = Number(data.filePageCount ?? 1);
|
|
132
|
+
if (page >= pageCount || batch.length === 0)
|
|
133
|
+
break;
|
|
134
|
+
page++;
|
|
135
|
+
}
|
|
136
|
+
return files;
|
|
137
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
export interface RunReceipt {
|
|
3
|
+
id: string;
|
|
4
|
+
status: string;
|
|
5
|
+
exitCode: number | null;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export declare function runRequest(path: string, method?: string, body?: unknown): Promise<any>;
|
|
9
|
+
export declare function drainLogs(path: string, cursor?: string, json?: boolean): Promise<{
|
|
10
|
+
cursor: string;
|
|
11
|
+
done: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function executeRun(args: string[]): Promise<number>;
|
|
14
|
+
export declare function runCapabilities(data: any): Record<string, unknown>;
|
|
15
|
+
export declare function registerRunsCommands(program: Command): void;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { resolveRemote, resolveToken } from "../config.js";
|
|
3
|
+
import { readSetup } from "./setup.js";
|
|
4
|
+
import { collectRunSource, parseRunArgs } from "./input.js";
|
|
5
|
+
import { recoveryReporter } from "./recovery.js";
|
|
6
|
+
const terminal = new Set(["succeeded", "failed", "cancelled", "timed_out"]);
|
|
7
|
+
export async function runRequest(path, method = "GET", body) {
|
|
8
|
+
const token = resolveToken();
|
|
9
|
+
if (!token)
|
|
10
|
+
throw new Error("Log in to DreamLake before submitting or inspecting runs");
|
|
11
|
+
let response;
|
|
12
|
+
try {
|
|
13
|
+
response = await fetch(`${resolveRemote()}${path}`, { method, headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" }, body: body === undefined ? undefined : JSON.stringify(body), redirect: "error", signal: AbortSignal.timeout(30_000) });
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
throw new Error("Run API could not be reached; a submitted run may exist. Retry with the same request ID and payload");
|
|
17
|
+
}
|
|
18
|
+
if (!response.ok)
|
|
19
|
+
throw new Error(`Run API request failed (HTTP ${response.status})`);
|
|
20
|
+
try {
|
|
21
|
+
return await response.json();
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
throw new Error("Run API returned invalid JSON");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function base(namespace) { return `/namespaces/${encodeURIComponent(namespace)}/runs`; }
|
|
28
|
+
function reference(value) {
|
|
29
|
+
const parts = value.split("/");
|
|
30
|
+
if (parts.length !== 2 || parts.some(part => !/^[A-Za-z0-9][A-Za-z0-9_.-]*$/.test(part)))
|
|
31
|
+
throw new Error("Run reference must be namespace/run-id");
|
|
32
|
+
return `${base(parts[0])}/${encodeURIComponent(parts[1])}`;
|
|
33
|
+
}
|
|
34
|
+
export async function drainLogs(path, cursor, json = false) {
|
|
35
|
+
const page = await runRequest(`${path}/logs${cursor === undefined ? "" : `?cursor=${encodeURIComponent(cursor)}`}`);
|
|
36
|
+
if (page?.outputPolicy === "discard-at-source-v1") {
|
|
37
|
+
if (!Array.isArray(page.entries) || page.entries.length || page.nextCursor !== null || typeof page.done !== "boolean")
|
|
38
|
+
throw new Error("Invalid private log metadata");
|
|
39
|
+
if (json)
|
|
40
|
+
process.stdout.write(`${JSON.stringify(page)}\n`);
|
|
41
|
+
return { cursor: "", done: page.done };
|
|
42
|
+
}
|
|
43
|
+
if (!Array.isArray(page.entries) || typeof page.nextCursor !== "string" || typeof page.done !== "boolean")
|
|
44
|
+
throw new Error("Run API returned invalid logs");
|
|
45
|
+
if (json)
|
|
46
|
+
process.stdout.write(`${JSON.stringify(page)}\n`);
|
|
47
|
+
else
|
|
48
|
+
for (const entry of page.entries) {
|
|
49
|
+
if (!["stdout", "stderr"].includes(entry.stream) || typeof entry.dataBase64 !== "string")
|
|
50
|
+
throw new Error("Run API returned invalid log entry");
|
|
51
|
+
(entry.stream === "stderr" ? process.stderr : process.stdout).write(Buffer.from(entry.dataBase64, "base64"));
|
|
52
|
+
}
|
|
53
|
+
return { cursor: page.nextCursor, done: page.done };
|
|
54
|
+
}
|
|
55
|
+
const help = `Usage: dreamlake run --target namespace/group/host [options] --uv-run <args...>\n dreamlake run --target namespace/group/host [options] --uvx <args...>\n\nAll DreamLake options precede the execution selector; everything after it is workload argv.\n --setup <metadata.json> Pinned repository + reviewed vault mappings (private mode)\n --allow-vault-delivery Explicit consent; requires setup + enrollment, no includes\n --include <file> Explicit relative file to upload (repeatable; 100 files, 1 MiB total)\n --enrollment-id <id> Select a host enrollment when ambiguous\n --request-id <id> Stable retry ID (generated otherwise)\n --timeout-seconds <n> Remote timeout, 1–86400 (default 3600)\n --provider-id <id> Select provider with --association-id and --association-revision\n --association-id <id> Owned Slurm association (--uv-run only)\n --association-revision <n> Expected association revision\n --cpus <n> --memory-mib <n> --gpus <n> Placement resource requests\n --no-wait Return the persisted receipt after submission\n --json Output JSON receipt; use runs logs for output\n\nNo files are inferred from workload arguments. Include your script and dependencies explicitly.\nRequires a compatible server and an online nymph with tracked-run and uv capabilities.\n`;
|
|
56
|
+
export async function executeRun(args) {
|
|
57
|
+
const selector = args.findIndex(arg => arg === "--uv-run" || arg === "--uvx");
|
|
58
|
+
const before = selector < 0 ? args : args.slice(0, selector);
|
|
59
|
+
const json = before.includes("--json");
|
|
60
|
+
const reportRecovery = recoveryReporter(text => { if (!json)
|
|
61
|
+
process.stderr.write(text); });
|
|
62
|
+
let requestId;
|
|
63
|
+
try {
|
|
64
|
+
if (before.includes("--help") || before.includes("-h")) {
|
|
65
|
+
process.stdout.write(help);
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
const input = parseRunArgs(args);
|
|
69
|
+
const setup = input.setupFile ? readSetup(input.setupFile) : undefined;
|
|
70
|
+
const files = setup ? undefined : collectRunSource(input.includes);
|
|
71
|
+
requestId = input.requestId ?? randomUUID();
|
|
72
|
+
if (!json)
|
|
73
|
+
process.stderr.write(`Request ID: ${requestId}\n`);
|
|
74
|
+
const path = base(input.target.split("/")[0]);
|
|
75
|
+
let { run } = await runRequest(path, "POST", { requestId, target: input.target, enrollmentId: input.enrollmentId, placement: input.placement, resources: input.resources, execution: input.execution, ...(setup ? { setup, allowVaultDelivery: true } : { source: { files } }), timeoutSeconds: input.timeoutSeconds });
|
|
76
|
+
if (!run || typeof run.id !== "string" || typeof run.status !== "string")
|
|
77
|
+
throw new Error("Run API returned invalid receipt");
|
|
78
|
+
reportRecovery(run);
|
|
79
|
+
const runPath = `${path}/${encodeURIComponent(run.id)}`;
|
|
80
|
+
if (!json)
|
|
81
|
+
process.stderr.write(`Run: ${input.target.split("/")[0]}/${run.id}\n`);
|
|
82
|
+
if (input.wait) {
|
|
83
|
+
let cursor;
|
|
84
|
+
let done = json || !!setup;
|
|
85
|
+
while (true) {
|
|
86
|
+
if (!json && !setup) {
|
|
87
|
+
const logs = await drainLogs(runPath, cursor);
|
|
88
|
+
cursor = logs.cursor;
|
|
89
|
+
done = logs.done;
|
|
90
|
+
}
|
|
91
|
+
({ run } = await runRequest(runPath));
|
|
92
|
+
reportRecovery(run);
|
|
93
|
+
if (terminal.has(run.status) && done)
|
|
94
|
+
break;
|
|
95
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (json)
|
|
99
|
+
process.stdout.write(`${JSON.stringify({ run })}\n`);
|
|
100
|
+
else
|
|
101
|
+
process.stderr.write(`Status: ${run.status}\n`);
|
|
102
|
+
return !input.wait || run.status === "succeeded" ? 0 : (typeof run.exitCode === "number" && run.exitCode > 0 && run.exitCode <= 255 ? run.exitCode : 1);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
const message = error.message;
|
|
106
|
+
if (json)
|
|
107
|
+
process.stdout.write(`${JSON.stringify({ error: message, requestId })}\n`);
|
|
108
|
+
else
|
|
109
|
+
process.stderr.write(`${message}\n`);
|
|
110
|
+
return 1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export function runCapabilities(data) {
|
|
114
|
+
const p = data?.privateSetup;
|
|
115
|
+
if (data?.version !== 1 || !Array.isArray(data.executionKinds) || data.executionKinds.some((v) => typeof v !== "string" || !/^[a-z0-9-]{1,64}$/.test(v)) || !p || typeof p.enabled !== "boolean" ||
|
|
116
|
+
!Array.isArray(p.repositoryOrigins) || p.repositoryOrigins.some((v) => { try {
|
|
117
|
+
return typeof v !== "string" || new URL(v).origin !== v || new URL(v).protocol !== "https:";
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
return true;
|
|
121
|
+
} }) ||
|
|
122
|
+
["maxMappings", "maxArgv", "maxArgBytes", "maxTimeoutSeconds"].some(k => !Number.isSafeInteger(p[k]) || p[k] < 1) || p.requiresConsent !== true || p.requiresExplicitEnrollment !== true || p.outputPolicy !== "discard-at-source-v1" || p.hostReadiness !== "verified-on-submit")
|
|
123
|
+
throw new Error("Run API returned invalid capability metadata");
|
|
124
|
+
return { version: 1, executionKinds: data.executionKinds, privateSetup: Object.fromEntries(["enabled", "repositoryOrigins", "maxMappings", "maxArgv", "maxArgBytes", "maxTimeoutSeconds", "requiresConsent", "requiresExplicitEnrollment", "outputPolicy", "hostReadiness"].map(k => [k, p[k]])) };
|
|
125
|
+
}
|
|
126
|
+
export function registerRunsCommands(program) {
|
|
127
|
+
program.command("run").description("submit an argv-preserving uv workload to an enrolled host");
|
|
128
|
+
const runs = program.command("runs").description("inspect persistent host run receipts and output");
|
|
129
|
+
runs.command("capabilities <namespace>").description("inspect server run support; host readiness is checked at submission").option("--json", "output JSON metadata").action(async (namespace) => {
|
|
130
|
+
try {
|
|
131
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9_.-]*$/.test(namespace))
|
|
132
|
+
throw new Error("Expected a namespace name");
|
|
133
|
+
process.stdout.write(`${JSON.stringify(runCapabilities(await runRequest(`${base(namespace)}/capabilities`)))}\n`);
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
process.stderr.write(`${error.message}\n`);
|
|
137
|
+
process.exitCode = 1;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
for (const action of ["status", "cancel", "logs"]) {
|
|
141
|
+
runs.command(`${action} <namespace/run-id>`).option("--json", "output JSON").option("--cursor <cursor>", "logs cursor").action(async (ref, options) => {
|
|
142
|
+
try {
|
|
143
|
+
const path = reference(ref);
|
|
144
|
+
if (action === "logs") {
|
|
145
|
+
await drainLogs(path, options.cursor, options.json);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const result = await runRequest(action === "cancel" ? `${path}/cancel` : path, action === "cancel" ? "POST" : "GET", action === "cancel" ? {} : undefined);
|
|
149
|
+
process.stdout.write(options.json ? `${JSON.stringify(result)}\n` : `${result.run.id}: ${result.run.status}\n`);
|
|
150
|
+
if (!options.json)
|
|
151
|
+
recoveryReporter(text => process.stderr.write(text))(result.run);
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
const message = error.message;
|
|
155
|
+
if (options.json)
|
|
156
|
+
process.stdout.write(`${JSON.stringify({ error: message })}\n`);
|
|
157
|
+
else
|
|
158
|
+
process.stderr.write(`${message}\n`);
|
|
159
|
+
process.exitCode = 1;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface RunInput {
|
|
2
|
+
target: string;
|
|
3
|
+
includes: string[];
|
|
4
|
+
setupFile?: string;
|
|
5
|
+
allowVaultDelivery?: boolean;
|
|
6
|
+
execution: {
|
|
7
|
+
kind: "uv-run" | "uvx";
|
|
8
|
+
argv: string[];
|
|
9
|
+
};
|
|
10
|
+
json: boolean;
|
|
11
|
+
wait: boolean;
|
|
12
|
+
requestId?: string;
|
|
13
|
+
enrollmentId?: string;
|
|
14
|
+
timeoutSeconds: number;
|
|
15
|
+
placement?: {
|
|
16
|
+
providerId: string;
|
|
17
|
+
associationId: string;
|
|
18
|
+
associationRevision: number;
|
|
19
|
+
};
|
|
20
|
+
resources?: {
|
|
21
|
+
cpus: number;
|
|
22
|
+
memoryMib: number;
|
|
23
|
+
gpus: number;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare function parseRunArgs(args: string[]): RunInput;
|
|
27
|
+
export interface SourceFile {
|
|
28
|
+
path: string;
|
|
29
|
+
contentBase64: string;
|
|
30
|
+
sha256: string;
|
|
31
|
+
mode: 420 | 493;
|
|
32
|
+
}
|
|
33
|
+
/** Explicit files only; never follow symlinks, recurse a folder or require Git. */
|
|
34
|
+
export declare function collectRunSource(includes: string[], cwd?: string, limit?: number): SourceFile[];
|