local-operator-ui 0.57.3 → 0.57.4

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 (94) hide show
  1. package/out/main/index.js +669 -17
  2. package/out/preload/index.js +56 -1
  3. package/out/renderer/assets/{_basePickBy-BeAzmqgq.js → _basePickBy-CqOK9I5a.js} +1 -1
  4. package/out/renderer/assets/{_baseUniq-Clx9gdFs.js → _baseUniq-Dfknltze.js} +1 -1
  5. package/out/renderer/assets/{agent-details-page-BMztNR89.js → agent-details-page-DKOAeAlz.js} +1 -1
  6. package/out/renderer/assets/{agent-hub-page-quUNNwcr.js → agent-hub-page-D75ZCD-T.js} +1 -1
  7. package/out/renderer/assets/{agents-page-BTYHgMAf.js → agents-page-Dy9dT2J6.js} +3 -3
  8. package/out/renderer/assets/{appearance-DCqlsN7S.js → appearance-RPtl24uV.js} +1 -1
  9. package/out/renderer/assets/{arc-BOZHzyJm.js → arc-CJgGs8E0.js} +1 -1
  10. package/out/renderer/assets/{architectureDiagram-IEHRJDOE-CpE8Siol.js → architectureDiagram-IEHRJDOE-BO-PVfmy.js} +1 -1
  11. package/out/renderer/assets/{avatar-cropper-BWJE7j7A.js → avatar-cropper-IPFrNOZH.js} +1 -1
  12. package/out/renderer/assets/{blockDiagram-JOT3LUYC-D4LTtQ_H.js → blockDiagram-JOT3LUYC-D4kISdJw.js} +1 -1
  13. package/out/renderer/assets/{book-open-fa_DaJBq.js → book-open-DSEz_hQQ.js} +1 -1
  14. package/out/renderer/assets/browser-page-4rUf9E5f.js +1 -0
  15. package/out/renderer/assets/{browser-webauthn-prompt-VC7pNm9O.js → browser-webauthn-prompt-DUTEBHSl.js} +1 -1
  16. package/out/renderer/assets/{c4Diagram-VJAJSXHY-DRtUDXOF.js → c4Diagram-VJAJSXHY-jrrji_Tt.js} +1 -1
  17. package/out/renderer/assets/channel-DSbKlaIM.js +1 -0
  18. package/out/renderer/assets/{chunk-4BMEZGHF-Cw4VudrA.js → chunk-4BMEZGHF-34jCJWgL.js} +1 -1
  19. package/out/renderer/assets/{chunk-A2AXSNBT-0JOiKMb-.js → chunk-A2AXSNBT-D2utPfjC.js} +1 -1
  20. package/out/renderer/assets/{chunk-AEK57VVT-CAKCg9DA.js → chunk-AEK57VVT-Chv6UTYK.js} +1 -1
  21. package/out/renderer/assets/{chunk-D6G4REZN-CFZ2DTGX.js → chunk-D6G4REZN-8au1oDUE.js} +1 -1
  22. package/out/renderer/assets/{chunk-RZ5BOZE2-CupwUHva.js → chunk-RZ5BOZE2-DCRrSym3.js} +1 -1
  23. package/out/renderer/assets/{chunk-XZIHB7SX-B1vcbFku.js → chunk-XZIHB7SX-BFp6lbut.js} +1 -1
  24. package/out/renderer/assets/classDiagram-GIVACNV2-B3UBTKI6.js +1 -0
  25. package/out/renderer/assets/classDiagram-v2-COTLJTTW-B3UBTKI6.js +1 -0
  26. package/out/renderer/assets/clone-CI0Pk6Pw.js +1 -0
  27. package/out/renderer/assets/{console-mirror-IB35kNI8.js → console-mirror-COvJr604.js} +1 -1
  28. package/out/renderer/assets/{consoleCapture-D4G96kDb.js → consoleCapture-Cl0JWwqq.js} +1 -1
  29. package/out/renderer/assets/{conversation-input-sync-DlorrZ6B.js → conversation-input-sync-bGjigx3Z.js} +4 -4
  30. package/out/renderer/assets/{dagre-OKDRZEBW-CunvCCGM.js → dagre-OKDRZEBW-WWu0Yua1.js} +1 -1
  31. package/out/renderer/assets/{diagram-SSKATNLV-DlpXMePq.js → diagram-SSKATNLV-CS9Mvsr2.js} +1 -1
  32. package/out/renderer/assets/{diagram-VNBRO52H-CtgMK6MT.js → diagram-VNBRO52H-qqdP8fjP.js} +1 -1
  33. package/out/renderer/assets/{erDiagram-Q7BY3M3F-C-QNezLB.js → erDiagram-Q7BY3M3F-Dcxo6XZi.js} +1 -1
  34. package/out/renderer/assets/{error-boundary-C1x5W-AX.js → error-boundary-BQ911DnY.js} +1 -1
  35. package/out/renderer/assets/{flowDiagram-4HSFHLVR-DjwRYw0E.js → flowDiagram-4HSFHLVR-CrxBDmsr.js} +1 -1
  36. package/out/renderer/assets/{ganttDiagram-APWFNJXF-Tb5F1KXD.js → ganttDiagram-APWFNJXF-Bx-sfLxO.js} +1 -1
  37. package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-BokP9Y1T.js → gitGraphDiagram-7IBYFJ6S-CJxWCbNe.js} +1 -1
  38. package/out/renderer/assets/{graph-DEHYXN6b.js → graph-BNSj1GHJ.js} +1 -1
  39. package/out/renderer/assets/{heart-DqMMtrJ1.js → heart-i91yzAwW.js} +1 -1
  40. package/out/renderer/assets/{index-BnqyWEPM.css → index-BlC0KBYH.css} +1 -1
  41. package/out/renderer/assets/{index-CJ8BPUHQ.js → index-BvbUVrcK.js} +1 -1
  42. package/out/renderer/assets/{index-D7fnBkIK.js → index-BxFcVHbG.js} +1 -1
  43. package/out/renderer/assets/index-CdTxr8VM.js +852 -0
  44. package/out/renderer/assets/{index-BWQzFq0n.js → index-CxNjWpOb.js} +10 -10
  45. package/out/renderer/assets/infoDiagram-PH2N3AL5-PsB_DDDA.js +2 -0
  46. package/out/renderer/assets/{inline-error-boundary-ChbTvdIh.js → inline-error-boundary-CEz9_z6I.js} +1 -1
  47. package/out/renderer/assets/{installer-Bplg-bpo.js → installer-G-5Vi1J-.js} +1 -1
  48. package/out/renderer/assets/{journeyDiagram-U35MCT3I-BfXoBW-2.js → journeyDiagram-U35MCT3I-DoNy_9X6.js} +1 -1
  49. package/out/renderer/assets/{kanban-definition-NDS4AKOZ-BeT3LOJG.js → kanban-definition-NDS4AKOZ-DdvklVql.js} +1 -1
  50. package/out/renderer/assets/{layout-B71SsWep.js → layout-qfLIC44U.js} +1 -1
  51. package/out/renderer/assets/{legacy-agents-page-BaSX_kru.js → legacy-agents-page-vNWqLnJO.js} +1 -1
  52. package/out/renderer/assets/{library-page-BwmVBhNJ.js → library-page-CsKdpZoN.js} +3 -3
  53. package/out/renderer/assets/{log-in-C4tjIXzF.js → log-in-ge87dxtE.js} +1 -1
  54. package/out/renderer/assets/{mermaid.core-D7wfsRjY.js → mermaid.core-34ehUt9F.js} +5 -5
  55. package/out/renderer/assets/{mesh-page-DbC0RmVo.js → mesh-page-Drazw6sy.js} +1 -1
  56. package/out/renderer/assets/{mindmap-definition-ALO5MXBD-BPTOzHuL.js → mindmap-definition-ALO5MXBD-DS9A7X_9.js} +1 -1
  57. package/out/renderer/assets/{mini-DXMqE-0u.js → mini-CiYAeR9E.js} +1 -1
  58. package/out/renderer/assets/{notebook-pen-CQdB2BC5.js → notebook-pen-6_thWw32.js} +1 -1
  59. package/out/renderer/assets/{notifications-page-C9PU2typ.js → notifications-page-B9lBzyI_.js} +1 -1
  60. package/out/renderer/assets/{org-access-Fw38H9fZ.js → org-access-LWjiDIPH.js} +1 -1
  61. package/out/renderer/assets/{org-surface-gate-CKBjFWJL.js → org-surface-gate-DGeVPoHg.js} +1 -1
  62. package/out/renderer/assets/{page-header-CAW9G_fb.js → page-header-DsXvFR6j.js} +1 -1
  63. package/out/renderer/assets/{pieDiagram-IB7DONF6-C0JN0KMq.js → pieDiagram-IB7DONF6-BzNpgGTh.js} +1 -1
  64. package/out/renderer/assets/{projects-page-D9F4QotN.js → projects-page-BJV0JVfL.js} +1 -1
  65. package/out/renderer/assets/{publication-validation-DygSOQkj.js → publication-validation-BIxxMtE8.js} +1 -1
  66. package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-BRgjFQlM.js → quadrantDiagram-7GDLP6J5-BGFLFl2M.js} +1 -1
  67. package/out/renderer/assets/{radar-MK3ICKWK-VE0niGVF.js → radar-MK3ICKWK-QP0xpCZj.js} +1 -1
  68. package/out/renderer/assets/{radient-auth-buttons-CXMLVkUO.js → radient-auth-buttons-GwvFtoOd.js} +1 -1
  69. package/out/renderer/assets/{requirementDiagram-KVF5MWMF-DkwJBmMi.js → requirementDiagram-KVF5MWMF-d1hwIQYi.js} +1 -1
  70. package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-DFv3zh8B.js → sankeyDiagram-QLVOVGJD-Bel2U3qO.js} +1 -1
  71. package/out/renderer/assets/{schedules-page-aTbxrD_M.js → schedules-page-CJV3Oiiy.js} +1 -1
  72. package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-BXcr3er8.js → sequenceDiagram-X6HHIX6F-Et2XMzpI.js} +1 -1
  73. package/out/renderer/assets/{settings-page-DWZ3Mguh.js → settings-page-sfk5JVcx.js} +1 -1
  74. package/out/renderer/assets/{smartart-CWBh1X_F.js → smartart-Csc0zQan.js} +1 -1
  75. package/out/renderer/assets/{stateDiagram-DGXRK772-Cw08neDd.js → stateDiagram-DGXRK772-D2GwxW6w.js} +1 -1
  76. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-BHUZ7x6j.js +1 -0
  77. package/out/renderer/assets/{team-bridge-page-BHAdGSZS.js → team-bridge-page-CW5zV9mz.js} +1 -1
  78. package/out/renderer/assets/{timeline-definition-BDJGKUSR-B-ZFBehC.js → timeline-definition-BDJGKUSR-BUZLWyEg.js} +1 -1
  79. package/out/renderer/assets/{use-default-on-banner-C8DUslhy.js → use-default-on-banner-CsqO83vJ.js} +1 -1
  80. package/out/renderer/assets/{use-download-agent-mutation-DMGaSxDK.js → use-download-agent-mutation-F8kNbCPE.js} +1 -1
  81. package/out/renderer/assets/{xychartDiagram-VJFVF3MP-BGB8PPzY.js → xychartDiagram-VJFVF3MP-C9F7-D_T.js} +1 -1
  82. package/out/renderer/console-capture.html +5 -5
  83. package/out/renderer/index.html +7 -7
  84. package/out/renderer/installer.html +4 -4
  85. package/out/renderer/mini.html +6 -6
  86. package/package.json +1 -1
  87. package/out/renderer/assets/browser-page-AgwdXhLM.js +0 -1
  88. package/out/renderer/assets/channel-DMQl-cpj.js +0 -1
  89. package/out/renderer/assets/classDiagram-GIVACNV2-DJsxDWD8.js +0 -1
  90. package/out/renderer/assets/classDiagram-v2-COTLJTTW-DJsxDWD8.js +0 -1
  91. package/out/renderer/assets/clone-B9GxWhWi.js +0 -1
  92. package/out/renderer/assets/index-Buuz619t.js +0 -852
  93. package/out/renderer/assets/infoDiagram-PH2N3AL5-bdAhVGkO.js +0 -2
  94. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-BtazAv7-.js +0 -1
