dorkos 0.123.0 → 0.124.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 (316) hide show
  1. package/dist/bin/cli.js +775 -308
  2. package/dist/browser/native/package-manifest.json +1 -1
  3. package/dist/browser/source-manifest.json +1 -1
  4. package/dist/client/assets/{AboutPage-BmtoPqP9.js → AboutPage-BH8Ndn3e.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-CEzdFJiR.js → ActivityErrorState-K5Mew9EX.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-mFYgTr3e.js → ActivityPage-BB20L5HU.js} +1 -1
  7. package/dist/client/assets/{ActivityRow-Bkc0kkim.js → ActivityRow-C5O7rnmS.js} +1 -1
  8. package/dist/client/assets/{AdapterIcon-DVgTrgnM.js → AdapterIcon-Bmybvrzb.js} +1 -1
  9. package/dist/client/assets/{AdapterSetupWizard-I03EluU5.js → AdapterSetupWizard-CkdV7Hhh.js} +2 -2
  10. package/dist/client/assets/{AgentOptionRow-DI1TzLaR.js → AgentOptionRow-BA2cDa7r.js} +1 -1
  11. package/dist/client/assets/{AgentPicker-CBYeBzjf.js → AgentPicker-CsIIPGZJ.js} +1 -1
  12. package/dist/client/assets/{AgentRequestCard-DQ6GYoeE.js → AgentRequestCard-0fOxvaoe.js} +3 -3
  13. package/dist/client/assets/{AppearancePage-62xIPNPn.js → AppearancePage-XOjkkoli.js} +1 -1
  14. package/dist/client/assets/{ApplyToOverridesDialog-CrqkeHQb.js → ApplyToOverridesDialog-CoO6V1G4.js} +1 -1
  15. package/dist/client/assets/{AttentionSignalRow-Coe5pYX6.js → AttentionSignalRow-CjjZobp7.js} +1 -1
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-D07cg75s.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-9TVHyRPJ.js} +1 -1
  17. package/dist/client/assets/{BindingDialog-DVyxVXZM.js → BindingDialog-DLoAQauL.js} +1 -1
  18. package/dist/client/assets/{BlintzCanvas-BmfkiUQJ.js → BlintzCanvas-CYHsXAcY.js} +3 -3
  19. package/dist/client/assets/{CanvasCsvContent-CRTr-AI7.js → CanvasCsvContent--Gr7Fe_U.js} +1 -1
  20. package/dist/client/assets/{CanvasFileContent-rOmY1s3T.js → CanvasFileContent-estXyAbr.js} +2 -2
  21. package/dist/client/assets/{CanvasModel3dContent-D7oRT6ey.js → CanvasModel3dContent-CkOo930M.js} +2 -2
  22. package/dist/client/assets/{ChatAppsOff-BmuOTq83.js → ChatAppsOff-D4L1zJVN.js} +1 -1
  23. package/dist/client/assets/{CodeMirrorDiff-DidSWwYJ.js → CodeMirrorDiff-DY_6ju-z.js} +1 -1
  24. package/dist/client/assets/{CodeMirrorEditor-BUAWGbRo.js → CodeMirrorEditor-BUoDBsBv.js} +1 -1
  25. package/dist/client/assets/{CommitmentList-uK4CKaz0.js → CommitmentList-wDkcVP9c.js} +1 -1
  26. package/dist/client/assets/{CommitmentsPage-BWITH1r2.js → CommitmentsPage-CzSM6b8R.js} +1 -1
  27. package/dist/client/assets/{ComputerResourceView-adgF_EZU.js → ComputerResourceView-cERD9H2L.js} +1 -1
  28. package/dist/client/assets/{ComputerViewer-D87LhxwL.js → ComputerViewer-rMcfbk2_.js} +1 -1
  29. package/dist/client/assets/{ConnectionAccessLists-BFEFqcSZ.js → ConnectionAccessLists-f7QeQbQo.js} +1 -1
  30. package/dist/client/assets/{ConnectionsPage-Cd_cLoSY.js → ConnectionsPage-BmjtA6pw.js} +2 -2
  31. package/dist/client/assets/{ConventionPage-BSztD-gU.js → ConventionPage-CH-ah6nI.js} +1 -1
  32. package/dist/client/assets/{ExtensionPageRoute-BSge6XRv.js → ExtensionPageRoute-CJIxa6ST.js} +2 -2
  33. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-TO2CUPG0.js → FloatingTanStackRouterDevtools-CqogiFob-BP7EJ2JL.js} +1 -1
  34. package/dist/client/assets/HandlePage-Cg8H3mQS.js +1 -0
  35. package/dist/client/assets/{HeartbeatPage-DIJzdOhj.js → HeartbeatPage-BUsf-qrU.js} +1 -1
  36. package/dist/client/assets/{KeyEntry-DJnzW3Mu.js → KeyEntry-C2kWdN8q.js} +1 -1
  37. package/dist/client/assets/{LexicalField-BxzNvIjJ.js → LexicalField-CR8ulsI_.js} +1 -1
  38. package/dist/client/assets/{ManagesPage-BQj8KbYA.js → ManagesPage-DTtsIOGi.js} +1 -1
  39. package/dist/client/assets/{Marketplace-CIG5_a_H.js → Marketplace-iaV5XAzv.js} +2 -2
  40. package/dist/client/assets/{MarketplaceSourcesView-16HKvFK-.js → MarketplaceSourcesView-6tgzUfFj.js} +1 -1
  41. package/dist/client/assets/{McpAppFrame-5xlga1jD.js → McpAppFrame-C7eYYdI9.js} +1 -1
  42. package/dist/client/assets/McpSigninBody-BDyGbJ7I.js +1 -0
  43. package/dist/client/assets/{Model3dViewer-CQ0sA_kr.js → Model3dViewer-BujDNuVS.js} +1 -1
  44. package/dist/client/assets/NamePage-Bx8T98OF.js +1 -0
  45. package/dist/client/assets/{NewDirectMessageMenu-D092y0K9.js → NewDirectMessageMenu-D4e-z2Jt.js} +1 -1
  46. package/dist/client/assets/{NotificationsPage-CskOPdhh.js → NotificationsPage-CkDeTaJp.js} +1 -1
  47. package/dist/client/assets/{OpenMeshSwitch-BHRm328L.js → OpenMeshSwitch-CtbOt3r5.js} +2 -2
  48. package/dist/client/assets/OperatorIdentityForm-Vr4qZnmM.js +1 -0
  49. package/dist/client/assets/PermissionHistory-DzU1rf2B.js +1 -0
  50. package/dist/client/assets/{PermissionsPage-XuPOSYll.js → PermissionsPage-f4QaX8oM.js} +1 -1
  51. package/dist/client/assets/{PersonalityPopover-BrZjxakx.js → PersonalityPopover-BkZruwF-.js} +1 -1
  52. package/dist/client/assets/PhotoPage-CmrOIRjf.js +1 -0
  53. package/dist/client/assets/{PreviewRefusedNotice-BANdpT9O.js → PreviewRefusedNotice-BXC2K0tx.js} +1 -1
  54. package/dist/client/assets/{ProfileFields-Dp68ebW9.js → ProfileFields-BebX5oiv.js} +1 -1
  55. package/dist/client/assets/{ProfilePanelContainer-BKwGdI90.js → ProfilePanelContainer-DZoL65zQ.js} +1 -1
  56. package/dist/client/assets/{ProfileRolePicker-ClOdfLda.js → ProfileRolePicker-D9H7wsuT.js} +1 -1
  57. package/dist/client/assets/{PromptSuggestionChips-zcW4UJ_O.js → PromptSuggestionChips-B5fDmc-g.js} +1 -1
  58. package/dist/client/assets/{ReportsToPopover-BwDVGqFg.js → ReportsToPopover-uVYhSqj7.js} +1 -1
  59. package/dist/client/assets/{RoomSurface-CSKIvyHH.js → RoomSurface-Bg5WV4Ep.js} +7 -7
  60. package/dist/client/assets/{RoomsPage-CAvrRbPk.js → RoomsPage-yflYFulU.js} +1 -1
  61. package/dist/client/assets/{RunsOnPopover-CQ4t9EZ-.js → RunsOnPopover-DtGrX1Vq.js} +1 -1
  62. package/dist/client/assets/{RuntimeConnectFlow--fVpIf0B.js → RuntimeConnectFlow-DjReuQ-T.js} +1 -1
  63. package/dist/client/assets/{RuntimeSetupDialog-COpyPrqL.js → RuntimeSetupDialog-Cr4GRi8c.js} +1 -1
  64. package/dist/client/assets/{SeenDevices-BPw3UgjX.js → SeenDevices-SPWkdzoK.js} +3 -3
  65. package/dist/client/assets/{SessionsPage-FDyYzuXs.js → SessionsPage-BWu-en78.js} +1 -1
  66. package/dist/client/assets/SettingsDialog-_dEXUhHe.js +12 -0
  67. package/dist/client/assets/{SkillsPage-PLXEY0LB.js → SkillsPage-BdUb9SZy.js} +1 -1
  68. package/dist/client/assets/TaskDialogWrapper-qYJPEoSR.js +1 -0
  69. package/dist/client/assets/{TasksEmptyState-8RZxhRh6.js → TasksEmptyState-Bgcg9vxF.js} +2 -2
  70. package/dist/client/assets/{TasksPage-C-EtQXKb.js → TasksPage-Ch5W2WQS.js} +1 -1
  71. package/dist/client/assets/{TeamComputerEntry-qx_19Htj.js → TeamComputerEntry-CPwSIMRw.js} +1 -1
  72. package/dist/client/assets/ToolsPage-Idimrn3o.js +2 -0
  73. package/dist/client/assets/{TopologyGraph-1wtG1BE9.js → TopologyGraph-I4_mkMHM.js} +14 -14
  74. package/dist/client/assets/{TourHost-C664E8OY.js → TourHost-BPaSwh9I.js} +1 -1
  75. package/dist/client/assets/{UnlinkDialog-Di1oBFA_.js → UnlinkDialog-BUWZUu5P.js} +1 -1
  76. package/dist/client/assets/{WidgetErrorCard-BfgGzyqg.js → WidgetErrorCard-cS8yMCxU.js} +3 -3
  77. package/dist/client/assets/_shell-ClVN2pUj.js +80 -0
  78. package/dist/client/assets/{_shell._home-Hz78BY6-.js → _shell._home-DCA5k-jb.js} +1 -1
  79. package/dist/client/assets/{_shell._home.activity-BxvI0gkw.js → _shell._home.activity-BX4nFLna.js} +1 -1
  80. package/dist/client/assets/{_shell._home.index-Cqq81f3P.js → _shell._home.index-C8t8cw72.js} +1 -1
  81. package/dist/client/assets/{_shell._home.tasks-Cth56CwC.js → _shell._home.tasks-BgUeEvhK.js} +1 -1
  82. package/dist/client/assets/{_shell._home.workspaces-DkoOJSWz.js → _shell._home.workspaces-BPBdnkRt.js} +1 -1
  83. package/dist/client/assets/_shell.channels-CX4kki7G.js +10 -0
  84. package/dist/client/assets/_shell.connections-0vP7g7E4.js +1 -0
  85. package/dist/client/assets/{_shell.feedback-requests-BTxHdsfb.js → _shell.feedback-requests-TsuaO4eR.js} +2 -2
  86. package/dist/client/assets/_shell.marketplace-CiL6YRbl.js +1 -0
  87. package/dist/client/assets/_shell.marketplace_.sources-C0sI8e21.js +1 -0
  88. package/dist/client/assets/_shell.session-_hhBvFc6.js +63 -0
  89. package/dist/client/assets/{_shell.team-ZxGwa39m.js → _shell.team-Bm6cOBhR.js} +4 -4
  90. package/dist/client/assets/_shell.x._extensionId-BWy5v1YE.js +1 -0
  91. package/dist/client/assets/_shell.x._extensionId_._-BWy5v1YE.js +1 -0
  92. package/dist/client/assets/{abnfDiagram-WEYOIA3C-CzqPVMdw.js → abnfDiagram-WEYOIA3C-CrvoN15x.js} +1 -1
  93. package/dist/client/assets/{access-copy-Dj09Xk4b.js → access-copy-B3yNZ7Gz.js} +1 -1
  94. package/dist/client/assets/{arc-Bgy7ExYl.js → arc-CuT6QA_y.js} +1 -1
  95. package/dist/client/assets/{architectureDiagram-ZHVYKT53-DYfb2p9r.js → architectureDiagram-ZHVYKT53-CPXCZ9H4.js} +1 -1
  96. package/dist/client/assets/{banner-dlsHTWSf.js → banner-DRumuw3F.js} +1 -1
  97. package/dist/client/assets/{blockDiagram-RJAE7QA3-BkOzLL8s.js → blockDiagram-RJAE7QA3-CM0rka9p.js} +1 -1
  98. package/dist/client/assets/{c4Diagram-XDPPPE54-CsZm4qpD.js → c4Diagram-XDPPPE54-D4j2cXRy.js} +1 -1
  99. package/dist/client/assets/{card-Dj6ZfRgu.js → card-B3CtfC3R.js} +1 -1
  100. package/dist/client/assets/channel-DjBlTcCV.js +1 -0
  101. package/dist/client/assets/{chunk-2E7WHVMD-GA96Jfps.js → chunk-2E7WHVMD-KGyqhVpO.js} +1 -1
  102. package/dist/client/assets/{chunk-2Q5K7J3B-CW2i0IkT.js → chunk-2Q5K7J3B-Dl0BHoqK.js} +1 -1
  103. package/dist/client/assets/{chunk-4EMNKR2T-BwFvnPZg.js → chunk-4EMNKR2T-Da7vH6Kv.js} +1 -1
  104. package/dist/client/assets/{chunk-55XCU76K-MOezzAAB.js → chunk-55XCU76K-DgBUEROO.js} +1 -1
  105. package/dist/client/assets/{chunk-5VM5RSS4-woru6zOC.js → chunk-5VM5RSS4-BQ4mn-_I.js} +1 -1
  106. package/dist/client/assets/{chunk-JWPE2WC7-CUrKlP2M.js → chunk-JWPE2WC7-8LPR3mXf.js} +1 -1
  107. package/dist/client/assets/{chunk-VQ5W62QI-CqZ2cdEu.js → chunk-VQ5W62QI-BkIVXi4W.js} +1 -1
  108. package/dist/client/assets/{chunk-XXDRQBXY-ByAcvWaE.js → chunk-XXDRQBXY-DQXJx06h.js} +1 -1
  109. package/dist/client/assets/{chunk-ZCHMQSOR-3nkba9kj.js → chunk-ZCHMQSOR-DzCE7qlD.js} +2 -2
  110. package/dist/client/assets/{classDiagram-v2-4MYWR3UA-B-zZKAmI.js → classDiagram-v2-4MYWR3UA-C_cZra7c.js} +1 -1
  111. package/dist/client/assets/{command-BAOEURY7.js → command-CDKbyppr.js} +1 -1
  112. package/dist/client/assets/{cose-bilkent-JH36ORCC-sCKxRv1H.js → cose-bilkent-JH36ORCC-DlXHdGwT.js} +1 -1
  113. package/dist/client/assets/{cpu-TtYQqONc.js → cpu-B7xLO7jn.js} +1 -1
  114. package/dist/client/assets/{cynefin-EF2NZ3EQ-CXzvL5Cg.js → cynefin-EF2NZ3EQ-HhP4ArLc.js} +1 -1
  115. package/dist/client/assets/{cynefinDiagram-WF24UDRP-C0wjhu9X.js → cynefinDiagram-WF24UDRP-D4GgWnZV.js} +1 -1
  116. package/dist/client/assets/{dagre-NK4GIZVX-Doi2IPkY.js → dagre-NK4GIZVX-SZ_OI2Zi.js} +1 -1
  117. package/dist/client/assets/{diagram-CBK3MWTC-11TVuPel.js → diagram-CBK3MWTC-BN-_Ja5m.js} +1 -1
  118. package/dist/client/assets/{diagram-I5XIIV2D-CJq7fHFM.js → diagram-I5XIIV2D-t7AK6xnL.js} +1 -1
  119. package/dist/client/assets/{diagram-ODIL2UCW-2Ae6unuU.js → diagram-ODIL2UCW-C1V7szSc.js} +1 -1
  120. package/dist/client/assets/{diagram-PFBEJUXE-BXza6_iz.js → diagram-PFBEJUXE-DPtraQ2g.js} +1 -1
  121. package/dist/client/assets/{diagram-RJA3I4VV-Z0i3uBW9.js → diagram-RJA3I4VV-D2XNRB2b.js} +1 -1
  122. package/dist/client/assets/{diagram-TYUNFSNR-Dq_-g1oP.js → diagram-TYUNFSNR-BieaRy38.js} +1 -1
  123. package/dist/client/assets/{ebnfDiagram-V4P3TTPT-vxzIvg-W.js → ebnfDiagram-V4P3TTPT-Bwki86UY.js} +1 -1
  124. package/dist/client/assets/{elk-QONTBCTQ-BBIXXtg_.js → elk-QONTBCTQ-WEXSAyHB.js} +1 -1
  125. package/dist/client/assets/{empty-state-kISAAp0z.js → empty-state-J-UJ0BUU.js} +1 -1
  126. package/dist/client/assets/{erDiagram-KYQIGQAA-Bk2MeLBx.js → erDiagram-KYQIGQAA-DIKASnoc.js} +1 -1
  127. package/dist/client/assets/{execution-config-DYFe-VNC.js → execution-config-ILQiJAmy.js} +1 -1
  128. package/dist/client/assets/{file-DEt4KgZG.js → file-D40js1Zx.js} +1 -1
  129. package/dist/client/assets/{file-exclamation-point-QqXJhXD9.js → file-exclamation-point-Dg3ZpiAe.js} +1 -1
  130. package/dist/client/assets/{file-text-CRw31ZWd.js → file-text-DgdvRfMk.js} +1 -1
  131. package/dist/client/assets/{find-latest-widget-fence-B3aaiBNI.js → find-latest-widget-fence-D4kBWC_1.js} +1 -1
  132. package/dist/client/assets/{flowDiagram-IUGLLWBU-B53m4r8u.js → flowDiagram-IUGLLWBU-CoavNw0M.js} +1 -1
  133. package/dist/client/assets/{form-Bjhk9zOn.js → form-DlPwEgQH.js} +1 -1
  134. package/dist/client/assets/{format-cron-9tmNIcgl.js → format-cron-BrK8RzgT.js} +1 -1
  135. package/dist/client/assets/{ganttDiagram-R7GPNTJY-CS6TN3R1.js → ganttDiagram-R7GPNTJY-DccKAz7f.js} +1 -1
  136. package/dist/client/assets/{git-branch-DWerghmw.js → git-branch-BpxhecMq.js} +1 -1
  137. package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-D096ZtqE.js → gitGraphDiagram-PDYL7XHY-DEbo_dgQ.js} +1 -1
  138. package/dist/client/assets/{graph-DQpTuPmX.js → graph-DROgI3M3.js} +1 -1
  139. package/dist/client/assets/{heart-CRkjVW7-.js → heart-c7u4Ezxt.js} +1 -1
  140. package/dist/client/assets/{highlighted-body-KPVGNVTW-DoVCXOMU.js → highlighted-body-KPVGNVTW-CrATNdTR.js} +1 -1
  141. package/dist/client/assets/image-lightbox-DE_fHkw-.js +1 -0
  142. package/dist/client/assets/{image-off-VyMBVwgK.js → image-off-BExgZjfM.js} +2 -2
  143. package/dist/client/assets/{index-DgyhdQnI.js → index-2wezsLA_.js} +1 -1
  144. package/dist/client/assets/index-7jby-RRg.js +1 -0
  145. package/dist/client/assets/{index-Czm6C7FZ.js → index-AzyLwYS_.js} +3 -3
  146. package/dist/client/assets/{index-CiVeycsn.js → index-B3eeEDWj.js} +5 -5
  147. package/dist/client/assets/{index-setKr4xl.js → index-BEkYBuOq.js} +1 -1
  148. package/dist/client/assets/index-BGqvci3k.js +1 -0
  149. package/dist/client/assets/{index-DKWpwwxo.js → index-BVqSmajJ.js} +1 -1
  150. package/dist/client/assets/{index-BBcAekWE.js → index-Be0OJLWK.js} +1 -1
  151. package/dist/client/assets/{index-BiFJIg4n.js → index-BizvylBV.js} +1 -1
  152. package/dist/client/assets/{index-n3-zWcH-.js → index-BkoMsjtM.js} +2 -2
  153. package/dist/client/assets/{index-_emDKzsu.js → index-BlyoyIck.js} +1 -1
  154. package/dist/client/assets/{index-C24HfJir.js → index-BqIHtiaE.js} +1 -1
  155. package/dist/client/assets/{index-Cs3WB8yn.js → index-C5or4L_3.js} +1 -1
  156. package/dist/client/assets/{index-igLqtuoO.js → index-C7B3eSOP.js} +1 -1
  157. package/dist/client/assets/{index-COMRALJO.js → index-CD8aw6Jb.js} +1 -1
  158. package/dist/client/assets/{index-CDuYKaGY.js → index-CT_pFeX_.js} +1 -1
  159. package/dist/client/assets/{index-b9p_y2Ql.js → index-CYy1cjtq.js} +1 -1
  160. package/dist/client/assets/{index-Csr_C1sk.js → index-CZmqtJWZ.js} +1 -1
  161. package/dist/client/assets/{index-DBo2XfNv.js → index-CbHCZsbE.js} +1 -1
  162. package/dist/client/assets/{index-BcFMs7lK.js → index-Ccf1XBTs.js} +1 -1
  163. package/dist/client/assets/index-Cga0qx1T.js +1033 -0
  164. package/dist/client/assets/{index-Ctqe81qr.js → index-CqPRAM_6.js} +1 -1
  165. package/dist/client/assets/index-Ct4At33X.js +1 -0
  166. package/dist/client/assets/{index-DN2sTT2U.js → index-D0eJtRlK.js} +1 -1
  167. package/dist/client/assets/{index-C3sW6rkN.js → index-D150FXCC.js} +22 -20
  168. package/dist/client/assets/{index-C6udJCgz.js → index-D3YeRrne.js} +1 -1
  169. package/dist/client/assets/index-DCJQGDZk.js +1 -0
  170. package/dist/client/assets/{index-BpjEclkM.js → index-DDgOoXP1.js} +1 -1
  171. package/dist/client/assets/{index-DmFNztTX.js → index-DINk1YfD.js} +1 -1
  172. package/dist/client/assets/{index-Dgrk2udV.js → index-DITPwUa9.js} +3 -3
  173. package/dist/client/assets/{index-CvhR1oZB.js → index-DNGNMW3c.js} +1 -1
  174. package/dist/client/assets/{index-rCvQat0D.js → index-DT7pv2iW.js} +1 -1
  175. package/dist/client/assets/{index-TnoaFCrj.js → index-DaZ1I8s-.js} +1 -1
  176. package/dist/client/assets/{index-CEVwhauU.js → index-DeRDq7bD.js} +1 -1
  177. package/dist/client/assets/{index-2EaVZrJe.js → index-DhHobJd3.js} +1 -1
  178. package/dist/client/assets/{index-CyGRWyhV.js → index-DksjixUS.js} +1 -1
  179. package/dist/client/assets/{index-C6Fo2htT.js → index-DswGXheF.js} +1 -1
  180. package/dist/client/assets/{index-t3eRSGcT.js → index-DxiRRZRo.js} +1 -1
  181. package/dist/client/assets/index-F-vqXYqa.js +1 -0
  182. package/dist/client/assets/{index-DNzk9m1D.js → index-InEBtYxw.js} +6 -6
  183. package/dist/client/assets/{index-BLkXoquZ.js → index-J3Hh1MnL.js} +1 -1
  184. package/dist/client/assets/{index-gIQ7FrL9.js → index-dyAahqKe.js} +1 -1
  185. package/dist/client/assets/{index-B2rBVMNl.js → index-mwf7ZNk2.js} +1 -1
  186. package/dist/client/assets/{index.esm-bLeQzVWT.js → index.esm-BFJ9SG0n.js} +1 -1
  187. package/dist/client/assets/{infoDiagram-MVDRKAX5-nN_N76Fn.js → infoDiagram-MVDRKAX5-VL8q5pKx.js} +1 -1
  188. package/dist/client/assets/{inline-code-D9bLKHjY.js → inline-code-BE9ckzPs.js} +1 -1
  189. package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-CiLFbWXd.js → ishikawaDiagram-HPEHV2GE-BLKkPYF-.js} +1 -1
  190. package/dist/client/assets/{journeyDiagram-BOSHW7O7-Dn3yOv96.js → journeyDiagram-BOSHW7O7-CSYpRobu.js} +1 -1
  191. package/dist/client/assets/{kanban-definition-FNSA4HC5-JxiBdBQC.js → kanban-definition-FNSA4HC5-HilAqtZo.js} +1 -1
  192. package/dist/client/assets/{layers-DTnLoRvE.js → layers-Cm7coqdo.js} +1 -1
  193. package/dist/client/assets/{lightbulb-CRKLr5q3.js → lightbulb-DqdWS75d.js} +1 -1
  194. package/dist/client/assets/{link-2-hgHg-lyw.js → link-2-CDJapTSa.js} +1 -1
  195. package/dist/client/assets/{list-runtime-types-Bb33QiMC.js → list-runtime-types-CP82p1u4.js} +1 -1
  196. package/dist/client/assets/{markdown-content-D0FpU2cz.js → markdown-content-m_qereFc.js} +1 -1
  197. package/dist/client/assets/{mention-pill-uuaUvwSW.js → mention-pill-DV5HIG5Q.js} +1 -1
  198. package/dist/client/assets/{mermaid.core-x3Hh6iut.js → mermaid.core-zxW6MBr-.js} +4 -4
  199. package/dist/client/assets/{message-square-off-B8N6YF9R.js → message-square-off-YVtpbaJ0.js} +1 -1
  200. package/dist/client/assets/{mindmap-definition-6OY57UG3-D0SEv5Re.js → mindmap-definition-6OY57UG3-IAYemvOg.js} +1 -1
  201. package/dist/client/assets/{more-details-CadxnGyH.js → more-details-ReA2ZFBn.js} +1 -1
  202. package/dist/client/assets/{owner-notice-CJHyha58.js → owner-notice-M4hn_1ep.js} +1 -1
  203. package/dist/client/assets/{package-B8G7jQm-.js → package-CUuTl39E.js} +1 -1
  204. package/dist/client/assets/{page-container-Bb-_N7lw.js → page-container-BnmNikNZ.js} +1 -1
  205. package/dist/client/assets/{paperclip-BDeYGKqh.js → paperclip-C6fYq5Zf.js} +1 -1
  206. package/dist/client/assets/{path-input-BIfexEKz.js → path-input-DHn9-XaE.js} +1 -1
  207. package/dist/client/assets/{pegDiagram-ECIUJNBX-7ivMd0-b.js → pegDiagram-ECIUJNBX-CojaUwe7.js} +1 -1
  208. package/dist/client/assets/{pieDiagram-GNMPY74T-DGDkbFvu.js → pieDiagram-GNMPY74T-CjP3pw6V.js} +1 -1
  209. package/dist/client/assets/{plug-wP1d6OUX.js → plug-DHQcxt7N.js} +1 -1
  210. package/dist/client/assets/primer-trigger-BmV5wjek.js +3 -0
  211. package/dist/client/assets/{profile-errors-C1qSJkiG.js → profile-errors-BSCuj3rT.js} +1 -1
  212. package/dist/client/assets/{progress-DmUieXLn.js → progress-4FQQfnS6.js} +1 -1
  213. package/dist/client/assets/{quadrantDiagram-D57K4MC3-AFQRVSsK.js → quadrantDiagram-D57K4MC3-OP0Z8zcR.js} +1 -1
  214. package/dist/client/assets/{query-error-state--8AnWSSn.js → query-error-state-BkUdxenP.js} +1 -1
  215. package/dist/client/assets/{radio-mkA-Sqe0.js → radio-ta5Bw763.js} +1 -1
  216. package/dist/client/assets/{railroadDiagram-Y72NRBL7-3QBa2d3j.js → railroadDiagram-Y72NRBL7-CT3NCb9b.js} +1 -1
  217. package/dist/client/assets/registry-Dc102rws.js +1 -0
  218. package/dist/client/assets/{relay-trace-schemas-fScydQ3A.js → relay-trace-schemas-DwUuyxao.js} +2 -2
  219. package/dist/client/assets/{requirementDiagram-EQYSW5RA-BVBqcASy.js → requirementDiagram-EQYSW5RA-tde4lYGp.js} +1 -1
  220. package/dist/client/assets/{room-files-source-BhkPUTiP.js → room-files-source-CZWhaaOy.js} +2 -2
  221. package/dist/client/assets/{rotate-ccw-clock-DiuTseKz.js → rotate-ccw-clock-RfbbgUa4.js} +1 -1
  222. package/dist/client/assets/{rotate-cw-DvoxWwSx.js → rotate-cw-B3rB_YSw.js} +1 -1
  223. package/dist/client/assets/{sankeyDiagram-SY24JHO5-DFjfOD38.js → sankeyDiagram-SY24JHO5-sdCzIA7-.js} +1 -1
  224. package/dist/client/assets/{scroll-area-DYyyRqW_.js → scroll-area-B4WB7Q40.js} +1 -1
  225. package/dist/client/assets/{search-x-CA-FzEqZ.js → search-x-DCUmWW2_.js} +1 -1
  226. package/dist/client/assets/{sequenceDiagram-BLEHNHQU-Cr9LzoSF.js → sequenceDiagram-BLEHNHQU-DvzTJcKu.js} +1 -1
  227. package/dist/client/assets/{shield-x-B0W_7qwR.js → shield-x-CANziVLc.js} +1 -1
  228. package/dist/client/assets/signed-in-DctJ2IWe.js +1 -0
  229. package/dist/client/assets/{sizeCapture-INFHLROL-Do_jfNyT.js → sizeCapture-INFHLROL-DuDA7TKE.js} +1 -1
  230. package/dist/client/assets/{soul-file-DgfhKQIK.js → soul-file-Co_8f1qw.js} +1 -1
  231. package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-BCi9yk_0.js → stateDiagram-v2-A6IESKWZ-BJPX5JTC.js} +1 -1
  232. package/dist/client/assets/{swimlanes-B3ENRKFQ-3SSAw2av.js → swimlanes-B3ENRKFQ-CiLSffGv.js} +1 -1
  233. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-Dv1-QS9J.js +8 -0
  234. package/dist/client/assets/{table-DvU_oS4E.js → table-BSAvOYPp.js} +1 -1
  235. package/dist/client/assets/{terminal-Dw2QZ7Dh.js → terminal-6CdY-T1V.js} +1 -1
  236. package/dist/client/assets/{timeline-definition-JXYKGLGB-DTLPXTMA.js → timeline-definition-JXYKGLGB-5oq8sl82.js} +1 -1
  237. package/dist/client/assets/{trust-posture-2MR0ap9o.js → trust-posture-D-Yjm6ot.js} +1 -1
  238. package/dist/client/assets/{unplug-CAVOLB2R.js → unplug-Bq_1WdV7.js} +1 -1
  239. package/dist/client/assets/{unverified-catalog-notice-u4ikVg8J.js → unverified-catalog-notice-CEzu54YH.js} +1 -1
  240. package/dist/client/assets/{use-adapter-catalog-BQKfRxXC.js → use-adapter-catalog-Tn3ZbPAj.js} +1 -1
  241. package/dist/client/assets/{use-bindings-BV6HA0MD.js → use-bindings-Bz9YRgO7.js} +1 -1
  242. package/dist/client/assets/{use-composer-prefs-DCSzOnEO.js → use-composer-prefs-D9oKJSQN.js} +1 -1
  243. package/dist/client/assets/{use-connector-management-fr1tx-GZ.js → use-connector-management-CLYFraXN.js} +1 -1
  244. package/dist/client/assets/{use-deep-link-scroll-v02TbidQ.js → use-deep-link-scroll-DkS713kG.js} +1 -1
  245. package/dist/client/assets/{use-delete-binding-CnziYpXo.js → use-delete-binding-CukKpHBK.js} +1 -1
  246. package/dist/client/assets/{use-dev-links-k4YWFO1v.js → use-dev-links-DQ32IcGe.js} +1 -1
  247. package/dist/client/assets/{use-external-adapter-catalog-DoGUfa2F.js → use-external-adapter-catalog-D-FO_XW6.js} +1 -1
  248. package/dist/client/assets/{use-full-activity-feed-CQNxgxnw.js → use-full-activity-feed-BNxcyb1j.js} +1 -1
  249. package/dist/client/assets/use-is-below-desktop-gTvJDvw4.js +1 -0
  250. package/dist/client/assets/use-is-hub-B1vPpkYU.js +1 -0
  251. package/dist/client/assets/{use-jump-back-in-BuO6A0P7.js → use-jump-back-in-Bibj5tVk.js} +3 -3
  252. package/dist/client/assets/{use-local-browser-BNzN5O1P.js → use-local-browser-xg7WXAVK.js} +1 -1
  253. package/dist/client/assets/{use-mesh-topology-CpIDE8lD.js → use-mesh-topology-BgCSFw8s.js} +1 -1
  254. package/dist/client/assets/{use-mounted-ref-BAO3qunF.js → use-mounted-ref-qRbdZfOU.js} +1 -1
  255. package/dist/client/assets/{use-notification-prefs-CtqeH5Pk.js → use-notification-prefs-B-4kZR7I.js} +1 -1
  256. package/dist/client/assets/{use-panel-tab-placements-DFobGBRm.js → use-panel-tab-placements-CCq-mZlY.js} +1 -1
  257. package/dist/client/assets/use-pending-read-C8L_v4Zw.js +1 -0
  258. package/dist/client/assets/{use-personality-commit-BvqCwzAC.js → use-personality-commit-DwSisUfF.js} +1 -1
  259. package/dist/client/assets/{use-promo-activation-Dz5cYm-X.js → use-promo-activation-Botoso6l.js} +3 -3
  260. package/dist/client/assets/{use-promo-dismissals-CuOsnqnZ.js → use-promo-dismissals-RJXp-r_J.js} +1 -1
  261. package/dist/client/assets/{use-pulse-freshness-qcTH6PM7.js → use-pulse-freshness-B3390hGg.js} +1 -1
  262. package/dist/client/assets/{use-relay-config-1mAMDNbc.js → use-relay-config-BV0xcLwS.js} +1 -1
  263. package/dist/client/assets/{use-room-follow-claim-CCGhsyH3.js → use-room-follow-claim-Du4hKHIJ.js} +1 -1
  264. package/dist/client/assets/{use-roving-tab-list-Bsg2dfUx.js → use-roving-tab-list-g2hO6Ruz.js} +1 -1
  265. package/dist/client/assets/{use-session-canvas-awPngMKg.js → use-session-canvas-i30oMO_Q.js} +3 -3
  266. package/dist/client/assets/{use-session-diagnostics-D5g8Mc52.js → use-session-diagnostics-a4b83F5J.js} +2 -2
  267. package/dist/client/assets/{use-unclaimed-chats-Db_wuzt0.js → use-unclaimed-chats-B92om889.js} +1 -1
  268. package/dist/client/assets/use-update-config-Tbn3SodN.js +1 -0
  269. package/dist/client/assets/{useMutationState-BvwBDXKc.js → useMutationState-DdOGdpjP.js} +1 -1
  270. package/dist/client/assets/{usecaseDiagram-WPOLBNNX-1zKygEKR.js → usecaseDiagram-WPOLBNNX-Di5pJvcw.js} +1 -1
  271. package/dist/client/assets/{vennDiagram-Q3Y3IDCW-BR2EbgGY.js → vennDiagram-Q3Y3IDCW-K7KAf26T.js} +1 -1
  272. package/dist/client/assets/{wardleyDiagram-IVAIDKWA-D0OwouJc.js → wardleyDiagram-IVAIDKWA-DVTaxQt9.js} +1 -1
  273. package/dist/client/assets/{xychartDiagram-4URNHDU4-BM-7_FQQ.js → xychartDiagram-4URNHDU4-x-lSJm_B.js} +1 -1
  274. package/dist/client/index.html +1 -1
  275. package/dist/drizzle/20261018210140_remote_command_agent_computer_kind.sql +21 -0
  276. package/dist/drizzle/20261019142317_turn_marks.sql +3 -0
  277. package/dist/drizzle/meta/20261018210140_snapshot.json +14027 -0
  278. package/dist/drizzle/meta/20261019142317_snapshot.json +14048 -0
  279. package/dist/drizzle/meta/_journal.json +14 -0
  280. package/dist/server/index.js +23779 -20674
  281. package/dist/server/index.js.map +2 -2
  282. package/package.json +4 -4
  283. package/dist/client/assets/HandlePage-BKiqymRF.js +0 -1
  284. package/dist/client/assets/McpSigninBody-COIHpHq_.js +0 -1
  285. package/dist/client/assets/NamePage-D7W6VMYd.js +0 -1
  286. package/dist/client/assets/OperatorIdentityForm-C3op6BIC.js +0 -1
  287. package/dist/client/assets/PermissionHistory-CKebTVkq.js +0 -1
  288. package/dist/client/assets/PhotoPage-Ch1at4A6.js +0 -1
  289. package/dist/client/assets/SettingsDialog-Bdws5dbS.js +0 -12
  290. package/dist/client/assets/TaskDialogWrapper-CTcW70s8.js +0 -1
  291. package/dist/client/assets/ToolsPage-D5-fx1EA.js +0 -2
  292. package/dist/client/assets/_shell-BLTSXXDw.js +0 -80
  293. package/dist/client/assets/_shell.channels-D_GQU4RB.js +0 -10
  294. package/dist/client/assets/_shell.connections-DZrlxs4G.js +0 -1
  295. package/dist/client/assets/_shell.marketplace-CZxkAmFz.js +0 -1
  296. package/dist/client/assets/_shell.marketplace_.sources-Q0BTQIuE.js +0 -1
  297. package/dist/client/assets/_shell.session-DvGL0DoX.js +0 -63
  298. package/dist/client/assets/_shell.x._extensionId-B6Tm5KuT.js +0 -1
  299. package/dist/client/assets/_shell.x._extensionId_._-B6Tm5KuT.js +0 -1
  300. package/dist/client/assets/channel-CGffcDRq.js +0 -1
  301. package/dist/client/assets/image-lightbox-BXzbN27o.js +0 -1
  302. package/dist/client/assets/index-1qv8ldHx.js +0 -1
  303. package/dist/client/assets/index-8-iQ6PnT.js +0 -1028
  304. package/dist/client/assets/index-BFitbVs4.js +0 -1
  305. package/dist/client/assets/index-CI84yP-g.js +0 -1
  306. package/dist/client/assets/index-D5zUdnZM.js +0 -1
  307. package/dist/client/assets/index-DX_2Mxwv.js +0 -1
  308. package/dist/client/assets/primer-trigger-CEli_z4n.js +0 -3
  309. package/dist/client/assets/registry-Bnd-HFt3.js +0 -1
  310. package/dist/client/assets/shield-check-CpUB_Ju1.js +0 -6
  311. package/dist/client/assets/signed-in-X2utDqQS.js +0 -1
  312. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-jpZCGfva.js +0 -8
  313. package/dist/client/assets/use-is-below-desktop-DR8FEbRW.js +0 -1
  314. package/dist/client/assets/use-is-hub-BmpgFnFp.js +0 -1
  315. package/dist/client/assets/use-pending-read-Do0_vZ2I.js +0 -1
  316. package/dist/client/assets/use-update-config-DwtH_H9Z.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CiVeycsn.js","assets/index-8-iQ6PnT.js","assets/index-DUZrTFYD.css","assets/room-files-source-BhkPUTiP.js","assets/markdown-content-D0FpU2cz.js","assets/file-exclamation-point-QqXJhXD9.js","assets/query-keys-DeYqUDia.js","assets/composer-insert-BpyATrmR.js","assets/index-gIQ7FrL9.js","assets/file-drag-GDx2qhdk.js","assets/rotate-cw-DvoxWwSx.js","assets/link-2-hgHg-lyw.js","assets/file-DEt4KgZG.js","assets/git-branch-DWerghmw.js","assets/more-details-CadxnGyH.js"])))=>i.map(i=>d[i]);
