local-operator-ui 0.47.9 → 0.48.1

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 (96) hide show
  1. package/out/main/index.js +537 -11
  2. package/out/renderer/assets/{_basePickBy-ojkoQ439.js → _basePickBy-Dv9-f1zg.js} +1 -1
  3. package/out/renderer/assets/{_baseUniq-Cgz7Hj_a.js → _baseUniq-DhaZAHoq.js} +1 -1
  4. package/out/renderer/assets/{agent-details-page-B5287Wxd.js → agent-details-page-CR3LqA6j.js} +1 -1
  5. package/out/renderer/assets/{agent-hub-page-D3p-cWKe.js → agent-hub-page-CUrnlAxA.js} +1 -1
  6. package/out/renderer/assets/{agents-page-Dfj750IG.js → agents-page-C7yY-2qp.js} +3 -3
  7. package/out/renderer/assets/{arc-QdUtBTFo.js → arc-LL7ee6-c.js} +1 -1
  8. package/out/renderer/assets/{architectureDiagram-IEHRJDOE-B6bGif-A.js → architectureDiagram-IEHRJDOE-Bdpg_P_k.js} +1 -1
  9. package/out/renderer/assets/{avatar-cropper-C0NbIvss.js → avatar-cropper-DIvwbJ-E.js} +1 -1
  10. package/out/renderer/assets/{blockDiagram-JOT3LUYC-DNZk1EMc.js → blockDiagram-JOT3LUYC-DOdFevdL.js} +1 -1
  11. package/out/renderer/assets/{book-open-DAO2iRnF.js → book-open-13BlWsMx.js} +1 -1
  12. package/out/renderer/assets/browser-page-Ducxyk3P.js +1 -0
  13. package/out/renderer/assets/{browser-webauthn-prompt-6rWrqh9J.js → browser-webauthn-prompt-DiRIL08d.js} +1 -1
  14. package/out/renderer/assets/{building-2-DpO451z6.js → building-2-9N44CmaA.js} +1 -1
  15. package/out/renderer/assets/{c4Diagram-VJAJSXHY-l_7VtVOD.js → c4Diagram-VJAJSXHY-CjyVs5O2.js} +1 -1
  16. package/out/renderer/assets/channel-DnjDWcac.js +1 -0
  17. package/out/renderer/assets/{chunk-4BMEZGHF-BZPnQwiD.js → chunk-4BMEZGHF-tE6rpM2C.js} +1 -1
  18. package/out/renderer/assets/{chunk-A2AXSNBT-CrfIH5iq.js → chunk-A2AXSNBT-DV0Fb7U9.js} +1 -1
  19. package/out/renderer/assets/{chunk-AEK57VVT-CaPCVkD8.js → chunk-AEK57VVT-BLSpH8f8.js} +1 -1
  20. package/out/renderer/assets/{chunk-D6G4REZN-bEDpLmbt.js → chunk-D6G4REZN-rSj-_6yc.js} +1 -1
  21. package/out/renderer/assets/{chunk-RZ5BOZE2-CsrG7rfM.js → chunk-RZ5BOZE2-jPXnSJCa.js} +1 -1
  22. package/out/renderer/assets/{chunk-XZIHB7SX-F1EtkaMn.js → chunk-XZIHB7SX-MRXkZaZL.js} +1 -1
  23. package/out/renderer/assets/classDiagram-GIVACNV2-QToYz1ed.js +1 -0
  24. package/out/renderer/assets/classDiagram-v2-COTLJTTW-QToYz1ed.js +1 -0
  25. package/out/renderer/assets/clone-DhcIbbVE.js +1 -0
  26. package/out/renderer/assets/{console-mirror-CY6eZKQD.js → console-mirror-Du1Dfi6G.js} +1 -1
  27. package/out/renderer/assets/{consoleCapture-Cj71UOvJ.js → consoleCapture-B8I_oIj6.js} +1 -1
  28. package/out/renderer/assets/{conversation-input-sync-CT1X3xzg.js → conversation-input-sync-CZrU8Pug.js} +5 -5
  29. package/out/renderer/assets/{dagre-OKDRZEBW-KbsJOd-j.js → dagre-OKDRZEBW-Cm4oWZdS.js} +1 -1
  30. package/out/renderer/assets/{diagram-SSKATNLV-P_0af2wd.js → diagram-SSKATNLV-B-SuT3th.js} +1 -1
  31. package/out/renderer/assets/{diagram-VNBRO52H-CkyDCyPd.js → diagram-VNBRO52H-C_87XaDb.js} +1 -1
  32. package/out/renderer/assets/{erDiagram-Q7BY3M3F-BaiH25Qu.js → erDiagram-Q7BY3M3F-CNUTHNRl.js} +1 -1
  33. package/out/renderer/assets/{error-boundary-CD9E-FB_.js → error-boundary-CwJn067i.js} +22 -22
  34. package/out/renderer/assets/{flowDiagram-4HSFHLVR-DB1HkaCE.js → flowDiagram-4HSFHLVR-CNWPnM24.js} +1 -1
  35. package/out/renderer/assets/{ganttDiagram-APWFNJXF-DnoZ-mEJ.js → ganttDiagram-APWFNJXF-DsY3XLIc.js} +1 -1
  36. package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-DcrBUoZ8.js → gitGraphDiagram-7IBYFJ6S-BC2rtoKr.js} +1 -1
  37. package/out/renderer/assets/{graph-Da9ZlHpw.js → graph-8FfBtXyF.js} +1 -1
  38. package/out/renderer/assets/{hash-BGVcZhsd.js → hash-CYo8ILV1.js} +1 -1
  39. package/out/renderer/assets/{heart-CC5rFmGg.js → heart-BNMX-lJj.js} +1 -1
  40. package/out/renderer/assets/{image-plus-Dc4Ph61z.js → image-plus-CJJBBm-x.js} +1 -1
  41. package/out/renderer/assets/{index-BiI-eK_K.js → index-Bw2_HcHz.js} +1 -1
  42. package/out/renderer/assets/{index-DSl-Zp-F.js → index-CAHaHqgX.js} +3 -3
  43. package/out/renderer/assets/{index-G0fTK0HE.js → index-Cbu_OqUM.js} +1 -1
  44. package/out/renderer/assets/{index-xeR22aZz.css → index-DY_OTUQR.css} +1 -1
  45. package/out/renderer/assets/infoDiagram-PH2N3AL5--dcCt49k.js +2 -0
  46. package/out/renderer/assets/{installer-M2B_gKRK.js → installer-8KDPYD7n.js} +1 -1
  47. package/out/renderer/assets/{journeyDiagram-U35MCT3I-DTmBGW6Q.js → journeyDiagram-U35MCT3I-BDNGeVqH.js} +1 -1
  48. package/out/renderer/assets/{kanban-definition-NDS4AKOZ-C8WI_dOp.js → kanban-definition-NDS4AKOZ-S6WyCw-t.js} +1 -1
  49. package/out/renderer/assets/{layout-C3jbvT4l.js → layout-C8dSdqMl.js} +1 -1
  50. package/out/renderer/assets/{legacy-agents-page-BX1ObLve.js → legacy-agents-page-DlgZ5b8m.js} +1 -1
  51. package/out/renderer/assets/{library-page-qOfmNVcg.js → library-page-Cp4PnUA5.js} +3 -3
  52. package/out/renderer/assets/{mermaid.core-CdQ7E5mL.js → mermaid.core-ChUVqMVr.js} +5 -5
  53. package/out/renderer/assets/{mesh-page-DMkT_9A-.js → mesh-page-DZZfCNa2.js} +1 -1
  54. package/out/renderer/assets/{mindmap-definition-ALO5MXBD-DU0mo9p2.js → mindmap-definition-ALO5MXBD-BDgMRP17.js} +1 -1
  55. package/out/renderer/assets/{mini-aAsnKaGz.js → mini-BiSL5p9w.js} +1 -1
  56. package/out/renderer/assets/{notebook-pen-BP6ceuCH.js → notebook-pen-CDTqffOy.js} +1 -1
  57. package/out/renderer/assets/{notifications-page-DRMToDYt.js → notifications-page-Cmp-Mcnx.js} +1 -1
  58. package/out/renderer/assets/{org-access-Bs8eFlSp.js → org-access-CQLGDE7O.js} +1 -1
  59. package/out/renderer/assets/{org-surface-gate-Cxo-hbUN.js → org-surface-gate-BRW-oc5F.js} +1 -1
  60. package/out/renderer/assets/{page-header-D5i9aRdF.js → page-header-51hz6cfp.js} +1 -1
  61. package/out/renderer/assets/{path-utils-CS-ZbmNv.js → path-utils-hqT2xf5k.js} +1 -1
  62. package/out/renderer/assets/{pieDiagram-IB7DONF6-Jdvz8VWw.js → pieDiagram-IB7DONF6-_o4TQRD4.js} +1 -1
  63. package/out/renderer/assets/{project-markdown-6v_v8CTi.js → project-markdown-DCyUXZT4.js} +1 -1
  64. package/out/renderer/assets/{projects-page-ClDZIyym.js → projects-page-DpKBnfKx.js} +1 -1
  65. package/out/renderer/assets/{publication-validation-fhBwU4Ct.js → publication-validation-DAtEW_km.js} +1 -1
  66. package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-DDWwjPpi.js → quadrantDiagram-7GDLP6J5-iGSUnWGg.js} +1 -1
  67. package/out/renderer/assets/{radar-MK3ICKWK-Bph4zewY.js → radar-MK3ICKWK-WyU70_8J.js} +1 -1
  68. package/out/renderer/assets/{radient-auth-buttons-DzozdIYt.js → radient-auth-buttons-CfQ8zffH.js} +1 -1
  69. package/out/renderer/assets/{requirementDiagram-KVF5MWMF-dCfjbetB.js → requirementDiagram-KVF5MWMF-D8UCvhk2.js} +1 -1
  70. package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-HVn73-Eh.js → sankeyDiagram-QLVOVGJD-Cu2Jst1E.js} +1 -1
  71. package/out/renderer/assets/{schedules-page-D7cUalTn.js → schedules-page-CBOwjsR3.js} +1 -1
  72. package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-DLk99tON.js → sequenceDiagram-X6HHIX6F-Cf1qv7nv.js} +1 -1
  73. package/out/renderer/assets/{settings-page-A_PbN5kj.js → settings-page-ri8T0hR6.js} +1 -1
  74. package/out/renderer/assets/{smartart-BXJB_IpV.js → smartart-BD3VY3T_.js} +1 -1
  75. package/out/renderer/assets/{stateDiagram-DGXRK772-D4lTws7V.js → stateDiagram-DGXRK772-DygQ8odd.js} +1 -1
  76. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-JmiS-OvQ.js +1 -0
  77. package/out/renderer/assets/team-bridge-page-CnL7zo0z.js +39 -0
  78. package/out/renderer/assets/{team-bridge-scope-preference-B_3LiR3U.js → team-bridge-scope-preference-amThPee8.js} +1 -1
  79. package/out/renderer/assets/{timeline-definition-BDJGKUSR-_5CvFmhx.js → timeline-definition-BDJGKUSR-WnOC2syY.js} +1 -1
  80. package/out/renderer/assets/{use-download-agent-mutation-uNfQtsZW.js → use-download-agent-mutation-Boh-EKE8.js} +1 -1
  81. package/out/renderer/assets/{use-session-snapshot-Dd2mlTTk.js → use-session-snapshot-DPrglgqS.js} +1 -1
  82. package/out/renderer/assets/{xychartDiagram-VJFVF3MP-FE7vAowE.js → xychartDiagram-VJFVF3MP-BwdKR-i5.js} +1 -1
  83. package/out/renderer/console-capture.html +5 -5
  84. package/out/renderer/index.html +7 -7
  85. package/out/renderer/installer.html +4 -4
  86. package/out/renderer/mini.html +7 -7
  87. package/package.json +2 -2
  88. package/out/renderer/assets/browser-page-PqDhz6JH.js +0 -1
  89. package/out/renderer/assets/channel-Bayx-C4D.js +0 -1
  90. package/out/renderer/assets/classDiagram-GIVACNV2-DIGzvb4h.js +0 -1
  91. package/out/renderer/assets/classDiagram-v2-COTLJTTW-DIGzvb4h.js +0 -1
  92. package/out/renderer/assets/clone-DSth8cxq.js +0 -1
  93. package/out/renderer/assets/infoDiagram-PH2N3AL5-CEGFxaq5.js +0 -2
  94. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-CLGdAi2z.js +0 -1
  95. package/out/renderer/assets/team-bridge-page-DOAIc8WR.js +0 -38
  96. /package/out/renderer/assets/{index-Cs4iHH2g.js → index-yTWbf43d.js} +0 -0
