@intentius/chant 0.124.100 → 0.124.102

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 (270) hide show
  1. package/dist/action-pins.d.ts +2 -0
  2. package/dist/action-pins.js +3 -0
  3. package/dist/ci-detect.d.ts +13 -0
  4. package/dist/ci-detect.js +12 -0
  5. package/dist/ci-evidence-claims.d.ts +12 -0
  6. package/dist/ci-evidence-claims.js +12 -0
  7. package/dist/ci-system.d.ts +66 -0
  8. package/dist/ci-system.js +61 -0
  9. package/dist/cli/handlers/build.js +27 -0
  10. package/dist/cli/handlers/release-doctor.d.ts +12 -0
  11. package/dist/cli/handlers/release-doctor.js +118 -0
  12. package/dist/cli/handlers/release-init.d.ts +10 -0
  13. package/dist/cli/handlers/release-init.js +374 -0
  14. package/dist/cli/handlers/release.d.ts +43 -2
  15. package/dist/cli/handlers/release.js +667 -39
  16. package/dist/cli/handlers/run-generate.js +11 -0
  17. package/dist/cli/main.d.ts +2 -0
  18. package/dist/cli/main.js +44 -101
  19. package/dist/cli/parse-args.js +48 -0
  20. package/dist/cli/registry.d.ts +16 -0
  21. package/dist/cli/release-commands/artifacts.d.ts +3 -0
  22. package/dist/cli/release-commands/artifacts.js +14 -0
  23. package/dist/cli/release-commands/candidates.d.ts +3 -0
  24. package/dist/cli/release-commands/candidates.js +16 -0
  25. package/dist/cli/release-commands/changed.d.ts +3 -0
  26. package/dist/cli/release-commands/changed.js +14 -0
  27. package/dist/cli/release-commands/compose.d.ts +3 -0
  28. package/dist/cli/release-commands/compose.js +16 -0
  29. package/dist/cli/release-commands/cut.d.ts +3 -0
  30. package/dist/cli/release-commands/cut.js +50 -0
  31. package/dist/cli/release-commands/doctor.d.ts +3 -0
  32. package/dist/cli/release-commands/doctor.js +14 -0
  33. package/dist/cli/release-commands/export.d.ts +3 -0
  34. package/dist/cli/release-commands/export.js +12 -0
  35. package/dist/cli/release-commands/images.d.ts +3 -0
  36. package/dist/cli/release-commands/images.js +13 -0
  37. package/dist/cli/release-commands/index.d.ts +8 -0
  38. package/dist/cli/release-commands/index.js +52 -0
  39. package/dist/cli/release-commands/init.d.ts +3 -0
  40. package/dist/cli/release-commands/init.js +19 -0
  41. package/dist/cli/release-commands/list.d.ts +3 -0
  42. package/dist/cli/release-commands/list.js +10 -0
  43. package/dist/cli/release-commands/next.d.ts +3 -0
  44. package/dist/cli/release-commands/next.js +13 -0
  45. package/dist/cli/release-commands/publish.d.ts +3 -0
  46. package/dist/cli/release-commands/publish.js +22 -0
  47. package/dist/cli/release-commands/stamp.d.ts +3 -0
  48. package/dist/cli/release-commands/stamp.js +15 -0
  49. package/dist/cli/release-commands/status.d.ts +3 -0
  50. package/dist/cli/release-commands/status.js +17 -0
  51. package/dist/cli/release-commands/tag.d.ts +3 -0
  52. package/dist/cli/release-commands/tag.js +12 -0
  53. package/dist/cli/release-commands/types.d.ts +20 -0
  54. package/dist/cli/release-commands/types.js +1 -0
  55. package/dist/cli/release-commands/verify.d.ts +3 -0
  56. package/dist/cli/release-commands/verify.js +15 -0
  57. package/dist/cli/release-commands/workflow.d.ts +3 -0
  58. package/dist/cli/release-commands/workflow.js +15 -0
  59. package/dist/cloud-lister/index.d.ts +4 -1
  60. package/dist/cloud-lister/index.js +2 -1
  61. package/dist/cloud-lister/kubernetes-components.d.ts +56 -0
  62. package/dist/cloud-lister/kubernetes-components.js +642 -0
  63. package/dist/cloud-lister/kubernetes.d.ts +18 -0
  64. package/dist/cloud-lister/kubernetes.js +26 -1
  65. package/dist/cloud-lister/mask.d.ts +5 -1
  66. package/dist/cloud-lister/mask.js +14 -5
  67. package/dist/components/cli-support.d.ts +1 -1
  68. package/dist/components/cli-support.js +1 -1
  69. package/dist/config-environments.d.ts +8 -1
  70. package/dist/config-environments.js +2 -0
  71. package/dist/config-import.d.ts +1 -1
  72. package/dist/config-import.js +6 -2
  73. package/dist/config-sandbox.d.ts +1 -1
  74. package/dist/config-sandbox.js +3 -3
  75. package/dist/config.d.ts +369 -10
  76. package/dist/config.js +127 -7
  77. package/dist/deep-observation.js +9 -3
  78. package/dist/floor-table.data.js +21 -1
  79. package/dist/forge-remote.d.ts +13 -0
  80. package/dist/forge-remote.js +15 -0
  81. package/dist/lexicon.d.ts +45 -4
  82. package/dist/lifecycle/__fixtures__/package-files.d.ts +32 -0
  83. package/dist/lifecycle/__fixtures__/package-files.js +72 -0
  84. package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +62 -0
  85. package/dist/lifecycle/__fixtures__/publish-fakes.js +275 -3
  86. package/dist/lifecycle/publish-attachments.d.ts +2 -1
  87. package/dist/lifecycle/publish-attachments.js +19 -2
  88. package/dist/lifecycle/publish-cargo.d.ts +99 -0
  89. package/dist/lifecycle/publish-cargo.js +412 -0
  90. package/dist/lifecycle/publish-credentials.d.ts +1 -1
  91. package/dist/lifecycle/publish-credentials.js +13 -0
  92. package/dist/lifecycle/publish-declaration.d.ts +322 -4
  93. package/dist/lifecycle/publish-declaration.js +340 -9
  94. package/dist/lifecycle/publish-forge.d.ts +45 -2
  95. package/dist/lifecycle/publish-forge.js +434 -34
  96. package/dist/lifecycle/publish-git-ssh.d.ts +15 -0
  97. package/dist/lifecycle/publish-git-ssh.js +30 -4
  98. package/dist/lifecycle/publish-github.d.ts +40 -2
  99. package/dist/lifecycle/publish-github.js +100 -3
  100. package/dist/lifecycle/publish-helm.d.ts +83 -0
  101. package/dist/lifecycle/publish-helm.js +452 -0
  102. package/dist/lifecycle/publish-homebrew.d.ts +7 -9
  103. package/dist/lifecycle/publish-homebrew.js +34 -197
  104. package/dist/lifecycle/publish-index.d.ts +141 -0
  105. package/dist/lifecycle/publish-index.js +719 -0
  106. package/dist/lifecycle/publish-marketplace.js +77 -0
  107. package/dist/lifecycle/publish-maven.d.ts +79 -0
  108. package/dist/lifecycle/publish-maven.js +364 -0
  109. package/dist/lifecycle/publish-mcp-registry.d.ts +66 -0
  110. package/dist/lifecycle/publish-mcp-registry.js +305 -0
  111. package/dist/lifecycle/publish-npm.d.ts +27 -1
  112. package/dist/lifecycle/publish-npm.js +216 -3
  113. package/dist/lifecycle/publish-nuget.d.ts +93 -0
  114. package/dist/lifecycle/publish-nuget.js +377 -0
  115. package/dist/lifecycle/publish-oci.d.ts +91 -2
  116. package/dist/lifecycle/publish-oci.js +247 -8
  117. package/dist/lifecycle/publish-package-files.d.ts +16 -0
  118. package/dist/lifecycle/publish-package-files.js +39 -0
  119. package/dist/lifecycle/publish-pypi.d.ts +138 -0
  120. package/dist/lifecycle/publish-pypi.js +657 -0
  121. package/dist/lifecycle/publish-record.d.ts +6 -3
  122. package/dist/lifecycle/publish-record.js +6 -3
  123. package/dist/lifecycle/publish-rubygems.d.ts +84 -0
  124. package/dist/lifecycle/publish-rubygems.js +366 -0
  125. package/dist/lifecycle/publish-signing.d.ts +147 -0
  126. package/dist/lifecycle/publish-signing.js +257 -0
  127. package/dist/lifecycle/publish-targets.d.ts +37 -1
  128. package/dist/lifecycle/publish-targets.js +102 -0
  129. package/dist/lifecycle/publish-tauri.js +43 -0
  130. package/dist/lifecycle/publish-train-names.d.ts +57 -0
  131. package/dist/lifecycle/publish-train-names.js +123 -0
  132. package/dist/lifecycle/publish-verify.d.ts +121 -0
  133. package/dist/lifecycle/publish-verify.js +130 -0
  134. package/dist/lifecycle/query.js +8 -0
  135. package/dist/lifecycle/release-artifacts.d.ts +290 -0
  136. package/dist/lifecycle/release-artifacts.js +808 -0
  137. package/dist/lifecycle/release-changelog.d.ts +13 -1
  138. package/dist/lifecycle/release-changelog.js +35 -2
  139. package/dist/lifecycle/release-cut.d.ts +64 -4
  140. package/dist/lifecycle/release-cut.js +147 -34
  141. package/dist/lifecycle/release-doctor.d.ts +113 -0
  142. package/dist/lifecycle/release-doctor.js +1198 -0
  143. package/dist/lifecycle/release-green.d.ts +86 -0
  144. package/dist/lifecycle/release-green.js +286 -0
  145. package/dist/lifecycle/release-init-registries.d.ts +48 -0
  146. package/dist/lifecycle/release-init-registries.js +97 -0
  147. package/dist/lifecycle/release-init.d.ts +275 -0
  148. package/dist/lifecycle/release-init.js +984 -0
  149. package/dist/lifecycle/release-intents.d.ts +73 -0
  150. package/dist/lifecycle/release-intents.js +128 -0
  151. package/dist/lifecycle/release-next.d.ts +111 -0
  152. package/dist/lifecycle/release-next.js +251 -0
  153. package/dist/lifecycle/release-prerelease.d.ts +19 -0
  154. package/dist/lifecycle/release-prerelease.js +30 -0
  155. package/dist/lifecycle/release-publish.d.ts +256 -10
  156. package/dist/lifecycle/release-publish.js +247 -35
  157. package/dist/lifecycle/release-status-change.d.ts +226 -0
  158. package/dist/lifecycle/release-status-change.js +478 -0
  159. package/dist/lifecycle/release-status.d.ts +11 -0
  160. package/dist/lifecycle/release-status.js +1 -1
  161. package/dist/lifecycle/release-store.d.ts +73 -2
  162. package/dist/lifecycle/release-store.js +32 -1
  163. package/dist/lifecycle/release-tag.d.ts +142 -0
  164. package/dist/lifecycle/release-tag.js +322 -0
  165. package/dist/lifecycle/release-verify.d.ts +73 -1
  166. package/dist/lifecycle/release-verify.js +117 -2
  167. package/dist/lifecycle/release-version-formats.d.ts +73 -0
  168. package/dist/lifecycle/release-version-formats.js +570 -0
  169. package/dist/lifecycle/release-version.d.ts +58 -10
  170. package/dist/lifecycle/release-version.js +164 -36
  171. package/dist/lifecycle/release-workstation.d.ts +3 -2
  172. package/dist/lifecycle/release-workstation.js +3 -2
  173. package/dist/op/generate-pipeline.js +1 -1
  174. package/dist/op/local-executor.d.ts +1 -1
  175. package/dist/op/local-executor.js +2 -2
  176. package/dist/op/op-waves-evidence.js +9 -2
  177. package/dist/pr-forge-base.js +4 -2
  178. package/dist/pr-forge.d.ts +20 -2
  179. package/dist/pr-forge.js +46 -10
  180. package/dist/release-floors.d.ts +8 -1
  181. package/dist/release-floors.js +9 -2
  182. package/dist/sensitive-key.d.ts +12 -0
  183. package/dist/sensitive-key.js +52 -0
  184. package/dist/tool-pins.d.ts +40 -0
  185. package/dist/tool-pins.js +66 -0
  186. package/dist/ts-loader.d.ts +8 -0
  187. package/dist/ts-loader.js +19 -0
  188. package/dist/wave-runtime.mjs +345 -342
  189. package/dist/workspace/ci-forge.d.ts +17 -0
  190. package/dist/workspace/ci-forge.js +17 -0
  191. package/dist/workspace/ci-init.js +1 -1
  192. package/dist/workspace/composites.schema.json +1 -0
  193. package/dist/workspace/declaration.d.ts +8 -0
  194. package/dist/workspace/declaration.js +12 -0
  195. package/dist/workspace/declaration.schema.json +8 -0
  196. package/dist/workspace/environments.d.ts +2 -0
  197. package/dist/workspace/environments.js +1 -1
  198. package/dist/workspace/identity-gate-rule.d.ts +61 -5
  199. package/dist/workspace/identity-gate-rule.js +81 -12
  200. package/dist/workspace/lexicon-outputs.d.ts +1 -1
  201. package/dist/workspace/lexicon-outputs.js +1 -1
  202. package/dist/workspace/member-pipeline.d.ts +2 -1
  203. package/dist/workspace/member-pipeline.js +5 -2
  204. package/dist/workspace/reason-codes.d.ts +2 -0
  205. package/dist/workspace/reason-codes.js +3 -1
  206. package/dist/workspace/release-changed.d.ts +75 -4
  207. package/dist/workspace/release-changed.js +205 -34
  208. package/dist/workspace/release-changed.schema.json +20 -2
  209. package/dist/workspace/release-steps/artifacts.d.ts +7 -0
  210. package/dist/workspace/release-steps/artifacts.js +45 -0
  211. package/dist/workspace/release-steps/builds.d.ts +12 -0
  212. package/dist/workspace/release-steps/builds.js +38 -0
  213. package/dist/workspace/release-steps/doctor.d.ts +8 -0
  214. package/dist/workspace/release-steps/doctor.js +14 -0
  215. package/dist/workspace/release-steps/goreleaser.d.ts +16 -0
  216. package/dist/workspace/release-steps/goreleaser.js +36 -0
  217. package/dist/workspace/release-steps/green.d.ts +3 -0
  218. package/dist/workspace/release-steps/green.js +6 -0
  219. package/dist/workspace/release-steps/images.d.ts +22 -0
  220. package/dist/workspace/release-steps/images.js +59 -0
  221. package/dist/workspace/release-steps/index.d.ts +9 -0
  222. package/dist/workspace/release-steps/index.js +50 -0
  223. package/dist/workspace/release-steps/nfpm.d.ts +13 -0
  224. package/dist/workspace/release-steps/nfpm.js +29 -0
  225. package/dist/workspace/release-steps/nuget.d.ts +14 -0
  226. package/dist/workspace/release-steps/nuget.js +16 -0
  227. package/dist/workspace/release-steps/pypi.d.ts +15 -0
  228. package/dist/workspace/release-steps/pypi.js +21 -0
  229. package/dist/workspace/release-steps/qemu.d.ts +21 -0
  230. package/dist/workspace/release-steps/qemu.js +35 -0
  231. package/dist/workspace/release-steps/signing.d.ts +18 -0
  232. package/dist/workspace/release-steps/signing.js +30 -0
  233. package/dist/workspace/release-steps/stamp.d.ts +3 -0
  234. package/dist/workspace/release-steps/stamp.js +4 -0
  235. package/dist/workspace/release-steps/targets.d.ts +31 -0
  236. package/dist/workspace/release-steps/targets.js +40 -0
  237. package/dist/workspace/release-steps/types.d.ts +104 -0
  238. package/dist/workspace/release-steps/types.js +2 -0
  239. package/dist/workspace/release-steps/verify.d.ts +3 -0
  240. package/dist/workspace/release-steps/verify.js +4 -0
  241. package/dist/workspace/release-toolchains.d.ts +59 -0
  242. package/dist/workspace/release-toolchains.js +133 -0
  243. package/dist/workspace/release-train-workflow.d.ts +36 -0
  244. package/dist/workspace/release-train-workflow.js +121 -0
  245. package/dist/workspace/release-train.d.ts +3 -1
  246. package/dist/workspace/release-train.js +20 -3
  247. package/dist/workspace/release-workflow.d.ts +183 -59
  248. package/dist/workspace/release-workflow.js +570 -201
  249. package/dist/workspace/releases.schema.json +70 -1
  250. package/dist/workspace/search-contract.d.ts +1 -1
  251. package/dist/workspace/security.js +9 -2
  252. package/dist/workspace/train-cut.d.ts +182 -0
  253. package/dist/workspace/train-cut.js +504 -0
  254. package/dist/workspace/train-prepare.d.ts +64 -0
  255. package/dist/workspace/train-prepare.js +313 -0
  256. package/dist/workspace/train-publish.d.ts +177 -0
  257. package/dist/workspace/train-publish.js +574 -0
  258. package/dist/workspace/train-range-labels.d.ts +33 -0
  259. package/dist/workspace/train-range-labels.js +109 -0
  260. package/dist/workspace/train-shell.d.ts +5 -0
  261. package/dist/workspace/train-shell.js +17 -0
  262. package/dist/workspace/trust/check-evidence-report.d.ts +3 -7
  263. package/dist/workspace/trust/check-evidence-report.js +3 -7
  264. package/dist/workspace/trust/seal.d.ts +13 -3
  265. package/dist/workspace/trust/seal.js +14 -4
  266. package/dist/workspace/work-cli.d.ts +3 -2
  267. package/dist/workspace/work-cli.js +3 -2
  268. package/dist/workspace/workspace-ledger.d.ts +14 -1
  269. package/dist/workspace/workspace-ledger.js +33 -7
  270. package/package.json +1 -1
