@opengeni/react 6.35.1-canary.45051251770001 → 6.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1122) hide show
  1. package/dist/app/app-state.js +32 -32
  2. package/dist/app/components/Composer.js +43 -43
  3. package/dist/app/components/add-card-dialog.js +1 -1
  4. package/dist/app/components/add-card.js +2 -2
  5. package/dist/app/components/agent/agent-capability-picker.js +9 -9
  6. package/dist/app/components/agents/agent-can-use.js +47 -47
  7. package/dist/app/components/agents/agent-form-page.js +139 -139
  8. package/dist/app/components/agents/agent-page.js +122 -122
  9. package/dist/app/components/agents/agent-setup-sections.js +74 -74
  10. package/dist/app/components/agents/agent-skills.js +13 -13
  11. package/dist/app/components/agents/agent-trigger-chat-field.js +6 -6
  12. package/dist/app/components/agents/agent-trigger-dialog.js +31 -31
  13. package/dist/app/components/agents/agent-trigger-picker.js +8 -8
  14. package/dist/app/components/agents/agents-page.js +87 -87
  15. package/dist/app/components/agents/composer-agent-chip.js +59 -59
  16. package/dist/app/components/agents/session-agent-chip.js +55 -55
  17. package/dist/app/components/artifacts/app-package.js +11 -11
  18. package/dist/app/components/artifacts/artifact-browse-controls.js +3 -3
  19. package/dist/app/components/artifacts/artifact-library.js +28 -28
  20. package/dist/app/components/artifacts/artifact-page-chrome.js +1 -1
  21. package/dist/app/components/artifacts/artifact-viewer.js +65 -65
  22. package/dist/app/components/artifacts/chat-interactive-block.js +27 -27
  23. package/dist/app/components/artifacts/copy-artifact-link.js +1 -1
  24. package/dist/app/components/artifacts/file-reach-dialog.js +12 -12
  25. package/dist/app/components/artifacts/inline-chat-image.js +52 -52
  26. package/dist/app/components/artifacts/retained-file-preview.js +58 -58
  27. package/dist/app/components/artifacts/retained-text-preview.js +8 -8
  28. package/dist/app/components/artifacts/site-actions.js +12 -12
  29. package/dist/app/components/artifacts/site-audience.js +7 -7
  30. package/dist/app/components/artifacts/site-conversations.js +34 -34
  31. package/dist/app/components/artifacts/site-data.js +26 -26
  32. package/dist/app/components/artifacts/site-public-link.js +3 -3
  33. package/dist/app/components/artifacts/site-publishing-page.js +69 -69
  34. package/dist/app/components/artifacts/site-publishing.js +54 -54
  35. package/dist/app/components/artifacts/site-settings.js +68 -68
  36. package/dist/app/components/artifacts/site-version-menu.js +9 -9
  37. package/dist/app/components/billing-class-mark.js +8 -8
  38. package/dist/app/components/capabilities/capability-detail-sheet.js +16 -16
  39. package/dist/app/components/capabilities/capability-logo-source.js +28 -28
  40. package/dist/app/components/capabilities/capability-logo.js +1 -1
  41. package/dist/app/components/capabilities/connection-account-picker.js +2 -2
  42. package/dist/app/components/capabilities/connector-tool-permissions.js +8 -8
  43. package/dist/app/components/capabilities/native-connect-setup.js +32 -32
  44. package/dist/app/components/capabilities/own-logins-shared-heads-up.js +6 -6
  45. package/dist/app/components/capabilities/perform-capability-action.js +4 -4
  46. package/dist/app/components/capabilities/prepared-mcp-setup-card.js +31 -31
  47. package/dist/app/components/capabilities/session-capability-card.js +146 -146
  48. package/dist/app/components/capabilities/session-chrome-card.js +49 -49
  49. package/dist/app/components/capabilities/session-connect-inputs-card.js +33 -33
  50. package/dist/app/components/capabilities/session-custom-mcp-card.js +38 -38
  51. package/dist/app/components/capabilities/session-github-card.js +44 -44
  52. package/dist/app/components/capabilities/session-machine-card.js +50 -50
  53. package/dist/app/components/capabilities/session-personal-github-card.js +32 -32
  54. package/dist/app/components/capabilities/session-plugin-card.js +21 -21
  55. package/dist/app/components/capabilities/use-capabilities-catalog.js +1 -1
  56. package/dist/app/components/capabilities/use-connection-accounts.js +3 -3
  57. package/dist/app/components/chat-payment-pages.js +2 -2
  58. package/dist/app/components/command-menu/chat-status.js +26 -26
  59. package/dist/app/components/command-menu/chat-switcher.js +86 -86
  60. package/dist/app/components/command-menu/command-menu.js +109 -109
  61. package/dist/app/components/command-menu/shortcut-sheet.js +23 -23
  62. package/dist/app/components/composer-capabilities-menu-body.js +7 -7
  63. package/dist/app/components/composer-mobile-plus-panel.js +29 -29
  64. package/dist/app/components/composer-mobile-plus.js +3 -3
  65. package/dist/app/components/credit-required-gate.js +6 -6
  66. package/dist/app/components/credit-required-prompt.js +24 -24
  67. package/dist/app/components/credits/checkout-credits-celebration.js +1 -1
  68. package/dist/app/components/credits/checkout-return.js +1 -1
  69. package/dist/app/components/credits/coupon-redeem.js +1 -1
  70. package/dist/app/components/credits/credit-refusal-notice.js +8 -8
  71. package/dist/app/components/credits/own-subscription-plan-notice.js +3 -3
  72. package/dist/app/components/desktop/app-shots.js +9 -9
  73. package/dist/app/components/desktop/app-update.js +3 -3
  74. package/dist/app/components/desktop/computer-use.js +3 -3
  75. package/dist/app/components/desktop/this-computer.js +6 -6
  76. package/dist/app/components/feedback.js +10 -10
  77. package/dist/app/components/follow-up-repository-menu-body.js +14 -14
  78. package/dist/app/components/follow-up-repository-picker.js +1 -1
  79. package/dist/app/components/github-app-connect-launcher.js +2 -2
  80. package/dist/app/components/in-app-help-link.js +3 -3
  81. package/dist/app/components/knowledge/agent-learning-settings.js +3 -3
  82. package/dist/app/components/machines/connect-machine-dialog.js +25 -25
  83. package/dist/app/components/manual-repository-editor.js +3 -3
  84. package/dist/app/components/markdown.js +16 -16
  85. package/dist/app/components/model-identity.js +3 -3
  86. package/dist/app/components/models/models-ui.js +17 -17
  87. package/dist/app/components/models/provider-mark.js +3 -3
  88. package/dist/app/components/models/subscription-usage.js +5 -5
  89. package/dist/app/components/my-things.js +15 -15
  90. package/dist/app/components/own-where-it-works.js +10 -10
  91. package/dist/app/components/personal-resource-attachment-surface.js +4 -4
  92. package/dist/app/components/pickers.js +12 -12
  93. package/dist/app/components/rail/channel-create-dialog.js +6 -6
  94. package/dist/app/components/rail/project-glyph.js +52 -52
  95. package/dist/app/components/rail/project-profile.js +73 -73
  96. package/dist/app/components/rail/rail-context.js +2 -2
  97. package/dist/app/components/rail/rail-sections.js +155 -155
  98. package/dist/app/components/rail/session-header.js +124 -124
  99. package/dist/app/components/rail/session-list.js +154 -154
  100. package/dist/app/components/rail/session-row-content.js +7 -7
  101. package/dist/app/components/rail/session-row-hover-details.js +37 -37
  102. package/dist/app/components/rail/session-shell.js +192 -192
  103. package/dist/app/components/rail/site-session-group-heading.js +36 -36
  104. package/dist/app/components/repository-picker.js +14 -14
  105. package/dist/app/components/secrets/session-secrets-panel.js +4 -4
  106. package/dist/app/components/session/agent-configuration-panel.js +48 -48
  107. package/dist/app/components/session/artifact-session-page.js +7 -7
  108. package/dist/app/components/session/banners.js +20 -20
  109. package/dist/app/components/session/chat-avatar.js +52 -52
  110. package/dist/app/components/session/console-new-conversation.js +111 -111
  111. package/dist/app/components/session/descendant-requests.js +109 -109
  112. package/dist/app/components/session/editable-artifacts-workspace.js +59 -59
  113. package/dist/app/components/session/failed-session-banner.js +30 -30
  114. package/dist/app/components/session/failure-recovery-boundary.js +3 -3
  115. package/dist/app/components/session/human-input-delegation-record.js +3 -3
  116. package/dist/app/components/session/human-input.js +86 -86
  117. package/dist/app/components/session/inspector.js +142 -142
  118. package/dist/app/components/session/linked-panel.js +3 -3
  119. package/dist/app/components/session/message-actions.js +10 -10
  120. package/dist/app/components/session/model-recovery-notice.js +4 -4
  121. package/dist/app/components/session/new-session-settings-menu.js +28 -28
  122. package/dist/app/components/session/new-session-setup-strip.js +55 -55
  123. package/dist/app/components/session/pull-request-panel.js +25 -25
  124. package/dist/app/components/session/sandbox-recovery-actions.js +3 -3
  125. package/dist/app/components/session/sandbox-switcher.js +22 -22
  126. package/dist/app/components/session/sandbox-workspace.js +118 -118
  127. package/dist/app/components/session/search-markdown-highlight.js +17 -17
  128. package/dist/app/components/session/search-results-view.js +18 -18
  129. package/dist/app/components/session/session-admin-access.js +13 -13
  130. package/dist/app/components/session/session-admission-notice.js +11 -11
  131. package/dist/app/components/session/session-avatar-picker.js +59 -59
  132. package/dist/app/components/session/session-avatar.js +54 -54
  133. package/dist/app/components/session/session-machine-access-notice.js +11 -11
  134. package/dist/app/components/session/session-profile-dialog.js +70 -70
  135. package/dist/app/components/session/session-profile-editor.js +71 -71
  136. package/dist/app/components/session/session-retention.js +6 -6
  137. package/dist/app/components/session/session-search-dialog.js +20 -20
  138. package/dist/app/components/session/session-skill-reviews.js +5 -5
  139. package/dist/app/components/session/session-tenancy-control.js +26 -26
  140. package/dist/app/components/session/session-unattended-setting.js +1 -1
  141. package/dist/app/components/session/session-usage-limit-section.js +11 -11
  142. package/dist/app/components/session/share-chat-dialog.js +10 -10
  143. package/dist/app/components/session/subagents.js +23 -23
  144. package/dist/app/components/session/subscription-account-indicator.js +25 -25
  145. package/dist/app/components/session/subscription-account-menu.js +7 -7
  146. package/dist/app/components/session-connectors-menu-body.js +10 -10
  147. package/dist/app/components/settings/row-select.js +6 -6
  148. package/dist/app/components/toaster.js +2 -2
  149. package/dist/app/components/transcription-settings.js +10 -10
  150. package/dist/app/components/ui/destructive-confirm.js +10 -10
  151. package/dist/app/components/usage/usage-entry.js +8 -8
  152. package/dist/app/components/window-bar.js +24 -24
  153. package/dist/app/components/workspace-composer-plus.js +43 -43
  154. package/dist/app/components/workspace-reach.js +6 -6
  155. package/dist/app/embed/session-app.js +398 -398
  156. package/dist/app/lib/actions/actions-provider.js +18 -18
  157. package/dist/app/lib/agent-capabilities.js +4 -4
  158. package/dist/app/lib/app-connect-card.js +14 -14
  159. package/dist/app/lib/app-shared-key-dialog.js +8 -8
  160. package/dist/app/lib/app-surfaces.js +1 -1
  161. package/dist/app/lib/app-sync-opt-in.js +4 -4
  162. package/dist/app/lib/codex-usage-query.js +3 -3
  163. package/dist/app/lib/composer-agent.js +2 -2
  164. package/dist/app/lib/composer-connectors.js +32 -32
  165. package/dist/app/lib/composer-send-blocking.js +3 -3
  166. package/dist/app/lib/console-site.js +6 -6
  167. package/dist/app/lib/console-text.js +2 -2
  168. package/dist/app/lib/deployment-free-model.js +2 -2
  169. package/dist/app/lib/events.js +29 -29
  170. package/dist/app/lib/failed-session-copy.js +6 -6
  171. package/dist/app/lib/feedback-capture.js +2 -2
  172. package/dist/app/lib/free-credit-gap.js +2 -2
  173. package/dist/app/lib/model-access-onboarding.js +5 -5
  174. package/dist/app/lib/model-policy.js +1 -1
  175. package/dist/app/lib/move-chat-to-machine.js +5 -5
  176. package/dist/app/lib/personal-resource-attachments.js +1 -1
  177. package/dist/app/lib/session-branch-cache.js +19 -19
  178. package/dist/app/lib/session-create.js +5 -5
  179. package/dist/app/lib/session-group-pagination.js +19 -19
  180. package/dist/app/lib/session-hover-facts.js +26 -26
  181. package/dist/app/lib/session-list-dirty-scopes.js +20 -20
  182. package/dist/app/lib/session-model.js +3 -3
  183. package/dist/app/lib/session-rail.js +16 -16
  184. package/dist/app/lib/session-rename.js +4 -4
  185. package/dist/app/lib/sessions-group.js +23 -23
  186. package/dist/app/lib/site-tool-consent-dialog.js +23 -23
  187. package/dist/app/lib/site-tool-consent.js +1 -1
  188. package/dist/app/lib/turn-failure-analytics.js +8 -8
  189. package/dist/app/lib/unavailable-session-model.js +2 -2
  190. package/dist/app/lib/use-artifact-catalog.js +2 -2
  191. package/dist/app/lib/use-duplicate-site.js +4 -4
  192. package/dist/app/lib/use-follow-up-repositories.js +5 -5
  193. package/dist/app/lib/use-personal-resource-attachment.js +2 -2
  194. package/dist/app/lib/use-workspace-machines.js +9 -9
  195. package/dist/app/lib/use-workspace-model-catalog.js +7 -7
  196. package/dist/app/lib/use-workspace-rigs.js +6 -6
  197. package/dist/app/lib/workspace-navigation-preference.js +5 -5
  198. package/dist/app/lib/workspace-scope-context.js +4 -4
  199. package/dist/app/routes/app-page-view.js +17 -17
  200. package/dist/app/routes/app-page.js +2 -2
  201. package/dist/app/routes/artifacts.js +152 -152
  202. package/dist/app/routes/retained-artifact.js +108 -108
  203. package/dist/app/routes/session-unavailable.js +5 -5
  204. package/dist/app/routes/session.js +249 -249
  205. package/dist/app/routes/sessions-index-hydration.js +6 -6
  206. package/dist/app/routes/sessions-index.js +207 -207
  207. package/dist/app/routes/site-view.js +200 -200
  208. package/dist/artifacts-document.js +4 -4
  209. package/dist/artifacts-presentation.js +7 -7
  210. package/dist/artifacts-spreadsheet.js +4 -4
  211. package/dist/artifacts.js +50 -50
  212. package/dist/automation-model.js +7 -7
  213. package/dist/automations.js +65 -65
  214. package/dist/browser-viewer-EIEMRVFF.js +23 -0
  215. package/dist/chat-interactive-block-FV37LWYZ.js +22 -0
  216. package/dist/chunk-2COBAJC7.js +818 -0
  217. package/dist/chunk-2HS3IUXE.js +170 -0
  218. package/dist/chunk-2JTMFYCT.js +296 -0
  219. package/dist/chunk-2JXKP4M6.js +114 -0
  220. package/dist/chunk-2P5K7CBH.js +269 -0
  221. package/dist/chunk-2XGRHMRI.js +250 -0
  222. package/dist/chunk-332BYSAZ.js +65 -0
  223. package/dist/chunk-3EM5GTP3.js +158 -0
  224. package/dist/chunk-3L5ATO4A.js +52 -0
  225. package/dist/chunk-3S3PJB7J.js +107 -0
  226. package/dist/chunk-3SBKYPNM.js +270 -0
  227. package/dist/chunk-3Z7VA6ET.js +114 -0
  228. package/dist/chunk-43BRJBEV.js +207 -0
  229. package/dist/chunk-46LZO4ZO.js +188 -0
  230. package/dist/chunk-46ZC5VNC.js +38 -0
  231. package/dist/chunk-4AH4EEHE.js +298 -0
  232. package/dist/chunk-4D3YJNVN.js +270 -0
  233. package/dist/chunk-4E5QVAT4.js +4480 -0
  234. package/dist/chunk-4E5QVAT4.js.map +1 -0
  235. package/dist/chunk-4I4RTI4D.js +37 -0
  236. package/dist/chunk-4KASGJTF.js +287 -0
  237. package/dist/chunk-4RUKLIOF.js +1263 -0
  238. package/dist/chunk-4UU7FN3I.js +650 -0
  239. package/dist/chunk-4VEIBNC2.js +427 -0
  240. package/dist/chunk-4VEIBNC2.js.map +1 -0
  241. package/dist/chunk-4ZRNASBF.js +2551 -0
  242. package/dist/chunk-5EJBPQI2.js +41 -0
  243. package/dist/chunk-5G4IGG7F.js +209 -0
  244. package/dist/chunk-5JAYZOAW.js +131 -0
  245. package/dist/chunk-5JOKVDSR.js +789 -0
  246. package/dist/chunk-5MP3G7ZV.js +1236 -0
  247. package/dist/chunk-5OVRMKP5.js +42 -0
  248. package/dist/chunk-5SGTRULO.js +1184 -0
  249. package/dist/chunk-5SOL4INY.js +572 -0
  250. package/dist/chunk-5Y34P32B.js +27 -0
  251. package/dist/chunk-62HIKJ5F.js +72 -0
  252. package/dist/chunk-62T2ZPD5.js +266 -0
  253. package/dist/chunk-63VNZRLY.js +386 -0
  254. package/dist/chunk-6CDBX3XG.js +33 -0
  255. package/dist/chunk-6D3D2JWY.js +278 -0
  256. package/dist/chunk-6DOIINY4.js +201 -0
  257. package/dist/chunk-6DQBUKGJ.js +112 -0
  258. package/dist/chunk-6SETNFNH.js +1399 -0
  259. package/dist/chunk-6XYFMHNT.js +56 -0
  260. package/dist/chunk-6YU3WV2P.js +33 -0
  261. package/dist/chunk-6YUHDFOZ.js +351 -0
  262. package/dist/chunk-72EOXOR7.js +1185 -0
  263. package/dist/chunk-72ND4ALI.js +532 -0
  264. package/dist/chunk-757LE32E.js +283 -0
  265. package/dist/chunk-7S2S4MXR.js +138 -0
  266. package/dist/chunk-7SYCHMXS.js +200 -0
  267. package/dist/chunk-7TVAPQOV.js +5089 -0
  268. package/dist/chunk-7UDLRDHK.js +214 -0
  269. package/dist/chunk-7YLQCMZP.js +357 -0
  270. package/dist/chunk-A5GX3CAE.js +849 -0
  271. package/dist/chunk-A7EBV2EB.js +318 -0
  272. package/dist/chunk-AB5SPXUR.js +114 -0
  273. package/dist/chunk-AHVQGL5A.js +202 -0
  274. package/dist/chunk-AI77ZKEV.js +26 -0
  275. package/dist/chunk-AIX2D6RB.js +1019 -0
  276. package/dist/chunk-AVSIHP7Q.js +192 -0
  277. package/dist/chunk-AWK23Q32.js +107 -0
  278. package/dist/chunk-AYVWA6KD.js +432 -0
  279. package/dist/chunk-AYZXE4IM.js +2553 -0
  280. package/dist/chunk-AZGGSPTE.js +124 -0
  281. package/dist/chunk-B45TB4HY.js +931 -0
  282. package/dist/chunk-BIUJHNVR.js +46 -0
  283. package/dist/chunk-BJUOKUE5.js +234 -0
  284. package/dist/chunk-BPEEVMKH.js +292 -0
  285. package/dist/chunk-BPHPAGYF.js +74 -0
  286. package/dist/chunk-BXMND6YU.js +307 -0
  287. package/dist/chunk-C6OM2SRG.js +117 -0
  288. package/dist/chunk-CIRCUDKF.js +1309 -0
  289. package/dist/chunk-CLKR4UG3.js +403 -0
  290. package/dist/chunk-CPX6BHER.js +554 -0
  291. package/dist/chunk-CVC4RO7D.js +155 -0
  292. package/dist/chunk-D3YJAQGK.js +103 -0
  293. package/dist/chunk-DFQ72BLS.js +1024 -0
  294. package/dist/chunk-DG65PJOZ.js +4564 -0
  295. package/dist/chunk-DNAXAS5R.js +406 -0
  296. package/dist/chunk-DO247ITS.js +175 -0
  297. package/dist/chunk-DONBARLL.js +154 -0
  298. package/dist/chunk-DTLXQ3ZU.js +373 -0
  299. package/dist/chunk-EAXTACI4.js +274 -0
  300. package/dist/chunk-EDPH7AJH.js +412 -0
  301. package/dist/chunk-EER3B3G5.js +10036 -0
  302. package/dist/chunk-EER3B3G5.js.map +1 -0
  303. package/dist/chunk-EFKQHCGJ.js +276 -0
  304. package/dist/chunk-EILSPMVD.js +133 -0
  305. package/dist/chunk-EK7KIETS.js +211 -0
  306. package/dist/chunk-EMWT6GOK.js +437 -0
  307. package/dist/chunk-EO22NST7.js +259 -0
  308. package/dist/chunk-ER5MYLIE.js +256 -0
  309. package/dist/chunk-ES5HKVQF.js +234 -0
  310. package/dist/chunk-EXRQ5ATC.js +738 -0
  311. package/dist/chunk-EXRQ5ATC.js.map +1 -0
  312. package/dist/chunk-F26YBYAZ.js +111 -0
  313. package/dist/chunk-F6QP4GSK.js +515 -0
  314. package/dist/chunk-F7QEO7M2.js +851 -0
  315. package/dist/chunk-FJFGDLXB.js +12 -0
  316. package/dist/chunk-FLLJ2WXW.js +113 -0
  317. package/dist/chunk-FMBJKMT4.js +107 -0
  318. package/dist/chunk-FPN4I4CG.js +3690 -0
  319. package/dist/chunk-FUXFJTXL.js +3070 -0
  320. package/dist/chunk-FXFOKD7A.js +449 -0
  321. package/dist/chunk-FZI4QOAV.js +3996 -0
  322. package/dist/chunk-FZI4QOAV.js.map +1 -0
  323. package/dist/chunk-G6SSSX5R.js +158 -0
  324. package/dist/chunk-GBGCMHBB.js +608 -0
  325. package/dist/chunk-GIHE7U3Y.js +174 -0
  326. package/dist/chunk-GJ4GTYOD.js +372 -0
  327. package/dist/chunk-GLSDWNFV.js +432 -0
  328. package/dist/chunk-GMGAW3T6.js +278 -0
  329. package/dist/chunk-GNGI6XFN.js +43 -0
  330. package/dist/chunk-GO5VIAA7.js +264 -0
  331. package/dist/chunk-GSW4YHZE.js +229 -0
  332. package/dist/chunk-GUC6IWEY.js +407 -0
  333. package/dist/chunk-GWAY3SO5.js +15 -0
  334. package/dist/chunk-GXOTNT5D.js +168 -0
  335. package/dist/chunk-GZZCVF76.js +3851 -0
  336. package/dist/chunk-H4VMHFOX.js +214 -0
  337. package/dist/chunk-HA5RFQAF.js +110 -0
  338. package/dist/chunk-HFROJDFQ.js +118 -0
  339. package/dist/chunk-HHFFPE67.js +220 -0
  340. package/dist/chunk-HJLHGXWL.js +103 -0
  341. package/dist/chunk-HKNMNL7B.js +2984 -0
  342. package/dist/chunk-HT7MBHLY.js +1021 -0
  343. package/dist/chunk-I5FSUZVW.js +584 -0
  344. package/dist/chunk-IINQO425.js +246 -0
  345. package/dist/chunk-IIXNEOK4.js +1022 -0
  346. package/dist/chunk-IM3WA5AL.js +311 -0
  347. package/dist/chunk-IX4P4OGR.js +399 -0
  348. package/dist/chunk-IX5VHZYS.js +129 -0
  349. package/dist/chunk-JB3TSUZO.js +263 -0
  350. package/dist/chunk-JIC6RLUB.js +27 -0
  351. package/dist/chunk-JNJIZCTN.js +172 -0
  352. package/dist/chunk-JNV5ZPUV.js +828 -0
  353. package/dist/chunk-JPQFVR24.js +50 -0
  354. package/dist/chunk-JPZVMXDP.js +1333 -0
  355. package/dist/chunk-JVPF34MX.js +215 -0
  356. package/dist/chunk-KED67KAF.js +85 -0
  357. package/dist/chunk-KJ72GMZ2.js +378 -0
  358. package/dist/chunk-KTGKGHEA.js +75 -0
  359. package/dist/chunk-KU77XHWB.js +285 -0
  360. package/dist/chunk-KVPQUADA.js +5915 -0
  361. package/dist/chunk-KVPQUADA.js.map +1 -0
  362. package/dist/chunk-KXBLLFOO.js +249 -0
  363. package/dist/chunk-L6WVCO6D.js +61 -0
  364. package/dist/chunk-LIOZ2MXJ.js +380 -0
  365. package/dist/chunk-LIOZ2MXJ.js.map +1 -0
  366. package/dist/chunk-LPEFULJY.js +73 -0
  367. package/dist/chunk-LRMGPO7E.js +98 -0
  368. package/dist/chunk-LVKTKORH.js +121 -0
  369. package/dist/chunk-MCPKUVMQ.js +99 -0
  370. package/dist/chunk-MFLU3466.js +99 -0
  371. package/dist/chunk-MIUJ3EH5.js +60 -0
  372. package/dist/chunk-MIUMNTIJ.js +175 -0
  373. package/dist/chunk-ML46TXRM.js +113 -0
  374. package/dist/chunk-MO3XJQN2.js +629 -0
  375. package/dist/chunk-MQRHTOQ2.js +218 -0
  376. package/dist/chunk-MVYQDBE6.js +79 -0
  377. package/dist/chunk-NIPON7YB.js +850 -0
  378. package/dist/chunk-NIPON7YB.js.map +1 -0
  379. package/dist/chunk-NPBEUU22.js +196 -0
  380. package/dist/chunk-NSXKGS2K.js +178 -0
  381. package/dist/chunk-NUEFORM6.js +2317 -0
  382. package/dist/chunk-NZOFNQNC.js +176 -0
  383. package/dist/chunk-O664PL2U.js +47 -0
  384. package/dist/chunk-O664PL2U.js.map +1 -0
  385. package/dist/chunk-OATXCLTY.js +211 -0
  386. package/dist/chunk-OG3ELROW.js +538 -0
  387. package/dist/chunk-OI4WS7FW.js +162 -0
  388. package/dist/chunk-OITGZUDC.js +82 -0
  389. package/dist/chunk-OKD2LBMK.js +333 -0
  390. package/dist/chunk-OLFOGAWU.js +273 -0
  391. package/dist/chunk-OLFOGAWU.js.map +1 -0
  392. package/dist/chunk-OSA4CGST.js +134 -0
  393. package/dist/chunk-OXYAKUFU.js +401 -0
  394. package/dist/chunk-OYMSMU5O.js +396 -0
  395. package/dist/chunk-P4NZ72KY.js +162 -0
  396. package/dist/chunk-PBYL2VIM.js +379 -0
  397. package/dist/chunk-PDW3OOSZ.js +505 -0
  398. package/dist/chunk-PGRKTQIW.js +523 -0
  399. package/dist/chunk-PPQJIVGM.js +175 -0
  400. package/dist/chunk-PYMQM65Y.js +125 -0
  401. package/dist/chunk-Q273Q33U.js +166 -0
  402. package/dist/chunk-Q4CLS2HL.js +340 -0
  403. package/dist/chunk-QA5UNVHD.js +85 -0
  404. package/dist/chunk-QFOBUA2J.js +428 -0
  405. package/dist/chunk-QLIM4D56.js +1095 -0
  406. package/dist/chunk-QMQF5U2D.js +20 -0
  407. package/dist/chunk-QNOWKKZ4.js +40 -0
  408. package/dist/chunk-QPOUPVPD.js +144 -0
  409. package/dist/chunk-QTJAQ6DS.js +48 -0
  410. package/dist/chunk-QUOFP3G7.js +404 -0
  411. package/dist/chunk-QVOTPOXK.js +29 -0
  412. package/dist/chunk-QYZ5RVGM.js +184 -0
  413. package/dist/chunk-R7CVDKRN.js +2580 -0
  414. package/dist/chunk-RB7MXNZD.js +639 -0
  415. package/dist/chunk-RDZQFZOQ.js +187 -0
  416. package/dist/chunk-RIHKEGWS.js +194 -0
  417. package/dist/chunk-ROSB7GF6.js +57 -0
  418. package/dist/chunk-RP3YMYCX.js +723 -0
  419. package/dist/chunk-RPHXJHNX.js +271 -0
  420. package/dist/chunk-RVC3M66H.js +191 -0
  421. package/dist/chunk-S3OTJAAC.js +283 -0
  422. package/dist/chunk-SBWPMVRN.js +56 -0
  423. package/dist/chunk-SERECSAR.js +138 -0
  424. package/dist/chunk-SHSEF3GJ.js +187 -0
  425. package/dist/chunk-SMS2M3RG.js +772 -0
  426. package/dist/chunk-SRDHDIRQ.js +177 -0
  427. package/dist/chunk-SXRYA7NN.js +389 -0
  428. package/dist/chunk-SYA3WYG4.js +1187 -0
  429. package/dist/chunk-SYYFA7W7.js +23 -0
  430. package/dist/chunk-T2QDSTBH.js +371 -0
  431. package/dist/chunk-TFSCGFYV.js +251 -0
  432. package/dist/chunk-TGCKZOSX.js +246 -0
  433. package/dist/chunk-THILLYQM.js +132 -0
  434. package/dist/chunk-TI6LGUEZ.js +2412 -0
  435. package/dist/chunk-TSY6YZL2.js +366 -0
  436. package/dist/chunk-TW2RHTLH.js +3321 -0
  437. package/dist/chunk-TWA5G277.js +141 -0
  438. package/dist/chunk-TZZ2S4XI.js +247 -0
  439. package/dist/chunk-U5D3K53R.js +58 -0
  440. package/dist/chunk-UECD27LX.js +251 -0
  441. package/dist/chunk-UFJDETKG.js +108 -0
  442. package/dist/chunk-UHCFYX4I.js +570 -0
  443. package/dist/chunk-UHTURYJO.js +898 -0
  444. package/dist/chunk-UJH63JT3.js +67 -0
  445. package/dist/chunk-UOLDS6S5.js +1152 -0
  446. package/dist/chunk-UUE3OGXI.js +84 -0
  447. package/dist/chunk-UUNJ2E57.js +391 -0
  448. package/dist/chunk-UYQVWRAH.js +199 -0
  449. package/dist/chunk-UYWVK7JQ.js +234 -0
  450. package/dist/chunk-UYWWUEL4.js +126 -0
  451. package/dist/chunk-V4CQKX5H.js +48 -0
  452. package/dist/chunk-V4QM7GDQ.js +3176 -0
  453. package/dist/chunk-V5Y74WII.js +91 -0
  454. package/dist/chunk-VGGZLUQK.js +129 -0
  455. package/dist/chunk-VGX636MB.js +311 -0
  456. package/dist/chunk-VGZLFQO2.js +773 -0
  457. package/dist/chunk-VJWZATNF.js +137 -0
  458. package/dist/chunk-VMWCIC2N.js +50 -0
  459. package/dist/chunk-VPWKTIU5.js +227 -0
  460. package/dist/chunk-VXOLG6YB.js +469 -0
  461. package/dist/chunk-W2NAU5VB.js +1628 -0
  462. package/dist/chunk-WGORKMR3.js +353 -0
  463. package/dist/chunk-WMIDELSJ.js +391 -0
  464. package/dist/chunk-WSOSGL2G.js +383 -0
  465. package/dist/chunk-WXUUOM4X.js +400 -0
  466. package/dist/chunk-WZ74QHLE.js +4863 -0
  467. package/dist/chunk-WZ74QHLE.js.map +1 -0
  468. package/dist/chunk-X2OWM2ME.js +1870 -0
  469. package/dist/chunk-X6UMGG4T.js +68 -0
  470. package/dist/chunk-XDXKB25W.js +93 -0
  471. package/dist/chunk-XE4PHI74.js +231 -0
  472. package/dist/chunk-XHF2XNU5.js +73 -0
  473. package/dist/chunk-XLJ4SQFS.js +230 -0
  474. package/dist/chunk-XOD4FX6M.js +2434 -0
  475. package/dist/chunk-XODQ2GPF.js +3110 -0
  476. package/dist/chunk-XT54RTAM.js +441 -0
  477. package/dist/chunk-YAVW5OJ5.js +131 -0
  478. package/dist/chunk-YDQHFJM2.js +83 -0
  479. package/dist/chunk-YH6O6OQ6.js +1356 -0
  480. package/dist/chunk-YIKPC2QP.js +794 -0
  481. package/dist/chunk-ZD7PKYC4.js +335 -0
  482. package/dist/chunk-ZEQYHEWP.js +406 -0
  483. package/dist/chunk-ZP3QCPYG.js +21 -0
  484. package/dist/chunk-ZRVUCTSI.js +265 -0
  485. package/dist/chunk-ZSI3ITRK.js +449 -0
  486. package/dist/chunk-ZZMEQCIZ.js +236 -0
  487. package/dist/components/browser-viewer.d.ts +4 -1
  488. package/dist/composer.js +35 -35
  489. package/dist/computer-viewer-ZBY3BPYW.js +21 -0
  490. package/dist/connect.js +30 -30
  491. package/dist/connection-step-up-JQ4OFSQN.js +145 -0
  492. package/dist/desktop-dictation.js +24 -24
  493. package/dist/desktop.js +2 -2
  494. package/dist/editor.js +2 -2
  495. package/dist/embedded-new-voice-ZB5XLKLU.js +25 -0
  496. package/dist/embedded-voice-MZJISDCS.js +25 -0
  497. package/dist/fleet-decision-row-LG3SYVR3.js +361 -0
  498. package/dist/human-input-model.d.ts +2 -0
  499. package/dist/in-chat-connect-model.js +6 -6
  500. package/dist/index.js +298 -298
  501. package/dist/interaction.d.ts +2 -0
  502. package/dist/interaction.js +11 -9
  503. package/dist/interaction.js.map +1 -1
  504. package/dist/latest-question-QWJTXMFA.js +1 -1
  505. package/dist/machine-request-model.js +1 -1
  506. package/dist/machines.js +8 -8
  507. package/dist/meetings-recorder.js +1 -1
  508. package/dist/meetings.js +116 -116
  509. package/dist/messages/en.d.ts +12 -0
  510. package/dist/messages.js +1 -1
  511. package/dist/model-levels.js +2 -2
  512. package/dist/model-picker-model.js +2 -2
  513. package/dist/model-policy-picker-menu-5Y72PLNF.js +23 -0
  514. package/dist/model-policy.js +1 -1
  515. package/dist/payment-page-card-YPSXRHBA.js +226 -0
  516. package/dist/platform-activity-row-ZU4MEBNK.js +156 -0
  517. package/dist/queue-surface-implementation-6Q25RPH6.js +932 -0
  518. package/dist/realtime.js +17 -17
  519. package/dist/recorder-host-JD4GWJ2Z.js +80 -0
  520. package/dist/recordings.js +3 -3
  521. package/dist/sandbox-files-HCLEEJMU.js +28 -0
  522. package/dist/session-app.js +398 -398
  523. package/dist/session-connect-cards-DRKEN3Z4.js +27 -0
  524. package/dist/session-list-model.js +3 -3
  525. package/dist/session-realtime-IZOTTRH6.js +30 -0
  526. package/dist/session-realtime.js +2 -2
  527. package/dist/session-ui.js +95 -95
  528. package/dist/session.js +42 -42
  529. package/dist/sites.js +3 -3
  530. package/dist/terminal.js +2 -2
  531. package/dist/this-computer.js +3 -3
  532. package/dist/timeline-annotation-markers-WWXNJOXI.js +157 -0
  533. package/dist/timeline-annotation-selection-ZKRIQFIQ.js +208 -0
  534. package/dist/timeline-annotations-dialog-4IMKTOXJ.js +283 -0
  535. package/dist/timeline-model.js +58 -58
  536. package/dist/ui/access-list.js +23 -23
  537. package/dist/ui/cadence-picker.js +7 -7
  538. package/dist/ui/choice-cards.js +3 -3
  539. package/dist/ui/confirm-dialog.js +2 -2
  540. package/dist/ui/copy-field.js +3 -3
  541. package/dist/ui/detail-page.js +5 -5
  542. package/dist/ui/detail-sheet.js +5 -5
  543. package/dist/ui/diff-view.js +3 -3
  544. package/dist/ui/disclosure.js +6 -6
  545. package/dist/ui/email-chips-input.js +3 -3
  546. package/dist/ui/field.js +2 -2
  547. package/dist/ui/flush-form-page.js +7 -7
  548. package/dist/ui/form-dialog.js +6 -6
  549. package/dist/ui/list-row.js +6 -6
  550. package/dist/ui/load-failure.js +3 -3
  551. package/dist/ui/relative-time.js +3 -3
  552. package/dist/ui/revision-history.js +13 -13
  553. package/dist/ui/role-select.js +11 -11
  554. package/dist/ui/select-menu.js +5 -5
  555. package/dist/ui/settings-nav.js +6 -6
  556. package/dist/ui/sheet.js +2 -2
  557. package/dist/ui/usage-meter.js +4 -4
  558. package/dist/usage.js +3 -3
  559. package/dist/workbench.js +11 -11
  560. package/package.json +5 -6
  561. package/src/components/browser-viewer.tsx +109 -72
  562. package/src/components/secret-question-field.tsx +2 -1
  563. package/src/human-input-model.ts +53 -10
  564. package/src/interaction.ts +2 -0
  565. package/src/messages/en.ts +12 -0
  566. package/src/model-policy.ts +3 -1
  567. package/dist/browser-viewer-5DCULGWS.js +0 -23
  568. package/dist/chat-interactive-block-ISMUKH3P.js +0 -22
  569. package/dist/chunk-22NKV5QE.js +0 -133
  570. package/dist/chunk-25SCFA2X.js +0 -794
  571. package/dist/chunk-2NJRDH3Z.js +0 -4480
  572. package/dist/chunk-2NJRDH3Z.js.map +0 -1
  573. package/dist/chunk-2O5EDTVB.js +0 -723
  574. package/dist/chunk-2R7AOT3Y.js +0 -400
  575. package/dist/chunk-2XQFDRP6.js +0 -234
  576. package/dist/chunk-34XY4PWB.js +0 -2412
  577. package/dist/chunk-37J33BLN.js +0 -107
  578. package/dist/chunk-3AXHBU7K.js +0 -818
  579. package/dist/chunk-3B4D4BV7.js +0 -270
  580. package/dist/chunk-3EQMXU5V.js +0 -403
  581. package/dist/chunk-3QUDVXDR.js +0 -227
  582. package/dist/chunk-3SKJO525.js +0 -215
  583. package/dist/chunk-3Y2VSFYS.js +0 -26
  584. package/dist/chunk-3Y7IJPHB.js +0 -3321
  585. package/dist/chunk-3YLXGP2I.js +0 -515
  586. package/dist/chunk-4AUUNEQY.js +0 -15
  587. package/dist/chunk-4D4XXJJJ.js +0 -379
  588. package/dist/chunk-4DW5QEAP.js +0 -201
  589. package/dist/chunk-4KF5I3H5.js +0 -335
  590. package/dist/chunk-4PG2BEQA.js +0 -175
  591. package/dist/chunk-4SW3EUNM.js +0 -83
  592. package/dist/chunk-4T2KWNYX.js +0 -378
  593. package/dist/chunk-4TTWUMDP.js +0 -168
  594. package/dist/chunk-4WKITG7P.js +0 -132
  595. package/dist/chunk-4YXA5UO3.js +0 -287
  596. package/dist/chunk-4ZCTHNOA.js +0 -298
  597. package/dist/chunk-52BUMJQB.js +0 -98
  598. package/dist/chunk-53ZK2JFE.js +0 -538
  599. package/dist/chunk-5ABIZ7YT.js +0 -371
  600. package/dist/chunk-5AHIKB3O.js +0 -449
  601. package/dist/chunk-5DEP55DK.js +0 -251
  602. package/dist/chunk-5ERDSF2C.js +0 -79
  603. package/dist/chunk-5G55HNJB.js +0 -412
  604. package/dist/chunk-62AHHCFV.js +0 -340
  605. package/dist/chunk-644P2VLV.js +0 -407
  606. package/dist/chunk-6F34IWSA.js +0 -47
  607. package/dist/chunk-6F34IWSA.js.map +0 -1
  608. package/dist/chunk-6QDXVH45.js +0 -114
  609. package/dist/chunk-6TBA45QF.js +0 -12
  610. package/dist/chunk-6Y3EFN4Q.js +0 -265
  611. package/dist/chunk-73P7NEOX.js +0 -52
  612. package/dist/chunk-7CLQ7RQV.js +0 -828
  613. package/dist/chunk-7M57K6K5.js +0 -505
  614. package/dist/chunk-7QORJTVI.js +0 -3690
  615. package/dist/chunk-ABO54U65.js +0 -108
  616. package/dist/chunk-ANCI6T7S.js +0 -406
  617. package/dist/chunk-AO27D7GY.js +0 -1021
  618. package/dist/chunk-ATQ3O5E6.js +0 -144
  619. package/dist/chunk-AXBSHKRP.js +0 -246
  620. package/dist/chunk-AZC5P5PV.js +0 -131
  621. package/dist/chunk-B6YDINPE.js +0 -68
  622. package/dist/chunk-BJNSS4UV.js +0 -399
  623. package/dist/chunk-BKYHS4IH.js +0 -276
  624. package/dist/chunk-BOCDCQYX.js +0 -41
  625. package/dist/chunk-BOP5TAUU.js +0 -229
  626. package/dist/chunk-BPD6VRVH.js +0 -432
  627. package/dist/chunk-BSAKPNKY.js +0 -263
  628. package/dist/chunk-BUBEMKK3.js +0 -4845
  629. package/dist/chunk-BUBEMKK3.js.map +0 -1
  630. package/dist/chunk-BXKNGFX5.js +0 -5089
  631. package/dist/chunk-CBHZXVSI.js +0 -207
  632. package/dist/chunk-CGEAOUXW.js +0 -246
  633. package/dist/chunk-CGWLKFQF.js +0 -2580
  634. package/dist/chunk-CIDJMJ44.js +0 -380
  635. package/dist/chunk-CIDJMJ44.js.map +0 -1
  636. package/dist/chunk-CNLR3MVZ.js +0 -175
  637. package/dist/chunk-CPN7JXYV.js +0 -93
  638. package/dist/chunk-DDCDQ4BF.js +0 -2551
  639. package/dist/chunk-DK5L6E4G.js +0 -391
  640. package/dist/chunk-DMDJPQCR.js +0 -5903
  641. package/dist/chunk-DMDJPQCR.js.map +0 -1
  642. package/dist/chunk-DNNW2FSP.js +0 -256
  643. package/dist/chunk-DRPIGAMM.js +0 -4564
  644. package/dist/chunk-DUZZB4C6.js +0 -283
  645. package/dist/chunk-DWH35C5X.js +0 -56
  646. package/dist/chunk-DWW2MA3S.js +0 -278
  647. package/dist/chunk-E4NQIEA3.js +0 -85
  648. package/dist/chunk-E4SAFP76.js +0 -112
  649. package/dist/chunk-EO7NZKIX.js +0 -249
  650. package/dist/chunk-EQSANTUC.js +0 -84
  651. package/dist/chunk-EVHNQCEM.js +0 -214
  652. package/dist/chunk-EVRLHFIG.js +0 -187
  653. package/dist/chunk-FAVXYNTK.js +0 -67
  654. package/dist/chunk-FRDJUZ6E.js +0 -91
  655. package/dist/chunk-FWRKCWQO.js +0 -141
  656. package/dist/chunk-G65TM5FL.js +0 -166
  657. package/dist/chunk-G7TU7QDO.js +0 -432
  658. package/dist/chunk-GGIPEZLL.js +0 -849
  659. package/dist/chunk-GKA5LFYR.js +0 -21
  660. package/dist/chunk-GMQFRX2V.js +0 -406
  661. package/dist/chunk-HE5BTYPR.js +0 -37
  662. package/dist/chunk-HI6TPRY5.js +0 -1356
  663. package/dist/chunk-HLNSIXSJ.js +0 -357
  664. package/dist/chunk-HUKGLWAY.js +0 -174
  665. package/dist/chunk-HUTQJY3F.js +0 -23
  666. package/dist/chunk-HWDHA4KS.js +0 -137
  667. package/dist/chunk-HWDKTGNX.js +0 -1263
  668. package/dist/chunk-HWOJ7JSO.js +0 -20
  669. package/dist/chunk-HWOYJOKK.js +0 -266
  670. package/dist/chunk-HXVKXFIC.js +0 -56
  671. package/dist/chunk-HYVRYGY3.js +0 -270
  672. package/dist/chunk-I5ZTAMDP.js +0 -27
  673. package/dist/chunk-IGVRNMXK.js +0 -154
  674. package/dist/chunk-IHNCZONS.js +0 -230
  675. package/dist/chunk-IIUBCLH6.js +0 -437
  676. package/dist/chunk-IQKLWMIF.js +0 -373
  677. package/dist/chunk-IQWAFZGW.js +0 -191
  678. package/dist/chunk-J3GK2LZP.js +0 -292
  679. package/dist/chunk-J4OOKDRV.js +0 -40
  680. package/dist/chunk-JBNCFLMW.js +0 -3996
  681. package/dist/chunk-JBNCFLMW.js.map +0 -1
  682. package/dist/chunk-JY4ACIKP.js +0 -194
  683. package/dist/chunk-KDZ7WKYY.js +0 -192
  684. package/dist/chunk-KGTZGR4F.js +0 -172
  685. package/dist/chunk-KKIJYI7N.js +0 -351
  686. package/dist/chunk-KLOB3IXX.js +0 -175
  687. package/dist/chunk-KMZUIWL6.js +0 -107
  688. package/dist/chunk-KUYTRUIE.js +0 -214
  689. package/dist/chunk-KYDLVMKA.js +0 -99
  690. package/dist/chunk-KZQDP2JM.js +0 -155
  691. package/dist/chunk-L22AVXXW.js +0 -187
  692. package/dist/chunk-L5AQCKRR.js +0 -311
  693. package/dist/chunk-LG3WCCUT.js +0 -188
  694. package/dist/chunk-LRE7WH6D.js +0 -1095
  695. package/dist/chunk-LSQP22UI.js +0 -176
  696. package/dist/chunk-LTNBDO5B.js +0 -72
  697. package/dist/chunk-LUUFLV27.js +0 -113
  698. package/dist/chunk-M2KDPKQC.js +0 -126
  699. package/dist/chunk-M5FX5KH5.js +0 -629
  700. package/dist/chunk-MD27CX2K.js +0 -1022
  701. package/dist/chunk-MEUAI3B7.js +0 -199
  702. package/dist/chunk-MFYH4N6I.js +0 -650
  703. package/dist/chunk-MPW67ODY.js +0 -639
  704. package/dist/chunk-MRNOTVGF.js +0 -366
  705. package/dist/chunk-MTOWY5MX.js +0 -307
  706. package/dist/chunk-MVLHO6AU.js +0 -441
  707. package/dist/chunk-N4AHWDN2.js +0 -121
  708. package/dist/chunk-NABGUV6O.js +0 -48
  709. package/dist/chunk-NH6OLIQD.js +0 -1628
  710. package/dist/chunk-NKCK4LBK.js +0 -103
  711. package/dist/chunk-NNE73MK2.js +0 -1333
  712. package/dist/chunk-NPKFHO6N.js +0 -584
  713. package/dist/chunk-NRRRO3NJ.js +0 -851
  714. package/dist/chunk-NSLCRIQ6.js +0 -386
  715. package/dist/chunk-NUZNJSL5.js +0 -285
  716. package/dist/chunk-NYTKZQ2V.js +0 -234
  717. package/dist/chunk-O4UAH7WR.js +0 -427
  718. package/dist/chunk-O4UAH7WR.js.map +0 -1
  719. package/dist/chunk-OAEI3MUO.js +0 -50
  720. package/dist/chunk-OCWCZRVU.js +0 -3110
  721. package/dist/chunk-ODR2Q4JQ.js +0 -1236
  722. package/dist/chunk-ODWNT3XC.js +0 -3176
  723. package/dist/chunk-OE6XABJ3.js +0 -269
  724. package/dist/chunk-OEGJWY2U.js +0 -3851
  725. package/dist/chunk-OHJXHKQT.js +0 -162
  726. package/dist/chunk-OJE3WTHK.js +0 -391
  727. package/dist/chunk-OJNZTTQE.js +0 -353
  728. package/dist/chunk-OMYNOB7U.js +0 -124
  729. package/dist/chunk-OX234K6A.js +0 -1399
  730. package/dist/chunk-OYJ7KP6H.js +0 -1152
  731. package/dist/chunk-OZGG6TS7.js +0 -554
  732. package/dist/chunk-P5DGNIGZ.js +0 -773
  733. package/dist/chunk-PCSRHFRF.js +0 -75
  734. package/dist/chunk-PGDGX6PO.js +0 -178
  735. package/dist/chunk-PGMXITPB.js +0 -85
  736. package/dist/chunk-PHNLFMBS.js +0 -158
  737. package/dist/chunk-PJF47YJJ.js +0 -202
  738. package/dist/chunk-PMBZMVKE.js +0 -33
  739. package/dist/chunk-PNLVWZSM.js +0 -211
  740. package/dist/chunk-PQ7WJAKL.js +0 -74
  741. package/dist/chunk-PTLRNXWE.js +0 -200
  742. package/dist/chunk-PTSRBKQC.js +0 -118
  743. package/dist/chunk-PX64T6XV.js +0 -134
  744. package/dist/chunk-PYS63BC6.js +0 -138
  745. package/dist/chunk-QHPB7VSA.js +0 -111
  746. package/dist/chunk-QJQTLBT3.js +0 -73
  747. package/dist/chunk-QR74WLXN.js +0 -65
  748. package/dist/chunk-QZSIADFZ.js +0 -523
  749. package/dist/chunk-R2T4IUNB.js +0 -29
  750. package/dist/chunk-R6CFPY3F.js +0 -278
  751. package/dist/chunk-R6OBJ7LF.js +0 -131
  752. package/dist/chunk-R6WQLIFX.js +0 -73
  753. package/dist/chunk-R7QHNWYL.js +0 -1309
  754. package/dist/chunk-R7ZIFQ7D.js +0 -738
  755. package/dist/chunk-R7ZIFQ7D.js.map +0 -1
  756. package/dist/chunk-RCKXQ2RY.js +0 -3070
  757. package/dist/chunk-RCN3SVJC.js +0 -211
  758. package/dist/chunk-RDTZN6HR.js +0 -372
  759. package/dist/chunk-RET43Z3F.js +0 -43
  760. package/dist/chunk-REUQ464X.js +0 -898
  761. package/dist/chunk-RIOTQESW.js +0 -107
  762. package/dist/chunk-RPJC2JCE.js +0 -209
  763. package/dist/chunk-RT2GW3LO.js +0 -10035
  764. package/dist/chunk-RT2GW3LO.js.map +0 -1
  765. package/dist/chunk-RULIWGQ6.js +0 -2984
  766. package/dist/chunk-RWZ5XML5.js +0 -103
  767. package/dist/chunk-RYWPD5WU.js +0 -572
  768. package/dist/chunk-RYYBQ4PW.js +0 -129
  769. package/dist/chunk-S44ADSZG.js +0 -236
  770. package/dist/chunk-SB3LGY34.js +0 -27
  771. package/dist/chunk-SG4FA5CX.js +0 -33
  772. package/dist/chunk-SMCHRNUL.js +0 -129
  773. package/dist/chunk-SMSEI6VH.js +0 -184
  774. package/dist/chunk-SNACGK3Z.js +0 -177
  775. package/dist/chunk-SOZTO34S.js +0 -2553
  776. package/dist/chunk-SP7XRRGB.js +0 -428
  777. package/dist/chunk-STA75WRF.js +0 -383
  778. package/dist/chunk-SUO5NPEX.js +0 -318
  779. package/dist/chunk-T2NC7ALH.js +0 -333
  780. package/dist/chunk-T3OUZVHU.js +0 -250
  781. package/dist/chunk-T4YOQ6DF.js +0 -789
  782. package/dist/chunk-TGG3ODCS.js +0 -99
  783. package/dist/chunk-TLR2SX7T.js +0 -2317
  784. package/dist/chunk-TXCGPEWC.js +0 -243
  785. package/dist/chunk-TXCGPEWC.js.map +0 -1
  786. package/dist/chunk-TZGJPDZL.js +0 -259
  787. package/dist/chunk-U7KNZEMU.js +0 -271
  788. package/dist/chunk-UDDZDC2Q.js +0 -772
  789. package/dist/chunk-UFIETNB2.js +0 -469
  790. package/dist/chunk-UFRXYZCJ.js +0 -125
  791. package/dist/chunk-UILJ5INQ.js +0 -170
  792. package/dist/chunk-UJ4DLPYG.js +0 -449
  793. package/dist/chunk-UKDLZ76A.js +0 -2434
  794. package/dist/chunk-UMYCZQSL.js +0 -1870
  795. package/dist/chunk-UPRN4FBY.js +0 -38
  796. package/dist/chunk-UQBYKWGG.js +0 -311
  797. package/dist/chunk-UQR5RZ5I.js +0 -218
  798. package/dist/chunk-UWPSCSIZ.js +0 -57
  799. package/dist/chunk-UYLO2JP2.js +0 -158
  800. package/dist/chunk-V2YSF3MJ.js +0 -114
  801. package/dist/chunk-VAJQQKSG.js +0 -283
  802. package/dist/chunk-VDHWFRTL.js +0 -58
  803. package/dist/chunk-VLDKWGHD.js +0 -61
  804. package/dist/chunk-VLODMRE3.js +0 -138
  805. package/dist/chunk-VM6BM3NV.js +0 -389
  806. package/dist/chunk-VRVB2XSO.js +0 -117
  807. package/dist/chunk-W2PBDF4F.js +0 -231
  808. package/dist/chunk-W7BNYXRT.js +0 -296
  809. package/dist/chunk-WCA777NS.js +0 -1187
  810. package/dist/chunk-WDDAHRBC.js +0 -404
  811. package/dist/chunk-WEXKKIPB.js +0 -1024
  812. package/dist/chunk-WG7OVUCV.js +0 -401
  813. package/dist/chunk-WMW4AXVG.js +0 -570
  814. package/dist/chunk-WRMMZYZC.js +0 -931
  815. package/dist/chunk-WYICOILE.js +0 -50
  816. package/dist/chunk-WYNXSYTH.js +0 -532
  817. package/dist/chunk-X62OJCQW.js +0 -234
  818. package/dist/chunk-XBFNNP6B.js +0 -608
  819. package/dist/chunk-XDXPGA3N.js +0 -850
  820. package/dist/chunk-XDXPGA3N.js.map +0 -1
  821. package/dist/chunk-XFP3AIZO.js +0 -247
  822. package/dist/chunk-XSL5GKL3.js +0 -110
  823. package/dist/chunk-XVXYLCSC.js +0 -82
  824. package/dist/chunk-XX2J7H2J.js +0 -196
  825. package/dist/chunk-Y6CNWBV3.js +0 -264
  826. package/dist/chunk-YEFIICAN.js +0 -46
  827. package/dist/chunk-YJBRNXFL.js +0 -1184
  828. package/dist/chunk-YP4SNX4P.js +0 -220
  829. package/dist/chunk-YQ6AYWGT.js +0 -162
  830. package/dist/chunk-YWKJSF3R.js +0 -396
  831. package/dist/chunk-Z3EQ3XBB.js +0 -114
  832. package/dist/chunk-ZD67RM6G.js +0 -60
  833. package/dist/chunk-ZMCVED5L.js +0 -1185
  834. package/dist/chunk-ZOTNM76R.js +0 -42
  835. package/dist/chunk-ZP7BJXQ5.js +0 -113
  836. package/dist/chunk-ZRNDPAED.js +0 -274
  837. package/dist/chunk-ZUQKQP3T.js +0 -251
  838. package/dist/chunk-ZVT2KQTH.js +0 -48
  839. package/dist/chunk-ZXDIEGD5.js +0 -1019
  840. package/dist/computer-viewer-KLRAA56S.js +0 -21
  841. package/dist/connection-step-up-PWIIW3KK.js +0 -145
  842. package/dist/embedded-new-voice-P2RCFI3X.js +0 -25
  843. package/dist/embedded-voice-HY5F4D2I.js +0 -25
  844. package/dist/fleet-decision-row-UEXT7NAN.js +0 -361
  845. package/dist/model-policy-picker-menu-AAGNLTEG.js +0 -23
  846. package/dist/payment-page-card-MHTYJHCW.js +0 -226
  847. package/dist/platform-activity-row-7VAPGRZQ.js +0 -156
  848. package/dist/queue-surface-implementation-AE5P3PSA.js +0 -932
  849. package/dist/recorder-host-I53BQIRX.js +0 -80
  850. package/dist/sandbox-files-LGE7EDX2.js +0 -28
  851. package/dist/session-connect-cards-QNL7WRKJ.js +0 -27
  852. package/dist/session-realtime-ZMXMK5EV.js +0 -30
  853. package/dist/timeline-annotation-markers-5RICTVVW.js +0 -157
  854. package/dist/timeline-annotation-selection-ITAHBOFW.js +0 -208
  855. package/dist/timeline-annotations-dialog-7PGBTPVD.js +0 -283
  856. /package/dist/{browser-viewer-5DCULGWS.js.map → browser-viewer-EIEMRVFF.js.map} +0 -0
  857. /package/dist/{chat-interactive-block-ISMUKH3P.js.map → chat-interactive-block-FV37LWYZ.js.map} +0 -0
  858. /package/dist/{chunk-3AXHBU7K.js.map → chunk-2COBAJC7.js.map} +0 -0
  859. /package/dist/{chunk-UILJ5INQ.js.map → chunk-2HS3IUXE.js.map} +0 -0
  860. /package/dist/{chunk-W7BNYXRT.js.map → chunk-2JTMFYCT.js.map} +0 -0
  861. /package/dist/{chunk-V2YSF3MJ.js.map → chunk-2JXKP4M6.js.map} +0 -0
  862. /package/dist/{chunk-OE6XABJ3.js.map → chunk-2P5K7CBH.js.map} +0 -0
  863. /package/dist/{chunk-T3OUZVHU.js.map → chunk-2XGRHMRI.js.map} +0 -0
  864. /package/dist/{chunk-QR74WLXN.js.map → chunk-332BYSAZ.js.map} +0 -0
  865. /package/dist/{chunk-UYLO2JP2.js.map → chunk-3EM5GTP3.js.map} +0 -0
  866. /package/dist/{chunk-73P7NEOX.js.map → chunk-3L5ATO4A.js.map} +0 -0
  867. /package/dist/{chunk-RIOTQESW.js.map → chunk-3S3PJB7J.js.map} +0 -0
  868. /package/dist/{chunk-HYVRYGY3.js.map → chunk-3SBKYPNM.js.map} +0 -0
  869. /package/dist/{chunk-6QDXVH45.js.map → chunk-3Z7VA6ET.js.map} +0 -0
  870. /package/dist/{chunk-CBHZXVSI.js.map → chunk-43BRJBEV.js.map} +0 -0
  871. /package/dist/{chunk-LG3WCCUT.js.map → chunk-46LZO4ZO.js.map} +0 -0
  872. /package/dist/{chunk-UPRN4FBY.js.map → chunk-46ZC5VNC.js.map} +0 -0
  873. /package/dist/{chunk-4ZCTHNOA.js.map → chunk-4AH4EEHE.js.map} +0 -0
  874. /package/dist/{chunk-3B4D4BV7.js.map → chunk-4D3YJNVN.js.map} +0 -0
  875. /package/dist/{chunk-HE5BTYPR.js.map → chunk-4I4RTI4D.js.map} +0 -0
  876. /package/dist/{chunk-4YXA5UO3.js.map → chunk-4KASGJTF.js.map} +0 -0
  877. /package/dist/{chunk-HWDKTGNX.js.map → chunk-4RUKLIOF.js.map} +0 -0
  878. /package/dist/{chunk-MFYH4N6I.js.map → chunk-4UU7FN3I.js.map} +0 -0
  879. /package/dist/{chunk-DDCDQ4BF.js.map → chunk-4ZRNASBF.js.map} +0 -0
  880. /package/dist/{chunk-BOCDCQYX.js.map → chunk-5EJBPQI2.js.map} +0 -0
  881. /package/dist/{chunk-RPJC2JCE.js.map → chunk-5G4IGG7F.js.map} +0 -0
  882. /package/dist/{chunk-AZC5P5PV.js.map → chunk-5JAYZOAW.js.map} +0 -0
  883. /package/dist/{chunk-T4YOQ6DF.js.map → chunk-5JOKVDSR.js.map} +0 -0
  884. /package/dist/{chunk-ODR2Q4JQ.js.map → chunk-5MP3G7ZV.js.map} +0 -0
  885. /package/dist/{chunk-ZOTNM76R.js.map → chunk-5OVRMKP5.js.map} +0 -0
  886. /package/dist/{chunk-YJBRNXFL.js.map → chunk-5SGTRULO.js.map} +0 -0
  887. /package/dist/{chunk-RYWPD5WU.js.map → chunk-5SOL4INY.js.map} +0 -0
  888. /package/dist/{chunk-SB3LGY34.js.map → chunk-5Y34P32B.js.map} +0 -0
  889. /package/dist/{chunk-LTNBDO5B.js.map → chunk-62HIKJ5F.js.map} +0 -0
  890. /package/dist/{chunk-HWOYJOKK.js.map → chunk-62T2ZPD5.js.map} +0 -0
  891. /package/dist/{chunk-NSLCRIQ6.js.map → chunk-63VNZRLY.js.map} +0 -0
  892. /package/dist/{chunk-PMBZMVKE.js.map → chunk-6CDBX3XG.js.map} +0 -0
  893. /package/dist/{chunk-R6CFPY3F.js.map → chunk-6D3D2JWY.js.map} +0 -0
  894. /package/dist/{chunk-4DW5QEAP.js.map → chunk-6DOIINY4.js.map} +0 -0
  895. /package/dist/{chunk-E4SAFP76.js.map → chunk-6DQBUKGJ.js.map} +0 -0
  896. /package/dist/{chunk-OX234K6A.js.map → chunk-6SETNFNH.js.map} +0 -0
  897. /package/dist/{chunk-HXVKXFIC.js.map → chunk-6XYFMHNT.js.map} +0 -0
  898. /package/dist/{chunk-SG4FA5CX.js.map → chunk-6YU3WV2P.js.map} +0 -0
  899. /package/dist/{chunk-KKIJYI7N.js.map → chunk-6YUHDFOZ.js.map} +0 -0
  900. /package/dist/{chunk-ZMCVED5L.js.map → chunk-72EOXOR7.js.map} +0 -0
  901. /package/dist/{chunk-WYNXSYTH.js.map → chunk-72ND4ALI.js.map} +0 -0
  902. /package/dist/{chunk-DUZZB4C6.js.map → chunk-757LE32E.js.map} +0 -0
  903. /package/dist/{chunk-VLODMRE3.js.map → chunk-7S2S4MXR.js.map} +0 -0
  904. /package/dist/{chunk-PTLRNXWE.js.map → chunk-7SYCHMXS.js.map} +0 -0
  905. /package/dist/{chunk-BXKNGFX5.js.map → chunk-7TVAPQOV.js.map} +0 -0
  906. /package/dist/{chunk-EVHNQCEM.js.map → chunk-7UDLRDHK.js.map} +0 -0
  907. /package/dist/{chunk-HLNSIXSJ.js.map → chunk-7YLQCMZP.js.map} +0 -0
  908. /package/dist/{chunk-GGIPEZLL.js.map → chunk-A5GX3CAE.js.map} +0 -0
  909. /package/dist/{chunk-SUO5NPEX.js.map → chunk-A7EBV2EB.js.map} +0 -0
  910. /package/dist/{chunk-Z3EQ3XBB.js.map → chunk-AB5SPXUR.js.map} +0 -0
  911. /package/dist/{chunk-PJF47YJJ.js.map → chunk-AHVQGL5A.js.map} +0 -0
  912. /package/dist/{chunk-3Y2VSFYS.js.map → chunk-AI77ZKEV.js.map} +0 -0
  913. /package/dist/{chunk-ZXDIEGD5.js.map → chunk-AIX2D6RB.js.map} +0 -0
  914. /package/dist/{chunk-KDZ7WKYY.js.map → chunk-AVSIHP7Q.js.map} +0 -0
  915. /package/dist/{chunk-37J33BLN.js.map → chunk-AWK23Q32.js.map} +0 -0
  916. /package/dist/{chunk-G7TU7QDO.js.map → chunk-AYVWA6KD.js.map} +0 -0
  917. /package/dist/{chunk-SOZTO34S.js.map → chunk-AYZXE4IM.js.map} +0 -0
  918. /package/dist/{chunk-OMYNOB7U.js.map → chunk-AZGGSPTE.js.map} +0 -0
  919. /package/dist/{chunk-WRMMZYZC.js.map → chunk-B45TB4HY.js.map} +0 -0
  920. /package/dist/{chunk-YEFIICAN.js.map → chunk-BIUJHNVR.js.map} +0 -0
  921. /package/dist/{chunk-NYTKZQ2V.js.map → chunk-BJUOKUE5.js.map} +0 -0
  922. /package/dist/{chunk-J3GK2LZP.js.map → chunk-BPEEVMKH.js.map} +0 -0
  923. /package/dist/{chunk-PQ7WJAKL.js.map → chunk-BPHPAGYF.js.map} +0 -0
  924. /package/dist/{chunk-MTOWY5MX.js.map → chunk-BXMND6YU.js.map} +0 -0
  925. /package/dist/{chunk-VRVB2XSO.js.map → chunk-C6OM2SRG.js.map} +0 -0
  926. /package/dist/{chunk-R7QHNWYL.js.map → chunk-CIRCUDKF.js.map} +0 -0
  927. /package/dist/{chunk-3EQMXU5V.js.map → chunk-CLKR4UG3.js.map} +0 -0
  928. /package/dist/{chunk-OZGG6TS7.js.map → chunk-CPX6BHER.js.map} +0 -0
  929. /package/dist/{chunk-KZQDP2JM.js.map → chunk-CVC4RO7D.js.map} +0 -0
  930. /package/dist/{chunk-NKCK4LBK.js.map → chunk-D3YJAQGK.js.map} +0 -0
  931. /package/dist/{chunk-WEXKKIPB.js.map → chunk-DFQ72BLS.js.map} +0 -0
  932. /package/dist/{chunk-DRPIGAMM.js.map → chunk-DG65PJOZ.js.map} +0 -0
  933. /package/dist/{chunk-GMQFRX2V.js.map → chunk-DNAXAS5R.js.map} +0 -0
  934. /package/dist/{chunk-CNLR3MVZ.js.map → chunk-DO247ITS.js.map} +0 -0
  935. /package/dist/{chunk-IGVRNMXK.js.map → chunk-DONBARLL.js.map} +0 -0
  936. /package/dist/{chunk-IQKLWMIF.js.map → chunk-DTLXQ3ZU.js.map} +0 -0
  937. /package/dist/{chunk-ZRNDPAED.js.map → chunk-EAXTACI4.js.map} +0 -0
  938. /package/dist/{chunk-5G55HNJB.js.map → chunk-EDPH7AJH.js.map} +0 -0
  939. /package/dist/{chunk-BKYHS4IH.js.map → chunk-EFKQHCGJ.js.map} +0 -0
  940. /package/dist/{chunk-22NKV5QE.js.map → chunk-EILSPMVD.js.map} +0 -0
  941. /package/dist/{chunk-PNLVWZSM.js.map → chunk-EK7KIETS.js.map} +0 -0
  942. /package/dist/{chunk-IIUBCLH6.js.map → chunk-EMWT6GOK.js.map} +0 -0
  943. /package/dist/{chunk-TZGJPDZL.js.map → chunk-EO22NST7.js.map} +0 -0
  944. /package/dist/{chunk-DNNW2FSP.js.map → chunk-ER5MYLIE.js.map} +0 -0
  945. /package/dist/{chunk-2XQFDRP6.js.map → chunk-ES5HKVQF.js.map} +0 -0
  946. /package/dist/{chunk-QHPB7VSA.js.map → chunk-F26YBYAZ.js.map} +0 -0
  947. /package/dist/{chunk-3YLXGP2I.js.map → chunk-F6QP4GSK.js.map} +0 -0
  948. /package/dist/{chunk-NRRRO3NJ.js.map → chunk-F7QEO7M2.js.map} +0 -0
  949. /package/dist/{chunk-6TBA45QF.js.map → chunk-FJFGDLXB.js.map} +0 -0
  950. /package/dist/{chunk-LUUFLV27.js.map → chunk-FLLJ2WXW.js.map} +0 -0
  951. /package/dist/{chunk-KMZUIWL6.js.map → chunk-FMBJKMT4.js.map} +0 -0
  952. /package/dist/{chunk-7QORJTVI.js.map → chunk-FPN4I4CG.js.map} +0 -0
  953. /package/dist/{chunk-RCKXQ2RY.js.map → chunk-FUXFJTXL.js.map} +0 -0
  954. /package/dist/{chunk-5AHIKB3O.js.map → chunk-FXFOKD7A.js.map} +0 -0
  955. /package/dist/{chunk-PHNLFMBS.js.map → chunk-G6SSSX5R.js.map} +0 -0
  956. /package/dist/{chunk-XBFNNP6B.js.map → chunk-GBGCMHBB.js.map} +0 -0
  957. /package/dist/{chunk-HUKGLWAY.js.map → chunk-GIHE7U3Y.js.map} +0 -0
  958. /package/dist/{chunk-RDTZN6HR.js.map → chunk-GJ4GTYOD.js.map} +0 -0
  959. /package/dist/{chunk-BPD6VRVH.js.map → chunk-GLSDWNFV.js.map} +0 -0
  960. /package/dist/{chunk-DWW2MA3S.js.map → chunk-GMGAW3T6.js.map} +0 -0
  961. /package/dist/{chunk-RET43Z3F.js.map → chunk-GNGI6XFN.js.map} +0 -0
  962. /package/dist/{chunk-Y6CNWBV3.js.map → chunk-GO5VIAA7.js.map} +0 -0
  963. /package/dist/{chunk-BOP5TAUU.js.map → chunk-GSW4YHZE.js.map} +0 -0
  964. /package/dist/{chunk-644P2VLV.js.map → chunk-GUC6IWEY.js.map} +0 -0
  965. /package/dist/{chunk-4AUUNEQY.js.map → chunk-GWAY3SO5.js.map} +0 -0
  966. /package/dist/{chunk-4TTWUMDP.js.map → chunk-GXOTNT5D.js.map} +0 -0
  967. /package/dist/{chunk-OEGJWY2U.js.map → chunk-GZZCVF76.js.map} +0 -0
  968. /package/dist/{chunk-KUYTRUIE.js.map → chunk-H4VMHFOX.js.map} +0 -0
  969. /package/dist/{chunk-XSL5GKL3.js.map → chunk-HA5RFQAF.js.map} +0 -0
  970. /package/dist/{chunk-PTSRBKQC.js.map → chunk-HFROJDFQ.js.map} +0 -0
  971. /package/dist/{chunk-YP4SNX4P.js.map → chunk-HHFFPE67.js.map} +0 -0
  972. /package/dist/{chunk-RWZ5XML5.js.map → chunk-HJLHGXWL.js.map} +0 -0
  973. /package/dist/{chunk-RULIWGQ6.js.map → chunk-HKNMNL7B.js.map} +0 -0
  974. /package/dist/{chunk-AO27D7GY.js.map → chunk-HT7MBHLY.js.map} +0 -0
  975. /package/dist/{chunk-NPKFHO6N.js.map → chunk-I5FSUZVW.js.map} +0 -0
  976. /package/dist/{chunk-AXBSHKRP.js.map → chunk-IINQO425.js.map} +0 -0
  977. /package/dist/{chunk-MD27CX2K.js.map → chunk-IIXNEOK4.js.map} +0 -0
  978. /package/dist/{chunk-UQBYKWGG.js.map → chunk-IM3WA5AL.js.map} +0 -0
  979. /package/dist/{chunk-BJNSS4UV.js.map → chunk-IX4P4OGR.js.map} +0 -0
  980. /package/dist/{chunk-SMCHRNUL.js.map → chunk-IX5VHZYS.js.map} +0 -0
  981. /package/dist/{chunk-BSAKPNKY.js.map → chunk-JB3TSUZO.js.map} +0 -0
  982. /package/dist/{chunk-I5ZTAMDP.js.map → chunk-JIC6RLUB.js.map} +0 -0
  983. /package/dist/{chunk-KGTZGR4F.js.map → chunk-JNJIZCTN.js.map} +0 -0
  984. /package/dist/{chunk-7CLQ7RQV.js.map → chunk-JNV5ZPUV.js.map} +0 -0
  985. /package/dist/{chunk-OAEI3MUO.js.map → chunk-JPQFVR24.js.map} +0 -0
  986. /package/dist/{chunk-NNE73MK2.js.map → chunk-JPZVMXDP.js.map} +0 -0
  987. /package/dist/{chunk-3SKJO525.js.map → chunk-JVPF34MX.js.map} +0 -0
  988. /package/dist/{chunk-E4NQIEA3.js.map → chunk-KED67KAF.js.map} +0 -0
  989. /package/dist/{chunk-4T2KWNYX.js.map → chunk-KJ72GMZ2.js.map} +0 -0
  990. /package/dist/{chunk-PCSRHFRF.js.map → chunk-KTGKGHEA.js.map} +0 -0
  991. /package/dist/{chunk-NUZNJSL5.js.map → chunk-KU77XHWB.js.map} +0 -0
  992. /package/dist/{chunk-EO7NZKIX.js.map → chunk-KXBLLFOO.js.map} +0 -0
  993. /package/dist/{chunk-VLDKWGHD.js.map → chunk-L6WVCO6D.js.map} +0 -0
  994. /package/dist/{chunk-QJQTLBT3.js.map → chunk-LPEFULJY.js.map} +0 -0
  995. /package/dist/{chunk-52BUMJQB.js.map → chunk-LRMGPO7E.js.map} +0 -0
  996. /package/dist/{chunk-N4AHWDN2.js.map → chunk-LVKTKORH.js.map} +0 -0
  997. /package/dist/{chunk-TGG3ODCS.js.map → chunk-MCPKUVMQ.js.map} +0 -0
  998. /package/dist/{chunk-KYDLVMKA.js.map → chunk-MFLU3466.js.map} +0 -0
  999. /package/dist/{chunk-ZD67RM6G.js.map → chunk-MIUJ3EH5.js.map} +0 -0
  1000. /package/dist/{chunk-KLOB3IXX.js.map → chunk-MIUMNTIJ.js.map} +0 -0
  1001. /package/dist/{chunk-ZP7BJXQ5.js.map → chunk-ML46TXRM.js.map} +0 -0
  1002. /package/dist/{chunk-M5FX5KH5.js.map → chunk-MO3XJQN2.js.map} +0 -0
  1003. /package/dist/{chunk-UQR5RZ5I.js.map → chunk-MQRHTOQ2.js.map} +0 -0
  1004. /package/dist/{chunk-5ERDSF2C.js.map → chunk-MVYQDBE6.js.map} +0 -0
  1005. /package/dist/{chunk-XX2J7H2J.js.map → chunk-NPBEUU22.js.map} +0 -0
  1006. /package/dist/{chunk-PGDGX6PO.js.map → chunk-NSXKGS2K.js.map} +0 -0
  1007. /package/dist/{chunk-TLR2SX7T.js.map → chunk-NUEFORM6.js.map} +0 -0
  1008. /package/dist/{chunk-LSQP22UI.js.map → chunk-NZOFNQNC.js.map} +0 -0
  1009. /package/dist/{chunk-RCN3SVJC.js.map → chunk-OATXCLTY.js.map} +0 -0
  1010. /package/dist/{chunk-53ZK2JFE.js.map → chunk-OG3ELROW.js.map} +0 -0
  1011. /package/dist/{chunk-YQ6AYWGT.js.map → chunk-OI4WS7FW.js.map} +0 -0
  1012. /package/dist/{chunk-XVXYLCSC.js.map → chunk-OITGZUDC.js.map} +0 -0
  1013. /package/dist/{chunk-T2NC7ALH.js.map → chunk-OKD2LBMK.js.map} +0 -0
  1014. /package/dist/{chunk-PX64T6XV.js.map → chunk-OSA4CGST.js.map} +0 -0
  1015. /package/dist/{chunk-WG7OVUCV.js.map → chunk-OXYAKUFU.js.map} +0 -0
  1016. /package/dist/{chunk-YWKJSF3R.js.map → chunk-OYMSMU5O.js.map} +0 -0
  1017. /package/dist/{chunk-OHJXHKQT.js.map → chunk-P4NZ72KY.js.map} +0 -0
  1018. /package/dist/{chunk-4D4XXJJJ.js.map → chunk-PBYL2VIM.js.map} +0 -0
  1019. /package/dist/{chunk-7M57K6K5.js.map → chunk-PDW3OOSZ.js.map} +0 -0
  1020. /package/dist/{chunk-QZSIADFZ.js.map → chunk-PGRKTQIW.js.map} +0 -0
  1021. /package/dist/{chunk-4PG2BEQA.js.map → chunk-PPQJIVGM.js.map} +0 -0
  1022. /package/dist/{chunk-UFRXYZCJ.js.map → chunk-PYMQM65Y.js.map} +0 -0
  1023. /package/dist/{chunk-G65TM5FL.js.map → chunk-Q273Q33U.js.map} +0 -0
  1024. /package/dist/{chunk-62AHHCFV.js.map → chunk-Q4CLS2HL.js.map} +0 -0
  1025. /package/dist/{chunk-PGMXITPB.js.map → chunk-QA5UNVHD.js.map} +0 -0
  1026. /package/dist/{chunk-SP7XRRGB.js.map → chunk-QFOBUA2J.js.map} +0 -0
  1027. /package/dist/{chunk-LRE7WH6D.js.map → chunk-QLIM4D56.js.map} +0 -0
  1028. /package/dist/{chunk-HWOJ7JSO.js.map → chunk-QMQF5U2D.js.map} +0 -0
  1029. /package/dist/{chunk-J4OOKDRV.js.map → chunk-QNOWKKZ4.js.map} +0 -0
  1030. /package/dist/{chunk-ATQ3O5E6.js.map → chunk-QPOUPVPD.js.map} +0 -0
  1031. /package/dist/{chunk-ZVT2KQTH.js.map → chunk-QTJAQ6DS.js.map} +0 -0
  1032. /package/dist/{chunk-WDDAHRBC.js.map → chunk-QUOFP3G7.js.map} +0 -0
  1033. /package/dist/{chunk-R2T4IUNB.js.map → chunk-QVOTPOXK.js.map} +0 -0
  1034. /package/dist/{chunk-SMSEI6VH.js.map → chunk-QYZ5RVGM.js.map} +0 -0
  1035. /package/dist/{chunk-CGWLKFQF.js.map → chunk-R7CVDKRN.js.map} +0 -0
  1036. /package/dist/{chunk-MPW67ODY.js.map → chunk-RB7MXNZD.js.map} +0 -0
  1037. /package/dist/{chunk-EVRLHFIG.js.map → chunk-RDZQFZOQ.js.map} +0 -0
  1038. /package/dist/{chunk-JY4ACIKP.js.map → chunk-RIHKEGWS.js.map} +0 -0
  1039. /package/dist/{chunk-UWPSCSIZ.js.map → chunk-ROSB7GF6.js.map} +0 -0
  1040. /package/dist/{chunk-2O5EDTVB.js.map → chunk-RP3YMYCX.js.map} +0 -0
  1041. /package/dist/{chunk-U7KNZEMU.js.map → chunk-RPHXJHNX.js.map} +0 -0
  1042. /package/dist/{chunk-IQWAFZGW.js.map → chunk-RVC3M66H.js.map} +0 -0
  1043. /package/dist/{chunk-VAJQQKSG.js.map → chunk-S3OTJAAC.js.map} +0 -0
  1044. /package/dist/{chunk-DWH35C5X.js.map → chunk-SBWPMVRN.js.map} +0 -0
  1045. /package/dist/{chunk-PYS63BC6.js.map → chunk-SERECSAR.js.map} +0 -0
  1046. /package/dist/{chunk-L22AVXXW.js.map → chunk-SHSEF3GJ.js.map} +0 -0
  1047. /package/dist/{chunk-UDDZDC2Q.js.map → chunk-SMS2M3RG.js.map} +0 -0
  1048. /package/dist/{chunk-SNACGK3Z.js.map → chunk-SRDHDIRQ.js.map} +0 -0
  1049. /package/dist/{chunk-VM6BM3NV.js.map → chunk-SXRYA7NN.js.map} +0 -0
  1050. /package/dist/{chunk-WCA777NS.js.map → chunk-SYA3WYG4.js.map} +0 -0
  1051. /package/dist/{chunk-HUTQJY3F.js.map → chunk-SYYFA7W7.js.map} +0 -0
  1052. /package/dist/{chunk-5ABIZ7YT.js.map → chunk-T2QDSTBH.js.map} +0 -0
  1053. /package/dist/{chunk-ZUQKQP3T.js.map → chunk-TFSCGFYV.js.map} +0 -0
  1054. /package/dist/{chunk-CGEAOUXW.js.map → chunk-TGCKZOSX.js.map} +0 -0
  1055. /package/dist/{chunk-4WKITG7P.js.map → chunk-THILLYQM.js.map} +0 -0
  1056. /package/dist/{chunk-34XY4PWB.js.map → chunk-TI6LGUEZ.js.map} +0 -0
  1057. /package/dist/{chunk-MRNOTVGF.js.map → chunk-TSY6YZL2.js.map} +0 -0
  1058. /package/dist/{chunk-3Y7IJPHB.js.map → chunk-TW2RHTLH.js.map} +0 -0
  1059. /package/dist/{chunk-FWRKCWQO.js.map → chunk-TWA5G277.js.map} +0 -0
  1060. /package/dist/{chunk-XFP3AIZO.js.map → chunk-TZZ2S4XI.js.map} +0 -0
  1061. /package/dist/{chunk-VDHWFRTL.js.map → chunk-U5D3K53R.js.map} +0 -0
  1062. /package/dist/{chunk-5DEP55DK.js.map → chunk-UECD27LX.js.map} +0 -0
  1063. /package/dist/{chunk-ABO54U65.js.map → chunk-UFJDETKG.js.map} +0 -0
  1064. /package/dist/{chunk-WMW4AXVG.js.map → chunk-UHCFYX4I.js.map} +0 -0
  1065. /package/dist/{chunk-REUQ464X.js.map → chunk-UHTURYJO.js.map} +0 -0
  1066. /package/dist/{chunk-FAVXYNTK.js.map → chunk-UJH63JT3.js.map} +0 -0
  1067. /package/dist/{chunk-OYJ7KP6H.js.map → chunk-UOLDS6S5.js.map} +0 -0
  1068. /package/dist/{chunk-EQSANTUC.js.map → chunk-UUE3OGXI.js.map} +0 -0
  1069. /package/dist/{chunk-OJE3WTHK.js.map → chunk-UUNJ2E57.js.map} +0 -0
  1070. /package/dist/{chunk-MEUAI3B7.js.map → chunk-UYQVWRAH.js.map} +0 -0
  1071. /package/dist/{chunk-X62OJCQW.js.map → chunk-UYWVK7JQ.js.map} +0 -0
  1072. /package/dist/{chunk-M2KDPKQC.js.map → chunk-UYWWUEL4.js.map} +0 -0
  1073. /package/dist/{chunk-NABGUV6O.js.map → chunk-V4CQKX5H.js.map} +0 -0
  1074. /package/dist/{chunk-ODWNT3XC.js.map → chunk-V4QM7GDQ.js.map} +0 -0
  1075. /package/dist/{chunk-FRDJUZ6E.js.map → chunk-V5Y74WII.js.map} +0 -0
  1076. /package/dist/{chunk-RYYBQ4PW.js.map → chunk-VGGZLUQK.js.map} +0 -0
  1077. /package/dist/{chunk-L5AQCKRR.js.map → chunk-VGX636MB.js.map} +0 -0
  1078. /package/dist/{chunk-P5DGNIGZ.js.map → chunk-VGZLFQO2.js.map} +0 -0
  1079. /package/dist/{chunk-HWDHA4KS.js.map → chunk-VJWZATNF.js.map} +0 -0
  1080. /package/dist/{chunk-WYICOILE.js.map → chunk-VMWCIC2N.js.map} +0 -0
  1081. /package/dist/{chunk-3QUDVXDR.js.map → chunk-VPWKTIU5.js.map} +0 -0
  1082. /package/dist/{chunk-UFIETNB2.js.map → chunk-VXOLG6YB.js.map} +0 -0
  1083. /package/dist/{chunk-NH6OLIQD.js.map → chunk-W2NAU5VB.js.map} +0 -0
  1084. /package/dist/{chunk-OJNZTTQE.js.map → chunk-WGORKMR3.js.map} +0 -0
  1085. /package/dist/{chunk-DK5L6E4G.js.map → chunk-WMIDELSJ.js.map} +0 -0
  1086. /package/dist/{chunk-STA75WRF.js.map → chunk-WSOSGL2G.js.map} +0 -0
  1087. /package/dist/{chunk-2R7AOT3Y.js.map → chunk-WXUUOM4X.js.map} +0 -0
  1088. /package/dist/{chunk-UMYCZQSL.js.map → chunk-X2OWM2ME.js.map} +0 -0
  1089. /package/dist/{chunk-B6YDINPE.js.map → chunk-X6UMGG4T.js.map} +0 -0
  1090. /package/dist/{chunk-CPN7JXYV.js.map → chunk-XDXKB25W.js.map} +0 -0
  1091. /package/dist/{chunk-W2PBDF4F.js.map → chunk-XE4PHI74.js.map} +0 -0
  1092. /package/dist/{chunk-R6WQLIFX.js.map → chunk-XHF2XNU5.js.map} +0 -0
  1093. /package/dist/{chunk-IHNCZONS.js.map → chunk-XLJ4SQFS.js.map} +0 -0
  1094. /package/dist/{chunk-UKDLZ76A.js.map → chunk-XOD4FX6M.js.map} +0 -0
  1095. /package/dist/{chunk-OCWCZRVU.js.map → chunk-XODQ2GPF.js.map} +0 -0
  1096. /package/dist/{chunk-MVLHO6AU.js.map → chunk-XT54RTAM.js.map} +0 -0
  1097. /package/dist/{chunk-R6OBJ7LF.js.map → chunk-YAVW5OJ5.js.map} +0 -0
  1098. /package/dist/{chunk-4SW3EUNM.js.map → chunk-YDQHFJM2.js.map} +0 -0
  1099. /package/dist/{chunk-HI6TPRY5.js.map → chunk-YH6O6OQ6.js.map} +0 -0
  1100. /package/dist/{chunk-25SCFA2X.js.map → chunk-YIKPC2QP.js.map} +0 -0
  1101. /package/dist/{chunk-4KF5I3H5.js.map → chunk-ZD7PKYC4.js.map} +0 -0
  1102. /package/dist/{chunk-ANCI6T7S.js.map → chunk-ZEQYHEWP.js.map} +0 -0
  1103. /package/dist/{chunk-GKA5LFYR.js.map → chunk-ZP3QCPYG.js.map} +0 -0
  1104. /package/dist/{chunk-6Y3EFN4Q.js.map → chunk-ZRVUCTSI.js.map} +0 -0
  1105. /package/dist/{chunk-UJ4DLPYG.js.map → chunk-ZSI3ITRK.js.map} +0 -0
  1106. /package/dist/{chunk-S44ADSZG.js.map → chunk-ZZMEQCIZ.js.map} +0 -0
  1107. /package/dist/{computer-viewer-KLRAA56S.js.map → computer-viewer-ZBY3BPYW.js.map} +0 -0
  1108. /package/dist/{connection-step-up-PWIIW3KK.js.map → connection-step-up-JQ4OFSQN.js.map} +0 -0
  1109. /package/dist/{embedded-new-voice-P2RCFI3X.js.map → embedded-new-voice-ZB5XLKLU.js.map} +0 -0
  1110. /package/dist/{embedded-voice-HY5F4D2I.js.map → embedded-voice-MZJISDCS.js.map} +0 -0
  1111. /package/dist/{fleet-decision-row-UEXT7NAN.js.map → fleet-decision-row-LG3SYVR3.js.map} +0 -0
  1112. /package/dist/{model-policy-picker-menu-AAGNLTEG.js.map → model-policy-picker-menu-5Y72PLNF.js.map} +0 -0
  1113. /package/dist/{payment-page-card-MHTYJHCW.js.map → payment-page-card-YPSXRHBA.js.map} +0 -0
  1114. /package/dist/{platform-activity-row-7VAPGRZQ.js.map → platform-activity-row-ZU4MEBNK.js.map} +0 -0
  1115. /package/dist/{queue-surface-implementation-AE5P3PSA.js.map → queue-surface-implementation-6Q25RPH6.js.map} +0 -0
  1116. /package/dist/{recorder-host-I53BQIRX.js.map → recorder-host-JD4GWJ2Z.js.map} +0 -0
  1117. /package/dist/{sandbox-files-LGE7EDX2.js.map → sandbox-files-HCLEEJMU.js.map} +0 -0
  1118. /package/dist/{session-connect-cards-QNL7WRKJ.js.map → session-connect-cards-DRKEN3Z4.js.map} +0 -0
  1119. /package/dist/{session-realtime-ZMXMK5EV.js.map → session-realtime-IZOTTRH6.js.map} +0 -0
  1120. /package/dist/{timeline-annotation-markers-5RICTVVW.js.map → timeline-annotation-markers-WWXNJOXI.js.map} +0 -0
  1121. /package/dist/{timeline-annotation-selection-ITAHBOFW.js.map → timeline-annotation-selection-ZKRIQFIQ.js.map} +0 -0
  1122. /package/dist/{timeline-annotations-dialog-7PGBTPVD.js.map → timeline-annotations-dialog-4IMKTOXJ.js.map} +0 -0