package/out/main/index.js CHANGED
@@ -82018,7 +82018,9 @@ const METHODS$1 = [
82018
82018
  // NAME, so `isMethod` admits it either way. Hosts advertise it in
82019
82019
  // HOST_CAPABILITIES (beside `press`), which is what lets the harness refuse it
82020
82020
  // on an app that predates it instead of sending an unknown method.
82021
- "hover"
82021
+ "hover",
82022
+ // DOM/native and page-owned ARIA selection; never an OS popup.
82023
+ "select"
82022
82024
  ];
82023
82025
  const METHOD_SET = new Set(METHODS$1);
82024
82026
  function isMethod(value) {
@@ -82079,6 +82081,7 @@ const HOST_CAPABILITIES = [
82079
82081
  // `hover` rides the same list as `press` for the same reason: desktop-only, and
82080
82082
  // the extension/cmux hosts and older desktop apps must be refused by capability.
82081
82083
  "hover",
82084
+ "select",
82082
82085
  // Session-scoped network capture. DESKTOP-ONLY: the extension's debugger is
82083
82086
  // attached only for the duration of an action, so it holds no standing session
82084
82087
  // to keep a `Network` subscription on. The backend therefore gates these four
@@ -82092,7 +82095,10 @@ const HOST_CAPABILITIES = [
82092
82095
  // PR-A owns, so a build that predates the bump advertises nothing it cannot
82093
82096
  // do.
82094
82097
  "record_start",
82095
- "record_stop"
82098
+ "record_stop",
82099
+ // Sized recording (width/height on record_start) is not a method; the
82100
+ // harness capability-gates the two params on this name.
82101
+ "record_size"
82096
82102
  ];
82097
82103
  const RUN_DIRNAME = path$1.join("run", "ui-browser");
82098
82104
  const STATE_FILENAME = "host.json";
@@ -98715,6 +98721,14 @@ function deadline(op, ms, what) {
98715
98721
  const RECORD_WIDTH = 1280;
98716
98722
  const RECORD_HEIGHT = 720;
98717
98723
  const RECORD_FPS = 10;
98724
+ const RECORD_MIN_SIDE = 240;
98725
+ const RECORD_MAX_SIDE = 3840;
98726
+ const RECORD_MAX_PIXELS = 3840 * 2160;
98727
+ const RECORD_LAYOUT_SETTLE_MS = 2e3;
98728
+ const RECORD_LAYOUT_POLL_MS = 50;
98729
+ const RECORD_FRAME_SETTLE_MS = 2e3;
98730
+ const RECORD_LARGE_AREA = 1920 * 1080;
98731
+ const MAX_CONCURRENT_LARGE_RECORDINGS = 1;
98718
98732
  const MAX_NAME_BYTES$1 = 255;
98719
98733
  const RECORD_DEFAULT_DURATION_S = 120;
98720
98734
  const RECORD_MAX_DURATION_S = 600;
@@ -98729,6 +98743,7 @@ const RECORD_FIRST_CHROMIUM_MAJOR = 153;
98729
98743
  const recordings = /* @__PURE__ */ new Map();
98730
98744
  const settled = /* @__PURE__ */ new Map();
98731
98745
  const reservations = /* @__PURE__ */ new Map();
98746
+ const viewportOverrides = /* @__PURE__ */ new Map();
98732
98747
  function notActive() {
98733
98748
  return new BridgeCommandError(
98734
98749
  "internal",
@@ -98844,6 +98859,191 @@ function maxBytesOf(params) {
98844
98859
  }
98845
98860
  return bytes;
98846
98861
  }
98862
+ function sizeRefusal(why, param, detail) {
98863
+ return new BridgeCommandError("internal", `${detail} Nothing was started.`, {
98864
+ reason: "record_size",
98865
+ param,
98866
+ why
98867
+ });
98868
+ }
98869
+ function sizeOf$1(params) {
98870
+ const hasWidth = params.width !== void 0;
98871
+ const hasHeight = params.height !== void 0;
98872
+ if (!hasWidth && !hasHeight) return null;
98873
+ if (!hasWidth || !hasHeight) {
98874
+ const missing = hasWidth ? "height" : "width";
98875
+ throw sizeRefusal(
98876
+ "incomplete",
98877
+ missing,
98878
+ `record_start width and height must be given together; ${missing} is missing.`
98879
+ );
98880
+ }
98881
+ const width = Number(params.width);
98882
+ const height = Number(params.height);
98883
+ if (!Number.isInteger(width) || !Number.isInteger(height)) {
98884
+ const param = Number.isInteger(width) ? "height" : "width";
98885
+ throw sizeRefusal(
98886
+ "range",
98887
+ param,
98888
+ `record_start width and height must be whole numbers of pixels: got ${String(params.width)}x${String(params.height)}.`
98889
+ );
98890
+ }
98891
+ if (width % 2 !== 0 || height % 2 !== 0) {
98892
+ const param = width % 2 !== 0 ? "width" : "height";
98893
+ throw sizeRefusal(
98894
+ "odd",
98895
+ param,
98896
+ `record_start ${param} must be even, because the encoder's chroma planes are half resolution: got ${width}x${height}.`
98897
+ );
98898
+ }
98899
+ if (width < RECORD_MIN_SIDE || width > RECORD_MAX_SIDE || height < RECORD_MIN_SIDE || height > RECORD_MAX_SIDE) {
98900
+ const param = width < RECORD_MIN_SIDE || width > RECORD_MAX_SIDE ? "width" : "height";
98901
+ throw sizeRefusal(
98902
+ "range",
98903
+ param,
98904
+ `record_start ${param} must be from ${RECORD_MIN_SIDE} to ${RECORD_MAX_SIDE} pixels: got ${width}x${height}.`
98905
+ );
98906
+ }
98907
+ if (width * height > RECORD_MAX_PIXELS) {
98908
+ throw sizeRefusal(
98909
+ "area",
98910
+ "size",
98911
+ `record_start ${width}x${height}: the area is larger than ${RECORD_MAX_SIDE}x${RECORD_MAX_PIXELS / RECORD_MAX_SIDE} (${RECORD_MAX_PIXELS} pixels), which is this host's ceiling.`
98912
+ );
98913
+ }
98914
+ return { width, height };
98915
+ }
98916
+ function isLarge(size) {
98917
+ return size.width * size.height > RECORD_LARGE_AREA;
98918
+ }
98919
+ function isLargeRecording(recording) {
98920
+ const size = sizeOfRecording(recording);
98921
+ return size !== null && isLarge(size);
98922
+ }
98923
+ function sizeOfRecording(recording) {
98924
+ return recording.width === void 0 || recording.height === void 0 ? null : { width: recording.width, height: recording.height };
98925
+ }
98926
+ function sizeFromValue(value) {
98927
+ if (!Array.isArray(value) || value.length !== 2) return null;
98928
+ const width = Number(value[0]);
98929
+ const height = Number(value[1]);
98930
+ if (!Number.isFinite(width) || !Number.isFinite(height)) return null;
98931
+ return { width: Math.round(width), height: Math.round(height) };
98932
+ }
98933
+ async function innerViewport(cdp, contents) {
98934
+ const answer = await cdp.send(
98935
+ contents,
98936
+ "Runtime.evaluate",
98937
+ {
98938
+ expression: "[window.innerWidth, window.innerHeight]",
98939
+ returnByValue: true
98940
+ },
98941
+ { deadlineMs: CDP_DEADLINE_MS }
98942
+ );
98943
+ return sizeFromValue(answer?.result?.value);
98944
+ }
98945
+ function isWaitableEvaluateFailure(error) {
98946
+ if (!(error instanceof BridgeCommandError)) return true;
98947
+ return error.code !== "tab_closed" && error.code !== "debugger_conflict";
98948
+ }
98949
+ async function waitForViewport(cdp, contents, size) {
98950
+ const deadline2 = Date.now() + RECORD_LAYOUT_SETTLE_MS;
98951
+ for (; ; ) {
98952
+ let measured = null;
98953
+ try {
98954
+ measured = await innerViewport(cdp, contents);
98955
+ } catch (error) {
98956
+ if (!isWaitableEvaluateFailure(error)) throw error;
98957
+ measured = null;
98958
+ }
98959
+ if (measured && measured.width === size.width && measured.height === size.height) {
98960
+ return size;
98961
+ }
98962
+ if (Date.now() >= deadline2) {
98963
+ throw sizeRefusal(
98964
+ "not_applied",
98965
+ "size",
98966
+ `record_start could not apply ${size.width}x${size.height} to the tab's viewport within ${RECORD_LAYOUT_SETTLE_MS / 1e3} s.`
98967
+ );
98968
+ }
98969
+ await new Promise(
98970
+ (resolveWait) => setTimeout(resolveWait, RECORD_LAYOUT_POLL_MS)
98971
+ );
98972
+ }
98973
+ }
98974
+ const FRAME_SETTLE_EXPRESSION = "new Promise((resolve) => { requestAnimationFrame(() => requestAnimationFrame(() => resolve([window.innerWidth, window.innerHeight]))); })";
98975
+ async function waitForCompositedFrame(cdp, contents, size) {
98976
+ const deadline2 = Date.now() + RECORD_FRAME_SETTLE_MS;
98977
+ for (; ; ) {
98978
+ const remaining = deadline2 - Date.now();
98979
+ if (remaining <= 0) break;
98980
+ let measured = null;
98981
+ try {
98982
+ const answer = await cdp.send(
98983
+ contents,
98984
+ "Runtime.evaluate",
98985
+ {
98986
+ expression: FRAME_SETTLE_EXPRESSION,
98987
+ awaitPromise: true,
98988
+ returnByValue: true
98989
+ },
98990
+ { deadlineMs: remaining }
98991
+ );
98992
+ measured = sizeFromValue(answer?.result?.value);
98993
+ } catch (error) {
98994
+ if (!isWaitableEvaluateFailure(error)) throw error;
98995
+ measured = null;
98996
+ }
98997
+ if (measured && measured.width === size.width && measured.height === size.height) {
98998
+ return;
98999
+ }
99000
+ await new Promise(
99001
+ (resolveWait) => setTimeout(resolveWait, RECORD_LAYOUT_POLL_MS)
99002
+ );
99003
+ }
99004
+ throw sizeRefusal(
99005
+ "not_applied",
99006
+ "size",
99007
+ `record_start applied ${size.width}x${size.height} to the tab's viewport, but the tab did not draw a frame at that size within ${RECORD_FRAME_SETTLE_MS / 1e3} s.`
99008
+ );
99009
+ }
99010
+ async function installViewport(cdp, contents, size) {
99011
+ const token = {};
99012
+ viewportOverrides.set(contents.id, token);
99013
+ try {
99014
+ await cdp.send(
99015
+ contents,
99016
+ "Emulation.setDeviceMetricsOverride",
99017
+ {
99018
+ width: size.width,
99019
+ height: size.height,
99020
+ deviceScaleFactor: 1,
99021
+ mobile: false
99022
+ },
99023
+ { deadlineMs: CDP_DEADLINE_MS }
99024
+ );
99025
+ } catch (error) {
99026
+ if (viewportOverrides.get(contents.id) === token) {
99027
+ viewportOverrides.delete(contents.id);
99028
+ }
99029
+ throw error;
99030
+ }
99031
+ return token;
99032
+ }
99033
+ async function clearViewport(cdp, contents, token) {
99034
+ if (viewportOverrides.get(contents.id) !== token) return;
99035
+ viewportOverrides.delete(contents.id);
99036
+ if (contents.isDestroyed()) return;
99037
+ try {
99038
+ await cdp.send(
99039
+ contents,
99040
+ "Emulation.clearDeviceMetricsOverride",
99041
+ {},
99042
+ { deadlineMs: CDP_DEADLINE_MS }
99043
+ );
99044
+ } catch {
99045
+ }
99046
+ }
98847
99047
  function capWords(bytes) {
98848
99048
  return bytes >= 1024 * 1024 ? `${Math.floor(bytes / (1024 * 1024))} MiB` : `${Math.round(bytes / 1024)} KiB`;
98849
99049
  }
@@ -98875,11 +99075,12 @@ function classifyStartFailure(error) {
98875
99075
  reason: "record_failed"
98876
99076
  });
98877
99077
  }
98878
- function captureShape() {
99078
+ function captureShape(size) {
98879
99079
  return {
98880
99080
  fps: RECORD_FPS,
98881
99081
  container: "mp4",
98882
- codec: "av1"
99082
+ codec: "av1",
99083
+ ...size ? { width: size.width, height: size.height } : {}
98883
99084
  };
98884
99085
  }
98885
99086
  async function readStream(recording, handle2, budgetAt, fd) {
@@ -98907,9 +99108,10 @@ async function readStream(recording, handle2, budgetAt, fd) {
98907
99108
  bytes += chunk.length;
98908
99109
  }
98909
99110
  if (bytes > recording.maxBytes) {
99111
+ const atSize = sizeOfRecording(recording);
98910
99112
  throw new BridgeCommandError(
98911
99113
  "internal",
98912
- `the recording is larger than ${capWords(recording.maxBytes)}; nothing was saved. Record a shorter span (timeout_s) and retry.`,
99114
+ `the recording is larger than ${capWords(recording.maxBytes)}${atSize ? ` at ${atSize.width}x${atSize.height}` : ""}; nothing was saved. Record a shorter span (timeout_s) and retry.`,
98913
99115
  { reason: "record_too_large", max_bytes: recording.maxBytes }
98914
99116
  );
98915
99117
  }
@@ -98924,6 +99126,7 @@ async function runFinalize(recording, autoStopped) {
98924
99126
  let fd = null;
98925
99127
  let createdPart = false;
98926
99128
  let endedAt = recording.startedAt;
99129
+ let viewportCleared = false;
98927
99130
  try {
98928
99131
  const stopped = await cdp.send(
98929
99132
  contents,
@@ -98932,6 +99135,10 @@ async function runFinalize(recording, autoStopped) {
98932
99135
  { deadlineMs: RECORD_STOP_DEADLINE_MS }
98933
99136
  );
98934
99137
  endedAt = Date.now();
99138
+ if (recording.viewportToken) {
99139
+ await clearViewport(cdp, contents, recording.viewportToken);
99140
+ viewportCleared = true;
99141
+ }
98935
99142
  handle2 = typeof stopped?.stream === "string" ? stopped.stream : "";
98936
99143
  if (recording.aborted) throw abortedWhileSaving();
98937
99144
  if (!handle2) {
@@ -98976,11 +99183,14 @@ async function runFinalize(recording, autoStopped) {
98976
99183
  bytes,
98977
99184
  duration_ms: endedAt - recording.startedAt,
98978
99185
  auto_stopped: autoStopped,
98979
- ...captureShape()
99186
+ ...captureShape(sizeOfRecording(recording))
98980
99187
  };
98981
99188
  } catch (error) {
98982
99189
  throw typedFailure(error);
98983
99190
  } finally {
99191
+ if (recording.viewportToken && !viewportCleared) {
99192
+ await clearViewport(cdp, contents, recording.viewportToken);
99193
+ }
98984
99194
  if (fd !== null) {
98985
99195
  try {
98986
99196
  fs.closeSync(fd);
@@ -99036,6 +99246,14 @@ async function endReplaced(recording) {
99036
99246
  ).catch(() => void 0);
99037
99247
  }
99038
99248
  } catch {
99249
+ } finally {
99250
+ if (recording.viewportToken) {
99251
+ await clearViewport(
99252
+ recording.cdp,
99253
+ recording.contents,
99254
+ recording.viewportToken
99255
+ );
99256
+ }
99039
99257
  }
99040
99258
  }
99041
99259
  async function abortAndEnd(webContentsId, reason) {
@@ -99073,6 +99291,14 @@ async function recordStart(ctx, params, requestId2) {
99073
99291
  );
99074
99292
  }
99075
99293
  }
99294
+ const size = sizeOf$1(params);
99295
+ if (size && tab.presented) {
99296
+ throw sizeRefusal(
99297
+ "visible",
99298
+ "size",
99299
+ `record_start cannot grow the tab the user is looking at to ${size.width}x${size.height}: that view is the app's own content area. Activate another tab, or omit width/height for a 1280x720 clip.`
99300
+ );
99301
+ }
99076
99302
  const path2 = preflightPath(params);
99077
99303
  const maxDurationS = durationOf(params);
99078
99304
  const maxBytes = maxBytesOf(params);
@@ -99106,24 +99332,51 @@ async function recordStart(ctx, params, requestId2) {
99106
99332
  { reason: "record_limit", limit: MAX_CONCURRENT_RECORDINGS }
99107
99333
  );
99108
99334
  }
99335
+ if (size && isLarge(size)) {
99336
+ const largeRunning = [...recordings.values()].filter(
99337
+ (other) => other !== active && isLargeRecording(other)
99338
+ ).length;
99339
+ const largeStarting = [...reservations.values()].filter(
99340
+ (entry2) => entry2.large
99341
+ ).length;
99342
+ if (largeRunning + largeStarting >= MAX_CONCURRENT_LARGE_RECORDINGS) {
99343
+ throw new BridgeCommandError(
99344
+ "busy",
99345
+ `a recording larger than 1920x1080 is already running, and this host allows ${MAX_CONCURRENT_LARGE_RECORDINGS} at a time; stop it with record_stop, ask for 1920x1080 or smaller, or omit width/height. Nothing was started.`,
99346
+ { reason: "record_limit", limit: MAX_CONCURRENT_LARGE_RECORDINGS }
99347
+ );
99348
+ }
99349
+ }
99109
99350
  if (active) {
99110
99351
  abortRecording(id2, "replaced_by_another_owner");
99111
99352
  }
99112
99353
  const reservation = `${Date.now()}-${Math.random()}`;
99113
- const entry = { webContentsId: id2, path: path2, cancelled: false };
99354
+ const entry = {
99355
+ webContentsId: id2,
99356
+ path: path2,
99357
+ cancelled: false,
99358
+ large: size !== null && isLarge(size)
99359
+ };
99114
99360
  reservations.set(reservation, entry);
99361
+ let measured = size;
99362
+ let viewportToken;
99115
99363
  let started = false;
99116
99364
  try {
99117
99365
  if (active) await endReplaced(active);
99118
99366
  await ctx.cdp.attach(contents);
99367
+ if (size) {
99368
+ viewportToken = await installViewport(ctx.cdp, contents, size);
99369
+ measured = await waitForViewport(ctx.cdp, contents, size);
99370
+ await waitForCompositedFrame(ctx.cdp, contents, measured);
99371
+ }
99119
99372
  try {
99120
99373
  await ctx.cdp.send(
99121
99374
  contents,
99122
99375
  "Page.startScreenRecording",
99123
99376
  {
99124
99377
  audio: false,
99125
- maxWidth: RECORD_WIDTH,
99126
- maxHeight: RECORD_HEIGHT,
99378
+ maxWidth: measured?.width ?? RECORD_WIDTH,
99379
+ maxHeight: measured?.height ?? RECORD_HEIGHT,
99127
99380
  frameRate: RECORD_FPS
99128
99381
  },
99129
99382
  { deadlineMs: RECORD_START_DEADLINE_MS }
@@ -99134,11 +99387,24 @@ async function recordStart(ctx, params, requestId2) {
99134
99387
  }
99135
99388
  } catch (error) {
99136
99389
  reservations.delete(reservation);
99390
+ if (size && viewportToken) {
99391
+ await clearViewport(ctx.cdp, contents, viewportToken);
99392
+ }
99137
99393
  throw error;
99138
99394
  }
99139
99395
  if (entry.cancelled) {
99140
99396
  reservations.delete(reservation);
99141
- if (started) await endReplaced({ cdp: ctx.cdp, contents });
99397
+ if (started) {
99398
+ await endReplaced({
99399
+ cdp: ctx.cdp,
99400
+ contents,
99401
+ width: measured?.width,
99402
+ height: measured?.height,
99403
+ viewportToken
99404
+ });
99405
+ } else if (size && viewportToken) {
99406
+ await clearViewport(ctx.cdp, contents, viewportToken);
99407
+ }
99142
99408
  throw new BridgeCommandError(
99143
99409
  "internal",
99144
99410
  "that browser tab was released while the recording was starting; nothing was saved. Use 'open' with a URL to get a new tab.",
@@ -99154,6 +99420,8 @@ async function recordStart(ctx, params, requestId2) {
99154
99420
  startedAt: Date.now(),
99155
99421
  maxBytes,
99156
99422
  maxDurationS,
99423
+ ...measured ? { width: measured.width, height: measured.height } : {},
99424
+ ...viewportToken ? { viewportToken } : {},
99157
99425
  timer: void 0,
99158
99426
  finishing: null,
99159
99427
  aborted: false
@@ -99169,7 +99437,7 @@ async function recordStart(ctx, params, requestId2) {
99169
99437
  path: path2,
99170
99438
  max_duration_s: maxDurationS,
99171
99439
  max_bytes: maxBytes,
99172
- ...captureShape()
99440
+ ...captureShape(measured)
99173
99441
  };
99174
99442
  }
99175
99443
  async function recordStop(ctx, params, requestId2) {
@@ -99211,6 +99479,13 @@ function abortRecording(webContentsId, reason, options = {}) {
99211
99479
  recording.timer = void 0;
99212
99480
  }
99213
99481
  recordings.delete(webContentsId);
99482
+ if (recording.viewportToken) {
99483
+ void clearViewport(
99484
+ recording.cdp,
99485
+ recording.contents,
99486
+ recording.viewportToken
99487
+ );
99488
+ }
99214
99489
  }
99215
99490
  if (options.tombstone && recording) {
99216
99491
  settled.set(webContentsId, {
@@ -102087,6 +102362,249 @@ async function query(ctx, params) {
102087
102362
  ctx.registry.touch(record);
102088
102363
  return { ...result, ...pageOf(record.view) };
102089
102364
  }
102365
+ function selectPage(mode, requested) {
102366
+ const doc = this.ownerDocument;
102367
+ const win = doc.defaultView;
102368
+ const clip2 = (text2) => text2.slice(0, 120);
102369
+ const native = this instanceof win.HTMLSelectElement;
102370
+ const kind = native ? "native" : "aria";
102371
+ if (!native && !this.matches(
102372
+ '[role="combobox"], [role="listbox"], [aria-haspopup="listbox"]'
102373
+ )) {
102374
+ return { status: "not_select" };
102375
+ }
102376
+ if (this.matches(":disabled, [aria-disabled=true]") || this.closest("[inert]"))
102377
+ return { status: "disabled", kind };
102378
+ if (mode === "trigger") return { status: "ready", kind };
102379
+ let root = this;
102380
+ if (!native && !this.matches('[role="listbox"]')) {
102381
+ const ids = (this.getAttribute("aria-controls") || this.getAttribute("aria-owns") || "").split(/\s+/).filter(Boolean);
102382
+ const controlled = ids.map((id2) => doc.getElementById(id2)).filter((el) => !!el);
102383
+ const candidates = controlled.length ? controlled : Array.from(doc.querySelectorAll('[role="listbox"]')).filter(
102384
+ (el) => el.getClientRects().length > 0
102385
+ );
102386
+ if (candidates.length !== 1) return { status: "listbox_missing", kind };
102387
+ root = candidates[0];
102388
+ }
102389
+ const elements = native ? Array.from(this.options) : Array.from(root.querySelectorAll('[role="option"]'));
102390
+ const facts = elements.map((el, index) => ({
102391
+ index,
102392
+ label: (native ? el.label : el.getAttribute("aria-label") || el.textContent || "").trim(),
102393
+ value: native ? el.value : el.getAttribute("data-value") || el.getAttribute("value") || ""
102394
+ }));
102395
+ const available = facts.slice(0, 50).map((fact) => ({
102396
+ ...fact,
102397
+ label: clip2(fact.label),
102398
+ value: clip2(fact.value)
102399
+ }));
102400
+ const multiple = native ? this.multiple : root.getAttribute("aria-multiselectable") === "true";
102401
+ if (mode === "describe") return { status: "ready", kind, multiple };
102402
+ const indexes = [];
102403
+ for (const item of requested) {
102404
+ const needle = typeof item === "string" ? item.trim() : "";
102405
+ const found = typeof item === "number" ? facts[item] : facts.find((o) => o.label === needle) ?? facts.find((o) => o.label.toLowerCase() === needle.toLowerCase()) ?? facts.find((o) => o.value === item);
102406
+ if (!found) return { status: "option_not_found", kind, available };
102407
+ if (!indexes.includes(found.index)) indexes.push(found.index);
102408
+ }
102409
+ if (!multiple && requested.length !== 1)
102410
+ return { status: "single_select", kind };
102411
+ if (!native && requested.length === 0) return { status: "aria_empty", kind };
102412
+ if (indexes.some(
102413
+ (i) => elements[i].matches(":disabled, [aria-disabled=true]") || elements[i].closest("optgroup[disabled], [inert]")
102414
+ ))
102415
+ return { status: "disabled", kind };
102416
+ if (mode === "option") return elements[indexes[0]];
102417
+ if (native && mode === "apply") {
102418
+ const setSelected = Object.getOwnPropertyDescriptor(
102419
+ win.HTMLOptionElement.prototype,
102420
+ "selected"
102421
+ ).set;
102422
+ if (!multiple) {
102423
+ if (indexes.length)
102424
+ Object.getOwnPropertyDescriptor(
102425
+ win.HTMLSelectElement.prototype,
102426
+ "value"
102427
+ ).set.call(this, facts[indexes[0]].value);
102428
+ const setIndex = Object.getOwnPropertyDescriptor(
102429
+ win.HTMLSelectElement.prototype,
102430
+ "selectedIndex"
102431
+ ).set;
102432
+ setIndex.call(this, indexes[0] ?? -1);
102433
+ }
102434
+ for (let i = 0; i < elements.length; i += 1)
102435
+ setSelected.call(elements[i], indexes.includes(i));
102436
+ if (!multiple)
102437
+ Object.getOwnPropertyDescriptor(
102438
+ win.HTMLSelectElement.prototype,
102439
+ "selectedIndex"
102440
+ ).set.call(this, indexes[0] ?? -1);
102441
+ this.dispatchEvent(new win.Event("input", { bubbles: true }));
102442
+ this.dispatchEvent(new win.Event("change", { bubbles: true }));
102443
+ }
102444
+ const selected = facts.filter(
102445
+ (o) => native ? elements[o.index].selected : elements[o.index].getAttribute("aria-selected") === "true"
102446
+ );
102447
+ const selectedMatch = indexes.length === selected.length && indexes.every((i) => selected.some((o) => o.index === i));
102448
+ const triggerText = (this.value || this.textContent || "").trim();
102449
+ const triggerMatch = !native && this.getAttribute("role") !== "listbox" && indexes.length === 1 && triggerText === facts[indexes[0]].label;
102450
+ const verified = selectedMatch || triggerMatch;
102451
+ return {
102452
+ status: "ready",
102453
+ kind,
102454
+ multiple,
102455
+ selected: native ? selected : indexes.map((i) => facts[i]),
102456
+ verified,
102457
+ available
102458
+ };
102459
+ }
102460
+ async function select(ctx, params) {
102461
+ const target2 = stringParam(params, "selector") || stringParam(params, "ref");
102462
+ const options = params.options;
102463
+ if (!target2 || !Array.isArray(options) || options.some(
102464
+ (o) => typeof o !== "string" && !(typeof o === "number" && Number.isSafeInteger(o) && o >= 0)
102465
+ )) {
102466
+ throw new BridgeCommandError(
102467
+ "internal",
102468
+ "select needs a selector and options (strings or non-negative integer indexes)",
102469
+ { reason: "invalid_arguments" }
102470
+ );
102471
+ }
102472
+ const record = ctx.registry.requireSurface(params.tab);
102473
+ const contents = record.view.webContents;
102474
+ const resolve = () => resolveNode(ctx, record, target2, { scroll: false });
102475
+ let node = await resolve();
102476
+ const run = async (mode, choices = options) => {
102477
+ const out = await sendIn(
102478
+ ctx,
102479
+ contents,
102480
+ node.sessionId,
102481
+ "Runtime.callFunctionOn",
102482
+ {
102483
+ objectId: node.objectId,
102484
+ functionDeclaration: selectPage.toString(),
102485
+ arguments: [{ value: mode }, { value: choices }],
102486
+ returnByValue: true
102487
+ }
102488
+ );
102489
+ const result2 = out.result?.value;
102490
+ if (!result2)
102491
+ throw new BridgeCommandError(
102492
+ "element_not_found",
102493
+ "selection target disappeared during selection"
102494
+ );
102495
+ if (result2.status !== "ready")
102496
+ throw new BridgeCommandError(
102497
+ "element_not_found",
102498
+ `select refused: ${result2.status}`,
102499
+ {
102500
+ reason: result2.status,
102501
+ ...result2.available ? { available: result2.available } : {}
102502
+ }
102503
+ );
102504
+ return result2;
102505
+ };
102506
+ const inspect = await sendIn(
102507
+ ctx,
102508
+ contents,
102509
+ node.sessionId,
102510
+ "Runtime.callFunctionOn",
102511
+ {
102512
+ objectId: node.objectId,
102513
+ functionDeclaration: "function () { return this.tagName === 'SELECT'; }",
102514
+ returnByValue: true
102515
+ }
102516
+ );
102517
+ if (inspect.result?.value === true) {
102518
+ await run("apply");
102519
+ await sleep(100);
102520
+ node = await resolve();
102521
+ const result2 = await run("read");
102522
+ ctx.registry.touch(record);
102523
+ return {
102524
+ selected: result2.selected,
102525
+ kind: "native",
102526
+ verified: result2.verified,
102527
+ ...pageOf(record.view)
102528
+ };
102529
+ }
102530
+ await run("trigger");
102531
+ if (options.length !== 1)
102532
+ throw new BridgeCommandError(
102533
+ "element_not_found",
102534
+ "ARIA selection needs exactly one option",
102535
+ { reason: "single_select" }
102536
+ );
102537
+ await sendIn(ctx, contents, node.sessionId, "Runtime.callFunctionOn", {
102538
+ objectId: node.objectId,
102539
+ functionDeclaration: CLICK_FUNCTION,
102540
+ returnByValue: true
102541
+ });
102542
+ await sleep(100);
102543
+ node = await resolve();
102544
+ const description = await run("describe");
102545
+ if (description.multiple || options.length !== 1)
102546
+ throw new BridgeCommandError(
102547
+ "element_not_found",
102548
+ "ARIA selection currently needs one option on a single-select widget",
102549
+ { reason: "single_select" }
102550
+ );
102551
+ const before = await run("read");
102552
+ const chosen = await sendIn(
102553
+ ctx,
102554
+ contents,
102555
+ node.sessionId,
102556
+ "Runtime.callFunctionOn",
102557
+ {
102558
+ objectId: node.objectId,
102559
+ functionDeclaration: selectPage.toString(),
102560
+ arguments: [{ value: "option" }, { value: options }],
102561
+ returnByValue: false
102562
+ }
102563
+ );
102564
+ if (!chosen.result?.objectId)
102565
+ throw new BridgeCommandError(
102566
+ "element_not_found",
102567
+ "the matched option disappeared"
102568
+ );
102569
+ await sendIn(ctx, contents, node.sessionId, "Runtime.callFunctionOn", {
102570
+ objectId: chosen.result.objectId,
102571
+ functionDeclaration: CLICK_FUNCTION,
102572
+ returnByValue: true
102573
+ });
102574
+ await sleep(100);
102575
+ node = await resolve();
102576
+ let result;
102577
+ try {
102578
+ result = await run("read");
102579
+ } catch (error) {
102580
+ if (!(error instanceof BridgeCommandError) || error.code !== "element_not_found")
102581
+ throw error;
102582
+ const text2 = await sendIn(
102583
+ ctx,
102584
+ contents,
102585
+ node.sessionId,
102586
+ "Runtime.callFunctionOn",
102587
+ {
102588
+ objectId: node.objectId,
102589
+ functionDeclaration: "function () { return (this.value || this.textContent || '').trim(); }",
102590
+ returnByValue: true
102591
+ }
102592
+ );
102593
+ return {
102594
+ selected: before.selected,
102595
+ kind: "aria",
102596
+ verified: before.selected?.length === 1 && text2.result?.value === before.selected[0].label,
102597
+ ...pageOf(record.view)
102598
+ };
102599
+ }
102600
+ ctx.registry.touch(record);
102601
+ return {
102602
+ selected: result.selected,
102603
+ kind: "aria",
102604
+ verified: result.verified,
102605
+ ...pageOf(record.view)
102606
+ };
102607
+ }
102090
102608
  const MAX_AGENT_TABS = 8;
102091
102609
  const BACKGROUND_VIEWPORT = {
102092
102610
  x: 0,
@@ -103945,6 +104463,7 @@ const DOCUMENT_SCOPED = /* @__PURE__ */ new Set([
103945
104463
  // `hover` dispatches page events at the CURRENT document and reports its hit
103946
104464
  // stack, so it is authorized on entry and on the result exactly like `click`.
103947
104465
  "hover",
104466
+ "select",
103948
104467
  "scroll",
103949
104468
  "logs",
103950
104469
  // `download` names a control on the CURRENT document (the link or button that
@@ -103978,6 +104497,10 @@ const NAVIGATING_ACTIONS = /* @__PURE__ */ new Set([
103978
104497
  // `changed`). It is deliberately NOT in NAVIGATION_ACTIONS: no per-hop `Fetch`
103979
104498
  // gate, for the reason that set's comment gives.
103980
104499
  "hover",
104500
+ // A select change handler can navigate just like hover: adopt/authorize the
104501
+ // landing on success OR throw, and restore if unapproved. No native popup,
104502
+ // no agent-initiated document request to intercept with Fetch.
104503
+ "select",
103981
104504
  "download",
103982
104505
  "upload"
103983
104506
  ]);
@@ -103999,6 +104522,7 @@ const TAB_SCOPED = /* @__PURE__ */ new Set([
103999
104522
  "type",
104000
104523
  "press",
104001
104524
  "hover",
104525
+ "select",
104002
104526
  "scroll",
104003
104527
  "logs",
104004
104528
  "close",
@@ -104277,6 +104801,8 @@ class BrowserHost {
104277
104801
  return press(this, params);
104278
104802
  case "hover":
104279
104803
  return hover(this, params);
104804
+ case "select":
104805
+ return select(this, params);
104280
104806
  case "download":
104281
104807
  return download(this, params);
104282
104808
  case "upload":