@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,42 @@
|
|
|
1
|
+
import { type ExportReport } from "./static-copy.js";
|
|
2
|
+
import { type StaticDownloadHost } from "./static-download-layout.js";
|
|
3
|
+
/** `source-control`'s `StaticSiteIdentity` and `StaticSitePackage`, written out so `site-backup` does not import the
|
|
4
|
+
* port it implements. Composition checks the fit where it assigns this packager (`deps.ts:2712`, `publish-export.ts:239`). */
|
|
5
|
+
type SiteIdentity = {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly slug: string;
|
|
8
|
+
readonly theme: string;
|
|
9
|
+
readonly themeId: string;
|
|
10
|
+
};
|
|
11
|
+
type SitePackage = {
|
|
12
|
+
readonly ok: true;
|
|
13
|
+
readonly files: {
|
|
14
|
+
readonly path: string;
|
|
15
|
+
readonly data: string | Buffer;
|
|
16
|
+
}[];
|
|
17
|
+
} | {
|
|
18
|
+
readonly ok: false;
|
|
19
|
+
readonly kind: "destination-collision";
|
|
20
|
+
readonly message: string;
|
|
21
|
+
};
|
|
22
|
+
/** Host values the packager cannot own: the download layout's host policy and the archive-wide path claim (a collision or alias refuses). */
|
|
23
|
+
export interface StaticSitePackagerDeps {
|
|
24
|
+
host: StaticDownloadHost;
|
|
25
|
+
claimArchivePaths: (required: {
|
|
26
|
+
entries: readonly {
|
|
27
|
+
path: string;
|
|
28
|
+
}[];
|
|
29
|
+
}, optional: {
|
|
30
|
+
manifest: boolean;
|
|
31
|
+
}) => void;
|
|
32
|
+
}
|
|
33
|
+
/** Stateless: one instance serves every commit and preview. */
|
|
34
|
+
export declare function createStaticSitePackager(deps: StaticSitePackagerDeps, _optional?: Record<string, never>): {
|
|
35
|
+
readonly entryFile: string;
|
|
36
|
+
readonly packageSite: (required: {
|
|
37
|
+
report: ExportReport;
|
|
38
|
+
site: SiteIdentity;
|
|
39
|
+
}, optional?: Record<string, never>) => SitePackage;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=static-site-packager.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SiteShareRefusal } from "./share-refusal.js";
|
|
2
|
+
import { prepareStaticReport } from "./static-copy.js";
|
|
3
|
+
import { LANDING_FILE } from "./static-download-landing.js";
|
|
4
|
+
import { staticDownloadLayout } from "./static-download-layout.js";
|
|
5
|
+
/**
|
|
6
|
+
* @file Implements `source-control`'s `StaticSitePackagerPort`: the same portable static copy the
|
|
7
|
+
* backup/share download builds, flattened into commit files. Lives beside the code it calls so
|
|
8
|
+
* `source-control` never imports `site-backup`.
|
|
9
|
+
*/
|
|
10
|
+
/** Active-theme portable packaging: the static-download layout, destination paths claimed (a collision or alias refuses). `site` is the
|
|
11
|
+
* identity pinned BEFORE rendering, so an owner changing the live selection mid-export cannot split it. */
|
|
12
|
+
function packageSite({ report, site, deps }, _options = {}) {
|
|
13
|
+
try {
|
|
14
|
+
const rendered = prepareStaticReport({ report, sourceEdits: deps.host.sourceEdits });
|
|
15
|
+
const files = staticDownloadLayout({ host: deps.host, copy: { files: rendered.files, publicOrigin: rendered.publicOrigin, siteSlug: site.slug, themeId: site.themeId,
|
|
16
|
+
metadata: { theme: site.theme, routes: rendered.routes, redirectFiles: rendered.redirectFiles, failed: rendered.failed, skipped: rendered.skipped },
|
|
17
|
+
readme: { name: site.name } } }).map(file => ({ path: file.path, data: file.content }));
|
|
18
|
+
deps.claimArchivePaths({ entries: files }, { manifest: false });
|
|
19
|
+
return { ok: true, files };
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
if (error instanceof SiteShareRefusal && /collision|aliases/i.test(error.message)) {
|
|
23
|
+
return { ok: false, kind: "destination-collision", message: error.message };
|
|
24
|
+
}
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** Stateless: one instance serves every commit and preview. */
|
|
29
|
+
export function createStaticSitePackager(deps, _optional = {}) {
|
|
30
|
+
return { entryFile: LANDING_FILE, packageSite: ({ report, site }, options = {}) => packageSite({ report, site, deps }, options) };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=static-site-packager.js.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { buildDomainRegistrations, type AgentToolDefinition, type AgentToolSideEffect, type ToolRegistration, type ToolExecutionContext, type ToolContributor } from "@jini-ai/core";
|
|
2
|
+
import { type ModelFacingErrorRule } from "@jini-ai/core/model-facing-tool-errors";
|
|
3
|
+
import type { AssistantSurfaceDeps } from "@jini-ai/core/contracts/site/daemon-surface-exchanges";
|
|
4
|
+
import type { AuthorizeFn } from "@jini-ai/core/contracts/events";
|
|
5
|
+
import type { SiteImportBackend } from "./import-backend.js";
|
|
6
|
+
import type { SiteShareBackend } from "./share-backend.js";
|
|
7
|
+
import type { parseSiteImportInput } from "./import-backend.js";
|
|
8
|
+
import type { StaticExportInput } from "./static-export-selection.js";
|
|
9
|
+
export interface SiteBackupToolDeps {
|
|
10
|
+
readonly authorize: AuthorizeFn;
|
|
11
|
+
readonly workspaceId: string;
|
|
12
|
+
readonly siteImportBackend?: Pick<SiteImportBackend, "importBackup" | "listPage">;
|
|
13
|
+
readonly siteShareBackend?: Pick<SiteShareBackend, "create" | "list" | "revoke">;
|
|
14
|
+
}
|
|
15
|
+
/** The host binds its own `StaticExportSelectionPolicy` into the injected parser, so the wiring layer never owns path policy or refusal text. */
|
|
16
|
+
type ParseStaticExportInput = (required: {
|
|
17
|
+
input: unknown;
|
|
18
|
+
}) => StaticExportInput;
|
|
19
|
+
export declare function createSiteBackupCatalog(required: {
|
|
20
|
+
importDescription: string;
|
|
21
|
+
commitDescription: string;
|
|
22
|
+
shareDescription: string;
|
|
23
|
+
}, _optional?: {}): AgentToolDefinition[];
|
|
24
|
+
/** This wiring layer's own risk classification, cross-checked against the catalog's `sideEffects`. */
|
|
25
|
+
export declare const siteBackupDerivedRisk: ReadonlyMap<string, AgentToolSideEffect>;
|
|
26
|
+
/**
|
|
27
|
+
* Builds this domain's `ToolRegistration[]`.
|
|
28
|
+
*
|
|
29
|
+
* @complexity O(1) at registration.
|
|
30
|
+
*/
|
|
31
|
+
export declare function bindSiteBackupTools<THost, TRequest extends SiteBackupToolDeps>(required: {
|
|
32
|
+
importDescription: string;
|
|
33
|
+
commitDescription: string;
|
|
34
|
+
shareDescription: string;
|
|
35
|
+
catalogModule: string;
|
|
36
|
+
toolMetadata: NonNullable<Parameters<typeof buildDomainRegistrations>[0]["metadata"]>;
|
|
37
|
+
modelFacingErrors: readonly ModelFacingErrorRule[];
|
|
38
|
+
parseStaticExportInput: ParseStaticExportInput;
|
|
39
|
+
parseSiteImportInput: typeof parseSiteImportInput;
|
|
40
|
+
parseSiteImportListQuery: (required: {
|
|
41
|
+
query: Record<string, unknown>;
|
|
42
|
+
}) => {
|
|
43
|
+
ok: true;
|
|
44
|
+
value: {
|
|
45
|
+
cursor?: string;
|
|
46
|
+
};
|
|
47
|
+
} | {
|
|
48
|
+
ok: false;
|
|
49
|
+
error: {
|
|
50
|
+
message: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
resolveDeps: (required: {
|
|
54
|
+
deps: THost;
|
|
55
|
+
ctx: ToolExecutionContext;
|
|
56
|
+
}, optional: Record<string, never>) => TRequest;
|
|
57
|
+
planSiteBackup: (required: {
|
|
58
|
+
deps: TRequest;
|
|
59
|
+
call: ToolExecutionContext;
|
|
60
|
+
}, optional: Record<string, never>) => Promise<unknown>;
|
|
61
|
+
pushSiteBackup: (required: {
|
|
62
|
+
deps: TRequest;
|
|
63
|
+
call: ToolExecutionContext;
|
|
64
|
+
}, optional: Record<string, never>) => Promise<unknown>;
|
|
65
|
+
}, _optional?: Record<string, never>): {
|
|
66
|
+
siteBackupAgentToolCatalog: AgentToolDefinition[];
|
|
67
|
+
buildSiteBackupRegistrations: ({ deps: mountedDeps, surfaces: _surfaces }: {
|
|
68
|
+
deps: THost;
|
|
69
|
+
surfaces: AssistantSurfaceDeps;
|
|
70
|
+
}, _optional?: Record<string, never>) => ToolRegistration[];
|
|
71
|
+
contributeSiteBackupTools: (_required: Record<string, never>, _optional?: Record<string, never>) => ToolContributor<THost, AssistantSurfaceDeps>;
|
|
72
|
+
};
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=tool-registrations.d.ts.map
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { buildDomainRegistrations, indexCatalogById, requireInputRecord, requireString, adaptLegacyAuthorize, requireToolPermission } from "@jini-ai/core";
|
|
2
|
+
import { withModelFacingErrors } from "@jini-ai/core/model-facing-tool-errors";
|
|
3
|
+
import { SiteShareRefusal } from "./share-refusal.js";
|
|
4
|
+
import { PLAN_TOOL_ID, PUSH_PERMISSION, SITE_BACKUP_DOMAIN as DOMAIN, SITE_BACKUP_PUSH_TOOL_ID } from "./backup-service.js";
|
|
5
|
+
const MUTATES_DURABLE_STATE = "mutates-durable-state";
|
|
6
|
+
/**
|
|
7
|
+
* @file The site-backup domain's agent tools: Git backup (`site_backup_plan`/`site_backup_push`, whose
|
|
8
|
+
* logic and safety rules live in `backup-service.ts`, shared with the admin Git backup route), site
|
|
9
|
+
* shares (`site_share_*`) and imports (`site_import_*`). This module is the catalog, the risk map and
|
|
10
|
+
* the thin handlers.
|
|
11
|
+
*/
|
|
12
|
+
const INCLUDE_SCHEMA = {
|
|
13
|
+
type: "object",
|
|
14
|
+
additionalProperties: false,
|
|
15
|
+
description: "Which parts of the site to back up. Every switch defaults to true; set one to false to leave it out.",
|
|
16
|
+
properties: {
|
|
17
|
+
database: { type: "boolean", description: "The site database: content, menus, media records and settings. No accounts, members, form submissions, sessions or saved credentials. Credential-looking content is retained with warnings." },
|
|
18
|
+
media: { type: "boolean", description: "Uploaded media files (not chat attachments)." },
|
|
19
|
+
themes: { type: "boolean", description: "Installed themes." },
|
|
20
|
+
plugins: { type: "boolean", description: "Installed agent plugins and skills (never plugin OAuth data)." },
|
|
21
|
+
settings: { type: "boolean", description: "The site's config.json and .site-meta.json." },
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
const PLAN_SCHEMA = {
|
|
25
|
+
type: "object",
|
|
26
|
+
additionalProperties: false,
|
|
27
|
+
required: ["owner", "repo"],
|
|
28
|
+
properties: {
|
|
29
|
+
credential: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Label of the saved custom credential or host connection to push with. Optional when exactly one saved custom credential points at a host's apiOrigin (source_control_get_capabilities lists each host's apiOrigin), or when none does and the host has a saved connection.",
|
|
32
|
+
},
|
|
33
|
+
owner: { type: "string", description: "Owner or organization (the account) of the target repository on the host." },
|
|
34
|
+
repo: { type: "string", description: "Target repository name. It must be PRIVATE and already have at least one commit." },
|
|
35
|
+
branch: { type: "string", description: "Branch to commit to. Optional; defaults to the repository's default branch. Must already exist." },
|
|
36
|
+
folder: {
|
|
37
|
+
type: "string",
|
|
38
|
+
description: "Repository-relative folder the backup is written to; it is REPLACED as a whole by each backup. Optional; defaults to the site's folder name.",
|
|
39
|
+
},
|
|
40
|
+
include: INCLUDE_SCHEMA,
|
|
41
|
+
commitMessage: { type: "string" },
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
const PUSH_SCHEMA = {
|
|
45
|
+
type: "object",
|
|
46
|
+
additionalProperties: false,
|
|
47
|
+
required: ["planId"],
|
|
48
|
+
properties: { planId: { type: "string", description: "The planId site_backup_plan returned. Single-use; valid for 10 minutes." } },
|
|
49
|
+
};
|
|
50
|
+
export function createSiteBackupCatalog(required, _optional = {}) {
|
|
51
|
+
return [
|
|
52
|
+
{ name: "site_import_backup",
|
|
53
|
+
description: required.importDescription,
|
|
54
|
+
sideEffects: MUTATES_DURABLE_STATE, authorization: { permission: "system.write" },
|
|
55
|
+
inputSchema: { type: "object", additionalProperties: false, oneOf: [{ required: ["url"] }, { required: ["uploadId"] }], properties: { url: { type: "string", description: "Public HTTPS share URL." }, uploadId: { type: "string", description: "ID from the authenticated application/zip upload endpoint; never a filesystem path." }, displayName: { type: "string", maxLength: 200 }, requestId: { type: "string", maxLength: 128, description: "Reuse for a retry of the same import. Omit for a separate import." } } },
|
|
56
|
+
},
|
|
57
|
+
{ name: "site_import_list", description: "List your private import history: date, source, new site, status and opening/setup instructions. Does not include other principals' imports or credentials.",
|
|
58
|
+
sideEffects: "none", authorization: { permission: "system.read" }, inputSchema: { type: "object", additionalProperties: false, properties: { cursor: { type: "string", maxLength: 96, description: "nextCursor from the previous page." } } },
|
|
59
|
+
},
|
|
60
|
+
{ name: PLAN_TOOL_ID,
|
|
61
|
+
description: "Plans a BACKUP OF THIS SITE to a private repository on a git host a turned-on Agent Plugin provides (source_control_get_capabilities lists each host with its label, apiOrigin and maxFileBytes) — the site's database (content and settings; never accounts, members, form submissions, sessions or saved credentials), media, themes, installed plugins and skills, and settings — as one folder, through the host's connection saved with credential_save with kind source-control or a saved custom credential (Access Tokens page -> 'Add custom provider', base URL = that host's apiOrigin). With no connection yet, tell the person the repository rules below and ask which repository first, then open that form. Use this to back up or keep a copy of the site itself; to publish the RENDERED site to a repository use source_control_execute_commit instead. Read-only: it writes nothing anywhere. It checks the credential, that the repository is PRIVATE (public and internal repositories are refused, because the backup holds unpublished content), that the credential can push, that the branch exists (defaults to the repository's default branch; an empty repository is refused — it needs a first commit such as a README), snapshots the database through the share policy, lists every file with its size, and checks the limits (a media, theme or plugin file over the host's maxFileBytes is left out and listed in skipped; the database over it fails the plan; at most 3000 files and 1 GiB). Returns {planned: true, planId, expiresAt, credential, repository, visibility, branch, folder, folderExists, include, fileCount, totalBytes, totalSize, files: [{path, bytes}], skipped, credentialWarnings, notes, nextStep}, or {planned: false, code, message} naming what to fix (codes: CREDENTIAL_NOT_FOUND, CREDENTIAL_AMBIGUOUS, CREDENTIAL_UNREADABLE, REPOSITORY_NOT_FOUND, REPOSITORY_NOT_PRIVATE, NO_PUSH_PERMISSION, REPOSITORY_EMPTY, BRANCH_NOT_FOUND, FOLDER_IS_FILE, DATABASE_SNAPSHOT_FAILED, UNSUPPORTED_DATA, UNSUPPORTED_SCHEMA, LIMIT_EXCEEDED, PROVIDER_ERROR, NETWORK_UNREACHABLE, UNAVAILABLE). Show the human the plan (repository, branch, folder, what is included, file count and size, anything skipped, and credentialWarnings), then call site_backup_push with the planId.",
|
|
62
|
+
sideEffects: "none",
|
|
63
|
+
authorization: { permission: PUSH_PERMISSION },
|
|
64
|
+
inputSchema: { ...PLAN_SCHEMA, properties: { ...PLAN_SCHEMA.properties, commitMessage: { ...PLAN_SCHEMA.properties.commitMessage, description: required.commitDescription } } },
|
|
65
|
+
},
|
|
66
|
+
{ name: SITE_BACKUP_PUSH_TOOL_ID,
|
|
67
|
+
description: "Pushes the single-use plan from site_backup_plan immediately in one non-force Git commit. Requires the original permissions and principal binding, and re-checks that the repository is private, the branch is unchanged and the planned files are fresh. Replaces only the backup folder; previous contents remain recoverable in Git history. Returns {pushed:true, commitSha, commitUrl, repository, branch, folder, filesWritten, totalBytes}. A large backup can take longer than one call: then it returns {pushed:false, cancelled:false, inProgress:true, planId, progress:{filesDone, filesTotal, bytesDone, bytesTotal}, message} while the upload keeps running; tell the human how far it is and call site_backup_push again with the SAME planId to keep waiting (it never starts a second upload). Failures return {pushed:false, cancelled:false, code, message}, including expired/missing plans, changed branches or files, public repositories and credential/provider/network errors; a failed upload names the file. Transient network errors, host errors and rate limits are already retried with backoff, so do not retry NETWORK_UNREACHABLE in a loop. Plan again after PLAN_STALE, DIVERGED_BRANCH or plan expiry.",
|
|
68
|
+
sideEffects: MUTATES_DURABLE_STATE,
|
|
69
|
+
authorization: { permission: PUSH_PERMISSION },
|
|
70
|
+
inputSchema: PUSH_SCHEMA,
|
|
71
|
+
},
|
|
72
|
+
{ name: "site_share_create",
|
|
73
|
+
description: required.shareDescription,
|
|
74
|
+
sideEffects: MUTATES_DURABLE_STATE,
|
|
75
|
+
authorization: { permission: PUSH_PERMISSION },
|
|
76
|
+
inputSchema: { type: "object", additionalProperties: false, properties: { jobId: { type: "string", description: "Only when polling: the jobId returned by this same create operation." } } },
|
|
77
|
+
},
|
|
78
|
+
{ name: "site_export_static",
|
|
79
|
+
description: "Export THIS SITE as rendered HTML, CSS, JavaScript and assets through selected installed themes (themeIds, in selection order; omit for the active theme). Creates one private ZIP download with a date-time filename; extract the ZIP, then open index.html in a browser; it lists every exported theme and its pages. Includes README.txt with its time, theme and known gaps, sites/<theme>/ pages and theme assets, and referenced public media in media/. Links are relative to each file so the copy opens from disk. Private Library documents are excluded. No database backup or public upload. Returns {shareId,file,downloadUrl}, or {jobId,phase,progress}; poll with ONLY the SAME jobId, without themeIds. Partial renders include their successful pages and disclose gaps. Does not require an already-running public server.",
|
|
80
|
+
sideEffects: MUTATES_DURABLE_STATE,
|
|
81
|
+
authorization: { permission: PUSH_PERMISSION },
|
|
82
|
+
inputSchema: { type: "object", additionalProperties: false, properties: { publicUrl: { type: "string", description: "Optional public HTTPS destination for absolute sitemap, feed and SEO URLs. Omit when unknown; start only." }, jobId: { type: "string", description: "Only when polling this static export; never combine with themeIds." }, themeIds: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string" }, description: "Ordered installed theme IDs. Start only; defaults to the active theme." } } },
|
|
83
|
+
},
|
|
84
|
+
{ name: "site_share_list",
|
|
85
|
+
description: "List THIS SITE's private export registry, including active, failed and revoked exports: shareId, site, creation/revocation dates, bytes, sha256, status, link and ZIP download path. Requires site-backup.push; there is no anonymous export index. Does not create an export or reveal storage credentials.",
|
|
86
|
+
sideEffects: "none",
|
|
87
|
+
authorization: { permission: PUSH_PERMISSION },
|
|
88
|
+
inputSchema: { type: "object", additionalProperties: false, properties: {} },
|
|
89
|
+
},
|
|
90
|
+
{ name: "site_share_revoke",
|
|
91
|
+
description: "Revoke THIS SITE's export by shareId. Disables its public token first, deletes the ZIP from private and remote storage, and verifies remote disappearance. Revoked entries remain in site_share_list. Cleanup/purge failures are reported and retrying the same shareId retries deletion. Already downloaded copies cannot be recalled.",
|
|
92
|
+
sideEffects: MUTATES_DURABLE_STATE,
|
|
93
|
+
authorization: { permission: PUSH_PERMISSION },
|
|
94
|
+
inputSchema: { type: "object", additionalProperties: false, required: ["shareId"], properties: { shareId: { type: "string" } } },
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
/** This wiring layer's own risk classification, cross-checked against the catalog's `sideEffects`. */
|
|
99
|
+
export const siteBackupDerivedRisk = new Map([
|
|
100
|
+
["site_import_backup", MUTATES_DURABLE_STATE],
|
|
101
|
+
["site_import_list", "none"],
|
|
102
|
+
// -> a non-decrypting credential list, one decrypting resolve, four read-only host GETs, a
|
|
103
|
+
// database snapshot held in memory (its restore-point file deleted at once), a disk walk, and an
|
|
104
|
+
// in-memory plan. Nothing durable is written anywhere.
|
|
105
|
+
[PLAN_TOOL_ID, "none"],
|
|
106
|
+
// -> blobs, trees, a commit and a non-force ref update in a
|
|
107
|
+
// THIRD-PARTY repository — the same classification custom_credential_write_files carries.
|
|
108
|
+
[SITE_BACKUP_PUSH_TOOL_ID, MUTATES_DURABLE_STATE],
|
|
109
|
+
["site_share_create", MUTATES_DURABLE_STATE],
|
|
110
|
+
["site_export_static", MUTATES_DURABLE_STATE],
|
|
111
|
+
["site_share_list", "none"],
|
|
112
|
+
["site_share_revoke", MUTATES_DURABLE_STATE],
|
|
113
|
+
]);
|
|
114
|
+
const SHARE_ACTIONS = {
|
|
115
|
+
static: async ({ backend, raw, ctx, parseStaticExportInput }) => backend.create({ principalId: ctx.principal.id, signal: ctx.signal, format: "static", ...parseStaticExportInput({ input: raw }) }),
|
|
116
|
+
list: async ({ backend, raw }) => {
|
|
117
|
+
if (Object.keys(raw).length)
|
|
118
|
+
throw new SiteShareRefusal({ code: "INVALID_INPUT", message: "site_share_list takes no fields." });
|
|
119
|
+
return { shares: await backend.list({}) };
|
|
120
|
+
},
|
|
121
|
+
revoke: async ({ backend, raw }) => {
|
|
122
|
+
if (Object.keys(raw).some(key => key !== "shareId"))
|
|
123
|
+
throw new SiteShareRefusal({ code: "INVALID_INPUT", message: "Only shareId is accepted." });
|
|
124
|
+
return await backend.revoke({ shareId: requireString({ input: raw, key: "shareId" }) });
|
|
125
|
+
},
|
|
126
|
+
create: async ({ backend, raw, ctx, format }) => {
|
|
127
|
+
if (Object.keys(raw).some(key => key !== "jobId") || raw.jobId !== undefined && (typeof raw.jobId !== "string" || !/^[0-9a-f-]{36}$/.test(raw.jobId)))
|
|
128
|
+
throw new SiteShareRefusal({ code: "INVALID_INPUT", message: "Only an optional share jobId is accepted." });
|
|
129
|
+
return await backend.create({ principalId: ctx.principal.id, signal: ctx.signal, ...(format ? { format } : {}), ...(typeof raw.jobId === "string" ? { jobId: raw.jobId } : {}) });
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
/** Authorization stays on the existing backup contributor; backend effects are shared with HTTP. */
|
|
133
|
+
async function handleShare(required, _optional = {}) {
|
|
134
|
+
const { deps, ctx, action, parseStaticExportInput } = required;
|
|
135
|
+
const raw = requireInputRecord({ input: ctx.input });
|
|
136
|
+
await requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: deps.authorize }), workspaceId: deps.workspaceId, principalId: ctx.principal.id, permission: PUSH_PERMISSION }, { entityType: DOMAIN });
|
|
137
|
+
if (!deps.siteShareBackend)
|
|
138
|
+
return { ok: false, code: "UNAVAILABLE", message: "Site sharing requires a site folder and private storage." };
|
|
139
|
+
try {
|
|
140
|
+
return await SHARE_ACTIONS[action]({ backend: deps.siteShareBackend, raw, ctx, parseStaticExportInput });
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
if (error instanceof SiteShareRefusal)
|
|
144
|
+
return { ok: false, code: error.code, message: error.message };
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Builds this domain's `ToolRegistration[]`.
|
|
150
|
+
*
|
|
151
|
+
* @complexity O(1) at registration.
|
|
152
|
+
*/
|
|
153
|
+
export function bindSiteBackupTools(required, _optional = {}) {
|
|
154
|
+
const siteBackupAgentToolCatalog = createSiteBackupCatalog(required);
|
|
155
|
+
const catalog = indexCatalogById({ catalog: siteBackupAgentToolCatalog });
|
|
156
|
+
const buildSiteBackupRegistrations = ({ deps: mountedDeps, surfaces: _surfaces }, _optional = {}) => {
|
|
157
|
+
const handlers = {
|
|
158
|
+
site_import_backup: ctx => handleImport({ deps: required.resolveDeps({ deps: mountedDeps, ctx }, {}), ctx, list: false, parseSiteImportInput: required.parseSiteImportInput, parseSiteImportListQuery: required.parseSiteImportListQuery }),
|
|
159
|
+
site_import_list: ctx => handleImport({ deps: required.resolveDeps({ deps: mountedDeps, ctx }, {}), ctx, list: true, parseSiteImportInput: required.parseSiteImportInput, parseSiteImportListQuery: required.parseSiteImportListQuery }),
|
|
160
|
+
[PLAN_TOOL_ID]: ctx => required.planSiteBackup({ deps: required.resolveDeps({ deps: mountedDeps, ctx }, {}), call: ctx }, {}),
|
|
161
|
+
[SITE_BACKUP_PUSH_TOOL_ID]: ctx => required.pushSiteBackup({ deps: required.resolveDeps({ deps: mountedDeps, ctx }, {}), call: ctx }, {}),
|
|
162
|
+
site_share_create: ctx => handleShare({ deps: required.resolveDeps({ deps: mountedDeps, ctx }, {}), ctx, action: "create", parseStaticExportInput: required.parseStaticExportInput }),
|
|
163
|
+
site_export_static: ctx => handleShare({ deps: required.resolveDeps({ deps: mountedDeps, ctx }, {}), ctx, action: "static", parseStaticExportInput: required.parseStaticExportInput }),
|
|
164
|
+
site_share_list: ctx => handleShare({ deps: required.resolveDeps({ deps: mountedDeps, ctx }, {}), ctx, action: "list", parseStaticExportInput: required.parseStaticExportInput }),
|
|
165
|
+
site_share_revoke: ctx => handleShare({ deps: required.resolveDeps({ deps: mountedDeps, ctx }, {}), ctx, action: "revoke", parseStaticExportInput: required.parseStaticExportInput }),
|
|
166
|
+
};
|
|
167
|
+
return buildDomainRegistrations({ metadata: required.toolMetadata, domain: DOMAIN, catalogModule: required.catalogModule, catalog,
|
|
168
|
+
handlers: withModelFacingErrors({ handlers, rules: required.modelFacingErrors }), derivedRisk: siteBackupDerivedRisk });
|
|
169
|
+
};
|
|
170
|
+
return {
|
|
171
|
+
siteBackupAgentToolCatalog, buildSiteBackupRegistrations,
|
|
172
|
+
contributeSiteBackupTools: (_required, _optional = {}) => ({
|
|
173
|
+
domain: DOMAIN, build: (deps, surfaces) => buildSiteBackupRegistrations({ deps, surfaces }, {}), risk: siteBackupDerivedRisk,
|
|
174
|
+
}),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/** Local creation permissions precede all download, upload consumption and registry effects. */
|
|
178
|
+
async function handleImport(required, _options = {}) {
|
|
179
|
+
const { deps, ctx, list, parseSiteImportInput, parseSiteImportListQuery } = required;
|
|
180
|
+
await requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: deps.authorize }), workspaceId: deps.workspaceId, principalId: ctx.principal.id, permission: list ? "system.read" : "system.write" }, { entityType: "site-registry" });
|
|
181
|
+
if (!deps.siteImportBackend)
|
|
182
|
+
return { ok: false, code: "UNAVAILABLE", message: "Import requires local site creation and a configured sites home." };
|
|
183
|
+
try {
|
|
184
|
+
const input = requireInputRecord({ input: ctx.input });
|
|
185
|
+
if (list) {
|
|
186
|
+
if (Object.keys(input).some(key => key !== "cursor"))
|
|
187
|
+
throw new SiteShareRefusal({ code: "INVALID_INPUT", message: "site_import_list accepts only cursor." });
|
|
188
|
+
const parsed = parseSiteImportListQuery({ query: input });
|
|
189
|
+
if (!parsed.ok)
|
|
190
|
+
throw new SiteShareRefusal({ code: "INVALID_CURSOR", message: parsed.error.message });
|
|
191
|
+
return await deps.siteImportBackend.listPage({ ...parsed.value, principalId: ctx.principal.id });
|
|
192
|
+
}
|
|
193
|
+
return await deps.siteImportBackend.importBackup({ ...parseSiteImportInput({ input }), principalId: ctx.principal.id }, { signal: ctx.signal });
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
if (error instanceof SiteShareRefusal)
|
|
197
|
+
return { ok: false, code: error.code, message: error.message };
|
|
198
|
+
throw error;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=tool-registrations.js.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The drift rules for the host desktop app's complexity ceiling, as pure functions. The CLI that
|
|
3
|
+
* runs ESLint and calls these is `scripts/check-complexity.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors `development/scripts/check-admin-complexity-drift.ts`'s design, including the two choices
|
|
6
|
+
* that file's own header argues for and which are worth restating because getting either wrong
|
|
7
|
+
* makes the ratchet decorative:
|
|
8
|
+
*
|
|
9
|
+
* **Debt is keyed per VIOLATION, never per FILE.** ESLint's flat config has no function-level
|
|
10
|
+
* scope, so a config-level relax can only ever exempt a whole file — and a per-file debt list lets
|
|
11
|
+
* every OTHER function in a listed file drift unnoticed. `App.hooks.ts` is 1272 lines; exempting it
|
|
12
|
+
* wholesale would create a complexity-free zone. So identity is (rule, file, message).
|
|
13
|
+
*
|
|
14
|
+
* **Identity deliberately excludes the line number.** Two functions in one file can produce the
|
|
15
|
+
* identical message at different lines, and a line-keyed entry goes stale on every edit above it —
|
|
16
|
+
* which turns the debt list into noise and trains people to regenerate it wholesale, which is the
|
|
17
|
+
* same as not having one.
|
|
18
|
+
*
|
|
19
|
+
* ## What this file adds beyond the admin version
|
|
20
|
+
*
|
|
21
|
+
* A **non-vacuity check**. `main.ts` reports zero violations at a 9 ceiling, which is true — forcing
|
|
22
|
+
* the threshold to 1 produces 34 findings on the same file, so the rule really is reaching it. But
|
|
23
|
+
* "zero violations" and "the glob matched nothing" are indistinguishable from an exit code, and
|
|
24
|
+
* this repo has already shipped four complexity scopes that silently matched nothing after a
|
|
25
|
+
* restructure (`check-src-complexity-drift.ts` scans nine directories; four no longer exist, and
|
|
26
|
+
* `--no-error-on-unmatched-pattern` turns that into silence). So {@link evaluateRun} requires a
|
|
27
|
+
* minimum linted-file count and fails when the scan shrinks, no matter how clean the result looks.
|
|
28
|
+
*/
|
|
29
|
+
/** One complexity finding, as `complexity-debt.json` stores it. `reason` is ESLint's message. */
|
|
30
|
+
export interface ComplexityViolation {
|
|
31
|
+
rule: string;
|
|
32
|
+
file: string;
|
|
33
|
+
reason: string;
|
|
34
|
+
}
|
|
35
|
+
/** The slice of one ESLint `-f json` message this file reads. `ruleId` is `null` for a parse error. */
|
|
36
|
+
export interface EslintMessage {
|
|
37
|
+
ruleId: string | null;
|
|
38
|
+
message: string;
|
|
39
|
+
}
|
|
40
|
+
/** The slice of one ESLint `-f json` file result this file reads. */
|
|
41
|
+
export interface EslintFileResult {
|
|
42
|
+
filePath: string;
|
|
43
|
+
messages: readonly EslintMessage[];
|
|
44
|
+
}
|
|
45
|
+
/** {@link diffAgainstBaseline}'s multiset difference. */
|
|
46
|
+
export interface BaselineDiff {
|
|
47
|
+
added: ComplexityViolation[];
|
|
48
|
+
removed: ComplexityViolation[];
|
|
49
|
+
}
|
|
50
|
+
/** {@link evaluateRun}'s verdict. `failures` empty means the gate passes. */
|
|
51
|
+
export interface ComplexityRunVerdict extends BaselineDiff {
|
|
52
|
+
current: ComplexityViolation[];
|
|
53
|
+
filesLinted: number;
|
|
54
|
+
failures: string[];
|
|
55
|
+
}
|
|
56
|
+
/** Stable identity for one violation: `|`-joined because ESLint's own messages contain colons,
|
|
57
|
+
* quotes and periods, so any human-readable separator risks two distinct violations colliding.
|
|
58
|
+
* @complexity O(1). */
|
|
59
|
+
export declare function violationKey(violation: ComplexityViolation): string;
|
|
60
|
+
/**
|
|
61
|
+
* Multiset difference between the grandfathered baseline and what ESLint reports now.
|
|
62
|
+
*
|
|
63
|
+
* @returns `{ added, removed }` — `added` fails the gate; `removed` is a prompt to shrink the list,
|
|
64
|
+
* never a failure (a fix must not be punished).
|
|
65
|
+
* @complexity O(n) in violations.
|
|
66
|
+
*/
|
|
67
|
+
export declare function diffAgainstBaseline({ baseline, current }: {
|
|
68
|
+
baseline: readonly ComplexityViolation[];
|
|
69
|
+
current: readonly ComplexityViolation[];
|
|
70
|
+
}, _options?: {}): BaselineDiff;
|
|
71
|
+
/**
|
|
72
|
+
* Turn one ESLint JSON run into a verdict.
|
|
73
|
+
*
|
|
74
|
+
* @param input.results ESLint's `-f json` output, already parsed.
|
|
75
|
+
* @param input.baseline the grandfathered violations.
|
|
76
|
+
* @param input.minFilesLinted the smallest plausible scan size; below this the run is not trusted.
|
|
77
|
+
* @returns `{ current, added, removed, filesLinted, failures }`.
|
|
78
|
+
* @complexity O(n) in results.
|
|
79
|
+
*/
|
|
80
|
+
export declare function evaluateRun({ results, baseline, minFilesLinted }: {
|
|
81
|
+
results: readonly EslintFileResult[];
|
|
82
|
+
baseline: readonly ComplexityViolation[];
|
|
83
|
+
minFilesLinted: number;
|
|
84
|
+
}, _options?: {}): ComplexityRunVerdict;
|
|
85
|
+
/**
|
|
86
|
+
* Whether an ESLint child process produced a usable report.
|
|
87
|
+
*
|
|
88
|
+
* ESLint exits 1 when it merely FINDS problems — the expected case here — and 2 when it CRASHED,
|
|
89
|
+
* with empty stdout. A caller testing `status !== 1` reads that crash as a pass. This repo has the
|
|
90
|
+
* scar: the admin ratchet's `--rule` technique exits 2 on any desktop-app glob whose directory
|
|
91
|
+
* contains a `.js` file, because no config block matching those files declared the sonarjs plugin.
|
|
92
|
+
*
|
|
93
|
+
* @returns `null` when usable, else the reason it is not.
|
|
94
|
+
* @complexity O(1).
|
|
95
|
+
*/
|
|
96
|
+
export declare function rejectUnusableEslintRun({ status, stdout }: {
|
|
97
|
+
status: number | null;
|
|
98
|
+
stdout: string | null | undefined;
|
|
99
|
+
}, _options?: {}): string | null;
|
|
100
|
+
//# sourceMappingURL=complexity-debt.d.ts.map
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The drift rules for the host desktop app's complexity ceiling, as pure functions. The CLI that
|
|
3
|
+
* runs ESLint and calls these is `scripts/check-complexity.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors `development/scripts/check-admin-complexity-drift.ts`'s design, including the two choices
|
|
6
|
+
* that file's own header argues for and which are worth restating because getting either wrong
|
|
7
|
+
* makes the ratchet decorative:
|
|
8
|
+
*
|
|
9
|
+
* **Debt is keyed per VIOLATION, never per FILE.** ESLint's flat config has no function-level
|
|
10
|
+
* scope, so a config-level relax can only ever exempt a whole file — and a per-file debt list lets
|
|
11
|
+
* every OTHER function in a listed file drift unnoticed. `App.hooks.ts` is 1272 lines; exempting it
|
|
12
|
+
* wholesale would create a complexity-free zone. So identity is (rule, file, message).
|
|
13
|
+
*
|
|
14
|
+
* **Identity deliberately excludes the line number.** Two functions in one file can produce the
|
|
15
|
+
* identical message at different lines, and a line-keyed entry goes stale on every edit above it —
|
|
16
|
+
* which turns the debt list into noise and trains people to regenerate it wholesale, which is the
|
|
17
|
+
* same as not having one.
|
|
18
|
+
*
|
|
19
|
+
* ## What this file adds beyond the admin version
|
|
20
|
+
*
|
|
21
|
+
* A **non-vacuity check**. `main.ts` reports zero violations at a 9 ceiling, which is true — forcing
|
|
22
|
+
* the threshold to 1 produces 34 findings on the same file, so the rule really is reaching it. But
|
|
23
|
+
* "zero violations" and "the glob matched nothing" are indistinguishable from an exit code, and
|
|
24
|
+
* this repo has already shipped four complexity scopes that silently matched nothing after a
|
|
25
|
+
* restructure (`check-src-complexity-drift.ts` scans nine directories; four no longer exist, and
|
|
26
|
+
* `--no-error-on-unmatched-pattern` turns that into silence). So {@link evaluateRun} requires a
|
|
27
|
+
* minimum linted-file count and fails when the scan shrinks, no matter how clean the result looks.
|
|
28
|
+
*/
|
|
29
|
+
/** Stable identity for one violation: `|`-joined because ESLint's own messages contain colons,
|
|
30
|
+
* quotes and periods, so any human-readable separator risks two distinct violations colliding.
|
|
31
|
+
* @complexity O(1). */
|
|
32
|
+
export function violationKey(violation) {
|
|
33
|
+
return `${violation.rule}|${violation.file}|${violation.reason}`;
|
|
34
|
+
}
|
|
35
|
+
/** Counts violations by key, so the diff is a MULTISET diff — two identical messages in one file
|
|
36
|
+
* are two violations, and fixing one of them must register.
|
|
37
|
+
* @complexity O(n). */
|
|
38
|
+
function countByKey({ violations }, _options = {}) {
|
|
39
|
+
const counts = new Map();
|
|
40
|
+
for (const v of violations) {
|
|
41
|
+
const key = violationKey(v);
|
|
42
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
43
|
+
}
|
|
44
|
+
return counts;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Multiset difference between the grandfathered baseline and what ESLint reports now.
|
|
48
|
+
*
|
|
49
|
+
* @returns `{ added, removed }` — `added` fails the gate; `removed` is a prompt to shrink the list,
|
|
50
|
+
* never a failure (a fix must not be punished).
|
|
51
|
+
* @complexity O(n) in violations.
|
|
52
|
+
*/
|
|
53
|
+
export function diffAgainstBaseline({ baseline, current }, _options = {}) {
|
|
54
|
+
const baseCounts = countByKey({ violations: baseline });
|
|
55
|
+
const currentCounts = countByKey({ violations: current });
|
|
56
|
+
const byKey = new Map([...baseline, ...current].map((v) => [violationKey(v), v]));
|
|
57
|
+
const added = [];
|
|
58
|
+
const removed = [];
|
|
59
|
+
for (const [key, violation] of byKey) {
|
|
60
|
+
const delta = (currentCounts.get(key) ?? 0) - (baseCounts.get(key) ?? 0);
|
|
61
|
+
for (let i = 0; i < delta; i += 1)
|
|
62
|
+
added.push(violation);
|
|
63
|
+
for (let i = 0; i < -delta; i += 1)
|
|
64
|
+
removed.push(violation);
|
|
65
|
+
}
|
|
66
|
+
return { added, removed };
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Turn one ESLint JSON run into a verdict.
|
|
70
|
+
*
|
|
71
|
+
* @param input.results ESLint's `-f json` output, already parsed.
|
|
72
|
+
* @param input.baseline the grandfathered violations.
|
|
73
|
+
* @param input.minFilesLinted the smallest plausible scan size; below this the run is not trusted.
|
|
74
|
+
* @returns `{ current, added, removed, filesLinted, failures }`.
|
|
75
|
+
* @complexity O(n) in results.
|
|
76
|
+
*/
|
|
77
|
+
export function evaluateRun({ results, baseline, minFilesLinted }, _options = {}) {
|
|
78
|
+
const current = [];
|
|
79
|
+
for (const result of results) {
|
|
80
|
+
for (const message of result.messages) {
|
|
81
|
+
if (message.ruleId === "complexity" || message.ruleId === "sonarjs/cognitive-complexity") {
|
|
82
|
+
current.push({ rule: message.ruleId, file: result.filePath, reason: message.message });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const { added, removed } = diffAgainstBaseline({ baseline, current });
|
|
87
|
+
const failures = [];
|
|
88
|
+
// A clean result and an empty scan look identical from the outside. This is the difference.
|
|
89
|
+
if (results.length < minFilesLinted) {
|
|
90
|
+
failures.push(`only ${results.length} file(s) were linted, expected at least ${minFilesLinted}. ` +
|
|
91
|
+
`A shrinking scan reads as "no violations" — the glob is stale, or an ignore pattern is too ` +
|
|
92
|
+
`broad. This is NOT a clean result.`);
|
|
93
|
+
}
|
|
94
|
+
if (added.length > 0) {
|
|
95
|
+
failures.push(`${added.length} NEW complexity violation(s) not in the debt list.`);
|
|
96
|
+
}
|
|
97
|
+
return { current, added, removed, filesLinted: results.length, failures };
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Whether an ESLint child process produced a usable report.
|
|
101
|
+
*
|
|
102
|
+
* ESLint exits 1 when it merely FINDS problems — the expected case here — and 2 when it CRASHED,
|
|
103
|
+
* with empty stdout. A caller testing `status !== 1` reads that crash as a pass. This repo has the
|
|
104
|
+
* scar: the admin ratchet's `--rule` technique exits 2 on any desktop-app glob whose directory
|
|
105
|
+
* contains a `.js` file, because no config block matching those files declared the sonarjs plugin.
|
|
106
|
+
*
|
|
107
|
+
* @returns `null` when usable, else the reason it is not.
|
|
108
|
+
* @complexity O(1).
|
|
109
|
+
*/
|
|
110
|
+
export function rejectUnusableEslintRun({ status, stdout }, _options = {}) {
|
|
111
|
+
if (status !== 0 && status !== 1) {
|
|
112
|
+
return `eslint exited ${status} — that is a CRASH, not a finding. Exit 0 and 1 are the only usable outcomes.`;
|
|
113
|
+
}
|
|
114
|
+
const trimmed = (stdout ?? "").trim();
|
|
115
|
+
if (trimmed.length === 0) {
|
|
116
|
+
return "eslint produced no output at all. An empty report is not an empty result.";
|
|
117
|
+
}
|
|
118
|
+
let parsed;
|
|
119
|
+
try {
|
|
120
|
+
parsed = JSON.parse(trimmed);
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
// `JSON.parse` of a string throws only `SyntaxError`.
|
|
124
|
+
return `eslint output was not JSON (${error.message}).`;
|
|
125
|
+
}
|
|
126
|
+
if (!Array.isArray(parsed) || parsed.length === 0) {
|
|
127
|
+
return "eslint reported zero files. The scan matched nothing, which is not the same as finding nothing.";
|
|
128
|
+
}
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=complexity-debt.js.map
|
|
@@ -22,7 +22,11 @@ function assertThresholds(thresholds) {
|
|
|
22
22
|
if (!Number.isFinite(value) || value < 0 || value > 100)
|
|
23
23
|
throw new RangeError('tier thresholds must be percentages from 0 to 100');
|
|
24
24
|
}
|
|
25
|
-
/** The branch total both tiers agree on, or why no trustworthy total exists.
|
|
25
|
+
/** The branch total both tiers agree on, or why no trustworthy total exists.
|
|
26
|
+
* brf is a static property of the source file (branch count from its AST), not of which tier's
|
|
27
|
+
* test run happened to load it — so it should agree between both records whenever both exist.
|
|
28
|
+
* Prefer the unit record (the primary/required tier) when both are present.
|
|
29
|
+
* A disagreement between tiers means one artifact is stale. */
|
|
26
30
|
function sharedBranchTotal(unitRec, integrationRec) {
|
|
27
31
|
const brf = unitRec?.brf ?? integrationRec?.brf;
|
|
28
32
|
if (brf === undefined)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type ts from 'typescript';
|
|
14
14
|
import type { createHardwiringInspector, HardwiringViolation } from './hardwiring.js';
|
|
15
|
-
export declare const ENV_ACCESS_RULES: readonly ["HW9-env-access", "HW12-env-import-time"];
|
|
15
|
+
export declare const ENV_ACCESS_RULES: readonly ["HW9-env-access", "HW12-env-import-time", "HW13-env-undeclared-entry"];
|
|
16
16
|
export interface EnvAccessSource {
|
|
17
17
|
file: string;
|
|
18
18
|
source: string;
|
|
@@ -21,8 +21,21 @@ export interface EnvAccessSource {
|
|
|
21
21
|
/** The owning package runs in a browser, DOM or universal runtime. There a bundler replaces the
|
|
22
22
|
* exact expression `process.env.NODE_ENV` with a constant, so it is a build define, not a read. */
|
|
23
23
|
buildDefine: boolean;
|
|
24
|
+
/** The names the host declares for this process entry. Absent means the entry has no declared
|
|
25
|
+
* names. Only an entry consults it: a declared name never legalizes an ambient read in a library. */
|
|
26
|
+
declaredEnvNames?: ReadonlySet<string>;
|
|
24
27
|
}
|
|
28
|
+
/** An injected environment map, such as the one a process entry hands to its helpers. */
|
|
29
|
+
export type DeclaredEnvMap = Readonly<Record<string, string | undefined>>;
|
|
25
30
|
type HardwiringInspector = ReturnType<typeof createHardwiringInspector>;
|
|
31
|
+
/** The checked accessor for a computed key: the entry's declared set decides before the map is indexed.
|
|
32
|
+
* Fails with a fixed message that never names the requested key or any value.
|
|
33
|
+
*/
|
|
34
|
+
export declare function readDeclaredEnvKey({ env, declaredNames, key }: {
|
|
35
|
+
env: DeclaredEnvMap;
|
|
36
|
+
declaredNames: ReadonlySet<string>;
|
|
37
|
+
key: string;
|
|
38
|
+
}, _optional?: Record<string, never>): string | undefined;
|
|
26
39
|
/** Bind the installed compiler and the hardwiring inspector whose helpers these rules reuse.
|
|
27
40
|
* Inspection is one O(n) walk over the file's AST nodes; no I/O, no module state.
|
|
28
41
|
* Only the env name (or the ambient object's own name) is hashed for debt identity.
|