package/out/main/index.js CHANGED
@@ -117471,6 +117471,59 @@ function describeDevDriverArming(arming) {
117471
117471
  if (arming.problems.length === 0) return null;
117472
117472
  return `[dev-driver] not armed: ${arming.problems.join("; ")}`;
117473
117473
  }
117474
+ const DEV_DRIVER_SCRIPT_ENV = "LOCAL_OPERATOR_UI_DEV_DRIVER_SCRIPT";
117475
+ const DEV_DRIVER_SCRIPT_ARG = "--lo-dev-driver-script";
117476
+ const DEV_DRIVER_SCRIPT_STEP = "dev-driver-script-step";
117477
+ const DEV_DRIVER_SCRIPT_RESULT = "dev-driver-script-result";
117478
+ function within(child, parent) {
117479
+ if (child === parent) return true;
117480
+ const prefix = parent.endsWith("/") ? parent : `${parent}/`;
117481
+ return child.startsWith(prefix);
117482
+ }
117483
+ function resolveDevDriverScript(input) {
117484
+ const raw = input.env[DEV_DRIVER_SCRIPT_ENV]?.trim() ?? "";
117485
+ if (raw === "") return { honoured: false, scriptPath: null, refusal: null };
117486
+ const refuse = (reason) => ({
117487
+ honoured: false,
117488
+ scriptPath: null,
117489
+ refusal: reason
117490
+ });
117491
+ if (!input.armed)
117492
+ return refuse(
117493
+ `${DEV_DRIVER_SCRIPT_ENV} needs the dev driver armed (${DEV_DRIVER_ENV}=1 and an absolute ${DEV_DRIVER_OUT_ENV})`
117494
+ );
117495
+ if (input.windowMode !== "headless" && input.windowMode !== "inactive")
117496
+ return refuse(
117497
+ `a dev-driver script never runs in a "${input.windowMode}" window; use --window-mode=inactive or headless`
117498
+ );
117499
+ if (!raw.startsWith("/"))
117500
+ return refuse(`${DEV_DRIVER_SCRIPT_ENV} must be an absolute path`);
117501
+ if (!input.userData.startsWith("/"))
117502
+ return refuse("the profile path is not absolute");
117503
+ const fold = (path2) => input.caseInsensitive ? path2.normalize("NFC").toLowerCase() : path2;
117504
+ const profile = fold(input.realpath(input.userData));
117505
+ for (const candidate of input.defaultUserData) {
117506
+ if (!candidate.startsWith("/")) continue;
117507
+ const root = fold(input.realpath(candidate));
117508
+ if (within(profile, root) || within(root, profile))
117509
+ return refuse(
117510
+ "the profile is the app's default user data (or inside/containing it); a script runs only in a scratch --user-data-dir"
117511
+ );
117512
+ }
117513
+ return { honoured: true, scriptPath: raw, refusal: null };
117514
+ }
117515
+ function describeDevDriverScript(gate) {
117516
+ if (gate.honoured)
117517
+ return `[dev-driver-script] ARMED; steps from ${gate.scriptPath}`;
117518
+ if (gate.refusal) return `[dev-driver-script] refused: ${gate.refusal}`;
117519
+ return null;
117520
+ }
117521
+ function devDriverScriptArgument() {
117522
+ return DEV_DRIVER_SCRIPT_ARG;
117523
+ }
117524
+ function devDriverQuietUpdatesReason(arming) {
117525
+ return arming.armed ? "the renderer dev driver is armed (a rig's boot): start-up seal repair and app-initiated update checks are skipped" : null;
117526
+ }
117474
117527
  const WEBAUTHN_GROUP_SUFFIX = ".webauthn";
