@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,117 +8,117 @@ module.exports = defineCases({
8
8
  layer: 'main',
9
9
  description: 'remote-scripts (main)',
10
10
  cleanup: (ctx) => {
11
- ctx.manager.remoteScripts.shutdown();
12
- ctx.manager.storage.set('remoteScripts.lastRun', null);
13
- ctx.manager.remoteScripts.initialize(ctx.manager);
11
+ ctx.omega.remoteScripts.shutdown();
12
+ ctx.omega.storage.set('remoteScripts.lastRun', null);
13
+ ctx.omega.remoteScripts.initialize(ctx.omega);
14
14
  },
15
15
  tests: [
16
16
  // ─── Boot wiring ────────────────────────────────────────────────────────
17
17
  {
18
- name: 'remoteScripts module wired on manager + initialized during boot',
18
+ name: 'remoteScripts module wired on omega + initialized during boot',
19
19
  run: (ctx) => {
20
- ctx.expect(ctx.manager.remoteScripts).toBeDefined();
21
- ctx.expect(ctx.manager.remoteScripts._initialized).toBe(true);
20
+ ctx.expect(ctx.omega.remoteScripts).toBeDefined();
21
+ ctx.expect(ctx.omega.remoteScripts._initialized).toBe(true);
22
22
  },
23
23
  },
24
24
  {
25
25
  name: 'off by default: no config.remoteScripts → lane disabled (no URL, no interval)',
26
26
  run: (ctx) => {
27
- ctx.manager.remoteScripts.shutdown();
28
- const orig = ctx.manager.config.remoteScripts;
29
- delete ctx.manager.config.remoteScripts;
27
+ ctx.omega.remoteScripts.shutdown();
28
+ const orig = ctx.omega.config.remoteScripts;
29
+ delete ctx.omega.config.remoteScripts;
30
30
  try {
31
- ctx.manager.remoteScripts.initialize(ctx.manager);
32
- ctx.expect(ctx.manager.remoteScripts._enabled).toBe(false);
33
- ctx.expect(ctx.manager.remoteScripts._url).toBe(null);
34
- ctx.expect(ctx.manager.remoteScripts._intervalId).toBe(null);
31
+ ctx.omega.remoteScripts.initialize(ctx.omega);
32
+ ctx.expect(ctx.omega.remoteScripts._enabled).toBe(false);
33
+ ctx.expect(ctx.omega.remoteScripts._url).toBe(null);
34
+ ctx.expect(ctx.omega.remoteScripts._intervalId).toBe(null);
35
35
  } finally {
36
- ctx.manager.remoteScripts.shutdown();
37
- ctx.manager.config.remoteScripts = orig;
38
- ctx.manager.remoteScripts.initialize(ctx.manager);
36
+ ctx.omega.remoteScripts.shutdown();
37
+ ctx.omega.config.remoteScripts = orig;
38
+ ctx.omega.remoteScripts.initialize(ctx.omega);
39
39
  }
40
40
  },
41
41
  },
42
42
  {
43
43
  name: 'opted in without explicit url: URL derived from brand.url + /data/scripts/main.js',
44
44
  run: (ctx) => {
45
- ctx.manager.remoteScripts.shutdown();
46
- const orig = ctx.manager.config.remoteScripts;
47
- const origBrandUrl = ctx.manager.config.brand.url;
45
+ ctx.omega.remoteScripts.shutdown();
46
+ const orig = ctx.omega.config.remoteScripts;
47
+ const origBrandUrl = ctx.omega.config.brand.url;
48
48
  // Synthetic loopback brand.url: initialize() fires a real refreshNow(),
49
49
  // and in a CONSUMER test run the real brand.url could serve a script
50
50
  // this lane would EXECUTE. Port 59987 is deliberately unlikely to listen.
51
- ctx.manager.config.brand.url = 'http://localhost:59987';
52
- ctx.manager.config.remoteScripts = { enabled: true };
51
+ ctx.omega.config.brand.url = 'http://localhost:59987';
52
+ ctx.omega.config.remoteScripts = { enabled: true };
53
53
  try {
54
- ctx.manager.remoteScripts.initialize(ctx.manager);
54
+ ctx.omega.remoteScripts.initialize(ctx.omega);
55
55
  // brand.url is set, so the URL must actually derive — a null here
56
56
  // would let the assertion pass vacuously.
57
- ctx.expect(ctx.manager.remoteScripts._url).toBe('http://localhost:59987/data/scripts/main.js');
57
+ ctx.expect(ctx.omega.remoteScripts._url).toBe('http://localhost:59987/data/scripts/main.js');
58
58
  } finally {
59
- ctx.manager.remoteScripts.shutdown();
60
- ctx.manager.config.remoteScripts = orig;
61
- ctx.manager.config.brand.url = origBrandUrl;
62
- ctx.manager.remoteScripts.initialize(ctx.manager);
59
+ ctx.omega.remoteScripts.shutdown();
60
+ ctx.omega.config.remoteScripts = orig;
61
+ ctx.omega.config.brand.url = origBrandUrl;
62
+ ctx.omega.remoteScripts.initialize(ctx.omega);
63
63
  }
64
64
  },
65
65
  },
66
66
  {
67
67
  name: 'URL override: config.remoteScripts.url wins over brand.url',
68
68
  run: (ctx) => {
69
- ctx.manager.remoteScripts.shutdown();
70
- const orig = ctx.manager.config.remoteScripts;
71
- ctx.manager.config.remoteScripts = { enabled: true, url: 'https://override.example/patch.js' };
69
+ ctx.omega.remoteScripts.shutdown();
70
+ const orig = ctx.omega.config.remoteScripts;
71
+ ctx.omega.config.remoteScripts = { enabled: true, url: 'https://override.example/patch.js' };
72
72
  try {
73
- ctx.manager.remoteScripts.initialize(ctx.manager);
74
- ctx.expect(ctx.manager.remoteScripts._url).toBe('https://override.example/patch.js');
73
+ ctx.omega.remoteScripts.initialize(ctx.omega);
74
+ ctx.expect(ctx.omega.remoteScripts._url).toBe('https://override.example/patch.js');
75
75
  } finally {
76
- ctx.manager.remoteScripts.shutdown();
77
- ctx.manager.config.remoteScripts = orig;
78
- ctx.manager.remoteScripts.initialize(ctx.manager);
76
+ ctx.omega.remoteScripts.shutdown();
77
+ ctx.omega.config.remoteScripts = orig;
78
+ ctx.omega.remoteScripts.initialize(ctx.omega);
79
79
  }
80
80
  },
81
81
  },
82
82
  {
83
83
  name: 'transport gate: non-https URL refused (lane disabled), loopback http allowed',
84
84
  run: (ctx) => {
85
- const orig = ctx.manager.config.remoteScripts;
85
+ const orig = ctx.omega.config.remoteScripts;
86
86
  try {
87
- ctx.manager.remoteScripts.shutdown();
88
- ctx.manager.config.remoteScripts = { enabled: true, url: 'http://insecure.example/patch.js' };
89
- ctx.manager.remoteScripts.initialize(ctx.manager);
90
- ctx.expect(ctx.manager.remoteScripts._url).toBe(null);
91
- ctx.expect(ctx.manager.remoteScripts._intervalId).toBe(null);
87
+ ctx.omega.remoteScripts.shutdown();
88
+ ctx.omega.config.remoteScripts = { enabled: true, url: 'http://insecure.example/patch.js' };
89
+ ctx.omega.remoteScripts.initialize(ctx.omega);
90
+ ctx.expect(ctx.omega.remoteScripts._url).toBe(null);
91
+ ctx.expect(ctx.omega.remoteScripts._intervalId).toBe(null);
92
92
 
93
93
  // Port 59987 is deliberately unlikely to be listening — initialize()
94
94
  // fires a real refreshNow(), and a live port (4000 = the web dev
95
95
  // server) would have its response body EXECUTED by this lane.
96
- ctx.manager.remoteScripts.shutdown();
97
- ctx.manager.config.remoteScripts = { enabled: true, url: 'http://localhost:59987/patch.js' };
98
- ctx.manager.remoteScripts.initialize(ctx.manager);
99
- ctx.expect(ctx.manager.remoteScripts._url).toBe('http://localhost:59987/patch.js');
96
+ ctx.omega.remoteScripts.shutdown();
97
+ ctx.omega.config.remoteScripts = { enabled: true, url: 'http://localhost:59987/patch.js' };
98
+ ctx.omega.remoteScripts.initialize(ctx.omega);
99
+ ctx.expect(ctx.omega.remoteScripts._url).toBe('http://localhost:59987/patch.js');
100
100
  } finally {
101
- ctx.manager.remoteScripts.shutdown();
102
- ctx.manager.config.remoteScripts = orig;
103
- ctx.manager.remoteScripts.initialize(ctx.manager);
101
+ ctx.omega.remoteScripts.shutdown();
102
+ ctx.omega.config.remoteScripts = orig;
103
+ ctx.omega.remoteScripts.initialize(ctx.omega);
104
104
  }
105
105
  },
106
106
  },
107
107
  {
108
108
  name: 'enabled=false: skip everything',
109
109
  run: (ctx) => {
110
- ctx.manager.remoteScripts.shutdown();
111
- const orig = ctx.manager.config.remoteScripts;
112
- ctx.manager.config.remoteScripts = { enabled: false };
110
+ ctx.omega.remoteScripts.shutdown();
111
+ const orig = ctx.omega.config.remoteScripts;
112
+ ctx.omega.config.remoteScripts = { enabled: false };
113
113
  try {
114
- ctx.manager.remoteScripts.initialize(ctx.manager);
115
- ctx.expect(ctx.manager.remoteScripts._enabled).toBe(false);
116
- ctx.expect(ctx.manager.remoteScripts._url).toBe(null);
117
- ctx.expect(ctx.manager.remoteScripts._intervalId).toBe(null);
114
+ ctx.omega.remoteScripts.initialize(ctx.omega);
115
+ ctx.expect(ctx.omega.remoteScripts._enabled).toBe(false);
116
+ ctx.expect(ctx.omega.remoteScripts._url).toBe(null);
117
+ ctx.expect(ctx.omega.remoteScripts._intervalId).toBe(null);
118
118
  } finally {
119
- ctx.manager.remoteScripts.shutdown();
120
- ctx.manager.config.remoteScripts = orig;
121
- ctx.manager.remoteScripts.initialize(ctx.manager);
119
+ ctx.omega.remoteScripts.shutdown();
120
+ ctx.omega.config.remoteScripts = orig;
121
+ ctx.omega.remoteScripts.initialize(ctx.omega);
122
122
  }
123
123
  },
124
124
  },
@@ -127,9 +127,9 @@ module.exports = defineCases({
127
127
  {
128
128
  name: '_hash: stable — same input produces same 16-char hex',
129
129
  run: (ctx) => {
130
- const rs = ctx.manager.remoteScripts;
131
- const h1 = rs._hash('manager.storage.delete("x");');
132
- const h2 = rs._hash('manager.storage.delete("x");');
130
+ const rs = ctx.omega.remoteScripts;
131
+ const h1 = rs._hash('omega.storage.delete("x");');
132
+ const h2 = rs._hash('omega.storage.delete("x");');
133
133
  ctx.expect(h1).toBe(h2);
134
134
  ctx.expect(typeof h1).toBe('string');
135
135
  ctx.expect(h1.length).toBe(16);
@@ -138,41 +138,41 @@ module.exports = defineCases({
138
138
  {
139
139
  name: '_hash: different input produces different hash',
140
140
  run: (ctx) => {
141
- const rs = ctx.manager.remoteScripts;
141
+ const rs = ctx.omega.remoteScripts;
142
142
  ctx.expect(rs._hash('script v1')).not.toBe(rs._hash('script v2'));
143
143
  },
144
144
  },
145
145
 
146
146
  // ─── Execution ──────────────────────────────────────────────────────────
147
147
  {
148
- name: '_execute: runs code with manager in scope',
148
+ name: '_execute: runs code with omega in scope',
149
149
  run: async (ctx) => {
150
- ctx.manager._remoteScriptTestResult = null;
151
- await ctx.manager.remoteScripts._execute('manager._remoteScriptTestResult = 42;');
152
- ctx.expect(ctx.manager._remoteScriptTestResult).toBe(42);
153
- delete ctx.manager._remoteScriptTestResult;
150
+ ctx.omega._remoteScriptTestResult = null;
151
+ await ctx.omega.remoteScripts._execute('omega._remoteScriptTestResult = 42;');
152
+ ctx.expect(ctx.omega._remoteScriptTestResult).toBe(42);
153
+ delete ctx.omega._remoteScriptTestResult;
154
154
  },
155
155
  },
156
156
  {
157
157
  name: '_execute: supports async code (await)',
158
158
  run: async (ctx) => {
159
- ctx.manager._remoteScriptTestResult = null;
160
- await ctx.manager.remoteScripts._execute(
161
- 'const v = await Promise.resolve(99); manager._remoteScriptTestResult = v;',
159
+ ctx.omega._remoteScriptTestResult = null;
160
+ await ctx.omega.remoteScripts._execute(
161
+ 'const v = await Promise.resolve(99); omega._remoteScriptTestResult = v;',
162
162
  );
163
- ctx.expect(ctx.manager._remoteScriptTestResult).toBe(99);
164
- delete ctx.manager._remoteScriptTestResult;
163
+ ctx.expect(ctx.omega._remoteScriptTestResult).toBe(99);
164
+ delete ctx.omega._remoteScriptTestResult;
165
165
  },
166
166
  },
167
167
  {
168
168
  name: '_execute: require is available (e.g. require("path"))',
169
169
  run: async (ctx) => {
170
- ctx.manager._remoteScriptTestResult = null;
171
- await ctx.manager.remoteScripts._execute(
172
- 'const path = require("path"); manager._remoteScriptTestResult = typeof path.join;',
170
+ ctx.omega._remoteScriptTestResult = null;
171
+ await ctx.omega.remoteScripts._execute(
172
+ 'const path = require("path"); omega._remoteScriptTestResult = typeof path.join;',
173
173
  );
174
- ctx.expect(ctx.manager._remoteScriptTestResult).toBe('function');
175
- delete ctx.manager._remoteScriptTestResult;
174
+ ctx.expect(ctx.omega._remoteScriptTestResult).toBe('function');
175
+ delete ctx.omega._remoteScriptTestResult;
176
176
  },
177
177
  },
178
178
  {
@@ -180,7 +180,7 @@ module.exports = defineCases({
180
180
  run: async (ctx) => {
181
181
  let threw = false;
182
182
  try {
183
- await ctx.manager.remoteScripts._execute('throw new Error("boom");');
183
+ await ctx.omega.remoteScripts._execute('throw new Error("boom");');
184
184
  } catch (e) {
185
185
  threw = true;
186
186
  ctx.expect(e.message).toBe('boom');
@@ -193,33 +193,33 @@ module.exports = defineCases({
193
193
  {
194
194
  name: 'getLastRun returns null when no script has run',
195
195
  run: (ctx) => {
196
- ctx.manager.storage.set('remoteScripts.lastRun', null);
197
- ctx.expect(ctx.manager.remoteScripts.getLastRun()).toBe(null);
196
+ ctx.omega.storage.set('remoteScripts.lastRun', null);
197
+ ctx.expect(ctx.omega.remoteScripts.getLastRun()).toBe(null);
198
198
  },
199
199
  },
200
200
  {
201
201
  name: 'clearExecuted wipes stored hash',
202
202
  run: (ctx) => {
203
- ctx.manager.storage.set('remoteScripts.lastRun', { hash: 'abc', timestamp: 1 });
204
- ctx.expect(ctx.manager.remoteScripts.getLastRun()).toEqual({ hash: 'abc', timestamp: 1 });
205
- ctx.manager.remoteScripts.clearExecuted();
206
- ctx.expect(ctx.manager.remoteScripts.getLastRun()).toBe(null);
203
+ ctx.omega.storage.set('remoteScripts.lastRun', { hash: 'abc', timestamp: 1 });
204
+ ctx.expect(ctx.omega.remoteScripts.getLastRun()).toEqual({ hash: 'abc', timestamp: 1 });
205
+ ctx.omega.remoteScripts.clearExecuted();
206
+ ctx.expect(ctx.omega.remoteScripts.getLastRun()).toBe(null);
207
207
  },
208
208
  },
209
209
  {
210
210
  name: 'refreshNow returns null when disabled',
211
211
  run: async (ctx) => {
212
- ctx.manager.remoteScripts.shutdown();
213
- const orig = ctx.manager.config.remoteScripts;
214
- ctx.manager.config.remoteScripts = { enabled: false };
212
+ ctx.omega.remoteScripts.shutdown();
213
+ const orig = ctx.omega.config.remoteScripts;
214
+ ctx.omega.config.remoteScripts = { enabled: false };
215
215
  try {
216
- ctx.manager.remoteScripts.initialize(ctx.manager);
217
- const result = await ctx.manager.remoteScripts.refreshNow();
216
+ ctx.omega.remoteScripts.initialize(ctx.omega);
217
+ const result = await ctx.omega.remoteScripts.refreshNow();
218
218
  ctx.expect(result).toBe(null);
219
219
  } finally {
220
- ctx.manager.remoteScripts.shutdown();
221
- ctx.manager.config.remoteScripts = orig;
222
- ctx.manager.remoteScripts.initialize(ctx.manager);
220
+ ctx.omega.remoteScripts.shutdown();
221
+ ctx.omega.config.remoteScripts = orig;
222
+ ctx.omega.remoteScripts.initialize(ctx.omega);
223
223
  }
224
224
  },
225
225
  },
@@ -227,18 +227,18 @@ module.exports = defineCases({
227
227
  {
228
228
  name: 'full pipeline: execute script → storage patched → hash stored → same script skipped → changed script re-runs',
229
229
  run: async (ctx) => {
230
- const rs = ctx.manager.remoteScripts;
230
+ const rs = ctx.omega.remoteScripts;
231
231
  rs.clearExecuted();
232
232
 
233
- const scriptV1 = 'manager.storage.set("remoteScripts._test.patched", true);';
234
- const scriptV2 = 'manager.storage.set("remoteScripts._test.patched", "v2");';
233
+ const scriptV1 = 'omega.storage.set("remoteScripts._test.patched", true);';
234
+ const scriptV2 = 'omega.storage.set("remoteScripts._test.patched", "v2");';
235
235
 
236
236
  // 1. Execute v1 — should patch storage
237
237
  await rs._execute(scriptV1);
238
238
  const hashV1 = rs._hash(scriptV1);
239
- ctx.manager.storage.set('remoteScripts.lastRun', { hash: hashV1, timestamp: Date.now() });
239
+ ctx.omega.storage.set('remoteScripts.lastRun', { hash: hashV1, timestamp: Date.now() });
240
240
 
241
- ctx.expect(ctx.manager.storage.get('remoteScripts._test.patched')).toBe(true);
241
+ ctx.expect(ctx.omega.storage.get('remoteScripts._test.patched')).toBe(true);
242
242
  ctx.expect(rs.getLastRun().hash).toBe(hashV1);
243
243
 
244
244
  // 2. Same script again — hash matches, should be skipped
@@ -251,25 +251,25 @@ module.exports = defineCases({
251
251
  ctx.expect(hashV2).not.toBe(hashV1); // proves the hash changes
252
252
 
253
253
  await rs._execute(scriptV2);
254
- ctx.expect(ctx.manager.storage.get('remoteScripts._test.patched')).toBe('v2');
254
+ ctx.expect(ctx.omega.storage.get('remoteScripts._test.patched')).toBe('v2');
255
255
 
256
256
  // Cleanup
257
- ctx.manager.storage.delete('remoteScripts._test.patched');
257
+ ctx.omega.storage.delete('remoteScripts._test.patched');
258
258
  },
259
259
  },
260
260
 
261
261
  {
262
262
  name: 'shutdown resets all internal state',
263
263
  run: (ctx) => {
264
- ctx.manager.remoteScripts.shutdown();
265
- const rs = ctx.manager.remoteScripts;
264
+ ctx.omega.remoteScripts.shutdown();
265
+ const rs = ctx.omega.remoteScripts;
266
266
  ctx.expect(rs._initialized).toBe(false);
267
- ctx.expect(rs._manager).toBe(null);
267
+ ctx.expect(rs._omega).toBe(null);
268
268
  ctx.expect(rs._url).toBe(null);
269
269
  ctx.expect(rs._enabled).toBe(false);
270
270
  ctx.expect(rs._intervalId).toBe(null);
271
271
  // Re-init for cleanup handler
272
- rs.initialize(ctx.manager);
272
+ rs.initialize(ctx.omega);
273
273
  },
274
274
  },
275
275
  ],
@@ -0,0 +1,71 @@
1
+ // Main-process tests for `omega.request()`: the harmonized API fetch, built once
2
+ // on the instance through @omega.js/client's createRequest, the extension
3
+ // background's shape ([#945](https://github.com/Omega-JS-Stack/omega/issues/945)).
4
+ //
5
+ // The API is a real local HTTP server; the one seam is main's Firebase session
6
+ // (`omega.auth._firebaseAuth`), because a real signed-in session needs the auth
7
+ // emulator, which the e2e-desktop lane drives.
8
+
9
+ const http = require('http');
10
+ const defineCases = require('../../../vendor/devkit/test/define-cases.js');
11
+
12
+ // A local API that records what reaches it and answers `{ ok: true }`
13
+ async function startApi() {
14
+ const received = [];
15
+ const server = http.createServer((req, res) => {
16
+ let body = '';
17
+ req.on('data', (chunk) => { body += chunk; });
18
+ req.on('end', () => {
19
+ received.push({ method: req.method, url: req.url, authorization: req.headers.authorization, body });
20
+ res.writeHead(200, { 'Content-Type': 'application/json' });
21
+ res.end(JSON.stringify({ ok: true }));
22
+ });
23
+ });
24
+ await new Promise((resolve) => server.listen(0, resolve));
25
+ return { port: server.address().port, received, close: () => new Promise((resolve) => server.close(resolve)) };
26
+ }
27
+
28
+ module.exports = defineCases({
29
+ type: 'suite',
30
+ layer: 'main',
31
+ description: 'omega.request (main)',
32
+ tests: [
33
+ {
34
+ name: 'omega.request posts with the token omega.auth.getIdToken returns; signed out, getIdToken is null',
35
+ run: async (ctx) => {
36
+ const auth = ctx.omega.auth;
37
+ const api = await startApi();
38
+ const saved = {
39
+ firebaseAuth: auth._firebaseAuth,
40
+ https: process.env.OMEGA_HTTPS_PORT,
41
+ hosting: process.env.OMEGA_HOSTING_PORT,
42
+ };
43
+
44
+ try {
45
+ auth._firebaseAuth = { currentUser: { getIdToken: async () => 'token-1' } };
46
+ ctx.expect(await auth.getIdToken()).toBe('token-1');
47
+
48
+ // The API base is read as the call starts: the local stack, here this server
49
+ delete process.env.OMEGA_HTTPS_PORT;
50
+ process.env.OMEGA_HOSTING_PORT = String(api.port);
51
+ const answer = await ctx.omega.request('/notes', { method: 'POST', body: { text: 'hi' } });
52
+
53
+ ctx.expect(answer).toEqual({ ok: true });
54
+ ctx.expect(api.received).toEqual([{ method: 'POST', url: '/notes', authorization: 'Bearer token-1', body: '{"text":"hi"}' }]);
55
+
56
+ auth._firebaseAuth = { currentUser: null };
57
+ ctx.expect(await auth.getIdToken()).toBeNull();
58
+ auth._firebaseAuth = null;
59
+ ctx.expect(await auth.getIdToken()).toBeNull();
60
+ } finally {
61
+ auth._firebaseAuth = saved.firebaseAuth;
62
+ if (saved.https === undefined) delete process.env.OMEGA_HTTPS_PORT;
63
+ else process.env.OMEGA_HTTPS_PORT = saved.https;
64
+ if (saved.hosting === undefined) delete process.env.OMEGA_HOSTING_PORT;
65
+ else process.env.OMEGA_HOSTING_PORT = saved.hosting;
66
+ await api.close();
67
+ }
68
+ },
69
+ },
70
+ ],
71
+ });
@@ -85,14 +85,14 @@ module.exports = defineCases({
85
85
  description: 'restart-manager (main)',
86
86
  cleanup: async (ctx) => {
87
87
  if (ctx.state.rm) ctx.state.rm.server.close();
88
- ctx.manager.restartManager.shutdown();
89
- ctx.manager.restartManager.initialize(ctx.manager);
88
+ ctx.omega.restartManager.shutdown();
89
+ ctx.omega.restartManager.initialize(ctx.omega);
90
90
  },
91
91
  tests: [
92
92
  {
93
- name: 'wired on manager with the full v2 API surface',
93
+ name: 'wired on omega with the full v2 API surface',
94
94
  run: (ctx) => {
95
- const rm = ctx.manager.restartManager;
95
+ const rm = ctx.omega.restartManager;
96
96
  ctx.expect(rm).toBeDefined();
97
97
  for (const fn of ['register', 'unregister', 'ensureInstalled', 'ensureRunning', 'getStatus', 'shutdown']) {
98
98
  ctx.expect(typeof rm[fn]).toBe('function');
@@ -102,7 +102,7 @@ module.exports = defineCases({
102
102
  {
103
103
  name: 'testing bail: bailed with reason, no timer, no before-quit hook',
104
104
  run: (ctx) => {
105
- const rm = ctx.manager.restartManager;
105
+ const rm = ctx.omega.restartManager;
106
106
  const status = rm.getStatus();
107
107
  ctx.expect(status.bailed).toBe(true);
108
108
  ctx.expect(status.bailReason).toBe('testing');
@@ -114,7 +114,7 @@ module.exports = defineCases({
114
114
  name: 'testing-root isolation: _root lives under the (Testing) userData, never appData',
115
115
  run: (ctx) => {
116
116
  const { app } = require('electron');
117
- const rm = ctx.manager.restartManager;
117
+ const rm = ctx.omega.restartManager;
118
118
  ctx.expect(rm._root.startsWith(app.getPath('userData'))).toBe(true);
119
119
  ctx.expect(rm._root).not.toBe(protocol.resolveSharedRoot(app.getPath('appData'), {}));
120
120
  },
@@ -122,38 +122,38 @@ module.exports = defineCases({
122
122
  {
123
123
  name: 'enabled=false bail (reason disabled, no timer)',
124
124
  run: (ctx) => {
125
- const rm = ctx.manager.restartManager;
125
+ const rm = ctx.omega.restartManager;
126
126
  rm.shutdown();
127
- const orig = ctx.manager.config.restartManager;
128
- ctx.manager.config.restartManager = { enabled: false };
127
+ const orig = ctx.omega.config.restartManager;
128
+ ctx.omega.config.restartManager = { enabled: false };
129
129
  try {
130
- rm.initialize(ctx.manager);
130
+ rm.initialize(ctx.omega);
131
131
  // Testing bail fires first in the harness, so force-evaluate the
132
132
  // config path: _enabled captured false proves the knob was read.
133
133
  ctx.expect(rm._enabled).toBe(false);
134
134
  ctx.expect(rm._registerTimer).toBe(null);
135
135
  } finally {
136
136
  rm.shutdown();
137
- ctx.manager.config.restartManager = orig;
138
- rm.initialize(ctx.manager);
137
+ ctx.omega.config.restartManager = orig;
138
+ rm.initialize(ctx.omega);
139
139
  }
140
140
  },
141
141
  },
142
142
  {
143
143
  name: 'brand.id === "restart-manager" bail (RM does not manage itself)',
144
144
  run: (ctx) => {
145
- const rm = ctx.manager.restartManager;
145
+ const rm = ctx.omega.restartManager;
146
146
  rm.shutdown();
147
- const origBrand = ctx.manager.config.brand;
148
- ctx.manager.config.brand = { ...origBrand, id: 'restart-manager' };
147
+ const origBrand = ctx.omega.config.brand;
148
+ ctx.omega.config.brand = { ...origBrand, id: 'restart-manager' };
149
149
  try {
150
- rm.initialize(ctx.manager);
150
+ rm.initialize(ctx.omega);
151
151
  ctx.expect(rm._registerTimer).toBe(null);
152
152
  ctx.expect(rm.getStatus().bailed).toBe(true);
153
153
  } finally {
154
154
  rm.shutdown();
155
- ctx.manager.config.brand = origBrand;
156
- rm.initialize(ctx.manager);
155
+ ctx.omega.config.brand = origBrand;
156
+ rm.initialize(ctx.omega);
157
157
  }
158
158
  },
159
159
  },
@@ -161,14 +161,14 @@ module.exports = defineCases({
161
161
  name: 'non-production without OMEGA_RESTART_MANAGER_DEV: nothing scheduled',
162
162
  run: (ctx) => {
163
163
  ctx.expect(process.env.OMEGA_RESTART_MANAGER_DEV).not.toBe('1');
164
- ctx.expect(ctx.manager.isProduction()).toBe(false);
165
- ctx.expect(ctx.manager.restartManager._registerTimer).toBe(null);
164
+ ctx.expect(ctx.omega.isProduction()).toBe(false);
165
+ ctx.expect(ctx.omega.restartManager._registerTimer).toBe(null);
166
166
  },
167
167
  },
168
168
  {
169
169
  name: '_readRuntime: valid file parses; wrong version / malformed / missing → null',
170
170
  run: (ctx) => {
171
- const rm = ctx.manager.restartManager;
171
+ const rm = ctx.omega.restartManager;
172
172
  const runtimePath = protocol.getRuntimePath(rm._root);
173
173
 
174
174
  writeRuntime(rm._root, 4000);
@@ -189,7 +189,7 @@ module.exports = defineCases({
189
189
  {
190
190
  name: '_pidAlive: own pid alive, absurd pid dead',
191
191
  run: (ctx) => {
192
- const rm = ctx.manager.restartManager;
192
+ const rm = ctx.omega.restartManager;
193
193
  ctx.expect(rm._pidAlive(process.pid)).toBe(true);
194
194
  ctx.expect(rm._pidAlive(999999)).toBe(false);
195
195
  },
@@ -197,14 +197,14 @@ module.exports = defineCases({
197
197
  {
198
198
  name: 'register round-trip: contract-valid payload lands, pid is ours, status flips',
199
199
  run: async (ctx) => {
200
- const rm = ctx.manager.restartManager;
200
+ const rm = ctx.omega.restartManager;
201
201
  ctx.state.rm = await startContractServer();
202
202
  writeRuntime(rm._root, ctx.state.rm.port);
203
203
 
204
204
  const ok = await rm.register();
205
205
  ctx.expect(ok).toBe(true);
206
206
 
207
- const appId = ctx.manager.config.brand.id;
207
+ const appId = ctx.omega.config.brand.id;
208
208
  const stored = ctx.state.rm.apps.get(appId);
209
209
  ctx.expect(stored).toBeDefined();
210
210
  ctx.expect(stored.pid).toBe(process.pid);
@@ -219,7 +219,7 @@ module.exports = defineCases({
219
219
  {
220
220
  name: 'heartbeat: idempotent upsert (1 app, request count climbs), timestamp advances',
221
221
  run: async (ctx) => {
222
- const rm = ctx.manager.restartManager;
222
+ const rm = ctx.omega.restartManager;
223
223
  const before = ctx.state.rm.counts.register;
224
224
 
225
225
  await rm._heartbeatTick();
@@ -233,7 +233,7 @@ module.exports = defineCases({
233
233
  {
234
234
  name: 'quit flush: capped deregister lands under the 1s budget',
235
235
  run: async (ctx) => {
236
- const rm = ctx.manager.restartManager;
236
+ const rm = ctx.omega.restartManager;
237
237
  const started = Date.now();
238
238
  await rm._quitFlush();
239
239
  ctx.expect(Date.now() - started).toBeLessThan(1000 + 250);
@@ -245,9 +245,9 @@ module.exports = defineCases({
245
245
  name: '_handleBeforeQuit: not-registered path returns without touching the event',
246
246
  run: (ctx) => {
247
247
  // Only the safe branch is drivable in the harness (the flush branch ends
248
- // in manager.quit which would kill the test Electron). _quitFlush itself
248
+ // in omega.quit which would kill the test Electron). _quitFlush itself
249
249
  // is proven above.
250
- const rm = ctx.manager.restartManager;
250
+ const rm = ctx.omega.restartManager;
251
251
  rm._registered = false;
252
252
  rm._quitFlushed = false;
253
253
  let prevented = false;
@@ -258,7 +258,7 @@ module.exports = defineCases({
258
258
  {
259
259
  name: 'deregister round-trip: fixture saw { id, pid }',
260
260
  run: async (ctx) => {
261
- const rm = ctx.manager.restartManager;
261
+ const rm = ctx.omega.restartManager;
262
262
  await rm.register();
263
263
  ctx.expect(ctx.state.rm.apps.size).toBe(1);
264
264
 
@@ -271,7 +271,7 @@ module.exports = defineCases({
271
271
  {
272
272
  name: 'dead server: register resolves false, lastError set, no spawn in testing',
273
273
  run: async (ctx) => {
274
- const rm = ctx.manager.restartManager;
274
+ const rm = ctx.omega.restartManager;
275
275
  // Grab a port that WAS listening and now is not.
276
276
  const throwaway = await startContractServer();
277
277
  const deadPort = throwaway.port;
@@ -286,7 +286,7 @@ module.exports = defineCases({
286
286
  {
287
287
  name: 'smart existence: installed app on disk short-circuits before any network',
288
288
  run: async (ctx) => {
289
- const rm = ctx.manager.restartManager;
289
+ const rm = ctx.omega.restartManager;
290
290
  const appPath = protocol.getInstalledAppPath(rm._root, process.platform);
291
291
  fs.mkdirSync(appPath, { recursive: true });
292
292
  try {
@@ -301,7 +301,7 @@ module.exports = defineCases({
301
301
  {
302
302
  name: 'not installed in testing: ensureInstalled refuses network and returns false',
303
303
  run: async (ctx) => {
304
- const rm = ctx.manager.restartManager;
304
+ const rm = ctx.omega.restartManager;
305
305
  if (process.env.TEST_EXTENDED_MODE) return ctx.skip('extended mode allows the real download');
306
306
  const ok = await rm.ensureInstalled();
307
307
  ctx.expect(ok).toBe(false);
@@ -312,7 +312,7 @@ module.exports = defineCases({
312
312
  run: async (ctx) => {
313
313
  if (!process.env.TEST_EXTENDED_MODE) return ctx.skip('requires TEST_EXTENDED_MODE (live GitHub)');
314
314
  const install = require('../../../lib/restart-manager/install.js');
315
- const rm = ctx.manager.restartManager;
315
+ const rm = ctx.omega.restartManager;
316
316
  try {
317
317
  const feed = await install.fetchFeed(rm._feed, process.platform);
318
318
  const artifact = install.pickArtifact(feed, process.platform, process.arch);