@mannyc1/ts-release 0.0.7 → 0.3.0
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/ARCHITECTURE.md +184 -92
- package/CHANGELOG.md +197 -0
- package/LICENSE +21 -0
- package/README.md +404 -327
- package/SPEC.md +257 -310
- package/apps/release-ts/README.md +39 -0
- package/apps/release-ts/src/cli/command.ts +164 -0
- package/apps/release-ts/src/cli/commands.ts +351 -0
- package/apps/release-ts/src/cli/main.ts +43 -0
- package/apps/release-ts/src/cli/node-main.ts +49 -0
- package/apps/ts-release-agents/LICENSE +21 -0
- package/apps/ts-release-agents/README.md +21 -0
- package/apps/ts-release-agents/evals/cases.json +11 -0
- package/apps/ts-release-agents/manifests/claude.json +5 -0
- package/apps/ts-release-agents/manifests/codex.json +5 -0
- package/apps/ts-release-agents/package.json +11 -0
- package/apps/ts-release-agents/skills/release/SKILL.md +48 -0
- package/apps/ts-release-agents/skills/release/references/configuration.md +18 -0
- package/apps/ts-release-agents/skills/release/references/recovery.md +10 -0
- package/apps/ts-release-agents/skills/release/references/staged-workflow.md +12 -0
- package/apps/ts-release-agents/skills/release/references/target-selection.md +13 -0
- package/apps/ts-release-agents/skills/release/references/verification.md +14 -0
- package/apps/ts-release-agents/src/build.ts +105 -0
- package/apps/ts-release-agents/src/check.ts +122 -0
- package/apps/ts-release-agents/src/install.ts +121 -0
- package/apps/ts-release-agents/test/contract.test.ts +56 -0
- package/apps/ts-release-agents/tsconfig.json +5 -0
- package/dist/api/api.d.ts +15 -0
- package/dist/api/api.d.ts.map +1 -0
- package/dist/api/api.js +244 -0
- package/dist/api/api.js.map +1 -0
- package/dist/api/errors.d.ts +39 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +32 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/input.d.ts +10 -0
- package/dist/api/input.d.ts.map +1 -0
- package/dist/api/input.js +73 -0
- package/dist/api/input.js.map +1 -0
- package/dist/api/runtime.d.ts +18 -0
- package/dist/api/runtime.d.ts.map +1 -0
- package/dist/api/runtime.js +7 -0
- package/dist/api/runtime.js.map +1 -0
- package/dist/api/types.d.ts +76 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +17 -0
- package/dist/api/types.js.map +1 -0
- package/dist/bin/ts-release.js +39346 -0
- package/dist/capabilities/bun-targets.d.ts +3 -0
- package/dist/capabilities/bun-targets.d.ts.map +1 -0
- package/dist/capabilities/bun-targets.js +3 -0
- package/dist/capabilities/bun-targets.js.map +1 -0
- package/dist/capabilities/field-ownership.d.ts +17 -0
- package/dist/capabilities/field-ownership.d.ts.map +1 -0
- package/dist/capabilities/field-ownership.js +40 -0
- package/dist/capabilities/field-ownership.js.map +1 -0
- package/dist/capabilities/module.d.ts +91 -0
- package/dist/capabilities/module.d.ts.map +1 -0
- package/dist/capabilities/module.js +2 -0
- package/dist/capabilities/module.js.map +1 -0
- package/dist/capabilities/registry.d.ts +829 -0
- package/dist/capabilities/registry.d.ts.map +1 -0
- package/dist/capabilities/registry.js +291 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +42 -0
- package/dist/config/config.js.map +1 -0
- package/dist/correction/coordinator.d.ts +248 -0
- package/dist/correction/coordinator.d.ts.map +1 -0
- package/dist/correction/coordinator.js +274 -0
- package/dist/correction/coordinator.js.map +1 -0
- package/dist/correction/index.d.ts +3 -0
- package/dist/correction/index.d.ts.map +1 -0
- package/dist/correction/index.js +3 -0
- package/dist/correction/index.js.map +1 -0
- package/dist/correction/intent.d.ts +111 -0
- package/dist/correction/intent.d.ts.map +1 -0
- package/dist/correction/intent.js +146 -0
- package/dist/correction/intent.js.map +1 -0
- package/dist/drivers/archive.d.ts +9 -0
- package/dist/drivers/archive.d.ts.map +1 -0
- package/dist/drivers/archive.js +105 -0
- package/dist/drivers/archive.js.map +1 -0
- package/dist/drivers/contain.d.ts +6 -0
- package/dist/drivers/contain.d.ts.map +1 -0
- package/dist/drivers/contain.js +17 -0
- package/dist/drivers/contain.js.map +1 -0
- package/dist/drivers/environment.d.ts +4 -0
- package/dist/drivers/environment.d.ts.map +1 -0
- package/dist/drivers/environment.js +18 -0
- package/dist/drivers/environment.js.map +1 -0
- package/dist/drivers/errors.d.ts +9 -0
- package/dist/drivers/errors.d.ts.map +1 -0
- package/dist/drivers/errors.js +6 -0
- package/dist/drivers/errors.js.map +1 -0
- package/dist/drivers/glob.d.ts +2 -0
- package/dist/drivers/glob.d.ts.map +1 -0
- package/dist/drivers/glob.js +162 -0
- package/dist/drivers/glob.js.map +1 -0
- package/dist/drivers/process.d.ts +48 -0
- package/dist/drivers/process.d.ts.map +1 -0
- package/dist/drivers/process.js +257 -0
- package/dist/drivers/process.js.map +1 -0
- package/dist/drivers/python-wheel.d.ts +21 -0
- package/dist/drivers/python-wheel.d.ts.map +1 -0
- package/dist/drivers/python-wheel.js +109 -0
- package/dist/drivers/python-wheel.js.map +1 -0
- package/dist/drivers/redact.d.ts +4 -0
- package/dist/drivers/redact.d.ts.map +1 -0
- package/dist/drivers/redact.js +24 -0
- package/dist/drivers/redact.js.map +1 -0
- package/dist/drivers/seccomp-helper-source.d.ts +7 -0
- package/dist/drivers/seccomp-helper-source.d.ts.map +1 -0
- package/dist/drivers/seccomp-helper-source.js +121 -0
- package/dist/drivers/seccomp-helper-source.js.map +1 -0
- package/dist/drivers/utils.d.ts +4 -0
- package/dist/drivers/utils.d.ts.map +1 -0
- package/dist/drivers/utils.js +5 -0
- package/dist/drivers/utils.js.map +1 -0
- package/dist/drivers/workspace.d.ts +9 -0
- package/dist/drivers/workspace.d.ts.map +1 -0
- package/dist/drivers/workspace.js +53 -0
- package/dist/drivers/workspace.js.map +1 -0
- package/dist/extensions/provider-adapter.d.ts +48 -0
- package/dist/extensions/provider-adapter.d.ts.map +1 -0
- package/dist/extensions/provider-adapter.js +64 -0
- package/dist/extensions/provider-adapter.js.map +1 -0
- package/dist/host.d.ts +33 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +20 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +19 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/model/artifact-collection.d.ts +84 -0
- package/dist/model/artifact-collection.d.ts.map +1 -0
- package/dist/model/artifact-collection.js +185 -0
- package/dist/model/artifact-collection.js.map +1 -0
- package/dist/model/authority.d.ts +89 -0
- package/dist/model/authority.d.ts.map +1 -0
- package/dist/model/authority.js +80 -0
- package/dist/model/authority.js.map +1 -0
- package/dist/model/bun-targets.d.ts +34 -0
- package/dist/model/bun-targets.d.ts.map +1 -0
- package/dist/model/bun-targets.js +17 -0
- package/dist/model/bun-targets.js.map +1 -0
- package/dist/model/canonical.d.ts +8 -0
- package/dist/model/canonical.d.ts.map +1 -0
- package/dist/model/canonical.js +205 -0
- package/dist/model/canonical.js.map +1 -0
- package/dist/model/catalog.d.ts +76 -0
- package/dist/model/catalog.d.ts.map +1 -0
- package/dist/model/catalog.js +174 -0
- package/dist/model/catalog.js.map +1 -0
- package/dist/model/digest.d.ts +53 -0
- package/dist/model/digest.d.ts.map +1 -0
- package/dist/model/digest.js +127 -0
- package/dist/model/digest.js.map +1 -0
- package/dist/model/errors.d.ts +14 -0
- package/dist/model/errors.d.ts.map +1 -0
- package/dist/model/errors.js +8 -0
- package/dist/model/errors.js.map +1 -0
- package/dist/model/primitives.d.ts +19 -0
- package/dist/model/primitives.d.ts.map +1 -0
- package/dist/model/primitives.js +18 -0
- package/dist/model/primitives.js.map +1 -0
- package/dist/model/pypi.d.ts +12 -0
- package/dist/model/pypi.d.ts.map +1 -0
- package/dist/model/pypi.js +20 -0
- package/dist/model/pypi.js.map +1 -0
- package/dist/model/python-distribution.d.ts +33 -0
- package/dist/model/python-distribution.d.ts.map +1 -0
- package/dist/model/python-distribution.js +367 -0
- package/dist/model/python-distribution.js.map +1 -0
- package/dist/model/secret-patterns.d.ts +2 -0
- package/dist/model/secret-patterns.d.ts.map +1 -0
- package/dist/model/secret-patterns.js +12 -0
- package/dist/model/secret-patterns.js.map +1 -0
- package/dist/operation-journal/authority.d.ts +3 -0
- package/dist/operation-journal/authority.d.ts.map +1 -0
- package/dist/operation-journal/authority.js +147 -0
- package/dist/operation-journal/authority.js.map +1 -0
- package/dist/operation-journal/aws/deadline.d.ts +12 -0
- package/dist/operation-journal/aws/deadline.d.ts.map +1 -0
- package/dist/operation-journal/aws/deadline.js +38 -0
- package/dist/operation-journal/aws/deadline.js.map +1 -0
- package/dist/operation-journal/aws/oidc.d.ts +27 -0
- package/dist/operation-journal/aws/oidc.d.ts.map +1 -0
- package/dist/operation-journal/aws/oidc.js +361 -0
- package/dist/operation-journal/aws/oidc.js.map +1 -0
- package/dist/operation-journal/aws/policy.d.ts +42 -0
- package/dist/operation-journal/aws/policy.d.ts.map +1 -0
- package/dist/operation-journal/aws/policy.js +404 -0
- package/dist/operation-journal/aws/policy.js.map +1 -0
- package/dist/operation-journal/aws/s3-boundary.d.ts +17 -0
- package/dist/operation-journal/aws/s3-boundary.d.ts.map +1 -0
- package/dist/operation-journal/aws/s3-boundary.js +417 -0
- package/dist/operation-journal/aws/s3-boundary.js.map +1 -0
- package/dist/operation-journal/aws.d.ts +11 -0
- package/dist/operation-journal/aws.d.ts.map +1 -0
- package/dist/operation-journal/aws.js +50 -0
- package/dist/operation-journal/aws.js.map +1 -0
- package/dist/operation-journal/canonical.d.ts +52 -0
- package/dist/operation-journal/canonical.d.ts.map +1 -0
- package/dist/operation-journal/canonical.js +282 -0
- package/dist/operation-journal/canonical.js.map +1 -0
- package/dist/operation-journal/model.d.ts +251 -0
- package/dist/operation-journal/model.d.ts.map +1 -0
- package/dist/operation-journal/model.js +56 -0
- package/dist/operation-journal/model.js.map +1 -0
- package/dist/operation-journal/reducer.d.ts +28 -0
- package/dist/operation-journal/reducer.d.ts.map +1 -0
- package/dist/operation-journal/reducer.js +73 -0
- package/dist/operation-journal/reducer.js.map +1 -0
- package/dist/operation-journal/s3.d.ts +7 -0
- package/dist/operation-journal/s3.d.ts.map +1 -0
- package/dist/operation-journal/s3.js +667 -0
- package/dist/operation-journal/s3.js.map +1 -0
- package/dist/operation-journal.d.ts +14 -0
- package/dist/operation-journal.d.ts.map +1 -0
- package/dist/operation-journal.js +12 -0
- package/dist/operation-journal.js.map +1 -0
- package/dist/platform/bun.d.ts +7 -0
- package/dist/platform/bun.d.ts.map +1 -0
- package/dist/platform/bun.js +15 -0
- package/dist/platform/bun.js.map +1 -0
- package/dist/platform/credentials.d.ts +32 -0
- package/dist/platform/credentials.d.ts.map +1 -0
- package/dist/platform/credentials.js +834 -0
- package/dist/platform/credentials.js.map +1 -0
- package/dist/platform/host-support.d.ts +2 -0
- package/dist/platform/host-support.d.ts.map +1 -0
- package/dist/platform/host-support.js +4 -0
- package/dist/platform/host-support.js.map +1 -0
- package/dist/platform/node.d.ts +7 -0
- package/dist/platform/node.d.ts.map +1 -0
- package/dist/platform/node.js +15 -0
- package/dist/platform/node.js.map +1 -0
- package/dist/platform/release-runtime.d.ts +11 -0
- package/dist/platform/release-runtime.d.ts.map +1 -0
- package/dist/platform/release-runtime.js +34 -0
- package/dist/platform/release-runtime.js.map +1 -0
- package/dist/platform/services.d.ts +15 -0
- package/dist/platform/services.d.ts.map +1 -0
- package/dist/platform/services.js +30 -0
- package/dist/platform/services.js.map +1 -0
- package/dist/platform/source-observer.d.ts +5 -0
- package/dist/platform/source-observer.d.ts.map +1 -0
- package/dist/platform/source-observer.js +159 -0
- package/dist/platform/source-observer.js.map +1 -0
- package/dist/provider-sdk.d.ts +14 -0
- package/dist/provider-sdk.d.ts.map +1 -0
- package/dist/provider-sdk.js +10 -0
- package/dist/provider-sdk.js.map +1 -0
- package/dist/publication/adapter.d.ts +212 -0
- package/dist/publication/adapter.d.ts.map +1 -0
- package/dist/publication/adapter.js +83 -0
- package/dist/publication/adapter.js.map +1 -0
- package/dist/publication/authority.d.ts +137 -0
- package/dist/publication/authority.d.ts.map +1 -0
- package/dist/publication/authority.js +233 -0
- package/dist/publication/authority.js.map +1 -0
- package/dist/publication/catalog-git.d.ts +37 -0
- package/dist/publication/catalog-git.d.ts.map +1 -0
- package/dist/publication/catalog-git.js +451 -0
- package/dist/publication/catalog-git.js.map +1 -0
- package/dist/publication/claim.d.ts +39 -0
- package/dist/publication/claim.d.ts.map +1 -0
- package/dist/publication/claim.js +31 -0
- package/dist/publication/claim.js.map +1 -0
- package/dist/publication/coordinator.d.ts +246 -0
- package/dist/publication/coordinator.d.ts.map +1 -0
- package/dist/publication/coordinator.js +370 -0
- package/dist/publication/coordinator.js.map +1 -0
- package/dist/publication/github.d.ts +36 -0
- package/dist/publication/github.d.ts.map +1 -0
- package/dist/publication/github.js +695 -0
- package/dist/publication/github.js.map +1 -0
- package/dist/publication/http.d.ts +69 -0
- package/dist/publication/http.d.ts.map +1 -0
- package/dist/publication/http.js +29 -0
- package/dist/publication/http.js.map +1 -0
- package/dist/publication/index.d.ts +5 -0
- package/dist/publication/index.d.ts.map +1 -0
- package/dist/publication/index.js +5 -0
- package/dist/publication/index.js.map +1 -0
- package/dist/publication/npm.d.ts +40 -0
- package/dist/publication/npm.d.ts.map +1 -0
- package/dist/publication/npm.js +359 -0
- package/dist/publication/npm.js.map +1 -0
- package/dist/publication/profiles.d.ts +136 -0
- package/dist/publication/profiles.d.ts.map +1 -0
- package/dist/publication/profiles.js +90 -0
- package/dist/publication/profiles.js.map +1 -0
- package/dist/publication/publisher.d.ts +82 -0
- package/dist/publication/publisher.d.ts.map +1 -0
- package/dist/publication/publisher.js +53 -0
- package/dist/publication/publisher.js.map +1 -0
- package/dist/publication/pypi.d.ts +45 -0
- package/dist/publication/pypi.d.ts.map +1 -0
- package/dist/publication/pypi.js +369 -0
- package/dist/publication/pypi.js.map +1 -0
- package/dist/publication/recovery.d.ts +663 -0
- package/dist/publication/recovery.d.ts.map +1 -0
- package/dist/publication/recovery.js +252 -0
- package/dist/publication/recovery.js.map +1 -0
- package/dist/publication/report.d.ts +1061 -0
- package/dist/publication/report.d.ts.map +1 -0
- package/dist/publication/report.js +441 -0
- package/dist/publication/report.js.map +1 -0
- package/dist/recipes/config.d.ts +296 -0
- package/dist/recipes/config.d.ts.map +1 -0
- package/dist/recipes/config.js +325 -0
- package/dist/recipes/config.js.map +1 -0
- package/dist/release/capabilities.d.ts +12 -0
- package/dist/release/capabilities.d.ts.map +1 -0
- package/dist/release/capabilities.js +395 -0
- package/dist/release/capabilities.js.map +1 -0
- package/dist/release/compiler.d.ts +5 -0
- package/dist/release/compiler.d.ts.map +1 -0
- package/dist/release/compiler.js +19 -0
- package/dist/release/compiler.js.map +1 -0
- package/dist/release/config.d.ts +5 -0
- package/dist/release/config.d.ts.map +1 -0
- package/dist/release/config.js +10 -0
- package/dist/release/config.js.map +1 -0
- package/dist/release/context.d.ts +96 -0
- package/dist/release/context.d.ts.map +1 -0
- package/dist/release/context.js +168 -0
- package/dist/release/context.js.map +1 -0
- package/dist/release/graph.d.ts +271 -0
- package/dist/release/graph.d.ts.map +1 -0
- package/dist/release/graph.js +766 -0
- package/dist/release/graph.js.map +1 -0
- package/dist/release/inspect.d.ts +88 -0
- package/dist/release/inspect.d.ts.map +1 -0
- package/dist/release/inspect.js +75 -0
- package/dist/release/inspect.js.map +1 -0
- package/dist/release/prepare.d.ts +24 -0
- package/dist/release/prepare.d.ts.map +1 -0
- package/dist/release/prepare.js +1115 -0
- package/dist/release/prepare.js.map +1 -0
- package/dist/release/prepared-ref.d.ts +60 -0
- package/dist/release/prepared-ref.d.ts.map +1 -0
- package/dist/release/prepared-ref.js +131 -0
- package/dist/release/prepared-ref.js.map +1 -0
- package/dist/release/prepared-store.d.ts +90 -0
- package/dist/release/prepared-store.d.ts.map +1 -0
- package/dist/release/prepared-store.js +339 -0
- package/dist/release/prepared-store.js.map +1 -0
- package/dist/release/prepared.d.ts +172 -0
- package/dist/release/prepared.d.ts.map +1 -0
- package/dist/release/prepared.js +268 -0
- package/dist/release/prepared.js.map +1 -0
- package/dist/release/staging.d.ts +31 -0
- package/dist/release/staging.d.ts.map +1 -0
- package/dist/release/staging.js +218 -0
- package/dist/release/staging.js.map +1 -0
- package/dist/resolve/authored.d.ts +53 -0
- package/dist/resolve/authored.d.ts.map +1 -0
- package/dist/resolve/authored.js +55 -0
- package/dist/resolve/authored.js.map +1 -0
- package/dist/resolve/encode.d.ts +3 -0
- package/dist/resolve/encode.d.ts.map +1 -0
- package/dist/resolve/encode.js +21 -0
- package/dist/resolve/encode.js.map +1 -0
- package/dist/resolve/errors.d.ts +7 -0
- package/dist/resolve/errors.d.ts.map +1 -0
- package/dist/resolve/errors.js +17 -0
- package/dist/resolve/errors.js.map +1 -0
- package/dist/resolve/facts.d.ts +12 -0
- package/dist/resolve/facts.d.ts.map +1 -0
- package/dist/resolve/facts.js +18 -0
- package/dist/resolve/facts.js.map +1 -0
- package/dist/resolve/resolve.d.ts +10 -0
- package/dist/resolve/resolve.d.ts.map +1 -0
- package/dist/resolve/resolve.js +242 -0
- package/dist/resolve/resolve.js.map +1 -0
- package/dist/store.d.ts +11 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +9 -0
- package/dist/store.js.map +1 -0
- package/examples/README.md +20 -30
- package/examples/github-release/release.config.json +11 -18
- package/examples/homebrew-tap/README.md +11 -0
- package/examples/homebrew-tap/release.config.json +40 -28
- package/examples/multi-target/release.config.json +28 -53
- package/examples/npm-first-publish/release.config.json +23 -25
- package/examples/npm-only/release.config.json +22 -30
- package/examples/portable-cli/README.md +17 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-darwin-arm64 +1 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-darwin-x64 +1 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-linux-arm64 +1 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-linux-x64 +1 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-windows-x64.exe +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-macosx_10_15_x86_64.whl +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-macosx_11_0_arm64.whl +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-manylinux2014_aarch64.whl +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-manylinux2014_x86_64.whl +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-win_amd64.whl +1 -0
- package/examples/portable-cli/package.json +9 -0
- package/examples/portable-cli/release.config.json +53 -0
- package/examples/portable-cli/src/cli.ts +3 -0
- package/examples/pypi-registry/README.md +8 -0
- package/examples/scoop-bucket/README.md +10 -0
- package/examples/scoop-bucket/release.config.json +40 -30
- package/package.json +73 -154
- package/src/api/api.ts +365 -0
- package/src/api/errors.ts +36 -0
- package/src/api/input.ts +92 -0
- package/src/api/runtime.ts +14 -0
- package/src/api/types.ts +103 -0
- package/src/capabilities/bun-targets.ts +2 -0
- package/src/capabilities/field-ownership.ts +60 -0
- package/src/capabilities/module.ts +158 -0
- package/src/capabilities/registry.ts +333 -0
- package/src/config/config.ts +48 -0
- package/src/correction/coordinator.ts +336 -0
- package/src/correction/index.ts +2 -0
- package/src/correction/intent.ts +172 -0
- package/src/drivers/archive.ts +111 -0
- package/src/drivers/contain.ts +20 -0
- package/src/drivers/environment.ts +28 -0
- package/src/drivers/errors.ts +6 -0
- package/src/drivers/glob.ts +137 -0
- package/src/drivers/process.ts +339 -0
- package/src/drivers/python-wheel.ts +145 -0
- package/src/drivers/redact.ts +31 -0
- package/src/drivers/seccomp-helper-source.ts +121 -0
- package/src/drivers/utils.ts +10 -0
- package/src/drivers/workspace.ts +46 -0
- package/src/extensions/provider-adapter.ts +99 -0
- package/src/host.ts +140 -0
- package/src/index.ts +64 -0
- package/src/model/artifact-collection.ts +237 -0
- package/src/model/authority.ts +116 -0
- package/src/model/bun-targets.ts +34 -0
- package/src/model/canonical.ts +205 -0
- package/src/model/catalog.ts +220 -0
- package/src/model/digest.ts +172 -0
- package/src/model/errors.ts +6 -0
- package/src/model/primitives.ts +37 -0
- package/src/model/pypi.ts +30 -0
- package/src/model/python-distribution.ts +360 -0
- package/src/model/secret-patterns.ts +11 -0
- package/src/operation-journal/authority.ts +162 -0
- package/src/operation-journal/aws/deadline.ts +41 -0
- package/src/operation-journal/aws/oidc.ts +439 -0
- package/src/operation-journal/aws/policy.ts +491 -0
- package/src/operation-journal/aws/s3-boundary.ts +562 -0
- package/src/operation-journal/aws.ts +60 -0
- package/src/operation-journal/canonical.ts +373 -0
- package/src/operation-journal/model.ts +301 -0
- package/src/operation-journal/reducer.ts +112 -0
- package/src/operation-journal/s3.ts +884 -0
- package/src/operation-journal.ts +51 -0
- package/src/platform/bun.ts +38 -0
- package/src/platform/credentials.ts +1151 -0
- package/src/platform/host-support.ts +4 -0
- package/src/platform/node.ts +38 -0
- package/src/platform/release-runtime.ts +47 -0
- package/src/platform/services.ts +57 -0
- package/src/platform/source-observer.ts +193 -0
- package/src/provider-sdk.ts +48 -0
- package/src/publication/adapter.ts +132 -0
- package/src/publication/authority.ts +397 -0
- package/src/publication/catalog-git.ts +603 -0
- package/src/publication/claim.ts +51 -0
- package/src/publication/coordinator.ts +578 -0
- package/src/publication/github.ts +1022 -0
- package/src/publication/http.ts +101 -0
- package/src/publication/index.ts +4 -0
- package/src/publication/npm.ts +525 -0
- package/src/publication/profiles.ts +94 -0
- package/src/publication/publisher.ts +130 -0
- package/src/publication/pypi.ts +463 -0
- package/src/publication/recovery.ts +349 -0
- package/src/publication/report.ts +628 -0
- package/src/recipes/config.ts +395 -0
- package/src/release/capabilities.ts +460 -0
- package/src/release/compiler.ts +28 -0
- package/src/release/config.ts +12 -0
- package/src/release/context.ts +223 -0
- package/src/release/graph.ts +866 -0
- package/src/release/inspect.ts +83 -0
- package/src/release/prepare.ts +1329 -0
- package/src/release/prepared-ref.ts +193 -0
- package/src/release/prepared-store.ts +378 -0
- package/src/release/prepared.ts +299 -0
- package/src/release/staging.ts +257 -0
- package/src/resolve/authored.ts +64 -0
- package/src/resolve/encode.ts +22 -0
- package/src/resolve/errors.ts +15 -0
- package/src/resolve/facts.ts +18 -0
- package/src/resolve/resolve.ts +328 -0
- package/src/store.ts +28 -0
- package/templates/README.md +55 -72
- package/templates/bun-cli-github/README.md +7 -9
- package/templates/bun-cli-github/release.config.json +35 -73
- package/templates/github-actions/release.yml +74 -0
- package/templates/github-actions/reviewed-release.yml +115 -0
- package/templates/multi-target-homebrew/README.md +10 -0
- package/templates/multi-target-homebrew/release.config.json +43 -60
- package/templates/multi-target-scoop/README.md +10 -0
- package/templates/multi-target-scoop/release.config.json +43 -62
- package/templates/npm-github/release.config.json +25 -38
- package/templates/npm-github/reviewed-release.config.json +37 -0
- package/templates/npm-only/README.md +10 -0
- package/templates/npm-only/release.config.json +15 -30
- package/templates/portable-cli/README.md +13 -0
- package/templates/portable-cli/release.config.json +53 -0
- package/dist/artifacts/adapter.d.ts +0 -39
- package/dist/artifacts/adapter.d.ts.map +0 -1
- package/dist/artifacts/adapter.js +0 -23
- package/dist/artifacts/adapter.js.map +0 -1
- package/dist/artifacts/registry.d.ts +0 -21
- package/dist/artifacts/registry.d.ts.map +0 -1
- package/dist/artifacts/registry.js +0 -21
- package/dist/artifacts/registry.js.map +0 -1
- package/dist/config/errors.d.ts +0 -24
- package/dist/config/errors.d.ts.map +0 -1
- package/dist/config/errors.js +0 -19
- package/dist/config/errors.js.map +0 -1
- package/dist/config/load.d.ts +0 -9
- package/dist/config/load.d.ts.map +0 -1
- package/dist/config/load.js +0 -29
- package/dist/config/load.js.map +0 -1
- package/dist/config/schema.d.ts +0 -12
- package/dist/config/schema.d.ts.map +0 -1
- package/dist/config/schema.js +0 -19
- package/dist/config/schema.js.map +0 -1
- package/dist/domain/artifact.d.ts +0 -118
- package/dist/domain/artifact.d.ts.map +0 -1
- package/dist/domain/artifact.js +0 -197
- package/dist/domain/artifact.js.map +0 -1
- package/dist/domain/evidence.d.ts +0 -59
- package/dist/domain/evidence.d.ts.map +0 -1
- package/dist/domain/evidence.js +0 -51
- package/dist/domain/evidence.js.map +0 -1
- package/dist/domain/operation.d.ts +0 -143
- package/dist/domain/operation.d.ts.map +0 -1
- package/dist/domain/operation.js +0 -198
- package/dist/domain/operation.js.map +0 -1
- package/dist/domain/release.d.ts +0 -93
- package/dist/domain/release.d.ts.map +0 -1
- package/dist/domain/release.js +0 -82
- package/dist/domain/release.js.map +0 -1
- package/dist/domain/remote-state.d.ts +0 -58
- package/dist/domain/remote-state.d.ts.map +0 -1
- package/dist/domain/remote-state.js +0 -55
- package/dist/domain/remote-state.js.map +0 -1
- package/dist/domain/target.d.ts +0 -148
- package/dist/domain/target.d.ts.map +0 -1
- package/dist/domain/target.js +0 -151
- package/dist/domain/target.js.map +0 -1
- package/dist/host/host.d.ts +0 -32
- package/dist/host/host.d.ts.map +0 -1
- package/dist/host/host.js +0 -24
- package/dist/host/host.js.map +0 -1
- package/dist/host/http-live.d.ts +0 -6
- package/dist/host/http-live.d.ts.map +0 -1
- package/dist/host/http-live.js +0 -86
- package/dist/host/http-live.js.map +0 -1
- package/dist/host/http.d.ts +0 -43
- package/dist/host/http.d.ts.map +0 -1
- package/dist/host/http.js +0 -59
- package/dist/host/http.js.map +0 -1
- package/dist/host/platform.d.ts +0 -10
- package/dist/host/platform.d.ts.map +0 -1
- package/dist/host/platform.js +0 -114
- package/dist/host/platform.js.map +0 -1
- package/dist/host/test.d.ts +0 -23
- package/dist/host/test.d.ts.map +0 -1
- package/dist/host/test.js +0 -222
- package/dist/host/test.js.map +0 -1
- package/dist/internal/workspace-path.d.ts +0 -15
- package/dist/internal/workspace-path.d.ts.map +0 -1
- package/dist/internal/workspace-path.js +0 -36
- package/dist/internal/workspace-path.js.map +0 -1
- package/dist/planner/artifact-inventory.d.ts +0 -9
- package/dist/planner/artifact-inventory.d.ts.map +0 -1
- package/dist/planner/artifact-inventory.js +0 -86
- package/dist/planner/artifact-inventory.js.map +0 -1
- package/dist/planner/create-release-plan.d.ts +0 -5
- package/dist/planner/create-release-plan.d.ts.map +0 -1
- package/dist/planner/create-release-plan.js +0 -25
- package/dist/planner/create-release-plan.js.map +0 -1
- package/dist/planner/errors.d.ts +0 -67
- package/dist/planner/errors.d.ts.map +0 -1
- package/dist/planner/errors.js +0 -58
- package/dist/planner/errors.js.map +0 -1
- package/dist/planner/evidence-recorder.d.ts +0 -28
- package/dist/planner/evidence-recorder.d.ts.map +0 -1
- package/dist/planner/evidence-recorder.js +0 -362
- package/dist/planner/evidence-recorder.js.map +0 -1
- package/dist/planner/executor.d.ts +0 -58
- package/dist/planner/executor.d.ts.map +0 -1
- package/dist/planner/executor.js +0 -147
- package/dist/planner/executor.js.map +0 -1
- package/dist/planner/normalize-release.d.ts +0 -19
- package/dist/planner/normalize-release.d.ts.map +0 -1
- package/dist/planner/normalize-release.js +0 -342
- package/dist/planner/normalize-release.js.map +0 -1
- package/dist/planner/reconcile.d.ts +0 -17
- package/dist/planner/reconcile.d.ts.map +0 -1
- package/dist/planner/reconcile.js +0 -259
- package/dist/planner/reconcile.js.map +0 -1
- package/dist/planner/render-plan.d.ts +0 -15
- package/dist/planner/render-plan.d.ts.map +0 -1
- package/dist/planner/render-plan.js +0 -231
- package/dist/planner/render-plan.js.map +0 -1
- package/dist/targets/adapter-helpers.d.ts +0 -79
- package/dist/targets/adapter-helpers.d.ts.map +0 -1
- package/dist/targets/adapter-helpers.js +0 -194
- package/dist/targets/adapter-helpers.js.map +0 -1
- package/dist/targets/adapter.d.ts +0 -17
- package/dist/targets/adapter.d.ts.map +0 -1
- package/dist/targets/adapter.js +0 -2
- package/dist/targets/adapter.js.map +0 -1
- package/dist/targets/github-release.d.ts +0 -25
- package/dist/targets/github-release.d.ts.map +0 -1
- package/dist/targets/github-release.js +0 -82
- package/dist/targets/github-release.js.map +0 -1
- package/dist/targets/github.d.ts +0 -11
- package/dist/targets/github.d.ts.map +0 -1
- package/dist/targets/github.js +0 -117
- package/dist/targets/github.js.map +0 -1
- package/dist/targets/homebrew.d.ts +0 -11
- package/dist/targets/homebrew.d.ts.map +0 -1
- package/dist/targets/homebrew.js +0 -210
- package/dist/targets/homebrew.js.map +0 -1
- package/dist/targets/live.d.ts +0 -5
- package/dist/targets/live.d.ts.map +0 -1
- package/dist/targets/live.js +0 -50
- package/dist/targets/live.js.map +0 -1
- package/dist/targets/npm.d.ts +0 -10
- package/dist/targets/npm.d.ts.map +0 -1
- package/dist/targets/npm.js +0 -112
- package/dist/targets/npm.js.map +0 -1
- package/dist/targets/pypi.d.ts +0 -11
- package/dist/targets/pypi.d.ts.map +0 -1
- package/dist/targets/pypi.js +0 -141
- package/dist/targets/pypi.js.map +0 -1
- package/dist/targets/registry.d.ts +0 -25
- package/dist/targets/registry.d.ts.map +0 -1
- package/dist/targets/registry.js +0 -34
- package/dist/targets/registry.js.map +0 -1
- package/dist/targets/scoop.d.ts +0 -11
- package/dist/targets/scoop.d.ts.map +0 -1
- package/dist/targets/scoop.js +0 -88
- package/dist/targets/scoop.js.map +0 -1
- package/dist/types/effect-internal.d.ts +0 -5
- package/dist/types/effect-internal.d.ts.map +0 -1
- package/dist/types/effect-internal.js +0 -2
- package/dist/types/effect-internal.js.map +0 -1
- package/dist/workflows/config.d.ts +0 -202
- package/dist/workflows/config.d.ts.map +0 -1
- package/dist/workflows/config.js +0 -420
- package/dist/workflows/config.js.map +0 -1
- package/dist/workflows/diagnostics.d.ts +0 -62
- package/dist/workflows/diagnostics.d.ts.map +0 -1
- package/dist/workflows/diagnostics.js +0 -530
- package/dist/workflows/diagnostics.js.map +0 -1
- package/dist/workflows/distribution.d.ts +0 -25
- package/dist/workflows/distribution.d.ts.map +0 -1
- package/dist/workflows/distribution.js +0 -24
- package/dist/workflows/distribution.js.map +0 -1
- package/dist/workflows/evidence.d.ts +0 -17
- package/dist/workflows/evidence.d.ts.map +0 -1
- package/dist/workflows/evidence.js +0 -32
- package/dist/workflows/evidence.js.map +0 -1
- package/dist/workflows/index.d.ts +0 -8
- package/dist/workflows/index.d.ts.map +0 -1
- package/dist/workflows/index.js +0 -7
- package/dist/workflows/index.js.map +0 -1
- package/dist/workflows/init.d.ts +0 -84
- package/dist/workflows/init.d.ts.map +0 -1
- package/dist/workflows/init.js +0 -487
- package/dist/workflows/init.js.map +0 -1
- package/dist/workflows/live.d.ts +0 -9
- package/dist/workflows/live.d.ts.map +0 -1
- package/dist/workflows/live.js +0 -7
- package/dist/workflows/live.js.map +0 -1
- package/dist/workflows/options.d.ts +0 -30
- package/dist/workflows/options.d.ts.map +0 -1
- package/dist/workflows/options.js +0 -16
- package/dist/workflows/options.js.map +0 -1
- package/examples/non-strict-skips/artifacts/release-example-skips-0.1.0.tgz +0 -1
- package/examples/non-strict-skips/release.config.json +0 -31
- package/examples/pypi-registry/release.config.json +0 -31
- package/templates/github-actions/plan-and-approved-execute.yml +0 -58
- package/templates/github-actions/plan-only.yml +0 -33
- package/templates/github-actions/trusted-publishing.yml +0 -61
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as NodeChildProcessSpawner from "@effect/platform-node/NodeChildProcessSpawner"
|
|
2
|
+
import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem"
|
|
3
|
+
import * as NodeHttpClient from "@effect/platform-node/NodeHttpClient"
|
|
4
|
+
import * as NodePath from "@effect/platform-node/NodePath"
|
|
5
|
+
import * as Layer from "effect/Layer"
|
|
6
|
+
import { join } from "node:path"
|
|
7
|
+
import type { ReleaseApiLayer } from "../api/types.js"
|
|
8
|
+
import { SourceObserverLive } from "./source-observer.js"
|
|
9
|
+
import { makeReleaseServicesLive } from "./services.js"
|
|
10
|
+
import {
|
|
11
|
+
makeLocalPreparedReleaseStore,
|
|
12
|
+
type PreparedReleaseStoreShape
|
|
13
|
+
} from "../release/prepared-store.js"
|
|
14
|
+
import type { PublicationClaimStoreShape } from "../publication/claim.js"
|
|
15
|
+
|
|
16
|
+
const nodeHost = Layer.mergeAll(
|
|
17
|
+
NodeChildProcessSpawner.layer.pipe(Layer.provide(Layer.mergeAll(
|
|
18
|
+
NodeFileSystem.layer,
|
|
19
|
+
NodePath.layer
|
|
20
|
+
))),
|
|
21
|
+
NodeHttpClient.layerFetch,
|
|
22
|
+
SourceObserverLive
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
/** A custom Node host takes one already-selected durable store service. */
|
|
26
|
+
export const makeNodeReleaseLayer = (
|
|
27
|
+
preparedStore: PreparedReleaseStoreShape,
|
|
28
|
+
publicationClaimStore?: PublicationClaimStoreShape
|
|
29
|
+
): ReleaseApiLayer => makeReleaseServicesLive(preparedStore, publicationClaimStore).pipe(Layer.provide(nodeHost))
|
|
30
|
+
|
|
31
|
+
const defaultNodeStore = makeLocalPreparedReleaseStore(join(
|
|
32
|
+
process.cwd(),
|
|
33
|
+
".release",
|
|
34
|
+
"ts-release",
|
|
35
|
+
"prepared"
|
|
36
|
+
))
|
|
37
|
+
|
|
38
|
+
export const NodeReleaseLayer: ReleaseApiLayer = makeNodeReleaseLayer(defaultNodeStore)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect"
|
|
2
|
+
import * as Layer from "effect/Layer"
|
|
3
|
+
import * as HttpBody from "effect/unstable/http/HttpBody"
|
|
4
|
+
import * as HttpClient from "effect/unstable/http/HttpClient"
|
|
5
|
+
import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest"
|
|
6
|
+
import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"
|
|
7
|
+
import { ReleaseRuntime } from "../api/runtime.js"
|
|
8
|
+
import { makeRunCommand } from "../drivers/process.js"
|
|
9
|
+
import { PublicationHttpError, type HttpRequest, type HttpResponse, type PublicationHttp } from "../publication/http.js"
|
|
10
|
+
import { SourceObserver } from "../release/context.js"
|
|
11
|
+
|
|
12
|
+
const makeWireRequest = (request: HttpRequest): HttpClientRequest.HttpClientRequest => {
|
|
13
|
+
const wire = HttpClientRequest.make(request.method)(request.url, request.body === undefined ? {} : {
|
|
14
|
+
body: HttpBody.uint8Array(typeof request.body === "string"
|
|
15
|
+
? new TextEncoder().encode(request.body)
|
|
16
|
+
: request.body)
|
|
17
|
+
})
|
|
18
|
+
return request.headers === undefined ? wire : HttpClientRequest.setHeaders(wire, request.headers)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const makePublicationHttp = (client: HttpClient.HttpClient): PublicationHttp => ({
|
|
22
|
+
request: (request: HttpRequest) => makeWireRequest(request).pipe(
|
|
23
|
+
(wire) => client.execute(wire),
|
|
24
|
+
Effect.flatMap((response) => response.arrayBuffer.pipe(Effect.map((body) => ({
|
|
25
|
+
status: response.status,
|
|
26
|
+
headers: Object.fromEntries(Object.entries(response.headers)),
|
|
27
|
+
body: new Uint8Array(body)
|
|
28
|
+
} satisfies HttpResponse)))),
|
|
29
|
+
Effect.mapError(() => PublicationHttpError.make({
|
|
30
|
+
commitment: "unknown",
|
|
31
|
+
reason: "The provider HTTP transport failed after dispatch."
|
|
32
|
+
}))
|
|
33
|
+
)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
/** Runtime-only process and source services. Durable storage is a direct service. */
|
|
37
|
+
export const ReleaseRuntimeLive: Layer.Layer<
|
|
38
|
+
ReleaseRuntime,
|
|
39
|
+
never,
|
|
40
|
+
SourceObserver | ChildProcessSpawner
|
|
41
|
+
> = Layer.effect(ReleaseRuntime, Effect.gen(function*() {
|
|
42
|
+
const source = yield* SourceObserver
|
|
43
|
+
const run = yield* makeRunCommand
|
|
44
|
+
return { source, run }
|
|
45
|
+
}))
|
|
46
|
+
|
|
47
|
+
export const makeReleaseRuntimeLive = (): typeof ReleaseRuntimeLive => ReleaseRuntimeLive
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as Context from "effect/Context"
|
|
2
|
+
import * as Effect from "effect/Effect"
|
|
3
|
+
import * as Layer from "effect/Layer"
|
|
4
|
+
import * as HttpClient from "effect/unstable/http/HttpClient"
|
|
5
|
+
import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"
|
|
6
|
+
import type { ReleaseApiServices } from "../api/types.js"
|
|
7
|
+
import { ReleaseRuntime } from "../api/runtime.js"
|
|
8
|
+
import { makeRunCommand } from "../drivers/process.js"
|
|
9
|
+
import {
|
|
10
|
+
AuthorizedMutationHttp,
|
|
11
|
+
CertifiedPublisherSpawn,
|
|
12
|
+
HttpAuthorizer,
|
|
13
|
+
NpmUserConfigResource,
|
|
14
|
+
makeEnvironmentCredentialPlatform
|
|
15
|
+
} from "./credentials.js"
|
|
16
|
+
import { CredentialProvider } from "../publication/authority.js"
|
|
17
|
+
import { PublicationClaimStore, type PublicationClaimStoreShape } from "../publication/claim.js"
|
|
18
|
+
import { SourceObserver } from "../release/context.js"
|
|
19
|
+
import {
|
|
20
|
+
PreparedReleaseStore,
|
|
21
|
+
type PreparedReleaseStoreShape
|
|
22
|
+
} from "../release/prepared-store.js"
|
|
23
|
+
import { makePublicationHttp } from "./release-runtime.js"
|
|
24
|
+
|
|
25
|
+
export type ReleaseServicesLayer = Layer.Layer<
|
|
26
|
+
ReleaseApiServices,
|
|
27
|
+
never,
|
|
28
|
+
SourceObserver | ChildProcessSpawner | HttpClient.HttpClient
|
|
29
|
+
>
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Compose the API's complete service boundary once. The raw HTTP transport and
|
|
33
|
+
* child-process spawner remain host inputs; only authority-checking services
|
|
34
|
+
* and the direct prepared store enter the API environment.
|
|
35
|
+
*/
|
|
36
|
+
export const makeReleaseServicesLive = (
|
|
37
|
+
preparedStore: PreparedReleaseStoreShape,
|
|
38
|
+
publicationClaimStore?: PublicationClaimStoreShape
|
|
39
|
+
): ReleaseServicesLayer => Layer.effectContext(Effect.gen(function*() {
|
|
40
|
+
const source = yield* SourceObserver
|
|
41
|
+
const run = yield* makeRunCommand
|
|
42
|
+
const client = yield* HttpClient.HttpClient
|
|
43
|
+
const spawner = yield* ChildProcessSpawner
|
|
44
|
+
const credentials = makeEnvironmentCredentialPlatform(makePublicationHttp(client), spawner)
|
|
45
|
+
|
|
46
|
+
const context = Context.make(ReleaseRuntime, { source, run }).pipe(
|
|
47
|
+
Context.add(PreparedReleaseStore, preparedStore),
|
|
48
|
+
Context.add(CredentialProvider, credentials.credentialProvider),
|
|
49
|
+
Context.add(HttpAuthorizer, credentials.httpAuthorizer),
|
|
50
|
+
Context.add(AuthorizedMutationHttp, credentials.authorizedMutationHttp),
|
|
51
|
+
Context.add(NpmUserConfigResource, credentials.npmUserConfigResource),
|
|
52
|
+
Context.add(CertifiedPublisherSpawn, credentials.certifiedPublisherSpawn)
|
|
53
|
+
)
|
|
54
|
+
return publicationClaimStore === undefined
|
|
55
|
+
? context
|
|
56
|
+
: Context.add(context, PublicationClaimStore, publicationClaimStore)
|
|
57
|
+
}))
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect"
|
|
2
|
+
import * as Layer from "effect/Layer"
|
|
3
|
+
import {
|
|
4
|
+
chmodSync,
|
|
5
|
+
lstatSync,
|
|
6
|
+
mkdirSync,
|
|
7
|
+
readFileSync,
|
|
8
|
+
readdirSync,
|
|
9
|
+
realpathSync,
|
|
10
|
+
symlinkSync,
|
|
11
|
+
writeFileSync
|
|
12
|
+
} from "node:fs"
|
|
13
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path"
|
|
14
|
+
import { spawnSync } from "node:child_process"
|
|
15
|
+
import { sha256Digest } from "../model/digest.js"
|
|
16
|
+
import { SafeRelativePath } from "../model/primitives.js"
|
|
17
|
+
import {
|
|
18
|
+
makeSourceObserver,
|
|
19
|
+
SourceMaterializationError,
|
|
20
|
+
SourceObserver,
|
|
21
|
+
type SourceObserverRuntime,
|
|
22
|
+
type StagingEntry,
|
|
23
|
+
type VerifiedSource
|
|
24
|
+
} from "../release/context.js"
|
|
25
|
+
import { canonicalStagingPath, snapshotStaging } from "../release/staging.js"
|
|
26
|
+
|
|
27
|
+
const materializationFailure = (field: string, reason: string): SourceMaterializationError =>
|
|
28
|
+
new SourceMaterializationError({ field, reason })
|
|
29
|
+
|
|
30
|
+
const gitBytes = (workspace: string, argv: ReadonlyArray<string>, input?: Uint8Array): Uint8Array => {
|
|
31
|
+
const result = spawnSync("git", [...argv], {
|
|
32
|
+
cwd: workspace,
|
|
33
|
+
encoding: null,
|
|
34
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
35
|
+
...(input === undefined ? {} : { input }),
|
|
36
|
+
maxBuffer: 1024 * 1024 * 1024
|
|
37
|
+
})
|
|
38
|
+
if (result.error !== undefined) throw result.error
|
|
39
|
+
if (result.status !== 0) {
|
|
40
|
+
throw new Error(Buffer.from(result.stderr ?? []).toString("utf8").trim() || `git ${argv[0]} exited ${result.status}.`)
|
|
41
|
+
}
|
|
42
|
+
return new Uint8Array(result.stdout ?? [])
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const gitText = (workspace: string, argv: ReadonlyArray<string>, input?: Uint8Array): string =>
|
|
46
|
+
new TextDecoder("utf-8", { fatal: true }).decode(gitBytes(workspace, argv, input))
|
|
47
|
+
|
|
48
|
+
const contained = (root: string, candidate: string): boolean => {
|
|
49
|
+
const path = relative(root, candidate)
|
|
50
|
+
return path === "" || (path !== ".." && !path.startsWith(`..${sep}`) && !isAbsolute(path))
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface GitTreeEntry {
|
|
54
|
+
readonly mode: "100644" | "100755" | "120000"
|
|
55
|
+
readonly object: string
|
|
56
|
+
readonly path: SafeRelativePath
|
|
57
|
+
readonly bytes: Uint8Array
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const parseTree = (workspace: string, source: VerifiedSource): ReadonlyArray<GitTreeEntry> => {
|
|
61
|
+
const raw = gitBytes(workspace, ["ls-tree", "-r", "-z", "--full-tree", source.commit.toString()])
|
|
62
|
+
const decoded = new TextDecoder("utf-8", { fatal: true })
|
|
63
|
+
const entries: GitTreeEntry[] = []
|
|
64
|
+
let cursor = 0
|
|
65
|
+
while (cursor < raw.length) {
|
|
66
|
+
const end = raw.indexOf(0, cursor)
|
|
67
|
+
if (end < 0) throw materializationFailure("source.tree", "Git tree output omitted its NUL terminator.")
|
|
68
|
+
const record = raw.slice(cursor, end)
|
|
69
|
+
cursor = end + 1
|
|
70
|
+
const tab = record.indexOf(9)
|
|
71
|
+
if (tab < 0) throw materializationFailure("source.tree", "Git tree output omitted its pathname separator.")
|
|
72
|
+
const header = decoded.decode(record.slice(0, tab))
|
|
73
|
+
const match = /^(100644|100755|120000) blob ([a-f0-9]+)$/u.exec(header)
|
|
74
|
+
if (match === null) {
|
|
75
|
+
const unsupported = /^(\d+) (\w+) /u.exec(header)
|
|
76
|
+
throw materializationFailure(
|
|
77
|
+
"source.tree",
|
|
78
|
+
unsupported?.[2] === "commit"
|
|
79
|
+
? "Verified source contains a submodule; declare and verify it as a separate input before preparation."
|
|
80
|
+
: `Verified source contains unsupported Git entry ${header}.`
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
const pathText = decoded.decode(record.slice(tab + 1))
|
|
84
|
+
const path = canonicalStagingPath(pathText)
|
|
85
|
+
const bytes = gitBytes(workspace, ["cat-file", "blob", match[2]!])
|
|
86
|
+
const observedObject = gitText(workspace, ["hash-object", "--stdin"], bytes).trim()
|
|
87
|
+
if (observedObject !== match[2]) {
|
|
88
|
+
throw materializationFailure("source.tree", `Git object ${match[2]} failed content verification.`)
|
|
89
|
+
}
|
|
90
|
+
entries.push({ mode: match[1] as GitTreeEntry["mode"], object: match[2]!, path, bytes })
|
|
91
|
+
}
|
|
92
|
+
return entries.sort((left, right) => left.path < right.path ? -1 : left.path > right.path ? 1 : 0)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const assertTrackedSourceStable = (workspace: string, source: VerifiedSource): void => {
|
|
96
|
+
const head = gitText(workspace, ["rev-parse", "HEAD"]).trim()
|
|
97
|
+
const tree = gitText(workspace, ["rev-parse", `${source.commit}^{tree}`]).trim()
|
|
98
|
+
const status = gitText(workspace, ["status", "--porcelain=v1", "--untracked-files=no"]).trim()
|
|
99
|
+
if (head !== source.commit.toString()) {
|
|
100
|
+
throw materializationFailure("source.commit", `Verified commit ${source.commit} drifted to ${head} before materialization.`)
|
|
101
|
+
}
|
|
102
|
+
if (tree !== source.tree.toString()) {
|
|
103
|
+
throw materializationFailure("source.tree", `Verified tree ${source.tree} disagrees with commit tree ${tree}.`)
|
|
104
|
+
}
|
|
105
|
+
if (status.length > 0) {
|
|
106
|
+
throw materializationFailure("source.clean", "Tracked source changed after verification and before materialization.")
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const materializeGitSource = (
|
|
111
|
+
workspaceValue: string,
|
|
112
|
+
source: VerifiedSource,
|
|
113
|
+
destinationValue: string
|
|
114
|
+
) => {
|
|
115
|
+
const workspace = realpathSync(workspaceValue)
|
|
116
|
+
const destination = realpathSync(destinationValue)
|
|
117
|
+
if (lstatSync(destination).isSymbolicLink() || !lstatSync(destination).isDirectory() || readdirSync(destination).length > 0) {
|
|
118
|
+
throw materializationFailure("source.destination", "Exact source materialization requires a fresh real directory.")
|
|
119
|
+
}
|
|
120
|
+
assertTrackedSourceStable(workspace, source)
|
|
121
|
+
const entries = parseTree(workspace, source)
|
|
122
|
+
const folded = new Map<string, string>()
|
|
123
|
+
for (const entry of entries) {
|
|
124
|
+
const portablePath = entry.path.toString()
|
|
125
|
+
const collision = folded.get(portablePath.toLocaleLowerCase("en-US"))
|
|
126
|
+
if (collision !== undefined && collision !== portablePath) {
|
|
127
|
+
throw materializationFailure("source.path", `Git paths ${collision} and ${portablePath} collide under case folding.`)
|
|
128
|
+
}
|
|
129
|
+
folded.set(portablePath.toLocaleLowerCase("en-US"), portablePath)
|
|
130
|
+
const target = join(destination, portablePath)
|
|
131
|
+
if (!contained(destination, target)) throw materializationFailure("source.path", `Git path ${portablePath} escapes staging.`)
|
|
132
|
+
mkdirSync(dirname(target), { recursive: true, mode: 0o700 })
|
|
133
|
+
if (entry.mode === "120000") {
|
|
134
|
+
const link = new TextDecoder("utf-8", { fatal: true }).decode(entry.bytes)
|
|
135
|
+
const landed = resolve(dirname(target), link)
|
|
136
|
+
if (link.length === 0 || isAbsolute(link) || !contained(destination, landed)) {
|
|
137
|
+
throw materializationFailure("source.symlink", `Git symlink ${portablePath} escapes private staging.`)
|
|
138
|
+
}
|
|
139
|
+
symlinkSync(link, target)
|
|
140
|
+
} else {
|
|
141
|
+
writeFileSync(target, entry.bytes, { mode: entry.mode === "100755" ? 0o755 : 0o644, flag: "wx" })
|
|
142
|
+
chmodSync(target, entry.mode === "100755" ? 0o755 : 0o644)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const snapshot = snapshotStaging(destination)
|
|
146
|
+
const files = snapshot.entries.filter((entry) => entry.kind !== "directory")
|
|
147
|
+
if (files.length !== entries.length) {
|
|
148
|
+
throw materializationFailure("source.tree", "Materialized tree has an unexpected file or symlink set.")
|
|
149
|
+
}
|
|
150
|
+
const actual = new Map<string, StagingEntry>(files.map((entry) => [entry.path.toString(), entry]))
|
|
151
|
+
for (const expected of entries) {
|
|
152
|
+
const entry = actual.get(expected.path.toString())
|
|
153
|
+
const kind = expected.mode === "120000" ? "symlink" : expected.mode === "100755" ? "executable" : "file"
|
|
154
|
+
if (entry === undefined || entry.kind !== kind || entry.size !== expected.bytes.length ||
|
|
155
|
+
entry.digest.hex !== sha256Digest(expected.bytes).hex) {
|
|
156
|
+
throw materializationFailure("source.tree", `Materialized path ${expected.path} failed byte or mode verification.`)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
const packageBytes = new Uint8Array(readFileSync(join(destination, source.packageManifestPath.toString())))
|
|
160
|
+
if (sha256Digest(packageBytes).hex !== source.packageManifestDigest.hex) {
|
|
161
|
+
throw materializationFailure("source.packageManifestDigest", "Materialized package manifest disagrees with verified source facts.")
|
|
162
|
+
}
|
|
163
|
+
assertTrackedSourceStable(workspace, source)
|
|
164
|
+
return snapshot
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const runtime: SourceObserverRuntime = {
|
|
168
|
+
canonicalRoot: (workspace) => Effect.try({
|
|
169
|
+
try: () => realpathSync(workspace), catch: (cause) => cause
|
|
170
|
+
}),
|
|
171
|
+
read: (workspace, path) => Effect.try({
|
|
172
|
+
try: () => new Uint8Array(readFileSync(join(workspace, path))), catch: (cause) => cause
|
|
173
|
+
}),
|
|
174
|
+
command: (workspace, argv) => Effect.try({
|
|
175
|
+
try: () => {
|
|
176
|
+
const result = spawnSync("git", [...argv], { cwd: workspace, encoding: "utf8", stdio: "pipe" })
|
|
177
|
+
if (result.error !== undefined) throw result.error
|
|
178
|
+
if (result.status !== 0) throw new Error(result.stderr.trim() || `Command exited ${result.status}.`)
|
|
179
|
+
return result.stdout
|
|
180
|
+
},
|
|
181
|
+
catch: (cause) => cause
|
|
182
|
+
}),
|
|
183
|
+
digest: (bytes) => Effect.sync(() => sha256Digest(bytes)),
|
|
184
|
+
materialize: (workspace, source, destination) => Effect.try({
|
|
185
|
+
try: () => materializeGitSource(workspace, source, destination),
|
|
186
|
+
catch: (cause) => cause
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Both supported runtimes use the same observation contract; only this host
|
|
191
|
+
// layer closes its filesystem/process primitives. The observer itself remains
|
|
192
|
+
// shared with tests and future library hosts.
|
|
193
|
+
export const SourceObserverLive = Layer.succeed(SourceObserver, makeSourceObserver(runtime))
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library/application-only provider composition. The stock CLI and Action do
|
|
3
|
+
* not discover packages, import configured code, or install adapters from
|
|
4
|
+
* serialized release configuration.
|
|
5
|
+
*/
|
|
6
|
+
export {
|
|
7
|
+
ProviderAdapterContract,
|
|
8
|
+
customProviderSubjects,
|
|
9
|
+
makeProviderAdapter
|
|
10
|
+
} from "./extensions/provider-adapter.js"
|
|
11
|
+
export type {
|
|
12
|
+
CustomProviderAdapter,
|
|
13
|
+
CustomProviderAdapterInput
|
|
14
|
+
} from "./extensions/provider-adapter.js"
|
|
15
|
+
export type { PublicationSubjectServices } from "./capabilities/module.js"
|
|
16
|
+
export type {
|
|
17
|
+
ReleaseObservationContext,
|
|
18
|
+
ReleaseSubject
|
|
19
|
+
} from "./publication/coordinator.js"
|
|
20
|
+
export {
|
|
21
|
+
conservativeUnknownRecoveryProfile,
|
|
22
|
+
makeRecoveryCapabilityProfile
|
|
23
|
+
} from "./publication/recovery.js"
|
|
24
|
+
export type {
|
|
25
|
+
PublicationProfileRegistration,
|
|
26
|
+
RecoveryCapabilityProfile
|
|
27
|
+
} from "./publication/recovery.js"
|
|
28
|
+
export {
|
|
29
|
+
SubjectId,
|
|
30
|
+
CanonicalAudience,
|
|
31
|
+
CredentialRef,
|
|
32
|
+
CredentialRequest,
|
|
33
|
+
ProviderId
|
|
34
|
+
} from "./model/authority.js"
|
|
35
|
+
export {
|
|
36
|
+
AuthoritativelyAbsent,
|
|
37
|
+
InconclusiveObservation,
|
|
38
|
+
MutationPrecondition,
|
|
39
|
+
NeedsMutation,
|
|
40
|
+
OutcomeUnknown,
|
|
41
|
+
PresentDifferent,
|
|
42
|
+
PresentEquivalent,
|
|
43
|
+
ProviderAlreadyEquivalent,
|
|
44
|
+
ProviderBlocked,
|
|
45
|
+
RejectedByProvider,
|
|
46
|
+
SafeReason,
|
|
47
|
+
Started
|
|
48
|
+
} from "./publication/report.js"
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect"
|
|
2
|
+
import * as Option from "effect/Option"
|
|
3
|
+
import { SubjectId } from "../model/authority.js"
|
|
4
|
+
import {
|
|
5
|
+
githubPublicationCapability,
|
|
6
|
+
catalogPublicationCapability,
|
|
7
|
+
npmPublicationCapability,
|
|
8
|
+
pyPiPublicationCapability
|
|
9
|
+
} from "../capabilities/registry.js"
|
|
10
|
+
import { encodePreparedRelease } from "../release/prepared.js"
|
|
11
|
+
import type { PreparedBundle } from "../release/prepared-store.js"
|
|
12
|
+
import { sha256 } from "../drivers/utils.js"
|
|
13
|
+
import {
|
|
14
|
+
observeReleaseSubjects,
|
|
15
|
+
publishReleaseSubjects,
|
|
16
|
+
type ReleaseSubject
|
|
17
|
+
} from "./coordinator.js"
|
|
18
|
+
import { AuthorizedMutationHttp, HttpAuthorizer } from "./http.js"
|
|
19
|
+
import {
|
|
20
|
+
CertifiedPublisherSpawn,
|
|
21
|
+
NpmUserConfigResource
|
|
22
|
+
} from "./publisher.js"
|
|
23
|
+
import {
|
|
24
|
+
validateRecoveryProfileSubjects,
|
|
25
|
+
type PublicationProfileRegistration
|
|
26
|
+
} from "./recovery.js"
|
|
27
|
+
import {
|
|
28
|
+
PublicationClaimStore,
|
|
29
|
+
unavailablePublicationClaimStore
|
|
30
|
+
} from "./claim.js"
|
|
31
|
+
import { customProviderSubjects, type CustomProviderAdapter } from "../extensions/provider-adapter.js"
|
|
32
|
+
export { installedPublicationProfiles } from "./profiles.js"
|
|
33
|
+
|
|
34
|
+
const registerSubjects = (
|
|
35
|
+
registration: PublicationProfileRegistration,
|
|
36
|
+
subjects: ReadonlyArray<ReleaseSubject>
|
|
37
|
+
): ReadonlyArray<ReleaseSubject> => {
|
|
38
|
+
validateRecoveryProfileSubjects(
|
|
39
|
+
registration.id,
|
|
40
|
+
registration.recovery,
|
|
41
|
+
subjects.map((subject) => subject.recovery)
|
|
42
|
+
)
|
|
43
|
+
return subjects
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const preparedSubject = (bundle: PreparedBundle): SubjectId => SubjectId.make(
|
|
47
|
+
`prepared:sha256-${sha256(encodePreparedRelease(bundle.manifest))}`
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Construct provider subjects only after the caller has loaded and verified
|
|
52
|
+
* the complete prepared bundle. The host authorizer is captured as an opaque
|
|
53
|
+
* sink; transports and credential values never enter the subject contract.
|
|
54
|
+
*/
|
|
55
|
+
export const subjectsForPreparedRelease = Effect.fn("subjectsForPreparedRelease")(function*(
|
|
56
|
+
bundle: PreparedBundle,
|
|
57
|
+
adapters: ReadonlyArray<CustomProviderAdapter> = []
|
|
58
|
+
) {
|
|
59
|
+
const http = yield* HttpAuthorizer
|
|
60
|
+
const mutationHttp = yield* AuthorizedMutationHttp
|
|
61
|
+
const userConfigs = yield* NpmUserConfigResource
|
|
62
|
+
const publisher = yield* CertifiedPublisherSpawn
|
|
63
|
+
const claimOption = yield* Effect.serviceOption(PublicationClaimStore)
|
|
64
|
+
const claims = Option.getOrElse(claimOption, () => unavailablePublicationClaimStore)
|
|
65
|
+
const subjects: Array<ReleaseSubject> = []
|
|
66
|
+
const priorPublicationSubjects: Array<SubjectId> = []
|
|
67
|
+
const services = { http, mutationHttp, userConfigs, publisher, claims }
|
|
68
|
+
for (const publication of bundle.manifest.publications) {
|
|
69
|
+
const moduleSubjects = publication._tag === "PreparedNpmPublication"
|
|
70
|
+
? npmPublicationCapability.subjects(bundle, publication, services)
|
|
71
|
+
: publication._tag === "PreparedPyPiPublication"
|
|
72
|
+
? pyPiPublicationCapability.subjects(bundle, publication, services)
|
|
73
|
+
: publication._tag === "PreparedGitHubPublication"
|
|
74
|
+
? githubPublicationCapability.subjects(bundle, publication, services)
|
|
75
|
+
: catalogPublicationCapability.subjects(bundle, publication, services)
|
|
76
|
+
const registered = registerSubjects(
|
|
77
|
+
publication._tag === "PreparedNpmPublication"
|
|
78
|
+
? npmPublicationCapability.profile
|
|
79
|
+
: publication._tag === "PreparedPyPiPublication"
|
|
80
|
+
? pyPiPublicationCapability.profile
|
|
81
|
+
: publication._tag === "PreparedGitHubPublication"
|
|
82
|
+
? githubPublicationCapability.profile
|
|
83
|
+
: catalogPublicationCapability.profile,
|
|
84
|
+
moduleSubjects
|
|
85
|
+
)
|
|
86
|
+
const ordered = registered.map((subject): ReleaseSubject => priorPublicationSubjects.length === 0
|
|
87
|
+
? subject
|
|
88
|
+
: {
|
|
89
|
+
...subject,
|
|
90
|
+
prerequisites: [...new Set([
|
|
91
|
+
...(subject.prerequisites ?? []),
|
|
92
|
+
...priorPublicationSubjects
|
|
93
|
+
])]
|
|
94
|
+
})
|
|
95
|
+
subjects.push(...ordered)
|
|
96
|
+
priorPublicationSubjects.push(...registered.map((subject) => subject.id))
|
|
97
|
+
}
|
|
98
|
+
const custom = customProviderSubjects(
|
|
99
|
+
bundle,
|
|
100
|
+
adapters,
|
|
101
|
+
services,
|
|
102
|
+
new Set([preparedSubject(bundle).toString(), ...priorPublicationSubjects.map((id) => id.toString())])
|
|
103
|
+
).map((subject): ReleaseSubject => priorPublicationSubjects.length === 0
|
|
104
|
+
? subject
|
|
105
|
+
: {
|
|
106
|
+
...subject,
|
|
107
|
+
prerequisites: [...new Set([
|
|
108
|
+
...(subject.prerequisites ?? []),
|
|
109
|
+
...priorPublicationSubjects
|
|
110
|
+
])]
|
|
111
|
+
})
|
|
112
|
+
subjects.push(...custom)
|
|
113
|
+
return subjects as ReadonlyArray<ReleaseSubject>
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
/** Remote, read-only observation through the same provider subjects as publish. */
|
|
117
|
+
export const observePreparedRelease = Effect.fn("observePreparedRelease")(function*(
|
|
118
|
+
bundle: PreparedBundle,
|
|
119
|
+
adapters: ReadonlyArray<CustomProviderAdapter> = []
|
|
120
|
+
) {
|
|
121
|
+
const subjects = yield* subjectsForPreparedRelease(bundle, adapters)
|
|
122
|
+
return yield* observeReleaseSubjects({ prepared: preparedSubject(bundle), subjects })
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
/** Dependency-ordered conservative publication through the shared coordinator. */
|
|
126
|
+
export const publishPreparedRelease = Effect.fn("publishPreparedRelease")(function*(
|
|
127
|
+
bundle: PreparedBundle,
|
|
128
|
+
adapters: ReadonlyArray<CustomProviderAdapter> = []
|
|
129
|
+
) {
|
|
130
|
+
const subjects = yield* subjectsForPreparedRelease(bundle, adapters)
|
|
131
|
+
return yield* publishReleaseSubjects({ prepared: preparedSubject(bundle), subjects })
|
|
132
|
+
})
|