@@ -0,0 +1,3070 @@
1
+ "use client";
2
+ import {
3
+ useSandboxFiles
4
+ } from "./chunk-V4QM7GDQ.js";
5
+ import {
6
+ WorkspaceDock
7
+ } from "./chunk-5SGTRULO.js";
8
+ import {
9
+ WorkbenchChanges,
10
+ WorkbenchChangesViewMenu,
11
+ useMachineChip
12
+ } from "./chunk-4RUKLIOF.js";
13
+ import {
14
+ SessionStatus
15
+ } from "./chunk-7S2S4MXR.js";
16
+ import {
17
+ PierreDiff
18
+ } from "./chunk-MQRHTOQ2.js";
19
+ import {
20
+ SandboxTerminal,
21
+ terminalCanAcquirePty,
22
+ xtermThemeFromTokens
23
+ } from "./chunk-72EOXOR7.js";
24
+ import {
25
+ sandboxAcceptsLiveIo
26
+ } from "./chunk-QV3DJVRZ.js";
27
+ import {
28
+ SessionMcpCapabilityCard
29
+ } from "./chunk-XT54RTAM.js";
30
+ import {
31
+ useTurnlessOutputGap
32
+ } from "./chunk-4E5QVAT4.js";
33
+ import {
34
+ invalidateSharedQueries,
35
+ useSharedQuery
36
+ } from "./chunk-DSQNSLQW.js";
37
+ import {
38
+ sessionAdmissionBlocked,
39
+ sessionDisplayStatus
40
+ } from "./chunk-DG5DQFS4.js";
41
+ import {
42
+ MACHINES_SESSION_POLL_MS,
43
+ useMachines
44
+ } from "./chunk-UUNJ2E57.js";
45
+ import {
46
+ useMutationRunner,
47
+ usePageLiveActivity,
48
+ usePolledValue
49
+ } from "./chunk-SW4S6I5E.js";
50
+ import {
51
+ normalizeError
52
+ } from "./chunk-CM7LVUKC.js";
53
+ import {
54
+ cn
55
+ } from "./chunk-TXS65BB2.js";
56
+ import {
57
+ useOpenGeni,
58
+ useOpenGeniClient
59
+ } from "./chunk-BVUAHAQX.js";
60
+ import {
61
+ useOpenGeniText
62
+ } from "./chunk-KVPQUADA.js";
63
+ import {
64
+ formatRelativeTime
65
+ } from "./chunk-UIK52VL4.js";
66
+
67
+ // src/session-auth-recommendation.ts
68
+ function sessionAuthRecommendation(t, item, catalog) {
69
+ if (item.authoritySource === "host" || item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable" || item.reason === "account_scope_fixed")
70
+ return void 0;
71
+ if (item.capability) return item;
72
+ if (item.reason === "insufficient_scope" && item.connectionId) return void 0;
73
+ const recoveryServerId = item.canonicalServerId ?? item.serverId;
74
+ const matches = catalog.filter(
75
+ (candidate) => recoveryServerId !== null && candidate.runtime.mcpServerId === recoveryServerId && recoveryServerId !== "opengeni" || item.connectionId !== null && candidate.connectionRef?.connectionId === item.connectionId
76
+ );
77
+ if (matches.length !== 1) return void 0;
78
+ const entry = matches[0];
79
+ const personalAccess = item.reason === "personal_authority_unavailable";
80
+ if (personalAccess && ((item.connectionSubjectScope ?? entry.connectionRef?.subjectScope) !== "subject" || entry.connectionRef?.authoritySource === "host"))
81
+ return void 0;
82
+ return {
83
+ ...item,
84
+ capability: {
85
+ id: entry.id,
86
+ name: entry.name,
87
+ kind: entry.kind,
88
+ source: entry.source,
89
+ action: "connect",
90
+ rationale: personalAccess ? t("sessionAuthRecommendation.reviewPermissionToUseYour") : t("sessionAuthRecommendation.reconnectThisIntegrationToUse"),
91
+ requiredVariables: []
92
+ }
93
+ };
94
+ }
95
+
96
+ // src/components/session-connection-request.tsx
97
+ import { useEffect, useRef, useState } from "react";
98
+ import { jsx, jsxs } from "react/jsx-runtime";
99
+ function SessionConnectionRequest(props) {
100
+ const [client, setClient] = useState(props.client);
101
+ const [generation, setGeneration] = useState(0);
102
+ if (client !== props.client) {
103
+ setClient(props.client);
104
+ setGeneration(generation + 1);
105
+ }
106
+ return /* @__PURE__ */ jsx(
107
+ ScopedRequest,
108
+ {
109
+ ...props
110
+ },
111
+ `${generation}:${props.workspaceId}:${props.sessionId}:${props.request.id}`
112
+ );
113
+ }
114
+ function ScopedRequest({ request, ...props }) {
115
+ const t = useOpenGeniText();
116
+ const [resolved, setResolved] = useState(null);
117
+ const [error, setError] = useState(null);
118
+ const [retry, setRetry] = useState(0);
119
+ const requestRef = useRef(request);
120
+ requestRef.current = request;
121
+ useEffect(() => {
122
+ let current = true;
123
+ const event = requestRef.current;
124
+ setResolved(null);
125
+ setError(null);
126
+ void props.client.listCapabilities(props.workspaceId).then((catalog) => {
127
+ if (!current) return;
128
+ const recommendation = sessionAuthRecommendation(t, event, catalog.items);
129
+ const candidate = catalog.items.find(
130
+ (entry) => entry.id === recommendation?.capability?.id
131
+ );
132
+ if (!recommendation || candidate?.kind !== "mcp" || candidate.authKind !== "oauth2") {
133
+ setError(t("sessionConnectionRequest.thisRequestCouldNotBe"));
134
+ return;
135
+ }
136
+ setResolved(recommendation);
137
+ }).catch(() => {
138
+ if (current) setError(t("sessionConnectionRequest.couldnTLoadConnectionDetails"));
139
+ });
140
+ return () => {
141
+ current = false;
142
+ };
143
+ }, [
144
+ props.client,
145
+ props.workspaceId,
146
+ request.id,
147
+ request.serverId,
148
+ request.connectionId,
149
+ request.authoritySource,
150
+ request.reason,
151
+ request.capability?.id,
152
+ retry,
153
+ t
154
+ ]);
155
+ if (!resolved?.capability)
156
+ return /* @__PURE__ */ jsxs("div", { className: "og-session-capability-setup", children: [
157
+ /* @__PURE__ */ jsx("p", { role: error ? "alert" : "status", children: error ?? t("sessionConnectionRequest.loadingConnectionDetails") }),
158
+ error ? /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setRetry((value) => value + 1), children: t("sessionConnectionRequest.retry") }) : null
159
+ ] });
160
+ return /* @__PURE__ */ jsx(
161
+ SessionMcpCapabilityCard,
162
+ {
163
+ ...props,
164
+ capabilityId: resolved.capability.id,
165
+ name: resolved.capability.name,
166
+ rationale: resolved.capability.rationale
167
+ }
168
+ );
169
+ }
170
+
171
+ // src/hooks/use-video-artifact-playback.ts
172
+ import { useMemo } from "react";
173
+ function useVideoArtifactPlaybackLoader(options = {}) {
174
+ const { client, workspaceId } = useOpenGeni(options);
175
+ return useMemo(
176
+ () => async (artifactId, signal) => {
177
+ if (typeof client.createVideoArtifactPlaybackSource !== "function") {
178
+ throw new Error("This Opengeni host does not expose retained-video playback.");
179
+ }
180
+ return await client.createVideoArtifactPlaybackSource(
181
+ workspaceId,
182
+ artifactId,
183
+ signal ? { signal } : {}
184
+ );
185
+ },
186
+ [client, workspaceId]
187
+ );
188
+ }
189
+
190
+ // src/hooks/use-scheduled-tasks.ts
191
+ import { useCallback } from "react";
192
+ function useScheduledTasks(options = {}) {
193
+ const { client, workspaceId } = useOpenGeni(options);
194
+ const limit = options.limit;
195
+ const load = useCallback(
196
+ async () => await client.listScheduledTasks(workspaceId, limit !== void 0 ? { limit } : {}),
197
+ [client, workspaceId, limit]
198
+ );
199
+ const state = usePolledValue(load, {
200
+ pollIntervalMs: options.pollIntervalMs,
201
+ enabled: options.enabled
202
+ });
203
+ return {
204
+ tasks: state.data ?? [],
205
+ loading: state.loading,
206
+ error: state.error,
207
+ refresh: state.refresh
208
+ };
209
+ }
210
+
211
+ // src/hooks/use-workspace-background-commands.ts
212
+ import { useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
213
+ function useWorkspaceBackgroundCommands(options = {}) {
214
+ const { client, workspaceId } = useOpenGeni(options);
215
+ const [pages, setPages] = useState2(1);
216
+ const enabled = options.enabled ?? true;
217
+ useEffect2(() => setPages(1), [client, workspaceId]);
218
+ const load = useCallback2(
219
+ async (signal) => {
220
+ if (!client.listWorkspaceBackgroundCommands)
221
+ throw new Error("The configured client does not support workspace commands");
222
+ const commands = /* @__PURE__ */ new Map();
223
+ let cursor;
224
+ for (let page = 0; page < pages; page += 1) {
225
+ signal?.throwIfAborted();
226
+ const result = await client.listWorkspaceBackgroundCommands(workspaceId, {
227
+ ...cursor ? { cursor } : {},
228
+ ...signal ? { signal } : {}
229
+ });
230
+ for (const command of result.commands) commands.set(command.id, command);
231
+ cursor = result.nextCursor ?? void 0;
232
+ if (!cursor) break;
233
+ }
234
+ return { commands: [...commands.values()], hasMore: Boolean(cursor) };
235
+ },
236
+ [client, workspaceId, pages]
237
+ );
238
+ const state = usePolledValue(load, { enabled, pollIntervalMs: options.pollIntervalMs ?? 5e3 });
239
+ const { data, refresh } = state;
240
+ const generation = useRef2(0);
241
+ useEffect2(() => {
242
+ generation.current += 1;
243
+ return () => {
244
+ generation.current += 1;
245
+ };
246
+ }, [client, workspaceId, enabled]);
247
+ const cancel = useCallback2(
248
+ async (commandId) => {
249
+ const command = data?.commands.find((item) => item.id === commandId);
250
+ if (!command || !enabled) return;
251
+ if (!client.cancelSessionBackgroundCommand)
252
+ throw new Error("The configured client does not support stopping commands");
253
+ const ticket = generation.current;
254
+ await client.cancelSessionBackgroundCommand(workspaceId, command.sessionId, commandId);
255
+ if (ticket === generation.current) await refresh();
256
+ },
257
+ [client, workspaceId, enabled, data, refresh]
258
+ );
259
+ return {
260
+ commands: enabled && !state.error ? state.data?.commands ?? [] : [],
261
+ loading: enabled && state.loading,
262
+ error: enabled ? state.error : null,
263
+ refresh: state.refresh,
264
+ cancel,
265
+ hasMore: enabled && !state.error && (state.data?.hasMore ?? false),
266
+ loadMore: () => setPages((value) => value + 1)
267
+ };
268
+ }
269
+
270
+ // src/index.ts
271
+ import { asVaultClient, vaultsApi, vaultErrorCode, vaultErrorDetail } from "@opengeni/sdk";
272
+
273
+ // src/hooks/use-workspaces.ts
274
+ import { useCallback as useCallback3 } from "react";
275
+ function useWorkspaces(options = {}) {
276
+ const client = useOpenGeniClient(options);
277
+ const load = useCallback3(async () => await client.listWorkspaces(), [client]);
278
+ const { data, loading, error, refresh } = usePolledValue(load, {
279
+ pollIntervalMs: options.pollIntervalMs,
280
+ enabled: options.enabled
281
+ });
282
+ const { run, mutating, mutationError, clearMutationError } = useMutationRunner();
283
+ const create = useCallback3(
284
+ async (request) => {
285
+ const result = await run(() => client.createWorkspace(request));
286
+ if (result) {
287
+ await refresh();
288
+ }
289
+ return result;
290
+ },
291
+ [client, run, refresh]
292
+ );
293
+ const update = useCallback3(
294
+ async (workspaceId, request) => {
295
+ const result = await run(() => client.updateWorkspace(workspaceId, request));
296
+ if (result) {
297
+ await refresh();
298
+ }
299
+ return result;
300
+ },
301
+ [client, run, refresh]
302
+ );
303
+ return {
304
+ workspaces: data ?? [],
305
+ loading,
306
+ error,
307
+ refresh,
308
+ create,
309
+ update,
310
+ mutating,
311
+ mutationError,
312
+ clearMutationError
313
+ };
314
+ }
315
+
316
+ // src/hooks/use-billing-usage.ts
317
+ import { useCallback as useCallback4 } from "react";
318
+ function useBillingUsage(options = {}) {
319
+ const client = useOpenGeniClient(options);
320
+ const accountId = options.accountId;
321
+ const workspaceId = options.workspaceId;
322
+ const load = useCallback4(
323
+ async () => await client.getBillingUsage({
324
+ ...accountId !== void 0 ? { accountId } : {},
325
+ ...workspaceId !== void 0 ? { workspaceId } : {}
326
+ }),
327
+ [client, accountId, workspaceId]
328
+ );
329
+ const state = usePolledValue(load, {
330
+ pollIntervalMs: options.pollIntervalMs,
331
+ enabled: options.enabled
332
+ });
333
+ return {
334
+ balance: state.data?.balance ?? null,
335
+ usage: state.data?.usage ?? [],
336
+ loading: state.loading,
337
+ error: state.error,
338
+ refresh: state.refresh
339
+ };
340
+ }
341
+
342
+ // src/hooks/use-session-capabilities.ts
343
+ import {
344
+ OpenGeniApiError,
345
+ applyUrlRotation
346
+ } from "@opengeni/sdk";
347
+ import { useCallback as useCallback5, useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
348
+ function desktopAttachable(cell) {
349
+ if (cell.transport !== null) return true;
350
+ return cell.reason === "lease_cold" || cell.reason === "not_provisioned" || cell.reason === null;
351
+ }
352
+ var VIEWER_INTERACTION_EVENTS = [
353
+ "pointerdown",
354
+ "pointermove",
355
+ "keydown",
356
+ "wheel",
357
+ "touchstart"
358
+ ];
359
+ function useViewerInteractionClock(onInteraction) {
360
+ const lastInteractionRef = useRef3(Date.now());
361
+ const onInteractionRef = useRef3(onInteraction);
362
+ onInteractionRef.current = onInteraction;
363
+ useEffect3(() => {
364
+ if (typeof window === "undefined") return;
365
+ const record = () => {
366
+ lastInteractionRef.current = Date.now();
367
+ onInteractionRef.current();
368
+ };
369
+ const onVisibility = () => {
370
+ if (typeof document !== "undefined" && document.visibilityState === "visible") record();
371
+ };
372
+ const listenerOptions = { capture: true, passive: true };
373
+ for (const type of VIEWER_INTERACTION_EVENTS) {
374
+ window.addEventListener(type, record, listenerOptions);
375
+ }
376
+ window.addEventListener("focus", record, listenerOptions);
377
+ if (typeof document !== "undefined") {
378
+ document.addEventListener("visibilitychange", onVisibility);
379
+ }
380
+ return () => {
381
+ for (const type of VIEWER_INTERACTION_EVENTS) {
382
+ window.removeEventListener(type, record, listenerOptions);
383
+ }
384
+ window.removeEventListener("focus", record, listenerOptions);
385
+ if (typeof document !== "undefined") {
386
+ document.removeEventListener("visibilitychange", onVisibility);
387
+ }
388
+ };
389
+ }, []);
390
+ return lastInteractionRef;
391
+ }
392
+ function rotationsFrom(events) {
393
+ const out = [];
394
+ for (const event of events) {
395
+ if (event.type === "stream.url.rotated" && event.payload && typeof event.payload === "object") {
396
+ out.push(event.payload);
397
+ }
398
+ }
399
+ return out;
400
+ }
401
+ function useSessionCapabilities(sessionId, options = {}) {
402
+ const { client, workspaceId } = useOpenGeni(options);
403
+ const enabled = (options.enabled ?? true) && Boolean(sessionId);
404
+ const pageLive = usePageLiveActivity();
405
+ const lifecycleEnabled = enabled && pageLive;
406
+ const attachDesktop = options.attachDesktop ?? false;
407
+ const attachTerminal = options.attachTerminal ?? false;
408
+ const attachFiles = options.attachFiles ?? false;
409
+ const warmingPollMs = options.warmingPollMs ?? 1500;
410
+ const warmingDeadlineMs = options.warmingDeadlineMs ?? 3e4;
411
+ const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${enabled}`;
412
+ const [capabilities, setCapabilities] = useState3(null);
413
+ const [state, setState] = useState3("idle");
414
+ const [error, setError] = useState3(null);
415
+ const [acknowledgmentRequired, setAcknowledgmentRequired] = useState3(null);
416
+ const [viewerCapReached, setViewerCapReached] = useState3(false);
417
+ const [viewerCapReason, setViewerCapReason] = useState3(null);
418
+ const [viewerId, setViewerId] = useState3(null);
419
+ const [stateIdentity, setStateIdentity] = useState3(identityKey);
420
+ const [nonce, setNonce] = useState3(0);
421
+ const epochRef = useRef3(0);
422
+ const viewerIdRef = useRef3(null);
423
+ const previousIdentityRef = useRef3(identityKey);
424
+ const renegotiate = useCallback5(() => {
425
+ setNonce((n) => n + 1);
426
+ }, []);
427
+ const cardRefusedRef = useRef3(false);
428
+ useEffect3(() => {
429
+ if (typeof window === "undefined") return;
430
+ const onCardVerified = () => {
431
+ if (!cardRefusedRef.current) return;
432
+ cardRefusedRef.current = false;
433
+ setViewerCapReached(false);
434
+ setViewerCapReason(null);
435
+ setNonce((n) => n + 1);
436
+ };
437
+ window.addEventListener("opengeni:card-verified", onCardVerified);
438
+ return () => window.removeEventListener("opengeni:card-verified", onCardVerified);
439
+ }, []);
440
+ const resumeOnInteractionRef = useRef3(false);
441
+ const lastInteractionRef = useViewerInteractionClock(() => {
442
+ if (!resumeOnInteractionRef.current) return;
443
+ resumeOnInteractionRef.current = false;
444
+ setNonce((n) => n + 1);
445
+ });
446
+ useEffect3(() => {
447
+ const identityChanged = previousIdentityRef.current !== identityKey;
448
+ previousIdentityRef.current = identityKey;
449
+ if (identityChanged) {
450
+ setStateIdentity(identityKey);
451
+ setCapabilities(null);
452
+ setState("idle");
453
+ setError(null);
454
+ setAcknowledgmentRequired(null);
455
+ setViewerCapReached(false);
456
+ setViewerCapReason(null);
457
+ setViewerId(null);
458
+ epochRef.current = 0;
459
+ viewerIdRef.current = null;
460
+ resumeOnInteractionRef.current = false;
461
+ }
462
+ if (!lifecycleEnabled || !sessionId) {
463
+ setState("idle");
464
+ setCapabilities(null);
465
+ viewerIdRef.current = null;
466
+ setViewerId(null);
467
+ return;
468
+ }
469
+ viewerIdRef.current = null;
470
+ setViewerId(null);
471
+ const awaitingInteraction = resumeOnInteractionRef.current;
472
+ let cancelled = false;
473
+ let idleDrainMs = null;
474
+ let pollTimer = null;
475
+ let heartbeatTimer = null;
476
+ let localViewerId = null;
477
+ const requestAbort = new AbortController();
478
+ const startedAt = Date.now();
479
+ const clearTimers = () => {
480
+ if (pollTimer !== null) clearTimeout(pollTimer);
481
+ if (heartbeatTimer !== null) clearTimeout(heartbeatTimer);
482
+ pollTimer = null;
483
+ heartbeatTimer = null;
484
+ };
485
+ const settle = (caps) => {
486
+ if (cancelled) return;
487
+ epochRef.current = caps.leaseEpoch;
488
+ setCapabilities(caps);
489
+ setError(null);
490
+ };
491
+ const reacquire = () => {
492
+ if (cancelled) return;
493
+ if (idleDrainMs !== null && Date.now() - lastInteractionRef.current >= idleDrainMs) {
494
+ localViewerId = null;
495
+ viewerIdRef.current = null;
496
+ setViewerId(null);
497
+ setState("on-demand");
498
+ resumeOnInteractionRef.current = true;
499
+ return;
500
+ }
501
+ renegotiate();
502
+ };
503
+ const startHeartbeat = (caps) => {
504
+ if (!localViewerId || heartbeatTimer !== null) return;
505
+ const intervalMs = caps.viewerHeartbeatIntervalMs > 0 ? caps.viewerHeartbeatIntervalMs : 3e4;
506
+ const schedule = () => {
507
+ if (cancelled || !localViewerId) return;
508
+ heartbeatTimer = setTimeout(() => {
509
+ heartbeatTimer = null;
510
+ if (cancelled || !localViewerId) return;
511
+ void client.heartbeatViewer(workspaceId, sessionId, localViewerId, {
512
+ leaseEpoch: epochRef.current,
513
+ lastInteractionAgeMs: Math.max(0, Date.now() - lastInteractionRef.current)
514
+ }).then((res) => {
515
+ if (!res.alive && !cancelled) {
516
+ reacquire();
517
+ }
518
+ }).catch((cause) => {
519
+ if (cancelled) return;
520
+ if (cause instanceof OpenGeniApiError && (cause.status === 409 || cause.status === 410)) {
521
+ reacquire();
522
+ }
523
+ }).finally(schedule);
524
+ }, intervalMs);
525
+ };
526
+ schedule();
527
+ };
528
+ const pollUntilWarm = () => {
529
+ pollTimer = setTimeout(() => {
530
+ if (cancelled) return;
531
+ void client.getStreamCapabilities(workspaceId, sessionId, { signal: requestAbort.signal }).then((caps) => {
532
+ if (cancelled) return;
533
+ settle(caps);
534
+ if (sandboxAcceptsLiveIo(caps.liveness)) {
535
+ setState("ready");
536
+ return;
537
+ }
538
+ if (warmingDeadlineMs > 0 && Date.now() - startedAt > warmingDeadlineMs) {
539
+ setState("error");
540
+ setError(new Error("sandbox did not warm in time \u2014 retry to re-negotiate"));
541
+ return;
542
+ }
543
+ pollUntilWarm();
544
+ }).catch((cause) => {
545
+ if (!cancelled) {
546
+ if (isSandboxOwnershipDisabledError(cause)) {
547
+ setState("on-demand");
548
+ setError(null);
549
+ return;
550
+ }
551
+ setState("error");
552
+ setError(normalizeError(cause));
553
+ }
554
+ });
555
+ }, warmingPollMs);
556
+ };
557
+ void (async () => {
558
+ setState("negotiating");
559
+ setAcknowledgmentRequired(null);
560
+ setViewerCapReached(false);
561
+ setViewerCapReason(null);
562
+ try {
563
+ const caps = await client.getStreamCapabilities(workspaceId, sessionId, {
564
+ signal: requestAbort.signal
565
+ });
566
+ if (cancelled) return;
567
+ settle(caps);
568
+ const wantDesktopAttach = attachDesktop && desktopAttachable(caps.DesktopStream);
569
+ const wantTerminalAttach = attachTerminal && terminalCanAcquirePty(caps.Terminal);
570
+ const wantFilesAttach = attachFiles && caps.FileSystem.available;
571
+ let attachRefused = false;
572
+ if (!awaitingInteraction && (wantDesktopAttach || wantTerminalAttach || wantFilesAttach)) {
573
+ try {
574
+ const holder = await client.attachViewer(workspaceId, sessionId, {
575
+ desktop: wantDesktopAttach,
576
+ terminal: wantTerminalAttach,
577
+ files: wantFilesAttach,
578
+ lastInteractionAgeMs: Math.max(0, Date.now() - lastInteractionRef.current)
579
+ });
580
+ if (cancelled) {
581
+ void client.detachViewer(workspaceId, sessionId, holder.viewerId).catch(() => {
582
+ });
583
+ return;
584
+ }
585
+ if (wantDesktopAttach && (!holder.dataPlaneUrl || !holder.transport || !holder.client) || wantTerminalAttach && (!holder.terminalUrl || !holder.terminalTransport)) {
586
+ await client.detachViewer(workspaceId, sessionId, holder.viewerId).catch(() => {
587
+ });
588
+ throw new Error("live plane unavailable");
589
+ }
590
+ localViewerId = holder.viewerId;
591
+ viewerIdRef.current = holder.viewerId;
592
+ idleDrainMs = typeof holder.viewerIdleDrainMs === "number" && holder.viewerIdleDrainMs > 0 ? holder.viewerIdleDrainMs : null;
593
+ setViewerId(holder.viewerId);
594
+ epochRef.current = holder.leaseEpoch;
595
+ setCapabilities(
596
+ (prev) => prev ? {
597
+ ...prev,
598
+ liveness: holder.liveness,
599
+ leaseEpoch: holder.leaseEpoch,
600
+ viewerHeartbeatIntervalMs: holder.viewerHeartbeatIntervalMs,
601
+ DesktopStream: wantDesktopAttach ? {
602
+ ...prev.DesktopStream,
603
+ transport: holder.transport ?? prev.DesktopStream.transport,
604
+ client: holder.client ?? prev.DesktopStream.client,
605
+ url: holder.dataPlaneUrl,
606
+ token: holder.streamToken,
607
+ expiresAt: holder.streamExpiresAt,
608
+ resolution: holder.resolution ?? prev.DesktopStream.resolution
609
+ } : prev.DesktopStream,
610
+ Terminal: wantTerminalAttach ? {
611
+ ...prev.Terminal,
612
+ transport: holder.terminalTransport ?? prev.Terminal.transport,
613
+ url: holder.terminalUrl,
614
+ token: holder.terminalToken,
615
+ expiresAt: holder.terminalExpiresAt,
616
+ // A live pty-ws means the box is pty-capable for real.
617
+ ptyCapable: holder.terminalTransport ? true : prev.Terminal.ptyCapable,
618
+ reason: holder.terminalTransport ? null : prev.Terminal.reason
619
+ } : prev.Terminal
620
+ } : prev
621
+ );
622
+ } catch (cause) {
623
+ if (cancelled) return;
624
+ if (cause instanceof OpenGeniApiError) {
625
+ if (cause.status === 409) {
626
+ if (wantDesktopAttach) {
627
+ setAcknowledgmentRequired(
628
+ cause.message.includes("shared_acknowledgment") ? "shared" : "unredacted"
629
+ );
630
+ }
631
+ } else if (cause.status === 429) {
632
+ const refusal = typeof cause.details?.viewerRefusal === "string" ? cause.details.viewerRefusal : cause.message.includes("went unused") ? "viewer_idle" : cause.message.includes("computers") ? "computer_limit" : null;
633
+ const cardRequired = cause.details?.code === "sandbox_card_required";
634
+ if (cardRequired && typeof window !== "undefined") {
635
+ window.dispatchEvent(
636
+ new CustomEvent("opengeni:card-required", {
637
+ detail: { workspaceId, accountId: null }
638
+ })
639
+ );
640
+ }
641
+ if (cardRequired) {
642
+ cardRefusedRef.current = true;
643
+ attachRefused = true;
644
+ setViewerCapReached(true);
645
+ setViewerCapReason("computers");
646
+ } else if (refusal === "viewer_idle") {
647
+ attachRefused = true;
648
+ resumeOnInteractionRef.current = true;
649
+ } else {
650
+ setViewerCapReached(true);
651
+ const computers = refusal === "computer_limit";
652
+ setViewerCapReason(computers ? "computers" : "viewers");
653
+ if (computers) attachRefused = true;
654
+ }
655
+ } else if (cause.status === 403) {
656
+ setState("error");
657
+ setError(cause);
658
+ return;
659
+ } else {
660
+ throw cause;
661
+ }
662
+ } else {
663
+ throw cause;
664
+ }
665
+ }
666
+ }
667
+ const warmUpRequested = !awaitingInteraction && !attachRefused && (wantDesktopAttach || wantTerminalAttach || wantFilesAttach);
668
+ if (sandboxAcceptsLiveIo(caps.liveness) || localViewerId) {
669
+ setState("ready");
670
+ startHeartbeat(caps);
671
+ } else if (warmUpRequested) {
672
+ setState("cold");
673
+ pollUntilWarm();
674
+ } else {
675
+ setState("on-demand");
676
+ }
677
+ } catch (cause) {
678
+ if (cancelled) return;
679
+ if (isSandboxOwnershipDisabledError(cause)) {
680
+ setState("on-demand");
681
+ setError(null);
682
+ return;
683
+ }
684
+ if (cause instanceof OpenGeniApiError && cause.status === 403) {
685
+ setState("error");
686
+ setError(new Error("not permitted to view this session's sandbox"));
687
+ return;
688
+ }
689
+ setState("error");
690
+ setError(normalizeError(cause));
691
+ }
692
+ })();
693
+ return () => {
694
+ cancelled = true;
695
+ requestAbort.abort();
696
+ clearTimers();
697
+ const releaseId = localViewerId ?? viewerIdRef.current;
698
+ if (releaseId) {
699
+ void client.detachViewer(workspaceId, sessionId, releaseId).catch(() => {
700
+ });
701
+ }
702
+ };
703
+ }, [
704
+ client,
705
+ workspaceId,
706
+ sessionId,
707
+ lifecycleEnabled,
708
+ attachDesktop,
709
+ attachTerminal,
710
+ attachFiles,
711
+ warmingPollMs,
712
+ warmingDeadlineMs,
713
+ nonce,
714
+ identityKey
715
+ ]);
716
+ const events = options.events;
717
+ useEffect3(() => {
718
+ if (!events || events.length === 0) return;
719
+ setCapabilities((prev) => {
720
+ if (!prev || !prev.DesktopStream.url) return prev;
721
+ let next = prev.DesktopStream;
722
+ let changed = false;
723
+ for (const rotation of rotationsFrom(events)) {
724
+ if (rotation.viewerId && viewerIdRef.current && rotation.viewerId !== viewerIdRef.current) {
725
+ continue;
726
+ }
727
+ const applied = applyUrlRotation(next, rotation, epochRef.current);
728
+ if (applied) {
729
+ next = { ...next, url: applied.url, token: applied.token, expiresAt: applied.expiresAt };
730
+ epochRef.current = Math.max(epochRef.current, rotation.leaseEpoch);
731
+ changed = true;
732
+ }
733
+ }
734
+ return changed ? { ...prev, DesktopStream: next, leaseEpoch: epochRef.current } : prev;
735
+ });
736
+ }, [events]);
737
+ const identityMatches = enabled && stateIdentity === identityKey;
738
+ return {
739
+ capabilities: identityMatches ? capabilities : null,
740
+ state: identityMatches ? state : "idle",
741
+ error: identityMatches ? error : null,
742
+ acknowledgmentRequired: identityMatches ? acknowledgmentRequired : null,
743
+ viewerCapReached: identityMatches && viewerCapReached,
744
+ viewerCapReason: identityMatches && viewerCapReached ? viewerCapReason : null,
745
+ viewerId: identityMatches ? viewerId : null,
746
+ renegotiate
747
+ };
748
+ }
749
+ function isSandboxOwnershipDisabledError(error) {
750
+ return error instanceof OpenGeniApiError && error.status === 404 && error.message.includes("sandbox ownership is not enabled");
751
+ }
752
+
753
+ // src/hooks/use-sandbox-terminal.ts
754
+ import { OpenGeniApiError as OpenGeniApiError2 } from "@opengeni/sdk";
755
+ import { useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef4, useState as useState4 } from "react";
756
+ var SANDBOX_TERMINAL_HISTORY_ROWS = 1e3;
757
+ var SANDBOX_TERMINAL_MAX_ROWS = 4e3;
758
+ function useSandboxTerminal(sessionId, options) {
759
+ const { client, workspaceId } = useOpenGeni(options);
760
+ const includeAgentFirehose = options.includeAgentFirehose ?? true;
761
+ const interactive = options.interactive ?? false;
762
+ const ptyFilter = options.ptyId;
763
+ const liveness = options.liveness;
764
+ const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${interactive}\0${ptyFilter ?? ""}`;
765
+ const [openedPtyId, setOpenedPtyId] = useState4(null);
766
+ const [openError, setOpenError] = useState4(null);
767
+ const [stateIdentity, setStateIdentity] = useState4(identityKey);
768
+ const [reopenNonce, setReopenNonce] = useState4(0);
769
+ const currentIdentityRef = useRef4(identityKey);
770
+ currentIdentityRef.current = identityKey;
771
+ useEffect4(() => {
772
+ setStateIdentity(identityKey);
773
+ setOpenedPtyId(null);
774
+ setOpenError(null);
775
+ }, [identityKey]);
776
+ const openInFlight = useRef4(false);
777
+ const boxWarm = liveness === void 0 || sandboxAcceptsLiveIo(liveness);
778
+ useEffect4(() => {
779
+ if (!interactive || !sessionId || ptyFilter || !boxWarm) {
780
+ setOpenError(null);
781
+ return;
782
+ }
783
+ let cancelled = false;
784
+ setOpenError(null);
785
+ openInFlight.current = true;
786
+ let openedId = null;
787
+ void client.terminalPtyOpen(workspaceId, sessionId, {}).then((res) => {
788
+ if (cancelled) {
789
+ void client.terminalPtyClose(workspaceId, sessionId, { ptyId: res.ptyId }).catch(() => {
790
+ });
791
+ return;
792
+ }
793
+ openedId = res.ptyId;
794
+ setOpenedPtyId(res.ptyId);
795
+ }).catch((cause) => {
796
+ if (!cancelled) setOpenError(cause instanceof Error ? cause : new Error(String(cause)));
797
+ }).finally(() => {
798
+ openInFlight.current = false;
799
+ });
800
+ return () => {
801
+ cancelled = true;
802
+ setOpenedPtyId(null);
803
+ const id = openedId;
804
+ if (id) void client.terminalPtyClose(workspaceId, sessionId, { ptyId: id }).catch(() => {
805
+ });
806
+ };
807
+ }, [interactive, client, workspaceId, sessionId, ptyFilter, boxWarm, reopenNonce]);
808
+ const outputTypes = useMemo2(
809
+ () => includeAgentFirehose && !ptyFilter ? ["terminal.pty.output.delta", "sandbox.command.output.delta"] : ["terminal.pty.output.delta"],
810
+ [includeAgentFirehose, ptyFilter]
811
+ );
812
+ const historyKey = `${workspaceId}\0${sessionId ?? ""}\0${outputTypes.join(",")}`;
813
+ const historyEnabled = (options.history ?? true) && Boolean(sessionId);
814
+ const gapGeneration = useTurnlessOutputGap(workspaceId, sessionId);
815
+ const [history, setHistory] = useState4(null);
816
+ const [historyTick, setHistoryTick] = useState4(0);
817
+ const readRef = useRef4(historyReadState(historyKey));
818
+ const mountedRef = useRef4(false);
819
+ useEffect4(() => {
820
+ mountedRef.current = true;
821
+ return () => {
822
+ mountedRef.current = false;
823
+ const state = readRef.current;
824
+ if (state.timer) clearTimeout(state.timer);
825
+ state.timer = null;
826
+ };
827
+ }, []);
828
+ useEffect4(() => {
829
+ let state = readRef.current;
830
+ if (state.key !== historyKey) {
831
+ if (state.timer) clearTimeout(state.timer);
832
+ state = historyReadState(historyKey);
833
+ readRef.current = state;
834
+ setHistory(null);
835
+ }
836
+ if (!historyEnabled || !sessionId || state.inFlight || state.timer) return;
837
+ if (!state.failed && state.generation === gapGeneration) return;
838
+ const now = Date.now();
839
+ const wait = state.failed ? terminalHistoryRetryDelay(state.failures) - (now - state.startedAt) : state.generation === null ? 0 : SANDBOX_TERMINAL_REREAD_MIN_MS - (now - state.startedAt);
840
+ if (wait > 0) {
841
+ state.timer = setTimeout(() => {
842
+ state.timer = null;
843
+ if (mountedRef.current) setHistoryTick((tick) => tick + 1);
844
+ }, wait);
845
+ return;
846
+ }
847
+ const generation = gapGeneration;
848
+ state.inFlight = true;
849
+ state.startedAt = now;
850
+ const current = () => mountedRef.current && readRef.current === state;
851
+ void readTerminalHistory(client, workspaceId, sessionId, outputTypes).then(
852
+ (page) => {
853
+ state.inFlight = false;
854
+ if (!current()) return;
855
+ state.failed = false;
856
+ state.failures = 0;
857
+ state.generation = generation;
858
+ setHistory({ key: state.key, events: page.events, complete: page.complete });
859
+ setHistoryTick((tick) => tick + 1);
860
+ },
861
+ (cause) => {
862
+ state.inFlight = false;
863
+ if (!current()) return;
864
+ if (cause instanceof OpenGeniApiError2 && cause.status >= 400 && cause.status < 500 && cause.status !== 408 && cause.status !== 429) {
865
+ state.failed = false;
866
+ state.failures = 0;
867
+ state.generation = generation;
868
+ return;
869
+ }
870
+ state.failed = true;
871
+ state.failures += 1;
872
+ setHistoryTick((tick) => tick + 1);
873
+ }
874
+ );
875
+ }, [
876
+ historyEnabled,
877
+ historyKey,
878
+ gapGeneration,
879
+ historyTick,
880
+ outputTypes,
881
+ client,
882
+ workspaceId,
883
+ sessionId
884
+ ]);
885
+ const liveRef = useRef4({ key: historyKey, rows: /* @__PURE__ */ new Map(), below: 0 });
886
+ const { chunks, openPty, supportsInput } = useMemo2(() => {
887
+ const open = /* @__PURE__ */ new Map();
888
+ let lastOpened = null;
889
+ let lastSupportsInput = false;
890
+ if (liveRef.current.key !== historyKey) {
891
+ liveRef.current = { key: historyKey, rows: /* @__PURE__ */ new Map(), below: 0 };
892
+ }
893
+ const liveRows = liveRef.current;
894
+ const live = liveRows.rows;
895
+ const types = new Set(outputTypes);
896
+ for (const event of options.events) {
897
+ if (event.workspaceId !== workspaceId || event.sessionId !== sessionId) continue;
898
+ if (event.type === "terminal.pty.started") {
899
+ const payload = event.payload;
900
+ if (payload?.ptyId) {
901
+ open.set(payload.ptyId, { supportsInput: true });
902
+ lastOpened = payload.ptyId;
903
+ }
904
+ continue;
905
+ }
906
+ if (event.type === "terminal.pty.exited") {
907
+ const payload = event.payload;
908
+ if (payload?.ptyId) {
909
+ open.delete(payload.ptyId);
910
+ if (lastOpened === payload.ptyId) lastOpened = null;
911
+ }
912
+ continue;
913
+ }
914
+ if (types.has(event.type) && event.sequence >= liveRows.below && !live.has(event.id)) {
915
+ live.set(event.id, event);
916
+ }
917
+ }
918
+ trimLiveRows(liveRows);
919
+ const loaded = history?.key === historyKey ? history : null;
920
+ const floor = loaded && !loaded.complete ? loaded.events[0]?.sequence ?? 0 : 0;
921
+ const seen = /* @__PURE__ */ new Set();
922
+ const out = [];
923
+ const add = (event) => {
924
+ if (seen.has(event.id) || event.sequence < floor) return;
925
+ seen.add(event.id);
926
+ const chunk = terminalChunk(event, ptyFilter);
927
+ if (chunk) out.push(chunk);
928
+ };
929
+ loaded?.events.forEach(add);
930
+ live.forEach(add);
931
+ out.sort((a, b) => a.seq - b.seq);
932
+ const activePty = ptyFilter && open.has(ptyFilter) ? ptyFilter : lastOpened;
933
+ lastSupportsInput = activePty ? open.get(activePty)?.supportsInput ?? false : false;
934
+ return {
935
+ chunks: out.length > SANDBOX_TERMINAL_MAX_ROWS ? out.slice(-SANDBOX_TERMINAL_MAX_ROWS) : out,
936
+ openPty: activePty,
937
+ supportsInput: lastSupportsInput
938
+ };
939
+ }, [options.events, history, historyKey, outputTypes, ptyFilter, workspaceId, sessionId]);
940
+ const identityMatches = stateIdentity === identityKey;
941
+ const activePtyId = identityMatches ? openedPtyId ?? openPty : null;
942
+ const canWrite = openedPtyId !== null || supportsInput;
943
+ const write = useMemo2(() => {
944
+ if (!activePtyId || !canWrite || !sessionId) return null;
945
+ const writeIdentity = identityKey;
946
+ return (data) => {
947
+ void client.terminalPtyWrite(workspaceId, sessionId, { ptyId: activePtyId, data }).catch((cause) => {
948
+ if (cause instanceof OpenGeniApiError2 && (cause.status === 409 || cause.status === 404) && activePtyId === openedPtyId && currentIdentityRef.current === writeIdentity) {
949
+ setOpenedPtyId(null);
950
+ setReopenNonce((n) => n + 1);
951
+ }
952
+ });
953
+ };
954
+ }, [client, workspaceId, sessionId, activePtyId, canWrite, openedPtyId, identityKey]);
955
+ const close = useCallback6(() => {
956
+ if (!activePtyId || !sessionId) return;
957
+ void client.terminalPtyClose(workspaceId, sessionId, { ptyId: activePtyId }).catch(() => {
958
+ });
959
+ }, [client, workspaceId, sessionId, activePtyId]);
960
+ const error = identityMatches ? openError : null;
961
+ return useMemo2(
962
+ () => ({ chunks, running: activePtyId !== null, write, activePtyId, close, error }),
963
+ [chunks, activePtyId, write, close, error]
964
+ );
965
+ }
966
+ function trimLiveRows(live) {
967
+ const { rows } = live;
968
+ if (rows.size <= SANDBOX_TERMINAL_MAX_ROWS + SANDBOX_TERMINAL_MAX_ROWS / 4) return;
969
+ const sorted = [...rows.values()].sort((left, right) => left.sequence - right.sequence);
970
+ const drop = sorted.length - SANDBOX_TERMINAL_MAX_ROWS;
971
+ for (const event of sorted.slice(0, drop)) rows.delete(event.id);
972
+ live.below = Math.max(live.below, sorted[drop].sequence);
973
+ }
974
+ function historyReadState(key) {
975
+ return {
976
+ key,
977
+ generation: null,
978
+ inFlight: false,
979
+ failed: false,
980
+ failures: 0,
981
+ startedAt: 0,
982
+ timer: null
983
+ };
984
+ }
985
+ var SANDBOX_TERMINAL_REREAD_MIN_MS = 1e3;
986
+ function terminalHistoryRetryDelay(failures) {
987
+ return Math.min(3e4, 1e3 * 2 ** Math.max(0, failures - 1));
988
+ }
989
+ function terminalChunk(event, ptyFilter) {
990
+ if (event.type === "terminal.pty.output.delta") {
991
+ const payload = event.payload;
992
+ if (!payload || typeof payload.chunk !== "string") return null;
993
+ if (ptyFilter && payload.ptyId !== ptyFilter) return null;
994
+ return {
995
+ id: event.id,
996
+ text: payload.chunk,
997
+ stream: payload.stream === "stderr" ? "stderr" : "stdout",
998
+ seq: event.sequence
999
+ };
1000
+ }
1001
+ if (event.type === "sandbox.command.output.delta" && !ptyFilter) {
1002
+ const payload = event.payload;
1003
+ if (!payload?.chunk) return null;
1004
+ return {
1005
+ id: event.id,
1006
+ text: payload.chunk,
1007
+ stream: payload.stream === "stderr" ? "stderr" : "stdout",
1008
+ seq: event.sequence
1009
+ };
1010
+ }
1011
+ return null;
1012
+ }
1013
+ async function readTerminalHistory(client, workspaceId, sessionId, includeTypes) {
1014
+ const options = {
1015
+ includeTypes,
1016
+ direction: "before",
1017
+ // Explicit: a cursorless read otherwise defaults to the monitoring tail,
1018
+ // which drops raw output deltas.
1019
+ mode: "forensic",
1020
+ payloadMode: "full",
1021
+ limit: SANDBOX_TERMINAL_HISTORY_ROWS
1022
+ };
1023
+ const pageClient = client;
1024
+ const page = typeof pageClient.listEventPage === "function" ? await pageClient.listEventPage(workspaceId, sessionId, options) : null;
1025
+ const events = page ? page.events : await client.listEvents(workspaceId, sessionId, options);
1026
+ const sorted = [...events].sort((left, right) => left.sequence - right.sequence);
1027
+ return {
1028
+ events: sorted,
1029
+ // Without a continuation fact, only an empty read is known complete: the
1030
+ // server's byte bound can cut a page short of the row limit.
1031
+ complete: page ? !page.hasMore : sorted.length === 0
1032
+ };
1033
+ }
1034
+
1035
+ // src/hooks/use-sandbox-git.ts
1036
+ import { useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo3, useRef as useRef5, useState as useState5 } from "react";
1037
+ function normalizeRoot(root) {
1038
+ const normalized = root.replaceAll("\\", "/").replace(/^\.\/+/, "").replace(/\/+$/, "");
1039
+ return normalized === "." ? "" : normalized;
1040
+ }
1041
+ function qualifyPath(repoRoot, path) {
1042
+ const root = normalizeRoot(repoRoot);
1043
+ return root ? `${root}/${path}` : path;
1044
+ }
1045
+ function qualifyDiff(repoRoot, file) {
1046
+ const root = normalizeRoot(repoRoot);
1047
+ return {
1048
+ ...file,
1049
+ path: qualifyPath(root, file.path),
1050
+ oldPath: file.oldPath === null ? null : qualifyPath(root, file.oldPath),
1051
+ repoRoot: root
1052
+ };
1053
+ }
1054
+ function uniqueRoots(roots) {
1055
+ return [...new Set(roots.map(normalizeRoot))].sort((a, b) => a.localeCompare(b));
1056
+ }
1057
+ var GIT_READ_BATCH_REQUEST_LIMIT = 32;
1058
+ function repoForPath(manifest, repoPath) {
1059
+ const want = normalizeRoot(repoPath);
1060
+ const exact = manifest.repos.find((r) => normalizeRoot(r.root) === want);
1061
+ if (exact) return exact;
1062
+ if (want === "" && manifest.repos.length === 1) return manifest.repos[0] ?? null;
1063
+ return null;
1064
+ }
1065
+ function sameFileDiff(a, b) {
1066
+ if (a.path !== b.path || a.oldPath !== b.oldPath || a.repoRoot !== b.repoRoot || a.status !== b.status || a.isBinary !== b.isBinary || a.isImage !== b.isImage || a.additions !== b.additions || a.deletions !== b.deletions || a.truncated !== b.truncated || a.hunks.length !== b.hunks.length)
1067
+ return false;
1068
+ return a.hunks.every((hunk, hunkIndex) => {
1069
+ const other = b.hunks[hunkIndex];
1070
+ if (!other || hunk.oldStart !== other.oldStart || hunk.oldLines !== other.oldLines || hunk.newStart !== other.newStart || hunk.newLines !== other.newLines || hunk.header !== other.header || hunk.lines.length !== other.lines.length)
1071
+ return false;
1072
+ return hunk.lines.every((line, lineIndex) => {
1073
+ const otherLine = other.lines[lineIndex];
1074
+ return otherLine !== void 0 && line.type === otherLine.type && line.oldNo === otherLine.oldNo && line.newNo === otherLine.newNo && line.text === otherLine.text;
1075
+ });
1076
+ });
1077
+ }
1078
+ function mergeDiffs(current, next) {
1079
+ if (current.length === 0) return next;
1080
+ const byPath = new Map(current.map((d) => [d.path, d]));
1081
+ let changed = current.length !== next.length;
1082
+ const merged = next.map((file, index) => {
1083
+ const existing = byPath.get(file.path);
1084
+ if (existing && sameFileDiff(existing, file)) {
1085
+ if (current[index] !== existing) changed = true;
1086
+ return existing;
1087
+ }
1088
+ changed = true;
1089
+ return file;
1090
+ });
1091
+ return changed ? merged : current;
1092
+ }
1093
+ function useSandboxGit(sessionId, options = {}) {
1094
+ const { client, workspaceId } = useOpenGeni(options);
1095
+ const enabled = (options.enabled ?? true) && Boolean(sessionId);
1096
+ const active = options.active ?? true;
1097
+ const repoPath = options.repoPath ?? "";
1098
+ const workspaceWide = options.repoPaths !== void 0;
1099
+ const repoPathsKey = uniqueRoots(
1100
+ options.repoPaths && options.repoPaths.length > 0 ? options.repoPaths : [repoPath]
1101
+ ).join("\0");
1102
+ const repoPaths = useMemo3(() => repoPathsKey.split("\0"), [repoPathsKey]);
1103
+ const comparison = options.comparison ?? (options.staged ? "staged" : "working");
1104
+ const hasAdvertisedRepoPaths = (options.repoPaths?.length ?? 0) > 0;
1105
+ const capture = comparison === "staged" ? null : options.capture ?? null;
1106
+ const isLive2 = sandboxAcceptsLiveIo(options.liveness);
1107
+ const acceptsEventReads = options.liveness === void 0 || isLive2;
1108
+ const acceptsEventReadsRef = useRef5(acceptsEventReads);
1109
+ acceptsEventReadsRef.current = acceptsEventReads;
1110
+ const hasLiveIoFence = options.liveness !== void 0;
1111
+ const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${repoPathsKey}\0${workspaceWide}\0${comparison}`;
1112
+ const [diff, setDiff] = useState5([]);
1113
+ const [branch, setBranch] = useState5(null);
1114
+ const [isRepo, setIsRepo] = useState5(false);
1115
+ const [ahead, setAhead] = useState5(0);
1116
+ const [behind, setBehind] = useState5(0);
1117
+ const [repoRoots, setRepoRoots] = useState5([]);
1118
+ const [source, setSource] = useState5(null);
1119
+ const sourceRef = useRef5(null);
1120
+ const [loading, setLoading] = useState5(false);
1121
+ const [error, setError] = useState5(null);
1122
+ const [stateIdentity, setStateIdentity] = useState5(identityKey);
1123
+ const refreshGenerationRef = useRef5(0);
1124
+ const refreshAbortRef = useRef5(null);
1125
+ const refreshInFlightRef = useRef5(null);
1126
+ const refreshPendingRef = useRef5(false);
1127
+ const refreshWorkerEpochRef = useRef5(0);
1128
+ const lastChangeRef = useRef5(0);
1129
+ const eventRefreshTimerRef = useRef5(null);
1130
+ const performRefresh = useCallback7(async () => {
1131
+ if (!sessionId) return;
1132
+ const refreshAbort = new AbortController();
1133
+ refreshAbortRef.current = refreshAbort;
1134
+ const generation = refreshGenerationRef.current += 1;
1135
+ setLoading(true);
1136
+ setError(null);
1137
+ try {
1138
+ const diffRequest = (root) => client.gitDiff(
1139
+ workspaceId,
1140
+ sessionId,
1141
+ {
1142
+ path: root,
1143
+ ...comparison === "branch" ? { fromRef: "origin/HEAD", mergeBase: true, includeUntracked: true } : comparison === "working" ? { fromRef: "HEAD", includeUntracked: true } : { staged: true, includeUntracked: false }
1144
+ },
1145
+ { signal: refreshAbort.signal }
1146
+ );
1147
+ const prefetched = hasAdvertisedRepoPaths ? await (async () => {
1148
+ const prefetchedRepos = [];
1149
+ for (let offset = 0; offset < repoPaths.length; offset += GIT_READ_BATCH_REQUEST_LIMIT) {
1150
+ const roots2 = repoPaths.slice(offset, offset + GIT_READ_BATCH_REQUEST_LIMIT);
1151
+ const batch = await client.gitReadBatch(
1152
+ workspaceId,
1153
+ sessionId,
1154
+ {
1155
+ requests: roots2.map((root) => ({
1156
+ status: { path: root },
1157
+ diff: {
1158
+ path: root,
1159
+ ...comparison === "branch" ? { fromRef: "origin/HEAD", mergeBase: true, includeUntracked: true } : comparison === "working" ? { fromRef: "HEAD", includeUntracked: true } : { staged: true, includeUntracked: false }
1160
+ }
1161
+ }))
1162
+ },
1163
+ { signal: refreshAbort.signal }
1164
+ );
1165
+ if (batch.results.length !== roots2.length) {
1166
+ throw new Error(
1167
+ `Workspace Git batch returned ${batch.results.length} results for ${roots2.length} repositories.`
1168
+ );
1169
+ }
1170
+ batch.results.forEach((item, index) => {
1171
+ prefetchedRepos.push({
1172
+ root: roots2[index],
1173
+ status: item.status,
1174
+ result: item.diff ?? {
1175
+ files: [],
1176
+ revision: item.status.revision
1177
+ }
1178
+ });
1179
+ });
1180
+ }
1181
+ return prefetchedRepos;
1182
+ })() : null;
1183
+ const statuses = prefetched ?? await Promise.all(
1184
+ repoPaths.map(async (root) => ({
1185
+ root,
1186
+ status: await client.gitStatus(
1187
+ workspaceId,
1188
+ sessionId,
1189
+ { path: root },
1190
+ { signal: refreshAbort.signal }
1191
+ )
1192
+ }))
1193
+ );
1194
+ if (refreshGenerationRef.current !== generation) return;
1195
+ const repositories = statuses.filter(({ status }) => status.isRepo);
1196
+ const roots = repositories.map(({ root }) => root);
1197
+ setRepoRoots((previous) => sameStrings(previous, roots) ? previous : roots);
1198
+ setIsRepo(repositories.length > 0);
1199
+ setBranch(repositories.length === 1 ? repositories[0]?.status.head ?? null : null);
1200
+ setAhead(repositories.reduce((sum, { status }) => sum + status.ahead, 0));
1201
+ setBehind(repositories.reduce((sum, { status }) => sum + status.behind, 0));
1202
+ if (repositories.length === 0) {
1203
+ setDiff([]);
1204
+ sourceRef.current = "live";
1205
+ setSource("live");
1206
+ return;
1207
+ }
1208
+ const prefetchedByRoot = new Map(prefetched?.map(({ root, result }) => [root, result]));
1209
+ const results = await Promise.all(
1210
+ repositories.map(async ({ root }) => ({
1211
+ root,
1212
+ result: prefetchedByRoot.get(root) ?? await diffRequest(root)
1213
+ }))
1214
+ );
1215
+ if (refreshGenerationRef.current !== generation) return;
1216
+ setDiff(
1217
+ (prev) => mergeDiffs(
1218
+ prev,
1219
+ results.flatMap(
1220
+ ({ root, result }) => workspaceWide ? result.files.map((file) => qualifyDiff(root, file)) : result.files
1221
+ )
1222
+ )
1223
+ );
1224
+ sourceRef.current = "live";
1225
+ setSource("live");
1226
+ } catch (cause) {
1227
+ if (refreshGenerationRef.current !== generation) return;
1228
+ setError(cause instanceof Error ? cause : new Error(String(cause)));
1229
+ } finally {
1230
+ if (refreshGenerationRef.current === generation) setLoading(false);
1231
+ if (refreshAbortRef.current === refreshAbort) refreshAbortRef.current = null;
1232
+ }
1233
+ }, [
1234
+ client,
1235
+ workspaceId,
1236
+ sessionId,
1237
+ repoPaths,
1238
+ hasAdvertisedRepoPaths,
1239
+ workspaceWide,
1240
+ comparison
1241
+ ]);
1242
+ const performRefreshRef = useRef5(performRefresh);
1243
+ performRefreshRef.current = performRefresh;
1244
+ const refresh = useCallback7(async () => {
1245
+ refreshPendingRef.current = true;
1246
+ const existing = refreshInFlightRef.current;
1247
+ if (existing) return await existing;
1248
+ const workerEpoch = refreshWorkerEpochRef.current;
1249
+ const run = (async () => {
1250
+ while (refreshPendingRef.current && refreshWorkerEpochRef.current === workerEpoch) {
1251
+ refreshPendingRef.current = false;
1252
+ await performRefreshRef.current();
1253
+ }
1254
+ })();
1255
+ refreshInFlightRef.current = run;
1256
+ try {
1257
+ await run;
1258
+ } finally {
1259
+ if (refreshInFlightRef.current === run) refreshInFlightRef.current = null;
1260
+ }
1261
+ }, []);
1262
+ const seedFromCapture = useCallback7(
1263
+ (manifest) => {
1264
+ const repositories = workspaceWide ? manifest.repos : [repoForPath(manifest, repoPath)].filter(Boolean);
1265
+ if (comparison === "branch" && repositories.some((repo) => repo.branchDiff === void 0)) {
1266
+ return;
1267
+ }
1268
+ if (repositories.length === 0) {
1269
+ setIsRepo(false);
1270
+ setBranch(null);
1271
+ setAhead(0);
1272
+ setBehind(0);
1273
+ setRepoRoots([]);
1274
+ setDiff((prev) => prev.length === 0 ? prev : []);
1275
+ sourceRef.current = "capture";
1276
+ setSource("capture");
1277
+ return;
1278
+ }
1279
+ setIsRepo(true);
1280
+ setBranch(repositories.length === 1 ? repositories[0]?.head ?? null : null);
1281
+ setAhead(repositories.reduce((sum, repo) => sum + repo.ahead, 0));
1282
+ setBehind(repositories.reduce((sum, repo) => sum + repo.behind, 0));
1283
+ const capturedRoots = repositories.map((repo) => normalizeRoot(repo.root));
1284
+ setRepoRoots((previous) => sameStrings(previous, capturedRoots) ? previous : capturedRoots);
1285
+ setDiff(
1286
+ (prev) => mergeDiffs(
1287
+ prev,
1288
+ repositories.flatMap((repo) => {
1289
+ const capturedDiff = comparison === "branch" ? repo.branchDiff ?? [] : repo.diff;
1290
+ return workspaceWide ? capturedDiff.map((file) => qualifyDiff(repo.root, file)) : capturedDiff;
1291
+ })
1292
+ )
1293
+ );
1294
+ sourceRef.current = "capture";
1295
+ setSource("capture");
1296
+ setError(null);
1297
+ },
1298
+ [comparison, repoPath, workspaceWide]
1299
+ );
1300
+ const captureRef = useRef5(capture);
1301
+ captureRef.current = capture;
1302
+ const captureRevision = capture?.revision ?? null;
1303
+ const previousIdentityRef = useRef5(identityKey);
1304
+ useEffect5(() => {
1305
+ refreshAbortRef.current?.abort();
1306
+ refreshAbortRef.current = null;
1307
+ refreshPendingRef.current = false;
1308
+ refreshGenerationRef.current += 1;
1309
+ const identityChanged = previousIdentityRef.current !== identityKey;
1310
+ previousIdentityRef.current = identityKey;
1311
+ if (identityChanged) {
1312
+ refreshWorkerEpochRef.current += 1;
1313
+ refreshInFlightRef.current = null;
1314
+ }
1315
+ if (identityChanged || !enabled) {
1316
+ lastChangeRef.current = 0;
1317
+ setDiff([]);
1318
+ setStateIdentity(identityKey);
1319
+ setIsRepo(false);
1320
+ setBranch(null);
1321
+ setAhead(0);
1322
+ setBehind(0);
1323
+ setRepoRoots([]);
1324
+ sourceRef.current = null;
1325
+ setSource(null);
1326
+ setLoading(false);
1327
+ setError(null);
1328
+ }
1329
+ if (!enabled) {
1330
+ return;
1331
+ }
1332
+ const currentCapture = captureRevision !== null ? captureRef.current : null;
1333
+ if (currentCapture && (identityChanged || !isLive2 || sourceRef.current !== "live")) {
1334
+ seedFromCapture(currentCapture);
1335
+ }
1336
+ if (!active) {
1337
+ if (!active) setLoading(false);
1338
+ return;
1339
+ }
1340
+ if (isLive2 || !hasLiveIoFence && !currentCapture) {
1341
+ void refresh();
1342
+ }
1343
+ return () => {
1344
+ refreshAbortRef.current?.abort();
1345
+ refreshAbortRef.current = null;
1346
+ refreshPendingRef.current = false;
1347
+ refreshGenerationRef.current += 1;
1348
+ };
1349
+ }, [
1350
+ enabled,
1351
+ active,
1352
+ isLive2,
1353
+ hasLiveIoFence,
1354
+ captureRevision,
1355
+ identityKey,
1356
+ refresh,
1357
+ seedFromCapture
1358
+ ]);
1359
+ const events = options.events;
1360
+ useEffect5(() => {
1361
+ if (!enabled || !events) {
1362
+ if (eventRefreshTimerRef.current) {
1363
+ clearTimeout(eventRefreshTimerRef.current);
1364
+ eventRefreshTimerRef.current = null;
1365
+ }
1366
+ return;
1367
+ }
1368
+ if (!active || !acceptsEventReads) {
1369
+ for (const event of events) {
1370
+ if (event.sequence > lastChangeRef.current) lastChangeRef.current = event.sequence;
1371
+ }
1372
+ if (eventRefreshTimerRef.current) {
1373
+ clearTimeout(eventRefreshTimerRef.current);
1374
+ eventRefreshTimerRef.current = null;
1375
+ }
1376
+ return;
1377
+ }
1378
+ let latest = lastChangeRef.current;
1379
+ let changed = false;
1380
+ for (const event of events) {
1381
+ if (event.sequence <= latest) continue;
1382
+ if (event.type === "git.changed") {
1383
+ latest = event.sequence;
1384
+ changed = true;
1385
+ }
1386
+ }
1387
+ if (latest > lastChangeRef.current) {
1388
+ lastChangeRef.current = latest;
1389
+ if (!changed) return;
1390
+ if (eventRefreshTimerRef.current) clearTimeout(eventRefreshTimerRef.current);
1391
+ eventRefreshTimerRef.current = setTimeout(() => {
1392
+ eventRefreshTimerRef.current = null;
1393
+ if (acceptsEventReadsRef.current) void refresh();
1394
+ }, 150);
1395
+ }
1396
+ }, [enabled, active, acceptsEventReads, events, refresh]);
1397
+ useEffect5(
1398
+ () => () => {
1399
+ if (eventRefreshTimerRef.current) clearTimeout(eventRefreshTimerRef.current);
1400
+ },
1401
+ []
1402
+ );
1403
+ const identityMatches = enabled && stateIdentity === identityKey;
1404
+ const capturedAt = identityMatches && source === "capture" ? capture?.capturedAt ?? null : null;
1405
+ return useMemo3(() => {
1406
+ const visibleRepoRoots = identityMatches ? repoRoots : NO_ROOTS;
1407
+ return {
1408
+ diff: identityMatches ? diff : NO_DIFF,
1409
+ branch: identityMatches ? branch : null,
1410
+ isRepo: identityMatches && isRepo,
1411
+ ahead: identityMatches ? ahead : 0,
1412
+ behind: identityMatches ? behind : 0,
1413
+ repoCount: visibleRepoRoots.length,
1414
+ repoRoots: visibleRepoRoots,
1415
+ refresh,
1416
+ source: identityMatches ? source : null,
1417
+ capturedAt,
1418
+ loading: identityMatches && loading,
1419
+ error: identityMatches ? error : null
1420
+ };
1421
+ }, [
1422
+ identityMatches,
1423
+ repoRoots,
1424
+ diff,
1425
+ branch,
1426
+ isRepo,
1427
+ ahead,
1428
+ behind,
1429
+ refresh,
1430
+ source,
1431
+ capturedAt,
1432
+ loading,
1433
+ error
1434
+ ]);
1435
+ }
1436
+ var NO_DIFF = Object.freeze([]);
1437
+ function sameStrings(a, b) {
1438
+ return a.length === b.length && a.every((value, index) => value === b[index]);
1439
+ }
1440
+ var NO_ROOTS = Object.freeze([]);
1441
+
1442
+ // src/hooks/use-workspace-capture.ts
1443
+ import { useCallback as useCallback8, useEffect as useEffect6, useRef as useRef6, useState as useState6 } from "react";
1444
+ import { isRecord } from "@opengeni/contracts/values";
1445
+ var REVISION_CAPTURED = "workspace.revision.captured";
1446
+ var REVISION_DEGRADED = "workspace.revision.degraded";
1447
+ var MANIFEST_FETCH_TIMEOUT_MS = 15e3;
1448
+ var CAPTURE_STATS_NUMBER_FIELDS = [
1449
+ "repoCount",
1450
+ "fileCount",
1451
+ "additions",
1452
+ "deletions",
1453
+ "totalBytes",
1454
+ "tooLargeCount",
1455
+ "binaryCount",
1456
+ "treeEntryCount",
1457
+ "durationMs"
1458
+ ];
1459
+ function captureManifestForResponse(value, response) {
1460
+ if (!isRecord(value) || value.version !== 1 || !Number.isSafeInteger(value.revision) || typeof value.capturedAt !== "string" || !(value.turnId === null || typeof value.turnId === "string") || !Number.isSafeInteger(value.leaseEpoch) || !isRecord(value.treeIndex) || typeof value.treeTruncated !== "boolean" || !Array.isArray(value.repos) || !Array.isArray(value.files) || !isRecord(value.stats)) {
1461
+ throw new Error("Workspace capture manifest failed validation.");
1462
+ }
1463
+ if (value.revision !== response.revision || value.capturedAt !== response.capturedAt || value.turnId !== response.turnId || value.leaseEpoch !== response.leaseEpoch) {
1464
+ throw new Error("Workspace capture manifest identity did not match its response.");
1465
+ }
1466
+ for (const field of CAPTURE_STATS_NUMBER_FIELDS) {
1467
+ if (!Number.isSafeInteger(value.stats[field]) || value.stats[field] !== response.stats[field]) {
1468
+ throw new Error("Workspace capture manifest statistics did not match its response.");
1469
+ }
1470
+ }
1471
+ if (typeof value.stats.treeTruncated !== "boolean" || value.stats.treeTruncated !== response.stats.treeTruncated || (value.stats.fingerprint ?? null) !== (response.stats.fingerprint ?? null) || value.repos.length !== response.stats.repoCount || value.files.length !== response.stats.fileCount || value.treeTruncated !== response.stats.treeTruncated) {
1472
+ throw new Error("Workspace capture manifest statistics did not match its response.");
1473
+ }
1474
+ return value;
1475
+ }
1476
+ function useWorkspaceCapture(sessionId, options = {}) {
1477
+ const { client, workspaceId } = useOpenGeni(options);
1478
+ const enabled = (options.enabled ?? true) && Boolean(sessionId);
1479
+ const identityKey = `${workspaceId}\0${sessionId ?? ""}`;
1480
+ const [capture, setCapture] = useState6(null);
1481
+ const [available, setAvailable] = useState6(false);
1482
+ const [degradedReason, setDegradedReason] = useState6(null);
1483
+ const [fileCount, setFileCount] = useState6(null);
1484
+ const [loading, setLoading] = useState6(false);
1485
+ const [error, setError] = useState6(null);
1486
+ const [announcedRevision, setAnnouncedRevision] = useState6(null);
1487
+ const [stateIdentity, setStateIdentity] = useState6(identityKey);
1488
+ const generationRef = useRef6(0);
1489
+ const requestAbortRef = useRef6(null);
1490
+ const lastSeqRef = useRef6(0);
1491
+ const refresh = useCallback8(async () => {
1492
+ if (!sessionId) return;
1493
+ requestAbortRef.current?.abort();
1494
+ const requestAbort = new AbortController();
1495
+ requestAbortRef.current = requestAbort;
1496
+ const generation = generationRef.current += 1;
1497
+ setStateIdentity(identityKey);
1498
+ setLoading(true);
1499
+ setError(null);
1500
+ try {
1501
+ for (let attempt = 0; attempt < 2; attempt += 1) {
1502
+ const res = await client.getWorkspaceCapture(
1503
+ workspaceId,
1504
+ sessionId,
1505
+ { signal: requestAbort.signal }
1506
+ );
1507
+ if (generationRef.current !== generation) return;
1508
+ if (!res.available) {
1509
+ setCapture(null);
1510
+ setAvailable(false);
1511
+ setFileCount(0);
1512
+ setDegradedReason(res.degradedReason ?? null);
1513
+ return;
1514
+ }
1515
+ setDegradedReason(null);
1516
+ setFileCount(res.stats.fileCount);
1517
+ let manifestValue = res.manifest;
1518
+ if (!manifestValue && res.manifestUrl) {
1519
+ const response = await fetch(res.manifestUrl.url, {
1520
+ signal: AbortSignal.any([
1521
+ requestAbort.signal,
1522
+ AbortSignal.timeout(MANIFEST_FETCH_TIMEOUT_MS)
1523
+ ]),
1524
+ credentials: "omit",
1525
+ cache: "no-store",
1526
+ referrerPolicy: "no-referrer"
1527
+ }).catch(() => null);
1528
+ if (generationRef.current !== generation) return;
1529
+ if (!response?.ok) {
1530
+ if (attempt === 0 && (response === null || response.status === 401 || response.status === 403)) {
1531
+ continue;
1532
+ }
1533
+ throw new Error(
1534
+ `Workspace capture manifest download failed${response ? ` (${response.status})` : ""}.`
1535
+ );
1536
+ }
1537
+ try {
1538
+ manifestValue = await response.json();
1539
+ } catch {
1540
+ throw new Error("Workspace capture manifest was not valid JSON.");
1541
+ }
1542
+ if (generationRef.current !== generation) return;
1543
+ }
1544
+ if (!manifestValue) {
1545
+ throw new Error("Workspace capture response did not include a manifest.");
1546
+ }
1547
+ const manifest = captureManifestForResponse(manifestValue, res);
1548
+ setCapture(manifest);
1549
+ setAvailable(true);
1550
+ setAnnouncedRevision(
1551
+ (prev) => prev === null || manifest.revision > prev ? manifest.revision : prev
1552
+ );
1553
+ return;
1554
+ }
1555
+ throw new Error("Workspace capture manifest download failed after refreshing its URL.");
1556
+ } catch (cause) {
1557
+ if (generationRef.current !== generation) return;
1558
+ setError(cause instanceof Error ? cause : new Error(String(cause)));
1559
+ } finally {
1560
+ if (generationRef.current === generation) setLoading(false);
1561
+ if (requestAbortRef.current === requestAbort) requestAbortRef.current = null;
1562
+ }
1563
+ }, [client, workspaceId, sessionId, identityKey]);
1564
+ useEffect6(() => {
1565
+ requestAbortRef.current?.abort();
1566
+ requestAbortRef.current = null;
1567
+ generationRef.current += 1;
1568
+ lastSeqRef.current = 0;
1569
+ setCapture(null);
1570
+ setAvailable(false);
1571
+ setDegradedReason(null);
1572
+ setFileCount(null);
1573
+ setAnnouncedRevision(null);
1574
+ setError(null);
1575
+ if (!enabled) {
1576
+ setLoading(false);
1577
+ return;
1578
+ }
1579
+ void refresh();
1580
+ return () => {
1581
+ requestAbortRef.current?.abort();
1582
+ requestAbortRef.current = null;
1583
+ generationRef.current += 1;
1584
+ };
1585
+ }, [enabled, refresh]);
1586
+ const events = options.events;
1587
+ useEffect6(() => {
1588
+ if (!enabled || !events) return;
1589
+ let newest = null;
1590
+ for (const event of events) {
1591
+ if (event.sequence <= lastSeqRef.current) continue;
1592
+ if (event.type === REVISION_CAPTURED) {
1593
+ const payload = event.payload;
1594
+ if (payload && typeof payload === "object" && typeof payload.revision === "number") {
1595
+ newest = newest === null ? payload.revision : Math.max(newest, payload.revision);
1596
+ }
1597
+ } else if (event.type === REVISION_DEGRADED) {
1598
+ const payload = event.payload;
1599
+ if (payload && typeof payload === "object" && typeof payload.revision === "number") {
1600
+ newest = newest === null ? payload.revision : Math.max(newest, payload.revision);
1601
+ }
1602
+ }
1603
+ }
1604
+ for (const event of events)
1605
+ if (event.sequence > lastSeqRef.current) lastSeqRef.current = event.sequence;
1606
+ if (newest === null) return;
1607
+ setAnnouncedRevision((prev) => prev === null || newest > prev ? newest : prev);
1608
+ }, [enabled, events]);
1609
+ const identityMatches = enabled && stateIdentity === identityKey;
1610
+ const visibleCapture = identityMatches ? capture : null;
1611
+ const visibleAnnouncedRevision = identityMatches ? announcedRevision : null;
1612
+ const loadedRevision = visibleCapture?.revision ?? null;
1613
+ useEffect6(() => {
1614
+ if (!enabled) return;
1615
+ if (visibleAnnouncedRevision === null) return;
1616
+ if (loadedRevision !== null && visibleAnnouncedRevision <= loadedRevision) return;
1617
+ if (requestAbortRef.current) return;
1618
+ void refresh();
1619
+ }, [enabled, visibleAnnouncedRevision, loadedRevision, refresh]);
1620
+ const isStale = loadedRevision !== null && visibleAnnouncedRevision !== null && visibleAnnouncedRevision > loadedRevision;
1621
+ return {
1622
+ capture: visibleCapture,
1623
+ revision: loadedRevision,
1624
+ capturedAt: visibleCapture?.capturedAt ?? null,
1625
+ available: identityMatches && available,
1626
+ degradedReason: identityMatches ? degradedReason : null,
1627
+ fileCount: identityMatches ? fileCount : null,
1628
+ isStale,
1629
+ loading: identityMatches && loading,
1630
+ error: identityMatches ? error : null,
1631
+ refresh
1632
+ };
1633
+ }
1634
+
1635
+ // src/hooks/use-workspace-edit.ts
1636
+ import { useCallback as useCallback9, useEffect as useEffect7, useMemo as useMemo4, useRef as useRef7, useState as useState7 } from "react";
1637
+ function isLive(liveness) {
1638
+ return sandboxAcceptsLiveIo(liveness);
1639
+ }
1640
+ function useWorkspaceEdit(sessionId, options = {}) {
1641
+ const { client, workspaceId } = useOpenGeni(options);
1642
+ const path = options.path ?? null;
1643
+ const baseContent = options.baseContent ?? null;
1644
+ const routeEpoch = options.route?.epoch;
1645
+ const routeRoot = options.route?.root;
1646
+ const route = useMemo4(
1647
+ () => routeEpoch !== void 0 && routeRoot !== void 0 ? { epoch: routeEpoch, root: routeRoot } : void 0,
1648
+ [routeEpoch, routeRoot]
1649
+ );
1650
+ const live = isLive(options.liveness);
1651
+ const offline = options.offline === true;
1652
+ const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${path ?? ""}\0${routeEpoch ?? ""}\0${routeRoot ?? ""}`;
1653
+ const [buffer, setBuffer] = useState7(null);
1654
+ const [wantsWarm, setWantsWarm] = useState7(false);
1655
+ const [flush, setFlush] = useState7("idle");
1656
+ const [conflict, setConflict] = useState7(null);
1657
+ const [error, setError] = useState7(null);
1658
+ const [stateIdentity, setStateIdentity] = useState7(identityKey);
1659
+ const onWarmRequested = options.onWarmRequested;
1660
+ const bufferRef = useRef7(null);
1661
+ bufferRef.current = buffer;
1662
+ const flushingRef = useRef7(false);
1663
+ const identityGenerationRef = useRef7(0);
1664
+ const flushAttemptRef = useRef7(0);
1665
+ const readAbortRef = useRef7(null);
1666
+ useEffect7(() => {
1667
+ identityGenerationRef.current += 1;
1668
+ flushAttemptRef.current += 1;
1669
+ readAbortRef.current?.abort();
1670
+ readAbortRef.current = null;
1671
+ setStateIdentity(identityKey);
1672
+ setBuffer(null);
1673
+ setWantsWarm(false);
1674
+ setFlush("idle");
1675
+ setConflict(null);
1676
+ setError(null);
1677
+ flushingRef.current = false;
1678
+ return () => {
1679
+ identityGenerationRef.current += 1;
1680
+ flushAttemptRef.current += 1;
1681
+ readAbortRef.current?.abort();
1682
+ readAbortRef.current = null;
1683
+ };
1684
+ }, [identityKey]);
1685
+ const edit = useCallback9(
1686
+ (content) => {
1687
+ if (stateIdentity !== identityKey) return;
1688
+ if (offline) return;
1689
+ setBuffer((prev) => prev === content ? prev : content);
1690
+ setFlush((prev) => prev === "flushing" ? prev : "idle");
1691
+ setConflict(null);
1692
+ if (!live) {
1693
+ setWantsWarm((prev) => {
1694
+ if (!prev) onWarmRequested?.();
1695
+ return true;
1696
+ });
1697
+ }
1698
+ },
1699
+ [offline, live, onWarmRequested, stateIdentity, identityKey]
1700
+ );
1701
+ const doFlush = useCallback9(
1702
+ async (force) => {
1703
+ if (stateIdentity !== identityKey) return;
1704
+ if (!sessionId || !path) return;
1705
+ const content = bufferRef.current;
1706
+ if (content === null) return;
1707
+ if (flushingRef.current) return;
1708
+ const identityGeneration = identityGenerationRef.current;
1709
+ const flushAttempt = flushAttemptRef.current += 1;
1710
+ flushingRef.current = true;
1711
+ setFlush("flushing");
1712
+ setError(null);
1713
+ try {
1714
+ if (!force) {
1715
+ const readAbort = new AbortController();
1716
+ readAbortRef.current?.abort();
1717
+ readAbortRef.current = readAbort;
1718
+ const liveRead = await client.fsRead(
1719
+ workspaceId,
1720
+ sessionId,
1721
+ { path, ...route ? { route } : {} },
1722
+ { signal: readAbort.signal }
1723
+ );
1724
+ if (readAbortRef.current === readAbort) readAbortRef.current = null;
1725
+ if (identityGenerationRef.current !== identityGeneration) return;
1726
+ const liveContent = liveRead.content;
1727
+ if (baseContent !== null && liveContent !== baseContent) {
1728
+ setConflict({ path, base: baseContent, live: liveContent });
1729
+ setFlush("conflict");
1730
+ return;
1731
+ }
1732
+ }
1733
+ await client.fsWrite(workspaceId, sessionId, {
1734
+ path,
1735
+ content,
1736
+ overwrite: true,
1737
+ ...route ? { route } : {}
1738
+ });
1739
+ if (identityGenerationRef.current !== identityGeneration) return;
1740
+ setConflict(null);
1741
+ setFlush("flushed");
1742
+ setWantsWarm(false);
1743
+ } catch (cause) {
1744
+ if (identityGenerationRef.current !== identityGeneration) return;
1745
+ setError(cause instanceof Error ? cause : new Error(String(cause)));
1746
+ setFlush("idle");
1747
+ } finally {
1748
+ if (flushAttemptRef.current === flushAttempt) {
1749
+ flushingRef.current = false;
1750
+ readAbortRef.current = null;
1751
+ }
1752
+ }
1753
+ },
1754
+ [client, workspaceId, sessionId, path, baseContent, route, stateIdentity, identityKey]
1755
+ );
1756
+ useEffect7(() => {
1757
+ if (offline) return;
1758
+ if (!live) return;
1759
+ if (buffer === null) return;
1760
+ if (flush === "flushed" || flush === "conflict" || flush === "flushing") return;
1761
+ void doFlush(false);
1762
+ }, [offline, live, buffer, flush, doFlush]);
1763
+ const overwrite = useCallback9(async () => {
1764
+ await doFlush(true);
1765
+ }, [doFlush]);
1766
+ const discard = useCallback9(() => {
1767
+ setBuffer(null);
1768
+ setWantsWarm(false);
1769
+ setFlush("idle");
1770
+ setConflict(null);
1771
+ setError(null);
1772
+ }, []);
1773
+ let state;
1774
+ if (offline) {
1775
+ state = "readonly-offline";
1776
+ } else if (flush === "flushing") {
1777
+ state = "flushing";
1778
+ } else if (flush === "flushed") {
1779
+ state = "flushed";
1780
+ } else if (flush === "conflict") {
1781
+ state = "conflict";
1782
+ } else if (buffer === null) {
1783
+ state = "viewing-cold";
1784
+ } else if (live) {
1785
+ state = "flushing";
1786
+ } else if (options.warming === true) {
1787
+ state = "warming";
1788
+ } else {
1789
+ state = "buffering";
1790
+ }
1791
+ const identityMatches = stateIdentity === identityKey;
1792
+ return {
1793
+ state: identityMatches ? state : offline ? "readonly-offline" : "viewing-cold",
1794
+ readOnly: offline,
1795
+ buffer: identityMatches ? buffer : null,
1796
+ wantsWarm: identityMatches && wantsWarm,
1797
+ edit,
1798
+ conflict: identityMatches ? conflict : null,
1799
+ overwrite,
1800
+ discard,
1801
+ error: identityMatches ? error : null
1802
+ };
1803
+ }
1804
+
1805
+ // src/index.ts
1806
+ import {
1807
+ humanizeModelSlug,
1808
+ isRawModelLabel,
1809
+ modelDisplayName as modelDisplayName2,
1810
+ modelSlug,
1811
+ modelVendor
1812
+ } from "@opengeni/sdk/model-display";
1813
+ import { parseOpenGeniLink } from "@opengeni/sdk";
1814
+
1815
+ // src/components/fleet-tile.tsx
1816
+ import { deriveSessionDisplayTitle } from "@opengeni/sdk";
1817
+ import { modelDisplayName } from "@opengeni/sdk/model-display";
1818
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
1819
+ var SESSION_METADATA_TITLE_KEYS = ["title", "name"];
1820
+ function sessionDisplayTitle(session) {
1821
+ return deriveSessionDisplayTitle(session, { metadataKeys: SESSION_METADATA_TITLE_KEYS });
1822
+ }
1823
+ function FleetTile({ session, title, subtitle, onOpen, className }) {
1824
+ const msg = useOpenGeniText();
1825
+ const running = session.status === "running" || session.status === "queued";
1826
+ const needsYou = session.status === "requires_action" && !sessionAdmissionBlocked(session);
1827
+ return /* @__PURE__ */ jsxs2(
1828
+ "button",
1829
+ {
1830
+ type: "button",
1831
+ "data-status": session.status,
1832
+ onClick: onOpen ? () => onOpen(session) : void 0,
1833
+ disabled: !onOpen,
1834
+ className: cn(
1835
+ "og-root group relative flex w-full flex-col gap-2.5 overflow-hidden rounded-og-lg border border-og-border",
1836
+ "bg-og-surface-1 p-4 text-left shadow-og-sm",
1837
+ "transition-[border-color,background-color,box-shadow,transform] duration-200 ease-og-out",
1838
+ onOpen && "hover:-translate-y-px hover:border-og-border-strong hover:bg-og-surface-2 hover:shadow-og-md",
1839
+ "disabled:cursor-default",
1840
+ className
1841
+ ),
1842
+ children: [
1843
+ /* @__PURE__ */ jsx2(
1844
+ "span",
1845
+ {
1846
+ "aria-hidden": true,
1847
+ className: cn(
1848
+ "absolute inset-y-0 left-0 w-0.5 transition-opacity duration-300",
1849
+ running ? "bg-og-accent opacity-100" : needsYou ? "bg-og-status-waiting opacity-100" : "opacity-0"
1850
+ )
1851
+ }
1852
+ ),
1853
+ /* @__PURE__ */ jsxs2("span", { className: "flex w-full items-start justify-between gap-3", children: [
1854
+ /* @__PURE__ */ jsx2("span", { className: "line-clamp-2 min-w-0 text-og-base font-medium leading-snug text-og-fg", children: title ?? sessionDisplayTitle(session) }),
1855
+ /* @__PURE__ */ jsx2(SessionStatus, { status: sessionDisplayStatus(session), size: "sm", className: "mt-px" })
1856
+ ] }),
1857
+ subtitle ? /* @__PURE__ */ jsx2("span", { className: "line-clamp-1 text-og-sm text-og-fg-muted", children: subtitle }) : null,
1858
+ /* @__PURE__ */ jsxs2("span", { className: "mt-auto flex w-full items-center gap-2 text-og-xs text-og-fg-subtle", children: [
1859
+ /* @__PURE__ */ jsx2("span", { className: "font-og-mono", children: session.id.slice(0, 8) }),
1860
+ /* @__PURE__ */ jsx2("span", { "aria-hidden": true, children: "\xB7" }),
1861
+ /* @__PURE__ */ jsx2("span", { className: "truncate", children: modelDisplayName(session.model) }),
1862
+ /* @__PURE__ */ jsx2("span", { className: "ml-auto shrink-0", title: session.updatedAt, children: formatRelativeTime(msg, session.updatedAt) })
1863
+ ] })
1864
+ ]
1865
+ }
1866
+ );
1867
+ }
1868
+
1869
+ // src/components/diff-view.tsx
1870
+ import { jsx as jsx3 } from "react/jsx-runtime";
1871
+ function DiffView({
1872
+ diff,
1873
+ fallback,
1874
+ layout = "unified",
1875
+ themeType,
1876
+ isRepo = true,
1877
+ emptyState,
1878
+ className
1879
+ }) {
1880
+ const t = useOpenGeniText();
1881
+ if (diff.length === 0) {
1882
+ return /* @__PURE__ */ jsx3("div", { className: cn("p-3 text-og-sm text-og-fg-subtle", className), children: emptyState ?? (isRepo ? t("diffView.noChanges") : t("diffView.noRepositoryMounted")) });
1883
+ }
1884
+ return /* @__PURE__ */ jsx3(
1885
+ PierreDiff,
1886
+ {
1887
+ diff,
1888
+ layout,
1889
+ themeType,
1890
+ ...fallback !== void 0 ? { fallback } : {},
1891
+ className
1892
+ }
1893
+ );
1894
+ }
1895
+
1896
+ // src/components/sandbox-workspace.tsx
1897
+ import {
1898
+ lazy,
1899
+ memo,
1900
+ Suspense,
1901
+ useCallback as useCallback10,
1902
+ useEffect as useEffect8,
1903
+ useMemo as useMemo5,
1904
+ useRef as useRef8,
1905
+ useState as useState8
1906
+ } from "react";
1907
+ import {
1908
+ CircleCheckIcon,
1909
+ CpuIcon,
1910
+ FileCode2Icon,
1911
+ GitCompareArrowsIcon,
1912
+ Globe2Icon,
1913
+ LoaderCircleIcon,
1914
+ MonitorIcon,
1915
+ RefreshCwIcon,
1916
+ SquareTerminalIcon,
1917
+ TriangleAlertIcon
1918
+ } from "lucide-react";
1919
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
1920
+ var LazySandboxFiles = lazy(
1921
+ () => import("./sandbox-files-HCLEEJMU.js").then(({ SandboxFiles: SandboxFiles2 }) => ({ default: SandboxFiles2 })).catch(() => ({ default: FilesLoadFailed }))
1922
+ );
1923
+ function FilesLoadFailed() {
1924
+ const t = useOpenGeniText();
1925
+ return /* @__PURE__ */ jsxs3(CenteredState, { tone: "danger", icon: /* @__PURE__ */ jsx4(TriangleAlertIcon, { className: "size-5", "aria-hidden": true }), children: [
1926
+ /* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: t("sandboxWorkspace.filesCouldNotBeLoaded") }),
1927
+ /* @__PURE__ */ jsxs3(DockActionButton, { onClick: () => window.location.reload(), children: [
1928
+ /* @__PURE__ */ jsx4(RefreshCwIcon, { className: "size-3", "aria-hidden": true }),
1929
+ t("sandboxWorkspace.reload")
1930
+ ] })
1931
+ ] });
1932
+ }
1933
+ function FilesTabBody(props) {
1934
+ return /* @__PURE__ */ jsx4(Suspense, { fallback: /* @__PURE__ */ jsx4(WorkbenchSurfaceLoading, { name: "Files" }), children: /* @__PURE__ */ jsx4(LazySandboxFiles, { ...props }) });
1935
+ }
1936
+ var LazyBrowserViewer = lazy(async () => {
1937
+ const { BrowserViewer } = await import("./browser-viewer-EIEMRVFF.js");
1938
+ return { default: BrowserViewer };
1939
+ });
1940
+ var LazyComputerViewer = lazy(async () => {
1941
+ const { ComputerViewer } = await import("./computer-viewer-ZBY3BPYW.js");
1942
+ return { default: ComputerViewer };
1943
+ });
1944
+ var WORKBENCH_TAB_CHANGES = "changes";
1945
+ var WORKBENCH_TAB_FILES = "files";
1946
+ var WORKBENCH_TAB_TERMINAL = "terminal";
1947
+ var WORKBENCH_TAB_BROWSER = "browser";
1948
+ var WORKBENCH_TAB_DESKTOP = "desktop";
1949
+ var WORKBENCH_SURFACES = [
1950
+ WORKBENCH_TAB_CHANGES,
1951
+ WORKBENCH_TAB_FILES,
1952
+ WORKBENCH_TAB_TERMINAL,
1953
+ WORKBENCH_TAB_BROWSER,
1954
+ WORKBENCH_TAB_DESKTOP
1955
+ ];
1956
+ function isWorkbenchSurface(value) {
1957
+ return WORKBENCH_SURFACES.includes(value);
1958
+ }
1959
+ function isCanonicalAbsoluteSandboxPath(value) {
1960
+ if (!value) return false;
1961
+ const portable = value.replaceAll("\\", "/");
1962
+ return portable.startsWith("/") || /^[A-Za-z]:\//u.test(portable);
1963
+ }
1964
+ function sourceDrivenDefaultTab(hasChanges, changesEnabled, filesEnabled) {
1965
+ if (hasChanges && changesEnabled) return WORKBENCH_TAB_CHANGES;
1966
+ if (filesEnabled) return WORKBENCH_TAB_FILES;
1967
+ if (changesEnabled) return WORKBENCH_TAB_CHANGES;
1968
+ return null;
1969
+ }
1970
+ function WorkbenchSurfaceLoading({ name }) {
1971
+ const t = useOpenGeniText();
1972
+ return /* @__PURE__ */ jsx4(
1973
+ CenteredState,
1974
+ {
1975
+ icon: /* @__PURE__ */ jsx4(LoaderCircleIcon, { className: "size-5 animate-spin motion-reduce:animate-none", "aria-hidden": true }),
1976
+ children: /* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: t("sandboxWorkspace.openingName", { name }) })
1977
+ }
1978
+ );
1979
+ }
1980
+ function initialWorkspaceTab(events, override) {
1981
+ if (override) return override;
1982
+ let bestSeq = -1;
1983
+ let bestFileCount = 0;
1984
+ for (const event of events ?? []) {
1985
+ if (event.type !== "workspace.revision.captured") continue;
1986
+ if (event.sequence <= bestSeq) continue;
1987
+ const stats = event.payload?.stats;
1988
+ bestSeq = event.sequence;
1989
+ bestFileCount = typeof stats?.fileCount === "number" ? stats.fileCount : 0;
1990
+ }
1991
+ if (bestFileCount > 0) return WORKBENCH_TAB_CHANGES;
1992
+ let latestGitSeq = -1;
1993
+ let committedOnly = false;
1994
+ for (const event of events ?? []) {
1995
+ if (event.type !== "git.changed" || event.sequence > bestSeq) continue;
1996
+ if (event.sequence <= latestGitSeq) continue;
1997
+ const payload = event.payload;
1998
+ latestGitSeq = event.sequence;
1999
+ committedOnly = typeof payload?.ahead === "number" && payload.ahead > 0 || payload?.reason === "commit";
2000
+ }
2001
+ return committedOnly ? WORKBENCH_TAB_CHANGES : WORKBENCH_TAB_FILES;
2002
+ }
2003
+ function sandboxProvisionInFlight(events) {
2004
+ let inFlight = false;
2005
+ for (const event of events) {
2006
+ if (event.type !== "sandbox.operation.started" && event.type !== "sandbox.operation.completed" && event.type !== "sandbox.operation.failed") {
2007
+ continue;
2008
+ }
2009
+ const payload = event.payload;
2010
+ const name = payload && typeof payload === "object" && !Array.isArray(payload) ? payload.name : null;
2011
+ if (name !== "sandbox.provision") continue;
2012
+ if (event.type === "sandbox.operation.started") {
2013
+ inFlight = true;
2014
+ } else {
2015
+ inFlight = false;
2016
+ }
2017
+ }
2018
+ return inFlight;
2019
+ }
2020
+ function workspaceTurnInFlight(events) {
2021
+ const activeTurnIds = /* @__PURE__ */ new Set();
2022
+ let anonymousTurnInFlight = false;
2023
+ let sessionOwnsWorkspace = false;
2024
+ for (const event of events) {
2025
+ if (event.type === "session.status.changed") {
2026
+ const status = event.payload && typeof event.payload === "object" && !Array.isArray(event.payload) ? event.payload.status : null;
2027
+ sessionOwnsWorkspace = status === "running" || status === "recovering";
2028
+ continue;
2029
+ }
2030
+ if (event.type === "turn.started") {
2031
+ if (event.turnId) activeTurnIds.add(event.turnId);
2032
+ else anonymousTurnInFlight = true;
2033
+ continue;
2034
+ }
2035
+ if (event.type !== "turn.completed" && event.type !== "turn.failed" && event.type !== "turn.cancelled" && event.type !== "turn.superseded") {
2036
+ continue;
2037
+ }
2038
+ if (event.turnId) activeTurnIds.delete(event.turnId);
2039
+ else anonymousTurnInFlight = false;
2040
+ }
2041
+ return sessionOwnsWorkspace || anonymousTurnInFlight || activeTurnIds.size > 0;
2042
+ }
2043
+ function emptyWarmIntents(sessionId) {
2044
+ return {
2045
+ sessionId,
2046
+ warmTerminal: false,
2047
+ warmFiles: false
2048
+ };
2049
+ }
2050
+ function useSandboxWorkspaceTabs(options) {
2051
+ const t = useOpenGeniText();
2052
+ const { client, workspaceId, workspaceInteractionEvent } = useOpenGeni(options);
2053
+ const {
2054
+ sessionId,
2055
+ events,
2056
+ onNotify,
2057
+ browserWebSocketFactory,
2058
+ computerWebSocketFactory,
2059
+ browserExtensionSetupUrl,
2060
+ requestedFilePath,
2061
+ requestedFileRequestId,
2062
+ requestedFileLine,
2063
+ onOpenFile,
2064
+ pullRequest,
2065
+ onOpenPullRequest,
2066
+ initialFilePath,
2067
+ onFilePathChange,
2068
+ isFileNodeVisible,
2069
+ hideToolFolders,
2070
+ initialBrowserSessionId,
2071
+ onBrowserSessionIdChange,
2072
+ initialComputerSessionId,
2073
+ onComputerSessionIdChange,
2074
+ onOpenComputerSession,
2075
+ requestedComputerSessionId,
2076
+ requestedComputerRequestId
2077
+ } = options;
2078
+ const initialTab = options.initialTab ?? null;
2079
+ const relevantOnly = options.tabVisibility === "relevant";
2080
+ const activeTab = options.activeTab ?? initialTab;
2081
+ const workspaceVisible = options.workspaceVisible ?? true;
2082
+ const machinesEnabled = options.machinesEnabled ?? true;
2083
+ const requestedSurfaces = options.surfaces ?? WORKBENCH_SURFACES;
2084
+ const surfaceSet = new Set(requestedSurfaces);
2085
+ const changesEnabled = surfaceSet.has(WORKBENCH_TAB_CHANGES);
2086
+ const filesEnabled = surfaceSet.has(WORKBENCH_TAB_FILES);
2087
+ const terminalEnabled = surfaceSet.has(WORKBENCH_TAB_TERMINAL);
2088
+ const browserEnabled = surfaceSet.has(WORKBENCH_TAB_BROWSER);
2089
+ const desktopEnabled = surfaceSet.has(WORKBENCH_TAB_DESKTOP);
2090
+ const createLinkedComputer = useCallback10(
2091
+ async (name, placement) => {
2092
+ const response = await client.createComputerSession(workspaceId, {
2093
+ operationId: crypto.randomUUID(),
2094
+ sessionId,
2095
+ name,
2096
+ ...placement ? { placement } : {}
2097
+ });
2098
+ if (response.operation.state !== "completed" || response.session.lifecycle !== "active") {
2099
+ throw new Error(
2100
+ response.operation.error?.message ?? t("sandboxWorkspace.theDesktopCouldNotBe")
2101
+ );
2102
+ }
2103
+ return {
2104
+ id: response.session.id,
2105
+ placement: response.session.placement
2106
+ };
2107
+ },
2108
+ [client, sessionId, workspaceId, t]
2109
+ );
2110
+ const workspaceDataEnabled = changesEnabled || filesEnabled;
2111
+ const machineSurfaceEnabled = workspaceDataEnabled || terminalEnabled || desktopEnabled;
2112
+ const resolvedActiveTab = activeTab ?? initialTab;
2113
+ const changesActive = resolvedActiveTab === WORKBENCH_TAB_CHANGES;
2114
+ const filesActive = resolvedActiveTab === WORKBENCH_TAB_FILES;
2115
+ const browserActive = resolvedActiveTab === WORKBENCH_TAB_BROWSER;
2116
+ const turnInFlight = workspaceTurnInFlight(events);
2117
+ const surfaceIdentity = WORKBENCH_SURFACES.filter((surface) => surfaceSet.has(surface)).join(",");
2118
+ const [storedWarmIntents, setStoredWarmIntents] = useState8(
2119
+ () => emptyWarmIntents(sessionId)
2120
+ );
2121
+ const warmIntents = storedWarmIntents.sessionId === sessionId ? storedWarmIntents : emptyWarmIntents(sessionId);
2122
+ const { warmTerminal, warmFiles } = warmIntents;
2123
+ const filesWarmRequested = warmFiles || Boolean(requestedFilePath);
2124
+ const requestWarmIntent = useCallback10(
2125
+ (intent) => {
2126
+ setStoredWarmIntents((previous) => {
2127
+ const current = previous.sessionId === sessionId ? previous : emptyWarmIntents(sessionId);
2128
+ return current[intent] ? current : { ...current, [intent]: true };
2129
+ });
2130
+ },
2131
+ [sessionId]
2132
+ );
2133
+ const machines = useMachines({
2134
+ workspaceId,
2135
+ sessionId,
2136
+ pollIntervalMs: MACHINES_SESSION_POLL_MS,
2137
+ enabled: machineSurfaceEnabled && machinesEnabled
2138
+ });
2139
+ const activeMachine = machines.machines.find((m) => m.sandboxId === machines.activeSandboxId) ?? machines.machines.find((m) => m.active) ?? null;
2140
+ const caps = useSessionCapabilities(sessionId, {
2141
+ events,
2142
+ enabled: machineSurfaceEnabled,
2143
+ attachDesktop: false,
2144
+ attachTerminal: terminalEnabled && warmTerminal,
2145
+ // Explicit live-file intent only — NOT "the Files tab is open". A cold edit
2146
+ // or guarded-file open wakes the box; a glance at the tree/diff does not.
2147
+ attachFiles: workspaceDataEnabled && filesWarmRequested
2148
+ });
2149
+ const capabilities = caps.capabilities;
2150
+ const liveness = capabilities?.liveness;
2151
+ const liveIoLiveness = liveness ?? null;
2152
+ const fileSystemOn = capabilities?.FileSystem.available ?? false;
2153
+ const fileSystemRoute = capabilities ? { epoch: capabilities.leaseEpoch, root: capabilities.FileSystem.root } : void 0;
2154
+ const fsReadOnly = capabilities?.FileSystem.readOnly ?? false;
2155
+ const filesEditable = fileSystemOn && !fsReadOnly && sandboxAcceptsLiveIo(liveness);
2156
+ const gitOn = capabilities?.Git.available ?? false;
2157
+ const terminalOn = terminalEnabled && (capabilities?.Terminal.transport ?? null) !== null;
2158
+ const ptyCapable = warmTerminal && (capabilities?.Terminal.ptyCapable ?? false) && capabilities?.Terminal.transport === "sse-events" && capabilities?.Terminal.reason === null;
2159
+ const terminalShown = terminalOn && workspaceVisible && resolvedActiveTab === WORKBENCH_TAB_TERMINAL;
2160
+ const [terminalOpenedSession, setTerminalOpenedSession] = useState8(null);
2161
+ useEffect8(() => {
2162
+ if (terminalShown) setTerminalOpenedSession(sessionId);
2163
+ }, [terminalShown, sessionId]);
2164
+ const terminal = useSandboxTerminal(sessionId, {
2165
+ events: terminalEnabled ? events : [],
2166
+ interactive: terminalEnabled && ptyCapable,
2167
+ liveness,
2168
+ history: terminalShown || terminalOpenedSession === sessionId
2169
+ });
2170
+ const provisioning = sandboxProvisionInFlight(events);
2171
+ const renegotiate = caps.renegotiate;
2172
+ const provisioningRef = useRef8({ sessionId, provisioning });
2173
+ useEffect8(() => {
2174
+ const previous = provisioningRef.current;
2175
+ if (previous.sessionId === sessionId && previous.provisioning && !provisioning) {
2176
+ renegotiate();
2177
+ }
2178
+ provisioningRef.current = { sessionId, provisioning };
2179
+ }, [sessionId, provisioning, renegotiate]);
2180
+ useEffect8(() => {
2181
+ if (workspaceInteractionEvent?.workspaceId !== workspaceId) return;
2182
+ renegotiate();
2183
+ }, [workspaceId, workspaceInteractionEvent, renegotiate]);
2184
+ const captureState = useWorkspaceCapture(sessionId, {
2185
+ events,
2186
+ enabled: workspaceDataEnabled
2187
+ });
2188
+ const captureAvailable = captureState.available;
2189
+ const liveWorkspaceExpected = sandboxAcceptsLiveIo(liveness);
2190
+ const capturePending = !liveWorkspaceExpected && (captureState.fileCount === null || captureState.loading);
2191
+ const repoPaths = useMemo5(() => {
2192
+ const advertised = capabilities?.Git.repos ?? [];
2193
+ if (advertised.length > 0) return advertised;
2194
+ return captureState.capture?.repos.map((repo) => repo.root) ?? [];
2195
+ }, [capabilities?.Git.repos, captureState.capture]);
2196
+ const files = useSandboxFiles(sessionId, {
2197
+ events,
2198
+ // No passive Channel-A reads while cold, even after a conclusive capture
2199
+ // miss. A missing capture gets an explicit "Open live workspace" gate.
2200
+ enabled: filesEnabled && (captureAvailable || fileSystemOn && liveWorkspaceExpected),
2201
+ // A cold sandbox can become warm while the first agent command still owns
2202
+ // startup. Do not race that command with an automatic Files read. Keeping
2203
+ // this fence at turn scope also avoids unsafe millisecond gaps between
2204
+ // sequential tool calls; rendered state and explicit user actions remain.
2205
+ active: filesActive && !turnInFlight,
2206
+ // A deliberate canonical absolute-path open browses in the selected target's
2207
+ // advertised namespace, so the authoritative tree and link share exact paths.
2208
+ ...isCanonicalAbsoluteSandboxPath(requestedFilePath) && capabilities?.FileSystem.root ? { rootPath: capabilities.FileSystem.root } : {},
2209
+ ...fileSystemRoute ? { route: fileSystemRoute } : {},
2210
+ repoPaths,
2211
+ liveness: liveIoLiveness,
2212
+ capture: captureState.capture,
2213
+ // A reverted optimistic mutation (e.g. a 409 rename collision) surfaces as a
2214
+ // host notification — the tree silently rolls back, the user sees why.
2215
+ onMutationError: (error, op) => onNotify?.({
2216
+ kind: "error",
2217
+ message: t("sandboxWorkspace.couldNotOpMessage", { op, message: error.message })
2218
+ })
2219
+ });
2220
+ const [storedChangesComparison, setStoredChangesComparison] = useState8(null);
2221
+ const captureSupportsBranch = captureState.capture !== null && captureState.capture.repos.length > 0 && captureState.capture.repos.every((repo) => repo.branchDiff !== void 0);
2222
+ const changesComparison = storedChangesComparison?.sessionId === sessionId ? storedChangesComparison.value : liveWorkspaceExpected || captureSupportsBranch ? "branch" : "working";
2223
+ const setChangesComparison = useCallback10(
2224
+ (value) => setStoredChangesComparison({ sessionId, value, picked: true }),
2225
+ [sessionId]
2226
+ );
2227
+ const git = useSandboxGit(sessionId, {
2228
+ events,
2229
+ enabled: changesComparison === "working" ? workspaceDataEnabled && (captureAvailable || gitOn && liveWorkspaceExpected) : changesComparison === "branch" ? workspaceDataEnabled && (captureSupportsBranch || gitOn && liveWorkspaceExpected) : workspaceDataEnabled && gitOn && liveWorkspaceExpected,
2230
+ // Live Git belongs to the visible Changes surface. In particular, do not
2231
+ // turn an unresolved/default tab into a hidden provider read: that races the
2232
+ // agent's own sandbox commands and used to refresh after every tool output
2233
+ // even while Files was visibly selected.
2234
+ active: changesActive && !turnInFlight,
2235
+ repoPaths,
2236
+ liveness: liveIoLiveness,
2237
+ comparison: changesComparison,
2238
+ capture: changesComparison === "staged" ? null : captureState.capture
2239
+ });
2240
+ useEffect8(() => {
2241
+ if (changesComparison === "branch" && git.error && storedChangesComparison?.sessionId !== sessionId) {
2242
+ setStoredChangesComparison({ sessionId, value: "working", picked: false });
2243
+ }
2244
+ }, [changesComparison, git.error, sessionId, storedChangesComparison?.sessionId]);
2245
+ const [xtermTheme, setXtermTheme] = useState8(void 0);
2246
+ useEffect8(() => {
2247
+ if (!terminalEnabled || typeof document === "undefined") return;
2248
+ const derive = () => setXtermTheme(xtermThemeFromTokens());
2249
+ derive();
2250
+ const observer = new MutationObserver(derive);
2251
+ observer.observe(document.documentElement, {
2252
+ attributes: true,
2253
+ attributeFilter: ["data-og-theme", "class"]
2254
+ });
2255
+ return () => observer.disconnect();
2256
+ }, [terminalEnabled]);
2257
+ const dirtyCount = git.diff.length;
2258
+ const eventsShowChanges = useMemo5(
2259
+ () => relevantOnly && initialWorkspaceTab(events) === WORKBENCH_TAB_CHANGES,
2260
+ [events, relevantOnly]
2261
+ );
2262
+ const chip = useMachineChip({
2263
+ liveness,
2264
+ capabilitiesState: caps.state,
2265
+ activeMachineState: activeMachine?.state ?? null,
2266
+ activeIsSelfhosted: activeMachine?.kind === "selfhosted",
2267
+ wantsWarm: terminalEnabled && warmTerminal || workspaceDataEnabled && filesWarmRequested,
2268
+ capturedAt: captureState.capturedAt
2269
+ });
2270
+ const workspaceWaking = chip.state === "waking";
2271
+ const defaultIdentity = `${sessionId}\0${surfaceIdentity}`;
2272
+ const defaultTabRef = useRef8({
2273
+ identity: defaultIdentity,
2274
+ value: null
2275
+ });
2276
+ if (defaultTabRef.current.identity !== defaultIdentity) {
2277
+ defaultTabRef.current = { identity: defaultIdentity, value: null };
2278
+ }
2279
+ const captureHasChanges = (captureState.fileCount ?? 0) > 0 || (captureState.capture?.repos.some((repo) => (repo.branchDiff?.length ?? 0) > 0) ?? false);
2280
+ const captureUnavailable = !captureState.loading && (captureState.fileCount === 0 && !captureHasChanges || captureState.error !== null);
2281
+ if (defaultTabRef.current.value === null) {
2282
+ if (initialTab && (!isWorkbenchSurface(initialTab) || surfaceSet.has(initialTab))) {
2283
+ defaultTabRef.current.value = initialTab;
2284
+ } else if (captureState.fileCount !== null && captureState.available) {
2285
+ defaultTabRef.current.value = sourceDrivenDefaultTab(
2286
+ captureHasChanges,
2287
+ changesEnabled,
2288
+ filesEnabled
2289
+ );
2290
+ } else if (captureUnavailable && initialWorkspaceTab(events) === WORKBENCH_TAB_CHANGES) {
2291
+ defaultTabRef.current.value = sourceDrivenDefaultTab(true, changesEnabled, filesEnabled);
2292
+ } else if (!captureState.loading && (captureState.fileCount !== null || captureState.error !== null)) {
2293
+ defaultTabRef.current.value = sourceDrivenDefaultTab(false, changesEnabled, filesEnabled);
2294
+ }
2295
+ }
2296
+ const defaultTab = defaultTabRef.current.value;
2297
+ const pullRequestUrl = pullRequest?.url;
2298
+ const pullRequestNumber = pullRequest?.number;
2299
+ const stablePullRequest = useMemo5(
2300
+ () => pullRequestUrl ? {
2301
+ url: pullRequestUrl,
2302
+ ...pullRequestNumber !== void 0 ? { number: pullRequestNumber } : {}
2303
+ } : null,
2304
+ [pullRequestUrl, pullRequestNumber]
2305
+ );
2306
+ const wakeFiles = useCallback10(() => requestWarmIntent("warmFiles"), [requestWarmIntent]);
2307
+ const openGuardedFile = useCallback10(
2308
+ (path) => {
2309
+ requestWarmIntent("warmFiles");
2310
+ onOpenFile?.(path);
2311
+ },
2312
+ [requestWarmIntent, onOpenFile]
2313
+ );
2314
+ const tabs = useMemo5(() => {
2315
+ const list = [];
2316
+ if (changesEnabled)
2317
+ list.push({
2318
+ id: WORKBENCH_TAB_CHANGES,
2319
+ label: t("sandboxWorkspace.changes"),
2320
+ icon: /* @__PURE__ */ jsx4(GitCompareArrowsIcon, {}),
2321
+ badge: dirtyCount > 0 && !relevantOnly ? /* @__PURE__ */ jsx4(DirtyBadge, { count: dirtyCount }) : void 0,
2322
+ // A comparison the person picked keeps Changes on the strip, even
2323
+ // when that comparison happens to be empty.
2324
+ ...relevantOnly && dirtyCount === 0 && !captureHasChanges && !eventsShowChanges && !(storedChangesComparison?.sessionId === sessionId && storedChangesComparison.picked) ? { optional: true, inMenu: true } : {},
2325
+ content: /* @__PURE__ */ jsx4(
2326
+ ChangesTabBody,
2327
+ {
2328
+ git,
2329
+ comparison: changesComparison,
2330
+ onComparisonChange: setChangesComparison,
2331
+ captureAvailable,
2332
+ captureDegraded: captureState.degradedReason !== null,
2333
+ captureRevision: captureState.revision,
2334
+ capturePending,
2335
+ liveWorkspaceExpected,
2336
+ workspaceWaking,
2337
+ capabilitiesState: caps.state,
2338
+ capabilitiesError: caps.error,
2339
+ onRetry: caps.renegotiate,
2340
+ onWake: wakeFiles,
2341
+ ...filesEnabled && onOpenFile ? { onOpenFile: openGuardedFile } : {},
2342
+ pullRequest: stablePullRequest,
2343
+ ...onOpenPullRequest ? { onOpenPullRequest } : {},
2344
+ navigation: relevantOnly ? "tree" : "rail"
2345
+ }
2346
+ )
2347
+ });
2348
+ if (filesEnabled)
2349
+ list.push({
2350
+ id: WORKBENCH_TAB_FILES,
2351
+ label: t("sandboxWorkspace.files"),
2352
+ icon: /* @__PURE__ */ jsx4(FileCode2Icon, {}),
2353
+ ...relevantOnly ? { optional: true } : {},
2354
+ content: /* @__PURE__ */ jsx4(
2355
+ FilesTabBody,
2356
+ {
2357
+ files,
2358
+ git,
2359
+ isNodeVisible: isFileNodeVisible,
2360
+ hideToolFolders,
2361
+ fileSystemAvailable: fileSystemOn || captureAvailable,
2362
+ editable: filesEditable && files.source === "live" && files.error === null && !files.loading,
2363
+ workspaceResting: !liveWorkspaceExpected && liveness !== void 0 && !capturePending && !captureAvailable && !workspaceWaking,
2364
+ workspaceWaking: !liveWorkspaceExpected && !captureAvailable && workspaceWaking,
2365
+ liveWorkspaceReady: liveWorkspaceExpected,
2366
+ workspaceError: caps.error ?? (caps.viewerCapReached ? new Error(
2367
+ caps.viewerCapReason === "computers" ? t("sandboxWorkspace.tooManyComputersRunningWithoutTask") : t("sandboxWorkspace.theLiveWorkspaceViewerLimit")
2368
+ ) : filesWarmRequested && caps.state === "on-demand" && !fileSystemOn ? new Error(t("sandboxWorkspace.thisMachineDoesNotCurrently")) : null),
2369
+ onWakeWorkspace: () => {
2370
+ if (filesWarmRequested) caps.renegotiate();
2371
+ else requestWarmIntent("warmFiles");
2372
+ },
2373
+ ...requestedFilePath ? {
2374
+ requestedPath: requestedFilePath,
2375
+ ...requestedFileRequestId !== null && requestedFileRequestId !== void 0 ? { requestedPathRequestId: requestedFileRequestId } : {},
2376
+ requestedPathReady: sandboxAcceptsLiveIo(liveness),
2377
+ ...requestedFileLine != null && requestedFileLine > 0 ? { requestedLine: requestedFileLine } : {}
2378
+ } : {},
2379
+ onEditIntent: () => requestWarmIntent("warmFiles"),
2380
+ initialSelectedPath: initialFilePath,
2381
+ onSelectedPathChange: onFilePathChange,
2382
+ className: "h-full"
2383
+ },
2384
+ sessionId
2385
+ )
2386
+ });
2387
+ if (terminalOn) {
2388
+ list.push({
2389
+ id: WORKBENCH_TAB_TERMINAL,
2390
+ label: t("sandboxWorkspace.terminal"),
2391
+ icon: /* @__PURE__ */ jsx4(SquareTerminalIcon, {}),
2392
+ ...relevantOnly ? { optional: true } : {},
2393
+ content: /* @__PURE__ */ jsx4("div", { className: "h-full bg-og-bg p-1", children: /* @__PURE__ */ jsx4(
2394
+ SandboxTerminal,
2395
+ {
2396
+ result: terminal,
2397
+ terminalCapability: capabilities?.Terminal ?? null,
2398
+ onActivate: () => requestWarmIntent("warmTerminal"),
2399
+ onReconnectNeeded: caps.renegotiate,
2400
+ showHeader: true,
2401
+ shell: capabilities?.Terminal.shell ?? void 0,
2402
+ liveness,
2403
+ ...xtermTheme ? { theme: xtermTheme } : {}
2404
+ },
2405
+ sessionId
2406
+ ) })
2407
+ });
2408
+ }
2409
+ if (browserEnabled) {
2410
+ list.push({
2411
+ id: WORKBENCH_TAB_BROWSER,
2412
+ label: t("sandboxWorkspace.browser"),
2413
+ icon: /* @__PURE__ */ jsx4(Globe2Icon, {}),
2414
+ ...relevantOnly ? { optional: true } : {},
2415
+ content: /* @__PURE__ */ jsx4(Suspense, { fallback: /* @__PURE__ */ jsx4(WorkbenchSurfaceLoading, { name: "Browser" }), children: /* @__PURE__ */ jsx4(
2416
+ LazyBrowserViewer,
2417
+ {
2418
+ client,
2419
+ workspaceId,
2420
+ sessionId,
2421
+ enabled: workspaceVisible,
2422
+ active: browserActive,
2423
+ onNotify,
2424
+ initialBrowserSessionId,
2425
+ onBrowserSessionIdChange,
2426
+ ...desktopEnabled ? { createLinkedComputer } : {},
2427
+ ...onOpenComputerSession ? { onOpenComputer: onOpenComputerSession } : {},
2428
+ ...browserWebSocketFactory ? { webSocketFactory: browserWebSocketFactory } : {},
2429
+ ...browserExtensionSetupUrl ? { browserExtensionSetupUrl } : {},
2430
+ className: "h-full"
2431
+ },
2432
+ sessionId
2433
+ ) })
2434
+ });
2435
+ }
2436
+ if (desktopEnabled) {
2437
+ list.push({
2438
+ id: WORKBENCH_TAB_DESKTOP,
2439
+ label: t("sandboxWorkspace.desktop"),
2440
+ icon: /* @__PURE__ */ jsx4(MonitorIcon, {}),
2441
+ ...relevantOnly ? { optional: true } : {},
2442
+ content: /* @__PURE__ */ jsx4(Suspense, { fallback: /* @__PURE__ */ jsx4(WorkbenchSurfaceLoading, { name: "Desktop" }), children: /* @__PURE__ */ jsx4(
2443
+ LazyComputerViewer,
2444
+ {
2445
+ client,
2446
+ workspaceId,
2447
+ sessionId,
2448
+ enabled: workspaceVisible,
2449
+ onNotify,
2450
+ initialComputerSessionId,
2451
+ onComputerSessionIdChange,
2452
+ requestedComputerSessionId,
2453
+ requestedComputerRequestId,
2454
+ ...computerWebSocketFactory ? { webSocketFactory: computerWebSocketFactory } : {},
2455
+ className: "h-full"
2456
+ },
2457
+ sessionId
2458
+ ) })
2459
+ });
2460
+ }
2461
+ return list;
2462
+ }, [
2463
+ fileSystemOn,
2464
+ changesEnabled,
2465
+ filesEnabled,
2466
+ terminalOn,
2467
+ browserEnabled,
2468
+ desktopEnabled,
2469
+ captureAvailable,
2470
+ captureState.degradedReason,
2471
+ dirtyCount,
2472
+ captureHasChanges,
2473
+ eventsShowChanges,
2474
+ storedChangesComparison,
2475
+ relevantOnly,
2476
+ warmTerminal,
2477
+ requestedFilePath,
2478
+ requestedFileRequestId,
2479
+ requestedFileLine,
2480
+ onOpenFile,
2481
+ stablePullRequest,
2482
+ onOpenPullRequest,
2483
+ initialFilePath,
2484
+ onFilePathChange,
2485
+ isFileNodeVisible,
2486
+ hideToolFolders,
2487
+ initialBrowserSessionId,
2488
+ onBrowserSessionIdChange,
2489
+ initialComputerSessionId,
2490
+ onComputerSessionIdChange,
2491
+ onOpenComputerSession,
2492
+ requestedComputerSessionId,
2493
+ requestedComputerRequestId,
2494
+ onNotify,
2495
+ browserWebSocketFactory,
2496
+ computerWebSocketFactory,
2497
+ workspaceVisible,
2498
+ // Only Browser reads which tab is active: switching between the other
2499
+ // tabs must not rebuild (and re-render) every panel.
2500
+ browserActive,
2501
+ client,
2502
+ workspaceId,
2503
+ liveness,
2504
+ sessionId,
2505
+ files,
2506
+ git,
2507
+ changesComparison,
2508
+ terminal,
2509
+ xtermTheme,
2510
+ capabilities,
2511
+ workspaceWaking,
2512
+ caps.state,
2513
+ caps.error,
2514
+ caps.viewerCapReached,
2515
+ caps.viewerCapReason,
2516
+ caps.renegotiate,
2517
+ filesWarmRequested,
2518
+ requestWarmIntent,
2519
+ wakeFiles,
2520
+ openGuardedFile,
2521
+ createLinkedComputer,
2522
+ t
2523
+ ]);
2524
+ return {
2525
+ tabs,
2526
+ defaultTab,
2527
+ machine: {
2528
+ enabled: machineSurfaceEnabled,
2529
+ chip,
2530
+ activeMachine,
2531
+ loading: machines.loading,
2532
+ error: machines.error,
2533
+ refresh: machines.refresh
2534
+ }
2535
+ };
2536
+ }
2537
+ function SandboxWorkspace(props) {
2538
+ const {
2539
+ sessionId,
2540
+ events,
2541
+ primary,
2542
+ surfaces,
2543
+ machinesEnabled,
2544
+ leadingTabs,
2545
+ trailingTabs,
2546
+ initialTab,
2547
+ tabVisibility,
2548
+ onActiveTabChange,
2549
+ onStripEmptied,
2550
+ openTabRequest,
2551
+ initialFilePath,
2552
+ onFilePathChange,
2553
+ isFileNodeVisible,
2554
+ hideToolFolders,
2555
+ openFileRequest,
2556
+ initialBrowserSessionId,
2557
+ onBrowserSessionIdChange,
2558
+ initialComputerSessionId,
2559
+ onComputerSessionIdChange,
2560
+ onNotify,
2561
+ browserWebSocketFactory,
2562
+ computerWebSocketFactory,
2563
+ browserExtensionSetupUrl,
2564
+ pullRequest,
2565
+ onOpenPullRequest,
2566
+ collapsed,
2567
+ onCollapsedChange,
2568
+ showCollapseControl,
2569
+ mobileLeadingControl,
2570
+ autoSaveId,
2571
+ defaultSize,
2572
+ minSize,
2573
+ maxSize,
2574
+ className
2575
+ } = props;
2576
+ const [storedSelection, setStoredSelection] = useState8(null);
2577
+ const [requestedFile, setRequestedFile] = useState8(null);
2578
+ const [requestedComputer, setRequestedComputer] = useState8(null);
2579
+ const nextFileRequestId = useRef8(0);
2580
+ const nextComputerRequestId = useRef8(0);
2581
+ const selectedTab = storedSelection?.sessionId === sessionId ? storedSelection.tab : null;
2582
+ const [shownTab, setShownTab] = useState8(null);
2583
+ const handledTabRequest = useRef8(null);
2584
+ useEffect8(() => {
2585
+ if (!openTabRequest || handledTabRequest.current?.sessionId === sessionId && handledTabRequest.current.requestId === openTabRequest.requestId)
2586
+ return;
2587
+ const available = [...leadingTabs ?? [], ...trailingTabs ?? []].some(
2588
+ (tab) => tab.id === openTabRequest.tab
2589
+ ) || (surfaces ?? WORKBENCH_SURFACES).some((tab) => tab === openTabRequest.tab);
2590
+ if (!available) return;
2591
+ handledTabRequest.current = { sessionId, requestId: openTabRequest.requestId };
2592
+ setStoredSelection({ sessionId, tab: openTabRequest.tab, picked: true });
2593
+ onActiveTabChange?.(openTabRequest.tab);
2594
+ if (openTabRequest.expand !== false) onCollapsedChange?.(false);
2595
+ }, [
2596
+ openTabRequest,
2597
+ sessionId,
2598
+ leadingTabs,
2599
+ trailingTabs,
2600
+ surfaces,
2601
+ onActiveTabChange,
2602
+ onCollapsedChange
2603
+ ]);
2604
+ const activeTabHint = selectedTab ?? initialTab ?? leadingTabs?.[0]?.id ?? null;
2605
+ const openFile = useCallback10(
2606
+ (path, line) => {
2607
+ setRequestedFile({
2608
+ sessionId,
2609
+ path,
2610
+ line: line != null && line > 0 ? line : null,
2611
+ requestId: ++nextFileRequestId.current
2612
+ });
2613
+ setStoredSelection({ sessionId, tab: WORKBENCH_TAB_FILES, picked: true });
2614
+ onActiveTabChange?.(WORKBENCH_TAB_FILES);
2615
+ onFilePathChange?.(path);
2616
+ onCollapsedChange?.(false);
2617
+ },
2618
+ [onActiveTabChange, onCollapsedChange, onFilePathChange, sessionId]
2619
+ );
2620
+ const handledOpenFileRequestId = useRef8(null);
2621
+ useEffect8(() => {
2622
+ if (!openFileRequest) return;
2623
+ if (handledOpenFileRequestId.current === openFileRequest.requestId) return;
2624
+ handledOpenFileRequestId.current = openFileRequest.requestId;
2625
+ openFile(openFileRequest.path, openFileRequest.line);
2626
+ }, [openFile, openFileRequest]);
2627
+ const openComputer = useCallback10(
2628
+ (computerSessionId) => {
2629
+ nextComputerRequestId.current += 1;
2630
+ setRequestedComputer({
2631
+ sessionId,
2632
+ computerSessionId,
2633
+ requestId: nextComputerRequestId.current
2634
+ });
2635
+ setStoredSelection({ sessionId, tab: WORKBENCH_TAB_DESKTOP, picked: true });
2636
+ onActiveTabChange?.(WORKBENCH_TAB_DESKTOP);
2637
+ onComputerSessionIdChange?.(computerSessionId);
2638
+ },
2639
+ [onActiveTabChange, onComputerSessionIdChange, sessionId]
2640
+ );
2641
+ const {
2642
+ tabs: workbenchTabs,
2643
+ machine,
2644
+ defaultTab
2645
+ } = useSandboxWorkspaceTabs({
2646
+ ...props.client ? { client: props.client } : {},
2647
+ ...props.workspaceId ? { workspaceId: props.workspaceId } : {},
2648
+ sessionId,
2649
+ events,
2650
+ ...surfaces ? { surfaces } : {},
2651
+ ...machinesEnabled !== void 0 ? { machinesEnabled } : {},
2652
+ ...initialTab ? { initialTab } : {},
2653
+ ...tabVisibility ? { tabVisibility } : {},
2654
+ activeTab: shownTab?.sessionId === sessionId ? shownTab.tab : activeTabHint,
2655
+ workspaceVisible: collapsed !== true,
2656
+ ...onNotify ? { onNotify } : {},
2657
+ ...browserWebSocketFactory ? { browserWebSocketFactory } : {},
2658
+ ...computerWebSocketFactory ? { computerWebSocketFactory } : {},
2659
+ ...browserExtensionSetupUrl ? { browserExtensionSetupUrl } : {},
2660
+ ...pullRequest ? { pullRequest } : {},
2661
+ ...onOpenPullRequest ? { onOpenPullRequest } : {},
2662
+ initialFilePath,
2663
+ onFilePathChange,
2664
+ isFileNodeVisible,
2665
+ hideToolFolders,
2666
+ initialBrowserSessionId,
2667
+ onBrowserSessionIdChange,
2668
+ initialComputerSessionId,
2669
+ onComputerSessionIdChange,
2670
+ requestedFilePath: requestedFile?.sessionId === sessionId ? requestedFile.path : null,
2671
+ requestedFileRequestId: requestedFile?.sessionId === sessionId ? requestedFile.requestId : null,
2672
+ requestedFileLine: requestedFile?.sessionId === sessionId ? requestedFile.line : null,
2673
+ onOpenFile: openFile,
2674
+ onOpenComputerSession: openComputer,
2675
+ requestedComputerSessionId: requestedComputer?.sessionId === sessionId ? requestedComputer.computerSessionId : null,
2676
+ requestedComputerRequestId: requestedComputer?.sessionId === sessionId ? requestedComputer.requestId : null
2677
+ });
2678
+ const tabs = [...leadingTabs ?? [], ...workbenchTabs, ...trailingTabs ?? []];
2679
+ const preferredTab = selectedTab ?? defaultTab;
2680
+ const preferredOptional = tabVisibility === "relevant" && !(storedSelection?.sessionId === sessionId && storedSelection.picked === true) && tabs.some((tab) => tab.id === preferredTab && tab.optional);
2681
+ const firstWithContent = preferredOptional ? tabs.find((tab) => !tab.optional) : void 0;
2682
+ const activeTab = firstWithContent ? firstWithContent.id : preferredTab && tabs.some((tab) => tab.id === preferredTab) ? preferredTab : tabs[0]?.id;
2683
+ const selectTab = useCallback10(
2684
+ (tab) => {
2685
+ setStoredSelection({ sessionId, tab, picked: true });
2686
+ onActiveTabChange?.(tab);
2687
+ },
2688
+ [onActiveTabChange, sessionId]
2689
+ );
2690
+ useEffect8(() => {
2691
+ if (selectedTab !== null || defaultTab === null) return;
2692
+ setStoredSelection({ sessionId, tab: defaultTab, picked: Boolean(initialTab) });
2693
+ }, [defaultTab, initialTab, selectedTab, sessionId]);
2694
+ const picked = storedSelection?.sessionId === sessionId && storedSelection.picked === true;
2695
+ const landingShown = tabVisibility === "relevant" && !picked && tabs.length > 0 && tabs.every((tab) => tab.optional);
2696
+ const shownNow = landingShown ? "" : activeTab ?? null;
2697
+ useEffect8(() => {
2698
+ if (shownNow === null) return;
2699
+ setShownTab(
2700
+ (previous) => previous?.sessionId === sessionId && previous.tab === shownNow ? previous : { sessionId, tab: shownNow }
2701
+ );
2702
+ }, [sessionId, shownNow]);
2703
+ const backToLanding = useCallback10(() => {
2704
+ setStoredSelection(
2705
+ (previous) => previous?.sessionId === sessionId ? { ...previous, picked: false } : previous
2706
+ );
2707
+ onStripEmptied?.();
2708
+ }, [onStripEmptied, sessionId]);
2709
+ return /* @__PURE__ */ jsx4(
2710
+ WorkspaceDock,
2711
+ {
2712
+ primary,
2713
+ tabs,
2714
+ ...activeTab !== void 0 ? { activeTab } : {},
2715
+ onActiveTabChange: selectTab,
2716
+ essentials: tabVisibility === "relevant",
2717
+ ...tabVisibility === "relevant" ? { landing: !picked, onStripEmptied: backToLanding } : {},
2718
+ ...sessionId ? { tabScope: sessionId } : {},
2719
+ ...machine.enabled && activeTab !== WORKBENCH_TAB_BROWSER && activeTab !== WORKBENCH_TAB_DESKTOP ? {
2720
+ headerAccessory: /* @__PURE__ */ jsx4(MachineStateChip, { chip: machine.chip }),
2721
+ // Waking or an unreachable machine is worth seeing without opening
2722
+ // the menu; a sleeping box is ordinary.
2723
+ headerAccessoryPinned: machine.chip.state === "waking" || machine.chip.unreachable === true
2724
+ } : {},
2725
+ ...mobileLeadingControl !== void 0 ? { mobileLeadingControl } : {},
2726
+ ...collapsed !== void 0 ? { collapsed } : {},
2727
+ ...onCollapsedChange ? { onCollapsedChange } : {},
2728
+ ...showCollapseControl !== void 0 ? { showCollapseControl } : {},
2729
+ ...autoSaveId !== void 0 ? { autoSaveId } : {},
2730
+ ...defaultSize !== void 0 ? { defaultSize } : {},
2731
+ ...minSize !== void 0 ? { minSize } : {},
2732
+ ...maxSize !== void 0 ? { maxSize } : {},
2733
+ ...className !== void 0 ? { className } : {}
2734
+ }
2735
+ );
2736
+ }
2737
+ function DirtyBadge({ count }) {
2738
+ return /* @__PURE__ */ jsx4("span", { className: "rounded-og-xs bg-og-accent-soft px-1 text-og-xs text-og-fg-muted", children: count });
2739
+ }
2740
+ function chipDotClass(state) {
2741
+ if (state === "live") return "bg-og-status-running";
2742
+ if (state === "waking") return "bg-og-status-idle animate-pulse motion-reduce:animate-none";
2743
+ return "bg-og-fg-subtle";
2744
+ }
2745
+ function MachineStateChip({ chip }) {
2746
+ const t = useOpenGeniText();
2747
+ return /* @__PURE__ */ jsxs3(
2748
+ "div",
2749
+ {
2750
+ role: "status",
2751
+ "aria-label": t("sandboxWorkspace.machineLabel", { label: chip.label }),
2752
+ title: chip.label,
2753
+ className: "inline-flex min-h-7 min-w-0 max-w-full items-center gap-1.5 px-2 py-1 text-og-xs font-medium text-og-fg-muted max-[1023px]:min-h-11 pointer-coarse:min-h-11",
2754
+ children: [
2755
+ /* @__PURE__ */ jsx4(
2756
+ "span",
2757
+ {
2758
+ className: cn("size-1.5 shrink-0 rounded-full", chipDotClass(chip.state)),
2759
+ "aria-hidden": true
2760
+ }
2761
+ ),
2762
+ /* @__PURE__ */ jsx4("span", { "data-contrast-audited": true, className: "min-w-0 max-w-[11rem] truncate", children: chip.label })
2763
+ ]
2764
+ }
2765
+ );
2766
+ }
2767
+ function DockActionButton({ onClick, children }) {
2768
+ return /* @__PURE__ */ jsx4(
2769
+ "button",
2770
+ {
2771
+ type: "button",
2772
+ onClick,
2773
+ className: "inline-flex items-center gap-1.5 rounded-og-sm border border-og-border px-2 py-1 text-og-xs font-medium text-og-fg-muted transition-colors hover:border-og-border-strong hover:text-og-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent max-[1023px]:min-h-11 pointer-coarse:min-h-11",
2774
+ children
2775
+ }
2776
+ );
2777
+ }
2778
+ var ChangesTabBody = memo(function ChangesTabBody2({
2779
+ comparison,
2780
+ onComparisonChange,
2781
+ ...props
2782
+ }) {
2783
+ const t = useOpenGeniText();
2784
+ const picker = useMemo5(
2785
+ () => ({
2786
+ value: comparison,
2787
+ options: [
2788
+ { value: "branch", label: t("sandboxWorkspace.branch") },
2789
+ { value: "working", label: t("sandboxWorkspace.uncommitted") },
2790
+ { value: "staged", label: t("sandboxWorkspace.staged") }
2791
+ ],
2792
+ onChange: (value) => onComparisonChange(value)
2793
+ }),
2794
+ [comparison, onComparisonChange, t]
2795
+ );
2796
+ if (props.git.diff.length > 0) {
2797
+ return /* @__PURE__ */ jsx4("div", { className: "h-full min-h-0", children: /* @__PURE__ */ jsx4(ChangesTabContent, { comparison, picker, ...props }) });
2798
+ }
2799
+ return /* @__PURE__ */ jsxs3("div", { className: "flex h-full min-h-0 flex-col", children: [
2800
+ /* @__PURE__ */ jsx4("div", { className: "flex min-h-9 shrink-0 items-center border-b border-og-border px-2 py-1", children: /* @__PURE__ */ jsx4(WorkbenchChangesViewMenu, { comparison: picker }) }),
2801
+ /* @__PURE__ */ jsx4("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx4(ChangesTabContent, { comparison, picker, ...props }) })
2802
+ ] });
2803
+ });
2804
+ function ChangesTabContent({
2805
+ git,
2806
+ comparison,
2807
+ picker,
2808
+ captureAvailable,
2809
+ captureDegraded,
2810
+ captureRevision,
2811
+ capturePending,
2812
+ liveWorkspaceExpected,
2813
+ workspaceWaking,
2814
+ capabilitiesState,
2815
+ capabilitiesError,
2816
+ onRetry,
2817
+ onWake,
2818
+ onOpenFile,
2819
+ pullRequest,
2820
+ onOpenPullRequest,
2821
+ navigation
2822
+ }) {
2823
+ const t = useOpenGeniText();
2824
+ const diff = git.diff;
2825
+ if (diff.length > 0) {
2826
+ return /* @__PURE__ */ jsxs3("div", { className: "flex h-full min-h-0 flex-col", children: [
2827
+ git.error ? /* @__PURE__ */ jsxs3(
2828
+ "div",
2829
+ {
2830
+ role: "status",
2831
+ "aria-live": "polite",
2832
+ "data-opengeni-changes-degraded": true,
2833
+ className: "flex shrink-0 items-center gap-2 border-b border-og-status-running/30 bg-og-status-running/10 px-2 py-1.5 text-og-xs text-og-fg-muted",
2834
+ children: [
2835
+ /* @__PURE__ */ jsx4(TriangleAlertIcon, { className: "size-3.5 shrink-0 text-og-status-running", "aria-hidden": true }),
2836
+ /* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1", children: git.source === "capture" ? t("sandboxWorkspace.liveChangesAreTemporarilyUnavailable") : t("sandboxWorkspace.liveRefreshFailedShowingThe") }),
2837
+ /* @__PURE__ */ jsxs3(
2838
+ "button",
2839
+ {
2840
+ type: "button",
2841
+ onClick: () => void git.refresh(),
2842
+ disabled: git.loading,
2843
+ className: "inline-flex min-h-7 shrink-0 items-center gap-1 rounded-og-sm border border-og-border bg-og-surface-1 px-2 font-medium text-og-fg transition-colors hover:border-og-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:min-h-11",
2844
+ children: [
2845
+ /* @__PURE__ */ jsx4(
2846
+ RefreshCwIcon,
2847
+ {
2848
+ className: cn("size-3", git.loading && "animate-spin motion-reduce:animate-none"),
2849
+ "aria-hidden": true
2850
+ }
2851
+ ),
2852
+ t("sandboxWorkspace.retry")
2853
+ ]
2854
+ }
2855
+ )
2856
+ ]
2857
+ }
2858
+ ) : null,
2859
+ /* @__PURE__ */ jsx4("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx4(
2860
+ WorkbenchChanges,
2861
+ {
2862
+ diff,
2863
+ source: git.source,
2864
+ capturedAt: git.capturedAt,
2865
+ captureRevision,
2866
+ ...onOpenFile ? { onOpenFile } : {},
2867
+ pullRequest: pullRequest ?? null,
2868
+ ...onOpenPullRequest ? { onOpenPullRequest } : {},
2869
+ comparison: picker,
2870
+ ...navigation ? { navigation } : {}
2871
+ }
2872
+ ) })
2873
+ ] });
2874
+ }
2875
+ if (capabilitiesError && !captureAvailable) {
2876
+ return /* @__PURE__ */ jsxs3(CenteredState, { icon: /* @__PURE__ */ jsx4(TriangleAlertIcon, { className: "size-5", "aria-hidden": true }), tone: "danger", children: [
2877
+ /* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: t("sandboxWorkspace.sandboxUnavailable") }),
2878
+ /* @__PURE__ */ jsx4("p", { "data-contrast-audited": true, className: "text-og-sm leading-5 text-og-fg-muted", children: capabilitiesError.message || t("sandboxWorkspace.couldnTReachTheSandbox") }),
2879
+ /* @__PURE__ */ jsxs3(DockActionButton, { onClick: onRetry, children: [
2880
+ /* @__PURE__ */ jsx4(RefreshCwIcon, { className: "size-3" }),
2881
+ t("sandboxWorkspace.retry")
2882
+ ] })
2883
+ ] });
2884
+ }
2885
+ if ((capturePending || capabilitiesState === "negotiating") && !captureAvailable && !workspaceWaking) {
2886
+ return /* @__PURE__ */ jsxs3(
2887
+ CenteredState,
2888
+ {
2889
+ icon: /* @__PURE__ */ jsx4(
2890
+ LoaderCircleIcon,
2891
+ {
2892
+ className: "size-5 animate-spin motion-reduce:animate-none",
2893
+ "aria-hidden": true
2894
+ }
2895
+ ),
2896
+ children: [
2897
+ /* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: t("sandboxWorkspace.connectingWorkspace") }),
2898
+ /* @__PURE__ */ jsx4("p", { className: "text-og-sm leading-5 text-og-fg-subtle", children: t("sandboxWorkspace.lookingForTheLatestFiles") })
2899
+ ]
2900
+ }
2901
+ );
2902
+ }
2903
+ if (!liveWorkspaceExpected && (comparison !== "working" || !captureAvailable)) {
2904
+ const previewUnavailable = captureDegraded && !captureAvailable && comparison !== "staged";
2905
+ return /* @__PURE__ */ jsxs3(
2906
+ CenteredState,
2907
+ {
2908
+ icon: workspaceWaking ? /* @__PURE__ */ jsx4(
2909
+ LoaderCircleIcon,
2910
+ {
2911
+ className: "size-5 animate-spin motion-reduce:animate-none",
2912
+ "aria-hidden": true
2913
+ }
2914
+ ) : previewUnavailable ? /* @__PURE__ */ jsx4(TriangleAlertIcon, { className: "size-5", "aria-hidden": true }) : /* @__PURE__ */ jsx4(CpuIcon, { className: "size-5", "aria-hidden": true }),
2915
+ children: [
2916
+ /* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: workspaceWaking ? t("sandboxWorkspace.wakingWorkspace") : previewUnavailable ? t("sandboxWorkspace.savedChangesPreviewIsUnavailable") : t("sandboxWorkspace.workspaceIsResting") }),
2917
+ /* @__PURE__ */ jsx4("p", { className: "text-og-sm leading-5 text-og-fg-subtle", children: workspaceWaking ? t("sandboxWorkspace.connectingToTheLiveWorking") : previewUnavailable ? t("sandboxWorkspace.openTheLiveWorkspaceTo") : comparison === "branch" ? t("sandboxWorkspace.wakeTheSandboxToCompare") : comparison === "staged" ? t("sandboxWorkspace.wakeTheSandboxToInspect") : t("sandboxWorkspace.noCapturedRevisionIsAvailable") }),
2918
+ !workspaceWaking ? /* @__PURE__ */ jsxs3(DockActionButton, { onClick: onWake, children: [
2919
+ /* @__PURE__ */ jsx4(CpuIcon, { className: "size-3" }),
2920
+ t("sandboxWorkspace.openLiveWorkspace")
2921
+ ] }) : null
2922
+ ]
2923
+ }
2924
+ );
2925
+ }
2926
+ if (git.loading && git.source === null) {
2927
+ return /* @__PURE__ */ jsxs3(
2928
+ CenteredState,
2929
+ {
2930
+ icon: /* @__PURE__ */ jsx4(
2931
+ LoaderCircleIcon,
2932
+ {
2933
+ className: "size-5 animate-spin motion-reduce:animate-none",
2934
+ "aria-hidden": true
2935
+ }
2936
+ ),
2937
+ children: [
2938
+ /* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: t("sandboxWorkspace.loadingWorkspace") }),
2939
+ /* @__PURE__ */ jsx4("p", { className: "text-og-sm leading-5 text-og-fg-subtle", children: t("sandboxWorkspace.readingTheCurrentWorkingTree") })
2940
+ ]
2941
+ }
2942
+ );
2943
+ }
2944
+ return /* @__PURE__ */ jsxs3(CenteredState, { icon: /* @__PURE__ */ jsx4(CircleCheckIcon, { className: "size-5", "aria-hidden": true }), tone: "success", children: [
2945
+ /* @__PURE__ */ jsx4("p", { className: "text-og-sm font-medium text-og-fg", children: comparison === "branch" ? t("sandboxWorkspace.noBranchChanges") : comparison === "staged" ? t("sandboxWorkspace.noStagedChanges") : t("sandboxWorkspace.noUncommittedChanges") }),
2946
+ /* @__PURE__ */ jsx4("p", { className: "text-og-sm leading-5 text-og-fg-subtle", children: comparison === "branch" ? t("sandboxWorkspace.thisBranchMatchesTheRemote") : comparison === "staged" ? t("sandboxWorkspace.stageFilesToReviewThe") : t("sandboxWorkspace.localEditsNotYetCommitted") })
2947
+ ] });
2948
+ }
2949
+ function CenteredState({
2950
+ children,
2951
+ icon,
2952
+ tone = "neutral"
2953
+ }) {
2954
+ return /* @__PURE__ */ jsx4(
2955
+ "div",
2956
+ {
2957
+ role: tone === "danger" ? "alert" : "status",
2958
+ "aria-atomic": "true",
2959
+ "aria-live": tone === "danger" ? "assertive" : "polite",
2960
+ className: "grid h-full place-items-center p-6 text-center",
2961
+ children: /* @__PURE__ */ jsxs3("div", { className: "flex max-w-sm flex-col items-center gap-2.5", children: [
2962
+ icon ? /* @__PURE__ */ jsx4(
2963
+ "span",
2964
+ {
2965
+ className: cn(
2966
+ "grid size-10 place-items-center rounded-og-lg border bg-og-surface-1 shadow-sm",
2967
+ tone === "success" && "border-og-status-idle/30 text-og-status-idle",
2968
+ tone === "danger" && "border-og-status-failed/30 text-og-status-failed",
2969
+ tone === "neutral" && "border-og-border text-og-fg-muted"
2970
+ ),
2971
+ children: icon
2972
+ }
2973
+ ) : null,
2974
+ children
2975
+ ] })
2976
+ }
2977
+ );
2978
+ }
2979
+
2980
+ // src/hooks/use-supergrok-accounts.ts
2981
+ import { useCallback as useCallback11 } from "react";
2982
+ var superGrokAccountsQueryKey = (workspaceId) => ["supergrok-accounts", workspaceId];
2983
+ var EMPTY = {
2984
+ accounts: [],
2985
+ activeAccountId: null,
2986
+ settings: {
2987
+ rotationEnabled: false,
2988
+ rotationStrategy: "sharded",
2989
+ activeCredentialId: null
2990
+ }
2991
+ };
2992
+ function useSuperGrokAccounts(options = {}) {
2993
+ const { client, workspaceId } = useOpenGeni(options);
2994
+ const supergrokClient = options.supergrokClient ?? client;
2995
+ const load = useCallback11(
2996
+ async () => await supergrokClient.listSuperGrokAccounts(workspaceId),
2997
+ [supergrokClient, workspaceId]
2998
+ );
2999
+ const { data, loading, refresh } = useSharedQuery(
3000
+ supergrokClient,
3001
+ superGrokAccountsQueryKey(workspaceId),
3002
+ load,
3003
+ { enabled: options.enabled, pollIntervalMs: options.pollIntervalMs }
3004
+ );
3005
+ const { run, mutating: activating, mutationError } = useMutationRunner();
3006
+ const activate = useCallback11(
3007
+ async (accountId) => {
3008
+ if (!supergrokClient.activateSuperGrokAccount) return false;
3009
+ const invalidated = { current: null };
3010
+ const result = await run(async () => {
3011
+ await supergrokClient.activateSuperGrokAccount(workspaceId, accountId);
3012
+ invalidated.current = invalidateSharedQueries(supergrokClient, ["supergrok-accounts"]);
3013
+ return true;
3014
+ });
3015
+ if (result) await invalidated.current;
3016
+ return result === true;
3017
+ },
3018
+ [run, supergrokClient, workspaceId]
3019
+ );
3020
+ const state = data ?? EMPTY;
3021
+ return {
3022
+ accounts: state.accounts,
3023
+ activeAccountId: state.activeAccountId,
3024
+ settings: state.settings,
3025
+ loading,
3026
+ refresh,
3027
+ activate,
3028
+ activating,
3029
+ mutationError
3030
+ };
3031
+ }
3032
+
3033
+ export {
3034
+ sessionAuthRecommendation,
3035
+ SessionConnectionRequest,
3036
+ useVideoArtifactPlaybackLoader,
3037
+ useScheduledTasks,
3038
+ useWorkspaceBackgroundCommands,
3039
+ useWorkspaces,
3040
+ useBillingUsage,
3041
+ useSessionCapabilities,
3042
+ useSandboxTerminal,
3043
+ useSandboxGit,
3044
+ useWorkspaceCapture,
3045
+ useWorkspaceEdit,
3046
+ sessionDisplayTitle,
3047
+ FleetTile,
3048
+ DiffView,
3049
+ WORKBENCH_TAB_CHANGES,
3050
+ WORKBENCH_TAB_FILES,
3051
+ WORKBENCH_TAB_TERMINAL,
3052
+ WORKBENCH_TAB_BROWSER,
3053
+ WORKBENCH_TAB_DESKTOP,
3054
+ WORKBENCH_SURFACES,
3055
+ initialWorkspaceTab,
3056
+ useSandboxWorkspaceTabs,
3057
+ SandboxWorkspace,
3058
+ useSuperGrokAccounts,
3059
+ asVaultClient,
3060
+ vaultsApi,
3061
+ vaultErrorCode,
3062
+ vaultErrorDetail,
3063
+ humanizeModelSlug,
3064
+ isRawModelLabel,
3065
+ modelDisplayName2 as modelDisplayName,
3066
+ modelSlug,
3067
+ modelVendor,
3068
+ parseOpenGeniLink
3069
+ };
3070
+ //# sourceMappingURL=chunk-FUXFJTXL.js.map