@omega.js/desktop 0.51.0 → 0.53.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 (289) hide show
  1. package/README.md +18 -13
  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.js +1 -1
  26. package/dist/commands/build.js +2 -2
  27. package/dist/commands/cdp/capture.js +2 -2
  28. package/dist/commands/cdp/quit.js +2 -2
  29. package/dist/commands/cdp/relaunch.js +2 -2
  30. package/dist/commands/cdp/theme.js +1 -1
  31. package/dist/commands/clean.js +2 -2
  32. package/dist/commands/deploy.js +4 -4
  33. package/dist/commands/finalize-release.js +4 -4
  34. package/dist/commands/install.js +3 -3
  35. package/dist/commands/launch.js +2 -2
  36. package/dist/commands/lib/deploy-precheck.js +3 -3
  37. package/dist/commands/lib/ensure-target.js +6 -6
  38. package/dist/commands/package.js +2 -2
  39. package/dist/commands/publish.js +2 -2
  40. package/dist/commands/release.js +3 -3
  41. package/dist/commands/runner.js +145 -48
  42. package/dist/commands/sign-windows.js +5 -5
  43. package/dist/commands/test.js +4 -4
  44. package/dist/commands/update.js +2 -2
  45. package/dist/commands/validate-certs.js +4 -4
  46. package/dist/commands/version.js +3 -3
  47. package/dist/defaults/.github/workflows/build.yml +2 -0
  48. package/dist/defaults/AGENTS.md +17 -8
  49. package/dist/defaults/config/omega.json5 +7 -7
  50. package/dist/defaults/hooks/build/post.js +1 -1
  51. package/dist/defaults/hooks/build/pre.js +1 -1
  52. package/dist/defaults/hooks/deploy/pre.js +1 -1
  53. package/dist/defaults/hooks/release/post.js +1 -1
  54. package/dist/defaults/hooks/release/pre.js +1 -1
  55. package/dist/defaults/src/assets/js/components/about/index.js +3 -5
  56. package/dist/defaults/src/assets/js/components/main/index.js +3 -5
  57. package/dist/defaults/src/assets/js/components/settings/index.js +3 -5
  58. package/dist/defaults/src/integrations/context-menu/index.js +2 -2
  59. package/dist/defaults/src/integrations/menu/index.js +3 -3
  60. package/dist/defaults/src/integrations/tray/index.js +3 -3
  61. package/dist/defaults/src/main.js +3 -5
  62. package/dist/defaults/src/preload.js +3 -5
  63. package/dist/defaults/test/README.md +2 -2
  64. package/dist/gulp/main.js +9 -10
  65. package/dist/gulp/tasks/audit.js +7 -7
  66. package/dist/gulp/tasks/build-config.js +8 -8
  67. package/dist/gulp/tasks/bundle.js +16 -16
  68. package/dist/gulp/tasks/defaults.js +3 -3
  69. package/dist/gulp/tasks/distribute.js +2 -2
  70. package/dist/gulp/tasks/html.js +9 -9
  71. package/dist/gulp/tasks/package-quick.js +3 -3
  72. package/dist/gulp/tasks/package.js +3 -3
  73. package/dist/gulp/tasks/release.js +3 -3
  74. package/dist/gulp/tasks/sass.js +6 -6
  75. package/dist/gulp/tasks/serve.js +4 -4
  76. package/dist/hooks/notarize-artifacts.js +1 -1
  77. package/dist/hooks/notarize.js +1 -1
  78. package/dist/index.js +5 -8
  79. package/dist/lib/_environment-mixin.js +50 -0
  80. package/dist/lib/_lifecycle-mixin.js +45 -0
  81. package/dist/lib/analytics.js +33 -35
  82. package/dist/lib/app-state.js +14 -14
  83. package/dist/lib/auth-flow.js +18 -18
  84. package/dist/lib/auth-persistence.js +12 -12
  85. package/dist/lib/auth.js +421 -0
  86. package/dist/lib/auto-updater.js +49 -49
  87. package/dist/lib/context-menu.js +13 -13
  88. package/dist/lib/context.js +19 -19
  89. package/dist/lib/deep-link.js +34 -34
  90. package/dist/lib/fontawesome.js +5 -5
  91. package/dist/lib/ipc.js +4 -4
  92. package/dist/lib/menu.js +25 -25
  93. package/dist/lib/protocol.js +5 -5
  94. package/dist/lib/remote-config.js +22 -22
  95. package/dist/lib/remote-scripts.js +21 -21
  96. package/dist/lib/restart-manager/index.js +28 -28
  97. package/dist/lib/sign-helpers/exec-with-limit.js +1 -1
  98. package/dist/lib/sign-helpers/sign-events.js +1 -1
  99. package/dist/lib/startup.js +18 -13
  100. package/dist/lib/storage.js +10 -10
  101. package/dist/lib/templating.js +16 -16
  102. package/dist/lib/theme.js +10 -10
  103. package/dist/lib/tray.js +27 -27
  104. package/dist/lib/usage.js +11 -11
  105. package/dist/lib/window-manager.js +26 -26
  106. package/dist/main.js +398 -483
  107. package/dist/preload.js +236 -176
  108. package/dist/renderer.js +417 -391
  109. package/dist/runner/job-started.js +1 -1
  110. package/dist/test/fixtures/consumer-app/config/omega.json5 +1 -1
  111. package/dist/test/fixtures/consumer-app/src/assets/js/components/main/index.js +8 -11
  112. package/dist/test/fixtures/consumer-app/src/main.js +5 -7
  113. package/dist/test/fixtures/consumer-app/src/preload.js +2 -2
  114. package/dist/test/harness/boot-entry.js +22 -20
  115. package/dist/test/harness/main-entry.js +31 -30
  116. package/dist/test/harness/renderer-entry.js +5 -5
  117. package/dist/test/harness/renderer-preload.js +137 -141
  118. package/dist/test/index.js +10 -10
  119. package/dist/test/runner.js +2 -2
  120. package/dist/test/runners/boot.js +7 -6
  121. package/dist/test/runners/electron.js +3 -2
  122. package/dist/test/runners/render-event.js +2 -2
  123. package/dist/test/suites/boot/consumer-app-boots.test.js +57 -26
  124. package/dist/test/suites/boot/restart-manager.test.js +2 -2
  125. package/dist/test/suites/boot/storage-bundled.test.js +5 -5
  126. package/dist/test/suites/boot/theme.test.js +13 -13
  127. package/dist/test/suites/build/audit.test.js +1 -1
  128. package/dist/test/suites/build/auth-persistence-resolve.test.js +6 -6
  129. package/dist/test/suites/build/boot-fixture.test.js +2 -2
  130. package/dist/test/suites/build/boot-runner-timeout.test.js +6 -5
  131. package/dist/test/suites/build/brand-scss.test.js +1 -1
  132. package/dist/test/suites/build/build-json-bake.test.js +1 -1
  133. package/dist/test/suites/build/cli.test.js +2 -2
  134. package/dist/test/suites/build/config-schema.test.js +5 -5
  135. package/dist/test/suites/build/defaults-scaffold.test.js +2 -2
  136. package/dist/test/suites/build/deploy-hook.test.js +3 -3
  137. package/dist/test/suites/build/ensure-target.test.js +2 -2
  138. package/dist/test/suites/build/env-delivery.test.js +2 -2
  139. package/dist/test/suites/build/esm-only-dependency.test.js +2 -2
  140. package/dist/test/suites/build/exports.test.js +9 -8
  141. package/dist/test/suites/build/get-config.test.js +4 -4
  142. package/dist/test/suites/build/manifest-deps.test.js +1 -1
  143. package/dist/test/suites/build/merge-line-files.test.js +1 -1
  144. package/dist/test/suites/build/omega-shell.test.js +34 -2
  145. package/dist/test/suites/build/omega.test.js +350 -0
  146. package/dist/test/suites/build/renderer-auth-bridge.test.js +211 -78
  147. package/dist/test/suites/build/runner.test.js +612 -5
  148. package/dist/test/suites/build/sentry.test.js +2 -2
  149. package/dist/test/suites/build/sign-windows-e2e.test.js +2 -2
  150. package/dist/test/suites/build/templating.test.js +3 -3
  151. package/dist/test/suites/build/test-stealth.test.js +7 -9
  152. package/dist/test/suites/build/url-helpers.test.js +55 -56
  153. package/dist/test/suites/build/validate-config.test.js +2 -2
  154. package/dist/test/suites/build/wave5-pins.test.js +2 -2
  155. package/dist/test/suites/main/analytics.test.js +59 -59
  156. package/dist/test/suites/main/app-state.test.js +66 -66
  157. package/dist/test/suites/main/auth-flow.test.js +41 -41
  158. package/dist/test/suites/main/auth-persistence.test.js +54 -43
  159. package/dist/test/suites/main/{client-bridge.integration.test.js → auth.integration.test.js} +10 -9
  160. package/dist/test/suites/main/auth.test.js +336 -0
  161. package/dist/test/suites/main/auto-updater.test.js +134 -134
  162. package/dist/test/suites/main/boot-sequence.test.js +37 -49
  163. package/dist/test/suites/main/context-menu.test.js +51 -50
  164. package/dist/test/suites/main/context.test.js +25 -25
  165. package/dist/test/suites/main/deep-link.test.js +74 -74
  166. package/dist/test/suites/main/fontawesome.test.js +27 -27
  167. package/dist/test/suites/main/ipc.test.js +35 -35
  168. package/dist/test/suites/main/menu.test.js +101 -100
  169. package/dist/test/suites/main/protocol.test.js +19 -19
  170. package/dist/test/suites/main/remote-config.test.js +63 -63
  171. package/dist/test/suites/main/remote-scripts.test.js +103 -103
  172. package/dist/test/suites/main/request.test.js +71 -0
  173. package/dist/test/suites/main/restart-manager.test.js +33 -33
  174. package/dist/test/suites/main/startup-paths-and-ua.test.js +4 -4
  175. package/dist/test/suites/main/startup.test.js +26 -26
  176. package/dist/test/suites/main/stealth-window.test.js +1 -1
  177. package/dist/test/suites/main/storage.test.js +25 -25
  178. package/dist/test/suites/main/theme.test.js +34 -34
  179. package/dist/test/suites/main/tray.test.js +79 -79
  180. package/dist/test/suites/main/url-helpers.test.js +133 -133
  181. package/dist/test/suites/main/usage.test.js +25 -25
  182. package/dist/test/suites/main/window-bounds.test.js +27 -27
  183. package/dist/test/suites/main/window-manager.test.js +44 -44
  184. package/dist/test/suites/renderer/analytics-bridge.test.js +5 -5
  185. package/dist/test/suites/renderer/cross-context-helpers.test.js +37 -31
  186. package/dist/test/suites/renderer/round-trip.test.js +3 -3
  187. package/dist/test/suites/renderer/tooltips.test.js +15 -15
  188. package/dist/test/suites/renderer/{window-em-surface.test.js → window-desktop-surface.test.js} +27 -7
  189. package/dist/test/utils/extended-mode-warning.js +1 -1
  190. package/dist/utils/boot-harness.js +56 -0
  191. package/dist/utils/mode-helpers.js +2 -15
  192. package/dist/utils/ship-keys.js +3 -3
  193. package/dist/utils/signing-status.js +51 -0
  194. package/dist/utils/test-events.js +7 -0
  195. package/dist/utils/test-stealth.js +6 -6
  196. package/dist/utils/url-helpers.js +52 -42
  197. package/dist/utils/user-agent.js +44 -0
  198. package/dist/vendor/account/engine.js +3 -3
  199. package/dist/vendor/account/index.js +14 -45
  200. package/dist/vendor/account/resolve-account.js +44 -0
  201. package/dist/vendor/account/schema.js +1 -1
  202. package/dist/vendor/account/user.js +99 -0
  203. package/dist/vendor/config/client-config.js +1 -1
  204. package/dist/vendor/config/environment.js +11 -30
  205. package/dist/vendor/config/index.js +13 -12
  206. package/dist/vendor/config/load.js +1 -2
  207. package/dist/vendor/config/platforms.js +1 -1
  208. package/dist/vendor/config/repo.js +24 -0
  209. package/dist/vendor/config/retired-keys.js +2 -2
  210. package/dist/vendor/config/schema.js +5 -8
  211. package/dist/vendor/config/site-global.js +2 -3
  212. package/dist/vendor/config/validate.js +1 -2
  213. package/dist/vendor/config/winback.js +1 -1
  214. package/dist/vendor/devkit/actions-secrets.js +1 -1
  215. package/dist/vendor/devkit/attach-log-file.js +1 -1
  216. package/dist/vendor/devkit/brand-version.js +162 -1
  217. package/dist/vendor/devkit/build-json.js +1 -1
  218. package/dist/vendor/devkit/cli-router.js +3 -4
  219. package/dist/vendor/devkit/defaults-engine.js +9 -11
  220. package/dist/vendor/devkit/deploy.js +64 -4
  221. package/dist/vendor/devkit/git-remote.js +78 -1
  222. package/dist/vendor/devkit/local.js +53 -3
  223. package/dist/vendor/devkit/lockfile.js +127 -0
  224. package/dist/vendor/devkit/merge-line-files.js +2 -3
  225. package/dist/vendor/devkit/pack-local.js +4 -7
  226. package/dist/vendor/devkit/preludes/origin-heal.js +35 -49
  227. package/dist/vendor/devkit/target-secrets.js +34 -45
  228. package/dist/vendor/devkit/test/runner-core.js +6 -6
  229. package/dist/vendor/monitoring/env.js +2 -2
  230. package/dist/vendor/monitoring/index.js +1 -1
  231. package/dist/vendor/monitoring/main.js +1 -1
  232. package/dist/vendor/monitoring/preload.js +1 -1
  233. package/dist/vendor/monitoring/renderer.js +1 -1
  234. package/docs/analytics.md +8 -8
  235. package/docs/app-state.md +19 -19
  236. package/docs/audit.md +4 -4
  237. package/docs/{client-bridge.md → auth.md} +88 -73
  238. package/docs/auto-updater.md +8 -8
  239. package/docs/boot-sequence.md +11 -6
  240. package/docs/build-system.md +1 -1
  241. package/docs/cdp-debugging.md +1 -1
  242. package/docs/common-mistakes.md +7 -7
  243. package/docs/config-schema.md +1 -1
  244. package/docs/context-menu.md +13 -13
  245. package/docs/context.md +11 -11
  246. package/docs/css.md +3 -9
  247. package/docs/deep-link.md +25 -25
  248. package/docs/environment-detection.md +16 -16
  249. package/docs/fontawesome.md +7 -5
  250. package/docs/hooks.md +8 -8
  251. package/docs/index.md +39 -28
  252. package/docs/ipc.md +10 -10
  253. package/docs/lib-modules.md +9 -9
  254. package/docs/logging.md +12 -14
  255. package/docs/menu.md +18 -18
  256. package/docs/releasing.md +4 -2
  257. package/docs/remote-config.md +9 -9
  258. package/docs/remote-scripts.md +12 -12
  259. package/docs/restart-manager.md +8 -8
  260. package/docs/runner.md +12 -10
  261. package/docs/sentry.md +4 -4
  262. package/docs/shared/analytics.md +1 -1
  263. package/docs/shared/brands.md +1 -1
  264. package/docs/shared/breaking-changes.md +79 -13
  265. package/docs/shared/config.md +24 -21
  266. package/docs/shared/deploys.md +30 -7
  267. package/docs/shared/local-dev.md +5 -3
  268. package/docs/shared/logging.md +1 -1
  269. package/docs/shared/monitoring.md +5 -5
  270. package/docs/shared/testing.md +2 -2
  271. package/docs/shared/theming.md +1 -1
  272. package/docs/shared/translation.md +19 -10
  273. package/docs/signing.md +1 -1
  274. package/docs/startup.md +16 -16
  275. package/docs/storage.md +11 -11
  276. package/docs/templating.md +3 -3
  277. package/docs/test-boot-layer.md +12 -12
  278. package/docs/test-framework.md +17 -17
  279. package/docs/themes.md +7 -7
  280. package/docs/tooltips.md +2 -2
  281. package/docs/tray.md +31 -31
  282. package/docs/usage.md +7 -7
  283. package/docs/verts.md +1 -1
  284. package/docs/windows.md +22 -22
  285. package/package.json +3 -4
  286. package/dist/lib/client-bridge.js +0 -374
  287. package/dist/lib/logger.js +0 -4
  288. package/dist/test/suites/build/manager.test.js +0 -213
  289. package/dist/test/suites/main/client-bridge.test.js +0 -262
