dorkos 0.124.1 → 0.125.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +1418 -956
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-DHaZvsJE.js → AboutPage-DNNSr3b2.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-BP-qFk2S.js → ActivityErrorState-CXDzOpkQ.js} +1 -1
- package/dist/client/assets/{ActivityPage-Bme3TzdQ.js → ActivityPage-BXp-o5SB.js} +1 -1
- package/dist/client/assets/{ActivityRow-BRZyW9MA.js → ActivityRow-DDhj9QxV.js} +1 -1
- package/dist/client/assets/{AdapterIcon-BcfquTja.js → AdapterIcon-CXXdDfkv.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-B4I23pBg.js → AdapterSetupWizard-BLljbUjj.js} +2 -2
- package/dist/client/assets/{AgentOptionRow-Cb34LtmH.js → AgentOptionRow-BcNFNeXa.js} +1 -1
- package/dist/client/assets/{AgentPicker-ouNRFSDh.js → AgentPicker-D4o66W3h.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-B6MHIsxa.js → AgentRequestCard-C6aBR2TD.js} +4 -4
- package/dist/client/assets/{AppearancePage-CutehigK.js → AppearancePage-BbXPYAzg.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-B-wIUI27.js → ApplyToOverridesDialog-DG2dhgC7.js} +1 -1
- package/dist/client/assets/AttentionSignalRow-DQpV3YrI.js +1 -0
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-CdWF4WLz.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-BZReuFC7.js} +3 -3
- package/dist/client/assets/{BindingDialog-BAdueON5.js → BindingDialog-dKfunEtT.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-b30dG4gx.js → BlintzCanvas-D4mpLc0Z.js} +4 -4
- package/dist/client/assets/{CanvasCsvContent-DGHgSikG.js → CanvasCsvContent-DgUpsa5s.js} +4 -4
- package/dist/client/assets/CanvasFileContent-CfHHO1iy.js +2 -0
- package/dist/client/assets/CanvasModel3dContent-BZBPeTnP.js +2 -0
- package/dist/client/assets/ChannelComposer-Fmb-x_zK.js +44 -0
- package/dist/client/assets/{ChatAppsOff-DiObvmJS.js → ChatAppsOff-B8Afyn-8.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-BncI1OY1.js → CodeMirrorDiff-046sCUyi.js} +2 -2
- package/dist/client/assets/{CodeMirrorEditor-DV6psv19.js → CodeMirrorEditor-gqpifORb.js} +1 -1
- package/dist/client/assets/{CommitmentList-Dx_Ek_Gl.js → CommitmentList-DIO5Qd5w.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-Bca8NMUa.js → CommitmentsPage-DDYSjVdN.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-DNVNFTdn.js → ComputerResourceView-nLfGu6HH.js} +1 -1
- package/dist/client/assets/{ComputerViewer-D8SxJdMm.js → ComputerViewer-Cmw-5KwO.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-Bhj1YT15.js → ConnectionAccessLists-DNjf06tk.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-B20JZxoK.js → ConnectionsPage-Cshv0nqL.js} +2 -2
- package/dist/client/assets/{ConventionPage-De645wxU.js → ConventionPage-CWpUQZsc.js} +3 -3
- package/dist/client/assets/{ExtensionPageRoute-nTeiOBRQ.js → ExtensionPageRoute-D4d8hWqD.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-DM79UITv.js → FloatingTanStackRouterDevtools-CqogiFob-D8MtiBS3.js} +1 -1
- package/dist/client/assets/HandlePage-BFp054RW.js +1 -0
- package/dist/client/assets/{HeartbeatPage-CBoUxz6t.js → HeartbeatPage-DcQd3crO.js} +1 -1
- package/dist/client/assets/{KeyEntry-Cug8ocpX.js → KeyEntry-B1M6Cb_W.js} +1 -1
- package/dist/client/assets/{LexicalField-Bv_ogmAq.js → LexicalField-DglxKbVV.js} +2 -2
- package/dist/client/assets/{ManagesPage-DfJBQKK3.js → ManagesPage-CHnWwBcn.js} +1 -1
- package/dist/client/assets/{Marketplace-swCVUbdY.js → Marketplace-nlAKYRdC.js} +2 -2
- package/dist/client/assets/{MarketplaceSourcesView-CDZDChpV.js → MarketplaceSourcesView-Co53MiW9.js} +1 -1
- package/dist/client/assets/{McpAppFrame-BM9cNPPd.js → McpAppFrame-L2zafUSH.js} +1 -1
- package/dist/client/assets/{McpSigninBody-DKyUKrEE.js → McpSigninBody-DRxPP8Zc.js} +1 -1
- package/dist/client/assets/{Model3dViewer-rXSL5y2P.js → Model3dViewer-Bjxhkabj.js} +1 -1
- package/dist/client/assets/NamePage-CaA8-GZa.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-GCEMS5oV.js → NewDirectMessageMenu-BjCp-d3D.js} +1 -1
- package/dist/client/assets/{NotificationsPage-DSWsOVLa.js → NotificationsPage-DwkL4gtE.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-BTuctDj4.js → OpenMeshSwitch-BLE-N5Jb.js} +2 -2
- package/dist/client/assets/{OperatorIdentityForm-ODDMd2YN.js → OperatorIdentityForm-Bl5rL-MI.js} +1 -1
- package/dist/client/assets/{PermissionHistory-41a58Se7.js → PermissionHistory-T4I64dJP.js} +1 -1
- package/dist/client/assets/{PermissionsPage-DefmymZ6.js → PermissionsPage-CU2ztV8O.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-7zPVBI1I.js → PersonalityPopover-A50oTbpT.js} +1 -1
- package/dist/client/assets/PhotoPage-B-aM0VI7.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-CwGlBJ7U.js → PreviewRefusedNotice-B6hvUBqt.js} +1 -1
- package/dist/client/assets/ProfileFields-BIDZHo11.js +1 -0
- package/dist/client/assets/{ProfilePanelContainer-RrhoPD3T.js → ProfilePanelContainer-IHMOmga2.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-CXRVBCAu.js → ProfileRolePicker-Bg_Tf8eF.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-bBroJdTi.js → PromptSuggestionChips-BItU6w6K.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-CfPatsWM.js → ReportsToPopover-CohliF94.js} +1 -1
- package/dist/client/assets/RoomSurface-CAbD4wVy.js +1 -0
- package/dist/client/assets/{RoomsPage-C3dDp1Mb.js → RoomsPage-D8kdi2T4.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-BcKjfQi-.js → RunsOnPopover-BCCxm2Mk.js} +1 -1
- package/dist/client/assets/RuntimeConnectFlow-CXAcX8bE.js +1 -0
- package/dist/client/assets/{RuntimeSetupDialog-Bg-0b-LC.js → RuntimeSetupDialog-Cof6tku2.js} +1 -1
- package/dist/client/assets/SeenDevices-DVjFyFfQ.js +19 -0
- package/dist/client/assets/{SessionsPage-Cqfx4FGW.js → SessionsPage-DkThEA16.js} +1 -1
- package/dist/client/assets/SettingsDialog-DqaBWDI4.js +12 -0
- package/dist/client/assets/{SkillsPage-BleHQavF.js → SkillsPage-D8eM04tW.js} +1 -1
- package/dist/client/assets/TaskDialogWrapper-b6z6wcEV.js +1 -0
- package/dist/client/assets/{TasksEmptyState-Bprx1k8M.js → TasksEmptyState-D4XWi20k.js} +2 -2
- package/dist/client/assets/{TasksPage-Dub39yEJ.js → TasksPage-TK0pCu-r.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-CJ-NG0u5.js → TeamComputerEntry-BxNRBuRo.js} +1 -1
- package/dist/client/assets/{ToolsPage-IsD6M-ZW.js → ToolsPage-DpcUQDHa.js} +2 -2
- package/dist/client/assets/TopologyGraph-CFdwWKhT.js +30 -0
- package/dist/client/assets/{TourHost-BYfztuPb.js → TourHost-CViLk6JM.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-BKhgxVdF.js → UnlinkDialog-CHiFjqy9.js} +1 -1
- package/dist/client/assets/UnreadDivider-CNjRFpAY.js +1 -0
- package/dist/client/assets/{WidgetErrorCard-1NyzIJBj.js → WidgetErrorCard-D9LKAbNg.js} +3 -3
- package/dist/client/assets/WorkView-CDLKDo74.js +63 -0
- package/dist/client/assets/_shell-x_WZg6D7.js +80 -0
- package/dist/client/assets/{_shell._home-xWj7wO5z.js → _shell._home-eVhoIWNB.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-BqcLoaB1.js → _shell._home.activity-Btyz_JXC.js} +1 -1
- package/dist/client/assets/_shell._home.index-mdspCjhm.js +3 -0
- package/dist/client/assets/{_shell._home.tasks--UhQB6h3.js → _shell._home.tasks-C1zBEy4f.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-BPFD8Of2.js → _shell._home.workspaces-B7eLLMZo.js} +1 -1
- package/dist/client/assets/{_shell.channels-CnFdvRzc.js → _shell.channels-KC-oi383.js} +4 -4
- package/dist/client/assets/{_shell.connections-Ik01wS5M.js → _shell.connections-FwwnIiVq.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-Czu42kzo.js → _shell.feedback-requests-BiagdWVc.js} +1 -1
- package/dist/client/assets/_shell.marketplace-D5vPAK8b.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-DKXolkMK.js +1 -0
- package/dist/client/assets/_shell.session-CRLQUxCR.js +1 -0
- package/dist/client/assets/{_shell.team-UfaJqohh.js → _shell.team-B3A__-1w.js} +5 -5
- package/dist/client/assets/_shell.threads-C-eFVUo7.js +1 -0
- package/dist/client/assets/_shell.x._extensionId-Cy2JYMPv.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-Cy2JYMPv.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-oxkfGyl6.js → abnfDiagram-WEYOIA3C-RjxMmLSp.js} +1 -1
- package/dist/client/assets/{access-copy-Dggxx2cX.js → access-copy-robDo1S-.js} +1 -1
- package/dist/client/assets/{arc-CqQdP0Qe.js → arc-De3porJy.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-89xM7zJD.js → architectureDiagram-ZHVYKT53-U4UN3Fwb.js} +2 -2
- package/dist/client/assets/{banner-DqJ2pM0Y.js → banner-Bb9qmJFV.js} +2 -2
- package/dist/client/assets/{blockDiagram-RJAE7QA3-CcxwDmZC.js → blockDiagram-RJAE7QA3-CckMUzCn.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-DCIhIyXa.js → c4Diagram-XDPPPE54-4IXkmK3u.js} +1 -1
- package/dist/client/assets/{card-DT-vFAns.js → card-CHG8Y8EA.js} +1 -1
- package/dist/client/assets/channel-DT-ECQUE.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-BfWEXcCj.js → chunk-2E7WHVMD-DtPOfWfp.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-KLXLZXlR.js → chunk-2Q5K7J3B-Dk44yc47.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-CL5Gttmj.js → chunk-4EMNKR2T-K_Oa4h2U.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-cfAl84Mv.js → chunk-55XCU76K-CBCR5VUz.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-BqUyGgoH.js → chunk-5VM5RSS4-o7pQ4Ip8.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-BWr2ST9i.js → chunk-JWPE2WC7-DnjGyJd7.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-V5zYx50O.js → chunk-VQ5W62QI-C2_U7FnB.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-gnvheN_J.js → chunk-XXDRQBXY-BEWhI2hh.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-ClGxxZvV.js → chunk-ZCHMQSOR-B4HhT1sq.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-DvmHzDb5.js → classDiagram-v2-4MYWR3UA-DhCJ3JPo.js} +1 -1
- package/dist/client/assets/{command-CNx4L11m.js → command-BiVO_CS1.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-Df8nXBRj.js → cose-bilkent-JH36ORCC-xZpEDSd4.js} +1 -1
- package/dist/client/assets/{cpu-D8KJEkdh.js → cpu-DDZTaXtb.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-CAn6ufHs.js → cynefin-EF2NZ3EQ-Cgz_Z2on.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-Cep_NrRw.js → cynefinDiagram-WF24UDRP-BJFrcql_.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-sWD3z9wf.js → dagre-NK4GIZVX-BYAx5Cie.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-CUpaBATr.js → diagram-CBK3MWTC-DZ9R9gqz.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D-BejWB2ry.js → diagram-I5XIIV2D--bivdwUI.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-BGKJfNk9.js → diagram-ODIL2UCW-9hvkubLT.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-V0dP8H8k.js → diagram-PFBEJUXE-hVLmub11.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-Bf5dVsFX.js → diagram-RJA3I4VV-BB5ttZ9z.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-CLrMSqb4.js → diagram-TYUNFSNR-B_FkQUUF.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-BGG4CWA0.js → ebnfDiagram-V4P3TTPT-TS7ZNoLc.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-bf9D6f0w.js → elk-QONTBCTQ-BRCKNiM7.js} +1 -1
- package/dist/client/assets/{empty-state-CDoXnrKn.js → empty-state-BO-UXPQj.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-fEUv-33P.js → erDiagram-KYQIGQAA-DycIeIib.js} +1 -1
- package/dist/client/assets/{execution-config-Ca9MDOtV.js → execution-config-DEYWqx9f.js} +1 -1
- package/dist/client/assets/{file-CiyVL55_.js → file-DQJ4ncBH.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-DaFRIKco.js → file-exclamation-point-3K4for51.js} +1 -1
- package/dist/client/assets/{file-text-DsnD-A8g.js → file-text-3tteNtIM.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-CNsnCgbB.js → find-latest-widget-fence-C2e-pGhG.js} +2 -2
- package/dist/client/assets/{flowDiagram-IUGLLWBU-CRbeSDod.js → flowDiagram-IUGLLWBU-4-MVKKj-.js} +1 -1
- package/dist/client/assets/{form-Cru78aT-.js → form-DJvcnZrN.js} +1 -1
- package/dist/client/assets/{format-cron-9K38-tn1.js → format-cron-B6RtTy4x.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-Mkk7zgs_.js → ganttDiagram-R7GPNTJY-DXZ9M_09.js} +3 -3
- package/dist/client/assets/{git-branch-CONwEYiR.js → git-branch-B5MdRp1u.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-Drre0vyA.js → gitGraphDiagram-PDYL7XHY-CXZBvZz1.js} +1 -1
- package/dist/client/assets/{graph-BJlnKWgo.js → graph-Ok4GTm1i.js} +1 -1
- package/dist/client/assets/{heart-CqwUlIUG.js → heart-WdIkTWht.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-e4LXC_pS.js → highlighted-body-KPVGNVTW-BnvI3qHd.js} +1 -1
- package/dist/client/assets/image-lightbox-DSFIEDOy.js +1 -0
- package/dist/client/assets/{image-off-DZuLkaRJ.js → image-off-SpOmtTU2.js} +2 -2
- package/dist/client/assets/{index-DzwZJuO1.js → index-0TLaDwd7.js} +1 -1
- package/dist/client/assets/index-5kYaIjI6.js +1 -0
- package/dist/client/assets/{index-BTjZIgFn.js → index-8N601Ptt.js} +1 -1
- package/dist/client/assets/{index-BKp2B9JS.js → index-B5tjSdoa.js} +1 -1
- package/dist/client/assets/index-BAAZ_Afo.js +1 -0
- package/dist/client/assets/{index-x1yAu9zJ.js → index-BAP0wpId.js} +1 -1
- package/dist/client/assets/{index-CyVH876g.js → index-BBfQSvDI.js} +1 -1
- package/dist/client/assets/index-BDJuvXMG.js +1053 -0
- package/dist/client/assets/index-BFyPYiSk.js +1 -0
- package/dist/client/assets/index-BHnCpgC9.js +1 -0
- package/dist/client/assets/{index-CVuEUzi5.js → index-BPEGncOX.js} +1 -1
- package/dist/client/assets/{index-DDNwNOHF.js → index-BUlGEVe6.js} +1 -1
- package/dist/client/assets/index-Beqi9bTa.js +43 -0
- package/dist/client/assets/{index-DL8ISRMH.js → index-BwZrircO.js} +1 -1
- package/dist/client/assets/{index-Bd7vUYhr.js → index-C1t_dxLe.js} +1 -1
- package/dist/client/assets/{index-vJy88bwb.js → index-CA3lyhQr.js} +1 -1
- package/dist/client/assets/index-CGvU4pGg.js +23 -0
- package/dist/client/assets/{index-B_0LYi32.js → index-CO8DgOi_.js} +1 -1
- package/dist/client/assets/{index-1yEXEZiH.js → index-CS1S0apl.js} +1 -1
- package/dist/client/assets/{index-DAlpmAIA.js → index-CXyeZWZE.js} +1 -1
- package/dist/client/assets/{index-DijWcSDZ.js → index-C_mZH9d1.js} +3 -3
- package/dist/client/assets/{index-A41zxoWk.js → index-CebrNsDE.js} +1 -1
- package/dist/client/assets/{index-B25gvCK_.js → index-CejscP7D.js} +1 -1
- package/dist/client/assets/{index-BtDxwJsM.js → index-CjNQaSIo.js} +1 -1
- package/dist/client/assets/{index-skAhJyIF.js → index-Cjqqoh6c.js} +1 -1
- package/dist/client/assets/{index-HR8BYVRQ.js → index-CzUbn74z.js} +1 -1
- package/dist/client/assets/index-D2ZFfqZZ.css +1 -0
- package/dist/client/assets/{index-DabU6r9W.js → index-D6y63gKa.js} +3 -3
- package/dist/client/assets/{index-BV2Ezdxv.js → index-D8KycDT8.js} +1 -1
- package/dist/client/assets/{index-Bo7x9IkO.js → index-DG-QaLdS.js} +1 -1
- package/dist/client/assets/index-DN4ppujx.js +1 -0
- package/dist/client/assets/{index-cI2u8WZS.js → index-DYc5kmwr.js} +1 -1
- package/dist/client/assets/{index-pVFjKNjX.js → index-DZ9FOOp-.js} +1 -1
- package/dist/client/assets/{index-BIB-maE5.js → index-DaAe-kkp.js} +1 -1
- package/dist/client/assets/{index-mZqojApH.js → index-DlJvYygP.js} +1 -1
- package/dist/client/assets/{index-BBmkfbXd.js → index-DncDh-DQ.js} +1 -1
- package/dist/client/assets/index-Dy7lfs5H.js +2 -0
- package/dist/client/assets/{index-DdJBZE0H.js → index-F1p3rnVP.js} +1 -1
- package/dist/client/assets/{index-By58MgcZ.js → index-PXtYLHfj.js} +1 -1
- package/dist/client/assets/{index-BFNy-Yp3.js → index-Uuq_anEw.js} +1 -1
- package/dist/client/assets/{index-BDD2EyoW.js → index-VsLUphXS.js} +1 -1
- package/dist/client/assets/{index-LEcodwyW.js → index-Z7RWysQU.js} +1 -1
- package/dist/client/assets/index-elechdSH.js +1 -0
- package/dist/client/assets/{index-Vz7VUm9l.js → index-mYbSzZYJ.js} +1 -1
- package/dist/client/assets/index-qqbs2gqN.js +1 -0
- package/dist/client/assets/{index.esm-BUPoRUaG.js → index.esm-Cl_dMJjM.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-B_Wyzufh.js → infoDiagram-MVDRKAX5-BLyKorfr.js} +1 -1
- package/dist/client/assets/{inline-code-BIzGDx6z.js → inline-code-hmEz0OM4.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-BDk2-6Pd.js → ishikawaDiagram-HPEHV2GE-BrnGHajs.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-7qf9KWEQ.js → journeyDiagram-BOSHW7O7-BQft6X3_.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-CFYDQmXn.js → kanban-definition-FNSA4HC5-l4Lwd6a7.js} +1 -1
- package/dist/client/assets/{layers-C9tVVcXg.js → layers-DHQ_aTAp.js} +1 -1
- package/dist/client/assets/{lightbulb-f4jtsAh0.js → lightbulb-qcE7kdo5.js} +1 -1
- package/dist/client/assets/{link-2-ZNlK1BG1.js → link-2-DBDnK6MQ.js} +1 -1
- package/dist/client/assets/{list-runtime-types-CqO-QFYD.js → list-runtime-types-CaJn2_14.js} +1 -1
- package/dist/client/assets/{markdown-content-DaEVxezf.js → markdown-content-NzXgwE2G.js} +1 -1
- package/dist/client/assets/{mention-pill-BiCPflY-.js → mention-pill-CumFsu3I.js} +1 -1
- package/dist/client/assets/{mermaid.core-SX8SzrsU.js → mermaid.core-DP7EozpQ.js} +4 -4
- package/dist/client/assets/{message-square-off-_qbedNGF.js → message-square-off-Zgzm0pcy.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-BloJIArH.js → mindmap-definition-6OY57UG3-DXfFlXJZ.js} +1 -1
- package/dist/client/assets/{more-details-CdJT0Ehl.js → more-details-XSn-_PbH.js} +1 -1
- package/dist/client/assets/{owner-notice-BDafFD_I.js → owner-notice-C0ArQJdp.js} +1 -1
- package/dist/client/assets/{package-Cb7lEm7t.js → package-DAjaMh-O.js} +1 -1
- package/dist/client/assets/{page-container-DsRgIMAL.js → page-container-CGXX9atD.js} +1 -1
- package/dist/client/assets/pane-resize-handle-DAB3TvrY.js +1 -0
- package/dist/client/assets/{paperclip-DNu1VtoX.js → paperclip-C6yKmauj.js} +1 -1
- package/dist/client/assets/{path-input-D3O71b-X.js → path-input-mDIpl2-x.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-Di48kPNu.js → pegDiagram-ECIUJNBX-PjvGQ3d5.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-DY8B_SPD.js → pieDiagram-GNMPY74T-BRtspcrq.js} +1 -1
- package/dist/client/assets/{plug-IIS_cL9-.js → plug-BEjxxorV.js} +1 -1
- package/dist/client/assets/primer-trigger-BiiSNY7s.js +3 -0
- package/dist/client/assets/profile-errors-XchEnatB.js +1 -0
- package/dist/client/assets/{progress-g5kkqvlR.js → progress-BF25Vgvc.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-Depv_dON.js → quadrantDiagram-D57K4MC3--heUvlvX.js} +1 -1
- package/dist/client/assets/{query-error-state-PuLGD7Jp.js → query-error-state-C2EyJ_cl.js} +1 -1
- package/dist/client/assets/{radio-QOLZSBz1.js → radio-BTlBepzs.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-BfD2AiZM.js → railroadDiagram-Y72NRBL7-DI8BFDIm.js} +1 -1
- package/dist/client/assets/registry-ZygbjV-M.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-DF_DfZ7s.js → relay-trace-schemas-V7JmDMFe.js} +2 -2
- package/dist/client/assets/repeat-Dl9Z6gcw.js +11 -0
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-B1iTjrkD.js → requirementDiagram-EQYSW5RA-BocwQwBX.js} +1 -1
- package/dist/client/assets/{room-files-source-g1th8mWs.js → room-files-source-4I4JJamw.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-BGwYMaGL.js → rotate-ccw-clock-Cvx7qMiL.js} +1 -1
- package/dist/client/assets/{rotate-cw-B4Y0q4GY.js → rotate-cw-BS2tU5V-.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-D5TzVJrQ.js → sankeyDiagram-SY24JHO5-ezcikI89.js} +1 -1
- package/dist/client/assets/{scroll-area-BvScZKSa.js → scroll-area-CkX9hs5p.js} +1 -1
- package/dist/client/assets/{search-x-CqN5twBj.js → search-x-BqiSsIfJ.js} +2 -2
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-BhUahaNf.js → sequenceDiagram-BLEHNHQU-CoGhkN3M.js} +1 -1
- package/dist/client/assets/{shield-x-DHJrwtKp.js → shield-x-DxL97yUb.js} +1 -1
- package/dist/client/assets/signed-in-BPaLzWUS.js +1 -0
- package/dist/client/assets/{sizeCapture-INFHLROL-D2Vi1Kq9.js → sizeCapture-INFHLROL-CqWfeZMY.js} +1 -1
- package/dist/client/assets/{soul-file-BMpVFN7U.js → soul-file-BgdRcA9b.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-b9gSbZnF.js → stateDiagram-v2-A6IESKWZ-FWPmI7hi.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-i47jxLY6.js → swimlanes-B3ENRKFQ-BmnK0GaI.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-CPB9ed5R.js +8 -0
- package/dist/client/assets/{table-CN2HCi4p.js → table-C5zpnw52.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-eY5gj0js.js → timeline-definition-JXYKGLGB-BJRYVT6z.js} +1 -1
- package/dist/client/assets/{trust-posture-Bcyy5Fub.js → trust-posture-DxR7JKit.js} +1 -1
- package/dist/client/assets/{unplug-lkD35Rwp.js → unplug-Cbp9pPvY.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-DiCIrrhU.js → unverified-catalog-notice-v-qMrtTV.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-BrqVd-47.js → use-adapter-catalog-B3wTq44G.js} +1 -1
- package/dist/client/assets/{use-bindings-CU2RSXOy.js → use-bindings-BAKvriCK.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-Dy2oTM8Y.js → use-composer-prefs-BLOdXw95.js} +1 -1
- package/dist/client/assets/{use-connector-management-5oRqzydY.js → use-connector-management-CApx-e1Z.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-Bg5nW8qq.js → use-deep-link-scroll-DjC3PUqZ.js} +1 -1
- package/dist/client/assets/{use-delete-binding-qeyRkvR1.js → use-delete-binding-DIu3LTuB.js} +1 -1
- package/dist/client/assets/{use-dev-links-FY4J_PjA.js → use-dev-links-D5AXy-P_.js} +1 -1
- package/dist/client/assets/use-direct-message-panel-CzUy0Vi1.js +1 -0
- package/dist/client/assets/{use-external-adapter-catalog-HiWFZZrW.js → use-external-adapter-catalog-CzMLWn_7.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-K1uk9Wya.js → use-full-activity-feed-Ce5XvGGR.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-OolRlRyZ.js +1 -0
- package/dist/client/assets/use-is-hub-CCn7X2nA.js +1 -0
- package/dist/client/assets/{use-local-browser-CTFiF0wf.js → use-local-browser-Bw7S_z6h.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-CafidaIH.js → use-mesh-topology-42Fa1F-V.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-B38uSLCx.js → use-mounted-ref-NbCy8N-y.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-m9XSNB6W.js → use-notification-prefs-DAokZCgt.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-D9n6rNJ1.js → use-panel-tab-placements-Dbjj1FO5.js} +1 -1
- package/dist/client/assets/use-pending-read-BBA4gaxj.js +1 -0
- package/dist/client/assets/{use-personality-commit-ChLQfLrK.js → use-personality-commit-mY_GJ7u5.js} +1 -1
- package/dist/client/assets/{use-promo-activation-DbJDgp4_.js → use-promo-activation-CzAU3S9F.js} +3 -3
- package/dist/client/assets/{use-promo-dismissals-Csw0j0N0.js → use-promo-dismissals-gDFH0Uhg.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-BIZ7daHW.js → use-pulse-freshness-C6m4sn2E.js} +1 -1
- package/dist/client/assets/{use-relay-config-hUB3lVFv.js → use-relay-config-COZDw_jc.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-BpKzhniV.js → use-room-follow-claim-CTPdEUnW.js} +1 -1
- package/dist/client/assets/use-room-sessions-DiysSClf.js +1 -0
- package/dist/client/assets/{use-roving-tab-list-BtM0bZL7.js → use-roving-tab-list-PltEsGcU.js} +1 -1
- package/dist/client/assets/use-session-canvas-pL8waI_Q.js +27 -0
- package/dist/client/assets/use-status-budget-D-MyG_Pd.js +16 -0
- package/dist/client/assets/{use-unclaimed-chats-BbMZtNG9.js → use-unclaimed-chats-BrLVSVmS.js} +1 -1
- package/dist/client/assets/use-update-config-Cjq60G6n.js +1 -0
- package/dist/client/assets/{useMutationState-CVpvw27W.js → useMutationState-BwG8hXiA.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-CHcpeLg4.js → usecaseDiagram-WPOLBNNX-57NgEVRV.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-gQbZL_A6.js → vennDiagram-Q3Y3IDCW-CRKzxbya.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-BFH_WHzZ.js → wardleyDiagram-IVAIDKWA-wRMWM1mn.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-B0QpyqeZ.js → xychartDiagram-4URNHDU4-Bm6K2W58.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261020142444_read_cursor_room_thread.sql +17 -0
- package/dist/drizzle/20261021004938_dor3203_settle_turn_holds.sql +7 -0
- package/dist/drizzle/20261021153328_dor3175_person_chat_mode.sql +1 -0
- package/dist/drizzle/meta/20261020142444_snapshot.json +14079 -0
- package/dist/drizzle/meta/20261021004938_snapshot.json +14079 -0
- package/dist/drizzle/meta/20261021153328_snapshot.json +14086 -0
- package/dist/drizzle/meta/_journal.json +21 -0
- package/dist/server/extension-child.cjs +27 -1
- package/dist/server/index.js +12079 -9480
- package/dist/server/index.js.map +2 -2
- package/package.json +11 -11
- package/dist/client/assets/AttentionSignalRow-B1aMjgX_.js +0 -1
- package/dist/client/assets/CanvasFileContent-D1bFaUeh.js +0 -2
- package/dist/client/assets/CanvasModel3dContent-dST7g1v2.js +0 -2
- package/dist/client/assets/HandlePage-B08V-om7.js +0 -1
- package/dist/client/assets/NamePage-JwMDK1JD.js +0 -1
- package/dist/client/assets/PhotoPage-DlOVhkW9.js +0 -1
- package/dist/client/assets/ProfileFields-DVMkpJSb.js +0 -1
- package/dist/client/assets/RoomSurface-CdgCdV6h.js +0 -44
- package/dist/client/assets/RuntimeConnectFlow-DCIRnvOH.js +0 -1
- package/dist/client/assets/SeenDevices-nMsGUQTv.js +0 -19
- package/dist/client/assets/SettingsDialog-C8r2igJ_.js +0 -12
- package/dist/client/assets/TaskDialogWrapper-BhTEvf-u.js +0 -1
- package/dist/client/assets/TopologyGraph-CwyasvFI.js +0 -30
- package/dist/client/assets/_shell-Ct2Bz7D0.js +0 -80
- package/dist/client/assets/_shell._home.index-D4sQsKKk.js +0 -3
- package/dist/client/assets/_shell.marketplace-Cezv-i16.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-BTENmr4W.js +0 -1
- package/dist/client/assets/_shell.session-BjevHF_O.js +0 -63
- package/dist/client/assets/_shell.x._extensionId-0OO_Xr72.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-0OO_Xr72.js +0 -1
- package/dist/client/assets/channel-Ngk70nQZ.js +0 -1
- package/dist/client/assets/image-lightbox-DHDtzoja.js +0 -1
- package/dist/client/assets/index-B9bZYNKR.js +0 -1
- package/dist/client/assets/index-BLP5O7X9.js +0 -1
- package/dist/client/assets/index-C3cvP8Fo.js +0 -1033
- package/dist/client/assets/index-CoWJD3Jg.js +0 -2
- package/dist/client/assets/index-D67Kfy-M.js +0 -1
- package/dist/client/assets/index-DyRGZyur.css +0 -1
- package/dist/client/assets/index-UPF8suf2.js +0 -1
- package/dist/client/assets/index-YW-v746p.js +0 -1
- package/dist/client/assets/index-iTQUa_b2.js +0 -23
- package/dist/client/assets/index-wY5OcS4a.js +0 -43
- package/dist/client/assets/index-xAgihCJ7.js +0 -1
- package/dist/client/assets/primer-trigger-DurKYe8C.js +0 -3
- package/dist/client/assets/profile-errors-BdhZfdvZ.js +0 -1
- package/dist/client/assets/registry-Ck8p6n1T.js +0 -1
- package/dist/client/assets/signed-in-BmywDpR5.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-CA9gW19w.js +0 -8
- package/dist/client/assets/terminal-BORQniao.js +0 -6
- package/dist/client/assets/use-is-below-desktop-Cu_jKnft.js +0 -1
- package/dist/client/assets/use-is-hub-BX7ypNRJ.js +0 -1
- package/dist/client/assets/use-jump-back-in-BjZ8EswV.js +0 -11
- package/dist/client/assets/use-pending-read-BoV-UI1E.js +0 -1
- package/dist/client/assets/use-session-canvas-DRrkNRcL.js +0 -25
- package/dist/client/assets/use-session-diagnostics-BTNgouum.js +0 -16
- package/dist/client/assets/use-update-config-CkWwKNkY.js +0 -1
- /package/dist/client/assets/{_shell-DIs3GY4I.css → WorkView-DIs3GY4I.css} +0 -0
package/dist/client/assets/{NewDirectMessageMenu-GCEMS5oV.js → NewDirectMessageMenu-BjCp-d3D.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a1 as b,a3 as R,a4 as
|
|
1
|
+
import{a1 as b,a3 as R,a4 as j,aP as x,a7 as P,eI as C,r as d,j as e,cT as E,cU as M,cW as k,cX as T,cY as K,dU as I,eu as L,I as F,aF as N,B as D,bz as B,bA as O,eJ as Q,f as Y,bB as _,bD as q,eK as z}from"./index-BDJuvXMG.js";function w(t){return Promise.all([t.invalidateQueries({queryKey:x.lists()}),t.invalidateQueries({queryKey:x.details()}),t.invalidateQueries({queryKey:x.threads()})]).then(()=>{})}function A(t){return(t==null?void 0:t.code)==="SLUG_TAKEN"}function H({isInlineErrorVisible:t}){const n=b(),r=R();return j({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 X(){const t=b(),n=R();return j({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 $({open:t,onOpenChange:n,onCreated:r}){const a=C(),[l,m]=d.useState(""),h=d.useRef(null),c=d.useRef(null),u=d.useRef(!0);d.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const o=H({isInlineErrorVisible:()=>u.current}),g=A(o.error)?o.error.message:null,f=l.trim(),p=f.length>0&&f.length<=y,v=s=>{!p||o.isPending||o.mutate({title:f,agentPaths:s.map(i=>i.agentPath)},{onSuccess:i=>{n(!1),r(i)}})},S=s=>{var i;s.key==="Enter"&&(s.preventDefault(),p&&((i=c.current)==null||i.focus()))};return e.jsx(E,{open:t,onOpenChange:n,children:e.jsxs(M,{className:"sm:max-w-md",onOpenAutoFocus:s=>{var i;s.preventDefault(),(i=h.current)==null||i.focus()},children:[e.jsxs(k,{children:[e.jsx(T,{children:"New channel"}),e.jsx(K,{children:"Name it, then pick who’s in it."})]}),e.jsxs(I,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(L,{htmlFor:"channel-name",children:"Channel name"}),e.jsx(F,{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 U="One agent opens a chat. Two or more start a group message.";function G(t){return t.length===1}function V(t){const n=t[0];return n!==void 0&&G(t)?`Open chat with ${n.displayName}`:"Start group message"}function J({onStart:t,open:n,onOpenChange:r,hideTrigger:a=!1}){const l=C(),m=d.useRef(null),h=()=>{r(!1),z.getState().open()};return e.jsxs(B,{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(Y,{})})}),e.jsxs(_,{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(q,{children:"New message"}),e.jsx(N,{inputRef:m,roster:l,onSubmit:c=>{r(!1),t(c)},submitLabel:V,emptyRosterMessage:"You don’t have any agents yet.",emptyRosterAction:e.jsx(D,{type:"button",size:"sm",variant:"outline",onClick:h,children:"Create agent"}),allChosenMessage:"Everyone is already here."}),e.jsx("p",{className:"text-muted-foreground mt-2 shrink-0 px-2 text-xs",children:U})]})]})}export{$ as C,J as N,U as O,G as a,V as o,X as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,w as s}from"./index-
|
|
1
|
+
import{j as t,w as s}from"./index-BDJuvXMG.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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{eM as A,r as f,eN as K,eO as T,a1 as p,a2 as _,a3 as m,a4 as v,eP as M,j as d,eQ as S,cQ as R,G as j}from"./index-BDJuvXMG.js";import{u as w}from"./use-mesh-topology-42Fa1F-V.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=T((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
2
|
`),a=t.join(`
|
|
3
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
4
|
`),N=new Set(a.length===0?[]:a.split(`
|
|
5
|
-
`)),b=x(i,o,new Set(u)),k=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:k,hasBrokenExecutionConfig:N.has(l)})}return y},[n,a,i,o,c,s])}function G(e){const t=p();return _({queryKey:["mesh","agent-health",e],queryFn:()=>t.getMeshAgentHealth(e),enabled:e!==null})}const h=["mesh","topology"];function W(){const e=p(),t=
|
|
5
|
+
`)),b=x(i,o,new Set(u)),k=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:k,hasBrokenExecutionConfig:N.has(l)})}return y},[n,a,i,o,c,s])}function G(e){const t=p();return _({queryKey:["mesh","agent-health",e],queryFn:()=>t.getMeshAgentHealth(e),enabled:e!==null})}const h=["mesh","topology"];function W(){const e=p(),t=m();return v({mutationFn:s=>e.updateMeshAccessRule(s),onSuccess:()=>{t.invalidateQueries({queryKey:h})}})}function E(){const e=p(),t=m();return v({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",q="On: any agent can message any other. Off: same project, plus pairs below.",L="New agents reach only their own project. Change it later in Team → Access.";function D({checked:e,onCheckedChange:t,disabled:s,className:n}){return d.jsx(S,{label:C,description:q,checked:e,onCheckedChange:t,disabled:s,className:n})}function H({checked:e,onCheckedChange:t,disabled:s,className:n}){return d.jsx(S,{label:C,description:L,checked:e,onCheckedChange:t,disabled:s,className:j("bg-muted/40 rounded-xl px-4 py-3",n)})}function Y(){const{data:e}=w(),{mutate:t,isPending:s}=E();return d.jsx(D,{checked:(e==null?void 0:e.openMesh)??!1,onCheckedChange:t,disabled:s})}function z({className:e}){const{data:t}=w(),{data:s}=R(),{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(H,{checked:!1,onCheckedChange:n,disabled:a,className:e})}export{Y as O,W as a,G as b,z as c,B as u};
|
package/dist/client/assets/{OperatorIdentityForm-ODDMd2YN.js → OperatorIdentityForm-Bl5rL-MI.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bj as j,f9 as F,fa as H,aY as x,r as g,c1 as P,c5 as B,cd as w,fb as G,a1 as D,a2 as Y,bS as K,bN as M,fc as q,z,bk as W,j as i,eu as N,I as R,B as A}from"./index-BDJuvXMG.js";import{d as Q,c as U,n as V,h as J}from"./profile-errors-XchEnatB.js";import{u as X}from"./use-mounted-ref-NbCy8N-y.js";import{u as L,F as k}from"./ProfileFields-BIDZHo11.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);g.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=Y({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=g.useRef(null);g.useEffect(()=>{!l&&c&&h.current!==c&&(h.current=c,s(c))},[l,c,s]);const f=g.useRef(new Map);g.useEffect(()=>{if(!l){f.current.clear();return}if(e.profileRef&&!c)return;const m=c??d;if(m){const p=f.current.get(m);if(p!==void 0&&(u===void 0||p.has(u)))return;f.current.set(m,(p??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=G(),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;g.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 E,b;const r=((E=z().data)==null?void 0:E.members)??[],a=r.find(y=>y.isSelf),o=X(),t=Q({isShownInline:()=>o.current}),s=U({isShownInline:()=>o.current}),[d,l]=g.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):""),p=h.trim(),v=n.trim(),S=a?W(a):null,T=p.length>0&&(p!==c||S!==null),C=t.isError&&t.variables===p?V(t.error):null,O=s.isError&&((b=s.variables)==null?void 0:b.handle)===v?J(s.error,v):null,_=async()=>{if(!a)return!1;l(!0);let y=!0;return T&&(y=await t.mutateAsync(p).then(()=>y,()=>!1)),v&&v!==u&&(y=await s.mutateAsync({authorId:a.id,handle:v}).then(()=>y,()=>!1)),l(!1),y};return{ready:a!==void 0,name:h,setName:f,handle:n,setHandle:m,canSave:a!==void 0&&!d&&(p.length>0||v.length>0),saving:d,nameError:C,nameSuggestion:S!==null&&p===c?S:null,handleError:O,save:_}}function he({onSaved:e,confirmLabel:r="Save",onSkip:a,skipLabel:o="Skip"}){const t=re(),s=g.useId(),d=g.useId(),l=g.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,eN as A,eO as P,G as k,gv as Y,a1 as E,a2 as W,gP as R,r as N,a3 as Z,a4 as ee,au as se,b8 as te,B as x,hj as v,by as q,bz as L,C as U,bA as D,bC as M,T as ne,gQ as g,hk as w,gW as _,gX as B,e as C,b6 as ae,hl as ie,hm as le,hn as re}from"./index-C3cvP8Fo.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-B-wIUI27.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=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(q,{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 X({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(X,{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 J({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(X,{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(_,{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(B,{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(_,{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(B,{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(q,{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(J,{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(J,{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,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-BDJuvXMG.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-DG2dhgC7.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 +1 @@
|
|
|
1
|
-
import{y as n,j as s}from"./index-
|
|
1
|
+
import{y as n,j as s}from"./index-BDJuvXMG.js";import{P as r,a}from"./PermissionHistory-T4I64dJP.js";import"./ApplyToOverridesDialog-DG2dhgC7.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-7zPVBI1I.js → PersonalityPopover-A50oTbpT.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-BDJuvXMG.js";import{u as m,P as p}from"./use-personality-commit-mY_GJ7u5.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-BgdRcA9b.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-BDJuvXMG.js";import{b as t}from"./ProfileFields-BIDZHo11.js";import"./profile-errors-XchEnatB.js";import"./use-mounted-ref-NbCy8N-y.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
|
package/dist/client/assets/{PreviewRefusedNotice-CwGlBJ7U.js → PreviewRefusedNotice-B6hvUBqt.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as b,j as n,
|
|
1
|
+
import{r as b,j as n,bm as _,bp as p,bq as S,f2 as k,bt as E,dK as I,dC as N,f3 as R,f4 as A,bn as T,bv as h,f5 as M,f6 as $,f7 as D,f8 as O,a1 as F,a2 as V,aa as G}from"./index-BDJuvXMG.js";import{S as L}from"./shield-x-DxL97yUb.js";var K=Object.defineProperty,v=(e,t)=>K(e,"name",{value:t,configurable:!0}),x="Tabs",[q,oe]=S(x,[k]),C=k(),[U,y]=q(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",...m}=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(p.div,{dir:u,"data-orientation":i,...m,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(p.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),m=j(i.baseId,s),u=s===i.value;return n.jsx(A,{asChild:!0,...l,focusable:!o,active:u,children:n.jsx(p.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":m,"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),m=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(p.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":g,hidden:!f,id:m,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 V({queryKey:G.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};
|
|
@@ -0,0 +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-BDJuvXMG.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-XchEnatB.js";import{u as N}from"./use-mounted-ref-NbCy8N-y.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-RrhoPD3T.js → ProfilePanelContainer-IHMOmga2.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f,j as t,
|
|
1
|
+
import{r as f,j as t,bg as D,bh as R,bi as E,en as H,eo as M,ep as _,eq as Z,er as A,G as V,I as v,B as P,z as B}from"./index-BDJuvXMG.js";import{F as j,b as K,P as Y,a as $,c as G}from"./ProfileFields-BIDZHo11.js";import{u as I,P as q,b as J}from"./ProfileRolePicker-Bg_Tf8eF.js";function U(e,s){if(e.length!==s.length)return!1;const n=new Set(s);return e.every(a=>n.has(a))}function Q(){const{roles:e,isLoading:s,saveRoles:n}=I(),[a,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(a).then(()=>{u("idle"),m(a)}).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:a,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(a,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 a of te(s).formatToParts(new Date(e)))n[a.type]=a.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 re(e,s,n,a,i){const l=se(a),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 ae(e,s,n){const[a,i,l]=e.split("-").map(Number);return new Date(re(a??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 a=e??J()??ee(),i=s??X;return{timezone:a,days:[...i.days],start:i.start,end:i.end,awayUntil:n!=null&&n.until?oe(new Date(n.until),a):""}}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:ae(e.awayUntil,"00:00",e.timezone).toISOString()}:null}function me(){const{timezone:e,workingHours:s,away:n,isLoading:a,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);!a&&!b(u,l)&&(x(l),d(l));const p=ue(o),g=r=>d(c=>({...c,...r})),W=r=>g({days:o.days.includes(r)?o.days.filter(c=>c!==r):[...o.days,r]}),L=()=>{if(p)return;h("saving");const r=o;i({timezone:r.timezone,workingHours:{days:[...r.days].sort((c,S)=>c-S),start:r.start,end:r.end},away:ce(r,u,n)}).then(()=>{h("idle"),C(null),O(r)}).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:r=>g({timezone:r}),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(r=>t.jsx(A,{value:r,responsive:!1,children:r.replace(/_/g," ")},r))})]})]}),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:r,short:c,name:S})=>{const T=o.days.includes(r);return t.jsx("button",{type:"button","aria-label":S,"aria-pressed":T,onClick:()=>W(r),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},r)})})]}),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:r=>g({start:r.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:r=>g({end:r.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:r=>g({awayUntil:r.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:a||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(a=>a.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 O,a3 as E,a2 as S,au as h,a4 as
|
|
1
|
+
import{a1 as O,a3 as E,a2 as S,au as h,a4 as j,at as D,eL as T,r as b,j as l,G as z,I as q,B as k}from"./index-BDJuvXMG.js";function B(){var a,d,c,m,g,p;const r=O(),s=E(),{data:e,isLoading:o}=S({queryKey:h.current(),queryFn:()=>r.getConfig(),staleTime:T}),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=O(),s=E(),{data:e,isSuccess:o}=S({queryKey:h.current(),queryFn:()=>r.getConfig(),staleTime:T}),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"}],M=6,F={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 H(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=F[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,M),I=r.filter(t=>!y.some(n=>n.id===t)),f=r.length>=A,L=t=>{v(r,t)?s(r.filter(n=>n!==t)):f||s([...r,t])},P=()=>{const t=p.trim().slice(0,N);if(!t)return;const n=H(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:()=>L(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)}),I.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(),P())},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-bBroJdTi.js → PromptSuggestionChips-BItU6w6K.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,ar as c,
|
|
1
|
+
import{j as e,ar as c,aQ as l,G as i}from"./index-BDJuvXMG.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-BDJuvXMG.js";import{u as Y}from"./use-mounted-ref-NbCy8N-y.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,iQ as _e,iR as ne,iS as me,iT as Le,iU as Fe,iV as De,aP as ze,r as s,j as t,G as ee,B as je,x as He,e as Q,gZ as Ie,hI as qe,gY as ke,iW as We,iX as $e,n as Be,h0 as X,a7 as Ke,fb as Ue,iY as Xe,iZ as Ye,i_ as Ge,cj as Qe,i$ as Ve,j0 as Ze,j1 as Je,j2 as et,cf as tt,j3 as nt,gk as G,j4 as st,l as rt,s as he,j5 as ot,j6 as at,ef as it,X as dt,dW as lt,ar as ut,j7 as ct,j8 as pe,j9 as ft,ad as mt,ja as ht,gX as pt,gW as gt,jb as xt,aI as ge,by as Rt}from"./index-BDJuvXMG.js";import{P as yt,u as vt}from"./pane-resize-handle-DAB3TvrY.js";import{D as bt,U as wt,u as jt}from"./UnreadDivider-CNjRFpAY.js";import{u as It}from"./use-room-follow-claim-CTPdEUnW.js";import{a as le,e as ue,g as kt,f as Ae,h as At,i as Ne,c as U,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-Fmb-x_zK.js";import{u as Mt,f as Tt,a as Pt,F as Et,C as Y,d as Ot,M as _t}from"./index-CGvU4pGg.js";import{u as Lt}from"./use-connector-management-CApx-e1Z.js";import{A as Ft}from"./AgentRequestCard-C6aBR2TD.js";import{u as Dt}from"./use-room-sessions-DiysSClf.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 w;const f=(w=ne.getState().paging[p])==null?void 0:w.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:j}=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:j,cursor:y,loadOlder:x}}function Wt({id:e,summary:o,open:r,onOpen:u}){const{capabilities:y}=Mt(),{count:i,lastAt:d,unread:j}=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":j>0?"":void 0,"aria-expanded":r,onClick:u,className:ee("focus-ring ml-[calc(var(--msg-padding-x)_+_var(--msg-gutter-width)_+_var(--msg-gap))]","mb-1 w-fit rounded text-left text-xs transition-colors","px-2 py-2 md:px-1 md:py-0.5",j>0?"text-primary hover:text-primary/80 font-medium":"text-muted-foreground hover:text-foreground"),children:[t.jsx("span",{"aria-hidden":!0,className:"mr-1",children:"↳"}),t.jsx("span",{className:ee(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})]}),j>0&&` · ${j} new`]}):null}function $t({loading:e,onLoad:o}){return t.jsx("div",{className:"flex justify-center px-4 py-3",children:t.jsxs(je,{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 Ut({roomId:e,roomName:o,viewerAuthorId:r,entries:u,members:y,formerAuthors:i,lastReadSeq:d,reactionFrequents:j,streamStalled:R,isLoading:x,error:p,onAddAgents:f,openThreadId:v,onOpenThread:I,resumeRow:k,landOnRow:A,onTopRow:w,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=We(H,d),m=$e(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]),W=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:U(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($t,{loading:l,onLoad:c});if(b.kind==="day-divider")return t.jsx(bt,{label:b.label});if(b.kind==="unread-divider")return t.jsx(wt,{});if(b.kind==="thread-reply"){if(m.onOpenThread===void 0)return null;const h=m.onOpenThread;return t.jsx(Wt,{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:U(a,N,E.faces),authorRef:N.get(a),authors:N,viewerAuthorId:r,authorNames:T,reactionFrequents:j,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,j,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 $=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:$?"Say something to get it going.":"Nothing answers until you add an agent."}),t.jsx(je,{type:"button",size:"sm",variant:$?"ghost":"default",onClick:f,className:"mt-1",children:$?"Add more agents":"Add agents"})]});return t.jsx(Se,{known:E,children:t.jsx(Y.Timeline,{ref:C,conversationId:e,label:`Messages in ${o}`,rows:W,renderRow:K,onOpenThread:I,domIdOf:O,...k===void 0?{}:{resumeRow:k},...A===void 0?{}:{landOnRow:A},...w===void 0?{}:{onTopRow:w},pending:L,viewerAuthorId:r,loading:x?t.jsx(Pe,{roomName:o}):void 0,empty:B,feedTestId:"room-timeline"})})}function Xt(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 w=ce(k)??null,S=w!==null&&A.rowId!==k.id;return{roomRowId:A.rowId,threadRootId:S?w:null,entryId:k.id}},[u,r]),j=s.useRef(null),R=(d==null?void 0:d.threadRootId)??null;s.useEffect(()=>{i===null||R===null||j.current!==i&&(j.current=i,X.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 Yt(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 Gt=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 j;(j=e.current)==null||j.call(e);let u=0;const y=Date.now()+Gt;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=Ue(),j=s.useRef(null);s.useEffect(()=>{if(e!==null){if(j.current!==e&&(j.current=e,r!==void 0)){X.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=X.getState().open[e];X.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}=Xe(),r=Ye(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(Ge,{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:j}){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:w}=zt(),[S,l]=s.useState(rn),c=s.useCallback(a=>{l(h=>new Set(h).add(a)),w({roomId:e.id,authorId:a},{onSettled:()=>l(h=>{const g=new Set(h);return g.delete(a),g})})},[w,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:G(h)},othersWaiting:a.othersWaiting,severalInTheWay:a.severalInTheWay}}),[p,L,E.data]),W=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]),$=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:U(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:$.get(g.authorId)??null}}),h=z.map(g=>({authorId:g.authorId,author:U(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,$]),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:U(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(Y.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(Y.LivePeek,{rows:m,onScrollToRow:j,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:W,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),j=y.current,R=i.current,x=d.current,p=u();for(const f of e){if(x.has(f.id))continue;if(j===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:j,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),w=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)},[]),W=s.useRef(null);s.useEffect(()=>{var n;r||(n=W.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:U(V(l,I),I,w.faces),at:l.createdAt});for(const m of c)n.push({kind:"message",id:m.id,payload:m,grouping:{position:"only"},author:U(V(m,I),I,w.faces),at:m.createdAt});return n},[l,P,c,I,w.faces,x,R]),$=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:w,children:t.jsx(Y.Root,{surface:"room",capabilities:fe,target:k.target,anchor:"rail",children:t.jsxs("section",{ref:W,"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 ${G(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:G(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:G(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:U(V(l,I),I,w.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(Y.Timeline,{ref:q,conversationId:`thread-${o}`,label:`Thread in ${G(e)}`,busy:!R&&!x,rows:O,renderRow:$,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?j: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 wn="react-resizable-panels:room-thread-split";function jn(){try{localStorage.removeItem(wn)}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 j=new ResizeObserver(d);return j.observe(i),()=>{j.disconnect(),o(null),u(null)}},[]),element:e,width:r,sizing:Rn(r??0)}}const kn=`${te}-room`,be=`${te}-thread`,we=`${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(),[j,R]=s.useState(()=>vn(r)),[x,p]=s.useState(null),f=s.useRef(null),v=yn(j,i,d),I=i===null||(d.maxPct-d.minPct)/100*i<An,k=o!==!1;s.useEffect(jn,[]);const A=s.useRef(!1);s.useLayoutEffect(()=>{var c;A.current&&((c=f.current)==null||c.resize(v))},[v,k]);const w=s.useRef(null),S=()=>{var P;const c=(P=f.current)==null?void 0:P.getSize(),C=w.current;if(w.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="${we}"]`);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:we,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:I,onDragging:c=>{var C;c&&(w.current=((C=f.current)==null?void 0:C.getSize())??null)},onKeyDownCapture:c=>{var C,N;I||(w.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:j}){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=X.getState().open[e])==null?void 0:m.rootEntryId;X.getState().closeThread(e),n!==void 0&&v.arm(n)},[e,v]),k=s.useCallback(n=>{X.getState().openThread(e,n)},[e]),A=pt(e),w=gt(e),S=jt(e,w.isSuccess);It(e);const l=A.data,c=s.useMemo(()=>w.data??[],[w.data]),C=Me({room:l});Zt({roomId:e,route:u,urlThreadId:o,openThreadId:f,entries:c,historyLoaded:w.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=Yt(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]),W=Xt({roomId:e,entrySeq:r,entries:c,historyLoaded:w.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:w.isSuccess,historyFailed:w.isError,...W.threadRow===void 0?{}:{landOnRow:W.threadRow},pushed:R,onClose:I},p.rootEntryId),$=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[y,t.jsx(Ut,{ref:E,roomId:l.id,roomName:G(l),viewerAuthorId:l.viewerAuthorId,entries:c,members:l.members,formerAuthors:l.formerAuthors,lastReadSeq:P,reactionFrequents:l.reactionFrequents,streamStalled:S.stalled,isLoading:w.isLoading,error:w.error,onAddAgents:()=>ge("add",l.id),openThreadId:f,onOpenThread:k,resumeRow:L,...W.roomRow===void 0?{}:{landOnRow:W.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:j},l.id)]}),B={surface:"room",capabilities:fe,target:C.target,anchor:"rail"};return R?t.jsx(Y.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:$}),t.jsx(Rt,{initial:!1,children:O!==!1&&t.jsx(fn,{onClose:I,children:O},`thread-${f}`)})]})})}):t.jsx(Y.Root,{...B,children:t.jsx(Nn,{room:$,thread:O})})}export{Pe as R,Wt as T,Fn 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-BDJuvXMG.js";function g({kind:s}){const r="text-muted-foreground size-3.5 shrink-0";return s==="dm"?e.jsx(h,{"aria-hidden":!0,className:r}):e.jsx(f,{"aria-hidden":!0,className:r})}function p(s){return s===1?"1 member":`${s} members`}function N({member:s}){var i;const r=d(),n=l(s.id);if(n.isPending)return e.jsx(m,{className:"h-16 w-full"});if(n.isError)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this member’s rooms."});const a=((i=n.data)==null?void 0:i.rooms)??[];return a.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.isSelf?"You aren’t":`${s.displayName} isn’t`," in any rooms yet."]}):e.jsx("div",{className:"flex flex-col",children:a.map(t=>{const o=e.jsxs(e.Fragment,{children:[e.jsx(g,{kind:t.kind}),e.jsx("span",{className:"min-w-0 truncate text-sm",children:u({kind:t.kind,slug:t.slug,title:t.name})}),e.jsx("span",{className:"text-muted-foreground ml-auto shrink-0 text-xs",children:p(t.memberCount)})]});return r?e.jsxs("button",{type:"button","data-slot":"profile-room-row",onClick:()=>void r({...x.channels(),search:{id:t.id}}),className:"focus-ring hover:bg-muted/50 flex h-9 items-center gap-2 rounded-md px-2 text-left transition-colors",children:[o,e.jsx(c,{"aria-hidden":!0,className:"text-muted-foreground/70 size-3.5 shrink-0"})]},t.id):e.jsx("div",{"data-slot":"profile-room-row",className:"flex h-9 items-center gap-2 rounded-md px-2",children:o},t.id)})})}export{N as RoomsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as L,j as e,a0 as ye,bx as Ee,ar as we,G as N,dP as ie,by as ue,bz as fe,bA as me,bC as xe,dQ as Te,a1 as Ae,a3 as ke,a4 as Le,ad as pe,as as Oe,dw as he,dR as De,dS as Ie,dT as Pe,a8 as j,dU as _e,dz as H,dV as Ue,am as be,B as $e,T as Re,b as He,e as Me,dW as Be,dX as ze,dY as Ke,dZ as Qe,d_ as Ve,d$ as qe}from"./index-C3cvP8Fo.js";import{C as ce}from"./runtime-connect-Dn0T5YWv.js";import{a as We,d as Xe,k as Ye,e as k}from"./execution-config-Ca9MDOtV.js";import{U as Fe}from"./unverified-catalog-notice-DiCIrrhU.js";import{s as Ge}from"./settings-for-runtime-BoOa-ZFG.js";const Ze={duration:.12,ease:"easeOut"},Je={type:"spring",stiffness:320,damping:28};function ve({isSetHere:a,serverDefault:l,onUseServerDefault:i,warning:r,className:s,"data-testid":d}){const[u,f]=L.useState(!1),o=a?"Set here":`Server default · ${l??"none"}`,n=a&&!!i,x=e.jsxs("span",{className:N("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",r?ie.warning:ie.neutral,n&&"hover:bg-accent hover:text-accent-foreground transition-colors",s),"data-testid":d,children:[r&&e.jsx(ye,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(Ee,{mode:"wait",initial:!1,children:e.jsx(we.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:Je},exit:{opacity:0},transition:Ze,children:o},o)})]});return n?e.jsxs(ue,{open:u,onOpenChange:f,children:[e.jsx(fe,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${r?`: ${r}`:""}`,children:x})}),e.jsxs(me,{className:"w-64 p-2",align:"start",children:[e.jsx(xe,{children:"Where this value comes from"}),r&&e.jsx("p",{className:N("px-2 pt-1 text-xs",Te.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{i(),f(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":d?`${d}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["Currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"Not set. Uses the built-in default."})]})]})]}):r?e.jsx("span",{title:r,"aria-label":`${o}: ${r}`,children:x}):x}const et=["agents"];function tt(a){const l=Ae(),i=ke();return Le({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:r=>l.updateMeshAgent(r.id,r.updates),onSuccess:()=>{i.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{i.invalidateQueries({queryKey:et})}})}const ge="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function $({label:a,valueLabel:l,options:i,selected:r,isSetHere:s,serverDefault:d,warning:u,onSelect:f,onInherit:o,testId:n,showHeader:x=!0,className:C,describedBy:m,inheritText:O}){const w=pe(),[S,h]=L.useState(!1);return e.jsxs("div",{className:N("space-y-1",C),children:[x&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ge,children:a}),!w&&e.jsx(ve,{isSetHere:s,serverDefault:d,warning:u,onUseServerDefault:o,"data-testid":`${n}-chip`})]}),e.jsxs(ue,{open:S,onOpenChange:h,children:[e.jsx(fe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...m?{"aria-describedby":m}:{},"data-testid":n,children:[e.jsx("span",{className:N("truncate",u?"text-status-warning-fg":s?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(Re,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(me,{className:"w-64 p-1",align:"start",children:[e.jsx(xe,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:i.map(c=>e.jsxs("button",{type:"button","data-testid":`${n}-option-${c.value}`,onClick:()=>{f(c.value),h(!1)},className:N("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",c.value===r&&"bg-accent"),children:[c.label,c.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:c.hint})]},c.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),h(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${n}-inherit`,children:O??(d?`Use server default: ${d}`:"Use server default")})]})]})]})}function st({agent:a,onUpdate:l,className:i}){var ee,te,se,ae,ne,le,oe,re,de;const r=pe(),{data:s}=Oe(),{data:d,isPending:u}=he(),f=((ee=s==null?void 0:s.executionDefaults)==null?void 0:ee.runtime)??"claude-code",o=a.runtime??f,n=(te=s==null?void 0:s.executionDefaults)==null?void 0:te.perRuntime.find(t=>t.runtime===o),{data:x}=De(),C=We(a,{defaultRuntime:f,runtimeDeclaresCredits:t=>{var b;return((b=d==null?void 0:d.capabilities[t])==null?void 0:b.credits)!==void 0},credits:(se=s==null?void 0:s.claudeCode)==null?void 0:se.credits,runtimeDefaultsToCredits:t=>{var b,A;return((A=(b=x==null?void 0:x.defaults)==null?void 0:b[t])==null?void 0:A.runsOn)==="credits"}}),{data:m,isError:O}=Ie({runtime:o,...C?{account:j}:{}}),w=a.model!=null,S=a.effort!=null,h=(n==null?void 0:n.model)??null,c=C&&(m??[]).some(t=>t.paidFromCredits),y=c?(m??[]).find(t=>t.isDefault):void 0,T=a.model??h??(y==null?void 0:y.value)??null,M=o==="doe"&&c&&!w&&!h,p=T?(m??[]).find(t=>t.value===T):void 0,D=(n==null?void 0:n.supportsEffort)??((ae=Ge(d,o))==null?void 0:ae.supportsEffort),B=D===void 0&&u,z=D!==!1,K=p?p.supportsEffort??!1:void 0,Q=(ne=s==null?void 0:s.claudeCode)==null?void 0:ne.accounts,{nameFor:V,creditsEntry:je,resolvedAccount:q}=Pe(),W=je??(a.account===j&&((le=s==null?void 0:s.claudeCode)!=null&&le.credits)?{path:s.claudeCode.credits.path}:null),v=Q&&[...Q.flatMap(t=>t.id===null?[]:[{id:t.id,label:V(t.path),path:t.path}]),...W?[{id:j,label:_e,path:W.path}]:[]],g=a.account??null,X=g!==null,Y=o==="claude-code"&&g===j&&((oe=s==null?void 0:s.claudeCode)==null?void 0:oe.credits)!==void 0&&!s.claudeCode.credits.allowedAgents.includes(a.id),I=s!=null&&s.claudeCode&&q?V(q):null,P=tt({errorLabel:"Couldn’t change this agent’s account"}),_=L.useCallback(t=>{P.mutate({id:a.id,updates:{account:t}})},[a.id,P]),Ne=Xe({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:f,serverDefaultModel:h,knownModels:Ye(m),knownAccounts:v,accountsUnavailable:(re=s==null?void 0:s.claudeCode)==null?void 0:re.accountsUnavailable,modelSupportsEffort:K,runtimeSupportsEffort:D,runtimeLabel:t=>H(t).label}),E=t=>{var b;return((b=Ne.breakages.find(A=>t.includes(A.kind)))==null?void 0:b.message)??null},U=!B&&z&&K!==!1,F=a.effort??(n==null?void 0:n.effort)??null,G=H(o).label,Ce=o==="claude-code"&&v!==void 0&&(v.length>1||X),Se=E(["account-unregistered"]),Z=(m??[]).some(t=>t.unverified),J=L.useId();return e.jsxs("div",{className:N("grid grid-cols-2 gap-3",i),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{label:"Model",valueLabel:M?ce:(p==null?void 0:p.displayName)??T??(c?"Default":"Automatic"),options:[...(m??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:T,isSetHere:w,serverDefault:(n==null?void 0:n.model)??null,warning:E(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:Z?J:void 0,inheritText:M?ce:c&&!h?y?`Use the suggested model: ${y.displayName}`:"Use the default model":void 0}),Z&&e.jsx(Fe,{id:J}),c&&(m??[]).some(t=>t.creditsListOutOfDate)&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-out-of-date",children:"The models your DorkOS credits cover may be out of date."}),C&&O&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-unavailable",children:"Couldn’t load the models DorkOS credits cover. Try again in a moment."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ge,children:"Effort"}),(!r||!U)&&(S||U)&&e.jsx(ve,{isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:E(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),B?e.jsx(R,{testId:"agent-effort-pending",text:`Checking what ${G} supports`,warning:null}):z?U?e.jsx($,{label:"Effort",valueLabel:k(F),options:Ue.filter(t=>!(p!=null&&p.supportedEffortLevels)||p.supportedEffortLevels.includes(t)).map(t=>({value:t,label:k(t)})),selected:F,isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(R,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:E(["effort-unsupported-model"])}):e.jsx(R,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${G}`,warning:E(["effort-unsupported-runtime"])})]}),Ce&&e.jsx($,{label:"Account",valueLabel:Y?I??"Default":g!==null?((de=v==null?void 0:v.find(t=>t.id===g))==null?void 0:de.label)??g:I??"Default",options:(v??[]).map(t=>({value:t.id,label:t.label,hint:t.id===j?"Paid from your DorkOS account":be(t.path)})),selected:g,isSetHere:X,serverDefault:I,warning:Se,onSelect:t=>_(t),onInherit:()=>_(null),testId:"agent-account-row",className:"col-span-full"}),Y&&e.jsxs("div",{className:"text-muted-foreground col-span-full flex flex-wrap items-center gap-2 text-xs","data-testid":"agent-credits-not-allowed",children:[e.jsx("span",{children:"This agent’s settings name DorkOS credits. It uses your default until you allow it."}),e.jsx($e,{size:"sm",variant:"outline",className:"h-6 px-2 text-xs",disabled:P.isPending,onClick:()=>_(j),children:"Allow"})]})]})}function R({text:a,warning:l,testId:i}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":i,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const at="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function it({member:a}){const{agent:l,projectPath:i,isPending:r,update:s}=He(a),{data:d}=he();if(r)return e.jsx(Me,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const u=d?Object.keys(d.capabilities):[l.runtime],f=u.includes(l.runtime)?u:[l.runtime,...u];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:at,children:"Runs on"}),e.jsxs(Be,{value:l.runtime??"claude-code",onValueChange:o=>s({runtime:o}),children:[e.jsx(ze,{className:"h-8 text-sm",responsive:!1,children:e.jsx(Ke,{})}),e.jsx(Qe,{children:f.map(o=>e.jsx(Ve,{value:o,responsive:!1,children:H(o).label},o))})]})]}),e.jsx(st,{agent:l,onUpdate:s,className:"grid-cols-1"}),i&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(qe,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:be(i)})]})]})}export{it as RunsOnPopover};
|
|
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-BDJuvXMG.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-DEYWqx9f.js";import{U as Xe}from"./unverified-catalog-notice-v-qMrtTV.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};
|