@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,138 @@
|
|
|
1
|
+
// `.dream/` — where a provider's scaffold lives, and how the root is found.
|
|
2
|
+
//
|
|
3
|
+
// WHY THERE IS A ROOT RULE AT ALL. `runnable import --out` is the only other
|
|
4
|
+
// command in this CLI that writes into a project tree, and it makes you say
|
|
5
|
+
// where. A provider cannot: `dreamlake provider status -n aws-demo` has to find
|
|
6
|
+
// the same directory `create` wrote, from any subdirectory of the repo, with no
|
|
7
|
+
// flag. So the root is INFERRED, exactly the way `findDreamRc()` infers it:
|
|
8
|
+
//
|
|
9
|
+
// walk up from cwd looking for `.dreamrc`. `.dream/` goes beside it.
|
|
10
|
+
// no `.dreamrc` anywhere → cwd.
|
|
11
|
+
//
|
|
12
|
+
// and it is PRINTED BEFORE ANYTHING IS WRITTEN. Same rule as
|
|
13
|
+
// lakeshore/index.ts:287-296 — if the operator is about to write into the wrong
|
|
14
|
+
// tree, the line that tells them has to come first.
|
|
15
|
+
//
|
|
16
|
+
// `--dream-dir <path>` overrides, for odd layouts and for tests. It names the
|
|
17
|
+
// directory that REPLACES `.dream/`, so the reported root is its parent.
|
|
18
|
+
//
|
|
19
|
+
// NOTHING HERE STORES A PHASE. `provider.json` is identity and provenance —
|
|
20
|
+
// which template, which version, when — and is read back to answer "what vendor
|
|
21
|
+
// is this?", never "how far along is it?". The phase is derived on every run
|
|
22
|
+
// from the directory, the decision scan, terraform's own state, and the live
|
|
23
|
+
// workers claiming the name. A phase on disk can disagree with the world; a
|
|
24
|
+
// derived one cannot.
|
|
25
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync, } from "node:fs";
|
|
26
|
+
import path from "node:path";
|
|
27
|
+
import { findDreamRc } from "../python.js";
|
|
28
|
+
export function resolveDreamRoot(flag) {
|
|
29
|
+
if (flag && flag.trim()) {
|
|
30
|
+
const dir = path.resolve(flag.trim());
|
|
31
|
+
return { root: path.dirname(dir), dir, source: "flag" };
|
|
32
|
+
}
|
|
33
|
+
const rc = findDreamRc();
|
|
34
|
+
if (rc) {
|
|
35
|
+
const root = path.dirname(rc);
|
|
36
|
+
return { root, dir: path.join(root, ".dream"), source: "dreamrc" };
|
|
37
|
+
}
|
|
38
|
+
const root = process.cwd();
|
|
39
|
+
return { root, dir: path.join(root, ".dream"), source: "cwd" };
|
|
40
|
+
}
|
|
41
|
+
/** How the root was found, for the `root:` line. */
|
|
42
|
+
export function rootNote(dream) {
|
|
43
|
+
if (dream.source === "flag")
|
|
44
|
+
return "(--dream-dir)";
|
|
45
|
+
if (dream.source === "dreamrc")
|
|
46
|
+
return "(.dreamrc)";
|
|
47
|
+
return "(cwd — no .dreamrc found)";
|
|
48
|
+
}
|
|
49
|
+
export function providerDir(dream, name) {
|
|
50
|
+
return path.join(dream.dir, "providers", name);
|
|
51
|
+
}
|
|
52
|
+
/** `<abs>` relative to the root, for the short forms in prose. */
|
|
53
|
+
export function relative(dream, abs) {
|
|
54
|
+
const rel = path.relative(dream.root, abs);
|
|
55
|
+
return rel.startsWith("..") ? abs : rel;
|
|
56
|
+
}
|
|
57
|
+
// ─── the name ────────────────────────────────────────────────────────────────
|
|
58
|
+
//
|
|
59
|
+
// The name is a directory segment AND a `Worker.providerName`, so it is
|
|
60
|
+
// validated before anything touches the filesystem. Ge's whole premise is that
|
|
61
|
+
// these are deliberate, human-chosen names; `../../etc` is not one.
|
|
62
|
+
const NAME = /^[A-Za-z0-9][A-Za-z0-9._-]{0,62}$/;
|
|
63
|
+
export function invalidNameMessage(name) {
|
|
64
|
+
if (!name || !name.trim()) {
|
|
65
|
+
return "no provider name — pass -n <name>. Providers are named by hand, once, on purpose";
|
|
66
|
+
}
|
|
67
|
+
if (!NAME.test(name)) {
|
|
68
|
+
return (`'${name}' is not a usable provider name — letters, digits, '.', '_' and ` +
|
|
69
|
+
`'-' only, starting with a letter or digit, at most 63 characters`);
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
// ─── .gitignore ──────────────────────────────────────────────────────────────
|
|
74
|
+
//
|
|
75
|
+
// Per-repo, written on first scaffold. The scaffold itself is reviewable in a
|
|
76
|
+
// PR — that is the point of a deliberate provider — but state, the provider
|
|
77
|
+
// plugin cache and saved plans are neither reviewable nor safe to share.
|
|
78
|
+
export const DREAM_GITIGNORE = [
|
|
79
|
+
"# Written by `dreamlake provider create`. The scaffold is meant to be",
|
|
80
|
+
"# committed and reviewed; everything below is machine state that is not.",
|
|
81
|
+
"providers/*/terraform/.terraform/",
|
|
82
|
+
"providers/*/terraform/terraform.tfstate*",
|
|
83
|
+
"providers/*/terraform/*.tfplan",
|
|
84
|
+
"",
|
|
85
|
+
].join("\n");
|
|
86
|
+
export function readProviderRecord(dir) {
|
|
87
|
+
const file = path.join(dir, "provider.json");
|
|
88
|
+
if (!existsSync(file))
|
|
89
|
+
return null;
|
|
90
|
+
try {
|
|
91
|
+
const parsed = JSON.parse(readFileSync(file, "utf8"));
|
|
92
|
+
if (!parsed || typeof parsed !== "object")
|
|
93
|
+
return null;
|
|
94
|
+
if (typeof parsed.name !== "string" || typeof parsed.vendor !== "string")
|
|
95
|
+
return null;
|
|
96
|
+
return {
|
|
97
|
+
name: parsed.name,
|
|
98
|
+
kind: typeof parsed.kind === "string" ? parsed.kind : "",
|
|
99
|
+
vendor: parsed.vendor,
|
|
100
|
+
template: typeof parsed.template === "string" ? parsed.template : parsed.vendor,
|
|
101
|
+
templateVersion: typeof parsed.templateVersion === "number" ? parsed.templateVersion : 0,
|
|
102
|
+
createdAt: typeof parsed.createdAt === "string" ? parsed.createdAt : "",
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// An unparseable provider.json is "this directory exists but does not say
|
|
107
|
+
// what it is" — the caller turns that into a refusal, not a crash.
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The whole scaffold, as ONE try/catch whose failure is a sentence —
|
|
113
|
+
* `cannot write to <dir>: <message>`, the shape runnable/index.ts:536-542 uses.
|
|
114
|
+
* A half-written provider directory is worse than none, so the caller treats
|
|
115
|
+
* this as all-or-nothing even though the filesystem cannot.
|
|
116
|
+
*/
|
|
117
|
+
export function writeFiles(dir, writes) {
|
|
118
|
+
try {
|
|
119
|
+
for (const w of writes) {
|
|
120
|
+
mkdirSync(path.dirname(w.path), { recursive: true });
|
|
121
|
+
writeFileSync(w.path, w.content);
|
|
122
|
+
}
|
|
123
|
+
return { ok: true, files: writes.map((w) => w.path) };
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
return { ok: false, message: `cannot write to ${dir}: ${err.message}` };
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* `.dream/.gitignore`, written on first scaffold only. Never rewritten: an
|
|
131
|
+
* operator who edited it did so on purpose.
|
|
132
|
+
*/
|
|
133
|
+
export function gitignoreWrite(dream) {
|
|
134
|
+
const file = path.join(dream.dir, ".gitignore");
|
|
135
|
+
if (existsSync(file))
|
|
136
|
+
return null;
|
|
137
|
+
return { path: file, content: DREAM_GITIGNORE };
|
|
138
|
+
}
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { collectionList } from "../collection-list.js";
|
|
2
|
+
import { registerMachineCommands } from "./machine.js";
|
|
3
|
+
import { PROVIDER_SPEC, QUEUE_DEF_SPEC, STORAGE_SPEC, runResourceCreate, runResourceDelete, runResourceList, runResourceShow, runResourceUpdate, } from "../lakeshore/index.js";
|
|
4
|
+
import { runProviderApply, runProviderConnect, runProviderCreate, runProviderDisconnect, runProviderPlan, runProviderStatus, VENDORS, } from "./lifecycle.js";
|
|
5
|
+
function registerGroup(program, spec, text) {
|
|
6
|
+
const group = program.command(spec.group).description(text.group);
|
|
7
|
+
const create = group
|
|
8
|
+
.command("create")
|
|
9
|
+
.description(`create a ${spec.label}`)
|
|
10
|
+
.option("--file <path>", "JSON or YAML file holding the row (name, kind, config, …)")
|
|
11
|
+
// `-n` is the short form because `dreamlake provider create -n aws-demo` is
|
|
12
|
+
// what a person types. It is shared with storage and queue-def, which is
|
|
13
|
+
// harmless: all three are named rows.
|
|
14
|
+
.option("-n, --name <name>", "row name, unique within the namespace (overrides --file)")
|
|
15
|
+
.option("--kind <kind>", spec.kindRequired
|
|
16
|
+
? "required — this collection has no server-side default"
|
|
17
|
+
: `optional — the server defaults to '${spec.defaultKind}'`)
|
|
18
|
+
.option("--description <text>", "free-text description")
|
|
19
|
+
.option("--config <json|@file>", "non-secret config, as inline JSON or @file.json")
|
|
20
|
+
// `metadata` is a generic column and this registrar is shared, so this flag
|
|
21
|
+
// lands on all three collections. It exists for `metadata.lifecycle`, which
|
|
22
|
+
// records which vendor template a provider was scaffolded from.
|
|
23
|
+
.option("--metadata <json|@file>", "free-form metadata, as inline JSON or @file.json. Generic across all three collections; `provider` uses metadata.lifecycle to record the vendor template a scaffold came from");
|
|
24
|
+
// Only two of the three collections carry a secret blob, and a flag that
|
|
25
|
+
// cannot do anything is worse than a missing one.
|
|
26
|
+
if (spec.hasSecret) {
|
|
27
|
+
create.option("--secret <json|@file>", "credentials, as inline JSON or @file.json. Encrypted at rest and never returned by any route.");
|
|
28
|
+
}
|
|
29
|
+
create
|
|
30
|
+
.option("--namespace <slug>", "namespace slug (default: active login)")
|
|
31
|
+
.option("--if-exists <mode>", [
|
|
32
|
+
"what a 409 means: fail (default) | ok.",
|
|
33
|
+
"Rows here are create-only, so a 409 means the name is taken and nothing",
|
|
34
|
+
"was touched — a success for a re-runnable script, a failure for a human.",
|
|
35
|
+
].join("\n"), "fail")
|
|
36
|
+
.option("--json", "emit JSON")
|
|
37
|
+
.addHelpText("after", ["", ...text.create].join("\n"))
|
|
38
|
+
.action(async (opts) => process.exit(await runResourceCreate(spec, opts)));
|
|
39
|
+
collectionList(group, "list")
|
|
40
|
+
.description(`list ${spec.plural} in a namespace`)
|
|
41
|
+
.option("--kind <kind>", "filter by kind (exact match, server-side)")
|
|
42
|
+
.option("--page <n>", "page number (default 1)")
|
|
43
|
+
.option("--page-size <n>", "rows per page (server clamps to 1..200; default 200)")
|
|
44
|
+
.option("--namespace <slug>", "namespace slug (default: active login)")
|
|
45
|
+
.option("--json", "emit JSON")
|
|
46
|
+
.action(async (opts) => process.exit(await runResourceList(spec, opts)));
|
|
47
|
+
group
|
|
48
|
+
.command("show")
|
|
49
|
+
.description(`show one ${spec.label}, config included`)
|
|
50
|
+
.argument("<id>", "name or 24-hex id")
|
|
51
|
+
.option("--namespace <slug>", "namespace slug (default: active login)")
|
|
52
|
+
.option("--json", "emit JSON")
|
|
53
|
+
.action(async (id, opts) => process.exit(await runResourceShow(spec, id, opts)));
|
|
54
|
+
const update = group
|
|
55
|
+
.command("update")
|
|
56
|
+
.description(`update one ${spec.label} — every field is optional`)
|
|
57
|
+
.argument("<id>", "name or 24-hex id")
|
|
58
|
+
.option("--file <path>", "JSON or YAML file whose keys become the patch")
|
|
59
|
+
.option("--name <name>", "rename the row")
|
|
60
|
+
.option("--kind <kind>", "change the kind")
|
|
61
|
+
.option("--description <text>", "replace the description")
|
|
62
|
+
.option("--config <json|@file>", "REPLACE the config wholesale — this is not a deep merge, so include every key you want to keep")
|
|
63
|
+
.option("--metadata <json|@file>", "REPLACE the metadata wholesale. Generic across all three collections; `provider` uses metadata.lifecycle to record the vendor template a scaffold came from");
|
|
64
|
+
if (spec.hasSecret) {
|
|
65
|
+
update
|
|
66
|
+
.option("--secret <json|@file>", "rotate the stored credentials")
|
|
67
|
+
.option("--clear-secret", "remove the stored credentials (sends secret: null)");
|
|
68
|
+
}
|
|
69
|
+
update
|
|
70
|
+
.option("--namespace <slug>", "namespace slug (default: active login)")
|
|
71
|
+
.option("--json", "emit JSON")
|
|
72
|
+
.addHelpText("after", [
|
|
73
|
+
"",
|
|
74
|
+
"The server assigns `config` rather than merging it (lakeshore-resources.ts:431).",
|
|
75
|
+
"Passing --config '{\"region\":\"us-west-2\"}' against a stored",
|
|
76
|
+
"{ region, bucket } leaves you with { region } and no bucket. `show --json`",
|
|
77
|
+
"first, edit, then pass the whole object back.",
|
|
78
|
+
"",
|
|
79
|
+
"Omitting a flag leaves that field exactly as it was.",
|
|
80
|
+
...(spec.hasSecret
|
|
81
|
+
? [
|
|
82
|
+
"",
|
|
83
|
+
"Secret semantics, from the server: omit --secret and --clear-secret to KEEP",
|
|
84
|
+
"what is stored, --clear-secret to CLEAR it, --secret to ROTATE it.",
|
|
85
|
+
]
|
|
86
|
+
: []),
|
|
87
|
+
].join("\n"))
|
|
88
|
+
.action(async (id, opts) => process.exit(await runResourceUpdate(spec, id, opts)));
|
|
89
|
+
group
|
|
90
|
+
.command("delete")
|
|
91
|
+
.description(`soft-delete one ${spec.label}`)
|
|
92
|
+
.argument("<id>", "name or 24-hex id")
|
|
93
|
+
.option("--yes", "skip the confirmation prompt")
|
|
94
|
+
.option("--namespace <slug>", "namespace slug (default: active login)")
|
|
95
|
+
.option("--json", "emit JSON")
|
|
96
|
+
.addHelpText("after", [
|
|
97
|
+
"",
|
|
98
|
+
"This is a SOFT delete: the server stamps deletedAt and answers",
|
|
99
|
+
"200 { success: true } — never a 204. The row stops appearing in every read",
|
|
100
|
+
"and its name is freed for a new create; nothing is erased.",
|
|
101
|
+
"",
|
|
102
|
+
"Without --yes on a non-TTY the command cancels rather than prompting, so a",
|
|
103
|
+
"script never hangs and never deletes by accident.",
|
|
104
|
+
].join("\n"))
|
|
105
|
+
.action(async (id, opts) => process.exit(await runResourceDelete(spec, id, opts)));
|
|
106
|
+
group.addHelpText("after", ["", ...text.after].join("\n"));
|
|
107
|
+
}
|
|
108
|
+
// ─── provider ────────────────────────────────────────────────────────────────
|
|
109
|
+
export function registerProviderCommand(program) {
|
|
110
|
+
registerGroup(program, PROVIDER_SPEC, {
|
|
111
|
+
group: "manage lakeshore providers — how a machine gets launched",
|
|
112
|
+
create: [
|
|
113
|
+
"`kind` is required: the launcher discriminator — local | slurm-ssh | aws-ec2 |",
|
|
114
|
+
"gce | k8s | … . It is a free string server-side on purpose, so a new launcher",
|
|
115
|
+
"never needs a schema change.",
|
|
116
|
+
"",
|
|
117
|
+
"`--secret` is encrypted at rest (AES-256-GCM) and is never returned by any",
|
|
118
|
+
"route. After a create, `show` can only tell you that a secret EXISTS.",
|
|
119
|
+
"",
|
|
120
|
+
"Examples:",
|
|
121
|
+
" dreamlake provider create --file provider.json --if-exists ok",
|
|
122
|
+
" dreamlake provider create --name kit-local --kind local --config '{\"shell\":\"bash\"}'",
|
|
123
|
+
],
|
|
124
|
+
after: [
|
|
125
|
+
"The full cycle, five commands:",
|
|
126
|
+
"",
|
|
127
|
+
" dreamlake provider create --file provider.json --if-exists ok",
|
|
128
|
+
" dreamlake provider list",
|
|
129
|
+
" dreamlake provider show kit-local",
|
|
130
|
+
" dreamlake provider update kit-local --description '…' # config is a REPLACE",
|
|
131
|
+
" dreamlake provider delete kit-local --yes # soft delete",
|
|
132
|
+
"",
|
|
133
|
+
"`dreamlake declare provider.json --collection lakeshore-providers` still works",
|
|
134
|
+
"and does exactly what `provider create` does. It is the generic writer for all",
|
|
135
|
+
"five head collections; this group is the lifecycle for one of them.",
|
|
136
|
+
],
|
|
137
|
+
});
|
|
138
|
+
registerLifecycle(program);
|
|
139
|
+
}
|
|
140
|
+
// ─── the lifecycle leaves ────────────────────────────────────────────────────
|
|
141
|
+
//
|
|
142
|
+
// Added AFTER registerGroup(), on the `provider` group only, and never inside
|
|
143
|
+
// registerGroup — that function is shared with `storage` and `queue-def` and
|
|
144
|
+
// must not grow a terraform scaffolder.
|
|
145
|
+
//
|
|
146
|
+
// Still zero logic in this file: each `.action` is `process.exit(await run…)`
|
|
147
|
+
// against ./lifecycle.js, which is where every decision lives.
|
|
148
|
+
//
|
|
149
|
+
// NO LEAF DECLARES `--version`, EVER. `program.version(VERSION, "-v, --version")`
|
|
150
|
+
// at cli/index.ts:61 is resolved from ANY descendant command, so
|
|
151
|
+
// `dreamlake provider plan --version` would print 0.6.0 and exit 0 having
|
|
152
|
+
// planned nothing.
|
|
153
|
+
function registerLifecycle(program) {
|
|
154
|
+
const group = program.commands.find((c) => c.name() === PROVIDER_SPEC.group);
|
|
155
|
+
if (!group)
|
|
156
|
+
return;
|
|
157
|
+
registerMachineCommands(group);
|
|
158
|
+
/** -n / --dream-dir / --server / --namespace / --json, on every leaf. */
|
|
159
|
+
const common = (cmd) => cmd
|
|
160
|
+
.requiredOption("-n, --name <name>", "the provider's name — chosen by hand, once")
|
|
161
|
+
.option("--dream-dir <path>", "directory that replaces `.dream/` (default: beside the nearest .dreamrc, else ./.dream)")
|
|
162
|
+
.option("--server <url>", "control plane base URL (default: $LAKESHORE_URL); also passed to nymph by connect")
|
|
163
|
+
.option("--namespace <slug>", "control-plane namespace (default: $LAKESHORE_NAMESPACE, else 'default')")
|
|
164
|
+
.option("--json", "emit one { status, blocking, nextAction, … } object instead of prose");
|
|
165
|
+
const AGENT_LOOP = [
|
|
166
|
+
"",
|
|
167
|
+
"THE LOOP THIS IS BUILT FOR. The CLI embeds no model: it does what it can",
|
|
168
|
+
"without guessing, then reports where it is (`status`) and what happens next",
|
|
169
|
+
"(`nextAction`). Something else performs that action and re-runs.",
|
|
170
|
+
"",
|
|
171
|
+
" 1. run with --json",
|
|
172
|
+
" 2. read .status and .nextAction — branch on THOSE, never on the exit code",
|
|
173
|
+
" 3. nextAction == null → done",
|
|
174
|
+
" kind == edit_then_continue → open .file, resolve every .blocking[].key,",
|
|
175
|
+
" then run .command",
|
|
176
|
+
" kind == run | shell → run .command",
|
|
177
|
+
" 4. go to 1",
|
|
178
|
+
"",
|
|
179
|
+
"`needs_input` EXITS 0. It is not a failure — the tool did its job, which was",
|
|
180
|
+
"to find out what it cannot decide. An agent under `set -e` must not die",
|
|
181
|
+
"because a question was answered successfully. Exit 1 means the tool could not",
|
|
182
|
+
"work at all: a bad flag, no binary, an unwritable directory, a refused ssh.",
|
|
183
|
+
"",
|
|
184
|
+
"Nothing on this path ever prompts. There is no TTY question anywhere.",
|
|
185
|
+
];
|
|
186
|
+
// ── `create` is EXTENDED, not duplicated ──
|
|
187
|
+
//
|
|
188
|
+
// Commander refuses a second subcommand with the same name outright
|
|
189
|
+
// ("cannot add command 'create' as already have command 'create'"), and the
|
|
190
|
+
// plan is explicit that create/list/show/update/delete keep working exactly
|
|
191
|
+
// as they do. So the existing leaf grows three flags and ONE dispatcher:
|
|
192
|
+
//
|
|
193
|
+
// --provider or --continue present → the local scaffold (lifecycle.ts)
|
|
194
|
+
// neither → the server row (runResourceCreate)
|
|
195
|
+
//
|
|
196
|
+
// The two cannot be confused: the row create is driven by `--kind` and
|
|
197
|
+
// `--config`, and the scaffold by `--provider`. `--name`, `--namespace` and
|
|
198
|
+
// `--json` are shared and mean the obvious thing on both paths.
|
|
199
|
+
const create = group.commands.find((c) => c.name() === "create");
|
|
200
|
+
if (create) {
|
|
201
|
+
create
|
|
202
|
+
.option("--provider <vendor>", `scaffold from a vendor template instead of writing a server row: ${VENDORS.join(" | ")}`)
|
|
203
|
+
.option("--continue", "resume a scaffold — the directory is expected, so go straight to the decision scan")
|
|
204
|
+
.option("--dream-dir <path>", "directory that replaces `.dream/` (default: beside the nearest .dreamrc, else ./.dream)")
|
|
205
|
+
.option("--server <url>", "control plane base URL for the scaffold path (default: $LAKESHORE_URL); ignored when writing a server row")
|
|
206
|
+
.addHelpText("after", [
|
|
207
|
+
"",
|
|
208
|
+
"WITH --provider (or --continue) THIS SCAFFOLDS INSTEAD OF WRITING A ROW.",
|
|
209
|
+
"It writes .dream/providers/<name>/ from a vendor template and reports which",
|
|
210
|
+
"decisions are still unresolved. It touches no server and applies nothing.",
|
|
211
|
+
"",
|
|
212
|
+
"Providers are DELIBERATE: created by hand, once, with a name a person chose.",
|
|
213
|
+
"A bridge never creates one, it claims one.",
|
|
214
|
+
"",
|
|
215
|
+
"Templates are a STARTING POINT, not a default. Each was derived from a real,",
|
|
216
|
+
"working account, and every value that named that account was DELETED rather",
|
|
217
|
+
"than defaulted — which is why a fresh scaffold usually reports `needs_input`.",
|
|
218
|
+
"Read ADAPT.md in the scaffolded directory before choosing values.",
|
|
219
|
+
"",
|
|
220
|
+
"`create` NEVER APPLIES. It writes files. `plan` reads. `apply --yes` spends.",
|
|
221
|
+
"",
|
|
222
|
+
"Re-running is the resume: a second create with identical inputs reports",
|
|
223
|
+
"`exists` with an empty `files` list and changes nothing on disk.",
|
|
224
|
+
...AGENT_LOOP,
|
|
225
|
+
"",
|
|
226
|
+
"Examples:",
|
|
227
|
+
" dreamlake provider create -n aws-demo --provider kube",
|
|
228
|
+
" dreamlake provider create -n aws-demo --continue --json",
|
|
229
|
+
" dreamlake provider create -n lab-box --provider ssh",
|
|
230
|
+
" dreamlake provider create -n aws-pair --provider aws-jump-worker --json",
|
|
231
|
+
"",
|
|
232
|
+
"aws-jump-worker packages controller/worker modules with typed JSON inputs,",
|
|
233
|
+
"S3 backend onboarding, and AGENT.md instructions. It defaults to exact",
|
|
234
|
+
"reference-existing worker IDs and retained results; external controller mode",
|
|
235
|
+
"reuses your current controller. Read ENROLLMENT.md; generic connect/disconnect",
|
|
236
|
+
"does not manage this setup. Explicit controller_mode=ec2 retains dual-EC2.",
|
|
237
|
+
].join("\n"))
|
|
238
|
+
// Overwrites the handler registerGroup installed; the row path is called
|
|
239
|
+
// explicitly below, so nothing is lost.
|
|
240
|
+
.action(async (opts) => {
|
|
241
|
+
const scaffold = opts.provider !== undefined || opts.continue === true;
|
|
242
|
+
process.exit(scaffold
|
|
243
|
+
? await runProviderCreate(opts)
|
|
244
|
+
: await runResourceCreate(PROVIDER_SPEC, opts));
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
common(group
|
|
248
|
+
.command("plan")
|
|
249
|
+
.description("terraform init + validate + plan for a scaffolded provider — reads only, changes nothing"))
|
|
250
|
+
.addHelpText("after", [
|
|
251
|
+
"",
|
|
252
|
+
"The offline decision scan runs FIRST: a missing variable must not cost a",
|
|
253
|
+
"`terraform init` and a provider plugin download.",
|
|
254
|
+
"",
|
|
255
|
+
"Binary resolution is DREAMLAKE_TERRAFORM → `terraform` on PATH → `tofu` on",
|
|
256
|
+
"PATH. OpenTofu is a drop-in for everything this runs.",
|
|
257
|
+
"",
|
|
258
|
+
"A missing or invalid VARIABLE is `needs_input` and exit 0 — a question, not a",
|
|
259
|
+
"failure. Any other terraform error is `error` and exit 1.",
|
|
260
|
+
...AGENT_LOOP,
|
|
261
|
+
].join("\n"))
|
|
262
|
+
.action(async (opts) => process.exit(await runProviderPlan(opts)));
|
|
263
|
+
common(group
|
|
264
|
+
.command("apply")
|
|
265
|
+
.description("terraform apply — CREATES REAL INFRASTRUCTURE AND SPENDS REAL MONEY"))
|
|
266
|
+
.option("--yes", "required. There is no confirmation prompt on this path; this flag is the confirmation")
|
|
267
|
+
.addHelpText("after", [
|
|
268
|
+
"",
|
|
269
|
+
"Without --yes this reports `needs_input` and exits 0, having spawned nothing.",
|
|
270
|
+
"The guard is deliberately NOT a prompt — an agent has no terminal to answer",
|
|
271
|
+
"one — so instead you have to type a different command than the one you just ran.",
|
|
272
|
+
"",
|
|
273
|
+
"There is no timeout on the apply itself: twenty minutes is a normal EKS",
|
|
274
|
+
"cluster. If terraform holds a state lock, this reports `applying` and tells",
|
|
275
|
+
"you to re-run — terraform owns that recovery and we do not reimplement it.",
|
|
276
|
+
"",
|
|
277
|
+
"Example:",
|
|
278
|
+
" dreamlake provider apply -n aws-demo --yes",
|
|
279
|
+
].join("\n"))
|
|
280
|
+
.action(async (opts) => process.exit(await runProviderApply(opts)));
|
|
281
|
+
common(group
|
|
282
|
+
.command("connect")
|
|
283
|
+
.description("ssh to the machine and start a nymph under the best supervisor it has"))
|
|
284
|
+
.option("--host <user@hostname>", "the machine to reach (default: `host` in adopt.json)")
|
|
285
|
+
.option("--queue <name>", "queue subscription (default: $DREAMLAKE_QUEUE, else default)")
|
|
286
|
+
.option("--nymph-command <cmd>", "what to run on the host (default: $DREAMLAKE_NYMPH, else `nymph --server <url> --queue <name>`)")
|
|
287
|
+
.addHelpText("after", [
|
|
288
|
+
"",
|
|
289
|
+
"THE CLAIM CHECK COMES FIRST. If a live worker already claims this provider,",
|
|
290
|
+
"connect reports `exists` and spawns zero ssh subprocesses.",
|
|
291
|
+
"",
|
|
292
|
+
"ssh runs with -o BatchMode=yes -o StrictHostKeyChecking=accept-new, so it can",
|
|
293
|
+
"never sit at a password prompt: an unaccepted key fails immediately with",
|
|
294
|
+
"`ssh-copy-id` as the next action.",
|
|
295
|
+
"",
|
|
296
|
+
"Supervisor ladder, checked on the host: systemd --user → systemd + sudo -n →",
|
|
297
|
+
"tmux. TMUX IS FOR ATTACHING, NOT FOR SUPERVISING — it keeps the nymph alive",
|
|
298
|
+
"after your ssh session ends but does NOT restart it, and that case reports",
|
|
299
|
+
"degraded: [\"no-supervisor\"] and says so in words.",
|
|
300
|
+
"",
|
|
301
|
+
"The default command requires --server or LAKESHORE_URL. Set server.namespace",
|
|
302
|
+
"in the remote udf-daemon.toml; --namespace here scopes only CLI requests.",
|
|
303
|
+
"",
|
|
304
|
+
"The ssh connection is never the supervisor. This returns as soon as the start",
|
|
305
|
+
"command does and holds no socket; killing the CLI does not touch the nymph.",
|
|
306
|
+
...AGENT_LOOP,
|
|
307
|
+
].join("\n"))
|
|
308
|
+
.action(async (opts) => process.exit(await runProviderConnect(opts)));
|
|
309
|
+
// ── `disconnect` — the half `delete` never did ──
|
|
310
|
+
//
|
|
311
|
+
// `provider delete` removes the row and stops nothing, so a deleted provider
|
|
312
|
+
// whose nymph is still up keeps polling the control plane forever. This is
|
|
313
|
+
// the command that stops it, and it deliberately leaves the row alone: the
|
|
314
|
+
// two are separate verbs because they undo separate things.
|
|
315
|
+
common(group
|
|
316
|
+
.command("disconnect")
|
|
317
|
+
.description("ssh to the machine and stop the nymph — the Provider row is left alone"))
|
|
318
|
+
.option("--host <user@hostname>", "the machine to reach (default: `host` in adopt.json)")
|
|
319
|
+
.addHelpText("after", [
|
|
320
|
+
"",
|
|
321
|
+
"DISCONNECT IS NOT DELETE. The Provider row is untouched — this stops a",
|
|
322
|
+
"process on a machine, which is the half `provider delete` never did. Deleting",
|
|
323
|
+
"a row while its nymph is still running leaves that nymph polling the control",
|
|
324
|
+
"plane forever, so the honest order is disconnect first, delete second:",
|
|
325
|
+
"",
|
|
326
|
+
" dreamlake provider disconnect -n lab-box",
|
|
327
|
+
" dreamlake provider delete lab-box --yes",
|
|
328
|
+
"",
|
|
329
|
+
"THE STOP MATCHES THE START. The same supervisor ladder `connect` climbed is",
|
|
330
|
+
"climbed again on the host, and the action is whatever it reports NOW:",
|
|
331
|
+
"",
|
|
332
|
+
" systemd --user systemctl --user stop nymph-<name>, then disable",
|
|
333
|
+
" systemd + sudo sudo -n systemctl stop nymph-<name>, then disable",
|
|
334
|
+
" tmux tmux kill-session -t nymph-<name>",
|
|
335
|
+
"",
|
|
336
|
+
"The `disable` is what keeps a reboot from bringing back the nymph you just",
|
|
337
|
+
"stopped. It is best-effort: a unit that was never enabled is not a failure.",
|
|
338
|
+
"",
|
|
339
|
+
"IDEMPOTENT. Disconnecting something already stopped exits 0 and says which",
|
|
340
|
+
"nothing it found — `absent` (no unit or session at all) or a unit that was",
|
|
341
|
+
"already down. Both report `exists`; only a nymph that was actually running",
|
|
342
|
+
"reports `disconnected`.",
|
|
343
|
+
"",
|
|
344
|
+
"A host with NO supervisor is an error, not a shrug: nothing there was started",
|
|
345
|
+
"by `connect`, so nothing here knows what to stop, and saying `disconnected`",
|
|
346
|
+
"would be a lie that leaves a nymph running.",
|
|
347
|
+
"",
|
|
348
|
+
"This does NOT terminate a cloud instance. A stopped nymph on a running EC2",
|
|
349
|
+
"box still costs money; `terraform destroy` in the provider's directory is the",
|
|
350
|
+
"command for that, and it is deliberately not wired to this one.",
|
|
351
|
+
...AGENT_LOOP,
|
|
352
|
+
].join("\n"))
|
|
353
|
+
.action(async (opts) => process.exit(await runProviderDisconnect(opts)));
|
|
354
|
+
common(group
|
|
355
|
+
.command("status")
|
|
356
|
+
.description("where this provider actually is — recomputed from the world every run"))
|
|
357
|
+
.addHelpText("after", [
|
|
358
|
+
"",
|
|
359
|
+
"NO PHASE IS STORED ANYWHERE. It is derived on every invocation from four",
|
|
360
|
+
"observations: the directory and its provider.json; the offline decision scan;",
|
|
361
|
+
"terraform's own state and lock files; and the live workers claiming the name.",
|
|
362
|
+
"A stored phase can disagree with the world — this cannot, and it notices a",
|
|
363
|
+
"`terraform apply` somebody ran by hand in that directory.",
|
|
364
|
+
"",
|
|
365
|
+
"`unclaimed` is a NORMAL state, not a fault. It means nothing can launch into",
|
|
366
|
+
"this account right now, which is worth knowing and is not an error.",
|
|
367
|
+
...AGENT_LOOP,
|
|
368
|
+
].join("\n"))
|
|
369
|
+
.action(async (opts) => process.exit(await runProviderStatus(opts)));
|
|
370
|
+
}
|
|
371
|
+
// ─── storage ─────────────────────────────────────────────────────────────────
|
|
372
|
+
export function registerStorageCommand(program) {
|
|
373
|
+
registerGroup(program, STORAGE_SPEC, {
|
|
374
|
+
group: "manage lakeshore storages — where a worker reads and writes bulk data",
|
|
375
|
+
create: [
|
|
376
|
+
"`kind` is required: 's3' (a whole bucket) or 's3-prefix' (a scoped prefix).",
|
|
377
|
+
"",
|
|
378
|
+
"`--config` carries the non-secret half — { bucket, prefix?, region?, endpoint? }.",
|
|
379
|
+
"Credentials go in `--secret`, which is encrypted at rest and never returned.",
|
|
380
|
+
"",
|
|
381
|
+
"Example:",
|
|
382
|
+
" dreamlake storage create --name kit-bucket --kind s3 \\",
|
|
383
|
+
" --config '{\"bucket\":\"kit-artifacts\",\"region\":\"us-west-2\"}'",
|
|
384
|
+
],
|
|
385
|
+
after: [
|
|
386
|
+
"Storages share their five routes with providers and queue definitions — one",
|
|
387
|
+
"registrar on the server, one implementation here. Only the nouns differ.",
|
|
388
|
+
"",
|
|
389
|
+
"`--metadata` is shared for the same reason. It exists because `provider` needs",
|
|
390
|
+
"somewhere to record which vendor template a scaffold came from; `metadata` is a",
|
|
391
|
+
"generic column, so storages get the flag too. Nothing here interprets it.",
|
|
392
|
+
],
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
// ─── queue-def ───────────────────────────────────────────────────────────────
|
|
396
|
+
export function registerQueueDefCommand(program) {
|
|
397
|
+
registerGroup(program, QUEUE_DEF_SPEC, {
|
|
398
|
+
group: "manage lakeshore queue definitions — a queue's policy, not its live state",
|
|
399
|
+
create: [
|
|
400
|
+
"`kind` is the scheduling policy: fifo (the default) | priority | boltzmann | filo.",
|
|
401
|
+
"It is the one collection here with a server-side default, so --kind is optional.",
|
|
402
|
+
"",
|
|
403
|
+
"A queue DEFINITION is a declaration. The live queue — depth, daemons, claims —",
|
|
404
|
+
"lives in the control plane and is not reachable from this CLI.",
|
|
405
|
+
"",
|
|
406
|
+
"A queue definition stores no secret.",
|
|
407
|
+
],
|
|
408
|
+
after: [
|
|
409
|
+
"A UDF does not require a queue. A queue is where you happen to run something,",
|
|
410
|
+
"not part of what it is: `Runnable` has no queue column at all. Declaring a",
|
|
411
|
+
"queue definition is about scheduling policy, not about registering code.",
|
|
412
|
+
"",
|
|
413
|
+
"`--metadata` is shared with providers and storages — one registrar, one flag.",
|
|
414
|
+
"It exists because `provider` needs somewhere to record which vendor template a",
|
|
415
|
+
"scaffold came from; `metadata` is a generic column, so this group gets it too.",
|
|
416
|
+
"Nothing here interprets it.",
|
|
417
|
+
],
|
|
418
|
+
});
|
|
419
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Blocking } from "./lifecycle.js";
|
|
2
|
+
import type { FileWrite, WriteOutcome } from "./dreamdir.js";
|
|
3
|
+
export declare const JUMP_WORKER_VENDOR = "aws-jump-worker";
|
|
4
|
+
export declare const jumpWorkerBackend: (dir: string) => string;
|
|
5
|
+
export declare function scanJumpWorker(dir: string, schemaText: (name: string) => string | null): Blocking[];
|
|
6
|
+
/** Refuse symlink components before either repair or reading edited input files. */
|
|
7
|
+
export declare function checkJumpWorkerPaths(files: string[]): void;
|
|
8
|
+
/** Exclusive creation prevents a repair from truncating a concurrently created edit. */
|
|
9
|
+
export declare function writeJumpWorkerFiles(dir: string, writes: FileWrite[]): WriteOutcome;
|