@adea-ai/app-framework 0.0.0-stage → 0.24.1

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 (358) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +30 -0
  3. package/README.md +1009 -2
  4. package/dist/app/application.d.ts +47 -0
  5. package/dist/app/application.js +115 -0
  6. package/dist/app/create-application.d.ts +13 -0
  7. package/dist/app/create-application.js +178 -0
  8. package/dist/app/service-registry.d.ts +44 -0
  9. package/dist/app/service-registry.js +116 -0
  10. package/dist/appearance/appearance-host.d.ts +62 -0
  11. package/dist/appearance/appearance-host.js +115 -0
  12. package/dist/appearance/appearance-preferences.d.ts +106 -0
  13. package/dist/appearance/appearance-preferences.js +175 -0
  14. package/dist/appearance/composition.d.ts +11 -0
  15. package/dist/appearance/composition.js +16 -0
  16. package/dist/appearance/custom-theme-import.d.ts +14 -0
  17. package/dist/appearance/custom-theme-import.js +315 -0
  18. package/dist/appearance/custom-theme-library.d.ts +146 -0
  19. package/dist/appearance/custom-theme-library.js +378 -0
  20. package/dist/appearance/editor.d.ts +20 -0
  21. package/dist/appearance/editor.js +47 -0
  22. package/dist/appearance/theme-file-importer.d.ts +23 -0
  23. package/dist/appearance/theme-file-importer.js +66 -0
  24. package/dist/appearance/theme-record-adapter.d.ts +26 -0
  25. package/dist/appearance/theme-record-adapter.js +64 -0
  26. package/dist/appearance/theme-registry.d.ts +10 -0
  27. package/dist/appearance/theme-registry.js +16 -0
  28. package/dist/appearance/window-surface.d.ts +5 -0
  29. package/dist/appearance/window-surface.js +9 -0
  30. package/dist/ci/toolchain-identity.d.ts +39 -0
  31. package/dist/ci/toolchain-identity.js +196 -0
  32. package/dist/cli/cef-helper-cli.d.ts +2 -0
  33. package/dist/cli/cef-helper-cli.js +18 -0
  34. package/dist/cli/cli-runner.d.ts +8 -0
  35. package/dist/cli/cli-runner.js +23 -0
  36. package/dist/cli/create-application-cli.d.ts +2 -0
  37. package/dist/cli/create-application-cli.js +40 -0
  38. package/dist/cli/electrobun-shortcut-patch-cli.d.ts +2 -0
  39. package/dist/cli/electrobun-shortcut-patch-cli.js +17 -0
  40. package/dist/cli/framework-update-cli.d.ts +2 -0
  41. package/dist/cli/framework-update-cli.js +40 -0
  42. package/dist/cli/release-assets-plan-cli.d.ts +2 -0
  43. package/dist/cli/release-assets-plan-cli.js +14 -0
  44. package/dist/cli/release-cut-cli.d.ts +2 -0
  45. package/dist/cli/release-cut-cli.js +27 -0
  46. package/dist/cli/release-descriptor-staging-cli.d.ts +2 -0
  47. package/dist/cli/release-descriptor-staging-cli.js +45 -0
  48. package/dist/cli/release-finalize-cli.d.ts +1 -0
  49. package/dist/cli/release-finalize-cli.js +30 -0
  50. package/dist/cli/release-promote-cli.d.ts +2 -0
  51. package/dist/cli/release-promote-cli.js +32 -0
  52. package/dist/cli/release-publish-cli.d.ts +2 -0
  53. package/dist/cli/release-publish-cli.js +48 -0
  54. package/dist/cli/release-sign-cli.d.ts +2 -0
  55. package/dist/cli/release-sign-cli.js +13 -0
  56. package/dist/cli/release-step-cli.d.ts +2 -0
  57. package/dist/cli/release-step-cli.js +44 -0
  58. package/dist/cli/toolchain-identity-cli.d.ts +2 -0
  59. package/dist/cli/toolchain-identity-cli.js +10 -0
  60. package/dist/cli/update-helper-cli.d.ts +1 -0
  61. package/dist/cli/update-helper-cli.js +10 -0
  62. package/dist/cli/windows-runtime-patch-cli.d.ts +2 -0
  63. package/dist/cli/windows-runtime-patch-cli.js +17 -0
  64. package/dist/desktop/application-command-client.d.ts +15 -0
  65. package/dist/desktop/application-command-client.js +21 -0
  66. package/dist/desktop/channel-handshake.d.ts +32 -0
  67. package/dist/desktop/channel-handshake.js +111 -0
  68. package/dist/desktop/channel-proof.d.ts +43 -0
  69. package/dist/desktop/channel-proof.js +85 -0
  70. package/dist/desktop/client-assets.d.ts +7 -0
  71. package/dist/desktop/client-assets.js +59 -0
  72. package/dist/desktop/desktop-client.d.ts +23 -0
  73. package/dist/desktop/desktop-client.js +231 -0
  74. package/dist/desktop/desktop-gateway.d.ts +18 -0
  75. package/dist/desktop/desktop-gateway.js +146 -0
  76. package/dist/desktop/desktop-host.d.ts +48 -0
  77. package/dist/desktop/desktop-host.js +208 -0
  78. package/dist/desktop/desktop-stream.d.ts +36 -0
  79. package/dist/desktop/desktop-stream.js +231 -0
  80. package/dist/desktop/loopback-policy.d.ts +19 -0
  81. package/dist/desktop/loopback-policy.js +23 -0
  82. package/dist/desktop/open-url-channel.d.ts +15 -0
  83. package/dist/desktop/open-url-channel.js +55 -0
  84. package/dist/desktop/string-policy.d.ts +2 -0
  85. package/dist/desktop/string-policy.js +11 -0
  86. package/dist/framework-source.json +1 -0
  87. package/dist/installer/archive-entry.d.ts +6 -0
  88. package/dist/installer/archive-entry.js +14 -0
  89. package/dist/installer/command-artifact.d.ts +47 -0
  90. package/dist/installer/command-artifact.js +261 -0
  91. package/dist/installer/command-qualification-command.d.ts +12 -0
  92. package/dist/installer/command-qualification-command.js +71 -0
  93. package/dist/installer/hosted-runner.d.ts +4 -0
  94. package/dist/installer/hosted-runner.js +10 -0
  95. package/dist/installer/installed-payload.d.ts +29 -0
  96. package/dist/installer/installed-payload.js +312 -0
  97. package/dist/installer/installer-ci-bootstrap.d.ts +26 -0
  98. package/dist/installer/installer-ci-bootstrap.js +160 -0
  99. package/dist/installer/installer-ci-preflight.d.ts +1 -0
  100. package/dist/installer/installer-ci-preflight.js +49 -0
  101. package/dist/installer/installer-ci-worker.d.ts +1 -0
  102. package/dist/installer/installer-ci-worker.js +105 -0
  103. package/dist/installer/installer-extraction.d.ts +14 -0
  104. package/dist/installer/installer-extraction.js +289 -0
  105. package/dist/installer/installer-fetch-guard.d.ts +15 -0
  106. package/dist/installer/installer-fetch-guard.js +50 -0
  107. package/dist/installer/installer-identity.d.ts +23 -0
  108. package/dist/installer/installer-identity.js +286 -0
  109. package/dist/installer/installer-layout.d.ts +21 -0
  110. package/dist/installer/installer-layout.js +89 -0
  111. package/dist/installer/installer-observation.d.ts +64 -0
  112. package/dist/installer/installer-observation.js +473 -0
  113. package/dist/installer/installer-process-cleanup.d.ts +18 -0
  114. package/dist/installer/installer-process-cleanup.js +158 -0
  115. package/dist/installer/installer-qualification-command.d.ts +11 -0
  116. package/dist/installer/installer-qualification-command.js +71 -0
  117. package/dist/installer/installer-renderer-evidence.d.ts +43 -0
  118. package/dist/installer/installer-renderer-evidence.js +136 -0
  119. package/dist/installer/installer-upgrade-command.d.ts +37 -0
  120. package/dist/installer/installer-upgrade-command.js +172 -0
  121. package/dist/installer/installer-worker-guard.d.ts +21 -0
  122. package/dist/installer/installer-worker-guard.js +72 -0
  123. package/dist/installer/native-executable.d.ts +5 -0
  124. package/dist/installer/native-executable.js +21 -0
  125. package/dist/installer/upgrade-asset-download.d.ts +13 -0
  126. package/dist/installer/upgrade-asset-download.js +41 -0
  127. package/dist/installer/write-all.d.ts +6 -0
  128. package/dist/installer/write-all.js +11 -0
  129. package/dist/native/app-bundle.d.ts +28 -0
  130. package/dist/native/app-bundle.js +60 -0
  131. package/dist/native/cef-helper.d.ts +28 -0
  132. package/dist/native/cef-helper.js +402 -0
  133. package/dist/native/desktop-build-hook.d.ts +7 -0
  134. package/dist/native/desktop-build-hook.js +20 -0
  135. package/dist/native/electrobun-source-patch.d.ts +25 -0
  136. package/dist/native/electrobun-source-patch.js +93 -0
  137. package/dist/native/linux-cef-links.d.ts +2 -0
  138. package/dist/native/linux-cef-links.js +15 -0
  139. package/dist/native/native-secret-store.d.ts +27 -0
  140. package/dist/native/native-secret-store.js +70 -0
  141. package/dist/native/native-utilities.d.ts +24 -0
  142. package/dist/native/native-utilities.js +85 -0
  143. package/dist/native/partitioned-window.d.ts +34 -0
  144. package/dist/native/partitioned-window.js +44 -0
  145. package/dist/native/renderer-profile.d.ts +53 -0
  146. package/dist/native/renderer-profile.js +30 -0
  147. package/dist/native/secure-window.d.ts +38 -0
  148. package/dist/native/secure-window.js +77 -0
  149. package/dist/native/sidecar-services.d.ts +23 -0
  150. package/dist/native/sidecar-services.js +46 -0
  151. package/dist/native/sidecar.d.ts +81 -0
  152. package/dist/native/sidecar.js +250 -0
  153. package/dist/native/window-bootstrap.d.ts +24 -0
  154. package/dist/native/window-bootstrap.js +63 -0
  155. package/dist/native/window-options.d.ts +32 -0
  156. package/dist/native/window-options.js +23 -0
  157. package/dist/native/windows-build-hook-internal.d.ts +2 -0
  158. package/dist/native/windows-build-hook-internal.js +32 -0
  159. package/dist/native/windows-build-hook.d.ts +2 -0
  160. package/dist/native/windows-build-hook.js +12 -0
  161. package/dist/native/windows-runtime-patch-internal.d.ts +3 -0
  162. package/dist/native/windows-runtime-patch-internal.js +20 -0
  163. package/dist/native/windows-runtime-patch.d.ts +4 -0
  164. package/dist/native/windows-runtime-patch.js +12 -0
  165. package/dist/release/feed-release-cut.d.ts +23 -0
  166. package/dist/release/feed-release-cut.js +93 -0
  167. package/dist/release/feed-state.d.ts +25 -0
  168. package/dist/release/feed-state.js +81 -0
  169. package/dist/release/framework-package-publish.d.ts +21 -0
  170. package/dist/release/framework-package-publish.js +127 -0
  171. package/dist/release/framework-update.d.ts +30 -0
  172. package/dist/release/framework-update.js +139 -0
  173. package/dist/release/github-cli.d.ts +6 -0
  174. package/dist/release/github-cli.js +16 -0
  175. package/dist/release/github-release-assets.d.ts +3 -0
  176. package/dist/release/github-release-assets.js +24 -0
  177. package/dist/release/github-release-cut.d.ts +14 -0
  178. package/dist/release/github-release-cut.js +174 -0
  179. package/dist/release/github-release-lookup.d.ts +7 -0
  180. package/dist/release/github-release-lookup.js +29 -0
  181. package/dist/release/github-release-promotion.d.ts +10 -0
  182. package/dist/release/github-release-promotion.js +78 -0
  183. package/dist/release/github-release-provenance.d.ts +9 -0
  184. package/dist/release/github-release-provenance.js +27 -0
  185. package/dist/release/github-release-publisher.d.ts +9 -0
  186. package/dist/release/github-release-publisher.js +63 -0
  187. package/dist/release/github-release-qualification.d.ts +12 -0
  188. package/dist/release/github-release-qualification.js +80 -0
  189. package/dist/release/local-provenance.d.ts +24 -0
  190. package/dist/release/local-provenance.js +72 -0
  191. package/dist/release/local-release.d.ts +133 -0
  192. package/dist/release/local-release.js +387 -0
  193. package/dist/release/macos-dmg.d.ts +22 -0
  194. package/dist/release/macos-dmg.js +91 -0
  195. package/dist/release/release-artifact.d.ts +6 -0
  196. package/dist/release/release-artifact.js +38 -0
  197. package/dist/release/release-assets-plan.d.ts +14 -0
  198. package/dist/release/release-assets-plan.js +65 -0
  199. package/dist/release/release-config.d.ts +76 -0
  200. package/dist/release/release-config.js +180 -0
  201. package/dist/release/release-cut-command.d.ts +13 -0
  202. package/dist/release/release-cut-command.js +39 -0
  203. package/dist/release/release-cut.d.ts +54 -0
  204. package/dist/release/release-cut.js +76 -0
  205. package/dist/release/release-descriptor-staging.d.ts +34 -0
  206. package/dist/release/release-descriptor-staging.js +147 -0
  207. package/dist/release/release-finalize.d.ts +16 -0
  208. package/dist/release/release-finalize.js +104 -0
  209. package/dist/release/release-promotion-command.d.ts +12 -0
  210. package/dist/release/release-promotion-command.js +28 -0
  211. package/dist/release/release-promotion.d.ts +29 -0
  212. package/dist/release/release-promotion.js +57 -0
  213. package/dist/release/release-publication.d.ts +33 -0
  214. package/dist/release/release-publication.js +138 -0
  215. package/dist/release/release-publish-command.d.ts +7 -0
  216. package/dist/release/release-publish-command.js +91 -0
  217. package/dist/release/release-qualification.d.ts +106 -0
  218. package/dist/release/release-qualification.js +135 -0
  219. package/dist/release/release-staging.d.ts +9 -0
  220. package/dist/release/release-staging.js +61 -0
  221. package/dist/release/release-steps.d.ts +38 -0
  222. package/dist/release/release-steps.js +147 -0
  223. package/dist/release/retained-release-build.d.ts +19 -0
  224. package/dist/release/retained-release-build.js +122 -0
  225. package/dist/shell/app-shell.d.ts +61 -0
  226. package/dist/shell/app-shell.js +306 -0
  227. package/dist/shell/app-utilities.d.ts +122 -0
  228. package/dist/shell/app-utilities.js +334 -0
  229. package/dist/shell/application-menu-commands.d.ts +5 -0
  230. package/dist/shell/application-menu-commands.js +11 -0
  231. package/dist/shell/application-menu.d.ts +61 -0
  232. package/dist/shell/application-menu.js +208 -0
  233. package/dist/shell/help-shortcuts.d.ts +12 -0
  234. package/dist/shell/help-shortcuts.js +22 -0
  235. package/dist/shell/navigation-drawer.d.ts +12 -0
  236. package/dist/shell/navigation-drawer.js +42 -0
  237. package/dist/shell/settings-sections.d.ts +31 -0
  238. package/dist/shell/settings-sections.js +50 -0
  239. package/dist/shell/shortcut-platform.d.ts +17 -0
  240. package/dist/shell/shortcut-platform.js +25 -0
  241. package/dist/update-helper.bundle.js +260 -0
  242. package/dist/updates/channel-update-manager.d.ts +46 -0
  243. package/dist/updates/channel-update-manager.js +114 -0
  244. package/dist/updates/desktop-updater.d.ts +104 -0
  245. package/dist/updates/desktop-updater.js +345 -0
  246. package/dist/updates/release-feed.d.ts +61 -0
  247. package/dist/updates/release-feed.js +111 -0
  248. package/dist/updates/release-location.d.ts +9 -0
  249. package/dist/updates/release-location.js +80 -0
  250. package/dist/updates/release-version.d.ts +12 -0
  251. package/dist/updates/release-version.js +43 -0
  252. package/dist/updates/signed-release.d.ts +63 -0
  253. package/dist/updates/signed-release.js +162 -0
  254. package/dist/updates/stable-file.d.ts +10 -0
  255. package/dist/updates/stable-file.js +22 -0
  256. package/dist/updates/update-adapter.d.ts +57 -0
  257. package/dist/updates/update-adapter.js +72 -0
  258. package/dist/updates/update-arm.d.ts +24 -0
  259. package/dist/updates/update-arm.js +95 -0
  260. package/dist/updates/update-channel-store.d.ts +8 -0
  261. package/dist/updates/update-channel-store.js +72 -0
  262. package/dist/updates/update-discovery.d.ts +13 -0
  263. package/dist/updates/update-discovery.js +56 -0
  264. package/dist/updates/update-download.d.ts +14 -0
  265. package/dist/updates/update-download.js +67 -0
  266. package/dist/updates/update-exclusive-rename.d.ts +2 -0
  267. package/dist/updates/update-exclusive-rename.js +52 -0
  268. package/dist/updates/update-extraction.d.ts +18 -0
  269. package/dist/updates/update-extraction.js +183 -0
  270. package/dist/updates/update-handoff-plan.d.ts +22 -0
  271. package/dist/updates/update-handoff-plan.js +28 -0
  272. package/dist/updates/update-helper.d.ts +24 -0
  273. package/dist/updates/update-helper.js +56 -0
  274. package/dist/updates/update-launch.d.ts +5 -0
  275. package/dist/updates/update-launch.js +27 -0
  276. package/dist/updates/update-manager.d.ts +40 -0
  277. package/dist/updates/update-manager.js +83 -0
  278. package/dist/updates/update-process-fence.d.ts +10 -0
  279. package/dist/updates/update-process-fence.js +114 -0
  280. package/dist/updates/update-resume.d.ts +13 -0
  281. package/dist/updates/update-resume.js +34 -0
  282. package/dist/updates/update-shutdown.d.ts +15 -0
  283. package/dist/updates/update-shutdown.js +29 -0
  284. package/dist/updates/update-state.d.ts +30 -0
  285. package/dist/updates/update-state.js +18 -0
  286. package/dist/updates/update-swap-stage.d.ts +27 -0
  287. package/dist/updates/update-swap-stage.js +58 -0
  288. package/dist/updates/update-swap.d.ts +10 -0
  289. package/dist/updates/update-swap.js +30 -0
  290. package/dist/views/app-about.d.ts +22 -0
  291. package/dist/views/app-about.js +43 -0
  292. package/dist/views/app-appearance.d.ts +11 -0
  293. package/dist/views/app-appearance.js +42 -0
  294. package/dist/views/app-help.d.ts +17 -0
  295. package/dist/views/app-help.js +42 -0
  296. package/dist/views/app-settings.d.ts +26 -0
  297. package/dist/views/app-settings.js +97 -0
  298. package/dist/views/appearance-surface.d.ts +9 -0
  299. package/dist/views/appearance-surface.js +334 -0
  300. package/dist/views/update-surface.d.ts +34 -0
  301. package/dist/views/update-surface.js +64 -0
  302. package/package.json +374 -4
  303. package/src/app/application.tsx +138 -0
  304. package/src/appearance/appearance-host.tsx +205 -0
  305. package/src/appearance/appearance-preferences.ts +287 -0
  306. package/src/appearance/composition.ts +29 -0
  307. package/src/appearance/custom-theme-import.ts +424 -0
  308. package/src/appearance/custom-theme-library.ts +600 -0
  309. package/src/appearance/editor.ts +94 -0
  310. package/src/appearance/theme-file-importer.ts +103 -0
  311. package/src/appearance/theme-record-adapter.ts +106 -0
  312. package/src/appearance/theme-registry.ts +20 -0
  313. package/src/appearance/window-surface.ts +18 -0
  314. package/src/desktop/client-assets.ts +75 -0
  315. package/src/native/electrobun-cef-main-frame-bridges.patch +63 -0
  316. package/src/native/electrobun-windows-shortcut-com.patch +923 -0
  317. package/src/native/renderer-profile.ts +27 -0
  318. package/src/native/window-options.ts +24 -0
  319. package/src/shell/app-shell.tsx +294 -0
  320. package/src/shell/app-utilities.tsx +437 -0
  321. package/src/shell/help-shortcuts.ts +24 -0
  322. package/src/shell/navigation-drawer.tsx +36 -0
  323. package/src/shell/settings-sections.ts +74 -0
  324. package/src/shell/shortcut-platform.ts +35 -0
  325. package/src/updates/release-version.ts +57 -0
  326. package/src/updates/update-adapter.ts +129 -0
  327. package/src/updates/update-state.ts +34 -0
  328. package/src/views/app-about.tsx +44 -0
  329. package/src/views/app-appearance.tsx +32 -0
  330. package/src/views/app-help.tsx +43 -0
  331. package/src/views/app-settings.tsx +88 -0
  332. package/src/views/appearance-surface.tsx +427 -0
  333. package/src/views/update-surface.tsx +85 -0
  334. package/templates/application/.gitattributes +1 -0
  335. package/templates/application/.github/workflows/release-assets.yml +29 -0
  336. package/templates/application/.github/workflows/release-finalize.yml +29 -0
  337. package/templates/application/.github/workflows/release-please.yml +19 -0
  338. package/templates/application/.github/workflows/release.yml +29 -0
  339. package/templates/application/.github/workflows/validation.yml +28 -0
  340. package/templates/application/.oxfmtrc.json +6 -0
  341. package/templates/application/.oxlintrc.json +48 -0
  342. package/templates/application/.release-please-manifest.json +3 -0
  343. package/templates/application/README.md +47 -0
  344. package/templates/application/electrobun.config.ts +22 -0
  345. package/templates/application/release-please-config.json +12 -0
  346. package/templates/application/scripts/app-version.ts +9 -0
  347. package/templates/application/scripts/build-desktop.ts +34 -0
  348. package/templates/application/scripts/secure-build.ts +1 -0
  349. package/templates/application/scripts/stage-release.ts +21 -0
  350. package/templates/application/src/bun/index.ts +80 -0
  351. package/templates/application/src/electrobun.d.ts +27 -0
  352. package/templates/application/src/web/index.html +12 -0
  353. package/templates/application/src/web/main.tsx +97 -0
  354. package/templates/application/src/web/public/icon.svg +1 -0
  355. package/templates/application/src/web/style.css +3 -0
  356. package/templates/application/tests/app-config.test.ts +9 -0
  357. package/templates/application/tsconfig.json +15 -0
  358. package/templates/application/vite.config.ts +10 -0
