local-operator-ui 0.48.12 → 0.48.13

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 (104) hide show
  1. package/out/main/index.js +1556 -129
  2. package/out/preload/recording-encoder.js +18 -0
  3. package/out/renderer/assets/{_basePickBy-V9OaYcB-.js → _basePickBy-CKmx30yF.js} +1 -1
  4. package/out/renderer/assets/{_baseUniq-8wB3Js4X.js → _baseUniq-Bpi6IoVg.js} +1 -1
  5. package/out/renderer/assets/{agent-details-page-BTl_-YEX.js → agent-details-page-DO7d_ih5.js} +1 -1
  6. package/out/renderer/assets/{agent-hub-page-DTtPTc9w.js → agent-hub-page-DqIdGNHj.js} +1 -1
  7. package/out/renderer/assets/{agents-page-Bu2x9OlH.js → agents-page-DMudbdAq.js} +3 -3
  8. package/out/renderer/assets/{approvalsOverlay-SZio8Ofp.js → approvalsOverlay-Bnfsw8L9.js} +1 -1
  9. package/out/renderer/assets/{arc-Cbb3dsAi.js → arc-OIEGuBTn.js} +1 -1
  10. package/out/renderer/assets/{architectureDiagram-IEHRJDOE-DgaTU5dP.js → architectureDiagram-IEHRJDOE-CzKyJ4cr.js} +1 -1
  11. package/out/renderer/assets/{avatar-cropper-BFcwvqI6.js → avatar-cropper-DXYS7VvI.js} +1 -1
  12. package/out/renderer/assets/{blockDiagram-JOT3LUYC-DJCvCjpH.js → blockDiagram-JOT3LUYC-ChQDHo8e.js} +1 -1
  13. package/out/renderer/assets/{book-open-pRuf5Is_.js → book-open-BAlAnYWc.js} +1 -1
  14. package/out/renderer/assets/browser-page-DKyFBSCV.js +1 -0
  15. package/out/renderer/assets/{browser-webauthn-prompt-DD_xVECS.js → browser-webauthn-prompt-C7dwOBvW.js} +1 -1
  16. package/out/renderer/assets/{building-2-DlFqaCQ3.js → building-2-B4SNlD8W.js} +1 -1
  17. package/out/renderer/assets/{c4Diagram-VJAJSXHY-BFW_Pmyj.js → c4Diagram-VJAJSXHY-DP6s4-gF.js} +1 -1
  18. package/out/renderer/assets/channel-DXyM-LNQ.js +1 -0
  19. package/out/renderer/assets/{chunk-4BMEZGHF-C1dT2h3n.js → chunk-4BMEZGHF-CfMGVgaT.js} +1 -1
  20. package/out/renderer/assets/{chunk-A2AXSNBT-CwOEb50A.js → chunk-A2AXSNBT-C7LLSPSK.js} +1 -1
  21. package/out/renderer/assets/{chunk-AEK57VVT-BjIII1gB.js → chunk-AEK57VVT-ssRgcUgK.js} +1 -1
  22. package/out/renderer/assets/{chunk-D6G4REZN-BKlGt3O8.js → chunk-D6G4REZN-w9sKgwLw.js} +1 -1
  23. package/out/renderer/assets/{chunk-RZ5BOZE2-CBIwKm85.js → chunk-RZ5BOZE2-C3JZadRL.js} +1 -1
  24. package/out/renderer/assets/{chunk-XZIHB7SX-Dd5yyEcI.js → chunk-XZIHB7SX-A81zsT6l.js} +1 -1
  25. package/out/renderer/assets/classDiagram-GIVACNV2-BouPcaGl.js +1 -0
  26. package/out/renderer/assets/classDiagram-v2-COTLJTTW-BouPcaGl.js +1 -0
  27. package/out/renderer/assets/clone-BWgv46LY.js +1 -0
  28. package/out/renderer/assets/{console-mirror-DkS5GNu7.js → console-mirror-Bd9Lx41W.js} +1 -1
  29. package/out/renderer/assets/{consoleCapture-DxKC5eT4.js → consoleCapture-TtI3yw3S.js} +1 -1
  30. package/out/renderer/assets/{conversation-input-sync-Cc-qTPXt.js → conversation-input-sync-B0udOX2P.js} +266 -261
  31. package/out/renderer/assets/{dagre-OKDRZEBW-BKO9uMeH.js → dagre-OKDRZEBW-futvc0Ip.js} +1 -1
  32. package/out/renderer/assets/{diagram-SSKATNLV-CJmi-g4h.js → diagram-SSKATNLV-DRqJ6jPO.js} +1 -1
  33. package/out/renderer/assets/{diagram-VNBRO52H-5GOk0Odf.js → diagram-VNBRO52H-CoXmeLca.js} +1 -1
  34. package/out/renderer/assets/{erDiagram-Q7BY3M3F-CwFYC9OY.js → erDiagram-Q7BY3M3F-DamfzVbu.js} +1 -1
  35. package/out/renderer/assets/{error-boundary-CNDQLahI.js → error-boundary-DQKaFMb3.js} +1 -1
  36. package/out/renderer/assets/{flowDiagram-4HSFHLVR-BlZSGS3e.js → flowDiagram-4HSFHLVR-D_JracNp.js} +1 -1
  37. package/out/renderer/assets/{ganttDiagram-APWFNJXF-BlzfkV0E.js → ganttDiagram-APWFNJXF-DxkMvvzu.js} +1 -1
  38. package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-D8yYVXgc.js → gitGraphDiagram-7IBYFJ6S-Ch2WfuGl.js} +1 -1
  39. package/out/renderer/assets/{graph-CujHlOYc.js → graph-E23dAXFZ.js} +1 -1
  40. package/out/renderer/assets/{hash-DwXIY4Qy.js → hash-Ccn2EAfy.js} +1 -1
  41. package/out/renderer/assets/{heart-DteLgKgY.js → heart-DRuR5lyD.js} +1 -1
  42. package/out/renderer/assets/{image-plus-D_LIjrWn.js → image-plus-CO38-orC.js} +1 -1
  43. package/out/renderer/assets/{index-CNRyf6TH.js → index-871YiMwJ.js} +1 -1
  44. package/out/renderer/assets/{index-BEwj3YQh.js → index-Cvms1u2n.js} +1 -1
  45. package/out/renderer/assets/{index-Cpnczd2X.js → index-D8bU6n8S.js} +204 -204
  46. package/out/renderer/assets/{index-dUG4NGMr.js → index-DszIY8oB.js} +1 -1
  47. package/out/renderer/assets/index-dyl6bCMv.css +1 -0
  48. package/out/renderer/assets/infoDiagram-PH2N3AL5-BzxTTi16.js +2 -0
  49. package/out/renderer/assets/{installer-By84PQn_.js → installer-BsEQzRI7.js} +1 -1
  50. package/out/renderer/assets/{journeyDiagram-U35MCT3I-3t-xjzS3.js → journeyDiagram-U35MCT3I-7o71pCw6.js} +1 -1
  51. package/out/renderer/assets/{kanban-definition-NDS4AKOZ-D0Q_2Dn8.js → kanban-definition-NDS4AKOZ-Ba2fKg5g.js} +1 -1
  52. package/out/renderer/assets/{layout-DkxReRsJ.js → layout-u9aNonBe.js} +1 -1
  53. package/out/renderer/assets/{legacy-agents-page-DfgBWM9T.js → legacy-agents-page-BUZN75el.js} +1 -1
  54. package/out/renderer/assets/{library-page-DdEXaPAq.js → library-page-CnofZnaB.js} +3 -3
  55. package/out/renderer/assets/{mermaid.core-wEi2Xha0.js → mermaid.core-BO7pGBkG.js} +19 -19
  56. package/out/renderer/assets/{mesh-page-Cvik8kDZ.js → mesh-page-BCIVB0Hi.js} +1 -1
  57. package/out/renderer/assets/{messages-BUgXrFuu.js → messages-BZscpRIC.js} +10 -10
  58. package/out/renderer/assets/{mindmap-definition-ALO5MXBD-Ckfeu4g8.js → mindmap-definition-ALO5MXBD--7E9KpWa.js} +1 -1
  59. package/out/renderer/assets/{mini-BTwSkiUX.js → mini-CdnwZ2z8.js} +1 -1
  60. package/out/renderer/assets/{notebook-pen-DaCDU6pT.js → notebook-pen-Dtk48ynr.js} +1 -1
  61. package/out/renderer/assets/{notifications-page-gR6HfBzt.js → notifications-page-DVFMPXXe.js} +1 -1
  62. package/out/renderer/assets/{org-access-CgK50sRd.js → org-access-HM79rP3f.js} +1 -1
  63. package/out/renderer/assets/{org-surface-gate-Cj5TZEFY.js → org-surface-gate-DKBYiK5D.js} +1 -1
  64. package/out/renderer/assets/{page-header-BxzHNbRL.js → page-header-Y2McYPDx.js} +1 -1
  65. package/out/renderer/assets/{path-utils-WME2-1t6.js → path-utils-BrLZulPz.js} +33 -33
  66. package/out/renderer/assets/{pieDiagram-IB7DONF6-hQbISGxe.js → pieDiagram-IB7DONF6-D5TiBcOS.js} +1 -1
  67. package/out/renderer/assets/{project-markdown-GTsXHeR9.js → project-markdown-DM2zz9cY.js} +1 -1
  68. package/out/renderer/assets/{projects-page-Maua55-d.js → projects-page-DQW7vu5M.js} +1 -1
  69. package/out/renderer/assets/{publication-validation-CEt8ujWM.js → publication-validation-CjUR3KXX.js} +1 -1
  70. package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-DoZgXTb2.js → quadrantDiagram-7GDLP6J5-BxqgjzcX.js} +1 -1
  71. package/out/renderer/assets/{radar-MK3ICKWK-BBfDik4W.js → radar-MK3ICKWK-RhGIy4cy.js} +1 -1
  72. package/out/renderer/assets/{radient-auth-buttons-D-rNfHt_.js → radient-auth-buttons-CjcIy4Ra.js} +1 -1
  73. package/out/renderer/assets/recordingEncoder-vsQVVLgp.js +1 -0
  74. package/out/renderer/assets/{requirementDiagram-KVF5MWMF-PQXtpJrE.js → requirementDiagram-KVF5MWMF-BbMnuHR5.js} +1 -1
  75. package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-sazrDowy.js → sankeyDiagram-QLVOVGJD-B5rU7VZ5.js} +1 -1
  76. package/out/renderer/assets/{schedules-page-CysGzIAB.js → schedules-page-D_c2nY3o.js} +1 -1
  77. package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-B_aEMcxw.js → sequenceDiagram-X6HHIX6F-B3c6QPin.js} +1 -1
  78. package/out/renderer/assets/settings-page-AbHZDN8P.js +288 -0
  79. package/out/renderer/assets/{smartart-CC6vc4y6.js → smartart-K65nA3xt.js} +1 -1
  80. package/out/renderer/assets/{stateDiagram-DGXRK772-CAtgbx5z.js → stateDiagram-DGXRK772-BaaeHACk.js} +1 -1
  81. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-B8p6qkit.js +1 -0
  82. package/out/renderer/assets/team-bridge-page-Cgvoi96Y.js +50 -0
  83. package/out/renderer/assets/{team-bridge-scope-preference-BF-iqyAj.js → team-bridge-scope-preference-CgR9TBFd.js} +1 -1
  84. package/out/renderer/assets/{timeline-definition-BDJGKUSR-CRv8lzqI.js → timeline-definition-BDJGKUSR-DazTtN2a.js} +1 -1
  85. package/out/renderer/assets/{use-download-agent-mutation-D5nyCqh7.js → use-download-agent-mutation-DB5SyNA0.js} +1 -1
  86. package/out/renderer/assets/{use-session-snapshot-DzP1uiH5.js → use-session-snapshot-DbuqOFVq.js} +1 -1
  87. package/out/renderer/assets/{xychartDiagram-VJFVF3MP-CjpCMwp7.js → xychartDiagram-VJFVF3MP-7wZpEaYI.js} +1 -1
  88. package/out/renderer/browser-approvals-overlay.html +2 -2
  89. package/out/renderer/console-capture.html +6 -6
  90. package/out/renderer/index.html +8 -8
  91. package/out/renderer/installer.html +5 -5
  92. package/out/renderer/mini.html +8 -8
  93. package/out/renderer/recording-encoder.html +23 -0
  94. package/package.json +1 -1
  95. package/out/renderer/assets/browser-page-DkW1hE9r.js +0 -1
  96. package/out/renderer/assets/channel-CenAtys0.js +0 -1
  97. package/out/renderer/assets/classDiagram-GIVACNV2-CvdzoE0r.js +0 -1
  98. package/out/renderer/assets/classDiagram-v2-COTLJTTW-CvdzoE0r.js +0 -1
  99. package/out/renderer/assets/clone-Bt9QDldY.js +0 -1
  100. package/out/renderer/assets/index-4c2Ov0Zi.css +0 -1
  101. package/out/renderer/assets/infoDiagram-PH2N3AL5-FQyDBbNh.js +0 -2
  102. package/out/renderer/assets/settings-page-Cwatgoy0.js +0 -288
  103. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-Be5VZUL8.js +0 -1
  104. package/out/renderer/assets/team-bridge-page-Y9vIMvkT.js +0 -50
package/out/main/index.js CHANGED
@@ -2939,7 +2939,8 @@ const enUiAgentsAvatar = {
2939
2939
  "ui.agents.avatar.editor.zoom": "Zoom",
2940
2940
  "ui.agents.avatar.editor.zoom_in": "Zoom in",
2941
2941
  "ui.agents.avatar.editor.zoom_out": "Zoom out",
2942
- "ui.agents.avatar.editor.zoom_value": "{value}×"
2942
+ "ui.agents.avatar.editor.zoom_value": "{value}×",
2943
+ "ui.agents.avatar.add_link": "Add a picture for {name}"
2943
2944
  };
