@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
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -17,10 +17,13 @@ public subpath and permission boundary.
|
|
|
17
17
|
| `./agent-jobs` | Bounded CLI jobs with resume, stdin prompts, raw logs and stream-based completion. |
|
|
18
18
|
| `./backup/plan-store` | Node-backed in-memory backup plans with expiry and principal/workspace binding. |
|
|
19
19
|
| `./backup/push-jobs` | In-memory backup push jobs with progress, cancellation and bounded waits. |
|
|
20
|
+
| `./backup/site/credential-warnings` | Archive credential warnings (location + fixed kind label, never the value) over a host-injected secret-shape redactor. |
|
|
21
|
+
| `./backup/site/*` | Site backup/share-archive pieces (saved-keys port, download-copy HTML transforms); see `src/backup/site/README.md` for what the host injects. |
|
|
20
22
|
| `./checks/published-types` | Published type-surface, registry-drift, linked-package and captured-log checks. |
|
|
21
23
|
| `./checks/coverage` | LCOV, floor, diff, disk-inventory and contamination/baseline policies. |
|
|
22
24
|
| `./checks/node` | Explicit filesystem, process, environment-loader and installer adapters. |
|
|
23
25
|
| `./local-dev` | Environment-file, listener lookup and advisory free-port helpers with host-supplied paths/commands. |
|
|
26
|
+
| `./local-dev/dev-proxy-upstream` | Dropped-upstream lifecycle and `EventSource` reconnect handling for a dev reverse proxy, over structural ports; the host supplies the refusal answer. |
|
|
24
27
|
| `./ci-cd` | Reserved for pipeline definitions, run status, logs, cancellation, and deployment orchestration. |
|
|
25
28
|
|
|
26
29
|
```ts
|
|
@@ -93,3 +96,16 @@ Default dispatchers remain shared; each override binding retains its own lazy
|
|
|
93
96
|
pool. HTTPS-only probes, manual redirects and existing deadlines are preserved.
|
|
94
97
|
The Node adapter attaches the validating Agent as a native fetch runtime extension,
|
|
95
98
|
preserving its identity across differing Node and undici dispatcher type versions.
|
|
99
|
+
|
|
100
|
+
## Wiring (local-dev boot listener)
|
|
101
|
+
|
|
102
|
+
`reserveBootListener` (`@jini-ai/devops/local-dev`): the host passes its server, port and already-resolved
|
|
103
|
+
bind host (its own env/flag precedence), and sets `autoStartPort` only for its production start.
|
|
104
|
+
`resolveBindHost` (same entry) takes the already-picked raw `--host`/env value and the fallback; the host
|
|
105
|
+
injects `source` (its flag/env label for the message) and `invalidHost` (its validation-error factory).
|
|
106
|
+
|
|
107
|
+
## Wiring (dns due-bindings sweeper)
|
|
108
|
+
|
|
109
|
+
`startDomainBindingSweeper` (`@jini-ai/devops/dns`): the host injects its pre-bound due-bindings sweep
|
|
110
|
+
(absent → idle handle) and a REQUIRED unref'd timer `scheduler` (`{ every, after }`; the webhook worker's
|
|
111
|
+
`nodeWebhookDeliveryScheduler` fits structurally). Start it only in the process that serves the site.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { AgentPluginLayout } from "@jini-ai/core/contracts/headless/plugin-host";
|
|
2
|
+
import type { ArchivePlugin } from "./archive-manifest.js";
|
|
3
|
+
import type { CollectedSiteBackupFiles, PlannedDiskFile, ReadPlannedFileResult, SiteBackupInclude, SiteBackupSources } from "./sources.js";
|
|
4
|
+
/** One installed agent plugin package, as the host's plugin lifecycle lists it. */
|
|
5
|
+
export interface InstalledAgentPluginRecord {
|
|
6
|
+
readonly pluginId: string;
|
|
7
|
+
readonly version?: string | undefined;
|
|
8
|
+
readonly archiveDigest: string;
|
|
9
|
+
}
|
|
10
|
+
/** The host's agent-plugin lifecycle reads this preparation needs, bound to one plugin layout. */
|
|
11
|
+
export interface ArchiveExtensionsLifecycle {
|
|
12
|
+
readonly listInstalledPlugins: (required: {
|
|
13
|
+
workspaceRoot: string;
|
|
14
|
+
}) => Promise<readonly InstalledAgentPluginRecord[]>;
|
|
15
|
+
readonly readBundledAgentPluginDigests: (required: {
|
|
16
|
+
workspaceRoot: string;
|
|
17
|
+
}) => Promise<ReadonlyMap<string, string>>;
|
|
18
|
+
readonly preferBundledAgentPluginDigests: (candidates: readonly InstalledAgentPluginRecord[], bundled: ReadonlyMap<string, string>) => readonly InstalledAgentPluginRecord[];
|
|
19
|
+
readonly readAgentPluginActivations: (required: {
|
|
20
|
+
workspaceRoot: string;
|
|
21
|
+
}) => Promise<{
|
|
22
|
+
readonly plugins: Readonly<Record<string, {
|
|
23
|
+
readonly enabled?: boolean | undefined;
|
|
24
|
+
} | undefined>>;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
/** Everything the preparation takes from the host. Every member is REQUIRED: the engine carries no host defaults. */
|
|
28
|
+
export interface ArchiveExtensionsDeps {
|
|
29
|
+
readonly collectSiteBackupFiles: (input: {
|
|
30
|
+
sources: SiteBackupSources;
|
|
31
|
+
include: SiteBackupInclude;
|
|
32
|
+
}, optional: {
|
|
33
|
+
profile: "share";
|
|
34
|
+
}) => Promise<CollectedSiteBackupFiles>;
|
|
35
|
+
readonly readPlannedFile: (file: PlannedDiskFile) => Promise<ReadPlannedFileResult>;
|
|
36
|
+
/** Binds the host's plugin lifecycle to the site's agent-plugin layout. */
|
|
37
|
+
readonly createLifecycle: (required: {
|
|
38
|
+
layout: AgentPluginLayout;
|
|
39
|
+
}) => ArchiveExtensionsLifecycle;
|
|
40
|
+
/** The theme owner's packaged original for a theme, or nothing when it has none. */
|
|
41
|
+
readonly resolveThemeOriginalSource: (required: {
|
|
42
|
+
manifest: {
|
|
43
|
+
tier: "static";
|
|
44
|
+
id: string;
|
|
45
|
+
};
|
|
46
|
+
siteThemesRoot: string;
|
|
47
|
+
packageThemesRoot: string | undefined;
|
|
48
|
+
}) => {
|
|
49
|
+
readonly originalDir: string;
|
|
50
|
+
} | null | undefined;
|
|
51
|
+
/** The host's runtime-path to archive-path mapping; `null` for a path the archive never carries. */
|
|
52
|
+
readonly runtimeToArchivePath: (required: {
|
|
53
|
+
path: string;
|
|
54
|
+
}) => string | null;
|
|
55
|
+
/** The file names a plugin package's own manifest may carry. */
|
|
56
|
+
readonly pluginManifestFilenames: readonly string[];
|
|
57
|
+
}
|
|
58
|
+
/** Selects installed package versions through the lifecycle owner; includes reset baselines.
|
|
59
|
+
* @throws SiteShareRefusal for multiple workspaces, unsafe originals or stale planned files.
|
|
60
|
+
* @complexity O(files × (themes + plugins) + package bytes), bounded by share caps.
|
|
61
|
+
*/
|
|
62
|
+
export declare function prepareArchiveExtensions(required: {
|
|
63
|
+
sources: SiteBackupSources;
|
|
64
|
+
files: readonly PlannedDiskFile[];
|
|
65
|
+
deps: ArchiveExtensionsDeps;
|
|
66
|
+
}, optional?: {
|
|
67
|
+
packageThemesRoot?: string;
|
|
68
|
+
}): Promise<{
|
|
69
|
+
files: PlannedDiskFile[];
|
|
70
|
+
plugins: ArchivePlugin[];
|
|
71
|
+
notices?: readonly string[];
|
|
72
|
+
}>;
|
|
73
|
+
//# sourceMappingURL=archive-extensions.d.ts.map
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { SiteShareRefusal } from "./share-refusal.js";
|
|
3
|
+
/** Selects installed package versions through the lifecycle owner; includes reset baselines.
|
|
4
|
+
* @throws SiteShareRefusal for multiple workspaces, unsafe originals or stale planned files.
|
|
5
|
+
* @complexity O(files × (themes + plugins) + package bytes), bounded by share caps.
|
|
6
|
+
*/
|
|
7
|
+
export async function prepareArchiveExtensions(required, optional = {}) {
|
|
8
|
+
const files = [...required.files], notices = [];
|
|
9
|
+
await includeThemeOriginals({ sources: required.sources, files, notices, deps: required.deps }, optional);
|
|
10
|
+
const workspaces = new Set(files.flatMap(file => /^agent-plugins\/ws\/([^/]+)\//.exec(file.path)?.[1] ?? []));
|
|
11
|
+
if (workspaces.size > 1)
|
|
12
|
+
throw new SiteShareRefusal({ code: "UNSUPPORTED_DATA", message: "Export requires a single plugin workspace." });
|
|
13
|
+
const plugins = [];
|
|
14
|
+
let selected = files;
|
|
15
|
+
const workspaceId = [...workspaces][0];
|
|
16
|
+
if (workspaceId) {
|
|
17
|
+
const lifecycle = required.deps.createLifecycle({ layout: required.sources.agentPlugins });
|
|
18
|
+
const workspaceRoot = required.sources.agentPlugins.forWorkspace({ workspaceId }).root;
|
|
19
|
+
const candidates = await lifecycle.listInstalledPlugins({ workspaceRoot });
|
|
20
|
+
const bundled = await lifecycle.readBundledAgentPluginDigests({ workspaceRoot });
|
|
21
|
+
const installed = lifecycle.preferBundledAgentPluginDigests(candidates, bundled);
|
|
22
|
+
if (new Set(installed.map(plugin => plugin.pluginId)).size !== installed.length)
|
|
23
|
+
throw new SiteShareRefusal({ code: "UNSUPPORTED_PLUGIN", message: "Export requires one installed digest per plugin id." });
|
|
24
|
+
const activations = await lifecycle.readAgentPluginActivations({ workspaceRoot });
|
|
25
|
+
// Old copies can stop indexing after a manifest contract changes. The ledger still names
|
|
26
|
+
// this build's valid revision; leave every other copy on disk, outside the flattened export.
|
|
27
|
+
const bundledSelection = new Map(installed.filter(plugin => bundled.get(plugin.pluginId) === plugin.archiveDigest).map(plugin => [plugin.pluginId, plugin.archiveDigest]));
|
|
28
|
+
selected = files.filter(file => !isSupersededBundledRevision({ file, selected: bundledSelection }));
|
|
29
|
+
for (const plugin of installed)
|
|
30
|
+
plugins.push({ kind: "agent", id: plugin.pluginId, version: plugin.version ?? "unknown", digest: plugin.archiveDigest, enabled: activations.plugins[plugin.pluginId]?.enabled ?? true, shipped: true });
|
|
31
|
+
}
|
|
32
|
+
plugins.push(...await unindexedAgentRecords({ files: selected, plugins }));
|
|
33
|
+
plugins.push(...await sitePluginRecords({ files: selected, deps: required.deps }));
|
|
34
|
+
return { files: selected.filter(file => required.deps.runtimeToArchivePath({ path: file.path }) !== null), plugins, ...(notices.length ? { notices } : {}) };
|
|
35
|
+
}
|
|
36
|
+
/** Flatten only the verified selected bundled revision; unrecorded/absent selections still refuse.
|
|
37
|
+
* @complexity O(path length) matching and O(1) ledger lookup per planned file; no disk writes. */
|
|
38
|
+
function isSupersededBundledRevision(required) {
|
|
39
|
+
const revision = /^agent-plugins\/ws\/[^/]+\/([^/]+)\/package\/sha256\/([a-f0-9]{64})\//.exec(required.file.path);
|
|
40
|
+
if (!revision)
|
|
41
|
+
return false;
|
|
42
|
+
const selected = required.selected.get(revision[1]);
|
|
43
|
+
return selected !== undefined && selected !== revision[2];
|
|
44
|
+
}
|
|
45
|
+
async function includeThemeOriginals(required, optional) {
|
|
46
|
+
const themes = required.files.filter(file => /^themes\/(static|declarative|code)\/[^/]+\/theme.json$/.test(file.path));
|
|
47
|
+
for (const file of themes) {
|
|
48
|
+
// The filter above kept only `themes/<tier>/<id>/theme.json`, so both segments exist.
|
|
49
|
+
const [, tier, id] = file.path.split("/");
|
|
50
|
+
const originalPrefix = `themes/__original-themes__/${tier}/${id}/`;
|
|
51
|
+
if (required.files.some(file => file.path.startsWith(originalPrefix)))
|
|
52
|
+
continue;
|
|
53
|
+
const original = required.deps.resolveThemeOriginalSource({ manifest: { tier: tier, id }, siteThemesRoot: required.sources.themesDir, packageThemesRoot: optional.packageThemesRoot });
|
|
54
|
+
if (original) {
|
|
55
|
+
const collected = await required.deps.collectSiteBackupFiles({ sources: { ...required.sources, themesDir: original.originalDir }, include: { database: false, media: false, themes: true, plugins: false, settings: false } }, { profile: "share" });
|
|
56
|
+
recordThemeOriginalCollection(required.notices, collected, id);
|
|
57
|
+
required.files.push(...collected.files.filter(file => file.path.startsWith("themes/")).map(file => ({ ...file, path: originalPrefix + file.path.slice("themes/".length) })));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
// A theme without a recorded baseline still needs a recoverable original in v2.
|
|
61
|
+
// Preserve its current snapshot as that baseline; never invent package content.
|
|
62
|
+
const livePrefix = `themes/${tier}/${id}/`;
|
|
63
|
+
required.files.push(...required.files.filter(file => file.path.startsWith(livePrefix)).map(file => ({ ...file, path: originalPrefix + file.path.slice(livePrefix.length) })));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function recordThemeOriginalCollection(notices, collected, id) {
|
|
68
|
+
notices.push(...(collected.notices ?? []));
|
|
69
|
+
if (collected.skipped.length) {
|
|
70
|
+
const skipped = collected.skipped[0];
|
|
71
|
+
if (skipped === undefined)
|
|
72
|
+
throw new Error("Theme original export has no skipped-file details");
|
|
73
|
+
throw new SiteShareRefusal({ code: "UNSAFE_FILE", message: `Cannot export theme original '${id}': ${skipped.reason}.` });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async function sitePluginRecords({ files, deps }) {
|
|
77
|
+
const groups = new Map();
|
|
78
|
+
for (const file of files) {
|
|
79
|
+
const mapped = deps.runtimeToArchivePath({ path: file.path });
|
|
80
|
+
const id = mapped && /^plugins\/([^/]+)\/package\//.exec(mapped)?.[1];
|
|
81
|
+
if (id) {
|
|
82
|
+
const group = groups.get(id) ?? [];
|
|
83
|
+
group.push(file);
|
|
84
|
+
groups.set(id, group);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const plugins = [];
|
|
88
|
+
for (const [id, entries] of groups) {
|
|
89
|
+
const digest = createHash("sha256");
|
|
90
|
+
let version = "unknown";
|
|
91
|
+
for (const file of entries) {
|
|
92
|
+
const read = await deps.readPlannedFile(file);
|
|
93
|
+
if (!read.ok)
|
|
94
|
+
throw new SiteShareRefusal({ code: "PLAN_STALE", message: read.message });
|
|
95
|
+
digest.update(file.path).update(createHash("sha256").update(read.bytes).digest());
|
|
96
|
+
version = sitePluginVersion({ file, bytes: read.bytes, id, current: version, manifestNames: deps.pluginManifestFilenames });
|
|
97
|
+
}
|
|
98
|
+
plugins.push({ kind: "site", id, version, digest: digest.digest("hex"), enabled: false, shipped: true });
|
|
99
|
+
}
|
|
100
|
+
return plugins;
|
|
101
|
+
}
|
|
102
|
+
/** Malformed/unindexed packages are still site content. Preserve their bytes, never infer trust. */
|
|
103
|
+
async function unindexedAgentRecords(required) {
|
|
104
|
+
const known = new Map(required.plugins.map(plugin => [plugin.id, plugin.digest]));
|
|
105
|
+
const extras = [];
|
|
106
|
+
for (const file of required.files) {
|
|
107
|
+
const match = /^agent-plugins\/ws\/[^/]+\/([^/]+)\/package\/sha256\/([a-f0-9]{64})\//.exec(file.path);
|
|
108
|
+
if (!match)
|
|
109
|
+
continue;
|
|
110
|
+
const id = match[1];
|
|
111
|
+
const digest = match[2];
|
|
112
|
+
const previous = known.get(id);
|
|
113
|
+
if (previous && previous !== digest)
|
|
114
|
+
throw new SiteShareRefusal({ code: "UNSUPPORTED_PLUGIN", message: `Plugin '${id}' has multiple installed digests.` });
|
|
115
|
+
if (!previous) {
|
|
116
|
+
known.set(id, digest);
|
|
117
|
+
extras.push({ kind: "agent", id, version: "unknown", digest, enabled: false, shipped: true });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return extras;
|
|
121
|
+
}
|
|
122
|
+
/** Only the package's own manifest names its version; nested example manifests do not. Jini lists exactly
|
|
123
|
+
* one manifest per package (the one discovery validated against its version folder). */
|
|
124
|
+
function sitePluginVersion(required) {
|
|
125
|
+
if (!required.manifestNames.some(name => required.file.path === `plugins/${required.id}/package/${name}`))
|
|
126
|
+
return required.current;
|
|
127
|
+
return String(JSON.parse(required.bytes.toString("utf8")).version ?? "unknown");
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=archive-extensions.js.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type StaticSiteMetadata } from "./static-copy.js";
|
|
2
|
+
import { ENCRYPTED_KEYS_DESCRIPTOR } from "./saved-keys-port.js";
|
|
3
|
+
/** The runtime schema identity an archive records and a restore compares against. */
|
|
4
|
+
export interface ArchiveSchemaIdentity {
|
|
5
|
+
readonly index: number;
|
|
6
|
+
readonly tag: string;
|
|
7
|
+
}
|
|
8
|
+
/** What the host owns: the file-count and manifest-size caps, its path-claim rules, the schema journal and the mismatch advice. */
|
|
9
|
+
export interface ArchiveManifestDeps {
|
|
10
|
+
readonly limits: {
|
|
11
|
+
readonly maxManifestBytes: number;
|
|
12
|
+
readonly maxFiles: number;
|
|
13
|
+
};
|
|
14
|
+
/** Host advice shown when the archive came from a known but different build. */
|
|
15
|
+
readonly versionMismatchMessage: string;
|
|
16
|
+
/** Claims one archive path (throws a {@link SiteShareRefusal}) so aliases and duplicates cannot share a file. */
|
|
17
|
+
readonly claimSharePath: (required: {
|
|
18
|
+
path: string;
|
|
19
|
+
directory: boolean;
|
|
20
|
+
aliases: Map<string, string>;
|
|
21
|
+
files: Set<string>;
|
|
22
|
+
}) => void;
|
|
23
|
+
/** Reads only the trusted migration journal: is this identity one this build ships. */
|
|
24
|
+
readonly isBundledSchemaIdentity: (required: {
|
|
25
|
+
schema: ArchiveSchemaIdentity;
|
|
26
|
+
}) => boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare const ARCHIVE_MANIFEST_PATH = "manifest.json";
|
|
29
|
+
export declare const ARCHIVE_DATABASE_PATH = "content.db";
|
|
30
|
+
export interface ArchiveFile {
|
|
31
|
+
readonly path: string;
|
|
32
|
+
readonly bytes: number;
|
|
33
|
+
readonly sha256: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ArchiveMedia {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly slug: string;
|
|
38
|
+
readonly path: string;
|
|
39
|
+
readonly sha256: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ArchivePlugin {
|
|
42
|
+
readonly kind: "agent" | "site";
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly version: string;
|
|
45
|
+
readonly digest: string;
|
|
46
|
+
readonly enabled: boolean;
|
|
47
|
+
readonly shipped: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface ArchiveManifest<TScopes extends object = Record<string, boolean>> {
|
|
50
|
+
readonly formatVersion: 2;
|
|
51
|
+
readonly profile: "share";
|
|
52
|
+
readonly schema: ArchiveSchemaIdentity;
|
|
53
|
+
readonly site: {
|
|
54
|
+
readonly name: string;
|
|
55
|
+
};
|
|
56
|
+
readonly scopes: TScopes;
|
|
57
|
+
readonly media: readonly ArchiveMedia[];
|
|
58
|
+
readonly plugins: readonly ArchivePlugin[];
|
|
59
|
+
readonly files: readonly ArchiveFile[];
|
|
60
|
+
readonly encryptedKeys?: typeof ENCRYPTED_KEYS_DESCRIPTOR;
|
|
61
|
+
readonly staticSite?: StaticSiteMetadata;
|
|
62
|
+
readonly staticSiteOmitted?: string;
|
|
63
|
+
}
|
|
64
|
+
/** The codec's operations, bound to a host by {@link createArchiveManifestCodec}. */
|
|
65
|
+
export interface ArchiveManifestCodec<TScopes extends object> {
|
|
66
|
+
/** Serializes the sole importable ZIP contract; repository backup retains its own manifest. */
|
|
67
|
+
buildArchiveManifest(required: Omit<ArchiveManifest<TScopes>, "formatVersion" | "profile">, _optional?: object): string;
|
|
68
|
+
/** Parses untrusted JSON and validates identity, paths, hashes and cross-record uniqueness.
|
|
69
|
+
* @throws SiteShareRefusal for v1, malformed records or a different runtime schema.
|
|
70
|
+
* @complexity O(files² + media + plugins), bounded by the shared 2,000-entry cap.
|
|
71
|
+
*/
|
|
72
|
+
parseArchiveManifest(required: {
|
|
73
|
+
bytes: Buffer;
|
|
74
|
+
schema: ArchiveSchemaIdentity;
|
|
75
|
+
}, _optional?: object): ArchiveManifest<TScopes>;
|
|
76
|
+
}
|
|
77
|
+
/** Binds the share manifest contract to a host's caps, path rules and schema journal. */
|
|
78
|
+
export declare function createArchiveManifestCodec<TScopes extends object = Record<string, boolean>>(deps: ArchiveManifestDeps): ArchiveManifestCodec<TScopes>;
|
|
79
|
+
/** The single file-record contract shared by manifest parsing and inventory construction.
|
|
80
|
+
* @returns A path/size/hash record, or throws SiteShareRefusal for malformed input.
|
|
81
|
+
*/
|
|
82
|
+
export declare function requireArchiveFileRecord(required: {
|
|
83
|
+
file: unknown;
|
|
84
|
+
}, _optional?: {}): ArchiveFile;
|
|
85
|
+
//# sourceMappingURL=archive-manifest.d.ts.map
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { SiteShareRefusal, archiveRefusalName } from "./share-refusal.js";
|
|
2
|
+
import { SHARED_PLUGIN_MEMORY } from "./share-file-policy.js";
|
|
3
|
+
import { isStaticSitePath } from "./static-copy.js";
|
|
4
|
+
import { SAVED_KEYS_PATH, ENCRYPTED_KEYS_DESCRIPTOR } from "./saved-keys-port.js";
|
|
5
|
+
export const ARCHIVE_MANIFEST_PATH = "manifest.json";
|
|
6
|
+
export const ARCHIVE_DATABASE_PATH = "content.db";
|
|
7
|
+
const HASH = /^[a-f0-9]{64}$/;
|
|
8
|
+
const ID = /^[a-z0-9]+(?:[-.][a-z0-9]+)*$/;
|
|
9
|
+
const ROOT = new RegExp(String.raw `^(?:media\/[^/]+|themes\/.+|plugins\/[^/]+\/(?:package|${SHARED_PLUGIN_MEMORY})\/.+|agent-plugins\/[^/]+\/(?:package|${SHARED_PLUGIN_MEMORY})\/.+|skills\/.+)$`);
|
|
10
|
+
function invalid() { throw new SiteShareRefusal({ code: "INVALID_ARCHIVE", message: "Invalid v2 share manifest, inventory or schema identity." }); }
|
|
11
|
+
/** Binds the share manifest contract to a host's caps, path rules and schema journal. */
|
|
12
|
+
export function createArchiveManifestCodec(deps) {
|
|
13
|
+
return {
|
|
14
|
+
buildArchiveManifest(required, _optional = {}) {
|
|
15
|
+
const manifest = { formatVersion: 2, profile: "share", ...required };
|
|
16
|
+
validateManifest({ manifest, schema: required.schema, deps });
|
|
17
|
+
return JSON.stringify(manifest, null, 2) + "\n";
|
|
18
|
+
},
|
|
19
|
+
parseArchiveManifest(required, _optional = {}) {
|
|
20
|
+
if (required.bytes.length > deps.limits.maxManifestBytes)
|
|
21
|
+
invalid();
|
|
22
|
+
let manifest;
|
|
23
|
+
try {
|
|
24
|
+
manifest = JSON.parse(required.bytes.toString("utf8"));
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
invalid();
|
|
28
|
+
}
|
|
29
|
+
validateManifest({ manifest, schema: required.schema, deps });
|
|
30
|
+
return manifest;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
// The manifest is untrusted JSON of any shape; each predicate reads it exactly as the archive gave it.
|
|
35
|
+
function validateManifest({ manifest: m, schema, deps }) {
|
|
36
|
+
validateIdentity({ manifest: m });
|
|
37
|
+
validateSiteName({ name: m.site?.name });
|
|
38
|
+
if (!["database", "media", "themes", "plugins", "settings"].every(scope => m.scopes?.[scope] === true))
|
|
39
|
+
invalid();
|
|
40
|
+
if (!Array.isArray(m.files) || m.files.length + 1 > deps.limits.maxFiles)
|
|
41
|
+
invalid();
|
|
42
|
+
const files = validateFiles({ files: m.files, deps });
|
|
43
|
+
if (!Array.isArray(m.media) || !Array.isArray(m.plugins))
|
|
44
|
+
invalid();
|
|
45
|
+
validateMedia({ media: m.media, files });
|
|
46
|
+
validatePlugins({ plugins: m.plugins, files });
|
|
47
|
+
validateEncryptedKeys({ descriptor: m.encryptedKeys, files });
|
|
48
|
+
validateSchemaVersion({ identity: m.schema, schema, deps });
|
|
49
|
+
}
|
|
50
|
+
function validateFiles({ files, deps }) {
|
|
51
|
+
const aliases = new Map(), names = new Set();
|
|
52
|
+
const inventory = new Map();
|
|
53
|
+
deps.claimSharePath({ path: ARCHIVE_MANIFEST_PATH, directory: false, aliases, files: names });
|
|
54
|
+
for (const record of files) {
|
|
55
|
+
// Static copies are a convenience for humans, never restore input or an integrity dependency.
|
|
56
|
+
if (typeof record?.path === "string" && isStaticSitePath({ path: record.path }))
|
|
57
|
+
continue;
|
|
58
|
+
const file = requireArchiveFileRecord({ file: record });
|
|
59
|
+
if (![ARCHIVE_DATABASE_PATH, "settings.json", SAVED_KEYS_PATH].includes(file.path) && !ROOT.test(file.path))
|
|
60
|
+
invalid();
|
|
61
|
+
deps.claimSharePath({ path: file.path, directory: false, aliases, files: names });
|
|
62
|
+
inventory.set(file.path, file);
|
|
63
|
+
}
|
|
64
|
+
if (!inventory.has(ARCHIVE_DATABASE_PATH) || !inventory.has("settings.json"))
|
|
65
|
+
invalid();
|
|
66
|
+
return inventory;
|
|
67
|
+
}
|
|
68
|
+
/** Only the exact versioned optional encrypted entry is recognized; no generic secrets root. */
|
|
69
|
+
function validateEncryptedKeys(required, _options = {}) {
|
|
70
|
+
if (required.descriptor === undefined) {
|
|
71
|
+
if (required.files.has(SAVED_KEYS_PATH))
|
|
72
|
+
invalid();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const value = required.descriptor;
|
|
76
|
+
if (value?.version !== 1 || value.path !== SAVED_KEYS_PATH || value.format !== ENCRYPTED_KEYS_DESCRIPTOR.format)
|
|
77
|
+
invalid();
|
|
78
|
+
if (!required.files.has(SAVED_KEYS_PATH))
|
|
79
|
+
invalid();
|
|
80
|
+
}
|
|
81
|
+
function validateMedia({ media, files }) {
|
|
82
|
+
const ids = new Set(), paths = new Set();
|
|
83
|
+
for (const row of media) {
|
|
84
|
+
if (!validMediaIdentity({ row, ids }))
|
|
85
|
+
invalid();
|
|
86
|
+
if (!validMediaPath({ row, paths }))
|
|
87
|
+
invalid();
|
|
88
|
+
if (files.get(row.path)?.sha256 !== row.sha256)
|
|
89
|
+
invalid();
|
|
90
|
+
ids.add(row.id);
|
|
91
|
+
paths.add(row.path);
|
|
92
|
+
}
|
|
93
|
+
if ([...files.keys()].filter(path => path.startsWith("media/")).length !== paths.size)
|
|
94
|
+
invalid();
|
|
95
|
+
}
|
|
96
|
+
function validatePlugins({ plugins, files }) {
|
|
97
|
+
const ids = new Set();
|
|
98
|
+
for (const row of plugins) {
|
|
99
|
+
if (!validPluginIdentity({ row }))
|
|
100
|
+
invalid();
|
|
101
|
+
const key = row.kind + "/" + row.id;
|
|
102
|
+
if (ids.has(key))
|
|
103
|
+
invalid();
|
|
104
|
+
validatePluginPackage({ row, files });
|
|
105
|
+
ids.add(key);
|
|
106
|
+
}
|
|
107
|
+
requirePluginCoverage({ files, ids });
|
|
108
|
+
}
|
|
109
|
+
function validatePluginPackage({ row, files }, _options = {}) {
|
|
110
|
+
if (!validPluginVersion({ row }))
|
|
111
|
+
invalid();
|
|
112
|
+
if (typeof row.enabled !== "boolean" || row.shipped !== true)
|
|
113
|
+
invalid();
|
|
114
|
+
const root = (row.kind === "agent" ? "agent-plugins/" : "plugins/") + row.id + "/package/";
|
|
115
|
+
if (![...files.keys()].some(path => path.startsWith(root)))
|
|
116
|
+
invalid();
|
|
117
|
+
}
|
|
118
|
+
function validateSiteName(required) {
|
|
119
|
+
if (typeof required.name !== "string" || !required.name.trim() || required.name.length > 200)
|
|
120
|
+
invalid();
|
|
121
|
+
}
|
|
122
|
+
function validMediaIdentity({ row, ids }) {
|
|
123
|
+
return typeof row?.id === "string" && Boolean(row.id) && !ids.has(row.id) && typeof row.slug === "string";
|
|
124
|
+
}
|
|
125
|
+
function validMediaPath({ row, paths }) {
|
|
126
|
+
return typeof row.path === "string" && /^media\/[^/]+$/.test(row.path) && !paths.has(row.path) && HASH.test(row.sha256);
|
|
127
|
+
}
|
|
128
|
+
function validPluginIdentity({ row }) {
|
|
129
|
+
return ["agent", "site"].includes(row?.kind) && typeof row.id === "string" && row.id.length <= 64 && ID.test(row.id);
|
|
130
|
+
}
|
|
131
|
+
function validPluginVersion({ row }) {
|
|
132
|
+
return typeof row.version === "string" && Boolean(row.version) && HASH.test(row.digest);
|
|
133
|
+
}
|
|
134
|
+
function requirePluginCoverage(required) {
|
|
135
|
+
for (const file of required.files.keys()) {
|
|
136
|
+
const match = /^(agent-plugins|plugins)\/([^/]+)\/package\//.exec(file);
|
|
137
|
+
if (match && !required.ids.has((match[1] === "agent-plugins" ? "agent" : "site") + "/" + match[2]))
|
|
138
|
+
invalid();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/** Refuse malformed identities separately so version advice never masks a broken manifest shape. */
|
|
142
|
+
function validateIdentity({ manifest: m }, _options = {}) {
|
|
143
|
+
if (m?.formatVersion !== 2 || m.profile !== "share")
|
|
144
|
+
invalid();
|
|
145
|
+
// Library added columns, not a new manifest identity. Historical database compatibility
|
|
146
|
+
// belongs to the worker's trusted schema matcher, never invented migration-ID aliases.
|
|
147
|
+
if (!Number.isSafeInteger(m.schema?.index) || typeof m.schema?.tag !== "string")
|
|
148
|
+
invalid();
|
|
149
|
+
}
|
|
150
|
+
/** After structural validation, distinguish an invented identity from a known source version.
|
|
151
|
+
* Reads only the trusted journal through its owner; throws INVALID_ARCHIVE without touching SQLite.
|
|
152
|
+
* O(bundled migrations), with no source DDL or migration code executed.
|
|
153
|
+
*/
|
|
154
|
+
function validateSchemaVersion({ identity, schema, deps }, _options = {}) {
|
|
155
|
+
if (identity.index === schema.index && identity.tag === schema.tag)
|
|
156
|
+
return;
|
|
157
|
+
if (!deps.isBundledSchemaIdentity({ schema: identity }))
|
|
158
|
+
throw new SiteShareRefusal({ code: "INVALID_ARCHIVE", message: `Unknown archive schema identity ${JSON.stringify({ index: identity.index, tag: archiveRefusalName({ name: identity.tag }) })}.` });
|
|
159
|
+
throw new SiteShareRefusal({ code: "INVALID_ARCHIVE", message: deps.versionMismatchMessage });
|
|
160
|
+
}
|
|
161
|
+
/** The single file-record contract shared by manifest parsing and inventory construction.
|
|
162
|
+
* @returns A path/size/hash record, or throws SiteShareRefusal for malformed input.
|
|
163
|
+
*/
|
|
164
|
+
export function requireArchiveFileRecord(required, _optional = {}) {
|
|
165
|
+
const file = required.file;
|
|
166
|
+
if (typeof file !== "object" || file === null || !("path" in file) || typeof file.path !== "string")
|
|
167
|
+
invalid();
|
|
168
|
+
requireArchiveFileMetadata(file);
|
|
169
|
+
return file;
|
|
170
|
+
}
|
|
171
|
+
function requireArchiveFileMetadata(file) {
|
|
172
|
+
if (!("bytes" in file) || typeof file.bytes !== "number" || !Number.isSafeInteger(file.bytes) || file.bytes < 0
|
|
173
|
+
|| !("sha256" in file) || typeof file.sha256 !== "string" || !HASH.test(file.sha256))
|
|
174
|
+
invalid();
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=archive-manifest.js.map
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/** The slice of a transform definition this module reads: the output format. */
|
|
2
|
+
export interface ArchiveMediaTransformParams {
|
|
3
|
+
readonly format: string;
|
|
4
|
+
}
|
|
5
|
+
/** Snapshot-owned metadata, never a read from mutable live media repositories. */
|
|
6
|
+
export interface ArchiveMediaSource<TParams extends ArchiveMediaTransformParams = ArchiveMediaTransformParams> {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly workspaceId: string;
|
|
9
|
+
readonly slug: string;
|
|
10
|
+
readonly originalFilename: string | null;
|
|
11
|
+
readonly kind: string;
|
|
12
|
+
readonly storageKey: string;
|
|
13
|
+
readonly sha256: string;
|
|
14
|
+
readonly documentOwned?: boolean;
|
|
15
|
+
readonly public?: {
|
|
16
|
+
readonly storageKey?: string;
|
|
17
|
+
readonly sha256?: string;
|
|
18
|
+
readonly version: number;
|
|
19
|
+
readonly params: TParams;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** One archived media file as the manifest lists it. */
|
|
23
|
+
export interface ArchiveMediaEntry {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly slug: string;
|
|
26
|
+
readonly path: string;
|
|
27
|
+
readonly sha256: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ArchiveMediaCopy extends ArchiveMediaEntry {
|
|
30
|
+
readonly workspaceId: string;
|
|
31
|
+
readonly storageKey: string;
|
|
32
|
+
readonly contentType: string;
|
|
33
|
+
readonly publicVersion?: number;
|
|
34
|
+
readonly documentOwned?: boolean | undefined;
|
|
35
|
+
}
|
|
36
|
+
export type ArchiveMediaRewriter = (required: {
|
|
37
|
+
bytes: Buffer;
|
|
38
|
+
copies: readonly ArchiveMediaCopy[];
|
|
39
|
+
}, optional?: {
|
|
40
|
+
signal?: AbortSignal;
|
|
41
|
+
}) => Promise<Buffer>;
|
|
42
|
+
/** The raster re-encoder: same bytes and params give the same output. */
|
|
43
|
+
export interface ArchiveMediaImageTransformer<TParams extends ArchiveMediaTransformParams = ArchiveMediaTransformParams> {
|
|
44
|
+
transform(input: {
|
|
45
|
+
bytes: Uint8Array;
|
|
46
|
+
params: TParams;
|
|
47
|
+
}): Promise<{
|
|
48
|
+
bytes: Uint8Array;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
/** Media content operations the host owns (sniffing, SVG sanitizing, content-addressed keys). */
|
|
52
|
+
export interface ArchiveMediaOperations {
|
|
53
|
+
sniffContentType(required: {
|
|
54
|
+
bytes: Uint8Array;
|
|
55
|
+
}): string;
|
|
56
|
+
sanitizeSvg(required: {
|
|
57
|
+
bytes: Uint8Array;
|
|
58
|
+
}): Promise<Uint8Array>;
|
|
59
|
+
computeBlobStorageKey(required: {
|
|
60
|
+
workspaceId: string;
|
|
61
|
+
sha256: string;
|
|
62
|
+
}): string;
|
|
63
|
+
mimeForTransformFormat(required: {
|
|
64
|
+
format: string;
|
|
65
|
+
}): string;
|
|
66
|
+
}
|
|
67
|
+
/** Portable-path policy the host owns: refuses a path (throws) or folds it to its collision alias. */
|
|
68
|
+
export interface ArchiveMediaPathPolicy {
|
|
69
|
+
validateSharePath(required: {
|
|
70
|
+
path: string;
|
|
71
|
+
}): void;
|
|
72
|
+
sharePathAlias(required: {
|
|
73
|
+
path: string;
|
|
74
|
+
}): string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Size-capped ledger and blob reads the host owns, so the share limits and their wording stay with
|
|
78
|
+
* the host. Each refuses (throws {@link SiteShareRefusal}) instead of returning a partial result.
|
|
79
|
+
*/
|
|
80
|
+
export interface ArchiveMediaSharePolicy<TLedger, TBlobStore> {
|
|
81
|
+
addBuffered(required: {
|
|
82
|
+
ledger: TLedger;
|
|
83
|
+
file: {
|
|
84
|
+
path: string;
|
|
85
|
+
content: Buffer;
|
|
86
|
+
};
|
|
87
|
+
}): void;
|
|
88
|
+
reportedBlobSize(required: {
|
|
89
|
+
blobStore: TBlobStore;
|
|
90
|
+
storageKey: string;
|
|
91
|
+
document: boolean;
|
|
92
|
+
}): Promise<number>;
|
|
93
|
+
fetchVerifiedBlob(required: {
|
|
94
|
+
blobStore: TBlobStore;
|
|
95
|
+
media: {
|
|
96
|
+
storageKey: string;
|
|
97
|
+
sha256?: string;
|
|
98
|
+
};
|
|
99
|
+
size: number;
|
|
100
|
+
}): Promise<Buffer>;
|
|
101
|
+
}
|
|
102
|
+
/** Everything the host injects. */
|
|
103
|
+
export interface ArchiveMediaHost<TLedger, TBlobStore> {
|
|
104
|
+
readonly operations: ArchiveMediaOperations;
|
|
105
|
+
readonly paths: ArchiveMediaPathPolicy;
|
|
106
|
+
readonly sharePolicy: ArchiveMediaSharePolicy<TLedger, TBlobStore>;
|
|
107
|
+
}
|
|
108
|
+
/** Picks exactly one public copy per item, in id order, without writing to the source site.
|
|
109
|
+
* @throws SiteShareRefusal naming missing, corrupt or unbounded media; raster failures never fall back to raw bytes.
|
|
110
|
+
* @complexity O(items log items + media bytes); shared caps bound retained output and each input read.
|
|
111
|
+
*/
|
|
112
|
+
export declare function bufferArchiveMedia<TLedger, TBlobStore, TParams extends ArchiveMediaTransformParams>(required: {
|
|
113
|
+
sources: readonly ArchiveMediaSource<TParams>[];
|
|
114
|
+
blobStore: TBlobStore;
|
|
115
|
+
imageTransformer: ArchiveMediaImageTransformer<TParams>;
|
|
116
|
+
ledger: TLedger;
|
|
117
|
+
host: ArchiveMediaHost<TLedger, TBlobStore>;
|
|
118
|
+
}, optional?: {
|
|
119
|
+
signal?: AbortSignal;
|
|
120
|
+
}): Promise<ArchiveMediaCopy[]>;
|
|
121
|
+
//# sourceMappingURL=archive-media.d.ts.map
|