@adea-ai/app-framework 0.24.0 → 0.25.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 (137) hide show
  1. package/README.md +49 -1
  2. package/dist/cli/macos-signing-cli.d.ts +2 -0
  3. package/dist/cli/macos-signing-cli.js +14 -0
  4. package/dist/desktop/channel-proof.js +7 -1
  5. package/dist/framework-source.json +1 -1
  6. package/dist/release/framework-package-publish.js +4 -2
  7. package/dist/release/local-release.d.ts +2 -0
  8. package/dist/release/local-release.js +25 -2
  9. package/dist/release/macos-signing.d.ts +27 -0
  10. package/dist/release/macos-signing.js +101 -0
  11. package/dist/shell/app-shell.js +21 -33
  12. package/dist/shell/navigation-drawer.d.ts +12 -0
  13. package/dist/shell/navigation-drawer.js +42 -0
  14. package/dist/updates/release-feed.d.ts +2 -0
  15. package/dist/updates/release-feed.js +11 -2
  16. package/package.json +16 -4
  17. package/src/shell/app-shell.tsx +29 -20
  18. package/src/shell/navigation-drawer.tsx +36 -0
  19. package/src/app/create-application.ts +0 -245
  20. package/src/app/service-registry.ts +0 -124
  21. package/src/ci/toolchain-identity.ts +0 -244
  22. package/src/cli/cef-helper-cli.ts +0 -21
  23. package/src/cli/cli-runner.ts +0 -29
  24. package/src/cli/create-application-cli.ts +0 -62
  25. package/src/cli/electrobun-shortcut-patch-cli.ts +0 -24
  26. package/src/cli/framework-update-cli.ts +0 -41
  27. package/src/cli/release-assets-plan-cli.ts +0 -14
  28. package/src/cli/release-cut-cli.ts +0 -41
  29. package/src/cli/release-descriptor-staging-cli.ts +0 -57
  30. package/src/cli/release-finalize-cli.ts +0 -34
  31. package/src/cli/release-promote-cli.ts +0 -31
  32. package/src/cli/release-publish-cli.ts +0 -46
  33. package/src/cli/release-sign-cli.ts +0 -24
  34. package/src/cli/release-step-cli.ts +0 -71
  35. package/src/cli/toolchain-identity-cli.ts +0 -12
  36. package/src/cli/update-helper-cli.ts +0 -12
  37. package/src/cli/windows-runtime-patch-cli.ts +0 -17
  38. package/src/desktop/application-command-client.ts +0 -43
  39. package/src/desktop/channel-handshake.ts +0 -136
  40. package/src/desktop/channel-proof.ts +0 -122
  41. package/src/desktop/desktop-client.ts +0 -303
  42. package/src/desktop/desktop-gateway.ts +0 -189
  43. package/src/desktop/desktop-host.ts +0 -335
  44. package/src/desktop/desktop-stream.ts +0 -324
  45. package/src/desktop/loopback-policy.ts +0 -41
  46. package/src/desktop/open-url-channel.ts +0 -79
  47. package/src/desktop/string-policy.ts +0 -9
  48. package/src/installer/archive-entry.ts +0 -32
  49. package/src/installer/command-artifact.ts +0 -307
  50. package/src/installer/command-qualification-command.ts +0 -75
  51. package/src/installer/hosted-runner.ts +0 -11
  52. package/src/installer/installed-payload.ts +0 -408
  53. package/src/installer/installer-ci-bootstrap.ts +0 -199
  54. package/src/installer/installer-ci-preflight.ts +0 -61
  55. package/src/installer/installer-ci-worker.ts +0 -105
  56. package/src/installer/installer-extraction.ts +0 -367
  57. package/src/installer/installer-fetch-guard.ts +0 -75
  58. package/src/installer/installer-identity.ts +0 -331
  59. package/src/installer/installer-layout.ts +0 -167
  60. package/src/installer/installer-observation.ts +0 -671
  61. package/src/installer/installer-process-cleanup.ts +0 -167
  62. package/src/installer/installer-qualification-command.ts +0 -81
  63. package/src/installer/installer-renderer-evidence.ts +0 -268
  64. package/src/installer/installer-upgrade-command.ts +0 -226
  65. package/src/installer/installer-worker-guard.ts +0 -112
  66. package/src/installer/native-executable.ts +0 -37
  67. package/src/installer/upgrade-asset-download.ts +0 -72
  68. package/src/installer/write-all.ts +0 -19
  69. package/src/native/app-bundle.ts +0 -86
  70. package/src/native/cef-helper.ts +0 -471
  71. package/src/native/desktop-build-hook.ts +0 -21
  72. package/src/native/electrobun-source-patch.ts +0 -107
  73. package/src/native/linux-cef-links.ts +0 -14
  74. package/src/native/native-secret-store.ts +0 -99
  75. package/src/native/native-utilities.ts +0 -166
  76. package/src/native/partitioned-window.ts +0 -62
  77. package/src/native/secure-window.ts +0 -115
  78. package/src/native/sidecar-services.ts +0 -71
  79. package/src/native/sidecar.ts +0 -387
  80. package/src/native/window-bootstrap.ts +0 -77
  81. package/src/native/windows-build-hook-internal.ts +0 -49
  82. package/src/native/windows-build-hook.ts +0 -12
  83. package/src/native/windows-runtime-patch-internal.ts +0 -48
  84. package/src/native/windows-runtime-patch.ts +0 -15
  85. package/src/release/feed-release-cut.ts +0 -110
  86. package/src/release/feed-state.ts +0 -135
  87. package/src/release/framework-package-publish.ts +0 -163
  88. package/src/release/framework-update.ts +0 -196
  89. package/src/release/github-cli.ts +0 -27
  90. package/src/release/github-release-assets.ts +0 -36
  91. package/src/release/github-release-cut.ts +0 -237
  92. package/src/release/github-release-lookup.ts +0 -39
  93. package/src/release/github-release-promotion.ts +0 -112
  94. package/src/release/github-release-provenance.ts +0 -65
  95. package/src/release/github-release-publisher.ts +0 -90
  96. package/src/release/github-release-qualification.ts +0 -144
  97. package/src/release/local-provenance.ts +0 -92
  98. package/src/release/local-release.ts +0 -525
  99. package/src/release/macos-dmg.ts +0 -113
  100. package/src/release/release-artifact.ts +0 -53
  101. package/src/release/release-assets-plan.ts +0 -118
  102. package/src/release/release-config.ts +0 -420
  103. package/src/release/release-cut-command.ts +0 -80
  104. package/src/release/release-cut.ts +0 -133
  105. package/src/release/release-descriptor-staging.ts +0 -242
  106. package/src/release/release-finalize.ts +0 -191
  107. package/src/release/release-promotion-command.ts +0 -36
  108. package/src/release/release-promotion.ts +0 -132
  109. package/src/release/release-publication.ts +0 -213
  110. package/src/release/release-publish-command.ts +0 -163
  111. package/src/release/release-qualification.ts +0 -397
  112. package/src/release/release-staging.ts +0 -87
  113. package/src/release/release-steps.ts +0 -173
  114. package/src/release/retained-release-build.ts +0 -217
  115. package/src/shell/application-menu-commands.ts +0 -6
  116. package/src/shell/application-menu.ts +0 -250
  117. package/src/updates/channel-update-manager.ts +0 -127
  118. package/src/updates/desktop-updater.ts +0 -440
  119. package/src/updates/release-feed.ts +0 -187
  120. package/src/updates/release-location.ts +0 -101
  121. package/src/updates/signed-release.ts +0 -311
  122. package/src/updates/stable-file.ts +0 -32
  123. package/src/updates/update-arm.ts +0 -107
  124. package/src/updates/update-channel-store.ts +0 -86
  125. package/src/updates/update-discovery.ts +0 -113
  126. package/src/updates/update-download.ts +0 -82
  127. package/src/updates/update-exclusive-rename.ts +0 -58
  128. package/src/updates/update-extraction.ts +0 -261
  129. package/src/updates/update-handoff-plan.ts +0 -75
  130. package/src/updates/update-helper.ts +0 -87
  131. package/src/updates/update-launch.ts +0 -33
  132. package/src/updates/update-manager.ts +0 -130
  133. package/src/updates/update-process-fence.ts +0 -125
  134. package/src/updates/update-resume.ts +0 -34
  135. package/src/updates/update-shutdown.ts +0 -37
  136. package/src/updates/update-swap-stage.ts +0 -75
  137. package/src/updates/update-swap.ts +0 -30