117475
117528
  const WEBAUTHN_PROMPT_REASON = "use a passkey for $1";
117476
117529
  const WEBAUTHN_CHOOSER_TIMEOUT_MS = 6e4;
@@ -122054,7 +122107,7 @@ const ADDRESS_OVERLAY_MAX_HEIGHT_DIP = 160;
122054
122107
  const ADDRESS_OVERLAY_READY_TIMEOUT_MS = 5e3;
122055
122108
  const DIP_INT32_MAX = 2 ** 31 - 1;
122056
122109
  const INDEX_DOCUMENT_SUFFIX$2 = /\/?index\.html(\?.*)?$/;
122057
- const TRAILING_SLASH$1 = /\/$/;
122110
+ const TRAILING_SLASH$2 = /\/$/;
122058
122111
  function addressOverlayDocumentUrlFor(rendererUrl) {
122059
122112
  return documentUrlFor(rendererUrl, ADDRESS_OVERLAY_DOCUMENT);
122060
122113
  }
@@ -122062,7 +122115,7 @@ function addressListDocumentUrlFor(rendererUrl) {
122062
122115
  return documentUrlFor(rendererUrl, ADDRESS_LIST_DOCUMENT);
122063
122116
  }
122064
122117
  function documentUrlFor(rendererUrl, document) {
122065
- return INDEX_DOCUMENT_SUFFIX$2.test(rendererUrl) ? rendererUrl.replace(INDEX_DOCUMENT_SUFFIX$2, `/${document}`) : `${rendererUrl.replace(TRAILING_SLASH$1, "")}/${document}`;
122118
+ return INDEX_DOCUMENT_SUFFIX$2.test(rendererUrl) ? rendererUrl.replace(INDEX_DOCUMENT_SUFFIX$2, `/${document}`) : `${rendererUrl.replace(TRAILING_SLASH$2, "")}/${document}`;
122066
122119
  }
122067
122120
  function resolveAddressOverlayGate(input) {
122068
122121
  const raw = input.env[ADDRESS_OVERLAY_S1_ENV];
@@ -125590,6 +125643,185 @@ function observeBrowserLocale(window) {
125590
125643
  }
125591
125644
  });
125592
125645
  }
125646
+ const BROWSER_COMPOSITE_FRAME = "browser-composite-frame";
125647
+ const BROWSER_COMPOSITE_CLEAR = "browser-composite-clear";
125648
+ const rectKeyOf = (rect2) => `${rect2.x},${rect2.y},${rect2.width},${rect2.height}`;
125649
+ class CompositeBridge {
125650
+ constructor(options) {
125651
+ this.options = options;
125652
+ }
125653
+ generation = 0;
125654
+ stream = null;
125655
+ consumerReady = false;
125656
+ disposed = false;
125657
+ /** The live generation, or null. Exposed for tests and evidence only. */
125658
+ get activeGeneration() {
125659
+ return this.stream?.generation ?? null;
125660
+ }
125661
+ /**
125662
+ * Reconcile with the registry. Called before every layout pass and on every
125663
+ * epoch bump; cheap when nothing changed.
125664
+ */
125665
+ sync() {
125666
+ if (this.disposed) return;
125667
+ const want = this.options.eligible();
125668
+ const current = this.stream;
125669
+ if (!want) {
125670
+ if (current) this.stop("ineligible");
125671
+ return;
125672
+ }
125673
+ if (current && current.tabId === want.tabId && current.source === want.source && current.webContentsId === want.source.id && current.documentEpoch === want.documentEpoch && current.rectKey === rectKeyOf(want.rect))
125674
+ return;
125675
+ if (current) {
125676
+ const resizedOnly = current.tabId === want.tabId && current.source === want.source && current.webContentsId === want.source.id && current.documentEpoch === want.documentEpoch;
125677
+ this.stop(resizedOnly ? "resized" : "changed");
125678
+ }
125679
+ this.start(want);
125680
+ }
125681
+ /** End the current generation and, if still eligible, start a fresh one. */
125682
+ invalidate(reason) {
125683
+ if (this.disposed || !this.stream) return;
125684
+ this.stop(reason);
125685
+ this.sync();
125686
+ }
125687
+ /**
125688
+ * The renderer's canvas mounted (true) or went away (false). A fresh consumer
125689
+ * has drawn nothing, so whatever was in flight is forgotten and the latest
125690
+ * frame is resent: a static page may never produce another one.
125691
+ */
125692
+ setConsumer(ready) {
125693
+ if (this.disposed) return;
125694
+ this.consumerReady = ready;
125695
+ const stream = this.stream;
125696
+ if (!stream) return;
125697
+ stream.inFlight = null;
125698
+ stream.sentSeq = 0;
125699
+ if (ready) this.pump(stream);
125700
+ }
125701
+ /**
125702
+ * The renderer drew a frame. Refused (false) unless it names the current
125703
+ * generation and the exact frame in flight: a late ACK from an ended
125704
+ * generation, a repeated ACK and a made-up one must not release a send.
125705
+ */
125706
+ ack(payload) {
125707
+ const stream = this.stream;
125708
+ if (!stream || typeof payload !== "object" || payload === null)
125709
+ return false;
125710
+ const { generation, frameSeq } = payload;
125711
+ if (generation !== stream.generation || typeof frameSeq !== "number" || frameSeq !== stream.inFlight)
125712
+ return false;
125713
+ stream.inFlight = null;
125714
+ this.pump(stream);
125715
+ return true;
125716
+ }
125717
+ /** Host stop, retry or window teardown. Idempotent. */
125718
+ dispose() {
125719
+ if (this.disposed) return;
125720
+ if (this.stream) this.stop("disposed");
125721
+ this.disposed = true;
125722
+ this.consumerReady = false;
125723
+ }
125724
+ start(want) {
125725
+ const source = want.source;
125726
+ if (source.isDestroyed()) return;
125727
+ this.generation += 1;
125728
+ const generation = this.generation;
125729
+ const onNavigation = (details) => {
125730
+ if (details?.isMainFrame && !details.isSameDocument)
125731
+ this.invalidateIf(generation, "navigation");
125732
+ };
125733
+ const onGone = () => this.invalidateIf(generation, "page-gone");
125734
+ const onDestroyed = () => {
125735
+ if (this.stream?.generation === generation) this.stop("page-destroyed");
125736
+ };
125737
+ source.on("did-start-navigation", onNavigation);
125738
+ source.on("render-process-gone", onGone);
125739
+ source.on("destroyed", onDestroyed);
125740
+ const stream = {
125741
+ generation,
125742
+ tabId: want.tabId,
125743
+ source,
125744
+ webContentsId: source.id,
125745
+ documentEpoch: want.documentEpoch,
125746
+ rectKey: rectKeyOf(want.rect),
125747
+ nextSeq: 1,
125748
+ inFlight: null,
125749
+ latest: null,
125750
+ sentSeq: 0,
125751
+ detach: () => {
125752
+ source.removeListener("did-start-navigation", onNavigation);
125753
+ source.removeListener("render-process-gone", onGone);
125754
+ source.removeListener("destroyed", onDestroyed);
125755
+ }
125756
+ };
125757
+ this.stream = stream;
125758
+ try {
125759
+ source.beginFrameSubscription(
125760
+ false,
125761
+ (image2) => this.onFrame(generation, image2)
125762
+ );
125763
+ source.invalidate?.();
125764
+ } catch (error) {
125765
+ this.options.log?.(
125766
+ `[browser] composite: subscription failed for tab ${want.tabId}: ${error?.message ?? error}`
125767
+ );
125768
+ this.stop("subscribe-failed");
125769
+ }
125770
+ }
125771
+ onFrame(generation, image2) {
125772
+ const stream = this.stream;
125773
+ if (!stream || stream.generation !== generation) return;
125774
+ if (image2.isEmpty()) return;
125775
+ stream.latest = { frameSeq: stream.nextSeq++, image: image2 };
125776
+ this.pump(stream);
125777
+ }
125778
+ /** Send the latest frame if the renderer is ready and nothing is in flight. */
125779
+ pump(stream) {
125780
+ if (!this.consumerReady || stream.inFlight !== null) return;
125781
+ const latest = stream.latest;
125782
+ if (!latest || latest.frameSeq <= stream.sentSeq) return;
125783
+ const target2 = this.options.target();
125784
+ if (!target2 || target2.isDestroyed()) return;
125785
+ const { width, height } = latest.image.getSize();
125786
+ const pixels = latest.image.toBitmap();
125787
+ stream.sentSeq = latest.frameSeq;
125788
+ if (width <= 0 || height <= 0 || pixels.byteLength !== width * height * 4)
125789
+ return;
125790
+ const frame = {
125791
+ generation: stream.generation,
125792
+ tabId: stream.tabId,
125793
+ webContentsId: stream.webContentsId,
125794
+ documentEpoch: stream.documentEpoch,
125795
+ frameSeq: latest.frameSeq,
125796
+ width,
125797
+ height,
125798
+ pixels
125799
+ };
125800
+ stream.inFlight = frame.frameSeq;
125801
+ target2.send(BROWSER_COMPOSITE_FRAME, frame);
125802
+ }
125803
+ invalidateIf(generation, reason) {
125804
+ if (this.stream?.generation === generation) this.invalidate(reason);
125805
+ }
125806
+ stop(reason) {
125807
+ const stream = this.stream;
125808
+ if (!stream) return;
125809
+ this.stream = null;
125810
+ stream.detach();
125811
+ stream.latest = null;
125812
+ if (!stream.source.isDestroyed()) {
125813
+ try {
125814
+ stream.source.endFrameSubscription();
125815
+ } catch {
125816
+ }
125817
+ }
125818
+ const target2 = this.options.target();
125819
+ if (target2 && !target2.isDestroyed()) {
125820
+ const clear = { generation: stream.generation, reason };
125821
+ target2.send(BROWSER_COMPOSITE_CLEAR, clear);
125822
+ }
125823
+ }
125824
+ }
125593
125825
  const EXTENSION_ID_PATTERN = /^[a-p]{32}$/;
