@jini-ai/devops 0.7.3-next.2 → 0.7.4
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 +7 -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 +158 -0
- package/dist/backup/site/backup-service.d.ts +336 -0
- package/dist/backup/site/backup-service.js +127 -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 +94 -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 +39 -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 +197 -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 +210 -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 +107 -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 +75 -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 +204 -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/coverage/lcov.js +1 -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 +152 -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 +130 -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 +321 -0
- package/dist/deploy/site/publish-credentials/store.js +367 -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 +118 -0
- package/dist/deploy/site/static-publish/credentials.d.ts +114 -0
- package/dist/deploy/site/static-publish/credentials.js +298 -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 +168 -0
- package/dist/deploy/site/static-publish/types.js +2 -0
- package/dist/deploy/site/static-publish/verify.d.ts +237 -0
- package/dist/deploy/site/static-publish/verify.js +284 -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/packaging/electron/update-manifest-merge.js +0 -2
- 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/asset-crawl.d.ts +30 -0
- package/dist/static-export/asset-crawl.js +71 -0
- package/dist/static-export/dynamic-asset-locations.d.ts +23 -0
- package/dist/static-export/dynamic-asset-locations.js +34 -0
- package/dist/static-export/html-url-locations.d.ts +3 -1
- package/dist/static-export/html-url-locations.js +43 -9
- package/dist/static-export/runner.js +26 -27
- 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/dist/static-export/transforms.d.ts +1 -1
- package/dist/static-export/transforms.js +3 -3
- package/package.json +911 -7
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { Tracker } from "@jini-ai/core/contracts/site/diagnostics-observability";
|
|
2
|
+
import type { ExportRunCounts, ExportRunSnapshot, ExportRunStatus } from "@jini-ai/core/contracts/site/export-run";
|
|
3
|
+
import { type Clock } from "@jini-ai/core/primitives";
|
|
4
|
+
/**
|
|
5
|
+
* @file The static-site export run's single-flight state, owned by an instance from
|
|
6
|
+
* {@link createExportRunner} so a SECOND caller — the `deployment_trigger_export`/
|
|
7
|
+
* `deployment_get_export_status` agent tools and the read-only `deployment_diagnose_static_export`
|
|
8
|
+
* (which reserves the same slot for a disposable export) — can trigger and poll the exact same run
|
|
9
|
+
* the host's admin export route already does, instead of reimplementing it against a second,
|
|
10
|
+
* independent run slot. The host creates ONE runner per process and hands that same instance to
|
|
11
|
+
* every caller; two runners never share a slot.
|
|
12
|
+
*
|
|
13
|
+
* THIS FILE NEVER IMPORTS THE EXPORT ENGINE (the real `exportSite`/`ExportReport`). An earlier host
|
|
14
|
+
* version imported the engine directly, and the engine at the time imported the host's app factory
|
|
15
|
+
* whose module body booted the whole app (including the agent tool catalog) as a side effect of
|
|
16
|
+
* merely loading it — closing a real cycle back into the still-loading tool-registration module and
|
|
17
|
+
* throwing `ReferenceError: Cannot access ... before initialization` under `node --test`. Both
|
|
18
|
+
* halves of that cycle are gone in the host now, but the injection below stays: it keeps the
|
|
19
|
+
* deployments feature from depending on the export engine's whole graph at all.
|
|
20
|
+
*
|
|
21
|
+
* The fix is dependency injection instead of an import: `startExportRun` takes the actual export
|
|
22
|
+
* engine as a parameter (typed structurally via {@link ExportEngine}, never by naming the engine's
|
|
23
|
+
* own option/report types), and the host binds the real engine exactly once in its composition
|
|
24
|
+
* root — the only place safe to import it. Every caller of `startExportRun` passes that bound
|
|
25
|
+
* engine straight through.
|
|
26
|
+
*
|
|
27
|
+
* DISCLOSED CROSS-PROCESS GAP: a runner's slot is plain in-memory state, so it is
|
|
28
|
+
* single-flight-correct only WITHIN one OS process. A host that serves its admin HTTP routes and a
|
|
29
|
+
* standalone agent daemon as separate OS processes creates one runner in each — there is no
|
|
30
|
+
* cross-process lock. A human clicking "Export" in the admin UI at the same moment an agent (running
|
|
31
|
+
* through the daemon) calls `deployment_trigger_export` could therefore both observe "not running"
|
|
32
|
+
* and both start writing into the same `outputDir` concurrently. Closing it for real needs either a
|
|
33
|
+
* cross-process lock (e.g. a lockfile under `outputDir`) or routing the daemon's trigger back over
|
|
34
|
+
* HTTP to the main process. An in-process agent surface that composes the SAME tool catalog inside
|
|
35
|
+
* the main server shares the one runner with the HTTP route, so single-flight holds there.
|
|
36
|
+
*/
|
|
37
|
+
export type { ExportRunCounts, ExportRunSnapshot, ExportRunStatus };
|
|
38
|
+
/**
|
|
39
|
+
* A structural mirror of the export engine's report — only the fields
|
|
40
|
+
* `summarizeCompletedReport` actually reads. Declared locally, never imported, per this file's
|
|
41
|
+
* header. The real report satisfies this structurally (it has every field below, with compatible
|
|
42
|
+
* types), so passing the real engine as an {@link ExportEngine} type-checks with no cast at the one
|
|
43
|
+
* place the host actually binds it.
|
|
44
|
+
*/
|
|
45
|
+
export interface ExportRunReportLike {
|
|
46
|
+
routes: {
|
|
47
|
+
succeeded: unknown[];
|
|
48
|
+
failed: {
|
|
49
|
+
path: string;
|
|
50
|
+
kind: string;
|
|
51
|
+
reason: string;
|
|
52
|
+
}[];
|
|
53
|
+
};
|
|
54
|
+
assets: {
|
|
55
|
+
succeeded: unknown[];
|
|
56
|
+
failed: {
|
|
57
|
+
url: string;
|
|
58
|
+
reason: string;
|
|
59
|
+
}[];
|
|
60
|
+
};
|
|
61
|
+
skippedManifestEntries: {
|
|
62
|
+
reason: string;
|
|
63
|
+
detail: string;
|
|
64
|
+
}[];
|
|
65
|
+
unreferencedThemeFiles: string[];
|
|
66
|
+
/** Bounded by the export engine to at most 200 entries. */
|
|
67
|
+
droppedReferences: {
|
|
68
|
+
page: string;
|
|
69
|
+
url: string;
|
|
70
|
+
attribute: string;
|
|
71
|
+
reason: "not-exported" | "needs-server";
|
|
72
|
+
}[];
|
|
73
|
+
basePath?: string;
|
|
74
|
+
basePathRewriteWarning?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The injected shape of the export engine, generic over whatever `routeDeps` type the caller
|
|
78
|
+
* carries (in every real caller, the host's full route-deps object — never spelled out by name
|
|
79
|
+
* here, see this file's header).
|
|
80
|
+
*/
|
|
81
|
+
export type ExportEngine<TRouteDeps> = (options: {
|
|
82
|
+
routeDeps: TRouteDeps;
|
|
83
|
+
outputDir: string;
|
|
84
|
+
clean?: boolean;
|
|
85
|
+
/** Present-but-`undefined` when the caller gave none: the key is always forwarded. */
|
|
86
|
+
basePath?: string | undefined;
|
|
87
|
+
}, optional?: object) => Promise<ExportRunReportLike>;
|
|
88
|
+
/** The optional half of `startExportRun`'s arguments. */
|
|
89
|
+
export interface StartExportRunOptions {
|
|
90
|
+
basePath?: string;
|
|
91
|
+
productEvent?: {
|
|
92
|
+
tracker: Tracker;
|
|
93
|
+
userId: string;
|
|
94
|
+
operationId: string;
|
|
95
|
+
source: "admin" | "assistant";
|
|
96
|
+
};
|
|
97
|
+
onSettled?: (settled: {
|
|
98
|
+
status: "completed" | "errored";
|
|
99
|
+
}) => void;
|
|
100
|
+
}
|
|
101
|
+
/** One process-local export slot and the four operations that share it. */
|
|
102
|
+
export interface ExportRunner {
|
|
103
|
+
getExportRunSnapshot(this: void): ExportRunSnapshot;
|
|
104
|
+
startExportRun<TRouteDeps extends {
|
|
105
|
+
clock: Clock;
|
|
106
|
+
exportOutputRootDir: string;
|
|
107
|
+
}>(this: void, required: {
|
|
108
|
+
routeDeps: TRouteDeps;
|
|
109
|
+
runExportSite: ExportEngine<TRouteDeps>;
|
|
110
|
+
clean: boolean;
|
|
111
|
+
}, optional?: StartExportRunOptions): ExportRunSnapshot;
|
|
112
|
+
assertExportNotRunning(this: void, _required: Record<string, never>, _optional?: Record<string, never>): void;
|
|
113
|
+
diagnoseStaticExport<TRouteDeps extends {
|
|
114
|
+
clock: Clock;
|
|
115
|
+
}>(this: void, required: {
|
|
116
|
+
routeDeps: TRouteDeps;
|
|
117
|
+
runExportSite: ExportEngine<TRouteDeps>;
|
|
118
|
+
}, _optional?: Record<string, never>): Promise<ExportRunDiagnostics>;
|
|
119
|
+
}
|
|
120
|
+
/** The "completed" fields of {@link ExportRunSnapshot}, as the diagnostic returns them. */
|
|
121
|
+
export type ExportRunDiagnostics = Pick<ExportRunSnapshot, "basePath" | "ok" | "counts" | "failedRoutes" | "failedAssets" | "skippedManifestEntries" | "unreferencedThemeFiles" | "droppedReferences" | "basePathRewriteWarning">;
|
|
122
|
+
/** Turns a failed run's caught value into the text the errored snapshot stores (host-owned wording). */
|
|
123
|
+
export type DescribeExportError = (required: {
|
|
124
|
+
error: unknown;
|
|
125
|
+
}) => string;
|
|
126
|
+
/**
|
|
127
|
+
* Creates one export slot. The host creates exactly ONE per process and shares it between its
|
|
128
|
+
* admin export route and the deployments agent tools — see this file's header for which callers
|
|
129
|
+
* share an instance and which (a separate daemon process) do not.
|
|
130
|
+
*
|
|
131
|
+
* @returns Closures over the instance's slot; safe to destructure.
|
|
132
|
+
* @complexity O(1).
|
|
133
|
+
*/
|
|
134
|
+
export declare function createExportRunner({ describeError }: {
|
|
135
|
+
describeError: DescribeExportError;
|
|
136
|
+
}, _optional?: Record<string, never>): ExportRunner;
|
|
137
|
+
//# sourceMappingURL=export-run.d.ts.map
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { mkdtemp, rm } from "node:fs/promises";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { nowIso } from "@jini-ai/core/primitives";
|
|
5
|
+
import { firstExportFailure } from "@jini-ai/devops/static-export/failure-summary";
|
|
6
|
+
/** Slims a full export report down to `ExportRunSnapshot`'s "completed" fields. */
|
|
7
|
+
function summarizeCompletedReport(report) {
|
|
8
|
+
return {
|
|
9
|
+
...(report.basePath !== undefined ? { basePath: report.basePath } : {}),
|
|
10
|
+
ok: firstExportFailure({ report }) === undefined,
|
|
11
|
+
counts: {
|
|
12
|
+
routesSucceeded: report.routes.succeeded.length,
|
|
13
|
+
routesFailed: report.routes.failed.length,
|
|
14
|
+
assetsSucceeded: report.assets.succeeded.length,
|
|
15
|
+
assetsFailed: report.assets.failed.length,
|
|
16
|
+
},
|
|
17
|
+
failedRoutes: report.routes.failed.map((f) => ({ path: f.path, kind: f.kind, reason: f.reason })),
|
|
18
|
+
failedAssets: report.assets.failed.map((f) => ({ url: f.url, reason: f.reason })),
|
|
19
|
+
skippedManifestEntries: report.skippedManifestEntries,
|
|
20
|
+
unreferencedThemeFiles: report.unreferencedThemeFiles,
|
|
21
|
+
droppedReferences: report.droppedReferences,
|
|
22
|
+
...(report.basePathRewriteWarning !== undefined ? { basePathRewriteWarning: report.basePathRewriteWarning } : {}),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function observeExportRun({ task, routeDeps, startedAtIso, outputDir, optional, describeError, read, commit }) {
|
|
26
|
+
void task
|
|
27
|
+
.then((report) => {
|
|
28
|
+
commit({
|
|
29
|
+
status: "completed",
|
|
30
|
+
startedAtIso,
|
|
31
|
+
finishedAtIso: nowIso({ clock: routeDeps.clock }),
|
|
32
|
+
outputDir,
|
|
33
|
+
...summarizeCompletedReport(report),
|
|
34
|
+
});
|
|
35
|
+
})
|
|
36
|
+
.catch((err) => {
|
|
37
|
+
commit({
|
|
38
|
+
status: "errored",
|
|
39
|
+
startedAtIso,
|
|
40
|
+
finishedAtIso: nowIso({ clock: routeDeps.clock }),
|
|
41
|
+
outputDir,
|
|
42
|
+
error: describeError({ error: err }),
|
|
43
|
+
});
|
|
44
|
+
})
|
|
45
|
+
.finally(() => {
|
|
46
|
+
const status = read().status === "completed" ? "completed" : "errored";
|
|
47
|
+
const event = optional?.productEvent;
|
|
48
|
+
void event?.tracker.capture({ name: "site_exported", userId: event.userId }, { properties: { outcome: status, operationId: event.operationId, eventId: `export:${event.operationId}`, source: event.source } });
|
|
49
|
+
optional?.onSettled?.({ status });
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Creates one export slot. The host creates exactly ONE per process and shares it between its
|
|
54
|
+
* admin export route and the deployments agent tools — see this file's header for which callers
|
|
55
|
+
* share an instance and which (a separate daemon process) do not.
|
|
56
|
+
*
|
|
57
|
+
* @returns Closures over the instance's slot; safe to destructure.
|
|
58
|
+
* @complexity O(1).
|
|
59
|
+
*/
|
|
60
|
+
export function createExportRunner({ describeError }, _optional = {}) {
|
|
61
|
+
/** The idle snapshot this runner reports before its first run. */
|
|
62
|
+
const IDLE_RUN = { status: "idle", startedAtIso: null, finishedAtIso: null, outputDir: null };
|
|
63
|
+
/** The instance's mutable slot — every operation below reads and writes this one value. */
|
|
64
|
+
let currentRun = IDLE_RUN;
|
|
65
|
+
/**
|
|
66
|
+
* The current/most recent export run's status, exactly as the HTTP status-poll route reports it.
|
|
67
|
+
*
|
|
68
|
+
* @returns `IDLE_RUN` if no run has ever started on this runner.
|
|
69
|
+
* @complexity O(1).
|
|
70
|
+
*/
|
|
71
|
+
function getExportRunSnapshot() {
|
|
72
|
+
return currentRun;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Starts a new export run unconditionally and returns the "running" snapshot immediately — the
|
|
76
|
+
* export itself continues in the background ("seconds to minutes").
|
|
77
|
+
*
|
|
78
|
+
* Caller contract: the caller must have already confirmed `getExportRunSnapshot().status !==
|
|
79
|
+
* "running"` in the SAME synchronous stretch of the event loop, with no `await` in between (both
|
|
80
|
+
* the admin export route's POST handler and the `deployment_trigger_export` handler do exactly
|
|
81
|
+
* this) — that is what makes "one export at a time" hold even under two concurrent callers in the
|
|
82
|
+
* same process. This function does not re-check, so calling it while a run is already in flight
|
|
83
|
+
* would silently start a second one; it is deliberately not the guard itself.
|
|
84
|
+
*
|
|
85
|
+
* @param required.routeDeps - The same full composition-root deps object the injected
|
|
86
|
+
* `runExportSite` needs to boot an in-process copy of the app. Opaque to this function beyond
|
|
87
|
+
* `.clock.nowMs()` and `.exportOutputRootDir` — passed straight through to `runExportSite`.
|
|
88
|
+
* `exportOutputRootDir` is resolved ONCE by the host's composition root (its env override, then
|
|
89
|
+
* the served site's export folder) — this function never reads `process.env` itself, and a test
|
|
90
|
+
* overrides the directory by setting this field on the fake `routeDeps` it constructs, not by
|
|
91
|
+
* mutating real process env vars.
|
|
92
|
+
* @param required.runExportSite - The actual export engine, injected by the caller — see this
|
|
93
|
+
* file's header for why it is never imported here directly.
|
|
94
|
+
* @param required.clean - Forwarded to `runExportSite`; wipes `outputDir` first when `true`.
|
|
95
|
+
* @param optional.basePath - Forwarded to `runExportSite`; see the engine's own `basePath` doc.
|
|
96
|
+
* @param optional.onSettled - Told the run's final status once it settles (the route's product event).
|
|
97
|
+
* @returns The new "running" snapshot (not a promise — the export's own completion is observed
|
|
98
|
+
* later via `getExportRunSnapshot`).
|
|
99
|
+
* @complexity O(1) synchronously; the awaited export itself is O(routes + assets) over HTTP, per
|
|
100
|
+
* the engine's own complexity note.
|
|
101
|
+
*/
|
|
102
|
+
function startExportRun(required, optional) {
|
|
103
|
+
const { routeDeps, runExportSite, clean } = required;
|
|
104
|
+
const outputDir = routeDeps.exportOutputRootDir;
|
|
105
|
+
const startedAtIso = nowIso({ clock: routeDeps.clock });
|
|
106
|
+
currentRun = { status: "running", startedAtIso, finishedAtIso: null, outputDir };
|
|
107
|
+
// Deliberately not awaited — the caller (an HTTP route or a tool handler) returns the "running"
|
|
108
|
+
// snapshot immediately; a later poll observes the outcome via getExportRunSnapshot(). Both
|
|
109
|
+
// branches always update currentRun, so a poller can never observe a stale "running" snapshot
|
|
110
|
+
// after the promise has actually settled.
|
|
111
|
+
observeExportRun({
|
|
112
|
+
task: runExportSite({ routeDeps, outputDir, clean, basePath: optional?.basePath }),
|
|
113
|
+
routeDeps, startedAtIso, outputDir, optional, describeError, read: getExportRunSnapshot,
|
|
114
|
+
commit: snapshot => { currentRun = snapshot; },
|
|
115
|
+
});
|
|
116
|
+
return currentRun;
|
|
117
|
+
}
|
|
118
|
+
/** Refuse a concurrent trigger or diagnostic using this runner's export state. */
|
|
119
|
+
function assertExportNotRunning(_r, _o = {}) {
|
|
120
|
+
if (currentRun.status === "running") {
|
|
121
|
+
throw Object.assign(new Error("an export is already running — call deployment_get_export_status to see its progress, this will not resolve on retry"), { code: "ALREADY_RUNNING" });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/** Run the injected engine in disposable storage and return only report diagnostics.
|
|
125
|
+
* Reserves currentRun before the first await; restores the previous status after cleanup.
|
|
126
|
+
* Engine/storage errors propagate, and the slot is released even if cleanup fails.
|
|
127
|
+
* @complexity One export pass plus removal of its temporary output files.
|
|
128
|
+
*/
|
|
129
|
+
async function diagnoseStaticExport(required, _o = {}) {
|
|
130
|
+
assertExportNotRunning({});
|
|
131
|
+
const previous = currentRun;
|
|
132
|
+
currentRun = { status: "running", startedAtIso: nowIso({ clock: required.routeDeps.clock }), finishedAtIso: null, outputDir: null };
|
|
133
|
+
let outputDir;
|
|
134
|
+
try {
|
|
135
|
+
outputDir = await mkdtemp(path.join(tmpdir(), "static-export-diagnostics-"));
|
|
136
|
+
currentRun = { ...currentRun, outputDir };
|
|
137
|
+
const report = await required.runExportSite({ routeDeps: required.routeDeps, outputDir, clean: false });
|
|
138
|
+
return summarizeCompletedReport(report);
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
try {
|
|
142
|
+
if (outputDir !== undefined)
|
|
143
|
+
await rm(outputDir, { recursive: true, force: true });
|
|
144
|
+
}
|
|
145
|
+
finally {
|
|
146
|
+
currentRun = previous;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return { getExportRunSnapshot, startExportRun, assertExportNotRunning, diagnoseStaticExport };
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=export-run.js.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { HttpClientPort } from "@jini-ai/core/primitives";
|
|
2
|
+
import type { DeploymentProviderId, DeploymentRunStatus, DeploymentTargetRecord, ReleaseRecord } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* @file The provider-neutral deployment port — the seam every first-party adapter
|
|
5
|
+
* (`@jini-ai/agent-plugins/github/deployments/github.mjs`, and later others) implements once.
|
|
6
|
+
*
|
|
7
|
+
* Purpose:
|
|
8
|
+
* Mirrors `Jini packages/commerce/src/payments/ports.ts`'s `PaymentProvider` discipline, which this codebase
|
|
9
|
+
* already uses for a structurally similar problem (many third-party providers behind one typed,
|
|
10
|
+
* never-throwing port, all outbound HTTP through the ADR-038 guarded seam): no method throws
|
|
11
|
+
* (every failure is a typed `DeploymentError`), credentials are pre-resolved and injected as a flat
|
|
12
|
+
* bundle rather than read by the adapter, and `ctx.httpClient` is the only permitted path to the
|
|
13
|
+
* network.
|
|
14
|
+
*
|
|
15
|
+
* How it relates to the project:
|
|
16
|
+
* The host's `EgressPolicy` is bound once, at `HttpClientPort` construction
|
|
17
|
+
* (the host's `createHttpClient({ transport, policy })`), not per request; there is no
|
|
18
|
+
* per-request policy field on `HttpRequest`. It also has no field that can restrict which HOST a
|
|
19
|
+
* request reaches (`devHostAllowlist` only exempts a host from the private-address check). So
|
|
20
|
+
* origin pinning for a specific provider's API is the ADAPTER's responsibility, asserted through a
|
|
21
|
+
* single chokepoint every outbound call is forced through — see `@jini-ai/agent-plugins/github/deployments/github.mjs`'s
|
|
22
|
+
* `sendPinned`, the only function in that file allowed to call `ctx.httpClient.send`.
|
|
23
|
+
*
|
|
24
|
+
* Architectural role:
|
|
25
|
+
* INTERFACES ONLY. `@jini-ai/agent-plugins/github/deployments/github.mjs` is the first (and, this pass, only) implementation.
|
|
26
|
+
* Generic over the HTTP client type (`THttpClient`, default `@jini-ai/core/primitives`' `HttpClientPort`)
|
|
27
|
+
* so a host whose guarded client keeps a different `send` call shape pins its own type at the use site;
|
|
28
|
+
* these are types only, so the seam has no runtime behaviour of its own.
|
|
29
|
+
*/
|
|
30
|
+
export type DeploymentErrorCode = "NO_CREDENTIALS_CONFIGURED" | "INVALID_TARGET_CONFIG" | "INVALID_RELEASE" | "TRANSPORT_ERROR" | "PROVIDER_ERROR" | "PROVIDER_RESPONSE_INVALID";
|
|
31
|
+
/** Mirrors `PaymentError`'s shape (`Jini packages/commerce/src/payments/ports.ts`) — typed, never thrown, plus
|
|
32
|
+
* `retryable`. */
|
|
33
|
+
export interface DeploymentError {
|
|
34
|
+
readonly code: DeploymentErrorCode;
|
|
35
|
+
readonly message: string;
|
|
36
|
+
readonly providerStatus?: number;
|
|
37
|
+
/** True = retrying the same call may succeed (a transport failure, a 5xx, a rate limit). */
|
|
38
|
+
readonly retryable: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface DeploymentProviderContext<THttpClient = HttpClientPort> {
|
|
41
|
+
/** Already resolved by core from `DeploymentProviderPort.credentialKeys`, scoped to THIS
|
|
42
|
+
* provider — same deviation `ProviderContext.credentials` documents in `Jini packages/commerce/src/payments/ports.ts`: a
|
|
43
|
+
* provider cannot read a peer provider's credentials, and "not configured" is checked once,
|
|
44
|
+
* uniformly, before any adapter code runs. */
|
|
45
|
+
readonly credentials: Readonly<Record<string, string>>;
|
|
46
|
+
/** The ADR-038 guarded seam, already constructed with this provider's `EgressPolicy`. There is no
|
|
47
|
+
* other way for an adapter to make an outbound call. */
|
|
48
|
+
readonly httpClient: THttpClient;
|
|
49
|
+
readonly now: () => number;
|
|
50
|
+
}
|
|
51
|
+
export interface StartDeploymentRunInput {
|
|
52
|
+
readonly target: DeploymentTargetRecord;
|
|
53
|
+
readonly release: ReleaseRecord;
|
|
54
|
+
}
|
|
55
|
+
export type StartDeploymentRunResult = {
|
|
56
|
+
readonly ok: true;
|
|
57
|
+
/** The provider's own identifier for the run just started. Never `null` on success. */
|
|
58
|
+
readonly providerRunRef: string;
|
|
59
|
+
readonly reconciliation: "poll" | "callback";
|
|
60
|
+
} | {
|
|
61
|
+
readonly ok: false;
|
|
62
|
+
readonly error: DeploymentError;
|
|
63
|
+
};
|
|
64
|
+
export interface PollDeploymentRunInput {
|
|
65
|
+
readonly target: DeploymentTargetRecord;
|
|
66
|
+
readonly providerRunRef: string;
|
|
67
|
+
}
|
|
68
|
+
export interface DeploymentRunStatusUpdate {
|
|
69
|
+
readonly status: DeploymentRunStatus;
|
|
70
|
+
/** The provider's own identifier for the status observation itself (distinct from
|
|
71
|
+
* `providerRunRef`, which identifies the run). `null` when the provider has not reported any
|
|
72
|
+
* status yet — GitHub returns this immediately after `startRun`, before its first webhook or a
|
|
73
|
+
* caught-up poll. */
|
|
74
|
+
readonly providerStatusId: string | null;
|
|
75
|
+
/** Sanitized provider-supplied text, if any. Never raw. */
|
|
76
|
+
readonly message: string | null;
|
|
77
|
+
}
|
|
78
|
+
export type PollDeploymentRunResult = {
|
|
79
|
+
readonly ok: true;
|
|
80
|
+
readonly update: DeploymentRunStatusUpdate;
|
|
81
|
+
} | {
|
|
82
|
+
readonly ok: false;
|
|
83
|
+
readonly error: DeploymentError;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* One deployment provider. Implemented once per provider, in its own file under `./providers/`,
|
|
87
|
+
* and (in a later slice) registered — core never enumerates implementations of this interface, the
|
|
88
|
+
* same rule `PaymentProviderRegistry` enforces for payments.
|
|
89
|
+
*
|
|
90
|
+
* Deliberately excluded this pass (see the handoff report's REMAINING section for why each is
|
|
91
|
+
* deferred, not forgotten):
|
|
92
|
+
* - No `validateTarget` — admin "configure target" UX is out of scope for this slice.
|
|
93
|
+
* - No `cancelRun` — the R1-R3 debate consensus is that rollback IS `startRun` with a prior
|
|
94
|
+
* `releaseId`, not a distinct cancel operation; GitHub's Deployments API has no cancel endpoint
|
|
95
|
+
* for an already-created deployment in any case.
|
|
96
|
+
* - No streaming-logs method — `EgressPolicy`'s response caps are sized for bounded JSON, not a
|
|
97
|
+
* long-lived connection; that is new design work, not a v1 default.
|
|
98
|
+
*/
|
|
99
|
+
export interface DeploymentProviderPort<THttpClient = HttpClientPort> {
|
|
100
|
+
readonly id: DeploymentProviderId;
|
|
101
|
+
/** Credential slot names this provider needs (e.g. `["appId", "installationId",
|
|
102
|
+
* "privateKeyPem"]`). Declaring them as DATA — rather than an adapter reading env vars inline —
|
|
103
|
+
* is what lets a future core layer report a misconfigured provider uniformly, before any adapter
|
|
104
|
+
* code runs. */
|
|
105
|
+
readonly credentialKeys: readonly string[];
|
|
106
|
+
/** MUST return promptly with a reference to poll or await a callback for — never blocks until the
|
|
107
|
+
* deployment finishes. */
|
|
108
|
+
startRun(input: StartDeploymentRunInput, ctx: DeploymentProviderContext<THttpClient>): Promise<StartDeploymentRunResult>;
|
|
109
|
+
/** Only ever called when reconciliation requires it — either as the sole mechanism for a
|
|
110
|
+
* `reconciliation: "poll"` run, or as the recovery path for a `"callback"` run whose webhook
|
|
111
|
+
* never arrived (or, for GitHub specifically, whose terminal state is `inactive`, which GitHub
|
|
112
|
+
* never delivers as a webhook at all). */
|
|
113
|
+
pollRun(input: PollDeploymentRunInput, ctx: DeploymentProviderContext<THttpClient>): Promise<PollDeploymentRunResult>;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { buildPublishHostCredentialHandler } from './publish-tool-credential.js';
|
|
2
|
+
import { type AgentToolSideEffect, type ToolRegistration, type ToolContributor } from '@jini-ai/core';
|
|
3
|
+
import type { StaticPublishToolDeps } from './publish-tool-deps.js';
|
|
4
|
+
import type { AssistantSurfaceDeps } from '@jini-ai/core/contracts/site/daemon-surface-exchanges';
|
|
5
|
+
/**
|
|
6
|
+
* This wiring layer's OWN risk classification, independent of the catalog's `sideEffects`
|
|
7
|
+
* declaration (`@jini-ai/cms/core`'s `assertToolIsWirable` cross-checks the two and refuses to wire
|
|
8
|
+
* on disagreement).
|
|
9
|
+
*/
|
|
10
|
+
export declare const staticPublishDerivedRisk: ReadonlyMap<string, AgentToolSideEffect>;
|
|
11
|
+
export declare function buildStaticPublishRegistrations(deps: StaticPublishToolDeps, surfaces: AssistantSurfaceDeps): ToolRegistration[];
|
|
12
|
+
/**
|
|
13
|
+
* Contributes Static Publish's AI tools; called once by the composition root's
|
|
14
|
+
* `installFirstPartyToolContributors()`, never as an import side effect.
|
|
15
|
+
* See ./tool-registrations.ts for the shared deployments/credential dependency boundary.
|
|
16
|
+
*/
|
|
17
|
+
export declare function contributeStaticPublishTools(): ToolContributor<StaticPublishToolDeps, AssistantSurfaceDeps>;
|
|
18
|
+
//# sourceMappingURL=publish-agent-tools.d.ts.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export { buildPublishHostCredentialHandler } from './publish-tool-credential.js';
|
|
2
|
+
import { deployTargetsLoader, requireStaticPublishTarget, mapPublishOutcomeToToolResult, previewStaticPublish, executeStaticPublish } from './publish-tool-execution.js';
|
|
3
|
+
import { getStaticPublishCapabilities } from './publish-tool-capabilities.js';
|
|
4
|
+
import { readCredentialHints } from './publish-tool-credential.js';
|
|
5
|
+
import { ToolInputError, buildDomainRegistrations, indexCatalogById, requireInputRecord, requireString } from '@jini-ai/core';
|
|
6
|
+
import { adaptLegacyAuthorize } from '@jini-ai/core';
|
|
7
|
+
import { toolMetadata } from '@jini-ai/core/tool-metadata/deployments';
|
|
8
|
+
import { publishJobRecoveryMessage } from '../index.js';
|
|
9
|
+
import { composePublishCredentialSource } from './static-publish/credentials.js';
|
|
10
|
+
import { getPublishJobSnapshot } from './static-publish/publish-run.js';
|
|
11
|
+
const DEPLOYMENTS_READ_PERMISSION = "deployments.read";
|
|
12
|
+
const SITE_PUBLISH_ENTITY = "site-publish";
|
|
13
|
+
/**
|
|
14
|
+
* This wiring layer's OWN risk classification, independent of the catalog's `sideEffects`
|
|
15
|
+
* declaration (`@jini-ai/cms/core`'s `assertToolIsWirable` cross-checks the two and refuses to wire
|
|
16
|
+
* on disagreement).
|
|
17
|
+
*/
|
|
18
|
+
export const staticPublishDerivedRisk = new Map([
|
|
19
|
+
// -> resolves credential presence (`PublishCredentialSource.isConfigured`, read-only) and validates
|
|
20
|
+
// config shape (`validateStaticPublishConfig`, pure). Authenticated provider inspection may
|
|
21
|
+
// resolve server-side for GETs only; no provisioning, uploads or export run.
|
|
22
|
+
["deployment_preview_static_publish", "none"],
|
|
23
|
+
["deployment_get_static_publish_status", "none"],
|
|
24
|
+
// -> `listPublishCredentials` (a pure DB read, never decrypts — `publish-credentials/store.ts`'s own
|
|
25
|
+
// doc) plus `PublishCredentialSource.isConfigured` per provider (same non-decrypting contract the
|
|
26
|
+
// preview tool relies on). No write, no decrypt, no network call.
|
|
27
|
+
["deployment_get_static_publish_capabilities", "none"],
|
|
28
|
+
// -> on confirm, calls `publishStaticSite`: a real `exportSite` pass plus a real provider API call
|
|
29
|
+
// (the selected host plugin's deploy target) using a write-scoped credential — genuinely mutates
|
|
30
|
+
// external durable state. See this file's header for the full risk story.
|
|
31
|
+
["deployment_execute_static_publish", "mutates-durable-state"],
|
|
32
|
+
// -> on submit, calls `createPublishCredential`/`updatePublishCredential` — a real encrypted write to
|
|
33
|
+
// `vendor_credential_sets`.
|
|
34
|
+
// No secret ever transits the model (see this file's header/the catalog entry's own comment); the
|
|
35
|
+
// write itself is still a genuine external-account-scoped mutation, same category (not merely "some
|
|
36
|
+
// risk classification") as the publish tool above.
|
|
37
|
+
// -> the host plugin module's pure `hostingSetup` over the caller's non-secret fields (never a saved
|
|
38
|
+
// credential). No write, no network call, no decrypt.
|
|
39
|
+
["deployment_generate_bucket_hosting_setup", "none"],
|
|
40
|
+
]);
|
|
41
|
+
// Cross-site discovery used to offer another site's key for a missing host. That reveals private
|
|
42
|
+
// inventory to a site agent. Offer the owner picker instead; the model never receives its choices.
|
|
43
|
+
export function buildStaticPublishRegistrations(deps, surfaces) {
|
|
44
|
+
const credentialSource = deps.credentialSource ??
|
|
45
|
+
composePublishCredentialSource({
|
|
46
|
+
workspaceId: deps.workspaceId,
|
|
47
|
+
executionMode: deps.publishExecutionMode,
|
|
48
|
+
env: deps.env,
|
|
49
|
+
dbDeps: { ...deps.credentialSourceStorePorts, repo: deps.vendorCredentialSetRepo, sealer: deps.siteAssistantSecretSealer, loadDeployTargets: deployTargetsLoader(deps) },
|
|
50
|
+
});
|
|
51
|
+
const historyStore = deps.historyStore ?? deps.publishHistoryStore;
|
|
52
|
+
const handlers = {
|
|
53
|
+
deployment_preview_static_publish: async (ctx) => previewStaticPublish({ deps, credentialSource, ctx }),
|
|
54
|
+
deployment_get_static_publish_capabilities: async (ctx) => getStaticPublishCapabilities({ deps, credentialSource, historyStore, ctx }),
|
|
55
|
+
/** Permission-checked job reads; no credentials or provider requests on the polling path. */
|
|
56
|
+
deployment_get_static_publish_status: async (ctx) => {
|
|
57
|
+
const raw = requireInputRecord({ input: ctx.input ?? {} });
|
|
58
|
+
for (const key of Object.keys(raw))
|
|
59
|
+
if (key !== "jobId" && key !== "executionId")
|
|
60
|
+
throw new ToolInputError({ message: `Unknown publish-status field '${key}'. Pass jobId or executionId, or {} for this site's latest publish.` });
|
|
61
|
+
const jobId = raw.jobId === undefined ? undefined : requireString({ input: raw, key: "jobId" });
|
|
62
|
+
const requestId = raw.executionId === undefined ? undefined : requireString({ input: raw, key: "executionId" });
|
|
63
|
+
await deps.requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: deps.authorize }), workspaceId: deps.workspaceId, principalId: ctx.principal.id, permission: DEPLOYMENTS_READ_PERMISSION }, { entityType: SITE_PUBLISH_ENTITY });
|
|
64
|
+
const snapshot = getPublishJobSnapshot({ deps: deps.staticPublishPorts, workspaceId: deps.workspaceId, jobId, requestId });
|
|
65
|
+
if (!snapshot)
|
|
66
|
+
return { code: "PUBLISH_JOB_NOT_FOUND", message: "No retained publish job was found for this site. A restart clears job snapshots. Check the hosting dashboard before starting another publish." };
|
|
67
|
+
const mapped = snapshot.result ? mapPublishOutcomeToToolResult({ deps, outcome: snapshot.result, exchange: { id: snapshot.jobId }, config: { target: snapshot.target }, detailRows: [], projectName: "" }) : undefined;
|
|
68
|
+
return { ...snapshot, ...(mapped ? { result: mapped.result } : {}),
|
|
69
|
+
message: publishJobRecoveryMessage({ job: snapshot, statusToolId: "deployment_get_static_publish_status" }) };
|
|
70
|
+
},
|
|
71
|
+
deployment_execute_static_publish: async (inputCtx, optional = {}) => executeStaticPublish({ deps, surfaces, credentialSource, historyStore, inputCtx, optional }),
|
|
72
|
+
/**
|
|
73
|
+
* The MCP-UI form-gated credential save for any host whose plugin declares a credential. Same
|
|
74
|
+
* Opens an exchange, emits a form, then uses `askThenReport` to replace it with the real save
|
|
75
|
+
* outcome: the model proposes structure for a human to fill in.
|
|
76
|
+
*
|
|
77
|
+
* The schema has no secret property, and a secret or undeclared field is refused before any form
|
|
78
|
+
* is raised. The human's typed secret lands in `answer.params` server-side and is sealed by
|
|
79
|
+
* `publish-credentials/store.ts`; it never enters a prompt or a completion, and the result never
|
|
80
|
+
* echoes any field.
|
|
81
|
+
*/
|
|
82
|
+
/**
|
|
83
|
+
* Pure read — the host plugin module's own `hostingSetup` over the caller's non-secret credential
|
|
84
|
+
* fields (never a saved credential). A host with no such steps is refused with the reason.
|
|
85
|
+
*/
|
|
86
|
+
deployment_generate_bucket_hosting_setup: async (ctx) => {
|
|
87
|
+
const raw = requireInputRecord({ input: ctx.input });
|
|
88
|
+
const loaded = requireStaticPublishTarget(raw, await deployTargetsLoader(deps)({ workspaceId: deps.workspaceId }));
|
|
89
|
+
const { descriptor, module } = loaded;
|
|
90
|
+
if (module.hostingSetup === undefined)
|
|
91
|
+
throw new ToolInputError({ message: `${descriptor.id} has no hosting-setup steps: publishing to it serves the site.` });
|
|
92
|
+
const fields = readCredentialHints({ raw, descriptor, deps });
|
|
93
|
+
await deps.requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: deps.authorize }), workspaceId: deps.workspaceId, principalId: ctx.principal.id, permission: DEPLOYMENTS_READ_PERMISSION }, { entityType: SITE_PUBLISH_ENTITY });
|
|
94
|
+
try {
|
|
95
|
+
return module.hostingSetup({ fields });
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
throw new ToolInputError({ message: err instanceof Error ? err.message : String(err) });
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
// No `unwiredToolIds`: this domain now wires its ENTIRE catalog, same tripwire discipline as
|
|
103
|
+
// Posts/Pages/Forms/Entries/Widgets — a 4th catalog entry added without a handler fails the build.
|
|
104
|
+
return buildDomainRegistrations({ metadata: toolMetadata,
|
|
105
|
+
domain: "static-publish",
|
|
106
|
+
catalogModule: "@jini-ai/devops/deploy/site/publish-agent-tools",
|
|
107
|
+
catalog: indexCatalogById({ catalog: deps.catalog }),
|
|
108
|
+
handlers,
|
|
109
|
+
derivedRisk: staticPublishDerivedRisk,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Contributes Static Publish's AI tools; called once by the composition root's
|
|
114
|
+
* `installFirstPartyToolContributors()`, never as an import side effect.
|
|
115
|
+
* See ./tool-registrations.ts for the shared deployments/credential dependency boundary.
|
|
116
|
+
*/
|
|
117
|
+
export function contributeStaticPublishTools() {
|
|
118
|
+
return { domain: "static-publish", build: buildStaticPublishRegistrations, risk: staticPublishDerivedRisk };
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=publish-agent-tools.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The address to offer the owner, read out of the repo's own deploy config.
|
|
3
|
+
*
|
|
4
|
+
* Deliberately not the process environment: on the machine doing the connecting that names
|
|
5
|
+
* THIS install (usually `localhost`), not the site being published to. The committed config is the
|
|
6
|
+
* one place that names the deployed site, and every install that has ever been deployed has it.
|
|
7
|
+
*
|
|
8
|
+
* @returns The first `https` origin found, or `null` — an install that has never been deployed has
|
|
9
|
+
* no candidate, which is an ordinary empty state and not an error.
|
|
10
|
+
* @complexity O(f · n) for `f` config files of length `n`; f is the number of declared candidate paths.
|
|
11
|
+
*/
|
|
12
|
+
export declare function findCandidateDestination(deps: {
|
|
13
|
+
readonly io: {
|
|
14
|
+
read(required: {
|
|
15
|
+
path: string;
|
|
16
|
+
}, optional?: Record<string, never>): string | null | Promise<string | null>;
|
|
17
|
+
};
|
|
18
|
+
readonly publicOriginKey: string;
|
|
19
|
+
/** Absolute path for a repo-relative config file. */
|
|
20
|
+
readonly resolvePath: (required: {
|
|
21
|
+
relative: string;
|
|
22
|
+
}, optional?: Record<string, never>) => string;
|
|
23
|
+
}, { candidatePaths }?: {
|
|
24
|
+
readonly candidatePaths?: readonly string[];
|
|
25
|
+
}): Promise<string | null>;
|
|
26
|
+
//# sourceMappingURL=publish-candidate.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { isContainedDeployConfigPath } from "../config-descriptors.js";
|
|
2
|
+
/* Deploy-config files a repo may carry, in the order they are consulted for a candidate address.
|
|
3
|
+
* The vendor paths and their order are declared as plain data by the bundled deploy-config
|
|
4
|
+
* plugins (`candidatePaths` in `jini-deploy-configs.json`); core adds only the neutral `app.json`.
|
|
5
|
+
* Operator repos may commit generated configs; generation inputs can remain in a workflow.
|
|
6
|
+
*
|
|
7
|
+
* This is a SUGGESTION mechanism, never a trust decision: whatever it finds is shown to the owner
|
|
8
|
+
* for confirmation and is re-validated as a URL before anything is done with it. That is why a
|
|
9
|
+
* plain scan is adequate here where a real parser would be required to WRITE one (a provisioning codec) — the
|
|
10
|
+
* cost of a wrong guess is a pre-filled field the owner corrects, not a misdirected publish. */
|
|
11
|
+
/**
|
|
12
|
+
* The address to offer the owner, read out of the repo's own deploy config.
|
|
13
|
+
*
|
|
14
|
+
* Deliberately not the process environment: on the machine doing the connecting that names
|
|
15
|
+
* THIS install (usually `localhost`), not the site being published to. The committed config is the
|
|
16
|
+
* one place that names the deployed site, and every install that has ever been deployed has it.
|
|
17
|
+
*
|
|
18
|
+
* @returns The first `https` origin found, or `null` — an install that has never been deployed has
|
|
19
|
+
* no candidate, which is an ordinary empty state and not an error.
|
|
20
|
+
* @complexity O(f · n) for `f` config files of length `n`; f is the number of declared candidate paths.
|
|
21
|
+
*/
|
|
22
|
+
export async function findCandidateDestination(deps, { candidatePaths = ["app.json"] } = {}) {
|
|
23
|
+
const key = deps.publicOriginKey;
|
|
24
|
+
const PUBLIC_URL_PATTERN = new RegExp(`${key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*[:=]\\s*["']?(https://[^"'\\s,]+)`);
|
|
25
|
+
for (const relative of candidatePaths) {
|
|
26
|
+
if (!isContainedDeployConfigPath({ value: relative }))
|
|
27
|
+
continue;
|
|
28
|
+
const contents = await deps.io.read({ path: deps.resolvePath({ relative }) });
|
|
29
|
+
if (contents !== null) {
|
|
30
|
+
const found = PUBLIC_URL_PATTERN.exec(contents)?.[1];
|
|
31
|
+
if (found !== undefined)
|
|
32
|
+
return found;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=publish-candidate.js.map
|