@@ -8,9 +8,9 @@ const defineCases = require('../../../vendor/devkit/test/define-cases.js');
8
8
  const STORAGE_KEY = 'autoUpdater';
9
9
 
10
10
  async function reinit(ctx, env) {
11
- const updater = ctx.manager.autoUpdater;
11
+ const updater = ctx.omega.autoUpdater;
12
12
  updater.shutdown();
13
- ctx.manager.storage.set(STORAGE_KEY, null);
13
+ ctx.omega.storage.set(STORAGE_KEY, null);
14
14
 
15
15
  // Snapshot + override env for this run.
16
16
  const saved = { OMEGA_DEV_UPDATE: process.env.OMEGA_DEV_UPDATE };
@@ -18,7 +18,7 @@ async function reinit(ctx, env) {
18
18
  if (v == null) delete process.env[k];
19
19
  else process.env[k] = v;
20
20
  }
21
- await updater.initialize(ctx.manager);
21
+ await updater.initialize(ctx.omega);
22
22
  return async () => {
23
23
  updater.shutdown();
24
24
  for (const [k, v] of Object.entries(saved)) {
@@ -26,7 +26,7 @@ async function reinit(ctx, env) {
26
26
  else process.env[k] = v;
27
27
  }
28
28
  // Re-init with the original env so subsequent tests have a working updater + IPC handlers.
29
- await updater.initialize(ctx.manager);
29
+ await updater.initialize(ctx.omega);
30
30
  };
31
31
  }
32
32
 
@@ -49,16 +49,16 @@ module.exports = defineCases({
49
49
  layer: 'main',
50
50
  description: 'auto-updater (main)',
51
51
  cleanup: async (ctx) => {
52
- ctx.manager.autoUpdater.shutdown();
53
- ctx.manager.storage.set(STORAGE_KEY, null);
52
+ ctx.omega.autoUpdater.shutdown();
53
+ ctx.omega.storage.set(STORAGE_KEY, null);
54
54
  delete process.env.OMEGA_DEV_UPDATE;
55
- await ctx.manager.autoUpdater.initialize(ctx.manager);
55
+ await ctx.omega.autoUpdater.initialize(ctx.omega);
56
56
  },
57
57
  tests: [
58
58
  {
59
59
  name: 'initialize ran during boot — initial status is idle',
60
60
  run: (ctx) => {
61
- const status = ctx.manager.autoUpdater.getStatus();
61
+ const status = ctx.omega.autoUpdater.getStatus();
62
62
  ctx.expect(status.code).toBe('idle');
63
63
  ctx.expect(status.percent).toBe(0);
64
64
  ctx.expect(status.error).toBe(null);
@@ -69,10 +69,10 @@ module.exports = defineCases({
69
69
  run: async (ctx) => {
70
70
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: 'available' });
71
71
  try {
72
- await ctx.manager.autoUpdater.checkNow({ userInitiated: true });
73
- await waitFor(() => ctx.manager.autoUpdater.getStatus().code === 'downloaded', { timeout: 5000 });
72
+ await ctx.omega.autoUpdater.checkNow({ userInitiated: true });
73
+ await waitFor(() => ctx.omega.autoUpdater.getStatus().code === 'downloaded', { timeout: 5000 });
74
74
 
75
- const s = ctx.manager.autoUpdater.getStatus();
75
+ const s = ctx.omega.autoUpdater.getStatus();
76
76
  ctx.expect(s.code).toBe('downloaded');
77
77
  ctx.expect(s.version).toBe('999.0.0');
78
78
  ctx.expect(s.percent).toBe(100);
@@ -85,10 +85,10 @@ module.exports = defineCases({
85
85
  run: async (ctx) => {
86
86
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: 'unavailable' });
87
87
  try {
88
- await ctx.manager.autoUpdater.checkNow({ userInitiated: false });
89
- await waitFor(() => ctx.manager.autoUpdater.getStatus().code === 'not-available');
88
+ await ctx.omega.autoUpdater.checkNow({ userInitiated: false });
89
+ await waitFor(() => ctx.omega.autoUpdater.getStatus().code === 'not-available');
90
90
 
91
- const s = ctx.manager.autoUpdater.getStatus();
91
+ const s = ctx.omega.autoUpdater.getStatus();
92
92
  ctx.expect(s.code).toBe('not-available');
93
93
  ctx.expect(s.error).toBe(null);
94
94
  } finally { await restore(); }
@@ -99,10 +99,10 @@ module.exports = defineCases({
99
99
  run: async (ctx) => {
100
100
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: 'error' });
101
101
  try {
102
- await ctx.manager.autoUpdater.checkNow({ userInitiated: false });
103
- await waitFor(() => ctx.manager.autoUpdater.getStatus().code === 'error');
102
+ await ctx.omega.autoUpdater.checkNow({ userInitiated: false });
103
+ await waitFor(() => ctx.omega.autoUpdater.getStatus().code === 'error');
104
104
 
105
- const s = ctx.manager.autoUpdater.getStatus();
105
+ const s = ctx.omega.autoUpdater.getStatus();
106
106
  ctx.expect(s.code).toBe('error');
107
107
  ctx.expect(s.error).toBeDefined();
108
108
  ctx.expect(s.error.message).toMatch(/Simulated/);
@@ -114,10 +114,10 @@ module.exports = defineCases({
114
114
  run: async (ctx) => {
115
115
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: null });
116
116
  try {
117
- await ctx.manager.autoUpdater.simulate('available');
118
- await waitFor(() => ctx.manager.autoUpdater.getStatus().code === 'downloaded', { timeout: 5000 });
117
+ await ctx.omega.autoUpdater.simulate('available');
118
+ await waitFor(() => ctx.omega.autoUpdater.getStatus().code === 'downloaded', { timeout: 5000 });
119
119
 
120
- const s = ctx.manager.autoUpdater.getStatus();
120
+ const s = ctx.omega.autoUpdater.getStatus();
121
121
  ctx.expect(s.code).toBe('downloaded');
122
122
  ctx.expect(s.version).toBe('999.0.0');
123
123
  ctx.expect(s.percent).toBe(100);
@@ -129,10 +129,10 @@ module.exports = defineCases({
129
129
  run: async (ctx) => {
130
130
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: null });
131
131
  try {
132
- await ctx.manager.autoUpdater.simulate('unavailable');
133
- await waitFor(() => ctx.manager.autoUpdater.getStatus().code === 'not-available');
132
+ await ctx.omega.autoUpdater.simulate('unavailable');
133
+ await waitFor(() => ctx.omega.autoUpdater.getStatus().code === 'not-available');
134
134
 
135
- ctx.expect(ctx.manager.autoUpdater.getStatus().error).toBe(null);
135
+ ctx.expect(ctx.omega.autoUpdater.getStatus().error).toBe(null);
136
136
  } finally { await restore(); }
137
137
  },
138
138
  },
@@ -141,10 +141,10 @@ module.exports = defineCases({
141
141
  run: async (ctx) => {
142
142
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: null });
143
143
  try {
144
- await ctx.manager.autoUpdater.simulate('error');
145
- await waitFor(() => ctx.manager.autoUpdater.getStatus().code === 'error');
144
+ await ctx.omega.autoUpdater.simulate('error');
145
+ await waitFor(() => ctx.omega.autoUpdater.getStatus().code === 'error');
146
146
 
147
- ctx.expect(ctx.manager.autoUpdater.getStatus().error.message).toMatch(/Simulated/);
147
+ ctx.expect(ctx.omega.autoUpdater.getStatus().error.message).toMatch(/Simulated/);
148
148
  } finally { await restore(); }
149
149
  },
150
150
  },
@@ -153,8 +153,8 @@ module.exports = defineCases({
153
153
  run: async (ctx) => {
154
154
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: null });
155
155
  try {
156
- await ctx.expect(() => ctx.manager.autoUpdater.simulate('sideways')).toThrow(/unknown scenario/i);
157
- await ctx.expect(() => ctx.manager.autoUpdater.simulate()).toThrow(/scenario required/i);
156
+ await ctx.expect(() => ctx.omega.autoUpdater.simulate('sideways')).toThrow(/unknown scenario/i);
157
+ await ctx.expect(() => ctx.omega.autoUpdater.simulate()).toThrow(/scenario required/i);
158
158
  } finally { await restore(); }
159
159
  },
160
160
  },
@@ -162,19 +162,19 @@ module.exports = defineCases({
162
162
  name: 'simulate(): refuses in a production build unless OMEGA_DEV_UPDATE is set',
163
163
  run: async (ctx) => {
164
164
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: null });
165
- const origIsProduction = ctx.manager.isProduction;
166
- ctx.manager.isProduction = () => true;
165
+ const origIsProduction = ctx.omega.isProduction;
166
+ ctx.omega.isProduction = () => true;
167
167
  try {
168
- await ctx.expect(() => ctx.manager.autoUpdater.simulate('available')).toThrow(/production/i);
169
- ctx.expect(ctx.manager.autoUpdater.getStatus().code).toBe('idle');
168
+ await ctx.expect(() => ctx.omega.autoUpdater.simulate('available')).toThrow(/production/i);
169
+ ctx.expect(ctx.omega.autoUpdater.getStatus().code).toBe('idle');
170
170
 
171
171
  // ...but a packaged QA build launched with the env var set may still simulate.
172
172
  process.env.OMEGA_DEV_UPDATE = 'available';
173
- await ctx.manager.autoUpdater.simulate('unavailable');
174
- await waitFor(() => ctx.manager.autoUpdater.getStatus().code === 'not-available');
173
+ await ctx.omega.autoUpdater.simulate('unavailable');
174
+ await waitFor(() => ctx.omega.autoUpdater.getStatus().code === 'not-available');
175
175
  } finally {
176
176
  delete process.env.OMEGA_DEV_UPDATE;
177
- ctx.manager.isProduction = origIsProduction;
177
+ ctx.omega.isProduction = origIsProduction;
178
178
  await restore();
179
179
  }
180
180
  },
@@ -183,11 +183,11 @@ module.exports = defineCases({
183
183
  // The whole point of the session flag: simulate() leaves the synthetic library
184
184
  // wired, so every LATER trigger (the hourly feed tick) drives the simulator too.
185
185
  // Without _isSimulating() latching, that fake 'downloaded' walks into the real
186
- // install path and flips the manager's quit latch.
186
+ // install path and flips the omega instance's quit latch.
187
187
  name: 'simulate(): latches the session so a later feed tick cannot reach the real install path',
188
188
  run: async (ctx) => {
189
189
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: null });
190
- const u = ctx.manager.autoUpdater;
190
+ const u = ctx.omega.autoUpdater;
191
191
  const origPrompt = u._promptToInstall;
192
192
  let promptCalls = 0;
193
193
  u._promptToInstall = async () => { promptCalls++; };
@@ -207,11 +207,11 @@ module.exports = defineCases({
207
207
  u._lastActivityAt = Date.now() - (10 * 60 * 1000);
208
208
  u._evaluateIdleInstall();
209
209
 
210
- ctx.expect(ctx.manager._allowQuit).toBe(false);
210
+ ctx.expect(ctx.omega._allowQuit).toBe(false);
211
211
  ctx.expect(promptCalls).toBe(0);
212
212
  } finally {
213
213
  u._promptToInstall = origPrompt;
214
- ctx.manager._allowQuit = false;
214
+ ctx.omega._allowQuit = false;
215
215
  await restore();
216
216
  }
217
217
  },
@@ -220,7 +220,7 @@ module.exports = defineCases({
220
220
  name: 'simulate(): shutdown clears the session flag',
221
221
  run: async (ctx) => {
222
222
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: null });
223
- const u = ctx.manager.autoUpdater;
223
+ const u = ctx.omega.autoUpdater;
224
224
  try {
225
225
  await u.simulate('unavailable');
226
226
  ctx.expect(u._isSimulating()).toBe(true);
@@ -234,7 +234,7 @@ module.exports = defineCases({
234
234
  name: 'simulate(): refuses while a cascade is already running',
235
235
  run: async (ctx) => {
236
236
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: null });
237
- const u = ctx.manager.autoUpdater;
237
+ const u = ctx.omega.autoUpdater;
238
238
  try {
239
239
  await u.simulate('available');
240
240
  ctx.expect(u._devSimulating).toBe(true);
@@ -251,13 +251,13 @@ module.exports = defineCases({
251
251
  run: async (ctx) => {
252
252
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: 'available' });
253
253
  try {
254
- await ctx.manager.autoUpdater.checkNow({ userInitiated: false });
255
- await waitFor(() => ctx.manager.autoUpdater.getStatus().code === 'downloaded', { timeout: 5000 });
254
+ await ctx.omega.autoUpdater.checkNow({ userInitiated: false });
255
+ await waitFor(() => ctx.omega.autoUpdater.getStatus().code === 'downloaded', { timeout: 5000 });
256
256
 
257
257
  // The fake download stamps memory (the in-session UI flow reads the
258
258
  // same as a real one) but must leave the production record alone.
259
- ctx.expect(typeof ctx.manager.autoUpdater.getStatus().downloadedAt).toBe('number');
260
- ctx.expect(ctx.manager.storage.get(`${STORAGE_KEY}.pendingUpdate`)).toBeUndefined();
259
+ ctx.expect(typeof ctx.omega.autoUpdater.getStatus().downloadedAt).toBe('number');
260
+ ctx.expect(ctx.omega.storage.get(`${STORAGE_KEY}.pendingUpdate`)).toBeUndefined();
261
261
  } finally { await restore(); }
262
262
  },
263
263
  },
@@ -266,11 +266,11 @@ module.exports = defineCases({
266
266
  run: async (ctx) => {
267
267
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: null });
268
268
  try {
269
- await ctx.manager.autoUpdater.simulate('available');
270
- await waitFor(() => ctx.manager.autoUpdater.getStatus().code === 'downloaded', { timeout: 5000 });
269
+ await ctx.omega.autoUpdater.simulate('available');
270
+ await waitFor(() => ctx.omega.autoUpdater.getStatus().code === 'downloaded', { timeout: 5000 });
271
271
 
272
- ctx.expect(typeof ctx.manager.autoUpdater.getStatus().downloadedAt).toBe('number');
273
- ctx.expect(ctx.manager.storage.get(`${STORAGE_KEY}.pendingUpdate`)).toBeUndefined();
272
+ ctx.expect(typeof ctx.omega.autoUpdater.getStatus().downloadedAt).toBe('number');
273
+ ctx.expect(ctx.omega.storage.get(`${STORAGE_KEY}.pendingUpdate`)).toBeUndefined();
274
274
  } finally { await restore(); }
275
275
  },
276
276
  },
@@ -281,17 +281,17 @@ module.exports = defineCases({
281
281
  name: 'a stale simulated pendingUpdate cannot seed a real download (30-day gate does not force install)',
282
282
  run: async (ctx) => {
283
283
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: null });
284
- const updater = ctx.manager.autoUpdater;
284
+ const updater = ctx.omega.autoUpdater;
285
285
  let quitCalled = false;
286
286
  let origQuit;
287
287
  try {
288
288
  // A 40-day-old simulator record, then a boot so the reconciler sees it.
289
289
  const staleTs = Date.now() - (40 * 24 * 60 * 60 * 1000);
290
- ctx.manager.storage.set(`${STORAGE_KEY}.pendingUpdate`, { version: '999.0.0', downloadedAt: staleTs });
290
+ ctx.omega.storage.set(`${STORAGE_KEY}.pendingUpdate`, { version: '999.0.0', downloadedAt: staleTs });
291
291
  updater.shutdown();
292
- await updater.initialize(ctx.manager);
292
+ await updater.initialize(ctx.omega);
293
293
 
294
- ctx.expect(ctx.manager.storage.get(`${STORAGE_KEY}.pendingUpdate`)).toBe(null);
294
+ ctx.expect(ctx.omega.storage.get(`${STORAGE_KEY}.pendingUpdate`)).toBe(null);
295
295
  ctx.expect(updater._state.downloadedAt).toBe(null);
296
296
 
297
297
  // A real update downloads: it starts its OWN 30-day clock.
@@ -300,7 +300,7 @@ module.exports = defineCases({
300
300
  updater._library.quitAndInstall = () => { quitCalled = true; };
301
301
  updater._library.emit('update-downloaded', { version: '2.0.0' });
302
302
 
303
- const stored = ctx.manager.storage.get(`${STORAGE_KEY}.pendingUpdate`);
303
+ const stored = ctx.omega.storage.get(`${STORAGE_KEY}.pendingUpdate`);
304
304
  ctx.expect(stored.version).toBe('2.0.0');
305
305
  ctx.expect(stored.downloadedAt).not.toBeLessThan(before);
306
306
  ctx.expect(updater._state.downloadedAt).toBe(stored.downloadedAt);
@@ -308,7 +308,7 @@ module.exports = defineCases({
308
308
  } finally {
309
309
  // The spy sat on the shared electron-updater singleton.
310
310
  if (origQuit) updater._library.quitAndInstall = origQuit;
311
- ctx.manager._allowQuit = false;
311
+ ctx.omega._allowQuit = false;
312
312
  await restore();
313
313
  }
314
314
  },
@@ -319,12 +319,12 @@ module.exports = defineCases({
319
319
  name: 'first download persists pendingUpdate to storage',
320
320
  run: async (ctx) => {
321
321
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: null });
322
- const updater = ctx.manager.autoUpdater;
322
+ const updater = ctx.omega.autoUpdater;
323
323
  try {
324
324
  updater._library.emit('update-downloaded', { version: '2.0.0' });
325
325
  ctx.expect(updater.getStatus().code).toBe('downloaded');
326
326
 
327
- const stored = ctx.manager.storage.get(`${STORAGE_KEY}.pendingUpdate`);
327
+ const stored = ctx.omega.storage.get(`${STORAGE_KEY}.pendingUpdate`);
328
328
  ctx.expect(stored).toBeDefined();
329
329
  ctx.expect(stored.version).toBe('2.0.0');
330
330
  ctx.expect(typeof stored.downloadedAt).toBe('number');
@@ -338,12 +338,12 @@ module.exports = defineCases({
338
338
  try {
339
339
  // Plant an older pending-update record manually.
340
340
  const oldTs = Date.now() - (10 * 24 * 60 * 60 * 1000); // 10 days ago
341
- ctx.manager.storage.set(`${STORAGE_KEY}.pendingUpdate`, { version: '888.0.0', downloadedAt: oldTs });
341
+ ctx.omega.storage.set(`${STORAGE_KEY}.pendingUpdate`, { version: '888.0.0', downloadedAt: oldTs });
342
342
 
343
343
  // Call _recordDownloadedAt for a "new" download.
344
- ctx.manager.autoUpdater._recordDownloadedAt('2.0.0');
344
+ ctx.omega.autoUpdater._recordDownloadedAt('2.0.0');
345
345
 
346
- const stored = ctx.manager.storage.get(`${STORAGE_KEY}.pendingUpdate`);
346
+ const stored = ctx.omega.storage.get(`${STORAGE_KEY}.pendingUpdate`);
347
347
  // Timer unchanged (first-download-wins) — but the version must track
348
348
  // the newest download: after installing 2.0.0, the clear-on-apply
349
349
  // check (pending.version === getVersion()) has to match, or the stale
@@ -360,19 +360,19 @@ module.exports = defineCases({
360
360
  let installCalled = false;
361
361
  try {
362
362
  // Override installNow to capture the trigger without actually quitting.
363
- const origInstall = ctx.manager.autoUpdater.installNow;
364
- ctx.manager.autoUpdater.installNow = async () => { installCalled = true; return true; };
363
+ const origInstall = ctx.omega.autoUpdater.installNow;
364
+ ctx.omega.autoUpdater.installNow = async () => { installCalled = true; return true; };
365
365
 
366
366
  // Plant an old pending-update.
367
367
  const oldTs = Date.now() - (31 * 24 * 60 * 60 * 1000);
368
- ctx.manager.autoUpdater._state.downloadedAt = oldTs;
369
- ctx.manager.autoUpdater._options.maxAgeMs = 30 * 24 * 60 * 60 * 1000;
368
+ ctx.omega.autoUpdater._state.downloadedAt = oldTs;
369
+ ctx.omega.autoUpdater._options.maxAgeMs = 30 * 24 * 60 * 60 * 1000;
370
370
 
371
- const triggered = ctx.manager.autoUpdater._enforceMaxAgeGate();
371
+ const triggered = ctx.omega.autoUpdater._enforceMaxAgeGate();
372
372
  ctx.expect(triggered).toBe(true);
373
373
  ctx.expect(installCalled).toBe(true);
374
374
 
375
- ctx.manager.autoUpdater.installNow = origInstall;
375
+ ctx.omega.autoUpdater.installNow = origInstall;
376
376
  } finally { await restore(); }
377
377
  },
378
378
  },
@@ -383,13 +383,13 @@ module.exports = defineCases({
383
383
  name: '30-day gate: carried-over stale pending installs when update-downloaded fires (real installNow state guard)',
384
384
  run: async (ctx) => {
385
385
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: null });
386
- const updater = ctx.manager.autoUpdater;
386
+ const updater = ctx.omega.autoUpdater;
387
387
  let quitCalled = false;
388
388
  let origQuit;
389
389
  try {
390
390
  // Plant a >30-day pending update, then reconcile like a fresh boot.
391
391
  const oldTs = Date.now() - (31 * 24 * 60 * 60 * 1000);
392
- ctx.manager.storage.set(`${STORAGE_KEY}.pendingUpdate`, { version: '777.0.0', downloadedAt: oldTs });
392
+ ctx.omega.storage.set(`${STORAGE_KEY}.pendingUpdate`, { version: '777.0.0', downloadedAt: oldTs });
393
393
  updater._options.maxAgeMs = 30 * 24 * 60 * 60 * 1000;
394
394
  updater._reconcilePendingUpdate();
395
395
 
@@ -407,9 +407,9 @@ module.exports = defineCases({
407
407
  ctx.expect(quitCalled).toBe(true);
408
408
  } finally {
409
409
  // The spy sat on the shared electron-updater singleton; the install
410
- // path also flipped the manager's quit latch — undo both.
410
+ // path also flipped the omega instance's quit latch — undo both.
411
411
  if (origQuit) updater._library.quitAndInstall = origQuit;
412
- ctx.manager._allowQuit = false;
412
+ ctx.omega._allowQuit = false;
413
413
  await restore();
414
414
  }
415
415
  },
@@ -419,10 +419,10 @@ module.exports = defineCases({
419
419
  run: async (ctx) => {
420
420
  const restore = await reinit(ctx, {});
421
421
  try {
422
- ctx.manager.autoUpdater._state.downloadedAt = Date.now() - (5 * 24 * 60 * 60 * 1000);
423
- ctx.manager.autoUpdater._options.maxAgeMs = 30 * 24 * 60 * 60 * 1000;
422
+ ctx.omega.autoUpdater._state.downloadedAt = Date.now() - (5 * 24 * 60 * 60 * 1000);
423
+ ctx.omega.autoUpdater._options.maxAgeMs = 30 * 24 * 60 * 60 * 1000;
424
424
 
425
- const triggered = ctx.manager.autoUpdater._enforceMaxAgeGate();
425
+ const triggered = ctx.omega.autoUpdater._enforceMaxAgeGate();
426
426
  ctx.expect(triggered).toBe(false);
427
427
  } finally { await restore(); }
428
428
  },
@@ -433,19 +433,19 @@ module.exports = defineCases({
433
433
  const restore = await reinit(ctx, {});
434
434
  try {
435
435
  // Stash a pending-update entry whose version matches our current package version.
436
- const currentVersion = ctx.manager.getVersion();
436
+ const currentVersion = ctx.omega.getVersion();
437
437
  ctx.expect(typeof currentVersion).toBe('string');
438
438
 
439
- ctx.manager.storage.set(`${STORAGE_KEY}.pendingUpdate`, {
439
+ ctx.omega.storage.set(`${STORAGE_KEY}.pendingUpdate`, {
440
440
  version: currentVersion,
441
441
  downloadedAt: Date.now() - (5 * 24 * 60 * 60 * 1000),
442
442
  });
443
443
 
444
444
  // Re-init triggers the reconciler.
445
- ctx.manager.autoUpdater.shutdown();
446
- await ctx.manager.autoUpdater.initialize(ctx.manager);
445
+ ctx.omega.autoUpdater.shutdown();
446
+ await ctx.omega.autoUpdater.initialize(ctx.omega);
447
447
 
448
- const stillThere = ctx.manager.storage.get(`${STORAGE_KEY}.pendingUpdate`);
448
+ const stillThere = ctx.omega.storage.get(`${STORAGE_KEY}.pendingUpdate`);
449
449
  ctx.expect(stillThere).toBe(null);
450
450
  } finally { await restore(); }
451
451
  },
@@ -455,7 +455,7 @@ module.exports = defineCases({
455
455
  run: async (ctx) => {
456
456
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: 'unavailable' });
457
457
  try {
458
- const result = await ctx.manager.autoUpdater.checkNow();
458
+ const result = await ctx.omega.autoUpdater.checkNow();
459
459
  ctx.expect(typeof result.code).toBe('string');
460
460
  ctx.expect('percent' in result).toBe(true);
461
461
  } finally { await restore(); }
@@ -464,26 +464,26 @@ module.exports = defineCases({
464
464
  {
465
465
  name: 'IPC handler registered: desktop:auto-updater:status returns status',
466
466
  run: async (ctx) => {
467
- const result = await ctx.manager.ipc.invoke('desktop:auto-updater:status');
467
+ const result = await ctx.omega.ipc.invoke('desktop:auto-updater:status');
468
468
  ctx.expect(typeof result.code).toBe('string');
469
469
  },
470
470
  },
471
471
  {
472
472
  name: 'enabled=false: skip wiring, no library, no interval',
473
473
  run: async (ctx) => {
474
- ctx.manager.autoUpdater.shutdown();
475
- const cfg = ctx.manager.config;
474
+ ctx.omega.autoUpdater.shutdown();
475
+ const cfg = ctx.omega.config;
476
476
  const orig = cfg.autoUpdate;
477
477
  cfg.autoUpdate = { enabled: false };
478
478
  try {
479
- await ctx.manager.autoUpdater.initialize(ctx.manager);
480
- ctx.expect(ctx.manager.autoUpdater._feedCheckIntervalId).toBe(null);
481
- ctx.expect(ctx.manager.autoUpdater._idleEvalIntervalId).toBe(null);
482
- ctx.expect(ctx.manager.autoUpdater._library).toBe(null);
479
+ await ctx.omega.autoUpdater.initialize(ctx.omega);
480
+ ctx.expect(ctx.omega.autoUpdater._feedCheckIntervalId).toBe(null);
481
+ ctx.expect(ctx.omega.autoUpdater._idleEvalIntervalId).toBe(null);
482
+ ctx.expect(ctx.omega.autoUpdater._library).toBe(null);
483
483
  } finally {
484
484
  cfg.autoUpdate = orig;
485
- ctx.manager.autoUpdater.shutdown();
486
- await ctx.manager.autoUpdater.initialize(ctx.manager);
485
+ ctx.omega.autoUpdater.shutdown();
486
+ await ctx.omega.autoUpdater.initialize(ctx.omega);
487
487
  }
488
488
  },
489
489
  },
@@ -497,7 +497,7 @@ module.exports = defineCases({
497
497
  {
498
498
  name: 'markActive() bumps _lastActivityAt to current time',
499
499
  run: async (ctx) => {
500
- const u = ctx.manager.autoUpdater;
500
+ const u = ctx.omega.autoUpdater;
501
501
  u._lastActivityAt = 0;
502
502
  const before = Date.now();
503
503
  u.markActive();
@@ -509,7 +509,7 @@ module.exports = defineCases({
509
509
  {
510
510
  name: '_onActivityIpc routes through to markActive',
511
511
  run: async (ctx) => {
512
- const u = ctx.manager.autoUpdater;
512
+ const u = ctx.omega.autoUpdater;
513
513
  u._lastActivityAt = 0;
514
514
  u._onActivityIpc();
515
515
  ctx.expect(u._lastActivityAt > 0).toBe(true);
@@ -518,11 +518,11 @@ module.exports = defineCases({
518
518
  {
519
519
  name: 'IPC channel desktop:auto-updater:activity is registered + bumps activity timestamp',
520
520
  run: async (ctx) => {
521
- const u = ctx.manager.autoUpdater;
521
+ const u = ctx.omega.autoUpdater;
522
522
  // initialize() registered the listener — verify presence + simulate an inbound
523
523
  // renderer message by invoking each registered listener directly. In-process
524
524
  // this matches what `ipcMain.on(channel, ...)` does on a real `ipcRenderer.send`.
525
- const listeners = ctx.manager.ipc._listeners['desktop:auto-updater:activity'];
525
+ const listeners = ctx.omega.ipc._listeners['desktop:auto-updater:activity'];
526
526
  ctx.expect(listeners).toBeDefined();
527
527
  ctx.expect(listeners.size > 0).toBe(true);
528
528
  u._lastActivityAt = 0;
@@ -533,7 +533,7 @@ module.exports = defineCases({
533
533
  {
534
534
  name: 'idle-install: when idle ≥ threshold + state=downloaded, installNow fires',
535
535
  run: async (ctx) => {
536
- const u = ctx.manager.autoUpdater;
536
+ const u = ctx.omega.autoUpdater;
537
537
  const origInstall = u.installNow;
538
538
  let installCalled = false;
539
539
  u.installNow = async () => { installCalled = true; return true; };
@@ -557,7 +557,7 @@ module.exports = defineCases({
557
557
  {
558
558
  name: 'idle-install: when active, prompt fires once per version (no install)',
559
559
  run: async (ctx) => {
560
- const u = ctx.manager.autoUpdater;
560
+ const u = ctx.omega.autoUpdater;
561
561
  const origInstall = u.installNow;
562
562
  const origPrompt = u._promptToInstall;
563
563
  let installCalled = false;
@@ -588,7 +588,7 @@ module.exports = defineCases({
588
588
  {
589
589
  name: 'idle-install: a NEW downloaded version re-arms the prompt',
590
590
  run: async (ctx) => {
591
- const u = ctx.manager.autoUpdater;
591
+ const u = ctx.omega.autoUpdater;
592
592
  const origPrompt = u._promptToInstall;
593
593
  let promptCalls = 0;
594
594
  u._promptToInstall = async (v) => { promptCalls++; };
@@ -616,7 +616,7 @@ module.exports = defineCases({
616
616
  {
617
617
  name: 'idle-install: skipped entirely when state !== downloaded',
618
618
  run: async (ctx) => {
619
- const u = ctx.manager.autoUpdater;
619
+ const u = ctx.omega.autoUpdater;
620
620
  const origInstall = u.installNow;
621
621
  const origPrompt = u._promptToInstall;
622
622
  let installCalled = false;
@@ -643,7 +643,7 @@ module.exports = defineCases({
643
643
  {
644
644
  name: 'idle-install: skipped when _userInitiated=true (consumer UI owns the path)',
645
645
  run: async (ctx) => {
646
- const u = ctx.manager.autoUpdater;
646
+ const u = ctx.omega.autoUpdater;
647
647
  const origInstall = u.installNow;
648
648
  const origPrompt = u._promptToInstall;
649
649
  let installCalled = false;
@@ -669,7 +669,7 @@ module.exports = defineCases({
669
669
  {
670
670
  name: 'idle-install: dev mode bails out (no install, no prompt)',
671
671
  run: async (ctx) => {
672
- const u = ctx.manager.autoUpdater;
672
+ const u = ctx.omega.autoUpdater;
673
673
  const origInstall = u.installNow;
674
674
  const origPrompt = u._promptToInstall;
675
675
  let installCalled = false;
@@ -697,7 +697,7 @@ module.exports = defineCases({
697
697
  {
698
698
  name: 'checkNow: dedupes — second call while state=checking returns without re-checking',
699
699
  run: async (ctx) => {
700
- const u = ctx.manager.autoUpdater;
700
+ const u = ctx.omega.autoUpdater;
701
701
  // Stub the underlying library so we can count calls.
702
702
  const origLib = u._library;
703
703
  let checkCalls = 0;
@@ -720,7 +720,7 @@ module.exports = defineCases({
720
720
  {
721
721
  name: 'checkNow: dedupes from each non-ready state (downloading, available, downloaded)',
722
722
  run: async (ctx) => {
723
- const u = ctx.manager.autoUpdater;
723
+ const u = ctx.omega.autoUpdater;
724
724
  const origLib = u._library;
725
725
  let checkCalls = 0;
726
726
  u._library = {
@@ -745,7 +745,7 @@ module.exports = defineCases({
745
745
  // User clicks "Check for Updates" — IPC invokes checkNow({userInitiated: true}).
746
746
  // Pre-fix: that flipped _userInitiated to true even though the second check was
747
747
  // skipped, breaking idle-install when the download completes.
748
- const u = ctx.manager.autoUpdater;
748
+ const u = ctx.omega.autoUpdater;
749
749
  u._state = { ...u._state, code: 'downloading' }; // mid-flight
750
750
  u._userInitiated = false; // initial periodic check
751
751
 
@@ -757,7 +757,7 @@ module.exports = defineCases({
757
757
  {
758
758
  name: 'checkNow: _userInitiated DOES flip when the call actually performs a check',
759
759
  run: async (ctx) => {
760
- const u = ctx.manager.autoUpdater;
760
+ const u = ctx.omega.autoUpdater;
761
761
  const origLib = u._library;
762
762
  u._library = {
763
763
  checkForUpdates: async () => {}, // no-op so the test runs synchronously
@@ -779,7 +779,7 @@ module.exports = defineCases({
779
779
  // Behavior contract: the timestamp tracks "we considered checking at this moment,"
780
780
  // not "we successfully checked." A user click that hits the dedup guard still updates
781
781
  // the timestamp so UI surfaces show fresh "checked just now" feedback.
782
- const u = ctx.manager.autoUpdater;
782
+ const u = ctx.omega.autoUpdater;
783
783
  u._state = { ...u._state, code: 'checking', lastCheckedAt: 0 };
784
784
  const before = Date.now();
785
785
  await u.checkNow({ userInitiated: true });
@@ -798,7 +798,7 @@ module.exports = defineCases({
798
798
  {
799
799
  name: 'feed-check tick: hits the library + runs 30-day gate (no idle eval)',
800
800
  run: async (ctx) => {
801
- const u = ctx.manager.autoUpdater;
801
+ const u = ctx.omega.autoUpdater;
802
802
  const origLib = u._library;
803
803
  const origGate = u._enforceMaxAgeGate;
804
804
  const origIdle = u._evaluateIdleInstall;
@@ -825,7 +825,7 @@ module.exports = defineCases({
825
825
  {
826
826
  name: 'idle-eval tick: only runs idle eval (no HTTP, no gate)',
827
827
  run: async (ctx) => {
828
- const u = ctx.manager.autoUpdater;
828
+ const u = ctx.omega.autoUpdater;
829
829
  const origLib = u._library;
830
830
  const origGate = u._enforceMaxAgeGate;
831
831
  const origIdle = u._evaluateIdleInstall;
@@ -851,7 +851,7 @@ module.exports = defineCases({
851
851
  {
852
852
  name: 'feed-check default cadence is 1h (production), not 1m',
853
853
  run: (ctx) => {
854
- const u = ctx.manager.autoUpdater;
854
+ const u = ctx.omega.autoUpdater;
855
855
  // Sanity-guard: if someone re-merges the timers or drops the cadence to
856
856
  // 60s again, this test fails. Production builds must not hammer the feed.
857
857
  ctx.expect(u._options.feedCheckIntervalMs).toBe(60 * 60 * 1000);
@@ -864,7 +864,7 @@ module.exports = defineCases({
864
864
  // The whole point of the new system: drive a real update through the dev simulator,
865
865
  // then exercise the post-download decision path with stubbed installNow.
866
866
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: 'available' });
867
- const u = ctx.manager.autoUpdater;
867
+ const u = ctx.omega.autoUpdater;
868
868
  const origInstall = u.installNow;
869
869
  const origIsSimulating = u._isSimulating;
870
870
  let installCalled = false;
@@ -890,7 +890,7 @@ module.exports = defineCases({
890
890
  name: 'full update sequence: download → user-active → prompt fires (no install)',
891
891
  run: async (ctx) => {
892
892
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: 'available' });
893
- const u = ctx.manager.autoUpdater;
893
+ const u = ctx.omega.autoUpdater;
894
894
  const origInstall = u.installNow;
895
895
  const origPrompt = u._promptToInstall;
896
896
  const origIsSimulating = u._isSimulating;
@@ -922,7 +922,7 @@ module.exports = defineCases({
922
922
  //
923
923
  // Where the unit tests above fake the clock + poke `_evaluateIdleInstall` directly,
924
924
  // this one drives a REAL update through the dev simulator AND lets the actual
925
- // periodic tick fire on its own. With `manager.isTesting() === true`, the tick
925
+ // periodic tick fire on its own. With `omega.isTesting() === true`, the tick
926
926
  // cadence drops to IDLE_TICK_MS_TESTING (500ms) and the idle threshold drops to
927
927
  // IDLE_INSTALL_THRESHOLD_MS_TESTING (3s) — so the full sequence completes inside
928
928
  // ~5s instead of ~15min.
@@ -935,7 +935,7 @@ module.exports = defineCases({
935
935
  name: 'real-time end-to-end: download fires, threshold elapses, install triggers via periodic tick',
936
936
  run: async (ctx) => {
937
937
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: 'available' });
938
- const u = ctx.manager.autoUpdater;
938
+ const u = ctx.omega.autoUpdater;
939
939
  const origInstall = u.installNow;
940
940
  const origIsSimulating = u._isSimulating;
941
941
  let installCalled = false;
@@ -965,7 +965,7 @@ module.exports = defineCases({
965
965
  name: 'real-time end-to-end: download fires while user-active → prompt fires, install does NOT',
966
966
  run: async (ctx) => {
967
967
  const restore = await reinit(ctx, { OMEGA_DEV_UPDATE: 'available' });
968
- const u = ctx.manager.autoUpdater;
968
+ const u = ctx.omega.autoUpdater;
969
969
  const origInstall = u.installNow;
970
970
  const origPrompt = u._promptToInstall;
971
971
  const origIsSimulating = u._isSimulating;
@@ -1006,43 +1006,43 @@ module.exports = defineCases({
1006
1006
  // ─── Mode helpers (@omega.js/backend-pattern: isDevelopment / isProduction / isTesting) ────
1007
1007
 
1008
1008
  {
1009
- name: 'manager.isTesting() returns true under OMEGA_ENVIRONMENT=testing (named by the test runner)',
1009
+ name: 'omega.isTesting() returns true under OMEGA_ENVIRONMENT=testing (named by the test runner)',
1010
1010
  run: (ctx) => {
1011
- ctx.expect(typeof ctx.manager.isTesting).toBe('function');
1012
- ctx.expect(ctx.manager.isTesting()).toBe(true);
1011
+ ctx.expect(typeof ctx.omega.isTesting).toBe('function');
1012
+ ctx.expect(ctx.omega.isTesting()).toBe(true);
1013
1013
  },
1014
1014
  },
1015
1015
  {
1016
- name: 'manager.isDevelopment() is false during tests (testing takes precedence)',
1016
+ name: 'omega.isDevelopment() is false during tests (testing takes precedence)',
1017
1017
  run: (ctx) => {
1018
1018
  // The test runs unpackaged, but the lane named testing, so this is a
1019
1019
  // TEST environment, not development. isDevelopment() is therefore false.
1020
- ctx.expect(typeof ctx.manager.isDevelopment).toBe('function');
1021
- ctx.expect(ctx.manager.isDevelopment()).toBe(false);
1022
- ctx.expect(ctx.manager.isTesting()).toBe(true);
1020
+ ctx.expect(typeof ctx.omega.isDevelopment).toBe('function');
1021
+ ctx.expect(ctx.omega.isDevelopment()).toBe(false);
1022
+ ctx.expect(ctx.omega.isTesting()).toBe(true);
1023
1023
  },
1024
1024
  },
1025
1025
  {
1026
- name: 'manager environments are mutually exclusive (exactly one true)',
1026
+ name: 'omega environments are mutually exclusive (exactly one true)',
1027
1027
  run: (ctx) => {
1028
- const flags = [ctx.manager.isDevelopment(), ctx.manager.isTesting(), ctx.manager.isProduction()];
1028
+ const flags = [ctx.omega.isDevelopment(), ctx.omega.isTesting(), ctx.omega.isProduction()];
1029
1029
  ctx.expect(flags.filter(Boolean).length).toBe(1);
1030
- ctx.expect(ctx.manager.isProduction()).toBe(false);
1030
+ ctx.expect(ctx.omega.isProduction()).toBe(false);
1031
1031
  },
1032
1032
  },
1033
1033
  {
1034
1034
  name: 'auto-updater._idleThresholdMs() returns 3s in tests, 15min in prod',
1035
1035
  run: (ctx) => {
1036
- const u = ctx.manager.autoUpdater;
1037
- // Test mode currently active (manager.isTesting() === true).
1036
+ const u = ctx.omega.autoUpdater;
1037
+ // Test mode currently active (omega.isTesting() === true).
1038
1038
  ctx.expect(u._idleThresholdMs()).toBe(3000);
1039
1039
 
1040
- // Stub manager.isTesting() to simulate prod and verify the threshold flips.
1041
- const origIsTesting = ctx.manager.isTesting;
1042
- ctx.manager.isTesting = () => false;
1040
+ // Stub omega.isTesting() to simulate prod and verify the threshold flips.
1041
+ const origIsTesting = ctx.omega.isTesting;
1042
+ ctx.omega.isTesting = () => false;
1043
1043
  try {
1044
1044
  ctx.expect(u._idleThresholdMs()).toBe(15 * 60 * 1000);
1045
- } finally { ctx.manager.isTesting = origIsTesting; }
1045
+ } finally { ctx.omega.isTesting = origIsTesting; }
1046
1046
  },
1047
1047
  },
1048
1048
 
@@ -1052,7 +1052,7 @@ module.exports = defineCases({
1052
1052
  name: 'shutdown clears pending timers + interval + idle-install state',
1053
1053
  run: async (ctx) => {
1054
1054
  const restore = await reinit(ctx, {});
1055
- const u = ctx.manager.autoUpdater;
1055
+ const u = ctx.omega.autoUpdater;
1056
1056
  try {
1057
1057
  u._pendingTimers.push(setTimeout(() => {}, 1000000));
1058
1058
  u._promptedForVersion = '1.2.3';
@@ -1071,7 +1071,7 @@ module.exports = defineCases({
1071
1071
  {
1072
1072
  name: '_menuItemFieldsForState produces correct label per state',
1073
1073
  run: (ctx) => {
1074
- const u = ctx.manager.autoUpdater;
1074
+ const u = ctx.omega.autoUpdater;
1075
1075
  const cases = [
1076
1076
  ['idle', 'Check for Updates...', true],
1077
1077
  ['error', 'Check for Updates...', true],
@@ -1101,12 +1101,12 @@ module.exports = defineCases({
1101
1101
  {
1102
1102
  name: 'IPC: desktop:auto-updater:check-now invokes checkNow with userInitiated=true',
1103
1103
  run: async (ctx) => {
1104
- const u = ctx.manager.autoUpdater;
1104
+ const u = ctx.omega.autoUpdater;
1105
1105
  const origCheck = u.checkNow;
1106
1106
  let receivedOpts = null;
1107
1107
  u.checkNow = async (opts) => { receivedOpts = opts; return u.getStatus(); };
1108
1108
  try {
1109
- await ctx.manager.ipc.invoke('desktop:auto-updater:check-now');
1109
+ await ctx.omega.ipc.invoke('desktop:auto-updater:check-now');
1110
1110
  ctx.expect(receivedOpts).toBeDefined();
1111
1111
  ctx.expect(receivedOpts.userInitiated).toBe(true);
1112
1112
  } finally { u.checkNow = origCheck; }
@@ -1115,12 +1115,12 @@ module.exports = defineCases({
1115
1115
  {
1116
1116
  name: 'IPC: desktop:auto-updater:install-now invokes installNow',
1117
1117
  run: async (ctx) => {
1118
- const u = ctx.manager.autoUpdater;
1118
+ const u = ctx.omega.autoUpdater;
1119
1119
  const origInstall = u.installNow;
1120
1120
  let installCalled = false;
1121
1121
  u.installNow = async () => { installCalled = true; return false; };
1122
1122
  try {
1123
- await ctx.manager.ipc.invoke('desktop:auto-updater:install-now');
1123
+ await ctx.omega.ipc.invoke('desktop:auto-updater:install-now');
1124
1124
  ctx.expect(installCalled).toBe(true);
1125
1125
  } finally { u.installNow = origInstall; }
1126
1126
  },
@@ -1128,7 +1128,7 @@ module.exports = defineCases({
1128
1128
  {
1129
1129
  name: 'installNow: returns false when state is not "downloaded"',
1130
1130
  run: async (ctx) => {
1131
- const u = ctx.manager.autoUpdater;
1131
+ const u = ctx.omega.autoUpdater;
1132
1132
  u._state = { ...u._state, code: 'idle' };
1133
1133
  const r = await u.installNow();
1134
1134
  ctx.expect(r).toBe(false);