@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
@@ -49,16 +49,16 @@ const STORAGE_KEY = 'autoUpdater';
49
49
  // install fires whenever the user eventually walks away. We never re-prompt
50
50
  // for the same version (tracked via `_promptedForVersion`).
51
51
  //
52
- // Consumer hook: `manager.autoUpdater.markActive()` lets app code force-bump the
52
+ // Consumer hook: `omega.autoUpdater.markActive()` lets app code force-bump the
53
53
  // activity timestamp from anywhere (e.g. just received an auth event, finished a
54
54
  // long-running renderer task, etc.). Use sparingly — the built-in signals cover
55
55
  // 99% of real activity.
56
56
  //
57
- // Test mode: when `manager.isTesting()` is true, the threshold collapses to 3s so
57
+ // Test mode: when `omega.isTesting()` is true, the threshold collapses to 3s so
58
58
  // integration tests can drive a real download → idle wait → install in ~5s instead
59
59
  // of 15min. Both timers (feed-check + idle-eval) likewise drop to 500ms in tests so
60
60
  // the full sequence fires inside a test run. Wired in `_idleThresholdMs()` and the
61
- // initialize() timer setup based on the manager's `isTesting()` helper.
61
+ // initialize() timer setup based on the omega instance's `isTesting()` helper.
62
62
  const IDLE_INSTALL_THRESHOLD_MS = 15 * 60 * 1000; // 15 min — production
63
63
  const IDLE_INSTALL_THRESHOLD_MS_TESTING = 3 * 1000; // 3 sec — when isTesting()
64
64
  const IDLE_TICK_MS_TESTING = 500; // 500ms periodic tick when testing
