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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (474) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +30 -0
  3. package/README.md +967 -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 +125 -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 +318 -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/settings-sections.d.ts +31 -0
  236. package/dist/shell/settings-sections.js +50 -0
  237. package/dist/shell/shortcut-platform.d.ts +17 -0
  238. package/dist/shell/shortcut-platform.js +25 -0
  239. package/dist/update-helper.bundle.js +260 -0
  240. package/dist/updates/channel-update-manager.d.ts +46 -0
  241. package/dist/updates/channel-update-manager.js +114 -0
  242. package/dist/updates/desktop-updater.d.ts +104 -0
  243. package/dist/updates/desktop-updater.js +345 -0
  244. package/dist/updates/release-feed.d.ts +61 -0
  245. package/dist/updates/release-feed.js +111 -0
  246. package/dist/updates/release-location.d.ts +9 -0
  247. package/dist/updates/release-location.js +80 -0
  248. package/dist/updates/release-version.d.ts +12 -0
  249. package/dist/updates/release-version.js +43 -0
  250. package/dist/updates/signed-release.d.ts +63 -0
  251. package/dist/updates/signed-release.js +162 -0
  252. package/dist/updates/stable-file.d.ts +10 -0
  253. package/dist/updates/stable-file.js +22 -0
  254. package/dist/updates/update-adapter.d.ts +57 -0
  255. package/dist/updates/update-adapter.js +72 -0
  256. package/dist/updates/update-arm.d.ts +24 -0
  257. package/dist/updates/update-arm.js +95 -0
  258. package/dist/updates/update-channel-store.d.ts +8 -0
  259. package/dist/updates/update-channel-store.js +72 -0
  260. package/dist/updates/update-discovery.d.ts +13 -0
  261. package/dist/updates/update-discovery.js +56 -0
  262. package/dist/updates/update-download.d.ts +14 -0
  263. package/dist/updates/update-download.js +67 -0
  264. package/dist/updates/update-exclusive-rename.d.ts +2 -0
  265. package/dist/updates/update-exclusive-rename.js +52 -0
  266. package/dist/updates/update-extraction.d.ts +18 -0
  267. package/dist/updates/update-extraction.js +183 -0
  268. package/dist/updates/update-handoff-plan.d.ts +22 -0
  269. package/dist/updates/update-handoff-plan.js +28 -0
  270. package/dist/updates/update-helper.d.ts +24 -0
  271. package/dist/updates/update-helper.js +56 -0
  272. package/dist/updates/update-launch.d.ts +5 -0
  273. package/dist/updates/update-launch.js +27 -0
  274. package/dist/updates/update-manager.d.ts +40 -0
  275. package/dist/updates/update-manager.js +83 -0
  276. package/dist/updates/update-process-fence.d.ts +10 -0
  277. package/dist/updates/update-process-fence.js +114 -0
  278. package/dist/updates/update-resume.d.ts +13 -0
  279. package/dist/updates/update-resume.js +34 -0
  280. package/dist/updates/update-shutdown.d.ts +15 -0
  281. package/dist/updates/update-shutdown.js +29 -0
  282. package/dist/updates/update-state.d.ts +30 -0
  283. package/dist/updates/update-state.js +18 -0
  284. package/dist/updates/update-swap-stage.d.ts +27 -0
  285. package/dist/updates/update-swap-stage.js +58 -0
  286. package/dist/updates/update-swap.d.ts +10 -0
  287. package/dist/updates/update-swap.js +30 -0
  288. package/dist/views/app-about.d.ts +22 -0
  289. package/dist/views/app-about.js +43 -0
  290. package/dist/views/app-appearance.d.ts +11 -0
  291. package/dist/views/app-appearance.js +42 -0
  292. package/dist/views/app-help.d.ts +17 -0
  293. package/dist/views/app-help.js +42 -0
  294. package/dist/views/app-settings.d.ts +26 -0
  295. package/dist/views/app-settings.js +97 -0
  296. package/dist/views/appearance-surface.d.ts +9 -0
  297. package/dist/views/appearance-surface.js +334 -0
  298. package/dist/views/update-surface.d.ts +34 -0
  299. package/dist/views/update-surface.js +64 -0
  300. package/package.json +363 -4
  301. package/src/app/application.tsx +138 -0
  302. package/src/app/create-application.ts +245 -0
  303. package/src/app/service-registry.ts +124 -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/ci/toolchain-identity.ts +244 -0
  315. package/src/cli/cef-helper-cli.ts +21 -0
  316. package/src/cli/cli-runner.ts +29 -0
  317. package/src/cli/create-application-cli.ts +62 -0
  318. package/src/cli/electrobun-shortcut-patch-cli.ts +24 -0
  319. package/src/cli/framework-update-cli.ts +41 -0
  320. package/src/cli/release-assets-plan-cli.ts +14 -0
  321. package/src/cli/release-cut-cli.ts +41 -0
  322. package/src/cli/release-descriptor-staging-cli.ts +57 -0
  323. package/src/cli/release-finalize-cli.ts +34 -0
  324. package/src/cli/release-promote-cli.ts +31 -0
  325. package/src/cli/release-publish-cli.ts +46 -0
  326. package/src/cli/release-sign-cli.ts +24 -0
  327. package/src/cli/release-step-cli.ts +71 -0
  328. package/src/cli/toolchain-identity-cli.ts +12 -0
  329. package/src/cli/update-helper-cli.ts +12 -0
  330. package/src/cli/windows-runtime-patch-cli.ts +17 -0
  331. package/src/desktop/application-command-client.ts +43 -0
  332. package/src/desktop/channel-handshake.ts +136 -0
  333. package/src/desktop/channel-proof.ts +122 -0
  334. package/src/desktop/client-assets.ts +75 -0
  335. package/src/desktop/desktop-client.ts +303 -0
  336. package/src/desktop/desktop-gateway.ts +189 -0
  337. package/src/desktop/desktop-host.ts +335 -0
  338. package/src/desktop/desktop-stream.ts +324 -0
  339. package/src/desktop/loopback-policy.ts +41 -0
  340. package/src/desktop/open-url-channel.ts +79 -0
  341. package/src/desktop/string-policy.ts +9 -0
  342. package/src/installer/archive-entry.ts +32 -0
  343. package/src/installer/command-artifact.ts +307 -0
  344. package/src/installer/command-qualification-command.ts +75 -0
  345. package/src/installer/hosted-runner.ts +11 -0
  346. package/src/installer/installed-payload.ts +408 -0
  347. package/src/installer/installer-ci-bootstrap.ts +199 -0
  348. package/src/installer/installer-ci-preflight.ts +61 -0
  349. package/src/installer/installer-ci-worker.ts +105 -0
  350. package/src/installer/installer-extraction.ts +367 -0
  351. package/src/installer/installer-fetch-guard.ts +75 -0
  352. package/src/installer/installer-identity.ts +331 -0
  353. package/src/installer/installer-layout.ts +167 -0
  354. package/src/installer/installer-observation.ts +671 -0
  355. package/src/installer/installer-process-cleanup.ts +167 -0
  356. package/src/installer/installer-qualification-command.ts +81 -0
  357. package/src/installer/installer-renderer-evidence.ts +268 -0
  358. package/src/installer/installer-upgrade-command.ts +226 -0
  359. package/src/installer/installer-worker-guard.ts +112 -0
  360. package/src/installer/native-executable.ts +37 -0
  361. package/src/installer/upgrade-asset-download.ts +72 -0
  362. package/src/installer/write-all.ts +19 -0
  363. package/src/native/app-bundle.ts +86 -0
  364. package/src/native/cef-helper.ts +471 -0
  365. package/src/native/desktop-build-hook.ts +21 -0
  366. package/src/native/electrobun-cef-main-frame-bridges.patch +63 -0
  367. package/src/native/electrobun-source-patch.ts +107 -0
  368. package/src/native/electrobun-windows-shortcut-com.patch +923 -0
  369. package/src/native/linux-cef-links.ts +14 -0
  370. package/src/native/native-secret-store.ts +99 -0
  371. package/src/native/native-utilities.ts +166 -0
  372. package/src/native/partitioned-window.ts +62 -0
  373. package/src/native/renderer-profile.ts +27 -0
  374. package/src/native/secure-window.ts +115 -0
  375. package/src/native/sidecar-services.ts +71 -0
  376. package/src/native/sidecar.ts +387 -0
  377. package/src/native/window-bootstrap.ts +77 -0
  378. package/src/native/window-options.ts +24 -0
  379. package/src/native/windows-build-hook-internal.ts +49 -0
  380. package/src/native/windows-build-hook.ts +12 -0
  381. package/src/native/windows-runtime-patch-internal.ts +48 -0
  382. package/src/native/windows-runtime-patch.ts +15 -0
  383. package/src/release/feed-release-cut.ts +110 -0
  384. package/src/release/feed-state.ts +135 -0
  385. package/src/release/framework-package-publish.ts +163 -0
  386. package/src/release/framework-update.ts +196 -0
  387. package/src/release/github-cli.ts +27 -0
  388. package/src/release/github-release-assets.ts +36 -0
  389. package/src/release/github-release-cut.ts +237 -0
  390. package/src/release/github-release-lookup.ts +39 -0
  391. package/src/release/github-release-promotion.ts +112 -0
  392. package/src/release/github-release-provenance.ts +65 -0
  393. package/src/release/github-release-publisher.ts +90 -0
  394. package/src/release/github-release-qualification.ts +144 -0
  395. package/src/release/local-provenance.ts +92 -0
  396. package/src/release/local-release.ts +525 -0
  397. package/src/release/macos-dmg.ts +113 -0
  398. package/src/release/release-artifact.ts +53 -0
  399. package/src/release/release-assets-plan.ts +118 -0
  400. package/src/release/release-config.ts +420 -0
  401. package/src/release/release-cut-command.ts +80 -0
  402. package/src/release/release-cut.ts +133 -0
  403. package/src/release/release-descriptor-staging.ts +242 -0
  404. package/src/release/release-finalize.ts +191 -0
  405. package/src/release/release-promotion-command.ts +36 -0
  406. package/src/release/release-promotion.ts +132 -0
  407. package/src/release/release-publication.ts +213 -0
  408. package/src/release/release-publish-command.ts +163 -0
  409. package/src/release/release-qualification.ts +397 -0
  410. package/src/release/release-staging.ts +87 -0
  411. package/src/release/release-steps.ts +173 -0
  412. package/src/release/retained-release-build.ts +217 -0
  413. package/src/shell/app-shell.tsx +285 -0
  414. package/src/shell/app-utilities.tsx +437 -0
  415. package/src/shell/application-menu-commands.ts +6 -0
  416. package/src/shell/application-menu.ts +250 -0
  417. package/src/shell/help-shortcuts.ts +24 -0
  418. package/src/shell/settings-sections.ts +74 -0
  419. package/src/shell/shortcut-platform.ts +35 -0
  420. package/src/updates/channel-update-manager.ts +127 -0
  421. package/src/updates/desktop-updater.ts +440 -0
  422. package/src/updates/release-feed.ts +187 -0
  423. package/src/updates/release-location.ts +101 -0
  424. package/src/updates/release-version.ts +57 -0
  425. package/src/updates/signed-release.ts +311 -0
  426. package/src/updates/stable-file.ts +32 -0
  427. package/src/updates/update-adapter.ts +129 -0
  428. package/src/updates/update-arm.ts +107 -0
  429. package/src/updates/update-channel-store.ts +86 -0
  430. package/src/updates/update-discovery.ts +113 -0
  431. package/src/updates/update-download.ts +82 -0
  432. package/src/updates/update-exclusive-rename.ts +58 -0
  433. package/src/updates/update-extraction.ts +261 -0
  434. package/src/updates/update-handoff-plan.ts +75 -0
  435. package/src/updates/update-helper.ts +87 -0
  436. package/src/updates/update-launch.ts +33 -0
  437. package/src/updates/update-manager.ts +130 -0
  438. package/src/updates/update-process-fence.ts +125 -0
  439. package/src/updates/update-resume.ts +34 -0
  440. package/src/updates/update-shutdown.ts +37 -0
  441. package/src/updates/update-state.ts +34 -0
  442. package/src/updates/update-swap-stage.ts +75 -0
  443. package/src/updates/update-swap.ts +30 -0
  444. package/src/views/app-about.tsx +44 -0
  445. package/src/views/app-appearance.tsx +32 -0
  446. package/src/views/app-help.tsx +43 -0
  447. package/src/views/app-settings.tsx +88 -0
  448. package/src/views/appearance-surface.tsx +427 -0
  449. package/src/views/update-surface.tsx +85 -0
  450. package/templates/application/.gitattributes +1 -0
  451. package/templates/application/.github/workflows/release-assets.yml +29 -0
  452. package/templates/application/.github/workflows/release-finalize.yml +29 -0
  453. package/templates/application/.github/workflows/release-please.yml +19 -0
  454. package/templates/application/.github/workflows/release.yml +29 -0
  455. package/templates/application/.github/workflows/validation.yml +28 -0
  456. package/templates/application/.oxfmtrc.json +6 -0
  457. package/templates/application/.oxlintrc.json +48 -0
  458. package/templates/application/.release-please-manifest.json +3 -0
  459. package/templates/application/README.md +47 -0
  460. package/templates/application/electrobun.config.ts +22 -0
  461. package/templates/application/release-please-config.json +12 -0
  462. package/templates/application/scripts/app-version.ts +9 -0
  463. package/templates/application/scripts/build-desktop.ts +34 -0
  464. package/templates/application/scripts/secure-build.ts +1 -0
  465. package/templates/application/scripts/stage-release.ts +21 -0
  466. package/templates/application/src/bun/index.ts +80 -0
  467. package/templates/application/src/electrobun.d.ts +27 -0
  468. package/templates/application/src/web/index.html +12 -0
  469. package/templates/application/src/web/main.tsx +97 -0
  470. package/templates/application/src/web/public/icon.svg +1 -0
  471. package/templates/application/src/web/style.css +3 -0
  472. package/templates/application/tests/app-config.test.ts +9 -0
  473. package/templates/application/tsconfig.json +15 -0
  474. package/templates/application/vite.config.ts +10 -0
