dorkos 0.125.1 → 0.125.3

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 (307) hide show
  1. package/dist/bin/cli.js +127 -20
  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-DNNSr3b2.js → AboutPage-DSSx1Gzx.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-CXDzOpkQ.js → ActivityErrorState-C-mLOmJm.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-BXp-o5SB.js → ActivityPage-DsOjjulF.js} +1 -1
  7. package/dist/client/assets/{ActivityRow-DDhj9QxV.js → ActivityRow-ylgCMe7Y.js} +1 -1
  8. package/dist/client/assets/{AdapterIcon-CXXdDfkv.js → AdapterIcon-DT5OdFbe.js} +1 -1
  9. package/dist/client/assets/{AdapterSetupWizard-BLljbUjj.js → AdapterSetupWizard-C6jxF55P.js} +1 -1
  10. package/dist/client/assets/{AgentOptionRow-BcNFNeXa.js → AgentOptionRow-CtdBmX9G.js} +1 -1
  11. package/dist/client/assets/{AgentPicker-D4o66W3h.js → AgentPicker--wr93sVO.js} +1 -1
  12. package/dist/client/assets/{AgentRequestCard-C6aBR2TD.js → AgentRequestCard-DVoE2cnk.js} +4 -4
  13. package/dist/client/assets/{AppearancePage-BbXPYAzg.js → AppearancePage-DR_g6BJO.js} +1 -1
  14. package/dist/client/assets/{ApplyToOverridesDialog-DG2dhgC7.js → ApplyToOverridesDialog-BqaoB6AS.js} +1 -1
  15. package/dist/client/assets/{AttentionSignalRow-DQpV3YrI.js → AttentionSignalRow-CM0TrrbJ.js} +1 -1
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-BZReuFC7.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-DJ54CELa.js} +1 -1
  17. package/dist/client/assets/{BindingDialog-dKfunEtT.js → BindingDialog-JAPULq7H.js} +1 -1
  18. package/dist/client/assets/{BlintzCanvas-D4mpLc0Z.js → BlintzCanvas-B3-FjszN.js} +3 -3
  19. package/dist/client/assets/{CanvasCsvContent-DgUpsa5s.js → CanvasCsvContent-Cmqry1BS.js} +1 -1
  20. package/dist/client/assets/{CanvasFileContent-CfHHO1iy.js → CanvasFileContent-BMkxUF1r.js} +2 -2
  21. package/dist/client/assets/{CanvasModel3dContent-BZBPeTnP.js → CanvasModel3dContent-DBhuNbFD.js} +2 -2
  22. package/dist/client/assets/ChannelComposer-WR3_Vvta.js +44 -0
  23. package/dist/client/assets/{ChatAppsOff-B8Afyn-8.js → ChatAppsOff-CY5_0lQH.js} +1 -1
  24. package/dist/client/assets/{CodeMirrorDiff-046sCUyi.js → CodeMirrorDiff-_EI44zW6.js} +1 -1
  25. package/dist/client/assets/{CodeMirrorEditor-gqpifORb.js → CodeMirrorEditor-x1lTuDQH.js} +1 -1
  26. package/dist/client/assets/{CommitmentList-DIO5Qd5w.js → CommitmentList-D-CvccnF.js} +1 -1
  27. package/dist/client/assets/{CommitmentsPage-DDYSjVdN.js → CommitmentsPage-CLw1FRLv.js} +1 -1
  28. package/dist/client/assets/{ComputerResourceView-nLfGu6HH.js → ComputerResourceView-QJnXivV4.js} +1 -1
  29. package/dist/client/assets/{ComputerViewer-Cmw-5KwO.js → ComputerViewer-DbTGz3OL.js} +1 -1
  30. package/dist/client/assets/{ConnectionAccessLists-DNjf06tk.js → ConnectionAccessLists-CB5UY0f0.js} +1 -1
  31. package/dist/client/assets/{ConnectionsPage-Cshv0nqL.js → ConnectionsPage-SpEJxCeF.js} +1 -1
  32. package/dist/client/assets/{ConventionPage-CWpUQZsc.js → ConventionPage-C2NIZjG3.js} +1 -1
  33. package/dist/client/assets/{ExtensionPageRoute-D4d8hWqD.js → ExtensionPageRoute-Drr5uceG.js} +1 -1
  34. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-D8MtiBS3.js → FloatingTanStackRouterDevtools-CqogiFob-kKteNmsx.js} +1 -1
  35. package/dist/client/assets/HandlePage-A1OCw0nr.js +1 -0
  36. package/dist/client/assets/{HeartbeatPage-DcQd3crO.js → HeartbeatPage-BLGTx_57.js} +1 -1
  37. package/dist/client/assets/{KeyEntry-B1M6Cb_W.js → KeyEntry-DgN8iewR.js} +1 -1
  38. package/dist/client/assets/{LexicalField-DglxKbVV.js → LexicalField-Bfj72GvX.js} +1 -1
  39. package/dist/client/assets/{ManagesPage-CHnWwBcn.js → ManagesPage-C3G1-Mep.js} +1 -1
  40. package/dist/client/assets/{Marketplace-nlAKYRdC.js → Marketplace-Dg0bIo7_.js} +2 -2
  41. package/dist/client/assets/{MarketplaceSourcesView-Co53MiW9.js → MarketplaceSourcesView-KPw8YYXi.js} +1 -1
  42. package/dist/client/assets/{McpAppFrame-L2zafUSH.js → McpAppFrame-DjJ4EM39.js} +1 -1
  43. package/dist/client/assets/{McpSigninBody-DRxPP8Zc.js → McpSigninBody-V6RSsDqe.js} +1 -1
  44. package/dist/client/assets/{Model3dViewer-Bjxhkabj.js → Model3dViewer-woNPO5OC.js} +1 -1
  45. package/dist/client/assets/NamePage-Du9m4rGe.js +1 -0
  46. package/dist/client/assets/{NewDirectMessageMenu-BjCp-d3D.js → NewDirectMessageMenu-CmCOFmXQ.js} +1 -1
  47. package/dist/client/assets/{NotificationsPage-DwkL4gtE.js → NotificationsPage-kUtiVsFS.js} +1 -1
  48. package/dist/client/assets/{OpenMeshSwitch-BLE-N5Jb.js → OpenMeshSwitch-r6HJBjR6.js} +1 -1
  49. package/dist/client/assets/{OperatorIdentityForm-Bl5rL-MI.js → OperatorIdentityForm-B29T-N9x.js} +1 -1
  50. package/dist/client/assets/{PermissionHistory-T4I64dJP.js → PermissionHistory-CV8cFJr3.js} +1 -1
  51. package/dist/client/assets/{PermissionsPage-CU2ztV8O.js → PermissionsPage-_PKlbWde.js} +1 -1
  52. package/dist/client/assets/{PersonalityPopover-A50oTbpT.js → PersonalityPopover-BOXTCA6E.js} +1 -1
  53. package/dist/client/assets/PhotoPage-Dx-3Lhm5.js +1 -0
  54. package/dist/client/assets/{PreviewRefusedNotice-B6hvUBqt.js → PreviewRefusedNotice-CdHja8fU.js} +1 -1
  55. package/dist/client/assets/{ProfileFields-BIDZHo11.js → ProfileFields-C48alR3i.js} +1 -1
  56. package/dist/client/assets/{ProfilePanelContainer-IHMOmga2.js → ProfilePanelContainer-BpJVbdUL.js} +1 -1
  57. package/dist/client/assets/{ProfileRolePicker-Bg_Tf8eF.js → ProfileRolePicker-DtuSZNaw.js} +1 -1
  58. package/dist/client/assets/{PromptSuggestionChips-BItU6w6K.js → PromptSuggestionChips-DT-JdGeO.js} +1 -1
  59. package/dist/client/assets/{ReportsToPopover-CohliF94.js → ReportsToPopover-BP2nxz2E.js} +1 -1
  60. package/dist/client/assets/{RoomSurface-CAbD4wVy.js → RoomSurface-C_mTmn8g.js} +1 -1
  61. package/dist/client/assets/{RoomsPage-D8kdi2T4.js → RoomsPage-gDIy73MQ.js} +1 -1
  62. package/dist/client/assets/{RunsOnPopover-BCCxm2Mk.js → RunsOnPopover-DhXG88Uj.js} +1 -1
  63. package/dist/client/assets/{RuntimeConnectFlow-CXAcX8bE.js → RuntimeConnectFlow-BsZsQZS9.js} +1 -1
  64. package/dist/client/assets/{RuntimeSetupDialog-Cof6tku2.js → RuntimeSetupDialog-BSb5iK2A.js} +1 -1
  65. package/dist/client/assets/{SeenDevices-DVjFyFfQ.js → SeenDevices-dzzlSeB2.js} +3 -3
  66. package/dist/client/assets/{SessionsPage-DkThEA16.js → SessionsPage-C6nmCWVM.js} +1 -1
  67. package/dist/client/assets/{SettingsDialog-DqaBWDI4.js → SettingsDialog-5aEZ-DG6.js} +3 -3
  68. package/dist/client/assets/{SkillsPage-D8eM04tW.js → SkillsPage-DSIKEsHr.js} +1 -1
  69. package/dist/client/assets/{TaskDialogWrapper-b6z6wcEV.js → TaskDialogWrapper-Cst7UxoY.js} +1 -1
  70. package/dist/client/assets/{TasksEmptyState-D4XWi20k.js → TasksEmptyState-DityFi7P.js} +1 -1
  71. package/dist/client/assets/{TasksPage-TK0pCu-r.js → TasksPage-BZx_Ku0k.js} +1 -1
  72. package/dist/client/assets/{TeamComputerEntry-BxNRBuRo.js → TeamComputerEntry-uj1GcPP_.js} +1 -1
  73. package/dist/client/assets/{ToolsPage-DpcUQDHa.js → ToolsPage-Qm6x37SO.js} +1 -1
  74. package/dist/client/assets/{TopologyGraph-CFdwWKhT.js → TopologyGraph-2C3Ij6tO.js} +2 -2
  75. package/dist/client/assets/{TourHost-CViLk6JM.js → TourHost-BsV8lcXT.js} +1 -1
  76. package/dist/client/assets/{UnlinkDialog-CHiFjqy9.js → UnlinkDialog-ClNn0nv6.js} +1 -1
  77. package/dist/client/assets/{UnreadDivider-CNjRFpAY.js → UnreadDivider-CGKnJcx7.js} +1 -1
  78. package/dist/client/assets/{WidgetErrorCard-D9LKAbNg.js → WidgetErrorCard-oq5MKUX_.js} +3 -3
  79. package/dist/client/assets/{WorkView-CDLKDo74.js → WorkView-wVnGvWAz.js} +15 -15
  80. package/dist/client/assets/{_shell-x_WZg6D7.js → _shell-D4V8GQqV.js} +6 -6
  81. package/dist/client/assets/{_shell._home-eVhoIWNB.js → _shell._home-DoaHLKk8.js} +1 -1
  82. package/dist/client/assets/{_shell._home.activity-Btyz_JXC.js → _shell._home.activity-BP1byb8g.js} +1 -1
  83. package/dist/client/assets/{_shell._home.index-mdspCjhm.js → _shell._home.index-BB5pgiqt.js} +2 -2
  84. package/dist/client/assets/{_shell._home.tasks-C1zBEy4f.js → _shell._home.tasks-B3w6mqyb.js} +1 -1
  85. package/dist/client/assets/{_shell._home.workspaces-B7eLLMZo.js → _shell._home.workspaces-BcOiklL5.js} +1 -1
  86. package/dist/client/assets/_shell.channels-DxSDnd-3.js +10 -0
  87. package/dist/client/assets/{_shell.connections-FwwnIiVq.js → _shell.connections-YKOm7ap5.js} +1 -1
  88. package/dist/client/assets/{_shell.feedback-requests-BiagdWVc.js → _shell.feedback-requests-DC2Jw1EF.js} +1 -1
  89. package/dist/client/assets/_shell.marketplace-BUh4boaf.js +1 -0
  90. package/dist/client/assets/_shell.marketplace_.sources-CnOFcGv1.js +1 -0
  91. package/dist/client/assets/_shell.session-BUP7x_Ra.js +1 -0
  92. package/dist/client/assets/{_shell.team-B3A__-1w.js → _shell.team-C9QJNwaK.js} +3 -3
  93. package/dist/client/assets/{_shell.threads-C-eFVUo7.js → _shell.threads-gs_o48eZ.js} +1 -1
  94. package/dist/client/assets/_shell.x._extensionId-B-X7HuaQ.js +1 -0
  95. package/dist/client/assets/_shell.x._extensionId_._-B-X7HuaQ.js +1 -0
  96. package/dist/client/assets/{abnfDiagram-WEYOIA3C-RjxMmLSp.js → abnfDiagram-WEYOIA3C-sjxf16g2.js} +1 -1
  97. package/dist/client/assets/{access-copy-robDo1S-.js → access-copy-_81ChCG3.js} +1 -1
  98. package/dist/client/assets/{arc-De3porJy.js → arc-B-c5OGeX.js} +1 -1
  99. package/dist/client/assets/{architectureDiagram-ZHVYKT53-U4UN3Fwb.js → architectureDiagram-ZHVYKT53-CExq4B1X.js} +1 -1
  100. package/dist/client/assets/{banner-Bb9qmJFV.js → banner-BhzLIs7u.js} +1 -1
  101. package/dist/client/assets/{blockDiagram-RJAE7QA3-CckMUzCn.js → blockDiagram-RJAE7QA3-C1D5MR7Z.js} +1 -1
  102. package/dist/client/assets/{c4Diagram-XDPPPE54-4IXkmK3u.js → c4Diagram-XDPPPE54-DMtF_wcg.js} +1 -1
  103. package/dist/client/assets/{card-CHG8Y8EA.js → card-Dsy8PPN6.js} +1 -1
  104. package/dist/client/assets/channel-C6IoQ0kc.js +1 -0
  105. package/dist/client/assets/{chunk-2E7WHVMD-DtPOfWfp.js → chunk-2E7WHVMD-DCmxZwyD.js} +1 -1
  106. package/dist/client/assets/{chunk-2Q5K7J3B-Dk44yc47.js → chunk-2Q5K7J3B-BXvjhtJ3.js} +1 -1
  107. package/dist/client/assets/{chunk-4EMNKR2T-K_Oa4h2U.js → chunk-4EMNKR2T-CR6qWjas.js} +1 -1
  108. package/dist/client/assets/{chunk-55XCU76K-CBCR5VUz.js → chunk-55XCU76K-Bny7RY06.js} +1 -1
  109. package/dist/client/assets/{chunk-5VM5RSS4-o7pQ4Ip8.js → chunk-5VM5RSS4-B9aD4Uib.js} +1 -1
  110. package/dist/client/assets/{chunk-JWPE2WC7-DnjGyJd7.js → chunk-JWPE2WC7-D28Xa5gr.js} +1 -1
  111. package/dist/client/assets/{chunk-VQ5W62QI-C2_U7FnB.js → chunk-VQ5W62QI-CLgnUSgl.js} +1 -1
  112. package/dist/client/assets/{chunk-XXDRQBXY-BEWhI2hh.js → chunk-XXDRQBXY-vMTRVR5A.js} +1 -1
  113. package/dist/client/assets/{chunk-ZCHMQSOR-B4HhT1sq.js → chunk-ZCHMQSOR-Ck0VFEtd.js} +2 -2
  114. package/dist/client/assets/{classDiagram-v2-4MYWR3UA-DhCJ3JPo.js → classDiagram-v2-4MYWR3UA-Dh4gPh4M.js} +1 -1
  115. package/dist/client/assets/{command-BiVO_CS1.js → command-CxjTPW0z.js} +1 -1
  116. package/dist/client/assets/{cose-bilkent-JH36ORCC-xZpEDSd4.js → cose-bilkent-JH36ORCC-BA-tF0x7.js} +1 -1
  117. package/dist/client/assets/{cpu-DDZTaXtb.js → cpu-SRODWAA1.js} +1 -1
  118. package/dist/client/assets/{cynefin-EF2NZ3EQ-Cgz_Z2on.js → cynefin-EF2NZ3EQ-B_kxrTf4.js} +1 -1
  119. package/dist/client/assets/{cynefinDiagram-WF24UDRP-BJFrcql_.js → cynefinDiagram-WF24UDRP-Be0brpVq.js} +1 -1
  120. package/dist/client/assets/{dagre-NK4GIZVX-BYAx5Cie.js → dagre-NK4GIZVX-zI9I0fUC.js} +1 -1
  121. package/dist/client/assets/{diagram-CBK3MWTC-DZ9R9gqz.js → diagram-CBK3MWTC-jN0pUEKR.js} +1 -1
  122. package/dist/client/assets/{diagram-I5XIIV2D--bivdwUI.js → diagram-I5XIIV2D-BjRZmmQf.js} +1 -1
  123. package/dist/client/assets/{diagram-ODIL2UCW-9hvkubLT.js → diagram-ODIL2UCW-BtnkiX3a.js} +1 -1
  124. package/dist/client/assets/{diagram-PFBEJUXE-hVLmub11.js → diagram-PFBEJUXE-Bteh9wpL.js} +1 -1
  125. package/dist/client/assets/{diagram-RJA3I4VV-BB5ttZ9z.js → diagram-RJA3I4VV-hRmqKbOC.js} +1 -1
  126. package/dist/client/assets/{diagram-TYUNFSNR-B_FkQUUF.js → diagram-TYUNFSNR-NKdthGes.js} +1 -1
  127. package/dist/client/assets/{ebnfDiagram-V4P3TTPT-TS7ZNoLc.js → ebnfDiagram-V4P3TTPT-CpkD13ID.js} +1 -1
  128. package/dist/client/assets/{elk-QONTBCTQ-BRCKNiM7.js → elk-QONTBCTQ-Dw4bdkn4.js} +1 -1
  129. package/dist/client/assets/{empty-state-BO-UXPQj.js → empty-state-Xw8KQdod.js} +1 -1
  130. package/dist/client/assets/{erDiagram-KYQIGQAA-DycIeIib.js → erDiagram-KYQIGQAA-fiThyiH_.js} +1 -1
  131. package/dist/client/assets/{execution-config-DEYWqx9f.js → execution-config-ryHuiBdx.js} +1 -1
  132. package/dist/client/assets/{file-DQJ4ncBH.js → file-CbZILJJL.js} +1 -1
  133. package/dist/client/assets/{file-exclamation-point-3K4for51.js → file-exclamation-point-rCHuN_aY.js} +1 -1
  134. package/dist/client/assets/{file-text-3tteNtIM.js → file-text-DGtefNvG.js} +1 -1
  135. package/dist/client/assets/{find-latest-widget-fence-C2e-pGhG.js → find-latest-widget-fence-DJDfJAaN.js} +1 -1
  136. package/dist/client/assets/{flowDiagram-IUGLLWBU-4-MVKKj-.js → flowDiagram-IUGLLWBU-ORyRd0wW.js} +1 -1
  137. package/dist/client/assets/{form-DJvcnZrN.js → form-USBlP2n_.js} +1 -1
  138. package/dist/client/assets/{format-cron-B6RtTy4x.js → format-cron-u8efK62G.js} +1 -1
  139. package/dist/client/assets/{ganttDiagram-R7GPNTJY-DXZ9M_09.js → ganttDiagram-R7GPNTJY-BC-M9_Wi.js} +1 -1
  140. package/dist/client/assets/{git-branch-B5MdRp1u.js → git-branch-jQqbJAvp.js} +1 -1
  141. package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-CXZBvZz1.js → gitGraphDiagram-PDYL7XHY-NIdjLN38.js} +1 -1
  142. package/dist/client/assets/{graph-Ok4GTm1i.js → graph-CBIOKOiw.js} +1 -1
  143. package/dist/client/assets/{heart-WdIkTWht.js → heart-CSbB9K4Q.js} +1 -1
  144. package/dist/client/assets/{highlighted-body-KPVGNVTW-BnvI3qHd.js → highlighted-body-KPVGNVTW-OC8sqXXy.js} +1 -1
  145. package/dist/client/assets/{image-lightbox-DSFIEDOy.js → image-lightbox-DgWS2xlv.js} +1 -1
  146. package/dist/client/assets/{image-off-SpOmtTU2.js → image-off-DziiNcIl.js} +1 -1
  147. package/dist/client/assets/{index-BFyPYiSk.js → index-B-KhOLHd.js} +1 -1
  148. package/dist/client/assets/{index-D8KycDT8.js → index-B5eM1_q1.js} +1 -1
  149. package/dist/client/assets/{index-BPEGncOX.js → index-B9utW3HE.js} +1 -1
  150. package/dist/client/assets/{index-CS1S0apl.js → index-BAaqQW-m.js} +1 -1
  151. package/dist/client/assets/index-BGGnQdij.js +17 -0
  152. package/dist/client/assets/{index-Cjqqoh6c.js → index-BN02EVKP.js} +1 -1
  153. package/dist/client/assets/{index-BAP0wpId.js → index-BOaou3k5.js} +1 -1
  154. package/dist/client/assets/{index-CA3lyhQr.js → index-BU_bmsP2.js} +1 -1
  155. package/dist/client/assets/{index-BAAZ_Afo.js → index-BYxDsLTQ.js} +1 -1
  156. package/dist/client/assets/index-BpsATTKn.js +1 -0
  157. package/dist/client/assets/{index-BUlGEVe6.js → index-Bz9CgPjs.js} +1 -1
  158. package/dist/client/assets/{index-CebrNsDE.js → index-C49AWTah.js} +1 -1
  159. package/dist/client/assets/{index-CO8DgOi_.js → index-C5gtuueN.js} +1 -1
  160. package/dist/client/assets/{index-0TLaDwd7.js → index-C9UgTEuh.js} +1 -1
  161. package/dist/client/assets/{index-BBfQSvDI.js → index-CCohVfmo.js} +1 -1
  162. package/dist/client/assets/{index-DZ9FOOp-.js → index-CDslENFz.js} +1 -1
  163. package/dist/client/assets/{index-qqbs2gqN.js → index-CP7hD01s.js} +1 -1
  164. package/dist/client/assets/{index-CzUbn74z.js → index-CRPh-508.js} +1 -1
  165. package/dist/client/assets/{index-C1t_dxLe.js → index-CRTzTiNF.js} +1 -1
  166. package/dist/client/assets/index-CUKvspHB.js +1 -0
  167. package/dist/client/assets/{index-B5tjSdoa.js → index-CWhDGAYM.js} +1 -1
  168. package/dist/client/assets/{index-CejscP7D.js → index-CeJVF9AD.js} +1 -1
  169. package/dist/client/assets/{index-DaAe-kkp.js → index-CiAb-mD4.js} +1 -1
  170. package/dist/client/assets/{index-Dy7lfs5H.js → index-CuT_aCM-.js} +2 -2
  171. package/dist/client/assets/{index-DncDh-DQ.js → index-D9Ej8fsx.js} +1 -1
  172. package/dist/client/assets/{index-DG-QaLdS.js → index-DJlq_kd_.js} +1 -1
  173. package/dist/client/assets/{index-DlJvYygP.js → index-DJyLZL6w.js} +1 -1
  174. package/dist/client/assets/index-DSYz85aL.js +1053 -0
  175. package/dist/client/assets/{index-CGvU4pGg.js → index-DYF1ER90.js} +3 -3
  176. package/dist/client/assets/{index-Uuq_anEw.js → index-DeDh_2c1.js} +1 -1
  177. package/dist/client/assets/{index-Beqi9bTa.js → index-DfYJ-zxk.js} +1 -1
  178. package/dist/client/assets/{index-PXtYLHfj.js → index-DgnJZ7RZ.js} +1 -1
  179. package/dist/client/assets/{index-BwZrircO.js → index-Dk33a8Wz.js} +1 -1
  180. package/dist/client/assets/{index-Z7RWysQU.js → index-DkcRrH0O.js} +1 -1
  181. package/dist/client/assets/{index-8N601Ptt.js → index-DnyoNFRt.js} +1 -1
  182. package/dist/client/assets/index-DtlBeLQB.css +1 -0
  183. package/dist/client/assets/{index-CjNQaSIo.js → index-LFeqJL-v.js} +1 -1
  184. package/dist/client/assets/{index-CXyeZWZE.js → index-RXFhiamo.js} +1 -1
  185. package/dist/client/assets/{index-BHnCpgC9.js → index-Yr72qWri.js} +1 -1
  186. package/dist/client/assets/{index-elechdSH.js → index-YtJ82pkp.js} +1 -1
  187. package/dist/client/assets/{index-F1p3rnVP.js → index-fAHI5hei.js} +1 -1
  188. package/dist/client/assets/{index-DYc5kmwr.js → index-j5szQcqb.js} +1 -1
  189. package/dist/client/assets/{index-D6y63gKa.js → index-jJbbnV9q.js} +3 -3
  190. package/dist/client/assets/{index-VsLUphXS.js → index-n6f9pLtt.js} +1 -1
  191. package/dist/client/assets/{index-mYbSzZYJ.js → index-w4wyJU8q.js} +1 -1
  192. package/dist/client/assets/{index.esm-Cl_dMJjM.js → index.esm-Dyd3JXuK.js} +1 -1
  193. package/dist/client/assets/{infoDiagram-MVDRKAX5-BLyKorfr.js → infoDiagram-MVDRKAX5-CPcm-36U.js} +1 -1
  194. package/dist/client/assets/{inline-code-hmEz0OM4.js → inline-code-BjkmgK0M.js} +1 -1
  195. package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-BrnGHajs.js → ishikawaDiagram-HPEHV2GE-B8eVNEDQ.js} +1 -1
  196. package/dist/client/assets/{journeyDiagram-BOSHW7O7-BQft6X3_.js → journeyDiagram-BOSHW7O7-CGkIGaMV.js} +1 -1
  197. package/dist/client/assets/{kanban-definition-FNSA4HC5-l4Lwd6a7.js → kanban-definition-FNSA4HC5-BTDbT6UJ.js} +1 -1
  198. package/dist/client/assets/{layers-DHQ_aTAp.js → layers-DyShcAgn.js} +1 -1
  199. package/dist/client/assets/{lightbulb-qcE7kdo5.js → lightbulb-QljDqLq7.js} +1 -1
  200. package/dist/client/assets/{link-2-DBDnK6MQ.js → link-2-7SoeCkEs.js} +1 -1
  201. package/dist/client/assets/{list-runtime-types-CaJn2_14.js → list-runtime-types-DvfLx6v2.js} +1 -1
  202. package/dist/client/assets/{markdown-content-NzXgwE2G.js → markdown-content-D7t62wwm.js} +1 -1
  203. package/dist/client/assets/{mention-pill-CumFsu3I.js → mention-pill-DNQ2ICCW.js} +1 -1
  204. package/dist/client/assets/{mermaid.core-DP7EozpQ.js → mermaid.core-NAyHAvFm.js} +4 -4
  205. package/dist/client/assets/{message-square-off-Zgzm0pcy.js → message-square-off-D6K1M95g.js} +1 -1
  206. package/dist/client/assets/{mindmap-definition-6OY57UG3-DXfFlXJZ.js → mindmap-definition-6OY57UG3-26dEepZx.js} +1 -1
  207. package/dist/client/assets/{more-details-XSn-_PbH.js → more-details-BJ_2FYn8.js} +1 -1
  208. package/dist/client/assets/{owner-notice-C0ArQJdp.js → owner-notice-CIfb2Yr7.js} +1 -1
  209. package/dist/client/assets/{package-DAjaMh-O.js → package-CeRLwc1u.js} +1 -1
  210. package/dist/client/assets/{page-container-CGXX9atD.js → page-container-D2J6eon9.js} +1 -1
  211. package/dist/client/assets/{pane-resize-handle-DAB3TvrY.js → pane-resize-handle-CXxva43c.js} +1 -1
  212. package/dist/client/assets/{paperclip-C6yKmauj.js → paperclip-DFuuQSWM.js} +1 -1
  213. package/dist/client/assets/{path-input-mDIpl2-x.js → path-input-DhGxbEsh.js} +1 -1
  214. package/dist/client/assets/{pegDiagram-ECIUJNBX-PjvGQ3d5.js → pegDiagram-ECIUJNBX-BJu6g9eg.js} +1 -1
  215. package/dist/client/assets/{pieDiagram-GNMPY74T-BRtspcrq.js → pieDiagram-GNMPY74T-CMf8TQF7.js} +1 -1
  216. package/dist/client/assets/{plug-BEjxxorV.js → plug-Bqwk5g66.js} +1 -1
  217. package/dist/client/assets/{primer-trigger-BiiSNY7s.js → primer-trigger-NAz78FSN.js} +1 -1
  218. package/dist/client/assets/{profile-errors-XchEnatB.js → profile-errors--0_JG2R0.js} +1 -1
  219. package/dist/client/assets/{progress-BF25Vgvc.js → progress-cQRXQehb.js} +1 -1
  220. package/dist/client/assets/{quadrantDiagram-D57K4MC3--heUvlvX.js → quadrantDiagram-D57K4MC3-Bb92PcA9.js} +1 -1
  221. package/dist/client/assets/{query-error-state-C2EyJ_cl.js → query-error-state-C2QLFCgp.js} +1 -1
  222. package/dist/client/assets/{radio-BTlBepzs.js → radio-CBD2fSSB.js} +1 -1
  223. package/dist/client/assets/{railroadDiagram-Y72NRBL7-DI8BFDIm.js → railroadDiagram-Y72NRBL7-YN2siyto.js} +1 -1
  224. package/dist/client/assets/registry-CsiY3fnM.js +1 -0
  225. package/dist/client/assets/{relay-trace-schemas-V7JmDMFe.js → relay-trace-schemas-yWn__06J.js} +1 -1
  226. package/dist/client/assets/{repeat-Dl9Z6gcw.js → repeat-CtIEyxm4.js} +1 -1
  227. package/dist/client/assets/{requirementDiagram-EQYSW5RA-BocwQwBX.js → requirementDiagram-EQYSW5RA-DJBQviv-.js} +1 -1
  228. package/dist/client/assets/{room-files-source-4I4JJamw.js → room-files-source-nnbGMKus.js} +1 -1
  229. package/dist/client/assets/{rotate-ccw-clock-Cvx7qMiL.js → rotate-ccw-clock-C2jXtg-P.js} +1 -1
  230. package/dist/client/assets/{rotate-cw-BS2tU5V-.js → rotate-cw-34X3Kx8Z.js} +1 -1
  231. package/dist/client/assets/{sankeyDiagram-SY24JHO5-ezcikI89.js → sankeyDiagram-SY24JHO5-DH2qnwVI.js} +1 -1
  232. package/dist/client/assets/{scroll-area-CkX9hs5p.js → scroll-area-DYTbXWMY.js} +1 -1
  233. package/dist/client/assets/{search-x-BqiSsIfJ.js → search-x-DeFOvp_5.js} +1 -1
  234. package/dist/client/assets/{sequenceDiagram-BLEHNHQU-CoGhkN3M.js → sequenceDiagram-BLEHNHQU-CkHcuOw2.js} +1 -1
  235. package/dist/client/assets/{shield-x-DxL97yUb.js → shield-x-bloGLifl.js} +1 -1
  236. package/dist/client/assets/{signed-in-BPaLzWUS.js → signed-in-DD2qV0PJ.js} +1 -1
  237. package/dist/client/assets/{sizeCapture-INFHLROL-CqWfeZMY.js → sizeCapture-INFHLROL-BXK-Cxjs.js} +1 -1
  238. package/dist/client/assets/{soul-file-BgdRcA9b.js → soul-file-DFPctfHR.js} +1 -1
  239. package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-FWPmI7hi.js → stateDiagram-v2-A6IESKWZ-DP_cqXJO.js} +1 -1
  240. package/dist/client/assets/{swimlanes-B3ENRKFQ-BmnK0GaI.js → swimlanes-B3ENRKFQ-BZxkK7Fr.js} +1 -1
  241. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-DXRZtHKX.js +8 -0
  242. package/dist/client/assets/{table-C5zpnw52.js → table-B8zvHC0J.js} +1 -1
  243. package/dist/client/assets/{timeline-definition-JXYKGLGB-BJRYVT6z.js → timeline-definition-JXYKGLGB-BPZ64ADa.js} +1 -1
  244. package/dist/client/assets/{trust-posture-DxR7JKit.js → trust-posture-C9r0jGhc.js} +1 -1
  245. package/dist/client/assets/{unplug-Cbp9pPvY.js → unplug-DYZEcvkR.js} +1 -1
  246. package/dist/client/assets/{unverified-catalog-notice-v-qMrtTV.js → unverified-catalog-notice-DAhwNpy_.js} +1 -1
  247. package/dist/client/assets/{use-adapter-catalog-B3wTq44G.js → use-adapter-catalog-DrDMqxhZ.js} +1 -1
  248. package/dist/client/assets/{use-bindings-BAKvriCK.js → use-bindings-Ci7hpEO4.js} +1 -1
  249. package/dist/client/assets/{use-composer-prefs-BLOdXw95.js → use-composer-prefs-FpUdi_wE.js} +1 -1
  250. package/dist/client/assets/{use-connector-management-CApx-e1Z.js → use-connector-management-CinfkPZI.js} +1 -1
  251. package/dist/client/assets/{use-deep-link-scroll-DjC3PUqZ.js → use-deep-link-scroll-DZnA4iYZ.js} +1 -1
  252. package/dist/client/assets/{use-delete-binding-DIu3LTuB.js → use-delete-binding-DDtaCc3v.js} +1 -1
  253. package/dist/client/assets/{use-dev-links-D5AXy-P_.js → use-dev-links-CtHwhTBj.js} +1 -1
  254. package/dist/client/assets/{use-direct-message-panel-CzUy0Vi1.js → use-direct-message-panel-Da9rkfA3.js} +1 -1
  255. package/dist/client/assets/{use-external-adapter-catalog-CzMLWn_7.js → use-external-adapter-catalog-CikM-LiV.js} +1 -1
  256. package/dist/client/assets/{use-full-activity-feed-Ce5XvGGR.js → use-full-activity-feed-B6TQc-xB.js} +1 -1
  257. package/dist/client/assets/use-is-below-desktop-DJQVU5CF.js +1 -0
  258. package/dist/client/assets/{use-local-browser-Bw7S_z6h.js → use-local-browser-ABoWOGv1.js} +1 -1
  259. package/dist/client/assets/{use-mesh-topology-42Fa1F-V.js → use-mesh-topology-C5njB0KY.js} +1 -1
  260. package/dist/client/assets/{use-mounted-ref-NbCy8N-y.js → use-mounted-ref-Bp9Wp7zY.js} +1 -1
  261. package/dist/client/assets/{use-notification-prefs-DAokZCgt.js → use-notification-prefs-DXww4pVV.js} +1 -1
  262. package/dist/client/assets/{use-panel-tab-placements-Dbjj1FO5.js → use-panel-tab-placements-DLQeHI7w.js} +1 -1
  263. package/dist/client/assets/use-pending-read-CgR0BnSW.js +1 -0
  264. package/dist/client/assets/{use-personality-commit-mY_GJ7u5.js → use-personality-commit-DYQ3KVxd.js} +1 -1
  265. package/dist/client/assets/{use-promo-activation-CzAU3S9F.js → use-promo-activation-nURLgFxH.js} +1 -1
  266. package/dist/client/assets/{use-promo-dismissals-gDFH0Uhg.js → use-promo-dismissals-BQkeHMCS.js} +1 -1
  267. package/dist/client/assets/{use-pulse-freshness-C6m4sn2E.js → use-pulse-freshness-B8VeNnHj.js} +1 -1
  268. package/dist/client/assets/{use-relay-config-COZDw_jc.js → use-relay-config-D0BknsXK.js} +1 -1
  269. package/dist/client/assets/{use-room-follow-claim-CTPdEUnW.js → use-room-follow-claim-BruRRf3z.js} +1 -1
  270. package/dist/client/assets/{use-room-sessions-DiysSClf.js → use-room-sessions-DGcrmZvE.js} +1 -1
  271. package/dist/client/assets/{use-roving-tab-list-PltEsGcU.js → use-roving-tab-list-YQ4MgIBO.js} +1 -1
  272. package/dist/client/assets/{use-session-canvas-pL8waI_Q.js → use-session-canvas-BaGypLR6.js} +3 -3
  273. package/dist/client/assets/{use-status-budget-D-MyG_Pd.js → use-status-budget-Q1ltHI80.js} +4 -4
  274. package/dist/client/assets/{use-unclaimed-chats-BrLVSVmS.js → use-unclaimed-chats-Bext8Aim.js} +1 -1
  275. package/dist/client/assets/use-update-config-BJEw2LjV.js +1 -0
  276. package/dist/client/assets/{useMutationState-BwG8hXiA.js → useMutationState-C3WVn0hu.js} +1 -1
  277. package/dist/client/assets/{usecaseDiagram-WPOLBNNX-57NgEVRV.js → usecaseDiagram-WPOLBNNX-Dg4P8nSr.js} +1 -1
  278. package/dist/client/assets/{vennDiagram-Q3Y3IDCW-CRKzxbya.js → vennDiagram-Q3Y3IDCW-B8Txoqsz.js} +1 -1
  279. package/dist/client/assets/{wardleyDiagram-IVAIDKWA-wRMWM1mn.js → wardleyDiagram-IVAIDKWA-lgQBspKc.js} +1 -1
  280. package/dist/client/assets/{xychartDiagram-4URNHDU4-Bm6K2W58.js → xychartDiagram-4URNHDU4-Ct9-Lgo9.js} +1 -1
  281. package/dist/client/index.html +2 -2
  282. package/dist/server/extension-child.cjs +1701 -435
  283. package/dist/server/index.js +23320 -21771
  284. package/dist/server/index.js.map +2 -2
  285. package/package.json +6 -6
  286. package/dist/client/assets/ChannelComposer-Fmb-x_zK.js +0 -44
  287. package/dist/client/assets/HandlePage-BFp054RW.js +0 -1
  288. package/dist/client/assets/NamePage-CaA8-GZa.js +0 -1
  289. package/dist/client/assets/PhotoPage-B-aM0VI7.js +0 -1
  290. package/dist/client/assets/_shell.channels-KC-oi383.js +0 -10
  291. package/dist/client/assets/_shell.marketplace-D5vPAK8b.js +0 -1
  292. package/dist/client/assets/_shell.marketplace_.sources-DKXolkMK.js +0 -1
  293. package/dist/client/assets/_shell.session-CRLQUxCR.js +0 -1
  294. package/dist/client/assets/_shell.x._extensionId-Cy2JYMPv.js +0 -1
  295. package/dist/client/assets/_shell.x._extensionId_._-Cy2JYMPv.js +0 -1
  296. package/dist/client/assets/channel-DT-ECQUE.js +0 -1
  297. package/dist/client/assets/index-5kYaIjI6.js +0 -1
  298. package/dist/client/assets/index-BDJuvXMG.js +0 -1053
  299. package/dist/client/assets/index-C_mZH9d1.js +0 -17
  300. package/dist/client/assets/index-D2ZFfqZZ.css +0 -1
  301. package/dist/client/assets/index-DN4ppujx.js +0 -1
  302. package/dist/client/assets/registry-ZygbjV-M.js +0 -1
  303. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-CPB9ed5R.js +0 -8
  304. package/dist/client/assets/use-is-below-desktop-OolRlRyZ.js +0 -1
  305. package/dist/client/assets/use-is-hub-CCn7X2nA.js +0 -1
  306. package/dist/client/assets/use-pending-read-BBA4gaxj.js +0 -1
  307. package/dist/client/assets/use-update-config-Cjq60G6n.js +0 -1
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/server/index.js.map
3
- size: 64244043 bytes
4
- sha256: 310935988a7b312affb8647fda3f63d416d78370e9d212f7162230692df338cb
3
+ size: 64403575 bytes
4
+ sha256: d61c82b9f70a2c71bde0123f5d8c537ebe4130478b6e356f19e1dbea8136698b
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dorkos",
3
- "version": "0.125.1",
3
+ "version": "0.125.3",
4
4
  "description": "You, multiplied. Build and run your business with an agent team. Your agents join your team chat, take on real work, and build the tools your company runs on.",
