@opengeni/react 6.35.1-canary.45058281793001 → 6.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1124) hide show
  1. package/dist/app/app-state.js +34 -34
  2. package/dist/app/components/Composer.js +43 -43
  3. package/dist/app/components/add-card-dialog.js +1 -1
  4. package/dist/app/components/add-card.js +2 -2
  5. package/dist/app/components/agent/agent-capability-picker.js +9 -9
  6. package/dist/app/components/agents/agent-can-use.js +47 -47
  7. package/dist/app/components/agents/agent-form-page.js +140 -140
  8. package/dist/app/components/agents/agent-page.js +123 -123
  9. package/dist/app/components/agents/agent-setup-sections.js +74 -74
  10. package/dist/app/components/agents/agent-skills.js +13 -13
  11. package/dist/app/components/agents/agent-trigger-chat-field.js +6 -6
  12. package/dist/app/components/agents/agent-trigger-dialog.js +31 -31
  13. package/dist/app/components/agents/agent-trigger-picker.js +8 -8
  14. package/dist/app/components/agents/agents-page.js +90 -90
  15. package/dist/app/components/agents/composer-agent-chip.js +59 -59
  16. package/dist/app/components/agents/session-agent-chip.js +54 -54
  17. package/dist/app/components/artifacts/app-package.js +10 -10
  18. package/dist/app/components/artifacts/artifact-browse-controls.js +3 -3
  19. package/dist/app/components/artifacts/artifact-library.js +28 -28
  20. package/dist/app/components/artifacts/artifact-page-chrome.js +1 -1
  21. package/dist/app/components/artifacts/artifact-viewer.js +68 -68
  22. package/dist/app/components/artifacts/chat-interactive-block.js +27 -27
  23. package/dist/app/components/artifacts/copy-artifact-link.js +1 -1
  24. package/dist/app/components/artifacts/file-reach-dialog.js +11 -11
  25. package/dist/app/components/artifacts/inline-chat-image.js +51 -51
  26. package/dist/app/components/artifacts/retained-file-preview.js +57 -57
  27. package/dist/app/components/artifacts/retained-text-preview.js +8 -8
  28. package/dist/app/components/artifacts/site-actions.js +11 -11
  29. package/dist/app/components/artifacts/site-audience.js +7 -7
  30. package/dist/app/components/artifacts/site-conversations.js +33 -33
  31. package/dist/app/components/artifacts/site-data.js +28 -28
  32. package/dist/app/components/artifacts/site-public-link.js +3 -3
  33. package/dist/app/components/artifacts/site-publishing-page.js +66 -66
  34. package/dist/app/components/artifacts/site-publishing.js +51 -51
  35. package/dist/app/components/artifacts/site-settings.js +65 -65
  36. package/dist/app/components/artifacts/site-version-menu.js +9 -9
  37. package/dist/app/components/billing-class-mark.js +8 -8
  38. package/dist/app/components/capabilities/capability-detail-sheet.js +18 -18
  39. package/dist/app/components/capabilities/capability-logo-source.js +27 -27
  40. package/dist/app/components/capabilities/capability-logo.js +1 -1
  41. package/dist/app/components/capabilities/connection-account-picker.js +2 -2
  42. package/dist/app/components/capabilities/connector-tool-permissions.js +8 -8
  43. package/dist/app/components/capabilities/native-connect-setup.js +31 -31
  44. package/dist/app/components/capabilities/own-logins-shared-heads-up.js +6 -6
  45. package/dist/app/components/capabilities/perform-capability-action.js +2 -2
  46. package/dist/app/components/capabilities/prepared-mcp-setup-card.js +30 -30
  47. package/dist/app/components/capabilities/session-capability-card.js +142 -142
  48. package/dist/app/components/capabilities/session-chrome-card.js +49 -49
  49. package/dist/app/components/capabilities/session-connect-inputs-card.js +33 -33
  50. package/dist/app/components/capabilities/session-custom-mcp-card.js +37 -37
  51. package/dist/app/components/capabilities/session-github-card.js +46 -46
  52. package/dist/app/components/capabilities/session-machine-card.js +50 -50
  53. package/dist/app/components/capabilities/session-personal-github-card.js +31 -31
  54. package/dist/app/components/capabilities/session-plugin-card.js +20 -20
  55. package/dist/app/components/capabilities/use-capabilities-catalog.js +3 -3
  56. package/dist/app/components/capabilities/use-connection-accounts.js +2 -2
  57. package/dist/app/components/chat-payment-pages.js +2 -2
  58. package/dist/app/components/command-menu/chat-status.js +25 -25
  59. package/dist/app/components/command-menu/chat-switcher.js +84 -84
  60. package/dist/app/components/command-menu/command-menu.js +113 -113
  61. package/dist/app/components/command-menu/shortcut-sheet.js +25 -25
  62. package/dist/app/components/composer-capabilities-menu-body.js +6 -6
  63. package/dist/app/components/composer-mobile-plus-panel.js +31 -31
  64. package/dist/app/components/composer-mobile-plus.js +3 -3
  65. package/dist/app/components/credit-required-gate.js +6 -6
  66. package/dist/app/components/credit-required-prompt.js +19 -19
  67. package/dist/app/components/credits/checkout-credits-celebration.js +1 -1
  68. package/dist/app/components/credits/checkout-return.js +1 -1
  69. package/dist/app/components/credits/coupon-redeem.js +1 -1
  70. package/dist/app/components/credits/credit-refusal-notice.js +7 -7
  71. package/dist/app/components/credits/own-subscription-plan-notice.js +3 -3
  72. package/dist/app/components/desktop/app-shots.js +9 -9
  73. package/dist/app/components/desktop/app-update.js +3 -3
  74. package/dist/app/components/desktop/computer-use.js +3 -3
  75. package/dist/app/components/desktop/this-computer.js +6 -6
  76. package/dist/app/components/feedback.js +10 -10
  77. package/dist/app/components/follow-up-repository-menu-body.js +14 -14
  78. package/dist/app/components/follow-up-repository-picker.js +1 -1
  79. package/dist/app/components/github-app-connect-launcher.js +2 -2
  80. package/dist/app/components/in-app-help-link.js +3 -3
  81. package/dist/app/components/knowledge/agent-learning-settings.js +3 -3
  82. package/dist/app/components/machines/connect-machine-dialog.js +25 -25
  83. package/dist/app/components/manual-repository-editor.js +4 -4
  84. package/dist/app/components/markdown.js +15 -15
  85. package/dist/app/components/model-identity.js +3 -3
  86. package/dist/app/components/models/models-ui.js +16 -16
  87. package/dist/app/components/models/provider-mark.js +3 -3
  88. package/dist/app/components/models/subscription-usage.js +5 -5
  89. package/dist/app/components/my-things.js +16 -16
  90. package/dist/app/components/own-where-it-works.js +10 -10
  91. package/dist/app/components/personal-resource-attachment-surface.js +4 -4
  92. package/dist/app/components/pickers.js +11 -11
  93. package/dist/app/components/rail/channel-create-dialog.js +5 -5
  94. package/dist/app/components/rail/project-glyph.js +52 -52
  95. package/dist/app/components/rail/project-profile.js +74 -74
  96. package/dist/app/components/rail/rail-context.js +2 -2
  97. package/dist/app/components/rail/rail-sections.js +157 -157
  98. package/dist/app/components/rail/session-header.js +128 -128
  99. package/dist/app/components/rail/session-list.js +155 -155
  100. package/dist/app/components/rail/session-row-content.js +7 -7
  101. package/dist/app/components/rail/session-row-hover-details.js +34 -34
  102. package/dist/app/components/rail/session-shell.js +196 -196
  103. package/dist/app/components/rail/site-session-group-heading.js +37 -37
  104. package/dist/app/components/repository-picker.js +14 -14
  105. package/dist/app/components/repository-ref-input.js +2 -2
  106. package/dist/app/components/secrets/session-secrets-panel.js +4 -4
  107. package/dist/app/components/session/agent-configuration-panel.js +46 -46
  108. package/dist/app/components/session/artifact-session-page.js +6 -6
  109. package/dist/app/components/session/banners.js +19 -19
  110. package/dist/app/components/session/chat-avatar.js +52 -52
  111. package/dist/app/components/session/console-new-conversation.js +109 -109
  112. package/dist/app/components/session/conversation-find.js +3 -3
  113. package/dist/app/components/session/descendant-requests.js +109 -109
  114. package/dist/app/components/session/editable-artifacts-workspace.js +59 -59
  115. package/dist/app/components/session/failed-session-banner.js +22 -22
  116. package/dist/app/components/session/failure-recovery-boundary.js +3 -3
  117. package/dist/app/components/session/human-input-delegation-record.js +3 -3
  118. package/dist/app/components/session/human-input.js +87 -87
  119. package/dist/app/components/session/inspector.js +143 -143
  120. package/dist/app/components/session/linked-panel.js +3 -3
  121. package/dist/app/components/session/message-actions.js +10 -10
  122. package/dist/app/components/session/model-recovery-notice.js +4 -4
  123. package/dist/app/components/session/new-session-settings-menu.js +30 -30
  124. package/dist/app/components/session/new-session-setup-strip.js +55 -55
  125. package/dist/app/components/session/pull-request-panel.js +24 -24
  126. package/dist/app/components/session/sandbox-recovery-actions.js +3 -3
  127. package/dist/app/components/session/sandbox-switcher.js +23 -23
  128. package/dist/app/components/session/sandbox-workspace.js +119 -119
  129. package/dist/app/components/session/search-markdown-highlight.js +16 -16
  130. package/dist/app/components/session/search-results-view.js +17 -17
  131. package/dist/app/components/session/session-admin-access.js +11 -11
  132. package/dist/app/components/session/session-admission-notice.js +11 -11
  133. package/dist/app/components/session/session-avatar-picker.js +59 -59
  134. package/dist/app/components/session/session-avatar.js +54 -54
  135. package/dist/app/components/session/session-machine-access-notice.js +11 -11
  136. package/dist/app/components/session/session-profile-dialog.js +70 -70
  137. package/dist/app/components/session/session-profile-editor.js +71 -71
  138. package/dist/app/components/session/session-retention.js +7 -7
  139. package/dist/app/components/session/session-search-dialog.js +22 -22
  140. package/dist/app/components/session/session-skill-reviews.js +5 -5
  141. package/dist/app/components/session/session-tenancy-control.js +27 -27
  142. package/dist/app/components/session/session-unattended-setting.js +3 -3
  143. package/dist/app/components/session/session-usage-limit-section.js +14 -14
  144. package/dist/app/components/session/share-chat-dialog.js +9 -9
  145. package/dist/app/components/session/subagents.js +23 -23
  146. package/dist/app/components/session/subscription-account-indicator.js +25 -25
  147. package/dist/app/components/session/subscription-account-menu.js +7 -7
  148. package/dist/app/components/session-connectors-menu-body.js +7 -7
  149. package/dist/app/components/settings/row-select.js +6 -6
  150. package/dist/app/components/toaster.js +2 -2
  151. package/dist/app/components/transcription-settings.js +10 -10
  152. package/dist/app/components/ui/destructive-confirm.js +9 -9
  153. package/dist/app/components/usage/usage-entry.js +8 -8
  154. package/dist/app/components/window-bar.js +26 -26
  155. package/dist/app/components/workspace-composer-plus.js +41 -41
  156. package/dist/app/components/workspace-reach.js +6 -6
  157. package/dist/app/embed/session-app.js +406 -406
  158. package/dist/app/lib/actions/actions-provider.js +20 -20
  159. package/dist/app/lib/agent-capabilities.js +4 -4
  160. package/dist/app/lib/app-connect-card.js +14 -14
  161. package/dist/app/lib/app-shared-key-dialog.js +8 -8
  162. package/dist/app/lib/app-surfaces.js +1 -1
  163. package/dist/app/lib/app-sync-opt-in.js +4 -4
  164. package/dist/app/lib/codex-usage-query.js +3 -3
  165. package/dist/app/lib/composer-agent.js +2 -2
  166. package/dist/app/lib/composer-connectors.js +31 -31
  167. package/dist/app/lib/composer-send-blocking.js +3 -3
  168. package/dist/app/lib/console-site.js +6 -6
  169. package/dist/app/lib/console-text.js +2 -2
  170. package/dist/app/lib/deployment-free-model.js +2 -2
  171. package/dist/app/lib/events.js +29 -29
  172. package/dist/app/lib/failed-session-copy.js +6 -6
  173. package/dist/app/lib/feedback-capture.js +2 -2
  174. package/dist/app/lib/free-credit-gap.js +2 -2
  175. package/dist/app/lib/model-access-onboarding.js +5 -5
  176. package/dist/app/lib/model-policy.js +1 -1
  177. package/dist/app/lib/move-chat-to-machine.js +5 -5
  178. package/dist/app/lib/personal-resource-attachments.js +1 -1
  179. package/dist/app/lib/session-branch-cache.js +18 -18
  180. package/dist/app/lib/session-create.js +5 -5
  181. package/dist/app/lib/session-group-pagination.js +18 -18
  182. package/dist/app/lib/session-hover-facts.js +25 -25
  183. package/dist/app/lib/session-list-dirty-scopes.js +19 -19
  184. package/dist/app/lib/session-model.js +3 -3
  185. package/dist/app/lib/session-rail.js +16 -16
  186. package/dist/app/lib/session-rename.js +4 -4
  187. package/dist/app/lib/sessions-group.js +22 -22
  188. package/dist/app/lib/site-tool-consent-dialog.js +23 -23
  189. package/dist/app/lib/site-tool-consent.js +1 -1
  190. package/dist/app/lib/turn-failure-analytics.js +7 -7
  191. package/dist/app/lib/unavailable-session-model.js +2 -2
  192. package/dist/app/lib/use-artifact-catalog.js +2 -2
  193. package/dist/app/lib/use-duplicate-site.js +4 -4
  194. package/dist/app/lib/use-follow-up-repositories.js +6 -6
  195. package/dist/app/lib/use-personal-resource-attachment.js +2 -2
  196. package/dist/app/lib/use-workspace-machines.js +10 -10
  197. package/dist/app/lib/use-workspace-model-catalog.js +6 -6
  198. package/dist/app/lib/use-workspace-rigs.js +7 -7
  199. package/dist/app/lib/workspace-navigation-preference.js +5 -5
  200. package/dist/app/lib/workspace-scope-context.js +4 -4
  201. package/dist/app/routes/app-page-view.js +17 -17
  202. package/dist/app/routes/app-page.js +2 -2
  203. package/dist/app/routes/artifacts.js +158 -158
  204. package/dist/app/routes/retained-artifact.js +114 -114
  205. package/dist/app/routes/session-unavailable.js +5 -5
  206. package/dist/app/routes/session.js +247 -247
  207. package/dist/app/routes/sessions-index-hydration.js +6 -6
  208. package/dist/app/routes/sessions-index.js +203 -203
  209. package/dist/app/routes/site-view.js +200 -200
  210. package/dist/artifacts-document.js +4 -4
  211. package/dist/artifacts-presentation.js +7 -7
  212. package/dist/artifacts-spreadsheet.js +4 -4
  213. package/dist/artifacts.js +50 -50
  214. package/dist/automation-model.js +7 -7
  215. package/dist/automations.js +67 -67
  216. package/dist/browser-viewer-EIEMRVFF.js +23 -0
  217. package/dist/chat-interactive-block-FV37LWYZ.js +22 -0
  218. package/dist/chunk-2COBAJC7.js +818 -0
  219. package/dist/chunk-2HS3IUXE.js +170 -0
  220. package/dist/chunk-2JTMFYCT.js +296 -0
  221. package/dist/chunk-2JXKP4M6.js +114 -0
  222. package/dist/chunk-2P5K7CBH.js +269 -0
  223. package/dist/chunk-2XGRHMRI.js +250 -0
  224. package/dist/chunk-332BYSAZ.js +65 -0
  225. package/dist/chunk-3EM5GTP3.js +158 -0
  226. package/dist/chunk-3L5ATO4A.js +52 -0
  227. package/dist/chunk-3S3PJB7J.js +107 -0
  228. package/dist/chunk-3SBKYPNM.js +270 -0
  229. package/dist/chunk-3Z7VA6ET.js +114 -0
  230. package/dist/chunk-43BRJBEV.js +207 -0
  231. package/dist/chunk-46LZO4ZO.js +188 -0
  232. package/dist/chunk-46ZC5VNC.js +38 -0
  233. package/dist/chunk-4AH4EEHE.js +298 -0
  234. package/dist/chunk-4D3YJNVN.js +270 -0
  235. package/dist/chunk-4E5QVAT4.js +4480 -0
  236. package/dist/chunk-4E5QVAT4.js.map +1 -0
  237. package/dist/chunk-4I4RTI4D.js +37 -0
  238. package/dist/chunk-4KASGJTF.js +287 -0
  239. package/dist/chunk-4RUKLIOF.js +1263 -0
  240. package/dist/chunk-4UU7FN3I.js +650 -0
  241. package/dist/chunk-4VEIBNC2.js +427 -0
  242. package/dist/chunk-4VEIBNC2.js.map +1 -0
  243. package/dist/chunk-4ZRNASBF.js +2551 -0
  244. package/dist/chunk-5EJBPQI2.js +41 -0
  245. package/dist/chunk-5G4IGG7F.js +209 -0
  246. package/dist/chunk-5JAYZOAW.js +131 -0
  247. package/dist/chunk-5JOKVDSR.js +789 -0
  248. package/dist/chunk-5MP3G7ZV.js +1236 -0
  249. package/dist/chunk-5OVRMKP5.js +42 -0
  250. package/dist/chunk-5SGTRULO.js +1184 -0
  251. package/dist/chunk-5SOL4INY.js +572 -0
  252. package/dist/chunk-5Y34P32B.js +27 -0
  253. package/dist/chunk-62HIKJ5F.js +72 -0
  254. package/dist/chunk-62T2ZPD5.js +266 -0
  255. package/dist/chunk-63VNZRLY.js +386 -0
  256. package/dist/chunk-6CDBX3XG.js +33 -0
  257. package/dist/chunk-6D3D2JWY.js +278 -0
  258. package/dist/chunk-6DOIINY4.js +201 -0
  259. package/dist/chunk-6DQBUKGJ.js +112 -0
  260. package/dist/chunk-6SETNFNH.js +1399 -0
  261. package/dist/chunk-6XYFMHNT.js +56 -0
  262. package/dist/chunk-6YU3WV2P.js +33 -0
  263. package/dist/chunk-6YUHDFOZ.js +351 -0
  264. package/dist/chunk-72EOXOR7.js +1185 -0
  265. package/dist/chunk-72ND4ALI.js +532 -0
  266. package/dist/chunk-757LE32E.js +283 -0
  267. package/dist/chunk-7FDEV6XW.js +89 -0
  268. package/dist/chunk-7S2S4MXR.js +138 -0
  269. package/dist/chunk-7SYCHMXS.js +200 -0
  270. package/dist/chunk-7TVAPQOV.js +5089 -0
  271. package/dist/chunk-7UDLRDHK.js +214 -0
  272. package/dist/chunk-7YLQCMZP.js +357 -0
  273. package/dist/chunk-A5GX3CAE.js +849 -0
  274. package/dist/chunk-A7EBV2EB.js +318 -0
  275. package/dist/chunk-AB5SPXUR.js +114 -0
  276. package/dist/chunk-AHVQGL5A.js +202 -0
  277. package/dist/chunk-AI77ZKEV.js +26 -0
  278. package/dist/chunk-AIX2D6RB.js +1019 -0
  279. package/dist/chunk-AVSIHP7Q.js +192 -0
  280. package/dist/chunk-AWK23Q32.js +107 -0
  281. package/dist/chunk-AYVWA6KD.js +432 -0
  282. package/dist/chunk-AYZXE4IM.js +2553 -0
  283. package/dist/chunk-AZGGSPTE.js +124 -0
  284. package/dist/chunk-B45TB4HY.js +931 -0
  285. package/dist/chunk-BIUJHNVR.js +46 -0
  286. package/dist/chunk-BJUOKUE5.js +234 -0
  287. package/dist/chunk-BPEEVMKH.js +292 -0
  288. package/dist/chunk-BPHPAGYF.js +74 -0
  289. package/dist/chunk-BXMND6YU.js +307 -0
  290. package/dist/chunk-C6OM2SRG.js +117 -0
  291. package/dist/chunk-CIRCUDKF.js +1309 -0
  292. package/dist/chunk-CLKR4UG3.js +403 -0
  293. package/dist/chunk-CPX6BHER.js +554 -0
  294. package/dist/chunk-CVC4RO7D.js +155 -0
  295. package/dist/chunk-D3YJAQGK.js +103 -0
  296. package/dist/chunk-DFQ72BLS.js +1024 -0
  297. package/dist/chunk-DG65PJOZ.js +4564 -0
  298. package/dist/chunk-DNAXAS5R.js +406 -0
  299. package/dist/chunk-DO247ITS.js +175 -0
  300. package/dist/chunk-DONBARLL.js +154 -0
  301. package/dist/chunk-DTLXQ3ZU.js +373 -0
  302. package/dist/chunk-EAXTACI4.js +274 -0
  303. package/dist/chunk-EDPH7AJH.js +412 -0
  304. package/dist/chunk-EER3B3G5.js +10036 -0
  305. package/dist/chunk-EER3B3G5.js.map +1 -0
  306. package/dist/chunk-EFKQHCGJ.js +276 -0
  307. package/dist/chunk-EILSPMVD.js +133 -0
  308. package/dist/chunk-EK7KIETS.js +211 -0
  309. package/dist/chunk-EMWT6GOK.js +437 -0
  310. package/dist/chunk-EO22NST7.js +259 -0
  311. package/dist/chunk-ER5MYLIE.js +256 -0
  312. package/dist/chunk-ES5HKVQF.js +234 -0
  313. package/dist/chunk-EXRQ5ATC.js +738 -0
  314. package/dist/chunk-EXRQ5ATC.js.map +1 -0
  315. package/dist/chunk-F26YBYAZ.js +111 -0
  316. package/dist/chunk-F6QP4GSK.js +515 -0
  317. package/dist/chunk-F7QEO7M2.js +851 -0
  318. package/dist/chunk-FJFGDLXB.js +12 -0
  319. package/dist/chunk-FLLJ2WXW.js +113 -0
  320. package/dist/chunk-FMBJKMT4.js +107 -0
  321. package/dist/chunk-FPN4I4CG.js +3690 -0
  322. package/dist/chunk-FUXFJTXL.js +3070 -0
  323. package/dist/chunk-FZI4QOAV.js +3996 -0
  324. package/dist/chunk-FZI4QOAV.js.map +1 -0
  325. package/dist/chunk-G6SSSX5R.js +158 -0
  326. package/dist/chunk-GBGCMHBB.js +608 -0
  327. package/dist/chunk-GIHE7U3Y.js +174 -0
  328. package/dist/chunk-GJ4GTYOD.js +372 -0
  329. package/dist/chunk-GLSDWNFV.js +432 -0
  330. package/dist/chunk-GMGAW3T6.js +278 -0
  331. package/dist/chunk-GNGI6XFN.js +43 -0
  332. package/dist/chunk-GO5VIAA7.js +264 -0
  333. package/dist/chunk-GSW4YHZE.js +229 -0
  334. package/dist/chunk-GUC6IWEY.js +407 -0
  335. package/dist/chunk-GWAY3SO5.js +15 -0
  336. package/dist/chunk-GXOTNT5D.js +168 -0
  337. package/dist/chunk-GZZCVF76.js +3851 -0
  338. package/dist/chunk-H4VMHFOX.js +214 -0
  339. package/dist/chunk-HA5RFQAF.js +110 -0
  340. package/dist/chunk-HFROJDFQ.js +118 -0
  341. package/dist/chunk-HHFFPE67.js +220 -0
  342. package/dist/chunk-HJLHGXWL.js +103 -0
  343. package/dist/chunk-HKNMNL7B.js +2984 -0
  344. package/dist/chunk-HT7MBHLY.js +1021 -0
  345. package/dist/chunk-I5FSUZVW.js +584 -0
  346. package/dist/chunk-IINQO425.js +246 -0
  347. package/dist/chunk-IIXNEOK4.js +1022 -0
  348. package/dist/chunk-IM3WA5AL.js +311 -0
  349. package/dist/chunk-IX4P4OGR.js +399 -0
  350. package/dist/chunk-IX5VHZYS.js +129 -0
  351. package/dist/chunk-JB3TSUZO.js +263 -0
  352. package/dist/chunk-JIC6RLUB.js +27 -0
  353. package/dist/chunk-JNJIZCTN.js +172 -0
  354. package/dist/chunk-JNV5ZPUV.js +828 -0
  355. package/dist/chunk-JPQFVR24.js +50 -0
  356. package/dist/chunk-JPZVMXDP.js +1333 -0
  357. package/dist/chunk-JVPF34MX.js +215 -0
  358. package/dist/chunk-KED67KAF.js +85 -0
  359. package/dist/chunk-KJ72GMZ2.js +378 -0
  360. package/dist/chunk-KTGKGHEA.js +75 -0
  361. package/dist/chunk-KU77XHWB.js +285 -0
  362. package/dist/chunk-KVPQUADA.js +5915 -0
  363. package/dist/chunk-KVPQUADA.js.map +1 -0
  364. package/dist/chunk-KXBLLFOO.js +249 -0
  365. package/dist/chunk-L6WVCO6D.js +61 -0
  366. package/dist/chunk-LIOZ2MXJ.js +380 -0
  367. package/dist/chunk-LIOZ2MXJ.js.map +1 -0
  368. package/dist/chunk-LPEFULJY.js +73 -0
  369. package/dist/chunk-LRMGPO7E.js +98 -0
  370. package/dist/chunk-LVKTKORH.js +121 -0
  371. package/dist/chunk-MCPKUVMQ.js +99 -0
  372. package/dist/chunk-MFLU3466.js +99 -0
  373. package/dist/chunk-MIUJ3EH5.js +60 -0
  374. package/dist/chunk-MIUMNTIJ.js +175 -0
  375. package/dist/chunk-ML46TXRM.js +113 -0
  376. package/dist/chunk-MO3XJQN2.js +629 -0
  377. package/dist/chunk-MQRHTOQ2.js +218 -0
  378. package/dist/chunk-MVYQDBE6.js +79 -0
  379. package/dist/chunk-NE5P7LFQ.js +100 -0
  380. package/dist/chunk-NIPON7YB.js +850 -0
  381. package/dist/chunk-NIPON7YB.js.map +1 -0
  382. package/dist/chunk-NPBEUU22.js +196 -0
  383. package/dist/chunk-NSXKGS2K.js +178 -0
  384. package/dist/chunk-NUEFORM6.js +2317 -0
  385. package/dist/chunk-NZOFNQNC.js +176 -0
  386. package/dist/chunk-O664PL2U.js +47 -0
  387. package/dist/chunk-O664PL2U.js.map +1 -0
  388. package/dist/chunk-OATXCLTY.js +211 -0
  389. package/dist/chunk-OG3ELROW.js +538 -0
  390. package/dist/chunk-OI4WS7FW.js +162 -0
  391. package/dist/chunk-OITGZUDC.js +82 -0
  392. package/dist/chunk-OKD2LBMK.js +333 -0
  393. package/dist/chunk-OLFOGAWU.js +273 -0
  394. package/dist/chunk-OLFOGAWU.js.map +1 -0
  395. package/dist/chunk-OSA4CGST.js +134 -0
  396. package/dist/chunk-OXYAKUFU.js +401 -0
  397. package/dist/chunk-OYMSMU5O.js +396 -0
  398. package/dist/chunk-P4NZ72KY.js +162 -0
  399. package/dist/chunk-PBYL2VIM.js +379 -0
  400. package/dist/chunk-PDW3OOSZ.js +505 -0
  401. package/dist/chunk-PGRKTQIW.js +523 -0
  402. package/dist/chunk-PPQJIVGM.js +175 -0
  403. package/dist/chunk-PYMQM65Y.js +125 -0
  404. package/dist/chunk-Q273Q33U.js +166 -0
  405. package/dist/chunk-Q4CLS2HL.js +340 -0
  406. package/dist/chunk-QA5UNVHD.js +85 -0
  407. package/dist/chunk-QFOBUA2J.js +428 -0
  408. package/dist/chunk-QLIM4D56.js +1095 -0
  409. package/dist/chunk-QMQF5U2D.js +20 -0
  410. package/dist/chunk-QNOWKKZ4.js +40 -0
  411. package/dist/chunk-QPOUPVPD.js +144 -0
  412. package/dist/chunk-QTJAQ6DS.js +48 -0
  413. package/dist/chunk-QUOFP3G7.js +404 -0
  414. package/dist/chunk-QVOTPOXK.js +29 -0
  415. package/dist/chunk-QYZ5RVGM.js +184 -0
  416. package/dist/chunk-R7CVDKRN.js +2580 -0
  417. package/dist/chunk-RB7MXNZD.js +639 -0
  418. package/dist/chunk-RDZQFZOQ.js +187 -0
  419. package/dist/chunk-RIHKEGWS.js +194 -0
  420. package/dist/chunk-ROSB7GF6.js +57 -0
  421. package/dist/chunk-RP3YMYCX.js +723 -0
  422. package/dist/chunk-RPHXJHNX.js +271 -0
  423. package/dist/chunk-RVC3M66H.js +191 -0
  424. package/dist/chunk-S3OTJAAC.js +283 -0
  425. package/dist/chunk-SBWPMVRN.js +56 -0
  426. package/dist/chunk-SERECSAR.js +138 -0
  427. package/dist/chunk-SHSEF3GJ.js +187 -0
  428. package/dist/chunk-SMS2M3RG.js +772 -0
  429. package/dist/chunk-SRDHDIRQ.js +177 -0
  430. package/dist/chunk-SXRYA7NN.js +389 -0
  431. package/dist/chunk-SYA3WYG4.js +1187 -0
  432. package/dist/chunk-SYYFA7W7.js +23 -0
  433. package/dist/chunk-T2QDSTBH.js +371 -0
  434. package/dist/chunk-TFSCGFYV.js +251 -0
  435. package/dist/chunk-TGCKZOSX.js +246 -0
  436. package/dist/chunk-THILLYQM.js +132 -0
  437. package/dist/chunk-TI6LGUEZ.js +2412 -0
  438. package/dist/chunk-TSY6YZL2.js +366 -0
  439. package/dist/chunk-TW2RHTLH.js +3321 -0
  440. package/dist/chunk-TWA5G277.js +141 -0
  441. package/dist/chunk-TZZ2S4XI.js +247 -0
  442. package/dist/chunk-U5D3K53R.js +58 -0
  443. package/dist/chunk-UECD27LX.js +251 -0
  444. package/dist/chunk-UFJDETKG.js +108 -0
  445. package/dist/chunk-UHCFYX4I.js +570 -0
  446. package/dist/chunk-UHTURYJO.js +898 -0
  447. package/dist/chunk-UJH63JT3.js +67 -0
  448. package/dist/chunk-UOLDS6S5.js +1152 -0
  449. package/dist/chunk-UUE3OGXI.js +84 -0
  450. package/dist/chunk-UUNJ2E57.js +391 -0
  451. package/dist/chunk-UYQVWRAH.js +199 -0
  452. package/dist/chunk-UYWVK7JQ.js +234 -0
  453. package/dist/chunk-UYWWUEL4.js +126 -0
  454. package/dist/chunk-V4CQKX5H.js +48 -0
  455. package/dist/chunk-V4QM7GDQ.js +3176 -0
  456. package/dist/chunk-V5Y74WII.js +91 -0
  457. package/dist/chunk-VGGZLUQK.js +129 -0
  458. package/dist/chunk-VGX636MB.js +311 -0
  459. package/dist/chunk-VGZLFQO2.js +773 -0
  460. package/dist/chunk-VJWZATNF.js +137 -0
  461. package/dist/chunk-VMWCIC2N.js +50 -0
  462. package/dist/chunk-VPWKTIU5.js +227 -0
  463. package/dist/chunk-VXOLG6YB.js +469 -0
  464. package/dist/chunk-W2NAU5VB.js +1628 -0
  465. package/dist/chunk-WGORKMR3.js +353 -0
  466. package/dist/chunk-WMIDELSJ.js +391 -0
  467. package/dist/chunk-WSOSGL2G.js +383 -0
  468. package/dist/chunk-WXUUOM4X.js +400 -0
  469. package/dist/chunk-WZ74QHLE.js +4863 -0
  470. package/dist/chunk-X2OWM2ME.js +1870 -0
  471. package/dist/chunk-X6UMGG4T.js +68 -0
  472. package/dist/chunk-XDXKB25W.js +93 -0
  473. package/dist/chunk-XE4PHI74.js +231 -0
  474. package/dist/chunk-XHF2XNU5.js +73 -0
  475. package/dist/chunk-XLJ4SQFS.js +230 -0
  476. package/dist/chunk-XOD4FX6M.js +2434 -0
  477. package/dist/chunk-XODQ2GPF.js +3110 -0
  478. package/dist/chunk-XT54RTAM.js +441 -0
  479. package/dist/chunk-YAVW5OJ5.js +131 -0
  480. package/dist/chunk-YDQHFJM2.js +83 -0
  481. package/dist/chunk-YH6O6OQ6.js +1356 -0
  482. package/dist/chunk-YIKPC2QP.js +794 -0
  483. package/dist/chunk-ZD7PKYC4.js +335 -0
  484. package/dist/chunk-ZEQYHEWP.js +406 -0
  485. package/dist/chunk-ZMYL6DTE.js +225 -0
  486. package/dist/chunk-ZP3QCPYG.js +21 -0
  487. package/dist/chunk-ZRVUCTSI.js +265 -0
  488. package/dist/chunk-ZSI3ITRK.js +449 -0
  489. package/dist/chunk-ZZMEQCIZ.js +236 -0
  490. package/dist/composer.js +36 -36
  491. package/dist/computer-viewer-ZBY3BPYW.js +21 -0
  492. package/dist/connect.js +29 -29
  493. package/dist/connection-step-up-JQ4OFSQN.js +145 -0
  494. package/dist/desktop-dictation.js +24 -24
  495. package/dist/desktop.js +2 -2
  496. package/dist/editor.js +2 -2
  497. package/dist/embedded-new-voice-ZB5XLKLU.js +25 -0
  498. package/dist/embedded-voice-MZJISDCS.js +25 -0
  499. package/dist/fleet-decision-row-LG3SYVR3.js +361 -0
  500. package/dist/human-input-model.d.ts +2 -0
  501. package/dist/in-chat-connect-model.js +6 -6
  502. package/dist/index.js +298 -298
  503. package/dist/interaction.js +9 -9
  504. package/dist/latest-question-QWJTXMFA.js +1 -1
  505. package/dist/machine-request-model.js +1 -1
  506. package/dist/machines.js +8 -8
  507. package/dist/meetings-recorder.js +1 -1
  508. package/dist/meetings.js +122 -122
  509. package/dist/messages/en.d.ts +10 -0
  510. package/dist/messages.js +1 -1
  511. package/dist/model-levels.js +2 -2
  512. package/dist/model-picker-model.js +2 -2
  513. package/dist/model-policy-picker-menu-5Y72PLNF.js +23 -0
  514. package/dist/model-policy.js +1 -1
  515. package/dist/payment-page-card-YPSXRHBA.js +226 -0
  516. package/dist/platform-activity-row-ZU4MEBNK.js +156 -0
  517. package/dist/queue-surface-implementation-6Q25RPH6.js +932 -0
  518. package/dist/realtime.js +17 -17
  519. package/dist/recorder-host-JD4GWJ2Z.js +80 -0
  520. package/dist/recordings.js +3 -3
  521. package/dist/sandbox-files-HCLEEJMU.js +28 -0
  522. package/dist/session-app.js +406 -406
  523. package/dist/session-connect-cards-DRKEN3Z4.js +27 -0
  524. package/dist/session-list-model.js +3 -3
  525. package/dist/session-realtime-IZOTTRH6.js +30 -0
  526. package/dist/session-realtime.js +2 -2
  527. package/dist/session-ui.js +95 -95
  528. package/dist/session.js +42 -42
  529. package/dist/sites.js +3 -3
  530. package/dist/terminal.js +2 -2
  531. package/dist/this-computer.js +3 -3
  532. package/dist/timeline-annotation-markers-WWXNJOXI.js +157 -0
  533. package/dist/timeline-annotation-selection-ZKRIQFIQ.js +208 -0
  534. package/dist/timeline-annotations-dialog-4IMKTOXJ.js +283 -0
  535. package/dist/timeline-model.js +58 -58
  536. package/dist/ui/access-list.js +19 -19
  537. package/dist/ui/cadence-picker.js +7 -7
  538. package/dist/ui/choice-cards.js +3 -3
  539. package/dist/ui/confirm-dialog.js +2 -2
  540. package/dist/ui/copy-field.js +3 -3
  541. package/dist/ui/detail-page.js +6 -6
  542. package/dist/ui/detail-sheet.js +6 -6
  543. package/dist/ui/diff-view.js +2 -2
  544. package/dist/ui/disclosure.js +7 -7
  545. package/dist/ui/email-chips-input.js +3 -3
  546. package/dist/ui/field.js +2 -2
  547. package/dist/ui/flush-form-page.js +6 -6
  548. package/dist/ui/form-dialog.js +5 -5
  549. package/dist/ui/list-row.js +7 -7
  550. package/dist/ui/load-failure.js +3 -3
  551. package/dist/ui/relative-time.js +3 -3
  552. package/dist/ui/revision-history.js +10 -10
  553. package/dist/ui/role-select.js +10 -10
  554. package/dist/ui/select-menu.js +5 -5
  555. package/dist/ui/settings-nav.js +6 -6
  556. package/dist/ui/sheet.js +2 -2
  557. package/dist/ui/usage-meter.js +4 -4
  558. package/dist/usage.js +3 -3
  559. package/dist/workbench.js +11 -11
  560. package/package.json +5 -6
  561. package/src/components/secret-question-field.tsx +2 -1
  562. package/src/human-input-model.ts +53 -12
  563. package/src/messages/en.ts +10 -0
  564. package/src/model-policy.ts +3 -1
  565. package/dist/browser-viewer-WGRM3JME.js +0 -23
  566. package/dist/chat-interactive-block-5E3UQYHO.js +0 -22
  567. package/dist/chunk-26KK6DN5.js +0 -41
  568. package/dist/chunk-272XEENJ.js +0 -100
  569. package/dist/chunk-2AU2S5NP.js +0 -772
  570. package/dist/chunk-2L7TCAO4.js +0 -188
  571. package/dist/chunk-2MXP6ZRP.js +0 -1095
  572. package/dist/chunk-2Q4XBV3J.js +0 -113
  573. package/dist/chunk-2U5ZJMNP.js +0 -386
  574. package/dist/chunk-2VHPKSFK.js +0 -1236
  575. package/dist/chunk-2WF5XIPA.js +0 -48
  576. package/dist/chunk-2Y53MMGA.js +0 -56
  577. package/dist/chunk-2ZR75AUO.js +0 -225
  578. package/dist/chunk-33QC4RN7.js +0 -133
  579. package/dist/chunk-35LBFD5I.js +0 -311
  580. package/dist/chunk-37J3ZX2N.js +0 -270
  581. package/dist/chunk-37SXZVSY.js +0 -380
  582. package/dist/chunk-37SXZVSY.js.map +0 -1
  583. package/dist/chunk-3ITEAD3E.js +0 -639
  584. package/dist/chunk-3JBLX5BN.js +0 -629
  585. package/dist/chunk-3JYID53J.js +0 -432
  586. package/dist/chunk-3MZCXSC7.js +0 -723
  587. package/dist/chunk-3NRJ4Z3A.js +0 -3176
  588. package/dist/chunk-3UG2AJHR.js +0 -89
  589. package/dist/chunk-3XS3A6Y6.js +0 -162
  590. package/dist/chunk-3ZBQIZEM.js +0 -214
  591. package/dist/chunk-3ZVACRTK.js +0 -82
  592. package/dist/chunk-46USHCHK.js +0 -389
  593. package/dist/chunk-4IMVT7OU.js +0 -263
  594. package/dist/chunk-4J4IPUPZ.js +0 -103
  595. package/dist/chunk-4PG2BEQA.js +0 -175
  596. package/dist/chunk-4YQFDBKE.js +0 -532
  597. package/dist/chunk-5ERDSF2C.js +0 -79
  598. package/dist/chunk-5EZELID5.js +0 -789
  599. package/dist/chunk-5NGW5K2D.js +0 -1333
  600. package/dist/chunk-5SK5PYFN.js +0 -15
  601. package/dist/chunk-5UI3VPCY.js +0 -1152
  602. package/dist/chunk-5W4ZGFXZ.js +0 -373
  603. package/dist/chunk-64XZTYX4.js +0 -572
  604. package/dist/chunk-67MFNMGH.js +0 -200
  605. package/dist/chunk-6C55RLFY.js +0 -103
  606. package/dist/chunk-6DFHNNWJ.js +0 -121
  607. package/dist/chunk-6F34IWSA.js +0 -47
  608. package/dist/chunk-6F34IWSA.js.map +0 -1
  609. package/dist/chunk-6FWBGVFL.js +0 -5905
  610. package/dist/chunk-6FWBGVFL.js.map +0 -1
  611. package/dist/chunk-6GBJFFQL.js +0 -215
  612. package/dist/chunk-6H2OQ6XG.js +0 -318
  613. package/dist/chunk-6LUF4TOE.js +0 -91
  614. package/dist/chunk-6M2WXQX5.js +0 -523
  615. package/dist/chunk-6O6CHBD3.js +0 -29
  616. package/dist/chunk-6U3PE427.js +0 -794
  617. package/dist/chunk-6V2UH36U.js +0 -187
  618. package/dist/chunk-73YALMGG.js +0 -1022
  619. package/dist/chunk-7JNWIGM4.js +0 -1628
  620. package/dist/chunk-7QODDTOI.js +0 -554
  621. package/dist/chunk-7TEXZ5LW.js +0 -46
  622. package/dist/chunk-A4SKSSSS.js +0 -2553
  623. package/dist/chunk-A7Z65D33.js +0 -400
  624. package/dist/chunk-ACUDUVDJ.js +0 -231
  625. package/dist/chunk-AI7XM4MY.js +0 -194
  626. package/dist/chunk-AJEOTFQE.js +0 -234
  627. package/dist/chunk-AKQSOR4G.js +0 -538
  628. package/dist/chunk-AP4FMXAM.js +0 -353
  629. package/dist/chunk-AQHQUPEF.js +0 -202
  630. package/dist/chunk-ATVSG5CO.js +0 -296
  631. package/dist/chunk-B6YDINPE.js +0 -68
  632. package/dist/chunk-BMOYN4HY.js +0 -283
  633. package/dist/chunk-BMSMK7SA.js +0 -84
  634. package/dist/chunk-BY7AWWDB.js +0 -177
  635. package/dist/chunk-BZ4GSY44.js +0 -2412
  636. package/dist/chunk-CGYPX3HJ.js +0 -292
  637. package/dist/chunk-CHYAUIZ3.js +0 -2984
  638. package/dist/chunk-CJEQQBNZ.js +0 -818
  639. package/dist/chunk-CP53LM7W.js +0 -1021
  640. package/dist/chunk-CQW4ZPU4.js +0 -191
  641. package/dist/chunk-CTKUOOU4.js +0 -246
  642. package/dist/chunk-CWKFPDYB.js +0 -124
  643. package/dist/chunk-CYBRD5BP.js +0 -113
  644. package/dist/chunk-CYPMAJ75.js +0 -449
  645. package/dist/chunk-CYPNXHWM.js +0 -379
  646. package/dist/chunk-D45IDQBW.js +0 -114
  647. package/dist/chunk-D4RTU236.js +0 -230
  648. package/dist/chunk-DBGOJIMM.js +0 -399
  649. package/dist/chunk-DD3DT5MY.js +0 -3321
  650. package/dist/chunk-DG3GW325.js +0 -72
  651. package/dist/chunk-DHLGGANG.js +0 -50
  652. package/dist/chunk-DHZW6JXQ.js +0 -10035
  653. package/dist/chunk-DHZW6JXQ.js.map +0 -1
  654. package/dist/chunk-DLHR7HHS.js +0 -931
  655. package/dist/chunk-DM7JLUWN.js +0 -406
  656. package/dist/chunk-DMQY35LC.js +0 -98
  657. package/dist/chunk-EBVL3YJQ.js +0 -67
  658. package/dist/chunk-EIQQYUOT.js +0 -274
  659. package/dist/chunk-EMART4X3.js +0 -107
  660. package/dist/chunk-EMJSJTIE.js +0 -207
  661. package/dist/chunk-ES3JAYQJ.js +0 -214
  662. package/dist/chunk-EWJ7WEZT.js +0 -175
  663. package/dist/chunk-FC6MLU5C.js +0 -52
  664. package/dist/chunk-FD6F2OE5.js +0 -515
  665. package/dist/chunk-FE4HNBHF.js +0 -48
  666. package/dist/chunk-FFXJF5KU.js +0 -201
  667. package/dist/chunk-FN5UTQSL.js +0 -117
  668. package/dist/chunk-FT4ZKYTG.js +0 -138
  669. package/dist/chunk-FYOGQHCD.js +0 -209
  670. package/dist/chunk-FZOK37SC.js +0 -155
  671. package/dist/chunk-GA42NSDJ.js +0 -132
  672. package/dist/chunk-GDWKVSMK.js +0 -372
  673. package/dist/chunk-GH3Q5XW4.js +0 -2551
  674. package/dist/chunk-GHLUZSIB.js +0 -259
  675. package/dist/chunk-GISBCT5E.js +0 -366
  676. package/dist/chunk-GKA5LFYR.js +0 -21
  677. package/dist/chunk-GPRM5GYZ.js +0 -131
  678. package/dist/chunk-GWJLR55B.js +0 -333
  679. package/dist/chunk-GX3RAB4W.js +0 -357
  680. package/dist/chunk-GYNTJYWY.js +0 -166
  681. package/dist/chunk-GYWQ4KVM.js +0 -85
  682. package/dist/chunk-H2AOQJQP.js +0 -378
  683. package/dist/chunk-H35G5UHL.js +0 -111
  684. package/dist/chunk-H6PJEWZH.js +0 -170
  685. package/dist/chunk-HHUTU5EN.js +0 -108
  686. package/dist/chunk-HPH3MFFE.js +0 -3996
  687. package/dist/chunk-HPH3MFFE.js.map +0 -1
  688. package/dist/chunk-HQZ6NGUU.js +0 -114
  689. package/dist/chunk-HSEHIVAE.js +0 -4564
  690. package/dist/chunk-HTYDPAJL.js +0 -391
  691. package/dist/chunk-HUKGLWAY.js +0 -174
  692. package/dist/chunk-HUTQJY3F.js +0 -23
  693. package/dist/chunk-HUWJZRD3.js +0 -311
  694. package/dist/chunk-HVL7TCB5.js +0 -50
  695. package/dist/chunk-HWOYJOKK.js +0 -266
  696. package/dist/chunk-HXANXMPH.js +0 -3851
  697. package/dist/chunk-HZBPL4KB.js +0 -244
  698. package/dist/chunk-HZBPL4KB.js.map +0 -1
  699. package/dist/chunk-I4CXHN6E.js +0 -269
  700. package/dist/chunk-I6YOCSEP.js +0 -37
  701. package/dist/chunk-IAXF3IO6.js +0 -1399
  702. package/dist/chunk-IGUPUA3G.js +0 -403
  703. package/dist/chunk-IKAVNCO5.js +0 -112
  704. package/dist/chunk-IMWP2Q4W.js +0 -137
  705. package/dist/chunk-IXPLYZFO.js +0 -40
  706. package/dist/chunk-J3CHK7NH.js +0 -12
  707. package/dist/chunk-JAC5I2BN.js +0 -85
  708. package/dist/chunk-JK2WTBLD.js +0 -158
  709. package/dist/chunk-JOKNFHFU.js +0 -412
  710. package/dist/chunk-JOVCPP44.js +0 -441
  711. package/dist/chunk-JTRRMV7B.js +0 -469
  712. package/dist/chunk-K2WDXLZS.js +0 -134
  713. package/dist/chunk-K6JW7GB3.js +0 -828
  714. package/dist/chunk-KA5H2Z3E.js +0 -168
  715. package/dist/chunk-KQBVH5LN.js +0 -229
  716. package/dist/chunk-KQVHSEQQ.js +0 -20
  717. package/dist/chunk-KREVCOE7.js +0 -187
  718. package/dist/chunk-KYDLVMKA.js +0 -99
  719. package/dist/chunk-L4PIAAQB.js +0 -4863
  720. package/dist/chunk-L64LMYJD.js +0 -114
  721. package/dist/chunk-L7XVC27Z.js +0 -850
  722. package/dist/chunk-L7XVC27Z.js.map +0 -1
  723. package/dist/chunk-L7ZLPS37.js +0 -371
  724. package/dist/chunk-LDZSUY7K.js +0 -298
  725. package/dist/chunk-LK3AAMN7.js +0 -404
  726. package/dist/chunk-LLVJ3P2N.js +0 -428
  727. package/dist/chunk-LPHBZCCV.js +0 -1263
  728. package/dist/chunk-LT3MK2XP.js +0 -608
  729. package/dist/chunk-M72GFKDP.js +0 -335
  730. package/dist/chunk-M73QQXUQ.js +0 -270
  731. package/dist/chunk-M7NPDODK.js +0 -1870
  732. package/dist/chunk-MB5EK2PA.js +0 -211
  733. package/dist/chunk-MB5WRIYX.js +0 -33
  734. package/dist/chunk-MBYHDOTU.js +0 -42
  735. package/dist/chunk-MDIHQGPV.js +0 -276
  736. package/dist/chunk-MQFJPFL4.js +0 -5089
  737. package/dist/chunk-MU6IU4IH.js +0 -650
  738. package/dist/chunk-N7IOCNWK.js +0 -1019
  739. package/dist/chunk-NDJPEX7P.js +0 -1187
  740. package/dist/chunk-NLKHAZMG.js +0 -898
  741. package/dist/chunk-NLYAWFDY.js +0 -199
  742. package/dist/chunk-NNIUBJOE.js +0 -154
  743. package/dist/chunk-NSBOITEM.js +0 -175
  744. package/dist/chunk-NUZNJSL5.js +0 -285
  745. package/dist/chunk-NZFMEGPE.js +0 -287
  746. package/dist/chunk-O4UAH7WR.js +0 -427
  747. package/dist/chunk-O4UAH7WR.js.map +0 -1
  748. package/dist/chunk-O4VCJWKV.js +0 -176
  749. package/dist/chunk-OE4QJJ4C.js +0 -432
  750. package/dist/chunk-OQEAJGAJ.js +0 -65
  751. package/dist/chunk-ORSFNFNY.js +0 -1184
  752. package/dist/chunk-OU2J6K3L.js +0 -129
  753. package/dist/chunk-OVAT4PIR.js +0 -437
  754. package/dist/chunk-OWF2AVT6.js +0 -407
  755. package/dist/chunk-P2OHWZMB.js +0 -256
  756. package/dist/chunk-PCSRHFRF.js +0 -75
  757. package/dist/chunk-PH2FDKJE.js +0 -250
  758. package/dist/chunk-PMBZMVKE.js +0 -33
  759. package/dist/chunk-PNLVWZSM.js +0 -211
  760. package/dist/chunk-PQ7WJAKL.js +0 -74
  761. package/dist/chunk-PTSRBKQC.js +0 -118
  762. package/dist/chunk-PTUIF4TT.js +0 -144
  763. package/dist/chunk-PV7X4PRR.js +0 -570
  764. package/dist/chunk-Q35LFE7H.js +0 -26
  765. package/dist/chunk-QAHGGBL2.js +0 -1024
  766. package/dist/chunk-QI5RXPYP.js +0 -56
  767. package/dist/chunk-QODAMEOR.js +0 -2317
  768. package/dist/chunk-QXOO5U46.js +0 -172
  769. package/dist/chunk-R6OBJ7LF.js +0 -131
  770. package/dist/chunk-R6WQLIFX.js +0 -73
  771. package/dist/chunk-R7SBV5KD.js +0 -3690
  772. package/dist/chunk-R7ZIFQ7D.js +0 -738
  773. package/dist/chunk-R7ZIFQ7D.js.map +0 -1
  774. package/dist/chunk-RFBJ6TUL.js +0 -43
  775. package/dist/chunk-RLNJSAHP.js +0 -851
  776. package/dist/chunk-RMVKH4EE.js +0 -351
  777. package/dist/chunk-RO2UO3VN.js +0 -107
  778. package/dist/chunk-ROCQ3IDW.js +0 -184
  779. package/dist/chunk-RPWI6A3H.js +0 -849
  780. package/dist/chunk-RTJVIXH5.js +0 -141
  781. package/dist/chunk-RZ5IQ3SX.js +0 -278
  782. package/dist/chunk-S7NX6KSE.js +0 -406
  783. package/dist/chunk-SFWP4DNI.js +0 -218
  784. package/dist/chunk-SI2RFGQX.js +0 -158
  785. package/dist/chunk-SKHYIIH4.js +0 -107
  786. package/dist/chunk-SOC5IBQT.js +0 -383
  787. package/dist/chunk-SUMBC7BQ.js +0 -396
  788. package/dist/chunk-T4UTYGB2.js +0 -110
  789. package/dist/chunk-T6N33M46.js +0 -251
  790. package/dist/chunk-TD5EKKVD.js +0 -83
  791. package/dist/chunk-TGG3ODCS.js +0 -99
  792. package/dist/chunk-TGVTVLNI.js +0 -401
  793. package/dist/chunk-TLTE3QSX.js +0 -73
  794. package/dist/chunk-TXAMGOUG.js +0 -2580
  795. package/dist/chunk-U4OIE2MJ.js +0 -271
  796. package/dist/chunk-UBTDG6GC.js +0 -126
  797. package/dist/chunk-UFRXYZCJ.js +0 -125
  798. package/dist/chunk-UHU2WESP.js +0 -340
  799. package/dist/chunk-UKDLZ76A.js +0 -2434
  800. package/dist/chunk-UPRN4FBY.js +0 -38
  801. package/dist/chunk-UQDT3SM2.js +0 -27
  802. package/dist/chunk-UQFUI3KT.js +0 -3070
  803. package/dist/chunk-UXBW2TYH.js +0 -1356
  804. package/dist/chunk-UXZLTAJO.js +0 -227
  805. package/dist/chunk-UZAVFOZC.js +0 -505
  806. package/dist/chunk-V2A4I4GC.js +0 -265
  807. package/dist/chunk-VAN6CEAV.js +0 -234
  808. package/dist/chunk-VDHWFRTL.js +0 -58
  809. package/dist/chunk-VLDKWGHD.js +0 -61
  810. package/dist/chunk-W4ABZ6XO.js +0 -4480
  811. package/dist/chunk-W4ABZ6XO.js.map +0 -1
  812. package/dist/chunk-W4TOPPVT.js +0 -162
  813. package/dist/chunk-W7P44UAE.js +0 -278
  814. package/dist/chunk-WAVR3UIC.js +0 -773
  815. package/dist/chunk-WLRB74VH.js +0 -251
  816. package/dist/chunk-WOVGVEKP.js +0 -192
  817. package/dist/chunk-WQ35KUFP.js +0 -264
  818. package/dist/chunk-WSBUFP77.js +0 -391
  819. package/dist/chunk-X56NEOYY.js +0 -283
  820. package/dist/chunk-XET2K3TU.js +0 -138
  821. package/dist/chunk-XJPDGFVT.js +0 -307
  822. package/dist/chunk-XK4VFZHQ.js +0 -246
  823. package/dist/chunk-XVP23IJS.js +0 -236
  824. package/dist/chunk-YEU2JC3B.js +0 -27
  825. package/dist/chunk-YFU2VZXS.js +0 -249
  826. package/dist/chunk-YMY2OO3V.js +0 -584
  827. package/dist/chunk-YNRZN3TU.js +0 -57
  828. package/dist/chunk-YP4SNX4P.js +0 -220
  829. package/dist/chunk-YSZAX6WJ.js +0 -196
  830. package/dist/chunk-YTUVANLR.js +0 -93
  831. package/dist/chunk-YUEYZTBP.js +0 -1309
  832. package/dist/chunk-YUVS7HYN.js +0 -129
  833. package/dist/chunk-YVQUPHYL.js +0 -234
  834. package/dist/chunk-YW4YRCXI.js +0 -3110
  835. package/dist/chunk-YZ2G24VJ.js +0 -1185
  836. package/dist/chunk-ZBTYTG4E.js +0 -247
  837. package/dist/chunk-ZCQJUYDX.js +0 -178
  838. package/dist/chunk-ZD67RM6G.js +0 -60
  839. package/dist/computer-viewer-BWWVUD6J.js +0 -21
  840. package/dist/connection-step-up-7ICLBORD.js +0 -145
  841. package/dist/embedded-new-voice-VD6GR5JQ.js +0 -25
  842. package/dist/embedded-voice-J2B6J2QQ.js +0 -25
  843. package/dist/fleet-decision-row-B672XMNG.js +0 -361
  844. package/dist/model-policy-picker-menu-HT3TWGSS.js +0 -23
  845. package/dist/payment-page-card-4LZPJ3OK.js +0 -226
  846. package/dist/platform-activity-row-TWXWUCXD.js +0 -156
  847. package/dist/queue-surface-implementation-SQ7K2TM4.js +0 -932
  848. package/dist/recorder-host-N2S7G3CW.js +0 -80
  849. package/dist/sandbox-files-6CKWJ2CU.js +0 -28
  850. package/dist/session-connect-cards-VNQWMX7A.js +0 -27
  851. package/dist/session-realtime-CRG7DRV6.js +0 -30
  852. package/dist/timeline-annotation-markers-JXCNK4S6.js +0 -157
  853. package/dist/timeline-annotation-selection-5ZTVYJXT.js +0 -208
  854. package/dist/timeline-annotations-dialog-4QWVCZCF.js +0 -283
  855. /package/dist/{browser-viewer-WGRM3JME.js.map → browser-viewer-EIEMRVFF.js.map} +0 -0
  856. /package/dist/{chat-interactive-block-5E3UQYHO.js.map → chat-interactive-block-FV37LWYZ.js.map} +0 -0
  857. /package/dist/{chunk-CJEQQBNZ.js.map → chunk-2COBAJC7.js.map} +0 -0
  858. /package/dist/{chunk-H6PJEWZH.js.map → chunk-2HS3IUXE.js.map} +0 -0
  859. /package/dist/{chunk-ATVSG5CO.js.map → chunk-2JTMFYCT.js.map} +0 -0
  860. /package/dist/{chunk-L64LMYJD.js.map → chunk-2JXKP4M6.js.map} +0 -0
  861. /package/dist/{chunk-I4CXHN6E.js.map → chunk-2P5K7CBH.js.map} +0 -0
  862. /package/dist/{chunk-PH2FDKJE.js.map → chunk-2XGRHMRI.js.map} +0 -0
  863. /package/dist/{chunk-OQEAJGAJ.js.map → chunk-332BYSAZ.js.map} +0 -0
  864. /package/dist/{chunk-SI2RFGQX.js.map → chunk-3EM5GTP3.js.map} +0 -0
  865. /package/dist/{chunk-FC6MLU5C.js.map → chunk-3L5ATO4A.js.map} +0 -0
  866. /package/dist/{chunk-SKHYIIH4.js.map → chunk-3S3PJB7J.js.map} +0 -0
  867. /package/dist/{chunk-37J3ZX2N.js.map → chunk-3SBKYPNM.js.map} +0 -0
  868. /package/dist/{chunk-D45IDQBW.js.map → chunk-3Z7VA6ET.js.map} +0 -0
  869. /package/dist/{chunk-EMJSJTIE.js.map → chunk-43BRJBEV.js.map} +0 -0
  870. /package/dist/{chunk-2L7TCAO4.js.map → chunk-46LZO4ZO.js.map} +0 -0
  871. /package/dist/{chunk-UPRN4FBY.js.map → chunk-46ZC5VNC.js.map} +0 -0
  872. /package/dist/{chunk-LDZSUY7K.js.map → chunk-4AH4EEHE.js.map} +0 -0
  873. /package/dist/{chunk-M73QQXUQ.js.map → chunk-4D3YJNVN.js.map} +0 -0
  874. /package/dist/{chunk-I6YOCSEP.js.map → chunk-4I4RTI4D.js.map} +0 -0
  875. /package/dist/{chunk-NZFMEGPE.js.map → chunk-4KASGJTF.js.map} +0 -0
  876. /package/dist/{chunk-LPHBZCCV.js.map → chunk-4RUKLIOF.js.map} +0 -0
  877. /package/dist/{chunk-MU6IU4IH.js.map → chunk-4UU7FN3I.js.map} +0 -0
  878. /package/dist/{chunk-GH3Q5XW4.js.map → chunk-4ZRNASBF.js.map} +0 -0
  879. /package/dist/{chunk-26KK6DN5.js.map → chunk-5EJBPQI2.js.map} +0 -0
  880. /package/dist/{chunk-FYOGQHCD.js.map → chunk-5G4IGG7F.js.map} +0 -0
  881. /package/dist/{chunk-GPRM5GYZ.js.map → chunk-5JAYZOAW.js.map} +0 -0
  882. /package/dist/{chunk-5EZELID5.js.map → chunk-5JOKVDSR.js.map} +0 -0
  883. /package/dist/{chunk-2VHPKSFK.js.map → chunk-5MP3G7ZV.js.map} +0 -0
  884. /package/dist/{chunk-MBYHDOTU.js.map → chunk-5OVRMKP5.js.map} +0 -0
  885. /package/dist/{chunk-ORSFNFNY.js.map → chunk-5SGTRULO.js.map} +0 -0
  886. /package/dist/{chunk-64XZTYX4.js.map → chunk-5SOL4INY.js.map} +0 -0
  887. /package/dist/{chunk-YEU2JC3B.js.map → chunk-5Y34P32B.js.map} +0 -0
  888. /package/dist/{chunk-DG3GW325.js.map → chunk-62HIKJ5F.js.map} +0 -0
  889. /package/dist/{chunk-HWOYJOKK.js.map → chunk-62T2ZPD5.js.map} +0 -0
  890. /package/dist/{chunk-2U5ZJMNP.js.map → chunk-63VNZRLY.js.map} +0 -0
  891. /package/dist/{chunk-PMBZMVKE.js.map → chunk-6CDBX3XG.js.map} +0 -0
  892. /package/dist/{chunk-W7P44UAE.js.map → chunk-6D3D2JWY.js.map} +0 -0
  893. /package/dist/{chunk-FFXJF5KU.js.map → chunk-6DOIINY4.js.map} +0 -0
  894. /package/dist/{chunk-IKAVNCO5.js.map → chunk-6DQBUKGJ.js.map} +0 -0
  895. /package/dist/{chunk-IAXF3IO6.js.map → chunk-6SETNFNH.js.map} +0 -0
  896. /package/dist/{chunk-QI5RXPYP.js.map → chunk-6XYFMHNT.js.map} +0 -0
  897. /package/dist/{chunk-MB5WRIYX.js.map → chunk-6YU3WV2P.js.map} +0 -0
  898. /package/dist/{chunk-RMVKH4EE.js.map → chunk-6YUHDFOZ.js.map} +0 -0
  899. /package/dist/{chunk-YZ2G24VJ.js.map → chunk-72EOXOR7.js.map} +0 -0
  900. /package/dist/{chunk-4YQFDBKE.js.map → chunk-72ND4ALI.js.map} +0 -0
  901. /package/dist/{chunk-X56NEOYY.js.map → chunk-757LE32E.js.map} +0 -0
  902. /package/dist/{chunk-3UG2AJHR.js.map → chunk-7FDEV6XW.js.map} +0 -0
  903. /package/dist/{chunk-XET2K3TU.js.map → chunk-7S2S4MXR.js.map} +0 -0
  904. /package/dist/{chunk-67MFNMGH.js.map → chunk-7SYCHMXS.js.map} +0 -0
  905. /package/dist/{chunk-MQFJPFL4.js.map → chunk-7TVAPQOV.js.map} +0 -0
  906. /package/dist/{chunk-ES3JAYQJ.js.map → chunk-7UDLRDHK.js.map} +0 -0
  907. /package/dist/{chunk-GX3RAB4W.js.map → chunk-7YLQCMZP.js.map} +0 -0
  908. /package/dist/{chunk-RPWI6A3H.js.map → chunk-A5GX3CAE.js.map} +0 -0
  909. /package/dist/{chunk-6H2OQ6XG.js.map → chunk-A7EBV2EB.js.map} +0 -0
  910. /package/dist/{chunk-HQZ6NGUU.js.map → chunk-AB5SPXUR.js.map} +0 -0
  911. /package/dist/{chunk-AQHQUPEF.js.map → chunk-AHVQGL5A.js.map} +0 -0
  912. /package/dist/{chunk-Q35LFE7H.js.map → chunk-AI77ZKEV.js.map} +0 -0
  913. /package/dist/{chunk-N7IOCNWK.js.map → chunk-AIX2D6RB.js.map} +0 -0
  914. /package/dist/{chunk-WOVGVEKP.js.map → chunk-AVSIHP7Q.js.map} +0 -0
  915. /package/dist/{chunk-EMART4X3.js.map → chunk-AWK23Q32.js.map} +0 -0
  916. /package/dist/{chunk-3JYID53J.js.map → chunk-AYVWA6KD.js.map} +0 -0
  917. /package/dist/{chunk-A4SKSSSS.js.map → chunk-AYZXE4IM.js.map} +0 -0
  918. /package/dist/{chunk-CWKFPDYB.js.map → chunk-AZGGSPTE.js.map} +0 -0
  919. /package/dist/{chunk-DLHR7HHS.js.map → chunk-B45TB4HY.js.map} +0 -0
  920. /package/dist/{chunk-7TEXZ5LW.js.map → chunk-BIUJHNVR.js.map} +0 -0
  921. /package/dist/{chunk-AJEOTFQE.js.map → chunk-BJUOKUE5.js.map} +0 -0
  922. /package/dist/{chunk-CGYPX3HJ.js.map → chunk-BPEEVMKH.js.map} +0 -0
  923. /package/dist/{chunk-PQ7WJAKL.js.map → chunk-BPHPAGYF.js.map} +0 -0
  924. /package/dist/{chunk-XJPDGFVT.js.map → chunk-BXMND6YU.js.map} +0 -0
  925. /package/dist/{chunk-FN5UTQSL.js.map → chunk-C6OM2SRG.js.map} +0 -0
  926. /package/dist/{chunk-YUEYZTBP.js.map → chunk-CIRCUDKF.js.map} +0 -0
  927. /package/dist/{chunk-IGUPUA3G.js.map → chunk-CLKR4UG3.js.map} +0 -0
  928. /package/dist/{chunk-7QODDTOI.js.map → chunk-CPX6BHER.js.map} +0 -0
  929. /package/dist/{chunk-FZOK37SC.js.map → chunk-CVC4RO7D.js.map} +0 -0
  930. /package/dist/{chunk-6C55RLFY.js.map → chunk-D3YJAQGK.js.map} +0 -0
  931. /package/dist/{chunk-QAHGGBL2.js.map → chunk-DFQ72BLS.js.map} +0 -0
  932. /package/dist/{chunk-HSEHIVAE.js.map → chunk-DG65PJOZ.js.map} +0 -0
  933. /package/dist/{chunk-DM7JLUWN.js.map → chunk-DNAXAS5R.js.map} +0 -0
  934. /package/dist/{chunk-NSBOITEM.js.map → chunk-DO247ITS.js.map} +0 -0
  935. /package/dist/{chunk-NNIUBJOE.js.map → chunk-DONBARLL.js.map} +0 -0
  936. /package/dist/{chunk-5W4ZGFXZ.js.map → chunk-DTLXQ3ZU.js.map} +0 -0
  937. /package/dist/{chunk-EIQQYUOT.js.map → chunk-EAXTACI4.js.map} +0 -0
  938. /package/dist/{chunk-JOKNFHFU.js.map → chunk-EDPH7AJH.js.map} +0 -0
  939. /package/dist/{chunk-MDIHQGPV.js.map → chunk-EFKQHCGJ.js.map} +0 -0
  940. /package/dist/{chunk-33QC4RN7.js.map → chunk-EILSPMVD.js.map} +0 -0
  941. /package/dist/{chunk-PNLVWZSM.js.map → chunk-EK7KIETS.js.map} +0 -0
  942. /package/dist/{chunk-OVAT4PIR.js.map → chunk-EMWT6GOK.js.map} +0 -0
  943. /package/dist/{chunk-GHLUZSIB.js.map → chunk-EO22NST7.js.map} +0 -0
  944. /package/dist/{chunk-P2OHWZMB.js.map → chunk-ER5MYLIE.js.map} +0 -0
  945. /package/dist/{chunk-YVQUPHYL.js.map → chunk-ES5HKVQF.js.map} +0 -0
  946. /package/dist/{chunk-H35G5UHL.js.map → chunk-F26YBYAZ.js.map} +0 -0
  947. /package/dist/{chunk-FD6F2OE5.js.map → chunk-F6QP4GSK.js.map} +0 -0
  948. /package/dist/{chunk-RLNJSAHP.js.map → chunk-F7QEO7M2.js.map} +0 -0
  949. /package/dist/{chunk-J3CHK7NH.js.map → chunk-FJFGDLXB.js.map} +0 -0
  950. /package/dist/{chunk-CYBRD5BP.js.map → chunk-FLLJ2WXW.js.map} +0 -0
  951. /package/dist/{chunk-RO2UO3VN.js.map → chunk-FMBJKMT4.js.map} +0 -0
  952. /package/dist/{chunk-R7SBV5KD.js.map → chunk-FPN4I4CG.js.map} +0 -0
  953. /package/dist/{chunk-UQFUI3KT.js.map → chunk-FUXFJTXL.js.map} +0 -0
  954. /package/dist/{chunk-JK2WTBLD.js.map → chunk-G6SSSX5R.js.map} +0 -0
  955. /package/dist/{chunk-LT3MK2XP.js.map → chunk-GBGCMHBB.js.map} +0 -0
  956. /package/dist/{chunk-HUKGLWAY.js.map → chunk-GIHE7U3Y.js.map} +0 -0
  957. /package/dist/{chunk-GDWKVSMK.js.map → chunk-GJ4GTYOD.js.map} +0 -0
  958. /package/dist/{chunk-OE4QJJ4C.js.map → chunk-GLSDWNFV.js.map} +0 -0
  959. /package/dist/{chunk-RZ5IQ3SX.js.map → chunk-GMGAW3T6.js.map} +0 -0
  960. /package/dist/{chunk-RFBJ6TUL.js.map → chunk-GNGI6XFN.js.map} +0 -0
  961. /package/dist/{chunk-WQ35KUFP.js.map → chunk-GO5VIAA7.js.map} +0 -0
  962. /package/dist/{chunk-KQBVH5LN.js.map → chunk-GSW4YHZE.js.map} +0 -0
  963. /package/dist/{chunk-OWF2AVT6.js.map → chunk-GUC6IWEY.js.map} +0 -0
  964. /package/dist/{chunk-5SK5PYFN.js.map → chunk-GWAY3SO5.js.map} +0 -0
  965. /package/dist/{chunk-KA5H2Z3E.js.map → chunk-GXOTNT5D.js.map} +0 -0
  966. /package/dist/{chunk-HXANXMPH.js.map → chunk-GZZCVF76.js.map} +0 -0
  967. /package/dist/{chunk-3ZBQIZEM.js.map → chunk-H4VMHFOX.js.map} +0 -0
  968. /package/dist/{chunk-T4UTYGB2.js.map → chunk-HA5RFQAF.js.map} +0 -0
  969. /package/dist/{chunk-PTSRBKQC.js.map → chunk-HFROJDFQ.js.map} +0 -0
  970. /package/dist/{chunk-YP4SNX4P.js.map → chunk-HHFFPE67.js.map} +0 -0
  971. /package/dist/{chunk-4J4IPUPZ.js.map → chunk-HJLHGXWL.js.map} +0 -0
  972. /package/dist/{chunk-CHYAUIZ3.js.map → chunk-HKNMNL7B.js.map} +0 -0
  973. /package/dist/{chunk-CP53LM7W.js.map → chunk-HT7MBHLY.js.map} +0 -0
  974. /package/dist/{chunk-YMY2OO3V.js.map → chunk-I5FSUZVW.js.map} +0 -0
  975. /package/dist/{chunk-CTKUOOU4.js.map → chunk-IINQO425.js.map} +0 -0
  976. /package/dist/{chunk-73YALMGG.js.map → chunk-IIXNEOK4.js.map} +0 -0
  977. /package/dist/{chunk-HUWJZRD3.js.map → chunk-IM3WA5AL.js.map} +0 -0
  978. /package/dist/{chunk-DBGOJIMM.js.map → chunk-IX4P4OGR.js.map} +0 -0
  979. /package/dist/{chunk-OU2J6K3L.js.map → chunk-IX5VHZYS.js.map} +0 -0
  980. /package/dist/{chunk-4IMVT7OU.js.map → chunk-JB3TSUZO.js.map} +0 -0
  981. /package/dist/{chunk-UQDT3SM2.js.map → chunk-JIC6RLUB.js.map} +0 -0
  982. /package/dist/{chunk-QXOO5U46.js.map → chunk-JNJIZCTN.js.map} +0 -0
  983. /package/dist/{chunk-K6JW7GB3.js.map → chunk-JNV5ZPUV.js.map} +0 -0
  984. /package/dist/{chunk-HVL7TCB5.js.map → chunk-JPQFVR24.js.map} +0 -0
  985. /package/dist/{chunk-5NGW5K2D.js.map → chunk-JPZVMXDP.js.map} +0 -0
  986. /package/dist/{chunk-6GBJFFQL.js.map → chunk-JVPF34MX.js.map} +0 -0
  987. /package/dist/{chunk-JAC5I2BN.js.map → chunk-KED67KAF.js.map} +0 -0
  988. /package/dist/{chunk-H2AOQJQP.js.map → chunk-KJ72GMZ2.js.map} +0 -0
  989. /package/dist/{chunk-PCSRHFRF.js.map → chunk-KTGKGHEA.js.map} +0 -0
  990. /package/dist/{chunk-NUZNJSL5.js.map → chunk-KU77XHWB.js.map} +0 -0
  991. /package/dist/{chunk-YFU2VZXS.js.map → chunk-KXBLLFOO.js.map} +0 -0
  992. /package/dist/{chunk-VLDKWGHD.js.map → chunk-L6WVCO6D.js.map} +0 -0
  993. /package/dist/{chunk-TLTE3QSX.js.map → chunk-LPEFULJY.js.map} +0 -0
  994. /package/dist/{chunk-DMQY35LC.js.map → chunk-LRMGPO7E.js.map} +0 -0
  995. /package/dist/{chunk-6DFHNNWJ.js.map → chunk-LVKTKORH.js.map} +0 -0
  996. /package/dist/{chunk-TGG3ODCS.js.map → chunk-MCPKUVMQ.js.map} +0 -0
  997. /package/dist/{chunk-KYDLVMKA.js.map → chunk-MFLU3466.js.map} +0 -0
  998. /package/dist/{chunk-ZD67RM6G.js.map → chunk-MIUJ3EH5.js.map} +0 -0
  999. /package/dist/{chunk-EWJ7WEZT.js.map → chunk-MIUMNTIJ.js.map} +0 -0
  1000. /package/dist/{chunk-2Q4XBV3J.js.map → chunk-ML46TXRM.js.map} +0 -0
  1001. /package/dist/{chunk-3JBLX5BN.js.map → chunk-MO3XJQN2.js.map} +0 -0
  1002. /package/dist/{chunk-SFWP4DNI.js.map → chunk-MQRHTOQ2.js.map} +0 -0
  1003. /package/dist/{chunk-5ERDSF2C.js.map → chunk-MVYQDBE6.js.map} +0 -0
  1004. /package/dist/{chunk-272XEENJ.js.map → chunk-NE5P7LFQ.js.map} +0 -0
  1005. /package/dist/{chunk-YSZAX6WJ.js.map → chunk-NPBEUU22.js.map} +0 -0
  1006. /package/dist/{chunk-ZCQJUYDX.js.map → chunk-NSXKGS2K.js.map} +0 -0
  1007. /package/dist/{chunk-QODAMEOR.js.map → chunk-NUEFORM6.js.map} +0 -0
  1008. /package/dist/{chunk-O4VCJWKV.js.map → chunk-NZOFNQNC.js.map} +0 -0
  1009. /package/dist/{chunk-MB5EK2PA.js.map → chunk-OATXCLTY.js.map} +0 -0
  1010. /package/dist/{chunk-AKQSOR4G.js.map → chunk-OG3ELROW.js.map} +0 -0
  1011. /package/dist/{chunk-W4TOPPVT.js.map → chunk-OI4WS7FW.js.map} +0 -0
  1012. /package/dist/{chunk-3ZVACRTK.js.map → chunk-OITGZUDC.js.map} +0 -0
  1013. /package/dist/{chunk-GWJLR55B.js.map → chunk-OKD2LBMK.js.map} +0 -0
  1014. /package/dist/{chunk-K2WDXLZS.js.map → chunk-OSA4CGST.js.map} +0 -0
  1015. /package/dist/{chunk-TGVTVLNI.js.map → chunk-OXYAKUFU.js.map} +0 -0
  1016. /package/dist/{chunk-SUMBC7BQ.js.map → chunk-OYMSMU5O.js.map} +0 -0
  1017. /package/dist/{chunk-3XS3A6Y6.js.map → chunk-P4NZ72KY.js.map} +0 -0
  1018. /package/dist/{chunk-CYPNXHWM.js.map → chunk-PBYL2VIM.js.map} +0 -0
  1019. /package/dist/{chunk-UZAVFOZC.js.map → chunk-PDW3OOSZ.js.map} +0 -0
  1020. /package/dist/{chunk-6M2WXQX5.js.map → chunk-PGRKTQIW.js.map} +0 -0
  1021. /package/dist/{chunk-4PG2BEQA.js.map → chunk-PPQJIVGM.js.map} +0 -0
  1022. /package/dist/{chunk-UFRXYZCJ.js.map → chunk-PYMQM65Y.js.map} +0 -0
  1023. /package/dist/{chunk-GYNTJYWY.js.map → chunk-Q273Q33U.js.map} +0 -0
  1024. /package/dist/{chunk-UHU2WESP.js.map → chunk-Q4CLS2HL.js.map} +0 -0
  1025. /package/dist/{chunk-GYWQ4KVM.js.map → chunk-QA5UNVHD.js.map} +0 -0
  1026. /package/dist/{chunk-LLVJ3P2N.js.map → chunk-QFOBUA2J.js.map} +0 -0
  1027. /package/dist/{chunk-2MXP6ZRP.js.map → chunk-QLIM4D56.js.map} +0 -0
  1028. /package/dist/{chunk-KQVHSEQQ.js.map → chunk-QMQF5U2D.js.map} +0 -0
  1029. /package/dist/{chunk-IXPLYZFO.js.map → chunk-QNOWKKZ4.js.map} +0 -0
  1030. /package/dist/{chunk-PTUIF4TT.js.map → chunk-QPOUPVPD.js.map} +0 -0
  1031. /package/dist/{chunk-FE4HNBHF.js.map → chunk-QTJAQ6DS.js.map} +0 -0
  1032. /package/dist/{chunk-LK3AAMN7.js.map → chunk-QUOFP3G7.js.map} +0 -0
  1033. /package/dist/{chunk-6O6CHBD3.js.map → chunk-QVOTPOXK.js.map} +0 -0
  1034. /package/dist/{chunk-ROCQ3IDW.js.map → chunk-QYZ5RVGM.js.map} +0 -0
  1035. /package/dist/{chunk-TXAMGOUG.js.map → chunk-R7CVDKRN.js.map} +0 -0
  1036. /package/dist/{chunk-3ITEAD3E.js.map → chunk-RB7MXNZD.js.map} +0 -0
  1037. /package/dist/{chunk-KREVCOE7.js.map → chunk-RDZQFZOQ.js.map} +0 -0
  1038. /package/dist/{chunk-AI7XM4MY.js.map → chunk-RIHKEGWS.js.map} +0 -0
  1039. /package/dist/{chunk-YNRZN3TU.js.map → chunk-ROSB7GF6.js.map} +0 -0
  1040. /package/dist/{chunk-3MZCXSC7.js.map → chunk-RP3YMYCX.js.map} +0 -0
  1041. /package/dist/{chunk-U4OIE2MJ.js.map → chunk-RPHXJHNX.js.map} +0 -0
  1042. /package/dist/{chunk-CQW4ZPU4.js.map → chunk-RVC3M66H.js.map} +0 -0
  1043. /package/dist/{chunk-BMOYN4HY.js.map → chunk-S3OTJAAC.js.map} +0 -0
  1044. /package/dist/{chunk-2Y53MMGA.js.map → chunk-SBWPMVRN.js.map} +0 -0
  1045. /package/dist/{chunk-FT4ZKYTG.js.map → chunk-SERECSAR.js.map} +0 -0
  1046. /package/dist/{chunk-6V2UH36U.js.map → chunk-SHSEF3GJ.js.map} +0 -0
  1047. /package/dist/{chunk-2AU2S5NP.js.map → chunk-SMS2M3RG.js.map} +0 -0
  1048. /package/dist/{chunk-BY7AWWDB.js.map → chunk-SRDHDIRQ.js.map} +0 -0
  1049. /package/dist/{chunk-46USHCHK.js.map → chunk-SXRYA7NN.js.map} +0 -0
  1050. /package/dist/{chunk-NDJPEX7P.js.map → chunk-SYA3WYG4.js.map} +0 -0
  1051. /package/dist/{chunk-HUTQJY3F.js.map → chunk-SYYFA7W7.js.map} +0 -0
  1052. /package/dist/{chunk-L7ZLPS37.js.map → chunk-T2QDSTBH.js.map} +0 -0
  1053. /package/dist/{chunk-T6N33M46.js.map → chunk-TFSCGFYV.js.map} +0 -0
  1054. /package/dist/{chunk-XK4VFZHQ.js.map → chunk-TGCKZOSX.js.map} +0 -0
  1055. /package/dist/{chunk-GA42NSDJ.js.map → chunk-THILLYQM.js.map} +0 -0
  1056. /package/dist/{chunk-BZ4GSY44.js.map → chunk-TI6LGUEZ.js.map} +0 -0
  1057. /package/dist/{chunk-GISBCT5E.js.map → chunk-TSY6YZL2.js.map} +0 -0
  1058. /package/dist/{chunk-DD3DT5MY.js.map → chunk-TW2RHTLH.js.map} +0 -0
  1059. /package/dist/{chunk-RTJVIXH5.js.map → chunk-TWA5G277.js.map} +0 -0
  1060. /package/dist/{chunk-ZBTYTG4E.js.map → chunk-TZZ2S4XI.js.map} +0 -0
  1061. /package/dist/{chunk-VDHWFRTL.js.map → chunk-U5D3K53R.js.map} +0 -0
  1062. /package/dist/{chunk-WLRB74VH.js.map → chunk-UECD27LX.js.map} +0 -0
  1063. /package/dist/{chunk-HHUTU5EN.js.map → chunk-UFJDETKG.js.map} +0 -0
  1064. /package/dist/{chunk-PV7X4PRR.js.map → chunk-UHCFYX4I.js.map} +0 -0
  1065. /package/dist/{chunk-NLKHAZMG.js.map → chunk-UHTURYJO.js.map} +0 -0
  1066. /package/dist/{chunk-EBVL3YJQ.js.map → chunk-UJH63JT3.js.map} +0 -0
  1067. /package/dist/{chunk-5UI3VPCY.js.map → chunk-UOLDS6S5.js.map} +0 -0
  1068. /package/dist/{chunk-BMSMK7SA.js.map → chunk-UUE3OGXI.js.map} +0 -0
  1069. /package/dist/{chunk-WSBUFP77.js.map → chunk-UUNJ2E57.js.map} +0 -0
  1070. /package/dist/{chunk-NLYAWFDY.js.map → chunk-UYQVWRAH.js.map} +0 -0
  1071. /package/dist/{chunk-VAN6CEAV.js.map → chunk-UYWVK7JQ.js.map} +0 -0
  1072. /package/dist/{chunk-UBTDG6GC.js.map → chunk-UYWWUEL4.js.map} +0 -0
  1073. /package/dist/{chunk-2WF5XIPA.js.map → chunk-V4CQKX5H.js.map} +0 -0
  1074. /package/dist/{chunk-3NRJ4Z3A.js.map → chunk-V4QM7GDQ.js.map} +0 -0
  1075. /package/dist/{chunk-6LUF4TOE.js.map → chunk-V5Y74WII.js.map} +0 -0
  1076. /package/dist/{chunk-YUVS7HYN.js.map → chunk-VGGZLUQK.js.map} +0 -0
  1077. /package/dist/{chunk-35LBFD5I.js.map → chunk-VGX636MB.js.map} +0 -0
  1078. /package/dist/{chunk-WAVR3UIC.js.map → chunk-VGZLFQO2.js.map} +0 -0
  1079. /package/dist/{chunk-IMWP2Q4W.js.map → chunk-VJWZATNF.js.map} +0 -0
  1080. /package/dist/{chunk-DHLGGANG.js.map → chunk-VMWCIC2N.js.map} +0 -0
  1081. /package/dist/{chunk-UXZLTAJO.js.map → chunk-VPWKTIU5.js.map} +0 -0
  1082. /package/dist/{chunk-JTRRMV7B.js.map → chunk-VXOLG6YB.js.map} +0 -0
  1083. /package/dist/{chunk-7JNWIGM4.js.map → chunk-W2NAU5VB.js.map} +0 -0
  1084. /package/dist/{chunk-AP4FMXAM.js.map → chunk-WGORKMR3.js.map} +0 -0
  1085. /package/dist/{chunk-HTYDPAJL.js.map → chunk-WMIDELSJ.js.map} +0 -0
  1086. /package/dist/{chunk-SOC5IBQT.js.map → chunk-WSOSGL2G.js.map} +0 -0
  1087. /package/dist/{chunk-A7Z65D33.js.map → chunk-WXUUOM4X.js.map} +0 -0
  1088. /package/dist/{chunk-L4PIAAQB.js.map → chunk-WZ74QHLE.js.map} +0 -0
  1089. /package/dist/{chunk-M7NPDODK.js.map → chunk-X2OWM2ME.js.map} +0 -0
  1090. /package/dist/{chunk-B6YDINPE.js.map → chunk-X6UMGG4T.js.map} +0 -0
  1091. /package/dist/{chunk-YTUVANLR.js.map → chunk-XDXKB25W.js.map} +0 -0
  1092. /package/dist/{chunk-ACUDUVDJ.js.map → chunk-XE4PHI74.js.map} +0 -0
  1093. /package/dist/{chunk-R6WQLIFX.js.map → chunk-XHF2XNU5.js.map} +0 -0
  1094. /package/dist/{chunk-D4RTU236.js.map → chunk-XLJ4SQFS.js.map} +0 -0
  1095. /package/dist/{chunk-UKDLZ76A.js.map → chunk-XOD4FX6M.js.map} +0 -0
  1096. /package/dist/{chunk-YW4YRCXI.js.map → chunk-XODQ2GPF.js.map} +0 -0
  1097. /package/dist/{chunk-JOVCPP44.js.map → chunk-XT54RTAM.js.map} +0 -0
  1098. /package/dist/{chunk-R6OBJ7LF.js.map → chunk-YAVW5OJ5.js.map} +0 -0
  1099. /package/dist/{chunk-TD5EKKVD.js.map → chunk-YDQHFJM2.js.map} +0 -0
  1100. /package/dist/{chunk-UXBW2TYH.js.map → chunk-YH6O6OQ6.js.map} +0 -0
  1101. /package/dist/{chunk-6U3PE427.js.map → chunk-YIKPC2QP.js.map} +0 -0
  1102. /package/dist/{chunk-M72GFKDP.js.map → chunk-ZD7PKYC4.js.map} +0 -0
  1103. /package/dist/{chunk-S7NX6KSE.js.map → chunk-ZEQYHEWP.js.map} +0 -0
  1104. /package/dist/{chunk-2ZR75AUO.js.map → chunk-ZMYL6DTE.js.map} +0 -0
  1105. /package/dist/{chunk-GKA5LFYR.js.map → chunk-ZP3QCPYG.js.map} +0 -0
  1106. /package/dist/{chunk-V2A4I4GC.js.map → chunk-ZRVUCTSI.js.map} +0 -0
  1107. /package/dist/{chunk-CYPMAJ75.js.map → chunk-ZSI3ITRK.js.map} +0 -0
  1108. /package/dist/{chunk-XVP23IJS.js.map → chunk-ZZMEQCIZ.js.map} +0 -0
  1109. /package/dist/{computer-viewer-BWWVUD6J.js.map → computer-viewer-ZBY3BPYW.js.map} +0 -0
  1110. /package/dist/{connection-step-up-7ICLBORD.js.map → connection-step-up-JQ4OFSQN.js.map} +0 -0
  1111. /package/dist/{embedded-new-voice-VD6GR5JQ.js.map → embedded-new-voice-ZB5XLKLU.js.map} +0 -0
  1112. /package/dist/{embedded-voice-J2B6J2QQ.js.map → embedded-voice-MZJISDCS.js.map} +0 -0
  1113. /package/dist/{fleet-decision-row-B672XMNG.js.map → fleet-decision-row-LG3SYVR3.js.map} +0 -0
  1114. /package/dist/{model-policy-picker-menu-HT3TWGSS.js.map → model-policy-picker-menu-5Y72PLNF.js.map} +0 -0
  1115. /package/dist/{payment-page-card-4LZPJ3OK.js.map → payment-page-card-YPSXRHBA.js.map} +0 -0
  1116. /package/dist/{platform-activity-row-TWXWUCXD.js.map → platform-activity-row-ZU4MEBNK.js.map} +0 -0
  1117. /package/dist/{queue-surface-implementation-SQ7K2TM4.js.map → queue-surface-implementation-6Q25RPH6.js.map} +0 -0
  1118. /package/dist/{recorder-host-N2S7G3CW.js.map → recorder-host-JD4GWJ2Z.js.map} +0 -0
  1119. /package/dist/{sandbox-files-6CKWJ2CU.js.map → sandbox-files-HCLEEJMU.js.map} +0 -0
  1120. /package/dist/{session-connect-cards-VNQWMX7A.js.map → session-connect-cards-DRKEN3Z4.js.map} +0 -0
  1121. /package/dist/{session-realtime-CRG7DRV6.js.map → session-realtime-IZOTTRH6.js.map} +0 -0
  1122. /package/dist/{timeline-annotation-markers-JXCNK4S6.js.map → timeline-annotation-markers-WWXNJOXI.js.map} +0 -0
  1123. /package/dist/{timeline-annotation-selection-5ZTVYJXT.js.map → timeline-annotation-selection-ZKRIQFIQ.js.map} +0 -0
  1124. /package/dist/{timeline-annotations-dialog-4QWVCZCF.js.map → timeline-annotations-dialog-4IMKTOXJ.js.map} +0 -0
