@omega.js/desktop 0.52.0 → 0.54.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 (345) hide show
  1. package/README.md +53 -48
  2. package/dist/assets/css/core/_initialize.scss +1 -1
  3. package/dist/assets/js/core/app-shell.js +14 -15
  4. package/dist/assets/themes/_template/_theme.js +6 -6
  5. package/dist/assets/themes/base/_includes/global/sections/account.html +4 -4
  6. package/dist/assets/themes/base/_includes/global/sections/app-sidebar.html +5 -5
  7. package/dist/assets/themes/base/_layouts/frontend/pages/account/index.html +3 -3
  8. package/dist/assets/themes/base/_layouts/frontend/pages/alternatives/index.html +1 -1
  9. package/dist/assets/themes/base/_layouts/frontend/pages/blog/tags/tag.html +1 -1
  10. package/dist/assets/themes/base/_layouts/frontend/pages/payment/confirmation.html +1 -1
  11. package/dist/assets/themes/base/_sections/marketing/newsletter-cta/section.js +2 -3
  12. package/dist/assets/themes/base/_sections/verts/unit/section.html +1 -1
  13. package/dist/assets/themes/base/_sections/verts/unit/section.js +3 -4
  14. package/dist/assets/themes/base/_theme.js +4 -3
  15. package/dist/assets/themes/bootstrap/_theme.js +2 -2
  16. package/dist/assets/themes/bootstrap/overrides/_links.scss +1 -1
  17. package/dist/assets/themes/classy/_theme.js +8 -6
  18. package/dist/assets/themes/classy/css/marketing/_sections.scss +1 -2
  19. package/dist/assets/themes/classy/js/hero-demo-form.js +3 -2
  20. package/dist/assets/themes/neobrutalism/_theme.js +5 -5
  21. package/dist/assets/themes/neobrutalism/js/pages/test/libraries/layers/index.js +1 -1
  22. package/dist/assets/themes/newsflash/_theme.js +6 -6
  23. package/dist/assets/themes/newsflash/js/pages/test/libraries/layers/index.js +1 -1
  24. package/dist/build.js +87 -111
  25. package/dist/cli-run.js +4 -1
  26. package/dist/cli.js +3 -3
  27. package/dist/commands/build.js +2 -2
  28. package/dist/commands/cdp/capture.js +2 -2
  29. package/dist/commands/cdp/client.js +1 -1
  30. package/dist/commands/cdp/quit.js +2 -2
  31. package/dist/commands/cdp/relaunch.js +2 -2
  32. package/dist/commands/cdp/theme.js +1 -1
  33. package/dist/commands/cdp.js +1 -1
  34. package/dist/commands/clean.js +4 -5
  35. package/dist/commands/deploy.js +4 -4
  36. package/dist/commands/dev.js +25 -0
  37. package/dist/commands/finalize-release.js +4 -4
  38. package/dist/commands/launch.js +2 -2
  39. package/dist/commands/lib/deploy-precheck.js +3 -3
  40. package/dist/commands/lib/ensure-target.js +18 -23
  41. package/dist/commands/lib/migrate.js +17 -0
  42. package/dist/commands/logs.js +1 -1
  43. package/dist/commands/package.js +2 -2
  44. package/dist/commands/publish.js +2 -2
  45. package/dist/commands/release.js +4 -4
  46. package/dist/commands/runner.js +11 -11
  47. package/dist/commands/sign-windows.js +5 -5
  48. package/dist/commands/test.js +8 -8
  49. package/dist/commands/update.js +7 -6
  50. package/dist/commands/validate-certs.js +4 -4
  51. package/dist/commands/version.js +3 -3
  52. package/dist/defaults/.github/workflows/build.yml +18 -18
  53. package/dist/defaults/_.gitignore +0 -2
  54. package/dist/defaults/_mas/README.md +3 -3
  55. package/dist/defaults/config/certs/README.md +1 -1
  56. package/dist/defaults/config/omega.json5 +43 -43
  57. package/dist/defaults/docs/README.md +3 -3
  58. package/dist/defaults/gulpfile.js +1 -1
  59. package/dist/defaults/hooks/build/post.js +2 -2
  60. package/dist/defaults/hooks/build/pre.js +2 -2
  61. package/dist/defaults/hooks/deploy/pre.js +1 -1
  62. package/dist/defaults/hooks/notarize/post.js +2 -2
  63. package/dist/defaults/hooks/release/post.js +2 -2
  64. package/dist/defaults/hooks/release/pre.js +2 -2
  65. package/dist/defaults/src/assets/js/components/about/index.js +3 -5
  66. package/dist/defaults/src/assets/js/components/main/index.js +3 -5
  67. package/dist/defaults/src/assets/js/components/settings/index.js +3 -5
  68. package/dist/defaults/src/assets/scss/pages/about.scss +1 -1
  69. package/dist/defaults/src/assets/scss/pages/main.scss +1 -1
  70. package/dist/defaults/src/assets/scss/pages/settings.scss +1 -1
  71. package/dist/defaults/src/integrations/context-menu/index.js +13 -13
  72. package/dist/defaults/src/integrations/menu/index.js +8 -8
  73. package/dist/defaults/src/integrations/tray/index.js +12 -12
  74. package/dist/defaults/src/main.js +5 -7
  75. package/dist/defaults/src/preload.js +4 -6
  76. package/dist/defaults/test/README.md +5 -5
  77. package/dist/defaults/test/_init.js +1 -1
  78. package/dist/gulp/main.js +9 -10
  79. package/dist/gulp/tasks/audit.js +11 -14
  80. package/dist/gulp/tasks/build-config.js +8 -8
  81. package/dist/gulp/tasks/bundle.js +16 -16
  82. package/dist/gulp/tasks/defaults.js +3 -3
  83. package/dist/gulp/tasks/distribute.js +2 -2
  84. package/dist/gulp/tasks/html.js +9 -9
  85. package/dist/gulp/tasks/package-quick.js +3 -3
  86. package/dist/gulp/tasks/package.js +3 -3
  87. package/dist/gulp/tasks/release.js +3 -3
  88. package/dist/gulp/tasks/sass.js +6 -6
  89. package/dist/gulp/tasks/serve.js +4 -4
  90. package/dist/hooks/notarize-artifacts.js +1 -1
  91. package/dist/hooks/notarize.js +1 -1
  92. package/dist/index.js +5 -8
  93. package/dist/lib/_environment-mixin.js +50 -0
  94. package/dist/lib/_lifecycle-mixin.js +45 -0
  95. package/dist/lib/analytics.js +33 -35
  96. package/dist/lib/app-state.js +14 -14
  97. package/dist/lib/auth-flow.js +18 -18
  98. package/dist/lib/auth-persistence.js +12 -12
  99. package/dist/lib/auth.js +421 -0
  100. package/dist/lib/auto-updater.js +49 -49
  101. package/dist/lib/context-menu.js +13 -13
  102. package/dist/lib/context.js +19 -19
  103. package/dist/lib/deep-link.js +34 -34
  104. package/dist/lib/fontawesome.js +5 -5
  105. package/dist/lib/ipc.js +4 -4
  106. package/dist/lib/menu.js +25 -25
  107. package/dist/lib/protocol.js +5 -5
  108. package/dist/lib/remote-config.js +22 -22
  109. package/dist/lib/remote-scripts.js +21 -21
  110. package/dist/lib/restart-manager/index.js +29 -29
  111. package/dist/lib/restart-manager/install.js +1 -1
  112. package/dist/lib/restart-manager/protocol.js +1 -1
  113. package/dist/lib/sign-helpers/exec-with-limit.js +1 -1
  114. package/dist/lib/sign-helpers/sign-events.js +1 -1
  115. package/dist/lib/startup.js +18 -13
  116. package/dist/lib/storage.js +10 -10
  117. package/dist/lib/templating.js +16 -16
  118. package/dist/lib/theme.js +10 -10
  119. package/dist/lib/tray.js +27 -27
  120. package/dist/lib/usage.js +11 -11
  121. package/dist/lib/window-manager.js +26 -26
  122. package/dist/main.js +399 -483
  123. package/dist/preload.js +236 -176
  124. package/dist/renderer.js +417 -391
  125. package/dist/test/fixtures/consumer-app/config/omega.json5 +1 -1
  126. package/dist/test/fixtures/consumer-app/src/assets/js/components/main/index.js +8 -11
  127. package/dist/test/fixtures/consumer-app/src/main.js +5 -7
  128. package/dist/test/fixtures/consumer-app/src/preload.js +2 -2
  129. package/dist/test/harness/boot-entry.js +22 -20
  130. package/dist/test/harness/main-entry.js +31 -30
  131. package/dist/test/harness/renderer-entry.js +5 -5
  132. package/dist/test/harness/renderer-preload.js +137 -141
  133. package/dist/test/index.js +10 -10
  134. package/dist/test/runner.js +2 -2
  135. package/dist/test/runners/boot.js +7 -6
  136. package/dist/test/runners/electron.js +3 -2
  137. package/dist/test/runners/render-event.js +2 -2
  138. package/dist/test/suites/boot/consumer-app-boots.test.js +57 -26
  139. package/dist/test/suites/boot/restart-manager.test.js +2 -2
  140. package/dist/test/suites/boot/storage-bundled.test.js +5 -5
  141. package/dist/test/suites/boot/theme.test.js +13 -13
  142. package/dist/test/suites/build/audit.test.js +21 -8
  143. package/dist/test/suites/build/auth-persistence-resolve.test.js +6 -6
  144. package/dist/test/suites/build/boot-fixture.test.js +2 -2
  145. package/dist/test/suites/build/boot-runner-timeout.test.js +6 -5
  146. package/dist/test/suites/build/brand-scss.test.js +1 -1
  147. package/dist/test/suites/build/build-json-bake.test.js +1 -1
  148. package/dist/test/suites/build/build-workflow-jobs.test.js +2 -2
  149. package/dist/test/suites/build/cli.test.js +30 -2
  150. package/dist/test/suites/build/config-schema.test.js +5 -5
  151. package/dist/test/suites/build/defaults-em-dash.test.js +22 -0
  152. package/dist/test/suites/build/defaults-scaffold.test.js +21 -7
  153. package/dist/test/suites/build/deploy-direct.test.js +7 -5
  154. package/dist/test/suites/build/deploy-dispatch.test.js +2 -1
  155. package/dist/test/suites/build/deploy-hook.test.js +7 -5
  156. package/dist/test/suites/build/dev-verb.test.js +67 -0
  157. package/dist/test/suites/build/ensure-target.test.js +13 -5
  158. package/dist/test/suites/build/env-delivery.test.js +2 -2
  159. package/dist/test/suites/build/esm-only-dependency.test.js +2 -2
  160. package/dist/test/suites/build/exports.test.js +9 -8
  161. package/dist/test/suites/build/get-config.test.js +4 -4
  162. package/dist/test/suites/build/manifest-deps.test.js +1 -1
  163. package/dist/test/suites/build/merge-line-files.test.js +7 -7
  164. package/dist/test/suites/build/migrate.test.js +29 -0
  165. package/dist/test/suites/build/omega-shell.test.js +34 -2
  166. package/dist/test/suites/build/omega.test.js +350 -0
  167. package/dist/test/suites/build/project-scripts-deps.test.js +6 -10
  168. package/dist/test/suites/build/renderer-auth-bridge.test.js +211 -78
  169. package/dist/test/suites/build/runner-env-write.test.js +73 -0
  170. package/dist/test/suites/build/runner.test.js +11 -10
  171. package/dist/test/suites/build/sentry.test.js +2 -2
  172. package/dist/test/suites/build/setup-scripts.test.js +27 -0
  173. package/dist/test/suites/build/sign-windows-e2e.test.js +2 -2
  174. package/dist/test/suites/build/templating.test.js +3 -3
  175. package/dist/test/suites/build/test-stealth.test.js +7 -9
  176. package/dist/test/suites/build/url-helpers.test.js +55 -56
  177. package/dist/test/suites/build/validate-config.test.js +15 -4
  178. package/dist/test/suites/build/verb-logs.test.js +20 -0
  179. package/dist/test/suites/build/wave5-pins.test.js +2 -2
  180. package/dist/test/suites/main/analytics.test.js +59 -59
  181. package/dist/test/suites/main/app-state.test.js +66 -66
  182. package/dist/test/suites/main/auth-flow.test.js +41 -41
  183. package/dist/test/suites/main/auth-persistence.test.js +54 -43
  184. package/dist/test/suites/main/{client-bridge.integration.test.js → auth.integration.test.js} +10 -9
  185. package/dist/test/suites/main/auth.test.js +336 -0
  186. package/dist/test/suites/main/auto-updater.test.js +134 -134
  187. package/dist/test/suites/main/boot-sequence.test.js +37 -49
  188. package/dist/test/suites/main/context-menu.test.js +51 -50
  189. package/dist/test/suites/main/context.test.js +25 -25
  190. package/dist/test/suites/main/deep-link.test.js +74 -74
  191. package/dist/test/suites/main/fontawesome.test.js +27 -27
  192. package/dist/test/suites/main/ipc.test.js +35 -35
  193. package/dist/test/suites/main/menu.test.js +101 -100
  194. package/dist/test/suites/main/protocol.test.js +19 -19
  195. package/dist/test/suites/main/remote-config.test.js +63 -63
  196. package/dist/test/suites/main/remote-scripts.test.js +103 -103
  197. package/dist/test/suites/main/request.test.js +71 -0
  198. package/dist/test/suites/main/restart-manager.test.js +33 -33
  199. package/dist/test/suites/main/startup-paths-and-ua.test.js +4 -4
  200. package/dist/test/suites/main/startup.test.js +26 -26
  201. package/dist/test/suites/main/stealth-window.test.js +1 -1
  202. package/dist/test/suites/main/storage.test.js +25 -25
  203. package/dist/test/suites/main/theme.test.js +34 -34
  204. package/dist/test/suites/main/tray.test.js +79 -79
  205. package/dist/test/suites/main/url-helpers.test.js +133 -133
  206. package/dist/test/suites/main/usage.test.js +25 -25
  207. package/dist/test/suites/main/window-bounds.test.js +27 -27
  208. package/dist/test/suites/main/window-manager.test.js +44 -44
  209. package/dist/test/suites/renderer/analytics-bridge.test.js +5 -5
  210. package/dist/test/suites/renderer/cross-context-helpers.test.js +37 -31
  211. package/dist/test/suites/renderer/round-trip.test.js +3 -3
  212. package/dist/test/suites/renderer/tooltips.test.js +15 -15
  213. package/dist/test/suites/renderer/{window-em-surface.test.js → window-desktop-surface.test.js} +28 -8
  214. package/dist/test/utils/extended-mode-warning.js +1 -1
  215. package/dist/utils/boot-harness.js +56 -0
  216. package/dist/utils/build-pipeline.js +4 -4
  217. package/dist/utils/mode-helpers.js +2 -15
  218. package/dist/utils/runner-env.js +13 -28
  219. package/dist/utils/ship-keys.js +3 -3
  220. package/dist/utils/signing-status.js +51 -0
  221. package/dist/utils/test-events.js +7 -0
  222. package/dist/utils/test-stealth.js +6 -6
  223. package/dist/utils/url-helpers.js +52 -42
  224. package/dist/utils/user-agent.js +44 -0
  225. package/dist/vendor/account/engine.js +3 -3
  226. package/dist/vendor/account/index.js +14 -45
  227. package/dist/vendor/account/resolve-account.js +44 -0
  228. package/dist/vendor/account/schema.js +1 -1
  229. package/dist/vendor/account/user.js +99 -0
  230. package/dist/vendor/config/client-config.js +1 -1
  231. package/dist/vendor/config/company.js +46 -14
  232. package/dist/vendor/config/defaults.js +30 -7
  233. package/dist/vendor/config/edit.js +25 -3
  234. package/dist/vendor/config/env-delivery.js +1 -1
  235. package/dist/vendor/config/env-schema.js +3 -6
  236. package/dist/vendor/config/env.js +34 -22
  237. package/dist/vendor/config/environment.js +11 -30
  238. package/dist/vendor/config/index.js +21 -28
  239. package/dist/vendor/config/load.js +16 -9
  240. package/dist/vendor/config/platforms.js +1 -1
  241. package/dist/vendor/config/repo.js +10 -27
  242. package/dist/vendor/config/schema-client.js +64 -0
  243. package/dist/vendor/config/schema-cloud.js +38 -0
  244. package/dist/vendor/config/schema-manager.js +118 -0
  245. package/dist/vendor/config/schema-overrides.js +68 -0
  246. package/dist/vendor/config/schema.js +104 -160
  247. package/dist/vendor/config/site-global.js +2 -3
  248. package/dist/vendor/config/validate.js +97 -78
  249. package/dist/vendor/config/winback.js +1 -1
  250. package/dist/vendor/devkit/actions-secrets.js +1 -1
  251. package/dist/vendor/devkit/agents-md.js +233 -0
  252. package/dist/vendor/devkit/attach-log-file.js +16 -2
  253. package/dist/vendor/devkit/build-json.js +1 -1
  254. package/dist/vendor/devkit/ci-workflows.js +30 -30
  255. package/dist/vendor/devkit/cli-router.js +16 -11
  256. package/dist/vendor/devkit/defaults-engine.js +15 -51
  257. package/dist/vendor/devkit/deploy-snapshot.js +44 -9
  258. package/dist/vendor/devkit/env-lines.js +183 -0
  259. package/dist/vendor/devkit/local.js +64 -10
  260. package/dist/vendor/devkit/lockfile.js +32 -13
  261. package/dist/vendor/devkit/logger.js +7 -2
  262. package/dist/vendor/devkit/merge-line-files.js +219 -177
  263. package/dist/vendor/devkit/omega-bin.js +208 -111
  264. package/dist/vendor/devkit/preludes/docs-sync.js +52 -0
  265. package/dist/vendor/devkit/preludes/index.js +1 -0
  266. package/dist/vendor/devkit/target-picker.js +45 -0
  267. package/dist/vendor/devkit/test/dashed-files.js +37 -0
  268. package/dist/vendor/devkit/test/run-verb-under-tee.js +71 -0
  269. package/dist/vendor/devkit/test/runner-core.js +6 -6
  270. package/dist/vendor/devkit/update.js +15 -15
  271. package/dist/vendor/devkit/verb-scripts.js +40 -0
  272. package/dist/vendor/devkit/verbs.js +170 -0
  273. package/dist/vendor/monitoring/env.js +2 -2
  274. package/dist/vendor/monitoring/index.js +1 -1
  275. package/dist/vendor/monitoring/main.js +1 -1
  276. package/dist/vendor/monitoring/preload.js +1 -1
  277. package/dist/vendor/monitoring/renderer.js +1 -1
  278. package/package.json +19 -26
  279. package/dist/commands/install.js +0 -37
  280. package/dist/defaults/AGENTS.md +0 -110
  281. package/dist/defaults/CLAUDE.md +0 -1
  282. package/dist/lib/client-bridge.js +0 -374
  283. package/dist/lib/logger.js +0 -4
  284. package/dist/test/suites/build/manager.test.js +0 -213
  285. package/dist/test/suites/main/client-bridge.test.js +0 -262
  286. package/dist/vendor/config/env-retired.js +0 -137
  287. package/dist/vendor/config/retired-keys.js +0 -635
  288. package/docs/analytics.md +0 -140
  289. package/docs/app-state.md +0 -92
  290. package/docs/audit.md +0 -69
  291. package/docs/auto-updater.md +0 -243
  292. package/docs/boot-sequence.md +0 -39
  293. package/docs/build-system.md +0 -169
  294. package/docs/cdp-debugging.md +0 -169
  295. package/docs/client-bridge.md +0 -269
  296. package/docs/common-mistakes.md +0 -21
  297. package/docs/config-schema.md +0 -120
  298. package/docs/context-menu.md +0 -112
  299. package/docs/context.md +0 -81
  300. package/docs/css.md +0 -90
  301. package/docs/deep-link.md +0 -186
  302. package/docs/environment-detection.md +0 -112
  303. package/docs/fontawesome.md +0 -107
  304. package/docs/hooks.md +0 -89
  305. package/docs/icons.md +0 -79
  306. package/docs/index.md +0 -317
  307. package/docs/installer-options.md +0 -165
  308. package/docs/ipc.md +0 -61
  309. package/docs/lib-modules.md +0 -53
  310. package/docs/logging.md +0 -229
  311. package/docs/menu.md +0 -160
  312. package/docs/releasing.md +0 -239
  313. package/docs/remote-config.md +0 -118
  314. package/docs/remote-scripts.md +0 -144
  315. package/docs/restart-manager.md +0 -144
  316. package/docs/runner.md +0 -290
  317. package/docs/sentry.md +0 -97
  318. package/docs/shared/agent-docs.md +0 -89
  319. package/docs/shared/analytics.md +0 -612
  320. package/docs/shared/brands.md +0 -57
  321. package/docs/shared/breaking-changes.md +0 -851
  322. package/docs/shared/config.md +0 -1952
  323. package/docs/shared/deploys.md +0 -341
  324. package/docs/shared/icons.md +0 -219
  325. package/docs/shared/local-dev.md +0 -167
  326. package/docs/shared/logging.md +0 -205
  327. package/docs/shared/monitoring.md +0 -167
  328. package/docs/shared/publishing.md +0 -187
  329. package/docs/shared/rulings.md +0 -34
  330. package/docs/shared/testing.md +0 -147
  331. package/docs/shared/theming.md +0 -629
  332. package/docs/shared/translation.md +0 -333
  333. package/docs/shared/updates.md +0 -61
  334. package/docs/signing.md +0 -293
  335. package/docs/startup.md +0 -142
  336. package/docs/storage.md +0 -59
  337. package/docs/templating.md +0 -101
  338. package/docs/test-boot-layer.md +0 -157
  339. package/docs/test-framework.md +0 -362
  340. package/docs/themes.md +0 -149
  341. package/docs/tooltips.md +0 -99
  342. package/docs/tray.md +0 -164
  343. package/docs/usage.md +0 -58
  344. package/docs/verts.md +0 -62
  345. package/docs/windows.md +0 -149