@@ -109,7 +109,7 @@ function freshState() {
109
109
 
110
110
  const autoUpdater = {
111
111
  _initialized: false,
112
- _manager: null,
112
+ _omega: null,
113
113
  _library: null,
114
114
  _options: null,
115
115
  _state: freshState(),
@@ -125,12 +125,12 @@ const autoUpdater = {
125
125
  _promptedForVersion: null, // version string we've already prompted about — never prompt twice for the same version
126
126
  _activityHooksWired: false, // guard: only wire main-side activity listeners once per process
127
127
 
128
- async initialize(manager) {
129
- autoUpdater._manager = manager;
128
+ async initialize(omega) {
129
+ autoUpdater._omega = omega;
130
130
  autoUpdater._initialized = true;
131
131
  autoUpdater._state = freshState();
132
132
 
133
- const cfg = (manager && manager.config && manager.config.autoUpdate) || {};
133
+ const cfg = (omega && omega.config && omega.config.autoUpdate) || {};
134
134
  autoUpdater._options = { ...DEFAULTS, ...cfg };
135
135
 
136
136
  if (autoUpdater._options.enabled === false) {
@@ -150,21 +150,21 @@ const autoUpdater = {
150
150
  }
151
151
 
152
152
  // 3. IPC: renderer status query + actions. Unhandle first so re-init is idempotent.
153
- if (manager && manager.ipc) {
153
+ if (omega && omega.ipc) {
154
154
  const channels = [
155
155
  ['desktop:auto-updater:status', async () => autoUpdater.getStatus()],
156
156
  ['desktop:auto-updater:check-now', async () => autoUpdater.checkNow({ userInitiated: true })],
157
157
  ['desktop:auto-updater:install-now', async () => autoUpdater.installNow()],
158
158
  ];
159
159
  for (const [chan, fn] of channels) {
160
- manager.ipc.unhandle(chan);
161
- manager.ipc.handle(chan, fn);
160
+ omega.ipc.unhandle(chan);
161
+ omega.ipc.handle(chan, fn);
162
162
  }
163
163
  // Activity ping from preload (debounced renderer-side mouse/keyboard/focus).
164
164
  // Listener (not handle) — fire-and-forget, no response needed. Set-backed
165
165
  // listener registry deduplicates same-fn re-adds, so re-init is safe.
166
- if (typeof manager.ipc.on === 'function') {
167
- manager.ipc.on('desktop:auto-updater:activity', autoUpdater._onActivityIpc);
166
+ if (typeof omega.ipc.on === 'function') {
167
+ omega.ipc.on('desktop:auto-updater:activity', autoUpdater._onActivityIpc);
168
168
  }
169
169
  }
170
170
 
@@ -188,10 +188,10 @@ const autoUpdater = {
188
188
  // a downloaded update based on user idle time. Default 1m cadence so a
189
189
  // downloaded update installs promptly when the user steps away.
190
190
  //
191
- // In tests (`manager.isTesting() === true`) both cadences collapse to
191
+ // In tests (`omega.isTesting() === true`) both cadences collapse to
192
192
  // IDLE_TICK_MS_TESTING (500ms) so an integration test sees the full sequence
193
193
  // fire within seconds of a download.
194
- const isTesting = manager.isTesting();
194
+ const isTesting = omega.isTesting();
195
195
  const feedInterval = isTesting ? IDLE_TICK_MS_TESTING : autoUpdater._options.feedCheckIntervalMs;
196
196
  const idleInterval = isTesting ? IDLE_TICK_MS_TESTING : autoUpdater._options.idleEvalIntervalMs;
197
197
 
@@ -281,7 +281,7 @@ const autoUpdater = {
281
281
  // Same doctrine as _isSimulating(): a packaged production build may simulate, but
282
282
  // only when it was LAUNCHED for QA with OMEGA_DEV_UPDATE set. Without that opt-in a
283
283
  // shipped binary must never be talked into faking an update it cannot deliver.
284
- if (autoUpdater._manager.isProduction() && !autoUpdater._isSimulating()) {
284
+ if (autoUpdater._omega.isProduction() && !autoUpdater._isSimulating()) {
285
285
  throw new Error('simulate(): refused in a production build. Relaunch with OMEGA_DEV_UPDATE set to simulate updates.');
286
286
  }
287
287
 
@@ -320,7 +320,7 @@ const autoUpdater = {
320
320
 
321
321
  // Bump the activity timestamp. Called automatically by the built-in activity hooks
322
322
  // (renderer mouse/keyboard, browser-window focus). Consumer code can also call this
323
- // directly from anywhere (`manager.autoUpdater.markActive()`) to force-bump on
323
+ // directly from anywhere (`omega.autoUpdater.markActive()`) to force-bump on
324
324
  // app-specific activity.
325
325
  markActive() {
326
326
  autoUpdater._lastActivityAt = Date.now();
@@ -341,13 +341,13 @@ const autoUpdater = {
341
341
  logger.log('Dev mode — skipping real quitAndInstall().');
342
342
  return true;
343
343
  }
344
- // Flip the manager's quit flag so the window-manager close handler lets the
344
+ // Flip the omega instance's quit flag so the window-manager close handler lets the
345
345
  // close events through instead of trapping them with hide-on-close. Without
346
346
  // this, quitAndInstall() fires before-quit but the BrowserWindow's close
347
347
  // handler (which runs FIRST since it has its own listener) would call
348
348
  // event.preventDefault() and the install would just hide the window.
349
- if (autoUpdater._manager) {
350
- autoUpdater._manager._allowQuit = true;
349
+ if (autoUpdater._omega) {
350
+ autoUpdater._omega._allowQuit = true;
351
351
  }
352
352
  if (autoUpdater._library && typeof autoUpdater._library.quitAndInstall === 'function') {
353
353
  autoUpdater._library.quitAndInstall();
@@ -372,10 +372,10 @@ const autoUpdater = {
372
372
  autoUpdater._promptedForVersion = null;
373
373
  autoUpdater._activityHooksWired = false;
374
374
 
375
- const m = autoUpdater._manager;
376
- if (m && m.ipc && typeof m.ipc.unhandle === 'function') {
375
+ const omega = autoUpdater._omega;
376
+ if (omega && omega.ipc && typeof omega.ipc.unhandle === 'function') {
377
377
  ['desktop:auto-updater:status', 'desktop:auto-updater:check-now', 'desktop:auto-updater:install-now'].forEach((c) => {
378
- m.ipc.unhandle(c);
378
+ omega.ipc.unhandle(c);
379
379
  });
380
380
  }
381
381
  },
@@ -385,7 +385,7 @@ const autoUpdater = {
385
385
  // Auto-updater dev SIMULATION mode — controls whether checkForUpdates() is wired
386
386
  // to electron-updater (real) or our synthetic event sequence (fake). Triggered by
387
387
  // setting OMEGA_DEV_UPDATE=available|unavailable|error. NOT the same as
388
- // `manager.isDevelopment()` (which is the runtime "are we packaged" signal); a
388
+ // `omega.isDevelopment()` (which is the runtime "are we packaged" signal); a
389
389
  // packaged production build can absolutely run with OMEGA_DEV_UPDATE set for QA.
390
390
  //
391
391
  // The runtime simulate() latches `_devSimulationSession` for the rest of the process
@@ -401,7 +401,7 @@ const autoUpdater = {
401
401
  },
402
402
 
403
403
  _idleThresholdMs() {
404
- return autoUpdater._manager.isTesting() ? IDLE_INSTALL_THRESHOLD_MS_TESTING : IDLE_INSTALL_THRESHOLD_MS;
404
+ return autoUpdater._omega.isTesting() ? IDLE_INSTALL_THRESHOLD_MS_TESTING : IDLE_INSTALL_THRESHOLD_MS;
405
405
  },
406
406
 
407
407
  _readyToCheck() {
@@ -461,7 +461,7 @@ const autoUpdater = {
461
461
  // user can't dismiss programmatically — exactly what we don't want firing
462
462
  // during automated runs. Tests that want to assert prompt behavior should
463
463
  // override `_promptToInstall` per-test (see auto-updater.test.js).
464
- if (autoUpdater._manager.isTesting()) {
464
+ if (autoUpdater._omega.isTesting()) {
465
465
  logger.log(`Test mode: _promptToInstall(${version}) — skipped native dialog.`);
466
466
  return;
467
467
  }
@@ -470,8 +470,8 @@ const autoUpdater = {
470
470
  if (!dialog) return; // renderer/preload context — no dialog API
471
471
 
472
472
  const focusedWindow = BrowserWindow.getFocusedWindow();
473
- const productName = autoUpdater._manager.config.app?.productName
474
- || autoUpdater._manager.config.brand.name;
473
+ const productName = autoUpdater._omega.config.app?.productName
474
+ || autoUpdater._omega.config.brand.name;
475
475
 
476
476
  // showMessageBox CAN reject (e.g. dialog destroyed, no display) — wrap just
477
477
  // the call. Synchronous setup above doesn't need a try.
@@ -521,9 +521,9 @@ const autoUpdater = {
521
521
  },
522
522
 
523
523
  _broadcastStatus() {
524
- const m = autoUpdater._manager;
525
- if (m && m.ipc && typeof m.ipc.broadcast === 'function') {
526
- m.ipc.broadcast('desktop:auto-updater:status', autoUpdater.getStatus());
524
+ const omega = autoUpdater._omega;
525
+ if (omega && omega.ipc && typeof omega.ipc.broadcast === 'function') {
526
+ omega.ipc.broadcast('desktop:auto-updater:status', autoUpdater.getStatus());
527
527
  }
528
528
  autoUpdater._updateMenuItem();
529
529
  autoUpdater._updateTrayItem();
@@ -551,36 +551,36 @@ const autoUpdater = {
551
551
  // Reflect updater state into the @omega.js/desktop Check-for-Updates item. The item lives under
552
552
  // `main/check-for-updates` on macOS (App menu) and `help/check-for-updates` on win/linux —
553
553
  // we just patch whichever one exists. Consumer can remove either via
554
- // manager.menu.remove('main/check-for-updates') in their integrations/menu/index.js.
554
+ // omega.menu.remove('main/check-for-updates') in their integrations/menu/index.js.
555
555
  _updateMenuItem() {
556
- const m = autoUpdater._manager;
556
+ const omega = autoUpdater._omega;
557
557
  const { label, enabled } = autoUpdater._menuItemFieldsForState();
558
558
 
559
559
  // Patch whichever id-path exists. .update() returns false (and warns) if missing,
560
560
  // so try both without doubling up on warnings — silence by checking has() first.
561
- if (m.menu.has('main/check-for-updates')) {
562
- m.menu.update('main/check-for-updates', { label, enabled });
563
- } else if (m.menu.has('help/check-for-updates')) {
564
- m.menu.update('help/check-for-updates', { label, enabled });
561
+ if (omega.menu.has('main/check-for-updates')) {
562
+ omega.menu.update('main/check-for-updates', { label, enabled });
563
+ } else if (omega.menu.has('help/check-for-updates')) {
564
+ omega.menu.update('help/check-for-updates', { label, enabled });
565
565
  }
566
566
  },
567
567
 
568
568
  // Reflect updater state into the tray's `check-for-updates` item, if present. Same
569
569
  // label/enabled semantics as the menu item — keeps both UIs in lockstep.
570
570
  _updateTrayItem() {
571
- const m = autoUpdater._manager;
571
+ const omega = autoUpdater._omega;
572
572
  const { label, enabled } = autoUpdater._menuItemFieldsForState();
573
573
 
574
- if (m.tray.has('check-for-updates')) {
575
- m.tray.update('check-for-updates', { label, enabled });
574
+ if (omega.tray.has('check-for-updates')) {
575
+ omega.tray.update('check-for-updates', { label, enabled });
576
576
  }
577
577
  },
578
578
 
579
579
  // 30-day gate ────────────────────────────────────────────────────────────────────
580
580
 
581
581
  _reconcilePendingUpdate() {
582
- const m = autoUpdater._manager;
583
- const pending = m.storage.get(`${STORAGE_KEY}.pendingUpdate`);
582
+ const omega = autoUpdater._omega;
583
+ const pending = omega.storage.get(`${STORAGE_KEY}.pendingUpdate`);
584
584
  if (!pending || !pending.downloadedAt) return;
585
585
 
586
586
  // A simulated record (written by a build from before the simulator stopped
@@ -590,14 +590,14 @@ const autoUpdater = {
590
590
  // force-installs the first REAL download the moment it lands.
591
591
  if (pending.version === SIMULATED_VERSION) {
592
592
  logger.log(`Discarding simulated pendingUpdate record (v${pending.version}) — the dev simulator never downloaded anything.`);
593
- m.storage.set(`${STORAGE_KEY}.pendingUpdate`, null);
593
+ omega.storage.set(`${STORAGE_KEY}.pendingUpdate`, null);
594
594
  return;
595
595
  }
596
596
 
597
- const currentVersion = autoUpdater._manager.getVersion();
597
+ const currentVersion = autoUpdater._omega.getVersion();
598
598
  if (pending.version === currentVersion) {
599
599
  logger.log(`Pending update v${pending.version} appears to be applied — clearing flag.`);
600
- m.storage.set(`${STORAGE_KEY}.pendingUpdate`, null);
600
+ omega.storage.set(`${STORAGE_KEY}.pendingUpdate`, null);
601
601
  return;
602
602
  }
603
603
 
@@ -622,10 +622,10 @@ const autoUpdater = {
622
622
  return;
623
623
  }
624
624
 
625
- const m = autoUpdater._manager;
626
- if (!m || !m.storage) return;
625
+ const omega = autoUpdater._omega;
626
+ if (!omega || !omega.storage) return;
627
627
 
628
- const existing = m.storage.get(`${STORAGE_KEY}.pendingUpdate`);
628
+ const existing = omega.storage.get(`${STORAGE_KEY}.pendingUpdate`);
629
629
  // FIRST download wins for the TIMER — but the stored version must track the
630
630
  // NEWEST download, or the clear-on-apply check (version === getVersion())
631
631
  // never matches after the install and the stale flag force-installs every
@@ -633,13 +633,13 @@ const autoUpdater = {
633
633
  if (existing && existing.downloadedAt) {
634
634
  logger.log(`pendingUpdate already recorded (v${existing.version} @ ${new Date(existing.downloadedAt).toISOString()}) — keeping existing timestamp.`);
635
635
  if (existing.version !== version) {
636
- m.storage.set(`${STORAGE_KEY}.pendingUpdate`, { version, downloadedAt: existing.downloadedAt });
636
+ omega.storage.set(`${STORAGE_KEY}.pendingUpdate`, { version, downloadedAt: existing.downloadedAt });
637
637
  }
638
638
  autoUpdater._state.downloadedAt = existing.downloadedAt;
639
639
  return;
640
640
  }
641
641
  const now = Date.now();
642
- m.storage.set(`${STORAGE_KEY}.pendingUpdate`, { version, downloadedAt: now });
642
+ omega.storage.set(`${STORAGE_KEY}.pendingUpdate`, { version, downloadedAt: now });
643
643
  autoUpdater._state.downloadedAt = now;
644
644
  logger.log(`Recorded pendingUpdate v${version} @ ${new Date(now).toISOString()}`);
645
645
  },
@@ -4,7 +4,7 @@
4
4
  // context-menu event with a builder API plus the event's `params`:
5
5
  //
6
6
  // // src/integrations/context-menu/index.js
7
- // module.exports = ({ manager, menu, params, webContents }) => {
7
+ // module.exports = ({ omega, menu, params, webContents }) => {
8
8
  // // Start from @omega.js/desktop's default template (undo/redo, cut/copy/paste, link items,
9
9
  // // reload, dev-only inspect):
10
10
  // menu.useDefaults();
@@ -44,10 +44,10 @@
44
44
  // Building no items (calling no menu.* methods) suppresses the popup entirely.
45
45
  //
46
46
  // @omega.js/desktop auto-attaches the handler to every BrowserWindow's webContents that
47
- // goes through `manager.windows.createNamed()`. To attach manually:
48
- // manager.contextMenu.attach(webContents)
47
+ // goes through `omega.windows.createNamed()`. To attach manually:
48
+ // omega.contextMenu.attach(webContents)
49
49
  //
50
- // Disabling at runtime: call `manager.contextMenu.disable()`. Idempotent. After
50
+ // Disabling at runtime: call `omega.contextMenu.disable()`. Idempotent. After
51
51
  // disable() the lib stops responding to context-menu events on already-attached
52
52
  // webContents — no new menus are shown. No config flag.
53
53
 
@@ -61,20 +61,20 @@ const logger = new LoggerLite('context-menu');
61
61
 
62
62
  const contextMenu = {
63
63
  _initialized: false,
64
- _manager: null,
64
+ _omega: null,
65
65
  _electron: null,
66
66
  _definitionFn: null,
67
67
  _attached: new WeakSet(), // webContents that already have the listener
68
68
 
69
- initialize(manager) {
69
+ initialize(omega) {
70
70
  if (contextMenu._initialized) {
71
71
  return;
72
72
  }
73
73
 
74
- contextMenu._manager = manager;
74
+ contextMenu._omega = omega;
75
75
 
76
76
  if (contextMenu._disabled) {
77
- logger.log('initialize — disabled via manager.contextMenu.disable() called pre-init');
77
+ logger.log('initialize — disabled via omega.contextMenu.disable() called pre-init');
78
78
  contextMenu._initialized = true;
79
79
  return;
80
80
  }
@@ -89,7 +89,7 @@ const contextMenu = {
89
89
 
90
90
  if (fs.existsSync(absPath)) {
91
91
  const loadConsumerFile = require('../utils/load-consumer-file.js');
92
- const loaded = loadConsumerFile(absPath, logger);
92
+ const loaded = loadConsumerFile(absPath);
93
93
  if (typeof loaded === 'function') {
94
94
  contextMenu._definitionFn = loaded;
95
95
  } else if (loaded != null) {
@@ -156,7 +156,7 @@ const contextMenu = {
156
156
 
157
157
  const fn = contextMenu._definitionFn || contextMenu._defaultFn;
158
158
  try {
159
- fn({ manager: contextMenu._manager, menu: builder, params, webContents });
159
+ fn({ omega: contextMenu._omega, menu: builder, params, webContents });
160
160
  } catch (e) {
161
161
  logger.error('context-menu definition fn threw:', e);
162
162
  return [];
@@ -170,7 +170,7 @@ const contextMenu = {
170
170
  // Item set + visibility gates mirror the legacy @omega.js/desktop context-menu behavior:
171
171
  // undo/redo gated on canUndo/canRedo, edit ops gated on params.isEditable, etc.
172
172
  _populateDefaults(items, params) {
173
- const m = contextMenu._manager;
173
+ const omega = contextMenu._omega;
174
174
  const flags = params.editFlags || {};
175
175
 
176
176
  // Undo / redo — only when applicable. Hidden when canUndo/canRedo is false (matches legacy).
@@ -219,7 +219,7 @@ const contextMenu = {
219
219
  if (items.length > 0) items.push({ type: 'separator' });
220
220
  items.push({ id: 'reload', role: 'reload' });
221
221
 
222
- if (m.isDevelopment()) {
222
+ if (omega.isDevelopment()) {
223
223
  items.push({ type: 'separator' });
224
224
  items.push({ id: 'inspect', role: 'inspectElement' });
225
225
  items.push({ id: 'toggle-devtools', role: 'toggleDevTools' });
@@ -286,7 +286,7 @@ const contextMenu = {
286
286
 
287
287
  // Disable the context menu entirely. Idempotent. Safe pre- or post-init.
288
288
  // After this, _popup() short-circuits — already-attached webContents stop
289
- // showing menus on right-click. No way to re-enable; call manager.contextMenu.define()
289
+ // showing menus on right-click. No way to re-enable; call omega.contextMenu.define()
290
290
  // and clear _disabled if you really need to.
291
291
  disable() {
292
292
  contextMenu._disabled = true;
@@ -1,14 +1,14 @@
1
1
  // Runtime context — what we know about the user's machine + their network +
2
2
  // the current session. Modeled after @omega.js/backend's `assistant.request.{geolocation,client}`
3
- // shape so @omega.js/desktop apps + sister projects (@omega.js/backend, UJM, @omega.js/client) all reference the
3
+ // shape so @omega.js/desktop apps + sister projects (@omega.js/backend, @omega.js/client) all reference the
4
4
  // same property paths when reading user info.
5
5
  //
6
- // Populated asynchronously during manager.initialize():
6
+ // Populated asynchronously during omega.initialize():
7
7
  //
8
- // manager.context.geolocation = { ip, country, region, city } // ipify-fetched
9
- // manager.context.client = { userAgent, locale, platform, arch, mobile }
10
- // manager.context.session = { id, startTime, deviceId } // desktop-specific
11
- // manager.context.app = { version, environment, isPackaged }
8
+ // omega.context.geolocation = { ip, country, region, city } // ipify-fetched
9
+ // omega.context.client = { userAgent, locale, platform, arch, mobile }
10
+ // omega.context.session = { id, startTime, deviceId } // desktop-specific
11
+ // omega.context.app = { version, environment, isPackaged }
12
12
  //
13
13
  // Geolocation is fetched from https://api.ipify.org (IP only) and persisted to
14
14
  // storage so a subsequent boot offline still reports the last-known IP. The
@@ -37,7 +37,7 @@ const IP_FETCH_TIMEOUT_MS = 5000;
37
37
 
38
38
  const context = {
39
39
  _initialized: false,
40
- _manager: null,
40
+ _omega: null,
41
41
 
42
42
  // Public shape — populated during initialize(). Exported as plain JSON so renderer
43
43
  // tests + IPC consumers can read it via structured-clone.
@@ -46,10 +46,10 @@ const context = {
46
46
  session: { id: null, startTime: null, deviceId: null },
47
47
  app: { version: null, environment: null, isPackaged: null },
48
48
 
49
- async initialize(manager) {
49
+ async initialize(omega) {
50
50
  if (context._initialized) return;
51
51
  context._initialized = true;
52
- context._manager = manager;
52
+ context._omega = omega;
53
53
 
54
54
  // ─── session ──────────────────────────────────────────────────────────────
55
55
  context.session.id = crypto.randomUUID();
@@ -67,14 +67,14 @@ const context = {
67
67
  context.app.isPackaged = app.isPackaged;
68
68
 
69
69
  // ─── app ──────────────────────────────────────────────────────────────────
70
- context.app.version = manager.getVersion();
71
- context.app.environment = manager.getEnvironment();
70
+ context.app.version = omega.getVersion();
71
+ context.app.environment = omega.getEnvironment();
72
72
 
73
73
  // ─── geolocation ──────────────────────────────────────────────────────────
74
74
  // Restore last-known from storage immediately so we always have SOMETHING to
75
75
  // work with (offline boot, ipify down, slow network, etc.). Then fire the
76
76
  // network fetch in the background — when it lands it overwrites + persists.
77
- const cached = manager.storage.get(STORAGE_KEY) || null;
77
+ const cached = omega.storage.get(STORAGE_KEY) || null;
78
78
  if (cached?.geolocation) {
79
79
  Object.assign(context.geolocation, cached.geolocation);
80
80
  }
@@ -82,8 +82,8 @@ const context = {
82
82
  context._fetchGeolocation().catch((e) => logger.warn(`geolocation fetch failed: ${e.message}`));
83
83
 
84
84
  // IPC: renderer can read the full context block.
85
- manager.ipc.unhandle('desktop:context:get');
86
- manager.ipc.handle('desktop:context:get', () => context.toJSON());
85
+ omega.ipc.unhandle('desktop:context:get');
86
+ omega.ipc.handle('desktop:context:get', () => context.toJSON());
87
87
 
88
88
  logger.log(`context initialized — session=${context.session.id} deviceId=${context.session.deviceId} platform=${context.client.platform}`);
89
89
  },
@@ -97,11 +97,11 @@ const context = {
97
97
  // id it had before its storage was wiped.
98
98
  // 3. A generated UUID (the shared derivation's floor), persisted for next boot.
99
99
  async _resolveDeviceId() {
100
- const m = context._manager;
100
+ const omega = context._omega;
101
101
 
102
102
  return core.deriveDeviceId({
103
- get: () => m.storage.get(`${STORAGE_KEY}.deviceId`),
104
- set: (id) => m.storage.set(`${STORAGE_KEY}.deviceId`, id),
103
+ get: () => omega.storage.get(`${STORAGE_KEY}.deviceId`),
104
+ set: (id) => omega.storage.set(`${STORAGE_KEY}.deviceId`, id),
105
105
  seed: () => context._readFirstMac(),
106
106
  });
107
107
  },
@@ -138,14 +138,14 @@ const context = {
138
138
 
139
139
  context.geolocation.ip = ip;
140
140
  // Persist for next launch so an offline boot still has a usable IP.
141
- context._manager.storage.set(`${STORAGE_KEY}.geolocation`, { ...context.geolocation });
141
+ context._omega.storage.set(`${STORAGE_KEY}.geolocation`, { ...context.geolocation });
142
142
  },
143
143
 
144
144
  // Test/teardown helper. Re-initialize is idempotent guarded; call this first
145
145
  // if a test wants to re-run with mutated state.
146
146
  shutdown() {
147
147
  context._initialized = false;
148
- context._manager = null;
148
+ context._omega = null;
149
149
  },
150
150
 
151
151
  // Plain-JSON snapshot — what gets sent over IPC to the renderer.
@@ -7,16 +7,16 @@
7
7
  // warm-start via `app.on('second-instance')` (read from the `additionalData` argument,
8
8
  // which carries the duplicate's real argv; the event's own `argv` is Chromium-processed).
9
9
  //
10
- // Public API on manager.deepLink:
10
+ // Public API on omega.deepLink:
11
11
  //
12
- // manager.deepLink.on(routeOrPattern, fn) // register a handler. Returns unsubscribe fn.
13
- // manager.deepLink.off(routeOrPattern, fn)
14
- // manager.deepLink.dispatch(url) // manually fire (for testing or custom triggers)
15
- // manager.deepLink.getColdStartUrl() // the deep-link URL the app was launched with, or null
12
+ // omega.deepLink.on(routeOrPattern, fn) // register a handler. Returns unsubscribe fn.
13
+ // omega.deepLink.off(routeOrPattern, fn)
14
+ // omega.deepLink.dispatch(url) // manually fire (for testing or custom triggers)
15
+ // omega.deepLink.getColdStartUrl() // the deep-link URL the app was launched with, or null
16
16
  //
17
17
  // Handler signature:
18
18
  //
19
- // manager.deepLink.on('user/profile/:id', (ctx) => {
19
+ // omega.deepLink.on('user/profile/:id', (ctx) => {
20
20
  // ctx.url // 'myapp://user/profile/42?ref=abc'
21
21
  // ctx.scheme // 'myapp'
22
22
  // ctx.route // 'user/profile/42'
@@ -38,8 +38,8 @@
38
38
  // the fall-through to wildcard handlers (concrete-pattern handlers always run).
39
39
  //
40
40
  // Built-in routes (registered by @omega.js/desktop, can be overridden by registering your own handler):
41
- // auth/token → manager.omega.handleAuthToken(query.token) [Pass 2.12 wires this up]
42
- // app/show → manager.windows.show(query.window || 'main')
41
+ // auth/token → omega.auth.handleToken(query.authToken)
42
+ // app/show → omega.windows.show(query.window || 'main')
43
43
  // app/quit → app.quit()
44
44
  //
45
45
  // Built-in handlers run AFTER consumer handlers, so a consumer can shadow any built-in
@@ -51,21 +51,21 @@ const logger = new LoggerLite('deep-link');
51
51
 
52
52
  const deepLink = {
53
53
  _initialized: false,
54
- _manager: null,
54
+ _omega: null,
55
55
  _electron: null,
56
56
  _handlers: [], // [{ pattern, fn, builtin: bool }]
57
57
  _coldStartUrl: null, // the URL the app was launched with (if any)
58
58
  _wired: false, // open-url + second-instance + queueing wired?
59
59
  _pendingUrls: [], // urls received before whenReady — drained on init
60
- _managerReady: false, // manager.initialize() finished — safe to dispatch
61
- _bootQueue: [], // dispatches held until _managerReady (client-bridge et al. are up)
60
+ _omegaReady: false, // omega.initialize() finished — safe to dispatch
61
+ _bootQueue: [], // dispatches held until _omegaReady (auth et al. are up)
62
62
 
63
- initialize(manager) {
63
+ initialize(omega) {
64
64
  if (deepLink._initialized) {
65
65
  return;
66
66
  }
67
67
 
68
- deepLink._manager = manager;
68
+ deepLink._omega = omega;
69
69
  deepLink._electron = require('electron');
70
70
 
71
71
  deepLink._wireElectronEvents();
@@ -76,9 +76,9 @@ const deepLink = {
76
76
  const coldUrl = deepLink._extractUrlFromArgv(process.argv);
77
77
  if (coldUrl) {
78
78
  deepLink._coldStartUrl = coldUrl;
79
- manager.appState.setLaunchedFromDeepLink(true);
80
- // _handle queues until markManagerReady() — a cold-start auth/token must
81
- // not dispatch before client-bridge has booted Firebase.
79
+ omega.appState.setLaunchedFromDeepLink(true);
80
+ // _handle queues until markOmegaReady() — a cold-start auth/token must
81
+ // not dispatch before auth has booted Firebase.
82
82
  deepLink._handle(coldUrl, 'cold-start', { argv: process.argv, cwd: process.cwd() });
83
83
  }
84
84
 
@@ -88,7 +88,7 @@ const deepLink = {
88
88
  deepLink._pendingUrls = [];
89
89
  if (!deepLink._coldStartUrl) {
90
90
  deepLink._coldStartUrl = urls[0];
91
- manager.appState.setLaunchedFromDeepLink(true);
91
+ omega.appState.setLaunchedFromDeepLink(true);
92
92
  }
93
93
  urls.forEach((u) => deepLink._handle(u, 'cold-start', { argv: process.argv, cwd: process.cwd() }));
94
94
  }
@@ -130,11 +130,11 @@ const deepLink = {
130
130
  // Surface the main window. With hidden-mode apps, the consumer typically created
131
131
  // `main` with `show: false` at boot, so it's in the registry but invisible — we
132
132
  // just need to show it now that the user explicitly asked.
133
- const main = deepLink._manager.windows.get('main');
133
+ const main = deepLink._omega.windows.get('main');
134
134
  if (main) {
135
135
  logger.log(`second-instance — surfacing main (visible=${main.isVisible()}, minimized=${main.isMinimized()})`);
136
136
  if (main.isMinimized()) main.restore();
137
- deepLink._manager.windows._ensureDockVisible();
137
+ deepLink._omega.windows._ensureDockVisible();
138
138
  main.show();
139
139
  main.focus();
140
140
  } else {
@@ -149,10 +149,10 @@ const deepLink = {
149
149
  },
150
150
 
151
151
  _registerBuiltins() {
152
- // auth/token — hand off to client-bridge. The receiving end of
153
- // manager.getAuthUrl()'s sign-in round-trip: the website's token page redirects
154
- // here with ?authToken=<custom-token>. MODERN shape only — legacy-app formats
155
- // (?payload=, ?token=) are UJM's concern, not @omega.js/desktop's.
152
+ // auth/token: hand off to lib/auth.js. The receiving end of
153
+ // omega.getAuthUrl()'s sign-in round-trip: the website's token page redirects
154
+ // here with ?authToken=<custom-token>. MODERN shape only — older formats
155
+ // (?payload=, ?token=) are not read.
156
156
  deepLink._handlers.push({
157
157
  pattern: 'auth/token',
158
158
  builtin: true,
@@ -162,7 +162,7 @@ const deepLink = {
162
162
  logger.warn('auth/token: no authToken in query string.');
163
163
  return;
164
164
  }
165
- deepLink._manager.omega.handleAuthToken(token);
165
+ deepLink._omega.auth.handleToken(token);
166
166
  },
167
167
  });
168
168
 
@@ -172,7 +172,7 @@ const deepLink = {
172
172
  builtin: true,
173
173
  fn: (ctx) => {
174
174
  const name = ctx.query?.window || 'main';
175
- deepLink._manager.windows.show(name);
175
+ deepLink._omega.windows.show(name);
176
176
  },
177
177
  });
178
178
 
@@ -189,7 +189,7 @@ const deepLink = {
189
189
  // Pull a `<scheme>://...` URL out of an argv array. Returns null if none of our schemes match.
190
190
  _extractUrlFromArgv(argv) {
191
191
  if (!Array.isArray(argv)) return null;
192
- const schemes = deepLink._manager.protocol.getSchemes();
192
+ const schemes = deepLink._omega.protocol.getSchemes();
193
193
  if (schemes.length === 0) return null;
194
194
 
195
195
  // Walk argv backward — the URL is typically the last meaningful arg.
@@ -246,13 +246,13 @@ const deepLink = {
246
246
  return params;
247
247
  },
248
248
 
249
- // Called by main.js once manager.initialize() completes — every LIB a handler
250
- // touches (client-bridge Firebase, the windows registry, tray) is up from here
249
+ // Called by main.js once omega.initialize() completes — every LIB a handler
250
+ // touches (auth's Firebase, the windows registry, tray) is up from here
251
251
  // on. (Consumer-created windows may still be pending — consumers create them
252
252
  // in initialize().then(); app/show on a not-yet-created window warns + drops,
253
253
  // same as always.) Any dispatch that arrived earlier drains now.
254
- markManagerReady() {
255
- deepLink._managerReady = true;
254
+ markOmegaReady() {
255
+ deepLink._omegaReady = true;
256
256
  const queued = deepLink._bootQueue.slice();
257
257
  deepLink._bootQueue = [];
258
258
  queued.forEach(({ url, source, env }) => deepLink._handle(url, source, env));
@@ -260,10 +260,10 @@ const deepLink = {
260
260
 
261
261
  // Run the dispatch pipeline for a single URL.
262
262
  _handle(url, source, env) {
263
- // Hold every dispatch until the manager is fully initialized — handlers
264
- // deref manager surfaces that don't exist yet during boot.
265
- if (!deepLink._managerReady) {
266
- logger.log(`queueing ${source} dispatch until manager ready — ${url}`);
263
+ // Hold every dispatch until omega is fully initialized: handlers
264
+ // deref omega surfaces that do not exist yet during boot.
265
+ if (!deepLink._omegaReady) {
266
+ logger.log(`queueing ${source} dispatch until omega ready — ${url}`);
267
267
  deepLink._bootQueue.push({ url, source, env });
268
268
  return;
269
269
  }