@opengeni/react 2.5.0-canary.2 → 3.0.1-canary.38817070914001

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 (865) hide show
  1. package/README.md +784 -22
  2. package/dist/accounts.d.ts +64 -0
  3. package/dist/accounts.js +824 -0
  4. package/dist/accounts.js.map +1 -0
  5. package/dist/approvals.d.ts +2 -1
  6. package/dist/artifacts-document.js +5 -3
  7. package/dist/artifacts-presentation.js +5 -3
  8. package/dist/artifacts-spreadsheet.d.ts +1 -1
  9. package/dist/artifacts-spreadsheet.js +5 -3
  10. package/dist/artifacts.d.ts +5 -1
  11. package/dist/artifacts.js +536 -42
  12. package/dist/artifacts.js.map +1 -1
  13. package/dist/browser-viewer-M7BIVFTW.js +19 -0
  14. package/dist/capability-catalog-row.d.ts +20 -0
  15. package/dist/capability-logo-fallback.d.ts +3 -0
  16. package/dist/chat-interactive-block-BO2IWXVK.js +14 -0
  17. package/dist/chunk-2DDJ6YH6.js +41 -0
  18. package/dist/chunk-2DDJ6YH6.js.map +1 -0
  19. package/dist/chunk-2HVLQ26H.js +183 -0
  20. package/dist/chunk-2HVLQ26H.js.map +1 -0
  21. package/dist/chunk-3PVDYTTB.js +24 -0
  22. package/dist/chunk-3PVDYTTB.js.map +1 -0
  23. package/dist/chunk-3UZCWK46.js +298 -0
  24. package/dist/chunk-3UZCWK46.js.map +1 -0
  25. package/dist/chunk-47CKUXTW.js +293 -0
  26. package/dist/chunk-47CKUXTW.js.map +1 -0
  27. package/dist/chunk-4QYP6QUI.js +109 -0
  28. package/dist/chunk-4QYP6QUI.js.map +1 -0
  29. package/dist/chunk-5EY26VZ7.js +1053 -0
  30. package/dist/chunk-5EY26VZ7.js.map +1 -0
  31. package/dist/chunk-5I4VRWBB.js +56 -0
  32. package/dist/chunk-5I4VRWBB.js.map +1 -0
  33. package/dist/chunk-5WOR7UCL.js +191 -0
  34. package/dist/chunk-5WOR7UCL.js.map +1 -0
  35. package/dist/chunk-5XEXTWEM.js +1911 -0
  36. package/dist/chunk-5XEXTWEM.js.map +1 -0
  37. package/dist/chunk-5YJLGOM5.js +51 -0
  38. package/dist/chunk-5YJLGOM5.js.map +1 -0
  39. package/dist/chunk-6JFN3OWG.js +386 -0
  40. package/dist/chunk-6JFN3OWG.js.map +1 -0
  41. package/dist/chunk-6SNDCUPB.js +83 -0
  42. package/dist/chunk-6SNDCUPB.js.map +1 -0
  43. package/dist/chunk-7QJT5O4S.js +35 -0
  44. package/dist/chunk-7QJT5O4S.js.map +1 -0
  45. package/dist/chunk-A55KV72M.js +402 -0
  46. package/dist/chunk-A55KV72M.js.map +1 -0
  47. package/dist/chunk-B27E3V37.js +29 -0
  48. package/dist/chunk-B27E3V37.js.map +1 -0
  49. package/dist/chunk-BOFEQC6K.js +162 -0
  50. package/dist/chunk-BOFEQC6K.js.map +1 -0
  51. package/dist/chunk-CM7LVUKC.js +35 -0
  52. package/dist/chunk-CM7LVUKC.js.map +1 -0
  53. package/dist/chunk-CORUP6JB.js +122 -0
  54. package/dist/chunk-CORUP6JB.js.map +1 -0
  55. package/dist/chunk-CSX5FFKZ.js +35 -0
  56. package/dist/chunk-CSX5FFKZ.js.map +1 -0
  57. package/dist/chunk-EGVHJKGJ.js +3125 -0
  58. package/dist/chunk-EGVHJKGJ.js.map +1 -0
  59. package/dist/{chunk-NEXLLTP4.js → chunk-G76LSA76.js} +6 -5
  60. package/dist/chunk-G76LSA76.js.map +1 -0
  61. package/dist/{chunk-PEI6RANI.js → chunk-GQMRL52F.js} +311 -75
  62. package/dist/chunk-GQMRL52F.js.map +1 -0
  63. package/dist/{chunk-QGBJ6GHG.js → chunk-GUUXOISA.js} +1113 -457
  64. package/dist/chunk-GUUXOISA.js.map +1 -0
  65. package/dist/{chunk-MXJGO7LE.js → chunk-HGKELH6Z.js} +1178 -115
  66. package/dist/chunk-HGKELH6Z.js.map +1 -0
  67. package/dist/{chunk-HUIKIDM5.js → chunk-I7X2P4FU.js} +225 -116
  68. package/dist/chunk-I7X2P4FU.js.map +1 -0
  69. package/dist/chunk-IGFZFLI2.js +1390 -0
  70. package/dist/chunk-IGFZFLI2.js.map +1 -0
  71. package/dist/{chunk-4MDLEHXL.js → chunk-IMSUVYQB.js} +26 -13
  72. package/dist/chunk-IMSUVYQB.js.map +1 -0
  73. package/dist/chunk-IOYHDEP3.js +38 -0
  74. package/dist/chunk-IOYHDEP3.js.map +1 -0
  75. package/dist/{chunk-X4JAFD5R.js → chunk-ISN726VG.js} +1513 -697
  76. package/dist/chunk-ISN726VG.js.map +1 -0
  77. package/dist/chunk-IZV5FTJC.js +55 -0
  78. package/dist/chunk-IZV5FTJC.js.map +1 -0
  79. package/dist/chunk-KF33GTWN.js +343 -0
  80. package/dist/chunk-KF33GTWN.js.map +1 -0
  81. package/dist/chunk-KSGQ5ODA.js +457 -0
  82. package/dist/chunk-KSGQ5ODA.js.map +1 -0
  83. package/dist/chunk-KZENYIA2.js +382 -0
  84. package/dist/chunk-KZENYIA2.js.map +1 -0
  85. package/dist/chunk-LJUMYUBO.js +218 -0
  86. package/dist/chunk-LJUMYUBO.js.map +1 -0
  87. package/dist/chunk-LSW2OJVV.js +380 -0
  88. package/dist/chunk-LSW2OJVV.js.map +1 -0
  89. package/dist/chunk-M357MHH3.js +2 -0
  90. package/dist/chunk-M357MHH3.js.map +1 -0
  91. package/dist/chunk-N7S72EXK.js +25 -0
  92. package/dist/chunk-N7S72EXK.js.map +1 -0
  93. package/dist/chunk-NX4ADH73.js +14 -0
  94. package/dist/chunk-NX4ADH73.js.map +1 -0
  95. package/dist/chunk-O5GPRG76.js +3006 -0
  96. package/dist/chunk-O5GPRG76.js.map +1 -0
  97. package/dist/chunk-O7F6UJO4.js +71 -0
  98. package/dist/chunk-O7F6UJO4.js.map +1 -0
  99. package/dist/chunk-OYQQJL3J.js +16 -0
  100. package/dist/chunk-OYQQJL3J.js.map +1 -0
  101. package/dist/{chunk-H5YGYNXS.js → chunk-P4BNUO57.js} +60 -17
  102. package/dist/chunk-P4BNUO57.js.map +1 -0
  103. package/dist/{chunk-JVYQRRC4.js → chunk-PEHTX3V7.js} +21 -1
  104. package/dist/chunk-PEHTX3V7.js.map +1 -0
  105. package/dist/chunk-PMV53IMM.js +26 -0
  106. package/dist/chunk-PMV53IMM.js.map +1 -0
  107. package/dist/{chunk-ZUT5QSQB.js → chunk-PWCBMEV2.js} +4262 -3917
  108. package/dist/chunk-PWCBMEV2.js.map +1 -0
  109. package/dist/{chunk-KCGXPP5V.js → chunk-PYEOPA4M.js} +13 -7
  110. package/dist/chunk-PYEOPA4M.js.map +1 -0
  111. package/dist/{chunk-T7VAYG2I.js → chunk-Q26UAIXI.js} +257 -45
  112. package/dist/chunk-Q26UAIXI.js.map +1 -0
  113. package/dist/{chunk-KZ73RL76.js → chunk-QHUE7E4N.js} +8 -3
  114. package/dist/chunk-QHUE7E4N.js.map +1 -0
  115. package/dist/chunk-QV3DJVRZ.js +11 -0
  116. package/dist/chunk-QV3DJVRZ.js.map +1 -0
  117. package/dist/chunk-R5SBNG7S.js +810 -0
  118. package/dist/chunk-R5SBNG7S.js.map +1 -0
  119. package/dist/chunk-RI42H5IU.js +326 -0
  120. package/dist/chunk-RI42H5IU.js.map +1 -0
  121. package/dist/chunk-S2QH6EZ5.js +211 -0
  122. package/dist/chunk-S2QH6EZ5.js.map +1 -0
  123. package/dist/chunk-S5ZT4TBR.js +2028 -0
  124. package/dist/chunk-S5ZT4TBR.js.map +1 -0
  125. package/dist/chunk-SHLZMAJN.js +304 -0
  126. package/dist/chunk-SHLZMAJN.js.map +1 -0
  127. package/dist/chunk-TGXK4BAZ.js +293 -0
  128. package/dist/chunk-TGXK4BAZ.js.map +1 -0
  129. package/dist/{chunk-XXWH2JLC.js → chunk-TIHSXNBC.js} +616 -621
  130. package/dist/chunk-TIHSXNBC.js.map +1 -0
  131. package/dist/{chunk-5YK2ZDIG.js → chunk-TNEZNMSN.js} +4 -10
  132. package/dist/chunk-TNEZNMSN.js.map +1 -0
  133. package/dist/{chunk-22KP6LR5.js → chunk-TXS65BB2.js} +3 -1
  134. package/dist/{chunk-22KP6LR5.js.map → chunk-TXS65BB2.js.map} +1 -1
  135. package/dist/chunk-UNJPZGNK.js +63 -0
  136. package/dist/chunk-UNJPZGNK.js.map +1 -0
  137. package/dist/chunk-VIUEOHXY.js +394 -0
  138. package/dist/chunk-VIUEOHXY.js.map +1 -0
  139. package/dist/chunk-VWH3YAV7.js +14058 -0
  140. package/dist/chunk-VWH3YAV7.js.map +1 -0
  141. package/dist/{chunk-ICA6R6TW.js → chunk-WNN7NO2N.js} +1451 -355
  142. package/dist/chunk-WNN7NO2N.js.map +1 -0
  143. package/dist/chunk-XDA5QJE7.js +402 -0
  144. package/dist/chunk-XDA5QJE7.js.map +1 -0
  145. package/dist/{chunk-VZTQ73XT.js → chunk-XEA5BCMA.js} +3 -1
  146. package/dist/{chunk-VZTQ73XT.js.map → chunk-XEA5BCMA.js.map} +1 -1
  147. package/dist/chunk-XHF7OYAN.js +1150 -0
  148. package/dist/chunk-XHF7OYAN.js.map +1 -0
  149. package/dist/chunk-YSRBFJMQ.js +43 -0
  150. package/dist/chunk-YSRBFJMQ.js.map +1 -0
  151. package/dist/chunk-ZOZAPAUO.js +174 -0
  152. package/dist/chunk-ZOZAPAUO.js.map +1 -0
  153. package/dist/chunk-ZQV5W7YC.js +809 -0
  154. package/dist/chunk-ZQV5W7YC.js.map +1 -0
  155. package/dist/chunk-ZUWF4NF7.js +13 -0
  156. package/dist/chunk-ZUWF4NF7.js.map +1 -0
  157. package/dist/client.d.ts +16 -7
  158. package/dist/clipboard.js +3 -1
  159. package/dist/commands/types.d.ts +2 -0
  160. package/dist/components/anthropic-mark.d.ts +3 -0
  161. package/dist/components/approval-surface.d.ts +19 -6
  162. package/dist/components/artifacts/artifact-chrome.d.ts +120 -0
  163. package/dist/components/artifacts/artifact-sandbox.d.ts +30 -0
  164. package/dist/components/artifacts/artifact-surface.d.ts +4 -2
  165. package/dist/components/artifacts/chat-interactive-block.d.ts +29 -0
  166. package/dist/components/artifacts/deferred-chat-media.d.ts +15 -0
  167. package/dist/components/artifacts/document-editor.d.ts +4 -2
  168. package/dist/components/artifacts/editable-artifact-ui.d.ts +2 -1
  169. package/dist/components/artifacts/editable-artifact-view.d.ts +48 -0
  170. package/dist/components/artifacts/editable-document.d.ts +1 -1
  171. package/dist/components/artifacts/editable-presentation.d.ts +2 -2
  172. package/dist/components/artifacts/editable-spreadsheet.d.ts +8 -3
  173. package/dist/components/artifacts/index.d.ts +9 -2
  174. package/dist/components/artifacts/inline-html-document.d.ts +2 -0
  175. package/dist/components/artifacts/latest-task-runner.d.ts +15 -0
  176. package/dist/components/artifacts/presentation-editor.d.ts +6 -2
  177. package/dist/components/artifacts/published-html-artifact-frame.d.ts +23 -3
  178. package/dist/components/artifacts/session-artifact-viewer.d.ts +39 -0
  179. package/dist/components/artifacts/site-view.d.ts +26 -0
  180. package/dist/components/artifacts/spreadsheet-command-queue.d.ts +20 -0
  181. package/dist/components/artifacts/spreadsheet-download.d.ts +7 -0
  182. package/dist/components/artifacts/spreadsheet-general-display.d.ts +24 -0
  183. package/dist/components/artifacts/spreadsheet-grid.d.ts +10 -3
  184. package/dist/components/artifacts/spreadsheet-resize.d.ts +50 -0
  185. package/dist/components/artifacts/spreadsheet-submissions.d.ts +9 -0
  186. package/dist/components/artifacts/visualization-assets.gen.d.ts +2 -0
  187. package/dist/components/browser-select-control.d.ts +16 -0
  188. package/dist/components/browser-viewer.d.ts +11 -2
  189. package/dist/components/chat-composer.d.ts +21 -3
  190. package/dist/components/child-session-link.d.ts +9 -0
  191. package/dist/components/claude-mark.d.ts +3 -0
  192. package/dist/components/code-editor.d.ts +1 -4
  193. package/dist/components/composer-transcription-control.d.ts +7 -0
  194. package/dist/components/composer.d.ts +38 -63
  195. package/dist/components/computer-viewer.d.ts +1 -1
  196. package/dist/components/copy-button.d.ts +3 -1
  197. package/dist/components/desktop-viewer.d.ts +1 -1
  198. package/dist/components/file-browser.d.ts +4 -1
  199. package/dist/components/fleet-tile.d.ts +2 -2
  200. package/dist/components/grok-mark.d.ts +26 -0
  201. package/dist/components/human-input-form.d.ts +28 -32
  202. package/dist/components/human-input-surface.d.ts +7 -2
  203. package/dist/components/linkified-text.d.ts +18 -0
  204. package/dist/components/machine-input-display.d.ts +22 -1
  205. package/dist/components/machines/agent-status-icon.d.ts +6 -0
  206. package/dist/components/machines/machine-detail.d.ts +7 -1
  207. package/dist/components/machines/machine-status.d.ts +48 -0
  208. package/dist/components/markdown-table-layout.d.ts +18 -0
  209. package/dist/components/markdown.d.ts +37 -4
  210. package/dist/components/message-timeline.d.ts +86 -7
  211. package/dist/components/model-mark.d.ts +29 -0
  212. package/dist/components/model-policy-picker-menu.d.ts +9 -0
  213. package/dist/components/model-policy-picker.d.ts +41 -25
  214. package/dist/components/new-conversation.d.ts +32 -0
  215. package/dist/components/open-geni-chat.d.ts +73 -0
  216. package/dist/components/open-geni-links.d.ts +68 -0
  217. package/dist/components/openrouter-mark.d.ts +6 -0
  218. package/dist/components/opper-mark.d.ts +7 -0
  219. package/dist/components/preview-loading.d.ts +2 -0
  220. package/dist/components/provider-recovery-notice.d.ts +16 -0
  221. package/dist/components/queue-item-content.d.ts +9 -0
  222. package/dist/components/rehype-secret-refs.d.ts +23 -0
  223. package/dist/components/remark-soft-line-breaks.d.ts +38 -0
  224. package/dist/components/sandbox-files.d.ts +6 -1
  225. package/dist/components/sandbox-workspace.d.ts +23 -0
  226. package/dist/components/secret-question-field.d.ts +31 -0
  227. package/dist/components/secret-ref-chip.d.ts +35 -0
  228. package/dist/components/session-capability-frame.d.ts +37 -0
  229. package/dist/components/session-chrome.d.ts +57 -8
  230. package/dist/components/session-commands-panel.d.ts +6 -0
  231. package/dist/components/session-commands.d.ts +6 -0
  232. package/dist/components/session-connection-request.d.ts +8 -0
  233. package/dist/components/session-conversation.d.ts +157 -0
  234. package/dist/components/session-list.d.ts +39 -0
  235. package/dist/components/session-mcp-capability-card.d.ts +41 -0
  236. package/dist/components/session-proxy-scope.d.ts +35 -0
  237. package/dist/components/session-status.d.ts +4 -1
  238. package/dist/components/session-usage-limit-notice.d.ts +39 -0
  239. package/dist/components/timeline-anchor.d.ts +24 -0
  240. package/dist/components/timeline-annotation-chrome.d.ts +25 -0
  241. package/dist/components/timeline-annotation-layout.d.ts +42 -0
  242. package/dist/components/timeline-annotation-markers.d.ts +8 -0
  243. package/dist/components/timeline-annotation-reveal-context.d.ts +4 -0
  244. package/dist/components/timeline-annotation-shared.d.ts +31 -0
  245. package/dist/components/timeline-annotations-dialog.d.ts +3 -2
  246. package/dist/components/timeline-annotations.d.ts +13 -3
  247. package/dist/components/timeline-reading-progress.d.ts +11 -0
  248. package/dist/components/timeline-search.d.ts +34 -0
  249. package/dist/components/timeline-settlement.d.ts +16 -0
  250. package/dist/components/tip-follow.d.ts +16 -0
  251. package/dist/components/tool-action-review.d.ts +47 -0
  252. package/dist/components/tool-review-history.d.ts +25 -0
  253. package/dist/components/usage-limit-notice.d.ts +49 -0
  254. package/dist/components/usage-member-list.d.ts +91 -0
  255. package/dist/components/usage-meter.d.ts +73 -0
  256. package/dist/components/use-viewer-menu-dismiss.d.ts +2 -0
  257. package/dist/components/user-message-body.d.ts +10 -1
  258. package/dist/composer-messages.d.ts +74 -0
  259. package/dist/composer-messages.js +9 -0
  260. package/dist/composer-messages.js.map +1 -0
  261. package/dist/composer-voice-events.d.ts +8 -0
  262. package/dist/composer.d.ts +5 -4
  263. package/dist/composer.js +26 -13
  264. package/dist/computer-viewer-GMLDXPON.js +20 -0
  265. package/dist/computer-viewer-GMLDXPON.js.map +1 -0
  266. package/dist/connect-account-identity.d.ts +8 -0
  267. package/dist/connect-accounts.d.ts +15 -0
  268. package/dist/connect-chooser.d.ts +18 -0
  269. package/dist/connect-panel.d.ts +18 -0
  270. package/dist/connect-setup.d.ts +18 -0
  271. package/dist/connect.d.ts +21 -0
  272. package/dist/connect.js +2149 -0
  273. package/dist/connect.js.map +1 -0
  274. package/dist/connection-catalog.d.ts +38 -0
  275. package/dist/connection-discovery.d.ts +12 -0
  276. package/dist/connection-installed.d.ts +17 -0
  277. package/dist/connection-logo.d.ts +9 -0
  278. package/dist/connection-service-logo.d.ts +8 -0
  279. package/dist/connection-service-presentation.d.ts +13 -0
  280. package/dist/connection-skeleton.d.ts +5 -0
  281. package/dist/connection-type-picker.d.ts +6 -0
  282. package/dist/conversation-timeline.d.ts +5 -0
  283. package/dist/desktop.d.ts +7 -0
  284. package/dist/desktop.js +27 -0
  285. package/dist/desktop.js.map +1 -0
  286. package/dist/device-authorization.d.ts +23 -0
  287. package/dist/diffs.d.ts +8 -0
  288. package/dist/diffs.js +15 -0
  289. package/dist/diffs.js.map +1 -0
  290. package/dist/discovery-cache.d.ts +5 -0
  291. package/dist/editor.d.ts +7 -0
  292. package/dist/editor.js +22 -0
  293. package/dist/editor.js.map +1 -0
  294. package/dist/embedded-new-voice-OCRNT6U5.js +18 -0
  295. package/dist/embedded-new-voice-OCRNT6U5.js.map +1 -0
  296. package/dist/embedded-session-client.d.ts +23 -0
  297. package/dist/embedded-voice-RPHPYVBT.js +18 -0
  298. package/dist/embedded-voice-RPHPYVBT.js.map +1 -0
  299. package/dist/file-node-visibility.d.ts +15 -0
  300. package/dist/{fleet-decision-row-GGCAT4E4.js → fleet-decision-row-SI63O5V4.js} +4 -1
  301. package/dist/fleet-decision-row-SI63O5V4.js.map +1 -0
  302. package/dist/hooks/latest-question.d.ts +25 -0
  303. package/dist/hooks/shared-machines-list.d.ts +4 -0
  304. package/dist/hooks/shared-query.d.ts +113 -0
  305. package/dist/hooks/use-attached-browsers.d.ts +1 -1
  306. package/dist/hooks/use-auth-runs.d.ts +1 -4
  307. package/dist/hooks/use-available-models.d.ts +1 -1
  308. package/dist/hooks/use-browser-frame-stream.d.ts +1 -1
  309. package/dist/hooks/use-browser-session.d.ts +12 -1
  310. package/dist/hooks/use-client-config-flags.d.ts +49 -0
  311. package/dist/hooks/use-codex-accounts.d.ts +59 -10
  312. package/dist/hooks/use-composer.d.ts +24 -2
  313. package/dist/hooks/use-computer-frame-stream.d.ts +1 -1
  314. package/dist/hooks/use-computer-input-posture.d.ts +13 -0
  315. package/dist/hooks/use-computer-session.d.ts +4 -0
  316. package/dist/hooks/use-connect.d.ts +23 -0
  317. package/dist/hooks/use-desktop-stream.d.ts +1 -1
  318. package/dist/hooks/use-file-attachments.d.ts +21 -2
  319. package/dist/hooks/use-goal.d.ts +2 -1
  320. package/dist/hooks/use-last-started-turn-policy.d.ts +5 -1
  321. package/dist/hooks/use-new-conversation.d.ts +56 -0
  322. package/dist/hooks/use-new-session-draft.d.ts +74 -0
  323. package/dist/hooks/use-realtime-voice-models.d.ts +7 -0
  324. package/dist/hooks/use-sandbox-files.d.ts +4 -1
  325. package/dist/hooks/use-session-conversation.d.ts +49 -0
  326. package/dist/hooks/use-session-events.d.ts +28 -7
  327. package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
  328. package/dist/hooks/use-session-model-account.d.ts +48 -0
  329. package/dist/hooks/use-supergrok-accounts.d.ts +7 -1
  330. package/dist/hooks/use-terminal-stream.d.ts +11 -5
  331. package/dist/hooks/use-usage.d.ts +40 -0
  332. package/dist/hooks/use-vaults.d.ts +53 -0
  333. package/dist/hooks/use-voice-input.d.ts +8 -1
  334. package/dist/hooks/use-workspace-edit.d.ts +4 -0
  335. package/dist/hooks/use-workspace-sessions.d.ts +22 -5
  336. package/dist/human-input-model.d.ts +122 -0
  337. package/dist/human-input.d.ts +3 -1
  338. package/dist/identity-link-accounts.d.ts +11 -0
  339. package/dist/identity-link-consent.d.ts +18 -0
  340. package/dist/index.d.ts +85 -20
  341. package/dist/index.js +2371 -6544
  342. package/dist/index.js.map +1 -1
  343. package/dist/interaction.d.ts +1 -1
  344. package/dist/interaction.js +14 -24
  345. package/dist/interaction.js.map +1 -1
  346. package/dist/latest-question-CHE7E753.js +118 -0
  347. package/dist/latest-question-CHE7E753.js.map +1 -0
  348. package/dist/lib/clipboard.d.ts +7 -0
  349. package/dist/lib/error-message.d.ts +7 -0
  350. package/dist/lib/format.d.ts +58 -4
  351. package/dist/lib/host-theme.d.ts +77 -0
  352. package/dist/lib/interaction-errors.d.ts +3 -0
  353. package/dist/lib/menu-styles.d.ts +22 -0
  354. package/dist/lib/notify-observer.d.ts +2 -0
  355. package/dist/lib/pierre-diffs-loader.d.ts +20 -0
  356. package/dist/lib/provider-recovery.d.ts +55 -0
  357. package/dist/lib/terminal-input-readiness.d.ts +11 -0
  358. package/dist/lib/transient-retry.d.ts +25 -0
  359. package/dist/lib/workbench-peers.d.ts +36 -0
  360. package/dist/lib/xterm-theme.d.ts +7 -5
  361. package/dist/machines.js +9 -5
  362. package/dist/markdown-table-layout-3PV2UAAH.js +113 -0
  363. package/dist/markdown-table-layout-3PV2UAAH.js.map +1 -0
  364. package/dist/mcp-connection-status.d.ts +14 -0
  365. package/dist/model-mark-paths.d.ts +34 -0
  366. package/dist/model-mark-paths.js +16 -0
  367. package/dist/model-mark-paths.js.map +1 -0
  368. package/dist/model-picker-model.d.ts +111 -0
  369. package/dist/model-picker-model.js +25 -0
  370. package/dist/model-picker-model.js.map +1 -0
  371. package/dist/model-policy-picker-menu-7GJ5URPR.js +17 -0
  372. package/dist/model-policy-picker-menu-7GJ5URPR.js.map +1 -0
  373. package/dist/model-policy.d.ts +30 -3
  374. package/dist/model-policy.js +14 -1
  375. package/dist/native-previews.d.ts +28 -0
  376. package/dist/native-previews.js +82 -0
  377. package/dist/native-previews.js.map +1 -0
  378. package/dist/new-session-draft.d.ts +7 -0
  379. package/dist/new-session-draft.js +639 -0
  380. package/dist/new-session-draft.js.map +1 -0
  381. package/dist/notification-text.d.ts +27 -0
  382. package/dist/{noto-sans-arabic-loader-IA2T4X2A.js → noto-sans-arabic-loader-XSH2KYWJ.js} +3 -1
  383. package/dist/{noto-sans-arabic-loader-IA2T4X2A.js.map → noto-sans-arabic-loader-XSH2KYWJ.js.map} +1 -1
  384. package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js → noto-sans-jp-loader.generated-MR5L6V7K.js} +3 -1
  385. package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js.map → noto-sans-jp-loader.generated-MR5L6V7K.js.map} +1 -1
  386. package/dist/older-history.d.ts +3 -2
  387. package/dist/organization-model.d.ts +32 -0
  388. package/dist/organization-model.js +65 -0
  389. package/dist/organization-model.js.map +1 -0
  390. package/dist/{platform-activity-row-BJHUHXAT.js → platform-activity-row-5OCKOQWZ.js} +16 -78
  391. package/dist/platform-activity-row-5OCKOQWZ.js.map +1 -0
  392. package/dist/plugin-details.d.ts +14 -0
  393. package/dist/plugin-discovery.d.ts +25 -0
  394. package/dist/preview-loading-paint.d.ts +20 -0
  395. package/dist/provider.d.ts +25 -2
  396. package/dist/queue-presentation-model.d.ts +72 -0
  397. package/dist/queue-presentation-model.js +38 -0
  398. package/dist/queue-presentation-model.js.map +1 -0
  399. package/dist/{queue-surface-implementation-BSKUWHRI.js → queue-surface-implementation-GJBH7NKO.js} +65 -265
  400. package/dist/queue-surface-implementation-GJBH7NKO.js.map +1 -0
  401. package/dist/realtime/embedded-new-voice.d.ts +1 -0
  402. package/dist/realtime/embedded-voice.d.ts +1 -0
  403. package/dist/realtime/realtime-control.d.ts +4 -65
  404. package/dist/realtime/session-realtime.d.ts +78 -0
  405. package/dist/realtime.js +25 -1294
  406. package/dist/realtime.js.map +1 -1
  407. package/dist/sandbox-files-O27IPOZW.js +21 -0
  408. package/dist/sandbox-files-O27IPOZW.js.map +1 -0
  409. package/dist/sandbox-label-model.d.ts +30 -0
  410. package/dist/sandbox-label-model.js +20 -0
  411. package/dist/sandbox-label-model.js.map +1 -0
  412. package/dist/secret-reference-label.d.ts +14 -0
  413. package/dist/secrets-ui.d.ts +57 -0
  414. package/dist/session-agents-model.d.ts +10 -0
  415. package/dist/session-agents-model.js +25 -0
  416. package/dist/session-agents-model.js.map +1 -0
  417. package/dist/session-attention-model.d.ts +8 -0
  418. package/dist/session-attention-model.js +47 -0
  419. package/dist/session-attention-model.js.map +1 -0
  420. package/dist/session-auth-recommendation.d.ts +5 -0
  421. package/dist/session-capability-policy.d.ts +31 -0
  422. package/dist/session-feedback-model.d.ts +20 -0
  423. package/dist/session-feedback-model.js +56 -0
  424. package/dist/session-feedback-model.js.map +1 -0
  425. package/dist/session-list-model.d.ts +138 -0
  426. package/dist/session-list-model.js +274 -0
  427. package/dist/session-list-model.js.map +1 -0
  428. package/dist/session-realtime-7DJOIHQW.js +21 -0
  429. package/dist/session-realtime-7DJOIHQW.js.map +1 -0
  430. package/dist/session-realtime.d.ts +7 -0
  431. package/dist/session-realtime.js +19 -0
  432. package/dist/session-realtime.js.map +1 -0
  433. package/dist/session-status-model.d.ts +36 -0
  434. package/dist/session-ui.d.ts +39 -1
  435. package/dist/session-ui.js +125 -12
  436. package/dist/session-ui.js.map +1 -1
  437. package/dist/session.d.ts +10 -2
  438. package/dist/session.js +37 -20
  439. package/dist/site-snapshot.d.ts +14 -0
  440. package/dist/sites-ui.d.ts +24 -0
  441. package/dist/sites.d.ts +3 -0
  442. package/dist/sites.js +14 -0
  443. package/dist/sites.js.map +1 -0
  444. package/dist/skill-discovery.d.ts +47 -0
  445. package/dist/terminal.d.ts +8 -0
  446. package/dist/terminal.js +32 -0
  447. package/dist/terminal.js.map +1 -0
  448. package/dist/testing/session-scenarios.d.ts +10 -0
  449. package/dist/testing/session-scenarios.js +367 -0
  450. package/dist/testing/session-scenarios.js.map +1 -0
  451. package/dist/timeline/activity-rail.d.ts +11 -2
  452. package/dist/timeline/agent-identity.d.ts +30 -0
  453. package/dist/timeline/agent-row.d.ts +31 -0
  454. package/dist/timeline/allowance-exhausted-row.d.ts +24 -0
  455. package/dist/timeline/compaction-copy.d.ts +46 -0
  456. package/dist/timeline/entrance.d.ts +13 -1
  457. package/dist/timeline/focus-sequence.d.ts +9 -0
  458. package/dist/timeline/genie-copy.d.ts +3 -0
  459. package/dist/timeline/genie-loading.d.ts +47 -0
  460. package/dist/timeline/index.d.ts +10 -4
  461. package/dist/timeline/knowledge-receipt.d.ts +17 -0
  462. package/dist/timeline/message-sender.d.ts +19 -0
  463. package/dist/timeline/notice-presentation.d.ts +13 -0
  464. package/dist/timeline/parsers.d.ts +11 -0
  465. package/dist/timeline/patch-apply-command.d.ts +18 -0
  466. package/dist/timeline/platform-activity-presentation.d.ts +21 -0
  467. package/dist/timeline/platform-activity-row.d.ts +1 -2
  468. package/dist/timeline/presented-image.d.ts +11 -0
  469. package/dist/timeline/projection.d.ts +31 -2
  470. package/dist/timeline/provider-logo.d.ts +15 -0
  471. package/dist/timeline/question-nav-model.d.ts +23 -0
  472. package/dist/timeline/registry.d.ts +12 -1
  473. package/dist/timeline/retained-image.d.ts +18 -0
  474. package/dist/timeline/retained-loaders.d.ts +27 -0
  475. package/dist/timeline/rolling-activity.d.ts +11 -0
  476. package/dist/timeline/screenshot-lightbox.d.ts +39 -2
  477. package/dist/timeline/session-usage-limit-row.d.ts +11 -0
  478. package/dist/timeline/shared.d.ts +4 -1
  479. package/dist/timeline/startup-dispatch-details.d.ts +5 -0
  480. package/dist/timeline/startup-preference.d.ts +3 -0
  481. package/dist/timeline/startup-timings.d.ts +4 -0
  482. package/dist/timeline/tool-display-name.d.ts +5 -2
  483. package/dist/timeline/tool-presentation.d.ts +172 -0
  484. package/dist/timeline/turn-summary-model.d.ts +95 -0
  485. package/dist/timeline/turn-summary.d.ts +20 -54
  486. package/dist/timeline/types.d.ts +179 -7
  487. package/dist/timeline/work-presentation.d.ts +60 -0
  488. package/dist/timeline-annotation-markers-U3G66KUD.js +166 -0
  489. package/dist/timeline-annotation-markers-U3G66KUD.js.map +1 -0
  490. package/dist/timeline-annotation-selection-BI7QTPTZ.js +242 -0
  491. package/dist/timeline-annotation-selection-BI7QTPTZ.js.map +1 -0
  492. package/dist/timeline-annotations-dialog-FOMHSDTE.js +274 -0
  493. package/dist/timeline-annotations-dialog-FOMHSDTE.js.map +1 -0
  494. package/dist/timeline-model.d.ts +29 -0
  495. package/dist/timeline-model.js +254 -0
  496. package/dist/timeline-model.js.map +1 -0
  497. package/dist/usage/allowance-copy.d.ts +25 -0
  498. package/dist/usage/session-usage-limit.d.ts +88 -0
  499. package/dist/usage/summary.d.ts +35 -0
  500. package/dist/usage.d.ts +17 -0
  501. package/dist/usage.js +1187 -0
  502. package/dist/usage.js.map +1 -0
  503. package/dist/voice-recording-owner.d.ts +7 -0
  504. package/package.json +105 -5
  505. package/src/accounts.tsx +1072 -0
  506. package/src/approvals.ts +8 -1
  507. package/src/artifacts-spreadsheet.ts +1 -0
  508. package/src/artifacts.ts +44 -0
  509. package/src/assets/README.md +8 -0
  510. package/src/assets/gmail.ico +0 -0
  511. package/src/assets/outlook.ico +0 -0
  512. package/src/capability-catalog-row.tsx +94 -0
  513. package/src/capability-logo-fallback.ts +22 -0
  514. package/src/client.ts +20 -31
  515. package/src/commands/registry.ts +18 -15
  516. package/src/commands/types.ts +2 -0
  517. package/src/components/anthropic-mark.tsx +10 -0
  518. package/src/components/approval-surface.tsx +401 -138
  519. package/src/components/artifacts/artifact-chrome.tsx +413 -0
  520. package/src/components/artifacts/artifact-sandbox.tsx +189 -0
  521. package/src/components/artifacts/artifact-surface.tsx +40 -20
  522. package/src/components/artifacts/chat-interactive-block.tsx +260 -0
  523. package/src/components/artifacts/deferred-chat-media.tsx +67 -0
  524. package/src/components/artifacts/document-editor.tsx +141 -16
  525. package/src/components/artifacts/editable-artifact-ui.tsx +4 -2
  526. package/src/components/artifacts/editable-artifact-view.tsx +197 -0
  527. package/src/components/artifacts/editable-artifact-workbench.tsx +5 -2
  528. package/src/components/artifacts/editable-document.tsx +37 -36
  529. package/src/components/artifacts/editable-presentation.tsx +36 -18
  530. package/src/components/artifacts/editable-spreadsheet.tsx +543 -103
  531. package/src/components/artifacts/index.ts +45 -0
  532. package/src/components/artifacts/inline-html-document.ts +24 -0
  533. package/src/components/artifacts/latest-task-runner.ts +49 -0
  534. package/src/components/artifacts/presentation-editor.tsx +323 -67
  535. package/src/components/artifacts/published-html-artifact-frame.tsx +122 -5
  536. package/src/components/artifacts/session-artifact-viewer.tsx +378 -0
  537. package/src/components/artifacts/site-view.tsx +121 -0
  538. package/src/components/artifacts/spreadsheet-canvas.ts +5 -10
  539. package/src/components/artifacts/spreadsheet-command-queue.ts +184 -0
  540. package/src/components/artifacts/spreadsheet-download.tsx +109 -0
  541. package/src/components/artifacts/spreadsheet-general-display.ts +43 -0
  542. package/src/components/artifacts/spreadsheet-grid.tsx +344 -144
  543. package/src/components/artifacts/spreadsheet-resize.tsx +421 -0
  544. package/src/components/artifacts/spreadsheet-submissions.tsx +46 -0
  545. package/src/components/artifacts/visualization-assets/base.css +1015 -0
  546. package/src/components/artifacts/visualization-assets/helpers.html +349 -0
  547. package/src/components/artifacts/visualization-assets.gen.ts +3 -0
  548. package/src/components/browser-select-control.tsx +312 -0
  549. package/src/components/browser-viewer.tsx +778 -318
  550. package/src/components/chat-composer.tsx +131 -85
  551. package/src/components/child-session-link.tsx +36 -0
  552. package/src/components/claude-mark.tsx +11 -0
  553. package/src/components/code-editor.tsx +13 -16
  554. package/src/components/composer-transcription-control.tsx +128 -30
  555. package/src/components/composer.tsx +426 -175
  556. package/src/components/computer-viewer.tsx +880 -253
  557. package/src/components/copy-button.tsx +13 -5
  558. package/src/components/desktop-viewer.tsx +1 -1
  559. package/src/components/enrollment-consent.tsx +1 -1
  560. package/src/components/enrollment-device-flow.tsx +1 -1
  561. package/src/components/file-browser.tsx +43 -34
  562. package/src/components/fleet-tile.tsx +9 -18
  563. package/src/components/generated-video-player.tsx +4 -2
  564. package/src/components/grok-mark.tsx +34 -0
  565. package/src/components/human-input-form.tsx +590 -283
  566. package/src/components/human-input-surface.tsx +21 -6
  567. package/src/components/interaction-intervention-banner.tsx +2 -2
  568. package/src/components/linkified-text.tsx +79 -0
  569. package/src/components/machine-card.tsx +35 -78
  570. package/src/components/machine-dock-bar.tsx +1 -1
  571. package/src/components/machine-input-display.ts +197 -3
  572. package/src/components/machines/agent-status-icon.tsx +31 -0
  573. package/src/components/machines/machine-detail.tsx +200 -31
  574. package/src/components/machines/machine-operation-policy.tsx +1 -1
  575. package/src/components/machines/machine-status.ts +241 -0
  576. package/src/components/machines-dashboard.tsx +2 -17
  577. package/src/components/markdown-table-layout.ts +143 -0
  578. package/src/components/markdown.tsx +466 -129
  579. package/src/components/message-timeline.tsx +2601 -734
  580. package/src/components/model-mark.tsx +102 -0
  581. package/src/components/model-picker.tsx +15 -4
  582. package/src/components/model-policy-picker-menu.tsx +371 -0
  583. package/src/components/model-policy-picker.tsx +256 -412
  584. package/src/components/new-conversation.tsx +221 -0
  585. package/src/components/open-geni-chat.tsx +309 -0
  586. package/src/components/open-geni-links.tsx +179 -0
  587. package/src/components/openrouter-mark.tsx +13 -0
  588. package/src/components/opper-mark.tsx +18 -0
  589. package/src/components/pierre-diff.tsx +41 -16
  590. package/src/components/pierre-file.tsx +35 -10
  591. package/src/components/preview-loading.tsx +109 -0
  592. package/src/components/provider-recovery-notice.tsx +49 -0
  593. package/src/components/queue-item-content.ts +14 -0
  594. package/src/components/queue-surface-implementation.tsx +51 -356
  595. package/src/components/queue-surface-state.tsx +3 -1
  596. package/src/components/rehype-secret-refs.ts +98 -0
  597. package/src/components/remark-soft-line-breaks.ts +166 -0
  598. package/src/components/sandbox-files.tsx +133 -17
  599. package/src/components/sandbox-terminal.tsx +84 -13
  600. package/src/components/sandbox-workspace.tsx +157 -51
  601. package/src/components/secret-question-field.tsx +324 -0
  602. package/src/components/secret-ref-chip.tsx +185 -0
  603. package/src/components/session-capability-frame.tsx +197 -0
  604. package/src/components/session-chrome.tsx +842 -251
  605. package/src/components/session-commands-panel.tsx +126 -0
  606. package/src/components/session-commands.tsx +18 -0
  607. package/src/components/session-connection-request.tsx +97 -0
  608. package/src/components/session-conversation.tsx +876 -0
  609. package/src/components/session-list.tsx +257 -0
  610. package/src/components/session-mcp-capability-card.tsx +680 -0
  611. package/src/components/session-proxy-scope.tsx +153 -0
  612. package/src/components/session-status.tsx +26 -17
  613. package/src/components/session-usage-limit-notice.tsx +174 -0
  614. package/src/components/timeline-anchor.tsx +119 -0
  615. package/src/components/timeline-annotation-chrome.tsx +196 -0
  616. package/src/components/timeline-annotation-layout.ts +268 -0
  617. package/src/components/timeline-annotation-markers.tsx +185 -0
  618. package/src/components/timeline-annotation-reveal-context.ts +9 -0
  619. package/src/components/timeline-annotation-selection.tsx +106 -54
  620. package/src/components/timeline-annotation-shared.ts +245 -0
  621. package/src/components/timeline-annotations-dialog.tsx +185 -128
  622. package/src/components/timeline-annotations.tsx +189 -45
  623. package/src/components/timeline-reading-progress.ts +80 -0
  624. package/src/components/timeline-search.tsx +168 -0
  625. package/src/components/timeline-settlement.ts +60 -0
  626. package/src/components/tip-follow.ts +52 -0
  627. package/src/components/tool-action-review.tsx +650 -0
  628. package/src/components/tool-review-history.tsx +88 -0
  629. package/src/components/tooltip.tsx +38 -5
  630. package/src/components/usage-limit-notice.tsx +179 -0
  631. package/src/components/usage-member-list.tsx +792 -0
  632. package/src/components/usage-meter.tsx +382 -0
  633. package/src/components/use-viewer-menu-dismiss.ts +33 -0
  634. package/src/components/user-message-body.tsx +27 -2
  635. package/src/components/workspace-dock.tsx +18 -1
  636. package/src/composer-messages.ts +150 -0
  637. package/src/composer-voice-events.ts +12 -0
  638. package/src/composer.ts +6 -1
  639. package/src/connect-account-identity.tsx +34 -0
  640. package/src/connect-accounts.tsx +233 -0
  641. package/src/connect-chooser.tsx +336 -0
  642. package/src/connect-panel.tsx +99 -0
  643. package/src/connect-setup.tsx +355 -0
  644. package/src/connect.ts +60 -0
  645. package/src/connection-assets.d.ts +4 -0
  646. package/src/connection-catalog.tsx +162 -0
  647. package/src/connection-discovery.tsx +238 -0
  648. package/src/connection-installed.tsx +51 -0
  649. package/src/connection-logo.tsx +37 -0
  650. package/src/connection-service-logo.tsx +55 -0
  651. package/src/connection-service-presentation.ts +46 -0
  652. package/src/connection-skeleton.tsx +16 -0
  653. package/src/connection-type-picker.tsx +36 -0
  654. package/src/conversation-timeline.ts +92 -0
  655. package/src/desktop.ts +24 -0
  656. package/src/device-authorization.tsx +98 -0
  657. package/src/diffs.ts +16 -0
  658. package/src/discovery-cache.ts +42 -0
  659. package/src/editor.ts +13 -0
  660. package/src/embedded-session-client.ts +104 -0
  661. package/src/file-node-visibility.ts +66 -0
  662. package/src/hooks/internal.ts +3 -2
  663. package/src/hooks/latest-question.ts +164 -0
  664. package/src/hooks/shared-machines-list.ts +34 -1
  665. package/src/hooks/shared-query.ts +721 -0
  666. package/src/hooks/use-attached-browsers.ts +1 -1
  667. package/src/hooks/use-auth-runs.ts +0 -27
  668. package/src/hooks/use-available-models.ts +21 -15
  669. package/src/hooks/use-browser-frame-stream.ts +19 -2
  670. package/src/hooks/use-browser-session.ts +680 -205
  671. package/src/hooks/use-browser-sessions.ts +32 -1
  672. package/src/hooks/use-client-config-flags.ts +118 -0
  673. package/src/hooks/use-codex-accounts.ts +247 -47
  674. package/src/hooks/use-composer.ts +340 -49
  675. package/src/hooks/use-computer-frame-stream.ts +25 -7
  676. package/src/hooks/use-computer-input-posture.ts +94 -0
  677. package/src/hooks/use-computer-session.ts +409 -95
  678. package/src/hooks/use-connect.ts +23 -0
  679. package/src/hooks/use-desktop-stream.ts +19 -28
  680. package/src/hooks/use-file-attachments.ts +118 -10
  681. package/src/hooks/use-goal.ts +107 -13
  682. package/src/hooks/use-human-input.ts +31 -4
  683. package/src/hooks/use-last-started-turn-policy.ts +46 -14
  684. package/src/hooks/use-machines.ts +4 -0
  685. package/src/hooks/use-new-conversation.ts +374 -0
  686. package/src/hooks/use-new-session-draft.ts +813 -0
  687. package/src/hooks/use-realtime-voice-models.ts +46 -0
  688. package/src/hooks/use-sandbox-files.ts +68 -20
  689. package/src/hooks/use-session-background-commands.ts +22 -11
  690. package/src/hooks/use-session-capabilities.ts +3 -2
  691. package/src/hooks/use-session-conversation.ts +150 -0
  692. package/src/hooks/use-session-events.ts +703 -382
  693. package/src/hooks/use-session-lineage.ts +20 -16
  694. package/src/hooks/use-session-mcp-approval-policy.ts +13 -5
  695. package/src/hooks/use-session-model-account.ts +174 -0
  696. package/src/hooks/use-session.ts +53 -21
  697. package/src/hooks/use-slash-commands.ts +6 -11
  698. package/src/hooks/use-supergrok-accounts.ts +22 -8
  699. package/src/hooks/use-terminal-stream.ts +153 -27
  700. package/src/hooks/use-transcription.ts +6 -0
  701. package/src/hooks/use-turn-queue.ts +2 -1
  702. package/src/hooks/use-usage.ts +100 -0
  703. package/src/hooks/use-vaults.ts +153 -0
  704. package/src/hooks/use-video-artifact-playback.ts +1 -1
  705. package/src/hooks/use-voice-input.ts +127 -19
  706. package/src/hooks/use-workspace-capture.ts +3 -2
  707. package/src/hooks/use-workspace-edit.ts +23 -5
  708. package/src/hooks/use-workspace-sessions.ts +97 -32
  709. package/src/human-input-model.ts +359 -0
  710. package/src/human-input.ts +12 -1
  711. package/src/identity-link-accounts.tsx +148 -0
  712. package/src/identity-link-consent.tsx +192 -0
  713. package/src/index.ts +273 -16
  714. package/src/interaction.ts +1 -0
  715. package/src/lib/clipboard.ts +29 -0
  716. package/src/lib/error-message.ts +37 -0
  717. package/src/lib/format.ts +213 -16
  718. package/src/lib/host-theme.ts +524 -0
  719. package/src/lib/interaction-errors.ts +15 -0
  720. package/src/lib/menu-styles.ts +44 -0
  721. package/src/lib/notify-observer.ts +15 -0
  722. package/src/lib/pierre-diffs-loader.ts +53 -0
  723. package/src/lib/provider-recovery.ts +240 -0
  724. package/src/lib/terminal-input-readiness.ts +51 -0
  725. package/src/lib/transient-retry.ts +99 -0
  726. package/src/lib/workbench-peers.ts +62 -0
  727. package/src/lib/xterm-theme.ts +23 -21
  728. package/src/mcp-connection-status.ts +35 -0
  729. package/src/model-mark-paths.ts +53 -0
  730. package/src/model-picker-model.ts +330 -0
  731. package/src/model-policy.ts +299 -74
  732. package/src/native-previews.ts +100 -0
  733. package/src/new-session-draft.ts +22 -0
  734. package/src/notification-text.ts +81 -0
  735. package/src/older-history.ts +22 -4
  736. package/src/organization-model.ts +118 -0
  737. package/src/plugin-details.tsx +185 -0
  738. package/src/plugin-discovery.tsx +196 -0
  739. package/src/preview-loading-paint.ts +68 -0
  740. package/src/provider.tsx +74 -15
  741. package/src/queue-presentation-model.ts +464 -0
  742. package/src/realtime/dropdown-menu.tsx +19 -12
  743. package/src/realtime/embedded-new-voice.tsx +1 -0
  744. package/src/realtime/embedded-voice.tsx +3 -0
  745. package/src/realtime/realtime-control.tsx +138 -501
  746. package/src/realtime/session-realtime.ts +566 -0
  747. package/src/sandbox-label-model.ts +53 -0
  748. package/src/secret-reference-label.ts +43 -0
  749. package/src/secrets-ui.tsx +59 -0
  750. package/src/session-agents-model.ts +33 -0
  751. package/src/session-attention-model.ts +62 -0
  752. package/src/session-auth-recommendation.ts +48 -0
  753. package/src/session-capability-policy.ts +196 -0
  754. package/src/session-context.ts +3 -4
  755. package/src/session-feedback-model.ts +95 -0
  756. package/src/session-list-model.ts +434 -0
  757. package/src/session-realtime.ts +18 -0
  758. package/src/session-status-model.ts +99 -0
  759. package/src/session-ui.ts +98 -1
  760. package/src/session.ts +22 -1
  761. package/src/site-snapshot.ts +74 -0
  762. package/src/sites-ui.tsx +348 -0
  763. package/src/sites.ts +3 -0
  764. package/src/skill-discovery.tsx +208 -0
  765. package/src/terminal.ts +26 -0
  766. package/src/testing/session-scenarios.ts +404 -0
  767. package/src/timeline/activity-rail.tsx +242 -101
  768. package/src/timeline/agent-identity.tsx +84 -0
  769. package/src/timeline/agent-row.tsx +231 -0
  770. package/src/timeline/allowance-exhausted-row.tsx +86 -0
  771. package/src/timeline/compaction-copy.ts +115 -0
  772. package/src/timeline/entrance.tsx +28 -3
  773. package/src/timeline/fleet-decision-projection.ts +2 -1
  774. package/src/timeline/fleet-decision-row.tsx +1 -0
  775. package/src/timeline/focus-sequence.ts +44 -0
  776. package/src/timeline/genie-copy.ts +19 -0
  777. package/src/timeline/genie-loading.tsx +143 -0
  778. package/src/timeline/index.ts +30 -1
  779. package/src/timeline/knowledge-receipt.tsx +100 -0
  780. package/src/timeline/message-sender.tsx +71 -0
  781. package/src/timeline/notice-presentation.ts +48 -0
  782. package/src/timeline/parsers.ts +42 -2
  783. package/src/timeline/patch-apply-command.tsx +135 -0
  784. package/src/timeline/platform-activity-presentation.ts +166 -0
  785. package/src/timeline/platform-activity-row.tsx +15 -90
  786. package/src/timeline/presented-image.ts +63 -0
  787. package/src/timeline/projection.ts +1743 -76
  788. package/src/timeline/provider-logo.tsx +53 -0
  789. package/src/timeline/question-nav-model.ts +28 -0
  790. package/src/timeline/registry.ts +26 -4
  791. package/src/timeline/retained-image.ts +97 -0
  792. package/src/timeline/retained-loaders.ts +91 -0
  793. package/src/timeline/rolling-activity.tsx +80 -0
  794. package/src/timeline/screenshot-lightbox.tsx +319 -32
  795. package/src/timeline/session-usage-limit-row.tsx +42 -0
  796. package/src/timeline/shared.tsx +42 -15
  797. package/src/timeline/startup-dispatch-details.tsx +36 -0
  798. package/src/timeline/startup-preference.ts +33 -0
  799. package/src/timeline/startup-timings.tsx +145 -0
  800. package/src/timeline/tool-display-name.ts +19 -7
  801. package/src/timeline/tool-presentation.ts +1316 -0
  802. package/src/timeline/tool-renderers.tsx +835 -1138
  803. package/src/timeline/turn-summary-model.ts +343 -0
  804. package/src/timeline/turn-summary.tsx +272 -365
  805. package/src/timeline/types.ts +189 -6
  806. package/src/timeline/work-presentation.ts +189 -0
  807. package/src/timeline-model.ts +143 -0
  808. package/src/usage/allowance-copy.ts +64 -0
  809. package/src/usage/session-usage-limit.ts +266 -0
  810. package/src/usage/summary.ts +93 -0
  811. package/src/usage.ts +70 -0
  812. package/src/voice-recording-owner.ts +22 -0
  813. package/styles/compiled.css +2303 -745
  814. package/styles/connect.css +290 -0
  815. package/styles/connect.d.ts +1 -0
  816. package/styles/effective-tokens.css +1 -0
  817. package/styles/index.css +278 -9
  818. package/styles/responsive.css +99 -7
  819. package/styles/session-capability.css +44 -0
  820. package/styles/tokens.css +136 -66
  821. package/dist/browser-viewer-GXUICIAG.js +0 -14
  822. package/dist/chunk-4MDLEHXL.js.map +0 -1
  823. package/dist/chunk-5YK2ZDIG.js.map +0 -1
  824. package/dist/chunk-6H6S5V4Z.js +0 -9571
  825. package/dist/chunk-6H6S5V4Z.js.map +0 -1
  826. package/dist/chunk-ATQJEWCA.js +0 -2263
  827. package/dist/chunk-ATQJEWCA.js.map +0 -1
  828. package/dist/chunk-FK6VG4LL.js +0 -90
  829. package/dist/chunk-FK6VG4LL.js.map +0 -1
  830. package/dist/chunk-H5YGYNXS.js.map +0 -1
  831. package/dist/chunk-HUIKIDM5.js.map +0 -1
  832. package/dist/chunk-ICA6R6TW.js.map +0 -1
  833. package/dist/chunk-JVYQRRC4.js.map +0 -1
  834. package/dist/chunk-KCGXPP5V.js.map +0 -1
  835. package/dist/chunk-KZ73RL76.js.map +0 -1
  836. package/dist/chunk-LAKLF4PA.js +0 -141
  837. package/dist/chunk-LAKLF4PA.js.map +0 -1
  838. package/dist/chunk-MXJGO7LE.js.map +0 -1
  839. package/dist/chunk-NEXLLTP4.js.map +0 -1
  840. package/dist/chunk-PEI6RANI.js.map +0 -1
  841. package/dist/chunk-QGBJ6GHG.js.map +0 -1
  842. package/dist/chunk-T7VAYG2I.js.map +0 -1
  843. package/dist/chunk-W6NFJXSA.js +0 -454
  844. package/dist/chunk-W6NFJXSA.js.map +0 -1
  845. package/dist/chunk-WSK7G5LE.js +0 -170
  846. package/dist/chunk-WSK7G5LE.js.map +0 -1
  847. package/dist/chunk-X4A66EWZ.js +0 -223
  848. package/dist/chunk-X4A66EWZ.js.map +0 -1
  849. package/dist/chunk-X4JAFD5R.js.map +0 -1
  850. package/dist/chunk-XXWH2JLC.js.map +0 -1
  851. package/dist/chunk-ZUT5QSQB.js.map +0 -1
  852. package/dist/computer-viewer-ZOP4Q7A7.js +0 -16
  853. package/dist/fleet-decision-row-GGCAT4E4.js.map +0 -1
  854. package/dist/hooks/use-environments.d.ts +0 -41
  855. package/dist/hooks/use-packs.d.ts +0 -32
  856. package/dist/platform-activity-row-BJHUHXAT.js.map +0 -1
  857. package/dist/queue-surface-implementation-BSKUWHRI.js.map +0 -1
  858. package/dist/timeline-annotation-selection-3L7LHGG2.js +0 -187
  859. package/dist/timeline-annotation-selection-3L7LHGG2.js.map +0 -1
  860. package/dist/timeline-annotations-dialog-U7EVLR75.js +0 -196
  861. package/dist/timeline-annotations-dialog-U7EVLR75.js.map +0 -1
  862. package/src/hooks/use-environments.ts +0 -182
  863. package/src/hooks/use-packs.ts +0 -157
  864. /package/dist/{browser-viewer-GXUICIAG.js.map → browser-viewer-M7BIVFTW.js.map} +0 -0
  865. /package/dist/{computer-viewer-ZOP4Q7A7.js.map → chat-interactive-block-BO2IWXVK.js.map} +0 -0