@@ -1,110 +0,0 @@
1
- # ========== Default Values ==========
2
- # OMEGA Desktop (@omega.js/desktop) consumer project
3
-
4
- <!-- MAINTAINERS (framework repo): this consumer template is MIRRORED across all OMEGA framework consumer templates (src/defaults/AGENTS.md ×N; web's lives at scaffold/AGENTS.md).
5
- Same sections in the same order: framework-specific extras may be inserted; canonical sections are never reordered/renamed. Edit every framework consumer template together.
6
- The mirroring rule lives in each framework guide's Doc-update parity section (docs/<framework>/index.md) -->
7
-
8
- ## Framework
9
-
10
- This project consumes **OMEGA Desktop** (@omega.js/desktop), a comprehensive framework for building modern Electron desktop apps. @omega.js/desktop provides one-line-import bootstrap per Electron process, a modular feature library with file-based extensibility, a multi-platform build/release pipeline (DMG / NSIS / deb / AppImage), and a built-in four-layer test framework.
11
-
12
- ## 🚨 READ THE FRAMEWORK DOCS FIRST
13
-
14
- **Before doing ANY work on this codebase, the agent MUST read the framework documentation: that is where the architecture, conventions, APIs, and gotchas live. Skipping these will result in solutions that conflict with framework patterns.**
15
-
16
- **Required reading:**
17
- - **`node_modules/@omega.js/AGENTS.md`**: the OMEGA map, the one agent entry into the framework docs; follow it to `docs/desktop/index.md` (the @omega.js/desktop guide: identity, architecture, conventions)
18
- - **`node_modules/@omega.js/desktop/docs/`**: subsystem deep references (read the relevant ones for the task at hand)
19
-
20
- ## 🚨 READ @omega.js/client TOO
21
-
22
- **@omega.js/desktop ships `@omega.js/client` as a runtime singleton inside the renderer process.**
23
- - It powers auth, Firebase, reactive `data-omega-bind` directives, analytics, error tracking, and utilities (`escapeHTML`, etc.).
24
- - Any task that touches auth flows, Firestore reads/writes, subscription resolution, push notifications, or DOM bindings means you are working with @omega.js/client as much as with @omega.js/desktop.
25
-
26
- **Required reading:**
27
- - **`node_modules/@omega.js/AGENTS.md`** → `docs/client/index.md`, the @omega.js/client guide: identity, module list, conventions
28
- - **`node_modules/@omega.js/client/docs/`**: module deep references (Auth, Bindings, Firestore, Notifications, etc.)
29
-
30
- ## Quick start
31
-
32
- ```bash
33
- npm start # dev with auto-reload (gulp → esbuild → electron .)
34
- npm run build # local production build (compiles bundles only, no installer)
35
- npm run package # full local production package (DMG/zip/universal-mac, NSIS-win, deb+AppImage-linux)
36
- npm run package:quick # fast packaged build for the host platform/arch only (~20-30s)
37
- npm run release # signed + published release (requires certs)
38
- npx omega test # run YOUR project's test suites (bare runs never include the framework corpus)
39
- npx omega test build/config # run project tests by path (relative to test/; full:<path> for both sources)
40
- npx omega test project: # run ONLY your project tests (all of them)
41
- npx omega test project:custom-test # run only consumer project tests matching a path
42
- npx omega test mgr: # run ONLY framework tests (universal alias; desktop:/framework: are equivalent)
43
- npx omega test desktop:build/config # run only framework tests matching a path
44
- npx omega test --extended # also run tests that hit REAL external services (off by default; TEST_EXTENDED_MODE=true is the env equivalent, a shared name across @omega.js/backend, @omega.js/extension, UJM, and @omega.js/desktop)
45
- # (output is teed to logs/: dev.log on `npm start`, build.log on `npm run build`, test.log on `npx omega test`; cat instead of scrolling scrollback)
46
- npx omega install dev # use LOCAL @omega.js/desktop source (to test framework edits)
47
- npx omega install live # restore the published @omega.js/desktop from npm
48
- ```
49
-
50
- > Editing the @omega.js/desktop framework source while working here? Run `npx omega install dev` so this project picks up your uncommitted framework changes (it otherwise uses its installed `node_modules/@omega.js/desktop`). Run `npx omega install live` to switch back.
51
-
52
- ## Where things live
53
-
54
- - `config/omega.json5`: the single OMEGA config (JSON5), with shared sections (brand, analytics, payment, cloud, monitoring, theme) at the top level; desktop settings (app, platforms, autoUpdate, startup, releases, remoteConfig, restartManager) under `targets.desktop`.
55
- - What the app SHIPS is one declaration: `platforms.<mac|windows|linux>.formats.<dmg|nsis|deb|appimage|snap>`. Presence = enabled, every platform and format is on by default, and `false` drops one (`snap: false`). Per-format settings live inside the format.
56
- - Packaging config: fully generated. @omega.js/desktop produces `dist/electron-builder.yml` from `config/omega.json5` (brand/app/signing) + @omega.js/desktop's opinionated defaults. Consumers never ship an `electron-builder.yml`. Override defaults via the `electronBuilder:` block in `omega.json5` if you genuinely need to.
57
- - `hooks/notarize/post.js`: optional post-notarize extension hook (@omega.js/desktop owns the actual `afterSign` notarize step).
58
- - `src/main.js`: main-process entry. One-line bootstrap of `@omega.js/desktop/main`.
59
- - `src/preload.js`: preload entry. Exposes `window.desktop` via contextBridge.
60
- - `src/integrations/tray/index.js`: tray definition. Edit this; it's yours.
61
- - `src/integrations/menu/index.js`: application menu definition.
62
- - `src/integrations/context-menu/index.js`: right-click menu definition (called per-event with `params`).
63
- - `src/views/<window>/index.html`: per-window HTML.
64
- - `src/assets/js/components/<window>/index.js`: renderer entry per window.
65
- - `src/assets/scss/main.scss`: shared SCSS.
66
- - `config/icons/<platform>/<slot>.png`: optional icon overrides (`mac/icon.png`, `mac/tray.png`, `mac/dmg.png`, `windows/icon.png`, etc.; the platform words are `mac`, `windows`, `linux`).
67
- - Ship ONE file per slot at the native (retina) size; @omega.js/desktop auto-downscales @1x variants.
68
- - macOS tray must be 32×32 (@omega.js/desktop renames to `trayTemplate.png` in dist for the OS dark-mode magic).
69
- - Missing slots fall back to @omega.js/desktop bundled defaults; Linux falls back to Windows resolution.
70
- - `test/**/*.js`: your project test suites (framework auto-runs them alongside its own).
71
-
72
- ## Per-context imports
73
-
74
- ```js
75
- // src/main.js
76
- new (require('@omega.js/desktop/main'))().initialize(); // auto-loads JSON5 config
77
-
78
- // src/preload.js
79
- new (require('@omega.js/desktop/preload'))().initialize();
80
-
81
- // src/assets/js/components/main/index.js
82
- new (require('@omega.js/desktop/renderer'))().initialize();
83
- ```
84
-
85
- ## Available APIs at runtime
86
-
87
- In main: `manager.storage`, `manager.ipc`, `manager.windows`, `manager.tray`, `manager.menu`, `manager.contextMenu`, `manager.startup`, `manager.appState`, `manager.deepLink`, `manager.autoUpdater`, `manager.sentry`, `manager.omega`, `manager.context`, `manager.usage`, `manager.remoteConfig`, `manager.analytics`, `manager.restartManager`.
88
-
89
- In renderer: `window.desktop.storage`, `window.desktop.ipc`, `window.desktop.logger`, `window.OMEGA_BUILD_JSON.config` (the one `build.js` the view's shell loads).
90
-
91
- ## Dependency resolution
92
-
93
- - **Do NOT install framework dependencies directly** (`firebase`, `fs-jetpack`, `@omega.js/client`, etc.). @omega.js/desktop's bundler resolves them through the framework's own `node_modules/`. If something doesn't resolve, the issue is in @omega.js/desktop's bundle task, not your `package.json`.
94
- - **@omega.js/client owns Firebase.** Never `require('firebase')` or `import('firebase/app')`. Use `require('@omega.js/client')` → `omega.auth()`, `omega.firestore()` in renderers. In main process, use `manager.omega` (the @omega.js/desktop bridge).
95
- - **`Manager.require(name)`** resolves from @omega.js/desktop's module context at runtime for unbundled code (gulp tasks, test fixtures).
96
-
97
- ## Testing
98
-
99
- Every feature ships with tests at every layer it has a surface in: **logic** (`test/build/`, `test/main/`), **UI** (`test/renderer/`: real events on the real DOM), and **end-to-end** (`test/boot/`).
100
- - Skip a layer only when the feature genuinely has no surface there; "the logic test covers it" does not excuse the UI test.
101
- - Test runs are invisible and never steal keyboard focus (@omega.js/desktop test stealth; set `OMEGA_TEST_SHOW=1` to watch a run live).
102
- - See `test/README.md` and `node_modules/@omega.js/desktop/docs/test-framework.md`.
103
-
104
- <!-- Everything above this marker is owned by the framework and rewritten by every omega verb. Add your project-specific notes below — they are preserved. -->
105
-
106
- # ========== Custom Values ==========
107
-
108
- ## Project-specific notes
109
-
110
- Add anything specific to THIS project here. Edits below this line are preserved across framework re-syncs.
@@ -1 +0,0 @@
1
- @AGENTS.md
@@ -1,374 +0,0 @@
1
- // Client bridge — main-process Firebase Auth, source of truth for renderers.
2
- //
3
- // This is @omega.js/desktop's analogue of BXM's background-service-worker auth role. The pattern:
4
- //
5
- // 1. Main runs its own Firebase Auth instance and is the source of truth.
6
- // 2. When a deep-link auth/token arrives, main calls signInWithCustomToken with that token,
7
- // then BROADCASTS the token to all renderer windows so their @omega.js/client Firebase
8
- // instances can sign in with the SAME token.
9
- // 3. On every renderer load, the renderer asks main "I'm at UID X (or null)" via the
10
- // desktop:auth:sync-request IPC. Main compares with its own UID and either does nothing,
11
- // tells the renderer to sign out, or fetches a fresh custom token from /omega
12
- // and sends it to the renderer.
13
- // 4. Sign-out: any renderer can request sign-out via desktop:auth:sign-out. Main signs out
14
- // its own Firebase + broadcasts desktop:auth:sign-out to all renderers.
15
- //
16
- // Firebase is BUNDLED by esbuild from @omega.js/desktop's module context (@omega.js/client owns it in @omega.js/desktop's
17
- // tree). If loading fails, the bridge stays in no-op mode and logs the reason.
18
-
19
- const LoggerLite = require('./logger-lite.js');
20
- const authPersistence = require('./auth-persistence.js');
21
- const { requiredPort } = require('../utils/url-helpers.js');
22
-
23
- const logger = new LoggerLite('client-bridge');
24
-
25
- const FIREBASE_APP_NAME = 'omega-auth';
26
-
27
- const bridge = {
28
- _initialized: false,
29
- _manager: null,
30
- _firebase: null, // firebase/app
31
- _firebaseAuth: null, // auth instance
32
- _firebaseModule: null, // firebase/auth namespace (signInWithCustomToken, signOut, ...)
33
- _stateSubs: new Set(), // main-side subscribers fn(user)
34
- _ipcRegistered: false,
35
- _resolvedPlan: null, // renderer-resolved subscription { plan, active, trialing, cancelling }
36
- _resolvedRoles: null, // renderer-resolved account roles { admin, betaTester, ... }
37
-
38
- async initialize(manager) {
39
- if (bridge._initialized) {
40
- return;
41
- }
42
-
43
- bridge._manager = manager;
44
-
45
- // Try to load firebase. If it's not installed, run in no-op mode.
46
- const ok = await bridge._tryLoadFirebase();
47
- if (!ok) {
48
- logger.warn('firebase not installed — client-bridge running in no-op mode. `npm i firebase` to enable auth.');
49
- }
50
-
51
- bridge._registerIpc();
52
-
53
- if (ok) {
54
- // Boot Firebase Auth. With a persistence strategy active (lib/auth-persistence.js,
55
- // default safeStorage), the session survives restarts — the restore lands async
56
- // via onAuthStateChanged shortly after boot.
57
- try {
58
- const strategy = await authPersistence.resolve(manager);
59
- bridge._firebaseAuth = bridge._getFirebaseAuth(strategy);
60
- // onAuthStateChanged is the source of truth listener.
61
- bridge._firebaseModule.onAuthStateChanged(bridge._firebaseAuth, (user) => {
62
- bridge._handleAuthStateChange(user);
63
- });
64
- logger.log(`initialize — firebase loaded (persistence: ${strategy ? strategy.name : 'in-memory'})`);
65
- } catch (e) {
66
- logger.error('firebase init failed:', e.message);
67
- }
68
- }
69
-
70
- bridge._initialized = true;
71
- },
72
-
73
- // Load firebase. Returns true on success. BUNDLED by esbuild from @omega.js/desktop's module context
74
- // (@omega.js/client owns firebase in @omega.js/desktop's tree) — same treatment as json5 in main.js. In the
75
- // webpack era it was a webpackIgnore'd runtime import(), which resolves relative to the CONSUMER's
76
- // main.bundle.js: that walk never reaches @omega.js/desktop's node_modules when @omega.js/desktop is symlinked
77
- // (`mgr install dev`) and depends on npm hoisting when installed — every dev app silently
78
- // ran the bridge in no-op mode. Interop guards handle both namespace shapes (json5 precedent).
79
- async _tryLoadFirebase() {
80
- try {
81
- const appMod = require('firebase/app');
82
- const authMod = require('firebase/auth');
83
-
84
- bridge._firebase = appMod.initializeApp ? appMod : (appMod.default || appMod);
85
- bridge._firebaseModule = authMod.getAuth ? authMod : (authMod.default || authMod);
86
- return true;
87
- } catch (e) {
88
- logger.warn('firebase load failed:', e.message);
89
- return false;
90
- }
91
- },
92
-
93
- _getFirebaseAuth(strategy) {
94
- if (bridge._firebaseAuth) return bridge._firebaseAuth;
95
-
96
- const firebaseConfig = bridge._manager.config.cloud?.config;
97
- if (!firebaseConfig || !Object.keys(firebaseConfig).length) {
98
- throw new Error('cloud.config is empty — cannot initialize auth.');
99
- }
100
-
101
- const { initializeApp, getApp } = bridge._firebase;
102
- const { getAuth, initializeAuth } = bridge._firebaseModule;
103
-
104
- let app;
105
- try { app = getApp(FIREBASE_APP_NAME); }
106
- catch (e) { app = initializeApp(firebaseConfig, FIREBASE_APP_NAME); }
107
-
108
- // With a storage strategy, boot auth on OUR persistence (session survives
109
- // restarts); without one, firebase's Node default (in-memory) applies.
110
- if (strategy && initializeAuth) {
111
- bridge._firebaseAuth = initializeAuth(app, {
112
- persistence: [authPersistence.buildFirebasePersistence(strategy)],
113
- });
114
- } else {
115
- bridge._firebaseAuth = getAuth(app);
116
- }
117
-
118
- // A TESTING run talks to the LOCAL stack, never real auth — the same move
119
- // getApiUrl() makes when it maps testing to localhost, and the same one
120
- // @omega.js/extension's background SW makes for its emulator runs. Only an
121
- // OMEGA_ENVIRONMENT=testing run reaches here; dev and production are untouched.
122
- if (bridge._manager.isTesting()) {
123
- const { connectAuthEmulator } = bridge._firebaseModule;
124
- const port = bridge._authEmulatorPort();
125
- logger.log(`testing run — connecting auth to the emulator on :${port}`);
126
- connectAuthEmulator(bridge._firebaseAuth, `http://localhost:${port}`, { disableWarnings: true });
127
- }
128
-
129
- return bridge._firebaseAuth;
130
- },
131
-
132
- // The auth emulator's port, on the same chain getApiUrl() walks: the
133
- // resolved-port env channel (N7), then the `dev.ports` map the bundle baked
134
- // into OMEGA_BUILD_JSON
135
- // ([#745](https://github.com/Omega-JS-Stack/omega/issues/745)). The classic
136
- // 9099 used to sit under those two as a last resort; it is gone (#834),
137
- // because nothing identity-checks what answers on it and a neighbouring
138
- // project's emulator reads as an auth mystery rather than a port problem.
139
- _authEmulatorPort() {
140
- return requiredPort(bridge._manager, 'OMEGA_AUTH_PORT', 'auth');
141
- },
142
-
143
- _registerIpc() {
144
- if (bridge._ipcRegistered) return;
145
- const ipc = bridge._manager.ipc;
146
-
147
- // Renderer asks main: "I'm at UID X (or null). Are we in sync?"
148
- ipc.handle('desktop:auth:sync-request', async ({ contextUid }) => {
149
- return bridge._handleSyncRequest(contextUid);
150
- });
151
-
152
- // Renderer asks main to sign out.
153
- ipc.handle('desktop:auth:sign-out', async () => {
154
- return bridge._handleSignOut();
155
- });
156
-
157
- // Renderer asks main for the current user (uid + email + displayName, no token).
158
- ipc.handle('desktop:auth:get-user', () => {
159
- const u = bridge._firebaseAuth?.currentUser;
160
- return u ? bridge._snapshotUser(u) : null;
161
- });
162
-
163
- // Renderer pushes its @omega.js/client account resolution (auth().listen() settled:
164
- // Firestore account fetched, subscription resolved). Main can't run Firestore,
165
- // so this is how main-side plan gates learn the REAL plan — BXM's "browser
166
- // contexts resolve, authority caches" split. UID-guarded: a stale push from a
167
- // renderer that hasn't synced yet is dropped.
168
- ipc.handle('desktop:auth:account-resolved', ({ uid, resolved, roles } = {}) => {
169
- const mainUid = bridge._firebaseAuth?.currentUser?.uid || null;
170
- if (!uid || uid !== mainUid) {
171
- return { accepted: false };
172
- }
173
-
174
- const changed = JSON.stringify(resolved) !== JSON.stringify(bridge._resolvedPlan)
175
- || JSON.stringify(roles || null) !== JSON.stringify(bridge._resolvedRoles);
176
- bridge._resolvedPlan = resolved || null;
177
- bridge._resolvedRoles = roles || null;
178
-
179
- if (changed) {
180
- logger.log(`account resolved — plan=${resolved?.plan || '(none)'} active=${!!resolved?.active}`);
181
- bridge._manager.ipc.broadcast('desktop:auth:plan-changed', { resolved: bridge._resolvedPlan, roles: bridge._resolvedRoles });
182
- // Main-side subscribers see the same user snapshot again with plan now known.
183
- const u = bridge._firebaseAuth?.currentUser;
184
- bridge._stateSubs.forEach((fn) => {
185
- try { fn(u ? bridge._snapshotUser(u) : null); } catch (e) { logger.error('onAuthChange subscriber threw:', e); }
186
- });
187
- }
188
- return { accepted: true };
189
- });
190
-
191
- bridge._ipcRegistered = true;
192
- },
193
-
194
- _handleAuthStateChange(user) {
195
- logger.log(`auth state → ${user ? user.email : 'signed out'}`);
196
-
197
- // Sign-out (or a different user signing in) invalidates the cached resolution —
198
- // renderers re-resolve and push fresh via desktop:auth:account-resolved.
199
- if (!user) {
200
- bridge._resolvedPlan = null;
201
- bridge._resolvedRoles = null;
202
- }
203
-
204
- // Notify any main-side subscribers (consumer code that called manager.omega.onAuthChange).
205
- const snap = user ? bridge._snapshotUser(user) : null;
206
- bridge._stateSubs.forEach((fn) => {
207
- try { fn(snap); } catch (e) { logger.error('onAuthChange subscriber threw:', e); }
208
- });
209
-
210
- // Tell renderers about the change so they can update UI / refresh menu items.
211
- bridge._manager.ipc.broadcast('desktop:auth:state-changed', snap);
212
-
213
- // Attribute Sentry events to the signed-in user (or clear on sign-out). When
214
- // sentry is disabled (no DSN, dev mode, etc.) setUser is a documented no-op.
215
- bridge._manager.sentry.setUser(snap);
216
- },
217
-
218
- // BXM's syncAuth pattern, ported to Electron.
219
- async _handleSyncRequest(contextUid) {
220
- if (!bridge._firebaseAuth) {
221
- return { needsSync: false, reason: 'firebase-not-loaded' };
222
- }
223
-
224
- const bgUser = bridge._firebaseAuth.currentUser;
225
- const bgUid = bgUser?.uid || null;
226
-
227
- // Already in sync.
228
- if (contextUid === bgUid) {
229
- return { needsSync: false };
230
- }
231
-
232
- // Renderer signed in but main signed out → tell renderer to sign out.
233
- if (!bgUser && contextUid) {
234
- return { needsSync: true, signOut: true };
235
- }
236
-
237
- // Main signed in, renderer not (or different user) → fetch a fresh custom token + send.
238
- try {
239
- const token = await bridge._fetchCustomToken(bgUser);
240
- return {
241
- needsSync: true,
242
- customToken: token,
243
- user: bridge._snapshotUser(bgUser),
244
- };
245
- } catch (e) {
246
- logger.error('sync-request: failed to fetch custom token:', e.message);
247
- return { needsSync: false, error: e.message };
248
- }
249
- },
250
-
251
- async _handleSignOut() {
252
- try {
253
- if (bridge._firebaseAuth?.currentUser) {
254
- await bridge._firebaseModule.signOut(bridge._firebaseAuth);
255
- }
256
- bridge._manager.ipc.broadcast('desktop:auth:sign-out', {});
257
- return { success: true };
258
- } catch (e) {
259
- logger.error('sign-out failed:', e.message);
260
- return { success: false, error: e.message };
261
- }
262
- },
263
-
264
- // Public API ──────────────────────────────────────────────────────────────────
265
-
266
- // Called by lib/deep-link's auth/token built-in.
267
- async handleAuthToken(token) {
268
- if (!bridge._firebaseAuth) {
269
- logger.warn('handleAuthToken called but firebase not loaded — ignoring.');
270
- return { success: false, reason: 'firebase-not-loaded' };
271
- }
272
- if (!token) {
273
- logger.warn('handleAuthToken called with no token — ignoring.');
274
- return { success: false, reason: 'no-token' };
275
- }
276
-
277
- try {
278
- const cred = await bridge._firebaseModule.signInWithCustomToken(bridge._firebaseAuth, token);
279
- logger.log(`signed in: ${cred.user.email || cred.user.uid}`);
280
-
281
- // Broadcast the token to renderers so they can sign in with the SAME token.
282
- // Tokens expire in 1 hour and aren't stored.
283
- bridge._manager.ipc.broadcast('desktop:auth:sign-in-with-token', { token });
284
-
285
- return { success: true, user: bridge._snapshotUser(cred.user) };
286
- } catch (e) {
287
- logger.error('signInWithCustomToken failed:', e.message);
288
- return { success: false, error: e.message };
289
- }
290
- },
291
-
292
- // Subscribe to auth state changes on the main side (e.g. for menu/tray refresh).
293
- onAuthChange(fn) {
294
- bridge._stateSubs.add(fn);
295
- return () => bridge._stateSubs.delete(fn);
296
- },
297
-
298
- // Snapshot of the current user (sync), or null.
299
- getCurrentUser() {
300
- const u = bridge._firebaseAuth?.currentUser;
301
- return u ? bridge._snapshotUser(u) : null;
302
- },
303
-
304
- // The renderer-resolved subscription ({ plan, active, trialing, cancelling }) or null
305
- // while no renderer has resolved yet. THE main-side plan source — consumer plan gates
306
- // read this (@omega.js/client's resolveSubscription output, pushed via desktop:auth:account-resolved).
307
- getResolvedPlan() {
308
- return bridge._resolvedPlan;
309
- },
310
-
311
- // The renderer-resolved account roles ({ admin, betaTester, ... }) or null.
312
- getResolvedRoles() {
313
- return bridge._resolvedRoles;
314
- },
315
-
316
- // Fresh Firebase ID token for the signed-in user (async), or null when
317
- // signed out / Firebase absent. For consumer main code calling
318
- // authenticated backend routes (`Authorization: Bearer <token>`).
319
- async getIdToken() {
320
- const u = bridge._firebaseAuth?.currentUser;
321
- return u ? u.getIdToken() : null;
322
- },
323
-
324
- // Force sign-out from main code.
325
- async signOut() {
326
- return bridge._handleSignOut();
327
- },
328
-
329
- // ─── Internals ────────────────────────────────────────────────────────────
330
-
331
- _snapshotUser(user) {
332
- return {
333
- uid: user.uid,
334
- email: user.email,
335
- displayName: user.displayName,
336
- photoURL: user.photoURL,
337
- emailVerified: user.emailVerified,
338
- };
339
- },
340
-
341
- // Fetch a fresh custom token for the currently-signed-in user via the shared
342
- // @omega.js/client request layer. Mirrors BXM: POST <apiUrl>/omega/user/token —
343
- // the route defaults uid to the authenticated caller and responds { token }
344
- // at the top level.
345
- async _fetchCustomToken(user) {
346
- const { createRequest } = require('@omega.js/client/modules/request.js');
347
-
348
- const request = createRequest({
349
- getApiUrl: () => bridge._manager.getApiUrl(),
350
- getIdToken: (force) => user.getIdToken(force),
351
- });
352
-
353
- const data = await request('/omega/user/token', { method: 'POST', body: {} });
354
-
355
- const token = data?.token;
356
- if (!token) {
357
- throw new Error('@omega.js/backend response missing token.');
358
- }
359
- return token;
360
- },
361
-
362
- // Tear-down used by tests — wipes state but keeps registered IPC handlers
363
- // (they're idempotent via `ipc.handle` duplicate-detection).
364
- async _resetForTests() {
365
- try {
366
- if (bridge._firebaseAuth?.currentUser && bridge._firebaseModule?.signOut) {
367
- await bridge._firebaseModule.signOut(bridge._firebaseAuth);
368
- }
369
- } catch (e) { /* ignore */ }
370
- bridge._stateSubs.clear();
371
- },
372
- };
373
-
374
- module.exports = bridge;
@@ -1,4 +0,0 @@
1
- // Shared devkit module — vendored into dist/vendor/devkit at prepare time by the
2
- // preparePackage `after` hook. This shim keeps the framework's internal require
3
- // paths stable while the implementation lives in @omega.js/devkit.
4
- module.exports = require('../vendor/devkit/logger.js');