@mannyc1/ts-release 0.0.6 → 0.2.2
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 +124 -87
- package/CHANGELOG.md +115 -0
- package/LICENSE +21 -0
- package/README.md +272 -540
- package/SPEC.md +206 -305
- package/apps/release-ts/README.md +32 -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 +117 -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 +39239 -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 +8 -0
- package/dist/drivers/archive.d.ts.map +1 -0
- package/dist/drivers/archive.js +101 -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/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 +6 -0
- package/dist/drivers/workspace.d.ts.map +1 -0
- package/dist/drivers/workspace.js +49 -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/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 +772 -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 +644 -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 +1116 -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 +337 -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 +61 -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 +102 -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 +340 -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 +40 -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/platform/bun.ts +38 -0
- package/src/platform/credentials.ts +1083 -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 +954 -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 +459 -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 +1331 -0
- package/src/release/prepared-ref.ts +193 -0
- package/src/release/prepared-store.ts +377 -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 -59
- package/templates/bun-cli-github/README.md +12 -0
- package/templates/bun-cli-github/release.config.json +51 -0
- package/templates/github-actions/release.yml +57 -0
- package/templates/github-actions/reviewed-release.yml +80 -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/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 -36
- package/dist/domain/artifact.d.ts.map +0 -1
- package/dist/domain/artifact.js +0 -29
- package/dist/domain/artifact.js.map +0 -1
- package/dist/domain/evidence.d.ts +0 -108
- package/dist/domain/evidence.d.ts.map +0 -1
- package/dist/domain/evidence.js +0 -96
- package/dist/domain/evidence.js.map +0 -1
- package/dist/domain/operation.d.ts +0 -153
- package/dist/domain/operation.d.ts.map +0 -1
- package/dist/domain/operation.js +0 -320
- package/dist/domain/operation.js.map +0 -1
- package/dist/domain/release.d.ts +0 -141
- package/dist/domain/release.d.ts.map +0 -1
- package/dist/domain/release.js +0 -127
- package/dist/domain/release.js.map +0 -1
- package/dist/domain/remote-state.d.ts +0 -85
- package/dist/domain/remote-state.d.ts.map +0 -1
- package/dist/domain/remote-state.js +0 -77
- package/dist/domain/remote-state.js.map +0 -1
- package/dist/domain/status.d.ts +0 -43
- package/dist/domain/status.d.ts.map +0 -1
- package/dist/domain/status.js +0 -51
- package/dist/domain/status.js.map +0 -1
- package/dist/domain/target.d.ts +0 -135
- package/dist/domain/target.d.ts.map +0 -1
- package/dist/domain/target.js +0 -137
- 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/workflow-phases.d.ts +0 -3
- package/dist/internal/workflow-phases.d.ts.map +0 -1
- package/dist/internal/workflow-phases.js +0 -2
- package/dist/internal/workflow-phases.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 -84
- 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 -81
- package/dist/planner/errors.d.ts.map +0 -1
- package/dist/planner/errors.js +0 -70
- package/dist/planner/errors.js.map +0 -1
- package/dist/planner/evidence-recorder.d.ts +0 -26
- package/dist/planner/evidence-recorder.d.ts.map +0 -1
- package/dist/planner/evidence-recorder.js +0 -330
- 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 -159
- package/dist/planner/executor.js.map +0 -1
- package/dist/planner/normalize-release.d.ts +0 -16
- package/dist/planner/normalize-release.d.ts.map +0 -1
- package/dist/planner/normalize-release.js +0 -218
- 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 -261
- package/dist/planner/reconcile.js.map +0 -1
- package/dist/planner/release-eligibility.d.ts +0 -39
- package/dist/planner/release-eligibility.d.ts.map +0 -1
- package/dist/planner/release-eligibility.js +0 -578
- package/dist/planner/release-eligibility.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 -238
- package/dist/planner/render-plan.js.map +0 -1
- package/dist/planner/status.d.ts +0 -40
- package/dist/planner/status.d.ts.map +0 -1
- package/dist/planner/status.js +0 -313
- package/dist/planner/status.js.map +0 -1
- package/dist/targets/adapter-helpers.d.ts +0 -64
- package/dist/targets/adapter-helpers.d.ts.map +0 -1
- package/dist/targets/adapter-helpers.js +0 -124
- 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 -125
- 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 -97
- 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 -118
- 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 -103
- 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 -78
- 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 -252
- package/dist/workflows/config.d.ts.map +0 -1
- package/dist/workflows/config.js +0 -465
- 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 -527
- package/dist/workflows/diagnostics.js.map +0 -1
- package/dist/workflows/evidence.d.ts +0 -26
- package/dist/workflows/evidence.d.ts.map +0 -1
- package/dist/workflows/evidence.js +0 -44
- package/dist/workflows/evidence.js.map +0 -1
- package/dist/workflows/index.d.ts +0 -7
- package/dist/workflows/index.d.ts.map +0 -1
- package/dist/workflows/index.js +0 -6
- 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 -441
- 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,99 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema"
|
|
2
|
+
import { NonEmptyName } from "../model/primitives.js"
|
|
3
|
+
import type { ReleaseSubject } from "../publication/coordinator.js"
|
|
4
|
+
import {
|
|
5
|
+
assertRecoveryProfileMatches,
|
|
6
|
+
validatePublicationProfiles,
|
|
7
|
+
type PublicationProfileRegistration
|
|
8
|
+
} from "../publication/recovery.js"
|
|
9
|
+
import type { PublicationSubjectServices } from "../capabilities/module.js"
|
|
10
|
+
import type { PreparedBundle } from "../release/prepared-store.js"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Closed acknowledgements required from every custom application adapter.
|
|
14
|
+
* They are intentionally precise rather than extensible strings: a boolean
|
|
15
|
+
* success callback or generic command publisher cannot satisfy this contract.
|
|
16
|
+
*/
|
|
17
|
+
export class ProviderAdapterContract
|
|
18
|
+
extends Schema.Class<ProviderAdapterContract>("ProviderAdapterContract")({
|
|
19
|
+
schemaVersion: Schema.Literal("ts-release/provider-adapter-contract/v1"),
|
|
20
|
+
preparedSubject: Schema.Literal("typed-canonical-data"),
|
|
21
|
+
identity: Schema.Literal("canonical-subject-id"),
|
|
22
|
+
observation: Schema.Literal("exact-equality-and-authoritative-absence"),
|
|
23
|
+
mutation: Schema.Literal("typed-precondition-and-commitment"),
|
|
24
|
+
credentials: Schema.Literal("audience-and-purpose-scoped"),
|
|
25
|
+
recovery: Schema.Literal("coordinator-profile"),
|
|
26
|
+
certification: Schema.Literal("provider-protocol-and-public-boundary-tests")
|
|
27
|
+
}) {}
|
|
28
|
+
|
|
29
|
+
export interface CustomProviderAdapterInput {
|
|
30
|
+
readonly id: string
|
|
31
|
+
readonly contract: ProviderAdapterContract
|
|
32
|
+
readonly profile: PublicationProfileRegistration
|
|
33
|
+
/**
|
|
34
|
+
* Derive typed subjects only from a verified prepared bundle and opaque host
|
|
35
|
+
* sinks. Returning no subject means this installed application adapter does
|
|
36
|
+
* not apply to that bundle.
|
|
37
|
+
*/
|
|
38
|
+
readonly subjects: (
|
|
39
|
+
bundle: PreparedBundle,
|
|
40
|
+
services: PublicationSubjectServices
|
|
41
|
+
) => ReadonlyArray<ReleaseSubject>
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface CustomProviderAdapter extends Omit<CustomProviderAdapterInput, "id"> {
|
|
45
|
+
readonly _tag: "CustomProviderAdapter"
|
|
46
|
+
readonly id: NonEmptyName
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const decodeContract = Schema.decodeUnknownSync(ProviderAdapterContract, {
|
|
50
|
+
onExcessProperty: "error"
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
/** Validate once at custom-application composition time. */
|
|
54
|
+
export const makeProviderAdapter = (input: CustomProviderAdapterInput): CustomProviderAdapter => {
|
|
55
|
+
const contract = decodeContract(input.contract)
|
|
56
|
+
const id = NonEmptyName.make(input.id)
|
|
57
|
+
const profile = validatePublicationProfiles({ [id.toString()]: input.profile })[id.toString()]!
|
|
58
|
+
if (profile.id !== id.toString()) {
|
|
59
|
+
throw new Error("A custom provider adapter id must equal its recovery-profile registration id.")
|
|
60
|
+
}
|
|
61
|
+
return Object.freeze({
|
|
62
|
+
_tag: "CustomProviderAdapter" as const,
|
|
63
|
+
...input,
|
|
64
|
+
id,
|
|
65
|
+
contract,
|
|
66
|
+
profile
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Build custom subjects behind the same profile and identity checks used by
|
|
72
|
+
* built-ins. Coordinator construction performs the final request identity,
|
|
73
|
+
* audience, purpose, mutation, prerequisite, and durable-history checks.
|
|
74
|
+
*/
|
|
75
|
+
export const customProviderSubjects = (
|
|
76
|
+
bundle: PreparedBundle,
|
|
77
|
+
adapters: ReadonlyArray<CustomProviderAdapter>,
|
|
78
|
+
services: PublicationSubjectServices,
|
|
79
|
+
reservedIds: ReadonlySet<string> = new Set()
|
|
80
|
+
): ReadonlyArray<ReleaseSubject> => {
|
|
81
|
+
const result: Array<ReleaseSubject> = []
|
|
82
|
+
const ids = new Set(reservedIds)
|
|
83
|
+
for (const adapter of adapters) {
|
|
84
|
+
const subjects = adapter.subjects(bundle, services)
|
|
85
|
+
for (const subject of subjects) {
|
|
86
|
+
if (ids.has(subject.id.toString())) {
|
|
87
|
+
throw new Error(`Custom provider adapter ${adapter.id} repeats subject ${subject.id}.`)
|
|
88
|
+
}
|
|
89
|
+
assertRecoveryProfileMatches(adapter.profile.id, adapter.profile.recovery, subject.recovery)
|
|
90
|
+
if (subject.observationRequests.some((request) => request.provider.toString() !== adapter.profile.provider) ||
|
|
91
|
+
subject.mutationRequest.provider.toString() !== adapter.profile.provider) {
|
|
92
|
+
throw new Error(`Custom provider adapter ${adapter.id} emitted credential authority for a foreign provider.`)
|
|
93
|
+
}
|
|
94
|
+
ids.add(subject.id.toString())
|
|
95
|
+
result.push(subject)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return result
|
|
99
|
+
}
|
package/src/host.ts
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import * as Layer from "effect/Layer"
|
|
2
|
+
import type { ReleaseRuntimeShape } from "./api/runtime.js"
|
|
3
|
+
import { ReleaseRuntime } from "./api/runtime.js"
|
|
4
|
+
import type { ReleaseApiLayer } from "./api/types.js"
|
|
5
|
+
import type { RunCommand } from "./drivers/process.js"
|
|
6
|
+
import { Sha256Digest, sha256Digest } from "./model/digest.js"
|
|
7
|
+
import { SafeRelativePath, WorkspaceRoot } from "./model/primitives.js"
|
|
8
|
+
import type { CredentialRequest } from "./model/authority.js"
|
|
9
|
+
import {
|
|
10
|
+
CredentialAudienceMismatch,
|
|
11
|
+
CredentialProvider,
|
|
12
|
+
CredentialPurposeMismatch,
|
|
13
|
+
CredentialStrategyUnsupported,
|
|
14
|
+
CredentialSubjectMismatch,
|
|
15
|
+
CredentialUnavailable,
|
|
16
|
+
makeCredentialProvider,
|
|
17
|
+
type CredentialAuthorityError,
|
|
18
|
+
type CredentialGrant,
|
|
19
|
+
type CredentialGrantAcquirer,
|
|
20
|
+
type CredentialGrantDescriptor,
|
|
21
|
+
type CredentialProviderShape,
|
|
22
|
+
type MutationCredentialGrant
|
|
23
|
+
} from "./publication/authority.js"
|
|
24
|
+
import {
|
|
25
|
+
AuthorizedMutationHttp,
|
|
26
|
+
HttpAuthorizer,
|
|
27
|
+
type AuthorizedMutationHttpShape,
|
|
28
|
+
type HttpAuthorizationError,
|
|
29
|
+
type HttpAuthorizerShape,
|
|
30
|
+
type HttpObservationRequest,
|
|
31
|
+
type HttpResponse
|
|
32
|
+
} from "./publication/http.js"
|
|
33
|
+
import {
|
|
34
|
+
CertifiedPublisherSpawn,
|
|
35
|
+
NpmUserConfigResource,
|
|
36
|
+
type CertifiedPublisherSpawnShape,
|
|
37
|
+
type NpmUserConfigResourceShape
|
|
38
|
+
} from "./publication/publisher.js"
|
|
39
|
+
import {
|
|
40
|
+
PublicationClaimOccupied,
|
|
41
|
+
PublicationClaimRequest,
|
|
42
|
+
PublicationClaimStore,
|
|
43
|
+
PublicationClaimUnavailable,
|
|
44
|
+
type PublicationClaimError,
|
|
45
|
+
type PublicationClaimStoreShape
|
|
46
|
+
} from "./publication/claim.js"
|
|
47
|
+
import {
|
|
48
|
+
ReleaseContextError,
|
|
49
|
+
SourceMaterializationError,
|
|
50
|
+
StagingEntry,
|
|
51
|
+
StagingSnapshot,
|
|
52
|
+
VerifiedSource,
|
|
53
|
+
makeSourceObserver,
|
|
54
|
+
type SourceObserverRuntime,
|
|
55
|
+
type SourceObserverShape,
|
|
56
|
+
type VerifiedReleaseContext
|
|
57
|
+
} from "./release/context.js"
|
|
58
|
+
import {
|
|
59
|
+
PreparedReleaseStore,
|
|
60
|
+
type PreparedReleaseStoreShape
|
|
61
|
+
} from "./release/prepared-store.js"
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
CredentialAudienceMismatch,
|
|
65
|
+
CredentialPurposeMismatch,
|
|
66
|
+
CredentialStrategyUnsupported,
|
|
67
|
+
CredentialSubjectMismatch,
|
|
68
|
+
CredentialUnavailable,
|
|
69
|
+
PublicationClaimOccupied,
|
|
70
|
+
PublicationClaimRequest,
|
|
71
|
+
PublicationClaimUnavailable,
|
|
72
|
+
ReleaseContextError,
|
|
73
|
+
SafeRelativePath,
|
|
74
|
+
Sha256Digest,
|
|
75
|
+
SourceMaterializationError,
|
|
76
|
+
StagingEntry,
|
|
77
|
+
StagingSnapshot,
|
|
78
|
+
VerifiedSource,
|
|
79
|
+
WorkspaceRoot,
|
|
80
|
+
makeCredentialProvider,
|
|
81
|
+
makeSourceObserver,
|
|
82
|
+
sha256Digest
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type {
|
|
86
|
+
CredentialAuthorityError,
|
|
87
|
+
CredentialGrant,
|
|
88
|
+
CredentialGrantAcquirer,
|
|
89
|
+
CredentialGrantDescriptor,
|
|
90
|
+
CredentialProviderShape,
|
|
91
|
+
CredentialRequest,
|
|
92
|
+
HttpAuthorizationError,
|
|
93
|
+
HttpAuthorizerShape,
|
|
94
|
+
HttpObservationRequest,
|
|
95
|
+
HttpResponse,
|
|
96
|
+
AuthorizedMutationHttpShape,
|
|
97
|
+
CertifiedPublisherSpawnShape,
|
|
98
|
+
NpmUserConfigResourceShape,
|
|
99
|
+
PublicationClaimError,
|
|
100
|
+
PublicationClaimStoreShape,
|
|
101
|
+
MutationCredentialGrant,
|
|
102
|
+
ReleaseRuntimeShape,
|
|
103
|
+
RunCommand,
|
|
104
|
+
SourceObserverRuntime,
|
|
105
|
+
SourceObserverShape,
|
|
106
|
+
VerifiedReleaseContext
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Structural inputs for a library-owned host integration. */
|
|
110
|
+
export interface CustomReleaseLayerInput {
|
|
111
|
+
readonly runtime: ReleaseRuntimeShape
|
|
112
|
+
readonly preparedStore: PreparedReleaseStoreShape
|
|
113
|
+
readonly credentialProvider: CredentialProviderShape
|
|
114
|
+
readonly httpAuthorizer: HttpAuthorizerShape
|
|
115
|
+
readonly authorizedMutationHttp: AuthorizedMutationHttpShape
|
|
116
|
+
readonly npmUserConfigResource: NpmUserConfigResourceShape
|
|
117
|
+
readonly certifiedPublisherSpawn: CertifiedPublisherSpawnShape
|
|
118
|
+
/** Required before a durable-cas-required publication can acquire mutation credentials. */
|
|
119
|
+
readonly publicationClaimStore?: PublicationClaimStoreShape
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Compose the complete API service boundary without exposing Context service
|
|
124
|
+
* tags. Credentials remain opaque grants and HTTP authorization remains a
|
|
125
|
+
* host-owned elimination boundary.
|
|
126
|
+
*/
|
|
127
|
+
export const makeCustomReleaseLayer = (
|
|
128
|
+
input: CustomReleaseLayerInput
|
|
129
|
+
): ReleaseApiLayer => Layer.mergeAll(
|
|
130
|
+
Layer.succeed(ReleaseRuntime, input.runtime),
|
|
131
|
+
Layer.succeed(PreparedReleaseStore, input.preparedStore),
|
|
132
|
+
Layer.succeed(CredentialProvider, input.credentialProvider),
|
|
133
|
+
Layer.succeed(HttpAuthorizer, input.httpAuthorizer),
|
|
134
|
+
Layer.succeed(AuthorizedMutationHttp, input.authorizedMutationHttp),
|
|
135
|
+
Layer.succeed(NpmUserConfigResource, input.npmUserConfigResource),
|
|
136
|
+
Layer.succeed(CertifiedPublisherSpawn, input.certifiedPublisherSpawn),
|
|
137
|
+
...(input.publicationClaimStore === undefined
|
|
138
|
+
? []
|
|
139
|
+
: [Layer.succeed(PublicationClaimStore, input.publicationClaimStore)])
|
|
140
|
+
)
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
const SchemaErrorTypeId: unique symbol
|
|
3
|
+
}
|
|
4
|
+
// The root is the intentionally small public lifecycle surface.
|
|
5
|
+
export {
|
|
6
|
+
CorrectionReport,
|
|
7
|
+
correct,
|
|
8
|
+
inspect,
|
|
9
|
+
makeReleaseApi,
|
|
10
|
+
observe,
|
|
11
|
+
prepare,
|
|
12
|
+
publish,
|
|
13
|
+
release
|
|
14
|
+
} from "./api/api.js"
|
|
15
|
+
export type {
|
|
16
|
+
CorrectInput,
|
|
17
|
+
InspectInput,
|
|
18
|
+
InspectOutput,
|
|
19
|
+
ObserveInput,
|
|
20
|
+
PrepareInput,
|
|
21
|
+
PublishInput,
|
|
22
|
+
ReleaseApi,
|
|
23
|
+
ReleaseApiLayer,
|
|
24
|
+
ReleaseApiOptions,
|
|
25
|
+
ReleaseInput,
|
|
26
|
+
ReleaseResult
|
|
27
|
+
} from "./api/types.js"
|
|
28
|
+
export {
|
|
29
|
+
AuthoredCatalogForwardCorrection,
|
|
30
|
+
AuthoredGithubReleaseAmendment,
|
|
31
|
+
AuthoredNpmDeprecation,
|
|
32
|
+
decodeAuthoredCorrection
|
|
33
|
+
} from "./correction/intent.js"
|
|
34
|
+
export type { AuthoredCorrection } from "./correction/intent.js"
|
|
35
|
+
export {
|
|
36
|
+
PreparationModeUnsupported, ReleaseAbortedError, ReleaseIncompleteError,
|
|
37
|
+
ReleaseInputError, ReleasePreparationError
|
|
38
|
+
} from "./api/errors.js"
|
|
39
|
+
export {
|
|
40
|
+
CredentialStrategyUnsupported,
|
|
41
|
+
CredentialUnavailable
|
|
42
|
+
} from "./publication/authority.js"
|
|
43
|
+
export {
|
|
44
|
+
CredentialFailureCause,
|
|
45
|
+
CredentialStrategyUnsupportedCause,
|
|
46
|
+
CredentialUnavailableCause,
|
|
47
|
+
ObservationReport,
|
|
48
|
+
ReleaseReport
|
|
49
|
+
} from "./publication/report.js"
|
|
50
|
+
export {
|
|
51
|
+
CompletePreparedReleaseRef, GitHubActionsCompletePreparedReleaseRef,
|
|
52
|
+
LocalCompletePreparedReleaseRef, PreparedReleaseRefCodecError,
|
|
53
|
+
PreparedReleaseRefMalformedError, PreparedReleaseRefUnknownSchemeError,
|
|
54
|
+
decodeCompletePreparedReleaseRef, encodeCompletePreparedReleaseRef,
|
|
55
|
+
makeGitHubActionsCompletePreparedReleaseRef, makeLocalCompletePreparedReleaseRef
|
|
56
|
+
} from "./release/prepared-ref.js"
|
|
57
|
+
export type { PreparedReleaseSha256 } from "./release/prepared-ref.js"
|
|
58
|
+
export { ReleaseRuntime } from "./api/runtime.js"
|
|
59
|
+
export { unsupportedExecutionHost } from "./platform/host-support.js"
|
|
60
|
+
export { resolveConfig } from "./resolve/resolve.js"
|
|
61
|
+
export type { AuthoredConfig, AuthoredProject } from "./resolve/authored.js"
|
|
62
|
+
export type { ObservedFacts } from "./resolve/facts.js"
|
|
63
|
+
export { encodeResolvedConfig } from "./resolve/encode.js"
|
|
64
|
+
export const defineRelease = <const Config>(config: Config): Config => config
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema"
|
|
2
|
+
import { encodeCanonicalJson } from "./canonical.js"
|
|
3
|
+
import { sha256Digest } from "./digest.js"
|
|
4
|
+
import { OperationId, OutputId, SafeRelativePath } from "./primitives.js"
|
|
5
|
+
|
|
6
|
+
export const ArtifactCollectionId = Schema.NonEmptyString.check(Schema.makeFilter((value: string) =>
|
|
7
|
+
/^[A-Za-z0-9._-]+$/u.test(value)
|
|
8
|
+
? undefined
|
|
9
|
+
: "Artifact collection id must be a portable ASCII identifier."
|
|
10
|
+
)).pipe(Schema.brand("ArtifactCollectionId"))
|
|
11
|
+
export type ArtifactCollectionId = typeof ArtifactCollectionId.Type
|
|
12
|
+
|
|
13
|
+
export const CollectionArtifactKind = Schema.Literals([
|
|
14
|
+
"file",
|
|
15
|
+
"executable",
|
|
16
|
+
"archive",
|
|
17
|
+
"digest"
|
|
18
|
+
])
|
|
19
|
+
export type CollectionArtifactKind = typeof CollectionArtifactKind.Type
|
|
20
|
+
|
|
21
|
+
export const ArtifactPathSuffix = Schema.NonEmptyString.check(Schema.makeFilter((value: string) =>
|
|
22
|
+
/^\.[A-Za-z0-9._-]+$/u.test(value)
|
|
23
|
+
? undefined
|
|
24
|
+
: "Artifact collection pathSuffix must be a canonical dot suffix without path separators."
|
|
25
|
+
)).pipe(Schema.brand("ArtifactPathSuffix"))
|
|
26
|
+
export type ArtifactPathSuffix = typeof ArtifactPathSuffix.Type
|
|
27
|
+
|
|
28
|
+
export const ArtifactCollectionRoot = SafeRelativePath.check(Schema.makeFilter((value: string) =>
|
|
29
|
+
value !== "." && value.split("/").every((part) => /^[A-Za-z0-9._-]+$/u.test(part) && part !== "." && part !== "..")
|
|
30
|
+
? undefined
|
|
31
|
+
: "Artifact collection root must be a canonical NFC POSIX subdirectory."
|
|
32
|
+
)).pipe(Schema.brand("ArtifactCollectionRoot"))
|
|
33
|
+
export type ArtifactCollectionRoot = typeof ArtifactCollectionRoot.Type
|
|
34
|
+
|
|
35
|
+
const nonNegativeInteger = Schema.Number.check(Schema.makeFilter((value: number) =>
|
|
36
|
+
Number.isSafeInteger(value) && value >= 0
|
|
37
|
+
? undefined
|
|
38
|
+
: "Collection cardinality bounds must be nonnegative safe integers."
|
|
39
|
+
))
|
|
40
|
+
|
|
41
|
+
export class OneArtifactCardinality
|
|
42
|
+
extends Schema.Class<OneArtifactCardinality>("OneArtifactCardinality")({
|
|
43
|
+
kind: Schema.Literal("one")
|
|
44
|
+
}) {}
|
|
45
|
+
|
|
46
|
+
export class OneOrMoreArtifactCardinality
|
|
47
|
+
extends Schema.Class<OneOrMoreArtifactCardinality>("OneOrMoreArtifactCardinality")({
|
|
48
|
+
kind: Schema.Literal("one-or-more")
|
|
49
|
+
}) {}
|
|
50
|
+
|
|
51
|
+
export class BoundedArtifactCardinality
|
|
52
|
+
extends Schema.Class<BoundedArtifactCardinality>("BoundedArtifactCardinality")({
|
|
53
|
+
kind: Schema.Literal("bounded"),
|
|
54
|
+
minimum: nonNegativeInteger,
|
|
55
|
+
maximum: nonNegativeInteger
|
|
56
|
+
}) {}
|
|
57
|
+
|
|
58
|
+
const ArtifactCardinalityVariants = Schema.Union([
|
|
59
|
+
OneArtifactCardinality,
|
|
60
|
+
OneOrMoreArtifactCardinality,
|
|
61
|
+
BoundedArtifactCardinality
|
|
62
|
+
])
|
|
63
|
+
|
|
64
|
+
export const ArtifactCardinality = ArtifactCardinalityVariants.pipe(Schema.check(
|
|
65
|
+
Schema.makeFilter((value) => value.kind !== "bounded" || value.minimum <= value.maximum
|
|
66
|
+
? undefined
|
|
67
|
+
: "Bounded collection cardinality minimum must not exceed maximum.")
|
|
68
|
+
))
|
|
69
|
+
export type ArtifactCardinality = typeof ArtifactCardinality.Type
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* One command-owned dynamic output set. A collection intentionally permits one
|
|
73
|
+
* artifact kind and one filename suffix: heterogeneous output sets must be
|
|
74
|
+
* split into independently selectable contracts.
|
|
75
|
+
*/
|
|
76
|
+
export class ArtifactCollectionContract
|
|
77
|
+
extends Schema.Class<ArtifactCollectionContract>("ArtifactCollectionContract")({
|
|
78
|
+
id: ArtifactCollectionId,
|
|
79
|
+
producer: OperationId,
|
|
80
|
+
root: ArtifactCollectionRoot,
|
|
81
|
+
artifactKind: CollectionArtifactKind,
|
|
82
|
+
pathSuffix: ArtifactPathSuffix,
|
|
83
|
+
mediaType: Schema.NonEmptyString,
|
|
84
|
+
cardinality: ArtifactCardinality
|
|
85
|
+
}) {}
|
|
86
|
+
|
|
87
|
+
/** A downstream requirement over a stable collection identity. */
|
|
88
|
+
export class ArtifactCollectionSelector
|
|
89
|
+
extends Schema.Class<ArtifactCollectionSelector>("ArtifactCollectionSelector")({
|
|
90
|
+
collection: ArtifactCollectionId,
|
|
91
|
+
artifactKind: CollectionArtifactKind,
|
|
92
|
+
pathSuffix: ArtifactPathSuffix,
|
|
93
|
+
mediaType: Schema.NonEmptyString,
|
|
94
|
+
cardinality: ArtifactCardinality
|
|
95
|
+
}) {}
|
|
96
|
+
|
|
97
|
+
/** Exact runtime member identity persisted beside the prepared artifacts. */
|
|
98
|
+
export class ArtifactCollectionMember
|
|
99
|
+
extends Schema.Class<ArtifactCollectionMember>("ArtifactCollectionMember")({
|
|
100
|
+
key: SafeRelativePath,
|
|
101
|
+
artifactId: OutputId
|
|
102
|
+
}) {}
|
|
103
|
+
|
|
104
|
+
export interface CardinalityRange {
|
|
105
|
+
readonly minimum: number
|
|
106
|
+
readonly maximum?: number
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const cardinalityRange = (value: ArtifactCardinality): CardinalityRange => {
|
|
110
|
+
switch (value.kind) {
|
|
111
|
+
case "one": return { minimum: 1, maximum: 1 }
|
|
112
|
+
case "one-or-more": return { minimum: 1 }
|
|
113
|
+
case "bounded": return { minimum: value.minimum, maximum: value.maximum }
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const cardinalityIssue = (value: ArtifactCardinality): string | undefined => {
|
|
118
|
+
const range = cardinalityRange(value)
|
|
119
|
+
return !Number.isSafeInteger(range.minimum) || range.minimum < 0 ||
|
|
120
|
+
(range.maximum !== undefined && (!Number.isSafeInteger(range.maximum) || range.maximum < range.minimum))
|
|
121
|
+
? "Collection cardinality must define a valid nonnegative integer range."
|
|
122
|
+
: undefined
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Reject kind/media/suffix combinations whose observable claims conflict. */
|
|
126
|
+
export const collectionContractIssue = (
|
|
127
|
+
value: Pick<ArtifactCollectionContract, "artifactKind" | "pathSuffix" | "mediaType">
|
|
128
|
+
): string | undefined => {
|
|
129
|
+
const suffix = value.pathSuffix.toString()
|
|
130
|
+
switch (value.artifactKind) {
|
|
131
|
+
case "archive":
|
|
132
|
+
if (value.mediaType === "application/zip" && suffix === ".zip") return undefined
|
|
133
|
+
if (value.mediaType === "application/gzip" && [".gz", ".tgz", ".tar.gz"].includes(suffix)) return undefined
|
|
134
|
+
return "Archive collections support application/zip with .zip or application/gzip with .gz, .tgz, or .tar.gz."
|
|
135
|
+
case "digest":
|
|
136
|
+
return value.mediaType === "text/plain" && [".sha256", ".sha512"].includes(suffix)
|
|
137
|
+
? undefined
|
|
138
|
+
: "Digest collections require text/plain with .sha256 or .sha512."
|
|
139
|
+
case "executable":
|
|
140
|
+
return value.mediaType === "application/octet-stream"
|
|
141
|
+
? undefined
|
|
142
|
+
: "Executable collections require application/octet-stream; executable mode is observed at capture."
|
|
143
|
+
case "file":
|
|
144
|
+
return value.mediaType === "application/zip" || value.mediaType === "application/gzip"
|
|
145
|
+
? "Archive media types require the archive artifact kind."
|
|
146
|
+
: undefined
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Byte-level checks for the formats whose kind is portable and observable. */
|
|
151
|
+
export const collectionMemberBytesIssue = (
|
|
152
|
+
contract: ArtifactCollectionContract,
|
|
153
|
+
bytes: Uint8Array
|
|
154
|
+
): string | undefined => {
|
|
155
|
+
if (contract.artifactKind === "archive") {
|
|
156
|
+
if (contract.mediaType === "application/zip") {
|
|
157
|
+
return bytes.length >= 4 && bytes[0] === 0x50 && bytes[1] === 0x4b &&
|
|
158
|
+
((bytes[2] === 0x03 && bytes[3] === 0x04) ||
|
|
159
|
+
(bytes[2] === 0x05 && bytes[3] === 0x06) ||
|
|
160
|
+
(bytes[2] === 0x07 && bytes[3] === 0x08))
|
|
161
|
+
? undefined
|
|
162
|
+
: "declared ZIP member does not have a ZIP file signature"
|
|
163
|
+
}
|
|
164
|
+
if (contract.mediaType === "application/gzip") {
|
|
165
|
+
return bytes.length >= 3 && bytes[0] === 0x1f && bytes[1] === 0x8b && bytes[2] === 0x08
|
|
166
|
+
? undefined
|
|
167
|
+
: "declared gzip member does not have a gzip file signature"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (contract.artifactKind === "digest") {
|
|
171
|
+
let text: string
|
|
172
|
+
try { text = new TextDecoder("utf-8", { fatal: true }).decode(bytes) } catch {
|
|
173
|
+
return "declared digest member is not UTF-8 text"
|
|
174
|
+
}
|
|
175
|
+
const digits = contract.pathSuffix === ".sha256" ? 64 : 128
|
|
176
|
+
const rows = text.endsWith("\n") ? text.slice(0, -1).split("\n") : text.split("\n")
|
|
177
|
+
return rows.length > 0 && rows.every((row) => new RegExp(`^[a-f0-9]{${digits}} [^\\s/](?:.*[^\\s/])?$`, "u").test(row))
|
|
178
|
+
? undefined
|
|
179
|
+
: `declared digest member does not contain canonical ${digits}-hex checksum rows`
|
|
180
|
+
}
|
|
181
|
+
return undefined
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export const cardinalityAccepts = (value: ArtifactCardinality, count: number): boolean => {
|
|
185
|
+
const range = cardinalityRange(value)
|
|
186
|
+
return Number.isSafeInteger(count) && count >= range.minimum &&
|
|
187
|
+
(range.maximum === undefined || count <= range.maximum)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export const cardinalitiesOverlap = (
|
|
191
|
+
left: ArtifactCardinality,
|
|
192
|
+
right: ArtifactCardinality
|
|
193
|
+
): boolean => {
|
|
194
|
+
const a = cardinalityRange(left)
|
|
195
|
+
const b = cardinalityRange(right)
|
|
196
|
+
const maximum = a.maximum === undefined
|
|
197
|
+
? b.maximum
|
|
198
|
+
: b.maximum === undefined
|
|
199
|
+
? a.maximum
|
|
200
|
+
: Math.min(a.maximum, b.maximum)
|
|
201
|
+
return maximum === undefined || Math.max(a.minimum, b.minimum) <= maximum
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** Paths discovered from directory entries must already be portable canon. */
|
|
205
|
+
export const normalizeCollectionMemberKey = (value: string): SafeRelativePath => {
|
|
206
|
+
if (value.split("/").some((part) => !/^[A-Za-z0-9._-]+$/u.test(part) || part === "." || part === "..")) {
|
|
207
|
+
throw new Error(`Collection member path ${JSON.stringify(value)} is not portable ASCII POSIX form.`)
|
|
208
|
+
}
|
|
209
|
+
return SafeRelativePath.make(value)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Stable output identity is a digest of the declared producer/contract and the
|
|
214
|
+
* normalized member key. No guessed runtime filename becomes graph authority.
|
|
215
|
+
*/
|
|
216
|
+
export const collectionMemberId = (
|
|
217
|
+
contract: ArtifactCollectionContract,
|
|
218
|
+
key: SafeRelativePath
|
|
219
|
+
): OutputId => OutputId.make(`collection-sha256-${sha256Digest(new TextEncoder().encode(
|
|
220
|
+
encodeCanonicalJson({
|
|
221
|
+
producer: contract.producer.toString(),
|
|
222
|
+
collection: contract.id.toString(),
|
|
223
|
+
root: contract.root.toString(),
|
|
224
|
+
artifactKind: contract.artifactKind,
|
|
225
|
+
pathSuffix: contract.pathSuffix.toString(),
|
|
226
|
+
mediaType: contract.mediaType,
|
|
227
|
+
cardinality: contract.cardinality.kind === "bounded"
|
|
228
|
+
? { kind: contract.cardinality.kind, minimum: contract.cardinality.minimum, maximum: contract.cardinality.maximum }
|
|
229
|
+
: { kind: contract.cardinality.kind },
|
|
230
|
+
key: key.toString()
|
|
231
|
+
})
|
|
232
|
+
)).hex}`)
|
|
233
|
+
|
|
234
|
+
export const collectionMemberPath = (
|
|
235
|
+
contract: ArtifactCollectionContract,
|
|
236
|
+
key: SafeRelativePath
|
|
237
|
+
): SafeRelativePath => SafeRelativePath.make(`${contract.root}/${key}`)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema"
|
|
2
|
+
|
|
3
|
+
const identifier = <const Name extends string>(name: Name) =>
|
|
4
|
+
Schema.NonEmptyString.pipe(Schema.brand(name))
|
|
5
|
+
|
|
6
|
+
/** Stable identity of one remotely observable publication/correction subject. */
|
|
7
|
+
export const SubjectId = identifier("SubjectId")
|
|
8
|
+
export type SubjectId = typeof SubjectId.Type
|
|
9
|
+
|
|
10
|
+
export const ProviderId = identifier("ProviderId")
|
|
11
|
+
export type ProviderId = typeof ProviderId.Type
|
|
12
|
+
|
|
13
|
+
/** Canonical provider audience, including any authority-relevant base path. */
|
|
14
|
+
export const CanonicalAudience = identifier("CanonicalAudience")
|
|
15
|
+
export type CanonicalAudience = typeof CanonicalAudience.Type
|
|
16
|
+
|
|
17
|
+
/** A host-owned secret reference. It is a name/handle, never secret material. */
|
|
18
|
+
export const CredentialRef = identifier("CredentialRef")
|
|
19
|
+
export type CredentialRef = typeof CredentialRef.Type
|
|
20
|
+
|
|
21
|
+
export const EnvironmentName = Schema.String.check(
|
|
22
|
+
Schema.makeFilter((value: string) => /^[A-Za-z_][A-Za-z0-9_]*$/u.test(value)
|
|
23
|
+
? undefined
|
|
24
|
+
: "EnvironmentName must be a portable environment variable name.")
|
|
25
|
+
).pipe(Schema.brand("EnvironmentName"))
|
|
26
|
+
export type EnvironmentName = typeof EnvironmentName.Type
|
|
27
|
+
|
|
28
|
+
export const CredentialPurpose = Schema.Literals(["observe", "publish", "correct"])
|
|
29
|
+
export type CredentialPurpose = typeof CredentialPurpose.Type
|
|
30
|
+
|
|
31
|
+
/** Exact verified source revision projected into npm's GitHub provenance statement. */
|
|
32
|
+
export const TrustedPublishingSourceCommit = Schema.String.check(
|
|
33
|
+
Schema.makeFilter((value: string) => /^[a-f0-9]{40}(?:[a-f0-9]{24})?$/u.test(value)
|
|
34
|
+
? undefined
|
|
35
|
+
: "TrustedPublishingSourceCommit must be a lowercase full Git SHA (40 or 64 hex characters).")
|
|
36
|
+
).pipe(Schema.brand("TrustedPublishingSourceCommit"))
|
|
37
|
+
export type TrustedPublishingSourceCommit = typeof TrustedPublishingSourceCommit.Type
|
|
38
|
+
|
|
39
|
+
export class AnonymousAuthStrategy
|
|
40
|
+
extends Schema.Class<AnonymousAuthStrategy>("AnonymousAuthStrategy")({
|
|
41
|
+
kind: Schema.Literal("anonymous")
|
|
42
|
+
}) {}
|
|
43
|
+
|
|
44
|
+
export class TokenAuthStrategy
|
|
45
|
+
extends Schema.Class<TokenAuthStrategy>("TokenAuthStrategy")({
|
|
46
|
+
kind: Schema.Literal("token"),
|
|
47
|
+
credential: CredentialRef
|
|
48
|
+
}) {}
|
|
49
|
+
|
|
50
|
+
export class TrustedPublishingAuthStrategy
|
|
51
|
+
extends Schema.Class<TrustedPublishingAuthStrategy>("TrustedPublishingAuthStrategy")({
|
|
52
|
+
kind: Schema.Literal("trusted-publishing"),
|
|
53
|
+
identityProvider: Schema.Literal("github-actions"),
|
|
54
|
+
runnerClass: Schema.Literal("github-hosted"),
|
|
55
|
+
repository: Schema.NonEmptyString,
|
|
56
|
+
workflow: Schema.NonEmptyString,
|
|
57
|
+
workflowRef: Schema.NonEmptyString,
|
|
58
|
+
sourceCommit: TrustedPublishingSourceCommit,
|
|
59
|
+
provenanceEnvironmentContract: Schema.Literal("github-actions-npm-provenance-v1"),
|
|
60
|
+
allowedAction: Schema.Literal("npm-publish-direct"),
|
|
61
|
+
publisherSink: Schema.Literal("certified-npm-cli")
|
|
62
|
+
}) {}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* A supported external workflow owner. The stock coordinator persists and
|
|
66
|
+
* reports this identity but deliberately cannot mint or consume its token.
|
|
67
|
+
*/
|
|
68
|
+
export class ExternalTrustedPublishingAuthStrategy
|
|
69
|
+
extends Schema.Class<ExternalTrustedPublishingAuthStrategy>("ExternalTrustedPublishingAuthStrategy")({
|
|
70
|
+
kind: Schema.Literal("trusted-publishing"),
|
|
71
|
+
identityProvider: Schema.Literal("github-actions"),
|
|
72
|
+
runnerClass: Schema.Literal("github-hosted"),
|
|
73
|
+
repository: Schema.NonEmptyString,
|
|
74
|
+
workflow: Schema.NonEmptyString,
|
|
75
|
+
workflowRef: Schema.NonEmptyString,
|
|
76
|
+
sourceCommit: TrustedPublishingSourceCommit,
|
|
77
|
+
provenanceEnvironmentContract: Schema.Literal("external-pypa-action-v1"),
|
|
78
|
+
allowedAction: Schema.Literal("external-pypa-action"),
|
|
79
|
+
publisherSink: Schema.Literal("external-host-owned"),
|
|
80
|
+
environment: Schema.NonEmptyString,
|
|
81
|
+
projects: Schema.NonEmptyArray(Schema.NonEmptyString)
|
|
82
|
+
}) {}
|
|
83
|
+
|
|
84
|
+
export const ResolvedTrustedPublishingAuthStrategy = Schema.Union([
|
|
85
|
+
TrustedPublishingAuthStrategy,
|
|
86
|
+
ExternalTrustedPublishingAuthStrategy
|
|
87
|
+
])
|
|
88
|
+
export type ResolvedTrustedPublishingAuthStrategy = typeof ResolvedTrustedPublishingAuthStrategy.Type
|
|
89
|
+
|
|
90
|
+
export const ResolvedAuthStrategy = Schema.Union([
|
|
91
|
+
AnonymousAuthStrategy,
|
|
92
|
+
TokenAuthStrategy,
|
|
93
|
+
ResolvedTrustedPublishingAuthStrategy
|
|
94
|
+
])
|
|
95
|
+
export type ResolvedAuthStrategy = typeof ResolvedAuthStrategy.Type
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Exact authority requested for a verified prepared subject. This value is
|
|
99
|
+
* safe to report and persist: it contains only host references and intent.
|
|
100
|
+
*/
|
|
101
|
+
export class CredentialRequest
|
|
102
|
+
extends Schema.Class<CredentialRequest>("CredentialRequest")({
|
|
103
|
+
subject: SubjectId,
|
|
104
|
+
provider: ProviderId,
|
|
105
|
+
audience: CanonicalAudience,
|
|
106
|
+
purpose: CredentialPurpose,
|
|
107
|
+
strategy: ResolvedAuthStrategy
|
|
108
|
+
}) {}
|
|
109
|
+
|
|
110
|
+
export type ObservationCredentialRequest = CredentialRequest & {
|
|
111
|
+
readonly purpose: "observe"
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export type MutationCredentialRequest = CredentialRequest & {
|
|
115
|
+
readonly purpose: "publish" | "correct"
|
|
116
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one advertised Bun artifact-target vocabulary. Config decoding, graph
|
|
3
|
+
* compilation, capability documentation, and cross-compile certification all
|
|
4
|
+
* project from these values.
|
|
5
|
+
*/
|
|
6
|
+
export const bunArtifactTargets = Object.freeze([
|
|
7
|
+
{ id: "linux-x64", bunTarget: "bun-linux-x64", format: "elf", architecture: "x86_64" },
|
|
8
|
+
{ id: "linux-arm64", bunTarget: "bun-linux-arm64", format: "elf", architecture: "aarch64" },
|
|
9
|
+
{ id: "darwin-x64", bunTarget: "bun-darwin-x64", format: "mach-o", architecture: "x86_64" },
|
|
10
|
+
{ id: "darwin-arm64", bunTarget: "bun-darwin-arm64", format: "mach-o", architecture: "aarch64" }
|
|
11
|
+
] as const)
|
|
12
|
+
|
|
13
|
+
// Windows targets are deliberately not advertised or shipped by this
|
|
14
|
+
// candidate. Header-valid cross-compilation alone cannot certify execution.
|
|
15
|
+
// Reopen one only after its public CLI binary executes on that Windows host in
|
|
16
|
+
// the same clean-candidate gate.
|
|
17
|
+
export type BunArtifactTarget = typeof bunArtifactTargets[number]
|
|
18
|
+
export type BunArtifactTargetId = BunArtifactTarget["id"]
|
|
19
|
+
export type BunBinaryFormat = BunArtifactTarget["format"]
|
|
20
|
+
export type BunBinaryArchitecture = BunArtifactTarget["architecture"]
|
|
21
|
+
|
|
22
|
+
const idsOf = <const Entries extends ReadonlyArray<{ readonly id: string }>>(
|
|
23
|
+
entries: Entries
|
|
24
|
+
): { readonly [Index in keyof Entries]: Entries[Index] extends { readonly id: infer Id } ? Id : never } =>
|
|
25
|
+
Object.freeze(entries.map(({ id }) => id)) as never
|
|
26
|
+
|
|
27
|
+
export const bunArtifactTargetIds = idsOf(bunArtifactTargets)
|
|
28
|
+
|
|
29
|
+
const byId = new Map<BunArtifactTargetId, BunArtifactTarget>(
|
|
30
|
+
bunArtifactTargets.map((target) => [target.id, target])
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
/** Total after strict config decoding against `bunArtifactTargetIds`. */
|
|
34
|
+
export const bunArtifactTarget = (id: BunArtifactTargetId): BunArtifactTarget => byId.get(id)!
|