@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,205 @@
|
|
|
1
|
+
import type { AgentToolDefinition, ToolHandler, ToolRegistration, ToolExecutionContext, ToolExecutionOptions, HumanConfirmer } from '@jini-ai/core';
|
|
2
|
+
import type { requireToolPermission } from '@jini-ai/core';
|
|
3
|
+
import type { resolveOperatorLocale } from '@jini-ai/core/operator-locale';
|
|
4
|
+
import type { GatedMutationHooks, plan, confirm, execute } from '@jini-ai/core/gated-mutations';
|
|
5
|
+
import type { HumanConfirmSpec } from '@jini-ai/core/contracts/site/human-confirm';
|
|
6
|
+
import type { AssistantSurfaceDeps } from '@jini-ai/core/contracts/site/daemon-surface-exchanges';
|
|
7
|
+
import type { SurfaceCardsPort, SurfaceCardSecretDeps, SurfaceCardSecretOptions, SecretCardForm, SurfaceOutcomeSpec } from '@jini-ai/core/contracts/cards';
|
|
8
|
+
import type { PluginCredentialCard } from '@jini-ai/core/contracts/credentials';
|
|
9
|
+
import type { CredentialTokenHint } from '@jini-ai/core/contracts/site/secrets-credential-token';
|
|
10
|
+
import type { UIResource } from '@jini-ai/core/contracts/site/protocol-mcp-ui';
|
|
11
|
+
import type { LoadInstalledDeployTargets } from "@jini-ai/devops/deploy/site/deploy-targets/types";
|
|
12
|
+
/** The host's own gateway deps, opaque to Jini. */
|
|
13
|
+
export type HostGatewayDeps = object;
|
|
14
|
+
type WithHostGatewayDeps<T> = Omit<T, 'deps'> & {
|
|
15
|
+
deps: HostGatewayDeps;
|
|
16
|
+
};
|
|
17
|
+
import type { OperatorLocaleDeps } from '@jini-ai/core/contracts/headless/plugin-host';
|
|
18
|
+
import type { Clock } from "@jini-ai/core/primitives";
|
|
19
|
+
import type { ExportReport as BaseExportReport } from '../../static-export/contracts.js';
|
|
20
|
+
type ExportReport = BaseExportReport & {
|
|
21
|
+
consentWarning?: string;
|
|
22
|
+
};
|
|
23
|
+
import type { AuthorizeFn } from "@jini-ai/core/contracts/events";
|
|
24
|
+
import type { KeyringPort } from "@jini-ai/core/contracts/vault";
|
|
25
|
+
import type { SecretSealerPort } from "@jini-ai/core/contracts/vault";
|
|
26
|
+
import type { PublishExecutionMode } from "@jini-ai/devops/deploy/site/publish-credentials/execution-mode";
|
|
27
|
+
import type { PublishCredentialWriteDeps, PublishCredentialReadDeps } from './publish-credentials/store.js';
|
|
28
|
+
type VendorCredentialSetRepoPort = PublishCredentialReadDeps['repo'];
|
|
29
|
+
import type { DeployTargetRegistry } from "@jini-ai/devops/deploy/site/deploy-targets/types";
|
|
30
|
+
import type { ObservabilityPort } from "@jini-ai/core/contracts/observability";
|
|
31
|
+
import type { PublishCredentialVerificationCache, VerifyPublishCredentialDeps } from './static-publish/verify.js';
|
|
32
|
+
import type { PublishHistoryStore } from './static-publish/publish-history.js';
|
|
33
|
+
import type { StaticPublishDeps } from './static-publish/adapter.js';
|
|
34
|
+
import type { DbPublishCredentialSourceDeps } from './static-publish/credentials.js';
|
|
35
|
+
import type { PublishCredentialSource } from "@jini-ai/devops/deploy/site/static-publish/types";
|
|
36
|
+
/** Composition-root-bound export operation, typed locally to avoid cross-feature type coupling.
|
|
37
|
+
* The composition root closes over full application dependencies; this feature passes only options.
|
|
38
|
+
*/
|
|
39
|
+
type ExportSiteBoundFn = (options: {
|
|
40
|
+
outputDir: string;
|
|
41
|
+
clean?: boolean;
|
|
42
|
+
basePath?: string;
|
|
43
|
+
}) => Promise<ExportReport>;
|
|
44
|
+
/** Only ports the tool handlers read, declared structurally without importing RouteDeps.
|
|
45
|
+
* A real publish needs the full application graph for export; exportSiteBound captures it at the
|
|
46
|
+
* composition root, so that requirement does not widen this feature's dependency contract.
|
|
47
|
+
* Every other field is a direct port type, never indexed from the composition root's wide bag.
|
|
48
|
+
*/
|
|
49
|
+
export interface StaticPublishToolDeps extends OperatorLocaleDeps {
|
|
50
|
+
readonly catalog: readonly AgentToolDefinition[];
|
|
51
|
+
readonly env: NodeJS.ProcessEnv;
|
|
52
|
+
readonly staticPublishPorts: Pick<StaticPublishDeps, 'publishJobs' | 'redactSecretShapes' | 'createNoopTracker' | 'createDeployHostKit' | 'defaultPublicPageSecurityHeaders' | 'firstExportFailure' | 'rmSync' | 'warn' | 'rewriteFormActions' | 'issueCredentialSetup'>;
|
|
53
|
+
readonly credentialStorePorts: Omit<PublishCredentialWriteDeps, 'repo' | 'sealer' | 'keyring' | 'clock' | 'idGen' | 'loadDeployTargets' | 'allowSharedKeyReplacement'>;
|
|
54
|
+
readonly credentialSourceStorePorts: Pick<DbPublishCredentialSourceDeps, 'describeCredential' | 'hasDefaultForPublish' | 'resolveForPublish' | 'resolveDefaultForPublish'>;
|
|
55
|
+
readonly verificationPorts: Pick<VerifyPublishCredentialDeps, 'assertCredentialToken' | 'CredentialInputError' | 'credentialText' | 'createDeployHostKit'>;
|
|
56
|
+
readonly requireToolPermission: typeof requireToolPermission;
|
|
57
|
+
readonly resolveOperatorLocale: typeof resolveOperatorLocale;
|
|
58
|
+
/** The host's gateway over its own deps (method syntax: the host's functions take its own, narrower
|
|
59
|
+
* deps type; Jini only passes back `gatedMutations.gatewayDeps`). */
|
|
60
|
+
gatewayPlan(required: WithHostGatewayDeps<Parameters<typeof plan>[0]>, optional?: Record<string, never>): ReturnType<typeof plan>;
|
|
61
|
+
gatewayConfirm(required: WithHostGatewayDeps<Parameters<typeof confirm>[0]>, optional?: Record<string, never>): ReturnType<typeof confirm>;
|
|
62
|
+
gatewayExecute<TResult>(required: WithHostGatewayDeps<Parameters<typeof execute<TResult>>[0]>, optional?: Record<string, never>): ReturnType<typeof execute<TResult>>;
|
|
63
|
+
readonly resolveActorClassIdentity: GatedMutationHooks<unknown, unknown>['resolveActorClassIdentity'];
|
|
64
|
+
readonly planHashOf: (required: {
|
|
65
|
+
details: unknown;
|
|
66
|
+
}) => string;
|
|
67
|
+
readonly checkToolPublishConsent: (required: {
|
|
68
|
+
deps: StaticPublishToolDeps;
|
|
69
|
+
principalId: string;
|
|
70
|
+
}) => Promise<Record<string, unknown> | null>;
|
|
71
|
+
readonly defineSecretCardTool: SurfaceCardsPort['defineSecretCardTool'];
|
|
72
|
+
readonly buildOutcomeSurface: SurfaceCardsPort<UIResource>['buildOutcomeSurface'];
|
|
73
|
+
readonly askThenReport: SurfaceCardSecretDeps['askThenReport'];
|
|
74
|
+
readonly secretCardOptions: SurfaceCardSecretOptions;
|
|
75
|
+
readonly uriHost: string;
|
|
76
|
+
readonly publishOutcomeApp: SurfaceOutcomeSpec['app'];
|
|
77
|
+
readonly credentialFormApp: SecretCardForm['app'];
|
|
78
|
+
readonly credentialRowLabel: string;
|
|
79
|
+
readonly credentialSaveToolId: string;
|
|
80
|
+
readonly abortGuardedCredentialRepo: <T extends {
|
|
81
|
+
readonly vault?: import('@jini-ai/core/contracts/vault').VaultRepoPort;
|
|
82
|
+
}>(required: {
|
|
83
|
+
store: T;
|
|
84
|
+
signal: AbortSignal;
|
|
85
|
+
}, optional?: Record<string, never>) => T;
|
|
86
|
+
readonly findPluginCredentialCard: (required: {
|
|
87
|
+
loadCards?: StaticPublishToolDeps['loadPluginCredentialCards'] | undefined;
|
|
88
|
+
workspaceId: string;
|
|
89
|
+
saveKind: PluginCredentialCard['saveKind'];
|
|
90
|
+
target: string;
|
|
91
|
+
}, optional?: Record<string, never>) => Promise<PluginCredentialCard | undefined>;
|
|
92
|
+
readonly applyPluginCredentialCard: (required: {
|
|
93
|
+
card?: PluginCredentialCard;
|
|
94
|
+
form: SecretCardForm;
|
|
95
|
+
}) => SecretCardForm;
|
|
96
|
+
readonly assertCredentialFreeField: (required: {
|
|
97
|
+
value: string;
|
|
98
|
+
field: string;
|
|
99
|
+
}) => void;
|
|
100
|
+
readonly credentialText: (required: {
|
|
101
|
+
id: 'saved' | 'connected' | 'auth' | 'timeout' | 'unreachable' | 'blank' | 'savedTitle';
|
|
102
|
+
locale?: string;
|
|
103
|
+
}) => string;
|
|
104
|
+
readonly formatCredentialHint: (required: {
|
|
105
|
+
hint: CredentialTokenHint | null;
|
|
106
|
+
locale: string;
|
|
107
|
+
}) => string;
|
|
108
|
+
readonly translateCredentialMessage: (required: {
|
|
109
|
+
message: string;
|
|
110
|
+
locale: string;
|
|
111
|
+
}) => string;
|
|
112
|
+
readonly issueCredentialSetup: StaticPublishDeps['issueCredentialSetup'];
|
|
113
|
+
readonly toolApprovalConfirmation: (required: {
|
|
114
|
+
descriptor: Pick<ToolRegistration['descriptor'], 'id' | 'metadata' | 'inputSchema'>;
|
|
115
|
+
input: unknown;
|
|
116
|
+
locale: string;
|
|
117
|
+
}) => HumanConfirmSpec;
|
|
118
|
+
readonly approvalToolHandler: <TPrepared>(steps: {
|
|
119
|
+
surfaces: AssistantSurfaceDeps;
|
|
120
|
+
prepare(input: {
|
|
121
|
+
ctx: ToolExecutionContext;
|
|
122
|
+
}, optional: ToolExecutionOptions): Promise<TPrepared>;
|
|
123
|
+
describe(input: {
|
|
124
|
+
ctx: ToolExecutionContext;
|
|
125
|
+
prepared: TPrepared;
|
|
126
|
+
}, optional: ToolExecutionOptions): HumanConfirmSpec | Promise<HumanConfirmSpec>;
|
|
127
|
+
run(input: {
|
|
128
|
+
ctx: ToolExecutionContext;
|
|
129
|
+
prepared: TPrepared;
|
|
130
|
+
confirmer: HumanConfirmer;
|
|
131
|
+
}, optional: ToolExecutionOptions): Promise<unknown>;
|
|
132
|
+
}, optional: {
|
|
133
|
+
flag: string;
|
|
134
|
+
}) => ToolHandler;
|
|
135
|
+
readonly loadPluginCredentialCards?: (workspaceId: string) => Promise<readonly PluginCredentialCard[]>;
|
|
136
|
+
/** Existing shared gateway; required when publishing with infrastructure changes. */
|
|
137
|
+
readonly gatedMutations?: {
|
|
138
|
+
readonly gatewayDeps: HostGatewayDeps;
|
|
139
|
+
};
|
|
140
|
+
readonly hostKit?: StaticPublishDeps["hostKit"];
|
|
141
|
+
readonly publicPageSecurityHeaders?: StaticPublishDeps["publicPageSecurityHeaders"];
|
|
142
|
+
readonly pluginExportHosts?: StaticPublishDeps["pluginExportHosts"];
|
|
143
|
+
/** `RouteDeps.formDestination`: the site's forms and receiver key, for a host that receives submissions. */
|
|
144
|
+
readonly formDestination?: StaticPublishDeps["formDestination"];
|
|
145
|
+
readonly ownerPrincipalId?: Promise<string>;
|
|
146
|
+
readonly authorize: AuthorizeFn;
|
|
147
|
+
readonly workspaceId: string;
|
|
148
|
+
readonly clock: Clock;
|
|
149
|
+
readonly idGen: {
|
|
150
|
+
newId(): string;
|
|
151
|
+
};
|
|
152
|
+
readonly siteAssistantSecretSealer: SecretSealerPort;
|
|
153
|
+
readonly siteAssistantSecretKeyring: KeyringPort;
|
|
154
|
+
readonly publishExecutionMode: PublishExecutionMode;
|
|
155
|
+
readonly publishHistoryStore: PublishHistoryStore;
|
|
156
|
+
readonly publishCredentialVerificationCache: PublishCredentialVerificationCache;
|
|
157
|
+
readonly vendorCredentialSetRepo: VendorCredentialSetRepoPort;
|
|
158
|
+
/** `RouteDeps.publishOutputRootDir`, threaded down for the same reason `exportSiteBound` above is —
|
|
159
|
+
* `publishStaticSite`'s `StaticPublishInput.publishOutputRootDir` needs it directly. */
|
|
160
|
+
readonly publishOutputRootDir: string;
|
|
161
|
+
/** The pre-bound export call — see {@link ExportSiteBoundFn}'s own doc above for what it is and why
|
|
162
|
+
* it replaces the `routeDeps: RouteDeps` field this interface used to carry (via `extends RouteDeps`). */
|
|
163
|
+
readonly exportSiteBound: ExportSiteBoundFn;
|
|
164
|
+
/** Test-only override — when supplied, replaces the composed `PublishCredentialSource` entirely
|
|
165
|
+
* (DB-backed + env-fallback composition, `vendorCredentialSetRepo`/`siteAssistantSecretSealer`/
|
|
166
|
+
* `publishExecutionMode` are all ignored). Production never sets this. */
|
|
167
|
+
credentialSource?: PublishCredentialSource;
|
|
168
|
+
/** Test-only override for `publishStaticSite`'s own `StaticPublishDeps.buildTarget` — lets a test
|
|
169
|
+
* substitute a fake `DeployTarget` so `deployment_execute_static_publish`'s CONFIRMED path can be
|
|
170
|
+
* exercised end-to-end without ever constructing a real host plugin's
|
|
171
|
+
* client or touching `fetch` (mirrors `static-publish/adapter.ts`'s own test-injection seam,
|
|
172
|
+
* "adapter tests with a faked deploy target — do not hit real providers in tests"). Production
|
|
173
|
+
* never sets this — `publishStaticSite`'s own default (the real Jini adapters) applies. */
|
|
174
|
+
buildTarget?: StaticPublishDeps["buildTarget"];
|
|
175
|
+
/** `RouteDeps.loadDeployTargets` — this workspace's deploy registry, which decides which config
|
|
176
|
+
* fields a target takes and judges them. Production composition injects the installed deploy Agent Plugin
|
|
177
|
+
* (`loadDeployTargetRegistry`); a test injects a registry read from the plugin's source. */
|
|
178
|
+
loadDeployTargets: ({ workspaceId }: {
|
|
179
|
+
workspaceId: string;
|
|
180
|
+
}, optional?: Record<string, never>) => Promise<DeployTargetRegistry>;
|
|
181
|
+
/** Installed metadata; production binds the data contribution loader, never executable discovery. */
|
|
182
|
+
readonly loadInstalledDeployTargets?: LoadInstalledDeployTargets;
|
|
183
|
+
/** Post-save connection checks share the verifier's HTTP seam; fixtures never need real egress. */
|
|
184
|
+
readonly fetchFn?: typeof fetch;
|
|
185
|
+
/** Test-only override for `RouteDeps.publishHistoryStore` (2026-08-16 rework — that field is now
|
|
186
|
+
* the real, DB-backed `SqlitePublishHistoryStore` in production; see `routes/types.ts`'s own doc)
|
|
187
|
+
* — lets a test inject an `InMemoryPublishHistoryStore` so it can assert on a recorded publish (or
|
|
188
|
+
* a capabilities read) without touching a real database. Passed straight through to
|
|
189
|
+
* `runPublishAndAwait` on a confirmed publish AND used by the capabilities handler's own read, so a
|
|
190
|
+
* test sees one consistent store on both sides. Production never sets this; both paths fall back to
|
|
191
|
+
* `deps.publishHistoryStore`, so a real publish's history is visible to this tool with no wiring
|
|
192
|
+
* change outside this domain (see `publish-run.ts`'s header, "Publish history"). */
|
|
193
|
+
historyStore?: PublishHistoryStore;
|
|
194
|
+
/** `RouteDeps.observability`, forwarded so a confirmed publish's deploy egress is traced. */
|
|
195
|
+
readonly observability?: ObservabilityPort;
|
|
196
|
+
readonly tracker?: import("@jini-ai/core/contracts/site/diagnostics-observability").Tracker;
|
|
197
|
+
}
|
|
198
|
+
type OptionalPublishPorts = Pick<StaticPublishDeps, "tracker" | "observability" | "hostKit" | "formDestination" | "publicPageSecurityHeaders" | "pluginExportHosts" | "buildTarget">;
|
|
199
|
+
/** The tool deps' optional static-publish ports, each present only when the host supplied it
|
|
200
|
+
* (exact optional properties forbid passing an explicit `undefined`). O(1). */
|
|
201
|
+
export declare function optionalPublishPorts(required: {
|
|
202
|
+
deps: Pick<StaticPublishToolDeps, keyof OptionalPublishPorts>;
|
|
203
|
+
}, _optional?: Record<string, never>): OptionalPublishPorts;
|
|
204
|
+
export {};
|
|
205
|
+
//# sourceMappingURL=publish-tool-deps.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** The tool deps' optional static-publish ports, each present only when the host supplied it
|
|
2
|
+
* (exact optional properties forbid passing an explicit `undefined`). O(1). */
|
|
3
|
+
export function optionalPublishPorts(required, _optional = {}) {
|
|
4
|
+
const { tracker, observability, hostKit, formDestination, publicPageSecurityHeaders, pluginExportHosts, buildTarget } = required.deps;
|
|
5
|
+
return {
|
|
6
|
+
...(tracker === undefined ? {} : { tracker }),
|
|
7
|
+
...(observability === undefined ? {} : { observability }),
|
|
8
|
+
...(hostKit === undefined ? {} : { hostKit }),
|
|
9
|
+
...(formDestination === undefined ? {} : { formDestination }),
|
|
10
|
+
...(publicPageSecurityHeaders === undefined ? {} : { publicPageSecurityHeaders }),
|
|
11
|
+
...(pluginExportHosts === undefined ? {} : { pluginExportHosts }),
|
|
12
|
+
...(buildTarget === undefined ? {} : { buildTarget }),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=publish-tool-deps.js.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type ToolHandler, type SurfaceEmission } from '@jini-ai/core';
|
|
2
|
+
import type { StaticPublishToolDeps } from './publish-tool-deps.js';
|
|
3
|
+
import type { AssistantSurfaceDeps } from '@jini-ai/core/contracts/site/daemon-surface-exchanges';
|
|
4
|
+
import type { SurfaceExchange } from '@jini-ai/core';
|
|
5
|
+
import type { DeployTargetRegistry, LoadedDeployTarget } from './deploy-targets/types.js';
|
|
6
|
+
import type { PublishHistoryStore } from './static-publish/publish-history.js';
|
|
7
|
+
import type { PublishCredentialSource, StaticPublishConfig, StaticPublishOutcome } from './static-publish/types.js';
|
|
8
|
+
/** {@link StaticPublishToolDeps.loadDeployTargets}, bound by composition to installed plugins or trusted source. */
|
|
9
|
+
export declare function deployTargetsLoader(deps: StaticPublishToolDeps): ({ workspaceId }: {
|
|
10
|
+
workspaceId: string;
|
|
11
|
+
}, optional?: Record<string, never>) => Promise<DeployTargetRegistry>;
|
|
12
|
+
/** One labelled row on a publish confirmation/outcome card. */
|
|
13
|
+
type DetailRow = {
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
17
|
+
/** Shared `target` lookup for `deployment_preview_static_publish` and
|
|
18
|
+
* `deployment_execute_static_publish`: the input's `target` must be a host this workspace's deploy
|
|
19
|
+
* registry has loaded.
|
|
20
|
+
* @throws {ToolInputError} `raw.target` is missing, or no loaded plugin provides it.
|
|
21
|
+
* @complexity O(1) — one registry lookup. */
|
|
22
|
+
export declare function requireStaticPublishTarget(raw: Record<string, unknown>, registry: DeployTargetRegistry): LoadedDeployTarget;
|
|
23
|
+
/**
|
|
24
|
+
* Maps `publishStaticSite`'s own `StaticPublishOutcome` (via {@link handlePublishConfirmationAnswer}'s
|
|
25
|
+
* `runPublishAndAwait` call) to `deployment_execute_static_publish`'s agent-facing result plus the
|
|
26
|
+
* `outcome` emission that corrects the confirmation dialog with the truth (see
|
|
27
|
+
* {@link handlePublishConfirmationAnswer}'s own header for why that emission exists at all).
|
|
28
|
+
*
|
|
29
|
+
* "Uploaded, but not yet reachable" (spec `custom-publish-provider-contract.md` §3a) — a `"partial"`
|
|
30
|
+
* outcome's files DID upload (so `published: true`, never a hard failure), but the site is not
|
|
31
|
+
* confirmed live yet (so `reachable: false`, never a plain success either). Structurally a distinct
|
|
32
|
+
* branch from both — see `static-publish/types.ts`'s `StaticPublishOutcome` header for why
|
|
33
|
+
* `outcome.ok` itself is `true | false | "partial"`, not merely a boolean.
|
|
34
|
+
*
|
|
35
|
+
* Every branch of `publishStaticSite`'s own failure contract (`static-publish/types.ts`'s
|
|
36
|
+
* `StaticPublishOutcome` doc, `adapter.ts`'s own `catch`) is already an actionable, credential-free
|
|
37
|
+
* message: `NO_CREDENTIALS_CONFIGURED` names the provider via the resolved credential source's own
|
|
38
|
+
* reason text, a credential missing a host-required field (e.g. an account id) names the exact
|
|
39
|
+
* missing field (the target's own `DeployError`), and `PROVIDER_ERROR` is `err.message` only — never a
|
|
40
|
+
* raw response body, never a credential. Passed straight through rather than re-wrapped, and straight
|
|
41
|
+
* into the outcome surface too — the same actionable text a human would need either way.
|
|
42
|
+
*/
|
|
43
|
+
export declare function mapPublishOutcomeToToolResult({ deps, outcome, exchange, config, detailRows, projectName }: {
|
|
44
|
+
deps: StaticPublishToolDeps;
|
|
45
|
+
outcome: StaticPublishOutcome;
|
|
46
|
+
exchange: Pick<SurfaceExchange, "id">;
|
|
47
|
+
config: StaticPublishConfig;
|
|
48
|
+
detailRows: readonly DetailRow[];
|
|
49
|
+
projectName: string;
|
|
50
|
+
}, _options?: {}): {
|
|
51
|
+
result: unknown;
|
|
52
|
+
outcome: SurfaceEmission;
|
|
53
|
+
};
|
|
54
|
+
export declare function previewStaticPublish({ deps, credentialSource, ctx }: {
|
|
55
|
+
deps: StaticPublishToolDeps;
|
|
56
|
+
credentialSource: PublishCredentialSource;
|
|
57
|
+
ctx: Parameters<ToolHandler>[0];
|
|
58
|
+
}): Promise<{
|
|
59
|
+
providerInspection?: import("./deploy-targets/types.js").DeployTargetInspection;
|
|
60
|
+
credentialGuidance?: string;
|
|
61
|
+
basePath: string | null;
|
|
62
|
+
credentialsConfigured: boolean;
|
|
63
|
+
validationError?: string;
|
|
64
|
+
target: string;
|
|
65
|
+
valid: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
/** Validates and starts the existing background publish path after approval. The job owns
|
|
68
|
+
* its lifetime; the initiating delegated call can finish or be cancelled independently. */
|
|
69
|
+
export declare function executeStaticPublish({ deps, surfaces, credentialSource, historyStore, inputCtx, optional }: {
|
|
70
|
+
deps: StaticPublishToolDeps;
|
|
71
|
+
surfaces: AssistantSurfaceDeps;
|
|
72
|
+
credentialSource: PublishCredentialSource;
|
|
73
|
+
historyStore: PublishHistoryStore;
|
|
74
|
+
inputCtx: Parameters<ToolHandler>[0];
|
|
75
|
+
optional: NonNullable<Parameters<ToolHandler>[1]>;
|
|
76
|
+
}): Promise<unknown>;
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=publish-tool-execution.d.ts.map
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { EXECUTE_STATIC_PUBLISH_SCHEMA } from './publish-tool-schema.js';
|
|
2
|
+
import { optionalPublishPorts } from "./publish-tool-deps.js";
|
|
3
|
+
import { ToolInputError, requireInputRecord, requireString } from '@jini-ai/core';
|
|
4
|
+
import { adaptLegacyAuthorize } from '@jini-ai/core';
|
|
5
|
+
import { nowIso as clockNowIso } from '@jini-ai/core/primitives';
|
|
6
|
+
import { toolMetadata } from '@jini-ai/core/tool-metadata/deployments';
|
|
7
|
+
import { getPublishRunSnapshot, getPublishJobSnapshot, startPublishRun } from './static-publish/publish-run.js';
|
|
8
|
+
import { planStaticPublish, readStaticPublishConfig, unknownTargetMessage } from './static-publish/adapter.js';
|
|
9
|
+
import { inspectStaticPublish } from './static-publish/inspection.js';
|
|
10
|
+
import { domainPublishTool } from './static-publish/domain-publish-tool.js';
|
|
11
|
+
const DEPLOYMENTS_READ_PERMISSION = "deployments.read";
|
|
12
|
+
const SITE_PUBLISH_ENTITY = "site-publish";
|
|
13
|
+
/** {@link StaticPublishToolDeps.loadDeployTargets}, bound by composition to installed plugins or trusted source. */
|
|
14
|
+
export function deployTargetsLoader(deps) {
|
|
15
|
+
return deps.loadDeployTargets;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Reads a tool input into a publish config for `target` (already looked up in `registry`) and plans
|
|
19
|
+
* it (`planStaticPublish`, the same call `publishStaticSite` makes). A blank optional field means "not
|
|
20
|
+
* set", matching the old per-target builders.
|
|
21
|
+
*
|
|
22
|
+
* @throws {ToolInputError} A declared field is not a string.
|
|
23
|
+
* @complexity O(f) declared fields.
|
|
24
|
+
*/
|
|
25
|
+
function planToolPublish({ registry, raw, target }, _options = {}) {
|
|
26
|
+
requireOnlyDeclaredFields(raw, target.descriptor);
|
|
27
|
+
const read = readStaticPublishConfig({ target, raw, options: { blankAsAbsent: true } });
|
|
28
|
+
if (!read.ok)
|
|
29
|
+
throw new ToolInputError({ message: read.message });
|
|
30
|
+
return { config: read.config, plan: planStaticPublish({ registry, config: read.config }), detailRows: configDetailRows(read.config, target) };
|
|
31
|
+
}
|
|
32
|
+
/** The publish request's own keys; every other input key must be one of the host's config fields. */
|
|
33
|
+
const PUBLISH_REQUEST_KEYS = new Set(["target", "projectName", "credentialId"]);
|
|
34
|
+
/** Only the explicit, non-secret connection choice crosses into the publish input. */
|
|
35
|
+
function toolCredentialChoice({ raw }, _options = {}) {
|
|
36
|
+
if (raw.credentialId === undefined)
|
|
37
|
+
return {};
|
|
38
|
+
if (typeof raw.credentialId !== "string" || !raw.credentialId.trim())
|
|
39
|
+
throw new ToolInputError({ message: "credentialId must be a non-empty string naming the person's selected connection. Choose it again before previewing or executing." });
|
|
40
|
+
return { credentialId: raw.credentialId };
|
|
41
|
+
}
|
|
42
|
+
/** Refuses an input key the chosen host does not declare, so nothing (a token included) reaches a
|
|
43
|
+
* publish except the host's own config fields. The schemas allow any string key because the fields
|
|
44
|
+
* come from the host's descriptor.
|
|
45
|
+
* @throws {ToolInputError} naming the first undeclared key and the fields the host takes.
|
|
46
|
+
* @complexity O(k·f) input keys by declared fields. */
|
|
47
|
+
function requireOnlyDeclaredFields(raw, descriptor) {
|
|
48
|
+
const declared = descriptor.configFields.map((field) => field.name);
|
|
49
|
+
const unknown = Object.keys(raw).find((key) => !PUBLISH_REQUEST_KEYS.has(key) && !declared.includes(key));
|
|
50
|
+
if (unknown === undefined)
|
|
51
|
+
return;
|
|
52
|
+
const takes = declared.length > 0 ? `It takes: ${declared.join(", ")}.` : "It takes no config fields.";
|
|
53
|
+
throw new ToolInputError({ message: `'${unknown}' is not a field of ${descriptor.id}. ${takes}` });
|
|
54
|
+
}
|
|
55
|
+
/** The card rows for a publish: the target module's own `summarize` when it has one, otherwise one
|
|
56
|
+
* row per declared config field the publish carries, in declaration order and under its declared
|
|
57
|
+
* label. Which fields exist is the plugin's business, so nothing here names a host.
|
|
58
|
+
* @complexity O(f) declared fields. */
|
|
59
|
+
function configDetailRows(config, target) {
|
|
60
|
+
if (target.module.summarize !== undefined)
|
|
61
|
+
return target.module.summarize(config).map(({ label, value }) => ({ label, value }));
|
|
62
|
+
return target.descriptor.configFields.flatMap((field) => {
|
|
63
|
+
const value = config[field.name];
|
|
64
|
+
return typeof value === "string" ? [{ label: field.label, value }] : [];
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const EXECUTE_STATIC_PUBLISH_TOOL_ID = "deployment_execute_static_publish";
|
|
68
|
+
/** The `ui://` URI for one publish-confirmation instance. Keyed by the exchange id (unique per raised
|
|
69
|
+
* dialog) rather than by an entity+version the way `deleteConfirmationUri`
|
|
70
|
+
* (`post deletion confirmation`) keys its own — a publish has no existing row/version to
|
|
71
|
+
* key against, so the exchange id is what keeps two dialogs raised for the same target from
|
|
72
|
+
* colliding on one URI. */
|
|
73
|
+
function publishConfirmationUri({ exchangeId, uriHost }, _options = {}) {
|
|
74
|
+
return `ui://${uriHost}/deployment-execute-static-publish/${exchangeId}`;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Renders the RESULT of a confirmed publish — what a human sees replacing the confirmation dialog
|
|
78
|
+
* they just answered, once `askThenReport`'s `handle` callback has actually run `publishStaticSite`
|
|
79
|
+
* (or refused to, e.g. `already-running`). See `Jini packages/daemon/src/surface-exchanges.ts`'s `askThenReport` doc
|
|
80
|
+
* for the mechanism this depends on: sent under the SAME `uri` the confirmation used
|
|
81
|
+
* (`publishConfirmationUri(exchangeId)`, deliberately reused rather than a fresh one), which is what
|
|
82
|
+
* makes `McpUiSurfaceCard` (`@jini-ai/chat`) replace the dialog in place instead of opening a second
|
|
83
|
+
* card, and what makes `McpUiHost` remount the frame cleanly (its `sessionKey` is
|
|
84
|
+
* `` `${uri}:${documentText}` ``, and this document's text always differs from the confirmation's).
|
|
85
|
+
*
|
|
86
|
+
* `state`/`message`/`url` map straight onto Jini's `SurfaceOutcomeSpec` (`@jini-ai/ui/mcp-ui/surfaces`'s
|
|
87
|
+
* `outcome.ts`) — this function's own job is only deciding the publish-specific title/details/labels,
|
|
88
|
+
* the same division of labor `buildPublishConfirmationResource` above already has with
|
|
89
|
+
* `buildConfirmationSurface`.
|
|
90
|
+
*
|
|
91
|
+
* @param spec.url - Present for `'success'` and `'partial'` only — renders one "Open site"/"Open when
|
|
92
|
+
* ready" button wired to the bridge's existing `openLink`, no new bridge plumbing. Omitted for
|
|
93
|
+
* `'failure'`: there is nothing live to open.
|
|
94
|
+
* @complexity O(1) — fixed-size field reads, no iteration.
|
|
95
|
+
*/
|
|
96
|
+
function buildPublishOutcomeResource(spec) {
|
|
97
|
+
const { deps, exchangeId, config, detailRows, projectName, state, message, url } = spec;
|
|
98
|
+
const unsuccessfulTitle = state === "partial" ? "Uploaded, not live yet" : "Publish failed";
|
|
99
|
+
const title = state === "success" ? "Published" : unsuccessfulTitle;
|
|
100
|
+
return deps.buildOutcomeSurface({
|
|
101
|
+
uri: publishConfirmationUri({ exchangeId, uriHost: deps.uriHost }),
|
|
102
|
+
title,
|
|
103
|
+
details: [
|
|
104
|
+
{ label: "Target", value: config.target },
|
|
105
|
+
{ label: "Project name", value: projectName },
|
|
106
|
+
...detailRows,
|
|
107
|
+
],
|
|
108
|
+
state,
|
|
109
|
+
message,
|
|
110
|
+
...(url !== undefined ? { openLinkUrl: url, openLinkLabel: state === "partial" ? "Open when ready" : "Open site" } : {}),
|
|
111
|
+
...(deps.publishOutcomeApp === undefined ? {} : { app: deps.publishOutcomeApp }),
|
|
112
|
+
preferredFrameSize: ["100%", "360px"],
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/** Shared `target` lookup for `deployment_preview_static_publish` and
|
|
116
|
+
* `deployment_execute_static_publish`: the input's `target` must be a host this workspace's deploy
|
|
117
|
+
* registry has loaded.
|
|
118
|
+
* @throws {ToolInputError} `raw.target` is missing, or no loaded plugin provides it.
|
|
119
|
+
* @complexity O(1) — one registry lookup. */
|
|
120
|
+
export function requireStaticPublishTarget(raw, registry) {
|
|
121
|
+
const targetId = requireString({ input: raw, key: "target" });
|
|
122
|
+
const target = registry.get(targetId);
|
|
123
|
+
if (target === undefined)
|
|
124
|
+
throw new ToolInputError({ message: unknownTargetMessage({ registry, targetId }) });
|
|
125
|
+
return target;
|
|
126
|
+
}
|
|
127
|
+
/** `deployment_preview_static_publish`'s result shape — extracted purely to keep that handler's
|
|
128
|
+
* own body a flat sequence of steps. */
|
|
129
|
+
function buildStaticPublishPreviewResult({ target, validationError, basePath, credential }, _options = {}) {
|
|
130
|
+
return {
|
|
131
|
+
target,
|
|
132
|
+
valid: validationError === null,
|
|
133
|
+
...(validationError !== null ? { validationError } : {}),
|
|
134
|
+
basePath: basePath ?? null,
|
|
135
|
+
credentialsConfigured: credential.configured,
|
|
136
|
+
...(!credential.configured ? { credentialGuidance: credential.reason } : {}),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Maps `publishStaticSite`'s own `StaticPublishOutcome` (via {@link handlePublishConfirmationAnswer}'s
|
|
141
|
+
* `runPublishAndAwait` call) to `deployment_execute_static_publish`'s agent-facing result plus the
|
|
142
|
+
* `outcome` emission that corrects the confirmation dialog with the truth (see
|
|
143
|
+
* {@link handlePublishConfirmationAnswer}'s own header for why that emission exists at all).
|
|
144
|
+
*
|
|
145
|
+
* "Uploaded, but not yet reachable" (spec `custom-publish-provider-contract.md` §3a) — a `"partial"`
|
|
146
|
+
* outcome's files DID upload (so `published: true`, never a hard failure), but the site is not
|
|
147
|
+
* confirmed live yet (so `reachable: false`, never a plain success either). Structurally a distinct
|
|
148
|
+
* branch from both — see `static-publish/types.ts`'s `StaticPublishOutcome` header for why
|
|
149
|
+
* `outcome.ok` itself is `true | false | "partial"`, not merely a boolean.
|
|
150
|
+
*
|
|
151
|
+
* Every branch of `publishStaticSite`'s own failure contract (`static-publish/types.ts`'s
|
|
152
|
+
* `StaticPublishOutcome` doc, `adapter.ts`'s own `catch`) is already an actionable, credential-free
|
|
153
|
+
* message: `NO_CREDENTIALS_CONFIGURED` names the provider via the resolved credential source's own
|
|
154
|
+
* reason text, a credential missing a host-required field (e.g. an account id) names the exact
|
|
155
|
+
* missing field (the target's own `DeployError`), and `PROVIDER_ERROR` is `err.message` only — never a
|
|
156
|
+
* raw response body, never a credential. Passed straight through rather than re-wrapped, and straight
|
|
157
|
+
* into the outcome surface too — the same actionable text a human would need either way.
|
|
158
|
+
*/
|
|
159
|
+
export function mapPublishOutcomeToToolResult({ deps, outcome, exchange, config, detailRows, projectName }, _options = {}) {
|
|
160
|
+
if (!outcome.ok) {
|
|
161
|
+
return {
|
|
162
|
+
result: { published: false, cancelled: false, code: outcome.code, message: outcome.message, ...(outcome.credentialSetup ? { credentialSetup: outcome.credentialSetup } : {}) },
|
|
163
|
+
outcome: {
|
|
164
|
+
channel: "mcp-ui",
|
|
165
|
+
payload: { resource: buildPublishOutcomeResource({ deps, exchangeId: exchange.id, config, detailRows, projectName, state: "failure", message: outcome.message }) },
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
const published = publishedOutcomeFields({ outcome });
|
|
170
|
+
if (outcome.ok === "partial") {
|
|
171
|
+
return {
|
|
172
|
+
result: { ...published, reachable: false, message: outcome.message },
|
|
173
|
+
outcome: {
|
|
174
|
+
channel: "mcp-ui",
|
|
175
|
+
payload: {
|
|
176
|
+
resource: buildPublishOutcomeResource({ deps, exchangeId: exchange.id, config, detailRows, projectName, state: "partial", message: [outcome.message, outcome.consentWarning].filter(Boolean).join(" "), url: outcome.url }),
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
result: { ...published, reachable: true },
|
|
183
|
+
outcome: {
|
|
184
|
+
channel: "mcp-ui",
|
|
185
|
+
payload: {
|
|
186
|
+
resource: buildPublishOutcomeResource({ deps,
|
|
187
|
+
exchangeId: exchange.id, config, detailRows, projectName, state: "success",
|
|
188
|
+
message: [`Published live at ${outcome.url}.`, outcome.consentWarning].filter(Boolean).join(" "),
|
|
189
|
+
url: outcome.url,
|
|
190
|
+
}),
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function publishedOutcomeFields({ outcome }) {
|
|
196
|
+
const published = {
|
|
197
|
+
published: true, target: outcome.targetId, url: outcome.url, status: outcome.status,
|
|
198
|
+
...(outcome.providerMetadata ? { providerMetadata: outcome.providerMetadata } : {}),
|
|
199
|
+
...(outcome.deploymentId !== undefined ? { deploymentId: outcome.deploymentId } : {}),
|
|
200
|
+
...(outcome.basePath !== undefined ? { basePath: outcome.basePath } : {}),
|
|
201
|
+
...(outcome.consentWarning ? { consentWarning: outcome.consentWarning } : {}),
|
|
202
|
+
};
|
|
203
|
+
return published;
|
|
204
|
+
}
|
|
205
|
+
/** All blocked assistant publishes report the same event and product source. */
|
|
206
|
+
function trackBlockedToolPublish({ deps, principalId, target, reasonClass }, _options = {}) {
|
|
207
|
+
void deps.tracker?.capture({ name: "site_publish_blocked", userId: principalId }, { properties: { target, reasonClass, source: "assistant" } });
|
|
208
|
+
}
|
|
209
|
+
export async function previewStaticPublish({ deps, credentialSource, ctx }) {
|
|
210
|
+
const raw = requireInputRecord({ input: ctx.input });
|
|
211
|
+
const registry = await deployTargetsLoader(deps)({ workspaceId: deps.workspaceId });
|
|
212
|
+
const loaded = requireStaticPublishTarget(raw, registry);
|
|
213
|
+
const target = loaded.descriptor.id;
|
|
214
|
+
await deps.requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: deps.authorize }), workspaceId: deps.workspaceId, principalId: ctx.principal.id, permission: DEPLOYMENTS_READ_PERMISSION }, { entityType: SITE_PUBLISH_ENTITY });
|
|
215
|
+
const { config, plan } = planToolPublish({ registry, raw, target: loaded });
|
|
216
|
+
const validationError = plan.ok ? null : plan.message;
|
|
217
|
+
const basePath = plan.ok ? plan.basePath : undefined;
|
|
218
|
+
// Local readiness stays non-decrypting. A provider inspection below is an explicit
|
|
219
|
+
// authenticated read; its server-side credential never enters this tool result.
|
|
220
|
+
const credential = await credentialSource.isConfigured({ workspaceId: deps.workspaceId, target, ...toolCredentialChoice({ raw }) });
|
|
221
|
+
const inspected = plan.ok && credential.configured ? await inspectStaticPublish({
|
|
222
|
+
deps: { ...deps.staticPublishPorts, credentialSource, loadDeployTargets: deps.loadDeployTargets, ...optionalPublishPorts({ deps }) },
|
|
223
|
+
input: { workspaceId: deps.workspaceId, config, projectName: typeof raw.projectName === "string" ? raw.projectName : "",
|
|
224
|
+
...toolCredentialChoice({ raw }) },
|
|
225
|
+
}) : {};
|
|
226
|
+
return { ...buildStaticPublishPreviewResult({ target, validationError, basePath, credential }),
|
|
227
|
+
...(inspected.inspection ? { providerInspection: inspected.inspection } : {}) };
|
|
228
|
+
}
|
|
229
|
+
async function startApprovedStaticPublish({ deps, approvedCtx, target, credentialSource, config, projectName, raw, historyStore, onSettled }) {
|
|
230
|
+
await deps.requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: deps.authorize }), workspaceId: deps.workspaceId, principalId: approvedCtx.principal.id, permission: "deployments.publish" }, { entityType: SITE_PUBLISH_ENTITY });
|
|
231
|
+
const currentConsent = await deps.checkToolPublishConsent({ deps, principalId: approvedCtx.principal.id });
|
|
232
|
+
if (currentConsent) {
|
|
233
|
+
trackBlockedToolPublish({ deps, principalId: approvedCtx.principal.id, target, reasonClass: "consent" });
|
|
234
|
+
return { published: false, cancelled: false, ...currentConsent };
|
|
235
|
+
}
|
|
236
|
+
if (approvedCtx.signal.aborted)
|
|
237
|
+
return { published: false, cancelled: false, reason: "abandoned" };
|
|
238
|
+
const active = getPublishRunSnapshot(deps.staticPublishPorts);
|
|
239
|
+
if (active.status === "running") {
|
|
240
|
+
trackBlockedToolPublish({ deps, principalId: approvedCtx.principal.id, target, reasonClass: "busy" });
|
|
241
|
+
if (active.jobId === undefined)
|
|
242
|
+
throw new Error("Running static publish has no job ID");
|
|
243
|
+
return { published: false, cancelled: false, code: "ALREADY_RUNNING", jobId: getPublishJobSnapshot({ deps: deps.staticPublishPorts, workspaceId: deps.workspaceId, jobId: active.jobId })?.jobId, message: "A publish is already running. Call deployment_get_static_publish_status with this jobId (or {} for the latest job on this site). Do not start another publish." };
|
|
244
|
+
}
|
|
245
|
+
const job = startPublishRun({
|
|
246
|
+
deps: { ...deps.staticPublishPorts, credentialSource, loadDeployTargets: deployTargetsLoader(deps), ...optionalPublishPorts({ deps }) },
|
|
247
|
+
input: { requestId: approvedCtx.executionId, productEvent: { userId: approvedCtx.principal.id, source: "assistant" }, workspaceId: deps.workspaceId, publishOutputRootDir: deps.publishOutputRootDir, idGen: deps.idGen, exportSiteBound: deps.exportSiteBound, config, projectName,
|
|
248
|
+
...toolCredentialChoice({ raw }) },
|
|
249
|
+
clock: { nowIso: () => clockNowIso({ clock: deps.clock }) },
|
|
250
|
+
historyStore,
|
|
251
|
+
}, { triggeredBy: "agent_tool", onSettled });
|
|
252
|
+
return { published: false, accepted: true, jobId: job.jobId, status: job.status, progress: job.progress,
|
|
253
|
+
message: "Publish started in the background. Call deployment_get_static_publish_status with this jobId in 5 seconds for progress and the final result. Do not publish again while it is running." };
|
|
254
|
+
}
|
|
255
|
+
/** Validates and starts the existing background publish path after approval. The job owns
|
|
256
|
+
* its lifetime; the initiating delegated call can finish or be cancelled independently. */
|
|
257
|
+
export async function executeStaticPublish({ deps, surfaces, credentialSource, historyStore, inputCtx, optional }) {
|
|
258
|
+
// Keep the same detached proposal/actor snapshot the former policy wrapper supplied before
|
|
259
|
+
// any asynchronous registry or permission read; later cards and effects use only this call.
|
|
260
|
+
const ctx = { ...inputCtx, input: structuredClone(inputCtx.input), principal: { ...inputCtx.principal }, run: { ...inputCtx.run } };
|
|
261
|
+
const raw = requireInputRecord({ input: ctx.input });
|
|
262
|
+
const registry = await deployTargetsLoader(deps)({ workspaceId: deps.workspaceId });
|
|
263
|
+
const loaded = requireStaticPublishTarget(raw, registry);
|
|
264
|
+
const target = loaded.descriptor.id;
|
|
265
|
+
const projectName = requireString({ input: raw, key: "projectName" });
|
|
266
|
+
await deps.requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: deps.authorize }), workspaceId: deps.workspaceId, principalId: ctx.principal.id, permission: "deployments.publish" }, { entityType: SITE_PUBLISH_ENTITY });
|
|
267
|
+
const { config, plan } = planToolPublish({ registry, raw, target: loaded });
|
|
268
|
+
if (!plan.ok) {
|
|
269
|
+
trackBlockedToolPublish({ deps, principalId: ctx.principal.id, target, reasonClass: "config" });
|
|
270
|
+
throw new ToolInputError({ message: `deployment_execute_static_publish: ${plan.message}` });
|
|
271
|
+
}
|
|
272
|
+
const consent = await deps.checkToolPublishConsent({ deps, principalId: ctx.principal.id });
|
|
273
|
+
if (consent) {
|
|
274
|
+
trackBlockedToolPublish({ deps, principalId: ctx.principal.id, target, reasonClass: "consent" });
|
|
275
|
+
return { published: false, cancelled: false, ...consent };
|
|
276
|
+
}
|
|
277
|
+
const onSettled = () => {
|
|
278
|
+
const settled = getPublishJobSnapshot({ deps: deps.staticPublishPorts, workspaceId: deps.workspaceId, requestId: ctx.executionId });
|
|
279
|
+
if (settled?.result && optional.emitSurface) {
|
|
280
|
+
const mapped = mapPublishOutcomeToToolResult({ deps, outcome: settled.result, exchange: { id: settled.jobId }, config, detailRows: [], projectName: "" });
|
|
281
|
+
void optional.emitSurface(mapped.outcome).catch(() => deps.staticPublishPorts.warn("[static-publish] result card could not be delivered; read deployment_get_static_publish_status for the result"));
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
if (config.customDomain && loaded.module.preview) {
|
|
285
|
+
return domainPublishTool({ deps, surfaces, credentialSource, historyStore, config, projectName, onSettled,
|
|
286
|
+
...toolCredentialChoice({ raw }) })(ctx, optional);
|
|
287
|
+
}
|
|
288
|
+
// Never decrypts (same `isConfigured()` contract the preview/capabilities handlers use above).
|
|
289
|
+
// Refuse unavailable credentials before starting an export.
|
|
290
|
+
const readiness = await credentialSource.isConfigured({ workspaceId: deps.workspaceId, target, ...toolCredentialChoice({ raw }) });
|
|
291
|
+
if (!readiness.configured) {
|
|
292
|
+
trackBlockedToolPublish({ deps, principalId: ctx.principal.id, target, reasonClass: "config" });
|
|
293
|
+
return {
|
|
294
|
+
published: false,
|
|
295
|
+
cancelled: false,
|
|
296
|
+
reason: "no-credential",
|
|
297
|
+
credentialSetup: deps.issueCredentialSetup({ setupToolId: "credential_save", prefill: { kind: "publish-host", target } }, {}),
|
|
298
|
+
message: `No publish credential is configured for '${target}'. Call credential_save with kind publish-host to open its secure card, then retry once. The admin's Static Site tab is an alternative. (${readiness.reason})`,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
if (ctx.signal.aborted)
|
|
302
|
+
return { published: false, cancelled: false, reason: "abandoned" };
|
|
303
|
+
// This domain owns one approval: the detailed domain plan above, or the ordinary publish
|
|
304
|
+
// card below. A second registration wrapper would ask twice for a domain publication.
|
|
305
|
+
return deps.approvalToolHandler({
|
|
306
|
+
surfaces,
|
|
307
|
+
prepare: async () => deps.toolApprovalConfirmation({ descriptor: { id: 'deployment_execute_static_publish', metadata: toolMetadata.deployment_execute_static_publish, inputSchema: EXECUTE_STATIC_PUBLISH_SCHEMA },
|
|
308
|
+
input: raw, locale: await deps.resolveOperatorLocale({ deps, workspaceId: deps.workspaceId, principalId: ctx.principal.id }) }),
|
|
309
|
+
describe: ({ prepared }, _options = {}) => ({ ...prepared, toolId: 'deployment_execute_static_publish' }),
|
|
310
|
+
run: async ({ ctx: approvedCtx }, _options = {}) => startApprovedStaticPublish({ deps, approvedCtx, target, credentialSource, config, projectName, raw, historyStore, onSettled }),
|
|
311
|
+
}, { flag: 'published' })(ctx, optional);
|
|
312
|
+
}
|
|
313
|
+
//# sourceMappingURL=publish-tool-execution.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** `deployment_execute_static_publish`'s input — {@link PREVIEW_STATIC_PUBLISH_SCHEMA}'s fields plus
|
|
2
|
+
* `projectName`, the one field a real publish needs that a preview does not. Carries only an optional saved connection ID, never a
|
|
3
|
+
* token or usable credential — see this file's header for why that is structural, not just
|
|
4
|
+
* undocumented. */
|
|
5
|
+
export declare const EXECUTE_STATIC_PUBLISH_SCHEMA: {
|
|
6
|
+
readonly type: "object";
|
|
7
|
+
readonly additionalProperties: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
};
|
|
10
|
+
readonly required: readonly ["target", "projectName"];
|
|
11
|
+
readonly properties: {
|
|
12
|
+
readonly projectName: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly title: "Project name";
|
|
15
|
+
readonly description: "Human-facing label for this publish run: the host uses it as the commit message or the project-name seed. 1-200 characters.";
|
|
16
|
+
};
|
|
17
|
+
readonly credentialId: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly title: "Saved connection";
|
|
20
|
+
readonly description: "Optional saved connection chosen by the person; preview and execute use this exact connection.";
|
|
21
|
+
};
|
|
22
|
+
readonly target: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly title: "Hosting provider";
|
|
25
|
+
readonly description: "Which host to publish to: one of the providerId values deployment_get_static_publish_capabilities lists. Pass that host's configFields as top-level string fields next to target (for example { target, <fieldName>: '<value>' }); a field the host does not declare is refused. The base path is computed from the host and the config, never passed in.";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=publish-tool-schema.d.ts.map
|