@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,175 @@
|
|
|
1
|
+
import { deployTargetsLoader } from './publish-tool-execution.js';
|
|
2
|
+
import { requireNoInput } from '@jini-ai/core';
|
|
3
|
+
import { adaptLegacyAuthorize } from '@jini-ai/core';
|
|
4
|
+
import { listPublishCredentials } from './publish-credentials/store.js';
|
|
5
|
+
import {} from './static-publish/verify.js';
|
|
6
|
+
const DEPLOYMENTS_READ_PERMISSION = "deployments.read";
|
|
7
|
+
const SITE_PUBLISH_ENTITY = "site-publish";
|
|
8
|
+
/**
|
|
9
|
+
* Builds `deployment_get_static_publish_capabilities`'s per-provider `guidance` string — extracted
|
|
10
|
+
* from that handler's own `providers.map()` purely for readability (the four cases read as one flat
|
|
11
|
+
* decision this way rather than a nested ternary inline). `undefined` means "nothing to tell the
|
|
12
|
+
* human" (the provider is fully ready).
|
|
13
|
+
*
|
|
14
|
+
* The `"invalid"` and `"unreachable"` branches are deliberately worded differently, per code review:
|
|
15
|
+
* an `"invalid"` credential (the provider affirmatively rejected it) tells the human to fix it;
|
|
16
|
+
* an `"unreachable"` one (a network failure/timeout/5xx during the last check — says NOTHING about
|
|
17
|
+
* whether the credential itself is good) must never suggest replacing a possibly-fine credential
|
|
18
|
+
* over what may have been a transient blip. Collapsing the two into one "update it" message would
|
|
19
|
+
* risk sending someone to regenerate a working token — the same false-negative shape Defect A (this
|
|
20
|
+
* same finding session) was filed for, one layer up.
|
|
21
|
+
*
|
|
22
|
+
* @complexity O(1) — fixed string interpolation, no iteration.
|
|
23
|
+
* @overallScore 100
|
|
24
|
+
*/
|
|
25
|
+
function buildCapabilityGuidance({ providerId, readiness, verification, credentialOrigin }, _options = {}) {
|
|
26
|
+
if (!readiness.configured)
|
|
27
|
+
return readiness.reason;
|
|
28
|
+
if (credentialOrigin === "environment") {
|
|
29
|
+
return `A ${providerId} key is configured on this server (environment). Publish with it; don't ask for or save another key.`;
|
|
30
|
+
}
|
|
31
|
+
if (verification === undefined) {
|
|
32
|
+
return `This ${providerId} credential is saved but has not been verified against ${providerId} yet — verify it in the Static Site tab before relying on it.`;
|
|
33
|
+
}
|
|
34
|
+
if (verification.status === "invalid") {
|
|
35
|
+
return `The saved ${providerId} credential was rejected by ${providerId} (checked ${verification.checkedAt}): ${verification.message} Update it in the Static Site tab.`;
|
|
36
|
+
}
|
|
37
|
+
if (verification.status === "unreachable") {
|
|
38
|
+
return `The last check of this ${providerId} credential could not reach ${providerId} (checked ${verification.checkedAt}): ${verification.message} This does not mean the credential is bad — try verifying again in the Static Site tab.`;
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
/** {@link buildProviderCapability}'s `savedCredentials` entries: no secret, only the token's last 4. */
|
|
43
|
+
function mapSavedCredentials(saved) {
|
|
44
|
+
return saved.map(({ id, label, isDefault, createdAt, updatedAt, tokenTail, tokenHint, credentialType, worksFor }) => ({ id, label, isDefault, createdAt, updatedAt, tokenTail, tokenHint, credentialType, worksFor }));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* {@link buildProviderCapability}'s result-object assembly, split out from the value computation so
|
|
48
|
+
* neither half alone carries every branch in the original 100-line closure. `verifiedAt`/`accountLabel`
|
|
49
|
+
* are the two fields this handler still needs beyond what {@link buildCapabilityGuidance} itself reads.
|
|
50
|
+
*
|
|
51
|
+
* accountLabel prefers the default credential's stored column, healed by post-save verification,
|
|
52
|
+
* and falls back to cached verification only when that column is null (an unhealed or env-only row).
|
|
53
|
+
* Stored identity survives restart while the cache does not, and prevents guessing a GitHub account
|
|
54
|
+
* from the human's email instead of using the verified token's actual account.
|
|
55
|
+
*/
|
|
56
|
+
function buildProviderCapabilityResult(spec, _options = {}) {
|
|
57
|
+
const { descriptor, ready, readiness, verified, verification, defaultCredential, lastPublish, savedCredentials, credentialOrigin, guidance } = spec;
|
|
58
|
+
return {
|
|
59
|
+
providerId: descriptor.id,
|
|
60
|
+
label: descriptor.label,
|
|
61
|
+
// What a publish to this host takes, besides `target` and `projectName`: pass each as a
|
|
62
|
+
// top-level string property of the same name.
|
|
63
|
+
configFields: descriptor.configFields.map(({ name, label, required, help }) => ({ name, label, required, ...(help !== undefined ? { help } : {}) })),
|
|
64
|
+
ready,
|
|
65
|
+
credentialConfigured: readiness.configured,
|
|
66
|
+
credentialOrigin,
|
|
67
|
+
verified,
|
|
68
|
+
verifiedAt: verification?.checkedAt ?? null,
|
|
69
|
+
// The verified credential's own public account login/username, when the host's verifier
|
|
70
|
+
// reports one — `null` when not yet verified, or for a provider whose verifier has no reviewed
|
|
71
|
+
// account field to read (see `verify.ts`'s header).
|
|
72
|
+
accountLabel: defaultCredential?.accountLabel ?? verification?.accountLabel ?? null,
|
|
73
|
+
lastPublish,
|
|
74
|
+
savedCredentials,
|
|
75
|
+
...(guidance !== undefined ? { guidance } : {}),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Computes one provider's `deployment_get_static_publish_capabilities` entry — extracted from that
|
|
80
|
+
* handler's own `PROVIDER_IDS.map()` callback purely to keep this domain's complexity gates: this was
|
|
81
|
+
* previously a single ~100-line inline async arrow.
|
|
82
|
+
*
|
|
83
|
+
* `savedCredentials` include only this host's explicitly compatible keys, with defaults selected
|
|
84
|
+
* after compatibility and token-only shape filtering. `credentialConfigured` comes from
|
|
85
|
+
* `credentialSource.isConfigured` (a saved default, or in self-hosted mode an env var).
|
|
86
|
+
*
|
|
87
|
+
* `ready` means "will actually work," not merely "a credential is saved" (2026-08-16 fix: a saved
|
|
88
|
+
* GitHub token GitHub rejected outright with 401 used to still report `ready: true`) — a credential
|
|
89
|
+
* that is configured but never verified, that failed its last verification, or whose last check could
|
|
90
|
+
* not reach the provider is NOT ready.
|
|
91
|
+
*
|
|
92
|
+
* `verification` is a cached, non-decrypting read only — NEVER `verifyPublishCredential` from here
|
|
93
|
+
* (that decrypts and makes a real provider call; see `static-publish/verify.ts`'s own header for why
|
|
94
|
+
* this handler must never be its caller).
|
|
95
|
+
*/
|
|
96
|
+
async function buildProviderCapability(loaded, ctx) {
|
|
97
|
+
const providerId = loaded.descriptor.id;
|
|
98
|
+
const savedForVendor = ctx.saved.filter(credential => credential.publishHosts.includes(providerId))
|
|
99
|
+
.map(credential => ({ ...credential, isDefault: credential.defaultFor.includes(providerId) }));
|
|
100
|
+
const savedCredentials = mapSavedCredentials(savedForVendor);
|
|
101
|
+
const defaultCredential = savedForVendor.find((credential) => credential.isDefault);
|
|
102
|
+
const readiness = await ctx.credentialSource.isConfigured({ workspaceId: ctx.deps.workspaceId, target: providerId });
|
|
103
|
+
// 2026-08-16, Defect 2: the last successful publish to this provider, if any — see
|
|
104
|
+
// `publish-history.ts`'s own header for the storage design. `null` means never published (from
|
|
105
|
+
// this server, in this history store) rather than an absent key, so an agent-facing JSON result
|
|
106
|
+
// always carries the field.
|
|
107
|
+
const lastPublish = await ctx.historyStore.getLast({ workspaceId: ctx.deps.workspaceId, target: providerId });
|
|
108
|
+
const verification = readiness.configured ? ctx.deps.publishCredentialVerificationCache.get({ workspaceId: ctx.deps.workspaceId, target: providerId, basis: readiness.basis }) : undefined;
|
|
109
|
+
const verified = verification ? verification.status : null;
|
|
110
|
+
const ready = readiness.configured && verified === "valid";
|
|
111
|
+
const fallbackOrigin = readiness.configured ? "environment" : null;
|
|
112
|
+
const credentialOrigin = savedCredentials.length ? "saved" : fallbackOrigin;
|
|
113
|
+
const guidance = buildCapabilityGuidance({ providerId, readiness, verification, credentialOrigin });
|
|
114
|
+
return { ...buildProviderCapabilityResult({ descriptor: loaded.descriptor, ready, readiness, verified, verification, defaultCredential, lastPublish, savedCredentials, credentialOrigin, guidance }),
|
|
115
|
+
defaultForNewDestination: loaded.module.defaultForNewDestination === true,
|
|
116
|
+
authenticatedPreview: loaded.module.preview !== undefined };
|
|
117
|
+
}
|
|
118
|
+
/** Preserve enabled-host readiness while exposing disabled/unknown hosts without claiming their
|
|
119
|
+
* credentials were inspected. Only activation permits executable use; loader refusals remain visible.
|
|
120
|
+
* @returns One host choice with explicit installation, activation and readiness states.
|
|
121
|
+
* @complexity O(1) metadata; enabled hosts delegate to the existing credential/history read model.
|
|
122
|
+
*/
|
|
123
|
+
async function buildInstalledProviderCapability({ installed, registry, context }, _optional = {}) {
|
|
124
|
+
const loaded = registry.get(installed.descriptor.id);
|
|
125
|
+
const identity = { pluginId: installed.pluginId, enabled: installed.enabled };
|
|
126
|
+
if (installed.enabled === true && loaded?.pluginId === installed.pluginId) {
|
|
127
|
+
return { ...await buildProviderCapability(loaded, context), ...identity, executable: true };
|
|
128
|
+
}
|
|
129
|
+
return { providerId: installed.descriptor.id, label: installed.descriptor.label, ...identity,
|
|
130
|
+
executable: false, ready: false, credentialConfigured: null, savedCredentials: null,
|
|
131
|
+
guidance: installed.enabled === true
|
|
132
|
+
? "The hosting plugin is enabled but its target could not be loaded. Inspect refusals before publishing."
|
|
133
|
+
: `Turn on Agent Plugin '${installed.pluginId}' under Admin → Agent Plugins, then call deployment_get_static_publish_capabilities again. Credentials and readiness have not been inspected for this host.` };
|
|
134
|
+
}
|
|
135
|
+
function hostsMissingSavedKey({ providers, installed }, _options = {}) {
|
|
136
|
+
return providers.filter(provider => !provider.savedCredentials?.length).map(provider => {
|
|
137
|
+
if (provider.executable)
|
|
138
|
+
return { id: provider.providerId, worksForIds: [] };
|
|
139
|
+
const vendorId = installed.find(item => item.descriptor.id === provider.providerId)?.descriptor.credential?.vendorId;
|
|
140
|
+
return { id: provider.providerId, worksForIds: [provider.providerId, vendorId].filter((id) => !!id).map(id => id.toLowerCase()) };
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Never decrypts — reads through `listPublishCredentials` (a pure DB read of
|
|
145
|
+
* `vendor_credential_sets`; see its own "read model only" doc) and `credentialSource.isConfigured`
|
|
146
|
+
* (this file's own preview handler already relies on the identical never-decrypting contract).
|
|
147
|
+
* Structurally cannot reach `resolveForPublish`/`resolveDefaultForPublish`: this handler never
|
|
148
|
+
* hands them a `SecretSealerPort`. `tokenTail` is the stored last 4 characters, never derived by
|
|
149
|
+
* decrypting.
|
|
150
|
+
*/
|
|
151
|
+
export async function getStaticPublishCapabilities({ deps, credentialSource, historyStore, ctx }) {
|
|
152
|
+
requireNoInput({ input: ctx.input });
|
|
153
|
+
await deps.requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: deps.authorize }), workspaceId: deps.workspaceId, principalId: ctx.principal.id, permission: DEPLOYMENTS_READ_PERMISSION }, { entityType: SITE_PUBLISH_ENTITY });
|
|
154
|
+
const loadDeployTargets = deployTargetsLoader(deps);
|
|
155
|
+
// Owner policy: unseal only server-side to derive the safe hint.
|
|
156
|
+
// Readiness still uses isConfigured(); no usable credential or provider probe reaches this result.
|
|
157
|
+
const saved = await listPublishCredentials({ ...deps.credentialStorePorts, repo: deps.vendorCredentialSetRepo, sealer: deps.siteAssistantSecretSealer, loadDeployTargets }, {
|
|
158
|
+
workspaceId: deps.workspaceId,
|
|
159
|
+
});
|
|
160
|
+
const registry = await loadDeployTargets({ workspaceId: deps.workspaceId });
|
|
161
|
+
const providerCapabilityContext = { deps, credentialSource, historyStore, saved };
|
|
162
|
+
const inventory = deps.loadInstalledDeployTargets
|
|
163
|
+
? await deps.loadInstalledDeployTargets({ workspaceId: deps.workspaceId })
|
|
164
|
+
: { items: registry.list().map(({ descriptor, pluginId }) => ({ descriptor, pluginId, enabled: true })), refusals: [] };
|
|
165
|
+
const providers = await Promise.all(inventory.items.map(installed => buildInstalledProviderCapability({ installed, registry, context: providerCapabilityContext })));
|
|
166
|
+
const refusals = [...new Set([...inventory.refusals, ...registry.refusals])];
|
|
167
|
+
const missing = hostsMissingSavedKey({ providers, installed: inventory.items });
|
|
168
|
+
if (missing.length)
|
|
169
|
+
return { executionMode: deps.publishExecutionMode, providers, refusals,
|
|
170
|
+
credentialSetup: deps.vendorCredentialSetRepo.project
|
|
171
|
+
? { toolId: "credential_copy_from_project", message: "Use a saved key to choose from Shared Keys, or enter a new key in the secure card." }
|
|
172
|
+
: { toolId: "credential_save", kind: "publish-host", message: "Open the secure key card to save a publishing key for this site." } };
|
|
173
|
+
return { executionMode: deps.publishExecutionMode, providers, refusals };
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=publish-tool-capabilities.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type ToolHandler } 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 { DeployTargetDescriptor } from './deploy-targets/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* The agent's non-secret credential-field values (form pre-fill, or hosting-setup input). Refuses a
|
|
7
|
+
* secret field, so a secret can never come from the chat, and a field the host does not declare. A
|
|
8
|
+
* blank value is left out.
|
|
9
|
+
*
|
|
10
|
+
* @throws {ToolInputError} naming the first refused key.
|
|
11
|
+
* @complexity O(k·f) input keys by credential fields.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readCredentialHints({ raw, descriptor, deps }: {
|
|
14
|
+
raw: Record<string, unknown>;
|
|
15
|
+
descriptor: DeployTargetDescriptor;
|
|
16
|
+
deps: StaticPublishToolDeps;
|
|
17
|
+
}, _optional?: Record<string, never>): Record<string, string>;
|
|
18
|
+
/**
|
|
19
|
+
* Builds this domain's `ToolRegistration[]` — the same shape every other domain's
|
|
20
|
+
* `build<Domain>Registrations` produces (see e.g. `recovery/tool-registrations.ts`'s
|
|
21
|
+
* `buildRecoveryRegistrations`). Called by `assistant/tool-registrations.ts`, which imports
|
|
22
|
+
* `buildStaticPublishRegistrations`/`staticPublishDerivedRisk` from this file and lists them as
|
|
23
|
+
* their own `"static-publish"` entry in `DOMAIN_SLICES` — see that file's own comment on that entry
|
|
24
|
+
* for why static-publish stays a separate slice rather than folding into this directory's sibling
|
|
25
|
+
* `deployments`/`agent-tools.ts` slice.
|
|
26
|
+
*
|
|
27
|
+
* @param deps - `StaticPublishToolDeps` plus this file's own test-only overrides (`credentialSource`,
|
|
28
|
+
* `buildTarget`). `credentialSource` defaults to the same DB-first, env-fallback-only-in-
|
|
29
|
+
* `"self-hosted-cli"`-mode composition `publish-site.ts`'s route constructs.
|
|
30
|
+
* @param surfaces - The held-open confirmation exchange store `deployment_execute_static_publish`
|
|
31
|
+
* parks on — see this file's header. Required, matching `buildPostRegistrations`' own shape (the
|
|
32
|
+
* other domain whose gate needs this), since a domain with no store at all could never wire this
|
|
33
|
+
* tool's gate at all.
|
|
34
|
+
* @complexity O(1) registration-time cost; each wired handler's own cost is documented at its call
|
|
35
|
+
* site above (preview/capabilities: O(1) plus the provider count; execute: one `exportSite` pass
|
|
36
|
+
* plus one provider API call, only after a human confirms).
|
|
37
|
+
*/
|
|
38
|
+
/** Bind publish credential saving to its existing descriptor, permission and sealed-store owner.
|
|
39
|
+
* @param required - Existing publish dependencies and shared surface exchanges.
|
|
40
|
+
* @returns An internal save adapter, never a retired tool registration.
|
|
41
|
+
* @example buildPublishHostCredentialHandler({ deps, surfaces });
|
|
42
|
+
* @complexity O(1) binding; invocation reads the provider registry and saved credential summaries.
|
|
43
|
+
*/
|
|
44
|
+
export declare function buildPublishHostCredentialHandler({ deps, surfaces }: {
|
|
45
|
+
deps: StaticPublishToolDeps;
|
|
46
|
+
surfaces: AssistantSurfaceDeps;
|
|
47
|
+
}, _optional?: {}): ToolHandler;
|
|
48
|
+
//# sourceMappingURL=publish-tool-credential.d.ts.map
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { PublishCredentialValidationError } from './publish-credentials/store-validation.js';
|
|
2
|
+
import { deployTargetsLoader, requireStaticPublishTarget } from './publish-tool-execution.js';
|
|
3
|
+
import { ToolInputError, requireInputRecord } from '@jini-ai/core';
|
|
4
|
+
import { adaptLegacyAuthorize } from '@jini-ai/core';
|
|
5
|
+
import { nowIso as clockNowIso } from '@jini-ai/core/primitives';
|
|
6
|
+
import { PublishCredentialDuplicateLabelError, listPublishCredentials, createPublishCredential, updatePublishCredential } from './publish-credentials/store.js';
|
|
7
|
+
import { verifyPublishCredentialById, verifySubmittedPublishCredential } from './static-publish/verify.js';
|
|
8
|
+
const SITE_PUBLISH_ENTITY = "site-publish";
|
|
9
|
+
/** The host whose credential the propose-credential tool saves: it must be loaded and declare one.
|
|
10
|
+
* @throws {ToolInputError} unknown host, or a host that takes no saved credential.
|
|
11
|
+
* @complexity O(1) — one registry lookup. */
|
|
12
|
+
function requireCredentialTarget(raw, registry) {
|
|
13
|
+
const { descriptor } = requireStaticPublishTarget(raw, registry);
|
|
14
|
+
if (descriptor.credential === undefined)
|
|
15
|
+
throw new ToolInputError({ message: `${descriptor.id} takes no saved credential.` });
|
|
16
|
+
return { descriptor, credential: descriptor.credential };
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The agent's non-secret credential-field values (form pre-fill, or hosting-setup input). Refuses a
|
|
20
|
+
* secret field, so a secret can never come from the chat, and a field the host does not declare. A
|
|
21
|
+
* blank value is left out.
|
|
22
|
+
*
|
|
23
|
+
* @throws {ToolInputError} naming the first refused key.
|
|
24
|
+
* @complexity O(k·f) input keys by credential fields.
|
|
25
|
+
*/
|
|
26
|
+
export function readCredentialHints({ raw, descriptor, deps }, _optional = {}) {
|
|
27
|
+
const fields = descriptor.credential?.fields ?? [];
|
|
28
|
+
const hints = {};
|
|
29
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
30
|
+
if (key === "target")
|
|
31
|
+
continue;
|
|
32
|
+
const field = fields.find((candidate) => candidate.name === key);
|
|
33
|
+
if (field === undefined) {
|
|
34
|
+
const takes = fields.length > 0 ? `It takes: ${fields.map((candidate) => candidate.name).join(", ")}.` : "It takes none.";
|
|
35
|
+
throw new ToolInputError({ message: `'${key}' is not a credential field of ${descriptor.id}. ${takes}` });
|
|
36
|
+
}
|
|
37
|
+
const hint = readCredentialHint({ deps, key, value, field, tokenField: descriptor.credential?.tokenField });
|
|
38
|
+
if (hint.trim() !== "")
|
|
39
|
+
hints[key] = hint;
|
|
40
|
+
}
|
|
41
|
+
return hints;
|
|
42
|
+
}
|
|
43
|
+
/** Validate a declared chat hint before allowing it into a credential form. */
|
|
44
|
+
function readCredentialHint({ deps, key, value, field, tokenField }, _options = {}) {
|
|
45
|
+
if (field.secret === true || key === tokenField)
|
|
46
|
+
throw new ToolInputError({ message: `'${key}' is secret: the person types it into the form, never into the chat.` });
|
|
47
|
+
if (typeof value !== "string")
|
|
48
|
+
throw new ToolInputError({ message: `'${key}' must be a string.` });
|
|
49
|
+
deps.assertCredentialFreeField({ value, field: key });
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
/** The propose-credential form, built from the host's credential spec. Posts back on cancel rather
|
|
53
|
+
* than closing silently: with the call parked, a silent close would strand the handler for the full
|
|
54
|
+
* TTL. */
|
|
55
|
+
function buildProposeCredentialForm(required, _optional = {}) {
|
|
56
|
+
const { deps, descriptor, credential, prefill, updating } = required;
|
|
57
|
+
return {
|
|
58
|
+
title: `Connect ${descriptor.label}`,
|
|
59
|
+
...(credential.help !== undefined ? { description: credential.help } : {}),
|
|
60
|
+
submitLabel: "Save connection",
|
|
61
|
+
fields: credential.fields.flatMap((field) => {
|
|
62
|
+
const base = { kind: "string", name: field.name, label: field.label,
|
|
63
|
+
...(field.help !== undefined ? { hint: field.help } : {}), required: field.required };
|
|
64
|
+
if (field.secret === true || field.name === credential.tokenField) {
|
|
65
|
+
// The store keeps exact blank secrets on update; the form must permit that submission too.
|
|
66
|
+
const secret = { ...base, secret: true, required: updating ? false : field.required, allowBlank: updating || !field.required };
|
|
67
|
+
if (updating && !field.required && field.name !== credential.tokenField) {
|
|
68
|
+
return [secret, { kind: "boolean", name: `clear-${field.name}`, label: `Remove ${field.label}`, value: false,
|
|
69
|
+
hint: "Remove the saved value when this connection is saved. Leave unchecked to keep or replace it." }];
|
|
70
|
+
}
|
|
71
|
+
return [secret];
|
|
72
|
+
}
|
|
73
|
+
return [{ ...base, ...(prefill[field.name] !== undefined ? { value: prefill[field.name] } : {}) }];
|
|
74
|
+
}),
|
|
75
|
+
...(deps.credentialFormApp === undefined ? {} : { app: deps.credentialFormApp }),
|
|
76
|
+
preferredFrameSize: ["100%", "560px"],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/** Only declared host fields enter the persisted connection; blank secrets keep their prior value. */
|
|
80
|
+
function publishConnectionValues({ targetId, credential, values }, _optional = {}) {
|
|
81
|
+
const connection = { providerId: targetId };
|
|
82
|
+
for (const field of credential.fields) {
|
|
83
|
+
// The form submits a blank optional secret as ""; omitted, the store reads it as not provided
|
|
84
|
+
// on create and keeps the stored one on update.
|
|
85
|
+
const blankOptionalSecret = values[field.name] === "" && field.secret === true && !field.required;
|
|
86
|
+
// The explicit remove choice wins over typed text; blank alone still keeps the saved secret.
|
|
87
|
+
if (values[`clear-${field.name}`] === true) {
|
|
88
|
+
connection[field.name] = null;
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (typeof values[field.name] === "string" && !blankOptionalSecret)
|
|
92
|
+
connection[field.name] = values[field.name];
|
|
93
|
+
}
|
|
94
|
+
return connection;
|
|
95
|
+
}
|
|
96
|
+
/** An explicit default wins; a sole visible row is also an unambiguous update target. */
|
|
97
|
+
function publishCredentialToUpdate({ rows, targetId }, _optional = {}) {
|
|
98
|
+
const candidates = rows.filter(row => row.providerId === targetId);
|
|
99
|
+
return candidates.find(row => row.isDefault) ?? (candidates.length === 1 ? candidates[0] : undefined);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Saves the submitted form as the host's connection: updates its default or sole visible row,
|
|
103
|
+
* otherwise creates a distinct project key. Only the host's declared
|
|
104
|
+
* fields are forwarded; `publish-credentials/store.ts` is the one place that decides what is valid
|
|
105
|
+
* (the form ships `novalidate`, so this is the real enforcement point). Its messages name fields,
|
|
106
|
+
* never values.
|
|
107
|
+
*
|
|
108
|
+
* @complexity O(n) in the workspace's saved credential count.
|
|
109
|
+
*/
|
|
110
|
+
async function saveProposedCredential(required, _optional = {}) {
|
|
111
|
+
const { deps, targetId, credential, values, signal } = required;
|
|
112
|
+
const connection = publishConnectionValues({ targetId, credential, values });
|
|
113
|
+
const repo = deps.abortGuardedCredentialRepo({ store: deps.vendorCredentialSetRepo, signal });
|
|
114
|
+
const writeDeps = {
|
|
115
|
+
...deps.credentialStorePorts,
|
|
116
|
+
repo,
|
|
117
|
+
// Only this submitted secret card receives the trusted, grant-checked replacement port.
|
|
118
|
+
allowSharedKeyReplacement: true,
|
|
119
|
+
loadDeployTargets: deployTargetsLoader(deps),
|
|
120
|
+
sealer: deps.siteAssistantSecretSealer,
|
|
121
|
+
keyring: deps.siteAssistantSecretKeyring,
|
|
122
|
+
clock: deps.clock,
|
|
123
|
+
idGen: deps.idGen,
|
|
124
|
+
};
|
|
125
|
+
const saved = await listPublishCredentials(writeDeps, { workspaceId: deps.workspaceId });
|
|
126
|
+
const existing = publishCredentialToUpdate({ rows: saved, targetId });
|
|
127
|
+
// A failed replacement check must leave the working default key intact, before any seal/write.
|
|
128
|
+
if (existing)
|
|
129
|
+
await checkPublishReplacement({ deps, targetId, credential, connection });
|
|
130
|
+
// Cancellation may arrive during the metadata read or probe; refuse before invoking persistence.
|
|
131
|
+
signal.throwIfAborted();
|
|
132
|
+
const stored = existing
|
|
133
|
+
? await updatePublishCredential(writeDeps, { workspaceId: deps.workspaceId, id: existing.id, connection })
|
|
134
|
+
: await createPublishCredential(writeDeps, { workspaceId: deps.workspaceId, label: `${deps.credentialRowLabel}-${deps.idGen.newId()}`, connection,
|
|
135
|
+
// New project keys stay non-default while the shared save-result path attaches them to this site.
|
|
136
|
+
...(deps.vendorCredentialSetRepo.project ? { isDefault: false } : {}) });
|
|
137
|
+
return { credentialId: stored.id, tokenHint: stored.tokenHint ?? null, usedByThisSite: existing !== undefined || stored.scope !== "project" };
|
|
138
|
+
}
|
|
139
|
+
/** Reuse the provider-owned verifier only where replacement would destroy an existing key.
|
|
140
|
+
* @throws PublishCredentialValidationError with fixed copy on refusal/unavailability; preserves legacy hosts without checks.
|
|
141
|
+
* @complexity One registry lookup/load plus one bounded provider check, no persistence.
|
|
142
|
+
*/
|
|
143
|
+
async function checkPublishReplacement({ deps, targetId, credential, connection }, _options = {}) {
|
|
144
|
+
// A blank secret keeps the stored one (store.ts updatedConnection), so no working key is replaced.
|
|
145
|
+
// A blank OPTIONAL secret is no reason to skip checking a replaced token.
|
|
146
|
+
if (credential.fields.some(field => (field.secret === true && field.required || field.name === credential.tokenField) && !connection[field.name]))
|
|
147
|
+
return;
|
|
148
|
+
const registry = await deployTargetsLoader(deps)({ workspaceId: deps.workspaceId });
|
|
149
|
+
if (!registry.get(targetId)?.module.verifyCredential)
|
|
150
|
+
return;
|
|
151
|
+
const verification = await verifySubmittedPublishCredential({
|
|
152
|
+
deps: { ...deps.verificationPorts, loadDeployTargets: async () => registry, clock: { nowIso: () => clockNowIso({ clock: deps.clock }) },
|
|
153
|
+
...(deps.fetchFn === undefined ? {} : { fetchFn: deps.fetchFn }), ...(deps.observability === undefined ? {} : { observability: deps.observability }) },
|
|
154
|
+
workspaceId: deps.workspaceId, target: targetId, spec: credential,
|
|
155
|
+
connection: connection,
|
|
156
|
+
});
|
|
157
|
+
if (verification.status === 'valid')
|
|
158
|
+
return;
|
|
159
|
+
throw new PublishCredentialValidationError(verification.status === 'invalid'
|
|
160
|
+
? 'This key was refused for this purpose. Nothing was saved. The previous key was kept.'
|
|
161
|
+
: "The service couldn't be reached. Nothing was saved. The previous key was kept.");
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* `deployment_propose_custom_provider_credential`'s domain save and post-save probe — kept separate
|
|
165
|
+
* so their cost is measured independently of the engine's exchange lifecycle.
|
|
166
|
+
* @complexity One existing credential write plus an optional provider verification.
|
|
167
|
+
*/
|
|
168
|
+
async function saveProposeCredential(required, _optional = {}) {
|
|
169
|
+
const { deps, targetId, locale } = required;
|
|
170
|
+
const saveResult = await saveProposedCredential(required);
|
|
171
|
+
// NEVER echoes a field value, secret or not. Owner 2026-10-07: the submitted human card
|
|
172
|
+
// now authorizes the same post-save read-only check as the admin form. Model-only reads stay probe-free.
|
|
173
|
+
let connection = 'saved';
|
|
174
|
+
try {
|
|
175
|
+
const registry = await deployTargetsLoader(deps)({ workspaceId: deps.workspaceId });
|
|
176
|
+
if (saveResult.usedByThisSite && registry.get(targetId)?.module.verifyCredential) {
|
|
177
|
+
const verification = await verifyPublishCredentialById({
|
|
178
|
+
...deps.verificationPorts, ...deps.credentialSourceStorePorts, repo: deps.vendorCredentialSetRepo, sealer: deps.siteAssistantSecretSealer,
|
|
179
|
+
cache: deps.publishCredentialVerificationCache, clock: { nowIso: () => clockNowIso({ clock: deps.clock }) },
|
|
180
|
+
loadDeployTargets: deployTargetsLoader(deps),
|
|
181
|
+
...(deps.observability === undefined ? {} : { observability: deps.observability }), ...(deps.fetchFn === undefined ? {} : { fetchFn: deps.fetchFn }),
|
|
182
|
+
}, { workspaceId: deps.workspaceId, id: saveResult.credentialId });
|
|
183
|
+
connection = credentialConnectionStatus({ verification, deps });
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
catch {
|
|
187
|
+
connection = 'unreachable';
|
|
188
|
+
}
|
|
189
|
+
const hint = deps.formatCredentialHint({ hint: saveResult.tokenHint, locale });
|
|
190
|
+
return { saved: true, credentialId: saveResult.credentialId, providerId: targetId, connected: connection === 'connected', connection,
|
|
191
|
+
tokenHint: saveResult.tokenHint, message: `${hint ? hint + '. ' : ''}${deps.credentialText({ id: connection, locale })}` };
|
|
192
|
+
}
|
|
193
|
+
/** Translate verification into the credential card's existing connection vocabulary. */
|
|
194
|
+
function credentialConnectionStatus({ verification, deps }, _options = {}) {
|
|
195
|
+
if (verification?.status === 'valid')
|
|
196
|
+
return 'connected';
|
|
197
|
+
if (verification?.status === 'invalid')
|
|
198
|
+
return 'auth';
|
|
199
|
+
return verification?.message === deps.credentialText({ id: 'timeout' }) ? 'timeout' : 'unreachable';
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Builds this domain's `ToolRegistration[]` — the same shape every other domain's
|
|
203
|
+
* `build<Domain>Registrations` produces (see e.g. `recovery/tool-registrations.ts`'s
|
|
204
|
+
* `buildRecoveryRegistrations`). Called by `assistant/tool-registrations.ts`, which imports
|
|
205
|
+
* `buildStaticPublishRegistrations`/`staticPublishDerivedRisk` from this file and lists them as
|
|
206
|
+
* their own `"static-publish"` entry in `DOMAIN_SLICES` — see that file's own comment on that entry
|
|
207
|
+
* for why static-publish stays a separate slice rather than folding into this directory's sibling
|
|
208
|
+
* `deployments`/`agent-tools.ts` slice.
|
|
209
|
+
*
|
|
210
|
+
* @param deps - `StaticPublishToolDeps` plus this file's own test-only overrides (`credentialSource`,
|
|
211
|
+
* `buildTarget`). `credentialSource` defaults to the same DB-first, env-fallback-only-in-
|
|
212
|
+
* `"self-hosted-cli"`-mode composition `publish-site.ts`'s route constructs.
|
|
213
|
+
* @param surfaces - The held-open confirmation exchange store `deployment_execute_static_publish`
|
|
214
|
+
* parks on — see this file's header. Required, matching `buildPostRegistrations`' own shape (the
|
|
215
|
+
* other domain whose gate needs this), since a domain with no store at all could never wire this
|
|
216
|
+
* tool's gate at all.
|
|
217
|
+
* @complexity O(1) registration-time cost; each wired handler's own cost is documented at its call
|
|
218
|
+
* site above (preview/capabilities: O(1) plus the provider count; execute: one `exportSite` pass
|
|
219
|
+
* plus one provider API call, only after a human confirms).
|
|
220
|
+
*/
|
|
221
|
+
/** Bind publish credential saving to its existing descriptor, permission and sealed-store owner.
|
|
222
|
+
* @param required - Existing publish dependencies and shared surface exchanges.
|
|
223
|
+
* @returns An internal save adapter, never a retired tool registration.
|
|
224
|
+
* @example buildPublishHostCredentialHandler({ deps, surfaces });
|
|
225
|
+
* @complexity O(1) binding; invocation reads the provider registry and saved credential summaries.
|
|
226
|
+
*/
|
|
227
|
+
export function buildPublishHostCredentialHandler({ deps, surfaces }, _optional = {}) {
|
|
228
|
+
return async (ctx, optional = {}) => {
|
|
229
|
+
const raw = requireInputRecord({ input: ctx.input });
|
|
230
|
+
const { descriptor, credential } = requireCredentialTarget(raw, await deployTargetsLoader(deps)({ workspaceId: deps.workspaceId }));
|
|
231
|
+
const prefill = readCredentialHints({ raw, descriptor, deps });
|
|
232
|
+
await deps.requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: deps.authorize }), workspaceId: deps.workspaceId, principalId: ctx.principal.id, permission: "deployments.credentials.write" }, { entityType: SITE_PUBLISH_ENTITY });
|
|
233
|
+
// Fail closed rather than degrade — identical posture to the execute-publish guard above.
|
|
234
|
+
// The engine supplies a ToolInputError so the refusal remains caller-safe through transport.
|
|
235
|
+
const stored = await listPublishCredentials({ ...deps.credentialStorePorts, repo: deps.vendorCredentialSetRepo, loadDeployTargets: deployTargetsLoader(deps) }, { workspaceId: deps.workspaceId });
|
|
236
|
+
const updating = publishCredentialToUpdate({ rows: stored, targetId: descriptor.id }) !== undefined;
|
|
237
|
+
const locale = await deps.resolveOperatorLocale({ deps, workspaceId: deps.workspaceId, principalId: ctx.principal.id });
|
|
238
|
+
const pluginCard = await deps.findPluginCredentialCard({ loadCards: deps.loadPluginCredentialCards, workspaceId: deps.workspaceId, saveKind: 'publish-host', target: descriptor.id });
|
|
239
|
+
const card = deps.defineSecretCardTool({
|
|
240
|
+
toolId: deps.credentialSaveToolId,
|
|
241
|
+
prepare: async () => ({ descriptor, credential, prefill, updating, locale }),
|
|
242
|
+
// New project keys need explicit attachment; an update changes the saved row where it lives.
|
|
243
|
+
form: ({ prep }) => deps.applyPluginCredentialCard({ ...(pluginCard === undefined ? {} : { card: pluginCard }), form: buildProposeCredentialForm({ ...prep, deps }) }),
|
|
244
|
+
save: ({ values, prep, signal }) => saveProposeCredential({ deps, targetId: prep.descriptor.id, credential: prep.credential, values, signal, locale: prep.locale }),
|
|
245
|
+
result: ({ prep, run }) => {
|
|
246
|
+
if (run.status === 'saved')
|
|
247
|
+
return run.saved;
|
|
248
|
+
if (run.status === 'cancelled')
|
|
249
|
+
return { saved: false, cancelled: true };
|
|
250
|
+
if (run.status === 'blank' || run.status === 'failed')
|
|
251
|
+
return { saved: false, cancelled: false, reason: 'invalid',
|
|
252
|
+
message: run.status === 'blank' ? deps.credentialText({ id: 'blank', locale: prep.locale }) : run.safeMessage };
|
|
253
|
+
return { saved: false, cancelled: false, reason: run.status,
|
|
254
|
+
note: run.status === 'expired' ? "The user did not respond to the credential form before it expired. Nothing was saved." : "The credential form was closed because the run ended. Nothing was saved." };
|
|
255
|
+
},
|
|
256
|
+
outcome: ({ prep, run }) => {
|
|
257
|
+
if (run.status === 'cancelled' || run.status === 'expired' || run.status === 'abandoned')
|
|
258
|
+
return undefined;
|
|
259
|
+
const saved = run.status === 'saved';
|
|
260
|
+
let message;
|
|
261
|
+
if (run.status === 'saved')
|
|
262
|
+
message = run.saved.message;
|
|
263
|
+
else if (run.status === 'blank')
|
|
264
|
+
message = deps.credentialText({ id: 'blank', locale: prep.locale });
|
|
265
|
+
else if (run.status === 'failed')
|
|
266
|
+
message = run.safeMessage;
|
|
267
|
+
else
|
|
268
|
+
message = deps.credentialText({ id: 'unreachable', locale: prep.locale });
|
|
269
|
+
return { title: deps.credentialText({ id: saved ? 'savedTitle' : 'unreachable', locale: prep.locale }), state: saved ? 'success' : 'failure', message };
|
|
270
|
+
},
|
|
271
|
+
}, {
|
|
272
|
+
...deps.secretCardOptions,
|
|
273
|
+
text: { ...deps.secretCardOptions.text, saveFailure: deps.credentialText({ id: 'unreachable', locale }) },
|
|
274
|
+
safeError: err => {
|
|
275
|
+
if (err instanceof PublishCredentialDuplicateLabelError)
|
|
276
|
+
return err.message;
|
|
277
|
+
return err instanceof PublishCredentialValidationError ? deps.translateCredentialMessage({ message: err.message, locale }) : undefined;
|
|
278
|
+
},
|
|
279
|
+
logFailure: metadata => deps.staticPublishPorts.warn(JSON.stringify(metadata)),
|
|
280
|
+
});
|
|
281
|
+
return card.handler({ surfaceExchanges: surfaces.surfaceExchanges, askThenReport: deps.askThenReport })(ctx, optional);
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=publish-tool-credential.js.map
|