2
- import{W as Z,r as i,mR as qt,j as a,g as Ut,ic as Wt,G as V,a1 as ne,a2 as Kt,bk as ee,a4 as re,a3 as Se,mS as Gt,mT as ye,mU as Be,mV as Vt,mW as Xt,mX as Yt,lI as Qt,mY as Jt,lK as Zt,mZ as en,dz as tn,g8 as nn,mO as sn,m_ as on,a0 as rn,bw as an,m$ as ln,n0 as dn,iI as cn,hF as un,ir as X,kx as qe,n1 as ot,bK as mn,kw as le,kB as rt,n2 as fn,kC as at,ai as pn,bO as it,hA as lt,B as Ae,x as hn,n3 as gn,c4 as Me,n4 as xn,s as ce,ep as yn,jW as dt,n5 as ct,aX as bn,e as se,n6 as he,hb as ut,kA as mt,n7 as vn,n8 as kn,n as Rn,q as Re,kz as wn,n9 as ft,eN as te,a7 as pt,fm as In,na as Nn,nb as jn,nc as Sn,nd as An,l as ht,ar as Ce,kk as Mn,aj as Cn,ne as On,nf as Tn,ng as _n,b6 as En,bW as Pn,nh as $n,ni as Dn,nj as Fn,nk as Ln,bx as we,dH as zn,kq as Hn,kv as Bn,ko as qn,nl as Un,nm as Wn,nn as Kn,no as Gn,eM as Vn,kr as Xn,np as Yn,nq as Qn,nr as Jn,dM as Zn,X as es,ns as ts,nt as Ue,nu as ns,ad as ss,nv as os,iq as rs,nw as as,nx as is,aH as We}from"./index-8-iQ6PnT.js";import{R as ls,A as ds,u as cs,P as us,a as ms}from"./use-jump-back-in-BuO6A0P7.js";import{a as Ke,m as Ge,f as Oe,b as Te,d as gt,e as xt,g as yt,E as fs,h as ps,i as hs,M as G,F as gs,D as xs,U as ys,C as Q,u as bs,j as vs,k as ks,l as Rs}from"./index-DNzk9m1D.js";import{a as ws}from"./use-room-follow-claim-CCGhsyH3.js";import"./WidgetErrorCard-BfgGzyqg.js";import{M as Is}from"./markdown-content-D0FpU2cz.js";import{W as Ns,a as js}from"./find-latest-widget-fence-B3aaiBNI.js";import{f as Ss}from"./format-duration-BCr6uzby.js";import{H as As,a as Ms,b as Cs}from"./RuntimeSetupDialog-COpyPrqL.js";import{M as Ve}from"./mention-pill-uuaUvwSW.js";import{R as Os}from"./rotate-ccw-clock-DiuTseKz.js";import{U as Ts}from"./unplug-CAVOLB2R.js";import{M as _s}from"./message-square-off-B8N6YF9R.js";import{i as Es}from"./registry-Bnd-HFt3.js";import{f as Ps}from"./use-connector-management-fr1tx-GZ.js";import{A as $s}from"./AgentRequestCard-DQ6GYoeE.js";/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B3eeEDWj.js","assets/index-Cga0qx1T.js","assets/index-DUZrTFYD.css","assets/room-files-source-CZWhaaOy.js","assets/markdown-content-m_qereFc.js","assets/file-exclamation-point-Dg3ZpiAe.js","assets/query-keys-DeYqUDia.js","assets/composer-insert-BpyATrmR.js","assets/index-dyAahqKe.js","assets/file-drag-GDx2qhdk.js","assets/rotate-cw-B3rB_YSw.js","assets/link-2-CDJapTSa.js","assets/file-D40js1Zx.js","assets/git-branch-BpxhecMq.js","assets/more-details-ReA2ZFBn.js"])))=>i.map(i=>d[i]);
2
+ import{W as Z,r as i,m_ as Ut,j as a,g as qt,ii as Wt,G as V,a1 as ne,a2 as Kt,bk as ee,a4 as re,a3 as Se,m$ as Gt,n0 as ye,n1 as He,n2 as Vt,n3 as Xt,n4 as Yt,lR as Qt,n5 as Jt,lT as Zt,n6 as en,dB as tn,gb as nn,mX as sn,n7 as on,a0 as rn,bw as an,n8 as ln,n9 as dn,iN as cn,hK as un,iw as X,kG as Ue,na as ot,bK as mn,kF as le,kK as rt,nb as fn,kL as at,ai as pn,bO as it,hF as lt,B as Ae,x as hn,nc as gn,c6 as Ce,nd as xn,s as ce,es as yn,jw as dt,ne as ct,aX as bn,e as se,nf as he,hf as ut,kJ as mt,ng as vn,nh as kn,n as Rn,q as Re,kI as wn,ni as ft,eQ as te,a7 as pt,fp as In,nj as Nn,nk as jn,nl as Sn,nm as An,l as ht,ar as Me,kt as Cn,aj as Mn,nn as On,no as Tn,np as _n,b6 as En,bW as Pn,nq as $n,nr as Dn,ns as Fn,nt as Ln,bx as we,dJ as zn,kz as Bn,kE as Hn,kx as Un,nu as qn,nv as Wn,nw as Kn,nx as Gn,eP as Vn,kA as Xn,ny as Yn,nz as Qn,nA as Jn,dO as Zn,X as es,nB as ts,nC as qe,nD as ns,ad as ss,nE as os,iv as rs,nF as as,nG as is,aH as We}from"./index-Cga0qx1T.js";import{R as ls,A as ds,u as cs,P as us,a as ms}from"./use-jump-back-in-Bibj5tVk.js";import{a as Ke,m as Ge,f as Oe,b as Te,d as gt,e as xt,g as yt,E as fs,h as ps,i as hs,M as G,F as gs,D as xs,U as ys,C as Q,u as bs,j as vs,k as ks,l as Rs}from"./index-InEBtYxw.js";import{a as ws}from"./use-room-follow-claim-Du4hKHIJ.js";import"./WidgetErrorCard-cS8yMCxU.js";import{M as Is}from"./markdown-content-m_qereFc.js";import{W as Ns,a as js}from"./find-latest-widget-fence-D4kBWC_1.js";import{f as Ss}from"./format-duration-BCr6uzby.js";import{H as As,a as Cs,b as Ms}from"./RuntimeSetupDialog-Cr4GRi8c.js";import{M as Ve}from"./mention-pill-DV5HIG5Q.js";import{R as Os}from"./rotate-ccw-clock-RfbbgUa4.js";import{U as Ts}from"./unplug-Bq_1WdV7.js";import{M as _s}from"./message-square-off-YVtpbaJ0.js";import{i as Es}from"./registry-Dc102rws.js";import{f as Ps}from"./use-connector-management-CLYFraXN.js";import{A as $s}from"./AgentRequestCard-0fOxvaoe.js";/**
3
3
  * @license lucide-react v1.48.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
@@ -24,12 +24,12 @@ import{W as Z,r as i,mR as qt,j as a,g as Ut,ic as Wt,G as V,a1 as ne,a2 as Kt,b
24
24
  *
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
- */const wt={name:"reply",size:24,node:[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]};wt.node;const Hs=Z(wt);/**
27
+ */const wt={name:"reply",size:24,node:[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]};wt.node;const Bs=Z(wt);/**
28
28
  * @license lucide-react v1.48.0 - ISC
29
29
  *
30
30
  * This source code is licensed under the ISC license.
31
31
  * See the LICENSE file in the root directory of this source tree.
32
- */const It={name:"timer",size:24,node:[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]};It.node;const Bs=Z(It);/**
32
+ */const It={name:"timer",size:24,node:[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]};It.node;const Hs=Z(It);/**
33
33
  * @license lucide-react v1.48.0 - ISC
34
34
  *
35
35
  * This source code is licensed under the ISC license.
@@ -39,6 +39,6 @@ import{W as Z,r as i,mR as qt,j as a,g as Ut,ic as Wt,G as V,a1 as ne,a2 as Kt,b
39
39
  *
40
40
  * This source code is licensed under the ISC license.
41
41
  * See the LICENSE file in the root directory of this source tree.
42
- */const jt={name:"user-x",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]};jt.node;const qs=Z(jt),Us=300;function ae({className:e,children:n}){return a.jsx("span",{className:V("bg-muted text-muted-foreground text-2xs inline-flex max-w-full items-center gap-1 truncate rounded-full px-2 py-0.5",e),children:n})}function St({identity:e,children:n,onViewProfile:s,className:t}){const{kind:o,displayName:r,handle:l,color:d,emoji:m,imageUrl:f,origin:u,agent:c}=e,w=d??"hsl(var(--muted-foreground))",h=typeof u=="object"&&u!==null,g=o==="agent"&&(c==null?void 0:c.working)!=null?c.working:null,[k,x]=i.useState(!1),N=i.useRef(!1),p=i.useRef(null),b=qt({onLongPress:()=>{N.current&&x(!0)}});return a.jsxs(As,{open:k,onOpenChange:x,openDelay:Us,children:[a.jsx(Ms,{asChild:!0,ref:p,"data-gesture-priority":"",...b,onPointerDown:_=>{N.current=_.pointerType==="touch"||_.pointerType==="pen",b.onPointerDown(_)},children:n}),a.jsxs(Cs,{"data-slot":"identity-hover-card",align:"start",className:V("flex w-64 flex-col gap-0 overflow-hidden p-0",t),children:[a.jsxs("div",{className:"flex items-center gap-3 p-3",children:[a.jsx(Ut,{"aria-hidden":!0,color:w,emoji:m,imageUrl:f,fallback:Wt(r),kind:o,origin:u,status:g?"working":"idle",size:"md"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-foreground truncate text-sm font-semibold",children:r}),l&&a.jsxs("p",{className:"text-muted-foreground truncate text-xs font-medium",children:["@",l]})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1.5 px-3 pb-3 empty:hidden",children:[o==="agent"&&((c==null?void 0:c.runtime)||(c==null?void 0:c.model))&&a.jsx(ae,{children:[c.runtime,c.model].filter(Boolean).join(" · ")}),g&&a.jsxs(ae,{className:"bg-status-success-bg text-status-success-fg",children:["Working · ",Ss(g.forMs)]}),o==="human"&&a.jsx(ae,{children:h?u.platform:"On this machine"}),o==="agent"&&(c==null?void 0:c.managedBy)&&a.jsxs(ae,{children:["Managed by"," ",c.managedBy.handle?`@${c.managedBy.handle}`:c.managedBy.displayName]})]}),s?a.jsx("button",{type:"button","data-slot":"identity-hover-card-profile",onClick:()=>{var _;(_=p.current)==null||_.focus(),s()},className:"border-border hover:bg-accent focus-visible:ring-ring text-brand-text mt-auto flex w-full items-center border-t px-3 py-2 text-left text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none",children:"View profile"}):a.jsxs("div",{className:"border-border mt-auto flex items-center justify-between border-t px-3 py-2",children:[a.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:"View profile"}),a.jsx("span",{className:"text-muted-foreground text-3xs tracking-wide uppercase",children:"soon"})]})]})]})}function At(e,n={}){const s=ne();return Kt({queryKey:ee.sessions(e??""),queryFn:()=>s.listRoomSessions(e),enabled:e!==null&&n.enabled===!0})}function Ws(){const e=ne();return re({mutationFn:({roomId:n,authorId:s})=>e.haltRoomAgent(n,s),meta:{errorLabel:"Couldn’t stop this agent"}})}function Ks(){const e=ne();return re({mutationFn:({roomId:n,authorId:s})=>e.promoteHold(n,s),meta:{errorLabel:"Couldn’t ask to be answered first"}})}function Gs(){const e=ne(),n=Se();return re({onMutate:({roomId:s,entryId:t,emoji:o,viewerAuthorId:r})=>{var u;const l=n.getQueryData(ee.entries(s)),d=(u=l==null?void 0:l.find(c=>c.id===t))==null?void 0:u.reactions,{reactions:m,on:f}=Ke(d,o,r);return n.setQueryData(ee.entries(s),c=>Ge(c,t,m)),{on:f}},mutationFn:({roomId:s,entryId:t,emoji:o,viewerAuthorId:r})=>{var m,f;const l=n.getQueryData(ee.entries(s)),d=((f=(m=l==null?void 0:l.find(u=>u.id===t))==null?void 0:m.reactions)==null?void 0:f.some(u=>u.emoji===o&&u.authorIds.includes(r)))??!1;return e.toggleReaction(s,t,{emoji:o,on:d})},onError:(s,{roomId:t,entryId:o,emoji:r,viewerAuthorId:l},d)=>{d!==void 0&&n.setQueryData(ee.entries(t),m=>{var c;const f=(c=m==null?void 0:m.find(w=>w.id===o))==null?void 0:c.reactions,{reactions:u}=Ke(f,r,l,!d.on);return Ge(m,o,u)})},onSuccess:({frequents:s},{roomId:t})=>{n.setQueryData(ee.detail(t),o=>o&&{...o,reactionFrequents:s})},meta:{errorLabel:"Couldn’t add your reaction",errorToastId:"room-reaction"}})}function J(e){return e.threadRootEntryId??e.parentEntryId}function Mt(e){return J(e)??e.id}function _e(e,n){return Math.max(n??0,e)}function Vs(e,n,s){let t=e[0],o=0;for(const r of e)r.seq>t.seq&&(t=r),n!==null&&r.seq>n&&(o+=1);return{count:_e(e.length,s),lastAt:t.createdAt,unread:o}}function Xs(e){const n=ne(),s=Se(),t=Gt(e),o=ye(u=>{var c;return e===null?null:((c=u.paging[e])==null?void 0:c.cursor)??null}),r=re({mutationFn:async u=>{var x;const c=(x=ye.getState().paging[u])==null?void 0:x.cursor;if(c==null)return;const w=await n.listRoomEntries(u,{before:c,limit:Be}),h=ee.entries(u),g=s.getQueryData(h),k=Vt(g,w);s.setQueryData(h,k),ye.getState().notePage(u,Xt(w)??c,Yt(w,Be)||k.length===((g==null?void 0:g.length)??0))},meta:{errorLabel:"Couldn't load older messages"}}),{mutateAsync:l,isPending:d}=r,m=i.useRef(!1),f=i.useCallback(async()=>{if(!(e===null||m.current)){m.current=!0;try{await l(e).catch(()=>{})}finally{m.current=!1}}},[e,l]);return{canLoadOlder:t,isLoadingOlder:d,cursor:o,loadOlder:f}}function Ys(e){return a.jsx(js,{code:e.code,isIncomplete:e.isIncomplete})}const Qs=[{language:Ns,component:Ys}],Js={turn_failed:{Icon:rn,tone:"text-status-warning"},agent_busy:{Icon:on},agent_gone:{Icon:qs,tone:"text-status-warning"},agent_left:{Icon:Xe,tone:"text-status-warning"},room_archived:{Icon:sn},runtime_gone:{Icon:zs,tone:"text-status-warning"},agent_paused:{Icon:nn},agent_declined:{Icon:_s},agent_unavailable:{Icon:tn},awaiting_approval:{Icon:Ds,tone:"text-status-warning"},halted:{Icon:en},budget_reached:{Icon:Zt},cascade_stopped:{Icon:Jt},addressing_changed:{Icon:Ls},bridge_blocked:{Icon:Ts,tone:"text-status-warning"},bridge_undelivered:{Icon:Qt,tone:"text-status-warning"},bridge_rate_limited:{Icon:Bs},bridge_second_agent_refused:{Icon:Xe},bridge_disconnected:{Icon:Fs},bridge_agent_swapped:{Icon:ls},bridge_history_note:{Icon:Os}},Zs={Icon:an},be=80;function eo(e){const n=e.trim();if(n.length<=be)return n;const s=n.slice(0,be),t=s.lastIndexOf(" ");return`${(t>be/2?s.slice(0,t):s).trimEnd()}…`}function to(e,n,s){const t=no(e,s),o=r=>a.jsx("a",{href:n.href,onClick:n.onOpen,"data-testid":"room-notice-session-link",className:"focus-ring hover:text-foreground rounded py-2 font-medium underline underline-offset-2",children:r});return t===null?a.jsxs(a.Fragment,{children:[e," ",o("Open chat")]}):a.jsxs(a.Fragment,{children:[e.slice(0,t.index),o(t.words),e.slice(t.index+t.words.length)]})}function no(e,n){if(n!==void 0){const t=ln(n),o=e.lastIndexOf(t);if(o!==-1)return{index:o,words:t}}const s=dn.exec(e);return s===null?null:{index:s.index,words:s[0]}}function so({entry:e,feedPosition:n,rowId:s,sessionLink:t,subjectName:o}){const{Icon:r,tone:l}=(e.body.notice&&Js[e.body.notice])??Zs;return a.jsxs("p",{id:s,"data-slot":"notice-row","data-testid":"room-notice","data-notice":e.body.notice??"unknown",...n&&{role:"article","aria-label":eo(e.body.text)},...Oe(n),className:V("focus-visible:ring-ring flex items-start gap-2 px-[var(--msg-padding-x)] py-2 text-xs outline-none focus-visible:ring-2",l??"text-muted-foreground"),children:[a.jsx(r,{"aria-hidden":!0,className:"mt-px size-3.5 shrink-0"}),a.jsx("span",{children:t?to(e.body.text,t,o):e.body.text})]})}const oo=Es.moment;function ro({entry:e,moment:n,subject:s,subjectIdentity:t,feedPosition:o,rowId:r}){const l=Te(e.createdAt);return a.jsx("div",{id:r,"data-slot":"moment-row","data-testid":"room-moment","data-moment":n.kind,role:"article","aria-label":`Moment: ${e.body.text}`,...Oe(o),className:"focus-visible:ring-ring px-[var(--msg-padding-x)] py-1 outline-none focus-visible:ring-2",children:a.jsxs("div",{className:"border-border/60 bg-muted/40 flex items-center gap-2.5 rounded-lg border px-3 py-2",children:[a.jsx(St,{identity:{kind:s.kind,displayName:s.displayName,handle:t==null?void 0:t.handle,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl,origin:t==null?void 0:t.origin,agent:t==null?void 0:t.agent},children:a.jsxs("span",{"data-testid":"room-moment-identity",className:"flex shrink-0 items-center",children:[a.jsx(gt,{author:s}),a.jsx("span",{className:"sr-only",children:s.displayName})]})}),a.jsx(oo,{"data-testid":"room-moment-mark","aria-hidden":!0,className:"text-muted-foreground size-3.5 shrink-0"}),a.jsx("p",{className:"min-w-0 flex-1 text-sm",children:e.body.text}),l.length>0&&a.jsx("time",{dateTime:e.createdAt,title:xt(e.createdAt),className:"text-msg-timestamp shrink-0 text-xs",children:l})]})})}function ao({id:e,summary:n,open:s,onOpen:t}){const{capabilities:o}=yt(),{count:r,lastAt:l,unread:d}=n,m=Te(l),[f,u]=i.useState({count:r,bumped:!1});f.count!==r&&u({count:r,bumped:!0});const c=f.count===r&&f.bumped;return o.threads?a.jsxs("button",{type:"button",id:e,"data-slot":"thread-reply-row","data-testid":"room-thread-replies","data-unread":d>0?"":void 0,"aria-expanded":s,onClick:t,className:V("focus-ring ml-[calc(var(--msg-padding-x)_+_var(--msg-gutter-width)_+_var(--msg-gap))]","mb-1 w-fit rounded text-left text-xs transition-colors","px-2 py-2 md:px-1 md:py-0.5",d>0?"text-primary hover:text-primary/80 font-medium":"text-muted-foreground hover:text-foreground"),children:[a.jsx("span",{"aria-hidden":!0,className:"mr-1",children:"↳"}),a.jsx("span",{className:V(c&&"motion-safe:animate-count-flip"),"data-testid":"room-thread-reply-count",children:r},r),r===1?" reply":" replies",m.length>0&&a.jsxs(a.Fragment,{children:[" · last ",a.jsx("time",{dateTime:l,title:xt(l),children:m})]}),d>0&&` · ${d} new`]}):null}function io(e,n){const s=le.getState(),t=s.drafts[e]??"",o=t===""||t.endsWith(" ")||t.endsWith(`
43
- `)?"":" ";s.set(e,`${t}${o}@${n} `)}function lo({roomId:e,entry:n,author:s,viewerAuthorId:t,onViewProfile:o}){const r=Mt(n),l=n.body.text,d=(s==null?void 0:s.id)===t?void 0:(s==null?void 0:s.handle)??void 0,m=s==null?void 0:s.displayName,{copy:f}=cn({toastOnSettle:!0});return i.useMemo(()=>{const u={reply:{id:"reply",label:"Reply in thread",icon:Hs,run:()=>{X.getState().openThread(e,r,!0),qe.getState().requestFocus(ot(e,r))}},copy:{id:"copy",label:"Copy text",icon:un,run:()=>void f(l)}};return o!==void 0&&(u.profile={id:"profile",label:"View profile",icon:mn,run:o}),d!==void 0&&(u.mention={id:"mention",label:m===void 0?"Mention author":`Mention ${m}`,icon:ds,run:()=>{io(e,d),qe.getState().requestFocus(e)}}),fs.map(c=>u[c]).filter(c=>c!==void 0)},[e,r,l,d,m,o,f])}function co(e){if(e.kind==="notice")return{kind:"notice"};const n=e.body.moment;return n?{kind:"moment",moment:n}:{kind:"message"}}function Ee(e,n=[]){return new Map([...n.map(s=>[s.author.id,{...s.author,origin:s.origin}]),...e.map(s=>[s.author.id,{...s.author,origin:s.origin}])])}function ue(e,n){const s=e.body.subjectAuthorId;return s===void 0||n.has(e.authorId)?e.authorId:s}function Y(e,n,s){const t=n.get(e),o=rt({record:{kind:(t==null?void 0:t.kind)??"system",id:e,displayName:(t==null?void 0:t.displayName)??"Unknown",emoji:t==null?void 0:t.emoji,color:t==null?void 0:t.color,imageUrl:t==null?void 0:t.imageUrl},override:(t==null?void 0:t.agentRef)===void 0?null:s==null?void 0:s.get(t.agentRef)});return{kind:o.kind,id:e,displayName:(t==null?void 0:t.displayName)??"Unknown",emoji:o.emoji,imageUrl:o.imageUrl,color:o.color,isExternal:typeof(t==null?void 0:t.origin)=="object"&&(t==null?void 0:t.origin)!==null,...(t==null?void 0:t.retired)===!0?{retired:!0}:{}}}function uo(e){const n=new Set;for(const r of e)J(r)===null&&n.add(r.id);const s=[],t=new Map,o=new Set;for(const r of e){const l=J(r);if(l===null){s.push(r);continue}if(!n.has(l)){s.push(r),o.add(r.id);continue}const d=t.get(l);d?d.push(r):t.set(l,[r])}return{topLevel:s,repliesByRoot:t,orphaned:o}}function Ct(e){return`thread-${e}`}function me(e){return`thread-row-${e}`}function Ie(e){return`thread-panel-entry-${e}`}function fe(e){return`room-entry-${e}`}function Pe(e,n){const s=e.find(d=>d.id===n);if(s===void 0)return null;const t=J(s)??null,o={rowId:n,domId:fe(n)};if(t===null)return o;const r=e.find(d=>d.id===t);return r!==void 0&&(J(r)??null)===null?{rowId:Ct(t),domId:me(t)}:o}function mo(e,n){if(n===null)return null;const s=e.find(t=>t.seq===n);return s===void 0?null:Pe(e,s.id)}const Ye=48;function Ot(e,n,s){const t=e.body.answersEntryId;if(t===void 0||t===e.id||n!==void 0&&n.id===t)return null;const o=s(t);if(o===void 0)return null;const r=o.body.text.replace(/\s+/gu," ").trim();return r.length===0?null:{entryId:t,excerpt:r.length>Ye?`${r.slice(0,Ye).trimEnd()}…`:r}}function fo(e,n){const s=new Map;for(const t of e){const o=n[t.projectPath];if(!o)continue;const r=fn({runtime:o.runtime,model:o.model});s.set(at(t.projectPath),{memberId:t.id,visual:pn(o),runtime:r.label,...r.modelLabel!==null&&{model:r.modelLabel}})}return s}function po(e){const n=new Map;for(const[s,t]of e)n.set(s,t.visual);return n}const ho={info:new Map,faces:new Map},$e=i.createContext(ho);function Tt({known:e,children:n}){return a.jsx($e.Provider,{value:e,children:n})}function De(){const e=it(),n=i.useMemo(()=>{var l;return((l=e.data)==null?void 0:l.agents)??[]},[e.data]),s=i.useMemo(()=>n.map(l=>l.projectPath),[n]),t=lt(s),o=i.useMemo(()=>fo(n,t.data??{}),[n,t.data]),r=i.useMemo(()=>po(o),[o]);return i.useMemo(()=>({info:o,faces:r}),[o,r])}function Ne(e){const n=i.useContext($e);return e===void 0?void 0:n.info.get(e)}function go(){return i.useContext($e).faces}function xo({loading:e,onLoad:n}){return a.jsx("div",{className:"flex justify-center px-4 py-3",children:a.jsxs(Ae,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:e,"data-testid":"room-load-older",className:"text-muted-foreground hover:text-foreground h-7 gap-2 text-xs",children:[e&&a.jsx(hn,{size:"xs"}),e?"Loading older messages…":"Older messages"]})})}function yo({showAuthorHeader:e,headerId:n,displayName:s,time:t,summary:o,contentId:r,summaryId:l,feedPosition:d}){return{...e?{"aria-labelledby":n}:{"aria-label":t.length>0?`${s}, ${t}`:s},"aria-describedby":o===null?r:l,...Oe(d)}}const de=120,bo="code block";function vo(e){if(e.length<=de&&!e.includes("```"))return null;const n=ko(e);return n.length===0?null:n}function ko(e){const n=e.replace(/```[\s\S]*?(?:```|$)/g,` ${bo} `).replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+)/gm,"").replace(/^\s{0,3}\|?[\s:|-]*\|[\s:|-]*$/gm," ").replace(/\|/g," ").replace(/[*_~]{1,3}/g,"").replace(/\s+/g," ").trim();if(n.length<=de)return n;const s=Ro(n,de),t=s.lastIndexOf(" ");return`${(t>de/2?s.slice(0,t):s).trimEnd()}…`}function Ro(e,n){if(typeof Intl.Segmenter=="function"){const t=new Intl.Segmenter(void 0,{granularity:"grapheme"});let o="";for(const{segment:r}of t.segment(e)){if(o.length+r.length>n)break;o+=r}return o}let s="";for(const t of e){if(s.length+t.length>n)break;s+=t}return s}function wo({roomId:e,entry:n,viewerAuthorId:s,reactionFrequents:t,streamStalled:o,isMember:r=!0}){const l=Gs(),d=o===!0||!r,m=i.useMemo(()=>n.reactions??[],[n.reactions]),f=i.useMemo(()=>m.filter(w=>ps(w,s)).map(w=>w.emoji),[m,s]),u=i.useCallback(w=>l.mutate({roomId:e,entryId:n.id,emoji:w,viewerAuthorId:s}),[l,e,n.id,s]),c=i.useMemo(()=>({quick:t,mine:f,onToggle:u,disabled:d}),[t,f,u,d]);return{reactions:m,toggle:u,quickRow:c}}function Io({barRef:e,pillsRef:n,hasReactions:s}){return t=>{var r,l;if(t.target!==t.currentTarget)return;const{key:o}=t;if(o==="ArrowDown"&&s){t.preventDefault(),(r=n.current)==null||r.focusFirst();return}o!=="ArrowRight"&&o!=="Enter"||(t.preventDefault(),(l=e.current)==null||l.focusFirst())}}function No(e,n){var c,w;const s=n.body.subjectAuthorId,t=n.body.notice,o=n.kind==="notice"&&t!==void 0&&s!==void 0&&gn.includes(t),r=At(e,{enabled:o}),l=Me(),d=Se(),m=ne(),f=o?((w=(c=r.data)==null?void 0:c.bindings.find(h=>h.authorId===s))==null?void 0:w.sessionId)??null:null,u=i.useCallback(h=>{h.button!==0||h.metaKey||h.ctrlKey||h.shiftKey||h.altKey||(h.preventDefault(),!(f===null||s===void 0)&&xn({queryClient:d,transport:m},e,s).then(g=>{g.kind!=="none"&&l(ce({session:g.kind==="bound"?g.sessionId:f}))}))},[s,l,d,e,f,m]);return i.useMemo(()=>f===null?null:{href:yn({session:f}),onOpen:u},[u,f])}const pe="mention",Fe="author_id",jo={[pe]:[Fe]},So=[pe];function Ao(e,n){if(!n||n.length===0)return e;const s=Mo(e,n);if(s.length===0)return e;let t=e;for(let o=s.length-1;o>=0;o--){const{offset:r,length:l,authorId:d}=s[o],m=t.slice(0,r),f=t.slice(r,r+l),u=t.slice(r+l);t=`${m}<${pe} ${Fe}="${d}">${f}</${pe}>${u}`}return t}function Mo(e,n){const s=[...n].sort((r,l)=>r.offset-l.offset),t=[];let o=0;for(const r of s)r.offset<o||r.offset+r.length>e.length||(t.push(r),o=r.offset+r.length);return t}const Co=new Map,_t=i.createContext(Co);function Oo({authors:e,children:n}){return a.jsx(_t.Provider,{value:e,children:n})}function To(e){const n=i.useContext(_t);return e===void 0?void 0:n.get(e)}function _o(e){return typeof e=="string"?e.replace(/^@/,""):""}function Eo({authorId:e,children:n}){const s=To(e),t=Ne(s==null?void 0:s.agentRef),{open:o}=dt();if(!s)return a.jsx(Ve,{kind:"human",label:_o(n),resolved:!1});const r=rt({record:s,override:t==null?void 0:t.visual}),l=ct(s,t==null?void 0:t.memberId),d=l===void 0?void 0:()=>o(l),m=d?{role:"button",tabIndex:0,"aria-label":`View ${s.displayName}’s profile`,onClick:d,onKeyDown:f=>{f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),d())}}:{};return a.jsx(St,{onViewProfile:d,identity:{kind:s.kind,displayName:s.displayName,handle:s.handle??void 0,color:r.color,emoji:r.emoji,imageUrl:r.imageUrl,origin:s.origin,agent:t&&{runtime:t.runtime,...t.model&&{model:t.model}}},children:a.jsx(Ve,{kind:s.kind,label:s.displayName,handle:s.handle??void 0,color:s.color,origin:s.origin,resolved:!0,interactive:d!==void 0,...m})})}function Po(e){return{mention:n=>{const s=n[Fe],t=typeof s=="string"?s:void 0;return!t||!e.has(t)?a.jsx(a.Fragment,{children:n.children}):a.jsx(Eo,{authorId:t,children:n.children})}}}function $o({entry:e,authors:n}){const s=i.useMemo(()=>Ao(e.body.text,e.mentionSpans),[e.body.text,e.mentionSpans]),t=i.useMemo(()=>{var r;return new Set(((r=e.mentionSpans)==null?void 0:r.map(l=>l.authorId))??[])},[e.mentionSpans]),o=i.useMemo(()=>Po(t),[t]);return a.jsx(Oo,{authors:n,children:a.jsx(Is,{content:s,className:"msg-prose",allowedTags:jo,literalTagContent:So,components:o,renderers:Qs})})}function Do(e){return function(s){return a.jsx($o,{entry:s,authors:e})}}const Et="the top folder";function Qe(e){return e.slice(e.lastIndexOf("/")+1)}function Fo(e){const n=e.lastIndexOf("/");return n===-1?"":e.slice(0,n)}function Lo(e){return e===""?Et:`${e}/`}function ve(e){return e.target!==void 0?e.target===""?Et:e.target:Lo(Fo(e.paths[0]??""))}function zo(e,n){const s=e.paths[0]??"",t=e.target;switch(e.kind){case"edit":return`${n} edited ${t??s}`;case"add":return`${n} added ${t??s}`;case"upload":return e.pathCount===1?`${n} uploaded ${Qe(s)} to ${ve(e)}`:`${n} uploaded ${e.pathCount} files to ${ve(e)}`;case"rename":{const o=e.from??"";return t!==void 0?`${n} renamed ${o} to ${t}`:o.endsWith("/")?`${n} renamed ${o}`:`${n} renamed ${o} to ${s}`}case"delete":return t!==void 0?`${n} deleted ${t}`:e.pathCount===1?`${n} deleted ${s}`:`${n} deleted ${e.pathCount} files`;case"from-attachment":return`${n} saved ${Qe(s)} from the chat to ${ve(e)}`}}const Ho=i.lazy(()=>bn(()=>import("./index-CiVeycsn.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.SaveToRoomFilesButton})));function Pt({roomId:e,entry:n,author:s,authorRef:t,authors:o,viewerAuthorId:r,authorNames:l,reactionFrequents:d,streamStalled:m,isMember:f=!0,grouping:u,orphanedReply:c,answers:w,feedPosition:h,rowId:g}){const k=Te(n.createdAt),x=i.useMemo(()=>{const K=vo(n.body.text),xe=hs(n.attachments??[]);if(xe===null)return K;const He=K??n.body.text.trim();return He.length>0?`${He} ${xe}`:xe},[n.body.text,n.attachments]),N=i.useId(),p=`${N}-author`,b=`${N}-content`,_=`${N}-summary`,T=i.useRef(null),$=i.useRef(null),C=i.useRef(null),{reactions:E,toggle:P,quickRow:I}=wo({roomId:e,entry:n,viewerAuthorId:r,reactionFrequents:d,streamStalled:m,isMember:f}),F=Ne(t==null?void 0:t.agentRef),{open:D}=dt(),M=t===void 0?void 0:ct(t,F==null?void 0:F.memberId),H=i.useCallback(()=>{M!==void 0&&D(M)},[D,M]),L=M===void 0?void 0:H,B=lo({roomId:e,entry:n,author:t,viewerAuthorId:r,onViewProfile:L}),W=Io({barRef:$,pillsRef:C,hasReactions:E.length>0}),z=i.useCallback(()=>{var K;return(K=T.current)==null?void 0:K.focus()},[]),q=i.useMemo(()=>Do(o),[o]),R=i.useCallback(K=>a.jsx(i.Suspense,{fallback:null,children:a.jsx(Ho,{roomId:e,attachment:K})}),[e]),y=go(),O=n.body.subjectAuthorId??n.authorId,A=o.get(O),v=Ne(A==null?void 0:A.agentRef),S=No(e,n),j=co(n);if(j.kind==="notice")return a.jsx(so,{entry:n,feedPosition:h,rowId:g,sessionLink:S,subjectName:A==null?void 0:A.displayName});if(j.kind==="moment")return a.jsx(ro,{entry:n,moment:j.moment,subject:O===n.authorId?s:Y(O,o,y),subjectIdentity:{handle:(A==null?void 0:A.handle)??void 0,origin:A==null?void 0:A.origin,agent:v&&{runtime:v.runtime,...v.model&&{model:v.model}}},feedPosition:h,rowId:g});const U=u.position==="first"||u.position==="only";return a.jsxs(G.Root,{ref:T,id:g,position:u.position,actions:B,reactions:I,"data-testid":"room-entry",tabIndex:0,...yo({showAuthorHeader:U,headerId:p,displayName:s.displayName,time:k,summary:x,contentId:b,summaryId:_,feedPosition:h}),onKeyDown:W,children:[a.jsx(G.Gutter,{author:s,at:n.createdAt,onViewProfile:L,isSelf:n.authorId===r}),a.jsxs(G.Body,{children:[a.jsx(G.Author,{id:p,author:s,at:n.createdAt,origin:t==null?void 0:t.origin}),c===!0&&a.jsx("p",{"data-testid":"room-entry-orphan",className:"text-muted-foreground text-xs italic",children:"Replying to an earlier message"}),w!=null&&a.jsx("p",{"data-testid":"room-entry-answers",className:"text-muted-foreground mb-1 truncate text-xs italic",children:`Answering “${w.excerpt}”`}),a.jsx(G.Content,{id:b,className:"[&_:not(pre)>code]:wrap-anywhere [&_pre]:overflow-x-auto",children:n.body.fileChange?a.jsx("p",{"data-testid":"room-entry-file-change",className:"wrap-anywhere",children:zo(n.body.fileChange,(A==null?void 0:A.displayName)??"Somebody")}):q(n,{rowId:n.id,isStreaming:!1})}),x!==null&&a.jsx("span",{id:_,className:"hidden",children:x}),a.jsx(G.Attachments,{items:n.attachments??[],renderAction:f?R:void 0}),a.jsx(G.Reactions,{ref:C,reactions:E,viewerAuthorId:r,names:l,frequents:d,onToggle:P,disabled:m===!0||!f,onExit:z}),a.jsx(G.Actions,{actions:B,reactions:I,barRef:$,onExit:z})]})]})}const Bo="room-load-older",qo=4;function $t({roomName:e}){return a.jsx(gs,{label:e===void 0?"Messages":`Messages in ${e}`,busy:!0,className:"flex flex-col gap-4 p-4","data-testid":"room-timeline-loading",children:Array.from({length:qo},(n,s)=>a.jsxs("div",{className:"flex gap-3",children:[a.jsx(se,{className:"size-7 shrink-0 rounded-full"}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[a.jsx(se,{className:"h-3 w-24"}),a.jsx(se,{className:"h-3 w-full max-w-md"})]})]},`room-skeleton-${s}`))})}function Uo({roomId:e,roomName:n,viewerAuthorId:s,entries:t,members:o,formerAuthors:r,lastReadSeq:l,reactionFrequents:d,streamStalled:m,isLoading:f,error:u,onAddAgents:c,openThreadId:w,onOpenThread:h,resumeRow:g,landOnRow:k,onTopRow:x,canLoadOlder:N=!1,isLoadingOlder:p=!1,onLoadOlder:b,ref:_}){const T=i.useMemo(()=>Ee(o,r),[o,r]),$=he(o,s),C=De(),E=i.useMemo(()=>new Map([...T].map(([y,O])=>[y,O.displayName])),[T]),P=ut(),I=mt(e,null),{topLevel:F,repliesByRoot:D,orphaned:M}=i.useMemo(()=>uo(t),[t]),H=i.useMemo(()=>new Map(t.map(y=>[y.id,y])),[t]),L=i.useMemo(()=>{const y=vn(F,l),O=kn(F.map(v=>({id:v.id,authorId:v.body.moment?`moment:${v.id}`:v.authorId,timestamp:v.createdAt})),{now:P,lastSeenId:y.lastSeenId,unreadFromStart:y.fromStart}),A=[];N&&!f&&A.push({kind:"load-older",id:Bo});for(const v of O){if(v.kind==="day-divider"){A.push({kind:"day-divider",id:v.key,label:v.label});continue}if(v.kind==="unread-divider"){A.push({kind:"unread-divider",id:v.key});continue}const S=F[v.index];A.push({kind:"message",id:S.id,entry:S,grouping:v.grouping,position:v.index+1,answers:Ot(S,F[v.index-1],H.get.bind(H))});const j=D.get(S.id);j&&A.push({kind:"thread-reply",id:Ct(S.id),rootId:S.id,replies:j,totalReplies:S.threadReplyCount})}return A},[F,D,H,l,P,N,f]),B=i.useMemo(()=>L.map(y=>y.kind==="load-older"?{kind:"notice",id:y.id,at:"",body:null}:y.kind==="day-divider"?{kind:"day-divider",id:y.id,label:y.label}:y.kind==="unread-divider"?{kind:"unread-divider",id:y.id}:y.kind==="thread-reply"?{kind:"thread-reply",id:y.id,rootId:y.rootId,replyCount:_e(y.replies.length,y.totalReplies),lastAt:y.replies[y.replies.length-1].createdAt}:{kind:"message",id:y.id,payload:y.entry,grouping:y.grouping,author:Y(ue(y.entry,T),T,C.faces),at:y.entry.createdAt}),[L,T,C.faces]),W=i.useCallback((y,O)=>{const A=L[O.index];if(A.kind==="load-older")return b===void 0?null:a.jsx(xo,{loading:p,onLoad:b});if(A.kind==="day-divider")return a.jsx(xs,{label:A.label});if(A.kind==="unread-divider")return a.jsx(ys,{});if(A.kind==="thread-reply"){if(O.onOpenThread===void 0)return null;const S=O.onOpenThread;return a.jsx(ao,{id:me(A.rootId),summary:Vs(A.replies,l,A.totalReplies),open:w===A.rootId,onOpen:()=>S(A.rootId)})}const v=ue(A.entry,T);return a.jsx(Pt,{roomId:e,entry:A.entry,author:Y(v,T,C.faces),authorRef:T.get(v),authors:T,viewerAuthorId:s,authorNames:E,reactionFrequents:d,streamStalled:m,isMember:$,grouping:A.grouping,orphanedReply:M.has(A.entry.id),answers:A.answers,feedPosition:{index:A.position,total:-1},rowId:fe(A.entry.id)})},[L,e,T,C.faces,s,E,d,m,$,M,l,w,p,b]),z=i.useCallback(y=>{if(y.kind==="message")return fe(y.id);if(y.kind==="thread-reply")return me(y.rootId)},[]);if(u)return a.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[a.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load these messages"}),a.jsx("p",{className:"max-w-sm",children:"Nothing was lost. Reload to try again."})]});const q=o.some(y=>y.author.kind==="agent"),R=a.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[a.jsx(Rn,{className:"text-muted-foreground/50 size-8","aria-hidden":!0}),a.jsx("p",{className:"text-foreground font-medium",children:"Nothing said here yet"}),a.jsx("p",{className:"max-w-sm",children:q?"Say something to get it going.":"Nothing answers until you add an agent."}),a.jsx(Ae,{type:"button",size:"sm",variant:q?"ghost":"default",onClick:c,className:"mt-1",children:q?"Add more agents":"Add agents"})]});return a.jsx(Tt,{known:C,children:a.jsx(Q.Timeline,{ref:_,conversationId:e,label:`Messages in ${n}`,rows:B,renderRow:W,onOpenThread:h,domIdOf:z,...g===void 0?{}:{resumeRow:g},...k===void 0?{}:{landOnRow:k},...x===void 0?{}:{onTopRow:x},pending:I,viewerAuthorId:s,loading:f?a.jsx($t,{roomName:n}):void 0,empty:R,feedTestId:"room-timeline"})})}const Le={reactions:!0,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!0,turnStatus:!1,asks:!0};function Wo(e){const n=ne(),[s,t]=i.useState([]),o=i.useRef(new Map),r=i.useCallback(h=>{const g=h.map(k=>({id:crypto.randomUUID(),file:k,status:"pending",progress:0}));t(k=>[...k,...g])},[]),l=i.useCallback(h=>{o.current.delete(h),t(g=>g.filter(k=>k.id!==h))},[]),d=i.useCallback(h=>{if(!h){o.current.clear(),t([]);return}const g=new Set(h);for(const k of g)o.current.delete(k);t(k=>k.filter(x=>!g.has(x.id)))},[]),m=i.useCallback(h=>{o.current.delete(h),t(g=>g.map(k=>k.id===h&&k.status==="error"?{...k,status:"pending",progress:0,error:void 0}:k))},[]),f=i.useRef(null),u=re({meta:{suppressErrorToast:!0},mutationFn:async h=>{t(N=>N.map(p=>h.some(b=>b.id===p.id)?{...p,status:"uploading"}:p));const g=N=>{t(p=>p.map(b=>b.status==="uploading"?{...b,progress:N.percentage}:b))},k=new AbortController;f.current=k;const x=h.map(N=>N.file);return n.uploadRoomAttachments(e,x,g,k.signal)},onSettled:()=>{f.current=null},onSuccess:(h,g)=>{g.forEach((k,x)=>{const N=h[x];N&&o.current.set(k.id,N.id)}),t(k=>k.map(x=>g.findIndex(p=>p.id===x.id)===-1?x:{...x,status:"uploaded",progress:100}))},onError:h=>{t(g=>g.map(k=>k.status==="uploading"?{...k,status:"error",error:h.message}:k))}}),c=i.useCallback(()=>{var h;(h=f.current)==null||h.abort()},[]),w=i.useCallback(async()=>{const h=s.filter(k=>k.status==="error");if(h.length>0)throw new Error(h.length===1?`${h[0].file.name} didn’t upload. Try again or remove it.`:`${h.length} files didn’t upload. Try again or remove them.`);const g=s.filter(k=>k.status==="pending");return g.length>0&&await u.mutateAsync(g),s.map(k=>o.current.get(k.id)).filter(k=>k!==void 0)},[s,u]);return{pendingFiles:s,addFiles:r,removeFile:l,retryFile:m,clearFiles:d,cancelUpload:c,uploadAndGetIds:w,hasPendingFiles:s.length>0,hasFailedUpload:s.some(h=>h.status==="error"),isUploading:u.isPending}}function Dt(e){const{room:n,threadRootId:s}=e,t=bs(),o=vs(),r=Wo((n==null?void 0:n.id)??""),l=n!==void 0&&he(n.members,n.viewerAuthorId),d=i.useRef({attachments:r,post:t,reply:o,room:n,threadRootId:s});i.useEffect(()=>{d.current={attachments:r,post:t,reply:o,room:n,threadRootId:s}});const m=i.useCallback(p=>d.current.attachments.addFiles(p),[]),f=i.useCallback(p=>d.current.attachments.removeFile(p),[]),u=i.useCallback(p=>d.current.attachments.retryFile(p),[]),c=i.useCallback(()=>d.current.attachments.cancelUpload(),[]),{pendingFiles:w,hasFailedUpload:h,isUploading:g}=r,k=i.useMemo(()=>({staged:w,add:m,remove:f,retry:u,cancel:c,hasFailed:h,isUploading:g,holdsSendWhileUploading:!1}),[w,h,g,m,f,u,c]),x=i.useCallback(async p=>{const{attachments:b,post:_,reply:T,room:$,threadRootId:C}=d.current;if($===void 0)throw new Error("That room isn’t loaded yet.");if($.archived)throw new Error("This room is archived.");Re.getState().recordOpened("room",$.id);const E=wn(),P=b.pendingFiles.map(M=>M.file.name),I=b.pendingFiles.map(M=>M.id),F=await b.uploadAndGetIds();b.clearFiles(I);const D=p.parentEntryId??C;if(D!==void 0){T.mutate({roomId:$.id,rootEntryId:D,text:p.text,clientId:E,attachmentIds:F,attachmentNames:P});return}_.mutate({roomId:$.id,text:p.text,clientId:E,attachmentIds:F,attachmentNames:P})},[]);return{target:i.useMemo(()=>({kind:"room",id:(n==null?void 0:n.id)??"",placeholder:n===void 0?"Message…":s===void 0?`Message ${te(n)}…`:"Reply in this thread…",canSend:n!==void 0&&!n.archived&&l,...n===void 0?{canSendReason:"Still opening this room…"}:n.archived?{canSendReason:"This room is archived. You can read it, but not add to it."}:l?{}:{canSendReason:ft},send:x,attachments:k}),[n,s,l,k,x]),attachments:r}}function Ko(e){const{roomId:n,entrySeq:s,entries:t,historyLoaded:o}=e,r=s===void 0?null:`${n}:${s}`,l=i.useMemo(()=>{if(s===void 0)return null;const g=t.find(p=>p.seq===s);if(g===void 0)return null;const k=Pe(t,g.id);if(k===null)return null;const x=J(g)??null,N=x!==null&&k.rowId!==g.id;return{roomRowId:k.rowId,threadRootId:N?x:null,entryId:g.id}},[t,s]),d=i.useRef(null),m=(l==null?void 0:l.threadRootId)??null;i.useEffect(()=>{r===null||m===null||d.current!==r&&(d.current=r,X.getState().openThread(n,m))},[r,n,m]);const f=i.useRef(null);i.useEffect(()=>{r===null||!o||l===null&&f.current!==r&&(f.current=r,pt.info("That message isn’t in the loaded history",{description:"Only recent messages are open. Nothing was lost."}))},[r,o,l]);const u=i.useRef(null),c=i.useCallback(()=>{if(!(r===null||u.current===r))return u.current=r,l==null?void 0:l.roomRowId},[r,l]),w=i.useRef(null),h=i.useCallback(()=>{if(!(r===null||w.current===r))return w.current=r,(l==null?void 0:l.threadRootId)===null||l==null?void 0:l.entryId},[r,l]);return{roomRow:s===void 0?void 0:c,threadRow:s===void 0?void 0:h}}function Go(e,n){const[s,t]=i.useState({roomId:null,seq:null});return s.roomId===e?s.seq:e===null?(t({roomId:null,seq:null}),null):n===null?null:(t({roomId:e,seq:n}),n)}const Vo=600;function Xo(e){return document.getElementById(me(e))??document.getElementById(fe(e))}function Yo(){const e=i.useRef(null);return i.useEffect(()=>()=>{var s;return(s=e.current)==null?void 0:s.call(e)},[]),{arm:i.useCallback(s=>{var d;(d=e.current)==null||d.call(e);let t=0;const o=Date.now()+Vo;let r=!1;const l=()=>{if(r)return;const m=document.activeElement;if(m===null||m===document.body||!m.isConnected){const u=Xo(s);if(u!==null){u.focus();return}}Date.now()>=o||(t=requestAnimationFrame(l))};t=requestAnimationFrame(l),e.current=()=>{r=!0,cancelAnimationFrame(t)}},[])}}function Qo({roomId:e,route:n,urlThreadId:s,openThreadId:t,entries:o,historyLoaded:r}){const l=In(),d=i.useRef(null);i.useEffect(()=>{if(e!==null){if(d.current!==e&&(d.current=e,s!==void 0)){X.getState().openThread(e,s);return}if(r&&t!==void 0){const m=o.find(u=>u.id===t),f=m===void 0?void 0:Mt(m);if(f!==void 0&&f!==t){const u=X.getState().open[e];X.getState().openThread(e,f,(u==null?void 0:u.focusComposer)??!1);return}}t!==s&&(l==null||l({to:n,search:m=>({...m,thread:t}),replace:!0}))}},[e,n,t,s,o,r,l])}const Jo=6,Ft="jump-back-in-listbox";function ze(e){return`jump-back-in-item-${e}`}const Zo='[role="combobox"]';function oe(e){return e instanceof Element&&e.matches(Zo)}function er({value:e,yieldToPalette:n=!1,enabled:s=!0}){const t=Me(),o=Nn(),[r,l]=i.useState(!1),[d,m]=i.useState({stamp:"",index:0}),[f,u]=i.useState(!1),[c,w]=i.useState(!1);e.length>0&&!c&&w(!0);const h=i.useRef(!1);i.useEffect(()=>{h.current=!0},[]);const{data:g}=it({enabled:s}),k=i.useMemo(()=>((g==null?void 0:g.agents)??[]).map(R=>R.projectPath),[g]),{data:x}=lt(k,{enabled:s}),N=i.useMemo(()=>x??{},[x]),p=i.useMemo(()=>jn(k,N),[k,N]),b=i.useMemo(()=>new Map(k.map(R=>[at(R),R])),[k]),_=i.useCallback(R=>Sn({room:R,agentsByPath:N,pathByAgentRef:b}),[N,b]),T=i.useMemo(()=>An(o.muted),[o.muted]),{items:$}=cs({mutedRoomIds:T,enabled:s}),C=i.useMemo(()=>$.slice(0,Jo),[$]),E=s&&r&&!f&&!c&&!n&&e.length===0&&C.length>0,P=`${E}:${C.length}`,I=d.stamp===P?d.index:0,F=i.useCallback(R=>{h.current&&oe(R.target)&&(u(!1),w(!1),l(!0))},[]),D=i.useCallback(R=>{oe(R.target)&&l(!0)},[]),M=i.useCallback(R=>{oe(R.target)&&l(!1)},[]),H=i.useCallback(R=>{C.length!==0&&m(y=>{const O=y.stamp===P?y.index:0;return{stamp:P,index:(O+R+C.length)%C.length}})},[C.length,P]),L=i.useCallback(()=>H(1),[H]),B=i.useCallback(()=>H(-1),[H]),W=i.useCallback(()=>{u(!0)},[]),z=i.useCallback(R=>{if(u(!0),R.kind==="session"){R.session.cwd&&Re.getState().recordOpened("agent",R.session.cwd),t(ce({dir:R.session.cwd??void 0,session:R.session.id}));return}Re.getState().recordOpened("room",R.room.id),t({...ht.channels(),search:{id:R.room.id}})},[t]),q=i.useCallback(()=>{const R=C[I];!E||!R||z(R)},[E,C,I,z]);return{isOpen:E,hasRows:C.length>0,rows:C,agents:N,displayNames:p,visualOf:_,selectedIndex:I,activeDescendantId:E&&C[I]!==void 0?ze(I):void 0,listboxId:E?Ft:void 0,handleFocus:F,handleBlur:M,handlePointerDown:D,moveDown:L,moveUp:B,selectHighlighted:q,selectRow:z,dismiss:W}}function Lt({mark:e,label:n,title:s,summary:t,lastActivityAt:o,index:r,isSelected:l,now:d,onSelect:m}){const f=i.useMemo(()=>Number.isNaN(Date.parse(o))?null:En(o),[o,d]);return a.jsxs("div",{id:ze(r),role:"option","aria-selected":l,"data-selected":l,title:s,onClick:m,className:"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-start gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[a.jsx("span",{className:"mt-px flex shrink-0 items-center",children:e}),a.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsxs("span",{className:"flex w-full items-center gap-1.5",children:[a.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm",children:n}),f!==null&&a.jsx("span",{className:"text-muted-foreground/60 text-3xs shrink-0",children:f})]}),t!==null&&a.jsx("span",{className:"text-muted-foreground/70 text-2xs truncate",children:t})]})]})}function tr({item:e,agent:n,displayName:s,index:t,isSelected:o,now:r,onSelect:l}){const d=Mn(n,e.session.cwd??s);return a.jsx(Lt,{mark:a.jsx(Cn,{color:d.color,emoji:d.emoji,size:"xs"}),label:e.name,title:`${s} · ${e.name}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:t,isSelected:o,now:r,onSelect:l})}function nr({item:e,visual:n,index:s,isSelected:t,now:o,onSelect:r}){return a.jsx(Lt,{mark:a.jsx(Tn,{room:e.room,participants:e.room.participants,visuals:_n(n)}),label:a.jsx(On,{room:e.room}),title:e.summary===null?e.name:`${e.name} · ${e.summary}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:s,isSelected:t,now:o,onSelect:r})}function sr({rows:e,selectedIndex:n,agents:s={},displayNames:t={},visualOf:o,onSelect:r}){const l=ut(6e4);return i.useEffect(()=>{var d,m;(m=(d=document.getElementById(ze(n)))==null?void 0:d.scrollIntoView)==null||m.call(d,{block:"nearest"})},[n]),a.jsx(Ce.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:d=>d.preventDefault(),children:a.jsx("div",{id:Ft,role:"listbox","aria-label":"Jump back in",className:"max-h-72 overflow-y-auto p-1.5",children:e.map((d,m)=>{var f;return d.kind==="session"?a.jsx(tr,{item:d,agent:d.session.cwd&&s[d.session.cwd]||null,displayName:d.session.cwd&&t[d.session.cwd]||((f=d.session.cwd)==null?void 0:f.split("/").pop())||"Agent",index:m,isSelected:m===n,now:l,onSelect:()=>r(d)},`session-${d.id}`):a.jsx(nr,{item:d,visual:o(d.room),index:m,isSelected:m===n,now:l,onSelect:()=>r(d)},`room-${d.id}`)})})})}const Je={people:"People",agents:"Agents"},or=["people","agents"];function rr(e,n){const s=[];for(const{author:t}of e){if(t.kind==="system"||t.id===n||t.retired)continue;const o=t.handle;s.push({section:t.kind==="agent"?"agents":"people",authorId:t.id,label:t.displayName,...o?{handle:o}:{},...t.emoji?{emoji:t.emoji}:{},...t.color?{color:t.color}:{},disabled:!o,...o?{}:{disabledReason:"No @name"}})}return s}function ar(e,n,s){const t=n.trim().toLowerCase(),o=e.map((r,l)=>({row:r,position:l,tier:ir(r,t)})).filter(r=>r.tier!==null).sort((r,l)=>r.tier-l.tier||r.position-l.position);return s.flatMap(r=>o.filter(l=>l.row.section===r).map(({row:l})=>l))}function ir(e,n){var o;if(n==="")return 0;const s=[(o=e.handle)==null?void 0:o.toLowerCase(),e.label.toLowerCase()].filter(r=>r!==void 0);let t=null;for(const r of s){const l=r===n?0:r.startsWith(n)?1:r.includes(n)?2:null;l!==null&&(t===null||l<t)&&(t=l)}return t}function ie(e,n,s){var r;const t=e.length;if(t===0)return 0;let o=(n%t+t)%t;for(let l=0;l<t;l++){if(!((r=e[o])!=null&&r.disabled))return o;o=(o+s+t)%t}return 0}function lr(e,n,s,t){const o=e.slice(0,n),r=e.slice(n+1+s.length),l=`@${t}`,d=r.startsWith(" ")?"":" ";return{value:o+l+d+r,cursorPos:o.length+l.length+1}}const dr=/(^|\s)@([A-Za-z0-9_.-]*)$/,zt="mention-palette-listbox";function je(e){return`mention-item-${e}`}function cr({members:e,viewerAuthorId:n,text:s,sectionOrder:t=or}){var D;const[o,r]=i.useState(!1),[l,d]=i.useState(""),[m,f]=i.useState(-1),u=Pn(s),c=i.useRef(!1),w=i.useMemo(()=>rr(e,n),[e,n]),h=i.useMemo(()=>o?ar(w,l,t):[],[w,l,o,t]),[g,k]=i.useState(null),x=g!==null&&g.query===l&&g.open===o?g.index:ie(h,0,1),N=h[x],p=h.length===0||N!==void 0&&!N.disabled?x:ie(h,0,1),b=i.useCallback((M,H)=>{const L=M.slice(0,H).match(dr);if(!L){r(!1);return}r(!0),d(L[2]),f((L.index??0)+L[1].length)},[]),_=i.useCallback(M=>{u.write(M),c.current=!1},[u]),T=i.useCallback(M=>{c.current||b(u.read(),M)},[b,u]),$=i.useCallback(()=>{k({query:l,open:o,index:ie(h,p+1,1)})},[h,p,l,o]),C=i.useCallback(()=>{k({query:l,open:o,index:ie(h,p-1,-1)})},[h,p,l,o]),E=i.useCallback(M=>M.disabled||M.handle===void 0?null:(c.current=!0,r(!1),lr(u.read(),m,l,M.handle)),[m,l,u]),P=i.useCallback(()=>{const M=h[p];return M?E(M):(r(!1),null)},[h,p,E]),I=i.useCallback(()=>{c.current=!0,r(!1)},[]),F=h.some(M=>!M.disabled);return{isOpen:o,hasSelectableRows:F,rows:h,selectedIndex:p,activeDescendantId:o&&((D=h[p])==null?void 0:D.disabled)===!1?je(p):void 0,listboxId:o?zt:void 0,noteTextChange:_,handleCursorChange:T,moveDown:$,moveUp:C,selectHighlighted:P,selectRow:E,dismiss:I}}function ur({rows:e,selectedIndex:n,onSelect:s}){const t=i.useMemo(()=>{const o=[];return e.forEach((r,l)=>{const d=o[o.length-1];d&&d.section===r.section?d.items.push({row:r,index:l}):o.push({section:r.section,items:[{row:r,index:l}]})}),o},[e]);return i.useEffect(()=>{var o;(o=document.getElementById(je(n)))==null||o.scrollIntoView({block:"nearest"})},[n]),a.jsx(Ce.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:o=>o.preventDefault(),children:a.jsx("div",{id:zt,role:"listbox","aria-label":"Mentions",className:"max-h-72 overflow-y-auto p-1.5",children:e.length===0?a.jsx("div",{className:"text-muted-foreground px-2 py-4 text-center text-sm",children:"No one by that name."}):t.map(({section:o,items:r},l)=>a.jsxs("div",{role:"group","aria-label":Je[o],children:[l>0&&a.jsx("div",{className:"bg-border mx-2 my-1.5 h-px"}),a.jsx("div",{"aria-hidden":!0,className:"text-muted-foreground/70 text-2xs px-2 pt-1.5 pb-1 font-medium tracking-wide uppercase",children:Je[o]}),r.map(({row:d,index:m})=>{const f=m===n;return a.jsxs("div",{id:je(m),role:"option","aria-selected":f,"aria-disabled":d.disabled,"data-selected":f,"data-disabled":d.disabled,onClick:()=>{d.disabled||s(d)},className:d.disabled?"flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1.5 opacity-45":"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[a.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 text-center text-sm leading-none",children:d.emoji}),a.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:d.label}),d.handle!==void 0&&a.jsxs("span",{className:"text-muted-foreground/70 truncate font-mono text-xs",children:["@",d.handle]}),d.disabledReason!==void 0&&a.jsx("span",{className:"text-muted-foreground/70 text-2xs ml-auto shrink-0",children:d.disabledReason})]},d.authorId)})]},o))})})}function Ht({room:e,threadRootId:n,focusOnMount:s,offerJumpBackIn:t,onFocusChange:o,attachments:r}){const l=n===void 0?e.id:ot(e.id,n),d=$n(l),{target:m}=yt(),f=Dn(),u=Fn(l),c=i.useRef(null),w=he(e.members,e.viewerAuthorId),h=i.useRef(!1),g=cr({members:e.members,viewerAuthorId:e.viewerAuthorId,text:d}),k=t===!0,x=er({value:d,yieldToPalette:g.isOpen,enabled:k}),N=i.useRef(u);i.useEffect(()=>{var I;u!==N.current&&(N.current=u,(I=c.current)==null||I.focus())},[u]),i.useEffect(()=>{var I;s===!0&&((I=c.current)==null||I.focusUnlessTouch())},[]);const p=i.useCallback(I=>le.getState().set(l,I),[l]),[b,_]=i.useState(null);i.useLayoutEffect(()=>{var I;b!==null&&((I=c.current)==null||I.focusAt(b.pos))},[b]);const T=i.useCallback(I=>{I&&(p(I.value),_({pos:I.cursorPos}))},[p]),$=i.useCallback(I=>T(g.selectRow(I)),[g,T]),C=i.useCallback(()=>T(g.selectHighlighted()),[g,T]),E=()=>{if(m===null||!m.canSend||h.current)return;g.dismiss();const I=le.getState().take(l).trim();if(I==="")return;const F=r.pendingFiles.length>0;F&&(h.current=!0),m.send({text:I}).catch(()=>{const D=le.getState(),M=D.drafts[l]??"";D.set(l,M===""?I:`${I}
44
- ${M}`)}).finally(()=>{F&&(h.current=!1)})};if(!w)return a.jsxs("div",{className:"flex items-center justify-between gap-3 border-t px-4 py-3",children:[a.jsx("p",{className:"text-muted-foreground text-sm",children:ft}),a.jsx(Ae,{type:"button",size:"sm",variant:"outline",disabled:f.isPending,onClick:()=>f.mutate({roomId:e.id,authorId:e.viewerAuthorId},{onSuccess:()=>pt.success(`You joined ${te(e)}`)}),children:Ln})]});const P=a.jsx(Q.Composer,{inputRef:c,value:d,onChange:I=>{p(I),g.noteTextChange(I)},onSubmit:E,head:a.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:g.isOpen&&g.rows.length===0?"No one by that name.":""}),mentionPicker:a.jsx(we,{children:g.isOpen&&a.jsx(ur,{rows:g.rows,selectedIndex:g.selectedIndex,onSelect:$})}),overlays:a.jsx(a.Fragment,{children:a.jsx(we,{children:x.isOpen&&a.jsx(sr,{rows:x.rows,selectedIndex:x.selectedIndex,agents:x.agents,displayNames:x.displayNames,visualOf:x.visualOf,onSelect:x.selectRow})})}),input:{onCursorChange:g.handleCursorChange,isStreaming:!1,isPaletteOpen:g.isOpen||x.isOpen,paletteHasResults:x.isOpen?x.hasRows:g.hasSelectableRows,onArrowUp:x.isOpen?x.moveUp:g.moveUp,onArrowDown:x.isOpen?x.moveDown:g.moveDown,onCommandSelect:x.isOpen?x.selectHighlighted:C,onEscape:x.isOpen?x.dismiss:g.dismiss,tabPicks:!x.isOpen,onClear:()=>{p(""),g.dismiss()},activeDescendantId:x.isOpen?x.activeDescendantId:g.activeDescendantId,paletteListboxId:x.isOpen?x.listboxId:g.listboxId,contextKey:l,...r.hasFailedUpload?{canSubmitReason:"A file didn’t upload. Try it again or remove it, then send."}:{}}});return!k&&o===void 0?P:a.jsx("section",{className:"flex flex-col","data-testid":zn.homeComposer,onFocus:I=>{x.handleFocus(I),oe(I.target)&&(o==null||o(!0))},onBlur:I=>{x.handleBlur(I),oe(I.target)&&(o==null||o(!1))},onPointerDown:x.handlePointerDown,children:P})}function mr(e){return e.kind!=="channel"||e.bridge!=null||e.archived?!1:!e.members.some(n=>n.author.kind==="agent")}function fr({room:e,hasEntries:n,onAddAgents:s}){return!n||!mr(e)?null:a.jsxs("p",{className:"text-muted-foreground shrink-0 px-4 pb-1 text-xs","data-testid":"no-agent-hint",children:["No agent is in this channel to answer."," ",a.jsx("button",{type:"button",onClick:s,className:"text-foreground focus-visible:ring-ring rounded-sm underline underline-offset-2 focus-visible:ring-2 focus-visible:outline-none",children:"Add one"})," ","to get answers here."]})}function pr({roomId:e}){const{approvals:n}=Hn(),s=Bn(n).filter(t=>t.roomId===e);return s.length===0?null:a.jsx("section",{"data-slot":"room-approvals","aria-label":"Requests waiting on you",className:"shrink-0 px-3 pb-2 md:px-4",children:a.jsx(qn,{approvals:s})})}function hr({roomId:e}){const{data:n}=Ps("pending"),s=(n??[]).filter(t=>t.roomId===e);return s.length===0?null:a.jsx("section",{"data-slot":"room-agent-requests","aria-label":"Apps agents are asking for",className:"shrink-0 space-y-2 px-3 pb-2 md:px-4",children:s.map(t=>a.jsx($s,{request:t},t.requestId))})}const gr="An agent",Ze=64,ke=3,xr=new Set;function Bt({room:e,entries:n,scope:s,laneScope:t,stalled:o,unavailable:r=!1,onRetry:l,onScrollToRow:d}){const m=Me(),f=Un(e.id,s),u=Wn(e.id,s),c=Kn(e.id,s),[w,h]=i.useState(!1),g=At(e.id,{enabled:w}),k=Gn(),{mutate:x}=Ws(),[N,p]=i.useState(xr),b=i.useCallback(v=>{p(S=>new Set(S).add(v)),x({roomId:e.id,authorId:v},{onSettled:()=>p(S=>{const j=new Set(S);return j.delete(v),j})})},[x,e.id]),_=Ks(),[T,$]=i.useState(()=>new Map),C=Vn(),E=De(),P=i.useMemo(()=>Ee(e.members,e.formerAuthors),[e.members,e.formerAuthors]),I=i.useCallback(v=>{var S;return((S=P.get(v))==null?void 0:S.displayName)??gr},[P]),{interactions:F}=Xn(),D=i.useMemo(()=>F.filter(v=>v.roomId===e.id),[F,e.id]),M=i.useMemo(()=>{var S;const v={};for(const j of D){if(j.roomAuthorId===void 0)continue;const U=(S=P.get(j.roomAuthorId))==null?void 0:S.displayName;U!==void 0&&(v[j.sessionId]=U)}return v},[D,P]),H=i.useMemo(()=>f.map(v=>({authorId:v.authorId,name:I(v.authorId),state:v.state,since:v.since,activity:v.activity??null})),[f,I]),L=i.useMemo(()=>u.map(v=>{var j;const S=(j=C.data)==null?void 0:j.find(U=>U.id===v.behindRoomId);return{authorId:v.authorId,name:I(v.authorId),since:v.since,behind:{roomId:v.behindRoomId,title:S===void 0?null:te(S)},othersWaiting:v.othersWaiting,severalInTheWay:v.severalInTheWay}}),[u,I,C.data]),B=i.useMemo(()=>{const v=new Set;for(const S of u)T.get(S.authorId)===S.entryId&&v.add(S.authorId);return v},[u,T]),W=i.useMemo(()=>c===null?null:{authorId:c.authorId,name:I(c.authorId)},[c,I]),z=i.useMemo(()=>ks({capabilities:Le,asks:D,agentNames:M,stalled:o,presence:H,held:L,silentFinish:W,turn:null}),[D,M,H,L,W,o]),q=i.useMemo(()=>{var S;const v=new Map;for(const j of((S=g.data)==null?void 0:S.bindings)??[])v.set(j.authorId,j.sessionId);return v},[g.data]),R=i.useCallback(v=>{const S=n.find(U=>U.id===v);if(S===void 0)return null;const j=S.body.text.replace(/\s+/gu," ").trim();return j.length===0?null:j.length>Ze?`${j.slice(0,Ze).trimEnd()}…`:j},[n]),y=i.useCallback(v=>{var S;return t==="thread"?Ie(v):((S=Pe(n,v))==null?void 0:S.domId)??null},[n,t]),O=i.useMemo(()=>{const v=f.map(j=>{const U=R(j.entryId),K=y(j.entryId);return{authorId:j.authorId,author:Y(j.authorId,P,E.faces),state:j.state,since:j.since,doing:Yn(j.activity),replyingTo:U===null||K===null?null:{entryId:j.entryId,excerpt:U,rowId:K},sessionId:q.get(j.authorId)??null}}),S=L.map(j=>({authorId:j.authorId,author:Y(j.authorId,P,E.faces),state:"held",since:j.since,doing:null,replyingTo:null,sessionId:null,behind:j.behind,othersWaiting:j.othersWaiting}));return[...v,...S]},[f,L,P,E.faces,R,y,q]),A=i.useMemo(()=>{if(f.length===0)return null;const v=f.slice(0,ke);return a.jsxs("span",{"aria-hidden":"true",className:"flex shrink-0 -space-x-1",children:[v.map(S=>a.jsx(gt,{author:Y(S.authorId,P,E.faces),className:"ring-background size-4 ring-2"},S.authorId)),f.length>ke&&a.jsx("span",{className:"bg-muted text-muted-foreground ring-background text-3xs flex size-4 items-center justify-center rounded-full ring-2",children:`+${f.length-ke}`})]})},[f,P,E.faces]);return a.jsx(Q.LiveLane,{state:z,scope:t,onRetry:l,unavailable:r,faces:A,onPeekOpenChange:h,askCard:z.kind==="ask"?a.jsx(Qn,{ask:z.ask,...M[z.ask.sessionId]?{agentName:M[z.ask.sessionId]}:{},onOpenSession:v=>{m(ce({session:v}))},className:"border-l-0"}):void 0,peek:a.jsx(Q.LivePeek,{rows:O,onScrollToRow:d,onOpenSession:v=>{m(ce({session:v}))},onOpenRoom:v=>{m({...ht.channels(),search:{id:v}})},onAnswerFirst:v=>{const S=u.find(j=>j.authorId===v);S!==void 0&&$(j=>new Map(j).set(v,S.entryId)),_.mutate({roomId:e.id,authorId:v})},promoted:B,onStopAll:()=>k.mutate({roomId:e.id}),stopping:k.isPending,onStopAgent:b,stoppingAgents:N})})}const et=3e3;function yr(e,n,s,t=Date.now){const o=i.useRef(null),r=i.useRef(new Map),l=i.useRef(new Map),d=o.current,m=r.current,f=l.current,u=t();for(const c of e){if(f.has(c.id))continue;if(d===null){f.set(c.id,"at-rest");continue}const w=m.get(c.authorId);f.set(c.id,w!==void 0&&u-w<et?"handed-off":"dropped")}return i.useEffect(()=>{if(!s)return;o.current=new Set(e.map(w=>w.id));const c=t();for(const w of n)r.current.set(w,c);for(const[w,h]of r.current)c-h>et&&r.current.delete(w);for(const w of l.current.keys())o.current.has(w)||l.current.delete(w)}),f}function br({kind:e}){return e==="thread-error"?a.jsxs("div",{"data-slot":"thread-notice","data-testid":"room-thread-error",className:"text-muted-foreground flex flex-col items-center gap-2 px-[var(--msg-padding-x)] py-6 text-center text-sm",children:[a.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load this thread"}),a.jsx("p",{className:"max-w-sm text-xs",children:"Nothing was lost. Reload to try again."})]}):e==="thread-waiting"?a.jsxs("div",{"data-slot":"thread-notice",className:"flex flex-col gap-2 px-[var(--msg-padding-x)]",children:[a.jsx(se,{className:"h-3 w-24"}),a.jsx(se,{className:"h-3 w-full max-w-sm"})]}):a.jsx("p",{"data-slot":"thread-notice","data-testid":"room-thread-orphan",className:"text-muted-foreground border-b px-[var(--msg-padding-x)] pb-3 text-xs italic",children:"This thread’s first message is gone. Its replies remain."})}function vr({room:e,rootEntryId:n,focusComposer:s,entries:t,reactionFrequents:o,streamStalled:r,streamUnavailable:l,onRetryStream:d,historyLoaded:m,historyFailed:f=!1,landOnRow:u,pushed:c,onClose:w}){const h=i.useMemo(()=>Ee(e.members,e.formerAuthors),[e.members,e.formerAuthors]),g=Dt({room:e,threadRootId:n}),k=he(e.members,e.viewerAuthorId),x=De(),N=i.useMemo(()=>new Map([...h].map(([R,y])=>[R,y.displayName])),[h]),{root:p,replies:b}=i.useMemo(()=>{let R;const y=[];for(const O of t)O.id===n?R=O:J(O)===n&&y.push(O);return{root:R,replies:y}},[t,n]),_=p==null?void 0:p.threadReplyCount,T=_!==void 0&&_>b.length,$=p===void 0||T?-1:1+b.length,C=_e(b.length,_),E=i.useMemo(()=>new Set(b.map(R=>R.id)),[b]),P=i.useMemo(()=>({replyIds:E,inside:!0}),[E]),I=Jn(e.id,P),F=mt(e.id,n),D=yr(b,I,m),M=i.useRef(null),H=i.useCallback(R=>{var y;(y=M.current)==null||y.scrollToRow(R)},[]),L=i.useRef(null);i.useEffect(()=>{var R;s||(R=L.current)==null||R.focus()},[n,s]);const B=R=>{R.key!=="Escape"||R.defaultPrevented||(R.stopPropagation(),w())},W=i.useMemo(()=>{const R=[];if(p===void 0){const y=f?"thread-error":m?"thread-orphan":"thread-waiting";R.push({kind:"notice",id:y,at:"",body:null})}else R.push({kind:"message",id:p.id,payload:p,grouping:{position:"only"},author:Y(ue(p,h),h,x.faces),at:p.createdAt});for(const y of b)R.push({kind:"message",id:y.id,payload:y,grouping:{position:"only"},author:Y(ue(y,h),h,x.faces),at:y.createdAt});return R},[p,b,h,x.faces,f,m]),z=i.useCallback(R=>{if(R.kind==="notice")return a.jsx(br,{kind:R.id});if(R.kind!=="message")return null;const y=R.payload,O=p!==void 0&&y.id===p.id,A=b.findIndex(j=>j.id===y.id),v=a.jsx(Pt,{roomId:e.id,entry:y,rowId:Ie(y.id),author:R.author,authorRef:h.get(y.authorId),authors:h,viewerAuthorId:e.viewerAuthorId,authorNames:N,reactionFrequents:o,streamStalled:r,isMember:k,grouping:{position:"only"},answers:Ot(y,A<=0?p:b[A-1],j=>(p==null?void 0:p.id)===j?p:b.find(U=>U.id===j)),feedPosition:{index:O?1:(p===void 0?0:1)+A+1,total:$}});if(O)return C===0?v:a.jsxs(a.Fragment,{children:[v,a.jsxs("div",{"aria-hidden":!0,"data-testid":"room-thread-divider",className:"flex items-center gap-2 px-[var(--msg-padding-x)] pt-1 pb-2",children:[a.jsx("span",{className:"text-muted-foreground shrink-0 text-xs",children:C===1?"1 reply":`${C} replies`}),a.jsx("span",{className:"bg-border h-px flex-1"})]})]});const S=D.get(y.id)??"at-rest";return a.jsx("div",{className:V(S==="dropped"&&"motion-safe:animate-thread-reply-in",S==="handed-off"&&"motion-safe:animate-reply-settle"),children:v})},[p,b,C,D,e.id,e.viewerAuthorId,h,N,o,r,k,$]),q=i.useCallback(R=>R.kind==="message"?Ie(R.id):void 0,[]);return a.jsx(Tt,{known:x,children:a.jsx(Q.Root,{surface:"room",capabilities:Le,target:g.target,anchor:"rail",children:a.jsxs("section",{ref:L,"aria-label":"Thread","data-testid":"room-thread-panel",tabIndex:-1,onKeyDown:B,className:V("bg-card flex min-h-0 flex-col outline-none",c?"h-full w-full":"w-full border-l"),children:[a.jsxs("header",{className:"flex items-center gap-2 border-b px-3 py-2",children:[a.jsx("button",{type:"button",onClick:w,"aria-label":c?`Back to ${te(e)}`:"Close thread",className:V("focus-ring text-muted-foreground hover:text-foreground relative -ml-1 rounded p-1","after:absolute after:-inset-2.5 md:after:hidden"),children:c?a.jsx(Zn,{"aria-hidden":!0,className:"size-4"}):a.jsx(es,{"aria-hidden":!0,className:"size-4"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"Thread"}),a.jsx("p",{className:"text-muted-foreground truncate text-xs",children:te(e)})]})]}),a.jsx(Q.Timeline,{ref:M,conversationId:`thread-${n}`,label:`Thread in ${te(e)}`,busy:!m&&!f,rows:W,renderRow:z,domIdOf:q,...u===void 0?{}:{landOnRow:u},pending:F,viewerAuthorId:e.viewerAuthorId,className:"py-3",feedTestId:"room-thread-feed"}),a.jsx(Bt,{room:e,entries:t,scope:P,laneScope:"thread",stalled:c&&r===!0,unavailable:l,onRetry:c?d:void 0,onScrollToRow:H}),a.jsx(Ht,{room:e,threadRootId:n,attachments:g.attachments,focusOnMount:s},n)]})})})}const ge="room-thread-split",kr=320,Rr=360,wr=40,Ir=50,Nr=25;function tt(e,n){return n<=0?Nr:Math.min(Math.round(e/n*1e3)/10,Ir)}function jr(e){const n=tt(kr,e),s=Math.round((100-tt(Rr,e))*10)/10;return{minPct:n,maxPct:s,defaultPct:Math.min(Math.max(wr,n),s)}}function Sr(e,n,s){if(e===null||n===null||n<=0)return s.defaultPct;const t=e/n*100;return Math.round(Math.min(Math.max(t,s.minPct),s.maxPct)*10)/10}function Ar(e){try{const n=localStorage.getItem(e),s=n===null?NaN:Number(n);return Number.isFinite(s)&&s>0?s:null}catch{return null}}function Mr(e,n){try{localStorage.setItem(e,String(Math.round(n)))}catch{}}const Cr="react-resizable-panels:room-thread-split";function Or(){try{localStorage.removeItem(Cr)}catch{}}function Tr(){const[e,n]=i.useState(null),[s,t]=i.useState(null);return{ref:i.useCallback(r=>{if(r===null)return;n(r);const l=()=>t(r.offsetWidth);l();const d=new ResizeObserver(l);return d.observe(r),()=>{d.disconnect(),n(null),t(null)}},[]),element:e,width:s,sizing:jr(s??0)}}const _r=`${ge}-room`,nt=`${ge}-thread`,st=`${ge}-handle`,Er=4;function Pr({room:e,thread:n,storageKey:s=ns.ROOM_THREAD_WIDTH}){const{ref:t,element:o,width:r,sizing:l}=Tr(),[d,m]=i.useState(()=>Ar(s)),[f,u]=i.useState(null),c=i.useRef(null),w=Sr(d,r,l),h=r===null||(l.maxPct-l.minPct)/100*r<Er,g=n!==!1;i.useEffect(Or,[]);const k=i.useRef(!1);i.useLayoutEffect(()=>{var b;k.current&&((b=c.current)==null||b.resize(w))},[w,g]);const x=i.useRef(null),N=()=>{var $;const b=($=c.current)==null?void 0:$.getSize(),_=x.current;if(x.current=null,b===void 0||r===null||r<=0||_===b)return;const T=Math.round(b/100*r);m(T),Mr(s,T)},p=f??w;return i.useLayoutEffect(()=>{const b=o==null?void 0:o.querySelector(`[data-panel-resize-handle-id="${st}"]`);b&&(b.setAttribute("aria-controls",nt),b.setAttribute("aria-valuenow",String(Math.round(p))),b.setAttribute("aria-valuemin",String(Math.round(l.minPct))),b.setAttribute("aria-valuemax",String(Math.round(l.maxPct))))}),a.jsx("div",{ref:t,className:"h-full overflow-hidden",children:a.jsxs(ts,{direction:"horizontal",id:ge,onLayout:b=>{k.current=b.length>1,u(k.current?b[1]:null)},children:[a.jsx(Ue,{id:_r,order:1,className:"flex",children:e}),g&&a.jsxs(a.Fragment,{children:[a.jsx(us,{id:st,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:h,onDragging:b=>{var _;b&&(x.current=((_=c.current)==null?void 0:_.getSize())??null)},onKeyDownCapture:b=>{var _,T;h||(x.current=((_=c.current)==null?void 0:_.getSize())??null,!(b.key!=="Home"&&b.key!=="End")&&(b.preventDefault(),(T=c.current)==null||T.resize(b.key==="Home"?l.minPct:l.maxPct)))},onResizeEnd:N}),a.jsx(Ue,{ref:c,id:nt,order:2,defaultSize:w,minSize:l.minPct,maxSize:l.maxPct,className:"flex",children:n})]})]})})}function Jr({roomId:e,threadId:n,entrySeq:s,threadRoute:t,aboveTimeline:o,aboveComposer:r,offerJumpBackIn:l,onComposerFocusChange:d}){const m=ss(),f=ms(),u=os(e),c=u==null?void 0:u.rootEntryId,w=Yo(),h=i.useCallback(()=>{var O;const y=(O=X.getState().open[e])==null?void 0:O.rootEntryId;X.getState().closeThread(e),y!==void 0&&w.arm(y)},[e,w]),g=i.useCallback(y=>{X.getState().openThread(e,y)},[e]),k=rs(e),x=as(e),N=Rs(e,x.isSuccess);ws(e);const p=k.data,b=i.useMemo(()=>x.data??[],[x.data]),_=Dt({room:p});Qo({roomId:e,route:t,urlThreadId:n,openThreadId:c,entries:b,historyLoaded:x.isSuccess});const T=i.useMemo(()=>{var y;return((y=p==null?void 0:p.members.find(O=>O.author.id===p.viewerAuthorId))==null?void 0:y.lastReadSeq)??null},[p]),$=Go(e,T);is(p,b);const C=i.useRef(null),E=i.useRef(void 0),P=i.useCallback(y=>{E.current=y},[]),I=i.useCallback(()=>E.current,[]);i.useLayoutEffect(()=>{E.current=void 0},[e]);const F=i.useCallback(y=>{var O;(O=C.current)==null||O.scrollToRow(y)},[]),D=Xs(e),{loadOlder:M,cursor:H}=D,L=i.useCallback(()=>{const y=mo(b,H);M().then(()=>{y!==null&&requestAnimationFrame(()=>{var O;return(O=C.current)==null?void 0:O.scrollToRow(y.domId)})})},[b,H,M]),B=Ko({roomId:e,entrySeq:s,entries:b,historyLoaded:x.isSuccess}),W=i.useMemo(()=>c===void 0?void 0:{replyIds:new Set(b.filter(O=>J(O)===c).map(O=>O.id)),inside:!1},[b,c]);if(k.isLoading)return a.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:a.jsx($t,{})});if(k.isError||!p)return a.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[a.jsx("p",{className:"text-foreground font-medium",children:"That channel or DM isn’t here"}),a.jsx("p",{className:"max-w-sm",children:"It may be archived, or the link is old."})]});const z=u!==void 0&&a.jsx(vr,{room:p,rootEntryId:u.rootEntryId,focusComposer:u.focusComposer,entries:b,reactionFrequents:p.reactionFrequents,streamStalled:N.stalled,streamUnavailable:N.unavailable,onRetryStream:N.retry,historyLoaded:x.isSuccess,historyFailed:x.isError,...B.threadRow===void 0?{}:{landOnRow:B.threadRow},pushed:m,onClose:h},u.rootEntryId),q=a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[o,a.jsx(Uo,{ref:C,roomId:p.id,roomName:te(p),viewerAuthorId:p.viewerAuthorId,entries:b,members:p.members,formerAuthors:p.formerAuthors,lastReadSeq:$,reactionFrequents:p.reactionFrequents,streamStalled:N.stalled,isLoading:x.isLoading,error:x.error,onAddAgents:()=>We("add",p.id),openThreadId:c,onOpenThread:g,resumeRow:I,...B.roomRow===void 0?{}:{landOnRow:B.roomRow},onTopRow:P,canLoadOlder:D.canLoadOlder,isLoadingOlder:D.isLoadingOlder,onLoadOlder:L}),r,a.jsx(pr,{roomId:p.id}),a.jsx(hr,{roomId:p.id}),a.jsx(Bt,{room:p,entries:b,scope:W,laneScope:"room",stalled:N.stalled,unavailable:N.unavailable,onRetry:N.retry,onScrollToRow:F}),a.jsx(fr,{room:p,hasEntries:b.length>0,onAddAgents:()=>We("add",p.id)}),a.jsx(Ht,{room:p,attachments:_.attachments,offerJumpBackIn:l,onFocusChange:d},p.id)]}),R={surface:"room",capabilities:Le,target:_.target,anchor:"rail"};return m?a.jsx(Q.Root,{...R,children:a.jsx(we,{initial:!1,mode:"wait",children:a.jsx(Ce.div,{initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:16},transition:{duration:.15,ease:[0,0,.2,1]},style:{paddingBottom:f},"data-testid":"room-surface",className:"flex h-full flex-col overflow-hidden",children:z===!1?q:z},z?`thread-${c}`:"room")})}):a.jsx(Q.Root,{...R,children:a.jsx(Pr,{room:q,thread:z})})}export{St as I,$t as R,ao as T,Jr as a,oe as i};
42
+ */const jt={name:"user-x",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]};jt.node;const Us=Z(jt),qs=300;function ae({className:e,children:n}){return a.jsx("span",{className:V("bg-muted text-muted-foreground text-2xs inline-flex max-w-full items-center gap-1 truncate rounded-full px-2 py-0.5",e),children:n})}function St({identity:e,children:n,onViewProfile:s,className:t}){const{kind:o,displayName:r,handle:l,color:d,emoji:m,imageUrl:f,origin:u,agent:c}=e,w=d??"hsl(var(--muted-foreground))",h=typeof u=="object"&&u!==null,g=o==="agent"&&(c==null?void 0:c.working)!=null?c.working:null,[k,x]=i.useState(!1),N=i.useRef(!1),p=i.useRef(null),b=Ut({onLongPress:()=>{N.current&&x(!0)}});return a.jsxs(As,{open:k,onOpenChange:x,openDelay:qs,children:[a.jsx(Cs,{asChild:!0,ref:p,"data-gesture-priority":"",...b,onPointerDown:_=>{N.current=_.pointerType==="touch"||_.pointerType==="pen",b.onPointerDown(_)},children:n}),a.jsxs(Ms,{"data-slot":"identity-hover-card",align:"start",className:V("flex w-64 flex-col gap-0 overflow-hidden p-0",t),children:[a.jsxs("div",{className:"flex items-center gap-3 p-3",children:[a.jsx(qt,{"aria-hidden":!0,color:w,emoji:m,imageUrl:f,fallback:Wt(r),kind:o,origin:u,status:g?"working":"idle",size:"md"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-foreground truncate text-sm font-semibold",children:r}),l&&a.jsxs("p",{className:"text-muted-foreground truncate text-xs font-medium",children:["@",l]})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1.5 px-3 pb-3 empty:hidden",children:[o==="agent"&&((c==null?void 0:c.runtime)||(c==null?void 0:c.model))&&a.jsx(ae,{children:[c.runtime,c.model].filter(Boolean).join(" · ")}),g&&a.jsxs(ae,{className:"bg-status-success-bg text-status-success-fg",children:["Working · ",Ss(g.forMs)]}),o==="human"&&a.jsx(ae,{children:h?u.platform:"On this machine"}),o==="agent"&&(c==null?void 0:c.managedBy)&&a.jsxs(ae,{children:["Managed by"," ",c.managedBy.handle?`@${c.managedBy.handle}`:c.managedBy.displayName]})]}),s?a.jsx("button",{type:"button","data-slot":"identity-hover-card-profile",onClick:()=>{var _;(_=p.current)==null||_.focus(),s()},className:"border-border hover:bg-accent focus-visible:ring-ring text-brand-text mt-auto flex w-full items-center border-t px-3 py-2 text-left text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none",children:"View profile"}):a.jsxs("div",{className:"border-border mt-auto flex items-center justify-between border-t px-3 py-2",children:[a.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:"View profile"}),a.jsx("span",{className:"text-muted-foreground text-3xs tracking-wide uppercase",children:"soon"})]})]})]})}function At(e,n={}){const s=ne();return Kt({queryKey:ee.sessions(e??""),queryFn:()=>s.listRoomSessions(e),enabled:e!==null&&n.enabled===!0})}function Ws(){const e=ne();return re({mutationFn:({roomId:n,authorId:s})=>e.haltRoomAgent(n,s),meta:{errorLabel:"Couldn’t stop this agent"}})}function Ks(){const e=ne();return re({mutationFn:({roomId:n,authorId:s})=>e.promoteHold(n,s),meta:{errorLabel:"Couldn’t ask to be answered first"}})}function Gs(){const e=ne(),n=Se();return re({onMutate:({roomId:s,entryId:t,emoji:o,viewerAuthorId:r})=>{var u;const l=n.getQueryData(ee.entries(s)),d=(u=l==null?void 0:l.find(c=>c.id===t))==null?void 0:u.reactions,{reactions:m,on:f}=Ke(d,o,r);return n.setQueryData(ee.entries(s),c=>Ge(c,t,m)),{on:f}},mutationFn:({roomId:s,entryId:t,emoji:o,viewerAuthorId:r})=>{var m,f;const l=n.getQueryData(ee.entries(s)),d=((f=(m=l==null?void 0:l.find(u=>u.id===t))==null?void 0:m.reactions)==null?void 0:f.some(u=>u.emoji===o&&u.authorIds.includes(r)))??!1;return e.toggleReaction(s,t,{emoji:o,on:d})},onError:(s,{roomId:t,entryId:o,emoji:r,viewerAuthorId:l},d)=>{d!==void 0&&n.setQueryData(ee.entries(t),m=>{var c;const f=(c=m==null?void 0:m.find(w=>w.id===o))==null?void 0:c.reactions,{reactions:u}=Ke(f,r,l,!d.on);return Ge(m,o,u)})},onSuccess:({frequents:s},{roomId:t})=>{n.setQueryData(ee.detail(t),o=>o&&{...o,reactionFrequents:s})},meta:{errorLabel:"Couldn’t add your reaction",errorToastId:"room-reaction"}})}function J(e){return e.threadRootEntryId??e.parentEntryId}function Ct(e){return J(e)??e.id}function _e(e,n){return Math.max(n??0,e)}function Vs(e,n,s){let t=e[0],o=0;for(const r of e)r.seq>t.seq&&(t=r),n!==null&&r.seq>n&&(o+=1);return{count:_e(e.length,s),lastAt:t.createdAt,unread:o}}function Xs(e){const n=ne(),s=Se(),t=Gt(e),o=ye(u=>{var c;return e===null?null:((c=u.paging[e])==null?void 0:c.cursor)??null}),r=re({mutationFn:async u=>{var x;const c=(x=ye.getState().paging[u])==null?void 0:x.cursor;if(c==null)return;const w=await n.listRoomEntries(u,{before:c,limit:He}),h=ee.entries(u),g=s.getQueryData(h),k=Vt(g,w);s.setQueryData(h,k),ye.getState().notePage(u,Xt(w)??c,Yt(w,He)||k.length===((g==null?void 0:g.length)??0))},meta:{errorLabel:"Couldn't load older messages"}}),{mutateAsync:l,isPending:d}=r,m=i.useRef(!1),f=i.useCallback(async()=>{if(!(e===null||m.current)){m.current=!0;try{await l(e).catch(()=>{})}finally{m.current=!1}}},[e,l]);return{canLoadOlder:t,isLoadingOlder:d,cursor:o,loadOlder:f}}function Ys(e){return a.jsx(js,{code:e.code,isIncomplete:e.isIncomplete})}const Qs=[{language:Ns,component:Ys}],Js={turn_failed:{Icon:rn,tone:"text-status-warning"},agent_busy:{Icon:on},agent_gone:{Icon:Us,tone:"text-status-warning"},agent_left:{Icon:Xe,tone:"text-status-warning"},room_archived:{Icon:sn},runtime_gone:{Icon:zs,tone:"text-status-warning"},agent_paused:{Icon:nn},agent_declined:{Icon:_s},agent_unavailable:{Icon:tn},awaiting_approval:{Icon:Ds,tone:"text-status-warning"},halted:{Icon:en},budget_reached:{Icon:Zt},cascade_stopped:{Icon:Jt},addressing_changed:{Icon:Ls},bridge_blocked:{Icon:Ts,tone:"text-status-warning"},bridge_undelivered:{Icon:Qt,tone:"text-status-warning"},bridge_rate_limited:{Icon:Hs},bridge_second_agent_refused:{Icon:Xe},bridge_disconnected:{Icon:Fs},bridge_agent_swapped:{Icon:ls},bridge_history_note:{Icon:Os}},Zs={Icon:an},be=80;function eo(e){const n=e.trim();if(n.length<=be)return n;const s=n.slice(0,be),t=s.lastIndexOf(" ");return`${(t>be/2?s.slice(0,t):s).trimEnd()}…`}function to(e,n,s){const t=no(e,s),o=r=>a.jsx("a",{href:n.href,onClick:n.onOpen,"data-testid":"room-notice-session-link",className:"focus-ring hover:text-foreground rounded py-2 font-medium underline underline-offset-2",children:r});return t===null?a.jsxs(a.Fragment,{children:[e," ",o("Open chat")]}):a.jsxs(a.Fragment,{children:[e.slice(0,t.index),o(t.words),e.slice(t.index+t.words.length)]})}function no(e,n){if(n!==void 0){const t=ln(n),o=e.lastIndexOf(t);if(o!==-1)return{index:o,words:t}}const s=dn.exec(e);return s===null?null:{index:s.index,words:s[0]}}function so({entry:e,feedPosition:n,rowId:s,sessionLink:t,subjectName:o}){const{Icon:r,tone:l}=(e.body.notice&&Js[e.body.notice])??Zs;return a.jsxs("p",{id:s,"data-slot":"notice-row","data-testid":"room-notice","data-notice":e.body.notice??"unknown",...n&&{role:"article","aria-label":eo(e.body.text)},...Oe(n),className:V("focus-visible:ring-ring flex items-start gap-2 px-[var(--msg-padding-x)] py-2 text-xs outline-none focus-visible:ring-2",l??"text-muted-foreground"),children:[a.jsx(r,{"aria-hidden":!0,className:"mt-px size-3.5 shrink-0"}),a.jsx("span",{children:t?to(e.body.text,t,o):e.body.text})]})}const oo=Es.moment;function ro({entry:e,moment:n,subject:s,subjectIdentity:t,feedPosition:o,rowId:r}){const l=Te(e.createdAt);return a.jsx("div",{id:r,"data-slot":"moment-row","data-testid":"room-moment","data-moment":n.kind,role:"article","aria-label":`Moment: ${e.body.text}`,...Oe(o),className:"focus-visible:ring-ring px-[var(--msg-padding-x)] py-1 outline-none focus-visible:ring-2",children:a.jsxs("div",{className:"border-border/60 bg-muted/40 flex items-center gap-2.5 rounded-lg border px-3 py-2",children:[a.jsx(St,{identity:{kind:s.kind,displayName:s.displayName,handle:t==null?void 0:t.handle,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl,origin:t==null?void 0:t.origin,agent:t==null?void 0:t.agent},children:a.jsxs("span",{"data-testid":"room-moment-identity",className:"flex shrink-0 items-center",children:[a.jsx(gt,{author:s}),a.jsx("span",{className:"sr-only",children:s.displayName})]})}),a.jsx(oo,{"data-testid":"room-moment-mark","aria-hidden":!0,className:"text-muted-foreground size-3.5 shrink-0"}),a.jsx("p",{className:"min-w-0 flex-1 text-sm",children:e.body.text}),l.length>0&&a.jsx("time",{dateTime:e.createdAt,title:xt(e.createdAt),className:"text-msg-timestamp shrink-0 text-xs",children:l})]})})}function ao({id:e,summary:n,open:s,onOpen:t}){const{capabilities:o}=yt(),{count:r,lastAt:l,unread:d}=n,m=Te(l),[f,u]=i.useState({count:r,bumped:!1});f.count!==r&&u({count:r,bumped:!0});const c=f.count===r&&f.bumped;return o.threads?a.jsxs("button",{type:"button",id:e,"data-slot":"thread-reply-row","data-testid":"room-thread-replies","data-unread":d>0?"":void 0,"aria-expanded":s,onClick:t,className:V("focus-ring ml-[calc(var(--msg-padding-x)_+_var(--msg-gutter-width)_+_var(--msg-gap))]","mb-1 w-fit rounded text-left text-xs transition-colors","px-2 py-2 md:px-1 md:py-0.5",d>0?"text-primary hover:text-primary/80 font-medium":"text-muted-foreground hover:text-foreground"),children:[a.jsx("span",{"aria-hidden":!0,className:"mr-1",children:"↳"}),a.jsx("span",{className:V(c&&"motion-safe:animate-count-flip"),"data-testid":"room-thread-reply-count",children:r},r),r===1?" reply":" replies",m.length>0&&a.jsxs(a.Fragment,{children:[" · last ",a.jsx("time",{dateTime:l,title:xt(l),children:m})]}),d>0&&` · ${d} new`]}):null}function io(e,n){const s=le.getState(),t=s.drafts[e]??"",o=t===""||t.endsWith(" ")||t.endsWith(`
43
+ `)?"":" ";s.set(e,`${t}${o}@${n} `)}function lo({roomId:e,entry:n,author:s,viewerAuthorId:t,onViewProfile:o}){const r=Ct(n),l=n.body.text,d=(s==null?void 0:s.id)===t?void 0:(s==null?void 0:s.handle)??void 0,m=s==null?void 0:s.displayName,{copy:f}=cn({toastOnSettle:!0});return i.useMemo(()=>{const u={reply:{id:"reply",label:"Reply in thread",icon:Bs,run:()=>{X.getState().openThread(e,r,!0),Ue.getState().requestFocus(ot(e,r))}},copy:{id:"copy",label:"Copy text",icon:un,run:()=>void f(l)}};return o!==void 0&&(u.profile={id:"profile",label:"View profile",icon:mn,run:o}),d!==void 0&&(u.mention={id:"mention",label:m===void 0?"Mention author":`Mention ${m}`,icon:ds,run:()=>{io(e,d),Ue.getState().requestFocus(e)}}),fs.map(c=>u[c]).filter(c=>c!==void 0)},[e,r,l,d,m,o,f])}function co(e){if(e.kind==="notice")return{kind:"notice"};const n=e.body.moment;return n?{kind:"moment",moment:n}:{kind:"message"}}function Ee(e,n=[]){return new Map([...n.map(s=>[s.author.id,{...s.author,origin:s.origin}]),...e.map(s=>[s.author.id,{...s.author,origin:s.origin}])])}function ue(e,n){const s=e.body.subjectAuthorId;return s===void 0||n.has(e.authorId)?e.authorId:s}function Y(e,n,s){const t=n.get(e),o=rt({record:{kind:(t==null?void 0:t.kind)??"system",id:e,displayName:(t==null?void 0:t.displayName)??"Unknown",emoji:t==null?void 0:t.emoji,color:t==null?void 0:t.color,imageUrl:t==null?void 0:t.imageUrl},override:(t==null?void 0:t.agentRef)===void 0?null:s==null?void 0:s.get(t.agentRef)});return{kind:o.kind,id:e,displayName:(t==null?void 0:t.displayName)??"Unknown",emoji:o.emoji,imageUrl:o.imageUrl,color:o.color,isExternal:typeof(t==null?void 0:t.origin)=="object"&&(t==null?void 0:t.origin)!==null,...(t==null?void 0:t.retired)===!0?{retired:!0}:{}}}function uo(e){const n=new Set;for(const r of e)J(r)===null&&n.add(r.id);const s=[],t=new Map,o=new Set;for(const r of e){const l=J(r);if(l===null){s.push(r);continue}if(!n.has(l)){s.push(r),o.add(r.id);continue}const d=t.get(l);d?d.push(r):t.set(l,[r])}return{topLevel:s,repliesByRoot:t,orphaned:o}}function Mt(e){return`thread-${e}`}function me(e){return`thread-row-${e}`}function Ie(e){return`thread-panel-entry-${e}`}function fe(e){return`room-entry-${e}`}function Pe(e,n){const s=e.find(d=>d.id===n);if(s===void 0)return null;const t=J(s)??null,o={rowId:n,domId:fe(n)};if(t===null)return o;const r=e.find(d=>d.id===t);return r!==void 0&&(J(r)??null)===null?{rowId:Mt(t),domId:me(t)}:o}function mo(e,n){if(n===null)return null;const s=e.find(t=>t.seq===n);return s===void 0?null:Pe(e,s.id)}const Ye=48;function Ot(e,n,s){const t=e.body.answersEntryId;if(t===void 0||t===e.id||n!==void 0&&n.id===t)return null;const o=s(t);if(o===void 0)return null;const r=o.body.text.replace(/\s+/gu," ").trim();return r.length===0?null:{entryId:t,excerpt:r.length>Ye?`${r.slice(0,Ye).trimEnd()}…`:r}}function fo(e,n){const s=new Map;for(const t of e){const o=n[t.projectPath];if(!o)continue;const r=fn({runtime:o.runtime,model:o.model});s.set(at(t.projectPath),{memberId:t.id,visual:pn(o),runtime:r.label,...r.modelLabel!==null&&{model:r.modelLabel}})}return s}function po(e){const n=new Map;for(const[s,t]of e)n.set(s,t.visual);return n}const ho={info:new Map,faces:new Map},$e=i.createContext(ho);function Tt({known:e,children:n}){return a.jsx($e.Provider,{value:e,children:n})}function De(){const e=it(),n=i.useMemo(()=>{var l;return((l=e.data)==null?void 0:l.agents)??[]},[e.data]),s=i.useMemo(()=>n.map(l=>l.projectPath),[n]),t=lt(s),o=i.useMemo(()=>fo(n,t.data??{}),[n,t.data]),r=i.useMemo(()=>po(o),[o]);return i.useMemo(()=>({info:o,faces:r}),[o,r])}function Ne(e){const n=i.useContext($e);return e===void 0?void 0:n.info.get(e)}function go(){return i.useContext($e).faces}function xo({loading:e,onLoad:n}){return a.jsx("div",{className:"flex justify-center px-4 py-3",children:a.jsxs(Ae,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:e,"data-testid":"room-load-older",className:"text-muted-foreground hover:text-foreground h-7 gap-2 text-xs",children:[e&&a.jsx(hn,{size:"xs"}),e?"Loading older messages…":"Older messages"]})})}function yo({showAuthorHeader:e,headerId:n,displayName:s,time:t,summary:o,contentId:r,summaryId:l,feedPosition:d}){return{...e?{"aria-labelledby":n}:{"aria-label":t.length>0?`${s}, ${t}`:s},"aria-describedby":o===null?r:l,...Oe(d)}}const de=120,bo="code block";function vo(e){if(e.length<=de&&!e.includes("```"))return null;const n=ko(e);return n.length===0?null:n}function ko(e){const n=e.replace(/```[\s\S]*?(?:```|$)/g,` ${bo} `).replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+)/gm,"").replace(/^\s{0,3}\|?[\s:|-]*\|[\s:|-]*$/gm," ").replace(/\|/g," ").replace(/[*_~]{1,3}/g,"").replace(/\s+/g," ").trim();if(n.length<=de)return n;const s=Ro(n,de),t=s.lastIndexOf(" ");return`${(t>de/2?s.slice(0,t):s).trimEnd()}…`}function Ro(e,n){if(typeof Intl.Segmenter=="function"){const t=new Intl.Segmenter(void 0,{granularity:"grapheme"});let o="";for(const{segment:r}of t.segment(e)){if(o.length+r.length>n)break;o+=r}return o}let s="";for(const t of e){if(s.length+t.length>n)break;s+=t}return s}function wo({roomId:e,entry:n,viewerAuthorId:s,reactionFrequents:t,streamStalled:o,isMember:r=!0}){const l=Gs(),d=o===!0||!r,m=i.useMemo(()=>n.reactions??[],[n.reactions]),f=i.useMemo(()=>m.filter(w=>ps(w,s)).map(w=>w.emoji),[m,s]),u=i.useCallback(w=>l.mutate({roomId:e,entryId:n.id,emoji:w,viewerAuthorId:s}),[l,e,n.id,s]),c=i.useMemo(()=>({quick:t,mine:f,onToggle:u,disabled:d}),[t,f,u,d]);return{reactions:m,toggle:u,quickRow:c}}function Io({barRef:e,pillsRef:n,hasReactions:s}){return t=>{var r,l;if(t.target!==t.currentTarget)return;const{key:o}=t;if(o==="ArrowDown"&&s){t.preventDefault(),(r=n.current)==null||r.focusFirst();return}o!=="ArrowRight"&&o!=="Enter"||(t.preventDefault(),(l=e.current)==null||l.focusFirst())}}function No(e,n){var c,w;const s=n.body.subjectAuthorId,t=n.body.notice,o=n.kind==="notice"&&t!==void 0&&s!==void 0&&gn.includes(t),r=At(e,{enabled:o}),l=Ce(),d=Se(),m=ne(),f=o?((w=(c=r.data)==null?void 0:c.bindings.find(h=>h.authorId===s))==null?void 0:w.sessionId)??null:null,u=i.useCallback(h=>{h.button!==0||h.metaKey||h.ctrlKey||h.shiftKey||h.altKey||(h.preventDefault(),!(f===null||s===void 0)&&xn({queryClient:d,transport:m},e,s).then(g=>{g.kind!=="none"&&l(ce({session:g.kind==="bound"?g.sessionId:f}))}))},[s,l,d,e,f,m]);return i.useMemo(()=>f===null?null:{href:yn({session:f}),onOpen:u},[u,f])}const pe="mention",Fe="author_id",jo={[pe]:[Fe]},So=[pe];function Ao(e,n){if(!n||n.length===0)return e;const s=Co(e,n);if(s.length===0)return e;let t=e;for(let o=s.length-1;o>=0;o--){const{offset:r,length:l,authorId:d}=s[o],m=t.slice(0,r),f=t.slice(r,r+l),u=t.slice(r+l);t=`${m}<${pe} ${Fe}="${d}">${f}</${pe}>${u}`}return t}function Co(e,n){const s=[...n].sort((r,l)=>r.offset-l.offset),t=[];let o=0;for(const r of s)r.offset<o||r.offset+r.length>e.length||(t.push(r),o=r.offset+r.length);return t}const Mo=new Map,_t=i.createContext(Mo);function Oo({authors:e,children:n}){return a.jsx(_t.Provider,{value:e,children:n})}function To(e){const n=i.useContext(_t);return e===void 0?void 0:n.get(e)}function _o(e){return typeof e=="string"?e.replace(/^@/,""):""}function Eo({authorId:e,children:n}){const s=To(e),t=Ne(s==null?void 0:s.agentRef),{open:o}=dt();if(!s)return a.jsx(Ve,{kind:"human",label:_o(n),resolved:!1});const r=rt({record:s,override:t==null?void 0:t.visual}),l=ct(s,t==null?void 0:t.memberId),d=l===void 0?void 0:()=>o(l),m=d?{role:"button",tabIndex:0,"aria-label":`View ${s.displayName}’s profile`,onClick:d,onKeyDown:f=>{f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),d())}}:{};return a.jsx(St,{onViewProfile:d,identity:{kind:s.kind,displayName:s.displayName,handle:s.handle??void 0,color:r.color,emoji:r.emoji,imageUrl:r.imageUrl,origin:s.origin,agent:t&&{runtime:t.runtime,...t.model&&{model:t.model}}},children:a.jsx(Ve,{kind:s.kind,label:s.displayName,handle:s.handle??void 0,color:s.color,origin:s.origin,resolved:!0,interactive:d!==void 0,...m})})}function Po(e){return{mention:n=>{const s=n[Fe],t=typeof s=="string"?s:void 0;return!t||!e.has(t)?a.jsx(a.Fragment,{children:n.children}):a.jsx(Eo,{authorId:t,children:n.children})}}}function $o({entry:e,authors:n}){const s=i.useMemo(()=>Ao(e.body.text,e.mentionSpans),[e.body.text,e.mentionSpans]),t=i.useMemo(()=>{var r;return new Set(((r=e.mentionSpans)==null?void 0:r.map(l=>l.authorId))??[])},[e.mentionSpans]),o=i.useMemo(()=>Po(t),[t]);return a.jsx(Oo,{authors:n,children:a.jsx(Is,{content:s,className:"msg-prose",allowedTags:jo,literalTagContent:So,components:o,renderers:Qs})})}function Do(e){return function(s){return a.jsx($o,{entry:s,authors:e})}}const Et="the top folder";function Qe(e){return e.slice(e.lastIndexOf("/")+1)}function Fo(e){const n=e.lastIndexOf("/");return n===-1?"":e.slice(0,n)}function Lo(e){return e===""?Et:`${e}/`}function ve(e){return e.target!==void 0?e.target===""?Et:e.target:Lo(Fo(e.paths[0]??""))}function zo(e,n){const s=e.paths[0]??"",t=e.target;switch(e.kind){case"edit":return`${n} edited ${t??s}`;case"add":return`${n} added ${t??s}`;case"upload":return e.pathCount===1?`${n} uploaded ${Qe(s)} to ${ve(e)}`:`${n} uploaded ${e.pathCount} files to ${ve(e)}`;case"rename":{const o=e.from??"";return t!==void 0?`${n} renamed ${o} to ${t}`:o.endsWith("/")?`${n} renamed ${o}`:`${n} renamed ${o} to ${s}`}case"delete":return t!==void 0?`${n} deleted ${t}`:e.pathCount===1?`${n} deleted ${s}`:`${n} deleted ${e.pathCount} files`;case"from-attachment":return`${n} saved ${Qe(s)} from the chat to ${ve(e)}`}}const Bo=i.lazy(()=>bn(()=>import("./index-B3eeEDWj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.SaveToRoomFilesButton})));function Pt({roomId:e,entry:n,author:s,authorRef:t,authors:o,viewerAuthorId:r,authorNames:l,reactionFrequents:d,streamStalled:m,isMember:f=!0,grouping:u,orphanedReply:c,answers:w,feedPosition:h,rowId:g}){const k=Te(n.createdAt),x=i.useMemo(()=>{const K=vo(n.body.text),xe=hs(n.attachments??[]);if(xe===null)return K;const Be=K??n.body.text.trim();return Be.length>0?`${Be} ${xe}`:xe},[n.body.text,n.attachments]),N=i.useId(),p=`${N}-author`,b=`${N}-content`,_=`${N}-summary`,T=i.useRef(null),$=i.useRef(null),M=i.useRef(null),{reactions:E,toggle:P,quickRow:I}=wo({roomId:e,entry:n,viewerAuthorId:r,reactionFrequents:d,streamStalled:m,isMember:f}),F=Ne(t==null?void 0:t.agentRef),{open:D}=dt(),C=t===void 0?void 0:ct(t,F==null?void 0:F.memberId),B=i.useCallback(()=>{C!==void 0&&D(C)},[D,C]),L=C===void 0?void 0:B,H=lo({roomId:e,entry:n,author:t,viewerAuthorId:r,onViewProfile:L}),W=Io({barRef:$,pillsRef:M,hasReactions:E.length>0}),z=i.useCallback(()=>{var K;return(K=T.current)==null?void 0:K.focus()},[]),U=i.useMemo(()=>Do(o),[o]),R=i.useCallback(K=>a.jsx(i.Suspense,{fallback:null,children:a.jsx(Bo,{roomId:e,attachment:K})}),[e]),y=go(),O=n.body.subjectAuthorId??n.authorId,A=o.get(O),v=Ne(A==null?void 0:A.agentRef),S=No(e,n),j=co(n);if(j.kind==="notice")return a.jsx(so,{entry:n,feedPosition:h,rowId:g,sessionLink:S,subjectName:A==null?void 0:A.displayName});if(j.kind==="moment")return a.jsx(ro,{entry:n,moment:j.moment,subject:O===n.authorId?s:Y(O,o,y),subjectIdentity:{handle:(A==null?void 0:A.handle)??void 0,origin:A==null?void 0:A.origin,agent:v&&{runtime:v.runtime,...v.model&&{model:v.model}}},feedPosition:h,rowId:g});const q=u.position==="first"||u.position==="only";return a.jsxs(G.Root,{ref:T,id:g,position:u.position,actions:H,reactions:I,"data-testid":"room-entry",tabIndex:0,...yo({showAuthorHeader:q,headerId:p,displayName:s.displayName,time:k,summary:x,contentId:b,summaryId:_,feedPosition:h}),onKeyDown:W,children:[a.jsx(G.Gutter,{author:s,at:n.createdAt,onViewProfile:L,isSelf:n.authorId===r}),a.jsxs(G.Body,{children:[a.jsx(G.Author,{id:p,author:s,at:n.createdAt,origin:t==null?void 0:t.origin}),c===!0&&a.jsx("p",{"data-testid":"room-entry-orphan",className:"text-muted-foreground text-xs italic",children:"Replying to an earlier message"}),w!=null&&a.jsx("p",{"data-testid":"room-entry-answers",className:"text-muted-foreground mb-1 truncate text-xs italic",children:`Answering “${w.excerpt}”`}),a.jsx(G.Content,{id:b,className:"[&_:not(pre)>code]:wrap-anywhere [&_pre]:overflow-x-auto",children:n.body.fileChange?a.jsx("p",{"data-testid":"room-entry-file-change",className:"wrap-anywhere",children:zo(n.body.fileChange,(A==null?void 0:A.displayName)??"Somebody")}):U(n,{rowId:n.id,isStreaming:!1})}),x!==null&&a.jsx("span",{id:_,className:"hidden",children:x}),a.jsx(G.Attachments,{items:n.attachments??[],renderAction:f?R:void 0}),a.jsx(G.Reactions,{ref:M,reactions:E,viewerAuthorId:r,names:l,frequents:d,onToggle:P,disabled:m===!0||!f,onExit:z}),a.jsx(G.Actions,{actions:H,reactions:I,barRef:$,onExit:z})]})]})}const Ho="room-load-older",Uo=4;function $t({roomName:e}){return a.jsx(gs,{label:e===void 0?"Messages":`Messages in ${e}`,busy:!0,className:"flex flex-col gap-4 p-4","data-testid":"room-timeline-loading",children:Array.from({length:Uo},(n,s)=>a.jsxs("div",{className:"flex gap-3",children:[a.jsx(se,{className:"size-7 shrink-0 rounded-full"}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[a.jsx(se,{className:"h-3 w-24"}),a.jsx(se,{className:"h-3 w-full max-w-md"})]})]},`room-skeleton-${s}`))})}function qo({roomId:e,roomName:n,viewerAuthorId:s,entries:t,members:o,formerAuthors:r,lastReadSeq:l,reactionFrequents:d,streamStalled:m,isLoading:f,error:u,onAddAgents:c,openThreadId:w,onOpenThread:h,resumeRow:g,landOnRow:k,onTopRow:x,canLoadOlder:N=!1,isLoadingOlder:p=!1,onLoadOlder:b,ref:_}){const T=i.useMemo(()=>Ee(o,r),[o,r]),$=he(o,s),M=De(),E=i.useMemo(()=>new Map([...T].map(([y,O])=>[y,O.displayName])),[T]),P=ut(),I=mt(e,null),{topLevel:F,repliesByRoot:D,orphaned:C}=i.useMemo(()=>uo(t),[t]),B=i.useMemo(()=>new Map(t.map(y=>[y.id,y])),[t]),L=i.useMemo(()=>{const y=vn(F,l),O=kn(F.map(v=>({id:v.id,authorId:v.body.moment?`moment:${v.id}`:v.authorId,timestamp:v.createdAt})),{now:P,lastSeenId:y.lastSeenId,unreadFromStart:y.fromStart}),A=[];N&&!f&&A.push({kind:"load-older",id:Ho});for(const v of O){if(v.kind==="day-divider"){A.push({kind:"day-divider",id:v.key,label:v.label});continue}if(v.kind==="unread-divider"){A.push({kind:"unread-divider",id:v.key});continue}const S=F[v.index];A.push({kind:"message",id:S.id,entry:S,grouping:v.grouping,position:v.index+1,answers:Ot(S,F[v.index-1],B.get.bind(B))});const j=D.get(S.id);j&&A.push({kind:"thread-reply",id:Mt(S.id),rootId:S.id,replies:j,totalReplies:S.threadReplyCount})}return A},[F,D,B,l,P,N,f]),H=i.useMemo(()=>L.map(y=>y.kind==="load-older"?{kind:"notice",id:y.id,at:"",body:null}:y.kind==="day-divider"?{kind:"day-divider",id:y.id,label:y.label}:y.kind==="unread-divider"?{kind:"unread-divider",id:y.id}:y.kind==="thread-reply"?{kind:"thread-reply",id:y.id,rootId:y.rootId,replyCount:_e(y.replies.length,y.totalReplies),lastAt:y.replies[y.replies.length-1].createdAt}:{kind:"message",id:y.id,payload:y.entry,grouping:y.grouping,author:Y(ue(y.entry,T),T,M.faces),at:y.entry.createdAt}),[L,T,M.faces]),W=i.useCallback((y,O)=>{const A=L[O.index];if(A.kind==="load-older")return b===void 0?null:a.jsx(xo,{loading:p,onLoad:b});if(A.kind==="day-divider")return a.jsx(xs,{label:A.label});if(A.kind==="unread-divider")return a.jsx(ys,{});if(A.kind==="thread-reply"){if(O.onOpenThread===void 0)return null;const S=O.onOpenThread;return a.jsx(ao,{id:me(A.rootId),summary:Vs(A.replies,l,A.totalReplies),open:w===A.rootId,onOpen:()=>S(A.rootId)})}const v=ue(A.entry,T);return a.jsx(Pt,{roomId:e,entry:A.entry,author:Y(v,T,M.faces),authorRef:T.get(v),authors:T,viewerAuthorId:s,authorNames:E,reactionFrequents:d,streamStalled:m,isMember:$,grouping:A.grouping,orphanedReply:C.has(A.entry.id),answers:A.answers,feedPosition:{index:A.position,total:-1},rowId:fe(A.entry.id)})},[L,e,T,M.faces,s,E,d,m,$,C,l,w,p,b]),z=i.useCallback(y=>{if(y.kind==="message")return fe(y.id);if(y.kind==="thread-reply")return me(y.rootId)},[]);if(u)return a.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[a.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load these messages"}),a.jsx("p",{className:"max-w-sm",children:"Nothing was lost. Reload to try again."})]});const U=o.some(y=>y.author.kind==="agent"),R=a.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[a.jsx(Rn,{className:"text-muted-foreground/50 size-8","aria-hidden":!0}),a.jsx("p",{className:"text-foreground font-medium",children:"Nothing said here yet"}),a.jsx("p",{className:"max-w-sm",children:U?"Say something to get it going.":"Nothing answers until you add an agent."}),a.jsx(Ae,{type:"button",size:"sm",variant:U?"ghost":"default",onClick:c,className:"mt-1",children:U?"Add more agents":"Add agents"})]});return a.jsx(Tt,{known:M,children:a.jsx(Q.Timeline,{ref:_,conversationId:e,label:`Messages in ${n}`,rows:H,renderRow:W,onOpenThread:h,domIdOf:z,...g===void 0?{}:{resumeRow:g},...k===void 0?{}:{landOnRow:k},...x===void 0?{}:{onTopRow:x},pending:I,viewerAuthorId:s,loading:f?a.jsx($t,{roomName:n}):void 0,empty:R,feedTestId:"room-timeline"})})}const Le={reactions:!0,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!0,turnStatus:!1,asks:!0};function Wo(e){const n=ne(),[s,t]=i.useState([]),o=i.useRef(new Map),r=i.useCallback(h=>{const g=h.map(k=>({id:crypto.randomUUID(),file:k,status:"pending",progress:0}));t(k=>[...k,...g])},[]),l=i.useCallback(h=>{o.current.delete(h),t(g=>g.filter(k=>k.id!==h))},[]),d=i.useCallback(h=>{if(!h){o.current.clear(),t([]);return}const g=new Set(h);for(const k of g)o.current.delete(k);t(k=>k.filter(x=>!g.has(x.id)))},[]),m=i.useCallback(h=>{o.current.delete(h),t(g=>g.map(k=>k.id===h&&k.status==="error"?{...k,status:"pending",progress:0,error:void 0}:k))},[]),f=i.useRef(null),u=re({meta:{suppressErrorToast:!0},mutationFn:async h=>{t(N=>N.map(p=>h.some(b=>b.id===p.id)?{...p,status:"uploading"}:p));const g=N=>{t(p=>p.map(b=>b.status==="uploading"?{...b,progress:N.percentage}:b))},k=new AbortController;f.current=k;const x=h.map(N=>N.file);return n.uploadRoomAttachments(e,x,g,k.signal)},onSettled:()=>{f.current=null},onSuccess:(h,g)=>{g.forEach((k,x)=>{const N=h[x];N&&o.current.set(k.id,N.id)}),t(k=>k.map(x=>g.findIndex(p=>p.id===x.id)===-1?x:{...x,status:"uploaded",progress:100}))},onError:h=>{t(g=>g.map(k=>k.status==="uploading"?{...k,status:"error",error:h.message}:k))}}),c=i.useCallback(()=>{var h;(h=f.current)==null||h.abort()},[]),w=i.useCallback(async()=>{const h=s.filter(k=>k.status==="error");if(h.length>0)throw new Error(h.length===1?`${h[0].file.name} didn’t upload. Try again or remove it.`:`${h.length} files didn’t upload. Try again or remove them.`);const g=s.filter(k=>k.status==="pending");return g.length>0&&await u.mutateAsync(g),s.map(k=>o.current.get(k.id)).filter(k=>k!==void 0)},[s,u]);return{pendingFiles:s,addFiles:r,removeFile:l,retryFile:m,clearFiles:d,cancelUpload:c,uploadAndGetIds:w,hasPendingFiles:s.length>0,hasFailedUpload:s.some(h=>h.status==="error"),isUploading:u.isPending}}function Dt(e){const{room:n,threadRootId:s}=e,t=bs(),o=vs(),r=Wo((n==null?void 0:n.id)??""),l=n!==void 0&&he(n.members,n.viewerAuthorId),d=i.useRef({attachments:r,post:t,reply:o,room:n,threadRootId:s});i.useEffect(()=>{d.current={attachments:r,post:t,reply:o,room:n,threadRootId:s}});const m=i.useCallback(p=>d.current.attachments.addFiles(p),[]),f=i.useCallback(p=>d.current.attachments.removeFile(p),[]),u=i.useCallback(p=>d.current.attachments.retryFile(p),[]),c=i.useCallback(()=>d.current.attachments.cancelUpload(),[]),{pendingFiles:w,hasFailedUpload:h,isUploading:g}=r,k=i.useMemo(()=>({staged:w,add:m,remove:f,retry:u,cancel:c,hasFailed:h,isUploading:g,holdsSendWhileUploading:!1}),[w,h,g,m,f,u,c]),x=i.useCallback(async p=>{const{attachments:b,post:_,reply:T,room:$,threadRootId:M}=d.current;if($===void 0)throw new Error("That room isn’t loaded yet.");if($.archived)throw new Error("This room is archived.");Re.getState().recordOpened("room",$.id);const E=wn(),P=b.pendingFiles.map(C=>C.file.name),I=b.pendingFiles.map(C=>C.id),F=await b.uploadAndGetIds();b.clearFiles(I);const D=p.parentEntryId??M;if(D!==void 0){T.mutate({roomId:$.id,rootEntryId:D,text:p.text,clientId:E,attachmentIds:F,attachmentNames:P});return}_.mutate({roomId:$.id,text:p.text,clientId:E,attachmentIds:F,attachmentNames:P})},[]);return{target:i.useMemo(()=>({kind:"room",id:(n==null?void 0:n.id)??"",placeholder:n===void 0?"Message…":s===void 0?`Message ${te(n)}…`:"Reply in this thread…",canSend:n!==void 0&&!n.archived&&l,...n===void 0?{canSendReason:"Still opening this room…"}:n.archived?{canSendReason:"This room is archived. You can read it, but not add to it."}:l?{}:{canSendReason:ft},send:x,attachments:k}),[n,s,l,k,x]),attachments:r}}function Ko(e){const{roomId:n,entrySeq:s,entries:t,historyLoaded:o}=e,r=s===void 0?null:`${n}:${s}`,l=i.useMemo(()=>{if(s===void 0)return null;const g=t.find(p=>p.seq===s);if(g===void 0)return null;const k=Pe(t,g.id);if(k===null)return null;const x=J(g)??null,N=x!==null&&k.rowId!==g.id;return{roomRowId:k.rowId,threadRootId:N?x:null,entryId:g.id}},[t,s]),d=i.useRef(null),m=(l==null?void 0:l.threadRootId)??null;i.useEffect(()=>{r===null||m===null||d.current!==r&&(d.current=r,X.getState().openThread(n,m))},[r,n,m]);const f=i.useRef(null);i.useEffect(()=>{r===null||!o||l===null&&f.current!==r&&(f.current=r,pt.info("That message isn’t in the loaded history",{description:"Only recent messages are open. Nothing was lost."}))},[r,o,l]);const u=i.useRef(null),c=i.useCallback(()=>{if(!(r===null||u.current===r))return u.current=r,l==null?void 0:l.roomRowId},[r,l]),w=i.useRef(null),h=i.useCallback(()=>{if(!(r===null||w.current===r))return w.current=r,(l==null?void 0:l.threadRootId)===null||l==null?void 0:l.entryId},[r,l]);return{roomRow:s===void 0?void 0:c,threadRow:s===void 0?void 0:h}}function Go(e,n){const[s,t]=i.useState({roomId:null,seq:null});return s.roomId===e?s.seq:e===null?(t({roomId:null,seq:null}),null):n===null?null:(t({roomId:e,seq:n}),n)}const Vo=600;function Xo(e){return document.getElementById(me(e))??document.getElementById(fe(e))}function Yo(){const e=i.useRef(null);return i.useEffect(()=>()=>{var s;return(s=e.current)==null?void 0:s.call(e)},[]),{arm:i.useCallback(s=>{var d;(d=e.current)==null||d.call(e);let t=0;const o=Date.now()+Vo;let r=!1;const l=()=>{if(r)return;const m=document.activeElement;if(m===null||m===document.body||!m.isConnected){const u=Xo(s);if(u!==null){u.focus();return}}Date.now()>=o||(t=requestAnimationFrame(l))};t=requestAnimationFrame(l),e.current=()=>{r=!0,cancelAnimationFrame(t)}},[])}}function Qo({roomId:e,route:n,urlThreadId:s,openThreadId:t,entries:o,historyLoaded:r}){const l=In(),d=i.useRef(null);i.useEffect(()=>{if(e!==null){if(d.current!==e&&(d.current=e,s!==void 0)){X.getState().openThread(e,s);return}if(r&&t!==void 0){const m=o.find(u=>u.id===t),f=m===void 0?void 0:Ct(m);if(f!==void 0&&f!==t){const u=X.getState().open[e];X.getState().openThread(e,f,(u==null?void 0:u.focusComposer)??!1);return}}t!==s&&(l==null||l({to:n,search:m=>({...m,thread:t}),replace:!0}))}},[e,n,t,s,o,r,l])}const Jo=6,Ft="jump-back-in-listbox";function ze(e){return`jump-back-in-item-${e}`}const Zo='[role="combobox"]';function oe(e){return e instanceof Element&&e.matches(Zo)}function er({value:e,yieldToPalette:n=!1,enabled:s=!0}){const t=Ce(),o=Nn(),[r,l]=i.useState(!1),[d,m]=i.useState({stamp:"",index:0}),[f,u]=i.useState(!1),[c,w]=i.useState(!1);e.length>0&&!c&&w(!0);const h=i.useRef(!1);i.useEffect(()=>{h.current=!0},[]);const{data:g}=it({enabled:s}),k=i.useMemo(()=>((g==null?void 0:g.agents)??[]).map(R=>R.projectPath),[g]),{data:x}=lt(k,{enabled:s}),N=i.useMemo(()=>x??{},[x]),p=i.useMemo(()=>jn(k,N),[k,N]),b=i.useMemo(()=>new Map(k.map(R=>[at(R),R])),[k]),_=i.useCallback(R=>Sn({room:R,agentsByPath:N,pathByAgentRef:b}),[N,b]),T=i.useMemo(()=>An(o.muted),[o.muted]),{items:$}=cs({mutedRoomIds:T,enabled:s}),M=i.useMemo(()=>$.slice(0,Jo),[$]),E=s&&r&&!f&&!c&&!n&&e.length===0&&M.length>0,P=`${E}:${M.length}`,I=d.stamp===P?d.index:0,F=i.useCallback(R=>{h.current&&oe(R.target)&&(u(!1),w(!1),l(!0))},[]),D=i.useCallback(R=>{oe(R.target)&&l(!0)},[]),C=i.useCallback(R=>{oe(R.target)&&l(!1)},[]),B=i.useCallback(R=>{M.length!==0&&m(y=>{const O=y.stamp===P?y.index:0;return{stamp:P,index:(O+R+M.length)%M.length}})},[M.length,P]),L=i.useCallback(()=>B(1),[B]),H=i.useCallback(()=>B(-1),[B]),W=i.useCallback(()=>{u(!0)},[]),z=i.useCallback(R=>{if(u(!0),R.kind==="session"){R.session.cwd&&Re.getState().recordOpened("agent",R.session.cwd),t(ce({dir:R.session.cwd??void 0,session:R.session.id}));return}Re.getState().recordOpened("room",R.room.id),t({...ht.channels(),search:{id:R.room.id}})},[t]),U=i.useCallback(()=>{const R=M[I];!E||!R||z(R)},[E,M,I,z]);return{isOpen:E,hasRows:M.length>0,rows:M,agents:N,displayNames:p,visualOf:_,selectedIndex:I,activeDescendantId:E&&M[I]!==void 0?ze(I):void 0,listboxId:E?Ft:void 0,handleFocus:F,handleBlur:C,handlePointerDown:D,moveDown:L,moveUp:H,selectHighlighted:U,selectRow:z,dismiss:W}}function Lt({mark:e,label:n,title:s,summary:t,lastActivityAt:o,index:r,isSelected:l,now:d,onSelect:m}){const f=i.useMemo(()=>Number.isNaN(Date.parse(o))?null:En(o),[o,d]);return a.jsxs("div",{id:ze(r),role:"option","aria-selected":l,"data-selected":l,title:s,onClick:m,className:"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-start gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[a.jsx("span",{className:"mt-px flex shrink-0 items-center",children:e}),a.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsxs("span",{className:"flex w-full items-center gap-1.5",children:[a.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm",children:n}),f!==null&&a.jsx("span",{className:"text-muted-foreground/60 text-3xs shrink-0",children:f})]}),t!==null&&a.jsx("span",{className:"text-muted-foreground/70 text-2xs truncate",children:t})]})]})}function tr({item:e,agent:n,displayName:s,index:t,isSelected:o,now:r,onSelect:l}){const d=Cn(n,e.session.cwd??s);return a.jsx(Lt,{mark:a.jsx(Mn,{color:d.color,emoji:d.emoji,size:"xs"}),label:e.name,title:`${s} · ${e.name}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:t,isSelected:o,now:r,onSelect:l})}function nr({item:e,visual:n,index:s,isSelected:t,now:o,onSelect:r}){return a.jsx(Lt,{mark:a.jsx(Tn,{room:e.room,participants:e.room.participants,visuals:_n(n)}),label:a.jsx(On,{room:e.room}),title:e.summary===null?e.name:`${e.name} · ${e.summary}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:s,isSelected:t,now:o,onSelect:r})}function sr({rows:e,selectedIndex:n,agents:s={},displayNames:t={},visualOf:o,onSelect:r}){const l=ut(6e4);return i.useEffect(()=>{var d,m;(m=(d=document.getElementById(ze(n)))==null?void 0:d.scrollIntoView)==null||m.call(d,{block:"nearest"})},[n]),a.jsx(Me.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:d=>d.preventDefault(),children:a.jsx("div",{id:Ft,role:"listbox","aria-label":"Jump back in",className:"max-h-72 overflow-y-auto p-1.5",children:e.map((d,m)=>{var f;return d.kind==="session"?a.jsx(tr,{item:d,agent:d.session.cwd&&s[d.session.cwd]||null,displayName:d.session.cwd&&t[d.session.cwd]||((f=d.session.cwd)==null?void 0:f.split("/").pop())||"Agent",index:m,isSelected:m===n,now:l,onSelect:()=>r(d)},`session-${d.id}`):a.jsx(nr,{item:d,visual:o(d.room),index:m,isSelected:m===n,now:l,onSelect:()=>r(d)},`room-${d.id}`)})})})}const Je={people:"People",agents:"Agents"},or=["people","agents"];function rr(e,n){const s=[];for(const{author:t}of e){if(t.kind==="system"||t.id===n||t.retired)continue;const o=t.handle;s.push({section:t.kind==="agent"?"agents":"people",authorId:t.id,label:t.displayName,...o?{handle:o}:{},...t.emoji?{emoji:t.emoji}:{},...t.color?{color:t.color}:{},disabled:!o,...o?{}:{disabledReason:"No @name"}})}return s}function ar(e,n,s){const t=n.trim().toLowerCase(),o=e.map((r,l)=>({row:r,position:l,tier:ir(r,t)})).filter(r=>r.tier!==null).sort((r,l)=>r.tier-l.tier||r.position-l.position);return s.flatMap(r=>o.filter(l=>l.row.section===r).map(({row:l})=>l))}function ir(e,n){var o;if(n==="")return 0;const s=[(o=e.handle)==null?void 0:o.toLowerCase(),e.label.toLowerCase()].filter(r=>r!==void 0);let t=null;for(const r of s){const l=r===n?0:r.startsWith(n)?1:r.includes(n)?2:null;l!==null&&(t===null||l<t)&&(t=l)}return t}function ie(e,n,s){var r;const t=e.length;if(t===0)return 0;let o=(n%t+t)%t;for(let l=0;l<t;l++){if(!((r=e[o])!=null&&r.disabled))return o;o=(o+s+t)%t}return 0}function lr(e,n,s,t){const o=e.slice(0,n),r=e.slice(n+1+s.length),l=`@${t}`,d=r.startsWith(" ")?"":" ";return{value:o+l+d+r,cursorPos:o.length+l.length+1}}const dr=/(^|\s)@([A-Za-z0-9_.-]*)$/,zt="mention-palette-listbox";function je(e){return`mention-item-${e}`}function cr({members:e,viewerAuthorId:n,text:s,sectionOrder:t=or}){var D;const[o,r]=i.useState(!1),[l,d]=i.useState(""),[m,f]=i.useState(-1),u=Pn(s),c=i.useRef(!1),w=i.useMemo(()=>rr(e,n),[e,n]),h=i.useMemo(()=>o?ar(w,l,t):[],[w,l,o,t]),[g,k]=i.useState(null),x=g!==null&&g.query===l&&g.open===o?g.index:ie(h,0,1),N=h[x],p=h.length===0||N!==void 0&&!N.disabled?x:ie(h,0,1),b=i.useCallback((C,B)=>{const L=C.slice(0,B).match(dr);if(!L){r(!1);return}r(!0),d(L[2]),f((L.index??0)+L[1].length)},[]),_=i.useCallback(C=>{u.write(C),c.current=!1},[u]),T=i.useCallback(C=>{c.current||b(u.read(),C)},[b,u]),$=i.useCallback(()=>{k({query:l,open:o,index:ie(h,p+1,1)})},[h,p,l,o]),M=i.useCallback(()=>{k({query:l,open:o,index:ie(h,p-1,-1)})},[h,p,l,o]),E=i.useCallback(C=>C.disabled||C.handle===void 0?null:(c.current=!0,r(!1),lr(u.read(),m,l,C.handle)),[m,l,u]),P=i.useCallback(()=>{const C=h[p];return C?E(C):(r(!1),null)},[h,p,E]),I=i.useCallback(()=>{c.current=!0,r(!1)},[]),F=h.some(C=>!C.disabled);return{isOpen:o,hasSelectableRows:F,rows:h,selectedIndex:p,activeDescendantId:o&&((D=h[p])==null?void 0:D.disabled)===!1?je(p):void 0,listboxId:o?zt:void 0,noteTextChange:_,handleCursorChange:T,moveDown:$,moveUp:M,selectHighlighted:P,selectRow:E,dismiss:I}}function ur({rows:e,selectedIndex:n,onSelect:s}){const t=i.useMemo(()=>{const o=[];return e.forEach((r,l)=>{const d=o[o.length-1];d&&d.section===r.section?d.items.push({row:r,index:l}):o.push({section:r.section,items:[{row:r,index:l}]})}),o},[e]);return i.useEffect(()=>{var o;(o=document.getElementById(je(n)))==null||o.scrollIntoView({block:"nearest"})},[n]),a.jsx(Me.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:o=>o.preventDefault(),children:a.jsx("div",{id:zt,role:"listbox","aria-label":"Mentions",className:"max-h-72 overflow-y-auto p-1.5",children:e.length===0?a.jsx("div",{className:"text-muted-foreground px-2 py-4 text-center text-sm",children:"No one by that name."}):t.map(({section:o,items:r},l)=>a.jsxs("div",{role:"group","aria-label":Je[o],children:[l>0&&a.jsx("div",{className:"bg-border mx-2 my-1.5 h-px"}),a.jsx("div",{"aria-hidden":!0,className:"text-muted-foreground/70 text-2xs px-2 pt-1.5 pb-1 font-medium tracking-wide uppercase",children:Je[o]}),r.map(({row:d,index:m})=>{const f=m===n;return a.jsxs("div",{id:je(m),role:"option","aria-selected":f,"aria-disabled":d.disabled,"data-selected":f,"data-disabled":d.disabled,onClick:()=>{d.disabled||s(d)},className:d.disabled?"flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1.5 opacity-45":"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[a.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 text-center text-sm leading-none",children:d.emoji}),a.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:d.label}),d.handle!==void 0&&a.jsxs("span",{className:"text-muted-foreground/70 truncate font-mono text-xs",children:["@",d.handle]}),d.disabledReason!==void 0&&a.jsx("span",{className:"text-muted-foreground/70 text-2xs ml-auto shrink-0",children:d.disabledReason})]},d.authorId)})]},o))})})}function Bt({room:e,threadRootId:n,focusOnMount:s,offerJumpBackIn:t,onFocusChange:o,attachments:r}){const l=n===void 0?e.id:ot(e.id,n),d=$n(l),{target:m}=yt(),f=Dn(),u=Fn(l),c=i.useRef(null),w=he(e.members,e.viewerAuthorId),h=i.useRef(!1),g=cr({members:e.members,viewerAuthorId:e.viewerAuthorId,text:d}),k=t===!0,x=er({value:d,yieldToPalette:g.isOpen,enabled:k}),N=i.useRef(u);i.useEffect(()=>{var I;u!==N.current&&(N.current=u,(I=c.current)==null||I.focus())},[u]),i.useEffect(()=>{var I;s===!0&&((I=c.current)==null||I.focusUnlessTouch())},[]);const p=i.useCallback(I=>le.getState().set(l,I),[l]),[b,_]=i.useState(null);i.useLayoutEffect(()=>{var I;b!==null&&((I=c.current)==null||I.focusAt(b.pos))},[b]);const T=i.useCallback(I=>{I&&(p(I.value),_({pos:I.cursorPos}))},[p]),$=i.useCallback(I=>T(g.selectRow(I)),[g,T]),M=i.useCallback(()=>T(g.selectHighlighted()),[g,T]),E=()=>{if(m===null||!m.canSend||h.current)return;g.dismiss();const I=le.getState().take(l).trim();if(I==="")return;const F=r.pendingFiles.length>0;F&&(h.current=!0),m.send({text:I}).catch(()=>{const D=le.getState(),C=D.drafts[l]??"";D.set(l,C===""?I:`${I}
44
+ ${C}`)}).finally(()=>{F&&(h.current=!1)})};if(!w)return a.jsxs("div",{className:"flex items-center justify-between gap-3 border-t px-4 py-3",children:[a.jsx("p",{className:"text-muted-foreground text-sm",children:ft}),a.jsx(Ae,{type:"button",size:"sm",variant:"outline",disabled:f.isPending,onClick:()=>f.mutate({roomId:e.id,authorId:e.viewerAuthorId},{onSuccess:()=>pt.success(`You joined ${te(e)}`)}),children:Ln})]});const P=a.jsx(Q.Composer,{inputRef:c,value:d,onChange:I=>{p(I),g.noteTextChange(I)},onSubmit:E,head:a.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:g.isOpen&&g.rows.length===0?"No one by that name.":""}),mentionPicker:a.jsx(we,{children:g.isOpen&&a.jsx(ur,{rows:g.rows,selectedIndex:g.selectedIndex,onSelect:$})}),overlays:a.jsx(a.Fragment,{children:a.jsx(we,{children:x.isOpen&&a.jsx(sr,{rows:x.rows,selectedIndex:x.selectedIndex,agents:x.agents,displayNames:x.displayNames,visualOf:x.visualOf,onSelect:x.selectRow})})}),input:{onCursorChange:g.handleCursorChange,isStreaming:!1,isPaletteOpen:g.isOpen||x.isOpen,paletteHasResults:x.isOpen?x.hasRows:g.hasSelectableRows,onArrowUp:x.isOpen?x.moveUp:g.moveUp,onArrowDown:x.isOpen?x.moveDown:g.moveDown,onCommandSelect:x.isOpen?x.selectHighlighted:M,onEscape:x.isOpen?x.dismiss:g.dismiss,tabPicks:!x.isOpen,onClear:()=>{p(""),g.dismiss()},activeDescendantId:x.isOpen?x.activeDescendantId:g.activeDescendantId,paletteListboxId:x.isOpen?x.listboxId:g.listboxId,contextKey:l,...r.hasFailedUpload?{canSubmitReason:"A file didn’t upload. Try it again or remove it, then send."}:{}}});return!k&&o===void 0?P:a.jsx("section",{className:"flex flex-col","data-testid":zn.homeComposer,onFocus:I=>{x.handleFocus(I),oe(I.target)&&(o==null||o(!0))},onBlur:I=>{x.handleBlur(I),oe(I.target)&&(o==null||o(!1))},onPointerDown:x.handlePointerDown,children:P})}function mr(e){return e.kind!=="channel"||e.bridge!=null||e.archived?!1:!e.members.some(n=>n.author.kind==="agent")}function fr({room:e,hasEntries:n,onAddAgents:s}){return!n||!mr(e)?null:a.jsxs("p",{className:"text-muted-foreground shrink-0 px-4 pb-1 text-xs","data-testid":"no-agent-hint",children:["No agent is in this channel to answer."," ",a.jsx("button",{type:"button",onClick:s,className:"text-foreground focus-visible:ring-ring rounded-sm underline underline-offset-2 focus-visible:ring-2 focus-visible:outline-none",children:"Add one"})," ","to get answers here."]})}function pr({roomId:e}){const{approvals:n}=Bn(),s=Hn(n).filter(t=>t.roomId===e);return s.length===0?null:a.jsx("section",{"data-slot":"room-approvals","aria-label":"Requests waiting on you",className:"shrink-0 px-3 pb-2 md:px-4",children:a.jsx(Un,{approvals:s})})}function hr({roomId:e}){const{data:n}=Ps("pending"),s=(n??[]).filter(t=>t.roomId===e);return s.length===0?null:a.jsx("section",{"data-slot":"room-agent-requests","aria-label":"Apps agents are asking for",className:"shrink-0 space-y-2 px-3 pb-2 md:px-4",children:s.map(t=>a.jsx($s,{request:t},t.requestId))})}const gr="An agent",Ze=64,ke=3,xr=new Set;function Ht({room:e,entries:n,scope:s,laneScope:t,stalled:o,unavailable:r=!1,onRetry:l,onScrollToRow:d}){const m=Ce(),f=qn(e.id,s),u=Wn(e.id,s),c=Kn(e.id,s),[w,h]=i.useState(!1),g=At(e.id,{enabled:w}),k=Gn(),{mutate:x}=Ws(),[N,p]=i.useState(xr),b=i.useCallback(v=>{p(S=>new Set(S).add(v)),x({roomId:e.id,authorId:v},{onSettled:()=>p(S=>{const j=new Set(S);return j.delete(v),j})})},[x,e.id]),_=Ks(),[T,$]=i.useState(()=>new Map),M=Vn(),E=De(),P=i.useMemo(()=>Ee(e.members,e.formerAuthors),[e.members,e.formerAuthors]),I=i.useCallback(v=>{var S;return((S=P.get(v))==null?void 0:S.displayName)??gr},[P]),{interactions:F}=Xn(),D=i.useMemo(()=>F.filter(v=>v.roomId===e.id),[F,e.id]),C=i.useMemo(()=>{var S;const v={};for(const j of D){if(j.roomAuthorId===void 0)continue;const q=(S=P.get(j.roomAuthorId))==null?void 0:S.displayName;q!==void 0&&(v[j.sessionId]=q)}return v},[D,P]),B=i.useMemo(()=>f.map(v=>({authorId:v.authorId,name:I(v.authorId),state:v.state,since:v.since,activity:v.activity??null})),[f,I]),L=i.useMemo(()=>u.map(v=>{var j;const S=(j=M.data)==null?void 0:j.find(q=>q.id===v.behindRoomId);return{authorId:v.authorId,name:I(v.authorId),since:v.since,behind:{roomId:v.behindRoomId,title:S===void 0?null:te(S)},othersWaiting:v.othersWaiting,severalInTheWay:v.severalInTheWay}}),[u,I,M.data]),H=i.useMemo(()=>{const v=new Set;for(const S of u)T.get(S.authorId)===S.entryId&&v.add(S.authorId);return v},[u,T]),W=i.useMemo(()=>c===null?null:{authorId:c.authorId,name:I(c.authorId)},[c,I]),z=i.useMemo(()=>ks({capabilities:Le,asks:D,agentNames:C,stalled:o,presence:B,held:L,silentFinish:W,turn:null}),[D,C,B,L,W,o]),U=i.useMemo(()=>{var S;const v=new Map;for(const j of((S=g.data)==null?void 0:S.bindings)??[])v.set(j.authorId,j.sessionId);return v},[g.data]),R=i.useCallback(v=>{const S=n.find(q=>q.id===v);if(S===void 0)return null;const j=S.body.text.replace(/\s+/gu," ").trim();return j.length===0?null:j.length>Ze?`${j.slice(0,Ze).trimEnd()}…`:j},[n]),y=i.useCallback(v=>{var S;return t==="thread"?Ie(v):((S=Pe(n,v))==null?void 0:S.domId)??null},[n,t]),O=i.useMemo(()=>{const v=f.map(j=>{const q=R(j.entryId),K=y(j.entryId);return{authorId:j.authorId,author:Y(j.authorId,P,E.faces),state:j.state,since:j.since,doing:Yn(j.activity),replyingTo:q===null||K===null?null:{entryId:j.entryId,excerpt:q,rowId:K},sessionId:U.get(j.authorId)??null}}),S=L.map(j=>({authorId:j.authorId,author:Y(j.authorId,P,E.faces),state:"held",since:j.since,doing:null,replyingTo:null,sessionId:null,behind:j.behind,othersWaiting:j.othersWaiting}));return[...v,...S]},[f,L,P,E.faces,R,y,U]),A=i.useMemo(()=>{if(f.length===0)return null;const v=f.slice(0,ke);return a.jsxs("span",{"aria-hidden":"true",className:"flex shrink-0 -space-x-1",children:[v.map(S=>a.jsx(gt,{author:Y(S.authorId,P,E.faces),className:"ring-background size-4 ring-2"},S.authorId)),f.length>ke&&a.jsx("span",{className:"bg-muted text-muted-foreground ring-background text-3xs flex size-4 items-center justify-center rounded-full ring-2",children:`+${f.length-ke}`})]})},[f,P,E.faces]);return a.jsx(Q.LiveLane,{state:z,scope:t,onRetry:l,unavailable:r,faces:A,onPeekOpenChange:h,askCard:z.kind==="ask"?a.jsx(Qn,{ask:z.ask,...C[z.ask.sessionId]?{agentName:C[z.ask.sessionId]}:{},onOpenSession:v=>{m(ce({session:v}))},className:"border-l-0"}):void 0,peek:a.jsx(Q.LivePeek,{rows:O,onScrollToRow:d,onOpenSession:v=>{m(ce({session:v}))},onOpenRoom:v=>{m({...ht.channels(),search:{id:v}})},onAnswerFirst:v=>{const S=u.find(j=>j.authorId===v);S!==void 0&&$(j=>new Map(j).set(v,S.entryId)),_.mutate({roomId:e.id,authorId:v})},promoted:H,onStopAll:()=>k.mutate({roomId:e.id}),stopping:k.isPending,onStopAgent:b,stoppingAgents:N})})}const et=3e3;function yr(e,n,s,t=Date.now){const o=i.useRef(null),r=i.useRef(new Map),l=i.useRef(new Map),d=o.current,m=r.current,f=l.current,u=t();for(const c of e){if(f.has(c.id))continue;if(d===null){f.set(c.id,"at-rest");continue}const w=m.get(c.authorId);f.set(c.id,w!==void 0&&u-w<et?"handed-off":"dropped")}return i.useEffect(()=>{if(!s)return;o.current=new Set(e.map(w=>w.id));const c=t();for(const w of n)r.current.set(w,c);for(const[w,h]of r.current)c-h>et&&r.current.delete(w);for(const w of l.current.keys())o.current.has(w)||l.current.delete(w)}),f}function br({kind:e}){return e==="thread-error"?a.jsxs("div",{"data-slot":"thread-notice","data-testid":"room-thread-error",className:"text-muted-foreground flex flex-col items-center gap-2 px-[var(--msg-padding-x)] py-6 text-center text-sm",children:[a.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load this thread"}),a.jsx("p",{className:"max-w-sm text-xs",children:"Nothing was lost. Reload to try again."})]}):e==="thread-waiting"?a.jsxs("div",{"data-slot":"thread-notice",className:"flex flex-col gap-2 px-[var(--msg-padding-x)]",children:[a.jsx(se,{className:"h-3 w-24"}),a.jsx(se,{className:"h-3 w-full max-w-sm"})]}):a.jsx("p",{"data-slot":"thread-notice","data-testid":"room-thread-orphan",className:"text-muted-foreground border-b px-[var(--msg-padding-x)] pb-3 text-xs italic",children:"This thread’s first message is gone. Its replies remain."})}function vr({room:e,rootEntryId:n,focusComposer:s,entries:t,reactionFrequents:o,streamStalled:r,streamUnavailable:l,onRetryStream:d,historyLoaded:m,historyFailed:f=!1,landOnRow:u,pushed:c,onClose:w}){const h=i.useMemo(()=>Ee(e.members,e.formerAuthors),[e.members,e.formerAuthors]),g=Dt({room:e,threadRootId:n}),k=he(e.members,e.viewerAuthorId),x=De(),N=i.useMemo(()=>new Map([...h].map(([R,y])=>[R,y.displayName])),[h]),{root:p,replies:b}=i.useMemo(()=>{let R;const y=[];for(const O of t)O.id===n?R=O:J(O)===n&&y.push(O);return{root:R,replies:y}},[t,n]),_=p==null?void 0:p.threadReplyCount,T=_!==void 0&&_>b.length,$=p===void 0||T?-1:1+b.length,M=_e(b.length,_),E=i.useMemo(()=>new Set(b.map(R=>R.id)),[b]),P=i.useMemo(()=>({replyIds:E,inside:!0}),[E]),I=Jn(e.id,P),F=mt(e.id,n),D=yr(b,I,m),C=i.useRef(null),B=i.useCallback(R=>{var y;(y=C.current)==null||y.scrollToRow(R)},[]),L=i.useRef(null);i.useEffect(()=>{var R;s||(R=L.current)==null||R.focus()},[n,s]);const H=R=>{R.key!=="Escape"||R.defaultPrevented||(R.stopPropagation(),w())},W=i.useMemo(()=>{const R=[];if(p===void 0){const y=f?"thread-error":m?"thread-orphan":"thread-waiting";R.push({kind:"notice",id:y,at:"",body:null})}else R.push({kind:"message",id:p.id,payload:p,grouping:{position:"only"},author:Y(ue(p,h),h,x.faces),at:p.createdAt});for(const y of b)R.push({kind:"message",id:y.id,payload:y,grouping:{position:"only"},author:Y(ue(y,h),h,x.faces),at:y.createdAt});return R},[p,b,h,x.faces,f,m]),z=i.useCallback(R=>{if(R.kind==="notice")return a.jsx(br,{kind:R.id});if(R.kind!=="message")return null;const y=R.payload,O=p!==void 0&&y.id===p.id,A=b.findIndex(j=>j.id===y.id),v=a.jsx(Pt,{roomId:e.id,entry:y,rowId:Ie(y.id),author:R.author,authorRef:h.get(y.authorId),authors:h,viewerAuthorId:e.viewerAuthorId,authorNames:N,reactionFrequents:o,streamStalled:r,isMember:k,grouping:{position:"only"},answers:Ot(y,A<=0?p:b[A-1],j=>(p==null?void 0:p.id)===j?p:b.find(q=>q.id===j)),feedPosition:{index:O?1:(p===void 0?0:1)+A+1,total:$}});if(O)return M===0?v:a.jsxs(a.Fragment,{children:[v,a.jsxs("div",{"aria-hidden":!0,"data-testid":"room-thread-divider",className:"flex items-center gap-2 px-[var(--msg-padding-x)] pt-1 pb-2",children:[a.jsx("span",{className:"text-muted-foreground shrink-0 text-xs",children:M===1?"1 reply":`${M} replies`}),a.jsx("span",{className:"bg-border h-px flex-1"})]})]});const S=D.get(y.id)??"at-rest";return a.jsx("div",{className:V(S==="dropped"&&"motion-safe:animate-thread-reply-in",S==="handed-off"&&"motion-safe:animate-reply-settle"),children:v})},[p,b,M,D,e.id,e.viewerAuthorId,h,N,o,r,k,$]),U=i.useCallback(R=>R.kind==="message"?Ie(R.id):void 0,[]);return a.jsx(Tt,{known:x,children:a.jsx(Q.Root,{surface:"room",capabilities:Le,target:g.target,anchor:"rail",children:a.jsxs("section",{ref:L,"aria-label":"Thread","data-testid":"room-thread-panel",tabIndex:-1,onKeyDown:H,className:V("bg-card flex min-h-0 flex-col outline-none",c?"h-full w-full":"w-full border-l"),children:[a.jsxs("header",{className:"flex items-center gap-2 border-b px-3 py-2",children:[a.jsx("button",{type:"button",onClick:w,"aria-label":c?`Back to ${te(e)}`:"Close thread",className:V("focus-ring text-muted-foreground hover:text-foreground relative -ml-1 rounded p-1","after:absolute after:-inset-2.5 md:after:hidden"),children:c?a.jsx(Zn,{"aria-hidden":!0,className:"size-4"}):a.jsx(es,{"aria-hidden":!0,className:"size-4"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"Thread"}),a.jsx("p",{className:"text-muted-foreground truncate text-xs",children:te(e)})]})]}),a.jsx(Q.Timeline,{ref:C,conversationId:`thread-${n}`,label:`Thread in ${te(e)}`,busy:!m&&!f,rows:W,renderRow:z,domIdOf:U,...u===void 0?{}:{landOnRow:u},pending:F,viewerAuthorId:e.viewerAuthorId,className:"py-3",feedTestId:"room-thread-feed"}),a.jsx(Ht,{room:e,entries:t,scope:P,laneScope:"thread",stalled:c&&r===!0,unavailable:l,onRetry:c?d:void 0,onScrollToRow:B}),a.jsx(Bt,{room:e,threadRootId:n,attachments:g.attachments,focusOnMount:s},n)]})})})}const ge="room-thread-split",kr=320,Rr=360,wr=40,Ir=50,Nr=25;function tt(e,n){return n<=0?Nr:Math.min(Math.round(e/n*1e3)/10,Ir)}function jr(e){const n=tt(kr,e),s=Math.round((100-tt(Rr,e))*10)/10;return{minPct:n,maxPct:s,defaultPct:Math.min(Math.max(wr,n),s)}}function Sr(e,n,s){if(e===null||n===null||n<=0)return s.defaultPct;const t=e/n*100;return Math.round(Math.min(Math.max(t,s.minPct),s.maxPct)*10)/10}function Ar(e){try{const n=localStorage.getItem(e),s=n===null?NaN:Number(n);return Number.isFinite(s)&&s>0?s:null}catch{return null}}function Cr(e,n){try{localStorage.setItem(e,String(Math.round(n)))}catch{}}const Mr="react-resizable-panels:room-thread-split";function Or(){try{localStorage.removeItem(Mr)}catch{}}function Tr(){const[e,n]=i.useState(null),[s,t]=i.useState(null);return{ref:i.useCallback(r=>{if(r===null)return;n(r);const l=()=>t(r.offsetWidth);l();const d=new ResizeObserver(l);return d.observe(r),()=>{d.disconnect(),n(null),t(null)}},[]),element:e,width:s,sizing:jr(s??0)}}const _r=`${ge}-room`,nt=`${ge}-thread`,st=`${ge}-handle`,Er=4;function Pr({room:e,thread:n,storageKey:s=ns.ROOM_THREAD_WIDTH}){const{ref:t,element:o,width:r,sizing:l}=Tr(),[d,m]=i.useState(()=>Ar(s)),[f,u]=i.useState(null),c=i.useRef(null),w=Sr(d,r,l),h=r===null||(l.maxPct-l.minPct)/100*r<Er,g=n!==!1;i.useEffect(Or,[]);const k=i.useRef(!1);i.useLayoutEffect(()=>{var b;k.current&&((b=c.current)==null||b.resize(w))},[w,g]);const x=i.useRef(null),N=()=>{var $;const b=($=c.current)==null?void 0:$.getSize(),_=x.current;if(x.current=null,b===void 0||r===null||r<=0||_===b)return;const T=Math.round(b/100*r);m(T),Cr(s,T)},p=f??w;return i.useLayoutEffect(()=>{const b=o==null?void 0:o.querySelector(`[data-panel-resize-handle-id="${st}"]`);b&&(b.setAttribute("aria-controls",nt),b.setAttribute("aria-valuenow",String(Math.round(p))),b.setAttribute("aria-valuemin",String(Math.round(l.minPct))),b.setAttribute("aria-valuemax",String(Math.round(l.maxPct))))}),a.jsx("div",{ref:t,className:"h-full overflow-hidden",children:a.jsxs(ts,{direction:"horizontal",id:ge,onLayout:b=>{k.current=b.length>1,u(k.current?b[1]:null)},children:[a.jsx(qe,{id:_r,order:1,className:"flex",children:e}),g&&a.jsxs(a.Fragment,{children:[a.jsx(us,{id:st,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:h,onDragging:b=>{var _;b&&(x.current=((_=c.current)==null?void 0:_.getSize())??null)},onKeyDownCapture:b=>{var _,T;h||(x.current=((_=c.current)==null?void 0:_.getSize())??null,!(b.key!=="Home"&&b.key!=="End")&&(b.preventDefault(),(T=c.current)==null||T.resize(b.key==="Home"?l.minPct:l.maxPct)))},onResizeEnd:N}),a.jsx(qe,{ref:c,id:nt,order:2,defaultSize:w,minSize:l.minPct,maxSize:l.maxPct,className:"flex",children:n})]})]})})}function Jr({roomId:e,threadId:n,entrySeq:s,threadRoute:t,aboveTimeline:o,aboveComposer:r,offerJumpBackIn:l,onComposerFocusChange:d}){const m=ss(),f=ms(),u=os(e),c=u==null?void 0:u.rootEntryId,w=Yo(),h=i.useCallback(()=>{var O;const y=(O=X.getState().open[e])==null?void 0:O.rootEntryId;X.getState().closeThread(e),y!==void 0&&w.arm(y)},[e,w]),g=i.useCallback(y=>{X.getState().openThread(e,y)},[e]),k=rs(e),x=as(e),N=Rs(e,x.isSuccess);ws(e);const p=k.data,b=i.useMemo(()=>x.data??[],[x.data]),_=Dt({room:p});Qo({roomId:e,route:t,urlThreadId:n,openThreadId:c,entries:b,historyLoaded:x.isSuccess});const T=i.useMemo(()=>{var y;return((y=p==null?void 0:p.members.find(O=>O.author.id===p.viewerAuthorId))==null?void 0:y.lastReadSeq)??null},[p]),$=Go(e,T);is(p,b);const M=i.useRef(null),E=i.useRef(void 0),P=i.useCallback(y=>{E.current=y},[]),I=i.useCallback(()=>E.current,[]);i.useLayoutEffect(()=>{E.current=void 0},[e]);const F=i.useCallback(y=>{var O;(O=M.current)==null||O.scrollToRow(y)},[]),D=Xs(e),{loadOlder:C,cursor:B}=D,L=i.useCallback(()=>{const y=mo(b,B);C().then(()=>{y!==null&&requestAnimationFrame(()=>{var O;return(O=M.current)==null?void 0:O.scrollToRow(y.domId)})})},[b,B,C]),H=Ko({roomId:e,entrySeq:s,entries:b,historyLoaded:x.isSuccess}),W=i.useMemo(()=>c===void 0?void 0:{replyIds:new Set(b.filter(O=>J(O)===c).map(O=>O.id)),inside:!1},[b,c]);if(k.isLoading)return a.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:a.jsx($t,{})});if(k.isError||!p)return a.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[a.jsx("p",{className:"text-foreground font-medium",children:"That channel or DM isn’t here"}),a.jsx("p",{className:"max-w-sm",children:"It may be archived, or the link is old."})]});const z=u!==void 0&&a.jsx(vr,{room:p,rootEntryId:u.rootEntryId,focusComposer:u.focusComposer,entries:b,reactionFrequents:p.reactionFrequents,streamStalled:N.stalled,streamUnavailable:N.unavailable,onRetryStream:N.retry,historyLoaded:x.isSuccess,historyFailed:x.isError,...H.threadRow===void 0?{}:{landOnRow:H.threadRow},pushed:m,onClose:h},u.rootEntryId),U=a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[o,a.jsx(qo,{ref:M,roomId:p.id,roomName:te(p),viewerAuthorId:p.viewerAuthorId,entries:b,members:p.members,formerAuthors:p.formerAuthors,lastReadSeq:$,reactionFrequents:p.reactionFrequents,streamStalled:N.stalled,isLoading:x.isLoading,error:x.error,onAddAgents:()=>We("add",p.id),openThreadId:c,onOpenThread:g,resumeRow:I,...H.roomRow===void 0?{}:{landOnRow:H.roomRow},onTopRow:P,canLoadOlder:D.canLoadOlder,isLoadingOlder:D.isLoadingOlder,onLoadOlder:L}),r,a.jsx(pr,{roomId:p.id}),a.jsx(hr,{roomId:p.id}),a.jsx(Ht,{room:p,entries:b,scope:W,laneScope:"room",stalled:N.stalled,unavailable:N.unavailable,onRetry:N.retry,onScrollToRow:F}),a.jsx(fr,{room:p,hasEntries:b.length>0,onAddAgents:()=>We("add",p.id)}),a.jsx(Bt,{room:p,attachments:_.attachments,offerJumpBackIn:l,onFocusChange:d},p.id)]}),R={surface:"room",capabilities:Le,target:_.target,anchor:"rail"};return m?a.jsx(Q.Root,{...R,children:a.jsx(we,{initial:!1,mode:"wait",children:a.jsx(Me.div,{initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:16},transition:{duration:.15,ease:[0,0,.2,1]},style:{paddingBottom:f},"data-testid":"room-surface",className:"flex h-full flex-col overflow-hidden",children:z===!1?U:z},z?`thread-${c}`:"room")})}):a.jsx(Q.Root,{...R,children:a.jsx(Pr,{room:U,thread:z})})}export{St as I,$t as R,ao as T,Jr as a,oe as i};
@@ -1 +1 @@
1
- import{h as d,i as l,j as e,e as m,k as u,C as c,l as x,n as h,H as f}from"./index-8-iQ6PnT.js";function g({kind:s}){const r="text-muted-foreground size-3.5 shrink-0";return s==="dm"?e.jsx(h,{"aria-hidden":!0,className:r}):e.jsx(f,{"aria-hidden":!0,className:r})}function p(s){return s===1?"1 member":`${s} members`}function N({member:s}){var i;const r=d(),n=l(s.id);if(n.isPending)return e.jsx(m,{className:"h-16 w-full"});if(n.isError)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this member’s rooms."});const a=((i=n.data)==null?void 0:i.rooms)??[];return a.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.isSelf?"You aren’t":`${s.displayName} isn’t`," in any rooms yet."]}):e.jsx("div",{className:"flex flex-col",children:a.map(t=>{const o=e.jsxs(e.Fragment,{children:[e.jsx(g,{kind:t.kind}),e.jsx("span",{className:"min-w-0 truncate text-sm",children:u({kind:t.kind,slug:t.slug,title:t.name})}),e.jsx("span",{className:"text-muted-foreground ml-auto shrink-0 text-xs",children:p(t.memberCount)})]});return r?e.jsxs("button",{type:"button","data-slot":"profile-room-row",onClick:()=>void r({...x.channels(),search:{id:t.id}}),className:"focus-ring hover:bg-muted/50 flex h-9 items-center gap-2 rounded-md px-2 text-left transition-colors",children:[o,e.jsx(c,{"aria-hidden":!0,className:"text-muted-foreground/70 size-3.5 shrink-0"})]},t.id):e.jsx("div",{"data-slot":"profile-room-row",className:"flex h-9 items-center gap-2 rounded-md px-2",children:o},t.id)})})}export{N as RoomsPage};
1
+ import{h as d,i as l,j as e,e as m,k as u,C as c,l as x,n as h,H as f}from"./index-Cga0qx1T.js";function g({kind:s}){const r="text-muted-foreground size-3.5 shrink-0";return s==="dm"?e.jsx(h,{"aria-hidden":!0,className:r}):e.jsx(f,{"aria-hidden":!0,className:r})}function p(s){return s===1?"1 member":`${s} members`}function N({member:s}){var i;const r=d(),n=l(s.id);if(n.isPending)return e.jsx(m,{className:"h-16 w-full"});if(n.isError)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this member’s rooms."});const a=((i=n.data)==null?void 0:i.rooms)??[];return a.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.isSelf?"You aren’t":`${s.displayName} isn’t`," in any rooms yet."]}):e.jsx("div",{className:"flex flex-col",children:a.map(t=>{const o=e.jsxs(e.Fragment,{children:[e.jsx(g,{kind:t.kind}),e.jsx("span",{className:"min-w-0 truncate text-sm",children:u({kind:t.kind,slug:t.slug,title:t.name})}),e.jsx("span",{className:"text-muted-foreground ml-auto shrink-0 text-xs",children:p(t.memberCount)})]});return r?e.jsxs("button",{type:"button","data-slot":"profile-room-row",onClick:()=>void r({...x.channels(),search:{id:t.id}}),className:"focus-ring hover:bg-muted/50 flex h-9 items-center gap-2 rounded-md px-2 text-left transition-colors",children:[o,e.jsx(c,{"aria-hidden":!0,className:"text-muted-foreground/70 size-3.5 shrink-0"})]},t.id):e.jsx("div",{"data-slot":"profile-room-row",className:"flex h-9 items-center gap-2 rounded-md px-2",children:o},t.id)})})}export{N as RoomsPage};
@@ -1 +1 @@
1
- import{r as O,j as e,a0 as ye,bx as Ee,ar as we,G as N,dN as ie,by as ue,bz as fe,bA as me,bC as xe,dO as Te,a1 as Ae,a3 as ke,a4 as Oe,ad as pe,as as Le,du as he,dP as De,dQ as Ie,dR as Pe,a8 as j,dS as _e,dx as H,dT as Ue,am as be,B as $e,T as Re,b as He,e as Me,dU as Be,dV as ze,dW as Ke,dX as Qe,dY as Ve,dZ as qe}from"./index-8-iQ6PnT.js";import{C as ce}from"./runtime-connect-Dn0T5YWv.js";import{a as We,d as Xe,k as Ye,e as k}from"./execution-config-DYFe-VNC.js";import{U as Fe}from"./unverified-catalog-notice-u4ikVg8J.js";import{s as Ge}from"./settings-for-runtime-BoOa-ZFG.js";const Ze={duration:.12,ease:"easeOut"},Je={type:"spring",stiffness:320,damping:28};function ve({isSetHere:a,serverDefault:l,onUseServerDefault:i,warning:r,className:s,"data-testid":d}){const[u,f]=O.useState(!1),o=a?"Set here":`Server default · ${l??"none"}`,n=a&&!!i,x=e.jsxs("span",{className:N("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",r?ie.warning:ie.neutral,n&&"hover:bg-accent hover:text-accent-foreground transition-colors",s),"data-testid":d,children:[r&&e.jsx(ye,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(Ee,{mode:"wait",initial:!1,children:e.jsx(we.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:Je},exit:{opacity:0},transition:Ze,children:o},o)})]});return n?e.jsxs(ue,{open:u,onOpenChange:f,children:[e.jsx(fe,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${r?`: ${r}`:""}`,children:x})}),e.jsxs(me,{className:"w-64 p-2",align:"start",children:[e.jsx(xe,{children:"Where this value comes from"}),r&&e.jsx("p",{className:N("px-2 pt-1 text-xs",Te.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{i(),f(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":d?`${d}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["Currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"Not set. Uses the built-in default."})]})]})]}):r?e.jsx("span",{title:r,"aria-label":`${o}: ${r}`,children:x}):x}const et=["agents"];function tt(a){const l=Ae(),i=ke();return Oe({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:r=>l.updateMeshAgent(r.id,r.updates),onSuccess:()=>{i.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{i.invalidateQueries({queryKey:et})}})}const ge="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function $({label:a,valueLabel:l,options:i,selected:r,isSetHere:s,serverDefault:d,warning:u,onSelect:f,onInherit:o,testId:n,showHeader:x=!0,className:C,describedBy:m,inheritText:L}){const w=pe(),[S,h]=O.useState(!1);return e.jsxs("div",{className:N("space-y-1",C),children:[x&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ge,children:a}),!w&&e.jsx(ve,{isSetHere:s,serverDefault:d,warning:u,onUseServerDefault:o,"data-testid":`${n}-chip`})]}),e.jsxs(ue,{open:S,onOpenChange:h,children:[e.jsx(fe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...m?{"aria-describedby":m}:{},"data-testid":n,children:[e.jsx("span",{className:N("truncate",u?"text-status-warning-fg":s?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(Re,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(me,{className:"w-64 p-1",align:"start",children:[e.jsx(xe,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:i.map(c=>e.jsxs("button",{type:"button","data-testid":`${n}-option-${c.value}`,onClick:()=>{f(c.value),h(!1)},className:N("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",c.value===r&&"bg-accent"),children:[c.label,c.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:c.hint})]},c.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),h(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${n}-inherit`,children:L??(d?`Use server default: ${d}`:"Use server default")})]})]})]})}function st({agent:a,onUpdate:l,className:i}){var ee,te,se,ae,ne,le,oe,re,de;const r=pe(),{data:s}=Le(),{data:d,isPending:u}=he(),f=((ee=s==null?void 0:s.executionDefaults)==null?void 0:ee.runtime)??"claude-code",o=a.runtime??f,n=(te=s==null?void 0:s.executionDefaults)==null?void 0:te.perRuntime.find(t=>t.runtime===o),{data:x}=De(),C=We(a,{defaultRuntime:f,runtimeDeclaresCredits:t=>{var b;return((b=d==null?void 0:d.capabilities[t])==null?void 0:b.credits)!==void 0},credits:(se=s==null?void 0:s.claudeCode)==null?void 0:se.credits,runtimeDefaultsToCredits:t=>{var b,A;return((A=(b=x==null?void 0:x.defaults)==null?void 0:b[t])==null?void 0:A.runsOn)==="credits"}}),{data:m,isError:L}=Ie({runtime:o,...C?{account:j}:{}}),w=a.model!=null,S=a.effort!=null,h=(n==null?void 0:n.model)??null,c=C&&(m??[]).some(t=>t.paidFromCredits),y=c?(m??[]).find(t=>t.isDefault):void 0,T=a.model??h??(y==null?void 0:y.value)??null,M=o==="doe"&&c&&!w&&!h,p=T?(m??[]).find(t=>t.value===T):void 0,D=(n==null?void 0:n.supportsEffort)??((ae=Ge(d,o))==null?void 0:ae.supportsEffort),B=D===void 0&&u,z=D!==!1,K=p?p.supportsEffort??!1:void 0,Q=(ne=s==null?void 0:s.claudeCode)==null?void 0:ne.accounts,{nameFor:V,creditsEntry:je,resolvedAccount:q}=Pe(),W=je??(a.account===j&&((le=s==null?void 0:s.claudeCode)!=null&&le.credits)?{path:s.claudeCode.credits.path}:null),v=Q&&[...Q.flatMap(t=>t.id===null?[]:[{id:t.id,label:V(t.path),path:t.path}]),...W?[{id:j,label:_e,path:W.path}]:[]],g=a.account??null,X=g!==null,Y=o==="claude-code"&&g===j&&((oe=s==null?void 0:s.claudeCode)==null?void 0:oe.credits)!==void 0&&!s.claudeCode.credits.allowedAgents.includes(a.id),I=s!=null&&s.claudeCode&&q?V(q):null,P=tt({errorLabel:"Couldn’t change this agent’s account"}),_=O.useCallback(t=>{P.mutate({id:a.id,updates:{account:t}})},[a.id,P]),Ne=Xe({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:f,serverDefaultModel:h,knownModels:Ye(m),knownAccounts:v,accountsUnavailable:(re=s==null?void 0:s.claudeCode)==null?void 0:re.accountsUnavailable,modelSupportsEffort:K,runtimeSupportsEffort:D,runtimeLabel:t=>H(t).label}),E=t=>{var b;return((b=Ne.breakages.find(A=>t.includes(A.kind)))==null?void 0:b.message)??null},U=!B&&z&&K!==!1,F=a.effort??(n==null?void 0:n.effort)??null,G=H(o).label,Ce=o==="claude-code"&&v!==void 0&&(v.length>1||X),Se=E(["account-unregistered"]),Z=(m??[]).some(t=>t.unverified),J=O.useId();return e.jsxs("div",{className:N("grid grid-cols-2 gap-3",i),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{label:"Model",valueLabel:M?ce:(p==null?void 0:p.displayName)??T??(c?"Default":"Automatic"),options:[...(m??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:T,isSetHere:w,serverDefault:(n==null?void 0:n.model)??null,warning:E(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:Z?J:void 0,inheritText:M?ce:c&&!h?y?`Use the suggested model: ${y.displayName}`:"Use the default model":void 0}),Z&&e.jsx(Fe,{id:J}),c&&(m??[]).some(t=>t.creditsListOutOfDate)&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-out-of-date",children:"The models your DorkOS credits cover may be out of date."}),C&&L&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-unavailable",children:"Couldn’t load the models DorkOS credits cover. Try again in a moment."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ge,children:"Effort"}),(!r||!U)&&(S||U)&&e.jsx(ve,{isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:E(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),B?e.jsx(R,{testId:"agent-effort-pending",text:`Checking what ${G} supports`,warning:null}):z?U?e.jsx($,{label:"Effort",valueLabel:k(F),options:Ue.filter(t=>!(p!=null&&p.supportedEffortLevels)||p.supportedEffortLevels.includes(t)).map(t=>({value:t,label:k(t)})),selected:F,isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(R,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:E(["effort-unsupported-model"])}):e.jsx(R,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${G}`,warning:E(["effort-unsupported-runtime"])})]}),Ce&&e.jsx($,{label:"Account",valueLabel:Y?I??"Default":g!==null?((de=v==null?void 0:v.find(t=>t.id===g))==null?void 0:de.label)??g:I??"Default",options:(v??[]).map(t=>({value:t.id,label:t.label,hint:t.id===j?"Paid from your DorkOS account":be(t.path)})),selected:g,isSetHere:X,serverDefault:I,warning:Se,onSelect:t=>_(t),onInherit:()=>_(null),testId:"agent-account-row",className:"col-span-full"}),Y&&e.jsxs("div",{className:"text-muted-foreground col-span-full flex flex-wrap items-center gap-2 text-xs","data-testid":"agent-credits-not-allowed",children:[e.jsx("span",{children:"This agent’s settings name DorkOS credits. It uses your default until you allow it."}),e.jsx($e,{size:"sm",variant:"outline",className:"h-6 px-2 text-xs",disabled:P.isPending,onClick:()=>_(j),children:"Allow"})]})]})}function R({text:a,warning:l,testId:i}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":i,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const at="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function it({member:a}){const{agent:l,projectPath:i,isPending:r,update:s}=He(a),{data:d}=he();if(r)return e.jsx(Me,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const u=d?Object.keys(d.capabilities):[l.runtime],f=u.includes(l.runtime)?u:[l.runtime,...u];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:at,children:"Runs on"}),e.jsxs(Be,{value:l.runtime??"claude-code",onValueChange:o=>s({runtime:o}),children:[e.jsx(ze,{className:"h-8 text-sm",responsive:!1,children:e.jsx(Ke,{})}),e.jsx(Qe,{children:f.map(o=>e.jsx(Ve,{value:o,responsive:!1,children:H(o).label},o))})]})]}),e.jsx(st,{agent:l,onUpdate:s,className:"grid-cols-1"}),i&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(qe,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:be(i)})]})]})}export{it as RunsOnPopover};
1
+ import{r as L,j as e,a0 as ye,bx as Ee,ar as we,G as N,dP as ie,by as ue,bz as fe,bA as me,bC as xe,dQ as Te,a1 as Ae,a3 as ke,a4 as Le,ad as pe,as as Oe,dw as he,dR as De,dS as Ie,dT as Pe,a8 as j,dU as _e,dz as H,dV as Ue,am as be,B as $e,T as Re,b as He,e as Me,dW as Be,dX as ze,dY as Ke,dZ as Qe,d_ as Ve,d$ as qe}from"./index-Cga0qx1T.js";import{C as ce}from"./runtime-connect-Dn0T5YWv.js";import{a as We,d as Xe,k as Ye,e as k}from"./execution-config-ILQiJAmy.js";import{U as Fe}from"./unverified-catalog-notice-CEzu54YH.js";import{s as Ge}from"./settings-for-runtime-BoOa-ZFG.js";const Ze={duration:.12,ease:"easeOut"},Je={type:"spring",stiffness:320,damping:28};function ve({isSetHere:a,serverDefault:l,onUseServerDefault:i,warning:r,className:s,"data-testid":d}){const[u,f]=L.useState(!1),o=a?"Set here":`Server default · ${l??"none"}`,n=a&&!!i,x=e.jsxs("span",{className:N("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",r?ie.warning:ie.neutral,n&&"hover:bg-accent hover:text-accent-foreground transition-colors",s),"data-testid":d,children:[r&&e.jsx(ye,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(Ee,{mode:"wait",initial:!1,children:e.jsx(we.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:Je},exit:{opacity:0},transition:Ze,children:o},o)})]});return n?e.jsxs(ue,{open:u,onOpenChange:f,children:[e.jsx(fe,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${r?`: ${r}`:""}`,children:x})}),e.jsxs(me,{className:"w-64 p-2",align:"start",children:[e.jsx(xe,{children:"Where this value comes from"}),r&&e.jsx("p",{className:N("px-2 pt-1 text-xs",Te.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{i(),f(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":d?`${d}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["Currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"Not set. Uses the built-in default."})]})]})]}):r?e.jsx("span",{title:r,"aria-label":`${o}: ${r}`,children:x}):x}const et=["agents"];function tt(a){const l=Ae(),i=ke();return Le({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:r=>l.updateMeshAgent(r.id,r.updates),onSuccess:()=>{i.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{i.invalidateQueries({queryKey:et})}})}const ge="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function $({label:a,valueLabel:l,options:i,selected:r,isSetHere:s,serverDefault:d,warning:u,onSelect:f,onInherit:o,testId:n,showHeader:x=!0,className:C,describedBy:m,inheritText:O}){const w=pe(),[S,h]=L.useState(!1);return e.jsxs("div",{className:N("space-y-1",C),children:[x&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ge,children:a}),!w&&e.jsx(ve,{isSetHere:s,serverDefault:d,warning:u,onUseServerDefault:o,"data-testid":`${n}-chip`})]}),e.jsxs(ue,{open:S,onOpenChange:h,children:[e.jsx(fe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...m?{"aria-describedby":m}:{},"data-testid":n,children:[e.jsx("span",{className:N("truncate",u?"text-status-warning-fg":s?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(Re,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(me,{className:"w-64 p-1",align:"start",children:[e.jsx(xe,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:i.map(c=>e.jsxs("button",{type:"button","data-testid":`${n}-option-${c.value}`,onClick:()=>{f(c.value),h(!1)},className:N("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",c.value===r&&"bg-accent"),children:[c.label,c.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:c.hint})]},c.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),h(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${n}-inherit`,children:O??(d?`Use server default: ${d}`:"Use server default")})]})]})]})}function st({agent:a,onUpdate:l,className:i}){var ee,te,se,ae,ne,le,oe,re,de;const r=pe(),{data:s}=Oe(),{data:d,isPending:u}=he(),f=((ee=s==null?void 0:s.executionDefaults)==null?void 0:ee.runtime)??"claude-code",o=a.runtime??f,n=(te=s==null?void 0:s.executionDefaults)==null?void 0:te.perRuntime.find(t=>t.runtime===o),{data:x}=De(),C=We(a,{defaultRuntime:f,runtimeDeclaresCredits:t=>{var b;return((b=d==null?void 0:d.capabilities[t])==null?void 0:b.credits)!==void 0},credits:(se=s==null?void 0:s.claudeCode)==null?void 0:se.credits,runtimeDefaultsToCredits:t=>{var b,A;return((A=(b=x==null?void 0:x.defaults)==null?void 0:b[t])==null?void 0:A.runsOn)==="credits"}}),{data:m,isError:O}=Ie({runtime:o,...C?{account:j}:{}}),w=a.model!=null,S=a.effort!=null,h=(n==null?void 0:n.model)??null,c=C&&(m??[]).some(t=>t.paidFromCredits),y=c?(m??[]).find(t=>t.isDefault):void 0,T=a.model??h??(y==null?void 0:y.value)??null,M=o==="doe"&&c&&!w&&!h,p=T?(m??[]).find(t=>t.value===T):void 0,D=(n==null?void 0:n.supportsEffort)??((ae=Ge(d,o))==null?void 0:ae.supportsEffort),B=D===void 0&&u,z=D!==!1,K=p?p.supportsEffort??!1:void 0,Q=(ne=s==null?void 0:s.claudeCode)==null?void 0:ne.accounts,{nameFor:V,creditsEntry:je,resolvedAccount:q}=Pe(),W=je??(a.account===j&&((le=s==null?void 0:s.claudeCode)!=null&&le.credits)?{path:s.claudeCode.credits.path}:null),v=Q&&[...Q.flatMap(t=>t.id===null?[]:[{id:t.id,label:V(t.path),path:t.path}]),...W?[{id:j,label:_e,path:W.path}]:[]],g=a.account??null,X=g!==null,Y=o==="claude-code"&&g===j&&((oe=s==null?void 0:s.claudeCode)==null?void 0:oe.credits)!==void 0&&!s.claudeCode.credits.allowedAgents.includes(a.id),I=s!=null&&s.claudeCode&&q?V(q):null,P=tt({errorLabel:"Couldn’t change this agent’s account"}),_=L.useCallback(t=>{P.mutate({id:a.id,updates:{account:t}})},[a.id,P]),Ne=Xe({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:f,serverDefaultModel:h,knownModels:Ye(m),knownAccounts:v,accountsUnavailable:(re=s==null?void 0:s.claudeCode)==null?void 0:re.accountsUnavailable,modelSupportsEffort:K,runtimeSupportsEffort:D,runtimeLabel:t=>H(t).label}),E=t=>{var b;return((b=Ne.breakages.find(A=>t.includes(A.kind)))==null?void 0:b.message)??null},U=!B&&z&&K!==!1,F=a.effort??(n==null?void 0:n.effort)??null,G=H(o).label,Ce=o==="claude-code"&&v!==void 0&&(v.length>1||X),Se=E(["account-unregistered"]),Z=(m??[]).some(t=>t.unverified),J=L.useId();return e.jsxs("div",{className:N("grid grid-cols-2 gap-3",i),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{label:"Model",valueLabel:M?ce:(p==null?void 0:p.displayName)??T??(c?"Default":"Automatic"),options:[...(m??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:T,isSetHere:w,serverDefault:(n==null?void 0:n.model)??null,warning:E(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:Z?J:void 0,inheritText:M?ce:c&&!h?y?`Use the suggested model: ${y.displayName}`:"Use the default model":void 0}),Z&&e.jsx(Fe,{id:J}),c&&(m??[]).some(t=>t.creditsListOutOfDate)&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-out-of-date",children:"The models your DorkOS credits cover may be out of date."}),C&&O&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-unavailable",children:"Couldn’t load the models DorkOS credits cover. Try again in a moment."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ge,children:"Effort"}),(!r||!U)&&(S||U)&&e.jsx(ve,{isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:E(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),B?e.jsx(R,{testId:"agent-effort-pending",text:`Checking what ${G} supports`,warning:null}):z?U?e.jsx($,{label:"Effort",valueLabel:k(F),options:Ue.filter(t=>!(p!=null&&p.supportedEffortLevels)||p.supportedEffortLevels.includes(t)).map(t=>({value:t,label:k(t)})),selected:F,isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(R,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:E(["effort-unsupported-model"])}):e.jsx(R,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${G}`,warning:E(["effort-unsupported-runtime"])})]}),Ce&&e.jsx($,{label:"Account",valueLabel:Y?I??"Default":g!==null?((de=v==null?void 0:v.find(t=>t.id===g))==null?void 0:de.label)??g:I??"Default",options:(v??[]).map(t=>({value:t.id,label:t.label,hint:t.id===j?"Paid from your DorkOS account":be(t.path)})),selected:g,isSetHere:X,serverDefault:I,warning:Se,onSelect:t=>_(t),onInherit:()=>_(null),testId:"agent-account-row",className:"col-span-full"}),Y&&e.jsxs("div",{className:"text-muted-foreground col-span-full flex flex-wrap items-center gap-2 text-xs","data-testid":"agent-credits-not-allowed",children:[e.jsx("span",{children:"This agent’s settings name DorkOS credits. It uses your default until you allow it."}),e.jsx($e,{size:"sm",variant:"outline",className:"h-6 px-2 text-xs",disabled:P.isPending,onClick:()=>_(j),children:"Allow"})]})]})}function R({text:a,warning:l,testId:i}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":i,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const at="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function it({member:a}){const{agent:l,projectPath:i,isPending:r,update:s}=He(a),{data:d}=he();if(r)return e.jsx(Me,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const u=d?Object.keys(d.capabilities):[l.runtime],f=u.includes(l.runtime)?u:[l.runtime,...u];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:at,children:"Runs on"}),e.jsxs(Be,{value:l.runtime??"claude-code",onValueChange:o=>s({runtime:o}),children:[e.jsx(ze,{className:"h-8 text-sm",responsive:!1,children:e.jsx(Ke,{})}),e.jsx(Qe,{children:f.map(o=>e.jsx(Ve,{value:o,responsive:!1,children:H(o).label},o))})]})]}),e.jsx(st,{agent:l,onUpdate:s,className:"grid-cols-1"}),i&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(qe,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:be(i)})]})]})}export{it as RunsOnPopover};