2944
2945
  const enUiAgentsConfig = {
2945
2946
  "ui.agents.config.about": "About {kind} {name}",
@@ -4560,6 +4561,11 @@ const enUiChatComposer = {
4560
4561
  "ui.chat.composer.confirm_recording_hint": "Confirm recording (Enter)",
4561
4562
  "ui.chat.composer.cancel_recording": "Cancel recording",
4562
4563
  "ui.chat.composer.cancel_recording_hint": "Cancel recording (Esc)",
4564
+ "ui.chat.composer.insert_transcript": "Insert transcript",
4565
+ "ui.chat.composer.insert_transcript_hint": "Insert transcript to review (Enter)",
4566
+ "ui.chat.composer.send_recording": "Send recording",
4567
+ "ui.chat.composer.send_recording_hint": "Transcribe and send now, no review",
4568
+ "ui.chat.composer.steer_hint": "Steer the agent now (Enter) · Esc stops the turn",
4563
4569
  "ui.chat.composer.stop": "Stop",
4564
4570
  "ui.chat.composer.stop_work_hint": "Stop this session's current work (Esc)",
4565
4571
  "ui.chat.composer.stop_agent": "Stop agent",
@@ -4610,8 +4616,9 @@ const enUiChatComposer = {
4610
4616
  };
4611
4617
  const enUiChatComposerMedia = {
4612
4618
  "ui.chat.composer_media.recording": "Recording",
4613
- "ui.chat.composer_media.confirms": "confirms",
4619
+ "ui.chat.composer_media.confirms": "inserts",
4614
4620
  "ui.chat.composer_media.cancels": "cancels",
4621
+ "ui.chat.composer_media.sends_now": "sends now",
4615
4622
  "ui.chat.composer_media.pasted_type": "Pasted {mimeType}",
4616
4623
  "ui.chat.composer_media.pasted_file": "Pasted file",
4617
4624
  "ui.chat.composer_media.preview_failed": "Could not be previewed",
@@ -9233,7 +9240,12 @@ const enUiSettingsAppearance = {
9233
9240
  "ui.settings.appearance.theme.tokyo_night_storm": "The brighter night — indigo storm skies under the same neon accents.",
9234
9241
  "ui.settings.appearance.theme.tokyo_night": "Deep blue-purple night with a bright blue accent.",
9235
9242
  "ui.settings.appearance.theme.tron": "Electric cyan circuitry on the Grid's blue-black.",
9236
- "ui.settings.appearance.theme.vaporwave": "Dusty pink and faded teal pastels on deep mall-purple."
9243
+ "ui.settings.appearance.theme.vaporwave": "Dusty pink and faded teal pastels on deep mall-purple.",
9244
+ "ui.settings.appearance.agent_avatar_size_setting.agent_picture_size": "Agent picture size",
9245
+ "ui.settings.appearance.agent_avatar_size_setting.how_large_the_agent_s_picture_appears_in_the_chat_window_and_the_chat": "How large agent pictures appear in the transcript and the chat header. Sidebar rows keep their size.",
9246
+ "ui.settings.appearance.agent_avatar_size_setting.small": "Small",
9247
+ "ui.settings.appearance.agent_avatar_size_setting.medium": "Medium",
9248
+ "ui.settings.appearance.agent_avatar_size_setting.large": "Large"
9237
9249
  };
9238
9250
  const enUiSettingsAppearanceWindowGlass = {
9239
9251
  "ui.settings.appearance.window_glass.label": "Translucent window",
@@ -10633,7 +10645,8 @@ const esUiAgentsAvatar = {
10633
10645
  "ui.agents.avatar.editor.zoom": "Zoom",
10634
10646
  "ui.agents.avatar.editor.zoom_in": "Acercar",
10635
10647
  "ui.agents.avatar.editor.zoom_out": "Alejar",
10636
- "ui.agents.avatar.editor.zoom_value": "{value}×"
10648
+ "ui.agents.avatar.editor.zoom_value": "{value}×",
10649
+ "ui.agents.avatar.add_link": "Añadir una foto para {name}"
10637
10650
  };
10638
10651
  const esUiAgentsConfig = {
10639
10652
  "ui.agents.config.about": "Acerca de {name} ({kind})",
@@ -12254,6 +12267,11 @@ const esUiChatComposer = {
12254
12267
  "ui.chat.composer.confirm_recording_hint": "Confirmar grabación (Intro)",
12255
12268
  "ui.chat.composer.cancel_recording": "Cancelar grabación",
12256
12269
  "ui.chat.composer.cancel_recording_hint": "Cancelar grabación (Esc)",
12270
+ "ui.chat.composer.insert_transcript": "Insertar transcripción",
12271
+ "ui.chat.composer.insert_transcript_hint": "Insertar la transcripción para revisarla (Intro)",
12272
+ "ui.chat.composer.send_recording": "Enviar grabación",
12273
+ "ui.chat.composer.send_recording_hint": "Transcribir y enviar ahora, sin revisar",
12274
+ "ui.chat.composer.steer_hint": "Guiar al agente ahora (Intro) · Esc detiene el turno",
12257
12275
  "ui.chat.composer.stop": "Detener",
12258
12276
  "ui.chat.composer.stop_work_hint": "Detener el trabajo actual de esta sesión (Esc)",
12259
12277
  "ui.chat.composer.stop_agent": "Detener agente",
@@ -12304,8 +12322,9 @@ const esUiChatComposer = {
12304
12322
  };
12305
12323
  const esUiChatComposerMedia = {
12306
12324
  "ui.chat.composer_media.recording": "Grabando",
12307
- "ui.chat.composer_media.confirms": "confirma",
12325
+ "ui.chat.composer_media.confirms": "inserta",
12308
12326
  "ui.chat.composer_media.cancels": "cancela",
12327
+ "ui.chat.composer_media.sends_now": "envía ahora",
12309
12328
  "ui.chat.composer_media.pasted_type": "Pegado {mimeType}",
12310
12329
  "ui.chat.composer_media.pasted_file": "Archivo pegado",
12311
12330
  "ui.chat.composer_media.preview_failed": "No se pudo previsualizar",
@@ -16927,7 +16946,12 @@ const esUiSettingsAppearance = {
16927
16946
  "ui.settings.appearance.theme.tokyo_night_storm": "La noche más brillante — cielos de tormenta índigo bajo los mismos acentos neón.",
16928
16947
  "ui.settings.appearance.theme.tokyo_night": "Noche azul violácea profunda con un acento azul brillante.",
16929
16948
  "ui.settings.appearance.theme.tron": "Circuitos cian eléctricos sobre el negro azulado de la Grid.",
16930
- "ui.settings.appearance.theme.vaporwave": "Pasteles rosa empolvado y verde azulado desteñido sobre un morado profundo de centro comercial."
16949
+ "ui.settings.appearance.theme.vaporwave": "Pasteles rosa empolvado y verde azulado desteñido sobre un morado profundo de centro comercial.",
16950
+ "ui.settings.appearance.agent_avatar_size_setting.agent_picture_size": "Tamaño de la foto del agente",
16951
+ "ui.settings.appearance.agent_avatar_size_setting.how_large_the_agent_s_picture_appears_in_the_chat_window_and_the_chat": "Tamaño de las fotos de los agentes en la transcripción y en la cabecera del chat. Las filas de la barra lateral mantienen su tamaño.",
16952
+ "ui.settings.appearance.agent_avatar_size_setting.small": "Pequeño",
16953
+ "ui.settings.appearance.agent_avatar_size_setting.medium": "Mediano",
16954
+ "ui.settings.appearance.agent_avatar_size_setting.large": "Grande"
16931
16955
  };
16932
16956
  const esUiSettingsAppearanceWindowGlass = {
16933
16957
  "ui.settings.appearance.window_glass.label": "Ventana translúcida",
@@ -18327,7 +18351,8 @@ const frUiAgentsAvatar = {
18327
18351
  "ui.agents.avatar.editor.zoom": "Zoom",
18328
18352
  "ui.agents.avatar.editor.zoom_in": "Zoom avant",
18329
18353
  "ui.agents.avatar.editor.zoom_out": "Zoom arrière",
18330
- "ui.agents.avatar.editor.zoom_value": "{value}×"
18354
+ "ui.agents.avatar.editor.zoom_value": "{value}×",
18355
+ "ui.agents.avatar.add_link": "Ajouter une photo pour {name}"
18331
18356
  };
18332
18357
  const frUiAgentsConfig = {
18333
18358
  "ui.agents.config.about": "Concerne : {kind} {name}",
@@ -19948,6 +19973,11 @@ const frUiChatComposer = {
19948
19973
  "ui.chat.composer.confirm_recording_hint": "Confirmer l’enregistrement (Entrée)",
19949
19974
  "ui.chat.composer.cancel_recording": "Annuler l’enregistrement",
19950
19975
  "ui.chat.composer.cancel_recording_hint": "Annuler l’enregistrement (Échap)",
19976
+ "ui.chat.composer.insert_transcript": "Insérer la transcription",
19977
+ "ui.chat.composer.insert_transcript_hint": "Insérer la transcription pour la relire (Entrée)",
19978
+ "ui.chat.composer.send_recording": "Envoyer l’enregistrement",
19979
+ "ui.chat.composer.send_recording_hint": "Transcrire et envoyer maintenant, sans relecture",
19980
+ "ui.chat.composer.steer_hint": "Orienter l’agent maintenant (Entrée) · Échap arrête le tour",
19951
19981
  "ui.chat.composer.stop": "Arrêter",
19952
19982
  "ui.chat.composer.stop_work_hint": "Arrêter le travail en cours de cette session (Échap)",
19953
19983
  "ui.chat.composer.stop_agent": "Arrêter l’agent",
@@ -19998,8 +20028,9 @@ const frUiChatComposer = {
19998
20028
  };
19999
20029
  const frUiChatComposerMedia = {
20000
20030
  "ui.chat.composer_media.recording": "Enregistrement",
20001
- "ui.chat.composer_media.confirms": "confirme",
20031
+ "ui.chat.composer_media.confirms": "insère",
20002
20032
  "ui.chat.composer_media.cancels": "annule",
20033
+ "ui.chat.composer_media.sends_now": "envoie maintenant",
20003
20034
  "ui.chat.composer_media.pasted_type": "Collé : {mimeType}",
20004
20035
  "ui.chat.composer_media.pasted_file": "Fichier collé",
20005
20036
  "ui.chat.composer_media.preview_failed": "Aperçu impossible",
@@ -24621,7 +24652,12 @@ const frUiSettingsAppearance = {
24621
24652
  "ui.settings.appearance.theme.tokyo_night_storm": "La nuit la plus lumineuse — ciel d’orage indigo sous les mêmes accents néon.",
24622
24653
  "ui.settings.appearance.theme.tokyo_night": "Nuit bleu-violet profond avec un accent bleu vif.",
24623
24654
  "ui.settings.appearance.theme.tron": "Circuits cyan électrique sur le bleu-noir de la Grid.",
24624
- "ui.settings.appearance.theme.vaporwave": "Pastels rose poudré et bleu-vert délavé sur un violet de galerie marchande."
24655
+ "ui.settings.appearance.theme.vaporwave": "Pastels rose poudré et bleu-vert délavé sur un violet de galerie marchande.",
24656
+ "ui.settings.appearance.agent_avatar_size_setting.agent_picture_size": "Taille de la photo de l’agent",
24657
+ "ui.settings.appearance.agent_avatar_size_setting.how_large_the_agent_s_picture_appears_in_the_chat_window_and_the_chat": "Taille des photos des agents dans la transcription et dans l’en-tête de conversation. Les lignes de la barre latérale gardent leur taille.",
24658
+ "ui.settings.appearance.agent_avatar_size_setting.small": "Petit",
24659
+ "ui.settings.appearance.agent_avatar_size_setting.medium": "Moyen",
24660
+ "ui.settings.appearance.agent_avatar_size_setting.large": "Grand"
24625
24661
  };
24626
24662
  const frUiSettingsAppearanceWindowGlass = {
24627
24663
  "ui.settings.appearance.window_glass.label": "Fenêtre translucide",
@@ -26021,7 +26057,8 @@ const hiUiAgentsAvatar = {
26021
26057
  "ui.agents.avatar.editor.zoom": "ज़ूम",
26022
26058
  "ui.agents.avatar.editor.zoom_in": "ज़ूम बढ़ाएँ",
26023
26059
  "ui.agents.avatar.editor.zoom_out": "ज़ूम घटाएँ",
26024
- "ui.agents.avatar.editor.zoom_value": "{value}×"
26060
+ "ui.agents.avatar.editor.zoom_value": "{value}×",
26061
+ "ui.agents.avatar.add_link": "{name} के लिए तस्वीर जोड़ें"
26025
26062
  };
26026
26063
  const hiUiAgentsConfig = {
26027
26064
  "ui.agents.config.about": "{kind} {name} के बारे में",
@@ -27642,6 +27679,11 @@ const hiUiChatComposer = {
27642
27679
  "ui.chat.composer.confirm_recording_hint": "रिकॉर्डिंग की पुष्टि करें (Enter)",
27643
27680
  "ui.chat.composer.cancel_recording": "रिकॉर्डिंग रद्द करें",
27644
27681
  "ui.chat.composer.cancel_recording_hint": "रिकॉर्डिंग रद्द करें (Esc)",
27682
+ "ui.chat.composer.insert_transcript": "ट्रांसक्रिप्ट डालें",
27683
+ "ui.chat.composer.insert_transcript_hint": "जाँचने के लिए ट्रांसक्रिप्ट डालें (Enter)",
27684
+ "ui.chat.composer.send_recording": "रिकॉर्डिंग भेजें",
27685
+ "ui.chat.composer.send_recording_hint": "अभी ट्रांसक्राइब करके भेजें, बिना जाँचे",
27686
+ "ui.chat.composer.steer_hint": "एजेंट को अभी दिशा दें (Enter) · Esc इस टर्न को रोकता है",
27645
27687
  "ui.chat.composer.stop": "रोकें",
27646
27688
  "ui.chat.composer.stop_work_hint": "इस सत्र का मौजूदा काम रोकें (Esc)",
27647
27689
  "ui.chat.composer.stop_agent": "एजेंट रोकें",
@@ -27692,8 +27734,9 @@ const hiUiChatComposer = {
27692
27734
  };
27693
27735
  const hiUiChatComposerMedia = {
27694
27736
  "ui.chat.composer_media.recording": "रिकॉर्डिंग",
27695
- "ui.chat.composer_media.confirms": "पुष्टि करता है",
27737
+ "ui.chat.composer_media.confirms": "डालता है",
27696
27738
  "ui.chat.composer_media.cancels": "रद्द करता है",
27739
+ "ui.chat.composer_media.sends_now": "अभी भेजता है",
27697
27740
  "ui.chat.composer_media.pasted_type": "पेस्ट किया गया {mimeType}",
27698
27741
  "ui.chat.composer_media.pasted_file": "पेस्ट की गई फ़ाइल",
27699
27742
  "ui.chat.composer_media.preview_failed": "प्रीव्यू नहीं दिखाया जा सका",
@@ -32315,7 +32358,12 @@ const hiUiSettingsAppearance = {
32315
32358
  "ui.settings.appearance.theme.tokyo_night_storm": "उजली रात — उसी नीयॉन एक्सेंट के नीचे इंडिगो तूफ़ानी आसमान।",
32316
32359
  "ui.settings.appearance.theme.tokyo_night": "चमकीले नीले एक्सेंट के साथ गहरी नीली-बैंगनी रात।",
32317
32360
  "ui.settings.appearance.theme.tron": "Grid की नीली-काली पृष्ठभूमि पर बिजली जैसी सायन सर्किटरी।",
32318
- "ui.settings.appearance.theme.vaporwave": "गहरे मॉल-पर्पल पर धुँधले गुलाबी और फीके टील पेस्टल।"
32361
+ "ui.settings.appearance.theme.vaporwave": "गहरे मॉल-पर्पल पर धुँधले गुलाबी और फीके टील पेस्टल।",
32362
+ "ui.settings.appearance.agent_avatar_size_setting.agent_picture_size": "एजेंट की तस्वीर का आकार",
32363
+ "ui.settings.appearance.agent_avatar_size_setting.how_large_the_agent_s_picture_appears_in_the_chat_window_and_the_chat": "ट्रांसक्रिप्ट और चैट हेडर में एजेंट की तस्वीरें कितनी बड़ी दिखें। साइडबार की पंक्तियों का आकार नहीं बदलता।",
32364
+ "ui.settings.appearance.agent_avatar_size_setting.small": "छोटा",
32365
+ "ui.settings.appearance.agent_avatar_size_setting.medium": "मध्यम",
32366
+ "ui.settings.appearance.agent_avatar_size_setting.large": "बड़ा"
32319
32367
  };
32320
32368
  const hiUiSettingsAppearanceWindowGlass = {
32321
32369
  "ui.settings.appearance.window_glass.label": "पारभासी विंडो",
@@ -33715,7 +33763,8 @@ const ruUiAgentsAvatar = {
33715
33763
  "ui.agents.avatar.editor.zoom": "Масштаб",
33716
33764
  "ui.agents.avatar.editor.zoom_in": "Приблизить",
33717
33765
  "ui.agents.avatar.editor.zoom_out": "Отдалить",
33718
- "ui.agents.avatar.editor.zoom_value": "{value}×"
33766
+ "ui.agents.avatar.editor.zoom_value": "{value}×",
33767
+ "ui.agents.avatar.add_link": "Добавить фото агенту {name}"
33719
33768
  };
33720
33769
  const ruUiAgentsConfig = {
33721
33770
  "ui.agents.config.about": "Контекст: {kind} {name}",
@@ -35321,6 +35370,11 @@ const ruUiChatComposer = {
35321
35370
  "ui.chat.composer.attach_file": "Прикрепить файл",
35322
35371
  "ui.chat.composer.cancel_recording": "Отменить запись",
35323
35372
  "ui.chat.composer.cancel_recording_hint": "Отменить запись (Esc)",
35373
+ "ui.chat.composer.insert_transcript": "Вставить расшифровку",
35374
+ "ui.chat.composer.insert_transcript_hint": "Вставить расшифровку для проверки (Enter)",
35375
+ "ui.chat.composer.send_recording": "Отправить запись",
35376
+ "ui.chat.composer.send_recording_hint": "Расшифровать и отправить сразу, без проверки",
35377
+ "ui.chat.composer.steer_hint": "Направить агента сейчас (Enter) · Esc остановит ход",
35324
35378
  "ui.chat.composer.clear_message": "Очистить сообщение",
35325
35379
  "ui.chat.composer.confirm_recording": "Подтвердить запись",
35326
35380
  "ui.chat.composer.confirm_recording_hint": "Подтвердить запись (Enter)",
@@ -35386,7 +35440,8 @@ const ruUiChatComposer = {
35386
35440
  };
35387
35441
  const ruUiChatComposerMedia = {
35388
35442
  "ui.chat.composer_media.cancels": "отменяет",
35389
- "ui.chat.composer_media.confirms": "подтверждает",
35443
+ "ui.chat.composer_media.sends_now": "отправляет сразу",
35444
+ "ui.chat.composer_media.confirms": "вставляет",
35390
35445
  "ui.chat.composer_media.pasted_file": "Вставленный файл",
35391
35446
  "ui.chat.composer_media.pasted_type": "Вставлено: {mimeType}",
35392
35447
  "ui.chat.composer_media.preview_failed": "Не удалось показать",
@@ -40009,7 +40064,12 @@ const ruUiSettingsAppearance = {
40009
40064
  "ui.settings.appearance.theme.tokyo_night_storm": "Более яркая ночь: грозовое небо индиго и те же неоновые акценты.",
40010
40065
  "ui.settings.appearance.theme.tokyo_night": "Глубокая сине-фиолетовая ночь с ярким синим акцентом.",
40011
40066
  "ui.settings.appearance.theme.tron": "Электрические циановые цепи на сине-чёрном фоне Сети.",
40012
- "ui.settings.appearance.theme.vaporwave": "Пыльно-розовая и выцветшая бирюзовая пастель на глубоком фиолетовом фоне молла."
40067
+ "ui.settings.appearance.theme.vaporwave": "Пыльно-розовая и выцветшая бирюзовая пастель на глубоком фиолетовом фоне молла.",
40068
+ "ui.settings.appearance.agent_avatar_size_setting.agent_picture_size": "Размер фото агента",
40069
+ "ui.settings.appearance.agent_avatar_size_setting.how_large_the_agent_s_picture_appears_in_the_chat_window_and_the_chat": "Размер фото агентов в транскрипте и в заголовке чата. Строки боковой панели остаются прежними.",
40070
+ "ui.settings.appearance.agent_avatar_size_setting.small": "Маленький",
40071
+ "ui.settings.appearance.agent_avatar_size_setting.medium": "Средний",
40072
+ "ui.settings.appearance.agent_avatar_size_setting.large": "Большой"
40013
40073
  };
40014
40074
  const ruUiSettingsAppearanceWindowGlass = {
40015
40075
  "ui.settings.appearance.window_glass.coverage_description": "Какие части окна становятся полупрозрачными. «Только боковые панели» оставляет разговор и страницы непрозрачными. «Всё приложение» также охватывает их и боковые панели; веб-страницы, документы и изображения внутри остаются непрозрачными.",
@@ -41409,7 +41469,8 @@ const urUiAgentsAvatar = {
41409
41469
  "ui.agents.avatar.editor.zoom": "زوم",
41410
41470
  "ui.agents.avatar.editor.zoom_in": "زوم بڑھائیں",
41411
41471
  "ui.agents.avatar.editor.zoom_out": "زوم گھٹائیں",
41412
- "ui.agents.avatar.editor.zoom_value": "{value}×"
41472
+ "ui.agents.avatar.editor.zoom_value": "{value}×",
41473
+ "ui.agents.avatar.add_link": "{name} کے لیے تصویر شامل کریں"
41413
41474
  };
41414
41475
  const urUiAgentsConfig = {
41415
41476
  "ui.agents.config.about": "متعلق: {kind} {name}",
@@ -43030,6 +43091,11 @@ const urUiChatComposer = {
43030
43091
  "ui.chat.composer.confirm_recording_hint": "ریکارڈنگ کی تصدیق کریں (Enter)",
43031
43092
  "ui.chat.composer.cancel_recording": "ریکارڈنگ منسوخ کریں",
43032
43093
  "ui.chat.composer.cancel_recording_hint": "ریکارڈنگ منسوخ کریں (Esc)",
43094
+ "ui.chat.composer.insert_transcript": "ٹرانسکرپٹ داخل کریں",
43095
+ "ui.chat.composer.insert_transcript_hint": "جانچنے کے لیے ٹرانسکرپٹ داخل کریں (Enter)",
43096
+ "ui.chat.composer.send_recording": "ریکارڈنگ بھیجیں",
43097
+ "ui.chat.composer.send_recording_hint": "ٹرانسکرائب کر کے ابھی بھیجیں، جانچے بغیر",
43098
+ "ui.chat.composer.steer_hint": "ایجنٹ کو ابھی ہدایت دیں (Enter) · Esc موجودہ باری روکتا ہے",
43033
43099
  "ui.chat.composer.stop": "روکیں",
43034
43100
  "ui.chat.composer.stop_work_hint": "اس سیشن کا موجودہ کام روکیں (Esc)",
43035
43101
  "ui.chat.composer.stop_agent": "ایجنٹ روکیں",
@@ -43080,8 +43146,9 @@ const urUiChatComposer = {
43080
43146
  };
43081
43147
  const urUiChatComposerMedia = {
43082
43148
  "ui.chat.composer_media.recording": "ریکارڈنگ جاری ہے",
43083
- "ui.chat.composer_media.confirms": "تصدیق کرے",
43149
+ "ui.chat.composer_media.confirms": "داخل کرے",
43084
43150
  "ui.chat.composer_media.cancels": "منسوخ کرے",
43151
+ "ui.chat.composer_media.sends_now": "ابھی بھیجے",
43085
43152
  "ui.chat.composer_media.pasted_type": "چسپاں کردہ {mimeType}",
43086
43153
  "ui.chat.composer_media.pasted_file": "چسپاں کردہ فائل",
43087
43154
  "ui.chat.composer_media.preview_failed": "پیش منظر نہیں دکھایا جا سکا",
@@ -47703,7 +47770,12 @@ const urUiSettingsAppearance = {
47703
47770
  "ui.settings.appearance.theme.tokyo_night_storm": "روشن تر رات — وہی نیون نمایاں رنگ، نیلے طوفانی آسمان کے نیچے۔",
47704
47771
  "ui.settings.appearance.theme.tokyo_night": "گہری نیلی بنفشی رات، روشن نیلے نمایاں رنگ کے ساتھ۔",
47705
47772
  "ui.settings.appearance.theme.tron": "Grid کے نیلے سیاہ پر برقی سایان سرکٹری۔",
47706
- "ui.settings.appearance.theme.vaporwave": "گہرے مال جیسے بنفشی رنگ پر دھندلے گلابی اور مند ٹیل پیسٹل۔"
47773
+ "ui.settings.appearance.theme.vaporwave": "گہرے مال جیسے بنفشی رنگ پر دھندلے گلابی اور مند ٹیل پیسٹل۔",
47774
+ "ui.settings.appearance.agent_avatar_size_setting.agent_picture_size": "ایجنٹ کی تصویر کا سائز",
47775
+ "ui.settings.appearance.agent_avatar_size_setting.how_large_the_agent_s_picture_appears_in_the_chat_window_and_the_chat": "ٹرانسکرپٹ اور چیٹ ہیڈر میں ایجنٹ کی تصویریں کتنی بڑی نظر آئیں۔ سائیڈ بار کی قطاروں کا سائز وہی رہتا ہے۔",
47776
+ "ui.settings.appearance.agent_avatar_size_setting.small": "چھوٹا",
47777
+ "ui.settings.appearance.agent_avatar_size_setting.medium": "درمیانہ",
47778
+ "ui.settings.appearance.agent_avatar_size_setting.large": "بڑا"
47707
47779
  };
47708
47780
  const urUiSettingsAppearanceWindowGlass = {
47709
47781
  "ui.settings.appearance.window_glass.label": "نیم شفاف ونڈو",
@@ -49103,7 +49175,8 @@ const viUiAgentsAvatar = {
49103
49175
  "ui.agents.avatar.editor.zoom": "Thu phóng",
49104
49176
  "ui.agents.avatar.editor.zoom_in": "Phóng to",
49105
49177
  "ui.agents.avatar.editor.zoom_out": "Thu nhỏ",
49106
- "ui.agents.avatar.editor.zoom_value": "{value}×"
49178
+ "ui.agents.avatar.editor.zoom_value": "{value}×",
49179
+ "ui.agents.avatar.add_link": "Thêm ảnh cho {name}"
49107
49180
  };
49108
49181
  const viUiAgentsConfig = {
49109
49182
  "ui.agents.config.about": "Về {kind} {name}",
@@ -50713,6 +50786,11 @@ const viUiChatComposer = {
50713
50786
  "ui.chat.composer.confirm_recording_hint": "Xác nhận ghi âm (Enter)",
50714
50787
  "ui.chat.composer.cancel_recording": "Hủy ghi âm",
50715
50788
  "ui.chat.composer.cancel_recording_hint": "Hủy ghi âm (Esc)",
50789
+ "ui.chat.composer.insert_transcript": "Chèn bản chép lời",
50790
+ "ui.chat.composer.insert_transcript_hint": "Chèn bản chép lời để xem lại (Enter)",
50791
+ "ui.chat.composer.send_recording": "Gửi bản ghi âm",
50792
+ "ui.chat.composer.send_recording_hint": "Chép lời và gửi ngay, không xem lại",
50793
+ "ui.chat.composer.steer_hint": "Định hướng tác nhân ngay (Enter) · Esc dừng lượt này",
50716
50794
  "ui.chat.composer.stop": "Dừng",
50717
50795
  "ui.chat.composer.stop_work_hint": "Dừng công việc hiện tại của phiên này (Esc)",
50718
50796
  "ui.chat.composer.stop_agent": "Dừng tác nhân",
@@ -50774,8 +50852,9 @@ const viUiChatComposer = {
50774
50852
  };
50775
50853
  const viUiChatComposerMedia = {
50776
50854
  "ui.chat.composer_media.recording": "Đang ghi âm",
50777
- "ui.chat.composer_media.confirms": "xác nhận",
50855
+ "ui.chat.composer_media.confirms": "chèn",
50778
50856
  "ui.chat.composer_media.cancels": "hủy",
50857
+ "ui.chat.composer_media.sends_now": "gửi ngay",
50779
50858
  "ui.chat.composer_media.pasted_type": "Đã dán {mimeType}",
50780
50859
  "ui.chat.composer_media.pasted_file": "Tệp đã dán",
50781
50860
  "ui.chat.composer_media.preview_failed": "Không xem trước được",
@@ -55397,7 +55476,12 @@ const viUiSettingsAppearance = {
55397
55476
  "ui.settings.appearance.theme.tokyo_night_storm": "Đêm sáng hơn — bầu trời bão chàm dưới các điểm nhấn neon.",
55398
55477
  "ui.settings.appearance.theme.tokyo_night": "Đêm xanh tím sâu với điểm nhấn xanh sáng.",
55399
55478
  "ui.settings.appearance.theme.tron": "Mạch điện cyan trên nền đen xanh của Grid.",
55400
- "ui.settings.appearance.theme.vaporwave": "Pastel hồng phai và xanh mòng két nhạt trên nền tím trung tâm thương mại đậm."
55479
+ "ui.settings.appearance.theme.vaporwave": "Pastel hồng phai và xanh mòng két nhạt trên nền tím trung tâm thương mại đậm.",
55480
+ "ui.settings.appearance.agent_avatar_size_setting.agent_picture_size": "Kích thước ảnh tác nhân",
55481
+ "ui.settings.appearance.agent_avatar_size_setting.how_large_the_agent_s_picture_appears_in_the_chat_window_and_the_chat": "Kích thước ảnh tác nhân trong nội dung cuộc trò chuyện và trên thanh tiêu đề cuộc trò chuyện. Các hàng ở thanh bên giữ nguyên kích thước.",
55482
+ "ui.settings.appearance.agent_avatar_size_setting.small": "Nhỏ",
55483
+ "ui.settings.appearance.agent_avatar_size_setting.medium": "Vừa",
55484
+ "ui.settings.appearance.agent_avatar_size_setting.large": "Lớn"
55401
55485
  };
55402
55486
  const viUiSettingsAppearanceWindowGlass = {
55403
55487
  "ui.settings.appearance.window_glass.label": "Cửa sổ trong mờ",
@@ -56797,7 +56881,8 @@ const zhCNUiAgentsAvatar = {
56797
56881
  "ui.agents.avatar.editor.zoom": "缩放",
56798
56882
  "ui.agents.avatar.editor.zoom_in": "放大",
56799
56883
  "ui.agents.avatar.editor.zoom_out": "缩小",
56800
- "ui.agents.avatar.editor.zoom_value": "{value}×"
56884
+ "ui.agents.avatar.editor.zoom_value": "{value}×",
56885
+ "ui.agents.avatar.add_link": "为 {name} 添加头像"
56801
56886
  };
56802
56887
  const zhCNUiAgentsConfig = {
56803
56888
  "ui.agents.config.about": "关于{kind} {name}",
@@ -58407,6 +58492,11 @@ const zhCNUiChatComposer = {
58407
58492
  "ui.chat.composer.confirm_recording_hint": "确认录音(Enter)",
58408
58493
  "ui.chat.composer.cancel_recording": "取消录音",
58409
58494
  "ui.chat.composer.cancel_recording_hint": "取消录音(Esc)",
58495
+ "ui.chat.composer.insert_transcript": "插入转写文字",
58496
+ "ui.chat.composer.insert_transcript_hint": "插入转写文字以供查看(Enter)",
58497
+ "ui.chat.composer.send_recording": "发送录音",
58498
+ "ui.chat.composer.send_recording_hint": "转写并立即发送,无需查看",
58499
+ "ui.chat.composer.steer_hint": "立即引导智能体(Enter)· Esc停止本轮",
58410
58500
  "ui.chat.composer.stop": "停止",
58411
58501
  "ui.chat.composer.stop_work_hint": "停止此会话当前的工作(Esc)",
58412
58502
  "ui.chat.composer.stop_agent": "停止智能体",
@@ -58468,8 +58558,9 @@ const zhCNUiChatComposer = {
58468
58558
  };
58469
58559
  const zhCNUiChatComposerMedia = {
58470
58560
  "ui.chat.composer_media.recording": "录音中",
58471
- "ui.chat.composer_media.confirms": "确认",
58561
+ "ui.chat.composer_media.confirms": "插入",
58472
58562
  "ui.chat.composer_media.cancels": "取消",
58563
+ "ui.chat.composer_media.sends_now": "立即发送",
58473
58564
  "ui.chat.composer_media.pasted_type": "粘贴的{mimeType}",
58474
58565
  "ui.chat.composer_media.pasted_file": "粘贴的文件",
58475
58566
  "ui.chat.composer_media.preview_failed": "无法预览",
@@ -63091,7 +63182,12 @@ const zhCNUiSettingsAppearance = {
63091
63182
  "ui.settings.appearance.theme.tokyo_night_storm": "更明亮的夜晚——靛蓝暴风雨天空,衬以同样的霓虹强调色。",
63092
63183
  "ui.settings.appearance.theme.tokyo_night": "深蓝紫夜色,点缀明亮蓝色。",
63093
63184
  "ui.settings.appearance.theme.tron": "电光青色的电路,铺在Grid的蓝黑底色上。",
63094
- "ui.settings.appearance.theme.vaporwave": "灰粉与褪色青绿粉彩,铺在深商场紫底色上。"
63185
+ "ui.settings.appearance.theme.vaporwave": "灰粉与褪色青绿粉彩,铺在深商场紫底色上。",
63186
+ "ui.settings.appearance.agent_avatar_size_setting.agent_picture_size": "智能体头像大小",
63187
+ "ui.settings.appearance.agent_avatar_size_setting.how_large_the_agent_s_picture_appears_in_the_chat_window_and_the_chat": "智能体头像在对话记录和聊天标题栏中的显示大小。侧边栏各行保持不变。",
63188
+ "ui.settings.appearance.agent_avatar_size_setting.small": "小",
63189
+ "ui.settings.appearance.agent_avatar_size_setting.medium": "中",
63190
+ "ui.settings.appearance.agent_avatar_size_setting.large": "大"
63095
63191
  };
63096
63192
  const zhCNUiSettingsAppearanceWindowGlass = {
63097
63193
  "ui.settings.appearance.window_glass.label": "半透明窗口",
@@ -74410,9 +74506,9 @@ function evaluatePendingServerUpdateMarker(input) {
74410
74506
  return { kind: "expired", marker, reason: "gone" };
74411
74507
  }
74412
74508
  const recorded = marker.groupStartedAt;
74413
- const live = input.liveGroupStamp ?? null;
74414
- if (recorded && live) {
74415
- return recorded === live ? { kind: "running", marker, reason: "owned" } : { kind: "expired", marker, reason: "foreign-pid" };
74509
+ const live2 = input.liveGroupStamp ?? null;
74510
+ if (recorded && live2) {
74511
+ return recorded === live2 ? { kind: "running", marker, reason: "owned" } : { kind: "expired", marker, reason: "foreign-pid" };
74416
74512
  }
74417
74513
  const deadline2 = Date.parse(marker.deadlineAt ?? "");
74418
74514
  const now = input.now ?? Date.now();
@@ -78767,14 +78863,14 @@ async function smokeEnvironment(venv, env) {
78767
78863
  ["serve", "--host", "127.0.0.1", "--port", String(address.port)],
78768
78864
  { env: isolated, stdio: "ignore" }
78769
78865
  );
78770
- let failed = null;
78866
+ let failed2 = null;
78771
78867
  child.on("error", (error) => {
78772
- failed = error;
78868
+ failed2 = error;
78773
78869
  });
78774
78870
  try {
78775
78871
  const deadline2 = Date.now() + 6e4;
78776
78872
  while (Date.now() < deadline2) {
78777
- if (failed) throw failed;
78873
+ if (failed2) throw failed2;
78778
78874
  if (child.exitCode !== null)
78779
78875
  throw new Error(`Backend smoke exited with ${child.exitCode}`);
78780
78876
  try {
@@ -84525,7 +84621,10 @@ const HOST_CAPABILITIES = [
84525
84621
  "record_stop",
84526
84622
  // Sized recording (width/height on record_start) is not a method; the
84527
84623
  // harness capability-gates the two params on this name.
84528
- "record_size"
84624
+ "record_size",
84625
+ // High-quality recording (quality on record_start) is not a method either; the
84626
+ // harness capability-gates the one param on this name.
84627
+ "record_quality"
84529
84628
  ];
84530
84629
  const RUN_DIRNAME = path$1.join("run", "ui-browser");
84531
84630
  const STATE_FILENAME = "host.json";
@@ -91961,18 +92060,18 @@ const CELL_BUDGET = 64 * 1024 * 1024;
91961
92060
  const MANAGED_BUDGET_BYTES = 768 * 1024 * 1024;
91962
92061
  const CELL_RESERVATION_BYTES = 16;
91963
92062
  const EXIT_ACK_GRACE_MS = 3e4;
91964
- function bounded(value, fallback, low, high) {
92063
+ function bounded$1(value, fallback, low, high) {
91965
92064
  return typeof value === "number" && Number.isFinite(value) ? Math.max(low, Math.min(high, Math.floor(value))) : fallback;
91966
92065
  }
91967
92066
  function consolePolicy(value = {}) {
91968
92067
  const input = value && typeof value === "object" ? value : {};
91969
- const maxLive = bounded(input.max_live, DEFAULT_LIVE_LIMIT, 32, 256);
92068
+ const maxLive = bounded$1(input.max_live, DEFAULT_LIVE_LIMIT, 32, 256);
91970
92069
  return {
91971
92070
  maxLive,
91972
- maxOwner: bounded(input.max_owner, DEFAULT_OWNER_LIMIT, 1, 32),
92071
+ maxOwner: bounded$1(input.max_owner, DEFAULT_OWNER_LIMIT, 1, 32),
91973
92072
  userReserved: Math.min(
91974
92073
  Math.floor(maxLive / 4),
91975
- bounded(input.user_reserved, DEFAULT_USER_RESERVED, 4, 32)
92074
+ bounded$1(input.user_reserved, DEFAULT_USER_RESERVED, 4, 32)
91976
92075
  )
91977
92076
  };
91978
92077
  }
@@ -94773,12 +94872,12 @@ class ConsoleHost {
94773
94872
  */
94774
94873
  bumpExitEpoch(entry) {
94775
94874
  const surface = entry.record.surface;
94776
- const live = this.exitEpoch.get(surface) ?? 0;
94875
+ const live2 = this.exitEpoch.get(surface) ?? 0;
94777
94876
  const next = this.options.history?.nextExitEpoch(
94778
94877
  entry.record.sessionId,
94779
94878
  surface,
94780
- live
94781
- ) ?? live + 1;
94879
+ live2
94880
+ ) ?? live2 + 1;
94782
94881
  this.exitEpoch.set(surface, next);
94783
94882
  return next;
94784
94883
  }
@@ -95514,8 +95613,8 @@ class ConsoleHistory {
95514
95613
  * backwards — two exits sharing one generation is exactly the collision the
95515
95614
  * counter exists to make impossible (§12.3).
95516
95615
  */
95517
- nextExitEpoch(sessionId2, surface, live) {
95518
- return Math.max(this.exitEpoch(sessionId2, surface), live) + 1;
95616
+ nextExitEpoch(sessionId2, surface, live2) {
95617
+ return Math.max(this.exitEpoch(sessionId2, surface), live2) + 1;
95519
95618
  }
95520
95619
  /** Remove one surface's history, log and sidecar. */
95521
95620
  remove(sessionId2, surface) {
@@ -96812,6 +96911,259 @@ function labelOf(account) {
96812
96911
  if (!account) return "an unnamed passkey";
96813
96912
  return account.displayName || account.name || "an unnamed passkey";
96814
96913
  }
96914
+ const RECORDING_ENCODER_CMD_CHANNEL = "recording-encoder:cmd";
96915
+ const RECORDING_ENCODER_EVT_CHANNEL = "recording-encoder:evt";
96916
+ function isWellFormedChunk(event) {
96917
+ return event.data instanceof Uint8Array && Number.isFinite(event.ts) && typeof event.key === "boolean" && (event.description === void 0 || event.description instanceof Uint8Array);
96918
+ }
96919
+ function answersTheRequest(event, asked) {
96920
+ return asked !== void 0 && event.width === asked.width && event.height === asked.height && (event.encoder === "hardware" || event.encoder === "software");
96921
+ }
96922
+ function errorData(error) {
96923
+ return error instanceof BridgeCommandError ? error.data : {};
96924
+ }
96925
+ const UNRESPONSIVE_GRACE_MS = 5e3;
96926
+ const live = /* @__PURE__ */ new Set();
96927
+ function disposeAllRecordingEncoders() {
96928
+ for (const dispose of [...live]) {
96929
+ try {
96930
+ dispose();
96931
+ } catch {
96932
+ }
96933
+ }
96934
+ }
96935
+ const routes = /* @__PURE__ */ new Map();
96936
+ let listening = false;
96937
+ function listen() {
96938
+ if (listening) return;
96939
+ listening = true;
96940
+ electron.ipcMain.on(RECORDING_ENCODER_EVT_CHANNEL, (event, message) => {
96941
+ const route = routes.get(event.sender.id);
96942
+ if (!route) return;
96943
+ if (event.senderFrame && event.senderFrame !== event.sender.mainFrame)
96944
+ return;
96945
+ if (!message || typeof message !== "object") return;
96946
+ route.handle(message);
96947
+ });
96948
+ }
96949
+ function createRecordingEncoderService(options) {
96950
+ return {
96951
+ open: (sink) => openWindow(options, sink)
96952
+ };
96953
+ }
96954
+ async function openWindow(options, sink) {
96955
+ listen();
96956
+ const partition = `recording-encoder-${node_crypto.randomUUID()}`;
96957
+ const childSession = electron.session.fromPartition(partition);
96958
+ childSession.setPermissionRequestHandler(
96959
+ (_contents, _permission, callback) => callback(false)
96960
+ );
96961
+ childSession.setPermissionCheckHandler(() => false);
96962
+ childSession.on("will-download", (event) => event.preventDefault());
96963
+ const window = new electron.BrowserWindow({
96964
+ // Never shown, focused or raised: `show: false` with Electron's default
96965
+ // `paintWhenInitiallyHidden` is the measured-working pair for the console
96966
+ // capture view, and an encoder needs no pixels of its own.
96967
+ show: false,
96968
+ width: 320,
96969
+ height: 240,
96970
+ webPreferences: {
96971
+ partition,
96972
+ preload: options.preloadPath,
96973
+ sandbox: true,
96974
+ contextIsolation: true,
96975
+ nodeIntegration: false,
96976
+ webSecurity: true,
96977
+ allowRunningInsecureContent: false,
96978
+ javascript: true,
96979
+ backgroundThrottling: false
96980
+ }
96981
+ });
96982
+ const contents = window.webContents;
96983
+ const windowId = contents.id;
96984
+ let disposed = false;
96985
+ const requested = /* @__PURE__ */ new Map();
96986
+ let unresponsiveTimer = null;
96987
+ const waiters = {
96988
+ ready: null,
96989
+ configure: /* @__PURE__ */ new Map(),
96990
+ flush: /* @__PURE__ */ new Map()
96991
+ };
96992
+ const failWaiters = (reason) => {
96993
+ const error = new BridgeCommandError("internal", reason, {
96994
+ reason: "record_failed"
96995
+ });
96996
+ waiters.ready?.reject(error);
96997
+ waiters.ready = null;
96998
+ for (const waiter of waiters.flush.values()) waiter.reject(error);
96999
+ waiters.flush.clear();
97000
+ for (const [, resolve] of waiters.configure) {
97001
+ resolve({ ok: false, why: "encoder_start", detail: reason });
97002
+ }
97003
+ waiters.configure.clear();
97004
+ };
97005
+ const dispose = () => {
97006
+ if (disposed) return;
97007
+ disposed = true;
97008
+ live.delete(dispose);
97009
+ routes.delete(windowId);
97010
+ if (unresponsiveTimer) clearTimeout(unresponsiveTimer);
97011
+ unresponsiveTimer = null;
97012
+ failWaiters("the encoder window was closed");
97013
+ try {
97014
+ if (!window.isDestroyed()) window.destroy();
97015
+ } catch {
97016
+ }
97017
+ try {
97018
+ void childSession.clearStorageData().catch(() => void 0);
97019
+ } catch {
97020
+ }
97021
+ };
97022
+ live.add(dispose);
97023
+ const died = (reason) => {
97024
+ if (disposed) return;
97025
+ options.log(`[browser] recording encoder window: ${reason}`);
97026
+ failWaiters(reason);
97027
+ sink.onFailure(reason);
97028
+ };
97029
+ routes.set(windowId, {
97030
+ windowId,
97031
+ handle: (event) => {
97032
+ if (disposed) return;
97033
+ switch (event.evt) {
97034
+ case "ready":
97035
+ waiters.ready?.resolve();
97036
+ waiters.ready = null;
97037
+ return;
97038
+ case "configured": {
97039
+ const resolve = waiters.configure.get(event.id);
97040
+ waiters.configure.delete(event.id);
97041
+ if (!resolve) return;
97042
+ const asked = requested.get(event.id);
97043
+ requested.delete(event.id);
97044
+ if (event.ok && !answersTheRequest(event, asked)) {
97045
+ resolve({
97046
+ ok: false,
97047
+ why: "encoder_start",
97048
+ detail: "the encoder answered with a size that was not asked for"
97049
+ });
97050
+ return;
97051
+ }
97052
+ resolve(
97053
+ event.ok ? {
97054
+ ok: true,
97055
+ encoder: event.encoder,
97056
+ codec: event.codec,
97057
+ width: event.width,
97058
+ height: event.height
97059
+ } : {
97060
+ ok: false,
97061
+ why: event.why,
97062
+ detail: String(event.detail).slice(0, 300)
97063
+ }
97064
+ );
97065
+ return;
97066
+ }
97067
+ case "chunk": {
97068
+ if (!isWellFormedChunk(event)) {
97069
+ died("the encoder sent a malformed chunk");
97070
+ return;
97071
+ }
97072
+ sink.onChunk({
97073
+ data: event.data,
97074
+ ts: event.ts,
97075
+ key: event.key,
97076
+ description: event.description
97077
+ });
97078
+ return;
97079
+ }
97080
+ case "frame-done":
97081
+ if (!Number.isInteger(event.seq)) return;
97082
+ sink.onFrameDone(event.seq);
97083
+ return;
97084
+ case "flushed": {
97085
+ const waiter = waiters.flush.get(event.id);
97086
+ waiters.flush.delete(event.id);
97087
+ waiter?.resolve();
97088
+ return;
97089
+ }
97090
+ case "error":
97091
+ died(`the encoder reported an error: ${event.message}`);
97092
+ return;
97093
+ }
97094
+ }
97095
+ });
97096
+ contents.setWindowOpenHandler(() => ({ action: "deny" }));
97097
+ const base = options.documentUrl.split("?")[0];
97098
+ const pin = (event, url) => {
97099
+ if (url.split("?")[0] !== base) event.preventDefault();
97100
+ };
97101
+ contents.on("will-navigate", pin);
97102
+ contents.on("will-redirect", pin);
97103
+ contents.on(
97104
+ "render-process-gone",
97105
+ (_event, details) => died(`the encoder process exited (${details?.reason ?? "unknown"})`)
97106
+ );
97107
+ contents.on("unresponsive", () => {
97108
+ if (unresponsiveTimer || disposed) return;
97109
+ unresponsiveTimer = setTimeout(() => {
97110
+ unresponsiveTimer = null;
97111
+ died("the encoder window stopped responding");
97112
+ }, UNRESPONSIVE_GRACE_MS);
97113
+ unresponsiveTimer.unref?.();
97114
+ });
97115
+ contents.on("responsive", () => {
97116
+ if (unresponsiveTimer) clearTimeout(unresponsiveTimer);
97117
+ unresponsiveTimer = null;
97118
+ });
97119
+ const send2 = (message) => {
97120
+ if (disposed || contents.isDestroyed()) return;
97121
+ contents.send(RECORDING_ENCODER_CMD_CHANNEL, message);
97122
+ };
97123
+ try {
97124
+ const ready = new Promise((resolve, reject) => {
97125
+ waiters.ready = { resolve, reject };
97126
+ });
97127
+ const loaded = contents.loadURL(options.documentUrl);
97128
+ await Promise.all([ready, loaded]);
97129
+ } catch (error) {
97130
+ dispose();
97131
+ throw error;
97132
+ }
97133
+ let configureId = 0;
97134
+ let flushId = 0;
97135
+ return {
97136
+ configure(request) {
97137
+ configureId += 1;
97138
+ const id2 = configureId;
97139
+ return new Promise((resolve) => {
97140
+ waiters.configure.set(id2, resolve);
97141
+ requested.set(id2, { width: request.width, height: request.height });
97142
+ send2({ cmd: "configure", id: id2, ...request });
97143
+ });
97144
+ },
97145
+ frame(seq2, data, ts) {
97146
+ send2({ cmd: "frame", seq: seq2, data, ts });
97147
+ },
97148
+ flush() {
97149
+ flushId += 1;
97150
+ const id2 = flushId;
97151
+ return new Promise((resolve, reject) => {
97152
+ if (disposed) {
97153
+ reject(
97154
+ new BridgeCommandError("internal", "the encoder window is gone", {
97155
+ reason: "record_failed"
97156
+ })
97157
+ );
97158
+ return;
97159
+ }
97160
+ waiters.flush.set(id2, { resolve, reject });
97161
+ send2({ cmd: "flush", id: id2 });
97162
+ });
97163
+ },
97164
+ dispose
97165
+ };
97166
+ }
96815
97167
  const ADDRESS_LIST_ENV = "LOCAL_OPERATOR_UI_BROWSER_ADDRESS_OVERLAY_S2";
96816
97168
  const ADDRESS_LIST_DOCUMENT = "browser-address-overlay-list.html";
96817
97169
  const ADDRESS_LIST_HEADER_HEIGHT = 28;
@@ -98704,9 +99056,6 @@ function readJson(path2) {
98704
99056
  return null;
98705
99057
  }
98706
99058
  }
98707
- function errorData(error) {
98708
- return error instanceof BridgeCommandError ? error.data : {};
98709
- }
98710
99059
  function nextSequence(queue) {
98711
99060
  return (queue ?? []).reduce(
98712
99061
  (highest, entry) => Math.max(highest, entry.sequence),
@@ -98743,10 +99092,10 @@ function consumableGrant(grants, origin, requester, now) {
98743
99092
  }
98744
99093
  function accessState(record, tombstones, storedAllowed, onceGrant, origin, requester, now) {
98745
99094
  if (storedAllowed || onceGrant) return "allowed";
98746
- const live = activeRequest(record, now);
98747
- if (live && live.origin === origin && live.requester === requester) {
98748
- if (!live.decision) return "pending";
98749
- return live.decision === "deny" ? "denied" : "allowed";
99095
+ const live2 = activeRequest(record, now);
99096
+ if (live2 && live2.origin === origin && live2.requester === requester) {
99097
+ if (!live2.decision) return "pending";
99098
+ return live2.decision === "deny" ? "denied" : "allowed";
98750
99099
  }
98751
99100
  const tomb = tombstones?.[receiptKey(origin, requester)];
98752
99101
  if (tomb && now < tomb.expiresAt) return "superseded";
@@ -99496,11 +99845,11 @@ class ApprovalStore {
99496
99845
  * the cap) steps aside, and its requester gets a tombstone so its next poll
99497
99846
  * reads "superseded" rather than the neutral "none". */
99498
99847
  displaceOldest(now) {
99499
- const live = liveQueue(this.queue, now);
99500
- if (!live.length) return;
99501
- const displaced = live.slice(
99848
+ const live2 = liveQueue(this.queue, now);
99849
+ if (!live2.length) return;
99850
+ const displaced = live2.slice(
99502
99851
  0,
99503
- Math.max(1, live.length - ACCESS_QUEUE_CAP + 1)
99852
+ Math.max(1, live2.length - ACCESS_QUEUE_CAP + 1)
99504
99853
  );
99505
99854
  for (const entry of displaced) {
99506
99855
  this.tombstones[receiptKey(entry.origin, entry.requester)] = tombstoneFor(
@@ -99525,8 +99874,8 @@ class ApprovalStore {
99525
99874
  }
99526
99875
  }
99527
99876
  sweep(now) {
99528
- const live = liveQueue(this.queue, now);
99529
- this.queue = live;
99877
+ const live2 = liveQueue(this.queue, now);
99878
+ this.queue = live2;
99530
99879
  this.results = cleanResults(this.results, now);
99531
99880
  for (const [origin, grant] of Object.entries(this.onceGrants)) {
99532
99881
  if (now >= grant.expiresAt) delete this.onceGrants[origin];
@@ -101152,6 +101501,864 @@ function deadline(op, ms, what) {
101152
101501
  );
101153
101502
  });
101154
101503
  }
101504
+ const TIMESCALE = 9e4;
101505
+ const MOVIE_TIMESCALE = 1e3;
101506
+ const MAX_FILE_BYTES = 4294967295;
101507
+ const u32 = (value) => {
101508
+ const out = Buffer.alloc(4);
101509
+ out.writeUInt32BE(value >>> 0);
101510
+ return out;
101511
+ };
101512
+ const u16 = (value) => {
101513
+ const out = Buffer.alloc(2);
101514
+ out.writeUInt16BE(value);
101515
+ return out;
101516
+ };
101517
+ const box = (type2, ...children) => {
101518
+ const body = Buffer.concat(children);
101519
+ return Buffer.concat([
101520
+ u32(8 + body.length),
101521
+ Buffer.from(type2, "latin1"),
101522
+ body
101523
+ ]);
101524
+ };
101525
+ const fullBox = (type2, version, flags, ...children) => box(type2, u32(version << 24 | flags), ...children);
101526
+ const IDENTITY_MATRIX = Buffer.concat(
101527
+ [65536, 0, 0, 0, 65536, 0, 0, 0, 1073741824].map(u32)
101528
+ );
101529
+ function assertOffset(value, what) {
101530
+ if (!Number.isFinite(value) || value < 0 || value > MAX_FILE_BYTES) {
101531
+ throw new RangeError(
101532
+ `${what} does not fit a 32-bit MP4 field (${value}); the recording cap keeps clips far below this`
101533
+ );
101534
+ }
101535
+ }
101536
+ function decodeTimes(input) {
101537
+ const { samples } = input;
101538
+ const first = samples[0].ts;
101539
+ const out = [];
101540
+ for (const sample of samples) {
101541
+ const tick = Math.round((sample.ts - first) * TIMESCALE / 1e6);
101542
+ const previous = out[out.length - 1];
101543
+ if (previous !== void 0 && tick <= previous) {
101544
+ throw new RangeError(
101545
+ `sample timestamps must strictly increase (got tick ${tick} after ${previous})`
101546
+ );
101547
+ }
101548
+ out.push(tick);
101549
+ }
101550
+ return out;
101551
+ }
101552
+ function writeMp4(input) {
101553
+ const { samples, width, height, description } = input;
101554
+ if (samples.length === 0) {
101555
+ throw new RangeError("an MP4 needs at least one sample");
101556
+ }
101557
+ if (!samples[0].key) {
101558
+ throw new RangeError("the first sample must be a key frame");
101559
+ }
101560
+ const count = samples.length;
101561
+ const dts = decodeTimes(input);
101562
+ const lastHold = (() => {
101563
+ const fallback = Math.max(
101564
+ 1,
101565
+ Math.round(input.fallbackFrameUs * TIMESCALE / 1e6)
101566
+ );
101567
+ if (input.endTs === void 0) return fallback;
101568
+ const endTick = Math.round(
101569
+ (input.endTs - samples[0].ts) * TIMESCALE / 1e6
101570
+ );
101571
+ return endTick > dts[count - 1] ? endTick - dts[count - 1] : fallback;
101572
+ })();
101573
+ const durations = dts.map(
101574
+ (tick, index) => index + 1 < count ? dts[index + 1] - tick : lastHold
101575
+ );
101576
+ const totalTicks = durations.reduce((sum, value) => sum + value, 0);
101577
+ const movieDuration = Math.round(totalTicks * MOVIE_TIMESCALE / TIMESCALE);
101578
+ let payload = 0;
101579
+ for (const sample of samples) payload += sample.data.length;
101580
+ assertOffset(payload + 8, "the media data size");
101581
+ const stts = (() => {
101582
+ const runs = [];
101583
+ for (const duration of durations) {
101584
+ const last = runs[runs.length - 1];
101585
+ if (last && last[1] === duration) last[0] += 1;
101586
+ else runs.push([1, duration]);
101587
+ }
101588
+ return fullBox(
101589
+ "stts",
101590
+ 0,
101591
+ 0,
101592
+ u32(runs.length),
101593
+ ...runs.flatMap(([run, duration]) => [u32(run), u32(duration)])
101594
+ );
101595
+ })();
101596
+ const keyIndexes = samples.flatMap(
101597
+ (sample, index) => sample.key ? [u32(index + 1)] : []
101598
+ );
101599
+ const stss = fullBox("stss", 0, 0, u32(keyIndexes.length), ...keyIndexes);
101600
+ const stsc = fullBox("stsc", 0, 0, u32(1), u32(1), u32(count), u32(1));
101601
+ const stsz = fullBox(
101602
+ "stsz",
101603
+ 0,
101604
+ 0,
101605
+ u32(0),
101606
+ u32(count),
101607
+ ...samples.map((sample) => u32(sample.data.length))
101608
+ );
101609
+ const sampleEntry = box(
101610
+ "avc1",
101611
+ Buffer.alloc(6),
101612
+ u16(1),
101613
+ Buffer.alloc(16),
101614
+ u16(width),
101615
+ u16(height),
101616
+ u32(4718592),
101617
+ u32(4718592),
101618
+ u32(0),
101619
+ u16(1),
101620
+ Buffer.alloc(32),
101621
+ u16(24),
101622
+ u16(65535),
101623
+ box("avcC", Buffer.from(description)),
101624
+ // nclx: primaries 1, transfer 1, matrix 1 (BT.709), then the full-range bit
101625
+ // in the top bit of a byte: 0 = limited.
101626
+ box(
101627
+ "colr",
101628
+ Buffer.from("nclx", "latin1"),
101629
+ u16(1),
101630
+ u16(1),
101631
+ u16(1),
101632
+ Buffer.from([0])
101633
+ )
101634
+ );
101635
+ const stsd = fullBox("stsd", 0, 0, u32(1), sampleEntry);
101636
+ const dinf = box(
101637
+ "dinf",
101638
+ fullBox("dref", 0, 0, u32(1), fullBox("url ", 0, 1))
101639
+ );
101640
+ const mdhd = fullBox(
101641
+ "mdhd",
101642
+ 0,
101643
+ 0,
101644
+ u32(0),
101645
+ u32(0),
101646
+ u32(TIMESCALE),
101647
+ u32(totalTicks),
101648
+ u16(21956),
101649
+ u16(0)
101650
+ );
101651
+ const hdlr = fullBox(
101652
+ "hdlr",
101653
+ 0,
101654
+ 0,
101655
+ u32(0),
101656
+ Buffer.from("vide", "latin1"),
101657
+ Buffer.alloc(12),
101658
+ Buffer.from("VideoHandler\0", "latin1")
101659
+ );
101660
+ const tkhd = fullBox(
101661
+ "tkhd",
101662
+ 0,
101663
+ 3,
101664
+ u32(0),
101665
+ u32(0),
101666
+ u32(1),
101667
+ u32(0),
101668
+ u32(movieDuration),
101669
+ Buffer.alloc(8),
101670
+ u16(0),
101671
+ u16(0),
101672
+ u16(0),
101673
+ u16(0),
101674
+ IDENTITY_MATRIX,
101675
+ u32(width << 16),
101676
+ u32(height << 16)
101677
+ );
101678
+ const mvhd = fullBox(
101679
+ "mvhd",
101680
+ 0,
101681
+ 0,
101682
+ u32(0),
101683
+ u32(0),
101684
+ u32(MOVIE_TIMESCALE),
101685
+ u32(movieDuration),
101686
+ u32(65536),
101687
+ u16(256),
101688
+ Buffer.alloc(10),
101689
+ IDENTITY_MATRIX,
101690
+ Buffer.alloc(24),
101691
+ u32(2)
101692
+ );
101693
+ const ftyp = box(
101694
+ "ftyp",
101695
+ Buffer.from("isom", "latin1"),
101696
+ u32(512),
101697
+ Buffer.from("isomiso2avc1mp41", "latin1")
101698
+ );
101699
+ const moovWith = (chunkOffset) => {
101700
+ const stco = fullBox("stco", 0, 0, u32(1), u32(chunkOffset));
101701
+ const stbl = box("stbl", stsd, stts, stss, stsc, stsz, stco);
101702
+ const minf = box(
101703
+ "minf",
101704
+ fullBox("vmhd", 0, 1, Buffer.alloc(8)),
101705
+ dinf,
101706
+ stbl
101707
+ );
101708
+ const trak = box("trak", tkhd, box("mdia", mdhd, hdlr, minf));
101709
+ return box("moov", mvhd, trak);
101710
+ };
101711
+ const moovSize = moovWith(0).length;
101712
+ const mdatHeader = Buffer.concat([u32(8 + payload), Buffer.from("mdat")]);
101713
+ const dataStart = ftyp.length + moovSize + mdatHeader.length;
101714
+ assertOffset(dataStart + payload, "the file size");
101715
+ const moov = moovWith(dataStart);
101716
+ const parts = [
101717
+ Buffer.concat([ftyp, moov, mdatHeader]),
101718
+ ...samples.map(
101719
+ (sample) => Buffer.from(
101720
+ sample.data.buffer,
101721
+ sample.data.byteOffset,
101722
+ sample.data.length
101723
+ )
101724
+ )
101725
+ ];
101726
+ return {
101727
+ parts,
101728
+ size: ftyp.length + moov.length + mdatHeader.length + payload,
101729
+ durationMs: movieDuration
101730
+ };
101731
+ }
101732
+ function muxOverheadBound(samples, descriptionBytes) {
101733
+ return 4096 + descriptionBytes + 16 * samples;
101734
+ }
101735
+ const HQ_TIMING = {
101736
+ nudgeMs: 300,
101737
+ firstFrameMs: 3e3,
101738
+ stopCaptureMs: 2e3,
101739
+ flushMs: 1e4,
101740
+ encoderStartMs: 1e4
101741
+ };
101742
+ const HQ_FPS = 10;
101743
+ const KEY_INTERVAL_US = 2e6;
101744
+ const BITRATE_SMALL = 4e6;
101745
+ const BITRATE_FULL_HD = 8e6;
101746
+ const BITRATE_LARGE = 16e6;
101747
+ const AREA_720P = 1280 * 720;
101748
+ const AREA_1080P = 1920 * 1080;
101749
+ const SOFTWARE_MAX_AREA = AREA_1080P;
101750
+ const DRAIN_MS = 3e3;
101751
+ const PNG_SIGNATURE = [137, 80, 78, 71];
101752
+ function bitrateFor(width, height) {
101753
+ const area = width * height;
101754
+ if (area <= AREA_720P) return BITRATE_SMALL;
101755
+ if (area <= AREA_1080P) return BITRATE_FULL_HD;
101756
+ return BITRATE_LARGE;
101757
+ }
101758
+ function pngSize(base64) {
101759
+ const head = Buffer.from(base64.slice(0, 32), "base64");
101760
+ if (head.length < 24) return null;
101761
+ for (let index = 0; index < PNG_SIGNATURE.length; index += 1) {
101762
+ if (head[index] !== PNG_SIGNATURE[index]) return null;
101763
+ }
101764
+ return { width: head.readUInt32BE(16), height: head.readUInt32BE(20) };
101765
+ }
101766
+ function failed(message) {
101767
+ return new BridgeCommandError("internal", message, { reason: "record_failed" });
101768
+ }
101769
+ function unavailable(why, detail) {
101770
+ return new BridgeCommandError(
101771
+ "internal",
101772
+ `high-quality recording is not available here (${detail}). Retry without quality for the standard recording; nothing was started.`,
101773
+ { reason: "record_quality_unavailable", why, detail }
101774
+ );
101775
+ }
101776
+ function bounded(work, ms, onTimeout) {
101777
+ let timer;
101778
+ const timeout = new Promise((_resolve, reject) => {
101779
+ timer = setTimeout(() => reject(onTimeout()), ms);
101780
+ timer.unref?.();
101781
+ });
101782
+ return Promise.race([work, timeout]).finally(() => {
101783
+ if (timer !== void 0) clearTimeout(timer);
101784
+ });
101785
+ }
101786
+ class HqSession {
101787
+ /** Set by `start` once the encoder answered. */
101788
+ encoder = "hardware";
101789
+ codec = "h264";
101790
+ width = 0;
101791
+ height = 0;
101792
+ bitrate = 0;
101793
+ fps = HQ_FPS;
101794
+ cdp;
101795
+ contents;
101796
+ timing;
101797
+ now;
101798
+ maxBytes;
101799
+ onCap;
101800
+ sized;
101801
+ maxWidth;
101802
+ maxHeight;
101803
+ host = null;
101804
+ unsubscribe = null;
101805
+ timers = /* @__PURE__ */ new Set();
101806
+ disposed = false;
101807
+ stopping = false;
101808
+ captureRequested = false;
101809
+ captureStop = null;
101810
+ finishing = null;
101811
+ failure = null;
101812
+ failureHandler = null;
101813
+ failureWaiters = /* @__PURE__ */ new Set();
101814
+ configured = false;
101815
+ configuring = false;
101816
+ pending = null;
101817
+ inFlight = null;
101818
+ seq = 0;
101819
+ gotFrame = false;
101820
+ onFirstFrame = null;
101821
+ restarting = false;
101822
+ restartAgain = false;
101823
+ lastSentAt = null;
101824
+ firstWallMs = null;
101825
+ anchorPageSec;
101826
+ anchorRelUs = 0;
101827
+ lastTsUs = -1e3;
101828
+ samples = [];
101829
+ description = null;
101830
+ payload = 0;
101831
+ capped = false;
101832
+ constructor(options) {
101833
+ this.cdp = options.cdp;
101834
+ this.contents = options.contents;
101835
+ this.timing = { ...HQ_TIMING, ...options.service.timing };
101836
+ this.now = options.now ?? Date.now;
101837
+ this.maxBytes = options.maxBytes;
101838
+ this.onCap = options.onCap;
101839
+ this.sized = options.size;
101840
+ this.maxWidth = options.maxWidth;
101841
+ this.maxHeight = options.maxHeight;
101842
+ }
101843
+ /**
101844
+ * Open the encoder, start the screencast and wait for a first frame.
101845
+ *
101846
+ * Every failure disposes before it throws, so a refused or failed start leaves no
101847
+ * window, subscription or timer. The CALLER still owns the viewport and the
101848
+ * reservation, as it does for the standard path.
101849
+ */
101850
+ static async start(options, registerSession) {
101851
+ const session = new HqSession(options);
101852
+ registerSession(session);
101853
+ try {
101854
+ await session.open(options);
101855
+ return session;
101856
+ } catch (error) {
101857
+ session.dispose();
101858
+ throw error;
101859
+ }
101860
+ }
101861
+ /** Called by `recording.ts` right after `start`: a failure that already happened
101862
+ * is delivered at once, so there is no gap in which a dead encoder is unseen. */
101863
+ onFailure(handler) {
101864
+ this.failureHandler = handler;
101865
+ if (this.failure && !this.disposed) handler(this.failure);
101866
+ }
101867
+ async open(options) {
101868
+ const sink = {
101869
+ onChunk: (chunk) => this.takeChunk(chunk),
101870
+ onFrameDone: (seq2) => this.frameDone(seq2),
101871
+ onFailure: (message) => this.fail(failed(message))
101872
+ };
101873
+ const opening = options.service.open(sink);
101874
+ try {
101875
+ this.host = await bounded(
101876
+ opening,
101877
+ this.timing.encoderStartMs,
101878
+ () => unavailable(
101879
+ "encoder_start",
101880
+ `the encoder window did not open in ${this.timing.encoderStartMs} ms`
101881
+ )
101882
+ );
101883
+ } catch (error) {
101884
+ void opening.then(
101885
+ (late) => {
101886
+ try {
101887
+ late.dispose();
101888
+ } catch {
101889
+ }
101890
+ },
101891
+ () => void 0
101892
+ );
101893
+ throw error instanceof BridgeCommandError && error.data?.reason === "record_quality_unavailable" ? error : unavailable(
101894
+ "encoder_start",
101895
+ error instanceof Error ? error.message : String(error)
101896
+ );
101897
+ }
101898
+ if (this.disposed) {
101899
+ try {
101900
+ this.host?.dispose();
101901
+ } catch {
101902
+ }
101903
+ this.host = null;
101904
+ throw failed("the recording was cancelled while starting");
101905
+ }
101906
+ if (this.sized) await this.configure(this.sized);
101907
+ this.throwIfDisposed();
101908
+ this.unsubscribe = this.cdp.subscribe(
101909
+ this.contents.id,
101910
+ (method, params) => this.onEvent(method, params)
101911
+ );
101912
+ const first = new Promise((resolve) => {
101913
+ this.onFirstFrame = resolve;
101914
+ });
101915
+ this.captureRequested = true;
101916
+ await this.startScreencast();
101917
+ this.throwIfDisposed();
101918
+ this.arm(this.timing.nudgeMs, () => void this.nudge());
101919
+ await this.race(
101920
+ first,
101921
+ this.timing.firstFrameMs,
101922
+ () => failed(
101923
+ `the page produced no frame within ${this.timing.firstFrameMs / 1e3} s of the recording starting, so nothing was recorded`
101924
+ )
101925
+ );
101926
+ }
101927
+ throwIfDisposed() {
101928
+ if (this.disposed)
101929
+ throw failed("the recording was cancelled while starting");
101930
+ }
101931
+ startScreencast() {
101932
+ return this.cdp.send(
101933
+ this.contents,
101934
+ "Page.startScreencast",
101935
+ {
101936
+ format: "png",
101937
+ maxWidth: this.maxWidth,
101938
+ maxHeight: this.maxHeight,
101939
+ everyNthFrame: 1
101940
+ },
101941
+ { deadlineMs: 2e4 }
101942
+ );
101943
+ }
101944
+ /** `work`, or the first failure, or a timeout. */
101945
+ race(work, ms, onTimeout) {
101946
+ return new Promise((resolve, reject) => {
101947
+ let settledOnce = false;
101948
+ const timer = setTimeout(() => finish2(() => reject(onTimeout())), ms);
101949
+ timer.unref?.();
101950
+ const waiter = (error) => finish2(() => reject(error));
101951
+ this.failureWaiters.add(waiter);
101952
+ const finish2 = (action) => {
101953
+ if (settledOnce) return;
101954
+ settledOnce = true;
101955
+ clearTimeout(timer);
101956
+ this.failureWaiters.delete(waiter);
101957
+ action();
101958
+ };
101959
+ work.then(
101960
+ (value) => finish2(() => resolve(value)),
101961
+ (error) => finish2(() => reject(error))
101962
+ );
101963
+ });
101964
+ }
101965
+ arm(ms, action) {
101966
+ const timer = setTimeout(() => {
101967
+ this.timers.delete(timer);
101968
+ if (!this.disposed) action();
101969
+ }, ms);
101970
+ timer.unref?.();
101971
+ this.timers.add(timer);
101972
+ }
101973
+ /** A first frame larger than the ceiling (the nudge's unscaled screenshot of a
101974
+ * presented tab) is configured at the size the screencast would have scaled it
101975
+ * to, so every later frame matches and the encoder document scales this one. */
101976
+ fitToCeiling(size) {
101977
+ const scale = Math.min(
101978
+ 1,
101979
+ this.maxWidth / size.width,
101980
+ this.maxHeight / size.height
101981
+ );
101982
+ return scale >= 1 ? size : {
101983
+ width: Math.round(size.width * scale),
101984
+ height: Math.round(size.height * scale)
101985
+ };
101986
+ }
101987
+ async configure(size) {
101988
+ if (this.configured || this.configuring || !this.host) return;
101989
+ this.configuring = true;
101990
+ const width = size.width - size.width % 2;
101991
+ const height = size.height - size.height % 2;
101992
+ const bitrate = bitrateFor(width, height);
101993
+ let answer;
101994
+ try {
101995
+ answer = await bounded(
101996
+ this.host.configure({
101997
+ width,
101998
+ height,
101999
+ bitrate,
102000
+ fps: HQ_FPS,
102001
+ softwareAllowed: width * height <= SOFTWARE_MAX_AREA,
102002
+ keyIntervalUs: KEY_INTERVAL_US
102003
+ }),
102004
+ this.timing.encoderStartMs,
102005
+ () => unavailable(
102006
+ "encoder_start",
102007
+ `the encoder did not answer within ${this.timing.encoderStartMs} ms`
102008
+ )
102009
+ );
102010
+ } catch (error) {
102011
+ throw error instanceof BridgeCommandError ? error : unavailable("encoder_start", String(error));
102012
+ }
102013
+ if (!answer.ok) throw unavailable(answer.why, answer.detail);
102014
+ this.encoder = answer.encoder;
102015
+ this.codec = "h264";
102016
+ this.width = answer.width;
102017
+ this.height = answer.height;
102018
+ this.bitrate = bitrate;
102019
+ this.configured = true;
102020
+ this.configuring = false;
102021
+ }
102022
+ onEvent(method, params) {
102023
+ if (this.disposed || this.stopping) return;
102024
+ if (method === PAGE_DISABLED_EVENT) {
102025
+ this.restartScreencast();
102026
+ return;
102027
+ }
102028
+ if (method !== "Page.screencastFrame") return;
102029
+ const data = params.data;
102030
+ if (typeof data !== "string") return;
102031
+ const sessionId2 = typeof params.sessionId === "number" ? params.sessionId : null;
102032
+ const metadata = params.metadata;
102033
+ this.take({
102034
+ ackId: sessionId2,
102035
+ data,
102036
+ pageSec: typeof metadata?.timestamp === "number" ? metadata.timestamp : void 0,
102037
+ arrivedAt: this.now()
102038
+ });
102039
+ }
102040
+ /**
102041
+ * `Page.disable` ENDS A RUNNING SCREENCAST and `Page.enable` does not bring it
102042
+ * back (measured, QA round 1 Q1). The origin gate sends exactly that after every
102043
+ * click, type, press and goto, so a clip would freeze at the first action while
102044
+ * keeping its wall-clock length. The pool announces each `Page.disable` it sent
102045
+ * (`PAGE_DISABLED_EVENT`) and the screencast is started again here. A watchdog on
102046
+ * "no frames lately" could not do this job: a static page legitimately produces
102047
+ * none. A burst is coalesced to one start in flight plus one queued (a disable
102048
+ * that lands after the in-flight start was sent ends THAT screencast too, so it
102049
+ * cannot simply be dropped), and a restart that fails fails the recording
102050
+ * instead of leaving a clip that silently stopped moving.
102051
+ *
102052
+ * Chromium's frame-in-flight count restarts with the screencast, so an ack that
102053
+ * was still owed for the old one is simply ignored by it; `inFlight` is left
102054
+ * alone because the encoder, not Chromium, is what releases it.
102055
+ */
102056
+ restartScreencast() {
102057
+ if (!this.captureRequested) return;
102058
+ if (this.restarting) {
102059
+ this.restartAgain = true;
102060
+ return;
102061
+ }
102062
+ this.restarting = true;
102063
+ void this.startScreencast().then(
102064
+ () => {
102065
+ this.restarting = false;
102066
+ if (this.restartAgain) {
102067
+ this.restartAgain = false;
102068
+ if (!this.disposed && !this.stopping) this.restartScreencast();
102069
+ }
102070
+ },
102071
+ (error) => {
102072
+ this.restarting = false;
102073
+ this.restartAgain = false;
102074
+ if (this.disposed || this.stopping) return;
102075
+ if (error instanceof BridgeCommandError && error.code === "tab_closed")
102076
+ return;
102077
+ this.fail(
102078
+ failed(
102079
+ `the page's screencast stopped and could not be restarted: ${error instanceof Error ? error.message : String(error)}`
102080
+ )
102081
+ );
102082
+ }
102083
+ );
102084
+ }
102085
+ /** The nudge: a static page may emit no screencast frame until something
102086
+ * changes, so one screenshot stands in as frame 0 (D17). */
102087
+ async nudge() {
102088
+ if (this.gotFrame || this.disposed || this.stopping) return;
102089
+ try {
102090
+ const shot = await this.cdp.send(
102091
+ this.contents,
102092
+ "Page.captureScreenshot",
102093
+ { format: "png", captureBeyondViewport: false },
102094
+ { deadlineMs: this.timing.firstFrameMs }
102095
+ );
102096
+ if (this.gotFrame || this.disposed || this.stopping) return;
102097
+ if (typeof shot?.data !== "string") return;
102098
+ this.take({
102099
+ ackId: null,
102100
+ data: shot.data,
102101
+ pageSec: void 0,
102102
+ arrivedAt: this.now()
102103
+ });
102104
+ } catch {
102105
+ }
102106
+ }
102107
+ take(frame) {
102108
+ if (!this.gotFrame) {
102109
+ this.gotFrame = true;
102110
+ const size = pngSize(frame.data);
102111
+ if (!this.configured) {
102112
+ if (!size) {
102113
+ this.fail(failed("the first frame was not a PNG image"));
102114
+ return;
102115
+ }
102116
+ void this.configure(this.fitToCeiling(size)).then(
102117
+ () => this.pump(),
102118
+ (error) => this.fail(
102119
+ error instanceof BridgeCommandError ? error : failed(String(error))
102120
+ )
102121
+ );
102122
+ }
102123
+ }
102124
+ if (this.pending) this.ack(this.pending.ackId);
102125
+ this.pending = frame;
102126
+ this.pump();
102127
+ }
102128
+ pump() {
102129
+ if (this.disposed || !this.configured || this.inFlight || !this.pending)
102130
+ return;
102131
+ if (this.stopping && this.capped) return;
102132
+ const frame = this.pending;
102133
+ const interval = 1e3 / HQ_FPS;
102134
+ if (this.lastSentAt !== null) {
102135
+ const wait = this.lastSentAt + interval - this.now();
102136
+ if (wait > 0) {
102137
+ this.arm(wait, () => this.pump());
102138
+ return;
102139
+ }
102140
+ }
102141
+ this.pending = null;
102142
+ this.send(frame);
102143
+ }
102144
+ send(frame) {
102145
+ if (!this.host) return;
102146
+ const arrived = frame.arrivedAt;
102147
+ let relUs;
102148
+ if (this.firstWallMs === null) {
102149
+ this.firstWallMs = arrived;
102150
+ this.anchorPageSec = frame.pageSec;
102151
+ this.anchorRelUs = 0;
102152
+ relUs = 0;
102153
+ } else if (frame.pageSec !== void 0 && this.anchorPageSec !== void 0) {
102154
+ relUs = this.anchorRelUs + (frame.pageSec - this.anchorPageSec) * 1e6;
102155
+ } else if (frame.pageSec !== void 0) {
102156
+ this.anchorPageSec = frame.pageSec;
102157
+ this.anchorRelUs = (arrived - this.firstWallMs) * 1e3;
102158
+ relUs = this.anchorRelUs;
102159
+ } else {
102160
+ relUs = (arrived - this.firstWallMs) * 1e3;
102161
+ }
102162
+ const ts = Math.max(Math.round(relUs), this.lastTsUs + 1e3);
102163
+ this.lastTsUs = ts;
102164
+ this.seq += 1;
102165
+ this.lastSentAt = this.now();
102166
+ this.inFlight = {
102167
+ seq: this.seq,
102168
+ ackId: frame.ackId,
102169
+ sentAt: this.lastSentAt,
102170
+ done: false
102171
+ };
102172
+ this.host.frame(this.seq, frame.data, ts);
102173
+ }
102174
+ frameDone(seq2) {
102175
+ const current = this.inFlight;
102176
+ if (this.disposed || !current || current.seq !== seq2) return;
102177
+ current.done = true;
102178
+ if (this.onFirstFrame) {
102179
+ this.onFirstFrame();
102180
+ this.onFirstFrame = null;
102181
+ }
102182
+ this.release();
102183
+ }
102184
+ /** Ack the frame and take the next, once the encoder has finished with it AND a
102185
+ * frame interval has passed since it was sent. */
102186
+ release() {
102187
+ const current = this.inFlight;
102188
+ if (this.disposed || !current || !current.done) return;
102189
+ const wait = current.sentAt + 1e3 / HQ_FPS - this.now();
102190
+ if (wait > 0 && !this.stopping) {
102191
+ this.arm(wait, () => this.release());
102192
+ return;
102193
+ }
102194
+ this.inFlight = null;
102195
+ if (!this.stopping) this.ack(current.ackId);
102196
+ this.pump();
102197
+ }
102198
+ ack(sessionId2) {
102199
+ if (this.disposed || this.stopping || sessionId2 === null) return;
102200
+ void this.cdp.send(
102201
+ this.contents,
102202
+ "Page.screencastFrameAck",
102203
+ { sessionId: sessionId2 },
102204
+ { deadlineMs: this.timing.stopCaptureMs }
102205
+ ).catch(() => void 0);
102206
+ }
102207
+ takeChunk(chunk) {
102208
+ if (this.disposed || this.capped) return;
102209
+ if (chunk.description && !this.description)
102210
+ this.description = chunk.description;
102211
+ if (!this.description) {
102212
+ this.fail(failed("the encoder produced no decoder configuration"));
102213
+ return;
102214
+ }
102215
+ const next = this.samples.length + 1;
102216
+ const total = this.payload + chunk.data.length + muxOverheadBound(next, this.description.length);
102217
+ if (total > this.maxBytes) {
102218
+ this.capped = true;
102219
+ this.onCap();
102220
+ return;
102221
+ }
102222
+ this.samples.push({ data: chunk.data, ts: chunk.ts, key: chunk.key });
102223
+ this.payload += chunk.data.length;
102224
+ }
102225
+ fail(error) {
102226
+ if (this.disposed || this.failure) return;
102227
+ this.failure = error;
102228
+ for (const waiter of [...this.failureWaiters]) waiter(error);
102229
+ this.failureHandler?.(error);
102230
+ }
102231
+ /** Stop the screencast, bounded; shared by every caller so Chromium is told once.
102232
+ * On a tab that survives (`endReplaced`, a cancelled start) this is awaited. */
102233
+ stopCapture(again = false) {
102234
+ if (this.captureStop && !again) return this.captureStop;
102235
+ this.captureStop = (async () => {
102236
+ if (!this.captureRequested || this.contents.isDestroyed()) return;
102237
+ try {
102238
+ await this.cdp.send(
102239
+ this.contents,
102240
+ "Page.stopScreencast",
102241
+ {},
102242
+ { deadlineMs: this.timing.stopCaptureMs }
102243
+ );
102244
+ } catch {
102245
+ }
102246
+ })();
102247
+ return this.captureStop;
102248
+ }
102249
+ /**
102250
+ * End the clip: stop the capture, drain the encoder and box the samples.
102251
+ *
102252
+ * Shared by the timer and `record_stop`. The newest waiting frame is encoded
102253
+ * first, because it is the page's final state and the last encoded frame is held
102254
+ * until the stop.
102255
+ */
102256
+ finish() {
102257
+ if (!this.finishing) this.finishing = this.runFinish();
102258
+ return this.finishing;
102259
+ }
102260
+ async runFinish() {
102261
+ const endedAt = this.now();
102262
+ this.stopping = true;
102263
+ await this.stopCapture();
102264
+ if (this.disposed)
102265
+ throw failed("the recording was discarded while it was being saved");
102266
+ await this.waitIdle();
102267
+ if (this.pending && this.configured && !this.capped && !this.failure) {
102268
+ const last = this.pending;
102269
+ this.pending = null;
102270
+ this.send(last);
102271
+ await this.waitIdle();
102272
+ }
102273
+ if (this.failure) throw this.failure;
102274
+ if (!this.host) throw failed("the encoder is gone");
102275
+ await this.race(
102276
+ this.host.flush(),
102277
+ this.timing.flushMs,
102278
+ () => failed(
102279
+ "the encoder did not finish within its time limit; nothing was saved"
102280
+ )
102281
+ );
102282
+ if (this.disposed)
102283
+ throw failed("the recording was discarded while it was being saved");
102284
+ if (this.samples.length === 0 || !this.description) {
102285
+ throw this.capped ? new BridgeCommandError(
102286
+ "internal",
102287
+ `the first frame alone does not fit the ${this.maxBytes}-byte limit; nothing was saved. Raise the size limit or record a smaller area.`,
102288
+ { reason: "record_too_large", max_bytes: this.maxBytes }
102289
+ ) : failed("the recording produced no frames; nothing was saved");
102290
+ }
102291
+ const endUs = this.firstWallMs === null ? void 0 : (endedAt - this.firstWallMs) * 1e3;
102292
+ const out = writeMp4({
102293
+ width: this.width,
102294
+ height: this.height,
102295
+ description: this.description,
102296
+ samples: this.samples,
102297
+ endTs: endUs,
102298
+ fallbackFrameUs: 1e6 / HQ_FPS
102299
+ });
102300
+ if (out.size > this.maxBytes) {
102301
+ throw new BridgeCommandError(
102302
+ "internal",
102303
+ `the recording is larger than ${this.maxBytes} bytes; nothing was saved`,
102304
+ { reason: "record_too_large", max_bytes: this.maxBytes }
102305
+ );
102306
+ }
102307
+ const seconds = Math.max(out.durationMs / 1e3, 1e-3);
102308
+ return {
102309
+ parts: out.parts,
102310
+ size: out.size,
102311
+ frames: this.samples.length,
102312
+ measuredFps: Math.round(this.samples.length / seconds * 100) / 100,
102313
+ avgBitrateKbps: Math.round(this.payload * 8 / seconds / 1e3),
102314
+ encoder: this.encoder,
102315
+ endedAt
102316
+ };
102317
+ }
102318
+ /** Resolves when no frame is in the encoder, the encoder failed, the session was
102319
+ * disposed, or the drain bound passed. Polled rather than signalled: it runs once
102320
+ * per stop, and a poll cannot miss a wake-up that raced the registration. */
102321
+ waitIdle() {
102322
+ return new Promise((resolve) => {
102323
+ const started = this.now();
102324
+ const check = () => {
102325
+ if (!this.inFlight || this.failure || this.disposed || this.now() - started >= DRAIN_MS) {
102326
+ resolve();
102327
+ return;
102328
+ }
102329
+ const timer = setTimeout(check, 20);
102330
+ timer.unref?.();
102331
+ };
102332
+ check();
102333
+ });
102334
+ }
102335
+ /** Tear everything down, now. Idempotent, synchronous, never throws, and never acks
102336
+ * afterwards. The best-effort `Page.stopScreencast` is fire-and-forget here; a
102337
+ * caller whose tab survives awaits `stopCapture` itself. */
102338
+ dispose() {
102339
+ if (this.disposed) return;
102340
+ this.disposed = true;
102341
+ this.unsubscribe?.();
102342
+ this.unsubscribe = null;
102343
+ for (const timer of this.timers) clearTimeout(timer);
102344
+ this.timers.clear();
102345
+ this.pending = null;
102346
+ this.samples = [];
102347
+ this.description = null;
102348
+ const pendingStop = this.captureRequested ? this.stopCapture() : null;
102349
+ void pendingStop?.catch(() => void 0);
102350
+ try {
102351
+ this.host?.dispose();
102352
+ } catch {
102353
+ }
102354
+ this.host = null;
102355
+ for (const waiter of [...this.failureWaiters]) {
102356
+ waiter(failed("the recording was discarded"));
102357
+ }
102358
+ this.failureWaiters.clear();
102359
+ this.failureHandler = null;
102360
+ }
102361
+ }
101155
102362
  const RECORD_WIDTH = 1280;
101156
102363
  const RECORD_HEIGHT = 720;
101157
102364
  const RECORD_FPS = 10;
@@ -101293,6 +102500,18 @@ function maxBytesOf(params) {
101293
102500
  }
101294
102501
  return bytes;
101295
102502
  }
102503
+ function qualityOf(params) {
102504
+ const raw = params.quality;
102505
+ if (raw === void 0 || raw === null || raw === "standard") {
102506
+ return "standard";
102507
+ }
102508
+ if (raw === "high") return "high";
102509
+ throw new BridgeCommandError(
102510
+ "internal",
102511
+ `record_start quality must be "standard" or "high": got ${JSON.stringify(raw)}. Nothing was started.`,
102512
+ { reason: "record_quality", param: "quality", why: "value" }
102513
+ );
102514
+ }
101296
102515
  function sizeRefusal(why, param, detail) {
101297
102516
  return new BridgeCommandError("internal", `${detail} Nothing was started.`, {
101298
102517
  reason: "record_size",
@@ -101517,6 +102736,15 @@ function captureShape(size) {
101517
102736
  ...size ? { width: size.width, height: size.height } : {}
101518
102737
  };
101519
102738
  }
102739
+ function highShape(session) {
102740
+ return {
102741
+ fps: session.fps,
102742
+ container: "mp4",
102743
+ codec: session.codec,
102744
+ width: session.width,
102745
+ height: session.height
102746
+ };
102747
+ }
101520
102748
  async function readStream(recording, handle2, budgetAt, fd) {
101521
102749
  let bytes = 0;
101522
102750
  for (; ; ) {
@@ -101553,7 +102781,27 @@ async function readStream(recording, handle2, budgetAt, fd) {
101553
102781
  }
101554
102782
  return bytes;
101555
102783
  }
102784
+ function publishPart(partPath, path2) {
102785
+ try {
102786
+ fs.linkSync(partPath, path2);
102787
+ } catch (error) {
102788
+ const code = error?.code;
102789
+ if (code === "EEXIST") {
102790
+ throw pathRefusal(
102791
+ path2,
102792
+ `the recording path appeared while recording and is never overwritten: ${path2}`
102793
+ );
102794
+ }
102795
+ throw error;
102796
+ }
102797
+ try {
102798
+ fs.unlinkSync(partPath);
102799
+ } catch {
102800
+ }
102801
+ }
101556
102802
  async function runFinalize(recording, autoStopped) {
102803
+ if (recording.engine === "high")
102804
+ return runFinalizeHigh(recording, autoStopped);
101557
102805
  const { contents, cdp, path: path2, partPath } = recording;
101558
102806
  const budgetAt = Date.now() + RECORD_STOP_BUDGET_MS;
101559
102807
  let handle2 = "";
@@ -101596,22 +102844,7 @@ async function runFinalize(recording, autoStopped) {
101596
102844
  fs.fsyncSync(fd);
101597
102845
  fs.closeSync(fd);
101598
102846
  fd = null;
101599
- try {
101600
- fs.linkSync(partPath, path2);
101601
- } catch (error) {
101602
- const code = error?.code;
101603
- if (code === "EEXIST") {
101604
- throw pathRefusal(
101605
- path2,
101606
- `the recording path appeared while recording and is never overwritten: ${path2}`
101607
- );
101608
- }
101609
- throw error;
101610
- }
101611
- try {
101612
- fs.unlinkSync(partPath);
101613
- } catch {
101614
- }
102847
+ publishPart(partPath, path2);
101615
102848
  return {
101616
102849
  path: path2,
101617
102850
  bytes,
@@ -101650,6 +102883,72 @@ async function runFinalize(recording, autoStopped) {
101650
102883
  }
101651
102884
  }
101652
102885
  }
102886
+ function writeAll(fd, buffer) {
102887
+ let offset = 0;
102888
+ while (offset < buffer.length) {
102889
+ offset += fs.writeSync(fd, buffer, offset, buffer.length - offset);
102890
+ }
102891
+ }
102892
+ async function runFinalizeHigh(recording, autoStopped) {
102893
+ const { contents, cdp, path: path2, partPath } = recording;
102894
+ const session = recording.encoder;
102895
+ let fd = null;
102896
+ let createdPart = false;
102897
+ let viewportCleared = false;
102898
+ try {
102899
+ if (!session) throw abortedWhileSaving();
102900
+ const clip2 = await session.finish();
102901
+ if (recording.viewportToken) {
102902
+ await clearViewport(cdp, contents, recording.viewportToken);
102903
+ viewportCleared = true;
102904
+ }
102905
+ if (recording.aborted) throw abortedWhileSaving();
102906
+ fd = fs.openSync(partPath, "wx", 384);
102907
+ createdPart = true;
102908
+ let bytes = 0;
102909
+ for (const part of clip2.parts) {
102910
+ writeAll(fd, part);
102911
+ bytes += part.length;
102912
+ }
102913
+ if (recording.aborted) throw abortedWhileSaving();
102914
+ fs.fsyncSync(fd);
102915
+ fs.closeSync(fd);
102916
+ fd = null;
102917
+ publishPart(partPath, path2);
102918
+ return {
102919
+ path: path2,
102920
+ bytes,
102921
+ duration_ms: clip2.endedAt - recording.startedAt,
102922
+ auto_stopped: autoStopped,
102923
+ ...highShape(session),
102924
+ quality: "high",
102925
+ encoder: clip2.encoder,
102926
+ frames: clip2.frames,
102927
+ measured_fps: clip2.measuredFps,
102928
+ avg_bitrate_kbps: clip2.avgBitrateKbps,
102929
+ stop_reason: recording.stopReason ?? (autoStopped ? "max_duration" : "stop")
102930
+ };
102931
+ } catch (error) {
102932
+ throw typedFailure(error);
102933
+ } finally {
102934
+ if (recording.viewportToken && !viewportCleared) {
102935
+ await clearViewport(cdp, contents, recording.viewportToken);
102936
+ }
102937
+ if (fd !== null) {
102938
+ try {
102939
+ fs.closeSync(fd);
102940
+ } catch {
102941
+ }
102942
+ }
102943
+ if (createdPart) {
102944
+ try {
102945
+ fs.unlinkSync(partPath);
102946
+ } catch {
102947
+ }
102948
+ }
102949
+ session?.dispose();
102950
+ }
102951
+ }
101653
102952
  function settle$1(webContentsId, recording, outcome) {
101654
102953
  if (recordings.get(webContentsId) === recording) {
101655
102954
  recordings.delete(webContentsId);
@@ -101664,6 +102963,11 @@ function settle$1(webContentsId, recording, outcome) {
101664
102963
  async function endReplaced(recording) {
101665
102964
  try {
101666
102965
  await recording.cdp.attach(recording.contents).catch(() => void 0);
102966
+ if (recording.encoder) {
102967
+ await recording.encoder.stopCapture(true);
102968
+ recording.encoder.dispose();
102969
+ return;
102970
+ }
101667
102971
  const stopped = await recording.cdp.send(
101668
102972
  recording.contents,
101669
102973
  "Page.stopScreenRecording",
@@ -101726,6 +103030,18 @@ async function recordStart(ctx, params, requestId2) {
101726
103030
  }
101727
103031
  }
101728
103032
  const size = sizeOf$1(params);
103033
+ const quality = qualityOf(params);
103034
+ if (quality === "high" && !ctx.recordingEncoder) {
103035
+ throw new BridgeCommandError(
103036
+ "internal",
103037
+ "high-quality recording is not available here (this host was built without its encoder window). Retry without quality for the standard recording; nothing was started.",
103038
+ {
103039
+ reason: "record_quality_unavailable",
103040
+ why: "no_h264_encoder",
103041
+ detail: "no encoder window"
103042
+ }
103043
+ );
103044
+ }
101729
103045
  if (size && tab.presented) {
101730
103046
  throw sizeRefusal(
101731
103047
  "visible",
@@ -101795,6 +103111,9 @@ async function recordStart(ctx, params, requestId2) {
101795
103111
  let measured = size;
101796
103112
  let viewportToken;
101797
103113
  let started = false;
103114
+ let hq;
103115
+ let capEarly = false;
103116
+ let capHandler = null;
101798
103117
  try {
101799
103118
  if (active) await endReplaced(active);
101800
103119
  await ctx.cdp.attach(contents);
@@ -101803,24 +103122,49 @@ async function recordStart(ctx, params, requestId2) {
101803
103122
  measured = await waitForViewport(ctx.cdp, contents, size);
101804
103123
  await waitForCompositedFrame(ctx.cdp, contents, measured);
101805
103124
  }
101806
- try {
101807
- await ctx.cdp.send(
101808
- contents,
101809
- "Page.startScreenRecording",
103125
+ if (quality === "high" && ctx.recordingEncoder) {
103126
+ const service = ctx.recordingEncoder;
103127
+ await HqSession.start(
101810
103128
  {
101811
- audio: false,
103129
+ cdp: ctx.cdp,
103130
+ contents,
103131
+ service,
101812
103132
  maxWidth: measured?.width ?? RECORD_WIDTH,
101813
103133
  maxHeight: measured?.height ?? RECORD_HEIGHT,
101814
- frameRate: RECORD_FPS
103134
+ size: measured,
103135
+ maxBytes,
103136
+ onCap: () => {
103137
+ if (capHandler) capHandler();
103138
+ else capEarly = true;
103139
+ }
101815
103140
  },
101816
- { deadlineMs: RECORD_START_DEADLINE_MS }
103141
+ (session) => {
103142
+ hq = session;
103143
+ entry.dispose = () => session.dispose();
103144
+ }
101817
103145
  );
101818
103146
  started = true;
101819
- } catch (error) {
101820
- throw classifyStartFailure(error);
103147
+ } else {
103148
+ try {
103149
+ await ctx.cdp.send(
103150
+ contents,
103151
+ "Page.startScreenRecording",
103152
+ {
103153
+ audio: false,
103154
+ maxWidth: measured?.width ?? RECORD_WIDTH,
103155
+ maxHeight: measured?.height ?? RECORD_HEIGHT,
103156
+ frameRate: RECORD_FPS
103157
+ },
103158
+ { deadlineMs: RECORD_START_DEADLINE_MS }
103159
+ );
103160
+ started = true;
103161
+ } catch (error) {
103162
+ throw classifyStartFailure(error);
103163
+ }
101821
103164
  }
101822
103165
  } catch (error) {
101823
103166
  reservations.delete(reservation);
103167
+ if (hq) await hq.stopCapture().catch(() => void 0);
101824
103168
  if (size && viewportToken) {
101825
103169
  await clearViewport(ctx.cdp, contents, viewportToken);
101826
103170
  }
@@ -101834,7 +103178,8 @@ async function recordStart(ctx, params, requestId2) {
101834
103178
  contents,
101835
103179
  width: measured?.width,
101836
103180
  height: measured?.height,
101837
- viewportToken
103181
+ viewportToken,
103182
+ encoder: hq
101838
103183
  });
101839
103184
  } else if (size && viewportToken) {
101840
103185
  await clearViewport(ctx.cdp, contents, viewportToken);
@@ -101858,7 +103203,9 @@ async function recordStart(ctx, params, requestId2) {
101858
103203
  ...viewportToken ? { viewportToken } : {},
101859
103204
  timer: void 0,
101860
103205
  finishing: null,
101861
- aborted: false
103206
+ aborted: false,
103207
+ engine: quality,
103208
+ ...hq ? { encoder: hq } : {}
101862
103209
  };
101863
103210
  recordings.set(id2, recording);
101864
103211
  reservations.delete(reservation);
@@ -101866,6 +103213,26 @@ async function recordStart(ctx, params, requestId2) {
101866
103213
  void finish(id2, recording, true).catch(() => void 0);
101867
103214
  }, maxDurationS * 1e3);
101868
103215
  recording.timer.unref?.();
103216
+ if (hq) {
103217
+ const session = hq;
103218
+ capHandler = () => {
103219
+ if (recording.aborted || recording.finishing) return;
103220
+ recording.stopReason = "max_bytes";
103221
+ void finish(id2, recording, true).catch(() => void 0);
103222
+ };
103223
+ session.onFailure((error) => failHigh(id2, recording, error));
103224
+ if (capEarly) capHandler();
103225
+ return {
103226
+ recording: true,
103227
+ path: path2,
103228
+ max_duration_s: maxDurationS,
103229
+ max_bytes: maxBytes,
103230
+ quality: "high",
103231
+ ...highShape(session),
103232
+ encoder: session.encoder,
103233
+ bitrate_bps: session.bitrate
103234
+ };
103235
+ }
101869
103236
  return {
101870
103237
  recording: true,
101871
103238
  path: path2,
@@ -101874,6 +103241,23 @@ async function recordStart(ctx, params, requestId2) {
101874
103241
  ...captureShape(measured)
101875
103242
  };
101876
103243
  }
103244
+ function failHigh(webContentsId, recording, error) {
103245
+ if (recording.aborted || recording.finishing) return;
103246
+ if (recordings.get(webContentsId) !== recording) return;
103247
+ const session = recording.encoder;
103248
+ settle$1(webContentsId, recording, { error });
103249
+ session?.dispose();
103250
+ void (async () => {
103251
+ await session?.stopCapture().catch(() => void 0);
103252
+ if (recording.viewportToken) {
103253
+ await clearViewport(
103254
+ recording.cdp,
103255
+ recording.contents,
103256
+ recording.viewportToken
103257
+ );
103258
+ }
103259
+ })();
103260
+ }
101877
103261
  async function recordStop(ctx, params, requestId2) {
101878
103262
  const tab = ctx.registry.requireSurface(String(params.tab ?? ""));
101879
103263
  const id2 = tab.view.webContents.id;
@@ -101903,11 +103287,13 @@ function abortRecording(webContentsId, reason, options = {}) {
101903
103287
  if (entry.webContentsId === webContentsId) {
101904
103288
  entry.cancelled = true;
101905
103289
  reservations.delete(token);
103290
+ entry.dispose?.();
101906
103291
  }
101907
103292
  }
101908
103293
  const recording = recordings.get(webContentsId);
101909
103294
  if (recording) {
101910
103295
  recording.aborted = true;
103296
+ recording.encoder?.dispose();
101911
103297
  if (recording.timer !== void 0) {
101912
103298
  clearTimeout(recording.timer);
101913
103299
  recording.timer = void 0;
@@ -102074,6 +103460,7 @@ const PROTOCOL_VERSION = "1.3";
102074
103460
  const ALREADY_ATTACHED = /another debugger|already attached/i;
102075
103461
  const STALE_SESSION = /no session|session with given id|no target|target closed/i;
102076
103462
  const FRAME_DETACHED = "frame_detached";
103463
+ const PAGE_DISABLED_EVENT = "LocalOperator.pageDisabled";
102077
103464
  class CdpPool {
102078
103465
  constructor(options = {}) {
102079
103466
  this.options = options;
@@ -102246,13 +103633,32 @@ class CdpPool {
102246
103633
  "that browser tab is gone; dropped the handle. Use 'open' with a URL to get a new tab"
102247
103634
  );
102248
103635
  }
102249
- return this.sendTo(
103636
+ const sent = this.sendTo(
102250
103637
  contents,
102251
103638
  method,
102252
103639
  params,
102253
103640
  options.deadlineMs ?? CDP_DEADLINE_MS,
102254
103641
  options.sessionId
102255
103642
  );
103643
+ if (method !== "Page.disable" || options.sessionId) return sent;
103644
+ const announce = () => {
103645
+ for (const listener of [...this.subscribers.get(contents.id) ?? []]) {
103646
+ try {
103647
+ listener(PAGE_DISABLED_EVENT, {});
103648
+ } catch {
103649
+ }
103650
+ }
103651
+ };
103652
+ return sent.then(
103653
+ (value) => {
103654
+ announce();
103655
+ return value;
103656
+ },
103657
+ (error) => {
103658
+ announce();
103659
+ throw error;
103660
+ }
103661
+ );
102256
103662
  }
102257
103663
  /**
102258
103664
  * The flattened session for one child frame, attached on first use.
@@ -107044,6 +108450,7 @@ class BrowserHost {
107044
108450
  approvals;
107045
108451
  ownership;
107046
108452
  downloads;
108453
+ recordingEncoder;
107047
108454
  log;
107048
108455
  onChanged;
107049
108456
  facts;
@@ -107085,6 +108492,7 @@ class BrowserHost {
107085
108492
  this.approvals = options.approvals;
107086
108493
  this.ownership = options.ownership;
107087
108494
  this.downloads = options.downloads;
108495
+ this.recordingEncoder = options.recordingEncoder;
107088
108496
  this.log = options.log;
107089
108497
  this.onChanged = options.onChanged;
107090
108498
  this.tabAudio = new TabAudioTracker(() => this.onChanged());
@@ -108027,7 +109435,7 @@ class BrowserHost {
108027
109435
  "the active tab changed before suggestions were read"
108028
109436
  );
108029
109437
  }
108030
- const live = collectAddressHistory(
109438
+ const live2 = collectAddressHistory(
108031
109439
  this.registry.list().map((record) => ({
108032
109440
  tabId: record.tabId,
108033
109441
  sessionId: record.sessionId,
@@ -108039,9 +109447,9 @@ class BrowserHost {
108039
109447
  const historyMatches = this.historyStore?.suggest(request.query, request.limit) ?? [];
108040
109448
  return {
108041
109449
  requestId: request.requestId,
108042
- activeTabId: live.activeTabId,
109450
+ activeTabId: live2.activeTabId,
108043
109451
  entries: mergeAddressHistory(
108044
- live.entries,
109452
+ live2.entries,
108045
109453
  historyMatches,
108046
109454
  request.query,
108047
109455
  request.limit
@@ -108850,7 +110258,7 @@ class DownloadArmer {
108850
110258
  });
108851
110259
  item.once("done", (_event, state2) => {
108852
110260
  capture.pending -= 1;
108853
- capture.live = capture.live.filter((live) => live !== entry);
110261
+ capture.live = capture.live.filter((live2) => live2 !== entry);
108854
110262
  const name = path$1.basename(savePath);
108855
110263
  this.release(capture, savePath);
108856
110264
  if (entry.weCancelled) {
@@ -108965,9 +110373,9 @@ class DownloadArmer {
108965
110373
  }
108966
110374
  /** Cancel every download this capture still has writing. */
108967
110375
  cancelLive(capture, clause, refusal) {
108968
- const live = [...capture.live];
110376
+ const live2 = [...capture.live];
108969
110377
  capture.live = [];
108970
- for (const entry of live) {
110378
+ for (const entry of live2) {
108971
110379
  if (entry.weCancelled) continue;
108972
110380
  this.refuseLive(
108973
110381
  capture,
@@ -109918,14 +111326,14 @@ class OwnershipLedger {
109918
111326
  }
109919
111327
  scope2.generation = generation;
109920
111328
  const allocation = scope2.allocations[String(params.allocation_id ?? "")];
109921
- const live = allocation?.tab ? this.hooks.isLive(allocation.tab) : false;
111329
+ const live2 = allocation?.tab ? this.hooks.isLive(allocation.tab) : false;
109922
111330
  const unresolved = allocation && ["allocating", "allocated", "cleanup_pending"].includes(
109923
111331
  allocation.state
109924
111332
  );
109925
111333
  return {
109926
111334
  ownership_version: 1,
109927
- state: live ? allocation.state : unresolved ? "allocating" : "closed",
109928
- tab: live ? allocation.tab ?? "" : "",
111335
+ state: live2 ? allocation.state : unresolved ? "allocating" : "closed",
111336
+ tab: live2 ? allocation.tab ?? "" : "",
109929
111337
  retention: scope2.retention ?? "",
109930
111338
  terminal: scope2.terminal ?? "",
109931
111339
  unknown_reservations: scope2.unknownReservations
@@ -111228,15 +112636,15 @@ class SessionCookieVault {
111228
112636
  for (const stored of snapshot2.cookies) {
111229
112637
  const identity2 = cookieIdentity(stored);
111230
112638
  if (!attempted.has(identity2)) continue;
111231
- const live = byIdentity.get(identity2);
111232
- if (!live) {
112639
+ const live2 = byIdentity.get(identity2);
112640
+ if (!live2) {
111233
112641
  report.drifted.push({
111234
112642
  name: stored.name,
111235
112643
  reason: "not present after the write"
111236
112644
  });
111237
112645
  continue;
111238
112646
  }
111239
- const drift = attributeDrift(stored, live) ?? sourceMetadataDrift(attempted.get(identity2), live);
112647
+ const drift = attributeDrift(stored, live2) ?? sourceMetadataDrift(attempted.get(identity2), live2);
111240
112648
  if (drift) report.drifted.push({ name: stored.name, reason: drift });
111241
112649
  }
111242
112650
  } catch (error) {
@@ -111467,26 +112875,26 @@ function readMarkerExists(path2) {
111467
112875
  return false;
111468
112876
  }
111469
112877
  }
111470
- function sourceMetadataDrift(params, live) {
112878
+ function sourceMetadataDrift(params, live2) {
111471
112879
  if (!params) return null;
111472
- if (params.sourceScheme !== void 0 && params.sourceScheme !== live.sourceScheme) {
111473
- return `the jar stored source scheme ${String(live.sourceScheme)} where the write asked for ${String(params.sourceScheme)}`;
112880
+ if (params.sourceScheme !== void 0 && params.sourceScheme !== live2.sourceScheme) {
112881
+ return `the jar stored source scheme ${String(live2.sourceScheme)} where the write asked for ${String(params.sourceScheme)}`;
111474
112882
  }
111475
- if (params.sourcePort !== void 0 && Number(params.sourcePort) !== Number(live.sourcePort)) {
111476
- return `the jar stored source port ${String(live.sourcePort)} where the write asked for ${String(params.sourcePort)}`;
112883
+ if (params.sourcePort !== void 0 && Number(params.sourcePort) !== Number(live2.sourcePort)) {
112884
+ return `the jar stored source port ${String(live2.sourcePort)} where the write asked for ${String(params.sourcePort)}`;
111477
112885
  }
111478
112886
  return null;
111479
112887
  }
111480
- function attributeDrift(stored, live) {
111481
- if (live.value !== stored.value) return "value changed";
111482
- if (live.secure !== stored.secure) return `secure became ${live.secure}`;
111483
- if (live.httpOnly !== stored.httpOnly)
111484
- return `httpOnly became ${live.httpOnly}`;
111485
- if (!isSessionCookie(live)) return "no longer a session cookie";
111486
- if (sameSiteShape(live.sameSite) !== sameSiteShape(stored.sameSite)) {
111487
- return `sameSite became ${sameSiteShape(live.sameSite)}`;
112888
+ function attributeDrift(stored, live2) {
112889
+ if (live2.value !== stored.value) return "value changed";
112890
+ if (live2.secure !== stored.secure) return `secure became ${live2.secure}`;
112891
+ if (live2.httpOnly !== stored.httpOnly)
112892
+ return `httpOnly became ${live2.httpOnly}`;
112893
+ if (!isSessionCookie(live2)) return "no longer a session cookie";
112894
+ if (sameSiteShape(live2.sameSite) !== sameSiteShape(stored.sameSite)) {
112895
+ return `sameSite became ${sameSiteShape(live2.sameSite)}`;
111488
112896
  }
111489
- const livePartition = partitionKeyForWrite(live);
112897
+ const livePartition = partitionKeyForWrite(live2);
111490
112898
  if (!livePartition.ok) return "partition identity is no longer representable";
111491
112899
  if (!samePartition(livePartition.key, stored.partitionKey))
111492
112900
  return "partition identity changed";
@@ -112824,6 +114232,11 @@ async function initializeBrowserHost(options, bindings) {
112824
114232
  approvals,
112825
114233
  ownership,
112826
114234
  downloads,
114235
+ recordingEncoder: options.recordingEncoder ? createRecordingEncoderService({
114236
+ documentUrl: options.recordingEncoder.documentUrl,
114237
+ preloadPath: options.recordingEncoder.preloadPath,
114238
+ log: log2
114239
+ }) : void 0,
112827
114240
  log: log2,
112828
114241
  onChanged: notifyChanged,
112829
114242
  facts: () => facts,
@@ -113133,6 +114546,7 @@ async function initializeBrowserHost(options, bindings) {
113133
114546
  approvalsExpiryTimer = null;
113134
114547
  }
113135
114548
  approvalsOverlay?.dispose("host-stop");
114549
+ disposeAllRecordingEncoders();
113136
114550
  registry.destroyAll();
113137
114551
  await Promise.allSettled([...releases]);
113138
114552
  await cdp.close();
@@ -116522,9 +117936,9 @@ class TeamBridgeNotifier {
116522
117936
  const pending = this.pendingOpen;
116523
117937
  this.pendingOpen = null;
116524
117938
  if (!pending) return null;
116525
- const unavailable = this.pendingUnavailable;
117939
+ const unavailable2 = this.pendingUnavailable;
116526
117940
  this.pendingUnavailable = false;
116527
- return !unavailable && pending.owner.accountId === this.authority?.accountId ? pending : { unavailable: true };
117941
+ return !unavailable2 && pending.owner.accountId === this.authority?.accountId ? pending : { unavailable: true };
116528
117942
  }
116529
117943
  replace(conversationId) {
116530
117944
  const previous = this.banners.get(conversationId);
@@ -116536,8 +117950,8 @@ class TeamBridgeNotifier {
116536
117950
  retainTarget(notification, target2) {
116537
117951
  const conversationId = target2.conversationId;
116538
117952
  this.lifetime.retain(notification, () => {
116539
- const live = this.banners.get(conversationId) === notification;
116540
- if (live) this.banners.delete(conversationId);
117953
+ const live2 = this.banners.get(conversationId) === notification;
117954
+ if (live2) this.banners.delete(conversationId);
116541
117955
  this.open(target2, this.revokedBanners.has(notification));
116542
117956
  });
116543
117957
  notification.once("close", () => {
@@ -116546,9 +117960,9 @@ class TeamBridgeNotifier {
116546
117960
  }
116547
117961
  });
116548
117962
  }
116549
- open(target2, unavailable = false) {
117963
+ open(target2, unavailable2 = false) {
116550
117964
  this.pendingOpen = target2;
116551
- this.pendingUnavailable = unavailable;
117965
+ this.pendingUnavailable = unavailable2;
116552
117966
  const window = this.options.window();
116553
117967
  if (window && !window.isDestroyed()) {
116554
117968
  this.options.host.signalOpen();
@@ -116836,10 +118250,10 @@ function runtimeStragglerCount(body, current) {
116836
118250
  }
116837
118251
  function daemonMoveOutcome(report) {
116838
118252
  if (report === null) return null;
116839
- const failed = report.daemons.filter(
118253
+ const failed2 = report.daemons.filter(
116840
118254
  (daemon) => daemon.status === "failed" || daemon.status === "unsupervised"
116841
118255
  ).map((daemon) => daemon.name);
116842
- return { source: "report", moved: failed.length === 0, failed };
118256
+ return { source: "report", moved: failed2.length === 0, failed: failed2 };
116843
118257
  }
116844
118258
  const CHROMIUM_TRANSPORT_CODES = [
116845
118259
  "ERR_INTERNET_DISCONNECTED",
@@ -117043,9 +118457,9 @@ async function reengageDisplacedSessions(input) {
117043
118457
  return { displaced: [], engaged: [], failed: [], stillResident: [] };
117044
118458
  const snapshotIds = snapshot2.map((row) => row.sessionId);
117045
118459
  const stillLiveIn = (rows) => {
117046
- const live = liveRosterIds(rows);
117047
- if (live === null) return null;
117048
- return new Set(snapshotIds.filter((id2) => live.has(id2)));
118460
+ const live2 = liveRosterIds(rows);
118461
+ if (live2 === null) return null;
118462
+ return new Set(snapshotIds.filter((id2) => live2.has(id2)));
117049
118463
  };
117050
118464
  let after = await input.readRoster();
117051
118465
  let stillLive = stillLiveIn(after) ?? new Set(snapshotIds);
@@ -117074,26 +118488,26 @@ async function reengageDisplacedSessions(input) {
117074
118488
  (row) => stillLiveAtEnd.has(row.sessionId)
117075
118489
  );
117076
118490
  const engaged = [];
117077
- const failed = [];
118491
+ const failed2 = [];
117078
118492
  for (const row of displaced) {
117079
118493
  try {
117080
118494
  if (await input.engage(row)) engaged.push(row.sessionId);
117081
118495
  else
117082
- failed.push({
118496
+ failed2.push({
117083
118497
  sessionId: row.sessionId,
117084
118498
  reason: "the server did not take the engage"
117085
118499
  });
117086
118500
  } catch (error) {
117087
- failed.push({
118501
+ failed2.push({
117088
118502
  sessionId: row.sessionId,
117089
118503
  reason: error instanceof Error ? error.message : String(error)
117090
118504
  });
117091
118505
  }
117092
118506
  }
117093
118507
  input.log?.(
117094
- `Re-engaged ${engaged.length} of ${displaced.length} displaced session(s)${failed.length > 0 ? `; ${failed.length} did not answer (${failed.map((row) => row.sessionId).join(", ")})` : ""}${stillResident.length > 0 ? `; ${stillResident.length} pre-swap runtime(s) still resident when the wait ended (${stillResident.map((row) => row.sessionId).join(", ")}), which nothing re-engages afterwards and which go cold on their own schedule` : ""}`
118508
+ `Re-engaged ${engaged.length} of ${displaced.length} displaced session(s)${failed2.length > 0 ? `; ${failed2.length} did not answer (${failed2.map((row) => row.sessionId).join(", ")})` : ""}${stillResident.length > 0 ? `; ${stillResident.length} pre-swap runtime(s) still resident when the wait ended (${stillResident.map((row) => row.sessionId).join(", ")}), which nothing re-engages afterwards and which go cold on their own schedule` : ""}`
117095
118509
  );
117096
- return { displaced, engaged, failed, stillResident };
118510
+ return { displaced, engaged, failed: failed2, stillResident };
117097
118511
  }
117098
118512
  const SESSION_ENGAGE_OPEN_MS = 5e3;
117099
118513
  const SESSION_ENGAGE_BEAT_MS = 5e3;
@@ -117158,8 +118572,8 @@ async function engageSessionThroughStream(input) {
117158
118572
  let leaseHeld = true;
117159
118573
  const leaseAt = input.now();
117160
118574
  while (input.now() - startedAt < openMs + holdMs) {
117161
- const live = await input.hasRuntime();
117162
- if (live === true) {
118575
+ const live2 = await input.hasRuntime();
118576
+ if (live2 === true) {
117163
118577
  cameUp = true;
117164
118578
  break;
117165
118579
  }
@@ -122503,25 +123917,25 @@ ${heal.removed.join("\n")}`,
122503
123917
  const after = await this.readFleetSnapshot(backend);
122504
123918
  const displaced = displacedSessions(snapshot2, after);
122505
123919
  const engaged = [];
122506
- const failed = [];
123920
+ const failed2 = [];
122507
123921
  for (const row of displaced) {
122508
123922
  try {
122509
123923
  if (await this.engageSessionRuntime(backend, row))
122510
123924
  engaged.push(row.sessionId);
122511
123925
  else
122512
- failed.push({
123926
+ failed2.push({
122513
123927
  sessionId: row.sessionId,
122514
123928
  reason: "the server did not take the engage"
122515
123929
  });
122516
123930
  } catch (error) {
122517
- failed.push({
123931
+ failed2.push({
122518
123932
  sessionId: row.sessionId,
122519
123933
  reason: error instanceof Error ? error.message : String(error)
122520
123934
  });
122521
123935
  }
122522
123936
  }
122523
123937
  logger.info(
122524
- `Re-engaged ${engaged.length} of ${displaced.length} session(s) displaced by the restart${failed.length > 0 ? `; ${failed.length} did not answer (${failed.map((row) => row.sessionId).join(", ")})` : ""}`,
123938
+ `Re-engaged ${engaged.length} of ${displaced.length} session(s) displaced by the restart${failed2.length > 0 ? `; ${failed2.length} did not answer (${failed2.map((row) => row.sessionId).join(", ")})` : ""}`,
122525
123939
  LogFileType.UPDATE_SERVICE
122526
123940
  );
122527
123941
  if (after === null) return null;
@@ -126316,6 +127730,10 @@ electron.app.whenReady().then(async () => {
126316
127730
  rendererUrl,
126317
127731
  "browser-approvals-overlay.html"
126318
127732
  );
127733
+ const recordingEncoderDocumentUrl = documentUrlFor(
127734
+ rendererUrl,
127735
+ "recording-encoder.html"
127736
+ );
126319
127737
  backendService.observeDesktopFeed(
126320
127738
  (frame) => {
126321
127739
  appAttention.observe(frame);
@@ -127250,6 +128668,13 @@ electron.app.whenReady().then(async () => {
127250
128668
  "../preload/browser-approvals-overlay.js"
127251
128669
  )
127252
128670
  },
128671
+ // The hidden H.264 encoder behind `record_start {quality: "high"}`:
128672
+ // the app's own bundled document and preload, derived like the
128673
+ // documents above and never caller-supplied.
128674
+ recordingEncoder: {
128675
+ documentUrl: recordingEncoderDocumentUrl,
128676
+ preloadPath: path$1.join(__dirname, "../preload/recording-encoder.js")
128677
+ },
127253
128678
  preloadPath: path$1.join(__dirname, "../preload/index.js"),
127254
128679
  /*
127255
128680
  * The console's surfaces are handed the user's own PATH, from the same
@@ -127479,6 +128904,7 @@ electron.app.on("before-quit", async (event) => {
127479
128904
  launcherWatch?.stop();
127480
128905
  armHeadlessExitDeadline("the app is quitting");
127481
128906
  }
128907
+ disposeAllRecordingEncoders();
127482
128908
  if (await holdQuitForSessionCookieSnapshot(event)) return;
127483
128909
  quitExitDeadline.phase("after the session-cookie hold");
127484
128910
  logger.info("App is about to quit", LogFileType.BACKEND);
@@ -127500,6 +128926,7 @@ electron.app.on("before-quit", async (event) => {
127500
128926
  );
127501
128927
  }
127502
128928
  activeUpdateService?.quitForInFlightInstall("app quit");
128929
+ disposeAllRecordingEncoders();
127503
128930
  void stopBrowserHost();
127504
128931
  quitExitDeadline.phase("awaiting the window close");
127505
128932
  });