package/README.md CHANGED
@@ -34,6 +34,46 @@ promotion; inputs must come from the authenticated release provider and the
34
34
  application's trusted release configuration. These functions do not fetch or
35
35
  verify release signatures, create artifacts, publish releases, or promote them.
36
36
 
37
+ ## Package entry points
38
+
39
+ Import a subpath; the package has no root export. Entries marked _solid_ also
40
+ export TypeScript source under the `solid` condition, which a Vite consumer with
41
+ `vite-plugin-solid` compiles itself. Entries marked _source only_ export
42
+ TypeScript source alone, and the rest resolve to `dist`. The package ships only
43
+ the source those entries reach, plus the Electrobun patches in `src/native`; a
44
+ test checks the file list against the exports.
45
+
46
+ | Area | Subpaths (`@adea-ai/app-framework/<subpath>`) |
47
+ | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
48
+ | Application and shell | `application`, `app-shell`, `app-utilities`, `app-settings`, `app-help`, `app-about`, `update-surface` (all _solid_), `service-registry`, `application-menu`, `application-command-client` |
49
+ | Appearance | `appearance-host`, `appearance-preferences`, `appearance-surface`, `custom-theme-library`, `window-surface` (all _solid_) |
50
+ | Desktop host | `desktop-host`, `desktop-gateway`, `desktop-client`, `desktop-stream`, `channel-handshake`, `channel-proof`, `loopback-policy`, `open-url-channel`, `client-assets` (source only) |
51
+ | Native windows and OS | `renderer-profile`, `secure-window`, `partitioned-window`, `window-options` (source only), `native-utilities`, `native-secret-store`, `app-bundle`, `sidecar`, `sidecar-services`, `desktop-build-hook`, `windows-runtime-patch` |
52
+ | Updates | `desktop-updater`, `update-manager`, `channel-update-manager`, `update-channel-store`, `update-discovery`, `update-download`, `update-extraction`, `signed-release`, `update-adapter` (_solid_), `update-state` and `release-version` (source only), `update-helper.js` (bundled helper) |
53
+ | Release tooling | `release-config`, `release-cut`, `release-steps`, `release-staging`, `release-artifact`, `release-assets-plan`, `release-descriptor-staging`, `release-publication`, `release-publish-command`, `release-promotion`, `retained-release-build`, `github-release-publisher`, `github-release-qualification`, `github-release-promotion`, `macos-dmg` |
54
+ | Installer qualification | `installer-layout`, `installer-identity`, `installer-extraction`, `installed-payload`, `installer-observation`, `installer-qualification-command`, `installer-renderer-evidence` |
55
+ | CI | `toolchain-identity` |
56
+
57
+ Commands (package `bin` entries):
58
+
59
+ | Command | Purpose |
60
+ | --------------------------------- | --------------------------------------------------------------------------------------------------- |
61
+ | `create-adea-app` | Generate an application from the starter template. |
62
+ | `adea-update-app-framework` | Move an app's framework tarball, lockfile and workflow pins to a published release together. |
63
+ | `adea-cut-release` | Cut a `dev` or `daily` release from trusted `main`. |
64
+ | `adea-plan-release-assets` | Validate a dispatched release-assets run and resolve its source and version. |
65
+ | `adea-release-step` | Run a per-platform step: `select-retained`, `stage-build`, `inspect`, `qualify`, `qualify-upgrade`. |
66
+ | `adea-sign-release` | Sign one staged archive's release identity. |
67
+ | `adea-sign-release-descriptors` | Sign channel descriptors for payloads every receipt qualified. |
68
+ | `adea-publish-release` | Publish the current trusted release-assets attempt. |
69
+ | `adea-finalize-release` | Publish a qualified Release Please draft as a prerelease. |
70
+ | `adea-verify-macos-signing` | On a Mac, check every nested Mach-O in an app is signed alike and the seal verifies. |
71
+ | `adea-promote-release` | Promote the newest qualified daily to stable after the soak. |
72
+ | `adea-cef-helper` | Print the CEF helper cache key, or build the helper. |
73
+ | `adea-patch-windows-runtime` | Apply the checksum-guarded Windows runtime correction. |
74
+ | `adea-patch-electrobun-shortcuts` | Apply the shipped Windows shortcut patch to an Electrobun checkout. |
75
+ | `adea-toolchain-identity` | Fail a cached task when the Node/Bun toolchain differs from its key. |
76
+
37
77
  ## Shared application shell
