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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +30 -0
  3. package/README.md +1009 -2
  4. package/dist/app/application.d.ts +47 -0
  5. package/dist/app/application.js +115 -0
  6. package/dist/app/create-application.d.ts +13 -0
  7. package/dist/app/create-application.js +178 -0
  8. package/dist/app/service-registry.d.ts +44 -0
  9. package/dist/app/service-registry.js +116 -0
  10. package/dist/appearance/appearance-host.d.ts +62 -0
  11. package/dist/appearance/appearance-host.js +115 -0
  12. package/dist/appearance/appearance-preferences.d.ts +106 -0
  13. package/dist/appearance/appearance-preferences.js +175 -0
  14. package/dist/appearance/composition.d.ts +11 -0
  15. package/dist/appearance/composition.js +16 -0
  16. package/dist/appearance/custom-theme-import.d.ts +14 -0
  17. package/dist/appearance/custom-theme-import.js +315 -0
  18. package/dist/appearance/custom-theme-library.d.ts +146 -0
  19. package/dist/appearance/custom-theme-library.js +378 -0
  20. package/dist/appearance/editor.d.ts +20 -0
  21. package/dist/appearance/editor.js +47 -0
  22. package/dist/appearance/theme-file-importer.d.ts +23 -0
  23. package/dist/appearance/theme-file-importer.js +66 -0
  24. package/dist/appearance/theme-record-adapter.d.ts +26 -0
  25. package/dist/appearance/theme-record-adapter.js +64 -0
  26. package/dist/appearance/theme-registry.d.ts +10 -0
  27. package/dist/appearance/theme-registry.js +16 -0
  28. package/dist/appearance/window-surface.d.ts +5 -0
  29. package/dist/appearance/window-surface.js +9 -0
  30. package/dist/ci/toolchain-identity.d.ts +39 -0
  31. package/dist/ci/toolchain-identity.js +196 -0
  32. package/dist/cli/cef-helper-cli.d.ts +2 -0
  33. package/dist/cli/cef-helper-cli.js +18 -0
  34. package/dist/cli/cli-runner.d.ts +8 -0
  35. package/dist/cli/cli-runner.js +23 -0
  36. package/dist/cli/create-application-cli.d.ts +2 -0
  37. package/dist/cli/create-application-cli.js +40 -0
  38. package/dist/cli/electrobun-shortcut-patch-cli.d.ts +2 -0
  39. package/dist/cli/electrobun-shortcut-patch-cli.js +17 -0
  40. package/dist/cli/framework-update-cli.d.ts +2 -0
  41. package/dist/cli/framework-update-cli.js +40 -0
  42. package/dist/cli/release-assets-plan-cli.d.ts +2 -0
  43. package/dist/cli/release-assets-plan-cli.js +14 -0
  44. package/dist/cli/release-cut-cli.d.ts +2 -0
  45. package/dist/cli/release-cut-cli.js +27 -0
  46. package/dist/cli/release-descriptor-staging-cli.d.ts +2 -0
  47. package/dist/cli/release-descriptor-staging-cli.js +45 -0
  48. package/dist/cli/release-finalize-cli.d.ts +1 -0
  49. package/dist/cli/release-finalize-cli.js +30 -0
  50. package/dist/cli/release-promote-cli.d.ts +2 -0
  51. package/dist/cli/release-promote-cli.js +32 -0
  52. package/dist/cli/release-publish-cli.d.ts +2 -0
  53. package/dist/cli/release-publish-cli.js +48 -0
  54. package/dist/cli/release-sign-cli.d.ts +2 -0
  55. package/dist/cli/release-sign-cli.js +13 -0
  56. package/dist/cli/release-step-cli.d.ts +2 -0
  57. package/dist/cli/release-step-cli.js +44 -0
  58. package/dist/cli/toolchain-identity-cli.d.ts +2 -0
  59. package/dist/cli/toolchain-identity-cli.js +10 -0
  60. package/dist/cli/update-helper-cli.d.ts +1 -0
  61. package/dist/cli/update-helper-cli.js +10 -0
  62. package/dist/cli/windows-runtime-patch-cli.d.ts +2 -0
  63. package/dist/cli/windows-runtime-patch-cli.js +17 -0
  64. package/dist/desktop/application-command-client.d.ts +15 -0
  65. package/dist/desktop/application-command-client.js +21 -0
  66. package/dist/desktop/channel-handshake.d.ts +32 -0
  67. package/dist/desktop/channel-handshake.js +111 -0
  68. package/dist/desktop/channel-proof.d.ts +43 -0
  69. package/dist/desktop/channel-proof.js +85 -0
  70. package/dist/desktop/client-assets.d.ts +7 -0
  71. package/dist/desktop/client-assets.js +59 -0
  72. package/dist/desktop/desktop-client.d.ts +23 -0
  73. package/dist/desktop/desktop-client.js +231 -0
  74. package/dist/desktop/desktop-gateway.d.ts +18 -0
  75. package/dist/desktop/desktop-gateway.js +146 -0
  76. package/dist/desktop/desktop-host.d.ts +48 -0
  77. package/dist/desktop/desktop-host.js +208 -0
  78. package/dist/desktop/desktop-stream.d.ts +36 -0
  79. package/dist/desktop/desktop-stream.js +231 -0
  80. package/dist/desktop/loopback-policy.d.ts +19 -0
  81. package/dist/desktop/loopback-policy.js +23 -0
  82. package/dist/desktop/open-url-channel.d.ts +15 -0
  83. package/dist/desktop/open-url-channel.js +55 -0
  84. package/dist/desktop/string-policy.d.ts +2 -0
  85. package/dist/desktop/string-policy.js +11 -0
  86. package/dist/framework-source.json +1 -0
  87. package/dist/installer/archive-entry.d.ts +6 -0
  88. package/dist/installer/archive-entry.js +14 -0
  89. package/dist/installer/command-artifact.d.ts +47 -0
  90. package/dist/installer/command-artifact.js +261 -0
  91. package/dist/installer/command-qualification-command.d.ts +12 -0
  92. package/dist/installer/command-qualification-command.js +71 -0
  93. package/dist/installer/hosted-runner.d.ts +4 -0
  94. package/dist/installer/hosted-runner.js +10 -0
  95. package/dist/installer/installed-payload.d.ts +29 -0
  96. package/dist/installer/installed-payload.js +312 -0
  97. package/dist/installer/installer-ci-bootstrap.d.ts +26 -0
  98. package/dist/installer/installer-ci-bootstrap.js +160 -0
  99. package/dist/installer/installer-ci-preflight.d.ts +1 -0
  100. package/dist/installer/installer-ci-preflight.js +49 -0
  101. package/dist/installer/installer-ci-worker.d.ts +1 -0
  102. package/dist/installer/installer-ci-worker.js +105 -0
  103. package/dist/installer/installer-extraction.d.ts +14 -0
  104. package/dist/installer/installer-extraction.js +289 -0
  105. package/dist/installer/installer-fetch-guard.d.ts +15 -0
  106. package/dist/installer/installer-fetch-guard.js +50 -0
  107. package/dist/installer/installer-identity.d.ts +23 -0
  108. package/dist/installer/installer-identity.js +286 -0
  109. package/dist/installer/installer-layout.d.ts +21 -0
  110. package/dist/installer/installer-layout.js +89 -0
  111. package/dist/installer/installer-observation.d.ts +64 -0
  112. package/dist/installer/installer-observation.js +473 -0
  113. package/dist/installer/installer-process-cleanup.d.ts +18 -0
  114. package/dist/installer/installer-process-cleanup.js +158 -0
  115. package/dist/installer/installer-qualification-command.d.ts +11 -0
  116. package/dist/installer/installer-qualification-command.js +71 -0
  117. package/dist/installer/installer-renderer-evidence.d.ts +43 -0
  118. package/dist/installer/installer-renderer-evidence.js +136 -0
  119. package/dist/installer/installer-upgrade-command.d.ts +37 -0
  120. package/dist/installer/installer-upgrade-command.js +172 -0
  121. package/dist/installer/installer-worker-guard.d.ts +21 -0
  122. package/dist/installer/installer-worker-guard.js +72 -0
  123. package/dist/installer/native-executable.d.ts +5 -0
  124. package/dist/installer/native-executable.js +21 -0
  125. package/dist/installer/upgrade-asset-download.d.ts +13 -0
  126. package/dist/installer/upgrade-asset-download.js +41 -0
  127. package/dist/installer/write-all.d.ts +6 -0
  128. package/dist/installer/write-all.js +11 -0
  129. package/dist/native/app-bundle.d.ts +28 -0
  130. package/dist/native/app-bundle.js +60 -0
  131. package/dist/native/cef-helper.d.ts +28 -0
  132. package/dist/native/cef-helper.js +402 -0
  133. package/dist/native/desktop-build-hook.d.ts +7 -0
  134. package/dist/native/desktop-build-hook.js +20 -0
  135. package/dist/native/electrobun-source-patch.d.ts +25 -0
  136. package/dist/native/electrobun-source-patch.js +93 -0
  137. package/dist/native/linux-cef-links.d.ts +2 -0
  138. package/dist/native/linux-cef-links.js +15 -0
  139. package/dist/native/native-secret-store.d.ts +27 -0
  140. package/dist/native/native-secret-store.js +70 -0
  141. package/dist/native/native-utilities.d.ts +24 -0
  142. package/dist/native/native-utilities.js +85 -0
  143. package/dist/native/partitioned-window.d.ts +34 -0
  144. package/dist/native/partitioned-window.js +44 -0
  145. package/dist/native/renderer-profile.d.ts +53 -0
  146. package/dist/native/renderer-profile.js +30 -0
  147. package/dist/native/secure-window.d.ts +38 -0
  148. package/dist/native/secure-window.js +77 -0
  149. package/dist/native/sidecar-services.d.ts +23 -0
  150. package/dist/native/sidecar-services.js +46 -0
  151. package/dist/native/sidecar.d.ts +81 -0
  152. package/dist/native/sidecar.js +250 -0
  153. package/dist/native/window-bootstrap.d.ts +24 -0
  154. package/dist/native/window-bootstrap.js +63 -0
  155. package/dist/native/window-options.d.ts +32 -0
  156. package/dist/native/window-options.js +23 -0
  157. package/dist/native/windows-build-hook-internal.d.ts +2 -0
  158. package/dist/native/windows-build-hook-internal.js +32 -0
  159. package/dist/native/windows-build-hook.d.ts +2 -0
  160. package/dist/native/windows-build-hook.js +12 -0
  161. package/dist/native/windows-runtime-patch-internal.d.ts +3 -0
  162. package/dist/native/windows-runtime-patch-internal.js +20 -0
  163. package/dist/native/windows-runtime-patch.d.ts +4 -0
  164. package/dist/native/windows-runtime-patch.js +12 -0
  165. package/dist/release/feed-release-cut.d.ts +23 -0
  166. package/dist/release/feed-release-cut.js +93 -0
  167. package/dist/release/feed-state.d.ts +25 -0
  168. package/dist/release/feed-state.js +81 -0
  169. package/dist/release/framework-package-publish.d.ts +21 -0
  170. package/dist/release/framework-package-publish.js +127 -0
  171. package/dist/release/framework-update.d.ts +30 -0
  172. package/dist/release/framework-update.js +139 -0
  173. package/dist/release/github-cli.d.ts +6 -0
  174. package/dist/release/github-cli.js +16 -0
  175. package/dist/release/github-release-assets.d.ts +3 -0
  176. package/dist/release/github-release-assets.js +24 -0
  177. package/dist/release/github-release-cut.d.ts +14 -0
  178. package/dist/release/github-release-cut.js +174 -0
  179. package/dist/release/github-release-lookup.d.ts +7 -0
  180. package/dist/release/github-release-lookup.js +29 -0
  181. package/dist/release/github-release-promotion.d.ts +10 -0
  182. package/dist/release/github-release-promotion.js +78 -0
  183. package/dist/release/github-release-provenance.d.ts +9 -0
  184. package/dist/release/github-release-provenance.js +27 -0
  185. package/dist/release/github-release-publisher.d.ts +9 -0
  186. package/dist/release/github-release-publisher.js +63 -0
  187. package/dist/release/github-release-qualification.d.ts +12 -0
  188. package/dist/release/github-release-qualification.js +80 -0
  189. package/dist/release/local-provenance.d.ts +24 -0
  190. package/dist/release/local-provenance.js +72 -0
  191. package/dist/release/local-release.d.ts +133 -0
  192. package/dist/release/local-release.js +387 -0
  193. package/dist/release/macos-dmg.d.ts +22 -0
  194. package/dist/release/macos-dmg.js +91 -0
  195. package/dist/release/release-artifact.d.ts +6 -0
  196. package/dist/release/release-artifact.js +38 -0
  197. package/dist/release/release-assets-plan.d.ts +14 -0
  198. package/dist/release/release-assets-plan.js +65 -0
  199. package/dist/release/release-config.d.ts +76 -0
  200. package/dist/release/release-config.js +180 -0
  201. package/dist/release/release-cut-command.d.ts +13 -0
  202. package/dist/release/release-cut-command.js +39 -0
  203. package/dist/release/release-cut.d.ts +54 -0
  204. package/dist/release/release-cut.js +76 -0
  205. package/dist/release/release-descriptor-staging.d.ts +34 -0
  206. package/dist/release/release-descriptor-staging.js +147 -0
  207. package/dist/release/release-finalize.d.ts +16 -0
  208. package/dist/release/release-finalize.js +104 -0
  209. package/dist/release/release-promotion-command.d.ts +12 -0
  210. package/dist/release/release-promotion-command.js +28 -0
  211. package/dist/release/release-promotion.d.ts +29 -0
  212. package/dist/release/release-promotion.js +57 -0
  213. package/dist/release/release-publication.d.ts +33 -0
  214. package/dist/release/release-publication.js +138 -0
  215. package/dist/release/release-publish-command.d.ts +7 -0
  216. package/dist/release/release-publish-command.js +91 -0
  217. package/dist/release/release-qualification.d.ts +106 -0
  218. package/dist/release/release-qualification.js +135 -0
  219. package/dist/release/release-staging.d.ts +9 -0
  220. package/dist/release/release-staging.js +61 -0
  221. package/dist/release/release-steps.d.ts +38 -0
  222. package/dist/release/release-steps.js +147 -0
  223. package/dist/release/retained-release-build.d.ts +19 -0
  224. package/dist/release/retained-release-build.js +122 -0
  225. package/dist/shell/app-shell.d.ts +61 -0
  226. package/dist/shell/app-shell.js +306 -0
  227. package/dist/shell/app-utilities.d.ts +122 -0
  228. package/dist/shell/app-utilities.js +334 -0
  229. package/dist/shell/application-menu-commands.d.ts +5 -0
  230. package/dist/shell/application-menu-commands.js +11 -0
  231. package/dist/shell/application-menu.d.ts +61 -0
  232. package/dist/shell/application-menu.js +208 -0
  233. package/dist/shell/help-shortcuts.d.ts +12 -0
  234. package/dist/shell/help-shortcuts.js +22 -0
  235. package/dist/shell/navigation-drawer.d.ts +12 -0
  236. package/dist/shell/navigation-drawer.js +42 -0
  237. package/dist/shell/settings-sections.d.ts +31 -0
  238. package/dist/shell/settings-sections.js +50 -0
  239. package/dist/shell/shortcut-platform.d.ts +17 -0
  240. package/dist/shell/shortcut-platform.js +25 -0
  241. package/dist/update-helper.bundle.js +260 -0
  242. package/dist/updates/channel-update-manager.d.ts +46 -0
  243. package/dist/updates/channel-update-manager.js +114 -0
  244. package/dist/updates/desktop-updater.d.ts +104 -0
  245. package/dist/updates/desktop-updater.js +345 -0
  246. package/dist/updates/release-feed.d.ts +61 -0
  247. package/dist/updates/release-feed.js +111 -0
  248. package/dist/updates/release-location.d.ts +9 -0
  249. package/dist/updates/release-location.js +80 -0
  250. package/dist/updates/release-version.d.ts +12 -0
  251. package/dist/updates/release-version.js +43 -0
  252. package/dist/updates/signed-release.d.ts +63 -0
  253. package/dist/updates/signed-release.js +162 -0
  254. package/dist/updates/stable-file.d.ts +10 -0
  255. package/dist/updates/stable-file.js +22 -0
  256. package/dist/updates/update-adapter.d.ts +57 -0
  257. package/dist/updates/update-adapter.js +72 -0
  258. package/dist/updates/update-arm.d.ts +24 -0
  259. package/dist/updates/update-arm.js +95 -0
  260. package/dist/updates/update-channel-store.d.ts +8 -0
  261. package/dist/updates/update-channel-store.js +72 -0
  262. package/dist/updates/update-discovery.d.ts +13 -0
  263. package/dist/updates/update-discovery.js +56 -0
  264. package/dist/updates/update-download.d.ts +14 -0
  265. package/dist/updates/update-download.js +67 -0
  266. package/dist/updates/update-exclusive-rename.d.ts +2 -0
  267. package/dist/updates/update-exclusive-rename.js +52 -0
  268. package/dist/updates/update-extraction.d.ts +18 -0
  269. package/dist/updates/update-extraction.js +183 -0
  270. package/dist/updates/update-handoff-plan.d.ts +22 -0
  271. package/dist/updates/update-handoff-plan.js +28 -0
  272. package/dist/updates/update-helper.d.ts +24 -0
  273. package/dist/updates/update-helper.js +56 -0
  274. package/dist/updates/update-launch.d.ts +5 -0
  275. package/dist/updates/update-launch.js +27 -0
  276. package/dist/updates/update-manager.d.ts +40 -0
  277. package/dist/updates/update-manager.js +83 -0
  278. package/dist/updates/update-process-fence.d.ts +10 -0
  279. package/dist/updates/update-process-fence.js +114 -0
  280. package/dist/updates/update-resume.d.ts +13 -0
  281. package/dist/updates/update-resume.js +34 -0
  282. package/dist/updates/update-shutdown.d.ts +15 -0
  283. package/dist/updates/update-shutdown.js +29 -0
  284. package/dist/updates/update-state.d.ts +30 -0
  285. package/dist/updates/update-state.js +18 -0
  286. package/dist/updates/update-swap-stage.d.ts +27 -0
  287. package/dist/updates/update-swap-stage.js +58 -0
  288. package/dist/updates/update-swap.d.ts +10 -0
  289. package/dist/updates/update-swap.js +30 -0
  290. package/dist/views/app-about.d.ts +22 -0
  291. package/dist/views/app-about.js +43 -0
  292. package/dist/views/app-appearance.d.ts +11 -0
  293. package/dist/views/app-appearance.js +42 -0
  294. package/dist/views/app-help.d.ts +17 -0
  295. package/dist/views/app-help.js +42 -0
  296. package/dist/views/app-settings.d.ts +26 -0
  297. package/dist/views/app-settings.js +97 -0
  298. package/dist/views/appearance-surface.d.ts +9 -0
  299. package/dist/views/appearance-surface.js +334 -0
  300. package/dist/views/update-surface.d.ts +34 -0
  301. package/dist/views/update-surface.js +64 -0
  302. package/package.json +374 -4
  303. package/src/app/application.tsx +138 -0
  304. package/src/appearance/appearance-host.tsx +205 -0
  305. package/src/appearance/appearance-preferences.ts +287 -0
  306. package/src/appearance/composition.ts +29 -0
  307. package/src/appearance/custom-theme-import.ts +424 -0
  308. package/src/appearance/custom-theme-library.ts +600 -0
  309. package/src/appearance/editor.ts +94 -0
  310. package/src/appearance/theme-file-importer.ts +103 -0
  311. package/src/appearance/theme-record-adapter.ts +106 -0
  312. package/src/appearance/theme-registry.ts +20 -0
  313. package/src/appearance/window-surface.ts +18 -0
  314. package/src/desktop/client-assets.ts +75 -0
  315. package/src/native/electrobun-cef-main-frame-bridges.patch +63 -0
  316. package/src/native/electrobun-windows-shortcut-com.patch +923 -0
  317. package/src/native/renderer-profile.ts +27 -0
  318. package/src/native/window-options.ts +24 -0
  319. package/src/shell/app-shell.tsx +294 -0
  320. package/src/shell/app-utilities.tsx +437 -0
  321. package/src/shell/help-shortcuts.ts +24 -0
  322. package/src/shell/navigation-drawer.tsx +36 -0
  323. package/src/shell/settings-sections.ts +74 -0
  324. package/src/shell/shortcut-platform.ts +35 -0
  325. package/src/updates/release-version.ts +57 -0
  326. package/src/updates/update-adapter.ts +129 -0
  327. package/src/updates/update-state.ts +34 -0
  328. package/src/views/app-about.tsx +44 -0
  329. package/src/views/app-appearance.tsx +32 -0
  330. package/src/views/app-help.tsx +43 -0
  331. package/src/views/app-settings.tsx +88 -0
  332. package/src/views/appearance-surface.tsx +427 -0
  333. package/src/views/update-surface.tsx +85 -0
  334. package/templates/application/.gitattributes +1 -0
  335. package/templates/application/.github/workflows/release-assets.yml +29 -0
  336. package/templates/application/.github/workflows/release-finalize.yml +29 -0
  337. package/templates/application/.github/workflows/release-please.yml +19 -0
  338. package/templates/application/.github/workflows/release.yml +29 -0
  339. package/templates/application/.github/workflows/validation.yml +28 -0
  340. package/templates/application/.oxfmtrc.json +6 -0
  341. package/templates/application/.oxlintrc.json +48 -0
  342. package/templates/application/.release-please-manifest.json +3 -0
  343. package/templates/application/README.md +47 -0
  344. package/templates/application/electrobun.config.ts +22 -0
  345. package/templates/application/release-please-config.json +12 -0
  346. package/templates/application/scripts/app-version.ts +9 -0
  347. package/templates/application/scripts/build-desktop.ts +34 -0
  348. package/templates/application/scripts/secure-build.ts +1 -0
  349. package/templates/application/scripts/stage-release.ts +21 -0
  350. package/templates/application/src/bun/index.ts +80 -0
  351. package/templates/application/src/electrobun.d.ts +27 -0
  352. package/templates/application/src/web/index.html +12 -0
  353. package/templates/application/src/web/main.tsx +97 -0
  354. package/templates/application/src/web/public/icon.svg +1 -0
  355. package/templates/application/src/web/style.css +3 -0
  356. package/templates/application/tests/app-config.test.ts +9 -0
  357. package/templates/application/tsconfig.json +15 -0
  358. package/templates/application/vite.config.ts +10 -0
