dorkos 0.125.0 → 0.125.2
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 +27 -15
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-GdrU2Z3k.js → AboutPage-BqGlH1pd.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-D1T74VJE.js → ActivityErrorState-C4hqCedX.js} +1 -1
- package/dist/client/assets/{ActivityPage-7GXGUwd1.js → ActivityPage-frpyizcK.js} +1 -1
- package/dist/client/assets/{ActivityRow-C-8dACWp.js → ActivityRow-DB9c3g1G.js} +1 -1
- package/dist/client/assets/{AdapterIcon-CRRs6yil.js → AdapterIcon-CEHkdca8.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-K6DsejqG.js → AdapterSetupWizard-DLJMkb-u.js} +1 -1
- package/dist/client/assets/{AgentOptionRow-CF5XZmBx.js → AgentOptionRow-D-QjHi5k.js} +1 -1
- package/dist/client/assets/{AgentPicker-BXes2ymU.js → AgentPicker-DoGucmqI.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-BuXVpWfb.js → AgentRequestCard--9GA9ymH.js} +1 -1
- package/dist/client/assets/{AppearancePage-DoqoCU4j.js → AppearancePage-NHNiZrtY.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-By8jgPX3.js → ApplyToOverridesDialog-Clo55n6V.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-CgGyTDmT.js → AttentionSignalRow-BOpClaCD.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-BzDxZ-G5.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-D9Tm8ual.js} +1 -1
- package/dist/client/assets/{BindingDialog-BXfjFGvP.js → BindingDialog-DZcTXLE8.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-C-dobEns.js → BlintzCanvas-DzjdPTlx.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent-ClMFJX7T.js → CanvasCsvContent-xYUrbFeA.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-BoDE2jjA.js → CanvasFileContent-D6fTvMea.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-fnWc0B7B.js → CanvasModel3dContent-DEassnBV.js} +2 -2
- package/dist/client/assets/{ChannelComposer-DIRPjyyf.js → ChannelComposer-CutghXOq.js} +3 -3
- package/dist/client/assets/{ChatAppsOff-DlCWmwEz.js → ChatAppsOff-C00Nl_w6.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-COsbYyNC.js → CodeMirrorDiff-JYxkSqFi.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-n3l14rY7.js → CodeMirrorEditor-CVXZ9B5S.js} +1 -1
- package/dist/client/assets/{CommitmentList-S2O_hvwR.js → CommitmentList-CcCSwcZ8.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-COOCQFpL.js → CommitmentsPage-BrDbzpyR.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-PA9T4FZP.js → ComputerResourceView-BlLvMt1I.js} +1 -1
- package/dist/client/assets/{ComputerViewer-CnYUWQBS.js → ComputerViewer-B8SWICbj.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-C1ZJtNl-.js → ConnectionAccessLists-Bsb-t24W.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-BBpWiN4-.js → ConnectionsPage-RAhWxuWU.js} +1 -1
- package/dist/client/assets/{ConventionPage-sa0Yn2uq.js → ConventionPage-CNij_BXA.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-BztrmZNp.js → ExtensionPageRoute-BsGqTcyI.js} +1 -1
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-CJrqr29-.js → FloatingTanStackRouterDevtools-CqogiFob-eQVA1bL6.js} +1 -1
- package/dist/client/assets/HandlePage-XG5mP_e9.js +1 -0
- package/dist/client/assets/{HeartbeatPage-BkyUpdZt.js → HeartbeatPage-D0tKoR6G.js} +1 -1
- package/dist/client/assets/{KeyEntry-DAMr1NNY.js → KeyEntry-CSmznLcG.js} +1 -1
- package/dist/client/assets/{LexicalField-Cnzrh08A.js → LexicalField-gYKPjFfN.js} +1 -1
- package/dist/client/assets/{ManagesPage-EAbQtygH.js → ManagesPage-BF6MFrsv.js} +1 -1
- package/dist/client/assets/{Marketplace-BfADALGd.js → Marketplace-BWDlXgwH.js} +1 -1
- package/dist/client/assets/{MarketplaceSourcesView-u1WKUk-p.js → MarketplaceSourcesView-BhKzgkiO.js} +1 -1
- package/dist/client/assets/{McpAppFrame-Cz-Ttlqr.js → McpAppFrame-BotrzoHd.js} +1 -1
- package/dist/client/assets/{McpSigninBody-CkOBUhOz.js → McpSigninBody-CdeX_lYs.js} +1 -1
- package/dist/client/assets/{Model3dViewer-CvLaSO7V.js → Model3dViewer-KHktOpbD.js} +1 -1
- package/dist/client/assets/NamePage-Cdd9-mZg.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-Be_4mBPd.js → NewDirectMessageMenu-CuvKJEDY.js} +1 -1
- package/dist/client/assets/{NotificationsPage-GCk9gfsW.js → NotificationsPage-DWcgfZJD.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-BBzgYSUc.js → OpenMeshSwitch-DdJ7g4yD.js} +1 -1
- package/dist/client/assets/{OperatorIdentityForm-ZAbJ4FJn.js → OperatorIdentityForm-7FUOEWw_.js} +1 -1
- package/dist/client/assets/{PermissionHistory-DgmFpdJK.js → PermissionHistory-CgQhZrvg.js} +1 -1
- package/dist/client/assets/{PermissionsPage-DHFt_34a.js → PermissionsPage-CK34y1VF.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-CobRy95S.js → PersonalityPopover-3BA36sB0.js} +1 -1
- package/dist/client/assets/PhotoPage-DFic-gDH.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-Ux5sq2Om.js → PreviewRefusedNotice-CnqAE9sr.js} +1 -1
- package/dist/client/assets/{ProfileFields-kBzeRPfc.js → ProfileFields-CIbISW83.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-CREt4ZC3.js → ProfilePanelContainer-DPDHtTbI.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-hQbo8P6M.js → ProfileRolePicker-83GFtm2P.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-CmW1lIso.js → PromptSuggestionChips-B9chKG4w.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-Dpa-_NsO.js → ReportsToPopover-DUv03JZP.js} +1 -1
- package/dist/client/assets/{RoomSurface-BQhgKnIE.js → RoomSurface-Bq6Slne3.js} +1 -1
- package/dist/client/assets/{RoomsPage-BHUDRYzJ.js → RoomsPage-BKxzz-nN.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-bGZ6VJoF.js → RunsOnPopover-BIdmMhs9.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-DN2ElvcH.js → RuntimeConnectFlow-IaRVgmqH.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-CUFie4LV.js → RuntimeSetupDialog-Er-lzjmK.js} +1 -1
- package/dist/client/assets/{SeenDevices-D_FnsL7V.js → SeenDevices-9quCcdUW.js} +1 -1
- package/dist/client/assets/{SessionsPage-1uOPUCP9.js → SessionsPage-CGic5VaN.js} +1 -1
- package/dist/client/assets/{SettingsDialog-AbwEHDG8.js → SettingsDialog-BZ58IaK1.js} +1 -1
- package/dist/client/assets/{SkillsPage-BEobBuAr.js → SkillsPage-VRYwez5T.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-BAFSmT-z.js → TaskDialogWrapper-C9LMV8oe.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-BFw2ODM-.js → TasksEmptyState-CagC0LAa.js} +1 -1
- package/dist/client/assets/{TasksPage-C0CMgSFx.js → TasksPage-3gkHB1Pv.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-BpjxLA1n.js → TeamComputerEntry-BD89Y5e6.js} +1 -1
- package/dist/client/assets/{ToolsPage-dx-rQ2F1.js → ToolsPage-Ds6LwY79.js} +1 -1
- package/dist/client/assets/{TopologyGraph-LpxkBhGK.js → TopologyGraph-CiZ2ACcQ.js} +1 -1
- package/dist/client/assets/{TourHost--UYZoKlJ.js → TourHost-BISNaEzZ.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-BN2odbqD.js → UnlinkDialog-DTuXHNsi.js} +1 -1
- package/dist/client/assets/{UnreadDivider-LbVIAoxM.js → UnreadDivider-l_VZ7ECn.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-CAUx4KUI.js → WidgetErrorCard-I8WiJv2g.js} +1 -1
- package/dist/client/assets/{WorkView-DVx4WoVI.js → WorkView-_wehEEl-.js} +3 -3
- package/dist/client/assets/_shell-BLcPeb8K.js +80 -0
- package/dist/client/assets/{_shell._home-uuqgFA3M.js → _shell._home-CcRH-M-A.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-CiMsy7bF.js → _shell._home.activity-cR24Vr9Q.js} +1 -1
- package/dist/client/assets/{_shell._home.index-0Zm5q3-G.js → _shell._home.index-agU2ItcI.js} +1 -1
- package/dist/client/assets/{_shell._home.tasks-BClPai4g.js → _shell._home.tasks-BDR9JTj3.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-DH4BgLT0.js → _shell._home.workspaces-B4nlcACK.js} +1 -1
- package/dist/client/assets/{_shell.channels-BGXkXPhY.js → _shell.channels-B7lTxkqM.js} +1 -1
- package/dist/client/assets/{_shell.connections-BwjXkgi1.js → _shell.connections-CWQYcH58.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-j7gTBF5b.js → _shell.feedback-requests-BkgHtyZr.js} +1 -1
- package/dist/client/assets/_shell.marketplace-BMqwT9qX.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-pXGa7Cqb.js +1 -0
- package/dist/client/assets/_shell.session-CmoE1W38.js +1 -0
- package/dist/client/assets/{_shell.team-BgJu1gDa.js → _shell.team-CTIVEpZQ.js} +3 -3
- package/dist/client/assets/{_shell.threads-C1IJJzcf.js → _shell.threads-ClWYrnld.js} +1 -1
- package/dist/client/assets/_shell.x._extensionId-BiXilrSW.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-BiXilrSW.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-BuEHMh0D.js → abnfDiagram-WEYOIA3C-0-Mx5lSG.js} +1 -1
- package/dist/client/assets/{access-copy-BZNjpw9v.js → access-copy-Cj31J6PU.js} +1 -1
- package/dist/client/assets/{arc-BbGU9Ctb.js → arc-DVmpcNHP.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-CdRG5sTM.js → architectureDiagram-ZHVYKT53-BZhMXbuC.js} +1 -1
- package/dist/client/assets/{banner-C7kHJJGz.js → banner-Ctq7kvQ0.js} +1 -1
- package/dist/client/assets/{blockDiagram-RJAE7QA3-CBQ6YXoI.js → blockDiagram-RJAE7QA3-Ctmof3-7.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-DavNcKCF.js → c4Diagram-XDPPPE54-BPglmQhG.js} +1 -1
- package/dist/client/assets/{card-D4ek-VvX.js → card-DI7YtQh3.js} +1 -1
- package/dist/client/assets/channel-A2WD4smw.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-ClO15ze9.js → chunk-2E7WHVMD-DIK6CHka.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-DsLDzf_i.js → chunk-2Q5K7J3B-C3uATYd9.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-D20fXIIK.js → chunk-4EMNKR2T-Dl3iYXVl.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-no_S5sRX.js → chunk-55XCU76K-BJF-Hcs9.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-D5xWEZ2p.js → chunk-5VM5RSS4-Cju3BnqQ.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-CnsdZOv0.js → chunk-JWPE2WC7-v1omZzgE.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-DxYg8tsH.js → chunk-VQ5W62QI-2HqA3jPL.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-7CQ-MKdC.js → chunk-XXDRQBXY-RDXwFs9Z.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-Ca7Jh42b.js → chunk-ZCHMQSOR-DhQsY-OT.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-BvZXavcI.js → classDiagram-v2-4MYWR3UA-DC5N-GDk.js} +1 -1
- package/dist/client/assets/{command-srO4Wv-5.js → command-DpK0GpDM.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-1NCiJaHv.js → cose-bilkent-JH36ORCC-BriFsb6c.js} +1 -1
- package/dist/client/assets/{cpu-CFIu4JtK.js → cpu-DzCUBK-1.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-DgZeohG3.js → cynefin-EF2NZ3EQ-cj34OpiI.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-MQB2xbJK.js → cynefinDiagram-WF24UDRP-DvAggKpl.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-BFHk_Y44.js → dagre-NK4GIZVX-BskSpt7C.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-CloEvZfp.js → diagram-CBK3MWTC-C6BZljcO.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D-9nzUtfKI.js → diagram-I5XIIV2D--4FPRmBZ.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-DVdnelgu.js → diagram-ODIL2UCW-kZxp81Fr.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-tTEeiAHa.js → diagram-PFBEJUXE-BSXBAffS.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-QFehV9_1.js → diagram-RJA3I4VV-DLDPF6FG.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-CYU5li-4.js → diagram-TYUNFSNR-CoU2knZy.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-Cn040Beg.js → ebnfDiagram-V4P3TTPT-C77T1UPB.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-tBbnwcb3.js → elk-QONTBCTQ-UFXrlbAn.js} +1 -1
- package/dist/client/assets/{empty-state-Bxfi7_ss.js → empty-state-aNwJA6H8.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-DAA0fFlD.js → erDiagram-KYQIGQAA-CyLB8fKu.js} +1 -1
- package/dist/client/assets/{execution-config-afKaYukD.js → execution-config-D7JzMYC2.js} +1 -1
- package/dist/client/assets/{file-C-ooqbRY.js → file-bSD5jgk_.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-BWWgLsMF.js → file-exclamation-point-BcCIL-rE.js} +1 -1
- package/dist/client/assets/{file-text-BJt8biPY.js → file-text-DTvj1wzM.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-DPQimlUD.js → find-latest-widget-fence-D01ENK2h.js} +1 -1
- package/dist/client/assets/{flowDiagram-IUGLLWBU-vYI6TodS.js → flowDiagram-IUGLLWBU-qmnUF-Ak.js} +1 -1
- package/dist/client/assets/{form-LJ2Rf9ny.js → form-C_yPntkz.js} +1 -1
- package/dist/client/assets/{format-cron-DrUISrHj.js → format-cron-DUPWkOrW.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-DLYpSX7r.js → ganttDiagram-R7GPNTJY-CBzoqGuU.js} +1 -1
- package/dist/client/assets/{git-branch-D5xr7U5P.js → git-branch-ClXAt1_G.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-DNIbVOaY.js → gitGraphDiagram-PDYL7XHY-DMh_n1S2.js} +1 -1
- package/dist/client/assets/{graph-DNjxkUSL.js → graph-BgkuepqW.js} +1 -1
- package/dist/client/assets/{heart-DnR_GX4I.js → heart-BrjEmIsl.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-L_Jd2uei.js → highlighted-body-KPVGNVTW-DlHNVEaV.js} +1 -1
- package/dist/client/assets/{image-lightbox-DZIhMyF3.js → image-lightbox-BtzkRztd.js} +1 -1
- package/dist/client/assets/{image-off-DdvvVxmq.js → image-off-4yaoLh32.js} +1 -1
- package/dist/client/assets/{index-B0jt7Nng.js → index-6yT0Qr0s.js} +1 -1
- package/dist/client/assets/{index-Ixk2o7yl.js → index-A_qzw4D8.js} +1 -1
- package/dist/client/assets/{index-adYd35CJ.js → index-Adjbt_HC.js} +1 -1
- package/dist/client/assets/{index-CXWlrRzK.js → index-B-X82FND.js} +1 -1
- package/dist/client/assets/{index-BzKkoaB1.js → index-BMCDckcY.js} +1 -1
- package/dist/client/assets/index-BOuCpkRb.js +1 -0
- package/dist/client/assets/{index-DTuNXPGU.js → index-BUkUamu4.js} +1 -1
- package/dist/client/assets/index-BVq1p60h.js +1 -0
- package/dist/client/assets/{index-By8pKNSM.js → index-BXtagrMY.js} +1 -1
- package/dist/client/assets/{index-CQ2atcs_.js → index-BeVLPg9t.js} +1 -1
- package/dist/client/assets/{index-ld6lMfGU.js → index-Bgg4cW4L.js} +1 -1
- package/dist/client/assets/{index-Ba9q2CoQ.js → index-BqHUbNdh.js} +1 -1
- package/dist/client/assets/{index-DqCxUalt.js → index-BtG4vr8c.js} +1 -1
- package/dist/client/assets/{index-BsHyymmC.js → index-C0LPB1iH.js} +1 -1
- package/dist/client/assets/{index-CDo6TA8n.js → index-CJhmUsIv.js} +1 -1
- package/dist/client/assets/{index-a6ojvFqI.js → index-CMLDdOez.js} +1 -1
- package/dist/client/assets/{index-D-Q7CW4p.js → index-CNV11SW6.js} +1 -1
- package/dist/client/assets/{index-9GoQjBFo.js → index-CNiC7KUz.js} +1 -1
- package/dist/client/assets/{index-By-VWzSF.js → index-CSyZb1X9.js} +1 -1
- package/dist/client/assets/{index-B1gC3xYN.js → index-CThGpHO2.js} +1 -1
- package/dist/client/assets/{index-uIonuakd.js → index-C_H6ZIel.js} +1 -1
- package/dist/client/assets/{index-ANmu61E0.js → index-C_xSr5lb.js} +1 -1
- package/dist/client/assets/{index-r0stHl-2.js → index-Cefoks17.js} +1 -1
- package/dist/client/assets/{index-DKTd8X7n.js → index-CjUfPyOM.js} +261 -261
- package/dist/client/assets/{index-DXWsH2Ep.js → index-Ckut3u-d.js} +1 -1
- package/dist/client/assets/{index-BFecX5dC.js → index-CrQWuUpr.js} +1 -1
- package/dist/client/assets/{index-xfRcAp50.js → index-CyfSPJ1D.js} +1 -1
- package/dist/client/assets/{index-CSqz4B0v.js → index-D0yajRDv.js} +1 -1
- package/dist/client/assets/index-D2ZFfqZZ.css +1 -0
- package/dist/client/assets/{index-ZYbeRA5f.js → index-DB2t3GUm.js} +3 -3
- package/dist/client/assets/{index-Bri5bZfv.js → index-DFWrO42z.js} +1 -1
- package/dist/client/assets/{index-BqKjnd_r.js → index-DGdKO24t.js} +1 -1
- package/dist/client/assets/{index-5hCWBj-r.js → index-DQ9ppIWv.js} +1 -1
- package/dist/client/assets/{index-DjFFFMc-.js → index-DX546SK5.js} +2 -2
- package/dist/client/assets/{index-Blhsfk7u.js → index-DXalAOXT.js} +1 -1
- package/dist/client/assets/{index-CDGWl8qL.js → index-DZ1BC5JW.js} +1 -1
- package/dist/client/assets/{index-BAIKz_P0.js → index-DgxXSEmR.js} +1 -1
- package/dist/client/assets/{index-BsmR2hi4.js → index-Dj4I8KcL.js} +3 -3
- package/dist/client/assets/{index-Bpwvxz0c.js → index-DrnHzrt4.js} +1 -1
- package/dist/client/assets/{index-CLQIvYHP.js → index-FhmSwVD0.js} +1 -1
- package/dist/client/assets/{index-BWQfqbbe.js → index-WkQdt6Zo.js} +1 -1
- package/dist/client/assets/{index-BYeyKNKj.js → index-WxG6nG96.js} +1 -1
- package/dist/client/assets/{index-D0ujPZdD.js → index-f1W4Bd4W.js} +1 -1
- package/dist/client/assets/{index-B2wx4J9U.js → index-qdygDruh.js} +1 -1
- package/dist/client/assets/{index-CLbs0fcq.js → index-t-NyR7HD.js} +1 -1
- package/dist/client/assets/{index.esm-j5KQ_b6S.js → index.esm-Bb3LMu5X.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-DjvSkTas.js → infoDiagram-MVDRKAX5-DbU4eDjZ.js} +1 -1
- package/dist/client/assets/{inline-code-DlVYFFW7.js → inline-code-DwFNff3_.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-BBivrI5n.js → ishikawaDiagram-HPEHV2GE-DmHmF-HT.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-DKdhbtdx.js → journeyDiagram-BOSHW7O7-DsjOeP3J.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-CkgAodR5.js → kanban-definition-FNSA4HC5-ByQ1WGy2.js} +1 -1
- package/dist/client/assets/{layers-CzyhuVSM.js → layers-DFZUUHM5.js} +1 -1
- package/dist/client/assets/{lightbulb-DwGE7s99.js → lightbulb-Bbgsejp1.js} +1 -1
- package/dist/client/assets/{link-2-CljREnN9.js → link-2-xieOmwOK.js} +1 -1
- package/dist/client/assets/{list-runtime-types-D5ZO30FL.js → list-runtime-types-B0CSonAi.js} +1 -1
- package/dist/client/assets/{markdown-content-CN_dGlgE.js → markdown-content-ysBIqFAg.js} +1 -1
- package/dist/client/assets/{mention-pill-C6OT4gx4.js → mention-pill-Daeu1X92.js} +1 -1
- package/dist/client/assets/{mermaid.core-DNuzxE7q.js → mermaid.core-B1mQMOXd.js} +4 -4
- package/dist/client/assets/{message-square-off-DlkAPJdd.js → message-square-off-D9hm8WNH.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-f9ygKKO1.js → mindmap-definition-6OY57UG3-CoP-DGm1.js} +1 -1
- package/dist/client/assets/{more-details-DRPervoL.js → more-details-DHCpYDi7.js} +1 -1
- package/dist/client/assets/{owner-notice-C-Q9ySA7.js → owner-notice-Crxco7HN.js} +1 -1
- package/dist/client/assets/{package-BVNiaGrb.js → package-CD8xq7hk.js} +1 -1
- package/dist/client/assets/{page-container-D03bhclt.js → page-container-B9sDc2wq.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-CZ9rHhNr.js → pane-resize-handle-DOchpdJ6.js} +1 -1
- package/dist/client/assets/{paperclip-DQQVX5tJ.js → paperclip-CzhXW5qi.js} +1 -1
- package/dist/client/assets/{path-input-CQ16nhYd.js → path-input-Z2p922fj.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-CZ_YkcKh.js → pegDiagram-ECIUJNBX-TEsMAO1a.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-DLHSPEH7.js → pieDiagram-GNMPY74T-CMIDIiMP.js} +1 -1
- package/dist/client/assets/{plug-CadJyjTp.js → plug-BEp9Ly3k.js} +1 -1
- package/dist/client/assets/{primer-trigger-DH4xfrlM.js → primer-trigger-4qUY83SX.js} +1 -1
- package/dist/client/assets/{profile-errors-DSnHlauU.js → profile-errors-CezsKqhA.js} +1 -1
- package/dist/client/assets/{progress-BB97hlmb.js → progress-eQl1UvNz.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-BWcUu48x.js → quadrantDiagram-D57K4MC3-DXjohzOz.js} +1 -1
- package/dist/client/assets/{query-error-state-B456s96E.js → query-error-state-COuKRlU0.js} +1 -1
- package/dist/client/assets/{radio-DrpN3x3S.js → radio-Cdnkcg1w.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-C2VRM83h.js → railroadDiagram-Y72NRBL7-BojgH6Hw.js} +1 -1
- package/dist/client/assets/registry-BSucT23N.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-BYCaGsVJ.js → relay-trace-schemas-XcVQg5Fa.js} +1 -1
- package/dist/client/assets/{repeat-DPzic7-j.js → repeat-wB31CP7I.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-B1bpdcM7.js → requirementDiagram-EQYSW5RA-Gojbrcvg.js} +1 -1
- package/dist/client/assets/{room-files-source-aN4p_kDV.js → room-files-source-DXKpm43a.js} +1 -1
- package/dist/client/assets/{rotate-ccw-clock-gqBy98sI.js → rotate-ccw-clock-LSKKAcnR.js} +1 -1
- package/dist/client/assets/{rotate-cw-mHsqEte-.js → rotate-cw-scTEKxeZ.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-QCGTTh9k.js → sankeyDiagram-SY24JHO5-QS71aycL.js} +1 -1
- package/dist/client/assets/{scroll-area-DVd6ctli.js → scroll-area-BNFXgTKM.js} +1 -1
- package/dist/client/assets/{search-x-CzgTzL0z.js → search-x-Cjf0n9z7.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-kiR1gX_u.js → sequenceDiagram-BLEHNHQU-Beg7mj69.js} +1 -1
- package/dist/client/assets/{shield-x-Btfd3Xnx.js → shield-x-Dr4BZfo_.js} +1 -1
- package/dist/client/assets/{signed-in-gS3tMpTW.js → signed-in-L9MLqTuc.js} +1 -1
- package/dist/client/assets/{sizeCapture-INFHLROL-Da56aMj0.js → sizeCapture-INFHLROL-3Oo1KjRp.js} +1 -1
- package/dist/client/assets/{soul-file-C7zd1yXt.js → soul-file-CxpOawh5.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-BZ3qlQWl.js → stateDiagram-v2-A6IESKWZ-DFYIDQ6C.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-B-wp91_T.js → swimlanes-B3ENRKFQ-BUgKOOrv.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-Bqjv1MSj.js +8 -0
- package/dist/client/assets/{table-BIdFvzBs.js → table-B0LsKsEv.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-CQojjy-8.js → timeline-definition-JXYKGLGB-BsPZ0P_8.js} +1 -1
- package/dist/client/assets/{trust-posture-DszobEjt.js → trust-posture-Cm7OhCEx.js} +1 -1
- package/dist/client/assets/{unplug-xlfZ61jC.js → unplug-DLA7Ib_s.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-DymrAwtm.js → unverified-catalog-notice-CxBO_pta.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-CytBTafV.js → use-adapter-catalog-C333Z2Q6.js} +1 -1
- package/dist/client/assets/{use-bindings-BPNK3sUh.js → use-bindings-Bu4yLLR5.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-DMQT0qiv.js → use-composer-prefs-BnjCX9pM.js} +1 -1
- package/dist/client/assets/{use-connector-management-PDVdWccW.js → use-connector-management-Bo6wOJQS.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-CwapSmGj.js → use-deep-link-scroll-D867V6rs.js} +1 -1
- package/dist/client/assets/{use-delete-binding-CgTwS83G.js → use-delete-binding-DKObM-zT.js} +1 -1
- package/dist/client/assets/{use-dev-links-BoZCIc4h.js → use-dev-links-C0Zc30aj.js} +1 -1
- package/dist/client/assets/{use-direct-message-panel-Cs4I6669.js → use-direct-message-panel-DNWtQq4B.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-PBrsasQ8.js → use-external-adapter-catalog-Bv5rDkX4.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-C2seN-V1.js → use-full-activity-feed-CFUj0qCS.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-BUS7OPGv.js +1 -0
- package/dist/client/assets/use-is-hub-CFhvDMHt.js +1 -0
- package/dist/client/assets/{use-local-browser-CF0uGQ6e.js → use-local-browser-BeZjn0gA.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-CnCeK4gS.js → use-mesh-topology-DurMpvjU.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-BtAb14HI.js → use-mounted-ref-CBSuPNPv.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-B8LHpZTt.js → use-notification-prefs-b8iKvzB4.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-DOXj0Pii.js → use-panel-tab-placements-BcKEux1G.js} +1 -1
- package/dist/client/assets/use-pending-read-BBBAnUYu.js +1 -0
- package/dist/client/assets/{use-personality-commit-YV9FVC-a.js → use-personality-commit-u3kQ6h3H.js} +1 -1
- package/dist/client/assets/{use-promo-activation-CjtGhz_3.js → use-promo-activation-C8_cGmEW.js} +1 -1
- package/dist/client/assets/{use-promo-dismissals-4rbLgSDG.js → use-promo-dismissals-B3VuaQCf.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-CGqANpVO.js → use-pulse-freshness-CSWQ0TZS.js} +1 -1
- package/dist/client/assets/{use-relay-config-CvU_70WJ.js → use-relay-config-BA6c0FMB.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-Doq_lWjk.js → use-room-follow-claim-BV-MtDQ5.js} +1 -1
- package/dist/client/assets/{use-room-sessions-CoEIaBRt.js → use-room-sessions-W62Zl72O.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-BzsrpjWV.js → use-roving-tab-list-CMITzUHu.js} +1 -1
- package/dist/client/assets/{use-session-canvas-DQ9ND8il.js → use-session-canvas-u63m2mYH.js} +3 -3
- package/dist/client/assets/{use-status-budget-AnHroEO0.js → use-status-budget-CbmPFvpQ.js} +1 -1
- package/dist/client/assets/{use-unclaimed-chats-DzOLK27i.js → use-unclaimed-chats-D7SEUfiO.js} +1 -1
- package/dist/client/assets/use-update-config-Dfd7KMde.js +1 -0
- package/dist/client/assets/{useMutationState-BAU_J-u3.js → useMutationState-rOg4bnKv.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-BrHN0c6G.js → usecaseDiagram-WPOLBNNX-C-w0e-nv.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-CbeP0Pbp.js → vennDiagram-Q3Y3IDCW-BNm2WXT5.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-mn5ebFhs.js → wardleyDiagram-IVAIDKWA-BFyFLiir.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-C8fXRQEv.js → xychartDiagram-4URNHDU4-BKxZlnEx.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/index.js +278 -101
- package/dist/server/index.js.map +2 -2
- package/package.json +4 -4
- package/dist/client/assets/HandlePage-tZidnrlt.js +0 -1
- package/dist/client/assets/NamePage-BS-oN_Hi.js +0 -1
- package/dist/client/assets/PhotoPage-BmFypD13.js +0 -1
- package/dist/client/assets/_shell-D7Jp6t6_.js +0 -80
- package/dist/client/assets/_shell.marketplace-6JRXJ9gt.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-DriHXfBM.js +0 -1
- package/dist/client/assets/_shell.session-BXSWGdwi.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-BNgicBXG.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-BNgicBXG.js +0 -1
- package/dist/client/assets/channel-ClNeQ2PQ.js +0 -1
- package/dist/client/assets/index-5eNHb7up.js +0 -1
- package/dist/client/assets/index-D1kQ19Gb.css +0 -1
- package/dist/client/assets/index-DHi8-3w0.js +0 -1
- package/dist/client/assets/registry-DRvQ3ChB.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-Drg_8k1s.js +0 -8
- package/dist/client/assets/use-is-below-desktop-pvzUlnxh.js +0 -1
- package/dist/client/assets/use-is-hub-CvEPWuj0.js +0 -1
- package/dist/client/assets/use-pending-read-DBaC7e8N.js +0 -1
- package/dist/client/assets/use-update-config-NRkQbxae.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hg as v,hh as fe,hd as be,hi as Ce,j as e,fX as ee,fY as ne,fZ as te,f_ as se,hj as Ne,f$ as ae,hk as ie,g0 as re,g1 as ce,g2 as oe,a1 as de,a3 as Ie,a4 as Te,a2 as Ae,y as le,hl as Se,r as A,hm as he,eu as x,en as S,eo as k,ep as R,eq as F,er as b,hn as ke,ho as Re,$ as E,_ as pe,as as Fe,hp as Oe,hq as we,cQ as Me,cT as De,cU as Ee,cW as Be,cX as $e,cY as _e,ak as Le,I as Pe,hr as V,B,dB as qe,hs as ze,eX as He,ht as Ye,x as Ge}from"./index-DKTd8X7n.js";import{B as Qe}from"./use-bindings-BPNK3sUh.js";import{u as Ue}from"./form-LJ2Rf9ny.js";import{u as We}from"./use-adapter-catalog-CytBTafV.js";import{I as Ke,t as Xe}from"./trust-posture-DszobEjt.js";function Z(n){return`Turn on ${be(n.stop)}`}function Ve(n){return!v(n)||fe(n)?null:"This stop never pauses to ask. It acts without checking with you."}function Ze({descriptor:n,consequence:i,onCancel:o,onConfirm:h}){const d=Ce(n??void 0),y=n?Ve(n):null;return e.jsx(ee,{open:n!==null,onOpenChange:C=>!C&&o(),children:e.jsxs(ne,{children:[e.jsxs(te,{children:[e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Ne,{descriptor:n??void 0,className:`size-4 ${d}`}),n&&Z(n)]}),e.jsxs(ae,{children:[n==null?void 0:n.promise,y&&" ",y&&e.jsx("span",{className:"text-foreground mt-2 block","data-testid":"consent-asks-note",children:y})]})]}),e.jsx("div",{className:"text-muted-foreground space-y-2 text-sm",children:i}),n&&e.jsx(ie,{mode:n.id,descriptor:n}),e.jsxs(re,{children:[e.jsx(ce,{children:"Cancel"}),e.jsx(oe,{onClick:h,children:n&&Z(n)})]})]})})}function ln(n={}){const i=de(),o=Ie();return Te({mutationFn:h=>i.createBinding(h),onSuccess:()=>{o.invalidateQueries({queryKey:[...Qe]})},meta:n.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:n.errorLabel??"Couldn’t add that connection"}})}function Je(n){const i=de();return Ae({queryKey:["relay","observed-chats",n],queryFn:()=>i.getObservedChats(n),enabled:!!n,staleTime:3e4})}const J=[{value:"per-chat",label:"One shared chat per group or channel",description:"Everyone there shares one chat with the agent."},{value:"per-user",label:"One chat per person",description:"Each person gets their own chat, even in a group."},{value:"stateless",label:"A fresh start every message",description:"Nothing carries over from the message before."}],Y="claude-code";function ve({strategy:n,onStrategyChange:i,permissionMode:o,onPermissionModeChange:h,canInitiate:d,onCanInitiateChange:y,canReply:C,onCanReplyChange:O,canReceive:w,onCanReceiveChange:M,notifyOnTaskComplete:$,onNotifyOnTaskCompleteChange:_,notifyBootstrapHint:p,bridged:L,open:P,onOpenChange:q,hasChanges:z}){const u=J.find(l=>l.value===n),j=le(Y),c=(j==null?void 0:j.permissionModes.values)??[],r=c.find(l=>l.id===o),D=(r==null?void 0:r.label)??Se(o),[f,I]=A.useState(null);function H(l){const N=c.find(T=>T.id===l);if(N&&v(N)){I(N);return}h(l)}return e.jsxs(e.Fragment,{children:[e.jsxs(he,{open:P,onOpenChange:q,trigger:"Advanced",badge:z?e.jsx(pe,{variant:"secondary",children:"Modified"}):void 0,children:[L?e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(x,{children:"How the agent remembers"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Kept in the channel this chat is linked to."})]}):e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(x,{htmlFor:"binding-session-strategy",children:"How the agent remembers"}),e.jsxs(S,{value:n,onValueChange:l=>i(l),children:[e.jsx(k,{id:"binding-session-strategy",className:"w-full",children:e.jsx(R,{})}),e.jsx(F,{children:J.map(l=>e.jsx(b,{value:l.value,children:l.label},l.value))})]}),u&&e.jsx("p",{className:"text-muted-foreground text-xs",children:u.description})]}),e.jsxs("div",{className:"space-y-2 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Permissions"}),c.length===0?e.jsxs("p",{"data-testid":"trust-dial-unavailable",className:"text-muted-foreground px-1 text-xs leading-relaxed",children:["Set to “",D,"”. No other levels to choose yet. Saving keeps it."]}):e.jsxs(e.Fragment,{children:[e.jsx(ke,{mode:o,descriptors:c,onChangeMode:H,strandsWorkingMode:!0,strandedNote:e.jsxs(e.Fragment,{children:["Set to “",D,"”. Saving keeps it, or pick a stop."]})}),e.jsx(ie,{mode:o,...r?{descriptor:r}:{},className:"px-1"})]})]}),e.jsxs("div",{className:"space-y-2.5 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Message direction"}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsxs(x,{htmlFor:"perm-initiate",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal",children:[e.jsx(Re,{className:"text-muted-foreground size-3"}),"Agent can message first"]}),e.jsx(E,{id:"perm-initiate",checked:d,onCheckedChange:y,"aria-label":"Agent can message first"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(x,{htmlFor:"perm-reply",className:"cursor-pointer text-xs font-normal",children:"Agent can reply to messages"}),e.jsx(E,{id:"perm-reply",checked:C,onCheckedChange:O,"aria-label":"Agent can reply to messages"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(x,{htmlFor:"perm-receive",className:"cursor-pointer text-xs font-normal",children:"Agent receives new messages"}),e.jsx(E,{id:"perm-receive",checked:w,onCheckedChange:M,"aria-label":"Agent receives new messages"})]})]}),e.jsxs("div",{className:"space-y-2.5 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Notifications"}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(x,{htmlFor:"notify-task-complete",className:"cursor-pointer text-xs font-normal",children:"Message me when scheduled tasks finish"}),e.jsx(E,{id:"notify-task-complete",checked:$,onCheckedChange:_,"aria-label":"Message me when scheduled tasks finish"})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"When off, you still hear about runs that didn’t finish."}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Needs “Agent can message first”."}),p&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"Message your bot once to start. Bots can’t write first."})]})]}),e.jsx(Ze,{descriptor:f,consequence:e.jsxs(e.Fragment,{children:["Anyone who can message this connection can make the agent act, with no one asked."," ",e.jsxs(Ke,{label:"About asking in the chat",title:"At a stop that asks",children:[e.jsx("p",{children:"Where your connection can show buttons, the agent waits for Approve or Deny."}),e.jsx("p",{children:"Only people on the approver list can answer."}),e.jsx("p",{children:"An ask nobody answers is refused after 10 minutes, and the agent carries on."})]})]}),onCancel:()=>I(null),onConfirm:()=>{f&&h(f.id),I(null)}})]})}const m="__any__",en={"per-chat":"One shared chat per group or channel","per-user":"One chat for each person",stateless:"No memory between messages"},me=[{value:"dm",label:"Direct message"},{value:"group",label:"Group"},{value:"channel",label:"Broadcast channel"},{value:"thread",label:"Thread"}];function xe(n){var i;return((i=me.find(o=>o.value===n))==null?void 0:i.label)??n}function nn({sessionStrategy:n,chatDisplayName:i,channelType:o}){const h=en[n];return i?`${h} in ${i}`:o?`${h} · ${xe(o)}`:h}function hn(n){return{adapterId:n.adapterId,agentId:n.agentId,sessionStrategy:n.sessionStrategy,label:n.label,permissionMode:n.permissionMode,chatId:n.chatId,channelType:n.channelType,canInitiate:n.canInitiate,canReply:n.canReply,canReceive:n.canReceive,notifyOnTaskComplete:n.notifyOnTaskComplete}}function pn(n){return{sessionStrategy:n.sessionStrategy,label:n.label,permissionMode:n.permissionMode,chatId:n.chatId??null,channelType:n.channelType??null,canInitiate:n.canInitiate,canReply:n.canReply,canReceive:n.canReceive,notifyOnTaskComplete:n.notifyOnTaskComplete}}function tn(n){return!!(n!=null&&n.canInitiate||(n==null?void 0:n.canReply)===!1||(n==null?void 0:n.canReceive)===!1||(n==null?void 0:n.notifyOnTaskComplete)===!1||(n==null?void 0:n.permissionMode)!==void 0&&n.permissionMode!=="acceptEdits"||n!=null&&n.sessionStrategy&&n.sessionStrategy!=="per-chat")}function sn(n,i){return{adapterId:(n==null?void 0:n.adapterId)??"",agentId:(n==null?void 0:n.agentId)??"",strategy:(n==null?void 0:n.sessionStrategy)??"per-chat",label:(n==null?void 0:n.label)??"",chatId:(n==null?void 0:n.chatId)??m,channelType:(n==null?void 0:n.channelType)??m,permissionMode:(n==null?void 0:n.permissionMode)??(i==null?void 0:i.defaultPermissionMode)??"acceptEdits",canInitiate:(n==null?void 0:n.canInitiate)??(i==null?void 0:i.defaultCanInitiate)??!1,canReply:(n==null?void 0:n.canReply)??!0,canReceive:(n==null?void 0:n.canReceive)??!0,notifyOnTaskComplete:(n==null?void 0:n.notifyOnTaskComplete)??!0}}function mn({open:n,onOpenChange:i,onConfirm:o,mode:h,initialValues:d,adapterName:y,agentName:C,onDelete:O,bindingId:w,isPending:M,bridged:$,bridgeSlot:_}){const p=h==="edit",[L,P]=A.useState(()=>!!(d!=null&&d.chatId||d!=null&&d.channelType)),[q,z]=A.useState(()=>tn(d)),{data:u}=Fe(),j=le(Y),[c]=A.useState(()=>{var t;return sn(d,p?void 0:{defaultPermissionMode:Oe(we(u==null?void 0:u.executionDefaults,Y),(j==null?void 0:j.permissionModes.values)??[]),defaultCanInitiate:u!=null&&Xe((t=u.permissions)==null?void 0:t.preset)==="trusted"})}),r=Ue({defaultValues:c,onSubmit:async({value:t})=>{await o({adapterId:t.adapterId,agentId:t.agentId,sessionStrategy:t.strategy,label:t.label,permissionMode:t.permissionMode,chatId:t.chatId===m?void 0:t.chatId,channelType:t.channelType===m?void 0:t.channelType,canInitiate:t.canInitiate,canReply:t.canReply,canReceive:t.canReceive,notifyOnTaskComplete:t.notifyOnTaskComplete}),p||r.reset()}}),{data:D=[]}=We(),{data:f}=Me(),[I,H]=A.useState(()=>(d==null?void 0:d.adapterId)??""),{data:l=[]}=Je(I||void 0),N=D.flatMap(t=>t.instances.filter(g=>g.enabled).map(g=>({id:g.id,label:g.label?`${g.label} (${t.manifest.displayName})`:`${g.id} (${t.manifest.displayName})`}))),T=(f==null?void 0:f.agents)??[];function ge(){r.setFieldValue("chatId",m),r.setFieldValue("channelType",m)}return e.jsx(De,{open:n,onOpenChange:i,children:e.jsxs(Ee,{className:"max-h-[85vh] max-w-md gap-0 p-0",children:[e.jsxs(Be,{className:"border-b px-4 py-3",children:[e.jsx($e,{children:p?"Edit connection":"Add connection"}),e.jsx(_e,{className:"sr-only",children:p?"Edit this connection’s settings":"Connect this agent to a chat"})]}),e.jsx(r.Subscribe,{selector:t=>({values:t.values,isSubmitting:t.isSubmitting}),children:({values:t,isSubmitting:g})=>{var X;const G=p||!!t.adapterId&&!!t.agentId,ue=!p||t.adapterId!==c.adapterId||t.agentId!==c.agentId||t.strategy!==c.strategy||t.label!==c.label||t.chatId!==c.chatId||t.channelType!==c.channelType||t.permissionMode!==c.permissionMode||t.canInitiate!==c.canInitiate||t.canReply!==c.canReply||t.canReceive!==c.canReceive||t.notifyOnTaskComplete!==c.notifyOnTaskComplete,Q=p?C:(X=T.find(s=>s.id===t.agentId))==null?void 0:X.name,U=G&&Q?`${nn({sessionStrategy:t.strategy,chatDisplayName:t.chatId!==m?`#${t.chatId}`:void 0,channelType:t.channelType!==m?t.channelType:void 0})}. Routed to ${Q}.`:null,W=t.chatId!==m||t.channelType!==m,ye=t.strategy!=="per-chat"||t.permissionMode!=="acceptEdits"||t.canInitiate||!t.canReply||!t.canReceive||!t.notifyOnTaskComplete,je=!G||!ue||!!M||g,K=!!M||g;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-5 overflow-y-auto px-4 py-5",children:[p?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Connection:"," ",e.jsx("span",{className:"text-foreground font-medium",children:y})," →"," ",e.jsx("span",{className:"text-foreground font-medium",children:C})]}),_]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"binding-adapter",children:"Source"}),N.length===0?e.jsx("p",{className:"text-muted-foreground border-input rounded-md border px-3 py-2 text-sm opacity-50",children:"Nothing set up yet"}):e.jsx(r.AppField,{name:"adapterId",children:s=>e.jsxs(S,{value:s.state.value,onValueChange:a=>{s.handleChange(a),H(a)},children:[e.jsx(k,{id:"binding-adapter",className:"w-full",children:e.jsx(R,{placeholder:"Pick a source"})}),e.jsx(F,{children:N.map(a=>e.jsx(b,{value:a.id,children:a.label},a.id))})]})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"binding-agent",children:"Agent"}),T.length===0?e.jsx("p",{className:"text-muted-foreground border-input rounded-md border px-3 py-2 text-sm opacity-50",children:"No agents yet"}):e.jsx(r.AppField,{name:"agentId",children:s=>e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-agent",className:"w-full",children:e.jsx(R,{placeholder:"Select an agent"})}),e.jsx(F,{children:T.map(a=>e.jsx(b,{value:a.id,children:Le(a)},a.id))})]})})]})]}),e.jsx(r.AppField,{name:"label",children:s=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"binding-label",children:"Label (optional)"}),e.jsx(Pe,{id:"binding-label",placeholder:"e.g., Customer support bot",value:s.state.value,onBlur:s.handleBlur,onChange:a=>s.handleChange(a.target.value)}),e.jsx(V,{children:"A name to tell this connection apart"})]})}),e.jsxs(he,{open:L,onOpenChange:P,trigger:"Chat filter",badge:W?e.jsx(pe,{variant:"secondary",children:"Active"}):void 0,children:[e.jsx(r.AppField,{name:"chatId",children:s=>e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(x,{htmlFor:"binding-chat-id",children:"Chat ID"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-chat-id",className:"w-full",children:e.jsx(R,{placeholder:"Any chat"})}),e.jsxs(F,{children:[e.jsx(b,{value:m,children:"Any chat"}),l.map(a=>e.jsxs(b,{value:a.chatId,children:[e.jsx("span",{children:a.displayName??a.chatId}),(a.channelType||a.messageCount>0)&&e.jsx("span",{className:"text-muted-foreground ml-2 text-xs",children:[a.channelType?xe(a.channelType):null,`${a.messageCount} messages`].filter(Boolean).join(" · ")})]},a.chatId))]})]}),e.jsx(V,{children:"Only take messages from this chat"})]})}),e.jsx(r.AppField,{name:"channelType",children:s=>e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(x,{htmlFor:"binding-channel-type",children:"Chat type"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-channel-type",className:"w-full",children:e.jsx(R,{placeholder:"Any type"})}),e.jsxs(F,{children:[e.jsx(b,{value:m,children:"Any type"}),me.map(a=>e.jsx(b,{value:a.value,children:a.label},a.value))]})]})]})}),W&&e.jsx("div",{className:"px-4 py-3",children:e.jsx(B,{variant:"ghost",size:"sm",onClick:ge,children:"Clear filters"})})]}),e.jsx(ve,{strategy:t.strategy,onStrategyChange:s=>r.setFieldValue("strategy",s),permissionMode:t.permissionMode,onPermissionModeChange:s=>r.setFieldValue("permissionMode",s),canInitiate:t.canInitiate,onCanInitiateChange:s=>r.setFieldValue("canInitiate",s),canReply:t.canReply,onCanReplyChange:s=>r.setFieldValue("canReply",s),canReceive:t.canReceive,onCanReceiveChange:s=>r.setFieldValue("canReceive",s),notifyOnTaskComplete:t.notifyOnTaskComplete,onNotifyOnTaskCompleteChange:s=>r.setFieldValue("notifyOnTaskComplete",s),notifyBootstrapHint:l.length===0,bridged:$,open:q,onOpenChange:z,hasChanges:ye}),U&&e.jsx("p",{className:"text-muted-foreground bg-muted/50 rounded-md px-3 py-2 text-xs italic",children:U})]}),e.jsxs(qe,{className:"border-t px-4 py-3",children:[p&&O&&w&&e.jsxs(ee,{children:[e.jsx(ze,{asChild:!0,children:e.jsxs(B,{variant:"ghost",size:"sm",className:"mr-auto text-red-600 hover:bg-red-50 hover:text-red-700 dark:hover:bg-red-950",children:[e.jsx(He,{className:"mr-1.5 size-3.5"}),"Remove"]})}),e.jsxs(ne,{children:[e.jsxs(te,{children:[e.jsx(se,{children:"Remove this connection?"}),e.jsx(ae,{children:"This agent stops getting messages from it."})]}),e.jsxs(re,{children:[e.jsx(ce,{children:"Cancel"}),e.jsx(oe,{onClick:()=>O(w),className:Ye({variant:"destructive"}),children:"Remove connection"})]})]})]}),e.jsx(B,{variant:"ghost",size:"sm",onClick:()=>i(!1),children:"Cancel"}),e.jsxs(B,{size:"sm",onClick:()=>r.handleSubmit(),disabled:je,children:[K&&e.jsx(Ge,{size:"xs",className:"mr-1.5"}),K?"Saving…":p?"Save changes":"Add connection"]})]})]})}})]})})}export{mn as B,ln as a,nn as b,hn as c,xe as d,pn as t,Je as u};
|
|
1
|
+
import{hg as v,hh as fe,hd as be,hi as Ce,j as e,fX as ee,fY as ne,fZ as te,f_ as se,hj as Ne,f$ as ae,hk as ie,g0 as re,g1 as ce,g2 as oe,a1 as de,a3 as Ie,a4 as Te,a2 as Ae,y as le,hl as Se,r as A,hm as he,eu as x,en as S,eo as k,ep as R,eq as F,er as b,hn as ke,ho as Re,$ as E,_ as pe,as as Fe,hp as Oe,hq as we,cQ as Me,cT as De,cU as Ee,cW as Be,cX as $e,cY as _e,ak as Le,I as Pe,hr as V,B,dB as qe,hs as ze,eX as He,ht as Ye,x as Ge}from"./index-CjUfPyOM.js";import{B as Qe}from"./use-bindings-Bu4yLLR5.js";import{u as Ue}from"./form-C_yPntkz.js";import{u as We}from"./use-adapter-catalog-C333Z2Q6.js";import{I as Ke,t as Xe}from"./trust-posture-Cm7OhCEx.js";function Z(n){return`Turn on ${be(n.stop)}`}function Ve(n){return!v(n)||fe(n)?null:"This stop never pauses to ask. It acts without checking with you."}function Ze({descriptor:n,consequence:i,onCancel:o,onConfirm:h}){const d=Ce(n??void 0),y=n?Ve(n):null;return e.jsx(ee,{open:n!==null,onOpenChange:C=>!C&&o(),children:e.jsxs(ne,{children:[e.jsxs(te,{children:[e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Ne,{descriptor:n??void 0,className:`size-4 ${d}`}),n&&Z(n)]}),e.jsxs(ae,{children:[n==null?void 0:n.promise,y&&" ",y&&e.jsx("span",{className:"text-foreground mt-2 block","data-testid":"consent-asks-note",children:y})]})]}),e.jsx("div",{className:"text-muted-foreground space-y-2 text-sm",children:i}),n&&e.jsx(ie,{mode:n.id,descriptor:n}),e.jsxs(re,{children:[e.jsx(ce,{children:"Cancel"}),e.jsx(oe,{onClick:h,children:n&&Z(n)})]})]})})}function ln(n={}){const i=de(),o=Ie();return Te({mutationFn:h=>i.createBinding(h),onSuccess:()=>{o.invalidateQueries({queryKey:[...Qe]})},meta:n.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:n.errorLabel??"Couldn’t add that connection"}})}function Je(n){const i=de();return Ae({queryKey:["relay","observed-chats",n],queryFn:()=>i.getObservedChats(n),enabled:!!n,staleTime:3e4})}const J=[{value:"per-chat",label:"One shared chat per group or channel",description:"Everyone there shares one chat with the agent."},{value:"per-user",label:"One chat per person",description:"Each person gets their own chat, even in a group."},{value:"stateless",label:"A fresh start every message",description:"Nothing carries over from the message before."}],Y="claude-code";function ve({strategy:n,onStrategyChange:i,permissionMode:o,onPermissionModeChange:h,canInitiate:d,onCanInitiateChange:y,canReply:C,onCanReplyChange:O,canReceive:w,onCanReceiveChange:M,notifyOnTaskComplete:$,onNotifyOnTaskCompleteChange:_,notifyBootstrapHint:p,bridged:L,open:P,onOpenChange:q,hasChanges:z}){const u=J.find(l=>l.value===n),j=le(Y),c=(j==null?void 0:j.permissionModes.values)??[],r=c.find(l=>l.id===o),D=(r==null?void 0:r.label)??Se(o),[f,I]=A.useState(null);function H(l){const N=c.find(T=>T.id===l);if(N&&v(N)){I(N);return}h(l)}return e.jsxs(e.Fragment,{children:[e.jsxs(he,{open:P,onOpenChange:q,trigger:"Advanced",badge:z?e.jsx(pe,{variant:"secondary",children:"Modified"}):void 0,children:[L?e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(x,{children:"How the agent remembers"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Kept in the channel this chat is linked to."})]}):e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(x,{htmlFor:"binding-session-strategy",children:"How the agent remembers"}),e.jsxs(S,{value:n,onValueChange:l=>i(l),children:[e.jsx(k,{id:"binding-session-strategy",className:"w-full",children:e.jsx(R,{})}),e.jsx(F,{children:J.map(l=>e.jsx(b,{value:l.value,children:l.label},l.value))})]}),u&&e.jsx("p",{className:"text-muted-foreground text-xs",children:u.description})]}),e.jsxs("div",{className:"space-y-2 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Permissions"}),c.length===0?e.jsxs("p",{"data-testid":"trust-dial-unavailable",className:"text-muted-foreground px-1 text-xs leading-relaxed",children:["Set to “",D,"”. No other levels to choose yet. Saving keeps it."]}):e.jsxs(e.Fragment,{children:[e.jsx(ke,{mode:o,descriptors:c,onChangeMode:H,strandsWorkingMode:!0,strandedNote:e.jsxs(e.Fragment,{children:["Set to “",D,"”. Saving keeps it, or pick a stop."]})}),e.jsx(ie,{mode:o,...r?{descriptor:r}:{},className:"px-1"})]})]}),e.jsxs("div",{className:"space-y-2.5 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Message direction"}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsxs(x,{htmlFor:"perm-initiate",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal",children:[e.jsx(Re,{className:"text-muted-foreground size-3"}),"Agent can message first"]}),e.jsx(E,{id:"perm-initiate",checked:d,onCheckedChange:y,"aria-label":"Agent can message first"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(x,{htmlFor:"perm-reply",className:"cursor-pointer text-xs font-normal",children:"Agent can reply to messages"}),e.jsx(E,{id:"perm-reply",checked:C,onCheckedChange:O,"aria-label":"Agent can reply to messages"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(x,{htmlFor:"perm-receive",className:"cursor-pointer text-xs font-normal",children:"Agent receives new messages"}),e.jsx(E,{id:"perm-receive",checked:w,onCheckedChange:M,"aria-label":"Agent receives new messages"})]})]}),e.jsxs("div",{className:"space-y-2.5 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Notifications"}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(x,{htmlFor:"notify-task-complete",className:"cursor-pointer text-xs font-normal",children:"Message me when scheduled tasks finish"}),e.jsx(E,{id:"notify-task-complete",checked:$,onCheckedChange:_,"aria-label":"Message me when scheduled tasks finish"})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"When off, you still hear about runs that didn’t finish."}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Needs “Agent can message first”."}),p&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"Message your bot once to start. Bots can’t write first."})]})]}),e.jsx(Ze,{descriptor:f,consequence:e.jsxs(e.Fragment,{children:["Anyone who can message this connection can make the agent act, with no one asked."," ",e.jsxs(Ke,{label:"About asking in the chat",title:"At a stop that asks",children:[e.jsx("p",{children:"Where your connection can show buttons, the agent waits for Approve or Deny."}),e.jsx("p",{children:"Only people on the approver list can answer."}),e.jsx("p",{children:"An ask nobody answers is refused after 10 minutes, and the agent carries on."})]})]}),onCancel:()=>I(null),onConfirm:()=>{f&&h(f.id),I(null)}})]})}const m="__any__",en={"per-chat":"One shared chat per group or channel","per-user":"One chat for each person",stateless:"No memory between messages"},me=[{value:"dm",label:"Direct message"},{value:"group",label:"Group"},{value:"channel",label:"Broadcast channel"},{value:"thread",label:"Thread"}];function xe(n){var i;return((i=me.find(o=>o.value===n))==null?void 0:i.label)??n}function nn({sessionStrategy:n,chatDisplayName:i,channelType:o}){const h=en[n];return i?`${h} in ${i}`:o?`${h} · ${xe(o)}`:h}function hn(n){return{adapterId:n.adapterId,agentId:n.agentId,sessionStrategy:n.sessionStrategy,label:n.label,permissionMode:n.permissionMode,chatId:n.chatId,channelType:n.channelType,canInitiate:n.canInitiate,canReply:n.canReply,canReceive:n.canReceive,notifyOnTaskComplete:n.notifyOnTaskComplete}}function pn(n){return{sessionStrategy:n.sessionStrategy,label:n.label,permissionMode:n.permissionMode,chatId:n.chatId??null,channelType:n.channelType??null,canInitiate:n.canInitiate,canReply:n.canReply,canReceive:n.canReceive,notifyOnTaskComplete:n.notifyOnTaskComplete}}function tn(n){return!!(n!=null&&n.canInitiate||(n==null?void 0:n.canReply)===!1||(n==null?void 0:n.canReceive)===!1||(n==null?void 0:n.notifyOnTaskComplete)===!1||(n==null?void 0:n.permissionMode)!==void 0&&n.permissionMode!=="acceptEdits"||n!=null&&n.sessionStrategy&&n.sessionStrategy!=="per-chat")}function sn(n,i){return{adapterId:(n==null?void 0:n.adapterId)??"",agentId:(n==null?void 0:n.agentId)??"",strategy:(n==null?void 0:n.sessionStrategy)??"per-chat",label:(n==null?void 0:n.label)??"",chatId:(n==null?void 0:n.chatId)??m,channelType:(n==null?void 0:n.channelType)??m,permissionMode:(n==null?void 0:n.permissionMode)??(i==null?void 0:i.defaultPermissionMode)??"acceptEdits",canInitiate:(n==null?void 0:n.canInitiate)??(i==null?void 0:i.defaultCanInitiate)??!1,canReply:(n==null?void 0:n.canReply)??!0,canReceive:(n==null?void 0:n.canReceive)??!0,notifyOnTaskComplete:(n==null?void 0:n.notifyOnTaskComplete)??!0}}function mn({open:n,onOpenChange:i,onConfirm:o,mode:h,initialValues:d,adapterName:y,agentName:C,onDelete:O,bindingId:w,isPending:M,bridged:$,bridgeSlot:_}){const p=h==="edit",[L,P]=A.useState(()=>!!(d!=null&&d.chatId||d!=null&&d.channelType)),[q,z]=A.useState(()=>tn(d)),{data:u}=Fe(),j=le(Y),[c]=A.useState(()=>{var t;return sn(d,p?void 0:{defaultPermissionMode:Oe(we(u==null?void 0:u.executionDefaults,Y),(j==null?void 0:j.permissionModes.values)??[]),defaultCanInitiate:u!=null&&Xe((t=u.permissions)==null?void 0:t.preset)==="trusted"})}),r=Ue({defaultValues:c,onSubmit:async({value:t})=>{await o({adapterId:t.adapterId,agentId:t.agentId,sessionStrategy:t.strategy,label:t.label,permissionMode:t.permissionMode,chatId:t.chatId===m?void 0:t.chatId,channelType:t.channelType===m?void 0:t.channelType,canInitiate:t.canInitiate,canReply:t.canReply,canReceive:t.canReceive,notifyOnTaskComplete:t.notifyOnTaskComplete}),p||r.reset()}}),{data:D=[]}=We(),{data:f}=Me(),[I,H]=A.useState(()=>(d==null?void 0:d.adapterId)??""),{data:l=[]}=Je(I||void 0),N=D.flatMap(t=>t.instances.filter(g=>g.enabled).map(g=>({id:g.id,label:g.label?`${g.label} (${t.manifest.displayName})`:`${g.id} (${t.manifest.displayName})`}))),T=(f==null?void 0:f.agents)??[];function ge(){r.setFieldValue("chatId",m),r.setFieldValue("channelType",m)}return e.jsx(De,{open:n,onOpenChange:i,children:e.jsxs(Ee,{className:"max-h-[85vh] max-w-md gap-0 p-0",children:[e.jsxs(Be,{className:"border-b px-4 py-3",children:[e.jsx($e,{children:p?"Edit connection":"Add connection"}),e.jsx(_e,{className:"sr-only",children:p?"Edit this connection’s settings":"Connect this agent to a chat"})]}),e.jsx(r.Subscribe,{selector:t=>({values:t.values,isSubmitting:t.isSubmitting}),children:({values:t,isSubmitting:g})=>{var X;const G=p||!!t.adapterId&&!!t.agentId,ue=!p||t.adapterId!==c.adapterId||t.agentId!==c.agentId||t.strategy!==c.strategy||t.label!==c.label||t.chatId!==c.chatId||t.channelType!==c.channelType||t.permissionMode!==c.permissionMode||t.canInitiate!==c.canInitiate||t.canReply!==c.canReply||t.canReceive!==c.canReceive||t.notifyOnTaskComplete!==c.notifyOnTaskComplete,Q=p?C:(X=T.find(s=>s.id===t.agentId))==null?void 0:X.name,U=G&&Q?`${nn({sessionStrategy:t.strategy,chatDisplayName:t.chatId!==m?`#${t.chatId}`:void 0,channelType:t.channelType!==m?t.channelType:void 0})}. Routed to ${Q}.`:null,W=t.chatId!==m||t.channelType!==m,ye=t.strategy!=="per-chat"||t.permissionMode!=="acceptEdits"||t.canInitiate||!t.canReply||!t.canReceive||!t.notifyOnTaskComplete,je=!G||!ue||!!M||g,K=!!M||g;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-5 overflow-y-auto px-4 py-5",children:[p?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Connection:"," ",e.jsx("span",{className:"text-foreground font-medium",children:y})," →"," ",e.jsx("span",{className:"text-foreground font-medium",children:C})]}),_]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"binding-adapter",children:"Source"}),N.length===0?e.jsx("p",{className:"text-muted-foreground border-input rounded-md border px-3 py-2 text-sm opacity-50",children:"Nothing set up yet"}):e.jsx(r.AppField,{name:"adapterId",children:s=>e.jsxs(S,{value:s.state.value,onValueChange:a=>{s.handleChange(a),H(a)},children:[e.jsx(k,{id:"binding-adapter",className:"w-full",children:e.jsx(R,{placeholder:"Pick a source"})}),e.jsx(F,{children:N.map(a=>e.jsx(b,{value:a.id,children:a.label},a.id))})]})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"binding-agent",children:"Agent"}),T.length===0?e.jsx("p",{className:"text-muted-foreground border-input rounded-md border px-3 py-2 text-sm opacity-50",children:"No agents yet"}):e.jsx(r.AppField,{name:"agentId",children:s=>e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-agent",className:"w-full",children:e.jsx(R,{placeholder:"Select an agent"})}),e.jsx(F,{children:T.map(a=>e.jsx(b,{value:a.id,children:Le(a)},a.id))})]})})]})]}),e.jsx(r.AppField,{name:"label",children:s=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"binding-label",children:"Label (optional)"}),e.jsx(Pe,{id:"binding-label",placeholder:"e.g., Customer support bot",value:s.state.value,onBlur:s.handleBlur,onChange:a=>s.handleChange(a.target.value)}),e.jsx(V,{children:"A name to tell this connection apart"})]})}),e.jsxs(he,{open:L,onOpenChange:P,trigger:"Chat filter",badge:W?e.jsx(pe,{variant:"secondary",children:"Active"}):void 0,children:[e.jsx(r.AppField,{name:"chatId",children:s=>e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(x,{htmlFor:"binding-chat-id",children:"Chat ID"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-chat-id",className:"w-full",children:e.jsx(R,{placeholder:"Any chat"})}),e.jsxs(F,{children:[e.jsx(b,{value:m,children:"Any chat"}),l.map(a=>e.jsxs(b,{value:a.chatId,children:[e.jsx("span",{children:a.displayName??a.chatId}),(a.channelType||a.messageCount>0)&&e.jsx("span",{className:"text-muted-foreground ml-2 text-xs",children:[a.channelType?xe(a.channelType):null,`${a.messageCount} messages`].filter(Boolean).join(" · ")})]},a.chatId))]})]}),e.jsx(V,{children:"Only take messages from this chat"})]})}),e.jsx(r.AppField,{name:"channelType",children:s=>e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(x,{htmlFor:"binding-channel-type",children:"Chat type"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-channel-type",className:"w-full",children:e.jsx(R,{placeholder:"Any type"})}),e.jsxs(F,{children:[e.jsx(b,{value:m,children:"Any type"}),me.map(a=>e.jsx(b,{value:a.value,children:a.label},a.value))]})]})]})}),W&&e.jsx("div",{className:"px-4 py-3",children:e.jsx(B,{variant:"ghost",size:"sm",onClick:ge,children:"Clear filters"})})]}),e.jsx(ve,{strategy:t.strategy,onStrategyChange:s=>r.setFieldValue("strategy",s),permissionMode:t.permissionMode,onPermissionModeChange:s=>r.setFieldValue("permissionMode",s),canInitiate:t.canInitiate,onCanInitiateChange:s=>r.setFieldValue("canInitiate",s),canReply:t.canReply,onCanReplyChange:s=>r.setFieldValue("canReply",s),canReceive:t.canReceive,onCanReceiveChange:s=>r.setFieldValue("canReceive",s),notifyOnTaskComplete:t.notifyOnTaskComplete,onNotifyOnTaskCompleteChange:s=>r.setFieldValue("notifyOnTaskComplete",s),notifyBootstrapHint:l.length===0,bridged:$,open:q,onOpenChange:z,hasChanges:ye}),U&&e.jsx("p",{className:"text-muted-foreground bg-muted/50 rounded-md px-3 py-2 text-xs italic",children:U})]}),e.jsxs(qe,{className:"border-t px-4 py-3",children:[p&&O&&w&&e.jsxs(ee,{children:[e.jsx(ze,{asChild:!0,children:e.jsxs(B,{variant:"ghost",size:"sm",className:"mr-auto text-red-600 hover:bg-red-50 hover:text-red-700 dark:hover:bg-red-950",children:[e.jsx(He,{className:"mr-1.5 size-3.5"}),"Remove"]})}),e.jsxs(ne,{children:[e.jsxs(te,{children:[e.jsx(se,{children:"Remove this connection?"}),e.jsx(ae,{children:"This agent stops getting messages from it."})]}),e.jsxs(re,{children:[e.jsx(ce,{children:"Cancel"}),e.jsx(oe,{onClick:()=>O(w),className:Ye({variant:"destructive"}),children:"Remove connection"})]})]})]}),e.jsx(B,{variant:"ghost",size:"sm",onClick:()=>i(!1),children:"Cancel"}),e.jsxs(B,{size:"sm",onClick:()=>r.handleSubmit(),disabled:je,children:[K&&e.jsx(Ge,{size:"xs",className:"mr-1.5"}),K?"Saving…":p?"Save changes":"Add connection"]})]})]})}})]})})}export{mn as B,ln as a,nn as b,hn as c,xe as d,pn as t,Je as u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-
|
|
2
|
-
var E7=Object.defineProperty;var S1=r=>{throw TypeError(r)};var D7=(r,e,t)=>e in r?E7(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Ce=(r,e,t)=>D7(r,typeof e!="symbol"?e+"":e,t),nd=(r,e,t)=>e.has(r)||S1("Cannot "+t);var C=(r,e,t)=>(nd(r,e,"read from private field"),t?t.call(r):e.get(r)),_=(r,e,t)=>e.has(r)?S1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),F=(r,e,t,n)=>(nd(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),Wi=(r,e,t)=>(nd(r,e,"access private method"),t);import{pF as C1,pG as O7,pH as _2,pI as gh,pJ as R7,pK as I7,pL as z7,r as R,R as j2,ez as bc,pM as yh,pN as vh,pO as $s,pP as M1,pQ as V2,pR as L7,pS as ol,pT as al,pU as T1,pV as es,pW as B7,pX as P7,pY as F7,pZ as f0,p_ as W2,p$ as Ua,h1 as $7,q0 as q7,q1 as ns,q2 as Tr,q3 as Ui,q4 as Hc,q5 as je,eR as H7,q6 as _7,q7 as j7,q8 as Wr,q9 as tu,qa as Mi,qb as U2,qc as A1,j as L,hB as V7,G as W7,aZ as U7}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-B1mQMOXd.js","assets/index-CjUfPyOM.js","assets/index-D2ZFfqZZ.css","assets/transform-BqqRT-Iy.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var E7=Object.defineProperty;var S1=r=>{throw TypeError(r)};var D7=(r,e,t)=>e in r?E7(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Ce=(r,e,t)=>D7(r,typeof e!="symbol"?e+"":e,t),nd=(r,e,t)=>e.has(r)||S1("Cannot "+t);var C=(r,e,t)=>(nd(r,e,"read from private field"),t?t.call(r):e.get(r)),_=(r,e,t)=>e.has(r)?S1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),F=(r,e,t,n)=>(nd(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),Wi=(r,e,t)=>(nd(r,e,"access private method"),t);import{pF as C1,pG as O7,pH as _2,pI as gh,pJ as R7,pK as I7,pL as z7,r as R,R as j2,ez as bc,pM as yh,pN as vh,pO as $s,pP as M1,pQ as V2,pR as L7,pS as ol,pT as al,pU as T1,pV as es,pW as B7,pX as P7,pY as F7,pZ as f0,p_ as W2,p$ as Ua,h1 as $7,q0 as q7,q1 as ns,q2 as Tr,q3 as Ui,q4 as Hc,q5 as je,eR as H7,q6 as _7,q7 as j7,q8 as Wr,q9 as tu,qa as Mi,qb as U2,qc as A1,j as L,hB as V7,G as W7,aZ as U7}from"./index-CjUfPyOM.js";import{p as zf}from"./index-DgxXSEmR.js";import{aw as K7,ax as G7,ab as J7,ac as Y7,ad as X7,ae as Z7,af as Q7,ag as K2,ah as eb,q as p0,ai as tb,aj as G2,ar as rb,ak as nb,al as ib,am as sb,an as ob,ao as ab,ap as lb,aq as cb,Z as Lf,a4 as ub,a5 as J2,a6 as db,a7 as hb,a8 as fb,a9 as pb,aa as mb,m as gb,a as yb,ay as vb,E as Fa,as as bb,t as ht,n as wb,at as kb,C as N1,az as xb}from"./index-DB2t3GUm.js";const Sb={}.hasOwnProperty;function Y2(r,e){let t=-1,n;if(e.extensions)for(;++t<e.extensions.length;)Y2(r,e.extensions[t]);for(n in e)if(Sb.call(e,n))switch(n){case"extensions":break;case"unsafe":{E1(r[n],e[n]);break}case"join":{E1(r[n],e[n]);break}case"handlers":{Cb(r[n],e[n]);break}default:r.options[n]=e[n]}return r}function E1(r,e){e&&r.push(...e)}function Cb(r,e){e&&Object.assign(r,e)}const Mb=[Tb];function Tb(r,e,t,n){if(e.type==="code"&&C1(e,n)&&(r.type==="list"||r.type===e.type&&C1(r,n)))return!1;if("spread"in t&&typeof t.spread=="boolean")return r.type==="paragraph"&&(r.type===e.type||e.type==="definition"||e.type==="heading"&&O7(e,n))?void 0:t.spread?1:0}const Ki=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Ab=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
|
|
3
3
|
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Ki},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
|
4
4
|
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Ki},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
|
5
5
|
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Ki},{atBreak:!0,character:"+",after:`(?:[ \r
|
|
@@ -1228,4 +1228,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1228
1228
|
fill: hsl(var(--muted-foreground)) !important;
|
|
1229
1229
|
stroke: hsl(var(--muted-foreground)) !important;
|
|
1230
1230
|
}
|
|
1231
|
-
`,hz={look:"classic",fontFamily:"var(--font-sans)",themeCSS:dz},fz=()=>U7(()=>import("./mermaid.core-
|
|
1231
|
+
`,hz={look:"classic",fontFamily:"var(--font-sans)",themeCSS:dz},fz=()=>U7(()=>import("./mermaid.core-B1mQMOXd.js").then(r=>r.bm),__vite__mapDeps([0,1,2,3])).then(r=>(r.default.initialize(hz),r));function pz({value:r,editable:e,onChange:t,className:n,sourceRevision:i,onSourceReady:s,onSourceSelection:o,onTaskToggleRequest:a,wikiLinks:l}){const c=V7();return L.jsx("div",{"data-theme":c,className:"dorkos-markdown contents",children:L.jsx(cz,{value:r,theme:c,editable:e,onChange:t,sourceRevision:i,onSourceReady:s,onSourceSelection:o,onTaskToggleRequest:a,wikiLinks:l,mermaid:fz,className:W7("desktop:select-text",n)})})}const bz=Object.freeze(Object.defineProperty({__proto__:null,BlintzCanvas:pz},Symbol.toStringTag,{value:"Module"}));export{bz as B,G0 as S,nD as a,rD as b,sD as c,UE as f,J0 as i,Iv as p,wv as r,J4 as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{eR as Ee,a1 as xe,aY as Re,r as ve,a2 as Se,j,G as Ce}from"./index-
|
|
1
|
+
import{eR as Ee,a1 as xe,aY as Re,r as ve,a2 as Se,j,G as Ce}from"./index-CjUfPyOM.js";import{u as Oe}from"./index-6yT0Qr0s.js";import{r as Te}from"./use-session-canvas-u63m2mYH.js";import"./rotate-cw-scTEKxeZ.js";import"./query-keys-DeYqUDia.js";import"./index.esm-Bb3LMu5X.js";import"./WidgetErrorCard-I8WiJv2g.js";import"./index-D0yajRDv.js";import"./card-DI7YtQh3.js";import"./progress-eQl1UvNz.js";import"./markdown-content-ysBIqFAg.js";import"./table-B0LsKsEv.js";import"./package-CD8xq7hk.js";import"./heart-BrjEmIsl.js";import"./git-branch-ClXAt1_G.js";import"./file-text-DTvj1wzM.js";import"./file-bSD5jgk_.js";import"./McpAppFrame-BotrzoHd.js";import"./more-details-DHCpYDi7.js";var he={exports:{}};/* @license
|
|
2
2
|
Papa Parse
|
|
3
3
|
v5.7.0
|
|
4
4
|
https://github.com/mholt/PapaParse
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-
|
|
2
|
-
import{r as a,aY as B,hy as ce,j as t,G as O,fO as oe,fP as le,B as D,fQ as ue,fR as de,fS as Z,hz as fe,d8 as he,d9 as pe,J as me,ga as ve,da as xe,a3 as ge,hA as be,aZ as ee,a1 as ye,hB as je,a2 as Ce}from"./index-DKTd8X7n.js";import{u as ke,a as we,b as Re}from"./use-session-canvas-DQ9ND8il.js";import{R as Te}from"./rotate-cw-mHsqEte-.js";import"./query-keys-DeYqUDia.js";import"./index.esm-j5KQ_b6S.js";import"./WidgetErrorCard-CAUx4KUI.js";import"./index-CSqz4B0v.js";import"./card-D4ek-VvX.js";import"./progress-BB97hlmb.js";import"./markdown-content-CN_dGlgE.js";import"./table-BIdFvzBs.js";import"./package-BVNiaGrb.js";import"./heart-DnR_GX4I.js";import"./git-branch-D5xr7U5P.js";import"./file-text-BJt8biPY.js";import"./file-C-ooqbRY.js";import"./McpAppFrame-Cz-Ttlqr.js";import"./more-details-DRPervoL.js";function E(e,r){return["canvas-file",e,r]}function Ne({documentId:e,sourcePath:r,binding:d,save:n,draftRef:o,revisionRef:s,finishAttemptRef:C,timerRef:y,finalSaveRef:b,invalidateConfirmedFile:p}){const x=a.useRef({binding:d,save:n,invalidateConfirmedFile:p}),_=a.useRef(null),f=a.useRef(null);return a.useLayoutEffect(()=>{x.current={binding:d,save:n,invalidateConfirmedFile:p}}),a.useLayoutEffect(()=>{const w=B.getState().openDocuments.find(m=>m.id===e);if(!w||typeof w.openedAt!="number")return;const R=ce(e,w.openedAt,r,{required:()=>!!x.current.binding,current:()=>{const m=f.current;return!!m&&m.revision===s.current&&m.attempt===C.current&&m.binding===x.current.binding&&m.save===x.current.save&&m.binding.current()},invalidateConfirmedFile:()=>x.current.invalidateConfirmedFile(),prepare:async()=>{var c;f.current=null;const{binding:m,save:T}=x.current;if(!(m!=null&&m.current()))return!1;y.current&&(clearTimeout(y.current),y.current=null);const F=o.current,g=s.current,l=++C.current,i=await T(F);return i.status!=="changed"&&i.status!=="no_op"||i.confirmed.content!==F||s.current!==g||C.current!==l||x.current.binding!==m||x.current.save!==T||!m.current()?!1:((c=b.current)==null||c.cancel(),b.current=null,f.current={revision:g,attempt:l,binding:m,save:T},!0)}});return _.current=R,()=>R.retire()},[e,r,o,s,C,y,b]),_}function M(e){return e.status==="refused"||e.status==="local_uncertain"?e.status:"unavailable"}function _e(e,r,d){var l;const n=a.useRef(e),o=a.useRef(null),s=a.useRef(null),[C,y]=a.useState({identity:e.identity,phase:"pending",busy:!1});a.useLayoutEffect(()=>{n.current=e},[e]);const b=a.useCallback((i,c)=>{o.current===i&&n.current.identity===i&&n.current.current()&&y(u=>({identity:i,...c,historical:c.historical??(u.identity===i?u.historical:void 0)}))},[]),p=a.useCallback(i=>{o.current!==i||n.current.identity!==i||y(c=>c.identity===i?{...c,phase:"unavailable",busy:!1}:{identity:i,phase:"unavailable",busy:!1})},[]),x=e.identity,_=e.supported;a.useLayoutEffect(()=>{const i=n.current;s.current=null,o.current=x;let c=!1;return _&&r==="ready"&&i.discover().then(u=>{c||(u.status==="observed"?b(x,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(x,{phase:M(u),busy:!1}):p(x))}),()=>{c=!0,s.current=null,o.current===x&&(o.current=null)}},[x,_,r,d,b,p]);const f=C.identity===e.identity?C:void 0,w=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return;s.current=null,y(j=>({identity:c,phase:"pending",busy:!0,historical:j.identity===c?j.historical:void 0}));const u=await i.discover(!0);u.status==="observed"?b(c,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(c,{phase:M(u),busy:!1}):p(c)},[b,p]),R=a.useCallback(async i=>{const c=n.current,u=c.identity;if(o.current!==u||!c.current())return;s.current=null,y(h=>({identity:u,phase:"pending",busy:!0,discovery:h.identity===u?h.discovery:void 0,historical:h.identity===u?h.historical:void 0}));const j=await c.recover(i);j.status==="observed"?b(u,{phase:"ready",discovery:j.value.discovery,historical:j.value.result.entry,busy:!1}):j.status!=="idle"?b(u,{phase:M(j),busy:!1}):p(u)},[b,p]),m=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return{status:"idle"};const u={};s.current=u,y(h=>h.identity===c?{...h,phase:"pending",busy:!0}:h);const j=await i.inspectCurrent();return s.current!==u?{status:"idle"}:(s.current=null,j.status==="idle"&&p(c),o.current===c&&n.current.identity===c&&i.current()&&j.status!=="idle"&&y(h=>h.identity===c?{...h,phase:j.status==="observed"?"ready":M(j),busy:!1}:h),j)},[p]),T=e.supported&&r==="ready",F=r==="pending"?"pending":(f==null?void 0:f.phase)??"pending",g=T&&(F!=="ready"||((l=f==null?void 0:f.discovery)==null?void 0:l.admission)==="blocked");return{supported:T,phase:F,editBlocked:g,busy:(f==null?void 0:f.busy)??F==="pending",discovery:f==null?void 0:f.discovery,historical:f==null?void 0:f.historical,refresh:w,recover:R,inspectCurrent:m}}const Fe={unavailable:"Couldn’t check previous saves, so editing is off.",refused:"This file can’t be edited from this canvas."};function Pe(e){var r,d,n;return e.supported?e.phase==="unavailable"||e.phase==="refused"||e.phase==="local_uncertain"?!0:((r=e.discovery)==null?void 0:r.admission)==="blocked"||((d=e.discovery)==null?void 0:d.entries.some(o=>o.state==="review"))===!0||((n=e.historical)==null?void 0:n.state)==="receipt":!1}function X({recovery:e,editing:r,loadCurrent:d}){var o;if(e.phase==="unavailable"||e.phase==="refused")return t.jsxs(t.Fragment,{children:[t.jsx("p",{role:"alert",className:"col-start-1 row-start-1 py-1.5",children:Fe[e.phase]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",className:"col-span-2 col-start-1 row-start-2 mb-1.5 justify-self-start @md:col-span-1 @md:col-start-2 @md:row-start-1 @md:mb-0",disabled:e.busy||r,onClick:()=>void e.refresh(),children:"Check again"})]});if(e.phase==="local_uncertain")return t.jsx("p",{role:"alert",children:"Use Retry original save. Checking previous saves won’t confirm this save."});const n=e.discovery;return t.jsxs("div",{className:"space-y-1",children:[(n==null?void 0:n.admission)==="blocked"&&t.jsx("p",{role:"alert",children:"An unresolved original save blocks this file. This list may not include the blocking operation."}),(n==null?void 0:n.hasMore)&&t.jsx("p",{children:"Only the latest 25 matching saves are shown. Older evidence is omitted."}),n&&n.entries.length>0&&t.jsx(t.Fragment,{children:t.jsx("ul",{children:n.entries.map(s=>t.jsxs("li",{children:[t.jsxs("span",{children:[s.eventId,":"," ",s.state==="receipt"?"Historical save recorded":s.state==="review"?"Original save needs review":s.state==="no_op"?"Original save made no change":"Original save failed before replacement"]}),s.state==="review"&&(s.reason==="prepared_without_replacement"?t.jsx("p",{children:"This save needs manual review. These controls won’t write the file."}):t.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsx("p",{children:"The original saved replacement must be proven before its receipt can be settled."}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:e.busy||r,onClick:()=>void e.recover(s.eventId),children:"Recover original receipt"})]}))]},s.eventId))})}),(n==null?void 0:n.admission)==="blocked"&&n.entries.length===0&&t.jsx("p",{children:"No matching recent saves."}),((o=e.historical)==null?void 0:o.state)==="receipt"&&t.jsxs("div",{role:"status",className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsxs("div",{children:[t.jsx("p",{children:"Previous save confirmed. Your current draft may differ."}),t.jsx("p",{children:e.historical.currentFileMatch==="different"?"The current file differs from that historical save.":e.historical.currentFileMatch==="same_saved_replacement"?"The saved replacement matched when checked; current bytes still require a fresh load.":"The current file was not checked."})]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:r||e.editBlocked||e.busy,onClick:d,children:"Load current file"})]})]})}function Se({recovery:e,editing:r,loadCurrent:d}){return!e.supported||r?null:t.jsxs(oe,{children:[t.jsx(le,{asChild:!0,children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground","aria-label":"More file actions",children:t.jsx(ue,{className:"size-4"})})}),t.jsxs(de,{align:"end",children:[t.jsx(Z,{disabled:e.busy,onSelect:()=>void e.refresh(),children:"Check previous saves"}),t.jsx(Z,{disabled:e.editBlocked||e.busy,onSelect:()=>d(),children:"Load current file"})]})]})}function De({recovery:e,editing:r,loadCurrent:d,toolbar:n}){const o=Pe(e),s=e.phase==="unavailable"||e.phase==="refused";return t.jsxs(t.Fragment,{children:[e.supported&&e.phase==="pending"&&t.jsx("p",{role:"status",className:"sr-only",children:"Checking previous saves…"}),t.jsx("div",{...o?{role:"region","aria-label":"Previous file saves"}:{},className:O("shrink-0",o?"bg-muted text-foreground mx-2 mt-2 rounded-md py-1 pr-1 pl-3 text-sm":"flex justify-end px-2 pt-1",o&&(s?"@container":"flow-root")),children:t.jsxs("div",{className:O(o&&s&&"grid grid-cols-[1fr_auto] items-center gap-x-2 @md:grid-cols-[1fr_auto_auto]"),children:[t.jsx("div",{className:O("flex items-center gap-1",o&&!s&&"float-right ml-2",o&&s&&"col-start-2 row-start-1 @md:col-start-3"),children:n}),o&&(s?t.jsx(X,{recovery:e,editing:r,loadCurrent:d}):t.jsx("div",{className:"py-1.5",children:t.jsx(X,{recovery:e,editing:r,loadCurrent:d})}))]})})]})}function Le({editing:e,off:r,observation:d,onClick:n}){return t.jsx(fe,{children:t.jsxs(he,{...r?{}:{open:!1},children:[t.jsx(pe,{asChild:!0,children:t.jsx("span",{className:"inline-flex",children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:n,"aria-label":e?"Finish editing":"Edit file",disabled:r,"data-document-save-observation":d,children:e?t.jsx(me,{className:"size-4"}):t.jsx(ve,{className:"size-4"})})})}),t.jsx(xe,{children:"Editing is off"})]})})}const ze=a.lazy(()=>ee(()=>import("./CodeMirrorEditor-n3l14rY7.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),Be=a.lazy(()=>ee(()=>import("./BlintzCanvas-C-dobEns.js").then(e=>e.B),__vite__mapDeps([5,1,2,6,4,7])).then(e=>({default:e.BlintzCanvas}))),Ee=500;function Me(e,r){return r==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function Oe(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";case"uncertain":return"Save not confirmed";default:return null}}function te({content:e,documentId:r,cwd:d,loaded:n,theme:o,isEditing:s,onEditingChange:C,setDocumentEditing:y,observedBinding:b,fileSaveObservation:p="unavailable",recoveryBinding:x}){const _=e.readOnly!==!0,f=Me(e.sourcePath,e.language),w=ge(),[R,m]=a.useState(n),[T,F]=a.useState(),g=a.useRef(b);a.useLayoutEffect(()=>{g.current=b},[b]);const l=ke({documentId:r,sourcePath:e.sourcePath,cwd:d,loadedContent:n,documentSaveBinding:T,documentRecoveryBinding:x}),i=_e(l.recovery,p,x),c=we({cwd:d,sourcePath:f?e.sourcePath:null,content:R,saved:l.status==="saved"}),u=a.useRef(!1),j=a.useRef(s);a.useLayoutEffect(()=>(u.current=!0,j.current=s,()=>{u.current=!1}),[s]);const h=a.useRef(null),S=a.useRef(R),L=a.useRef(0),A=a.useRef(0),I=a.useRef(l.save),K=a.useRef(l.prepareFinalSave),U=a.useRef(l.waitForCloseDrain),z=a.useRef(null),Y=a.useRef(C),V=Ne({documentId:r,sourcePath:e.sourcePath,binding:T,save:l.save,draftRef:S,revisionRef:L,finishAttemptRef:A,timerRef:h,finalSaveRef:z,invalidateConfirmedFile:()=>{w.invalidateQueries({queryKey:E(d,e.sourcePath)}).catch(()=>{})}});a.useEffect(()=>{S.current=R,I.current=l.save,K.current=l.prepareFinalSave,U.current=l.waitForCloseDrain,Y.current=C});const $=a.useCallback(v=>{var k;L.current+=1,S.current=v,m(v),(k=z.current)==null||k.cancel(),z.current=K.current(v),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,I.current(S.current)},Ee)},[]),se=()=>{var P;if(i.editBlocked||p==="pending"||p==="ready"&&!((P=g.current)!=null&&P.current()))return;const v=g.current,k=v&&Object.freeze({...v.incarnation});F(v!=null&&v.current()&&k?{incarnation:k,current:()=>{const N=g.current;return!!N&&be(k,N.incarnation)&&N.current()}}:void 0),L.current+=1,S.current=n,m(n),C(!0),y(r,!0)},ne=async()=>{h.current&&(clearTimeout(h.current),h.current=null);const v=S.current,k=L.current,P=++A.current,N=await I.current(v);if(N.status!=="changed"&&N.status!=="no_op"||L.current!==k||A.current!==P||N.confirmed.content!==v)return;const Q=N.confirmed;Q.content===S.current&&w.setQueryData(E(d,e.sourcePath),q=>q&&{...q,content:Q.content,hash:Q.hash}),C(!1),y(r,!1)},re=()=>{w.invalidateQueries({queryKey:E(d,e.sourcePath)})};a.useEffect(()=>{var v;s||(h.current&&clearTimeout(h.current),h.current=null,(v=z.current)==null||v.cancel(),z.current=null)},[s]),a.useEffect(()=>{const v=V.current;return()=>{var N;h.current&&(clearTimeout(h.current),h.current=null);const k=(N=z.current)==null?void 0:N.flush(),P=S.current;v==null||v.settleRetirement(Promise.resolve(k).then(()=>U.current(P))),z.current=null,y(r,!1),Y.current(!1)}},[r,y,V]);const G=async()=>{if(s||!u.current||i.editBlocked)return;const v=L.current,k=await i.inspectCurrent();k.status!=="observed"||!u.current||j.current||L.current!==v||!l.recovery.current()||w.setQueryData(E(d,e.sourcePath),P=>P&&{...P,...k.value})},ae=()=>{const v=l.adoptDisk();v!=null&&m(v)},ie=()=>{l.overwrite(S.current)},J=l.status==="saved"?l.confirmedContent!==R?"Unsaved changes":l.documentReceipt?"Save recorded":"Saved to file":Oe(l.status),W=s?R:n;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsx(De,{recovery:i,editing:s,loadCurrent:()=>void G(),toolbar:t.jsxs(t.Fragment,{children:[_&&J&&t.jsx("span",{className:O("mr-1 text-xs",l.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:J}),!s&&p==="pending"&&t.jsx("span",{role:"status",children:"Checking document…"}),!s&&t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:re,"aria-label":"Refresh from disk",children:t.jsx(Te,{className:"size-4"})}),_&&t.jsx(Le,{editing:s,off:!s&&(p==="pending"||i.editBlocked),observation:p,onClick:s?()=>void ne():se}),t.jsx(Se,{recovery:i,editing:s,loadCurrent:()=>void G()})]})}),l.status==="uncertain"&&t.jsxs("div",{role:"status",className:"mx-2 mt-2 flex items-center gap-2 text-sm",children:[t.jsx("span",{children:"Save not confirmed. Retry the original save before saving another draft."}),t.jsx(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>void l.retryUnconfirmed(),children:"Retry original save"})]}),l.status==="conflict"&&t.jsxs("div",{className:"bg-destructive/10 text-destructive mx-2 mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-3 py-2 text-sm",children:[t.jsx("span",{className:"flex-1",children:"This file changed on disk since you opened it."}),t.jsx(D,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:ae,children:"Reload"}),t.jsx(D,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:ie,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(a.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:f?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(Be,{value:W,editable:s,onChange:s?$:void 0,wikiLinks:c})}):t.jsx(ze,{value:W,editable:s,filename:e.sourcePath,languageHint:e.language,theme:o,onChange:s?$:void 0})})})]})}function Ae(e){const{fileSaveBinding:r,fileSaveObservation:d}=Re(e.documentId);return t.jsx(te,{...e,observedBinding:r,recoveryBinding:r,fileSaveObservation:d})}function Ie(e){switch(e==null?void 0:e.code){case"NOT_FOUND":return"This file doesn’t exist.";case"NOT_A_FILE":return"This path is a directory, not a file.";case"TOO_LARGE":return"This file is too large to open here.";case"BINARY_FILE":return"This file isn’t text, so the editor can’t show it.";default:return"This file couldn’t be loaded."}}function at({content:e,documentId:r}){const d=ye(),n=B(g=>g.selectedCwd),o=B(g=>g.setDocumentEditing),s=B(g=>{var l;return((l=g.openDocuments.find(i=>i.id===r))==null?void 0:l.editing)??!1}),C=je(),y=B(g=>g.canvasSessionId),b=B(g=>g.roomCanvasLiveRoomId),{data:p,error:x,isLoading:_}=Ce({queryKey:E(n,e.sourcePath),enabled:n!==null,queryFn:()=>d.readFileContent(n,e.sourcePath),staleTime:3e4,retry:!1}),[f,w]=a.useState(null),R=g=>{w(g&&p?{pinnedHash:p.hash}:null)};if(n===null)return t.jsx(H,{children:"Open a chat to view files."});if(_)return t.jsx(H,{children:"Loading file…"});if(x||!p)return t.jsx(H,{children:Ie(x)});const m=f!==null&&s,T=(m?f==null?void 0:f.pinnedHash:null)??p.hash,F=y&&!b?Ae:te;return t.jsx(F,{content:e,documentId:r,cwd:n,loaded:p.content,theme:C,isEditing:m,onEditingChange:R,setDocumentEditing:o},`${e.sourcePath}:${T}`)}function H({children:e}){return t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:e})})}export{at as CanvasFileContent};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-CVXZ9B5S.js","assets/index-CjUfPyOM.js","assets/index-D2ZFfqZZ.css","assets/index-Cefoks17.js","assets/index-DB2t3GUm.js","assets/BlintzCanvas-DzjdPTlx.js","assets/index-DgxXSEmR.js","assets/BlintzCanvas-DCXOV_yN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as a,aY as B,hy as ce,j as t,G as O,fO as oe,fP as le,B as D,fQ as ue,fR as de,fS as Z,hz as fe,d8 as he,d9 as pe,J as me,ga as ve,da as xe,a3 as ge,hA as be,aZ as ee,a1 as ye,hB as je,a2 as Ce}from"./index-CjUfPyOM.js";import{u as ke,a as we,b as Re}from"./use-session-canvas-u63m2mYH.js";import{R as Te}from"./rotate-cw-scTEKxeZ.js";import"./query-keys-DeYqUDia.js";import"./index.esm-Bb3LMu5X.js";import"./WidgetErrorCard-I8WiJv2g.js";import"./index-D0yajRDv.js";import"./card-DI7YtQh3.js";import"./progress-eQl1UvNz.js";import"./markdown-content-ysBIqFAg.js";import"./table-B0LsKsEv.js";import"./package-CD8xq7hk.js";import"./heart-BrjEmIsl.js";import"./git-branch-ClXAt1_G.js";import"./file-text-DTvj1wzM.js";import"./file-bSD5jgk_.js";import"./McpAppFrame-BotrzoHd.js";import"./more-details-DHCpYDi7.js";function E(e,r){return["canvas-file",e,r]}function Ne({documentId:e,sourcePath:r,binding:d,save:n,draftRef:o,revisionRef:s,finishAttemptRef:C,timerRef:y,finalSaveRef:b,invalidateConfirmedFile:p}){const x=a.useRef({binding:d,save:n,invalidateConfirmedFile:p}),_=a.useRef(null),f=a.useRef(null);return a.useLayoutEffect(()=>{x.current={binding:d,save:n,invalidateConfirmedFile:p}}),a.useLayoutEffect(()=>{const w=B.getState().openDocuments.find(m=>m.id===e);if(!w||typeof w.openedAt!="number")return;const R=ce(e,w.openedAt,r,{required:()=>!!x.current.binding,current:()=>{const m=f.current;return!!m&&m.revision===s.current&&m.attempt===C.current&&m.binding===x.current.binding&&m.save===x.current.save&&m.binding.current()},invalidateConfirmedFile:()=>x.current.invalidateConfirmedFile(),prepare:async()=>{var c;f.current=null;const{binding:m,save:T}=x.current;if(!(m!=null&&m.current()))return!1;y.current&&(clearTimeout(y.current),y.current=null);const F=o.current,g=s.current,l=++C.current,i=await T(F);return i.status!=="changed"&&i.status!=="no_op"||i.confirmed.content!==F||s.current!==g||C.current!==l||x.current.binding!==m||x.current.save!==T||!m.current()?!1:((c=b.current)==null||c.cancel(),b.current=null,f.current={revision:g,attempt:l,binding:m,save:T},!0)}});return _.current=R,()=>R.retire()},[e,r,o,s,C,y,b]),_}function M(e){return e.status==="refused"||e.status==="local_uncertain"?e.status:"unavailable"}function _e(e,r,d){var l;const n=a.useRef(e),o=a.useRef(null),s=a.useRef(null),[C,y]=a.useState({identity:e.identity,phase:"pending",busy:!1});a.useLayoutEffect(()=>{n.current=e},[e]);const b=a.useCallback((i,c)=>{o.current===i&&n.current.identity===i&&n.current.current()&&y(u=>({identity:i,...c,historical:c.historical??(u.identity===i?u.historical:void 0)}))},[]),p=a.useCallback(i=>{o.current!==i||n.current.identity!==i||y(c=>c.identity===i?{...c,phase:"unavailable",busy:!1}:{identity:i,phase:"unavailable",busy:!1})},[]),x=e.identity,_=e.supported;a.useLayoutEffect(()=>{const i=n.current;s.current=null,o.current=x;let c=!1;return _&&r==="ready"&&i.discover().then(u=>{c||(u.status==="observed"?b(x,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(x,{phase:M(u),busy:!1}):p(x))}),()=>{c=!0,s.current=null,o.current===x&&(o.current=null)}},[x,_,r,d,b,p]);const f=C.identity===e.identity?C:void 0,w=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return;s.current=null,y(j=>({identity:c,phase:"pending",busy:!0,historical:j.identity===c?j.historical:void 0}));const u=await i.discover(!0);u.status==="observed"?b(c,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(c,{phase:M(u),busy:!1}):p(c)},[b,p]),R=a.useCallback(async i=>{const c=n.current,u=c.identity;if(o.current!==u||!c.current())return;s.current=null,y(h=>({identity:u,phase:"pending",busy:!0,discovery:h.identity===u?h.discovery:void 0,historical:h.identity===u?h.historical:void 0}));const j=await c.recover(i);j.status==="observed"?b(u,{phase:"ready",discovery:j.value.discovery,historical:j.value.result.entry,busy:!1}):j.status!=="idle"?b(u,{phase:M(j),busy:!1}):p(u)},[b,p]),m=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return{status:"idle"};const u={};s.current=u,y(h=>h.identity===c?{...h,phase:"pending",busy:!0}:h);const j=await i.inspectCurrent();return s.current!==u?{status:"idle"}:(s.current=null,j.status==="idle"&&p(c),o.current===c&&n.current.identity===c&&i.current()&&j.status!=="idle"&&y(h=>h.identity===c?{...h,phase:j.status==="observed"?"ready":M(j),busy:!1}:h),j)},[p]),T=e.supported&&r==="ready",F=r==="pending"?"pending":(f==null?void 0:f.phase)??"pending",g=T&&(F!=="ready"||((l=f==null?void 0:f.discovery)==null?void 0:l.admission)==="blocked");return{supported:T,phase:F,editBlocked:g,busy:(f==null?void 0:f.busy)??F==="pending",discovery:f==null?void 0:f.discovery,historical:f==null?void 0:f.historical,refresh:w,recover:R,inspectCurrent:m}}const Fe={unavailable:"Couldn’t check previous saves, so editing is off.",refused:"This file can’t be edited from this canvas."};function Pe(e){var r,d,n;return e.supported?e.phase==="unavailable"||e.phase==="refused"||e.phase==="local_uncertain"?!0:((r=e.discovery)==null?void 0:r.admission)==="blocked"||((d=e.discovery)==null?void 0:d.entries.some(o=>o.state==="review"))===!0||((n=e.historical)==null?void 0:n.state)==="receipt":!1}function X({recovery:e,editing:r,loadCurrent:d}){var o;if(e.phase==="unavailable"||e.phase==="refused")return t.jsxs(t.Fragment,{children:[t.jsx("p",{role:"alert",className:"col-start-1 row-start-1 py-1.5",children:Fe[e.phase]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",className:"col-span-2 col-start-1 row-start-2 mb-1.5 justify-self-start @md:col-span-1 @md:col-start-2 @md:row-start-1 @md:mb-0",disabled:e.busy||r,onClick:()=>void e.refresh(),children:"Check again"})]});if(e.phase==="local_uncertain")return t.jsx("p",{role:"alert",children:"Use Retry original save. Checking previous saves won’t confirm this save."});const n=e.discovery;return t.jsxs("div",{className:"space-y-1",children:[(n==null?void 0:n.admission)==="blocked"&&t.jsx("p",{role:"alert",children:"An unresolved original save blocks this file. This list may not include the blocking operation."}),(n==null?void 0:n.hasMore)&&t.jsx("p",{children:"Only the latest 25 matching saves are shown. Older evidence is omitted."}),n&&n.entries.length>0&&t.jsx(t.Fragment,{children:t.jsx("ul",{children:n.entries.map(s=>t.jsxs("li",{children:[t.jsxs("span",{children:[s.eventId,":"," ",s.state==="receipt"?"Historical save recorded":s.state==="review"?"Original save needs review":s.state==="no_op"?"Original save made no change":"Original save failed before replacement"]}),s.state==="review"&&(s.reason==="prepared_without_replacement"?t.jsx("p",{children:"This save needs manual review. These controls won’t write the file."}):t.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsx("p",{children:"The original saved replacement must be proven before its receipt can be settled."}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:e.busy||r,onClick:()=>void e.recover(s.eventId),children:"Recover original receipt"})]}))]},s.eventId))})}),(n==null?void 0:n.admission)==="blocked"&&n.entries.length===0&&t.jsx("p",{children:"No matching recent saves."}),((o=e.historical)==null?void 0:o.state)==="receipt"&&t.jsxs("div",{role:"status",className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsxs("div",{children:[t.jsx("p",{children:"Previous save confirmed. Your current draft may differ."}),t.jsx("p",{children:e.historical.currentFileMatch==="different"?"The current file differs from that historical save.":e.historical.currentFileMatch==="same_saved_replacement"?"The saved replacement matched when checked; current bytes still require a fresh load.":"The current file was not checked."})]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:r||e.editBlocked||e.busy,onClick:d,children:"Load current file"})]})]})}function Se({recovery:e,editing:r,loadCurrent:d}){return!e.supported||r?null:t.jsxs(oe,{children:[t.jsx(le,{asChild:!0,children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground","aria-label":"More file actions",children:t.jsx(ue,{className:"size-4"})})}),t.jsxs(de,{align:"end",children:[t.jsx(Z,{disabled:e.busy,onSelect:()=>void e.refresh(),children:"Check previous saves"}),t.jsx(Z,{disabled:e.editBlocked||e.busy,onSelect:()=>d(),children:"Load current file"})]})]})}function De({recovery:e,editing:r,loadCurrent:d,toolbar:n}){const o=Pe(e),s=e.phase==="unavailable"||e.phase==="refused";return t.jsxs(t.Fragment,{children:[e.supported&&e.phase==="pending"&&t.jsx("p",{role:"status",className:"sr-only",children:"Checking previous saves…"}),t.jsx("div",{...o?{role:"region","aria-label":"Previous file saves"}:{},className:O("shrink-0",o?"bg-muted text-foreground mx-2 mt-2 rounded-md py-1 pr-1 pl-3 text-sm":"flex justify-end px-2 pt-1",o&&(s?"@container":"flow-root")),children:t.jsxs("div",{className:O(o&&s&&"grid grid-cols-[1fr_auto] items-center gap-x-2 @md:grid-cols-[1fr_auto_auto]"),children:[t.jsx("div",{className:O("flex items-center gap-1",o&&!s&&"float-right ml-2",o&&s&&"col-start-2 row-start-1 @md:col-start-3"),children:n}),o&&(s?t.jsx(X,{recovery:e,editing:r,loadCurrent:d}):t.jsx("div",{className:"py-1.5",children:t.jsx(X,{recovery:e,editing:r,loadCurrent:d})}))]})})]})}function Le({editing:e,off:r,observation:d,onClick:n}){return t.jsx(fe,{children:t.jsxs(he,{...r?{}:{open:!1},children:[t.jsx(pe,{asChild:!0,children:t.jsx("span",{className:"inline-flex",children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:n,"aria-label":e?"Finish editing":"Edit file",disabled:r,"data-document-save-observation":d,children:e?t.jsx(me,{className:"size-4"}):t.jsx(ve,{className:"size-4"})})})}),t.jsx(xe,{children:"Editing is off"})]})})}const ze=a.lazy(()=>ee(()=>import("./CodeMirrorEditor-CVXZ9B5S.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),Be=a.lazy(()=>ee(()=>import("./BlintzCanvas-DzjdPTlx.js").then(e=>e.B),__vite__mapDeps([5,1,2,6,4,7])).then(e=>({default:e.BlintzCanvas}))),Ee=500;function Me(e,r){return r==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function Oe(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";case"uncertain":return"Save not confirmed";default:return null}}function te({content:e,documentId:r,cwd:d,loaded:n,theme:o,isEditing:s,onEditingChange:C,setDocumentEditing:y,observedBinding:b,fileSaveObservation:p="unavailable",recoveryBinding:x}){const _=e.readOnly!==!0,f=Me(e.sourcePath,e.language),w=ge(),[R,m]=a.useState(n),[T,F]=a.useState(),g=a.useRef(b);a.useLayoutEffect(()=>{g.current=b},[b]);const l=ke({documentId:r,sourcePath:e.sourcePath,cwd:d,loadedContent:n,documentSaveBinding:T,documentRecoveryBinding:x}),i=_e(l.recovery,p,x),c=we({cwd:d,sourcePath:f?e.sourcePath:null,content:R,saved:l.status==="saved"}),u=a.useRef(!1),j=a.useRef(s);a.useLayoutEffect(()=>(u.current=!0,j.current=s,()=>{u.current=!1}),[s]);const h=a.useRef(null),S=a.useRef(R),L=a.useRef(0),A=a.useRef(0),I=a.useRef(l.save),K=a.useRef(l.prepareFinalSave),U=a.useRef(l.waitForCloseDrain),z=a.useRef(null),Y=a.useRef(C),V=Ne({documentId:r,sourcePath:e.sourcePath,binding:T,save:l.save,draftRef:S,revisionRef:L,finishAttemptRef:A,timerRef:h,finalSaveRef:z,invalidateConfirmedFile:()=>{w.invalidateQueries({queryKey:E(d,e.sourcePath)}).catch(()=>{})}});a.useEffect(()=>{S.current=R,I.current=l.save,K.current=l.prepareFinalSave,U.current=l.waitForCloseDrain,Y.current=C});const $=a.useCallback(v=>{var k;L.current+=1,S.current=v,m(v),(k=z.current)==null||k.cancel(),z.current=K.current(v),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,I.current(S.current)},Ee)},[]),se=()=>{var P;if(i.editBlocked||p==="pending"||p==="ready"&&!((P=g.current)!=null&&P.current()))return;const v=g.current,k=v&&Object.freeze({...v.incarnation});F(v!=null&&v.current()&&k?{incarnation:k,current:()=>{const N=g.current;return!!N&&be(k,N.incarnation)&&N.current()}}:void 0),L.current+=1,S.current=n,m(n),C(!0),y(r,!0)},ne=async()=>{h.current&&(clearTimeout(h.current),h.current=null);const v=S.current,k=L.current,P=++A.current,N=await I.current(v);if(N.status!=="changed"&&N.status!=="no_op"||L.current!==k||A.current!==P||N.confirmed.content!==v)return;const Q=N.confirmed;Q.content===S.current&&w.setQueryData(E(d,e.sourcePath),q=>q&&{...q,content:Q.content,hash:Q.hash}),C(!1),y(r,!1)},re=()=>{w.invalidateQueries({queryKey:E(d,e.sourcePath)})};a.useEffect(()=>{var v;s||(h.current&&clearTimeout(h.current),h.current=null,(v=z.current)==null||v.cancel(),z.current=null)},[s]),a.useEffect(()=>{const v=V.current;return()=>{var N;h.current&&(clearTimeout(h.current),h.current=null);const k=(N=z.current)==null?void 0:N.flush(),P=S.current;v==null||v.settleRetirement(Promise.resolve(k).then(()=>U.current(P))),z.current=null,y(r,!1),Y.current(!1)}},[r,y,V]);const G=async()=>{if(s||!u.current||i.editBlocked)return;const v=L.current,k=await i.inspectCurrent();k.status!=="observed"||!u.current||j.current||L.current!==v||!l.recovery.current()||w.setQueryData(E(d,e.sourcePath),P=>P&&{...P,...k.value})},ae=()=>{const v=l.adoptDisk();v!=null&&m(v)},ie=()=>{l.overwrite(S.current)},J=l.status==="saved"?l.confirmedContent!==R?"Unsaved changes":l.documentReceipt?"Save recorded":"Saved to file":Oe(l.status),W=s?R:n;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsx(De,{recovery:i,editing:s,loadCurrent:()=>void G(),toolbar:t.jsxs(t.Fragment,{children:[_&&J&&t.jsx("span",{className:O("mr-1 text-xs",l.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:J}),!s&&p==="pending"&&t.jsx("span",{role:"status",children:"Checking document…"}),!s&&t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:re,"aria-label":"Refresh from disk",children:t.jsx(Te,{className:"size-4"})}),_&&t.jsx(Le,{editing:s,off:!s&&(p==="pending"||i.editBlocked),observation:p,onClick:s?()=>void ne():se}),t.jsx(Se,{recovery:i,editing:s,loadCurrent:()=>void G()})]})}),l.status==="uncertain"&&t.jsxs("div",{role:"status",className:"mx-2 mt-2 flex items-center gap-2 text-sm",children:[t.jsx("span",{children:"Save not confirmed. Retry the original save before saving another draft."}),t.jsx(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>void l.retryUnconfirmed(),children:"Retry original save"})]}),l.status==="conflict"&&t.jsxs("div",{className:"bg-destructive/10 text-destructive mx-2 mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-3 py-2 text-sm",children:[t.jsx("span",{className:"flex-1",children:"This file changed on disk since you opened it."}),t.jsx(D,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:ae,children:"Reload"}),t.jsx(D,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:ie,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(a.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:f?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(Be,{value:W,editable:s,onChange:s?$:void 0,wikiLinks:c})}):t.jsx(ze,{value:W,editable:s,filename:e.sourcePath,languageHint:e.language,theme:o,onChange:s?$:void 0})})})]})}function Ae(e){const{fileSaveBinding:r,fileSaveObservation:d}=Re(e.documentId);return t.jsx(te,{...e,observedBinding:r,recoveryBinding:r,fileSaveObservation:d})}function Ie(e){switch(e==null?void 0:e.code){case"NOT_FOUND":return"This file doesn’t exist.";case"NOT_A_FILE":return"This path is a directory, not a file.";case"TOO_LARGE":return"This file is too large to open here.";case"BINARY_FILE":return"This file isn’t text, so the editor can’t show it.";default:return"This file couldn’t be loaded."}}function at({content:e,documentId:r}){const d=ye(),n=B(g=>g.selectedCwd),o=B(g=>g.setDocumentEditing),s=B(g=>{var l;return((l=g.openDocuments.find(i=>i.id===r))==null?void 0:l.editing)??!1}),C=je(),y=B(g=>g.canvasSessionId),b=B(g=>g.roomCanvasLiveRoomId),{data:p,error:x,isLoading:_}=Ce({queryKey:E(n,e.sourcePath),enabled:n!==null,queryFn:()=>d.readFileContent(n,e.sourcePath),staleTime:3e4,retry:!1}),[f,w]=a.useState(null),R=g=>{w(g&&p?{pinnedHash:p.hash}:null)};if(n===null)return t.jsx(H,{children:"Open a chat to view files."});if(_)return t.jsx(H,{children:"Loading file…"});if(x||!p)return t.jsx(H,{children:Ie(x)});const m=f!==null&&s,T=(m?f==null?void 0:f.pinnedHash:null)??p.hash,F=y&&!b?Ae:te;return t.jsx(F,{content:e,documentId:r,cwd:n,loaded:p.content,theme:C,isEditing:m,onEditingChange:R,setDocumentEditing:o},`${e.sourcePath}:${T}`)}function H({children:e}){return t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:e})})}export{at as CanvasFileContent};
|
package/dist/client/assets/{CanvasModel3dContent-fnWc0B7B.js → CanvasModel3dContent-DEassnBV.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-
|
|
2
|
-
import{a1 as m,aY as n,r as s,j as t,aZ as p}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-KHktOpbD.js","assets/index-CjUfPyOM.js","assets/index-D2ZFfqZZ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a1 as m,aY as n,r as s,j as t,aZ as p}from"./index-CjUfPyOM.js";import{r as u}from"./use-session-canvas-u63m2mYH.js";import"./rotate-cw-scTEKxeZ.js";import"./query-keys-DeYqUDia.js";import"./index.esm-Bb3LMu5X.js";import"./WidgetErrorCard-I8WiJv2g.js";import"./index-D0yajRDv.js";import"./card-DI7YtQh3.js";import"./progress-eQl1UvNz.js";import"./markdown-content-ysBIqFAg.js";import"./table-B0LsKsEv.js";import"./package-CD8xq7hk.js";import"./heart-BrjEmIsl.js";import"./git-branch-ClXAt1_G.js";import"./file-text-DTvj1wzM.js";import"./file-bSD5jgk_.js";import"./McpAppFrame-BotrzoHd.js";import"./more-details-DHCpYDi7.js";const d=s.lazy(()=>p(()=>import("./Model3dViewer-KHktOpbD.js"),__vite__mapDeps([0,1,2])).then(e=>({default:e.Model3dViewer})));function f(e){var o;const r=(o=e.split(".").pop())==null?void 0:o.toLowerCase();return r==="glb"||r==="gltf"?"gltf":r==="stl"?"stl":r==="obj"?"obj":r==="3mf"?"3mf":r==="ply"?"ply":r==="fbx"?"fbx":r==="dae"?"dae":null}function A({content:e}){const r=m(),o=n(i=>i.selectedCwd),l=s.useMemo(()=>u(e.src,i=>r.mediaUrl(o??"",i)),[e.src,r,o]),a=s.useMemo(()=>f(e.src),[e.src]);return l.url===null||a===null?t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:"This 3D model can’t be displayed here."})}):t.jsx("div",{className:"bg-muted/40 h-full w-full",children:t.jsx(s.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading 3D viewer…"}),children:t.jsx(d,{url:l.url,format:a,label:e.title??"Canvas 3D model"})})})}export{A as CanvasModel3dContent,f as formatOf};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{W as F,r as i,j as l,B as ue,hv as yt,mD as bt,g as vt,jS as kt,G as ne,a1 as fe,a3 as De,a4 as Pe,aP as H,c8 as Fe,c9 as wt,cO as Nt,mE as It,kx as Rt,mF as Ct,h as At,aA as Mt,cf as Le,gk as se,q as Z,a7 as Be,s as pe,ml as jt,mG as St,mn as Ot,mH as _t,dX as Et,fW as Tt,mB as $t,mI as Dt,mJ as Pt,a0 as Ft,bx as Lt,mK as Bt,mL as Ut,ji as Ht,ib as Kt,h0 as Wt,lt as Ne,mM as Ue,bL as qt,ls as X,lw as He,mN as zt,c7 as ge,ai as Vt,bP as he,i6 as Ke,mO as Gt,cj as We,mP as Jt,eU as Yt,k7 as qe,mQ as ze,aZ as Xt,gZ as Ve,lv as Qt,mR as Ge,mS as Zt,mT as en,mU as tn,mV as Ie,eN as nn,mW as sn,mX as on,mY as an,mZ as rn,m_ as cn,m$ as ln,l as dn,hI as un,ar as Je,lk as mn,aj as fn,n0 as pn,n1 as gn,n2 as hn,b8 as xn,bX as yn,n3 as bn,n4 as vn,n5 as kn,n6 as wn,by as Re,ea as Nn}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BMCDckcY.js","assets/index-CjUfPyOM.js","assets/index-D2ZFfqZZ.css","assets/room-files-source-DXKpm43a.js","assets/markdown-content-ysBIqFAg.js","assets/file-exclamation-point-BcCIL-rE.js","assets/query-keys-DeYqUDia.js","assets/composer-insert-BpyATrmR.js","assets/index-6yT0Qr0s.js","assets/file-drag-GDx2qhdk.js","assets/rotate-cw-scTEKxeZ.js","assets/link-2-xieOmwOK.js","assets/file-bSD5jgk_.js","assets/git-branch-ClXAt1_G.js","assets/more-details-DHCpYDi7.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{W as F,r as i,j as l,B as ue,hv as yt,mD as bt,g as vt,jS as kt,G as ne,a1 as fe,a3 as De,a4 as Pe,aP as H,c8 as Fe,c9 as wt,cO as Nt,mE as It,kx as Rt,mF as Ct,h as At,aA as Mt,cf as Le,gk as se,q as Z,a7 as Be,s as pe,ml as jt,mG as St,mn as Ot,mH as _t,dX as Et,fW as Tt,mB as $t,mI as Dt,mJ as Pt,a0 as Ft,bx as Lt,mK as Bt,mL as Ut,ji as Ht,ib as Kt,h0 as Wt,lt as Ne,mM as Ue,bL as qt,ls as X,lw as He,mN as zt,c7 as ge,ai as Vt,bP as he,i6 as Ke,mO as Gt,cj as We,mP as Jt,eU as Yt,k7 as qe,mQ as ze,aZ as Xt,gZ as Ve,lv as Qt,mR as Ge,mS as Zt,mT as en,mU as tn,mV as Ie,eN as nn,mW as sn,mX as on,mY as an,mZ as rn,m_ as cn,m$ as ln,l as dn,hI as un,ar as Je,lk as mn,aj as fn,n0 as pn,n1 as gn,n2 as hn,b8 as xn,bX as yn,n3 as bn,n4 as vn,n5 as kn,n6 as wn,by as Re,ea as Nn}from"./index-CjUfPyOM.js";import{g as Ce,m as Ae,h as xe,f as Ye,M as In,a as Rn,E as Cn,i as An,j as Mn,b as P,c as jn,k as Sn,u as On,C as _n}from"./index-Dj4I8KcL.js";import{R as En,A as Xe}from"./repeat-wB31CP7I.js";import{u as Tn}from"./use-room-sessions-W62Zl72O.js";import"./WidgetErrorCard-I8WiJv2g.js";import{M as $n}from"./markdown-content-ysBIqFAg.js";import{W as Dn,a as Pn}from"./find-latest-widget-fence-D01ENK2h.js";import{f as Fn}from"./format-duration-BCr6uzby.js";import{H as Ln,a as Bn,b as Un}from"./RuntimeSetupDialog-Er-lzjmK.js";import{M as Me}from"./mention-pill-Daeu1X92.js";import{R as Hn}from"./rotate-ccw-clock-LSKKAcnR.js";import{U as Kn}from"./unplug-DLA7Ib_s.js";import{M as Wn}from"./message-square-off-D9hm8WNH.js";import{i as qn}from"./registry-BSucT23N.js";/**
|
|
3
3
|
* @license lucide-react v1.48.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
@@ -40,5 +40,5 @@ import{W as F,r as i,j as l,B as ue,hv as yt,mD as bt,g as vt,jS as kt,G as ne,a
|
|
|
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
42
|
*/const at={name:"user-x",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]};at.node;const Qn=F(at),Zn='[data-slot="identity-hover-card-actions"] button:not(:disabled)';function es(e){const{open:n,setOpen:s,triggerRef:t,enabled:o}=e,a=i.useRef(null),r=i.useRef(!1);i.useEffect(()=>{if(!n||!r.current)return;r.current=!1;let u=0,x=0;const v=()=>{var m;const f=(m=a.current)==null?void 0:m.querySelector(Zn);if(f)return f.focus();++u<10&&(x=requestAnimationFrame(v))};return v(),()=>cancelAnimationFrame(x)},[n]);const c=i.useCallback(u=>{var x;!u&&((x=a.current)!=null&&x.contains(document.activeElement))||s(u)},[s]),d=i.useCallback(u=>{!o||u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),r.current=!0,s(!0))},[o,s]),g=i.useMemo(()=>({onEscapeKeyDown:()=>{var u;return(u=t.current)==null?void 0:u.focus()},onBlur:u=>{var v,f,m;const x=u.relatedTarget;x&&((v=a.current)!=null&&v.contains(x)||(f=t.current)!=null&&f.contains(x))||(m=a.current)!=null&&m.contains(document.activeElement)||s(!1)}}),[s,t]);return{contentRef:a,handleOpenChange:c,onTriggerKeyDown:d,contentHandlers:g}}function ce(e){const n=e.key==="ArrowRight"||e.key==="ArrowDown",s=e.key==="ArrowLeft"||e.key==="ArrowUp",t=e.key==="Tab";if(!n&&!s&&!t)return;const o=e.currentTarget.closest('[data-slot="identity-hover-card-actions"]');if(!o)return;const a=Array.from(o.querySelectorAll("button:not(:disabled)")),r=a.indexOf(document.activeElement);if(r===-1||a.length===0)return;e.preventDefault();const c=s||t&&e.shiftKey?-1:1;a[(r+c+a.length)%a.length].focus()}function ts({kind:e,about:n}){const t=[e==="agent"?"Agent":e==="human"?"Person":null,n.role].filter(Boolean).join(" · ");return!t&&!n.status?null:l.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5 px-3 pb-3","data-slot":"identity-hover-card-about",children:[t&&l.jsx("p",{className:"text-muted-foreground truncate text-xs",title:t,children:t}),n.status&&l.jsx("p",{className:"text-foreground/80 truncate text-xs","data-slot":"identity-hover-card-status",children:n.status})]})}function ns({actions:e,onAct:n}){const s=t=>()=>{n(),t()};return l.jsxs("div",{className:"border-border mt-auto flex flex-col gap-2 border-t p-3","data-slot":"identity-hover-card-actions",role:"group","aria-label":"Actions",children:[l.jsxs("div",{className:"flex gap-2",children:[e.onMessage&&l.jsx(ue,{size:"xs",className:"flex-1",onClick:s(e.onMessage),onKeyDown:ce,children:"Message"}),e.onViewProfile&&l.jsx(ue,{size:"xs",variant:"outline",className:"flex-1",onClick:s(e.onViewProfile),onKeyDown:ce,children:"Profile"})]}),e.session&&l.jsxs("button",{type:"button","data-slot":"identity-hover-card-session",onClick:s(e.session.onOpen),onKeyDown:ce,className:"text-muted-foreground hover:text-foreground focus-visible:ring-ring flex min-w-0 items-center gap-1.5 rounded-sm text-left text-xs transition-colors focus-visible:ring-2 focus-visible:outline-none",children:[l.jsx(yt,{className:"size-3.5 shrink-0","aria-hidden":!0}),l.jsx("span",{className:"truncate",children:e.session.label})]})]})}const ss=300;function G({className:e,children:n}){return l.jsx("span",{className:ne("bg-muted text-muted-foreground text-2xs inline-flex max-w-full items-center gap-1 truncate rounded-full px-2 py-0.5",e),children:n})}function ye({identity:e,children:n,onViewProfile:s,about:t,actions:o,onOpenChange:a,openOnClick:r=!1,className:c}){const{kind:d,displayName:g,handle:u,color:x,emoji:v,imageUrl:f,origin:m,agent:p}=e,h=x??"hsl(var(--muted-foreground))",w=typeof m=="object"&&m!==null,y=d==="agent"&&(p==null?void 0:p.working)!=null?p.working:null,[I,S]=i.useState(!1),C=i.useCallback(k=>{S(k),a==null||a(k)},[a]),A=i.useRef(!1),N=i.useRef(null),M=bt({onLongPress:()=>{A.current&&C(!0)}}),{contentRef:j,handleOpenChange:b,onTriggerKeyDown:O,contentHandlers:_}=es({open:I,setOpen:C,triggerRef:N,enabled:r&&o!==void 0});return l.jsxs(Ln,{open:I,onOpenChange:b,openDelay:ss,children:[l.jsx(Bn,{asChild:!0,ref:N,"data-gesture-priority":"",...M,onPointerDown:k=>{A.current=k.pointerType==="touch"||k.pointerType==="pen",M.onPointerDown(k)},...r?{onClick:()=>C(!0),onKeyDown:O}:{},children:n}),l.jsxs(Un,{ref:j,..._,...o?{role:"dialog","aria-label":g}:{},"data-slot":"identity-hover-card",align:"start",className:ne("flex w-64 flex-col gap-0 overflow-hidden p-0",c),children:[l.jsxs("div",{className:"flex items-center gap-3 p-3",children:[l.jsx(vt,{"aria-hidden":!0,color:h,emoji:v,imageUrl:f,fallback:kt(g),kind:d,origin:m,status:y?"working":"idle",size:"md"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-foreground truncate text-sm font-semibold",children:g}),u&&l.jsxs("p",{className:"text-muted-foreground truncate text-xs font-medium",children:["@",u]})]})]}),t&&l.jsx(ts,{kind:d,about:t}),l.jsxs("div",{className:"flex flex-wrap gap-1.5 px-3 pb-3 empty:hidden",children:[d==="agent"&&((p==null?void 0:p.runtime)||(p==null?void 0:p.model))&&l.jsx(G,{children:[p.runtime,p.model].filter(Boolean).join(" · ")}),y&&l.jsxs(G,{className:"bg-status-success-bg text-status-success-fg",children:["Working · ",Fn(y.forMs)]}),d==="human"&&l.jsx(G,{children:w?m.platform:"On this machine"}),d==="agent"&&(p==null?void 0:p.managedBy)&&l.jsxs(G,{children:["Managed by"," ",p.managedBy.handle?`@${p.managedBy.handle}`:p.managedBy.displayName]})]}),o?l.jsx(ns,{actions:o,onAct:()=>{var k;(k=N.current)==null||k.focus(),C(!1)}}):s?l.jsx("button",{type:"button","data-slot":"identity-hover-card-profile",onClick:()=>{var k;(k=N.current)==null||k.focus(),s()},className:"border-border hover:bg-accent focus-visible:ring-ring text-brand-text mt-auto flex w-full items-center border-t px-3 py-2 text-left text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none",children:"View profile"}):l.jsxs("div",{className:"border-border mt-auto flex items-center justify-between border-t px-3 py-2",children:[l.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:"View profile"}),l.jsx("span",{className:"text-muted-foreground text-3xs tracking-wide uppercase",children:"soon"})]})]})]})}function os(){const e=fe(),n=De();return Pe({onMutate:({roomId:s,entryId:t,emoji:o,viewerAuthorId:a})=>{var u;const r=n.getQueryData(H.entries(s)),c=(u=r==null?void 0:r.find(x=>x.id===t))==null?void 0:u.reactions,{reactions:d,on:g}=Ce(c,o,a);return n.setQueryData(H.entries(s),x=>Ae(x,t,d)),{on:g}},mutationFn:({roomId:s,entryId:t,emoji:o,viewerAuthorId:a})=>{var d,g;const r=n.getQueryData(H.entries(s)),c=((g=(d=r==null?void 0:r.find(u=>u.id===t))==null?void 0:d.reactions)==null?void 0:g.some(u=>u.emoji===o&&u.authorIds.includes(a)))??!1;return e.toggleReaction(s,t,{emoji:o,on:c})},onError:(s,{roomId:t,entryId:o,emoji:a,viewerAuthorId:r},c)=>{c!==void 0&&n.setQueryData(H.entries(t),d=>{var x;const g=(x=d==null?void 0:d.find(v=>v.id===o))==null?void 0:x.reactions,{reactions:u}=Ce(g,a,r,!c.on);return Ae(d,o,u)})},onSuccess:({frequents:s},{roomId:t})=>{n.setQueryData(H.detail(t),o=>o&&{...o,reactionFrequents:s})},meta:{errorLabel:"Couldn’t add your reaction",errorToastId:"room-reaction"}})}function W(e){return e.threadRootEntryId??e.parentEntryId}function as(e){return W(e)??e.id}function rs(e,n){return Math.max(n??0,e)}function Wo(e,n,s){let t=e[0],o=0;for(const a of e)a.seq>t.seq&&(t=a),n!==null&&a.seq>n&&(o+=1);return{count:rs(e.length,s),lastAt:t.createdAt,unread:o}}function is(e){var C,A;const{agentPath:n,displayName:s,onViewProfile:t,engaged:o}=e,a=Fe(),r=wt(),c=a&&o&&n!==void 0,d=Nt(c?n:null),g=It(d.member),u=Rt(),x=Ct(),v=At(),f=Mt(),{data:m}=Le({enabled:c&&r}),p=f.status==="ready"?f.roomId:null,h=m==null?void 0:m.find(N=>N.id===p),w=h?se(h):null,y=(A=(C=d.member)==null?void 0:C.agent)==null?void 0:A.effectiveRuntimeId,I=i.useCallback(()=>{n!==void 0&&(Z.getState().recordOpened("agent",n),u({agentPath:n},y?{runtime:y}:{}))},[n,u,y]),S=i.useCallback(async()=>{if(n===void 0||!v)return;const N=await x(n);if(N===null){Be(`${s} has no session in ${w??"this room"} yet`);return}v(pe({session:N}))},[n,v,x,s,w]);return i.useMemo(()=>!a||n===void 0?null:{about:{role:d.role,status:g},actions:{onMessage:I,...t?{onViewProfile:t}:{},...r&&w?{session:{label:`Session in ${w}`,onOpen:()=>void S()}}:{}}},[a,n,d.role,g,I,t,r,w,S])}function cs({identity:e,agentPath:n,onViewProfile:s,openOnClick:t=!1,children:o}){const[a,r]=i.useState(!1),c=is({agentPath:n,displayName:e.displayName,onViewProfile:s,engaged:a}),d=i.useCallback(g=>{g&&r(!0)},[]);return l.jsx(ye,{identity:e,onViewProfile:s,onOpenChange:d,openOnClick:t&&c!==null,...c?{about:c.about,actions:c.actions}:{},children:o})}function ls(e){return l.jsx(Pn,{code:e.code,isIncomplete:e.isIncomplete})}const ds=[{language:Dn,component:ls}],us={turn_failed:{Icon:Ft,tone:"text-status-warning"},agent_busy:{Icon:Pt},agent_gone:{Icon:Qn,tone:"text-status-warning"},agent_left:{Icon:je,tone:"text-status-warning"},room_archived:{Icon:Dt},agent_reseated:{Icon:$t},handle_changed:{Icon:Xe},runtime_gone:{Icon:Jn,tone:"text-status-warning"},agent_paused:{Icon:Tt},agent_declined:{Icon:Wn},agent_unavailable:{Icon:Et},awaiting_approval:{Icon:zn,tone:"text-status-warning"},halted:{Icon:_t},budget_reached:{Icon:Ot},cascade_stopped:{Icon:St},addressing_changed:{Icon:Gn},bridge_blocked:{Icon:Kn,tone:"text-status-warning"},bridge_undelivered:{Icon:jt,tone:"text-status-warning"},bridge_rate_limited:{Icon:Xn},bridge_second_agent_refused:{Icon:je},bridge_disconnected:{Icon:Vn},bridge_agent_swapped:{Icon:En},bridge_history_note:{Icon:Hn}},ms={Icon:Lt},le=80;function fs(e){const n=e.trim();if(n.length<=le)return n;const s=n.slice(0,le),t=s.lastIndexOf(" ");return`${(t>le/2?s.slice(0,t):s).trimEnd()}…`}function ps(e,n,s){const t=gs(e,s),o=a=>l.jsx("a",{href:n.href,onClick:n.onOpen,"data-testid":"room-notice-session-link",className:"focus-ring hover:text-foreground rounded py-2 font-medium underline underline-offset-2",children:a});return t===null?l.jsxs(l.Fragment,{children:[e," ",o("Open chat")]}):l.jsxs(l.Fragment,{children:[e.slice(0,t.index),o(t.words),e.slice(t.index+t.words.length)]})}function gs(e,n){if(n!==void 0){const t=Bt(n),o=e.lastIndexOf(t);if(o!==-1)return{index:o,words:t}}const s=Ut.exec(e);return s===null?null:{index:s.index,words:s[0]}}function hs({entry:e,feedPosition:n,rowId:s,sessionLink:t,subjectName:o}){const{Icon:a,tone:r}=(e.body.notice&&us[e.body.notice])??ms;return l.jsxs("p",{id:s,"data-slot":"notice-row","data-testid":"room-notice","data-notice":e.body.notice??"unknown",...n&&{role:"article","aria-label":fs(e.body.text)},...xe(n),className:ne("focus-visible:ring-ring flex items-start gap-2 px-[var(--msg-padding-x)] py-2 text-xs outline-none focus-visible:ring-2",r??"text-muted-foreground"),children:[l.jsx(a,{"aria-hidden":!0,className:"mt-px size-3.5 shrink-0"}),l.jsx("span",{children:t?ps(e.body.text,t,o):e.body.text})]})}const xs=qn.moment;function ys({entry:e,moment:n,subject:s,subjectIdentity:t,feedPosition:o,rowId:a}){const r=Ye(e.createdAt);return l.jsx("div",{id:a,"data-slot":"moment-row","data-testid":"room-moment","data-moment":n.kind,role:"article","aria-label":`Moment: ${e.body.text}`,...xe(o),className:"focus-visible:ring-ring px-[var(--msg-padding-x)] py-1 outline-none focus-visible:ring-2",children:l.jsxs("div",{className:"border-border/60 bg-muted/40 flex items-center gap-2.5 rounded-lg border px-3 py-2",children:[l.jsx(ye,{identity:{kind:s.kind,displayName:s.displayName,handle:t==null?void 0:t.handle,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl,origin:t==null?void 0:t.origin,agent:t==null?void 0:t.agent},children:l.jsxs("span",{"data-testid":"room-moment-identity",className:"flex shrink-0 items-center",children:[l.jsx(In,{author:s}),l.jsx("span",{className:"sr-only",children:s.displayName})]})}),l.jsx(xs,{"data-testid":"room-moment-mark","aria-hidden":!0,className:"text-muted-foreground size-3.5 shrink-0"}),l.jsx("p",{className:"min-w-0 flex-1 text-sm",children:e.body.text}),r.length>0&&l.jsx("time",{dateTime:e.createdAt,title:Rn(e.createdAt),className:"text-msg-timestamp shrink-0 text-xs",children:r})]})})}function bs(e,n){const s=X.getState(),t=s.drafts[e]??"",o=t===""||t.endsWith(" ")||t.endsWith(`
|
|
43
|
-
`)?"":" ";s.set(e,`${t}${o}@${n} `)}function vs({roomId:e,entry:n,author:s,viewerAuthorId:t,onViewProfile:o}){const a=as(n),r=n.body.text,c=(s==null?void 0:s.id)===t?void 0:(s==null?void 0:s.handle)??void 0,d=s==null?void 0:s.displayName,{copy:g}=Ht({toastOnSettle:!0});return i.useMemo(()=>{const u={reply:{id:"reply",label:"Reply in thread",icon:Yn,run:()=>{Wt.getState().openThread(e,a,!0),Ne.getState().requestFocus(Ue(e,a))}},copy:{id:"copy",label:"Copy text",icon:Kt,run:()=>void g(r)}};return o!==void 0&&(u.profile={id:"profile",label:"View profile",icon:qt,run:o}),c!==void 0&&(u.mention={id:"mention",label:d===void 0?"Mention author":`Mention ${d}`,icon:Xe,run:()=>{bs(e,c),Ne.getState().requestFocus(e)}}),Cn.map(x=>u[x]).filter(x=>x!==void 0)},[e,a,r,c,d,o,g])}function ks(e){if(e.kind==="notice")return{kind:"notice"};const n=e.body.moment;return n?{kind:"moment",moment:n}:{kind:"message"}}function qo(e,n=[]){return new Map([...n.map(s=>[s.author.id,{...s.author,origin:s.origin}]),...e.map(s=>[s.author.id,{...s.author,origin:s.origin}])])}function zo(e,n){const s=e.body.subjectAuthorId;return s===void 0||n.has(e.authorId)?e.authorId:s}function ws(e,n,s){const t=n.get(e),o=He({record:{kind:(t==null?void 0:t.kind)??"system",id:e,displayName:(t==null?void 0:t.displayName)??"Unknown",emoji:t==null?void 0:t.emoji,color:t==null?void 0:t.color,imageUrl:t==null?void 0:t.imageUrl},override:(t==null?void 0:t.agentRef)===void 0?null:s==null?void 0:s.get(t.agentRef)});return{kind:o.kind,id:e,displayName:(t==null?void 0:t.displayName)??"Unknown",emoji:o.emoji,imageUrl:o.imageUrl,color:o.color,isExternal:typeof(t==null?void 0:t.origin)=="object"&&(t==null?void 0:t.origin)!==null,...(t==null?void 0:t.retired)===!0?{retired:!0}:{}}}function Vo(e){const n=new Set;for(const a of e)W(a)===null&&n.add(a.id);const s=[],t=new Map,o=new Set;for(const a of e){const r=W(a);if(r===null){s.push(a);continue}if(!n.has(r)){s.push(a),o.add(a.id);continue}const c=t.get(r);c?c.push(a):t.set(r,[a])}return{topLevel:s,repliesByRoot:t,orphaned:o}}function Ns(e){return`thread-${e}`}function Is(e){return`thread-row-${e}`}function Go(e){return`thread-panel-entry-${e}`}function Rs(e){return`room-entry-${e}`}function Cs(e,n){const s=e.find(c=>c.id===n);if(s===void 0)return null;const t=W(s)??null,o={rowId:n,domId:Rs(n)};if(t===null)return o;const a=e.find(c=>c.id===t);return a!==void 0&&(W(a)??null)===null?{rowId:Ns(t),domId:Is(t)}:o}function Jo(e,n){if(n===null)return null;const s=e.find(t=>t.seq===n);return s===void 0?null:Cs(e,s.id)}const Se=48;function Yo(e,n,s){const t=e.body.answersEntryId;if(t===void 0||t===e.id||n!==void 0&&n.id===t)return null;const o=s(t);if(o===void 0)return null;const a=o.body.text.replace(/\s+/gu," ").trim();return a.length===0?null:{entryId:t,excerpt:a.length>Se?`${a.slice(0,Se).trimEnd()}…`:a}}function As(e,n){const s=new Map;for(const t of e){const o=n[t.projectPath];if(!o)continue;const a=zt({runtime:o.runtime,model:o.model});s.set(ge(t.projectPath),{memberId:t.id,visual:Vt(o),runtime:a.label,...a.modelLabel!==null&&{model:a.modelLabel}})}return s}function Ms(e){const n=new Map;for(const[s,t]of e)n.set(s,t.visual);return n}const js={info:new Map,faces:new Map},be=i.createContext(js);function Xo({known:e,children:n}){return l.jsx(be.Provider,{value:e,children:n})}function Qo(){const e=he(),n=i.useMemo(()=>{var r;return((r=e.data)==null?void 0:r.agents)??[]},[e.data]),s=i.useMemo(()=>n.map(r=>r.projectPath),[n]),t=Ke(s),o=i.useMemo(()=>As(n,t.data??{}),[n,t.data]),a=i.useMemo(()=>Ms(o),[o]);return i.useMemo(()=>({info:o,faces:a}),[o,a])}function ee(e){const n=i.useContext(be);return e===void 0?void 0:n.info.get(e)}function Ss(){return i.useContext(be).faces}function Os({showAuthorHeader:e,headerId:n,displayName:s,time:t,summary:o,contentId:a,summaryId:r,feedPosition:c}){return{...e?{"aria-labelledby":n}:{"aria-label":t.length>0?`${s}, ${t}`:s},"aria-describedby":o===null?a:r,...xe(c)}}const Q=120,_s="code block";function Es(e){if(e.length<=Q&&!e.includes("```"))return null;const n=Ts(e);return n.length===0?null:n}function Ts(e){const n=e.replace(/```[\s\S]*?(?:```|$)/g,` ${_s} `).replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+)/gm,"").replace(/^\s{0,3}\|?[\s:|-]*\|[\s:|-]*$/gm," ").replace(/\|/g," ").replace(/[*_~]{1,3}/g,"").replace(/\s+/g," ").trim();if(n.length<=Q)return n;const s=$s(n,Q),t=s.lastIndexOf(" ");return`${(t>Q/2?s.slice(0,t):s).trimEnd()}…`}function $s(e,n){if(typeof Intl.Segmenter=="function"){const t=new Intl.Segmenter(void 0,{granularity:"grapheme"});let o="";for(const{segment:a}of t.segment(e)){if(o.length+a.length>n)break;o+=a}return o}let s="";for(const t of e){if(s.length+t.length>n)break;s+=t}return s}function Ds({roomId:e,entry:n,viewerAuthorId:s,reactionFrequents:t,streamStalled:o,isMember:a=!0}){const r=os(),c=o===!0||!a,d=i.useMemo(()=>n.reactions??[],[n.reactions]),g=i.useMemo(()=>d.filter(v=>An(v,s)).map(v=>v.emoji),[d,s]),u=i.useCallback(v=>r.mutate({roomId:e,entryId:n.id,emoji:v,viewerAuthorId:s}),[r,e,n.id,s]),x=i.useMemo(()=>({quick:t,mine:g,onToggle:u,disabled:c}),[t,g,u,c]);return{reactions:d,toggle:u,quickRow:x}}function Ps({barRef:e,pillsRef:n,hasReactions:s}){return t=>{var a,r;if(t.target!==t.currentTarget)return;const{key:o}=t;if(o==="ArrowDown"&&s){t.preventDefault(),(a=n.current)==null||a.focusFirst();return}o!=="ArrowRight"&&o!=="Enter"||(t.preventDefault(),(r=e.current)==null||r.focusFirst())}}function Fs(e,n){var x,v;const s=n.body.subjectAuthorId,t=n.body.notice,o=n.kind==="notice"&&t!==void 0&&s!==void 0&&Gt.includes(t),a=Tn(e,{enabled:o}),r=We(),c=De(),d=fe(),g=o?((v=(x=a.data)==null?void 0:x.bindings.find(f=>f.authorId===s))==null?void 0:v.sessionId)??null:null,u=i.useCallback(f=>{f.button!==0||f.metaKey||f.ctrlKey||f.shiftKey||f.altKey||(f.preventDefault(),!(g===null||s===void 0)&&Jt({queryClient:c,transport:d},e,s).then(m=>{m.kind!=="none"&&r(pe({session:m.kind==="bound"?m.sessionId:g}))}))},[s,r,c,e,g,d]);return i.useMemo(()=>g===null?null:{href:Yt({session:g}),onOpen:u},[u,g])}const te="mention",ve="author_id",Ls={[te]:[ve]},Bs=[te];function Us(e,n){if(!n||n.length===0)return e;const s=Hs(e,n);if(s.length===0)return e;let t=e;for(let o=s.length-1;o>=0;o--){const{offset:a,length:r,authorId:c}=s[o],d=t.slice(0,a),g=t.slice(a,a+r),u=t.slice(a+r);t=`${d}<${te} ${ve}="${c}">${g}</${te}>${u}`}return t}function Hs(e,n){const s=[...n].sort((a,r)=>a.offset-r.offset),t=[];let o=0;for(const a of s)a.offset<o||a.offset+a.length>e.length||(t.push(a),o=a.offset+a.length);return t}const Ks=new Map,rt=i.createContext(Ks);function Ws({authors:e,children:n}){return l.jsx(rt.Provider,{value:e,children:n})}function qs(e){const n=i.useContext(rt);return e===void 0?void 0:n.get(e)}const Oe=new WeakMap;function zs(e){const n=Oe.get(e);if(n)return n;const s=new Map(e.map(t=>[ge(t.projectPath),t.projectPath]));return Oe.set(e,s),s}function Vs(e){var t;const s=(t=he().data)==null?void 0:t.agents;return i.useMemo(()=>e===void 0||!s?void 0:zs(s).get(e),[s,e])}function it(e){const{agentRef:n,identity:s,onViewProfile:t}=e,o=Fe(),a=Vs(o?n:void 0),r=ee(n);return i.useMemo(()=>{if(!o||s.kind!=="agent"||a===void 0)return null;const c={...s,agent:r&&{runtime:r.runtime,...r.model&&{model:r.model}}},d=(g,u={})=>l.jsx(cs,{identity:c,agentPath:a,onViewProfile:t,openOnClick:u.openOnClick??!1,children:g});return{wrap:d,wrapAvatar:g=>d(l.jsx("button",{type:"button",tabIndex:-1,"aria-label":s.displayName,"aria-haspopup":"dialog",className:"focus-ring inline-flex cursor-pointer rounded-sm","data-slot":"room-agent-card-face",children:g}),{openOnClick:!0}),wrapName:g=>d(l.jsx("button",{type:"button","aria-haspopup":"dialog",className:ne(g.props.className,"focus-ring cursor-pointer rounded-sm text-left underline-offset-4 hover:underline"),"data-slot":"room-agent-card-name",children:s.displayName}),{openOnClick:!0})}},[o,s,a,r,t])}const Gs={kind:"human",displayName:""};function Js(e){return typeof e=="string"?e.replace(/^@/,""):""}function Ys({authorId:e,children:n}){const s=qs(e),t=ee(s==null?void 0:s.agentRef),{open:o}=qe(),a=s?He({record:s,override:t==null?void 0:t.visual}):null,r=s?ze(s,t==null?void 0:t.memberId):void 0,c=i.useMemo(()=>r===void 0?void 0:()=>o(r),[r,o]),d=a==null?void 0:a.color,g=a==null?void 0:a.emoji,u=a==null?void 0:a.imageUrl,x=i.useMemo(()=>s?{kind:s.kind,displayName:s.displayName,handle:s.handle??void 0,color:d,emoji:g,imageUrl:u,origin:s.origin,agent:t&&{runtime:t.runtime,...t.model&&{model:t.model}}}:null,[s,d,g,u,t]),v=it({agentRef:s==null?void 0:s.agentRef,identity:x??Gs,onViewProfile:c});if(!s||!x)return l.jsx(Me,{kind:"human",label:Js(n),resolved:!1});const m=v?{role:"button",tabIndex:0,"aria-haspopup":"dialog"}:c?{role:"button",tabIndex:0,"aria-label":`View ${s.displayName}’s profile`,onClick:c,onKeyDown:h=>{h.key!=="Enter"&&h.key!==" "||(h.preventDefault(),c())}}:{},p=l.jsx(Me,{kind:s.kind,label:s.displayName,handle:s.handle??void 0,color:s.color,origin:s.origin,resolved:!0,interactive:c!==void 0,...m});return v?v.wrap(p,{openOnClick:!0}):l.jsx(ye,{onViewProfile:c,identity:x,children:p})}function Xs(e){return{mention:n=>{const s=n[ve],t=typeof s=="string"?s:void 0;return!t||!e.has(t)?l.jsx(l.Fragment,{children:n.children}):l.jsx(Ys,{authorId:t,children:n.children})}}}function Qs({entry:e,authors:n}){const s=i.useMemo(()=>Us(e.body.text,e.mentionSpans),[e.body.text,e.mentionSpans]),t=i.useMemo(()=>{var a;return new Set(((a=e.mentionSpans)==null?void 0:a.map(r=>r.authorId))??[])},[e.mentionSpans]),o=i.useMemo(()=>Xs(t),[t]);return l.jsx(Ws,{authors:n,children:l.jsx($n,{content:s,className:"msg-prose",allowedTags:Ls,literalTagContent:Bs,components:o,renderers:ds})})}function Zs(e){return function(s){return l.jsx(Qs,{entry:s,authors:e})}}const ct="the top folder";function _e(e){return e.slice(e.lastIndexOf("/")+1)}function eo(e){const n=e.lastIndexOf("/");return n===-1?"":e.slice(0,n)}function to(e){return e===""?ct:`${e}/`}function de(e){return e.target!==void 0?e.target===""?ct:e.target:to(eo(e.paths[0]??""))}function no(e,n){const s=e.paths[0]??"",t=e.target;switch(e.kind){case"edit":return`${n} edited ${t??s}`;case"add":return`${n} added ${t??s}`;case"upload":return e.pathCount===1?`${n} uploaded ${_e(s)} to ${de(e)}`:`${n} uploaded ${e.pathCount} files to ${de(e)}`;case"rename":{const o=e.from??"";return t!==void 0?`${n} renamed ${o} to ${t}`:o.endsWith("/")?`${n} renamed ${o}`:`${n} renamed ${o} to ${s}`}case"delete":return t!==void 0?`${n} deleted ${t}`:e.pathCount===1?`${n} deleted ${s}`:`${n} deleted ${e.pathCount} files`;case"from-attachment":return`${n} saved ${_e(s)} from the chat to ${de(e)}`}}const so=i.lazy(()=>Xt(()=>import("./index-BzKkoaB1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.SaveToRoomFilesButton})));function Zo({roomId:e,entry:n,author:s,authorRef:t,authors:o,viewerAuthorId:a,authorNames:r,reactionFrequents:c,streamStalled:d,isMember:g=!0,grouping:u,orphanedReply:x,answers:v,feedPosition:f,rowId:m}){const p=Ye(n.createdAt),h=i.useMemo(()=>{const L=Es(n.body.text),ie=Mn(n.attachments??[]);if(ie===null)return L;const we=L??n.body.text.trim();return we.length>0?`${we} ${ie}`:ie},[n.body.text,n.attachments]),w=i.useId(),y=`${w}-author`,I=`${w}-content`,S=`${w}-summary`,C=i.useRef(null),A=i.useRef(null),N=i.useRef(null),{reactions:M,toggle:j,quickRow:b}=Ds({roomId:e,entry:n,viewerAuthorId:a,reactionFrequents:c,streamStalled:d,isMember:g}),O=ee(t==null?void 0:t.agentRef),{open:_}=qe(),k=t===void 0?void 0:ze(t,O==null?void 0:O.memberId),D=i.useCallback(()=>{k!==void 0&&_(k)},[_,k]),T=k===void 0?void 0:D,q=vs({roomId:e,entry:n,author:t,viewerAuthorId:a,onViewProfile:T}),z=(t==null?void 0:t.handle)??void 0,B=i.useMemo(()=>({kind:s.kind,displayName:s.displayName,handle:z,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl}),[s.kind,s.displayName,z,s.color,s.emoji,s.imageUrl]),$=it({agentRef:t==null?void 0:t.agentRef,identity:B,onViewProfile:T}),R=Ps({barRef:A,pillsRef:N,hasReactions:M.length>0}),U=i.useCallback(()=>{var L;return(L=C.current)==null?void 0:L.focus()},[]),oe=i.useMemo(()=>Zs(o),[o]),pt=i.useCallback(L=>l.jsx(i.Suspense,{fallback:null,children:l.jsx(so,{roomId:e,attachment:L})}),[e]),gt=Ss(),ae=n.body.subjectAuthorId??n.authorId,E=o.get(ae),V=ee(E==null?void 0:E.agentRef),ht=Fs(e,n),re=ks(n);if(re.kind==="notice")return l.jsx(hs,{entry:n,feedPosition:f,rowId:m,sessionLink:ht,subjectName:E==null?void 0:E.displayName});if(re.kind==="moment")return l.jsx(ys,{entry:n,moment:re.moment,subject:ae===n.authorId?s:ws(ae,o,gt),subjectIdentity:{handle:(E==null?void 0:E.handle)??void 0,origin:E==null?void 0:E.origin,agent:V&&{runtime:V.runtime,...V.model&&{model:V.model}}},feedPosition:f,rowId:m});const xt=u.position==="first"||u.position==="only";return l.jsxs(P.Root,{ref:C,id:m,position:u.position,actions:q,reactions:b,"data-testid":"room-entry",tabIndex:0,...Os({showAuthorHeader:xt,headerId:y,displayName:s.displayName,time:p,summary:h,contentId:I,summaryId:S,feedPosition:f}),onKeyDown:R,children:[l.jsx(P.Gutter,{author:s,at:n.createdAt,onViewProfile:$?void 0:T,isSelf:n.authorId===a,renderAvatar:$==null?void 0:$.wrapAvatar}),l.jsxs(P.Body,{children:[l.jsx(P.Author,{id:y,author:s,at:n.createdAt,origin:t==null?void 0:t.origin,renderName:$==null?void 0:$.wrapName}),x===!0&&l.jsx("p",{"data-testid":"room-entry-orphan",className:"text-muted-foreground text-xs italic",children:"Replying to an earlier message"}),v!=null&&l.jsx("p",{"data-testid":"room-entry-answers",className:"text-muted-foreground mb-1 truncate text-xs italic",children:`Answering “${v.excerpt}”`}),l.jsx(P.Content,{id:I,className:"[&_:not(pre)>code]:wrap-anywhere [&_pre]:overflow-x-auto",children:n.body.fileChange?l.jsx("p",{"data-testid":"room-entry-file-change",className:"wrap-anywhere",children:no(n.body.fileChange,(E==null?void 0:E.displayName)??"Somebody")}):oe(n,{rowId:n.id,isStreaming:!1})}),h!==null&&l.jsx("span",{id:S,className:"hidden",children:h}),l.jsx(P.Attachments,{items:n.attachments??[],renderAction:g?pt:void 0}),l.jsx(P.Reactions,{ref:N,reactions:M,viewerAuthorId:a,names:r,frequents:c,onToggle:j,disabled:d===!0||!g,onExit:U}),l.jsx(P.Actions,{actions:q,reactions:b,barRef:A,onExit:U})]})]})}const ea={reactions:!0,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!0,turnStatus:!1,asks:!0};function oo(e){const n=fe(),[s,t]=i.useState([]),o=i.useRef(new Map),a=i.useCallback(f=>{const m=f.map(p=>({id:crypto.randomUUID(),file:p,status:"pending",progress:0}));t(p=>[...p,...m])},[]),r=i.useCallback(f=>{o.current.delete(f),t(m=>m.filter(p=>p.id!==f))},[]),c=i.useCallback(f=>{if(!f){o.current.clear(),t([]);return}const m=new Set(f);for(const p of m)o.current.delete(p);t(p=>p.filter(h=>!m.has(h.id)))},[]),d=i.useCallback(f=>{o.current.delete(f),t(m=>m.map(p=>p.id===f&&p.status==="error"?{...p,status:"pending",progress:0,error:void 0}:p))},[]),g=i.useRef(null),u=Pe({meta:{suppressErrorToast:!0},mutationFn:async f=>{t(w=>w.map(y=>f.some(I=>I.id===y.id)?{...y,status:"uploading"}:y));const m=w=>{t(y=>y.map(I=>I.status==="uploading"?{...I,progress:w.percentage}:I))},p=new AbortController;g.current=p;const h=f.map(w=>w.file);return n.uploadRoomAttachments(e,h,m,p.signal)},onSettled:()=>{g.current=null},onSuccess:(f,m)=>{m.forEach((p,h)=>{const w=f[h];w&&o.current.set(p.id,w.id)}),t(p=>p.map(h=>m.findIndex(y=>y.id===h.id)===-1?h:{...h,status:"uploaded",progress:100}))},onError:f=>{t(m=>m.map(p=>p.status==="uploading"?{...p,status:"error",error:f.message}:p))}}),x=i.useCallback(()=>{var f;(f=g.current)==null||f.abort()},[]),v=i.useCallback(async()=>{const f=s.filter(p=>p.status==="error");if(f.length>0)throw new Error(f.length===1?`${f[0].file.name} didn’t upload. Try again or remove it.`:`${f.length} files didn’t upload. Try again or remove them.`);const m=s.filter(p=>p.status==="pending");return m.length>0&&await u.mutateAsync(m),s.map(p=>o.current.get(p.id)).filter(p=>p!==void 0)},[s,u]);return{pendingFiles:s,addFiles:a,removeFile:r,retryFile:d,clearFiles:c,cancelUpload:x,uploadAndGetIds:v,hasPendingFiles:s.length>0,hasFailedUpload:s.some(f=>f.status==="error"),isUploading:u.isPending}}function ta(e){const{room:n,threadRootId:s}=e,t=jn(),o=Sn(),a=oo((n==null?void 0:n.id)??""),r=n!==void 0&&Ve(n.members,n.viewerAuthorId),c=i.useRef({attachments:a,post:t,reply:o,room:n,threadRootId:s});i.useEffect(()=>{c.current={attachments:a,post:t,reply:o,room:n,threadRootId:s}});const d=i.useCallback(y=>c.current.attachments.addFiles(y),[]),g=i.useCallback(y=>c.current.attachments.removeFile(y),[]),u=i.useCallback(y=>c.current.attachments.retryFile(y),[]),x=i.useCallback(()=>c.current.attachments.cancelUpload(),[]),{pendingFiles:v,hasFailedUpload:f,isUploading:m}=a,p=i.useMemo(()=>({staged:v,add:d,remove:g,retry:u,cancel:x,hasFailed:f,isUploading:m,holdsSendWhileUploading:!1}),[v,f,m,d,g,u,x]),h=i.useCallback(async y=>{const{attachments:I,post:S,reply:C,room:A,threadRootId:N}=c.current;if(A===void 0)throw new Error("That room isn’t loaded yet.");if(A.archived)throw new Error("This room is archived.");Z.getState().recordOpened("room",A.id);const M=Qt(),j=I.pendingFiles.map(k=>k.file.name),b=I.pendingFiles.map(k=>k.id),O=await I.uploadAndGetIds();I.clearFiles(b);const _=y.parentEntryId??N;if(_!==void 0){C.mutate({roomId:A.id,rootEntryId:_,text:y.text,clientId:M,attachmentIds:O,attachmentNames:j});return}S.mutate({roomId:A.id,text:y.text,clientId:M,attachmentIds:O,attachmentNames:j})},[]);return{target:i.useMemo(()=>({kind:"room",id:(n==null?void 0:n.id)??"",placeholder:n===void 0?"Message…":s===void 0?`Message ${se(n)}…`:"Reply in this thread…",canSend:n!==void 0&&!n.archived&&r,...n===void 0?{canSendReason:"Still opening this room…"}:n.archived?{canSendReason:"This room is archived. You can read it, but not add to it."}:r?{}:{canSendReason:Ge},send:h,attachments:p}),[n,s,r,p,h]),attachments:a}}const lt=8;function dt(e){if(e==null)return null;const n=e.replace(/\s+/g," ").trim();return n.length===0?null:n}function ao(e){if(tn(e)){const s=e.unreadCount??0;return s===1?"1 new message":`${s} new messages`}const n=e.working??0;return n>0?n===1?"1 agent working":`${n} agents working`:dt(e.topic)}function Ee(e){return{kind:"session",id:e.id,name:en(e.title),summary:dt(e.lastMessagePreview),lastActivityAt:e.updatedAt,session:e}}function ro(e){return{kind:e.kind==="dm"?"dm":"channel",id:e.id,name:se(e),summary:ao(e),lastActivityAt:e.lastActivityAt,room:e}}function J(e){if(e===void 0)return null;const n=Date.parse(e);return Number.isNaN(n)?null:n}function io(e){return e.kind==="session"?Ie("session",e.id):Ie("room",e.id)}function Te(e,n){const s=[J(n[io(e)]),...e.kind==="session"?[J(e.session.lastTouchedByYouAt),J(e.session.userLastMessageAt)]:[]].filter(t=>t!==null);return s.length>0?Math.max(...s):J(e.lastActivityAt)??Number.NEGATIVE_INFINITY}function co(e){return(n,s)=>Te(s,e)-Te(n,e)||s.id.localeCompare(n.id)}function lo(e){const n=new Set;return e.filter(s=>{const t=`${s.kind}:${s.id}`;return n.has(t)?!1:(n.add(t),!0)})}function uo(e,n){return!(n.has(e.id)||e.unreadCount===null||e.lastActivityAt===e.createdAt)}function mo({sessions:e,rooms:n,mutedRoomIds:s=new Set,interactions:t={},limit:o=lt}){const{yours:a,spinOffs:r,automated:c}=Zt(e),d=co(t),g=[...a.map(Ee),...n.filter(u=>uo(u,s)).map(ro)].sort(d);return{items:lo(g).slice(0,o),automated:[...r,...c].map(Ee).sort(d).slice(0,o)}}const fo=3,po=on;function go({limit:e=lt,mutedRoomIds:n,enabled:s=!0}={}){var g,u;const t=nn(Math.max(e*fo,po),{enabled:s}),o=Le({enabled:s}),a=sn(),r=(g=t.data)==null?void 0:g.sessions,c=o.data;return{...i.useMemo(()=>mo({sessions:r??[],rooms:c??[],mutedRoomIds:n,interactions:a,limit:e}),[r,c,n,a,e]),isLoading:s&&(t.isLoading||o.isLoading),warnings:((u=t.data)==null?void 0:u.warnings)??[]}}const ho=6,ut="jump-back-in-listbox";function ke(e){return`jump-back-in-item-${e}`}const xo='[role="combobox"]';function K(e){return e instanceof Element&&e.matches(xo)}function yo({value:e,yieldToPalette:n=!1,enabled:s=!0}){const t=We(),o=an(),[a,r]=i.useState(!1),[c,d]=i.useState({stamp:"",index:0}),[g,u]=i.useState(!1),[x,v]=i.useState(!1);e.length>0&&!x&&v(!0);const f=i.useRef(!1);i.useEffect(()=>{f.current=!0},[]);const{data:m}=he({enabled:s}),p=i.useMemo(()=>((m==null?void 0:m.agents)??[]).map(R=>R.projectPath),[m]),{data:h}=Ke(p,{enabled:s}),w=i.useMemo(()=>h??{},[h]),y=i.useMemo(()=>rn(p,w),[p,w]),I=i.useMemo(()=>new Map(p.map(R=>[ge(R),R])),[p]),S=i.useCallback(R=>cn({room:R,agentsByPath:w,pathByAgentRef:I}),[w,I]),C=i.useMemo(()=>ln(o.muted),[o.muted]),{items:A}=go({mutedRoomIds:C,enabled:s}),N=i.useMemo(()=>A.slice(0,ho),[A]),M=s&&a&&!g&&!x&&!n&&e.length===0&&N.length>0,j=`${M}:${N.length}`,b=c.stamp===j?c.index:0,O=i.useCallback(R=>{f.current&&K(R.target)&&(u(!1),v(!1),r(!0))},[]),_=i.useCallback(R=>{K(R.target)&&r(!0)},[]),k=i.useCallback(R=>{K(R.target)&&r(!1)},[]),D=i.useCallback(R=>{N.length!==0&&d(U=>{const oe=U.stamp===j?U.index:0;return{stamp:j,index:(oe+R+N.length)%N.length}})},[N.length,j]),T=i.useCallback(()=>D(1),[D]),q=i.useCallback(()=>D(-1),[D]),z=i.useCallback(()=>{u(!0)},[]),B=i.useCallback(R=>{if(u(!0),R.kind==="session"){R.session.cwd&&Z.getState().recordOpened("agent",R.session.cwd),t(pe({dir:R.session.cwd??void 0,session:R.session.id}));return}Z.getState().recordOpened("room",R.room.id),t({...dn.channels(),search:{id:R.room.id}})},[t]),$=i.useCallback(()=>{const R=N[b];!M||!R||B(R)},[M,N,b,B]);return{isOpen:M,hasRows:N.length>0,rows:N,agents:w,displayNames:y,visualOf:S,selectedIndex:b,activeDescendantId:M&&N[b]!==void 0?ke(b):void 0,listboxId:M?ut:void 0,handleFocus:O,handleBlur:k,handlePointerDown:_,moveDown:T,moveUp:q,selectHighlighted:$,selectRow:B,dismiss:z}}function mt({mark:e,label:n,title:s,summary:t,lastActivityAt:o,index:a,isSelected:r,now:c,onSelect:d}){const g=i.useMemo(()=>Number.isNaN(Date.parse(o))?null:xn(o),[o,c]);return l.jsxs("div",{id:ke(a),role:"option","aria-selected":r,"data-selected":r,title:s,onClick:d,className:"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-start gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[l.jsx("span",{className:"mt-px flex shrink-0 items-center",children:e}),l.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[l.jsxs("span",{className:"flex w-full items-center gap-1.5",children:[l.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm",children:n}),g!==null&&l.jsx("span",{className:"text-muted-foreground/60 text-3xs shrink-0",children:g})]}),t!==null&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs truncate",children:t})]})]})}function bo({item:e,agent:n,displayName:s,index:t,isSelected:o,now:a,onSelect:r}){const c=mn(n,e.session.cwd??s);return l.jsx(mt,{mark:l.jsx(fn,{color:c.color,emoji:c.emoji,size:"xs"}),label:e.name,title:`${s} · ${e.name}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:t,isSelected:o,now:a,onSelect:r})}function vo({item:e,visual:n,index:s,isSelected:t,now:o,onSelect:a}){return l.jsx(mt,{mark:l.jsx(gn,{room:e.room,participants:e.room.participants,visuals:hn(n)}),label:l.jsx(pn,{room:e.room}),title:e.summary===null?e.name:`${e.name} · ${e.summary}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:s,isSelected:t,now:o,onSelect:a})}function ko({rows:e,selectedIndex:n,agents:s={},displayNames:t={},visualOf:o,onSelect:a}){const r=un(6e4);return i.useEffect(()=>{var c,d;(d=(c=document.getElementById(ke(n)))==null?void 0:c.scrollIntoView)==null||d.call(c,{block:"nearest"})},[n]),l.jsx(Je.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:c=>c.preventDefault(),children:l.jsx("div",{id:ut,role:"listbox","aria-label":"Jump back in",className:"max-h-72 overflow-y-auto p-1.5",children:e.map((c,d)=>{var g;return c.kind==="session"?l.jsx(bo,{item:c,agent:c.session.cwd&&s[c.session.cwd]||null,displayName:c.session.cwd&&t[c.session.cwd]||((g=c.session.cwd)==null?void 0:g.split("/").pop())||"Agent",index:d,isSelected:d===n,now:r,onSelect:()=>a(c)},`session-${c.id}`):l.jsx(vo,{item:c,visual:o(c.room),index:d,isSelected:d===n,now:r,onSelect:()=>a(c)},`room-${c.id}`)})})})}const $e={people:"People",agents:"Agents"},wo=["people","agents"];function No(e,n){const s=[];for(const{author:t}of e){if(t.kind==="system"||t.id===n||t.retired)continue;const o=t.handle;s.push({section:t.kind==="agent"?"agents":"people",authorId:t.id,label:t.displayName,...o?{handle:o}:{},...t.emoji?{emoji:t.emoji}:{},...t.color?{color:t.color}:{},disabled:!o,...o?{}:{disabledReason:"No @name"}})}return s}function Io(e,n,s){const t=n.trim().toLowerCase(),o=e.map((a,r)=>({row:a,position:r,tier:Ro(a,t)})).filter(a=>a.tier!==null).sort((a,r)=>a.tier-r.tier||a.position-r.position);return s.flatMap(a=>o.filter(r=>r.row.section===a).map(({row:r})=>r))}function Ro(e,n){var o;if(n==="")return 0;const s=[(o=e.handle)==null?void 0:o.toLowerCase(),e.label.toLowerCase()].filter(a=>a!==void 0);let t=null;for(const a of s){const r=a===n?0:a.startsWith(n)?1:a.includes(n)?2:null;r!==null&&(t===null||r<t)&&(t=r)}return t}function Y(e,n,s){var a;const t=e.length;if(t===0)return 0;let o=(n%t+t)%t;for(let r=0;r<t;r++){if(!((a=e[o])!=null&&a.disabled))return o;o=(o+s+t)%t}return 0}function Co(e,n,s,t){const o=e.slice(0,n),a=e.slice(n+1+s.length),r=`@${t}`,c=a.startsWith(" ")?"":" ";return{value:o+r+c+a,cursorPos:o.length+r.length+1}}const Ao=/(^|\s)@([A-Za-z0-9_.-]*)$/,ft="mention-palette-listbox";function me(e){return`mention-item-${e}`}function Mo({members:e,viewerAuthorId:n,text:s,sectionOrder:t=wo}){var _;const[o,a]=i.useState(!1),[r,c]=i.useState(""),[d,g]=i.useState(-1),u=yn(s),x=i.useRef(!1),v=i.useMemo(()=>No(e,n),[e,n]),f=i.useMemo(()=>o?Io(v,r,t):[],[v,r,o,t]),[m,p]=i.useState(null),h=m!==null&&m.query===r&&m.open===o?m.index:Y(f,0,1),w=f[h],y=f.length===0||w!==void 0&&!w.disabled?h:Y(f,0,1),I=i.useCallback((k,D)=>{const T=k.slice(0,D).match(Ao);if(!T){a(!1);return}a(!0),c(T[2]),g((T.index??0)+T[1].length)},[]),S=i.useCallback(k=>{u.write(k),x.current=!1},[u]),C=i.useCallback(k=>{x.current||I(u.read(),k)},[I,u]),A=i.useCallback(()=>{p({query:r,open:o,index:Y(f,y+1,1)})},[f,y,r,o]),N=i.useCallback(()=>{p({query:r,open:o,index:Y(f,y-1,-1)})},[f,y,r,o]),M=i.useCallback(k=>k.disabled||k.handle===void 0?null:(x.current=!0,a(!1),Co(u.read(),d,r,k.handle)),[d,r,u]),j=i.useCallback(()=>{const k=f[y];return k?M(k):(a(!1),null)},[f,y,M]),b=i.useCallback(()=>{x.current=!0,a(!1)},[]),O=f.some(k=>!k.disabled);return{isOpen:o,hasSelectableRows:O,rows:f,selectedIndex:y,activeDescendantId:o&&((_=f[y])==null?void 0:_.disabled)===!1?me(y):void 0,listboxId:o?ft:void 0,noteTextChange:S,handleCursorChange:C,moveDown:A,moveUp:N,selectHighlighted:j,selectRow:M,dismiss:b}}function jo({rows:e,selectedIndex:n,onSelect:s}){const t=i.useMemo(()=>{const o=[];return e.forEach((a,r)=>{const c=o[o.length-1];c&&c.section===a.section?c.items.push({row:a,index:r}):o.push({section:a.section,items:[{row:a,index:r}]})}),o},[e]);return i.useEffect(()=>{var o;(o=document.getElementById(me(n)))==null||o.scrollIntoView({block:"nearest"})},[n]),l.jsx(Je.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:o=>o.preventDefault(),children:l.jsx("div",{id:ft,role:"listbox","aria-label":"Mentions",className:"max-h-72 overflow-y-auto p-1.5",children:e.length===0?l.jsx("div",{className:"text-muted-foreground px-2 py-4 text-center text-sm",children:"No one by that name."}):t.map(({section:o,items:a},r)=>l.jsxs("div",{role:"group","aria-label":$e[o],children:[r>0&&l.jsx("div",{className:"bg-border mx-2 my-1.5 h-px"}),l.jsx("div",{"aria-hidden":!0,className:"text-muted-foreground/70 text-2xs px-2 pt-1.5 pb-1 font-medium tracking-wide uppercase",children:$e[o]}),a.map(({row:c,index:d})=>{const g=d===n;return l.jsxs("div",{id:me(d),role:"option","aria-selected":g,"aria-disabled":c.disabled,"data-selected":g,"data-disabled":c.disabled,onClick:()=>{c.disabled||s(c)},className:c.disabled?"flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1.5 opacity-45":"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[l.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 text-center text-sm leading-none",children:c.emoji}),l.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:c.label}),c.handle!==void 0&&l.jsxs("span",{className:"text-muted-foreground/70 truncate font-mono text-xs",children:["@",c.handle]}),c.disabledReason!==void 0&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs ml-auto shrink-0",children:c.disabledReason})]},c.authorId)})]},o))})})}function na({room:e,threadRootId:n,focusOnMount:s,offerJumpBackIn:t,onFocusChange:o,attachments:a}){const r=n===void 0?e.id:Ue(e.id,n),c=bn(r),{target:d}=On(),g=vn(),u=kn(r),x=i.useRef(null),v=Ve(e.members,e.viewerAuthorId),f=i.useRef(!1),m=Mo({members:e.members,viewerAuthorId:e.viewerAuthorId,text:c}),p=t===!0,h=yo({value:c,yieldToPalette:m.isOpen,enabled:p}),w=i.useRef(u);i.useEffect(()=>{var b;u!==w.current&&(w.current=u,(b=x.current)==null||b.focus())},[u]),i.useEffect(()=>{var b;s===!0&&((b=x.current)==null||b.focusUnlessTouch())},[]);const y=i.useCallback(b=>X.getState().set(r,b),[r]),[I,S]=i.useState(null);i.useLayoutEffect(()=>{var b;I!==null&&((b=x.current)==null||b.focusAt(I.pos))},[I]);const C=i.useCallback(b=>{b&&(y(b.value),S({pos:b.cursorPos}))},[y]),A=i.useCallback(b=>C(m.selectRow(b)),[m,C]),N=i.useCallback(()=>C(m.selectHighlighted()),[m,C]),M=()=>{if(d===null||!d.canSend||f.current)return;m.dismiss();const b=X.getState().take(r).trim();if(b==="")return;const O=a.pendingFiles.length>0;O&&(f.current=!0),d.send({text:b}).catch(()=>{const _=X.getState(),k=_.drafts[r]??"";_.set(r,k===""?b:`${b}
|
|
43
|
+
`)?"":" ";s.set(e,`${t}${o}@${n} `)}function vs({roomId:e,entry:n,author:s,viewerAuthorId:t,onViewProfile:o}){const a=as(n),r=n.body.text,c=(s==null?void 0:s.id)===t?void 0:(s==null?void 0:s.handle)??void 0,d=s==null?void 0:s.displayName,{copy:g}=Ht({toastOnSettle:!0});return i.useMemo(()=>{const u={reply:{id:"reply",label:"Reply in thread",icon:Yn,run:()=>{Wt.getState().openThread(e,a,!0),Ne.getState().requestFocus(Ue(e,a))}},copy:{id:"copy",label:"Copy text",icon:Kt,run:()=>void g(r)}};return o!==void 0&&(u.profile={id:"profile",label:"View profile",icon:qt,run:o}),c!==void 0&&(u.mention={id:"mention",label:d===void 0?"Mention author":`Mention ${d}`,icon:Xe,run:()=>{bs(e,c),Ne.getState().requestFocus(e)}}),Cn.map(x=>u[x]).filter(x=>x!==void 0)},[e,a,r,c,d,o,g])}function ks(e){if(e.kind==="notice")return{kind:"notice"};const n=e.body.moment;return n?{kind:"moment",moment:n}:{kind:"message"}}function qo(e,n=[]){return new Map([...n.map(s=>[s.author.id,{...s.author,origin:s.origin}]),...e.map(s=>[s.author.id,{...s.author,origin:s.origin}])])}function zo(e,n){const s=e.body.subjectAuthorId;return s===void 0||n.has(e.authorId)?e.authorId:s}function ws(e,n,s){const t=n.get(e),o=He({record:{kind:(t==null?void 0:t.kind)??"system",id:e,displayName:(t==null?void 0:t.displayName)??"Unknown",emoji:t==null?void 0:t.emoji,color:t==null?void 0:t.color,imageUrl:t==null?void 0:t.imageUrl},override:(t==null?void 0:t.agentRef)===void 0?null:s==null?void 0:s.get(t.agentRef)});return{kind:o.kind,id:e,displayName:(t==null?void 0:t.displayName)??"Unknown",emoji:o.emoji,imageUrl:o.imageUrl,color:o.color,isExternal:typeof(t==null?void 0:t.origin)=="object"&&(t==null?void 0:t.origin)!==null,...(t==null?void 0:t.retired)===!0?{retired:!0}:{}}}function Vo(e){const n=new Set;for(const a of e)W(a)===null&&n.add(a.id);const s=[],t=new Map,o=new Set;for(const a of e){const r=W(a);if(r===null){s.push(a);continue}if(!n.has(r)){s.push(a),o.add(a.id);continue}const c=t.get(r);c?c.push(a):t.set(r,[a])}return{topLevel:s,repliesByRoot:t,orphaned:o}}function Ns(e){return`thread-${e}`}function Is(e){return`thread-row-${e}`}function Go(e){return`thread-panel-entry-${e}`}function Rs(e){return`room-entry-${e}`}function Cs(e,n){const s=e.find(c=>c.id===n);if(s===void 0)return null;const t=W(s)??null,o={rowId:n,domId:Rs(n)};if(t===null)return o;const a=e.find(c=>c.id===t);return a!==void 0&&(W(a)??null)===null?{rowId:Ns(t),domId:Is(t)}:o}function Jo(e,n){if(n===null)return null;const s=e.find(t=>t.seq===n);return s===void 0?null:Cs(e,s.id)}const Se=48;function Yo(e,n,s){const t=e.body.answersEntryId;if(t===void 0||t===e.id||n!==void 0&&n.id===t)return null;const o=s(t);if(o===void 0)return null;const a=o.body.text.replace(/\s+/gu," ").trim();return a.length===0?null:{entryId:t,excerpt:a.length>Se?`${a.slice(0,Se).trimEnd()}…`:a}}function As(e,n){const s=new Map;for(const t of e){const o=n[t.projectPath];if(!o)continue;const a=zt({runtime:o.runtime,model:o.model});s.set(ge(t.projectPath),{memberId:t.id,visual:Vt(o),runtime:a.label,...a.modelLabel!==null&&{model:a.modelLabel}})}return s}function Ms(e){const n=new Map;for(const[s,t]of e)n.set(s,t.visual);return n}const js={info:new Map,faces:new Map},be=i.createContext(js);function Xo({known:e,children:n}){return l.jsx(be.Provider,{value:e,children:n})}function Qo(){const e=he(),n=i.useMemo(()=>{var r;return((r=e.data)==null?void 0:r.agents)??[]},[e.data]),s=i.useMemo(()=>n.map(r=>r.projectPath),[n]),t=Ke(s),o=i.useMemo(()=>As(n,t.data??{}),[n,t.data]),a=i.useMemo(()=>Ms(o),[o]);return i.useMemo(()=>({info:o,faces:a}),[o,a])}function ee(e){const n=i.useContext(be);return e===void 0?void 0:n.info.get(e)}function Ss(){return i.useContext(be).faces}function Os({showAuthorHeader:e,headerId:n,displayName:s,time:t,summary:o,contentId:a,summaryId:r,feedPosition:c}){return{...e?{"aria-labelledby":n}:{"aria-label":t.length>0?`${s}, ${t}`:s},"aria-describedby":o===null?a:r,...xe(c)}}const Q=120,_s="code block";function Es(e){if(e.length<=Q&&!e.includes("```"))return null;const n=Ts(e);return n.length===0?null:n}function Ts(e){const n=e.replace(/```[\s\S]*?(?:```|$)/g,` ${_s} `).replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+)/gm,"").replace(/^\s{0,3}\|?[\s:|-]*\|[\s:|-]*$/gm," ").replace(/\|/g," ").replace(/[*_~]{1,3}/g,"").replace(/\s+/g," ").trim();if(n.length<=Q)return n;const s=$s(n,Q),t=s.lastIndexOf(" ");return`${(t>Q/2?s.slice(0,t):s).trimEnd()}…`}function $s(e,n){if(typeof Intl.Segmenter=="function"){const t=new Intl.Segmenter(void 0,{granularity:"grapheme"});let o="";for(const{segment:a}of t.segment(e)){if(o.length+a.length>n)break;o+=a}return o}let s="";for(const t of e){if(s.length+t.length>n)break;s+=t}return s}function Ds({roomId:e,entry:n,viewerAuthorId:s,reactionFrequents:t,streamStalled:o,isMember:a=!0}){const r=os(),c=o===!0||!a,d=i.useMemo(()=>n.reactions??[],[n.reactions]),g=i.useMemo(()=>d.filter(v=>An(v,s)).map(v=>v.emoji),[d,s]),u=i.useCallback(v=>r.mutate({roomId:e,entryId:n.id,emoji:v,viewerAuthorId:s}),[r,e,n.id,s]),x=i.useMemo(()=>({quick:t,mine:g,onToggle:u,disabled:c}),[t,g,u,c]);return{reactions:d,toggle:u,quickRow:x}}function Ps({barRef:e,pillsRef:n,hasReactions:s}){return t=>{var a,r;if(t.target!==t.currentTarget)return;const{key:o}=t;if(o==="ArrowDown"&&s){t.preventDefault(),(a=n.current)==null||a.focusFirst();return}o!=="ArrowRight"&&o!=="Enter"||(t.preventDefault(),(r=e.current)==null||r.focusFirst())}}function Fs(e,n){var x,v;const s=n.body.subjectAuthorId,t=n.body.notice,o=n.kind==="notice"&&t!==void 0&&s!==void 0&&Gt.includes(t),a=Tn(e,{enabled:o}),r=We(),c=De(),d=fe(),g=o?((v=(x=a.data)==null?void 0:x.bindings.find(f=>f.authorId===s))==null?void 0:v.sessionId)??null:null,u=i.useCallback(f=>{f.button!==0||f.metaKey||f.ctrlKey||f.shiftKey||f.altKey||(f.preventDefault(),!(g===null||s===void 0)&&Jt({queryClient:c,transport:d},e,s).then(m=>{m.kind!=="none"&&r(pe({session:m.kind==="bound"?m.sessionId:g}))}))},[s,r,c,e,g,d]);return i.useMemo(()=>g===null?null:{href:Yt({session:g}),onOpen:u},[u,g])}const te="mention",ve="author_id",Ls={[te]:[ve]},Bs=[te];function Us(e,n){if(!n||n.length===0)return e;const s=Hs(e,n);if(s.length===0)return e;let t=e;for(let o=s.length-1;o>=0;o--){const{offset:a,length:r,authorId:c}=s[o],d=t.slice(0,a),g=t.slice(a,a+r),u=t.slice(a+r);t=`${d}<${te} ${ve}="${c}">${g}</${te}>${u}`}return t}function Hs(e,n){const s=[...n].sort((a,r)=>a.offset-r.offset),t=[];let o=0;for(const a of s)a.offset<o||a.offset+a.length>e.length||(t.push(a),o=a.offset+a.length);return t}const Ks=new Map,rt=i.createContext(Ks);function Ws({authors:e,children:n}){return l.jsx(rt.Provider,{value:e,children:n})}function qs(e){const n=i.useContext(rt);return e===void 0?void 0:n.get(e)}const Oe=new WeakMap;function zs(e){const n=Oe.get(e);if(n)return n;const s=new Map(e.map(t=>[ge(t.projectPath),t.projectPath]));return Oe.set(e,s),s}function Vs(e){var t;const s=(t=he().data)==null?void 0:t.agents;return i.useMemo(()=>e===void 0||!s?void 0:zs(s).get(e),[s,e])}function it(e){const{agentRef:n,identity:s,onViewProfile:t}=e,o=Fe(),a=Vs(o?n:void 0),r=ee(n);return i.useMemo(()=>{if(!o||s.kind!=="agent"||a===void 0)return null;const c={...s,agent:r&&{runtime:r.runtime,...r.model&&{model:r.model}}},d=(g,u={})=>l.jsx(cs,{identity:c,agentPath:a,onViewProfile:t,openOnClick:u.openOnClick??!1,children:g});return{wrap:d,wrapAvatar:g=>d(l.jsx("button",{type:"button",tabIndex:-1,"aria-label":s.displayName,"aria-haspopup":"dialog",className:"focus-ring inline-flex cursor-pointer rounded-sm","data-slot":"room-agent-card-face",children:g}),{openOnClick:!0}),wrapName:g=>d(l.jsx("button",{type:"button","aria-haspopup":"dialog",className:ne(g.props.className,"focus-ring cursor-pointer rounded-sm text-left underline-offset-4 hover:underline"),"data-slot":"room-agent-card-name",children:s.displayName}),{openOnClick:!0})}},[o,s,a,r,t])}const Gs={kind:"human",displayName:""};function Js(e){return typeof e=="string"?e.replace(/^@/,""):""}function Ys({authorId:e,children:n}){const s=qs(e),t=ee(s==null?void 0:s.agentRef),{open:o}=qe(),a=s?He({record:s,override:t==null?void 0:t.visual}):null,r=s?ze(s,t==null?void 0:t.memberId):void 0,c=i.useMemo(()=>r===void 0?void 0:()=>o(r),[r,o]),d=a==null?void 0:a.color,g=a==null?void 0:a.emoji,u=a==null?void 0:a.imageUrl,x=i.useMemo(()=>s?{kind:s.kind,displayName:s.displayName,handle:s.handle??void 0,color:d,emoji:g,imageUrl:u,origin:s.origin,agent:t&&{runtime:t.runtime,...t.model&&{model:t.model}}}:null,[s,d,g,u,t]),v=it({agentRef:s==null?void 0:s.agentRef,identity:x??Gs,onViewProfile:c});if(!s||!x)return l.jsx(Me,{kind:"human",label:Js(n),resolved:!1});const m=v?{role:"button",tabIndex:0,"aria-haspopup":"dialog"}:c?{role:"button",tabIndex:0,"aria-label":`View ${s.displayName}’s profile`,onClick:c,onKeyDown:h=>{h.key!=="Enter"&&h.key!==" "||(h.preventDefault(),c())}}:{},p=l.jsx(Me,{kind:s.kind,label:s.displayName,handle:s.handle??void 0,color:s.color,origin:s.origin,resolved:!0,interactive:c!==void 0,...m});return v?v.wrap(p,{openOnClick:!0}):l.jsx(ye,{onViewProfile:c,identity:x,children:p})}function Xs(e){return{mention:n=>{const s=n[ve],t=typeof s=="string"?s:void 0;return!t||!e.has(t)?l.jsx(l.Fragment,{children:n.children}):l.jsx(Ys,{authorId:t,children:n.children})}}}function Qs({entry:e,authors:n}){const s=i.useMemo(()=>Us(e.body.text,e.mentionSpans),[e.body.text,e.mentionSpans]),t=i.useMemo(()=>{var a;return new Set(((a=e.mentionSpans)==null?void 0:a.map(r=>r.authorId))??[])},[e.mentionSpans]),o=i.useMemo(()=>Xs(t),[t]);return l.jsx(Ws,{authors:n,children:l.jsx($n,{content:s,className:"msg-prose",allowedTags:Ls,literalTagContent:Bs,components:o,renderers:ds})})}function Zs(e){return function(s){return l.jsx(Qs,{entry:s,authors:e})}}const ct="the top folder";function _e(e){return e.slice(e.lastIndexOf("/")+1)}function eo(e){const n=e.lastIndexOf("/");return n===-1?"":e.slice(0,n)}function to(e){return e===""?ct:`${e}/`}function de(e){return e.target!==void 0?e.target===""?ct:e.target:to(eo(e.paths[0]??""))}function no(e,n){const s=e.paths[0]??"",t=e.target;switch(e.kind){case"edit":return`${n} edited ${t??s}`;case"add":return`${n} added ${t??s}`;case"upload":return e.pathCount===1?`${n} uploaded ${_e(s)} to ${de(e)}`:`${n} uploaded ${e.pathCount} files to ${de(e)}`;case"rename":{const o=e.from??"";return t!==void 0?`${n} renamed ${o} to ${t}`:o.endsWith("/")?`${n} renamed ${o}`:`${n} renamed ${o} to ${s}`}case"delete":return t!==void 0?`${n} deleted ${t}`:e.pathCount===1?`${n} deleted ${s}`:`${n} deleted ${e.pathCount} files`;case"from-attachment":return`${n} saved ${_e(s)} from the chat to ${de(e)}`}}const so=i.lazy(()=>Xt(()=>import("./index-BMCDckcY.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.SaveToRoomFilesButton})));function Zo({roomId:e,entry:n,author:s,authorRef:t,authors:o,viewerAuthorId:a,authorNames:r,reactionFrequents:c,streamStalled:d,isMember:g=!0,grouping:u,orphanedReply:x,answers:v,feedPosition:f,rowId:m}){const p=Ye(n.createdAt),h=i.useMemo(()=>{const L=Es(n.body.text),ie=Mn(n.attachments??[]);if(ie===null)return L;const we=L??n.body.text.trim();return we.length>0?`${we} ${ie}`:ie},[n.body.text,n.attachments]),w=i.useId(),y=`${w}-author`,I=`${w}-content`,S=`${w}-summary`,C=i.useRef(null),A=i.useRef(null),N=i.useRef(null),{reactions:M,toggle:j,quickRow:b}=Ds({roomId:e,entry:n,viewerAuthorId:a,reactionFrequents:c,streamStalled:d,isMember:g}),O=ee(t==null?void 0:t.agentRef),{open:_}=qe(),k=t===void 0?void 0:ze(t,O==null?void 0:O.memberId),D=i.useCallback(()=>{k!==void 0&&_(k)},[_,k]),T=k===void 0?void 0:D,q=vs({roomId:e,entry:n,author:t,viewerAuthorId:a,onViewProfile:T}),z=(t==null?void 0:t.handle)??void 0,B=i.useMemo(()=>({kind:s.kind,displayName:s.displayName,handle:z,color:s.color,emoji:s.emoji,imageUrl:s.imageUrl}),[s.kind,s.displayName,z,s.color,s.emoji,s.imageUrl]),$=it({agentRef:t==null?void 0:t.agentRef,identity:B,onViewProfile:T}),R=Ps({barRef:A,pillsRef:N,hasReactions:M.length>0}),U=i.useCallback(()=>{var L;return(L=C.current)==null?void 0:L.focus()},[]),oe=i.useMemo(()=>Zs(o),[o]),pt=i.useCallback(L=>l.jsx(i.Suspense,{fallback:null,children:l.jsx(so,{roomId:e,attachment:L})}),[e]),gt=Ss(),ae=n.body.subjectAuthorId??n.authorId,E=o.get(ae),V=ee(E==null?void 0:E.agentRef),ht=Fs(e,n),re=ks(n);if(re.kind==="notice")return l.jsx(hs,{entry:n,feedPosition:f,rowId:m,sessionLink:ht,subjectName:E==null?void 0:E.displayName});if(re.kind==="moment")return l.jsx(ys,{entry:n,moment:re.moment,subject:ae===n.authorId?s:ws(ae,o,gt),subjectIdentity:{handle:(E==null?void 0:E.handle)??void 0,origin:E==null?void 0:E.origin,agent:V&&{runtime:V.runtime,...V.model&&{model:V.model}}},feedPosition:f,rowId:m});const xt=u.position==="first"||u.position==="only";return l.jsxs(P.Root,{ref:C,id:m,position:u.position,actions:q,reactions:b,"data-testid":"room-entry",tabIndex:0,...Os({showAuthorHeader:xt,headerId:y,displayName:s.displayName,time:p,summary:h,contentId:I,summaryId:S,feedPosition:f}),onKeyDown:R,children:[l.jsx(P.Gutter,{author:s,at:n.createdAt,onViewProfile:$?void 0:T,isSelf:n.authorId===a,renderAvatar:$==null?void 0:$.wrapAvatar}),l.jsxs(P.Body,{children:[l.jsx(P.Author,{id:y,author:s,at:n.createdAt,origin:t==null?void 0:t.origin,renderName:$==null?void 0:$.wrapName}),x===!0&&l.jsx("p",{"data-testid":"room-entry-orphan",className:"text-muted-foreground text-xs italic",children:"Replying to an earlier message"}),v!=null&&l.jsx("p",{"data-testid":"room-entry-answers",className:"text-muted-foreground mb-1 truncate text-xs italic",children:`Answering “${v.excerpt}”`}),l.jsx(P.Content,{id:I,className:"[&_:not(pre)>code]:wrap-anywhere [&_pre]:overflow-x-auto",children:n.body.fileChange?l.jsx("p",{"data-testid":"room-entry-file-change",className:"wrap-anywhere",children:no(n.body.fileChange,(E==null?void 0:E.displayName)??"Somebody")}):oe(n,{rowId:n.id,isStreaming:!1})}),h!==null&&l.jsx("span",{id:S,className:"hidden",children:h}),l.jsx(P.Attachments,{items:n.attachments??[],renderAction:g?pt:void 0}),l.jsx(P.Reactions,{ref:N,reactions:M,viewerAuthorId:a,names:r,frequents:c,onToggle:j,disabled:d===!0||!g,onExit:U}),l.jsx(P.Actions,{actions:q,reactions:b,barRef:A,onExit:U})]})]})}const ea={reactions:!0,threads:!0,runWith:!1,attachments:!0,mentions:!0,streamHealth:!0,presence:!0,turnStatus:!1,asks:!0};function oo(e){const n=fe(),[s,t]=i.useState([]),o=i.useRef(new Map),a=i.useCallback(f=>{const m=f.map(p=>({id:crypto.randomUUID(),file:p,status:"pending",progress:0}));t(p=>[...p,...m])},[]),r=i.useCallback(f=>{o.current.delete(f),t(m=>m.filter(p=>p.id!==f))},[]),c=i.useCallback(f=>{if(!f){o.current.clear(),t([]);return}const m=new Set(f);for(const p of m)o.current.delete(p);t(p=>p.filter(h=>!m.has(h.id)))},[]),d=i.useCallback(f=>{o.current.delete(f),t(m=>m.map(p=>p.id===f&&p.status==="error"?{...p,status:"pending",progress:0,error:void 0}:p))},[]),g=i.useRef(null),u=Pe({meta:{suppressErrorToast:!0},mutationFn:async f=>{t(w=>w.map(y=>f.some(I=>I.id===y.id)?{...y,status:"uploading"}:y));const m=w=>{t(y=>y.map(I=>I.status==="uploading"?{...I,progress:w.percentage}:I))},p=new AbortController;g.current=p;const h=f.map(w=>w.file);return n.uploadRoomAttachments(e,h,m,p.signal)},onSettled:()=>{g.current=null},onSuccess:(f,m)=>{m.forEach((p,h)=>{const w=f[h];w&&o.current.set(p.id,w.id)}),t(p=>p.map(h=>m.findIndex(y=>y.id===h.id)===-1?h:{...h,status:"uploaded",progress:100}))},onError:f=>{t(m=>m.map(p=>p.status==="uploading"?{...p,status:"error",error:f.message}:p))}}),x=i.useCallback(()=>{var f;(f=g.current)==null||f.abort()},[]),v=i.useCallback(async()=>{const f=s.filter(p=>p.status==="error");if(f.length>0)throw new Error(f.length===1?`${f[0].file.name} didn’t upload. Try again or remove it.`:`${f.length} files didn’t upload. Try again or remove them.`);const m=s.filter(p=>p.status==="pending");return m.length>0&&await u.mutateAsync(m),s.map(p=>o.current.get(p.id)).filter(p=>p!==void 0)},[s,u]);return{pendingFiles:s,addFiles:a,removeFile:r,retryFile:d,clearFiles:c,cancelUpload:x,uploadAndGetIds:v,hasPendingFiles:s.length>0,hasFailedUpload:s.some(f=>f.status==="error"),isUploading:u.isPending}}function ta(e){const{room:n,threadRootId:s}=e,t=jn(),o=Sn(),a=oo((n==null?void 0:n.id)??""),r=n!==void 0&&Ve(n.members,n.viewerAuthorId),c=i.useRef({attachments:a,post:t,reply:o,room:n,threadRootId:s});i.useEffect(()=>{c.current={attachments:a,post:t,reply:o,room:n,threadRootId:s}});const d=i.useCallback(y=>c.current.attachments.addFiles(y),[]),g=i.useCallback(y=>c.current.attachments.removeFile(y),[]),u=i.useCallback(y=>c.current.attachments.retryFile(y),[]),x=i.useCallback(()=>c.current.attachments.cancelUpload(),[]),{pendingFiles:v,hasFailedUpload:f,isUploading:m}=a,p=i.useMemo(()=>({staged:v,add:d,remove:g,retry:u,cancel:x,hasFailed:f,isUploading:m,holdsSendWhileUploading:!1}),[v,f,m,d,g,u,x]),h=i.useCallback(async y=>{const{attachments:I,post:S,reply:C,room:A,threadRootId:N}=c.current;if(A===void 0)throw new Error("That room isn’t loaded yet.");if(A.archived)throw new Error("This room is archived.");Z.getState().recordOpened("room",A.id);const M=Qt(),j=I.pendingFiles.map(k=>k.file.name),b=I.pendingFiles.map(k=>k.id),O=await I.uploadAndGetIds();I.clearFiles(b);const _=y.parentEntryId??N;if(_!==void 0){C.mutate({roomId:A.id,rootEntryId:_,text:y.text,clientId:M,attachmentIds:O,attachmentNames:j});return}S.mutate({roomId:A.id,text:y.text,clientId:M,attachmentIds:O,attachmentNames:j})},[]);return{target:i.useMemo(()=>({kind:"room",id:(n==null?void 0:n.id)??"",placeholder:n===void 0?"Message…":s===void 0?`Message ${se(n)}…`:"Reply in this thread…",canSend:n!==void 0&&!n.archived&&r,...n===void 0?{canSendReason:"Still opening this room…"}:n.archived?{canSendReason:"This room is archived. You can read it, but not add to it."}:r?{}:{canSendReason:Ge},send:h,attachments:p}),[n,s,r,p,h]),attachments:a}}const lt=8;function dt(e){if(e==null)return null;const n=e.replace(/\s+/g," ").trim();return n.length===0?null:n}function ao(e){if(tn(e)){const s=e.unreadCount??0;return s===1?"1 new message":`${s} new messages`}const n=e.working??0;return n>0?n===1?"1 agent working":`${n} agents working`:dt(e.topic)}function Ee(e){return{kind:"session",id:e.id,name:en(e.title),summary:dt(e.lastMessagePreview),lastActivityAt:e.updatedAt,session:e}}function ro(e){return{kind:e.kind==="dm"?"dm":"channel",id:e.id,name:se(e),summary:ao(e),lastActivityAt:e.lastActivityAt,room:e}}function J(e){if(e===void 0)return null;const n=Date.parse(e);return Number.isNaN(n)?null:n}function io(e){return e.kind==="session"?Ie("session",e.id):Ie("room",e.id)}function Te(e,n){const s=[J(n[io(e)]),...e.kind==="session"?[J(e.session.lastTouchedByYouAt),J(e.session.userLastMessageAt)]:[]].filter(t=>t!==null);return s.length>0?Math.max(...s):J(e.lastActivityAt)??Number.NEGATIVE_INFINITY}function co(e){return(n,s)=>Te(s,e)-Te(n,e)||s.id.localeCompare(n.id)}function lo(e){const n=new Set;return e.filter(s=>{const t=`${s.kind}:${s.id}`;return n.has(t)?!1:(n.add(t),!0)})}function uo(e,n){return!(n.has(e.id)||e.unreadCount===null||e.lastActivityAt===e.createdAt)}function mo({sessions:e,rooms:n,mutedRoomIds:s=new Set,interactions:t={},limit:o=lt}){const{yours:a,spinOffs:r,automated:c}=Zt(e),d=co(t),g=[...a.map(Ee),...n.filter(u=>uo(u,s)).map(ro)].sort(d);return{items:lo(g).slice(0,o),automated:[...r,...c].map(Ee).sort(d).slice(0,o)}}const fo=3,po=on;function go({limit:e=lt,mutedRoomIds:n,enabled:s=!0}={}){var g,u;const t=nn(Math.max(e*fo,po),{enabled:s}),o=Le({enabled:s}),a=sn(),r=(g=t.data)==null?void 0:g.sessions,c=o.data;return{...i.useMemo(()=>mo({sessions:r??[],rooms:c??[],mutedRoomIds:n,interactions:a,limit:e}),[r,c,n,a,e]),isLoading:s&&(t.isLoading||o.isLoading),warnings:((u=t.data)==null?void 0:u.warnings)??[]}}const ho=6,ut="jump-back-in-listbox";function ke(e){return`jump-back-in-item-${e}`}const xo='[role="combobox"]';function K(e){return e instanceof Element&&e.matches(xo)}function yo({value:e,yieldToPalette:n=!1,enabled:s=!0}){const t=We(),o=an(),[a,r]=i.useState(!1),[c,d]=i.useState({stamp:"",index:0}),[g,u]=i.useState(!1),[x,v]=i.useState(!1);e.length>0&&!x&&v(!0);const f=i.useRef(!1);i.useEffect(()=>{f.current=!0},[]);const{data:m}=he({enabled:s}),p=i.useMemo(()=>((m==null?void 0:m.agents)??[]).map(R=>R.projectPath),[m]),{data:h}=Ke(p,{enabled:s}),w=i.useMemo(()=>h??{},[h]),y=i.useMemo(()=>rn(p,w),[p,w]),I=i.useMemo(()=>new Map(p.map(R=>[ge(R),R])),[p]),S=i.useCallback(R=>cn({room:R,agentsByPath:w,pathByAgentRef:I}),[w,I]),C=i.useMemo(()=>ln(o.muted),[o.muted]),{items:A}=go({mutedRoomIds:C,enabled:s}),N=i.useMemo(()=>A.slice(0,ho),[A]),M=s&&a&&!g&&!x&&!n&&e.length===0&&N.length>0,j=`${M}:${N.length}`,b=c.stamp===j?c.index:0,O=i.useCallback(R=>{f.current&&K(R.target)&&(u(!1),v(!1),r(!0))},[]),_=i.useCallback(R=>{K(R.target)&&r(!0)},[]),k=i.useCallback(R=>{K(R.target)&&r(!1)},[]),D=i.useCallback(R=>{N.length!==0&&d(U=>{const oe=U.stamp===j?U.index:0;return{stamp:j,index:(oe+R+N.length)%N.length}})},[N.length,j]),T=i.useCallback(()=>D(1),[D]),q=i.useCallback(()=>D(-1),[D]),z=i.useCallback(()=>{u(!0)},[]),B=i.useCallback(R=>{if(u(!0),R.kind==="session"){R.session.cwd&&Z.getState().recordOpened("agent",R.session.cwd),t(pe({dir:R.session.cwd??void 0,session:R.session.id}));return}Z.getState().recordOpened("room",R.room.id),t({...dn.channels(),search:{id:R.room.id}})},[t]),$=i.useCallback(()=>{const R=N[b];!M||!R||B(R)},[M,N,b,B]);return{isOpen:M,hasRows:N.length>0,rows:N,agents:w,displayNames:y,visualOf:S,selectedIndex:b,activeDescendantId:M&&N[b]!==void 0?ke(b):void 0,listboxId:M?ut:void 0,handleFocus:O,handleBlur:k,handlePointerDown:_,moveDown:T,moveUp:q,selectHighlighted:$,selectRow:B,dismiss:z}}function mt({mark:e,label:n,title:s,summary:t,lastActivityAt:o,index:a,isSelected:r,now:c,onSelect:d}){const g=i.useMemo(()=>Number.isNaN(Date.parse(o))?null:xn(o),[o,c]);return l.jsxs("div",{id:ke(a),role:"option","aria-selected":r,"data-selected":r,title:s,onClick:d,className:"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-start gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[l.jsx("span",{className:"mt-px flex shrink-0 items-center",children:e}),l.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[l.jsxs("span",{className:"flex w-full items-center gap-1.5",children:[l.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm",children:n}),g!==null&&l.jsx("span",{className:"text-muted-foreground/60 text-3xs shrink-0",children:g})]}),t!==null&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs truncate",children:t})]})]})}function bo({item:e,agent:n,displayName:s,index:t,isSelected:o,now:a,onSelect:r}){const c=mn(n,e.session.cwd??s);return l.jsx(mt,{mark:l.jsx(fn,{color:c.color,emoji:c.emoji,size:"xs"}),label:e.name,title:`${s} · ${e.name}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:t,isSelected:o,now:a,onSelect:r})}function vo({item:e,visual:n,index:s,isSelected:t,now:o,onSelect:a}){return l.jsx(mt,{mark:l.jsx(gn,{room:e.room,participants:e.room.participants,visuals:hn(n)}),label:l.jsx(pn,{room:e.room}),title:e.summary===null?e.name:`${e.name} · ${e.summary}`,summary:e.summary,lastActivityAt:e.lastActivityAt,index:s,isSelected:t,now:o,onSelect:a})}function ko({rows:e,selectedIndex:n,agents:s={},displayNames:t={},visualOf:o,onSelect:a}){const r=un(6e4);return i.useEffect(()=>{var c,d;(d=(c=document.getElementById(ke(n)))==null?void 0:c.scrollIntoView)==null||d.call(c,{block:"nearest"})},[n]),l.jsx(Je.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:c=>c.preventDefault(),children:l.jsx("div",{id:ut,role:"listbox","aria-label":"Jump back in",className:"max-h-72 overflow-y-auto p-1.5",children:e.map((c,d)=>{var g;return c.kind==="session"?l.jsx(bo,{item:c,agent:c.session.cwd&&s[c.session.cwd]||null,displayName:c.session.cwd&&t[c.session.cwd]||((g=c.session.cwd)==null?void 0:g.split("/").pop())||"Agent",index:d,isSelected:d===n,now:r,onSelect:()=>a(c)},`session-${c.id}`):l.jsx(vo,{item:c,visual:o(c.room),index:d,isSelected:d===n,now:r,onSelect:()=>a(c)},`room-${c.id}`)})})})}const $e={people:"People",agents:"Agents"},wo=["people","agents"];function No(e,n){const s=[];for(const{author:t}of e){if(t.kind==="system"||t.id===n||t.retired)continue;const o=t.handle;s.push({section:t.kind==="agent"?"agents":"people",authorId:t.id,label:t.displayName,...o?{handle:o}:{},...t.emoji?{emoji:t.emoji}:{},...t.color?{color:t.color}:{},disabled:!o,...o?{}:{disabledReason:"No @name"}})}return s}function Io(e,n,s){const t=n.trim().toLowerCase(),o=e.map((a,r)=>({row:a,position:r,tier:Ro(a,t)})).filter(a=>a.tier!==null).sort((a,r)=>a.tier-r.tier||a.position-r.position);return s.flatMap(a=>o.filter(r=>r.row.section===a).map(({row:r})=>r))}function Ro(e,n){var o;if(n==="")return 0;const s=[(o=e.handle)==null?void 0:o.toLowerCase(),e.label.toLowerCase()].filter(a=>a!==void 0);let t=null;for(const a of s){const r=a===n?0:a.startsWith(n)?1:a.includes(n)?2:null;r!==null&&(t===null||r<t)&&(t=r)}return t}function Y(e,n,s){var a;const t=e.length;if(t===0)return 0;let o=(n%t+t)%t;for(let r=0;r<t;r++){if(!((a=e[o])!=null&&a.disabled))return o;o=(o+s+t)%t}return 0}function Co(e,n,s,t){const o=e.slice(0,n),a=e.slice(n+1+s.length),r=`@${t}`,c=a.startsWith(" ")?"":" ";return{value:o+r+c+a,cursorPos:o.length+r.length+1}}const Ao=/(^|\s)@([A-Za-z0-9_.-]*)$/,ft="mention-palette-listbox";function me(e){return`mention-item-${e}`}function Mo({members:e,viewerAuthorId:n,text:s,sectionOrder:t=wo}){var _;const[o,a]=i.useState(!1),[r,c]=i.useState(""),[d,g]=i.useState(-1),u=yn(s),x=i.useRef(!1),v=i.useMemo(()=>No(e,n),[e,n]),f=i.useMemo(()=>o?Io(v,r,t):[],[v,r,o,t]),[m,p]=i.useState(null),h=m!==null&&m.query===r&&m.open===o?m.index:Y(f,0,1),w=f[h],y=f.length===0||w!==void 0&&!w.disabled?h:Y(f,0,1),I=i.useCallback((k,D)=>{const T=k.slice(0,D).match(Ao);if(!T){a(!1);return}a(!0),c(T[2]),g((T.index??0)+T[1].length)},[]),S=i.useCallback(k=>{u.write(k),x.current=!1},[u]),C=i.useCallback(k=>{x.current||I(u.read(),k)},[I,u]),A=i.useCallback(()=>{p({query:r,open:o,index:Y(f,y+1,1)})},[f,y,r,o]),N=i.useCallback(()=>{p({query:r,open:o,index:Y(f,y-1,-1)})},[f,y,r,o]),M=i.useCallback(k=>k.disabled||k.handle===void 0?null:(x.current=!0,a(!1),Co(u.read(),d,r,k.handle)),[d,r,u]),j=i.useCallback(()=>{const k=f[y];return k?M(k):(a(!1),null)},[f,y,M]),b=i.useCallback(()=>{x.current=!0,a(!1)},[]),O=f.some(k=>!k.disabled);return{isOpen:o,hasSelectableRows:O,rows:f,selectedIndex:y,activeDescendantId:o&&((_=f[y])==null?void 0:_.disabled)===!1?me(y):void 0,listboxId:o?ft:void 0,noteTextChange:S,handleCursorChange:C,moveDown:A,moveUp:N,selectHighlighted:j,selectRow:M,dismiss:b}}function jo({rows:e,selectedIndex:n,onSelect:s}){const t=i.useMemo(()=>{const o=[];return e.forEach((a,r)=>{const c=o[o.length-1];c&&c.section===a.section?c.items.push({row:a,index:r}):o.push({section:a.section,items:[{row:a,index:r}]})}),o},[e]);return i.useEffect(()=>{var o;(o=document.getElementById(me(n)))==null||o.scrollIntoView({block:"nearest"})},[n]),l.jsx(Je.div,{initial:{opacity:0,scale:.98,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:4},transition:{duration:.15,ease:[0,0,.2,1]},className:"bg-popover max-h-80 overflow-hidden rounded-lg border shadow-lg",onMouseDown:o=>o.preventDefault(),children:l.jsx("div",{id:ft,role:"listbox","aria-label":"Mentions",className:"max-h-72 overflow-y-auto p-1.5",children:e.length===0?l.jsx("div",{className:"text-muted-foreground px-2 py-4 text-center text-sm",children:"No one by that name."}):t.map(({section:o,items:a},r)=>l.jsxs("div",{role:"group","aria-label":$e[o],children:[r>0&&l.jsx("div",{className:"bg-border mx-2 my-1.5 h-px"}),l.jsx("div",{"aria-hidden":!0,className:"text-muted-foreground/70 text-2xs px-2 pt-1.5 pb-1 font-medium tracking-wide uppercase",children:$e[o]}),a.map(({row:c,index:d})=>{const g=d===n;return l.jsxs("div",{id:me(d),role:"option","aria-selected":g,"aria-disabled":c.disabled,"data-selected":g,"data-disabled":c.disabled,onClick:()=>{c.disabled||s(c)},className:c.disabled?"flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1.5 opacity-45":"data-[selected=true]:bg-accent hover:bg-muted flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-100",children:[l.jsx("span",{"aria-hidden":!0,className:"size-4 shrink-0 text-center text-sm leading-none",children:c.emoji}),l.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:c.label}),c.handle!==void 0&&l.jsxs("span",{className:"text-muted-foreground/70 truncate font-mono text-xs",children:["@",c.handle]}),c.disabledReason!==void 0&&l.jsx("span",{className:"text-muted-foreground/70 text-2xs ml-auto shrink-0",children:c.disabledReason})]},c.authorId)})]},o))})})}function na({room:e,threadRootId:n,focusOnMount:s,offerJumpBackIn:t,onFocusChange:o,attachments:a}){const r=n===void 0?e.id:Ue(e.id,n),c=bn(r),{target:d}=On(),g=vn(),u=kn(r),x=i.useRef(null),v=Ve(e.members,e.viewerAuthorId),f=i.useRef(!1),m=Mo({members:e.members,viewerAuthorId:e.viewerAuthorId,text:c}),p=t===!0,h=yo({value:c,yieldToPalette:m.isOpen,enabled:p}),w=i.useRef(u);i.useEffect(()=>{var b;u!==w.current&&(w.current=u,(b=x.current)==null||b.focus())},[u]),i.useEffect(()=>{var b;s===!0&&((b=x.current)==null||b.focusUnlessTouch())},[]);const y=i.useCallback(b=>X.getState().set(r,b),[r]),[I,S]=i.useState(null);i.useLayoutEffect(()=>{var b;I!==null&&((b=x.current)==null||b.focusAt(I.pos))},[I]);const C=i.useCallback(b=>{b&&(y(b.value),S({pos:b.cursorPos}))},[y]),A=i.useCallback(b=>C(m.selectRow(b)),[m,C]),N=i.useCallback(()=>C(m.selectHighlighted()),[m,C]),M=()=>{if(d===null||!d.canSend||f.current)return;m.dismiss();const b=X.getState().take(r).trim();if(b==="")return;const O=a.pendingFiles.length>0;O&&(f.current=!0),d.send({text:b}).catch(()=>{const _=X.getState(),k=_.drafts[r]??"";_.set(r,k===""?b:`${b}
|
|
44
44
|
${k}`)}).finally(()=>{O&&(f.current=!1)})};if(!v)return l.jsxs("div",{className:"flex items-center justify-between gap-3 border-t px-4 py-3",children:[l.jsx("p",{className:"text-muted-foreground text-sm",children:Ge}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:g.isPending,onClick:()=>g.mutate({roomId:e.id,authorId:e.viewerAuthorId},{onSuccess:()=>Be.success(`You joined ${se(e)}`)}),children:wn})]});const j=l.jsx(_n.Composer,{inputRef:x,value:c,onChange:b=>{y(b),m.noteTextChange(b)},onSubmit:M,head:l.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:m.isOpen&&m.rows.length===0?"No one by that name.":""}),mentionPicker:l.jsx(Re,{children:m.isOpen&&l.jsx(jo,{rows:m.rows,selectedIndex:m.selectedIndex,onSelect:A})}),overlays:l.jsx(l.Fragment,{children:l.jsx(Re,{children:h.isOpen&&l.jsx(ko,{rows:h.rows,selectedIndex:h.selectedIndex,agents:h.agents,displayNames:h.displayNames,visualOf:h.visualOf,onSelect:h.selectRow})})}),input:{onCursorChange:m.handleCursorChange,isStreaming:!1,isPaletteOpen:m.isOpen||h.isOpen,paletteHasResults:h.isOpen?h.hasRows:m.hasSelectableRows,onArrowUp:h.isOpen?h.moveUp:m.moveUp,onArrowDown:h.isOpen?h.moveDown:m.moveDown,onCommandSelect:h.isOpen?h.selectHighlighted:N,onEscape:h.isOpen?h.dismiss:m.dismiss,tabPicks:!h.isOpen,onClear:()=>{y(""),m.dismiss()},activeDescendantId:h.isOpen?h.activeDescendantId:m.activeDescendantId,paletteListboxId:h.isOpen?h.listboxId:m.listboxId,contextKey:r,...a.hasFailedUpload?{canSubmitReason:"A file didn’t upload. Try it again or remove it, then send."}:{}}});return!p&&o===void 0?j:l.jsx("section",{className:"flex flex-col","data-testid":Nn.homeComposer,onFocus:b=>{h.handleFocus(b),K(b.target)&&(o==null||o(!0))},onBlur:b=>{h.handleBlur(b),K(b.target)&&(o==null||o(!1))},onPointerDown:h.handlePointerDown,children:j})}export{Xo as A,na as C,ye as I,ea as R,qo as a,Zo as b,ws as c,zo as d,Qo as e,Yo as f,Vo as g,Ns as h,rs as i,Wo as j,Is as k,Rs as l,Cs as m,Go as n,Jo as o,K as p,as as r,W as t,ta as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{W as m,a1 as x,aY as k,r as v,j as t,B as d,G as p,a7 as y}from"./index-
|
|
1
|
+
import{W as m,a1 as x,aY as k,r as v,j as t,B as d,G as p,a7 as y}from"./index-CjUfPyOM.js";import{u as R}from"./use-update-config-Dfd7KMde.js";import{I as S}from"./inline-code-DwFNff3_.js";/**
|
|
2
2
|
* @license lucide-react v1.48.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|