@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,69 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { ToolInputError } from '@jini-ai/core';
|
|
3
|
+
import { describeErrorForLog } from '@jini-ai/core/model-facing-tool-errors';
|
|
4
|
+
import { planStaticPublish } from './adapter.js';
|
|
5
|
+
import { redactDeployTargetMessage, toDeployTargetCredential } from './credentials.js';
|
|
6
|
+
/** Provider inspection is an explicit authenticated READ, unlike the local readiness check.
|
|
7
|
+
* Reuses the exact workspace/worksFor-aware credential resolver used by execution. Secrets remain
|
|
8
|
+
* server-side; providers without inspection retain their existing non-decrypting preview behavior.
|
|
9
|
+
* @complexity One registry/credential read plus the plugin's bounded inventory reads. */
|
|
10
|
+
export async function inspectStaticPublish({ deps, input }, _options = {}) {
|
|
11
|
+
const registry = await deps.loadDeployTargets({ workspaceId: input.workspaceId });
|
|
12
|
+
const plan = planStaticPublish({ registry, config: input.config });
|
|
13
|
+
if (!plan.ok)
|
|
14
|
+
throw new ToolInputError({ message: plan.message });
|
|
15
|
+
if (!plan.target.module.preview)
|
|
16
|
+
return {};
|
|
17
|
+
// Callers without a project label (the admin Static Site card) keep the local-only preview they
|
|
18
|
+
// had before provider inspection existed; only a domain review cannot be answered without one.
|
|
19
|
+
if (!hasInspectionProject(input))
|
|
20
|
+
return {};
|
|
21
|
+
const resolved = await resolveInspectionCredential({ deps, input });
|
|
22
|
+
if (!resolved.ok)
|
|
23
|
+
throw new ToolInputError({ message: `NO_CREDENTIALS_CONFIGURED: ${resolved.reason}` });
|
|
24
|
+
const credential = toDeployTargetCredential(resolved);
|
|
25
|
+
const kit = deps.hostKit ?? deps.createDeployHostKit(deps.observability === undefined ? {} : { observability: deps.observability });
|
|
26
|
+
const forms = await previewFormDestination({ deps, input, kit });
|
|
27
|
+
try {
|
|
28
|
+
const hostInspection = await plan.target.module.preview({ credential, config: input.config, projectName: input.projectName, kit, ...forms.hostInput });
|
|
29
|
+
return inspectionResult({ inspection: forms.addFormLine({ inspection: hostInspection }), resolved, credential });
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
const message = error instanceof Error ? error.message : 'Provider inspection failed. Check the connection and preview again.';
|
|
33
|
+
throw new ToolInputError({ message: redactDeployTargetMessage({ message, credential: resolved, target: plan.target }) });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function inspectionResult({ inspection, resolved, credential }) {
|
|
37
|
+
return { inspection, ...(resolved.credentialId === undefined ? {} : { credentialId: resolved.credentialId }),
|
|
38
|
+
credentialBinding: createHash('sha256').update(JSON.stringify(credential)).digest('hex') };
|
|
39
|
+
}
|
|
40
|
+
function hasInspectionProject(input) {
|
|
41
|
+
if (input.projectName.trim())
|
|
42
|
+
return true;
|
|
43
|
+
if (!input.config.customDomain)
|
|
44
|
+
return false;
|
|
45
|
+
throw new ToolInputError({ message: 'PROJECT_NAME_REQUIRED: A custom-domain preview needs projectName. Pass the same project name to preview and execute.' });
|
|
46
|
+
}
|
|
47
|
+
/** The site's active forms for a preview: handed to the host when its deployment carries the
|
|
48
|
+
* selected co-hosted receiver, otherwise core's own form line (external, off or refused). Forms
|
|
49
|
+
* only: the receiver key is never read or created by a preview.
|
|
50
|
+
* @complexity One forms read when the port is wired, plus a registry load and setting read with forms. */
|
|
51
|
+
async function previewFormDestination({ deps, input, kit }, _options = {}) {
|
|
52
|
+
const forms = deps.formDestination
|
|
53
|
+
? await deps.formDestination.previewInput({ workspaceId: input.workspaceId, hostingTargetId: input.config.target, projectName: input.projectName, kit })
|
|
54
|
+
: {};
|
|
55
|
+
const { hosting, formSubmissions } = forms;
|
|
56
|
+
return { hostInput: hosting ? { formDestination: hosting } : {},
|
|
57
|
+
addFormLine: ({ inspection }, _options = {}) => (formSubmissions ? { ...inspection, formSubmissions } : inspection) };
|
|
58
|
+
}
|
|
59
|
+
async function resolveInspectionCredential({ deps, input }, _options = {}) {
|
|
60
|
+
try {
|
|
61
|
+
return await deps.credentialSource.resolve({ workspaceId: input.workspaceId, target: input.config.target,
|
|
62
|
+
...(input.credentialId !== undefined ? { credentialId: input.credentialId } : {}) });
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
deps.warn('[static-publish] saved connection could not be resolved for inspection', describeErrorForLog({ err: error }));
|
|
66
|
+
throw new ToolInputError({ message: 'CREDENTIAL_RESOLUTION_FAILED: The saved connection could not be opened. Reopen the secure connection form and select or repair it before previewing again.' });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=inspection.js.map
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import type { StaticDeploymentDestination, DeploymentDestination } from "@jini-ai/core/contracts/site/deployment-admin";
|
|
2
|
+
import type { UUID } from "@jini-ai/core/primitives";
|
|
3
|
+
import type { StaticPublishTargetId } from "@jini-ai/devops/deploy/site/static-publish/types";
|
|
4
|
+
import type { DeployTargetDescriptor, DeployTargetRegistry } from "@jini-ai/devops/deploy/site/deploy-targets/types";
|
|
5
|
+
/**
|
|
6
|
+
* @file Durable, append-only publish-history ledger.
|
|
7
|
+
* Publish results are records, not cache slots: keeping them in the database makes them durable,
|
|
8
|
+
* queryable and joinable without overwriting earlier publishes. publish-run.ts's in-process
|
|
9
|
+
* snapshot answers whether a publish is running; it cannot supply persistent per-target history.
|
|
10
|
+
*
|
|
11
|
+
* Purpose:
|
|
12
|
+
* {@link PublishHistoryStore} is the port — `getLast` (the single most recent row for a
|
|
13
|
+
* `(workspace, target)` pair, what `deployment_get_static_publish_capabilities` surfaces as
|
|
14
|
+
* `lastPublish`) and `list` (newest-first, workspace-scoped, optionally target-scoped — what a future
|
|
15
|
+
* history UI would page through). {@link InMemoryPublishHistoryStore} is the test double, append-only
|
|
16
|
+
* like the real table (a test asserting "the second publish did not erase the first" needs an
|
|
17
|
+
* in-memory double that can actually fail that assertion). `SqlitePublishHistoryStore`
|
|
18
|
+
* (`src/platform/db/sqlite/publish-history-repo.sqlite.ts`, this feature's real ADR-006 rule-of-two second
|
|
19
|
+
* adapter) is the production implementation — it lives under `src/platform/db/sqlite/`, not here, matching
|
|
20
|
+
* every other DB-backed port/adapter split in this codebase (`VendorCredentialSetRepoPort` in
|
|
21
|
+
* `features/vendor-credentials/`, `SqliteVendorCredentialSetRepo` there in `db/sqlite/`).
|
|
22
|
+
*
|
|
23
|
+
* Architectural role:
|
|
24
|
+
* `features/deployments/static-publish` domain logic — this file declares the port and its in-memory
|
|
25
|
+
* test double only; no Drizzle/SQL import belongs here (that is the adapter's job, one layer down).
|
|
26
|
+
* Static publishes settle through `publish-run.ts` (both its shared entry
|
|
27
|
+
* points — the admin route's fire-and-forget `startPublishRun` and the agent tool's awaited
|
|
28
|
+
* `runPublishAndAwait` — settle through the same function, so both callers record identically with no
|
|
29
|
+
* change needed at either call site). `publish-agent-tools.ts`'s capabilities handler is the one
|
|
30
|
+
* place `getLast` is read from today, surfaced per provider as `lastPublish`.
|
|
31
|
+
* Coordinator decision (2026-10-18): outbound peer execution and deploy-ops also append here;
|
|
32
|
+
* destination memory belongs to this ledger rather than separate per-flow stores.
|
|
33
|
+
*/
|
|
34
|
+
/** Which of this feature's two entry points produced a given {@link PublishHistoryEntry} — the admin
|
|
35
|
+
* UI's Static Site tab (`publish-site.ts`'s HTTP trigger route, via `startPublishRun`) or the
|
|
36
|
+
* assistant's confirmed publish tool (`publish-agent-tools.ts`'s `deployment_execute_static_publish`,
|
|
37
|
+
* via `runPublishAndAwait`). Free to compute at the source: `publish-run.ts`'s two entry functions
|
|
38
|
+
* each hardcode their own literal when calling into history recording, since which caller reached
|
|
39
|
+
* which function IS the answer — no request-scoped or caller-supplied value is needed. */
|
|
40
|
+
export type PublishTrigger = "admin_ui" | "agent_tool";
|
|
41
|
+
/** One recorded publish — a row in the append-only ledger, not a cache slot. `owner`/`repo`/`branch`/
|
|
42
|
+
* `commitSha` are present only for a git-backed target (`StaticPublishConfig`'s own per-target
|
|
43
|
+
* field split — see `types.ts`); every other target carries none of the four. `commitSha` specifically is
|
|
44
|
+
* NOT a placeholder that is always empty for every other target because it could not be obtained —
|
|
45
|
+
* it genuinely does not exist for them (their publishes are not git commits); see
|
|
46
|
+
* `publish-run.ts`'s `toHistoryEntry` for where this is derived from the target's own outcome. */
|
|
47
|
+
export interface PublishHistoryEntry {
|
|
48
|
+
/** Absent/null legacy discriminator means static. Other kinds reuse target as their owner id. */
|
|
49
|
+
readonly kind?: string;
|
|
50
|
+
readonly target: StaticPublishTargetId;
|
|
51
|
+
readonly url: string;
|
|
52
|
+
/** `false` for an accepted deploy without confirmed landing, or an "uploaded, not yet confirmed
|
|
53
|
+
* reachable" partial outcome (`StaticPublishOutcome`'s own `ok: "partial"` branch). Everything else that reaches this store
|
|
54
|
+
* at all is a full, confirmed-live success (see {@link PublishHistoryStore.recordSuccess}'s own
|
|
55
|
+
* doc: an `ok: false` outcome is never recorded, so `reachable` is never "the publish failed"). */
|
|
56
|
+
readonly reachable: boolean;
|
|
57
|
+
readonly status: string;
|
|
58
|
+
readonly projectName: string;
|
|
59
|
+
/** Saved connection actually resolved, including default selection; never its secret. */
|
|
60
|
+
readonly credentialId?: string;
|
|
61
|
+
/** Descriptor-allowlisted non-secret settings. Absent on legacy, non-replayable history. */
|
|
62
|
+
readonly configFields?: Readonly<Record<string, string>>;
|
|
63
|
+
readonly publishedAt: string;
|
|
64
|
+
readonly owner?: string;
|
|
65
|
+
readonly repo?: string;
|
|
66
|
+
readonly basePath?: string;
|
|
67
|
+
/** The provider's own opaque identifier for this publish — `StaticPublishOutcome.deploymentId`,
|
|
68
|
+
* verbatim, whatever it means for that target (a host deploy id, or, for a git-backed target, the
|
|
69
|
+
* same commit sha `commitSha` below also carries). Absent when the outcome carried none (a
|
|
70
|
+
* target with no deployment concept, e.g. an object-store upload). */
|
|
71
|
+
readonly deploymentId?: string;
|
|
72
|
+
/** Git-backed targets only — see this interface's own header. */
|
|
73
|
+
readonly commitSha?: string;
|
|
74
|
+
/** Git-backed targets only — the branch actually published to. */
|
|
75
|
+
readonly branch?: string;
|
|
76
|
+
readonly triggeredBy: PublishTrigger;
|
|
77
|
+
}
|
|
78
|
+
/** Workspace-and-target-scoped read/write for the publish-history ledger. */
|
|
79
|
+
export interface PublishHistoryStore {
|
|
80
|
+
/** Latest success or explicitly pending deploy per (kind, target, projectName), across the full workspace
|
|
81
|
+
* ledger. At most 201 rows; the read service refuses over 200 rather than hiding destinations. */
|
|
82
|
+
listDestinationHistory(input: {
|
|
83
|
+
workspaceId: UUID;
|
|
84
|
+
}, options?: Record<string, never>): Promise<PublishHistoryEntry[]>;
|
|
85
|
+
/** The single most recent recorded publish for `(workspaceId, target)`, or `null` if none has ever
|
|
86
|
+
* been recorded — what `deployment_get_static_publish_capabilities` surfaces as `lastPublish`. */
|
|
87
|
+
getLast(input: {
|
|
88
|
+
workspaceId: UUID;
|
|
89
|
+
target: StaticPublishTargetId;
|
|
90
|
+
}): Promise<PublishHistoryEntry | null>;
|
|
91
|
+
/** Every recorded publish for `workspaceId`, newest first, optionally narrowed to one `target` —
|
|
92
|
+
* what a future read-only history view would page through. `limit` defaults to
|
|
93
|
+
* `DEFAULT_PUBLISH_HISTORY_LIST_LIMIT` and is clamped to `MAX_PUBLISH_HISTORY_LIST_LIMIT`
|
|
94
|
+
* (`core/publish-history-list-limit.ts`) regardless of what a caller requests: this table is
|
|
95
|
+
* append-only and grows for the life of an install (`REVIEWED_INTEGER_ID_COLUMNS` in
|
|
96
|
+
* `db/migration/manifest.ts` reviews `publish_history.id` as `"unbounded"` for exactly this
|
|
97
|
+
* reason), so an unbounded `list` call is a real resource-exhaustion risk a workspace with years of
|
|
98
|
+
* publish history could actually trigger, not a hypothetical one. */
|
|
99
|
+
list(input: {
|
|
100
|
+
workspaceId: UUID;
|
|
101
|
+
target?: StaticPublishTargetId;
|
|
102
|
+
limit?: number;
|
|
103
|
+
}): Promise<PublishHistoryEntry[]>;
|
|
104
|
+
/** Distinct workspace-scoped saved live URLs across the full ledger (t08). At most 201:
|
|
105
|
+
* callers refuse an over-200-address set instead of silently losing older destinations. */
|
|
106
|
+
listLiveUrls(input: {
|
|
107
|
+
workspaceId: UUID;
|
|
108
|
+
}): Promise<string[]>;
|
|
109
|
+
/** Appends a new row — an append-only ledger, never a replace-in-place. Named for what it is ever
|
|
110
|
+
* called with, not what it is capable of rejecting: an `ok: false` `StaticPublishOutcome` is never
|
|
111
|
+
* passed to it at all (the caller, `publish-run.ts`'s `toHistoryEntry`, decides that, not this
|
|
112
|
+
* port), so `recordSuccess` never means "the publish failed." */
|
|
113
|
+
recordSuccess(input: {
|
|
114
|
+
workspaceId: UUID;
|
|
115
|
+
entry: PublishHistoryEntry;
|
|
116
|
+
}): Promise<void>;
|
|
117
|
+
}
|
|
118
|
+
/** Test double — append-only like the real table (a `Map<key, PublishHistoryEntry[]>`, not
|
|
119
|
+
* `Map<key, PublishHistoryEntry>`), so a test can actually assert "the second publish did not erase
|
|
120
|
+
* the first." Dies on process restart, same as any in-memory double; production always uses
|
|
121
|
+
* `SqlitePublishHistoryStore` instead (`host src/server/runtime/composition/deps.ts`), never this class. */
|
|
122
|
+
export declare class InMemoryPublishHistoryStore implements PublishHistoryStore {
|
|
123
|
+
private readonly required;
|
|
124
|
+
constructor(required: {
|
|
125
|
+
peerKind: string;
|
|
126
|
+
resolvePublishHistoryListLimit(input: {
|
|
127
|
+
requested: number | undefined;
|
|
128
|
+
}): number;
|
|
129
|
+
}, _optional?: {});
|
|
130
|
+
private readonly entriesByWorkspace;
|
|
131
|
+
/** Full-ledger selection, matching SQL's kind-scoped grouped max(id). O(n) time, O(d) space for n runs/d destinations. */
|
|
132
|
+
listDestinationHistory(input: {
|
|
133
|
+
workspaceId: UUID;
|
|
134
|
+
}, _options?: Record<string, never>): Promise<PublishHistoryEntry[]>;
|
|
135
|
+
getLast(input: {
|
|
136
|
+
workspaceId: UUID;
|
|
137
|
+
target: StaticPublishTargetId;
|
|
138
|
+
}): Promise<PublishHistoryEntry | null>;
|
|
139
|
+
list(input: {
|
|
140
|
+
workspaceId: UUID;
|
|
141
|
+
target?: StaticPublishTargetId;
|
|
142
|
+
limit?: number;
|
|
143
|
+
}): Promise<PublishHistoryEntry[]>;
|
|
144
|
+
listLiveUrls(input: {
|
|
145
|
+
workspaceId: UUID;
|
|
146
|
+
}): Promise<string[]>;
|
|
147
|
+
recordSuccess(input: {
|
|
148
|
+
workspaceId: UUID;
|
|
149
|
+
entry: PublishHistoryEntry;
|
|
150
|
+
}): Promise<void>;
|
|
151
|
+
}
|
|
152
|
+
/** Public replay contract; credentialId identifies a connection and never carries its secret. */
|
|
153
|
+
export type StaticPublishDestination = StaticDeploymentDestination;
|
|
154
|
+
/** Only declared public config may enter history or a response. Credential fields are excluded even
|
|
155
|
+
* if a descriptor accidentally also declares them as config. O(f*c) for f config/c credential fields.
|
|
156
|
+
* @example publicPublishConfigFields({ descriptor, config: input.config }) */
|
|
157
|
+
export declare function publicPublishConfigFields(input: {
|
|
158
|
+
descriptor: DeployTargetDescriptor;
|
|
159
|
+
config: Readonly<Record<string, unknown>>;
|
|
160
|
+
}, _options?: Record<string, never>): Record<string, string>;
|
|
161
|
+
/** Read saved destinations without resolving credentials. Store failures propagate to the HTTP
|
|
162
|
+
* boundary. Newest publish time first, independently of ledger insertion order.
|
|
163
|
+
* One bounded ledger read, O(d*f*c + d log d) time, O(d*f) response space; d <= 200.
|
|
164
|
+
* @example listStaticPublishDestinations({ workspaceId, historyStore, registry }) */
|
|
165
|
+
export declare function listStaticPublishDestinations(input: {
|
|
166
|
+
workspaceId: UUID;
|
|
167
|
+
historyStore: PublishHistoryStore;
|
|
168
|
+
registry: DeployTargetRegistry;
|
|
169
|
+
}, _options?: Record<string, never>): Promise<StaticPublishDestination[]>;
|
|
170
|
+
export type PublishDestination = DeploymentDestination<{
|
|
171
|
+
readonly id: string;
|
|
172
|
+
readonly kind: "peer" | `${string}-peer`;
|
|
173
|
+
readonly peerId: string;
|
|
174
|
+
readonly label: string;
|
|
175
|
+
readonly url: string;
|
|
176
|
+
readonly lastPublishedAt: string;
|
|
177
|
+
}>;
|
|
178
|
+
/** One bounded ledger read, no credential resolution. Only caller-authorized saved peer summaries
|
|
179
|
+
* may enter this projection; deleted peers never become destinations from stale history.
|
|
180
|
+
* @returns Latest successful destinations and explicitly pending deploys, newest first; throws on the 200-destination cap.
|
|
181
|
+
* @complexity O(d*p + d*f*c + d log d), d <= 200, p saved peers; no per-row I/O.
|
|
182
|
+
* @example listPublishDestinations({ workspaceId, historyStore, registry, peers, peerKind })
|
|
183
|
+
*/
|
|
184
|
+
export declare function listPublishDestinations(input: {
|
|
185
|
+
workspaceId: UUID;
|
|
186
|
+
historyStore: PublishHistoryStore;
|
|
187
|
+
registry: DeployTargetRegistry;
|
|
188
|
+
peers: readonly {
|
|
189
|
+
id: string;
|
|
190
|
+
label: string;
|
|
191
|
+
baseUrl: string;
|
|
192
|
+
}[];
|
|
193
|
+
peerKind: Extract<PublishDestination, {
|
|
194
|
+
peerId: string;
|
|
195
|
+
}>["kind"];
|
|
196
|
+
}, _options?: Record<string, never>): Promise<PublishDestination[]>;
|
|
197
|
+
//# sourceMappingURL=publish-history.d.ts.map
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/** Test double — append-only like the real table (a `Map<key, PublishHistoryEntry[]>`, not
|
|
2
|
+
* `Map<key, PublishHistoryEntry>`), so a test can actually assert "the second publish did not erase
|
|
3
|
+
* the first." Dies on process restart, same as any in-memory double; production always uses
|
|
4
|
+
* `SqlitePublishHistoryStore` instead (`host src/server/runtime/composition/deps.ts`), never this class. */
|
|
5
|
+
export class InMemoryPublishHistoryStore {
|
|
6
|
+
required;
|
|
7
|
+
constructor(required, _optional = {}) {
|
|
8
|
+
this.required = required;
|
|
9
|
+
}
|
|
10
|
+
entriesByWorkspace = new Map();
|
|
11
|
+
/** Full-ledger selection, matching SQL's kind-scoped grouped max(id). O(n) time, O(d) space for n runs/d destinations. */
|
|
12
|
+
async listDestinationHistory(input, _options = {}) {
|
|
13
|
+
const latest = new Map();
|
|
14
|
+
const rows = this.entriesByWorkspace.get(input.workspaceId) ?? [];
|
|
15
|
+
for (let i = rows.length - 1; i >= 0; i -= 1) {
|
|
16
|
+
const row = rows[i];
|
|
17
|
+
if (row === undefined)
|
|
18
|
+
throw new Error("Publish history has no row at its recorded position");
|
|
19
|
+
const key = JSON.stringify([row.kind ?? "static", row.target, row.projectName]);
|
|
20
|
+
if (isReplayableDestination({ row, peerKind: this.required.peerKind }) && !latest.has(key))
|
|
21
|
+
latest.set(key, row);
|
|
22
|
+
if (latest.size > 200)
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
return [...latest.values()];
|
|
26
|
+
}
|
|
27
|
+
async getLast(input) {
|
|
28
|
+
const rows = this.entriesByWorkspace.get(input.workspaceId) ?? [];
|
|
29
|
+
for (let i = rows.length - 1; i >= 0; i -= 1) {
|
|
30
|
+
const row = rows[i];
|
|
31
|
+
if (row === undefined)
|
|
32
|
+
throw new Error("Publish history has no row at its recorded position");
|
|
33
|
+
if ((row.kind ?? "static") === "static" && row.target === input.target)
|
|
34
|
+
return row;
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
async list(input) {
|
|
39
|
+
const limit = this.required.resolvePublishHistoryListLimit({ requested: input.limit });
|
|
40
|
+
const rows = this.entriesByWorkspace.get(input.workspaceId) ?? [];
|
|
41
|
+
const matching = input.target === undefined ? rows : rows.filter((row) => row.target === input.target);
|
|
42
|
+
// Newest-first: entries are appended oldest-to-newest, so reverse before slicing to `limit`.
|
|
43
|
+
return matching.slice().reverse().slice(0, limit);
|
|
44
|
+
}
|
|
45
|
+
async listLiveUrls(input) {
|
|
46
|
+
const urls = new Set();
|
|
47
|
+
for (const entry of this.entriesByWorkspace.get(input.workspaceId) ?? []) {
|
|
48
|
+
urls.add(entry.url);
|
|
49
|
+
if (urls.size > 200)
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
return [...urls].sort();
|
|
53
|
+
}
|
|
54
|
+
async recordSuccess(input) {
|
|
55
|
+
const rows = this.entriesByWorkspace.get(input.workspaceId) ?? [];
|
|
56
|
+
rows.push(input.entry);
|
|
57
|
+
this.entriesByWorkspace.set(input.workspaceId, rows);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/** Only declared public config may enter history or a response. Credential fields are excluded even
|
|
61
|
+
* if a descriptor accidentally also declares them as config. O(f*c) for f config/c credential fields.
|
|
62
|
+
* @example publicPublishConfigFields({ descriptor, config: input.config }) */
|
|
63
|
+
export function publicPublishConfigFields(input, _options = {}) {
|
|
64
|
+
const credential = input.descriptor.credential;
|
|
65
|
+
return Object.fromEntries(input.descriptor.configFields
|
|
66
|
+
.filter(field => {
|
|
67
|
+
if (field.secret || ["target", "credentialId", "projectName"].includes(field.name))
|
|
68
|
+
return false;
|
|
69
|
+
if (field.name === credential?.tokenField || credential?.fields.some(candidate => candidate.name === field.name))
|
|
70
|
+
return false;
|
|
71
|
+
return typeof input.config[field.name] === "string";
|
|
72
|
+
})
|
|
73
|
+
.map(field => [field.name, input.config[field.name]]));
|
|
74
|
+
}
|
|
75
|
+
/** Read saved destinations without resolving credentials. Store failures propagate to the HTTP
|
|
76
|
+
* boundary. Newest publish time first, independently of ledger insertion order.
|
|
77
|
+
* One bounded ledger read, O(d*f*c + d log d) time, O(d*f) response space; d <= 200.
|
|
78
|
+
* @example listStaticPublishDestinations({ workspaceId, historyStore, registry }) */
|
|
79
|
+
export async function listStaticPublishDestinations(input, _options = {}) {
|
|
80
|
+
const rows = await input.historyStore.listDestinationHistory({ workspaceId: input.workspaceId });
|
|
81
|
+
if (rows.length > 200)
|
|
82
|
+
throw new Error("publish destination limit exceeded (200)");
|
|
83
|
+
return staticDestinations({ rows, registry: input.registry });
|
|
84
|
+
}
|
|
85
|
+
/** Descriptor-owned public static projection, shared by the static compatibility API and mixed list. */
|
|
86
|
+
function staticDestinations(input) {
|
|
87
|
+
return input.rows.flatMap(row => {
|
|
88
|
+
const target = input.registry.get(row.target);
|
|
89
|
+
if ((row.kind ?? "static") !== "static" || !row.reachable)
|
|
90
|
+
return [];
|
|
91
|
+
if (row.configFields === undefined || target === undefined)
|
|
92
|
+
return [];
|
|
93
|
+
return [{
|
|
94
|
+
id: `static:${encodeURIComponent(row.target)}:${encodeURIComponent(row.projectName)}`,
|
|
95
|
+
kind: "static",
|
|
96
|
+
lastPublishedAt: row.publishedAt,
|
|
97
|
+
label: `${target.descriptor.label}: ${row.projectName}`,
|
|
98
|
+
url: row.url,
|
|
99
|
+
target: row.target,
|
|
100
|
+
projectName: row.projectName,
|
|
101
|
+
...(row.credentialId !== undefined ? { credentialId: row.credentialId } : {}),
|
|
102
|
+
configFields: publicPublishConfigFields({ descriptor: target.descriptor, config: row.configFields }),
|
|
103
|
+
}];
|
|
104
|
+
}).sort((a, b) => Date.parse(b.lastPublishedAt) - Date.parse(a.lastPublishedAt));
|
|
105
|
+
}
|
|
106
|
+
/** One bounded ledger read, no credential resolution. Only caller-authorized saved peer summaries
|
|
107
|
+
* may enter this projection; deleted peers never become destinations from stale history.
|
|
108
|
+
* @returns Latest successful destinations and explicitly pending deploys, newest first; throws on the 200-destination cap.
|
|
109
|
+
* @complexity O(d*p + d*f*c + d log d), d <= 200, p saved peers; no per-row I/O.
|
|
110
|
+
* @example listPublishDestinations({ workspaceId, historyStore, registry, peers, peerKind })
|
|
111
|
+
*/
|
|
112
|
+
export async function listPublishDestinations(input, _options = {}) {
|
|
113
|
+
const rows = await input.historyStore.listDestinationHistory({ workspaceId: input.workspaceId });
|
|
114
|
+
if (rows.length > 200)
|
|
115
|
+
throw new Error("publish destination limit exceeded (200)");
|
|
116
|
+
const destinations = staticDestinations({ rows, registry: input.registry });
|
|
117
|
+
const peers = new Map(input.peers.map(peer => [peer.id, peer]));
|
|
118
|
+
destinations.push(...rows.flatMap((row) => {
|
|
119
|
+
if (!isConfirmedOrPending({ row }))
|
|
120
|
+
return [];
|
|
121
|
+
if (row.kind === input.peerKind) {
|
|
122
|
+
const peer = peers.get(row.target);
|
|
123
|
+
return peer ? [{ id: `${input.peerKind}:${peer.id}`, kind: input.peerKind, peerId: peer.id,
|
|
124
|
+
label: peer.label, url: peer.baseUrl, lastPublishedAt: row.publishedAt }] : [];
|
|
125
|
+
}
|
|
126
|
+
if (row.kind === "deploy" && row.url !== "") {
|
|
127
|
+
return [deployDestination({ row, peers: input.peers })];
|
|
128
|
+
}
|
|
129
|
+
return [];
|
|
130
|
+
}));
|
|
131
|
+
return destinations.sort((a, b) => Date.parse(b.lastPublishedAt) - Date.parse(a.lastPublishedAt));
|
|
132
|
+
}
|
|
133
|
+
/** Replay needs public static config or a peer/deploy identity, in addition to an eligible outcome. */
|
|
134
|
+
function isReplayableDestination({ row, peerKind }, _options = {}) {
|
|
135
|
+
return isConfirmedOrPending({ row }) && (row.kind === peerKind || row.kind === "deploy" || row.configFields !== undefined);
|
|
136
|
+
}
|
|
137
|
+
/** Ledger eligibility is shared by selection and projection: only deploys can be pending. */
|
|
138
|
+
function isConfirmedOrPending({ row }, _options = {}) {
|
|
139
|
+
return row.reachable || (row.kind === "deploy" && row.status === "started");
|
|
140
|
+
}
|
|
141
|
+
/** A deploy's public status and optional link to a saved peer, without credential resolution. */
|
|
142
|
+
function deployDestination({ row, peers }, _options = {}) {
|
|
143
|
+
const pendingDeploy = row.status === "started";
|
|
144
|
+
// Normalized addresses match root URLs with or without a trailing slash, never by hostname alone.
|
|
145
|
+
const peer = peers.find(candidate => candidate.baseUrl.replace(/(?<!\/)\/+$/, "") === row.url.replace(/(?<!\/)\/+$/, ""));
|
|
146
|
+
return { id: `deploy:${encodeURIComponent(row.target)}:${encodeURIComponent(row.projectName)}`,
|
|
147
|
+
kind: "deploy", target: row.target, label: row.projectName, url: row.url,
|
|
148
|
+
// Acceptance alone never claims a live site, including rows written before this guard.
|
|
149
|
+
status: pendingDeploy ? "started" : "confirmed",
|
|
150
|
+
...(pendingDeploy ? { statusMessage: "Deploy started, not confirmed" } : {}),
|
|
151
|
+
lastPublishedAt: row.publishedAt, ...(peer ? { linkedPeerId: peer.id } : {}) };
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=publish-history.js.map
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import type { PublishJobSnapshot, DeployPublishProgress } from "@jini-ai/devops/deploy";
|
|
2
|
+
import { type StaticPublishDeps, type StaticPublishInput } from "./adapter.js";
|
|
3
|
+
import type { PublishHistoryStore, PublishTrigger } from "./publish-history.js";
|
|
4
|
+
import type { StaticPublishOutcome, StaticPublishTargetId } from "@jini-ai/devops/deploy/site/static-publish/types";
|
|
5
|
+
/**
|
|
6
|
+
* @file This sub-feature's process-local single-flight state for a real publish, extracted out of
|
|
7
|
+
* `server/routes/admin/system/publish-site.ts` (2026-08-16, Terra audit finding #1) so a SECOND
|
|
8
|
+
* caller — `deployment_execute_static_publish` (`publish-agent-tools.ts`, the assistant's
|
|
9
|
+
* MCP-UI-confirmed publish tool) — can share the exact same guard the admin route's own trigger
|
|
10
|
+
* already enforced, instead of calling {@link publishStaticSite} directly with no tracking at all.
|
|
11
|
+
*
|
|
12
|
+
* Before this file existed, `publish-site.ts` held its own PRIVATE `currentRun` module variable and
|
|
13
|
+
* checked it before every trigger; `publish-agent-tools.ts` had no equivalent slot to check at all
|
|
14
|
+
* (not merely a bug in its own guard — there was structurally nothing for it to check, since the
|
|
15
|
+
* state lived un-exported in a `src/server/**` file this domain must never import from — see this
|
|
16
|
+
* module's placement note below). Two publishes to the same or even different targets both run a
|
|
17
|
+
* fresh `clean` export into a shared per-target output directory (`adapter.ts`'s `publishOutputDir`);
|
|
18
|
+
* a human clicking "Publish" in the admin UI at the same moment an agent's confirmed
|
|
19
|
+
* `deployment_execute_static_publish` call reached its own `publishStaticSite` invocation could
|
|
20
|
+
* clean and rewrite the same directory out from under each other. This became reachable the day
|
|
21
|
+
* `deployment_execute_static_publish` went from unwired to a real, agent-callable tool.
|
|
22
|
+
*
|
|
23
|
+
* Lives in `static-publish/`, not this domain's sibling `features/deployments/export-run.ts` — a
|
|
24
|
+
* DIFFERENT sub-feature (this file's own imports are `static-publish/adapter.ts`'s `publishStaticSite`
|
|
25
|
+
* only, never the host's site-export module), but the SAME reasoning `export-run.ts`'s header gives for its own
|
|
26
|
+
* placement applies here too: `host src/server/inbound/admin-http/routes/system/publish-site.ts` (a `src/server/**` file)
|
|
27
|
+
* is free to import FROM this domain, but `publish-agent-tools.ts`'s own `tool-registrations.ts`-style
|
|
28
|
+
* rule (see `deployments/tool-registrations.ts`'s file header) forbids the reverse — a domain's
|
|
29
|
+
* tool-wiring file must never import from `src/server/**`. Putting the shared slot here, not there,
|
|
30
|
+
* is what lets both callers import ONE real module without either one crossing that back-edge.
|
|
31
|
+
*
|
|
32
|
+
* DISCLOSED CROSS-PROCESS GAP, same shape `export-run.ts`'s own header already discloses for its own
|
|
33
|
+
* `currentRun`: this module's publish-job store is process-local, single-flight-correct only
|
|
34
|
+
* WITHIN one OS process. the host's admin HTTP server and the standalone agent daemon
|
|
35
|
+
* (`assistant/agent-daemon-server.ts`) each load their own independent copy of this module — there is
|
|
36
|
+
* no cross-process lock, and this file does not attempt to add one (that is a design change, e.g. a
|
|
37
|
+
* lockfile under the publish output directory or routing the daemon's call back over HTTP to the main
|
|
38
|
+
* process — out of scope for this fix, which closes the WITHIN-process gap only). The in-process BYOK
|
|
39
|
+
* execution mode (`host src/server/runtime/composition/modules/assistant-byok.ts`, composing the same tool catalog inside the main
|
|
40
|
+
* server process) shares this exact module instance with the admin HTTP route, so single-flight holds
|
|
41
|
+
* there — which is the concrete scenario this fix closes (a human using the admin UI's Static Site tab
|
|
42
|
+
* and the assistant dock in the SAME running server, at the same time).
|
|
43
|
+
*
|
|
44
|
+
* ## Publish history (2026-08-16, Defect 2; reworked same day into an append-only DB table)
|
|
45
|
+
*
|
|
46
|
+
* The SAME reason this module exists in the first place — one shared slot both `publish-site.ts`'s
|
|
47
|
+
* HTTP trigger route and `deployment_execute_static_publish` settle through — is why publish HISTORY
|
|
48
|
+
* is also recorded here rather than in either caller: recording it once, at the one place both routes
|
|
49
|
+
* already converge, means neither call site needs to change to gain it. `settleWithOutcome`/
|
|
50
|
+
* `settleWithError` above are this module's PRE-EXISTING job (the single-flight snapshot); recording
|
|
51
|
+
* history is a separate, additional side effect performed alongside them, not folded into them, so a
|
|
52
|
+
* reader auditing "what does settling a run do to the shared snapshot" is not also reading unrelated
|
|
53
|
+
* persistence code. See `./publish-history.ts`'s own header for the storage design (an append-only
|
|
54
|
+
* `publish_history` table, `src/platform/db/schema.sqlite.ts`; migration `0043`).
|
|
55
|
+
*
|
|
56
|
+
* `historyStore` is a REQUIRED parameter on {@link startPublishRun} — deliberately no module-level default the way this file's original
|
|
57
|
+
* (file-backed) design had one. A DB-backed store needs a live `ContentDb` handle to construct, and
|
|
58
|
+
* only the composition root (`host src/server/runtime/composition/deps.ts`/`host src/server/runtime/composition/app.ts`) has one; a module-level singleton
|
|
59
|
+
* constructed at import time cannot get one without either module-load-time I/O (this module's own
|
|
60
|
+
* prior header explicitly avoided that) or a global mutable setter (a worse shape than just requiring
|
|
61
|
+
* the argument). Both real callers thread it from `RouteDeps.publishHistoryStore` — `publish-site.ts`
|
|
62
|
+
* passes `deps.publishHistoryStore` straight through; `publish-agent-tools.ts`'s
|
|
63
|
+
* `StaticPublishToolDeps` does the same, with its own `historyStore` field staying a TEST-ONLY
|
|
64
|
+
* override on top (see that file's own doc). Every test in `publish-run.unit.test.ts` already passes
|
|
65
|
+
* an explicit `InMemoryPublishHistoryStore`, so this change needed no test-signature updates.
|
|
66
|
+
*
|
|
67
|
+
* `toHistoryEntry` below also decides `triggeredBy` (`'admin_ui'` vs `'agent_tool'`) — not a
|
|
68
|
+
* caller-supplied field, but a trigger bound by each caller of {@link startPublishRun}
|
|
69
|
+
* when it calls {@link recordHistoryIfPublished}, since which function ran IS the answer
|
|
70
|
+
* (see `publish-history.ts`'s own `PublishTrigger` doc).
|
|
71
|
+
*/
|
|
72
|
+
export type PublishRunStatus = "idle" | "running" | "completed" | "errored";
|
|
73
|
+
export interface PublishRunSnapshot {
|
|
74
|
+
readonly jobId?: string;
|
|
75
|
+
readonly requestId?: string;
|
|
76
|
+
readonly progress?: DeployPublishProgress;
|
|
77
|
+
status: PublishRunStatus;
|
|
78
|
+
startedAtIso: string | null;
|
|
79
|
+
finishedAtIso: string | null;
|
|
80
|
+
target: StaticPublishTargetId | null;
|
|
81
|
+
/** Present only once `status` is `"completed"` or `"errored"` AND the run reached a real outcome
|
|
82
|
+
* (an unexpected throw out of `publishStaticSite` populates `error` instead). */
|
|
83
|
+
result?: StaticPublishOutcome;
|
|
84
|
+
/** Populated only when the run settled via an unexpected throw rather than a normal
|
|
85
|
+
* `StaticPublishOutcome` — a message, never the raw error object, same boundary
|
|
86
|
+
* `export-run.ts`'s own `error` field crosses. */
|
|
87
|
+
error?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The current/most recent publish run's status, exactly as both callers report it (the HTTP status
|
|
91
|
+
* poll route, and — indirectly, via a thrown/returned refusal — the agent tool).
|
|
92
|
+
*
|
|
93
|
+
* @returns `IDLE_RUN` if no run has ever started in this process.
|
|
94
|
+
* @complexity O(1).
|
|
95
|
+
*/
|
|
96
|
+
export declare function getPublishRunSnapshot(deps: Pick<StaticPublishDeps, "publishJobs">, _optional?: {}): PublishRunSnapshot;
|
|
97
|
+
/** Scoped job lookup for transport adapters; permission checks belong to the caller.
|
|
98
|
+
* No export bytes, credentials or raw provider error objects enter a snapshot.
|
|
99
|
+
* @complexity O(1) by ID; O(20) for the site's latest retained job.
|
|
100
|
+
*/
|
|
101
|
+
export declare function getPublishJobSnapshot({ deps, workspaceId, jobId, requestId }: {
|
|
102
|
+
deps: Pick<StaticPublishDeps, "publishJobs">;
|
|
103
|
+
workspaceId: string;
|
|
104
|
+
jobId?: string | undefined;
|
|
105
|
+
requestId?: string | undefined;
|
|
106
|
+
}, _options?: {}): PublishJobSnapshot<StaticPublishOutcome> | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* Starts a new publish run unconditionally and returns the "running" snapshot immediately — the
|
|
109
|
+
* publish itself continues in the background. Used by `publish-site.ts`'s HTTP trigger route, which
|
|
110
|
+
* returns `202` and lets the caller poll {@link getPublishRunSnapshot} for the outcome (same
|
|
111
|
+
* fire-and-forget shape as `export-run.ts`'s `startExportRun`, which this mirrors).
|
|
112
|
+
*
|
|
113
|
+
* Caller contract: the caller must have already confirmed `getPublishRunSnapshot().status !==
|
|
114
|
+
* "running"` in the SAME synchronous stretch of the event loop, with no `await` in between. The
|
|
115
|
+
* shared Jini store also refuses a second running job, so a missed caller guard fails closed rather
|
|
116
|
+
* than starting concurrent exports. This preserves the caller contract (`startExportRun`'s own
|
|
117
|
+
* doc, restated here rather than merely cross-referenced since violating it is exactly the bug this
|
|
118
|
+
* whole file exists to close).
|
|
119
|
+
*
|
|
120
|
+
* @param required.historyStore - See this file's header ("Publish history") — REQUIRED, no module-level
|
|
121
|
+
* default; real callers pass `RouteDeps.publishHistoryStore`, tests pass an
|
|
122
|
+
* `InMemoryPublishHistoryStore`.
|
|
123
|
+
* @param optional.onSettled - Told the run's final status once it settles (the route's product event).
|
|
124
|
+
* @complexity O(1) synchronously; the awaited publish itself is bounded by `publishStaticSite`'s own
|
|
125
|
+
* complexity note (one export pass plus one provider's fixed poll budget).
|
|
126
|
+
*/
|
|
127
|
+
export declare function startPublishRun({ deps, input, clock, historyStore }: {
|
|
128
|
+
deps: StaticPublishDeps;
|
|
129
|
+
input: StaticPublishInput;
|
|
130
|
+
clock: {
|
|
131
|
+
nowIso(): string;
|
|
132
|
+
};
|
|
133
|
+
historyStore: PublishHistoryStore;
|
|
134
|
+
}, optional?: {
|
|
135
|
+
onSettled?: (settled: {
|
|
136
|
+
status: "completed" | "errored";
|
|
137
|
+
}) => void;
|
|
138
|
+
triggeredBy?: PublishTrigger;
|
|
139
|
+
}): PublishRunSnapshot;
|
|
140
|
+
export declare function createAdminPublishStart(required: {
|
|
141
|
+
start: typeof startPublishRun;
|
|
142
|
+
deps: StaticPublishDeps;
|
|
143
|
+
input: Pick<StaticPublishInput, "workspaceId" | "publishOutputRootDir" | "idGen" | "exportSiteBound">;
|
|
144
|
+
clock: Parameters<typeof startPublishRun>[0]["clock"];
|
|
145
|
+
historyStore: PublishHistoryStore;
|
|
146
|
+
}, _optional?: {}): ({ principal, parsed, config }: {
|
|
147
|
+
principal: {
|
|
148
|
+
id: string;
|
|
149
|
+
};
|
|
150
|
+
parsed: {
|
|
151
|
+
projectName: string;
|
|
152
|
+
credentialId?: unknown;
|
|
153
|
+
};
|
|
154
|
+
config: StaticPublishInput["config"];
|
|
155
|
+
}, _optional?: {}) => PublishRunSnapshot;
|
|
156
|
+
//# sourceMappingURL=publish-run.d.ts.map
|