@@ -22,6 +22,13 @@
22
22
  * discover` or `cosign tree` finds them. A referrer the registry already
23
23
  * holds is not pushed again.
24
24
  *
25
+ * When the publish signs (#5164, ./publish-signing.ts), the stage also
26
+ * pushes a cosign signature and SLSA provenance of the image, each a Sigstore
27
+ * bundle in an artifact manifest whose subject is the image. On a registry
28
+ * without the referrers API (GHCR, Docker Hub) they are listed under the
29
+ * referrers tag `sha256-<hex>`, as cosign does. An image that already has a
30
+ * bundle with the same predicate type is not signed again.
31
+ *
25
32
  * Credentials come from `usernameEnv` and `passwordEnv` (default
26
33
  * `OCI_USERNAME`, `OCI_PASSWORD`), or else from the `auths` entry for the
27
34
  * registry in the docker config file (`$DOCKER_CONFIG/config.json` or
@@ -40,9 +47,12 @@ import { existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
40
47
  import { tmpdir } from "node:os";
41
48
  import { join } from "node:path";
42
49
  import { memberSbom, releaseProvenance } from "./publish-attachments.js";
50
+ import { BUNDLE_PREDICATE_ANNOTATION, COSIGN_SIGN_PREDICATE, SIGSTORE_BUNDLE_MEDIA_TYPE, SLSA_PROVENANCE_PREDICATE, cosignSignStatement, slsaProvenanceStatement } from "./publish-signing.js";
43
51
  import { readCredential } from "./publish-credentials.js";
44
52
  import { bytesDigest, checkReleaseDigest, fileDigest, isDir, memberFile, publishTargetKey } from "./publish-targets.js";
53
+ import { trainName, waitUntilServed } from "./publish-train-names.js";
45
54
  import { PublishTargetError } from "./release-publish.js";
55
+ import { prereleaseOf } from "./release-prerelease.js";
46
56
  const INDEX_TYPES = new Set(["application/vnd.oci.image.index.v1+json", "application/vnd.docker.distribution.manifest.list.v2+json"]);
47
57
  export function parseRepository(repository) {
48
58
  const parts = repository.split("/");
@@ -126,7 +136,7 @@ function readLayout(abs) {
126
136
  }
127
137
  }
128
138
  /** The credential for `repo`: the declared variables, else the docker config's `auths` entry. */
129
- function ociCredential(decl, repo, ctx) {
139
+ export function ociCredential(decl, repo, ctx) {
130
140
  const password = readCredential(ctx.env, [decl.passwordEnv ?? "OCI_PASSWORD"], ctx.redactor);
131
141
  if (password) {
132
142
  const user = ctx.env[decl.usernameEnv ?? "OCI_USERNAME"];
@@ -184,7 +194,7 @@ class RegistryAnswer extends Error {
184
194
  * token. A 401 under a token it already holds, as when the registry's token
185
195
  * expires during a long push, is answered once more (#4877).
186
196
  */
187
- class Registry {
197
+ export class Registry {
188
198
  constructor(repo, fetch, cred, ctx, sleep = (ms) => new Promise((r) => setTimeout(r, ms))) {
189
199
  this.repo = repo;
190
200
  this.fetch = fetch;
@@ -301,13 +311,84 @@ class Registry {
301
311
  const res = await this.request("HEAD", `/v2/${this.repo.name}/manifests/${digest}`, { accept: mediaType });
302
312
  return res.status === 200;
303
313
  }
314
+ /** The manifest `ref` (a tag or a digest) names, or null when the registry has none (#5163). */
315
+ async getManifest(ref) {
316
+ const accept = [...INDEX_TYPES, IMAGE_MANIFEST, "application/vnd.docker.distribution.manifest.v2+json"].join(", ");
317
+ const res = await this.request("GET", `/v2/${this.repo.name}/manifests/${ref}`, { accept });
318
+ if (res.status === 404)
319
+ return null;
320
+ if (res.status !== 200 || !res.arrayBuffer)
321
+ this.fail(`reading manifest ${ref}`, res.status, await res.text());
322
+ const bytes = new Uint8Array(await res.arrayBuffer());
323
+ const mediaType = res.headers.get("content-type")?.split(";")[0]?.trim() || (JSON.parse(Buffer.from(bytes).toString("utf-8")).mediaType ?? IMAGE_MANIFEST);
324
+ return { mediaType, bytes, digest: res.headers.get("docker-content-digest") ?? bytesDigest(bytes) };
325
+ }
326
+ /** Put a manifest. True when the registry answered with `OCI-Subject`, so its referrers API lists a manifest with a subject. */
304
327
  async putManifest(ref, mediaType, bytes) {
305
- await this.tries(`putting manifest ${ref}`, async () => {
328
+ return this.tries(`putting manifest ${ref}`, async () => {
306
329
  const res = await this.request("PUT", `/v2/${this.repo.name}/manifests/${ref}`, { "content-type": mediaType }, bytes);
307
330
  if (res.status !== 201)
308
331
  throw new RegistryAnswer(`putting manifest ${ref}`, res.status, await res.text());
332
+ return res.headers.get("oci-subject") !== null;
309
333
  });
310
334
  }
335
+ /**
336
+ * The referrers of `digest` (#5164): the referrers API's index, else, on a
337
+ * registry without it (GHCR, Docker Hub), the index the referrers tag
338
+ * schema keeps at the tag `sha256-<hex>`. Empty when there is neither.
339
+ */
340
+ async referrers(digest) {
341
+ const api = await this.request("GET", `/v2/${this.repo.name}/referrers/${digest}`, { accept: OCI_INDEX });
342
+ if (api.status === 200) {
343
+ const body = JSON.parse(await api.text());
344
+ return body.manifests ?? [];
345
+ }
346
+ return (await this.referrersTag(digest))?.manifests ?? [];
347
+ }
348
+ async referrersTag(digest) {
349
+ const res = await this.request("GET", `/v2/${this.repo.name}/manifests/${referrersTagOf(digest)}`, { accept: OCI_INDEX });
350
+ if (res.status !== 200)
351
+ return null;
352
+ try {
353
+ const body = JSON.parse(await res.text());
354
+ return { manifests: body.manifests ?? [] };
355
+ }
356
+ catch {
357
+ return null;
358
+ }
359
+ }
360
+ /** Add `descriptor` to the referrers tag of `subject` (the OCI distribution spec's fallback), unless it is listed there. */
361
+ async addToReferrersTag(subject, descriptor) {
362
+ const index = (await this.referrersTag(subject)) ?? { manifests: [] };
363
+ if (index.manifests.some((m) => m.digest === descriptor.digest))
364
+ return;
365
+ const bytes = new Uint8Array(Buffer.from(JSON.stringify({ schemaVersion: 2, mediaType: OCI_INDEX, manifests: [...index.manifests, descriptor] })));
366
+ await this.putManifest(referrersTagOf(subject), OCI_INDEX, bytes);
367
+ }
368
+ }
369
+ const OCI_INDEX = "application/vnd.oci.image.index.v1+json";
370
+ /** The tag the referrers tag schema keeps the referrers of `digest` under: `sha256-<hex>`. */
371
+ export function referrersTagOf(digest) {
372
+ return digest.replace(":", "-");
373
+ }
374
+ /**
375
+ * The artifact manifest that attaches a Sigstore bundle to the image
376
+ * `subject` (#5164), as `cosign sign` and `cosign attest` push one: the
377
+ * bundle media type as the artifact type and the one layer, and the
378
+ * statement's predicate type in `dev.sigstore.bundle.predicateType`.
379
+ */
380
+ export function bundleReferrerManifest(bundle, predicateType, subject) {
381
+ const annotations = { "dev.sigstore.bundle.content": "dsse-envelope", [BUNDLE_PREDICATE_ANNOTATION]: predicateType };
382
+ const manifest = {
383
+ schemaVersion: 2,
384
+ mediaType: IMAGE_MANIFEST,
385
+ artifactType: SIGSTORE_BUNDLE_MEDIA_TYPE,
386
+ config: { mediaType: EMPTY_CONFIG.mediaType, digest: bytesDigest(EMPTY_CONFIG.bytes), size: EMPTY_CONFIG.bytes.byteLength },
387
+ layers: [{ mediaType: SIGSTORE_BUNDLE_MEDIA_TYPE, digest: bundle.digest, size: bundle.bytes.byteLength, annotations: { "org.opencontainers.image.title": bundle.name } }],
388
+ subject,
389
+ annotations,
390
+ };
391
+ return new Uint8Array(Buffer.from(JSON.stringify(manifest)));
311
392
  }
312
393
  /** The media type of the empty config an artifact manifest names. */
313
394
  const EMPTY_CONFIG = { mediaType: "application/vnd.oci.empty.v1+json", bytes: new Uint8Array(Buffer.from("{}")) };
@@ -329,12 +410,17 @@ export function referrerManifest(a, subject) {
329
410
  };
330
411
  return new Uint8Array(Buffer.from(JSON.stringify(manifest)));
331
412
  }
332
- /** The tags to point at the digest: the context's tag when set, else the declared ones with `{label}` filled in. */
413
+ /** The tags to point at the digest: the context's tag when set, else the declared ones with `{label}` filled in, without `latest` for a prerelease label. */
333
414
  export function ociTags(decl, ctx) {
334
415
  if (ctx.tag)
335
416
  return [ctx.tag];
336
417
  const declared = decl.tags ?? (ctx.label ? ["{label}"] : []);
337
- return declared.filter((t) => ctx.label !== null || !t.includes("{label}")).map((t) => t.split("{label}").join(ctx.label ?? ""));
418
+ const tags = declared.filter((t) => ctx.label !== null || !t.includes("{label}")).map((t) => t.split("{label}").join(ctx.label ?? ""));
419
+ // A prerelease label moves no `latest`; what is left is its own label tag.
420
+ if (prereleaseOf(ctx.label) === null)
421
+ return tags;
422
+ const kept = tags.filter((t) => t !== "latest");
423
+ return kept.length > 0 || ctx.label === null ? kept : [ctx.label];
338
424
  }
339
425
  /** The digest an OCI archive (a layout directory or a tar file of one) is pushed under: its top manifest's (#4657). */
340
426
  export function ociArchiveDigest(abs) {
@@ -346,6 +432,18 @@ export function ociArchiveDigest(abs) {
346
432
  layout.cleanup();
347
433
  }
348
434
  }
435
+ /**
436
+ * The tags a status change moves (#5163): the channel's tag when the release
437
+ * was cut to one, else the declared tags with no `{label}` in them, such as
438
+ * `latest`, without `latest` for a prerelease label, which never moved it
439
+ * (#5166). A tag that names the label belongs to that release and stays.
440
+ */
441
+ export function ociMovingTags(decl, channel, label = null) {
442
+ if (channel)
443
+ return [channel];
444
+ const moving = (decl.tags ?? ["{label}"]).filter((t) => !t.includes("{label}"));
445
+ return prereleaseOf(label) === null ? moving : moving.filter((t) => t !== "latest");
446
+ }
349
447
  export function ociTarget(decl, deps) {
350
448
  const repo = parseRepository(decl.repository);
351
449
  const fetchImpl = deps.fetch ?? ((url, init) => fetch(url, init));
@@ -383,11 +481,149 @@ export function ociTarget(decl, deps) {
383
481
  });
384
482
  };
385
483
  const referrerItem = (r) => ({ name: r.attachment.name, destination: `${decl.repository}@${r.digest}, a referrer of the image`, digest: r.digest, attachment: r.attachment.kind });
484
+ /** #5164: the cosign signature and SLSA provenance of the image, which a stage signs when the publish signs. */
485
+ const signatures = [
486
+ { predicateType: COSIGN_SIGN_PREDICATE, name: "cosign signature", attachment: "signature" },
487
+ { predicateType: SLSA_PROVENANCE_PREDICATE, name: "SLSA provenance", attachment: "attestation" },
488
+ ];
489
+ const signatureItem = (ctx, s, image, digest) => ({
490
+ name: s.name,
491
+ destination: digest ? `${decl.repository}@${digest}, a referrer of the image` : `${decl.repository}, a referrer of the image, signed when staged`,
492
+ ...(digest ? { digest } : {}),
493
+ attachment: s.attachment,
494
+ signs: [{ name: `${decl.repository}@${image}`, digest: image }],
495
+ predicateType: s.predicateType,
496
+ ...(ctx.signing ? { sigstore: ctx.signing.identity } : {}),
497
+ });
498
+ /** Sign the image and push each bundle as a referrer, unless the image has one with that predicate type already. */
499
+ const sign = async (ctx, registry, layout) => {
500
+ if (!ctx.signing)
501
+ return [];
502
+ const subject = { mediaType: layout.top.mediaType, digest: layout.top.digest, size: layout.top.bytes.byteLength };
503
+ const existing = await registry.referrers(layout.top.digest);
504
+ const items = [];
505
+ for (const s of signatures) {
506
+ const found = existing.find((m) => m.artifactType === SIGSTORE_BUNDLE_MEDIA_TYPE && m.annotations?.[BUNDLE_PREDICATE_ANNOTATION] === s.predicateType);
507
+ if (found) {
508
+ ctx.log(`${layout.top.digest} already has a ${s.name}; it is not signed again`);
509
+ items.push({ ...signatureItem(ctx, s, layout.top.digest, found.digest), present: true });
510
+ continue;
511
+ }
512
+ const name = `${decl.repository}@${layout.top.digest}`;
513
+ const statement = s.predicateType === COSIGN_SIGN_PREDICATE ? cosignSignStatement({ name: decl.repository, digest: layout.top.digest }) : slsaProvenanceStatement(ctx, [{ name, digest: layout.top.digest }]);
514
+ ctx.log(`signing ${name} with ${ctx.signing.signer.name}: ${s.name}`);
515
+ const bytes = await ctx.signing.signer.signStatement(statement);
516
+ const bundle = { kind: "provenance", name: `${s.attachment}.sigstore.json`, mediaType: SIGSTORE_BUNDLE_MEDIA_TYPE, bytes, digest: bytesDigest(bytes) };
517
+ const manifest = bundleReferrerManifest(bundle, s.predicateType, subject);
518
+ const digest = bytesDigest(manifest);
519
+ await registry.pushBlob(bytesDigest(EMPTY_CONFIG.bytes), () => EMPTY_CONFIG.bytes);
520
+ await registry.pushBlob(bundle.digest, () => bundle.bytes);
521
+ const listed = await registry.putManifest(digest, IMAGE_MANIFEST, manifest);
522
+ if (!listed) {
523
+ await registry.addToReferrersTag(layout.top.digest, {
524
+ mediaType: IMAGE_MANIFEST,
525
+ digest,
526
+ size: manifest.byteLength,
527
+ artifactType: SIGSTORE_BUNDLE_MEDIA_TYPE,
528
+ annotations: { "dev.sigstore.bundle.content": "dsse-envelope", [BUNDLE_PREDICATE_ANNOTATION]: s.predicateType },
529
+ });
530
+ }
531
+ items.push(signatureItem(ctx, s, layout.top.digest, digest));
532
+ }
533
+ return items;
534
+ };
386
535
  const connect = (ctx) => {
387
536
  const cred = ociCredential(decl, repo, ctx);
388
537
  return { cred, registry: new Registry(repo, fetchImpl, cred, ctx, deps.sleep) };
389
538
  };
539
+ /** The image's digest among a release's recorded items: the one item that is not an attachment. */
540
+ const imageDigest = (items) => items.find((i) => i.attachment === undefined && i.digest)?.digest;
390
541
  return {
542
+ /** #5165: the repository; what the image bundles is not read from it, so a member names that with `release.dependsOn`. */
543
+ async names() {
544
+ return { provides: [trainName("oci", decl.repository)], needs: [] };
545
+ },
546
+ /** #5165: whether each tag that names the label is there; null when no declared tag names it. */
547
+ async published(ctx) {
548
+ const label = ctx.label;
549
+ if (label === null)
550
+ return null;
551
+ const tags = (decl.tags ?? ["{label}"]).filter((t) => t.includes("{label}")).map((t) => t.split("{label}").join(label));
552
+ if (tags.length === 0)
553
+ return null;
554
+ const { registry } = connect(ctx);
555
+ for (const t of tags)
556
+ if ((await registry.getManifest(t)) === null)
557
+ return false;
558
+ return true;
559
+ },
560
+ /** #5165: wait until each tag the reveal moved names the image's digest. */
561
+ async visible(ctx, published) {
562
+ const digest = imageDigest(published.items);
563
+ const tags = ociTags(decl, ctx);
564
+ if (!digest || tags.length === 0)
565
+ return;
566
+ const { registry } = connect(ctx);
567
+ await waitUntilServed(ctx, deps, {
568
+ what: decl.repository,
569
+ code: "publish-oci-not-served",
570
+ check: async () => {
571
+ const missing = [];
572
+ for (const t of tags)
573
+ if ((await registry.getManifest(t))?.digest !== digest)
574
+ missing.push(`${decl.repository}:${t}`);
575
+ return missing;
576
+ },
577
+ });
578
+ },
579
+ /**
580
+ * #5163: a registry has no deprecation, so deprecate does nothing here. A
581
+ * yank points each moving tag that names this release's digest at the
582
+ * head release's; a restore points them back when this release is the
583
+ * head. The label's own tag stays, since a registry need not delete a tag.
584
+ */
585
+ async setStatus(ctx) {
586
+ if (ctx.status === "deprecated")
587
+ return [{ what: `${decl.repository} unchanged: a registry has no deprecation; yank moves its tags` }];
588
+ const ours = imageDigest(ctx.revealed);
589
+ if (!ours)
590
+ return [{ what: `${decl.repository} unchanged: the publish record names no image digest`, already: true }];
591
+ const tags = ociMovingTags(decl, ctx.tag, ctx.label);
592
+ if (tags.length === 0)
593
+ return [{ what: `${decl.repository} unchanged: every tag the target moves names the label, so none moves`, already: true }];
594
+ const isHead = ctx.head?.releaseDigest === ctx.release.releaseDigest;
595
+ if (ctx.status === "active" && !isHead)
596
+ return [{ what: `${decl.repository} ${tags.join(", ")} unchanged: a newer active release holds them`, already: true }];
597
+ const to = ctx.status === "active" ? ours : ctx.head ? imageDigest(ctx.head.items) : undefined;
598
+ const actions = [];
599
+ if (!to) {
600
+ for (const t of tags) {
601
+ actions.push({
602
+ what: `${decl.repository}:${t} stays where it is`,
603
+ refused: { code: "release-status-no-previous", message: `no earlier active release of this channel was pushed to ${decl.repository}, so ${t} has nowhere to move back to`, fix: "Cut and publish a release to move it to, or restore an earlier one." },
604
+ });
605
+ }
606
+ return actions;
607
+ }
608
+ if (!ctx.apply)
609
+ return tags.map((t) => ({ what: ctx.status === "active" ? `point ${decl.repository}:${t} at ${ours}` : `point ${decl.repository}:${t} at ${to}, if it names ${ours}` }));
610
+ const { registry } = connect(ctx);
611
+ let manifest;
612
+ for (const t of tags) {
613
+ const now = await registry.getManifest(t);
614
+ if (now?.digest === to || (ctx.status === "yanked" && now?.digest !== ours)) {
615
+ actions.push({ what: `${decl.repository}:${t} names ${now?.digest ?? "nothing"}; not moved`, already: true });
616
+ continue;
617
+ }
618
+ manifest ?? (manifest = await registry.getManifest(to));
619
+ if (!manifest)
620
+ throw new PublishTargetError("release-status-oci-failed", `${decl.repository} no longer holds ${to}, so ${t} can't point at it`);
621
+ await registry.putManifest(t, manifest.mediaType, manifest.bytes);
622
+ ctx.log(`tagged ${to} ${t}`);
623
+ actions.push({ what: `point ${decl.repository}:${t} at ${to}` });
624
+ }
625
+ return actions;
626
+ },
391
627
  kind: "oci",
