dorkos 0.124.0 → 0.124.1
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.
- package/dist/bin/cli.js +935 -551
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-BH8Ndn3e.js → AboutPage-DHaZvsJE.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-K5Mew9EX.js → ActivityErrorState-BP-qFk2S.js} +1 -1
- package/dist/client/assets/{ActivityPage-BB20L5HU.js → ActivityPage-Bme3TzdQ.js} +1 -1
- package/dist/client/assets/{ActivityRow-C5O7rnmS.js → ActivityRow-BRZyW9MA.js} +1 -1
- package/dist/client/assets/{AdapterIcon-Bmybvrzb.js → AdapterIcon-BcfquTja.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-CkdV7Hhh.js → AdapterSetupWizard-B4I23pBg.js} +1 -1
- package/dist/client/assets/{AgentOptionRow-BA2cDa7r.js → AgentOptionRow-Cb34LtmH.js} +1 -1
- package/dist/client/assets/{AgentPicker-CsIIPGZJ.js → AgentPicker-ouNRFSDh.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-0fOxvaoe.js → AgentRequestCard-B6MHIsxa.js} +2 -2
- package/dist/client/assets/{AppearancePage-XOjkkoli.js → AppearancePage-CutehigK.js} +1 -1
- package/dist/client/assets/ApplyToOverridesDialog-B-wIUI27.js +1 -0
- package/dist/client/assets/{AttentionSignalRow-CjjZobp7.js → AttentionSignalRow-B1aMjgX_.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-9TVHyRPJ.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-CdWF4WLz.js} +1 -1
- package/dist/client/assets/{BindingDialog-DLoAQauL.js → BindingDialog-BAdueON5.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-CYHsXAcY.js → BlintzCanvas-b30dG4gx.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent--Gr7Fe_U.js → CanvasCsvContent-DGHgSikG.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-estXyAbr.js → CanvasFileContent-D1bFaUeh.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-CkOo930M.js → CanvasModel3dContent-dST7g1v2.js} +2 -2
- package/dist/client/assets/{ChatAppsOff-D4L1zJVN.js → ChatAppsOff-DiObvmJS.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-DY_6ju-z.js → CodeMirrorDiff-BncI1OY1.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BUoDBsBv.js → CodeMirrorEditor-DV6psv19.js} +1 -1
- package/dist/client/assets/{CommitmentList-wDkcVP9c.js → CommitmentList-Dx_Ek_Gl.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-CzSM6b8R.js → CommitmentsPage-Bca8NMUa.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-cERD9H2L.js → ComputerResourceView-DNVNFTdn.js} +1 -1
- package/dist/client/assets/{ComputerViewer-rMcfbk2_.js → ComputerViewer-D8SxJdMm.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-f7QeQbQo.js → ConnectionAccessLists-Bhj1YT15.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-BmjtA6pw.js → ConnectionsPage-B20JZxoK.js} +1 -1
- package/dist/client/assets/{ConventionPage-CH-ah6nI.js → ConventionPage-De645wxU.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-CJIxa6ST.js → ExtensionPageRoute-nTeiOBRQ.js} +1 -1
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-BP7EJ2JL.js → FloatingTanStackRouterDevtools-CqogiFob-DM79UITv.js} +1 -1
- package/dist/client/assets/HandlePage-B08V-om7.js +1 -0
- package/dist/client/assets/{HeartbeatPage-BUsf-qrU.js → HeartbeatPage-CBoUxz6t.js} +1 -1
- package/dist/client/assets/{KeyEntry-C2kWdN8q.js → KeyEntry-Cug8ocpX.js} +1 -1
- package/dist/client/assets/{LexicalField-CR8ulsI_.js → LexicalField-Bv_ogmAq.js} +1 -1
- package/dist/client/assets/{ManagesPage-DTtsIOGi.js → ManagesPage-DfJBQKK3.js} +1 -1
- package/dist/client/assets/{Marketplace-iaV5XAzv.js → Marketplace-swCVUbdY.js} +2 -2
- package/dist/client/assets/{MarketplaceSourcesView-6tgzUfFj.js → MarketplaceSourcesView-CDZDChpV.js} +1 -1
- package/dist/client/assets/{McpAppFrame-C7eYYdI9.js → McpAppFrame-BM9cNPPd.js} +1 -1
- package/dist/client/assets/{McpSigninBody-BDyGbJ7I.js → McpSigninBody-DKyUKrEE.js} +1 -1
- package/dist/client/assets/{Model3dViewer-BujDNuVS.js → Model3dViewer-rXSL5y2P.js} +1 -1
- package/dist/client/assets/NamePage-JwMDK1JD.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-D4e-z2Jt.js → NewDirectMessageMenu-GCEMS5oV.js} +1 -1
- package/dist/client/assets/{NotificationsPage-CkDeTaJp.js → NotificationsPage-DSWsOVLa.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-CtbOt3r5.js → OpenMeshSwitch-BTuctDj4.js} +1 -1
- package/dist/client/assets/{OperatorIdentityForm-Vr4qZnmM.js → OperatorIdentityForm-ODDMd2YN.js} +1 -1
- package/dist/client/assets/PermissionHistory-41a58Se7.js +1 -0
- package/dist/client/assets/{PermissionsPage-f4QaX8oM.js → PermissionsPage-DefmymZ6.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-BkZruwF-.js → PersonalityPopover-7zPVBI1I.js} +1 -1
- package/dist/client/assets/PhotoPage-DlOVhkW9.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-BXC2K0tx.js → PreviewRefusedNotice-CwGlBJ7U.js} +1 -1
- package/dist/client/assets/{ProfileFields-BebX5oiv.js → ProfileFields-DVMkpJSb.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-DZoL65zQ.js → ProfilePanelContainer-RrhoPD3T.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-D9H7wsuT.js → ProfileRolePicker-CXRVBCAu.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-B5fDmc-g.js → PromptSuggestionChips-bBroJdTi.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-uVYhSqj7.js → ReportsToPopover-CfPatsWM.js} +1 -1
- package/dist/client/assets/{RoomSurface-Bg5WV4Ep.js → RoomSurface-CdgCdV6h.js} +11 -11
- package/dist/client/assets/{RoomsPage-yflYFulU.js → RoomsPage-C3dDp1Mb.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-DtGrX1Vq.js → RunsOnPopover-BcKjfQi-.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-DjReuQ-T.js → RuntimeConnectFlow-DCIRnvOH.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-Cr4GRi8c.js → RuntimeSetupDialog-Bg-0b-LC.js} +1 -1
- package/dist/client/assets/SeenDevices-nMsGUQTv.js +19 -0
- package/dist/client/assets/{SessionsPage-BWu-en78.js → SessionsPage-Cqfx4FGW.js} +1 -1
- package/dist/client/assets/SettingsDialog-C8r2igJ_.js +12 -0
- package/dist/client/assets/{SkillsPage-BdUb9SZy.js → SkillsPage-BleHQavF.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-qYJPEoSR.js → TaskDialogWrapper-BhTEvf-u.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-Bgcg9vxF.js → TasksEmptyState-Bprx1k8M.js} +2 -2
- package/dist/client/assets/{TasksPage-Ch5W2WQS.js → TasksPage-Dub39yEJ.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-CPwSIMRw.js → TeamComputerEntry-CJ-NG0u5.js} +1 -1
- package/dist/client/assets/ToolsPage-IsD6M-ZW.js +2 -0
- package/dist/client/assets/{TopologyGraph-I4_mkMHM.js → TopologyGraph-CwyasvFI.js} +14 -14
- package/dist/client/assets/{TourHost-BPaSwh9I.js → TourHost-BYfztuPb.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-BUWZUu5P.js → UnlinkDialog-BKhgxVdF.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-cS8yMCxU.js → WidgetErrorCard-1NyzIJBj.js} +6 -6
- package/dist/client/assets/_shell-Ct2Bz7D0.js +80 -0
- package/dist/client/assets/{_shell._home-DCA5k-jb.js → _shell._home-xWj7wO5z.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-BX4nFLna.js → _shell._home.activity-BqcLoaB1.js} +1 -1
- package/dist/client/assets/{_shell._home.index-C8t8cw72.js → _shell._home.index-D4sQsKKk.js} +1 -1
- package/dist/client/assets/{_shell._home.tasks-BgUeEvhK.js → _shell._home.tasks--UhQB6h3.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-BPBdnkRt.js → _shell._home.workspaces-BPFD8Of2.js} +1 -1
- package/dist/client/assets/{_shell.channels-CX4kki7G.js → _shell.channels-CnFdvRzc.js} +4 -4
- package/dist/client/assets/{_shell.connections-0vP7g7E4.js → _shell.connections-Ik01wS5M.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-TsuaO4eR.js → _shell.feedback-requests-Czu42kzo.js} +1 -1
- package/dist/client/assets/_shell.marketplace-Cezv-i16.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-BTENmr4W.js +1 -0
- package/dist/client/assets/_shell.session-BjevHF_O.js +63 -0
- package/dist/client/assets/{_shell.team-Bm6cOBhR.js → _shell.team-UfaJqohh.js} +3 -3
- package/dist/client/assets/_shell.x._extensionId-0OO_Xr72.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-0OO_Xr72.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-CrvoN15x.js → abnfDiagram-WEYOIA3C-oxkfGyl6.js} +1 -1
- package/dist/client/assets/{access-copy-B3yNZ7Gz.js → access-copy-Dggxx2cX.js} +1 -1
- package/dist/client/assets/{arc-CuT6QA_y.js → arc-CqQdP0Qe.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-CPXCZ9H4.js → architectureDiagram-ZHVYKT53-89xM7zJD.js} +1 -1
- package/dist/client/assets/{banner-DRumuw3F.js → banner-DqJ2pM0Y.js} +1 -1
- package/dist/client/assets/{blockDiagram-RJAE7QA3-CM0rka9p.js → blockDiagram-RJAE7QA3-CcxwDmZC.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-D4j2cXRy.js → c4Diagram-XDPPPE54-DCIhIyXa.js} +1 -1
- package/dist/client/assets/{card-B3CtfC3R.js → card-DT-vFAns.js} +1 -1
- package/dist/client/assets/channel-Ngk70nQZ.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-KGyqhVpO.js → chunk-2E7WHVMD-BfWEXcCj.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-Dl0BHoqK.js → chunk-2Q5K7J3B-KLXLZXlR.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-Da7vH6Kv.js → chunk-4EMNKR2T-CL5Gttmj.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-DgBUEROO.js → chunk-55XCU76K-cfAl84Mv.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-BQ4mn-_I.js → chunk-5VM5RSS4-BqUyGgoH.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-8LPR3mXf.js → chunk-JWPE2WC7-BWr2ST9i.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-BkIVXi4W.js → chunk-VQ5W62QI-V5zYx50O.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-DQXJx06h.js → chunk-XXDRQBXY-gnvheN_J.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-DzCE7qlD.js → chunk-ZCHMQSOR-ClGxxZvV.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-C_cZra7c.js → classDiagram-v2-4MYWR3UA-DvmHzDb5.js} +1 -1
- package/dist/client/assets/{command-CDKbyppr.js → command-CNx4L11m.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-DlXHdGwT.js → cose-bilkent-JH36ORCC-Df8nXBRj.js} +1 -1
- package/dist/client/assets/{cpu-B7xLO7jn.js → cpu-D8KJEkdh.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-HhP4ArLc.js → cynefin-EF2NZ3EQ-CAn6ufHs.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-D4GgWnZV.js → cynefinDiagram-WF24UDRP-Cep_NrRw.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-SZ_OI2Zi.js → dagre-NK4GIZVX-sWD3z9wf.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-BN-_Ja5m.js → diagram-CBK3MWTC-CUpaBATr.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D-t7AK6xnL.js → diagram-I5XIIV2D-BejWB2ry.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-C1V7szSc.js → diagram-ODIL2UCW-BGKJfNk9.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-DPtraQ2g.js → diagram-PFBEJUXE-V0dP8H8k.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-D2XNRB2b.js → diagram-RJA3I4VV-Bf5dVsFX.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-BieaRy38.js → diagram-TYUNFSNR-CLrMSqb4.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-Bwki86UY.js → ebnfDiagram-V4P3TTPT-BGG4CWA0.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-WEXSAyHB.js → elk-QONTBCTQ-bf9D6f0w.js} +1 -1
- package/dist/client/assets/{empty-state-J-UJ0BUU.js → empty-state-CDoXnrKn.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-DIKASnoc.js → erDiagram-KYQIGQAA-fEUv-33P.js} +1 -1
- package/dist/client/assets/{execution-config-ILQiJAmy.js → execution-config-Ca9MDOtV.js} +1 -1
- package/dist/client/assets/{file-D40js1Zx.js → file-CiyVL55_.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-Dg3ZpiAe.js → file-exclamation-point-DaFRIKco.js} +1 -1
- package/dist/client/assets/{file-text-DgdvRfMk.js → file-text-DsnD-A8g.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-D4kBWC_1.js → find-latest-widget-fence-CNsnCgbB.js} +1 -1
- package/dist/client/assets/{flowDiagram-IUGLLWBU-CoavNw0M.js → flowDiagram-IUGLLWBU-CRbeSDod.js} +1 -1
- package/dist/client/assets/{form-DlPwEgQH.js → form-Cru78aT-.js} +1 -1
- package/dist/client/assets/{format-cron-BrK8RzgT.js → format-cron-9K38-tn1.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-DccKAz7f.js → ganttDiagram-R7GPNTJY-Mkk7zgs_.js} +1 -1
- package/dist/client/assets/{git-branch-BpxhecMq.js → git-branch-CONwEYiR.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-DEbo_dgQ.js → gitGraphDiagram-PDYL7XHY-Drre0vyA.js} +1 -1
- package/dist/client/assets/{graph-DROgI3M3.js → graph-BJlnKWgo.js} +1 -1
- package/dist/client/assets/{heart-c7u4Ezxt.js → heart-CqwUlIUG.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-CrATNdTR.js → highlighted-body-KPVGNVTW-e4LXC_pS.js} +1 -1
- package/dist/client/assets/{image-lightbox-DE_fHkw-.js → image-lightbox-DHDtzoja.js} +1 -1
- package/dist/client/assets/{image-off-BExgZjfM.js → image-off-DZuLkaRJ.js} +1 -1
- package/dist/client/assets/{index-D0eJtRlK.js → index-1yEXEZiH.js} +1 -1
- package/dist/client/assets/{index-Be0OJLWK.js → index-A41zxoWk.js} +1 -1
- package/dist/client/assets/{index-DeRDq7bD.js → index-B25gvCK_.js} +1 -1
- package/dist/client/assets/index-B9bZYNKR.js +1 -0
- package/dist/client/assets/{index-DaZ1I8s-.js → index-BBmkfbXd.js} +1 -1
- package/dist/client/assets/{index-DNGNMW3c.js → index-BDD2EyoW.js} +1 -1
- package/dist/client/assets/{index-Ccf1XBTs.js → index-BFNy-Yp3.js} +1 -1
- package/dist/client/assets/{index-DksjixUS.js → index-BIB-maE5.js} +1 -1
- package/dist/client/assets/{index-CbHCZsbE.js → index-BKp2B9JS.js} +1 -1
- package/dist/client/assets/{index-DCJQGDZk.js → index-BLP5O7X9.js} +1 -1
- package/dist/client/assets/{index-DhHobJd3.js → index-BTjZIgFn.js} +1 -1
- package/dist/client/assets/{index-BVqSmajJ.js → index-BV2Ezdxv.js} +1 -1
- package/dist/client/assets/{index-C7B3eSOP.js → index-B_0LYi32.js} +1 -1
- package/dist/client/assets/{index-DDgOoXP1.js → index-Bd7vUYhr.js} +1 -1
- package/dist/client/assets/{index-BlyoyIck.js → index-Bo7x9IkO.js} +1 -1
- package/dist/client/assets/{index-D150FXCC.js → index-BtDxwJsM.js} +1 -1
- package/dist/client/assets/{index-DswGXheF.js → index-By58MgcZ.js} +1 -1
- package/dist/client/assets/index-C3cvP8Fo.js +1033 -0
- package/dist/client/assets/{index-C5or4L_3.js → index-CVuEUzi5.js} +1 -1
- package/dist/client/assets/{index-BkoMsjtM.js → index-CoWJD3Jg.js} +2 -2
- package/dist/client/assets/{index-CqPRAM_6.js → index-CyVH876g.js} +1 -1
- package/dist/client/assets/{index-BGqvci3k.js → index-D67Kfy-M.js} +1 -1
- package/dist/client/assets/{index-D3YeRrne.js → index-DAlpmAIA.js} +1 -1
- package/dist/client/assets/{index-BEkYBuOq.js → index-DDNwNOHF.js} +1 -1
- package/dist/client/assets/{index-CD8aw6Jb.js → index-DL8ISRMH.js} +1 -1
- package/dist/client/assets/{index-AzyLwYS_.js → index-DabU6r9W.js} +3 -3
- package/dist/client/assets/{index-CT_pFeX_.js → index-DdJBZE0H.js} +1 -1
- package/dist/client/assets/{index-B3eeEDWj.js → index-DijWcSDZ.js} +1 -1
- package/dist/client/assets/index-DyRGZyur.css +1 -0
- package/dist/client/assets/{index-DINk1YfD.js → index-DzwZJuO1.js} +1 -1
- package/dist/client/assets/{index-CZmqtJWZ.js → index-HR8BYVRQ.js} +1 -1
- package/dist/client/assets/{index-J3Hh1MnL.js → index-LEcodwyW.js} +1 -1
- package/dist/client/assets/index-UPF8suf2.js +1 -0
- package/dist/client/assets/{index-DT7pv2iW.js → index-Vz7VUm9l.js} +1 -1
- package/dist/client/assets/index-YW-v746p.js +1 -0
- package/dist/client/assets/{index-2wezsLA_.js → index-cI2u8WZS.js} +1 -1
- package/dist/client/assets/{index-InEBtYxw.js → index-iTQUa_b2.js} +6 -6
- package/dist/client/assets/{index-CYy1cjtq.js → index-mZqojApH.js} +1 -1
- package/dist/client/assets/{index-dyAahqKe.js → index-pVFjKNjX.js} +1 -1
- package/dist/client/assets/{index-DxiRRZRo.js → index-skAhJyIF.js} +1 -1
- package/dist/client/assets/{index-BizvylBV.js → index-vJy88bwb.js} +1 -1
- package/dist/client/assets/index-wY5OcS4a.js +43 -0
- package/dist/client/assets/{index-mwf7ZNk2.js → index-x1yAu9zJ.js} +1 -1
- package/dist/client/assets/{index-F-vqXYqa.js → index-xAgihCJ7.js} +1 -1
- package/dist/client/assets/{index.esm-BFJ9SG0n.js → index.esm-BUPoRUaG.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-VL8q5pKx.js → infoDiagram-MVDRKAX5-B_Wyzufh.js} +1 -1
- package/dist/client/assets/{inline-code-BE9ckzPs.js → inline-code-BIzGDx6z.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-BLKkPYF-.js → ishikawaDiagram-HPEHV2GE-BDk2-6Pd.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-CSYpRobu.js → journeyDiagram-BOSHW7O7-7qf9KWEQ.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-HilAqtZo.js → kanban-definition-FNSA4HC5-CFYDQmXn.js} +1 -1
- package/dist/client/assets/{layers-Cm7coqdo.js → layers-C9tVVcXg.js} +1 -1
- package/dist/client/assets/{lightbulb-DqdWS75d.js → lightbulb-f4jtsAh0.js} +1 -1
- package/dist/client/assets/{link-2-CDJapTSa.js → link-2-ZNlK1BG1.js} +1 -1
- package/dist/client/assets/{list-runtime-types-CP82p1u4.js → list-runtime-types-CqO-QFYD.js} +1 -1
- package/dist/client/assets/{markdown-content-m_qereFc.js → markdown-content-DaEVxezf.js} +1 -1
- package/dist/client/assets/{mention-pill-DV5HIG5Q.js → mention-pill-BiCPflY-.js} +1 -1
- package/dist/client/assets/{mermaid.core-zxW6MBr-.js → mermaid.core-SX8SzrsU.js} +4 -4
- package/dist/client/assets/{message-square-off-YVtpbaJ0.js → message-square-off-_qbedNGF.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-IAYemvOg.js → mindmap-definition-6OY57UG3-BloJIArH.js} +1 -1
- package/dist/client/assets/{more-details-ReA2ZFBn.js → more-details-CdJT0Ehl.js} +1 -1
- package/dist/client/assets/{owner-notice-M4hn_1ep.js → owner-notice-BDafFD_I.js} +1 -1
- package/dist/client/assets/{package-CUuTl39E.js → package-Cb7lEm7t.js} +1 -1
- package/dist/client/assets/{page-container-BnmNikNZ.js → page-container-DsRgIMAL.js} +1 -1
- package/dist/client/assets/{paperclip-C6fYq5Zf.js → paperclip-DNu1VtoX.js} +1 -1
- package/dist/client/assets/{path-input-DHn9-XaE.js → path-input-D3O71b-X.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-CojaUwe7.js → pegDiagram-ECIUJNBX-Di48kPNu.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-CjP3pw6V.js → pieDiagram-GNMPY74T-DY8B_SPD.js} +1 -1
- package/dist/client/assets/{plug-DHQcxt7N.js → plug-IIS_cL9-.js} +1 -1
- package/dist/client/assets/{primer-trigger-BmV5wjek.js → primer-trigger-DurKYe8C.js} +2 -2
- package/dist/client/assets/{profile-errors-BSCuj3rT.js → profile-errors-BdhZfdvZ.js} +1 -1
- package/dist/client/assets/{progress-4FQQfnS6.js → progress-g5kkqvlR.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-OP0Z8zcR.js → quadrantDiagram-D57K4MC3-Depv_dON.js} +1 -1
- package/dist/client/assets/{query-error-state-BkUdxenP.js → query-error-state-PuLGD7Jp.js} +1 -1
- package/dist/client/assets/{radio-ta5Bw763.js → radio-QOLZSBz1.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-CT3NCb9b.js → railroadDiagram-Y72NRBL7-BfD2AiZM.js} +1 -1
- package/dist/client/assets/registry-Ck8p6n1T.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-DwUuyxao.js → relay-trace-schemas-DF_DfZ7s.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-tde4lYGp.js → requirementDiagram-EQYSW5RA-B1iTjrkD.js} +1 -1
- package/dist/client/assets/{room-files-source-CZWhaaOy.js → room-files-source-g1th8mWs.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-RfbbgUa4.js → rotate-ccw-clock-BGwYMaGL.js} +1 -1
- package/dist/client/assets/{rotate-cw-B3rB_YSw.js → rotate-cw-B4Y0q4GY.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-sdCzIA7-.js → sankeyDiagram-SY24JHO5-D5TzVJrQ.js} +1 -1
- package/dist/client/assets/{scroll-area-B4WB7Q40.js → scroll-area-BvScZKSa.js} +1 -1
- package/dist/client/assets/{search-x-DCUmWW2_.js → search-x-CqN5twBj.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-DvzTJcKu.js → sequenceDiagram-BLEHNHQU-BhUahaNf.js} +1 -1
- package/dist/client/assets/{shield-x-CANziVLc.js → shield-x-DHJrwtKp.js} +1 -1
- package/dist/client/assets/signed-in-BmywDpR5.js +1 -0
- package/dist/client/assets/{sizeCapture-INFHLROL-DuDA7TKE.js → sizeCapture-INFHLROL-D2Vi1Kq9.js} +1 -1
- package/dist/client/assets/{soul-file-Co_8f1qw.js → soul-file-BMpVFN7U.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-BJPX5JTC.js → stateDiagram-v2-A6IESKWZ-b9gSbZnF.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-CiLSffGv.js → swimlanes-B3ENRKFQ-i47jxLY6.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-CA9gW19w.js +8 -0
- package/dist/client/assets/{table-BSAvOYPp.js → table-CN2HCi4p.js} +1 -1
- package/dist/client/assets/{terminal-6CdY-T1V.js → terminal-BORQniao.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-5oq8sl82.js → timeline-definition-JXYKGLGB-eY5gj0js.js} +1 -1
- package/dist/client/assets/{trust-posture-D-Yjm6ot.js → trust-posture-Bcyy5Fub.js} +1 -1
- package/dist/client/assets/{unplug-Bq_1WdV7.js → unplug-lkD35Rwp.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-CEzu54YH.js → unverified-catalog-notice-DiCIrrhU.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-Tn3ZbPAj.js → use-adapter-catalog-BrqVd-47.js} +1 -1
- package/dist/client/assets/{use-bindings-Bz9YRgO7.js → use-bindings-CU2RSXOy.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-D9oKJSQN.js → use-composer-prefs-Dy2oTM8Y.js} +1 -1
- package/dist/client/assets/{use-connector-management-CLYFraXN.js → use-connector-management-5oRqzydY.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-DkS713kG.js → use-deep-link-scroll-Bg5nW8qq.js} +1 -1
- package/dist/client/assets/{use-delete-binding-CukKpHBK.js → use-delete-binding-qeyRkvR1.js} +1 -1
- package/dist/client/assets/{use-dev-links-DQ32IcGe.js → use-dev-links-FY4J_PjA.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-D-FO_XW6.js → use-external-adapter-catalog-HiWFZZrW.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-BNxcyb1j.js → use-full-activity-feed-K1uk9Wya.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-Cu_jKnft.js +1 -0
- package/dist/client/assets/use-is-hub-BX7ypNRJ.js +1 -0
- package/dist/client/assets/{use-jump-back-in-Bibj5tVk.js → use-jump-back-in-BjZ8EswV.js} +1 -1
- package/dist/client/assets/{use-local-browser-xg7WXAVK.js → use-local-browser-CTFiF0wf.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-BgCSFw8s.js → use-mesh-topology-CafidaIH.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-qRbdZfOU.js → use-mounted-ref-B38uSLCx.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-B-4kZR7I.js → use-notification-prefs-m9XSNB6W.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-CCq-mZlY.js → use-panel-tab-placements-D9n6rNJ1.js} +1 -1
- package/dist/client/assets/use-pending-read-BoV-UI1E.js +1 -0
- package/dist/client/assets/{use-personality-commit-DwSisUfF.js → use-personality-commit-ChLQfLrK.js} +1 -1
- package/dist/client/assets/{use-promo-activation-Botoso6l.js → use-promo-activation-DbJDgp4_.js} +1 -1
- package/dist/client/assets/{use-promo-dismissals-RJXp-r_J.js → use-promo-dismissals-Csw0j0N0.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-B3390hGg.js → use-pulse-freshness-BIZ7daHW.js} +1 -1
- package/dist/client/assets/{use-relay-config-BV0xcLwS.js → use-relay-config-hUB3lVFv.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-Du4hKHIJ.js → use-room-follow-claim-BpKzhniV.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-g2hO6Ruz.js → use-roving-tab-list-BtM0bZL7.js} +1 -1
- package/dist/client/assets/{use-session-canvas-i30oMO_Q.js → use-session-canvas-DRrkNRcL.js} +3 -3
- package/dist/client/assets/use-session-diagnostics-BTNgouum.js +16 -0
- package/dist/client/assets/{use-unclaimed-chats-B92om889.js → use-unclaimed-chats-BbMZtNG9.js} +1 -1
- package/dist/client/assets/use-update-config-CkWwKNkY.js +1 -0
- package/dist/client/assets/{useMutationState-DdOGdpjP.js → useMutationState-CVpvw27W.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-Di5pJvcw.js → usecaseDiagram-WPOLBNNX-CHcpeLg4.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-K7KAf26T.js → vennDiagram-Q3Y3IDCW-gQbZL_A6.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-DVTaxQt9.js → wardleyDiagram-IVAIDKWA-BFH_WHzZ.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-x-lSJm_B.js → xychartDiagram-4URNHDU4-B0QpyqeZ.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261019185620_dor3037_wifi_holds.sql +8 -0
- package/dist/drizzle/meta/20261019185620_snapshot.json +14079 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/server/extension-child.cjs +18 -2
- package/dist/server/index.js +55523 -26605
- package/dist/server/index.js.map +2 -2
- package/package.json +6 -6
- package/dist/client/assets/ApplyToOverridesDialog-CoO6V1G4.js +0 -1
- package/dist/client/assets/HandlePage-Cg8H3mQS.js +0 -1
- package/dist/client/assets/NamePage-Bx8T98OF.js +0 -1
- package/dist/client/assets/PermissionHistory-DzU1rf2B.js +0 -1
- package/dist/client/assets/PhotoPage-CmrOIRjf.js +0 -1
- package/dist/client/assets/SeenDevices-SPWkdzoK.js +0 -19
- package/dist/client/assets/SettingsDialog-_dEXUhHe.js +0 -12
- package/dist/client/assets/ToolsPage-Idimrn3o.js +0 -2
- package/dist/client/assets/_shell-ClVN2pUj.js +0 -80
- package/dist/client/assets/_shell.marketplace-CiL6YRbl.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-C0sI8e21.js +0 -1
- package/dist/client/assets/_shell.session-_hhBvFc6.js +0 -63
- package/dist/client/assets/_shell.x._extensionId-BWy5v1YE.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-BWy5v1YE.js +0 -1
- package/dist/client/assets/channel-DjBlTcCV.js +0 -1
- package/dist/client/assets/index-7jby-RRg.js +0 -1
- package/dist/client/assets/index-BqIHtiaE.js +0 -1
- package/dist/client/assets/index-Cga0qx1T.js +0 -1033
- package/dist/client/assets/index-Ct4At33X.js +0 -1
- package/dist/client/assets/index-DITPwUa9.js +0 -38
- package/dist/client/assets/index-DUZrTFYD.css +0 -1
- package/dist/client/assets/registry-Dc102rws.js +0 -1
- package/dist/client/assets/signed-in-DctJ2IWe.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-Dv1-QS9J.js +0 -8
- package/dist/client/assets/use-is-below-desktop-gTvJDvw4.js +0 -1
- package/dist/client/assets/use-is-hub-B1vPpkYU.js +0 -1
- package/dist/client/assets/use-pending-read-C8L_v4Zw.js +0 -1
- package/dist/client/assets/use-session-diagnostics-a4b83F5J.js +0 -16
- package/dist/client/assets/use-update-config-Tbn3SodN.js +0 -1
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{W as Z,r as i,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DijWcSDZ.js","assets/index-C3cvP8Fo.js","assets/index-DyRGZyur.css","assets/room-files-source-g1th8mWs.js","assets/markdown-content-DaEVxezf.js","assets/file-exclamation-point-DaFRIKco.js","assets/query-keys-DeYqUDia.js","assets/composer-insert-BpyATrmR.js","assets/index-pVFjKNjX.js","assets/file-drag-GDx2qhdk.js","assets/rotate-cw-B4Y0q4GY.js","assets/link-2-ZNlK1BG1.js","assets/file-CiyVL55_.js","assets/git-branch-CONwEYiR.js","assets/more-details-CdJT0Ehl.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{W as Z,r as i,n6 as Ut,j as a,g as qt,ir as Wt,G as V,a1 as ne,a2 as Kt,bk as ee,a4 as re,a3 as Ae,n7 as Gt,n8 as ye,n9 as He,na as Vt,nb as Xt,nc as Yt,lZ as Qt,nd as Jt,l$ as Zt,ne as en,dB as tn,gb as nn,nf as sn,n3 as on,ng as rn,a0 as an,bw as ln,nh as dn,ni as cn,iP as un,hL as mn,iE as X,kv as Ue,nj as ot,bK as fn,ku as le,kz as rt,nk as pn,kA as at,ai as hn,bO as it,hG as lt,B as Se,x as gn,nl as xn,c6 as Ce,nm as yn,s as ce,es as bn,jk as dt,nn as ct,aX as vn,e as se,no as he,hf as ut,ky as mt,np as kn,nq as Rn,n as wn,q as Re,kx as In,nr as ft,eQ as te,a7 as pt,fp as Nn,ns as jn,nt as An,nu as Sn,nv as Cn,l as ht,ar as Me,ki as Mn,aj as On,nw as Tn,nx as _n,ny as En,b6 as Pn,bW as $n,nz as Dn,nA as Fn,nB as Ln,nC as zn,bx as we,dJ as Bn,ko as Hn,kt as Un,km as qn,nD as Wn,nE as Kn,nF as Gn,nG as Vn,eP as Xn,kp as Yn,nH as Qn,nI as Jn,nJ as Zn,dO as es,X as ts,nK as ns,nL as qe,nM as ss,ad as os,nN as rs,iD as as,nO as is,nP as ls,aH as We}from"./index-C3cvP8Fo.js";import{R as ds,A as cs,u as us,P as ms,a as fs}from"./use-jump-back-in-BjZ8EswV.js";import{a as Ke,m as Ge,f as Oe,b as Te,d as gt,e as xt,g as yt,E as ps,h as hs,i as gs,M as G,F as xs,D as ys,U as bs,C as Q,u as vs,j as ks,k as Rs,l as ws}from"./index-iTQUa_b2.js";import{a as Is}from"./use-room-follow-claim-BpKzhniV.js";import"./WidgetErrorCard-1NyzIJBj.js";import{M as Ns}from"./markdown-content-DaEVxezf.js";import{W as js,a as As}from"./find-latest-widget-fence-CNsnCgbB.js";import{f as Ss}from"./format-duration-BCr6uzby.js";import{H as Cs,a as Ms,b as Os}from"./RuntimeSetupDialog-Bg-0b-LC.js";import{M as Ve}from"./mention-pill-BiCPflY-.js";import{R as Ts}from"./rotate-ccw-clock-BGwYMaGL.js";import{U as _s}from"./unplug-lkD35Rwp.js";import{M as Es}from"./message-square-off-_qbedNGF.js";import{i as Ps}from"./registry-Ck8p6n1T.js";import{f as $s}from"./use-connector-management-5oRqzydY.js";import{A as Ds}from"./AgentRequestCard-B6MHIsxa.js";/**
|
|
3
3
|
* @license lucide-react v1.48.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const bt={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"}]]};bt.node;const
|
|
7
|
+
*/const bt={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"}]]};bt.node;const Fs=Z(bt);/**
|
|
8
8
|
* @license lucide-react v1.48.0 - ISC
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the ISC license.
|
|
11
11
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/const vt={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"}]]};vt.node;const
|
|
12
|
+
*/const vt={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"}]]};vt.node;const Ls=Z(vt);/**
|
|
13
13
|
* @license lucide-react v1.48.0 - ISC
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the ISC license.
|
|
16
16
|
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/const kt={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"}]]};kt.node;const
|
|
17
|
+
*/const kt={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"}]]};kt.node;const zs=Z(kt);/**
|
|
18
18
|
* @license lucide-react v1.48.0 - ISC
|
|
19
19
|
*
|
|
20
20
|
* This source code is licensed under the ISC license.
|
|
21
21
|
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/const Rt={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"}]]};Rt.node;const
|
|
22
|
+
*/const Rt={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"}]]};Rt.node;const Bs=Z(Rt);/**
|
|
23
23
|
* @license lucide-react v1.48.0 - ISC
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const wt={name:"reply",size:24,node:[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]};wt.node;const
|
|
27
|
+
*/const wt={name:"reply",size:24,node:[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]};wt.node;const Hs=Z(wt);/**
|
|
28
28
|
* @license lucide-react v1.48.0 - ISC
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the ISC license.
|
|
31
31
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/const It={name:"timer",size:24,node:[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]};It.node;const
|
|
32
|
+
*/const It={name:"timer",size:24,node:[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]};It.node;const Us=Z(It);/**
|
|
33
33
|
* @license lucide-react v1.48.0 - ISC
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the ISC license.
|
|
@@ -39,6 +39,6 @@ import{W as Z,r as i,m_ as Ut,j as a,g as qt,ii as Wt,G as V,a1 as ne,a2 as Kt,b
|
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the ISC license.
|
|
41
41
|
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const jt={name:"user-x",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]};jt.node;const
|
|
43
|
-
`)?"":" ";s.set(e,`${t}${o}@${n} `)}function lo({roomId:e,entry:n,author:s,viewerAuthorId:t,onViewProfile:o}){const r=Ct(n),l=n.body.text,d=(s==null?void 0:s.id)===t?void 0:(s==null?void 0:s.handle)??void 0,m=s==null?void 0:s.displayName,{copy:f}=cn({toastOnSettle:!0});return i.useMemo(()=>{const u={reply:{id:"reply",label:"Reply in thread",icon:Bs,run:()=>{X.getState().openThread(e,r,!0),Ue.getState().requestFocus(ot(e,r))}},copy:{id:"copy",label:"Copy text",icon:un,run:()=>void f(l)}};return o!==void 0&&(u.profile={id:"profile",label:"View profile",icon:mn,run:o}),d!==void 0&&(u.mention={id:"mention",label:m===void 0?"Mention author":`Mention ${m}`,icon:ds,run:()=>{io(e,d),Ue.getState().requestFocus(e)}}),fs.map(c=>u[c]).filter(c=>c!==void 0)},[e,r,l,d,m,o,f])}function co(e){if(e.kind==="notice")return{kind:"notice"};const n=e.body.moment;return n?{kind:"moment",moment:n}:{kind:"message"}}function Ee(e,n=[]){return new Map([...n.map(s=>[s.author.id,{...s.author,origin:s.origin}]),...e.map(s=>[s.author.id,{...s.author,origin:s.origin}])])}function ue(e,n){const s=e.body.subjectAuthorId;return s===void 0||n.has(e.authorId)?e.authorId:s}function Y(e,n,s){const t=n.get(e),o=rt({record:{kind:(t==null?void 0:t.kind)??"system",id:e,displayName:(t==null?void 0:t.displayName)??"Unknown",emoji:t==null?void 0:t.emoji,color:t==null?void 0:t.color,imageUrl:t==null?void 0:t.imageUrl},override:(t==null?void 0:t.agentRef)===void 0?null:s==null?void 0:s.get(t.agentRef)});return{kind:o.kind,id:e,displayName:(t==null?void 0:t.displayName)??"Unknown",emoji:o.emoji,imageUrl:o.imageUrl,color:o.color,isExternal:typeof(t==null?void 0:t.origin)=="object"&&(t==null?void 0:t.origin)!==null,...(t==null?void 0:t.retired)===!0?{retired:!0}:{}}}function uo(e){const n=new Set;for(const r of e)J(r)===null&&n.add(r.id);const s=[],t=new Map,o=new Set;for(const r of e){const l=J(r);if(l===null){s.push(r);continue}if(!n.has(l)){s.push(r),o.add(r.id);continue}const d=t.get(l);d?d.push(r):t.set(l,[r])}return{topLevel:s,repliesByRoot:t,orphaned:o}}function Mt(e){return`thread-${e}`}function me(e){return`thread-row-${e}`}function Ie(e){return`thread-panel-entry-${e}`}function fe(e){return`room-entry-${e}`}function Pe(e,n){const s=e.find(d=>d.id===n);if(s===void 0)return null;const t=J(s)??null,o={rowId:n,domId:fe(n)};if(t===null)return o;const r=e.find(d=>d.id===t);return r!==void 0&&(J(r)??null)===null?{rowId:Mt(t),domId:me(t)}:o}function mo(e,n){if(n===null)return null;const s=e.find(t=>t.seq===n);return s===void 0?null:Pe(e,s.id)}const Ye=48;function Ot(e,n,s){const t=e.body.answersEntryId;if(t===void 0||t===e.id||n!==void 0&&n.id===t)return null;const o=s(t);if(o===void 0)return null;const r=o.body.text.replace(/\s+/gu," ").trim();return r.length===0?null:{entryId:t,excerpt:r.length>Ye?`${r.slice(0,Ye).trimEnd()}…`:r}}function fo(e,n){const s=new Map;for(const t of e){const o=n[t.projectPath];if(!o)continue;const r=fn({runtime:o.runtime,model:o.model});s.set(at(t.projectPath),{memberId:t.id,visual:pn(o),runtime:r.label,...r.modelLabel!==null&&{model:r.modelLabel}})}return s}function po(e){const n=new Map;for(const[s,t]of e)n.set(s,t.visual);return n}const ho={info:new Map,faces:new Map},$e=i.createContext(ho);function Tt({known:e,children:n}){return a.jsx($e.Provider,{value:e,children:n})}function De(){const e=it(),n=i.useMemo(()=>{var l;return((l=e.data)==null?void 0:l.agents)??[]},[e.data]),s=i.useMemo(()=>n.map(l=>l.projectPath),[n]),t=lt(s),o=i.useMemo(()=>fo(n,t.data??{}),[n,t.data]),r=i.useMemo(()=>po(o),[o]);return i.useMemo(()=>({info:o,faces:r}),[o,r])}function Ne(e){const n=i.useContext($e);return e===void 0?void 0:n.info.get(e)}function go(){return i.useContext($e).faces}function xo({loading:e,onLoad:n}){return a.jsx("div",{className:"flex justify-center px-4 py-3",children:a.jsxs(Ae,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:e,"data-testid":"room-load-older",className:"text-muted-foreground hover:text-foreground h-7 gap-2 text-xs",children:[e&&a.jsx(hn,{size:"xs"}),e?"Loading older messages…":"Older messages"]})})}function yo({showAuthorHeader:e,headerId:n,displayName:s,time:t,summary:o,contentId:r,summaryId:l,feedPosition:d}){return{...e?{"aria-labelledby":n}:{"aria-label":t.length>0?`${s}, ${t}`:s},"aria-describedby":o===null?r:l,...Oe(d)}}const de=120,bo="code block";function vo(e){if(e.length<=de&&!e.includes("```"))return null;const n=ko(e);return n.length===0?null:n}function ko(e){const n=e.replace(/```[\s\S]*?(?:```|$)/g,` ${bo} `).replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+)/gm,"").replace(/^\s{0,3}\|?[\s:|-]*\|[\s:|-]*$/gm," ").replace(/\|/g," ").replace(/[*_~]{1,3}/g,"").replace(/\s+/g," ").trim();if(n.length<=de)return n;const s=Ro(n,de),t=s.lastIndexOf(" ");return`${(t>de/2?s.slice(0,t):s).trimEnd()}…`}function Ro(e,n){if(typeof Intl.Segmenter=="function"){const t=new Intl.Segmenter(void 0,{granularity:"grapheme"});let o="";for(const{segment:r}of t.segment(e)){if(o.length+r.length>n)break;o+=r}return o}let s="";for(const t of e){if(s.length+t.length>n)break;s+=t}return s}function wo({roomId:e,entry:n,viewerAuthorId:s,reactionFrequents:t,streamStalled:o,isMember:r=!0}){const l=Gs(),d=o===!0||!r,m=i.useMemo(()=>n.reactions??[],[n.reactions]),f=i.useMemo(()=>m.filter(w=>ps(w,s)).map(w=>w.emoji),[m,s]),u=i.useCallback(w=>l.mutate({roomId:e,entryId:n.id,emoji:w,viewerAuthorId:s}),[l,e,n.id,s]),c=i.useMemo(()=>({quick:t,mine:f,onToggle:u,disabled:d}),[t,f,u,d]);return{reactions:m,toggle:u,quickRow:c}}function Io({barRef:e,pillsRef:n,hasReactions:s}){return t=>{var r,l;if(t.target!==t.currentTarget)return;const{key:o}=t;if(o==="ArrowDown"&&s){t.preventDefault(),(r=n.current)==null||r.focusFirst();return}o!=="ArrowRight"&&o!=="Enter"||(t.preventDefault(),(l=e.current)==null||l.focusFirst())}}function No(e,n){var c,w;const s=n.body.subjectAuthorId,t=n.body.notice,o=n.kind==="notice"&&t!==void 0&&s!==void 0&&gn.includes(t),r=At(e,{enabled:o}),l=Ce(),d=Se(),m=ne(),f=o?((w=(c=r.data)==null?void 0:c.bindings.find(h=>h.authorId===s))==null?void 0:w.sessionId)??null:null,u=i.useCallback(h=>{h.button!==0||h.metaKey||h.ctrlKey||h.shiftKey||h.altKey||(h.preventDefault(),!(f===null||s===void 0)&&xn({queryClient:d,transport:m},e,s).then(g=>{g.kind!=="none"&&l(ce({session:g.kind==="bound"?g.sessionId:f}))}))},[s,l,d,e,f,m]);return i.useMemo(()=>f===null?null:{href:yn({session:f}),onOpen:u},[u,f])}const pe="mention",Fe="author_id",jo={[pe]:[Fe]},So=[pe];function Ao(e,n){if(!n||n.length===0)return e;const s=Co(e,n);if(s.length===0)return e;let t=e;for(let o=s.length-1;o>=0;o--){const{offset:r,length:l,authorId:d}=s[o],m=t.slice(0,r),f=t.slice(r,r+l),u=t.slice(r+l);t=`${m}<${pe} ${Fe}="${d}">${f}</${pe}>${u}`}return t}function Co(e,n){const s=[...n].sort((r,l)=>r.offset-l.offset),t=[];let o=0;for(const r of s)r.offset<o||r.offset+r.length>e.length||(t.push(r),o=r.offset+r.length);return t}const Mo=new Map,_t=i.createContext(Mo);function Oo({authors:e,children:n}){return a.jsx(_t.Provider,{value:e,children:n})}function To(e){const n=i.useContext(_t);return e===void 0?void 0:n.get(e)}function _o(e){return typeof e=="string"?e.replace(/^@/,""):""}function Eo({authorId:e,children:n}){const s=To(e),t=Ne(s==null?void 0:s.agentRef),{open:o}=dt();if(!s)return a.jsx(Ve,{kind:"human",label:_o(n),resolved:!1});const r=rt({record:s,override:t==null?void 0:t.visual}),l=ct(s,t==null?void 0:t.memberId),d=l===void 0?void 0:()=>o(l),m=d?{role:"button",tabIndex:0,"aria-label":`View ${s.displayName}’s profile`,onClick:d,onKeyDown:f=>{f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),d())}}:{};return a.jsx(St,{onViewProfile:d,identity:{kind:s.kind,displayName:s.displayName,handle:s.handle??void 0,color:r.color,emoji:r.emoji,imageUrl:r.imageUrl,origin:s.origin,agent:t&&{runtime:t.runtime,...t.model&&{model:t.model}}},children:a.jsx(Ve,{kind:s.kind,label:s.displayName,handle:s.handle??void 0,color:s.color,origin:s.origin,resolved:!0,interactive:d!==void 0,...m})})}function Po(e){return{mention:n=>{const s=n[Fe],t=typeof s=="string"?s:void 0;return!t||!e.has(t)?a.jsx(a.Fragment,{children:n.children}):a.jsx(Eo,{authorId:t,children:n.children})}}}function $o({entry:e,authors:n}){const s=i.useMemo(()=>Ao(e.body.text,e.mentionSpans),[e.body.text,e.mentionSpans]),t=i.useMemo(()=>{var r;return new Set(((r=e.mentionSpans)==null?void 0:r.map(l=>l.authorId))??[])},[e.mentionSpans]),o=i.useMemo(()=>Po(t),[t]);return a.jsx(Oo,{authors:n,children:a.jsx(Is,{content:s,className:"msg-prose",allowedTags:jo,literalTagContent:So,components:o,renderers:Qs})})}function Do(e){return function(s){return a.jsx($o,{entry:s,authors:e})}}const Et="the top folder";function Qe(e){return e.slice(e.lastIndexOf("/")+1)}function Fo(e){const n=e.lastIndexOf("/");return n===-1?"":e.slice(0,n)}function Lo(e){return e===""?Et:`${e}/`}function ve(e){return e.target!==void 0?e.target===""?Et:e.target:Lo(Fo(e.paths[0]??""))}function zo(e,n){const s=e.paths[0]??"",t=e.target;switch(e.kind){case"edit":return`${n} edited ${t??s}`;case"add":return`${n} added ${t??s}`;case"upload":return e.pathCount===1?`${n} uploaded ${Qe(s)} to ${ve(e)}`:`${n} uploaded ${e.pathCount} files to ${ve(e)}`;case"rename":{const o=e.from??"";return t!==void 0?`${n} renamed ${o} to ${t}`:o.endsWith("/")?`${n} renamed ${o}`:`${n} renamed ${o} to ${s}`}case"delete":return t!==void 0?`${n} deleted ${t}`:e.pathCount===1?`${n} deleted ${s}`:`${n} deleted ${e.pathCount} files`;case"from-attachment":return`${n} saved ${Qe(s)} from the chat to ${ve(e)}`}}const Bo=i.lazy(()=>bn(()=>import("./index-B3eeEDWj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.SaveToRoomFilesButton})));function Pt({roomId:e,entry:n,author:s,authorRef:t,authors:o,viewerAuthorId:r,authorNames:l,reactionFrequents:d,streamStalled:m,isMember:f=!0,grouping:u,orphanedReply:c,answers:w,feedPosition:h,rowId:g}){const k=Te(n.createdAt),x=i.useMemo(()=>{const K=vo(n.body.text),xe=hs(n.attachments??[]);if(xe===null)return K;const Be=K??n.body.text.trim();return Be.length>0?`${Be} ${xe}`:xe},[n.body.text,n.attachments]),N=i.useId(),p=`${N}-author`,b=`${N}-content`,_=`${N}-summary`,T=i.useRef(null),$=i.useRef(null),M=i.useRef(null),{reactions:E,toggle:P,quickRow:I}=wo({roomId:e,entry:n,viewerAuthorId:r,reactionFrequents:d,streamStalled:m,isMember:f}),F=Ne(t==null?void 0:t.agentRef),{open:D}=dt(),C=t===void 0?void 0:ct(t,F==null?void 0:F.memberId),B=i.useCallback(()=>{C!==void 0&&D(C)},[D,C]),L=C===void 0?void 0:B,H=lo({roomId:e,entry:n,author:t,viewerAuthorId:r,onViewProfile:L}),W=Io({barRef:$,pillsRef:M,hasReactions:E.length>0}),z=i.useCallback(()=>{var K;return(K=T.current)==null?void 0:K.focus()},[]),U=i.useMemo(()=>Do(o),[o]),R=i.useCallback(K=>a.jsx(i.Suspense,{fallback:null,children:a.jsx(Bo,{roomId:e,attachment:K})}),[e]),y=go(),O=n.body.subjectAuthorId??n.authorId,A=o.get(O),v=Ne(A==null?void 0:A.agentRef),S=No(e,n),j=co(n);if(j.kind==="notice")return a.jsx(so,{entry:n,feedPosition:h,rowId:g,sessionLink:S,subjectName:A==null?void 0:A.displayName});if(j.kind==="moment")return a.jsx(ro,{entry:n,moment:j.moment,subject:O===n.authorId?s:Y(O,o,y),subjectIdentity:{handle:(A==null?void 0:A.handle)??void 0,origin:A==null?void 0:A.origin,agent:v&&{runtime:v.runtime,...v.model&&{model:v.model}}},feedPosition:h,rowId:g});const q=u.position==="first"||u.position==="only";return a.jsxs(G.Root,{ref:T,id:g,position:u.position,actions:H,reactions:I,"data-testid":"room-entry",tabIndex:0,...yo({showAuthorHeader:q,headerId:p,displayName:s.displayName,time:k,summary:x,contentId:b,summaryId:_,feedPosition:h}),onKeyDown:W,children:[a.jsx(G.Gutter,{author:s,at:n.createdAt,onViewProfile:L,isSelf:n.authorId===r}),a.jsxs(G.Body,{children:[a.jsx(G.Author,{id:p,author:s,at:n.createdAt,origin:t==null?void 0:t.origin}),c===!0&&a.jsx("p",{"data-testid":"room-entry-orphan",className:"text-muted-foreground text-xs italic",children:"Replying to an earlier message"}),w!=null&&a.jsx("p",{"data-testid":"room-entry-answers",className:"text-muted-foreground mb-1 truncate text-xs italic",children:`Answering “${w.excerpt}”`}),a.jsx(G.Content,{id:b,className:"[&_:not(pre)>code]:wrap-anywhere [&_pre]:overflow-x-auto",children:n.body.fileChange?a.jsx("p",{"data-testid":"room-entry-file-change",className:"wrap-anywhere",children:zo(n.body.fileChange,(A==null?void 0:A.displayName)??"Somebody")}):U(n,{rowId:n.id,isStreaming:!1})}),x!==null&&a.jsx("span",{id:_,className:"hidden",children:x}),a.jsx(G.Attachments,{items:n.attachments??[],renderAction:f?R:void 0}),a.jsx(G.Reactions,{ref:M,reactions:E,viewerAuthorId:r,names:l,frequents:d,onToggle:P,disabled:m===!0||!f,onExit:z}),a.jsx(G.Actions,{actions:H,reactions:I,barRef:$,onExit:z})]})]})}const Ho="room-load-older",Uo=4;function $t({roomName:e}){return a.jsx(gs,{label:e===void 0?"Messages":`Messages in ${e}`,busy:!0,className:"flex flex-col gap-4 p-4","data-testid":"room-timeline-loading",children:Array.from({length:Uo},(n,s)=>a.jsxs("div",{className:"flex gap-3",children:[a.jsx(se,{className:"size-7 shrink-0 rounded-full"}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[a.jsx(se,{className:"h-3 w-24"}),a.jsx(se,{className:"h-3 w-full max-w-md"})]})]},`room-skeleton-${s}`))})}function qo({roomId:e,roomName:n,viewerAuthorId:s,entries:t,members:o,formerAuthors:r,lastReadSeq:l,reactionFrequents:d,streamStalled:m,isLoading:f,error:u,onAddAgents:c,openThreadId:w,onOpenThread:h,resumeRow:g,landOnRow:k,onTopRow:x,canLoadOlder:N=!1,isLoadingOlder:p=!1,onLoadOlder:b,ref:_}){const T=i.useMemo(()=>Ee(o,r),[o,r]),$=he(o,s),M=De(),E=i.useMemo(()=>new Map([...T].map(([y,O])=>[y,O.displayName])),[T]),P=ut(),I=mt(e,null),{topLevel:F,repliesByRoot:D,orphaned:C}=i.useMemo(()=>uo(t),[t]),B=i.useMemo(()=>new Map(t.map(y=>[y.id,y])),[t]),L=i.useMemo(()=>{const y=vn(F,l),O=kn(F.map(v=>({id:v.id,authorId:v.body.moment?`moment:${v.id}`:v.authorId,timestamp:v.createdAt})),{now:P,lastSeenId:y.lastSeenId,unreadFromStart:y.fromStart}),A=[];N&&!f&&A.push({kind:"load-older",id:Ho});for(const v of O){if(v.kind==="day-divider"){A.push({kind:"day-divider",id:v.key,label:v.label});continue}if(v.kind==="unread-divider"){A.push({kind:"unread-divider",id:v.key});continue}const S=F[v.index];A.push({kind:"message",id:S.id,entry:S,grouping:v.grouping,position:v.index+1,answers:Ot(S,F[v.index-1],B.get.bind(B))});const j=D.get(S.id);j&&A.push({kind:"thread-reply",id:Mt(S.id),rootId:S.id,replies:j,totalReplies:S.threadReplyCount})}return A},[F,D,B,l,P,N,f]),H=i.useMemo(()=>L.map(y=>y.kind==="load-older"?{kind:"notice",id:y.id,at:"",body:null}:y.kind==="day-divider"?{kind:"day-divider",id:y.id,label:y.label}:y.kind==="unread-divider"?{kind:"unread-divider",id:y.id}:y.kind==="thread-reply"?{kind:"thread-reply",id:y.id,rootId:y.rootId,replyCount:_e(y.replies.length,y.totalReplies),lastAt:y.replies[y.replies.length-1].createdAt}:{kind:"message",id:y.id,payload:y.entry,grouping:y.grouping,author:Y(ue(y.entry,T),T,M.faces),at:y.entry.createdAt}),[L,T,M.faces]),W=i.useCallback((y,O)=>{const A=L[O.index];if(A.kind==="load-older")return b===void 0?null:a.jsx(xo,{loading:p,onLoad:b});if(A.kind==="day-divider")return a.jsx(xs,{label:A.label});if(A.kind==="unread-divider")return a.jsx(ys,{});if(A.kind==="thread-reply"){if(O.onOpenThread===void 0)return null;const S=O.onOpenThread;return a.jsx(ao,{id:me(A.rootId),summary:Vs(A.replies,l,A.totalReplies),open:w===A.rootId,onOpen:()=>S(A.rootId)})}const v=ue(A.entry,T);return a.jsx(Pt,{roomId:e,entry:A.entry,author:Y(v,T,M.faces),authorRef:T.get(v),authors:T,viewerAuthorId:s,authorNames:E,reactionFrequents:d,streamStalled:m,isMember:$,grouping:A.grouping,orphanedReply:C.has(A.entry.id),answers:A.answers,feedPosition:{index:A.position,total:-1},rowId:fe(A.entry.id)})},[L,e,T,M.faces,s,E,d,m,$,C,l,w,p,b]),z=i.useCallback(y=>{if(y.kind==="message")return fe(y.id);if(y.kind==="thread-reply")return me(y.rootId)},[]);if(u)return a.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[a.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load these messages"}),a.jsx("p",{className:"max-w-sm",children:"Nothing was lost. Reload to try again."})]});const U=o.some(y=>y.author.kind==="agent"),R=a.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[a.jsx(Rn,{className:"text-muted-foreground/50 size-8","aria-hidden":!0}),a.jsx("p",{className:"text-foreground font-medium",children:"Nothing said here yet"}),a.jsx("p",{className:"max-w-sm",children:U?"Say something to get it going.":"Nothing answers until you add an agent."}),a.jsx(Ae,{type:"button",size:"sm",variant:U?"ghost":"default",onClick:c,className:"mt-1",children:U?"Add more agents":"Add agents"})]});return a.jsx(Tt,{known:M,children:a.jsx(Q.Timeline,{ref:_,conversationId:e,label:`Messages in ${n}`,rows:H,renderRow:W,onOpenThread:h,domIdOf:z,...g===void 0?{}:{resumeRow:g},...k===void 0?{}:{landOnRow:k},...x===void 0?{}:{onTopRow:x},pending:I,viewerAuthorId:s,loading:f?a.jsx($t,{roomName:n}):void 0,empty:R,feedTestId:"room-timeline"})})}const Le={reactions:!0,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!0,turnStatus:!1,asks:!0};function Wo(e){const n=ne(),[s,t]=i.useState([]),o=i.useRef(new Map),r=i.useCallback(h=>{const g=h.map(k=>({id:crypto.randomUUID(),file:k,status:"pending",progress:0}));t(k=>[...k,...g])},[]),l=i.useCallback(h=>{o.current.delete(h),t(g=>g.filter(k=>k.id!==h))},[]),d=i.useCallback(h=>{if(!h){o.current.clear(),t([]);return}const g=new Set(h);for(const k of g)o.current.delete(k);t(k=>k.filter(x=>!g.has(x.id)))},[]),m=i.useCallback(h=>{o.current.delete(h),t(g=>g.map(k=>k.id===h&&k.status==="error"?{...k,status:"pending",progress:0,error:void 0}:k))},[]),f=i.useRef(null),u=re({meta:{suppressErrorToast:!0},mutationFn:async h=>{t(N=>N.map(p=>h.some(b=>b.id===p.id)?{...p,status:"uploading"}:p));const g=N=>{t(p=>p.map(b=>b.status==="uploading"?{...b,progress:N.percentage}:b))},k=new AbortController;f.current=k;const x=h.map(N=>N.file);return n.uploadRoomAttachments(e,x,g,k.signal)},onSettled:()=>{f.current=null},onSuccess:(h,g)=>{g.forEach((k,x)=>{const N=h[x];N&&o.current.set(k.id,N.id)}),t(k=>k.map(x=>g.findIndex(p=>p.id===x.id)===-1?x:{...x,status:"uploaded",progress:100}))},onError:h=>{t(g=>g.map(k=>k.status==="uploading"?{...k,status:"error",error:h.message}:k))}}),c=i.useCallback(()=>{var h;(h=f.current)==null||h.abort()},[]),w=i.useCallback(async()=>{const h=s.filter(k=>k.status==="error");if(h.length>0)throw new Error(h.length===1?`${h[0].file.name} didn’t upload. Try again or remove it.`:`${h.length} files didn’t upload. Try again or remove them.`);const g=s.filter(k=>k.status==="pending");return g.length>0&&await u.mutateAsync(g),s.map(k=>o.current.get(k.id)).filter(k=>k!==void 0)},[s,u]);return{pendingFiles:s,addFiles:r,removeFile:l,retryFile:m,clearFiles:d,cancelUpload:c,uploadAndGetIds:w,hasPendingFiles:s.length>0,hasFailedUpload:s.some(h=>h.status==="error"),isUploading:u.isPending}}function Dt(e){const{room:n,threadRootId:s}=e,t=bs(),o=vs(),r=Wo((n==null?void 0:n.id)??""),l=n!==void 0&&he(n.members,n.viewerAuthorId),d=i.useRef({attachments:r,post:t,reply:o,room:n,threadRootId:s});i.useEffect(()=>{d.current={attachments:r,post:t,reply:o,room:n,threadRootId:s}});const m=i.useCallback(p=>d.current.attachments.addFiles(p),[]),f=i.useCallback(p=>d.current.attachments.removeFile(p),[]),u=i.useCallback(p=>d.current.attachments.retryFile(p),[]),c=i.useCallback(()=>d.current.attachments.cancelUpload(),[]),{pendingFiles:w,hasFailedUpload:h,isUploading:g}=r,k=i.useMemo(()=>({staged:w,add:m,remove:f,retry:u,cancel:c,hasFailed:h,isUploading:g,holdsSendWhileUploading:!1}),[w,h,g,m,f,u,c]),x=i.useCallback(async p=>{const{attachments:b,post:_,reply:T,room:$,threadRootId:M}=d.current;if($===void 0)throw new Error("That room isn’t loaded yet.");if($.archived)throw new Error("This room is archived.");Re.getState().recordOpened("room",$.id);const E=wn(),P=b.pendingFiles.map(C=>C.file.name),I=b.pendingFiles.map(C=>C.id),F=await b.uploadAndGetIds();b.clearFiles(I);const D=p.parentEntryId??M;if(D!==void 0){T.mutate({roomId:$.id,rootEntryId:D,text:p.text,clientId:E,attachmentIds:F,attachmentNames:P});return}_.mutate({roomId:$.id,text:p.text,clientId:E,attachmentIds:F,attachmentNames:P})},[]);return{target:i.useMemo(()=>({kind:"room",id:(n==null?void 0:n.id)??"",placeholder:n===void 0?"Message…":s===void 0?`Message ${te(n)}…`:"Reply in this thread…",canSend:n!==void 0&&!n.archived&&l,...n===void 0?{canSendReason:"Still opening this room…"}:n.archived?{canSendReason:"This room is archived. You can read it, but not add to it."}:l?{}:{canSendReason:ft},send:x,attachments:k}),[n,s,l,k,x]),attachments:r}}function Ko(e){const{roomId:n,entrySeq:s,entries:t,historyLoaded:o}=e,r=s===void 0?null:`${n}:${s}`,l=i.useMemo(()=>{if(s===void 0)return null;const g=t.find(p=>p.seq===s);if(g===void 0)return null;const k=Pe(t,g.id);if(k===null)return null;const x=J(g)??null,N=x!==null&&k.rowId!==g.id;return{roomRowId:k.rowId,threadRootId:N?x:null,entryId:g.id}},[t,s]),d=i.useRef(null),m=(l==null?void 0:l.threadRootId)??null;i.useEffect(()=>{r===null||m===null||d.current!==r&&(d.current=r,X.getState().openThread(n,m))},[r,n,m]);const f=i.useRef(null);i.useEffect(()=>{r===null||!o||l===null&&f.current!==r&&(f.current=r,pt.info("That message isn’t in the loaded history",{description:"Only recent messages are open. Nothing was lost."}))},[r,o,l]);const u=i.useRef(null),c=i.useCallback(()=>{if(!(r===null||u.current===r))return u.current=r,l==null?void 0:l.roomRowId},[r,l]),w=i.useRef(null),h=i.useCallback(()=>{if(!(r===null||w.current===r))return w.current=r,(l==null?void 0:l.threadRootId)===null||l==null?void 0:l.entryId},[r,l]);return{roomRow:s===void 0?void 0:c,threadRow:s===void 0?void 0:h}}function Go(e,n){const[s,t]=i.useState({roomId:null,seq:null});return s.roomId===e?s.seq:e===null?(t({roomId:null,seq:null}),null):n===null?null:(t({roomId:e,seq:n}),n)}const Vo=600;function Xo(e){return document.getElementById(me(e))??document.getElementById(fe(e))}function Yo(){const e=i.useRef(null);return i.useEffect(()=>()=>{var s;return(s=e.current)==null?void 0:s.call(e)},[]),{arm:i.useCallback(s=>{var d;(d=e.current)==null||d.call(e);let t=0;const o=Date.now()+Vo;let r=!1;const l=()=>{if(r)return;const m=document.activeElement;if(m===null||m===document.body||!m.isConnected){const u=Xo(s);if(u!==null){u.focus();return}}Date.now()>=o||(t=requestAnimationFrame(l))};t=requestAnimationFrame(l),e.current=()=>{r=!0,cancelAnimationFrame(t)}},[])}}function Qo({roomId:e,route:n,urlThreadId:s,openThreadId:t,entries:o,historyLoaded:r}){const l=In(),d=i.useRef(null);i.useEffect(()=>{if(e!==null){if(d.current!==e&&(d.current=e,s!==void 0)){X.getState().openThread(e,s);return}if(r&&t!==void 0){const m=o.find(u=>u.id===t),f=m===void 0?void 0:Ct(m);if(f!==void 0&&f!==t){const u=X.getState().open[e];X.getState().openThread(e,f,(u==null?void 0:u.focusComposer)??!1);return}}t!==s&&(l==null||l({to:n,search:m=>({...m,thread:t}),replace:!0}))}},[e,n,t,s,o,r,l])}const Jo=6,Ft="jump-back-in-listbox";function ze(e){return`jump-back-in-item-${e}`}const Zo='[role="combobox"]';function oe(e){return e instanceof Element&&e.matches(Zo)}function er({value:e,yieldToPalette:n=!1,enabled:s=!0}){const t=Ce(),o=Nn(),[r,l]=i.useState(!1),[d,m]=i.useState({stamp:"",index:0}),[f,u]=i.useState(!1),[c,w]=i.useState(!1);e.length>0&&!c&&w(!0);const h=i.useRef(!1);i.useEffect(()=>{h.current=!0},[]);const{data:g}=it({enabled:s}),k=i.useMemo(()=>((g==null?void 0:g.agents)??[]).map(R=>R.projectPath),[g]),{data:x}=lt(k,{enabled:s}),N=i.useMemo(()=>x??{},[x]),p=i.useMemo(()=>jn(k,N),[k,N]),b=i.useMemo(()=>new Map(k.map(R=>[at(R),R])),[k]),_=i.useCallback(R=>Sn({room:R,agentsByPath:N,pathByAgentRef:b}),[N,b]),T=i.useMemo(()=>An(o.muted),[o.muted]),{items:$}=cs({mutedRoomIds:T,enabled:s}),M=i.useMemo(()=>$.slice(0,Jo),[$]),E=s&&r&&!f&&!c&&!n&&e.length===0&&M.length>0,P=`${E}:${M.length}`,I=d.stamp===P?d.index:0,F=i.useCallback(R=>{h.current&&oe(R.target)&&(u(!1),w(!1),l(!0))},[]),D=i.useCallback(R=>{oe(R.target)&&l(!0)},[]),C=i.useCallback(R=>{oe(R.target)&&l(!1)},[]),B=i.useCallback(R=>{M.length!==0&&m(y=>{const O=y.stamp===P?y.index:0;return{stamp:P,index:(O+R+M.length)%M.length}})},[M.length,P]),L=i.useCallback(()=>B(1),[B]),H=i.useCallback(()=>B(-1),[B]),W=i.useCallback(()=>{u(!0)},[]),z=i.useCallback(R=>{if(u(!0),R.kind==="session"){R.session.cwd&&Re.getState().recordOpened("agent",R.session.cwd),t(ce({dir:R.session.cwd??void 0,session:R.session.id}));return}Re.getState().recordOpened("room",R.room.id),t({...ht.channels(),search:{id:R.room.id}})},[t]),U=i.useCallback(()=>{const R=M[I];!E||!R||z(R)},[E,M,I,z]);return{isOpen:E,hasRows:M.length>0,rows:M,agents:N,displayNames:p,visualOf:_,selectedIndex:I,activeDescendantId:E&&M[I]!==void 0?ze(I):void 0,listboxId:E?Ft:void 0,handleFocus:F,handleBlur:C,handlePointerDown:D,moveDown:L,moveUp:H,selectHighlighted:U,selectRow:z,dismiss:W}}function Lt({mark:e,label:n,title:s,summary:t,lastActivityAt:o,index:r,isSelected:l,now:d,onSelect:m}){const f=i.useMemo(()=>Number.isNaN(Date.parse(o))?null:En(o),[o,d]);return a.jsxs("div",{id:ze(r),role:"option","aria-selected":l,"data-selected":l,title:s,onClick:m,className:"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-start gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[a.jsx("span",{className:"mt-px flex shrink-0 items-center",children:e}),a.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsxs("span",{className:"flex w-full items-center gap-1.5",children:[a.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm",children:n}),f!==null&&a.jsx("span",{className:"text-muted-foreground/60 text-3xs shrink-0",children:f})]}),t!==null&&a.jsx("span",{className:"text-muted-foreground/70 text-2xs truncate",children:t})]})]})}function tr({item:e,agent:n,displayName:s,index:t,isSelected:o,now:r,onSelect:l}){const d=Cn(n,e.session.cwd??s);return a.jsx(Lt,{mark:a.jsx(Mn,{color:d.color,emoji:d.emoji,size:"xs"}),label:e.name,title:`${s} · ${e.name}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:t,isSelected:o,now:r,onSelect:l})}function nr({item:e,visual:n,index:s,isSelected:t,now:o,onSelect:r}){return a.jsx(Lt,{mark:a.jsx(Tn,{room:e.room,participants:e.room.participants,visuals:_n(n)}),label:a.jsx(On,{room:e.room}),title:e.summary===null?e.name:`${e.name} · ${e.summary}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:s,isSelected:t,now:o,onSelect:r})}function sr({rows:e,selectedIndex:n,agents:s={},displayNames:t={},visualOf:o,onSelect:r}){const l=ut(6e4);return i.useEffect(()=>{var d,m;(m=(d=document.getElementById(ze(n)))==null?void 0:d.scrollIntoView)==null||m.call(d,{block:"nearest"})},[n]),a.jsx(Me.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:d=>d.preventDefault(),children:a.jsx("div",{id:Ft,role:"listbox","aria-label":"Jump back in",className:"max-h-72 overflow-y-auto p-1.5",children:e.map((d,m)=>{var f;return d.kind==="session"?a.jsx(tr,{item:d,agent:d.session.cwd&&s[d.session.cwd]||null,displayName:d.session.cwd&&t[d.session.cwd]||((f=d.session.cwd)==null?void 0:f.split("/").pop())||"Agent",index:m,isSelected:m===n,now:l,onSelect:()=>r(d)},`session-${d.id}`):a.jsx(nr,{item:d,visual:o(d.room),index:m,isSelected:m===n,now:l,onSelect:()=>r(d)},`room-${d.id}`)})})})}const Je={people:"People",agents:"Agents"},or=["people","agents"];function rr(e,n){const s=[];for(const{author:t}of e){if(t.kind==="system"||t.id===n||t.retired)continue;const o=t.handle;s.push({section:t.kind==="agent"?"agents":"people",authorId:t.id,label:t.displayName,...o?{handle:o}:{},...t.emoji?{emoji:t.emoji}:{},...t.color?{color:t.color}:{},disabled:!o,...o?{}:{disabledReason:"No @name"}})}return s}function ar(e,n,s){const t=n.trim().toLowerCase(),o=e.map((r,l)=>({row:r,position:l,tier:ir(r,t)})).filter(r=>r.tier!==null).sort((r,l)=>r.tier-l.tier||r.position-l.position);return s.flatMap(r=>o.filter(l=>l.row.section===r).map(({row:l})=>l))}function ir(e,n){var o;if(n==="")return 0;const s=[(o=e.handle)==null?void 0:o.toLowerCase(),e.label.toLowerCase()].filter(r=>r!==void 0);let t=null;for(const r of s){const l=r===n?0:r.startsWith(n)?1:r.includes(n)?2:null;l!==null&&(t===null||l<t)&&(t=l)}return t}function ie(e,n,s){var r;const t=e.length;if(t===0)return 0;let o=(n%t+t)%t;for(let l=0;l<t;l++){if(!((r=e[o])!=null&&r.disabled))return o;o=(o+s+t)%t}return 0}function lr(e,n,s,t){const o=e.slice(0,n),r=e.slice(n+1+s.length),l=`@${t}`,d=r.startsWith(" ")?"":" ";return{value:o+l+d+r,cursorPos:o.length+l.length+1}}const dr=/(^|\s)@([A-Za-z0-9_.-]*)$/,zt="mention-palette-listbox";function je(e){return`mention-item-${e}`}function cr({members:e,viewerAuthorId:n,text:s,sectionOrder:t=or}){var D;const[o,r]=i.useState(!1),[l,d]=i.useState(""),[m,f]=i.useState(-1),u=Pn(s),c=i.useRef(!1),w=i.useMemo(()=>rr(e,n),[e,n]),h=i.useMemo(()=>o?ar(w,l,t):[],[w,l,o,t]),[g,k]=i.useState(null),x=g!==null&&g.query===l&&g.open===o?g.index:ie(h,0,1),N=h[x],p=h.length===0||N!==void 0&&!N.disabled?x:ie(h,0,1),b=i.useCallback((C,B)=>{const L=C.slice(0,B).match(dr);if(!L){r(!1);return}r(!0),d(L[2]),f((L.index??0)+L[1].length)},[]),_=i.useCallback(C=>{u.write(C),c.current=!1},[u]),T=i.useCallback(C=>{c.current||b(u.read(),C)},[b,u]),$=i.useCallback(()=>{k({query:l,open:o,index:ie(h,p+1,1)})},[h,p,l,o]),M=i.useCallback(()=>{k({query:l,open:o,index:ie(h,p-1,-1)})},[h,p,l,o]),E=i.useCallback(C=>C.disabled||C.handle===void 0?null:(c.current=!0,r(!1),lr(u.read(),m,l,C.handle)),[m,l,u]),P=i.useCallback(()=>{const C=h[p];return C?E(C):(r(!1),null)},[h,p,E]),I=i.useCallback(()=>{c.current=!0,r(!1)},[]),F=h.some(C=>!C.disabled);return{isOpen:o,hasSelectableRows:F,rows:h,selectedIndex:p,activeDescendantId:o&&((D=h[p])==null?void 0:D.disabled)===!1?je(p):void 0,listboxId:o?zt:void 0,noteTextChange:_,handleCursorChange:T,moveDown:$,moveUp:M,selectHighlighted:P,selectRow:E,dismiss:I}}function ur({rows:e,selectedIndex:n,onSelect:s}){const t=i.useMemo(()=>{const o=[];return e.forEach((r,l)=>{const d=o[o.length-1];d&&d.section===r.section?d.items.push({row:r,index:l}):o.push({section:r.section,items:[{row:r,index:l}]})}),o},[e]);return i.useEffect(()=>{var o;(o=document.getElementById(je(n)))==null||o.scrollIntoView({block:"nearest"})},[n]),a.jsx(Me.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:o=>o.preventDefault(),children:a.jsx("div",{id:zt,role:"listbox","aria-label":"Mentions",className:"max-h-72 overflow-y-auto p-1.5",children:e.length===0?a.jsx("div",{className:"text-muted-foreground px-2 py-4 text-center text-sm",children:"No one by that name."}):t.map(({section:o,items:r},l)=>a.jsxs("div",{role:"group","aria-label":Je[o],children:[l>0&&a.jsx("div",{className:"bg-border mx-2 my-1.5 h-px"}),a.jsx("div",{"aria-hidden":!0,className:"text-muted-foreground/70 text-2xs px-2 pt-1.5 pb-1 font-medium tracking-wide uppercase",children:Je[o]}),r.map(({row:d,index:m})=>{const f=m===n;return a.jsxs("div",{id:je(m),role:"option","aria-selected":f,"aria-disabled":d.disabled,"data-selected":f,"data-disabled":d.disabled,onClick:()=>{d.disabled||s(d)},className:d.disabled?"flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1.5 opacity-45":"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[a.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 text-center text-sm leading-none",children:d.emoji}),a.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:d.label}),d.handle!==void 0&&a.jsxs("span",{className:"text-muted-foreground/70 truncate font-mono text-xs",children:["@",d.handle]}),d.disabledReason!==void 0&&a.jsx("span",{className:"text-muted-foreground/70 text-2xs ml-auto shrink-0",children:d.disabledReason})]},d.authorId)})]},o))})})}function Bt({room:e,threadRootId:n,focusOnMount:s,offerJumpBackIn:t,onFocusChange:o,attachments:r}){const l=n===void 0?e.id:ot(e.id,n),d=$n(l),{target:m}=yt(),f=Dn(),u=Fn(l),c=i.useRef(null),w=he(e.members,e.viewerAuthorId),h=i.useRef(!1),g=cr({members:e.members,viewerAuthorId:e.viewerAuthorId,text:d}),k=t===!0,x=er({value:d,yieldToPalette:g.isOpen,enabled:k}),N=i.useRef(u);i.useEffect(()=>{var I;u!==N.current&&(N.current=u,(I=c.current)==null||I.focus())},[u]),i.useEffect(()=>{var I;s===!0&&((I=c.current)==null||I.focusUnlessTouch())},[]);const p=i.useCallback(I=>le.getState().set(l,I),[l]),[b,_]=i.useState(null);i.useLayoutEffect(()=>{var I;b!==null&&((I=c.current)==null||I.focusAt(b.pos))},[b]);const T=i.useCallback(I=>{I&&(p(I.value),_({pos:I.cursorPos}))},[p]),$=i.useCallback(I=>T(g.selectRow(I)),[g,T]),M=i.useCallback(()=>T(g.selectHighlighted()),[g,T]),E=()=>{if(m===null||!m.canSend||h.current)return;g.dismiss();const I=le.getState().take(l).trim();if(I==="")return;const F=r.pendingFiles.length>0;F&&(h.current=!0),m.send({text:I}).catch(()=>{const D=le.getState(),C=D.drafts[l]??"";D.set(l,C===""?I:`${I}
|
|
44
|
-
${C}`)}).finally(()=>{F&&(h.current=!1)})};if(!w)return a.jsxs("div",{className:"flex items-center justify-between gap-3 border-t px-4 py-3",children:[a.jsx("p",{className:"text-muted-foreground text-sm",children:ft}),a.jsx(Ae,{type:"button",size:"sm",variant:"outline",disabled:f.isPending,onClick:()=>f.mutate({roomId:e.id,authorId:e.viewerAuthorId},{onSuccess:()=>pt.success(`You joined ${te(e)}`)}),children:Ln})]});const P=a.jsx(Q.Composer,{inputRef:c,value:d,onChange:I=>{p(I),g.noteTextChange(I)},onSubmit:E,head:a.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:g.isOpen&&g.rows.length===0?"No one by that name.":""}),mentionPicker:a.jsx(we,{children:g.isOpen&&a.jsx(ur,{rows:g.rows,selectedIndex:g.selectedIndex,onSelect:$})}),overlays:a.jsx(a.Fragment,{children:a.jsx(we,{children:x.isOpen&&a.jsx(sr,{rows:x.rows,selectedIndex:x.selectedIndex,agents:x.agents,displayNames:x.displayNames,visualOf:x.visualOf,onSelect:x.selectRow})})}),input:{onCursorChange:g.handleCursorChange,isStreaming:!1,isPaletteOpen:g.isOpen||x.isOpen,paletteHasResults:x.isOpen?x.hasRows:g.hasSelectableRows,onArrowUp:x.isOpen?x.moveUp:g.moveUp,onArrowDown:x.isOpen?x.moveDown:g.moveDown,onCommandSelect:x.isOpen?x.selectHighlighted:M,onEscape:x.isOpen?x.dismiss:g.dismiss,tabPicks:!x.isOpen,onClear:()=>{p(""),g.dismiss()},activeDescendantId:x.isOpen?x.activeDescendantId:g.activeDescendantId,paletteListboxId:x.isOpen?x.listboxId:g.listboxId,contextKey:l,...r.hasFailedUpload?{canSubmitReason:"A file didn’t upload. Try it again or remove it, then send."}:{}}});return!k&&o===void 0?P:a.jsx("section",{className:"flex flex-col","data-testid":zn.homeComposer,onFocus:I=>{x.handleFocus(I),oe(I.target)&&(o==null||o(!0))},onBlur:I=>{x.handleBlur(I),oe(I.target)&&(o==null||o(!1))},onPointerDown:x.handlePointerDown,children:P})}function mr(e){return e.kind!=="channel"||e.bridge!=null||e.archived?!1:!e.members.some(n=>n.author.kind==="agent")}function fr({room:e,hasEntries:n,onAddAgents:s}){return!n||!mr(e)?null:a.jsxs("p",{className:"text-muted-foreground shrink-0 px-4 pb-1 text-xs","data-testid":"no-agent-hint",children:["No agent is in this channel to answer."," ",a.jsx("button",{type:"button",onClick:s,className:"text-foreground focus-visible:ring-ring rounded-sm underline underline-offset-2 focus-visible:ring-2 focus-visible:outline-none",children:"Add one"})," ","to get answers here."]})}function pr({roomId:e}){const{approvals:n}=Bn(),s=Hn(n).filter(t=>t.roomId===e);return s.length===0?null:a.jsx("section",{"data-slot":"room-approvals","aria-label":"Requests waiting on you",className:"shrink-0 px-3 pb-2 md:px-4",children:a.jsx(Un,{approvals:s})})}function hr({roomId:e}){const{data:n}=Ps("pending"),s=(n??[]).filter(t=>t.roomId===e);return s.length===0?null:a.jsx("section",{"data-slot":"room-agent-requests","aria-label":"Apps agents are asking for",className:"shrink-0 space-y-2 px-3 pb-2 md:px-4",children:s.map(t=>a.jsx($s,{request:t},t.requestId))})}const gr="An agent",Ze=64,ke=3,xr=new Set;function Ht({room:e,entries:n,scope:s,laneScope:t,stalled:o,unavailable:r=!1,onRetry:l,onScrollToRow:d}){const m=Ce(),f=qn(e.id,s),u=Wn(e.id,s),c=Kn(e.id,s),[w,h]=i.useState(!1),g=At(e.id,{enabled:w}),k=Gn(),{mutate:x}=Ws(),[N,p]=i.useState(xr),b=i.useCallback(v=>{p(S=>new Set(S).add(v)),x({roomId:e.id,authorId:v},{onSettled:()=>p(S=>{const j=new Set(S);return j.delete(v),j})})},[x,e.id]),_=Ks(),[T,$]=i.useState(()=>new Map),M=Vn(),E=De(),P=i.useMemo(()=>Ee(e.members,e.formerAuthors),[e.members,e.formerAuthors]),I=i.useCallback(v=>{var S;return((S=P.get(v))==null?void 0:S.displayName)??gr},[P]),{interactions:F}=Xn(),D=i.useMemo(()=>F.filter(v=>v.roomId===e.id),[F,e.id]),C=i.useMemo(()=>{var S;const v={};for(const j of D){if(j.roomAuthorId===void 0)continue;const q=(S=P.get(j.roomAuthorId))==null?void 0:S.displayName;q!==void 0&&(v[j.sessionId]=q)}return v},[D,P]),B=i.useMemo(()=>f.map(v=>({authorId:v.authorId,name:I(v.authorId),state:v.state,since:v.since,activity:v.activity??null})),[f,I]),L=i.useMemo(()=>u.map(v=>{var j;const S=(j=M.data)==null?void 0:j.find(q=>q.id===v.behindRoomId);return{authorId:v.authorId,name:I(v.authorId),since:v.since,behind:{roomId:v.behindRoomId,title:S===void 0?null:te(S)},othersWaiting:v.othersWaiting,severalInTheWay:v.severalInTheWay}}),[u,I,M.data]),H=i.useMemo(()=>{const v=new Set;for(const S of u)T.get(S.authorId)===S.entryId&&v.add(S.authorId);return v},[u,T]),W=i.useMemo(()=>c===null?null:{authorId:c.authorId,name:I(c.authorId)},[c,I]),z=i.useMemo(()=>ks({capabilities:Le,asks:D,agentNames:C,stalled:o,presence:B,held:L,silentFinish:W,turn:null}),[D,C,B,L,W,o]),U=i.useMemo(()=>{var S;const v=new Map;for(const j of((S=g.data)==null?void 0:S.bindings)??[])v.set(j.authorId,j.sessionId);return v},[g.data]),R=i.useCallback(v=>{const S=n.find(q=>q.id===v);if(S===void 0)return null;const j=S.body.text.replace(/\s+/gu," ").trim();return j.length===0?null:j.length>Ze?`${j.slice(0,Ze).trimEnd()}…`:j},[n]),y=i.useCallback(v=>{var S;return t==="thread"?Ie(v):((S=Pe(n,v))==null?void 0:S.domId)??null},[n,t]),O=i.useMemo(()=>{const v=f.map(j=>{const q=R(j.entryId),K=y(j.entryId);return{authorId:j.authorId,author:Y(j.authorId,P,E.faces),state:j.state,since:j.since,doing:Yn(j.activity),replyingTo:q===null||K===null?null:{entryId:j.entryId,excerpt:q,rowId:K},sessionId:U.get(j.authorId)??null}}),S=L.map(j=>({authorId:j.authorId,author:Y(j.authorId,P,E.faces),state:"held",since:j.since,doing:null,replyingTo:null,sessionId:null,behind:j.behind,othersWaiting:j.othersWaiting}));return[...v,...S]},[f,L,P,E.faces,R,y,U]),A=i.useMemo(()=>{if(f.length===0)return null;const v=f.slice(0,ke);return a.jsxs("span",{"aria-hidden":"true",className:"flex shrink-0 -space-x-1",children:[v.map(S=>a.jsx(gt,{author:Y(S.authorId,P,E.faces),className:"ring-background size-4 ring-2"},S.authorId)),f.length>ke&&a.jsx("span",{className:"bg-muted text-muted-foreground ring-background text-3xs flex size-4 items-center justify-center rounded-full ring-2",children:`+${f.length-ke}`})]})},[f,P,E.faces]);return a.jsx(Q.LiveLane,{state:z,scope:t,onRetry:l,unavailable:r,faces:A,onPeekOpenChange:h,askCard:z.kind==="ask"?a.jsx(Qn,{ask:z.ask,...C[z.ask.sessionId]?{agentName:C[z.ask.sessionId]}:{},onOpenSession:v=>{m(ce({session:v}))},className:"border-l-0"}):void 0,peek:a.jsx(Q.LivePeek,{rows:O,onScrollToRow:d,onOpenSession:v=>{m(ce({session:v}))},onOpenRoom:v=>{m({...ht.channels(),search:{id:v}})},onAnswerFirst:v=>{const S=u.find(j=>j.authorId===v);S!==void 0&&$(j=>new Map(j).set(v,S.entryId)),_.mutate({roomId:e.id,authorId:v})},promoted:H,onStopAll:()=>k.mutate({roomId:e.id}),stopping:k.isPending,onStopAgent:b,stoppingAgents:N})})}const et=3e3;function yr(e,n,s,t=Date.now){const o=i.useRef(null),r=i.useRef(new Map),l=i.useRef(new Map),d=o.current,m=r.current,f=l.current,u=t();for(const c of e){if(f.has(c.id))continue;if(d===null){f.set(c.id,"at-rest");continue}const w=m.get(c.authorId);f.set(c.id,w!==void 0&&u-w<et?"handed-off":"dropped")}return i.useEffect(()=>{if(!s)return;o.current=new Set(e.map(w=>w.id));const c=t();for(const w of n)r.current.set(w,c);for(const[w,h]of r.current)c-h>et&&r.current.delete(w);for(const w of l.current.keys())o.current.has(w)||l.current.delete(w)}),f}function br({kind:e}){return e==="thread-error"?a.jsxs("div",{"data-slot":"thread-notice","data-testid":"room-thread-error",className:"text-muted-foreground flex flex-col items-center gap-2 px-[var(--msg-padding-x)] py-6 text-center text-sm",children:[a.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load this thread"}),a.jsx("p",{className:"max-w-sm text-xs",children:"Nothing was lost. Reload to try again."})]}):e==="thread-waiting"?a.jsxs("div",{"data-slot":"thread-notice",className:"flex flex-col gap-2 px-[var(--msg-padding-x)]",children:[a.jsx(se,{className:"h-3 w-24"}),a.jsx(se,{className:"h-3 w-full max-w-sm"})]}):a.jsx("p",{"data-slot":"thread-notice","data-testid":"room-thread-orphan",className:"text-muted-foreground border-b px-[var(--msg-padding-x)] pb-3 text-xs italic",children:"This thread’s first message is gone. Its replies remain."})}function vr({room:e,rootEntryId:n,focusComposer:s,entries:t,reactionFrequents:o,streamStalled:r,streamUnavailable:l,onRetryStream:d,historyLoaded:m,historyFailed:f=!1,landOnRow:u,pushed:c,onClose:w}){const h=i.useMemo(()=>Ee(e.members,e.formerAuthors),[e.members,e.formerAuthors]),g=Dt({room:e,threadRootId:n}),k=he(e.members,e.viewerAuthorId),x=De(),N=i.useMemo(()=>new Map([...h].map(([R,y])=>[R,y.displayName])),[h]),{root:p,replies:b}=i.useMemo(()=>{let R;const y=[];for(const O of t)O.id===n?R=O:J(O)===n&&y.push(O);return{root:R,replies:y}},[t,n]),_=p==null?void 0:p.threadReplyCount,T=_!==void 0&&_>b.length,$=p===void 0||T?-1:1+b.length,M=_e(b.length,_),E=i.useMemo(()=>new Set(b.map(R=>R.id)),[b]),P=i.useMemo(()=>({replyIds:E,inside:!0}),[E]),I=Jn(e.id,P),F=mt(e.id,n),D=yr(b,I,m),C=i.useRef(null),B=i.useCallback(R=>{var y;(y=C.current)==null||y.scrollToRow(R)},[]),L=i.useRef(null);i.useEffect(()=>{var R;s||(R=L.current)==null||R.focus()},[n,s]);const H=R=>{R.key!=="Escape"||R.defaultPrevented||(R.stopPropagation(),w())},W=i.useMemo(()=>{const R=[];if(p===void 0){const y=f?"thread-error":m?"thread-orphan":"thread-waiting";R.push({kind:"notice",id:y,at:"",body:null})}else R.push({kind:"message",id:p.id,payload:p,grouping:{position:"only"},author:Y(ue(p,h),h,x.faces),at:p.createdAt});for(const y of b)R.push({kind:"message",id:y.id,payload:y,grouping:{position:"only"},author:Y(ue(y,h),h,x.faces),at:y.createdAt});return R},[p,b,h,x.faces,f,m]),z=i.useCallback(R=>{if(R.kind==="notice")return a.jsx(br,{kind:R.id});if(R.kind!=="message")return null;const y=R.payload,O=p!==void 0&&y.id===p.id,A=b.findIndex(j=>j.id===y.id),v=a.jsx(Pt,{roomId:e.id,entry:y,rowId:Ie(y.id),author:R.author,authorRef:h.get(y.authorId),authors:h,viewerAuthorId:e.viewerAuthorId,authorNames:N,reactionFrequents:o,streamStalled:r,isMember:k,grouping:{position:"only"},answers:Ot(y,A<=0?p:b[A-1],j=>(p==null?void 0:p.id)===j?p:b.find(q=>q.id===j)),feedPosition:{index:O?1:(p===void 0?0:1)+A+1,total:$}});if(O)return M===0?v:a.jsxs(a.Fragment,{children:[v,a.jsxs("div",{"aria-hidden":!0,"data-testid":"room-thread-divider",className:"flex items-center gap-2 px-[var(--msg-padding-x)] pt-1 pb-2",children:[a.jsx("span",{className:"text-muted-foreground shrink-0 text-xs",children:M===1?"1 reply":`${M} replies`}),a.jsx("span",{className:"bg-border h-px flex-1"})]})]});const S=D.get(y.id)??"at-rest";return a.jsx("div",{className:V(S==="dropped"&&"motion-safe:animate-thread-reply-in",S==="handed-off"&&"motion-safe:animate-reply-settle"),children:v})},[p,b,M,D,e.id,e.viewerAuthorId,h,N,o,r,k,$]),U=i.useCallback(R=>R.kind==="message"?Ie(R.id):void 0,[]);return a.jsx(Tt,{known:x,children:a.jsx(Q.Root,{surface:"room",capabilities:Le,target:g.target,anchor:"rail",children:a.jsxs("section",{ref:L,"aria-label":"Thread","data-testid":"room-thread-panel",tabIndex:-1,onKeyDown:H,className:V("bg-card flex min-h-0 flex-col outline-none",c?"h-full w-full":"w-full border-l"),children:[a.jsxs("header",{className:"flex items-center gap-2 border-b px-3 py-2",children:[a.jsx("button",{type:"button",onClick:w,"aria-label":c?`Back to ${te(e)}`:"Close thread",className:V("focus-ring text-muted-foreground hover:text-foreground relative -ml-1 rounded p-1","after:absolute after:-inset-2.5 md:after:hidden"),children:c?a.jsx(Zn,{"aria-hidden":!0,className:"size-4"}):a.jsx(es,{"aria-hidden":!0,className:"size-4"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"Thread"}),a.jsx("p",{className:"text-muted-foreground truncate text-xs",children:te(e)})]})]}),a.jsx(Q.Timeline,{ref:C,conversationId:`thread-${n}`,label:`Thread in ${te(e)}`,busy:!m&&!f,rows:W,renderRow:z,domIdOf:U,...u===void 0?{}:{landOnRow:u},pending:F,viewerAuthorId:e.viewerAuthorId,className:"py-3",feedTestId:"room-thread-feed"}),a.jsx(Ht,{room:e,entries:t,scope:P,laneScope:"thread",stalled:c&&r===!0,unavailable:l,onRetry:c?d:void 0,onScrollToRow:B}),a.jsx(Bt,{room:e,threadRootId:n,attachments:g.attachments,focusOnMount:s},n)]})})})}const ge="room-thread-split",kr=320,Rr=360,wr=40,Ir=50,Nr=25;function tt(e,n){return n<=0?Nr:Math.min(Math.round(e/n*1e3)/10,Ir)}function jr(e){const n=tt(kr,e),s=Math.round((100-tt(Rr,e))*10)/10;return{minPct:n,maxPct:s,defaultPct:Math.min(Math.max(wr,n),s)}}function Sr(e,n,s){if(e===null||n===null||n<=0)return s.defaultPct;const t=e/n*100;return Math.round(Math.min(Math.max(t,s.minPct),s.maxPct)*10)/10}function Ar(e){try{const n=localStorage.getItem(e),s=n===null?NaN:Number(n);return Number.isFinite(s)&&s>0?s:null}catch{return null}}function Cr(e,n){try{localStorage.setItem(e,String(Math.round(n)))}catch{}}const Mr="react-resizable-panels:room-thread-split";function Or(){try{localStorage.removeItem(Mr)}catch{}}function Tr(){const[e,n]=i.useState(null),[s,t]=i.useState(null);return{ref:i.useCallback(r=>{if(r===null)return;n(r);const l=()=>t(r.offsetWidth);l();const d=new ResizeObserver(l);return d.observe(r),()=>{d.disconnect(),n(null),t(null)}},[]),element:e,width:s,sizing:jr(s??0)}}const _r=`${ge}-room`,nt=`${ge}-thread`,st=`${ge}-handle`,Er=4;function Pr({room:e,thread:n,storageKey:s=ns.ROOM_THREAD_WIDTH}){const{ref:t,element:o,width:r,sizing:l}=Tr(),[d,m]=i.useState(()=>Ar(s)),[f,u]=i.useState(null),c=i.useRef(null),w=Sr(d,r,l),h=r===null||(l.maxPct-l.minPct)/100*r<Er,g=n!==!1;i.useEffect(Or,[]);const k=i.useRef(!1);i.useLayoutEffect(()=>{var b;k.current&&((b=c.current)==null||b.resize(w))},[w,g]);const x=i.useRef(null),N=()=>{var $;const b=($=c.current)==null?void 0:$.getSize(),_=x.current;if(x.current=null,b===void 0||r===null||r<=0||_===b)return;const T=Math.round(b/100*r);m(T),Cr(s,T)},p=f??w;return i.useLayoutEffect(()=>{const b=o==null?void 0:o.querySelector(`[data-panel-resize-handle-id="${st}"]`);b&&(b.setAttribute("aria-controls",nt),b.setAttribute("aria-valuenow",String(Math.round(p))),b.setAttribute("aria-valuemin",String(Math.round(l.minPct))),b.setAttribute("aria-valuemax",String(Math.round(l.maxPct))))}),a.jsx("div",{ref:t,className:"h-full overflow-hidden",children:a.jsxs(ts,{direction:"horizontal",id:ge,onLayout:b=>{k.current=b.length>1,u(k.current?b[1]:null)},children:[a.jsx(qe,{id:_r,order:1,className:"flex",children:e}),g&&a.jsxs(a.Fragment,{children:[a.jsx(us,{id:st,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:h,onDragging:b=>{var _;b&&(x.current=((_=c.current)==null?void 0:_.getSize())??null)},onKeyDownCapture:b=>{var _,T;h||(x.current=((_=c.current)==null?void 0:_.getSize())??null,!(b.key!=="Home"&&b.key!=="End")&&(b.preventDefault(),(T=c.current)==null||T.resize(b.key==="Home"?l.minPct:l.maxPct)))},onResizeEnd:N}),a.jsx(qe,{ref:c,id:nt,order:2,defaultSize:w,minSize:l.minPct,maxSize:l.maxPct,className:"flex",children:n})]})]})})}function Jr({roomId:e,threadId:n,entrySeq:s,threadRoute:t,aboveTimeline:o,aboveComposer:r,offerJumpBackIn:l,onComposerFocusChange:d}){const m=ss(),f=ms(),u=os(e),c=u==null?void 0:u.rootEntryId,w=Yo(),h=i.useCallback(()=>{var O;const y=(O=X.getState().open[e])==null?void 0:O.rootEntryId;X.getState().closeThread(e),y!==void 0&&w.arm(y)},[e,w]),g=i.useCallback(y=>{X.getState().openThread(e,y)},[e]),k=rs(e),x=as(e),N=Rs(e,x.isSuccess);ws(e);const p=k.data,b=i.useMemo(()=>x.data??[],[x.data]),_=Dt({room:p});Qo({roomId:e,route:t,urlThreadId:n,openThreadId:c,entries:b,historyLoaded:x.isSuccess});const T=i.useMemo(()=>{var y;return((y=p==null?void 0:p.members.find(O=>O.author.id===p.viewerAuthorId))==null?void 0:y.lastReadSeq)??null},[p]),$=Go(e,T);is(p,b);const M=i.useRef(null),E=i.useRef(void 0),P=i.useCallback(y=>{E.current=y},[]),I=i.useCallback(()=>E.current,[]);i.useLayoutEffect(()=>{E.current=void 0},[e]);const F=i.useCallback(y=>{var O;(O=M.current)==null||O.scrollToRow(y)},[]),D=Xs(e),{loadOlder:C,cursor:B}=D,L=i.useCallback(()=>{const y=mo(b,B);C().then(()=>{y!==null&&requestAnimationFrame(()=>{var O;return(O=M.current)==null?void 0:O.scrollToRow(y.domId)})})},[b,B,C]),H=Ko({roomId:e,entrySeq:s,entries:b,historyLoaded:x.isSuccess}),W=i.useMemo(()=>c===void 0?void 0:{replyIds:new Set(b.filter(O=>J(O)===c).map(O=>O.id)),inside:!1},[b,c]);if(k.isLoading)return a.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:a.jsx($t,{})});if(k.isError||!p)return a.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[a.jsx("p",{className:"text-foreground font-medium",children:"That channel or DM isn’t here"}),a.jsx("p",{className:"max-w-sm",children:"It may be archived, or the link is old."})]});const z=u!==void 0&&a.jsx(vr,{room:p,rootEntryId:u.rootEntryId,focusComposer:u.focusComposer,entries:b,reactionFrequents:p.reactionFrequents,streamStalled:N.stalled,streamUnavailable:N.unavailable,onRetryStream:N.retry,historyLoaded:x.isSuccess,historyFailed:x.isError,...H.threadRow===void 0?{}:{landOnRow:H.threadRow},pushed:m,onClose:h},u.rootEntryId),U=a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[o,a.jsx(qo,{ref:M,roomId:p.id,roomName:te(p),viewerAuthorId:p.viewerAuthorId,entries:b,members:p.members,formerAuthors:p.formerAuthors,lastReadSeq:$,reactionFrequents:p.reactionFrequents,streamStalled:N.stalled,isLoading:x.isLoading,error:x.error,onAddAgents:()=>We("add",p.id),openThreadId:c,onOpenThread:g,resumeRow:I,...H.roomRow===void 0?{}:{landOnRow:H.roomRow},onTopRow:P,canLoadOlder:D.canLoadOlder,isLoadingOlder:D.isLoadingOlder,onLoadOlder:L}),r,a.jsx(pr,{roomId:p.id}),a.jsx(hr,{roomId:p.id}),a.jsx(Ht,{room:p,entries:b,scope:W,laneScope:"room",stalled:N.stalled,unavailable:N.unavailable,onRetry:N.retry,onScrollToRow:F}),a.jsx(fr,{room:p,hasEntries:b.length>0,onAddAgents:()=>We("add",p.id)}),a.jsx(Bt,{room:p,attachments:_.attachments,offerJumpBackIn:l,onFocusChange:d},p.id)]}),R={surface:"room",capabilities:Le,target:_.target,anchor:"rail"};return m?a.jsx(Q.Root,{...R,children:a.jsx(we,{initial:!1,mode:"wait",children:a.jsx(Me.div,{initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:16},transition:{duration:.15,ease:[0,0,.2,1]},style:{paddingBottom:f},"data-testid":"room-surface",className:"flex h-full flex-col overflow-hidden",children:z===!1?U:z},z?`thread-${c}`:"room")})}):a.jsx(Q.Root,{...R,children:a.jsx(Pr,{room:U,thread:z})})}export{St as I,$t as R,ao as T,Jr as a,oe as i};
|
|
42
|
+
*/const jt={name:"user-x",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]};jt.node;const qs=Z(jt),Ws=300;function ae({className:e,children:n}){return a.jsx("span",{className:V("bg-muted text-muted-foreground text-2xs inline-flex max-w-full items-center gap-1 truncate rounded-full px-2 py-0.5",e),children:n})}function At({identity:e,children:n,onViewProfile:s,className:t}){const{kind:o,displayName:r,handle:l,color:d,emoji:m,imageUrl:f,origin:u,agent:c}=e,w=d??"hsl(var(--muted-foreground))",h=typeof u=="object"&&u!==null,g=o==="agent"&&(c==null?void 0:c.working)!=null?c.working:null,[k,x]=i.useState(!1),N=i.useRef(!1),p=i.useRef(null),b=Ut({onLongPress:()=>{N.current&&x(!0)}});return a.jsxs(Cs,{open:k,onOpenChange:x,openDelay:Ws,children:[a.jsx(Ms,{asChild:!0,ref:p,"data-gesture-priority":"",...b,onPointerDown:_=>{N.current=_.pointerType==="touch"||_.pointerType==="pen",b.onPointerDown(_)},children:n}),a.jsxs(Os,{"data-slot":"identity-hover-card",align:"start",className:V("flex w-64 flex-col gap-0 overflow-hidden p-0",t),children:[a.jsxs("div",{className:"flex items-center gap-3 p-3",children:[a.jsx(qt,{"aria-hidden":!0,color:w,emoji:m,imageUrl:f,fallback:Wt(r),kind:o,origin:u,status:g?"working":"idle",size:"md"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-foreground truncate text-sm font-semibold",children:r}),l&&a.jsxs("p",{className:"text-muted-foreground truncate text-xs font-medium",children:["@",l]})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1.5 px-3 pb-3 empty:hidden",children:[o==="agent"&&((c==null?void 0:c.runtime)||(c==null?void 0:c.model))&&a.jsx(ae,{children:[c.runtime,c.model].filter(Boolean).join(" · ")}),g&&a.jsxs(ae,{className:"bg-status-success-bg text-status-success-fg",children:["Working · ",Ss(g.forMs)]}),o==="human"&&a.jsx(ae,{children:h?u.platform:"On this machine"}),o==="agent"&&(c==null?void 0:c.managedBy)&&a.jsxs(ae,{children:["Managed by"," ",c.managedBy.handle?`@${c.managedBy.handle}`:c.managedBy.displayName]})]}),s?a.jsx("button",{type:"button","data-slot":"identity-hover-card-profile",onClick:()=>{var _;(_=p.current)==null||_.focus(),s()},className:"border-border hover:bg-accent focus-visible:ring-ring text-brand-text mt-auto flex w-full items-center border-t px-3 py-2 text-left text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none",children:"View profile"}):a.jsxs("div",{className:"border-border mt-auto flex items-center justify-between border-t px-3 py-2",children:[a.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:"View profile"}),a.jsx("span",{className:"text-muted-foreground text-3xs tracking-wide uppercase",children:"soon"})]})]})]})}function St(e,n={}){const s=ne();return Kt({queryKey:ee.sessions(e??""),queryFn:()=>s.listRoomSessions(e),enabled:e!==null&&n.enabled===!0})}function Ks(){const e=ne();return re({mutationFn:({roomId:n,authorId:s})=>e.haltRoomAgent(n,s),meta:{errorLabel:"Couldn’t stop this agent"}})}function Gs(){const e=ne();return re({mutationFn:({roomId:n,authorId:s})=>e.promoteHold(n,s),meta:{errorLabel:"Couldn’t ask to be answered first"}})}function Vs(){const e=ne(),n=Ae();return re({onMutate:({roomId:s,entryId:t,emoji:o,viewerAuthorId:r})=>{var u;const l=n.getQueryData(ee.entries(s)),d=(u=l==null?void 0:l.find(c=>c.id===t))==null?void 0:u.reactions,{reactions:m,on:f}=Ke(d,o,r);return n.setQueryData(ee.entries(s),c=>Ge(c,t,m)),{on:f}},mutationFn:({roomId:s,entryId:t,emoji:o,viewerAuthorId:r})=>{var m,f;const l=n.getQueryData(ee.entries(s)),d=((f=(m=l==null?void 0:l.find(u=>u.id===t))==null?void 0:m.reactions)==null?void 0:f.some(u=>u.emoji===o&&u.authorIds.includes(r)))??!1;return e.toggleReaction(s,t,{emoji:o,on:d})},onError:(s,{roomId:t,entryId:o,emoji:r,viewerAuthorId:l},d)=>{d!==void 0&&n.setQueryData(ee.entries(t),m=>{var c;const f=(c=m==null?void 0:m.find(w=>w.id===o))==null?void 0:c.reactions,{reactions:u}=Ke(f,r,l,!d.on);return Ge(m,o,u)})},onSuccess:({frequents:s},{roomId:t})=>{n.setQueryData(ee.detail(t),o=>o&&{...o,reactionFrequents:s})},meta:{errorLabel:"Couldn’t add your reaction",errorToastId:"room-reaction"}})}function J(e){return e.threadRootEntryId??e.parentEntryId}function Ct(e){return J(e)??e.id}function _e(e,n){return Math.max(n??0,e)}function Xs(e,n,s){let t=e[0],o=0;for(const r of e)r.seq>t.seq&&(t=r),n!==null&&r.seq>n&&(o+=1);return{count:_e(e.length,s),lastAt:t.createdAt,unread:o}}function Ys(e){const n=ne(),s=Ae(),t=Gt(e),o=ye(u=>{var c;return e===null?null:((c=u.paging[e])==null?void 0:c.cursor)??null}),r=re({mutationFn:async u=>{var x;const c=(x=ye.getState().paging[u])==null?void 0:x.cursor;if(c==null)return;const w=await n.listRoomEntries(u,{before:c,limit:He}),h=ee.entries(u),g=s.getQueryData(h),k=Vt(g,w);s.setQueryData(h,k),ye.getState().notePage(u,Xt(w)??c,Yt(w,He)||k.length===((g==null?void 0:g.length)??0))},meta:{errorLabel:"Couldn't load older messages"}}),{mutateAsync:l,isPending:d}=r,m=i.useRef(!1),f=i.useCallback(async()=>{if(!(e===null||m.current)){m.current=!0;try{await l(e).catch(()=>{})}finally{m.current=!1}}},[e,l]);return{canLoadOlder:t,isLoadingOlder:d,cursor:o,loadOlder:f}}function Qs(e){return a.jsx(As,{code:e.code,isIncomplete:e.isIncomplete})}const Js=[{language:js,component:Qs}],Zs={turn_failed:{Icon:an,tone:"text-status-warning"},agent_busy:{Icon:rn},agent_gone:{Icon:qs,tone:"text-status-warning"},agent_left:{Icon:Xe,tone:"text-status-warning"},room_archived:{Icon:on},agent_reseated:{Icon:sn},runtime_gone:{Icon:Bs,tone:"text-status-warning"},agent_paused:{Icon:nn},agent_declined:{Icon:Es},agent_unavailable:{Icon:tn},awaiting_approval:{Icon:Fs,tone:"text-status-warning"},halted:{Icon:en},budget_reached:{Icon:Zt},cascade_stopped:{Icon:Jt},addressing_changed:{Icon:zs},bridge_blocked:{Icon:_s,tone:"text-status-warning"},bridge_undelivered:{Icon:Qt,tone:"text-status-warning"},bridge_rate_limited:{Icon:Us},bridge_second_agent_refused:{Icon:Xe},bridge_disconnected:{Icon:Ls},bridge_agent_swapped:{Icon:ds},bridge_history_note:{Icon:Ts}},eo={Icon:ln},be=80;function to(e){const n=e.trim();if(n.length<=be)return n;const s=n.slice(0,be),t=s.lastIndexOf(" ");return`${(t>be/2?s.slice(0,t):s).trimEnd()}…`}function no(e,n,s){const t=so(e,s),o=r=>a.jsx("a",{href:n.href,onClick:n.onOpen,"data-testid":"room-notice-session-link",className:"focus-ring hover:text-foreground rounded py-2 font-medium underline underline-offset-2",children:r});return t===null?a.jsxs(a.Fragment,{children:[e," ",o("Open chat")]}):a.jsxs(a.Fragment,{children:[e.slice(0,t.index),o(t.words),e.slice(t.index+t.words.length)]})}function so(e,n){if(n!==void 0){const t=dn(n),o=e.lastIndexOf(t);if(o!==-1)return{index:o,words:t}}const s=cn.exec(e);return s===null?null:{index:s.index,words:s[0]}}function oo({entry:e,feedPosition:n,rowId:s,sessionLink:t,subjectName:o}){const{Icon:r,tone:l}=(e.body.notice&&Zs[e.body.notice])??eo;return a.jsxs("p",{id:s,"data-slot":"notice-row","data-testid":"room-notice","data-notice":e.body.notice??"unknown",...n&&{role:"article","aria-label":to(e.body.text)},...Oe(n),className:V("focus-visible:ring-ring flex items-start gap-2 px-[var(--msg-padding-x)] py-2 text-xs outline-none focus-visible:ring-2",l??"text-muted-foreground"),children:[a.jsx(r,{"aria-hidden":!0,className:"mt-px size-3.5 shrink-0"}),a.jsx("span",{children:t?no(e.body.text,t,o):e.body.text})]})}const ro=Ps.moment;function ao({entry:e,moment:n,subject:s,subjectIdentity:t,feedPosition:o,rowId:r}){const l=Te(e.createdAt);return a.jsx("div",{id:r,"data-slot":"moment-row","data-testid":"room-moment","data-moment":n.kind,role:"article","aria-label":`Moment: ${e.body.text}`,...Oe(o),className:"focus-visible:ring-ring px-[var(--msg-padding-x)] py-1 outline-none focus-visible:ring-2",children:a.jsxs("div",{className:"border-border/60 bg-muted/40 flex items-center gap-2.5 rounded-lg border px-3 py-2",children:[a.jsx(At,{identity:{kind:s.kind,displayName:s.displayName,handle:t==null?void 0:t.handle,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl,origin:t==null?void 0:t.origin,agent:t==null?void 0:t.agent},children:a.jsxs("span",{"data-testid":"room-moment-identity",className:"flex shrink-0 items-center",children:[a.jsx(gt,{author:s}),a.jsx("span",{className:"sr-only",children:s.displayName})]})}),a.jsx(ro,{"data-testid":"room-moment-mark","aria-hidden":!0,className:"text-muted-foreground size-3.5 shrink-0"}),a.jsx("p",{className:"min-w-0 flex-1 text-sm",children:e.body.text}),l.length>0&&a.jsx("time",{dateTime:e.createdAt,title:xt(e.createdAt),className:"text-msg-timestamp shrink-0 text-xs",children:l})]})})}function io({id:e,summary:n,open:s,onOpen:t}){const{capabilities:o}=yt(),{count:r,lastAt:l,unread:d}=n,m=Te(l),[f,u]=i.useState({count:r,bumped:!1});f.count!==r&&u({count:r,bumped:!0});const c=f.count===r&&f.bumped;return o.threads?a.jsxs("button",{type:"button",id:e,"data-slot":"thread-reply-row","data-testid":"room-thread-replies","data-unread":d>0?"":void 0,"aria-expanded":s,onClick:t,className:V("focus-ring ml-[calc(var(--msg-padding-x)_+_var(--msg-gutter-width)_+_var(--msg-gap))]","mb-1 w-fit rounded text-left text-xs transition-colors","px-2 py-2 md:px-1 md:py-0.5",d>0?"text-primary hover:text-primary/80 font-medium":"text-muted-foreground hover:text-foreground"),children:[a.jsx("span",{"aria-hidden":!0,className:"mr-1",children:"↳"}),a.jsx("span",{className:V(c&&"motion-safe:animate-count-flip"),"data-testid":"room-thread-reply-count",children:r},r),r===1?" reply":" replies",m.length>0&&a.jsxs(a.Fragment,{children:[" · last ",a.jsx("time",{dateTime:l,title:xt(l),children:m})]}),d>0&&` · ${d} new`]}):null}function lo(e,n){const s=le.getState(),t=s.drafts[e]??"",o=t===""||t.endsWith(" ")||t.endsWith(`
|
|
43
|
+
`)?"":" ";s.set(e,`${t}${o}@${n} `)}function co({roomId:e,entry:n,author:s,viewerAuthorId:t,onViewProfile:o}){const r=Ct(n),l=n.body.text,d=(s==null?void 0:s.id)===t?void 0:(s==null?void 0:s.handle)??void 0,m=s==null?void 0:s.displayName,{copy:f}=un({toastOnSettle:!0});return i.useMemo(()=>{const u={reply:{id:"reply",label:"Reply in thread",icon:Hs,run:()=>{X.getState().openThread(e,r,!0),Ue.getState().requestFocus(ot(e,r))}},copy:{id:"copy",label:"Copy text",icon:mn,run:()=>void f(l)}};return o!==void 0&&(u.profile={id:"profile",label:"View profile",icon:fn,run:o}),d!==void 0&&(u.mention={id:"mention",label:m===void 0?"Mention author":`Mention ${m}`,icon:cs,run:()=>{lo(e,d),Ue.getState().requestFocus(e)}}),ps.map(c=>u[c]).filter(c=>c!==void 0)},[e,r,l,d,m,o,f])}function uo(e){if(e.kind==="notice")return{kind:"notice"};const n=e.body.moment;return n?{kind:"moment",moment:n}:{kind:"message"}}function Ee(e,n=[]){return new Map([...n.map(s=>[s.author.id,{...s.author,origin:s.origin}]),...e.map(s=>[s.author.id,{...s.author,origin:s.origin}])])}function ue(e,n){const s=e.body.subjectAuthorId;return s===void 0||n.has(e.authorId)?e.authorId:s}function Y(e,n,s){const t=n.get(e),o=rt({record:{kind:(t==null?void 0:t.kind)??"system",id:e,displayName:(t==null?void 0:t.displayName)??"Unknown",emoji:t==null?void 0:t.emoji,color:t==null?void 0:t.color,imageUrl:t==null?void 0:t.imageUrl},override:(t==null?void 0:t.agentRef)===void 0?null:s==null?void 0:s.get(t.agentRef)});return{kind:o.kind,id:e,displayName:(t==null?void 0:t.displayName)??"Unknown",emoji:o.emoji,imageUrl:o.imageUrl,color:o.color,isExternal:typeof(t==null?void 0:t.origin)=="object"&&(t==null?void 0:t.origin)!==null,...(t==null?void 0:t.retired)===!0?{retired:!0}:{}}}function mo(e){const n=new Set;for(const r of e)J(r)===null&&n.add(r.id);const s=[],t=new Map,o=new Set;for(const r of e){const l=J(r);if(l===null){s.push(r);continue}if(!n.has(l)){s.push(r),o.add(r.id);continue}const d=t.get(l);d?d.push(r):t.set(l,[r])}return{topLevel:s,repliesByRoot:t,orphaned:o}}function Mt(e){return`thread-${e}`}function me(e){return`thread-row-${e}`}function Ie(e){return`thread-panel-entry-${e}`}function fe(e){return`room-entry-${e}`}function Pe(e,n){const s=e.find(d=>d.id===n);if(s===void 0)return null;const t=J(s)??null,o={rowId:n,domId:fe(n)};if(t===null)return o;const r=e.find(d=>d.id===t);return r!==void 0&&(J(r)??null)===null?{rowId:Mt(t),domId:me(t)}:o}function fo(e,n){if(n===null)return null;const s=e.find(t=>t.seq===n);return s===void 0?null:Pe(e,s.id)}const Ye=48;function Ot(e,n,s){const t=e.body.answersEntryId;if(t===void 0||t===e.id||n!==void 0&&n.id===t)return null;const o=s(t);if(o===void 0)return null;const r=o.body.text.replace(/\s+/gu," ").trim();return r.length===0?null:{entryId:t,excerpt:r.length>Ye?`${r.slice(0,Ye).trimEnd()}…`:r}}function po(e,n){const s=new Map;for(const t of e){const o=n[t.projectPath];if(!o)continue;const r=pn({runtime:o.runtime,model:o.model});s.set(at(t.projectPath),{memberId:t.id,visual:hn(o),runtime:r.label,...r.modelLabel!==null&&{model:r.modelLabel}})}return s}function ho(e){const n=new Map;for(const[s,t]of e)n.set(s,t.visual);return n}const go={info:new Map,faces:new Map},$e=i.createContext(go);function Tt({known:e,children:n}){return a.jsx($e.Provider,{value:e,children:n})}function De(){const e=it(),n=i.useMemo(()=>{var l;return((l=e.data)==null?void 0:l.agents)??[]},[e.data]),s=i.useMemo(()=>n.map(l=>l.projectPath),[n]),t=lt(s),o=i.useMemo(()=>po(n,t.data??{}),[n,t.data]),r=i.useMemo(()=>ho(o),[o]);return i.useMemo(()=>({info:o,faces:r}),[o,r])}function Ne(e){const n=i.useContext($e);return e===void 0?void 0:n.info.get(e)}function xo(){return i.useContext($e).faces}function yo({loading:e,onLoad:n}){return a.jsx("div",{className:"flex justify-center px-4 py-3",children:a.jsxs(Se,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:e,"data-testid":"room-load-older",className:"text-muted-foreground hover:text-foreground h-7 gap-2 text-xs",children:[e&&a.jsx(gn,{size:"xs"}),e?"Loading older messages…":"Older messages"]})})}function bo({showAuthorHeader:e,headerId:n,displayName:s,time:t,summary:o,contentId:r,summaryId:l,feedPosition:d}){return{...e?{"aria-labelledby":n}:{"aria-label":t.length>0?`${s}, ${t}`:s},"aria-describedby":o===null?r:l,...Oe(d)}}const de=120,vo="code block";function ko(e){if(e.length<=de&&!e.includes("```"))return null;const n=Ro(e);return n.length===0?null:n}function Ro(e){const n=e.replace(/```[\s\S]*?(?:```|$)/g,` ${vo} `).replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+)/gm,"").replace(/^\s{0,3}\|?[\s:|-]*\|[\s:|-]*$/gm," ").replace(/\|/g," ").replace(/[*_~]{1,3}/g,"").replace(/\s+/g," ").trim();if(n.length<=de)return n;const s=wo(n,de),t=s.lastIndexOf(" ");return`${(t>de/2?s.slice(0,t):s).trimEnd()}…`}function wo(e,n){if(typeof Intl.Segmenter=="function"){const t=new Intl.Segmenter(void 0,{granularity:"grapheme"});let o="";for(const{segment:r}of t.segment(e)){if(o.length+r.length>n)break;o+=r}return o}let s="";for(const t of e){if(s.length+t.length>n)break;s+=t}return s}function Io({roomId:e,entry:n,viewerAuthorId:s,reactionFrequents:t,streamStalled:o,isMember:r=!0}){const l=Vs(),d=o===!0||!r,m=i.useMemo(()=>n.reactions??[],[n.reactions]),f=i.useMemo(()=>m.filter(w=>hs(w,s)).map(w=>w.emoji),[m,s]),u=i.useCallback(w=>l.mutate({roomId:e,entryId:n.id,emoji:w,viewerAuthorId:s}),[l,e,n.id,s]),c=i.useMemo(()=>({quick:t,mine:f,onToggle:u,disabled:d}),[t,f,u,d]);return{reactions:m,toggle:u,quickRow:c}}function No({barRef:e,pillsRef:n,hasReactions:s}){return t=>{var r,l;if(t.target!==t.currentTarget)return;const{key:o}=t;if(o==="ArrowDown"&&s){t.preventDefault(),(r=n.current)==null||r.focusFirst();return}o!=="ArrowRight"&&o!=="Enter"||(t.preventDefault(),(l=e.current)==null||l.focusFirst())}}function jo(e,n){var c,w;const s=n.body.subjectAuthorId,t=n.body.notice,o=n.kind==="notice"&&t!==void 0&&s!==void 0&&xn.includes(t),r=St(e,{enabled:o}),l=Ce(),d=Ae(),m=ne(),f=o?((w=(c=r.data)==null?void 0:c.bindings.find(h=>h.authorId===s))==null?void 0:w.sessionId)??null:null,u=i.useCallback(h=>{h.button!==0||h.metaKey||h.ctrlKey||h.shiftKey||h.altKey||(h.preventDefault(),!(f===null||s===void 0)&&yn({queryClient:d,transport:m},e,s).then(g=>{g.kind!=="none"&&l(ce({session:g.kind==="bound"?g.sessionId:f}))}))},[s,l,d,e,f,m]);return i.useMemo(()=>f===null?null:{href:bn({session:f}),onOpen:u},[u,f])}const pe="mention",Fe="author_id",Ao={[pe]:[Fe]},So=[pe];function Co(e,n){if(!n||n.length===0)return e;const s=Mo(e,n);if(s.length===0)return e;let t=e;for(let o=s.length-1;o>=0;o--){const{offset:r,length:l,authorId:d}=s[o],m=t.slice(0,r),f=t.slice(r,r+l),u=t.slice(r+l);t=`${m}<${pe} ${Fe}="${d}">${f}</${pe}>${u}`}return t}function Mo(e,n){const s=[...n].sort((r,l)=>r.offset-l.offset),t=[];let o=0;for(const r of s)r.offset<o||r.offset+r.length>e.length||(t.push(r),o=r.offset+r.length);return t}const Oo=new Map,_t=i.createContext(Oo);function To({authors:e,children:n}){return a.jsx(_t.Provider,{value:e,children:n})}function _o(e){const n=i.useContext(_t);return e===void 0?void 0:n.get(e)}function Eo(e){return typeof e=="string"?e.replace(/^@/,""):""}function Po({authorId:e,children:n}){const s=_o(e),t=Ne(s==null?void 0:s.agentRef),{open:o}=dt();if(!s)return a.jsx(Ve,{kind:"human",label:Eo(n),resolved:!1});const r=rt({record:s,override:t==null?void 0:t.visual}),l=ct(s,t==null?void 0:t.memberId),d=l===void 0?void 0:()=>o(l),m=d?{role:"button",tabIndex:0,"aria-label":`View ${s.displayName}’s profile`,onClick:d,onKeyDown:f=>{f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),d())}}:{};return a.jsx(At,{onViewProfile:d,identity:{kind:s.kind,displayName:s.displayName,handle:s.handle??void 0,color:r.color,emoji:r.emoji,imageUrl:r.imageUrl,origin:s.origin,agent:t&&{runtime:t.runtime,...t.model&&{model:t.model}}},children:a.jsx(Ve,{kind:s.kind,label:s.displayName,handle:s.handle??void 0,color:s.color,origin:s.origin,resolved:!0,interactive:d!==void 0,...m})})}function $o(e){return{mention:n=>{const s=n[Fe],t=typeof s=="string"?s:void 0;return!t||!e.has(t)?a.jsx(a.Fragment,{children:n.children}):a.jsx(Po,{authorId:t,children:n.children})}}}function Do({entry:e,authors:n}){const s=i.useMemo(()=>Co(e.body.text,e.mentionSpans),[e.body.text,e.mentionSpans]),t=i.useMemo(()=>{var r;return new Set(((r=e.mentionSpans)==null?void 0:r.map(l=>l.authorId))??[])},[e.mentionSpans]),o=i.useMemo(()=>$o(t),[t]);return a.jsx(To,{authors:n,children:a.jsx(Ns,{content:s,className:"msg-prose",allowedTags:Ao,literalTagContent:So,components:o,renderers:Js})})}function Fo(e){return function(s){return a.jsx(Do,{entry:s,authors:e})}}const Et="the top folder";function Qe(e){return e.slice(e.lastIndexOf("/")+1)}function Lo(e){const n=e.lastIndexOf("/");return n===-1?"":e.slice(0,n)}function zo(e){return e===""?Et:`${e}/`}function ve(e){return e.target!==void 0?e.target===""?Et:e.target:zo(Lo(e.paths[0]??""))}function Bo(e,n){const s=e.paths[0]??"",t=e.target;switch(e.kind){case"edit":return`${n} edited ${t??s}`;case"add":return`${n} added ${t??s}`;case"upload":return e.pathCount===1?`${n} uploaded ${Qe(s)} to ${ve(e)}`:`${n} uploaded ${e.pathCount} files to ${ve(e)}`;case"rename":{const o=e.from??"";return t!==void 0?`${n} renamed ${o} to ${t}`:o.endsWith("/")?`${n} renamed ${o}`:`${n} renamed ${o} to ${s}`}case"delete":return t!==void 0?`${n} deleted ${t}`:e.pathCount===1?`${n} deleted ${s}`:`${n} deleted ${e.pathCount} files`;case"from-attachment":return`${n} saved ${Qe(s)} from the chat to ${ve(e)}`}}const Ho=i.lazy(()=>vn(()=>import("./index-DijWcSDZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.SaveToRoomFilesButton})));function Pt({roomId:e,entry:n,author:s,authorRef:t,authors:o,viewerAuthorId:r,authorNames:l,reactionFrequents:d,streamStalled:m,isMember:f=!0,grouping:u,orphanedReply:c,answers:w,feedPosition:h,rowId:g}){const k=Te(n.createdAt),x=i.useMemo(()=>{const K=ko(n.body.text),xe=gs(n.attachments??[]);if(xe===null)return K;const Be=K??n.body.text.trim();return Be.length>0?`${Be} ${xe}`:xe},[n.body.text,n.attachments]),N=i.useId(),p=`${N}-author`,b=`${N}-content`,_=`${N}-summary`,T=i.useRef(null),$=i.useRef(null),M=i.useRef(null),{reactions:E,toggle:P,quickRow:I}=Io({roomId:e,entry:n,viewerAuthorId:r,reactionFrequents:d,streamStalled:m,isMember:f}),F=Ne(t==null?void 0:t.agentRef),{open:D}=dt(),C=t===void 0?void 0:ct(t,F==null?void 0:F.memberId),B=i.useCallback(()=>{C!==void 0&&D(C)},[D,C]),L=C===void 0?void 0:B,H=co({roomId:e,entry:n,author:t,viewerAuthorId:r,onViewProfile:L}),W=No({barRef:$,pillsRef:M,hasReactions:E.length>0}),z=i.useCallback(()=>{var K;return(K=T.current)==null?void 0:K.focus()},[]),U=i.useMemo(()=>Fo(o),[o]),R=i.useCallback(K=>a.jsx(i.Suspense,{fallback:null,children:a.jsx(Ho,{roomId:e,attachment:K})}),[e]),y=xo(),O=n.body.subjectAuthorId??n.authorId,S=o.get(O),v=Ne(S==null?void 0:S.agentRef),A=jo(e,n),j=uo(n);if(j.kind==="notice")return a.jsx(oo,{entry:n,feedPosition:h,rowId:g,sessionLink:A,subjectName:S==null?void 0:S.displayName});if(j.kind==="moment")return a.jsx(ao,{entry:n,moment:j.moment,subject:O===n.authorId?s:Y(O,o,y),subjectIdentity:{handle:(S==null?void 0:S.handle)??void 0,origin:S==null?void 0:S.origin,agent:v&&{runtime:v.runtime,...v.model&&{model:v.model}}},feedPosition:h,rowId:g});const q=u.position==="first"||u.position==="only";return a.jsxs(G.Root,{ref:T,id:g,position:u.position,actions:H,reactions:I,"data-testid":"room-entry",tabIndex:0,...bo({showAuthorHeader:q,headerId:p,displayName:s.displayName,time:k,summary:x,contentId:b,summaryId:_,feedPosition:h}),onKeyDown:W,children:[a.jsx(G.Gutter,{author:s,at:n.createdAt,onViewProfile:L,isSelf:n.authorId===r}),a.jsxs(G.Body,{children:[a.jsx(G.Author,{id:p,author:s,at:n.createdAt,origin:t==null?void 0:t.origin}),c===!0&&a.jsx("p",{"data-testid":"room-entry-orphan",className:"text-muted-foreground text-xs italic",children:"Replying to an earlier message"}),w!=null&&a.jsx("p",{"data-testid":"room-entry-answers",className:"text-muted-foreground mb-1 truncate text-xs italic",children:`Answering “${w.excerpt}”`}),a.jsx(G.Content,{id:b,className:"[&_:not(pre)>code]:wrap-anywhere [&_pre]:overflow-x-auto",children:n.body.fileChange?a.jsx("p",{"data-testid":"room-entry-file-change",className:"wrap-anywhere",children:Bo(n.body.fileChange,(S==null?void 0:S.displayName)??"Somebody")}):U(n,{rowId:n.id,isStreaming:!1})}),x!==null&&a.jsx("span",{id:_,className:"hidden",children:x}),a.jsx(G.Attachments,{items:n.attachments??[],renderAction:f?R:void 0}),a.jsx(G.Reactions,{ref:M,reactions:E,viewerAuthorId:r,names:l,frequents:d,onToggle:P,disabled:m===!0||!f,onExit:z}),a.jsx(G.Actions,{actions:H,reactions:I,barRef:$,onExit:z})]})]})}const Uo="room-load-older",qo=4;function $t({roomName:e}){return a.jsx(xs,{label:e===void 0?"Messages":`Messages in ${e}`,busy:!0,className:"flex flex-col gap-4 p-4","data-testid":"room-timeline-loading",children:Array.from({length:qo},(n,s)=>a.jsxs("div",{className:"flex gap-3",children:[a.jsx(se,{className:"size-7 shrink-0 rounded-full"}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[a.jsx(se,{className:"h-3 w-24"}),a.jsx(se,{className:"h-3 w-full max-w-md"})]})]},`room-skeleton-${s}`))})}function Wo({roomId:e,roomName:n,viewerAuthorId:s,entries:t,members:o,formerAuthors:r,lastReadSeq:l,reactionFrequents:d,streamStalled:m,isLoading:f,error:u,onAddAgents:c,openThreadId:w,onOpenThread:h,resumeRow:g,landOnRow:k,onTopRow:x,canLoadOlder:N=!1,isLoadingOlder:p=!1,onLoadOlder:b,ref:_}){const T=i.useMemo(()=>Ee(o,r),[o,r]),$=he(o,s),M=De(),E=i.useMemo(()=>new Map([...T].map(([y,O])=>[y,O.displayName])),[T]),P=ut(),I=mt(e,null),{topLevel:F,repliesByRoot:D,orphaned:C}=i.useMemo(()=>mo(t),[t]),B=i.useMemo(()=>new Map(t.map(y=>[y.id,y])),[t]),L=i.useMemo(()=>{const y=kn(F,l),O=Rn(F.map(v=>({id:v.id,authorId:v.body.moment?`moment:${v.id}`:v.authorId,timestamp:v.createdAt})),{now:P,lastSeenId:y.lastSeenId,unreadFromStart:y.fromStart}),S=[];N&&!f&&S.push({kind:"load-older",id:Uo});for(const v of O){if(v.kind==="day-divider"){S.push({kind:"day-divider",id:v.key,label:v.label});continue}if(v.kind==="unread-divider"){S.push({kind:"unread-divider",id:v.key});continue}const A=F[v.index];S.push({kind:"message",id:A.id,entry:A,grouping:v.grouping,position:v.index+1,answers:Ot(A,F[v.index-1],B.get.bind(B))});const j=D.get(A.id);j&&S.push({kind:"thread-reply",id:Mt(A.id),rootId:A.id,replies:j,totalReplies:A.threadReplyCount})}return S},[F,D,B,l,P,N,f]),H=i.useMemo(()=>L.map(y=>y.kind==="load-older"?{kind:"notice",id:y.id,at:"",body:null}:y.kind==="day-divider"?{kind:"day-divider",id:y.id,label:y.label}:y.kind==="unread-divider"?{kind:"unread-divider",id:y.id}:y.kind==="thread-reply"?{kind:"thread-reply",id:y.id,rootId:y.rootId,replyCount:_e(y.replies.length,y.totalReplies),lastAt:y.replies[y.replies.length-1].createdAt}:{kind:"message",id:y.id,payload:y.entry,grouping:y.grouping,author:Y(ue(y.entry,T),T,M.faces),at:y.entry.createdAt}),[L,T,M.faces]),W=i.useCallback((y,O)=>{const S=L[O.index];if(S.kind==="load-older")return b===void 0?null:a.jsx(yo,{loading:p,onLoad:b});if(S.kind==="day-divider")return a.jsx(ys,{label:S.label});if(S.kind==="unread-divider")return a.jsx(bs,{});if(S.kind==="thread-reply"){if(O.onOpenThread===void 0)return null;const A=O.onOpenThread;return a.jsx(io,{id:me(S.rootId),summary:Xs(S.replies,l,S.totalReplies),open:w===S.rootId,onOpen:()=>A(S.rootId)})}const v=ue(S.entry,T);return a.jsx(Pt,{roomId:e,entry:S.entry,author:Y(v,T,M.faces),authorRef:T.get(v),authors:T,viewerAuthorId:s,authorNames:E,reactionFrequents:d,streamStalled:m,isMember:$,grouping:S.grouping,orphanedReply:C.has(S.entry.id),answers:S.answers,feedPosition:{index:S.position,total:-1},rowId:fe(S.entry.id)})},[L,e,T,M.faces,s,E,d,m,$,C,l,w,p,b]),z=i.useCallback(y=>{if(y.kind==="message")return fe(y.id);if(y.kind==="thread-reply")return me(y.rootId)},[]);if(u)return a.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[a.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load these messages"}),a.jsx("p",{className:"max-w-sm",children:"Nothing was lost. Reload to try again."})]});const U=o.some(y=>y.author.kind==="agent"),R=a.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[a.jsx(wn,{className:"text-muted-foreground/50 size-8","aria-hidden":!0}),a.jsx("p",{className:"text-foreground font-medium",children:"Nothing said here yet"}),a.jsx("p",{className:"max-w-sm",children:U?"Say something to get it going.":"Nothing answers until you add an agent."}),a.jsx(Se,{type:"button",size:"sm",variant:U?"ghost":"default",onClick:c,className:"mt-1",children:U?"Add more agents":"Add agents"})]});return a.jsx(Tt,{known:M,children:a.jsx(Q.Timeline,{ref:_,conversationId:e,label:`Messages in ${n}`,rows:H,renderRow:W,onOpenThread:h,domIdOf:z,...g===void 0?{}:{resumeRow:g},...k===void 0?{}:{landOnRow:k},...x===void 0?{}:{onTopRow:x},pending:I,viewerAuthorId:s,loading:f?a.jsx($t,{roomName:n}):void 0,empty:R,feedTestId:"room-timeline"})})}const Le={reactions:!0,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!0,turnStatus:!1,asks:!0};function Ko(e){const n=ne(),[s,t]=i.useState([]),o=i.useRef(new Map),r=i.useCallback(h=>{const g=h.map(k=>({id:crypto.randomUUID(),file:k,status:"pending",progress:0}));t(k=>[...k,...g])},[]),l=i.useCallback(h=>{o.current.delete(h),t(g=>g.filter(k=>k.id!==h))},[]),d=i.useCallback(h=>{if(!h){o.current.clear(),t([]);return}const g=new Set(h);for(const k of g)o.current.delete(k);t(k=>k.filter(x=>!g.has(x.id)))},[]),m=i.useCallback(h=>{o.current.delete(h),t(g=>g.map(k=>k.id===h&&k.status==="error"?{...k,status:"pending",progress:0,error:void 0}:k))},[]),f=i.useRef(null),u=re({meta:{suppressErrorToast:!0},mutationFn:async h=>{t(N=>N.map(p=>h.some(b=>b.id===p.id)?{...p,status:"uploading"}:p));const g=N=>{t(p=>p.map(b=>b.status==="uploading"?{...b,progress:N.percentage}:b))},k=new AbortController;f.current=k;const x=h.map(N=>N.file);return n.uploadRoomAttachments(e,x,g,k.signal)},onSettled:()=>{f.current=null},onSuccess:(h,g)=>{g.forEach((k,x)=>{const N=h[x];N&&o.current.set(k.id,N.id)}),t(k=>k.map(x=>g.findIndex(p=>p.id===x.id)===-1?x:{...x,status:"uploaded",progress:100}))},onError:h=>{t(g=>g.map(k=>k.status==="uploading"?{...k,status:"error",error:h.message}:k))}}),c=i.useCallback(()=>{var h;(h=f.current)==null||h.abort()},[]),w=i.useCallback(async()=>{const h=s.filter(k=>k.status==="error");if(h.length>0)throw new Error(h.length===1?`${h[0].file.name} didn’t upload. Try again or remove it.`:`${h.length} files didn’t upload. Try again or remove them.`);const g=s.filter(k=>k.status==="pending");return g.length>0&&await u.mutateAsync(g),s.map(k=>o.current.get(k.id)).filter(k=>k!==void 0)},[s,u]);return{pendingFiles:s,addFiles:r,removeFile:l,retryFile:m,clearFiles:d,cancelUpload:c,uploadAndGetIds:w,hasPendingFiles:s.length>0,hasFailedUpload:s.some(h=>h.status==="error"),isUploading:u.isPending}}function Dt(e){const{room:n,threadRootId:s}=e,t=vs(),o=ks(),r=Ko((n==null?void 0:n.id)??""),l=n!==void 0&&he(n.members,n.viewerAuthorId),d=i.useRef({attachments:r,post:t,reply:o,room:n,threadRootId:s});i.useEffect(()=>{d.current={attachments:r,post:t,reply:o,room:n,threadRootId:s}});const m=i.useCallback(p=>d.current.attachments.addFiles(p),[]),f=i.useCallback(p=>d.current.attachments.removeFile(p),[]),u=i.useCallback(p=>d.current.attachments.retryFile(p),[]),c=i.useCallback(()=>d.current.attachments.cancelUpload(),[]),{pendingFiles:w,hasFailedUpload:h,isUploading:g}=r,k=i.useMemo(()=>({staged:w,add:m,remove:f,retry:u,cancel:c,hasFailed:h,isUploading:g,holdsSendWhileUploading:!1}),[w,h,g,m,f,u,c]),x=i.useCallback(async p=>{const{attachments:b,post:_,reply:T,room:$,threadRootId:M}=d.current;if($===void 0)throw new Error("That room isn’t loaded yet.");if($.archived)throw new Error("This room is archived.");Re.getState().recordOpened("room",$.id);const E=In(),P=b.pendingFiles.map(C=>C.file.name),I=b.pendingFiles.map(C=>C.id),F=await b.uploadAndGetIds();b.clearFiles(I);const D=p.parentEntryId??M;if(D!==void 0){T.mutate({roomId:$.id,rootEntryId:D,text:p.text,clientId:E,attachmentIds:F,attachmentNames:P});return}_.mutate({roomId:$.id,text:p.text,clientId:E,attachmentIds:F,attachmentNames:P})},[]);return{target:i.useMemo(()=>({kind:"room",id:(n==null?void 0:n.id)??"",placeholder:n===void 0?"Message…":s===void 0?`Message ${te(n)}…`:"Reply in this thread…",canSend:n!==void 0&&!n.archived&&l,...n===void 0?{canSendReason:"Still opening this room…"}:n.archived?{canSendReason:"This room is archived. You can read it, but not add to it."}:l?{}:{canSendReason:ft},send:x,attachments:k}),[n,s,l,k,x]),attachments:r}}function Go(e){const{roomId:n,entrySeq:s,entries:t,historyLoaded:o}=e,r=s===void 0?null:`${n}:${s}`,l=i.useMemo(()=>{if(s===void 0)return null;const g=t.find(p=>p.seq===s);if(g===void 0)return null;const k=Pe(t,g.id);if(k===null)return null;const x=J(g)??null,N=x!==null&&k.rowId!==g.id;return{roomRowId:k.rowId,threadRootId:N?x:null,entryId:g.id}},[t,s]),d=i.useRef(null),m=(l==null?void 0:l.threadRootId)??null;i.useEffect(()=>{r===null||m===null||d.current!==r&&(d.current=r,X.getState().openThread(n,m))},[r,n,m]);const f=i.useRef(null);i.useEffect(()=>{r===null||!o||l===null&&f.current!==r&&(f.current=r,pt.info("That message isn’t in the loaded history",{description:"Only recent messages are open. Nothing was lost."}))},[r,o,l]);const u=i.useRef(null),c=i.useCallback(()=>{if(!(r===null||u.current===r))return u.current=r,l==null?void 0:l.roomRowId},[r,l]),w=i.useRef(null),h=i.useCallback(()=>{if(!(r===null||w.current===r))return w.current=r,(l==null?void 0:l.threadRootId)===null||l==null?void 0:l.entryId},[r,l]);return{roomRow:s===void 0?void 0:c,threadRow:s===void 0?void 0:h}}function Vo(e,n){const[s,t]=i.useState({roomId:null,seq:null});return s.roomId===e?s.seq:e===null?(t({roomId:null,seq:null}),null):n===null?null:(t({roomId:e,seq:n}),n)}const Xo=600;function Yo(e){return document.getElementById(me(e))??document.getElementById(fe(e))}function Qo(){const e=i.useRef(null);return i.useEffect(()=>()=>{var s;return(s=e.current)==null?void 0:s.call(e)},[]),{arm:i.useCallback(s=>{var d;(d=e.current)==null||d.call(e);let t=0;const o=Date.now()+Xo;let r=!1;const l=()=>{if(r)return;const m=document.activeElement;if(m===null||m===document.body||!m.isConnected){const u=Yo(s);if(u!==null){u.focus();return}}Date.now()>=o||(t=requestAnimationFrame(l))};t=requestAnimationFrame(l),e.current=()=>{r=!0,cancelAnimationFrame(t)}},[])}}function Jo({roomId:e,route:n,urlThreadId:s,openThreadId:t,entries:o,historyLoaded:r}){const l=Nn(),d=i.useRef(null);i.useEffect(()=>{if(e!==null){if(d.current!==e&&(d.current=e,s!==void 0)){X.getState().openThread(e,s);return}if(r&&t!==void 0){const m=o.find(u=>u.id===t),f=m===void 0?void 0:Ct(m);if(f!==void 0&&f!==t){const u=X.getState().open[e];X.getState().openThread(e,f,(u==null?void 0:u.focusComposer)??!1);return}}t!==s&&(l==null||l({to:n,search:m=>({...m,thread:t}),replace:!0}))}},[e,n,t,s,o,r,l])}const Zo=6,Ft="jump-back-in-listbox";function ze(e){return`jump-back-in-item-${e}`}const er='[role="combobox"]';function oe(e){return e instanceof Element&&e.matches(er)}function tr({value:e,yieldToPalette:n=!1,enabled:s=!0}){const t=Ce(),o=jn(),[r,l]=i.useState(!1),[d,m]=i.useState({stamp:"",index:0}),[f,u]=i.useState(!1),[c,w]=i.useState(!1);e.length>0&&!c&&w(!0);const h=i.useRef(!1);i.useEffect(()=>{h.current=!0},[]);const{data:g}=it({enabled:s}),k=i.useMemo(()=>((g==null?void 0:g.agents)??[]).map(R=>R.projectPath),[g]),{data:x}=lt(k,{enabled:s}),N=i.useMemo(()=>x??{},[x]),p=i.useMemo(()=>An(k,N),[k,N]),b=i.useMemo(()=>new Map(k.map(R=>[at(R),R])),[k]),_=i.useCallback(R=>Sn({room:R,agentsByPath:N,pathByAgentRef:b}),[N,b]),T=i.useMemo(()=>Cn(o.muted),[o.muted]),{items:$}=us({mutedRoomIds:T,enabled:s}),M=i.useMemo(()=>$.slice(0,Zo),[$]),E=s&&r&&!f&&!c&&!n&&e.length===0&&M.length>0,P=`${E}:${M.length}`,I=d.stamp===P?d.index:0,F=i.useCallback(R=>{h.current&&oe(R.target)&&(u(!1),w(!1),l(!0))},[]),D=i.useCallback(R=>{oe(R.target)&&l(!0)},[]),C=i.useCallback(R=>{oe(R.target)&&l(!1)},[]),B=i.useCallback(R=>{M.length!==0&&m(y=>{const O=y.stamp===P?y.index:0;return{stamp:P,index:(O+R+M.length)%M.length}})},[M.length,P]),L=i.useCallback(()=>B(1),[B]),H=i.useCallback(()=>B(-1),[B]),W=i.useCallback(()=>{u(!0)},[]),z=i.useCallback(R=>{if(u(!0),R.kind==="session"){R.session.cwd&&Re.getState().recordOpened("agent",R.session.cwd),t(ce({dir:R.session.cwd??void 0,session:R.session.id}));return}Re.getState().recordOpened("room",R.room.id),t({...ht.channels(),search:{id:R.room.id}})},[t]),U=i.useCallback(()=>{const R=M[I];!E||!R||z(R)},[E,M,I,z]);return{isOpen:E,hasRows:M.length>0,rows:M,agents:N,displayNames:p,visualOf:_,selectedIndex:I,activeDescendantId:E&&M[I]!==void 0?ze(I):void 0,listboxId:E?Ft:void 0,handleFocus:F,handleBlur:C,handlePointerDown:D,moveDown:L,moveUp:H,selectHighlighted:U,selectRow:z,dismiss:W}}function Lt({mark:e,label:n,title:s,summary:t,lastActivityAt:o,index:r,isSelected:l,now:d,onSelect:m}){const f=i.useMemo(()=>Number.isNaN(Date.parse(o))?null:Pn(o),[o,d]);return a.jsxs("div",{id:ze(r),role:"option","aria-selected":l,"data-selected":l,title:s,onClick:m,className:"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-start gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[a.jsx("span",{className:"mt-px flex shrink-0 items-center",children:e}),a.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsxs("span",{className:"flex w-full items-center gap-1.5",children:[a.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm",children:n}),f!==null&&a.jsx("span",{className:"text-muted-foreground/60 text-3xs shrink-0",children:f})]}),t!==null&&a.jsx("span",{className:"text-muted-foreground/70 text-2xs truncate",children:t})]})]})}function nr({item:e,agent:n,displayName:s,index:t,isSelected:o,now:r,onSelect:l}){const d=Mn(n,e.session.cwd??s);return a.jsx(Lt,{mark:a.jsx(On,{color:d.color,emoji:d.emoji,size:"xs"}),label:e.name,title:`${s} · ${e.name}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:t,isSelected:o,now:r,onSelect:l})}function sr({item:e,visual:n,index:s,isSelected:t,now:o,onSelect:r}){return a.jsx(Lt,{mark:a.jsx(_n,{room:e.room,participants:e.room.participants,visuals:En(n)}),label:a.jsx(Tn,{room:e.room}),title:e.summary===null?e.name:`${e.name} · ${e.summary}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:s,isSelected:t,now:o,onSelect:r})}function or({rows:e,selectedIndex:n,agents:s={},displayNames:t={},visualOf:o,onSelect:r}){const l=ut(6e4);return i.useEffect(()=>{var d,m;(m=(d=document.getElementById(ze(n)))==null?void 0:d.scrollIntoView)==null||m.call(d,{block:"nearest"})},[n]),a.jsx(Me.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:d=>d.preventDefault(),children:a.jsx("div",{id:Ft,role:"listbox","aria-label":"Jump back in",className:"max-h-72 overflow-y-auto p-1.5",children:e.map((d,m)=>{var f;return d.kind==="session"?a.jsx(nr,{item:d,agent:d.session.cwd&&s[d.session.cwd]||null,displayName:d.session.cwd&&t[d.session.cwd]||((f=d.session.cwd)==null?void 0:f.split("/").pop())||"Agent",index:m,isSelected:m===n,now:l,onSelect:()=>r(d)},`session-${d.id}`):a.jsx(sr,{item:d,visual:o(d.room),index:m,isSelected:m===n,now:l,onSelect:()=>r(d)},`room-${d.id}`)})})})}const Je={people:"People",agents:"Agents"},rr=["people","agents"];function ar(e,n){const s=[];for(const{author:t}of e){if(t.kind==="system"||t.id===n||t.retired)continue;const o=t.handle;s.push({section:t.kind==="agent"?"agents":"people",authorId:t.id,label:t.displayName,...o?{handle:o}:{},...t.emoji?{emoji:t.emoji}:{},...t.color?{color:t.color}:{},disabled:!o,...o?{}:{disabledReason:"No @name"}})}return s}function ir(e,n,s){const t=n.trim().toLowerCase(),o=e.map((r,l)=>({row:r,position:l,tier:lr(r,t)})).filter(r=>r.tier!==null).sort((r,l)=>r.tier-l.tier||r.position-l.position);return s.flatMap(r=>o.filter(l=>l.row.section===r).map(({row:l})=>l))}function lr(e,n){var o;if(n==="")return 0;const s=[(o=e.handle)==null?void 0:o.toLowerCase(),e.label.toLowerCase()].filter(r=>r!==void 0);let t=null;for(const r of s){const l=r===n?0:r.startsWith(n)?1:r.includes(n)?2:null;l!==null&&(t===null||l<t)&&(t=l)}return t}function ie(e,n,s){var r;const t=e.length;if(t===0)return 0;let o=(n%t+t)%t;for(let l=0;l<t;l++){if(!((r=e[o])!=null&&r.disabled))return o;o=(o+s+t)%t}return 0}function dr(e,n,s,t){const o=e.slice(0,n),r=e.slice(n+1+s.length),l=`@${t}`,d=r.startsWith(" ")?"":" ";return{value:o+l+d+r,cursorPos:o.length+l.length+1}}const cr=/(^|\s)@([A-Za-z0-9_.-]*)$/,zt="mention-palette-listbox";function je(e){return`mention-item-${e}`}function ur({members:e,viewerAuthorId:n,text:s,sectionOrder:t=rr}){var D;const[o,r]=i.useState(!1),[l,d]=i.useState(""),[m,f]=i.useState(-1),u=$n(s),c=i.useRef(!1),w=i.useMemo(()=>ar(e,n),[e,n]),h=i.useMemo(()=>o?ir(w,l,t):[],[w,l,o,t]),[g,k]=i.useState(null),x=g!==null&&g.query===l&&g.open===o?g.index:ie(h,0,1),N=h[x],p=h.length===0||N!==void 0&&!N.disabled?x:ie(h,0,1),b=i.useCallback((C,B)=>{const L=C.slice(0,B).match(cr);if(!L){r(!1);return}r(!0),d(L[2]),f((L.index??0)+L[1].length)},[]),_=i.useCallback(C=>{u.write(C),c.current=!1},[u]),T=i.useCallback(C=>{c.current||b(u.read(),C)},[b,u]),$=i.useCallback(()=>{k({query:l,open:o,index:ie(h,p+1,1)})},[h,p,l,o]),M=i.useCallback(()=>{k({query:l,open:o,index:ie(h,p-1,-1)})},[h,p,l,o]),E=i.useCallback(C=>C.disabled||C.handle===void 0?null:(c.current=!0,r(!1),dr(u.read(),m,l,C.handle)),[m,l,u]),P=i.useCallback(()=>{const C=h[p];return C?E(C):(r(!1),null)},[h,p,E]),I=i.useCallback(()=>{c.current=!0,r(!1)},[]),F=h.some(C=>!C.disabled);return{isOpen:o,hasSelectableRows:F,rows:h,selectedIndex:p,activeDescendantId:o&&((D=h[p])==null?void 0:D.disabled)===!1?je(p):void 0,listboxId:o?zt:void 0,noteTextChange:_,handleCursorChange:T,moveDown:$,moveUp:M,selectHighlighted:P,selectRow:E,dismiss:I}}function mr({rows:e,selectedIndex:n,onSelect:s}){const t=i.useMemo(()=>{const o=[];return e.forEach((r,l)=>{const d=o[o.length-1];d&&d.section===r.section?d.items.push({row:r,index:l}):o.push({section:r.section,items:[{row:r,index:l}]})}),o},[e]);return i.useEffect(()=>{var o;(o=document.getElementById(je(n)))==null||o.scrollIntoView({block:"nearest"})},[n]),a.jsx(Me.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:o=>o.preventDefault(),children:a.jsx("div",{id:zt,role:"listbox","aria-label":"Mentions",className:"max-h-72 overflow-y-auto p-1.5",children:e.length===0?a.jsx("div",{className:"text-muted-foreground px-2 py-4 text-center text-sm",children:"No one by that name."}):t.map(({section:o,items:r},l)=>a.jsxs("div",{role:"group","aria-label":Je[o],children:[l>0&&a.jsx("div",{className:"bg-border mx-2 my-1.5 h-px"}),a.jsx("div",{"aria-hidden":!0,className:"text-muted-foreground/70 text-2xs px-2 pt-1.5 pb-1 font-medium tracking-wide uppercase",children:Je[o]}),r.map(({row:d,index:m})=>{const f=m===n;return a.jsxs("div",{id:je(m),role:"option","aria-selected":f,"aria-disabled":d.disabled,"data-selected":f,"data-disabled":d.disabled,onClick:()=>{d.disabled||s(d)},className:d.disabled?"flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1.5 opacity-45":"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[a.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 text-center text-sm leading-none",children:d.emoji}),a.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:d.label}),d.handle!==void 0&&a.jsxs("span",{className:"text-muted-foreground/70 truncate font-mono text-xs",children:["@",d.handle]}),d.disabledReason!==void 0&&a.jsx("span",{className:"text-muted-foreground/70 text-2xs ml-auto shrink-0",children:d.disabledReason})]},d.authorId)})]},o))})})}function Bt({room:e,threadRootId:n,focusOnMount:s,offerJumpBackIn:t,onFocusChange:o,attachments:r}){const l=n===void 0?e.id:ot(e.id,n),d=Dn(l),{target:m}=yt(),f=Fn(),u=Ln(l),c=i.useRef(null),w=he(e.members,e.viewerAuthorId),h=i.useRef(!1),g=ur({members:e.members,viewerAuthorId:e.viewerAuthorId,text:d}),k=t===!0,x=tr({value:d,yieldToPalette:g.isOpen,enabled:k}),N=i.useRef(u);i.useEffect(()=>{var I;u!==N.current&&(N.current=u,(I=c.current)==null||I.focus())},[u]),i.useEffect(()=>{var I;s===!0&&((I=c.current)==null||I.focusUnlessTouch())},[]);const p=i.useCallback(I=>le.getState().set(l,I),[l]),[b,_]=i.useState(null);i.useLayoutEffect(()=>{var I;b!==null&&((I=c.current)==null||I.focusAt(b.pos))},[b]);const T=i.useCallback(I=>{I&&(p(I.value),_({pos:I.cursorPos}))},[p]),$=i.useCallback(I=>T(g.selectRow(I)),[g,T]),M=i.useCallback(()=>T(g.selectHighlighted()),[g,T]),E=()=>{if(m===null||!m.canSend||h.current)return;g.dismiss();const I=le.getState().take(l).trim();if(I==="")return;const F=r.pendingFiles.length>0;F&&(h.current=!0),m.send({text:I}).catch(()=>{const D=le.getState(),C=D.drafts[l]??"";D.set(l,C===""?I:`${I}
|
|
44
|
+
${C}`)}).finally(()=>{F&&(h.current=!1)})};if(!w)return a.jsxs("div",{className:"flex items-center justify-between gap-3 border-t px-4 py-3",children:[a.jsx("p",{className:"text-muted-foreground text-sm",children:ft}),a.jsx(Se,{type:"button",size:"sm",variant:"outline",disabled:f.isPending,onClick:()=>f.mutate({roomId:e.id,authorId:e.viewerAuthorId},{onSuccess:()=>pt.success(`You joined ${te(e)}`)}),children:zn})]});const P=a.jsx(Q.Composer,{inputRef:c,value:d,onChange:I=>{p(I),g.noteTextChange(I)},onSubmit:E,head:a.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:g.isOpen&&g.rows.length===0?"No one by that name.":""}),mentionPicker:a.jsx(we,{children:g.isOpen&&a.jsx(mr,{rows:g.rows,selectedIndex:g.selectedIndex,onSelect:$})}),overlays:a.jsx(a.Fragment,{children:a.jsx(we,{children:x.isOpen&&a.jsx(or,{rows:x.rows,selectedIndex:x.selectedIndex,agents:x.agents,displayNames:x.displayNames,visualOf:x.visualOf,onSelect:x.selectRow})})}),input:{onCursorChange:g.handleCursorChange,isStreaming:!1,isPaletteOpen:g.isOpen||x.isOpen,paletteHasResults:x.isOpen?x.hasRows:g.hasSelectableRows,onArrowUp:x.isOpen?x.moveUp:g.moveUp,onArrowDown:x.isOpen?x.moveDown:g.moveDown,onCommandSelect:x.isOpen?x.selectHighlighted:M,onEscape:x.isOpen?x.dismiss:g.dismiss,tabPicks:!x.isOpen,onClear:()=>{p(""),g.dismiss()},activeDescendantId:x.isOpen?x.activeDescendantId:g.activeDescendantId,paletteListboxId:x.isOpen?x.listboxId:g.listboxId,contextKey:l,...r.hasFailedUpload?{canSubmitReason:"A file didn’t upload. Try it again or remove it, then send."}:{}}});return!k&&o===void 0?P:a.jsx("section",{className:"flex flex-col","data-testid":Bn.homeComposer,onFocus:I=>{x.handleFocus(I),oe(I.target)&&(o==null||o(!0))},onBlur:I=>{x.handleBlur(I),oe(I.target)&&(o==null||o(!1))},onPointerDown:x.handlePointerDown,children:P})}function fr(e){return e.kind!=="channel"||e.bridge!=null||e.archived?!1:!e.members.some(n=>n.author.kind==="agent")}function pr({room:e,hasEntries:n,onAddAgents:s}){return!n||!fr(e)?null:a.jsxs("p",{className:"text-muted-foreground shrink-0 px-4 pb-1 text-xs","data-testid":"no-agent-hint",children:["No agent is in this channel to answer."," ",a.jsx("button",{type:"button",onClick:s,className:"text-foreground focus-visible:ring-ring rounded-sm underline underline-offset-2 focus-visible:ring-2 focus-visible:outline-none",children:"Add one"})," ","to get answers here."]})}function hr({roomId:e}){const{approvals:n}=Hn(),s=Un(n).filter(t=>t.roomId===e);return s.length===0?null:a.jsx("section",{"data-slot":"room-approvals","aria-label":"Requests waiting on you",className:"shrink-0 px-3 pb-2 md:px-4",children:a.jsx(qn,{approvals:s})})}function gr({roomId:e}){const{data:n}=$s("pending"),s=(n??[]).filter(t=>t.roomId===e);return s.length===0?null:a.jsx("section",{"data-slot":"room-agent-requests","aria-label":"Apps agents are asking for",className:"shrink-0 space-y-2 px-3 pb-2 md:px-4",children:s.map(t=>a.jsx(Ds,{request:t},t.requestId))})}const xr="An agent",Ze=64,ke=3,yr=new Set;function Ht({room:e,entries:n,scope:s,laneScope:t,stalled:o,unavailable:r=!1,onRetry:l,onScrollToRow:d}){const m=Ce(),f=Wn(e.id,s),u=Kn(e.id,s),c=Gn(e.id,s),[w,h]=i.useState(!1),g=St(e.id,{enabled:w}),k=Vn(),{mutate:x}=Ks(),[N,p]=i.useState(yr),b=i.useCallback(v=>{p(A=>new Set(A).add(v)),x({roomId:e.id,authorId:v},{onSettled:()=>p(A=>{const j=new Set(A);return j.delete(v),j})})},[x,e.id]),_=Gs(),[T,$]=i.useState(()=>new Map),M=Xn(),E=De(),P=i.useMemo(()=>Ee(e.members,e.formerAuthors),[e.members,e.formerAuthors]),I=i.useCallback(v=>{var A;return((A=P.get(v))==null?void 0:A.displayName)??xr},[P]),{interactions:F}=Yn(),D=i.useMemo(()=>F.filter(v=>v.roomId===e.id),[F,e.id]),C=i.useMemo(()=>{var A;const v={};for(const j of D){if(j.roomAuthorId===void 0)continue;const q=(A=P.get(j.roomAuthorId))==null?void 0:A.displayName;q!==void 0&&(v[j.sessionId]=q)}return v},[D,P]),B=i.useMemo(()=>f.map(v=>({authorId:v.authorId,name:I(v.authorId),state:v.state,since:v.since,activity:v.activity??null})),[f,I]),L=i.useMemo(()=>u.map(v=>{var j;const A=(j=M.data)==null?void 0:j.find(q=>q.id===v.behindRoomId);return{authorId:v.authorId,name:I(v.authorId),since:v.since,behind:{roomId:v.behindRoomId,title:A===void 0?null:te(A)},othersWaiting:v.othersWaiting,severalInTheWay:v.severalInTheWay}}),[u,I,M.data]),H=i.useMemo(()=>{const v=new Set;for(const A of u)T.get(A.authorId)===A.entryId&&v.add(A.authorId);return v},[u,T]),W=i.useMemo(()=>c===null?null:{authorId:c.authorId,name:I(c.authorId)},[c,I]),z=i.useMemo(()=>Rs({capabilities:Le,asks:D,agentNames:C,stalled:o,presence:B,held:L,silentFinish:W,turn:null}),[D,C,B,L,W,o]),U=i.useMemo(()=>{var A;const v=new Map;for(const j of((A=g.data)==null?void 0:A.bindings)??[])v.set(j.authorId,j.sessionId);return v},[g.data]),R=i.useCallback(v=>{const A=n.find(q=>q.id===v);if(A===void 0)return null;const j=A.body.text.replace(/\s+/gu," ").trim();return j.length===0?null:j.length>Ze?`${j.slice(0,Ze).trimEnd()}…`:j},[n]),y=i.useCallback(v=>{var A;return t==="thread"?Ie(v):((A=Pe(n,v))==null?void 0:A.domId)??null},[n,t]),O=i.useMemo(()=>{const v=f.map(j=>{const q=R(j.entryId),K=y(j.entryId);return{authorId:j.authorId,author:Y(j.authorId,P,E.faces),state:j.state,since:j.since,doing:Qn(j.activity),replyingTo:q===null||K===null?null:{entryId:j.entryId,excerpt:q,rowId:K},sessionId:U.get(j.authorId)??null}}),A=L.map(j=>({authorId:j.authorId,author:Y(j.authorId,P,E.faces),state:"held",since:j.since,doing:null,replyingTo:null,sessionId:null,behind:j.behind,othersWaiting:j.othersWaiting}));return[...v,...A]},[f,L,P,E.faces,R,y,U]),S=i.useMemo(()=>{if(f.length===0)return null;const v=f.slice(0,ke);return a.jsxs("span",{"aria-hidden":"true",className:"flex shrink-0 -space-x-1",children:[v.map(A=>a.jsx(gt,{author:Y(A.authorId,P,E.faces),className:"ring-background size-4 ring-2"},A.authorId)),f.length>ke&&a.jsx("span",{className:"bg-muted text-muted-foreground ring-background text-3xs flex size-4 items-center justify-center rounded-full ring-2",children:`+${f.length-ke}`})]})},[f,P,E.faces]);return a.jsx(Q.LiveLane,{state:z,scope:t,onRetry:l,unavailable:r,faces:S,onPeekOpenChange:h,askCard:z.kind==="ask"?a.jsx(Jn,{ask:z.ask,...C[z.ask.sessionId]?{agentName:C[z.ask.sessionId]}:{},onOpenSession:v=>{m(ce({session:v}))},className:"border-l-0"}):void 0,peek:a.jsx(Q.LivePeek,{rows:O,onScrollToRow:d,onOpenSession:v=>{m(ce({session:v}))},onOpenRoom:v=>{m({...ht.channels(),search:{id:v}})},onAnswerFirst:v=>{const A=u.find(j=>j.authorId===v);A!==void 0&&$(j=>new Map(j).set(v,A.entryId)),_.mutate({roomId:e.id,authorId:v})},promoted:H,onStopAll:()=>k.mutate({roomId:e.id}),stopping:k.isPending,onStopAgent:b,stoppingAgents:N})})}const et=3e3;function br(e,n,s,t=Date.now){const o=i.useRef(null),r=i.useRef(new Map),l=i.useRef(new Map),d=o.current,m=r.current,f=l.current,u=t();for(const c of e){if(f.has(c.id))continue;if(d===null){f.set(c.id,"at-rest");continue}const w=m.get(c.authorId);f.set(c.id,w!==void 0&&u-w<et?"handed-off":"dropped")}return i.useEffect(()=>{if(!s)return;o.current=new Set(e.map(w=>w.id));const c=t();for(const w of n)r.current.set(w,c);for(const[w,h]of r.current)c-h>et&&r.current.delete(w);for(const w of l.current.keys())o.current.has(w)||l.current.delete(w)}),f}function vr({kind:e}){return e==="thread-error"?a.jsxs("div",{"data-slot":"thread-notice","data-testid":"room-thread-error",className:"text-muted-foreground flex flex-col items-center gap-2 px-[var(--msg-padding-x)] py-6 text-center text-sm",children:[a.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load this thread"}),a.jsx("p",{className:"max-w-sm text-xs",children:"Nothing was lost. Reload to try again."})]}):e==="thread-waiting"?a.jsxs("div",{"data-slot":"thread-notice",className:"flex flex-col gap-2 px-[var(--msg-padding-x)]",children:[a.jsx(se,{className:"h-3 w-24"}),a.jsx(se,{className:"h-3 w-full max-w-sm"})]}):a.jsx("p",{"data-slot":"thread-notice","data-testid":"room-thread-orphan",className:"text-muted-foreground border-b px-[var(--msg-padding-x)] pb-3 text-xs italic",children:"This thread’s first message is gone. Its replies remain."})}function kr({room:e,rootEntryId:n,focusComposer:s,entries:t,reactionFrequents:o,streamStalled:r,streamUnavailable:l,onRetryStream:d,historyLoaded:m,historyFailed:f=!1,landOnRow:u,pushed:c,onClose:w}){const h=i.useMemo(()=>Ee(e.members,e.formerAuthors),[e.members,e.formerAuthors]),g=Dt({room:e,threadRootId:n}),k=he(e.members,e.viewerAuthorId),x=De(),N=i.useMemo(()=>new Map([...h].map(([R,y])=>[R,y.displayName])),[h]),{root:p,replies:b}=i.useMemo(()=>{let R;const y=[];for(const O of t)O.id===n?R=O:J(O)===n&&y.push(O);return{root:R,replies:y}},[t,n]),_=p==null?void 0:p.threadReplyCount,T=_!==void 0&&_>b.length,$=p===void 0||T?-1:1+b.length,M=_e(b.length,_),E=i.useMemo(()=>new Set(b.map(R=>R.id)),[b]),P=i.useMemo(()=>({replyIds:E,inside:!0}),[E]),I=Zn(e.id,P),F=mt(e.id,n),D=br(b,I,m),C=i.useRef(null),B=i.useCallback(R=>{var y;(y=C.current)==null||y.scrollToRow(R)},[]),L=i.useRef(null);i.useEffect(()=>{var R;s||(R=L.current)==null||R.focus()},[n,s]);const H=R=>{R.key!=="Escape"||R.defaultPrevented||(R.stopPropagation(),w())},W=i.useMemo(()=>{const R=[];if(p===void 0){const y=f?"thread-error":m?"thread-orphan":"thread-waiting";R.push({kind:"notice",id:y,at:"",body:null})}else R.push({kind:"message",id:p.id,payload:p,grouping:{position:"only"},author:Y(ue(p,h),h,x.faces),at:p.createdAt});for(const y of b)R.push({kind:"message",id:y.id,payload:y,grouping:{position:"only"},author:Y(ue(y,h),h,x.faces),at:y.createdAt});return R},[p,b,h,x.faces,f,m]),z=i.useCallback(R=>{if(R.kind==="notice")return a.jsx(vr,{kind:R.id});if(R.kind!=="message")return null;const y=R.payload,O=p!==void 0&&y.id===p.id,S=b.findIndex(j=>j.id===y.id),v=a.jsx(Pt,{roomId:e.id,entry:y,rowId:Ie(y.id),author:R.author,authorRef:h.get(y.authorId),authors:h,viewerAuthorId:e.viewerAuthorId,authorNames:N,reactionFrequents:o,streamStalled:r,isMember:k,grouping:{position:"only"},answers:Ot(y,S<=0?p:b[S-1],j=>(p==null?void 0:p.id)===j?p:b.find(q=>q.id===j)),feedPosition:{index:O?1:(p===void 0?0:1)+S+1,total:$}});if(O)return M===0?v:a.jsxs(a.Fragment,{children:[v,a.jsxs("div",{"aria-hidden":!0,"data-testid":"room-thread-divider",className:"flex items-center gap-2 px-[var(--msg-padding-x)] pt-1 pb-2",children:[a.jsx("span",{className:"text-muted-foreground shrink-0 text-xs",children:M===1?"1 reply":`${M} replies`}),a.jsx("span",{className:"bg-border h-px flex-1"})]})]});const A=D.get(y.id)??"at-rest";return a.jsx("div",{className:V(A==="dropped"&&"motion-safe:animate-thread-reply-in",A==="handed-off"&&"motion-safe:animate-reply-settle"),children:v})},[p,b,M,D,e.id,e.viewerAuthorId,h,N,o,r,k,$]),U=i.useCallback(R=>R.kind==="message"?Ie(R.id):void 0,[]);return a.jsx(Tt,{known:x,children:a.jsx(Q.Root,{surface:"room",capabilities:Le,target:g.target,anchor:"rail",children:a.jsxs("section",{ref:L,"aria-label":"Thread","data-testid":"room-thread-panel",tabIndex:-1,onKeyDown:H,className:V("bg-card flex min-h-0 flex-col outline-none",c?"h-full w-full":"w-full border-l"),children:[a.jsxs("header",{className:"flex items-center gap-2 border-b px-3 py-2",children:[a.jsx("button",{type:"button",onClick:w,"aria-label":c?`Back to ${te(e)}`:"Close thread",className:V("focus-ring text-muted-foreground hover:text-foreground relative -ml-1 rounded p-1","after:absolute after:-inset-2.5 md:after:hidden"),children:c?a.jsx(es,{"aria-hidden":!0,className:"size-4"}):a.jsx(ts,{"aria-hidden":!0,className:"size-4"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"Thread"}),a.jsx("p",{className:"text-muted-foreground truncate text-xs",children:te(e)})]})]}),a.jsx(Q.Timeline,{ref:C,conversationId:`thread-${n}`,label:`Thread in ${te(e)}`,busy:!m&&!f,rows:W,renderRow:z,domIdOf:U,...u===void 0?{}:{landOnRow:u},pending:F,viewerAuthorId:e.viewerAuthorId,className:"py-3",feedTestId:"room-thread-feed"}),a.jsx(Ht,{room:e,entries:t,scope:P,laneScope:"thread",stalled:c&&r===!0,unavailable:l,onRetry:c?d:void 0,onScrollToRow:B}),a.jsx(Bt,{room:e,threadRootId:n,attachments:g.attachments,focusOnMount:s},n)]})})})}const ge="room-thread-split",Rr=320,wr=360,Ir=40,Nr=50,jr=25;function tt(e,n){return n<=0?jr:Math.min(Math.round(e/n*1e3)/10,Nr)}function Ar(e){const n=tt(Rr,e),s=Math.round((100-tt(wr,e))*10)/10;return{minPct:n,maxPct:s,defaultPct:Math.min(Math.max(Ir,n),s)}}function Sr(e,n,s){if(e===null||n===null||n<=0)return s.defaultPct;const t=e/n*100;return Math.round(Math.min(Math.max(t,s.minPct),s.maxPct)*10)/10}function Cr(e){try{const n=localStorage.getItem(e),s=n===null?NaN:Number(n);return Number.isFinite(s)&&s>0?s:null}catch{return null}}function Mr(e,n){try{localStorage.setItem(e,String(Math.round(n)))}catch{}}const Or="react-resizable-panels:room-thread-split";function Tr(){try{localStorage.removeItem(Or)}catch{}}function _r(){const[e,n]=i.useState(null),[s,t]=i.useState(null);return{ref:i.useCallback(r=>{if(r===null)return;n(r);const l=()=>t(r.offsetWidth);l();const d=new ResizeObserver(l);return d.observe(r),()=>{d.disconnect(),n(null),t(null)}},[]),element:e,width:s,sizing:Ar(s??0)}}const Er=`${ge}-room`,nt=`${ge}-thread`,st=`${ge}-handle`,Pr=4;function $r({room:e,thread:n,storageKey:s=ss.ROOM_THREAD_WIDTH}){const{ref:t,element:o,width:r,sizing:l}=_r(),[d,m]=i.useState(()=>Cr(s)),[f,u]=i.useState(null),c=i.useRef(null),w=Sr(d,r,l),h=r===null||(l.maxPct-l.minPct)/100*r<Pr,g=n!==!1;i.useEffect(Tr,[]);const k=i.useRef(!1);i.useLayoutEffect(()=>{var b;k.current&&((b=c.current)==null||b.resize(w))},[w,g]);const x=i.useRef(null),N=()=>{var $;const b=($=c.current)==null?void 0:$.getSize(),_=x.current;if(x.current=null,b===void 0||r===null||r<=0||_===b)return;const T=Math.round(b/100*r);m(T),Mr(s,T)},p=f??w;return i.useLayoutEffect(()=>{const b=o==null?void 0:o.querySelector(`[data-panel-resize-handle-id="${st}"]`);b&&(b.setAttribute("aria-controls",nt),b.setAttribute("aria-valuenow",String(Math.round(p))),b.setAttribute("aria-valuemin",String(Math.round(l.minPct))),b.setAttribute("aria-valuemax",String(Math.round(l.maxPct))))}),a.jsx("div",{ref:t,className:"h-full overflow-hidden",children:a.jsxs(ns,{direction:"horizontal",id:ge,onLayout:b=>{k.current=b.length>1,u(k.current?b[1]:null)},children:[a.jsx(qe,{id:Er,order:1,className:"flex",children:e}),g&&a.jsxs(a.Fragment,{children:[a.jsx(ms,{id:st,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:h,onDragging:b=>{var _;b&&(x.current=((_=c.current)==null?void 0:_.getSize())??null)},onKeyDownCapture:b=>{var _,T;h||(x.current=((_=c.current)==null?void 0:_.getSize())??null,!(b.key!=="Home"&&b.key!=="End")&&(b.preventDefault(),(T=c.current)==null||T.resize(b.key==="Home"?l.minPct:l.maxPct)))},onResizeEnd:N}),a.jsx(qe,{ref:c,id:nt,order:2,defaultSize:w,minSize:l.minPct,maxSize:l.maxPct,className:"flex",children:n})]})]})})}function Zr({roomId:e,threadId:n,entrySeq:s,threadRoute:t,aboveTimeline:o,aboveComposer:r,offerJumpBackIn:l,onComposerFocusChange:d}){const m=os(),f=fs(),u=rs(e),c=u==null?void 0:u.rootEntryId,w=Qo(),h=i.useCallback(()=>{var O;const y=(O=X.getState().open[e])==null?void 0:O.rootEntryId;X.getState().closeThread(e),y!==void 0&&w.arm(y)},[e,w]),g=i.useCallback(y=>{X.getState().openThread(e,y)},[e]),k=as(e),x=is(e),N=ws(e,x.isSuccess);Is(e);const p=k.data,b=i.useMemo(()=>x.data??[],[x.data]),_=Dt({room:p});Jo({roomId:e,route:t,urlThreadId:n,openThreadId:c,entries:b,historyLoaded:x.isSuccess});const T=i.useMemo(()=>{var y;return((y=p==null?void 0:p.members.find(O=>O.author.id===p.viewerAuthorId))==null?void 0:y.lastReadSeq)??null},[p]),$=Vo(e,T);ls(p,b);const M=i.useRef(null),E=i.useRef(void 0),P=i.useCallback(y=>{E.current=y},[]),I=i.useCallback(()=>E.current,[]);i.useLayoutEffect(()=>{E.current=void 0},[e]);const F=i.useCallback(y=>{var O;(O=M.current)==null||O.scrollToRow(y)},[]),D=Ys(e),{loadOlder:C,cursor:B}=D,L=i.useCallback(()=>{const y=fo(b,B);C().then(()=>{y!==null&&requestAnimationFrame(()=>{var O;return(O=M.current)==null?void 0:O.scrollToRow(y.domId)})})},[b,B,C]),H=Go({roomId:e,entrySeq:s,entries:b,historyLoaded:x.isSuccess}),W=i.useMemo(()=>c===void 0?void 0:{replyIds:new Set(b.filter(O=>J(O)===c).map(O=>O.id)),inside:!1},[b,c]);if(k.isLoading)return a.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:a.jsx($t,{})});if(k.isError||!p)return a.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[a.jsx("p",{className:"text-foreground font-medium",children:"That channel or DM isn’t here"}),a.jsx("p",{className:"max-w-sm",children:"It may be archived, or the link is old."})]});const z=u!==void 0&&a.jsx(kr,{room:p,rootEntryId:u.rootEntryId,focusComposer:u.focusComposer,entries:b,reactionFrequents:p.reactionFrequents,streamStalled:N.stalled,streamUnavailable:N.unavailable,onRetryStream:N.retry,historyLoaded:x.isSuccess,historyFailed:x.isError,...H.threadRow===void 0?{}:{landOnRow:H.threadRow},pushed:m,onClose:h},u.rootEntryId),U=a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[o,a.jsx(Wo,{ref:M,roomId:p.id,roomName:te(p),viewerAuthorId:p.viewerAuthorId,entries:b,members:p.members,formerAuthors:p.formerAuthors,lastReadSeq:$,reactionFrequents:p.reactionFrequents,streamStalled:N.stalled,isLoading:x.isLoading,error:x.error,onAddAgents:()=>We("add",p.id),openThreadId:c,onOpenThread:g,resumeRow:I,...H.roomRow===void 0?{}:{landOnRow:H.roomRow},onTopRow:P,canLoadOlder:D.canLoadOlder,isLoadingOlder:D.isLoadingOlder,onLoadOlder:L}),r,a.jsx(hr,{roomId:p.id}),a.jsx(gr,{roomId:p.id}),a.jsx(Ht,{room:p,entries:b,scope:W,laneScope:"room",stalled:N.stalled,unavailable:N.unavailable,onRetry:N.retry,onScrollToRow:F}),a.jsx(pr,{room:p,hasEntries:b.length>0,onAddAgents:()=>We("add",p.id)}),a.jsx(Bt,{room:p,attachments:_.attachments,offerJumpBackIn:l,onFocusChange:d},p.id)]}),R={surface:"room",capabilities:Le,target:_.target,anchor:"rail"};return m?a.jsx(Q.Root,{...R,children:a.jsx(we,{initial:!1,mode:"wait",children:a.jsx(Me.div,{initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:16},transition:{duration:.15,ease:[0,0,.2,1]},style:{paddingBottom:f},"data-testid":"room-surface",className:"flex h-full flex-col overflow-hidden",children:z===!1?U:z},z?`thread-${c}`:"room")})}):a.jsx(Q.Root,{...R,children:a.jsx($r,{room:U,thread:z})})}export{At as I,$t as R,io as T,Zr as a,oe as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as d,i as l,j as e,e as m,k as u,C as c,l as x,n as h,H as f}from"./index-
|
|
1
|
+
import{h as d,i as l,j as e,e as m,k as u,C as c,l as x,n as h,H as f}from"./index-C3cvP8Fo.js";function g({kind:s}){const r="text-muted-foreground size-3.5 shrink-0";return s==="dm"?e.jsx(h,{"aria-hidden":!0,className:r}):e.jsx(f,{"aria-hidden":!0,className:r})}function p(s){return s===1?"1 member":`${s} members`}function N({member:s}){var i;const r=d(),n=l(s.id);if(n.isPending)return e.jsx(m,{className:"h-16 w-full"});if(n.isError)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this member’s rooms."});const a=((i=n.data)==null?void 0:i.rooms)??[];return a.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.isSelf?"You aren’t":`${s.displayName} isn’t`," in any rooms yet."]}):e.jsx("div",{className:"flex flex-col",children:a.map(t=>{const o=e.jsxs(e.Fragment,{children:[e.jsx(g,{kind:t.kind}),e.jsx("span",{className:"min-w-0 truncate text-sm",children:u({kind:t.kind,slug:t.slug,title:t.name})}),e.jsx("span",{className:"text-muted-foreground ml-auto shrink-0 text-xs",children:p(t.memberCount)})]});return r?e.jsxs("button",{type:"button","data-slot":"profile-room-row",onClick:()=>void r({...x.channels(),search:{id:t.id}}),className:"focus-ring hover:bg-muted/50 flex h-9 items-center gap-2 rounded-md px-2 text-left transition-colors",children:[o,e.jsx(c,{"aria-hidden":!0,className:"text-muted-foreground/70 size-3.5 shrink-0"})]},t.id):e.jsx("div",{"data-slot":"profile-room-row",className:"flex h-9 items-center gap-2 rounded-md px-2",children:o},t.id)})})}export{N as RoomsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as L,j as e,a0 as ye,bx as Ee,ar as we,G as N,dP as ie,by as ue,bz as fe,bA as me,bC as xe,dQ as Te,a1 as Ae,a3 as ke,a4 as Le,ad as pe,as as Oe,dw as he,dR as De,dS as Ie,dT as Pe,a8 as j,dU as _e,dz as H,dV as Ue,am as be,B as $e,T as Re,b as He,e as Me,dW as Be,dX as ze,dY as Ke,dZ as Qe,d_ as Ve,d$ as qe}from"./index-Cga0qx1T.js";import{C as ce}from"./runtime-connect-Dn0T5YWv.js";import{a as We,d as Xe,k as Ye,e as k}from"./execution-config-ILQiJAmy.js";import{U as Fe}from"./unverified-catalog-notice-CEzu54YH.js";import{s as Ge}from"./settings-for-runtime-BoOa-ZFG.js";const Ze={duration:.12,ease:"easeOut"},Je={type:"spring",stiffness:320,damping:28};function ve({isSetHere:a,serverDefault:l,onUseServerDefault:i,warning:r,className:s,"data-testid":d}){const[u,f]=L.useState(!1),o=a?"Set here":`Server default · ${l??"none"}`,n=a&&!!i,x=e.jsxs("span",{className:N("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",r?ie.warning:ie.neutral,n&&"hover:bg-accent hover:text-accent-foreground transition-colors",s),"data-testid":d,children:[r&&e.jsx(ye,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(Ee,{mode:"wait",initial:!1,children:e.jsx(we.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:Je},exit:{opacity:0},transition:Ze,children:o},o)})]});return n?e.jsxs(ue,{open:u,onOpenChange:f,children:[e.jsx(fe,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${r?`: ${r}`:""}`,children:x})}),e.jsxs(me,{className:"w-64 p-2",align:"start",children:[e.jsx(xe,{children:"Where this value comes from"}),r&&e.jsx("p",{className:N("px-2 pt-1 text-xs",Te.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{i(),f(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":d?`${d}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["Currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"Not set. Uses the built-in default."})]})]})]}):r?e.jsx("span",{title:r,"aria-label":`${o}: ${r}`,children:x}):x}const et=["agents"];function tt(a){const l=Ae(),i=ke();return Le({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:r=>l.updateMeshAgent(r.id,r.updates),onSuccess:()=>{i.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{i.invalidateQueries({queryKey:et})}})}const ge="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function $({label:a,valueLabel:l,options:i,selected:r,isSetHere:s,serverDefault:d,warning:u,onSelect:f,onInherit:o,testId:n,showHeader:x=!0,className:C,describedBy:m,inheritText:O}){const w=pe(),[S,h]=L.useState(!1);return e.jsxs("div",{className:N("space-y-1",C),children:[x&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ge,children:a}),!w&&e.jsx(ve,{isSetHere:s,serverDefault:d,warning:u,onUseServerDefault:o,"data-testid":`${n}-chip`})]}),e.jsxs(ue,{open:S,onOpenChange:h,children:[e.jsx(fe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...m?{"aria-describedby":m}:{},"data-testid":n,children:[e.jsx("span",{className:N("truncate",u?"text-status-warning-fg":s?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(Re,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(me,{className:"w-64 p-1",align:"start",children:[e.jsx(xe,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:i.map(c=>e.jsxs("button",{type:"button","data-testid":`${n}-option-${c.value}`,onClick:()=>{f(c.value),h(!1)},className:N("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",c.value===r&&"bg-accent"),children:[c.label,c.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:c.hint})]},c.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),h(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${n}-inherit`,children:O??(d?`Use server default: ${d}`:"Use server default")})]})]})]})}function st({agent:a,onUpdate:l,className:i}){var ee,te,se,ae,ne,le,oe,re,de;const r=pe(),{data:s}=Oe(),{data:d,isPending:u}=he(),f=((ee=s==null?void 0:s.executionDefaults)==null?void 0:ee.runtime)??"claude-code",o=a.runtime??f,n=(te=s==null?void 0:s.executionDefaults)==null?void 0:te.perRuntime.find(t=>t.runtime===o),{data:x}=De(),C=We(a,{defaultRuntime:f,runtimeDeclaresCredits:t=>{var b;return((b=d==null?void 0:d.capabilities[t])==null?void 0:b.credits)!==void 0},credits:(se=s==null?void 0:s.claudeCode)==null?void 0:se.credits,runtimeDefaultsToCredits:t=>{var b,A;return((A=(b=x==null?void 0:x.defaults)==null?void 0:b[t])==null?void 0:A.runsOn)==="credits"}}),{data:m,isError:O}=Ie({runtime:o,...C?{account:j}:{}}),w=a.model!=null,S=a.effort!=null,h=(n==null?void 0:n.model)??null,c=C&&(m??[]).some(t=>t.paidFromCredits),y=c?(m??[]).find(t=>t.isDefault):void 0,T=a.model??h??(y==null?void 0:y.value)??null,M=o==="doe"&&c&&!w&&!h,p=T?(m??[]).find(t=>t.value===T):void 0,D=(n==null?void 0:n.supportsEffort)??((ae=Ge(d,o))==null?void 0:ae.supportsEffort),B=D===void 0&&u,z=D!==!1,K=p?p.supportsEffort??!1:void 0,Q=(ne=s==null?void 0:s.claudeCode)==null?void 0:ne.accounts,{nameFor:V,creditsEntry:je,resolvedAccount:q}=Pe(),W=je??(a.account===j&&((le=s==null?void 0:s.claudeCode)!=null&&le.credits)?{path:s.claudeCode.credits.path}:null),v=Q&&[...Q.flatMap(t=>t.id===null?[]:[{id:t.id,label:V(t.path),path:t.path}]),...W?[{id:j,label:_e,path:W.path}]:[]],g=a.account??null,X=g!==null,Y=o==="claude-code"&&g===j&&((oe=s==null?void 0:s.claudeCode)==null?void 0:oe.credits)!==void 0&&!s.claudeCode.credits.allowedAgents.includes(a.id),I=s!=null&&s.claudeCode&&q?V(q):null,P=tt({errorLabel:"Couldn’t change this agent’s account"}),_=L.useCallback(t=>{P.mutate({id:a.id,updates:{account:t}})},[a.id,P]),Ne=Xe({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:f,serverDefaultModel:h,knownModels:Ye(m),knownAccounts:v,accountsUnavailable:(re=s==null?void 0:s.claudeCode)==null?void 0:re.accountsUnavailable,modelSupportsEffort:K,runtimeSupportsEffort:D,runtimeLabel:t=>H(t).label}),E=t=>{var b;return((b=Ne.breakages.find(A=>t.includes(A.kind)))==null?void 0:b.message)??null},U=!B&&z&&K!==!1,F=a.effort??(n==null?void 0:n.effort)??null,G=H(o).label,Ce=o==="claude-code"&&v!==void 0&&(v.length>1||X),Se=E(["account-unregistered"]),Z=(m??[]).some(t=>t.unverified),J=L.useId();return e.jsxs("div",{className:N("grid grid-cols-2 gap-3",i),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{label:"Model",valueLabel:M?ce:(p==null?void 0:p.displayName)??T??(c?"Default":"Automatic"),options:[...(m??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:T,isSetHere:w,serverDefault:(n==null?void 0:n.model)??null,warning:E(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:Z?J:void 0,inheritText:M?ce:c&&!h?y?`Use the suggested model: ${y.displayName}`:"Use the default model":void 0}),Z&&e.jsx(Fe,{id:J}),c&&(m??[]).some(t=>t.creditsListOutOfDate)&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-out-of-date",children:"The models your DorkOS credits cover may be out of date."}),C&&O&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-unavailable",children:"Couldn’t load the models DorkOS credits cover. Try again in a moment."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ge,children:"Effort"}),(!r||!U)&&(S||U)&&e.jsx(ve,{isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:E(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),B?e.jsx(R,{testId:"agent-effort-pending",text:`Checking what ${G} supports`,warning:null}):z?U?e.jsx($,{label:"Effort",valueLabel:k(F),options:Ue.filter(t=>!(p!=null&&p.supportedEffortLevels)||p.supportedEffortLevels.includes(t)).map(t=>({value:t,label:k(t)})),selected:F,isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(R,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:E(["effort-unsupported-model"])}):e.jsx(R,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${G}`,warning:E(["effort-unsupported-runtime"])})]}),Ce&&e.jsx($,{label:"Account",valueLabel:Y?I??"Default":g!==null?((de=v==null?void 0:v.find(t=>t.id===g))==null?void 0:de.label)??g:I??"Default",options:(v??[]).map(t=>({value:t.id,label:t.label,hint:t.id===j?"Paid from your DorkOS account":be(t.path)})),selected:g,isSetHere:X,serverDefault:I,warning:Se,onSelect:t=>_(t),onInherit:()=>_(null),testId:"agent-account-row",className:"col-span-full"}),Y&&e.jsxs("div",{className:"text-muted-foreground col-span-full flex flex-wrap items-center gap-2 text-xs","data-testid":"agent-credits-not-allowed",children:[e.jsx("span",{children:"This agent’s settings name DorkOS credits. It uses your default until you allow it."}),e.jsx($e,{size:"sm",variant:"outline",className:"h-6 px-2 text-xs",disabled:P.isPending,onClick:()=>_(j),children:"Allow"})]})]})}function R({text:a,warning:l,testId:i}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":i,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const at="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function it({member:a}){const{agent:l,projectPath:i,isPending:r,update:s}=He(a),{data:d}=he();if(r)return e.jsx(Me,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const u=d?Object.keys(d.capabilities):[l.runtime],f=u.includes(l.runtime)?u:[l.runtime,...u];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:at,children:"Runs on"}),e.jsxs(Be,{value:l.runtime??"claude-code",onValueChange:o=>s({runtime:o}),children:[e.jsx(ze,{className:"h-8 text-sm",responsive:!1,children:e.jsx(Ke,{})}),e.jsx(Qe,{children:f.map(o=>e.jsx(Ve,{value:o,responsive:!1,children:H(o).label},o))})]})]}),e.jsx(st,{agent:l,onUpdate:s,className:"grid-cols-1"}),i&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(qe,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:be(i)})]})]})}export{it as RunsOnPopover};
|
|
1
|
+
import{r as L,j as e,a0 as ye,bx as Ee,ar as we,G as N,dP as ie,by as ue,bz as fe,bA as me,bC as xe,dQ as Te,a1 as Ae,a3 as ke,a4 as Le,ad as pe,as as Oe,dw as he,dR as De,dS as Ie,dT as Pe,a8 as j,dU as _e,dz as H,dV as Ue,am as be,B as $e,T as Re,b as He,e as Me,dW as Be,dX as ze,dY as Ke,dZ as Qe,d_ as Ve,d$ as qe}from"./index-C3cvP8Fo.js";import{C as ce}from"./runtime-connect-Dn0T5YWv.js";import{a as We,d as Xe,k as Ye,e as k}from"./execution-config-Ca9MDOtV.js";import{U as Fe}from"./unverified-catalog-notice-DiCIrrhU.js";import{s as Ge}from"./settings-for-runtime-BoOa-ZFG.js";const Ze={duration:.12,ease:"easeOut"},Je={type:"spring",stiffness:320,damping:28};function ve({isSetHere:a,serverDefault:l,onUseServerDefault:i,warning:r,className:s,"data-testid":d}){const[u,f]=L.useState(!1),o=a?"Set here":`Server default · ${l??"none"}`,n=a&&!!i,x=e.jsxs("span",{className:N("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",r?ie.warning:ie.neutral,n&&"hover:bg-accent hover:text-accent-foreground transition-colors",s),"data-testid":d,children:[r&&e.jsx(ye,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(Ee,{mode:"wait",initial:!1,children:e.jsx(we.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:Je},exit:{opacity:0},transition:Ze,children:o},o)})]});return n?e.jsxs(ue,{open:u,onOpenChange:f,children:[e.jsx(fe,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${r?`: ${r}`:""}`,children:x})}),e.jsxs(me,{className:"w-64 p-2",align:"start",children:[e.jsx(xe,{children:"Where this value comes from"}),r&&e.jsx("p",{className:N("px-2 pt-1 text-xs",Te.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{i(),f(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":d?`${d}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["Currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"Not set. Uses the built-in default."})]})]})]}):r?e.jsx("span",{title:r,"aria-label":`${o}: ${r}`,children:x}):x}const et=["agents"];function tt(a){const l=Ae(),i=ke();return Le({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:r=>l.updateMeshAgent(r.id,r.updates),onSuccess:()=>{i.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{i.invalidateQueries({queryKey:et})}})}const ge="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function $({label:a,valueLabel:l,options:i,selected:r,isSetHere:s,serverDefault:d,warning:u,onSelect:f,onInherit:o,testId:n,showHeader:x=!0,className:C,describedBy:m,inheritText:O}){const w=pe(),[S,h]=L.useState(!1);return e.jsxs("div",{className:N("space-y-1",C),children:[x&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ge,children:a}),!w&&e.jsx(ve,{isSetHere:s,serverDefault:d,warning:u,onUseServerDefault:o,"data-testid":`${n}-chip`})]}),e.jsxs(ue,{open:S,onOpenChange:h,children:[e.jsx(fe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...m?{"aria-describedby":m}:{},"data-testid":n,children:[e.jsx("span",{className:N("truncate",u?"text-status-warning-fg":s?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(Re,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(me,{className:"w-64 p-1",align:"start",children:[e.jsx(xe,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:i.map(c=>e.jsxs("button",{type:"button","data-testid":`${n}-option-${c.value}`,onClick:()=>{f(c.value),h(!1)},className:N("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",c.value===r&&"bg-accent"),children:[c.label,c.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:c.hint})]},c.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),h(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${n}-inherit`,children:O??(d?`Use server default: ${d}`:"Use server default")})]})]})]})}function st({agent:a,onUpdate:l,className:i}){var ee,te,se,ae,ne,le,oe,re,de;const r=pe(),{data:s}=Oe(),{data:d,isPending:u}=he(),f=((ee=s==null?void 0:s.executionDefaults)==null?void 0:ee.runtime)??"claude-code",o=a.runtime??f,n=(te=s==null?void 0:s.executionDefaults)==null?void 0:te.perRuntime.find(t=>t.runtime===o),{data:x}=De(),C=We(a,{defaultRuntime:f,runtimeDeclaresCredits:t=>{var b;return((b=d==null?void 0:d.capabilities[t])==null?void 0:b.credits)!==void 0},credits:(se=s==null?void 0:s.claudeCode)==null?void 0:se.credits,runtimeDefaultsToCredits:t=>{var b,A;return((A=(b=x==null?void 0:x.defaults)==null?void 0:b[t])==null?void 0:A.runsOn)==="credits"}}),{data:m,isError:O}=Ie({runtime:o,...C?{account:j}:{}}),w=a.model!=null,S=a.effort!=null,h=(n==null?void 0:n.model)??null,c=C&&(m??[]).some(t=>t.paidFromCredits),y=c?(m??[]).find(t=>t.isDefault):void 0,T=a.model??h??(y==null?void 0:y.value)??null,M=o==="doe"&&c&&!w&&!h,p=T?(m??[]).find(t=>t.value===T):void 0,D=(n==null?void 0:n.supportsEffort)??((ae=Ge(d,o))==null?void 0:ae.supportsEffort),B=D===void 0&&u,z=D!==!1,K=p?p.supportsEffort??!1:void 0,Q=(ne=s==null?void 0:s.claudeCode)==null?void 0:ne.accounts,{nameFor:V,creditsEntry:je,resolvedAccount:q}=Pe(),W=je??(a.account===j&&((le=s==null?void 0:s.claudeCode)!=null&&le.credits)?{path:s.claudeCode.credits.path}:null),v=Q&&[...Q.flatMap(t=>t.id===null?[]:[{id:t.id,label:V(t.path),path:t.path}]),...W?[{id:j,label:_e,path:W.path}]:[]],g=a.account??null,X=g!==null,Y=o==="claude-code"&&g===j&&((oe=s==null?void 0:s.claudeCode)==null?void 0:oe.credits)!==void 0&&!s.claudeCode.credits.allowedAgents.includes(a.id),I=s!=null&&s.claudeCode&&q?V(q):null,P=tt({errorLabel:"Couldn’t change this agent’s account"}),_=L.useCallback(t=>{P.mutate({id:a.id,updates:{account:t}})},[a.id,P]),Ne=Xe({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:f,serverDefaultModel:h,knownModels:Ye(m),knownAccounts:v,accountsUnavailable:(re=s==null?void 0:s.claudeCode)==null?void 0:re.accountsUnavailable,modelSupportsEffort:K,runtimeSupportsEffort:D,runtimeLabel:t=>H(t).label}),E=t=>{var b;return((b=Ne.breakages.find(A=>t.includes(A.kind)))==null?void 0:b.message)??null},U=!B&&z&&K!==!1,F=a.effort??(n==null?void 0:n.effort)??null,G=H(o).label,Ce=o==="claude-code"&&v!==void 0&&(v.length>1||X),Se=E(["account-unregistered"]),Z=(m??[]).some(t=>t.unverified),J=L.useId();return e.jsxs("div",{className:N("grid grid-cols-2 gap-3",i),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{label:"Model",valueLabel:M?ce:(p==null?void 0:p.displayName)??T??(c?"Default":"Automatic"),options:[...(m??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:T,isSetHere:w,serverDefault:(n==null?void 0:n.model)??null,warning:E(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:Z?J:void 0,inheritText:M?ce:c&&!h?y?`Use the suggested model: ${y.displayName}`:"Use the default model":void 0}),Z&&e.jsx(Fe,{id:J}),c&&(m??[]).some(t=>t.creditsListOutOfDate)&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-out-of-date",children:"The models your DorkOS credits cover may be out of date."}),C&&O&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-unavailable",children:"Couldn’t load the models DorkOS credits cover. Try again in a moment."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ge,children:"Effort"}),(!r||!U)&&(S||U)&&e.jsx(ve,{isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:E(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),B?e.jsx(R,{testId:"agent-effort-pending",text:`Checking what ${G} supports`,warning:null}):z?U?e.jsx($,{label:"Effort",valueLabel:k(F),options:Ue.filter(t=>!(p!=null&&p.supportedEffortLevels)||p.supportedEffortLevels.includes(t)).map(t=>({value:t,label:k(t)})),selected:F,isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(R,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:E(["effort-unsupported-model"])}):e.jsx(R,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${G}`,warning:E(["effort-unsupported-runtime"])})]}),Ce&&e.jsx($,{label:"Account",valueLabel:Y?I??"Default":g!==null?((de=v==null?void 0:v.find(t=>t.id===g))==null?void 0:de.label)??g:I??"Default",options:(v??[]).map(t=>({value:t.id,label:t.label,hint:t.id===j?"Paid from your DorkOS account":be(t.path)})),selected:g,isSetHere:X,serverDefault:I,warning:Se,onSelect:t=>_(t),onInherit:()=>_(null),testId:"agent-account-row",className:"col-span-full"}),Y&&e.jsxs("div",{className:"text-muted-foreground col-span-full flex flex-wrap items-center gap-2 text-xs","data-testid":"agent-credits-not-allowed",children:[e.jsx("span",{children:"This agent’s settings name DorkOS credits. It uses your default until you allow it."}),e.jsx($e,{size:"sm",variant:"outline",className:"h-6 px-2 text-xs",disabled:P.isPending,onClick:()=>_(j),children:"Allow"})]})]})}function R({text:a,warning:l,testId:i}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":i,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const at="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function it({member:a}){const{agent:l,projectPath:i,isPending:r,update:s}=He(a),{data:d}=he();if(r)return e.jsx(Me,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const u=d?Object.keys(d.capabilities):[l.runtime],f=u.includes(l.runtime)?u:[l.runtime,...u];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:at,children:"Runs on"}),e.jsxs(Be,{value:l.runtime??"claude-code",onValueChange:o=>s({runtime:o}),children:[e.jsx(ze,{className:"h-8 text-sm",responsive:!1,children:e.jsx(Ke,{})}),e.jsx(Qe,{children:f.map(o=>e.jsx(Ve,{value:o,responsive:!1,children:H(o).label},o))})]})]}),e.jsx(st,{agent:l,onUpdate:s,className:"grid-cols-1"}),i&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(qe,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:be(i)})]})]})}export{it as RunsOnPopover};
|