dorkos 0.129.0 → 0.130.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/dist/bin/cli.js +694 -513
  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-CML_SdU1.js → AboutPage-B2CzVj5W.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-TuQRJopr.js → ActivityErrorState-Dl-P-e0R.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-CmSxeVSK.js → ActivityPage-CW7tqLHb.js} +1 -1
  7. package/dist/client/assets/{ActivityRow-DJhDehIR.js → ActivityRow-Vy4aXWk-.js} +1 -1
  8. package/dist/client/assets/{AdapterIcon-CeRDpZGz.js → AdapterIcon-aabKVZmM.js} +1 -1
  9. package/dist/client/assets/{AdapterSetupWizard-B6KkTuJo.js → AdapterSetupWizard-C5Hs0xkG.js} +2 -2
  10. package/dist/client/assets/{AgentOptionRow-388OJkPc.js → AgentOptionRow-CqIMxq9S.js} +1 -1
  11. package/dist/client/assets/{AgentPicker-C51wqToQ.js → AgentPicker-C6mbTDJJ.js} +1 -1
  12. package/dist/client/assets/{AgentRequestCard-Bz31ewIs.js → AgentRequestCard-C8GV5Sxn.js} +3 -3
  13. package/dist/client/assets/{AppearancePage-DSVeowGb.js → AppearancePage-C0JKrHsO.js} +1 -1
  14. package/dist/client/assets/{ApplyToOverridesDialog-DRtcLrVY.js → ApplyToOverridesDialog-DWEi0MNt.js} +1 -1
  15. package/dist/client/assets/{AttentionSignalRow-CqKZyoxB.js → AttentionSignalRow-Cpu0lKYg.js} +1 -1
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-DA1jhqFy.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-_zVrHu5s.js} +1 -1
  17. package/dist/client/assets/{BindingDialog-D25PAed0.js → BindingDialog-4UeaJfUu.js} +1 -1
  18. package/dist/client/assets/BlintzCanvas-DCXIQZM_.js +1231 -0
  19. package/dist/client/assets/{CanvasCsvContent-ZWHWmb88.js → CanvasCsvContent-D-0TuvVs.js} +1 -1
  20. package/dist/client/assets/{CanvasFileContent-DR5pUgca.js → CanvasFileContent-DqSx7lz9.js} +2 -2
  21. package/dist/client/assets/{CanvasModel3dContent-OP1ZOMui.js → CanvasModel3dContent-zTx660yQ.js} +2 -2
  22. package/dist/client/assets/ChannelComposer-D4TYVkvO.js +45 -0
  23. package/dist/client/assets/{ChatAppsOff-ByitL4Xt.js → ChatAppsOff-BzfyQc55.js} +1 -1
  24. package/dist/client/assets/{CodeMirrorDiff-JsV_vWBa.js → CodeMirrorDiff-BLWBYGLp.js} +1 -1
  25. package/dist/client/assets/{CodeMirrorEditor-BfCJG9hQ.js → CodeMirrorEditor-D0q3ETxK.js} +1 -1
  26. package/dist/client/assets/{CommitmentList-yFV3_m00.js → CommitmentList-BoMiLsRe.js} +1 -1
  27. package/dist/client/assets/{CommitmentsPage-DeERVg-2.js → CommitmentsPage-_7mNJVUZ.js} +1 -1
  28. package/dist/client/assets/{ComputerResourceView-CYMMSE8Y.js → ComputerResourceView-Bo2LaCJf.js} +1 -1
  29. package/dist/client/assets/{ComputerViewer-H7kJSIj7.js → ComputerViewer-a4VSdAw_.js} +1 -1
  30. package/dist/client/assets/{ConnectionAccessLists-SRkf7-Y6.js → ConnectionAccessLists-Dvv0YO31.js} +1 -1
  31. package/dist/client/assets/{ConnectionsPage-D6e3hd4L.js → ConnectionsPage-oO8pNgbc.js} +2 -2
  32. package/dist/client/assets/{ConventionPage-CpvRMcSG.js → ConventionPage-CFJjwhBd.js} +2 -2
  33. package/dist/client/assets/{ExtensionPageRoute-CiFv6we8.js → ExtensionPageRoute-BqZN9q7M.js} +2 -2
  34. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-D-8CeYC7.js → FloatingTanStackRouterDevtools-CqogiFob-CnSp2ZEM.js} +1 -1
  35. package/dist/client/assets/{ForwardConsentHost-ml3b_fsX.js → ForwardConsentHost-4LhRvCdu.js} +1 -1
  36. package/dist/client/assets/HandlePage-BjoYPqme.js +1 -0
  37. package/dist/client/assets/{HeartbeatPage-C0zSvWH4.js → HeartbeatPage-rJzICayy.js} +1 -1
  38. package/dist/client/assets/{KeyEntry-Dq6eKAbX.js → KeyEntry-BTTuXleL.js} +1 -1
  39. package/dist/client/assets/{LexicalField-CYOqOLpV.js → LexicalField-Dk_SDrjk.js} +1 -1
  40. package/dist/client/assets/{ManagesPage-DZTMD3Al.js → ManagesPage-Cvu3CQDn.js} +1 -1
  41. package/dist/client/assets/{Marketplace-buSfuVrY.js → Marketplace-DPjPPlZz.js} +2 -2
  42. package/dist/client/assets/{MarketplaceSourcesView-BxwvBWgh.js → MarketplaceSourcesView-ChCys0on.js} +1 -1
  43. package/dist/client/assets/{McpAppFrame-CWiRFp8o.js → McpAppFrame-DNamtzOp.js} +2 -2
  44. package/dist/client/assets/{McpSigninBody-BpYSAV1h.js → McpSigninBody-DLw3ZdZE.js} +1 -1
  45. package/dist/client/assets/{Model3dViewer-B2KTvx6d.js → Model3dViewer-IwCBCPZ2.js} +1 -1
  46. package/dist/client/assets/NamePage-FY_D0eA2.js +1 -0
  47. package/dist/client/assets/NewDirectMessageMenu-BB0gvClR.js +1 -0
  48. package/dist/client/assets/{NotificationsPage-CWXIghVM.js → NotificationsPage-aCF0AtqL.js} +1 -1
  49. package/dist/client/assets/{OpenMeshSwitch-C9hiAEHP.js → OpenMeshSwitch-DjCWF2Vy.js} +2 -2
  50. package/dist/client/assets/{OperatorIdentityForm-CjmMoP6n.js → OperatorIdentityForm-Bcveds6f.js} +1 -1
  51. package/dist/client/assets/{PermissionHistory-D_Imuq02.js → PermissionHistory-CYsxFYmV.js} +1 -1
  52. package/dist/client/assets/{PermissionsPage-QMLV8PfB.js → PermissionsPage-sxHkY92V.js} +1 -1
  53. package/dist/client/assets/{PersonalityPopover-BL9DLK0Q.js → PersonalityPopover-BZ20JTnJ.js} +1 -1
  54. package/dist/client/assets/PhotoPage-KBzkb0sT.js +1 -0
  55. package/dist/client/assets/{PreviewRefusedNotice-Dt2hV0aJ.js → PreviewRefusedNotice-BFQPYcUG.js} +1 -1
  56. package/dist/client/assets/{ProfileFields-DD6X85w2.js → ProfileFields-sp17IFo8.js} +1 -1
  57. package/dist/client/assets/{ProfilePanelContainer-DuFEpNJ3.js → ProfilePanelContainer-mA44jh5A.js} +1 -1
  58. package/dist/client/assets/{ProfileRolePicker-CT9eJ1J0.js → ProfileRolePicker-Chh4_ZMB.js} +1 -1
  59. package/dist/client/assets/{PromptSuggestionChips-C8V611-5.js → PromptSuggestionChips-CEi_-fHF.js} +1 -1
  60. package/dist/client/assets/{ReportsToPopover-Bs55bP7b.js → ReportsToPopover-D1uknwnk.js} +1 -1
  61. package/dist/client/assets/RoomSurface-Clf1yLrr.js +1 -0
  62. package/dist/client/assets/{RoomsPage-CDiSwt-I.js → RoomsPage-BtCNzvhQ.js} +1 -1
  63. package/dist/client/assets/{RunsOnPopover-CFBDa9DO.js → RunsOnPopover-LCvBpe9J.js} +1 -1
  64. package/dist/client/assets/{RuntimeConnectFlow-DsawxJN7.js → RuntimeConnectFlow-C5UDeHUC.js} +1 -1
  65. package/dist/client/assets/{RuntimeSetupDialog-bdf844gx.js → RuntimeSetupDialog-Bqh67Vqb.js} +1 -1
  66. package/dist/client/assets/{SeenDevices-Cix5nnGQ.js → SeenDevices-DvCfdeDo.js} +3 -3
  67. package/dist/client/assets/{SessionsPage-CCu8rM-J.js → SessionsPage-DLByE-re.js} +1 -1
  68. package/dist/client/assets/{SettingsDialog-D7sVluoe.js → SettingsDialog-Co-Oxtyw.js} +3 -3
  69. package/dist/client/assets/{SkillsPage-SSq7ofgp.js → SkillsPage-Cc79IstM.js} +1 -1
  70. package/dist/client/assets/{TaskDialogWrapper-CBIuIbmj.js → TaskDialogWrapper-DuYV7Zch.js} +1 -1
  71. package/dist/client/assets/{TasksEmptyState-C0K_NOA3.js → TasksEmptyState-CfmPtBra.js} +2 -2
  72. package/dist/client/assets/{TasksPage-BpSn7GmR.js → TasksPage-DGk0zUhO.js} +1 -1
  73. package/dist/client/assets/{TeamComputerEntry-BAi9omUC.js → TeamComputerEntry-CLHbeX5i.js} +1 -1
  74. package/dist/client/assets/{ToolsPage-nkGWy6MR.js → ToolsPage-CSkDE7rZ.js} +2 -2
  75. package/dist/client/assets/{TopologyGraph-D6SSv0kC.js → TopologyGraph-pBC37k5P.js} +1 -1
  76. package/dist/client/assets/{TourHost-CrZciWIf.js → TourHost-CS9RsLj_.js} +1 -1
  77. package/dist/client/assets/{UnlinkDialog-B9zw8r6F.js → UnlinkDialog-CelhOUZ0.js} +1 -1
  78. package/dist/client/assets/{UnreadDivider-BnJ06LmP.js → UnreadDivider-B_OMR0mQ.js} +1 -1
  79. package/dist/client/assets/{WidgetErrorCard-CQKYI7oK.js → WidgetErrorCard-CsMqCyCb.js} +9 -9
  80. package/dist/client/assets/{WithheldExtensionsNotice-VMM5NjL5.js → WithheldExtensionsNotice-GiKb0iQu.js} +1 -1
  81. package/dist/client/assets/WorkQueuePage-Cu721KyM.js +1 -0
  82. package/dist/client/assets/{WorkView-D5d8DDxS.js → WorkView-CpWEaxMr.js} +1 -1
  83. package/dist/client/assets/_shell-CmGG8Ysk.js +80 -0
  84. package/dist/client/assets/{_shell._home-CcfELPIk.js → _shell._home-BnKkAeSp.js} +1 -1
  85. package/dist/client/assets/{_shell._home.activity-CGKsuLq8.js → _shell._home.activity-DaaLJbvO.js} +1 -1
  86. package/dist/client/assets/{_shell._home.index-DrJRgJCb.js → _shell._home.index-CNPasFxP.js} +2 -2
  87. package/dist/client/assets/_shell._home.tasks-DXEOJ5Nq.js +1 -0
  88. package/dist/client/assets/{_shell._home.workspaces-CjBJymCW.js → _shell._home.workspaces-UeSvmquR.js} +1 -1
  89. package/dist/client/assets/{_shell.channels-CzQFR6pU.js → _shell.channels-NUbf5mcb.js} +1 -1
  90. package/dist/client/assets/{_shell.connections-B5hafeep.js → _shell.connections-BEns4DKb.js} +1 -1
  91. package/dist/client/assets/{_shell.feedback-requests-DtD2bH-4.js → _shell.feedback-requests-NyjHNdnj.js} +2 -2
  92. package/dist/client/assets/_shell.marketplace-BEYqsDKe.js +1 -0
  93. package/dist/client/assets/_shell.marketplace_.sources-D6Ls30FY.js +1 -0
  94. package/dist/client/assets/_shell.session-CVc6i3eN.js +1 -0
  95. package/dist/client/assets/{_shell.team-BrGo-IxK.js → _shell.team-CXeOt4XD.js} +4 -4
  96. package/dist/client/assets/{_shell.threads-Ceq_tmNk.js → _shell.threads-BYdN1UtZ.js} +1 -1
  97. package/dist/client/assets/_shell.x._extensionId-DtJYSfvG.js +1 -0
  98. package/dist/client/assets/_shell.x._extensionId_._-DtJYSfvG.js +1 -0
  99. package/dist/client/assets/{abnfDiagram-WEYOIA3C-BN5bqwbu.js → abnfDiagram-WEYOIA3C-BLCVDt6M.js} +1 -1
  100. package/dist/client/assets/{access-copy-BAhTOOsG.js → access-copy-BSQ3QECN.js} +1 -1
  101. package/dist/client/assets/{arc-BfTE_VoF.js → arc-t4OhsI5R.js} +1 -1
  102. package/dist/client/assets/{architectureDiagram-ZHVYKT53-Dc6keeDz.js → architectureDiagram-ZHVYKT53-BcIfbGZR.js} +1 -1
  103. package/dist/client/assets/{banner-DOgGDCJ5.js → banner-B6xfuDA7.js} +1 -1
  104. package/dist/client/assets/{blockDiagram-RJAE7QA3-B4c6U-ob.js → blockDiagram-RJAE7QA3-DTOlrcEZ.js} +1 -1
  105. package/dist/client/assets/{c4Diagram-XDPPPE54-CCtD8QC8.js → c4Diagram-XDPPPE54-CHGqwaxa.js} +1 -1
  106. package/dist/client/assets/channel-CSk6LhO2.js +1 -0
  107. package/dist/client/assets/{chunk-2E7WHVMD-DcDNqIJG.js → chunk-2E7WHVMD-Bh4L_7yX.js} +1 -1
  108. package/dist/client/assets/{chunk-2Q5K7J3B-DOVVK0B8.js → chunk-2Q5K7J3B-BmouLl8r.js} +1 -1
  109. package/dist/client/assets/{chunk-4EMNKR2T-Cg-Do982.js → chunk-4EMNKR2T-BVhtiAdG.js} +1 -1
  110. package/dist/client/assets/{chunk-55XCU76K-CDmULSeY.js → chunk-55XCU76K-BdbLnE56.js} +1 -1
  111. package/dist/client/assets/{chunk-5VM5RSS4-Bi0yIWW1.js → chunk-5VM5RSS4-Qg9lQpPO.js} +1 -1
  112. package/dist/client/assets/{chunk-JWPE2WC7-ZHaJh6CV.js → chunk-JWPE2WC7-CfIrQaMW.js} +1 -1
  113. package/dist/client/assets/{chunk-VQ5W62QI-DZi6GyW_.js → chunk-VQ5W62QI-BP9oQzc0.js} +1 -1
  114. package/dist/client/assets/{chunk-XXDRQBXY-D18oZOrd.js → chunk-XXDRQBXY-DKzIjnsB.js} +1 -1
  115. package/dist/client/assets/{chunk-ZCHMQSOR-BkZ0l0fE.js → chunk-ZCHMQSOR-DsvG6BGY.js} +2 -2
  116. package/dist/client/assets/{classDiagram-v2-4MYWR3UA-BfmK1buF.js → classDiagram-v2-4MYWR3UA-BSiSmGgP.js} +1 -1
  117. package/dist/client/assets/{command-CZqA020F.js → command-B_FPXirc.js} +1 -1
  118. package/dist/client/assets/{copy-button-ByA00JGh.js → copy-button-Bp75zBSh.js} +1 -1
  119. package/dist/client/assets/{cose-bilkent-JH36ORCC-B1NTVSbk.js → cose-bilkent-JH36ORCC-CXgyrZix.js} +1 -1
  120. package/dist/client/assets/{cpu-DNvpMmNN.js → cpu-DpkNIYeK.js} +1 -1
  121. package/dist/client/assets/{cynefin-EF2NZ3EQ-CB_HMIZ8.js → cynefin-EF2NZ3EQ-DkmPO3hK.js} +1 -1
  122. package/dist/client/assets/{cynefinDiagram-WF24UDRP-MmIWYdc2.js → cynefinDiagram-WF24UDRP-BDknJT17.js} +1 -1
  123. package/dist/client/assets/{dagre-NK4GIZVX-BQay0k4e.js → dagre-NK4GIZVX-BR4J5E3b.js} +1 -1
  124. package/dist/client/assets/{detail-row-290qyusq.js → detail-row-C8zz6mAC.js} +1 -1
  125. package/dist/client/assets/{diagram-CBK3MWTC-C1lRH4cb.js → diagram-CBK3MWTC-CvLKqPry.js} +1 -1
  126. package/dist/client/assets/{diagram-I5XIIV2D-CnANa27A.js → diagram-I5XIIV2D-CVtE60X9.js} +1 -1
  127. package/dist/client/assets/{diagram-ODIL2UCW-Cwt7hxes.js → diagram-ODIL2UCW-B--CpfLk.js} +1 -1
  128. package/dist/client/assets/{diagram-PFBEJUXE-DZtAER77.js → diagram-PFBEJUXE-08gch1t1.js} +1 -1
  129. package/dist/client/assets/{diagram-RJA3I4VV-CbVXbiGs.js → diagram-RJA3I4VV-C2e-ubaD.js} +1 -1
  130. package/dist/client/assets/{diagram-TYUNFSNR-D-AcGdsL.js → diagram-TYUNFSNR-DcpK4OXX.js} +1 -1
  131. package/dist/client/assets/{ebnfDiagram-V4P3TTPT-DLkrFSAy.js → ebnfDiagram-V4P3TTPT-DM44BkBt.js} +1 -1
  132. package/dist/client/assets/{elk-QONTBCTQ-DQM6Glxa.js → elk-QONTBCTQ-maYS1Zzm.js} +1 -1
  133. package/dist/client/assets/{empty-state-BnuM8oop.js → empty-state-HtOTBAoq.js} +1 -1
  134. package/dist/client/assets/{erDiagram-KYQIGQAA-C1qgB1Mn.js → erDiagram-KYQIGQAA-BR7z9r2M.js} +1 -1
  135. package/dist/client/assets/{execution-config-BjLHHc9x.js → execution-config-DYYeJyJh.js} +1 -1
  136. package/dist/client/assets/{file-D7_QdH_S.js → file-VtGYNr9E.js} +1 -1
  137. package/dist/client/assets/{file-exclamation-point-Cdt8YqyQ.js → file-exclamation-point-eBlQssyW.js} +1 -1
  138. package/dist/client/assets/{file-text-CB9l6Ur-.js → file-text-DvNAxTGZ.js} +1 -1
  139. package/dist/client/assets/{find-latest-widget-fence-SQB9WgjN.js → find-latest-widget-fence-C2qXvASs.js} +3 -3
  140. package/dist/client/assets/{flowDiagram-IUGLLWBU-DH-ePeFu.js → flowDiagram-IUGLLWBU-DiuMtMbj.js} +1 -1
  141. package/dist/client/assets/{form--HjBAzX8.js → form-CGIIzr1u.js} +1 -1
  142. package/dist/client/assets/{format-cron-svkfKW5b.js → format-cron-BzJ6ekoo.js} +1 -1
  143. package/dist/client/assets/{ganttDiagram-R7GPNTJY-fjb_iAW1.js → ganttDiagram-R7GPNTJY-Cf_z8Ri1.js} +1 -1
  144. package/dist/client/assets/{git-branch-CPOwiT8a.js → git-branch-BVzjBPW-.js} +1 -1
  145. package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-CcCqH5T3.js → gitGraphDiagram-PDYL7XHY-RZXACCBr.js} +1 -1
  146. package/dist/client/assets/{graph-DS3J2jnN.js → graph-DfAV_ObD.js} +1 -1
  147. package/dist/client/assets/{heart-C6uRnXx3.js → heart-BMOCYMFT.js} +1 -1
  148. package/dist/client/assets/{highlighted-body-KPVGNVTW-CNygKq0i.js → highlighted-body-KPVGNVTW-DrrsaKBc.js} +1 -1
  149. package/dist/client/assets/{image-lightbox-BQV3i0WJ.js → image-lightbox-tAwBNBhm.js} +1 -1
  150. package/dist/client/assets/{image-off-B88WBkcV.js → image-off-BpagBHk1.js} +1 -1
  151. package/dist/client/assets/{index-UJpgX--l.js → index-0uCJUW_h.js} +2 -2
  152. package/dist/client/assets/index-0y0K3rYv.js +1 -0
  153. package/dist/client/assets/{index-B_YZ5cyn.js → index-2GjydAcS.js} +1 -1
  154. package/dist/client/assets/{index-tRdq7FGO.js → index-6dsaPQ7-.js} +1 -1
  155. package/dist/client/assets/{index-DhqeMM58.js → index-7-yzdcAx.js} +3 -3
  156. package/dist/client/assets/{index-DXZ-w0Z9.js → index-A7HgzxSw.js} +1 -1
  157. package/dist/client/assets/{index-BTqJGL1_.js → index-BEqKTiCR.js} +1 -1
  158. package/dist/client/assets/{index-B_v2l2ND.js → index-BIN0yv4s.js} +1 -1
  159. package/dist/client/assets/{index-B6pmysqs.js → index-BL5Vmq62.js} +1 -1
  160. package/dist/client/assets/index-BOvFXsF_.js +1 -0
  161. package/dist/client/assets/{index-BtTqA4_d.js → index-BbcfxnHC.js} +1 -1
  162. package/dist/client/assets/{index-D0QV18E0.js → index-BdKIijqB.js} +1 -1
  163. package/dist/client/assets/{index-CZmU-67J.js → index-BfAymWoj.js} +1 -1
  164. package/dist/client/assets/{index-COXdXByr.js → index-Bgts5its.js} +1 -1
  165. package/dist/client/assets/{index-DYQjub9g.js → index-BiL3chP7.js} +1 -1
  166. package/dist/client/assets/{index-C7I0BjyX.js → index-Bu3PEVA_.js} +1 -1
  167. package/dist/client/assets/{index-BKdXHSbr.js → index-C6DTV4h3.js} +1 -1
  168. package/dist/client/assets/{index-DK8zHloW.js → index-CCH9c-nB.js} +1 -1
  169. package/dist/client/assets/{index-oc-yQ5Q4.js → index-CH4NJ8dD.js} +1 -1
  170. package/dist/client/assets/{index-BxsALYNM.js → index-CKGJp3Cm.js} +1 -1
  171. package/dist/client/assets/{index-BIZNH5u1.js → index-CeqI4FFw.js} +1 -1
  172. package/dist/client/assets/{index-Cbk19RQp.js → index-Cj9-XXKl.js} +1 -1
  173. package/dist/client/assets/{index-um-0KSur.js → index-Cu8tnfM_.js} +1 -1
  174. package/dist/client/assets/{index-B_rc9Pb1.js → index-D4OWRMsG.js} +1 -1
  175. package/dist/client/assets/{index-RQhQx8gq.js → index-D8SP73Xw.js} +1 -1
  176. package/dist/client/assets/{index-CEicS7Zi.js → index-DEJXVqcY.js} +1 -1
  177. package/dist/client/assets/{index-CTJA-mZu.js → index-DEMZynQt.js} +1 -1
  178. package/dist/client/assets/{index-5RD9flqf.js → index-DGzMwE1Z.js} +1 -1
  179. package/dist/client/assets/{index-CLTrC-a-.js → index-DIJdZqg2.js} +3 -3
  180. package/dist/client/assets/{index-Ds9wPt9M.js → index-DIRqrOEK.js} +1 -1
  181. package/dist/client/assets/{index-DBAPfYwE.js → index-DNbdGvs9.js} +1 -1
  182. package/dist/client/assets/{index-D5fV4hrl.js → index-DOBjxRe9.js} +1 -1
  183. package/dist/client/assets/{index-57qzL_5b.js → index-DcBlHsnC.js} +1 -1
  184. package/dist/client/assets/index-DdsaTuqO.js +1 -0
  185. package/dist/client/assets/{index-BN3zOTbR.js → index-Dt4H9Tms.js} +3 -3
  186. package/dist/client/assets/{index-BNq_mnok.js → index-HXC63Ry8.js} +1 -1
  187. package/dist/client/assets/index-MHIn2TC9.js +1063 -0
  188. package/dist/client/assets/{index-DdBvjuc4.js → index-OjJ_8uMM.js} +1 -1
  189. package/dist/client/assets/index-P4Wos1Gi.css +1 -0
  190. package/dist/client/assets/{index-Bktc0aFV.js → index-U5jTIqzv.js} +1 -1
  191. package/dist/client/assets/{index-CLVvKY2v.js → index-ZzPr9GUI.js} +1 -1
  192. package/dist/client/assets/{index-DO8NbOqk.js → index-d9cqTUAj.js} +1 -1
  193. package/dist/client/assets/{index-Cbbw2ByB.js → index-fcfCRITA.js} +1 -1
  194. package/dist/client/assets/{index-3CJSEcZE.js → index-onQlu3UR.js} +1 -1
  195. package/dist/client/assets/{index.esm-B10OaB6F.js → index.esm-DSKTDEoH.js} +1 -1
  196. package/dist/client/assets/{infoDiagram-MVDRKAX5-CGtvYWtj.js → infoDiagram-MVDRKAX5-B8dulOBe.js} +1 -1
  197. package/dist/client/assets/{inline-code-BL-6EKVP.js → inline-code-B3qpjdZ2.js} +1 -1
  198. package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-ICsVVT2t.js → ishikawaDiagram-HPEHV2GE-Cy8aIg0O.js} +1 -1
  199. package/dist/client/assets/{journeyDiagram-BOSHW7O7-DEmSX2Hn.js → journeyDiagram-BOSHW7O7-BZAlejG3.js} +1 -1
  200. package/dist/client/assets/{kanban-definition-FNSA4HC5-SAV5PQOr.js → kanban-definition-FNSA4HC5-BxS1edpe.js} +1 -1
  201. package/dist/client/assets/{layers-Bfdpn7ZM.js → layers-ByCM7XO5.js} +1 -1
  202. package/dist/client/assets/{lightbulb-CSPTiZoi.js → lightbulb-KjW8YTXH.js} +1 -1
  203. package/dist/client/assets/{link-2-ZzmN9B9k.js → link-2-CtFfuMO5.js} +1 -1
  204. package/dist/client/assets/{list-runtime-types-7qV7HQ7K.js → list-runtime-types-DrzHejZo.js} +1 -1
  205. package/dist/client/assets/{markdown-content-CiDXslQf.js → markdown-content-DgiSdNwz.js} +1 -1
  206. package/dist/client/assets/mention-pill-CHPHlu-U.js +1 -0
  207. package/dist/client/assets/{mermaid.core-C-qvGQ5g.js → mermaid.core-ovqlC4PC.js} +4 -4
  208. package/dist/client/assets/{message-square-off-BehEHG9c.js → message-square-off-CEOyy4Pq.js} +1 -1
  209. package/dist/client/assets/{mindmap-definition-6OY57UG3-DzU2APoo.js → mindmap-definition-6OY57UG3-CsngqLzI.js} +1 -1
  210. package/dist/client/assets/{more-details-DF2dJXMV.js → more-details-BW9mauVT.js} +1 -1
  211. package/dist/client/assets/{owner-notice-DoH-_Veh.js → owner-notice-BRUVafHC.js} +1 -1
  212. package/dist/client/assets/{package-Fm_v1gMn.js → package-Bbs99yqi.js} +1 -1
  213. package/dist/client/assets/{page-container-Bcz5wJVR.js → page-container-BVfGgaaJ.js} +1 -1
  214. package/dist/client/assets/{pane-resize-handle-_EuIpxzc.js → pane-resize-handle-BL7Meu5R.js} +1 -1
  215. package/dist/client/assets/{paperclip-AGN67YEM.js → paperclip-QOWXs8-5.js} +1 -1
  216. package/dist/client/assets/{path-input-jrT0Ap4j.js → path-input-BDRHmgzW.js} +1 -1
  217. package/dist/client/assets/{pegDiagram-ECIUJNBX-CAyGJ7fm.js → pegDiagram-ECIUJNBX-DPsWmWqw.js} +1 -1
  218. package/dist/client/assets/{pieDiagram-GNMPY74T-tmLJe1p-.js → pieDiagram-GNMPY74T-BdOIDv4F.js} +1 -1
  219. package/dist/client/assets/{plug-C-4o4Kb8.js → plug-BrsPyUhu.js} +1 -1
  220. package/dist/client/assets/primer-trigger-C97fRm1v.js +3 -0
  221. package/dist/client/assets/{profile-errors-vJU1kT3U.js → profile-errors-nPLX60ha.js} +1 -1
  222. package/dist/client/assets/{progress-BTu_QWg8.js → progress-C9TALtIa.js} +1 -1
  223. package/dist/client/assets/{quadrantDiagram-D57K4MC3-CUr2zJoz.js → quadrantDiagram-D57K4MC3-MzMEunU7.js} +1 -1
  224. package/dist/client/assets/{query-error-state-BCX32dab.js → query-error-state-BJjgx-WC.js} +1 -1
  225. package/dist/client/assets/{radio-DBitPjM1.js → radio-Biql29-B.js} +1 -1
  226. package/dist/client/assets/{railroadDiagram-Y72NRBL7-Bk9OMEWz.js → railroadDiagram-Y72NRBL7-Dzx_PYVW.js} +1 -1
  227. package/dist/client/assets/registry-B0HgbN69.js +1 -0
  228. package/dist/client/assets/registry-fiUD5cv6.js +39 -0
  229. package/dist/client/assets/{relay-trace-schemas-C-1Js81V.js → relay-trace-schemas-BJ4MfChd.js} +2 -2
  230. package/dist/client/assets/{repeat-B1wCYWXI.js → repeat-CKufDGoQ.js} +1 -1
  231. package/dist/client/assets/{requirementDiagram-EQYSW5RA-B2pkljrw.js → requirementDiagram-EQYSW5RA-J0pg6FEt.js} +1 -1
  232. package/dist/client/assets/{room-files-source-BDkq0-fd.js → room-files-source-iaYdshKo.js} +2 -2
  233. package/dist/client/assets/{rotate-ccw-clock-Ds8cHkxD.js → rotate-ccw-clock-CnARSw5V.js} +1 -1
  234. package/dist/client/assets/{rotate-cw-hUzouNTK.js → rotate-cw-BAn_5-Gq.js} +1 -1
  235. package/dist/client/assets/{sankeyDiagram-SY24JHO5-DEW9eIPS.js → sankeyDiagram-SY24JHO5-6V_uy-zQ.js} +1 -1
  236. package/dist/client/assets/{scroll-area-RSd8NjrE.js → scroll-area-XDq7yL_d.js} +1 -1
  237. package/dist/client/assets/{sequenceDiagram-BLEHNHQU-CoiCdD1D.js → sequenceDiagram-BLEHNHQU-C4jZi3N4.js} +1 -1
  238. package/dist/client/assets/{shield-x-KL4ZbHfz.js → shield-x-CpiXuMbN.js} +1 -1
  239. package/dist/client/assets/{signed-in-Dzxe2378.js → signed-in-Rv3Sjk8n.js} +1 -1
  240. package/dist/client/assets/{sizeCapture-INFHLROL-BWGf0Ghs.js → sizeCapture-INFHLROL-B7nxFreb.js} +1 -1
  241. package/dist/client/assets/{soul-file-BQXbWArv.js → soul-file-BQz4TtHo.js} +1 -1
  242. package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-aeqwGZMB.js → stateDiagram-v2-A6IESKWZ-B5rvc4n2.js} +1 -1
  243. package/dist/client/assets/{swimlanes-B3ENRKFQ-BkWhAAlV.js → swimlanes-B3ENRKFQ-DnElusDo.js} +1 -1
  244. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-DLpKz5fF.js +8 -0
  245. package/dist/client/assets/{table-CfLst6CF.js → table-NGiWzPO4.js} +1 -1
  246. package/dist/client/assets/{timeline-definition-JXYKGLGB-C1BUxIfq.js → timeline-definition-JXYKGLGB-DMgyn3XX.js} +1 -1
  247. package/dist/client/assets/{trust-posture-CfEIPM4Z.js → trust-posture-BArJ9H4j.js} +1 -1
  248. package/dist/client/assets/{unplug-B3eDst8L.js → unplug-MSjeZ0tJ.js} +1 -1
  249. package/dist/client/assets/{unverified-catalog-notice-BqIWxQuN.js → unverified-catalog-notice-DA96H8Df.js} +1 -1
  250. package/dist/client/assets/{use-bindings-DhOKnybh.js → use-bindings-BojBqRJS.js} +1 -1
  251. package/dist/client/assets/{use-composer-prefs-_rlNL0D8.js → use-composer-prefs-BDl8aMme.js} +1 -1
  252. package/dist/client/assets/{use-connector-management-CHLdhBhC.js → use-connector-management-FONU6FK8.js} +1 -1
  253. package/dist/client/assets/{use-deep-link-scroll-BVkszEn2.js → use-deep-link-scroll-CtbBPBgi.js} +1 -1
  254. package/dist/client/assets/{use-delete-binding-BET7vH2R.js → use-delete-binding-COhBv6X3.js} +1 -1
  255. package/dist/client/assets/{use-dev-links-BjLPuSUC.js → use-dev-links-Dh0MCiGY.js} +1 -1
  256. package/dist/client/assets/{use-direct-message-panel-ClXVf94w.js → use-direct-message-panel-CYnWunqk.js} +1 -1
  257. package/dist/client/assets/{use-external-adapter-catalog-D1INoacX.js → use-external-adapter-catalog-RTDOW8Yi.js} +1 -1
  258. package/dist/client/assets/{use-filter-state-BRlb3qG3.js → use-filter-state-CSFTDx7z.js} +1 -1
  259. package/dist/client/assets/{use-full-activity-feed-GWBg-_1B.js → use-full-activity-feed-DlY_ZbRZ.js} +1 -1
  260. package/dist/client/assets/use-is-below-desktop-ClzGXlRb.js +1 -0
  261. package/dist/client/assets/{use-local-browser-C-V2n_wd.js → use-local-browser-WwZd-FOP.js} +1 -1
  262. package/dist/client/assets/{use-mesh-topology-BzSFyR_s.js → use-mesh-topology-WnFkjq41.js} +1 -1
  263. package/dist/client/assets/{use-mounted-ref-1T3JbkY1.js → use-mounted-ref-Dz1h70pz.js} +1 -1
  264. package/dist/client/assets/{use-notification-prefs-qcYeVmLQ.js → use-notification-prefs-IrF5_cko.js} +1 -1
  265. package/dist/client/assets/use-pending-read-CnAnzOt_.js +1 -0
  266. package/dist/client/assets/{use-personality-commit-CJb-rqmM.js → use-personality-commit-C4hYkSPy.js} +1 -1
  267. package/dist/client/assets/use-promo-activation-CPVANFBh.js +6 -0
  268. package/dist/client/assets/{use-promo-dismissals-C6bPU5Rm.js → use-promo-dismissals-B9m0HT6L.js} +1 -1
  269. package/dist/client/assets/{use-pulse-freshness-Y11Ibit1.js → use-pulse-freshness-DMySxN8D.js} +1 -1
  270. package/dist/client/assets/{use-room-follow-claim-Di-yvoJD.js → use-room-follow-claim-ByaYVY0o.js} +1 -1
  271. package/dist/client/assets/{use-room-sessions-CPDRbQAW.js → use-room-sessions-DPB29acU.js} +1 -1
  272. package/dist/client/assets/{use-roving-tab-list-DK0OzOUz.js → use-roving-tab-list-BO8kbs-w.js} +1 -1
  273. package/dist/client/assets/{use-session-canvas-DA2i9Mdm.js → use-session-canvas-Cunag2K7.js} +9 -9
  274. package/dist/client/assets/{use-status-budget-jMg_w0rF.js → use-status-budget-jt-9aQR0.js} +2 -2
  275. package/dist/client/assets/{use-transform-BX3r518L.js → use-transform-ydtuYUNp.js} +1 -1
  276. package/dist/client/assets/{use-unclaimed-chats-B0nk8b84.js → use-unclaimed-chats-ClBWJgNm.js} +1 -1
  277. package/dist/client/assets/use-update-config-ZHtOtve0.js +1 -0
  278. package/dist/client/assets/{useMutationState-Rlga1GBT.js → useMutationState-B8ArIqeH.js} +1 -1
  279. package/dist/client/assets/{usecaseDiagram-WPOLBNNX-mjIwRNL1.js → usecaseDiagram-WPOLBNNX-C5JdAkG9.js} +1 -1
  280. package/dist/client/assets/{vennDiagram-Q3Y3IDCW-BcDIpVa6.js → vennDiagram-Q3Y3IDCW-CqLCy7LU.js} +1 -1
  281. package/dist/client/assets/{wardleyDiagram-IVAIDKWA-NFX31kox.js → wardleyDiagram-IVAIDKWA-C9FlHLTd.js} +1 -1
  282. package/dist/client/assets/{xychartDiagram-4URNHDU4-DZZY7dL1.js → xychartDiagram-4URNHDU4-BIm-RUWd.js} +1 -1
  283. package/dist/client/index.html +2 -2
  284. package/dist/drizzle/20261101195529_work_queue.sql +38 -0
  285. package/dist/drizzle/20261101233656_dor3644_session_launched_by.sql +1 -0
  286. package/dist/drizzle/20261102041558_dor3070_marketplace_summary.sql +2 -0
  287. package/dist/drizzle/20261102051715_dor3440_clear_origin_holds.sql +10 -0
  288. package/dist/drizzle/20261102135442_agent_browser_profiles.sql +15 -0
  289. package/dist/drizzle/meta/20261101195529_snapshot.json +14363 -0
  290. package/dist/drizzle/meta/20261101233656_snapshot.json +14370 -0
  291. package/dist/drizzle/meta/20261102041558_snapshot.json +14384 -0
  292. package/dist/drizzle/meta/20261102051715_snapshot.json +14384 -0
  293. package/dist/drizzle/meta/20261102135442_snapshot.json +14483 -0
  294. package/dist/drizzle/meta/_journal.json +35 -0
  295. package/dist/server/extension-child.cjs +1147 -572
  296. package/dist/server/index.js +41788 -36880
  297. package/dist/server/index.js.map +2 -2
  298. package/package.json +3 -3
  299. package/dist/client/assets/BlintzCanvas-BgIQdpTx.js +0 -1231
  300. package/dist/client/assets/ChannelComposer-BJ0nNzQb.js +0 -45
  301. package/dist/client/assets/HandlePage-Bq5qdCfY.js +0 -1
  302. package/dist/client/assets/NamePage-_yT2RQvT.js +0 -1
  303. package/dist/client/assets/NewDirectMessageMenu-CMp4ppiH.js +0 -1
  304. package/dist/client/assets/PhotoPage-Djh4IZBF.js +0 -1
  305. package/dist/client/assets/RoomSurface-DXZ36tmU.js +0 -1
  306. package/dist/client/assets/_shell-CTKp94uQ.js +0 -80
  307. package/dist/client/assets/_shell._home.tasks-B_lv_-fX.js +0 -1
  308. package/dist/client/assets/_shell.marketplace-DUpaCb0r.js +0 -1
  309. package/dist/client/assets/_shell.marketplace_.sources-C3pA7zZW.js +0 -1
  310. package/dist/client/assets/_shell.session-DH_9f3AK.js +0 -1
  311. package/dist/client/assets/_shell.x._extensionId-DaXLhYNr.js +0 -1
  312. package/dist/client/assets/_shell.x._extensionId_._-DaXLhYNr.js +0 -1
  313. package/dist/client/assets/channel-CF9_Q7CV.js +0 -1
  314. package/dist/client/assets/index-3JL8A9YZ.css +0 -1
  315. package/dist/client/assets/index-BPp-rj-W.js +0 -1
  316. package/dist/client/assets/index-C4Uak2ha.js +0 -1
  317. package/dist/client/assets/index-Daoy3TZ8.js +0 -1
  318. package/dist/client/assets/index-YUtEyz7O.js +0 -1053
  319. package/dist/client/assets/mention-pill-CuSUdpn7.js +0 -1
  320. package/dist/client/assets/primer-trigger-CmE4Ib-X.js +0 -3
  321. package/dist/client/assets/registry-DVPRVi8T.js +0 -34
  322. package/dist/client/assets/registry-DiFfRDdW.js +0 -1
  323. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-CS2DMvLi.js +0 -8
  324. package/dist/client/assets/use-is-below-desktop-BjWA-tqP.js +0 -1
  325. package/dist/client/assets/use-pending-read-C1oA2H00.js +0 -1
  326. package/dist/client/assets/use-promo-activation-CAJItujg.js +0 -11
  327. package/dist/client/assets/use-update-config-Ce7sHmp2.js +0 -1
