@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.
- package/LICENSE +201 -0
- package/NOTICE +30 -0
- package/README.md +967 -2
- package/dist/app/application.d.ts +47 -0
- package/dist/app/application.js +115 -0
- package/dist/app/create-application.d.ts +13 -0
- package/dist/app/create-application.js +178 -0
- package/dist/app/service-registry.d.ts +44 -0
- package/dist/app/service-registry.js +116 -0
- package/dist/appearance/appearance-host.d.ts +62 -0
- package/dist/appearance/appearance-host.js +115 -0
- package/dist/appearance/appearance-preferences.d.ts +106 -0
- package/dist/appearance/appearance-preferences.js +175 -0
- package/dist/appearance/composition.d.ts +11 -0
- package/dist/appearance/composition.js +16 -0
- package/dist/appearance/custom-theme-import.d.ts +14 -0
- package/dist/appearance/custom-theme-import.js +315 -0
- package/dist/appearance/custom-theme-library.d.ts +146 -0
- package/dist/appearance/custom-theme-library.js +378 -0
- package/dist/appearance/editor.d.ts +20 -0
- package/dist/appearance/editor.js +47 -0
- package/dist/appearance/theme-file-importer.d.ts +23 -0
- package/dist/appearance/theme-file-importer.js +66 -0
- package/dist/appearance/theme-record-adapter.d.ts +26 -0
- package/dist/appearance/theme-record-adapter.js +64 -0
- package/dist/appearance/theme-registry.d.ts +10 -0
- package/dist/appearance/theme-registry.js +16 -0
- package/dist/appearance/window-surface.d.ts +5 -0
- package/dist/appearance/window-surface.js +9 -0
- package/dist/ci/toolchain-identity.d.ts +39 -0
- package/dist/ci/toolchain-identity.js +196 -0
- package/dist/cli/cef-helper-cli.d.ts +2 -0
- package/dist/cli/cef-helper-cli.js +18 -0
- package/dist/cli/cli-runner.d.ts +8 -0
- package/dist/cli/cli-runner.js +23 -0
- package/dist/cli/create-application-cli.d.ts +2 -0
- package/dist/cli/create-application-cli.js +40 -0
- package/dist/cli/electrobun-shortcut-patch-cli.d.ts +2 -0
- package/dist/cli/electrobun-shortcut-patch-cli.js +17 -0
- package/dist/cli/framework-update-cli.d.ts +2 -0
- package/dist/cli/framework-update-cli.js +40 -0
- package/dist/cli/release-assets-plan-cli.d.ts +2 -0
- package/dist/cli/release-assets-plan-cli.js +14 -0
- package/dist/cli/release-cut-cli.d.ts +2 -0
- package/dist/cli/release-cut-cli.js +27 -0
- package/dist/cli/release-descriptor-staging-cli.d.ts +2 -0
- package/dist/cli/release-descriptor-staging-cli.js +45 -0
- package/dist/cli/release-finalize-cli.d.ts +1 -0
- package/dist/cli/release-finalize-cli.js +30 -0
- package/dist/cli/release-promote-cli.d.ts +2 -0
- package/dist/cli/release-promote-cli.js +32 -0
- package/dist/cli/release-publish-cli.d.ts +2 -0
- package/dist/cli/release-publish-cli.js +48 -0
- package/dist/cli/release-sign-cli.d.ts +2 -0
- package/dist/cli/release-sign-cli.js +13 -0
- package/dist/cli/release-step-cli.d.ts +2 -0
- package/dist/cli/release-step-cli.js +44 -0
- package/dist/cli/toolchain-identity-cli.d.ts +2 -0
- package/dist/cli/toolchain-identity-cli.js +10 -0
- package/dist/cli/update-helper-cli.d.ts +1 -0
- package/dist/cli/update-helper-cli.js +10 -0
- package/dist/cli/windows-runtime-patch-cli.d.ts +2 -0
- package/dist/cli/windows-runtime-patch-cli.js +17 -0
- package/dist/desktop/application-command-client.d.ts +15 -0
- package/dist/desktop/application-command-client.js +21 -0
- package/dist/desktop/channel-handshake.d.ts +32 -0
- package/dist/desktop/channel-handshake.js +111 -0
- package/dist/desktop/channel-proof.d.ts +43 -0
- package/dist/desktop/channel-proof.js +85 -0
- package/dist/desktop/client-assets.d.ts +7 -0
- package/dist/desktop/client-assets.js +59 -0
- package/dist/desktop/desktop-client.d.ts +23 -0
- package/dist/desktop/desktop-client.js +231 -0
- package/dist/desktop/desktop-gateway.d.ts +18 -0
- package/dist/desktop/desktop-gateway.js +146 -0
- package/dist/desktop/desktop-host.d.ts +48 -0
- package/dist/desktop/desktop-host.js +208 -0
- package/dist/desktop/desktop-stream.d.ts +36 -0
- package/dist/desktop/desktop-stream.js +231 -0
- package/dist/desktop/loopback-policy.d.ts +19 -0
- package/dist/desktop/loopback-policy.js +23 -0
- package/dist/desktop/open-url-channel.d.ts +15 -0
- package/dist/desktop/open-url-channel.js +55 -0
- package/dist/desktop/string-policy.d.ts +2 -0
- package/dist/desktop/string-policy.js +11 -0
- package/dist/framework-source.json +1 -0
- package/dist/installer/archive-entry.d.ts +6 -0
- package/dist/installer/archive-entry.js +14 -0
- package/dist/installer/command-artifact.d.ts +47 -0
- package/dist/installer/command-artifact.js +261 -0
- package/dist/installer/command-qualification-command.d.ts +12 -0
- package/dist/installer/command-qualification-command.js +71 -0
- package/dist/installer/hosted-runner.d.ts +4 -0
- package/dist/installer/hosted-runner.js +10 -0
- package/dist/installer/installed-payload.d.ts +29 -0
- package/dist/installer/installed-payload.js +312 -0
- package/dist/installer/installer-ci-bootstrap.d.ts +26 -0
- package/dist/installer/installer-ci-bootstrap.js +160 -0
- package/dist/installer/installer-ci-preflight.d.ts +1 -0
- package/dist/installer/installer-ci-preflight.js +49 -0
- package/dist/installer/installer-ci-worker.d.ts +1 -0
- package/dist/installer/installer-ci-worker.js +105 -0
- package/dist/installer/installer-extraction.d.ts +14 -0
- package/dist/installer/installer-extraction.js +289 -0
- package/dist/installer/installer-fetch-guard.d.ts +15 -0
- package/dist/installer/installer-fetch-guard.js +50 -0
- package/dist/installer/installer-identity.d.ts +23 -0
- package/dist/installer/installer-identity.js +286 -0
- package/dist/installer/installer-layout.d.ts +21 -0
- package/dist/installer/installer-layout.js +89 -0
- package/dist/installer/installer-observation.d.ts +64 -0
- package/dist/installer/installer-observation.js +473 -0
- package/dist/installer/installer-process-cleanup.d.ts +18 -0
- package/dist/installer/installer-process-cleanup.js +158 -0
- package/dist/installer/installer-qualification-command.d.ts +11 -0
- package/dist/installer/installer-qualification-command.js +71 -0
- package/dist/installer/installer-renderer-evidence.d.ts +43 -0
- package/dist/installer/installer-renderer-evidence.js +136 -0
- package/dist/installer/installer-upgrade-command.d.ts +37 -0
- package/dist/installer/installer-upgrade-command.js +172 -0
- package/dist/installer/installer-worker-guard.d.ts +21 -0
- package/dist/installer/installer-worker-guard.js +72 -0
- package/dist/installer/native-executable.d.ts +5 -0
- package/dist/installer/native-executable.js +21 -0
- package/dist/installer/upgrade-asset-download.d.ts +13 -0
- package/dist/installer/upgrade-asset-download.js +41 -0
- package/dist/installer/write-all.d.ts +6 -0
- package/dist/installer/write-all.js +11 -0
- package/dist/native/app-bundle.d.ts +28 -0
- package/dist/native/app-bundle.js +60 -0
- package/dist/native/cef-helper.d.ts +28 -0
- package/dist/native/cef-helper.js +402 -0
- package/dist/native/desktop-build-hook.d.ts +7 -0
- package/dist/native/desktop-build-hook.js +20 -0
- package/dist/native/electrobun-source-patch.d.ts +25 -0
- package/dist/native/electrobun-source-patch.js +93 -0
- package/dist/native/linux-cef-links.d.ts +2 -0
- package/dist/native/linux-cef-links.js +15 -0
- package/dist/native/native-secret-store.d.ts +27 -0
- package/dist/native/native-secret-store.js +70 -0
- package/dist/native/native-utilities.d.ts +24 -0
- package/dist/native/native-utilities.js +85 -0
- package/dist/native/partitioned-window.d.ts +34 -0
- package/dist/native/partitioned-window.js +44 -0
- package/dist/native/renderer-profile.d.ts +53 -0
- package/dist/native/renderer-profile.js +30 -0
- package/dist/native/secure-window.d.ts +38 -0
- package/dist/native/secure-window.js +77 -0
- package/dist/native/sidecar-services.d.ts +23 -0
- package/dist/native/sidecar-services.js +46 -0
- package/dist/native/sidecar.d.ts +81 -0
- package/dist/native/sidecar.js +250 -0
- package/dist/native/window-bootstrap.d.ts +24 -0
- package/dist/native/window-bootstrap.js +63 -0
- package/dist/native/window-options.d.ts +32 -0
- package/dist/native/window-options.js +23 -0
- package/dist/native/windows-build-hook-internal.d.ts +2 -0
- package/dist/native/windows-build-hook-internal.js +32 -0
- package/dist/native/windows-build-hook.d.ts +2 -0
- package/dist/native/windows-build-hook.js +12 -0
- package/dist/native/windows-runtime-patch-internal.d.ts +3 -0
- package/dist/native/windows-runtime-patch-internal.js +20 -0
- package/dist/native/windows-runtime-patch.d.ts +4 -0
- package/dist/native/windows-runtime-patch.js +12 -0
- package/dist/release/feed-release-cut.d.ts +23 -0
- package/dist/release/feed-release-cut.js +93 -0
- package/dist/release/feed-state.d.ts +25 -0
- package/dist/release/feed-state.js +81 -0
- package/dist/release/framework-package-publish.d.ts +21 -0
- package/dist/release/framework-package-publish.js +125 -0
- package/dist/release/framework-update.d.ts +30 -0
- package/dist/release/framework-update.js +139 -0
- package/dist/release/github-cli.d.ts +6 -0
- package/dist/release/github-cli.js +16 -0
- package/dist/release/github-release-assets.d.ts +3 -0
- package/dist/release/github-release-assets.js +24 -0
- package/dist/release/github-release-cut.d.ts +14 -0
- package/dist/release/github-release-cut.js +174 -0
- package/dist/release/github-release-lookup.d.ts +7 -0
- package/dist/release/github-release-lookup.js +29 -0
- package/dist/release/github-release-promotion.d.ts +10 -0
- package/dist/release/github-release-promotion.js +78 -0
- package/dist/release/github-release-provenance.d.ts +9 -0
- package/dist/release/github-release-provenance.js +27 -0
- package/dist/release/github-release-publisher.d.ts +9 -0
- package/dist/release/github-release-publisher.js +63 -0
- package/dist/release/github-release-qualification.d.ts +12 -0
- package/dist/release/github-release-qualification.js +80 -0
- package/dist/release/local-provenance.d.ts +24 -0
- package/dist/release/local-provenance.js +72 -0
- package/dist/release/local-release.d.ts +133 -0
- package/dist/release/local-release.js +387 -0
- package/dist/release/macos-dmg.d.ts +22 -0
- package/dist/release/macos-dmg.js +91 -0
- package/dist/release/release-artifact.d.ts +6 -0
- package/dist/release/release-artifact.js +38 -0
- package/dist/release/release-assets-plan.d.ts +14 -0
- package/dist/release/release-assets-plan.js +65 -0
- package/dist/release/release-config.d.ts +76 -0
- package/dist/release/release-config.js +180 -0
- package/dist/release/release-cut-command.d.ts +13 -0
- package/dist/release/release-cut-command.js +39 -0
- package/dist/release/release-cut.d.ts +54 -0
- package/dist/release/release-cut.js +76 -0
- package/dist/release/release-descriptor-staging.d.ts +34 -0
- package/dist/release/release-descriptor-staging.js +147 -0
- package/dist/release/release-finalize.d.ts +16 -0
- package/dist/release/release-finalize.js +104 -0
- package/dist/release/release-promotion-command.d.ts +12 -0
- package/dist/release/release-promotion-command.js +28 -0
- package/dist/release/release-promotion.d.ts +29 -0
- package/dist/release/release-promotion.js +57 -0
- package/dist/release/release-publication.d.ts +33 -0
- package/dist/release/release-publication.js +138 -0
- package/dist/release/release-publish-command.d.ts +7 -0
- package/dist/release/release-publish-command.js +91 -0
- package/dist/release/release-qualification.d.ts +106 -0
- package/dist/release/release-qualification.js +135 -0
- package/dist/release/release-staging.d.ts +9 -0
- package/dist/release/release-staging.js +61 -0
- package/dist/release/release-steps.d.ts +38 -0
- package/dist/release/release-steps.js +147 -0
- package/dist/release/retained-release-build.d.ts +19 -0
- package/dist/release/retained-release-build.js +122 -0
- package/dist/shell/app-shell.d.ts +61 -0
- package/dist/shell/app-shell.js +318 -0
- package/dist/shell/app-utilities.d.ts +122 -0
- package/dist/shell/app-utilities.js +334 -0
- package/dist/shell/application-menu-commands.d.ts +5 -0
- package/dist/shell/application-menu-commands.js +11 -0
- package/dist/shell/application-menu.d.ts +61 -0
- package/dist/shell/application-menu.js +208 -0
- package/dist/shell/help-shortcuts.d.ts +12 -0
- package/dist/shell/help-shortcuts.js +22 -0
- package/dist/shell/settings-sections.d.ts +31 -0
- package/dist/shell/settings-sections.js +50 -0
- package/dist/shell/shortcut-platform.d.ts +17 -0
- package/dist/shell/shortcut-platform.js +25 -0
- package/dist/update-helper.bundle.js +260 -0
- package/dist/updates/channel-update-manager.d.ts +46 -0
- package/dist/updates/channel-update-manager.js +114 -0
- package/dist/updates/desktop-updater.d.ts +104 -0
- package/dist/updates/desktop-updater.js +345 -0
- package/dist/updates/release-feed.d.ts +61 -0
- package/dist/updates/release-feed.js +111 -0
- package/dist/updates/release-location.d.ts +9 -0
- package/dist/updates/release-location.js +80 -0
- package/dist/updates/release-version.d.ts +12 -0
- package/dist/updates/release-version.js +43 -0
- package/dist/updates/signed-release.d.ts +63 -0
- package/dist/updates/signed-release.js +162 -0
- package/dist/updates/stable-file.d.ts +10 -0
- package/dist/updates/stable-file.js +22 -0
- package/dist/updates/update-adapter.d.ts +57 -0
- package/dist/updates/update-adapter.js +72 -0
- package/dist/updates/update-arm.d.ts +24 -0
- package/dist/updates/update-arm.js +95 -0
- package/dist/updates/update-channel-store.d.ts +8 -0
- package/dist/updates/update-channel-store.js +72 -0
- package/dist/updates/update-discovery.d.ts +13 -0
- package/dist/updates/update-discovery.js +56 -0
- package/dist/updates/update-download.d.ts +14 -0
- package/dist/updates/update-download.js +67 -0
- package/dist/updates/update-exclusive-rename.d.ts +2 -0
- package/dist/updates/update-exclusive-rename.js +52 -0
- package/dist/updates/update-extraction.d.ts +18 -0
- package/dist/updates/update-extraction.js +183 -0
- package/dist/updates/update-handoff-plan.d.ts +22 -0
- package/dist/updates/update-handoff-plan.js +28 -0
- package/dist/updates/update-helper.d.ts +24 -0
- package/dist/updates/update-helper.js +56 -0
- package/dist/updates/update-launch.d.ts +5 -0
- package/dist/updates/update-launch.js +27 -0
- package/dist/updates/update-manager.d.ts +40 -0
- package/dist/updates/update-manager.js +83 -0
- package/dist/updates/update-process-fence.d.ts +10 -0
- package/dist/updates/update-process-fence.js +114 -0
- package/dist/updates/update-resume.d.ts +13 -0
- package/dist/updates/update-resume.js +34 -0
- package/dist/updates/update-shutdown.d.ts +15 -0
- package/dist/updates/update-shutdown.js +29 -0
- package/dist/updates/update-state.d.ts +30 -0
- package/dist/updates/update-state.js +18 -0
- package/dist/updates/update-swap-stage.d.ts +27 -0
- package/dist/updates/update-swap-stage.js +58 -0
- package/dist/updates/update-swap.d.ts +10 -0
- package/dist/updates/update-swap.js +30 -0
- package/dist/views/app-about.d.ts +22 -0
- package/dist/views/app-about.js +43 -0
- package/dist/views/app-appearance.d.ts +11 -0
- package/dist/views/app-appearance.js +42 -0
- package/dist/views/app-help.d.ts +17 -0
- package/dist/views/app-help.js +42 -0
- package/dist/views/app-settings.d.ts +26 -0
- package/dist/views/app-settings.js +97 -0
- package/dist/views/appearance-surface.d.ts +9 -0
- package/dist/views/appearance-surface.js +334 -0
- package/dist/views/update-surface.d.ts +34 -0
- package/dist/views/update-surface.js +64 -0
- package/package.json +363 -4
- package/src/app/application.tsx +138 -0
- package/src/app/create-application.ts +245 -0
- package/src/app/service-registry.ts +124 -0
- package/src/appearance/appearance-host.tsx +205 -0
- package/src/appearance/appearance-preferences.ts +287 -0
- package/src/appearance/composition.ts +29 -0
- package/src/appearance/custom-theme-import.ts +424 -0
- package/src/appearance/custom-theme-library.ts +600 -0
- package/src/appearance/editor.ts +94 -0
- package/src/appearance/theme-file-importer.ts +103 -0
- package/src/appearance/theme-record-adapter.ts +106 -0
- package/src/appearance/theme-registry.ts +20 -0
- package/src/appearance/window-surface.ts +18 -0
- package/src/ci/toolchain-identity.ts +244 -0
- package/src/cli/cef-helper-cli.ts +21 -0
- package/src/cli/cli-runner.ts +29 -0
- package/src/cli/create-application-cli.ts +62 -0
- package/src/cli/electrobun-shortcut-patch-cli.ts +24 -0
- package/src/cli/framework-update-cli.ts +41 -0
- package/src/cli/release-assets-plan-cli.ts +14 -0
- package/src/cli/release-cut-cli.ts +41 -0
- package/src/cli/release-descriptor-staging-cli.ts +57 -0
- package/src/cli/release-finalize-cli.ts +34 -0
- package/src/cli/release-promote-cli.ts +31 -0
- package/src/cli/release-publish-cli.ts +46 -0
- package/src/cli/release-sign-cli.ts +24 -0
- package/src/cli/release-step-cli.ts +71 -0
- package/src/cli/toolchain-identity-cli.ts +12 -0
- package/src/cli/update-helper-cli.ts +12 -0
- package/src/cli/windows-runtime-patch-cli.ts +17 -0
- package/src/desktop/application-command-client.ts +43 -0
- package/src/desktop/channel-handshake.ts +136 -0
- package/src/desktop/channel-proof.ts +122 -0
- package/src/desktop/client-assets.ts +75 -0
- package/src/desktop/desktop-client.ts +303 -0
- package/src/desktop/desktop-gateway.ts +189 -0
- package/src/desktop/desktop-host.ts +335 -0
- package/src/desktop/desktop-stream.ts +324 -0
- package/src/desktop/loopback-policy.ts +41 -0
- package/src/desktop/open-url-channel.ts +79 -0
- package/src/desktop/string-policy.ts +9 -0
- package/src/installer/archive-entry.ts +32 -0
- package/src/installer/command-artifact.ts +307 -0
- package/src/installer/command-qualification-command.ts +75 -0
- package/src/installer/hosted-runner.ts +11 -0
- package/src/installer/installed-payload.ts +408 -0
- package/src/installer/installer-ci-bootstrap.ts +199 -0
- package/src/installer/installer-ci-preflight.ts +61 -0
- package/src/installer/installer-ci-worker.ts +105 -0
- package/src/installer/installer-extraction.ts +367 -0
- package/src/installer/installer-fetch-guard.ts +75 -0
- package/src/installer/installer-identity.ts +331 -0
- package/src/installer/installer-layout.ts +167 -0
- package/src/installer/installer-observation.ts +671 -0
- package/src/installer/installer-process-cleanup.ts +167 -0
- package/src/installer/installer-qualification-command.ts +81 -0
- package/src/installer/installer-renderer-evidence.ts +268 -0
- package/src/installer/installer-upgrade-command.ts +226 -0
- package/src/installer/installer-worker-guard.ts +112 -0
- package/src/installer/native-executable.ts +37 -0
- package/src/installer/upgrade-asset-download.ts +72 -0
- package/src/installer/write-all.ts +19 -0
- package/src/native/app-bundle.ts +86 -0
- package/src/native/cef-helper.ts +471 -0
- package/src/native/desktop-build-hook.ts +21 -0
- package/src/native/electrobun-cef-main-frame-bridges.patch +63 -0
- package/src/native/electrobun-source-patch.ts +107 -0
- package/src/native/electrobun-windows-shortcut-com.patch +923 -0
- package/src/native/linux-cef-links.ts +14 -0
- package/src/native/native-secret-store.ts +99 -0
- package/src/native/native-utilities.ts +166 -0
- package/src/native/partitioned-window.ts +62 -0
- package/src/native/renderer-profile.ts +27 -0
- package/src/native/secure-window.ts +115 -0
- package/src/native/sidecar-services.ts +71 -0
- package/src/native/sidecar.ts +387 -0
- package/src/native/window-bootstrap.ts +77 -0
- package/src/native/window-options.ts +24 -0
- package/src/native/windows-build-hook-internal.ts +49 -0
- package/src/native/windows-build-hook.ts +12 -0
- package/src/native/windows-runtime-patch-internal.ts +48 -0
- package/src/native/windows-runtime-patch.ts +15 -0
- package/src/release/feed-release-cut.ts +110 -0
- package/src/release/feed-state.ts +135 -0
- package/src/release/framework-package-publish.ts +163 -0
- package/src/release/framework-update.ts +196 -0
- package/src/release/github-cli.ts +27 -0
- package/src/release/github-release-assets.ts +36 -0
- package/src/release/github-release-cut.ts +237 -0
- package/src/release/github-release-lookup.ts +39 -0
- package/src/release/github-release-promotion.ts +112 -0
- package/src/release/github-release-provenance.ts +65 -0
- package/src/release/github-release-publisher.ts +90 -0
- package/src/release/github-release-qualification.ts +144 -0
- package/src/release/local-provenance.ts +92 -0
- package/src/release/local-release.ts +525 -0
- package/src/release/macos-dmg.ts +113 -0
- package/src/release/release-artifact.ts +53 -0
- package/src/release/release-assets-plan.ts +118 -0
- package/src/release/release-config.ts +420 -0
- package/src/release/release-cut-command.ts +80 -0
- package/src/release/release-cut.ts +133 -0
- package/src/release/release-descriptor-staging.ts +242 -0
- package/src/release/release-finalize.ts +191 -0
- package/src/release/release-promotion-command.ts +36 -0
- package/src/release/release-promotion.ts +132 -0
- package/src/release/release-publication.ts +213 -0
- package/src/release/release-publish-command.ts +163 -0
- package/src/release/release-qualification.ts +397 -0
- package/src/release/release-staging.ts +87 -0
- package/src/release/release-steps.ts +173 -0
- package/src/release/retained-release-build.ts +217 -0
- package/src/shell/app-shell.tsx +285 -0
- package/src/shell/app-utilities.tsx +437 -0
- package/src/shell/application-menu-commands.ts +6 -0
- package/src/shell/application-menu.ts +250 -0
- package/src/shell/help-shortcuts.ts +24 -0
- package/src/shell/settings-sections.ts +74 -0
- package/src/shell/shortcut-platform.ts +35 -0
- package/src/updates/channel-update-manager.ts +127 -0
- package/src/updates/desktop-updater.ts +440 -0
- package/src/updates/release-feed.ts +187 -0
- package/src/updates/release-location.ts +101 -0
- package/src/updates/release-version.ts +57 -0
- package/src/updates/signed-release.ts +311 -0
- package/src/updates/stable-file.ts +32 -0
- package/src/updates/update-adapter.ts +129 -0
- package/src/updates/update-arm.ts +107 -0
- package/src/updates/update-channel-store.ts +86 -0
- package/src/updates/update-discovery.ts +113 -0
- package/src/updates/update-download.ts +82 -0
- package/src/updates/update-exclusive-rename.ts +58 -0
- package/src/updates/update-extraction.ts +261 -0
- package/src/updates/update-handoff-plan.ts +75 -0
- package/src/updates/update-helper.ts +87 -0
- package/src/updates/update-launch.ts +33 -0
- package/src/updates/update-manager.ts +130 -0
- package/src/updates/update-process-fence.ts +125 -0
- package/src/updates/update-resume.ts +34 -0
- package/src/updates/update-shutdown.ts +37 -0
- package/src/updates/update-state.ts +34 -0
- package/src/updates/update-swap-stage.ts +75 -0
- package/src/updates/update-swap.ts +30 -0
- package/src/views/app-about.tsx +44 -0
- package/src/views/app-appearance.tsx +32 -0
- package/src/views/app-help.tsx +43 -0
- package/src/views/app-settings.tsx +88 -0
- package/src/views/appearance-surface.tsx +427 -0
- package/src/views/update-surface.tsx +85 -0
- package/templates/application/.gitattributes +1 -0
- package/templates/application/.github/workflows/release-assets.yml +29 -0
- package/templates/application/.github/workflows/release-finalize.yml +29 -0
- package/templates/application/.github/workflows/release-please.yml +19 -0
- package/templates/application/.github/workflows/release.yml +29 -0
- package/templates/application/.github/workflows/validation.yml +28 -0
- package/templates/application/.oxfmtrc.json +6 -0
- package/templates/application/.oxlintrc.json +48 -0
- package/templates/application/.release-please-manifest.json +3 -0
- package/templates/application/README.md +47 -0
- package/templates/application/electrobun.config.ts +22 -0
- package/templates/application/release-please-config.json +12 -0
- package/templates/application/scripts/app-version.ts +9 -0
- package/templates/application/scripts/build-desktop.ts +34 -0
- package/templates/application/scripts/secure-build.ts +1 -0
- package/templates/application/scripts/stage-release.ts +21 -0
- package/templates/application/src/bun/index.ts +80 -0
- package/templates/application/src/electrobun.d.ts +27 -0
- package/templates/application/src/web/index.html +12 -0
- package/templates/application/src/web/main.tsx +97 -0
- package/templates/application/src/web/public/icon.svg +1 -0
- package/templates/application/src/web/style.css +3 -0
- package/templates/application/tests/app-config.test.ts +9 -0
- package/templates/application/tsconfig.json +15 -0
- package/templates/application/vite.config.ts +10 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { containsAsciiControl } from '../desktop/string-policy'
|
|
2
|
+
|
|
3
|
+
/** Release qualification adapted from adea-ai/adea scripts/release-policy.mjs
|
|
4
|
+
* and scripts/desktop-renderer-probe.mjs, commit 6155d18941acbb14d9099bc2a33a50ee9683a068 (Apache-2.0). */
|
|
5
|
+
export type Artifact = { name: string; size: number; digest: string }
|
|
6
|
+
export type ReleaseIdentity = {
|
|
7
|
+
tag: string
|
|
8
|
+
sourceSha: string
|
|
9
|
+
workflowSha: string
|
|
10
|
+
runId: string
|
|
11
|
+
runAttempt: number
|
|
12
|
+
}
|
|
13
|
+
export type OfflinePolicy =
|
|
14
|
+
| { kind: 'standalone'; marker: string }
|
|
15
|
+
| { kind: 'local-bootstrap'; marker: string; path: string }
|
|
16
|
+
export type RendererEvidence = {
|
|
17
|
+
method: string
|
|
18
|
+
origin: string
|
|
19
|
+
samples: number
|
|
20
|
+
guardInstalled: boolean
|
|
21
|
+
bootstrapDenied: boolean
|
|
22
|
+
offlineObserved: boolean
|
|
23
|
+
unexpectedActivity: boolean
|
|
24
|
+
elapsedMs: number
|
|
25
|
+
visible: boolean
|
|
26
|
+
readyState: string
|
|
27
|
+
width: number
|
|
28
|
+
height: number
|
|
29
|
+
interactiveElements: number
|
|
30
|
+
textLength: number
|
|
31
|
+
markerObserved?: boolean
|
|
32
|
+
browserNetworkRestricted?: boolean
|
|
33
|
+
offlinePolicy?: OfflinePolicy
|
|
34
|
+
}
|
|
35
|
+
export type InstallerReceipt = ReleaseIdentity & {
|
|
36
|
+
schema: number
|
|
37
|
+
platform: string
|
|
38
|
+
installed: boolean
|
|
39
|
+
launched: boolean
|
|
40
|
+
rendererReady: boolean
|
|
41
|
+
rendererEvidence: RendererEvidence
|
|
42
|
+
assets: Artifact[]
|
|
43
|
+
}
|
|
44
|
+
/** One command artifact extracted into a clean location and run there. */
|
|
45
|
+
export type CommandReceipt = ReleaseIdentity & {
|
|
46
|
+
schema: 1
|
|
47
|
+
kind: string
|
|
48
|
+
platform: string
|
|
49
|
+
installed: boolean
|
|
50
|
+
versionMatched: boolean
|
|
51
|
+
probesPassed: boolean
|
|
52
|
+
serviceStarted: boolean
|
|
53
|
+
/** How the service was stopped: SIGTERM with a clean exit, or the Windows process tree. */
|
|
54
|
+
serviceStopped: 'sigterm' | 'process-tree'
|
|
55
|
+
asset: Artifact
|
|
56
|
+
}
|
|
57
|
+
export type Qualification = ReleaseIdentity & {
|
|
58
|
+
schema: number
|
|
59
|
+
platforms: string[]
|
|
60
|
+
installerTests: string[]
|
|
61
|
+
installerReceipts: InstallerReceipt[]
|
|
62
|
+
/** Present exactly when the release requires command artifacts. */
|
|
63
|
+
commandReceipts?: CommandReceipt[]
|
|
64
|
+
assets: Artifact[]
|
|
65
|
+
}
|
|
66
|
+
export type Requirements = {
|
|
67
|
+
platforms: Record<string, readonly string[]>
|
|
68
|
+
releaseAssets: readonly string[]
|
|
69
|
+
offlinePolicy?: OfflinePolicy
|
|
70
|
+
/** Command artifact asset names by kind, then platform; absent when the app ships none. */
|
|
71
|
+
commandArtifacts?: Record<string, Record<string, string>>
|
|
72
|
+
}
|
|
73
|
+
export type Release = { tag_name: string; draft: boolean; assets: Artifact[] }
|
|
74
|
+
|
|
75
|
+
function assert(condition: unknown, message: string): asserts condition {
|
|
76
|
+
if (!condition) throw new Error(message)
|
|
77
|
+
}
|
|
78
|
+
function expectedAssets(requirements: Requirements): string[] {
|
|
79
|
+
if (Object.hasOwn(requirements, 'offlinePolicy')) parseOfflinePolicy(requirements.offlinePolicy)
|
|
80
|
+
const platforms = Object.entries(requirements.platforms)
|
|
81
|
+
assert(platforms.length > 0, 'Missing platforms')
|
|
82
|
+
const names = [
|
|
83
|
+
...platforms.flatMap(([platform, artifacts]) => {
|
|
84
|
+
assert(/^[a-z0-9-]+$/.test(platform) && artifacts.length > 0, 'Invalid platform requirements')
|
|
85
|
+
return artifacts
|
|
86
|
+
}),
|
|
87
|
+
...Object.entries(requirements.commandArtifacts ?? {}).flatMap(([kind, byPlatform]) => {
|
|
88
|
+
assert(
|
|
89
|
+
/^[a-z][a-z0-9-]{0,31}$/.test(kind) &&
|
|
90
|
+
Object.keys(byPlatform).length === platforms.length &&
|
|
91
|
+
platforms.every(([platform]) => typeof byPlatform[platform] === 'string'),
|
|
92
|
+
'Invalid command artifact requirements'
|
|
93
|
+
)
|
|
94
|
+
return Object.values(byPlatform)
|
|
95
|
+
}),
|
|
96
|
+
...requirements.releaseAssets,
|
|
97
|
+
]
|
|
98
|
+
assert(
|
|
99
|
+
names.length > 0 &&
|
|
100
|
+
names.every((name) => /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(name)) &&
|
|
101
|
+
new Set(names).size === names.length,
|
|
102
|
+
'Invalid or duplicate asset requirements'
|
|
103
|
+
)
|
|
104
|
+
return names
|
|
105
|
+
}
|
|
106
|
+
function matches(saved: Artifact, uploaded: Artifact): boolean {
|
|
107
|
+
return Boolean(
|
|
108
|
+
saved &&
|
|
109
|
+
uploaded &&
|
|
110
|
+
saved.name === uploaded.name &&
|
|
111
|
+
Number.isSafeInteger(saved.size) &&
|
|
112
|
+
saved.size > 0 &&
|
|
113
|
+
saved.size === uploaded.size &&
|
|
114
|
+
/^sha256:[a-f0-9]{64}$/.test(saved.digest) &&
|
|
115
|
+
saved.digest === uploaded.digest
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
function uniqueAsset(assets: Artifact[], name: string): Artifact {
|
|
119
|
+
const found = assets.filter((asset) => asset.name === name)
|
|
120
|
+
assert(found.length === 1, `Missing or duplicate asset: ${name}`)
|
|
121
|
+
return found[0]!
|
|
122
|
+
}
|
|
123
|
+
export function parseOfflinePolicy(value: unknown): OfflinePolicy {
|
|
124
|
+
assert(
|
|
125
|
+
typeof value === 'object' && value !== null && !Array.isArray(value),
|
|
126
|
+
'Invalid offline policy'
|
|
127
|
+
)
|
|
128
|
+
const policy = value as Record<string, unknown>
|
|
129
|
+
assert(
|
|
130
|
+
typeof policy.marker === 'string' &&
|
|
131
|
+
policy.marker.trim().length > 0 &&
|
|
132
|
+
policy.marker.length <= 256 &&
|
|
133
|
+
!containsAsciiControl(policy.marker),
|
|
134
|
+
'Invalid offline marker'
|
|
135
|
+
)
|
|
136
|
+
if (policy.kind === 'standalone') {
|
|
137
|
+
assert(Object.keys(policy).length === 2, 'Invalid standalone offline policy')
|
|
138
|
+
return { kind: 'standalone', marker: policy.marker }
|
|
139
|
+
}
|
|
140
|
+
assert(
|
|
141
|
+
policy.kind === 'local-bootstrap' &&
|
|
142
|
+
Object.keys(policy).length === 3 &&
|
|
143
|
+
typeof policy.path === 'string' &&
|
|
144
|
+
policy.path.length <= 256 &&
|
|
145
|
+
/^\/(?:[A-Za-z0-9_~-]+\/)*[A-Za-z0-9_~-]+$/.test(policy.path) &&
|
|
146
|
+
!policy.path.startsWith('/__framework/'),
|
|
147
|
+
'Invalid bootstrap offline policy'
|
|
148
|
+
)
|
|
149
|
+
return { kind: 'local-bootstrap', marker: policy.marker, path: policy.path }
|
|
150
|
+
}
|
|
151
|
+
function checkRenderer(value: RendererEvidence, offlinePolicy?: OfflinePolicy): void {
|
|
152
|
+
const port = Number(value?.origin?.split(':').at(-1))
|
|
153
|
+
const common =
|
|
154
|
+
value &&
|
|
155
|
+
port >= 1024 &&
|
|
156
|
+
port <= 65535 &&
|
|
157
|
+
/^http:\/\/127\.0\.0\.1:[1-9]\d{3,4}$/.test(value.origin) &&
|
|
158
|
+
value.samples === 2 &&
|
|
159
|
+
value.guardInstalled === true &&
|
|
160
|
+
value.offlineObserved === true &&
|
|
161
|
+
value.unexpectedActivity === false &&
|
|
162
|
+
Number.isFinite(value.elapsedMs) &&
|
|
163
|
+
value.elapsedMs >= 3000 &&
|
|
164
|
+
value.visible === true &&
|
|
165
|
+
['interactive', 'complete'].includes(value.readyState) &&
|
|
166
|
+
Number.isFinite(value.width) &&
|
|
167
|
+
value.width >= 100 &&
|
|
168
|
+
Number.isFinite(value.height) &&
|
|
169
|
+
value.height >= 100 &&
|
|
170
|
+
Number.isSafeInteger(value.interactiveElements) &&
|
|
171
|
+
value.interactiveElements >= 1 &&
|
|
172
|
+
Number.isSafeInteger(value.textLength) &&
|
|
173
|
+
value.textLength >= 1
|
|
174
|
+
if (!offlinePolicy) {
|
|
175
|
+
assert(
|
|
176
|
+
common && value.method === 'native-dom-raf-v1' && value.bootstrapDenied === true,
|
|
177
|
+
'Incomplete native renderer evidence'
|
|
178
|
+
)
|
|
179
|
+
return
|
|
180
|
+
}
|
|
181
|
+
assert(value && value.offlinePolicy, 'Incomplete native renderer evidence')
|
|
182
|
+
const policy = parseOfflinePolicy(offlinePolicy),
|
|
183
|
+
observed = parseOfflinePolicy(value.offlinePolicy)
|
|
184
|
+
assert(
|
|
185
|
+
common &&
|
|
186
|
+
value.method === 'native-dom-raf-v2' &&
|
|
187
|
+
value.markerObserved === true &&
|
|
188
|
+
value.browserNetworkRestricted === true &&
|
|
189
|
+
observed.kind === policy.kind &&
|
|
190
|
+
observed.marker === policy.marker &&
|
|
191
|
+
(policy.kind === 'standalone'
|
|
192
|
+
? value.bootstrapDenied === false
|
|
193
|
+
: observed.kind === 'local-bootstrap' &&
|
|
194
|
+
observed.path === policy.path &&
|
|
195
|
+
value.bootstrapDenied === true),
|
|
196
|
+
'Incomplete native renderer evidence'
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
/** Validate one installed-app receipt against the exact attempt and payload bytes. */
|
|
200
|
+
export function validateInstallerReceipt(
|
|
201
|
+
identity: ReleaseIdentity,
|
|
202
|
+
entry: InstallerReceipt,
|
|
203
|
+
platform: string,
|
|
204
|
+
names: readonly string[],
|
|
205
|
+
assets: Artifact[],
|
|
206
|
+
offlinePolicy?: OfflinePolicy
|
|
207
|
+
): true {
|
|
208
|
+
assertIdentity(identity, platform)
|
|
209
|
+
assert(
|
|
210
|
+
Array.isArray(names) && new Set(names).size === names.length,
|
|
211
|
+
'Invalid installer receipt context'
|
|
212
|
+
)
|
|
213
|
+
assert(
|
|
214
|
+
entry &&
|
|
215
|
+
entry.platform === platform &&
|
|
216
|
+
entry.schema === 2 &&
|
|
217
|
+
entry.installed === true &&
|
|
218
|
+
entry.launched === true &&
|
|
219
|
+
entry.rendererReady === true &&
|
|
220
|
+
(['tag', 'sourceSha', 'workflowSha', 'runId', 'runAttempt'] as const).every(
|
|
221
|
+
(key) => entry[key] === identity[key]
|
|
222
|
+
),
|
|
223
|
+
'Installer identity mismatch'
|
|
224
|
+
)
|
|
225
|
+
checkRenderer(entry.rendererEvidence, offlinePolicy)
|
|
226
|
+
assert(
|
|
227
|
+
Array.isArray(entry.assets) && names.length > 0 && entry.assets.length === names.length,
|
|
228
|
+
'Incorrect installer asset count'
|
|
229
|
+
)
|
|
230
|
+
for (const name of names)
|
|
231
|
+
assert(
|
|
232
|
+
matches(uniqueAsset(entry.assets, name), uniqueAsset(assets, name)),
|
|
233
|
+
`Installer asset mismatch: ${name}`
|
|
234
|
+
)
|
|
235
|
+
return true
|
|
236
|
+
}
|
|
237
|
+
function assertIdentity(identity: ReleaseIdentity, platform: string) {
|
|
238
|
+
assert(
|
|
239
|
+
/^v\d+\.\d+\.\d+(?:-dev\.\d+)?$/.test(identity.tag) &&
|
|
240
|
+
/^[a-f0-9]{40}$/.test(identity.sourceSha) &&
|
|
241
|
+
/^[a-f0-9]{40}$/.test(identity.workflowSha) &&
|
|
242
|
+
/^[1-9]\d{0,19}$/.test(identity.runId) &&
|
|
243
|
+
Number.isSafeInteger(identity.runAttempt) &&
|
|
244
|
+
identity.runAttempt > 0 &&
|
|
245
|
+
/^[a-z0-9-]+$/.test(platform),
|
|
246
|
+
'Invalid receipt context'
|
|
247
|
+
)
|
|
248
|
+
}
|
|
249
|
+
/** Validate one command artifact receipt against the exact attempt and payload bytes. */
|
|
250
|
+
export function validateCommandReceipt(
|
|
251
|
+
identity: ReleaseIdentity,
|
|
252
|
+
entry: CommandReceipt,
|
|
253
|
+
kind: string,
|
|
254
|
+
platform: string,
|
|
255
|
+
name: string,
|
|
256
|
+
assets: Artifact[]
|
|
257
|
+
): true {
|
|
258
|
+
assertIdentity(identity, platform)
|
|
259
|
+
assert(
|
|
260
|
+
entry &&
|
|
261
|
+
entry.schema === 1 &&
|
|
262
|
+
entry.kind === kind &&
|
|
263
|
+
entry.platform === platform &&
|
|
264
|
+
entry.installed === true &&
|
|
265
|
+
entry.versionMatched === true &&
|
|
266
|
+
entry.probesPassed === true &&
|
|
267
|
+
entry.serviceStarted === true &&
|
|
268
|
+
entry.serviceStopped === (platform === 'windows-x64' ? 'process-tree' : 'sigterm') &&
|
|
269
|
+
Object.keys(entry).length === 14 &&
|
|
270
|
+
(['tag', 'sourceSha', 'workflowSha', 'runId', 'runAttempt'] as const).every(
|
|
271
|
+
(key) => entry[key] === identity[key]
|
|
272
|
+
),
|
|
273
|
+
'Command artifact receipt mismatch'
|
|
274
|
+
)
|
|
275
|
+
assert(
|
|
276
|
+
matches(entry.asset, uniqueAsset(assets, name)),
|
|
277
|
+
`Command artifact asset mismatch: ${name}`
|
|
278
|
+
)
|
|
279
|
+
return true
|
|
280
|
+
}
|
|
281
|
+
/** Validate that every required command artifact has exactly one receipt for its bytes. */
|
|
282
|
+
export function validateCommandReceipts(
|
|
283
|
+
identity: ReleaseIdentity,
|
|
284
|
+
receipts: CommandReceipt[] | undefined,
|
|
285
|
+
requirements: Requirements,
|
|
286
|
+
assets: Artifact[]
|
|
287
|
+
): void {
|
|
288
|
+
const required = Object.entries(requirements.commandArtifacts ?? {}).flatMap(
|
|
289
|
+
([kind, byPlatform]) =>
|
|
290
|
+
Object.entries(byPlatform).map(([platform, name]) => ({ kind, platform, name }))
|
|
291
|
+
)
|
|
292
|
+
if (!required.length) {
|
|
293
|
+
assert(receipts === undefined, 'Unexpected command artifact receipts')
|
|
294
|
+
return
|
|
295
|
+
}
|
|
296
|
+
assert(
|
|
297
|
+
Array.isArray(receipts) && receipts.length === required.length,
|
|
298
|
+
'Missing or duplicate command artifact receipts'
|
|
299
|
+
)
|
|
300
|
+
for (const { kind, platform, name } of required) {
|
|
301
|
+
const entries = receipts.filter((entry) => entry?.kind === kind && entry.platform === platform)
|
|
302
|
+
assert(entries.length === 1, `Missing or duplicate command artifact receipt: ${kind}`)
|
|
303
|
+
validateCommandReceipt(identity, entries[0]!, kind, platform, name, assets)
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
export function validateReleaseQualification(
|
|
307
|
+
release: Release,
|
|
308
|
+
receipt: Qualification,
|
|
309
|
+
sourceSha: string,
|
|
310
|
+
requirements: Requirements
|
|
311
|
+
): true {
|
|
312
|
+
const required = expectedAssets(requirements)
|
|
313
|
+
const platforms = Object.keys(requirements.platforms)
|
|
314
|
+
assert(
|
|
315
|
+
release.draft === false &&
|
|
316
|
+
receipt.schema === 2 &&
|
|
317
|
+
receipt.tag === release.tag_name &&
|
|
318
|
+
receipt.sourceSha === sourceSha &&
|
|
319
|
+
/^[a-f0-9]{40}$/.test(sourceSha) &&
|
|
320
|
+
/^[a-f0-9]{40}$/.test(receipt.workflowSha) &&
|
|
321
|
+
/^[1-9]\d*$/.test(receipt.runId) &&
|
|
322
|
+
Number.isSafeInteger(receipt.runAttempt) &&
|
|
323
|
+
receipt.runAttempt > 0,
|
|
324
|
+
'Qualification identity mismatch'
|
|
325
|
+
)
|
|
326
|
+
assert(
|
|
327
|
+
receipt.platforms.length === platforms.length &&
|
|
328
|
+
receipt.installerTests.length === platforms.length &&
|
|
329
|
+
receipt.installerReceipts.length === platforms.length &&
|
|
330
|
+
platforms.every(
|
|
331
|
+
(platform) =>
|
|
332
|
+
receipt.platforms.filter((x) => x === platform).length === 1 &&
|
|
333
|
+
receipt.installerTests.filter((x) => x === platform).length === 1
|
|
334
|
+
),
|
|
335
|
+
'Missing or duplicate platform tests'
|
|
336
|
+
)
|
|
337
|
+
for (const platform of platforms) {
|
|
338
|
+
const entries = receipt.installerReceipts.filter((entry) => entry.platform === platform)
|
|
339
|
+
assert(entries.length === 1, `Missing or duplicate installer receipt: ${platform}`)
|
|
340
|
+
validateInstallerReceipt(
|
|
341
|
+
receipt,
|
|
342
|
+
entries[0]!,
|
|
343
|
+
platform,
|
|
344
|
+
requirements.platforms[platform]!,
|
|
345
|
+
release.assets,
|
|
346
|
+
requirements.offlinePolicy
|
|
347
|
+
)
|
|
348
|
+
}
|
|
349
|
+
validateCommandReceipts(receipt, receipt.commandReceipts, requirements, release.assets)
|
|
350
|
+
assert(receipt.assets.length === required.length, 'Incorrect qualification asset count')
|
|
351
|
+
for (const name of required)
|
|
352
|
+
assert(
|
|
353
|
+
matches(uniqueAsset(receipt.assets, name), uniqueAsset(release.assets, name)),
|
|
354
|
+
`Qualification asset mismatch: ${name}`
|
|
355
|
+
)
|
|
356
|
+
return true
|
|
357
|
+
}
|
|
358
|
+
export function validateQualificationRun(
|
|
359
|
+
run: {
|
|
360
|
+
id: number
|
|
361
|
+
run_attempt: number
|
|
362
|
+
conclusion: string
|
|
363
|
+
path: string
|
|
364
|
+
repository: { full_name: string }
|
|
365
|
+
head_sha: string
|
|
366
|
+
event: string
|
|
367
|
+
},
|
|
368
|
+
jobs: { name: string; conclusion: string }[],
|
|
369
|
+
receipt: Qualification,
|
|
370
|
+
repository: string,
|
|
371
|
+
requirements: Requirements,
|
|
372
|
+
assetsWorkflow: string
|
|
373
|
+
): true {
|
|
374
|
+
expectedAssets(requirements)
|
|
375
|
+
assert(
|
|
376
|
+
String(run.id) === receipt.runId &&
|
|
377
|
+
run.run_attempt === receipt.runAttempt &&
|
|
378
|
+
run.conclusion === 'success' &&
|
|
379
|
+
run.path === assetsWorkflow &&
|
|
380
|
+
run.repository.full_name === repository &&
|
|
381
|
+
run.head_sha === receipt.workflowSha &&
|
|
382
|
+
['release', 'workflow_dispatch'].includes(run.event),
|
|
383
|
+
'Qualification run identity mismatch'
|
|
384
|
+
)
|
|
385
|
+
for (const platform of Object.keys(requirements.platforms)) {
|
|
386
|
+
// Called through the reusable assets workflow, GitHub prefixes each job with the
|
|
387
|
+
// caller's job id ("assets / Installer / macos-arm64").
|
|
388
|
+
const platformJobs = jobs.filter((job) =>
|
|
389
|
+
new RegExp(`^(?:[A-Za-z0-9_-]+ / )?Installer / ${platform}$`).test(job.name)
|
|
390
|
+
)
|
|
391
|
+
assert(
|
|
392
|
+
platformJobs.length === 1 && platformJobs[0]!.conclusion === 'success',
|
|
393
|
+
`Missing successful installer job: ${platform}`
|
|
394
|
+
)
|
|
395
|
+
}
|
|
396
|
+
return true
|
|
397
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto'
|
|
2
|
+
import { lstat, open, rm } from 'node:fs/promises'
|
|
3
|
+
import { join, resolve } from 'node:path'
|
|
4
|
+
import { parseReleaseConfig, platformPayloads } from './release-config'
|
|
5
|
+
import type { Artifact } from './release-qualification'
|
|
6
|
+
|
|
7
|
+
/** Stage the platform's configured payloads from the build without replacing existing bytes. */
|
|
8
|
+
export async function stagePlatformArtifacts(options: {
|
|
9
|
+
config: unknown
|
|
10
|
+
tag: string
|
|
11
|
+
platform: string
|
|
12
|
+
directory: string
|
|
13
|
+
sources: Record<string, string>
|
|
14
|
+
}): Promise<Artifact[]> {
|
|
15
|
+
const requirements = parseReleaseConfig(options.config).requirements(options.tag)
|
|
16
|
+
const expected = platformPayloads(requirements, options.platform)
|
|
17
|
+
if (
|
|
18
|
+
!expected.length ||
|
|
19
|
+
Object.keys(options.sources).length !== expected.length ||
|
|
20
|
+
expected.some((name) => !Object.hasOwn(options.sources, name))
|
|
21
|
+
)
|
|
22
|
+
throw new Error('Platform staging sources do not match release configuration')
|
|
23
|
+
const directory = resolve(options.directory)
|
|
24
|
+
const created: string[] = []
|
|
25
|
+
try {
|
|
26
|
+
const artifacts: Artifact[] = []
|
|
27
|
+
for (const name of expected) {
|
|
28
|
+
const sourcePath = options.sources[name]
|
|
29
|
+
if (typeof sourcePath !== 'string' || !sourcePath) throw new Error('Invalid staging source')
|
|
30
|
+
const sourceInfo = await lstat(sourcePath)
|
|
31
|
+
if (
|
|
32
|
+
!sourceInfo.isFile() ||
|
|
33
|
+
sourceInfo.isSymbolicLink() ||
|
|
34
|
+
!Number.isSafeInteger(sourceInfo.size) ||
|
|
35
|
+
sourceInfo.size < 1
|
|
36
|
+
)
|
|
37
|
+
throw new Error('Invalid staging source')
|
|
38
|
+
const input = await open(sourcePath, 'r')
|
|
39
|
+
try {
|
|
40
|
+
const before = await input.stat()
|
|
41
|
+
if (
|
|
42
|
+
!before.isFile() ||
|
|
43
|
+
before.dev !== sourceInfo.dev ||
|
|
44
|
+
before.ino !== sourceInfo.ino ||
|
|
45
|
+
before.size !== sourceInfo.size
|
|
46
|
+
)
|
|
47
|
+
throw new Error('Staging source changed')
|
|
48
|
+
const target = join(directory, name)
|
|
49
|
+
const output = await open(target, 'wx')
|
|
50
|
+
created.push(target)
|
|
51
|
+
const hash = createHash('sha256')
|
|
52
|
+
let size = 0
|
|
53
|
+
try {
|
|
54
|
+
for await (const chunk of input.createReadStream({ autoClose: false })) {
|
|
55
|
+
size += chunk.length
|
|
56
|
+
if (size > before.size) throw new Error('Staging source changed')
|
|
57
|
+
hash.update(chunk)
|
|
58
|
+
let offset = 0
|
|
59
|
+
while (offset < chunk.length) {
|
|
60
|
+
const { bytesWritten } = await output.write(chunk, offset, chunk.length - offset)
|
|
61
|
+
if (!bytesWritten) throw new Error('Unable to stage artifact')
|
|
62
|
+
offset += bytesWritten
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
} finally {
|
|
66
|
+
await output.close()
|
|
67
|
+
}
|
|
68
|
+
const after = await input.stat()
|
|
69
|
+
if (
|
|
70
|
+
size !== before.size ||
|
|
71
|
+
after.size !== before.size ||
|
|
72
|
+
after.mtimeMs !== before.mtimeMs ||
|
|
73
|
+
after.dev !== before.dev ||
|
|
74
|
+
after.ino !== before.ino
|
|
75
|
+
)
|
|
76
|
+
throw new Error('Staging source changed')
|
|
77
|
+
artifacts.push({ name, size, digest: 'sha256:' + hash.digest('hex') })
|
|
78
|
+
} finally {
|
|
79
|
+
await input.close()
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return artifacts
|
|
83
|
+
} catch (error) {
|
|
84
|
+
await Promise.all(created.map((path) => rm(path, { force: true })))
|
|
85
|
+
throw error
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The per-platform steps the reusable release-assets workflow runs in an app's
|
|
3
|
+
* directory (`bun run release:<step> <platform> [directory]`, with
|
|
4
|
+
* `RELEASE_TAG`), so an app maps its scripts to `release-step-cli.js` instead
|
|
5
|
+
* of keeping its own copies. Each reads `release-config.json` from the app
|
|
6
|
+
* directory; an app's own tests keep that file in step with its app identity.
|
|
7
|
+
*/
|
|
8
|
+
import { appendFile, mkdir, mkdtemp, readdir, rm } from 'node:fs/promises'
|
|
9
|
+
import { tmpdir } from 'node:os'
|
|
10
|
+
import { join } from 'node:path'
|
|
11
|
+
import { packCommandArtifact, readCommandArtifact } from '../installer/command-artifact'
|
|
12
|
+
import { qualifyCommandArtifactsCommand } from '../installer/command-qualification-command'
|
|
13
|
+
import { verifyInstallerPayload } from '../installer/installer-identity'
|
|
14
|
+
import { assertPortableAppName, type InstallerPlatform } from '../installer/installer-layout'
|
|
15
|
+
import { qualifyInstallerCommand } from '../installer/installer-qualification-command'
|
|
16
|
+
import { qualifyUpgradeCommand } from '../installer/installer-upgrade-command'
|
|
17
|
+
import { parseReleaseConfig, platformPayloads } from './release-config'
|
|
18
|
+
import { stagePlatformArtifacts } from './release-staging'
|
|
19
|
+
import { selectRetainedReleaseBuild } from './retained-release-build'
|
|
20
|
+
|
|
21
|
+
const PLATFORMS: readonly InstallerPlatform[] = ['macos-arm64', 'windows-x64', 'linux-x64']
|
|
22
|
+
|
|
23
|
+
export type ReleaseStepContext = {
|
|
24
|
+
env: Record<string, string | undefined>
|
|
25
|
+
/** The parsed `release-config.json`. */
|
|
26
|
+
config: { appName: string } & Record<string, unknown>
|
|
27
|
+
tag: string
|
|
28
|
+
platform: InstallerPlatform
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function releasePlatform(value: string | undefined): InstallerPlatform {
|
|
32
|
+
if (!value || !PLATFORMS.includes(value as InstallerPlatform))
|
|
33
|
+
throw new Error('Expected a release platform')
|
|
34
|
+
return value as InstallerPlatform
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function platformAssets(context: ReleaseStepContext): [string, string] {
|
|
38
|
+
const assets = parseReleaseConfig(context.config).requirements(context.tag).platforms[
|
|
39
|
+
context.platform
|
|
40
|
+
]
|
|
41
|
+
if (!assets || assets.length !== 2) throw new Error('Expected one installer and one archive')
|
|
42
|
+
return [assets[0]!, assets[1]!]
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function renderer(env: Record<string, string | undefined>) {
|
|
46
|
+
const value = env.ADEA_APP_RENDERER
|
|
47
|
+
if (value !== 'native' && value !== 'cef')
|
|
48
|
+
throw new Error('ADEA_APP_RENDERER must be native or cef')
|
|
49
|
+
return value
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Reuse this tag's payload from an earlier trusted attempt; writes `reuse`, `artifactId` and `runId` to `GITHUB_OUTPUT`. */
|
|
53
|
+
export async function selectRetainedStep(context: ReleaseStepContext): Promise<void> {
|
|
54
|
+
const output = context.env.GITHUB_OUTPUT
|
|
55
|
+
if (!output) throw new Error('Expected GITHUB_OUTPUT')
|
|
56
|
+
const result = await selectRetainedReleaseBuild(context)
|
|
57
|
+
await appendFile(
|
|
58
|
+
output,
|
|
59
|
+
result.reuse
|
|
60
|
+
? `reuse=true\nartifactId=${result.artifactId}\nrunId=${result.runId}\n`
|
|
61
|
+
: 'reuse=false\n'
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** The installer and update archive a stable Electrobun build leaves in `artifacts`. */
|
|
66
|
+
export function electrobunArtifacts(
|
|
67
|
+
appName: string,
|
|
68
|
+
platform: InstallerPlatform
|
|
69
|
+
): [installer: string, archive: string] {
|
|
70
|
+
assertPortableAppName(appName)
|
|
71
|
+
const bundle = appName.replaceAll(' ', '')
|
|
72
|
+
return {
|
|
73
|
+
'macos-arm64': [`macos-arm64-${bundle}.dmg`, `stable-macos-arm64-${bundle}.app.tar.zst`],
|
|
74
|
+
'windows-x64': [`win-x64-${bundle}-Setup.zip`, `stable-win-x64-${bundle}.tar.zst`],
|
|
75
|
+
'linux-x64': [`linux-x64-${bundle}-Setup.tar.gz`, `stable-linux-x64-${bundle}.tar.zst`],
|
|
76
|
+
}[platform] as [string, string]
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Copy the freshly built installer and archive into `directory` under their release asset names,
|
|
81
|
+
* and pack each command artifact's built directory into its release archive beside them.
|
|
82
|
+
*/
|
|
83
|
+
export async function stageBuildStep(
|
|
84
|
+
context: ReleaseStepContext,
|
|
85
|
+
directory: string,
|
|
86
|
+
artifacts = 'artifacts'
|
|
87
|
+
) {
|
|
88
|
+
const [installerAsset, archiveAsset] = platformAssets(context)
|
|
89
|
+
const [installer, archive] = electrobunArtifacts(context.config.appName, context.platform)
|
|
90
|
+
const parsed = parseReleaseConfig(context.config)
|
|
91
|
+
const requirements = parsed.requirements(context.tag)
|
|
92
|
+
await mkdir(directory, { recursive: true })
|
|
93
|
+
const packed = await mkdtemp(join(tmpdir(), 'framework-command-pack-'))
|
|
94
|
+
try {
|
|
95
|
+
const sources: Record<string, string> = {
|
|
96
|
+
[installerAsset]: join(artifacts, installer),
|
|
97
|
+
[archiveAsset]: join(artifacts, archive),
|
|
98
|
+
}
|
|
99
|
+
for (const policy of parsed.commandArtifacts) {
|
|
100
|
+
const name = requirements.commandArtifacts![policy.kind]![context.platform]!
|
|
101
|
+
sources[name] = join(packed, name)
|
|
102
|
+
await packCommandArtifact({
|
|
103
|
+
source: policy.build,
|
|
104
|
+
archive: sources[name],
|
|
105
|
+
executable: policy.executable,
|
|
106
|
+
platform: context.platform,
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
return await stagePlatformArtifacts({ ...context, directory, sources })
|
|
110
|
+
} finally {
|
|
111
|
+
await rm(packed, { recursive: true, force: true })
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Check a staged payload before its installer runs: exactly the configured assets, an installer
|
|
117
|
+
* that embeds the staged archive, and command artifacts with only safe entries and a launcher.
|
|
118
|
+
*/
|
|
119
|
+
export async function inspectStagedStep(context: ReleaseStepContext, directory: string) {
|
|
120
|
+
const parsed = parseReleaseConfig(context.config)
|
|
121
|
+
const requirements = parsed.requirements(context.tag)
|
|
122
|
+
const assets = platformPayloads(requirements, context.platform)
|
|
123
|
+
const entries = await readdir(directory, { withFileTypes: true })
|
|
124
|
+
if (
|
|
125
|
+
entries.length !== assets.length ||
|
|
126
|
+
entries.some((entry) => !entry.isFile() || !assets.includes(entry.name))
|
|
127
|
+
)
|
|
128
|
+
throw new Error('Staged platform directory contains unexpected files')
|
|
129
|
+
const [installer, archive] = platformAssets(context).map((name) => join(directory, name)) as [
|
|
130
|
+
string,
|
|
131
|
+
string,
|
|
132
|
+
]
|
|
133
|
+
for (const policy of parsed.commandArtifacts)
|
|
134
|
+
await readCommandArtifact({
|
|
135
|
+
archive: join(directory, requirements.commandArtifacts![policy.kind]![context.platform]!),
|
|
136
|
+
executable: policy.executable,
|
|
137
|
+
platform: context.platform,
|
|
138
|
+
})
|
|
139
|
+
return {
|
|
140
|
+
archive,
|
|
141
|
+
identity: await verifyInstallerPayload({
|
|
142
|
+
platform: context.platform,
|
|
143
|
+
appName: context.config.appName,
|
|
144
|
+
installer,
|
|
145
|
+
archive,
|
|
146
|
+
env: context.env,
|
|
147
|
+
}),
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Run each staged command artifact from a clean location and stage its receipt, then run the
|
|
153
|
+
* staged installer, observe the installed app and stage the installer receipt.
|
|
154
|
+
*/
|
|
155
|
+
export async function qualifyStep(context: ReleaseStepContext, directory: string): Promise<void> {
|
|
156
|
+
const mode = renderer(context.env)
|
|
157
|
+
await qualifyCommandArtifactsCommand({ ...context, directory })
|
|
158
|
+
await qualifyInstallerCommand({ ...context, renderer: mode, directory })
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** Install the newest earlier release, apply this release's update and observe the new version. */
|
|
162
|
+
export function qualifyUpgradeStep(
|
|
163
|
+
context: ReleaseStepContext,
|
|
164
|
+
directory: string,
|
|
165
|
+
onStage?: (stage: string) => void
|
|
166
|
+
) {
|
|
167
|
+
return qualifyUpgradeCommand({
|
|
168
|
+
...context,
|
|
169
|
+
renderer: renderer(context.env),
|
|
170
|
+
directory,
|
|
171
|
+
...(onStage ? { onStage } : {}),
|
|
172
|
+
})
|
|
173
|
+
}
|