@jini-ai/devops 0.7.3-next.2 → 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/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 +911 -7
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { planStaticPublish, publishOutputDir, resolvePublishPlan } from './adapter-plan.js';
|
|
2
|
+
import { runExportForPublish, buildDeployFilesForPublish } from './adapter-export.js';
|
|
3
|
+
export { planStaticPublish, missingRequiredFieldMessage, unknownTargetMessage, readStaticPublishConfig, publishOutputDir } from './adapter-plan.js';
|
|
4
|
+
export { toDeployFile } from './adapter-export.js';
|
|
5
|
+
import { describeErrorForLog } from "@jini-ai/core/model-facing-tool-errors";
|
|
6
|
+
import { createHash } from "node:crypto";
|
|
7
|
+
import { DeployError } from "@jini-ai/devops/deploy";
|
|
8
|
+
import { withDeclaredHosts } from "@jini-ai/core/contracts/server/security-headers";
|
|
9
|
+
import { redactDeployTargetMessage, toDeployTargetCredential } from "./credentials.js";
|
|
10
|
+
/**
|
|
11
|
+
* @file Publishes the host's own static export through a deploy target that an Agent Plugin contributes
|
|
12
|
+
* (`deploy-targets/registry.ts`). Core names no hosting vendor: which targets exist, which config
|
|
13
|
+
* fields each takes, how each validates them, which base path each serves from, and what extra files
|
|
14
|
+
* each host needs all come from the plugin's descriptor and module (deploy plan T7).
|
|
15
|
+
*
|
|
16
|
+
* Purpose:
|
|
17
|
+
* "Wrap it, do not reimplement" — this module does no host HTTP itself. It (a) resolves the target
|
|
18
|
+
* and checks its config ({@link planStaticPublish}), (b) runs the host's real static exporter with the
|
|
19
|
+
* base path the target's module computes, (c) maps the resulting `ExportReport` into `DeployFile[]`,
|
|
20
|
+
* and (d) hands the file set, plus the live security headers as data (`responseHeaders`), to the
|
|
21
|
+
* `DeployTarget` the module builds.
|
|
22
|
+
*
|
|
23
|
+
* Base-path/target mismatch, made structurally impossible rather than merely documented:
|
|
24
|
+
* `StaticPublishConfig` has NO `basePath` field — a caller can never supply one. The target module
|
|
25
|
+
* derives it from the config, and {@link publishStaticSite} always runs a FRESH `exportSite` with
|
|
26
|
+
* that exact value immediately before publishing, so no previously-produced export (built with some
|
|
27
|
+
* other or no base path) can reach a target. The cost is a full re-export per publish, accepted
|
|
28
|
+
* deliberately: a stale base path silently 404ing every asset on a live site is strictly worse.
|
|
29
|
+
*
|
|
30
|
+
* A refused export (any route or asset failed) never reaches a target at all — this module will not
|
|
31
|
+
* publish a known-incomplete site, mirroring `cli/commands/export.ts`'s own honesty contract.
|
|
32
|
+
*
|
|
33
|
+
* Architectural role:
|
|
34
|
+
* `features/deployments/static-publish` domain logic. Depends on `deploy-targets/` for the target
|
|
35
|
+
* registry and host kit. No dependency on `../ports.ts`/`@jini-ai/agent-plugins/github/deployments/github.mjs` (the sibling
|
|
36
|
+
* continuous-deployment feature) — see `./types.ts`'s header for why these stay separate.
|
|
37
|
+
*/
|
|
38
|
+
const MAX_PROJECT_NAME_LENGTH = 200;
|
|
39
|
+
/**
|
|
40
|
+
* Resolves `input.config.target`'s credential via `deps.credentialSource.resolve()`, translating
|
|
41
|
+
* both a thrown decrypt failure and an `{ok:false}` "not configured" result into
|
|
42
|
+
* {@link publishStaticSite}'s own `{ok:false, code, message}` channel — see that function's own
|
|
43
|
+
* header doc for the full "never throws" contract this step upholds.
|
|
44
|
+
*
|
|
45
|
+
* `PublishCredentialSource.resolve()`'s own doc documents a throw as a real, DELIBERATE possibility
|
|
46
|
+
* for the DB-backed source (`publish-credentials/store.ts`'s `resolveForPublish`/
|
|
47
|
+
* `resolveDefaultForPublish`: "a decrypt failure here should surface, not degrade" — a corrupted row
|
|
48
|
+
* or a missing site key throws rather than resolving a silent `null`). `publishStaticSite`'s own
|
|
49
|
+
* contract is that IT never throws regardless — so a genuine decrypt failure still needs to
|
|
50
|
+
* "surface", just through the established `{ok:false, code, message}` channel instead of an uncaught
|
|
51
|
+
* exception, exactly like every other failure mode in that function. `err.message` only, same
|
|
52
|
+
* boundary {@link publishAndMapOutcome}'s own catch documents — a decrypt failure's message names the
|
|
53
|
+
* mechanism (bad AAD, tampered ciphertext, missing key), never the ciphertext or a derived secret
|
|
54
|
+
* itself.
|
|
55
|
+
*/
|
|
56
|
+
async function resolvePublishCredentialForSite(deps, input) {
|
|
57
|
+
let credential;
|
|
58
|
+
try {
|
|
59
|
+
credential = await deps.credentialSource.resolve({
|
|
60
|
+
workspaceId: input.workspaceId,
|
|
61
|
+
target: input.config.target,
|
|
62
|
+
// Conditional spread, never `credentialId: input.credentialId` — an absent choice must not
|
|
63
|
+
// travel as an explicit `undefined` key, which a source could read as "a choice was made".
|
|
64
|
+
...(input.credentialId !== undefined ? { credentialId: input.credentialId } : {}),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
return {
|
|
69
|
+
ok: false,
|
|
70
|
+
outcome: {
|
|
71
|
+
ok: false,
|
|
72
|
+
code: "NO_CREDENTIALS_CONFIGURED",
|
|
73
|
+
credentialSetup: deps.issueCredentialSetup({ setupToolId: "credential_save", prefill: { kind: "publish-host", target: input.config.target } }, {}),
|
|
74
|
+
message: `credential could not be resolved: ${err instanceof Error ? err.message : String(err)}`,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
if (!credential.ok) {
|
|
79
|
+
return { ok: false, outcome: { ok: false, code: "NO_CREDENTIALS_CONFIGURED", credentialSetup: deps.issueCredentialSetup({ setupToolId: "credential_save", prefill: { kind: "publish-host", target: input.config.target } }, {}), message: credential.reason } };
|
|
80
|
+
}
|
|
81
|
+
return { ok: true, credential };
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* `result.status` is EVERY target's own honest terminal state (`DeployLinkStatus`) — not merely "did
|
|
85
|
+
* the API call succeed". A status other than 'ready' means the provider accepted the publish but the
|
|
86
|
+
* site is not (yet, or ever, without a further step outside this call) reachable — spec
|
|
87
|
+
* `custom-publish-provider-contract.md` §3a's "uploaded, but not yet reachable" requirement, required
|
|
88
|
+
* regardless of provider once `StaticPublishOutcome` carries a real third branch for it (see that
|
|
89
|
+
* type's own header). Applied uniformly here rather than special-cased per target: every target
|
|
90
|
+
* already resolves its own `status` internally before returning (verified directly against
|
|
91
|
+
* a hosting target's own reachability wait inside `publish()`), so this is the one
|
|
92
|
+
* place that turns an already-honest `status` into an equally-honest `StaticPublishOutcome`.
|
|
93
|
+
*/
|
|
94
|
+
function buildPartialPublishOutcome({ targetId, result, basePath }, _options = {}) {
|
|
95
|
+
return {
|
|
96
|
+
ok: "partial",
|
|
97
|
+
targetId,
|
|
98
|
+
url: result.url,
|
|
99
|
+
status: result.status,
|
|
100
|
+
message: result.statusMessage ?? `Published to ${targetId}, but the public URL is not confirmed reachable yet (status: ${result.status}).`,
|
|
101
|
+
...(result.deploymentId !== undefined ? { deploymentId: result.deploymentId } : {}),
|
|
102
|
+
...(basePath !== undefined ? { basePath } : {}),
|
|
103
|
+
...(result.providerMetadata !== undefined ? { providerMetadata: result.providerMetadata } : {}),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/** {@link buildPartialPublishOutcome}'s sibling for `result.status === "ready"` — a full success. */
|
|
107
|
+
function buildSuccessPublishOutcome({ targetId, result, basePath }, _options = {}) {
|
|
108
|
+
return {
|
|
109
|
+
ok: true,
|
|
110
|
+
targetId,
|
|
111
|
+
url: result.url,
|
|
112
|
+
status: result.status,
|
|
113
|
+
...(result.deploymentId !== undefined ? { deploymentId: result.deploymentId } : {}),
|
|
114
|
+
...(basePath !== undefined ? { basePath } : {}),
|
|
115
|
+
...(result.providerMetadata !== undefined ? { providerMetadata: result.providerMetadata } : {}),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** Public header data and existing publish metadata share one provider call; no extra I/O. */
|
|
119
|
+
function publishOptions({ input, formDestination, readHeaders }) {
|
|
120
|
+
return { responseHeaders: readHeaders(),
|
|
121
|
+
...(input.onProgress ? { onProgress: (progress) => input.onProgress?.({ progress }) } : {}),
|
|
122
|
+
metadata: { ...input.config, ...(input.domainApproval ? { domainApproval: input.domainApproval } : {}), ...(formDestination ? { formDestination } : {}) } };
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Calls `jiniTarget.publish()` and maps its result to a {@link StaticPublishOutcome}, translating a
|
|
126
|
+
* rejected `publish()` call into {@link publishStaticSite}'s own `{ok:false, code:"PROVIDER_ERROR"}`
|
|
127
|
+
* channel.
|
|
128
|
+
*
|
|
129
|
+
* `err.message` only — never `DeployError.details` (the raw upstream response body) or the error
|
|
130
|
+
* object itself. This crosses an HTTP/tool-result boundary (the admin route's JSON response, the
|
|
131
|
+
* agent tool's result), the same "message, never the raw error" discipline `export-site.ts`'s own
|
|
132
|
+
* errored-run summary already follows. No observed host deploy target puts `credential.token`
|
|
133
|
+
* into a `DeployError` message, but this boundary still holds even if one ever did.
|
|
134
|
+
*/
|
|
135
|
+
async function publishAndMapOutcome({ jiniTarget, publishInput, input, basePath }, { formDestination, readHeaders }) {
|
|
136
|
+
try {
|
|
137
|
+
// Older plugins may not report progress. Once provider work starts, creation is unknown
|
|
138
|
+
// until that plugin reports evidence or returns a deployment ID.
|
|
139
|
+
input.onProgress?.({ progress: { phase: "uploading", deploymentCreated: "unknown" } });
|
|
140
|
+
const result = await jiniTarget.publish(publishInput, publishOptions({ input, formDestination, readHeaders }));
|
|
141
|
+
if (result.status === "failed")
|
|
142
|
+
return { ok: false, code: "PROVIDER_ERROR", message: failedPublishMessage({ targetId: input.config.target, result }) };
|
|
143
|
+
if (result.status !== "ready") {
|
|
144
|
+
return buildPartialPublishOutcome({ targetId: input.config.target, result, basePath });
|
|
145
|
+
}
|
|
146
|
+
return buildSuccessPublishOutcome({ targetId: input.config.target, result, basePath });
|
|
147
|
+
}
|
|
148
|
+
catch (err) {
|
|
149
|
+
const message = err instanceof DeployError || err instanceof Error ? err.message : String(err);
|
|
150
|
+
return { ok: false, code: "PROVIDER_ERROR", message };
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/** The provider's own failure text, else a plain fallback naming the target and deployment. */
|
|
154
|
+
function failedPublishMessage({ targetId, result }, _options = {}) {
|
|
155
|
+
return result.statusMessage ?? `Publishing to ${targetId} failed. Check the provider dashboard before publishing again. Deployment ID: ${result.deploymentId ?? "unknown"}.`;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Publishes the host's current site content to `input.config.target`. Always runs a fresh, `clean`
|
|
159
|
+
* export with the target-correct base path immediately before publishing (see this file's header)
|
|
160
|
+
* — never reuses a previously-produced export directory.
|
|
161
|
+
*
|
|
162
|
+
* Never throws: every failure (an unknown target or bad config, a registry that will not load, a
|
|
163
|
+
* credential that does not resolve — including a genuine DECRYPT failure, see
|
|
164
|
+
* {@link resolvePublishCredentialForSite} — a failed export, a credential unusable for the target, or
|
|
165
|
+
* a rejected `publish()` call) is returned as `{ok: false, code, message}`. `message` is always built
|
|
166
|
+
* from `err.message`, never a raw `DeployError.details`/response-body object. Every caller
|
|
167
|
+
* (`publish-site.ts`'s HTTP route, `deployment_execute_static_publish`) relies on this.
|
|
168
|
+
*
|
|
169
|
+
* Orchestrates its work as a flat sequence of steps, each translating its own failure mode into this
|
|
170
|
+
* function's `{ok:false, code, message}` channel and returning early: {@link resolvePublishPlan},
|
|
171
|
+
* {@link resolvePublishCredentialForSite}, {@link runExportForPublish}, {@link constructTargetForPublish},
|
|
172
|
+
* then {@link publishAndMapOutcome} for the terminal result.
|
|
173
|
+
*
|
|
174
|
+
* @complexity One registry load, one `exportSite` pass (O(routes + assets) HTTP requests against the
|
|
175
|
+
* in-process app) plus one `DeployTarget.publish()` call (bounded by that target's own poll budget).
|
|
176
|
+
*/
|
|
177
|
+
export async function publishStaticSite(deps, input) {
|
|
178
|
+
// Publish/deploy chokepoint: one `site.publish` operation per run (target id only; the outcome
|
|
179
|
+
// is `published` or the failure code), with its export and host egress as child spans.
|
|
180
|
+
const tracker = deps.tracker ?? deps.createNoopTracker({});
|
|
181
|
+
return tracker.trace({ name: "site.publish", run: async (span) => {
|
|
182
|
+
const outcome = await publishStaticSiteSteps(deps, input);
|
|
183
|
+
span.setOutcome(outcome.ok ? { outcome: "published", failed: false } : { outcome: outcome.code, failed: true });
|
|
184
|
+
return outcome;
|
|
185
|
+
} }, { attributes: { "publish.target": input.config.target } });
|
|
186
|
+
}
|
|
187
|
+
/** {@link publishStaticSite}'s steps, inside its operation. */
|
|
188
|
+
async function publishStaticSiteSteps(deps, input) {
|
|
189
|
+
if (input.projectName.trim() === "" || input.projectName.length > MAX_PROJECT_NAME_LENGTH) {
|
|
190
|
+
return { ok: false, code: "INVALID_CONFIG", message: `projectName must be 1-${MAX_PROJECT_NAME_LENGTH} characters` };
|
|
191
|
+
}
|
|
192
|
+
const plan = await resolvePublishPlan(deps, input);
|
|
193
|
+
if (!plan.ok)
|
|
194
|
+
return { ok: false, code: "INVALID_CONFIG", message: plan.message };
|
|
195
|
+
const credentialResult = await resolvePublishCredentialForSite(deps, input);
|
|
196
|
+
if (!credentialResult.ok) {
|
|
197
|
+
return credentialResult.outcome;
|
|
198
|
+
}
|
|
199
|
+
if (credentialChangedSinceReview({ input, credential: credentialResult.credential })) {
|
|
200
|
+
return { ok: false, code: "INVALID_CONFIG", message: "CREDENTIAL_CHANGED: The connection changed after domain review. Preview and confirm again before publishing." };
|
|
201
|
+
}
|
|
202
|
+
const resolvedCredential = toDeployTargetCredential(credentialResult.credential);
|
|
203
|
+
const targetResult = constructTargetForPublish({ deps, pluginTarget: plan.target, config: input.config, credential: resolvedCredential });
|
|
204
|
+
if (!targetResult.ok) {
|
|
205
|
+
return targetResult.outcome;
|
|
206
|
+
}
|
|
207
|
+
const outputDir = publishOutputDir({ parent: input.publishOutputRootDir, target: input.config.target, runId: input.idGen.newId() });
|
|
208
|
+
const exportResult = await runExportForPublish({ deps, input, outputDir, basePath: plan.basePath, target: targetResult.target });
|
|
209
|
+
if (!exportResult.ok)
|
|
210
|
+
return finishPublishOutcome({ outcome: exportResult.outcome, credential: credentialResult.credential, target: plan.target });
|
|
211
|
+
const files = buildDeployFilesForPublish(exportResult.report);
|
|
212
|
+
const forms = await prepareFormDestination({ deps, input });
|
|
213
|
+
if (!forms.ok)
|
|
214
|
+
return forms.outcome;
|
|
215
|
+
const publishInput = { files: filesForReceiver({ deps, files, submitUrl: forms.submitUrl }), projectName: input.projectName };
|
|
216
|
+
const hosts = await readPluginExportHosts({ deps });
|
|
217
|
+
const baseHeaders = deps.publicPageSecurityHeaders ?? deps.defaultPublicPageSecurityHeaders;
|
|
218
|
+
const outcome = await publishAndMapOutcome({ jiniTarget: targetResult.target, publishInput, input, basePath: plan.basePath }, { formDestination: forms.hosting, readHeaders: () => hosts ? withDeclaredHosts({ headers: baseHeaders(), hosts }) : baseHeaders() });
|
|
219
|
+
await saveReceiverKey({ deps, outcome, save: forms.save });
|
|
220
|
+
const reported = publishConsentWarning({ outcome, warning: exportResult.report.consentWarning });
|
|
221
|
+
return finishPublishOutcome({ outcome: reported, credential: credentialResult.credential, target: plan.target });
|
|
222
|
+
}
|
|
223
|
+
/** A domain review binds the credential it saw; any other credential needs a fresh review. */
|
|
224
|
+
function credentialChangedSinceReview({ input, credential }, _options = {}) {
|
|
225
|
+
return Boolean(input.domainApproval) && input.domainApproval?.credentialBinding !== createHash("sha256").update(JSON.stringify(toDeployTargetCredential(credential))).digest("hex");
|
|
226
|
+
}
|
|
227
|
+
/** Hosts the site's plugin exports declare, for the published security headers. */
|
|
228
|
+
async function readPluginExportHosts({ deps }, _options = {}) {
|
|
229
|
+
// Report-only data: a catalog read failure must not stop a publish.
|
|
230
|
+
return deps.pluginExportHosts?.().catch((error) => {
|
|
231
|
+
deps.warn("[static-publish] Could not read plugin export hosts", describeErrorForLog({ err: { err: error } }));
|
|
232
|
+
return undefined;
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
/** Keep a successful publication's export warning in the result without changing its status. */
|
|
236
|
+
function publishConsentWarning({ outcome, warning }) {
|
|
237
|
+
return outcome.ok !== false && warning ? { ...outcome, consentWarning: warning } : outcome;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* The site's active forms and, when there are any, its receiver key, for the receiver the site's
|
|
241
|
+
* form setting selects (`features/form-destinations/port.ts`): the co-hosted add-on for this host
|
|
242
|
+
* (`hosting`), or an external receiver's post address (`submitUrl`). No port: nothing is sent and
|
|
243
|
+
* no key is created.
|
|
244
|
+
* @complexity One forms read plus at most one key read (and an external receiver's own prepare).
|
|
245
|
+
*/
|
|
246
|
+
async function prepareFormDestination({ deps, input }, _options = {}) {
|
|
247
|
+
if (!deps.formDestination)
|
|
248
|
+
return { ok: true };
|
|
249
|
+
try {
|
|
250
|
+
const plan = await deps.formDestination.prepare({ workspaceId: input.workspaceId, hostingTargetId: input.config.target, projectName: input.projectName,
|
|
251
|
+
kit: deps.hostKit ?? deps.createDeployHostKit(deps.observability === undefined ? {} : { observability: deps.observability }) });
|
|
252
|
+
return { ok: true, ...plan };
|
|
253
|
+
}
|
|
254
|
+
catch (err) {
|
|
255
|
+
return { ok: false, outcome: { ok: false, code: "EXPORT_FAILED", message: `form submissions could not be prepared: ${err instanceof Error ? err.message : String(err)}. Check the site's forms, then publish again.` } };
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/** An external receiver: exported pages post to its address instead of the site's own path. @complexity O(HTML bytes). */
|
|
259
|
+
function filesForReceiver({ deps, files, submitUrl }, _options = {}) {
|
|
260
|
+
return submitUrl ? deps.rewriteFormActions({ files, submitUrl }) : files;
|
|
261
|
+
}
|
|
262
|
+
/** Saves the receiver key (new, or moved after a rename) once the host has it. A failed save is logged, not fatal: the
|
|
263
|
+
* next publish creates and installs a fresh key, and rows still waiting at the host stay pullable. */
|
|
264
|
+
async function saveReceiverKey({ deps, outcome, save }, _options = {}) {
|
|
265
|
+
if (!save || outcome.ok === false)
|
|
266
|
+
return;
|
|
267
|
+
try {
|
|
268
|
+
await save({ url: outcome.url });
|
|
269
|
+
}
|
|
270
|
+
catch (error) {
|
|
271
|
+
deps.warn("[static-publish] the form receiver key could not be saved; the next publish will replace it", describeErrorForLog({ err: error }));
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/** Redact declared secrets from full/partial provider failures and retain the saved credential id.
|
|
275
|
+
* @complexity O(fields + message bytes × secrets), delegated to the shared redactor. */
|
|
276
|
+
function finishPublishOutcome({ outcome, credential, target }, _options = {}) {
|
|
277
|
+
// A plugin can include its credential in an error message. Keep the useful provider explanation
|
|
278
|
+
// while removing every declared secret before this site-publish response reaches HTTP or a tool.
|
|
279
|
+
const safe = "message" in outcome
|
|
280
|
+
? { ...outcome, message: redactDeployTargetMessage({ message: outcome.message, credential, target }) } : outcome;
|
|
281
|
+
// Bind history to the row opened for this run, never a later default lookup.
|
|
282
|
+
return safe.ok && credential.credentialId !== undefined ? { ...safe, credentialId: credential.credentialId } : safe;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Adapts an installed module's target to devops' {@link DeployTarget} port. Installed
|
|
286
|
+
* content-addressed modules keep their ABI: security headers still reach the first object, and
|
|
287
|
+
* `checkReachability` takes the bare URL string, so the port's `{ url }` is unwrapped here.
|
|
288
|
+
* @param installedTarget What the plugin module's `create` returned.
|
|
289
|
+
* @returns The same target behind the devops port.
|
|
290
|
+
* @complexity O(1); each call forwards once.
|
|
291
|
+
*/
|
|
292
|
+
export function adaptInstalledTarget(installedTarget) {
|
|
293
|
+
const resolvePublicUrl = installedTarget.resolvePublicUrl?.bind(installedTarget);
|
|
294
|
+
return {
|
|
295
|
+
id: installedTarget.id,
|
|
296
|
+
...(resolvePublicUrl ? { resolvePublicUrl: (required) => resolvePublicUrl(required, {}) } : {}),
|
|
297
|
+
publish: (required, optional) => installedTarget.publish({ ...required, ...optional }),
|
|
298
|
+
checkReachability: ({ url }) => installedTarget.checkReachability(url),
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Constructs the `DeployTarget` `publishAndMapOutcome` will call `publish()` on, translating a throw
|
|
303
|
+
* (typically a credential missing a field the host requires) into {@link publishStaticSite}'s own
|
|
304
|
+
* `{ok:false, code}` channel — the message, never the raw error object, since it crosses an
|
|
305
|
+
* HTTP/tool-result boundary.
|
|
306
|
+
* @complexity O(1) plus the module's own construction.
|
|
307
|
+
*/
|
|
308
|
+
function constructTargetForPublish({ deps, pluginTarget, config, credential }, _options = {}) {
|
|
309
|
+
try {
|
|
310
|
+
if (deps.buildTarget !== undefined)
|
|
311
|
+
return { ok: true, target: deps.buildTarget(config, credential) };
|
|
312
|
+
const kit = deps.hostKit ?? deps.createDeployHostKit(deps.observability === undefined ? {} : { observability: deps.observability });
|
|
313
|
+
return { ok: true, target: adaptInstalledTarget(pluginTarget.module.create({ credential, config: config, kit })) };
|
|
314
|
+
}
|
|
315
|
+
catch {
|
|
316
|
+
// Adapter exceptions may include a credential field; the card needs only the target identifier.
|
|
317
|
+
return { ok: false, outcome: { ok: false, code: "NO_CREDENTIALS_CONFIGURED", message: `credential is not usable for ${config.target}`,
|
|
318
|
+
credentialSetup: deps.issueCredentialSetup({ setupToolId: "credential_save", prefill: { kind: "publish-host", target: config.target } }, {}) } };
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import type { StaticPublishConfig, PublishCredentialSource } from './types.js';
|
|
2
|
+
import type { DeployTargetCredentialSpec, DeployTargetRegistry, LoadedDeployTarget, DeployTargetInspection } from '../deploy-targets/types.js';
|
|
3
|
+
type AdminPublishSiteDeps = {
|
|
4
|
+
workspaceId: string;
|
|
5
|
+
loadDeployTargets: (required: {
|
|
6
|
+
workspaceId: string;
|
|
7
|
+
}) => Promise<DeployTargetRegistry>;
|
|
8
|
+
refusal: (refusal: string) => void;
|
|
9
|
+
unknownTargetMessage: (required: {
|
|
10
|
+
registry: DeployTargetRegistry;
|
|
11
|
+
targetId: string;
|
|
12
|
+
}) => string;
|
|
13
|
+
readStaticPublishConfig: (required: {
|
|
14
|
+
target: LoadedDeployTarget;
|
|
15
|
+
raw: Record<string, unknown>;
|
|
16
|
+
options: {
|
|
17
|
+
blankAsAbsent: boolean;
|
|
18
|
+
};
|
|
19
|
+
}) => {
|
|
20
|
+
ok: true;
|
|
21
|
+
config: StaticPublishConfig;
|
|
22
|
+
} | {
|
|
23
|
+
ok: false;
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
missingRequiredFieldMessage: (required: {
|
|
27
|
+
target: LoadedDeployTarget;
|
|
28
|
+
config: StaticPublishConfig;
|
|
29
|
+
}) => string | null;
|
|
30
|
+
planStaticPublish: (required: {
|
|
31
|
+
registry: DeployTargetRegistry;
|
|
32
|
+
config: StaticPublishConfig;
|
|
33
|
+
}) => {
|
|
34
|
+
ok: true;
|
|
35
|
+
basePath?: string;
|
|
36
|
+
} | {
|
|
37
|
+
ok: false;
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
40
|
+
inspectStaticPublish: (required: {
|
|
41
|
+
input: {
|
|
42
|
+
workspaceId: string;
|
|
43
|
+
config: StaticPublishConfig;
|
|
44
|
+
projectName: string;
|
|
45
|
+
credentialId?: string;
|
|
46
|
+
};
|
|
47
|
+
}) => Promise<{
|
|
48
|
+
inspection?: DeployTargetInspection;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
51
|
+
type PublishSiteContext = {
|
|
52
|
+
deps: AdminPublishSiteDeps;
|
|
53
|
+
credentialSource: PublishCredentialSource;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Resolves `targetId` in this workspace's registry and reads its descriptor-declared config fields
|
|
57
|
+
* from `raw`. Registry refusals (a module that did not load) are logged, never returned.
|
|
58
|
+
* @returns The target and config, or a refusal naming the unknown target / the non-string field.
|
|
59
|
+
* @complexity One registry load plus O(f) declared fields.
|
|
60
|
+
*/
|
|
61
|
+
export declare function readTargetConfig({ deps, targetId, raw, blankAsAbsent }: {
|
|
62
|
+
deps: AdminPublishSiteDeps;
|
|
63
|
+
targetId: string;
|
|
64
|
+
raw: Record<string, unknown>;
|
|
65
|
+
blankAsAbsent: boolean;
|
|
66
|
+
}, _optional?: {}): Promise<{
|
|
67
|
+
ok: true;
|
|
68
|
+
registry: DeployTargetRegistry;
|
|
69
|
+
target: LoadedDeployTarget;
|
|
70
|
+
config: StaticPublishConfig;
|
|
71
|
+
} | {
|
|
72
|
+
ok: false;
|
|
73
|
+
error: string;
|
|
74
|
+
}>;
|
|
75
|
+
export declare function credentialChoice({ value }: {
|
|
76
|
+
value: unknown;
|
|
77
|
+
}, _options?: {}): {
|
|
78
|
+
credentialId?: string;
|
|
79
|
+
};
|
|
80
|
+
/** The HTTP projection calls the same authenticated inspection used by the chat preview. */
|
|
81
|
+
export declare function httpPublishPreview(required: {
|
|
82
|
+
deps: AdminPublishSiteDeps;
|
|
83
|
+
credentialSource: PublishCredentialSource;
|
|
84
|
+
registry: DeployTargetRegistry;
|
|
85
|
+
config: StaticPublishConfig;
|
|
86
|
+
query: Record<string, unknown>;
|
|
87
|
+
}, _options?: {}): Promise<{
|
|
88
|
+
target: string;
|
|
89
|
+
valid: boolean;
|
|
90
|
+
validationError: string | null;
|
|
91
|
+
basePath: string | null;
|
|
92
|
+
credentialsConfigured: boolean;
|
|
93
|
+
credentialGuidance: string | null;
|
|
94
|
+
providerInspection: DeployTargetInspection | undefined;
|
|
95
|
+
}>;
|
|
96
|
+
/** The preview query's target + config, or the 400 message for whichever part is missing/invalid. */
|
|
97
|
+
export declare function readPreviewTarget({ deps, query }: {
|
|
98
|
+
deps: AdminPublishSiteDeps;
|
|
99
|
+
query: Record<string, unknown>;
|
|
100
|
+
}): Promise<{
|
|
101
|
+
ok: true;
|
|
102
|
+
read: Extract<Awaited<ReturnType<typeof readTargetConfig>>, {
|
|
103
|
+
ok: true;
|
|
104
|
+
}>;
|
|
105
|
+
} | {
|
|
106
|
+
ok: false;
|
|
107
|
+
error: string;
|
|
108
|
+
}>;
|
|
109
|
+
/**
|
|
110
|
+
* The preview read the `publish/preview` spec (`@jini-ai/cms/admin-http/routes/system/publish-site/preview`)
|
|
111
|
+
* is bound to: the same reads `deployment_preview_static_publish`'s handler performs (this file's
|
|
112
|
+
* header) — the registry's plan (config check + base path) and local credential readiness. No export
|
|
113
|
+
* runs. Authenticated provider inspection is separate from `isConfigured()` (2026-08-15 split, see
|
|
114
|
+
* `static-publish/types.ts`'s `PublishCredentialSource` header) — a preview must never resolve a real
|
|
115
|
+
* credential just to read a boolean off it. A `ToolInputError` from the inspection propagates: the spec
|
|
116
|
+
* answers it `400 PROVIDER_INSPECTION_FAILED`.
|
|
117
|
+
* @complexity One registry load plus the credential/inspection reads.
|
|
118
|
+
*/
|
|
119
|
+
export declare function publishPreviewFor({ context }: {
|
|
120
|
+
context: PublishSiteContext;
|
|
121
|
+
}, _optional?: Record<string, never>): ({ query }: {
|
|
122
|
+
query: Readonly<Record<string, unknown>>;
|
|
123
|
+
}) => Promise<{
|
|
124
|
+
ok: true;
|
|
125
|
+
value: Awaited<ReturnType<typeof httpPublishPreview>>;
|
|
126
|
+
} | {
|
|
127
|
+
ok: false;
|
|
128
|
+
error: string;
|
|
129
|
+
}>;
|
|
130
|
+
/** The registry's targets as the admin card's descriptors: ids, labels and field specs, never module paths. */
|
|
131
|
+
export declare function describePublishTargets({ registry }: {
|
|
132
|
+
registry: DeployTargetRegistry;
|
|
133
|
+
}, _optional?: {}): {
|
|
134
|
+
i18n?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
135
|
+
credential?: {
|
|
136
|
+
vendorLabel?: string;
|
|
137
|
+
help?: string;
|
|
138
|
+
userHelp?: string;
|
|
139
|
+
tokenPageUrl?: string;
|
|
140
|
+
tokenField: string;
|
|
141
|
+
fields: DeployTargetCredentialSpec["fields"];
|
|
142
|
+
};
|
|
143
|
+
projectName?: import("../../target-contracts.js").DeployTargetProjectNameCopy;
|
|
144
|
+
id: string;
|
|
145
|
+
label: string;
|
|
146
|
+
defaultForNewDestination: boolean;
|
|
147
|
+
authenticatedPreview: boolean;
|
|
148
|
+
configFields: readonly import("../../target-contracts.js").DeployTargetFieldSpec[];
|
|
149
|
+
}[];
|
|
150
|
+
/** The registry's public target descriptors for this workspace, bound into the `publish-targets` spec;
|
|
151
|
+
* registry refusals (a module that did not load) are logged, never returned. @complexity O(t). */
|
|
152
|
+
export declare function publishTargetsFor({ deps }: {
|
|
153
|
+
deps: Pick<AdminPublishSiteDeps, "workspaceId" | "loadDeployTargets" | "refusal">;
|
|
154
|
+
}, _optional?: {}): () => Promise<{
|
|
155
|
+
i18n?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
156
|
+
credential?: {
|
|
157
|
+
vendorLabel?: string;
|
|
158
|
+
help?: string;
|
|
159
|
+
userHelp?: string;
|
|
160
|
+
tokenPageUrl?: string;
|
|
161
|
+
tokenField: string;
|
|
162
|
+
fields: DeployTargetCredentialSpec["fields"];
|
|
163
|
+
};
|
|
164
|
+
projectName?: import("../../target-contracts.js").DeployTargetProjectNameCopy;
|
|
165
|
+
id: string;
|
|
166
|
+
label: string;
|
|
167
|
+
defaultForNewDestination: boolean;
|
|
168
|
+
authenticatedPreview: boolean;
|
|
169
|
+
configFields: readonly import("../../target-contracts.js").DeployTargetFieldSpec[];
|
|
170
|
+
}[]>;
|
|
171
|
+
export declare function createAdminPublishRead(required: PublishSiteContext, _optional?: {}): {
|
|
172
|
+
readTargetConfig: (input: Omit<Parameters<typeof readTargetConfig>[0], "deps">, _optional?: {}) => Promise<{
|
|
173
|
+
ok: true;
|
|
174
|
+
registry: DeployTargetRegistry;
|
|
175
|
+
target: LoadedDeployTarget;
|
|
176
|
+
config: StaticPublishConfig;
|
|
177
|
+
} | {
|
|
178
|
+
ok: false;
|
|
179
|
+
error: string;
|
|
180
|
+
}>;
|
|
181
|
+
publishPreview: ({ query }: {
|
|
182
|
+
query: Readonly<Record<string, unknown>>;
|
|
183
|
+
}) => Promise<{
|
|
184
|
+
ok: true;
|
|
185
|
+
value: Awaited<ReturnType<typeof httpPublishPreview>>;
|
|
186
|
+
} | {
|
|
187
|
+
ok: false;
|
|
188
|
+
error: string;
|
|
189
|
+
}>;
|
|
190
|
+
publishTargets: () => Promise<{
|
|
191
|
+
i18n?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
192
|
+
credential?: {
|
|
193
|
+
vendorLabel?: string;
|
|
194
|
+
help?: string;
|
|
195
|
+
userHelp?: string;
|
|
196
|
+
tokenPageUrl?: string;
|
|
197
|
+
tokenField: string;
|
|
198
|
+
fields: DeployTargetCredentialSpec["fields"];
|
|
199
|
+
};
|
|
200
|
+
projectName?: import("../../target-contracts.js").DeployTargetProjectNameCopy;
|
|
201
|
+
id: string;
|
|
202
|
+
label: string;
|
|
203
|
+
defaultForNewDestination: boolean;
|
|
204
|
+
authenticatedPreview: boolean;
|
|
205
|
+
configFields: readonly import("../../target-contracts.js").DeployTargetFieldSpec[];
|
|
206
|
+
}[]>;
|
|
207
|
+
};
|
|
208
|
+
export {};
|
|
209
|
+
//# sourceMappingURL=admin-publish-read.d.ts.map
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { ToolInputError } from '@jini-ai/core';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves `targetId` in this workspace's registry and reads its descriptor-declared config fields
|
|
4
|
+
* from `raw`. Registry refusals (a module that did not load) are logged, never returned.
|
|
5
|
+
* @returns The target and config, or a refusal naming the unknown target / the non-string field.
|
|
6
|
+
* @complexity One registry load plus O(f) declared fields.
|
|
7
|
+
*/
|
|
8
|
+
export async function readTargetConfig({ deps, targetId, raw, blankAsAbsent }, _optional = {}) {
|
|
9
|
+
const registry = await deps.loadDeployTargets({ workspaceId: deps.workspaceId });
|
|
10
|
+
for (const refusal of registry.refusals)
|
|
11
|
+
deps.refusal(refusal);
|
|
12
|
+
const target = registry.get(targetId);
|
|
13
|
+
if (target === undefined)
|
|
14
|
+
return { ok: false, error: deps.unknownTargetMessage({ registry, targetId }) };
|
|
15
|
+
const read = deps.readStaticPublishConfig({ target, raw, options: { blankAsAbsent } });
|
|
16
|
+
if (!read.ok)
|
|
17
|
+
return { ok: false, error: read.message };
|
|
18
|
+
return { ok: true, registry, target, config: read.config };
|
|
19
|
+
}
|
|
20
|
+
/** A target's saved-credential form, as the admin renders it: the vendor's display name, the field
|
|
21
|
+
* specs (secret fields flagged, never a value), the form's help and token page, and which field is
|
|
22
|
+
* the token. Never the vendor id. @complexity O(1). */
|
|
23
|
+
function publicCredentialSpec(spec) {
|
|
24
|
+
return {
|
|
25
|
+
...(spec.vendorLabel !== undefined ? { vendorLabel: spec.vendorLabel } : {}),
|
|
26
|
+
...(spec.help !== undefined ? { help: spec.help } : {}),
|
|
27
|
+
...(spec.userHelp !== undefined ? { userHelp: spec.userHelp } : {}),
|
|
28
|
+
...(spec.tokenPageUrl !== undefined ? { tokenPageUrl: spec.tokenPageUrl } : {}),
|
|
29
|
+
tokenField: spec.tokenField,
|
|
30
|
+
fields: spec.fields,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function credentialChoice({ value }, _options = {}) {
|
|
34
|
+
if (value === undefined)
|
|
35
|
+
return {};
|
|
36
|
+
if (typeof value !== "string" || !value.trim())
|
|
37
|
+
throw new ToolInputError({ message: "credentialId must be a non-empty string naming the selected connection. Reload and choose it again." });
|
|
38
|
+
return { credentialId: value };
|
|
39
|
+
}
|
|
40
|
+
/** The HTTP projection calls the same authenticated inspection used by the chat preview. */
|
|
41
|
+
export async function httpPublishPreview(required, _options = {}) {
|
|
42
|
+
const { deps, credentialSource, registry, config, query } = required;
|
|
43
|
+
const plan = deps.planStaticPublish({ registry, config });
|
|
44
|
+
// A chosen connection wins over the default one for readiness too (decision J-O25).
|
|
45
|
+
const choice = credentialChoice({ value: query.credentialId });
|
|
46
|
+
const credential = await credentialSource.isConfigured({ workspaceId: deps.workspaceId, target: config.target, ...choice });
|
|
47
|
+
const inspected = plan.ok && credential.configured ? await deps.inspectStaticPublish({
|
|
48
|
+
input: { workspaceId: deps.workspaceId, config, projectName: typeof query.projectName === "string" ? query.projectName : "", ...choice },
|
|
49
|
+
}) : {};
|
|
50
|
+
return { target: config.target, valid: plan.ok, validationError: plan.ok ? null : plan.message,
|
|
51
|
+
basePath: plan.ok ? (plan.basePath ?? null) : null, credentialsConfigured: credential.configured,
|
|
52
|
+
credentialGuidance: credential.configured ? null : credential.reason,
|
|
53
|
+
providerInspection: inspected.inspection };
|
|
54
|
+
}
|
|
55
|
+
/** The preview query's target + config, or the 400 message for whichever part is missing/invalid. */
|
|
56
|
+
export async function readPreviewTarget({ deps, query }) {
|
|
57
|
+
if (typeof query.target !== "string" || query.target.trim() === "")
|
|
58
|
+
return { ok: false, error: "'target' query param (non-empty string) is required" };
|
|
59
|
+
const read = await readTargetConfig({ deps, targetId: query.target, raw: query, blankAsAbsent: true });
|
|
60
|
+
if (!read.ok)
|
|
61
|
+
return { ok: false, error: read.error };
|
|
62
|
+
// A required field that is absent is a malformed request (400); a present-but-invalid value is
|
|
63
|
+
// an answer (200, `valid:false`) — the distinction the admin card renders.
|
|
64
|
+
const missing = deps.missingRequiredFieldMessage({ target: read.target, config: read.config });
|
|
65
|
+
return missing !== null ? { ok: false, error: missing } : { ok: true, read };
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The preview read the `publish/preview` spec (`@jini-ai/cms/admin-http/routes/system/publish-site/preview`)
|
|
69
|
+
* is bound to: the same reads `deployment_preview_static_publish`'s handler performs (this file's
|
|
70
|
+
* header) — the registry's plan (config check + base path) and local credential readiness. No export
|
|
71
|
+
* runs. Authenticated provider inspection is separate from `isConfigured()` (2026-08-15 split, see
|
|
72
|
+
* `static-publish/types.ts`'s `PublishCredentialSource` header) — a preview must never resolve a real
|
|
73
|
+
* credential just to read a boolean off it. A `ToolInputError` from the inspection propagates: the spec
|
|
74
|
+
* answers it `400 PROVIDER_INSPECTION_FAILED`.
|
|
75
|
+
* @complexity One registry load plus the credential/inspection reads.
|
|
76
|
+
*/
|
|
77
|
+
export function publishPreviewFor({ context }, _optional = {}) {
|
|
78
|
+
const { deps, credentialSource } = context;
|
|
79
|
+
return async ({ query }) => {
|
|
80
|
+
const target = await readPreviewTarget({ deps, query: { ...query } });
|
|
81
|
+
if (!target.ok)
|
|
82
|
+
return { ok: false, error: target.error };
|
|
83
|
+
return { ok: true, value: await httpPublishPreview({ deps, credentialSource, registry: target.read.registry, config: target.read.config, query: { ...query } }) };
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/** The registry's targets as the admin card's descriptors: ids, labels and field specs, never module paths. */
|
|
87
|
+
export function describePublishTargets({ registry }, _optional = {}) {
|
|
88
|
+
return registry.list().map(({ descriptor }) => ({
|
|
89
|
+
id: descriptor.id,
|
|
90
|
+
label: descriptor.label,
|
|
91
|
+
defaultForNewDestination: registry.get(descriptor.id)?.module.defaultForNewDestination === true,
|
|
92
|
+
authenticatedPreview: registry.get(descriptor.id)?.module.preview !== undefined,
|
|
93
|
+
configFields: descriptor.configFields,
|
|
94
|
+
...(descriptor.projectName !== undefined ? { projectName: descriptor.projectName } : {}),
|
|
95
|
+
...(descriptor.credential !== undefined ? { credential: publicCredentialSpec(descriptor.credential) } : {}),
|
|
96
|
+
...(descriptor.i18n !== undefined ? { i18n: descriptor.i18n } : {}),
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
/** The registry's public target descriptors for this workspace, bound into the `publish-targets` spec;
|
|
100
|
+
* registry refusals (a module that did not load) are logged, never returned. @complexity O(t). */
|
|
101
|
+
export function publishTargetsFor({ deps }, _optional = {}) {
|
|
102
|
+
return async () => {
|
|
103
|
+
const registry = await deps.loadDeployTargets({ workspaceId: deps.workspaceId });
|
|
104
|
+
for (const refusal of registry.refusals)
|
|
105
|
+
deps.refusal(refusal);
|
|
106
|
+
return describePublishTargets({ registry });
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export function createAdminPublishRead(required, _optional = {}) {
|
|
110
|
+
return {
|
|
111
|
+
readTargetConfig: (input, _optional = {}) => readTargetConfig({ ...input, deps: required.deps }),
|
|
112
|
+
publishPreview: publishPreviewFor({ context: required }),
|
|
113
|
+
publishTargets: publishTargetsFor({ deps: required.deps }),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=admin-publish-read.js.map
|