@@ -1,3176 +0,0 @@
1
- "use client";
2
- import {
3
- PierreFile
4
- } from "./chunk-CYBRD5BP.js";
5
- import {
6
- useUnicodeFallbackFonts
7
- } from "./chunk-ACXGUCJX.js";
8
- import {
9
- useThemeType
10
- } from "./chunk-B27E3V37.js";
11
- import {
12
- CodeEditor
13
- } from "./chunk-2U5ZJMNP.js";
14
- import {
15
- prefersReducedMotion
16
- } from "./chunk-OCN4S7WN.js";
17
- import {
18
- sandboxAcceptsLiveIo
19
- } from "./chunk-QV3DJVRZ.js";
20
- import {
21
- MENU_BUTTON_CLASS,
22
- MENU_SEPARATOR_CLASS,
23
- MENU_SURFACE_CLASS
24
- } from "./chunk-PNNTR6KP.js";
25
- import {
26
- usePortalContainer
27
- } from "./chunk-UD6AAZSC.js";
28
- import {
29
- usePortalTokenSource,
30
- usePortalTokenStyle
31
- } from "./chunk-XEA5BCMA.js";
32
- import {
33
- useOpenGeni
34
- } from "./chunk-BVUAHAQX.js";
35
- import {
36
- cn
37
- } from "./chunk-TXS65BB2.js";
38
- import {
39
- createOpenGeniText,
40
- useOpenGeniText
41
- } from "./chunk-6FWBGVFL.js";
42
-
43
- // src/components/sandbox-files.tsx
44
- import { FileCode2Icon, FileWarningIcon, LoaderCircleIcon } from "lucide-react";
45
- import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo3, useRef as useRef3, useState as useState3 } from "react";
46
- import { Group, Panel, Separator } from "react-resizable-panels";
47
-
48
- // src/hooks/use-sandbox-files.ts
49
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
50
- var englishText = createOpenGeniText();
51
- var CapturedFileUnavailableError = class extends Error {
52
- constructor(path, reason, t = englishText) {
53
- super(
54
- reason === "too-large" ? t("hooks.useSandboxFiles.pathExceedsTheCapturedPreview", { path }) : reason === "content-missing" ? t("hooks.useSandboxFiles.pathIsNoLongerAvailable", { path }) : t("hooks.useSandboxFiles.pathWasNotChangedIn", { path })
55
- );
56
- this.path = path;
57
- this.reason = reason;
58
- this.name = "CapturedFileUnavailableError";
59
- }
60
- code = "captured_file_unavailable";
61
- };
62
- var FileWriteConflictError = class extends Error {
63
- constructor(path, expectedContent, liveContent, t = englishText) {
64
- super(t("hooks.useSandboxFiles.pathChangedOnTheMachine", { path }));
65
- this.path = path;
66
- this.expectedContent = expectedContent;
67
- this.liveContent = liveContent;
68
- this.name = "FileWriteConflictError";
69
- }
70
- code = "file_write_conflict";
71
- };
72
- function normalizeRoot(root) {
73
- const slashNormalized = root.replaceAll("\\", "/").replace(/^\.\/+/, "");
74
- if (slashNormalized === "/") return "/";
75
- const normalized = slashNormalized.replace(/\/+$/, "");
76
- return normalized === "." ? "" : normalized;
77
- }
78
- function isAbsoluteTreePath(path) {
79
- return path.startsWith("/") || /^[A-Za-z]:\//u.test(path);
80
- }
81
- function joinTreeRoot(root, path) {
82
- if (!root || isAbsoluteTreePath(path)) return path;
83
- return root === "/" ? `/${path}` : `${root}/${path}`;
84
- }
85
- function qualifyStatusPath(root, path, treeRoot) {
86
- const normalized = normalizeRoot(root);
87
- const workspaceRelative = joinTreeRoot(normalized, path);
88
- return joinTreeRoot(normalizeRoot(treeRoot), workspaceRelative);
89
- }
90
- function summarizeStatuses(statuses) {
91
- const repositories = statuses.filter(({ status }) => status.isRepo);
92
- return {
93
- branch: repositories.length === 1 ? repositories[0]?.status.head ?? null : null,
94
- isRepo: repositories.length > 0,
95
- repoCount: repositories.length,
96
- ahead: repositories.reduce((sum, { status }) => sum + status.ahead, 0),
97
- behind: repositories.reduce((sum, { status }) => sum + status.behind, 0),
98
- dirtyCount: repositories.reduce((sum, { status }) => sum + status.files.length, 0)
99
- };
100
- }
101
- function parentOf(path) {
102
- const i = path.lastIndexOf("/");
103
- return i <= 0 ? "" : path.slice(0, i);
104
- }
105
- function parentWithinTree(path, rootPath) {
106
- const parent = parentOf(path);
107
- return parent === "" && normalizeRoot(rootPath) === "/" && path.startsWith("/") ? "/" : parent;
108
- }
109
- function leafOf(path) {
110
- const i = path.lastIndexOf("/");
111
- return i < 0 ? path : path.slice(i + 1);
112
- }
113
- function sortNodes(nodes) {
114
- return [...nodes].sort((a, b) => {
115
- if (a.kind !== b.kind) return a.kind === "dir" ? -1 : 1;
116
- return a.name.localeCompare(b.name, void 0, { sensitivity: "base" });
117
- });
118
- }
119
- function fsNodeToTree(node, captureComplete = false) {
120
- const kind = node.type === "dir" ? "dir" : "file";
121
- const mappedChildren = node.children && node.children.length > 0 ? node.children.map((child) => fsNodeToTree(child, captureComplete)) : captureComplete && kind === "dir" ? [] : void 0;
122
- return {
123
- path: node.path,
124
- name: node.name,
125
- kind,
126
- size: node.sizeBytes,
127
- ...kind === "dir" ? { children: mappedChildren } : {},
128
- // A collapsed residue dir from the capture index — carried through so the
129
- // tree can show an inline "contents on machine" row cold instead of nothing.
130
- ...kind === "dir" && node.truncated ? { truncated: true } : {}
131
- };
132
- }
133
- var GIT_STATUS_TO_TREE = {
134
- added: "added",
135
- modified: "modified",
136
- deleted: "deleted",
137
- renamed: "renamed",
138
- copied: "added",
139
- untracked: "untracked",
140
- typechange: "modified"
141
- };
142
- function replaceChildren(nodes, targetPath, children) {
143
- return nodes.map((node) => {
144
- if (node.path === targetPath) {
145
- return { ...node, children };
146
- }
147
- if (node.kind === "dir" && node.children && targetPath.startsWith(`${node.path}/`)) {
148
- return {
149
- ...node,
150
- children: replaceChildren(node.children, targetPath, children)
151
- };
152
- }
153
- return node;
154
- });
155
- }
156
- function findNodeByPath(nodes, path) {
157
- for (const node of nodes) {
158
- if (node.path === path) return node;
159
- if (node.kind === "dir" && node.children && path.startsWith(`${node.path}/`)) {
160
- const hit = findNodeByPath(node.children, path);
161
- if (hit) return hit;
162
- }
163
- }
164
- return void 0;
165
- }
166
- var FS_LIST_BATCH_REQUEST_LIMIT = 16;
167
- function initialDirectoryFrontier(rootPath, repoPaths) {
168
- const root = normalizeRoot(rootPath);
169
- const rootParts = root.split("/").filter(Boolean);
170
- const rootPrefix = root.startsWith("//") ? "//" : root.startsWith("/") ? "/" : "";
171
- const paths = /* @__PURE__ */ new Set();
172
- for (const repoPath of repoPaths) {
173
- const canonicalRepoPath = joinTreeRoot(root, normalizeRoot(repoPath));
174
- const parts = canonicalRepoPath.split("/").filter(Boolean);
175
- if (rootParts.some((part, index) => parts[index] !== part)) continue;
176
- for (let depth = rootParts.length + 1; depth <= parts.length; depth += 1) {
177
- const path = parts.slice(0, depth).join("/");
178
- paths.add(`${rootPrefix}${path}`);
179
- }
180
- }
181
- return [...paths].sort((a, b) => a.split("/").length - b.split("/").length || a.localeCompare(b)).slice(0, 8);
182
- }
183
- function parentIsLoaded(nodes, parent, rootPath = "") {
184
- if (parent === normalizeRoot(rootPath)) return true;
185
- const node = findNodeByPath(nodes, parent);
186
- return Boolean(node && node.kind === "dir" && node.children !== void 0);
187
- }
188
- function insertNode(nodes, parent, child, rootPath = "") {
189
- if (parent === normalizeRoot(rootPath)) {
190
- if (nodes.some((n) => n.path === child.path)) return nodes;
191
- return sortNodes([...nodes, child]);
192
- }
193
- return nodes.map((node) => {
194
- if (node.path === parent) {
195
- if (node.kind !== "dir" || node.children === void 0) return node;
196
- if (node.children.some((n) => n.path === child.path)) return node;
197
- return { ...node, children: sortNodes([...node.children, child]) };
198
- }
199
- if (node.kind === "dir" && node.children && parent.startsWith(`${node.path}/`)) {
200
- return { ...node, children: insertNode(node.children, parent, child, rootPath) };
201
- }
202
- return node;
203
- });
204
- }
205
- function removeNode(nodes, path, rootPath = "") {
206
- const parent = parentWithinTree(path, rootPath);
207
- if (parent === normalizeRoot(rootPath)) {
208
- if (!nodes.some((n) => n.path === path)) return nodes;
209
- return nodes.filter((n) => n.path !== path);
210
- }
211
- return nodes.map((node) => {
212
- if (node.path === parent) {
213
- if (node.kind !== "dir" || node.children === void 0) return node;
214
- return {
215
- ...node,
216
- children: node.children.filter((n) => n.path !== path)
217
- };
218
- }
219
- if (node.kind === "dir" && node.children && parent.startsWith(`${node.path}/`)) {
220
- return { ...node, children: removeNode(node.children, path, rootPath) };
221
- }
222
- return node;
223
- });
224
- }
225
- function sameNodeShallow(a, b) {
226
- return a.path === b.path && a.kind === b.kind && a.name === b.name && (a.size ?? null) === (b.size ?? null) && (a.status ?? void 0) === (b.status ?? void 0) && (a.truncated ?? false) === (b.truncated ?? false);
227
- }
228
- function mergeChildren(current, listed) {
229
- const byPath = new Map(current.map((n) => [n.path, n]));
230
- const merged = listed.map((next) => {
231
- const existing = byPath.get(next.path);
232
- if (!existing) return next;
233
- if (existing.kind === "dir" && next.kind === "dir" && existing.children !== void 0) {
234
- const candidate = { ...next, children: existing.children };
235
- return sameNodeShallow(existing, candidate) ? existing : candidate;
236
- }
237
- if (existing.children === next.children && sameNodeShallow(existing, next)) {
238
- return existing;
239
- }
240
- return next;
241
- });
242
- return sortNodes(merged);
243
- }
244
- function mergeRootChildren(nodes, listed) {
245
- return mergeChildren(nodes, listed);
246
- }
247
- function repathNode(node, fromPrefix, toPrefix) {
248
- const newPath = toPrefix + node.path.slice(fromPrefix.length);
249
- const next = { ...node, path: newPath, name: leafOf(newPath) };
250
- if (node.children) next.children = node.children.map((c) => repathNode(c, fromPrefix, toPrefix));
251
- return next;
252
- }
253
- function decodeBase64Bytes(value) {
254
- const binary = atob(value);
255
- const bytes = new Uint8Array(binary.length);
256
- for (let index = 0; index < binary.length; index += 1) {
257
- bytes[index] = binary.charCodeAt(index);
258
- }
259
- return bytes;
260
- }
261
- function decodeBase64Text(value) {
262
- return new TextDecoder().decode(decodeBase64Bytes(value));
263
- }
264
- function encodeBase64Bytes(bytes) {
265
- let binary = "";
266
- const chunkSize = 32768;
267
- for (let offset = 0; offset < bytes.length; offset += chunkSize) {
268
- binary += String.fromCharCode(...bytes.subarray(offset, offset + chunkSize));
269
- }
270
- return btoa(binary);
271
- }
272
- async function assertCapturedHash(bytes, expected) {
273
- if (!expected) throw new Error("Captured file is missing its integrity hash.");
274
- if (!globalThis.crypto?.subtle) {
275
- throw new Error("Captured file integrity verification is unavailable in this browser.");
276
- }
277
- const buffer = new ArrayBuffer(bytes.byteLength);
278
- new Uint8Array(buffer).set(bytes);
279
- const digest = new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256", buffer));
280
- const actual = [...digest].map((byte) => byte.toString(16).padStart(2, "0")).join("");
281
- if (actual !== expected) throw new Error("Captured file content failed its integrity check.");
282
- }
283
- function useSandboxFiles(sessionId, options = {}) {
284
- const t = useOpenGeniText();
285
- const { client, workspaceId } = useOpenGeni(options);
286
- const enabled = (options.enabled ?? true) && Boolean(sessionId);
287
- const active = options.active ?? true;
288
- const rootPath = options.rootPath ?? "";
289
- const routeEpoch = options.route?.epoch ?? null;
290
- const routeRoot = options.route?.root ?? null;
291
- const route = useMemo(
292
- () => routeEpoch !== null && routeRoot !== null ? { epoch: routeEpoch, root: routeRoot } : void 0,
293
- [routeEpoch, routeRoot]
294
- );
295
- const repoPathsKey = [
296
- ...new Set((options.repoPaths?.length ? options.repoPaths : [rootPath]).map(normalizeRoot))
297
- ].join("\0");
298
- const repoPaths = useMemo(() => repoPathsKey.split("\0"), [repoPathsKey]);
299
- const capture = options.capture ?? null;
300
- const isLive = sandboxAcceptsLiveIo(options.liveness);
301
- const acceptsEventReads = options.liveness === void 0 || isLive;
302
- const acceptsEventReadsRef = useRef(acceptsEventReads);
303
- acceptsEventReadsRef.current = acceptsEventReads;
304
- const hasLiveIoFence = options.liveness !== void 0;
305
- const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${rootPath}\0${repoPathsKey}\0${routeEpoch ?? ""}\0${routeRoot ?? ""}`;
306
- const [tree, setTree] = useState([]);
307
- const treeRef = useRef([]);
308
- const [loading, setLoading] = useState(false);
309
- const [expandingPaths, setExpandingPaths] = useState(/* @__PURE__ */ new Set());
310
- const [error, setError] = useState(null);
311
- const [gitSummary, setGitSummary] = useState(null);
312
- const [gitLoading, setGitLoading] = useState(false);
313
- const [contentRevision, setContentRevision] = useState(0);
314
- const [stateIdentity, setStateIdentity] = useState(identityKey);
315
- const [source, setSource] = useState(null);
316
- const sourceRef = useRef(null);
317
- const statusRef = useRef(/* @__PURE__ */ new Map());
318
- const refreshGenerationRef = useRef(0);
319
- const refreshAbortRef = useRef(null);
320
- const identityAbortRef = useRef(new AbortController());
321
- const eventReadAbortRef = useRef(new AbortController());
322
- const identityGenerationRef = useRef(0);
323
- const lastSeqRef = useRef(0);
324
- const pendingParentsRef = useRef(/* @__PURE__ */ new Set());
325
- const pendingGitRef = useRef(false);
326
- const eventReconcileInFlightRef = useRef(null);
327
- const eventReconcilePendingRef = useRef(false);
328
- const debounceRef = useRef(null);
329
- const ownRevisionsRef = useRef(/* @__PURE__ */ new Set());
330
- const onMutationErrorRef = useRef(options.onMutationError);
331
- onMutationErrorRef.current = options.onMutationError;
332
- treeRef.current = tree;
333
- const applyStatus = useCallback((nodes) => {
334
- const overlay = statusRef.current;
335
- const walk = (list) => {
336
- let changed = false;
337
- const out = list.map((node) => {
338
- const nextChildren = node.children ? walk(node.children) : node.children;
339
- const wantStatus = node.kind === "file" ? overlay.get(node.path) : void 0;
340
- const childrenChanged = nextChildren !== node.children;
341
- const statusChanged = (node.status ?? void 0) !== (wantStatus ?? void 0);
342
- if (!childrenChanged && !statusChanged) return node;
343
- changed = true;
344
- const next = {
345
- ...node,
346
- ...node.children ? { children: nextChildren } : {}
347
- };
348
- if (wantStatus) next.status = wantStatus;
349
- else delete next.status;
350
- return next;
351
- });
352
- return changed ? out : list;
353
- };
354
- return walk(nodes);
355
- }, []);
356
- const refresh = useCallback(async () => {
357
- if (!sessionId) return;
358
- refreshAbortRef.current?.abort();
359
- const refreshAbort = new AbortController();
360
- refreshAbortRef.current = refreshAbort;
361
- const generation = refreshGenerationRef.current += 1;
362
- setLoading(true);
363
- setGitLoading(true);
364
- setError(null);
365
- try {
366
- const frontierPaths = initialDirectoryFrontier(rootPath, repoPaths);
367
- const listRequests = [rootPath, ...frontierPaths].map((path) => ({
368
- path,
369
- depth: 1,
370
- ...route ? { route } : {}
371
- }));
372
- const listedBatch = await client.fsListBatch(
373
- workspaceId,
374
- sessionId,
375
- { requests: listRequests },
376
- { signal: refreshAbort.signal }
377
- );
378
- if (refreshGenerationRef.current !== generation) return;
379
- const listed = listedBatch.results[0];
380
- if (!listed) throw new Error("Workspace list batch did not return the root result.");
381
- const children = (listed.root.children ?? []).map((node) => fsNodeToTree(node));
382
- setTree((prev) => {
383
- let hydrated = prev.length === 0 ? children : mergeRootChildren(prev, children);
384
- for (const [index, path] of frontierPaths.entries()) {
385
- const prefetched = listedBatch.results[index + 1];
386
- if (!prefetched) continue;
387
- hydrated = replaceChildren(
388
- hydrated,
389
- path,
390
- (prefetched.root.children ?? []).map((node) => fsNodeToTree(node))
391
- );
392
- }
393
- return applyStatus(hydrated);
394
- });
395
- sourceRef.current = "live";
396
- setSource("live");
397
- setLoading(false);
398
- const statuses = repoPaths.length > 0 ? await client.gitReadBatch(
399
- workspaceId,
400
- sessionId,
401
- {
402
- requests: repoPaths.map((root) => ({
403
- status: { path: root }
404
- }))
405
- },
406
- { signal: refreshAbort.signal }
407
- ).then(
408
- (batch) => batch.results.map((result, index) => ({
409
- root: repoPaths[index] ?? "",
410
- status: result.status
411
- }))
412
- ).catch(() => null) : [];
413
- if (refreshGenerationRef.current !== generation) return;
414
- if (statuses) {
415
- const overlay = /* @__PURE__ */ new Map();
416
- for (const { root, status } of statuses) {
417
- for (const file of status.files) {
418
- const code = file.worktree ?? file.index;
419
- const mapped = code ? GIT_STATUS_TO_TREE[code] : void 0;
420
- if (mapped) overlay.set(qualifyStatusPath(root, file.path, rootPath), mapped);
421
- }
422
- }
423
- statusRef.current = overlay;
424
- setGitSummary(summarizeStatuses(statuses));
425
- } else {
426
- statusRef.current = /* @__PURE__ */ new Map();
427
- setGitSummary(null);
428
- }
429
- setGitLoading(false);
430
- setTree((prev) => applyStatus(prev));
431
- } catch (cause) {
432
- if (refreshGenerationRef.current !== generation) return;
433
- setError(cause instanceof Error ? cause : new Error(String(cause)));
434
- } finally {
435
- if (refreshGenerationRef.current === generation) setLoading(false);
436
- if (refreshGenerationRef.current === generation) setGitLoading(false);
437
- if (refreshAbortRef.current === refreshAbort) refreshAbortRef.current = null;
438
- }
439
- }, [client, workspaceId, sessionId, rootPath, repoPaths, route, applyStatus]);
440
- const seedFromCapture = useCallback(
441
- (manifest) => {
442
- const overlay = /* @__PURE__ */ new Map();
443
- for (const file of manifest.files) {
444
- if (file.deleted) continue;
445
- const mapped = GIT_STATUS_TO_TREE[file.status];
446
- if (mapped) overlay.set(file.path, mapped);
447
- }
448
- statusRef.current = overlay;
449
- const children = (manifest.treeIndex.children ?? []).map((node) => fsNodeToTree(node, true));
450
- setTree(
451
- (prev) => applyStatus(prev.length === 0 ? children : mergeRootChildren(prev, children))
452
- );
453
- sourceRef.current = "capture";
454
- setSource("capture");
455
- setGitSummary({
456
- branch: manifest.repos.length === 1 ? manifest.repos[0]?.head ?? null : null,
457
- isRepo: manifest.repos.length > 0,
458
- repoCount: manifest.repos.length,
459
- ahead: manifest.repos.reduce((sum, repo) => sum + repo.ahead, 0),
460
- behind: manifest.repos.reduce((sum, repo) => sum + repo.behind, 0),
461
- dirtyCount: manifest.files.length
462
- });
463
- setGitLoading(false);
464
- setError(null);
465
- },
466
- [applyStatus]
467
- );
468
- const expand = useCallback(
469
- async (path) => {
470
- if (!sessionId) return;
471
- if (source === "capture" && capture) return;
472
- const identityGeneration = identityGenerationRef.current;
473
- const identitySignal = identityAbortRef.current.signal;
474
- setExpandingPaths((prev) => {
475
- const next = new Set(prev);
476
- next.add(path);
477
- return next;
478
- });
479
- try {
480
- const listed = await client.fsList(
481
- workspaceId,
482
- sessionId,
483
- { path, depth: 1, ...route ? { route } : {} },
484
- { signal: identitySignal }
485
- );
486
- if (identityGenerationRef.current !== identityGeneration) return;
487
- const children = (listed.root.children ?? []).map((node) => fsNodeToTree(node));
488
- setTree((prev) => applyStatus(replaceChildren(prev, path, children)));
489
- } catch (cause) {
490
- if (identityGenerationRef.current !== identityGeneration) return;
491
- setError(cause instanceof Error ? cause : new Error(String(cause)));
492
- } finally {
493
- if (identityGenerationRef.current === identityGeneration) {
494
- setExpandingPaths((prev) => {
495
- if (!prev.has(path)) return prev;
496
- const next = new Set(prev);
497
- next.delete(path);
498
- return next;
499
- });
500
- }
501
- }
502
- },
503
- [client, workspaceId, sessionId, capture, source, route, applyStatus]
504
- );
505
- const readFile = useCallback(
506
- async (path, requestOptions = {}) => {
507
- if (!sessionId) throw new Error("no session");
508
- const identitySignal = identityAbortRef.current.signal;
509
- const signal = requestOptions.signal ? AbortSignal.any([identitySignal, requestOptions.signal]) : identitySignal;
510
- const captured = capture?.files.find((file) => file.path === path && !file.deleted);
511
- if (source === "capture" && capture) {
512
- if (!captured) {
513
- throw new CapturedFileUnavailableError(path, "not-captured", t);
514
- }
515
- for (let attempt = 0; attempt < 2; attempt += 1) {
516
- const result = await client.getWorkspaceCaptureFile(
517
- workspaceId,
518
- sessionId,
519
- path,
520
- capture.revision,
521
- { signal }
522
- );
523
- if (result.path !== path || result.revision !== capture.revision) {
524
- throw new Error(
525
- "Captured file identity did not match the requested workspace revision."
526
- );
527
- }
528
- if (result.hash !== captured.hash || result.sizeBytes !== captured.sizeBytes || result.isBinary !== captured.isBinary || result.tooLarge !== captured.tooLarge) {
529
- throw new Error("Captured file metadata did not match its manifest.");
530
- }
531
- if (result.tooLarge) {
532
- throw new CapturedFileUnavailableError(path, "too-large", t);
533
- }
534
- let bytes;
535
- let encoding;
536
- let content;
537
- if (result.content !== null && result.encoding !== null) {
538
- encoding = result.encoding;
539
- content = result.content;
540
- bytes = encoding === "base64" ? decodeBase64Bytes(content) : new TextEncoder().encode(content);
541
- } else if (result.contentUrl) {
542
- const response = await fetch(result.contentUrl.url, {
543
- credentials: "omit",
544
- cache: "no-store",
545
- referrerPolicy: "no-referrer",
546
- signal: AbortSignal.any([signal, AbortSignal.timeout(3e4)])
547
- }).catch(() => null);
548
- if (!response?.ok) {
549
- if (attempt === 0 && (response === null || response.status === 401 || response.status === 403)) {
550
- continue;
551
- }
552
- throw new Error("Captured file download failed.");
553
- }
554
- bytes = new Uint8Array(await response.arrayBuffer());
555
- encoding = result.isBinary ? "base64" : "utf8";
556
- content = result.isBinary ? encodeBase64Bytes(bytes) : new TextDecoder().decode(bytes);
557
- } else {
558
- throw new CapturedFileUnavailableError(path, "content-missing", t);
559
- }
560
- if (bytes.byteLength !== result.sizeBytes) {
561
- throw new Error("Captured file size did not match its manifest.");
562
- }
563
- await assertCapturedHash(bytes, result.hash);
564
- return {
565
- path,
566
- encoding,
567
- content,
568
- sizeBytes: result.sizeBytes,
569
- truncated: false,
570
- isBinary: result.isBinary,
571
- revision: result.revision
572
- };
573
- }
574
- throw new Error("Captured file download failed after refreshing its URL.");
575
- }
576
- return await client.fsRead(
577
- workspaceId,
578
- sessionId,
579
- { path, ...route ? { route } : {} },
580
- { signal }
581
- );
582
- },
583
- [client, workspaceId, sessionId, capture, source, route, t]
584
- );
585
- const reconcilePath = useCallback(
586
- async (path, requestSignal) => {
587
- if (!sessionId) return;
588
- const identityGeneration = identityGenerationRef.current;
589
- const identitySignal = identityAbortRef.current.signal;
590
- const signal = requestSignal ? AbortSignal.any([identitySignal, requestSignal]) : identitySignal;
591
- if (!parentIsLoaded(treeRef.current, path, rootPath)) return;
592
- try {
593
- const listed = await client.fsList(
594
- workspaceId,
595
- sessionId,
596
- { path, depth: 1, ...route ? { route } : {} },
597
- { signal }
598
- );
599
- if (identityGenerationRef.current !== identityGeneration) return;
600
- const children = (listed.root.children ?? []).map((node) => fsNodeToTree(node));
601
- if (path === normalizeRoot(rootPath)) {
602
- setTree((prev) => applyStatus(mergeRootChildren(prev, children)));
603
- } else
604
- setTree((prev) => {
605
- const existing = findNodeByPath(prev, path);
606
- const merged = existing?.children ? mergeChildren(existing.children, children) : children;
607
- return applyStatus(replaceChildren(prev, path, merged));
608
- });
609
- } catch {
610
- }
611
- },
612
- [client, workspaceId, sessionId, rootPath, route, applyStatus]
613
- );
614
- const reconcilePaths = useCallback(
615
- async (requestedPaths, requestSignal) => {
616
- if (!sessionId) return;
617
- const identityGeneration = identityGenerationRef.current;
618
- const identitySignal = identityAbortRef.current.signal;
619
- const signal = requestSignal ? AbortSignal.any([identitySignal, requestSignal]) : identitySignal;
620
- const paths = [...new Set(requestedPaths)].filter(
621
- (path) => parentIsLoaded(treeRef.current, path, rootPath)
622
- );
623
- for (let offset = 0; offset < paths.length; offset += FS_LIST_BATCH_REQUEST_LIMIT) {
624
- const chunk = paths.slice(offset, offset + FS_LIST_BATCH_REQUEST_LIMIT);
625
- try {
626
- const listed = await client.fsListBatch(
627
- workspaceId,
628
- sessionId,
629
- {
630
- requests: chunk.map((path) => ({
631
- path,
632
- depth: 1,
633
- ...route ? { route } : {}
634
- }))
635
- },
636
- { signal }
637
- );
638
- if (identityGenerationRef.current !== identityGeneration) return;
639
- setTree((previous) => {
640
- let next = previous;
641
- for (const [index, path] of chunk.entries()) {
642
- const result = listed.results[index];
643
- if (!result) continue;
644
- const children = (result.root.children ?? []).map((node) => fsNodeToTree(node));
645
- if (path === normalizeRoot(rootPath)) {
646
- next = mergeRootChildren(next, children);
647
- } else {
648
- const existing = findNodeByPath(next, path);
649
- const merged = existing?.children ? mergeChildren(existing.children, children) : children;
650
- next = replaceChildren(next, path, merged);
651
- }
652
- }
653
- return applyStatus(next);
654
- });
655
- } catch {
656
- }
657
- }
658
- },
659
- [client, workspaceId, sessionId, rootPath, route, applyStatus]
660
- );
661
- const runOptimistic = useCallback(
662
- async (opName, apply, op, reconcileParents) => {
663
- const identityGeneration = identityGenerationRef.current;
664
- const snapshot = treeRef.current;
665
- setError(null);
666
- setTree(applyStatus(apply(snapshot)));
667
- try {
668
- const res = await op();
669
- if (identityGenerationRef.current !== identityGeneration) return res;
670
- if (res && typeof res === "object" && "revision" in res) {
671
- const rev = res.revision;
672
- if (typeof rev === "number") ownRevisionsRef.current.add(rev);
673
- }
674
- for (const parent of reconcileParents) {
675
- if (identityGenerationRef.current !== identityGeneration) return res;
676
- await reconcilePath(parent);
677
- }
678
- return res;
679
- } catch (cause) {
680
- const err = cause instanceof Error ? cause : new Error(String(cause));
681
- if (identityGenerationRef.current !== identityGeneration) throw err;
682
- setTree(applyStatus(snapshot));
683
- if (err instanceof FileWriteConflictError) throw err;
684
- setError(err);
685
- onMutationErrorRef.current?.(err, opName);
686
- throw err;
687
- }
688
- },
689
- [applyStatus, reconcilePath]
690
- );
691
- const writeFile = useCallback(
692
- async (path, content, writeOptions = {}) => {
693
- if (!sessionId) throw new Error("no session");
694
- const identityGeneration = identityGenerationRef.current;
695
- const identitySignal = identityAbortRef.current.signal;
696
- const parent = parentWithinTree(path, rootPath);
697
- const exists = Boolean(findNodeByPath(tree, path));
698
- const node = {
699
- path,
700
- name: leafOf(path),
701
- kind: "file",
702
- size: content.length
703
- };
704
- return await runOptimistic(
705
- "write",
706
- (nodes) => exists ? nodes : insertNode(nodes, parent, node, rootPath),
707
- async () => {
708
- if (!writeOptions.force && writeOptions.expectedContent !== void 0) {
709
- const live = await client.fsRead(
710
- workspaceId,
711
- sessionId,
712
- { path, ...route ? { route } : {} },
713
- { signal: identitySignal }
714
- );
715
- if (identityGenerationRef.current !== identityGeneration) {
716
- throw new Error(t("hooks.useSandboxFiles.fileSaveCancelledBecauseThe"));
717
- }
718
- const liveContent = live.encoding === "base64" ? decodeBase64Text(live.content) : live.content;
719
- if (live.truncated || live.isBinary || liveContent !== writeOptions.expectedContent) {
720
- throw new FileWriteConflictError(path, writeOptions.expectedContent, liveContent, t);
721
- }
722
- }
723
- if (identityGenerationRef.current !== identityGeneration) {
724
- throw new Error(t("hooks.useSandboxFiles.fileSaveCancelledBecauseThe"));
725
- }
726
- return await client.fsWrite(workspaceId, sessionId, {
727
- path,
728
- content,
729
- overwrite: true,
730
- ...route ? { route } : {}
731
- });
732
- },
733
- exists ? [] : [parent]
734
- );
735
- },
736
- [client, workspaceId, sessionId, tree, rootPath, route, runOptimistic, t]
737
- );
738
- const createFile = useCallback(
739
- async (path) => {
740
- if (!sessionId) throw new Error("no session");
741
- const parent = parentWithinTree(path, rootPath);
742
- const node = {
743
- path,
744
- name: leafOf(path),
745
- kind: "file",
746
- size: 0
747
- };
748
- await runOptimistic(
749
- t("hooks.useSandboxFiles.createFile"),
750
- (nodes) => insertNode(nodes, parent, node, rootPath),
751
- () => client.fsWrite(workspaceId, sessionId, {
752
- path,
753
- content: "",
754
- overwrite: false,
755
- ...route ? { route } : {}
756
- }),
757
- [parent]
758
- );
759
- },
760
- [client, workspaceId, sessionId, rootPath, route, runOptimistic, t]
761
- );
762
- const createDir = useCallback(
763
- async (path) => {
764
- if (!sessionId) throw new Error("no session");
765
- const parent = parentWithinTree(path, rootPath);
766
- const node = {
767
- path,
768
- name: leafOf(path),
769
- kind: "dir",
770
- children: []
771
- };
772
- await runOptimistic(
773
- t("hooks.useSandboxFiles.createFolder"),
774
- (nodes) => insertNode(nodes, parent, node, rootPath),
775
- () => client.fsMkdir(workspaceId, sessionId, {
776
- path,
777
- recursive: true,
778
- ...route ? { route } : {}
779
- }),
780
- [parent]
781
- );
782
- },
783
- [client, workspaceId, sessionId, rootPath, route, runOptimistic, t]
784
- );
785
- const deleteEntry = useCallback(
786
- async (path, recursive = false) => {
787
- if (!sessionId) throw new Error("no session");
788
- await runOptimistic(
789
- "delete",
790
- (nodes) => removeNode(nodes, path, rootPath),
791
- () => client.fsDelete(workspaceId, sessionId, {
792
- path,
793
- recursive,
794
- ...route ? { route } : {}
795
- }),
796
- [parentWithinTree(path, rootPath)]
797
- );
798
- },
799
- [client, workspaceId, sessionId, rootPath, route, runOptimistic]
800
- );
801
- const moveEntry = useCallback(
802
- async (path, newPath, opts) => {
803
- if (!sessionId) throw new Error("no session");
804
- const from = parentWithinTree(path, rootPath);
805
- const to = parentWithinTree(newPath, rootPath);
806
- await runOptimistic(
807
- "move",
808
- (nodes) => {
809
- const moving = findNodeByPath(nodes, path);
810
- if (!moving) return nodes;
811
- const moved = repathNode(moving, path, newPath);
812
- return insertNode(removeNode(nodes, path, rootPath), to, moved, rootPath);
813
- },
814
- () => client.fsMove(workspaceId, sessionId, {
815
- path,
816
- newPath,
817
- overwrite: opts?.overwrite ?? false,
818
- ...route ? { route } : {}
819
- }),
820
- to === from ? [from] : [from, to]
821
- );
822
- },
823
- [client, workspaceId, sessionId, rootPath, route, runOptimistic]
824
- );
825
- const captureRef = useRef(capture);
826
- captureRef.current = capture;
827
- const captureRevision = capture?.revision ?? null;
828
- const previousIdentityRef = useRef(identityKey);
829
- useEffect(() => {
830
- refreshAbortRef.current?.abort();
831
- refreshAbortRef.current = null;
832
- refreshGenerationRef.current += 1;
833
- eventReadAbortRef.current.abort();
834
- eventReadAbortRef.current = new AbortController();
835
- const identityChanged = previousIdentityRef.current !== identityKey;
836
- previousIdentityRef.current = identityKey;
837
- if (identityChanged || !enabled) {
838
- if (identityChanged) eventReconcileInFlightRef.current = null;
839
- identityAbortRef.current.abort();
840
- identityAbortRef.current = new AbortController();
841
- identityGenerationRef.current += 1;
842
- lastSeqRef.current = 0;
843
- pendingParentsRef.current = /* @__PURE__ */ new Set();
844
- pendingGitRef.current = false;
845
- eventReconcilePendingRef.current = false;
846
- if (debounceRef.current) {
847
- clearTimeout(debounceRef.current);
848
- debounceRef.current = null;
849
- }
850
- ownRevisionsRef.current = /* @__PURE__ */ new Set();
851
- statusRef.current = /* @__PURE__ */ new Map();
852
- treeRef.current = [];
853
- setTree([]);
854
- setStateIdentity(identityKey);
855
- setExpandingPaths(/* @__PURE__ */ new Set());
856
- sourceRef.current = null;
857
- setSource(null);
858
- setLoading(false);
859
- setError(null);
860
- setGitSummary(null);
861
- setGitLoading(false);
862
- setContentRevision(0);
863
- }
864
- if (!enabled) {
865
- return;
866
- }
867
- const currentCapture = captureRevision !== null ? captureRef.current : null;
868
- if (currentCapture && (identityChanged || !isLive || sourceRef.current !== "live")) {
869
- seedFromCapture(currentCapture);
870
- }
871
- if (!active) {
872
- if (!active) {
873
- setLoading(false);
874
- setGitLoading(false);
875
- }
876
- return;
877
- }
878
- if (isLive || !hasLiveIoFence && !currentCapture) {
879
- void refresh();
880
- }
881
- return () => {
882
- refreshAbortRef.current?.abort();
883
- refreshAbortRef.current = null;
884
- refreshGenerationRef.current += 1;
885
- eventReadAbortRef.current.abort();
886
- eventReconcilePendingRef.current = false;
887
- };
888
- }, [
889
- enabled,
890
- active,
891
- isLive,
892
- hasLiveIoFence,
893
- captureRevision,
894
- identityKey,
895
- refresh,
896
- seedFromCapture
897
- ]);
898
- const refreshGitOverlay = useCallback(
899
- async (requestSignal) => {
900
- if (!sessionId) return;
901
- const identityGeneration = identityGenerationRef.current;
902
- const identitySignal = identityAbortRef.current.signal;
903
- const signal = requestSignal ? AbortSignal.any([identitySignal, requestSignal]) : identitySignal;
904
- setGitLoading(true);
905
- try {
906
- const batch = await client.gitReadBatch(
907
- workspaceId,
908
- sessionId,
909
- { requests: repoPaths.map((root) => ({ status: { path: root } })) },
910
- { signal }
911
- );
912
- const statuses = batch.results.map((result, index) => ({
913
- root: repoPaths[index] ?? "",
914
- status: result.status
915
- }));
916
- if (identityGenerationRef.current !== identityGeneration) return;
917
- const overlay = /* @__PURE__ */ new Map();
918
- for (const { root, status } of statuses) {
919
- for (const file of status.files) {
920
- const code = file.worktree ?? file.index;
921
- const mapped = code ? GIT_STATUS_TO_TREE[code] : void 0;
922
- if (mapped) overlay.set(qualifyStatusPath(root, file.path, rootPath), mapped);
923
- }
924
- }
925
- statusRef.current = overlay;
926
- setGitSummary(summarizeStatuses(statuses));
927
- setTree((prev) => applyStatus(prev));
928
- } catch {
929
- } finally {
930
- if (identityGenerationRef.current === identityGeneration) setGitLoading(false);
931
- }
932
- },
933
- [client, workspaceId, sessionId, repoPaths, rootPath, applyStatus]
934
- );
935
- const performEventReconcile = useCallback(async () => {
936
- const parents = pendingParentsRef.current;
937
- pendingParentsRef.current = /* @__PURE__ */ new Set();
938
- const wantGit = pendingGitRef.current;
939
- pendingGitRef.current = false;
940
- const signal = eventReadAbortRef.current.signal;
941
- const paths = [...parents];
942
- await reconcilePaths(paths, signal);
943
- if (wantGit) await refreshGitOverlay(signal);
944
- }, [reconcilePaths, refreshGitOverlay]);
945
- const performEventReconcileRef = useRef(performEventReconcile);
946
- performEventReconcileRef.current = performEventReconcile;
947
- const reconcilePendingEvents = useCallback(async () => {
948
- eventReconcilePendingRef.current = true;
949
- const existing = eventReconcileInFlightRef.current;
950
- if (existing) return await existing;
951
- const identityGeneration = identityGenerationRef.current;
952
- const run = (async () => {
953
- while (eventReconcilePendingRef.current && identityGenerationRef.current === identityGeneration) {
954
- eventReconcilePendingRef.current = false;
955
- await performEventReconcileRef.current();
956
- }
957
- })();
958
- eventReconcileInFlightRef.current = run;
959
- try {
960
- await run;
961
- } finally {
962
- if (eventReconcileInFlightRef.current === run) eventReconcileInFlightRef.current = null;
963
- }
964
- }, []);
965
- const events = options.events;
966
- useEffect(() => {
967
- if (!enabled || !events) return;
968
- if (!active || !acceptsEventReads) {
969
- for (const event of events) {
970
- if (event.sequence > lastSeqRef.current) lastSeqRef.current = event.sequence;
971
- }
972
- if (debounceRef.current) {
973
- clearTimeout(debounceRef.current);
974
- debounceRef.current = null;
975
- }
976
- pendingParentsRef.current = /* @__PURE__ */ new Set();
977
- pendingGitRef.current = false;
978
- eventReconcilePendingRef.current = false;
979
- return;
980
- }
981
- let sawNew = false;
982
- let contentChanged = false;
983
- for (const event of events) {
984
- if (event.sequence <= lastSeqRef.current) continue;
985
- if (event.type === "fs.changed") {
986
- sawNew = true;
987
- const payload = event.payload;
988
- if (!payload || typeof payload !== "object") continue;
989
- if (payload.source === "write") continue;
990
- if (typeof payload.revision === "number" && ownRevisionsRef.current.has(payload.revision))
991
- continue;
992
- contentChanged = true;
993
- for (const change of payload.changes ?? []) {
994
- pendingParentsRef.current.add(parentWithinTree(change.path, rootPath));
995
- if (change.oldPath) {
996
- pendingParentsRef.current.add(parentWithinTree(change.oldPath, rootPath));
997
- }
998
- }
999
- } else if (event.type === "git.changed") {
1000
- sawNew = true;
1001
- const payload = event.payload;
1002
- if (payload && typeof payload === "object" && typeof payload.revision === "number" && ownRevisionsRef.current.has(payload.revision))
1003
- continue;
1004
- pendingGitRef.current = true;
1005
- }
1006
- }
1007
- for (const event of events)
1008
- if (event.sequence > lastSeqRef.current) lastSeqRef.current = event.sequence;
1009
- if (!sawNew) return;
1010
- if (contentChanged) setContentRevision((revision) => revision + 1);
1011
- if (debounceRef.current) clearTimeout(debounceRef.current);
1012
- const identityGeneration = identityGenerationRef.current;
1013
- debounceRef.current = setTimeout(() => {
1014
- debounceRef.current = null;
1015
- if (identityGenerationRef.current !== identityGeneration) return;
1016
- if (!acceptsEventReadsRef.current) {
1017
- pendingParentsRef.current = /* @__PURE__ */ new Set();
1018
- pendingGitRef.current = false;
1019
- return;
1020
- }
1021
- void reconcilePendingEvents();
1022
- }, 150);
1023
- }, [enabled, active, acceptsEventReads, events, rootPath, reconcilePendingEvents]);
1024
- useEffect(() => {
1025
- if (active && acceptsEventReads) return;
1026
- if (debounceRef.current) {
1027
- clearTimeout(debounceRef.current);
1028
- debounceRef.current = null;
1029
- }
1030
- pendingParentsRef.current = /* @__PURE__ */ new Set();
1031
- pendingGitRef.current = false;
1032
- eventReconcilePendingRef.current = false;
1033
- }, [active, acceptsEventReads]);
1034
- useEffect(
1035
- () => () => {
1036
- refreshAbortRef.current?.abort();
1037
- identityAbortRef.current.abort();
1038
- eventReadAbortRef.current.abort();
1039
- eventReconcilePendingRef.current = false;
1040
- identityGenerationRef.current += 1;
1041
- if (debounceRef.current) clearTimeout(debounceRef.current);
1042
- },
1043
- []
1044
- );
1045
- const identityMatches = enabled && stateIdentity === identityKey;
1046
- const capturedAt = identityMatches && source === "capture" ? capture?.capturedAt ?? null : null;
1047
- return useMemo(
1048
- () => ({
1049
- tree: identityMatches ? tree : NO_TREE,
1050
- expand,
1051
- expandingPaths: identityMatches ? expandingPaths : NO_PATHS,
1052
- readFile,
1053
- writeFile,
1054
- createFile,
1055
- createDir,
1056
- deleteEntry,
1057
- moveEntry,
1058
- refresh,
1059
- contentRevision: identityMatches ? contentRevision : 0,
1060
- source: identityMatches ? source : null,
1061
- capturedAt,
1062
- gitSummary: identityMatches ? gitSummary : null,
1063
- gitLoading: identityMatches && gitLoading,
1064
- loading: identityMatches && loading,
1065
- error: identityMatches ? error : null
1066
- }),
1067
- [
1068
- identityMatches,
1069
- tree,
1070
- expand,
1071
- expandingPaths,
1072
- readFile,
1073
- writeFile,
1074
- createFile,
1075
- createDir,
1076
- deleteEntry,
1077
- moveEntry,
1078
- refresh,
1079
- contentRevision,
1080
- source,
1081
- capturedAt,
1082
- gitSummary,
1083
- gitLoading,
1084
- loading,
1085
- error
1086
- ]
1087
- );
1088
- }
1089
- var NO_TREE = Object.freeze([]);
1090
- var NO_PATHS = /* @__PURE__ */ new Set();
1091
-
1092
- // src/file-node-visibility.ts
1093
- var TOOL_AND_CACHE_DIRS = /* @__PURE__ */ new Set([
1094
- ".bun",
1095
- ".cache",
1096
- ".git",
1097
- ".gradle",
1098
- ".mypy_cache",
1099
- ".npm",
1100
- ".pnpm-store",
1101
- ".pytest_cache",
1102
- ".ruff_cache",
1103
- ".tox",
1104
- ".turbo",
1105
- ".venv",
1106
- ".yarn",
1107
- "__pycache__",
1108
- "node_modules"
1109
- ]);
1110
- var KEPT_DOT_DIRS = /* @__PURE__ */ new Set([".agents", ".claude", ".github"]);
1111
- function isHiddenByDefault(node, context, rootIsRepository) {
1112
- if (node.kind !== "dir") return false;
1113
- if (TOOL_AND_CACHE_DIRS.has(node.name)) return true;
1114
- return context.depth === 0 && !rootIsRepository && node.name.startsWith(".") && !KEPT_DOT_DIRS.has(node.name);
1115
- }
1116
- function treeRootIsRepository(nodes) {
1117
- return nodes.some((node) => node.name === ".git");
1118
- }
1119
- function pathMayBeHiddenByDefault(path) {
1120
- const segments = path.split(/[/\\]/u);
1121
- return segments.slice(0, -1).some((segment) => TOOL_AND_CACHE_DIRS.has(segment));
1122
- }
1123
- function pathIsInsideDirectory(path, directory) {
1124
- if (!path.startsWith(directory) || path === directory) return false;
1125
- if (directory.endsWith("/") || directory.endsWith("\\")) return true;
1126
- const boundary = path[directory.length];
1127
- return boundary === "/" || boundary === "\\";
1128
- }
1129
- function visibleFileTree(nodes, predicate, parent = null, depth = 0) {
1130
- if (!predicate) return nodes;
1131
- const visible = [];
1132
- for (const node of nodes) {
1133
- if (!predicate(node, { depth, parent })) continue;
1134
- visible.push(
1135
- node.children === void 0 ? node : {
1136
- ...node,
1137
- children: visibleFileTree(node.children, predicate, node, depth + 1)
1138
- }
1139
- );
1140
- }
1141
- return visible;
1142
- }
1143
- function filePathVisibility(nodes, path, predicate, parent = null, depth = 0) {
1144
- if (!predicate) return "visible";
1145
- for (const node of nodes) {
1146
- if (node.path !== path && !pathIsInsideDirectory(path, node.path)) continue;
1147
- if (!predicate(node, { depth, parent })) return "hidden";
1148
- if (node.path === path) return "visible";
1149
- if (node.kind !== "dir" || node.children === void 0) return "unknown";
1150
- return filePathVisibility(node.children, path, predicate, node, depth + 1);
1151
- }
1152
- return "unknown";
1153
- }
1154
-
1155
- // src/components/file-browser.tsx
1156
- import {
1157
- ChevronRightIcon,
1158
- EyeIcon,
1159
- EyeOffIcon,
1160
- FileIcon,
1161
- FilePlusIcon,
1162
- FolderIcon,
1163
- FolderPlusIcon,
1164
- PencilIcon,
1165
- RefreshCwIcon,
1166
- TriangleAlertIcon,
1167
- Trash2Icon
1168
- } from "lucide-react";
1169
- import {
1170
- useCallback as useCallback2,
1171
- useEffect as useEffect2,
1172
- useId,
1173
- useLayoutEffect,
1174
- useMemo as useMemo2,
1175
- useRef as useRef2,
1176
- useState as useState2
1177
- } from "react";
1178
- import { AlertDialog } from "radix-ui";
1179
- import { VList } from "virtua";
1180
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1181
- var STATUS_TINT = {
1182
- added: "text-og-status-idle",
1183
- modified: "text-og-status-running",
1184
- deleted: "text-og-status-failed line-through",
1185
- renamed: "text-og-accent",
1186
- untracked: "text-og-fg-subtle"
1187
- };
1188
- var useBrowserLayoutEffect = typeof window === "undefined" ? useEffect2 : useLayoutEffect;
1189
- function parentOf2(path) {
1190
- const i = path.lastIndexOf("/");
1191
- return i <= 0 ? "" : path.slice(0, i);
1192
- }
1193
- function joinPath(parent, name) {
1194
- return parent ? `${parent}/${name}` : name;
1195
- }
1196
- function itemKey(item) {
1197
- switch (item.type) {
1198
- case "node":
1199
- return item.node.path;
1200
- case "create":
1201
- return `create:${item.parent}`;
1202
- case "skeleton":
1203
- return `skeleton:${item.path}`;
1204
- case "residue":
1205
- return `residue:${item.path}`;
1206
- }
1207
- }
1208
- function pathIsInsideDirectory2(path, directory) {
1209
- if (!path.startsWith(directory) || path === directory) return false;
1210
- if (directory.endsWith("/") || directory.endsWith("\\")) return true;
1211
- const boundary = path[directory.length];
1212
- return boundary === "/" || boundary === "\\";
1213
- }
1214
- function findNode(nodes, path) {
1215
- for (const node of nodes) {
1216
- if (node.path === path) return node;
1217
- if (node.kind === "dir" && node.children && pathIsInsideDirectory2(path, node.path)) {
1218
- const hit = findNode(node.children, path);
1219
- if (hit) return hit;
1220
- }
1221
- }
1222
- return void 0;
1223
- }
1224
- function traceRevealPath(nodes, targetPath) {
1225
- for (const node of nodes) {
1226
- if (node.path === targetPath) {
1227
- return {
1228
- directories: node.kind === "dir" ? [node.path] : [],
1229
- frontier: node.kind === "dir" && node.children === void 0 ? node.path : null
1230
- };
1231
- }
1232
- if (node.kind !== "dir" || !pathIsInsideDirectory2(targetPath, node.path)) continue;
1233
- if (node.children === void 0) {
1234
- return { directories: [node.path], frontier: node.path };
1235
- }
1236
- const child = traceRevealPath(node.children, targetPath);
1237
- return {
1238
- directories: [node.path, ...child.directories],
1239
- frontier: child.frontier
1240
- };
1241
- }
1242
- return { directories: [], frontier: null };
1243
- }
1244
- function FileBrowser({
1245
- result,
1246
- fallback,
1247
- onSelectFile,
1248
- selectedPath,
1249
- isNodeVisible,
1250
- showHidden = false,
1251
- onShowHiddenChange,
1252
- revealPath,
1253
- revealPathRequestId,
1254
- renderNode,
1255
- emptyState,
1256
- editable = true,
1257
- confirmDelete,
1258
- className
1259
- }) {
1260
- const t = useOpenGeniText();
1261
- const [expanded, setExpanded] = useState2(/* @__PURE__ */ new Set());
1262
- const [loadingPaths, setLoadingPaths] = useState2(/* @__PURE__ */ new Set());
1263
- const [active, setActive] = useState2(null);
1264
- const [draftCreate, setDraftCreate] = useState2(null);
1265
- const [draftRename, setDraftRename] = useState2(null);
1266
- const [dragOver, setDragOver] = useState2(null);
1267
- const [menu, setMenu] = useState2(null);
1268
- const [pendingDelete, setPendingDelete] = useState2(null);
1269
- const [busy, setBusy] = useState2(false);
1270
- const [coarsePointer, setCoarsePointer] = useState2(false);
1271
- const [revealRequest, setRevealRequest] = useState2(null);
1272
- const handledRevealRequestRef = useRef2(null);
1273
- const attemptedRevealPathsRef = useRef2(/* @__PURE__ */ new Set());
1274
- const treeId = useId();
1275
- const container = usePortalTokenSource();
1276
- const containerRef = container.currentRef;
1277
- const deleteReturnFocusRef = useRef2(null);
1278
- const vlistRef = useRef2(null);
1279
- const portalTokenStyle = usePortalTokenStyle(container.source);
1280
- const getTreeElement = useCallback2(
1281
- () => typeof document === "undefined" ? null : document.getElementById(treeId),
1282
- [treeId]
1283
- );
1284
- const visibleTree = useMemo2(
1285
- () => visibleFileTree(result.tree, isNodeVisible),
1286
- [isNodeVisible, result.tree]
1287
- );
1288
- useBrowserLayoutEffect(() => {
1289
- if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
1290
- const query = window.matchMedia("(pointer: coarse)");
1291
- const update = () => setCoarsePointer(query.matches);
1292
- update();
1293
- if (typeof query.addEventListener === "function") {
1294
- query.addEventListener("change", update);
1295
- return () => query.removeEventListener("change", update);
1296
- }
1297
- if (typeof query.addListener === "function") {
1298
- query.addListener(update);
1299
- return () => query.removeListener(update);
1300
- }
1301
- }, []);
1302
- const effectiveRevealRequestId = revealPath ? revealPathRequestId ?? revealPath : null;
1303
- useEffect2(() => {
1304
- if (!revealPath || effectiveRevealRequestId === null) {
1305
- setRevealRequest(null);
1306
- return;
1307
- }
1308
- const handled = handledRevealRequestRef.current;
1309
- if (handled?.path === revealPath && handled.requestId === effectiveRevealRequestId) return;
1310
- handledRevealRequestRef.current = {
1311
- path: revealPath,
1312
- requestId: effectiveRevealRequestId
1313
- };
1314
- attemptedRevealPathsRef.current = /* @__PURE__ */ new Set();
1315
- setActive(null);
1316
- setRevealRequest({ path: revealPath, requestId: effectiveRevealRequestId });
1317
- }, [effectiveRevealRequestId, revealPath]);
1318
- const visibleActive = active && findNode(visibleTree, active) ? active : null;
1319
- const cursor = visibleActive ?? (selectedPath && findNode(visibleTree, selectedPath) ? selectedPath : null);
1320
- useEffect2(() => {
1321
- if (active !== null && visibleActive === null) setActive(null);
1322
- }, [active, visibleActive]);
1323
- const expand = useCallback2(
1324
- async (path) => {
1325
- const node = findNode(visibleTree, path);
1326
- if (node && node.kind === "dir" && node.children === void 0) {
1327
- setLoadingPaths((prev) => new Set(prev).add(path));
1328
- try {
1329
- await result.expand(path);
1330
- } finally {
1331
- setLoadingPaths((prev) => {
1332
- const next = new Set(prev);
1333
- next.delete(path);
1334
- return next;
1335
- });
1336
- }
1337
- }
1338
- },
1339
- [result, visibleTree]
1340
- );
1341
- const open = useCallback2(
1342
- (path) => {
1343
- setExpanded((prev) => new Set(prev).add(path));
1344
- void expand(path);
1345
- },
1346
- [expand]
1347
- );
1348
- useEffect2(() => {
1349
- if (!revealRequest) return;
1350
- const trace = traceRevealPath(visibleTree, revealRequest.path);
1351
- if (trace.directories.length > 0) {
1352
- setExpanded((previous) => {
1353
- const next = new Set(previous);
1354
- let changed = false;
1355
- for (const path of trace.directories) {
1356
- if (next.has(path)) continue;
1357
- next.add(path);
1358
- changed = true;
1359
- }
1360
- return changed ? next : previous;
1361
- });
1362
- }
1363
- const frontier = trace.frontier;
1364
- if (!frontier || attemptedRevealPathsRef.current.has(frontier) || loadingPaths.has(frontier) || result.expandingPaths.has(frontier)) {
1365
- return;
1366
- }
1367
- attemptedRevealPathsRef.current.add(frontier);
1368
- void expand(frontier);
1369
- }, [expand, loadingPaths, result.expandingPaths, revealRequest, visibleTree]);
1370
- const toggle = useCallback2(
1371
- async (node) => {
1372
- if (node.kind !== "dir") return;
1373
- const isOpen = expanded.has(node.path);
1374
- setExpanded((prev) => {
1375
- const next = new Set(prev);
1376
- if (isOpen) next.delete(node.path);
1377
- else next.add(node.path);
1378
- return next;
1379
- });
1380
- if (!isOpen) await expand(node.path);
1381
- },
1382
- [expanded, expand]
1383
- );
1384
- const cold = result.source !== "live";
1385
- const renderItems = useMemo2(() => {
1386
- const items = [];
1387
- if (draftCreate && draftCreate.parent === "") {
1388
- items.push({ type: "create", parent: "", kind: draftCreate.kind, depth: 0 });
1389
- }
1390
- const walk = (nodes, depth) => {
1391
- for (const node of nodes) {
1392
- items.push({ type: "node", node, depth });
1393
- if (node.kind !== "dir" || !expanded.has(node.path)) continue;
1394
- if (draftCreate && draftCreate.parent === node.path) {
1395
- items.push({
1396
- type: "create",
1397
- parent: node.path,
1398
- kind: draftCreate.kind,
1399
- depth: depth + 1
1400
- });
1401
- }
1402
- const childless = node.children === void 0 || node.children.length === 0;
1403
- const isLoading = loadingPaths.has(node.path) || result.expandingPaths.has(node.path);
1404
- if (node.truncated && childless && cold && !isLoading) {
1405
- items.push({ type: "residue", path: node.path, depth: depth + 1 });
1406
- } else if (node.children && node.children.length > 0) {
1407
- walk(node.children, depth + 1);
1408
- } else if (isLoading && childless) {
1409
- items.push({ type: "skeleton", path: node.path, depth: depth + 1 });
1410
- }
1411
- }
1412
- };
1413
- walk(visibleTree, 0);
1414
- return items;
1415
- }, [visibleTree, expanded, draftCreate, loadingPaths, result.expandingPaths, cold]);
1416
- const unicodeFontPaths = useMemo2(
1417
- () => renderItems.flatMap((item) => item.type === "node" ? [item.node.path] : []),
1418
- [renderItems]
1419
- );
1420
- useUnicodeFallbackFonts(unicodeFontPaths);
1421
- const flatRows = useMemo2(
1422
- () => renderItems.flatMap(
1423
- (item) => item.type === "node" ? [{ node: item.node, depth: item.depth }] : []
1424
- ),
1425
- [renderItems]
1426
- );
1427
- const rowIndexByPath = useMemo2(
1428
- () => new Map(flatRows.map((row, index) => [row.node.path, index])),
1429
- [flatRows]
1430
- );
1431
- const treePositionByPath = useMemo2(() => {
1432
- const positions = /* @__PURE__ */ new Map();
1433
- const visit = (nodes) => {
1434
- nodes.forEach((node, index) => {
1435
- positions.set(node.path, { position: index + 1, setSize: nodes.length });
1436
- if (node.children) visit(node.children);
1437
- });
1438
- };
1439
- visit(visibleTree);
1440
- return positions;
1441
- }, [visibleTree]);
1442
- const cursorIndex = cursor ? rowIndexByPath.get(cursor) ?? -1 : -1;
1443
- const activeDescendantId = cursorIndex >= 0 ? `${treeId}-item-${cursorIndex}` : void 0;
1444
- const supportsMutation = editable && result.source === "live" && result.error === null && !result.loading;
1445
- const performDelete = useCallback2(
1446
- async (node) => {
1447
- if (!supportsMutation) return;
1448
- const recursive = node.kind === "dir";
1449
- setBusy(true);
1450
- try {
1451
- await result.deleteEntry(node.path, recursive);
1452
- } catch {
1453
- } finally {
1454
- setBusy(false);
1455
- }
1456
- },
1457
- [supportsMutation, result]
1458
- );
1459
- const runDelete = useCallback2(
1460
- async (node, returnFocus) => {
1461
- if (!supportsMutation) return;
1462
- setMenu(null);
1463
- if (!confirmDelete) {
1464
- deleteReturnFocusRef.current = returnFocus ?? (typeof document !== "undefined" && document.activeElement instanceof HTMLElement ? document.activeElement : null);
1465
- setPendingDelete(node);
1466
- return;
1467
- }
1468
- if (await confirmDelete(node)) await performDelete(node);
1469
- },
1470
- [supportsMutation, confirmDelete, performDelete]
1471
- );
1472
- const closePendingDelete = useCallback2(
1473
- (restoreTrigger) => {
1474
- const returnTarget = restoreTrigger ? deleteReturnFocusRef.current : getTreeElement();
1475
- deleteReturnFocusRef.current = null;
1476
- setPendingDelete(null);
1477
- if (typeof window !== "undefined") {
1478
- window.requestAnimationFrame(() => {
1479
- const target = returnTarget?.isConnected ? returnTarget : getTreeElement();
1480
- target?.focus();
1481
- });
1482
- }
1483
- },
1484
- [getTreeElement]
1485
- );
1486
- const commitCreate = useCallback2(
1487
- async (name) => {
1488
- const draft = draftCreate;
1489
- setDraftCreate(null);
1490
- if (!draft || !supportsMutation) return;
1491
- const trimmed = name.trim().replace(/\/+$/, "");
1492
- if (!trimmed) return;
1493
- const path = joinPath(draft.parent, trimmed);
1494
- setBusy(true);
1495
- try {
1496
- if (draft.kind === "dir") {
1497
- await result.createDir(path);
1498
- open(path);
1499
- } else {
1500
- await result.createFile(path);
1501
- setActive(path);
1502
- onSelectFile?.(path);
1503
- }
1504
- } catch {
1505
- } finally {
1506
- setBusy(false);
1507
- }
1508
- },
1509
- [draftCreate, supportsMutation, result, open, onSelectFile]
1510
- );
1511
- const commitRename = useCallback2(
1512
- async (name) => {
1513
- const draft = draftRename;
1514
- setDraftRename(null);
1515
- if (!draft || !supportsMutation) return;
1516
- const node = findNode(visibleTree, draft.path);
1517
- const trimmed = name.trim().replace(/\/+$/, "");
1518
- if (!node || !trimmed || trimmed === node.name) return;
1519
- const newPath = joinPath(parentOf2(draft.path), trimmed);
1520
- setBusy(true);
1521
- try {
1522
- await result.moveEntry(draft.path, newPath);
1523
- if (node.kind === "file" && (selectedPath === draft.path || active === draft.path)) {
1524
- setActive(newPath);
1525
- onSelectFile?.(newPath);
1526
- }
1527
- } catch {
1528
- } finally {
1529
- setBusy(false);
1530
- }
1531
- },
1532
- [draftRename, supportsMutation, result, selectedPath, active, onSelectFile, visibleTree]
1533
- );
1534
- const startCreate = useCallback2(
1535
- (kind) => {
1536
- if (!supportsMutation) return;
1537
- const anchor = cursor ? findNode(visibleTree, cursor) : void 0;
1538
- const parent = anchor ? anchor.kind === "dir" ? anchor.path : parentOf2(anchor.path) : "";
1539
- if (parent) open(parent);
1540
- setDraftRename(null);
1541
- setMenu(null);
1542
- setDraftCreate({ parent, kind });
1543
- },
1544
- [supportsMutation, cursor, open, visibleTree]
1545
- );
1546
- const startRename = useCallback2(
1547
- (node) => {
1548
- if (!supportsMutation) return;
1549
- setDraftCreate(null);
1550
- setMenu(null);
1551
- setDraftRename({ path: node.path });
1552
- },
1553
- [supportsMutation]
1554
- );
1555
- const onDropOnto = useCallback2(
1556
- async (targetDir, sourcePath) => {
1557
- setDragOver(null);
1558
- if (!supportsMutation || !sourcePath) return;
1559
- const src = findNode(visibleTree, sourcePath);
1560
- if (!src) return;
1561
- if (parentOf2(sourcePath) === targetDir) return;
1562
- if (targetDir === sourcePath || targetDir.startsWith(`${sourcePath}/`)) return;
1563
- const newPath = joinPath(targetDir, src.name);
1564
- if (newPath === sourcePath) return;
1565
- setBusy(true);
1566
- try {
1567
- await result.moveEntry(sourcePath, newPath);
1568
- if (src.kind === "file" && (selectedPath === sourcePath || active === sourcePath)) {
1569
- setActive(newPath);
1570
- onSelectFile?.(newPath);
1571
- }
1572
- } catch {
1573
- } finally {
1574
- setBusy(false);
1575
- }
1576
- },
1577
- [supportsMutation, result, selectedPath, active, onSelectFile, visibleTree]
1578
- );
1579
- const onKeyDown = useCallback2(
1580
- (e) => {
1581
- if (draftCreate || draftRename) return;
1582
- if (flatRows.length === 0) return;
1583
- const idx = flatRows.findIndex((r) => r.node.path === cursor);
1584
- const move = (next) => {
1585
- const clamped = Math.max(0, Math.min(flatRows.length - 1, next));
1586
- const row = flatRows[clamped];
1587
- if (row) setActive(row.node.path);
1588
- e.preventDefault();
1589
- };
1590
- const cur = idx >= 0 ? flatRows[idx] : void 0;
1591
- switch (e.key) {
1592
- case "ArrowDown":
1593
- move(idx < 0 ? 0 : idx + 1);
1594
- break;
1595
- case "ArrowUp":
1596
- move(idx < 0 ? 0 : idx - 1);
1597
- break;
1598
- case "Home":
1599
- move(0);
1600
- break;
1601
- case "End":
1602
- move(flatRows.length - 1);
1603
- break;
1604
- case "PageDown": {
1605
- const pageSize = Math.max(
1606
- 1,
1607
- Math.floor((containerRef.current?.clientHeight || 280) / (coarsePointer ? 44 : 28)) - 1
1608
- );
1609
- move((idx < 0 ? 0 : idx) + pageSize);
1610
- break;
1611
- }
1612
- case "PageUp": {
1613
- const pageSize = Math.max(
1614
- 1,
1615
- Math.floor((containerRef.current?.clientHeight || 280) / (coarsePointer ? 44 : 28)) - 1
1616
- );
1617
- move((idx < 0 ? 0 : idx) - pageSize);
1618
- break;
1619
- }
1620
- case "ArrowRight":
1621
- if (cur?.node.kind === "dir") {
1622
- if (!expanded.has(cur.node.path)) open(cur.node.path);
1623
- else move(idx + 1);
1624
- e.preventDefault();
1625
- }
1626
- break;
1627
- case "ArrowLeft":
1628
- if (cur) {
1629
- if (cur.node.kind === "dir" && expanded.has(cur.node.path)) {
1630
- setExpanded((prev) => {
1631
- const n = new Set(prev);
1632
- n.delete(cur.node.path);
1633
- return n;
1634
- });
1635
- } else {
1636
- const parent = parentOf2(cur.node.path);
1637
- if (parent) setActive(parent);
1638
- }
1639
- e.preventDefault();
1640
- }
1641
- break;
1642
- case "Enter":
1643
- if (cur) {
1644
- if (cur.node.kind === "dir") void toggle(cur.node);
1645
- else onSelectFile?.(cur.node.path);
1646
- e.preventDefault();
1647
- }
1648
- break;
1649
- case "ContextMenu":
1650
- case "F10":
1651
- if (cur && supportsMutation && (e.key === "ContextMenu" || e.shiftKey)) {
1652
- const rowIndex = rowIndexByPath.get(cur.node.path) ?? 0;
1653
- const row = document.getElementById(`${treeId}-item-${rowIndex}`);
1654
- const rect = row?.getBoundingClientRect();
1655
- setMenu({
1656
- node: cur.node,
1657
- x: rect ? rect.left + Math.min(32, rect.width / 2) : 8,
1658
- y: rect ? rect.bottom : 8
1659
- });
1660
- e.preventDefault();
1661
- } else if (e.key === "F10") {
1662
- break;
1663
- }
1664
- break;
1665
- case "F2":
1666
- if (cur) {
1667
- startRename(cur.node);
1668
- e.preventDefault();
1669
- }
1670
- break;
1671
- case "Delete":
1672
- case "Backspace":
1673
- if (cur && supportsMutation) {
1674
- void runDelete(cur.node);
1675
- e.preventDefault();
1676
- }
1677
- break;
1678
- }
1679
- },
1680
- [
1681
- draftCreate,
1682
- draftRename,
1683
- flatRows,
1684
- cursor,
1685
- expanded,
1686
- open,
1687
- toggle,
1688
- onSelectFile,
1689
- startRename,
1690
- runDelete,
1691
- supportsMutation,
1692
- coarsePointer,
1693
- containerRef,
1694
- rowIndexByPath,
1695
- treeId
1696
- ]
1697
- );
1698
- useEffect2(() => {
1699
- if (!menu) return;
1700
- const close = () => setMenu(null);
1701
- window.addEventListener("click", close);
1702
- window.addEventListener("scroll", close, true);
1703
- window.addEventListener("resize", close);
1704
- return () => {
1705
- window.removeEventListener("click", close);
1706
- window.removeEventListener("scroll", close, true);
1707
- window.removeEventListener("resize", close);
1708
- };
1709
- }, [menu]);
1710
- const showErrorEmpty = result.error && visibleTree.length === 0 && !draftCreate;
1711
- const showDegradedTree = result.error && visibleTree.length > 0;
1712
- const showEmpty = !result.loading && visibleTree.length === 0 && !draftCreate;
1713
- const showToolbar = supportsMutation || result.loading || onShowHiddenChange !== void 0;
1714
- const usesVirtualTree = !showErrorEmpty && !showEmpty && renderItems.length > 500;
1715
- const renderNodeRow = (node, depth) => {
1716
- const isOpen = expanded.has(node.path);
1717
- if (renderNode) {
1718
- return /* @__PURE__ */ jsx("div", { children: renderNode(node, depth, isOpen) });
1719
- }
1720
- const isDir = node.kind === "dir";
1721
- const isSelected = node.path === selectedPath || node.path === active;
1722
- const isCursor = node.path === cursor;
1723
- const isLoading = loadingPaths.has(node.path) || result.expandingPaths.has(node.path);
1724
- const isRenaming = draftRename?.path === node.path;
1725
- const isDropTarget = dragOver === (isDir ? node.path : parentOf2(node.path));
1726
- const dropDir = isDir ? node.path : parentOf2(node.path);
1727
- const treePosition = treePositionByPath.get(node.path);
1728
- return /* @__PURE__ */ jsx(
1729
- "div",
1730
- {
1731
- id: `${treeId}-item-${rowIndexByPath.get(node.path) ?? 0}`,
1732
- role: "treeitem",
1733
- "aria-level": depth + 1,
1734
- "aria-posinset": treePosition?.position,
1735
- "aria-setsize": treePosition?.setSize,
1736
- "aria-expanded": isDir ? isOpen : void 0,
1737
- "aria-selected": isCursor || void 0,
1738
- "aria-busy": isLoading || void 0,
1739
- onDragOver: supportsMutation ? (e) => {
1740
- e.preventDefault();
1741
- e.dataTransfer.dropEffect = "move";
1742
- setDragOver(dropDir);
1743
- } : void 0,
1744
- onDragLeave: supportsMutation ? (e) => {
1745
- e.stopPropagation();
1746
- setDragOver((cur) => cur === dropDir ? null : cur);
1747
- } : void 0,
1748
- onDrop: supportsMutation ? (e) => {
1749
- e.preventDefault();
1750
- e.stopPropagation();
1751
- const src = e.dataTransfer.getData("text/og-path");
1752
- void onDropOnto(dropDir, src);
1753
- } : void 0,
1754
- children: isRenaming ? /* @__PURE__ */ jsx(
1755
- InlineInput,
1756
- {
1757
- depth,
1758
- kind: node.kind,
1759
- initialValue: node.name,
1760
- onCommit: (name) => void commitRename(name),
1761
- onCancel: () => setDraftRename(null)
1762
- }
1763
- ) : /* @__PURE__ */ jsxs(
1764
- "button",
1765
- {
1766
- type: "button",
1767
- tabIndex: -1,
1768
- draggable: supportsMutation || void 0,
1769
- onDragStart: supportsMutation ? (e) => {
1770
- e.dataTransfer.setData("text/og-path", node.path);
1771
- e.dataTransfer.effectAllowed = "move";
1772
- } : void 0,
1773
- onClick: () => {
1774
- setActive(node.path);
1775
- if (isDir) void toggle(node);
1776
- else onSelectFile?.(node.path);
1777
- },
1778
- onDoubleClick: () => supportsMutation && startRename(node),
1779
- onContextMenu: (e) => {
1780
- if (!supportsMutation) return;
1781
- e.preventDefault();
1782
- setActive(node.path);
1783
- setMenu({ node, x: e.clientX, y: e.clientY });
1784
- },
1785
- className: cn(
1786
- "group relative flex min-h-7 w-full items-center gap-1 truncate rounded-og-sm px-1 py-0.5 text-left text-og-sm pointer-coarse:min-h-11",
1787
- "hover:bg-og-surface-2",
1788
- isSelected && "bg-og-surface-2",
1789
- isCursor && "outline outline-1 -outline-offset-1 outline-og-accent",
1790
- isDropTarget && "bg-og-accent-soft ring-1 ring-inset ring-og-accent",
1791
- // A thin progress shimmer on the expanding row — no per-node spinner.
1792
- isLoading && "after:pointer-events-none after:absolute after:inset-x-1 after:bottom-0 after:h-px after:animate-pulse after:rounded-full after:bg-og-accent-soft",
1793
- node.status ? STATUS_TINT[node.status] : void 0
1794
- ),
1795
- style: { paddingLeft: `${depth * 12 + 4}px` },
1796
- children: [
1797
- isDir ? /* @__PURE__ */ jsx(
1798
- ChevronRightIcon,
1799
- {
1800
- className: cn(
1801
- "size-3 shrink-0 transition-transform",
1802
- isOpen && "rotate-90",
1803
- isLoading && "text-og-accent"
1804
- )
1805
- }
1806
- ) : /* @__PURE__ */ jsx("span", { className: "inline-block w-3 shrink-0" }),
1807
- isDir ? /* @__PURE__ */ jsx(FolderIcon, { className: "size-3.5 shrink-0" }) : /* @__PURE__ */ jsx(FileIcon, { className: "size-3.5 shrink-0" }),
1808
- /* @__PURE__ */ jsx("span", { className: "truncate", children: node.name }),
1809
- supportsMutation && /* @__PURE__ */ jsx(
1810
- "span",
1811
- {
1812
- role: "button",
1813
- tabIndex: -1,
1814
- "aria-label": t("fileBrowser.moreActions"),
1815
- onClick: (e) => {
1816
- e.preventDefault();
1817
- e.stopPropagation();
1818
- setActive(node.path);
1819
- const rect = e.currentTarget.getBoundingClientRect();
1820
- setMenu({ node, x: rect.right, y: rect.bottom });
1821
- },
1822
- className: "ml-auto hidden shrink-0 px-1 text-og-fg-subtle hover:text-og-fg group-hover:inline",
1823
- children: "\u22EF"
1824
- }
1825
- )
1826
- ]
1827
- }
1828
- )
1829
- }
1830
- );
1831
- };
1832
- const renderItem = (item) => {
1833
- switch (item.type) {
1834
- case "node":
1835
- return renderNodeRow(item.node, item.depth);
1836
- case "create":
1837
- return /* @__PURE__ */ jsx(
1838
- InlineInput,
1839
- {
1840
- depth: item.depth,
1841
- kind: item.kind,
1842
- initialValue: "",
1843
- onCommit: (name) => void commitCreate(name),
1844
- onCancel: () => setDraftCreate(null)
1845
- }
1846
- );
1847
- case "skeleton":
1848
- return /* @__PURE__ */ jsx(
1849
- "div",
1850
- {
1851
- role: "group",
1852
- "aria-hidden": true,
1853
- style: { paddingLeft: `${item.depth * 12 + 4}px` },
1854
- className: "space-y-1 py-1",
1855
- children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx(
1856
- "div",
1857
- {
1858
- className: "h-2.5 animate-pulse rounded-og-sm bg-og-surface-2",
1859
- style: { width: `${70 - i * 12}%` }
1860
- },
1861
- i
1862
- ))
1863
- }
1864
- );
1865
- case "residue":
1866
- return /* @__PURE__ */ jsxs(
1867
- "div",
1868
- {
1869
- style: { paddingLeft: `${item.depth * 12 + 4}px` },
1870
- className: "flex items-center gap-1.5 py-0.5 pr-1 text-og-xs italic text-og-fg-subtle",
1871
- children: [
1872
- /* @__PURE__ */ jsx("span", { className: "inline-block w-3 shrink-0" }),
1873
- /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: t("fileBrowser.contentsOnMachineOpenWhen") })
1874
- ]
1875
- }
1876
- );
1877
- }
1878
- };
1879
- useEffect2(() => {
1880
- if (!cursor) return;
1881
- const index = renderItems.findIndex((it) => it.type === "node" && it.node.path === cursor);
1882
- if (index >= 0) vlistRef.current?.scrollToIndex(index);
1883
- }, [cursor, renderItems]);
1884
- useEffect2(() => {
1885
- if (!revealRequest) return;
1886
- const index = renderItems.findIndex(
1887
- (item) => item.type === "node" && item.node.path === revealRequest.path
1888
- );
1889
- if (index < 0) return;
1890
- if (usesVirtualTree) {
1891
- vlistRef.current?.scrollToIndex(index);
1892
- } else {
1893
- document.getElementById(`${treeId}-item-${index}`)?.scrollIntoView?.({ block: "nearest" });
1894
- }
1895
- setRevealRequest(
1896
- (current) => current?.path === revealRequest.path && current.requestId === revealRequest.requestId ? null : current
1897
- );
1898
- }, [renderItems, revealRequest, treeId, usesVirtualTree]);
1899
- return /* @__PURE__ */ jsxs("div", { className: cn("flex min-h-0 min-w-0 flex-col", className), children: [
1900
- showToolbar && /* @__PURE__ */ jsxs(
1901
- "div",
1902
- {
1903
- role: "toolbar",
1904
- "aria-label": t("fileBrowser.fileActions"),
1905
- className: "flex shrink-0 flex-wrap items-center gap-0.5 border-b border-og-border px-1 py-1",
1906
- children: [
1907
- supportsMutation ? /* @__PURE__ */ jsxs(Fragment, { children: [
1908
- /* @__PURE__ */ jsx(
1909
- ToolbarButton,
1910
- {
1911
- label: t("fileBrowser.newFile"),
1912
- onClick: () => startCreate("file"),
1913
- disabled: busy,
1914
- children: /* @__PURE__ */ jsx(FilePlusIcon, { className: "size-3.5" })
1915
- }
1916
- ),
1917
- /* @__PURE__ */ jsx(
1918
- ToolbarButton,
1919
- {
1920
- label: t("fileBrowser.newFolder"),
1921
- onClick: () => startCreate("dir"),
1922
- disabled: busy,
1923
- children: /* @__PURE__ */ jsx(FolderPlusIcon, { className: "size-3.5" })
1924
- }
1925
- ),
1926
- /* @__PURE__ */ jsx(
1927
- ToolbarButton,
1928
- {
1929
- label: t("fileBrowser.rename"),
1930
- onClick: () => {
1931
- const node = cursor ? findNode(visibleTree, cursor) : void 0;
1932
- if (node) startRename(node);
1933
- },
1934
- disabled: busy || !cursor,
1935
- children: /* @__PURE__ */ jsx(PencilIcon, { className: "size-3.5" })
1936
- }
1937
- ),
1938
- /* @__PURE__ */ jsx(
1939
- ToolbarButton,
1940
- {
1941
- label: t("fileBrowser.delete"),
1942
- onClick: (event) => {
1943
- const node = cursor ? findNode(visibleTree, cursor) : void 0;
1944
- if (node) void runDelete(node, event.currentTarget);
1945
- },
1946
- disabled: busy || !cursor,
1947
- children: /* @__PURE__ */ jsx(Trash2Icon, { className: "size-3.5" })
1948
- }
1949
- )
1950
- ] }) : null,
1951
- /* @__PURE__ */ jsx("span", { className: "ml-auto" }),
1952
- onShowHiddenChange ? /* @__PURE__ */ jsx(
1953
- ToolbarButton,
1954
- {
1955
- label: t("fileBrowser.showHiddenFiles"),
1956
- pressed: showHidden,
1957
- onClick: () => onShowHiddenChange(!showHidden),
1958
- children: showHidden ? /* @__PURE__ */ jsx(EyeIcon, { className: "size-3.5" }) : /* @__PURE__ */ jsx(EyeOffIcon, { className: "size-3.5" })
1959
- }
1960
- ) : null,
1961
- /* @__PURE__ */ jsx(
1962
- ToolbarButton,
1963
- {
1964
- label: t("fileBrowser.refresh"),
1965
- onClick: () => void result.refresh(),
1966
- disabled: busy || result.loading,
1967
- children: /* @__PURE__ */ jsx(RefreshCwIcon, { className: cn("size-3.5", result.loading && "animate-spin") })
1968
- }
1969
- )
1970
- ]
1971
- }
1972
- ),
1973
- showDegradedTree ? /* @__PURE__ */ jsxs(
1974
- "div",
1975
- {
1976
- role: "status",
1977
- "aria-live": "polite",
1978
- "data-opengeni-files-degraded": true,
1979
- 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",
1980
- children: [
1981
- /* @__PURE__ */ jsx(TriangleAlertIcon, { className: "size-3.5 shrink-0 text-og-status-running", "aria-hidden": true }),
1982
- /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1", children: result.source === "capture" ? t("fileBrowser.liveFilesAreTemporarilyUnavailable") : t("fileBrowser.liveRefreshFailedShowingThe") }),
1983
- /* @__PURE__ */ jsxs(
1984
- "button",
1985
- {
1986
- type: "button",
1987
- onClick: () => void result.refresh(),
1988
- disabled: result.loading,
1989
- 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",
1990
- children: [
1991
- /* @__PURE__ */ jsx(
1992
- RefreshCwIcon,
1993
- {
1994
- className: cn("size-3", result.loading && "animate-spin motion-reduce:animate-none"),
1995
- "aria-hidden": true
1996
- }
1997
- ),
1998
- t("fileBrowser.retry")
1999
- ]
2000
- }
2001
- )
2002
- ]
2003
- }
2004
- ) : null,
2005
- /* @__PURE__ */ jsx(
2006
- "div",
2007
- {
2008
- ref: container.ref,
2009
- onFocus: (event) => {
2010
- if (event.target.id === treeId && cursorIndex < 0) {
2011
- const first = flatRows[0];
2012
- if (first) setActive(first.node.path);
2013
- }
2014
- },
2015
- onKeyDown,
2016
- onDragOver: supportsMutation ? (e) => {
2017
- e.preventDefault();
2018
- e.dataTransfer.dropEffect = "move";
2019
- setDragOver("");
2020
- } : void 0,
2021
- onDrop: supportsMutation ? (e) => {
2022
- e.preventDefault();
2023
- const src = e.dataTransfer.getData("text/og-path");
2024
- void onDropOnto("", src);
2025
- } : void 0,
2026
- className: cn(
2027
- "flex min-h-0 min-w-0 flex-1 flex-col p-1",
2028
- dragOver === "" && "ring-1 ring-inset ring-og-accent"
2029
- ),
2030
- "data-opengeni-file-tree": true,
2031
- children: showErrorEmpty ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-2 p-2 text-og-sm text-og-fg-subtle", children: [
2032
- /* @__PURE__ */ jsx("div", { children: fallback ?? t("fileBrowser.couldNotLoadFilesMessage", {
2033
- message: result.error?.message ?? t("fileBrowser.refreshTheFileListTo")
2034
- }) }),
2035
- /* @__PURE__ */ jsxs(
2036
- "button",
2037
- {
2038
- type: "button",
2039
- onClick: () => void result.refresh(),
2040
- disabled: result.loading,
2041
- 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 disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:min-h-11",
2042
- children: [
2043
- /* @__PURE__ */ jsx(
2044
- RefreshCwIcon,
2045
- {
2046
- className: cn("size-3.5", result.loading && "animate-spin"),
2047
- "aria-hidden": true
2048
- }
2049
- ),
2050
- t("fileBrowser.retry")
2051
- ]
2052
- }
2053
- )
2054
- ] }) : showEmpty ? /* @__PURE__ */ jsx("div", { className: "p-2 text-og-sm text-og-fg-subtle", children: emptyState ?? t("fileBrowser.thisDirectoryIsEmpty") }) : !usesVirtualTree ? /* @__PURE__ */ jsx(
2055
- "div",
2056
- {
2057
- id: treeId,
2058
- role: "tree",
2059
- "aria-label": t("fileBrowser.workspaceFiles"),
2060
- "aria-activedescendant": activeDescendantId,
2061
- "aria-multiselectable": false,
2062
- tabIndex: 0,
2063
- className: "min-h-0 min-w-0 flex-1 overflow-auto outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
2064
- children: renderItems.map((item) => /* @__PURE__ */ jsx("div", { className: "min-w-0", children: renderItem(item) }, itemKey(item)))
2065
- }
2066
- ) : (
2067
- // Virtualized: only the rows in/near the viewport mount, so a 3k-node
2068
- // tree stays responsive. The flat item list already carries the
2069
- // expanded subtree + synthetic (create/skeleton/residue) rows.
2070
- /* @__PURE__ */ jsx(
2071
- VList,
2072
- {
2073
- ref: vlistRef,
2074
- id: treeId,
2075
- role: "tree",
2076
- "aria-label": t("fileBrowser.workspaceFiles"),
2077
- "aria-activedescendant": activeDescendantId,
2078
- "aria-multiselectable": false,
2079
- tabIndex: 0,
2080
- className: "min-h-0 flex-1 outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
2081
- itemSize: coarsePointer ? 44 : 28,
2082
- ssrCount: Math.min(32, renderItems.length),
2083
- children: renderItems.map((item) => /* @__PURE__ */ jsx("div", { className: "min-w-0", children: renderItem(item) }, itemKey(item)))
2084
- }
2085
- )
2086
- )
2087
- }
2088
- ),
2089
- menu && menu.node && /* @__PURE__ */ jsx(
2090
- ContextMenu,
2091
- {
2092
- node: menu.node,
2093
- x: menu.x,
2094
- y: menu.y,
2095
- onRename: () => menu.node && startRename(menu.node),
2096
- onDelete: () => menu.node && void runDelete(menu.node),
2097
- onNewFile: () => startCreate("file"),
2098
- onNewFolder: () => startCreate("dir"),
2099
- onClose: () => {
2100
- setMenu(null);
2101
- window.requestAnimationFrame(() => getTreeElement()?.focus());
2102
- }
2103
- }
2104
- ),
2105
- pendingDelete ? /* @__PURE__ */ jsx(
2106
- DeleteDialog,
2107
- {
2108
- node: pendingDelete,
2109
- busy,
2110
- portalTokenStyle,
2111
- onCancel: () => closePendingDelete(true),
2112
- onConfirm: () => {
2113
- const node = pendingDelete;
2114
- closePendingDelete(false);
2115
- void performDelete(node);
2116
- }
2117
- }
2118
- ) : null
2119
- ] });
2120
- }
2121
- function DeleteDialog({
2122
- node,
2123
- busy,
2124
- portalTokenStyle,
2125
- onCancel,
2126
- onConfirm
2127
- }) {
2128
- const t = useOpenGeniText();
2129
- const portalContainer = usePortalContainer();
2130
- const cancelRef = useRef2(null);
2131
- const [open, setOpen] = useState2(true);
2132
- const closeIntentRef = useRef2("cancel");
2133
- const settledRef = useRef2(false);
2134
- const settleTimerRef = useRef2(null);
2135
- const settle = () => {
2136
- if (settledRef.current) return;
2137
- settledRef.current = true;
2138
- if (closeIntentRef.current === "confirm") {
2139
- onConfirm();
2140
- } else {
2141
- onCancel();
2142
- }
2143
- };
2144
- const scheduleSettle = () => {
2145
- if (settleTimerRef.current !== null) return;
2146
- settleTimerRef.current = setTimeout(() => {
2147
- settleTimerRef.current = null;
2148
- settle();
2149
- }, 0);
2150
- };
2151
- useEffect2(
2152
- () => () => {
2153
- if (settleTimerRef.current !== null) clearTimeout(settleTimerRef.current);
2154
- },
2155
- []
2156
- );
2157
- return /* @__PURE__ */ jsx(
2158
- AlertDialog.Root,
2159
- {
2160
- open,
2161
- onOpenChange: (nextOpen) => {
2162
- if (!nextOpen && !busy) {
2163
- setOpen(false);
2164
- scheduleSettle();
2165
- }
2166
- },
2167
- children: /* @__PURE__ */ jsxs(
2168
- AlertDialog.Portal,
2169
- {
2170
- container: portalContainer ?? (typeof document === "undefined" ? null : document.body),
2171
- children: [
2172
- /* @__PURE__ */ jsx(AlertDialog.Overlay, { className: "og-root fixed inset-0 z-[100] bg-black/45 backdrop-blur-[2px]" }),
2173
- /* @__PURE__ */ jsxs(
2174
- AlertDialog.Content,
2175
- {
2176
- className: "og-root fixed left-1/2 top-1/2 z-[101] max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-sm -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-og-lg border border-og-border-strong bg-og-surface-1 p-4 text-og-fg shadow-2xl outline-hidden",
2177
- style: portalTokenStyle,
2178
- onOpenAutoFocus: (event) => {
2179
- event.preventDefault();
2180
- cancelRef.current?.focus();
2181
- },
2182
- onCloseAutoFocus: (event) => {
2183
- event.preventDefault();
2184
- scheduleSettle();
2185
- },
2186
- onEscapeKeyDown: (event) => {
2187
- event.stopPropagation();
2188
- if (busy) {
2189
- event.preventDefault();
2190
- } else {
2191
- closeIntentRef.current = "cancel";
2192
- }
2193
- },
2194
- children: [
2195
- /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
2196
- /* @__PURE__ */ jsx("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-og-status-failed/12 text-og-status-failed", children: /* @__PURE__ */ jsx(Trash2Icon, { className: "size-4", "aria-hidden": true }) }),
2197
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
2198
- /* @__PURE__ */ jsxs(AlertDialog.Title, { className: "text-og-sm font-semibold", children: [
2199
- t("fileBrowser.delete"),
2200
- " ",
2201
- node.kind === "dir" ? t("fileBrowser.folder") : t("fileBrowser.file"),
2202
- "?"
2203
- ] }),
2204
- /* @__PURE__ */ jsxs(AlertDialog.Description, { className: "mt-1 text-og-sm leading-relaxed text-og-fg-muted", children: [
2205
- /* @__PURE__ */ jsx("span", { className: "break-all font-og-mono text-og-fg", children: node.path }),
2206
- node.kind === "dir" ? " and everything inside it will be permanently removed." : " will be permanently removed."
2207
- ] })
2208
- ] })
2209
- ] }),
2210
- /* @__PURE__ */ jsxs("div", { className: "mt-4 flex justify-end gap-2", children: [
2211
- /* @__PURE__ */ jsx(AlertDialog.Cancel, { asChild: true, children: /* @__PURE__ */ jsx(
2212
- "button",
2213
- {
2214
- ref: cancelRef,
2215
- type: "button",
2216
- onClick: () => {
2217
- closeIntentRef.current = "cancel";
2218
- },
2219
- disabled: busy,
2220
- className: "min-h-9 rounded-og-md border border-og-border px-3 text-og-sm font-medium text-og-fg hover:bg-og-surface-2 disabled:opacity-50 pointer-coarse:min-h-11",
2221
- children: t("fileBrowser.cancel")
2222
- }
2223
- ) }),
2224
- /* @__PURE__ */ jsx(AlertDialog.Action, { asChild: true, children: /* @__PURE__ */ jsx(
2225
- "button",
2226
- {
2227
- type: "button",
2228
- onClick: () => {
2229
- closeIntentRef.current = "confirm";
2230
- },
2231
- disabled: busy,
2232
- className: "min-h-9 rounded-og-md bg-og-danger-fill px-3 text-og-sm font-semibold text-og-danger-fg shadow-sm hover:brightness-110 disabled:opacity-50 pointer-coarse:min-h-11",
2233
- children: t("fileBrowser.deletePermanently")
2234
- }
2235
- ) })
2236
- ] })
2237
- ]
2238
- }
2239
- )
2240
- ]
2241
- }
2242
- )
2243
- }
2244
- );
2245
- }
2246
- function ToolbarButton({
2247
- label,
2248
- onClick,
2249
- disabled,
2250
- pressed,
2251
- children
2252
- }) {
2253
- return /* @__PURE__ */ jsx(
2254
- "button",
2255
- {
2256
- type: "button",
2257
- title: label,
2258
- "aria-label": label,
2259
- "aria-pressed": pressed,
2260
- onClick,
2261
- disabled,
2262
- className: cn(
2263
- "inline-flex size-7 items-center justify-center rounded-og-sm p-1 text-og-fg-muted max-[1023px]:size-11 pointer-coarse:min-h-11 pointer-coarse:min-w-11",
2264
- "hover:bg-og-surface-2 hover:text-og-fg",
2265
- "aria-pressed:bg-og-surface-2 aria-pressed:text-og-fg",
2266
- "disabled:cursor-not-allowed disabled:opacity-40"
2267
- ),
2268
- children
2269
- }
2270
- );
2271
- }
2272
- function InlineInput({
2273
- depth,
2274
- kind,
2275
- initialValue,
2276
- onCommit,
2277
- onCancel
2278
- }) {
2279
- const t = useOpenGeniText();
2280
- const [value, setValue] = useState2(initialValue);
2281
- const ref = useRef2(null);
2282
- const doneRef = useRef2(false);
2283
- useEffect2(() => {
2284
- const el = ref.current;
2285
- if (!el) return;
2286
- el.focus();
2287
- const dot = initialValue.lastIndexOf(".");
2288
- if (initialValue && dot > 0) el.setSelectionRange(0, dot);
2289
- else el.select();
2290
- }, [initialValue]);
2291
- const finish = (commit) => {
2292
- if (doneRef.current) return;
2293
- doneRef.current = true;
2294
- if (commit) onCommit(value);
2295
- else onCancel();
2296
- };
2297
- return /* @__PURE__ */ jsxs(
2298
- "div",
2299
- {
2300
- className: "flex items-center gap-1 px-1 py-0.5",
2301
- style: { paddingLeft: `${depth * 12 + 4}px` },
2302
- children: [
2303
- /* @__PURE__ */ jsx("span", { className: "inline-block w-3 shrink-0" }),
2304
- kind === "dir" ? /* @__PURE__ */ jsx(FolderIcon, { className: "size-3.5 shrink-0" }) : /* @__PURE__ */ jsx(FileIcon, { className: "size-3.5 shrink-0" }),
2305
- /* @__PURE__ */ jsx(
2306
- "input",
2307
- {
2308
- ref,
2309
- value,
2310
- spellCheck: false,
2311
- autoComplete: "off",
2312
- "aria-label": kind === "dir" ? t("fileBrowser.folderName") : t("fileBrowser.fileName"),
2313
- onChange: (e) => setValue(e.target.value),
2314
- onBlur: () => finish(true),
2315
- onKeyDown: (e) => {
2316
- if (e.key === "Enter") {
2317
- e.preventDefault();
2318
- finish(true);
2319
- } else if (e.key === "Escape") {
2320
- e.preventDefault();
2321
- finish(false);
2322
- }
2323
- e.stopPropagation();
2324
- },
2325
- className: cn(
2326
- "min-w-0 flex-1 rounded-og-sm border bg-og-bg px-1 py-0 text-og-sm",
2327
- "border-og-accent text-og-fg",
2328
- "outline-hidden"
2329
- )
2330
- }
2331
- )
2332
- ]
2333
- }
2334
- );
2335
- }
2336
- function ContextMenu({
2337
- node,
2338
- x,
2339
- y,
2340
- onRename,
2341
- onDelete,
2342
- onNewFile,
2343
- onNewFolder,
2344
- onClose
2345
- }) {
2346
- const t = useOpenGeniText();
2347
- const isDir = node.kind === "dir";
2348
- const menuRef = useRef2(null);
2349
- const vw = typeof window !== "undefined" ? window.innerWidth : 9999;
2350
- const vh = typeof window !== "undefined" ? window.innerHeight : 9999;
2351
- const left = Math.max(4, Math.min(x, vw - 180));
2352
- const top = Math.max(4, Math.min(y, vh - 160));
2353
- useEffect2(() => {
2354
- menuRef.current?.querySelector('[role="menuitem"]')?.focus();
2355
- }, []);
2356
- const onKeyDown = (event) => {
2357
- const items = Array.from(
2358
- menuRef.current?.querySelectorAll('[role="menuitem"]') ?? []
2359
- );
2360
- if (items.length === 0) return;
2361
- const current = items.findIndex((item2) => item2 === document.activeElement);
2362
- let next = null;
2363
- if (event.key === "ArrowDown") next = (current + 1 + items.length) % items.length;
2364
- else if (event.key === "ArrowUp") next = (current - 1 + items.length) % items.length;
2365
- else if (event.key === "Home") next = 0;
2366
- else if (event.key === "End") next = items.length - 1;
2367
- else if (event.key === "Escape") {
2368
- event.preventDefault();
2369
- event.stopPropagation();
2370
- onClose();
2371
- return;
2372
- }
2373
- if (next === null) return;
2374
- event.preventDefault();
2375
- event.stopPropagation();
2376
- items[next]?.focus();
2377
- };
2378
- const item = (label, icon, onClick, danger) => /* @__PURE__ */ jsxs(
2379
- "button",
2380
- {
2381
- type: "button",
2382
- role: "menuitem",
2383
- onClick: (e) => {
2384
- e.stopPropagation();
2385
- onClick();
2386
- },
2387
- className: cn(
2388
- MENU_BUTTON_CLASS,
2389
- danger && "text-og-status-failed [&_svg]:text-og-status-failed!"
2390
- ),
2391
- children: [
2392
- icon,
2393
- label
2394
- ]
2395
- }
2396
- );
2397
- return /* @__PURE__ */ jsxs(
2398
- "div",
2399
- {
2400
- ref: menuRef,
2401
- role: "menu",
2402
- "aria-label": t("fileBrowser.actionsForName", { name: node.name }),
2403
- onKeyDown,
2404
- onClick: (e) => e.stopPropagation(),
2405
- style: { left, top },
2406
- className: cn(MENU_SURFACE_CLASS, "fixed z-50 min-w-[180px] overflow-hidden"),
2407
- children: [
2408
- isDir && /* @__PURE__ */ jsxs(Fragment, { children: [
2409
- item(t("fileBrowser.newFile"), /* @__PURE__ */ jsx(FilePlusIcon, {}), onNewFile),
2410
- item(t("fileBrowser.newFolder"), /* @__PURE__ */ jsx(FolderPlusIcon, {}), onNewFolder),
2411
- /* @__PURE__ */ jsx("div", { role: "separator", className: MENU_SEPARATOR_CLASS })
2412
- ] }),
2413
- item(t("fileBrowser.rename"), /* @__PURE__ */ jsx(PencilIcon, {}), onRename),
2414
- item("Delete", /* @__PURE__ */ jsx(Trash2Icon, {}), onDelete, true)
2415
- ]
2416
- }
2417
- );
2418
- }
2419
-
2420
- // src/components/sandbox-files.tsx
2421
- import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
2422
- function SandboxFiles({
2423
- files,
2424
- git,
2425
- fileSystemAvailable = true,
2426
- usePierre = true,
2427
- editable = true,
2428
- onEditIntent,
2429
- initialSelectedPath,
2430
- onSelectedPathChange,
2431
- isNodeVisible,
2432
- hideToolFolders = true,
2433
- requestedPath,
2434
- requestedLine,
2435
- requestedPathRequestId,
2436
- requestedPathReady = true,
2437
- workspaceResting = false,
2438
- workspaceWaking = false,
2439
- liveWorkspaceReady = true,
2440
- workspaceError = null,
2441
- onWakeWorkspace,
2442
- themeType,
2443
- className
2444
- }) {
2445
- const t = useOpenGeniText();
2446
- const [selected, setSelected] = useState3(() => initialSelectedPath ?? null);
2447
- const [editMode, setEditMode] = useState3(false);
2448
- const [focusLine, setFocusLine] = useState3(null);
2449
- const [treeRevealRequest, setTreeRevealRequest] = useState3(null);
2450
- const [liveRequestedPath, setLiveRequestedPath] = useState3(null);
2451
- const [viewReloadRevision, setViewReloadRevision] = useState3(0);
2452
- const viewerScrollRef = useRef3(null);
2453
- const pendingRequestRef = useRef3(null);
2454
- const handledRequestRef = useRef3(null);
2455
- const requestKey = requestedPath ? requestedPathRequestId ?? requestedPath : null;
2456
- const [showHiddenChoice, setShowHiddenChoice] = useShowHiddenFiles();
2457
- const [revealHidden, setRevealHidden] = useState3(false);
2458
- const showHidden = !hideToolFolders || showHiddenChoice || revealHidden;
2459
- const setShowHidden = useCallback3(
2460
- (show) => {
2461
- setRevealHidden(false);
2462
- setShowHiddenChoice(show);
2463
- },
2464
- [setShowHiddenChoice]
2465
- );
2466
- const rootIsRepository = useMemo3(() => treeRootIsRepository(files.tree), [files.tree]);
2467
- const treeNodeVisible = useCallback3(
2468
- (node, context) => (isNodeVisible ? isNodeVisible(node, context) : true) && (showHidden || !isHiddenByDefault(node, context, rootIsRepository)),
2469
- [isNodeVisible, rootIsRepository, showHidden]
2470
- );
2471
- const visibleByDefault = useCallback3(
2472
- (node, context) => !isHiddenByDefault(node, context, rootIsRepository),
2473
- [rootIsRepository]
2474
- );
2475
- const onlyHiddenEntries = useMemo3(() => {
2476
- if (showHidden) return false;
2477
- const top = { depth: 0, parent: null };
2478
- return !files.tree.some((node) => treeNodeVisible(node, top)) && files.tree.some((node) => isNodeVisible ? isNodeVisible(node, top) : true);
2479
- }, [files.tree, isNodeVisible, showHidden, treeNodeVisible]);
2480
- useEffect3(() => {
2481
- if (!requestedPath || requestKey === null) {
2482
- pendingRequestRef.current = null;
2483
- handledRequestRef.current = null;
2484
- setTreeRevealRequest(null);
2485
- return;
2486
- }
2487
- if (handledRequestRef.current === requestKey) {
2488
- return;
2489
- }
2490
- if (!requestedPathReady) {
2491
- pendingRequestRef.current = requestKey;
2492
- setTreeRevealRequest(null);
2493
- return;
2494
- }
2495
- if ((isNodeVisible || hideToolFolders) && files.loading && files.tree.length === 0) return;
2496
- if (isNodeVisible && !files.loading && files.tree.length === 0) {
2497
- handledRequestRef.current = requestKey;
2498
- pendingRequestRef.current = null;
2499
- setTreeRevealRequest(null);
2500
- return;
2501
- }
2502
- if (filePathVisibility(files.tree, requestedPath, isNodeVisible) === "hidden") {
2503
- handledRequestRef.current = requestKey;
2504
- pendingRequestRef.current = null;
2505
- setTreeRevealRequest(null);
2506
- return;
2507
- }
2508
- if (!showHidden) {
2509
- const visibility = filePathVisibility(files.tree, requestedPath, visibleByDefault);
2510
- if (visibility === "hidden" || visibility === "unknown" && pathMayBeHiddenByDefault(requestedPath)) {
2511
- setRevealHidden(true);
2512
- }
2513
- }
2514
- handledRequestRef.current = requestKey;
2515
- pendingRequestRef.current = null;
2516
- setSelected(requestedPath);
2517
- onSelectedPathChange?.(requestedPath);
2518
- setEditMode(false);
2519
- setFocusLine(requestedLine != null && requestedLine > 0 ? requestedLine : null);
2520
- setTreeRevealRequest({ path: requestedPath, requestId: requestKey });
2521
- setViewReloadRevision((revision) => revision + 1);
2522
- }, [
2523
- files.loading,
2524
- files.tree,
2525
- hideToolFolders,
2526
- visibleByDefault,
2527
- isNodeVisible,
2528
- onSelectedPathChange,
2529
- requestKey,
2530
- requestedLine,
2531
- requestedPath,
2532
- requestedPathReady,
2533
- showHidden
2534
- ]);
2535
- const rootRef = useRef3(null);
2536
- const [wide, setWide] = useState3(false);
2537
- useEffect3(() => {
2538
- const el = rootRef.current;
2539
- if (!el) return;
2540
- const update = () => setWide(el.getBoundingClientRect().width >= 720);
2541
- update();
2542
- if (typeof ResizeObserver === "undefined") return;
2543
- const observer = new ResizeObserver(update);
2544
- observer.observe(el);
2545
- const surface = el.closest("[data-workspace-surface]");
2546
- const surfaceObserver = surface && typeof MutationObserver !== "undefined" ? new MutationObserver(update) : null;
2547
- surfaceObserver?.observe(surface, {
2548
- attributes: true,
2549
- attributeFilter: ["class", "style"]
2550
- });
2551
- return () => {
2552
- observer.disconnect();
2553
- surfaceObserver?.disconnect();
2554
- };
2555
- }, []);
2556
- const resolvedTheme = useThemeType(themeType);
2557
- const selectedVisibility = selected ? filePathVisibility(files.tree, selected, isNodeVisible) : "unknown";
2558
- const visibilityPending = Boolean(isNodeVisible && files.loading && files.tree.length === 0);
2559
- const viewPath = selectedVisibility === "hidden" || visibilityPending ? null : selected;
2560
- useEffect3(() => {
2561
- if (selected === null || selectedVisibility !== "hidden") return;
2562
- setSelected(null);
2563
- onSelectedPathChange?.(null);
2564
- setEditMode(false);
2565
- setFocusLine(null);
2566
- setTreeRevealRequest(null);
2567
- setLiveRequestedPath(null);
2568
- }, [onSelectedPathChange, selected, selectedVisibility]);
2569
- const fileView = useFileView(
2570
- viewPath,
2571
- files.readFile,
2572
- `${files.contentRevision ?? 0}:${viewReloadRevision}`
2573
- );
2574
- useEffect3(() => {
2575
- if (focusLine === null && viewReloadRevision > 0 && viewerScrollRef.current) {
2576
- viewerScrollRef.current.scrollTop = 0;
2577
- }
2578
- }, [focusLine, viewReloadRevision]);
2579
- const selectFile = useCallback3(
2580
- (path) => {
2581
- if (pendingRequestRef.current !== null) {
2582
- handledRequestRef.current = pendingRequestRef.current;
2583
- pendingRequestRef.current = null;
2584
- }
2585
- setSelected(path);
2586
- onSelectedPathChange?.(path);
2587
- setEditMode(false);
2588
- setFocusLine(null);
2589
- setTreeRevealRequest(null);
2590
- setLiveRequestedPath(null);
2591
- setViewReloadRevision(0);
2592
- },
2593
- [onSelectedPathChange]
2594
- );
2595
- const canEdit = editable && viewPath !== null && !fileView.loading && fileView.error === null && !fileView.isBinary && !fileView.truncated && fileView.content !== null;
2596
- const showEditor = canEdit && editMode;
2597
- const captureFileUnavailable = fileView.error instanceof CapturedFileUnavailableError ? fileView.error : null;
2598
- const waitingForSelectedFile = !workspaceError && liveRequestedPath === viewPath && (!liveWorkspaceReady || files.loading) && captureFileUnavailable !== null;
2599
- if (workspaceError && !liveWorkspaceReady && files.source !== "capture") {
2600
- return /* @__PURE__ */ jsxs2(
2601
- Notice,
2602
- {
2603
- className,
2604
- title: t("sandboxFiles.couldNotOpenLiveWorkspace"),
2605
- announce: "alert",
2606
- children: [
2607
- /* @__PURE__ */ jsx2("p", { children: workspaceError.message }),
2608
- onWakeWorkspace ? /* @__PURE__ */ jsx2(WakeButton, { onClick: onWakeWorkspace, children: t("sandboxFiles.retryLiveWorkspace") }) : null
2609
- ]
2610
- }
2611
- );
2612
- }
2613
- if (workspaceResting || workspaceWaking) {
2614
- return /* @__PURE__ */ jsx2("div", { className: cn("h-full", className), "data-opengeni-workspace-resting": true, children: /* @__PURE__ */ jsxs2(
2615
- Notice,
2616
- {
2617
- icon: workspaceWaking ? /* @__PURE__ */ jsx2(
2618
- LoaderCircleIcon,
2619
- {
2620
- className: "size-5 animate-spin motion-reduce:animate-none",
2621
- "aria-hidden": true
2622
- }
2623
- ) : /* @__PURE__ */ jsx2(FileCode2Icon, { className: "size-5", "aria-hidden": true }),
2624
- title: workspaceWaking ? t("sandboxFiles.wakingWorkspace") : t("sandboxFiles.workspaceIsResting"),
2625
- announce: "status",
2626
- children: [
2627
- /* @__PURE__ */ jsx2("p", { children: workspaceWaking ? t("sandboxFiles.connectingToTheLiveFile") : t("sandboxFiles.noCapturedRevisionIsAvailable") }),
2628
- !workspaceWaking && onWakeWorkspace ? /* @__PURE__ */ jsx2(WakeButton, { onClick: onWakeWorkspace, children: t("sandboxFiles.openLiveWorkspace") }) : null
2629
- ]
2630
- }
2631
- ) });
2632
- }
2633
- if (!fileSystemAvailable) {
2634
- return /* @__PURE__ */ jsx2(
2635
- Notice,
2636
- {
2637
- className,
2638
- icon: /* @__PURE__ */ jsx2(FileWarningIcon, { className: "size-5", "aria-hidden": true }),
2639
- title: t("sandboxFiles.filesUnavailable"),
2640
- announce: "alert",
2641
- children: t("sandboxFiles.thisSandboxDoesNotExpose")
2642
- }
2643
- );
2644
- }
2645
- return /* @__PURE__ */ jsxs2("div", { ref: rootRef, className: cn("flex h-full min-h-0 min-w-0 flex-col", className), children: [
2646
- /* @__PURE__ */ jsx2(
2647
- GitHeader,
2648
- {
2649
- loading: Boolean(files.loading || files.gitLoading || files.source === null || git?.loading) && files.gitSummary === null,
2650
- git: files.gitSummary ?? {
2651
- branch: git?.branch ?? null,
2652
- isRepo: git?.isRepo ?? false,
2653
- repoCount: git?.repoCount ?? 0,
2654
- ahead: git?.ahead ?? 0,
2655
- behind: git?.behind ?? 0,
2656
- dirtyCount: git?.diff.length ?? 0
2657
- }
2658
- }
2659
- ),
2660
- /* @__PURE__ */ jsxs2(
2661
- Group,
2662
- {
2663
- orientation: wide ? "horizontal" : "vertical",
2664
- className: cn("min-h-0 flex-1", wide ? "flex-row" : "flex-col"),
2665
- children: [
2666
- /* @__PURE__ */ jsx2(
2667
- Panel,
2668
- {
2669
- id: "sandbox-files-tree",
2670
- defaultSize: wide ? "280px" : "40%",
2671
- minSize: wide ? "180px" : "120px",
2672
- maxSize: wide ? "60%" : "70%",
2673
- className: "flex min-h-0 min-w-0 flex-col",
2674
- children: /* @__PURE__ */ jsx2(
2675
- FileBrowser,
2676
- {
2677
- result: files,
2678
- isNodeVisible: treeNodeVisible,
2679
- showHidden,
2680
- ...hideToolFolders ? { onShowHiddenChange: setShowHidden } : {},
2681
- selectedPath: selected ?? void 0,
2682
- ...treeRevealRequest ? {
2683
- revealPath: treeRevealRequest.path,
2684
- revealPathRequestId: treeRevealRequest.requestId
2685
- } : {},
2686
- onSelectFile: selectFile,
2687
- editable,
2688
- emptyState: onlyHiddenEntries ? /* @__PURE__ */ jsxs2("span", { children: [
2689
- t("sandboxFiles.onlyHiddenFilesHere"),
2690
- " ",
2691
- /* @__PURE__ */ jsx2(
2692
- "button",
2693
- {
2694
- type: "button",
2695
- className: "font-medium text-og-fg underline underline-offset-2 hover:text-og-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent",
2696
- onClick: () => setShowHidden(true),
2697
- children: t("fileBrowser.showHiddenFiles")
2698
- }
2699
- )
2700
- ] }) : t("sandboxFiles.thisDirectoryIsEmpty"),
2701
- className: "min-w-0 flex-1"
2702
- }
2703
- )
2704
- }
2705
- ),
2706
- /* @__PURE__ */ jsx2(
2707
- Separator,
2708
- {
2709
- "aria-label": t("sandboxFiles.resizeFileTree"),
2710
- className: cn(
2711
- "group relative z-10 shrink-0 cursor-col-resize outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
2712
- "w-px bg-og-border after:absolute after:inset-y-0 after:left-1/2 after:w-3 after:-translate-x-1/2",
2713
- "hover:bg-og-accent focus-visible:bg-og-accent data-[separator-state=dragging]:bg-og-accent",
2714
- !wide && "h-px w-full cursor-row-resize after:inset-x-0 after:inset-y-auto after:top-1/2 after:h-3 after:w-full after:-translate-x-0 after:-translate-y-1/2"
2715
- )
2716
- }
2717
- ),
2718
- /* @__PURE__ */ jsxs2(
2719
- Panel,
2720
- {
2721
- id: "sandbox-files-viewer",
2722
- minSize: wide ? "240px" : "160px",
2723
- className: cn("flex min-h-0 min-w-0 flex-col", !wide && "border-t border-og-border"),
2724
- children: [
2725
- /* @__PURE__ */ jsxs2("div", { className: "flex shrink-0 items-center justify-between gap-2 border-b border-og-border bg-og-surface-1 px-2 py-1", children: [
2726
- /* @__PURE__ */ jsx2(
2727
- "span",
2728
- {
2729
- "data-opengeni-selected-file": true,
2730
- className: "min-w-0 truncate font-og-mono text-og-xs text-og-fg-muted",
2731
- children: selected ? focusLine !== null ? `${selected}:${focusLine}` : selected : t("sandboxFiles.noFileSelected")
2732
- }
2733
- ),
2734
- canEdit && /* @__PURE__ */ jsx2(
2735
- Segmented,
2736
- {
2737
- options: [
2738
- { value: "view", label: t("sandboxFiles.view") },
2739
- { value: "edit", label: t("sandboxFiles.edit") }
2740
- ],
2741
- value: editMode ? "edit" : "view",
2742
- onChange: (v) => setEditMode(v === "edit")
2743
- }
2744
- )
2745
- ] }),
2746
- /* @__PURE__ */ jsx2(
2747
- "div",
2748
- {
2749
- ref: viewerScrollRef,
2750
- className: "min-h-0 flex-1 overflow-auto",
2751
- "data-opengeni-file-viewer-scroll": true,
2752
- children: viewPath ? showEditor && fileView.content !== null ? /* @__PURE__ */ jsx2(
2753
- CodeEditor,
2754
- {
2755
- path: viewPath,
2756
- initialContents: fileView.content,
2757
- themeType: resolvedTheme,
2758
- onSave: (contents, expectedContents) => files.writeFile(viewPath, contents, { expectedContent: expectedContents }),
2759
- onOverwrite: (contents) => files.writeFile(viewPath, contents, { force: true }),
2760
- onReload: () => setViewReloadRevision((revision) => revision + 1),
2761
- ...onEditIntent ? { onEditIntent } : {},
2762
- className: "h-full"
2763
- },
2764
- viewPath
2765
- ) : workspaceError && (liveRequestedPath === viewPath || requestedPath === viewPath) && !liveWorkspaceReady ? /* @__PURE__ */ jsxs2(Notice, { title: t("sandboxFiles.couldNotOpenLiveFile"), announce: "alert", children: [
2766
- /* @__PURE__ */ jsx2("p", { children: workspaceError.message }),
2767
- onWakeWorkspace ? /* @__PURE__ */ jsx2(WakeButton, { onClick: onWakeWorkspace, children: t("sandboxFiles.retryLiveFile") }) : null
2768
- ] }) : waitingForSelectedFile ? /* @__PURE__ */ jsx2(
2769
- Notice,
2770
- {
2771
- icon: /* @__PURE__ */ jsx2(
2772
- LoaderCircleIcon,
2773
- {
2774
- className: "size-5 animate-spin motion-reduce:animate-none",
2775
- "aria-hidden": true
2776
- }
2777
- ),
2778
- title: t("sandboxFiles.wakingWorkspace"),
2779
- announce: "status",
2780
- children: t("sandboxFiles.openingViewpathWhenTheLive", { viewPath })
2781
- }
2782
- ) : captureFileUnavailable ? /* @__PURE__ */ jsxs2(
2783
- Notice,
2784
- {
2785
- icon: /* @__PURE__ */ jsx2(FileCode2Icon, { className: "size-5", "aria-hidden": true }),
2786
- title: t("sandboxFiles.onMachine"),
2787
- children: [
2788
- /* @__PURE__ */ jsx2("p", { children: captureFileUnavailable.reason === "too-large" ? t("sandboxFiles.thisFileIsLargerThan") : captureFileUnavailable.reason === "content-missing" ? t("sandboxFiles.theCapturedCopyIsNo") : t("sandboxFiles.thisFileWasIndexedBut") }),
2789
- onWakeWorkspace ? /* @__PURE__ */ jsx2(
2790
- WakeButton,
2791
- {
2792
- onClick: () => {
2793
- setLiveRequestedPath(viewPath);
2794
- if (liveWorkspaceReady) void files.refresh();
2795
- else onWakeWorkspace();
2796
- },
2797
- children: liveWorkspaceReady ? t("sandboxFiles.retryLiveFile") : t("sandboxFiles.openLiveFile")
2798
- }
2799
- ) : null
2800
- ]
2801
- }
2802
- ) : fileView.error ? /* @__PURE__ */ jsx2(Notice, { announce: "alert", children: t("sandboxFiles.couldNotOpenViewpathMessage", {
2803
- viewPath,
2804
- message: fileView.error.message
2805
- }) }) : fileView.loading ? /* @__PURE__ */ jsx2(Notice, { announce: "status", children: t("sandboxFiles.loadingViewpath", { viewPath }) }) : fileView.imageUrl ? /* @__PURE__ */ jsx2(
2806
- RasterFilePreview,
2807
- {
2808
- src: fileView.imageUrl,
2809
- path: viewPath
2810
- },
2811
- fileView.imageUrl
2812
- ) : fileView.isBinary ? /* @__PURE__ */ jsxs2(Notice, { children: [
2813
- t("sandboxFiles.viewpathIsABinaryFile", { viewPath }),
2814
- fileView.sizeBytes ?? 0,
2815
- " ",
2816
- t("sandboxFiles.bytes")
2817
- ] }) : fileView.content !== null ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
2818
- fileView.truncated && /* @__PURE__ */ jsxs2("div", { className: "border-b border-og-border bg-og-surface-1 px-2 py-1 text-og-xs text-og-status-running", children: [
2819
- t("sandboxFiles.largeFileShowingATruncated"),
2820
- fileView.sizeBytes ?? 0,
2821
- " ",
2822
- t("sandboxFiles.bytesLoadedEditingIsDisabled")
2823
- ] }),
2824
- usePierre && focusLine === null ? /* @__PURE__ */ jsx2(
2825
- PierreFile,
2826
- {
2827
- path: viewPath,
2828
- contents: fileView.content,
2829
- themeType: resolvedTheme,
2830
- fallback: /* @__PURE__ */ jsx2("pre", { className: "overflow-auto whitespace-pre p-2 font-og-mono text-og-sm text-og-fg", children: fileView.content }),
2831
- className: "p-1"
2832
- },
2833
- `${viewPath}:${viewReloadRevision}`
2834
- ) : focusLine !== null ? /* @__PURE__ */ jsx2(
2835
- LineNumberedFile,
2836
- {
2837
- path: viewPath,
2838
- contents: fileView.content,
2839
- focusLine
2840
- }
2841
- ) : /* @__PURE__ */ jsx2("pre", { className: "overflow-auto whitespace-pre p-2 font-og-mono text-og-sm text-og-fg", children: fileView.content })
2842
- ] }) : /* @__PURE__ */ jsx2(Notice, { announce: "status", children: t("sandboxFiles.loadingViewpath", { viewPath }) }) : (
2843
- // Nothing selected — the tree shows the whole workspace; pick a file.
2844
- requestedPath && !requestedPathReady ? workspaceError ? /* @__PURE__ */ jsxs2(Notice, { title: t("sandboxFiles.couldNotOpenLiveFile"), announce: "alert", children: [
2845
- /* @__PURE__ */ jsx2("p", { children: workspaceError.message }),
2846
- onWakeWorkspace ? /* @__PURE__ */ jsx2(WakeButton, { onClick: onWakeWorkspace, children: t("sandboxFiles.retryLiveFile") }) : null
2847
- ] }) : /* @__PURE__ */ jsx2(
2848
- Notice,
2849
- {
2850
- icon: /* @__PURE__ */ jsx2(
2851
- LoaderCircleIcon,
2852
- {
2853
- className: "size-5 animate-spin motion-reduce:animate-none",
2854
- "aria-hidden": true
2855
- }
2856
- ),
2857
- title: t("sandboxFiles.wakingSandbox"),
2858
- announce: "status",
2859
- children: t("sandboxFiles.openingRequestedpathWhenTheLive", { requestedPath })
2860
- }
2861
- ) : /* @__PURE__ */ jsx2(
2862
- Notice,
2863
- {
2864
- icon: /* @__PURE__ */ jsx2(FileCode2Icon, { className: "size-5", "aria-hidden": true }),
2865
- title: t("sandboxFiles.chooseAFile"),
2866
- children: t("sandboxFiles.selectAFileInThe")
2867
- }
2868
- )
2869
- )
2870
- }
2871
- )
2872
- ]
2873
- }
2874
- )
2875
- ]
2876
- }
2877
- )
2878
- ] });
2879
- }
2880
- function WakeButton({ children, onClick }) {
2881
- return /* @__PURE__ */ jsx2(
2882
- "button",
2883
- {
2884
- type: "button",
2885
- onClick,
2886
- className: "mt-1 inline-flex min-h-11 items-center justify-center rounded-og-md border border-og-primary-border bg-og-primary text-og-primary-fg px-3 py-2 text-og-sm font-medium transition-colors hover:bg-og-primary-hover focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent focus-visible:ring-offset-2 focus-visible:ring-offset-og-bg",
2887
- children
2888
- }
2889
- );
2890
- }
2891
- function LineNumberedFile({
2892
- path,
2893
- contents,
2894
- focusLine
2895
- }) {
2896
- const t = useOpenGeniText();
2897
- const lines = contents.split("\n");
2898
- const inRange = focusLine >= 1 && focusLine <= lines.length;
2899
- const targetRef = useRef3(null);
2900
- useEffect3(() => {
2901
- targetRef.current?.scrollIntoView({
2902
- block: "center",
2903
- behavior: prefersReducedMotion() ? "auto" : "smooth"
2904
- });
2905
- }, [path, focusLine, contents]);
2906
- return /* @__PURE__ */ jsxs2(
2907
- "div",
2908
- {
2909
- className: "h-full min-h-0 overflow-auto font-og-mono text-og-sm text-og-fg",
2910
- role: "region",
2911
- "aria-label": inRange ? t("sandboxFiles.pathAtLineFocusline", { path, focusLine }) : path,
2912
- children: [
2913
- !inRange ? /* @__PURE__ */ jsx2(
2914
- "p",
2915
- {
2916
- className: "border-b border-og-border bg-og-surface-1 px-2 py-1 text-og-xs text-og-fg-muted",
2917
- role: "status",
2918
- children: t("sandboxFiles.lineFocuslineIsPastThe", { focusLine })
2919
- }
2920
- ) : null,
2921
- /* @__PURE__ */ jsx2("div", { children: lines.map((text, index) => {
2922
- const lineNumber = index + 1;
2923
- const focused = inRange && lineNumber === focusLine;
2924
- return /* @__PURE__ */ jsxs2(
2925
- "div",
2926
- {
2927
- ref: focused ? targetRef : void 0,
2928
- "data-opengeni-file-line": lineNumber,
2929
- ...focused ? { "data-opengeni-focus-line": "" } : {},
2930
- "aria-current": focused ? "location" : void 0,
2931
- className: cn("flex gap-3 px-2 py-0.5 leading-6", focused && "bg-og-accent-soft"),
2932
- children: [
2933
- /* @__PURE__ */ jsx2("span", { className: "w-11 shrink-0 select-none text-right tabular-nums text-og-fg-subtle", children: lineNumber }),
2934
- /* @__PURE__ */ jsx2("pre", { className: "min-w-0 flex-1 whitespace-pre-wrap break-words", children: text || " " })
2935
- ]
2936
- },
2937
- lineNumber
2938
- );
2939
- }) })
2940
- ]
2941
- }
2942
- );
2943
- }
2944
- function GitHeader({ git, loading }) {
2945
- const t = useOpenGeniText();
2946
- if (loading) {
2947
- return /* @__PURE__ */ jsxs2(
2948
- "div",
2949
- {
2950
- className: "flex shrink-0 items-center gap-2 border-b border-og-border bg-og-surface-1 px-2 py-1 text-og-sm text-og-fg-muted",
2951
- role: "status",
2952
- "aria-live": "polite",
2953
- children: [
2954
- /* @__PURE__ */ jsx2(
2955
- LoaderCircleIcon,
2956
- {
2957
- className: "size-3.5 shrink-0 animate-spin motion-reduce:animate-none",
2958
- "aria-hidden": true
2959
- }
2960
- ),
2961
- /* @__PURE__ */ jsx2("span", { children: t("sandboxFiles.loadingRepository") })
2962
- ]
2963
- }
2964
- );
2965
- }
2966
- const dirty = git.dirtyCount > 0;
2967
- return /* @__PURE__ */ jsxs2("div", { className: "flex shrink-0 items-center gap-2 border-b border-og-border bg-og-surface-1 px-2 py-1 text-og-sm", children: [
2968
- /* @__PURE__ */ jsx2(
2969
- "span",
2970
- {
2971
- "aria-hidden": "true",
2972
- className: cn(
2973
- "size-2 shrink-0 rounded-full",
2974
- dirty ? "bg-og-status-running" : "bg-og-status-idle"
2975
- )
2976
- }
2977
- ),
2978
- /* @__PURE__ */ jsx2("span", { className: "sr-only", children: dirty ? t("sandboxFiles.uncommittedChangesInDirtycountFiles", { dirtyCount: git.dirtyCount }) : t("sandboxFiles.noUncommittedChanges") }),
2979
- /* @__PURE__ */ jsx2("span", { className: "truncate font-og-mono text-og-fg", children: git.repoCount > 1 ? t("sandboxFiles.repocountRepositories", { repoCount: git.repoCount }) : git.branch ?? (git.isRepo ? t("sandboxFiles.detached") : t("sandboxFiles.noRepo")) }),
2980
- (git.ahead > 0 || git.behind > 0) && /* @__PURE__ */ jsxs2("span", { className: "flex shrink-0 items-center gap-1.5 text-og-xs text-og-fg-subtle", children: [
2981
- git.ahead > 0 && /* @__PURE__ */ jsxs2("span", { "data-contrast-audited": true, children: [
2982
- "\u2191",
2983
- git.ahead
2984
- ] }),
2985
- git.behind > 0 && /* @__PURE__ */ jsxs2("span", { "data-contrast-audited": true, children: [
2986
- "\u2193",
2987
- git.behind
2988
- ] })
2989
- ] }),
2990
- dirty && /* @__PURE__ */ jsx2(
2991
- "span",
2992
- {
2993
- "aria-hidden": "true",
2994
- "data-contrast-audited": true,
2995
- className: "ml-auto shrink-0 text-og-xs text-og-fg-subtle",
2996
- children: t("sandboxFiles.dirtycountChanged", { dirtyCount: git.dirtyCount })
2997
- }
2998
- )
2999
- ] });
3000
- }
3001
- function Segmented({
3002
- options,
3003
- value,
3004
- onChange
3005
- }) {
3006
- return /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap items-center rounded-og-sm border border-og-border p-0.5", children: options.map((opt) => /* @__PURE__ */ jsx2(
3007
- "button",
3008
- {
3009
- type: "button",
3010
- onClick: () => onChange(opt.value),
3011
- className: cn(
3012
- "min-h-7 rounded-og-xs px-1.5 py-0.5 text-og-xs focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent max-[1023px]:min-h-11 max-[1023px]:min-w-11 pointer-coarse:min-h-11 pointer-coarse:min-w-11",
3013
- opt.value === value ? "bg-og-accent-soft text-og-fg" : "text-og-fg-subtle hover:text-og-fg"
3014
- ),
3015
- children: opt.label
3016
- },
3017
- opt.value
3018
- )) });
3019
- }
3020
- function useFileView(path, readFile, reloadRevision = 0) {
3021
- const previousPathRef = useRef3(null);
3022
- const [state, setState] = useState3({
3023
- content: null,
3024
- isBinary: false,
3025
- truncated: false,
3026
- sizeBytes: null,
3027
- loading: false,
3028
- error: null
3029
- });
3030
- useEffect3(() => {
3031
- if (!path) {
3032
- previousPathRef.current = null;
3033
- setState({
3034
- content: null,
3035
- isBinary: false,
3036
- truncated: false,
3037
- sizeBytes: null,
3038
- loading: false,
3039
- error: null
3040
- });
3041
- return;
3042
- }
3043
- const pathChanged = previousPathRef.current !== path;
3044
- previousPathRef.current = path;
3045
- let cancelled = false;
3046
- const abort = new AbortController();
3047
- if (pathChanged) {
3048
- setState({
3049
- content: null,
3050
- isBinary: false,
3051
- truncated: false,
3052
- sizeBytes: null,
3053
- loading: true,
3054
- error: null
3055
- });
3056
- } else {
3057
- setState((previous) => ({ ...previous, error: null }));
3058
- }
3059
- void readFile(path, { signal: abort.signal }).then((res) => {
3060
- if (cancelled) return;
3061
- const content = res.isBinary ? null : res.encoding === "base64" ? decodeBase64Utf8(res.content) : res.content;
3062
- setState({
3063
- content,
3064
- imageUrl: !res.truncated && res.encoding === "base64" ? rasterImageUrl(path, res.content) : null,
3065
- isBinary: res.isBinary,
3066
- truncated: res.truncated,
3067
- sizeBytes: res.sizeBytes,
3068
- loading: false,
3069
- error: null
3070
- });
3071
- }).catch((cause) => {
3072
- if (cancelled) return;
3073
- const error = cause instanceof Error ? cause : new Error(String(cause));
3074
- setState(
3075
- (previous) => pathChanged ? {
3076
- content: null,
3077
- isBinary: false,
3078
- truncated: false,
3079
- sizeBytes: null,
3080
- loading: false,
3081
- error
3082
- } : { ...previous, loading: false, error }
3083
- );
3084
- });
3085
- return () => {
3086
- cancelled = true;
3087
- abort.abort();
3088
- };
3089
- }, [path, readFile, reloadRevision]);
3090
- return state;
3091
- }
3092
- function rasterImageUrl(path, content) {
3093
- const extension = path.split(".").pop()?.toLowerCase();
3094
- const mime = extension === "png" ? "image/png" : extension === "jpg" || extension === "jpeg" ? "image/jpeg" : extension === "gif" ? "image/gif" : extension === "webp" ? "image/webp" : null;
3095
- return mime ? `data:${mime};base64,${content}` : null;
3096
- }
3097
- function RasterFilePreview({ src, path }) {
3098
- const t = useOpenGeniText();
3099
- const [failed, setFailed] = useState3(false);
3100
- return failed ? /* @__PURE__ */ jsx2(Notice, { title: t("sandboxFiles.imagePreviewUnavailable"), announce: "alert", children: t("sandboxFiles.couldNotDecodePathAs", { path }) }) : /* @__PURE__ */ jsx2(
3101
- "img",
3102
- {
3103
- src,
3104
- alt: path,
3105
- onError: () => setFailed(true),
3106
- className: "max-w-full object-contain"
3107
- }
3108
- );
3109
- }
3110
- function decodeBase64Utf8(b64) {
3111
- try {
3112
- if (typeof atob === "function") {
3113
- const binary = atob(b64);
3114
- const bytes = new Uint8Array(binary.length);
3115
- for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
3116
- return new TextDecoder().decode(bytes);
3117
- }
3118
- } catch {
3119
- }
3120
- return b64;
3121
- }
3122
- function Notice({
3123
- children,
3124
- className,
3125
- icon,
3126
- title,
3127
- announce
3128
- }) {
3129
- return /* @__PURE__ */ jsx2(
3130
- "div",
3131
- {
3132
- role: announce,
3133
- "aria-atomic": announce ? "true" : void 0,
3134
- "aria-live": announce === "alert" ? "assertive" : announce === "status" ? "polite" : void 0,
3135
- className: cn(
3136
- "flex h-full items-center justify-center p-4 text-center text-og-sm text-og-fg-subtle",
3137
- className
3138
- ),
3139
- children: /* @__PURE__ */ jsxs2("div", { className: "flex max-w-sm flex-col items-center gap-2.5", children: [
3140
- icon ? /* @__PURE__ */ jsx2("span", { className: "grid size-10 place-items-center rounded-og-lg border border-og-border bg-og-surface-1 text-og-fg-muted shadow-sm", children: icon }) : null,
3141
- title ? /* @__PURE__ */ jsx2("p", { className: "font-medium text-og-fg", children: title }) : null,
3142
- /* @__PURE__ */ jsx2("div", { "data-contrast-audited": true, className: "leading-5", children })
3143
- ] })
3144
- }
3145
- );
3146
- }
3147
- var SHOW_HIDDEN_FILES_KEY = "og.files.show-hidden:v1";
3148
- function useShowHiddenFiles() {
3149
- const [show, setShow] = useState3(() => {
3150
- try {
3151
- return typeof window !== "undefined" && window.localStorage.getItem(SHOW_HIDDEN_FILES_KEY) === "1";
3152
- } catch {
3153
- return false;
3154
- }
3155
- });
3156
- const update = useCallback3((next) => {
3157
- setShow(next);
3158
- try {
3159
- if (next) window.localStorage.setItem(SHOW_HIDDEN_FILES_KEY, "1");
3160
- else window.localStorage.removeItem(SHOW_HIDDEN_FILES_KEY);
3161
- } catch {
3162
- }
3163
- }, []);
3164
- return [show, update];
3165
- }
3166
-
3167
- export {
3168
- CapturedFileUnavailableError,
3169
- FileWriteConflictError,
3170
- useSandboxFiles,
3171
- visibleFileTree,
3172
- filePathVisibility,
3173
- FileBrowser,
3174
- SandboxFiles
3175
- };
3176
- //# sourceMappingURL=chunk-3NRJ4Z3A.js.map