dorkos 0.125.3 → 0.126.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +87749 -87287
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-DSSx1Gzx.js → AboutPage-2c9n8B32.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-C-mLOmJm.js → ActivityErrorState-muwC_jif.js} +1 -1
- package/dist/client/assets/{ActivityPage-DsOjjulF.js → ActivityPage-2aUz3zv0.js} +1 -1
- package/dist/client/assets/{ActivityRow-ylgCMe7Y.js → ActivityRow-nQBqDCak.js} +1 -1
- package/dist/client/assets/{AdapterIcon-DT5OdFbe.js → AdapterIcon-ChpyilnO.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-C6jxF55P.js → AdapterSetupWizard-DRKQp5Gh.js} +2 -2
- package/dist/client/assets/{AgentOptionRow-CtdBmX9G.js → AgentOptionRow-CeVPhvTq.js} +1 -1
- package/dist/client/assets/{AgentPicker--wr93sVO.js → AgentPicker-D8YX1P_q.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-DVoE2cnk.js → AgentRequestCard-refCLvuV.js} +3 -3
- package/dist/client/assets/{AppearancePage-DR_g6BJO.js → AppearancePage-BDTIp3j0.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-BqaoB6AS.js → ApplyToOverridesDialog-C-XL9N4W.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-CM0TrrbJ.js → AttentionSignalRow-Dn4rP542.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-DJ54CELa.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-B0sy0nRk.js} +1 -1
- package/dist/client/assets/{BindingDialog-JAPULq7H.js → BindingDialog-DMYB-vWm.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-B3-FjszN.js → BlintzCanvas-D9ZLEDXc.js} +28 -28
- package/dist/client/assets/{CanvasCsvContent-Cmqry1BS.js → CanvasCsvContent-DMqGpNWm.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-BMkxUF1r.js → CanvasFileContent-Bxhc86lv.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-DBhuNbFD.js → CanvasModel3dContent-D783Ql7m.js} +2 -2
- package/dist/client/assets/ChannelComposer-BNlD-d2W.js +44 -0
- package/dist/client/assets/{ChatAppsOff-CY5_0lQH.js → ChatAppsOff-eRAfqzJR.js} +2 -2
- package/dist/client/assets/{CodeMirrorDiff-_EI44zW6.js → CodeMirrorDiff-CqEUAG6G.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-x1lTuDQH.js → CodeMirrorEditor-BM1ANude.js} +1 -1
- package/dist/client/assets/{CommitmentList-D-CvccnF.js → CommitmentList-C3QvbbGF.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-CLw1FRLv.js → CommitmentsPage-bmqKNd-Z.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-QJnXivV4.js → ComputerResourceView-78falOZG.js} +1 -1
- package/dist/client/assets/{ComputerViewer-DbTGz3OL.js → ComputerViewer-DZ2RiDbn.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-CB5UY0f0.js → ConnectionAccessLists-CXsNyR4U.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-SpEJxCeF.js → ConnectionsPage-bpkRfRRK.js} +2 -2
- package/dist/client/assets/{ConventionPage-C2NIZjG3.js → ConventionPage-rYtICYjS.js} +3 -3
- package/dist/client/assets/{ExtensionPageRoute-Drr5uceG.js → ExtensionPageRoute-DXTqUrR4.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-kKteNmsx.js → FloatingTanStackRouterDevtools-CqogiFob-CCNB3_Gb.js} +1 -1
- package/dist/client/assets/ForwardConsentHost-BfVnJ6oD.js +1 -0
- package/dist/client/assets/HandlePage-BH_G4sMV.js +1 -0
- package/dist/client/assets/{HeartbeatPage-BLGTx_57.js → HeartbeatPage-DdAfcR81.js} +1 -1
- package/dist/client/assets/{KeyEntry-DgN8iewR.js → KeyEntry-CR7GBqXf.js} +1 -1
- package/dist/client/assets/{LexicalField-Bfj72GvX.js → LexicalField-RAoub3wq.js} +2 -2
- package/dist/client/assets/{ManagesPage-C3G1-Mep.js → ManagesPage-CEhYj9ov.js} +1 -1
- package/dist/client/assets/{Marketplace-Dg0bIo7_.js → Marketplace-DtxHDbF4.js} +2 -2
- package/dist/client/assets/{MarketplaceSourcesView-KPw8YYXi.js → MarketplaceSourcesView-CSFvFtV_.js} +1 -1
- package/dist/client/assets/{McpAppFrame-DjJ4EM39.js → McpAppFrame-1mPdRK9p.js} +2 -2
- package/dist/client/assets/{McpSigninBody-V6RSsDqe.js → McpSigninBody--HfjMnE1.js} +1 -1
- package/dist/client/assets/{Model3dViewer-woNPO5OC.js → Model3dViewer-BT2SY67i.js} +1 -1
- package/dist/client/assets/NamePage-CaJsVRhh.js +1 -0
- package/dist/client/assets/NewDirectMessageMenu-QUtJTzKI.js +1 -0
- package/dist/client/assets/{NotificationsPage-kUtiVsFS.js → NotificationsPage-D3fleW0i.js} +1 -1
- package/dist/client/assets/OpenMeshSwitch-8WEn0WrA.js +5 -0
- package/dist/client/assets/{OperatorIdentityForm-B29T-N9x.js → OperatorIdentityForm-BRKAQS0D.js} +1 -1
- package/dist/client/assets/{PermissionHistory-CV8cFJr3.js → PermissionHistory-5stLHBu8.js} +1 -1
- package/dist/client/assets/{PermissionsPage-_PKlbWde.js → PermissionsPage-C2pB1TCJ.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-BOXTCA6E.js → PersonalityPopover-DIbsJ6HP.js} +1 -1
- package/dist/client/assets/PhotoPage-33Xh8sq1.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-CdHja8fU.js → PreviewRefusedNotice-CjT7jQ45.js} +1 -1
- package/dist/client/assets/{ProfileFields-C48alR3i.js → ProfileFields-gZNaFBow.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-BpJVbdUL.js → ProfilePanelContainer-DYf7L8xJ.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-DtuSZNaw.js → ProfileRolePicker-DclYXFSP.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-DT-JdGeO.js → PromptSuggestionChips-k9HolS90.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-BP2nxz2E.js → ReportsToPopover-Bh5KrFbJ.js} +1 -1
- package/dist/client/assets/RoomSurface-32U7Wl6Z.js +1 -0
- package/dist/client/assets/{RoomsPage-gDIy73MQ.js → RoomsPage-sdMZgHla.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-DhXG88Uj.js → RunsOnPopover-B5_Jz7ir.js} +1 -1
- package/dist/client/assets/RuntimeConnectFlow-C_6ozpAK.js +1 -0
- package/dist/client/assets/RuntimeSetupDialog-BDvzruM4.js +1 -0
- package/dist/client/assets/SeenDevices-CZ--8ljN.js +19 -0
- package/dist/client/assets/{SessionsPage-C6nmCWVM.js → SessionsPage-BKyrJh1O.js} +1 -1
- package/dist/client/assets/SettingsDialog-E5hPag3F.js +12 -0
- package/dist/client/assets/{SkillsPage-DSIKEsHr.js → SkillsPage-BeL6zfgw.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-Cst7UxoY.js → TaskDialogWrapper-B-IP5hYv.js} +1 -1
- package/dist/client/assets/TasksEmptyState-BcftWVbk.js +3 -0
- package/dist/client/assets/TasksPage-CmroTI1v.js +1 -0
- package/dist/client/assets/{TeamComputerEntry-uj1GcPP_.js → TeamComputerEntry-DbfoZrZz.js} +1 -1
- package/dist/client/assets/{ToolsPage-Qm6x37SO.js → ToolsPage-h-PS45fZ.js} +1 -1
- package/dist/client/assets/{TopologyGraph-2C3Ij6tO.js → TopologyGraph-Bk_0y0Yy.js} +15 -15
- package/dist/client/assets/{TourHost-BsV8lcXT.js → TourHost-D4La-1-E.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-ClNn0nv6.js → UnlinkDialog-CWd4fhT4.js} +1 -1
- package/dist/client/assets/UnreadDivider-Bvg9QLn9.js +1 -0
- package/dist/client/assets/{WidgetErrorCard-oq5MKUX_.js → WidgetErrorCard-DictdlWO.js} +2 -2
- package/dist/client/assets/WorkView-DxThzZ0w.js +51 -0
- package/dist/client/assets/{_shell-D4V8GQqV.js → _shell-CX_gaQPE.js} +22 -22
- package/dist/client/assets/{_shell._home-DoaHLKk8.js → _shell._home-CBNsPEH4.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-BP1byb8g.js → _shell._home.activity-DpSGWVSW.js} +1 -1
- package/dist/client/assets/_shell._home.index-BWH93iWg.js +3 -0
- package/dist/client/assets/_shell._home.tasks-Ive4UW8c.js +1 -0
- package/dist/client/assets/{_shell._home.workspaces-BcOiklL5.js → _shell._home.workspaces-3R3VtH7x.js} +1 -1
- package/dist/client/assets/{_shell.channels-DxSDnd-3.js → _shell.channels-DRslcaiA.js} +4 -4
- package/dist/client/assets/{_shell.connections-YKOm7ap5.js → _shell.connections-BPQxNUPD.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-DC2Jw1EF.js → _shell.feedback-requests-DkXEk3qm.js} +2 -2
- package/dist/client/assets/_shell.marketplace-D8deZF5L.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-BHG9MqWR.js +1 -0
- package/dist/client/assets/_shell.session-CkdA2hgF.js +1 -0
- package/dist/client/assets/{_shell.team-C9QJNwaK.js → _shell.team-CZu-l34d.js} +3 -3
- package/dist/client/assets/_shell.threads-Cz-EZQXr.js +1 -0
- package/dist/client/assets/_shell.x._extensionId-Cry6E5KK.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-Cry6E5KK.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-sjxf16g2.js → abnfDiagram-WEYOIA3C-4hI8_uRi.js} +1 -1
- package/dist/client/assets/{access-copy-_81ChCG3.js → access-copy-BegDAoeR.js} +1 -1
- package/dist/client/assets/{arc-B-c5OGeX.js → arc-DgydwPM5.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-CExq4B1X.js → architectureDiagram-ZHVYKT53-4kexDkbn.js} +1 -1
- package/dist/client/assets/{banner-BhzLIs7u.js → banner-CYV5jQI0.js} +2 -2
- package/dist/client/assets/{blockDiagram-RJAE7QA3-C1D5MR7Z.js → blockDiagram-RJAE7QA3-BUP4L5_m.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-DMtF_wcg.js → c4Diagram-XDPPPE54-B4HK3S3o.js} +1 -1
- package/dist/client/assets/{card-Dsy8PPN6.js → card-6VNSI3kT.js} +1 -1
- package/dist/client/assets/channel-Bf4e4rlX.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-DCmxZwyD.js → chunk-2E7WHVMD-Bhw5hCVI.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-BXvjhtJ3.js → chunk-2Q5K7J3B-CeUgfCvO.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-CR6qWjas.js → chunk-4EMNKR2T-DqSZunXx.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-Bny7RY06.js → chunk-55XCU76K-Bigp9-bU.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-B9aD4Uib.js → chunk-5VM5RSS4-DF1L8DrH.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-D28Xa5gr.js → chunk-JWPE2WC7-lcFap_43.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-CLgnUSgl.js → chunk-VQ5W62QI-Bgmsy9NF.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-vMTRVR5A.js → chunk-XXDRQBXY-DFFzLm_u.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-Ck0VFEtd.js → chunk-ZCHMQSOR-B4aJwBdo.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-Dh4gPh4M.js → classDiagram-v2-4MYWR3UA-BdUAMGnS.js} +1 -1
- package/dist/client/assets/{command-CxjTPW0z.js → command-Dz2pZLle.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-BA-tF0x7.js → cose-bilkent-JH36ORCC-BdJxQmWe.js} +1 -1
- package/dist/client/assets/{cpu-SRODWAA1.js → cpu-CjKJ8pVl.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-B_kxrTf4.js → cynefin-EF2NZ3EQ-BvnDWKe0.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-Be0brpVq.js → cynefinDiagram-WF24UDRP-DKL8UyvS.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-zI9I0fUC.js → dagre-NK4GIZVX-CCuJpxlY.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-jN0pUEKR.js → diagram-CBK3MWTC-C1jeuv8r.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D-BjRZmmQf.js → diagram-I5XIIV2D-CSnTyOU0.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-BtnkiX3a.js → diagram-ODIL2UCW-9w6q1YKi.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-Bteh9wpL.js → diagram-PFBEJUXE-BMFBmD0P.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-hRmqKbOC.js → diagram-RJA3I4VV-D9Utl6qX.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-NKdthGes.js → diagram-TYUNFSNR-u_ogc51l.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-CpkD13ID.js → ebnfDiagram-V4P3TTPT-Bg_smbFH.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-Dw4bdkn4.js → elk-QONTBCTQ-CtuwbIK2.js} +1 -1
- package/dist/client/assets/{empty-state-Xw8KQdod.js → empty-state-CbFKhqwB.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-fiThyiH_.js → erDiagram-KYQIGQAA-MlvYHdZ7.js} +1 -1
- package/dist/client/assets/{execution-config-ryHuiBdx.js → execution-config-BjNjQoBp.js} +1 -1
- package/dist/client/assets/{file-CbZILJJL.js → file-JokR8lB2.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-rCHuN_aY.js → file-exclamation-point-sl45DZYe.js} +1 -1
- package/dist/client/assets/{file-text-DGtefNvG.js → file-text-C4PxLfBm.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-DJDfJAaN.js → find-latest-widget-fence-Bc1LICCy.js} +5 -5
- package/dist/client/assets/{flowDiagram-IUGLLWBU-ORyRd0wW.js → flowDiagram-IUGLLWBU-BlrKbUnh.js} +1 -1
- package/dist/client/assets/{form-USBlP2n_.js → form-1NlezfMg.js} +1 -1
- package/dist/client/assets/{format-cron-u8efK62G.js → format-cron-C57sE3sK.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-BC-M9_Wi.js → ganttDiagram-R7GPNTJY-BhCCQ-d7.js} +3 -3
- package/dist/client/assets/{git-branch-jQqbJAvp.js → git-branch-BXEb1Sqq.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-NIdjLN38.js → gitGraphDiagram-PDYL7XHY-Chl1aqHg.js} +1 -1
- package/dist/client/assets/{graph-CBIOKOiw.js → graph-DIIpUxLd.js} +1 -1
- package/dist/client/assets/{heart-CSbB9K4Q.js → heart-CUs7jdhV.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-OC8sqXXy.js → highlighted-body-KPVGNVTW-DlDHGjld.js} +1 -1
- package/dist/client/assets/image-lightbox-BczXKBTZ.js +1 -0
- package/dist/client/assets/image-off-Ch98GGBJ.js +6 -0
- package/dist/client/assets/{index-CiAb-mD4.js → index-0MDZSAdr.js} +1 -1
- package/dist/client/assets/{index-C5gtuueN.js → index-37h1E-65.js} +1 -1
- package/dist/client/assets/{index-CeJVF9AD.js → index-8FrM4Unx.js} +1 -1
- package/dist/client/assets/{index-CRPh-508.js → index-B0p2_o3r.js} +1 -1
- package/dist/client/assets/{index-BU_bmsP2.js → index-B0q1o1JU.js} +1 -1
- package/dist/client/assets/{index-Yr72qWri.js → index-BAnl5kwm.js} +1 -1
- package/dist/client/assets/{index-w4wyJU8q.js → index-BC41bN42.js} +1 -1
- package/dist/client/assets/{index-DfYJ-zxk.js → index-BNJa5z6K.js} +7 -7
- package/dist/client/assets/{index-DJyLZL6w.js → index-BQlnEL5t.js} +1 -1
- package/dist/client/assets/{index-DkcRrH0O.js → index-BRyEtRBO.js} +1 -1
- package/dist/client/assets/index-BThp0Av1.js +1 -0
- package/dist/client/assets/{index-LFeqJL-v.js → index-BVjrgWDa.js} +1 -1
- package/dist/client/assets/{index-D9Ej8fsx.js → index-BiyMpL0z.js} +1 -1
- package/dist/client/assets/{index-DeDh_2c1.js → index-BwHCH3tE.js} +1 -1
- package/dist/client/assets/index-ByIDaFWv.js +1 -0
- package/dist/client/assets/{index-RXFhiamo.js → index-BzqkXlms.js} +1 -1
- package/dist/client/assets/index-CFJcOzPD.js +1 -0
- package/dist/client/assets/{index-B5eM1_q1.js → index-CQTeDD0B.js} +1 -1
- package/dist/client/assets/{index-BOaou3k5.js → index-CSOhBvPV.js} +1 -1
- package/dist/client/assets/{index-Dk33a8Wz.js → index-CYhf-E_N.js} +1 -1
- package/dist/client/assets/{index-CWhDGAYM.js → index-CaVP52c1.js} +1 -1
- package/dist/client/assets/{index-CRTzTiNF.js → index-Cn1ZEy3S.js} +1 -1
- package/dist/client/assets/{index-C9UgTEuh.js → index-CnNGTb8f.js} +1 -1
- package/dist/client/assets/{index-BGGnQdij.js → index-Cnjpi7ar.js} +3 -3
- package/dist/client/assets/{index-BYxDsLTQ.js → index-CoHeCySh.js} +1 -1
- package/dist/client/assets/index-CujX3mpY.css +1 -0
- package/dist/client/assets/{index-C49AWTah.js → index-Cw0QRsnv.js} +1 -1
- package/dist/client/assets/{index-CuT_aCM-.js → index-Czar7aPT.js} +2 -2
- package/dist/client/assets/{index-Bz9CgPjs.js → index-D1Be28yK.js} +1 -1
- package/dist/client/assets/{index-j5szQcqb.js → index-D6NjBiAq.js} +1 -1
- package/dist/client/assets/{index-fAHI5hei.js → index-DMfV6rUz.js} +1 -1
- package/dist/client/assets/index-D_9H4FdK.js +1 -0
- package/dist/client/assets/{index-B9utW3HE.js → index-DaZdDh7o.js} +1 -1
- package/dist/client/assets/{index-CDslENFz.js → index-DlZ77Qfj.js} +1 -1
- package/dist/client/assets/index-Dv6HjbCS.js +1 -0
- package/dist/client/assets/index-DwrBsA10.js +1053 -0
- package/dist/client/assets/{index-CCohVfmo.js → index-DzLIbXMR.js} +1 -1
- package/dist/client/assets/{index-n6f9pLtt.js → index-Ev7FZl9a.js} +1 -1
- package/dist/client/assets/{index-DJlq_kd_.js → index-HnW-eS5i.js} +1 -1
- package/dist/client/assets/{index-DnyoNFRt.js → index-hyqRnlFg.js} +1 -1
- package/dist/client/assets/{index-jJbbnV9q.js → index-pQstFziR.js} +3 -3
- package/dist/client/assets/{index-BN02EVKP.js → index-rKEUwjq8.js} +1 -1
- package/dist/client/assets/{index-BAaqQW-m.js → index-slBSiB-H.js} +1 -1
- package/dist/client/assets/{index-DgnJZ7RZ.js → index-vU7itvE8.js} +1 -1
- package/dist/client/assets/{index.esm-Dyd3JXuK.js → index.esm-DM8Bqi3n.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-CPcm-36U.js → infoDiagram-MVDRKAX5-C0p1eP9j.js} +1 -1
- package/dist/client/assets/{inline-code-BjkmgK0M.js → inline-code-CNmpgW3O.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-B8eVNEDQ.js → ishikawaDiagram-HPEHV2GE-COdxgYUT.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-CGkIGaMV.js → journeyDiagram-BOSHW7O7-C84Ny9n9.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-BTDbT6UJ.js → kanban-definition-FNSA4HC5-ECSXhFX0.js} +1 -1
- package/dist/client/assets/{layers-DyShcAgn.js → layers-JgRwJGyf.js} +1 -1
- package/dist/client/assets/{lightbulb-QljDqLq7.js → lightbulb-BhQB8sFP.js} +1 -1
- package/dist/client/assets/{link-2-7SoeCkEs.js → link-2-B4byjdgg.js} +1 -1
- package/dist/client/assets/{list-runtime-types-DvfLx6v2.js → list-runtime-types-M5_gxIg1.js} +1 -1
- package/dist/client/assets/{markdown-content-D7t62wwm.js → markdown-content-C3qWcii6.js} +1 -1
- package/dist/client/assets/{mention-pill-DNQ2ICCW.js → mention-pill-DUbgdKmA.js} +1 -1
- package/dist/client/assets/{mermaid.core-NAyHAvFm.js → mermaid.core-BQiwaVjZ.js} +4 -4
- package/dist/client/assets/{message-square-off-D6K1M95g.js → message-square-off-AjtFFe_u.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-26dEepZx.js → mindmap-definition-6OY57UG3-BfA6EqgP.js} +1 -1
- package/dist/client/assets/{more-details-BJ_2FYn8.js → more-details-itSF4Fah.js} +1 -1
- package/dist/client/assets/{owner-notice-CIfb2Yr7.js → owner-notice-B6JRjE_c.js} +1 -1
- package/dist/client/assets/{package-CeRLwc1u.js → package-5YQSitlR.js} +1 -1
- package/dist/client/assets/{page-container-D2J6eon9.js → page-container-DBPUOYYM.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-CXxva43c.js → pane-resize-handle-Kwb3zKa6.js} +1 -1
- package/dist/client/assets/{paperclip-DFuuQSWM.js → paperclip-IRKZTEQw.js} +1 -1
- package/dist/client/assets/{path-input-DhGxbEsh.js → path-input-BHkA4fFw.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-BJu6g9eg.js → pegDiagram-ECIUJNBX-CqIy9WDe.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-CMf8TQF7.js → pieDiagram-GNMPY74T-C5yI3cvV.js} +1 -1
- package/dist/client/assets/{plug-Bqwk5g66.js → plug-CupdBXaG.js} +1 -1
- package/dist/client/assets/{primer-trigger-NAz78FSN.js → primer-trigger-Ci_XRRfX.js} +2 -2
- package/dist/client/assets/{profile-errors--0_JG2R0.js → profile-errors-aEsWNifs.js} +1 -1
- package/dist/client/assets/{progress-cQRXQehb.js → progress-Bpmb837n.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-Bb92PcA9.js → quadrantDiagram-D57K4MC3-DyCDNvk7.js} +1 -1
- package/dist/client/assets/{query-error-state-C2QLFCgp.js → query-error-state-s6AJaHa3.js} +1 -1
- package/dist/client/assets/{radio-CBD2fSSB.js → radio-Ci6Ghks8.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-YN2siyto.js → railroadDiagram-Y72NRBL7-B3u1B937.js} +1 -1
- package/dist/client/assets/registry-DatwH4jj.js +1 -0
- package/dist/client/assets/registry-NGfn1R2_.js +34 -0
- package/dist/client/assets/{relay-trace-schemas-yWn__06J.js → relay-trace-schemas-hOFIzdY-.js} +2 -2
- package/dist/client/assets/{repeat-CtIEyxm4.js → repeat-B1S2ceC2.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-DJBQviv-.js → requirementDiagram-EQYSW5RA-CdG-unip.js} +1 -1
- package/dist/client/assets/{room-files-source-nnbGMKus.js → room-files-source-J7gnN1gx.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-C2jXtg-P.js → rotate-ccw-clock-7Q2akPFi.js} +1 -1
- package/dist/client/assets/{rotate-cw-34X3Kx8Z.js → rotate-cw-DK3Rzmlh.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-DH2qnwVI.js → sankeyDiagram-SY24JHO5-D3Z4Qk2b.js} +1 -1
- package/dist/client/assets/{scroll-area-DYTbXWMY.js → scroll-area-6Gelypei.js} +1 -1
- package/dist/client/assets/{search-x-DeFOvp_5.js → search-x-Be8VetKs.js} +2 -2
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-CkHcuOw2.js → sequenceDiagram-BLEHNHQU-RXPgeLr6.js} +1 -1
- package/dist/client/assets/{shield-x-bloGLifl.js → shield-x-D8lJ0Op0.js} +1 -1
- package/dist/client/assets/signed-in-NOeTLLso.js +1 -0
- package/dist/client/assets/{sizeCapture-INFHLROL-BXK-Cxjs.js → sizeCapture-INFHLROL-q7qki1pK.js} +1 -1
- package/dist/client/assets/{soul-file-DFPctfHR.js → soul-file-DTEcjDxP.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-DP_cqXJO.js → stateDiagram-v2-A6IESKWZ-DFs6IVbj.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-BZxkK7Fr.js → swimlanes-B3ENRKFQ-D1A-3JE-.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-hZFkkqUb.js +8 -0
- package/dist/client/assets/{table-B8zvHC0J.js → table-CuBPM_bg.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-BPZ64ADa.js → timeline-definition-JXYKGLGB-CLHy0rAb.js} +1 -1
- package/dist/client/assets/{trust-posture-C9r0jGhc.js → trust-posture-BXXe8F8n.js} +1 -1
- package/dist/client/assets/{unplug-DYZEcvkR.js → unplug-Cuej6sM6.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-DAhwNpy_.js → unverified-catalog-notice-BbK4SCJp.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-DrDMqxhZ.js → use-adapter-catalog-Cy7ENVZN.js} +1 -1
- package/dist/client/assets/{use-bindings-Ci7hpEO4.js → use-bindings-Tj0BcF4m.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-FpUdi_wE.js → use-composer-prefs-BrQVpwRi.js} +1 -1
- package/dist/client/assets/{use-connector-management-CinfkPZI.js → use-connector-management-CLZQXgln.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-DZnA4iYZ.js → use-deep-link-scroll-BeqtUhj2.js} +1 -1
- package/dist/client/assets/{use-delete-binding-DDtaCc3v.js → use-delete-binding-d7ii9iFQ.js} +1 -1
- package/dist/client/assets/{use-dev-links-CtHwhTBj.js → use-dev-links-MYOV3h2q.js} +1 -1
- package/dist/client/assets/{use-direct-message-panel-Da9rkfA3.js → use-direct-message-panel-C_lXDYnB.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-CikM-LiV.js → use-external-adapter-catalog-kMFSEJGV.js} +1 -1
- package/dist/client/assets/use-full-activity-feed-MFSkvnza.js +1 -0
- package/dist/client/assets/use-is-below-desktop-CJJ4zMQO.js +1 -0
- package/dist/client/assets/{use-local-browser-ABoWOGv1.js → use-local-browser-1oVtlmXD.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-C5njB0KY.js → use-mesh-topology-BJs6M6kh.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-Bp9Wp7zY.js → use-mounted-ref-DitdlmSI.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-DXww4pVV.js → use-notification-prefs-CXbRTRLF.js} +1 -1
- package/dist/client/assets/use-pending-read-CvX1lOb8.js +1 -0
- package/dist/client/assets/{use-personality-commit-DYQ3KVxd.js → use-personality-commit-DQrWyVGT.js} +1 -1
- package/dist/client/assets/{use-promo-activation-nURLgFxH.js → use-promo-activation-CgdBHk2f.js} +3 -3
- package/dist/client/assets/{use-promo-dismissals-BQkeHMCS.js → use-promo-dismissals-DprcDmfs.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-B8VeNnHj.js → use-pulse-freshness-BtMzHCs3.js} +1 -1
- package/dist/client/assets/{use-relay-config-D0BknsXK.js → use-relay-config-CGBlgXC2.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-BruRRf3z.js → use-room-follow-claim-Db5U7kWT.js} +1 -1
- package/dist/client/assets/{use-room-sessions-DGcrmZvE.js → use-room-sessions-K6mdH-Tb.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-YQ4MgIBO.js → use-roving-tab-list-B2zxa_F_.js} +1 -1
- package/dist/client/assets/{use-session-canvas-BaGypLR6.js → use-session-canvas-D4G5fO_a.js} +7 -7
- package/dist/client/assets/{use-status-budget-Q1ltHI80.js → use-status-budget-UccdTZ7o.js} +4 -4
- package/dist/client/assets/use-transform-BBj2pwbo.js +1 -0
- package/dist/client/assets/{use-unclaimed-chats-Bext8Aim.js → use-unclaimed-chats-BidDnyt8.js} +1 -1
- package/dist/client/assets/use-update-config-D8g4P42J.js +1 -0
- package/dist/client/assets/{useMutationState-C3WVn0hu.js → useMutationState-RYxTf1aD.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-Dg4P8nSr.js → usecaseDiagram-WPOLBNNX-Bjmcc2gK.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-B8Txoqsz.js → vennDiagram-Q3Y3IDCW-Cd6C9CxW.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-lgQBspKc.js → wardleyDiagram-IVAIDKWA-CzWWmwUL.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-Ct9-Lgo9.js → xychartDiagram-4URNHDU4-DSUn9rhA.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261025175042_dor3123_needs_attention.sql +7 -0
- package/dist/drizzle/meta/20261025175042_snapshot.json +14093 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/server/extension-child.cjs +188 -107
- package/dist/server/index.js +11572 -8338
- package/dist/server/index.js.map +2 -2
- package/package.json +7 -7
- package/dist/client/assets/ChannelComposer-WR3_Vvta.js +0 -44
- package/dist/client/assets/HandlePage-A1OCw0nr.js +0 -1
- package/dist/client/assets/NamePage-Du9m4rGe.js +0 -1
- package/dist/client/assets/NewDirectMessageMenu-CmCOFmXQ.js +0 -1
- package/dist/client/assets/OpenMeshSwitch-r6HJBjR6.js +0 -5
- package/dist/client/assets/PhotoPage-Dx-3Lhm5.js +0 -1
- package/dist/client/assets/RoomSurface-C_mTmn8g.js +0 -1
- package/dist/client/assets/RuntimeConnectFlow-BsZsQZS9.js +0 -1
- package/dist/client/assets/RuntimeSetupDialog-BSb5iK2A.js +0 -1
- package/dist/client/assets/SeenDevices-dzzlSeB2.js +0 -19
- package/dist/client/assets/SettingsDialog-5aEZ-DG6.js +0 -12
- package/dist/client/assets/TasksEmptyState-DityFi7P.js +0 -3
- package/dist/client/assets/TasksPage-BZx_Ku0k.js +0 -1
- package/dist/client/assets/UnreadDivider-CGKnJcx7.js +0 -1
- package/dist/client/assets/WorkView-wVnGvWAz.js +0 -63
- package/dist/client/assets/_shell._home.index-BB5pgiqt.js +0 -3
- package/dist/client/assets/_shell._home.tasks-B3w6mqyb.js +0 -1
- package/dist/client/assets/_shell.marketplace-BUh4boaf.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-CnOFcGv1.js +0 -1
- package/dist/client/assets/_shell.session-BUP7x_Ra.js +0 -1
- package/dist/client/assets/_shell.threads-gs_o48eZ.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-B-X7HuaQ.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-B-X7HuaQ.js +0 -1
- package/dist/client/assets/channel-C6IoQ0kc.js +0 -1
- package/dist/client/assets/image-lightbox-DgWS2xlv.js +0 -1
- package/dist/client/assets/image-off-DziiNcIl.js +0 -6
- package/dist/client/assets/index-B-KhOLHd.js +0 -1
- package/dist/client/assets/index-BpsATTKn.js +0 -1
- package/dist/client/assets/index-CP7hD01s.js +0 -1
- package/dist/client/assets/index-CUKvspHB.js +0 -1
- package/dist/client/assets/index-DSYz85aL.js +0 -1053
- package/dist/client/assets/index-DYF1ER90.js +0 -23
- package/dist/client/assets/index-DtlBeLQB.css +0 -1
- package/dist/client/assets/index-YtJ82pkp.js +0 -1
- package/dist/client/assets/registry-CsiY3fnM.js +0 -1
- package/dist/client/assets/signed-in-DD2qV0PJ.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-DXRZtHKX.js +0 -8
- package/dist/client/assets/use-full-activity-feed-B6TQc-xB.js +0 -1
- package/dist/client/assets/use-is-below-desktop-DJQVU5CF.js +0 -1
- package/dist/client/assets/use-panel-tab-placements-DLQeHI7w.js +0 -1
- package/dist/client/assets/use-pending-read-CgR0BnSW.js +0 -1
- package/dist/client/assets/use-update-config-BJEw2LjV.js +0 -1
- /package/dist/client/assets/{WorkView-DIs3GY4I.css → registry-DIs3GY4I.css} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var i_=Object.defineProperty;var s_=(r,e,t)=>e in r?i_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jt=(r,e,t)=>s_(r,typeof e!="symbol"?e+"":e,t);import{r as Xc,j as Kc}from"./index-
|
|
1
|
+
var i_=Object.defineProperty;var s_=(r,e,t)=>e in r?i_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jt=(r,e,t)=>s_(r,typeof e!="symbol"?e+"":e,t);import{r as Xc,j as Kc}from"./index-DwrBsA10.js";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-DwrBsA10.js";import{P as m}from"./ProfileFields-gZNaFBow.js";import"./profile-errors-aEsWNifs.js";import"./use-mounted-ref-DitdlmSI.js";function a({member:r}){return o.jsx(m,{member:r})}export{a as NamePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a1 as b,a3 as R,a4 as C,aP as x,a7 as P,eA as j,r as d,j as e,d2 as E,d3 as M,d5 as k,d6 as T,d7 as K,eB as L,em as B,I,aC as N,B as D,bz as F,bA as O,eC as Q,f as _,bB as q,bD as z,eD as H}from"./index-DwrBsA10.js";function w(t){return Promise.all([t.invalidateQueries({queryKey:x.lists()}),t.invalidateQueries({queryKey:x.details()}),t.invalidateQueries({queryKey:x.threads()})]).then(()=>{})}function A(t){return(t==null?void 0:t.code)==="SLUG_TAKEN"}function Y({isInlineErrorVisible:t}){const n=b(),r=R();return C({mutationFn:({title:a,agentPaths:l})=>n.createRoom({kind:"channel",title:a,members:[],agentPaths:l}),onSuccess:()=>w(r),meta:{suppressErrorToast:!0},onError:a=>{A(a)&&t()||P.error("Couldn’t create that channel.",{description:a.message})}})}function W(){const t=b(),n=R();return C({mutationFn:({agentPaths:r,title:a})=>t.createRoom({kind:"dm",title:a,members:[],agentPaths:r}),onSettled:()=>w(n),meta:{errorLabel:"Couldn’t start that DM"}})}const y=200;function X({open:t,onOpenChange:n,onCreated:r}){const a=j(),[l,m]=d.useState(""),h=d.useRef(null),c=d.useRef(null),u=d.useRef(!0);d.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const o=Y({isInlineErrorVisible:()=>u.current}),g=A(o.error)?o.error.message:null,f=l.trim(),p=f.length>0&&f.length<=y,v=s=>{!p||o.isPending||o.mutate({title:f,agentPaths:s.map(i=>i.agentPath)},{onSuccess:i=>{n(!1),r(i)}})},S=s=>{var i;s.key==="Enter"&&(s.preventDefault(),p&&((i=c.current)==null||i.focus()))};return e.jsx(E,{open:t,onOpenChange:n,children:e.jsxs(M,{className:"sm:max-w-md",onOpenAutoFocus:s=>{var i;s.preventDefault(),(i=h.current)==null||i.focus()},children:[e.jsxs(k,{children:[e.jsx(T,{children:"New channel"}),e.jsx(K,{children:"Name it, then pick who’s in it."})]}),e.jsxs(L,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"channel-name",children:"Channel name"}),e.jsx(I,{ref:h,id:"channel-name",value:l,maxLength:y,placeholder:"Backend",autoComplete:"off",onChange:s=>{m(s.target.value),o.error&&o.reset()},onKeyDown:S,"aria-invalid":g?!0:void 0,"aria-describedby":g?"channel-name-error":void 0}),g&&e.jsx("p",{id:"channel-name-error",role:"alert",className:"text-destructive text-xs",children:g})]}),e.jsxs("section",{"aria-label":"Agents in this channel",className:"space-y-2 border-t pt-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Who’s in it"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Agents read everything here and reply when @mentioned."}),e.jsx(N,{roster:a,onSubmit:v,submitLabel:s=>s.length===0?"Create channel":s.length===1?"Create channel with 1 agent":`Create channel with ${s.length} agents`,emptyRosterMessage:"You don’t have any agents yet. You can add them to the channel later.",allChosenMessage:"That’s every agent you have.",isSubmitting:o.isPending,submitDisabled:!p,inputRef:c})]}),e.jsx("div",{className:"flex justify-center border-t pt-3",children:e.jsx(D,{type:"button",variant:"ghost",size:"sm",disabled:!p||o.isPending,onClick:()=>v([]),children:"Create it without agents"})})]})]})})}const G="One agent opens a chat. Two or more start a group message.";function V(t){return t.length===1}function $(t){const n=t[0];return n!==void 0&&V(t)?`Open chat with ${n.displayName}`:"Start group message"}function J({onStart:t,open:n,onOpenChange:r,hideTrigger:a=!1}){const l=j(),m=d.useRef(null),h=()=>{r(!1),H.getState().open()};return e.jsxs(F,{open:n,onOpenChange:r,modal:!0,fullHeight:!0,children:[e.jsx(O,{asChild:!0,children:e.jsx(Q,{...a?{"aria-hidden":!0,tabIndex:-1,className:"sr-only"}:{"aria-label":"New message"},children:e.jsx(_,{})})}),e.jsxs(q,{side:"right",align:"start",className:"flex w-64 flex-col p-2","aria-label":"New message",onOpenAutoFocus:c=>{var u;c.preventDefault(),(u=m.current)==null||u.focus()},children:[e.jsx(z,{children:"New message"}),e.jsx(N,{inputRef:m,roster:l,onSubmit:c=>{r(!1),t(c)},submitLabel:$,emptyRosterMessage:"You don’t have any agents yet.",emptyRosterAction:e.jsx(D,{type:"button",size:"sm",variant:"outline",onClick:h,children:"Create agent"}),allChosenMessage:"Everyone is already here."}),e.jsx("p",{className:"text-muted-foreground mt-2 shrink-0 px-2 text-xs",children:G})]})]})}export{X as C,J as N,G as O,V as a,$ as o,W as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,w as s}from"./index-
|
|
1
|
+
import{j as t,w as s}from"./index-DwrBsA10.js";function o({member:e}){var n;const i=((n=e.agent)==null?void 0:n.manifestId)??null;return i===null?t.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-notifications",children:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Notifications are set per agent."})}):t.jsx("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-notifications",children:t.jsx(s,{lens:{agentId:i},emptyLabel:`${e.displayName} has not told you anything yet.`})})}export{o as NotificationsPage};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{eR as A,r as f,eS as k,eT as K,a1 as p,a2 as R,a3 as m,a4 as S,eU as M,j as d,eV as v,c$ as _,G as j}from"./index-DwrBsA10.js";import{u as w}from"./use-mesh-topology-BJs6M6kh.js";const O={activeWithinMs:3600*1e3,inactiveAfterMs:10080*60*1e3};function P(e){if(e.liveKinds.includes("pendingApproval")||e.liveKinds.includes("error")||e.hasBrokenExecutionConfig===!0)return"needs-attention";if(e.liveKinds.includes("streaming"))return"active";if(e.lastActivityAt===null)return"fresh";if(e.now-e.lastActivityAt<=O.activeWithinMs)return"active";const s=Math.max(e.lastActivityAt,e.lastInteractionAt??e.lastActivityAt);return e.now-s>O.inactiveAfterMs?"inactive":"idle"}function x(e,t,s){var a;const n=new Map;for(const[i,o]of Object.entries(e)){if(!s.has(o))continue;const r=K((a=t[i])==null?void 0:a.lifecycle);if(!r)continue;const c=n.get(o);c?c.push(r):n.set(o,[r])}return n}const q=Object.freeze({});function B(e,t=[],s=q){const n=e.join(`
|
|
2
|
+
`),a=t.join(`
|
|
3
|
+
`),i=A(f.useCallback(u=>u.statusCwds,[])),o=A(f.useCallback(u=>u.statuses,[])),{data:r}=k(),c=r==null?void 0:r.agentActivity;return f.useMemo(()=>{const u=n.length===0?[]:n.split(`
|
|
4
|
+
`),N=new Set(a.length===0?[]:a.split(`
|
|
5
|
+
`)),b=x(i,o,new Set(u)),T=Date.now(),y={};for(const l of u){const g=c==null?void 0:c[l];y[l]=P({liveKinds:b.get(l)??[],lastActivityAt:g?new Date(g).getTime():null,lastInteractionAt:s[l]??null,now:T,hasBrokenExecutionConfig:N.has(l)})}return y},[n,a,i,o,c,s])}function G(e){const t=p();return R({queryKey:["mesh","agent-health",e],queryFn:()=>t.getMeshAgentHealth(e),enabled:e!==null})}const h=["mesh","topology"];function U(){const e=p(),t=m();return S({mutationFn:s=>e.updateMeshAccessRule(s),onSuccess:()=>{t.invalidateQueries({queryKey:h})}})}function E(){const e=p(),t=m();return S({mutationFn:s=>e.updateMeshAccessRule({sourceNamespace:M,targetNamespace:M,action:s?"allow":"deny"}),onMutate:async s=>{await t.cancelQueries({queryKey:h});const n=t.getQueriesData({queryKey:h});return t.setQueriesData({queryKey:h},a=>a&&{...a,openMesh:s}),{previous:n}},onError:(s,n,a)=>{for(const[i,o]of(a==null?void 0:a.previous)??[])t.setQueryData(i,o)},onSettled:()=>{t.invalidateQueries({queryKey:h})}})}const C="Let all my agents talk to each other",L="On: any agent can message any other. Off: same project, plus pairs below.",D="New agents reach only their own project. Change it later in Team → Access.";function H({checked:e,onCheckedChange:t,disabled:s,className:n}){return d.jsx(v,{label:C,description:L,checked:e,onCheckedChange:t,disabled:s,className:n})}function Q({checked:e,onCheckedChange:t,disabled:s,className:n}){return d.jsx(v,{label:C,description:D,checked:e,onCheckedChange:t,disabled:s,className:j("bg-muted/40 rounded-xl px-4 py-3",n)})}function W(){const{data:e}=w(),{mutate:t,isPending:s}=E();return d.jsx(H,{checked:(e==null?void 0:e.openMesh)??!1,onCheckedChange:t,disabled:s})}function Y({className:e}){const{data:t}=w(),{data:s}=_(),{mutate:n,isPending:a}=E(),i=((s==null?void 0:s.agents)??[]).filter(o=>!o.isSystem).length;return(t==null?void 0:t.openMesh)!==!1||i===0?null:d.jsx(Q,{checked:!1,onCheckedChange:n,disabled:a,className:e})}export{W as O,U as a,G as b,Y as c,B as u};
|
package/dist/client/assets/{OperatorIdentityForm-B29T-N9x.js → OperatorIdentityForm-BRKAQS0D.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bj as j,
|
|
1
|
+
import{bj as j,fu as F,fv as H,aY as x,r as p,cc as P,cg as B,co as w,fw as Y,a1 as D,a2 as G,c1 as K,bY as M,fx as q,z,bk as W,j as i,em as N,I as R,B as A}from"./index-DwrBsA10.js";import{d as Q,c as U,n as V,h as J}from"./profile-errors-aEsWNifs.js";import{u as X}from"./use-mounted-ref-DitdlmSI.js";import{u as L,F as k}from"./ProfileFields-gZNaFBow.js";function Z(e){return{name:e.displayName.trim()===""||e.displayName===j,handle:!e.handle}}function de(e){const r=Z(e);return r.name||r.handle}function $(e,r){var t,s,d;const a=(d=(s=(t=e.person)==null?void 0:t.email)==null?void 0:s.split("@")[0])==null?void 0:d.trim();if(!a)return"";const o=new Set([...F,...r.filter(l=>l.id!==e.id&&l.handle).map(l=>l.handle.toLowerCase())]);return H(a,o)??""}function ue(){const e=x(a=>a.setRightPanelOpen),r=x(a=>a.setActiveRightPanelTab);p.useEffect(()=>{const a=o=>{if((o.metaKey||o.ctrlKey)&&o.shiftKey&&o.key==="A"){o.preventDefault();const{rightPanelOpen:t,activeRightPanelTab:s}=x.getState();t&&s===P?e(!1):(r(P),e(!0))}};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,r])}const ee="agent-hub",te={sessions:"sessions",tasks:"tasks",tools:"tools",channels:"rooms",config:null,toolkit:null,identity:null,overview:null,profile:null,personality:null};function ae(e){return(typeof e=="string"?te[e]:null)??void 0}const I=new Set(["identity","personality","channels","tools"]);function ne(){var n;const e=w(),r=D(),a=G({queryKey:["profile-location",e.profileRef],queryFn:()=>r.getSessionLocation(e.profileRef),enabled:!!e.profileRef}),o=K(m=>m.openProfileDockedFromLink),t=x(m=>m.requestRightPanel),s=x(m=>m.setExplicitAgentPath),d=M(),l=e.panel===P,c=e.agentPath??((n=a.data)==null?void 0:n.cwd)??null,u=q(e.profilePage)??void 0,h=p.useRef(null);p.useEffect(()=>{!l&&c&&h.current!==c&&(h.current=c,s(c))},[l,c,s]);const f=p.useRef(new Map);p.useEffect(()=>{if(!l){f.current.clear();return}if(e.profileRef&&!c)return;const m=c??d;if(m){const g=f.current.get(m);if(g!==void 0&&(u===void 0||g.has(u)))return;f.current.set(m,(g??new Set).add(u??"")),o(m,u);return}t(P,null)},[l,e.profileRef,c,d,u,o,t])}function se(){const e=w(),r=Y(),a=D(),o=e.panel===ee,t=e.dialog==="agent"||!!e.agent&&I.has(e.agent),s=o||t,d=o?e.hubTab:e.agent;p.useEffect(()=>{if(!s&&!e.agentPath||!r)return;let l=!1;return(async()=>{const u=e.profileRef??(e.agentPath?(await a.createSessionLocation(e.agentPath)).id:void 0);if(l)return;const h=ae(d);r({search:f=>{const n={...f};return e.dialog==="agent"&&delete n.dialog,typeof n.agent=="string"&&I.has(n.agent)&&delete n.agent,u&&(n.profileRef=u,delete n.agentPath),s&&(delete n.hubTab,n.panel=P,h?n.profilePage=h:delete n.profilePage),n},replace:!0})})().catch(()=>{}),()=>{l=!0}},[s,e.dialog,e.agentPath,e.profileRef,d,r,a])}function fe(){se(),ne(),B()}function re(){var S,b;const r=((S=z().data)==null?void 0:S.members)??[],a=r.find(v=>v.isSelf),o=X(),t=Q({isShownInline:()=>o.current}),s=U({isShownInline:()=>o.current}),[d,l]=p.useState(!1),c=!a||a.displayName===j?"":a.displayName,u=(a==null?void 0:a.handle)??"",[h,f]=L(c),[n,m]=L(a?u||$(a,r):""),g=h.trim(),y=n.trim(),E=a?W(a):null,T=g.length>0&&(g!==c||E!==null),C=t.isError&&t.variables===g?V(t.error):null,O=s.isError&&((b=s.variables)==null?void 0:b.handle)===y?J(s.error,y):null,_=async()=>{if(!a)return!1;l(!0);let v=!0;return T&&(v=await t.mutateAsync(g).then(()=>v,()=>!1)),y&&y!==u&&(v=await s.mutateAsync({authorId:a.id,handle:y}).then(()=>v,()=>!1)),l(!1),v};return{ready:a!==void 0,name:h,setName:f,handle:n,setHandle:m,canSave:a!==void 0&&!d&&(g.length>0||y.length>0),saving:d,nameError:C,nameSuggestion:E!==null&&g===c?E:null,handleError:O,save:_}}function he({onSaved:e,confirmLabel:r="Save",onSkip:a,skipLabel:o="Skip"}){const t=re(),s=p.useId(),d=p.useId(),l=p.useId(),c=f=>{f.preventDefault(),t.canSave&&t.save().then(n=>{n&&e()})},u=t.nameError!==null||t.handleError!==null;let h=r;return t.saving?h="Saving…":u&&(h="Try again"),i.jsxs("form",{onSubmit:c,className:"flex flex-col gap-3","data-testid":"operator-identity-form",children:[i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(N,{htmlFor:s,className:"text-xs",children:"Your name"}),i.jsx(R,{id:s,value:t.name,maxLength:80,autoComplete:"name",placeholder:"What you go by",disabled:!t.ready,onChange:f=>t.setName(f.target.value),className:"h-8 text-sm"}),t.nameSuggestion&&!t.nameError&&i.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.nameSuggestion,". Save it to make it yours."]}),t.nameError&&i.jsx(k,{tone:"error",children:t.nameError})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(N,{htmlFor:d,className:"text-xs",children:"Handle"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{"aria-hidden":!0,className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-sm",children:"@"}),i.jsx(R,{id:d,value:t.handle,maxLength:64,autoComplete:"username",autoCapitalize:"none",spellCheck:!1,placeholder:"yourname","aria-describedby":l,disabled:!t.ready,onChange:f=>t.setHandle(f.target.value),className:"h-8 pl-6 text-sm"})]}),i.jsx("p",{id:l,className:"text-muted-foreground text-xs",children:"What others type after @ to reach you."}),t.handleError&&i.jsx(k,{tone:"error",children:t.handleError})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(A,{type:"submit",size:"sm",disabled:!t.canSave,"data-testid":"confirm-identity",children:h}),a&&i.jsx(A,{type:"button",size:"sm",variant:"ghost",onClick:a,disabled:t.saving,"data-testid":"skip-identity",children:o})]})]})}export{he as O,ne as a,fe as b,ue as c,de as i,se as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,gi as A,gj as P,G as k,gQ as Y,a1 as E,a2 as q,hb as R,r as N,a3 as Z,a4 as ee,au as se,ba as te,B as x,hM as v,bz as W,bA as L,C as U,bB as D,bD as M,T as ne,hd as g,hN as w,hj as B,hk as _,e as C,b8 as ae,hO as ie,hP as le,hQ as re}from"./index-DSYz85aL.js";import{u as y,c as oe,a as p,l as H,S as f,P as b,s as z,d as T,r as j,f as $,b as K,e as S,g as de,A as ce}from"./ApplyToOverridesDialog-BqaoB6AS.js";const I=[{value:"blocked",label:"Blocked"},{value:"ask",label:"Ask"},{value:"allowed",label:"Allowed"}];function Q({value:e,onChange:t,floor:n=!1,disabled:a=!1,className:l,"aria-label":o}){const d=n?I.filter(i=>i.value!=="allowed"):I;return s.jsx(A,{"aria-label":o,value:e??"",onValueChange:i=>t(i),disabled:a,className:k("w-full md:w-auto",l),children:d.map(i=>s.jsx(P,{value:i.value,className:k(Y,"md:min-h-0 md:min-w-16"),children:i.label},i.value))})}function ue(e){const t=E();return q({queryKey:R.agent(e??""),queryFn:()=>t.getAgentPermissions(e),enabled:!!e})}function me(e){const{data:t}=y();return N.useMemo(()=>{const n=new Map;for(const a of(t==null?void 0:t.exceptions)??[]){if(a.area!==e)continue;const l=n.get(a.agentId);(!l||l.action&&!a.action)&&n.set(a.agentId,a)}return[...n.values()]},[t,e])}function he(e){const t=E();return q({queryKey:R.history(e),queryFn:()=>t.getPermissionHistory(e?{agentId:e,limit:50}:{limit:50})})}function xe(e){var n;const t=e;return(t==null?void 0:t.code)!=="UNDO_CONFLICT"?null:((n=t.body)==null?void 0:n.conflicts)??[]}function fe(){const e=E(),t=Z();return ee({mutationFn:({eventId:n,force:a})=>e.undoPermissionChange(n,a?{force:!0}:{}),meta:{suppressErrorToast:!0},onSettled:()=>{t.invalidateQueries({queryKey:R.all}),t.invalidateQueries({queryKey:["mesh","agents"]}),t.invalidateQueries({queryKey:se.all})}})}function F(e){const{data:t}=y();return t?oe(t,e):void 0}function V({areaId:e,label:t,description:n,floor:a,value:l,sourceText:o,why:d,changed:i=!1,onChange:m,onReset:r,disabled:u=!1,footer:c,details:h}){return s.jsxs("div",{className:"@container","data-testid":`permission-row-${e}`,children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[i?s.jsx("span",{className:"bg-primary size-1.5 shrink-0 rounded-full","aria-label":"Set differently for this agent",role:"img"}):null,s.jsx("span",{className:"text-sm font-medium",children:t}),a?s.jsx(te,{className:"text-muted-foreground size-3.5","aria-label":"Never Allowed"}):null]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:n}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:o}),d?s.jsxs(s.Fragment,{children:[o?" · ":null,d]}):null]})]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(Q,{value:l,onChange:m,floor:a,disabled:u,"aria-label":t}),i&&r?s.jsxs(x,{variant:"ghost",size:"sm",className:"self-start @lg:self-end",onClick:r,disabled:u,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset to default"]}):null,c]})]}),h]})}function ge({area:e,exception:t}){const n=p({kind:"agent",agentId:t.agentId}),a=()=>n.mutate({kind:"patch",...t.action?{actions:{[t.action]:null}}:{areas:{[e]:null}},surface:"settings"}),l=H(t.lastChange);return s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"min-w-0 text-sm",children:[s.jsxs("span",{className:"block break-words",children:[t.agentName,": ",f[t.state],t.action?" (one action)":""]}),l?s.jsx("span",{className:"text-muted-foreground block text-xs",children:l}):null]}),s.jsxs(x,{variant:"ghost",size:"sm",onClick:a,disabled:n.isPending,"aria-label":`Reset ${t.agentName} to the default`,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]})]})}function pe({area:e,areaLabel:t,agents:n}){if(n.length===0)return null;const a=n.length===1?"1 agent differs":`${n.length} agents differ`;return s.jsxs(W,{children:[s.jsx(L,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start md:self-end",children:[a,s.jsx(U,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsxs(M,{className:"text-sm font-medium",children:["Set differently for ",t]}),s.jsx("ul",{className:"space-y-1",children:n.map(l=>s.jsx(ge,{area:e,exception:l},l.agentId))})]})]})}function G(e,t){return e.resolved.source===(t.kind==="agent"?"agent-action":"default-action")}function J({action:e,preset:t,agentName:n}){const a=f[e.resolved.state];return s.jsx(b,{question:`Why is ${e.title} set to ${a}${n?` for ${n}`:""}?`,sentence:z({...e.resolved,preset:t,fromExtension:e.source!==void 0}),...e.lastChange?{lastChange:e.lastChange}:{}})}function je({action:e,area:t,scope:n,preset:a,agentName:l,disabled:o,reset:d,onSave:i}){const m=G(e,n),r=F({kind:"action",action:e.id,area:t.id}),u=m?"Set on its own":e.alwaysAsks?e.source?"Always asks: an extension tool that can delete things":"Always asks, so you see the change first":e.resolved.destructiveAsk?"Always asks unless you set it here":`Follows ${t.label}`,c=n.kind==="default"&&r!==void 0?T(r):null;return s.jsxs("li",{className:"flex flex-col gap-2 py-2 @md:flex-row @md:items-center @md:justify-between","data-testid":`permission-action-${e.id}`,children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm",children:e.title}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.source?s.jsxs("span",{children:["From ",e.source.name," · "]}):null,s.jsx("span",{children:u}),c?s.jsxs("span",{children:[" · ",c]}):null," ·"," ",s.jsx(J,{action:e,preset:a,...l?{agentName:l}:{}})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[m?d:null,s.jsx(Q,{value:e.resolved.state,floor:t.floor||e.alwaysAsks===!0,disabled:o,"aria-label":e.title,onChange:h=>{h!==e.resolved.state&&i(h)}})]})]})}function X({scope:e,area:t,surface:n,preset:a,agentName:l}){const o=p(e),[d,i]=N.useState(!1);if(t.actions.length===0)return null;const m=t.actions.filter(c=>G(c,e)),r=(c,h)=>o.mutate({kind:"patch",actions:{[c.id]:h},surface:n},{onError:j}),u=c=>s.jsxs(x,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs",disabled:o.isPending,"aria-label":`Put ${c.title} back to ${t.label}`,onClick:()=>r(c,null),children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]});return s.jsxs("div",{className:"flex flex-col items-start gap-1 pb-3","data-testid":`permission-actions-${t.id}`,children:[!d&&m.length>0?s.jsx("ul",{className:"w-full space-y-1","data-testid":`permission-action-exceptions-${t.id}`,children:m.map(c=>s.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:"text-muted-foreground min-w-0",children:[s.jsxs("span",{children:["Except ",c.title,": ",f[c.resolved.state]]})," ","·"," ",s.jsx(J,{action:c,preset:a,...l?{agentName:l}:{}})]}),u(c)]},c.id))}):null,s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground -ml-2 h-7 px-2 text-xs","aria-expanded":d,onClick:()=>i(c=>!c),children:[s.jsx(ne,{className:k("size-3.5 transition-transform",d&&"rotate-180"),"aria-hidden":!0}),d?"Hide individual actions":"Show individual actions"]}),d?s.jsx("ul",{className:"divide-border w-full divide-y","aria-label":`${t.label} actions`,children:t.actions.map(c=>s.jsx(je,{action:c,area:t,scope:e,preset:a,...l?{agentName:l}:{},disabled:o.isPending,reset:u(c),onSave:h=>r(c,h)},c.id))}):null]})}function Ne({agentId:e,agentName:t,files:n}){const a=p({kind:"agent",agentId:e}),l=n.source==="agent",o=n.inherited.stop,d=n.stop,i=r=>a.mutate({kind:"patch",filesAndCommands:r,surface:"agent-page"},{onError:j}),m=o?`${l?`Everyone else: ${g(o)}`:`Same as everyone (${g(o)})`}${n.inherited.source==="runtime"?` · ${$("runtime")}`:""}`:$(n.inherited.source);return s.jsxs("div",{className:"@container","data-testid":"permission-row-files",children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[l?s.jsx("span",{className:"bg-primary size-1.5 shrink-0 rounded-full","aria-label":"Set differently for this agent",role:"img"}):null,s.jsx("span",{className:"text-sm font-medium",children:"Files & commands"})]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Editing files and running commands in this agent’s chats"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:m})," ·"," ",s.jsx(b,{question:`Why is Files & commands ${d?`set to ${g(d)}`:"not set"} for ${t}?`,sentence:K(d,n.source),...n.lastChange?{lastChange:n.lastChange}:{}})]})]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(A,{"aria-label":"Files & commands",className:"w-full @lg:w-auto",value:d??"",disabled:a.isPending,onValueChange:r=>{r&&r!==d&&i(r)},children:w.map(r=>s.jsxs(P,{value:r.id,"aria-label":r.label,children:[s.jsx(B,{descriptor:r,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:r.label})]},r.id))}),l?s.jsxs(x,{variant:"ghost",size:"sm",className:"self-start @lg:self-end",onClick:()=>i(null),disabled:a.isPending,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset to default"]}):null]})]}),s.jsx(_,{descriptor:w.find(r=>r.stop===d),className:"pb-3"})]})}function Re({files:e,preset:t,onChange:n,disabled:a=!1,runtimeLabel:l=o=>o}){const o=F({kind:"files"}),d=e.stop===null?$("runtime-own"):e.stop===e.presetStop?`From ${S[t??"trusted"]}`:"Changed from your preset";return s.jsxs("div",{className:"@container","data-testid":"permission-row-files",children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("span",{className:"text-sm font-medium",children:"Files & commands"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Editing files and running commands"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:[d,o!==void 0?T(o):""].filter(Boolean).join(" · ")})," ","·"," ",s.jsx(b,{question:`Why is Files & commands ${e.stop?`set to ${g(e.stop)}`:"not set"}?`,sentence:K(e.stop,e.stop===null?"runtime-own":"default"),...e.lastChange?{lastChange:e.lastChange}:{}})]}),e.runtimes.map(i=>s.jsxs("p",{className:"text-muted-foreground text-xs",children:[l(i.runtime)," starts at ",g(i.stop)," (Settings → Runtimes)"]},i.runtime))]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(A,{"aria-label":"Files & commands",className:"w-full @lg:w-auto",value:e.stop??"",disabled:a,onValueChange:i=>{i&&i!==e.stop&&n(i)},children:w.map(i=>s.jsxs(P,{value:i.id,"aria-label":i.label,children:[s.jsx(B,{descriptor:i,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:i.label})]},i.id))}),s.jsx(be,{agents:e.exceptions})]})]}),s.jsx(_,{descriptor:w.find(i=>i.stop===e.stop),className:"pb-3"})]})}function ve({agent:e}){const t=p({kind:"agent",agentId:e.agentId}),n=H(e.lastChange);return s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"min-w-0 text-sm",children:[s.jsxs("span",{className:"block break-words",children:[e.agentName,": ",g(e.stop)]}),n?s.jsx("span",{className:"text-muted-foreground block text-xs",children:n}):null]}),s.jsxs(x,{variant:"ghost",size:"sm",disabled:t.isPending,"aria-label":`Reset ${e.agentName} to the default`,onClick:()=>t.mutate({kind:"patch",filesAndCommands:null,surface:"settings"},{onError:j}),children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]})]})}function be({agents:e}){return e.length===0?null:s.jsxs(W,{children:[s.jsx(L,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start @lg:self-end",children:[e.length===1?"1 agent differs":`${e.length} agents differ`,s.jsx(U,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsx(M,{className:"text-sm font-medium",children:"Set differently for Files & commands"}),s.jsx("ul",{className:"space-y-1",children:e.map(t=>s.jsx(ve,{agent:t},t.agentId))})]})]})}function O(e){return e.filter(t=>t.kind==="state")}function we({area:e,overview:t}){const n=p({kind:"default"}),a=me(e.id),l=F({kind:"area",area:e.id})??0,[o,d]=N.useState(null),i=(r,u)=>{n.mutate({kind:"patch",areas:{[e.id]:r},...u&&u.length>0?{applyToAgents:u}:{},surface:"settings"},{onError:j,onSettled:()=>d(null)})},m=r=>{r!==e.resolved.state&&(a.length>0?d(r):i(r))};return s.jsxs(s.Fragment,{children:[s.jsx(V,{areaId:e.id,label:e.label,description:e.description,floor:e.floor,value:e.resolved.state,sourceText:[de(e.resolved.source,t.preset),T(l)].filter(Boolean).join(" · "),why:s.jsx(b,{question:`Why is ${e.label} set to ${f[e.resolved.state]}?`,sentence:z({...e.resolved,preset:t.preset}),...e.lastChange?{lastChange:e.lastChange}:{}}),onChange:m,disabled:n.isPending,footer:s.jsx(pe,{area:e.id,areaLabel:e.label,agents:a}),details:s.jsx(X,{scope:{kind:"default"},area:e,surface:"settings",preset:t.preset})}),s.jsx(ce,{open:o!==null,onCancel:()=>d(null),subject:e.label,next:o??"ask",agents:a.map(r=>({agentId:r.agentId,agentName:r.agentName,detail:`${f[r.state]}${r.action?" (one action)":""}`})),affectedCount:l,onKeep:()=>o&&i(o),onUpdate:r=>o&&i(o,r),pending:n.isPending})]})}function ye({agentId:e,agentName:t,area:n}){var r;const a=((r=y().data)==null?void 0:r.preset)??null,l=p({kind:"agent",agentId:e}),o=n.resolved.source==="agent-area"||n.resolved.source==="agent-action",d=o?`Everyone else: ${f[n.inherited.state]}`:`Same as everyone (${f[n.inherited.state]})`,i=n.changedOutsideAt?`Changed outside DorkOS · ${d}`:d,m=u=>l.mutate({kind:"patch",areas:{[n.id]:u},surface:"agent-page"},{onError:j});return s.jsx(V,{areaId:n.id,label:n.label,description:n.description,floor:n.floor,value:n.resolved.state,sourceText:i,why:s.jsx(b,{question:`Why is ${n.label} set to ${f[n.resolved.state]} for ${t}?`,sentence:z({...n.resolved,preset:a}),...n.lastChange?{lastChange:n.lastChange}:{}}),changed:o,onChange:u=>{u!==n.resolved.state&&m(u)},onReset:()=>m(null),disabled:l.isPending,details:s.jsx(X,{scope:{kind:"agent",agentId:e},area:n,surface:"agent-page",preset:a,agentName:t})})}function ze({scope:e}){const t=y(),n=ue(e.kind==="agent"?e.agentId:void 0);return e.kind==="default"?t.isError?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read the permissions."}):t.data?s.jsx("div",{className:"divide-border divide-y","data-testid":"permission-list-default",children:O(t.data.areas).map(a=>s.jsx(we,{area:a,overview:t.data},a.id))}):s.jsx(C,{className:"h-20 w-full"}):n.isError?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s permissions."}):n.data?s.jsxs("div",{className:"divide-border divide-y","data-testid":"permission-list-agent",children:[s.jsx(Ne,{agentId:e.agentId,agentName:n.data.agentName,files:n.data.filesAndCommands}),O(n.data.areas).map(a=>s.jsx(ye,{agentId:e.agentId,agentName:n.data.agentName,area:a},a.id))]}):s.jsx(C,{className:"h-20 w-full"})}function ke(e,t){if(t.key.kind==="chat")return ie(e);if(t.key.kind==="account")return le(e);if(e===null)return t.target.kind==="agent"?"the default":"the preset";switch(t.key.kind){case"files":return Ce(e)?g(e):e;case"preset":return e in S?S[e]:e;default:return e in f?f[e]:e}}function Ce(e){return re.includes(e)}function $e(e){if(e.length===1){const{change:t}=e[0];return`This has changed since. Set it back to ${ke(t.before,t)} anyway?`}return"Some of this has changed since. Set it all back anyway?"}function Se(e){if(e.suggestionRestored)return null;if(e.changes.length===0&&e.skipped.length===0)return"Nothing to undo. It was already back.";if(e.skipped.length===0)return null;const t=e.changes.length,n=`Undid ${t} ${t===1?"change":"changes"}.`,a=e.skipped.filter(i=>i.reason==="changed-since").length,l=e.skipped.filter(i=>i.reason==="floor").length,o=e.skipped.filter(i=>i.reason==="gone").length,d=[];if(a>0&&d.push(`${a} had changed since and ${a===1?"was":"were"} left alone.`),l>0&&d.push(`${l} can’t be set to Allowed and ${l===1?"was":"were"} left alone.`),o>0&&d.push(`${o} ${o===1?"was about an agent":"were about agents"} no longer here.`),d.length>1){const i=e.skipped.length;return`${n} ${i} ${i===1?"was":"were"} left alone.`}return[n,...d].join(" ")}function Ae({item:e}){const t=fe(),[n,a]=N.useState(null),[l,o]=N.useState(null),d=e.undone,i=e.undoable&&!d,m=ae(e.occurredAt),r=u=>t.mutate({eventId:e.id,...u?{force:!0}:{}},{onSuccess:c=>{a(null),o(Se(c))},onError:c=>{const h=xe(c);h?a(h):j(c)}});return s.jsxs("li",{className:"space-y-1","data-testid":"permission-history-row",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0 space-y-0.5",children:[s.jsx("p",{className:"text-sm",children:e.summary}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.actorLabel," · ",m]}),e.actorDetail?s.jsx("p",{className:"text-muted-foreground text-xs",children:e.actorDetail}):null]}),d?s.jsx("span",{className:"text-muted-foreground shrink-0 pt-0.5 text-xs",children:"Undone"}):i&&n===null?s.jsx(x,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs",disabled:t.isPending,"aria-label":`Undo: ${e.summary}, ${m}`,onClick:()=>r(!1),children:"Undo"}):null]}),n!==null?s.jsxs("div",{role:"group","aria-label":"Undo conflict",className:"bg-muted/50 flex flex-col gap-2 rounded-md p-2 @md:flex-row @md:items-center @md:justify-between",children:[s.jsx("p",{className:"text-sm",children:$e(n)}),s.jsxs("div",{className:"flex shrink-0 gap-2",children:[s.jsx(x,{variant:"outline",size:"sm",disabled:t.isPending,onClick:()=>a(null),children:"Cancel"}),s.jsx(x,{size:"sm",disabled:t.isPending,onClick:()=>r(!0),children:"Set it back"})]})]}):null,l?s.jsx("p",{className:"text-muted-foreground text-xs",role:"status",children:l}):null]})}function Te({agentId:e}){const{data:t,isPending:n,isError:a}=he(e);if(a)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read the history."});if(n)return s.jsx(C,{className:"h-12 w-full"});const l=(t==null?void 0:t.items)??[];return l.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No permission changes yet."}):s.jsx("ul",{className:"@container space-y-3","aria-label":"Permission history",children:l.map(o=>s.jsx(Ae,{item:o},o.id))})}export{Re as D,ze as P,Te as a};
|
|
1
|
+
import{j as s,hn as A,ho as P,G as k,gm as Y,a1 as E,a2 as W,gK as R,r as N,a3 as Z,a4 as ee,aI as se,ba as te,B as x,hS as v,bz as q,bA as U,C as L,bB as D,bD as M,U as ne,gM as g,hT as w,gS as B,gT as K,e as C,b8 as ae,hU as ie,hV as le,hW as re}from"./index-DwrBsA10.js";import{u as y,c as oe,a as p,l as _,S as f,P as b,s as z,d as T,r as j,f as $,b as H,e as S,g as de,A as ce}from"./ApplyToOverridesDialog-C-XL9N4W.js";const I=[{value:"blocked",label:"Blocked"},{value:"ask",label:"Ask"},{value:"allowed",label:"Allowed"}];function Q({value:e,onChange:t,floor:n=!1,disabled:a=!1,className:l,"aria-label":o}){const d=n?I.filter(i=>i.value!=="allowed"):I;return s.jsx(A,{"aria-label":o,value:e??"",onValueChange:i=>t(i),disabled:a,className:k("w-full md:w-auto",l),children:d.map(i=>s.jsx(P,{value:i.value,className:k(Y,"md:min-h-0 md:min-w-16"),children:i.label},i.value))})}function ue(e){const t=E();return W({queryKey:R.agent(e??""),queryFn:()=>t.getAgentPermissions(e),enabled:!!e})}function me(e){const{data:t}=y();return N.useMemo(()=>{const n=new Map;for(const a of(t==null?void 0:t.exceptions)??[]){if(a.area!==e)continue;const l=n.get(a.agentId);(!l||l.action&&!a.action)&&n.set(a.agentId,a)}return[...n.values()]},[t,e])}function he(e){const t=E();return W({queryKey:R.history(e),queryFn:()=>t.getPermissionHistory(e?{agentId:e,limit:50}:{limit:50})})}function xe(e){var n;const t=e;return(t==null?void 0:t.code)!=="UNDO_CONFLICT"?null:((n=t.body)==null?void 0:n.conflicts)??[]}function fe(){const e=E(),t=Z();return ee({mutationFn:({eventId:n,force:a})=>e.undoPermissionChange(n,a?{force:!0}:{}),meta:{suppressErrorToast:!0},onSettled:()=>{t.invalidateQueries({queryKey:R.all}),t.invalidateQueries({queryKey:["mesh","agents"]}),t.invalidateQueries({queryKey:se.all})}})}function F(e){const{data:t}=y();return t?oe(t,e):void 0}function V({areaId:e,label:t,description:n,floor:a,value:l,sourceText:o,why:d,changed:i=!1,onChange:m,onReset:r,disabled:u=!1,footer:c,details:h}){return s.jsxs("div",{className:"@container","data-testid":`permission-row-${e}`,children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[i?s.jsx("span",{className:"bg-primary size-1.5 shrink-0 rounded-full","aria-label":"Set differently for this agent",role:"img"}):null,s.jsx("span",{className:"text-sm font-medium",children:t}),a?s.jsx(te,{className:"text-muted-foreground size-3.5","aria-label":"Never Allowed"}):null]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:n}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:o}),d?s.jsxs(s.Fragment,{children:[o?" · ":null,d]}):null]})]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(Q,{value:l,onChange:m,floor:a,disabled:u,"aria-label":t}),i&&r?s.jsxs(x,{variant:"ghost",size:"sm",className:"self-start @lg:self-end",onClick:r,disabled:u,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset to default"]}):null,c]})]}),h]})}function ge({area:e,exception:t}){const n=p({kind:"agent",agentId:t.agentId}),a=()=>n.mutate({kind:"patch",...t.action?{actions:{[t.action]:null}}:{areas:{[e]:null}},surface:"settings"}),l=_(t.lastChange);return s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"min-w-0 text-sm",children:[s.jsxs("span",{className:"block break-words",children:[t.agentName,": ",f[t.state],t.action?" (one action)":""]}),l?s.jsx("span",{className:"text-muted-foreground block text-xs",children:l}):null]}),s.jsxs(x,{variant:"ghost",size:"sm",onClick:a,disabled:n.isPending,"aria-label":`Reset ${t.agentName} to the default`,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]})]})}function pe({area:e,areaLabel:t,agents:n}){if(n.length===0)return null;const a=n.length===1?"1 agent differs":`${n.length} agents differ`;return s.jsxs(q,{children:[s.jsx(U,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start md:self-end",children:[a,s.jsx(L,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsxs(M,{className:"text-sm font-medium",children:["Set differently for ",t]}),s.jsx("ul",{className:"space-y-1",children:n.map(l=>s.jsx(ge,{area:e,exception:l},l.agentId))})]})]})}function G(e,t){return e.resolved.source===(t.kind==="agent"?"agent-action":"default-action")}function J({action:e,preset:t,agentName:n}){const a=f[e.resolved.state];return s.jsx(b,{question:`Why is ${e.title} set to ${a}${n?` for ${n}`:""}?`,sentence:z({...e.resolved,preset:t,fromExtension:e.source!==void 0}),...e.lastChange?{lastChange:e.lastChange}:{}})}function je({action:e,area:t,scope:n,preset:a,agentName:l,disabled:o,reset:d,onSave:i}){const m=G(e,n),r=F({kind:"action",action:e.id,area:t.id}),u=m?"Set on its own":e.alwaysAsks?e.source?"Always asks: an extension tool that can delete things":"Always asks, so you see the change first":e.resolved.destructiveAsk?"Always asks unless you set it here":`Follows ${t.label}`,c=n.kind==="default"&&r!==void 0?T(r):null;return s.jsxs("li",{className:"flex flex-col gap-2 py-2 @md:flex-row @md:items-center @md:justify-between","data-testid":`permission-action-${e.id}`,children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm",children:e.title}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.source?s.jsxs("span",{children:["From ",e.source.name," · "]}):null,s.jsx("span",{children:u}),c?s.jsxs("span",{children:[" · ",c]}):null," ·"," ",s.jsx(J,{action:e,preset:a,...l?{agentName:l}:{}})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[m?d:null,s.jsx(Q,{value:e.resolved.state,floor:t.floor||e.alwaysAsks===!0,disabled:o,"aria-label":e.title,onChange:h=>{h!==e.resolved.state&&i(h)}})]})]})}function X({scope:e,area:t,surface:n,preset:a,agentName:l}){const o=p(e),[d,i]=N.useState(!1);if(t.actions.length===0)return null;const m=t.actions.filter(c=>G(c,e)),r=(c,h)=>o.mutate({kind:"patch",actions:{[c.id]:h},surface:n},{onError:j}),u=c=>s.jsxs(x,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs",disabled:o.isPending,"aria-label":`Put ${c.title} back to ${t.label}`,onClick:()=>r(c,null),children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]});return s.jsxs("div",{className:"flex flex-col items-start gap-1 pb-3","data-testid":`permission-actions-${t.id}`,children:[!d&&m.length>0?s.jsx("ul",{className:"w-full space-y-1","data-testid":`permission-action-exceptions-${t.id}`,children:m.map(c=>s.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:"text-muted-foreground min-w-0",children:[s.jsxs("span",{children:["Except ",c.title,": ",f[c.resolved.state]]})," ","·"," ",s.jsx(J,{action:c,preset:a,...l?{agentName:l}:{}})]}),u(c)]},c.id))}):null,s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground -ml-2 h-7 px-2 text-xs","aria-expanded":d,onClick:()=>i(c=>!c),children:[s.jsx(ne,{className:k("size-3.5 transition-transform",d&&"rotate-180"),"aria-hidden":!0}),d?"Hide individual actions":"Show individual actions"]}),d?s.jsx("ul",{className:"divide-border w-full divide-y","aria-label":`${t.label} actions`,children:t.actions.map(c=>s.jsx(je,{action:c,area:t,scope:e,preset:a,...l?{agentName:l}:{},disabled:o.isPending,reset:u(c),onSave:h=>r(c,h)},c.id))}):null]})}function Ne({agentId:e,agentName:t,files:n}){const a=p({kind:"agent",agentId:e}),l=n.source==="agent",o=n.inherited.stop,d=n.stop,i=r=>a.mutate({kind:"patch",filesAndCommands:r,surface:"agent-page"},{onError:j}),m=o?`${l?`Everyone else: ${g(o)}`:`Same as everyone (${g(o)})`}${n.inherited.source==="runtime"?` · ${$("runtime")}`:""}`:$(n.inherited.source);return s.jsxs("div",{className:"@container","data-testid":"permission-row-files",children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[l?s.jsx("span",{className:"bg-primary size-1.5 shrink-0 rounded-full","aria-label":"Set differently for this agent",role:"img"}):null,s.jsx("span",{className:"text-sm font-medium",children:"Files & commands"})]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Editing files and running commands in this agent’s chats"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:m})," ·"," ",s.jsx(b,{question:`Why is Files & commands ${d?`set to ${g(d)}`:"not set"} for ${t}?`,sentence:H(d,n.source),...n.lastChange?{lastChange:n.lastChange}:{}})]})]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(A,{"aria-label":"Files & commands",className:"w-full @lg:w-auto",value:d??"",disabled:a.isPending,onValueChange:r=>{r&&r!==d&&i(r)},children:w.map(r=>s.jsxs(P,{value:r.id,"aria-label":r.label,children:[s.jsx(B,{descriptor:r,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:r.label})]},r.id))}),l?s.jsxs(x,{variant:"ghost",size:"sm",className:"self-start @lg:self-end",onClick:()=>i(null),disabled:a.isPending,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset to default"]}):null]})]}),s.jsx(K,{descriptor:w.find(r=>r.stop===d),className:"pb-3"})]})}function Re({files:e,preset:t,onChange:n,disabled:a=!1,runtimeLabel:l=o=>o}){const o=F({kind:"files"}),d=e.stop===null?$("runtime-own"):e.stop===e.presetStop?`From ${S[t??"trusted"]}`:"Changed from your preset";return s.jsxs("div",{className:"@container","data-testid":"permission-row-files",children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("span",{className:"text-sm font-medium",children:"Files & commands"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Editing files and running commands"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:[d,o!==void 0?T(o):""].filter(Boolean).join(" · ")})," ","·"," ",s.jsx(b,{question:`Why is Files & commands ${e.stop?`set to ${g(e.stop)}`:"not set"}?`,sentence:H(e.stop,e.stop===null?"runtime-own":"default"),...e.lastChange?{lastChange:e.lastChange}:{}})]}),e.runtimes.map(i=>s.jsxs("p",{className:"text-muted-foreground text-xs",children:[l(i.runtime)," starts at ",g(i.stop)," (Settings → Runtimes)"]},i.runtime))]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(A,{"aria-label":"Files & commands",className:"w-full @lg:w-auto",value:e.stop??"",disabled:a,onValueChange:i=>{i&&i!==e.stop&&n(i)},children:w.map(i=>s.jsxs(P,{value:i.id,"aria-label":i.label,children:[s.jsx(B,{descriptor:i,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:i.label})]},i.id))}),s.jsx(be,{agents:e.exceptions})]})]}),s.jsx(K,{descriptor:w.find(i=>i.stop===e.stop),className:"pb-3"})]})}function ve({agent:e}){const t=p({kind:"agent",agentId:e.agentId}),n=_(e.lastChange);return s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"min-w-0 text-sm",children:[s.jsxs("span",{className:"block break-words",children:[e.agentName,": ",g(e.stop)]}),n?s.jsx("span",{className:"text-muted-foreground block text-xs",children:n}):null]}),s.jsxs(x,{variant:"ghost",size:"sm",disabled:t.isPending,"aria-label":`Reset ${e.agentName} to the default`,onClick:()=>t.mutate({kind:"patch",filesAndCommands:null,surface:"settings"},{onError:j}),children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]})]})}function be({agents:e}){return e.length===0?null:s.jsxs(q,{children:[s.jsx(U,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start @lg:self-end",children:[e.length===1?"1 agent differs":`${e.length} agents differ`,s.jsx(L,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsx(M,{className:"text-sm font-medium",children:"Set differently for Files & commands"}),s.jsx("ul",{className:"space-y-1",children:e.map(t=>s.jsx(ve,{agent:t},t.agentId))})]})]})}function O(e){return e.filter(t=>t.kind==="state")}function we({area:e,overview:t}){const n=p({kind:"default"}),a=me(e.id),l=F({kind:"area",area:e.id})??0,[o,d]=N.useState(null),i=(r,u)=>{n.mutate({kind:"patch",areas:{[e.id]:r},...u&&u.length>0?{applyToAgents:u}:{},surface:"settings"},{onError:j,onSettled:()=>d(null)})},m=r=>{r!==e.resolved.state&&(a.length>0?d(r):i(r))};return s.jsxs(s.Fragment,{children:[s.jsx(V,{areaId:e.id,label:e.label,description:e.description,floor:e.floor,value:e.resolved.state,sourceText:[de(e.resolved.source,t.preset),T(l)].filter(Boolean).join(" · "),why:s.jsx(b,{question:`Why is ${e.label} set to ${f[e.resolved.state]}?`,sentence:z({...e.resolved,preset:t.preset}),...e.lastChange?{lastChange:e.lastChange}:{}}),onChange:m,disabled:n.isPending,footer:s.jsx(pe,{area:e.id,areaLabel:e.label,agents:a}),details:s.jsx(X,{scope:{kind:"default"},area:e,surface:"settings",preset:t.preset})}),s.jsx(ce,{open:o!==null,onCancel:()=>d(null),subject:e.label,next:o??"ask",agents:a.map(r=>({agentId:r.agentId,agentName:r.agentName,detail:`${f[r.state]}${r.action?" (one action)":""}`})),affectedCount:l,onKeep:()=>o&&i(o),onUpdate:r=>o&&i(o,r),pending:n.isPending})]})}function ye({agentId:e,agentName:t,area:n}){var r;const a=((r=y().data)==null?void 0:r.preset)??null,l=p({kind:"agent",agentId:e}),o=n.resolved.source==="agent-area"||n.resolved.source==="agent-action",d=o?`Everyone else: ${f[n.inherited.state]}`:`Same as everyone (${f[n.inherited.state]})`,i=n.changedOutsideAt?`Changed outside DorkOS · ${d}`:d,m=u=>l.mutate({kind:"patch",areas:{[n.id]:u},surface:"agent-page"},{onError:j});return s.jsx(V,{areaId:n.id,label:n.label,description:n.description,floor:n.floor,value:n.resolved.state,sourceText:i,why:s.jsx(b,{question:`Why is ${n.label} set to ${f[n.resolved.state]} for ${t}?`,sentence:z({...n.resolved,preset:a}),...n.lastChange?{lastChange:n.lastChange}:{}}),changed:o,onChange:u=>{u!==n.resolved.state&&m(u)},onReset:()=>m(null),disabled:l.isPending,details:s.jsx(X,{scope:{kind:"agent",agentId:e},area:n,surface:"agent-page",preset:a,agentName:t})})}function ze({scope:e}){const t=y(),n=ue(e.kind==="agent"?e.agentId:void 0);return e.kind==="default"?t.isError?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read the permissions."}):t.data?s.jsx("div",{className:"divide-border divide-y","data-testid":"permission-list-default",children:O(t.data.areas).map(a=>s.jsx(we,{area:a,overview:t.data},a.id))}):s.jsx(C,{className:"h-20 w-full"}):n.isError?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s permissions."}):n.data?s.jsxs("div",{className:"divide-border divide-y","data-testid":"permission-list-agent",children:[s.jsx(Ne,{agentId:e.agentId,agentName:n.data.agentName,files:n.data.filesAndCommands}),O(n.data.areas).map(a=>s.jsx(ye,{agentId:e.agentId,agentName:n.data.agentName,area:a},a.id))]}):s.jsx(C,{className:"h-20 w-full"})}function ke(e,t){if(t.key.kind==="chat")return ie(e);if(t.key.kind==="account")return le(e);if(e===null)return t.target.kind==="agent"?"the default":"the preset";switch(t.key.kind){case"files":return Ce(e)?g(e):e;case"preset":return e in S?S[e]:e;default:return e in f?f[e]:e}}function Ce(e){return re.includes(e)}function $e(e){if(e.length===1){const{change:t}=e[0];return`This has changed since. Set it back to ${ke(t.before,t)} anyway?`}return"Some of this has changed since. Set it all back anyway?"}function Se(e){if(e.suggestionRestored)return null;if(e.changes.length===0&&e.skipped.length===0)return"Nothing to undo. It was already back.";if(e.skipped.length===0)return null;const t=e.changes.length,n=`Undid ${t} ${t===1?"change":"changes"}.`,a=e.skipped.filter(i=>i.reason==="changed-since").length,l=e.skipped.filter(i=>i.reason==="floor").length,o=e.skipped.filter(i=>i.reason==="gone").length,d=[];if(a>0&&d.push(`${a} had changed since and ${a===1?"was":"were"} left alone.`),l>0&&d.push(`${l} can’t be set to Allowed and ${l===1?"was":"were"} left alone.`),o>0&&d.push(`${o} ${o===1?"was about an agent":"were about agents"} no longer here.`),d.length>1){const i=e.skipped.length;return`${n} ${i} ${i===1?"was":"were"} left alone.`}return[n,...d].join(" ")}function Ae({item:e}){const t=fe(),[n,a]=N.useState(null),[l,o]=N.useState(null),d=e.undone,i=e.undoable&&!d,m=ae(e.occurredAt),r=u=>t.mutate({eventId:e.id,...u?{force:!0}:{}},{onSuccess:c=>{a(null),o(Se(c))},onError:c=>{const h=xe(c);h?a(h):j(c)}});return s.jsxs("li",{className:"space-y-1","data-testid":"permission-history-row",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0 space-y-0.5",children:[s.jsx("p",{className:"text-sm",children:e.summary}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.actorLabel," · ",m]}),e.actorDetail?s.jsx("p",{className:"text-muted-foreground text-xs",children:e.actorDetail}):null]}),d?s.jsx("span",{className:"text-muted-foreground shrink-0 pt-0.5 text-xs",children:"Undone"}):i&&n===null?s.jsx(x,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs",disabled:t.isPending,"aria-label":`Undo: ${e.summary}, ${m}`,onClick:()=>r(!1),children:"Undo"}):null]}),n!==null?s.jsxs("div",{role:"group","aria-label":"Undo conflict",className:"bg-muted/50 flex flex-col gap-2 rounded-md p-2 @md:flex-row @md:items-center @md:justify-between",children:[s.jsx("p",{className:"text-sm",children:$e(n)}),s.jsxs("div",{className:"flex shrink-0 gap-2",children:[s.jsx(x,{variant:"outline",size:"sm",disabled:t.isPending,onClick:()=>a(null),children:"Cancel"}),s.jsx(x,{size:"sm",disabled:t.isPending,onClick:()=>r(!0),children:"Set it back"})]})]}):null,l?s.jsx("p",{className:"text-muted-foreground text-xs",role:"status",children:l}):null]})}function Te({agentId:e}){const{data:t,isPending:n,isError:a}=he(e);if(a)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read the history."});if(n)return s.jsx(C,{className:"h-12 w-full"});const l=(t==null?void 0:t.items)??[];return l.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No permission changes yet."}):s.jsx("ul",{className:"@container space-y-3","aria-label":"Permission history",children:l.map(o=>s.jsx(Ae,{item:o},o.id))})}export{Re as D,ze as P,Te as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as n,j as s}from"./index-
|
|
1
|
+
import{y as n,j as s}from"./index-DwrBsA10.js";import{P as r,a}from"./PermissionHistory-5stLHBu8.js";import"./ApplyToOverridesDialog-C-XL9N4W.js";function d({member:t}){var o;const e=n((o=t.agent)==null?void 0:o.runtime),i=(e==null?void 0:e.supportsMcp)??!0;return s.jsxs("div",{className:"space-y-6",children:[i?null:s.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent can’t use DorkOS tools, so these don’t apply."}),s.jsx(r,{scope:{kind:"agent",agentId:t.id}}),s.jsxs("section",{className:"space-y-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"History"}),s.jsx(a,{agentId:t.id})]})]})}export{d as PermissionsPage};
|
package/dist/client/assets/{PersonalityPopover-BOXTCA6E.js → PersonalityPopover-DIbsJ6HP.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n,j as t,e as i}from"./index-
|
|
1
|
+
import{b as n,j as t,e as i}from"./index-DwrBsA10.js";import{u as m,P as p}from"./use-personality-commit-DQrWyVGT.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-DTEcjDxP.js";function P({member:r}){const{agent:e,isPending:o,update:a}=n(r),s=m(e,a);return o?t.jsx(i,{className:"h-40 w-full"}):e?t.jsx(p,{traits:s.traits,onTraitsChange:s.onTraitsChange,compact:!0,className:"p-1"}):t.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s personality."})}export{P as PersonalityPopover};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./index-DwrBsA10.js";import{b as t}from"./ProfileFields-gZNaFBow.js";import"./profile-errors-aEsWNifs.js";import"./use-mounted-ref-DitdlmSI.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
|
package/dist/client/assets/{PreviewRefusedNotice-CdHja8fU.js → PreviewRefusedNotice-CjT7jQ45.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as b,j as n,bm as _,bp as
|
|
1
|
+
import{r as b,j as n,bm as _,bp as m,bq as S,fn as k,bt as E,eG as I,dN as N,fo as R,fp as A,bn as T,bv as h,fq as M,fr as $,fs as D,ft as O,a1 as F,a2 as G,aa as V}from"./index-DwrBsA10.js";import{S as L}from"./shield-x-D8lJ0Op0.js";var q=Object.defineProperty,v=(e,t)=>q(e,"name",{value:t,configurable:!0}),x="Tabs",[K,oe]=S(x,[k]),C=k(),[U,y]=K(x),H=b.forwardRef(v(function(t,a){const{__scopeTabs:r,value:s,onValueChange:o,defaultValue:d,orientation:i="horizontal",dir:l,activationMode:g="automatic",...p}=t,u=E(l),[c,f]=I({prop:s,onChange:o,defaultProp:d??"",caller:x});return n.jsx(U,{scope:r,baseId:N(),value:c,onValueChange:f,orientation:i,dir:u,activationMode:g,children:n.jsx(m.div,{dir:u,"data-orientation":i,...p,ref:a})})},"Tabs")),z="TabsList",B=b.forwardRef(v(function(t,a){const{__scopeTabs:r,loop:s=!0,...o}=t,d=y(z,r),i=C(r);return n.jsx(R,{asChild:!0,...i,orientation:d.orientation,dir:d.dir,loop:s,children:n.jsx(m.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})},"TabsList")),Q="TabsTrigger",W=b.forwardRef(v(function(t,a){const{__scopeTabs:r,value:s,disabled:o=!1,...d}=t,i=y(Q,r),l=C(r),g=w(i.baseId,s),p=j(i.baseId,s),u=s===i.value;return n.jsx(A,{asChild:!0,...l,focusable:!o,active:u,children:n.jsx(m.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":p,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:g,...d,ref:a,onMouseDown:T(t.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?i.onValueChange(s):c.preventDefault()}),onKeyDown:T(t.onKeyDown,c=>{o||c.target!==c.currentTarget||[" ","Enter"].includes(c.key)&&i.onValueChange(s)}),onFocus:T(t.onFocus,()=>{const c=i.activationMode!=="manual";!u&&!o&&c&&i.onValueChange(s)})})})},"TabsTrigger")),X="TabsContent",J=b.forwardRef(v(function(t,a){const{__scopeTabs:r,value:s,forceMount:o,children:d,...i}=t,l=y(X,r),g=w(l.baseId,s),p=j(l.baseId,s),u=s===l.value,c=b.useRef(u);return b.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),n.jsx(_,{present:o||u,children:({present:f})=>n.jsx(m.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":g,hidden:!f,id:p,tabIndex:0,...i,ref:a,style:{...t.style,animationDuration:c.current?"0s":void 0},children:f&&d})})},"TabsContent"));function w(e,t){return`${e}-trigger-${t}`}v(w,"makeTriggerId");function j(e,t){return`${e}-content-${t}`}v(j,"makeContentId");var Y=H,Z=B,ee=W,te=J;function ie({...e}){return n.jsx(Y,{"data-slot":"tabs",...e})}function ce({className:e,responsive:t=!0,...a}){return n.jsx(Z,{"data-slot":"tabs-list",className:h("bg-dui-muted text-dui-muted-foreground inline-flex items-center justify-center rounded-lg p-1",t?M:"h-9",e),...a})}function ue({className:e,...t}){return n.jsx(ee,{"data-slot":"tabs-trigger",className:h("ring-offset-dui-background inline-flex items-center justify-center rounded-md px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow,opacity] motion-reduce:transition-none! md:py-1","focus-visible:ring-dui-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none","disabled:pointer-events-none disabled:opacity-50","data-[state=active]:bg-dui-background data-[state=active]:text-dui-foreground data-[state=active]:shadow",e),...t})}function de({className:e,...t}){return n.jsx(te,{"data-slot":"tabs-content",className:h("ring-offset-dui-background mt-2","data-[state=active]:animate-in data-[state=active]:fade-in-0 data-[state=active]:duration-150 motion-reduce:animate-none!","focus-visible:ring-dui-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t})}const ae={default:!1,plan:!1,acceptEdits:!1,dontAsk:!0,bypassPermissions:!0,auto:!0};function le(e){return ae[e]??!1}function se(e){try{return O.toString(e)}catch{return`On the schedule ${e}`}}function fe(e){const t=e.cron?se(e.cron):"Runs only when you ask",a=$(e.startsEnabled);return`${t}, ${a}. This job ${D(e.permissionMode)}.`}function be(e,t){const a=F(),{enabled:r=!0,...s}=t??{},o=Object.keys(s).length>0;return G({queryKey:V.permissionPreview(e??"",o?s:void 0),queryFn:()=>a.previewMarketplacePackage(e,o?s:void 0),enabled:r&&e!==null,staleTime:3e4,networkMode:"always"})}function P(e){const t=e==null?void 0:e.body,a=Array.isArray(t==null?void 0:t.errors)?t.errors.filter(r=>typeof r=="string"):[];return a.length>0?{reasons:a,checked:!0}:{reasons:e instanceof Error&&e.message?[e.message]:[],checked:!1}}function ve(e){return P(e).checked}function ge({error:e}){const{reasons:t,checked:a}=P(e);return n.jsxs("div",{role:"alert",className:"border-destructive/40 bg-destructive/5 space-y-2 rounded-md border p-3 text-sm",children:[n.jsxs("p",{className:"text-destructive flex items-center gap-2 font-medium",children:[n.jsx(L,{className:"size-4 shrink-0","aria-hidden":!0}),"DorkOS won’t install this package"]}),n.jsx("p",{className:"text-muted-foreground text-xs",children:a?"What it found:":"It couldn’t check what this package does."}),t.length>0&&n.jsx("ul",{className:"text-muted-foreground list-disc space-y-1 pl-5 text-xs [overflow-wrap:anywhere]",children:t.map(r=>n.jsx("li",{children:r},r))})]})}export{ge as P,ie as T,ce as a,ue as b,de as c,fe as d,ve as i,le as r,be as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,t as E,j as e,bg as m,bh as g,bi as x,g as y,B as u,I as f,bj as j,bk as b}from"./index-
|
|
1
|
+
import{r as p,t as E,j as e,bg as m,bh as g,bi as x,g as y,B as u,I as f,bj as j,bk as b}from"./index-DwrBsA10.js";import{u as k,a as C,b as v,c as A,h as I,d as F,n as D}from"./profile-errors-aEsWNifs.js";import{u as N}from"./use-mounted-ref-DitdlmSI.js";function P(a){const[n,t]=p.useState(a),[r,i]=p.useState(a);return r!==a&&(i(a),t(a)),[n,t]}const M="image/png,image/jpeg,image/webp";function l({tone:a,children:n}){return e.jsx("p",{role:a==="error"?"alert":"status",className:a==="error"?"text-destructive text-xs":"text-muted-foreground text-xs",children:n})}function H({member:a}){const n=E(a),t=p.useRef(null),r=k(),i=C();function c(s){const o=s==null?void 0:s[0];o&&(r.mutate({file:o}),t.current&&(t.current.value=""))}return e.jsx(m,{children:e.jsxs(g,{className:"space-y-3",children:[e.jsx(x,{label:"Photo",description:"PNG, JPEG or WebP, up to 2 MB.",orientation:"vertical",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(y,{size:"lg",kind:n.kind,color:n.color,emoji:n.emoji,imageUrl:n.imageUrl,fallback:n.fallback,origin:n.origin}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("input",{ref:t,type:"file",accept:M,className:"hidden","data-testid":"profile-photo-input",onChange:s=>c(s.target.files)}),e.jsx(u,{size:"sm",variant:"outline",disabled:r.isPending,onClick:()=>{var s;return(s=t.current)==null?void 0:s.click()},children:a.imageUrl?"Change photo":"Upload a photo"}),a.imageUrl&&e.jsx(u,{size:"sm",variant:"ghost",disabled:i.isPending,onClick:()=>i.mutate(),children:"Remove"})]})]})}),r.isError&&e.jsx(l,{tone:"error",children:v(r.error)}),i.isError&&e.jsx(l,{tone:"error",children:v(i.error)})]})})}function L({member:a}){const n=N(),t=F({isShownInline:()=>n.current}),r=a.displayName===j?"":a.displayName,[i,c]=P(r),s=b(a),o=i.trim().length>0&&i.trim()!==r,d=i.trim().length>0&&(o||s!==null);return e.jsx(m,{children:e.jsxs(g,{className:"space-y-3",children:[e.jsx(x,{label:"Display name",description:s?`${s}. Save it to make it yours.`:"What DorkOS calls you.",orientation:"vertical",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{value:i,maxLength:80,"aria-label":"Display name",placeholder:j,onChange:h=>c(h.target.value)}),e.jsx(u,{size:"sm",disabled:!d||t.isPending,onClick:()=>t.mutate(i.trim()),children:"Save"})]})}),t.isError&&e.jsx(l,{tone:"error",children:D(t.error)}),t.isSuccess&&i.trim()===t.variables&&e.jsx(l,{tone:"ok",children:"Saved."})]})})}function z({member:a}){var d,h;const n=N(),t=A({isShownInline:()=>n.current}),[r,i]=P(a.handle??""),c=r.trim()!==(a.handle??""),s=a.kind==="agent",o=s?(d=a.agent)==null?void 0:d.authorId:a.id;return e.jsx(m,{children:e.jsxs(g,{className:"space-y-3",children:[e.jsx(x,{label:"Handle",description:s?"What others type after @ to reach this agent.":"What others type after @ to reach you.",orientation:"vertical",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{value:r,maxLength:64,placeholder:s?"agentname":"yourname","aria-label":"Handle",disabled:!o,onChange:S=>i(S.target.value)}),e.jsx(u,{size:"sm",disabled:!o||!c||t.isPending,onClick:()=>o&&t.mutate({authorId:o,handle:r.trim()}),children:"Save"})]})}),!o&&e.jsx(l,{tone:"ok",children:"It gets a handle when it first joins a room."}),t.isError&&e.jsx(l,{tone:"error",children:I(t.error,r.trim())}),t.isSuccess&&r.trim()===((h=t.variables)==null?void 0:h.handle)&&e.jsx(l,{tone:"ok",children:"Saved."})]})})}function T({member:a}){var n,t;return e.jsx(m,{children:e.jsx(g,{children:e.jsx(x,{label:"Email",description:(n=a.person)!=null&&n.email?"Your sign-in email. It stays fixed.":"No login on this machine. Turn one on in Settings › Login & security.",orientation:"vertical",children:e.jsx(f,{readOnly:!0,"aria-label":"Email",value:((t=a.person)==null?void 0:t.email)??"",placeholder:"No email on this machine",className:"text-muted-foreground"})})})})}export{l as F,L as P,z as a,H as b,T as c,P as u};
|
package/dist/client/assets/{ProfilePanelContainer-BpJVbdUL.js → ProfilePanelContainer-DYf7L8xJ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f,j as t,bg as D,bh as R,bi as E,
|
|
1
|
+
import{r as f,j as t,bg as D,bh as R,bi as E,ef as H,eg as M,eh as _,ei as Z,ej as A,G as V,I as v,B as P,z as B}from"./index-DwrBsA10.js";import{F as j,b as K,P as Y,a as $,c as G}from"./ProfileFields-gZNaFBow.js";import{u as I,P as q,b as J}from"./ProfileRolePicker-DclYXFSP.js";function U(e,s){if(e.length!==s.length)return!1;const n=new Set(s);return e.every(r=>n.has(r))}function Q(){const{roles:e,isLoading:s,saveRoles:n}=I(),[r,i]=f.useState(e),[l,o]=f.useState(e),[d,u]=f.useState("idle"),[x,m]=f.useState(null);!s&&!U(l,e)&&(o(e),i(e));const h=()=>{u("saving"),n(r).then(()=>{u("idle"),m(r)}).catch(()=>u("error"))};return t.jsx(D,{children:t.jsxs(R,{className:"space-y-3",children:[t.jsx(E,{label:"What kind of work you do",description:"Only DorkBot and your agents read this. It stays on this machine.",orientation:"vertical",children:t.jsx(q,{selected:r,onChange:i,onConfirm:h,confirmLabel:d==="saving"?"Saving…":"Save",busy:d==="saving"||s})}),d==="error"&&t.jsx(j,{tone:"error",children:"Couldn’t save that. Try again."}),d!=="error"&&x&&U(r,x)&&t.jsx(j,{tone:"ok",children:"Saved."})]})})}const X=Object.freeze({days:[1,2,3,4,5],start:"09:00",end:"17:00"});function ee(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}const k=new Map;function te(e){let s=k.get(e);return s||(s=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",weekday:"short"}),k.set(e,s)),s}const ne={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};function w(e,s){const n={};for(const r of te(s).formatToParts(new Date(e)))n[r.type]=r.value;return{year:Number(n.year),month:Number(n.month),day:Number(n.day),hour:Number(n.hour),minute:Number(n.minute),second:Number(n.second),weekday:ne[n.weekday??""]??0}}function z(e,s){const n=w(e,s);return Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second)-Math.floor(e/1e3)*1e3}function se(e){const[s,n]=e.split(":").map(Number);return(s??0)*60+(n??0)}function ae(e,s,n,r,i){const l=se(r),o=Date.UTC(e,s-1,n,Math.floor(l/60),l%60),d=o-z(o-864e5,i),u=o-z(o+864e5,i),x=h=>{const y=w(h,i);return y.year===e&&y.month===s&&y.day===n&&y.hour*60+y.minute===l},m=[d,u].filter(x);return m.length>0?Math.min(...m):Math.max(d,u)}function re(e,s,n){const[r,i,l]=e.split("-").map(Number);return new Date(ae(r??1970,i??1,l??1,s,n))}function oe(e,s){const n=w(e.getTime(),s);return`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")}`}const ie=[{day:1,short:"M",name:"Monday"},{day:2,short:"T",name:"Tuesday"},{day:3,short:"W",name:"Wednesday"},{day:4,short:"T",name:"Thursday"},{day:5,short:"F",name:"Friday"},{day:6,short:"S",name:"Saturday"},{day:0,short:"S",name:"Sunday"}];function le(e){const s=typeof Intl.supportedValuesOf=="function"?Intl.supportedValuesOf("timeZone"):[];return s.includes(e)?s:[e,...s]}function de(e,s,n){const r=e??J()??ee(),i=s??X;return{timezone:r,days:[...i.days],start:i.start,end:i.end,awayUntil:n!=null&&n.until?oe(new Date(n.until),r):""}}function b(e,s){return e.timezone===s.timezone&&e.start===s.start&&e.end===s.end&&e.awayUntil===s.awayUntil&&[...e.days].sort().join()===[...s.days].sort().join()}function ue(e){return e.days.length===0?"Pick at least one working day.":!e.start||!e.end?"Set a start and an end time.":e.end<=e.start?"The day has to end after it starts.":null}function ce(e,s,n){return e.awayUntil===s.awayUntil?n:e.awayUntil?{...n,until:re(e.awayUntil,"00:00",e.timezone).toISOString()}:null}function me(){const{timezone:e,workingHours:s,away:n,isLoading:r,saveHours:i}=I(),l=de(e,s,n),[o,d]=f.useState(l),[u,x]=f.useState(l),[m,h]=f.useState("idle"),[y,C]=f.useState(null),[F,O]=f.useState(null);!r&&!b(u,l)&&(x(l),d(l));const p=ue(o),g=a=>d(c=>({...c,...a})),W=a=>g({days:o.days.includes(a)?o.days.filter(c=>c!==a):[...o.days,a]}),L=()=>{if(p)return;h("saving");const a=o;i({timezone:a.timezone,workingHours:{days:[...a.days].sort((c,S)=>c-S),start:a.start,end:a.end},away:ce(a,u,n)}).then(()=>{h("idle"),C(null),O(a)}).catch(c=>{h("error"),C(c instanceof Error?c.message:null)})};return t.jsx(D,{children:t.jsxs(R,{className:"space-y-4",children:[t.jsx(E,{label:"Your hours",description:"Your time zone and working hours.",orientation:"vertical",children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("label",{htmlFor:"profile-timezone",className:"text-muted-foreground text-xs",children:"Time zone"}),t.jsxs(H,{value:o.timezone,onValueChange:a=>g({timezone:a}),children:[t.jsx(M,{id:"profile-timezone",className:"h-8 text-sm",responsive:!1,children:t.jsx(_,{})}),t.jsx(Z,{children:le(o.timezone).map(a=>t.jsx(A,{value:a,responsive:!1,children:a.replace(/_/g," ")},a))})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{id:"profile-days-label",className:"text-muted-foreground text-xs",children:"Working days"}),t.jsx("div",{role:"group","aria-labelledby":"profile-days-label",className:"flex gap-1",children:ie.map(({day:a,short:c,name:S})=>{const T=o.days.includes(a);return t.jsx("button",{type:"button","aria-label":S,"aria-pressed":T,onClick:()=>W(a),className:V("size-8 rounded-md border text-xs font-medium",T?"bg-primary text-primary-foreground border-transparent":"text-muted-foreground hover:bg-accent"),children:c},a)})})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"flex-1 space-y-1",children:[t.jsx("label",{htmlFor:"profile-hours-start",className:"text-muted-foreground text-xs",children:"Start"}),t.jsx(v,{id:"profile-hours-start",type:"time",value:o.start,onChange:a=>g({start:a.target.value})})]}),t.jsxs("div",{className:"flex-1 space-y-1",children:[t.jsx("label",{htmlFor:"profile-hours-end",className:"text-muted-foreground text-xs",children:"End"}),t.jsx(v,{id:"profile-hours-end",type:"time",value:o.end,onChange:a=>g({end:a.target.value})})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("label",{htmlFor:"profile-away-until",className:"text-muted-foreground text-xs",children:"Away until"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(v,{id:"profile-away-until",type:"date",value:o.awayUntil,onChange:a=>g({awayUntil:a.target.value})}),o.awayUntil&&t.jsx(P,{type:"button",variant:"ghost",size:"sm",onClick:()=>g({awayUntil:""}),children:"Clear"})]})]})]})}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(P,{type:"button",size:"sm",onClick:L,disabled:r||m==="saving"||p!==null||b(o,u),children:m==="saving"?"Saving…":"Save"}),p&&t.jsx(j,{tone:"error",children:p}),!p&&m==="error"&&t.jsx(j,{tone:"error",children:y??"Couldn’t save that. Try again."}),!p&&m!=="error"&&F&&b(o,F)&&t.jsx(j,{tone:"ok",children:"Saved."})]})]})})}function fe({member:e}){return t.jsxs("div",{className:"space-y-4",children:[t.jsx("p",{className:"text-muted-foreground text-sm",children:"How you appear on your team page, in rooms and beside your messages."}),t.jsx(K,{member:e}),t.jsx(Y,{member:e}),t.jsx($,{member:e}),t.jsx(G,{member:e}),t.jsx(Q,{}),t.jsx(me,{})]})}function N({children:e}){return t.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:e})}function pe(){var n;const e=B(),s=(n=e.data)==null?void 0:n.members.find(r=>r.isSelf);return e.isPending?t.jsx(N,{children:"Loading your profile…"}):e.isError?t.jsx(N,{children:"Couldn’t load your profile. Reopen this tab to try again."}):s?t.jsx(fe,{member:s}):t.jsx(N,{children:"Couldn’t find your profile. Reopen this tab to try again."})}export{fe as P,pe as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a1 as
|
|
1
|
+
import{a1 as E,a3 as O,a2 as I,aI as h,a4 as j,aH as D,eE as S,r as b,j as l,G as z,I as q,B as k}from"./index-DwrBsA10.js";function B(){var a,d,c,m,g,p;const r=E(),s=O(),{data:e,isLoading:o}=I({queryKey:h.current(),queryFn:()=>r.getConfig(),staleTime:S}),i=j({mutationKey:D,mutationFn:u=>r.updateConfig({profile:u}),onSuccess:()=>{s.invalidateQueries({queryKey:h.all})}});return{roles:((a=e==null?void 0:e.profile)==null?void 0:a.roles)??[],rolePromptDismissedAt:((d=e==null?void 0:e.profile)==null?void 0:d.rolePromptDismissedAt)??null,identityPromptDismissedAt:((c=e==null?void 0:e.profile)==null?void 0:c.identityPromptDismissedAt)??null,timezone:((m=e==null?void 0:e.profile)==null?void 0:m.timezone)??null,workingHours:((g=e==null?void 0:e.profile)==null?void 0:g.workingHours)??null,away:((p=e==null?void 0:e.profile)==null?void 0:p.away)??null,isLoading:o,saveHours:u=>i.mutateAsync(u).then(()=>{}),saveRoles:u=>i.mutateAsync({roles:u}).then(()=>{}),dismissRolePrompt:()=>i.mutateAsync({rolePromptDismissedAt:new Date().toISOString()}).then(()=>{}),dismissIdentityPrompt:()=>i.mutateAsync({identityPromptDismissedAt:new Date().toISOString()}).then(()=>{})}}let x=!1;function K(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{return null}}function Q(){const r=E(),s=O(),{data:e,isSuccess:o}=I({queryKey:h.current(),queryFn:()=>r.getConfig(),staleTime:S}),i=e==null?void 0:e.profile;b.useEffect(()=>{if(x||!o||!i)return;if(i.timezone!=null){x=!0;return}const a=K();a&&(x=!0,r.updateConfig({profile:{timezone:a}}).then(()=>s.invalidateQueries({queryKey:h.all})).catch(()=>{}))},[o,i,r,s])}const w=[{id:"software-development",label:"Building software"},{id:"hiring",label:"Hiring people"},{id:"marketing",label:"Marketing"},{id:"writing",label:"Writing"},{id:"research",label:"Research"},{id:"business-ops",label:"Running a business"},{id:"design",label:"Design"},{id:"sales",label:"Sales"}],H=6,M={developer:"software-development",engineer:"software-development",programmer:"software-development",coder:"software-development","software engineer":"software-development",recruiter:"hiring",recruiting:"hiring",talent:"hiring",marketer:"marketing",growth:"marketing",writer:"writing",author:"writing",researcher:"research",scientist:"research",founder:"business-ops",entrepreneur:"business-ops",operations:"business-ops",ops:"business-ops",designer:"design",seller:"sales",salesperson:"sales"};function F(r){var i;const s=r.trim().toLowerCase();if(s.length===0)return;const e=w.find(a=>a.id===s);if(e)return e.id;const o=M[s];return o||((i=w.find(a=>a.label.toLowerCase()===s))==null?void 0:i.id)}const A=10,N=60;function v(r,s){const e=s.trim().toLowerCase();return r.some(o=>o.trim().toLowerCase()===e)}function W({selected:r,onChange:s,onConfirm:e,confirmLabel:o,onSkip:i,skipLabel:a,busy:d=!1,error:c=null}){const[m,g]=b.useState(!1),[p,u]=b.useState(""),C=b.useRef(null),y=w.slice(0,H),T=r.filter(t=>!y.some(n=>n.id===t)),f=r.length>=A,P=t=>{v(r,t)?s(r.filter(n=>n!==t)):f||s([...r,t])},L=()=>{const t=p.trim().slice(0,N);if(!t)return;const n=F(t),R=n&&y.some(_=>_.id===n)?n:t;!v(r,R)&&r.length<A&&s([...r,R]),u("")};return l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"group","aria-label":"What kind of work you do",children:[y.map(t=>{const n=v(r,t.id);return l.jsx("button",{type:"button","aria-pressed":n,disabled:f&&!n,onClick:()=>P(t.id),className:z("focus-visible:ring-ring rounded-md border px-2.5 py-1 text-xs transition-colors duration-150 focus-visible:ring-2 focus-visible:outline-none disabled:opacity-50",n?"border-primary bg-primary text-primary-foreground":"border-input bg-background text-foreground hover:bg-accent"),children:t.label},t.id)}),T.map(t=>l.jsx("button",{type:"button","aria-pressed":!0,onClick:()=>s(r.filter(n=>n!==t)),className:"border-primary bg-primary text-primary-foreground focus-visible:ring-ring rounded-md border px-2.5 py-1 text-xs transition-colors duration-150 focus-visible:ring-2 focus-visible:outline-none",children:t},t)),!m&&l.jsx("button",{type:"button",disabled:f,onClick:()=>{g(!0),setTimeout(()=>{var t;return(t=C.current)==null?void 0:t.focus()},0)},className:"border-input text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:ring-ring rounded-md border border-dashed px-2.5 py-1 text-xs transition-colors duration-150 focus-visible:ring-2 focus-visible:outline-none disabled:opacity-50",children:"Something else"})]}),f&&l.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"profile-role-cap-hint",children:"Ten at most. Remove a role to add another."}),m&&!f&&l.jsx(q,{ref:C,value:p,onChange:t=>u(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),L())},maxLength:N,placeholder:"Type your work and press Enter","aria-label":"Something else: describe your work",className:"h-8 text-xs"}),c&&l.jsx("p",{className:"text-destructive text-sm",role:"alert","data-testid":"profile-save-error",children:c}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsx(k,{size:"sm",onClick:e,disabled:d||r.length===0,"data-testid":"confirm-profile",children:o}),i&&l.jsx(k,{size:"sm",variant:"ghost",onClick:i,disabled:d,"data-testid":"skip-profile",children:a})]})]})}export{W as P,Q as a,K as b,B as u};
|
package/dist/client/assets/{PromptSuggestionChips-DT-JdGeO.js → PromptSuggestionChips-k9HolS90.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,ar as c,aQ as l,G as i}from"./index-
|
|
1
|
+
import{j as e,ar as c,aQ as l,G as i}from"./index-DwrBsA10.js";const p=4,m={compact:"max-w-[200px] gap-1.5 px-2.5 py-1 text-xs",comfortable:"min-h-9 max-w-[280px] gap-2 px-3 py-1.5 text-sm"};function u({suggestions:o,onChipClick:s,ariaLabel:r="Suggested follow-ups",size:a="compact"}){const n=o.slice(0,p);return e.jsx(c.div,{"data-slot":"prompt-suggestion-chips",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},role:"group","aria-label":r,className:"mt-1.5 flex flex-wrap items-center gap-2",children:n.map(t=>e.jsxs("button",{type:"button","aria-label":t,title:t,onClick:()=>s(t),className:i("bg-secondary text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:ring-ring inline-flex items-center truncate rounded-md transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-offset-2",m[a]),children:[e.jsx(l,{className:i("shrink-0",a==="compact"?"size-3":"size-3.5")}),e.jsx("span",{className:"truncate",children:t})]},t))})}export{u as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as g,b as D,z as P,j as e,e as O,D as _,F as U,G as C,t as z,g as F,J as K,K as M}from"./index-
|
|
1
|
+
import{r as g,b as D,z as P,j as e,e as O,D as _,F as U,G as C,t as z,g as F,J as K,K as M}from"./index-DwrBsA10.js";import{u as Y}from"./use-mounted-ref-DitdlmSI.js";const A="REPORTS_TO_CYCLE",q="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function B({option:a,selected:d,focusable:i,isDefault:p,disabled:x,onPick:c}){const n=z(a.member);return e.jsxs("button",{type:"button",role:"radio","aria-checked":d,tabIndex:i?0:-1,disabled:x,onClick:c,className:C(M,"flex w-full min-w-0 items-center gap-2 rounded-md px-1.5 py-1 text-left text-sm","hover:bg-accent disabled:opacity-60"),children:[e.jsx(F,{size:"xs",kind:n.kind,color:n.color,emoji:n.emoji,imageUrl:n.imageUrl,fallback:n.fallback,origin:n.origin,badge:null}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[a.label,p&&e.jsxs(e.Fragment,{children:[" ",e.jsx("span",{className:"text-muted-foreground",children:"(default)"})]})]}),d&&e.jsx(K,{"aria-hidden":!0,className:"size-3.5 shrink-0"})]})}function J({member:a}){var y,R;const d=Y(),i=g.useRef(null),p=g.useId(),x=g.useId(),{agent:c,isPending:n,isSaving:h,error:u,update:b}=D(a,{errorLabel:"Couldn’t change who this agent reports to",isShownInline:t=>d.current===!0&&t.code===A}),j=P();if(n||j.isPending)return e.jsx(O,{className:"h-24 w-full"});if(!c)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const I=((y=j.data)==null?void 0:y.members)??[],l=_(c,I,a),m=U(c.id,I,a),E=m.some(t=>t.accountId===l.accountId)?l.accountId:((R=m[0])==null?void 0:R.accountId)??null,L=t=>{var v;const s=Array.from(((v=i.current)==null?void 0:v.querySelectorAll('[role="radio"]'))??[]),r=s.indexOf(document.activeElement),o={ArrowDown:r+1,ArrowRight:r+1,ArrowUp:r-1,ArrowLeft:r-1,Home:0,End:s.length-1}[t.key];if(o===void 0||s.length===0)return;t.preventDefault();const f=s[(o+s.length)%s.length];s.forEach(N=>N.tabIndex=N===f?0:-1),f==null||f.focus()},S=m.filter(t=>t.kind==="person"),T=m.filter(t=>t.kind==="agent"),k=(u==null?void 0:u.code)===A?u.message:null,w=(t,s,r)=>r.length>0&&e.jsxs("div",{role:"group","aria-labelledby":s,className:"space-y-0.5",children:[e.jsx("div",{id:s,className:C(q,"px-1.5"),children:t}),r.map(o=>e.jsx(B,{option:o,selected:l.accountId===o.accountId,focusable:E===o.accountId,isDefault:l.isDefault&&l.accountId===o.accountId,disabled:h,onPick:()=>{o.accountId!==c.reportsTo&&b({reportsTo:o.accountId})}},o.accountId))]});return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-reports-to",children:[e.jsxs("div",{ref:i,role:"radiogroup","aria-label":"Reports to",onKeyDown:L,className:"max-h-72 space-y-2 overflow-y-auto",children:[w("People",p,S),w("Agents",x,T)]}),k&&e.jsx("p",{role:"alert",className:"text-status-error px-1.5 text-xs",children:k}),!l.isDefault&&e.jsx("button",{type:"button",disabled:h,onClick:()=>b({reportsTo:null}),className:"text-muted-foreground hover:text-foreground px-1.5 text-xs underline-offset-2 hover:underline",children:"Use the default"})]})}export{J as ReportsToPopover};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a1 as ie,a4 as de,a3 as Oe,iX as _e,iY as ne,iZ as me,i_ as Le,i$ as Fe,j0 as De,aP as ze,r as s,j as t,G as ee,B as we,x as He,e as Q,gw as Ie,hf as qe,gv as ke,j1 as $e,j2 as We,n as Be,gz as U,a7 as Ke,fw as Ge,j3 as Ue,j4 as Xe,j5 as Ye,cu as Qe,j6 as Ve,j7 as Ze,j8 as Je,j9 as et,cq as tt,ja as nt,gu as Y,jb as st,l as rt,s as he,jc as ot,jd as at,e5 as it,X as dt,e2 as lt,ar as ut,je as ct,jf as pe,jg as ft,ad as mt,jh as ht,gt as pt,gs as gt,ji as xt,aF as ge,by as Rt}from"./index-DwrBsA10.js";import{P as yt,u as vt}from"./pane-resize-handle-Kwb3zKa6.js";import{D as bt,U as jt,u as wt}from"./UnreadDivider-Bvg9QLn9.js";import{u as It}from"./use-room-follow-claim-Db5U7kWT.js";import{a as le,e as ue,g as kt,f as Ae,h as At,i as Ne,c as G,d as V,j as Nt,k as re,b as oe,l as ae,A as Se,m as Ce,t as ce,r as St,n as J,R as fe,u as Me,C as Te,o as Ct}from"./ChannelComposer-BNlD-d2W.js";import{u as Mt,f as Tt,a as Pt,F as Et,C as X,d as Ot,M as _t}from"./registry-NGfn1R2_.js";import{u as Lt}from"./use-connector-management-CLZQXgln.js";import{A as Ft}from"./AgentRequestCard-refCLvuV.js";import{u as Dt}from"./use-room-sessions-K6mdH-Tb.js";function zt(){const e=ie();return de({mutationFn:({roomId:o,authorId:r})=>e.haltRoomAgent(o,r),meta:{errorLabel:"Couldn’t stop this agent"}})}function Ht(){const e=ie();return de({mutationFn:({roomId:o,authorId:r})=>e.promoteHold(o,r),meta:{errorLabel:"Couldn’t ask to be answered first"}})}function qt(e){const o=ie(),r=Oe(),u=_e(e),y=ne(p=>{var f;return e===null?null:((f=p.paging[e])==null?void 0:f.cursor)??null}),i=de({mutationFn:async p=>{var j;const f=(j=ne.getState().paging[p])==null?void 0:j.cursor;if(f==null)return;const v=await o.listRoomEntries(p,{before:f,limit:me}),I=ze.entries(p),k=r.getQueryData(I),A=Le(k,v);r.setQueryData(I,A),ne.getState().notePage(p,Fe(v)??f,De(v,me)||A.length===((k==null?void 0:k.length)??0))},meta:{errorLabel:"Couldn't load older messages"}}),{mutateAsync:d,isPending:w}=i,R=s.useRef(!1),x=s.useCallback(async()=>{if(!(e===null||R.current)){R.current=!0;try{await d(e).catch(()=>{})}finally{R.current=!1}}},[e,d]);return{canLoadOlder:u,isLoadingOlder:w,cursor:y,loadOlder:x}}function $t({id:e,summary:o,open:r,onOpen:u}){const{capabilities:y}=Mt(),{count:i,lastAt:d,unread:w}=o,R=Tt(d),[x,p]=s.useState({count:i,bumped:!1});x.count!==i&&p({count:i,bumped:!0});const f=x.count===i&&x.bumped;return y.threads?t.jsxs("button",{type:"button",id:e,"data-slot":"thread-reply-row","data-testid":"room-thread-replies","data-unread":w>0?"":void 0,"aria-expanded":r,onClick:u,className:ee("focus-ring ml-[calc(var(--msg-padding-x)_+_var(--msg-gutter-width)_+_var(--msg-gap))]","mb-1 w-fit rounded text-left text-xs transition-colors","px-2 py-2 md:px-1 md:py-0.5",w>0?"text-primary hover:text-primary/80 font-medium":"text-muted-foreground hover:text-foreground"),children:[t.jsx("span",{"aria-hidden":!0,className:"mr-1",children:"↳"}),t.jsx("span",{className:ee(f&&"motion-safe:animate-count-flip"),"data-testid":"room-thread-reply-count",children:i},i),i===1?" reply":" replies",R.length>0&&t.jsxs(t.Fragment,{children:[" · last ",t.jsx("time",{dateTime:d,title:Pt(d),children:R})]}),w>0&&` · ${w} new`]}):null}function Wt({loading:e,onLoad:o}){return t.jsx("div",{className:"flex justify-center px-4 py-3",children:t.jsxs(we,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:e,"data-testid":"room-load-older",className:"text-muted-foreground hover:text-foreground h-7 gap-2 text-xs",children:[e&&t.jsx(He,{size:"xs"}),e?"Loading older messages…":"Older messages"]})})}const Bt="room-load-older",Kt=4;function Pe({roomName:e}){return t.jsx(Et,{label:e===void 0?"Messages":`Messages in ${e}`,busy:!0,className:"flex flex-col gap-4 p-4","data-testid":"room-timeline-loading",children:Array.from({length:Kt},(o,r)=>t.jsxs("div",{className:"flex gap-3",children:[t.jsx(Q,{className:"size-7 shrink-0 rounded-full"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[t.jsx(Q,{className:"h-3 w-24"}),t.jsx(Q,{className:"h-3 w-full max-w-md"})]})]},`room-skeleton-${r}`))})}function Gt({roomId:e,roomName:o,viewerAuthorId:r,entries:u,members:y,formerAuthors:i,lastReadSeq:d,reactionFrequents:w,streamStalled:R,isLoading:x,error:p,onAddAgents:f,openThreadId:v,onOpenThread:I,resumeRow:k,landOnRow:A,onTopRow:j,canLoadOlder:S=!1,isLoadingOlder:l=!1,onLoadOlder:c,ref:C}){const N=s.useMemo(()=>le(y,i),[y,i]),P=Ie(y,r),E=ue(),T=s.useMemo(()=>new Map([...N].map(([n,m])=>[n,m.displayName])),[N]),M=qe(),L=ke(e,null),{topLevel:H,repliesByRoot:F,orphaned:D}=s.useMemo(()=>kt(u),[u]),q=s.useMemo(()=>new Map(u.map(n=>[n.id,n])),[u]),z=s.useMemo(()=>{const n=$e(H,d),m=We(H.map(a=>({id:a.id,authorId:a.body.moment?`moment:${a.id}`:a.authorId,timestamp:a.createdAt})),{now:M,lastSeenId:n.lastSeenId,unreadFromStart:n.fromStart}),b=[];S&&!x&&b.push({kind:"load-older",id:Bt});for(const a of m){if(a.kind==="day-divider"){b.push({kind:"day-divider",id:a.key,label:a.label});continue}if(a.kind==="unread-divider"){b.push({kind:"unread-divider",id:a.key});continue}const h=H[a.index];b.push({kind:"message",id:h.id,entry:h,grouping:a.grouping,position:a.index+1,answers:Ae(h,H[a.index-1],q.get.bind(q))});const g=F.get(h.id);g&&b.push({kind:"thread-reply",id:At(h.id),rootId:h.id,replies:g,totalReplies:h.threadReplyCount})}return b},[H,F,q,d,M,S,x]),$=s.useMemo(()=>z.map(n=>n.kind==="load-older"?{kind:"notice",id:n.id,at:"",body:null}:n.kind==="day-divider"?{kind:"day-divider",id:n.id,label:n.label}:n.kind==="unread-divider"?{kind:"unread-divider",id:n.id}:n.kind==="thread-reply"?{kind:"thread-reply",id:n.id,rootId:n.rootId,replyCount:Ne(n.replies.length,n.totalReplies),lastAt:n.replies[n.replies.length-1].createdAt}:{kind:"message",id:n.id,payload:n.entry,grouping:n.grouping,author:G(V(n.entry,N),N,E.faces),at:n.entry.createdAt}),[z,N,E.faces]),K=s.useCallback((n,m)=>{const b=z[m.index];if(b.kind==="load-older")return c===void 0?null:t.jsx(Wt,{loading:l,onLoad:c});if(b.kind==="day-divider")return t.jsx(bt,{label:b.label});if(b.kind==="unread-divider")return t.jsx(jt,{});if(b.kind==="thread-reply"){if(m.onOpenThread===void 0)return null;const h=m.onOpenThread;return t.jsx($t,{id:re(b.rootId),summary:Nt(b.replies,d,b.totalReplies),open:v===b.rootId,onOpen:()=>h(b.rootId)})}const a=V(b.entry,N);return t.jsx(oe,{roomId:e,entry:b.entry,author:G(a,N,E.faces),authorRef:N.get(a),authors:N,viewerAuthorId:r,authorNames:T,reactionFrequents:w,streamStalled:R,isMember:P,grouping:b.grouping,orphanedReply:D.has(b.entry.id),answers:b.answers,feedPosition:{index:b.position,total:-1},rowId:ae(b.entry.id)})},[z,e,N,E.faces,r,T,w,R,P,D,d,v,l,c]),O=s.useCallback(n=>{if(n.kind==="message")return ae(n.id);if(n.kind==="thread-reply")return re(n.rootId)},[]);if(p)return t.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[t.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load these messages"}),t.jsx("p",{className:"max-w-sm",children:"Nothing was lost. Reload to try again."})]});const W=y.some(n=>n.author.kind==="agent"),B=t.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[t.jsx(Be,{className:"text-muted-foreground/50 size-8","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:"Nothing said here yet"}),t.jsx("p",{className:"max-w-sm",children:W?"Say something to get it going.":"Nothing answers until you add an agent."}),t.jsx(we,{type:"button",size:"sm",variant:W?"ghost":"default",onClick:f,className:"mt-1",children:W?"Add more agents":"Add agents"})]});return t.jsx(Se,{known:E,children:t.jsx(X.Timeline,{ref:C,conversationId:e,label:`Messages in ${o}`,rows:$,renderRow:K,onOpenThread:I,domIdOf:O,...k===void 0?{}:{resumeRow:k},...A===void 0?{}:{landOnRow:A},...j===void 0?{}:{onTopRow:j},pending:L,viewerAuthorId:r,loading:x?t.jsx(Pe,{roomName:o}):void 0,empty:B,feedTestId:"room-timeline"})})}function Ut(e){const{roomId:o,entrySeq:r,entries:u,historyLoaded:y}=e,i=r===void 0?null:`${o}:${r}`,d=s.useMemo(()=>{if(r===void 0)return null;const k=u.find(l=>l.seq===r);if(k===void 0)return null;const A=Ce(u,k.id);if(A===null)return null;const j=ce(k)??null,S=j!==null&&A.rowId!==k.id;return{roomRowId:A.rowId,threadRootId:S?j:null,entryId:k.id}},[u,r]),w=s.useRef(null),R=(d==null?void 0:d.threadRootId)??null;s.useEffect(()=>{i===null||R===null||w.current!==i&&(w.current=i,U.getState().openThread(o,R))},[i,o,R]);const x=s.useRef(null);s.useEffect(()=>{i===null||!y||d===null&&x.current!==i&&(x.current=i,Ke.info("That message isn’t in the loaded history",{description:"Only recent messages are open. Nothing was lost."}))},[i,y,d]);const p=s.useRef(null),f=s.useCallback(()=>{if(!(i===null||p.current===i))return p.current=i,d==null?void 0:d.roomRowId},[i,d]),v=s.useRef(null),I=s.useCallback(()=>{if(!(i===null||v.current===i))return v.current=i,(d==null?void 0:d.threadRootId)===null||d==null?void 0:d.entryId},[i,d]);return{roomRow:r===void 0?void 0:f,threadRow:r===void 0?void 0:I}}function Xt(e,o){const[r,u]=s.useState({roomId:null,seq:null});return r.roomId===e?r.seq:e===null?(u({roomId:null,seq:null}),null):o===null?null:(u({roomId:e,seq:o}),o)}const Yt=600;function Qt(e){return document.getElementById(re(e))??document.getElementById(ae(e))}function Vt(){const e=s.useRef(null);return s.useEffect(()=>()=>{var r;return(r=e.current)==null?void 0:r.call(e)},[]),{arm:s.useCallback(r=>{var w;(w=e.current)==null||w.call(e);let u=0;const y=Date.now()+Yt;let i=!1;const d=()=>{if(i)return;const R=document.activeElement;if(R===null||R===document.body||!R.isConnected){const p=Qt(r);if(p!==null){p.focus();return}}Date.now()>=y||(u=requestAnimationFrame(d))};u=requestAnimationFrame(d),e.current=()=>{i=!0,cancelAnimationFrame(u)}},[])}}function Zt({roomId:e,route:o,urlThreadId:r,openThreadId:u,entries:y,historyLoaded:i}){const d=Ge(),w=s.useRef(null);s.useEffect(()=>{if(e!==null){if(w.current!==e&&(w.current=e,r!==void 0)){U.getState().openThread(e,r);return}if(i&&u!==void 0){const R=y.find(p=>p.id===u),x=R===void 0?void 0:St(R);if(x!==void 0&&x!==u){const p=U.getState().open[e];U.getState().openThread(e,x,(p==null?void 0:p.focusComposer)??!1);return}}u!==r&&(d==null||d({to:o,search:R=>({...R,thread:u}),replace:!0}))}},[e,o,u,r,y,i,d])}function Jt(e){return e.kind!=="channel"||e.bridge!=null||e.archived?!1:!e.members.some(o=>o.author.kind==="agent")}function en({room:e,hasEntries:o,onAddAgents:r}){return!o||!Jt(e)?null:t.jsxs("p",{className:"text-muted-foreground shrink-0 px-4 pb-1 text-xs","data-testid":"no-agent-hint",children:["No agent is in this channel to answer."," ",t.jsx("button",{type:"button",onClick:r,className:"text-foreground focus-visible:ring-ring rounded-sm underline underline-offset-2 focus-visible:ring-2 focus-visible:outline-none",children:"Add one"})," ","to get answers here."]})}function tn({roomId:e}){const{approvals:o}=Ue(),r=Xe(o).filter(u=>u.roomId===e);return r.length===0?null:t.jsx("section",{"data-slot":"room-approvals","aria-label":"Requests waiting on you",className:"shrink-0 px-3 pb-2 md:px-4",children:t.jsx(Ye,{approvals:r})})}function nn({roomId:e}){const{data:o}=Lt("pending"),r=(o??[]).filter(u=>u.roomId===e);return r.length===0?null:t.jsx("section",{"data-slot":"room-agent-requests","aria-label":"Apps agents are asking for",className:"shrink-0 space-y-2 px-3 pb-2 md:px-4",children:r.map(u=>t.jsx(Ft,{request:u},u.requestId))})}const sn="An agent",xe=64,se=3,rn=new Set;function Ee({room:e,entries:o,scope:r,laneScope:u,stalled:y,unavailable:i=!1,onRetry:d,onScrollToRow:w}){const R=Qe(),x=Ve(e.id,r),p=Ze(e.id,r),f=Je(e.id,r),[v,I]=s.useState(!1),k=Dt(e.id,{enabled:v}),A=et(),{mutate:j}=zt(),[S,l]=s.useState(rn),c=s.useCallback(a=>{l(h=>new Set(h).add(a)),j({roomId:e.id,authorId:a},{onSettled:()=>l(h=>{const g=new Set(h);return g.delete(a),g})})},[j,e.id]),C=Ht(),[N,P]=s.useState(()=>new Map),E=tt(),T=ue(),M=s.useMemo(()=>le(e.members,e.formerAuthors),[e.members,e.formerAuthors]),L=s.useCallback(a=>{var h;return((h=M.get(a))==null?void 0:h.displayName)??sn},[M]),{interactions:H}=nt(),F=s.useMemo(()=>H.filter(a=>a.roomId===e.id),[H,e.id]),D=s.useMemo(()=>{var h;const a={};for(const g of F){if(g.roomAuthorId===void 0)continue;const _=(h=M.get(g.roomAuthorId))==null?void 0:h.displayName;_!==void 0&&(a[g.sessionId]=_)}return a},[F,M]),q=s.useMemo(()=>x.map(a=>({authorId:a.authorId,name:L(a.authorId),state:a.state,since:a.since,activity:a.activity??null})),[x,L]),z=s.useMemo(()=>p.map(a=>{var g;const h=(g=E.data)==null?void 0:g.find(_=>_.id===a.behindRoomId);return{authorId:a.authorId,name:L(a.authorId),since:a.since,behind:{roomId:a.behindRoomId,title:h===void 0?null:Y(h)},othersWaiting:a.othersWaiting,severalInTheWay:a.severalInTheWay}}),[p,L,E.data]),$=s.useMemo(()=>{const a=new Set;for(const h of p)N.get(h.authorId)===h.entryId&&a.add(h.authorId);return a},[p,N]),K=s.useMemo(()=>f===null?null:{authorId:f.authorId,name:L(f.authorId)},[f,L]),O=s.useMemo(()=>Ot({capabilities:fe,asks:F,agentNames:D,stalled:y,presence:q,held:z,silentFinish:K,turn:null}),[F,D,q,z,K,y]),W=s.useMemo(()=>{var h;const a=new Map;for(const g of((h=k.data)==null?void 0:h.bindings)??[])a.set(g.authorId,g.sessionId);return a},[k.data]),B=s.useCallback(a=>{const h=o.find(_=>_.id===a);if(h===void 0)return null;const g=h.body.text.replace(/\s+/gu," ").trim();return g.length===0?null:g.length>xe?`${g.slice(0,xe).trimEnd()}…`:g},[o]),n=s.useCallback(a=>{var h;return u==="thread"?J(a):((h=Ce(o,a))==null?void 0:h.domId)??null},[o,u]),m=s.useMemo(()=>{const a=x.map(g=>{const _=B(g.entryId),Z=n(g.entryId);return{authorId:g.authorId,author:G(g.authorId,M,T.faces),state:g.state,since:g.since,doing:st(g.activity),replyingTo:_===null||Z===null?null:{entryId:g.entryId,excerpt:_,rowId:Z},sessionId:W.get(g.authorId)??null}}),h=z.map(g=>({authorId:g.authorId,author:G(g.authorId,M,T.faces),state:"held",since:g.since,doing:null,replyingTo:null,sessionId:null,behind:g.behind,othersWaiting:g.othersWaiting}));return[...a,...h]},[x,z,M,T.faces,B,n,W]),b=s.useMemo(()=>{if(x.length===0)return null;const a=x.slice(0,se);return t.jsxs("span",{"aria-hidden":"true",className:"flex shrink-0 -space-x-1",children:[a.map(h=>t.jsx(_t,{author:G(h.authorId,M,T.faces),className:"ring-background size-4 ring-2"},h.authorId)),x.length>se&&t.jsx("span",{className:"bg-muted text-muted-foreground ring-background text-3xs flex size-4 items-center justify-center rounded-full ring-2",children:`+${x.length-se}`})]})},[x,M,T.faces]);return t.jsx(X.LiveLane,{state:O,scope:u,onRetry:d,unavailable:i,faces:b,onPeekOpenChange:I,askCard:O.kind==="ask"?t.jsx(ot,{ask:O.ask,...D[O.ask.sessionId]?{agentName:D[O.ask.sessionId]}:{},onOpenSession:a=>{R(he({session:a}))},className:"border-l-0"}):void 0,peek:t.jsx(X.LivePeek,{rows:m,onScrollToRow:w,onOpenSession:a=>{R(he({session:a}))},onOpenRoom:a=>{R({...rt.channels(),search:{id:a}})},onAnswerFirst:a=>{const h=p.find(g=>g.authorId===a);h!==void 0&&P(g=>new Map(g).set(a,h.entryId)),C.mutate({roomId:e.id,authorId:a})},promoted:$,onStopAll:()=>A.mutate({roomId:e.id}),stopping:A.isPending,onStopAgent:c,stoppingAgents:S})})}const Re=3e3;function on(e,o,r,u=Date.now){const y=s.useRef(null),i=s.useRef(new Map),d=s.useRef(new Map),w=y.current,R=i.current,x=d.current,p=u();for(const f of e){if(x.has(f.id))continue;if(w===null){x.set(f.id,"at-rest");continue}const v=R.get(f.authorId);x.set(f.id,v!==void 0&&p-v<Re?"handed-off":"dropped")}return s.useEffect(()=>{if(!r)return;y.current=new Set(e.map(v=>v.id));const f=u();for(const v of o)i.current.set(v,f);for(const[v,I]of i.current)f-I>Re&&i.current.delete(v);for(const v of d.current.keys())y.current.has(v)||d.current.delete(v)}),x}function an({kind:e}){return e==="thread-error"?t.jsxs("div",{"data-slot":"thread-notice","data-testid":"room-thread-error",className:"text-muted-foreground flex flex-col items-center gap-2 px-[var(--msg-padding-x)] py-6 text-center text-sm",children:[t.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load this thread"}),t.jsx("p",{className:"max-w-sm text-xs",children:"Nothing was lost. Reload to try again."})]}):e==="thread-waiting"?t.jsxs("div",{"data-slot":"thread-notice",className:"flex flex-col gap-2 px-[var(--msg-padding-x)]",children:[t.jsx(Q,{className:"h-3 w-24"}),t.jsx(Q,{className:"h-3 w-full max-w-sm"})]}):t.jsx("p",{"data-slot":"thread-notice","data-testid":"room-thread-orphan",className:"text-muted-foreground border-b px-[var(--msg-padding-x)] pb-3 text-xs italic",children:"This thread’s first message is gone. Its replies remain."})}function dn({room:e,rootEntryId:o,focusComposer:r,entries:u,reactionFrequents:y,streamStalled:i,streamUnavailable:d,onRetryStream:w,historyLoaded:R,historyFailed:x=!1,landOnRow:p,pushed:f,onClose:v}){const I=s.useMemo(()=>le(e.members,e.formerAuthors),[e.members,e.formerAuthors]),k=Me({room:e,threadRootId:o}),A=Ie(e.members,e.viewerAuthorId),j=ue(),S=s.useMemo(()=>new Map([...I].map(([n,m])=>[n,m.displayName])),[I]),{root:l,replies:c}=s.useMemo(()=>{let n;const m=[];for(const b of u)b.id===o?n=b:ce(b)===o&&m.push(b);return{root:n,replies:m}},[u,o]),C=l==null?void 0:l.threadReplyCount,N=C!==void 0&&C>c.length,P=!f,E=l===void 0||N?-1:(P?1:0)+c.length,T=Ne(c.length,C),M=s.useMemo(()=>new Set(c.map(n=>n.id)),[c]),L=s.useMemo(()=>({replyIds:M,inside:!0}),[M]),H=at(e.id,L),F=ke(e.id,o),D=on(c,H,R),q=s.useRef(null),z=s.useCallback(n=>{var m;(m=q.current)==null||m.scrollToRow(n)},[]),$=s.useRef(null);s.useEffect(()=>{var n;r||(n=$.current)==null||n.focus()},[o,r]);const K=n=>{n.key!=="Escape"||n.defaultPrevented||(n.stopPropagation(),v())},O=s.useMemo(()=>{const n=[];if(l===void 0){const m=x?"thread-error":R?"thread-orphan":"thread-waiting";n.push({kind:"notice",id:m,at:"",body:null})}else P&&n.push({kind:"message",id:l.id,payload:l,grouping:{position:"only"},author:G(V(l,I),I,j.faces),at:l.createdAt});for(const m of c)n.push({kind:"message",id:m.id,payload:m,grouping:{position:"only"},author:G(V(m,I),I,j.faces),at:m.createdAt});return n},[l,P,c,I,j.faces,x,R]),W=s.useCallback(n=>{if(n.kind==="notice")return t.jsx(an,{kind:n.id});if(n.kind!=="message")return null;const m=n.payload,b=l!==void 0&&m.id===l.id,a=c.findIndex(_=>_.id===m.id),h=t.jsx(oe,{roomId:e.id,entry:m,rowId:J(m.id),author:n.author,authorRef:I.get(m.authorId),authors:I,viewerAuthorId:e.viewerAuthorId,authorNames:S,reactionFrequents:y,streamStalled:i,isMember:A,grouping:{position:"only"},answers:Ae(m,a<=0?l:c[a-1],_=>(l==null?void 0:l.id)===_?l:c.find(Z=>Z.id===_)),feedPosition:{index:b?1:(l===void 0||!P?0:1)+a+1,total:E}});if(b)return t.jsxs(t.Fragment,{children:[h,t.jsx(ye,{count:T})]});const g=D.get(m.id)??"at-rest";return t.jsx("div",{className:ee(g==="dropped"&&"motion-safe:animate-thread-reply-in",g==="handed-off"&&"motion-safe:animate-reply-settle"),children:h})},[l,P,c,T,D,e.id,e.viewerAuthorId,I,S,y,i,A,E]),B=s.useCallback(n=>n.kind==="message"?J(n.id):void 0,[]);return t.jsx(Se,{known:j,children:t.jsx(X.Root,{surface:"room",capabilities:fe,target:k.target,anchor:"rail",children:t.jsxs("section",{ref:$,"aria-label":"Thread","data-testid":"room-thread-panel",tabIndex:-1,onKeyDown:K,className:ee("bg-card flex min-h-0 flex-col outline-none",f?"h-full w-full":"w-full border-l"),children:[f?t.jsxs("header",{className:"flex items-center gap-2 border-b px-1 py-1",children:[t.jsxs("button",{type:"button",onClick:v,"aria-label":`Back to ${Y(e)}`,"data-testid":"room-thread-back",className:"focus-ring text-muted-foreground hover:text-foreground flex h-11 min-w-0 items-center gap-1 rounded px-2 text-sm",children:[t.jsx(it,{"aria-hidden":!0,className:"size-4 shrink-0"}),t.jsx("span",{className:"truncate",children:Y(e)})]}),t.jsx("p",{className:"ml-auto shrink-0 pr-3 text-sm font-medium",children:"Thread"})]}):t.jsxs("header",{className:"flex items-center gap-2 border-b px-3 py-2",children:[t.jsx("button",{type:"button",onClick:v,"aria-label":"Close thread",className:"focus-ring text-muted-foreground hover:text-foreground relative -ml-1 rounded p-1",children:t.jsx(dt,{"aria-hidden":!0,className:"size-4"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm font-medium",children:"Thread"}),t.jsx("p",{className:"text-muted-foreground truncate text-xs",children:Y(e)})]})]}),f&&l!==void 0&&t.jsxs("div",{"data-testid":"room-thread-pinned-root",className:"max-h-[40%] shrink-0 overflow-y-auto border-b pt-2",children:[t.jsx(oe,{roomId:e.id,entry:l,rowId:J(l.id),author:G(V(l,I),I,j.faces),authorRef:I.get(l.authorId),authors:I,viewerAuthorId:e.viewerAuthorId,authorNames:S,reactionFrequents:y,streamStalled:i,isMember:A,grouping:{position:"only"}}),t.jsx(ye,{count:T})]}),t.jsx(X.Timeline,{ref:q,conversationId:`thread-${o}`,label:`Thread in ${Y(e)}`,busy:!R&&!x,rows:O,renderRow:W,domIdOf:B,...p===void 0?{}:{landOnRow:p},pending:F,viewerAuthorId:e.viewerAuthorId,className:"py-3",feedTestId:"room-thread-feed"}),t.jsx(Ee,{room:e,entries:u,scope:L,laneScope:"thread",stalled:f&&i===!0,unavailable:d,onRetry:f?w:void 0,onScrollToRow:z}),t.jsx(Te,{room:e,threadRootId:o,attachments:k.attachments,focusOnMount:r},o)]})})})}function ye({count:e}){return e===0?null:t.jsxs("div",{"aria-hidden":!0,"data-testid":"room-thread-divider",className:"flex items-center gap-2 px-[var(--msg-padding-x)] pt-1 pb-2",children:[t.jsx("span",{className:"text-muted-foreground shrink-0 text-xs",children:e===1?"1 reply":`${e} replies`}),t.jsx("span",{className:"bg-border h-px flex-1"})]})}const ln=96,un=500;function cn(e){return e.offset.x>ln||e.velocity.x>un}function fn({children:e,onClose:o}){const r=lt()===!0,u=r?{x:0}:{x:"100%"};return t.jsx(ut.div,{"data-testid":"room-thread-sheet",className:"bg-card absolute inset-0 z-10 flex flex-col shadow-xl",initial:u,animate:{x:0},exit:u,transition:r?{duration:0}:{duration:.22,ease:[.32,.72,0,1]},drag:"x",dragDirectionLock:!0,dragConstraints:{left:0,right:0},dragElastic:{left:0,right:.9},dragMomentum:!1,onDragEnd:(y,i)=>{cn(i)&&o()},children:e})}const te="room-thread-split",mn=320,hn=360,pn=40,gn=50,xn=25;function ve(e,o){return o<=0?xn:Math.min(Math.round(e/o*1e3)/10,gn)}function Rn(e){const o=ve(mn,e),r=Math.round((100-ve(hn,e))*10)/10;return{minPct:o,maxPct:r,defaultPct:Math.min(Math.max(pn,o),r)}}function yn(e,o,r){if(e===null||o===null||o<=0)return r.defaultPct;const u=e/o*100;return Math.round(Math.min(Math.max(u,r.minPct),r.maxPct)*10)/10}function vn(e){try{const o=localStorage.getItem(e),r=o===null?NaN:Number(o);return Number.isFinite(r)&&r>0?r:null}catch{return null}}function bn(e,o){try{localStorage.setItem(e,String(Math.round(o)))}catch{}}const jn="react-resizable-panels:room-thread-split";function wn(){try{localStorage.removeItem(jn)}catch{}}function In(){const[e,o]=s.useState(null),[r,u]=s.useState(null);return{ref:s.useCallback(i=>{if(i===null)return;o(i);const d=()=>u(i.offsetWidth);d();const w=new ResizeObserver(d);return w.observe(i),()=>{w.disconnect(),o(null),u(null)}},[]),element:e,width:r,sizing:Rn(r??0)}}const kn=`${te}-room`,be=`${te}-thread`,je=`${te}-handle`,An=4;function Nn({room:e,thread:o,storageKey:r=ft.ROOM_THREAD_WIDTH}){const{ref:u,element:y,width:i,sizing:d}=In(),[w,R]=s.useState(()=>vn(r)),[x,p]=s.useState(null),f=s.useRef(null),v=yn(w,i,d),I=i===null||(d.maxPct-d.minPct)/100*i<An,k=o!==!1;s.useEffect(wn,[]);const A=s.useRef(!1);s.useLayoutEffect(()=>{var c;A.current&&((c=f.current)==null||c.resize(v))},[v,k]);const j=s.useRef(null),S=()=>{var P;const c=(P=f.current)==null?void 0:P.getSize(),C=j.current;if(j.current=null,c===void 0||i===null||i<=0||C===c)return;const N=Math.round(c/100*i);R(N),bn(r,N)},l=x??v;return s.useLayoutEffect(()=>{const c=y==null?void 0:y.querySelector(`[data-panel-resize-handle-id="${je}"]`);c&&(c.setAttribute("aria-controls",be),c.setAttribute("aria-valuenow",String(Math.round(l))),c.setAttribute("aria-valuemin",String(Math.round(d.minPct))),c.setAttribute("aria-valuemax",String(Math.round(d.maxPct))))}),t.jsx("div",{ref:u,className:"h-full overflow-hidden",children:t.jsxs(ct,{direction:"horizontal",id:te,onLayout:c=>{A.current=c.length>1,p(A.current?c[1]:null)},children:[t.jsx(pe,{id:kn,order:1,className:"flex",children:e}),k&&t.jsxs(t.Fragment,{children:[t.jsx(yt,{id:je,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:I,onDragging:c=>{var C;c&&(j.current=((C=f.current)==null?void 0:C.getSize())??null)},onKeyDownCapture:c=>{var C,N;I||(j.current=((C=f.current)==null?void 0:C.getSize())??null,!(c.key!=="Home"&&c.key!=="End")&&(c.preventDefault(),(N=f.current)==null||N.resize(c.key==="Home"?d.minPct:d.maxPct)))},onResizeEnd:S}),t.jsx(pe,{ref:f,id:be,order:2,defaultSize:v,minSize:d.minPct,maxSize:d.maxPct,className:"flex",children:o})]})]})})}function Fn({roomId:e,threadId:o,entrySeq:r,threadRoute:u,aboveTimeline:y,aboveComposer:i,offerJumpBackIn:d,onComposerFocusChange:w}){const R=mt(),x=vt(),p=ht(e),f=p==null?void 0:p.rootEntryId,v=Vt(),I=s.useCallback(()=>{var m;const n=(m=U.getState().open[e])==null?void 0:m.rootEntryId;U.getState().closeThread(e),n!==void 0&&v.arm(n)},[e,v]),k=s.useCallback(n=>{U.getState().openThread(e,n)},[e]),A=pt(e),j=gt(e),S=wt(e,j.isSuccess);It(e);const l=A.data,c=s.useMemo(()=>j.data??[],[j.data]),C=Me({room:l});Zt({roomId:e,route:u,urlThreadId:o,openThreadId:f,entries:c,historyLoaded:j.isSuccess});const N=s.useMemo(()=>{var n;return((n=l==null?void 0:l.members.find(m=>m.author.id===l.viewerAuthorId))==null?void 0:n.lastReadSeq)??null},[l]),P=Xt(e,N);xt(l,c);const E=s.useRef(null),T=s.useRef(void 0),M=s.useCallback(n=>{T.current=n},[]),L=s.useCallback(()=>T.current,[]);s.useLayoutEffect(()=>{T.current=void 0},[e]);const H=s.useCallback(n=>{var m;(m=E.current)==null||m.scrollToRow(n)},[]),F=qt(e),{loadOlder:D,cursor:q}=F,z=s.useCallback(()=>{const n=Ct(c,q);D().then(()=>{n!==null&&requestAnimationFrame(()=>{var m;return(m=E.current)==null?void 0:m.scrollToRow(n.domId)})})},[c,q,D]),$=Ut({roomId:e,entrySeq:r,entries:c,historyLoaded:j.isSuccess}),K=s.useMemo(()=>f===void 0?void 0:{replyIds:new Set(c.filter(m=>ce(m)===f).map(m=>m.id)),inside:!1},[c,f]);if(A.isLoading)return t.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:t.jsx(Pe,{})});if(A.isError||!l)return t.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[t.jsx("p",{className:"text-foreground font-medium",children:"That channel or DM isn’t here"}),t.jsx("p",{className:"max-w-sm",children:"It may be archived, or the link is old."})]});const O=p!==void 0&&t.jsx(dn,{room:l,rootEntryId:p.rootEntryId,focusComposer:p.focusComposer,entries:c,reactionFrequents:l.reactionFrequents,streamStalled:S.stalled,streamUnavailable:S.unavailable,onRetryStream:S.retry,historyLoaded:j.isSuccess,historyFailed:j.isError,...$.threadRow===void 0?{}:{landOnRow:$.threadRow},pushed:R,onClose:I},p.rootEntryId),W=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[y,t.jsx(Gt,{ref:E,roomId:l.id,roomName:Y(l),viewerAuthorId:l.viewerAuthorId,entries:c,members:l.members,formerAuthors:l.formerAuthors,lastReadSeq:P,reactionFrequents:l.reactionFrequents,streamStalled:S.stalled,isLoading:j.isLoading,error:j.error,onAddAgents:()=>ge("add",l.id),openThreadId:f,onOpenThread:k,resumeRow:L,...$.roomRow===void 0?{}:{landOnRow:$.roomRow},onTopRow:M,canLoadOlder:F.canLoadOlder,isLoadingOlder:F.isLoadingOlder,onLoadOlder:z}),i,t.jsx(tn,{roomId:l.id}),t.jsx(nn,{roomId:l.id}),t.jsx(Ee,{room:l,entries:c,scope:K,laneScope:"room",stalled:S.stalled,unavailable:S.unavailable,onRetry:S.retry,onScrollToRow:H}),t.jsx(en,{room:l,hasEntries:c.length>0,onAddAgents:()=>ge("add",l.id)}),t.jsx(Te,{room:l,attachments:C.attachments,offerJumpBackIn:d,onFocusChange:w},l.id)]}),B={surface:"room",capabilities:fe,target:C.target,anchor:"rail"};return R?t.jsx(X.Root,{...B,children:t.jsx("div",{style:{paddingBottom:x},"data-testid":"room-surface",className:"flex h-full flex-col overflow-hidden",children:t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col overflow-hidden",children:[t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",inert:O!==!1,"data-testid":"room-under-thread",children:W}),t.jsx(Rt,{initial:!1,children:O!==!1&&t.jsx(fn,{onClose:I,children:O},`thread-${f}`)})]})})}):t.jsx(X.Root,{...B,children:t.jsx(Nn,{room:W,thread:O})})}export{Fn as R,$t as T,Pe as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as d,i as l,j as e,e as m,k as u,C as c,l as x,n as h,H as f}from"./index-
|
|
1
|
+
import{h as d,i as l,j as e,e as m,k as u,C as c,l as x,n as h,H as f}from"./index-DwrBsA10.js";function g({kind:s}){const r="text-muted-foreground size-3.5 shrink-0";return s==="dm"?e.jsx(h,{"aria-hidden":!0,className:r}):e.jsx(f,{"aria-hidden":!0,className:r})}function p(s){return s===1?"1 member":`${s} members`}function N({member:s}){var i;const r=d(),n=l(s.id);if(n.isPending)return e.jsx(m,{className:"h-16 w-full"});if(n.isError)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this member’s rooms."});const a=((i=n.data)==null?void 0:i.rooms)??[];return a.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.isSelf?"You aren’t":`${s.displayName} isn’t`," in any rooms yet."]}):e.jsx("div",{className:"flex flex-col",children:a.map(t=>{const o=e.jsxs(e.Fragment,{children:[e.jsx(g,{kind:t.kind}),e.jsx("span",{className:"min-w-0 truncate text-sm",children:u({kind:t.kind,slug:t.slug,title:t.name})}),e.jsx("span",{className:"text-muted-foreground ml-auto shrink-0 text-xs",children:p(t.memberCount)})]});return r?e.jsxs("button",{type:"button","data-slot":"profile-room-row",onClick:()=>void r({...x.channels(),search:{id:t.id}}),className:"focus-ring hover:bg-muted/50 flex h-9 items-center gap-2 rounded-md px-2 text-left transition-colors",children:[o,e.jsx(c,{"aria-hidden":!0,className:"text-muted-foreground/70 size-3.5 shrink-0"})]},t.id):e.jsx("div",{"data-slot":"profile-room-row",className:"flex h-9 items-center gap-2 rounded-md px-2",children:o},t.id)})})}export{N as RoomsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as D,j as e,a0 as ye,by as Ee,ar as we,G as N,eg as de,bz as ue,bA as fe,bB as me,bD as xe,eh as Te,a1 as Ae,a3 as ke,a4 as De,ad as pe,as as Le,dS as he,ei as Oe,ej as Ie,ek as Pe,a8 as j,el as _e,dV as H,em as Ue,am as be,B as $e,T as Re,b as He,e as Me,en as Be,eo as ze,ep as Ke,eq as qe,er as Ve,es as Qe}from"./index-DSYz85aL.js";import{C as ce}from"./runtime-connect-Dn0T5YWv.js";import{a as Fe,d as Ge,k as We,e as k}from"./execution-config-ryHuiBdx.js";import{U as Xe}from"./unverified-catalog-notice-DAhwNpy_.js";import{s as Ye}from"./settings-for-runtime-BoOa-ZFG.js";const Je={duration:.12,ease:"easeOut"},Ze={type:"spring",stiffness:320,damping:28};function ge({isSetHere:a,serverDefault:l,onUseServerDefault:d,warning:r,className:s,"data-testid":i}){const[u,f]=D.useState(!1),o=a?"Set here":`Server default · ${l??"none"}`,n=a&&!!d,x=e.jsxs("span",{className:N("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",r?de.warning:de.neutral,n&&"hover:bg-accent hover:text-accent-foreground transition-colors",s),"data-testid":i,children:[r&&e.jsx(ye,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(Ee,{mode:"wait",initial:!1,children:e.jsx(we.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:Ze},exit:{opacity:0},transition:Je,children:o},o)})]});return n?e.jsxs(ue,{open:u,onOpenChange:f,children:[e.jsx(fe,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${r?`: ${r}`:""}`,children:x})}),e.jsxs(me,{className:"w-64 p-2",align:"start",children:[e.jsx(xe,{children:"Where this value comes from"}),r&&e.jsx("p",{className:N("px-2 pt-1 text-xs",Te.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{d(),f(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":i?`${i}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["Currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"Not set. Uses the built-in default."})]})]})]}):r?e.jsx("span",{title:r,"aria-label":`${o}: ${r}`,children:x}):x}const et=["agents"];function tt(a){const l=Ae(),d=ke();return De({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:r=>l.updateMeshAgent(r.id,r.updates),onSuccess:()=>{d.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{d.invalidateQueries({queryKey:et})}})}const ve="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function $({label:a,valueLabel:l,options:d,selected:r,isSetHere:s,serverDefault:i,warning:u,onSelect:f,onInherit:o,testId:n,showHeader:x=!0,className:C,describedBy:m,inheritText:L}){const w=pe(),[S,h]=D.useState(!1);return e.jsxs("div",{className:N("space-y-1",C),children:[x&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ve,children:a}),!w&&e.jsx(ge,{isSetHere:s,serverDefault:i,warning:u,onUseServerDefault:o,"data-testid":`${n}-chip`})]}),e.jsxs(ue,{open:S,onOpenChange:h,children:[e.jsx(fe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...m?{"aria-describedby":m}:{},"data-testid":n,children:[e.jsx("span",{className:N("truncate",u?"text-status-warning-fg":s?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(Re,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(me,{className:"w-64 p-1",align:"start",children:[e.jsx(xe,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:d.map(c=>e.jsxs("button",{type:"button","data-testid":`${n}-option-${c.value}`,onClick:()=>{f(c.value),h(!1)},className:N("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",c.value===r&&"bg-accent"),children:[c.label,c.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:c.hint})]},c.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),h(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${n}-inherit`,children:L??(i?`Use server default: ${i}`:"Use server default")})]})]})]})}function st({agent:a,onUpdate:l,className:d}){var ee,te,se,ae,ne,le,oe,re,ie;const r=pe(),{data:s}=Le(),{data:i,isPending:u}=he(),f=((ee=s==null?void 0:s.executionDefaults)==null?void 0:ee.runtime)??"claude-code",o=a.runtime??f,n=(te=s==null?void 0:s.executionDefaults)==null?void 0:te.perRuntime.find(t=>t.runtime===o),{data:x}=Oe(),C=Fe(a,{defaultRuntime:f,runtimeDeclaresCredits:t=>{var b;return((b=i==null?void 0:i.capabilities[t])==null?void 0:b.credits)!==void 0},credits:(se=s==null?void 0:s.claudeCode)==null?void 0:se.credits,runtimeDefaultsToCredits:t=>{var b,A;return((A=(b=x==null?void 0:x.defaults)==null?void 0:b[t])==null?void 0:A.runsOn)==="credits"}}),{data:m,isError:L}=Ie({runtime:o,...C?{account:j}:{}}),w=a.model!=null,S=a.effort!=null,h=(n==null?void 0:n.model)??null,c=C&&(m??[]).some(t=>t.paidFromCredits),y=c?(m??[]).find(t=>t.isDefault):void 0,T=a.model??h??(y==null?void 0:y.value)??null,M=o==="doe"&&c&&!w&&!h,p=T?(m??[]).find(t=>t.value===T):void 0,O=(n==null?void 0:n.supportsEffort)??((ae=Ye(i,o))==null?void 0:ae.supportsEffort),B=O===void 0&&u,z=O!==!1,K=p?p.supportsEffort??!1:void 0,q=(ne=s==null?void 0:s.claudeCode)==null?void 0:ne.accounts,{nameFor:V,creditsEntry:je,resolvedAccount:Q}=Pe(),F=je??(a.account===j&&((le=s==null?void 0:s.claudeCode)!=null&&le.credits)?{path:s.claudeCode.credits.path}:null),g=q&&[...q.flatMap(t=>t.id===null?[]:[{id:t.id,label:V(t.path),path:t.path}]),...F?[{id:j,label:_e,path:F.path}]:[]],v=a.account??null,G=v!==null,W=o==="claude-code"&&v===j&&((oe=s==null?void 0:s.claudeCode)==null?void 0:oe.credits)!==void 0&&!s.claudeCode.credits.allowedAgents.includes(a.id),I=s!=null&&s.claudeCode&&Q?V(Q):null,P=tt({errorLabel:"Couldn’t change this agent’s account"}),_=D.useCallback(t=>{P.mutate({id:a.id,updates:{account:t}})},[a.id,P]),Ne=Ge({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:f,serverDefaultModel:h,knownModels:We(m),knownAccounts:g,accountsUnavailable:(re=s==null?void 0:s.claudeCode)==null?void 0:re.accountsUnavailable,modelSupportsEffort:K,runtimeSupportsEffort:O,runtimeLabel:t=>H(t).label}),E=t=>{var b;return((b=Ne.breakages.find(A=>t.includes(A.kind)))==null?void 0:b.message)??null},U=!B&&z&&K!==!1,X=a.effort??(n==null?void 0:n.effort)??null,Y=H(o).label,Ce=o==="claude-code"&&g!==void 0&&(g.length>1||G),Se=E(["account-unregistered"]),J=(m??[]).some(t=>t.unverified),Z=D.useId();return e.jsxs("div",{className:N("grid grid-cols-2 gap-3",d),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{label:"Model",valueLabel:M?ce:(p==null?void 0:p.displayName)??T??(c?"Default":"Automatic"),options:[...(m??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:T,isSetHere:w,serverDefault:(n==null?void 0:n.model)??null,warning:E(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:J?Z:void 0,inheritText:M?ce:c&&!h?y?`Use the suggested model: ${y.displayName}`:"Use the default model":void 0}),J&&e.jsx(Xe,{id:Z}),c&&(m??[]).some(t=>t.creditsListOutOfDate)&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-out-of-date",children:"The models your DorkOS credits cover may be out of date."}),C&&L&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-unavailable",children:"Couldn’t load the models DorkOS credits cover. Try again in a moment."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ve,children:"Effort"}),(!r||!U)&&(S||U)&&e.jsx(ge,{isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:E(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),B?e.jsx(R,{testId:"agent-effort-pending",text:`Checking what ${Y} supports`,warning:null}):z?U?e.jsx($,{label:"Effort",valueLabel:k(X),options:Ue.filter(t=>!(p!=null&&p.supportedEffortLevels)||p.supportedEffortLevels.includes(t)).map(t=>({value:t,label:k(t)})),selected:X,isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(R,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:E(["effort-unsupported-model"])}):e.jsx(R,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${Y}`,warning:E(["effort-unsupported-runtime"])})]}),Ce&&e.jsx($,{label:"Account",valueLabel:W?I??"Default":v!==null?((ie=g==null?void 0:g.find(t=>t.id===v))==null?void 0:ie.label)??v:I??"Default",options:(g??[]).map(t=>({value:t.id,label:t.label,hint:t.id===j?"Paid from your DorkOS account":be(t.path)})),selected:v,isSetHere:G,serverDefault:I,warning:Se,onSelect:t=>_(t),onInherit:()=>_(null),testId:"agent-account-row",className:"col-span-full"}),W&&e.jsxs("div",{className:"text-muted-foreground col-span-full flex flex-wrap items-center gap-2 text-xs","data-testid":"agent-credits-not-allowed",children:[e.jsx("span",{children:"This agent’s settings name DorkOS credits. It uses your default until you allow it."}),e.jsx($e,{size:"sm",variant:"outline",className:"h-6 px-2 text-xs",disabled:P.isPending,onClick:()=>_(j),children:"Allow"})]})]})}function R({text:a,warning:l,testId:d}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":d,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const at="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function dt({member:a}){const{agent:l,projectPath:d,isPending:r,update:s}=He(a),{data:i}=he();if(r)return e.jsx(Me,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const u=i?Object.keys(i.capabilities):[l.runtime],f=u.includes(l.runtime)?u:[l.runtime,...u];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:at,children:"Runs on"}),e.jsxs(Be,{value:l.runtime??"claude-code",onValueChange:o=>s({runtime:o}),children:[e.jsx(ze,{className:"h-8 text-sm",responsive:!1,children:e.jsx(Ke,{})}),e.jsx(qe,{children:f.map(o=>e.jsx(Ve,{value:o,responsive:!1,children:H(o).label},o))})]})]}),e.jsx(st,{agent:l,onUpdate:s,className:"grid-cols-1"}),d&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(Qe,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:be(d)})]})]})}export{dt as RunsOnPopover};
|
|
1
|
+
import{r as D,j as e,a0 as ye,by as Ee,ar as we,G as N,e6 as de,bz as ue,bA as fe,bB as me,bD as xe,e7 as Ae,a1 as Te,a3 as ke,a4 as De,ad as pe,aN as Le,e8 as he,e9 as Oe,ea as Ie,eb as Pe,a8 as j,ec as _e,ed as H,ee as Ue,am as be,B as $e,U as Re,b as He,e as Me,ef as Be,eg as ze,eh as Ke,ei as qe,ej as Qe,ek as Ve}from"./index-DwrBsA10.js";import{C as ce}from"./runtime-connect-Dn0T5YWv.js";import{a as Fe,d as Ge,k as We,e as k}from"./execution-config-BjNjQoBp.js";import{U as Xe}from"./unverified-catalog-notice-BbK4SCJp.js";import{s as Ye}from"./settings-for-runtime-BoOa-ZFG.js";const Je={duration:.12,ease:"easeOut"},Ze={type:"spring",stiffness:320,damping:28};function ge({isSetHere:a,serverDefault:l,onUseServerDefault:d,warning:r,className:s,"data-testid":i}){const[u,f]=D.useState(!1),o=a?"Set here":`Server default · ${l??"none"}`,n=a&&!!d,x=e.jsxs("span",{className:N("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",r?de.warning:de.neutral,n&&"hover:bg-accent hover:text-accent-foreground transition-colors",s),"data-testid":i,children:[r&&e.jsx(ye,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(Ee,{mode:"wait",initial:!1,children:e.jsx(we.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:Ze},exit:{opacity:0},transition:Je,children:o},o)})]});return n?e.jsxs(ue,{open:u,onOpenChange:f,children:[e.jsx(fe,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${r?`: ${r}`:""}`,children:x})}),e.jsxs(me,{className:"w-64 p-2",align:"start",children:[e.jsx(xe,{children:"Where this value comes from"}),r&&e.jsx("p",{className:N("px-2 pt-1 text-xs",Ae.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{d(),f(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":i?`${i}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["Currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"Not set. Uses the built-in default."})]})]})]}):r?e.jsx("span",{title:r,"aria-label":`${o}: ${r}`,children:x}):x}const et=["agents"];function tt(a){const l=Te(),d=ke();return De({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:r=>l.updateMeshAgent(r.id,r.updates),onSuccess:()=>{d.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{d.invalidateQueries({queryKey:et})}})}const ve="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function $({label:a,valueLabel:l,options:d,selected:r,isSetHere:s,serverDefault:i,warning:u,onSelect:f,onInherit:o,testId:n,showHeader:x=!0,className:C,describedBy:m,inheritText:L}){const w=pe(),[S,h]=D.useState(!1);return e.jsxs("div",{className:N("space-y-1",C),children:[x&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ve,children:a}),!w&&e.jsx(ge,{isSetHere:s,serverDefault:i,warning:u,onUseServerDefault:o,"data-testid":`${n}-chip`})]}),e.jsxs(ue,{open:S,onOpenChange:h,children:[e.jsx(fe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...m?{"aria-describedby":m}:{},"data-testid":n,children:[e.jsx("span",{className:N("truncate",u?"text-status-warning-fg":s?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(Re,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(me,{className:"w-64 p-1",align:"start",children:[e.jsx(xe,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:d.map(c=>e.jsxs("button",{type:"button","data-testid":`${n}-option-${c.value}`,onClick:()=>{f(c.value),h(!1)},className:N("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",c.value===r&&"bg-accent"),children:[c.label,c.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:c.hint})]},c.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),h(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${n}-inherit`,children:L??(i?`Use server default: ${i}`:"Use server default")})]})]})]})}function st({agent:a,onUpdate:l,className:d}){var ee,te,se,ae,ne,le,oe,re,ie;const r=pe(),{data:s}=Le(),{data:i,isPending:u}=he(),f=((ee=s==null?void 0:s.executionDefaults)==null?void 0:ee.runtime)??"claude-code",o=a.runtime??f,n=(te=s==null?void 0:s.executionDefaults)==null?void 0:te.perRuntime.find(t=>t.runtime===o),{data:x}=Oe(),C=Fe(a,{defaultRuntime:f,runtimeDeclaresCredits:t=>{var b;return((b=i==null?void 0:i.capabilities[t])==null?void 0:b.credits)!==void 0},credits:(se=s==null?void 0:s.claudeCode)==null?void 0:se.credits,runtimeDefaultsToCredits:t=>{var b,T;return((T=(b=x==null?void 0:x.defaults)==null?void 0:b[t])==null?void 0:T.runsOn)==="credits"}}),{data:m,isError:L}=Ie({runtime:o,...C?{account:j}:{}}),w=a.model!=null,S=a.effort!=null,h=(n==null?void 0:n.model)??null,c=C&&(m??[]).some(t=>t.paidFromCredits),y=c?(m??[]).find(t=>t.isDefault):void 0,A=a.model??h??(y==null?void 0:y.value)??null,M=o==="doe"&&c&&!w&&!h,p=A?(m??[]).find(t=>t.value===A):void 0,O=(n==null?void 0:n.supportsEffort)??((ae=Ye(i,o))==null?void 0:ae.supportsEffort),B=O===void 0&&u,z=O!==!1,K=p?p.supportsEffort??!1:void 0,q=(ne=s==null?void 0:s.claudeCode)==null?void 0:ne.accounts,{nameFor:Q,creditsEntry:je,resolvedAccount:V}=Pe(),F=je??(a.account===j&&((le=s==null?void 0:s.claudeCode)!=null&&le.credits)?{path:s.claudeCode.credits.path}:null),g=q&&[...q.flatMap(t=>t.id===null?[]:[{id:t.id,label:Q(t.path),path:t.path}]),...F?[{id:j,label:_e,path:F.path}]:[]],v=a.account??null,G=v!==null,W=o==="claude-code"&&v===j&&((oe=s==null?void 0:s.claudeCode)==null?void 0:oe.credits)!==void 0&&!s.claudeCode.credits.allowedAgents.includes(a.id),I=s!=null&&s.claudeCode&&V?Q(V):null,P=tt({errorLabel:"Couldn’t change this agent’s account"}),_=D.useCallback(t=>{P.mutate({id:a.id,updates:{account:t}})},[a.id,P]),Ne=Ge({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:f,serverDefaultModel:h,knownModels:We(m),knownAccounts:g,accountsUnavailable:(re=s==null?void 0:s.claudeCode)==null?void 0:re.accountsUnavailable,modelSupportsEffort:K,runtimeSupportsEffort:O,runtimeLabel:t=>H(t).label}),E=t=>{var b;return((b=Ne.breakages.find(T=>t.includes(T.kind)))==null?void 0:b.message)??null},U=!B&&z&&K!==!1,X=a.effort??(n==null?void 0:n.effort)??null,Y=H(o).label,Ce=o==="claude-code"&&g!==void 0&&(g.length>1||G),Se=E(["account-unregistered"]),J=(m??[]).some(t=>t.unverified),Z=D.useId();return e.jsxs("div",{className:N("grid grid-cols-2 gap-3",d),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{label:"Model",valueLabel:M?ce:(p==null?void 0:p.displayName)??A??(c?"Default":"Automatic"),options:[...(m??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:A,isSetHere:w,serverDefault:(n==null?void 0:n.model)??null,warning:E(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:J?Z:void 0,inheritText:M?ce:c&&!h?y?`Use the suggested model: ${y.displayName}`:"Use the default model":void 0}),J&&e.jsx(Xe,{id:Z}),c&&(m??[]).some(t=>t.creditsListOutOfDate)&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-out-of-date",children:"The models your DorkOS credits cover may be out of date."}),C&&L&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-unavailable",children:"Couldn’t load the models DorkOS credits cover. Try again in a moment."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ve,children:"Effort"}),(!r||!U)&&(S||U)&&e.jsx(ge,{isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:E(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),B?e.jsx(R,{testId:"agent-effort-pending",text:`Checking what ${Y} supports`,warning:null}):z?U?e.jsx($,{label:"Effort",valueLabel:k(X),options:Ue.filter(t=>!(p!=null&&p.supportedEffortLevels)||p.supportedEffortLevels.includes(t)).map(t=>({value:t,label:k(t)})),selected:X,isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(R,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:E(["effort-unsupported-model"])}):e.jsx(R,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${Y}`,warning:E(["effort-unsupported-runtime"])})]}),Ce&&e.jsx($,{label:"Account",valueLabel:W?I??"Default":v!==null?((ie=g==null?void 0:g.find(t=>t.id===v))==null?void 0:ie.label)??v:I??"Default",options:(g??[]).map(t=>({value:t.id,label:t.label,hint:t.id===j?"Paid from your DorkOS account":be(t.path)})),selected:v,isSetHere:G,serverDefault:I,warning:Se,onSelect:t=>_(t),onInherit:()=>_(null),testId:"agent-account-row",className:"col-span-full"}),W&&e.jsxs("div",{className:"text-muted-foreground col-span-full flex flex-wrap items-center gap-2 text-xs","data-testid":"agent-credits-not-allowed",children:[e.jsx("span",{children:"This agent’s settings name DorkOS credits. It uses your default until you allow it."}),e.jsx($e,{size:"sm",variant:"outline",className:"h-6 px-2 text-xs",disabled:P.isPending,onClick:()=>_(j),children:"Allow"})]})]})}function R({text:a,warning:l,testId:d}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":d,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const at="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function dt({member:a}){const{agent:l,projectPath:d,isPending:r,update:s}=He(a),{data:i}=he();if(r)return e.jsx(Me,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const u=i?Object.keys(i.capabilities):[l.runtime],f=u.includes(l.runtime)?u:[l.runtime,...u];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:at,children:"Runs on"}),e.jsxs(Be,{value:l.runtime??"claude-code",onValueChange:o=>s({runtime:o}),children:[e.jsx(ze,{className:"h-8 text-sm",responsive:!1,children:e.jsx(Ke,{})}),e.jsx(qe,{children:f.map(o=>e.jsx(Qe,{value:o,responsive:!1,children:H(o).label},o))})]})]}),e.jsx(st,{agent:l,onUpdate:s,className:"grid-cols-1"}),d&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(Ve,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:be(d)})]})]})}export{dt as RunsOnPopover};
|