125594
125826
  function isExtensionId(value) {
125595
125827
  return typeof value === "string" && EXTENSION_ID_PATTERN.test(value);
@@ -125709,12 +125941,12 @@ const CAPS = {
125709
125941
  "uploadMaxFiles": 10
125710
125942
  };
125711
125943
  const NONCE = node_crypto.randomBytes(16).toString("hex");
125712
- const PREFIX = `about:blank#lop-${NONCE}:`;
125944
+ const PREFIX$1 = `about:blank#lop-${NONCE}:`;
125713
125945
  function internalDocumentUrl(page) {
125714
- return `${PREFIX}${internalUrlOf(page)}`;
125946
+ return `${PREFIX$1}${internalUrlOf(page)}`;
125715
125947
  }
125716
125948
  function internalPageOfDocument(url) {
125717
- return url.startsWith(PREFIX) ? parseInternalUrl(url.slice(PREFIX.length)) : null;
125949
+ return url.startsWith(PREFIX$1) ? parseInternalUrl(url.slice(PREFIX$1.length)) : null;
125718
125950
  }
125719
125951
  function isInternalDocument(url) {
125720
125952
  return url.startsWith("about:blank#lop-");
@@ -128786,12 +129018,14 @@ class TabRegistry {
128786
129018
  */
128787
129019
  constructor(viewFactory, onRemove, onChanged, onLayout = () => {
128788
129020
  }, onPresentation = () => {
129021
+ }, onBeforeLayout = () => {
128789
129022
  }) {
128790
129023
  this.viewFactory = viewFactory;
128791
129024
  this.onRemove = onRemove;
128792
129025
  this.onChanged = onChanged;
128793
129026
  this.onLayout = onLayout;
128794
129027
  this.onPresentation = onPresentation;
129028
+ this.onBeforeLayout = onBeforeLayout;
128795
129029
  }
128796
129030
  tabs = /* @__PURE__ */ new Map();
128797
129031
  nextTabId = 1;
@@ -129216,6 +129450,11 @@ class TabRegistry {
129216
129450
  if (!record || record.tabId !== this.activeTabId) return false;
129217
129451
  return this.contentRect !== null && !this.visible && !this.ownStateContent;
129218
129452
  }
129453
+ /** A copy of the renderer-reported content rect, or null (route torn down). */
129454
+ get presentationContentRect() {
129455
+ const rect2 = this.contentRect;
129456
+ return rect2 ? { x: rect2.x, y: rect2.y, width: rect2.width, height: rect2.height } : null;
129457
+ }
129219
129458
  activate(tabId) {
129220
129459
  if (!this.tabs.has(tabId)) return;
129221
129460
  this.activeTabId = tabId;
@@ -129223,6 +129462,10 @@ class TabRegistry {
129223
129462
  this.onChanged();
129224
129463
  }
129225
129464
  applyLayout() {
129465
+ try {
129466
+ this.onBeforeLayout();
129467
+ } catch {
129468
+ }
129226
129469
  const active = this.activeTabId === null ? null : this.tabs.get(this.activeTabId);
129227
129470
  for (const record of this.tabs.values()) {
129228
129471
  const isActive = record === active;
@@ -130762,7 +131005,7 @@ const TAB_SCOPED = /* @__PURE__ */ new Set([
130762
131005
  const RESTORE_CONCURRENCY = 4;
130763
131006
  const RESTORE_TAB_TIMEOUT_MS = 1e4;
130764
131007
  const RESTORE_BUDGET_MS = 8e3;
130765
- function withTimeout(work, ms) {
131008
+ function withTimeout$1(work, ms) {
130766
131009
  return new Promise((resolve, reject) => {
130767
131010
  const timer = setTimeout(
130768
131011
  () => reject(new Error(`timed out after ${ms}ms`)),
@@ -131829,7 +132072,7 @@ class BrowserHost {
131829
132072
  contents.on("did-navigate", onCommitted);
131830
132073
  try {
131831
132074
  const started = this.startRestore(tabId, recorded);
131832
- if (started) await withTimeout(started, RESTORE_TAB_TIMEOUT_MS);
132075
+ if (started) await withTimeout$1(started, RESTORE_TAB_TIMEOUT_MS);
131833
132076
  } catch (error) {
131834
132077
  this.log(`[browser] could not restore tab ${tabId}: ${String(error)}`);
131835
132078
  if (!committed2 && !isSupersededRestore(error) && !this.loadFailures.has(tabId) && this.registry.get(tabId) && !contents.isDestroyed()) {
@@ -131857,7 +132100,7 @@ class BrowserHost {
131857
132100
  await this.restoreUnderTimeout(tabId, recorded);
131858
132101
  if (!this.registry.get(tabId)) return;
131859
132102
  try {
131860
- await withTimeout(this.cdp.attach(contents), RESTORE_TAB_TIMEOUT_MS);
132103
+ await withTimeout$1(this.cdp.attach(contents), RESTORE_TAB_TIMEOUT_MS);
131861
132104
  } catch (error) {
131862
132105
  this.log(
131863
132106
  `[browser] could not attach to restored tab ${tabId}: ${String(error)}`
@@ -135473,6 +135716,9 @@ const BROWSER_IPC_CHANNELS = [
135473
135716
  /** The user's own recovery click on the `unavailable` state (round 1, D1a).
135474
135717
  * Named here so the namespace stays the one place that lists its channels. */
135475
135718
  "browser-retry",
135719
+ /** The live composite's renderer replies (`composite-bridge.ts`). */
135720
+ "browser-composite-ack",
135721
+ "browser-composite-consumer",
135476
135722
  /**
135477
135723
  * S1's probe-only channel. Listed here for unregistration only: the handler
135478
135724
  * below is registered only when the launch gate passed, and this entry makes
@@ -135649,6 +135895,16 @@ function registerBrowserIpc(options) {
135649
135895
  authorize(event);
135650
135896
  options.focusPage?.();
135651
135897
  });
135898
+ electron.ipcMain.handle("browser-composite-ack", (event, payload) => {
135899
+ authorize(event);
135900
+ return options.composite?.ack(payload) ?? false;
135901
+ });
135902
+ electron.ipcMain.handle("browser-composite-consumer", (event, ready) => {
135903
+ authorize(event);
135904
+ if (typeof ready !== "boolean")
135905
+ throw new Error("Composite consumer state must be a boolean.");
135906
+ options.composite?.consumer(ready);
135907
+ });
135652
135908
  electron.ipcMain.handle("browser-home", async (event) => {
135653
135909
  const host = authorize(event);
135654
135910
  return host.goHomeActive();
@@ -139005,6 +139261,11 @@ function startBrowserHost(options) {
139005
139261
  ) ?? false,
139006
139262
  openSystemSettings: async (tabId, id2) => await bindings.mediaPermission?.openSystemSettings(tabId, id2) ?? false
139007
139263
  },
139264
+ // Per call through `bindings`, so a retried start's bridge answers.
139265
+ composite: {
139266
+ ack: (payload) => bindings.composite?.ack(payload) ?? false,
139267
+ consumer: (ready) => bindings.composite?.consumer(ready)
139268
+ },
139008
139269
  focusPage: () => {
139009
139270
  const record = bindings.host?.()?.registry.activeTab;
139010
139271
  const target2 = record?.presented ? electron.webContents.fromId(record.view.webContents.id) : null;
@@ -139839,6 +140100,7 @@ async function initializeBrowserHost(options, bindings) {
139839
140100
  captureSession();
139840
140101
  };
139841
140102
  notifyAddressOverlayHealth = notifyChanged;
140103
+ let compositeBridge = null;
139842
140104
  const registry = new TabRegistry(
139843
140105
  (_createOptions, tabId) => {
139844
140106
  const view = buildView(options.window);
@@ -139888,8 +140150,57 @@ async function initializeBrowserHost(options, bindings) {
139888
140150
  view,
139889
140151
  presented2
139890
140152
  );
140153
+ },
140154
+ // Before the views are hidden/detached: the composite must subscribe to a
140155
+ // still-attached page (composite-bridge.ts, "SUBSCRIBE BEFORE DETACH").
140156
+ () => compositeBridge?.sync()
140157
+ );
140158
+ compositeBridge = new CompositeBridge({
140159
+ eligible: () => {
140160
+ if (options.window.isDestroyed()) return null;
140161
+ const record = registry.activeTab;
140162
+ if (!record || !registry.hiddenByOverlay(record.tabId)) return null;
140163
+ const rect2 = registry.presentationContentRect;
140164
+ if (!rect2 || rect2.width <= 0 || rect2.height <= 0) return null;
140165
+ const source = record.view.webContents;
140166
+ if (source.isDestroyed()) return null;
140167
+ return {
140168
+ tabId: record.tabId,
140169
+ source,
140170
+ documentEpoch: record.documentEpoch,
140171
+ rect: rect2
140172
+ };
140173
+ },
140174
+ target: () => options.window.isDestroyed() || options.window.webContents.isDestroyed() ? null : options.window.webContents,
140175
+ log: log2
140176
+ });
140177
+ const liveComposite = compositeBridge;
140178
+ registry.onEpoch(() => liveComposite.sync());
140179
+ const resetCompositeConsumer = (details) => {
140180
+ if (details && "isMainFrame" in details) {
140181
+ if (!details.isMainFrame || details.isSameDocument) return;
139891
140182
  }
140183
+ liveComposite.setConsumer(false);
140184
+ };
140185
+ const onShellGone = () => liveComposite.setConsumer(false);
140186
+ options.window.webContents.on(
140187
+ "did-start-navigation",
140188
+ resetCompositeConsumer
139892
140189
  );
140190
+ options.window.webContents.on("render-process-gone", onShellGone);
140191
+ const disposeComposite = () => {
140192
+ liveComposite.dispose();
140193
+ if (options.window.isDestroyed()) return;
140194
+ options.window.webContents.removeListener(
140195
+ "did-start-navigation",
140196
+ resetCompositeConsumer
140197
+ );
140198
+ options.window.webContents.removeListener(
140199
+ "render-process-gone",
140200
+ onShellGone
140201
+ );
140202
+ };
140203
+ rollback.add(disposeComposite);
139893
140204
  registryForDownloads = registry;
139894
140205
  registry.setCustodyGate(passkeyCustody);
139895
140206
  const userTabFocused = (contents) => {
@@ -140367,6 +140678,10 @@ async function initializeBrowserHost(options, bindings) {
140367
140678
  expectedUrl: options.expectedUrl,
140368
140679
  host: () => host,
140369
140680
  webauthn: () => webauthn,
140681
+ composite: {
140682
+ ack: (payload) => liveComposite.ack(payload),
140683
+ consumer: (ready) => liveComposite.setConsumer(ready)
140684
+ },
140370
140685
  passkeyNotice: {
140371
140686
  dismiss: (tabId, at) => {
140372
140687
  const dismissed = passkeyNotices.dismiss(tabId, at);
@@ -140506,6 +140821,7 @@ async function initializeBrowserHost(options, bindings) {
140506
140821
  }
140507
140822
  approvalsOverlay?.dispose("host-stop");
140508
140823
  disposeAllRecordingEncoders();
140824
+ disposeComposite();
140509
140825
  registry.destroyAll();
140510
140826
  await Promise.allSettled([...releases]);
140511
140827
  await cdp.close();
@@ -141634,7 +141950,7 @@ function accept(value, paths, problems) {
141634
141950
  }
141635
141951
  paths.push(value);
141636
141952
  }
141637
- const FRAME_LABEL = /^[a-z0-9][a-z0-9_-]{0,63}$/;
141953
+ const FRAME_LABEL$1 = /^[a-z0-9][a-z0-9_-]{0,63}$/;
141638
141954
  function registerDevDriverIPC(options) {
141639
141955
  const { window, expectedUrl, outDir, identity: identity2 } = options;
141640
141956
  fs.mkdirSync(outDir, { recursive: true });
@@ -141669,7 +141985,7 @@ function registerDevDriverIPC(options) {
141669
141985
  });
141670
141986
  electron.ipcMain.handle(DEV_DRIVER_CAPTURE, async (event, label) => {
141671
141987
  const owner = authorize(event);
141672
- if (typeof label !== "string" || !FRAME_LABEL.test(label)) {
141988
+ if (typeof label !== "string" || !FRAME_LABEL$1.test(label)) {
141673
141989
  throw new Error(
141674
141990
  "Invalid frame label: lowercase letters, digits, dash and underscore only."
141675
141991
  );
@@ -141696,6 +142012,202 @@ function registerDevDriverIPC(options) {
141696
142012
  };
141697
142013
  });
141698
142014
  }
142015
+ const DEV_DRIVER_SCRIPT_MAX_STEPS = 64;
142016
+ const DEV_DRIVER_SCRIPT_MAX_BYTES = 64 * 1024;
142017
+ const DEV_DRIVER_SCRIPT_CAP_MS = 3e5;
142018
+ const DEV_DRIVER_SCRIPT_STEP_TIMEOUT_MS = 3e4;
142019
+ const DEV_DRIVER_SCRIPT_READY_MS = 3e4;
142020
+ const DEV_DRIVER_SCRIPT_ACK_MS = 6e4;
142021
+ const DEV_DRIVER_SCRIPT_VERBS = Object.freeze([
142022
+ "navigate",
142023
+ "setTheme",
142024
+ "press",
142025
+ "state",
142026
+ "waitFor",
142027
+ "openCanvas",
142028
+ "skipOnboarding",
142029
+ "shutter"
142030
+ ]);
142031
+ const FRAME_LABEL = /^[a-z0-9][a-z0-9_-]{0,63}$/;
142032
+ function parseDevDriverScript(text2) {
142033
+ if (Buffer.byteLength(text2, "utf8") > DEV_DRIVER_SCRIPT_MAX_BYTES)
142034
+ throw new Error(
142035
+ `the step list is larger than ${DEV_DRIVER_SCRIPT_MAX_BYTES} bytes`
142036
+ );
142037
+ let parsed;
142038
+ try {
142039
+ parsed = JSON.parse(text2);
142040
+ } catch (error) {
142041
+ throw new Error(
142042
+ `the step list is not JSON (${error instanceof Error ? error.message : String(error)})`
142043
+ );
142044
+ }
142045
+ const steps = parsed?.steps;
142046
+ if (!Array.isArray(steps) || steps.length === 0)
142047
+ throw new Error('the step list needs a non-empty "steps" array');
142048
+ if (steps.length > DEV_DRIVER_SCRIPT_MAX_STEPS)
142049
+ throw new Error(
142050
+ `the step list has ${steps.length} steps; the cap is ${DEV_DRIVER_SCRIPT_MAX_STEPS}`
142051
+ );
142052
+ const labels = /* @__PURE__ */ new Set();
142053
+ return {
142054
+ steps: steps.map((raw, index) => {
142055
+ const at = `step ${index + 1}`;
142056
+ if (!raw || typeof raw !== "object" || Array.isArray(raw))
142057
+ throw new Error(`${at} is not an object`);
142058
+ const step = raw;
142059
+ const verb = step.verb;
142060
+ if (typeof verb !== "string" || !DEV_DRIVER_SCRIPT_VERBS.includes(verb))
142061
+ throw new Error(
142062
+ `${at} names verb ${JSON.stringify(verb)}; allowed: ${DEV_DRIVER_SCRIPT_VERBS.join(", ")}`
142063
+ );
142064
+ const timeoutMs = step.timeoutMs;
142065
+ if (timeoutMs !== void 0 && (typeof timeoutMs !== "number" || !Number.isInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > DEV_DRIVER_SCRIPT_CAP_MS))
142066
+ throw new Error(
142067
+ `${at} timeoutMs must be a positive integer up to ${DEV_DRIVER_SCRIPT_CAP_MS}`
142068
+ );
142069
+ if (step.optional !== void 0 && typeof step.optional !== "boolean")
142070
+ throw new Error(`${at} optional must be a boolean`);
142071
+ if (verb === "shutter") {
142072
+ const payload = step.payload;
142073
+ const label = payload?.label;
142074
+ if (typeof label !== "string" || !FRAME_LABEL.test(label))
142075
+ throw new Error(
142076
+ `${at} shutter label must match ${FRAME_LABEL} (lowercase, digits, dash, underscore)`
142077
+ );
142078
+ if (labels.has(label))
142079
+ throw new Error(`${at} repeats shutter label ${label}`);
142080
+ labels.add(label);
142081
+ if (payload?.capture !== "external" && payload?.capture !== "capturepage")
142082
+ throw new Error(
142083
+ `${at} shutter capture must be "external" or "capturepage"`
142084
+ );
142085
+ if (step.optional === true)
142086
+ throw new Error(`${at} a shutter step cannot be optional`);
142087
+ }
142088
+ return {
142089
+ verb,
142090
+ ...step.payload !== void 0 ? { payload: step.payload } : {},
142091
+ ...step.optional === true ? { optional: true } : {},
142092
+ ...timeoutMs !== void 0 ? { timeoutMs } : {}
142093
+ };
142094
+ })
142095
+ };
142096
+ }
142097
+ const PREFIX = "[dev-driver-script]";
142098
+ const TRAILING_SLASH$1 = /\/$/;
142099
+ const RESULT_PRINT_CAP = 4096;
142100
+ function printable(value) {
142101
+ let text2;
142102
+ try {
142103
+ text2 = JSON.stringify(value) ?? "null";
142104
+ } catch {
142105
+ text2 = '"<unserializable>"';
142106
+ }
142107
+ return text2.length > RESULT_PRINT_CAP ? `${text2.slice(0, RESULT_PRINT_CAP)}...<truncated>` : text2;
142108
+ }
142109
+ function oneLine(error) {
142110
+ return (error instanceof Error ? error.message : String(error)).replace(
142111
+ /\s+/g,
142112
+ " "
142113
+ );
142114
+ }
142115
+ async function withTimeout(work, ms, what, deps) {
142116
+ let timedOut = false;
142117
+ const timer = deps.sleep(ms).then(() => {
142118
+ timedOut = true;
142119
+ });
142120
+ const result = await Promise.race([work, timer]);
142121
+ if (timedOut) throw new Error(`${what} did not answer within ${ms} ms`);
142122
+ return result;
142123
+ }
142124
+ async function runDevDriverScript(script, deps) {
142125
+ const readyMs = deps.readyMs ?? DEV_DRIVER_SCRIPT_READY_MS;
142126
+ const ackMs = deps.ackMs ?? DEV_DRIVER_SCRIPT_ACK_MS;
142127
+ const defaultStepMs = deps.stepTimeoutMs ?? DEV_DRIVER_SCRIPT_STEP_TIMEOUT_MS;
142128
+ const needed = [
142129
+ ...new Set(
142130
+ script.steps.map((s) => s.verb).filter((verb) => verb !== "shutter")
142131
+ )
142132
+ ];
142133
+ const readyBy = deps.now() + readyMs;
142134
+ let installed2 = [];
142135
+ for (; ; ) {
142136
+ try {
142137
+ installed2 = await withTimeout(deps.verbs(), 2e3, "verbs", deps);
142138
+ } catch {
142139
+ installed2 = [];
142140
+ }
142141
+ if (needed.every((verb) => installed2.includes(verb))) break;
142142
+ if (deps.now() >= readyBy) {
142143
+ const missing = needed.filter((verb) => !installed2.includes(verb));
142144
+ deps.log(
142145
+ `${PREFIX} step=0 verb=ready error: the renderer did not install ${missing.join(", ")} within ${readyMs} ms`
142146
+ );
142147
+ deps.log(`${PREFIX} FAILED step=0`);
142148
+ return { ok: false, failedStep: 0 };
142149
+ }
142150
+ await deps.sleep(100);
142151
+ }
142152
+ deps.log(`${PREFIX} ready verbs=${installed2.length}`);
142153
+ for (const [index, step] of script.steps.entries()) {
142154
+ const n = index + 1;
142155
+ const timeoutMs = step.timeoutMs ?? defaultStepMs;
142156
+ try {
142157
+ if (step.verb === "shutter") {
142158
+ const { label, capture } = step.payload;
142159
+ const facts = deps.windowFacts();
142160
+ if (capture === "capturepage") {
142161
+ const shot = await withTimeout(
142162
+ deps.capture(label),
142163
+ timeoutMs,
142164
+ "capture",
142165
+ deps
142166
+ );
142167
+ deps.log(
142168
+ `${PREFIX} SHUTTER label=${label} capture=capturepage path=${shot.path} width=${shot.pixels.width} height=${shot.pixels.height} visible=${facts.visible} focused=${facts.focused}`
142169
+ );
142170
+ } else {
142171
+ const ack = `${deps.outDir.replace(TRAILING_SLASH$1, "")}/${label}.ack`;
142172
+ deps.log(
142173
+ `${PREFIX} SHUTTER label=${label} media=${deps.mediaSourceId()} visible=${facts.visible} focused=${facts.focused} ack=${ack}`
142174
+ );
142175
+ const ackBy = deps.now() + ackMs;
142176
+ while (!deps.ackExists(ack)) {
142177
+ if (deps.now() >= ackBy)
142178
+ throw new Error(
142179
+ `no ack at ${ack} within ${ackMs} ms (the harness did not confirm the capture)`
142180
+ );
142181
+ await deps.sleep(100);
142182
+ }
142183
+ }
142184
+ deps.log(`${PREFIX} step=${n} verb=shutter ok {"label":"${label}"}`);
142185
+ continue;
142186
+ }
142187
+ const value = await withTimeout(
142188
+ deps.call(step.verb, step.payload),
142189
+ timeoutMs,
142190
+ step.verb,
142191
+ deps
142192
+ );
142193
+ deps.log(`${PREFIX} step=${n} verb=${step.verb} ok ${printable(value)}`);
142194
+ } catch (error) {
142195
+ if (step.optional) {
142196
+ deps.log(
142197
+ `${PREFIX} step=${n} verb=${step.verb} skipped (optional): ${oneLine(error)}`
142198
+ );
142199
+ continue;
142200
+ }
142201
+ deps.log(
142202
+ `${PREFIX} step=${n} verb=${step.verb} error: ${oneLine(error)}`
142203
+ );
142204
+ deps.log(`${PREFIX} FAILED step=${n}`);
142205
+ return { ok: false, failedStep: n };
142206
+ }
142207
+ }
142208
+ deps.log(`${PREFIX} DONE steps=${script.steps.length}`);
142209
+ return { ok: true, failedStep: null };
142210
+ }
141699
142211
  function shouldToggleDevTools(input, isDev) {
141700
142212
  return isDev && input.type === "keyDown" && input.code === "F12";
141701
142213
  }
@@ -146483,14 +146995,17 @@ class UpdateService {
146483
146995
  * because the guarantee is about one press.
146484
146996
  */
146485
146997
  fleetDrainSpentMs = 0;
146998
+ /** S3: why this launch skips app-initiated update work; null for product launches. */
146999
+ quietReason;
146486
147000
  /**
146487
147001
  * Initialize the update service
146488
147002
  * @param mainWindow - The main application window
146489
147003
  * @param backendService - Optional backend service manager for restarting the backend after updates
146490
147004
  */
146491
- constructor(mainWindow2, backendService2) {
147005
+ constructor(mainWindow2, backendService2, options) {
146492
147006
  this.mainWindow = mainWindow2;
146493
147007
  this.backendService = backendService2 || null;
147008
+ this.quietReason = options?.quietReason ?? null;
146494
147009
  this.isDevMode = !electron.app.isPackaged || Boolean(process.env.ELECTRON_RENDERER_URL);
146495
147010
  const execPath = process.execPath;
146496
147011
  this.isNpxInstall = execPath.includes("node_modules/.bin") || execPath.includes("node_modules\\.bin");
@@ -146509,6 +147024,13 @@ class UpdateService {
146509
147024
  electronUpdater.autoUpdater.autoInstallOnAppQuit = false;
146510
147025
  this.setupUpdateEvents();
146511
147026
  this.recoverPendingInstall();
147027
+ if (this.quietReason) {
147028
+ logger.info(
147029
+ `Update service is quiet for this launch: ${this.quietReason}`,
147030
+ LogFileType.UPDATE_SERVICE
147031
+ );
147032
+ return;
147033
+ }
146512
147034
  const sealProbe = setTimeout(() => {
146513
147035
  void this.repairReachableBundleSeals().catch((error) => {
146514
147036
  logger.warn(
@@ -148533,6 +149055,13 @@ ${heal.removed.join("\n")}`,
148533
149055
  electron.ipcMain.handle(
148534
149056
  "check-for-updates",
148535
149057
  async (_event, options) => {
149058
+ if (this.quietReason && options?.manual !== true) {
149059
+ logger.info(
149060
+ `Skipped the app-initiated UI update check: ${this.quietReason}`,
149061
+ LogFileType.UPDATE_SERVICE
149062
+ );
149063
+ return null;
149064
+ }
148536
149065
  logger.info("Checking for UI updates...", LogFileType.UPDATE_SERVICE);
148537
149066
  this.onCheckRequested(options);
148538
149067
  const reportFailure = options?.manual === true;
@@ -153554,6 +154083,105 @@ const devDriverArming = resolveDevDriverArming({
153554
154083
  });
153555
154084
  const devDriverLine = describeDevDriverArming(devDriverArming);
153556
154085
  if (devDriverLine) console.log(devDriverLine);
154086
+ const devDriverScript = (() => {
154087
+ const realpathOrSelf = (path2) => {
154088
+ try {
154089
+ return fs.realpathSync(path2);
154090
+ } catch {
154091
+ return path2;
154092
+ }
154093
+ };
154094
+ try {
154095
+ const appData = electron.app.getPath("appData");
154096
+ return resolveDevDriverScript({
154097
+ env: launchEnv,
154098
+ armed: devDriverArming.armed,
154099
+ windowMode: windowLaunch.mode,
154100
+ userData: electron.app.getPath("userData"),
154101
+ defaultUserData: [
154102
+ .../* @__PURE__ */ new Set([
154103
+ electron.app.getName(),
154104
+ "Local Operator",
154105
+ "local-operator-ui",
154106
+ "Electron"
154107
+ ])
154108
+ ].map((name) => path$1.join(appData, name)),
154109
+ realpath: realpathOrSelf,
154110
+ // APFS is case-insensitive by default: compare folded there (R1-3).
154111
+ caseInsensitive: process.platform === "darwin"
154112
+ });
154113
+ } catch (error) {
154114
+ return {
154115
+ honoured: false,
154116
+ scriptPath: null,
154117
+ refusal: launchEnv.LOCAL_OPERATOR_UI_DEV_DRIVER_SCRIPT ? `the profile paths could not be read (${error instanceof Error ? error.message : String(error)})` : null
154118
+ };
154119
+ }
154120
+ })();
154121
+ const devDriverScriptLine = describeDevDriverScript(devDriverScript);
154122
+ if (devDriverScriptLine) console.log(devDriverScriptLine);
154123
+ let devDriverScriptStarted = false;
154124
+ function startDevDriverScriptOnce(window) {
154125
+ if (!devDriverScript.honoured || !devDriverScript.scriptPath || !devDriverArming.outDir || devDriverScriptStarted)
154126
+ return;
154127
+ devDriverScriptStarted = true;
154128
+ const outDir = devDriverArming.outDir;
154129
+ let script;
154130
+ try {
154131
+ script = parseDevDriverScript(
154132
+ fs.readFileSync(devDriverScript.scriptPath, "utf8")
154133
+ );
154134
+ } catch (error) {
154135
+ console.log(
154136
+ `[dev-driver-script] refused: ${error instanceof Error ? error.message : String(error)}`
154137
+ );
154138
+ endHeadlessRun("the dev-driver script was refused");
154139
+ return;
154140
+ }
154141
+ let nextId = 1;
154142
+ const pending = /* @__PURE__ */ new Map();
154143
+ electron.ipcMain.on(DEV_DRIVER_SCRIPT_RESULT, (event, message) => {
154144
+ if (window.isDestroyed() || event.sender !== window.webContents || event.senderFrame !== window.webContents.mainFrame)
154145
+ return;
154146
+ const id2 = message?.id;
154147
+ const waiter = typeof id2 === "number" ? pending.get(id2) : void 0;
154148
+ if (!waiter) return;
154149
+ pending.delete(id2);
154150
+ const result = message;
154151
+ if (result.ok) waiter.resolve(result.value);
154152
+ else waiter.reject(new Error(result.error ?? "the verb failed"));
154153
+ });
154154
+ const send2 = (verb, payload) => new Promise((resolve, reject) => {
154155
+ if (window.isDestroyed()) {
154156
+ reject(new Error("the window is gone"));
154157
+ return;
154158
+ }
154159
+ const id2 = nextId++;
154160
+ pending.set(id2, { resolve, reject });
154161
+ window.webContents.send(DEV_DRIVER_SCRIPT_STEP, { id: id2, verb, payload });
154162
+ });
154163
+ window.webContents.once("did-finish-load", () => {
154164
+ void runDevDriverScript(script, {
154165
+ verbs: async () => await send2("__verbs"),
154166
+ call: (verb, payload) => send2(verb, payload),
154167
+ capture: async (label) => await send2("__capture", { label }),
154168
+ mediaSourceId: () => window.getMediaSourceId(),
154169
+ windowFacts: () => ({
154170
+ visible: !window.isDestroyed() && window.isVisible(),
154171
+ focused: !window.isDestroyed() && window.isFocused()
154172
+ }),
154173
+ outDir,
154174
+ ackExists: (path2) => fs.existsSync(path2),
154175
+ sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms).unref()),
154176
+ now: () => Date.now(),
154177
+ log: (line) => console.log(line)
154178
+ }).then(
154179
+ ({ ok }) => endHeadlessRun(
154180
+ ok ? "the dev-driver script finished" : "the dev-driver script failed"
154181
+ )
154182
+ );
154183
+ });
154184
+ }
153557
154185
  const attachQueue = devDriverArming.armed ? readAttachArguments(process.argv) : { paths: [], problems: [] };
153558
154186
  for (const problem of attachQueue.problems)
153559
154187
  console.error(`[dev-driver] ${problem}`);
@@ -153578,7 +154206,14 @@ if (addressOverlayGate.asked) {
153578
154206
  addressOverlayGate.enabled ? addressOverlayGate.visible ? "[address-overlay] ARMED (S3 VISIBLE probe, inactive window, 120 s cap, no product path)" : `[address-overlay] ARMED (S${addressOverlayGate.list ? "2 probe: mirror list" : "1 probe: native child"}, no product path)` : `[address-overlay] not armed: ${addressOverlayGate.reason}`
153579
154207
  );
153580
154208
  }
153581
- const devDriverWebPreferences = devDriverArming.armed && devDriverArming.outDir ? { additionalArguments: [devDriverArgument(devDriverArming.outDir)] } : {};
154209
+ const devDriverWebPreferences = devDriverArming.armed && devDriverArming.outDir ? {
154210
+ additionalArguments: [
154211
+ devDriverArgument(devDriverArming.outDir),
154212
+ // S1: the preload installs its step listener only when this is
154213
+ // present, i.e. only when the script gate above passed.
154214
+ ...devDriverScript.honoured ? [devDriverScriptArgument()] : []
154215
+ ]
154216
+ } : {};
153582
154217
  const telemetryWebPreferences = {
153583
154218
  additionalArguments: [telemetryArgument(telemetryLaunch.enabled)]
153584
154219
  };
@@ -153904,7 +154539,9 @@ electron.app.whenReady().then(async () => {
153904
154539
  env: launchEnv,
153905
154540
  // S3 only: the one visible run nobody is watching still must not
153906
154541
  // outlive its launcher. False for every product launch.
153907
- boundedVisibleProbe: addressOverlayGate.visible
154542
+ // The S1 step runner too: an `inactive` scripted run is a visible
154543
+ // window nobody is at, so it is launcher-bound and capped (below).
154544
+ boundedVisibleProbe: addressOverlayGate.visible || devDriverScript.honoured
153908
154545
  });
153909
154546
  logger.info(`[window-mode] ${launcher.reason}`, LogFileType.BACKEND);
153910
154547
  if (windowLaunch.mode !== "normal") {
@@ -153930,12 +154567,20 @@ electron.app.whenReady().then(async () => {
153930
154567
  `[address-overlay] visible probe cap: ${ADDRESS_OVERLAY_VISIBLE_MAX_MS / 1e3} s from launch`
153931
154568
  );
153932
154569
  }
153933
- if (windowLaunch.mode === "headless" || addressOverlayGate.visible) {
154570
+ if (devDriverScript.honoured) {
154571
+ const scriptCap = setTimeout(() => {
154572
+ endHeadlessRun(
154573
+ `the dev-driver script reached its ${DEV_DRIVER_SCRIPT_CAP_MS / 1e3} s cap`
154574
+ );
154575
+ }, DEV_DRIVER_SCRIPT_CAP_MS);
154576
+ scriptCap.unref();
154577
+ }
154578
+ if (windowLaunch.mode === "headless" || addressOverlayGate.visible || devDriverScript.honoured) {
153934
154579
  for (const signal of ["SIGTERM", "SIGINT"]) {
153935
154580
  process.on(signal, () => endHeadlessRun(`received ${signal}`));
153936
154581
  }
153937
154582
  }
153938
- if (windowLaunch.mode !== "headless" && !addressOverlayGate.visible) {
154583
+ if (windowLaunch.mode !== "headless" && !addressOverlayGate.visible && !devDriverScript.honoured) {
153939
154584
  const onSigtermDuringQuit = () => {
153940
154585
  if (!quitState.isQuitting()) {
153941
154586
  process.removeListener("SIGTERM", onSigtermDuringQuit);
@@ -154095,7 +154740,9 @@ electron.app.whenReady().then(async () => {
154095
154740
  const desktopNotifier = new DesktopNotifier(
154096
154741
  () => mainWindow,
154097
154742
  sendDesktop,
154098
- windowLaunch.show,
154743
+ // S1: a scripted run banners nothing, `inactive` included - its banners
154744
+ // would duplicate the operator's own app and could enter a frame.
154745
+ devDriverScript.honoured ? "never" : windowLaunch.show,
154099
154746
  {
154100
154747
  /*
154101
154748
  * Whether a window we have a heartbeat from is still there.
@@ -155046,6 +155693,7 @@ electron.app.whenReady().then(async () => {
155046
155693
  request
155047
155694
  );
155048
155695
  const windowId = mainWindow.webContents.id;
155696
+ startDevDriverScriptOnce(mainWindow);
155049
155697
  claimParkedFor(
155050
155698
  mainWindow,
155051
155699
  (session2, request2) => openSessionInWindow(session2, request2, { fromPark: true }),
@@ -155075,7 +155723,11 @@ electron.app.whenReady().then(async () => {
155075
155723
  updateService.dispose();
155076
155724
  updateService = null;
155077
155725
  }
155078
- updateService = new UpdateService(mainWindow, backendService);
155726
+ updateService = new UpdateService(mainWindow, backendService, {
155727
+ // S3: an armed (rig) boot of the shipped bundle neither repairs that
155728
+ // bundle's seal nor checks for updates. Null for every product launch.
155729
+ quietReason: devDriverQuietUpdatesReason(devDriverArming)
155730
+ });
155079
155731
  activeUpdateService = updateService;
155080
155732
  mainWindow.on("closed", () => {
155081
155733
  if (updateService) {