@@ -0,0 +1,824 @@
1
+ "use client";
2
+
3
+ // src/accounts.tsx
4
+ import {
5
+ createContext,
6
+ useCallback,
7
+ useContext,
8
+ useEffect,
9
+ useMemo,
10
+ useRef,
11
+ useState
12
+ } from "react";
13
+ import { jsx } from "react/jsx-runtime";
14
+ var BrowserAccountsContext = createContext(null);
15
+ var DEFAULT_CHANNEL = "opengeni:browser-account-epoch:v1";
16
+ var CROSS_TAB_ACTOR_HOLD_MS = 3e4;
17
+ async function yieldToCrossTabActorHold() {
18
+ await new Promise((resolve) => setTimeout(resolve, 0));
19
+ }
20
+ function operationId() {
21
+ return crypto.randomUUID();
22
+ }
23
+ function sameActor(left, right) {
24
+ return left?.generation === right?.generation && left?.actorEpoch === right?.actorEpoch && left?.selectedSlotId === right?.selectedSlotId && left?.state === right?.state;
25
+ }
26
+ function sameSelectedActor(left, right) {
27
+ return left !== null && right !== null && left.actorEpoch === right.actorEpoch && left.selectedSlotId === right.selectedSlotId && left.state === right.state;
28
+ }
29
+ function compareCounter(left, right) {
30
+ const leftValue = BigInt(left);
31
+ const rightValue = BigInt(right);
32
+ return leftValue < rightValue ? -1 : leftValue > rightValue ? 1 : 0;
33
+ }
34
+ function isOlderProjection(candidate, current) {
35
+ const epoch = compareCounter(candidate.actorEpoch, current.actorEpoch);
36
+ return epoch < 0 || epoch === 0 && compareCounter(candidate.generation, current.generation) < 0;
37
+ }
38
+ function accountError(error) {
39
+ return error instanceof Error ? error : new Error("Browser account operation failed");
40
+ }
41
+ function supersededOperationError() {
42
+ const error = new Error("Browser account operation was superseded by an actor change");
43
+ error.name = "AbortError";
44
+ return error;
45
+ }
46
+ function errorCode(error) {
47
+ if (!error || typeof error !== "object") return null;
48
+ const code = error.code;
49
+ return typeof code === "string" ? code : null;
50
+ }
51
+ function needsReconciliation(error) {
52
+ return (/* @__PURE__ */ new Set(["actor_change_required", "generation_conflict", "operation_outcome_unknown"])).has(
53
+ errorCode(error) ?? ""
54
+ );
55
+ }
56
+ function BrowserAccountsProvider({
57
+ client,
58
+ onActorTransition,
59
+ children,
60
+ broadcastChannelName = DEFAULT_CHANNEL,
61
+ bootstrapLegacySession = false
62
+ }) {
63
+ const [projection, setProjection] = useState(null);
64
+ const [phase, setPhase] = useState("loading");
65
+ const [blockers, setBlockers] = useState([]);
66
+ const [error, setError] = useState(null);
67
+ const [transaction, setTransaction] = useState(null);
68
+ const projectionRef = useRef(projection);
69
+ const transactionRef = useRef(transaction);
70
+ const blockerInspectorsRef = useRef(/* @__PURE__ */ new Map());
71
+ const pendingRef = useRef(null);
72
+ const transactionTargetSlotIdRef = useRef(null);
73
+ const beginOperationRef = useRef(null);
74
+ const bootstrapOperationRef = useRef(null);
75
+ const completionOperationRef = useRef(null);
76
+ const cancelOperationRef = useRef(null);
77
+ const pendingCommitSequenceRef = useRef(null);
78
+ const pendingServerMutationSequenceRef = useRef(null);
79
+ const invalidatedDuringPendingCommitRef = useRef(false);
80
+ const sequenceRef = useRef(0);
81
+ const transitionAbortRef = useRef(null);
82
+ const channelRef = useRef(null);
83
+ const crossTabActorHoldsRef = useRef(/* @__PURE__ */ new Map());
84
+ projectionRef.current = projection;
85
+ transactionRef.current = transaction;
86
+ const inspectBlockers = useCallback(() => {
87
+ const current = [...blockerInspectorsRef.current.entries()].map(([id, inspect]) => {
88
+ const blocker = inspect();
89
+ return blocker ? { ...blocker, id } : null;
90
+ }).filter((value2) => value2 !== null).sort((left, right) => left.id.localeCompare(right.id));
91
+ setBlockers(current);
92
+ return current;
93
+ }, []);
94
+ const publishActorHint = useCallback((next) => {
95
+ if (!next) return;
96
+ channelRef.current?.postMessage({
97
+ type: "actor-epoch-changed",
98
+ generation: next.generation,
99
+ actorEpoch: next.actorEpoch
100
+ });
101
+ }, []);
102
+ const publishActorHold = useCallback(
103
+ (transitionId, current) => {
104
+ channelRef.current?.postMessage({
105
+ type: "actor-transition-pending",
106
+ transitionId,
107
+ generation: current.generation,
108
+ actorEpoch: current.actorEpoch
109
+ });
110
+ },
111
+ []
112
+ );
113
+ const publishActorRelease = useCallback((transitionId) => {
114
+ channelRef.current?.postMessage({
115
+ type: "actor-transition-released",
116
+ transitionId
117
+ });
118
+ }, []);
119
+ const clearLoginTransactionState = useCallback(() => {
120
+ transactionRef.current = null;
121
+ beginOperationRef.current = null;
122
+ completionOperationRef.current = null;
123
+ cancelOperationRef.current = null;
124
+ transactionTargetSlotIdRef.current = null;
125
+ setTransaction(null);
126
+ }, []);
127
+ const settleActorTransition = useCallback(
128
+ async (kind, from, accepted, sequence, publish, authorityResetConfirmed = false, initiatingSurfaceFenced = false) => {
129
+ let source = from;
130
+ let target = accepted;
131
+ if (!authorityResetConfirmed && from && target && isOlderProjection(target, from)) {
132
+ target = await client.getSessionSet();
133
+ if (sequenceRef.current !== sequence) return null;
134
+ if (isOlderProjection(target, from)) {
135
+ throw new Error("Browser account response regressed the accepted actor epoch");
136
+ }
137
+ }
138
+ if (!initiatingSurfaceFenced && sameSelectedActor(source, target)) {
139
+ setProjection(target);
140
+ setPhase("ready");
141
+ setError(null);
142
+ return target;
143
+ }
144
+ while (true) {
145
+ transitionAbortRef.current?.abort();
146
+ const controller = new AbortController();
147
+ transitionAbortRef.current = controller;
148
+ if (publish) publishActorHint(target);
149
+ setPhase("loading");
150
+ await onActorTransition({
151
+ kind,
152
+ from: initiatingSurfaceFenced ? null : source,
153
+ to: target,
154
+ signal: controller.signal
155
+ });
156
+ initiatingSurfaceFenced = false;
157
+ if (controller.signal.aborted || sequenceRef.current !== sequence) return null;
158
+ if (!target) {
159
+ setProjection(null);
160
+ setPhase("ready");
161
+ setError(null);
162
+ return null;
163
+ }
164
+ const confirmed = await client.reconcileSessionSetAuthority();
165
+ if (controller.signal.aborted || sequenceRef.current !== sequence) return null;
166
+ if (sameActor(target, confirmed) || sameSelectedActor(target, confirmed)) {
167
+ setProjection(confirmed);
168
+ setPhase("ready");
169
+ setError(null);
170
+ return confirmed;
171
+ }
172
+ source = target;
173
+ target = confirmed;
174
+ }
175
+ },
176
+ [client, onActorTransition, publishActorHint]
177
+ );
178
+ const reconcile = useCallback(
179
+ async (kind, publish = false) => {
180
+ const sequence = ++sequenceRef.current;
181
+ const before = projectionRef.current;
182
+ setPhase("loading");
183
+ let first = await client.reconcileSessionSetAuthority();
184
+ if (sequenceRef.current !== sequence) return null;
185
+ if (bootstrapLegacySession && first.mode === "dual" && first.selectedSlotId === null && first.slots.length === 0) {
186
+ const bootstrapOperation = bootstrapOperationRef.current?.generation === first.generation ? bootstrapOperationRef.current.operationId : operationId();
187
+ bootstrapOperationRef.current = {
188
+ generation: first.generation,
189
+ operationId: bootstrapOperation
190
+ };
191
+ try {
192
+ first = await client.bootstrapSessionSet({
193
+ operationId: bootstrapOperation,
194
+ expectedGeneration: first.generation
195
+ });
196
+ bootstrapOperationRef.current = null;
197
+ } catch (caught) {
198
+ if (!needsReconciliation(caught)) throw caught;
199
+ const reconciled = await client.getSessionSet();
200
+ if (sequenceRef.current !== sequence) return null;
201
+ if (reconciled.selectedSlotId === null || reconciled.slots.length === 0) throw caught;
202
+ first = reconciled;
203
+ bootstrapOperationRef.current = null;
204
+ }
205
+ }
206
+ if (sameActor(before, first) || sameSelectedActor(before, first)) {
207
+ setProjection(first);
208
+ setPhase("ready");
209
+ setError(null);
210
+ return first;
211
+ }
212
+ if (kind === "cross_tab") clearLoginTransactionState();
213
+ return await settleActorTransition(kind, before, first, sequence, publish, true);
214
+ },
215
+ [bootstrapLegacySession, clearLoginTransactionState, client, settleActorTransition]
216
+ );
217
+ const fail = useCallback(
218
+ async (caught, kind) => {
219
+ const nextError = accountError(caught);
220
+ if (needsReconciliation(caught)) {
221
+ try {
222
+ await reconcile(kind);
223
+ } catch {
224
+ }
225
+ }
226
+ setError(nextError);
227
+ setPhase("recoverable_error");
228
+ throw nextError;
229
+ },
230
+ [reconcile]
231
+ );
232
+ const executePending = useCallback(
233
+ async (pending) => {
234
+ const blocked = inspectBlockers();
235
+ if (blocked.length > 0) {
236
+ pendingRef.current = pending;
237
+ setPhase("blocked");
238
+ return false;
239
+ }
240
+ const current = projectionRef.current;
241
+ if (!current) throw new Error("Browser session set is not loaded");
242
+ const expectedGeneration = pending.expectedGeneration ?? current.generation;
243
+ pending.expectedGeneration = expectedGeneration;
244
+ const sequence = ++sequenceRef.current;
245
+ pendingCommitSequenceRef.current = sequence;
246
+ pendingServerMutationSequenceRef.current = null;
247
+ invalidatedDuringPendingCommitRef.current = false;
248
+ pendingRef.current = pending;
249
+ setPhase("committing");
250
+ setError(null);
251
+ const changesActor = pending.changesActor(current);
252
+ let initiatingActorFenced = false;
253
+ try {
254
+ if (changesActor) {
255
+ publishActorHold(pending.operationId, current);
256
+ transitionAbortRef.current?.abort();
257
+ const controller = new AbortController();
258
+ transitionAbortRef.current = controller;
259
+ projectionRef.current = null;
260
+ setProjection(null);
261
+ setPhase("loading");
262
+ initiatingActorFenced = true;
263
+ await onActorTransition({
264
+ kind: pending.kind,
265
+ from: current,
266
+ to: null,
267
+ signal: controller.signal
268
+ });
269
+ if (controller.signal.aborted || sequenceRef.current !== sequence) return false;
270
+ await yieldToCrossTabActorHold();
271
+ if (controller.signal.aborted || sequenceRef.current !== sequence) return false;
272
+ }
273
+ pendingServerMutationSequenceRef.current = sequence;
274
+ let accepted;
275
+ try {
276
+ accepted = await pending.execute(expectedGeneration);
277
+ } catch (caught) {
278
+ if (errorCode(caught) !== "operation_outcome_unknown") throw caught;
279
+ accepted = await pending.execute(expectedGeneration);
280
+ }
281
+ if (sequenceRef.current !== sequence) return false;
282
+ let authorityResetConfirmed = pending.kind === "logout_all";
283
+ if (invalidatedDuringPendingCommitRef.current) {
284
+ accepted = await client.reconcileSessionSetAuthority();
285
+ authorityResetConfirmed = true;
286
+ if (sequenceRef.current !== sequence) return false;
287
+ }
288
+ pendingRef.current = null;
289
+ if (pendingServerMutationSequenceRef.current === sequence) {
290
+ pendingServerMutationSequenceRef.current = null;
291
+ }
292
+ if (pendingCommitSequenceRef.current === sequence) {
293
+ pendingCommitSequenceRef.current = null;
294
+ invalidatedDuringPendingCommitRef.current = false;
295
+ }
296
+ if (!initiatingActorFenced && !authorityResetConfirmed && sameSelectedActor(current, accepted)) {
297
+ setProjection(accepted);
298
+ setPhase("ready");
299
+ setError(null);
300
+ } else {
301
+ await settleActorTransition(
302
+ pending.kind,
303
+ current,
304
+ accepted,
305
+ sequence,
306
+ true,
307
+ authorityResetConfirmed,
308
+ initiatingActorFenced
309
+ );
310
+ }
311
+ return true;
312
+ } catch (caught) {
313
+ if (initiatingActorFenced) {
314
+ let authorityRestored = false;
315
+ try {
316
+ const restored = await client.reconcileSessionSetAuthority();
317
+ if (sequenceRef.current !== sequence) return false;
318
+ await settleActorTransition(
319
+ pending.kind,
320
+ current,
321
+ restored,
322
+ sequence,
323
+ false,
324
+ true,
325
+ true
326
+ );
327
+ if (sequenceRef.current !== sequence) return false;
328
+ authorityRestored = true;
329
+ } catch {
330
+ }
331
+ if (authorityRestored) {
332
+ const restoredError = accountError(caught);
333
+ setError(restoredError);
334
+ setPhase("recoverable_error");
335
+ throw restoredError;
336
+ }
337
+ }
338
+ return await fail(caught, pending.kind);
339
+ } finally {
340
+ if (changesActor) publishActorRelease(pending.operationId);
341
+ if (pendingServerMutationSequenceRef.current === sequence) {
342
+ pendingServerMutationSequenceRef.current = null;
343
+ }
344
+ if (pendingCommitSequenceRef.current === sequence) {
345
+ pendingCommitSequenceRef.current = null;
346
+ invalidatedDuringPendingCommitRef.current = false;
347
+ }
348
+ }
349
+ },
350
+ [
351
+ client,
352
+ fail,
353
+ inspectBlockers,
354
+ onActorTransition,
355
+ publishActorHold,
356
+ publishActorRelease,
357
+ settleActorTransition
358
+ ]
359
+ );
360
+ const refresh = useCallback(async () => {
361
+ try {
362
+ return await reconcile("cross_tab");
363
+ } catch (caught) {
364
+ const nextError = accountError(caught);
365
+ setError(nextError);
366
+ setPhase("recoverable_error");
367
+ throw nextError;
368
+ }
369
+ }, [reconcile]);
370
+ const beginNeutralActorInvalidation = useCallback(
371
+ async (before) => {
372
+ transitionAbortRef.current?.abort();
373
+ const controller = new AbortController();
374
+ transitionAbortRef.current = controller;
375
+ projectionRef.current = null;
376
+ setProjection(null);
377
+ clearLoginTransactionState();
378
+ setPhase("loading");
379
+ setError(null);
380
+ await onActorTransition({
381
+ kind: "cross_tab",
382
+ from: before,
383
+ to: null,
384
+ signal: controller.signal
385
+ });
386
+ return controller;
387
+ },
388
+ [clearLoginTransactionState, onActorTransition]
389
+ );
390
+ const invalidateActor = useCallback(async () => {
391
+ const pendingCommitSequence = pendingCommitSequenceRef.current;
392
+ if (pendingCommitSequence !== null && pendingServerMutationSequenceRef.current === pendingCommitSequence) {
393
+ invalidatedDuringPendingCommitRef.current = true;
394
+ await beginNeutralActorInvalidation(projectionRef.current);
395
+ return null;
396
+ }
397
+ if (pendingCommitSequence !== null) {
398
+ pendingCommitSequenceRef.current = null;
399
+ pendingServerMutationSequenceRef.current = null;
400
+ invalidatedDuringPendingCommitRef.current = false;
401
+ pendingRef.current = null;
402
+ }
403
+ const sequence = ++sequenceRef.current;
404
+ const before = projectionRef.current;
405
+ try {
406
+ const neutral = await beginNeutralActorInvalidation(before);
407
+ if (neutral.signal.aborted || sequenceRef.current !== sequence) return null;
408
+ const accepted = await client.reconcileSessionSetAuthority();
409
+ if (sequenceRef.current !== sequence) return null;
410
+ return await settleActorTransition("cross_tab", before, accepted, sequence, false, true);
411
+ } catch (caught) {
412
+ if (sequenceRef.current !== sequence) return null;
413
+ const nextError = accountError(caught);
414
+ setError(nextError);
415
+ setPhase("recoverable_error");
416
+ throw nextError;
417
+ }
418
+ }, [beginNeutralActorInvalidation, client, settleActorTransition]);
419
+ const registerTransitionBlocker = useCallback((id, inspect) => {
420
+ if (!id.trim()) throw new Error("Browser account transition blocker id is required");
421
+ blockerInspectorsRef.current.set(id, inspect);
422
+ return () => {
423
+ if (blockerInspectorsRef.current.get(id) === inspect) {
424
+ blockerInspectorsRef.current.delete(id);
425
+ }
426
+ };
427
+ }, []);
428
+ const continueTransition = useCallback(async () => {
429
+ const pending = pendingRef.current;
430
+ return pending ? await executePending(pending) : false;
431
+ }, [executePending]);
432
+ const cancelPendingTransition = useCallback(() => {
433
+ pendingRef.current = null;
434
+ setBlockers([]);
435
+ setPhase(projectionRef.current ? "ready" : "loading");
436
+ }, []);
437
+ const beginLogin = useCallback(
438
+ async (kind, slotId, returnIntent) => {
439
+ const current = projectionRef.current;
440
+ if (!current) throw new Error("Browser session set is not loaded");
441
+ if (kind === "reauth" && slotId === current.selectedSlotId && inspectBlockers().length > 0) {
442
+ setPhase("blocked");
443
+ throw new Error("Settle account transition blockers before re-authenticating");
444
+ }
445
+ const sequence = ++sequenceRef.current;
446
+ setPhase("committing");
447
+ setError(null);
448
+ const signature = JSON.stringify([
449
+ kind,
450
+ slotId ?? null,
451
+ returnIntent ?? null,
452
+ current.generation
453
+ ]);
454
+ const beginOperation = beginOperationRef.current?.signature === signature ? beginOperationRef.current.operationId : operationId();
455
+ beginOperationRef.current = { signature, operationId: beginOperation };
456
+ let next;
457
+ try {
458
+ next = await client.beginLoginTransaction({
459
+ operationId: beginOperation,
460
+ expectedGeneration: current.generation,
461
+ kind,
462
+ ...slotId ? { slotId } : {},
463
+ ...returnIntent ? { returnIntent } : {}
464
+ });
465
+ } catch (caught) {
466
+ if (sequenceRef.current !== sequence) {
467
+ if (beginOperationRef.current?.operationId === beginOperation) {
468
+ beginOperationRef.current = null;
469
+ }
470
+ throw supersededOperationError();
471
+ }
472
+ return await fail(caught, kind);
473
+ }
474
+ if (sequenceRef.current !== sequence) {
475
+ if (beginOperationRef.current?.operationId === beginOperation) {
476
+ beginOperationRef.current = null;
477
+ }
478
+ throw supersededOperationError();
479
+ }
480
+ beginOperationRef.current = null;
481
+ transactionTargetSlotIdRef.current = slotId ?? null;
482
+ completionOperationRef.current = null;
483
+ cancelOperationRef.current = null;
484
+ setTransaction(next);
485
+ setPhase("ready");
486
+ return next;
487
+ },
488
+ [client, fail, inspectBlockers]
489
+ );
490
+ const beginAdd = useCallback(
491
+ async (returnIntent) => await beginLogin("add", void 0, returnIntent),
492
+ [beginLogin]
493
+ );
494
+ const beginReauth = useCallback(
495
+ async (slotId, returnIntent) => await beginLogin("reauth", slotId, returnIntent),
496
+ [beginLogin]
497
+ );
498
+ const completeEmailPassword = useCallback(
499
+ async (input) => {
500
+ const current = projectionRef.current;
501
+ const activeTransaction = transactionRef.current;
502
+ if (!current || !activeTransaction) throw new Error("No browser login transaction is active");
503
+ const selectedReauth = activeTransaction.kind === "reauth" && transactionTargetSlotIdRef.current !== null && transactionTargetSlotIdRef.current === current.selectedSlotId;
504
+ if (selectedReauth && inspectBlockers().length > 0) {
505
+ setPhase("blocked");
506
+ return false;
507
+ }
508
+ const sequence = ++sequenceRef.current;
509
+ setPhase("committing");
510
+ setError(null);
511
+ const completionOperation = completionOperationRef.current ?? {
512
+ operationId: operationId(),
513
+ expectedGeneration: current.generation
514
+ };
515
+ completionOperationRef.current = completionOperation;
516
+ try {
517
+ const completed = await client.completeEmailPasswordTransaction({
518
+ operationId: completionOperation.operationId,
519
+ expectedGeneration: completionOperation.expectedGeneration,
520
+ transactionId: activeTransaction.id,
521
+ email: input.email,
522
+ password: input.password
523
+ });
524
+ if (sequenceRef.current !== sequence) return false;
525
+ completionOperationRef.current = null;
526
+ cancelOperationRef.current = null;
527
+ transactionTargetSlotIdRef.current = null;
528
+ setTransaction(null);
529
+ const actorChanged = completed.projection.actorEpoch !== current.actorEpoch;
530
+ if (actorChanged) {
531
+ await settleActorTransition(
532
+ activeTransaction.kind,
533
+ current,
534
+ completed.projection,
535
+ sequence,
536
+ true
537
+ );
538
+ } else {
539
+ setProjection(completed.projection);
540
+ setPhase("ready");
541
+ }
542
+ return true;
543
+ } catch (caught) {
544
+ return await fail(caught, activeTransaction.kind);
545
+ }
546
+ },
547
+ [client, fail, inspectBlockers, settleActorTransition]
548
+ );
549
+ const settleExternalLoginTransaction = useCallback(
550
+ async (transactionId) => {
551
+ const activeTransaction = transactionRef.current;
552
+ if (!activeTransaction || activeTransaction.id !== transactionId) return false;
553
+ try {
554
+ await reconcile(activeTransaction.kind, true);
555
+ if (transactionRef.current?.id !== transactionId) return false;
556
+ completionOperationRef.current = null;
557
+ cancelOperationRef.current = null;
558
+ transactionTargetSlotIdRef.current = null;
559
+ setTransaction(null);
560
+ return true;
561
+ } catch (caught) {
562
+ const nextError = accountError(caught);
563
+ setError(nextError);
564
+ setPhase("recoverable_error");
565
+ throw nextError;
566
+ }
567
+ },
568
+ [reconcile]
569
+ );
570
+ const cancelLoginTransaction = useCallback(async () => {
571
+ const current = projectionRef.current;
572
+ const activeTransaction = transactionRef.current;
573
+ if (!current || !activeTransaction) return;
574
+ const sequence = ++sequenceRef.current;
575
+ setPhase("committing");
576
+ const cancelOperation = cancelOperationRef.current ?? {
577
+ operationId: operationId(),
578
+ expectedGeneration: current.generation
579
+ };
580
+ cancelOperationRef.current = cancelOperation;
581
+ let next;
582
+ try {
583
+ next = await client.cancelLoginTransaction({
584
+ operationId: cancelOperation.operationId,
585
+ expectedGeneration: cancelOperation.expectedGeneration,
586
+ transactionId: activeTransaction.id
587
+ });
588
+ } catch (caught) {
589
+ if (sequenceRef.current !== sequence) {
590
+ if (cancelOperationRef.current?.operationId === cancelOperation.operationId) {
591
+ cancelOperationRef.current = null;
592
+ }
593
+ throw supersededOperationError();
594
+ }
595
+ await fail(caught, activeTransaction.kind);
596
+ return;
597
+ }
598
+ if (sequenceRef.current !== sequence) {
599
+ if (cancelOperationRef.current?.operationId === cancelOperation.operationId) {
600
+ cancelOperationRef.current = null;
601
+ }
602
+ throw supersededOperationError();
603
+ }
604
+ clearLoginTransactionState();
605
+ setProjection(next);
606
+ setPhase("ready");
607
+ setError(null);
608
+ }, [clearLoginTransactionState, client, fail]);
609
+ const selectSlot = useCallback(
610
+ async (slotId) => {
611
+ const id = operationId();
612
+ return await executePending({
613
+ kind: "select",
614
+ operationId: id,
615
+ expectedGeneration: null,
616
+ changesActor: (current) => current.selectedSlotId !== slotId,
617
+ execute: async (expectedGeneration) => await client.selectLoginSlot({
618
+ operationId: id,
619
+ expectedGeneration,
620
+ slotId
621
+ })
622
+ });
623
+ },
624
+ [client, executePending]
625
+ );
626
+ const logoutSlot = useCallback(
627
+ async (slotId, replacementSlotId) => {
628
+ const id = operationId();
629
+ return await executePending({
630
+ kind: "logout_one",
631
+ operationId: id,
632
+ expectedGeneration: null,
633
+ changesActor: (current) => current.selectedSlotId === slotId,
634
+ execute: async (expectedGeneration) => await client.logoutLoginSlot({
635
+ operationId: id,
636
+ expectedGeneration,
637
+ slotId,
638
+ replacementSlotId
639
+ })
640
+ });
641
+ },
642
+ [client, executePending]
643
+ );
644
+ const logoutAll = useCallback(async () => {
645
+ const id = operationId();
646
+ return await executePending({
647
+ kind: "logout_all",
648
+ operationId: id,
649
+ expectedGeneration: null,
650
+ // Logout-all always rotates the browser-set authority, even when the set
651
+ // is neutral but still contains slots. Peers must therefore enter the
652
+ // same precommit hold and reconciliation boundary unconditionally.
653
+ changesActor: () => true,
654
+ execute: async (expectedGeneration) => {
655
+ await client.logoutSessionSet({ operationId: id, expectedGeneration });
656
+ return await client.getSessionSet();
657
+ }
658
+ });
659
+ }, [client, executePending]);
660
+ const resolveDeepLink = useCallback(
661
+ async (path) => await client.resolveDeepLink({ path }),
662
+ [client]
663
+ );
664
+ useEffect(() => {
665
+ const sequence = sequenceRef;
666
+ const transitionAbort = transitionAbortRef;
667
+ void refresh().catch((caught) => {
668
+ setError(accountError(caught));
669
+ setPhase("recoverable_error");
670
+ });
671
+ return () => {
672
+ ++sequence.current;
673
+ transitionAbort.current?.abort();
674
+ };
675
+ }, [client, refresh]);
676
+ useEffect(() => {
677
+ if (!broadcastChannelName || typeof BroadcastChannel === "undefined") return;
678
+ const channel = new BroadcastChannel(broadcastChannelName);
679
+ const actorHolds = crossTabActorHoldsRef.current;
680
+ channelRef.current = channel;
681
+ channel.onmessage = (event) => {
682
+ const value2 = event.data;
683
+ if (!value2 || typeof value2 !== "object") return;
684
+ const hint = value2;
685
+ if (hint.type === "actor-transition-pending") {
686
+ if (typeof hint.transitionId !== "string" || !/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu.test(
687
+ hint.transitionId
688
+ ) || typeof hint.actorEpoch !== "string" || typeof hint.generation !== "string" || crossTabActorHoldsRef.current.has(hint.transitionId)) {
689
+ return;
690
+ }
691
+ const current = projectionRef.current;
692
+ if (current && (current.actorEpoch !== hint.actorEpoch || current.generation !== hint.generation)) {
693
+ return;
694
+ }
695
+ if (!current && crossTabActorHoldsRef.current.size === 0) return;
696
+ const firstHold = crossTabActorHoldsRef.current.size === 0;
697
+ const timeout = setTimeout(() => {
698
+ if (!crossTabActorHoldsRef.current.delete(hint.transitionId)) return;
699
+ if (crossTabActorHoldsRef.current.size === 0) {
700
+ void invalidateActor().catch(() => void 0);
701
+ }
702
+ }, CROSS_TAB_ACTOR_HOLD_MS);
703
+ crossTabActorHoldsRef.current.set(hint.transitionId, timeout);
704
+ if (firstHold) {
705
+ if (pendingCommitSequenceRef.current !== null) {
706
+ invalidatedDuringPendingCommitRef.current = true;
707
+ } else {
708
+ ++sequenceRef.current;
709
+ }
710
+ void beginNeutralActorInvalidation(current).catch(() => void 0);
711
+ }
712
+ return;
713
+ }
714
+ if (hint.type === "actor-transition-released") {
715
+ if (typeof hint.transitionId !== "string") return;
716
+ const timeout = crossTabActorHoldsRef.current.get(hint.transitionId);
717
+ if (timeout === void 0) return;
718
+ clearTimeout(timeout);
719
+ crossTabActorHoldsRef.current.delete(hint.transitionId);
720
+ if (crossTabActorHoldsRef.current.size === 0) {
721
+ void invalidateActor().catch(() => void 0);
722
+ }
723
+ return;
724
+ }
725
+ if (hint.type !== "actor-epoch-changed" || typeof hint.actorEpoch !== "string" || typeof hint.generation !== "string" || hint.actorEpoch === projectionRef.current?.actorEpoch && hint.generation === projectionRef.current?.generation) {
726
+ return;
727
+ }
728
+ for (const timeout of crossTabActorHoldsRef.current.values()) clearTimeout(timeout);
729
+ crossTabActorHoldsRef.current.clear();
730
+ void invalidateActor().catch(() => void 0);
731
+ };
732
+ return () => {
733
+ for (const timeout of actorHolds.values()) clearTimeout(timeout);
734
+ actorHolds.clear();
735
+ channel.close();
736
+ if (channelRef.current === channel) channelRef.current = null;
737
+ };
738
+ }, [beginNeutralActorInvalidation, broadcastChannelName, invalidateActor]);
739
+ const value = useMemo(
740
+ () => ({
741
+ projection,
742
+ phase,
743
+ blockers,
744
+ error,
745
+ transaction,
746
+ hasPendingTransition: pendingRef.current !== null,
747
+ refresh,
748
+ invalidateActor,
749
+ registerTransitionBlocker,
750
+ continueTransition,
751
+ cancelPendingTransition,
752
+ beginAdd,
753
+ beginReauth,
754
+ completeEmailPassword,
755
+ settleExternalLoginTransaction,
756
+ cancelLoginTransaction,
757
+ selectSlot,
758
+ logoutSlot,
759
+ logoutAll,
760
+ resolveDeepLink
761
+ }),
762
+ [
763
+ projection,
764
+ phase,
765
+ blockers,
766
+ error,
767
+ transaction,
768
+ refresh,
769
+ invalidateActor,
770
+ registerTransitionBlocker,
771
+ continueTransition,
772
+ cancelPendingTransition,
773
+ beginAdd,
774
+ beginReauth,
775
+ completeEmailPassword,
776
+ settleExternalLoginTransaction,
777
+ cancelLoginTransaction,
778
+ selectSlot,
779
+ logoutSlot,
780
+ logoutAll,
781
+ resolveDeepLink
782
+ ]
783
+ );
784
+ return /* @__PURE__ */ jsx(BrowserAccountsContext.Provider, { value, children });
785
+ }
786
+ function useBrowserAccounts() {
787
+ const context = useContext(BrowserAccountsContext);
788
+ if (!context) {
789
+ throw new Error(
790
+ "@opengeni/react/accounts: wrap the tree in <BrowserAccountsProvider> before using account hooks"
791
+ );
792
+ }
793
+ return context;
794
+ }
795
+ function useOptionalBrowserAccounts() {
796
+ return useContext(BrowserAccountsContext);
797
+ }
798
+ function useBrowserAccountTransitionBlocker(id, inspect) {
799
+ const { registerTransitionBlocker } = useBrowserAccounts();
800
+ const inspectRef = useRef(inspect);
801
+ inspectRef.current = inspect;
802
+ useEffect(
803
+ () => registerTransitionBlocker(id, () => inspectRef.current()),
804
+ [id, registerTransitionBlocker]
805
+ );
806
+ }
807
+ function useOptionalBrowserAccountTransitionBlocker(id, inspect) {
808
+ const context = useContext(BrowserAccountsContext);
809
+ const registerTransitionBlocker = context?.registerTransitionBlocker;
810
+ const inspectRef = useRef(inspect);
811
+ inspectRef.current = inspect;
812
+ useEffect(() => {
813
+ if (!registerTransitionBlocker) return;
814
+ return registerTransitionBlocker(id, () => inspectRef.current());
815
+ }, [id, registerTransitionBlocker]);
816
+ }
817
+ export {
818
+ BrowserAccountsProvider,
819
+ useBrowserAccountTransitionBlocker,
820
+ useBrowserAccounts,
821
+ useOptionalBrowserAccountTransitionBlocker,
822
+ useOptionalBrowserAccounts
823
+ };
824
+ //# sourceMappingURL=accounts.js.map