392
628
  name: `oci ${decl.repository}`,
393
629
  destination: decl.repository,
@@ -396,7 +632,7 @@ export function ociTarget(decl, deps) {
396
632
  async plan(ctx) {
397
633
  const layout = inspect(ctx);
398
634
  try {
399
- return [item(ctx, layout.top.digest), ...referrers(ctx, layout).map(referrerItem)];
635
+ return [item(ctx, layout.top.digest), ...referrers(ctx, layout).map(referrerItem), ...(ctx.signing ? signatures.map((s) => signatureItem(ctx, s, layout.top.digest)) : [])];
400
636
  }
401
637
  finally {
402
638
  layout.cleanup();
@@ -439,13 +675,15 @@ export function ociTarget(decl, deps) {
439
675
  await registry.putManifest(r.digest, IMAGE_MANIFEST, r.manifest);
440
676
  items.push(referrerItem(r));
441
677
  }
678
+ // #5164: signed in the stage, so no tag points at an image before its signature is there.
679
+ items.push(...(await sign(ctx, registry, layout)));
442
680
  return { target: this.name, destination: this.destination, items, state: {} };
443
681
  }
444
682
  finally {
445
683
  layout.cleanup();
446
684
  }
447
685
  },
448
- async reveal(ctx) {
686
+ async reveal(ctx, staged) {
449
687
  const layout = inspect(ctx);
450
688
  try {
451
689
  const { registry } = connect(ctx);
@@ -453,7 +691,8 @@ export function ociTarget(decl, deps) {
453
691
  for (const t of tags)
454
692
  await registry.putManifest(t, layout.top.mediaType, layout.top.bytes);
455
693
  ctx.log(tags.length > 0 ? `tagged ${layout.top.digest} ${tags.join(", ")}` : `no tag to point at ${layout.top.digest}`);
456
- return { target: this.name, destination: this.destination, items: [item(ctx, layout.top.digest), ...referrers(ctx, layout).map(referrerItem)] };
694
+ const signed = (staged?.items ?? []).filter((i) => i.attachment === "signature" || i.attachment === "attestation").map(({ present: _present, ...i }) => i);
695
+ return { target: this.name, destination: this.destination, items: [item(ctx, layout.top.digest), ...referrers(ctx, layout).map(referrerItem), ...signed] };
457
696
  }
458
697
  finally {
459
698
  layout.cleanup();
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The package files a registry target names (#5232): files, directories of
3
+ * them, and `artifact:<name>` for the files the release records for a
4
+ * `release.artifacts` entry, as the nuget and rubygems targets take them.
5
+ */
6
+ import { type PublishContext } from "./release-publish.js";
7
+ /**
8
+ * Each file `entries` names, in order: a file as it is, a directory as every
9
+ * file in it whose name ends in `ext`, in name order, and `artifact:<name>` as
10
+ * the release's paths for it. A directory with none is refused with
11
+ * `<code>-no-files`, a file name given twice with `<code>-duplicate-file`.
12
+ */
13
+ export declare function packageFiles(ctx: Pick<PublishContext, "cwd" | "release">, entries: readonly string[], ext: string, code: string, buildFix: string): Array<{
14
+ path: string;
15
+ abs: string;
16
+ }>;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The package files a registry target names (#5232): files, directories of
3
+ * them, and `artifact:<name>` for the files the release records for a
4
+ * `release.artifacts` entry, as the nuget and rubygems targets take them.
5
+ */
6
+ import { readdirSync, statSync } from "node:fs";
7
+ import { basename, join } from "node:path";
8
+ import { expandArtifactAssets, memberFile } from "./publish-targets.js";
9
+ import { PublishTargetError } from "./release-publish.js";
10
+ /**
11
+ * Each file `entries` names, in order: a file as it is, a directory as every
12
+ * file in it whose name ends in `ext`, in name order, and `artifact:<name>` as
13
+ * the release's paths for it. A directory with none is refused with
14
+ * `<code>-no-files`, a file name given twice with `<code>-duplicate-file`.
15
+ */
16
+ export function packageFiles(ctx, entries, ext, code, buildFix) {
17
+ const out = [];
18
+ const seen = new Set();
19
+ const add = (path) => {
20
+ const abs = memberFile(ctx.cwd, path);
21
+ if (seen.has(basename(abs)))
22
+ throw new PublishTargetError(`${code}-duplicate-file`, `${basename(abs)} is named twice`, "Name each file once.");
23
+ seen.add(basename(abs));
24
+ out.push({ path, abs });
25
+ };
26
+ for (const entry of expandArtifactAssets(ctx.release, entries)) {
27
+ const abs = memberFile(ctx.cwd, entry);
28
+ if (statSync(abs).isDirectory()) {
29
+ const found = readdirSync(abs).filter((f) => f.endsWith(ext) && statSync(join(abs, f)).isFile()).sort();
30
+ if (found.length === 0)
31
+ throw new PublishTargetError(`${code}-no-files`, `${entry} holds no ${ext} file`, buildFix);
32
+ for (const f of found)
33
+ add(join(entry, f));
34
+ }
35
+ else
36
+ add(entry);
37
+ }
38
+ return out;
39
+ }
@@ -0,0 +1,138 @@
1
+ /**
2
+ * The PyPI target (#5167): built wheels and sdists uploaded to PyPI, TestPyPI
3
+ * or another index that takes PyPI's upload API.
4
+ *
5
+ * The files are the ones the build wrote, named one by one, by their
6
+ * directory, or as `artifact:<name>` for the files the release records for a
7
+ * `release.artifacts` entry. Each file that the release records must match
8
+ * its digest. The project's name and version are read from the file's own
9
+ * metadata: `<name>.dist-info/METADATA` in a wheel, `PKG-INFO` in an sdist.
10
+ *
11
+ * An index has no draft: a file is visible as soon as it is uploaded, and a
12
+ * file name can never be uploaded again. So the stage uploads nothing. It
13
+ * checks what it can without changing anything: the files and their
14
+ * digests, the credential, and which files the index already serves, read
15
+ * from its simple API (PEP 691 JSON, or PEP 503 HTML). A file the index
16
+ * serves with the same SHA-256 is `present`; one it serves with another is
17
+ * refused (`publish-pypi-file-exists`). The reveal uploads the rest, after
18
+ * reading the simple API again, so a reveal run again after an upload whose
19
+ * record was lost sends nothing twice. Nothing is out between the stage and
20
+ * the reveal, so a check of what staged can't see this target.
21
+ *
22
+ * Credentials:
23
+ *
24
+ * - `auth: "token"`: an API token from `tokenEnv` (default `PYPI_TOKEN`, or
25
+ * `TEST_PYPI_TOKEN` for TestPyPI), sent as the password of user
26
+ * `__token__`, or of the user in `usernameEnv`.
27
+ * - `auth: "trusted-publishing"`, PyPI and TestPyPI only: the run's OIDC ID
28
+ * token, from GitHub Actions or from `PYPI_ID_TOKEN` (a GitLab job's
29
+ * `id_tokens`), with the audience the index names at `/_/oidc/audience`,
30
+ * is exchanged at `/_/oidc/mint-token` for an upload token that lasts
31
+ * minutes. The stage makes the exchange to check that the index takes this
32
+ * workflow as a trusted publisher of the project, and drops the token; the
33
+ * reveal exchanges again for the upload.
34
+ *
35
+ * Unset, `auth` is a token when the token's variable is set, else trusted
36
+ * publishing when the run has an OIDC ID token.
37
+ *
38
+ * A wheel carries its SBOM in `.dist-info/sboms/` (PEP 770), since an index
39
+ * keeps no file beside a distribution. Under the `supply-chain` group a wheel
40
+ * without one is refused (`publish-sbom-missing`) unless `sbom` is `false`.
41
+ * The PEP 740 attestations beside each file (`<file>.<name>.attestation`, as
42
+ * `pypi-attestations sign` writes them) are uploaded with it. When the
43
+ * publish signs with Sigstore (`release.signing` or `supply-chain`, #5164)
44
+ * and uploads by trusted publishing, the stage signs a publish attestation
45
+ * (`https://docs.pypi.org/attestations/publish/v1`) for each file that has
46
+ * none beside it, keeps it in the publish record's state, and the reveal
47
+ * uploads it. PyPI takes attestations only from a trusted publisher, so
48
+ * under a token nothing is signed and the stage says so.
49
+ */
50
+ import type { PypiPublishDeclaration } from "./publish-declaration.js";
51
+ import type { InTotoStatement } from "./publish-signing.js";
52
+ import { type PublishDeps, type PublishTarget } from "./release-publish.js";
53
+ /** The first chant that publishes a `pypi` target (#5167). */
54
+ export declare const PUBLISH_PYPI_FLOOR = "0.124.101";
55
+ /** The variable an OIDC ID token for PyPI is read from outside GitHub Actions, as PyPI's docs name it for GitLab. */
56
+ export declare const PYPI_ID_TOKEN_ENV = "PYPI_ID_TOKEN";
57
+ /** Where each named index is. */
58
+ export declare const PYPI_INDEXES: {
59
+ readonly pypi: {
60
+ readonly label: "PyPI";
61
+ readonly site: "https://pypi.org";
62
+ readonly upload: "https://upload.pypi.org/legacy/";
63
+ readonly simple: "https://pypi.org/simple/";
64
+ readonly tokenEnv: "PYPI_TOKEN";
65
+ };
66
+ readonly testpypi: {
67
+ readonly label: "TestPyPI";
68
+ readonly site: "https://test.pypi.org";
69
+ readonly upload: "https://test.pypi.org/legacy/";
70
+ readonly simple: "https://test.pypi.org/simple/";
71
+ readonly tokenEnv: "TEST_PYPI_TOKEN";
72
+ };
73
+ };
74
+ /** The index a declaration uploads to: a named one, or another with its own URLs and no trusted publishing. */
75
+ export declare function pypiIndex(decl: Pick<PypiPublishDeclaration, "index" | "uploadUrl" | "simpleUrl">): {
76
+ label: string;
77
+ site: string | null;
78
+ upload: string;
79
+ simple: string;
80
+ tokenEnv: string;
81
+ };
82
+ /** The variable the declaration's token is read from. */
83
+ export declare function pypiTokenEnv(decl: Pick<PypiPublishDeclaration, "index" | "uploadUrl" | "simpleUrl" | "tokenEnv">): string;
84
+ /** How the target authenticates in `env`: the declared `auth`, else a token when its variable is set, else trusted publishing when the run has an OIDC ID token on PyPI or TestPyPI. */
85
+ export declare function pypiAuth(decl: PypiPublishDeclaration, env: NodeJS.ProcessEnv): "token" | "trusted-publishing";
86
+ /** A project name as the simple API keys it (PEP 503). */
87
+ export declare function normalizeProjectName(name: string): string;
88
+ /** The names of a zip archive's entries. */
89
+ export declare function zipEntryNames(zip: Buffer): string[];
90
+ /** One file of a zip archive, or null. Reads stored and deflated entries. */
91
+ export declare function zipEntry(zip: Buffer, name: string): Buffer | null;
92
+ /** Each entry of a tar archive, by name, with its bytes: ustar names with their prefix, and pax and GNU long names. */
93
+ export declare function tarEntries(tar: Buffer): Map<string, Buffer>;
94
+ /** A distribution's core metadata (RFC 822 headers, then the description as the body). */
95
+ export declare function parseCoreMetadata(text: string): {
96
+ fields: Array<[string, string]>;
97
+ name: string | null;
98
+ version: string | null;
99
+ metadataVersion: string | null;
100
+ };
101
+ /** One wheel or sdist, read. */
102
+ export interface PypiDistribution {
103
+ path: string;
104
+ abs: string;
105
+ file: string;
106
+ bytes: Buffer;
107
+ digest: string;
108
+ filetype: "bdist_wheel" | "sdist";
109
+ pyversion: string;
110
+ name: string;
111
+ version: string;
112
+ metadata: Array<[string, string]>;
113
+ /** The SBOM entry a wheel carries (PEP 770), if any. */
114
+ sbom: string | null;
115
+ /** The PEP 740 attestations beside it, and one the stage signed (`signed`). */
116
+ attestations: Array<{
117
+ path: string;
118
+ text: string;
119
+ digest: string;
120
+ signed?: boolean;
121
+ }>;
122
+ }
123
+ /** Read one distribution file. */
124
+ export declare function readDistribution(path: string, abs: string): Omit<PypiDistribution, "attestations">;
125
+ /** The predicate type of a PyPI publish attestation (PEP 740). */
126
+ export declare const PYPI_PUBLISH_PREDICATE = "https://docs.pypi.org/attestations/publish/v1";
127
+ /** The in-toto statement a PyPI publish attestation signs: the file's name and SHA-256. */
128
+ export declare function pypiPublishStatement(file: string, digest: string): InTotoStatement;
129
+ /**
130
+ * A PEP 740 attestation from a Sigstore bundle (v0.3) over a DSSE envelope,
131
+ * as `pypi_attestations.Attestation.from_bundle` makes it: the signing
132
+ * certificate and transparency log entries, and the envelope's statement and
133
+ * signature.
134
+ */
135
+ export declare function pep740FromBundle(bundle: Uint8Array): Record<string, unknown>;
136
+ export declare function pypiTarget(decl: PypiPublishDeclaration, deps: PublishDeps): PublishTarget;
137
+ /** The project name the member builds, for the doctor: from a built distribution, else `[project] name` in `pyproject.toml`. */
138
+ export declare function pypiProjectName(cwd: string, files: readonly string[]): string | null;