@opengeni/react 6.37.3 → 6.37.4-canary.45279257475001

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 (1192) hide show
  1. package/dist/app/app-state.js +32 -32
  2. package/dist/app/components/Composer.css +1 -1
  3. package/dist/app/components/Composer.css.map +1 -1
  4. package/dist/app/components/Composer.js +44 -43
  5. package/dist/app/components/add-card-dialog.js +3 -2
  6. package/dist/app/components/add-card-dialog.js.map +1 -1
  7. package/dist/app/components/add-card.js +3 -3
  8. package/dist/app/components/agent/agent-capability-picker.js +9 -9
  9. package/dist/app/components/agents/agent-can-use.js +48 -47
  10. package/dist/app/components/agents/agent-form-page.js +143 -142
  11. package/dist/app/components/agents/agent-form-page.js.map +1 -1
  12. package/dist/app/components/agents/agent-page.js +124 -123
  13. package/dist/app/components/agents/agent-setup-sections.js +78 -77
  14. package/dist/app/components/agents/agent-skills.js +14 -13
  15. package/dist/app/components/agents/agent-trigger-chat-field.js +6 -6
  16. package/dist/app/components/agents/agent-trigger-dialog.js +34 -33
  17. package/dist/app/components/agents/agent-trigger-picker.js +8 -8
  18. package/dist/app/components/agents/agent-trigger-repositories.js +16 -16
  19. package/dist/app/components/agents/agents-page.js +96 -95
  20. package/dist/app/components/agents/agents-page.js.map +1 -1
  21. package/dist/app/components/agents/composer-agent-chip.js +60 -59
  22. package/dist/app/components/agents/session-agent-chip.js +55 -54
  23. package/dist/app/components/artifacts/app-package.js +13 -12
  24. package/dist/app/components/artifacts/artifact-browse-controls.js +3 -3
  25. package/dist/app/components/artifacts/artifact-library.js +29 -28
  26. package/dist/app/components/artifacts/artifact-page-chrome.js +1 -1
  27. package/dist/app/components/artifacts/artifact-viewer.js +67 -66
  28. package/dist/app/components/artifacts/artifact-viewer.js.map +1 -1
  29. package/dist/app/components/artifacts/chat-interactive-block.js +30 -29
  30. package/dist/app/components/artifacts/chat-interactive-block.js.map +1 -1
  31. package/dist/app/components/artifacts/copy-artifact-link.js +2 -2
  32. package/dist/app/components/artifacts/file-reach-dialog.js +13 -12
  33. package/dist/app/components/artifacts/inline-chat-image.js +52 -51
  34. package/dist/app/components/artifacts/ready-made-apps.js +13 -12
  35. package/dist/app/components/artifacts/retained-file-preview.js +58 -57
  36. package/dist/app/components/artifacts/retained-text-preview.js +8 -8
  37. package/dist/app/components/artifacts/site-actions.js +12 -12
  38. package/dist/app/components/artifacts/site-audience.js +9 -8
  39. package/dist/app/components/artifacts/site-conversations.js +35 -35
  40. package/dist/app/components/artifacts/site-data.js +27 -26
  41. package/dist/app/components/artifacts/site-public-link.js +3 -3
  42. package/dist/app/components/artifacts/site-publishing-page.js +69 -68
  43. package/dist/app/components/artifacts/site-publishing.js +54 -53
  44. package/dist/app/components/artifacts/site-settings.js +68 -67
  45. package/dist/app/components/artifacts/site-version-menu.js +10 -10
  46. package/dist/app/components/billing-class-mark.js +7 -7
  47. package/dist/app/components/capabilities/capability-detail-sheet.js +18 -17
  48. package/dist/app/components/capabilities/capability-logo-source.js +29 -28
  49. package/dist/app/components/capabilities/capability-logo.js +1 -1
  50. package/dist/app/components/capabilities/connection-account-picker.js +2 -2
  51. package/dist/app/components/capabilities/connection-ownership-selector.js +4 -3
  52. package/dist/app/components/capabilities/connector-tool-permissions.js +8 -8
  53. package/dist/app/components/capabilities/detail-dialog.js +3 -2
  54. package/dist/app/components/capabilities/native-connect-setup.js +32 -31
  55. package/dist/app/components/capabilities/own-logins-shared-heads-up.js +6 -6
  56. package/dist/app/components/capabilities/perform-capability-action.js +2 -2
  57. package/dist/app/components/capabilities/prepared-mcp-setup-card.js +32 -31
  58. package/dist/app/components/capabilities/session-capability-card.css +1 -1
  59. package/dist/app/components/capabilities/session-capability-card.css.map +1 -1
  60. package/dist/app/components/capabilities/session-capability-card.js +136 -135
  61. package/dist/app/components/capabilities/session-capability-card.js.map +1 -1
  62. package/dist/app/components/capabilities/session-chrome-card.css +1 -1
  63. package/dist/app/components/capabilities/session-chrome-card.css.map +1 -1
  64. package/dist/app/components/capabilities/session-chrome-card.js +49 -48
  65. package/dist/app/components/capabilities/session-connect-inputs-card.js +34 -33
  66. package/dist/app/components/capabilities/session-custom-mcp-card.js +39 -38
  67. package/dist/app/components/capabilities/session-github-card.js +45 -44
  68. package/dist/app/components/capabilities/session-machine-card.css +1 -1
  69. package/dist/app/components/capabilities/session-machine-card.css.map +1 -1
  70. package/dist/app/components/capabilities/session-machine-card.js +50 -49
  71. package/dist/app/components/capabilities/session-personal-github-card.js +33 -32
  72. package/dist/app/components/capabilities/session-plugin-card.js +21 -20
  73. package/dist/app/components/capabilities/use-capabilities-catalog.js +1 -1
  74. package/dist/app/components/capabilities/use-connection-accounts.js +2 -2
  75. package/dist/app/components/chat-payment-pages.js +2 -2
  76. package/dist/app/components/command-menu/chat-status.js +26 -26
  77. package/dist/app/components/command-menu/chat-switcher.js +87 -86
  78. package/dist/app/components/command-menu/chat-switcher.js.map +1 -1
  79. package/dist/app/components/command-menu/command-menu.js +332 -330
  80. package/dist/app/components/command-menu/command-menu.js.map +1 -1
  81. package/dist/app/components/command-menu/shortcut-sheet.js +27 -26
  82. package/dist/app/components/command-menu/shortcut-sheet.js.map +1 -1
  83. package/dist/app/components/composer-capabilities-menu-body.js +7 -7
  84. package/dist/app/components/composer-mobile-plus-panel.js +29 -28
  85. package/dist/app/components/composer-mobile-plus-panel.js.map +1 -1
  86. package/dist/app/components/composer-mobile-plus.js +5 -4
  87. package/dist/app/components/credit-required-gate.js +7 -7
  88. package/dist/app/components/credit-required-prompt.js +25 -24
  89. package/dist/app/components/credit-required-prompt.js.map +1 -1
  90. package/dist/app/components/credits/checkout-credits-celebration.js +4 -3
  91. package/dist/app/components/credits/checkout-return.js +4 -3
  92. package/dist/app/components/credits/checkout-return.js.map +1 -1
  93. package/dist/app/components/credits/coupon-redeem.js +1 -1
  94. package/dist/app/components/credits/credit-refusal-notice.js +7 -7
  95. package/dist/app/components/credits/own-subscription-plan-notice.js +3 -3
  96. package/dist/app/components/desktop/app-shots.css +1 -1
  97. package/dist/app/components/desktop/app-shots.css.map +1 -1
  98. package/dist/app/components/desktop/app-shots.js +10 -9
  99. package/dist/app/components/desktop/app-update.js +3 -3
  100. package/dist/app/components/desktop/computer-use.js +3 -3
  101. package/dist/app/components/desktop/this-computer.css +1 -1
  102. package/dist/app/components/desktop/this-computer.css.map +1 -1
  103. package/dist/app/components/desktop/this-computer.js +7 -6
  104. package/dist/app/components/feedback.js +11 -10
  105. package/dist/app/components/follow-up-repository-menu-body.js +13 -13
  106. package/dist/app/components/follow-up-repository-picker.js +1 -1
  107. package/dist/app/components/github-app-connect-launcher.js +3 -3
  108. package/dist/app/components/in-app-help-link.js +3 -3
  109. package/dist/app/components/knowledge/agent-learning-settings.js +3 -3
  110. package/dist/app/components/machines/connect-machine-dialog.css +1 -1
  111. package/dist/app/components/machines/connect-machine-dialog.css.map +1 -1
  112. package/dist/app/components/machines/connect-machine-dialog.js +25 -24
  113. package/dist/app/components/manual-repository-editor.js +3 -3
  114. package/dist/app/components/markdown.js +16 -15
  115. package/dist/app/components/model-identity.js +3 -3
  116. package/dist/app/components/models/models-ui.js +17 -16
  117. package/dist/app/components/models/provider-mark.js +3 -3
  118. package/dist/app/components/models/subscription-usage.js +5 -5
  119. package/dist/app/components/my-things.js +16 -15
  120. package/dist/app/components/my-things.js.map +1 -1
  121. package/dist/app/components/own-where-it-works.js +11 -10
  122. package/dist/app/components/personal-resource-attachment-surface.js +4 -4
  123. package/dist/app/components/pickers.js +11 -11
  124. package/dist/app/components/rail/channel-create-dialog.js +7 -6
  125. package/dist/app/components/rail/project-glyph.js +53 -52
  126. package/dist/app/components/rail/project-profile.js +74 -73
  127. package/dist/app/components/rail/rail-context.js +2 -2
  128. package/dist/app/components/rail/rail-sections.js +155 -154
  129. package/dist/app/components/rail/session-header.js +125 -124
  130. package/dist/app/components/rail/session-list.js +152 -151
  131. package/dist/app/components/rail/session-row-content.js +6 -6
  132. package/dist/app/components/rail/session-row-hover-details.js +36 -36
  133. package/dist/app/components/rail/session-shell.js +192 -191
  134. package/dist/app/components/rail/site-session-group-heading.js +36 -36
  135. package/dist/app/components/repository-picker.js +13 -13
  136. package/dist/app/components/secrets/session-secrets-panel.js +4 -4
  137. package/dist/app/components/session/agent-configuration-panel.js +45 -44
  138. package/dist/app/components/session/agent-configuration-panel.js.map +1 -1
  139. package/dist/app/components/session/artifact-session-page.js +7 -7
  140. package/dist/app/components/session/banners.js +20 -19
  141. package/dist/app/components/session/chat-avatar.js +53 -52
  142. package/dist/app/components/session/console-new-conversation.css +1 -1
  143. package/dist/app/components/session/console-new-conversation.css.map +1 -1
  144. package/dist/app/components/session/console-new-conversation.js +110 -109
  145. package/dist/app/components/session/descendant-requests.js +110 -109
  146. package/dist/app/components/session/descendant-requests.js.map +1 -1
  147. package/dist/app/components/session/editable-artifacts-workspace.js +60 -59
  148. package/dist/app/components/session/editable-artifacts-workspace.js.map +1 -1
  149. package/dist/app/components/session/failed-session-banner.js +29 -28
  150. package/dist/app/components/session/failed-session-banner.js.map +1 -1
  151. package/dist/app/components/session/failure-recovery-boundary.js +3 -3
  152. package/dist/app/components/session/human-input-delegation-record.js +3 -3
  153. package/dist/app/components/session/human-input.js +88 -87
  154. package/dist/app/components/session/inspector.js +146 -145
  155. package/dist/app/components/session/inspector.js.map +1 -1
  156. package/dist/app/components/session/linked-panel.js +3 -3
  157. package/dist/app/components/session/message-actions.js +11 -10
  158. package/dist/app/components/session/message-actions.js.map +1 -1
  159. package/dist/app/components/session/model-recovery-notice.js +4 -4
  160. package/dist/app/components/session/new-session-settings-menu.css +1 -1
  161. package/dist/app/components/session/new-session-settings-menu.css.map +1 -1
  162. package/dist/app/components/session/new-session-settings-menu.js +30 -29
  163. package/dist/app/components/session/new-session-setup-strip.js +56 -55
  164. package/dist/app/components/session/pull-request-panel.js +25 -24
  165. package/dist/app/components/session/sandbox-recovery-actions.js +5 -4
  166. package/dist/app/components/session/sandbox-switcher.js +22 -22
  167. package/dist/app/components/session/sandbox-workspace.js +120 -119
  168. package/dist/app/components/session/search-markdown-highlight.js +17 -16
  169. package/dist/app/components/session/search-results-view.js +18 -17
  170. package/dist/app/components/session/session-admin-access.js +14 -13
  171. package/dist/app/components/session/session-admission-notice.js +11 -11
  172. package/dist/app/components/session/session-avatar-picker.js +60 -59
  173. package/dist/app/components/session/session-avatar.js +55 -54
  174. package/dist/app/components/session/session-machine-access-notice.js +11 -11
  175. package/dist/app/components/session/session-profile-dialog.js +71 -70
  176. package/dist/app/components/session/session-profile-editor.js +72 -71
  177. package/dist/app/components/session/session-retention.js +6 -6
  178. package/dist/app/components/session/session-search-dialog.js +21 -20
  179. package/dist/app/components/session/session-search-dialog.js.map +1 -1
  180. package/dist/app/components/session/session-skill-reviews.js +5 -5
  181. package/dist/app/components/session/session-tenancy-control.js +32 -31
  182. package/dist/app/components/session/session-tenancy-control.js.map +1 -1
  183. package/dist/app/components/session/session-unattended-setting.js +1 -1
  184. package/dist/app/components/session/session-usage-limit-section.js +11 -11
  185. package/dist/app/components/session/share-chat-dialog.js +11 -10
  186. package/dist/app/components/session/subagents.js +23 -23
  187. package/dist/app/components/session/subscription-account-indicator.js +25 -25
  188. package/dist/app/components/session/subscription-account-menu.js +7 -7
  189. package/dist/app/components/session-connectors-menu-body.js +10 -10
  190. package/dist/app/components/settings/row-select.js +6 -6
  191. package/dist/app/components/toaster.js +2 -2
  192. package/dist/app/components/transcription-settings.js +10 -10
  193. package/dist/app/components/ui/destructive-confirm.js +11 -10
  194. package/dist/app/components/usage/usage-entry.js +8 -8
  195. package/dist/app/components/window-bar.js +26 -26
  196. package/dist/app/components/workspace-composer-plus.js +44 -43
  197. package/dist/app/components/workspace-reach.js +6 -6
  198. package/dist/app/embed/session-app.css +1 -1
  199. package/dist/app/embed/session-app.css.map +1 -1
  200. package/dist/app/embed/session-app.js +388 -387
  201. package/dist/app/lib/actions/actions-provider.js +19 -19
  202. package/dist/app/lib/agent-capabilities.js +4 -4
  203. package/dist/app/lib/app-connect-card.js +15 -14
  204. package/dist/app/lib/app-shared-key-dialog.js +9 -8
  205. package/dist/app/lib/app-surfaces.js +2 -2
  206. package/dist/app/lib/app-sync-opt-in.js +6 -5
  207. package/dist/app/lib/codex-usage-query.js +3 -3
  208. package/dist/app/lib/composer-agent.js +2 -2
  209. package/dist/app/lib/composer-connectors.js +33 -32
  210. package/dist/app/lib/composer-send-blocking.js +2 -2
  211. package/dist/app/lib/console-site.js +8 -7
  212. package/dist/app/lib/console-text.js +2 -2
  213. package/dist/app/lib/events.js +30 -29
  214. package/dist/app/lib/failed-session-copy.js +5 -5
  215. package/dist/app/lib/feedback-capture.js +2 -2
  216. package/dist/app/lib/model-access-onboarding.js +4 -4
  217. package/dist/app/lib/move-chat-to-machine.js +5 -5
  218. package/dist/app/lib/personal-resource-attachments.js +1 -1
  219. package/dist/app/lib/session-branch-cache.js +19 -19
  220. package/dist/app/lib/session-create.js +5 -5
  221. package/dist/app/lib/session-group-pagination.js +19 -19
  222. package/dist/app/lib/session-hover-facts.js +26 -26
  223. package/dist/app/lib/session-list-dirty-scopes.js +20 -20
  224. package/dist/app/lib/session-model.js +2 -2
  225. package/dist/app/lib/session-rail.js +16 -16
  226. package/dist/app/lib/session-rename.js +3 -3
  227. package/dist/app/lib/sessions-group.js +23 -23
  228. package/dist/app/lib/site-tool-consent-dialog.js +25 -24
  229. package/dist/app/lib/site-tool-consent-dialog.js.map +1 -1
  230. package/dist/app/lib/site-tool-consent.js +1 -1
  231. package/dist/app/lib/turn-failure-analytics.js +6 -6
  232. package/dist/app/lib/use-artifact-catalog.js +2 -2
  233. package/dist/app/lib/use-duplicate-site.js +5 -5
  234. package/dist/app/lib/use-follow-up-repositories.js +7 -6
  235. package/dist/app/lib/use-personal-resource-attachment.js +2 -2
  236. package/dist/app/lib/use-workspace-machines.js +9 -9
  237. package/dist/app/lib/use-workspace-model-catalog.js +5 -5
  238. package/dist/app/lib/use-workspace-rigs.js +6 -6
  239. package/dist/app/lib/workspace-navigation-preference.js +5 -5
  240. package/dist/app/lib/workspace-scope-context.js +4 -4
  241. package/dist/app/routes/app-page-view.js +22 -21
  242. package/dist/app/routes/app-page-view.js.map +1 -1
  243. package/dist/app/routes/app-page.js +2 -2
  244. package/dist/app/routes/artifacts.js +153 -152
  245. package/dist/app/routes/artifacts.js.map +1 -1
  246. package/dist/app/routes/retained-artifact.js +106 -105
  247. package/dist/app/routes/retained-artifact.js.map +1 -1
  248. package/dist/app/routes/session-unavailable.js +6 -6
  249. package/dist/app/routes/session.css +1 -1
  250. package/dist/app/routes/session.css.map +1 -1
  251. package/dist/app/routes/session.js +246 -245
  252. package/dist/app/routes/sessions-index-hydration.js +6 -6
  253. package/dist/app/routes/sessions-index.css +1 -1
  254. package/dist/app/routes/sessions-index.css.map +1 -1
  255. package/dist/app/routes/sessions-index.js +202 -201
  256. package/dist/app/routes/site-view.css +1 -1
  257. package/dist/app/routes/site-view.css.map +1 -1
  258. package/dist/app/routes/site-view.js +195 -194
  259. package/dist/app/routes/site-view.js.map +1 -1
  260. package/dist/artifacts-document.js +4 -4
  261. package/dist/artifacts-presentation.js +9 -8
  262. package/dist/artifacts-spreadsheet.js +4 -4
  263. package/dist/artifacts.js +51 -50
  264. package/dist/automation-model.js +6 -6
  265. package/dist/automations.js +71 -70
  266. package/dist/automations.js.map +1 -1
  267. package/dist/browser-viewer-O5FJOWWI.js +23 -0
  268. package/dist/chat-interactive-block-TQTOUHRC.js +22 -0
  269. package/dist/chunk-23TTCFRP.js +3690 -0
  270. package/dist/chunk-2BOFLWNJ.js +129 -0
  271. package/dist/chunk-2NO5QJCL.js +438 -0
  272. package/dist/chunk-2NO5QJCL.js.map +1 -0
  273. package/dist/chunk-3DMD2KHT.js +851 -0
  274. package/dist/chunk-3DOISS3I.js +132 -0
  275. package/dist/chunk-3KWTXE4O.js +199 -0
  276. package/dist/chunk-3TRERIPD.js +93 -0
  277. package/dist/chunk-3UXBTL7Z.js +92 -0
  278. package/dist/chunk-3XEKXNB4.js +283 -0
  279. package/dist/chunk-3ZJUQG4K.js +428 -0
  280. package/dist/chunk-42WTAUUW.js +335 -0
  281. package/dist/chunk-46ZC5VNC.js +38 -0
  282. package/dist/chunk-4BVEFGX7.js +166 -0
  283. package/dist/chunk-4IOFV4S4.js +401 -0
  284. package/dist/chunk-4ISXBLJV.js +137 -0
  285. package/dist/chunk-4L2MBYLH.js +283 -0
  286. package/dist/chunk-4N3B25HA.js +850 -0
  287. package/dist/chunk-4N3B25HA.js.map +1 -0
  288. package/dist/chunk-4NWUZ6SL.js +176 -0
  289. package/dist/chunk-4QVX6CTT.js +318 -0
  290. package/dist/chunk-4YARO4Y5.js +2984 -0
  291. package/dist/chunk-4Z7BPBS7.js +34 -0
  292. package/dist/chunk-55ILMX6B.js +794 -0
  293. package/dist/chunk-57OAQTWD.js +103 -0
  294. package/dist/chunk-5BRPLALX.js +380 -0
  295. package/dist/chunk-5BRPLALX.js.map +1 -0
  296. package/dist/chunk-5EF4JI6Q.js +214 -0
  297. package/dist/chunk-5EF4JI6Q.js.map +1 -0
  298. package/dist/chunk-5GXX3NI7.js +46 -0
  299. package/dist/chunk-5VE3PPSK.js +353 -0
  300. package/dist/chunk-62T2ZPD5.js +266 -0
  301. package/dist/chunk-655JT4VH.js +251 -0
  302. package/dist/chunk-65OPNLE4.js +505 -0
  303. package/dist/chunk-67PIP46J.js +229 -0
  304. package/dist/chunk-6CAK65QV.js +211 -0
  305. package/dist/chunk-6CDBX3XG.js +33 -0
  306. package/dist/chunk-6D3D2JWY.js +278 -0
  307. package/dist/chunk-6DGQB6GT.js +107 -0
  308. package/dist/chunk-6NFK3J2O.js +188 -0
  309. package/dist/chunk-6R3QX3AC.js +538 -0
  310. package/dist/chunk-6S5OMLAL.js +400 -0
  311. package/dist/chunk-6SG2VVVB.js +249 -0
  312. package/dist/chunk-6U57GGJI.js +110 -0
  313. package/dist/chunk-6V2PEFPS.js +98 -0
  314. package/dist/chunk-6VASZZVV.js +3321 -0
  315. package/dist/chunk-7BBYH5R5.js +168 -0
  316. package/dist/chunk-7EO3T3IX.js +209 -0
  317. package/dist/chunk-7EZQ6EKM.js +158 -0
  318. package/dist/chunk-7HI53NPP.js +15 -0
  319. package/dist/chunk-7J4BFENI.js +37 -0
  320. package/dist/chunk-7LSGNY2L.js +114 -0
  321. package/dist/chunk-7MMONDFK.js +1236 -0
  322. package/dist/chunk-7MWPBGDX.js +175 -0
  323. package/dist/chunk-7NSDIQMY.js +371 -0
  324. package/dist/chunk-7XPDLT5G.js +231 -0
  325. package/dist/chunk-A3BCF4MV.js +378 -0
  326. package/dist/chunk-A5GX3CAE.js +849 -0
  327. package/dist/chunk-AAHQJWEP.js +515 -0
  328. package/dist/chunk-AAWEPZOG.js +144 -0
  329. package/dist/chunk-ABRT345L.js +598 -0
  330. package/dist/chunk-AJ7KJ7XZ.js +4519 -0
  331. package/dist/chunk-AJ7KJ7XZ.js.map +1 -0
  332. package/dist/chunk-ANXFE2EP.js +91 -0
  333. package/dist/chunk-AQNE4XWU.js +271 -0
  334. package/dist/chunk-AV2OMWDS.js +4979 -0
  335. package/dist/chunk-AYHMHAU5.js +1019 -0
  336. package/dist/chunk-AZ637XK3.js +50 -0
  337. package/dist/chunk-B6AH43UQ.js +2434 -0
  338. package/dist/chunk-BBECLK22.js +383 -0
  339. package/dist/chunk-BWYPJG3P.js +158 -0
  340. package/dist/chunk-CI7F4Y26.js +396 -0
  341. package/dist/chunk-CNLSXEQC.js +931 -0
  342. package/dist/chunk-COCB4HE3.js +65 -0
  343. package/dist/chunk-CPEVLG3B.js +357 -0
  344. package/dist/chunk-CRHH5C6Z.js +5920 -0
  345. package/dist/chunk-CRHH5C6Z.js.map +1 -0
  346. package/dist/chunk-CVC4RO7D.js +155 -0
  347. package/dist/chunk-CY6RLRHJ.js +3110 -0
  348. package/dist/chunk-D3WLSMCL.js +117 -0
  349. package/dist/chunk-D7SSOJEU.js +178 -0
  350. package/dist/chunk-DBOD5WXT.js +818 -0
  351. package/dist/chunk-DFWSRIFL.js +162 -0
  352. package/dist/chunk-DITZUBOK.js +126 -0
  353. package/dist/chunk-DKD2ZZSJ.js +287 -0
  354. package/dist/chunk-DOJWHSRD.js +246 -0
  355. package/dist/chunk-DR6LZXJI.js +187 -0
  356. package/dist/chunk-DV73XOVB.js +650 -0
  357. package/dist/chunk-DYO7DNDD.js +316 -0
  358. package/dist/chunk-DYZASWWT.js +234 -0
  359. package/dist/chunk-EAJHD44A.js +573 -0
  360. package/dist/chunk-EAJHD44A.js.map +1 -0
  361. package/dist/chunk-EC5HUNXI.js +1263 -0
  362. package/dist/chunk-ECQ7FV3E.js +247 -0
  363. package/dist/chunk-ECVCSZWY.js +406 -0
  364. package/dist/chunk-EMXO5HCY.js +333 -0
  365. package/dist/chunk-ENJX5TAA.js +265 -0
  366. package/dist/chunk-EQSYPIAI.js +66 -0
  367. package/dist/chunk-EV73XMK3.js +1152 -0
  368. package/dist/chunk-F2SGC74A.js +2553 -0
  369. package/dist/chunk-F3LIUDXN.js +738 -0
  370. package/dist/chunk-F3LIUDXN.js.map +1 -0
  371. package/dist/chunk-F5ABIEWA.js +1029 -0
  372. package/dist/chunk-F5ABIEWA.js.map +1 -0
  373. package/dist/chunk-F5DEBD4D.js +230 -0
  374. package/dist/chunk-F6JJBUQ2.js +566 -0
  375. package/dist/chunk-FEVZDJOZ.js +1024 -0
  376. package/dist/chunk-FF22IUY3.js +121 -0
  377. package/dist/chunk-FILRDNUQ.js +256 -0
  378. package/dist/chunk-FLB3BP2E.js +227 -0
  379. package/dist/chunk-FZVMMHPC.js +639 -0
  380. package/dist/chunk-G6D5NVWM.js +112 -0
  381. package/dist/chunk-GGH5STTP.js +192 -0
  382. package/dist/chunk-GGHX6GS7.js +187 -0
  383. package/dist/chunk-GIHE7U3Y.js +174 -0
  384. package/dist/chunk-GO5VIAA7.js +264 -0
  385. package/dist/chunk-GSK637QS.js +27 -0
  386. package/dist/chunk-HBYO34CP.js +56 -0
  387. package/dist/chunk-HFROJDFQ.js +118 -0
  388. package/dist/chunk-HGEDFQ7G.js +251 -0
  389. package/dist/chunk-HH3QTFGV.js +1356 -0
  390. package/dist/chunk-HHFFPE67.js +220 -0
  391. package/dist/chunk-HHYTB5OL.js +246 -0
  392. package/dist/chunk-HPKWAHHI.js +48 -0
  393. package/dist/chunk-HSPOCEGP.js +373 -0
  394. package/dist/chunk-IC74VN2I.js +608 -0
  395. package/dist/chunk-ICSQO2CV.js +1021 -0
  396. package/dist/chunk-IEZE7SL6.js +3070 -0
  397. package/dist/chunk-IGHNTARW.js +170 -0
  398. package/dist/chunk-IKYS56PQ.js +138 -0
  399. package/dist/chunk-IO474NRY.js +56 -0
  400. package/dist/chunk-IP2CCFAV.js +723 -0
  401. package/dist/chunk-IT5GF54F.js +3851 -0
  402. package/dist/chunk-IX67G5FD.js +270 -0
  403. package/dist/chunk-IXNJK7KJ.js +292 -0
  404. package/dist/chunk-IZWTARYT.js +276 -0
  405. package/dist/chunk-JBV2HY43.js +108 -0
  406. package/dist/chunk-JE62XK5K.js +33 -0
  407. package/dist/chunk-JFAWCALM.js +85 -0
  408. package/dist/chunk-JQGPATQZ.js +83 -0
  409. package/dist/chunk-JYZGX5UZ.js +274 -0
  410. package/dist/chunk-K227GMSM.js +72 -0
  411. package/dist/chunk-KB2O7JIJ.js +449 -0
  412. package/dist/chunk-KT6GC67G.js +12 -0
  413. package/dist/chunk-KTGKGHEA.js +75 -0
  414. package/dist/chunk-KU77XHWB.js +285 -0
  415. package/dist/chunk-KZIRVLCM.js +175 -0
  416. package/dist/chunk-L3DUSTRN.js +259 -0
  417. package/dist/chunk-L6WVCO6D.js +61 -0
  418. package/dist/chunk-L7PCZEEG.js +79 -0
  419. package/dist/chunk-LEN2DVU6.js +311 -0
  420. package/dist/chunk-LGOQW2CE.js +191 -0
  421. package/dist/chunk-LK2JO72Y.js +389 -0
  422. package/dist/chunk-LSJPFW34.js +3996 -0
  423. package/dist/chunk-LSJPFW34.js.map +1 -0
  424. package/dist/chunk-LXLHIOJM.js +584 -0
  425. package/dist/chunk-LYQQ4VBE.js +1333 -0
  426. package/dist/chunk-M22ZHQ7S.js +1628 -0
  427. package/dist/chunk-M5RKFV6K.js +20 -0
  428. package/dist/chunk-MCPKUVMQ.js +99 -0
  429. package/dist/chunk-MDGNCUAC.js +145 -0
  430. package/dist/chunk-MFLU3466.js +99 -0
  431. package/dist/chunk-MIUJ3EH5.js +60 -0
  432. package/dist/chunk-MO3XJQN2.js +629 -0
  433. package/dist/chunk-MTHAYXDH.js +107 -0
  434. package/dist/chunk-MVYQDBE6.js +79 -0
  435. package/dist/chunk-NA7VZQPL.js +307 -0
  436. package/dist/chunk-ND6FWOSO.js +2431 -0
  437. package/dist/chunk-NGTCSS53.js +24 -0
  438. package/dist/chunk-NGTCSS53.js.map +1 -0
  439. package/dist/chunk-NIFPH34L.js +351 -0
  440. package/dist/chunk-NKYC6WHQ.js +103 -0
  441. package/dist/chunk-NML7VKLU.js +391 -0
  442. package/dist/chunk-NPAWLKJB.js +41 -0
  443. package/dist/chunk-NQSKI2YD.js +1185 -0
  444. package/dist/chunk-NXQFBC22.js +114 -0
  445. package/dist/chunk-NXRZMHVM.js +43 -0
  446. package/dist/chunk-NYU5DE4K.js +1309 -0
  447. package/dist/chunk-O2EEYPIZ.js +48 -0
  448. package/dist/chunk-O4TOEISQ.js +67 -0
  449. package/dist/chunk-O533L2TG.js +129 -0
  450. package/dist/chunk-O664PL2U.js +47 -0
  451. package/dist/chunk-O664PL2U.js.map +1 -0
  452. package/dist/chunk-ON6ZGJDW.js +532 -0
  453. package/dist/chunk-OPELE3Z4.js +311 -0
  454. package/dist/chunk-OTSUC6PP.js +234 -0
  455. package/dist/chunk-OXM267RC.js +128 -0
  456. package/dist/chunk-OXM267RC.js.map +1 -0
  457. package/dist/chunk-OZNL5OKT.js +1184 -0
  458. package/dist/chunk-P3PDKPLK.js +432 -0
  459. package/dist/chunk-PCZBYN2H.js +372 -0
  460. package/dist/chunk-PIPXXQFV.js +57 -0
  461. package/dist/chunk-PMUZUPPE.js +131 -0
  462. package/dist/chunk-PN52EIFV.js +113 -0
  463. package/dist/chunk-PPQJIVGM.js +175 -0
  464. package/dist/chunk-PQYFOTNI.js +469 -0
  465. package/dist/chunk-PUX4YJAW.js +1095 -0
  466. package/dist/chunk-PYMQM65Y.js +125 -0
  467. package/dist/chunk-Q5UO7GT5.js +404 -0
  468. package/dist/chunk-QA5UNVHD.js +85 -0
  469. package/dist/chunk-QDZR7FXG.js +215 -0
  470. package/dist/chunk-QNOWKKZ4.js +40 -0
  471. package/dist/chunk-QUXQYYZO.js +73 -0
  472. package/dist/chunk-QVOTPOXK.js +29 -0
  473. package/dist/chunk-R2DSOIME.js +772 -0
  474. package/dist/chunk-RFQQXXJ6.js +366 -0
  475. package/dist/chunk-RLWI34XM.js +27 -0
  476. package/dist/chunk-RMWCGSEP.js +124 -0
  477. package/dist/chunk-ROTEQD2Z.js +441 -0
  478. package/dist/chunk-RPCWZFP7.js +296 -0
  479. package/dist/chunk-RW5QRWVI.js +141 -0
  480. package/dist/chunk-RZZHOHL6.js +5089 -0
  481. package/dist/chunk-S5STZCBZ.js +133 -0
  482. package/dist/chunk-SD4A5P24.js +1803 -0
  483. package/dist/chunk-SJM4TCWJ.js +197 -0
  484. package/dist/chunk-SJXK56WZ.js +905 -0
  485. package/dist/chunk-SJXK56WZ.js.map +1 -0
  486. package/dist/chunk-SQYTYXR4.js +100 -0
  487. package/dist/chunk-SRDHDIRQ.js +177 -0
  488. package/dist/chunk-SVC674IM.js +263 -0
  489. package/dist/chunk-SYYFA7W7.js +23 -0
  490. package/dist/chunk-T2UUHB7V.js +1187 -0
  491. package/dist/chunk-TBOH54QP.js +298 -0
  492. package/dist/chunk-TG2GO424.js +196 -0
  493. package/dist/chunk-TOJNLC42.js +107 -0
  494. package/dist/chunk-TW75KM7T.js +412 -0
  495. package/dist/chunk-TWWAPJYE.js +26 -0
  496. package/dist/chunk-UARZCGWU.js +202 -0
  497. package/dist/chunk-UCNTAS2U.js +2580 -0
  498. package/dist/chunk-UD7IARSL.js +162 -0
  499. package/dist/chunk-UDKZKGUQ.js +379 -0
  500. package/dist/chunk-UEUYUUZA.js +3183 -0
  501. package/dist/chunk-UEUYUUZA.js.map +1 -0
  502. package/dist/chunk-UJRSZ6ZB.js +391 -0
  503. package/dist/chunk-UTM23O3G.js +50 -0
  504. package/dist/chunk-UUJSS56V.js +4570 -0
  505. package/dist/chunk-UWSF733U.js +42 -0
  506. package/dist/chunk-V4ZYJWU3.js +386 -0
  507. package/dist/chunk-VEIT2EGK.js +207 -0
  508. package/dist/chunk-VGG6DOTN.js +172 -0
  509. package/dist/chunk-VGSGAQJX.js +82 -0
  510. package/dist/chunk-VHK5CBIG.js +2317 -0
  511. package/dist/chunk-VLA2DTYG.js +154 -0
  512. package/dist/chunk-VSN6XKZ5.js +278 -0
  513. package/dist/chunk-VW6TOTDQ.js +111 -0
  514. package/dist/chunk-W3HKBWPM.js +406 -0
  515. package/dist/chunk-WDYM5SFM.js +73 -0
  516. package/dist/chunk-WJ4AZ2AR.js +2551 -0
  517. package/dist/chunk-WMQHP4E3.js +214 -0
  518. package/dist/chunk-WP5A6F6P.js +269 -0
  519. package/dist/chunk-WUR2DYJX.js +527 -0
  520. package/dist/chunk-WUR2DYJX.js.map +1 -0
  521. package/dist/chunk-WWQH3L6M.js +407 -0
  522. package/dist/chunk-WYIC3CXE.js +157 -0
  523. package/dist/chunk-WYIC3CXE.js.map +1 -0
  524. package/dist/chunk-X3T6ULUZ.js +297 -0
  525. package/dist/chunk-XA32OUL4.js +52 -0
  526. package/dist/chunk-XCICIQIE.js +113 -0
  527. package/dist/chunk-XHRIUCBD.js +138 -0
  528. package/dist/chunk-XJBWVT5X.js +1177 -0
  529. package/dist/chunk-XKQRWJFE.js +270 -0
  530. package/dist/chunk-XN3EVUB5.js +134 -0
  531. package/dist/chunk-XT6GBN2G.js +828 -0
  532. package/dist/chunk-XYVDTM4D.js +184 -0
  533. package/dist/chunk-XZO5X3KH.js +84 -0
  534. package/dist/chunk-Y34DIEOG.js +201 -0
  535. package/dist/chunk-YAIYUFCX.js +114 -0
  536. package/dist/chunk-YFLRBEDS.js +200 -0
  537. package/dist/chunk-YIKMBS4B.js +10053 -0
  538. package/dist/chunk-YIKMBS4B.js.map +1 -0
  539. package/dist/chunk-YQX227EF.js +403 -0
  540. package/dist/chunk-YVAB57JZ.js +340 -0
  541. package/dist/chunk-YWHSODBB.js +250 -0
  542. package/dist/chunk-YWJHCJQW.js +218 -0
  543. package/dist/chunk-Z37DSW2K.js +570 -0
  544. package/dist/chunk-ZELN2B72.js +399 -0
  545. package/dist/chunk-ZFGGR2JW.js +236 -0
  546. package/dist/chunk-ZL7SEED7.js +773 -0
  547. package/dist/composer.js +37 -36
  548. package/dist/computer-viewer-CNYFTUGF.js +21 -0
  549. package/dist/connect.js +31 -30
  550. package/dist/connection-step-up-EZRZW2LY.js +147 -0
  551. package/dist/connection-step-up-EZRZW2LY.js.map +1 -0
  552. package/dist/desktop-dictation.js +24 -24
  553. package/dist/desktop.js +2 -2
  554. package/dist/editor.js +2 -2
  555. package/dist/embedded-new-voice-A56WDECM.js +25 -0
  556. package/dist/embedded-voice-CBTSMIWW.js +25 -0
  557. package/dist/fleet-decision-row-6PQTGI2U.js +361 -0
  558. package/dist/in-chat-connect-model.js +5 -5
  559. package/dist/index.js +299 -298
  560. package/dist/interaction.js +9 -9
  561. package/dist/latest-question-F3VPDR7U.js +1 -1
  562. package/dist/lib/modal-layer.d.ts +11 -0
  563. package/dist/machine-request-model.js +1 -1
  564. package/dist/machines.js +8 -8
  565. package/dist/meetings-recorder.js +1 -1
  566. package/dist/meetings.js +117 -116
  567. package/dist/meetings.js.map +1 -1
  568. package/dist/messages/en.d.ts +1 -0
  569. package/dist/messages.js +1 -1
  570. package/dist/model-policy-picker-menu-ZU72JATS.js +23 -0
  571. package/dist/payment-page-card-5VEUANFD.js +227 -0
  572. package/dist/payment-page-card-5VEUANFD.js.map +1 -0
  573. package/dist/platform-activity-row-5IQT6R5Z.js +156 -0
  574. package/dist/queue-surface-implementation-TPCJ4R6N.js +933 -0
  575. package/dist/queue-surface-implementation-TPCJ4R6N.js.map +1 -0
  576. package/dist/realtime.js +17 -17
  577. package/dist/recorder-host-G5M676VM.js +80 -0
  578. package/dist/recordings.js +3 -3
  579. package/dist/sandbox-files-HCXOP6ZO.js +29 -0
  580. package/dist/session-app.css +1 -1
  581. package/dist/session-app.css.map +1 -1
  582. package/dist/session-app.js +388 -387
  583. package/dist/session-connect-cards-MYJRQWSA.js +28 -0
  584. package/dist/session-list-model.js +2 -2
  585. package/dist/session-realtime-YFVGQFJK.js +30 -0
  586. package/dist/session-realtime.js +2 -2
  587. package/dist/session-ui.js +96 -95
  588. package/dist/session.js +42 -42
  589. package/dist/sites.js +3 -3
  590. package/dist/terminal.js +2 -2
  591. package/dist/this-computer.js +4 -3
  592. package/dist/timeline-annotation-markers-5ELTFV5B.js +157 -0
  593. package/dist/timeline-annotation-selection-XHUOFRIY.js +208 -0
  594. package/dist/timeline-annotations-dialog-X2VNDYZ4.js +283 -0
  595. package/dist/timeline-model.js +58 -58
  596. package/dist/ui/access-list.js +24 -23
  597. package/dist/ui/access-list.js.map +1 -1
  598. package/dist/ui/cadence-picker.js +7 -7
  599. package/dist/ui/choice-cards.js +3 -3
  600. package/dist/ui/confirm-dialog.js +4 -3
  601. package/dist/ui/copy-field.js +3 -3
  602. package/dist/ui/detail-page.js +6 -5
  603. package/dist/ui/detail-sheet.js +6 -5
  604. package/dist/ui/dialog.js +2 -1
  605. package/dist/ui/diff-view.js +3 -3
  606. package/dist/ui/disclosure.js +7 -6
  607. package/dist/ui/email-chips-input.js +3 -3
  608. package/dist/ui/field.js +2 -2
  609. package/dist/ui/flush-form-page.js +8 -7
  610. package/dist/ui/form-dialog.js +7 -6
  611. package/dist/ui/list-row.js +6 -6
  612. package/dist/ui/load-failure.js +3 -3
  613. package/dist/ui/relative-time.js +3 -3
  614. package/dist/ui/revision-history.js +13 -13
  615. package/dist/ui/role-select.js +12 -11
  616. package/dist/ui/select-menu.js +5 -5
  617. package/dist/ui/settings-nav.js +6 -6
  618. package/dist/ui/sheet.js +3 -2
  619. package/dist/ui/usage-meter.js +4 -4
  620. package/dist/usage.js +3 -3
  621. package/dist/workbench.js +11 -11
  622. package/package.json +6 -5
  623. package/src/app/components/command-menu/command-menu.tsx +232 -228
  624. package/src/components/automations/automation-model.ts +1 -0
  625. package/src/components/file-browser.tsx +69 -64
  626. package/src/components/session-capability-frame.tsx +36 -34
  627. package/src/components/this-computer/this-computer-setup.tsx +36 -29
  628. package/src/lib/modal-layer.tsx +33 -0
  629. package/src/messages/en.ts +1 -0
  630. package/src/timeline/screenshot-lightbox.tsx +137 -128
  631. package/src/ui/detail-sheet.tsx +44 -40
  632. package/src/ui/dialog.tsx +39 -35
  633. package/src/ui/form-dialog-layer.test.tsx +4 -3
  634. package/src/ui/form-dialog.tsx +28 -26
  635. package/src/ui/sheet.tsx +36 -46
  636. package/styles/compiled.css +57 -12
  637. package/styles/index.css +19 -0
  638. package/styles/this-computer.css +1 -1
  639. package/dist/browser-viewer-J6O65JXH.js +0 -23
  640. package/dist/chat-interactive-block-R5JEJYMR.js +0 -22
  641. package/dist/chunk-236GMLCR.js +0 -50
  642. package/dist/chunk-24S44WBL.js +0 -200
  643. package/dist/chunk-27HN57HE.js +0 -274
  644. package/dist/chunk-2FLGURHP.js +0 -297
  645. package/dist/chunk-2SH6CLOR.js +0 -378
  646. package/dist/chunk-2XZ3EUSP.js +0 -505
  647. package/dist/chunk-2ZC62PY4.js +0 -113
  648. package/dist/chunk-36YTBVYF.js +0 -197
  649. package/dist/chunk-3775TQE5.js +0 -10053
  650. package/dist/chunk-3775TQE5.js.map +0 -1
  651. package/dist/chunk-3CF2B2LD.js +0 -110
  652. package/dist/chunk-3GENISSH.js +0 -129
  653. package/dist/chunk-3IEVQMGO.js +0 -2431
  654. package/dist/chunk-3N3EN7FA.js +0 -34
  655. package/dist/chunk-3NMKLLEB.js +0 -218
  656. package/dist/chunk-3VSKLEUE.js +0 -4570
  657. package/dist/chunk-3X4HTUUR.js +0 -538
  658. package/dist/chunk-3XHPCZ6N.js +0 -380
  659. package/dist/chunk-3XHPCZ6N.js.map +0 -1
  660. package/dist/chunk-4GFLP4OY.js +0 -131
  661. package/dist/chunk-4GUPD7CJ.js +0 -234
  662. package/dist/chunk-4OGDD2EM.js +0 -2434
  663. package/dist/chunk-4T2RJ2HY.js +0 -93
  664. package/dist/chunk-4XEPZARK.js +0 -391
  665. package/dist/chunk-4YJGB22T.js +0 -570
  666. package/dist/chunk-4YNWA5YG.js +0 -236
  667. package/dist/chunk-4ZRGFCSP.js +0 -5919
  668. package/dist/chunk-4ZRGFCSP.js.map +0 -1
  669. package/dist/chunk-54NTSBQO.js +0 -33
  670. package/dist/chunk-5BRK72J5.js +0 -214
  671. package/dist/chunk-5BRK72J5.js.map +0 -1
  672. package/dist/chunk-5CGZOJN7.js +0 -111
  673. package/dist/chunk-5ERDSF2C.js +0 -79
  674. package/dist/chunk-5I6CWDA6.js +0 -3176
  675. package/dist/chunk-5I6CWDA6.js.map +0 -1
  676. package/dist/chunk-5JG277OH.js +0 -92
  677. package/dist/chunk-5JOTMM3F.js +0 -3996
  678. package/dist/chunk-5JOTMM3F.js.map +0 -1
  679. package/dist/chunk-5ORXRVXV.js +0 -469
  680. package/dist/chunk-5XVOL3KH.js +0 -931
  681. package/dist/chunk-67BMBRTK.js +0 -406
  682. package/dist/chunk-67JCL67N.js +0 -84
  683. package/dist/chunk-6F34IWSA.js +0 -47
  684. package/dist/chunk-6F34IWSA.js.map +0 -1
  685. package/dist/chunk-6GCMLYER.js +0 -432
  686. package/dist/chunk-6GODDS6F.js +0 -103
  687. package/dist/chunk-6GYRHQVL.js +0 -5089
  688. package/dist/chunk-6LF2ZE52.js +0 -851
  689. package/dist/chunk-6MSTIFAL.js +0 -406
  690. package/dist/chunk-6OMREP52.js +0 -187
  691. package/dist/chunk-6P3QOMPV.js +0 -57
  692. package/dist/chunk-6SPEMI7K.js +0 -850
  693. package/dist/chunk-6SPEMI7K.js.map +0 -1
  694. package/dist/chunk-6WGJB6GO.js +0 -65
  695. package/dist/chunk-72PGXQDN.js +0 -399
  696. package/dist/chunk-75LF7LSI.js +0 -307
  697. package/dist/chunk-7CIMPDGL.js +0 -26
  698. package/dist/chunk-7EJWP62C.js +0 -271
  699. package/dist/chunk-7FY47EN2.js +0 -138
  700. package/dist/chunk-7I4KWTJS.js +0 -112
  701. package/dist/chunk-7J3TLTPI.js +0 -50
  702. package/dist/chunk-7M5DPUGZ.js +0 -215
  703. package/dist/chunk-7ZQVRVNI.js +0 -1263
  704. package/dist/chunk-A2QOUEU3.js +0 -256
  705. package/dist/chunk-A36WG3BT.js +0 -175
  706. package/dist/chunk-ADFUTR45.js +0 -138
  707. package/dist/chunk-ADNH5GSP.js +0 -1236
  708. package/dist/chunk-AGW5H6QV.js +0 -1356
  709. package/dist/chunk-AHBEBGLO.js +0 -27
  710. package/dist/chunk-AJIGRQIO.js +0 -311
  711. package/dist/chunk-AP63EUPJ.js +0 -145
  712. package/dist/chunk-ATWXYAWP.js +0 -227
  713. package/dist/chunk-AU2DT7O2.js +0 -29
  714. package/dist/chunk-AX65L6QV.js +0 -316
  715. package/dist/chunk-AZHZ2EU4.js +0 -333
  716. package/dist/chunk-B57G2C45.js +0 -357
  717. package/dist/chunk-BIQMUTVW.js +0 -1333
  718. package/dist/chunk-BOZN54YB.js +0 -149
  719. package/dist/chunk-BOZN54YB.js.map +0 -1
  720. package/dist/chunk-BPCI4ZGR.js +0 -4979
  721. package/dist/chunk-BRJLN3ZL.js +0 -67
  722. package/dist/chunk-BY7AWWDB.js +0 -177
  723. package/dist/chunk-CBSBNUGV.js +0 -523
  724. package/dist/chunk-CBSBNUGV.js.map +0 -1
  725. package/dist/chunk-CGS44LYC.js +0 -1022
  726. package/dist/chunk-CGS44LYC.js.map +0 -1
  727. package/dist/chunk-CHKHQHOO.js +0 -3070
  728. package/dist/chunk-CSGKUDNB.js +0 -1024
  729. package/dist/chunk-CZPN2HP3.js +0 -441
  730. package/dist/chunk-D2VP4C5B.js +0 -515
  731. package/dist/chunk-D32VVOBJ.js +0 -738
  732. package/dist/chunk-D32VVOBJ.js.map +0 -1
  733. package/dist/chunk-D4AF4SOJ.js +0 -246
  734. package/dist/chunk-DCML4SXQ.js +0 -201
  735. package/dist/chunk-DECSYLBP.js +0 -572
  736. package/dist/chunk-DECSYLBP.js.map +0 -1
  737. package/dist/chunk-DEKCTHXM.js +0 -639
  738. package/dist/chunk-DGS62JWP.js +0 -828
  739. package/dist/chunk-DHXRMZPQ.js +0 -276
  740. package/dist/chunk-DJ4X4U4A.js +0 -1021
  741. package/dist/chunk-DLMMQMKZ.js +0 -2551
  742. package/dist/chunk-DWPE3Y7M.js +0 -144
  743. package/dist/chunk-EFD4DD3E.js +0 -113
  744. package/dist/chunk-EGSRY63C.js +0 -251
  745. package/dist/chunk-EIVA3MAH.js +0 -85
  746. package/dist/chunk-EJYHPNXD.js +0 -103
  747. package/dist/chunk-EQ263DHZ.js +0 -27
  748. package/dist/chunk-EVJ42E62.js +0 -137
  749. package/dist/chunk-EW3N5SCT.js +0 -1628
  750. package/dist/chunk-F47X7XPQ.js +0 -124
  751. package/dist/chunk-F4ESDJTE.js +0 -400
  752. package/dist/chunk-F7NV3EL5.js +0 -2580
  753. package/dist/chunk-FFWVFU6S.js +0 -48
  754. package/dist/chunk-FPPPLIGK.js +0 -1184
  755. package/dist/chunk-FUJ6DWRZ.js +0 -207
  756. package/dist/chunk-FWEMP52Y.js +0 -199
  757. package/dist/chunk-FX4HG4FR.js +0 -37
  758. package/dist/chunk-FZOK37SC.js +0 -155
  759. package/dist/chunk-GBGJIR6F.js +0 -404
  760. package/dist/chunk-GCURVP5U.js +0 -211
  761. package/dist/chunk-GFMRMSFN.js +0 -196
  762. package/dist/chunk-GH4VY3H5.js +0 -178
  763. package/dist/chunk-GJFTPSGN.js +0 -278
  764. package/dist/chunk-GKOIWZ4C.js +0 -794
  765. package/dist/chunk-GNTEF5TL.js +0 -158
  766. package/dist/chunk-GQF2HWQE.js +0 -407
  767. package/dist/chunk-GXYS6BI3.js +0 -311
  768. package/dist/chunk-H27MS36Q.js +0 -318
  769. package/dist/chunk-H4NDK35I.js +0 -85
  770. package/dist/chunk-H6DJIEO6.js +0 -269
  771. package/dist/chunk-HC7C4ZN2.js +0 -608
  772. package/dist/chunk-HUKGLWAY.js +0 -174
  773. package/dist/chunk-HUS2QEPV.js +0 -428
  774. package/dist/chunk-HUTQJY3F.js +0 -23
  775. package/dist/chunk-HWOYJOKK.js +0 -266
  776. package/dist/chunk-I46F7LUI.js +0 -15
  777. package/dist/chunk-I57PYKVN.js +0 -386
  778. package/dist/chunk-IBI3N3P7.js +0 -56
  779. package/dist/chunk-IEUZ4ASX.js +0 -3110
  780. package/dist/chunk-IHLF7R6Q.js +0 -1309
  781. package/dist/chunk-J3XWJ2A6.js +0 -209
  782. package/dist/chunk-J45WTHTL.js +0 -229
  783. package/dist/chunk-J4OOKDRV.js +0 -40
  784. package/dist/chunk-J6YVN3W7.js +0 -162
  785. package/dist/chunk-JOZFVEBN.js +0 -2984
  786. package/dist/chunk-K7GGLL2U.js +0 -231
  787. package/dist/chunk-KDHWX7XH.js +0 -292
  788. package/dist/chunk-KMLELG4O.js +0 -46
  789. package/dist/chunk-KQY4P4EO.js +0 -373
  790. package/dist/chunk-KSDCQPJY.js +0 -12
  791. package/dist/chunk-KW4OJ3RS.js +0 -175
  792. package/dist/chunk-KWOYMJKM.js +0 -1803
  793. package/dist/chunk-KYDLVMKA.js +0 -99
  794. package/dist/chunk-KZYQNVXE.js +0 -449
  795. package/dist/chunk-L3GNEC6B.js +0 -1019
  796. package/dist/chunk-L5JV7MAF.js +0 -372
  797. package/dist/chunk-LC5E7CVA.js +0 -191
  798. package/dist/chunk-LEYZQZFS.js +0 -121
  799. package/dist/chunk-LFMTPBET.js +0 -265
  800. package/dist/chunk-LFQI2C46.js +0 -175
  801. package/dist/chunk-LH3SDMDC.js +0 -172
  802. package/dist/chunk-LJKZGQTI.js +0 -192
  803. package/dist/chunk-LQDSZPB5.js +0 -73
  804. package/dist/chunk-LTYUE572.js +0 -117
  805. package/dist/chunk-M3WCB73E.js +0 -379
  806. package/dist/chunk-M47MKLW2.js +0 -283
  807. package/dist/chunk-M5FX5KH5.js +0 -629
  808. package/dist/chunk-MHL727ZE.js +0 -129
  809. package/dist/chunk-N3AAMSBH.js +0 -170
  810. package/dist/chunk-N4TJ7A7I.js +0 -41
  811. package/dist/chunk-NFZAMHSR.js +0 -401
  812. package/dist/chunk-NRAVQJE2.js +0 -61
  813. package/dist/chunk-NU4HYZ3C.js +0 -48
  814. package/dist/chunk-NUZNJSL5.js +0 -285
  815. package/dist/chunk-NY5DX43C.js +0 -133
  816. package/dist/chunk-O3C4BASC.js +0 -773
  817. package/dist/chunk-O5JDQZGV.js +0 -176
  818. package/dist/chunk-OMYT3X2Y.js +0 -107
  819. package/dist/chunk-OSQ6YGZW.js +0 -412
  820. package/dist/chunk-OWXSWGP3.js +0 -263
  821. package/dist/chunk-PBCSPCF6.js +0 -43
  822. package/dist/chunk-PBKG2OPJ.js +0 -849
  823. package/dist/chunk-PCP5GF77.js +0 -366
  824. package/dist/chunk-PCSRHFRF.js +0 -75
  825. package/dist/chunk-PHNHJKEL.js +0 -287
  826. package/dist/chunk-PIPD74PT.js +0 -650
  827. package/dist/chunk-PMBZMVKE.js +0 -33
  828. package/dist/chunk-PMVZYQ5W.js +0 -107
  829. package/dist/chunk-POUIWV6K.js +0 -2553
  830. package/dist/chunk-PTSRBKQC.js +0 -118
  831. package/dist/chunk-Q5AQJQXU.js +0 -114
  832. package/dist/chunk-QAS2OFG5.js +0 -371
  833. package/dist/chunk-QCJ6SNCP.js +0 -532
  834. package/dist/chunk-QFMPAR74.js +0 -73
  835. package/dist/chunk-QHF4B7R4.js +0 -166
  836. package/dist/chunk-QHGWFKTK.js +0 -52
  837. package/dist/chunk-QJ4YC4PM.js +0 -353
  838. package/dist/chunk-QMFX5BDA.js +0 -3851
  839. package/dist/chunk-QSG6FWOK.js +0 -126
  840. package/dist/chunk-QTT5574G.js +0 -154
  841. package/dist/chunk-R6CFPY3F.js +0 -278
  842. package/dist/chunk-R6OBJ7LF.js +0 -131
  843. package/dist/chunk-R6OBJ7LF.js.map +0 -1
  844. package/dist/chunk-RAUWORZV.js +0 -1187
  845. package/dist/chunk-RG7PMYWW.js +0 -82
  846. package/dist/chunk-RLS563ST.js +0 -403
  847. package/dist/chunk-RQAE6DI7.js +0 -259
  848. package/dist/chunk-RWWQLVGV.js +0 -184
  849. package/dist/chunk-S6GFECVG.js +0 -56
  850. package/dist/chunk-SBWVYYRA.js +0 -283
  851. package/dist/chunk-SHW2QUOE.js +0 -158
  852. package/dist/chunk-SQJQVTHA.js +0 -3690
  853. package/dist/chunk-STTCF3OR.js +0 -202
  854. package/dist/chunk-SVG5U7UN.js +0 -270
  855. package/dist/chunk-SY6V3Z2U.js +0 -270
  856. package/dist/chunk-T3WYQHAO.js +0 -42
  857. package/dist/chunk-TCDDOFRG.js +0 -79
  858. package/dist/chunk-TGG3ODCS.js +0 -99
  859. package/dist/chunk-TL6UOSMX.js +0 -4519
  860. package/dist/chunk-TL6UOSMX.js.map +0 -1
  861. package/dist/chunk-TU6FW6IJ.js +0 -566
  862. package/dist/chunk-TXSZR2SB.js +0 -188
  863. package/dist/chunk-TYZ3WUKG.js +0 -1095
  864. package/dist/chunk-U3GQZEAO.js +0 -584
  865. package/dist/chunk-U4EMW7RP.js +0 -249
  866. package/dist/chunk-UBSHJB6M.js +0 -83
  867. package/dist/chunk-UFRXYZCJ.js +0 -125
  868. package/dist/chunk-UHBIXNRW.js +0 -100
  869. package/dist/chunk-UJB54P4M.js +0 -335
  870. package/dist/chunk-UJKVMFFF.js +0 -114
  871. package/dist/chunk-UJSXNGKJ.js +0 -141
  872. package/dist/chunk-UNOJ5PNN.js +0 -3321
  873. package/dist/chunk-UOBJFO25.js +0 -351
  874. package/dist/chunk-UPRN4FBY.js +0 -38
  875. package/dist/chunk-UQQUMT5P.js +0 -91
  876. package/dist/chunk-UTFX46TK.js +0 -1177
  877. package/dist/chunk-V5HRUE42.js +0 -396
  878. package/dist/chunk-VCWRMKTQ.js +0 -296
  879. package/dist/chunk-VJAP57SP.js +0 -114
  880. package/dist/chunk-VMJN6YQL.js +0 -391
  881. package/dist/chunk-VUNGU657.js +0 -20
  882. package/dist/chunk-VWEGG7JQ.js +0 -134
  883. package/dist/chunk-VWT7ORWC.js +0 -437
  884. package/dist/chunk-VWT7ORWC.js.map +0 -1
  885. package/dist/chunk-VXGQVX53.js +0 -1152
  886. package/dist/chunk-W7UFWXZ6.js +0 -72
  887. package/dist/chunk-WKBJNGYV.js +0 -230
  888. package/dist/chunk-WZZV7DUU.js +0 -723
  889. package/dist/chunk-XDWW2DLJ.js +0 -247
  890. package/dist/chunk-XF55A7CC.js +0 -162
  891. package/dist/chunk-XGUBIE35.js +0 -187
  892. package/dist/chunk-XIUJL352.js +0 -66
  893. package/dist/chunk-XKPVWLMM.js +0 -383
  894. package/dist/chunk-XSR6J5LY.js +0 -234
  895. package/dist/chunk-Y2LD4FTV.js +0 -132
  896. package/dist/chunk-Y3TQ2M2O.js +0 -214
  897. package/dist/chunk-Y5HXP2NR.js +0 -251
  898. package/dist/chunk-Y6CNWBV3.js +0 -264
  899. package/dist/chunk-YGPMLIFT.js +0 -2317
  900. package/dist/chunk-YIR4KVJO.js +0 -389
  901. package/dist/chunk-YN6UVG4Z.js +0 -250
  902. package/dist/chunk-YNIDJOGT.js +0 -340
  903. package/dist/chunk-YP4SNX4P.js +0 -220
  904. package/dist/chunk-YPIOAMHD.js +0 -246
  905. package/dist/chunk-YPM3T3UM.js +0 -598
  906. package/dist/chunk-YRJZYQ5A.js +0 -898
  907. package/dist/chunk-YRJZYQ5A.js.map +0 -1
  908. package/dist/chunk-YVODOJZG.js +0 -298
  909. package/dist/chunk-ZAGLLXX5.js +0 -107
  910. package/dist/chunk-ZD67RM6G.js +0 -60
  911. package/dist/chunk-ZLY7M463.js +0 -1185
  912. package/dist/chunk-ZNIG3CPB.js +0 -98
  913. package/dist/chunk-ZOQKWIFS.js +0 -108
  914. package/dist/chunk-ZU5WVSHV.js +0 -168
  915. package/dist/chunk-ZWEVJPXC.js +0 -818
  916. package/dist/chunk-ZWFLYN7T.js +0 -772
  917. package/dist/computer-viewer-ZISZUM4L.js +0 -21
  918. package/dist/connection-step-up-UQHDCXFE.js +0 -146
  919. package/dist/connection-step-up-UQHDCXFE.js.map +0 -1
  920. package/dist/embedded-new-voice-UWSSA7AB.js +0 -25
  921. package/dist/embedded-voice-T34K465A.js +0 -25
  922. package/dist/fleet-decision-row-REAWMEHI.js +0 -361
  923. package/dist/model-policy-picker-menu-2CTRKSDJ.js +0 -23
  924. package/dist/payment-page-card-OOOFGIMH.js +0 -226
  925. package/dist/payment-page-card-OOOFGIMH.js.map +0 -1
  926. package/dist/platform-activity-row-EZYTZPYR.js +0 -156
  927. package/dist/queue-surface-implementation-HDZ42LN7.js +0 -932
  928. package/dist/queue-surface-implementation-HDZ42LN7.js.map +0 -1
  929. package/dist/recorder-host-6HFQQTNI.js +0 -80
  930. package/dist/sandbox-files-6JY7WVMO.js +0 -28
  931. package/dist/session-connect-cards-VTSJODCX.js +0 -27
  932. package/dist/session-realtime-G3ZGG3KR.js +0 -30
  933. package/dist/timeline-annotation-markers-S6DMHCI6.js +0 -157
  934. package/dist/timeline-annotation-selection-UFZOKL5E.js +0 -208
  935. package/dist/timeline-annotations-dialog-FPJ4MPHD.js +0 -283
  936. /package/dist/{browser-viewer-J6O65JXH.js.map → browser-viewer-O5FJOWWI.js.map} +0 -0
  937. /package/dist/{chat-interactive-block-R5JEJYMR.js.map → chat-interactive-block-TQTOUHRC.js.map} +0 -0
  938. /package/dist/{chunk-SQJQVTHA.js.map → chunk-23TTCFRP.js.map} +0 -0
  939. /package/dist/{chunk-3GENISSH.js.map → chunk-2BOFLWNJ.js.map} +0 -0
  940. /package/dist/{chunk-6LF2ZE52.js.map → chunk-3DMD2KHT.js.map} +0 -0
  941. /package/dist/{chunk-Y2LD4FTV.js.map → chunk-3DOISS3I.js.map} +0 -0
  942. /package/dist/{chunk-FWEMP52Y.js.map → chunk-3KWTXE4O.js.map} +0 -0
  943. /package/dist/{chunk-4T2RJ2HY.js.map → chunk-3TRERIPD.js.map} +0 -0
  944. /package/dist/{chunk-5JG277OH.js.map → chunk-3UXBTL7Z.js.map} +0 -0
  945. /package/dist/{chunk-M47MKLW2.js.map → chunk-3XEKXNB4.js.map} +0 -0
  946. /package/dist/{chunk-HUS2QEPV.js.map → chunk-3ZJUQG4K.js.map} +0 -0
  947. /package/dist/{chunk-UJB54P4M.js.map → chunk-42WTAUUW.js.map} +0 -0
  948. /package/dist/{chunk-UPRN4FBY.js.map → chunk-46ZC5VNC.js.map} +0 -0
  949. /package/dist/{chunk-QHF4B7R4.js.map → chunk-4BVEFGX7.js.map} +0 -0
  950. /package/dist/{chunk-NFZAMHSR.js.map → chunk-4IOFV4S4.js.map} +0 -0
  951. /package/dist/{chunk-EVJ42E62.js.map → chunk-4ISXBLJV.js.map} +0 -0
  952. /package/dist/{chunk-SBWVYYRA.js.map → chunk-4L2MBYLH.js.map} +0 -0
  953. /package/dist/{chunk-O5JDQZGV.js.map → chunk-4NWUZ6SL.js.map} +0 -0
  954. /package/dist/{chunk-H27MS36Q.js.map → chunk-4QVX6CTT.js.map} +0 -0
  955. /package/dist/{chunk-JOZFVEBN.js.map → chunk-4YARO4Y5.js.map} +0 -0
  956. /package/dist/{chunk-3N3EN7FA.js.map → chunk-4Z7BPBS7.js.map} +0 -0
  957. /package/dist/{chunk-GKOIWZ4C.js.map → chunk-55ILMX6B.js.map} +0 -0
  958. /package/dist/{chunk-6GODDS6F.js.map → chunk-57OAQTWD.js.map} +0 -0
  959. /package/dist/{chunk-KMLELG4O.js.map → chunk-5GXX3NI7.js.map} +0 -0
  960. /package/dist/{chunk-QJ4YC4PM.js.map → chunk-5VE3PPSK.js.map} +0 -0
  961. /package/dist/{chunk-HWOYJOKK.js.map → chunk-62T2ZPD5.js.map} +0 -0
  962. /package/dist/{chunk-EGSRY63C.js.map → chunk-655JT4VH.js.map} +0 -0
  963. /package/dist/{chunk-2XZ3EUSP.js.map → chunk-65OPNLE4.js.map} +0 -0
  964. /package/dist/{chunk-J45WTHTL.js.map → chunk-67PIP46J.js.map} +0 -0
  965. /package/dist/{chunk-GCURVP5U.js.map → chunk-6CAK65QV.js.map} +0 -0
  966. /package/dist/{chunk-PMBZMVKE.js.map → chunk-6CDBX3XG.js.map} +0 -0
  967. /package/dist/{chunk-R6CFPY3F.js.map → chunk-6D3D2JWY.js.map} +0 -0
  968. /package/dist/{chunk-PMVZYQ5W.js.map → chunk-6DGQB6GT.js.map} +0 -0
  969. /package/dist/{chunk-TXSZR2SB.js.map → chunk-6NFK3J2O.js.map} +0 -0
  970. /package/dist/{chunk-3X4HTUUR.js.map → chunk-6R3QX3AC.js.map} +0 -0
  971. /package/dist/{chunk-F4ESDJTE.js.map → chunk-6S5OMLAL.js.map} +0 -0
  972. /package/dist/{chunk-U4EMW7RP.js.map → chunk-6SG2VVVB.js.map} +0 -0
  973. /package/dist/{chunk-3CF2B2LD.js.map → chunk-6U57GGJI.js.map} +0 -0
  974. /package/dist/{chunk-ZNIG3CPB.js.map → chunk-6V2PEFPS.js.map} +0 -0
  975. /package/dist/{chunk-UNOJ5PNN.js.map → chunk-6VASZZVV.js.map} +0 -0
  976. /package/dist/{chunk-ZU5WVSHV.js.map → chunk-7BBYH5R5.js.map} +0 -0
  977. /package/dist/{chunk-J3XWJ2A6.js.map → chunk-7EO3T3IX.js.map} +0 -0
  978. /package/dist/{chunk-SHW2QUOE.js.map → chunk-7EZQ6EKM.js.map} +0 -0
  979. /package/dist/{chunk-I46F7LUI.js.map → chunk-7HI53NPP.js.map} +0 -0
  980. /package/dist/{chunk-FX4HG4FR.js.map → chunk-7J4BFENI.js.map} +0 -0
  981. /package/dist/{chunk-Q5AQJQXU.js.map → chunk-7LSGNY2L.js.map} +0 -0
  982. /package/dist/{chunk-ADNH5GSP.js.map → chunk-7MMONDFK.js.map} +0 -0
  983. /package/dist/{chunk-KW4OJ3RS.js.map → chunk-7MWPBGDX.js.map} +0 -0
  984. /package/dist/{chunk-QAS2OFG5.js.map → chunk-7NSDIQMY.js.map} +0 -0
  985. /package/dist/{chunk-K7GGLL2U.js.map → chunk-7XPDLT5G.js.map} +0 -0
  986. /package/dist/{chunk-2SH6CLOR.js.map → chunk-A3BCF4MV.js.map} +0 -0
  987. /package/dist/{chunk-PBKG2OPJ.js.map → chunk-A5GX3CAE.js.map} +0 -0
  988. /package/dist/{chunk-D2VP4C5B.js.map → chunk-AAHQJWEP.js.map} +0 -0
  989. /package/dist/{chunk-DWPE3Y7M.js.map → chunk-AAWEPZOG.js.map} +0 -0
  990. /package/dist/{chunk-YPM3T3UM.js.map → chunk-ABRT345L.js.map} +0 -0
  991. /package/dist/{chunk-UQQUMT5P.js.map → chunk-ANXFE2EP.js.map} +0 -0
  992. /package/dist/{chunk-7EJWP62C.js.map → chunk-AQNE4XWU.js.map} +0 -0
  993. /package/dist/{chunk-BPCI4ZGR.js.map → chunk-AV2OMWDS.js.map} +0 -0
  994. /package/dist/{chunk-L3GNEC6B.js.map → chunk-AYHMHAU5.js.map} +0 -0
  995. /package/dist/{chunk-7J3TLTPI.js.map → chunk-AZ637XK3.js.map} +0 -0
  996. /package/dist/{chunk-4OGDD2EM.js.map → chunk-B6AH43UQ.js.map} +0 -0
  997. /package/dist/{chunk-XKPVWLMM.js.map → chunk-BBECLK22.js.map} +0 -0
  998. /package/dist/{chunk-GNTEF5TL.js.map → chunk-BWYPJG3P.js.map} +0 -0
  999. /package/dist/{chunk-V5HRUE42.js.map → chunk-CI7F4Y26.js.map} +0 -0
  1000. /package/dist/{chunk-5XVOL3KH.js.map → chunk-CNLSXEQC.js.map} +0 -0
  1001. /package/dist/{chunk-6WGJB6GO.js.map → chunk-COCB4HE3.js.map} +0 -0
  1002. /package/dist/{chunk-B57G2C45.js.map → chunk-CPEVLG3B.js.map} +0 -0
  1003. /package/dist/{chunk-FZOK37SC.js.map → chunk-CVC4RO7D.js.map} +0 -0
  1004. /package/dist/{chunk-IEUZ4ASX.js.map → chunk-CY6RLRHJ.js.map} +0 -0
  1005. /package/dist/{chunk-LTYUE572.js.map → chunk-D3WLSMCL.js.map} +0 -0
  1006. /package/dist/{chunk-GH4VY3H5.js.map → chunk-D7SSOJEU.js.map} +0 -0
  1007. /package/dist/{chunk-ZWEVJPXC.js.map → chunk-DBOD5WXT.js.map} +0 -0
  1008. /package/dist/{chunk-J6YVN3W7.js.map → chunk-DFWSRIFL.js.map} +0 -0
  1009. /package/dist/{chunk-QSG6FWOK.js.map → chunk-DITZUBOK.js.map} +0 -0
  1010. /package/dist/{chunk-PHNHJKEL.js.map → chunk-DKD2ZZSJ.js.map} +0 -0
  1011. /package/dist/{chunk-YPIOAMHD.js.map → chunk-DOJWHSRD.js.map} +0 -0
  1012. /package/dist/{chunk-XGUBIE35.js.map → chunk-DR6LZXJI.js.map} +0 -0
  1013. /package/dist/{chunk-PIPD74PT.js.map → chunk-DV73XOVB.js.map} +0 -0
  1014. /package/dist/{chunk-AX65L6QV.js.map → chunk-DYO7DNDD.js.map} +0 -0
  1015. /package/dist/{chunk-4GUPD7CJ.js.map → chunk-DYZASWWT.js.map} +0 -0
  1016. /package/dist/{chunk-7ZQVRVNI.js.map → chunk-EC5HUNXI.js.map} +0 -0
  1017. /package/dist/{chunk-XDWW2DLJ.js.map → chunk-ECQ7FV3E.js.map} +0 -0
  1018. /package/dist/{chunk-67BMBRTK.js.map → chunk-ECVCSZWY.js.map} +0 -0
  1019. /package/dist/{chunk-AZHZ2EU4.js.map → chunk-EMXO5HCY.js.map} +0 -0
  1020. /package/dist/{chunk-LFMTPBET.js.map → chunk-ENJX5TAA.js.map} +0 -0
  1021. /package/dist/{chunk-XIUJL352.js.map → chunk-EQSYPIAI.js.map} +0 -0
  1022. /package/dist/{chunk-VXGQVX53.js.map → chunk-EV73XMK3.js.map} +0 -0
  1023. /package/dist/{chunk-POUIWV6K.js.map → chunk-F2SGC74A.js.map} +0 -0
  1024. /package/dist/{chunk-WKBJNGYV.js.map → chunk-F5DEBD4D.js.map} +0 -0
  1025. /package/dist/{chunk-TU6FW6IJ.js.map → chunk-F6JJBUQ2.js.map} +0 -0
  1026. /package/dist/{chunk-CSGKUDNB.js.map → chunk-FEVZDJOZ.js.map} +0 -0
  1027. /package/dist/{chunk-LEYZQZFS.js.map → chunk-FF22IUY3.js.map} +0 -0
  1028. /package/dist/{chunk-A2QOUEU3.js.map → chunk-FILRDNUQ.js.map} +0 -0
  1029. /package/dist/{chunk-ATWXYAWP.js.map → chunk-FLB3BP2E.js.map} +0 -0
  1030. /package/dist/{chunk-DEKCTHXM.js.map → chunk-FZVMMHPC.js.map} +0 -0
  1031. /package/dist/{chunk-7I4KWTJS.js.map → chunk-G6D5NVWM.js.map} +0 -0
  1032. /package/dist/{chunk-LJKZGQTI.js.map → chunk-GGH5STTP.js.map} +0 -0
  1033. /package/dist/{chunk-6OMREP52.js.map → chunk-GGHX6GS7.js.map} +0 -0
  1034. /package/dist/{chunk-HUKGLWAY.js.map → chunk-GIHE7U3Y.js.map} +0 -0
  1035. /package/dist/{chunk-Y6CNWBV3.js.map → chunk-GO5VIAA7.js.map} +0 -0
  1036. /package/dist/{chunk-AHBEBGLO.js.map → chunk-GSK637QS.js.map} +0 -0
  1037. /package/dist/{chunk-S6GFECVG.js.map → chunk-HBYO34CP.js.map} +0 -0
  1038. /package/dist/{chunk-PTSRBKQC.js.map → chunk-HFROJDFQ.js.map} +0 -0
  1039. /package/dist/{chunk-Y5HXP2NR.js.map → chunk-HGEDFQ7G.js.map} +0 -0
  1040. /package/dist/{chunk-AGW5H6QV.js.map → chunk-HH3QTFGV.js.map} +0 -0
  1041. /package/dist/{chunk-YP4SNX4P.js.map → chunk-HHFFPE67.js.map} +0 -0
  1042. /package/dist/{chunk-D4AF4SOJ.js.map → chunk-HHYTB5OL.js.map} +0 -0
  1043. /package/dist/{chunk-FFWVFU6S.js.map → chunk-HPKWAHHI.js.map} +0 -0
  1044. /package/dist/{chunk-KQY4P4EO.js.map → chunk-HSPOCEGP.js.map} +0 -0
  1045. /package/dist/{chunk-HC7C4ZN2.js.map → chunk-IC74VN2I.js.map} +0 -0
  1046. /package/dist/{chunk-DJ4X4U4A.js.map → chunk-ICSQO2CV.js.map} +0 -0
  1047. /package/dist/{chunk-CHKHQHOO.js.map → chunk-IEZE7SL6.js.map} +0 -0
  1048. /package/dist/{chunk-N3AAMSBH.js.map → chunk-IGHNTARW.js.map} +0 -0
  1049. /package/dist/{chunk-7FY47EN2.js.map → chunk-IKYS56PQ.js.map} +0 -0
  1050. /package/dist/{chunk-IBI3N3P7.js.map → chunk-IO474NRY.js.map} +0 -0
  1051. /package/dist/{chunk-WZZV7DUU.js.map → chunk-IP2CCFAV.js.map} +0 -0
  1052. /package/dist/{chunk-QMFX5BDA.js.map → chunk-IT5GF54F.js.map} +0 -0
  1053. /package/dist/{chunk-SVG5U7UN.js.map → chunk-IX67G5FD.js.map} +0 -0
  1054. /package/dist/{chunk-KDHWX7XH.js.map → chunk-IXNJK7KJ.js.map} +0 -0
  1055. /package/dist/{chunk-DHXRMZPQ.js.map → chunk-IZWTARYT.js.map} +0 -0
  1056. /package/dist/{chunk-ZOQKWIFS.js.map → chunk-JBV2HY43.js.map} +0 -0
  1057. /package/dist/{chunk-54NTSBQO.js.map → chunk-JE62XK5K.js.map} +0 -0
  1058. /package/dist/{chunk-EIVA3MAH.js.map → chunk-JFAWCALM.js.map} +0 -0
  1059. /package/dist/{chunk-UBSHJB6M.js.map → chunk-JQGPATQZ.js.map} +0 -0
  1060. /package/dist/{chunk-27HN57HE.js.map → chunk-JYZGX5UZ.js.map} +0 -0
  1061. /package/dist/{chunk-W7UFWXZ6.js.map → chunk-K227GMSM.js.map} +0 -0
  1062. /package/dist/{chunk-KZYQNVXE.js.map → chunk-KB2O7JIJ.js.map} +0 -0
  1063. /package/dist/{chunk-KSDCQPJY.js.map → chunk-KT6GC67G.js.map} +0 -0
  1064. /package/dist/{chunk-PCSRHFRF.js.map → chunk-KTGKGHEA.js.map} +0 -0
  1065. /package/dist/{chunk-NUZNJSL5.js.map → chunk-KU77XHWB.js.map} +0 -0
  1066. /package/dist/{chunk-A36WG3BT.js.map → chunk-KZIRVLCM.js.map} +0 -0
  1067. /package/dist/{chunk-RQAE6DI7.js.map → chunk-L3DUSTRN.js.map} +0 -0
  1068. /package/dist/{chunk-NRAVQJE2.js.map → chunk-L6WVCO6D.js.map} +0 -0
  1069. /package/dist/{chunk-TCDDOFRG.js.map → chunk-L7PCZEEG.js.map} +0 -0
  1070. /package/dist/{chunk-GXYS6BI3.js.map → chunk-LEN2DVU6.js.map} +0 -0
  1071. /package/dist/{chunk-LC5E7CVA.js.map → chunk-LGOQW2CE.js.map} +0 -0
  1072. /package/dist/{chunk-YIR4KVJO.js.map → chunk-LK2JO72Y.js.map} +0 -0
  1073. /package/dist/{chunk-U3GQZEAO.js.map → chunk-LXLHIOJM.js.map} +0 -0
  1074. /package/dist/{chunk-BIQMUTVW.js.map → chunk-LYQQ4VBE.js.map} +0 -0
  1075. /package/dist/{chunk-EW3N5SCT.js.map → chunk-M22ZHQ7S.js.map} +0 -0
  1076. /package/dist/{chunk-VUNGU657.js.map → chunk-M5RKFV6K.js.map} +0 -0
  1077. /package/dist/{chunk-TGG3ODCS.js.map → chunk-MCPKUVMQ.js.map} +0 -0
  1078. /package/dist/{chunk-AP63EUPJ.js.map → chunk-MDGNCUAC.js.map} +0 -0
  1079. /package/dist/{chunk-KYDLVMKA.js.map → chunk-MFLU3466.js.map} +0 -0
  1080. /package/dist/{chunk-ZD67RM6G.js.map → chunk-MIUJ3EH5.js.map} +0 -0
  1081. /package/dist/{chunk-M5FX5KH5.js.map → chunk-MO3XJQN2.js.map} +0 -0
  1082. /package/dist/{chunk-OMYT3X2Y.js.map → chunk-MTHAYXDH.js.map} +0 -0
  1083. /package/dist/{chunk-5ERDSF2C.js.map → chunk-MVYQDBE6.js.map} +0 -0
  1084. /package/dist/{chunk-75LF7LSI.js.map → chunk-NA7VZQPL.js.map} +0 -0
  1085. /package/dist/{chunk-3IEVQMGO.js.map → chunk-ND6FWOSO.js.map} +0 -0
  1086. /package/dist/{chunk-UOBJFO25.js.map → chunk-NIFPH34L.js.map} +0 -0
  1087. /package/dist/{chunk-EJYHPNXD.js.map → chunk-NKYC6WHQ.js.map} +0 -0
  1088. /package/dist/{chunk-4XEPZARK.js.map → chunk-NML7VKLU.js.map} +0 -0
  1089. /package/dist/{chunk-N4TJ7A7I.js.map → chunk-NPAWLKJB.js.map} +0 -0
  1090. /package/dist/{chunk-ZLY7M463.js.map → chunk-NQSKI2YD.js.map} +0 -0
  1091. /package/dist/{chunk-VJAP57SP.js.map → chunk-NXQFBC22.js.map} +0 -0
  1092. /package/dist/{chunk-PBCSPCF6.js.map → chunk-NXRZMHVM.js.map} +0 -0
  1093. /package/dist/{chunk-IHLF7R6Q.js.map → chunk-NYU5DE4K.js.map} +0 -0
  1094. /package/dist/{chunk-NU4HYZ3C.js.map → chunk-O2EEYPIZ.js.map} +0 -0
  1095. /package/dist/{chunk-BRJLN3ZL.js.map → chunk-O4TOEISQ.js.map} +0 -0
  1096. /package/dist/{chunk-MHL727ZE.js.map → chunk-O533L2TG.js.map} +0 -0
  1097. /package/dist/{chunk-QCJ6SNCP.js.map → chunk-ON6ZGJDW.js.map} +0 -0
  1098. /package/dist/{chunk-AJIGRQIO.js.map → chunk-OPELE3Z4.js.map} +0 -0
  1099. /package/dist/{chunk-XSR6J5LY.js.map → chunk-OTSUC6PP.js.map} +0 -0
  1100. /package/dist/{chunk-FPPPLIGK.js.map → chunk-OZNL5OKT.js.map} +0 -0
  1101. /package/dist/{chunk-6GCMLYER.js.map → chunk-P3PDKPLK.js.map} +0 -0
  1102. /package/dist/{chunk-L5JV7MAF.js.map → chunk-PCZBYN2H.js.map} +0 -0
  1103. /package/dist/{chunk-6P3QOMPV.js.map → chunk-PIPXXQFV.js.map} +0 -0
  1104. /package/dist/{chunk-4GFLP4OY.js.map → chunk-PMUZUPPE.js.map} +0 -0
  1105. /package/dist/{chunk-EFD4DD3E.js.map → chunk-PN52EIFV.js.map} +0 -0
  1106. /package/dist/{chunk-LFQI2C46.js.map → chunk-PPQJIVGM.js.map} +0 -0
  1107. /package/dist/{chunk-5ORXRVXV.js.map → chunk-PQYFOTNI.js.map} +0 -0
  1108. /package/dist/{chunk-TYZ3WUKG.js.map → chunk-PUX4YJAW.js.map} +0 -0
  1109. /package/dist/{chunk-UFRXYZCJ.js.map → chunk-PYMQM65Y.js.map} +0 -0
  1110. /package/dist/{chunk-GBGJIR6F.js.map → chunk-Q5UO7GT5.js.map} +0 -0
  1111. /package/dist/{chunk-H4NDK35I.js.map → chunk-QA5UNVHD.js.map} +0 -0
  1112. /package/dist/{chunk-7M5DPUGZ.js.map → chunk-QDZR7FXG.js.map} +0 -0
  1113. /package/dist/{chunk-J4OOKDRV.js.map → chunk-QNOWKKZ4.js.map} +0 -0
  1114. /package/dist/{chunk-QFMPAR74.js.map → chunk-QUXQYYZO.js.map} +0 -0
  1115. /package/dist/{chunk-AU2DT7O2.js.map → chunk-QVOTPOXK.js.map} +0 -0
  1116. /package/dist/{chunk-ZWFLYN7T.js.map → chunk-R2DSOIME.js.map} +0 -0
  1117. /package/dist/{chunk-PCP5GF77.js.map → chunk-RFQQXXJ6.js.map} +0 -0
  1118. /package/dist/{chunk-EQ263DHZ.js.map → chunk-RLWI34XM.js.map} +0 -0
  1119. /package/dist/{chunk-F47X7XPQ.js.map → chunk-RMWCGSEP.js.map} +0 -0
  1120. /package/dist/{chunk-CZPN2HP3.js.map → chunk-ROTEQD2Z.js.map} +0 -0
  1121. /package/dist/{chunk-VCWRMKTQ.js.map → chunk-RPCWZFP7.js.map} +0 -0
  1122. /package/dist/{chunk-UJSXNGKJ.js.map → chunk-RW5QRWVI.js.map} +0 -0
  1123. /package/dist/{chunk-6GYRHQVL.js.map → chunk-RZZHOHL6.js.map} +0 -0
  1124. /package/dist/{chunk-NY5DX43C.js.map → chunk-S5STZCBZ.js.map} +0 -0
  1125. /package/dist/{chunk-KWOYMJKM.js.map → chunk-SD4A5P24.js.map} +0 -0
  1126. /package/dist/{chunk-36YTBVYF.js.map → chunk-SJM4TCWJ.js.map} +0 -0
  1127. /package/dist/{chunk-UHBIXNRW.js.map → chunk-SQYTYXR4.js.map} +0 -0
  1128. /package/dist/{chunk-BY7AWWDB.js.map → chunk-SRDHDIRQ.js.map} +0 -0
  1129. /package/dist/{chunk-OWXSWGP3.js.map → chunk-SVC674IM.js.map} +0 -0
  1130. /package/dist/{chunk-HUTQJY3F.js.map → chunk-SYYFA7W7.js.map} +0 -0
  1131. /package/dist/{chunk-RAUWORZV.js.map → chunk-T2UUHB7V.js.map} +0 -0
  1132. /package/dist/{chunk-YVODOJZG.js.map → chunk-TBOH54QP.js.map} +0 -0
  1133. /package/dist/{chunk-GFMRMSFN.js.map → chunk-TG2GO424.js.map} +0 -0
  1134. /package/dist/{chunk-ZAGLLXX5.js.map → chunk-TOJNLC42.js.map} +0 -0
  1135. /package/dist/{chunk-OSQ6YGZW.js.map → chunk-TW75KM7T.js.map} +0 -0
  1136. /package/dist/{chunk-7CIMPDGL.js.map → chunk-TWWAPJYE.js.map} +0 -0
  1137. /package/dist/{chunk-STTCF3OR.js.map → chunk-UARZCGWU.js.map} +0 -0
  1138. /package/dist/{chunk-F7NV3EL5.js.map → chunk-UCNTAS2U.js.map} +0 -0
  1139. /package/dist/{chunk-XF55A7CC.js.map → chunk-UD7IARSL.js.map} +0 -0
  1140. /package/dist/{chunk-M3WCB73E.js.map → chunk-UDKZKGUQ.js.map} +0 -0
  1141. /package/dist/{chunk-VMJN6YQL.js.map → chunk-UJRSZ6ZB.js.map} +0 -0
  1142. /package/dist/{chunk-236GMLCR.js.map → chunk-UTM23O3G.js.map} +0 -0
  1143. /package/dist/{chunk-3VSKLEUE.js.map → chunk-UUJSS56V.js.map} +0 -0
  1144. /package/dist/{chunk-T3WYQHAO.js.map → chunk-UWSF733U.js.map} +0 -0
  1145. /package/dist/{chunk-I57PYKVN.js.map → chunk-V4ZYJWU3.js.map} +0 -0
  1146. /package/dist/{chunk-FUJ6DWRZ.js.map → chunk-VEIT2EGK.js.map} +0 -0
  1147. /package/dist/{chunk-LH3SDMDC.js.map → chunk-VGG6DOTN.js.map} +0 -0
  1148. /package/dist/{chunk-RG7PMYWW.js.map → chunk-VGSGAQJX.js.map} +0 -0
  1149. /package/dist/{chunk-YGPMLIFT.js.map → chunk-VHK5CBIG.js.map} +0 -0
  1150. /package/dist/{chunk-QTT5574G.js.map → chunk-VLA2DTYG.js.map} +0 -0
  1151. /package/dist/{chunk-GJFTPSGN.js.map → chunk-VSN6XKZ5.js.map} +0 -0
  1152. /package/dist/{chunk-5CGZOJN7.js.map → chunk-VW6TOTDQ.js.map} +0 -0
  1153. /package/dist/{chunk-6MSTIFAL.js.map → chunk-W3HKBWPM.js.map} +0 -0
  1154. /package/dist/{chunk-LQDSZPB5.js.map → chunk-WDYM5SFM.js.map} +0 -0
  1155. /package/dist/{chunk-DLMMQMKZ.js.map → chunk-WJ4AZ2AR.js.map} +0 -0
  1156. /package/dist/{chunk-Y3TQ2M2O.js.map → chunk-WMQHP4E3.js.map} +0 -0
  1157. /package/dist/{chunk-H6DJIEO6.js.map → chunk-WP5A6F6P.js.map} +0 -0
  1158. /package/dist/{chunk-GQF2HWQE.js.map → chunk-WWQH3L6M.js.map} +0 -0
  1159. /package/dist/{chunk-2FLGURHP.js.map → chunk-X3T6ULUZ.js.map} +0 -0
  1160. /package/dist/{chunk-QHGWFKTK.js.map → chunk-XA32OUL4.js.map} +0 -0
  1161. /package/dist/{chunk-2ZC62PY4.js.map → chunk-XCICIQIE.js.map} +0 -0
  1162. /package/dist/{chunk-ADFUTR45.js.map → chunk-XHRIUCBD.js.map} +0 -0
  1163. /package/dist/{chunk-UTFX46TK.js.map → chunk-XJBWVT5X.js.map} +0 -0
  1164. /package/dist/{chunk-SY6V3Z2U.js.map → chunk-XKQRWJFE.js.map} +0 -0
  1165. /package/dist/{chunk-VWEGG7JQ.js.map → chunk-XN3EVUB5.js.map} +0 -0
  1166. /package/dist/{chunk-DGS62JWP.js.map → chunk-XT6GBN2G.js.map} +0 -0
  1167. /package/dist/{chunk-RWWQLVGV.js.map → chunk-XYVDTM4D.js.map} +0 -0
  1168. /package/dist/{chunk-67JCL67N.js.map → chunk-XZO5X3KH.js.map} +0 -0
  1169. /package/dist/{chunk-DCML4SXQ.js.map → chunk-Y34DIEOG.js.map} +0 -0
  1170. /package/dist/{chunk-UJKVMFFF.js.map → chunk-YAIYUFCX.js.map} +0 -0
  1171. /package/dist/{chunk-24S44WBL.js.map → chunk-YFLRBEDS.js.map} +0 -0
  1172. /package/dist/{chunk-RLS563ST.js.map → chunk-YQX227EF.js.map} +0 -0
  1173. /package/dist/{chunk-YNIDJOGT.js.map → chunk-YVAB57JZ.js.map} +0 -0
  1174. /package/dist/{chunk-YN6UVG4Z.js.map → chunk-YWHSODBB.js.map} +0 -0
  1175. /package/dist/{chunk-3NMKLLEB.js.map → chunk-YWJHCJQW.js.map} +0 -0
  1176. /package/dist/{chunk-4YJGB22T.js.map → chunk-Z37DSW2K.js.map} +0 -0
  1177. /package/dist/{chunk-72PGXQDN.js.map → chunk-ZELN2B72.js.map} +0 -0
  1178. /package/dist/{chunk-4YNWA5YG.js.map → chunk-ZFGGR2JW.js.map} +0 -0
  1179. /package/dist/{chunk-O3C4BASC.js.map → chunk-ZL7SEED7.js.map} +0 -0
  1180. /package/dist/{computer-viewer-ZISZUM4L.js.map → computer-viewer-CNYFTUGF.js.map} +0 -0
  1181. /package/dist/{embedded-new-voice-UWSSA7AB.js.map → embedded-new-voice-A56WDECM.js.map} +0 -0
  1182. /package/dist/{embedded-voice-T34K465A.js.map → embedded-voice-CBTSMIWW.js.map} +0 -0
  1183. /package/dist/{fleet-decision-row-REAWMEHI.js.map → fleet-decision-row-6PQTGI2U.js.map} +0 -0
  1184. /package/dist/{model-policy-picker-menu-2CTRKSDJ.js.map → model-policy-picker-menu-ZU72JATS.js.map} +0 -0
  1185. /package/dist/{platform-activity-row-EZYTZPYR.js.map → platform-activity-row-5IQT6R5Z.js.map} +0 -0
  1186. /package/dist/{recorder-host-6HFQQTNI.js.map → recorder-host-G5M676VM.js.map} +0 -0
  1187. /package/dist/{sandbox-files-6JY7WVMO.js.map → sandbox-files-HCXOP6ZO.js.map} +0 -0
  1188. /package/dist/{session-connect-cards-VTSJODCX.js.map → session-connect-cards-MYJRQWSA.js.map} +0 -0
  1189. /package/dist/{session-realtime-G3ZGG3KR.js.map → session-realtime-YFVGQFJK.js.map} +0 -0
  1190. /package/dist/{timeline-annotation-markers-S6DMHCI6.js.map → timeline-annotation-markers-5ELTFV5B.js.map} +0 -0
  1191. /package/dist/{timeline-annotation-selection-UFZOKL5E.js.map → timeline-annotation-selection-XHUOFRIY.js.map} +0 -0
  1192. /package/dist/{timeline-annotations-dialog-FPJ4MPHD.js.map → timeline-annotations-dialog-X2VNDYZ4.js.map} +0 -0
