@mannyc1/ts-release 0.0.7 → 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.
Files changed (635) hide show
  1. package/ARCHITECTURE.md +124 -92
  2. package/CHANGELOG.md +115 -0
  3. package/LICENSE +21 -0
  4. package/README.md +278 -324
  5. package/SPEC.md +206 -310
  6. package/apps/release-ts/README.md +32 -0
  7. package/apps/release-ts/src/cli/command.ts +164 -0
  8. package/apps/release-ts/src/cli/commands.ts +351 -0
  9. package/apps/release-ts/src/cli/main.ts +43 -0
  10. package/apps/release-ts/src/cli/node-main.ts +49 -0
  11. package/apps/ts-release-agents/LICENSE +21 -0
  12. package/apps/ts-release-agents/README.md +21 -0
  13. package/apps/ts-release-agents/evals/cases.json +11 -0
  14. package/apps/ts-release-agents/manifests/claude.json +5 -0
  15. package/apps/ts-release-agents/manifests/codex.json +5 -0
  16. package/apps/ts-release-agents/package.json +11 -0
  17. package/apps/ts-release-agents/skills/release/SKILL.md +48 -0
  18. package/apps/ts-release-agents/skills/release/references/configuration.md +18 -0
  19. package/apps/ts-release-agents/skills/release/references/recovery.md +10 -0
  20. package/apps/ts-release-agents/skills/release/references/staged-workflow.md +12 -0
  21. package/apps/ts-release-agents/skills/release/references/target-selection.md +13 -0
  22. package/apps/ts-release-agents/skills/release/references/verification.md +14 -0
  23. package/apps/ts-release-agents/src/build.ts +105 -0
  24. package/apps/ts-release-agents/src/check.ts +117 -0
  25. package/apps/ts-release-agents/src/install.ts +121 -0
  26. package/apps/ts-release-agents/test/contract.test.ts +56 -0
  27. package/apps/ts-release-agents/tsconfig.json +5 -0
  28. package/dist/api/api.d.ts +15 -0
  29. package/dist/api/api.d.ts.map +1 -0
  30. package/dist/api/api.js +244 -0
  31. package/dist/api/api.js.map +1 -0
  32. package/dist/api/errors.d.ts +39 -0
  33. package/dist/api/errors.d.ts.map +1 -0
  34. package/dist/api/errors.js +32 -0
  35. package/dist/api/errors.js.map +1 -0
  36. package/dist/api/input.d.ts +10 -0
  37. package/dist/api/input.d.ts.map +1 -0
  38. package/dist/api/input.js +73 -0
  39. package/dist/api/input.js.map +1 -0
  40. package/dist/api/runtime.d.ts +18 -0
  41. package/dist/api/runtime.d.ts.map +1 -0
  42. package/dist/api/runtime.js +7 -0
  43. package/dist/api/runtime.js.map +1 -0
  44. package/dist/api/types.d.ts +76 -0
  45. package/dist/api/types.d.ts.map +1 -0
  46. package/dist/api/types.js +17 -0
  47. package/dist/api/types.js.map +1 -0
  48. package/dist/bin/ts-release.js +39239 -0
  49. package/dist/capabilities/bun-targets.d.ts +3 -0
  50. package/dist/capabilities/bun-targets.d.ts.map +1 -0
  51. package/dist/capabilities/bun-targets.js +3 -0
  52. package/dist/capabilities/bun-targets.js.map +1 -0
  53. package/dist/capabilities/field-ownership.d.ts +17 -0
  54. package/dist/capabilities/field-ownership.d.ts.map +1 -0
  55. package/dist/capabilities/field-ownership.js +40 -0
  56. package/dist/capabilities/field-ownership.js.map +1 -0
  57. package/dist/capabilities/module.d.ts +91 -0
  58. package/dist/capabilities/module.d.ts.map +1 -0
  59. package/dist/capabilities/module.js +2 -0
  60. package/dist/capabilities/module.js.map +1 -0
  61. package/dist/capabilities/registry.d.ts +829 -0
  62. package/dist/capabilities/registry.d.ts.map +1 -0
  63. package/dist/capabilities/registry.js +291 -0
  64. package/dist/capabilities/registry.js.map +1 -0
  65. package/dist/config/config.d.ts +6 -0
  66. package/dist/config/config.d.ts.map +1 -0
  67. package/dist/config/config.js +42 -0
  68. package/dist/config/config.js.map +1 -0
  69. package/dist/correction/coordinator.d.ts +248 -0
  70. package/dist/correction/coordinator.d.ts.map +1 -0
  71. package/dist/correction/coordinator.js +274 -0
  72. package/dist/correction/coordinator.js.map +1 -0
  73. package/dist/correction/index.d.ts +3 -0
  74. package/dist/correction/index.d.ts.map +1 -0
  75. package/dist/correction/index.js +3 -0
  76. package/dist/correction/index.js.map +1 -0
  77. package/dist/correction/intent.d.ts +111 -0
  78. package/dist/correction/intent.d.ts.map +1 -0
  79. package/dist/correction/intent.js +146 -0
  80. package/dist/correction/intent.js.map +1 -0
  81. package/dist/drivers/archive.d.ts +8 -0
  82. package/dist/drivers/archive.d.ts.map +1 -0
  83. package/dist/drivers/archive.js +101 -0
  84. package/dist/drivers/archive.js.map +1 -0
  85. package/dist/drivers/contain.d.ts +6 -0
  86. package/dist/drivers/contain.d.ts.map +1 -0
  87. package/dist/drivers/contain.js +17 -0
  88. package/dist/drivers/contain.js.map +1 -0
  89. package/dist/drivers/environment.d.ts +4 -0
  90. package/dist/drivers/environment.d.ts.map +1 -0
  91. package/dist/drivers/environment.js +18 -0
  92. package/dist/drivers/environment.js.map +1 -0
  93. package/dist/drivers/errors.d.ts +9 -0
  94. package/dist/drivers/errors.d.ts.map +1 -0
  95. package/dist/drivers/errors.js +6 -0
  96. package/dist/drivers/errors.js.map +1 -0
  97. package/dist/drivers/glob.d.ts +2 -0
  98. package/dist/drivers/glob.d.ts.map +1 -0
  99. package/dist/drivers/glob.js +162 -0
  100. package/dist/drivers/glob.js.map +1 -0
  101. package/dist/drivers/process.d.ts +48 -0
  102. package/dist/drivers/process.d.ts.map +1 -0
  103. package/dist/drivers/process.js +257 -0
  104. package/dist/drivers/process.js.map +1 -0
  105. package/dist/drivers/redact.d.ts +4 -0
  106. package/dist/drivers/redact.d.ts.map +1 -0
  107. package/dist/drivers/redact.js +24 -0
  108. package/dist/drivers/redact.js.map +1 -0
  109. package/dist/drivers/seccomp-helper-source.d.ts +7 -0
  110. package/dist/drivers/seccomp-helper-source.d.ts.map +1 -0
  111. package/dist/drivers/seccomp-helper-source.js +121 -0
  112. package/dist/drivers/seccomp-helper-source.js.map +1 -0
  113. package/dist/drivers/utils.d.ts +4 -0
  114. package/dist/drivers/utils.d.ts.map +1 -0
  115. package/dist/drivers/utils.js +5 -0
  116. package/dist/drivers/utils.js.map +1 -0
  117. package/dist/drivers/workspace.d.ts +6 -0
  118. package/dist/drivers/workspace.d.ts.map +1 -0
  119. package/dist/drivers/workspace.js +49 -0
  120. package/dist/drivers/workspace.js.map +1 -0
  121. package/dist/extensions/provider-adapter.d.ts +48 -0
  122. package/dist/extensions/provider-adapter.d.ts.map +1 -0
  123. package/dist/extensions/provider-adapter.js +64 -0
  124. package/dist/extensions/provider-adapter.js.map +1 -0
  125. package/dist/host.d.ts +33 -0
  126. package/dist/host.d.ts.map +1 -0
  127. package/dist/host.js +20 -0
  128. package/dist/host.js.map +1 -0
  129. package/dist/index.d.ts +19 -1
  130. package/dist/index.d.ts.map +1 -1
  131. package/dist/index.js +12 -1
  132. package/dist/index.js.map +1 -1
  133. package/dist/model/artifact-collection.d.ts +84 -0
  134. package/dist/model/artifact-collection.d.ts.map +1 -0
  135. package/dist/model/artifact-collection.js +185 -0
  136. package/dist/model/artifact-collection.js.map +1 -0
  137. package/dist/model/authority.d.ts +89 -0
  138. package/dist/model/authority.d.ts.map +1 -0
  139. package/dist/model/authority.js +80 -0
  140. package/dist/model/authority.js.map +1 -0
  141. package/dist/model/bun-targets.d.ts +34 -0
  142. package/dist/model/bun-targets.d.ts.map +1 -0
  143. package/dist/model/bun-targets.js +17 -0
  144. package/dist/model/bun-targets.js.map +1 -0
  145. package/dist/model/canonical.d.ts +8 -0
  146. package/dist/model/canonical.d.ts.map +1 -0
  147. package/dist/model/canonical.js +205 -0
  148. package/dist/model/canonical.js.map +1 -0
  149. package/dist/model/catalog.d.ts +76 -0
  150. package/dist/model/catalog.d.ts.map +1 -0
  151. package/dist/model/catalog.js +174 -0
  152. package/dist/model/catalog.js.map +1 -0
  153. package/dist/model/digest.d.ts +53 -0
  154. package/dist/model/digest.d.ts.map +1 -0
  155. package/dist/model/digest.js +127 -0
  156. package/dist/model/digest.js.map +1 -0
  157. package/dist/model/errors.d.ts +14 -0
  158. package/dist/model/errors.d.ts.map +1 -0
  159. package/dist/model/errors.js +8 -0
  160. package/dist/model/errors.js.map +1 -0
  161. package/dist/model/primitives.d.ts +19 -0
  162. package/dist/model/primitives.d.ts.map +1 -0
  163. package/dist/model/primitives.js +18 -0
  164. package/dist/model/primitives.js.map +1 -0
  165. package/dist/model/pypi.d.ts +12 -0
  166. package/dist/model/pypi.d.ts.map +1 -0
  167. package/dist/model/pypi.js +20 -0
  168. package/dist/model/pypi.js.map +1 -0
  169. package/dist/model/python-distribution.d.ts +33 -0
  170. package/dist/model/python-distribution.d.ts.map +1 -0
  171. package/dist/model/python-distribution.js +367 -0
  172. package/dist/model/python-distribution.js.map +1 -0
  173. package/dist/model/secret-patterns.d.ts +2 -0
  174. package/dist/model/secret-patterns.d.ts.map +1 -0
  175. package/dist/model/secret-patterns.js +12 -0
  176. package/dist/model/secret-patterns.js.map +1 -0
  177. package/dist/platform/bun.d.ts +7 -0
  178. package/dist/platform/bun.d.ts.map +1 -0
  179. package/dist/platform/bun.js +15 -0
  180. package/dist/platform/bun.js.map +1 -0
  181. package/dist/platform/credentials.d.ts +32 -0
  182. package/dist/platform/credentials.d.ts.map +1 -0
  183. package/dist/platform/credentials.js +772 -0
  184. package/dist/platform/credentials.js.map +1 -0
  185. package/dist/platform/host-support.d.ts +2 -0
  186. package/dist/platform/host-support.d.ts.map +1 -0
  187. package/dist/platform/host-support.js +4 -0
  188. package/dist/platform/host-support.js.map +1 -0
  189. package/dist/platform/node.d.ts +7 -0
  190. package/dist/platform/node.d.ts.map +1 -0
  191. package/dist/platform/node.js +15 -0
  192. package/dist/platform/node.js.map +1 -0
  193. package/dist/platform/release-runtime.d.ts +11 -0
  194. package/dist/platform/release-runtime.d.ts.map +1 -0
  195. package/dist/platform/release-runtime.js +34 -0
  196. package/dist/platform/release-runtime.js.map +1 -0
  197. package/dist/platform/services.d.ts +15 -0
  198. package/dist/platform/services.d.ts.map +1 -0
  199. package/dist/platform/services.js +30 -0
  200. package/dist/platform/services.js.map +1 -0
  201. package/dist/platform/source-observer.d.ts +5 -0
  202. package/dist/platform/source-observer.d.ts.map +1 -0
  203. package/dist/platform/source-observer.js +159 -0
  204. package/dist/platform/source-observer.js.map +1 -0
  205. package/dist/provider-sdk.d.ts +14 -0
  206. package/dist/provider-sdk.d.ts.map +1 -0
  207. package/dist/provider-sdk.js +10 -0
  208. package/dist/provider-sdk.js.map +1 -0
  209. package/dist/publication/adapter.d.ts +212 -0
  210. package/dist/publication/adapter.d.ts.map +1 -0
  211. package/dist/publication/adapter.js +83 -0
  212. package/dist/publication/adapter.js.map +1 -0
  213. package/dist/publication/authority.d.ts +137 -0
  214. package/dist/publication/authority.d.ts.map +1 -0
  215. package/dist/publication/authority.js +233 -0
  216. package/dist/publication/authority.js.map +1 -0
  217. package/dist/publication/catalog-git.d.ts +37 -0
  218. package/dist/publication/catalog-git.d.ts.map +1 -0
  219. package/dist/publication/catalog-git.js +451 -0
  220. package/dist/publication/catalog-git.js.map +1 -0
  221. package/dist/publication/claim.d.ts +39 -0
  222. package/dist/publication/claim.d.ts.map +1 -0
  223. package/dist/publication/claim.js +31 -0
  224. package/dist/publication/claim.js.map +1 -0
  225. package/dist/publication/coordinator.d.ts +246 -0
  226. package/dist/publication/coordinator.d.ts.map +1 -0
  227. package/dist/publication/coordinator.js +370 -0
  228. package/dist/publication/coordinator.js.map +1 -0
  229. package/dist/publication/github.d.ts +36 -0
  230. package/dist/publication/github.d.ts.map +1 -0
  231. package/dist/publication/github.js +644 -0
  232. package/dist/publication/github.js.map +1 -0
  233. package/dist/publication/http.d.ts +69 -0
  234. package/dist/publication/http.d.ts.map +1 -0
  235. package/dist/publication/http.js +29 -0
  236. package/dist/publication/http.js.map +1 -0
  237. package/dist/publication/index.d.ts +5 -0
  238. package/dist/publication/index.d.ts.map +1 -0
  239. package/dist/publication/index.js +5 -0
  240. package/dist/publication/index.js.map +1 -0
  241. package/dist/publication/npm.d.ts +40 -0
  242. package/dist/publication/npm.d.ts.map +1 -0
  243. package/dist/publication/npm.js +359 -0
  244. package/dist/publication/npm.js.map +1 -0
  245. package/dist/publication/profiles.d.ts +136 -0
  246. package/dist/publication/profiles.d.ts.map +1 -0
  247. package/dist/publication/profiles.js +90 -0
  248. package/dist/publication/profiles.js.map +1 -0
  249. package/dist/publication/publisher.d.ts +82 -0
  250. package/dist/publication/publisher.d.ts.map +1 -0
  251. package/dist/publication/publisher.js +53 -0
  252. package/dist/publication/publisher.js.map +1 -0
  253. package/dist/publication/pypi.d.ts +45 -0
  254. package/dist/publication/pypi.d.ts.map +1 -0
  255. package/dist/publication/pypi.js +369 -0
  256. package/dist/publication/pypi.js.map +1 -0
  257. package/dist/publication/recovery.d.ts +663 -0
  258. package/dist/publication/recovery.d.ts.map +1 -0
  259. package/dist/publication/recovery.js +252 -0
  260. package/dist/publication/recovery.js.map +1 -0
  261. package/dist/publication/report.d.ts +1061 -0
  262. package/dist/publication/report.d.ts.map +1 -0
  263. package/dist/publication/report.js +441 -0
  264. package/dist/publication/report.js.map +1 -0
  265. package/dist/recipes/config.d.ts +296 -0
  266. package/dist/recipes/config.d.ts.map +1 -0
  267. package/dist/recipes/config.js +325 -0
  268. package/dist/recipes/config.js.map +1 -0
  269. package/dist/release/capabilities.d.ts +12 -0
  270. package/dist/release/capabilities.d.ts.map +1 -0
  271. package/dist/release/capabilities.js +395 -0
  272. package/dist/release/capabilities.js.map +1 -0
  273. package/dist/release/compiler.d.ts +5 -0
  274. package/dist/release/compiler.d.ts.map +1 -0
  275. package/dist/release/compiler.js +19 -0
  276. package/dist/release/compiler.js.map +1 -0
  277. package/dist/release/config.d.ts +5 -0
  278. package/dist/release/config.d.ts.map +1 -0
  279. package/dist/release/config.js +10 -0
  280. package/dist/release/config.js.map +1 -0
  281. package/dist/release/context.d.ts +96 -0
  282. package/dist/release/context.d.ts.map +1 -0
  283. package/dist/release/context.js +168 -0
  284. package/dist/release/context.js.map +1 -0
  285. package/dist/release/graph.d.ts +271 -0
  286. package/dist/release/graph.d.ts.map +1 -0
  287. package/dist/release/graph.js +766 -0
  288. package/dist/release/graph.js.map +1 -0
  289. package/dist/release/inspect.d.ts +88 -0
  290. package/dist/release/inspect.d.ts.map +1 -0
  291. package/dist/release/inspect.js +75 -0
  292. package/dist/release/inspect.js.map +1 -0
  293. package/dist/release/prepare.d.ts +24 -0
  294. package/dist/release/prepare.d.ts.map +1 -0
  295. package/dist/release/prepare.js +1116 -0
  296. package/dist/release/prepare.js.map +1 -0
  297. package/dist/release/prepared-ref.d.ts +60 -0
  298. package/dist/release/prepared-ref.d.ts.map +1 -0
  299. package/dist/release/prepared-ref.js +131 -0
  300. package/dist/release/prepared-ref.js.map +1 -0
  301. package/dist/release/prepared-store.d.ts +90 -0
  302. package/dist/release/prepared-store.d.ts.map +1 -0
  303. package/dist/release/prepared-store.js +337 -0
  304. package/dist/release/prepared-store.js.map +1 -0
  305. package/dist/release/prepared.d.ts +172 -0
  306. package/dist/release/prepared.d.ts.map +1 -0
  307. package/dist/release/prepared.js +268 -0
  308. package/dist/release/prepared.js.map +1 -0
  309. package/dist/release/staging.d.ts +31 -0
  310. package/dist/release/staging.d.ts.map +1 -0
  311. package/dist/release/staging.js +218 -0
  312. package/dist/release/staging.js.map +1 -0
  313. package/dist/resolve/authored.d.ts +53 -0
  314. package/dist/resolve/authored.d.ts.map +1 -0
  315. package/dist/resolve/authored.js +55 -0
  316. package/dist/resolve/authored.js.map +1 -0
  317. package/dist/resolve/encode.d.ts +3 -0
  318. package/dist/resolve/encode.d.ts.map +1 -0
  319. package/dist/resolve/encode.js +21 -0
  320. package/dist/resolve/encode.js.map +1 -0
  321. package/dist/resolve/errors.d.ts +7 -0
  322. package/dist/resolve/errors.d.ts.map +1 -0
  323. package/dist/resolve/errors.js +17 -0
  324. package/dist/resolve/errors.js.map +1 -0
  325. package/dist/resolve/facts.d.ts +12 -0
  326. package/dist/resolve/facts.d.ts.map +1 -0
  327. package/dist/resolve/facts.js +18 -0
  328. package/dist/resolve/facts.js.map +1 -0
  329. package/dist/resolve/resolve.d.ts +10 -0
  330. package/dist/resolve/resolve.d.ts.map +1 -0
  331. package/dist/resolve/resolve.js +242 -0
  332. package/dist/resolve/resolve.js.map +1 -0
  333. package/dist/store.d.ts +11 -0
  334. package/dist/store.d.ts.map +1 -0
  335. package/dist/store.js +9 -0
  336. package/dist/store.js.map +1 -0
  337. package/examples/README.md +20 -30
  338. package/examples/github-release/release.config.json +11 -18
  339. package/examples/homebrew-tap/README.md +11 -0
  340. package/examples/homebrew-tap/release.config.json +40 -28
  341. package/examples/multi-target/release.config.json +28 -53
  342. package/examples/npm-first-publish/release.config.json +23 -25
  343. package/examples/npm-only/release.config.json +22 -30
  344. package/examples/portable-cli/README.md +17 -0
  345. package/examples/portable-cli/artifacts/portable-example-0.1.0-darwin-arm64 +1 -0
  346. package/examples/portable-cli/artifacts/portable-example-0.1.0-darwin-x64 +1 -0
  347. package/examples/portable-cli/artifacts/portable-example-0.1.0-linux-arm64 +1 -0
  348. package/examples/portable-cli/artifacts/portable-example-0.1.0-linux-x64 +1 -0
  349. package/examples/portable-cli/artifacts/portable-example-0.1.0-windows-x64.exe +1 -0
  350. package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-macosx_10_15_x86_64.whl +1 -0
  351. package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-macosx_11_0_arm64.whl +1 -0
  352. package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-manylinux2014_aarch64.whl +1 -0
  353. package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-manylinux2014_x86_64.whl +1 -0
  354. package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-win_amd64.whl +1 -0
  355. package/examples/portable-cli/package.json +9 -0
  356. package/examples/portable-cli/release.config.json +53 -0
  357. package/examples/portable-cli/src/cli.ts +3 -0
  358. package/examples/pypi-registry/README.md +8 -0
  359. package/examples/scoop-bucket/README.md +10 -0
  360. package/examples/scoop-bucket/release.config.json +40 -30
  361. package/package.json +60 -156
  362. package/src/api/api.ts +365 -0
  363. package/src/api/errors.ts +36 -0
  364. package/src/api/input.ts +92 -0
  365. package/src/api/runtime.ts +14 -0
  366. package/src/api/types.ts +103 -0
  367. package/src/capabilities/bun-targets.ts +2 -0
  368. package/src/capabilities/field-ownership.ts +60 -0
  369. package/src/capabilities/module.ts +158 -0
  370. package/src/capabilities/registry.ts +333 -0
  371. package/src/config/config.ts +48 -0
  372. package/src/correction/coordinator.ts +336 -0
  373. package/src/correction/index.ts +2 -0
  374. package/src/correction/intent.ts +172 -0
  375. package/src/drivers/archive.ts +102 -0
  376. package/src/drivers/contain.ts +20 -0
  377. package/src/drivers/environment.ts +28 -0
  378. package/src/drivers/errors.ts +6 -0
  379. package/src/drivers/glob.ts +137 -0
  380. package/src/drivers/process.ts +340 -0
  381. package/src/drivers/redact.ts +31 -0
  382. package/src/drivers/seccomp-helper-source.ts +121 -0
  383. package/src/drivers/utils.ts +10 -0
  384. package/src/drivers/workspace.ts +40 -0
  385. package/src/extensions/provider-adapter.ts +99 -0
  386. package/src/host.ts +140 -0
  387. package/src/index.ts +64 -0
  388. package/src/model/artifact-collection.ts +237 -0
  389. package/src/model/authority.ts +116 -0
  390. package/src/model/bun-targets.ts +34 -0
  391. package/src/model/canonical.ts +205 -0
  392. package/src/model/catalog.ts +220 -0
  393. package/src/model/digest.ts +172 -0
  394. package/src/model/errors.ts +6 -0
  395. package/src/model/primitives.ts +37 -0
  396. package/src/model/pypi.ts +30 -0
  397. package/src/model/python-distribution.ts +360 -0
  398. package/src/model/secret-patterns.ts +11 -0
  399. package/src/platform/bun.ts +38 -0
  400. package/src/platform/credentials.ts +1083 -0
  401. package/src/platform/host-support.ts +4 -0
  402. package/src/platform/node.ts +38 -0
  403. package/src/platform/release-runtime.ts +47 -0
  404. package/src/platform/services.ts +57 -0
  405. package/src/platform/source-observer.ts +193 -0
  406. package/src/provider-sdk.ts +48 -0
  407. package/src/publication/adapter.ts +132 -0
  408. package/src/publication/authority.ts +397 -0
  409. package/src/publication/catalog-git.ts +603 -0
  410. package/src/publication/claim.ts +51 -0
  411. package/src/publication/coordinator.ts +578 -0
  412. package/src/publication/github.ts +954 -0
  413. package/src/publication/http.ts +101 -0
  414. package/src/publication/index.ts +4 -0
  415. package/src/publication/npm.ts +525 -0
  416. package/src/publication/profiles.ts +94 -0
  417. package/src/publication/publisher.ts +130 -0
  418. package/src/publication/pypi.ts +463 -0
  419. package/src/publication/recovery.ts +349 -0
  420. package/src/publication/report.ts +628 -0
  421. package/src/recipes/config.ts +395 -0
  422. package/src/release/capabilities.ts +459 -0
  423. package/src/release/compiler.ts +28 -0
  424. package/src/release/config.ts +12 -0
  425. package/src/release/context.ts +223 -0
  426. package/src/release/graph.ts +866 -0
  427. package/src/release/inspect.ts +83 -0
  428. package/src/release/prepare.ts +1331 -0
  429. package/src/release/prepared-ref.ts +193 -0
  430. package/src/release/prepared-store.ts +377 -0
  431. package/src/release/prepared.ts +299 -0
  432. package/src/release/staging.ts +257 -0
  433. package/src/resolve/authored.ts +64 -0
  434. package/src/resolve/encode.ts +22 -0
  435. package/src/resolve/errors.ts +15 -0
  436. package/src/resolve/facts.ts +18 -0
  437. package/src/resolve/resolve.ts +328 -0
  438. package/src/store.ts +28 -0
  439. package/templates/README.md +55 -72
  440. package/templates/bun-cli-github/README.md +7 -9
  441. package/templates/bun-cli-github/release.config.json +35 -73
  442. package/templates/github-actions/release.yml +57 -0
  443. package/templates/github-actions/reviewed-release.yml +80 -0
  444. package/templates/multi-target-homebrew/README.md +10 -0
  445. package/templates/multi-target-homebrew/release.config.json +43 -60
  446. package/templates/multi-target-scoop/README.md +10 -0
  447. package/templates/multi-target-scoop/release.config.json +43 -62
  448. package/templates/npm-github/release.config.json +25 -38
  449. package/templates/npm-github/reviewed-release.config.json +37 -0
  450. package/templates/npm-only/README.md +10 -0
  451. package/templates/npm-only/release.config.json +15 -30
  452. package/templates/portable-cli/README.md +13 -0
  453. package/templates/portable-cli/release.config.json +53 -0
  454. package/dist/artifacts/adapter.d.ts +0 -39
  455. package/dist/artifacts/adapter.d.ts.map +0 -1
  456. package/dist/artifacts/adapter.js +0 -23
  457. package/dist/artifacts/adapter.js.map +0 -1
  458. package/dist/artifacts/registry.d.ts +0 -21
  459. package/dist/artifacts/registry.d.ts.map +0 -1
  460. package/dist/artifacts/registry.js +0 -21
  461. package/dist/artifacts/registry.js.map +0 -1
  462. package/dist/config/errors.d.ts +0 -24
  463. package/dist/config/errors.d.ts.map +0 -1
  464. package/dist/config/errors.js +0 -19
  465. package/dist/config/errors.js.map +0 -1
  466. package/dist/config/load.d.ts +0 -9
  467. package/dist/config/load.d.ts.map +0 -1
  468. package/dist/config/load.js +0 -29
  469. package/dist/config/load.js.map +0 -1
  470. package/dist/config/schema.d.ts +0 -12
  471. package/dist/config/schema.d.ts.map +0 -1
  472. package/dist/config/schema.js +0 -19
  473. package/dist/config/schema.js.map +0 -1
  474. package/dist/domain/artifact.d.ts +0 -118
  475. package/dist/domain/artifact.d.ts.map +0 -1
  476. package/dist/domain/artifact.js +0 -197
  477. package/dist/domain/artifact.js.map +0 -1
  478. package/dist/domain/evidence.d.ts +0 -59
  479. package/dist/domain/evidence.d.ts.map +0 -1
  480. package/dist/domain/evidence.js +0 -51
  481. package/dist/domain/evidence.js.map +0 -1
  482. package/dist/domain/operation.d.ts +0 -143
  483. package/dist/domain/operation.d.ts.map +0 -1
  484. package/dist/domain/operation.js +0 -198
  485. package/dist/domain/operation.js.map +0 -1
  486. package/dist/domain/release.d.ts +0 -93
  487. package/dist/domain/release.d.ts.map +0 -1
  488. package/dist/domain/release.js +0 -82
  489. package/dist/domain/release.js.map +0 -1
  490. package/dist/domain/remote-state.d.ts +0 -58
  491. package/dist/domain/remote-state.d.ts.map +0 -1
  492. package/dist/domain/remote-state.js +0 -55
  493. package/dist/domain/remote-state.js.map +0 -1
  494. package/dist/domain/target.d.ts +0 -148
  495. package/dist/domain/target.d.ts.map +0 -1
  496. package/dist/domain/target.js +0 -151
  497. package/dist/domain/target.js.map +0 -1
  498. package/dist/host/host.d.ts +0 -32
  499. package/dist/host/host.d.ts.map +0 -1
  500. package/dist/host/host.js +0 -24
  501. package/dist/host/host.js.map +0 -1
  502. package/dist/host/http-live.d.ts +0 -6
  503. package/dist/host/http-live.d.ts.map +0 -1
  504. package/dist/host/http-live.js +0 -86
  505. package/dist/host/http-live.js.map +0 -1
  506. package/dist/host/http.d.ts +0 -43
  507. package/dist/host/http.d.ts.map +0 -1
  508. package/dist/host/http.js +0 -59
  509. package/dist/host/http.js.map +0 -1
  510. package/dist/host/platform.d.ts +0 -10
  511. package/dist/host/platform.d.ts.map +0 -1
  512. package/dist/host/platform.js +0 -114
  513. package/dist/host/platform.js.map +0 -1
  514. package/dist/host/test.d.ts +0 -23
  515. package/dist/host/test.d.ts.map +0 -1
  516. package/dist/host/test.js +0 -222
  517. package/dist/host/test.js.map +0 -1
  518. package/dist/internal/workspace-path.d.ts +0 -15
  519. package/dist/internal/workspace-path.d.ts.map +0 -1
  520. package/dist/internal/workspace-path.js +0 -36
  521. package/dist/internal/workspace-path.js.map +0 -1
  522. package/dist/planner/artifact-inventory.d.ts +0 -9
  523. package/dist/planner/artifact-inventory.d.ts.map +0 -1
  524. package/dist/planner/artifact-inventory.js +0 -86
  525. package/dist/planner/artifact-inventory.js.map +0 -1
  526. package/dist/planner/create-release-plan.d.ts +0 -5
  527. package/dist/planner/create-release-plan.d.ts.map +0 -1
  528. package/dist/planner/create-release-plan.js +0 -25
  529. package/dist/planner/create-release-plan.js.map +0 -1
  530. package/dist/planner/errors.d.ts +0 -67
  531. package/dist/planner/errors.d.ts.map +0 -1
  532. package/dist/planner/errors.js +0 -58
  533. package/dist/planner/errors.js.map +0 -1
  534. package/dist/planner/evidence-recorder.d.ts +0 -28
  535. package/dist/planner/evidence-recorder.d.ts.map +0 -1
  536. package/dist/planner/evidence-recorder.js +0 -362
  537. package/dist/planner/evidence-recorder.js.map +0 -1
  538. package/dist/planner/executor.d.ts +0 -58
  539. package/dist/planner/executor.d.ts.map +0 -1
  540. package/dist/planner/executor.js +0 -147
  541. package/dist/planner/executor.js.map +0 -1
  542. package/dist/planner/normalize-release.d.ts +0 -19
  543. package/dist/planner/normalize-release.d.ts.map +0 -1
  544. package/dist/planner/normalize-release.js +0 -342
  545. package/dist/planner/normalize-release.js.map +0 -1
  546. package/dist/planner/reconcile.d.ts +0 -17
  547. package/dist/planner/reconcile.d.ts.map +0 -1
  548. package/dist/planner/reconcile.js +0 -259
  549. package/dist/planner/reconcile.js.map +0 -1
  550. package/dist/planner/render-plan.d.ts +0 -15
  551. package/dist/planner/render-plan.d.ts.map +0 -1
  552. package/dist/planner/render-plan.js +0 -231
  553. package/dist/planner/render-plan.js.map +0 -1
  554. package/dist/targets/adapter-helpers.d.ts +0 -79
  555. package/dist/targets/adapter-helpers.d.ts.map +0 -1
  556. package/dist/targets/adapter-helpers.js +0 -194
  557. package/dist/targets/adapter-helpers.js.map +0 -1
  558. package/dist/targets/adapter.d.ts +0 -17
  559. package/dist/targets/adapter.d.ts.map +0 -1
  560. package/dist/targets/adapter.js +0 -2
  561. package/dist/targets/adapter.js.map +0 -1
  562. package/dist/targets/github-release.d.ts +0 -25
  563. package/dist/targets/github-release.d.ts.map +0 -1
  564. package/dist/targets/github-release.js +0 -82
  565. package/dist/targets/github-release.js.map +0 -1
  566. package/dist/targets/github.d.ts +0 -11
  567. package/dist/targets/github.d.ts.map +0 -1
  568. package/dist/targets/github.js +0 -117
  569. package/dist/targets/github.js.map +0 -1
  570. package/dist/targets/homebrew.d.ts +0 -11
  571. package/dist/targets/homebrew.d.ts.map +0 -1
  572. package/dist/targets/homebrew.js +0 -210
  573. package/dist/targets/homebrew.js.map +0 -1
  574. package/dist/targets/live.d.ts +0 -5
  575. package/dist/targets/live.d.ts.map +0 -1
  576. package/dist/targets/live.js +0 -50
  577. package/dist/targets/live.js.map +0 -1
  578. package/dist/targets/npm.d.ts +0 -10
  579. package/dist/targets/npm.d.ts.map +0 -1
  580. package/dist/targets/npm.js +0 -112
  581. package/dist/targets/npm.js.map +0 -1
  582. package/dist/targets/pypi.d.ts +0 -11
  583. package/dist/targets/pypi.d.ts.map +0 -1
  584. package/dist/targets/pypi.js +0 -141
  585. package/dist/targets/pypi.js.map +0 -1
  586. package/dist/targets/registry.d.ts +0 -25
  587. package/dist/targets/registry.d.ts.map +0 -1
  588. package/dist/targets/registry.js +0 -34
  589. package/dist/targets/registry.js.map +0 -1
  590. package/dist/targets/scoop.d.ts +0 -11
  591. package/dist/targets/scoop.d.ts.map +0 -1
  592. package/dist/targets/scoop.js +0 -88
  593. package/dist/targets/scoop.js.map +0 -1
  594. package/dist/types/effect-internal.d.ts +0 -5
  595. package/dist/types/effect-internal.d.ts.map +0 -1
  596. package/dist/types/effect-internal.js +0 -2
  597. package/dist/types/effect-internal.js.map +0 -1
  598. package/dist/workflows/config.d.ts +0 -202
  599. package/dist/workflows/config.d.ts.map +0 -1
  600. package/dist/workflows/config.js +0 -420
  601. package/dist/workflows/config.js.map +0 -1
  602. package/dist/workflows/diagnostics.d.ts +0 -62
  603. package/dist/workflows/diagnostics.d.ts.map +0 -1
  604. package/dist/workflows/diagnostics.js +0 -530
  605. package/dist/workflows/diagnostics.js.map +0 -1
  606. package/dist/workflows/distribution.d.ts +0 -25
  607. package/dist/workflows/distribution.d.ts.map +0 -1
  608. package/dist/workflows/distribution.js +0 -24
  609. package/dist/workflows/distribution.js.map +0 -1
  610. package/dist/workflows/evidence.d.ts +0 -17
  611. package/dist/workflows/evidence.d.ts.map +0 -1
  612. package/dist/workflows/evidence.js +0 -32
  613. package/dist/workflows/evidence.js.map +0 -1
  614. package/dist/workflows/index.d.ts +0 -8
  615. package/dist/workflows/index.d.ts.map +0 -1
  616. package/dist/workflows/index.js +0 -7
  617. package/dist/workflows/index.js.map +0 -1
  618. package/dist/workflows/init.d.ts +0 -84
  619. package/dist/workflows/init.d.ts.map +0 -1
  620. package/dist/workflows/init.js +0 -487
  621. package/dist/workflows/init.js.map +0 -1
  622. package/dist/workflows/live.d.ts +0 -9
  623. package/dist/workflows/live.d.ts.map +0 -1
  624. package/dist/workflows/live.js +0 -7
  625. package/dist/workflows/live.js.map +0 -1
  626. package/dist/workflows/options.d.ts +0 -30
  627. package/dist/workflows/options.d.ts.map +0 -1
  628. package/dist/workflows/options.js +0 -16
  629. package/dist/workflows/options.js.map +0 -1
  630. package/examples/non-strict-skips/artifacts/release-example-skips-0.1.0.tgz +0 -1
  631. package/examples/non-strict-skips/release.config.json +0 -31
  632. package/examples/pypi-registry/release.config.json +0 -31
  633. package/templates/github-actions/plan-and-approved-execute.yml +0 -58
  634. package/templates/github-actions/plan-only.yml +0 -33
  635. 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)!