38
78
 
39
79
  `ApplicationShell` composes the published `@adea-ai/ui` rail, toolbar,
@@ -43,6 +83,8 @@ navigation callback and view content. Optional slots provide workspace and
43
83
  history controls, search, toolbar actions, rail footer and status content.
44
84
  The host controls sidebar state and persisted width; the shell restores focus
45
85
  after the narrow-screen sidebar closes and handles the advertised search chord.
86
+ The narrow-screen drawer loads the first time the window is narrow, so a wide
87
+ window never loads its dialog code.
46
88
 
47
89
  Consumers must import `@adea-ai/ui/globals.css` and configure Tailwind to scan
48
90
  the UI and framework package source. `tests/consumer` shows a buildable packed
@@ -501,6 +543,11 @@ Nothing is uploaded; publishing steps write a tree mirroring the feed's keys and
501
543
  the feed's release and stages the upload.
502
544
  - `adea-promote-release --local <config> <out>` promotes a qualified daily
503
545
  after the soak and stages release.json, index.json and the stable pointer.
546
+ A daily qualifies when it publishes every platform in `stablePlatforms`
547
+ (release-config.json; macOS only by default, add `windows-x64` and `linux-x64`
548
+ to require them). A stable promoted without a supported platform records it as
549
+ `missingPlatforms` in release.json. A daily short of a required platform is
550
+ `unqualified` with `reasons`.
504
551
  - `adea-finalize-release --local <config> <tag>` verifies a published release
505
552
  from the feed and lists its verified and missing platforms.
506
553
 
@@ -704,7 +751,8 @@ Command artifacts are portable command-line payloads an app publishes beside its
704
751
  desktop payloads, through the same staging, qualification, signing and immutable
705
752
  publication. Each `commandArtifacts` entry names its own update identity, the
706
753
  directory the release build leaves, one `.tar.gz` asset per release platform and
707
- the commands that qualify it:
754
+ the commands that qualify it. An app can declare up to four kinds, each with up
755
+ to 16 extra qualification environment variables:
708
756
 
