@dreamlake/dreamlake-cli 0.88.1 → 0.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/access.d.ts +83 -0
- package/dist/api/access.js +77 -0
- package/dist/api/agent.d.ts +156 -0
- package/dist/api/agent.js +111 -0
- package/dist/api/browser.d.ts +90 -0
- package/dist/api/browser.js +102 -0
- package/dist/api/client.d.ts +54 -0
- package/dist/api/client.js +102 -0
- package/dist/api/common.d.ts +28 -0
- package/dist/api/common.js +16 -0
- package/dist/api/content.d.ts +195 -0
- package/dist/api/content.js +147 -0
- package/dist/api/execution.d.ts +84 -0
- package/dist/api/execution.js +73 -0
- package/dist/api/http.d.ts +19 -0
- package/dist/api/http.js +66 -0
- package/dist/api/index.d.ts +2362 -0
- package/dist/api/index.js +116 -0
- package/dist/api/infra.d.ts +2 -0
- package/dist/api/infra.js +2 -0
- package/dist/api/jobs.d.ts +2 -0
- package/dist/api/jobs.js +2 -0
- package/dist/api/layout.d.ts +2 -0
- package/dist/api/layout.js +2 -0
- package/dist/api/library-edit.d.ts +3 -0
- package/dist/api/library-edit.js +3 -0
- package/dist/api/library-manifest.d.ts +2 -0
- package/dist/api/library-manifest.js +2 -0
- package/dist/api/note-character-plan.d.ts +2 -0
- package/dist/api/note-character-plan.js +2 -0
- package/dist/api/note-editing.d.ts +2 -0
- package/dist/api/note-editing.js +2 -0
- package/dist/api/note-edits.d.ts +21 -0
- package/dist/api/note-edits.js +10 -0
- package/dist/api/note-events.d.ts +5 -0
- package/dist/api/note-events.js +11 -0
- package/dist/api/note-files.d.ts +102 -0
- package/dist/api/note-files.js +107 -0
- package/dist/api/note-html-read.d.ts +2 -0
- package/dist/api/note-html-read.js +2 -0
- package/dist/api/note-html.d.ts +2 -0
- package/dist/api/note-html.js +2 -0
- package/dist/api/note-linger.d.ts +83 -0
- package/dist/api/note-linger.js +270 -0
- package/dist/api/note-presence.d.ts +82 -0
- package/dist/api/note-presence.js +72 -0
- package/dist/api/note-toc.d.ts +2 -0
- package/dist/api/note-toc.js +2 -0
- package/dist/api/notes.d.ts +329 -0
- package/dist/api/notes.js +209 -0
- package/dist/api/open-resources.d.ts +27 -0
- package/dist/api/open-resources.js +102 -0
- package/dist/api/ownership.d.ts +12 -0
- package/dist/api/ownership.js +24 -0
- package/dist/api/platform.d.ts +83 -0
- package/dist/api/platform.js +56 -0
- package/dist/api/presigned-transfer.d.ts +2 -0
- package/dist/api/presigned-transfer.js +2 -0
- package/dist/api/registered-runs.d.ts +48 -0
- package/dist/api/registered-runs.js +33 -0
- package/dist/api/sessions.d.ts +299 -0
- package/dist/api/sessions.js +105 -0
- package/dist/api/storage.d.ts +46 -0
- package/dist/api/storage.js +34 -0
- package/dist/api/streams.d.ts +18 -0
- package/dist/api/streams.js +70 -0
- package/dist/api/vault.d.ts +93 -0
- package/dist/api/vault.js +79 -0
- package/dist/api/workspace.d.ts +180 -0
- package/dist/api/workspace.js +146 -0
- package/dist/cli/agent-identity.d.ts +4 -0
- package/dist/cli/agent-identity.js +21 -0
- package/dist/cli/agents/identity.d.ts +50 -0
- package/dist/cli/agents/identity.js +105 -0
- package/dist/cli/agents/index.d.ts +31 -0
- package/dist/cli/agents/index.js +580 -0
- package/dist/cli/agents/manage.d.ts +43 -0
- package/dist/cli/agents/manage.js +376 -0
- package/dist/cli/agents/spec.d.ts +104 -0
- package/dist/cli/agents/spec.js +280 -0
- package/dist/cli/agents/web.d.ts +7 -0
- package/dist/cli/agents/web.js +109 -0
- package/dist/cli/artifact/incremental.d.ts +21 -0
- package/dist/cli/artifact/incremental.js +80 -0
- package/dist/cli/artifact/index.d.ts +52 -0
- package/dist/cli/artifact/index.js +405 -0
- package/dist/cli/artifact/meta.d.ts +69 -0
- package/dist/cli/artifact/meta.js +189 -0
- package/dist/cli/auth/commands.d.ts +29 -0
- package/dist/cli/auth/commands.js +327 -0
- package/dist/cli/auth/constants.d.ts +13 -0
- package/dist/cli/auth/constants.js +18 -0
- package/dist/cli/auth/credentials.d.ts +37 -0
- package/dist/cli/auth/credentials.js +155 -0
- package/dist/cli/auth/device-flow.d.ts +32 -0
- package/dist/cli/auth/device-flow.js +154 -0
- package/dist/cli/auth/device-secret.d.ts +6 -0
- package/dist/cli/auth/device-secret.js +26 -0
- package/dist/cli/auth/machine.d.ts +15 -0
- package/dist/cli/auth/machine.js +126 -0
- package/dist/cli/auth/materialized.d.ts +32 -0
- package/dist/cli/auth/materialized.js +102 -0
- package/dist/cli/auth/migrate.d.ts +10 -0
- package/dist/cli/auth/migrate.js +75 -0
- package/dist/cli/client.d.ts +102 -0
- package/dist/cli/client.js +206 -0
- package/dist/cli/collection-list.d.ts +3 -0
- package/dist/cli/collection-list.js +25 -0
- package/dist/cli/compat/ctx.d.ts +26 -0
- package/dist/cli/compat/ctx.js +76 -0
- package/dist/cli/compat/dreamdb-wasm-embedded.d.ts +2 -0
- package/dist/cli/compat/dreamdb-wasm-embedded.js +8 -0
- package/dist/cli/compat/dreamdb-wasm.d.ts +1 -0
- package/dist/cli/compat/dreamdb-wasm.js +26 -0
- package/dist/cli/compat/dreamdb.d.ts +112 -0
- package/dist/cli/compat/dreamdb.js +219 -0
- package/dist/cli/compat/flags.d.ts +2 -0
- package/dist/cli/compat/flags.js +13 -0
- package/dist/cli/compat/http.d.ts +23 -0
- package/dist/cli/compat/http.js +137 -0
- package/dist/cli/compat/presignedTransfer.d.ts +139 -0
- package/dist/cli/compat/presignedTransfer.js +580 -0
- package/dist/cli/compat/s3-backend.d.ts +73 -0
- package/dist/cli/compat/s3-backend.js +132 -0
- package/dist/cli/config.d.ts +22 -0
- package/dist/cli/config.js +96 -0
- package/dist/cli/connection/dto.d.ts +159 -0
- package/dist/cli/connection/dto.js +497 -0
- package/dist/cli/connection/index.d.ts +50 -0
- package/dist/cli/connection/index.js +413 -0
- package/dist/cli/connection/oauth.d.ts +23 -0
- package/dist/cli/connection/oauth.js +290 -0
- package/dist/cli/connection/write.d.ts +47 -0
- package/dist/cli/connection/write.js +573 -0
- package/dist/cli/create/index.d.ts +19 -0
- package/dist/cli/create/index.js +209 -0
- package/dist/cli/declare/index.d.ts +29 -0
- package/dist/cli/declare/index.js +304 -0
- package/dist/cli/delete/index.d.ts +18 -0
- package/dist/cli/delete/index.js +232 -0
- package/dist/cli/download/index.d.ts +9 -0
- package/dist/cli/download/index.js +128 -0
- package/dist/cli/env/compose.d.ts +88 -0
- package/dist/cli/env/compose.js +402 -0
- package/dist/cli/env/index.d.ts +176 -0
- package/dist/cli/env/index.js +1011 -0
- package/dist/cli/experiments/index.d.ts +11 -0
- package/dist/cli/experiments/index.js +168 -0
- package/dist/cli/glob.d.ts +1 -0
- package/dist/cli/glob.js +45 -0
- package/dist/cli/graphql-helpers.d.ts +23 -0
- package/dist/cli/graphql-helpers.js +42 -0
- package/dist/cli/graphql.d.ts +10 -0
- package/dist/cli/graphql.js +47 -0
- package/dist/cli/help-examples.generated.d.ts +1 -0
- package/dist/cli/help-examples.generated.js +192 -0
- package/dist/cli/helpers.d.ts +8 -0
- package/dist/cli/helpers.js +106 -0
- package/dist/cli/hosts/api.d.ts +29 -0
- package/dist/cli/hosts/api.js +54 -0
- package/dist/cli/hosts/bootstrap-source.d.ts +1 -0
- package/dist/cli/hosts/bootstrap-source.js +2 -0
- package/dist/cli/hosts/catalog.d.ts +26 -0
- package/dist/cli/hosts/catalog.js +55 -0
- package/dist/cli/hosts/config.d.ts +45 -0
- package/dist/cli/hosts/config.js +179 -0
- package/dist/cli/hosts/credentials.d.ts +19 -0
- package/dist/cli/hosts/credentials.js +173 -0
- package/dist/cli/hosts/enroll.d.ts +17 -0
- package/dist/cli/hosts/enroll.js +109 -0
- package/dist/cli/hosts/enrollments.d.ts +25 -0
- package/dist/cli/hosts/enrollments.js +54 -0
- package/dist/cli/hosts/index.d.ts +6 -0
- package/dist/cli/hosts/index.js +279 -0
- package/dist/cli/hosts/inventory.d.ts +40 -0
- package/dist/cli/hosts/inventory.js +91 -0
- package/dist/cli/hosts/lifecycle.d.ts +15 -0
- package/dist/cli/hosts/lifecycle.js +108 -0
- package/dist/cli/hosts/metrics-source.d.ts +12 -0
- package/dist/cli/hosts/metrics-source.js +89 -0
- package/dist/cli/hosts/observations.d.ts +39 -0
- package/dist/cli/hosts/observations.js +102 -0
- package/dist/cli/hosts/remote.d.ts +5 -0
- package/dist/cli/hosts/remote.js +66 -0
- package/dist/cli/hosts/ssh.d.ts +63 -0
- package/dist/cli/hosts/ssh.js +276 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +288 -0
- package/dist/cli/infra/api.d.ts +95 -0
- package/dist/cli/infra/api.js +291 -0
- package/dist/cli/infra/index.d.ts +5 -0
- package/dist/cli/infra/index.js +102 -0
- package/dist/cli/infra/move.d.ts +15 -0
- package/dist/cli/infra/move.js +123 -0
- package/dist/cli/infra/transfer.d.ts +15 -0
- package/dist/cli/infra/transfer.js +280 -0
- package/dist/cli/jobs/api.d.ts +69 -0
- package/dist/cli/jobs/api.js +121 -0
- package/dist/cli/jobs/index.d.ts +5 -0
- package/dist/cli/jobs/index.js +140 -0
- package/dist/cli/lakeshore/index.d.ts +98 -0
- package/dist/cli/lakeshore/index.js +502 -0
- package/dist/cli/launch/index.d.ts +43 -0
- package/dist/cli/launch/index.js +270 -0
- package/dist/cli/layout/index.d.ts +2 -0
- package/dist/cli/layout/index.js +44 -0
- package/dist/cli/layout/transport.d.ts +12 -0
- package/dist/cli/layout/transport.js +70 -0
- package/dist/cli/library/add.d.ts +60 -0
- package/dist/cli/library/add.js +348 -0
- package/dist/cli/library/cache.d.ts +26 -0
- package/dist/cli/library/cache.js +88 -0
- package/dist/cli/library/config.d.ts +75 -0
- package/dist/cli/library/config.js +198 -0
- package/dist/cli/library/digest.d.ts +5 -0
- package/dist/cli/library/digest.js +19 -0
- package/dist/cli/library/discover.d.ts +87 -0
- package/dist/cli/library/discover.js +534 -0
- package/dist/cli/library/freshness.d.ts +35 -0
- package/dist/cli/library/freshness.js +109 -0
- package/dist/cli/library/generation.d.ts +35 -0
- package/dist/cli/library/generation.js +211 -0
- package/dist/cli/library/index.d.ts +2 -0
- package/dist/cli/library/index.js +36 -0
- package/dist/cli/library/info.d.ts +69 -0
- package/dist/cli/library/info.js +311 -0
- package/dist/cli/library/list.d.ts +33 -0
- package/dist/cli/library/list.js +86 -0
- package/dist/cli/library/manifest.d.ts +81 -0
- package/dist/cli/library/manifest.js +200 -0
- package/dist/cli/library/manifestCache.d.ts +45 -0
- package/dist/cli/library/manifestCache.js +169 -0
- package/dist/cli/library/pull.d.ts +30 -0
- package/dist/cli/library/pull.js +438 -0
- package/dist/cli/library/push.d.ts +72 -0
- package/dist/cli/library/push.js +642 -0
- package/dist/cli/library/rm.d.ts +31 -0
- package/dist/cli/library/rm.js +200 -0
- package/dist/cli/library/search.d.ts +18 -0
- package/dist/cli/library/search.js +181 -0
- package/dist/cli/library/stat.d.ts +15 -0
- package/dist/cli/library/stat.js +127 -0
- package/dist/cli/library/tools.d.ts +104 -0
- package/dist/cli/library/tools.js +163 -0
- package/dist/cli/library/wire.d.ts +47 -0
- package/dist/cli/library/wire.js +120 -0
- package/dist/cli/list/index.d.ts +26 -0
- package/dist/cli/list/index.js +256 -0
- package/dist/cli/notes/api-transport.d.ts +5 -0
- package/dist/cli/notes/api-transport.js +20 -0
- package/dist/cli/notes/character-plan.d.ts +22 -0
- package/dist/cli/notes/character-plan.js +232 -0
- package/dist/cli/notes/document.d.ts +73 -0
- package/dist/cli/notes/document.js +306 -0
- package/dist/cli/notes/edit-commands.d.ts +106 -0
- package/dist/cli/notes/edit-commands.js +623 -0
- package/dist/cli/notes/editing.d.ts +81 -0
- package/dist/cli/notes/editing.js +305 -0
- package/dist/cli/notes/events.d.ts +36 -0
- package/dist/cli/notes/events.js +54 -0
- package/dist/cli/notes/files-commands.d.ts +97 -0
- package/dist/cli/notes/files-commands.js +548 -0
- package/dist/cli/notes/html-read.d.ts +9 -0
- package/dist/cli/notes/html-read.js +90 -0
- package/dist/cli/notes/html.d.ts +73 -0
- package/dist/cli/notes/html.js +381 -0
- package/dist/cli/notes/index.d.ts +123 -0
- package/dist/cli/notes/index.js +1300 -0
- package/dist/cli/notes/linger.d.ts +4 -0
- package/dist/cli/notes/linger.js +96 -0
- package/dist/cli/notes/media-commands.d.ts +5 -0
- package/dist/cli/notes/media-commands.js +51 -0
- package/dist/cli/notes/move-command.d.ts +83 -0
- package/dist/cli/notes/move-command.js +259 -0
- package/dist/cli/notes/rm-command.d.ts +22 -0
- package/dist/cli/notes/rm-command.js +110 -0
- package/dist/cli/notes/select-command.d.ts +12 -0
- package/dist/cli/notes/select-command.js +63 -0
- package/dist/cli/notes/suggest-diff.d.ts +56 -0
- package/dist/cli/notes/suggest-diff.js +311 -0
- package/dist/cli/notes/toc.d.ts +38 -0
- package/dist/cli/notes/toc.js +144 -0
- package/dist/cli/notes/transfer-command.d.ts +6 -0
- package/dist/cli/notes/transfer-command.js +9 -0
- package/dist/cli/notes/version-commands.d.ts +19 -0
- package/dist/cli/notes/version-commands.js +178 -0
- package/dist/cli/nymph/index.d.ts +74 -0
- package/dist/cli/nymph/index.js +349 -0
- package/dist/cli/org/index.d.ts +34 -0
- package/dist/cli/org/index.js +341 -0
- package/dist/cli/ownership/index.d.ts +12 -0
- package/dist/cli/ownership/index.js +122 -0
- package/dist/cli/ownership/metadata-transfer.d.ts +20 -0
- package/dist/cli/ownership/metadata-transfer.js +159 -0
- package/dist/cli/page/index.d.ts +58 -0
- package/dist/cli/page/index.js +387 -0
- package/dist/cli/pipeline/index.d.ts +69 -0
- package/dist/cli/pipeline/index.js +604 -0
- package/dist/cli/progress.d.ts +60 -0
- package/dist/cli/progress.js +276 -0
- package/dist/cli/project/attachments.d.ts +10 -0
- package/dist/cli/project/attachments.js +39 -0
- package/dist/cli/project/grants.d.ts +10 -0
- package/dist/cli/project/grants.js +39 -0
- package/dist/cli/project/index.d.ts +8 -0
- package/dist/cli/project/index.js +92 -0
- package/dist/cli/project/move.d.ts +57 -0
- package/dist/cli/project/move.js +242 -0
- package/dist/cli/project/output.d.ts +2 -0
- package/dist/cli/project/output.js +29 -0
- package/dist/cli/project/stream.d.ts +55 -0
- package/dist/cli/project/stream.js +207 -0
- package/dist/cli/project/transfer-preview.d.ts +8 -0
- package/dist/cli/project/transfer-preview.js +10 -0
- package/dist/cli/prompt.d.ts +1 -0
- package/dist/cli/prompt.js +17 -0
- package/dist/cli/provider/dreamdir.d.ts +52 -0
- package/dist/cli/provider/dreamdir.js +138 -0
- package/dist/cli/provider/index.d.ts +4 -0
- package/dist/cli/provider/index.js +419 -0
- package/dist/cli/provider/jump-worker.d.ts +9 -0
- package/dist/cli/provider/jump-worker.js +141 -0
- package/dist/cli/provider/lifecycle.d.ts +149 -0
- package/dist/cli/provider/lifecycle.js +1390 -0
- package/dist/cli/provider/machine.d.ts +17 -0
- package/dist/cli/provider/machine.js +116 -0
- package/dist/cli/provider/ssh.d.ts +105 -0
- package/dist/cli/provider/ssh.js +305 -0
- package/dist/cli/provider/terraform.d.ts +140 -0
- package/dist/cli/provider/terraform.js +288 -0
- package/dist/cli/providers/index.d.ts +18 -0
- package/dist/cli/providers/index.js +422 -0
- package/dist/cli/python.d.ts +61 -0
- package/dist/cli/python.js +255 -0
- package/dist/cli/queues/index.d.ts +33 -0
- package/dist/cli/queues/index.js +248 -0
- package/dist/cli/queues/slurm.d.ts +10 -0
- package/dist/cli/queues/slurm.js +134 -0
- package/dist/cli/resources.d.ts +72 -0
- package/dist/cli/resources.js +137 -0
- package/dist/cli/run/index.d.ts +15 -0
- package/dist/cli/run/index.js +163 -0
- package/dist/cli/run/input.d.ts +34 -0
- package/dist/cli/run/input.js +135 -0
- package/dist/cli/run/recovery.d.ts +2 -0
- package/dist/cli/run/recovery.js +18 -0
- package/dist/cli/run/setup.d.ts +3 -0
- package/dist/cli/run/setup.js +62 -0
- package/dist/cli/runconfig/index.d.ts +12 -0
- package/dist/cli/runconfig/index.js +130 -0
- package/dist/cli/runnable/index.d.ts +35 -0
- package/dist/cli/runnable/index.js +575 -0
- package/dist/cli/runnable/path.d.ts +115 -0
- package/dist/cli/runnable/path.js +288 -0
- package/dist/cli/runnable/run.d.ts +91 -0
- package/dist/cli/runnable/run.js +239 -0
- package/dist/cli/runnable/upload.d.ts +43 -0
- package/dist/cli/runnable/upload.js +342 -0
- package/dist/cli/runnable/worker.d.ts +1 -0
- package/dist/cli/runnable/worker.js +44 -0
- package/dist/cli/schemas/workflow-spec.schema.json +335 -0
- package/dist/cli/self-update/index.d.ts +5 -0
- package/dist/cli/self-update/index.js +107 -0
- package/dist/cli/self-update/install.d.ts +60 -0
- package/dist/cli/self-update/install.js +428 -0
- package/dist/cli/self-update/paths.d.ts +40 -0
- package/dist/cli/self-update/paths.js +87 -0
- package/dist/cli/self-update/releases.d.ts +41 -0
- package/dist/cli/self-update/releases.js +153 -0
- package/dist/cli/self-update/settings.d.ts +16 -0
- package/dist/cli/self-update/settings.js +68 -0
- package/dist/cli/self-update/update.d.ts +18 -0
- package/dist/cli/self-update/update.js +241 -0
- package/dist/cli/service-accounts/index.d.ts +3 -0
- package/dist/cli/service-accounts/index.js +149 -0
- package/dist/cli/session-affiliation.d.ts +26 -0
- package/dist/cli/session-affiliation.js +135 -0
- package/dist/cli/sessions/affiliation.d.ts +8 -0
- package/dist/cli/sessions/affiliation.js +66 -0
- package/dist/cli/sessions/api.d.ts +55 -0
- package/dist/cli/sessions/api.js +88 -0
- package/dist/cli/sessions/control.d.ts +6 -0
- package/dist/cli/sessions/control.js +159 -0
- package/dist/cli/sessions/conversation.d.ts +15 -0
- package/dist/cli/sessions/conversation.js +118 -0
- package/dist/cli/sessions/index.d.ts +2 -0
- package/dist/cli/sessions/index.js +209 -0
- package/dist/cli/sessions/managed.d.ts +39 -0
- package/dist/cli/sessions/managed.js +63 -0
- package/dist/cli/sessions/redaction.d.ts +2 -0
- package/dist/cli/sessions/redaction.js +11 -0
- package/dist/cli/sessions/runner/exec.d.ts +108 -0
- package/dist/cli/sessions/runner/exec.js +335 -0
- package/dist/cli/sessions/runner/journal.d.ts +26 -0
- package/dist/cli/sessions/runner/journal.js +49 -0
- package/dist/cli/sessions/runner/native.d.ts +48 -0
- package/dist/cli/sessions/runner/native.js +170 -0
- package/dist/cli/sessions/runner/pod.d.ts +30 -0
- package/dist/cli/sessions/runner/pod.js +129 -0
- package/dist/cli/sessions/runner/serve.d.ts +85 -0
- package/dist/cli/sessions/runner/serve.js +558 -0
- package/dist/cli/sessions/sync.d.ts +47 -0
- package/dist/cli/sessions/sync.js +80 -0
- package/dist/cli/sessions/transport.d.ts +14 -0
- package/dist/cli/sessions/transport.js +116 -0
- package/dist/cli/share.d.ts +15 -0
- package/dist/cli/share.js +139 -0
- package/dist/cli/skill/catalog.d.ts +141 -0
- package/dist/cli/skill/catalog.js +442 -0
- package/dist/cli/skill/files.d.ts +89 -0
- package/dist/cli/skill/files.js +264 -0
- package/dist/cli/skill/index.d.ts +268 -0
- package/dist/cli/skill/index.js +1216 -0
- package/dist/cli/skill/manifest.d.ts +30 -0
- package/dist/cli/skill/manifest.js +101 -0
- package/dist/cli/skill/prefs.d.ts +9 -0
- package/dist/cli/skill/prefs.js +32 -0
- package/dist/cli/skill/reminders.d.ts +15 -0
- package/dist/cli/skill/reminders.js +105 -0
- package/dist/cli/skill/tar.d.ts +17 -0
- package/dist/cli/skill/tar.js +195 -0
- package/dist/cli/snapshot/index.d.ts +24 -0
- package/dist/cli/snapshot/index.js +146 -0
- package/dist/cli/source/access.d.ts +45 -0
- package/dist/cli/source/access.js +563 -0
- package/dist/cli/source/control.d.ts +103 -0
- package/dist/cli/source/control.js +546 -0
- package/dist/cli/source/delete.d.ts +89 -0
- package/dist/cli/source/delete.js +463 -0
- package/dist/cli/source/index.d.ts +288 -0
- package/dist/cli/source/index.js +1348 -0
- package/dist/cli/source/share.d.ts +65 -0
- package/dist/cli/source/share.js +530 -0
- package/dist/cli/source/upload.d.ts +62 -0
- package/dist/cli/source/upload.js +258 -0
- package/dist/cli/source/write.d.ts +77 -0
- package/dist/cli/source/write.js +335 -0
- package/dist/cli/spawn.d.ts +28 -0
- package/dist/cli/spawn.js +81 -0
- package/dist/cli/target.d.ts +22 -0
- package/dist/cli/target.js +85 -0
- package/dist/cli/tasks/index.d.ts +38 -0
- package/dist/cli/tasks/index.js +365 -0
- package/dist/cli/team/index.d.ts +37 -0
- package/dist/cli/team/index.js +407 -0
- package/dist/cli/telemetry.d.ts +23 -0
- package/dist/cli/telemetry.js +262 -0
- package/dist/cli/telemetryJournal.d.ts +26 -0
- package/dist/cli/telemetryJournal.js +104 -0
- package/dist/cli/update/index.d.ts +21 -0
- package/dist/cli/update/index.js +284 -0
- package/dist/cli/upload/index.d.ts +11 -0
- package/dist/cli/upload/index.js +261 -0
- package/dist/cli/upload/kinds.d.ts +10 -0
- package/dist/cli/upload/kinds.js +85 -0
- package/dist/cli/upload/multipart.d.ts +21 -0
- package/dist/cli/upload/multipart.js +248 -0
- package/dist/cli/vault/affected-preview.d.ts +15 -0
- package/dist/cli/vault/affected-preview.js +38 -0
- package/dist/cli/vault/cloud.d.ts +55 -0
- package/dist/cli/vault/cloud.js +287 -0
- package/dist/cli/vault/format.d.ts +18 -0
- package/dist/cli/vault/format.js +104 -0
- package/dist/cli/vault/hostCredentials.d.ts +21 -0
- package/dist/cli/vault/hostCredentials.js +71 -0
- package/dist/cli/vault/hostSupersessions.d.ts +18 -0
- package/dist/cli/vault/hostSupersessions.js +68 -0
- package/dist/cli/vault/import.d.ts +3 -0
- package/dist/cli/vault/import.js +79 -0
- package/dist/cli/vault/index.d.ts +14 -0
- package/dist/cli/vault/index.js +225 -0
- package/dist/cli/vault/keys.d.ts +5 -0
- package/dist/cli/vault/keys.js +165 -0
- package/dist/cli/vault/kms.d.ts +6 -0
- package/dist/cli/vault/kms.js +169 -0
- package/dist/cli/vault/list.d.ts +13 -0
- package/dist/cli/vault/list.js +60 -0
- package/dist/cli/vault/listView.d.ts +21 -0
- package/dist/cli/vault/listView.js +123 -0
- package/dist/cli/vault/managementMetadata.d.ts +2 -0
- package/dist/cli/vault/managementMetadata.js +23 -0
- package/dist/cli/vault/mutations.d.ts +8 -0
- package/dist/cli/vault/mutations.js +151 -0
- package/dist/cli/vault/otp.d.ts +6 -0
- package/dist/cli/vault/otp.js +62 -0
- package/dist/cli/vault/otpIntent.d.ts +23 -0
- package/dist/cli/vault/otpIntent.js +76 -0
- package/dist/cli/vault/passImport.d.ts +25 -0
- package/dist/cli/vault/passImport.js +129 -0
- package/dist/cli/vault/passOtp.d.ts +51 -0
- package/dist/cli/vault/passOtp.js +101 -0
- package/dist/cli/vault/passStore.d.ts +26 -0
- package/dist/cli/vault/passStore.js +134 -0
- package/dist/cli/vault/passwordCommand.d.ts +39 -0
- package/dist/cli/vault/passwordCommand.js +101 -0
- package/dist/cli/vault/passwordProbe.d.ts +27 -0
- package/dist/cli/vault/passwordProbe.js +282 -0
- package/dist/cli/vault/passwordRotation.d.ts +9 -0
- package/dist/cli/vault/passwordRotation.js +273 -0
- package/dist/cli/vault/rotationApi.d.ts +13 -0
- package/dist/cli/vault/rotationApi.js +58 -0
- package/dist/cli/vault/rotationCommand.d.ts +2 -0
- package/dist/cli/vault/rotationCommand.js +75 -0
- package/dist/cli/vault/rotationEngine.d.ts +19 -0
- package/dist/cli/vault/rotationEngine.js +65 -0
- package/dist/cli/vault/rotationHelperSource.d.ts +2 -0
- package/dist/cli/vault/rotationHelperSource.js +3 -0
- package/dist/cli/vault/rotationInput.d.ts +11 -0
- package/dist/cli/vault/rotationInput.js +48 -0
- package/dist/cli/vault/rotationJournal.d.ts +16 -0
- package/dist/cli/vault/rotationJournal.js +183 -0
- package/dist/cli/vault/rotationKeys.d.ts +4 -0
- package/dist/cli/vault/rotationKeys.js +48 -0
- package/dist/cli/vault/rotationPrepare.d.ts +17 -0
- package/dist/cli/vault/rotationPrepare.js +108 -0
- package/dist/cli/vault/rotationRemote.d.ts +33 -0
- package/dist/cli/vault/rotationRemote.js +156 -0
- package/dist/cli/vault/rotationState.d.ts +42 -0
- package/dist/cli/vault/rotationState.js +115 -0
- package/dist/cli/vault/rotationTransport.d.ts +18 -0
- package/dist/cli/vault/rotationTransport.js +71 -0
- package/dist/cli/vault/sshSource.d.ts +18 -0
- package/dist/cli/vault/sshSource.js +196 -0
- package/dist/cli/vault/sshSync.d.ts +17 -0
- package/dist/cli/vault/sshSync.js +224 -0
- package/dist/cli/vault/sshTransfer.d.ts +22 -0
- package/dist/cli/vault/sshTransfer.js +140 -0
- package/dist/cli/vault/terraformState.d.ts +66 -0
- package/dist/cli/vault/terraformState.js +252 -0
- package/dist/cli/vault/terraformStateCommand.d.ts +2 -0
- package/dist/cli/vault/terraformStateCommand.js +61 -0
- package/dist/cli/vault/tree.d.ts +43 -0
- package/dist/cli/vault/tree.js +292 -0
- package/dist/cli/version.d.ts +1 -0
- package/dist/cli/version.js +9 -0
- package/dist/cli/workflow/index.d.ts +76 -0
- package/dist/cli/workflow/index.js +826 -0
- package/dist/cli/workflow/validate.d.ts +19 -0
- package/dist/cli/workflow/validate.js +353 -0
- package/dist/package.json +1 -0
- package/package.json +28 -10
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { openResourcesApi } from "./open-resources.js";
|
|
2
|
+
export * from "./open-resources.js";
|
|
3
|
+
export * from "./library-manifest.js";
|
|
4
|
+
export * from "./library-edit.js";
|
|
5
|
+
export * from "./storage.js";
|
|
6
|
+
import * as browser from "./browser.js";
|
|
7
|
+
export * from "./browser.js";
|
|
8
|
+
import { registeredRunsApi } from "./registered-runs.js";
|
|
9
|
+
export * from "./registered-runs.js";
|
|
10
|
+
import { pagesApi } from "./streams.js";
|
|
11
|
+
export * from "./streams.js";
|
|
12
|
+
import { platformApi, machineApi } from "./platform.js";
|
|
13
|
+
export * from "./platform.js";
|
|
14
|
+
import { vaultApi } from "./vault.js";
|
|
15
|
+
export * from "./vault.js";
|
|
16
|
+
import { hostsApi, serviceAccountsApi, graphqlApi, organizationsApi, teamsApi, } from "./access.js";
|
|
17
|
+
export * from "./access.js";
|
|
18
|
+
import { projectsApi, nodesApi, tasksApi, connectionsApi, } from "./workspace.js";
|
|
19
|
+
import { artifactsApi, scenesApi, pipelinesApi, workflowsApi, runnablesApi, librariesApi, sourcesApi, } from "./content.js";
|
|
20
|
+
import { runsApi, providersApi, queuesApi } from "./execution.js";
|
|
21
|
+
import { ownershipApi } from "./ownership.js";
|
|
22
|
+
import { resourceApi, namespacePath } from "./common.js";
|
|
23
|
+
import { JobsApi } from "./jobs.js";
|
|
24
|
+
import { InfraApi } from "./infra.js";
|
|
25
|
+
import { terminalApi } from "./sessions.js";
|
|
26
|
+
export * from "./common.js";
|
|
27
|
+
export * from "./workspace.js";
|
|
28
|
+
export * from "./content.js";
|
|
29
|
+
export * from "./execution.js";
|
|
30
|
+
export * from "./ownership.js";
|
|
31
|
+
export * from "./note-files.js";
|
|
32
|
+
export * from "./note-presence.js";
|
|
33
|
+
export * from "./note-linger.js";
|
|
34
|
+
export * from "./jobs.js";
|
|
35
|
+
export * from "./infra.js";
|
|
36
|
+
/** `@dreamlake/dreamlake-cli/api` — the DreamLake TypeScript API.
|
|
37
|
+
*
|
|
38
|
+
* import { createClient } from '@dreamlake/dreamlake-cli/api';
|
|
39
|
+
* const dl = createClient({ remote: 'https://api.dreamlake.ai', token });
|
|
40
|
+
* const { sessions } = await dl.sessions('marvin').list({ sort: 'recent' });
|
|
41
|
+
* const command = await dl.sessions('marvin').commands.create('send', { sessionId, text: 'rebase please' });
|
|
42
|
+
* await dl.sessions('marvin').commands.wait(command.command.id, 60);
|
|
43
|
+
*
|
|
44
|
+
* Existing CLI implementations stay in place. This entry exports their pure
|
|
45
|
+
* helpers or adds explicit-credential adapters over the same server contract.
|
|
46
|
+
*/
|
|
47
|
+
import { agentApi, projectToolsApi } from "./agent.js";
|
|
48
|
+
import { createTransport, } from "./client.js";
|
|
49
|
+
import { notesApi } from "./notes.js";
|
|
50
|
+
import { sessionsApi } from "./sessions.js";
|
|
51
|
+
export * from "./client.js";
|
|
52
|
+
export * from "./sessions.js";
|
|
53
|
+
export * from "./notes.js";
|
|
54
|
+
export * from "./agent.js";
|
|
55
|
+
/** TypeScript operations use an explicit transport; importing does not execute CLI startup. */
|
|
56
|
+
export function createApi(transport) {
|
|
57
|
+
return {
|
|
58
|
+
transport,
|
|
59
|
+
openResources: openResourcesApi(transport),
|
|
60
|
+
browser,
|
|
61
|
+
profile: () => transport.request("GET", "/auth/me"),
|
|
62
|
+
registeredRuns: registeredRunsApi(transport),
|
|
63
|
+
pages: pagesApi(transport),
|
|
64
|
+
platform: (namespace) => platformApi(transport, namespace),
|
|
65
|
+
machine: machineApi(transport),
|
|
66
|
+
projectTools: projectToolsApi(transport),
|
|
67
|
+
vault: (scope) => vaultApi(transport, scope),
|
|
68
|
+
hosts: (namespace) => hostsApi(transport, namespace),
|
|
69
|
+
serviceAccounts: (namespace) => serviceAccountsApi(transport, namespace),
|
|
70
|
+
graphql: graphqlApi(transport),
|
|
71
|
+
organizations: organizationsApi(transport),
|
|
72
|
+
teams: teamsApi(transport),
|
|
73
|
+
sessions: (namespace) => sessionsApi(transport, namespace),
|
|
74
|
+
terminal: (namespace) => terminalApi(transport, namespace),
|
|
75
|
+
notes: (namespace) => notesApi(transport, namespace),
|
|
76
|
+
projects: (namespace) => projectsApi(transport, namespace),
|
|
77
|
+
nodes: nodesApi(transport),
|
|
78
|
+
tasks: (namespace, project) => tasksApi(transport, namespace, project),
|
|
79
|
+
connections: (namespace) => connectionsApi(transport, namespace),
|
|
80
|
+
artifacts: (namespace) => artifactsApi(transport, namespace),
|
|
81
|
+
scenes: (namespace) => scenesApi(transport, namespace),
|
|
82
|
+
pipelines: (namespace) => pipelinesApi(transport, namespace),
|
|
83
|
+
workflows: (namespace) => workflowsApi(transport, namespace),
|
|
84
|
+
runnables: (namespace) => runnablesApi(transport, namespace),
|
|
85
|
+
libraries: (namespace) => librariesApi(transport, namespace),
|
|
86
|
+
sources: (namespace) => sourcesApi(transport, namespace),
|
|
87
|
+
runs: (namespace) => runsApi(transport, namespace),
|
|
88
|
+
providers: (namespace) => providersApi(transport, namespace),
|
|
89
|
+
queues: (namespace) => queuesApi(transport, namespace),
|
|
90
|
+
ownership: (namespace) => ownershipApi(transport, namespace),
|
|
91
|
+
runConfigs: (namespace) => resourceApi(transport, namespacePath(namespace) + "/run-configs"),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export function createClient(options) {
|
|
95
|
+
const transport = createTransport(options);
|
|
96
|
+
return {
|
|
97
|
+
...createApi(transport),
|
|
98
|
+
agent: agentApi(transport, options),
|
|
99
|
+
jobs: (namespace) => JobsApi.create(options.remote, options.token, namespace, options.fetch),
|
|
100
|
+
get infra() {
|
|
101
|
+
return InfraApi.create({
|
|
102
|
+
remote: options.remote,
|
|
103
|
+
token: options.token,
|
|
104
|
+
fetch: options.fetch,
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export * from "./layout.js";
|
|
110
|
+
export * as noteEditing from "./note-editing.js";
|
|
111
|
+
export * as noteOutline from "./note-toc.js";
|
|
112
|
+
export * as noteHtml from "./note-html.js";
|
|
113
|
+
export * from "./note-html-read.js";
|
|
114
|
+
export { characterDiff, NotePatchError, PATCH_LIMITS, } from "./note-character-plan.js";
|
|
115
|
+
export * from "./presigned-transfer.js";
|
|
116
|
+
export * from "./note-events.js";
|
package/dist/api/jobs.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Unicode code-point edits against one retained Notes v2 baseline. */
|
|
2
|
+
export interface NoteSource {
|
|
3
|
+
note: string;
|
|
4
|
+
content: string;
|
|
5
|
+
hash: string;
|
|
6
|
+
revision: string;
|
|
7
|
+
}
|
|
8
|
+
export interface NoteEdit {
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
text: string;
|
|
12
|
+
expected?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface NotePatch {
|
|
15
|
+
format: "inline-dff" | "diff";
|
|
16
|
+
patch: string;
|
|
17
|
+
baseRevision: string;
|
|
18
|
+
mode: "merge" | "exact";
|
|
19
|
+
}
|
|
20
|
+
/** Validate optional expected text, then use the existing source-span compiler. */
|
|
21
|
+
export declare function noteEdits(source: NoteSource, edits: NoteEdit[], mode?: "merge" | "exact"): NotePatch;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { documentEdits } from "../cli/notes/document.js";
|
|
2
|
+
/** Validate optional expected text, then use the existing source-span compiler. */
|
|
3
|
+
export function noteEdits(source, edits, mode = "exact") {
|
|
4
|
+
const points = Array.from(source.content);
|
|
5
|
+
for (const edit of edits) {
|
|
6
|
+
if (edit.expected !== undefined && edit.expected !== points.slice(edit.start, edit.end).join(""))
|
|
7
|
+
throw new Error("Edit does not match the original source");
|
|
8
|
+
}
|
|
9
|
+
return documentEdits(source, edits, mode === "exact");
|
|
10
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Explicit-token adapter; the existing stream parser stays at its original location. */
|
|
2
|
+
import { readNoteEvents as readEvents, type NoteEvent } from "../cli/notes/events.js";
|
|
3
|
+
export type { Selection, Participant, NoteEvent } from "../cli/notes/events.js";
|
|
4
|
+
export type NoteEventRequest = Parameters<typeof readEvents>[5];
|
|
5
|
+
export declare function readNoteEvents(url: string, token: string, note: string, signal: AbortSignal, receive: (event: NoteEvent) => void, request?: NoteEventRequest): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Explicit-token adapter; the existing stream parser stays at its original location. */
|
|
2
|
+
import { readNoteEvents as readEvents } from "../cli/notes/events.js";
|
|
3
|
+
import { httpResponse, HttpError } from "./http.js";
|
|
4
|
+
export function readNoteEvents(url, token, note, signal, receive, request) {
|
|
5
|
+
return readEvents(url, token, note, signal, receive, request ?? (async (url, options = {}) => {
|
|
6
|
+
const response = await httpResponse(url, { token: options.token, headers: options.headers, signal: options.signal, redirect: "manual" });
|
|
7
|
+
if (!response.ok)
|
|
8
|
+
throw new HttpError(response.status, await response.text());
|
|
9
|
+
return response;
|
|
10
|
+
}));
|
|
11
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/** Note attachments. JSON receipts match `notes files … --json`; bytes remain streams. */
|
|
2
|
+
import { type Transport, type RequestOptions } from './client.js';
|
|
3
|
+
import type { Readable } from 'node:stream';
|
|
4
|
+
export interface NoteFile {
|
|
5
|
+
id: string;
|
|
6
|
+
path: string;
|
|
7
|
+
contentType: string;
|
|
8
|
+
sizeBytes: number;
|
|
9
|
+
etag: string;
|
|
10
|
+
createdBy: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
trashed: boolean;
|
|
14
|
+
previewKind: string | null;
|
|
15
|
+
text: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface NoteFilePage {
|
|
18
|
+
files: NoteFile[];
|
|
19
|
+
total: number;
|
|
20
|
+
}
|
|
21
|
+
export interface NoteFileListOptions {
|
|
22
|
+
glob?: string;
|
|
23
|
+
trashed?: boolean;
|
|
24
|
+
contentType?: string;
|
|
25
|
+
limit?: number;
|
|
26
|
+
offset?: number;
|
|
27
|
+
/** @deprecated Use glob. This is interpreted as a literal path prefix. */
|
|
28
|
+
prefix?: string;
|
|
29
|
+
/** @deprecated Use trashed. */
|
|
30
|
+
trash?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export type NoteFileWriteReceipt = NoteFile & {
|
|
33
|
+
operationId?: string;
|
|
34
|
+
};
|
|
35
|
+
export interface NoteFileOperationReceipt {
|
|
36
|
+
operationId: string;
|
|
37
|
+
state: 'admitted' | 'write-started' | 'published' | 'aborted-before-write';
|
|
38
|
+
historicalResult: boolean;
|
|
39
|
+
file?: NoteFile;
|
|
40
|
+
}
|
|
41
|
+
export interface NoteFilePreview {
|
|
42
|
+
url: string;
|
|
43
|
+
kind: 'session' | 'shared';
|
|
44
|
+
previewKind: string | null;
|
|
45
|
+
}
|
|
46
|
+
export declare function noteFileOperationId(value: unknown): string | undefined;
|
|
47
|
+
export declare function validateNoteFileKey(key?: string): void;
|
|
48
|
+
export declare function noteFilesApi(t: Transport, base: string): {
|
|
49
|
+
list: (query?: NoteFileListOptions) => Promise<NoteFilePage>;
|
|
50
|
+
get: (id: string) => Promise<NoteFile>;
|
|
51
|
+
resolve: (ref: string, includeTrashed?: boolean) => Promise<NoteFile>;
|
|
52
|
+
text: (ref: string) => Promise<{
|
|
53
|
+
text: string;
|
|
54
|
+
etag: string;
|
|
55
|
+
}>;
|
|
56
|
+
cat: (ref: string) => Promise<{
|
|
57
|
+
text: string;
|
|
58
|
+
etag: string;
|
|
59
|
+
}>;
|
|
60
|
+
download: (ref: string, signal?: AbortSignal) => Promise<Response>;
|
|
61
|
+
upload: (path: string, body: NonNullable<RequestOptions["body"]> | Readable, options?: {
|
|
62
|
+
contentType?: string;
|
|
63
|
+
overwrite?: boolean;
|
|
64
|
+
ifMatch?: string;
|
|
65
|
+
contentLength?: number;
|
|
66
|
+
signal?: AbortSignal;
|
|
67
|
+
}) => Promise<NoteFile>;
|
|
68
|
+
write: (input: {
|
|
69
|
+
path: string;
|
|
70
|
+
text: string;
|
|
71
|
+
overwrite?: boolean;
|
|
72
|
+
contentType?: string;
|
|
73
|
+
}, options?: {
|
|
74
|
+
ifMatch?: string;
|
|
75
|
+
idempotencyKey?: string;
|
|
76
|
+
}) => Promise<NoteFileWriteReceipt>;
|
|
77
|
+
move: (ref: string, path: string, options?: {
|
|
78
|
+
overwrite?: boolean;
|
|
79
|
+
ifMatch?: string;
|
|
80
|
+
}) => Promise<NoteFile>;
|
|
81
|
+
copy: (ref: string, path: string, options?: {
|
|
82
|
+
overwrite?: boolean;
|
|
83
|
+
idempotencyKey?: string;
|
|
84
|
+
}) => Promise<NoteFileWriteReceipt>;
|
|
85
|
+
operation: (operationId: string, action?: "status" | "reconcile" | "cancel") => Promise<NoteFileOperationReceipt>;
|
|
86
|
+
status: (id: string) => Promise<NoteFileOperationReceipt>;
|
|
87
|
+
reconcile: (id: string) => Promise<NoteFileOperationReceipt>;
|
|
88
|
+
cancel: (id: string) => Promise<NoteFileOperationReceipt>;
|
|
89
|
+
delete: (ref: string, options?: {
|
|
90
|
+
purge?: boolean;
|
|
91
|
+
ifMatch?: string;
|
|
92
|
+
}) => Promise<{
|
|
93
|
+
id: string;
|
|
94
|
+
purged: boolean;
|
|
95
|
+
}>;
|
|
96
|
+
restore: (ref: string, path?: string) => Promise<NoteFile>;
|
|
97
|
+
preview: (ref: string, share?: boolean) => Promise<NoteFilePreview>;
|
|
98
|
+
revokePreview: (ref: string) => Promise<{
|
|
99
|
+
id: string;
|
|
100
|
+
shared: boolean;
|
|
101
|
+
}>;
|
|
102
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/** Note attachments. JSON receipts match `notes files … --json`; bytes remain streams. */
|
|
2
|
+
import { ApiError, seg } from './client.js';
|
|
3
|
+
export function noteFileOperationId(value) {
|
|
4
|
+
return typeof value === 'string' && /^[a-f0-9]{24}$/i.test(value) ? value : undefined;
|
|
5
|
+
}
|
|
6
|
+
export function validateNoteFileKey(key) {
|
|
7
|
+
if (key !== undefined && (!/^[\x20-\x7e]{1,256}$/.test(key) || key.trim() !== key))
|
|
8
|
+
throw new Error('--idempotency-key must be 1–256 printable ASCII bytes without surrounding spaces');
|
|
9
|
+
}
|
|
10
|
+
export function noteFilesApi(t, base) {
|
|
11
|
+
const file = (id) => `${base}/files/${seg(id)}`;
|
|
12
|
+
const list = (query = {}) => {
|
|
13
|
+
const { prefix, trash, ...rest } = query;
|
|
14
|
+
// Compatibility aliases previously sent unsupported server fields.
|
|
15
|
+
const glob = rest.glob ?? (prefix === undefined ? undefined : prefix.replace(/[?*\[\]{}()!+@]/g, '\\$&') + '*');
|
|
16
|
+
return t.request('GET', base + '/files', { query: { ...rest, glob, trashed: rest.trashed ?? trash } });
|
|
17
|
+
};
|
|
18
|
+
const get = (id) => t.request('GET', file(id));
|
|
19
|
+
/** Paths are exact names; scan every page instead of treating page one as the whole directory. */
|
|
20
|
+
const resolve = async (ref, includeTrashed = false) => {
|
|
21
|
+
if (/^[a-f0-9]{24}$/i.test(ref))
|
|
22
|
+
return get(ref);
|
|
23
|
+
for (const trashed of includeTrashed ? [false, true] : [false]) {
|
|
24
|
+
let offset = 0;
|
|
25
|
+
for (;;) {
|
|
26
|
+
const page = await list({ trashed, limit: 100, offset });
|
|
27
|
+
if (!Array.isArray(page.files) || !Number.isSafeInteger(page.total) || page.total < 0)
|
|
28
|
+
throw new Error('Attachment listing is unreadable');
|
|
29
|
+
const hit = page.files.find(row => row.path === ref);
|
|
30
|
+
if (hit)
|
|
31
|
+
return hit;
|
|
32
|
+
offset += page.files.length;
|
|
33
|
+
if (offset >= page.total)
|
|
34
|
+
break;
|
|
35
|
+
if (!page.files.length)
|
|
36
|
+
throw new Error('Attachment listing did not advance');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
throw new ApiError(404, 'note_file_not_found', { path: ref });
|
|
40
|
+
};
|
|
41
|
+
const resolveId = async (ref, includeTrashed = false) => /^[a-f0-9]{24}$/i.test(ref) ? ref : (await resolve(ref, includeTrashed)).id;
|
|
42
|
+
const publish = async (path, json, options) => {
|
|
43
|
+
validateNoteFileKey(options.idempotencyKey);
|
|
44
|
+
let operationId;
|
|
45
|
+
try {
|
|
46
|
+
const result = await t.request('POST', path, { json,
|
|
47
|
+
headers: { ...(options.ifMatch ? { 'If-Match': options.ifMatch } : {}), ...(options.idempotencyKey !== undefined ? { 'Idempotency-Key': options.idempotencyKey } : {}) },
|
|
48
|
+
redirect: 'manual', onHeaders: headers => { operationId = noteFileOperationId(headers.get('Note-File-Operation-Id')); } });
|
|
49
|
+
if (!result || typeof result.id !== 'string' || typeof result.path !== 'string')
|
|
50
|
+
throw new ApiError(503, 'note_file_publication_unconfirmed', { operationId });
|
|
51
|
+
return { ...result, ...(operationId ? { operationId } : {}) };
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
const body = error instanceof ApiError ? error.body : undefined;
|
|
55
|
+
operationId ??= noteFileOperationId(body?.operationId);
|
|
56
|
+
// Keep the original error type/status/code and the operation identity, including lost-response failures.
|
|
57
|
+
if (error instanceof Error && operationId)
|
|
58
|
+
Object.assign(error, { operationId });
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const operation = async (operationId, action = 'status') => {
|
|
63
|
+
if (!noteFileOperationId(operationId))
|
|
64
|
+
throw new Error('operation must be a 24-character hexadecimal ID');
|
|
65
|
+
const result = await t.request(action === 'status' ? 'GET' : 'POST', base + '/file-publications/' + seg(operationId) + (action === 'status' ? '' : action === 'cancel' ? '/abort' : '/reconcile'), { redirect: 'manual' });
|
|
66
|
+
if (!result || noteFileOperationId(result.operationId)?.toLowerCase() !== operationId.toLowerCase() ||
|
|
67
|
+
!['admitted', 'write-started', 'published', 'aborted-before-write'].includes(result.state) || typeof result.historicalResult !== 'boolean')
|
|
68
|
+
throw new ApiError(503, 'note_file_operation_unconfirmed', { operationId });
|
|
69
|
+
return result;
|
|
70
|
+
};
|
|
71
|
+
const text = async (ref) => {
|
|
72
|
+
const row = await resolve(ref);
|
|
73
|
+
if (!row.text)
|
|
74
|
+
throw new ApiError(400, 'note_file_not_text', { id: row.id, contentType: row.contentType });
|
|
75
|
+
return t.request('GET', file(row.id) + '/text');
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
list, get, resolve, text, cat: text,
|
|
79
|
+
download: async (ref, signal) => {
|
|
80
|
+
if (!t.raw)
|
|
81
|
+
throw new Error('transport_does_not_support_streaming');
|
|
82
|
+
return t.raw('GET', file(await resolveId(ref)) + '/content', { signal, query: { redirect: false } });
|
|
83
|
+
},
|
|
84
|
+
upload: (path, body, options = {}) => {
|
|
85
|
+
if (options.contentLength !== undefined && (!Number.isSafeInteger(options.contentLength) || options.contentLength < 0))
|
|
86
|
+
throw new Error('contentLength must be a nonnegative safe integer');
|
|
87
|
+
return t.request('PUT', base + '/files/content', { body: body, signal: options.signal,
|
|
88
|
+
query: { path, contentType: options.contentType, overwrite: options.overwrite },
|
|
89
|
+
headers: { 'Content-Type': options.contentType ?? 'application/octet-stream', ...(options.ifMatch ? { 'If-Match': options.ifMatch } : {}),
|
|
90
|
+
...(options.contentLength === undefined ? {} : { 'Content-Length': String(options.contentLength) }) } });
|
|
91
|
+
},
|
|
92
|
+
write: (input, options = {}) => publish(base + '/files', { ...input, overwrite: input.overwrite ?? false }, options),
|
|
93
|
+
move: async (ref, path, options = {}) => t.request('PATCH', file(await resolveId(ref)), { json: { path, overwrite: options.overwrite ?? false }, headers: options.ifMatch ? { 'If-Match': options.ifMatch } : {} }),
|
|
94
|
+
copy: async (ref, path, options = {}) => {
|
|
95
|
+
validateNoteFileKey(options.idempotencyKey);
|
|
96
|
+
return publish(file(await resolveId(ref)) + '/copy', { path, overwrite: options.overwrite ?? false }, options);
|
|
97
|
+
},
|
|
98
|
+
operation,
|
|
99
|
+
status: (id) => operation(id),
|
|
100
|
+
reconcile: (id) => operation(id, 'reconcile'),
|
|
101
|
+
cancel: (id) => operation(id, 'cancel'),
|
|
102
|
+
delete: async (ref, options = {}) => t.request('DELETE', file(await resolveId(ref, true)), { query: { purge: options.purge ?? false }, headers: options.ifMatch ? { 'If-Match': options.ifMatch } : {} }),
|
|
103
|
+
restore: async (ref, path) => t.request('POST', file(await resolveId(ref, true)) + '/restore', { json: path ? { path } : {} }),
|
|
104
|
+
preview: async (ref, share = false) => t.request('GET', file(await resolveId(ref)) + '/preview', { query: share ? { share: true } : {} }),
|
|
105
|
+
revokePreview: async (ref) => t.request('DELETE', file(await resolveId(ref)) + '/preview'),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Transport } from './client.js';
|
|
2
|
+
import { readNoteEvents, type Participant } from './note-events.js';
|
|
3
|
+
export interface NoteLingerOptions {
|
|
4
|
+
signal: AbortSignal;
|
|
5
|
+
format?: 'diff' | 'inline-dff';
|
|
6
|
+
debounce?: string;
|
|
7
|
+
throttle?: string;
|
|
8
|
+
ifMatch?: string;
|
|
9
|
+
intent?: string;
|
|
10
|
+
}
|
|
11
|
+
export type NoteLingerEvent = ({
|
|
12
|
+
type: 'snapshot';
|
|
13
|
+
observedAt: number;
|
|
14
|
+
selectionHash: string;
|
|
15
|
+
participants: Participant[];
|
|
16
|
+
} & LingerRead) | {
|
|
17
|
+
type: 'update';
|
|
18
|
+
observedAt: number;
|
|
19
|
+
content?: LingerRead;
|
|
20
|
+
joined: Participant[];
|
|
21
|
+
left: Participant[];
|
|
22
|
+
activities: Activity[];
|
|
23
|
+
selections: (Participant & {
|
|
24
|
+
hash: string;
|
|
25
|
+
})[];
|
|
26
|
+
};
|
|
27
|
+
export declare const LINGER_BATCH_MS = 2000;
|
|
28
|
+
/** Durations are bounded to avoid accidental busy loops or effectively silent sessions. */
|
|
29
|
+
export declare function lingerDuration(value: string | undefined, option: string): number;
|
|
30
|
+
export interface Activity {
|
|
31
|
+
id: string;
|
|
32
|
+
agent: {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
owner: string;
|
|
36
|
+
};
|
|
37
|
+
kind: "read" | "insert";
|
|
38
|
+
scope: string;
|
|
39
|
+
hash: string;
|
|
40
|
+
ranges: {
|
|
41
|
+
start: number;
|
|
42
|
+
end: number;
|
|
43
|
+
}[];
|
|
44
|
+
at: number;
|
|
45
|
+
expiresAt: number;
|
|
46
|
+
}
|
|
47
|
+
export interface LingerRead {
|
|
48
|
+
note: string;
|
|
49
|
+
hash: string;
|
|
50
|
+
revision: string;
|
|
51
|
+
content?: string;
|
|
52
|
+
base?: string;
|
|
53
|
+
patch?: string;
|
|
54
|
+
format?: string;
|
|
55
|
+
}
|
|
56
|
+
interface Observation {
|
|
57
|
+
body: LingerRead;
|
|
58
|
+
participants: Participant[];
|
|
59
|
+
activities: Activity[];
|
|
60
|
+
}
|
|
61
|
+
export interface LingerRuntime {
|
|
62
|
+
signal?: AbortSignal;
|
|
63
|
+
events?: typeof readNoteEvents;
|
|
64
|
+
now(): number;
|
|
65
|
+
wait(ms: number, signal: AbortSignal): Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
/** Stable activity fingerprints suppress renewed read/typing observations each poll. */
|
|
68
|
+
export declare class LingerBatch {
|
|
69
|
+
private readonly self;
|
|
70
|
+
private participants;
|
|
71
|
+
private activity;
|
|
72
|
+
private selections;
|
|
73
|
+
constructor(initial: Observation, self: string);
|
|
74
|
+
others(rows: Participant[]): Participant[];
|
|
75
|
+
diff(next: Observation): {
|
|
76
|
+
joined: Participant[];
|
|
77
|
+
left: Participant[];
|
|
78
|
+
activities: Activity[];
|
|
79
|
+
selections: Participant[];
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export declare function watchNote(t: Transport, path: string, id: string, opts: NoteLingerOptions, receive: (event: NoteLingerEvent) => void | Promise<void>, clock?: LingerRuntime): Promise<void>;
|
|
83
|
+
export {};
|