@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,264 @@
|
|
|
1
|
+
// Filesystem primitives the installer shares: path safety, hashing, and
|
|
2
|
+
// `lstat`-based kinds. Everything that touches a skill directory goes through
|
|
3
|
+
// these so symlinks are never followed and no path can escape the target.
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
import { lstatSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmdirSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
/** What sits at `p`, without following a symlink. */
|
|
8
|
+
export function kindOf(p) {
|
|
9
|
+
try {
|
|
10
|
+
const s = lstatSync(p);
|
|
11
|
+
if (s.isSymbolicLink())
|
|
12
|
+
return "symlink";
|
|
13
|
+
if (s.isDirectory())
|
|
14
|
+
return "dir";
|
|
15
|
+
if (s.isFile())
|
|
16
|
+
return "file";
|
|
17
|
+
return "other";
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return "absent";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function sha256(data) {
|
|
24
|
+
return createHash("sha256").update(data).digest("hex");
|
|
25
|
+
}
|
|
26
|
+
export function hashFile(p) {
|
|
27
|
+
return sha256(readFileSync(p));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Normalize an archive or manifest path. Returns `null` for anything that is
|
|
31
|
+
* not a plain relative file path: absolute paths, drive letters, `..`
|
|
32
|
+
* segments, backslashes, NULs. `./a/./b` becomes `a/b`.
|
|
33
|
+
*/
|
|
34
|
+
export function safeRelativePath(raw) {
|
|
35
|
+
if (typeof raw !== "string" || raw.length === 0)
|
|
36
|
+
return null;
|
|
37
|
+
if (raw.includes("\0") || raw.includes("\\"))
|
|
38
|
+
return null;
|
|
39
|
+
if (raw.startsWith("/") || /^[A-Za-z]:/.test(raw))
|
|
40
|
+
return null;
|
|
41
|
+
const parts = raw.split("/").filter((seg) => seg !== "" && seg !== ".");
|
|
42
|
+
if (parts.length === 0 || parts.some((seg) => seg === ".."))
|
|
43
|
+
return null;
|
|
44
|
+
return parts.join("/");
|
|
45
|
+
}
|
|
46
|
+
/** Every entry under `dir`, never descending into a symlinked directory. */
|
|
47
|
+
export function listDir(dir, prefix = "") {
|
|
48
|
+
const files = [];
|
|
49
|
+
const others = [];
|
|
50
|
+
for (const ent of readdirSync(dir, { withFileTypes: true })) {
|
|
51
|
+
const rel = prefix ? `${prefix}/${ent.name}` : ent.name;
|
|
52
|
+
if (ent.isSymbolicLink())
|
|
53
|
+
others.push(rel);
|
|
54
|
+
else if (ent.isDirectory()) {
|
|
55
|
+
const nested = listDir(path.join(dir, ent.name), rel);
|
|
56
|
+
files.push(...nested.files);
|
|
57
|
+
others.push(...nested.others);
|
|
58
|
+
}
|
|
59
|
+
else if (ent.isFile())
|
|
60
|
+
files.push(rel);
|
|
61
|
+
else
|
|
62
|
+
others.push(rel);
|
|
63
|
+
}
|
|
64
|
+
files.sort();
|
|
65
|
+
others.sort();
|
|
66
|
+
return { files, others };
|
|
67
|
+
}
|
|
68
|
+
/** Every regular file under `dir`, as forward-slash relative paths, sorted. */
|
|
69
|
+
export function walkFiles(dir) {
|
|
70
|
+
return listDir(dir).files;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* `p` with every symlink in its longest existing prefix resolved; the part
|
|
74
|
+
* that does not exist yet is appended as given. This is how a scope's skills
|
|
75
|
+
* directory is canonicalised once per command: a symlinked `~/.claude/skills`
|
|
76
|
+
* (a dotfiles setup) is followed to where it points, and every path derived
|
|
77
|
+
* from it is the real one.
|
|
78
|
+
*/
|
|
79
|
+
export function resolveExisting(p) {
|
|
80
|
+
const abs = path.resolve(p);
|
|
81
|
+
let cur = abs;
|
|
82
|
+
const missing = [];
|
|
83
|
+
for (;;) {
|
|
84
|
+
try {
|
|
85
|
+
return path.join(realpathSync(cur), ...missing);
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
const parent = path.dirname(cur);
|
|
89
|
+
if (parent === cur)
|
|
90
|
+
return abs;
|
|
91
|
+
missing.unshift(path.basename(cur));
|
|
92
|
+
cur = parent;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** True when `child` is exactly `<parent>/<one segment>`. */
|
|
97
|
+
export function isDirectChild(parent, child) {
|
|
98
|
+
const rel = path.relative(parent, child);
|
|
99
|
+
return rel !== "" && !rel.startsWith("..") && !path.isAbsolute(rel) && !rel.includes(path.sep) && !rel.includes("/");
|
|
100
|
+
}
|
|
101
|
+
/** True when any directory between `root` and `root/rel` is a symlink. */
|
|
102
|
+
export function hasSymlinkAncestor(root, rel) {
|
|
103
|
+
const parts = rel.split("/");
|
|
104
|
+
let cur = root;
|
|
105
|
+
for (let i = 0; i < parts.length - 1; i += 1) {
|
|
106
|
+
cur = path.join(cur, parts[i]);
|
|
107
|
+
if (kindOf(cur) === "symlink")
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
// ─── owned writes ────────────────────────────────────────────────────────────
|
|
113
|
+
//
|
|
114
|
+
// The installer mutates the filesystem ONLY through the four wrappers below,
|
|
115
|
+
// and each of them calls `safeTarget` on every invocation. Containment is
|
|
116
|
+
// therefore a property of the primitive, not of a check that ran earlier: a
|
|
117
|
+
// plan computed a moment ago cannot write or delete outside the skill
|
|
118
|
+
// directory, whatever was planted in between.
|
|
119
|
+
export class ContainmentError extends Error {
|
|
120
|
+
}
|
|
121
|
+
/** Pin a skill directory: the descriptor every mutation under it must present. */
|
|
122
|
+
export function pinOwnedDir(skillDir) {
|
|
123
|
+
const dir = path.resolve(skillDir);
|
|
124
|
+
return { skillDir: dir, pinnedReal: resolveExisting(dir) };
|
|
125
|
+
}
|
|
126
|
+
/** The longest existing prefix of `p` and how many trailing components it is missing. */
|
|
127
|
+
function existingPrefix(p) {
|
|
128
|
+
let cur = p;
|
|
129
|
+
let missing = 0;
|
|
130
|
+
while (kindOf(cur) === "absent") {
|
|
131
|
+
const parent = path.dirname(cur);
|
|
132
|
+
if (parent === cur)
|
|
133
|
+
break;
|
|
134
|
+
cur = parent;
|
|
135
|
+
missing += 1;
|
|
136
|
+
}
|
|
137
|
+
return { existing: cur, missing };
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The one way the installer addresses a path under a skill directory. Runs
|
|
141
|
+
* in full on every call, `rel === ""` (the skill directory itself) included:
|
|
142
|
+
*
|
|
143
|
+
* - `rel` must be a plain relative path: already normalised, no `..`, not
|
|
144
|
+
* absolute, no backslash, no NUL.
|
|
145
|
+
* - (a) Every existing component from the pinned scope directory down to
|
|
146
|
+
* the target — the scope directory, the skill directory, each part of
|
|
147
|
+
* `rel` — is `lstat`ed and must not be a symlink.
|
|
148
|
+
* - (b) The realpath of the target's longest existing prefix must equal,
|
|
149
|
+
* as a string, the same-depth prefix of `pinnedReal/rel`. A parent
|
|
150
|
+
* swapped for a symlink after the pin was taken resolves elsewhere and
|
|
151
|
+
* is refused, however plausible the new place looks.
|
|
152
|
+
*
|
|
153
|
+
* Throws `ContainmentError`; never returns a path it did not prove.
|
|
154
|
+
*/
|
|
155
|
+
export function safeTarget(owned, rel) {
|
|
156
|
+
const root = path.resolve(owned.skillDir);
|
|
157
|
+
if (typeof rel !== "string" || rel.includes("\0") || rel.includes("\\") || path.isAbsolute(rel) || (rel !== "" && safeRelativePath(rel) !== rel)) {
|
|
158
|
+
throw new ContainmentError(`refusing path ${JSON.stringify(rel)} under ${root}`);
|
|
159
|
+
}
|
|
160
|
+
const parts = rel === "" ? [] : rel.split("/");
|
|
161
|
+
// (a) from the pinned scope directory down.
|
|
162
|
+
let cur = path.dirname(root);
|
|
163
|
+
for (const part of [path.basename(root), ...parts]) {
|
|
164
|
+
const kind = kindOf(cur);
|
|
165
|
+
if (kind === "symlink")
|
|
166
|
+
throw new ContainmentError(`${cur} is a symlink`);
|
|
167
|
+
if (kind === "absent")
|
|
168
|
+
break;
|
|
169
|
+
cur = path.join(cur, part);
|
|
170
|
+
}
|
|
171
|
+
const last = kindOf(cur);
|
|
172
|
+
if (last === "symlink")
|
|
173
|
+
throw new ContainmentError(`${cur} is a symlink`);
|
|
174
|
+
// (b) against the pin, never against a fresh resolution.
|
|
175
|
+
const target = path.join(root, ...parts);
|
|
176
|
+
const pinned = path.resolve(path.join(owned.pinnedReal, ...parts));
|
|
177
|
+
const { existing, missing } = existingPrefix(target);
|
|
178
|
+
let expected = pinned;
|
|
179
|
+
for (let i = 0; i < missing; i += 1)
|
|
180
|
+
expected = path.dirname(expected);
|
|
181
|
+
let actual;
|
|
182
|
+
try {
|
|
183
|
+
actual = realpathSync(existing);
|
|
184
|
+
}
|
|
185
|
+
catch (err) {
|
|
186
|
+
throw new ContainmentError(`cannot resolve ${existing}: ${err.message}`);
|
|
187
|
+
}
|
|
188
|
+
if (actual !== expected) {
|
|
189
|
+
throw new ContainmentError(`${existing} resolves to ${actual}, not the pinned ${expected}`);
|
|
190
|
+
}
|
|
191
|
+
return target;
|
|
192
|
+
}
|
|
193
|
+
/** `mkdir -p` of `rel` (a directory path; `""` for the skill directory itself) inside the owned directory. */
|
|
194
|
+
export function ensureOwnedDir(owned, rel) {
|
|
195
|
+
const dir = safeTarget(owned, rel);
|
|
196
|
+
mkdirSync(dir, { recursive: true });
|
|
197
|
+
return dir;
|
|
198
|
+
}
|
|
199
|
+
/** Write `bytes` at `rel` inside the owned directory, creating parent directories. Returns the absolute path. */
|
|
200
|
+
export function writeOwnedFile(owned, rel, bytes) {
|
|
201
|
+
const parent = path.posix.dirname(rel);
|
|
202
|
+
ensureOwnedDir(owned, parent === "." ? "" : parent);
|
|
203
|
+
const file = safeTarget(owned, rel);
|
|
204
|
+
const kind = kindOf(file);
|
|
205
|
+
if (kind !== "absent" && kind !== "file")
|
|
206
|
+
throw new ContainmentError(`${file} is not a regular file`);
|
|
207
|
+
writeFileSync(file, bytes);
|
|
208
|
+
return file;
|
|
209
|
+
}
|
|
210
|
+
/** Unlink the regular file at `rel` inside the owned directory. Returns the absolute path. */
|
|
211
|
+
export function unlinkOwnedFile(owned, rel) {
|
|
212
|
+
const file = safeTarget(owned, rel);
|
|
213
|
+
if (kindOf(file) !== "file")
|
|
214
|
+
throw new ContainmentError(`${file} is not a regular file`);
|
|
215
|
+
unlinkSync(file);
|
|
216
|
+
return file;
|
|
217
|
+
}
|
|
218
|
+
/** Remove the directory at `rel` (`""` for the skill directory itself) when it is empty. True when removed. */
|
|
219
|
+
export function removeEmptyOwnedDir(owned, rel) {
|
|
220
|
+
const dir = safeTarget(owned, rel);
|
|
221
|
+
if (kindOf(dir) !== "dir")
|
|
222
|
+
return false;
|
|
223
|
+
if (readdirSync(dir).length > 0)
|
|
224
|
+
return false;
|
|
225
|
+
rmdirSync(dir);
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
// ─── CLI state files ─────────────────────────────────────────────────────────
|
|
229
|
+
/**
|
|
230
|
+
* Write one of the installer's own state files (preferences, reminder
|
|
231
|
+
* receipts) under the CLI state directory: the directory is created, a
|
|
232
|
+
* symlink at the file's path is refused rather than written through, and
|
|
233
|
+
* the bytes land atomically (a temporary file beside it, then rename) so a
|
|
234
|
+
* reader never sees a half-written file.
|
|
235
|
+
*/
|
|
236
|
+
export function writeStateFile(file, data) {
|
|
237
|
+
const dir = path.dirname(file);
|
|
238
|
+
mkdirSync(dir, { recursive: true });
|
|
239
|
+
if (kindOf(file) === "symlink")
|
|
240
|
+
throw new ContainmentError(`${file} is a symlink`);
|
|
241
|
+
const tmp = path.join(dir, `.${path.basename(file)}.${process.pid}.${Date.now()}.tmp`);
|
|
242
|
+
writeFileSync(tmp, data);
|
|
243
|
+
try {
|
|
244
|
+
renameSync(tmp, file);
|
|
245
|
+
}
|
|
246
|
+
catch (err) {
|
|
247
|
+
rmSync(tmp, { force: true });
|
|
248
|
+
throw err;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Remove now-empty parent directories of `rel` inside the owned directory,
|
|
253
|
+
* innermost first. The skill directory itself is removed only when
|
|
254
|
+
* `includeRoot` is set and it is empty.
|
|
255
|
+
*/
|
|
256
|
+
export function pruneEmptyDirs(owned, rel, includeRoot = false) {
|
|
257
|
+
const parts = rel.split("/");
|
|
258
|
+
for (let i = parts.length - 1; i >= 1; i -= 1) {
|
|
259
|
+
if (!removeEmptyOwnedDir(owned, parts.slice(0, i).join("/")))
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (includeRoot)
|
|
263
|
+
removeEmptyOwnedDir(owned, "");
|
|
264
|
+
}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { type SkillCatalog, type SkillPayload } from "./catalog.js";
|
|
3
|
+
import { type OwnedDir } from "./files.js";
|
|
4
|
+
import { type SkillAgent, type SkillManifest, type SkillScope, type SkillSourceKind } from "./manifest.js";
|
|
5
|
+
import { type SkillPreferences } from "./prefs.js";
|
|
6
|
+
export { listBundledSkills, resolveBundleDir } from "./catalog.js";
|
|
7
|
+
export type { SkillAgent, SkillScope } from "./manifest.js";
|
|
8
|
+
/** What happens next. `null` means "done, stop". */
|
|
9
|
+
export type SkillNextAction = {
|
|
10
|
+
kind: "run";
|
|
11
|
+
command: string;
|
|
12
|
+
}
|
|
13
|
+
/** The CLI could not fetch the release; a person can, from this address. */
|
|
14
|
+
| {
|
|
15
|
+
kind: "download";
|
|
16
|
+
url: string;
|
|
17
|
+
} | null;
|
|
18
|
+
export type SkillInstallStatus =
|
|
19
|
+
/** Written. `files` names every path this run created or replaced. */
|
|
20
|
+
"installed"
|
|
21
|
+
/** Present already and current. `files: []` is the proof it was a no-op. */
|
|
22
|
+
| "exists"
|
|
23
|
+
/** Present and different. Nothing was written. `conflicts` names the paths. */
|
|
24
|
+
| "conflict"
|
|
25
|
+
/** The one failure shape. */
|
|
26
|
+
| "error";
|
|
27
|
+
export type SkillRemoveStatus = "removed" | "error";
|
|
28
|
+
/** An installed copy, as the manifest describes it. */
|
|
29
|
+
export type SkillState =
|
|
30
|
+
/** No directory. */
|
|
31
|
+
"absent"
|
|
32
|
+
/** Manifest present, every listed file still hashes as written. */
|
|
33
|
+
| "installed"
|
|
34
|
+
/** Manifest present, at least one listed file edited or missing. */
|
|
35
|
+
| "modified"
|
|
36
|
+
/** Something that is not a directory is in the way. */
|
|
37
|
+
| "blocked"
|
|
38
|
+
/** Directory present, no (valid) manifest — not ours to update or remove. */
|
|
39
|
+
| "unmanaged";
|
|
40
|
+
/** One skill's outcome inside an install or update run. */
|
|
41
|
+
export interface SkillResult {
|
|
42
|
+
status: SkillInstallStatus;
|
|
43
|
+
skill: string;
|
|
44
|
+
/** Release tag the payload came from; null when the source carries none. */
|
|
45
|
+
version: string | null;
|
|
46
|
+
source: SkillSourceKind | null;
|
|
47
|
+
/** The manifest's version before this run (update only). */
|
|
48
|
+
previous?: string | null;
|
|
49
|
+
scope: SkillScope;
|
|
50
|
+
/** Absolute path of the installed copy. */
|
|
51
|
+
target: string;
|
|
52
|
+
/** Files written BY THIS RUN, absolute. `[]` proves a no-op. */
|
|
53
|
+
files: string[];
|
|
54
|
+
/** Retired files deleted by this run, absolute (update only). */
|
|
55
|
+
deleted?: string[];
|
|
56
|
+
/** Paths that differ and were not written. Non-empty only on conflict. */
|
|
57
|
+
conflicts?: string[];
|
|
58
|
+
/** Files under the target the skill does not own. Never written, never deleted. */
|
|
59
|
+
extra?: string[];
|
|
60
|
+
/** Absolute path of the manifest, when this run wrote or refreshed it. */
|
|
61
|
+
manifest?: string;
|
|
62
|
+
/** Set when the skill was pulled in through another skill's `requires`. */
|
|
63
|
+
requiredBy?: string;
|
|
64
|
+
/** Why an `exists` was a no-op when that is not obvious: the installed copy is newer, or it has no manifest. */
|
|
65
|
+
message?: string;
|
|
66
|
+
/** The target exists without a manifest and was not adopted; `nextAction` says how to. */
|
|
67
|
+
unmanaged?: boolean;
|
|
68
|
+
nextAction: SkillNextAction;
|
|
69
|
+
error?: string;
|
|
70
|
+
kind?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface SkillCatalogInfo {
|
|
73
|
+
version: string | null;
|
|
74
|
+
/** Where the catalog used for this run came from. */
|
|
75
|
+
origin: "release" | "embedded" | "none";
|
|
76
|
+
/** Why the release was not used, when it was wanted. */
|
|
77
|
+
unreachable?: string;
|
|
78
|
+
}
|
|
79
|
+
/** The result of `install`, `update` and `init`. */
|
|
80
|
+
export interface SkillInstallResult {
|
|
81
|
+
status: SkillInstallStatus;
|
|
82
|
+
agent?: SkillAgent;
|
|
83
|
+
scope?: SkillScope;
|
|
84
|
+
catalog?: SkillCatalogInfo;
|
|
85
|
+
/** One entry per skill, requested ones first, then `requires`. */
|
|
86
|
+
skills?: SkillResult[];
|
|
87
|
+
/** REQUIRED, nullable. An agent reads exactly one key. */
|
|
88
|
+
nextAction: SkillNextAction;
|
|
89
|
+
error?: string;
|
|
90
|
+
kind?: string;
|
|
91
|
+
/** `init` only: what was saved for later `skill` subcommands. */
|
|
92
|
+
preferences?: SkillPreferences & {
|
|
93
|
+
path: string;
|
|
94
|
+
};
|
|
95
|
+
/** `init` only: other skills in the embedded catalog. */
|
|
96
|
+
available?: {
|
|
97
|
+
name: string;
|
|
98
|
+
description: string;
|
|
99
|
+
}[];
|
|
100
|
+
}
|
|
101
|
+
export interface SkillRemoveResult {
|
|
102
|
+
status: SkillRemoveStatus;
|
|
103
|
+
agent?: SkillAgent;
|
|
104
|
+
scope?: SkillScope;
|
|
105
|
+
skill?: string;
|
|
106
|
+
target?: string;
|
|
107
|
+
version?: string | null;
|
|
108
|
+
/** Files deleted by this run, absolute. */
|
|
109
|
+
deleted?: string[];
|
|
110
|
+
/**
|
|
111
|
+
* Files left under the target, relative: manifest files that were edited
|
|
112
|
+
* (never deleted) and files the manifest does not list. When `SKILL.md`
|
|
113
|
+
* is among them the skill stays discoverable by the agent.
|
|
114
|
+
*/
|
|
115
|
+
kept?: string[];
|
|
116
|
+
nextAction: SkillNextAction;
|
|
117
|
+
error?: string;
|
|
118
|
+
kind?: string;
|
|
119
|
+
}
|
|
120
|
+
export interface SkillScopeState {
|
|
121
|
+
path: string;
|
|
122
|
+
state: SkillState;
|
|
123
|
+
/** The installed manifest's version, when there is a manifest. */
|
|
124
|
+
version: string | null;
|
|
125
|
+
/** Why a present manifest was rejected. */
|
|
126
|
+
error?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface SkillListEntry {
|
|
129
|
+
name: string;
|
|
130
|
+
description: string;
|
|
131
|
+
requires: string[];
|
|
132
|
+
/** How many files the source holds, when known. */
|
|
133
|
+
files: number | null;
|
|
134
|
+
/** True when this build carries the skill for offline install. */
|
|
135
|
+
embedded: boolean;
|
|
136
|
+
/** Newest version this run knows of: the refreshed catalog, else the embedded snapshot. */
|
|
137
|
+
latest: string | null;
|
|
138
|
+
project: SkillScopeState;
|
|
139
|
+
global: SkillScopeState;
|
|
140
|
+
}
|
|
141
|
+
export interface SkillListResult {
|
|
142
|
+
status: "ok" | "error";
|
|
143
|
+
/** The embedded bundle's location, or null when this build carries none. */
|
|
144
|
+
source?: string | null;
|
|
145
|
+
agent?: SkillAgent;
|
|
146
|
+
catalog?: {
|
|
147
|
+
version: string | null;
|
|
148
|
+
origin: "embedded" | "none";
|
|
149
|
+
};
|
|
150
|
+
/** Present with `--refresh`. */
|
|
151
|
+
latest?: {
|
|
152
|
+
version: string;
|
|
153
|
+
origin: "release";
|
|
154
|
+
} | {
|
|
155
|
+
error: string;
|
|
156
|
+
url: string;
|
|
157
|
+
};
|
|
158
|
+
skills?: SkillListEntry[];
|
|
159
|
+
nextAction: SkillNextAction;
|
|
160
|
+
error?: string;
|
|
161
|
+
kind?: string;
|
|
162
|
+
}
|
|
163
|
+
export interface SkillInstallOptions {
|
|
164
|
+
agent?: string;
|
|
165
|
+
global?: boolean;
|
|
166
|
+
project?: boolean;
|
|
167
|
+
dir?: string;
|
|
168
|
+
/** Overwrite files the user edited. Nothing else. */
|
|
169
|
+
force?: boolean;
|
|
170
|
+
/** Let an older, or not comparable, version replace an installed one. */
|
|
171
|
+
allowDowngrade?: boolean;
|
|
172
|
+
json?: boolean;
|
|
173
|
+
}
|
|
174
|
+
export interface SkillListOptions {
|
|
175
|
+
agent?: string;
|
|
176
|
+
refresh?: boolean;
|
|
177
|
+
json?: boolean;
|
|
178
|
+
}
|
|
179
|
+
export declare function isSkillName(name: unknown): name is string;
|
|
180
|
+
/**
|
|
181
|
+
* The scope's skills directory for an agent, symlinks resolved. A symlinked
|
|
182
|
+
* `.claude/skills` or `.agents/skills` (a dotfiles setup) is legitimate and
|
|
183
|
+
* is followed; the resolution happens once per command and every target,
|
|
184
|
+
* reported path and write is derived from the resolved directory.
|
|
185
|
+
*/
|
|
186
|
+
export declare function skillsDir(scopeRoot: string, agent?: SkillAgent): string;
|
|
187
|
+
/**
|
|
188
|
+
* Where a skill lives inside a resolved skills directory: exactly
|
|
189
|
+
* `<dir>/<name>`. The name is validated before the path is built and the
|
|
190
|
+
* built path is checked to be a direct child — a second line behind the
|
|
191
|
+
* regex, so no caller can ever address a path outside the directory.
|
|
192
|
+
*/
|
|
193
|
+
export declare function targetIn(dir: string, name: string): string;
|
|
194
|
+
export declare function skillTarget(scopeRoot: string, name: string, agent?: SkillAgent): string;
|
|
195
|
+
/**
|
|
196
|
+
* The skill directory as a pinned descriptor: its path under the resolved
|
|
197
|
+
* scope directory and what that resolved to right now. Taken once per skill
|
|
198
|
+
* per command, before planning; every write or delete that follows is
|
|
199
|
+
* checked against it, never against a fresh resolution.
|
|
200
|
+
*/
|
|
201
|
+
export declare function ownedTarget(dir: string, name: string): OwnedDir;
|
|
202
|
+
/** The command that would resolve the current invocation, `--force` and `--allow-downgrade` optional. */
|
|
203
|
+
export declare function skillCommand(verb: "install" | "update" | "remove", names: string | string[], opts: SkillInstallOptions, force: boolean, allowDowngrade?: boolean): string;
|
|
204
|
+
export declare function installCommand(skill: string | string[], opts: SkillInstallOptions, force: boolean): string;
|
|
205
|
+
export interface Plan {
|
|
206
|
+
status: SkillInstallStatus;
|
|
207
|
+
error?: string;
|
|
208
|
+
kind?: string;
|
|
209
|
+
/** Informational text for a guarded `exists`; the manifest is left alone. */
|
|
210
|
+
message?: string;
|
|
211
|
+
/** An `exists` that must not touch the manifest either (older candidate; unmanaged target). */
|
|
212
|
+
noWrite?: boolean;
|
|
213
|
+
/** The target has no manifest and was not adopted. */
|
|
214
|
+
unmanaged?: boolean;
|
|
215
|
+
nextAction?: SkillNextAction;
|
|
216
|
+
/** Payload paths to write. */
|
|
217
|
+
writes: string[];
|
|
218
|
+
/** Retired, unmodified manifest paths to delete. */
|
|
219
|
+
deletes: string[];
|
|
220
|
+
/** Paths `--force` would overwrite. */
|
|
221
|
+
conflicts: string[];
|
|
222
|
+
/** Paths nothing overrides: not a regular file, or under a symlinked directory. */
|
|
223
|
+
hard: string[];
|
|
224
|
+
/** Local files the payload does not own. */
|
|
225
|
+
extra: string[];
|
|
226
|
+
previous: SkillManifest | null;
|
|
227
|
+
}
|
|
228
|
+
/** Exported for tests that need to act between planning and applying. */
|
|
229
|
+
export declare function planUpdate(payload: SkillPayload, target: string, force: boolean, allowDowngrade?: boolean): Plan;
|
|
230
|
+
export interface ApplyContext {
|
|
231
|
+
agent: SkillAgent;
|
|
232
|
+
scope: SkillScope;
|
|
233
|
+
/** The resolved skills directory the target must stay inside. */
|
|
234
|
+
dir: string;
|
|
235
|
+
verb: "install" | "update";
|
|
236
|
+
opts: SkillInstallOptions;
|
|
237
|
+
requiredBy?: string;
|
|
238
|
+
}
|
|
239
|
+
export declare function applyPlan(payload: SkillPayload, owned: OwnedDir, plan: Plan, ctx: ApplyContext): SkillResult;
|
|
240
|
+
interface InstallInternals {
|
|
241
|
+
/** `init`: never consult the release; the embedded bundle is the source. */
|
|
242
|
+
offline?: boolean;
|
|
243
|
+
init?: {
|
|
244
|
+
preferences: SkillPreferences;
|
|
245
|
+
path: string;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
export declare function runSkillInstall(names: string | string[] | undefined, opts: SkillInstallOptions, internal?: InstallInternals): Promise<number>;
|
|
249
|
+
export declare function runSkillUpdate(names: string[], opts: SkillInstallOptions): Promise<number>;
|
|
250
|
+
export declare function runSkillRemove(name: string, opts: SkillInstallOptions): Promise<number>;
|
|
251
|
+
export interface ListEntriesOptions {
|
|
252
|
+
/** A freshly fetched catalog (`--refresh`), consulted for `latest` first. */
|
|
253
|
+
latest?: SkillCatalog | null;
|
|
254
|
+
/** Hash every manifest file to tell `installed` from `modified`. Off for startup reminders. */
|
|
255
|
+
verify?: boolean;
|
|
256
|
+
/** Project root; defaults to cwd. */
|
|
257
|
+
cwd?: string;
|
|
258
|
+
}
|
|
259
|
+
/** Catalog rows with installed state at both scopes for one agent. */
|
|
260
|
+
export declare function installedSkillEntries(agent: SkillAgent, options?: ListEntriesOptions): SkillListEntry[];
|
|
261
|
+
export declare function runSkillList(opts: SkillListOptions): Promise<number>;
|
|
262
|
+
export interface SkillInitIO {
|
|
263
|
+
interactive: boolean;
|
|
264
|
+
agent(): Promise<SkillAgent>;
|
|
265
|
+
global(): Promise<boolean>;
|
|
266
|
+
}
|
|
267
|
+
export declare function runSkillInit(opts: SkillInstallOptions, io?: SkillInitIO): Promise<number>;
|
|
268
|
+
export declare function registerSkillCommand(program: Command): void;
|