@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,204 @@
|
|
|
1
|
+
import { ToolInputError, buildDomainRegistrations, indexCatalogById, requireInputRecord } from "@jini-ai/core";
|
|
2
|
+
import { adaptLegacyAuthorize, requireToolPermission } from "@jini-ai/core";
|
|
3
|
+
import { toolMetadata } from "@jini-ai/core/tool-metadata/domain-dns";
|
|
4
|
+
import { domainDnsInstructions, planDomainDns, verifyDomainDns } from "./dns-changes.js";
|
|
5
|
+
import { buildDomainDnsRegistrations, domainDnsDerivedRisk, toolInputPublicNames } from "./tools.js";
|
|
6
|
+
import { mailDnsRecordStatus } from "./mail-dns-status.js";
|
|
7
|
+
import { buildMailDnsRegistrations, mailDnsDerivedRisk } from "./mail-dns-tools.js";
|
|
8
|
+
const RECORD_TYPES = ["A", "AAAA", "CNAME", "TXT", "MX", "CAA", "NS", "SRV"];
|
|
9
|
+
const PURPOSES = ["site", "mail", "tls"];
|
|
10
|
+
const hostnameSchema = { type: "string", minLength: 1, maxLength: 254, description: "The site or mail hostname, such as example.com or www.example.com; no URL, IP, port, or path." };
|
|
11
|
+
const requirementsSchema = {
|
|
12
|
+
type: "array", minItems: 1, maxItems: 10,
|
|
13
|
+
description: "Records the hosting or mail provider asked for. Omit to use the requirements saved for this hostname by an earlier dns_verify.",
|
|
14
|
+
items: {
|
|
15
|
+
type: "object", additionalProperties: false, required: ["purpose", "records"],
|
|
16
|
+
properties: {
|
|
17
|
+
purpose: { type: "string", enum: [...PURPOSES] },
|
|
18
|
+
domain: { type: "string", maxLength: 254, description: "Defaults to the hostname." },
|
|
19
|
+
providerId: { type: "string", maxLength: 64, description: "Who needs the records, e.g. a mail or hosting provider id." },
|
|
20
|
+
caa: { type: "object", additionalProperties: false, required: ["issuer"], properties: { issuer: { type: "string", minLength: 1, maxLength: 253, description: "CA that will issue the certificate, e.g. letsencrypt.org." } } },
|
|
21
|
+
records: {
|
|
22
|
+
type: "array", minItems: 1, maxItems: 50,
|
|
23
|
+
items: {
|
|
24
|
+
type: "object", additionalProperties: false, required: ["type", "name", "value"],
|
|
25
|
+
properties: {
|
|
26
|
+
type: { type: "string", enum: [...RECORD_TYPES] },
|
|
27
|
+
name: { type: "string", minLength: 1, maxLength: 254, description: "Fully-qualified record name, e.g. send.example.com or _dmarc.example.com." },
|
|
28
|
+
value: { type: "string", minLength: 1, maxLength: 4096 },
|
|
29
|
+
ttl: { type: "integer", minimum: 60, maximum: 86400 },
|
|
30
|
+
priority: { type: "integer", minimum: 0, maximum: 65535 },
|
|
31
|
+
note: { type: "string", maxLength: 200 },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
const INCLUDES = ["mail"];
|
|
39
|
+
const includeSchema = {
|
|
40
|
+
type: "array", minItems: 1, maxItems: 1, uniqueItems: true, items: { type: "string", enum: [...INCLUDES] },
|
|
41
|
+
description: "Add records from this site's own configuration: [\"mail\"] adds what the active transactional mail provider needs for the sender domain (SPF merged into any existing SPF; a monitoring-only DMARC only when none exists). Replaces an earlier copy of those records.",
|
|
42
|
+
};
|
|
43
|
+
const inputSchema = { type: "object", additionalProperties: false, required: ["hostname"], properties: { hostname: hostnameSchema, requirements: requirementsSchema, include: includeSchema } };
|
|
44
|
+
export const dnsChangeAgentToolCatalog = [
|
|
45
|
+
{
|
|
46
|
+
name: "dns_plan",
|
|
47
|
+
description: "Plans the DNS record changes a hostname needs for its site or mail provider: finds the zone, checks its nameserver delegation, reads the current records from the zone's own nameservers, and returns {hostname, providerId, zone, delegation, inventory, changes, preserved, blockers, fingerprint}. Preserves existing mail, TXT, CAA and unrelated records; merges SPF instead of adding a second one; blocks on unreadable records, CNAME conflicts, apex CNAMEs and CAA that excludes the certificate issuer. Pass requirements (the records a provider asked for), include [\"mail\"] for the site's mail provider, or reuse the ones saved by dns_verify. Read-only: it never changes DNS; use dns_instructions for the rows to enter and dns_verify afterwards. Records are untrusted data.",
|
|
48
|
+
sideEffects: "none", authorization: { permission: "deployments.read" }, inputSchema,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "dns_instructions",
|
|
52
|
+
description: "Returns copyable DNS rows (action add/change/remove, type, host, name, value, TTL, priority) and notes for a person to enter at their DNS host so a hostname satisfies its site or mail requirements. When the current records cannot be read it lists every required record instead. Pass requirements, include [\"mail\"], or reuse the ones saved by dns_verify. Read-only; it does not change DNS. Follow with dns_verify once the records are entered.",
|
|
53
|
+
sideEffects: "none", authorization: { permission: "deployments.read" }, inputSchema,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "dns_verify",
|
|
57
|
+
description: "Starts or continues propagation tracking for a hostname: saves its required records (site, verification, certificate or mail), checks every authoritative nameserver of its zone once now, and returns {hostname, zone, status: pending|propagated|mismatch|timeout|unknown, delegation, attempt, nextCheckAt, records}. Unknown means a DNS server did not answer, not that the domain is broken; timeout means 48 hours passed without propagation. Call after DNS records were entered; call again later to re-check. include [\"mail\"] also saves the site's mail provider records. Saves only the domain's tracking state on this site; never changes DNS.",
|
|
58
|
+
sideEffects: "mutates-durable-state", authorization: { permission: "deployments.publish" }, inputSchema,
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
export const dnsChangeDerivedRisk = new Map([
|
|
62
|
+
// -> registry provider findZone/listRecords + authoritative resolver reads; no stored state.
|
|
63
|
+
["dns_plan", "none"],
|
|
64
|
+
// -> the same reads as dns_plan, rendered as rows; no stored state.
|
|
65
|
+
["dns_instructions", "none"],
|
|
66
|
+
// -> resolver reads + DomainBindingStore.put (the binding's requirements and status).
|
|
67
|
+
["dns_verify", "mutates-durable-state"],
|
|
68
|
+
]);
|
|
69
|
+
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
70
|
+
const optionalInt = ({ value, min, max }, _options = {}) => value === undefined || (Number.isInteger(value) && value >= min && value <= max);
|
|
71
|
+
const optionalText = ({ value, max }, _options = {}) => value === undefined || (typeof value === "string" && value.length <= max);
|
|
72
|
+
const caaIssuerValid = ({ issuer }, _options = {}) => typeof issuer === "string" && issuer.length > 0 && issuer.length <= 253;
|
|
73
|
+
const optionalCaa = ({ value }, _options = {}) => value === undefined || (isObject(value) && caaIssuerValid({ issuer: value.issuer }));
|
|
74
|
+
const RECORD_SHAPE = "each requirement record needs type (A, AAAA, CNAME, TXT, MX, CAA, NS or SRV), name and a value of at most 4096 characters; ttl 60-86400, priority 0-65535 and note up to 200 characters are optional.";
|
|
75
|
+
const REQUIREMENT_SHAPE = "requirements must be 1-10 objects with purpose (site, mail or tls) and 1-50 records; domain, providerId (up to 64 characters) and caa.issuer are optional.";
|
|
76
|
+
const INCLUDE_SHAPE = "include must be [\"mail\"].";
|
|
77
|
+
function refuse({ prefix, message }, _options = {}) {
|
|
78
|
+
throw new ToolInputError({ message: `${prefix}: ${message}` });
|
|
79
|
+
}
|
|
80
|
+
/** Ordered checks; each runs only after every earlier one passed. */
|
|
81
|
+
const RECORD_CHECKS = [
|
|
82
|
+
raw => RECORD_TYPES.includes(raw.type),
|
|
83
|
+
raw => typeof raw.value === "string" && raw.value.length > 0 && raw.value.length <= 4096,
|
|
84
|
+
raw => optionalInt({ value: raw.ttl, min: 60, max: 86400 }) && optionalInt({ value: raw.priority, min: 0, max: 65535 }),
|
|
85
|
+
raw => optionalText({ value: raw.note, max: 200 }),
|
|
86
|
+
];
|
|
87
|
+
function readRecord({ raw, prefix, names }, _options = {}) {
|
|
88
|
+
if (!isObject(raw) || !RECORD_CHECKS.every(check => check(raw)))
|
|
89
|
+
refuse({ prefix, message: RECORD_SHAPE });
|
|
90
|
+
const name = names.readPublicDnsName({ value: raw.name, errorPrefix: prefix });
|
|
91
|
+
const { type, value, ttl, priority, note } = raw;
|
|
92
|
+
return { type, name, value, ...(ttl === undefined ? {} : { ttl }), ...(priority === undefined ? {} : { priority }), ...(note === undefined ? {} : { note }) };
|
|
93
|
+
}
|
|
94
|
+
const REQUIREMENT_CHECKS = [
|
|
95
|
+
raw => PURPOSES.includes(raw.purpose),
|
|
96
|
+
raw => Array.isArray(raw.records) && raw.records.length > 0 && raw.records.length <= 50,
|
|
97
|
+
raw => optionalText({ value: raw.providerId, max: 64 }) && optionalCaa({ value: raw.caa }),
|
|
98
|
+
];
|
|
99
|
+
function readRequirement({ raw, hostname, prefix, names }, _options = {}) {
|
|
100
|
+
if (!isObject(raw) || !REQUIREMENT_CHECKS.every(check => check(raw)))
|
|
101
|
+
refuse({ prefix, message: REQUIREMENT_SHAPE });
|
|
102
|
+
const domain = raw.domain === undefined ? hostname : names.readPublicDomain({ value: raw.domain, errorPrefix: prefix });
|
|
103
|
+
const records = raw.records.map(record => readRecord({ raw: record, prefix, names }));
|
|
104
|
+
const purpose = raw.purpose;
|
|
105
|
+
const caa = raw.caa;
|
|
106
|
+
return { purpose, domain, providerId: raw.providerId ?? purpose, records, ...(caa === undefined ? {} : { caa: { issuer: caa.issuer } }) };
|
|
107
|
+
}
|
|
108
|
+
function readRequirements({ raw, hostname, prefix, names }, _options = {}) {
|
|
109
|
+
if (!Array.isArray(raw) || raw.length === 0 || raw.length > 10)
|
|
110
|
+
refuse({ prefix, message: REQUIREMENT_SHAPE });
|
|
111
|
+
return raw.map(requirement => readRequirement({ raw: requirement, hostname, prefix, names }));
|
|
112
|
+
}
|
|
113
|
+
function readInclude({ raw, prefix }, _options = {}) {
|
|
114
|
+
if (!Array.isArray(raw) || raw.length !== 1 || !INCLUDES.includes(raw[0]))
|
|
115
|
+
refuse({ prefix, message: INCLUDE_SHAPE });
|
|
116
|
+
return [raw[0]];
|
|
117
|
+
}
|
|
118
|
+
/** Validate untrusted tool input before any authorization or network effect, with the host's injected
|
|
119
|
+
* public-name validators (refusals surface as ToolInputError). O(records). */
|
|
120
|
+
export function readDnsChangeInput(required, _optional = {}) {
|
|
121
|
+
const input = requireInputRecord({ input: required.input });
|
|
122
|
+
const names = toolInputPublicNames({ validators: required.publicNames });
|
|
123
|
+
const hostname = names.readPublicDomain({ value: input.hostname, errorPrefix: required.errorPrefix });
|
|
124
|
+
return {
|
|
125
|
+
hostname,
|
|
126
|
+
...(input.requirements === undefined ? {} : { requirements: readRequirements({ raw: input.requirements, hostname, prefix: required.errorPrefix, names }) }),
|
|
127
|
+
...(input.include === undefined ? {} : { include: readInclude({ raw: input.include, prefix: required.errorPrefix }) }),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
async function authorizeFor({ deps, principalId, permission }, _options = {}) {
|
|
131
|
+
await requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: deps.authorize }), workspaceId: deps.workspaceId, principalId, permission }, { entityType: "domain-dns" });
|
|
132
|
+
}
|
|
133
|
+
function planView(planned) {
|
|
134
|
+
const { plan, delegation } = planned;
|
|
135
|
+
return {
|
|
136
|
+
hostname: planned.hostname, providerId: planned.providerId, zone: planned.zone, zoneFound: planned.zoneFound,
|
|
137
|
+
delegation: delegation === null ? null : { state: delegation.state, nameservers: delegation.nameservers, reason: delegation.reason },
|
|
138
|
+
inventory: plan.inventory, changes: plan.changes, preserved: plan.preserved, blockers: planned.blockers, fingerprint: plan.fingerprint,
|
|
139
|
+
untrusted: true,
|
|
140
|
+
next: planned.blockers.length > 0
|
|
141
|
+
? "Resolve the blockers first; dns_instructions still lists the required records."
|
|
142
|
+
: "Nothing is applied automatically: use dns_instructions for the rows to enter, then dns_verify.",
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Wire the three DNS change tools to tool permissions for this invocation's principal.
|
|
147
|
+
* @complexity O(1) registration; effects happen only when a handler runs.
|
|
148
|
+
* @example buildDnsChangeRegistrations(deps)
|
|
149
|
+
*/
|
|
150
|
+
export function buildDnsChangeRegistrations(deps, _optional = {}) {
|
|
151
|
+
const ports = {
|
|
152
|
+
registry: deps.registry, resolver: deps.resolver, context: deps.context,
|
|
153
|
+
...(deps.bindings ? { bindings: deps.bindings } : {}), ...(deps.mailRequirements ? { mailRequirements: deps.mailRequirements } : {}),
|
|
154
|
+
};
|
|
155
|
+
return buildDomainRegistrations({ metadata: toolMetadata, domain: "domain-dns", catalogModule: "@jini-ai/devops/dns/site/dns-tools.ts", catalog: indexCatalogById({ catalog: dnsChangeAgentToolCatalog }), derivedRisk: dnsChangeDerivedRisk, handlers: {
|
|
156
|
+
dns_plan: async (ctx) => {
|
|
157
|
+
const input = readDnsChangeInput({ input: ctx.input, errorPrefix: "dns_plan", publicNames: deps.publicNames });
|
|
158
|
+
await authorizeFor({ deps, principalId: ctx.principal.id, permission: "deployments.read" });
|
|
159
|
+
return planView(await planDomainDns(input, ports));
|
|
160
|
+
},
|
|
161
|
+
dns_instructions: async (ctx) => {
|
|
162
|
+
const input = readDnsChangeInput({ input: ctx.input, errorPrefix: "dns_instructions", publicNames: deps.publicNames });
|
|
163
|
+
await authorizeFor({ deps, principalId: ctx.principal.id, permission: "deployments.read" });
|
|
164
|
+
const { planned, instructions } = await domainDnsInstructions(input, ports);
|
|
165
|
+
return { hostname: planned.hostname, zone: instructions.zone, rows: instructions.rows, notes: instructions.notes, blockers: planned.blockers, fingerprint: planned.plan.fingerprint, untrusted: true };
|
|
166
|
+
},
|
|
167
|
+
dns_verify: async (ctx) => {
|
|
168
|
+
const input = readDnsChangeInput({ input: ctx.input, errorPrefix: "dns_verify", publicNames: deps.publicNames });
|
|
169
|
+
await authorizeFor({ deps, principalId: ctx.principal.id, permission: "deployments.publish" });
|
|
170
|
+
if (deps.bindings === undefined)
|
|
171
|
+
refuse({ prefix: "dns_verify", message: "this site has no content database to keep the domain's tracking state in." });
|
|
172
|
+
const { binding, delegation, verification } = await verifyDomainDns(input, { ...ports, bindings: deps.bindings, now: deps.now });
|
|
173
|
+
return {
|
|
174
|
+
hostname: binding.hostname, zone: binding.zone, status: binding.status, attempt: binding.attempt, startedAt: binding.startedAt, nextCheckAt: binding.nextCheckAt,
|
|
175
|
+
delegation: { state: delegation.state, reason: delegation.reason }, nameservers: verification.nameservers,
|
|
176
|
+
...(verification.reason === undefined ? {} : { reason: verification.reason }),
|
|
177
|
+
// `status` is the Email page's vocabulary (Matches/Missing/Pending/Mismatch/Unknown/TimedOut).
|
|
178
|
+
records: verification.records.map(({ record, state, byNameserver }) => ({ type: record.type, name: record.name, value: record.value, state, status: mailDnsRecordStatus({ record: { state, byNameserver }, timedOut: binding.status === "timeout" }), byNameserver })),
|
|
179
|
+
untrusted: true,
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
} });
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* One `domain-dns` contributor for the read-only diagnostics, the DNS change tools and the two
|
|
186
|
+
* mail DNS status tools (`mail-dns-tools.ts`).
|
|
187
|
+
* Takes the host's ports from its composition root without constructing network clients here.
|
|
188
|
+
* @param required Host dependency factories; invoked only during tool catalog assembly.
|
|
189
|
+
* @complexity O(1).
|
|
190
|
+
* @example contributeDomainDnsAndChangeTools({ createDeps, createDnsDeps })
|
|
191
|
+
*/
|
|
192
|
+
export function contributeDomainDnsAndChangeTools({ createDeps, createDnsDeps }, _optional = {}) {
|
|
193
|
+
return {
|
|
194
|
+
domain: "domain-dns",
|
|
195
|
+
build: routeDeps => {
|
|
196
|
+
const dnsDeps = createDnsDeps(routeDeps);
|
|
197
|
+
const domainDeps = createDeps(routeDeps);
|
|
198
|
+
// The change tools validate hostnames with the same injected validators as the read diagnostics.
|
|
199
|
+
return [...buildDomainDnsRegistrations(domainDeps), ...buildDnsChangeRegistrations({ ...dnsDeps, publicNames: domainDeps.publicNames }), ...buildMailDnsRegistrations(dnsDeps)];
|
|
200
|
+
},
|
|
201
|
+
risk: new Map([...domainDnsDerivedRisk, ...dnsChangeDerivedRisk, ...mailDnsDerivedRisk]),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=dns-tools.js.map
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { DomainRecordRequirement } from "@jini-ai/core/provider-registry";
|
|
2
|
+
import { type DnsInstructions, type RecordVerification } from "../index.js";
|
|
3
|
+
import type { SenderDomainVerification, SenderDomainVerificationPort } from "@jini-ai/core/contracts/mail";
|
|
4
|
+
import type { DomainBinding, DomainBindingStore } from "./binding.repo.js";
|
|
5
|
+
import { type DnsChangePorts, type DomainDnsBlocker } from "./dns-changes.js";
|
|
6
|
+
export type MailDnsRecordStatus = "Checking" | "Matches" | "Missing" | "Mismatch" | "Pending" | "Unknown" | "TimedOut";
|
|
7
|
+
/** Why there is (or is not) a record table to show. */
|
|
8
|
+
export type MailDnsState = "checked"
|
|
9
|
+
/** No sender address is configured, so there is no sender domain. */
|
|
10
|
+
| "no_sender"
|
|
11
|
+
/** No transactional provider is selected or installed. */
|
|
12
|
+
| "no_provider"
|
|
13
|
+
/** "DNS verification unavailable for this provider": it publishes no domain records. */
|
|
14
|
+
| "verification_unavailable"
|
|
15
|
+
/** The provider could list records but cannot be asked now (e.g. its key is not saved). */
|
|
16
|
+
| "requirements_unavailable"
|
|
17
|
+
/** The provider was asked for its records and answered with an error. */
|
|
18
|
+
| "requirements_failed"
|
|
19
|
+
/** The records are known but the check could not run (zone layout, no tracking store, ...). */
|
|
20
|
+
| "check_failed";
|
|
21
|
+
export interface MailDnsNameserverView {
|
|
22
|
+
nameserver: string;
|
|
23
|
+
status: MailDnsRecordStatus;
|
|
24
|
+
answers: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface MailDnsRecordView {
|
|
27
|
+
type: DomainRecordRequirement["type"];
|
|
28
|
+
/** Relative to the zone, `@` for the apex: what DNS host forms ask for. */
|
|
29
|
+
host: string;
|
|
30
|
+
name: string;
|
|
31
|
+
expected: string;
|
|
32
|
+
/** Every distinct answer the authoritative nameservers gave; empty when none or unread. */
|
|
33
|
+
observed: string[];
|
|
34
|
+
status: MailDnsRecordStatus;
|
|
35
|
+
/** `mail` for the provider's records and the DMARC hint; `other` for records saved by another purpose. */
|
|
36
|
+
purpose: "mail" | "other";
|
|
37
|
+
priority?: number;
|
|
38
|
+
ttl?: number;
|
|
39
|
+
note?: string;
|
|
40
|
+
byNameserver: MailDnsNameserverView[];
|
|
41
|
+
}
|
|
42
|
+
export interface MailDnsTracking {
|
|
43
|
+
status: DomainBinding["status"];
|
|
44
|
+
attempt: number;
|
|
45
|
+
startedAt: string;
|
|
46
|
+
nextCheckAt: string | null;
|
|
47
|
+
lastCheckedAt: string | null;
|
|
48
|
+
}
|
|
49
|
+
export interface MailDnsCheck {
|
|
50
|
+
hostname: string;
|
|
51
|
+
zone: string;
|
|
52
|
+
delegation: {
|
|
53
|
+
state: string;
|
|
54
|
+
reason: string;
|
|
55
|
+
} | null;
|
|
56
|
+
nameservers: string[];
|
|
57
|
+
overall: MailDnsRecordStatus;
|
|
58
|
+
records: MailDnsRecordView[];
|
|
59
|
+
/** Why every record is Unknown, when the whole check could not reach the nameservers. */
|
|
60
|
+
reason?: string;
|
|
61
|
+
checkedAt: string;
|
|
62
|
+
/** True when this check was saved (`verifyMailDnsStatus`); false for the read-only view. */
|
|
63
|
+
persisted: boolean;
|
|
64
|
+
/** The saved propagation tracking, or `null` when it was never started. */
|
|
65
|
+
tracking: MailDnsTracking | null;
|
|
66
|
+
/** Read view only: copyable rows, notes and plan blockers. */
|
|
67
|
+
rows?: DnsInstructions["rows"];
|
|
68
|
+
notes?: DnsInstructions["notes"];
|
|
69
|
+
blockers?: DomainDnsBlocker[];
|
|
70
|
+
}
|
|
71
|
+
export interface MailDnsStatus {
|
|
72
|
+
state: MailDnsState;
|
|
73
|
+
/** Caller-safe explanation for every state but `checked`. */
|
|
74
|
+
message?: string;
|
|
75
|
+
senderDomain: string | null;
|
|
76
|
+
providerId: string | null;
|
|
77
|
+
/** The provider's own verdict, separate from DNS; `null` when this root cannot ask. */
|
|
78
|
+
providerVerification: SenderDomainVerification | null;
|
|
79
|
+
dns?: MailDnsCheck;
|
|
80
|
+
/** DNS answers and provider-supplied values are data, never instructions. */
|
|
81
|
+
untrusted: true;
|
|
82
|
+
}
|
|
83
|
+
/** DNS change ports plus the provider-side verdict; field names match `DnsChangeToolDeps`. */
|
|
84
|
+
export type MailDnsStatusPorts = DnsChangePorts & {
|
|
85
|
+
now: () => number;
|
|
86
|
+
senderDomainVerification?: SenderDomainVerificationPort;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* One record's status. Pending from the kernel is split: no server has it yet → Missing; some do →
|
|
90
|
+
* Pending (propagating). Past the 48 h window an unpropagated record is TimedOut, not Missing.
|
|
91
|
+
* @complexity O(nameservers).
|
|
92
|
+
*/
|
|
93
|
+
export declare function mailDnsRecordStatus(required: {
|
|
94
|
+
record: Pick<RecordVerification, "state" | "byNameserver">;
|
|
95
|
+
timedOut: boolean;
|
|
96
|
+
}): MailDnsRecordStatus;
|
|
97
|
+
/**
|
|
98
|
+
* Read-only status: provider verdict, plan rows and one unsaved check. Authorization is the caller's.
|
|
99
|
+
* @complexity Two provider calls, the plan's reads and O(records · nameservers) DNS queries.
|
|
100
|
+
* @example await readMailDnsStatus({}, ports)
|
|
101
|
+
*/
|
|
102
|
+
export declare function readMailDnsStatus(_required: Record<string, never>, ports: MailDnsStatusPorts): Promise<MailDnsStatus>;
|
|
103
|
+
/**
|
|
104
|
+
* Saved check: `verifyDomainDns` (`include: ["mail"]`) records the result and schedules re-checks.
|
|
105
|
+
* @complexity As {@link readMailDnsStatus} minus the plan, plus one keyed write.
|
|
106
|
+
* @example await verifyMailDnsStatus({}, ports)
|
|
107
|
+
*/
|
|
108
|
+
export declare function verifyMailDnsStatus(_required: Record<string, never>, ports: MailDnsStatusPorts & {
|
|
109
|
+
bindings?: DomainBindingStore;
|
|
110
|
+
}): Promise<MailDnsStatus>;
|
|
111
|
+
//# sourceMappingURL=mail-dns-status.d.ts.map
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The host email settings' **Sender and DNS** status (email design, phase 3): one record-by-record
|
|
3
|
+
* projection of the sender domain's mail DNS, plus the provider's own verdict kept apart from it.
|
|
4
|
+
*
|
|
5
|
+
* Two operations, each shared by an admin route and an assistant tool:
|
|
6
|
+
* - {@link readMailDnsStatus} (`deployments.read`): plan, copyable rows and one UNSAVED check of
|
|
7
|
+
* every authoritative nameserver (`inspectDomainDns`).
|
|
8
|
+
* - {@link verifyMailDnsStatus} (`deployments.publish`): the same check through `verifyDomainDns`,
|
|
9
|
+
* which saves the tracking state and schedules re-checks; it stays the single status writer.
|
|
10
|
+
* Both read the records through `include: ["mail"]`, so SPF is merged and an existing DMARC kept
|
|
11
|
+
* exactly as `dns_plan` does. Nothing here changes DNS.
|
|
12
|
+
*
|
|
13
|
+
* Statuses: Matches, Missing, Mismatch, Pending (some nameservers answer, others not yet), Unknown
|
|
14
|
+
* (a server did not answer: never a failure), TimedOut (48 h without propagation). `Checking` is the
|
|
15
|
+
* client's in-flight state; the server never returns it, but it is part of the shared vocabulary.
|
|
16
|
+
*/
|
|
17
|
+
import { ToolInputError } from "@jini-ai/core";
|
|
18
|
+
import { normalizeDnsName } from "../index.js";
|
|
19
|
+
import { inspectDomainDns, verifyDomainDns } from "./dns-changes.js";
|
|
20
|
+
import { DMARC_HINT_VALUE } from "./mail-requirements.js";
|
|
21
|
+
const NAMESERVER_STATUS = { propagated: "Matches", mismatch: "Mismatch", unknown: "Unknown", pending: "Missing" };
|
|
22
|
+
/**
|
|
23
|
+
* One record's status. Pending from the kernel is split: no server has it yet → Missing; some do →
|
|
24
|
+
* Pending (propagating). Past the 48 h window an unpropagated record is TimedOut, not Missing.
|
|
25
|
+
* @complexity O(nameservers).
|
|
26
|
+
*/
|
|
27
|
+
export function mailDnsRecordStatus(required) {
|
|
28
|
+
const { record, timedOut } = required;
|
|
29
|
+
if (record.state !== "pending")
|
|
30
|
+
return NAMESERVER_STATUS[record.state];
|
|
31
|
+
if (timedOut)
|
|
32
|
+
return "TimedOut";
|
|
33
|
+
return record.byNameserver.some(observation => observation.state === "propagated") ? "Pending" : "Missing";
|
|
34
|
+
}
|
|
35
|
+
const OVERALL_ORDER = ["Mismatch", "TimedOut", "Missing", "Pending", "Unknown"];
|
|
36
|
+
/** The most actionable record status; all Matches only when every record matches. */
|
|
37
|
+
function overallOf(records) {
|
|
38
|
+
return OVERALL_ORDER.find(status => records.some(record => record.status === status)) ?? "Matches";
|
|
39
|
+
}
|
|
40
|
+
function relativeHost({ name, zone }, _options = {}) {
|
|
41
|
+
if (name === zone)
|
|
42
|
+
return "@";
|
|
43
|
+
return name.endsWith(`.${zone}`) ? name.slice(0, -(zone.length + 1)) : name;
|
|
44
|
+
}
|
|
45
|
+
const recordKey = (record) => `${record.type} ${normalizeDnsName({ name: record.name })} ${record.value}`;
|
|
46
|
+
function nameserverView(observation) {
|
|
47
|
+
return { nameserver: observation.nameserver, status: NAMESERVER_STATUS[observation.state], answers: [...observation.answers] };
|
|
48
|
+
}
|
|
49
|
+
/** One verified record, labelled against the mail provider's own records. */
|
|
50
|
+
function recordView(verified, context) {
|
|
51
|
+
const { record } = verified;
|
|
52
|
+
const name = normalizeDnsName({ name: record.name });
|
|
53
|
+
const isMail = context.mailKeys.has(recordKey(record)) || (record.type === "TXT" && name.startsWith("_dmarc.") && record.value === DMARC_HINT_VALUE);
|
|
54
|
+
return {
|
|
55
|
+
type: record.type, host: relativeHost({ name, zone: context.zone }), name, expected: record.value,
|
|
56
|
+
observed: [...new Set(verified.byNameserver.flatMap(observation => observation.answers))],
|
|
57
|
+
status: mailDnsRecordStatus({ record: verified, timedOut: context.timedOut }), purpose: isMail ? "mail" : "other",
|
|
58
|
+
...(record.priority === undefined ? {} : { priority: record.priority }), ...(record.ttl === undefined ? {} : { ttl: record.ttl }), ...(record.note === undefined ? {} : { note: record.note }),
|
|
59
|
+
byNameserver: verified.byNameserver.map(nameserverView),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function trackingOf({ binding }, _options = {}) {
|
|
63
|
+
if (binding === null)
|
|
64
|
+
return null;
|
|
65
|
+
return { status: binding.status, attempt: binding.attempt, startedAt: binding.startedAt, nextCheckAt: binding.nextCheckAt, lastCheckedAt: binding.lastCheckedAt };
|
|
66
|
+
}
|
|
67
|
+
/** The record table for one check. @complexity O(records · nameservers). */
|
|
68
|
+
function checkView(input) {
|
|
69
|
+
const timedOut = input.binding?.status === "timeout";
|
|
70
|
+
const mailKeys = new Set(input.requirement.records.map(recordKey));
|
|
71
|
+
const records = input.verification.records.map(verified => recordView(verified, { zone: input.zone, mailKeys, timedOut }));
|
|
72
|
+
return {
|
|
73
|
+
hostname: input.hostname, zone: input.zone, delegation: input.delegation, nameservers: [...input.verification.nameservers],
|
|
74
|
+
overall: overallOf(records), records, ...(input.verification.reason === undefined ? {} : { reason: input.verification.reason }),
|
|
75
|
+
checkedAt: input.checkedAt, persisted: input.persisted, tracking: trackingOf({ binding: input.binding }),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/** Every required record Unknown: no zone was found, so no authoritative server could be asked. */
|
|
79
|
+
function unreadVerification(planned, requirementRecords) {
|
|
80
|
+
return {
|
|
81
|
+
zone: planned.zone, state: "unknown", nameservers: [],
|
|
82
|
+
reason: `No DNS zone serving ${planned.hostname} could be found, so its records could not be checked.`,
|
|
83
|
+
records: requirementRecords.map(record => ({ record, state: "unknown", byNameserver: [] })),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const NO_RECORDS = {
|
|
87
|
+
no_sender: { state: "no_sender", message: "Set the site's sender address first; its domain is the one that needs mail DNS records." },
|
|
88
|
+
no_provider: { state: "no_provider", message: "Choose a transactional mail provider first; its records depend on which provider sends." },
|
|
89
|
+
unknown: { state: "requirements_unavailable", message: "The mail provider's DNS records can't be read right now. Check that its key, or a connected account, can read domains." },
|
|
90
|
+
};
|
|
91
|
+
const UNSUPPORTED = { state: "verification_unavailable", message: "DNS verification is unavailable for this provider: it publishes no domain records to check." };
|
|
92
|
+
function base({ verdict }, _options = {}) {
|
|
93
|
+
const senderDomain = verdict !== null && "domain" in verdict ? verdict.domain ?? null : null;
|
|
94
|
+
return { senderDomain, providerId: verdict?.providerId ?? null, providerVerification: verdict, untrusted: true };
|
|
95
|
+
}
|
|
96
|
+
/** Preserve a caller-safe provider refusal instead of masking it with the generic unknown state. */
|
|
97
|
+
function noRecordsReason({ verdict }, _options = {}) {
|
|
98
|
+
const fallback = NO_RECORDS[verdict?.state ?? ""] ?? UNSUPPORTED;
|
|
99
|
+
return verdict?.state === "unknown" ? { ...fallback, message: verdict.reason } : fallback;
|
|
100
|
+
}
|
|
101
|
+
/** The verdict's no-records reason, except that a failed records read already carries the
|
|
102
|
+
* provider's own error, which must not be replaced by the domain check's generic unknown state. */
|
|
103
|
+
function verdictReason(status, verdict) {
|
|
104
|
+
if (!NO_RECORDS[verdict.state])
|
|
105
|
+
return {};
|
|
106
|
+
return verdict.state === "unknown" && status.state === "requirements_failed" ? {} : noRecordsReason({ verdict });
|
|
107
|
+
}
|
|
108
|
+
/** The provider's records once (the plan step asks the port again through a cached copy). */
|
|
109
|
+
async function resolveRequirement({ ports, verdict }, _options = {}) {
|
|
110
|
+
if (ports.mailRequirements === undefined)
|
|
111
|
+
return { kind: "none", status: { ...base({ verdict }), state: "requirements_unavailable", message: "This server cannot report its mail provider's DNS records." } };
|
|
112
|
+
try {
|
|
113
|
+
const requirement = await ports.mailRequirements({ workspaceId: ports.context.workspaceId });
|
|
114
|
+
if (requirement !== null)
|
|
115
|
+
return { kind: "records", requirement };
|
|
116
|
+
const why = noRecordsReason({ verdict });
|
|
117
|
+
return { kind: "none", status: { ...base({ verdict }), ...why } };
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
return { kind: "none", status: { ...base({ verdict }), state: "requirements_failed", message: err instanceof ToolInputError ? err.message : "The mail provider could not list its required DNS records." } };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** Shared head of both operations: the provider's verdict, then its records, each read once. */
|
|
124
|
+
async function prepare(ports) {
|
|
125
|
+
// Requirements start independently: a slow provider verdict cannot hold their lookup hostage.
|
|
126
|
+
const requirementRead = resolveRequirement({ ports, verdict: null });
|
|
127
|
+
const verdict = ports.senderDomainVerification ? await ports.senderDomainVerification() : null;
|
|
128
|
+
let resolved = await requirementRead;
|
|
129
|
+
if (resolved.kind === "none" && verdict)
|
|
130
|
+
resolved = { kind: "none", status: { ...resolved.status, ...base({ verdict }), ...verdictReason(resolved.status, verdict) } };
|
|
131
|
+
const requirement = resolved.kind === "records" ? resolved.requirement : null;
|
|
132
|
+
return { verdict, resolved, cached: { ...ports, mailRequirements: async () => requirement } };
|
|
133
|
+
}
|
|
134
|
+
function headOf({ verdict, requirement }, _options = {}) {
|
|
135
|
+
return { ...base({ verdict }), senderDomain: normalizeDnsName({ name: requirement.domain }), providerId: requirement.providerId };
|
|
136
|
+
}
|
|
137
|
+
/** A caller-level refusal from the DNS layer (zone layout, missing store) becomes a state, not a 500. */
|
|
138
|
+
async function guarded({ head, run }, _options = {}) {
|
|
139
|
+
try {
|
|
140
|
+
return { ...head, state: "checked", dns: await run() };
|
|
141
|
+
}
|
|
142
|
+
catch (err) {
|
|
143
|
+
if (!(err instanceof ToolInputError))
|
|
144
|
+
throw err;
|
|
145
|
+
return { ...head, state: "check_failed", message: err.message };
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Read-only status: provider verdict, plan rows and one unsaved check. Authorization is the caller's.
|
|
150
|
+
* @complexity Two provider calls, the plan's reads and O(records · nameservers) DNS queries.
|
|
151
|
+
* @example await readMailDnsStatus({}, ports)
|
|
152
|
+
*/
|
|
153
|
+
export async function readMailDnsStatus(_required, ports) {
|
|
154
|
+
const { verdict, resolved, cached } = await prepare(ports);
|
|
155
|
+
if (resolved.kind === "none")
|
|
156
|
+
return resolved.status;
|
|
157
|
+
const { requirement } = resolved;
|
|
158
|
+
const hostname = normalizeDnsName({ name: requirement.domain });
|
|
159
|
+
return guarded({ head: headOf({ verdict, requirement }), run: async () => {
|
|
160
|
+
const inspected = await inspectDomainDns({ hostname, include: ["mail"] }, cached);
|
|
161
|
+
const { planned, instructions } = inspected;
|
|
162
|
+
const delegation = planned.delegation === null ? null : { state: planned.delegation.state, reason: planned.delegation.reason };
|
|
163
|
+
const verification = inspected.verification ?? unreadVerification(planned, requirement.records);
|
|
164
|
+
const check = checkView({ hostname, zone: planned.zone, delegation, verification, binding: inspected.binding, requirement, checkedAt: new Date(ports.now()).toISOString(), persisted: false });
|
|
165
|
+
return { ...check, rows: instructions.rows, notes: instructions.notes, blockers: planned.blockers };
|
|
166
|
+
} });
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Saved check: `verifyDomainDns` (`include: ["mail"]`) records the result and schedules re-checks.
|
|
170
|
+
* @complexity As {@link readMailDnsStatus} minus the plan, plus one keyed write.
|
|
171
|
+
* @example await verifyMailDnsStatus({}, ports)
|
|
172
|
+
*/
|
|
173
|
+
export async function verifyMailDnsStatus(_required, ports) {
|
|
174
|
+
const { verdict, resolved, cached } = await prepare(ports);
|
|
175
|
+
if (resolved.kind === "none")
|
|
176
|
+
return resolved.status;
|
|
177
|
+
const { requirement } = resolved;
|
|
178
|
+
const hostname = normalizeDnsName({ name: requirement.domain });
|
|
179
|
+
return guarded({ head: headOf({ verdict, requirement }), run: async () => {
|
|
180
|
+
const bindings = ports.bindings;
|
|
181
|
+
if (bindings === undefined)
|
|
182
|
+
throw new ToolInputError({ message: "this site has no content database to keep the domain's tracking state in." });
|
|
183
|
+
const { binding, delegation, verification } = await verifyDomainDns({ hostname, include: ["mail"] }, { ...cached, bindings });
|
|
184
|
+
// `verifyDomainDns` stamps `lastCheckedAt` on every binding it saves (`nextBinding`), so the saved check's time is never null here.
|
|
185
|
+
if (binding.lastCheckedAt == null)
|
|
186
|
+
throw new Error("Verified mail domain binding has no check time");
|
|
187
|
+
return checkView({ hostname, zone: binding.zone, delegation: { state: delegation.state, reason: delegation.reason }, verification, binding, requirement, checkedAt: binding.lastCheckedAt, persisted: true });
|
|
188
|
+
} });
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=mail-dns-status.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `mail_dns_status` and `mail_dns_verify`: the assistant side of a host email settings'
|
|
3
|
+
* **Sender and DNS** section. Each tool calls the same operation as the host's admin route
|
|
4
|
+
* (which calls `readMailDnsStatus` / `verifyMailDnsStatus` directly) with the same permission:
|
|
5
|
+
* `deployments.read` for the unsaved check, `deployments.publish` for the saved one.
|
|
6
|
+
* No hostname is asked for: the sender domain comes from the site's own mail configuration.
|
|
7
|
+
*/
|
|
8
|
+
import { type AgentToolSideEffect, type ToolRegistration } from "@jini-ai/core";
|
|
9
|
+
import type { DnsChangeToolDeps } from "./tool-deps.js";
|
|
10
|
+
import { type MailDnsStatusPorts } from "./mail-dns-status.js";
|
|
11
|
+
export declare const mailDnsAgentToolCatalog: {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
sideEffects: AgentToolSideEffect;
|
|
15
|
+
authorization: {
|
|
16
|
+
permission: string;
|
|
17
|
+
};
|
|
18
|
+
inputSchema: {
|
|
19
|
+
readonly type: "object";
|
|
20
|
+
readonly additionalProperties: false;
|
|
21
|
+
readonly properties: {};
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
export declare const mailDnsDerivedRisk: ReadonlyMap<string, AgentToolSideEffect>;
|
|
25
|
+
/** The operation ports from the DNS change deps (the same composition the dns_* tools use). */
|
|
26
|
+
export declare function mailDnsPorts(deps: DnsChangeToolDeps): MailDnsStatusPorts & Pick<DnsChangeToolDeps, "bindings">;
|
|
27
|
+
/**
|
|
28
|
+
* The two mail DNS tools under the `domain-dns` contributor.
|
|
29
|
+
* @complexity O(1) registration; effects happen only when a handler runs.
|
|
30
|
+
* @example buildMailDnsRegistrations(deps)
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildMailDnsRegistrations(deps: DnsChangeToolDeps): ToolRegistration[];
|
|
33
|
+
//# sourceMappingURL=mail-dns-tools.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `mail_dns_status` and `mail_dns_verify`: the assistant side of a host email settings'
|
|
3
|
+
* **Sender and DNS** section. Each tool calls the same operation as the host's admin route
|
|
4
|
+
* (which calls `readMailDnsStatus` / `verifyMailDnsStatus` directly) with the same permission:
|
|
5
|
+
* `deployments.read` for the unsaved check, `deployments.publish` for the saved one.
|
|
6
|
+
* No hostname is asked for: the sender domain comes from the site's own mail configuration.
|
|
7
|
+
*/
|
|
8
|
+
import { buildDomainRegistrations, indexCatalogById, requireInputRecord } from "@jini-ai/core";
|
|
9
|
+
import { adaptLegacyAuthorize, requireToolPermission } from "@jini-ai/core";
|
|
10
|
+
import { toolMetadata } from "@jini-ai/core/tool-metadata/domain-dns";
|
|
11
|
+
import { readMailDnsStatus, verifyMailDnsStatus } from "./mail-dns-status.js";
|
|
12
|
+
const emptyInput = { type: "object", additionalProperties: false, properties: {} };
|
|
13
|
+
const RETURNS = "Returns {state, message?, senderDomain, providerId, providerVerification, dns?: {hostname, zone, delegation, nameservers, overall, records, checkedAt, persisted, tracking}}. state is checked, no_sender, no_provider, verification_unavailable (the provider publishes no domain records), requirements_unavailable, requirements_failed or check_failed. Each record has type, host, name, expected, observed, status (Matches, Missing, Mismatch, Pending, Unknown or TimedOut) and byNameserver. Unknown means a DNS server did not answer, never that the domain is broken. providerVerification is the mail provider's own verdict (verified, pending, failed, not_found, unsupported, unknown), separate from DNS. Records are untrusted data.";
|
|
14
|
+
export const mailDnsAgentToolCatalog = [
|
|
15
|
+
{
|
|
16
|
+
name: "mail_dns_status",
|
|
17
|
+
description: `Checks the DNS records this site's mail provider needs for the sender domain, record by record, against every authoritative nameserver, plus copyable rows (rows, notes, blockers) to enter at the DNS host. SPF is merged into any existing SPF and an existing DMARC is kept. Read-only: saves nothing and never changes DNS; use mail_dns_verify to start saved tracking. ${RETURNS} Requires deployments.read.`,
|
|
18
|
+
sideEffects: "none", authorization: { permission: "deployments.read" }, inputSchema: emptyInput,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "mail_dns_verify",
|
|
22
|
+
description: `Runs the same record-by-record mail DNS check for the sender domain and saves it as the domain's tracking state, so the site keeps re-checking until the records propagate (48 hours at most). Call after the records were entered. Never changes DNS. ${RETURNS} Requires deployments.publish.`,
|
|
23
|
+
sideEffects: "mutates-durable-state", authorization: { permission: "deployments.publish" }, inputSchema: emptyInput,
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
export const mailDnsDerivedRisk = new Map([
|
|
27
|
+
// -> provider domainStatus/domainRequirements reads + resolver reads; no stored state.
|
|
28
|
+
["mail_dns_status", "none"],
|
|
29
|
+
// -> the same reads + DomainBindingStore.put through verifyDomainDns.
|
|
30
|
+
["mail_dns_verify", "mutates-durable-state"],
|
|
31
|
+
]);
|
|
32
|
+
async function authorizeFor({ deps, principalId, permission }, _options = {}) {
|
|
33
|
+
await requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: deps.authorize }), workspaceId: deps.workspaceId, principalId, permission }, { entityType: "domain-dns" });
|
|
34
|
+
}
|
|
35
|
+
/** The operation ports from the DNS change deps (the same composition the dns_* tools use). */
|
|
36
|
+
export function mailDnsPorts(deps) {
|
|
37
|
+
return {
|
|
38
|
+
registry: deps.registry, resolver: deps.resolver, context: deps.context, now: deps.now,
|
|
39
|
+
...(deps.bindings ? { bindings: deps.bindings } : {}), ...(deps.mailRequirements ? { mailRequirements: deps.mailRequirements } : {}),
|
|
40
|
+
...(deps.senderDomainVerification ? { senderDomainVerification: deps.senderDomainVerification } : {}),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The two mail DNS tools under the `domain-dns` contributor.
|
|
45
|
+
* @complexity O(1) registration; effects happen only when a handler runs.
|
|
46
|
+
* @example buildMailDnsRegistrations(deps)
|
|
47
|
+
*/
|
|
48
|
+
export function buildMailDnsRegistrations(deps) {
|
|
49
|
+
return buildDomainRegistrations({ metadata: toolMetadata, domain: "domain-dns", catalogModule: "dns/site/mail-dns-tools.ts", catalog: indexCatalogById({ catalog: mailDnsAgentToolCatalog }), derivedRisk: mailDnsDerivedRisk, handlers: {
|
|
50
|
+
mail_dns_status: async (ctx) => {
|
|
51
|
+
requireInputRecord({ input: ctx.input });
|
|
52
|
+
await authorizeFor({ deps, principalId: ctx.principal.id, permission: "deployments.read" });
|
|
53
|
+
return readMailDnsStatus({}, mailDnsPorts(deps));
|
|
54
|
+
},
|
|
55
|
+
mail_dns_verify: async (ctx) => {
|
|
56
|
+
requireInputRecord({ input: ctx.input });
|
|
57
|
+
await authorizeFor({ deps, principalId: ctx.principal.id, permission: "deployments.publish" });
|
|
58
|
+
return verifyMailDnsStatus({}, mailDnsPorts(deps));
|
|
59
|
+
},
|
|
60
|
+
} });
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=mail-dns-tools.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DomainRequirement } from "@jini-ai/core/provider-registry";
|
|
2
|
+
import { type DnsPlanRequirement, type DnsProvider, type DnsProviderContext } from "../index.js";
|
|
3
|
+
/** What a caller may ask to add to a hostname's requirements. */
|
|
4
|
+
export type DnsRequirementInclude = "mail";
|
|
5
|
+
/** Who "asked" for the DMARC hint, so a later refresh can replace it. */
|
|
6
|
+
export declare const DMARC_HINT_PROVIDER_ID = "dmarc-hint";
|
|
7
|
+
/** Monitoring only: receivers report, nothing is rejected, so it cannot break delivery. */
|
|
8
|
+
export declare const DMARC_HINT_VALUE = "v=DMARC1; p=none";
|
|
9
|
+
/** Returns the transactional provider's records for the sender domain, or `null` when unconfigured. */
|
|
10
|
+
export type MailRequirementsPort = (required: {
|
|
11
|
+
workspaceId: string;
|
|
12
|
+
}) => Promise<DomainRequirement | null>;
|
|
13
|
+
interface MailPorts {
|
|
14
|
+
provider: DnsProvider;
|
|
15
|
+
context: DnsProviderContext;
|
|
16
|
+
mailRequirements?: MailRequirementsPort;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Append the active mail provider's records for its sender domain to `requirements`, replacing any
|
|
20
|
+
* earlier copy of them (and of the DMARC hint) so a refresh never duplicates. Caller errors when the
|
|
21
|
+
* site cannot report mail requirements or the sender domain is outside the hostname.
|
|
22
|
+
* @complexity One port call, then at most one zone lookup and one record listing.
|
|
23
|
+
*/
|
|
24
|
+
export declare function withMailRequirements(required: {
|
|
25
|
+
hostname: string;
|
|
26
|
+
requirements: DnsPlanRequirement[];
|
|
27
|
+
errorPrefix: string;
|
|
28
|
+
}, ports: MailPorts): Promise<DnsPlanRequirement[]>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=mail-requirements.d.ts.map
|