@jini-ai/devops 0.7.3-next.1 → 0.7.3-next.3
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/CHANGELOG.md +6 -0
- package/README.md +16 -0
- package/dist/backup/site/archive-extensions.d.ts +73 -0
- package/dist/backup/site/archive-extensions.js +129 -0
- package/dist/backup/site/archive-manifest.d.ts +85 -0
- package/dist/backup/site/archive-manifest.js +176 -0
- package/dist/backup/site/archive-media.d.ts +121 -0
- package/dist/backup/site/archive-media.js +93 -0
- package/dist/backup/site/backup-service.credentials.d.ts +31 -0
- package/dist/backup/site/backup-service.credentials.js +161 -0
- package/dist/backup/site/backup-service.d.ts +331 -0
- package/dist/backup/site/backup-service.js +125 -0
- package/dist/backup/site/backup-service.plan.d.ts +64 -0
- package/dist/backup/site/backup-service.plan.js +207 -0
- package/dist/backup/site/backup-service.push.d.ts +29 -0
- package/dist/backup/site/backup-service.push.js +82 -0
- package/dist/backup/site/backup-service.shared.d.ts +40 -0
- package/dist/backup/site/backup-service.shared.js +37 -0
- package/dist/backup/site/bundled-export-file-policy.d.ts +38 -0
- package/dist/backup/site/bundled-export-file-policy.js +40 -0
- package/dist/backup/site/credential-warnings.d.ts +41 -0
- package/dist/backup/site/credential-warnings.js +50 -0
- package/dist/backup/site/import-backend-steps.d.ts +167 -0
- package/dist/backup/site/import-backend-steps.js +170 -0
- package/dist/backup/site/import-backend.d.ts +167 -0
- package/dist/backup/site/import-backend.js +298 -0
- package/dist/backup/site/import-database.d.ts +118 -0
- package/dist/backup/site/import-database.js +167 -0
- package/dist/backup/site/import-index/admission.d.ts +54 -0
- package/dist/backup/site/import-index/admission.js +46 -0
- package/dist/backup/site/import-index/backfill.d.ts +106 -0
- package/dist/backup/site/import-index/backfill.js +137 -0
- package/dist/backup/site/import-index/errors.d.ts +28 -0
- package/dist/backup/site/import-index/errors.js +38 -0
- package/dist/backup/site/import-index/migrations/checksums.d.ts +4 -0
- package/dist/backup/site/import-index/migrations/checksums.js +4 -0
- package/dist/backup/site/import-index/migrations/site-imports-v1.d.ts +2 -0
- package/dist/backup/site/import-index/migrations/site-imports-v1.js +10 -0
- package/dist/backup/site/import-index/mode.d.ts +191 -0
- package/dist/backup/site/import-index/mode.js +272 -0
- package/dist/backup/site/import-index/open.d.ts +40 -0
- package/dist/backup/site/import-index/open.js +87 -0
- package/dist/backup/site/import-index/paging.d.ts +28 -0
- package/dist/backup/site/import-index/paging.js +66 -0
- package/dist/backup/site/import-index/payload-namespace.d.ts +80 -0
- package/dist/backup/site/import-index/payload-namespace.js +156 -0
- package/dist/backup/site/import-index/rows.d.ts +32 -0
- package/dist/backup/site/import-index/rows.js +61 -0
- package/dist/backup/site/import-index/schema.d.ts +8 -0
- package/dist/backup/site/import-index/schema.js +31 -0
- package/dist/backup/site/import-index/store.d.ts +27 -0
- package/dist/backup/site/import-index/store.js +33 -0
- package/dist/backup/site/import-index/sweep.d.ts +10 -0
- package/dist/backup/site/import-index/sweep.js +26 -0
- package/dist/backup/site/import-keep-off.d.ts +128 -0
- package/dist/backup/site/import-keep-off.js +204 -0
- package/dist/backup/site/import-plugin-state.d.ts +74 -0
- package/dist/backup/site/import-plugin-state.js +67 -0
- package/dist/backup/site/import-registry.d.ts +110 -0
- package/dist/backup/site/import-registry.js +205 -0
- package/dist/backup/site/import-restore-placement.d.ts +94 -0
- package/dist/backup/site/import-restore-placement.js +158 -0
- package/dist/backup/site/import-restore.d.ts +111 -0
- package/dist/backup/site/import-restore.js +120 -0
- package/dist/backup/site/import-verifier-inventory.d.ts +137 -0
- package/dist/backup/site/import-verifier-inventory.js +236 -0
- package/dist/backup/site/import-verifier-projection.d.ts +78 -0
- package/dist/backup/site/import-verifier-projection.js +100 -0
- package/dist/backup/site/import-verifier.d.ts +126 -0
- package/dist/backup/site/import-verifier.js +53 -0
- package/dist/backup/site/owned-temp-root.d.ts +12 -0
- package/dist/backup/site/owned-temp-root.js +2 -0
- package/dist/backup/site/package-file-inventory.d.ts +63 -0
- package/dist/backup/site/package-file-inventory.js +56 -0
- package/dist/backup/site/push-content.d.ts +70 -0
- package/dist/backup/site/push-content.js +56 -0
- package/dist/backup/site/react/ShowMoreImports.d.ts +21 -0
- package/dist/backup/site/react/ShowMoreImports.js +8 -0
- package/dist/backup/site/saved-keys-port.d.ts +47 -0
- package/dist/backup/site/saved-keys-port.js +3 -0
- package/dist/backup/site/saved-keys.d.ts +25 -0
- package/dist/backup/site/saved-keys.js +38 -0
- package/dist/backup/site/share-backend.d.ts +243 -0
- package/dist/backup/site/share-backend.js +284 -0
- package/dist/backup/site/share-database/projection.d.ts +195 -0
- package/dist/backup/site/share-database/projection.js +90 -0
- package/dist/backup/site/share-database/projection.media.d.ts +38 -0
- package/dist/backup/site/share-database/projection.media.js +179 -0
- package/dist/backup/site/share-database/projection.tables.d.ts +46 -0
- package/dist/backup/site/share-database/projection.tables.js +193 -0
- package/dist/backup/site/share-expiry.d.ts +75 -0
- package/dist/backup/site/share-expiry.js +49 -0
- package/dist/backup/site/share-export-failure.d.ts +17 -0
- package/dist/backup/site/share-export-failure.js +16 -0
- package/dist/backup/site/share-file-policy.d.ts +60 -0
- package/dist/backup/site/share-file-policy.js +146 -0
- package/dist/backup/site/share-hosting.d.ts +107 -0
- package/dist/backup/site/share-hosting.js +148 -0
- package/dist/backup/site/share-preparation-steps.d.ts +180 -0
- package/dist/backup/site/share-preparation-steps.js +109 -0
- package/dist/backup/site/share-preparation.d.ts +122 -0
- package/dist/backup/site/share-preparation.js +43 -0
- package/dist/backup/site/share-refusal.d.ts +21 -0
- package/dist/backup/site/share-refusal.js +20 -0
- package/dist/backup/site/share-registry.d.ts +124 -0
- package/dist/backup/site/share-registry.js +219 -0
- package/dist/backup/site/share-retention.d.ts +62 -0
- package/dist/backup/site/share-retention.js +126 -0
- package/dist/backup/site/share-service.d.ts +128 -0
- package/dist/backup/site/share-service.js +194 -0
- package/dist/backup/site/share-zip.d.ts +115 -0
- package/dist/backup/site/share-zip.js +144 -0
- package/dist/backup/site/sources.d.ts +344 -0
- package/dist/backup/site/sources.js +595 -0
- package/dist/backup/site/static-copy.d.ts +122 -0
- package/dist/backup/site/static-copy.js +165 -0
- package/dist/backup/site/static-download-html.d.ts +76 -0
- package/dist/backup/site/static-download-html.js +149 -0
- package/dist/backup/site/static-download-landing.d.ts +52 -0
- package/dist/backup/site/static-download-landing.js +95 -0
- package/dist/backup/site/static-download-layout.d.ts +96 -0
- package/dist/backup/site/static-download-layout.js +325 -0
- package/dist/backup/site/static-export-selection.d.ts +50 -0
- package/dist/backup/site/static-export-selection.js +76 -0
- package/dist/backup/site/static-site-packager.d.ts +42 -0
- package/dist/backup/site/static-site-packager.js +32 -0
- package/dist/backup/site/tool-registrations.d.ts +74 -0
- package/dist/backup/site/tool-registrations.js +201 -0
- package/dist/checks/complexity-debt.d.ts +100 -0
- package/dist/checks/complexity-debt.js +131 -0
- package/dist/checks/coverage/diff.js +5 -1
- package/dist/checks/env-access.d.ts +14 -1
- package/dist/checks/env-access.js +92 -6
- package/dist/checks/live-verify-checks.d.ts +29 -0
- package/dist/checks/live-verify-checks.js +30 -0
- package/dist/checks/quality-gates.d.ts +137 -0
- package/dist/checks/quality-gates.js +209 -0
- package/dist/core/deploy-types.d.ts +2 -0
- package/dist/deploy/admin-http/site-update-status.d.ts +8 -0
- package/dist/deploy/admin-http/site-update-status.js +15 -0
- package/dist/deploy/host-kit.d.ts +3 -0
- package/dist/deploy/index.d.ts +6 -0
- package/dist/deploy/index.js +6 -0
- package/dist/deploy/ops-runner.js +7 -0
- package/dist/deploy/ops-tool-contracts.d.ts +10 -1
- package/dist/deploy/react/Deployment.d.ts +37 -0
- package/dist/deploy/react/Deployment.js +94 -0
- package/dist/deploy/react/DockerfileTab.d.ts +72 -0
- package/dist/deploy/react/DockerfileTab.js +131 -0
- package/dist/deploy/react/HistoryTab.d.ts +43 -0
- package/dist/deploy/react/HistoryTab.js +12 -0
- package/dist/deploy/react/OverviewTab.d.ts +60 -0
- package/dist/deploy/react/OverviewTab.js +75 -0
- package/dist/deploy/react/PublishRunResult.d.ts +5 -1
- package/dist/deploy/react/PublishRunResult.js +4 -4
- package/dist/deploy/react/SiteUpdateNotice.d.ts +22 -0
- package/dist/deploy/react/SiteUpdateNotice.js +25 -0
- package/dist/deploy/react/StaticCredentialFields.d.ts +36 -0
- package/dist/deploy/react/StaticCredentialFields.js +63 -0
- package/dist/deploy/react/StaticCredentialSteps.d.ts +23 -0
- package/dist/deploy/react/StaticCredentialSteps.js +155 -0
- package/dist/deploy/react/StaticExportCard.d.ts +11 -0
- package/dist/deploy/react/StaticExportCard.js +97 -0
- package/dist/deploy/react/StaticPublishCredentials.d.ts +50 -0
- package/dist/deploy/react/StaticPublishCredentials.js +77 -0
- package/dist/deploy/react/StaticPublishForm.d.ts +12 -0
- package/dist/deploy/react/StaticPublishForm.js +91 -0
- package/dist/deploy/react/StaticSiteTab.d.ts +207 -0
- package/dist/deploy/react/StaticSiteTab.js +117 -0
- package/dist/deploy/react/deployment-visuals.d.ts +207 -0
- package/dist/deploy/react/deployment-visuals.js +101 -0
- package/dist/deploy/react/download-dockerfile.d.ts +14 -0
- package/dist/deploy/react/download-dockerfile.js +15 -0
- package/dist/deploy/react/hooks/publish-credential-draft.d.ts +33 -0
- package/dist/deploy/react/hooks/publish-credential-draft.js +54 -0
- package/dist/deploy/react/hooks/publish-credential-selection.d.ts +13 -0
- package/dist/deploy/react/hooks/publish-credential-selection.js +34 -0
- package/dist/deploy/react/hooks/publish-credential-writes.d.ts +20 -0
- package/dist/deploy/react/hooks/publish-credential-writes.js +99 -0
- package/dist/deploy/react/hooks/static-publish-actions.d.ts +10 -0
- package/dist/deploy/react/hooks/static-publish-actions.js +62 -0
- package/dist/deploy/react/hooks/static-publish-form.hooks.d.ts +38 -0
- package/dist/deploy/react/hooks/static-publish-form.hooks.js +103 -0
- package/dist/deploy/react/hooks/static-publish-run.hooks.d.ts +28 -0
- package/dist/deploy/react/hooks/static-publish-run.hooks.js +92 -0
- package/dist/deploy/react/hooks/use-dockerfile-source.hooks.d.ts +148 -0
- package/dist/deploy/react/hooks/use-dockerfile-source.hooks.js +155 -0
- package/dist/deploy/react/hooks/use-publish-credentials.hooks.d.ts +268 -0
- package/dist/deploy/react/hooks/use-publish-credentials.hooks.js +52 -0
- package/dist/deploy/react/hooks/use-static-export.hooks.d.ts +128 -0
- package/dist/deploy/react/hooks/use-static-export.hooks.js +159 -0
- package/dist/deploy/react/hooks/use-static-publish.hooks.d.ts +208 -0
- package/dist/deploy/react/hooks/use-static-publish.hooks.js +48 -0
- package/dist/deploy/react/index.d.ts +4 -0
- package/dist/deploy/react/index.js +2 -0
- package/dist/deploy/react/rules.d.ts +363 -0
- package/dist/deploy/react/rules.js +314 -0
- package/dist/deploy/react/use-deployment-overview.hooks.d.ts +41 -0
- package/dist/deploy/react/use-deployment-overview.hooks.js +11 -0
- package/dist/deploy/site/agent-tools.d.ts +42 -0
- package/dist/deploy/site/agent-tools.js +119 -0
- package/dist/deploy/site/deploy-config-registry.d.ts +155 -0
- package/dist/deploy/site/deploy-config-registry.js +124 -0
- package/dist/deploy/site/deploy-config.d.ts +97 -0
- package/dist/deploy/site/deploy-config.js +115 -0
- package/dist/deploy/site/deploy-ops/agent-tools.d.ts +22 -0
- package/dist/deploy/site/deploy-ops/agent-tools.js +76 -0
- package/dist/deploy/site/deploy-ops/registry.d.ts +134 -0
- package/dist/deploy/site/deploy-ops/registry.js +106 -0
- package/dist/deploy/site/deploy-ops/run-ops.d.ts +66 -0
- package/dist/deploy/site/deploy-ops/run-ops.js +34 -0
- package/dist/deploy/site/deploy-ops/secret-confirm.d.ts +36 -0
- package/dist/deploy/site/deploy-ops/secret-confirm.js +27 -0
- package/dist/deploy/site/deploy-targets/host-kit.d.ts +28 -0
- package/dist/deploy/site/deploy-targets/host-kit.js +120 -0
- package/dist/deploy/site/deploy-targets/registry.d.ts +157 -0
- package/dist/deploy/site/deploy-targets/registry.js +132 -0
- package/dist/deploy/site/deploy-targets/types.d.ts +27 -0
- package/dist/deploy/site/deploy-targets/types.js +2 -0
- package/dist/deploy/site/dockerfile.d.ts +137 -0
- package/dist/deploy/site/dockerfile.js +101 -0
- package/dist/deploy/site/export-run.d.ts +137 -0
- package/dist/deploy/site/export-run.js +152 -0
- package/dist/deploy/site/ports.d.ts +115 -0
- package/dist/deploy/site/ports.js +2 -0
- package/dist/deploy/site/publish-agent-tools.d.ts +18 -0
- package/dist/deploy/site/publish-agent-tools.js +120 -0
- package/dist/deploy/site/publish-candidate.d.ts +26 -0
- package/dist/deploy/site/publish-candidate.js +37 -0
- package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.d.ts +78 -0
- package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.js +88 -0
- package/dist/deploy/site/publish-credentials/compatibility-port.d.ts +38 -0
- package/dist/deploy/site/publish-credentials/compatibility-port.js +19 -0
- package/dist/deploy/site/publish-credentials/execution-mode.d.ts +43 -0
- package/dist/deploy/site/publish-credentials/execution-mode.js +19 -0
- package/dist/deploy/site/publish-credentials/store-owner.d.ts +11 -0
- package/dist/deploy/site/publish-credentials/store-owner.js +9 -0
- package/dist/deploy/site/publish-credentials/store-resolution.d.ts +55 -0
- package/dist/deploy/site/publish-credentials/store-resolution.js +100 -0
- package/dist/deploy/site/publish-credentials/store-validation.d.ts +68 -0
- package/dist/deploy/site/publish-credentials/store-validation.js +182 -0
- package/dist/deploy/site/publish-credentials/store.d.ts +322 -0
- package/dist/deploy/site/publish-credentials/store.js +372 -0
- package/dist/deploy/site/publish-credentials/types.d.ts +85 -0
- package/dist/deploy/site/publish-credentials/types.js +2 -0
- package/dist/deploy/site/publish-tool-capabilities.d.ts +123 -0
- package/dist/deploy/site/publish-tool-capabilities.js +175 -0
- package/dist/deploy/site/publish-tool-credential.d.ts +48 -0
- package/dist/deploy/site/publish-tool-credential.js +284 -0
- package/dist/deploy/site/publish-tool-deps.d.ts +205 -0
- package/dist/deploy/site/publish-tool-deps.js +15 -0
- package/dist/deploy/site/publish-tool-execution.d.ts +78 -0
- package/dist/deploy/site/publish-tool-execution.js +313 -0
- package/dist/deploy/site/publish-tool-schema.d.ts +29 -0
- package/dist/deploy/site/publish-tool-schema.js +38 -0
- package/dist/deploy/site/static-publish/adapter-export.d.ts +54 -0
- package/dist/deploy/site/static-publish/adapter-export.js +89 -0
- package/dist/deploy/site/static-publish/adapter-plan.d.ts +99 -0
- package/dist/deploy/site/static-publish/adapter-plan.js +112 -0
- package/dist/deploy/site/static-publish/adapter.d.ts +182 -0
- package/dist/deploy/site/static-publish/adapter.js +321 -0
- package/dist/deploy/site/static-publish/admin-publish-read.d.ts +209 -0
- package/dist/deploy/site/static-publish/admin-publish-read.js +116 -0
- package/dist/deploy/site/static-publish/credentials.d.ts +110 -0
- package/dist/deploy/site/static-publish/credentials.js +290 -0
- package/dist/deploy/site/static-publish/domain-publish-rows.d.ts +25 -0
- package/dist/deploy/site/static-publish/domain-publish-rows.js +43 -0
- package/dist/deploy/site/static-publish/domain-publish-tool.d.ts +19 -0
- package/dist/deploy/site/static-publish/domain-publish-tool.js +111 -0
- package/dist/deploy/site/static-publish/inspection.d.ts +24 -0
- package/dist/deploy/site/static-publish/inspection.js +69 -0
- package/dist/deploy/site/static-publish/publish-history.d.ts +197 -0
- package/dist/deploy/site/static-publish/publish-history.js +153 -0
- package/dist/deploy/site/static-publish/publish-run.d.ts +156 -0
- package/dist/deploy/site/static-publish/publish-run.js +186 -0
- package/dist/deploy/site/static-publish/types.d.ts +165 -0
- package/dist/deploy/site/static-publish/types.js +2 -0
- package/dist/deploy/site/static-publish/verify.d.ts +217 -0
- package/dist/deploy/site/static-publish/verify.js +248 -0
- package/dist/deploy/site/tool-registrations.d.ts +97 -0
- package/dist/deploy/site/tool-registrations.js +130 -0
- package/dist/deploy/site/types.d.ts +51 -0
- package/dist/deploy/site/types.js +2 -0
- package/dist/deploy/site-update/check-for-update.d.ts +19 -0
- package/dist/deploy/site-update/check-for-update.js +19 -0
- package/dist/deploy/site-update/contracts.d.ts +161 -0
- package/dist/deploy/site-update/contracts.js +94 -0
- package/dist/deploy/site-update/desktop-site-update.d.ts +66 -0
- package/dist/deploy/site-update/desktop-site-update.js +43 -0
- package/dist/deploy/site-update/fake-site-update.d.ts +39 -0
- package/dist/deploy/site-update/fake-site-update.js +52 -0
- package/dist/deploy/site-update/run-site-update.d.ts +121 -0
- package/dist/deploy/site-update/run-site-update.js +219 -0
- package/dist/deploy/site-update/self-hosted-site-update.d.ts +71 -0
- package/dist/deploy/site-update/self-hosted-site-update.js +79 -0
- package/dist/deploy/target-contracts.d.ts +3 -0
- package/dist/deploy/tool.d.ts +5 -8
- package/dist/deploy/tool.js +6 -9
- package/dist/dns/binding-sweeper.d.ts +72 -0
- package/dist/dns/binding-sweeper.js +53 -0
- package/dist/dns/index.d.ts +1 -0
- package/dist/dns/index.js +1 -0
- package/dist/dns/site/binding.repo.d.ts +71 -0
- package/dist/dns/site/binding.repo.js +45 -0
- package/dist/dns/site/dns-changes.d.ts +90 -0
- package/dist/dns/site/dns-changes.js +271 -0
- package/dist/dns/site/dns-tools.d.ts +46 -0
- package/dist/dns/site/dns-tools.js +204 -0
- package/dist/dns/site/mail-dns-status.d.ts +111 -0
- package/dist/dns/site/mail-dns-status.js +190 -0
- package/dist/dns/site/mail-dns-tools.d.ts +33 -0
- package/dist/dns/site/mail-dns-tools.js +62 -0
- package/dist/dns/site/mail-requirements.d.ts +30 -0
- package/dist/dns/site/mail-requirements.js +78 -0
- package/dist/dns/site/tool-deps.d.ts +21 -0
- package/dist/dns/site/tool-deps.js +2 -0
- package/dist/dns/site/tools.d.ts +74 -0
- package/dist/dns/site/tools.js +124 -0
- package/dist/local-dev/bind-host.d.ts +80 -0
- package/dist/local-dev/bind-host.js +90 -0
- package/dist/local-dev/dev-proxy-upstream.d.ts +69 -0
- package/dist/local-dev/dev-proxy-upstream.js +63 -0
- package/dist/local-dev/index.d.ts +28 -0
- package/dist/local-dev/index.js +25 -0
- package/dist/packaging/electron/archive.d.ts +2 -9
- package/dist/packaging/electron/asar-adapter.d.ts +2 -1
- package/dist/packaging/electron/entry.d.ts +2 -0
- package/dist/packaging/electron/move-to-applications.d.ts +165 -0
- package/dist/packaging/electron/move-to-applications.js +162 -0
- package/dist/packaging/electron/policies.d.ts +33 -4
- package/dist/packaging/electron/policies.js +29 -10
- package/dist/packaging/electron/ports.d.ts +1 -6
- package/dist/packaging/electron/staging.d.ts +11 -2
- package/dist/packaging/electron/staging.js +15 -5
- package/dist/react/site-share-expiry/ShareExpiryControls.d.ts +29 -0
- package/dist/react/site-share-expiry/ShareExpiryControls.js +7 -0
- package/dist/react/site-share-expiry/index.d.ts +2 -0
- package/dist/react/site-share-expiry/index.js +2 -0
- package/dist/source-control/react/ProvidersTab.d.ts +98 -0
- package/dist/source-control/react/ProvidersTab.js +195 -0
- package/dist/source-control/react/SourceControl.d.ts +51 -0
- package/dist/source-control/react/SourceControl.js +61 -0
- package/dist/source-control/react/hooks/use-source-control-credentials.hooks.d.ts +128 -0
- package/dist/source-control/react/hooks/use-source-control-credentials.hooks.js +102 -0
- package/dist/source-control/react/rules.d.ts +167 -0
- package/dist/source-control/react/rules.js +125 -0
- package/dist/source-control/react/source-control-visuals.d.ts +75 -0
- package/dist/source-control/react/source-control-visuals.js +48 -0
- package/dist/source-control/site/agent-tools.d.ts +5 -0
- package/dist/source-control/site/agent-tools.js +30 -0
- package/dist/source-control/site/bundled-provider-registry.d.ts +33 -0
- package/dist/source-control/site/bundled-provider-registry.js +37 -0
- package/dist/source-control/site/commit-schema.d.ts +40 -0
- package/dist/source-control/site/commit-schema.js +29 -0
- package/dist/source-control/site/commit-target.d.ts +26 -0
- package/dist/source-control/site/commit-target.js +58 -0
- package/dist/source-control/site/credential-form.d.ts +36 -0
- package/dist/source-control/site/credential-form.js +102 -0
- package/dist/source-control/site/credential-setup.d.ts +107 -0
- package/dist/source-control/site/credential-setup.js +216 -0
- package/dist/source-control/site/provider-kit.d.ts +37 -0
- package/dist/source-control/site/provider-kit.js +35 -0
- package/dist/source-control/site/provider-module.d.ts +251 -0
- package/dist/source-control/site/provider-module.js +2 -0
- package/dist/source-control/site/saved-key-bindings.d.ts +4 -0
- package/dist/source-control/site/saved-key-bindings.js +4 -0
- package/dist/source-control/site/static-site-packager-port.d.ts +37 -0
- package/dist/source-control/site/static-site-packager-port.js +2 -0
- package/dist/source-control/site/store.d.ts +209 -0
- package/dist/source-control/site/store.js +374 -0
- package/dist/source-control/site/store.validation.d.ts +72 -0
- package/dist/source-control/site/store.validation.js +168 -0
- package/dist/source-control/site/tool-registrations.d.ts +190 -0
- package/dist/source-control/site/tool-registrations.js +379 -0
- package/dist/static-export/site/export-preflight.d.ts +48 -0
- package/dist/static-export/site/export-preflight.js +82 -0
- package/dist/static-export/site/media-original-urls.d.ts +57 -0
- package/dist/static-export/site/media-original-urls.js +109 -0
- package/dist/static-export/site/ports.d.ts +82 -0
- package/dist/static-export/site/ports.js +29 -0
- package/dist/static-export/site/public-origin-policy.d.ts +32 -0
- package/dist/static-export/site/public-origin-policy.js +68 -0
- package/dist/static-export/site/route-manifest.d.ts +65 -0
- package/dist/static-export/site/route-manifest.js +139 -0
- package/dist/static-export/site/site-exporter.d.ts +158 -0
- package/dist/static-export/site/site-exporter.js +112 -0
- package/dist/static-export/site/static-security-headers.d.ts +39 -0
- package/dist/static-export/site/static-security-headers.js +43 -0
- package/dist/static-export/site/theme-preview-manifest.d.ts +35 -0
- package/dist/static-export/site/theme-preview-manifest.js +28 -0
- package/package.json +912 -8
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { credentialChoice } from "./admin-publish-read.js";
|
|
2
|
+
import { describeErrorForLog } from "@jini-ai/core/model-facing-tool-errors";
|
|
3
|
+
import { publishStaticSite } from "./adapter.js";
|
|
4
|
+
import { publicPublishConfigFields } from "./publish-history.js";
|
|
5
|
+
const IDLE_RUN = { status: "idle", startedAtIso: null, finishedAtIso: null, target: null };
|
|
6
|
+
/** Process-local job store — see this file's header for exactly which callers share ONE instance
|
|
7
|
+
* of it and which do not. */
|
|
8
|
+
/**
|
|
9
|
+
* Maps a settled `outcome` into the durable record this run's publish produced — `undefined` when
|
|
10
|
+
* nothing was actually published (`outcome.ok === false`; see {@link PublishHistoryEntry}'s own doc
|
|
11
|
+
* on why a failure is never recorded at all, not recorded-as-failed). `owner`/`repo`/`branch`/
|
|
12
|
+
* `commitSha` are the HOST's own facts, read off `outcome.providerMetadata` (whatever the target
|
|
13
|
+
* module reports, string values only) — never off `input.config`, and never by naming a target here.
|
|
14
|
+
* `deploymentId` is always carried through when the outcome has one.
|
|
15
|
+
*
|
|
16
|
+
* @complexity O(1) — fixed-shape field mapping, no iteration.
|
|
17
|
+
*/
|
|
18
|
+
function toHistoryEntry({ input, outcome, clock, triggeredBy }, _options = {}) {
|
|
19
|
+
if (!outcome.ok)
|
|
20
|
+
return undefined;
|
|
21
|
+
const meta = outcome.providerMetadata ?? {};
|
|
22
|
+
return {
|
|
23
|
+
target: outcome.targetId,
|
|
24
|
+
url: outcome.url,
|
|
25
|
+
reachable: outcome.ok === true,
|
|
26
|
+
status: outcome.status,
|
|
27
|
+
projectName: input.projectName,
|
|
28
|
+
publishedAt: clock.nowIso(),
|
|
29
|
+
triggeredBy,
|
|
30
|
+
...stringField(meta, "owner"),
|
|
31
|
+
...stringField(meta, "repo"),
|
|
32
|
+
...stringField(meta, "branch"),
|
|
33
|
+
...stringField(meta, "commitSha"),
|
|
34
|
+
...(outcome.basePath !== undefined ? { basePath: outcome.basePath } : {}),
|
|
35
|
+
...(outcome.deploymentId !== undefined ? { deploymentId: outcome.deploymentId } : {}),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** `{ [key]: value }` when `meta[key]` is a string, else `{}` — host metadata is untyped data. */
|
|
39
|
+
function stringField(meta, key) {
|
|
40
|
+
const value = meta[key];
|
|
41
|
+
return (typeof value === "string" ? { [key]: value } : {});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Records a settled outcome's history, if it produced one — best-effort, never throws and never
|
|
45
|
+
* changes what the caller reports. A failed history write (a DB error, a full disk) must not turn an
|
|
46
|
+
* otherwise-successful publish into a reported failure: the caller already has the TRUE outcome from
|
|
47
|
+
* {@link publishStaticSite} and returns it regardless: losing "where did we last publish" is a
|
|
48
|
+
* strictly smaller problem than a hard error on this genuinely non-essential bookkeeping step layered
|
|
49
|
+
* on top of a publish that already succeeded.
|
|
50
|
+
*
|
|
51
|
+
* @complexity One registry load, O(f*c) public-field filtering, one history insert.
|
|
52
|
+
*/
|
|
53
|
+
async function recordHistoryIfPublished({ deps, historyStore, input, outcome, clock, triggeredBy }, _options = {}) {
|
|
54
|
+
const entry = toHistoryEntry({ input, outcome, clock, triggeredBy });
|
|
55
|
+
if (entry === undefined || !outcome.ok)
|
|
56
|
+
return;
|
|
57
|
+
const credentialId = outcome.credentialId ?? input.credentialId;
|
|
58
|
+
try {
|
|
59
|
+
// Reuse the descriptor contract, never copy raw config or the resolved credential into history.
|
|
60
|
+
// A registry reload failure must not erase the pre-existing outcome-only history behavior.
|
|
61
|
+
const registry = await deps.loadDeployTargets({ workspaceId: input.workspaceId }).catch(() => {
|
|
62
|
+
// Loader errors may embed plugin config or credentials; log only the failed operation.
|
|
63
|
+
deps.warn("[static-publish] destination registry reload failed; recording outcome only");
|
|
64
|
+
return undefined;
|
|
65
|
+
});
|
|
66
|
+
const target = registry?.get(input.config.target);
|
|
67
|
+
await historyStore.recordSuccess({ workspaceId: input.workspaceId, entry: {
|
|
68
|
+
...entry,
|
|
69
|
+
...(credentialId !== undefined ? { credentialId } : {}),
|
|
70
|
+
...historyDestinationFields({ target, input, outcome }),
|
|
71
|
+
} });
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
// Keep the true publish result; database errors can embed secret parameters.
|
|
75
|
+
deps.warn("[static-publish] destination history write failed after publish", describeErrorForLog({ err: error }));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function historyDestinationFields({ target, input, outcome }) {
|
|
79
|
+
if (target === undefined)
|
|
80
|
+
return {};
|
|
81
|
+
return { configFields: publicPublishConfigFields({ descriptor: target.descriptor, config: {
|
|
82
|
+
...input.config, ...target.module.destinationConfig?.(outcome.providerMetadata === undefined ? {} : { providerMetadata: outcome.providerMetadata }),
|
|
83
|
+
} }) };
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The current/most recent publish run's status, exactly as both callers report it (the HTTP status
|
|
87
|
+
* poll route, and — indirectly, via a thrown/returned refusal — the agent tool).
|
|
88
|
+
*
|
|
89
|
+
* @returns `IDLE_RUN` if no run has ever started in this process.
|
|
90
|
+
* @complexity O(1).
|
|
91
|
+
*/
|
|
92
|
+
export function getPublishRunSnapshot(deps, _optional = {}) {
|
|
93
|
+
return deps.publishJobs.latest() ?? IDLE_RUN;
|
|
94
|
+
}
|
|
95
|
+
/** Capture one accepted/settled publish at the shared run owner. No provider payload leaves here.
|
|
96
|
+
* @complexity O(1) time and space per run. */
|
|
97
|
+
function publishEvent(required, _optional = {}) {
|
|
98
|
+
const { deps, input, operationId, outcome } = required;
|
|
99
|
+
if (!input.productEvent)
|
|
100
|
+
return;
|
|
101
|
+
void deps.tracker?.capture({ name: outcome ? "deploy_finished" : "site_publish_started", userId: input.productEvent.userId }, { properties: { operationId, eventId: `publish:${operationId}:${outcome ?? "started"}`, target: input.config.target, source: input.productEvent.source, ...(outcome ? { outcome } : {}) } });
|
|
102
|
+
}
|
|
103
|
+
/** Scoped job lookup for transport adapters; permission checks belong to the caller.
|
|
104
|
+
* No export bytes, credentials or raw provider error objects enter a snapshot.
|
|
105
|
+
* @complexity O(1) by ID; O(20) for the site's latest retained job.
|
|
106
|
+
*/
|
|
107
|
+
export function getPublishJobSnapshot({ deps, workspaceId, jobId, requestId }, _options = {}) {
|
|
108
|
+
return deps.publishJobs.get({ scopeId: workspaceId, ...(jobId !== undefined ? { jobId } : {}), ...(requestId !== undefined ? { requestId } : {}) });
|
|
109
|
+
}
|
|
110
|
+
function beginRun({ deps, input, clock, jobId }, _options = {}) {
|
|
111
|
+
deps.publishJobs.begin({ jobId, ...(input.requestId ? { requestId: input.requestId } : {}), scopeId: input.workspaceId, target: input.config.target, startedAtIso: clock.nowIso() });
|
|
112
|
+
}
|
|
113
|
+
function settleWithOutcome({ deps, jobId, outcome, clock }, _options = {}) {
|
|
114
|
+
if (outcome.ok)
|
|
115
|
+
deps.publishJobs.progress({ jobId, progress: { url: outcome.url,
|
|
116
|
+
...(outcome.deploymentId ? { deploymentCreated: true, deploymentId: outcome.deploymentId } : {}) } });
|
|
117
|
+
deps.publishJobs.settle({ jobId, status: outcome.ok ? "completed" : "errored", finishedAtIso: clock.nowIso(), result: outcome });
|
|
118
|
+
}
|
|
119
|
+
function settleWithError({ deps, jobId, err, clock }, _options = {}) {
|
|
120
|
+
// Unexpected exceptions can embed credentials. Provider errors use the adapter's safe outcome.
|
|
121
|
+
deps.publishJobs.settle({ jobId, status: "errored", finishedAtIso: clock.nowIso(), error: deps.redactSecretShapes({ text: err instanceof Error ? err.message : String(err) }).text });
|
|
122
|
+
}
|
|
123
|
+
/** Bind provider progress to this job, independently of the initiating tool's signal. */
|
|
124
|
+
function jobInput({ deps, input, jobId }, _options = {}) {
|
|
125
|
+
return { ...input, onProgress: ({ progress }, _options = {}) => deps.publishJobs.progress({ jobId, progress }) };
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Starts a new publish run unconditionally and returns the "running" snapshot immediately — the
|
|
129
|
+
* publish itself continues in the background. Used by `publish-site.ts`'s HTTP trigger route, which
|
|
130
|
+
* returns `202` and lets the caller poll {@link getPublishRunSnapshot} for the outcome (same
|
|
131
|
+
* fire-and-forget shape as `export-run.ts`'s `startExportRun`, which this mirrors).
|
|
132
|
+
*
|
|
133
|
+
* Caller contract: the caller must have already confirmed `getPublishRunSnapshot().status !==
|
|
134
|
+
* "running"` in the SAME synchronous stretch of the event loop, with no `await` in between. The
|
|
135
|
+
* shared Jini store also refuses a second running job, so a missed caller guard fails closed rather
|
|
136
|
+
* than starting concurrent exports. This preserves the caller contract (`startExportRun`'s own
|
|
137
|
+
* doc, restated here rather than merely cross-referenced since violating it is exactly the bug this
|
|
138
|
+
* whole file exists to close).
|
|
139
|
+
*
|
|
140
|
+
* @param required.historyStore - See this file's header ("Publish history") — REQUIRED, no module-level
|
|
141
|
+
* default; real callers pass `RouteDeps.publishHistoryStore`, tests pass an
|
|
142
|
+
* `InMemoryPublishHistoryStore`.
|
|
143
|
+
* @param optional.onSettled - Told the run's final status once it settles (the route's product event).
|
|
144
|
+
* @complexity O(1) synchronously; the awaited publish itself is bounded by `publishStaticSite`'s own
|
|
145
|
+
* complexity note (one export pass plus one provider's fixed poll budget).
|
|
146
|
+
*/
|
|
147
|
+
export function startPublishRun({ deps, input, clock, historyStore }, optional = {}) {
|
|
148
|
+
const operationId = input.idGen.newId();
|
|
149
|
+
beginRun({ deps, input, clock, jobId: operationId });
|
|
150
|
+
publishEvent({ deps, input, operationId });
|
|
151
|
+
void publishStaticSite(deps, jobInput({ deps, input, jobId: operationId }))
|
|
152
|
+
.then(async (outcome) => {
|
|
153
|
+
// Record first: callers that refresh destinations once the snapshot completes must see this run.
|
|
154
|
+
await recordHistoryIfPublished({ deps, historyStore, input, outcome, clock, triggeredBy: optional.triggeredBy ?? "admin_ui" });
|
|
155
|
+
settleWithOutcome({ deps, jobId: operationId, outcome, clock });
|
|
156
|
+
})
|
|
157
|
+
.catch((err) => settleWithError({ deps, jobId: operationId, err, clock }))
|
|
158
|
+
.finally(() => {
|
|
159
|
+
const status = deps.publishJobs.get({ scopeId: input.workspaceId, jobId: operationId })?.status === "completed" ? "completed" : "errored";
|
|
160
|
+
publishEvent({ deps, input, operationId, outcome: status });
|
|
161
|
+
optional.onSettled?.({ status });
|
|
162
|
+
});
|
|
163
|
+
return getPublishRunSnapshot(deps);
|
|
164
|
+
}
|
|
165
|
+
export function createAdminPublishStart(required, _optional = {}) {
|
|
166
|
+
return function startAdminPublish({ principal, parsed, config }, _optional = {}) {
|
|
167
|
+
// Deliberately not awaited — see this file's header for why the response returns before the
|
|
168
|
+
// publish finishes. `startPublishRun` itself keeps the shared slot in sync as the publish
|
|
169
|
+
// settles, so a poller can never observe a stale "running" snapshot after the promise has
|
|
170
|
+
// actually settled.
|
|
171
|
+
return required.start({ deps: required.deps, input: {
|
|
172
|
+
productEvent: { userId: principal.id, source: "admin" },
|
|
173
|
+
workspaceId: required.input.workspaceId,
|
|
174
|
+
publishOutputRootDir: required.input.publishOutputRootDir,
|
|
175
|
+
idGen: required.input.idGen,
|
|
176
|
+
exportSiteBound: required.input.exportSiteBound,
|
|
177
|
+
config,
|
|
178
|
+
projectName: parsed.projectName,
|
|
179
|
+
// The connection the operator actually chose in the Static Site tab. Never defaulted here:
|
|
180
|
+
// an absent id means "this caller has no chosen connection", which the credential source
|
|
181
|
+
// answers with its own default lookup — see the trigger request parser.
|
|
182
|
+
...credentialChoice({ value: parsed.credentialId }),
|
|
183
|
+
}, clock: required.clock, historyStore: required.historyStore });
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=publish-run.js.map
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { DeployTargetDescriptor } from "../deploy-targets/types.js";
|
|
2
|
+
import type { ToolFailureDiagnostic } from "@jini-ai/core/contracts/site/daemon-tool-recovery";
|
|
3
|
+
import type { UUID } from "@jini-ai/core/primitives";
|
|
4
|
+
/**
|
|
5
|
+
* @file Domain types for one-shot static-site publishing through a deploy target an Agent Plugin
|
|
6
|
+
* contributes (`../deploy-targets/`).
|
|
7
|
+
*
|
|
8
|
+
* Purpose:
|
|
9
|
+
* Deliberately separate from this directory's sibling `../types.ts`/`../ports.ts`
|
|
10
|
+
* (`DeploymentProviderPort`/`DeploymentTargetRecord`) — that machinery promotes an EXISTING git
|
|
11
|
+
* commit through a GitHub App (`@jini-ai/agent-plugins/github/deployments/github.mjs`), continuous-deployment-shaped. This
|
|
12
|
+
* feature does the opposite: it takes the host's own static export (`src/features/site-export`'s `exportSite`, bytes
|
|
13
|
+
* this process just rendered, never a pre-existing commit) and hands the file set to a devops
|
|
14
|
+
* `DeployTarget` — a one-shot "publish this exact file set" operation with no polling-run/webhook
|
|
15
|
+
* lifecycle of its own. Two genuinely different problems that happen to share the word "deploy".
|
|
16
|
+
*
|
|
17
|
+
* How it relates to the project:
|
|
18
|
+
* Target ids are OPEN strings (deploy plan T7): the set of targets, and each target's config
|
|
19
|
+
* fields, come from the deploy-target registry at runtime, which validates them at every entry point
|
|
20
|
+
* (`adapter.ts`'s `planStaticPublish`). Ids stay byte-identical to the historical provider ids:
|
|
21
|
+
* sealed credentials and publish history rows are keyed by them.
|
|
22
|
+
*
|
|
23
|
+
* Architectural role:
|
|
24
|
+
* Domain types only — no I/O.
|
|
25
|
+
*/
|
|
26
|
+
/** A deploy target id the registry knows (lowercase hyphenated). */
|
|
27
|
+
export type StaticPublishTargetId = DeployTargetDescriptor["id"];
|
|
28
|
+
/**
|
|
29
|
+
* One publish's target and its descriptor-declared config fields, all strings. `basePath` is
|
|
30
|
+
* deliberately NOT a field — the target module derives it, which is what makes "export base path
|
|
31
|
+
* doesn't match the publish target" structurally impossible rather than merely documented.
|
|
32
|
+
*/
|
|
33
|
+
export interface StaticPublishConfig {
|
|
34
|
+
readonly target: StaticPublishTargetId;
|
|
35
|
+
readonly [field: string]: string | undefined;
|
|
36
|
+
}
|
|
37
|
+
/** Every outcome this feature returns to a caller (admin route JSON, agent tool result) — never a
|
|
38
|
+
* `DeployFile`, never a token, never a raw upstream error body.
|
|
39
|
+
*
|
|
40
|
+
* THREE outcomes, not two — `ok` is `true | false | "partial"`, never merely a boolean. Spec
|
|
41
|
+
* `custom-publish-provider-contract.md` §3a names the exact failure mode this third state exists to
|
|
42
|
+
* prevent: uploading objects to a bucket does not, by itself, make them servable — a bucket is private
|
|
43
|
+
* by default on every S3-compatible provider, so "the PUT calls all succeeded" and "a human can
|
|
44
|
+
* actually load this site" are genuinely different claims. Folding "uploaded fine, but not reachable
|
|
45
|
+
* yet" into `ok: true` would be a false "Published" success pointing at a URL that 404s; folding it
|
|
46
|
+
* into `ok: false` would hide that the upload itself DID succeed (nothing needs re-uploading, only the
|
|
47
|
+
* hosting/public-access step is missing — see `deployment_generate_bucket_hosting_setup`, spec §3a).
|
|
48
|
+
* Neither existing branch is honest here, so this is a genuine third branch, not a reuse of either.
|
|
49
|
+
*
|
|
50
|
+
* `adapter.ts`'s `publishStaticSite` is the one place this is decided, from the SAME
|
|
51
|
+
* `DeployPublishResult.status` field every target (not only s3-compatible) already returns — see that
|
|
52
|
+
* function's own doc for why the check applies uniformly rather than being special-cased per target. */
|
|
53
|
+
export type StaticPublishOutcome = {
|
|
54
|
+
readonly ok: true;
|
|
55
|
+
/** Saved connection used for this run; absent for environment credentials. */
|
|
56
|
+
readonly credentialId?: UUID;
|
|
57
|
+
readonly targetId: StaticPublishTargetId;
|
|
58
|
+
readonly url: string;
|
|
59
|
+
readonly status: string;
|
|
60
|
+
readonly deploymentId?: string;
|
|
61
|
+
/** The base path this publish's export was rewritten for — e.g. `/${repo}` for a host that
|
|
62
|
+
* serves the site under a repository subpath; absent for a host serving it at the root. Echoed back so a caller can show "published at /repo" without having to
|
|
63
|
+
* re-derive the same computation this module already did. */
|
|
64
|
+
readonly basePath?: string;
|
|
65
|
+
readonly consentWarning?: string;
|
|
66
|
+
/** The host's own facts about this publish (`DeployPublishResult.providerMetadata`), e.g. the
|
|
67
|
+
* repository and commit a git-backed host wrote. Carried into publish history. */
|
|
68
|
+
readonly providerMetadata?: Readonly<Record<string, unknown>>;
|
|
69
|
+
} | {
|
|
70
|
+
/** "Uploaded, not yet reachable" — see this type's own header. Every field below has the exact
|
|
71
|
+
* same meaning as the `ok: true` branch's namesake field; only the discriminant and `message`
|
|
72
|
+
* are new, so a caller migrating from a boolean-only reading of `ok` gets a compile error
|
|
73
|
+
* (an unhandled union member) rather than a silent misclassification. */
|
|
74
|
+
readonly ok: "partial";
|
|
75
|
+
readonly credentialId?: UUID;
|
|
76
|
+
readonly targetId: StaticPublishTargetId;
|
|
77
|
+
readonly url: string;
|
|
78
|
+
readonly status: string;
|
|
79
|
+
readonly message: string;
|
|
80
|
+
readonly deploymentId?: string;
|
|
81
|
+
readonly basePath?: string;
|
|
82
|
+
readonly consentWarning?: string;
|
|
83
|
+
readonly providerMetadata?: Readonly<Record<string, unknown>>;
|
|
84
|
+
} | {
|
|
85
|
+
readonly ok: false;
|
|
86
|
+
readonly code: "INVALID_CONFIG" | "NO_CREDENTIALS_CONFIGURED" | "EXPORT_FAILED" | "PROVIDER_ERROR";
|
|
87
|
+
readonly credentialSetup?: ToolFailureDiagnostic;
|
|
88
|
+
readonly message: string;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Resolves the bearer token for one publish target, and separately answers whether one is even
|
|
92
|
+
* configured. `credentials.ts`'s `createEnvPublishCredentialSource` is the env-var implementation;
|
|
93
|
+
* `publish-credentials`'s DB-backed source (2026-08-15, ADR-058-pattern encrypted store) is the
|
|
94
|
+
* second — both implement this same interface so no caller changes when the composition between them
|
|
95
|
+
* changes.
|
|
96
|
+
*
|
|
97
|
+
* TWO separate methods, not one, on purpose (2026-08-15 split, Terra's design): {@link resolve}
|
|
98
|
+
* is the ONLY one of the two that may decrypt/expose a real credential, and must never expose usable credentials to a status display or model. Authenticated provider inspection
|
|
99
|
+
* may resolve server-side for read-only API calls; local readiness previews still use isConfigured.
|
|
100
|
+
* {@link isConfigured} answers the read-only "would a publish work" question every preview/education
|
|
101
|
+
* surface actually needs, without decrypting anything (the DB-backed source's `isConfigured` only
|
|
102
|
+
* ever calls `describeCredential`-shaped reads — never `resolveForPublish`). Before this split, the
|
|
103
|
+
* only method was `resolve()`, and the admin preview route called it just to read `.ok` off the
|
|
104
|
+
* result — harmless while the only implementation was a plain `process.env` read, but it would have
|
|
105
|
+
* meant a REAL decrypt on every preview once a DB-backed source existed.
|
|
106
|
+
*
|
|
107
|
+
* `resolve()`'s success ({@link ResolvedPublishCredentialSuccess}) is flat: `token` (the host
|
|
108
|
+
* descriptor's `credential.tokenField`, e.g. the secret half of an access-key pair) plus every other
|
|
109
|
+
* field that host's credential declares, under its own name. Core names none of them; the host's
|
|
110
|
+
* deploy module reads what it needs.
|
|
111
|
+
*/
|
|
112
|
+
export type PublishVerificationBasis = {
|
|
113
|
+
readonly id: UUID;
|
|
114
|
+
readonly revision: number;
|
|
115
|
+
} | {
|
|
116
|
+
readonly kind: "env";
|
|
117
|
+
};
|
|
118
|
+
/** {@link PublishCredentialSource.resolve}'s success: `token` plus the host's other declared credential
|
|
119
|
+
* fields. `true` is in the index type only so `ok` itself fits it; every field is a string. */
|
|
120
|
+
export type ResolvedPublishCredentialSuccess = {
|
|
121
|
+
readonly ok: true;
|
|
122
|
+
readonly token: string;
|
|
123
|
+
readonly basis: PublishVerificationBasis;
|
|
124
|
+
/** Saved row actually resolved, including default selection; absent for environment credentials. */
|
|
125
|
+
readonly credentialId?: UUID;
|
|
126
|
+
} & Readonly<Record<string, string | true | PublishVerificationBasis | undefined>>;
|
|
127
|
+
export interface PublishCredentialSource {
|
|
128
|
+
/**
|
|
129
|
+
* @param input.credentialId - OPTIONAL id of the saved connection the OPERATOR chose for this one
|
|
130
|
+
* publish (terra review 2026-09-20, finding 1 — Critical). When present, an implementation must
|
|
131
|
+
* resolve THAT connection or refuse: never the provider's current default, and never a fallback
|
|
132
|
+
* source. The silent "whichever row is `is_default` when the publish POST lands" resolution this
|
|
133
|
+
* parameter replaces is the defect itself — a publish fired while a "make this one the default"
|
|
134
|
+
* promotion was still in flight went to the PREVIOUS account. Absent means the caller genuinely
|
|
135
|
+
* has no chosen connection (the `deployment_execute_static_publish` agent tool, and any admin
|
|
136
|
+
* install whose credentials come from server env vars, which have no ids), and the established
|
|
137
|
+
* default lookup applies unchanged.
|
|
138
|
+
*
|
|
139
|
+
* UNTRUSTED input: it arrives from an HTTP body. An implementation must scope its lookup to
|
|
140
|
+
* `workspaceId` and verify the row's own provider matches `target` before resolving anything —
|
|
141
|
+
* a request naming another workspace's credential id must refuse, not publish.
|
|
142
|
+
*/
|
|
143
|
+
resolve(input: {
|
|
144
|
+
workspaceId: UUID;
|
|
145
|
+
target: StaticPublishTargetId;
|
|
146
|
+
credentialId?: UUID;
|
|
147
|
+
}): Promise<ResolvedPublishCredentialSuccess | {
|
|
148
|
+
readonly ok: false;
|
|
149
|
+
readonly reason: string;
|
|
150
|
+
}>;
|
|
151
|
+
/** Read-only, never decrypts. `reason` (when `configured` is `false`) is the same human-readable,
|
|
152
|
+
* non-secret guidance `resolve()`'s own `{ok:false}.reason` carries — safe to show in an admin UI
|
|
153
|
+
* or hand to an agent tool. */
|
|
154
|
+
isConfigured(input: {
|
|
155
|
+
workspaceId: UUID;
|
|
156
|
+
target: StaticPublishTargetId;
|
|
157
|
+
}): Promise<{
|
|
158
|
+
readonly configured: true;
|
|
159
|
+
readonly basis: PublishVerificationBasis;
|
|
160
|
+
} | {
|
|
161
|
+
readonly configured: false;
|
|
162
|
+
readonly reason: string;
|
|
163
|
+
}>;
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import type { UUID } from "@jini-ai/core/primitives";
|
|
2
|
+
import type { ObservabilityPort } from "@jini-ai/core/contracts/observability";
|
|
3
|
+
import type { SecretSealerPort } from "@jini-ai/core/contracts/vault";
|
|
4
|
+
import { DEPLOY_FETCH_TIMEOUTS } from "@jini-ai/devops/deploy/site/deploy-targets/host-kit";
|
|
5
|
+
import type { DeployTargetCredentialSpec, DeployTargetRegistry } from "@jini-ai/devops/deploy/site/deploy-targets/types";
|
|
6
|
+
import type { PluginDeployHostKit as DeployHostKit } from "@jini-ai/devops/deploy";
|
|
7
|
+
import type { DbPublishCredentialSourceDeps } from "./credentials.js";
|
|
8
|
+
type VendorCredentialSetRepoPort = DbPublishCredentialSourceDeps['repo'];
|
|
9
|
+
import { projectConnectionForPublish } from "./credentials.js";
|
|
10
|
+
import type { PublishCredentialSource, PublishVerificationBasis, StaticPublishTargetId } from "@jini-ai/devops/deploy/site/static-publish/types";
|
|
11
|
+
/**
|
|
12
|
+
* Whether a saved credential for `target` can ever produce an `accountLabel`, per the host's declared
|
|
13
|
+
* `yieldsAccountLabel`. Lets `publish-credentials/account-label-heal-scheduler.ts`'s background
|
|
14
|
+
* backfill skip a host that never can, instead of probing it on every list.
|
|
15
|
+
*
|
|
16
|
+
* @complexity O(1) — one registry lookup.
|
|
17
|
+
*/
|
|
18
|
+
export declare function canYieldAccountLabel({ registry, target }: {
|
|
19
|
+
registry: DeployTargetRegistry;
|
|
20
|
+
target: StaticPublishTargetId;
|
|
21
|
+
}, _optional?: Record<string, never>): boolean;
|
|
22
|
+
/** One cached verification outcome. Never carries the credential, its ciphertext, or any raw
|
|
23
|
+
* provider response — see this file's header. `status` is the enforced three-way boundary contract
|
|
24
|
+
* (never a boolean) — `"unreachable"` must stay distinguishable from `"invalid"` at every layer that
|
|
25
|
+
* reads this, all the way out to the agent-facing capabilities tool. */
|
|
26
|
+
export interface PublishCredentialVerificationResult {
|
|
27
|
+
readonly status: "valid" | "invalid" | "unreachable";
|
|
28
|
+
readonly message: string;
|
|
29
|
+
readonly checkedAt: string;
|
|
30
|
+
/** The verified account's public login/username (the host's own account-name field) — present only
|
|
31
|
+
* on a `"valid"` result for a provider whose success response carries one (see this file's header
|
|
32
|
+
* for exactly which, and why). Never an email, plan, or org — the ONE field this module's
|
|
33
|
+
* otherwise-total "never reads the response body" rule makes a deliberate, scoped exception for.
|
|
34
|
+
* `publish-agent-tools.ts`'s capabilities handler surfaces this so the agent can default a
|
|
35
|
+
* repository-backed publish's `owner` to it instead of guessing (2026-08-16, Defect 1). */
|
|
36
|
+
readonly accountLabel?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Read/write surface for cached verification results, keyed by `(workspaceId, target)` — the SAME
|
|
40
|
+
* granularity `PublishCredentialSource.isConfigured()` already uses, deliberately NOT by credential
|
|
41
|
+
* row id (see this feature's design doc for why: it unifies the DB-backed and env-var-fallback
|
|
42
|
+
* paths under one mechanism, since an env-sourced credential has no row to key by id but does have a
|
|
43
|
+
* `target`). `publish-agent-tools.ts`'s capabilities handler only ever calls {@link get} — never
|
|
44
|
+
* {@link set}, which only {@link verifyPublishCredential} (and its human-gated callers) may reach.
|
|
45
|
+
*/
|
|
46
|
+
export interface PublishCredentialVerificationCache {
|
|
47
|
+
get(input: {
|
|
48
|
+
workspaceId: UUID;
|
|
49
|
+
target: StaticPublishTargetId;
|
|
50
|
+
basis: PublishVerificationBasis;
|
|
51
|
+
}): PublishCredentialVerificationResult | undefined;
|
|
52
|
+
set(input: {
|
|
53
|
+
workspaceId: UUID;
|
|
54
|
+
target: StaticPublishTargetId;
|
|
55
|
+
basis: PublishVerificationBasis;
|
|
56
|
+
}, result: PublishCredentialVerificationResult): void;
|
|
57
|
+
/** Clears a cached result — called when `resolve()` reports no credential at all, so a STALE
|
|
58
|
+
* verification from a since-deleted/replaced credential can never keep reporting `ready: true`
|
|
59
|
+
* for a target that currently has nothing configured. */
|
|
60
|
+
delete(input: {
|
|
61
|
+
workspaceId: UUID;
|
|
62
|
+
target: StaticPublishTargetId;
|
|
63
|
+
}): void;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The real, in-process implementation — a plain `Map`, no TTL/expiry (see this feature's design doc
|
|
67
|
+
* for why: an auto-expiring cache would make `ready` flip back to `false` from time alone, which
|
|
68
|
+
* reads as flakiness; `checkedAt` lets a caller judge staleness itself instead). Lost on process
|
|
69
|
+
* restart — an accepted trade-off, see the same doc.
|
|
70
|
+
*
|
|
71
|
+
* @complexity O(1) per operation — a single `Map` key lookup/write.
|
|
72
|
+
* @overallScore 100
|
|
73
|
+
*/
|
|
74
|
+
export declare class InMemoryPublishCredentialVerificationCache implements PublishCredentialVerificationCache {
|
|
75
|
+
private readonly entries;
|
|
76
|
+
private static key;
|
|
77
|
+
get(input: {
|
|
78
|
+
workspaceId: UUID;
|
|
79
|
+
target: StaticPublishTargetId;
|
|
80
|
+
basis: PublishVerificationBasis;
|
|
81
|
+
}): PublishCredentialVerificationResult | undefined;
|
|
82
|
+
set(input: {
|
|
83
|
+
workspaceId: UUID;
|
|
84
|
+
target: StaticPublishTargetId;
|
|
85
|
+
basis: PublishVerificationBasis;
|
|
86
|
+
}, result: PublishCredentialVerificationResult): void;
|
|
87
|
+
delete(input: {
|
|
88
|
+
workspaceId: UUID;
|
|
89
|
+
target: StaticPublishTargetId;
|
|
90
|
+
}): void;
|
|
91
|
+
}
|
|
92
|
+
export interface VerifyPublishCredentialDeps {
|
|
93
|
+
readonly assertCredentialToken: (required: {
|
|
94
|
+
value: unknown;
|
|
95
|
+
field?: string;
|
|
96
|
+
hosted?: boolean;
|
|
97
|
+
}, optional?: Record<string, never>) => void;
|
|
98
|
+
readonly CredentialInputError: abstract new (...args: never[]) => Error;
|
|
99
|
+
readonly credentialText: (required: {
|
|
100
|
+
id: "auth" | "timeout" | "unreachable";
|
|
101
|
+
}) => string;
|
|
102
|
+
readonly createDeployHostKit: (required: {
|
|
103
|
+
fetchFn?: typeof fetch;
|
|
104
|
+
observability?: ObservabilityPort;
|
|
105
|
+
timeouts: typeof DEPLOY_FETCH_TIMEOUTS;
|
|
106
|
+
}) => DeployHostKit;
|
|
107
|
+
/** The COMPOSED source (DB-first, env-fallback) — the same one a real publish resolves against, so
|
|
108
|
+
* this verifies whichever credential would actually be used. Decrypts; see this file's header for
|
|
109
|
+
* why only THIS module and a real publish may call its `resolve()`. */
|
|
110
|
+
readonly credentialSource: PublishCredentialSource;
|
|
111
|
+
readonly cache: PublishCredentialVerificationCache;
|
|
112
|
+
readonly clock: {
|
|
113
|
+
nowIso(): string;
|
|
114
|
+
};
|
|
115
|
+
/** This workspace's deploy registry: whose module checks the credential. */
|
|
116
|
+
loadDeployTargets({ workspaceId }: {
|
|
117
|
+
workspaceId: string;
|
|
118
|
+
}, optional?: Record<string, never>): Promise<DeployTargetRegistry>;
|
|
119
|
+
/** Injected by tests; defaults to global `fetch`. Never the DB-scoped `fetchFn` itself. */
|
|
120
|
+
readonly fetchFn?: typeof fetch;
|
|
121
|
+
/** Replaces the whole kit (tests); `fetchFn` is ignored when set. */
|
|
122
|
+
readonly hostKit?: DeployHostKit;
|
|
123
|
+
/** `RouteDeps.observability`: the check's request is one outbound span. */
|
|
124
|
+
readonly observability?: ObservabilityPort;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Resolves whichever credential a real publish to `input.target` would use, has that host's module
|
|
128
|
+
* check it with one bounded, read-only authenticated request, and caches the outcome under
|
|
129
|
+
* `(workspaceId, target)` — this is what `deployment_get_static_publish_capabilities`'s
|
|
130
|
+
* `ready`/`verified` fields read. The ONE non-test caller of this module allowed to trigger it is a
|
|
131
|
+
* human action (the admin credential-CRUD route, after a save, or via an explicit "Verify" trigger)
|
|
132
|
+
* — never an agent tool.
|
|
133
|
+
*
|
|
134
|
+
* @returns The freshly-computed result (also now cached). `null` when no credential is configured at
|
|
135
|
+
* all — clears any stale cached entry and makes NO network call, matching
|
|
136
|
+
* {@link verifyPublishCredentialById}'s own "nothing to verify" contract for a missing row.
|
|
137
|
+
* Deliberately not folded into `status: "invalid"`/`"unreachable"`: neither word honestly describes
|
|
138
|
+
* "there was nothing here to check".
|
|
139
|
+
* @complexity O(1) — one `resolve()` call (one repo read plus, for a DB-backed credential, one
|
|
140
|
+
* decrypt), one registry load, plus one bounded outbound HTTP request.
|
|
141
|
+
*/
|
|
142
|
+
export declare function verifyPublishCredential(deps: VerifyPublishCredentialDeps, input: {
|
|
143
|
+
workspaceId: UUID;
|
|
144
|
+
target: StaticPublishTargetId;
|
|
145
|
+
}): Promise<PublishCredentialVerificationResult | null>;
|
|
146
|
+
export interface VerifyPublishCredentialByIdDeps {
|
|
147
|
+
readonly assertCredentialToken: (required: {
|
|
148
|
+
value: unknown;
|
|
149
|
+
field?: string;
|
|
150
|
+
hosted?: boolean;
|
|
151
|
+
}, optional?: Record<string, never>) => void;
|
|
152
|
+
readonly CredentialInputError: abstract new (...args: never[]) => Error;
|
|
153
|
+
readonly credentialText: (required: {
|
|
154
|
+
id: "auth" | "timeout" | "unreachable";
|
|
155
|
+
}) => string;
|
|
156
|
+
readonly createDeployHostKit: (required: {
|
|
157
|
+
fetchFn?: typeof fetch;
|
|
158
|
+
observability?: ObservabilityPort;
|
|
159
|
+
timeouts: typeof DEPLOY_FETCH_TIMEOUTS;
|
|
160
|
+
}) => DeployHostKit;
|
|
161
|
+
readonly resolveForPublish: DbPublishCredentialSourceDeps['resolveForPublish'];
|
|
162
|
+
/** `vendor_credential_sets`, where saved publish credentials live. */
|
|
163
|
+
readonly repo: VendorCredentialSetRepoPort;
|
|
164
|
+
readonly sealer: SecretSealerPort;
|
|
165
|
+
readonly cache: PublishCredentialVerificationCache;
|
|
166
|
+
readonly clock: {
|
|
167
|
+
nowIso(): string;
|
|
168
|
+
};
|
|
169
|
+
/** This workspace's deploy registry: which saved field is the token, and whose module checks it. */
|
|
170
|
+
loadDeployTargets({ workspaceId }: {
|
|
171
|
+
workspaceId: string;
|
|
172
|
+
}, optional?: Record<string, never>): Promise<DeployTargetRegistry>;
|
|
173
|
+
readonly fetchFn?: typeof fetch;
|
|
174
|
+
readonly hostKit?: DeployHostKit;
|
|
175
|
+
readonly observability?: ObservabilityPort;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Verifies ONE specific saved connection by id — what the admin's per-row "Verify" action and the
|
|
179
|
+
* post-save check both actually mean ("check the thing I just clicked/saved"), distinct from
|
|
180
|
+
* {@link verifyPublishCredential}'s "check whichever credential is currently active for this target"
|
|
181
|
+
* (which always resolves the group's DEFAULT — Contract v2 Correction B — regardless of which row a
|
|
182
|
+
* caller has in mind).
|
|
183
|
+
*
|
|
184
|
+
* Only updates the `(workspaceId, target)` cache — the one `deployment_get_static_publish_
|
|
185
|
+
* capabilities` reads — when `id` IS its provider's current default. A non-default row's result is
|
|
186
|
+
* still computed and returned (so the human sees an honest answer for the row they actually asked
|
|
187
|
+
* about), but never overwrites the `ready` signal for a DIFFERENT, unrelated row sharing the same
|
|
188
|
+
* provider.
|
|
189
|
+
*
|
|
190
|
+
* The decrypted connection is projected through the host's declared credential spec, the same
|
|
191
|
+
* projection a real publish uses (`credentials.ts`'s `projectConnectionForPublish`), so the check sees
|
|
192
|
+
* exactly what the module's `create` would.
|
|
193
|
+
*
|
|
194
|
+
* @returns `null` if no row exists for `(workspaceId, id)` — the caller (the admin route) is
|
|
195
|
+
* expected to have already checked existence and map this to its own 404, matching
|
|
196
|
+
* `resolveForPublish`'s own "no such row is `null`, not thrown" contract.
|
|
197
|
+
* @complexity O(1) — one decrypting read (`resolveForPublish`), one registry load, plus one bounded
|
|
198
|
+
* outbound HTTP request.
|
|
199
|
+
*/
|
|
200
|
+
export declare function verifyPublishCredentialById(deps: VerifyPublishCredentialByIdDeps, input: {
|
|
201
|
+
workspaceId: UUID;
|
|
202
|
+
id: UUID;
|
|
203
|
+
}): Promise<PublishCredentialVerificationResult | null>;
|
|
204
|
+
/** Check a human-submitted replacement through the existing host verifier before overwriting.
|
|
205
|
+
* @returns The normal safe verification result; does not write credentials or cache results.
|
|
206
|
+
* @complexity One registry load and one bounded host check.
|
|
207
|
+
* @example verifySubmittedPublishCredential({ deps, workspaceId, target, connection, spec });
|
|
208
|
+
*/
|
|
209
|
+
export declare function verifySubmittedPublishCredential({ deps, workspaceId, target, connection, spec }: {
|
|
210
|
+
deps: Pick<VerifyPublishCredentialDeps, 'loadDeployTargets' | 'clock' | 'fetchFn' | 'observability' | 'assertCredentialToken' | 'CredentialInputError' | 'credentialText' | 'createDeployHostKit'>;
|
|
211
|
+
workspaceId: string;
|
|
212
|
+
target: string;
|
|
213
|
+
connection: Parameters<typeof projectConnectionForPublish>[0];
|
|
214
|
+
spec: DeployTargetCredentialSpec;
|
|
215
|
+
}, _options?: {}): Promise<PublishCredentialVerificationResult>;
|
|
216
|
+
export {};
|
|
217
|
+
//# sourceMappingURL=verify.d.ts.map
|