@@ -1,45 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BN3zOTbR.js","assets/index-YUtEyz7O.js","assets/index-3JL8A9YZ.css","assets/room-files-source-BDkq0-fd.js","assets/markdown-content-CiDXslQf.js","assets/file-exclamation-point-Cdt8YqyQ.js","assets/query-keys-DeYqUDia.js","assets/composer-insert-BpyATrmR.js","assets/index-DYQjub9g.js","assets/file-drag-GDx2qhdk.js","assets/rotate-cw-hUzouNTK.js","assets/link-2-ZzmN9B9k.js","assets/file-D7_QdH_S.js","assets/git-branch-CPOwiT8a.js","assets/more-details-DF2dJXMV.js"])))=>i.map(i=>d[i]);
2
- import{O as P,r as c,j as l,B as ue,h4 as Nn,n1 as Cn,g as Rn,k2 as An,G as te,a5 as fe,a7 as Fe,a8 as Be,aQ as U,ci as Ue,cj as Sn,cT as Mn,n2 as jn,lx as _n,n3 as On,h as En,ay as Tn,cp as He,gv as se,q as Z,dB as We,s as pe,lX as $n,n4 as Dn,my as Pn,n5 as Ln,eP as Fn,g7 as Bn,a0 as Un,e0 as Hn,m$ as Wn,n6 as Kn,n7 as zn,a4 as qn,bx as Vn,n8 as Gn,n9 as Jn,Y as Yn,$ as Qn,gA as Xn,kT as Ce,na as Ke,bV as Zn,kS as Q,kW as ze,nb as et,ch as ge,ak as nt,bZ as he,im as qe,c5 as tt,_ as Ve,nc as st,ct as Ge,nd as ot,fc as at,kj as Je,ne as Ye,a_ as rt,gx as Qe,kV as it,nf as Xe,ng as ct,nh as lt,ni as dt,nj as Re,eR as ut,nk as mt,nl as ft,nm as pt,nn as gt,no as ht,np as xt,l as yt,hh as bt,kK as vt,al as kt,nq as wt,nr as It,ns as Nt,b9 as Ct,nt as Rt,nu as At,nv as St,nw as Mt,Z as Ae,f0 as jt}from"./index-YUtEyz7O.js";import{g as Se,m as Me,h as xe,f as Ze,M as _t,a as Ot,E as Et,i as Tt,j as $t,c as D,k as Dt,b as Pt,l as Lt,r as Ft,u as Bt,C as Ut}from"./registry-DVPRVi8T.js";import"./WidgetErrorCard-CQKYI7oK.js";import{R as Ht,A as en}from"./repeat-B1wCYWXI.js";import{u as Wt}from"./use-room-sessions-CPDRbQAW.js";import{M as Kt}from"./markdown-content-CiDXslQf.js";import{W as zt,a as qt}from"./find-latest-widget-fence-SQB9WgjN.js";import{f as Vt}from"./format-duration-BCr6uzby.js";import{H as Gt,a as Jt,b as Yt}from"./RuntimeSetupDialog-bdf844gx.js";import{M as je}from"./mention-pill-CuSUdpn7.js";import{R as Qt}from"./rotate-ccw-clock-Ds8cHkxD.js";import{U as Xt}from"./unplug-B3eDst8L.js";import{M as _e}from"./message-square-off-BehEHG9c.js";import{i as Zt}from"./registry-DiFfRDdW.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 nn={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"}]]};nn.node;const es=P(nn);/**
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 tn={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"}]]};tn.node;const ns=P(tn);/**
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 sn={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"}]]};sn.node;const ts=P(sn);/**
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 on={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"}]]};on.node;const ss=P(on);/**
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 an={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"}]]};an.node;const os=P(an);/**
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 rn={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"}]]};rn.node;const as=P(rn);/**
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 cn={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"}]]};cn.node;const Oe=P(cn);/**
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 ln={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"}]]};ln.node;const rs=P(ln),is='[data-slot="identity-hover-card-actions"] button:not(:disabled)';function cs(e){const{open:t,setOpen:s,triggerRef:n,enabled:o}=e,a=c.useRef(null),r=c.useRef(!1);c.useEffect(()=>{if(!t||!r.current)return;r.current=!1;let m=0,x=0;const v=()=>{var u;const f=(u=a.current)==null?void 0:u.querySelector(is);if(f)return f.focus();++m<10&&(x=requestAnimationFrame(v))};return v(),()=>cancelAnimationFrame(x)},[t]);const i=c.useCallback(m=>{var x;!m&&((x=a.current)!=null&&x.contains(document.activeElement))||s(m)},[s]),d=c.useCallback(m=>{!o||m.key!=="Enter"&&m.key!==" "||(m.preventDefault(),r.current=!0,s(!0))},[o,s]),p=c.useMemo(()=>({onEscapeKeyDown:()=>{var m;return(m=n.current)==null?void 0:m.focus()},onBlur:m=>{var v,f,u;const x=m.relatedTarget;x&&((v=a.current)!=null&&v.contains(x)||(f=n.current)!=null&&f.contains(x))||(u=a.current)!=null&&u.contains(document.activeElement)||s(!1)}}),[s,n]);return{contentRef:a,handleOpenChange:i,onTriggerKeyDown:d,contentHandlers:p}}function ce(e){const t=e.key==="ArrowRight"||e.key==="ArrowDown",s=e.key==="ArrowLeft"||e.key==="ArrowUp",n=e.key==="Tab";if(!t&&!s&&!n)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 i=s||n&&e.shiftKey?-1:1;a[(r+i+a.length)%a.length].focus()}function ls({kind:e,about:t}){const n=[e==="agent"?"Agent":e==="human"?"Person":null,t.role].filter(Boolean).join(" · ");return!n&&!t.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:[n&&l.jsx("p",{className:"text-muted-foreground truncate text-xs",title:n,children:n}),t.status&&l.jsx("p",{className:"text-foreground/80 truncate text-xs","data-slot":"identity-hover-card-status",children:t.status})]})}function ds({actions:e,onAct:t}){const s=n=>()=>{t(),n()};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(Nn,{className:"size-3.5 shrink-0","aria-hidden":!0}),l.jsx("span",{className:"truncate",children:e.session.label})]})]})}const us=300;function G({className:e,children:t}){return l.jsx("span",{className:te("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:t})}function ye({identity:e,children:t,onViewProfile:s,about:n,actions:o,onOpenChange:a,openOnClick:r=!1,className:i}){const{kind:d,displayName:p,handle:m,color:x,emoji:v,imageUrl:f,origin:u,agent:g}=e,I=x??"hsl(var(--muted-foreground))",h=typeof u=="object"&&u!==null,y=d==="agent"&&(g==null?void 0:g.working)!=null?g.working:null,[N,M]=c.useState(!1),S=c.useCallback(k=>{M(k),a==null||a(k)},[a]),R=c.useRef(!1),C=c.useRef(null),A=Cn({onLongPress:()=>{R.current&&S(!0)}}),{contentRef:_,handleOpenChange:O,onTriggerKeyDown:b,contentHandlers:j}=cs({open:N,setOpen:S,triggerRef:C,enabled:r&&o!==void 0});return l.jsxs(Gt,{open:N,onOpenChange:O,openDelay:us,children:[l.jsx(Jt,{asChild:!0,ref:C,"data-gesture-priority":"",...A,onPointerDown:k=>{R.current=k.pointerType==="touch"||k.pointerType==="pen",A.onPointerDown(k)},...r?{onClick:()=>S(!0),onKeyDown:b}:{},children:t}),l.jsxs(Yt,{ref:_,...j,...o?{role:"dialog","aria-label":p}:{},"data-slot":"identity-hover-card",align:"start",className:te("flex w-64 flex-col gap-0 overflow-hidden p-0",i),children:[l.jsxs("div",{className:"flex items-center gap-3 p-3",children:[l.jsx(Rn,{"aria-hidden":!0,color:I,emoji:v,imageUrl:f,fallback:An(p),kind:d,origin:u,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:p}),m&&l.jsxs("p",{className:"text-muted-foreground truncate text-xs font-medium",children:["@",m]})]})]}),n&&l.jsx(ls,{kind:d,about:n}),l.jsxs("div",{className:"flex flex-wrap gap-1.5 px-3 pb-3 empty:hidden",children:[d==="agent"&&((g==null?void 0:g.runtime)||(g==null?void 0:g.model))&&l.jsx(G,{children:[g.runtime,g.model].filter(Boolean).join(" · ")}),y&&l.jsxs(G,{className:"bg-status-success-bg text-status-success-fg",children:["Working · ",Vt(y.forMs)]}),d==="human"&&l.jsx(G,{children:h?u.platform:"On this machine"}),d==="agent"&&(g==null?void 0:g.managedBy)&&l.jsxs(G,{children:["Managed by"," ",g.managedBy.handle?`@${g.managedBy.handle}`:g.managedBy.displayName]})]}),o?l.jsx(ds,{actions:o,onAct:()=>{var k;(k=C.current)==null||k.focus(),S(!1)}}):s?l.jsx("button",{type:"button","data-slot":"identity-hover-card-profile",onClick:()=>{var k;(k=C.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 ms(){const e=fe(),t=Fe();return Be({onMutate:({roomId:s,entryId:n,emoji:o,viewerAuthorId:a})=>{var m;const r=t.getQueryData(U.entries(s)),i=(m=r==null?void 0:r.find(x=>x.id===n))==null?void 0:m.reactions,{reactions:d,on:p}=Se(i,o,a);return t.setQueryData(U.entries(s),x=>Me(x,n,d)),{on:p}},mutationFn:({roomId:s,entryId:n,emoji:o,viewerAuthorId:a})=>{var d,p;const r=t.getQueryData(U.entries(s)),i=((p=(d=r==null?void 0:r.find(m=>m.id===n))==null?void 0:d.reactions)==null?void 0:p.some(m=>m.emoji===o&&m.authorIds.includes(a)))??!1;return e.toggleReaction(s,n,{emoji:o,on:i})},onError:(s,{roomId:n,entryId:o,emoji:a,viewerAuthorId:r},i)=>{i!==void 0&&t.setQueryData(U.entries(n),d=>{var x;const p=(x=d==null?void 0:d.find(v=>v.id===o))==null?void 0:x.reactions,{reactions:m}=Se(p,a,r,!i.on);return Me(d,o,m)})},onSuccess:({frequents:s},{roomId:n})=>{t.setQueryData(U.detail(n),o=>o&&{...o,reactionFrequents:s})},meta:{errorLabel:"Couldn’t add your reaction",errorToastId:"room-reaction"}})}function W(e){return e.threadRootEntryId??e.parentEntryId}function fs(e){return W(e)??e.id}function ps(e,t){return Math.max(t??0,e)}function la(e,t,s){let n=e[0],o=0;for(const a of e)a.seq>n.seq&&(n=a),t!==null&&a.seq>t&&(o+=1);return{count:ps(e.length,s),lastAt:n.createdAt,unread:o}}function gs(e){var S,R;const{agentPath:t,displayName:s,onViewProfile:n,engaged:o}=e,a=Ue(),r=Sn(),i=a&&o&&t!==void 0,d=Mn(i?t:null),p=jn(d.member),m=_n(),x=On(),v=En(),f=Tn(),{data:u}=He({enabled:i&&r}),g=f.status==="ready"?f.roomId:null,I=u==null?void 0:u.find(C=>C.id===g),h=I?se(I):null,y=(R=(S=d.member)==null?void 0:S.agent)==null?void 0:R.effectiveRuntimeId,N=c.useCallback(()=>{t!==void 0&&(Z.getState().recordOpened("agent",t),m({agentPath:t},y?{runtime:y}:{}))},[t,m,y]),M=c.useCallback(async()=>{if(t===void 0||!v)return;const C=await x(t);if(C===null){We(`${s} has no session in ${h??"this room"} yet`);return}v(pe({session:C}))},[t,v,x,s,h]);return c.useMemo(()=>!a||t===void 0?null:{about:{role:d.role,status:p},actions:{onMessage:N,...n?{onViewProfile:n}:{},...r&&h?{session:{label:`Session in ${h}`,onOpen:()=>void M()}}:{}}},[a,t,d.role,p,N,n,r,h,M])}function hs({identity:e,agentPath:t,onViewProfile:s,openOnClick:n=!1,children:o}){const[a,r]=c.useState(!1),i=gs({agentPath:t,displayName:e.displayName,onViewProfile:s,engaged:a}),d=c.useCallback(p=>{p&&r(!0)},[]);return l.jsx(ye,{identity:e,onViewProfile:s,onOpenChange:d,openOnClick:n&&i!==null,...i?{about:i.about,actions:i.actions}:{},children:o})}function xs(e){return l.jsx(qt,{code:e.code,isIncomplete:e.isIncomplete})}const ys=[{language:zt,component:xs}],bs={turn_failed:{Icon:qn,tone:"text-status-warning"},agent_busy:{Icon:zn},agent_gone:{Icon:rs,tone:"text-status-warning"},agent_left:{Icon:Oe,tone:"text-status-warning"},room_archived:{Icon:Kn},agent_reseated:{Icon:Wn},handle_changed:{Icon:en},files_set_up:{Icon:Hn},handoff_shared:{Icon:Un},handoff_declined:{Icon:_e},runtime_gone:{Icon:ss,tone:"text-status-warning"},agent_paused:{Icon:Bn},agent_declined:{Icon:_e},agent_unavailable:{Icon:Fn},awaiting_approval:{Icon:es,tone:"text-status-warning"},halted:{Icon:Ln},budget_reached:{Icon:Pn},cascade_stopped:{Icon:Dn},addressing_changed:{Icon:ts},bridge_blocked:{Icon:Xt,tone:"text-status-warning"},bridge_undelivered:{Icon:$n,tone:"text-status-warning"},bridge_rate_limited:{Icon:as},bridge_second_agent_refused:{Icon:Oe},bridge_disconnected:{Icon:ns},bridge_agent_swapped:{Icon:Ht},bridge_history_note:{Icon:Qt}},vs={Icon:Vn},le=80;function ks(e){const t=e.trim();if(t.length<=le)return t;const s=t.slice(0,le),n=s.lastIndexOf(" ");return`${(n>le/2?s.slice(0,n):s).trimEnd()}…`}function ws(e,t,s){const n=Is(e,s),o=a=>l.jsx("a",{href:t.href,onClick:t.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 n===null?l.jsxs(l.Fragment,{children:[e," ",o("Open chat")]}):l.jsxs(l.Fragment,{children:[e.slice(0,n.index),o(n.words),e.slice(n.index+n.words.length)]})}function Is(e,t){if(t!==void 0){const n=Gn(t),o=e.lastIndexOf(n);if(o!==-1)return{index:o,words:n}}const s=Jn.exec(e);return s===null?null:{index:s.index,words:s[0]}}function Ns({entry:e,feedPosition:t,rowId:s,sessionLink:n,subjectName:o}){const{Icon:a,tone:r}=(e.body.notice&&bs[e.body.notice])??vs;return l.jsxs("p",{id:s,"data-slot":"notice-row","data-testid":"room-notice","data-notice":e.body.notice??"unknown",...t&&{role:"article","aria-label":ks(e.body.text)},...xe(t),className:te("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:n?ws(e.body.text,n,o):e.body.text})]})}const Cs=Zt.moment;function Rs({entry:e,moment:t,subject:s,subjectIdentity:n,feedPosition:o,rowId:a}){const r=Ze(e.createdAt);return l.jsx("div",{id:a,"data-slot":"moment-row","data-testid":"room-moment","data-moment":t.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:n==null?void 0:n.handle,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl,origin:n==null?void 0:n.origin,agent:n==null?void 0:n.agent},children:l.jsxs("span",{"data-testid":"room-moment-identity",className:"flex shrink-0 items-center",children:[l.jsx(_t,{author:s}),l.jsx("span",{className:"sr-only",children:s.displayName})]})}),l.jsx(Cs,{"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:Ot(e.createdAt),className:"text-msg-timestamp shrink-0 text-xs",children:r})]})})}function As(e,t){const s=Q.getState(),n=s.drafts[e]??"",o=n===""||n.endsWith(" ")||n.endsWith(`
43
- `)?"":" ";s.set(e,`${n}${o}@${t} `)}function Ss({roomId:e,entry:t,author:s,viewerAuthorId:n,onViewProfile:o}){const a=fs(t),r=t.body.text,i=(s==null?void 0:s.id)===n?void 0:(s==null?void 0:s.handle)??void 0,d=s==null?void 0:s.displayName,{copy:p}=Yn({toastOnSettle:!0});return c.useMemo(()=>{const m={reply:{id:"reply",label:"Reply in thread",icon:os,run:()=>{Xn.getState().openThread(e,a,!0),Ce.getState().requestFocus(Ke(e,a))}},copy:{id:"copy",label:"Copy text",icon:Qn,run:()=>void p(r)}};return o!==void 0&&(m.profile={id:"profile",label:"View profile",icon:Zn,run:o}),i!==void 0&&(m.mention={id:"mention",label:d===void 0?"Mention author":`Mention ${d}`,icon:en,run:()=>{As(e,i),Ce.getState().requestFocus(e)}}),Et.map(x=>m[x]).filter(x=>x!==void 0)},[e,a,r,i,d,o,p])}function Ms(e){if(e.kind==="notice")return{kind:"notice"};const t=e.body.moment;return t?{kind:"moment",moment:t}:{kind:"message"}}function da(e,t=[]){return new Map([...t.map(s=>[s.author.id,{...s.author,origin:s.origin}]),...e.map(s=>[s.author.id,{...s.author,origin:s.origin}])])}function ua(e,t){const s=e.body.subjectAuthorId;return s===void 0||t.has(e.authorId)?e.authorId:s}function js(e,t,s){const n=t.get(e),o=ze({record:{kind:(n==null?void 0:n.kind)??"system",id:e,displayName:(n==null?void 0:n.displayName)??"Unknown",emoji:n==null?void 0:n.emoji,color:n==null?void 0:n.color,imageUrl:n==null?void 0:n.imageUrl},override:(n==null?void 0:n.agentRef)===void 0?null:s==null?void 0:s.get(n.agentRef)});return{kind:o.kind,id:e,displayName:(n==null?void 0:n.displayName)??"Unknown",emoji:o.emoji,imageUrl:o.imageUrl,color:o.color,isExternal:typeof(n==null?void 0:n.origin)=="object"&&(n==null?void 0:n.origin)!==null,...(n==null?void 0:n.retired)===!0?{retired:!0}:{}}}function ma(e){const t=new Set;for(const a of e)W(a)===null&&t.add(a.id);const s=[],n=new Map,o=new Set;for(const a of e){const r=W(a);if(r===null){s.push(a);continue}if(!t.has(r)){s.push(a),o.add(a.id);continue}const i=n.get(r);i?i.push(a):n.set(r,[a])}return{topLevel:s,repliesByRoot:n,orphaned:o}}function _s(e){return`thread-${e}`}function Os(e){return`thread-row-${e}`}function fa(e){return`thread-panel-entry-${e}`}function Es(e){return`room-entry-${e}`}function Ts(e,t){const s=e.find(i=>i.id===t);if(s===void 0)return null;const n=W(s)??null,o={rowId:t,domId:Es(t)};if(n===null)return o;const a=e.find(i=>i.id===n);return a!==void 0&&(W(a)??null)===null?{rowId:_s(n),domId:Os(n)}:o}function pa(e,t){if(t===null)return null;const s=e.find(n=>n.seq===t);return s===void 0?null:Ts(e,s.id)}const Ee=48;function ga(e,t,s){const n=e.body.answersEntryId;if(n===void 0||n===e.id||t!==void 0&&t.id===n)return null;const o=s(n);if(o===void 0)return null;const a=o.body.text.replace(/\s+/gu," ").trim();return a.length===0?null:{entryId:n,excerpt:a.length>Ee?`${a.slice(0,Ee).trimEnd()}…`:a}}function $s(e,t){const s=new Map;for(const n of e){const o=t[n.projectPath];if(!o)continue;const a=et({runtime:o.runtime,model:o.model});s.set(ge(n.projectPath),{memberId:n.id,visual:nt(o),runtime:a.label,...a.modelLabel!==null&&{model:a.modelLabel}})}return s}function Ds(e){const t=new Map;for(const[s,n]of e)t.set(s,n.visual);return t}const Ps={info:new Map,faces:new Map},be=c.createContext(Ps);function ha({known:e,children:t}){return l.jsx(be.Provider,{value:e,children:t})}function xa(){const e=he(),t=c.useMemo(()=>{var r;return((r=e.data)==null?void 0:r.agents)??[]},[e.data]),s=c.useMemo(()=>t.map(r=>r.projectPath),[t]),n=qe(s),o=c.useMemo(()=>$s(t,n.data??{}),[t,n.data]),a=c.useMemo(()=>Ds(o),[o]);return c.useMemo(()=>({info:o,faces:a}),[o,a])}function ee(e){const t=c.useContext(be);return e===void 0?void 0:t.info.get(e)}function Ls(){return c.useContext(be).faces}const Te={people:"People",agents:"Agents"},Fs=["people","agents"];function Bs(e,t){const s=[];for(const{author:n}of e){if(n.kind==="system"||n.id===t||n.retired)continue;const o=n.handle;s.push({section:n.kind==="agent"?"agents":"people",authorId:n.id,label:n.displayName,...o?{handle:o}:{},...n.emoji?{emoji:n.emoji}:{},...n.color?{color:n.color}:{},disabled:!o,...o?{}:{disabledReason:"No @name"}})}return s}function Us(e,t,s){const n=t.trim().toLowerCase(),o=e.map((a,r)=>({row:a,position:r,tier:Hs(a,n)})).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 Hs(e,t){var o;if(t==="")return 0;const s=[(o=e.handle)==null?void 0:o.toLowerCase(),e.label.toLowerCase()].filter(a=>a!==void 0);let n=null;for(const a of s){const r=a===t?0:a.startsWith(t)?1:a.includes(t)?2:null;r!==null&&(n===null||r<n)&&(n=r)}return n}function J(e,t,s){var a;const n=e.length;if(n===0)return 0;let o=(t%n+n)%n;for(let r=0;r<n;r++){if(!((a=e[o])!=null&&a.disabled))return o;o=(o+s+n)%n}return 0}function Ws(e,t,s,n){const o=e.slice(0,t),a=e.slice(t+1+s.length),r=`@${n}`,i=a.startsWith(" ")?"":" ";return{value:o+r+i+a,cursorPos:o.length+r.length+1}}const Ks=/(^|\s)@([A-Za-z0-9_.-]*)$/,dn="mention-palette-listbox";function me(e){return`mention-item-${e}`}function zs({members:e,viewerAuthorId:t,text:s,sectionOrder:n=Fs}){var j;const[o,a]=c.useState(!1),[r,i]=c.useState(""),[d,p]=c.useState(-1),m=tt(s),x=c.useRef(!1),v=c.useMemo(()=>Bs(e,t),[e,t]),f=c.useMemo(()=>o?Us(v,r,n):[],[v,r,o,n]),[u,g]=c.useState(null),I=u!==null&&u.query===r&&u.open===o?u.index:J(f,0,1),h=f[I],y=f.length===0||h!==void 0&&!h.disabled?I:J(f,0,1),N=c.useCallback((k,T)=>{const $=k.slice(0,T).match(Ks);if(!$){a(!1);return}a(!0),i($[2]),p(($.index??0)+$[1].length)},[]),M=c.useCallback(k=>{m.write(k),x.current=!1},[m]),S=c.useCallback(k=>{x.current||N(m.read(),k)},[N,m]),R=c.useCallback(()=>{g({query:r,open:o,index:J(f,y+1,1)})},[f,y,r,o]),C=c.useCallback(()=>{g({query:r,open:o,index:J(f,y-1,-1)})},[f,y,r,o]),A=c.useCallback(k=>k.disabled||k.handle===void 0?null:(x.current=!0,a(!1),Ws(m.read(),d,r,k.handle)),[d,r,m]),_=c.useCallback(()=>{const k=f[y];return k?A(k):(a(!1),null)},[f,y,A]),O=c.useCallback(()=>{x.current=!0,a(!1)},[]),b=f.some(k=>!k.disabled);return{isOpen:o,hasSelectableRows:b,rows:f,selectedIndex:y,activeDescendantId:o&&((j=f[y])==null?void 0:j.disabled)===!1?me(y):void 0,listboxId:o?dn:void 0,noteTextChange:M,handleCursorChange:S,moveDown:R,moveUp:C,selectHighlighted:_,selectRow:A,dismiss:O}}function qs({rows:e,selectedIndex:t,onSelect:s}){const n=c.useMemo(()=>{const o=[];return e.forEach((a,r)=>{const i=o[o.length-1];i&&i.section===a.section?i.items.push({row:a,index:r}):o.push({section:a.section,items:[{row:a,index:r}]})}),o},[e]);return c.useEffect(()=>{var o;(o=document.getElementById(me(t)))==null||o.scrollIntoView({block:"nearest"})},[t]),l.jsx(Ve.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:dn,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."}):n.map(({section:o,items:a},r)=>l.jsxs("div",{role:"group","aria-label":Te[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:Te[o]}),a.map(({row:i,index:d})=>{const p=d===t;return l.jsxs("div",{id:me(d),role:"option","aria-selected":p,"aria-disabled":i.disabled,"data-selected":p,"data-disabled":i.disabled,onClick:()=>{i.disabled||s(i)},className:i.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:i.emoji}),l.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:i.label}),i.handle!==void 0&&l.jsxs("span",{className:"text-muted-foreground/70 truncate font-mono text-xs",children:["@",i.handle]}),i.disabledReason!==void 0&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs ml-auto shrink-0",children:i.disabledReason})]},i.authorId)})]},o))})})}const Vs=/(?:^|[^A-Za-z0-9_.@-])cc(?![A-Za-z0-9_])/i;function Gs(e,t){const s=e.lastIndexOf(`
44
- `,t-1)+1;return Vs.test(e.slice(s,t))}function Js(e,t){const s=[...t].sort((a,r)=>a.offset-r.offset),n=s.map(a=>Gs(e,a.offset)),o=new Set(s.filter((a,r)=>!n[r]).map(a=>a.authorId));return s.map((a,r)=>n[r]&&!o.has(a.authorId)?{...a,cc:!0}:a)}function Ys(e,t){const s=e.length>0?`Woke ${e.join(", ")}.`:"Woke nobody.";return t.length>0?`${s} Cc: ${t.join(", ")}.`:s}function un(e){const t=new Set(e.filter(n=>!n.cc).map(n=>n.authorId)),s=[];for(const n of e)n.cc&&!t.has(n.authorId)&&!s.includes(n.authorId)&&s.push(n.authorId);return s}const Qs=/@([A-Za-z0-9][A-Za-z0-9_.-]*)/g,Xs=/[.\-_]+$/;function Zs(e,t){const s=new Map;for(const{author:o}of t)o.handle&&s.set(o.handle.toLowerCase(),o.handle);const n=[];for(const o of e.matchAll(Qs)){if(o.index===void 0)continue;const a=o[1].toLowerCase(),r=a.replace(Xs,""),i=s.get(a)??s.get(r);if(!i)continue;const d=(s.has(a)?a.length:r.length)+1;n.push({offset:o.index,length:d,authorId:i,handle:i})}return n}function eo(e,t){const s=Js(e,Zs(e,t)),n=[],o=[];for(const r of s){const i=r.cc?o:n;i.includes(r.handle)||i.push(r.handle)}if(o.length===0)return null;const a=r=>r.map(i=>`@${i}`).join(", ");return`${n.length>0?`Wakes ${a(n)}`:"Wakes nobody"} · cc ${a(o)}`}function no(e,t){const s=e.mentions.filter(r=>r!==e.authorId);if(s.length===0)return null;const n=new Set(un(e.mentionSpans??[])),o=r=>{var i,d;return`@${((i=t.get(r))==null?void 0:i.handle)??((d=t.get(r))==null?void 0:d.displayName)??r}`},a=s.filter(r=>{var i;return!n.has(r)&&((i=t.get(r))==null?void 0:i.kind)==="agent"});return Ys(a.map(o),s.filter(r=>n.has(r)).map(o))}function to({showAuthorHeader:e,headerId:t,displayName:s,time:n,summary:o,contentId:a,summaryId:r,feedPosition:i}){return{...e?{"aria-labelledby":t}:{"aria-label":n.length>0?`${s}, ${n}`:s},"aria-describedby":o===null?a:r,...xe(i)}}const X=120,so="code block";function oo(e){if(e.length<=X&&!e.includes("```"))return null;const t=ao(e);return t.length===0?null:t}function ao(e){const t=e.replace(/```[\s\S]*?(?:```|$)/g,` ${so} `).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(t.length<=X)return t;const s=ro(t,X),n=s.lastIndexOf(" ");return`${(n>X/2?s.slice(0,n):s).trimEnd()}…`}function ro(e,t){if(typeof Intl.Segmenter=="function"){const n=new Intl.Segmenter(void 0,{granularity:"grapheme"});let o="";for(const{segment:a}of n.segment(e)){if(o.length+a.length>t)break;o+=a}return o}let s="";for(const n of e){if(s.length+n.length>t)break;s+=n}return s}function io({roomId:e,entry:t,viewerAuthorId:s,reactionFrequents:n,streamStalled:o,isMember:a=!0}){const r=ms(),i=o===!0||!a,d=c.useMemo(()=>t.reactions??[],[t.reactions]),p=c.useMemo(()=>d.filter(v=>Tt(v,s)).map(v=>v.emoji),[d,s]),m=c.useCallback(v=>r.mutate({roomId:e,entryId:t.id,emoji:v,viewerAuthorId:s}),[r,e,t.id,s]),x=c.useMemo(()=>({quick:n,mine:p,onToggle:m,disabled:i}),[n,p,m,i]);return{reactions:d,toggle:m,quickRow:x}}function co({barRef:e,pillsRef:t,hasReactions:s}){return n=>{var a,r;if(n.target!==n.currentTarget)return;const{key:o}=n;if(o==="ArrowDown"&&s){n.preventDefault(),(a=t.current)==null||a.focusFirst();return}o!=="ArrowRight"&&o!=="Enter"||(n.preventDefault(),(r=e.current)==null||r.focusFirst())}}function lo(e,t){var x,v;const s=t.body.subjectAuthorId,n=t.body.notice,o=t.kind==="notice"&&n!==void 0&&s!==void 0&&st.includes(n),a=Wt(e,{enabled:o}),r=Ge(),i=Fe(),d=fe(),p=o?((v=(x=a.data)==null?void 0:x.bindings.find(f=>f.authorId===s))==null?void 0:v.sessionId)??null:null,m=c.useCallback(f=>{f.button!==0||f.metaKey||f.ctrlKey||f.shiftKey||f.altKey||(f.preventDefault(),!(p===null||s===void 0)&&ot({queryClient:i,transport:d},e,s).then(u=>{u.kind!=="none"&&r(pe({session:u.kind==="bound"?u.sessionId:p}))}))},[s,r,i,e,p,d]);return c.useMemo(()=>p===null?null:{href:at({session:p}),onOpen:m},[m,p])}const ne="mention",ve="author_id",uo={[ne]:[ve]},mo=[ne];function fo(e,t){if(!t||t.length===0)return e;const s=po(e,t);if(s.length===0)return e;let n=e;for(let o=s.length-1;o>=0;o--){const{offset:a,length:r,authorId:i}=s[o],d=n.slice(0,a),p=n.slice(a,a+r),m=n.slice(a+r);n=`${d}<${ne} ${ve}="${i}">${p}</${ne}>${m}`}return n}function po(e,t){const s=[...t].sort((a,r)=>a.offset-r.offset),n=[];let o=0;for(const a of s)a.offset<o||a.offset+a.length>e.length||(n.push(a),o=a.offset+a.length);return n}const go=/(?:^|[^\p{L}\p{N}_])cc$/iu;function ho(e,t){const s=new Set;for(const n of t)n.cc&&go.test(e.slice(0,n.offset).trimEnd())&&s.add(n.authorId);return s}const xo=new Map,mn=c.createContext(xo);function yo({authors:e,children:t}){return l.jsx(mn.Provider,{value:e,children:t})}function bo(e){const t=c.useContext(mn);return e===void 0?void 0:t.get(e)}const $e=new WeakMap;function vo(e){const t=$e.get(e);if(t)return t;const s=new Map(e.map(n=>[ge(n.projectPath),n.projectPath]));return $e.set(e,s),s}function ko(e){var n;const s=(n=he().data)==null?void 0:n.agents;return c.useMemo(()=>e===void 0||!s?void 0:vo(s).get(e),[s,e])}function fn(e){const{agentRef:t,identity:s,onViewProfile:n}=e,o=Ue(),a=ko(o?t:void 0),r=ee(t);return c.useMemo(()=>{if(!o||s.kind!=="agent"||a===void 0)return null;const i={...s,agent:r&&{runtime:r.runtime,...r.model&&{model:r.model}}},d=(p,m={})=>l.jsx(hs,{identity:i,agentPath:a,onViewProfile:n,openOnClick:m.openOnClick??!1,children:p});return{wrap:d,wrapAvatar:p=>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:p}),{openOnClick:!0}),wrapName:p=>d(l.jsx("button",{type:"button","aria-haspopup":"dialog",className:te(p.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,n])}const wo={kind:"human",displayName:""};function Io(e){return typeof e=="string"?e.replace(/^@/,""):""}function No({authorId:e,children:t,cc:s,ccWord:n}){const o=bo(e),a=ee(o==null?void 0:o.agentRef),{open:r}=Je(),i=o?ze({record:o,override:a==null?void 0:a.visual}):null,d=o?Ye(o,a==null?void 0:a.memberId):void 0,p=c.useMemo(()=>d===void 0?void 0:()=>r(d),[d,r]),m=i==null?void 0:i.color,x=i==null?void 0:i.emoji,v=i==null?void 0:i.imageUrl,f=c.useMemo(()=>o?{kind:o.kind,displayName:o.displayName,handle:o.handle??void 0,color:m,emoji:x,imageUrl:v,origin:o.origin,agent:a&&{runtime:a.runtime,...a.model&&{model:a.model}}}:null,[o,m,x,v,a]),u=fn({agentRef:o==null?void 0:o.agentRef,identity:f??wo,onViewProfile:p});if(!o||!f)return l.jsx(je,{kind:"human",label:Io(t),resolved:!1});const I=u?{role:"button",tabIndex:0,"aria-haspopup":"dialog"}:p?{role:"button",tabIndex:0,"aria-label":`View ${o.displayName}’s profile`,onClick:p,onKeyDown:y=>{y.key!=="Enter"&&y.key!==" "||(y.preventDefault(),p())}}:{},h=l.jsx(je,{kind:o.kind,label:o.displayName,handle:o.handle??void 0,color:o.color,origin:o.origin,resolved:!0,interactive:p!==void 0,...I,cc:s,ccWord:n});return u?u.wrap(h,{openOnClick:!0}):l.jsx(ye,{onViewProfile:p,identity:f,children:h})}function Co(e,t=new Set,s=new Set){return{mention:n=>{const o=n[ve],a=typeof o=="string"?o:void 0;return!a||!e.has(a)?l.jsx(l.Fragment,{children:n.children}):l.jsx(No,{authorId:a,cc:t.has(a),ccWord:!s.has(a),children:n.children})}}}function Ro({entry:e,authors:t}){const s=c.useMemo(()=>fo(e.body.text,e.mentionSpans),[e.body.text,e.mentionSpans]),n=c.useMemo(()=>{var i;return new Set(((i=e.mentionSpans)==null?void 0:i.map(d=>d.authorId))??[])},[e.mentionSpans]),o=c.useMemo(()=>new Set(un(e.mentionSpans??[])),[e.mentionSpans]),a=c.useMemo(()=>ho(e.body.text,e.mentionSpans??[]),[e.body.text,e.mentionSpans]),r=c.useMemo(()=>Co(n,o,a),[n,o,a]);return l.jsx(yo,{authors:t,children:l.jsx(Kt,{content:s,className:"msg-prose",allowedTags:uo,literalTagContent:mo,components:r,renderers:ys})})}function Ao(e){return function(s){return l.jsx(Ro,{entry:s,authors:e})}}const pn="the top folder";function De(e){return e.slice(e.lastIndexOf("/")+1)}function So(e){const t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function Mo(e){return e===""?pn:`${e}/`}function de(e){return e.target!==void 0?e.target===""?pn:e.target:Mo(So(e.paths[0]??""))}function jo(e,t){const s=e.paths[0]??"",n=e.target;switch(e.kind){case"edit":return`${t} edited ${n??s}`;case"add":return`${t} added ${n??s}`;case"upload":return e.pathCount===1?`${t} uploaded ${De(s)} to ${de(e)}`:`${t} uploaded ${e.pathCount} files to ${de(e)}`;case"rename":{const o=e.from??"";return n!==void 0?`${t} renamed ${o} to ${n}`:o.endsWith("/")?`${t} renamed ${o}`:`${t} renamed ${o} to ${s}`}case"delete":return n!==void 0?`${t} deleted ${n}`:e.pathCount===1?`${t} deleted ${s}`:`${t} deleted ${e.pathCount} files`;case"from-attachment":return`${t} saved ${De(s)} from the chat to ${de(e)}`}}const _o=c.lazy(()=>rt(()=>import("./index-BN3zOTbR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.SaveToRoomFilesButton})));function ya({roomId:e,entry:t,author:s,authorRef:n,authors:o,viewerAuthorId:a,authorNames:r,reactionFrequents:i,streamStalled:d,isMember:p=!0,grouping:m,orphanedReply:x,answers:v,feedPosition:f,rowId:u,roomKind:g}){const I=Ze(t.createdAt),h=c.useMemo(()=>{const L=oo(t.body.text),ie=$t(t.attachments??[]);if(ie===null)return L;const Ne=L??t.body.text.trim();return Ne.length>0?`${Ne} ${ie}`:ie},[t.body.text,t.attachments]),y=c.useId(),N=`${y}-author`,M=`${y}-content`,S=`${y}-summary`,R=c.useRef(null),C=c.useRef(null),A=c.useRef(null),{reactions:_,toggle:O,quickRow:b}=io({roomId:e,entry:t,viewerAuthorId:a,reactionFrequents:i,streamStalled:d,isMember:p}),j=ee(n==null?void 0:n.agentRef),{open:k}=Je(),T=n===void 0?void 0:Ye(n,j==null?void 0:j.memberId),$=c.useCallback(()=>{T!==void 0&&k(T)},[k,T]),B=T===void 0?void 0:$,K=Ss({roomId:e,entry:t,author:n,viewerAuthorId:a,onViewProfile:B}),F=(n==null?void 0:n.handle)??void 0,oe=c.useMemo(()=>({kind:s.kind,displayName:s.displayName,handle:F,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl}),[s.kind,s.displayName,F,s.color,s.emoji,s.imageUrl]),w=fn({agentRef:n==null?void 0:n.agentRef,identity:oe,onViewProfile:B}),z=co({barRef:C,pillsRef:A,hasReactions:_.length>0}),q=c.useCallback(()=>{var L;return(L=R.current)==null?void 0:L.focus()},[]),bn=c.useMemo(()=>Ao(o),[o]),we=c.useMemo(()=>g==="channel"&&t.authorId===a?no(t,o):null,[g,t,a,o]),vn=c.useCallback(L=>l.jsx(c.Suspense,{fallback:null,children:l.jsx(_o,{roomId:e,attachment:L})}),[e]),kn=Ls(),ae=t.body.subjectAuthorId??t.authorId,E=o.get(ae),V=ee(E==null?void 0:E.agentRef),wn=lo(e,t),re=Ms(t);if(re.kind==="notice")return l.jsx(Ns,{entry:t,feedPosition:f,rowId:u,sessionLink:wn,subjectName:E==null?void 0:E.displayName});if(re.kind==="moment")return l.jsx(Rs,{entry:t,moment:re.moment,subject:ae===t.authorId?s:js(ae,o,kn),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:u});const In=m.position==="first"||m.position==="only",Ie=t.authorId===a;return l.jsxs(D.Root,{ref:R,id:u,position:m.position,actions:K,reactions:b,"data-testid":"room-entry",tabIndex:0,...to({showAuthorHeader:In,headerId:N,displayName:s.displayName,time:I,summary:h,contentId:M,summaryId:S,feedPosition:f}),onKeyDown:z,children:[l.jsx(D.Gutter,{author:s,at:t.createdAt,onViewProfile:w?void 0:B,isSelf:Ie,renderAvatar:w==null?void 0:w.wrapAvatar}),l.jsxs(D.Body,{children:[l.jsx(D.Author,{id:N,author:s,at:t.createdAt,origin:n==null?void 0:n.origin,isSelf:Ie,renderName:w==null?void 0:w.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}”`}),t.body.via&&l.jsx(Dt,{via:t.body.via}),l.jsx(D.Content,{id:M,className:"wrap-anywhere [&_pre]:overflow-x-auto [&_pre]:wrap-normal",children:t.body.fileChange?l.jsx("p",{"data-testid":"room-entry-file-change",className:"wrap-anywhere",children:jo(t.body.fileChange,(E==null?void 0:E.displayName)??"Somebody")}):bn(t,{rowId:t.id,isStreaming:!1})}),we!==null&&l.jsx("p",{"data-testid":"room-entry-reach",className:"text-muted-foreground text-xs",children:we}),h!==null&&l.jsx("span",{id:S,className:"hidden",children:h}),l.jsx(D.Attachments,{items:t.attachments??[],renderAction:p?vn:void 0}),l.jsx(D.Reactions,{ref:A,reactions:_,viewerAuthorId:a,names:r,frequents:i,onToggle:O,disabled:d===!0||!p,onExit:q}),l.jsx(D.Actions,{actions:K,reactions:b,barRef:C,onExit:q})]})]})}const ba={reactions:!0,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!0,turnStatus:!1,asks:!0};function Oo(e){const t=fe(),[s,n]=c.useState([]),o=c.useRef(new Map),a=c.useCallback(f=>{const u=f.map(g=>({id:crypto.randomUUID(),file:g,status:"pending",progress:0}));n(g=>[...g,...u])},[]),r=c.useCallback(f=>{o.current.delete(f),n(u=>u.filter(g=>g.id!==f))},[]),i=c.useCallback(f=>{if(!f){o.current.clear(),n([]);return}const u=new Set(f);for(const g of u)o.current.delete(g);n(g=>g.filter(I=>!u.has(I.id)))},[]),d=c.useCallback(f=>{o.current.delete(f),n(u=>u.map(g=>g.id===f&&g.status==="error"?{...g,status:"pending",progress:0,error:void 0}:g))},[]),p=c.useRef(null),m=Be({meta:{suppressErrorToast:!0},mutationFn:async f=>{n(h=>h.map(y=>f.some(N=>N.id===y.id)?{...y,status:"uploading"}:y));const u=h=>{n(y=>y.map(N=>N.status==="uploading"?{...N,progress:h.percentage}:N))},g=new AbortController;p.current=g;const I=f.map(h=>h.file);return t.uploadRoomAttachments(e,I,u,g.signal)},onSettled:()=>{p.current=null},onSuccess:(f,u)=>{u.forEach((g,I)=>{const h=f[I];h&&o.current.set(g.id,h.id)}),n(g=>g.map(I=>u.findIndex(y=>y.id===I.id)===-1?I:{...I,status:"uploaded",progress:100}))},onError:f=>{n(u=>u.map(g=>g.status==="uploading"?{...g,status:"error",error:f.message}:g))}}),x=c.useCallback(()=>{var f;(f=p.current)==null||f.abort()},[]),v=c.useCallback(async()=>{const f=s.filter(g=>g.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 u=s.filter(g=>g.status==="pending");return u.length>0&&await m.mutateAsync(u),s.map(g=>o.current.get(g.id)).filter(g=>g!==void 0)},[s,m]);return{pendingFiles:s,addFiles:a,removeFile:r,retryFile:d,clearFiles:i,cancelUpload:x,uploadAndGetIds:v,hasPendingFiles:s.length>0,hasFailedUpload:s.some(f=>f.status==="error"),isUploading:m.isPending}}function va(e){const{room:t,threadRootId:s}=e,n=Pt(),o=Lt(),a=Oo((t==null?void 0:t.id)??""),r=t!==void 0&&Qe(t.members,t.viewerAuthorId),i=c.useRef({attachments:a,post:n,reply:o,room:t,threadRootId:s});c.useEffect(()=>{i.current={attachments:a,post:n,reply:o,room:t,threadRootId:s}});const d=c.useCallback(y=>i.current.attachments.addFiles(y),[]),p=c.useCallback(y=>i.current.attachments.removeFile(y),[]),m=c.useCallback(y=>i.current.attachments.retryFile(y),[]),x=c.useCallback(()=>i.current.attachments.cancelUpload(),[]),{pendingFiles:v,hasFailedUpload:f,isUploading:u}=a,g=c.useMemo(()=>({staged:v,add:d,remove:p,retry:m,cancel:x,hasFailed:f,isUploading:u,holdsSendWhileUploading:!1}),[v,f,u,d,p,m,x]),I=c.useCallback(async y=>{const{attachments:N,post:M,reply:S,room:R,threadRootId:C}=i.current;if(R===void 0)throw new Error("That room isn’t loaded yet.");if(R.archived)throw new Error("This room is archived.");Z.getState().recordOpened("room",R.id);const A=it(),_=N.pendingFiles.map(k=>k.file.name),O=N.pendingFiles.map(k=>k.id),b=await N.uploadAndGetIds();N.clearFiles(O);const j=y.parentEntryId??C;if(Ft({roomId:R.id,threadRootId:j??null},y.text),j!==void 0){S.mutate({roomId:R.id,rootEntryId:j,text:y.text,clientId:A,attachmentIds:b,attachmentNames:_});return}M.mutate({roomId:R.id,text:y.text,clientId:A,attachmentIds:b,attachmentNames:_})},[]);return{target:c.useMemo(()=>({kind:"room",id:(t==null?void 0:t.id)??"",placeholder:t===void 0?"Message…":s===void 0?`Message ${se(t)}…`:"Reply in this thread…",canSend:t!==void 0&&!t.archived&&r,...t===void 0?{canSendReason:"Still opening this room…"}:t.archived?{canSendReason:"This room is archived. You can read it, but not add to it."}:r?{}:{canSendReason:Xe},send:I,attachments:g}),[t,s,r,g,I]),attachments:a}}const gn=8;function hn(e){if(e==null)return null;const t=e.replace(/\s+/g," ").trim();return t.length===0?null:t}function Eo(e){if(dt(e)){const s=e.unreadCount??0;return s===1?"1 new message":`${s} new messages`}const t=e.working??0;return t>0?t===1?"1 agent working":`${t} agents working`:hn(e.topic)}function Pe(e){return{kind:"session",id:e.id,name:lt(e.title),summary:hn(e.lastMessagePreview),lastActivityAt:e.updatedAt,session:e}}function To(e){return{kind:e.kind==="dm"?"dm":"channel",id:e.id,name:se(e),summary:Eo(e),lastActivityAt:e.lastActivityAt,room:e}}function Y(e){if(e===void 0)return null;const t=Date.parse(e);return Number.isNaN(t)?null:t}function $o(e){return e.kind==="session"?Re("session",e.id):Re("room",e.id)}function Le(e,t){const s=[Y(t[$o(e)]),...e.kind==="session"?[Y(e.session.lastTouchedByYouAt),Y(e.session.userLastMessageAt)]:[]].filter(n=>n!==null);return s.length>0?Math.max(...s):Y(e.lastActivityAt)??Number.NEGATIVE_INFINITY}function Do(e){return(t,s)=>Le(s,e)-Le(t,e)||s.id.localeCompare(t.id)}function Po(e){const t=new Set;return e.filter(s=>{const n=`${s.kind}:${s.id}`;return t.has(n)?!1:(t.add(n),!0)})}function Lo(e,t){return!(t.has(e.id)||e.unreadCount===null||e.lastActivityAt===e.createdAt)}function Fo({sessions:e,rooms:t,mutedRoomIds:s=new Set,interactions:n={},limit:o=gn}){const{yours:a,spinOffs:r,automated:i}=ct(e),d=Do(n),p=[...a.map(Pe),...t.filter(m=>Lo(m,s)).map(To)].sort(d);return{items:Po(p).slice(0,o),automated:[...r,...i].map(Pe).sort(d).slice(0,o)}}const Bo=3,Uo=ft;function Ho({limit:e=gn,mutedRoomIds:t,enabled:s=!0}={}){var p,m;const n=ut(Math.max(e*Bo,Uo),{enabled:s}),o=He({enabled:s}),a=mt(),r=(p=n.data)==null?void 0:p.sessions,i=o.data;return{...c.useMemo(()=>Fo({sessions:r??[],rooms:i??[],mutedRoomIds:t,interactions:a,limit:e}),[r,i,t,a,e]),isLoading:s&&(n.isLoading||o.isLoading),warnings:((m=n.data)==null?void 0:m.warnings)??[]}}const Wo=6,xn="jump-back-in-listbox";function ke(e){return`jump-back-in-item-${e}`}const Ko='[role="combobox"]';function H(e){return e instanceof Element&&e.matches(Ko)}function zo({value:e,yieldToPalette:t=!1,enabled:s=!0}){const n=Ge(),o=pt(),[a,r]=c.useState(!1),[i,d]=c.useState({stamp:"",index:0}),[p,m]=c.useState(!1),[x,v]=c.useState(!1);e.length>0&&!x&&v(!0);const f=c.useRef(!1);c.useEffect(()=>{f.current=!0},[]);const{data:u}=he({enabled:s}),g=c.useMemo(()=>((u==null?void 0:u.agents)??[]).map(w=>w.projectPath),[u]),{data:I}=qe(g,{enabled:s}),h=c.useMemo(()=>I??{},[I]),y=c.useMemo(()=>gt(g,h),[g,h]),N=c.useMemo(()=>new Map(g.map(w=>[ge(w),w])),[g]),M=c.useCallback(w=>ht({room:w,agentsByPath:h,pathByAgentRef:N}),[h,N]),S=c.useMemo(()=>xt(o.muted),[o.muted]),{items:R}=Ho({mutedRoomIds:S,enabled:s}),C=c.useMemo(()=>R.slice(0,Wo),[R]),A=s&&a&&!p&&!x&&!t&&e.length===0&&C.length>0,_=`${A}:${C.length}`,O=i.stamp===_?i.index:0,b=c.useCallback(w=>{f.current&&H(w.target)&&(m(!1),v(!1),r(!0))},[]),j=c.useCallback(w=>{H(w.target)&&r(!0)},[]),k=c.useCallback(w=>{H(w.target)&&r(!1)},[]),T=c.useCallback(w=>{C.length!==0&&d(z=>{const q=z.stamp===_?z.index:0;return{stamp:_,index:(q+w+C.length)%C.length}})},[C.length,_]),$=c.useCallback(()=>T(1),[T]),B=c.useCallback(()=>T(-1),[T]),K=c.useCallback(()=>{m(!0)},[]),F=c.useCallback(w=>{if(m(!0),w.kind==="session"){w.session.cwd&&Z.getState().recordOpened("agent",w.session.cwd),n(pe({dir:w.session.cwd??void 0,session:w.session.id}));return}Z.getState().recordOpened("room",w.room.id),n({...yt.channels(),search:{id:w.room.id}})},[n]),oe=c.useCallback(()=>{const w=C[O];!A||!w||F(w)},[A,C,O,F]);return{isOpen:A,hasRows:C.length>0,rows:C,agents:h,displayNames:y,visualOf:M,selectedIndex:O,activeDescendantId:A&&C[O]!==void 0?ke(O):void 0,listboxId:A?xn:void 0,handleFocus:b,handleBlur:k,handlePointerDown:j,moveDown:$,moveUp:B,selectHighlighted:oe,selectRow:F,dismiss:K}}function yn({mark:e,label:t,title:s,summary:n,lastActivityAt:o,index:a,isSelected:r,now:i,onSelect:d}){const p=c.useMemo(()=>Number.isNaN(Date.parse(o))?null:Ct(o),[o,i]);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:t}),p!==null&&l.jsx("span",{className:"text-muted-foreground/60 text-3xs shrink-0",children:p})]}),n!==null&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs truncate",children:n})]})]})}function qo({item:e,agent:t,displayName:s,index:n,isSelected:o,now:a,onSelect:r}){const i=vt(t,e.session.cwd??s);return l.jsx(yn,{mark:l.jsx(kt,{color:i.color,emoji:i.emoji,size:"xs"}),label:e.name,title:`${s} · ${e.name}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:n,isSelected:o,now:a,onSelect:r})}function Vo({item:e,visual:t,index:s,isSelected:n,now:o,onSelect:a}){return l.jsx(yn,{mark:l.jsx(It,{room:e.room,participants:e.room.participants,visuals:Nt(t)}),label:l.jsx(wt,{room:e.room}),title:e.summary===null?e.name:`${e.name} · ${e.summary}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:s,isSelected:n,now:o,onSelect:a})}function Go({rows:e,selectedIndex:t,agents:s={},displayNames:n={},visualOf:o,onSelect:a}){const r=bt(6e4);return c.useEffect(()=>{var i,d;(d=(i=document.getElementById(ke(t)))==null?void 0:i.scrollIntoView)==null||d.call(i,{block:"nearest"})},[t]),l.jsx(Ve.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:i=>i.preventDefault(),children:l.jsx("div",{id:xn,role:"listbox","aria-label":"Jump back in",className:"max-h-72 overflow-y-auto p-1.5",children:e.map((i,d)=>{var p;return i.kind==="session"?l.jsx(qo,{item:i,agent:i.session.cwd&&s[i.session.cwd]||null,displayName:i.session.cwd&&n[i.session.cwd]||((p=i.session.cwd)==null?void 0:p.split("/").pop())||"Agent",index:d,isSelected:d===t,now:r,onSelect:()=>a(i)},`session-${i.id}`):l.jsx(Vo,{item:i,visual:o(i.room),index:d,isSelected:d===t,now:r,onSelect:()=>a(i)},`room-${i.id}`)})})})}function ka({room:e,threadRootId:t,focusOnMount:s,offerJumpBackIn:n,onFocusChange:o,attachments:a}){const r=t===void 0?e.id:Ke(e.id,t),i=Rt(r),{target:d}=Bt(),p=At(),m=St(r),x=c.useRef(null),v=Qe(e.members,e.viewerAuthorId),f=c.useRef(!1),u=zs({members:e.members,viewerAuthorId:e.viewerAuthorId,text:i}),g=c.useMemo(()=>e.kind==="channel"?eo(i,e.members):null,[e.kind,e.members,i]),I=n===!0,h=zo({value:i,yieldToPalette:u.isOpen,enabled:I}),y=c.useRef(m);c.useEffect(()=>{var b;m!==y.current&&(y.current=m,(b=x.current)==null||b.focus())},[m]),c.useEffect(()=>{var b;s===!0&&((b=x.current)==null||b.focusUnlessTouch())},[]);const N=c.useCallback(b=>Q.getState().set(r,b),[r]),[M,S]=c.useState(null);c.useLayoutEffect(()=>{var b;M!==null&&((b=x.current)==null||b.focusAt(M.pos))},[M]);const R=c.useCallback(b=>{b&&(N(b.value),S({pos:b.cursorPos}))},[N]),C=c.useCallback(b=>R(u.selectRow(b)),[u,R]),A=c.useCallback(()=>R(u.selectHighlighted()),[u,R]),_=()=>{if(d===null||!d.canSend||f.current)return;u.dismiss();const b=Q.getState().take(r).trim();if(b==="")return;const j=a.pendingFiles.length>0;j&&(f.current=!0),d.send({text:b}).catch(()=>{const k=Q.getState(),T=k.drafts[r]??"";k.set(r,T===""?b:`${b}
45
- ${T}`)}).finally(()=>{j&&(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:Xe}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:p.isPending,onClick:()=>p.mutate({roomId:e.id,authorId:e.viewerAuthorId},{onSuccess:()=>We.success(`You joined ${se(e)}`)}),children:Mt})]});const O=l.jsx(Ut.Composer,{inputRef:x,value:i,onChange:b=>{N(b),u.noteTextChange(b)},onSubmit:_,footer:g?l.jsx("p",{"data-slot":"cc-line",className:"text-muted-foreground px-3 pb-2 text-xs",children:g}):void 0,head:l.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:u.isOpen&&u.rows.length===0?"No one by that name.":""}),mentionPicker:l.jsx(Ae,{children:u.isOpen&&l.jsx(qs,{rows:u.rows,selectedIndex:u.selectedIndex,onSelect:C})}),overlays:l.jsx(l.Fragment,{children:l.jsx(Ae,{children:h.isOpen&&l.jsx(Go,{rows:h.rows,selectedIndex:h.selectedIndex,agents:h.agents,displayNames:h.displayNames,visualOf:h.visualOf,onSelect:h.selectRow})})}),input:{onCursorChange:u.handleCursorChange,isStreaming:!1,isPaletteOpen:u.isOpen||h.isOpen,paletteHasResults:h.isOpen?h.hasRows:u.hasSelectableRows,onArrowUp:h.isOpen?h.moveUp:u.moveUp,onArrowDown:h.isOpen?h.moveDown:u.moveDown,onCommandSelect:h.isOpen?h.selectHighlighted:A,onEscape:h.isOpen?h.dismiss:u.dismiss,tabPicks:!h.isOpen,onClear:()=>{N(""),u.dismiss()},activeDescendantId:h.isOpen?h.activeDescendantId:u.activeDescendantId,paletteListboxId:h.isOpen?h.listboxId:u.listboxId,contextKey:r,...a.hasFailedUpload?{canSubmitReason:"A file didn’t upload. Try it again or remove it, then send."}:{}}});return!I&&o===void 0?O:l.jsx("section",{className:"flex flex-col","data-testid":jt.homeComposer,onFocus:b=>{h.handleFocus(b),H(b.target)&&(o==null||o(!0))},onBlur:b=>{h.handleBlur(b),H(b.target)&&(o==null||o(!1))},onPointerDown:h.handlePointerDown,children:O})}export{ha as A,ka as C,ye as I,ba as R,da as a,ya as b,js as c,ua as d,xa as e,ga as f,ma as g,_s as h,ps as i,la as j,Os as k,Es as l,Ts as m,fa as n,pa as o,H as p,fs as r,W as t,va as u};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-YUtEyz7O.js";import{a as t}from"./ProfileFields-DD6X85w2.js";import"./profile-errors-vJU1kT3U.js";import"./use-mounted-ref-1T3JbkY1.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-YUtEyz7O.js";import{P as m}from"./ProfileFields-DD6X85w2.js";import"./profile-errors-vJU1kT3U.js";import"./use-mounted-ref-1T3JbkY1.js";function a({member:r}){return o.jsx(m,{member:r})}export{a as NamePage};
@@ -1 +0,0 @@
1
- import{a5 as b,a7 as R,a8 as C,aQ as x,dB as P,ez as j,r as d,j as e,cY as E,cZ as M,c$ as k,d0 as T,d1 as K,eA as L,el as B,I,aD as N,B as D,by as F,bz as O,eB as Q,f as z,bA as Y,bC as _,eC as q}from"./index-YUtEyz7O.js";function w(t){return Promise.all([t.invalidateQueries({queryKey:x.lists()}),t.invalidateQueries({queryKey:x.details()}),t.invalidateQueries({queryKey:x.threads()})]).then(()=>{})}function A(t){return(t==null?void 0:t.code)==="SLUG_TAKEN"}function H({isInlineErrorVisible:t}){const n=b(),r=R();return C({mutationFn:({title:a,agentPaths:l})=>n.createRoom({kind:"channel",title:a,members:[],agentPaths:l}),onSuccess:()=>w(r),meta:{suppressErrorToast:!0},onError:a=>{A(a)&&t()||P.error("Couldn’t create that channel.",{description:a.message})}})}function W(){const t=b(),n=R();return C({mutationFn:({agentPaths:r,title:a})=>t.createRoom({kind:"dm",title:a,members:[],agentPaths:r}),onSettled:()=>w(n),meta:{errorLabel:"Couldn’t start that DM"}})}const y=200;function X({open:t,onOpenChange:n,onCreated:r}){const a=j(),[l,m]=d.useState(""),h=d.useRef(null),c=d.useRef(null),u=d.useRef(!0);d.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const o=H({isInlineErrorVisible:()=>u.current}),g=A(o.error)?o.error.message:null,f=l.trim(),p=f.length>0&&f.length<=y,v=s=>{!p||o.isPending||o.mutate({title:f,agentPaths:s.map(i=>i.agentPath)},{onSuccess:i=>{n(!1),r(i)}})},S=s=>{var i;s.key==="Enter"&&(s.preventDefault(),p&&((i=c.current)==null||i.focus()))};return e.jsx(E,{open:t,onOpenChange:n,children:e.jsxs(M,{className:"sm:max-w-md",onOpenAutoFocus:s=>{var i;s.preventDefault(),(i=h.current)==null||i.focus()},children:[e.jsxs(k,{children:[e.jsx(T,{children:"New channel"}),e.jsx(K,{children:"Name it, then pick who’s in it."})]}),e.jsxs(L,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"channel-name",children:"Channel name"}),e.jsx(I,{ref:h,id:"channel-name",value:l,maxLength:y,placeholder:"Backend",autoComplete:"off",onChange:s=>{m(s.target.value),o.error&&o.reset()},onKeyDown:S,"aria-invalid":g?!0:void 0,"aria-describedby":g?"channel-name-error":void 0}),g&&e.jsx("p",{id:"channel-name-error",role:"alert",className:"text-destructive text-xs",children:g})]}),e.jsxs("section",{"aria-label":"Agents in this channel",className:"space-y-2 border-t pt-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Who’s in it"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Agents read everything here and reply when @mentioned."}),e.jsx(N,{roster:a,onSubmit:v,submitLabel:s=>s.length===0?"Create channel":s.length===1?"Create channel with 1 agent":`Create channel with ${s.length} agents`,emptyRosterMessage:"You don’t have any agents yet. You can add them to the channel later.",allChosenMessage:"That’s every agent you have.",isSubmitting:o.isPending,submitDisabled:!p,inputRef:c})]}),e.jsx("div",{className:"flex justify-center border-t pt-3",children:e.jsx(D,{type:"button",variant:"ghost",size:"sm",disabled:!p||o.isPending,onClick:()=>v([]),children:"Create it without agents"})})]})]})})}const $="One agent opens a chat. Two or more start a group message.";function G(t){return t.length===1}function V(t){const n=t[0];return n!==void 0&&G(t)?`Open chat with ${n.displayName}`:"Start group message"}function Z({onStart:t,open:n,onOpenChange:r,hideTrigger:a=!1}){const l=j(),m=d.useRef(null),h=()=>{r(!1),q.getState().open()};return e.jsxs(F,{open:n,onOpenChange:r,modal:!0,fullHeight:!0,children:[e.jsx(O,{asChild:!0,children:e.jsx(Q,{...a?{"aria-hidden":!0,tabIndex:-1,className:"sr-only"}:{"aria-label":"New message"},children:e.jsx(z,{})})}),e.jsxs(Y,{side:"right",align:"start",className:"flex w-64 flex-col p-2","aria-label":"New message",onOpenAutoFocus:c=>{var u;c.preventDefault(),(u=m.current)==null||u.focus()},children:[e.jsx(_,{children:"New message"}),e.jsx(N,{inputRef:m,roster:l,onSubmit:c=>{r(!1),t(c)},submitLabel:V,emptyRosterMessage:"You don’t have any agents yet.",emptyRosterAction:e.jsx(D,{type:"button",size:"sm",variant:"outline",onClick:h,children:"Create agent"}),allChosenMessage:"Everyone is already here."}),e.jsx("p",{className:"text-muted-foreground mt-2 shrink-0 px-2 text-xs",children:$})]})]})}export{X as C,Z as N,$ as O,G as a,V as o,W as u};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-YUtEyz7O.js";import{b as t}from"./ProfileFields-DD6X85w2.js";import"./profile-errors-vJU1kT3U.js";import"./use-mounted-ref-1T3JbkY1.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
@@ -1 +0,0 @@
1
- import{a5 as ie,a8 as de,a7 as Oe,i$ as _e,j0 as ne,j1 as me,j2 as Le,j3 as Fe,j4 as De,aQ as ze,r as n,j as t,G as ee,B as we,x as He,e as Q,gx as ke,hh as qe,gw as Ie,j5 as $e,j6 as We,n as Be,gA as U,dB as Ke,fv as Ge,j7 as Ue,j8 as Xe,j9 as Ye,ct as Qe,ja as Ve,jb as Ze,jc as Je,jd as et,cp as tt,je as nt,gv as Y,jf as st,l as rt,s as he,jg as ot,jh as at,e4 as it,X as dt,e1 as lt,_ as ut,ji as ct,jj as pe,jk as ft,af as mt,jl as ht,gu as pt,gt,jm as xt,aG as ge,Z as Rt}from"./index-YUtEyz7O.js";import{P as vt,u as yt}from"./pane-resize-handle-_EuIpxzc.js";import{D as bt,U as jt,u as wt}from"./UnreadDivider-BnJ06LmP.js";import{u as kt}from"./use-room-follow-claim-Di-yvoJD.js";import{a as le,e as ue,g as It,f as Ae,h as At,i as Ne,c as G,d as V,j as Nt,k as re,b as oe,l as ae,A as Se,m as Ce,t as ce,r as St,n as J,R as fe,u as Me,C as Te,o as Ct}from"./ChannelComposer-BJ0nNzQb.js";import{u as Mt,f as Tt,a as Et,F as Pt,C as X,d as Ot,M as _t}from"./registry-DVPRVi8T.js";import{u as Lt}from"./use-connector-management-CHLdhBhC.js";import{A as Ft}from"./AgentRequestCard-Bz31ewIs.js";import{u as Dt}from"./use-room-sessions-CPDRbQAW.js";function zt(){const e=ie();return de({mutationFn:({roomId:o,authorId:r})=>e.haltRoomAgent(o,r),meta:{errorLabel:"Couldn’t stop this agent"}})}function Ht(){const e=ie();return de({mutationFn:({roomId:o,authorId:r})=>e.promoteHold(o,r),meta:{errorLabel:"Couldn’t ask to be answered first"}})}function qt(e){const o=ie(),r=Oe(),u=_e(e),v=ne(g=>{var p;return e===null?null:((p=g.paging[e])==null?void 0:p.cursor)??null}),i=de({mutationFn:async g=>{var b;const p=(b=ne.getState().paging[g])==null?void 0:b.cursor;if(p==null)return;const y=await o.listRoomEntries(g,{before:p,limit:me}),w=ze.entries(g),k=r.getQueryData(w),I=Le(k,y);r.setQueryData(w,I),ne.getState().notePage(g,Fe(y)??p,De(y,me)||I.length===((k==null?void 0:k.length)??0))},meta:{errorLabel:"Couldn't load older messages"}}),{mutateAsync:l,isPending:j}=i,R=n.useRef(!1),x=n.useCallback(async()=>{if(!(e===null||R.current)){R.current=!0;try{await l(e).catch(()=>{})}finally{R.current=!1}}},[e,l]);return{canLoadOlder:u,isLoadingOlder:j,cursor:v,loadOlder:x}}function $t({id:e,summary:o,open:r,onOpen:u}){const{capabilities:v}=Mt(),{count:i,lastAt:l,unread:j}=o,R=Tt(l),[x,g]=n.useState({count:i,bumped:!1});x.count!==i&&g({count:i,bumped:!0});const p=x.count===i&&x.bumped;return v.threads?t.jsxs("button",{type:"button",id:e,"data-slot":"thread-reply-row","data-testid":"room-thread-replies","data-unread":j>0?"":void 0,"aria-expanded":r,onClick:u,className:ee("focus-ring ml-[calc(var(--msg-padding-x)_+_var(--msg-gutter-width)_+_var(--msg-gap))]","mb-1 w-fit rounded text-left text-xs transition-colors","px-2 py-2 md:px-1 md:py-0.5",j>0?"text-primary hover:text-primary/80 font-medium":"text-muted-foreground hover:text-foreground"),children:[t.jsx("span",{"aria-hidden":!0,className:"mr-1",children:"↳"}),t.jsx("span",{className:ee(p&&"motion-safe:animate-count-flip"),"data-testid":"room-thread-reply-count",children:i},i),i===1?" reply":" replies",R.length>0&&t.jsxs(t.Fragment,{children:[" · last ",t.jsx("time",{dateTime:l,title:Et(l),children:R})]}),j>0&&` · ${j} new`]}):null}function Wt({loading:e,onLoad:o}){return t.jsx("div",{className:"flex justify-center px-4 py-3",children:t.jsxs(we,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:e,"data-testid":"room-load-older",className:"text-muted-foreground hover:text-foreground h-7 gap-2 text-xs",children:[e&&t.jsx(He,{size:"xs"}),e?"Loading older messages…":"Older messages"]})})}const Bt="room-load-older",Kt=4;function Ee({roomName:e}){return t.jsx(Pt,{label:e===void 0?"Messages":`Messages in ${e}`,busy:!0,className:"flex flex-col gap-4 p-4","data-testid":"room-timeline-loading",children:Array.from({length:Kt},(o,r)=>t.jsxs("div",{className:"flex gap-3",children:[t.jsx(Q,{className:"size-7 shrink-0 rounded-full"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[t.jsx(Q,{className:"h-3 w-24"}),t.jsx(Q,{className:"h-3 w-full max-w-md"})]})]},`room-skeleton-${r}`))})}function Gt({roomId:e,roomName:o,viewerAuthorId:r,entries:u,members:v,formerAuthors:i,lastReadSeq:l,reactionFrequents:j,streamStalled:R,isLoading:x,error:g,onAddAgents:p,openThreadId:y,onOpenThread:w,resumeRow:k,landOnRow:I,onTopRow:b,canLoadOlder:N=!1,isLoadingOlder:d=!1,onLoadOlder:f,ref:C,roomKind:O}){const A=n.useMemo(()=>le(v,i),[v,i]),z=ke(v,r),S=ue(),M=n.useMemo(()=>new Map([...A].map(([a,T])=>[a,T.displayName])),[A]),_=qe(),B=Ie(e,null),{topLevel:P,repliesByRoot:D,orphaned:q}=n.useMemo(()=>It(u),[u]),H=n.useMemo(()=>new Map(u.map(a=>[a.id,a])),[u]),L=n.useMemo(()=>{const a=$e(P,l),T=We(P.map(c=>({id:c.id,authorId:c.body.moment?`moment:${c.id}`:c.authorId,timestamp:c.createdAt})),{now:_,lastSeenId:a.lastSeenId,unreadFromStart:a.fromStart}),s=[];N&&!x&&s.push({kind:"load-older",id:Bt});for(const c of T){if(c.kind==="day-divider"){s.push({kind:"day-divider",id:c.key,label:c.label});continue}if(c.kind==="unread-divider"){s.push({kind:"unread-divider",id:c.key});continue}const h=P[c.index];s.push({kind:"message",id:h.id,entry:h,grouping:c.grouping,position:c.index+1,answers:Ae(h,P[c.index-1],H.get.bind(H))});const E=D.get(h.id);E&&s.push({kind:"thread-reply",id:At(h.id),rootId:h.id,replies:E,totalReplies:h.threadReplyCount})}return s},[P,D,H,l,_,N,x]),K=n.useMemo(()=>L.map(a=>a.kind==="load-older"?{kind:"notice",id:a.id,at:"",body:null}:a.kind==="day-divider"?{kind:"day-divider",id:a.id,label:a.label}:a.kind==="unread-divider"?{kind:"unread-divider",id:a.id}:a.kind==="thread-reply"?{kind:"thread-reply",id:a.id,rootId:a.rootId,replyCount:Ne(a.replies.length,a.totalReplies),lastAt:a.replies[a.replies.length-1].createdAt}:{kind:"message",id:a.id,payload:a.entry,grouping:a.grouping,author:G(V(a.entry,A),A,S.faces),at:a.entry.createdAt}),[L,A,S.faces]),F=n.useCallback((a,T)=>{const s=L[T.index];if(s.kind==="load-older")return f===void 0?null:t.jsx(Wt,{loading:d,onLoad:f});if(s.kind==="day-divider")return t.jsx(bt,{label:s.label});if(s.kind==="unread-divider")return t.jsx(jt,{});if(s.kind==="thread-reply"){if(T.onOpenThread===void 0)return null;const h=T.onOpenThread;return t.jsx($t,{id:re(s.rootId),summary:Nt(s.replies,l,s.totalReplies),open:y===s.rootId,onOpen:()=>h(s.rootId)})}const c=V(s.entry,A);return t.jsx(oe,{roomId:e,entry:s.entry,author:G(c,A,S.faces),authorRef:A.get(c),authors:A,viewerAuthorId:r,authorNames:M,reactionFrequents:j,streamStalled:R,isMember:z,grouping:s.grouping,orphanedReply:q.has(s.entry.id),answers:s.answers,feedPosition:{index:s.position,total:-1},rowId:ae(s.entry.id),roomKind:O})},[L,e,O,A,S.faces,r,M,j,R,z,q,l,y,d,f]),W=n.useCallback(a=>{if(a.kind==="message")return ae(a.id);if(a.kind==="thread-reply")return re(a.rootId)},[]);if(g)return t.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[t.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load these messages"}),t.jsx("p",{className:"max-w-sm",children:"Nothing was lost. Reload to try again."})]});const $=v.some(a=>a.author.kind==="agent"),m=t.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[t.jsx(Be,{className:"text-muted-foreground/50 size-8","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:"Nothing said here yet"}),t.jsx("p",{className:"max-w-sm",children:$?"Say something to get it going.":"Nothing answers until you add an agent."}),t.jsx(we,{type:"button",size:"sm",variant:$?"ghost":"default",onClick:p,className:"mt-1",children:$?"Add more agents":"Add agents"})]});return t.jsx(Se,{known:S,children:t.jsx(X.Timeline,{ref:C,conversationId:e,label:`Messages in ${o}`,rows:K,renderRow:F,onOpenThread:w,domIdOf:W,...k===void 0?{}:{resumeRow:k},...I===void 0?{}:{landOnRow:I},...b===void 0?{}:{onTopRow:b},pending:B,viewerAuthorId:r,loading:x?t.jsx(Ee,{roomName:o}):void 0,empty:m,feedTestId:"room-timeline"})})}function Ut(e){const{roomId:o,entrySeq:r,entries:u,historyLoaded:v}=e,i=r===void 0?null:`${o}:${r}`,l=n.useMemo(()=>{if(r===void 0)return null;const k=u.find(d=>d.seq===r);if(k===void 0)return null;const I=Ce(u,k.id);if(I===null)return null;const b=ce(k)??null,N=b!==null&&I.rowId!==k.id;return{roomRowId:I.rowId,threadRootId:N?b:null,entryId:k.id}},[u,r]),j=n.useRef(null),R=(l==null?void 0:l.threadRootId)??null;n.useEffect(()=>{i===null||R===null||j.current!==i&&(j.current=i,U.getState().openThread(o,R))},[i,o,R]);const x=n.useRef(null);n.useEffect(()=>{i===null||!v||l===null&&x.current!==i&&(x.current=i,Ke.info("That message isn’t in the loaded history",{description:"Only recent messages are open. Nothing was lost."}))},[i,v,l]);const g=n.useRef(null),p=n.useCallback(()=>{if(!(i===null||g.current===i))return g.current=i,l==null?void 0:l.roomRowId},[i,l]),y=n.useRef(null),w=n.useCallback(()=>{if(!(i===null||y.current===i))return y.current=i,(l==null?void 0:l.threadRootId)===null||l==null?void 0:l.entryId},[i,l]);return{roomRow:r===void 0?void 0:p,threadRow:r===void 0?void 0:w}}function Xt(e,o){const[r,u]=n.useState({roomId:null,seq:null});return r.roomId===e?r.seq:e===null?(u({roomId:null,seq:null}),null):o===null?null:(u({roomId:e,seq:o}),o)}const Yt=600;function Qt(e){return document.getElementById(re(e))??document.getElementById(ae(e))}function Vt(){const e=n.useRef(null);return n.useEffect(()=>()=>{var r;return(r=e.current)==null?void 0:r.call(e)},[]),{arm:n.useCallback(r=>{var j;(j=e.current)==null||j.call(e);let u=0;const v=Date.now()+Yt;let i=!1;const l=()=>{if(i)return;const R=document.activeElement;if(R===null||R===document.body||!R.isConnected){const g=Qt(r);if(g!==null){g.focus();return}}Date.now()>=v||(u=requestAnimationFrame(l))};u=requestAnimationFrame(l),e.current=()=>{i=!0,cancelAnimationFrame(u)}},[])}}function Zt({roomId:e,route:o,urlThreadId:r,openThreadId:u,entries:v,historyLoaded:i}){const l=Ge(),j=n.useRef(null);n.useEffect(()=>{if(e!==null){if(j.current!==e&&(j.current=e,r!==void 0)){U.getState().openThread(e,r);return}if(i&&u!==void 0){const R=v.find(g=>g.id===u),x=R===void 0?void 0:St(R);if(x!==void 0&&x!==u){const g=U.getState().open[e];U.getState().openThread(e,x,(g==null?void 0:g.focusComposer)??!1);return}}u!==r&&(l==null||l({to:o,search:R=>({...R,thread:u}),replace:!0}))}},[e,o,u,r,v,i,l])}function Jt(e){return e.kind!=="channel"||e.bridge!=null||e.archived?!1:!e.members.some(o=>o.author.kind==="agent")}function en({room:e,hasEntries:o,onAddAgents:r}){return!o||!Jt(e)?null:t.jsxs("p",{className:"text-muted-foreground shrink-0 px-4 pb-1 text-xs","data-testid":"no-agent-hint",children:["No agent is in this channel to answer."," ",t.jsx("button",{type:"button",onClick:r,className:"text-foreground focus-visible:ring-ring rounded-sm underline underline-offset-2 focus-visible:ring-2 focus-visible:outline-none",children:"Add one"})," ","to get answers here."]})}function tn({roomId:e}){const{approvals:o}=Ue(),r=Xe(o).filter(u=>u.roomId===e);return r.length===0?null:t.jsx("section",{"data-slot":"room-approvals","aria-label":"Requests waiting on you",className:"shrink-0 px-3 pb-2 md:px-4",children:t.jsx(Ye,{approvals:r})})}function nn({roomId:e}){const{data:o}=Lt("pending"),r=(o??[]).filter(u=>u.roomId===e);return r.length===0?null:t.jsx("section",{"data-slot":"room-agent-requests","aria-label":"Apps agents are asking for",className:"shrink-0 space-y-2 px-3 pb-2 md:px-4",children:r.map(u=>t.jsx(Ft,{request:u},u.requestId))})}const sn="An agent",xe=64,se=3,rn=new Set;function Pe({room:e,entries:o,scope:r,laneScope:u,stalled:v,unavailable:i=!1,onRetry:l,onScrollToRow:j}){const R=Qe(),x=Ve(e.id,r),g=Ze(e.id,r),p=Je(e.id,r),[y,w]=n.useState(!1),k=Dt(e.id,{enabled:y}),I=et(),{mutate:b}=zt(),[N,d]=n.useState(rn),f=n.useCallback(s=>{d(c=>new Set(c).add(s)),b({roomId:e.id,authorId:s},{onSettled:()=>d(c=>{const h=new Set(c);return h.delete(s),h})})},[b,e.id]),C=Ht(),[O,A]=n.useState(()=>new Map),z=tt(),S=ue(),M=n.useMemo(()=>le(e.members,e.formerAuthors),[e.members,e.formerAuthors]),_=n.useCallback(s=>{var c;return((c=M.get(s))==null?void 0:c.displayName)??sn},[M]),{interactions:B}=nt(),P=n.useMemo(()=>B.filter(s=>s.roomId===e.id),[B,e.id]),D=n.useMemo(()=>{var c;const s={};for(const h of P){if(h.roomAuthorId===void 0)continue;const E=(c=M.get(h.roomAuthorId))==null?void 0:c.displayName;E!==void 0&&(s[h.sessionId]=E)}return s},[P,M]),q=n.useMemo(()=>x.map(s=>({authorId:s.authorId,name:_(s.authorId),state:s.state,since:s.since,activity:s.activity??null})),[x,_]),H=n.useMemo(()=>g.map(s=>{var h;const c=(h=z.data)==null?void 0:h.find(E=>E.id===s.behindRoomId);return{authorId:s.authorId,name:_(s.authorId),since:s.since,behind:{roomId:s.behindRoomId,title:c===void 0?null:Y(c)},othersWaiting:s.othersWaiting,severalInTheWay:s.severalInTheWay}}),[g,_,z.data]),L=n.useMemo(()=>{const s=new Set;for(const c of g)O.get(c.authorId)===c.entryId&&s.add(c.authorId);return s},[g,O]),K=n.useMemo(()=>p===null?null:{authorId:p.authorId,name:_(p.authorId)},[p,_]),F=n.useMemo(()=>Ot({capabilities:fe,asks:P,agentNames:D,stalled:v,presence:q,held:H,silentFinish:K,turn:null}),[P,D,q,H,K,v]),W=n.useMemo(()=>{var c;const s=new Map;for(const h of((c=k.data)==null?void 0:c.bindings)??[])s.set(h.authorId,h.sessionId);return s},[k.data]),$=n.useCallback(s=>{const c=o.find(E=>E.id===s);if(c===void 0)return null;const h=c.body.text.replace(/\s+/gu," ").trim();return h.length===0?null:h.length>xe?`${h.slice(0,xe).trimEnd()}…`:h},[o]),m=n.useCallback(s=>{var c;return u==="thread"?J(s):((c=Ce(o,s))==null?void 0:c.domId)??null},[o,u]),a=n.useMemo(()=>{const s=x.map(h=>{const E=$(h.entryId),Z=m(h.entryId);return{authorId:h.authorId,author:G(h.authorId,M,S.faces),state:h.state,since:h.since,doing:st(h.activity),replyingTo:E===null||Z===null?null:{entryId:h.entryId,excerpt:E,rowId:Z},sessionId:W.get(h.authorId)??null}}),c=H.map(h=>({authorId:h.authorId,author:G(h.authorId,M,S.faces),state:"held",since:h.since,doing:null,replyingTo:null,sessionId:null,behind:h.behind,othersWaiting:h.othersWaiting}));return[...s,...c]},[x,H,M,S.faces,$,m,W]),T=n.useMemo(()=>{if(x.length===0)return null;const s=x.slice(0,se);return t.jsxs("span",{"aria-hidden":"true",className:"flex shrink-0 -space-x-1",children:[s.map(c=>t.jsx(_t,{author:G(c.authorId,M,S.faces),className:"ring-background size-4 ring-2"},c.authorId)),x.length>se&&t.jsx("span",{className:"bg-muted text-muted-foreground ring-background text-3xs flex size-4 items-center justify-center rounded-full ring-2",children:`+${x.length-se}`})]})},[x,M,S.faces]);return t.jsx(X.LiveLane,{state:F,scope:u,onRetry:l,unavailable:i,faces:T,onPeekOpenChange:w,askCard:F.kind==="ask"?t.jsx(ot,{ask:F.ask,...D[F.ask.sessionId]?{agentName:D[F.ask.sessionId]}:{},onOpenSession:s=>{R(he({session:s}))},className:"border-l-0"}):void 0,peek:t.jsx(X.LivePeek,{rows:a,onScrollToRow:j,onOpenSession:s=>{R(he({session:s}))},onOpenRoom:s=>{R({...rt.channels(),search:{id:s}})},onAnswerFirst:s=>{const c=g.find(h=>h.authorId===s);c!==void 0&&A(h=>new Map(h).set(s,c.entryId)),C.mutate({roomId:e.id,authorId:s})},promoted:L,onStopAll:()=>I.mutate({roomId:e.id}),stopping:I.isPending,onStopAgent:f,stoppingAgents:N})})}const Re=3e3;function on(e,o,r,u=Date.now){const v=n.useRef(null),i=n.useRef(new Map),l=n.useRef(new Map),j=v.current,R=i.current,x=l.current,g=u();for(const p of e){if(x.has(p.id))continue;if(j===null){x.set(p.id,"at-rest");continue}const y=R.get(p.authorId);x.set(p.id,y!==void 0&&g-y<Re?"handed-off":"dropped")}return n.useEffect(()=>{if(!r)return;v.current=new Set(e.map(y=>y.id));const p=u();for(const y of o)i.current.set(y,p);for(const[y,w]of i.current)p-w>Re&&i.current.delete(y);for(const y of l.current.keys())v.current.has(y)||l.current.delete(y)}),x}function an({kind:e}){return e==="thread-error"?t.jsxs("div",{"data-slot":"thread-notice","data-testid":"room-thread-error",className:"text-muted-foreground flex flex-col items-center gap-2 px-[var(--msg-padding-x)] py-6 text-center text-sm",children:[t.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load this thread"}),t.jsx("p",{className:"max-w-sm text-xs",children:"Nothing was lost. Reload to try again."})]}):e==="thread-waiting"?t.jsxs("div",{"data-slot":"thread-notice",className:"flex flex-col gap-2 px-[var(--msg-padding-x)]",children:[t.jsx(Q,{className:"h-3 w-24"}),t.jsx(Q,{className:"h-3 w-full max-w-sm"})]}):t.jsx("p",{"data-slot":"thread-notice","data-testid":"room-thread-orphan",className:"text-muted-foreground border-b px-[var(--msg-padding-x)] pb-3 text-xs italic",children:"This thread’s first message is gone. Its replies remain."})}function dn({room:e,rootEntryId:o,focusComposer:r,entries:u,reactionFrequents:v,streamStalled:i,streamUnavailable:l,onRetryStream:j,historyLoaded:R,historyFailed:x=!1,landOnRow:g,pushed:p,onClose:y}){const w=n.useMemo(()=>le(e.members,e.formerAuthors),[e.members,e.formerAuthors]),k=Me({room:e,threadRootId:o}),I=ke(e.members,e.viewerAuthorId),b=ue(),N=n.useMemo(()=>new Map([...w].map(([m,a])=>[m,a.displayName])),[w]),{root:d,replies:f}=n.useMemo(()=>{let m;const a=[];for(const T of u)T.id===o?m=T:ce(T)===o&&a.push(T);return{root:m,replies:a}},[u,o]),C=d==null?void 0:d.threadReplyCount,O=C!==void 0&&C>f.length,A=!p,z=d===void 0||O?-1:(A?1:0)+f.length,S=Ne(f.length,C),M=n.useMemo(()=>new Set(f.map(m=>m.id)),[f]),_=n.useMemo(()=>({replyIds:M,inside:!0}),[M]),B=at(e.id,_),P=Ie(e.id,o),D=on(f,B,R),q=n.useRef(null),H=n.useCallback(m=>{var a;(a=q.current)==null||a.scrollToRow(m)},[]),L=n.useRef(null);n.useEffect(()=>{var m;r||(m=L.current)==null||m.focus()},[o,r]);const K=m=>{m.key!=="Escape"||m.defaultPrevented||(m.stopPropagation(),y())},F=n.useMemo(()=>{const m=[];if(d===void 0){const a=x?"thread-error":R?"thread-orphan":"thread-waiting";m.push({kind:"notice",id:a,at:"",body:null})}else A&&m.push({kind:"message",id:d.id,payload:d,grouping:{position:"only"},author:G(V(d,w),w,b.faces),at:d.createdAt});for(const a of f)m.push({kind:"message",id:a.id,payload:a,grouping:{position:"only"},author:G(V(a,w),w,b.faces),at:a.createdAt});return m},[d,A,f,w,b.faces,x,R]),W=n.useCallback(m=>{if(m.kind==="notice")return t.jsx(an,{kind:m.id});if(m.kind!=="message")return null;const a=m.payload,T=d!==void 0&&a.id===d.id,s=f.findIndex(E=>E.id===a.id),c=t.jsx(oe,{roomId:e.id,entry:a,rowId:J(a.id),roomKind:e.kind,author:m.author,authorRef:w.get(a.authorId),authors:w,viewerAuthorId:e.viewerAuthorId,authorNames:N,reactionFrequents:v,streamStalled:i,isMember:I,grouping:{position:"only"},answers:Ae(a,s<=0?d:f[s-1],E=>(d==null?void 0:d.id)===E?d:f.find(Z=>Z.id===E)),feedPosition:{index:T?1:(d===void 0||!A?0:1)+s+1,total:z}});if(T)return t.jsxs(t.Fragment,{children:[c,t.jsx(ve,{count:S})]});const h=D.get(a.id)??"at-rest";return t.jsx("div",{className:ee(h==="dropped"&&"motion-safe:animate-thread-reply-in",h==="handed-off"&&"motion-safe:animate-reply-settle"),children:c})},[d,A,f,S,D,e.id,e.kind,e.viewerAuthorId,w,N,v,i,I,z]),$=n.useCallback(m=>m.kind==="message"?J(m.id):void 0,[]);return t.jsx(Se,{known:b,children:t.jsx(X.Root,{surface:"room",capabilities:fe,target:k.target,anchor:"rail",children:t.jsxs("section",{ref:L,"aria-label":"Thread","data-testid":"room-thread-panel",tabIndex:-1,onKeyDown:K,className:ee("bg-card flex min-h-0 flex-col outline-none",p?"h-full w-full":"w-full border-l"),children:[p?t.jsxs("header",{className:"flex items-center gap-2 border-b px-1 py-1",children:[t.jsxs("button",{type:"button",onClick:y,"aria-label":`Back to ${Y(e)}`,"data-testid":"room-thread-back",className:"focus-ring text-muted-foreground hover:text-foreground flex h-11 min-w-0 items-center gap-1 rounded px-2 text-sm",children:[t.jsx(it,{"aria-hidden":!0,className:"size-4 shrink-0"}),t.jsx("span",{className:"truncate",children:Y(e)})]}),t.jsx("p",{className:"ml-auto shrink-0 pr-3 text-sm font-medium",children:"Thread"})]}):t.jsxs("header",{className:"flex items-center gap-2 border-b px-3 py-2",children:[t.jsx("button",{type:"button",onClick:y,"aria-label":"Close thread",className:"focus-ring text-muted-foreground hover:text-foreground relative -ml-1 rounded p-1",children:t.jsx(dt,{"aria-hidden":!0,className:"size-4"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm font-medium",children:"Thread"}),t.jsx("p",{className:"text-muted-foreground truncate text-xs",children:Y(e)})]})]}),p&&d!==void 0&&t.jsxs("div",{"data-testid":"room-thread-pinned-root",className:"max-h-[40%] shrink-0 overflow-y-auto border-b pt-2",children:[t.jsx(oe,{roomId:e.id,entry:d,rowId:J(d.id),roomKind:e.kind,author:G(V(d,w),w,b.faces),authorRef:w.get(d.authorId),authors:w,viewerAuthorId:e.viewerAuthorId,authorNames:N,reactionFrequents:v,streamStalled:i,isMember:I,grouping:{position:"only"}}),t.jsx(ve,{count:S})]}),t.jsx(X.Timeline,{ref:q,conversationId:`thread-${o}`,label:`Thread in ${Y(e)}`,busy:!R&&!x,rows:F,renderRow:W,domIdOf:$,...g===void 0?{}:{landOnRow:g},pending:P,viewerAuthorId:e.viewerAuthorId,className:"py-3",feedTestId:"room-thread-feed"}),t.jsx(Pe,{room:e,entries:u,scope:_,laneScope:"thread",stalled:p&&i===!0,unavailable:l,onRetry:p?j:void 0,onScrollToRow:H}),t.jsx(Te,{room:e,threadRootId:o,attachments:k.attachments,focusOnMount:r},o)]})})})}function ve({count:e}){return e===0?null:t.jsxs("div",{"aria-hidden":!0,"data-testid":"room-thread-divider",className:"flex items-center gap-2 px-[var(--msg-padding-x)] pt-1 pb-2",children:[t.jsx("span",{className:"text-muted-foreground shrink-0 text-xs",children:e===1?"1 reply":`${e} replies`}),t.jsx("span",{className:"bg-border h-px flex-1"})]})}const ln=96,un=500;function cn(e){return e.offset.x>ln||e.velocity.x>un}function fn({children:e,onClose:o}){const r=lt()===!0,u=r?{x:0}:{x:"100%"};return t.jsx(ut.div,{"data-testid":"room-thread-sheet",className:"bg-card absolute inset-0 z-10 flex flex-col shadow-xl",initial:u,animate:{x:0},exit:u,transition:r?{duration:0}:{duration:.22,ease:[.32,.72,0,1]},drag:"x",dragDirectionLock:!0,dragConstraints:{left:0,right:0},dragElastic:{left:0,right:.9},dragMomentum:!1,onDragEnd:(v,i)=>{cn(i)&&o()},children:e})}const te="room-thread-split",mn=320,hn=360,pn=40,gn=50,xn=25;function ye(e,o){return o<=0?xn:Math.min(Math.round(e/o*1e3)/10,gn)}function Rn(e){const o=ye(mn,e),r=Math.round((100-ye(hn,e))*10)/10;return{minPct:o,maxPct:r,defaultPct:Math.min(Math.max(pn,o),r)}}function vn(e,o,r){if(e===null||o===null||o<=0)return r.defaultPct;const u=e/o*100;return Math.round(Math.min(Math.max(u,r.minPct),r.maxPct)*10)/10}function yn(e){try{const o=localStorage.getItem(e),r=o===null?NaN:Number(o);return Number.isFinite(r)&&r>0?r:null}catch{return null}}function bn(e,o){try{localStorage.setItem(e,String(Math.round(o)))}catch{}}const jn="react-resizable-panels:room-thread-split";function wn(){try{localStorage.removeItem(jn)}catch{}}function kn(){const[e,o]=n.useState(null),[r,u]=n.useState(null);return{ref:n.useCallback(i=>{if(i===null)return;o(i);const l=()=>u(i.offsetWidth);l();const j=new ResizeObserver(l);return j.observe(i),()=>{j.disconnect(),o(null),u(null)}},[]),element:e,width:r,sizing:Rn(r??0)}}const In=`${te}-room`,be=`${te}-thread`,je=`${te}-handle`,An=4;function Nn({room:e,thread:o,storageKey:r=ft.ROOM_THREAD_WIDTH}){const{ref:u,element:v,width:i,sizing:l}=kn(),[j,R]=n.useState(()=>yn(r)),[x,g]=n.useState(null),p=n.useRef(null),y=vn(j,i,l),w=i===null||(l.maxPct-l.minPct)/100*i<An,k=o!==!1;n.useEffect(wn,[]);const I=n.useRef(!1);n.useLayoutEffect(()=>{var f;I.current&&((f=p.current)==null||f.resize(y))},[y,k]);const b=n.useRef(null),N=()=>{var A;const f=(A=p.current)==null?void 0:A.getSize(),C=b.current;if(b.current=null,f===void 0||i===null||i<=0||C===f)return;const O=Math.round(f/100*i);R(O),bn(r,O)},d=x??y;return n.useLayoutEffect(()=>{const f=v==null?void 0:v.querySelector(`[data-panel-resize-handle-id="${je}"]`);f&&(f.setAttribute("aria-controls",be),f.setAttribute("aria-valuenow",String(Math.round(d))),f.setAttribute("aria-valuemin",String(Math.round(l.minPct))),f.setAttribute("aria-valuemax",String(Math.round(l.maxPct))))}),t.jsx("div",{ref:u,className:"h-full overflow-hidden",children:t.jsxs(ct,{direction:"horizontal",id:te,onLayout:f=>{I.current=f.length>1,g(I.current?f[1]:null)},children:[t.jsx(pe,{id:In,order:1,className:"flex",children:e}),k&&t.jsxs(t.Fragment,{children:[t.jsx(vt,{id:je,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:w,onDragging:f=>{var C;f&&(b.current=((C=p.current)==null?void 0:C.getSize())??null)},onKeyDownCapture:f=>{var C,O;w||(b.current=((C=p.current)==null?void 0:C.getSize())??null,!(f.key!=="Home"&&f.key!=="End")&&(f.preventDefault(),(O=p.current)==null||O.resize(f.key==="Home"?l.minPct:l.maxPct)))},onResizeEnd:N}),t.jsx(pe,{ref:p,id:be,order:2,defaultSize:y,minSize:l.minPct,maxSize:l.maxPct,className:"flex",children:o})]})]})})}function Fn({roomId:e,threadId:o,entrySeq:r,threadRoute:u,aboveTimeline:v,aboveComposer:i,offerJumpBackIn:l,onComposerFocusChange:j}){const R=mt(),x=yt(),g=ht(e),p=g==null?void 0:g.rootEntryId,y=Vt(),w=n.useCallback(()=>{var a;const m=(a=U.getState().open[e])==null?void 0:a.rootEntryId;U.getState().closeThread(e),m!==void 0&&y.arm(m)},[e,y]),k=n.useCallback(m=>{U.getState().openThread(e,m)},[e]),I=pt(e),b=gt(e),N=wt(e,b.isSuccess);kt(e);const d=I.data,f=n.useMemo(()=>b.data??[],[b.data]),C=Me({room:d});Zt({roomId:e,route:u,urlThreadId:o,openThreadId:p,entries:f,historyLoaded:b.isSuccess});const O=n.useMemo(()=>{var m;return((m=d==null?void 0:d.members.find(a=>a.author.id===d.viewerAuthorId))==null?void 0:m.lastReadSeq)??null},[d]),A=Xt(e,O);xt(d,f);const z=n.useRef(null),S=n.useRef(void 0),M=n.useCallback(m=>{S.current=m},[]),_=n.useCallback(()=>S.current,[]);n.useLayoutEffect(()=>{S.current=void 0},[e]);const B=n.useCallback(m=>{var a;(a=z.current)==null||a.scrollToRow(m)},[]),P=qt(e),{loadOlder:D,cursor:q}=P,H=n.useCallback(()=>{const m=Ct(f,q);D().then(()=>{m!==null&&requestAnimationFrame(()=>{var a;return(a=z.current)==null?void 0:a.scrollToRow(m.domId)})})},[f,q,D]),L=Ut({roomId:e,entrySeq:r,entries:f,historyLoaded:b.isSuccess}),K=n.useMemo(()=>p===void 0?void 0:{replyIds:new Set(f.filter(a=>ce(a)===p).map(a=>a.id)),inside:!1},[f,p]);if(I.isLoading)return t.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:t.jsx(Ee,{})});if(I.isError||!d)return 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("p",{className:"text-foreground font-medium",children:"That channel or DM isn’t here"}),t.jsx("p",{className:"max-w-sm",children:"It may be archived, or the link is old."})]});const F=g!==void 0&&t.jsx(dn,{room:d,rootEntryId:g.rootEntryId,focusComposer:g.focusComposer,entries:f,reactionFrequents:d.reactionFrequents,streamStalled:N.stalled,streamUnavailable:N.unavailable,onRetryStream:N.retry,historyLoaded:b.isSuccess,historyFailed:b.isError,...L.threadRow===void 0?{}:{landOnRow:L.threadRow},pushed:R,onClose:w},g.rootEntryId),W=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[v,t.jsx(Gt,{ref:z,roomId:d.id,roomKind:d.kind,roomName:Y(d),viewerAuthorId:d.viewerAuthorId,entries:f,members:d.members,formerAuthors:d.formerAuthors,lastReadSeq:A,reactionFrequents:d.reactionFrequents,streamStalled:N.stalled,isLoading:b.isLoading,error:b.error,onAddAgents:()=>ge("add",d.id),openThreadId:p,onOpenThread:k,resumeRow:_,...L.roomRow===void 0?{}:{landOnRow:L.roomRow},onTopRow:M,canLoadOlder:P.canLoadOlder,isLoadingOlder:P.isLoadingOlder,onLoadOlder:H}),i,t.jsx(tn,{roomId:d.id}),t.jsx(nn,{roomId:d.id}),t.jsx(Pe,{room:d,entries:f,scope:K,laneScope:"room",stalled:N.stalled,unavailable:N.unavailable,onRetry:N.retry,onScrollToRow:B}),t.jsx(en,{room:d,hasEntries:f.length>0,onAddAgents:()=>ge("add",d.id)}),t.jsx(Te,{room:d,attachments:C.attachments,offerJumpBackIn:l,onFocusChange:j},d.id)]}),$={surface:"room",capabilities:fe,target:C.target,anchor:"rail"};return R?t.jsx(X.Root,{...$,children:t.jsx("div",{style:{paddingBottom:x},"data-testid":"room-surface",className:"flex h-full flex-col overflow-hidden",children:t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col overflow-hidden",children:[t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",inert:F!==!1,"data-testid":"room-under-thread",children:W}),t.jsx(Rt,{initial:!1,children:F!==!1&&t.jsx(fn,{onClose:w,children:F},`thread-${p}`)})]})})}):t.jsx(X.Root,{...$,children:t.jsx(Nn,{room:W,thread:F})})}export{Fn as R,$t as T,Ee as a};