@opengeni/react 6.36.0 → 6.36.1-canary.45113772604001

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