709
757
  ```json
710
758
  "commandArtifacts": {
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export {};
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env bun
2
+ import { runCli } from "./cli-runner.js";
3
+ import { verifyMacosBundleSigning } from "../release/macos-signing.js";
4
+ // src/cli/macos-signing-cli.ts
5
+ await runCli("Unable to check the app signing; run it on macOS with codesign.", async () => {
6
+ const [app, flag, ...extra] = process.argv.slice(2);
7
+ if (!app || extra.length || ![void 0, "--hardened"].includes(flag)) throw new Error("usage");
8
+ const report = await verifyMacosBundleSigning({
9
+ app,
10
+ requireHardened: flag === "--hardened"
11
+ });
12
+ process.stdout.write(JSON.stringify(report, null, 2) + "\n");
13
+ if (report.problems.length) process.exitCode = 1;
14
+ });
@@ -27,6 +27,7 @@ function createChannelProofVerifier(options) {
27
27
  const context = options.context ?? "adea-invoke-v1";
28
28
  if (!field(context) || !Number.isSafeInteger(maxNonces) || maxNonces < 1 || !Number.isSafeInteger(maxBodyBytes) || maxBodyBytes < 1) throw new Error("Invalid channel proof configuration");
29
29
  const nonces = /* @__PURE__ */ new Map();
30
+ let earliest = Infinity;
30
31
  return { verify(input) {
31
32
  if (!field(input?.channelId) || !field(input.credentialId) || !field(input.nonce) || typeof input.body !== "string" || Buffer.byteLength(input.body) > maxBodyBytes || typeof input.timestamp !== "string" || !/^\d{1,16}$/.test(input.timestamp) || typeof input.proof !== "string" || !/^[A-Za-z0-9_-]{43}$/.test(input.proof)) return {
32
33
  ok: false,
@@ -65,7 +66,11 @@ function createChannelProofVerifier(options) {
65
66
  ok: false,
66
67
  code: "unauthenticated"
67
68
  };
68
- for (const [key, expiry] of nonces) if (expiry < at) nonces.delete(key);
69
+ if (earliest < at) {
70
+ earliest = Infinity;
71
+ for (const [key, expiry] of nonces) if (expiry < at) nonces.delete(key);
72
+ else if (expiry < earliest) earliest = expiry;
73
+ }
69
74
  const key = `${input.channelId}\0${input.credentialId}\0${input.nonce}`;
70
75
  if (nonces.has(key)) return {
71
76
  ok: false,
@@ -76,6 +81,7 @@ function createChannelProofVerifier(options) {
76
81
  code: "capacity"
77
82
  };
78
83
  nonces.set(key, timestamp + 6e4);
84
+ if (timestamp + 6e4 < earliest) earliest = timestamp + 6e4;
79
85
  return {
80
86
  ok: true,
81
87
  principal: channel.principal
@@ -1 +1 @@
1
- {"version":"0.24.0","commit":"c8c0113e93350252c7663325de13629da17dc923"}
1
+ {"version":"0.25.0","commit":"cdd27e85b7321e4fe3418bb7960bde6321b06462"}
@@ -8,6 +8,7 @@ import { tmpdir } from "node:os";
8
8
  // src/release/framework-package-publish.ts
9
9
  var packageName = "@adea-ai/app-framework";
10
10
  var registryUrl = "https://registry.npmjs.org/";
11
+ var PUBLISH_VISIBILITY_MS = 9e5;
11
12
  /** Runs `npm` with arguments in the current directory and the caller's environment. */
12
13
  function npmCli(args) {
13
14
  return new Promise((resolveRun) => execFile("npm", args, { maxBuffer: 8388608 }, (error, stdout, stderr) => {
@@ -108,7 +109,7 @@ async function publishFrameworkPackage(options) {
108
109
  integrity,
109
110
  status: "dry-run"
110
111
  };
111
- for (let attempt = 0; attempt < 10; attempt++) {
112
+ for (let waited = 0, delay = 5e3;; waited += delay, delay = Math.min(delay * 2, 3e4)) {
112
113
  const published = await registry(version);
113
114
  if (published !== null) {
114
115
  if (publishedIntegrity(published) !== integrity) throw new Error("npm published other bytes than the tested package");
@@ -118,7 +119,8 @@ async function publishFrameworkPackage(options) {
118
119
  status: "published"
119
120
  };
120
121
  }
121
- await sleep(3e3);
122
+ if (waited >= PUBLISH_VISIBILITY_MS) break;
123
+ await sleep(delay);
122
124
  }
123
125
  throw new Error("npm does not list the published version yet");
124
126
  }
@@ -116,6 +116,7 @@ export declare function runLocalPromotion(options: {
116
116
  fetch: FetchFunction;
117
117
  }): Promise<{
118
118
  status: 'held' | 'soaking' | 'unqualified';
119
+ reasons?: string[] | undefined;
119
120
  plan?: Readonly<{
120
121
  schema: 1;
121
122
  base: string;
@@ -124,6 +125,7 @@ export declare function runLocalPromotion(options: {
124
125
  } | {
125
126
  status: 'stable';
126
127
  tag: string;
128
+ reasons?: string[] | undefined;
127
129
  plan?: Readonly<{
128
130
  schema: 1;
129
131
  base: string;
@@ -300,6 +300,17 @@ async function stageLocalRelease(options) {
300
300
  };
301
301
  return writeStagedTree(options.out, feed, uploads, releaseDocuments(feed, updated, release));
302
302
  }
303
+ /**
304
+ * Platforms a daily must publish before it can become stable: `stablePlatforms` in
305
+ * release-config.json, macOS only by default. List more (up to every supported platform) to
306
+ * require them; a stable promoted without a supported platform records it as `missingPlatforms`.
307
+ */
308
+ function stablePlatforms(config) {
309
+ const value = object(config) ? config.stablePlatforms : void 0;
310
+ if (value === void 0) return ["macos-arm64"];
311
+ if (!Array.isArray(value) || !value.length || new Set(value).size !== value.length || !value.every((name) => typeof name === "string" && Object.hasOwn(platformTargets, name))) throw new Error("Invalid stablePlatforms in the release configuration");
312
+ return value;
313
+ }
303
314
  /** Check a release the feed publishes: ledger, release.json and every signed descriptor. */
304
315
  async function verifyLocalRelease(options) {
305
316
  const local = localConfig(options.config);
@@ -327,8 +338,11 @@ async function verifyLocalRelease(options) {
327
338
  async function runLocalPromotion(options) {
328
339
  const local = localConfig(options.config);
329
340
  const feed = local.feed;
341
+ const required = stablePlatforms(local.config);
330
342
  const ledger = await readFeedLedger(feed, options.fetch);
331
343
  let plan;
344
+ const qualified = /* @__PURE__ */ new Map();
345
+ const reasons = [];
332
346
  return {
333
347
  ...await promoteDailyRelease({
334
348
  now: timestamp(options.now),
@@ -346,7 +360,7 @@ async function runLocalPromotion(options) {
346
360
  }));
347
361
  },
348
362
  async qualify(release) {
349
- await verifyFeedRelease({
363
+ const { platforms } = await verifyFeedRelease({
350
364
  config: local.config,
351
365
  feed,
352
366
  tag: release.tag,
@@ -355,9 +369,16 @@ async function runLocalPromotion(options) {
355
369
  fetch: options.fetch,
356
370
  channels: ["stable"]
357
371
  });
372
+ qualified.set(release.tag, platforms);
373
+ const missing = required.filter((name) => !platforms.includes(name));
374
+ if (missing.length) {
375
+ reasons.push(`${release.tag} lacks ${missing.join(", ")}; publish them or relax stablePlatforms in release-config.json`);
376
+ return false;
377
+ }
358
378
  return true;
359
379
  },
360
380
  async markStable(selected, at) {
381
+ const absent = Object.keys(platformTargets).filter((name) => !qualified.get(selected.tag)?.includes(name));
361
382
  const entry = ledger.releases.find((item) => item.tag === selected.tag);
362
383
  const remote = await readFeedRelease(feed, selected.tag, options.fetch);
363
384
  if (!entry || !remote || entry.kind === "dev") throw new Error("Release changed during promotion");
@@ -376,11 +397,13 @@ async function runLocalPromotion(options) {
376
397
  }, feed.app);
377
398
  plan = await writeStagedTree(options.out, feed, [], releaseDocuments(feed, updated, {
378
399
  ...remote,
379
- channel: "stable"
400
+ channel: "stable",
401
+ ...absent.length ? { missingPlatforms: absent } : {}
380
402
  }));
381
403
  }
382
404
  }
383
405
  }),
406
+ ...reasons.length && !plan ? { reasons } : {},
384
407
  ...plan ? { plan } : {}
385
408
  };
386
409
  }
@@ -0,0 +1,27 @@
1
+ export type CodesignRun = (args: readonly string[]) => {
2
+ status: number;
3
+ output: string;
4
+ };
5
+ type BinarySigning = Readonly<{
6
+ path: string;
7
+ signature: 'adhoc' | 'identity' | 'unsigned';
8
+ team?: string;
9
+ hardened: boolean;
10
+ }>;
11
+ export type MacosSigningReport = Readonly<{
12
+ binaries: readonly BinarySigning[];
13
+ problems: readonly string[];
14
+ }>;
15
+ /**
16
+ * Check that every Mach-O file in a macOS app bundle carries a code signature of one kind and
17
+ * that the bundle's seal verifies. An ad-hoc build (no Developer ID) needs every nested binary
18
+ * ad-hoc signed; a Developer ID build needs every binary signed by the same team, and with
19
+ * `requireHardened` the hardened runtime on each. Notarization is separate: it needs a
20
+ * Developer ID and is not checked here.
21
+ */
22
+ export declare function verifyMacosBundleSigning(options: {
23
+ app: string;
24
+ requireHardened?: boolean;
25
+ codesign?: CodesignRun;
26
+ }): Promise<MacosSigningReport>;
27
+ export {};
@@ -0,0 +1,101 @@
1
+ import { open, readdir } from "node:fs/promises";
2
+ import { join, relative } from "node:path";
3
+ import { spawnSync } from "node:child_process";
4
+ // src/release/macos-signing.ts
5
+ var MACH_O_MAGIC = /* @__PURE__ */ new Set([
6
+ 4277009102,
7
+ 4277009103,
8
+ 3472551422,
9
+ 3489328638,
10
+ 3405691582,
11
+ 3199925962,
12
+ 3405691583,
13
+ 3216703178
14
+ ]);
15
+ var MAX_FILES = 2e5;
16
+ var run = (args) => {
17
+ const result = spawnSync("codesign", [...args], {
18
+ encoding: "utf8",
19
+ maxBuffer: 16777216
20
+ });
21
+ if (result.error) throw result.error;
22
+ return {
23
+ status: result.status ?? 1,
24
+ output: `${result.stdout}${result.stderr}`
25
+ };
26
+ };
27
+ async function isMachO(path) {
28
+ const handle = await open(path, "r");
29
+ try {
30
+ const head = Buffer.alloc(4);
31
+ const { bytesRead } = await handle.read(head, 0, 4, 0);
32
+ return bytesRead === 4 && MACH_O_MAGIC.has(head.readUInt32BE(0));
33
+ } finally {
34
+ await handle.close();
35
+ }
36
+ }
37
+ async function* machOFiles(root) {
38
+ let seen = 0;
39
+ const stack = [root];
40
+ while (stack.length) {
41
+ const directory = stack.pop();
42
+ for (const entry of await readdir(directory, { withFileTypes: true })) {
43
+ if (++seen > MAX_FILES) throw new Error("Bundle has too many files to inspect");
44
+ const path = join(directory, entry.name);
45
+ if (entry.isDirectory()) stack.push(path);
46
+ else if (entry.isFile() && await isMachO(path)) yield path;
47
+ }
48
+ }
49
+ }
50
+ /**
51
+ * Check that every Mach-O file in a macOS app bundle carries a code signature of one kind and
52
+ * that the bundle's seal verifies. An ad-hoc build (no Developer ID) needs every nested binary
53
+ * ad-hoc signed; a Developer ID build needs every binary signed by the same team, and with
54
+ * `requireHardened` the hardened runtime on each. Notarization is separate: it needs a
55
+ * Developer ID and is not checked here.
56
+ */
57
+ async function verifyMacosBundleSigning(options) {
58
+ const codesign = options.codesign ?? run;
59
+ const problems = [];
60
+ const binaries = [];
61
+ for await (const file of machOFiles(options.app)) {
62
+ const name = relative(options.app, file);
63
+ const { status, output } = codesign(["-dvv", file]);
64
+ if (status !== 0 || /code object is not signed/i.test(output)) {
65
+ binaries.push({
66
+ path: name,
67
+ signature: "unsigned",
68
+ hardened: false
69
+ });
70
+ problems.push(`${name} is not signed`);
71
+ continue;
72
+ }
73
+ const adhoc = /^Signature=adhoc$/m.test(output);
74
+ const team = output.match(/^TeamIdentifier=(\S+)$/m)?.[1];
75
+ const flags = output.match(/flags=0x[0-9a-f]+\(([^)]*)\)/)?.[1] ?? "";
76
+ binaries.push({
77
+ path: name,
78
+ signature: adhoc ? "adhoc" : "identity",
79
+ ...team && team !== "not" ? { team } : {},
80
+ hardened: flags.split(",").includes("runtime")
81
+ });
82
+ }
83
+ if (!binaries.length) problems.push("No Mach-O files found; is this a macOS app bundle?");
84
+ if (new Set(binaries.filter((item) => item.signature !== "unsigned").map((item) => item.signature)).size > 1) problems.push("Binaries mix ad-hoc and identity signatures");
85
+ if (new Set(binaries.filter((item) => item.signature === "identity").map((item) => item.team)).size > 1) problems.push("Binaries are signed by different teams");
86
+ if (options.requireHardened) {
87
+ for (const item of binaries) if (item.signature !== "unsigned" && !item.hardened) problems.push(`${item.path} lacks the hardened runtime`);
88
+ }
89
+ const seal = codesign([
90
+ "--verify",
91
+ "--deep",
92
+ "--strict",
93
+ options.app
94
+ ]);
95
+ if (seal.status !== 0) problems.push(`Bundle seal does not verify: ${seal.output.trim().slice(0, 500)}`);
96
+ return {
97
+ binaries,
98
+ problems
99
+ };
100
+ }
101
+ export { verifyMacosBundleSigning };
@@ -1,5 +1,5 @@
1
1
  import { className, createComponent, effect, insert, memo, mergeProps, template } from "solid-js/web";
2
- import { For, Show, createEffect, createSignal, onCleanup, onMount } from "solid-js";
2
+ import { For, Show, Suspense, createEffect, createSignal, lazy, onCleanup, onMount } from "solid-js";
3
3
  import { AppShell, AppShellBody, AppShellContent, AppShellMain, SkipLink } from "@adea-ai/ui/components/layout/app-shell";
4
4
  import { ContextualSidebar } from "@adea-ai/ui/components/layout/contextual-sidebar";
5
5
  import { PixelPane } from "@adea-ai/ui/components/layout/pixel-pane";
@@ -7,12 +7,12 @@ import { ShellRail } from "@adea-ai/ui/components/layout/shell-rail";
7
7
  import { ShellTopBar } from "@adea-ai/ui/components/layout/shell-top-bar";
8
8
  import { SideRailItem, SideRailSection } from "@adea-ai/ui/components/layout/side-rail";
9
9
  import { ActionButton } from "@adea-ai/ui/components/composites/action-button";
10
- import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@adea-ai/ui/components/ui/sheet";
11
10
  import { TooltipProvider } from "@adea-ai/ui/components/ui/tooltip";
12
11
  import { PanelLeftClose, PanelLeftIcon, PanelLeftOpen } from "lucide-solid";
13
12
  // src/shell/app-shell.tsx
14
13
  var _tmpl$ = /*#__PURE__*/ template(`<div>`);
15
14
  var _tmpl$2 = /*#__PURE__*/ template(`<div data-slot=app-shell-main class="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden">`);
15
+ var NavigationDrawer = lazy(() => import("./navigation-drawer.js").then((module) => ({ default: module.NavigationDrawer })));
16
16
  function createNarrow(query) {
17
17
  const [narrow, setNarrow] = createSignal(false);
18
18
  createEffect(() => {
@@ -31,8 +31,10 @@ function ApplicationShell(props) {
31
31
  let sidebarToggle;
32
32
  const narrow = createNarrow(() => props.drawer ? props.narrowQuery ?? "(max-width: 799px)" : void 0);
33
33
  const [drawerOpen, setDrawerOpen] = createSignal(false);
34
+ const [drawerMounted, setDrawerMounted] = createSignal(false);
34
35
  createEffect(() => {
35
- if (!narrow()) setDrawerOpen(false);
36
+ if (narrow()) setDrawerMounted(true);
37
+ else setDrawerOpen(false);
36
38
  });
37
39
  const leading = () => props.sidebar ?? props.pane;
38
40
  const toggleVisible = () => narrow() || Boolean(leading());
@@ -278,37 +280,23 @@ function ApplicationShell(props) {
278
280
  }), null);
279
281
  insert(_el$, createComponent(Show, {
280
282
  get when() {
281
- return props.drawer;
283
+ return memo(() => !!drawerMounted())() && props.drawer;
282
284
  },
283
- children: (drawer) => createComponent(Sheet, {
284
- get open() {
285
- return memo(() => !!narrow())() && drawerOpen();
286
- },
287
- onOpenChange: setDrawerOpen,
288
- get children() {
289
- return createComponent(SheetContent, {
290
- "data-mobile": "true",
291
- side: "start",
292
- closeButton: false,
293
- "class": "w-72 max-w-full",
294
- onCloseAutoFocus: (event) => {
295
- if (!sidebarToggle) return;
296
- event.preventDefault();
297
- sidebarToggle.focus();
298
- },
299
- get children() {
300
- return [createComponent(SheetHeader, {
301
- "class": "sr-only",
302
- get children() {
303
- return createComponent(SheetTitle, { get children() {
304
- return `${props.name} navigation`;
305
- } });
306
- }
307
- }), memo(() => drawer()(() => setDrawerOpen(false)))];
308
- }
309
- });
310
- }
311
- })
285
+ children: (drawer) => createComponent(Suspense, { get children() {
286
+ return createComponent(NavigationDrawer, {
287
+ get name() {
288
+ return props.name;
289
+ },
290
+ get open() {
291
+ return memo(() => !!narrow())() && drawerOpen();
292
+ },
293
+ onOpenChange: setDrawerOpen,
294
+ restoreFocus: () => sidebarToggle,
295
+ get children() {
296
+ return drawer()(() => setDrawerOpen(false));
297
+ }
298
+ });
299
+ } })
312
300
  }), null);
313
301
  effect(() => className(_el$, `flex h-screen w-screen flex-col overflow-hidden ${props.class ?? ""}`));
314
302
  return _el$;
@@ -0,0 +1,12 @@
1
+ import type { JSX } from 'solid-js';
2
+ /**
3
+ * The narrow-window navigation drawer. The shell loads it the first time the window is
4
+ * narrow, so wide windows never fetch the dialog primitives behind the sheet.
5
+ */
6
+ export declare function NavigationDrawer(props: {
7
+ name: string;
8
+ open: boolean;
9
+ onOpenChange(open: boolean): void;
10
+ restoreFocus(): HTMLElement | undefined;
11
+ children: JSX.Element;
12
+ }): JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { createComponent, memo } from "solid-js/web";
2
+ import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@adea-ai/ui/components/ui/sheet";
3
+ // src/shell/navigation-drawer.tsx
4
+ /**
5
+ * The narrow-window navigation drawer. The shell loads it the first time the window is
6
+ * narrow, so wide windows never fetch the dialog primitives behind the sheet.
7
+ */
8
+ function NavigationDrawer(props) {
9
+ return createComponent(Sheet, {
10
+ get open() {
11
+ return props.open;
12
+ },
13
+ get onOpenChange() {
14
+ return props.onOpenChange;
15
+ },
16
+ get children() {
17
+ return createComponent(SheetContent, {
18
+ "data-mobile": "true",
19
+ side: "start",
20
+ closeButton: false,
21
+ "class": "w-72 max-w-full",
22
+ onCloseAutoFocus: (event) => {
23
+ const target = props.restoreFocus();
24
+ if (!target) return;
25
+ event.preventDefault();
26
+ target.focus();
27
+ },
28
+ get children() {
29
+ return [createComponent(SheetHeader, {
30
+ "class": "sr-only",
31
+ get children() {
32
+ return createComponent(SheetTitle, { get children() {
33
+ return `${props.name} navigation`;
34
+ } });
35
+ }
36
+ }), memo(() => props.children)];
37
+ }
38
+ });
39
+ }
40
+ });
41
+ }
42
+ export { NavigationDrawer };
@@ -21,6 +21,8 @@ export type FeedRelease = Readonly<{
21
21
  channel: FeedChannel;
22
22
  publishedAt: string;
23
23
  assets: readonly FeedAsset[];
24
+ /** Supported platforms a stable release was promoted without; present only on such stables. */
25
+ missingPlatforms?: readonly string[];
24
26
  }>;
25
27
  export type LedgerEntry = Readonly<{
26
28
  tag: string;
@@ -41,7 +41,13 @@ var channelOf = (tag) => tag.includes("-dev.") ? "dev" : "daily";
41
41
  /** Validate a release.json or channel pointer: a tag of its channel and a bounded,
42
42
  * unique asset inventory. */
43
43
  function parseFeedRelease(value) {
44
- if (!record(value) || !exactKeys(value, [
44
+ if (!record(value) || !exactKeys(value, Object.hasOwn(value, "missingPlatforms") ? [
45
+ "tag",
46
+ "channel",
47
+ "publishedAt",
48
+ "assets",
49
+ "missingPlatforms"
50
+ ] : [
45
51
  "tag",
46
52
  "channel",
47
53
  "publishedAt",
@@ -65,11 +71,14 @@ function parseFeedRelease(value) {
65
71
  sha256: asset.sha256
66
72
  };
67
73
  });
74
+ const allowed = value.missingPlatforms;
75
+ if (allowed !== void 0 && (value.channel !== "stable" || !Array.isArray(allowed) || allowed.length < 1 || allowed.length > 8 || new Set(allowed).size !== allowed.length || !allowed.every((name) => typeof name === "string" && segment.test(name)))) throw new Error("Invalid feed release");
68
76
  return {
69
77
  tag: value.tag,
70
78
  channel: value.channel,
71
79
  publishedAt: value.publishedAt,
72
- assets
80
+ assets,
81
+ ...allowed ? { missingPlatforms: allowed } : {}
73
82
  };
74
83
  }
75
84
  /** Validate the ledger: this app, at most MAX_LEDGER_RELEASES unique tags, newest first,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/app-framework",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,11 +20,23 @@
20
20
  "adea-sign-release-descriptors": "./dist/cli/release-descriptor-staging-cli.js",
21
21
  "adea-toolchain-identity": "./dist/cli/toolchain-identity-cli.js",
22
22
  "adea-update-app-framework": "./dist/cli/framework-update-cli.js",
23
+ "adea-verify-macos-signing": "./dist/cli/macos-signing-cli.js",
23
24
  "create-adea-app": "./dist/cli/create-application-cli.js"
24
25
  },
25
26
  "files": [
26
27
  "dist",
27
- "src",
28
+ "src/app/application.tsx",
29
+ "src/appearance",
30
+ "src/desktop/client-assets.ts",
31
+ "src/native/*.patch",
32
+ "src/native/renderer-profile.ts",
33
+ "src/native/window-options.ts",
34
+ "src/shell",
35
+ "!src/shell/application-menu*.ts",
36
+ "src/updates/release-version.ts",
37
+ "src/updates/update-adapter.ts",
38
+ "src/updates/update-state.ts",
39
+ "src/views",
28
40
  "README.md",
29
41
  "LICENSE",
30
42
  "NOTICE",
@@ -333,7 +345,7 @@
333
345
  "tar": "^7.5.22"
334
346
  },
335
347
  "devDependencies": {
336
- "@adea-ai/ui": "0.149.0",
348
+ "@adea-ai/ui": "0.149.7",
337
349
  "@babel/core": "^8.0.6",
338
350
  "@babel/preset-typescript": "^8.0.1",
339
351
  "@happy-dom/global-registrator": "^21.0.4",
@@ -342,7 +354,7 @@
342
354
  "@types/bun": "^1.4.4",
343
355
  "@types/node": "^26.0.0",
344
356
  "babel-preset-solid": "^1.9.15",
345
- "code-foundry": "1.53.10",
357
+ "code-foundry": "1.53.11",
346
358
  "knip": "6.43.0",
347
359
  "lucide-solid": "^1.51.0",
348
360
  "oxfmt": "0.75.0",