@@ -0,0 +1,47 @@
1
+ import { type Component, type JSX, type ParentProps } from 'solid-js';
2
+ import type { ContextualSidebarProps } from '@adea-ai/ui/components/layout/contextual-sidebar';
3
+ import type { ThemeProviderProps } from '@adea-ai/ui/components/theme/lazy';
4
+ import { type ApplicationIdentity, type ApplicationUtilitiesProps } from '../shell/app-utilities';
5
+ export type ApplicationView = Readonly<{
6
+ id: string;
7
+ label: string;
8
+ icon: JSX.Element;
9
+ render(): JSX.Element;
10
+ sidebar?(): ContextualSidebarProps | undefined;
11
+ }>;
12
+ export type ApplicationDefinition = Readonly<{
13
+ identity: ApplicationIdentity;
14
+ storageKey: string;
15
+ mark: JSX.Element;
16
+ initialView: string;
17
+ views: readonly ApplicationView[];
18
+ }>;
19
+ /** Validate the static app identity and destinations before the UI mounts. */
20
+ export declare function defineApplication(definition: ApplicationDefinition): ApplicationDefinition;
21
+ export type ApplicationProps = {
22
+ definition: ApplicationDefinition;
23
+ runtime: 'desktop' | 'web';
24
+ /** Supply a router when navigation is externally owned; otherwise the app keeps local state. */
25
+ router?: {
26
+ current(): string;
27
+ navigate(id: string): void;
28
+ };
29
+ utilities?: Omit<ApplicationUtilitiesProps, 'identity' | 'runtime'>;
30
+ theme?: Omit<ThemeProviderProps, 'children' | 'storageKey'>;
31
+ /** Replace the default provider to retain an existing appearance contract. */
32
+ themeProvider?: Component<ParentProps>;
33
+ footer?: JSX.Element;
34
+ onSearch?: () => void;
35
+ searchLabel?: string;
36
+ searchKeys?: readonly string[];
37
+ navigationControls?: JSX.Element;
38
+ workspace?: JSX.Element;
39
+ search?: JSX.Element;
40
+ actions?: JSX.Element;
41
+ status?: JSX.Element;
42
+ draggable?: boolean;
43
+ macosInset?: boolean;
44
+ windowsInset?: boolean;
45
+ };
46
+ /** Mount shared UI chrome from an app's own views and identity. */
47
+ export declare function Application(props: ApplicationProps): JSX.Element;
@@ -0,0 +1,115 @@
1
+ import { ApplicationShell } from "../shell/app-shell.js";
2
+ import { ApplicationThemeProvider, ApplicationUtilities } from "../shell/app-utilities.js";
3
+ import { createComponent, memo, mergeProps } from "solid-js/web";
4
+ import { createMemo, createSignal } from "solid-js";
5
+ // src/app/application.tsx
6
+ /** Validate the static app identity and destinations before the UI mounts. */
7
+ function defineApplication(definition) {
8
+ if (!definition.identity.name.trim() || !definition.storageKey.trim() || definition.views.length === 0) throw new Error("Application identity, storage key and at least one view are required");
9
+ const ids = /* @__PURE__ */ new Set();
10
+ const views = definition.views.map((view) => {
11
+ if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(view.id) || !view.label.trim() || typeof view.render !== "function" || ids.has(view.id)) throw new Error("Application view identifiers and labels must be valid and unique");
12
+ ids.add(view.id);
13
+ return Object.freeze({ ...view });
14
+ });
15
+ if (!ids.has(definition.initialView)) throw new Error("The initial application view must exist");
16
+ return Object.freeze({
17
+ ...definition,
18
+ identity: Object.freeze({ ...definition.identity }),
19
+ views: Object.freeze(views)
20
+ });
21
+ }
22
+ /** Mount shared UI chrome from an app's own views and identity. */
23
+ function Application(props) {
24
+ const [localView, setLocalView] = createSignal(props.definition.initialView);
25
+ const view = createMemo(() => props.definition.views.find((item) => item.id === (props.router?.current() ?? localView())) ?? props.definition.views.find((item) => item.id === props.definition.initialView));
26
+ const navigate = (id) => {
27
+ if (!props.definition.views.some((item) => item.id === id)) return;
28
+ if (props.router) props.router.navigate(id);
29
+ else setLocalView(id);
30
+ };
31
+ const Theme = props.themeProvider ?? ((providerProps) => createComponent(ApplicationThemeProvider, mergeProps(() => props.theme, {
32
+ get storageKey() {
33
+ return props.definition.storageKey;
34
+ },
35
+ get children() {
36
+ return providerProps.children;
37
+ }
38
+ })));
39
+ return createComponent(Theme, { get children() {
40
+ return createComponent(ApplicationShell, {
41
+ get name() {
42
+ return props.definition.identity.name;
43
+ },
44
+ get mark() {
45
+ return props.definition.mark;
46
+ },
47
+ get destinations() {
48
+ return props.definition.views;
49
+ },
50
+ get activeDestination() {
51
+ return view().id;
52
+ },
53
+ onNavigate: navigate,
54
+ get title() {
55
+ return view().label;
56
+ },
57
+ get content() {
58
+ return view().render();
59
+ },
60
+ get sidebar() {
61
+ return view().sidebar?.();
62
+ },
63
+ get onSearch() {
64
+ return props.onSearch;
65
+ },
66
+ get searchLabel() {
67
+ return props.searchLabel;
68
+ },
69
+ get searchKeys() {
70
+ return props.searchKeys;
71
+ },
72
+ get navigation() {
73
+ return props.navigationControls;
74
+ },
75
+ get workspace() {
76
+ return props.workspace;
77
+ },
78
+ get search() {
79
+ return props.search;
80
+ },
81
+ get actions() {
82
+ return props.actions;
83
+ },
84
+ get status() {
85
+ return props.status;
86
+ },
87
+ get draggable() {
88
+ return props.draggable;
89
+ },
90
+ get macosInset() {
91
+ return props.macosInset;
92
+ },
93
+ get windowsInset() {
94
+ return props.windowsInset;
95
+ },
96
+ get footer() {
97
+ return props.footer ?? createComponent(ApplicationUtilities, mergeProps(() => props.utilities, {
98
+ get help() {
99
+ return memo(() => !!props.utilities?.help)() && {
100
+ search: Boolean(props.onSearch),
101
+ ...props.utilities.help
102
+ };
103
+ },
104
+ get identity() {
105
+ return props.definition.identity;
106
+ },
107
+ get runtime() {
108
+ return props.runtime;
109
+ }
110
+ }));
111
+ }
112
+ });
113
+ } });
114
+ }
115
+ export { Application, defineApplication };
@@ -0,0 +1,13 @@
1
+ import { type DesktopRenderer } from '../native/renderer-profile';
2
+ /** Generate a new app without replacing an existing directory. */
3
+ export declare function createApplication(options: {
4
+ directory: string;
5
+ slug: string;
6
+ name: string;
7
+ identifier: string;
8
+ sourceUrl: string;
9
+ frameworkSpecifier: string;
10
+ renderer?: DesktopRenderer;
11
+ }): Promise<{
12
+ directory: string;
13
+ }>;
@@ -0,0 +1,178 @@
1
+ import { createRendererProfile } from "../native/renderer-profile.js";
2
+ import { containsAsciiControl } from "../desktop/string-policy.js";
3
+ import { assertPortableAppName } from "../installer/installer-layout.js";
4
+ import { cp, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
5
+ import { resolve } from "node:path";
6
+ // src/app/create-application.ts
7
+ /** Generate a new app without replacing an existing directory. */
8
+ async function createApplication(options) {
9
+ if (typeof options.directory !== "string" || !options.directory.trim() || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(options.slug) || options.slug.length > 64 || typeof options.name !== "string" || !options.name.trim() || options.name.length > 80 || containsAsciiControl(options.name) || !/^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*){1,}$/.test(options.identifier) || typeof options.frameworkSpecifier !== "string" || !options.frameworkSpecifier.trim()) throw new Error("Invalid application identity or framework dependency");
10
+ assertPortableAppName(options.name);
11
+ let source;
12
+ try {
13
+ source = new URL(options.sourceUrl);
14
+ } catch {
15
+ throw new Error("Invalid application source URL");
16
+ }
17
+ if (source.protocol !== "https:" || source.username || source.password) throw new Error("Invalid application source URL");
18
+ if (containsAsciiControl(options.frameworkSpecifier, true) || options.frameworkSpecifier.length > 512) throw new Error("Invalid framework dependency");
19
+ if (/^(?:git\+)?https?:/i.test(options.frameworkSpecifier)) {
20
+ let dependency;
21
+ try {
22
+ dependency = new URL(options.frameworkSpecifier.replace(/^git\+/, ""));
23
+ } catch {
24
+ throw new Error("Invalid framework dependency");
25
+ }
26
+ if (dependency.protocol !== "https:" || dependency.username || dependency.password || dependency.search) throw new Error("Invalid framework dependency");
27
+ }
28
+ const renderer = createRendererProfile(options.renderer).renderer;
29
+ const frameworkManifest = JSON.parse(await readFile(resolve(import.meta.dir, "../../package.json"), "utf8"));
30
+ const uiVersion = frameworkManifest.devDependencies?.["@adea-ai/ui"];
31
+ if (typeof uiVersion !== "string" || !/^\d+\.\d+\.\d+$/.test(uiVersion)) throw new Error("Framework UI version is unavailable");
32
+ const frameworkVersion = frameworkManifest.version;
33
+ if (typeof frameworkVersion !== "string" || !/^\d+\.\d+\.\d+$/.test(frameworkVersion)) throw new Error("Framework version is unavailable");
34
+ const directory = resolve(options.directory);
35
+ await mkdir(directory);
36
+ const template = resolve(import.meta.dir, "../../templates/application");
37
+ for (const entry of await readdir(template)) await cp(resolve(template, entry), resolve(directory, entry), {
38
+ recursive: true,
39
+ errorOnExist: true,
40
+ force: false
41
+ });
42
+ for (const name of [
43
+ "release.yml",
44
+ "release-assets.yml",
45
+ "release-finalize.yml"
46
+ ]) {
47
+ const path = resolve(directory, ".github/workflows", name);
48
+ const workflow = await readFile(path, "utf8");
49
+ await writeFile(path, workflow.replaceAll("{{FRAMEWORK_REF}}", `v${frameworkVersion}`).replaceAll("{{RENDERER}}", renderer));
50
+ }
51
+ const config = {
52
+ slug: options.slug,
53
+ name: options.name,
54
+ identifier: options.identifier,
55
+ sourceUrl: source.href,
56
+ version: "0.1.0",
57
+ renderer,
58
+ initialPort: null,
59
+ urlSchemes: []
60
+ };
61
+ const configEntries = Object.entries(config).map(([key, value]) => {
62
+ const json = JSON.stringify(value);
63
+ return ` ${key}: ${typeof value !== "string" || value.includes("'") ? json : `'${json.slice(1, -1).replace(/\\"/g, "\"")}'`},`;
64
+ }).join("\n");
65
+ await writeFile(resolve(directory, "src/app-config.ts"), `export const appConfig = {\n${configEntries}\n} as const\n`);
66
+ const manifest = {
67
+ name: options.slug,
68
+ version: "0.1.0",
69
+ private: true,
70
+ type: "module",
71
+ packageManager: "bun@1.4.4",
72
+ scripts: {
73
+ format: "oxfmt src scripts tests vite.config.ts electrobun.config.ts",
74
+ "format:check": "oxfmt --check src scripts tests vite.config.ts electrobun.config.ts",
75
+ "format:write": "oxfmt --write src scripts tests vite.config.ts electrobun.config.ts",
76
+ lint: "oxlint src scripts tests vite.config.ts electrobun.config.ts",
77
+ typecheck: "bun check -p tsconfig.json",
78
+ test: "bun test tests",
79
+ "dev:web": "vp dev --host 127.0.0.1",
80
+ "build:web": "vp build",
81
+ "build:desktop": "bun run build:web && bun scripts/build-desktop.ts dev",
82
+ "build:release": "bun run build:web && bun scripts/build-desktop.ts stable",
83
+ "release:cut": "bun node_modules/@adea-ai/app-framework/dist/cli/release-cut-cli.js",
84
+ "release:promote": "bun node_modules/@adea-ai/app-framework/dist/cli/release-promote-cli.js",
85
+ "release:finalize": "bun node_modules/@adea-ai/app-framework/dist/cli/release-finalize-cli.js",
86
+ "release:publish": "bun node_modules/@adea-ai/app-framework/dist/cli/release-publish-cli.js",
87
+ "release:stage": "bun scripts/stage-release.ts",
88
+ "release:stage-build": "bun node_modules/@adea-ai/app-framework/dist/cli/release-step-cli.js stage-build",
89
+ "release:inspect": "bun node_modules/@adea-ai/app-framework/dist/cli/release-step-cli.js inspect",
90
+ "release:plan": "bun node_modules/@adea-ai/app-framework/dist/cli/release-assets-plan-cli.js",
91
+ "release:sign-descriptors": "bun node_modules/@adea-ai/app-framework/dist/cli/release-descriptor-staging-cli.js",
92
+ "release:qualify": "bun node_modules/@adea-ai/app-framework/dist/cli/release-step-cli.js qualify",
93
+ "release:qualify-upgrade": "bun node_modules/@adea-ai/app-framework/dist/cli/release-step-cli.js qualify-upgrade",
94
+ "release:select-retained": "bun node_modules/@adea-ai/app-framework/dist/cli/release-step-cli.js select-retained"
95
+ },
96
+ dependencies: {
97
+ "@adea-ai/app-framework": options.frameworkSpecifier,
98
+ "@adea-ai/ui": uiVersion,
99
+ "lucide-solid": "^1.51.0",
100
+ "solid-js": "1.9.15"
101
+ },
102
+ devDependencies: {
103
+ "@shadcn/lint": "^0.2.0",
104
+ oxlint: "^1.86.0",
105
+ oxfmt: "^0.71.0",
106
+ "@tailwindcss/vite": "^4.3.3",
107
+ tailwindcss: "^4.3.3",
108
+ vite: "npm:@voidzero-dev/vite-plus-core@1.4.0",
109
+ "vite-plus": "1.4.0",
110
+ "vite-plugin-solid": "2.11.14",
111
+ electrobun: "2.0.5",
112
+ typescript: "^7.0.2",
113
+ "@types/bun": "^1.4.4"
114
+ },
115
+ overrides: { vite: "npm:@voidzero-dev/vite-plus-core@1.4.0" }
116
+ };
117
+ await writeFile(resolve(directory, "package.json"), JSON.stringify(manifest, null, 2) + "\n");
118
+ const platforms = {
119
+ "macos-arm64": [`${options.slug}-{tag}-macos-arm64.dmg`, `${options.slug}-{tag}-macos-arm64.tar.zst`],
120
+ "windows-x64": [`${options.slug}-{tag}-windows-x64-Setup.zip`, `${options.slug}-{tag}-windows-x64.tar.zst`],
121
+ "linux-x64": [`${options.slug}-{tag}-linux-x64-Setup.tar.gz`, `${options.slug}-{tag}-linux-x64.tar.zst`]
122
+ };
123
+ const devDiscoveryAssets = Object.keys(platforms).map((platform) => `dev-${platform}.json`);
124
+ const dailyDiscoveryAssets = Object.keys(platforms).map((platform) => `daily-${platform}.json`);
125
+ const stableDiscoveryAssets = Object.keys(platforms).map((platform) => `stable-${platform}.json`);
126
+ const releaseAssets = [
127
+ ...dailyDiscoveryAssets,
128
+ ...stableDiscoveryAssets,
129
+ ...devDiscoveryAssets
130
+ ];
131
+ const targets = {
132
+ "macos-arm64": ["darwin", "arm64"],
133
+ "windows-x64": ["win32", "x64"],
134
+ "linux-x64": ["linux", "x64"]
135
+ };
136
+ const descriptors = Object.fromEntries([
137
+ "dev",
138
+ "daily",
139
+ "stable"
140
+ ].flatMap((channel) => Object.entries(targets).map(([platform, [os, arch]]) => [`${channel}-${platform}.json`, {
141
+ channel,
142
+ platform: os,
143
+ arch,
144
+ allowedPayloads: [platforms[platform][1]]
145
+ }])));
146
+ await writeFile(resolve(directory, "release-config.json"), JSON.stringify({
147
+ appName: options.name,
148
+ appId: options.identifier,
149
+ soakHours: 96,
150
+ versionSource: {
151
+ kind: "source-manifest",
152
+ path: "package.json"
153
+ },
154
+ releaseWorkflows: {
155
+ control: ".github/workflows/release.yml",
156
+ assets: ".github/workflows/release-assets.yml"
157
+ },
158
+ releaseFeed: {
159
+ base: "https://adea.dev/releases/",
160
+ app: options.slug
161
+ },
162
+ offlinePolicy: {
163
+ kind: "standalone",
164
+ marker: `Welcome to ${options.name}.`
165
+ },
166
+ offlineExpectedReads: [],
167
+ platforms,
168
+ releaseAssets,
169
+ dailyDiscoveryAssets,
170
+ stableDiscoveryAssets,
171
+ devDiscoveryAssets,
172
+ releaseSigningKeys: {},
173
+ descriptors
174
+ }, null, 2) + "\n");
175
+ await writeFile(resolve(directory, ".gitignore"), "node_modules/\nbuild/\nartifacts/\n.hutch/\n.cottontail-tmp/\n.env\n.env.*\n!.env.example\n");
176
+ return { directory };
177
+ }
178
+ export { createApplication };
@@ -0,0 +1,44 @@
1
+ /** The transport supplies a verified principal; this registry does not authenticate it. */
2
+ export type ServiceDefinition<Principal, Input, Output> = Readonly<{
3
+ parse(value: unknown): Input;
4
+ authorize(principal: Principal, input: Input): boolean | Promise<boolean>;
5
+ run(principal: Principal, input: Input): Output | Promise<Output>;
6
+ /** Largest invoke body the transport accepts for this service. Default 256 KiB, at most 16 MiB. */
7
+ maxBodyBytes?: number;
8
+ }>;
9
+ export type ServiceResult = {
10
+ ok: true;
11
+ value: unknown;
12
+ } | {
13
+ ok: false;
14
+ code: 'unknown_service' | 'invalid_input' | 'unauthorized' | 'service_failed';
15
+ } | {
16
+ ok: false;
17
+ code: 'service_error';
18
+ error: {
19
+ code: string;
20
+ message: string;
21
+ };
22
+ };
23
+ export declare const DEFAULT_SERVICE_BODY_BYTES: number;
24
+ export declare const MAX_SERVICE_BODY_BYTES: number;
25
+ /**
26
+ * An error a service means its caller to read. Throw it from `run` and the caller
27
+ * receives `{ok: false, code: 'service_error', error: {code, message}}`; any other
28
+ * thrown value stays a bare `service_failed` so implementation detail never leaks.
29
+ */
30
+ export declare class ServiceError extends Error {
31
+ readonly code: string;
32
+ constructor(code: string, message: string);
33
+ }
34
+ /** In-process dispatch boundary for app services. Never expose it without an authenticated transport. */
35
+ export declare function createServiceRegistry<Principal>(): {
36
+ register<Input, Output>(name: string, definition: ServiceDefinition<Principal, Input, Output>): () => void;
37
+ /**
38
+ * The invoke body limit for `name` (the default for an unknown service), or with no
39
+ * name the largest limit any registered service accepts, for reading before the name is known.
40
+ */
41
+ maxBodyBytes(name?: string): number;
42
+ /** `current` must synchronously recheck channel and scope immediately before the handler starts. */
43
+ dispatch(name: string, value: unknown, principal: Principal, current?: () => boolean): Promise<ServiceResult>;
44
+ };
@@ -0,0 +1,116 @@
1
+ // src/app/service-registry.ts
2
+ var MAX_ERROR_MESSAGE = 2048;
3
+ var DEFAULT_SERVICE_BODY_BYTES = 262144;
4
+ var MAX_SERVICE_BODY_BYTES = 16777216;
5
+ /**
6
+ * An error a service means its caller to read. Throw it from `run` and the caller
7
+ * receives `{ok: false, code: 'service_error', error: {code, message}}`; any other
8
+ * thrown value stays a bare `service_failed` so implementation detail never leaks.
9
+ */
10
+ var ServiceError = class extends Error {
11
+ code;
12
+ constructor(code, message) {
13
+ if (typeof code !== "string" || !/^[a-z][a-z0-9_]*$/.test(code) || code.length > 64) throw new Error("Invalid service error code");
14
+ if (typeof message !== "string") throw new Error("Invalid service error message");
15
+ super(message.length > MAX_ERROR_MESSAGE ? message.slice(0, MAX_ERROR_MESSAGE) : message);
16
+ this.name = "ServiceError";
17
+ this.code = code;
18
+ }
19
+ };
20
+ /** In-process dispatch boundary for app services. Never expose it without an authenticated transport. */
21
+ function createServiceRegistry() {
22
+ const entries = /* @__PURE__ */ new Map();
23
+ return {
24
+ register(name, definition) {
25
+ if (!/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/.test(name) || name.length > 128) throw new Error("Invalid service name");
26
+ if (entries.has(name)) throw new Error("Service already registered");
27
+ const { parse, authorize, run } = definition;
28
+ if (typeof parse !== "function" || typeof authorize !== "function" || typeof run !== "function") throw new Error("Invalid service definition");
29
+ const maxBodyBytes = definition.maxBodyBytes ?? 262144;
30
+ if (!Number.isSafeInteger(maxBodyBytes) || maxBodyBytes < 1 || maxBodyBytes > 16777216) throw new Error("Invalid service body limit");
31
+ const entry = {
32
+ maxBodyBytes,
33
+ async invoke(value, principal, current) {
34
+ let input;
35
+ try {
36
+ input = parse(value);
37
+ } catch {
38
+ return {
39
+ ok: false,
40
+ code: "invalid_input"
41
+ };
42
+ }
43
+ try {
44
+ if (await authorize(principal, input) !== true) return {
45
+ ok: false,
46
+ code: "unauthorized"
47
+ };
48
+ } catch {
49
+ return {
50
+ ok: false,
51
+ code: "unauthorized"
52
+ };
53
+ }
54
+ if (entries.get(name) !== entry) return {
55
+ ok: false,
56
+ code: "unknown_service"
57
+ };
58
+ try {
59
+ if (current && current() !== true) return {
60
+ ok: false,
61
+ code: "unauthorized"
62
+ };
63
+ } catch {
64
+ return {
65
+ ok: false,
66
+ code: "unauthorized"
67
+ };
68
+ }
69
+ try {
70
+ return {
71
+ ok: true,
72
+ value: await run(principal, input)
73
+ };
74
+ } catch (error) {
75
+ if (!(error instanceof ServiceError)) return {
76
+ ok: false,
77
+ code: "service_failed"
78
+ };
79
+ return {
80
+ ok: false,
81
+ code: "service_error",
82
+ error: {
83
+ code: error.code,
84
+ message: error.message
85
+ }
86
+ };
87
+ }
88
+ }
89
+ };
90
+ entries.set(name, entry);
91
+ return () => {
92
+ if (entries.get(name) === entry) entries.delete(name);
93
+ };
94
+ },
95
+ /**
96
+ * The invoke body limit for `name` (the default for an unknown service), or with no
97
+ * name the largest limit any registered service accepts, for reading before the name is known.
98
+ */
99
+ maxBodyBytes(name) {
100
+ if (name !== void 0) return entries.get(name)?.maxBodyBytes ?? 262144;
101
+ let largest = DEFAULT_SERVICE_BODY_BYTES;
102
+ for (const entry of entries.values()) largest = Math.max(largest, entry.maxBodyBytes);
103
+ return largest;
104
+ },
105
+ /** `current` must synchronously recheck channel and scope immediately before the handler starts. */
106
+ async dispatch(name, value, principal, current) {
107
+ const entry = entries.get(name);
108
+ if (!entry) return {
109
+ ok: false,
110
+ code: "unknown_service"
111
+ };
112
+ return entry.invoke(value, principal, current);
113
+ }
114
+ };
115
+ }
116
+ export { DEFAULT_SERVICE_BODY_BYTES, MAX_SERVICE_BODY_BYTES, ServiceError, createServiceRegistry };
@@ -0,0 +1,62 @@
1
+ import { type JSX, type ParentProps } from 'solid-js';
2
+ import { type ThemeContextValue as UiThemeContextValue, type ThemeProviderProps as UiThemeProviderProps } from '@adea-ai/ui/components/theme/lazy';
3
+ import { type AppearancePreferencesV2 } from './appearance-preferences';
4
+ export type { AppearanceMode, AppearancePreferencesV2, ResolvedAppearance, } from './appearance-preferences';
5
+ /**
6
+ * The shared theme context plus the V2 document seam the appearance editor works
7
+ * in. Everything the shell reads (the selection, the resolved appearance, the
8
+ * variant, `accentRolesFor`) is the shared context itself; only a V2-shaped write
9
+ * and a V2-shaped draft preview are Adea's.
10
+ */
11
+ export type AppearanceContextValue = Omit<UiThemeContextValue, 'preview'> & {
12
+ /** Persist a field update immediately (Zeron's `SavePolicy::Immediate`). */
13
+ update: (patch: Partial<AppearancePreferencesV2>) => void;
14
+ /**
15
+ * Apply a draft against the visible app without persisting it. A committed change
16
+ * while a draft is open (a zoom chord, the mode toggle) leaves the draft showing.
17
+ */
18
+ preview: (preferences: AppearancePreferencesV2 | undefined) => void;
19
+ };
20
+ /**
21
+ * Everything the shared provider is told about Adea: where the preference lives, the
22
+ * imported themes, and the policies that make Adea's document what it has always
23
+ * been. A function so a test and the component build the same provider.
24
+ */
25
+ export declare function appearanceProviderProps(options?: {
26
+ nativeTranslucency?: () => boolean;
27
+ }): Omit<UiThemeProviderProps, 'children'>;
28
+ /**
29
+ * The V2 view of a shared theme context. Reads derive from the provider's selection;
30
+ * writes go through its `setSelection`, so the shared provider remains the only
31
+ * writer of the document and of storage.
32
+ */
33
+ export declare function createAppearanceContext(ui: UiThemeContextValue): AppearanceContextValue;
34
+ type ThemeProviderProps = ParentProps<{
35
+ /**
36
+ * Whether the host window can render OS translucency. The web lane keeps
37
+ * the default `false` and renders tokenized frosted surfaces instead of
38
+ * pretending to OS vibrancy.
39
+ */
40
+ nativeTranslucency?: boolean;
41
+ }>;
42
+ /**
43
+ * Adea's appearance provider: the shared ThemeProvider configured for Adea's V2
44
+ * document, with the V2 context on top. It owns the versioned appearance preference
45
+ * (mode, independent light/dark themes, accent, surface) and applies it to the
46
+ * document.
47
+ */
48
+ export declare function ThemeProvider(props: ThemeProviderProps): JSX.Element;
49
+ /**
50
+ * The appearance editor's view of the context: the shared context with the V2
51
+ * `update` and `preview` seam. Shell code that only reads the theme (the selection,
52
+ * the variant, `accentRolesFor`) uses the shared `useOptionalTheme` of
53
+ * `@adea-ai/ui/components/theme` instead.
54
+ */
55
+ export declare function useTheme(): AppearanceContextValue;
56
+ /**
57
+ * Pre-paint appearance restore for server-rendered documents. Rendered in the
58
+ * document head, it resolves the stored preference against the OS
59
+ * and applies the document state before first paint so hydration never shows the
60
+ * wrong theme.
61
+ */
62
+ export declare function ThemeScript(): JSX.Element;