@@ -0,0 +1,29 @@
1
+ // src/release/github-release-lookup.ts
2
+ /** GitHub's release-by-tag endpoint omits drafts, so inspect bounded listings when opted in. */
3
+ async function lookupRelease(options) {
4
+ const { tag, base, read } = options;
5
+ try {
6
+ const result = await read(`${base}/releases/tags/${encodeURIComponent(tag)}`);
7
+ if (typeof result !== "object" || result === null || Array.isArray(result)) throw new Error("Invalid release response");
8
+ return result;
9
+ } catch (error) {
10
+ const detail = error;
11
+ if (!/\bHTTP 404\b/.test(String(detail?.stderr ?? detail?.message ?? ""))) throw error;
12
+ }
13
+ if (!options.includeDraft) return null;
14
+ let match = null;
15
+ for (let page = 1; page <= 100; page++) {
16
+ const result = await read(`${base}/releases?per_page=100&page=${page}`);
17
+ if (!Array.isArray(result) || result.length > 100) throw new Error("Invalid release history");
18
+ for (const item of result) {
19
+ if (typeof item !== "object" || item === null || Array.isArray(item) || typeof item.tag_name !== "string") throw new Error("Invalid release history");
20
+ if (item.tag_name === tag) {
21
+ if (match) throw new Error("Duplicate release tag");
22
+ match = item;
23
+ }
24
+ }
25
+ if (result.length < 100) return match;
26
+ }
27
+ throw new Error("Release history exceeds inspection limit");
28
+ }
29
+ export { lookupRelease };
@@ -0,0 +1,10 @@
1
+ import type { Requirements } from './release-qualification';
2
+ import type { PromotionProvider } from './release-promotion';
3
+ /** GitHub release provider for a trusted workflow, using GH_TOKEN for gh. */
4
+ export declare function createGitHubPromotionProvider(options: {
5
+ repository: string;
6
+ requirements: (tag: string) => Requirements;
7
+ assetsWorkflow: string;
8
+ releasePleaseManifestPath: string;
9
+ run?: (args: string[], input?: string) => Promise<string>;
10
+ }): PromotionProvider;
@@ -0,0 +1,78 @@
1
+ import { githubCli } from "./github-cli.js";
2
+ import { assertRepositorySlug } from "../updates/signed-release.js";
3
+ import { qualifyGitHubRelease } from "./github-release-qualification.js";
4
+ // src/release/github-release-promotion.ts
5
+ function normalizePromotionRelease(value) {
6
+ if (typeof value !== "object" || value === null) throw new Error("Invalid GitHub release");
7
+ const item = value;
8
+ if (!Number.isSafeInteger(item.id) || typeof item.tag_name !== "string" || item.body !== null && typeof item.body !== "string" || typeof item.draft !== "boolean" || typeof item.prerelease !== "boolean" || typeof item.published_at !== "string") throw new Error("Invalid GitHub release");
9
+ return {
10
+ id: item.id,
11
+ tag: item.tag_name,
12
+ body: typeof item.body === "string" ? item.body : "",
13
+ draft: item.draft,
14
+ prerelease: item.prerelease,
15
+ publishedAt: item.published_at
16
+ };
17
+ }
18
+ /** GitHub release provider for a trusted workflow, using GH_TOKEN for gh. */
19
+ function createGitHubPromotionProvider(options) {
20
+ const repository = options.repository;
21
+ assertRepositorySlug(repository);
22
+ const run = options.run ?? githubCli();
23
+ const base = `repos/${repository}`;
24
+ const read = async (path) => JSON.parse(await run(["api", path]));
25
+ const qualify = async (release) => {
26
+ await qualifyGitHubRelease({
27
+ repository,
28
+ tag: release.tag,
29
+ requirements: options.requirements(release.tag),
30
+ assetsWorkflow: options.assetsWorkflow,
31
+ releasePleaseManifestPath: options.releasePleaseManifestPath,
32
+ run
33
+ });
34
+ return true;
35
+ };
36
+ return {
37
+ async list() {
38
+ const releases = [];
39
+ for (let page = 1; page <= 100; page++) {
40
+ const data = await read(`${base}/releases?per_page=100&page=${page}`);
41
+ if (!Array.isArray(data)) throw new Error("Invalid GitHub release listing");
42
+ for (const item of data) {
43
+ if (typeof item !== "object" || item === null || typeof item.draft !== "boolean") throw new Error("Invalid GitHub release listing");
44
+ if (!item.draft) releases.push(normalizePromotionRelease(item));
45
+ }
46
+ if (data.length < 100) return releases;
47
+ }
48
+ throw new Error("Too many GitHub releases");
49
+ },
50
+ qualify,
51
+ async markStable(selected, at) {
52
+ const timestamp = new Date(at);
53
+ if (!Number.isFinite(timestamp.getTime())) throw new Error("Invalid promotion timestamp");
54
+ const current = normalizePromotionRelease(await read(`${base}/releases/tags/${encodeURIComponent(selected.tag)}`));
55
+ if (current.id !== selected.id || current.tag !== selected.tag || current.publishedAt !== selected.publishedAt || current.draft || current.body !== selected.body || current.prerelease !== selected.prerelease) throw new Error("Release changed during promotion");
56
+ await qualify(current);
57
+ const marker = `<!-- adea-stable:v1 ${current.tag} -->`;
58
+ const body = current.body.split(/\r?\n/).includes(marker) ? current.body : `${current.body}\n\n${marker}\n<!-- adea-stable-time:${timestamp.toISOString()} -->`;
59
+ await run([
60
+ "api",
61
+ `${base}/releases/${current.id}`,
62
+ "--method",
63
+ "PATCH",
64
+ "--input",
65
+ "-"
66
+ ], JSON.stringify({
67
+ prerelease: false,
68
+ make_latest: "true",
69
+ body
70
+ }));
71
+ const after = normalizePromotionRelease(await read(`${base}/releases/tags/${encodeURIComponent(current.tag)}`));
72
+ if (after.id !== current.id || after.draft || after.prerelease || !after.body.split(/\r?\n/).includes(marker)) throw new Error("Stable release update could not be verified");
73
+ const latest = normalizePromotionRelease(await read(`${base}/releases/latest`));
74
+ if (latest.id !== current.id || latest.tag !== current.tag) throw new Error("Latest stable release could not be verified");
75
+ }
76
+ };
77
+ }
78
+ export { createGitHubPromotionProvider };
@@ -0,0 +1,9 @@
1
+ /** Check the tag and source independently; legacy release notes are never rewritten. */
2
+ export declare function verifyReleaseProvenance(options: {
3
+ tag: string;
4
+ sourceSha: string;
5
+ body: string;
6
+ releasePleaseManifestPath: string;
7
+ read(path: string): Promise<unknown>;
8
+ base: string;
9
+ }): Promise<boolean>;
@@ -0,0 +1,27 @@
1
+ // src/release/github-release-provenance.ts
2
+ /** Check the tag and source independently; legacy release notes are never rewritten. */
3
+ async function verifyReleaseProvenance(options) {
4
+ const { tag, sourceSha, body, releasePleaseManifestPath, read, base } = options;
5
+ if (!/^[a-f0-9]{40}$/.test(sourceSha)) return false;
6
+ const lines = body.split(/\r?\n/);
7
+ const markers = lines.filter((line) => line.startsWith("adea-channel:"));
8
+ const sources = lines.filter((line) => line.startsWith("Source: "));
9
+ const kind = tag.includes("-dev.") ? "dev" : "daily";
10
+ if (kind === "dev" && markers.length === 1 && markers[0] === "adea-channel:dev" && sources.length === 1 && sources[0] === `Source: ${sourceSha}`) return true;
11
+ if (kind !== "daily" || markers.length || sources.length || !/^v(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/.test(tag) || !/^[A-Za-z0-9._/-]+\.json$/.test(releasePleaseManifestPath) || releasePleaseManifestPath.split("/").some((part) => !part || part === "." || part === "..")) return false;
12
+ const result = await read(`${base}/contents/${releasePleaseManifestPath.split("/").map(encodeURIComponent).join("/")}?ref=${sourceSha}`);
13
+ if (typeof result !== "object" || result === null || Array.isArray(result)) return false;
14
+ const data = result;
15
+ if (data.type !== "file" || data.encoding !== "base64" || !Number.isSafeInteger(data.size) || Number(data.size) < 1 || Number(data.size) > 262144 || typeof data.content !== "string" || data.content.length > 4e5) return false;
16
+ const encoded = data.content.replace(/\n/g, "");
17
+ if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(encoded)) return false;
18
+ const bytes = Buffer.from(encoded, "base64");
19
+ if (bytes.length !== data.size || bytes.toString("base64") !== encoded) return false;
20
+ try {
21
+ const manifest = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
22
+ return typeof manifest === "object" && manifest !== null && !Array.isArray(manifest) && manifest.version === tag.slice(1);
23
+ } catch {
24
+ return false;
25
+ }
26
+ }
27
+ export { verifyReleaseProvenance };
@@ -0,0 +1,9 @@
1
+ import type { ReleaseIdentity } from './release-qualification';
2
+ import type { ReleasePublisher } from './release-publication';
3
+ /** GitHub adapter; callers must run it in a trusted release job with GH_TOKEN. */
4
+ export declare function createGitHubReleasePublisher(options: {
5
+ repository: string;
6
+ identity: ReleaseIdentity;
7
+ releasePleaseManifestPath: string;
8
+ run?: (args: string[]) => Promise<string>;
9
+ }): ReleasePublisher;
@@ -0,0 +1,63 @@
1
+ import { githubCli } from "./github-cli.js";
2
+ import { listGitHubReleaseAssets } from "./github-release-assets.js";
3
+ import { verifyReleaseProvenance } from "./github-release-provenance.js";
4
+ import { lookupRelease } from "./github-release-lookup.js";
5
+ import { isRepositorySlug } from "../updates/signed-release.js";
6
+ // src/release/github-release-publisher.ts
7
+ /** GitHub adapter; callers must run it in a trusted release job with GH_TOKEN. */
8
+ function createGitHubReleasePublisher(options) {
9
+ const { repository, identity } = options;
10
+ if (!isRepositorySlug(repository) || identity.tag.length > 65 || !/^v[0-9]+\.[0-9]+\.[0-9]+(?:-dev\.[0-9]+)?$/.test(identity.tag) || !/^[a-f0-9]{40}$/.test(identity.sourceSha) || !/^[a-f0-9]{40}$/.test(identity.workflowSha)) throw new Error("Invalid GitHub release identity");
11
+ const run = options.run ?? githubCli();
12
+ const base = `repos/${repository}`;
13
+ const read = async (path) => JSON.parse(await run(["api", path]));
14
+ return {
15
+ async inspect(selected) {
16
+ if (Object.keys(identity).some((key) => identity[key] !== selected[key])) throw new Error("Release identity changed");
17
+ const [releaseData, commitData, sourceComparison, workflowComparison] = await Promise.all([
18
+ lookupRelease({
19
+ tag: identity.tag,
20
+ base,
21
+ read,
22
+ includeDraft: true
23
+ }),
24
+ read(`${base}/commits/${encodeURIComponent(identity.tag)}`),
25
+ read(`${base}/compare/${identity.sourceSha}...main`),
26
+ read(`${base}/compare/${identity.workflowSha}...main`)
27
+ ]);
28
+ const release = releaseData;
29
+ const commit = commitData;
30
+ const source = sourceComparison;
31
+ const workflow = workflowComparison;
32
+ if (!release || typeof release.tag_name !== "string" || typeof release.draft !== "boolean" || typeof release.body !== "string") throw new Error("Invalid GitHub release response");
33
+ const assets = await listGitHubReleaseAssets(read, base, release.id);
34
+ const provenance = (!release.draft || !release.body.split(/\r?\n/).some((line) => line.startsWith("adea-channel:") || line.startsWith("Source: "))) && await verifyReleaseProvenance({
35
+ tag: identity.tag,
36
+ sourceSha: identity.sourceSha,
37
+ body: release.body,
38
+ releasePleaseManifestPath: options.releasePleaseManifestPath,
39
+ read,
40
+ base
41
+ });
42
+ return {
43
+ tag: release.tag_name,
44
+ sourceSha: typeof commit?.sha === "string" ? commit.sha : "",
45
+ sourceOnMain: provenance && ["ahead", "identical"].includes(String(source?.status)),
46
+ workflowOnMain: ["ahead", "identical"].includes(String(workflow?.status)),
47
+ draft: release.draft,
48
+ assets
49
+ };
50
+ },
51
+ async upload(path) {
52
+ await run([
53
+ "release",
54
+ "upload",
55
+ identity.tag,
56
+ path,
57
+ "--repo",
58
+ repository
59
+ ]);
60
+ }
61
+ };
62
+ }
63
+ export { createGitHubReleasePublisher };
@@ -0,0 +1,12 @@
1
+ import { type Qualification, type Requirements } from './release-qualification';
2
+ /** Verify immutable GitHub release assets and the exact successful workflow attempt. */
3
+ export declare function qualifyGitHubRelease(options: {
4
+ repository: string;
5
+ tag: string;
6
+ requirements: Requirements;
7
+ /** Caller release-assets workflow path every qualification run must come from. */
8
+ assetsWorkflow: string;
9
+ releasePleaseManifestPath: string;
10
+ allowDraft?: boolean;
11
+ run?: (args: string[]) => Promise<string>;
12
+ }): Promise<Qualification>;
@@ -0,0 +1,80 @@
1
+ import { githubCli } from "./github-cli.js";
2
+ import { validateQualificationRun, validateReleaseQualification } from "./release-qualification.js";
3
+ import { listGitHubReleaseAssets } from "./github-release-assets.js";
4
+ import { verifyReleaseProvenance } from "./github-release-provenance.js";
5
+ import { lookupRelease } from "./github-release-lookup.js";
6
+ import { isRepositorySlug } from "../updates/signed-release.js";
7
+ import { createHash } from "node:crypto";
8
+ // src/release/github-release-qualification.ts
9
+ /** Verify immutable GitHub release assets and the exact successful workflow attempt. */
10
+ async function qualifyGitHubRelease(options) {
11
+ const { repository, tag, requirements } = options;
12
+ if (!isRepositorySlug(repository) || tag.length > 65 || !/^v\d+\.\d+\.\d+(?:-dev\.\d+)?$/.test(tag)) throw new Error("Invalid release identity");
13
+ const run = options.run ?? githubCli();
14
+ const base = `repos/${repository}`;
15
+ const read = async (path) => JSON.parse(await run(["api", path]));
16
+ const [releaseData, commitData] = await Promise.all([lookupRelease({
17
+ tag,
18
+ base,
19
+ read,
20
+ includeDraft: options.allowDraft === true
21
+ }), read(`${base}/commits/${encodeURIComponent(tag)}`)]);
22
+ const release = releaseData;
23
+ const sourceSha = commitData?.sha;
24
+ if (!release || release.tag_name !== tag || release.draft !== false && !(release.draft === true && options.allowDraft === true) || typeof release.body !== "string" || release.draft === true && release.body.split(/\r?\n/).some((line) => line.startsWith("adea-channel:") || line.startsWith("Source: ")) || typeof sourceSha !== "string" || !await verifyReleaseProvenance({
25
+ tag,
26
+ sourceSha,
27
+ body: release.body,
28
+ releasePleaseManifestPath: options.releasePleaseManifestPath,
29
+ read,
30
+ base
31
+ })) throw new Error("Invalid release source");
32
+ const assets = await listGitHubReleaseAssets(read, base, release.id);
33
+ const pattern = /^qualification-([1-9]\d*)-([1-9]\d*)\.json$/;
34
+ const candidates = assets.filter((asset) => pattern.test(asset.name)).sort((a, b) => {
35
+ const first = a.name.match(pattern), second = b.name.match(pattern);
36
+ const runOrder = BigInt(second[1]) - BigInt(first[1]);
37
+ return runOrder < 0n ? -1 : runOrder > 0n ? 1 : Number(second[2]) - Number(first[2]);
38
+ });
39
+ for (const asset of candidates) try {
40
+ if (assets.filter((item) => item.name === asset.name).length !== 1 || !Number.isSafeInteger(asset.size) || asset.size < 1 || asset.size > 262144) throw new Error("Invalid qualification asset");
41
+ const text = await run([
42
+ "release",
43
+ "download",
44
+ tag,
45
+ "--repo",
46
+ repository,
47
+ "--pattern",
48
+ asset.name,
49
+ "--output",
50
+ "-"
51
+ ]);
52
+ const bytes = Buffer.from(text, "utf8");
53
+ if (bytes.length !== asset.size || "sha256:" + createHash("sha256").update(bytes).digest("hex") !== asset.digest) throw new Error("Qualification bytes changed");
54
+ const receipt = JSON.parse(text);
55
+ if (asset.name !== `qualification-${receipt.runId}-${receipt.runAttempt}.json`) throw new Error("Qualification filename mismatch");
56
+ validateReleaseQualification({
57
+ tag_name: tag,
58
+ draft: false,
59
+ assets
60
+ }, receipt, sourceSha, requirements);
61
+ const attempt = `${base}/actions/runs/${receipt.runId}/attempts/${receipt.runAttempt}`;
62
+ const runData = await read(attempt);
63
+ const jobs = [];
64
+ for (let page = 1; page <= 100; page++) {
65
+ const response = await read(`${attempt}/jobs?per_page=100&page=${page}`);
66
+ if (!Array.isArray(response?.jobs)) throw new Error("Invalid qualification jobs");
67
+ jobs.push(...response.jobs);
68
+ if (response.jobs.length < 100) break;
69
+ if (page === 100) throw new Error("Too many qualification jobs");
70
+ }
71
+ validateQualificationRun(runData, jobs, receipt, repository, requirements, options.assetsWorkflow);
72
+ for (const commit of [sourceSha, receipt.workflowSha]) {
73
+ const result = await read(`${base}/compare/${commit}...main`);
74
+ if (!["ahead", "identical"].includes(String(result?.status))) throw new Error("Untrusted release ancestry");
75
+ }
76
+ return receipt;
77
+ } catch {}
78
+ throw new Error("No successful immutable qualification matches this release");
79
+ }
80
+ export { qualifyGitHubRelease };
@@ -0,0 +1,24 @@
1
+ /** Runs `git` with arguments, resolving its trimmed stdout; a failure rejects with the exit
2
+ * status as `code`. */
3
+ export type GitRun = (args: string[]) => Promise<string>;
4
+ export declare function gitCli(): GitRun;
5
+ /** Whether `older` is `newer` or one of its ancestors; any other failure propagates. */
6
+ export declare function gitIsAncestor(git: GitRun, older: string, newer: string): Promise<boolean>;
7
+ /** The released version in the source manifest at the exact source commit. */
8
+ export declare function readSourceVersion(git: GitRun, sourceSha: string, path: string): Promise<string>;
9
+ /** The `owner/name` of the checkout's GitHub origin, as descriptors record it. */
10
+ export declare function originRepository(git: GitRun): Promise<string>;
11
+ /**
12
+ * Local release provenance, replacing a trusted workflow run: the working tree is a clean
13
+ * checkout of exactly `sourceSha` (no modified, staged or untracked files), and that commit is
14
+ * on the fetched `origin/main`. Returns the origin repository and the source manifest's version.
15
+ */
16
+ export declare function resolveLocalProvenance(options: {
17
+ git: GitRun;
18
+ sourceSha: string;
19
+ versionSourcePath: string;
20
+ }): Promise<{
21
+ sourceSha: string;
22
+ repository: string;
23
+ releasedVersion: string;
24
+ }>;
@@ -0,0 +1,72 @@
1
+ import { execFile } from "node:child_process";
2
+ // src/release/local-provenance.ts
3
+ function gitCli() {
4
+ return (args) => new Promise((resolve, reject) => execFile("git", args, { maxBuffer: 1048576 }, (error, stdout) => error ? reject(Object.assign(/* @__PURE__ */ new Error("Git command failed"), { code: error.code })) : resolve(stdout.trim())));
5
+ }
6
+ /** Whether `older` is `newer` or one of its ancestors; any other failure propagates. */
7
+ async function gitIsAncestor(git, older, newer) {
8
+ if (!/^[a-f0-9]{40}$/.test(older) || !/^(?:[a-f0-9]{40}|refs\/remotes\/origin\/main)$/.test(newer)) return false;
9
+ try {
10
+ await git([
11
+ "merge-base",
12
+ "--is-ancestor",
13
+ older,
14
+ newer
15
+ ]);
16
+ return true;
17
+ } catch (error) {
18
+ if (error.code === 1) return false;
19
+ throw error;
20
+ }
21
+ }
22
+ /** The released version in the source manifest at the exact source commit. */
23
+ async function readSourceVersion(git, sourceSha, path) {
24
+ const bytes = await git(["show", `${sourceSha}:${path}`]);
25
+ if (bytes.length > 262144) throw new Error("Invalid source version manifest");
26
+ let manifest;
27
+ try {
28
+ manifest = JSON.parse(bytes);
29
+ } catch {
30
+ throw new Error("Invalid source version manifest");
31
+ }
32
+ if (typeof manifest !== "object" || manifest === null || Array.isArray(manifest) || typeof manifest.version !== "string") throw new Error("Invalid source version manifest");
33
+ return manifest.version;
34
+ }
35
+ /** The `owner/name` of the checkout's GitHub origin, as descriptors record it. */
36
+ async function originRepository(git) {
37
+ const url = await git([
38
+ "remote",
39
+ "get-url",
40
+ "origin"
41
+ ]);
42
+ const match = /^(?:https:\/\/github\.com\/|git@github\.com:)([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+?)(?:\.git)?\/?$/.exec(url);
43
+ if (!match || match[1].split("/").some((part) => part === "." || part === "..")) throw new Error("Origin is not a GitHub repository");
44
+ return match[1];
45
+ }
46
+ /**
47
+ * Local release provenance, replacing a trusted workflow run: the working tree is a clean
48
+ * checkout of exactly `sourceSha` (no modified, staged or untracked files), and that commit is
49
+ * on the fetched `origin/main`. Returns the origin repository and the source manifest's version.
50
+ */
51
+ async function resolveLocalProvenance(options) {
52
+ const { git, sourceSha } = options;
53
+ if (!/^[a-f0-9]{40}$/.test(sourceSha)) throw new Error("Invalid source commit");
54
+ if (await git([
55
+ "rev-parse",
56
+ "--verify",
57
+ "HEAD^{commit}"
58
+ ]) !== sourceSha) throw new Error("Checkout is not at the requested source commit");
59
+ if ((await git([
60
+ "status",
61
+ "--porcelain=v1",
62
+ "--untracked-files=all",
63
+ "--ignore-submodules=none"
64
+ ])).length) throw new Error("Checkout has uncommitted or untracked files");
65
+ if (!await gitIsAncestor(git, sourceSha, "refs/remotes/origin/main")) throw new Error("Source commit is not on origin/main");
66
+ return {
67
+ sourceSha,
68
+ repository: await originRepository(git),
69
+ releasedVersion: await readSourceVersion(git, sourceSha, options.versionSourcePath)
70
+ };
71
+ }
72
+ export { gitCli, gitIsAncestor, originRepository, readSourceVersion, resolveLocalProvenance };
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Local release mode: cut, sign, stage and promote desktop releases from a clean checkout on a
3
+ * developer machine, publishing to the app's HTTPS release feed instead of GitHub Releases.
4
+ * Nothing here uploads. Each publishing step writes a staged tree that mirrors the feed's
5
+ * object keys and an ordered upload plan; the caller uploads it with its own credentials.
6
+ */
7
+ import { type KeyObject } from 'node:crypto';
8
+ import { type FeedChannel } from '../updates/release-feed';
9
+ import type { FetchFunction } from '../updates/release-location';
10
+ import { type GitRun } from './local-provenance';
11
+ import { type ReleasePlatform } from './release-config';
12
+ /** One object to upload, in plan order; the staged file is `<out>/<key>`. */
13
+ type UploadObject = Readonly<{
14
+ key: string;
15
+ size: number;
16
+ sha256: string;
17
+ contentType: string;
18
+ cacheControl: string;
19
+ }>;
20
+ /** Upload in order: immutable assets, then release.json, then index.json, then channel
21
+ * pointers, so a partial upload is never advertised. */
22
+ export type UploadPlan = Readonly<{
23
+ schema: 1;
24
+ base: string;
25
+ objects: readonly UploadObject[];
26
+ }>;
27
+ /** The release platform of this machine. */
28
+ export declare function hostReleasePlatform(platform?: string, arch?: string): ReleasePlatform;
29
+ /** Cut or resume a dev or daily release from a clean local checkout of `sourceSha`, with
30
+ * version state from the feed's ledger. `dispatched` means: build and publish this tag. */
31
+ export declare function runLocalReleaseCut(options: {
32
+ kind: 'dev' | 'daily';
33
+ config: unknown;
34
+ sourceSha: string;
35
+ platform: ReleasePlatform;
36
+ git: GitRun;
37
+ fetch: FetchFunction;
38
+ }): Promise<{
39
+ tag: string;
40
+ sourceSha: string;
41
+ status: 'qualified' | 'pending' | 'dispatched';
42
+ version: string;
43
+ platform: "linux-x64" | "macos-arm64" | "windows-x64";
44
+ }>;
45
+ /** Local provenance for an already cut tag: a clean checkout of `sourceSha` on origin/main whose
46
+ * manifest version the tag belongs to (the daily itself, or a dev build of the next minor). */
47
+ export declare function localTagProvenance(options: {
48
+ config: unknown;
49
+ tag: string;
50
+ sourceSha: string;
51
+ git: GitRun;
52
+ }): Promise<{
53
+ repository: string;
54
+ }>;
55
+ /**
56
+ * Sign this platform's channel descriptors for payloads staged by `release-step stage-build`.
57
+ * Local provenance takes the place of the workflow run: the source commit is also the commit
58
+ * whose release tooling ran, and `runId` is the caller's local run number with attempt 1.
59
+ * Installer qualification needs a disposable hosted runner and is not part of a local release.
60
+ */
61
+ export declare function stageLocalDescriptors(options: {
62
+ config: unknown;
63
+ directory: string;
64
+ tag: string;
65
+ sourceSha: string;
66
+ repository: string;
67
+ runId: string;
68
+ platform: ReleasePlatform;
69
+ keyId: string;
70
+ privateKey: KeyObject;
71
+ }): Promise<string[]>;
72
+ /**
73
+ * Stage this platform's signed release for upload. `directory` holds exactly the platform's
74
+ * payloads and the descriptors `stageLocalDescriptors` signed; every descriptor must
75
+ * authenticate against the app's trust and name its staged payload. The release merges with
76
+ * what the feed already publishes for the tag (another platform's build), never replacing an
77
+ * existing asset with different bytes. Writes `<out>/<app>/<tag>/<asset>` for new assets, the
78
+ * merged release.json, the ledger with this release newest first, and the channel pointers
79
+ * the release now holds, plus `<out>/upload-plan.json`.
80
+ */
81
+ export declare function stageLocalRelease(options: {
82
+ config: unknown;
83
+ directory: string;
84
+ out: string;
85
+ tag: string;
86
+ sourceSha: string;
87
+ repository: string;
88
+ platform: ReleasePlatform;
89
+ now: string;
90
+ fetch: FetchFunction;
91
+ }): Promise<UploadPlan>;
92
+ /** Check a release the feed publishes: ledger, release.json and every signed descriptor. */
93
+ export declare function verifyLocalRelease(options: {
94
+ config: unknown;
95
+ tag: string;
96
+ repository: string;
97
+ fetch: FetchFunction;
98
+ }): Promise<{
99
+ tag: string;
100
+ channel: FeedChannel;
101
+ platforms: string[];
102
+ missing: string[];
103
+ }>;
104
+ /**
105
+ * Promote the newest qualified daily after the soak, with the shared promotion policy over the
106
+ * feed's ledger. A daily qualifies when every published platform's stable descriptors verify.
107
+ * Promotion signs nothing (a daily already carries its stable descriptors); it stages the
108
+ * release.json and ledger entry marked stable and the stable channel pointer.
109
+ */
110
+ export declare function runLocalPromotion(options: {
111
+ config: unknown;
112
+ out: string;
113
+ now: string;
114
+ held: boolean;
115
+ repository: string;
116
+ fetch: FetchFunction;
117
+ }): Promise<{
118
+ status: 'held' | 'soaking' | 'unqualified';
119
+ plan?: Readonly<{
120
+ schema: 1;
121
+ base: string;
122
+ objects: readonly UploadObject[];
123
+ }> | undefined;
124
+ } | {
125
+ status: 'stable';
126
+ tag: string;
127
+ plan?: Readonly<{
128
+ schema: 1;
129
+ base: string;
130
+ objects: readonly UploadObject[];
131
+ }> | undefined;
132
+ }>;
133
+ export {};