@@ -0,0 +1,135 @@
1
+ import { containsAsciiControl } from "../desktop/string-policy.js";
2
+ // src/release/release-qualification.ts
3
+ function assert(condition, message) {
4
+ if (!condition) throw new Error(message);
5
+ }
6
+ function expectedAssets(requirements) {
7
+ if (Object.hasOwn(requirements, "offlinePolicy")) parseOfflinePolicy(requirements.offlinePolicy);
8
+ const platforms = Object.entries(requirements.platforms);
9
+ assert(platforms.length > 0, "Missing platforms");
10
+ const names = [
11
+ ...platforms.flatMap(([platform, artifacts]) => {
12
+ assert(/^[a-z0-9-]+$/.test(platform) && artifacts.length > 0, "Invalid platform requirements");
13
+ return artifacts;
14
+ }),
15
+ ...Object.entries(requirements.commandArtifacts ?? {}).flatMap(([kind, byPlatform]) => {
16
+ assert(/^[a-z][a-z0-9-]{0,31}$/.test(kind) && Object.keys(byPlatform).length === platforms.length && platforms.every(([platform]) => typeof byPlatform[platform] === "string"), "Invalid command artifact requirements");
17
+ return Object.values(byPlatform);
18
+ }),
19
+ ...requirements.releaseAssets
20
+ ];
21
+ assert(names.length > 0 && names.every((name) => /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(name)) && new Set(names).size === names.length, "Invalid or duplicate asset requirements");
22
+ return names;
23
+ }
24
+ function matches(saved, uploaded) {
25
+ return Boolean(saved && uploaded && saved.name === uploaded.name && Number.isSafeInteger(saved.size) && saved.size > 0 && saved.size === uploaded.size && /^sha256:[a-f0-9]{64}$/.test(saved.digest) && saved.digest === uploaded.digest);
26
+ }
27
+ function uniqueAsset(assets, name) {
28
+ const found = assets.filter((asset) => asset.name === name);
29
+ assert(found.length === 1, `Missing or duplicate asset: ${name}`);
30
+ return found[0];
31
+ }
32
+ function parseOfflinePolicy(value) {
33
+ assert(typeof value === "object" && value !== null && !Array.isArray(value), "Invalid offline policy");
34
+ const policy = value;
35
+ assert(typeof policy.marker === "string" && policy.marker.trim().length > 0 && policy.marker.length <= 256 && !containsAsciiControl(policy.marker), "Invalid offline marker");
36
+ if (policy.kind === "standalone") {
37
+ assert(Object.keys(policy).length === 2, "Invalid standalone offline policy");
38
+ return {
39
+ kind: "standalone",
40
+ marker: policy.marker
41
+ };
42
+ }
43
+ assert(policy.kind === "local-bootstrap" && Object.keys(policy).length === 3 && typeof policy.path === "string" && policy.path.length <= 256 && /^\/(?:[A-Za-z0-9_~-]+\/)*[A-Za-z0-9_~-]+$/.test(policy.path) && !policy.path.startsWith("/__framework/"), "Invalid bootstrap offline policy");
44
+ return {
45
+ kind: "local-bootstrap",
46
+ marker: policy.marker,
47
+ path: policy.path
48
+ };
49
+ }
50
+ function checkRenderer(value, offlinePolicy) {
51
+ const port = Number(value?.origin?.split(":").at(-1));
52
+ const common = value && port >= 1024 && port <= 65535 && /^http:\/\/127\.0\.0\.1:[1-9]\d{3,4}$/.test(value.origin) && value.samples === 2 && value.guardInstalled === true && value.offlineObserved === true && value.unexpectedActivity === false && Number.isFinite(value.elapsedMs) && value.elapsedMs >= 3e3 && value.visible === true && ["interactive", "complete"].includes(value.readyState) && Number.isFinite(value.width) && value.width >= 100 && Number.isFinite(value.height) && value.height >= 100 && Number.isSafeInteger(value.interactiveElements) && value.interactiveElements >= 1 && Number.isSafeInteger(value.textLength) && value.textLength >= 1;
53
+ if (!offlinePolicy) {
54
+ assert(common && value.method === "native-dom-raf-v1" && value.bootstrapDenied === true, "Incomplete native renderer evidence");
55
+ return;
56
+ }
57
+ assert(value && value.offlinePolicy, "Incomplete native renderer evidence");
58
+ const policy = parseOfflinePolicy(offlinePolicy), observed = parseOfflinePolicy(value.offlinePolicy);
59
+ assert(common && value.method === "native-dom-raf-v2" && value.markerObserved === true && value.browserNetworkRestricted === true && observed.kind === policy.kind && observed.marker === policy.marker && (policy.kind === "standalone" ? value.bootstrapDenied === false : observed.kind === "local-bootstrap" && observed.path === policy.path && value.bootstrapDenied === true), "Incomplete native renderer evidence");
60
+ }
61
+ /** Validate one installed-app receipt against the exact attempt and payload bytes. */
62
+ function validateInstallerReceipt(identity, entry, platform, names, assets, offlinePolicy) {
63
+ assertIdentity(identity, platform);
64
+ assert(Array.isArray(names) && new Set(names).size === names.length, "Invalid installer receipt context");
65
+ assert(entry && entry.platform === platform && entry.schema === 2 && entry.installed === true && entry.launched === true && entry.rendererReady === true && [
66
+ "tag",
67
+ "sourceSha",
68
+ "workflowSha",
69
+ "runId",
70
+ "runAttempt"
71
+ ].every((key) => entry[key] === identity[key]), "Installer identity mismatch");
72
+ checkRenderer(entry.rendererEvidence, offlinePolicy);
73
+ assert(Array.isArray(entry.assets) && names.length > 0 && entry.assets.length === names.length, "Incorrect installer asset count");
74
+ for (const name of names) assert(matches(uniqueAsset(entry.assets, name), uniqueAsset(assets, name)), `Installer asset mismatch: ${name}`);
75
+ return true;
76
+ }
77
+ function assertIdentity(identity, platform) {
78
+ assert(/^v\d+\.\d+\.\d+(?:-dev\.\d+)?$/.test(identity.tag) && /^[a-f0-9]{40}$/.test(identity.sourceSha) && /^[a-f0-9]{40}$/.test(identity.workflowSha) && /^[1-9]\d{0,19}$/.test(identity.runId) && Number.isSafeInteger(identity.runAttempt) && identity.runAttempt > 0 && /^[a-z0-9-]+$/.test(platform), "Invalid receipt context");
79
+ }
80
+ /** Validate one command artifact receipt against the exact attempt and payload bytes. */
81
+ function validateCommandReceipt(identity, entry, kind, platform, name, assets) {
82
+ assertIdentity(identity, platform);
83
+ assert(entry && entry.schema === 1 && entry.kind === kind && entry.platform === platform && entry.installed === true && entry.versionMatched === true && entry.probesPassed === true && entry.serviceStarted === true && entry.serviceStopped === (platform === "windows-x64" ? "process-tree" : "sigterm") && Object.keys(entry).length === 14 && [
84
+ "tag",
85
+ "sourceSha",
86
+ "workflowSha",
87
+ "runId",
88
+ "runAttempt"
89
+ ].every((key) => entry[key] === identity[key]), "Command artifact receipt mismatch");
90
+ assert(matches(entry.asset, uniqueAsset(assets, name)), `Command artifact asset mismatch: ${name}`);
91
+ return true;
92
+ }
93
+ /** Validate that every required command artifact has exactly one receipt for its bytes. */
94
+ function validateCommandReceipts(identity, receipts, requirements, assets) {
95
+ const required = Object.entries(requirements.commandArtifacts ?? {}).flatMap(([kind, byPlatform]) => Object.entries(byPlatform).map(([platform, name]) => ({
96
+ kind,
97
+ platform,
98
+ name
99
+ })));
100
+ if (!required.length) {
101
+ assert(receipts === void 0, "Unexpected command artifact receipts");
102
+ return;
103
+ }
104
+ assert(Array.isArray(receipts) && receipts.length === required.length, "Missing or duplicate command artifact receipts");
105
+ for (const { kind, platform, name } of required) {
106
+ const entries = receipts.filter((entry) => entry?.kind === kind && entry.platform === platform);
107
+ assert(entries.length === 1, `Missing or duplicate command artifact receipt: ${kind}`);
108
+ validateCommandReceipt(identity, entries[0], kind, platform, name, assets);
109
+ }
110
+ }
111
+ function validateReleaseQualification(release, receipt, sourceSha, requirements) {
112
+ const required = expectedAssets(requirements);
113
+ const platforms = Object.keys(requirements.platforms);
114
+ assert(release.draft === false && receipt.schema === 2 && receipt.tag === release.tag_name && receipt.sourceSha === sourceSha && /^[a-f0-9]{40}$/.test(sourceSha) && /^[a-f0-9]{40}$/.test(receipt.workflowSha) && /^[1-9]\d*$/.test(receipt.runId) && Number.isSafeInteger(receipt.runAttempt) && receipt.runAttempt > 0, "Qualification identity mismatch");
115
+ assert(receipt.platforms.length === platforms.length && receipt.installerTests.length === platforms.length && receipt.installerReceipts.length === platforms.length && platforms.every((platform) => receipt.platforms.filter((x) => x === platform).length === 1 && receipt.installerTests.filter((x) => x === platform).length === 1), "Missing or duplicate platform tests");
116
+ for (const platform of platforms) {
117
+ const entries = receipt.installerReceipts.filter((entry) => entry.platform === platform);
118
+ assert(entries.length === 1, `Missing or duplicate installer receipt: ${platform}`);
119
+ validateInstallerReceipt(receipt, entries[0], platform, requirements.platforms[platform], release.assets, requirements.offlinePolicy);
120
+ }
121
+ validateCommandReceipts(receipt, receipt.commandReceipts, requirements, release.assets);
122
+ assert(receipt.assets.length === required.length, "Incorrect qualification asset count");
123
+ for (const name of required) assert(matches(uniqueAsset(receipt.assets, name), uniqueAsset(release.assets, name)), `Qualification asset mismatch: ${name}`);
124
+ return true;
125
+ }
126
+ function validateQualificationRun(run, jobs, receipt, repository, requirements, assetsWorkflow) {
127
+ expectedAssets(requirements);
128
+ assert(String(run.id) === receipt.runId && run.run_attempt === receipt.runAttempt && run.conclusion === "success" && run.path === assetsWorkflow && run.repository.full_name === repository && run.head_sha === receipt.workflowSha && ["release", "workflow_dispatch"].includes(run.event), "Qualification run identity mismatch");
129
+ for (const platform of Object.keys(requirements.platforms)) {
130
+ const platformJobs = jobs.filter((job) => new RegExp(`^(?:[A-Za-z0-9_-]+ / )?Installer / ${platform}$`).test(job.name));
131
+ assert(platformJobs.length === 1 && platformJobs[0].conclusion === "success", `Missing successful installer job: ${platform}`);
132
+ }
133
+ return true;
134
+ }
135
+ export { parseOfflinePolicy, validateCommandReceipt, validateCommandReceipts, validateInstallerReceipt, validateQualificationRun, validateReleaseQualification };
@@ -0,0 +1,9 @@
1
+ import type { Artifact } from './release-qualification';
2
+ /** Stage the platform's configured payloads from the build without replacing existing bytes. */
3
+ export declare function stagePlatformArtifacts(options: {
4
+ config: unknown;
5
+ tag: string;
6
+ platform: string;
7
+ directory: string;
8
+ sources: Record<string, string>;
9
+ }): Promise<Artifact[]>;
@@ -0,0 +1,61 @@
1
+ import { parseReleaseConfig, platformPayloads } from "./release-config.js";
2
+ import { lstat, open, rm } from "node:fs/promises";
3
+ import { join, resolve } from "node:path";
4
+ import { createHash } from "node:crypto";
5
+ // src/release/release-staging.ts
6
+ /** Stage the platform's configured payloads from the build without replacing existing bytes. */
7
+ async function stagePlatformArtifacts(options) {
8
+ const requirements = parseReleaseConfig(options.config).requirements(options.tag);
9
+ const expected = platformPayloads(requirements, options.platform);
10
+ if (!expected.length || Object.keys(options.sources).length !== expected.length || expected.some((name) => !Object.hasOwn(options.sources, name))) throw new Error("Platform staging sources do not match release configuration");
11
+ const directory = resolve(options.directory);
12
+ const created = [];
13
+ try {
14
+ const artifacts = [];
15
+ for (const name of expected) {
16
+ const sourcePath = options.sources[name];
17
+ if (typeof sourcePath !== "string" || !sourcePath) throw new Error("Invalid staging source");
18
+ const sourceInfo = await lstat(sourcePath);
19
+ if (!sourceInfo.isFile() || sourceInfo.isSymbolicLink() || !Number.isSafeInteger(sourceInfo.size) || sourceInfo.size < 1) throw new Error("Invalid staging source");
20
+ const input = await open(sourcePath, "r");
21
+ try {
22
+ const before = await input.stat();
23
+ if (!before.isFile() || before.dev !== sourceInfo.dev || before.ino !== sourceInfo.ino || before.size !== sourceInfo.size) throw new Error("Staging source changed");
24
+ const target = join(directory, name);
25
+ const output = await open(target, "wx");
26
+ created.push(target);
27
+ const hash = createHash("sha256");
28
+ let size = 0;
29
+ try {
30
+ for await (const chunk of input.createReadStream({ autoClose: false })) {
31
+ size += chunk.length;
32
+ if (size > before.size) throw new Error("Staging source changed");
33
+ hash.update(chunk);
34
+ let offset = 0;
35
+ while (offset < chunk.length) {
36
+ const { bytesWritten } = await output.write(chunk, offset, chunk.length - offset);
37
+ if (!bytesWritten) throw new Error("Unable to stage artifact");
38
+ offset += bytesWritten;
39
+ }
40
+ }
41
+ } finally {
42
+ await output.close();
43
+ }
44
+ const after = await input.stat();
45
+ if (size !== before.size || after.size !== before.size || after.mtimeMs !== before.mtimeMs || after.dev !== before.dev || after.ino !== before.ino) throw new Error("Staging source changed");
46
+ artifacts.push({
47
+ name,
48
+ size,
49
+ digest: "sha256:" + hash.digest("hex")
50
+ });
51
+ } finally {
52
+ await input.close();
53
+ }
54
+ }
55
+ return artifacts;
56
+ } catch (error) {
57
+ await Promise.all(created.map((path) => rm(path, { force: true })));
58
+ throw error;
59
+ }
60
+ }
61
+ export { stagePlatformArtifacts };
@@ -0,0 +1,38 @@
1
+ import { type InstallerPlatform } from '../installer/installer-layout';
2
+ export type ReleaseStepContext = {
3
+ env: Record<string, string | undefined>;
4
+ /** The parsed `release-config.json`. */
5
+ config: {
6
+ appName: string;
7
+ } & Record<string, unknown>;
8
+ tag: string;
9
+ platform: InstallerPlatform;
10
+ };
11
+ export declare function releasePlatform(value: string | undefined): InstallerPlatform;
12
+ /** Reuse this tag's payload from an earlier trusted attempt; writes `reuse`, `artifactId` and `runId` to `GITHUB_OUTPUT`. */
13
+ export declare function selectRetainedStep(context: ReleaseStepContext): Promise<void>;
14
+ /** The installer and update archive a stable Electrobun build leaves in `artifacts`. */
15
+ export declare function electrobunArtifacts(appName: string, platform: InstallerPlatform): [installer: string, archive: string];
16
+ /**
17
+ * Copy the freshly built installer and archive into `directory` under their release asset names,
18
+ * and pack each command artifact's built directory into its release archive beside them.
19
+ */
20
+ export declare function stageBuildStep(context: ReleaseStepContext, directory: string, artifacts?: string): Promise<import("./release-qualification").Artifact[]>;
21
+ /**
22
+ * Check a staged payload before its installer runs: exactly the configured assets, an installer
23
+ * that embeds the staged archive, and command artifacts with only safe entries and a launcher.
24
+ */
25
+ export declare function inspectStagedStep(context: ReleaseStepContext, directory: string): Promise<{
26
+ archive: string;
27
+ identity: {
28
+ installer: import("./release-qualification").Artifact;
29
+ archive: import("./release-qualification").Artifact;
30
+ };
31
+ }>;
32
+ /**
33
+ * Run each staged command artifact from a clean location and stage its receipt, then run the
34
+ * staged installer, observe the installed app and stage the installer receipt.
35
+ */
36
+ export declare function qualifyStep(context: ReleaseStepContext, directory: string): Promise<void>;
37
+ /** Install the newest earlier release, apply this release's update and observe the new version. */
38
+ export declare function qualifyUpgradeStep(context: ReleaseStepContext, directory: string, onStage?: (stage: string) => void): Promise<import("../installer/installer-upgrade-command").UpgradeReceipt | null>;
@@ -0,0 +1,147 @@
1
+ import { assertPortableAppName } from "../installer/installer-layout.js";
2
+ import { parseReleaseConfig, platformPayloads } from "./release-config.js";
3
+ import { packCommandArtifact, readCommandArtifact } from "../installer/command-artifact.js";
4
+ import { qualifyCommandArtifactsCommand } from "../installer/command-qualification-command.js";
5
+ import { verifyInstallerPayload } from "../installer/installer-identity.js";
6
+ import { qualifyInstallerCommand } from "../installer/installer-qualification-command.js";
7
+ import { qualifyUpgradeCommand } from "../installer/installer-upgrade-command.js";
8
+ import { stagePlatformArtifacts } from "./release-staging.js";
9
+ import { selectRetainedReleaseBuild } from "./retained-release-build.js";
10
+ import { appendFile, mkdir, mkdtemp, readdir, rm } from "node:fs/promises";
11
+ import { join } from "node:path";
12
+ import { tmpdir } from "node:os";
13
+ // src/release/release-steps.ts
14
+ /**
15
+ * The per-platform steps the reusable release-assets workflow runs in an app's
16
+ * directory (`bun run release:<step> <platform> [directory]`, with
17
+ * `RELEASE_TAG`), so an app maps its scripts to `release-step-cli.js` instead
18
+ * of keeping its own copies. Each reads `release-config.json` from the app
19
+ * directory; an app's own tests keep that file in step with its app identity.
20
+ */
21
+ var PLATFORMS = [
22
+ "macos-arm64",
23
+ "windows-x64",
24
+ "linux-x64"
25
+ ];
26
+ function releasePlatform(value) {
27
+ if (!value || !PLATFORMS.includes(value)) throw new Error("Expected a release platform");
28
+ return value;
29
+ }
30
+ function platformAssets(context) {
31
+ const assets = parseReleaseConfig(context.config).requirements(context.tag).platforms[context.platform];
32
+ if (!assets || assets.length !== 2) throw new Error("Expected one installer and one archive");
33
+ return [assets[0], assets[1]];
34
+ }
35
+ function renderer(env) {
36
+ const value = env.ADEA_APP_RENDERER;
37
+ if (value !== "native" && value !== "cef") throw new Error("ADEA_APP_RENDERER must be native or cef");
38
+ return value;
39
+ }
40
+ /** Reuse this tag's payload from an earlier trusted attempt; writes `reuse`, `artifactId` and `runId` to `GITHUB_OUTPUT`. */
41
+ async function selectRetainedStep(context) {
42
+ const output = context.env.GITHUB_OUTPUT;
43
+ if (!output) throw new Error("Expected GITHUB_OUTPUT");
44
+ const result = await selectRetainedReleaseBuild(context);
45
+ await appendFile(output, result.reuse ? `reuse=true\nartifactId=${result.artifactId}\nrunId=${result.runId}\n` : "reuse=false\n");
46
+ }
47
+ /** The installer and update archive a stable Electrobun build leaves in `artifacts`. */
48
+ function electrobunArtifacts(appName, platform) {
49
+ assertPortableAppName(appName);
50
+ const bundle = appName.replaceAll(" ", "");
51
+ return {
52
+ "macos-arm64": [`macos-arm64-${bundle}.dmg`, `stable-macos-arm64-${bundle}.app.tar.zst`],
53
+ "windows-x64": [`win-x64-${bundle}-Setup.zip`, `stable-win-x64-${bundle}.tar.zst`],
54
+ "linux-x64": [`linux-x64-${bundle}-Setup.tar.gz`, `stable-linux-x64-${bundle}.tar.zst`]
55
+ }[platform];
56
+ }
57
+ /**
58
+ * Copy the freshly built installer and archive into `directory` under their release asset names,
59
+ * and pack each command artifact's built directory into its release archive beside them.
60
+ */
61
+ async function stageBuildStep(context, directory, artifacts = "artifacts") {
62
+ const [installerAsset, archiveAsset] = platformAssets(context);
63
+ const [installer, archive] = electrobunArtifacts(context.config.appName, context.platform);
64
+ const parsed = parseReleaseConfig(context.config);
65
+ const requirements = parsed.requirements(context.tag);
66
+ await mkdir(directory, { recursive: true });
67
+ const packed = await mkdtemp(join(tmpdir(), "framework-command-pack-"));
68
+ try {
69
+ const sources = {
70
+ [installerAsset]: join(artifacts, installer),
71
+ [archiveAsset]: join(artifacts, archive)
72
+ };
73
+ for (const policy of parsed.commandArtifacts) {
74
+ const name = requirements.commandArtifacts[policy.kind][context.platform];
75
+ sources[name] = join(packed, name);
76
+ await packCommandArtifact({
77
+ source: policy.build,
78
+ archive: sources[name],
79
+ executable: policy.executable,
80
+ platform: context.platform
81
+ });
82
+ }
83
+ return await stagePlatformArtifacts({
84
+ ...context,
85
+ directory,
86
+ sources
87
+ });
88
+ } finally {
89
+ await rm(packed, {
90
+ recursive: true,
91
+ force: true
92
+ });
93
+ }
94
+ }
95
+ /**
96
+ * Check a staged payload before its installer runs: exactly the configured assets, an installer
97
+ * that embeds the staged archive, and command artifacts with only safe entries and a launcher.
98
+ */
99
+ async function inspectStagedStep(context, directory) {
100
+ const parsed = parseReleaseConfig(context.config);
101
+ const requirements = parsed.requirements(context.tag);
102
+ const assets = platformPayloads(requirements, context.platform);
103
+ const entries = await readdir(directory, { withFileTypes: true });
104
+ if (entries.length !== assets.length || entries.some((entry) => !entry.isFile() || !assets.includes(entry.name))) throw new Error("Staged platform directory contains unexpected files");
105
+ const [installer, archive] = platformAssets(context).map((name) => join(directory, name));
106
+ for (const policy of parsed.commandArtifacts) await readCommandArtifact({
107
+ archive: join(directory, requirements.commandArtifacts[policy.kind][context.platform]),
108
+ executable: policy.executable,
109
+ platform: context.platform
110
+ });
111
+ return {
112
+ archive,
113
+ identity: await verifyInstallerPayload({
114
+ platform: context.platform,
115
+ appName: context.config.appName,
116
+ installer,
117
+ archive,
118
+ env: context.env
119
+ })
120
+ };
121
+ }
122
+ /**
123
+ * Run each staged command artifact from a clean location and stage its receipt, then run the
124
+ * staged installer, observe the installed app and stage the installer receipt.
125
+ */
126
+ async function qualifyStep(context, directory) {
127
+ const mode = renderer(context.env);
128
+ await qualifyCommandArtifactsCommand({
129
+ ...context,
130
+ directory
131
+ });
132
+ await qualifyInstallerCommand({
133
+ ...context,
134
+ renderer: mode,
135
+ directory
136
+ });
137
+ }
138
+ /** Install the newest earlier release, apply this release's update and observe the new version. */
139
+ function qualifyUpgradeStep(context, directory, onStage) {
140
+ return qualifyUpgradeCommand({
141
+ ...context,
142
+ renderer: renderer(context.env),
143
+ directory,
144
+ ...onStage ? { onStage } : {}
145
+ });
146
+ }
147
+ export { electrobunArtifacts, inspectStagedStep, qualifyStep, qualifyUpgradeStep, releasePlatform, selectRetainedStep, stageBuildStep };
@@ -0,0 +1,19 @@
1
+ import type { InstallerPlatform } from '../installer/installer-layout';
2
+ type Selection = {
3
+ reuse: false;
4
+ } | {
5
+ reuse: true;
6
+ artifactId: string;
7
+ runId: string;
8
+ runAttempt: number;
9
+ digest: string;
10
+ };
11
+ /** Find the first trusted retained platform build, or refuse rebuilding published bytes. */
12
+ export declare function selectRetainedReleaseBuild(options: {
13
+ env: Record<string, string | undefined>;
14
+ config: unknown;
15
+ tag: string;
16
+ platform: InstallerPlatform;
17
+ run?: (args: string[], input?: string) => Promise<string>;
18
+ }): Promise<Selection>;
19
+ export {};
@@ -0,0 +1,122 @@
1
+ import { githubCli } from "./github-cli.js";
2
+ import { lookupRelease } from "./github-release-lookup.js";
3
+ import { parseReleaseConfig, platformPayloads, workflowFile } from "./release-config.js";
4
+ import { createGitHubReleaseCutProvider } from "./github-release-cut.js";
5
+ import { planReleaseAssets, releasePlanGitHubEnvironment } from "./release-assets-plan.js";
6
+ // src/release/retained-release-build.ts
7
+ var record = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
8
+ var id = (value) => {
9
+ if (typeof value === "number" && !Number.isSafeInteger(value)) throw new Error("Invalid GitHub identity");
10
+ const text = String(value);
11
+ if (!/^[1-9]\d{0,19}$/.test(text)) throw new Error("Invalid GitHub identity");
12
+ return text;
13
+ };
14
+ /** Find the first trusted retained platform build, or refuse rebuilding published bytes. */
15
+ async function selectRetainedReleaseBuild(options) {
16
+ const { env, config, tag, platform } = options;
17
+ if (![
18
+ "macos-arm64",
19
+ "windows-x64",
20
+ "linux-x64"
21
+ ].includes(platform) || !record(config) || typeof config.appName !== "string" || env.RELEASE_TAG !== tag) throw new Error("Invalid retained build context");
22
+ const run = options.run ?? githubCli(releasePlanGitHubEnvironment(env));
23
+ const plan = await planReleaseAssets({
24
+ env,
25
+ config,
26
+ tag,
27
+ run
28
+ });
29
+ if (env.SOURCE_SHA !== plan.sourceSha) throw new Error("Retained build source mismatch");
30
+ const parsed = parseReleaseConfig(config), assetsWorkflow = parsed.releaseWorkflows.assets, requirements = parsed.requirements(tag);
31
+ if (requirements.platforms[platform]?.length !== 2) throw new Error("Invalid platform requirements");
32
+ const expected = platformPayloads(requirements, platform);
33
+ const repository = env.GITHUB_REPOSITORY, base = `repos/${repository}`;
34
+ const read = async (path) => JSON.parse(await run(["api", path]));
35
+ const release = await lookupRelease({
36
+ tag,
37
+ base,
38
+ read,
39
+ includeDraft: true
40
+ });
41
+ const hiddenDraft = release === null;
42
+ if (!hiddenDraft && (!record(release) || release.tag_name !== tag)) throw new Error("Invalid release assets");
43
+ const releaseAssets = [];
44
+ if (!hiddenDraft) {
45
+ const releaseId = id(release.id);
46
+ for (let page = 1; page <= 10; page++) {
47
+ const assets = await read(`${base}/releases/${releaseId}/assets?per_page=100&page=${page}`);
48
+ if (!Array.isArray(assets) || assets.length > 100) throw new Error("Invalid release assets");
49
+ releaseAssets.push(...assets);
50
+ if (assets.length < 100) break;
51
+ if (page === 10) throw new Error("Too many release assets");
52
+ }
53
+ }
54
+ if (releaseAssets.some((asset) => !record(asset) || typeof asset.name !== "string") || new Set(releaseAssets.map((asset) => asset.name)).size !== releaseAssets.length) throw new Error("Invalid release assets");
55
+ const published = expected.some((name) => releaseAssets.some((asset) => asset.name === name));
56
+ const provider = createGitHubReleaseCutProvider({
57
+ repository,
58
+ appName: config.appName,
59
+ requirements: parsed.requirements,
60
+ assetsWorkflow,
61
+ releasePleaseManifestPath: parsed.releasePleaseManifestPath,
62
+ run
63
+ });
64
+ const candidates = [], seenArtifacts = /* @__PURE__ */ new Set(), seenRuns = /* @__PURE__ */ new Set();
65
+ for (let page = 1; page <= 10; page++) {
66
+ const response = await read(`${base}/actions/workflows/${workflowFile(assetsWorkflow)}/runs?event=workflow_dispatch&per_page=100&page=${page}`);
67
+ if (!record(response) || !Array.isArray(response.workflow_runs) || response.workflow_runs.length > 100) throw new Error("Invalid release workflow listing");
68
+ for (const value of response.workflow_runs) {
69
+ if (!record(value) || value.display_title !== `framework-release-assets:${tag}` || value.head_branch !== "main" || value.event !== "workflow_dispatch" || value.path !== assetsWorkflow) continue;
70
+ const runId = id(value.id);
71
+ if (seenRuns.has(runId)) throw new Error("Duplicate workflow run");
72
+ seenRuns.add(runId);
73
+ if (value.status !== "completed" && runId !== env.GITHUB_RUN_ID) continue;
74
+ if (typeof value.head_sha !== "string" || !/^[a-f0-9]{40}$/.test(value.head_sha) || !await provider.isMainAncestor(value.head_sha)) throw new Error("Untrusted retained workflow");
75
+ for (let artifactPage = 1; artifactPage <= 10; artifactPage++) {
76
+ const listing = await read(`${base}/actions/runs/${runId}/artifacts?per_page=100&page=${artifactPage}`);
77
+ if (!record(listing) || !Array.isArray(listing.artifacts) || listing.artifacts.length > 100) throw new Error("Invalid retained artifact listing");
78
+ for (const artifact of listing.artifacts) {
79
+ if (!record(artifact) || typeof artifact.name !== "string") throw new Error("Invalid retained artifact");
80
+ const prefix = `framework-build-${tag}-${platform}-${plan.sourceSha}-r${runId}-a`;
81
+ if (!artifact.name.startsWith(prefix)) continue;
82
+ const attemptText = artifact.name.slice(prefix.length);
83
+ if (artifact.expired === true) continue;
84
+ if (!/^[1-9]\d{0,8}$/.test(attemptText) || artifact.expired !== false || typeof artifact.digest !== "string" || !/^sha256:[a-f0-9]{64}$/.test(artifact.digest) || !Number.isSafeInteger(artifact.size_in_bytes) || Number(artifact.size_in_bytes) < 1 || !record(artifact.workflow_run) || id(artifact.workflow_run.id) !== runId || artifact.workflow_run.head_sha !== value.head_sha || artifact.workflow_run.head_branch !== "main") throw new Error("Invalid retained artifact provenance");
85
+ const artifactId = id(artifact.id);
86
+ if (seenArtifacts.has(artifactId)) throw new Error("Duplicate retained artifact");
87
+ seenArtifacts.add(artifactId);
88
+ const attempt = Number(attemptText);
89
+ if (runId === env.GITHUB_RUN_ID && attempt >= Number(env.GITHUB_RUN_ATTEMPT)) continue;
90
+ const attemptRun = await read(`${base}/actions/runs/${runId}/attempts/${attempt}`);
91
+ if (!record(attemptRun) || id(attemptRun.id) !== runId || attemptRun.run_attempt !== attempt || attemptRun.head_sha !== value.head_sha || attemptRun.head_branch !== "main" || attemptRun.event !== "workflow_dispatch" || attemptRun.path !== assetsWorkflow || attemptRun.display_title !== `framework-release-assets:${tag}` || !record(attemptRun.repository) || attemptRun.repository.full_name !== repository || attemptRun.status !== "completed") throw new Error("Retained attempt provenance mismatch");
92
+ const jobs = [];
93
+ for (let jobPage = 1; jobPage <= 10; jobPage++) {
94
+ const data = await read(`${base}/actions/runs/${runId}/attempts/${attempt}/jobs?per_page=100&page=${jobPage}`);
95
+ if (!record(data) || !Array.isArray(data.jobs) || data.jobs.length > 100 || data.jobs.some((job) => !record(job))) throw new Error("Invalid retained job listing");
96
+ jobs.push(...data.jobs);
97
+ if (data.jobs.length < 100) break;
98
+ if (jobPage === 10) throw new Error("Too many retained jobs");
99
+ }
100
+ const build = jobs.filter((job) => job.name === `Build / ${platform}`);
101
+ if (build.length !== 1 || build[0].status !== "completed" || build[0].conclusion !== "success") throw new Error("Retained build job is not successful");
102
+ candidates.push({
103
+ reuse: true,
104
+ artifactId,
105
+ runId,
106
+ runAttempt: attempt,
107
+ digest: artifact.digest
108
+ });
109
+ }
110
+ if (listing.artifacts.length < 100) break;
111
+ if (artifactPage === 10) throw new Error("Too many retained artifacts");
112
+ }
113
+ }
114
+ if (response.workflow_runs.length < 100) break;
115
+ if (page === 10) throw new Error("Too many release workflow runs");
116
+ }
117
+ const sorted = candidates.filter((value) => value.reuse).sort((left, right) => BigInt(left.runId) < BigInt(right.runId) ? -1 : BigInt(left.runId) > BigInt(right.runId) ? 1 : left.runAttempt - right.runAttempt);
118
+ if (sorted.length) return sorted[0];
119
+ if (published) throw new Error("Published payload has no retained build; refusing to rebuild");
120
+ return { reuse: false };
121
+ }
122
+ export { selectRetainedReleaseBuild };
@@ -0,0 +1,61 @@
1
+ import { type ContextualSidebarProps } from '@adea-ai/ui/components/layout/contextual-sidebar';
2
+ import { type JSX } from 'solid-js';
3
+ export type ApplicationDestination = Readonly<{
4
+ id: string;
5
+ label: string;
6
+ icon: JSX.Element;
7
+ }>;
8
+ export type ApplicationShellProps = {
9
+ name: string;
10
+ mark: JSX.Element;
11
+ destinations: readonly ApplicationDestination[];
12
+ activeDestination: string;
13
+ onNavigate(id: string): void;
14
+ title: JSX.Element;
15
+ content: JSX.Element;
16
+ sidebar?: ContextualSidebarProps;
17
+ onSearch?: () => void;
18
+ searchLabel?: string;
19
+ searchKeys?: readonly string[];
20
+ footer?: JSX.Element;
21
+ navigation?: JSX.Element;
22
+ workspace?: JSX.Element;
23
+ search?: JSX.Element;
24
+ actions?: JSX.Element;
25
+ status?: JSX.Element;
26
+ draggable?: boolean;
27
+ macosInset?: boolean;
28
+ windowsInset?: boolean;
29
+ /** Replaces the rail's destination list, for apps that compose their own sections. */
30
+ rail?: JSX.Element;
31
+ /**
32
+ * Navigation for narrow windows, where the rail is hidden and the toolbar toggle opens
33
+ * this in a drawer. `close` dismisses the drawer, e.g. after a destination is chosen.
34
+ */
35
+ drawer?(close: () => void): JSX.Element;
36
+ /** When the window counts as narrow; defaults to `(max-width: 799px)`. */
37
+ narrowQuery?: string;
38
+ /**
39
+ * A leading pane the app renders inside its own content (a multi-pane workspace), which
40
+ * the toolbar toggle and chord control in place of a contextual sidebar. `id` names the
41
+ * pane's element so the toggle can point at it.
42
+ */
43
+ pane?: Readonly<{
44
+ open: boolean;
45
+ onOpenChange(open: boolean): void;
46
+ width?: number;
47
+ id?: string;
48
+ /** What the toggle names the pane, as in "Collapse sidebar"; defaults to `sidebar`. */
49
+ label?: string;
50
+ }>;
51
+ /**
52
+ * For apps whose views render their own `<main>`: the id of the active view's main
53
+ * landmark. The shell then wraps content in a plain container and the skip link targets
54
+ * this id instead of the shell's own main.
55
+ */
56
+ viewLandmark?: string;
57
+ /** Classes for the shell's root element. */
58
+ class?: string;
59
+ };
60
+ /** Shared chrome and navigation composition; applications own routes and services. */
61
+ export declare function ApplicationShell(props: ApplicationShellProps): JSX.Element;