@@ -1,3070 +0,0 @@
1
- "use client";
2
- import {
3
- useSandboxFiles
4
- } from "./chunk-5I6CWDA6.js";
5
- import {
6
- WorkbenchChanges,
7
- WorkbenchChangesViewMenu,
8
- useMachineChip
9
- } from "./chunk-7ZQVRVNI.js";
10
- import {
11
- WorkspaceDock
12
- } from "./chunk-FPPPLIGK.js";
13
- import {
14
- SessionStatus
15
- } from "./chunk-7FY47EN2.js";
16
- import {
17
- PierreDiff
18
- } from "./chunk-3NMKLLEB.js";
19
- import {
20
- SessionMcpCapabilityCard
21
- } from "./chunk-CZPN2HP3.js";
22
- import {
23
- useTurnlessOutputGap
24
- } from "./chunk-TL6UOSMX.js";
25
- import {
26
- invalidateSharedQueries,
27
- useSharedQuery
28
- } from "./chunk-DSQNSLQW.js";
29
- import {
30
- sessionAdmissionBlocked,
31
- sessionDisplayStatus
32
- } from "./chunk-DG5DQFS4.js";
33
- import {
34
- SandboxTerminal,
35
- terminalCanAcquirePty,
36
- xtermThemeFromTokens
37
- } from "./chunk-ZLY7M463.js";
38
- import {
39
- sandboxAcceptsLiveIo
40
- } from "./chunk-QV3DJVRZ.js";
41
- import {
42
- MACHINES_SESSION_POLL_MS,
43
- useMachines
44
- } from "./chunk-4XEPZARK.js";
45
- import {
46
- formatRelativeTime
47
- } from "./chunk-UIK52VL4.js";
48
- import {
49
- useMutationRunner,
50
- usePageLiveActivity,
51
- usePolledValue
52
- } from "./chunk-SW4S6I5E.js";
53
- import {
54
- normalizeError
55
- } from "./chunk-CM7LVUKC.js";
56
- import {
57
- useOpenGeni,
58
- useOpenGeniClient
59
- } from "./chunk-BVUAHAQX.js";
60
- import {
61
- cn
62
- } from "./chunk-TXS65BB2.js";
63
- import {
64
- useOpenGeniText
65
- } from "./chunk-4ZRGFCSP.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-6JY7WVMO.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-J6O65JXH.js");
1938
- return { default: BrowserViewer };
1939
- });
1940
- var LazyComputerViewer = lazy(async () => {
1941
- const { ComputerViewer } = await import("./computer-viewer-ZISZUM4L.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
- useSessionCapabilities,
3036
- useSandboxGit,
3037
- useSandboxTerminal,
3038
- useWorkspaceCapture,
3039
- WORKBENCH_TAB_CHANGES,
3040
- WORKBENCH_TAB_FILES,
3041
- WORKBENCH_TAB_TERMINAL,
3042
- WORKBENCH_TAB_BROWSER,
3043
- WORKBENCH_TAB_DESKTOP,
3044
- WORKBENCH_SURFACES,
3045
- initialWorkspaceTab,
3046
- useSandboxWorkspaceTabs,
3047
- SandboxWorkspace,
3048
- SessionConnectionRequest,
3049
- useVideoArtifactPlaybackLoader,
3050
- useScheduledTasks,
3051
- useWorkspaceBackgroundCommands,
3052
- useWorkspaces,
3053
- useBillingUsage,
3054
- useWorkspaceEdit,
3055
- sessionDisplayTitle,
3056
- FleetTile,
3057
- DiffView,
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-CHKHQHOO.js.map