5
5
  "license": "MIT",
6
6
  "author": "Dorian Collier",
@@ -82,14 +82,14 @@
82
82
  "tsx": "^4.23.15",
83
83
  "typescript": "^5.9.3",
84
84
  "vitest": "^4.1.11",
85
- "@dorkos/marketplace": "0.0.0",
86
- "@dorkos/db": "0.0.0",
85
+ "@dorkos/browser": "0.0.0",
86
+ "@dorkos/eslint-config": "0.0.0",
87
87
  "@dorkos/harness": "0.0.0",
88
- "@dorkos/server": "0.0.0",
88
+ "@dorkos/marketplace": "0.0.0",
89
89
  "@dorkos/typescript-config": "0.0.0",
90
+ "@dorkos/server": "0.0.0",
91
+ "@dorkos/db": "0.0.0",
90
92
  "@dorkos/shared": "0.0.0",
91
- "@dorkos/browser": "0.0.0",
92
- "@dorkos/eslint-config": "0.0.0",
93
93
  "@dorkos/client": "0.0.0"
94
94
  },
95
95
  "scripts": {
@@ -1,44 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C_mZH9d1.js","assets/index-BDJuvXMG.js","assets/index-D2ZFfqZZ.css","assets/room-files-source-4I4JJamw.js","assets/markdown-content-NzXgwE2G.js","assets/file-exclamation-point-3K4for51.js","assets/query-keys-DeYqUDia.js","assets/composer-insert-BpyATrmR.js","assets/index-DZ9FOOp-.js","assets/file-drag-GDx2qhdk.js","assets/rotate-cw-BS2tU5V-.js","assets/link-2-DBDnK6MQ.js","assets/file-DQJ4ncBH.js","assets/git-branch-B5MdRp1u.js","assets/more-details-XSn-_PbH.js"])))=>i.map(i=>d[i]);
2
- import{W as F,r as i,j as l,B as ue,hv as yt,mD as bt,g as vt,jS as kt,G as ne,a1 as fe,a3 as De,a4 as Pe,aP as H,c8 as Fe,c9 as wt,cO as Nt,mE as It,kx as Rt,mF as Ct,h as At,aA as Mt,cf as Le,gk as se,q as Z,a7 as Be,s as pe,ml as jt,mG as St,mn as Ot,mH as _t,dX as Et,fW as Tt,mB as $t,mI as Dt,mJ as Pt,a0 as Ft,bx as Lt,mK as Bt,mL as Ut,ji as Ht,ib as Kt,h0 as Wt,lt as Ne,mM as Ue,bL as qt,ls as X,lw as He,mN as zt,c7 as ge,ai as Vt,bP as he,i6 as Ke,mO as Gt,cj as We,mP as Jt,eU as Yt,k7 as qe,mQ as ze,aZ as Xt,gZ as Ve,lv as Qt,mR as Ge,mS as Zt,mT as en,mU as tn,mV as Ie,eN as nn,mW as sn,mX as on,mY as an,mZ as rn,m_ as cn,m$ as ln,l as dn,hI as un,ar as Je,lk as mn,aj as fn,n0 as pn,n1 as gn,n2 as hn,b8 as xn,bX as yn,n3 as bn,n4 as vn,n5 as kn,n6 as wn,by as Re,ea as Nn}from"./index-BDJuvXMG.js";import{g as Ce,m as Ae,h as xe,f as Ye,M as In,a as Rn,E as Cn,i as An,j as Mn,b as P,c as jn,k as Sn,u as On,C as _n}from"./index-CGvU4pGg.js";import{R as En,A as Xe}from"./repeat-Dl9Z6gcw.js";import{u as Tn}from"./use-room-sessions-DiysSClf.js";import"./WidgetErrorCard-D9LKAbNg.js";import{M as $n}from"./markdown-content-NzXgwE2G.js";import{W as Dn,a as Pn}from"./find-latest-widget-fence-C2e-pGhG.js";import{f as Fn}from"./format-duration-BCr6uzby.js";import{H as Ln,a as Bn,b as Un}from"./RuntimeSetupDialog-Cof6tku2.js";import{M as Me}from"./mention-pill-CumFsu3I.js";import{R as Hn}from"./rotate-ccw-clock-Cvx7qMiL.js";import{U as Kn}from"./unplug-Cbp9pPvY.js";import{M as Wn}from"./message-square-off-Zgzm0pcy.js";import{i as qn}from"./registry-ZygbjV-M.js";/**
3
- * @license lucide-react v1.48.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */const Qe={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};Qe.node;const zn=F(Qe);/**
8
- * @license lucide-react v1.48.0 - ISC
9
- *
10
- * This source code is licensed under the ISC license.
11
- * See the LICENSE file in the root directory of this source tree.
12
- */const Ze={name:"link-2-off",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]};Ze.node;const Vn=F(Ze);/**
13
- * @license lucide-react v1.48.0 - ISC
14
- *
15
- * This source code is licensed under the ISC license.
16
- * See the LICENSE file in the root directory of this source tree.
17
- */const et={name:"megaphone",size:24,node:[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]]};et.node;const Gn=F(et);/**
18
- * @license lucide-react v1.48.0 - ISC
19
- *
20
- * This source code is licensed under the ISC license.
21
- * See the LICENSE file in the root directory of this source tree.
22
- */const tt={name:"power-off",size:24,node:[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};tt.node;const Jn=F(tt);/**
23
- * @license lucide-react v1.48.0 - ISC
24
- *
25
- * This source code is licensed under the ISC license.
26
- * See the LICENSE file in the root directory of this source tree.
27
- */const nt={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"}]]};nt.node;const Yn=F(nt);/**
28
- * @license lucide-react v1.48.0 - ISC
29
- *
30
- * This source code is licensed under the ISC license.
31
- * See the LICENSE file in the root directory of this source tree.
32
- */const st={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"}]]};st.node;const Xn=F(st);/**
33
- * @license lucide-react v1.48.0 - ISC
34
- *
35
- * This source code is licensed under the ISC license.
36
- * See the LICENSE file in the root directory of this source tree.
37
- */const ot={name:"user-minus",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:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};ot.node;const je=F(ot);/**
38
- * @license lucide-react v1.48.0 - ISC
39
- *
40
- * This source code is licensed under the ISC license.
41
- * See the LICENSE file in the root directory of this source tree.
42
- */const at={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"}]]};at.node;const Qn=F(at),Zn='[data-slot="identity-hover-card-actions"] button:not(:disabled)';function es(e){const{open:n,setOpen:s,triggerRef:t,enabled:o}=e,a=i.useRef(null),r=i.useRef(!1);i.useEffect(()=>{if(!n||!r.current)return;r.current=!1;let u=0,x=0;const v=()=>{var m;const f=(m=a.current)==null?void 0:m.querySelector(Zn);if(f)return f.focus();++u<10&&(x=requestAnimationFrame(v))};return v(),()=>cancelAnimationFrame(x)},[n]);const c=i.useCallback(u=>{var x;!u&&((x=a.current)!=null&&x.contains(document.activeElement))||s(u)},[s]),d=i.useCallback(u=>{!o||u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),r.current=!0,s(!0))},[o,s]),g=i.useMemo(()=>({onEscapeKeyDown:()=>{var u;return(u=t.current)==null?void 0:u.focus()},onBlur:u=>{var v,f,m;const x=u.relatedTarget;x&&((v=a.current)!=null&&v.contains(x)||(f=t.current)!=null&&f.contains(x))||(m=a.current)!=null&&m.contains(document.activeElement)||s(!1)}}),[s,t]);return{contentRef:a,handleOpenChange:c,onTriggerKeyDown:d,contentHandlers:g}}function ce(e){const n=e.key==="ArrowRight"||e.key==="ArrowDown",s=e.key==="ArrowLeft"||e.key==="ArrowUp",t=e.key==="Tab";if(!n&&!s&&!t)return;const o=e.currentTarget.closest('[data-slot="identity-hover-card-actions"]');if(!o)return;const a=Array.from(o.querySelectorAll("button:not(:disabled)")),r=a.indexOf(document.activeElement);if(r===-1||a.length===0)return;e.preventDefault();const c=s||t&&e.shiftKey?-1:1;a[(r+c+a.length)%a.length].focus()}function ts({kind:e,about:n}){const t=[e==="agent"?"Agent":e==="human"?"Person":null,n.role].filter(Boolean).join(" · ");return!t&&!n.status?null:l.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5 px-3 pb-3","data-slot":"identity-hover-card-about",children:[t&&l.jsx("p",{className:"text-muted-foreground truncate text-xs",title:t,children:t}),n.status&&l.jsx("p",{className:"text-foreground/80 truncate text-xs","data-slot":"identity-hover-card-status",children:n.status})]})}function ns({actions:e,onAct:n}){const s=t=>()=>{n(),t()};return l.jsxs("div",{className:"border-border mt-auto flex flex-col gap-2 border-t p-3","data-slot":"identity-hover-card-actions",role:"group","aria-label":"Actions",children:[l.jsxs("div",{className:"flex gap-2",children:[e.onMessage&&l.jsx(ue,{size:"xs",className:"flex-1",onClick:s(e.onMessage),onKeyDown:ce,children:"Message"}),e.onViewProfile&&l.jsx(ue,{size:"xs",variant:"outline",className:"flex-1",onClick:s(e.onViewProfile),onKeyDown:ce,children:"Profile"})]}),e.session&&l.jsxs("button",{type:"button","data-slot":"identity-hover-card-session",onClick:s(e.session.onOpen),onKeyDown:ce,className:"text-muted-foreground hover:text-foreground focus-visible:ring-ring flex min-w-0 items-center gap-1.5 rounded-sm text-left text-xs transition-colors focus-visible:ring-2 focus-visible:outline-none",children:[l.jsx(yt,{className:"size-3.5 shrink-0","aria-hidden":!0}),l.jsx("span",{className:"truncate",children:e.session.label})]})]})}const ss=300;function G({className:e,children:n}){return l.jsx("span",{className:ne("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 ye({identity:e,children:n,onViewProfile:s,about:t,actions:o,onOpenChange:a,openOnClick:r=!1,className:c}){const{kind:d,displayName:g,handle:u,color:x,emoji:v,imageUrl:f,origin:m,agent:p}=e,h=x??"hsl(var(--muted-foreground))",w=typeof m=="object"&&m!==null,y=d==="agent"&&(p==null?void 0:p.working)!=null?p.working:null,[I,S]=i.useState(!1),C=i.useCallback(k=>{S(k),a==null||a(k)},[a]),A=i.useRef(!1),N=i.useRef(null),M=bt({onLongPress:()=>{A.current&&C(!0)}}),{contentRef:j,handleOpenChange:b,onTriggerKeyDown:O,contentHandlers:_}=es({open:I,setOpen:C,triggerRef:N,enabled:r&&o!==void 0});return l.jsxs(Ln,{open:I,onOpenChange:b,openDelay:ss,children:[l.jsx(Bn,{asChild:!0,ref:N,"data-gesture-priority":"",...M,onPointerDown:k=>{A.current=k.pointerType==="touch"||k.pointerType==="pen",M.onPointerDown(k)},...r?{onClick:()=>C(!0),onKeyDown:O}:{},children:n}),l.jsxs(Un,{ref:j,..._,...o?{role:"dialog","aria-label":g}:{},"data-slot":"identity-hover-card",align:"start",className:ne("flex w-64 flex-col gap-0 overflow-hidden p-0",c),children:[l.jsxs("div",{className:"flex items-center gap-3 p-3",children:[l.jsx(vt,{"aria-hidden":!0,color:h,emoji:v,imageUrl:f,fallback:kt(g),kind:d,origin:m,status:y?"working":"idle",size:"md"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-foreground truncate text-sm font-semibold",children:g}),u&&l.jsxs("p",{className:"text-muted-foreground truncate text-xs font-medium",children:["@",u]})]})]}),t&&l.jsx(ts,{kind:d,about:t}),l.jsxs("div",{className:"flex flex-wrap gap-1.5 px-3 pb-3 empty:hidden",children:[d==="agent"&&((p==null?void 0:p.runtime)||(p==null?void 0:p.model))&&l.jsx(G,{children:[p.runtime,p.model].filter(Boolean).join(" · ")}),y&&l.jsxs(G,{className:"bg-status-success-bg text-status-success-fg",children:["Working · ",Fn(y.forMs)]}),d==="human"&&l.jsx(G,{children:w?m.platform:"On this machine"}),d==="agent"&&(p==null?void 0:p.managedBy)&&l.jsxs(G,{children:["Managed by"," ",p.managedBy.handle?`@${p.managedBy.handle}`:p.managedBy.displayName]})]}),o?l.jsx(ns,{actions:o,onAct:()=>{var k;(k=N.current)==null||k.focus(),C(!1)}}):s?l.jsx("button",{type:"button","data-slot":"identity-hover-card-profile",onClick:()=>{var k;(k=N.current)==null||k.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"}):l.jsxs("div",{className:"border-border mt-auto flex items-center justify-between border-t px-3 py-2",children:[l.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:"View profile"}),l.jsx("span",{className:"text-muted-foreground text-3xs tracking-wide uppercase",children:"soon"})]})]})]})}function os(){const e=fe(),n=De();return Pe({onMutate:({roomId:s,entryId:t,emoji:o,viewerAuthorId:a})=>{var u;const r=n.getQueryData(H.entries(s)),c=(u=r==null?void 0:r.find(x=>x.id===t))==null?void 0:u.reactions,{reactions:d,on:g}=Ce(c,o,a);return n.setQueryData(H.entries(s),x=>Ae(x,t,d)),{on:g}},mutationFn:({roomId:s,entryId:t,emoji:o,viewerAuthorId:a})=>{var d,g;const r=n.getQueryData(H.entries(s)),c=((g=(d=r==null?void 0:r.find(u=>u.id===t))==null?void 0:d.reactions)==null?void 0:g.some(u=>u.emoji===o&&u.authorIds.includes(a)))??!1;return e.toggleReaction(s,t,{emoji:o,on:c})},onError:(s,{roomId:t,entryId:o,emoji:a,viewerAuthorId:r},c)=>{c!==void 0&&n.setQueryData(H.entries(t),d=>{var x;const g=(x=d==null?void 0:d.find(v=>v.id===o))==null?void 0:x.reactions,{reactions:u}=Ce(g,a,r,!c.on);return Ae(d,o,u)})},onSuccess:({frequents:s},{roomId:t})=>{n.setQueryData(H.detail(t),o=>o&&{...o,reactionFrequents:s})},meta:{errorLabel:"Couldn’t add your reaction",errorToastId:"room-reaction"}})}function W(e){return e.threadRootEntryId??e.parentEntryId}function as(e){return W(e)??e.id}function rs(e,n){return Math.max(n??0,e)}function Wo(e,n,s){let t=e[0],o=0;for(const a of e)a.seq>t.seq&&(t=a),n!==null&&a.seq>n&&(o+=1);return{count:rs(e.length,s),lastAt:t.createdAt,unread:o}}function is(e){var C,A;const{agentPath:n,displayName:s,onViewProfile:t,engaged:o}=e,a=Fe(),r=wt(),c=a&&o&&n!==void 0,d=Nt(c?n:null),g=It(d.member),u=Rt(),x=Ct(),v=At(),f=Mt(),{data:m}=Le({enabled:c&&r}),p=f.status==="ready"?f.roomId:null,h=m==null?void 0:m.find(N=>N.id===p),w=h?se(h):null,y=(A=(C=d.member)==null?void 0:C.agent)==null?void 0:A.effectiveRuntimeId,I=i.useCallback(()=>{n!==void 0&&(Z.getState().recordOpened("agent",n),u({agentPath:n},y?{runtime:y}:{}))},[n,u,y]),S=i.useCallback(async()=>{if(n===void 0||!v)return;const N=await x(n);if(N===null){Be(`${s} has no session in ${w??"this room"} yet`);return}v(pe({session:N}))},[n,v,x,s,w]);return i.useMemo(()=>!a||n===void 0?null:{about:{role:d.role,status:g},actions:{onMessage:I,...t?{onViewProfile:t}:{},...r&&w?{session:{label:`Session in ${w}`,onOpen:()=>void S()}}:{}}},[a,n,d.role,g,I,t,r,w,S])}function cs({identity:e,agentPath:n,onViewProfile:s,openOnClick:t=!1,children:o}){const[a,r]=i.useState(!1),c=is({agentPath:n,displayName:e.displayName,onViewProfile:s,engaged:a}),d=i.useCallback(g=>{g&&r(!0)},[]);return l.jsx(ye,{identity:e,onViewProfile:s,onOpenChange:d,openOnClick:t&&c!==null,...c?{about:c.about,actions:c.actions}:{},children:o})}function ls(e){return l.jsx(Pn,{code:e.code,isIncomplete:e.isIncomplete})}const ds=[{language:Dn,component:ls}],us={turn_failed:{Icon:Ft,tone:"text-status-warning"},agent_busy:{Icon:Pt},agent_gone:{Icon:Qn,tone:"text-status-warning"},agent_left:{Icon:je,tone:"text-status-warning"},room_archived:{Icon:Dt},agent_reseated:{Icon:$t},handle_changed:{Icon:Xe},runtime_gone:{Icon:Jn,tone:"text-status-warning"},agent_paused:{Icon:Tt},agent_declined:{Icon:Wn},agent_unavailable:{Icon:Et},awaiting_approval:{Icon:zn,tone:"text-status-warning"},halted:{Icon:_t},budget_reached:{Icon:Ot},cascade_stopped:{Icon:St},addressing_changed:{Icon:Gn},bridge_blocked:{Icon:Kn,tone:"text-status-warning"},bridge_undelivered:{Icon:jt,tone:"text-status-warning"},bridge_rate_limited:{Icon:Xn},bridge_second_agent_refused:{Icon:je},bridge_disconnected:{Icon:Vn},bridge_agent_swapped:{Icon:En},bridge_history_note:{Icon:Hn}},ms={Icon:Lt},le=80;function fs(e){const n=e.trim();if(n.length<=le)return n;const s=n.slice(0,le),t=s.lastIndexOf(" ");return`${(t>le/2?s.slice(0,t):s).trimEnd()}…`}function ps(e,n,s){const t=gs(e,s),o=a=>l.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:a});return t===null?l.jsxs(l.Fragment,{children:[e," ",o("Open chat")]}):l.jsxs(l.Fragment,{children:[e.slice(0,t.index),o(t.words),e.slice(t.index+t.words.length)]})}function gs(e,n){if(n!==void 0){const t=Bt(n),o=e.lastIndexOf(t);if(o!==-1)return{index:o,words:t}}const s=Ut.exec(e);return s===null?null:{index:s.index,words:s[0]}}function hs({entry:e,feedPosition:n,rowId:s,sessionLink:t,subjectName:o}){const{Icon:a,tone:r}=(e.body.notice&&us[e.body.notice])??ms;return l.jsxs("p",{id:s,"data-slot":"notice-row","data-testid":"room-notice","data-notice":e.body.notice??"unknown",...n&&{role:"article","aria-label":fs(e.body.text)},...xe(n),className:ne("focus-visible:ring-ring flex items-start gap-2 px-[var(--msg-padding-x)] py-2 text-xs outline-none focus-visible:ring-2",r??"text-muted-foreground"),children:[l.jsx(a,{"aria-hidden":!0,className:"mt-px size-3.5 shrink-0"}),l.jsx("span",{children:t?ps(e.body.text,t,o):e.body.text})]})}const xs=qn.moment;function ys({entry:e,moment:n,subject:s,subjectIdentity:t,feedPosition:o,rowId:a}){const r=Ye(e.createdAt);return l.jsx("div",{id:a,"data-slot":"moment-row","data-testid":"room-moment","data-moment":n.kind,role:"article","aria-label":`Moment: ${e.body.text}`,...xe(o),className:"focus-visible:ring-ring px-[var(--msg-padding-x)] py-1 outline-none focus-visible:ring-2",children:l.jsxs("div",{className:"border-border/60 bg-muted/40 flex items-center gap-2.5 rounded-lg border px-3 py-2",children:[l.jsx(ye,{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:l.jsxs("span",{"data-testid":"room-moment-identity",className:"flex shrink-0 items-center",children:[l.jsx(In,{author:s}),l.jsx("span",{className:"sr-only",children:s.displayName})]})}),l.jsx(xs,{"data-testid":"room-moment-mark","aria-hidden":!0,className:"text-muted-foreground size-3.5 shrink-0"}),l.jsx("p",{className:"min-w-0 flex-1 text-sm",children:e.body.text}),r.length>0&&l.jsx("time",{dateTime:e.createdAt,title:Rn(e.createdAt),className:"text-msg-timestamp shrink-0 text-xs",children:r})]})})}function bs(e,n){const s=X.getState(),t=s.drafts[e]??"",o=t===""||t.endsWith(" ")||t.endsWith(`
43
- `)?"":" ";s.set(e,`${t}${o}@${n} `)}function vs({roomId:e,entry:n,author:s,viewerAuthorId:t,onViewProfile:o}){const a=as(n),r=n.body.text,c=(s==null?void 0:s.id)===t?void 0:(s==null?void 0:s.handle)??void 0,d=s==null?void 0:s.displayName,{copy:g}=Ht({toastOnSettle:!0});return i.useMemo(()=>{const u={reply:{id:"reply",label:"Reply in thread",icon:Yn,run:()=>{Wt.getState().openThread(e,a,!0),Ne.getState().requestFocus(Ue(e,a))}},copy:{id:"copy",label:"Copy text",icon:Kt,run:()=>void g(r)}};return o!==void 0&&(u.profile={id:"profile",label:"View profile",icon:qt,run:o}),c!==void 0&&(u.mention={id:"mention",label:d===void 0?"Mention author":`Mention ${d}`,icon:Xe,run:()=>{bs(e,c),Ne.getState().requestFocus(e)}}),Cn.map(x=>u[x]).filter(x=>x!==void 0)},[e,a,r,c,d,o,g])}function ks(e){if(e.kind==="notice")return{kind:"notice"};const n=e.body.moment;return n?{kind:"moment",moment:n}:{kind:"message"}}function qo(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 zo(e,n){const s=e.body.subjectAuthorId;return s===void 0||n.has(e.authorId)?e.authorId:s}function ws(e,n,s){const t=n.get(e),o=He({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 Vo(e){const n=new Set;for(const a of e)W(a)===null&&n.add(a.id);const s=[],t=new Map,o=new Set;for(const a of e){const r=W(a);if(r===null){s.push(a);continue}if(!n.has(r)){s.push(a),o.add(a.id);continue}const c=t.get(r);c?c.push(a):t.set(r,[a])}return{topLevel:s,repliesByRoot:t,orphaned:o}}function Ns(e){return`thread-${e}`}function Is(e){return`thread-row-${e}`}function Go(e){return`thread-panel-entry-${e}`}function Rs(e){return`room-entry-${e}`}function Cs(e,n){const s=e.find(c=>c.id===n);if(s===void 0)return null;const t=W(s)??null,o={rowId:n,domId:Rs(n)};if(t===null)return o;const a=e.find(c=>c.id===t);return a!==void 0&&(W(a)??null)===null?{rowId:Ns(t),domId:Is(t)}:o}function Jo(e,n){if(n===null)return null;const s=e.find(t=>t.seq===n);return s===void 0?null:Cs(e,s.id)}const Se=48;function Yo(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 a=o.body.text.replace(/\s+/gu," ").trim();return a.length===0?null:{entryId:t,excerpt:a.length>Se?`${a.slice(0,Se).trimEnd()}…`:a}}function As(e,n){const s=new Map;for(const t of e){const o=n[t.projectPath];if(!o)continue;const a=zt({runtime:o.runtime,model:o.model});s.set(ge(t.projectPath),{memberId:t.id,visual:Vt(o),runtime:a.label,...a.modelLabel!==null&&{model:a.modelLabel}})}return s}function Ms(e){const n=new Map;for(const[s,t]of e)n.set(s,t.visual);return n}const js={info:new Map,faces:new Map},be=i.createContext(js);function Xo({known:e,children:n}){return l.jsx(be.Provider,{value:e,children:n})}function Qo(){const e=he(),n=i.useMemo(()=>{var r;return((r=e.data)==null?void 0:r.agents)??[]},[e.data]),s=i.useMemo(()=>n.map(r=>r.projectPath),[n]),t=Ke(s),o=i.useMemo(()=>As(n,t.data??{}),[n,t.data]),a=i.useMemo(()=>Ms(o),[o]);return i.useMemo(()=>({info:o,faces:a}),[o,a])}function ee(e){const n=i.useContext(be);return e===void 0?void 0:n.info.get(e)}function Ss(){return i.useContext(be).faces}function Os({showAuthorHeader:e,headerId:n,displayName:s,time:t,summary:o,contentId:a,summaryId:r,feedPosition:c}){return{...e?{"aria-labelledby":n}:{"aria-label":t.length>0?`${s}, ${t}`:s},"aria-describedby":o===null?a:r,...xe(c)}}const Q=120,_s="code block";function Es(e){if(e.length<=Q&&!e.includes("```"))return null;const n=Ts(e);return n.length===0?null:n}function Ts(e){const n=e.replace(/```[\s\S]*?(?:```|$)/g,` ${_s} `).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<=Q)return n;const s=$s(n,Q),t=s.lastIndexOf(" ");return`${(t>Q/2?s.slice(0,t):s).trimEnd()}…`}function $s(e,n){if(typeof Intl.Segmenter=="function"){const t=new Intl.Segmenter(void 0,{granularity:"grapheme"});let o="";for(const{segment:a}of t.segment(e)){if(o.length+a.length>n)break;o+=a}return o}let s="";for(const t of e){if(s.length+t.length>n)break;s+=t}return s}function Ds({roomId:e,entry:n,viewerAuthorId:s,reactionFrequents:t,streamStalled:o,isMember:a=!0}){const r=os(),c=o===!0||!a,d=i.useMemo(()=>n.reactions??[],[n.reactions]),g=i.useMemo(()=>d.filter(v=>An(v,s)).map(v=>v.emoji),[d,s]),u=i.useCallback(v=>r.mutate({roomId:e,entryId:n.id,emoji:v,viewerAuthorId:s}),[r,e,n.id,s]),x=i.useMemo(()=>({quick:t,mine:g,onToggle:u,disabled:c}),[t,g,u,c]);return{reactions:d,toggle:u,quickRow:x}}function Ps({barRef:e,pillsRef:n,hasReactions:s}){return t=>{var a,r;if(t.target!==t.currentTarget)return;const{key:o}=t;if(o==="ArrowDown"&&s){t.preventDefault(),(a=n.current)==null||a.focusFirst();return}o!=="ArrowRight"&&o!=="Enter"||(t.preventDefault(),(r=e.current)==null||r.focusFirst())}}function Fs(e,n){var x,v;const s=n.body.subjectAuthorId,t=n.body.notice,o=n.kind==="notice"&&t!==void 0&&s!==void 0&&Gt.includes(t),a=Tn(e,{enabled:o}),r=We(),c=De(),d=fe(),g=o?((v=(x=a.data)==null?void 0:x.bindings.find(f=>f.authorId===s))==null?void 0:v.sessionId)??null:null,u=i.useCallback(f=>{f.button!==0||f.metaKey||f.ctrlKey||f.shiftKey||f.altKey||(f.preventDefault(),!(g===null||s===void 0)&&Jt({queryClient:c,transport:d},e,s).then(m=>{m.kind!=="none"&&r(pe({session:m.kind==="bound"?m.sessionId:g}))}))},[s,r,c,e,g,d]);return i.useMemo(()=>g===null?null:{href:Yt({session:g}),onOpen:u},[u,g])}const te="mention",ve="author_id",Ls={[te]:[ve]},Bs=[te];function Us(e,n){if(!n||n.length===0)return e;const s=Hs(e,n);if(s.length===0)return e;let t=e;for(let o=s.length-1;o>=0;o--){const{offset:a,length:r,authorId:c}=s[o],d=t.slice(0,a),g=t.slice(a,a+r),u=t.slice(a+r);t=`${d}<${te} ${ve}="${c}">${g}</${te}>${u}`}return t}function Hs(e,n){const s=[...n].sort((a,r)=>a.offset-r.offset),t=[];let o=0;for(const a of s)a.offset<o||a.offset+a.length>e.length||(t.push(a),o=a.offset+a.length);return t}const Ks=new Map,rt=i.createContext(Ks);function Ws({authors:e,children:n}){return l.jsx(rt.Provider,{value:e,children:n})}function qs(e){const n=i.useContext(rt);return e===void 0?void 0:n.get(e)}const Oe=new WeakMap;function zs(e){const n=Oe.get(e);if(n)return n;const s=new Map(e.map(t=>[ge(t.projectPath),t.projectPath]));return Oe.set(e,s),s}function Vs(e){var t;const s=(t=he().data)==null?void 0:t.agents;return i.useMemo(()=>e===void 0||!s?void 0:zs(s).get(e),[s,e])}function it(e){const{agentRef:n,identity:s,onViewProfile:t}=e,o=Fe(),a=Vs(o?n:void 0),r=ee(n);return i.useMemo(()=>{if(!o||s.kind!=="agent"||a===void 0)return null;const c={...s,agent:r&&{runtime:r.runtime,...r.model&&{model:r.model}}},d=(g,u={})=>l.jsx(cs,{identity:c,agentPath:a,onViewProfile:t,openOnClick:u.openOnClick??!1,children:g});return{wrap:d,wrapAvatar:g=>d(l.jsx("button",{type:"button",tabIndex:-1,"aria-label":s.displayName,"aria-haspopup":"dialog",className:"focus-ring inline-flex cursor-pointer rounded-sm","data-slot":"room-agent-card-face",children:g}),{openOnClick:!0}),wrapName:g=>d(l.jsx("button",{type:"button","aria-haspopup":"dialog",className:ne(g.props.className,"focus-ring cursor-pointer rounded-sm text-left underline-offset-4 hover:underline"),"data-slot":"room-agent-card-name",children:s.displayName}),{openOnClick:!0})}},[o,s,a,r,t])}const Gs={kind:"human",displayName:""};function Js(e){return typeof e=="string"?e.replace(/^@/,""):""}function Ys({authorId:e,children:n}){const s=qs(e),t=ee(s==null?void 0:s.agentRef),{open:o}=qe(),a=s?He({record:s,override:t==null?void 0:t.visual}):null,r=s?ze(s,t==null?void 0:t.memberId):void 0,c=i.useMemo(()=>r===void 0?void 0:()=>o(r),[r,o]),d=a==null?void 0:a.color,g=a==null?void 0:a.emoji,u=a==null?void 0:a.imageUrl,x=i.useMemo(()=>s?{kind:s.kind,displayName:s.displayName,handle:s.handle??void 0,color:d,emoji:g,imageUrl:u,origin:s.origin,agent:t&&{runtime:t.runtime,...t.model&&{model:t.model}}}:null,[s,d,g,u,t]),v=it({agentRef:s==null?void 0:s.agentRef,identity:x??Gs,onViewProfile:c});if(!s||!x)return l.jsx(Me,{kind:"human",label:Js(n),resolved:!1});const m=v?{role:"button",tabIndex:0,"aria-haspopup":"dialog"}:c?{role:"button",tabIndex:0,"aria-label":`View ${s.displayName}’s profile`,onClick:c,onKeyDown:h=>{h.key!=="Enter"&&h.key!==" "||(h.preventDefault(),c())}}:{},p=l.jsx(Me,{kind:s.kind,label:s.displayName,handle:s.handle??void 0,color:s.color,origin:s.origin,resolved:!0,interactive:c!==void 0,...m});return v?v.wrap(p,{openOnClick:!0}):l.jsx(ye,{onViewProfile:c,identity:x,children:p})}function Xs(e){return{mention:n=>{const s=n[ve],t=typeof s=="string"?s:void 0;return!t||!e.has(t)?l.jsx(l.Fragment,{children:n.children}):l.jsx(Ys,{authorId:t,children:n.children})}}}function Qs({entry:e,authors:n}){const s=i.useMemo(()=>Us(e.body.text,e.mentionSpans),[e.body.text,e.mentionSpans]),t=i.useMemo(()=>{var a;return new Set(((a=e.mentionSpans)==null?void 0:a.map(r=>r.authorId))??[])},[e.mentionSpans]),o=i.useMemo(()=>Xs(t),[t]);return l.jsx(Ws,{authors:n,children:l.jsx($n,{content:s,className:"msg-prose",allowedTags:Ls,literalTagContent:Bs,components:o,renderers:ds})})}function Zs(e){return function(s){return l.jsx(Qs,{entry:s,authors:e})}}const ct="the top folder";function _e(e){return e.slice(e.lastIndexOf("/")+1)}function eo(e){const n=e.lastIndexOf("/");return n===-1?"":e.slice(0,n)}function to(e){return e===""?ct:`${e}/`}function de(e){return e.target!==void 0?e.target===""?ct:e.target:to(eo(e.paths[0]??""))}function no(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 ${_e(s)} to ${de(e)}`:`${n} uploaded ${e.pathCount} files to ${de(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 ${_e(s)} from the chat to ${de(e)}`}}const so=i.lazy(()=>Xt(()=>import("./index-C_mZH9d1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.SaveToRoomFilesButton})));function Zo({roomId:e,entry:n,author:s,authorRef:t,authors:o,viewerAuthorId:a,authorNames:r,reactionFrequents:c,streamStalled:d,isMember:g=!0,grouping:u,orphanedReply:x,answers:v,feedPosition:f,rowId:m}){const p=Ye(n.createdAt),h=i.useMemo(()=>{const L=Es(n.body.text),ie=Mn(n.attachments??[]);if(ie===null)return L;const we=L??n.body.text.trim();return we.length>0?`${we} ${ie}`:ie},[n.body.text,n.attachments]),w=i.useId(),y=`${w}-author`,I=`${w}-content`,S=`${w}-summary`,C=i.useRef(null),A=i.useRef(null),N=i.useRef(null),{reactions:M,toggle:j,quickRow:b}=Ds({roomId:e,entry:n,viewerAuthorId:a,reactionFrequents:c,streamStalled:d,isMember:g}),O=ee(t==null?void 0:t.agentRef),{open:_}=qe(),k=t===void 0?void 0:ze(t,O==null?void 0:O.memberId),D=i.useCallback(()=>{k!==void 0&&_(k)},[_,k]),T=k===void 0?void 0:D,q=vs({roomId:e,entry:n,author:t,viewerAuthorId:a,onViewProfile:T}),z=(t==null?void 0:t.handle)??void 0,B=i.useMemo(()=>({kind:s.kind,displayName:s.displayName,handle:z,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl}),[s.kind,s.displayName,z,s.color,s.emoji,s.imageUrl]),$=it({agentRef:t==null?void 0:t.agentRef,identity:B,onViewProfile:T}),R=Ps({barRef:A,pillsRef:N,hasReactions:M.length>0}),U=i.useCallback(()=>{var L;return(L=C.current)==null?void 0:L.focus()},[]),oe=i.useMemo(()=>Zs(o),[o]),pt=i.useCallback(L=>l.jsx(i.Suspense,{fallback:null,children:l.jsx(so,{roomId:e,attachment:L})}),[e]),gt=Ss(),ae=n.body.subjectAuthorId??n.authorId,E=o.get(ae),V=ee(E==null?void 0:E.agentRef),ht=Fs(e,n),re=ks(n);if(re.kind==="notice")return l.jsx(hs,{entry:n,feedPosition:f,rowId:m,sessionLink:ht,subjectName:E==null?void 0:E.displayName});if(re.kind==="moment")return l.jsx(ys,{entry:n,moment:re.moment,subject:ae===n.authorId?s:ws(ae,o,gt),subjectIdentity:{handle:(E==null?void 0:E.handle)??void 0,origin:E==null?void 0:E.origin,agent:V&&{runtime:V.runtime,...V.model&&{model:V.model}}},feedPosition:f,rowId:m});const xt=u.position==="first"||u.position==="only";return l.jsxs(P.Root,{ref:C,id:m,position:u.position,actions:q,reactions:b,"data-testid":"room-entry",tabIndex:0,...Os({showAuthorHeader:xt,headerId:y,displayName:s.displayName,time:p,summary:h,contentId:I,summaryId:S,feedPosition:f}),onKeyDown:R,children:[l.jsx(P.Gutter,{author:s,at:n.createdAt,onViewProfile:$?void 0:T,isSelf:n.authorId===a,renderAvatar:$==null?void 0:$.wrapAvatar}),l.jsxs(P.Body,{children:[l.jsx(P.Author,{id:y,author:s,at:n.createdAt,origin:t==null?void 0:t.origin,renderName:$==null?void 0:$.wrapName}),x===!0&&l.jsx("p",{"data-testid":"room-entry-orphan",className:"text-muted-foreground text-xs italic",children:"Replying to an earlier message"}),v!=null&&l.jsx("p",{"data-testid":"room-entry-answers",className:"text-muted-foreground mb-1 truncate text-xs italic",children:`Answering “${v.excerpt}”`}),l.jsx(P.Content,{id:I,className:"[&_:not(pre)>code]:wrap-anywhere [&_pre]:overflow-x-auto",children:n.body.fileChange?l.jsx("p",{"data-testid":"room-entry-file-change",className:"wrap-anywhere",children:no(n.body.fileChange,(E==null?void 0:E.displayName)??"Somebody")}):oe(n,{rowId:n.id,isStreaming:!1})}),h!==null&&l.jsx("span",{id:S,className:"hidden",children:h}),l.jsx(P.Attachments,{items:n.attachments??[],renderAction:g?pt:void 0}),l.jsx(P.Reactions,{ref:N,reactions:M,viewerAuthorId:a,names:r,frequents:c,onToggle:j,disabled:d===!0||!g,onExit:U}),l.jsx(P.Actions,{actions:q,reactions:b,barRef:A,onExit:U})]})]})}const ea={reactions:!0,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!0,turnStatus:!1,asks:!0};function oo(e){const n=fe(),[s,t]=i.useState([]),o=i.useRef(new Map),a=i.useCallback(f=>{const m=f.map(p=>({id:crypto.randomUUID(),file:p,status:"pending",progress:0}));t(p=>[...p,...m])},[]),r=i.useCallback(f=>{o.current.delete(f),t(m=>m.filter(p=>p.id!==f))},[]),c=i.useCallback(f=>{if(!f){o.current.clear(),t([]);return}const m=new Set(f);for(const p of m)o.current.delete(p);t(p=>p.filter(h=>!m.has(h.id)))},[]),d=i.useCallback(f=>{o.current.delete(f),t(m=>m.map(p=>p.id===f&&p.status==="error"?{...p,status:"pending",progress:0,error:void 0}:p))},[]),g=i.useRef(null),u=Pe({meta:{suppressErrorToast:!0},mutationFn:async f=>{t(w=>w.map(y=>f.some(I=>I.id===y.id)?{...y,status:"uploading"}:y));const m=w=>{t(y=>y.map(I=>I.status==="uploading"?{...I,progress:w.percentage}:I))},p=new AbortController;g.current=p;const h=f.map(w=>w.file);return n.uploadRoomAttachments(e,h,m,p.signal)},onSettled:()=>{g.current=null},onSuccess:(f,m)=>{m.forEach((p,h)=>{const w=f[h];w&&o.current.set(p.id,w.id)}),t(p=>p.map(h=>m.findIndex(y=>y.id===h.id)===-1?h:{...h,status:"uploaded",progress:100}))},onError:f=>{t(m=>m.map(p=>p.status==="uploading"?{...p,status:"error",error:f.message}:p))}}),x=i.useCallback(()=>{var f;(f=g.current)==null||f.abort()},[]),v=i.useCallback(async()=>{const f=s.filter(p=>p.status==="error");if(f.length>0)throw new Error(f.length===1?`${f[0].file.name} didn’t upload. Try again or remove it.`:`${f.length} files didn’t upload. Try again or remove them.`);const m=s.filter(p=>p.status==="pending");return m.length>0&&await u.mutateAsync(m),s.map(p=>o.current.get(p.id)).filter(p=>p!==void 0)},[s,u]);return{pendingFiles:s,addFiles:a,removeFile:r,retryFile:d,clearFiles:c,cancelUpload:x,uploadAndGetIds:v,hasPendingFiles:s.length>0,hasFailedUpload:s.some(f=>f.status==="error"),isUploading:u.isPending}}function ta(e){const{room:n,threadRootId:s}=e,t=jn(),o=Sn(),a=oo((n==null?void 0:n.id)??""),r=n!==void 0&&Ve(n.members,n.viewerAuthorId),c=i.useRef({attachments:a,post:t,reply:o,room:n,threadRootId:s});i.useEffect(()=>{c.current={attachments:a,post:t,reply:o,room:n,threadRootId:s}});const d=i.useCallback(y=>c.current.attachments.addFiles(y),[]),g=i.useCallback(y=>c.current.attachments.removeFile(y),[]),u=i.useCallback(y=>c.current.attachments.retryFile(y),[]),x=i.useCallback(()=>c.current.attachments.cancelUpload(),[]),{pendingFiles:v,hasFailedUpload:f,isUploading:m}=a,p=i.useMemo(()=>({staged:v,add:d,remove:g,retry:u,cancel:x,hasFailed:f,isUploading:m,holdsSendWhileUploading:!1}),[v,f,m,d,g,u,x]),h=i.useCallback(async y=>{const{attachments:I,post:S,reply:C,room:A,threadRootId:N}=c.current;if(A===void 0)throw new Error("That room isn’t loaded yet.");if(A.archived)throw new Error("This room is archived.");Z.getState().recordOpened("room",A.id);const M=Qt(),j=I.pendingFiles.map(k=>k.file.name),b=I.pendingFiles.map(k=>k.id),O=await I.uploadAndGetIds();I.clearFiles(b);const _=y.parentEntryId??N;if(_!==void 0){C.mutate({roomId:A.id,rootEntryId:_,text:y.text,clientId:M,attachmentIds:O,attachmentNames:j});return}S.mutate({roomId:A.id,text:y.text,clientId:M,attachmentIds:O,attachmentNames:j})},[]);return{target:i.useMemo(()=>({kind:"room",id:(n==null?void 0:n.id)??"",placeholder:n===void 0?"Message…":s===void 0?`Message ${se(n)}…`:"Reply in this thread…",canSend:n!==void 0&&!n.archived&&r,...n===void 0?{canSendReason:"Still opening this room…"}:n.archived?{canSendReason:"This room is archived. You can read it, but not add to it."}:r?{}:{canSendReason:Ge},send:h,attachments:p}),[n,s,r,p,h]),attachments:a}}const lt=8;function dt(e){if(e==null)return null;const n=e.replace(/\s+/g," ").trim();return n.length===0?null:n}function ao(e){if(tn(e)){const s=e.unreadCount??0;return s===1?"1 new message":`${s} new messages`}const n=e.working??0;return n>0?n===1?"1 agent working":`${n} agents working`:dt(e.topic)}function Ee(e){return{kind:"session",id:e.id,name:en(e.title),summary:dt(e.lastMessagePreview),lastActivityAt:e.updatedAt,session:e}}function ro(e){return{kind:e.kind==="dm"?"dm":"channel",id:e.id,name:se(e),summary:ao(e),lastActivityAt:e.lastActivityAt,room:e}}function J(e){if(e===void 0)return null;const n=Date.parse(e);return Number.isNaN(n)?null:n}function io(e){return e.kind==="session"?Ie("session",e.id):Ie("room",e.id)}function Te(e,n){const s=[J(n[io(e)]),...e.kind==="session"?[J(e.session.lastTouchedByYouAt),J(e.session.userLastMessageAt)]:[]].filter(t=>t!==null);return s.length>0?Math.max(...s):J(e.lastActivityAt)??Number.NEGATIVE_INFINITY}function co(e){return(n,s)=>Te(s,e)-Te(n,e)||s.id.localeCompare(n.id)}function lo(e){const n=new Set;return e.filter(s=>{const t=`${s.kind}:${s.id}`;return n.has(t)?!1:(n.add(t),!0)})}function uo(e,n){return!(n.has(e.id)||e.unreadCount===null||e.lastActivityAt===e.createdAt)}function mo({sessions:e,rooms:n,mutedRoomIds:s=new Set,interactions:t={},limit:o=lt}){const{yours:a,spinOffs:r,automated:c}=Zt(e),d=co(t),g=[...a.map(Ee),...n.filter(u=>uo(u,s)).map(ro)].sort(d);return{items:lo(g).slice(0,o),automated:[...r,...c].map(Ee).sort(d).slice(0,o)}}const fo=3,po=on;function go({limit:e=lt,mutedRoomIds:n,enabled:s=!0}={}){var g,u;const t=nn(Math.max(e*fo,po),{enabled:s}),o=Le({enabled:s}),a=sn(),r=(g=t.data)==null?void 0:g.sessions,c=o.data;return{...i.useMemo(()=>mo({sessions:r??[],rooms:c??[],mutedRoomIds:n,interactions:a,limit:e}),[r,c,n,a,e]),isLoading:s&&(t.isLoading||o.isLoading),warnings:((u=t.data)==null?void 0:u.warnings)??[]}}const ho=6,ut="jump-back-in-listbox";function ke(e){return`jump-back-in-item-${e}`}const xo='[role="combobox"]';function K(e){return e instanceof Element&&e.matches(xo)}function yo({value:e,yieldToPalette:n=!1,enabled:s=!0}){const t=We(),o=an(),[a,r]=i.useState(!1),[c,d]=i.useState({stamp:"",index:0}),[g,u]=i.useState(!1),[x,v]=i.useState(!1);e.length>0&&!x&&v(!0);const f=i.useRef(!1);i.useEffect(()=>{f.current=!0},[]);const{data:m}=he({enabled:s}),p=i.useMemo(()=>((m==null?void 0:m.agents)??[]).map(R=>R.projectPath),[m]),{data:h}=Ke(p,{enabled:s}),w=i.useMemo(()=>h??{},[h]),y=i.useMemo(()=>rn(p,w),[p,w]),I=i.useMemo(()=>new Map(p.map(R=>[ge(R),R])),[p]),S=i.useCallback(R=>cn({room:R,agentsByPath:w,pathByAgentRef:I}),[w,I]),C=i.useMemo(()=>ln(o.muted),[o.muted]),{items:A}=go({mutedRoomIds:C,enabled:s}),N=i.useMemo(()=>A.slice(0,ho),[A]),M=s&&a&&!g&&!x&&!n&&e.length===0&&N.length>0,j=`${M}:${N.length}`,b=c.stamp===j?c.index:0,O=i.useCallback(R=>{f.current&&K(R.target)&&(u(!1),v(!1),r(!0))},[]),_=i.useCallback(R=>{K(R.target)&&r(!0)},[]),k=i.useCallback(R=>{K(R.target)&&r(!1)},[]),D=i.useCallback(R=>{N.length!==0&&d(U=>{const oe=U.stamp===j?U.index:0;return{stamp:j,index:(oe+R+N.length)%N.length}})},[N.length,j]),T=i.useCallback(()=>D(1),[D]),q=i.useCallback(()=>D(-1),[D]),z=i.useCallback(()=>{u(!0)},[]),B=i.useCallback(R=>{if(u(!0),R.kind==="session"){R.session.cwd&&Z.getState().recordOpened("agent",R.session.cwd),t(pe({dir:R.session.cwd??void 0,session:R.session.id}));return}Z.getState().recordOpened("room",R.room.id),t({...dn.channels(),search:{id:R.room.id}})},[t]),$=i.useCallback(()=>{const R=N[b];!M||!R||B(R)},[M,N,b,B]);return{isOpen:M,hasRows:N.length>0,rows:N,agents:w,displayNames:y,visualOf:S,selectedIndex:b,activeDescendantId:M&&N[b]!==void 0?ke(b):void 0,listboxId:M?ut:void 0,handleFocus:O,handleBlur:k,handlePointerDown:_,moveDown:T,moveUp:q,selectHighlighted:$,selectRow:B,dismiss:z}}function mt({mark:e,label:n,title:s,summary:t,lastActivityAt:o,index:a,isSelected:r,now:c,onSelect:d}){const g=i.useMemo(()=>Number.isNaN(Date.parse(o))?null:xn(o),[o,c]);return l.jsxs("div",{id:ke(a),role:"option","aria-selected":r,"data-selected":r,title:s,onClick:d,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:[l.jsx("span",{className:"mt-px flex shrink-0 items-center",children:e}),l.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[l.jsxs("span",{className:"flex w-full items-center gap-1.5",children:[l.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm",children:n}),g!==null&&l.jsx("span",{className:"text-muted-foreground/60 text-3xs shrink-0",children:g})]}),t!==null&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs truncate",children:t})]})]})}function bo({item:e,agent:n,displayName:s,index:t,isSelected:o,now:a,onSelect:r}){const c=mn(n,e.session.cwd??s);return l.jsx(mt,{mark:l.jsx(fn,{color:c.color,emoji:c.emoji,size:"xs"}),label:e.name,title:`${s} · ${e.name}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:t,isSelected:o,now:a,onSelect:r})}function vo({item:e,visual:n,index:s,isSelected:t,now:o,onSelect:a}){return l.jsx(mt,{mark:l.jsx(gn,{room:e.room,participants:e.room.participants,visuals:hn(n)}),label:l.jsx(pn,{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:a})}function ko({rows:e,selectedIndex:n,agents:s={},displayNames:t={},visualOf:o,onSelect:a}){const r=un(6e4);return i.useEffect(()=>{var c,d;(d=(c=document.getElementById(ke(n)))==null?void 0:c.scrollIntoView)==null||d.call(c,{block:"nearest"})},[n]),l.jsx(Je.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:c=>c.preventDefault(),children:l.jsx("div",{id:ut,role:"listbox","aria-label":"Jump back in",className:"max-h-72 overflow-y-auto p-1.5",children:e.map((c,d)=>{var g;return c.kind==="session"?l.jsx(bo,{item:c,agent:c.session.cwd&&s[c.session.cwd]||null,displayName:c.session.cwd&&t[c.session.cwd]||((g=c.session.cwd)==null?void 0:g.split("/").pop())||"Agent",index:d,isSelected:d===n,now:r,onSelect:()=>a(c)},`session-${c.id}`):l.jsx(vo,{item:c,visual:o(c.room),index:d,isSelected:d===n,now:r,onSelect:()=>a(c)},`room-${c.id}`)})})})}const $e={people:"People",agents:"Agents"},wo=["people","agents"];function No(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 Io(e,n,s){const t=n.trim().toLowerCase(),o=e.map((a,r)=>({row:a,position:r,tier:Ro(a,t)})).filter(a=>a.tier!==null).sort((a,r)=>a.tier-r.tier||a.position-r.position);return s.flatMap(a=>o.filter(r=>r.row.section===a).map(({row:r})=>r))}function Ro(e,n){var o;if(n==="")return 0;const s=[(o=e.handle)==null?void 0:o.toLowerCase(),e.label.toLowerCase()].filter(a=>a!==void 0);let t=null;for(const a of s){const r=a===n?0:a.startsWith(n)?1:a.includes(n)?2:null;r!==null&&(t===null||r<t)&&(t=r)}return t}function Y(e,n,s){var a;const t=e.length;if(t===0)return 0;let o=(n%t+t)%t;for(let r=0;r<t;r++){if(!((a=e[o])!=null&&a.disabled))return o;o=(o+s+t)%t}return 0}function Co(e,n,s,t){const o=e.slice(0,n),a=e.slice(n+1+s.length),r=`@${t}`,c=a.startsWith(" ")?"":" ";return{value:o+r+c+a,cursorPos:o.length+r.length+1}}const Ao=/(^|\s)@([A-Za-z0-9_.-]*)$/,ft="mention-palette-listbox";function me(e){return`mention-item-${e}`}function Mo({members:e,viewerAuthorId:n,text:s,sectionOrder:t=wo}){var _;const[o,a]=i.useState(!1),[r,c]=i.useState(""),[d,g]=i.useState(-1),u=yn(s),x=i.useRef(!1),v=i.useMemo(()=>No(e,n),[e,n]),f=i.useMemo(()=>o?Io(v,r,t):[],[v,r,o,t]),[m,p]=i.useState(null),h=m!==null&&m.query===r&&m.open===o?m.index:Y(f,0,1),w=f[h],y=f.length===0||w!==void 0&&!w.disabled?h:Y(f,0,1),I=i.useCallback((k,D)=>{const T=k.slice(0,D).match(Ao);if(!T){a(!1);return}a(!0),c(T[2]),g((T.index??0)+T[1].length)},[]),S=i.useCallback(k=>{u.write(k),x.current=!1},[u]),C=i.useCallback(k=>{x.current||I(u.read(),k)},[I,u]),A=i.useCallback(()=>{p({query:r,open:o,index:Y(f,y+1,1)})},[f,y,r,o]),N=i.useCallback(()=>{p({query:r,open:o,index:Y(f,y-1,-1)})},[f,y,r,o]),M=i.useCallback(k=>k.disabled||k.handle===void 0?null:(x.current=!0,a(!1),Co(u.read(),d,r,k.handle)),[d,r,u]),j=i.useCallback(()=>{const k=f[y];return k?M(k):(a(!1),null)},[f,y,M]),b=i.useCallback(()=>{x.current=!0,a(!1)},[]),O=f.some(k=>!k.disabled);return{isOpen:o,hasSelectableRows:O,rows:f,selectedIndex:y,activeDescendantId:o&&((_=f[y])==null?void 0:_.disabled)===!1?me(y):void 0,listboxId:o?ft:void 0,noteTextChange:S,handleCursorChange:C,moveDown:A,moveUp:N,selectHighlighted:j,selectRow:M,dismiss:b}}function jo({rows:e,selectedIndex:n,onSelect:s}){const t=i.useMemo(()=>{const o=[];return e.forEach((a,r)=>{const c=o[o.length-1];c&&c.section===a.section?c.items.push({row:a,index:r}):o.push({section:a.section,items:[{row:a,index:r}]})}),o},[e]);return i.useEffect(()=>{var o;(o=document.getElementById(me(n)))==null||o.scrollIntoView({block:"nearest"})},[n]),l.jsx(Je.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:l.jsx("div",{id:ft,role:"listbox","aria-label":"Mentions",className:"max-h-72 overflow-y-auto p-1.5",children:e.length===0?l.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:a},r)=>l.jsxs("div",{role:"group","aria-label":$e[o],children:[r>0&&l.jsx("div",{className:"bg-border mx-2 my-1.5 h-px"}),l.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:$e[o]}),a.map(({row:c,index:d})=>{const g=d===n;return l.jsxs("div",{id:me(d),role:"option","aria-selected":g,"aria-disabled":c.disabled,"data-selected":g,"data-disabled":c.disabled,onClick:()=>{c.disabled||s(c)},className:c.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:[l.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 text-center text-sm leading-none",children:c.emoji}),l.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:c.label}),c.handle!==void 0&&l.jsxs("span",{className:"text-muted-foreground/70 truncate font-mono text-xs",children:["@",c.handle]}),c.disabledReason!==void 0&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs ml-auto shrink-0",children:c.disabledReason})]},c.authorId)})]},o))})})}function na({room:e,threadRootId:n,focusOnMount:s,offerJumpBackIn:t,onFocusChange:o,attachments:a}){const r=n===void 0?e.id:Ue(e.id,n),c=bn(r),{target:d}=On(),g=vn(),u=kn(r),x=i.useRef(null),v=Ve(e.members,e.viewerAuthorId),f=i.useRef(!1),m=Mo({members:e.members,viewerAuthorId:e.viewerAuthorId,text:c}),p=t===!0,h=yo({value:c,yieldToPalette:m.isOpen,enabled:p}),w=i.useRef(u);i.useEffect(()=>{var b;u!==w.current&&(w.current=u,(b=x.current)==null||b.focus())},[u]),i.useEffect(()=>{var b;s===!0&&((b=x.current)==null||b.focusUnlessTouch())},[]);const y=i.useCallback(b=>X.getState().set(r,b),[r]),[I,S]=i.useState(null);i.useLayoutEffect(()=>{var b;I!==null&&((b=x.current)==null||b.focusAt(I.pos))},[I]);const C=i.useCallback(b=>{b&&(y(b.value),S({pos:b.cursorPos}))},[y]),A=i.useCallback(b=>C(m.selectRow(b)),[m,C]),N=i.useCallback(()=>C(m.selectHighlighted()),[m,C]),M=()=>{if(d===null||!d.canSend||f.current)return;m.dismiss();const b=X.getState().take(r).trim();if(b==="")return;const O=a.pendingFiles.length>0;O&&(f.current=!0),d.send({text:b}).catch(()=>{const _=X.getState(),k=_.drafts[r]??"";_.set(r,k===""?b:`${b}
44
- ${k}`)}).finally(()=>{O&&(f.current=!1)})};if(!v)return l.jsxs("div",{className:"flex items-center justify-between gap-3 border-t px-4 py-3",children:[l.jsx("p",{className:"text-muted-foreground text-sm",children:Ge}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:g.isPending,onClick:()=>g.mutate({roomId:e.id,authorId:e.viewerAuthorId},{onSuccess:()=>Be.success(`You joined ${se(e)}`)}),children:wn})]});const j=l.jsx(_n.Composer,{inputRef:x,value:c,onChange:b=>{y(b),m.noteTextChange(b)},onSubmit:M,head:l.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:m.isOpen&&m.rows.length===0?"No one by that name.":""}),mentionPicker:l.jsx(Re,{children:m.isOpen&&l.jsx(jo,{rows:m.rows,selectedIndex:m.selectedIndex,onSelect:A})}),overlays:l.jsx(l.Fragment,{children:l.jsx(Re,{children:h.isOpen&&l.jsx(ko,{rows:h.rows,selectedIndex:h.selectedIndex,agents:h.agents,displayNames:h.displayNames,visualOf:h.visualOf,onSelect:h.selectRow})})}),input:{onCursorChange:m.handleCursorChange,isStreaming:!1,isPaletteOpen:m.isOpen||h.isOpen,paletteHasResults:h.isOpen?h.hasRows:m.hasSelectableRows,onArrowUp:h.isOpen?h.moveUp:m.moveUp,onArrowDown:h.isOpen?h.moveDown:m.moveDown,onCommandSelect:h.isOpen?h.selectHighlighted:N,onEscape:h.isOpen?h.dismiss:m.dismiss,tabPicks:!h.isOpen,onClear:()=>{y(""),m.dismiss()},activeDescendantId:h.isOpen?h.activeDescendantId:m.activeDescendantId,paletteListboxId:h.isOpen?h.listboxId:m.listboxId,contextKey:r,...a.hasFailedUpload?{canSubmitReason:"A file didn’t upload. Try it again or remove it, then send."}:{}}});return!p&&o===void 0?j:l.jsx("section",{className:"flex flex-col","data-testid":Nn.homeComposer,onFocus:b=>{h.handleFocus(b),K(b.target)&&(o==null||o(!0))},onBlur:b=>{h.handleBlur(b),K(b.target)&&(o==null||o(!1))},onPointerDown:h.handlePointerDown,children:j})}export{Xo as A,na as C,ye as I,ea as R,qo as a,Zo as b,ws as c,zo as d,Qo as e,Yo as f,Vo as g,Ns as h,rs as i,Wo as j,Is as k,Rs as l,Cs as m,Go as n,Jo as o,K as p,as as r,W as t,ta as u};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BDJuvXMG.js";import{a as t}from"./ProfileFields-BIDZHo11.js";import"./profile-errors-XchEnatB.js";import"./use-mounted-ref-NbCy8N-y.js";function n({member:r}){return o.jsx(t,{member:r})}export{n as HandlePage};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BDJuvXMG.js";import{P as m}from"./ProfileFields-BIDZHo11.js";import"./profile-errors-XchEnatB.js";import"./use-mounted-ref-NbCy8N-y.js";function a({member:r}){return o.jsx(m,{member:r})}export{a as NamePage};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-BDJuvXMG.js";import{b as t}from"./ProfileFields-BIDZHo11.js";import"./profile-errors-XchEnatB.js";import"./use-mounted-ref-NbCy8N-y.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
@@ -1,10 +0,0 @@
1
- import{W as Mt,r as f,j as t,gU as Ot,a1 as V,ks as Xe,a2 as Ze,kt as z,a3 as le,a4 as we,ku as $t,kv as ue,kw as X,cf as Ut,kx as It,c6 as Lt,g$ as Ft,cj as Re,l as xe,ky as Kt,kz as _t,kA as Pt,kB as je,kC as Ae,B as S,kD as qt,cQ as zt,kE as et,eu as ae,en as tt,eo as st,ep as nt,eq as at,er as Te,I as Me,fX as rt,hs as Yt,fY as it,fZ as ot,f_ as lt,f$ as ct,g0 as dt,g1 as ut,g2 as Ht,$ as Qt,kF as Bt,kG as Jt,kH as Wt,kI as ge,cT as Oe,cU as $e,cW as Ue,cX as Ie,cY as Le,dU as Fe,dB as Ke,a7 as mt,kJ as Gt,kK as Vt,hT as Xt,kL as Zt,kM as _e,kN as es,kO as ts,kP as ft,kQ as ss,kR as pt,kS as ht,kT as ns,eb as xt,kU as as,kV as rs,kW as is,ji as os,a0 as ls,ey as cs,fe as ds,kX as us,c$ as gt,kY as ms,kZ as fs,ad as ps,n as Qe}from"./index-BDJuvXMG.js";import{T as hs,R as xs,a as gs}from"./RoomSurface-CAbD4wVy.js";import{b as pe,C as Ne}from"./index-CGvU4pGg.js";import{M as ys}from"./markdown-content-NzXgwE2G.js";import{o as vs,a as js,c as Ns}from"./owner-notice-C0ArQJdp.js";import"./ChannelComposer-Fmb-x_zK.js";import"./pane-resize-handle-DAB3TvrY.js";import"./UnreadDivider-CNjRFpAY.js";import"./use-room-follow-claim-CTPdEUnW.js";import"./use-connector-management-CApx-e1Z.js";import"./AgentRequestCard-C6aBR2TD.js";import"./access-copy-robDo1S-.js";import"./query-error-state-C2EyJ_cl.js";import"./empty-state-BO-UXPQj.js";import"./use-bindings-BAKvriCK.js";import"./connection-copy--MA7AN04.js";import"./KeyEntry-B1M6Cb_W.js";import"./use-room-sessions-DiysSClf.js";import"./file-DQJ4ncBH.js";import"./file-drag-GDx2qhdk.js";import"./find-latest-widget-fence-C2e-pGhG.js";import"./WidgetErrorCard-D9LKAbNg.js";import"./index-BHnCpgC9.js";import"./card-CHG8Y8EA.js";import"./progress-BF25Vgvc.js";import"./table-C5zpnw52.js";import"./package-DAjaMh-O.js";import"./heart-WdIkTWht.js";import"./git-branch-B5MdRp1u.js";import"./file-text-3tteNtIM.js";import"./paperclip-C6yKmauj.js";import"./index-DZ9FOOp-.js";import"./RuntimeSetupDialog-Cof6tku2.js";import"./inline-code-hmEz0OM4.js";import"./list-runtime-types-CaJn2_14.js";import"./RuntimeConnectFlow-CXAcX8bE.js";import"./useMutationState-BwG8hXiA.js";import"./runtime-connect-Dn0T5YWv.js";import"./repeat-Dl9Z6gcw.js";import"./format-duration-BCr6uzby.js";import"./mention-pill-CumFsu3I.js";import"./rotate-ccw-clock-Cvx7qMiL.js";import"./unplug-Cbp9pPvY.js";import"./message-square-off-Zgzm0pcy.js";import"./registry-ZygbjV-M.js";/**
2
- * @license lucide-react v1.48.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const yt={name:"circle-off",size:24,node:[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.35 2.69A10 10 0 0 1 21.3 15.65",key:"1pfsoa"}],["path",{d:"M19.08 19.08A10 10 0 1 1 4.92 4.92",key:"1ablyi"}]]};yt.node;const Cs=Mt(yt),ws=5e3;function Rs({connection:e}){var l;const s=e.official===!0&&e.status==="connected"&&((l=e.access)==null?void 0:l.state)==="unverified",n=f.useMemo(()=>s?{}:null,[s]),[a,i]=f.useState(null);return f.useEffect(()=>{if(!n)return;const d=setTimeout(()=>i(n),ws);return()=>clearTimeout(d)},[n]),n===null||a!==n?null:t.jsx(Ot,{tone:"info",role:"status",className:"m-3","data-testid":"official-space-unreachable",children:"The DorkOS community isn’t reachable right now. Try again in a few minutes."})}function vt(e,s){return[...z.remote(e,s),"teammates"]}function Ss(e,s=!0){const n=V(),a=Xe(s);return Ze({queryKey:a?vt(a,e):[...z.all,"owner","unresolved",e,"teammates"],queryFn:()=>$t(a,async()=>{const[i,l]=await Promise.all([n.getCommunityWakeAgentsFrom(e),n.getCommunityTeammateSpend(e)]);return{wakeAgentsFrom:i.wakeAgentsFrom,spend:l}}),enabled:s&&a!==null})}function ks(e){const s=V(),n=le(),a=Xe(!0);return we({mutationFn:async i=>{"wakeAgentsFrom"in i?await s.setCommunityWakeAgentsFrom(e,i.wakeAgentsFrom):await s.setCommunityTeammateSpendLimit(e,i.monthlyLimitUsd)},onSettled:async()=>{a&&await n.invalidateQueries({queryKey:vt(a,e)})}})}const bs=500,oe=new Map;function jt(e,s){return e.id!==s.id||e.community!==s.community||e.roomId!==s.roomId||e.text===s.text&&e.authorDisplayName===s.authorDisplayName&&JSON.stringify(e.mentions)===JSON.stringify(s.mentions)&&JSON.stringify(e.attachments)===JSON.stringify(s.attachments)?e:{...e,text:s.text,mentions:s.mentions,attachments:s.attachments,authorDisplayName:s.authorDisplayName}}function Ee(e,s){if(s.size===0)return e;let n=!1;const a=e.map(i=>{const l=s.get(i.id),d=l?jt(i,l):i;return d!==i&&(n=!0),d});return n?a:e}function Ce(e,s,...n){const a=new Map;for(const i of n)for(const l of i){if(l.community!==e||l.roomId!==s)throw new Error("Community history contains a different room.");a.set(l.id,l)}return[...a.values()].sort((i,l)=>i.remoteSeq-l.remoteSeq)}function As(e,s,n=!0,a=0,i="legacy",l=!1,d){const c=V(),r=f.useRef(d);f.useEffect(()=>{r.current=d},[d]);const o=le(),h=ue(!0,i,e),u=JSON.stringify([h==null?void 0:h.ownerKey,h==null?void 0:h.epoch,h==null?void 0:h.route.epoch,h==null?void 0:h.accessFingerprint,e,s]),[y,N]=f.useState(()=>({address:u,room:null,entries:[],revisions:oe,deliveries:[],status:"connecting"}));return f.useEffect(()=>{if(!h||!n)return;const v=h,w=new AbortController;let g,O=0,A,_,Y=!1;N({address:u,room:null,entries:[],revisions:oe,deliveries:[],status:"connecting"});function M(){Y=!0,A=void 0,_=void 0,o.removeQueries({queryKey:z.remote(v,e)}),N({address:u,room:null,entries:[],revisions:oe,deliveries:[],status:"removed"})}async function q(){try{await c.subscribeRemoteCommunityRoom(e,s,C=>{var U;if(!(w.signal.aborted||Y||!X(v))){if(C.type==="closed"){(C.reason==="removed"||C.reason==="revoked")&&M();return}if(O=0,C.type==="snapshot")A=C.cursor??void 0,C.redactionCursor&&(_=C.redactionCursor),o.setQueryData(z.room(v,e,s),C.room),N(j=>({address:u,room:C.room,entries:Ee(Ce(e,s,j.address===u?j.entries:[],C.entries).slice(-500),j.address===u?j.revisions:oe),revisions:j.address===u?j.revisions:oe,deliveries:j.deliveries.filter(x=>!C.entries.some(I=>I.originIdempotencyKey===x.idempotencyKey)),status:C.stale?"offline":"live"}));else if(C.type==="revision"){const j=C.entry;C.redactionCursor&&(_=C.redactionCursor);const x=[...z.room(v,e,s),"entries"],b=o.getQueriesData({queryKey:x}).some(([,k])=>k==null?void 0:k.pages.some(F=>F.entries.some(H=>H.id===j.id)))||o.isFetching({queryKey:x})>0||((U=r.current)==null?void 0:U.call(r,j.id))===!0;o.setQueriesData({queryKey:x},k=>{if(!k)return k;let F=!1;const H=k.pages.map(Z=>{const re=Z.entries.map(ee=>jt(ee,j));return re.some((ee,me)=>ee!==Z.entries[me])?(F=!0,{...Z,entries:re}):Z});return F?{...k,pages:H}:k}),N(k=>{if(!b&&!k.entries.some(H=>H.id===j.id))return k;const F=new Map(k.revisions);for(F.delete(j.id),F.set(j.id,j);F.size>bs;)F.delete(F.keys().next().value);return{...k,entries:Ee(k.entries,F),revisions:F}})}else C.type==="deliveries"?N(j=>({...j,deliveries:C.deliveries.filter(x=>!j.entries.some(I=>I.originIdempotencyKey===x.idempotencyKey))})):(A=C.entry.cursor,N(j=>({...j,entries:Ce(e,s,j.entries,[C.entry]).slice(-500),deliveries:j.deliveries.filter(x=>x.idempotencyKey!==C.entry.originIdempotencyKey),status:"live"})))}},{since:A,redactions:_,signal:w.signal})}catch(C){if(w.signal.aborted||!X(v))return;const U=C&&typeof C=="object"&&"status"in C?C.status:void 0,j=C&&typeof C=="object"&&"code"in C?C.code:void 0;j==="COMMUNITY_DELETED"||j==="COMMUNITY_TAKEN_DOWN"?(M(),o.invalidateQueries({queryKey:z.connections(v)})):U===401||U===403||U===404?M():U===410&&j==="COMMUNITY_CURSOR_STALE"&&(A=void 0)}if(w.signal.aborted||Y||!X(v))return;const L=o.getQueryData(z.room(v,e,s));L&&o.setQueryData(z.room(v,e,s),{...L,stale:!0,writable:!1}),N(C=>({...C,room:C.room?{...C.room,stale:!0,writable:!1}:null,status:"offline"})),g=setTimeout(()=>{q()},Math.min(3e4,1e3*2**Math.min(O++,5)))}return q(),()=>{w.abort(),clearTimeout(g)}},[u,e,s,n,a,o,c,h,l]),y.address!==u||!h?{address:u,room:null,entries:[],revisions:oe,deliveries:[],status:"connecting"}:n?y:l?{...y,room:y.room?{...y.room,stale:!0,writable:!1}:null,deliveries:[],status:"offline"}:{address:u,room:null,entries:[],revisions:oe,deliveries:[],status:"removed"}}function Ds(e){var h;const s=Ut(),n=It(),a=e===void 0||(h=s.data)==null?void 0:h.find(u=>u.id===e),i=a!==void 0&&Lt(a)!==null,l=e===void 0||s.data!==void 0||s.isError,[d,c]=f.useState(void 0),r=e!==void 0&&d===e,o=f.useRef(void 0);return f.useEffect(()=>{!i||e===void 0||r||o.current===e||(o.current=e,n({roomId:e},{replace:!0,quiet:!0}).then(u=>{u||c(e)}))},[i,e,r,n]),l?i&&!r?"redirecting":"show":"pending"}function Ts(e,s,n){var c;const a=Ft(),i=Re(),l=e!==void 0&&((c=a.room)==null?void 0:c.id)===e,d=a.status!=="loading";return f.useEffect(()=>{l&&i({...xe.home(),search:{...s===void 0?{}:{thread:s},...n===void 0?{}:{entry:n}},replace:!0})},[l,s,n,i]),e===void 0?"show":l?"redirecting":d?"show":"pending"}function Es(e){return e?{ownerAddress:JSON.stringify([e.ownerKey,e.epoch]),contextAddress:JSON.stringify([e.ownerKey,e.epoch,e.route.epoch,e.accessFingerprint])}:{ownerAddress:"",contextAddress:""}}const Ms=new Set(["COMMUNITY_MUTED","COMMUNITY_SLOW_MODE","COMMUNITY_RULES_NOT_ACCEPTED"]);function Os(e){const s=e==null?void 0:e.code;return typeof s=="string"&&Ms.has(s)}function $s(e,s=new Date){return e.kind==="muted"?`You’re muted here until ${Kt(e.until,s)??"later"}.`:e.kind==="rules"?"Accept this space’s rules to post.":`Slow mode. Post again in ${e.secondsLeft}s.`}function Us(e,s){if(!e)return null;if(e.mutedUntil&&Date.parse(e.mutedUntil)>s)return{kind:"muted",until:e.mutedUntil};const{rules:n}=e;return n.text!==null&&n.version>0&&n.acceptedVersion<n.version?{kind:"rules"}:null}function Is({community:e,roomId:s,enabled:n,accessFingerprint:a}){var Y;const i=V(),l=le(),d=ue(n,a,e),c=d?[...z.room(d,e,s),"standing"]:[...z.all,"owner","unresolved",e,"room",s,"standing"],r=Ze({queryKey:c,queryFn:()=>_t(d,()=>i.getRemoteCommunityStanding(e,s)),enabled:n&&d!==null,staleTime:3e4,retry:!1,refetchInterval:M=>{var q;return(q=M.state.data)!=null&&q.mutedUntil&&Date.parse(M.state.data.mutedUntil)>Date.now()?6e4:!1}}),[o,h]=f.useState(null),[u,y]=f.useState(()=>Date.now()),N=(Y=r.data)!=null&&Y.mutedUntil?Date.parse(r.data.mutedUntil):null;f.useEffect(()=>{if(o!==null&&o>u){const M=setTimeout(()=>y(Date.now()),1e3);return()=>clearTimeout(M)}if(N!==null&&N>u){const M=setTimeout(()=>y(Date.now()),Math.min(N-u+50,1073741824));return()=>clearTimeout(M)}},[N,u,o]);const v=r.refetch,w=f.useCallback(M=>{if((M==null?void 0:M.code)==="COMMUNITY_SLOW_MODE"){const L=M.retryAfterMs;if(typeof L=="number"&&L>0){const C=Date.now();y(C),h(C+L)}return}v()},[v]),g=we({meta:{suppressErrorToast:!0},mutationFn:M=>i.acceptRemoteCommunityRules(e,M),onSuccess:M=>{l.setQueryData(c,q=>q&&{...q,rules:M})},onError:()=>void v()}),O=Us(r.data,u),A=o===null?0:Math.ceil((o-u)/1e3),_=O??(A>0?{kind:"slow",secondsLeft:A}:null);return{standing:r.data,hold:_,noteHold:w,accept:g}}const Ls=new Set(["COMMUNITY_DELETED","COMMUNITY_TAKEN_DOWN"]),Fs=30*6e4,he=new Map;function Nt(e,s,n){return JSON.stringify([e,s,n])}function Ct(e){return Date.now()-e<Fs}function Ks(e){for(const[s,n]of he)Ct(n.at)||he.delete(s);return he.get(e)}function _s(){return Date.now()}function Ps(e,s,n){he.set(e,{attachmentId:s,at:n})}function Be(e){for(const s of e.files)he.delete(Nt(e.ref,e.roomId,s.id))}function Je(e){return e.filter(s=>s.trim()).join(`
7
-
8
- `)}function qs(e){const s=e==null?void 0:e.code;return typeof s=="string"&&Ls.has(s)}function De(e){return e.map(({id:s,file:n})=>({id:s,file:n,status:"pending",progress:0}))}function zs({ref:e,roomId:s,canSend:n,entries:a,onReceipt:i,draft:l,ownerKey:d,contextKey:c=d,onHold:r}){const o=V(),h=JSON.stringify([d,e,s,c]),u=Pt(l),y=u.text,N=f.useMemo(()=>De(u.files),[u.files]),v=f.useRef(l);f.useLayoutEffect(()=>{v.current=l},[l]);function w(m){const R=v.current;if(!R)return;const $=je.getState(),T=$.drafts[Ae(R)],E=m({text:(T==null?void 0:T.text)??"",files:De((T==null?void 0:T.files)??[])});$.write(R,{text:E.text,files:E.files.map(({id:P,file:B})=>({id:P,file:B}))})}function g(m){w(R=>({...R,text:m}))}function O(m){w(R=>({...R,files:m(R.files)}))}const[A,_]=f.useState(null);function Y(m){_(m===null?null:{address:h,context:c,message:m})}const[M,q]=f.useState([]),L=f.useRef(new Map),C=f.useRef(0),U=f.useRef(new Map),j=f.useRef(new Set),x=f.useRef(h),I=f.useRef(c),b=f.useRef(!0),k=f.useRef(n),F=f.useRef(i),H=f.useRef(r);f.useLayoutEffect(()=>{x.current=h,I.current=c,k.current=n,F.current=i,H.current=r},[h,n,c,i,r]),f.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]),f.useEffect(()=>{let m=!1;for(const R of a){if(!R.originIdempotencyKey)continue;const $=L.current.get(R.originIdempotencyKey);($==null?void 0:$.address)===x.current&&$.context===I.current&&L.current.delete(R.originIdempotencyKey)&&(Be($),m=!0)}m&&q([...L.current.values()])},[a]);function Z(){b.current&&q([...L.current.values()].filter(m=>m.address===x.current&&m.context===I.current).map(m=>({...m})))}async function re(m){var R,$;if(!(j.current.has(m.key)||!k.current||!b.current||m.address!==x.current)){j.current.add(m.key),m.status="sending",m.error=void 0,Z();try{!m.posted&&m.uploadedAt.some(E=>!Ct(E))&&(m.attachmentIds=[],m.uploadedAt=[],m.triedAt=[],m.uploadRound+=1);for(let E=m.attachmentIds.length;E<m.files.length;E++){if(!k.current||!b.current||m.address!==x.current)throw new Error("Reconnect to this channel, then try again.");const P=m.files[E],B=Nt(m.ref,m.roomId,P.id),J=Ks(B);if(J){m.attachmentIds.push(J.attachmentId),m.uploadedAt.push(J.at);continue}const te=(R=m.triedAt)[E]??(R[E]=_s()),W=await o.uploadRemoteCommunityAttachment(m.ref,m.roomId,P.file,m.uploadRound?`${m.key}:file:${E}:${m.uploadRound}`:`${m.key}:file:${E}`);Ps(B,W.id,te),m.uploadedAt.push(te),m.attachmentIds.push(W.id)}if(!k.current||!b.current||m.address!==x.current)throw new Error("Reconnect to this channel, then try again.");m.posted=!0;const T=await o.postRemoteCommunityEntry(m.ref,m.roomId,{text:m.text,parentEntryId:m.parentEntryId,attachmentIds:m.attachmentIds,idempotencyKey:m.key});L.current.delete(m.key),Be(m),b.current&&m.address===x.current&&m.context===I.current&&F.current(T)}catch(T){if(qs(T)&&ee(m)){L.current.delete(m.key);return}if(Os(T)&&ee(m)){L.current.delete(m.key),b.current&&m.address===x.current&&(($=H.current)==null||$.call(H,T));return}m.status="failed",m.error=T instanceof Error?T.message:"Not confirmed. Try this message again."}finally{j.current.delete(m.key),Z()}}}function ee(m){const{draft:R}=m.origin,$=Ae(R),T=je.getState(),E=T.drafts[$],P=(E==null?void 0:E.text)??"";let B=U.current.get($)??[];const J=Je(B.map(G=>G.origin.typed));let te=P;J&&P.startsWith(J)?te=P.slice(J.length).replace(/^\n+/,""):B=[];const W=[...B,m].sort((G,se)=>G.origin.seq-se.origin.seq),ye=new Set(W.flatMap(G=>G.files.map(se=>se.id))),ie=[...W.flatMap(G=>G.files.map(({id:se,file:fe})=>({id:se,file:fe}))),...((E==null?void 0:E.files)??[]).filter(G=>!ye.has(G.id))];return T.write(R,{text:Je([...W.map(G=>G.origin.typed),te]),files:ie}),$ in je.getState().drafts?(U.current.set($,W),!0):!1}function me(m){const R=v.current;if(!R||!k.current)return;const $=je.getState(),T=$.drafts[Ae(R)];if(!T||!T.text.trim()&&T.files.length===0)return;if(L.current.size>=30){Y("Too many messages waiting. Let them send, or retry them first.");return}const E=$.take(R),P=De(E.files),B={address:h,context:c,ref:e,roomId:s,key:crypto.randomUUID(),text:E.text.trim()?E.text:P.map(J=>J.file.name).join(", "),parentEntryId:m,files:P,attachmentIds:[],uploadedAt:[],triedAt:[],posted:!1,uploadRound:0,status:"sending",origin:{draft:R,typed:E.text,seq:C.current+=1}};L.current.set(B.key,B),Y(null),re(B)}return{text:y,setText:g,attachments:{staged:N,add(m){if(m.some(R=>R.size>25*1024*1024)){Y("Each file must be 25 MB or smaller.");return}O(R=>R.length+m.length>8?(Y("Attach up to eight files to one message."),R):[...R,...m.map($=>({id:crypto.randomUUID(),file:$,status:"pending",progress:0}))])},remove(m){O(R=>R.filter($=>$.id!==m))},retry(){},cancel(){O(()=>[])},hasFailed:!1,isUploading:!1,holdsSendWhileUploading:!1},deliveries:M.filter(m=>m.address===h&&m.context===c),error:(A==null?void 0:A.address)===h&&A.context===c?A.message:null,send:me,retry(m){const R=L.current.get(m);R&&re(R)}}}function wt({entry:e,onThread:s,onReport:n}){const a=V(),i=f.useId(),[l,d]=f.useState(null),[c,r]=f.useState(null),o={id:JSON.stringify([e.community,e.authorId]),kind:e.authorKind,displayName:e.authorDisplayName};async function h(u,y){if(c)return;r(u),d(null);let N;try{const v=await a.downloadRemoteCommunityAttachment(e.community,e.roomId,u);N=URL.createObjectURL(v);const w=document.createElement("a");w.href=N,w.download=Array.from(y,g=>g==="/"||g==="\\"||g.charCodeAt(0)<32?"_":g).join(""),document.body.append(w),w.click(),w.remove()}catch(v){d(v instanceof Error?v.message:"Couldn’t download the file. Try again.")}finally{N&&setTimeout(()=>URL.revokeObjectURL(N),1e3),r(null)}}return t.jsxs(pe.Root,{role:e.authorKind==="human"?"user":"assistant","aria-labelledby":i,children:[t.jsx(pe.Gutter,{author:o,at:e.createdAt}),t.jsxs(pe.Body,{children:[t.jsx(pe.Author,{id:i,author:o,at:e.createdAt}),t.jsxs(pe.Content,{children:[t.jsx(ys,{content:e.text}),e.attachments.map(u=>t.jsx(S,{variant:"outline",size:"sm",disabled:c!==null,onClick:()=>void h(u.id,u.name),className:"max-w-full",children:t.jsx("span",{className:"min-w-0 truncate",children:c===u.id?"Downloading…":u.name})},u.id)),l&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:l}),s&&t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>s(e.threadRootEntryId??e.id),children:e.depth===0?"Reply in thread":"Open thread"}),n&&t.jsx(S,{variant:"ghost",size:"sm",onClick:n,children:"Report"})]})]})]})}function Ys({community:e,roomId:s,online:n,canEnroll:a,accessFingerprint:i}){var j,x,I;const l=V(),d=le(),c=ue(!0,i,e),r=qt(e,a,i),o=zt(),h=et(e,a,i),[u,y]=f.useState(""),[N,v]=f.useState(""),[w,g]=f.useState(!1),[O,A]=f.useState(null),[_,Y]=f.useState(null),M=f.useId(),q=((j=r.data)==null?void 0:j.filter(b=>b.active))??[],L=((x=o.data)==null?void 0:x.agents.filter(b=>!q.some(k=>k.localAgentId===b.id)))??[];async function C(){c&&X(c)&&await d.invalidateQueries({queryKey:z.remote(c,e)})}async function U(b){if(b.preventDefault(),!u||w||!n||!a||!c)return;const k=c;g(!0),A(null);try{if(await l.enrollRemoteCommunityAgent(e,u,N.trim()?{handle:N.trim()}:{}),!X(k))return;y(""),v(""),await C()}catch(F){X(k)&&A(F instanceof Error?F.message:"Couldn’t add the agent. Try again.")}finally{X(k)&&g(!1)}}return t.jsxs("section",{className:"mt-3 space-y-2 border-t pt-3","aria-label":"Your agents in this space",children:[t.jsx("h3",{className:"text-sm font-medium",children:"My agents"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Add an agent from here, then choose whether it joins this channel."}),r.isError&&t.jsxs("p",{role:"alert",children:["Couldn’t load your agents in this space."," ",t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void r.refetch(),children:"Retry"})]}),(I=r.data)==null?void 0:I.map(b=>{var k;return t.jsx(Hs,{agent:b,roomId:s,online:n,canEnroll:a,takesDms:((k=h.data)==null?void 0:k.available)===!0,onChanged:C,onNotice:Y},b.localAgentId)}),o.isError&&t.jsx("p",{role:"alert",children:"Couldn’t load the agents on this computer."}),a&&L.length>0&&t.jsxs("form",{onSubmit:b=>void U(b),className:"flex flex-wrap items-end gap-2",children:[t.jsxs("div",{className:"min-w-40 flex-1 space-y-1",children:[t.jsx(ae,{htmlFor:`${M}-agent`,children:"Local agent"}),t.jsxs(tt,{value:u,onValueChange:y,disabled:!n||w,children:[t.jsx(st,{id:`${M}-agent`,children:t.jsx(nt,{placeholder:"Choose an agent"})}),t.jsx(at,{children:L.map(b=>t.jsx(Te,{value:b.id,children:b.name},b.id))})]})]}),t.jsxs("div",{className:"min-w-40 flex-1 space-y-1",children:[t.jsx(ae,{htmlFor:`${M}-handle`,children:"Space handle (optional)"}),t.jsx(Me,{id:`${M}-handle`,value:N,onChange:b=>v(b.target.value),disabled:!n||w,placeholder:"Use the agent’s handle"})]}),t.jsx(S,{type:"submit",disabled:!u||!n||w,children:w?"Adding…":"Add to space"})]}),_&&t.jsx("p",{role:"status",className:"text-muted-foreground text-sm",children:_}),O&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:O})]})}function Hs({agent:e,roomId:s,online:n,canEnroll:a,takesDms:i,onChanged:l,onNotice:d}){const c=V(),[r,o]=f.useState(null),[h,u]=f.useState(null),y=e.roomIds.includes(s),N=f.useId();async function v(g,O){if(!r){o(g),u(null);try{await O(),await l()}catch(A){u(A instanceof Error?A.message:"Couldn’t finish that. Try again.")}finally{o(null)}}}function w(g){d(g.remoteRevoked?"Stopped taking part.":"Stopped here, but the space wasn’t told. Try again when it’s reachable.")}return t.jsxs("div",{className:"space-y-1 rounded-md border p-2",children:[t.jsxs("p",{className:"text-sm font-medium",children:[e.displayName,!e.active&&" · stopped here"," ",t.jsxs("span",{className:"text-muted-foreground font-normal",children:["· owned by ",e.ownerDisplayName]})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.jsx(S,{variant:"outline",size:"sm",disabled:r!==null||!a||!e.active||!y&&!n,onClick:()=>void v("membership",async()=>{y?w(await c.leaveRemoteCommunityAgentRoom(e.community,s,e.localAgentId)):await c.joinRemoteCommunityAgentRoom(e.community,s,e.localAgentId)}),children:y?"Leave channel":"Join channel"}),t.jsx(S,{variant:"ghost",size:"sm",disabled:r!==null||!a,onClick:()=>void v("stop",()=>c.haltRemoteCommunityAgent(e.community,s,e.localAgentId)),children:"Stop agent"}),t.jsxs(rt,{children:[t.jsx(Yt,{asChild:!0,children:t.jsx(S,{variant:"ghost",size:"sm",disabled:r!==null||!a,children:"Remove from space"})}),t.jsxs(it,{children:[t.jsxs(ot,{children:[t.jsxs(lt,{children:["Remove ",e.displayName,"?"]}),t.jsx(ct,{children:"It leaves every channel in this space. You can re-add it."})]}),t.jsxs(dt,{children:[t.jsx(ut,{children:"Cancel"}),t.jsx(Ht,{onClick:()=>void v("remove",async()=>w(await c.ejectRemoteCommunityAgent(e.community,e.localAgentId))),children:"Remove agent"})]})]})]})]}),i&&e.active&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Qt,{id:N,checked:e.acceptsDms===!0,disabled:r!==null||!a||!n,onCheckedChange:g=>void v("dms",()=>c.setRemoteCommunityAgentDms(e.community,e.localAgentId,g))}),t.jsx(ae,{htmlFor:N,className:"text-xs font-normal",children:"Takes direct messages"})]}),h&&t.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:h})]})}function Qs({community:e,agent:s,disabled:n,accessFingerprint:a}){const i=V(),l=Re(),d=le(),c=ue(!0,a,e),[r,o]=f.useState(!1),[h,u]=f.useState(null);async function y(){if(!r){o(!0),u(null);try{const N=await i.startRemoteCommunityDm(e,s.memberId);c&&await d.invalidateQueries({queryKey:z.dms(c,e)}),l({...xe.channels(),search:{community:e,id:N.roomId}})}catch(N){u(N.code===Bt?`${s.displayName} isn’t taking direct messages.`:"Couldn’t open the direct message. Try again.")}finally{o(!1)}}}return t.jsxs("span",{className:"flex flex-wrap items-center justify-end gap-x-2",children:[h&&t.jsx("span",{role:"status",className:"text-muted-foreground order-last w-full text-right text-xs sm:order-none sm:w-auto",children:h}),t.jsx(S,{variant:"ghost",size:"sm",disabled:n||r,onClick:()=>void y(),"aria-label":`Message ${s.displayName}`,children:"Message"})]})}function We(e){return`$${e.toFixed(2)}`}function Bs({community:e,online:s,canEnroll:n}){var w;const a=f.useId(),i=Ss(e),l=ks(e),d=(w=i.data)==null?void 0:w.spend,[c,r]=f.useState(null),o=(d==null?void 0:d.monthlyLimitUsd)!=null?String(d.monthlyLimitUsd):"",h=c??o,u=h.trim()===""?null:Jt(Number(h)),y=u===null||Number.isFinite(u)&&u>=Wt,N=u!==((d==null?void 0:d.monthlyLimitUsd)??null);function v(g){g.preventDefault(),!(!y||!N||l.isPending)&&l.mutate({monthlyLimitUsd:u},{onSuccess:()=>r(null)})}return!n&&!(d!=null&&d.hasAgentsHere)?null:t.jsxs("section",{className:"mt-3 space-y-2 border-t pt-3","aria-labelledby":`${a}-heading`,children:[t.jsx("h3",{id:`${a}-heading`,className:"text-sm font-medium",children:"Teammates"}),i.isError&&t.jsxs("p",{role:"alert",className:"text-sm",children:["Couldn’t load teammate settings."," ",t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void i.refetch(),children:"Retry"})]}),i.data&&d&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{htmlFor:`${a}-wake`,children:"Who can wake your agents"}),t.jsxs(tt,{value:i.data.wakeAgentsFrom,onValueChange:g=>l.mutate({wakeAgentsFrom:g==="me"?"me":"members"}),disabled:!s||l.isPending,children:[t.jsx(st,{id:`${a}-wake`,className:"max-w-64",children:t.jsx(nt,{})}),t.jsxs(at,{children:[t.jsx(Te,{value:"members",children:"Anyone in this space"}),t.jsx(Te,{value:"me",children:"Only me"})]})]})]}),t.jsxs("form",{onSubmit:v,className:"space-y-1",children:[t.jsx(ae,{htmlFor:`${a}-limit`,children:"Monthly limit for teammates"}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"text-muted-foreground text-sm","aria-hidden":!0,children:"$"}),t.jsx(Me,{id:`${a}-limit`,inputMode:"decimal",value:h,onChange:g=>r(g.target.value),placeholder:"No limit","aria-invalid":!y,disabled:!s||l.isPending,className:"w-32"}),t.jsx(S,{type:"submit",size:"sm",disabled:!s||!y||!N||l.isPending,children:"Save"})]}),t.jsxs("p",{className:"text-muted-foreground text-xs",children:[d.monthlyLimitUsd===null?"No limit":`Limit ${We(d.monthlyLimitUsd)} a month`,` · ${We(d.spentUsd)} spent this month${d.approximate?", approximate":""}`]}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Past the limit, teammates’ messages wake nobody. A running turn may go slightly over."}),!y&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Enter at least $0.01, or leave it empty."})]}),l.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:"Couldn’t save. Try again."})]})]})}function Js(e,s){const n=new Date(e),a=n.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return n.toDateString()===s.toDateString()?a:`${n.toLocaleDateString([],{month:"short",day:"numeric",...n.getFullYear()===s.getFullYear()?{}:{year:"numeric"}})}, ${a}`}function Ws(e,s=new Date){return e.kind!=="agent"?null:e.availability==="available"?{text:"Available"}:e.availability==="offline"&&e.lastSeenAt?{text:"Offline since",since:{dateTime:new Date(e.lastSeenAt).toISOString(),label:Js(e.lastSeenAt,s)}}:null}function Gs({roster:e,failed:s,canMention:n,onMention:a,community:i,roomId:l,online:d,canEnroll:c,agentsKey:r,accessFingerprint:o}){var N,v,w;const u=((N=et(i,!0,o).data)==null?void 0:N.available)===!0,y=(w=(v=ge().data)==null?void 0:v.find(g=>g.ref===i))==null?void 0:w.connectedHumanMemberId;return t.jsxs("div",{className:"max-h-48 overflow-auto border-b p-3","aria-label":"Channel members",children:[s&&t.jsx("p",{role:"alert",children:"Couldn’t load members."}),(e==null?void 0:e.stale)&&t.jsx("p",{className:"text-muted-foreground text-sm",children:"Saved member list"}),e==null?void 0:e.members.map(g=>{var A;const O=Ws(g);return t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-2 text-sm",children:[t.jsxs("span",{children:[g.displayName,g.kind==="agent"?" · Agent":"",g.ownerMemberId&&` · owned by ${((A=e.members.find(_=>_.memberId===g.ownerMemberId))==null?void 0:A.displayName)??"a space member"}`,O&&t.jsxs("span",{className:"text-muted-foreground",children:[` · ${O.text}`,O.since&&t.jsxs(t.Fragment,{children:[" ",t.jsx("time",{dateTime:O.since.dateTime,children:O.since.label})]})]})]}),t.jsxs("span",{className:"flex flex-wrap items-center justify-end",children:[u&&g.kind==="agent"&&g.ownerMemberId!==y&&t.jsx(Qs,{community:i,agent:g,disabled:!d,accessFingerprint:o}),g.handle&&t.jsxs(S,{variant:"ghost",size:"sm",disabled:!n,onClick:()=>a(g.handle),children:["Mention @",g.handle]})]})]},g.memberId)}),c&&t.jsx(Ys,{community:i,roomId:l,online:d,canEnroll:!0,accessFingerprint:o},r),t.jsx(Bs,{community:i,online:d,canEnroll:c})]})}function Rt(e,s){return e instanceof Error&&e.message?e.message:s}function Vs({conduct:e,staff:s,onReadRules:n}){const{hold:a,standing:i}=e;return(a==null?void 0:a.kind)==="rules"?t.jsx("div",{className:"px-1 pb-1",children:t.jsx(S,{size:"sm",variant:"outline",onClick:n,children:"Read the rules"})}):a||s||!(i!=null&&i.slowModeSeconds)?null:t.jsxs("p",{className:"text-muted-foreground px-1 pb-1 text-xs",children:["Slow mode: one message every ",i.slowModeSeconds,"s."]})}function Xs({conduct:e,open:s,onOpenChange:n}){var l;const a=(l=e.standing)==null?void 0:l.rules,i=a?a.acceptedVersion>=a.version:!1;return t.jsx(Oe,{open:s,onOpenChange:n,children:t.jsxs($e,{className:"sm:max-w-lg",children:[t.jsxs(Ue,{children:[t.jsx(Ie,{children:"Space rules"}),t.jsx(Le,{children:i?"You accepted these rules.":"Accept these rules to post here."})]}),t.jsxs(Fe,{children:[t.jsx("div",{className:"max-h-[50vh] overflow-y-auto rounded-md border p-3 text-sm leading-relaxed whitespace-pre-wrap",children:(a==null?void 0:a.text)??"This space has no rules."}),e.accept.error&&t.jsx("p",{role:"alert",className:"text-destructive mt-2 text-sm",children:Rt(e.accept.error,"Couldn’t accept the rules. Try again.")})]}),t.jsxs(Ke,{children:[t.jsx(S,{variant:"outline",onClick:()=>n(!1),children:"Close"}),(a==null?void 0:a.text)&&!i&&t.jsx(S,{disabled:e.accept.isPending,onClick:()=>e.accept.mutate(a.version,{onSuccess:()=>n(!1)}),children:e.accept.isPending?"Accepting…":"Accept rules"})]})]})})}function Zs({community:e,accessFingerprint:s,currentName:n,open:a,onOpenChange:i}){return t.jsx(Oe,{open:a,onOpenChange:i,children:t.jsx($e,{className:"sm:max-w-md",children:a&&t.jsx(en,{community:e,accessFingerprint:s,currentName:n,onDone:()=>i(!1)})})})}function en({community:e,accessFingerprint:s,currentName:n,onDone:a}){const i=V(),l=le(),d=ue(!0,s,e),[c,r]=f.useState(n),o=we({meta:{suppressErrorToast:!0},mutationFn:u=>i.setRemoteCommunityDisplayName(e,u),onSuccess:async()=>{d&&await l.invalidateQueries({queryKey:z.content(d,e)}),a()}}),h=c.trim();return t.jsxs("form",{onSubmit:u=>{u.preventDefault(),h&&h!==n&&o.mutate(h)},children:[t.jsxs(Ue,{children:[t.jsx(Ie,{children:"Your name in this space"}),t.jsx(Le,{children:"Other spaces keep the name they show."})]}),t.jsxs(Fe,{className:"space-y-2",children:[t.jsx(ae,{htmlFor:"remote-community-display-name",children:"Name"}),t.jsx(Me,{id:"remote-community-display-name",value:c,maxLength:128,autoComplete:"nickname",onChange:u=>r(u.target.value)}),o.error&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:Rt(o.error,"Couldn’t change your name. Try again.")})]}),t.jsxs(Ke,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:a,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:!h||h===n||o.isPending,children:o.isPending?"Saving…":"Save name"})]})]})}const tn=[{value:"spam",label:"Spam"},{value:"harassment",label:"Harassment"},{value:"off_topic",label:"Off topic"},{value:"illegal",label:"Against the law"},{value:"other",label:"Something else"}];function sn({entry:e,onClose:s}){return t.jsx(Oe,{open:e!==null,onOpenChange:n=>!n&&s(),children:t.jsx($e,{className:"sm:max-w-md",children:e&&t.jsx(nn,{entry:e,onClose:s},e.id)})})}function nn({entry:e,onClose:s}){const n=V(),a=f.useId(),[i,l]=f.useState(null),[d,c]=f.useState(""),r=we({meta:{suppressErrorToast:!0},mutationFn:o=>n.reportRemoteCommunityEntry(e.community,e.roomId,e.id,o),onSuccess:()=>{mt("Message reported"),s()}});return t.jsxs("form",{onSubmit:o=>{o.preventDefault(),i&&r.mutate({reason:i,...d.trim()?{note:d.trim()}:{}})},children:[t.jsxs(Ue,{children:[t.jsx(Ie,{children:"Report message"}),t.jsx(Le,{children:"This space’s owners and admins review reports."})]}),t.jsxs(Fe,{className:"space-y-4",children:[t.jsxs("p",{className:"text-muted-foreground line-clamp-3 text-sm",children:[e.authorDisplayName,": ",e.text]}),t.jsx(Gt,{"aria-label":"Reason",value:i??"",onValueChange:o=>l(o),children:tn.map(o=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Vt,{value:o.value,id:`${a}-${o.value}`}),t.jsx(ae,{htmlFor:`${a}-${o.value}`,children:o.label})]},o.value))}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ae,{htmlFor:`${a}-note`,children:"Note (optional)"}),t.jsx(Xt,{id:`${a}-note`,value:d,maxLength:Zt,onChange:o=>c(o.target.value),rows:3}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Only owners and admins see this."})]}),r.error&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:r.error instanceof Error&&r.error.message?r.error.message:"Couldn’t send the report. Try again."})]}),t.jsxs(Ke,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:!i||r.isPending,children:r.isPending?"Sending…":"Send report"})]})]})}function an({agentDeliveries:e,drafts:s,entries:n,threadId:a,canSend:i,action:l,onRetryAgent:d,onRetryDraft:c}){return t.jsxs(t.Fragment,{children:[e.filter(r=>r.parentEntryId===(a??null)&&!n.some(o=>o.originIdempotencyKey===r.idempotencyKey)).map(r=>t.jsxs("div",{className:"border-t px-4 py-2 text-sm",role:"status",children:[t.jsxs("p",{className:"font-medium",children:[r.author.displayName," · Agent"]}),t.jsx("p",{className:"whitespace-pre-wrap",children:r.text}),r.attachments.map((o,h)=>t.jsx("span",{className:"mr-2",children:o.name},h)),t.jsx("p",{className:"text-muted-foreground",children:r.state==="pending"?"Waiting for the space to confirm…":r.failure==="expired"?"Not confirmed. Too late to try again.":"Not confirmed. Check the space and the agent’s channel access."}),r.state==="pending"&&r.retryable&&t.jsx(S,{variant:"outline",size:"sm",disabled:!i||l!==null,onClick:()=>d(r.idempotencyKey),children:l===`retry:${r.idempotencyKey}`?"Retrying…":"Retry now"})]},r.idempotencyKey)),s.filter(r=>r.parentEntryId===a&&!n.some(o=>o.originIdempotencyKey===r.key)).map(r=>t.jsxs("div",{className:"border-t px-4 py-2 text-sm",role:"status",children:[t.jsx("p",{className:"whitespace-pre-wrap",children:r.text}),r.files.map(o=>t.jsx("span",{className:"mr-2",children:o.file.name},o.id)),t.jsx("p",{className:"text-muted-foreground",children:r.status==="sending"?"Sending…":"Delivery not confirmed."}),r.error&&t.jsx("p",{children:r.error}),r.status==="failed"&&t.jsx(S,{variant:"outline",size:"sm",disabled:!i,onClick:()=>c(r.key),children:"Retry message"})]},r.key))]})}function rn(e,s){var l;const n=new Map;for(const d of e)d.thread&&n.set(d.id,{count:d.thread.replyCount,lastAt:d.thread.lastReplyAt,through:d.threadLastReplySeq});const a=new Map;for(const d of s){const c=d.threadRootEntryId;if(d.depth===0||c===null)continue;const r=(l=n.get(c))==null?void 0:l.through;if(r!==void 0&&d.remoteSeq<=r)continue;const o=a.get(c);a.set(c,{count:((o==null?void 0:o.count)??0)+1,newest:o&&o.newest.remoteSeq>d.remoteSeq?o.newest:d})}const i=new Map;for(const d of new Set([...n.keys(),...a.keys()])){const c=n.get(d),r=a.get(d),o=c===void 0?r.count:c.through===void 0?Math.max(c.count,(r==null?void 0:r.count)??0):c.count+((r==null?void 0:r.count)??0);i.set(d,{count:o,lastAt:(r==null?void 0:r.newest.createdAt)??c.lastAt,unread:0})}return i}const on={reactions:!1,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!1,turnStatus:!1,asks:!1};function ln({community:e,roomId:s,threadId:n,onThread:a,dmAgentName:i}){var qe,ze,Ye,He;const l=V(),c=(qe=ge().data)==null?void 0:qe.find(p=>p.ref===e),r=_e(c==null?void 0:c.access),o=ue(!0,r.fingerprint,e),{ownerAddress:h,contextAddress:u}=Es(o),y=le(),N=es(),v=ts(),w=(ze=N.data)==null?void 0:ze.destinations.find(p=>p.ref===e&&p.roomId===s),g=f.useRef(null),O=f.useRef(void 0),A=(w==null?void 0:w.scrollAnchorEntryId)??null,_=f.useCallback(p=>{if(!o||n)return;g.current&&clearTimeout(g.current),g.current=null;const D=p??null,K=O.current===void 0?A:O.current;D===null&&K===null||(g.current=setTimeout(()=>{g.current=null,O.current=D,v.mutate({ref:e,roomId:s,threadId:n??null,scrollAnchorEntryId:D})},400))},[o,e,v,A,s,n]);f.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),f.useEffect(()=>{(c==null?void 0:c.status)==="reconnect-required"&&o&&y.removeQueries({queryKey:z.remote(o,e)})},[o,e,c==null?void 0:c.status,y]);const Y=ft(e,s,r.capabilities.read,r.fingerprint),[M,q]=f.useState(0),L=f.useRef([]),C=f.useCallback(p=>L.current.some(D=>D.id===p),[]),U=As(e,s,r.capabilities.stream,M,r.fingerprint,r.cacheReadable,C),j=U.status==="removed",x=j?null:U.room??Y.data,I=ss(e,s,n,!j&&r.capabilities.read&&(x==null?void 0:x.readable)===!0,r.fingerprint),b=pt(e,s,!j&&r.capabilities.read&&(x==null?void 0:x.readable)===!0,r.fingerprint),[k,F]=f.useState(()=>({address:u,entries:[]})),H=f.useMemo(()=>k.address===u?k.entries:[],[u,k]);f.useEffect(()=>{L.current=H},[H]);const[Z,re]=f.useState(0),[ee,me]=f.useState(!1),[Se,m]=f.useState(null),[R,$]=f.useState(null),T=Is({community:e,roomId:s,enabled:!j&&r.capabilities.read&&(x==null?void 0:x.readable)===!0,accessFingerprint:r.fingerprint}),E=(c==null?void 0:c.connectedHumanMemberId)??null,P=(Ye=b.data)==null?void 0:Ye.members.find(p=>p.memberId===E),B=p=>{var D;return p===E||((D=b.data)==null?void 0:D.members.some(K=>K.memberId===p&&K.ownerMemberId===E))===!0},[J,te]=f.useState({address:"",name:null,error:null}),W=J.address===u?J.name:null,ye=J.address===u?J.error:null,ie=f.useRef(null),G=f.useRef(null),se=f.useRef(null),fe=!j&&r.capabilities.post&&U.status==="live"&&(x==null?void 0:x.writable)===!0,ke=fe&&T.hold===null,ce=f.useMemo(()=>{var p;return j?[]:Ee(Ce(e,s,...((p=I.data)==null?void 0:p.pages.map(D=>D.entries))??[],U.entries,H),U.revisions)},[e,s,I.data,U.entries,U.revisions,H,j]),kt=f.useCallback(p=>{F(D=>({address:u,entries:Ce(e,s,D.address===u?D.entries:[],[p]).slice(-500)})),re(D=>D+1)},[u,e,s]);f.useLayoutEffect(()=>{var p;Z>0&&((p=se.current)==null||p.scrollToBottom())},[Z]);const bt=f.useMemo(()=>{var p;return o?{ownerKey:o.ownerKey,epoch:o.epoch,ref:e,generation:((p=o.connection)==null?void 0:p.generation)??0,roomId:s,threadId:n}:null},[o,e,s,n]),Q=zs({ref:e,roomId:s,canSend:ke,entries:ce,onReceipt:kt,draft:bt,ownerKey:h||"unresolved",contextKey:u||"unresolved",onHold:T.noteHold}),At=ce.filter(p=>n?p.id===n||p.threadRootEntryId===n:p.depth===0),Dt=f.useMemo(()=>{var p;return n?new Map:rn(((p=I.data)==null?void 0:p.pages.flatMap(D=>D.entries))??[],ce)},[n,I.data,ce]),Pe=At.flatMap(p=>{const D=Dt.get(p.id);return D?[{kind:"message",entry:p},{kind:"replies",rootId:p.id,summary:D}]:[{kind:"message",entry:p}]}),Tt=Pe.map(p=>p.kind==="replies"?{kind:"thread-reply",id:`${p.rootId}:replies`,rootId:p.rootId,replyCount:p.summary.count,lastAt:p.summary.lastAt}:{kind:"message",id:p.entry.id,payload:p.entry,grouping:{position:"only"},author:{id:JSON.stringify([e,p.entry.authorId]),kind:p.entry.authorKind,displayName:p.entry.authorDisplayName},at:p.entry.createdAt}),be={kind:"room",id:JSON.stringify([e,s,n]),placeholder:n?"Reply in thread…":`Message ${i??(x==null?void 0:x.title)??"this channel"}…`,canSend:ke,canSendReason:j?"You no longer have access to this channel.":T.hold?$s(T.hold):!r.capabilities.post&&r.cacheReadable?"This space is read-only.":x!=null&&x.archived?"This channel is archived.":x!=null&&x.joined?"Reconnecting. You can send once the space is back.":"Join this channel to send messages.",attachments:Q.attachments,async send(){Q.send(n)}};async function ve(p,D){if(W||!o)return;const K=o,de=u;te({address:de,name:p,error:null});try{if(await D(),!X(K))return;(p==="join"||p==="leave"||p.startsWith("retry:"))&&q(ne=>ne+1),await y.invalidateQueries({queryKey:z.remote(K,e)})}catch(ne){X(K)&&te({address:de,name:p,error:ne instanceof Error?ne.message:"Couldn’t finish that. Try again."})}finally{X(K)&&te(ne=>ne.address===de?{...ne,name:null}:ne)}}function Et(){var K;const p=ce.at(-1);if(n||I.hasNextPage||!p||U.status!=="live"||((K=ie.current)==null?void 0:K.address)===u&&ie.current.cursor===p.cursor||!o)return;const D=o;ie.current={address:u,cursor:p.cursor},l.setRemoteCommunityReadCursor(e,s,p.cursor).then(()=>{X(D)&&y.invalidateQueries({queryKey:z.rooms(D,e)})}).catch(()=>{var de;((de=ie.current)==null?void 0:de.address)===u&&(ie.current=null)})}return t.jsxs(Ne.Root,{surface:"room",capabilities:on,target:be,children:[t.jsxs("section",{className:"flex h-full min-h-0 flex-col","aria-label":(x==null?void 0:x.title)??"Space channel",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b px-3 py-2",children:[n&&t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>a(),children:"Back to channel"}),!j&&r.capabilities.post&&x&&!x.joined&&!x.stale&&t.jsx(S,{size:"sm",disabled:W!==null,onClick:()=>void ve("join",()=>l.joinRemoteCommunityRoom(e,s)),children:"Join channel"}),r.cacheReadable&&t.jsx(S,{variant:"ghost",size:"sm",disabled:j,onClick:()=>me(!ee),children:ee?"Hide members":"Members"}),((He=T.standing)==null?void 0:He.rules.text)&&t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>m("rules"),children:"Rules"}),r.capabilities.post&&t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>m("name"),children:"Your name"}),r.capabilities.enrollAgent&&t.jsx(S,{variant:"outline",size:"sm",disabled:W!==null,onClick:()=>void ve("stop",()=>l.haltRemoteCommunityRoom(e,s)),children:W==="stop"?"Stopping…":"Stop my agents"}),r.capabilities.post&&(x==null?void 0:x.joined)&&!i&&t.jsx(S,{variant:"ghost",size:"sm",disabled:W!==null||!fe,onClick:()=>void ve("leave",async()=>{await l.leaveRemoteCommunityRoom(e,s),o&&y.removeQueries({queryKey:z.room(o,e,s)})}),children:"Leave channel"})]}),ye&&t.jsx("p",{role:"alert",className:"text-destructive px-4 py-2 text-sm",children:ye}),j?t.jsx("p",{role:"status",className:"p-6 text-sm",children:"You no longer have access to this channel."}):t.jsxs(t.Fragment,{children:[U.status!=="live"&&t.jsx("p",{role:"status",className:"text-muted-foreground px-4 py-2 text-sm",children:U.status==="connecting"?"Connecting to the space…":"Space unavailable. Showing saved messages."}),Y.isError&&t.jsx("p",{role:"alert",className:"px-4 py-2 text-sm",children:"Couldn’t load this channel."}),ee&&t.jsx(Gs,{roster:b.data,failed:b.isError,canMention:fe,onMention:p=>{var D;Q.setText(`${Q.text}${Q.text&&!Q.text.endsWith(" ")?" ":""}@${p} `),(D=G.current)==null||D.focus()},community:e,roomId:s,online:U.status==="live",canEnroll:r.capabilities.enrollAgent,agentsKey:u,accessFingerprint:r.fingerprint}),I.isError&&t.jsxs("p",{role:"alert",className:"p-3 text-sm",children:["Some messages could not be loaded."," ",t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void I.refetch(),children:"Retry"})]}),I.hasNextPage&&t.jsx(S,{variant:"ghost",size:"sm",disabled:I.isFetchingNextPage,onClick:()=>void I.fetchNextPage(),children:"Load the next page of history"}),t.jsx(Ne.Timeline,{ref:se,conversationId:be.id,rows:Tt,label:n?"Space thread":"Space messages",busy:I.isFetching,resumeRow:()=>n?void 0:A??void 0,onTopRow:_,onReachedBottom:Et,onOpenThread:a,empty:t.jsx("p",{className:"text-muted-foreground p-6 text-sm",children:I.isPending?"Loading messages…":"No messages here yet."}),renderRow:(p,D)=>{const K=Pe[D.index];return K.kind==="message"?t.jsx(wt,{entry:K.entry,onThread:a,onReport:r.capabilities.post&&b.data&&!B(K.entry.authorId)?()=>$(K.entry):void 0}):t.jsx(hs,{summary:K.summary,open:!1,onOpen:()=>a(K.rootId)})}}),t.jsx(an,{agentDeliveries:U.deliveries,drafts:Q.deliveries,entries:ce,threadId:n,canSend:ke,action:W,onRetryAgent:p=>void ve(`retry:${p}`,()=>l.retryRemoteCommunityDelivery(e,s,p)),onRetryDraft:Q.retry}),Q.error&&t.jsx("p",{role:"alert",className:"text-destructive px-4 py-2 text-sm",children:Q.error}),t.jsx(Ne.Composer,{inputRef:G,aboveInput:t.jsx(Vs,{conduct:T,staff:["owner","admin"].includes((P==null?void 0:P.role)??""),onReadRules:()=>m("rules")}),className:"m-3",value:Q.text,onChange:Q.setText,onSubmit:()=>Q.send(n),input:{isStreaming:!1,contextKey:be.id,canSubmit:Q.text.trim().length>0||Q.attachments.staged.length>0}})]})]}),t.jsx(Xs,{conduct:T,open:Se==="rules",onOpenChange:p=>m(p?"rules":null)}),t.jsx(Zs,{community:e,accessFingerprint:r.fingerprint,currentName:(P==null?void 0:P.displayName)??"",open:Se==="name",onOpenChange:p=>m(p?"name":null)}),t.jsx(sn,{entry:R,onClose:()=>$(null)})]})}function cn({community:e,roomId:s}){var h,u;const n=ge(),a=(h=n.data)==null?void 0:h.find(y=>y.ref===e),i=_e(a==null?void 0:a.access),l=ft(e,s??"",!!s&&i.capabilities.read,i.fingerprint),{dm:d}=ht(e,s??"",!!s&&i.capabilities.read,i.fingerprint),c=(a==null?void 0:a.label)??"Space",r=s?d?ns(d):(u=l.data)==null?void 0:u.title:void 0,o=a===void 0&&n.fetchStatus==="fetching"||s!==void 0&&r===void 0&&l.fetchStatus==="fetching";return t.jsx(xt,{pending:o,children:r?`${c} · ${r}`:c})}function St(e){var s,n,a,i;return!e||e.status==="reconnect-required"?null:((n=(s=e.access)==null?void 0:s.lastKnown)==null?void 0:n.lifecycle)==="deleted"?"deleted":((i=(a=e.access)==null?void 0:a.lastKnown)==null?void 0:i.lifecycle)==="taken_down"?"taken-down":e.seemsGoneSince?"seems-gone":null}function Ge(e,s,n){return`${e} ${e===1?s:n}`}function dn(e,s){const n=[e>0?Ge(e,"message from your agents","messages from your agents"):null,s>0?Ge(s,"draft of yours","drafts of yours"):null].filter(i=>i!==null);if(n.length===0)return null;const a=n.length===1&&(e===1||s===1);return`${n.join(" and ")} ${a?"wasn’t":"weren’t"} sent.`}function un({connection:e,onRemoved:s}){const n=St(e),a=as(),[i,l]=f.useState(!1),{ownerKey:d}=rs(),c=is(d,e.ref),{copied:r,failed:o,copy:h}=os(),u=e.label,y=e.seemsGoneSince?new Date(e.seemsGoneSince).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):null;function N(){a.mutate(e,{onSuccess:()=>{l(!1),mt.success(`${u} is removed from DorkOS.`),s()}})}const v=n==="deleted"||n==="taken-down",w=n==="taken-down"?"This space was taken down":n==="deleted"?"This space was deleted":"This space seems to be gone",g=n==="taken-down"?`DorkOS removed its copy here. If ${u} returns, you can connect again.`:n==="deleted"?"DorkOS removed its copy from this computer.":`Since ${y}, ${u} says it doesn’t exist. Its channels, messages and files are still here.`,O=dn(v?e.undeliveredAgentMessages??0:0,c.length),A=c.length===0?null:c.length===1?"Your unsent draft is cleared too.":`Your ${c.length} unsent drafts are cleared too.`;return t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-10 text-center text-sm","data-testid":"community-gone",children:[t.jsx(Cs,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:w}),t.jsx("p",{className:"text-muted-foreground max-w-sm",children:g}),O&&t.jsx("p",{role:"status",className:"text-foreground max-w-sm","data-testid":"community-gone-unsent",children:O}),t.jsx("span",{className:"sr-only","aria-live":"polite","data-testid":"community-gone-copy-status",children:r?"Copied.":o?"Couldn’t copy to the clipboard.":""}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[c.length>0&&t.jsx(S,{variant:"outline",onClick:()=>void h(c.join(`
9
-
10
- `)),children:r?"Copied":o?"Couldn’t copy":c.length===1?"Copy your draft":"Copy your drafts"}),t.jsx(S,{variant:v?"outline":"destructive",onClick:()=>l(!0),children:v?"Remove from DorkOS":"Remove local copy"})]}),t.jsx(rt,{open:i,onOpenChange:_=>{_||a.reset(),l(_)},children:t.jsxs(it,{children:[t.jsxs(ot,{children:[t.jsx(lt,{children:v?`Remove ${u} from DorkOS?`:`Remove your copy of ${u}?`}),t.jsx(ct,{asChild:!0,children:t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{children:v?`${u} leaves this app. Nothing else is stored here.`:"This deletes its channels, messages and files from this computer."}),!v&&t.jsx("p",{children:"Your agents stop answering there. If it’s still around, you can connect again."}),A&&t.jsx("p",{children:A})]})})]}),a.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-sm",children:"Couldn’t remove it. Check that DorkOS is running, then try again."}),t.jsxs(dt,{children:[t.jsx(ut,{disabled:a.isPending,children:"Cancel"}),t.jsx(S,{variant:"destructive",disabled:a.isPending,onClick:N,children:a.isPending?"Removing…":v?"Remove from DorkOS":"Remove local copy"})]})]})})]})}function mn({connection:e,dateFormat:s}){var l,d;const n=vs(e);if(!n)return null;const[a,...i]=js(n,(d=(l=e.access)==null?void 0:l.lastKnown)==null?void 0:d.lifecycle,s);return t.jsxs("section",{"aria-label":"Request to take over this space",className:"border-status-warning-border bg-status-warning-bg text-status-warning-fg flex flex-wrap items-start gap-x-3 gap-y-2 border-b px-4 py-3 text-sm",children:[t.jsx(ls,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),t.jsxs("div",{className:"min-w-0 flex-1 basis-60 space-y-1",children:[t.jsx("p",{className:"text-foreground font-medium",children:a}),i.map(c=>t.jsx("p",{children:c},c))]}),t.jsxs(S,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>ds(Ns(e)),children:["Open space",t.jsx(cs,{className:"size-3.5","aria-hidden":!0})]})]})}const fn={reactions:!1,threads:!1,runWith:!1,attachments:!1,mentions:!1,streamHealth:!1,presence:!1,turnStatus:!1,asks:!1};function pn({dm:e,localAgentId:s,access:n}){var r,o,h,u;const a=us(e.community,e.roomId,s,n),i=f.useRef(null),l=f.useRef(!0),d=(o=(r=a.data)==null?void 0:r.entries.at(-1))==null?void 0:o.id;f.useLayoutEffect(()=>{const y=i.current;y&&l.current&&(y.scrollTop=y.scrollHeight)},[d]);const c={kind:"room",id:JSON.stringify([e.community,e.roomId,"read-only"]),placeholder:"",canSend:!1,canSendReason:"This direct message is read-only.",attachments:null,send:()=>Promise.reject(new Error("This direct message is read-only."))};return t.jsx(Ne.Root,{surface:"room",capabilities:fn,target:c,children:t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsxs("section",{className:"border-b px-4 py-2 text-sm","aria-label":"About this direct message",children:[t.jsxs("p",{children:[t.jsx("span",{className:"font-medium",children:`${e.member.displayName} with ${e.agent.displayName}`}),t.jsx("span",{className:"text-muted-foreground",children:" · Read-only"})]}),t.jsx("p",{className:"text-muted-foreground text-xs",children:`Only ${e.member.displayName} and ${e.agent.displayName} can post here.`})]}),t.jsxs("section",{ref:i,onScroll:y=>{const N=y.currentTarget;l.current=N.scrollHeight-N.scrollTop-N.clientHeight<40},className:"min-h-0 flex-1 overflow-auto py-2","aria-label":"Messages",children:[a.isError&&t.jsxs("p",{role:"alert",className:"px-4 text-sm",children:["Couldn’t load this direct message."," ",t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>void a.refetch(),children:"Retry"})]}),((h=a.data)==null?void 0:h.entries.length)===0&&t.jsx("p",{className:"text-muted-foreground px-4 text-sm",children:"No messages yet."}),(u=a.data)==null?void 0:u.entries.map(y=>t.jsx(wt,{entry:y},y.id))]})]})})}function hn({community:e,roomId:s,children:n}){var d;const a=(d=ge().data)==null?void 0:d.find(c=>c.ref===e),i=_e(a==null?void 0:a.access),{dm:l}=ht(e,s,i.verified&&i.capabilities.read,i.fingerprint);return l?l.readOnly&&l.localAgentId?t.jsx(pn,{dm:l,localAgentId:l.localAgentId,access:i.fingerprint}):t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsx(xn,{dm:l,accessFingerprint:i.fingerprint}),t.jsx("div",{className:"min-h-0 flex-1",children:n(l.agent.displayName)})]}):n()}function xn({dm:e,accessFingerprint:s}){var l;const a=(l=pt(e.community,e.roomId,!0,s).data)==null?void 0:l.members.find(d=>d.memberId===e.agent.memberId),i=e.agent.ownerDisplayName;return t.jsxs("section",{className:"border-b px-4 py-2 text-sm","aria-label":"About this direct message",children:[t.jsxs("p",{children:[t.jsx("span",{className:"font-medium",children:e.agent.displayName}),t.jsx("span",{className:"text-muted-foreground",children:` · ${i}’s agent · ${i} can read this`})]}),(a==null?void 0:a.availability)==="offline"&&t.jsx("p",{role:"status",className:"text-muted-foreground text-xs",children:`Offline. ${e.agent.displayName} won’t answer until its computer is back on.`})]})}function gn(){const{id:e,community:s}=gt({from:"/_shell/channels"}),n=ms(s);return s&&!n.visible?n.isLoading?null:t.jsx(fs,{...xe.channels(),search:{},replace:!0}):t.jsxs(t.Fragment,{children:[s?t.jsx(cn,{community:s,roomId:e}):e===void 0&&t.jsx(xt,{children:"Channels"}),t.jsx(yn,{})]})}function yn(){const{id:e,thread:s,entry:n,community:a}=gt({from:"/_shell/channels"}),i=Re(),l=Ts(a?void 0:e,s,n),d=Ds(a?void 0:e),c=ps();return a&&e?t.jsx(Ve,{community:a,children:t.jsx(hn,{community:a,roomId:e,children:r=>t.jsx(ln,{community:a,roomId:e,threadId:s,dmAgentName:r,onThread:o=>{i({...xe.channels(),search:{community:a,id:e,thread:o}})}})},JSON.stringify([a,e]))}):a?t.jsx(Ve,{community:a,children:t.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[t.jsx(Qe,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:"No channel selected"}),t.jsx("p",{className:"max-w-sm",children:"Choose a channel from this space."})]})}):l==="pending"||d==="pending"?t.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:t.jsx(xs,{})}):l==="redirecting"||d==="redirecting"?null:e===void 0?t.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[t.jsx(Qe,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:"Pick a channel or DM"}),t.jsx("p",{className:"max-w-sm",children:c?"Open one from All, at the bottom of the screen.":"Open one from the sidebar, or use + next to Channels."})]}):t.jsx(gs,{roomId:e,threadId:s,entrySeq:n,threadRoute:"/channels"})}function Ve({community:e,children:s}){var i;const n=Re(),a=(i=ge().data)==null?void 0:i.find(l=>l.ref===e);return a&&St(a)?t.jsx(un,{connection:a,onRemoved:()=>void n({...xe.channels(),search:{}})}):t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a&&t.jsx(mn,{connection:a}),a&&t.jsx(Rs,{connection:a}),t.jsx("div",{className:"min-h-0 flex-1",children:s})]})}const da=gn;export{da as component};
@@ -1 +0,0 @@
1
- import{j as t}from"./index-BDJuvXMG.js";import{M as o}from"./Marketplace-nlAKYRdC.js";import{P as r}from"./page-container-CGXX9atD.js";import"./PreviewRefusedNotice-B6hvUBqt.js";import"./shield-x-DxL97yUb.js";import"./card-CHG8Y8EA.js";import"./empty-state-BO-UXPQj.js";import"./markdown-content-NzXgwE2G.js";import"./use-unclaimed-chats-BrLVSVmS.js";import"./use-bindings-BAKvriCK.js";import"./UnlinkDialog-CHiFjqy9.js";import"./use-dev-links-D5AXy-P_.js";import"./more-details-XSn-_PbH.js";import"./file-DQJ4ncBH.js";import"./AgentPicker-D4o66W3h.js";import"./command-BiVO_CS1.js";import"./AgentOptionRow-BcNFNeXa.js";import"./useMutationState-BwG8hXiA.js";import"./file-exclamation-point-3K4for51.js";import"./rotate-ccw-clock-Cvx7qMiL.js";import"./path-input-mDIpl2-x.js";function i(){return t.jsx(r,{width:"wide",children:t.jsx(o,{})})}const R=i;export{R as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BDJuvXMG.js";import{P as r}from"./page-container-CGXX9atD.js";import{M as e}from"./MarketplaceSourcesView-Co53MiW9.js";import"./use-pending-read-BBA4gaxj.js";function t(){return o.jsx(r,{width:"reading",children:o.jsx(e,{})})}const s=t;export{s as component};
@@ -1 +0,0 @@
1
- import{S as o}from"./WorkView-CDLKDo74.js";import"./index-BDJuvXMG.js";import"./WidgetErrorCard-D9LKAbNg.js";import"./index-CGvU4pGg.js";import"./PromptSuggestionChips-BItU6w6K.js";import"./primer-trigger-BiiSNY7s.js";import"./use-is-below-desktop-OolRlRyZ.js";import"./use-notification-prefs-DAokZCgt.js";import"./card-CHG8Y8EA.js";import"./use-status-budget-D-MyG_Pd.js";import"./git-branch-B5MdRp1u.js";import"./use-update-config-Cjq60G6n.js";import"./settings-for-runtime-BoOa-ZFG.js";import"./RuntimeSetupDialog-Cof6tku2.js";import"./inline-code-hmEz0OM4.js";import"./list-runtime-types-CaJn2_14.js";import"./RuntimeConnectFlow-CXAcX8bE.js";import"./useMutationState-BwG8hXiA.js";import"./runtime-connect-Dn0T5YWv.js";import"./unverified-catalog-notice-v-qMrtTV.js";import"./layers-DHQ_aTAp.js";import"./cpu-DDZTaXtb.js";import"./banner-Bb9qmJFV.js";import"./UnreadDivider-CNjRFpAY.js";import"./composer-insert-BpyATrmR.js";import"./use-composer-prefs-BLOdXw95.js";import"./McpAppFrame-L2zafUSH.js";import"./more-details-XSn-_PbH.js";import"./find-latest-widget-fence-C2e-pGhG.js";import"./file-DQJ4ncBH.js";import"./use-session-canvas-pL8waI_Q.js";import"./rotate-cw-BS2tU5V-.js";import"./query-keys-DeYqUDia.js";import"./index.esm-Cl_dMJjM.js";import"./file-text-3tteNtIM.js";import"./markdown-content-NzXgwE2G.js";import"./shield-x-DxL97yUb.js";import"./McpSigninBody-DRxPP8Zc.js";import"./image-off-SpOmtTU2.js";import"./format-duration-BCr6uzby.js";import"./use-connector-management-CApx-e1Z.js";import"./AgentRequestCard-C6aBR2TD.js";import"./access-copy-robDo1S-.js";import"./query-error-state-C2EyJ_cl.js";import"./empty-state-BO-UXPQj.js";import"./use-bindings-BAKvriCK.js";import"./connection-copy--MA7AN04.js";import"./KeyEntry-B1M6Cb_W.js";import"./index-BHnCpgC9.js";import"./progress-BF25Vgvc.js";import"./table-C5zpnw52.js";import"./package-DAjaMh-O.js";import"./heart-WdIkTWht.js";import"./file-drag-GDx2qhdk.js";import"./paperclip-C6yKmauj.js";import"./index-DZ9FOOp-.js";const mo=o;export{mo as component};
@@ -1 +0,0 @@
1
- import{E as o}from"./ExtensionPageRoute-D4d8hWqD.js";import"./index-BDJuvXMG.js";import"./empty-state-BO-UXPQj.js";import"./page-container-CGXX9atD.js";import"./use-dev-links-D5AXy-P_.js";import"./UnlinkDialog-CHiFjqy9.js";const e=o;export{e as component};
@@ -1 +0,0 @@
1
- import{E as o}from"./ExtensionPageRoute-D4d8hWqD.js";import"./index-BDJuvXMG.js";import"./empty-state-BO-UXPQj.js";import"./page-container-CGXX9atD.js";import"./use-dev-links-D5AXy-P_.js";import"./UnlinkDialog-CHiFjqy9.js";const e=o;export{e as component};
@@ -1 +0,0 @@
1
- import{U as a,C as n}from"./mermaid.core-DP7EozpQ.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
@@ -1 +0,0 @@
1
- import{A as p,T as a}from"./TeamComputerEntry-BxNRBuRo.js";import{C,a as n}from"./ComputerResourceView-nLfGu6HH.js";import"./index-BDJuvXMG.js";import"./ComputerViewer-Cmw-5KwO.js";import"./use-is-below-desktop-OolRlRyZ.js";export{p as AgentComputerPanel,C as ComputerPanelView,n as ComputerPipView,a as TeamComputerEntry};