dorkos 0.126.2 → 0.126.3
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 +133 -38
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-BQ66xWcJ.js → AboutPage-ycWTfXI8.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-CPbfgXjw.js → ActivityErrorState-DBecAo4-.js} +1 -1
- package/dist/client/assets/{ActivityPage-CesljfZn.js → ActivityPage-CGuIeDGm.js} +1 -1
- package/dist/client/assets/{ActivityRow-DzhwE0ht.js → ActivityRow-BRiUvjHA.js} +1 -1
- package/dist/client/assets/{AdapterIcon-BXJkyF5g.js → AdapterIcon-z6z9LKwd.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-CwKYl1vG.js → AdapterSetupWizard-Cp56Zx24.js} +1 -1
- package/dist/client/assets/{AgentOptionRow-0VdNzXCF.js → AgentOptionRow-BLuSwpNh.js} +1 -1
- package/dist/client/assets/{AgentPicker-Ldh64iOA.js → AgentPicker-DazquIgR.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-CmAlDGTr.js → AgentRequestCard-BoRmxLKy.js} +1 -1
- package/dist/client/assets/{AppearancePage-DmsZPHst.js → AppearancePage-BMiVpe48.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-Ct1W283T.js → ApplyToOverridesDialog-BHIrnfPf.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-B7gezgzA.js → AttentionSignalRow-CjN8lCWI.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Nqvr65_g.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-BMBnO0fv.js} +1 -1
- package/dist/client/assets/{BindingDialog-CpBZoSZU.js → BindingDialog-Bw55sMTh.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-BCtfZPrs.js → BlintzCanvas-Dd3bC9vw.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent-DYksqzaf.js → CanvasCsvContent-B2S75f6B.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-CqEqSxuJ.js → CanvasFileContent-CVSfg4MO.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-vR6ze4IR.js → CanvasModel3dContent-CNmJsBTS.js} +2 -2
- package/dist/client/assets/{ChannelComposer-BVACOdph.js → ChannelComposer-7KpffyFv.js} +3 -3
- package/dist/client/assets/{ChatAppsOff-VsPP2Hye.js → ChatAppsOff-D7anOG3n.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-CmKjH03N.js → CodeMirrorDiff-CfOmRCky.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BtNgazuc.js → CodeMirrorEditor-Cyz227_1.js} +1 -1
- package/dist/client/assets/{CommitmentList-D9I-CmNy.js → CommitmentList-DKo1Fb1A.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-BORMYDZb.js → CommitmentsPage-DIcEZ2ka.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-BZ9BxgOi.js → ComputerResourceView-Ck7rJ-SP.js} +1 -1
- package/dist/client/assets/{ComputerViewer-CbuU9tXK.js → ComputerViewer-Dw_VpNjD.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-uE-Fzp6Y.js → ConnectionAccessLists-CETLVH7o.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-D7QTHeQQ.js → ConnectionsPage-ZVWDffcl.js} +1 -1
- package/dist/client/assets/{ConventionPage-PS2WWCyB.js → ConventionPage-DkJ91wrN.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-Cn7bYxGB.js → ExtensionPageRoute-FbJo1Qc0.js} +1 -1
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-DKGNSXVz.js → FloatingTanStackRouterDevtools-CqogiFob-DCLR3iKw.js} +1 -1
- package/dist/client/assets/{ForwardConsentHost-CLIHtWwq.js → ForwardConsentHost-Buy5XlH7.js} +1 -1
- package/dist/client/assets/HandlePage-CByGC3B8.js +1 -0
- package/dist/client/assets/{HeartbeatPage-7MTowke-.js → HeartbeatPage-GXBEcZoJ.js} +1 -1
- package/dist/client/assets/{KeyEntry-Cf7D0Oo6.js → KeyEntry-g2VQ33KW.js} +1 -1
- package/dist/client/assets/{LexicalField-DqvzeMr3.js → LexicalField-CLd77PuB.js} +1 -1
- package/dist/client/assets/{ManagesPage-DxR4zWMf.js → ManagesPage-qCwzJ4Cx.js} +1 -1
- package/dist/client/assets/{Marketplace-V_92jKOn.js → Marketplace-DdkdIVPQ.js} +1 -1
- package/dist/client/assets/{MarketplaceSourcesView-CjCVMP_d.js → MarketplaceSourcesView-D44G21ff.js} +1 -1
- package/dist/client/assets/{McpAppFrame-4JDJsrmg.js → McpAppFrame-DVNWJHrn.js} +1 -1
- package/dist/client/assets/{McpSigninBody-DG1XX7XT.js → McpSigninBody-BO0OkvOw.js} +1 -1
- package/dist/client/assets/{Model3dViewer-DedBFHsl.js → Model3dViewer-Cvcyx2yv.js} +1 -1
- package/dist/client/assets/NamePage-5VUtswMH.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-C8t7x-sB.js → NewDirectMessageMenu-C_hXtliM.js} +1 -1
- package/dist/client/assets/{NotificationsPage-DwGFE3F6.js → NotificationsPage-DP4HAVMA.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-DPmTA9eg.js → OpenMeshSwitch-0Mkl8abo.js} +1 -1
- package/dist/client/assets/{OperatorIdentityForm-Cu0h8Xqy.js → OperatorIdentityForm-BRftJqRq.js} +1 -1
- package/dist/client/assets/{PermissionHistory-zD6ksrl2.js → PermissionHistory-Czl5PWN3.js} +1 -1
- package/dist/client/assets/{PermissionsPage-Durcnmie.js → PermissionsPage-DAsbrl6Q.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-DuRjJuLj.js → PersonalityPopover-liTJ0Lns.js} +1 -1
- package/dist/client/assets/PhotoPage-DDcbiGjb.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-hlYrFDQM.js → PreviewRefusedNotice-DcD1EY2c.js} +1 -1
- package/dist/client/assets/{ProfileFields-x-x8vgNo.js → ProfileFields-Bi_AfHOE.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-8WxopRj2.js → ProfilePanelContainer-BIbOulLu.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-BfciiNpr.js → ProfileRolePicker-BadkFi4V.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-D34Zeaq_.js → PromptSuggestionChips-C653MlaU.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-BhqA5qXi.js → ReportsToPopover-dIbt6aes.js} +1 -1
- package/dist/client/assets/{RoomSurface-BlMNuQsT.js → RoomSurface-CssMcozl.js} +1 -1
- package/dist/client/assets/{RoomsPage-C52AOHIE.js → RoomsPage-CxwTRRNu.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-DLhEKwXF.js → RunsOnPopover-lp8n4lgI.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-D3H5Fpkc.js → RuntimeConnectFlow-BAqkzthF.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-DPU4QIY9.js → RuntimeSetupDialog-E6f7Rd2W.js} +1 -1
- package/dist/client/assets/{SeenDevices-CDSHTsL7.js → SeenDevices-xdR3YQNr.js} +1 -1
- package/dist/client/assets/{SessionsPage-Crh3D3Jj.js → SessionsPage-BNZTufty.js} +1 -1
- package/dist/client/assets/{SettingsDialog-D0Oh-ku1.js → SettingsDialog-d7SQTDNy.js} +1 -1
- package/dist/client/assets/{SkillsPage-BPexZwnJ.js → SkillsPage-DiqUOZup.js} +1 -1
- package/dist/client/assets/{TaskDialogWrapper-D6RB8E59.js → TaskDialogWrapper-5gb-f-Uo.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-Di3SbhJM.js → TasksEmptyState-g-CavcMv.js} +1 -1
- package/dist/client/assets/{TasksPage-CDLsY1Ww.js → TasksPage-BexV_pxB.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-B_q-oVSs.js → TeamComputerEntry-BFYqGL-G.js} +1 -1
- package/dist/client/assets/{ToolsPage-gvIVTnwf.js → ToolsPage-Dxt6qOdF.js} +1 -1
- package/dist/client/assets/{TopologyGraph-Bp8aL_qw.js → TopologyGraph-Cx_6gdbV.js} +1 -1
- package/dist/client/assets/{TourHost-Cg8EHvod.js → TourHost-DvAjpsug.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-Ddd1Yxfk.js → UnlinkDialog-fgubvOUd.js} +1 -1
- package/dist/client/assets/{UnreadDivider-LL4_YtF0.js → UnreadDivider-BoLcTO_Z.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-BA3P7hNv.js → WidgetErrorCard-CgRMeAEO.js} +1 -1
- package/dist/client/assets/{WithheldExtensionsNotice-quqWNbus.js → WithheldExtensionsNotice-CFHBDyIh.js} +1 -1
- package/dist/client/assets/{WorkView-C_h8sclU.js → WorkView-5jzcnod5.js} +1 -1
- package/dist/client/assets/{_shell-D9q8zLfr.js → _shell-DFfXd1ys.js} +1 -1
- package/dist/client/assets/{_shell._home-CrTxBB3h.js → _shell._home-D2GJeGbi.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-2M0BJkbQ.js → _shell._home.activity-DRXBBtAq.js} +1 -1
- package/dist/client/assets/{_shell._home.index-BTJhhEWN.js → _shell._home.index-CA_GnaUK.js} +1 -1
- package/dist/client/assets/{_shell._home.tasks-Dfrqv2nl.js → _shell._home.tasks-Cr4gak8T.js} +1 -1
- package/dist/client/assets/{_shell._home.workspaces-DPLQXDdH.js → _shell._home.workspaces-DbWciI1g.js} +1 -1
- package/dist/client/assets/{_shell.channels-CJqfUTZ1.js → _shell.channels-C31Txlqh.js} +1 -1
- package/dist/client/assets/{_shell.connections-Cpe1hru3.js → _shell.connections-gfevZyC-.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-BeWCqScf.js → _shell.feedback-requests-CQc7aVrV.js} +1 -1
- package/dist/client/assets/_shell.marketplace-BepG1fJe.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-BBQESbqU.js +1 -0
- package/dist/client/assets/_shell.session-DzeI9YIK.js +1 -0
- package/dist/client/assets/{_shell.team-EPvcS7RS.js → _shell.team-BlLU5BMC.js} +3 -3
- package/dist/client/assets/{_shell.threads-NJDzq9dv.js → _shell.threads-YmF9dQnZ.js} +1 -1
- package/dist/client/assets/_shell.x._extensionId-ByRocZjS.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-ByRocZjS.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-DUHshdrR.js → abnfDiagram-WEYOIA3C-DLiXaMmC.js} +1 -1
- package/dist/client/assets/{access-copy-DHfPjN3G.js → access-copy-xWnaUps1.js} +1 -1
- package/dist/client/assets/{arc-sP6zNsGB.js → arc-AndXXvZc.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-C8PTjsPx.js → architectureDiagram-ZHVYKT53-CM4tGveM.js} +1 -1
- package/dist/client/assets/{banner-CVrzHqOT.js → banner-BH1gXPTc.js} +1 -1
- package/dist/client/assets/{blockDiagram-RJAE7QA3-Cydde2fz.js → blockDiagram-RJAE7QA3-DenkdFXV.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-DbM6KAK7.js → c4Diagram-XDPPPE54-DMAlFuoX.js} +1 -1
- package/dist/client/assets/{card-DA_Z-FYX.js → card-TbpEl6EH.js} +1 -1
- package/dist/client/assets/channel-5-dQamNX.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-CEbspaNh.js → chunk-2E7WHVMD-u0q5vCEc.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-DDP1SiE0.js → chunk-2Q5K7J3B-DBTggfjR.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-BFjozJqd.js → chunk-4EMNKR2T-zu55wq-c.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-0JSp6acZ.js → chunk-55XCU76K-XLIA3Qss.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-DswTXnmp.js → chunk-5VM5RSS4-DmGjbtZg.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-D0PYncYV.js → chunk-JWPE2WC7-ikMrk6md.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-r5T-ZVBs.js → chunk-VQ5W62QI-cfwin8SC.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-D8kkjktE.js → chunk-XXDRQBXY-Cn3e0QEQ.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-D6XtRzln.js → chunk-ZCHMQSOR-7RkBP94K.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-DUPDMGfm.js → classDiagram-v2-4MYWR3UA-CqVol7t8.js} +1 -1
- package/dist/client/assets/{command-BvXBgZfv.js → command-2pl_Cn7b.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-tiQpE-Q8.js → cose-bilkent-JH36ORCC-m0tmlDnx.js} +1 -1
- package/dist/client/assets/{cpu-mx7zDf7k.js → cpu-CdCfSlSR.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-BjAUxFfb.js → cynefin-EF2NZ3EQ-Cf7ajLou.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-PmlyltXR.js → cynefinDiagram-WF24UDRP-Dl8GJr0l.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-DDePjPkn.js → dagre-NK4GIZVX-2yAF6nW_.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-D7N3T4Fx.js → diagram-CBK3MWTC-DaBb9JFm.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D-BfZHSbR2.js → diagram-I5XIIV2D-BMeCfhD1.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-sXAa9bzN.js → diagram-ODIL2UCW-ClVKCieB.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-Dfd_61WO.js → diagram-PFBEJUXE-DFIKk-tB.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-BCzdEfnM.js → diagram-RJA3I4VV-DzC_xtYu.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-BMqtz6sZ.js → diagram-TYUNFSNR-BroMVHm2.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-CyWj1615.js → ebnfDiagram-V4P3TTPT-GMsyIh86.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-BkQMBXse.js → elk-QONTBCTQ-DIpw6SW5.js} +1 -1
- package/dist/client/assets/{empty-state-Dv5iV4jb.js → empty-state-B7ufhAFk.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-DiPsX7uU.js → erDiagram-KYQIGQAA-CsezeWpx.js} +1 -1
- package/dist/client/assets/{execution-config-Bej0Ot8e.js → execution-config-DRqIsff0.js} +1 -1
- package/dist/client/assets/{file-DXbyb23e.js → file-DHPgnMgj.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-C8XqHyzY.js → file-exclamation-point-DtjBa2XX.js} +1 -1
- package/dist/client/assets/{file-text-CRTgqqkn.js → file-text-wmrSy3Io.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-D1i7qNny.js → find-latest-widget-fence-Bv9D10ve.js} +1 -1
- package/dist/client/assets/{flowDiagram-IUGLLWBU-BSM44aJP.js → flowDiagram-IUGLLWBU-BGwNqglr.js} +1 -1
- package/dist/client/assets/{form-DYSiVEri.js → form-CA_eiUg-.js} +1 -1
- package/dist/client/assets/{format-cron-DYYwmo-o.js → format-cron-YPhIy57w.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-BWCjYexX.js → ganttDiagram-R7GPNTJY-4IlzTCzA.js} +1 -1
- package/dist/client/assets/{git-branch-1zYKSuur.js → git-branch-BLIYLcM4.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-ULC7Zunc.js → gitGraphDiagram-PDYL7XHY-HeaC8vlP.js} +1 -1
- package/dist/client/assets/{graph-BsZzo5TN.js → graph-Ch9lnHSS.js} +1 -1
- package/dist/client/assets/{heart-C4CSHUW7.js → heart-D4fTvM5q.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-CFECg7iB.js → highlighted-body-KPVGNVTW-KPma22SA.js} +1 -1
- package/dist/client/assets/{image-lightbox-M9t3Wulc.js → image-lightbox-DI18fB2Q.js} +1 -1
- package/dist/client/assets/{image-off-c01kxBAm.js → image-off-DRgXXpgv.js} +1 -1
- package/dist/client/assets/{index-BScgHCO_.js → index--2mMmier.js} +1 -1
- package/dist/client/assets/{index-DG13Cp5o.js → index-2J89pJxF.js} +1 -1
- package/dist/client/assets/{index-C1XazYWZ.js → index-3UGWygRZ.js} +1 -1
- package/dist/client/assets/{index-Dt7RONID.js → index-B-4XmK5Q.js} +1 -1
- package/dist/client/assets/index-B9X2-pzp.js +1 -0
- package/dist/client/assets/{index-Du4HX97h.js → index-BAd8jUzo.js} +2 -2
- package/dist/client/assets/{index-UJq1qaku.js → index-BMYGo6Ki.js} +1 -1
- package/dist/client/assets/{index-B3xeyV6n.js → index-BY0SKYuc.js} +1 -1
- package/dist/client/assets/{index-DIDUjTkq.js → index-B_56Srtt.js} +1 -1
- package/dist/client/assets/{index-uLbyd6YP.js → index-BmlBYrxT.js} +1 -1
- package/dist/client/assets/{index-Br35Gqfz.js → index-BtRM2yox.js} +1 -1
- package/dist/client/assets/{index-DyN65ufd.js → index-ButY6gKr.js} +1 -1
- package/dist/client/assets/{index-BYY8HEOz.js → index-C-X6jaVm.js} +1 -1
- package/dist/client/assets/{index-XEE1k4cl.js → index-C3IsCAxA.js} +1 -1
- package/dist/client/assets/{index-BTGRc0hC.js → index-COoO8dzi.js} +1 -1
- package/dist/client/assets/{index-BIVIHPoe.js → index-CRCfkwyN.js} +1 -1
- package/dist/client/assets/{index-BRH6C3LJ.js → index-CTTaeOCw.js} +1 -1
- package/dist/client/assets/index-CgpRBcA4.js +1 -0
- package/dist/client/assets/{index-DrENuQdJ.js → index-ClbMjgcZ.js} +1 -1
- package/dist/client/assets/{index-CnltS8ym.js → index-CucieFDK.js} +1 -1
- package/dist/client/assets/{index-DQTTC52E.js → index-D0cIffaH.js} +1 -1
- package/dist/client/assets/{index-B-7P1Q9s.js → index-D9w0FBQG.js} +1 -1
- package/dist/client/assets/{index-BqwCOIbF.js → index-DHZS9Lod.js} +1 -1
- package/dist/client/assets/{index-DsasLE1l.js → index-DSIdPh8G.js} +1 -1
- package/dist/client/assets/{index-CAAsqmfP.js → index-DTRAR0KK.js} +1 -1
- package/dist/client/assets/{index-LpaxG4VS.js → index-DbV3-jog.js} +1 -1
- package/dist/client/assets/{index-JG_0k1NX.js → index-Dbujw1c2.js} +1 -1
- package/dist/client/assets/{index-C3swXqWW.js → index-DpvGUFpV.js} +1 -1
- package/dist/client/assets/{index-CAjKQnAd.js → index-DuvW22xi.js} +1 -1
- package/dist/client/assets/{index-D847rJXW.js → index-Dy9bWvna.js} +1 -1
- package/dist/client/assets/{index-B_he44rF.js → index-EDXuyCOT.js} +1 -1
- package/dist/client/assets/{index-FwAvbbet.js → index-Ix2nCAz0.js} +1 -1
- package/dist/client/assets/{index-BSxkprTm.js → index-JoxvTUfo.js} +3 -3
- package/dist/client/assets/{index-YXyEu3Ia.js → index-QSo53dH-.js} +1 -1
- package/dist/client/assets/{index-DhkfALZp.js → index-bzM-k5lI.js} +1 -1
- package/dist/client/assets/{index-Ce3HZQem.js → index-jk2K24il.js} +1 -1
- package/dist/client/assets/{index-DzHj8lCz.js → index-mRMaqxu5.js} +9 -9
- package/dist/client/assets/{index-B6Scr7KJ.js → index-p3WivF1M.js} +226 -226
- package/dist/client/assets/{index-DrQqkQq_.js → index-qEI7Rsr1.js} +1 -1
- package/dist/client/assets/{index-DhoaVQXu.js → index-rPJ8b_DO.js} +1 -1
- package/dist/client/assets/{index-jLIoULQt.js → index-uG06zgQo.js} +1 -1
- package/dist/client/assets/{index-DhYnXLRT.js → index-uy36h8lC.js} +1 -1
- package/dist/client/assets/{index-BnXWm8Db.js → index-zvAbU6ah.js} +1 -1
- package/dist/client/assets/{index.esm-CZ68Qd2t.js → index.esm-CxXuMuQv.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-BCjhXqIT.js → infoDiagram-MVDRKAX5-g9EeD2xH.js} +1 -1
- package/dist/client/assets/{inline-code-BKPMIXZR.js → inline-code-14c1Gacs.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-C9rsv2nh.js → ishikawaDiagram-HPEHV2GE-Zv5DrRnv.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-BRYr1XL1.js → journeyDiagram-BOSHW7O7-COiWWTez.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-2ey8FXEn.js → kanban-definition-FNSA4HC5-DnQa8qXB.js} +1 -1
- package/dist/client/assets/{layers-DE3wjQuk.js → layers-D_NEJsnH.js} +1 -1
- package/dist/client/assets/{lightbulb-BXJIRUdm.js → lightbulb-EadQi_Lr.js} +1 -1
- package/dist/client/assets/{link-2-DzWm9OxA.js → link-2-DugR2HHU.js} +1 -1
- package/dist/client/assets/{list-runtime-types-BhkZkTrB.js → list-runtime-types-iJaKcim4.js} +1 -1
- package/dist/client/assets/{markdown-content-Bk9lCksw.js → markdown-content-BFHUHPgi.js} +1 -1
- package/dist/client/assets/{mention-pill-os_7QQu2.js → mention-pill-DXBno6EY.js} +1 -1
- package/dist/client/assets/{mermaid.core-BcRUBvZd.js → mermaid.core-C6ckWvkG.js} +4 -4
- package/dist/client/assets/{message-square-off-DuOiETNI.js → message-square-off-BH8wbm2a.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-DBhXkS2i.js → mindmap-definition-6OY57UG3-DV4PNLc-.js} +1 -1
- package/dist/client/assets/{more-details-Bt9nlPmS.js → more-details-DhdX4DGU.js} +1 -1
- package/dist/client/assets/{owner-notice-4ZSBxa2K.js → owner-notice-FMj3k7-f.js} +1 -1
- package/dist/client/assets/{package-BmOMrNwc.js → package-0mI7-RiJ.js} +1 -1
- package/dist/client/assets/{page-container-LomhzyuS.js → page-container-DRyYoDkA.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-BOtzx5Q4.js → pane-resize-handle-OBc3uYxQ.js} +1 -1
- package/dist/client/assets/{paperclip-C1tkiT74.js → paperclip-BsTJpkyE.js} +1 -1
- package/dist/client/assets/{path-input-JHTlL97W.js → path-input-CFm1b1pk.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-B01fb3t0.js → pegDiagram-ECIUJNBX-Cboo0f6B.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-BJ7JYrTk.js → pieDiagram-GNMPY74T-CiihSor1.js} +1 -1
- package/dist/client/assets/{plug-CsqfQsYq.js → plug-BdnJAo1j.js} +1 -1
- package/dist/client/assets/{primer-trigger-DLdK7lVr.js → primer-trigger-BV4xZfFz.js} +1 -1
- package/dist/client/assets/{profile-errors-CpvSy5wY.js → profile-errors-B08zStmk.js} +1 -1
- package/dist/client/assets/{progress-qB87L0zJ.js → progress-CpiQE0rv.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-mJYGGmOV.js → quadrantDiagram-D57K4MC3-dF0oKeMn.js} +1 -1
- package/dist/client/assets/{query-error-state-MyJ1ivia.js → query-error-state-B0RUeb10.js} +1 -1
- package/dist/client/assets/{radio-DJV7l0fv.js → radio-CAGXbJK_.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-BlXWwQe2.js → railroadDiagram-Y72NRBL7-ClkFJVq1.js} +1 -1
- package/dist/client/assets/{registry-tJrGs7kB.js → registry-Cog_2xvt.js} +4 -4
- package/dist/client/assets/registry-DLWJMbtY.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-TH0-GYCB.js → relay-trace-schemas-CNDSmhcJ.js} +1 -1
- package/dist/client/assets/{repeat-CBnopqBr.js → repeat-Dag80z5v.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-Dqr1Y74x.js → requirementDiagram-EQYSW5RA-Cey6FmFd.js} +1 -1
- package/dist/client/assets/{room-files-source-BFo0FEUP.js → room-files-source-BKUFMU_b.js} +1 -1
- package/dist/client/assets/{rotate-ccw-clock-D9XRHj5E.js → rotate-ccw-clock-egrvXlKX.js} +1 -1
- package/dist/client/assets/{rotate-cw-DNa7ENG3.js → rotate-cw-Po-L3HFe.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-DGYZs_kW.js → sankeyDiagram-SY24JHO5-BsIuHjbJ.js} +1 -1
- package/dist/client/assets/{scroll-area-Bf6IGziJ.js → scroll-area-C7vKp2H4.js} +1 -1
- package/dist/client/assets/{search-x-DFBBEouE.js → search-x-C_BEqIuX.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-BW3u4L9y.js → sequenceDiagram-BLEHNHQU-BJZXJxwu.js} +1 -1
- package/dist/client/assets/{shield-x-WGxwrtNV.js → shield-x-hHpT8rAA.js} +1 -1
- package/dist/client/assets/{signed-in-eV4_EXuv.js → signed-in-BhArfIJC.js} +1 -1
- package/dist/client/assets/{sizeCapture-INFHLROL-C1TpueOu.js → sizeCapture-INFHLROL-DYCQyn7S.js} +1 -1
- package/dist/client/assets/{soul-file-e1iYX9IV.js → soul-file-Doekkv7n.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-DvrHUauN.js → stateDiagram-v2-A6IESKWZ-C6bUDAO7.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-BUbTcoId.js → swimlanes-B3ENRKFQ-DGyTrJBT.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-DrZ99xGr.js +8 -0
- package/dist/client/assets/{table-DsxLk3Gx.js → table-9KRGRv_s.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-CzbVpGxn.js → timeline-definition-JXYKGLGB-CHAJwSq6.js} +1 -1
- package/dist/client/assets/{trust-posture-Blofy7eE.js → trust-posture-BQE9NSf_.js} +1 -1
- package/dist/client/assets/{unplug-B6dUhqA7.js → unplug-CklGWwz7.js} +1 -1
- package/dist/client/assets/untrusted-text-BDygHCRk.js +1 -0
- package/dist/client/assets/{unverified-catalog-notice-6pwZtIjx.js → unverified-catalog-notice-9mykZSlO.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-J43bUHJu.js → use-adapter-catalog-CDxy08u_.js} +1 -1
- package/dist/client/assets/{use-bindings-BgXZ0D7k.js → use-bindings-CPbqKyo6.js} +1 -1
- package/dist/client/assets/{use-composer-prefs--zO2mm_M.js → use-composer-prefs-C7v03Xx_.js} +1 -1
- package/dist/client/assets/{use-connector-management-9Q7wHb06.js → use-connector-management-COqWo76Y.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-CXqwdwGr.js → use-deep-link-scroll-BuYR3PaO.js} +1 -1
- package/dist/client/assets/{use-delete-binding-BBQNMtUY.js → use-delete-binding-Dfz8BlLn.js} +1 -1
- package/dist/client/assets/{use-dev-links-C643CCcq.js → use-dev-links-Cu2JmM-_.js} +1 -1
- package/dist/client/assets/{use-direct-message-panel-BD_daG2E.js → use-direct-message-panel-DobIp_O4.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-BjbC1V6t.js → use-external-adapter-catalog-OLn4l20Q.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-DUH8r8jx.js → use-full-activity-feed-DNrhQueu.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-7gY1n-47.js +1 -0
- package/dist/client/assets/{use-local-browser-P93oA-F5.js → use-local-browser-DPdkgs06.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-B0k0gLoW.js → use-mesh-topology-Ci7r-pAi.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-DE7EQsBF.js → use-mounted-ref-CWXhSyZ8.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-B8JtshQ0.js → use-notification-prefs-GJ2coibL.js} +1 -1
- package/dist/client/assets/use-pending-read-DcVJ8fZb.js +1 -0
- package/dist/client/assets/{use-personality-commit-Dh5Sejj_.js → use-personality-commit-Da2BJ_58.js} +1 -1
- package/dist/client/assets/{use-promo-activation-C9FWA7ru.js → use-promo-activation-D4PAd7pd.js} +1 -1
- package/dist/client/assets/{use-promo-dismissals-BIfafj9f.js → use-promo-dismissals-BCBu0s3k.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-CxzVMmVK.js → use-pulse-freshness-CHLSUL-h.js} +1 -1
- package/dist/client/assets/{use-relay-config-DQE3dmJ2.js → use-relay-config-C6rPlEud.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-B1QPFaUb.js → use-room-follow-claim-BSijPV3c.js} +1 -1
- package/dist/client/assets/{use-room-sessions-CdjzO67_.js → use-room-sessions-CNqHgLVa.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-Nu-MIapD.js → use-roving-tab-list-EsqX22Ik.js} +1 -1
- package/dist/client/assets/use-session-canvas-DAGOz8a6.js +27 -0
- package/dist/client/assets/{use-status-budget-DgeTxC3h.js → use-status-budget-CHln-8aP.js} +1 -1
- package/dist/client/assets/{use-transform-CiJqtMBf.js → use-transform-BmyqpcvO.js} +1 -1
- package/dist/client/assets/{use-unclaimed-chats-Blkq6U4D.js → use-unclaimed-chats-9Clj_rwl.js} +1 -1
- package/dist/client/assets/use-update-config-T78vOnRy.js +1 -0
- package/dist/client/assets/{useMutationState-lbcdmnfE.js → useMutationState-B61VoWtY.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-BM36oESm.js → usecaseDiagram-WPOLBNNX-BUqj8rIH.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-Zrybcs91.js → vennDiagram-Q3Y3IDCW-B09oli-Z.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-CO4pzGG0.js → wardleyDiagram-IVAIDKWA-BE7gzLdw.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-pi_wF1CM.js → xychartDiagram-4URNHDU4-CbGKfmuW.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/index.js +5692 -4710
- package/dist/server/index.js.map +2 -2
- package/package.json +4 -4
- package/dist/client/assets/HandlePage-BjlcYr_l.js +0 -1
- package/dist/client/assets/NamePage-A8X09lY7.js +0 -1
- package/dist/client/assets/PhotoPage-DP5WoeFd.js +0 -1
- package/dist/client/assets/_shell.marketplace-CzLqm8iR.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-DtraxnMx.js +0 -1
- package/dist/client/assets/_shell.session-72JEfodU.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-CcJi8pKR.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-CcJi8pKR.js +0 -1
- package/dist/client/assets/channel-DMgpNBDz.js +0 -1
- package/dist/client/assets/index-e6oawwKv.js +0 -1
- package/dist/client/assets/index-j30EyYIU.js +0 -1
- package/dist/client/assets/registry-BrjQCdmG.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-wkooBe_N.js +0 -8
- package/dist/client/assets/untrusted-text-pHjcUwfI.js +0 -1
- package/dist/client/assets/use-is-below-desktop-DAZnwJGB.js +0 -1
- package/dist/client/assets/use-pending-read-DeGO1wGC.js +0 -1
- package/dist/client/assets/use-session-canvas-BfKGOpNy.js +0 -27
- package/dist/client/assets/use-update-config-BFFW_6Mc.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,hp as A,hq as P,G as k,go as J,a1 as E,a2 as q,gM as R,r as N,a3 as Z,a4 as ee,aI as se,ba as te,B as x,hU as v,bz as U,bA as W,C as L,bB as D,bD as M,U as ne,gO as g,hV as w,gU as B,gV as _,e as C,b8 as ae,hW as ie,hX as le,hY as re}from"./index-B6Scr7KJ.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-Ct1W283T.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(J,"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(U,{children:[s.jsx(W,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start md:self-end",children:[a,s.jsx(L,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsxs(M,{className:"text-sm font-medium",children:["Set differently for ",t]}),s.jsx("ul",{className:"space-y-1",children:n.map(l=>s.jsx(ge,{area:e,exception:l},l.agentId))})]})]})}function G(e,t){return e.resolved.source===(t.kind==="agent"?"agent-action":"default-action")}function 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 Y({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(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(U,{children:[s.jsx(W,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start @lg:self-end",children:[e.length===1?"1 agent differs":`${e.length} agents differ`,s.jsx(L,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsx(M,{className:"text-sm font-medium",children:"Set differently for Files & commands"}),s.jsx("ul",{className:"space-y-1",children:e.map(t=>s.jsx(ve,{agent:t},t.agentId))})]})]})}function O(e){return e.filter(t=>t.kind==="state")}function we({area:e,overview:t}){const n=p({kind:"default"}),a=me(e.id),l=F({kind:"area",area:e.id})??0,[o,d]=N.useState(null),i=(r,u)=>{n.mutate({kind:"patch",areas:{[e.id]:r},...u&&u.length>0?{applyToAgents:u}:{},surface:"settings"},{onError:j,onSettled:()=>d(null)})},m=r=>{r!==e.resolved.state&&(a.length>0?d(r):i(r))};return s.jsxs(s.Fragment,{children:[s.jsx(V,{areaId:e.id,label:e.label,description:e.description,floor:e.floor,value:e.resolved.state,sourceText:[de(e.resolved.source,t.preset),T(l)].filter(Boolean).join(" · "),why:s.jsx(b,{question:`Why is ${e.label} set to ${f[e.resolved.state]}?`,sentence:z({...e.resolved,preset:t.preset}),...e.lastChange?{lastChange:e.lastChange}:{}}),onChange:m,disabled:n.isPending,footer:s.jsx(pe,{area:e.id,areaLabel:e.label,agents:a}),details:s.jsx(Y,{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(Y,{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,hp as A,hq as P,G as k,go as J,a1 as E,a2 as q,gM as R,r as N,a3 as Z,a4 as ee,aI as se,ba as te,B as x,hU as v,bz as U,bA as W,C as L,bB as D,bD as M,U as ne,gO as g,hV as w,gU as B,gV as _,e as C,b8 as ae,hW as ie,hX as le,hY as re}from"./index-p3WivF1M.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-BHIrnfPf.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(J,"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(U,{children:[s.jsx(W,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start md:self-end",children:[a,s.jsx(L,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsxs(M,{className:"text-sm font-medium",children:["Set differently for ",t]}),s.jsx("ul",{className:"space-y-1",children:n.map(l=>s.jsx(ge,{area:e,exception:l},l.agentId))})]})]})}function G(e,t){return e.resolved.source===(t.kind==="agent"?"agent-action":"default-action")}function 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 Y({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(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(U,{children:[s.jsx(W,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start @lg:self-end",children:[e.length===1?"1 agent differs":`${e.length} agents differ`,s.jsx(L,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsx(M,{className:"text-sm font-medium",children:"Set differently for Files & commands"}),s.jsx("ul",{className:"space-y-1",children:e.map(t=>s.jsx(ve,{agent:t},t.agentId))})]})]})}function O(e){return e.filter(t=>t.kind==="state")}function we({area:e,overview:t}){const n=p({kind:"default"}),a=me(e.id),l=F({kind:"area",area:e.id})??0,[o,d]=N.useState(null),i=(r,u)=>{n.mutate({kind:"patch",areas:{[e.id]:r},...u&&u.length>0?{applyToAgents:u}:{},surface:"settings"},{onError:j,onSettled:()=>d(null)})},m=r=>{r!==e.resolved.state&&(a.length>0?d(r):i(r))};return s.jsxs(s.Fragment,{children:[s.jsx(V,{areaId:e.id,label:e.label,description:e.description,floor:e.floor,value:e.resolved.state,sourceText:[de(e.resolved.source,t.preset),T(l)].filter(Boolean).join(" · "),why:s.jsx(b,{question:`Why is ${e.label} set to ${f[e.resolved.state]}?`,sentence:z({...e.resolved,preset:t.preset}),...e.lastChange?{lastChange:e.lastChange}:{}}),onChange:m,disabled:n.isPending,footer:s.jsx(pe,{area:e.id,areaLabel:e.label,agents:a}),details:s.jsx(Y,{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(Y,{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 i,j as s}from"./index-
|
|
1
|
+
import{y as i,j as s}from"./index-p3WivF1M.js";import{P as a,a as m}from"./PermissionHistory-Czl5PWN3.js";import{R as n}from"./ApplyToOverridesDialog-BHIrnfPf.js";function l({member:t}){var o;const e=i((o=t.agent)==null?void 0:o.runtime),r=(e==null?void 0:e.supportsMcp)??!0;return s.jsxs("div",{className:"space-y-6",children:[r?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(a,{scope:{kind:"agent",agentId:t.id}}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:[n[0]," ",n[1]]}),s.jsxs("section",{className:"space-y-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"History"}),s.jsx(m,{agentId:t.id})]})]})}export{l as PermissionsPage};
|
package/dist/client/assets/{PersonalityPopover-DuRjJuLj.js → PersonalityPopover-liTJ0Lns.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-p3WivF1M.js";import{u as m,P as p}from"./use-personality-commit-Da2BJ_58.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-Doekkv7n.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-p3WivF1M.js";import{b as t}from"./ProfileFields-Bi_AfHOE.js";import"./profile-errors-B08zStmk.js";import"./use-mounted-ref-CWXhSyZ8.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
|
package/dist/client/assets/{PreviewRefusedNotice-hlYrFDQM.js → PreviewRefusedNotice-DcD1EY2c.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as b,j as n,bm as _,bp as m,bq as I,fp as k,bt as S,eI as E,dP as N,fq as R,fr as A,bn as T,bv as h,fs as M,ft as $,fu as D,fv as O,a1 as F,a2 as V,aa as G}from"./index-
|
|
1
|
+
import{r as b,j as n,bm as _,bp as m,bq as I,fp as k,bt as S,eI as E,dP as N,fq as R,fr as A,bn as T,bv as h,fs as M,ft as $,fu as D,fv as O,a1 as F,a2 as V,aa as G}from"./index-p3WivF1M.js";import{S as L}from"./shield-x-hHpT8rAA.js";var q=Object.defineProperty,v=(e,t)=>q(e,"name",{value:t,configurable:!0}),x="Tabs",[K,oe]=I(x,[k]),P=k(),[U,y]=K(x),H=b.forwardRef(v(function(t,a){const{__scopeTabs:r,value:s,onValueChange:o,defaultValue:d,orientation:i="horizontal",dir:l,activationMode:g="automatic",...p}=t,u=S(l),[c,f]=E({prop:s,onChange:o,defaultProp:d??"",caller:x});return n.jsx(U,{scope:r,baseId:N(),value:c,onValueChange:f,orientation:i,dir:u,activationMode:g,children:n.jsx(m.div,{dir:u,"data-orientation":i,...p,ref:a})})},"Tabs")),z="TabsList",B=b.forwardRef(v(function(t,a){const{__scopeTabs:r,loop:s=!0,...o}=t,d=y(z,r),i=P(r);return n.jsx(R,{asChild:!0,...i,orientation:d.orientation,dir:d.dir,loop:s,children:n.jsx(m.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})},"TabsList")),Q="TabsTrigger",W=b.forwardRef(v(function(t,a){const{__scopeTabs:r,value:s,disabled:o=!1,...d}=t,i=y(Q,r),l=P(r),g=w(i.baseId,s),p=j(i.baseId,s),u=s===i.value;return n.jsx(A,{asChild:!0,...l,focusable:!o,active:u,children:n.jsx(m.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":p,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:g,...d,ref:a,onMouseDown:T(t.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?i.onValueChange(s):c.preventDefault()}),onKeyDown:T(t.onKeyDown,c=>{o||c.target!==c.currentTarget||[" ","Enter"].includes(c.key)&&i.onValueChange(s)}),onFocus:T(t.onFocus,()=>{const c=i.activationMode!=="manual";!u&&!o&&c&&i.onValueChange(s)})})})},"TabsTrigger")),X="TabsContent",J=b.forwardRef(v(function(t,a){const{__scopeTabs:r,value:s,forceMount:o,children:d,...i}=t,l=y(X,r),g=w(l.baseId,s),p=j(l.baseId,s),u=s===l.value,c=b.useRef(u);return b.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),n.jsx(_,{present:o||u,children:({present:f})=>n.jsx(m.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":g,hidden:!f,id:p,tabIndex:0,...i,ref:a,style:{...t.style,animationDuration:c.current?"0s":void 0},children:f&&d})})},"TabsContent"));function w(e,t){return`${e}-trigger-${t}`}v(w,"makeTriggerId");function j(e,t){return`${e}-content-${t}`}v(j,"makeContentId");var Y=H,Z=B,ee=W,te=J;function ie({...e}){return n.jsx(Y,{"data-slot":"tabs",...e})}function ce({className:e,responsive:t=!0,...a}){return n.jsx(Z,{"data-slot":"tabs-list",className:h("bg-dui-muted text-dui-muted-foreground inline-flex items-center justify-center rounded-lg p-1",t?M:"h-9",e),...a})}function ue({className:e,...t}){return n.jsx(ee,{"data-slot":"tabs-trigger",className:h("ring-offset-dui-background inline-flex items-center justify-center rounded-md px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow,opacity] motion-reduce:transition-none! md:py-1","focus-visible:ring-dui-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none","disabled:pointer-events-none disabled:opacity-50","data-[state=active]:bg-dui-background data-[state=active]:text-dui-foreground data-[state=active]:shadow",e),...t})}function de({className:e,...t}){return n.jsx(te,{"data-slot":"tabs-content",className:h("ring-offset-dui-background mt-2","data-[state=active]:animate-in data-[state=active]:fade-in-0 data-[state=active]:duration-150 motion-reduce:animate-none!","focus-visible:ring-dui-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t})}const ae={default:!1,plan:!1,acceptEdits:!1,dontAsk:!0,bypassPermissions:!0,auto:!0};function le(e){return ae[e]??!1}function se(e){try{return O.toString(e)}catch{return`On the schedule ${e}`}}function fe(e){const t=e.cron?se(e.cron):"Runs only when you ask",a=$(e.startsEnabled);return`${t}, ${a}. This job ${D(e.permissionMode)}.`}function be(e,t){const a=F(),{enabled:r=!0,...s}=t??{},o=Object.keys(s).length>0;return 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 C(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 C(e).checked}function ge({error:e}){const{reasons:t,checked:a}=C(e);return n.jsxs("div",{role:"alert",className:"border-destructive/40 bg-destructive/5 space-y-2 rounded-md border p-3 text-sm",children:[n.jsxs("p",{className:"text-destructive flex items-center gap-2 font-medium",children:[n.jsx(L,{className:"size-4 shrink-0","aria-hidden":!0}),"DorkOS won’t install this package"]}),n.jsx("p",{className:"text-muted-foreground text-xs",children:a?"What it found:":"It couldn’t check what this package does."}),t.length>0&&n.jsx("ul",{className:"text-muted-foreground list-disc space-y-1 pl-5 text-xs [overflow-wrap:anywhere]",children:t.map(r=>n.jsx("li",{children:r},r))})]})}export{ge as P,ie as T,ce as a,ue as b,de as c,fe as d,ve as i,le as r,be as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,t as E,j as e,bg as m,bh as g,bi as x,g as y,B as u,I as f,bj as j,bk as b}from"./index-
|
|
1
|
+
import{r as p,t as E,j as e,bg as m,bh as g,bi as x,g as y,B as u,I as f,bj as j,bk as b}from"./index-p3WivF1M.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-B08zStmk.js";import{u as N}from"./use-mounted-ref-CWXhSyZ8.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-8WxopRj2.js → ProfilePanelContainer-BIbOulLu.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as h,j as t,bg as D,bh as R,bi as E,eh as H,ei as M,ej as _,ek as Z,el as A,G as V,I as v,B as P,z as B}from"./index-
|
|
1
|
+
import{r as h,j as t,bg as D,bh as R,bi as E,eh as H,ei as M,ej as _,ek as Z,el as A,G as V,I as v,B as P,z as B}from"./index-p3WivF1M.js";import{F as j,b as K,P as Y,a as $,c as G}from"./ProfileFields-Bi_AfHOE.js";import{u as I,P as q,b as J}from"./ProfileRolePicker-BadkFi4V.js";function k(e,s){if(e.length!==s.length)return!1;const n=new Set(s);return e.every(r=>n.has(r))}function Q(){const{roles:e,isLoading:s,saveRoles:n}=I(),[r,i]=h.useState(e),[l,o]=h.useState(e),[d,u]=h.useState("idle"),[x,m]=h.useState(null);!s&&!k(l,e)&&(o(e),i(e));const f=()=>{u("saving"),n(r).then(()=>{u("idle"),m(r)}).catch(()=>u("error"))};return t.jsx(D,{children:t.jsxs(R,{className:"space-y-3",children:[t.jsx(E,{label:"What kind of work you do",description:"Only DorkBot and your agents read this. It stays on this machine.",orientation:"vertical",children:t.jsx(q,{selected:r,onChange:i,onConfirm:f,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&&k(r,x)&&t.jsx(j,{tone:"ok",children:"Saved."})]})})}const X=Object.freeze({days:[1,2,3,4,5],start:"09:00",end:"17:00"});function ee(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}const U=new Map;function te(e){let s=U.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"}),U.set(e,s)),s}const ne={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};function w(e,s){const n={};for(const r of te(s).formatToParts(new Date(e)))n[r.type]=r.value;return{year:Number(n.year),month:Number(n.month),day:Number(n.day),hour:Number(n.hour),minute:Number(n.minute),second:Number(n.second),weekday:ne[n.weekday??""]??0}}function z(e,s){const n=w(e,s);return Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second)-Math.floor(e/1e3)*1e3}function se(e){const[s,n]=e.split(":").map(Number);return(s??0)*60+(n??0)}function ae(e,s,n,r,i){const l=se(r),o=Date.UTC(e,s-1,n,Math.floor(l/60),l%60),d=o-z(o-864e5,i),u=o-z(o+864e5,i),x=f=>{const y=w(f,i);return y.year===e&&y.month===s&&y.day===n&&y.hour*60+y.minute===l},m=[d,u].filter(x);return m.length>0?Math.min(...m):Math.max(d,u)}function re(e,s,n){const[r,i,l]=e.split("-").map(Number);return new Date(ae(r??1970,i??1,l??1,s,n))}function oe(e,s){const n=w(e.getTime(),s);return`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")}`}const ie=[{day:1,short:"M",name:"Monday"},{day:2,short:"T",name:"Tuesday"},{day:3,short:"W",name:"Wednesday"},{day:4,short:"T",name:"Thursday"},{day:5,short:"F",name:"Friday"},{day:6,short:"S",name:"Saturday"},{day:0,short:"S",name:"Sunday"}];function le(e){const s=typeof Intl.supportedValuesOf=="function"?Intl.supportedValuesOf("timeZone"):[];return s.includes(e)?s:[e,...s]}function de(e,s,n){const r=e??J()??ee(),i=s??X;return{timezone:r,days:[...i.days],start:i.start,end:i.end,awayUntil:n!=null&&n.until?oe(new Date(n.until),r):""}}function b(e,s){return e.timezone===s.timezone&&e.start===s.start&&e.end===s.end&&e.awayUntil===s.awayUntil&&[...e.days].sort().join()===[...s.days].sort().join()}function ue(e){return e.days.length===0?"Pick at least one working day.":!e.start||!e.end?"Set a start and an end time.":e.end<=e.start?"The day has to end after it starts.":null}function ce(e,s,n){return e.awayUntil===s.awayUntil?n:e.awayUntil?{...n,until:re(e.awayUntil,"00:00",e.timezone).toISOString()}:null}function me(){const{timezone:e,workingHours:s,away:n,isLoading:r,saveHours:i}=I(),l=de(e,s,n),[o,d]=h.useState(l),[u,x]=h.useState(l),[m,f]=h.useState("idle"),[y,C]=h.useState(null),[F,O]=h.useState(null);!r&&!b(u,l)&&(x(l),d(l));const p=ue(o),g=a=>d(c=>({...c,...a})),W=a=>g({days:o.days.includes(a)?o.days.filter(c=>c!==a):[...o.days,a]}),L=()=>{if(p)return;f("saving");const a=o;i({timezone:a.timezone,workingHours:{days:[...a.days].sort((c,S)=>c-S),start:a.start,end:a.end},away:ce(a,u,n)}).then(()=>{f("idle"),C(null),O(a)}).catch(c=>{f("error"),C(c instanceof Error?c.message:null)})};return t.jsx(D,{children:t.jsxs(R,{className:"space-y-4",children:[t.jsx(E,{label:"Your hours",description:"Your time zone and working hours.",orientation:"vertical",children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("label",{htmlFor:"profile-timezone",className:"text-muted-foreground text-xs",children:"Time zone"}),t.jsxs(H,{value:o.timezone,onValueChange:a=>g({timezone:a}),children:[t.jsx(M,{id:"profile-timezone",className:"h-8 text-sm",responsive:!1,children:t.jsx(_,{})}),t.jsx(Z,{children:le(o.timezone).map(a=>t.jsx(A,{value:a,responsive:!1,children:a.replace(/_/g," ")},a))})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{id:"profile-days-label",className:"text-muted-foreground text-xs",children:"Working days"}),t.jsx("div",{role:"group","aria-labelledby":"profile-days-label",className:"flex gap-1",children:ie.map(({day:a,short:c,name:S})=>{const T=o.days.includes(a);return t.jsx("button",{type:"button","aria-label":S,"aria-pressed":T,onClick:()=>W(a),className:V("size-8 rounded-md border text-xs font-medium",T?"bg-primary text-primary-foreground border-transparent":"text-muted-foreground hover:bg-accent"),children:c},a)})})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"flex-1 space-y-1",children:[t.jsx("label",{htmlFor:"profile-hours-start",className:"text-muted-foreground text-xs",children:"Start"}),t.jsx(v,{id:"profile-hours-start",type:"time",value:o.start,onChange:a=>g({start:a.target.value})})]}),t.jsxs("div",{className:"flex-1 space-y-1",children:[t.jsx("label",{htmlFor:"profile-hours-end",className:"text-muted-foreground text-xs",children:"End"}),t.jsx(v,{id:"profile-hours-end",type:"time",value:o.end,onChange:a=>g({end:a.target.value})})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("label",{htmlFor:"profile-away-until",className:"text-muted-foreground text-xs",children:"Away until"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(v,{id:"profile-away-until",type:"date",value:o.awayUntil,onChange:a=>g({awayUntil:a.target.value})}),o.awayUntil&&t.jsx(P,{type:"button",variant:"ghost",size:"sm",onClick:()=>g({awayUntil:""}),children:"Clear"})]})]})]})}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(P,{type:"button",size:"sm",onClick:L,disabled:r||m==="saving"||p!==null||b(o,u),children:m==="saving"?"Saving…":"Save"}),p&&t.jsx(j,{tone:"error",children:p}),!p&&m==="error"&&t.jsx(j,{tone:"error",children:y??"Couldn’t save that. Try again."}),!p&&m!=="error"&&F&&b(o,F)&&t.jsx(j,{tone:"ok",children:"Saved."})]})]})})}function he({member:e}){return t.jsxs("div",{className:"space-y-4",children:[t.jsx("p",{className:"text-muted-foreground text-sm",children:"How you appear on your team page, in rooms and beside your messages."}),t.jsx(K,{member:e}),t.jsx(Y,{member:e}),t.jsx($,{member:e}),t.jsx(G,{member:e}),t.jsx(Q,{}),t.jsx(me,{})]})}function N({children:e}){return t.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:e})}function pe(){var n;const e=B(),s=(n=e.data)==null?void 0:n.members.find(r=>r.isSelf);return e.isPending?t.jsx(N,{children:"Loading your profile…"}):e.isError?t.jsx(N,{children:"Couldn’t load your profile. Reopen this tab to try again."}):s?t.jsx(he,{member:s}):t.jsx(N,{children:"Couldn’t find your profile. Reopen this tab to try again."})}export{he as P,pe as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a1 as O,a3 as E,a2 as I,aI as h,a4 as j,aH as D,eG as S,r as b,j as l,G as z,I as q,B as k}from"./index-
|
|
1
|
+
import{a1 as O,a3 as E,a2 as I,aI as h,a4 as j,aH as D,eG as S,r as b,j as l,G as z,I as q,B as k}from"./index-p3WivF1M.js";function B(){var a,d,c,m,g,p;const r=O(),s=E(),{data:e,isLoading:o}=I({queryKey:h.current(),queryFn:()=>r.getConfig(),staleTime:S}),i=j({mutationKey:D,mutationFn:u=>r.updateConfig({profile:u}),onSuccess:()=>{s.invalidateQueries({queryKey:h.all})}});return{roles:((a=e==null?void 0:e.profile)==null?void 0:a.roles)??[],rolePromptDismissedAt:((d=e==null?void 0:e.profile)==null?void 0:d.rolePromptDismissedAt)??null,identityPromptDismissedAt:((c=e==null?void 0:e.profile)==null?void 0:c.identityPromptDismissedAt)??null,timezone:((m=e==null?void 0:e.profile)==null?void 0:m.timezone)??null,workingHours:((g=e==null?void 0:e.profile)==null?void 0:g.workingHours)??null,away:((p=e==null?void 0:e.profile)==null?void 0:p.away)??null,isLoading:o,saveHours:u=>i.mutateAsync(u).then(()=>{}),saveRoles:u=>i.mutateAsync({roles:u}).then(()=>{}),dismissRolePrompt:()=>i.mutateAsync({rolePromptDismissedAt:new Date().toISOString()}).then(()=>{}),dismissIdentityPrompt:()=>i.mutateAsync({identityPromptDismissedAt:new Date().toISOString()}).then(()=>{})}}let x=!1;function K(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{return null}}function Q(){const r=O(),s=E(),{data:e,isSuccess:o}=I({queryKey:h.current(),queryFn:()=>r.getConfig(),staleTime:S}),i=e==null?void 0:e.profile;b.useEffect(()=>{if(x||!o||!i)return;if(i.timezone!=null){x=!0;return}const a=K();a&&(x=!0,r.updateConfig({profile:{timezone:a}}).then(()=>s.invalidateQueries({queryKey:h.all})).catch(()=>{}))},[o,i,r,s])}const w=[{id:"software-development",label:"Building software"},{id:"hiring",label:"Hiring people"},{id:"marketing",label:"Marketing"},{id:"writing",label:"Writing"},{id:"research",label:"Research"},{id:"business-ops",label:"Running a business"},{id:"design",label:"Design"},{id:"sales",label:"Sales"}],H=6,M={developer:"software-development",engineer:"software-development",programmer:"software-development",coder:"software-development","software engineer":"software-development",recruiter:"hiring",recruiting:"hiring",talent:"hiring",marketer:"marketing",growth:"marketing",writer:"writing",author:"writing",researcher:"research",scientist:"research",founder:"business-ops",entrepreneur:"business-ops",operations:"business-ops",ops:"business-ops",designer:"design",seller:"sales",salesperson:"sales"};function F(r){var i;const s=r.trim().toLowerCase();if(s.length===0)return;const e=w.find(a=>a.id===s);if(e)return e.id;const o=M[s];return o||((i=w.find(a=>a.label.toLowerCase()===s))==null?void 0:i.id)}const A=10,N=60;function v(r,s){const e=s.trim().toLowerCase();return r.some(o=>o.trim().toLowerCase()===e)}function W({selected:r,onChange:s,onConfirm:e,confirmLabel:o,onSkip:i,skipLabel:a,busy:d=!1,error:c=null}){const[m,g]=b.useState(!1),[p,u]=b.useState(""),C=b.useRef(null),y=w.slice(0,H),T=r.filter(t=>!y.some(n=>n.id===t)),f=r.length>=A,P=t=>{v(r,t)?s(r.filter(n=>n!==t)):f||s([...r,t])},L=()=>{const t=p.trim().slice(0,N);if(!t)return;const n=F(t),R=n&&y.some(_=>_.id===n)?n:t;!v(r,R)&&r.length<A&&s([...r,R]),u("")};return l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"group","aria-label":"What kind of work you do",children:[y.map(t=>{const n=v(r,t.id);return l.jsx("button",{type:"button","aria-pressed":n,disabled:f&&!n,onClick:()=>P(t.id),className:z("focus-visible:ring-ring rounded-md border px-2.5 py-1 text-xs transition-colors duration-150 focus-visible:ring-2 focus-visible:outline-none disabled:opacity-50",n?"border-primary bg-primary text-primary-foreground":"border-input bg-background text-foreground hover:bg-accent"),children:t.label},t.id)}),T.map(t=>l.jsx("button",{type:"button","aria-pressed":!0,onClick:()=>s(r.filter(n=>n!==t)),className:"border-primary bg-primary text-primary-foreground focus-visible:ring-ring rounded-md border px-2.5 py-1 text-xs transition-colors duration-150 focus-visible:ring-2 focus-visible:outline-none",children:t},t)),!m&&l.jsx("button",{type:"button",disabled:f,onClick:()=>{g(!0),setTimeout(()=>{var t;return(t=C.current)==null?void 0:t.focus()},0)},className:"border-input text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:ring-ring rounded-md border border-dashed px-2.5 py-1 text-xs transition-colors duration-150 focus-visible:ring-2 focus-visible:outline-none disabled:opacity-50",children:"Something else"})]}),f&&l.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"profile-role-cap-hint",children:"Ten at most. Remove a role to add another."}),m&&!f&&l.jsx(q,{ref:C,value:p,onChange:t=>u(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),L())},maxLength:N,placeholder:"Type your work and press Enter","aria-label":"Something else: describe your work",className:"h-8 text-xs"}),c&&l.jsx("p",{className:"text-destructive text-sm",role:"alert","data-testid":"profile-save-error",children:c}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsx(k,{size:"sm",onClick:e,disabled:d||r.length===0,"data-testid":"confirm-profile",children:o}),i&&l.jsx(k,{size:"sm",variant:"ghost",onClick:i,disabled:d,"data-testid":"skip-profile",children:a})]})]})}export{W as P,Q as a,K as b,B as u};
|
package/dist/client/assets/{PromptSuggestionChips-D34Zeaq_.js → PromptSuggestionChips-C653MlaU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,ar as c,aQ as l,G as i}from"./index-
|
|
1
|
+
import{j as e,ar as c,aQ as l,G as i}from"./index-p3WivF1M.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-p3WivF1M.js";import{u as Y}from"./use-mounted-ref-CWXhSyZ8.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a1 as ie,a4 as de,a3 as Oe,iZ as _e,i_ as ne,i$ as me,j0 as Le,j1 as Fe,j2 as De,aP as ze,r as s,j as t,G as ee,B as we,x as He,e as Q,gy as Ie,hh as qe,gx as ke,j3 as $e,j4 as We,n as Be,gB as U,a7 as Ke,fy as Ge,j5 as Ue,j6 as Xe,j7 as Ye,cu as Qe,j8 as Ve,j9 as Ze,ja as Je,jb as et,cq as tt,jc as nt,gw as Y,jd as st,l as rt,s as he,je as ot,jf as at,e7 as it,X as dt,e4 as lt,ar as ut,jg as ct,jh as pe,ji as ft,ad as mt,jj as ht,gv as pt,gu as gt,jk as xt,aF as ge,by as yt}from"./index-B6Scr7KJ.js";import{P as Rt,u as vt}from"./pane-resize-handle-BOtzx5Q4.js";import{D as bt,U as jt,u as wt}from"./UnreadDivider-LL4_YtF0.js";import{u as It}from"./use-room-follow-claim-B1QPFaUb.js";import{a as le,e as ue,g as kt,f as Ae,h as At,i as Ne,c as G,d as V,j as Nt,k as re,b as oe,l as ae,A as Se,m as Ce,t as ce,r as St,n as J,R as fe,u as Me,C as Te,o as Ct}from"./ChannelComposer-BVACOdph.js";import{u as Mt,f as Tt,a as Pt,F as Et,C as X,d as Ot,M as _t}from"./registry-tJrGs7kB.js";import{u as Lt}from"./use-connector-management-9Q7wHb06.js";import{A as Ft}from"./AgentRequestCard-CmAlDGTr.js";import{u as Dt}from"./use-room-sessions-CdjzO67_.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),R=ne(p=>{var f;return e===null?null:((f=p.paging[e])==null?void 0:f.cursor)??null}),i=de({mutationFn:async p=>{var j;const f=(j=ne.getState().paging[p])==null?void 0:j.cursor;if(f==null)return;const v=await o.listRoomEntries(p,{before:f,limit:me}),I=ze.entries(p),k=r.getQueryData(I),A=Le(k,v);r.setQueryData(I,A),ne.getState().notePage(p,Fe(v)??f,De(v,me)||A.length===((k==null?void 0:k.length)??0))},meta:{errorLabel:"Couldn't load older messages"}}),{mutateAsync:d,isPending:w}=i,y=s.useRef(!1),x=s.useCallback(async()=>{if(!(e===null||y.current)){y.current=!0;try{await d(e).catch(()=>{})}finally{y.current=!1}}},[e,d]);return{canLoadOlder:u,isLoadingOlder:w,cursor:R,loadOlder:x}}function $t({id:e,summary:o,open:r,onOpen:u}){const{capabilities:R}=Mt(),{count:i,lastAt:d,unread:w}=o,y=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 R.threads?t.jsxs("button",{type:"button",id:e,"data-slot":"thread-reply-row","data-testid":"room-thread-replies","data-unread":w>0?"":void 0,"aria-expanded":r,onClick:u,className:ee("focus-ring ml-[calc(var(--msg-padding-x)_+_var(--msg-gutter-width)_+_var(--msg-gap))]","mb-1 w-fit rounded text-left text-xs transition-colors","px-2 py-2 md:px-1 md:py-0.5",w>0?"text-primary hover:text-primary/80 font-medium":"text-muted-foreground hover:text-foreground"),children:[t.jsx("span",{"aria-hidden":!0,className:"mr-1",children:"↳"}),t.jsx("span",{className:ee(f&&"motion-safe:animate-count-flip"),"data-testid":"room-thread-reply-count",children:i},i),i===1?" reply":" replies",y.length>0&&t.jsxs(t.Fragment,{children:[" · last ",t.jsx("time",{dateTime:d,title:Pt(d),children:y})]}),w>0&&` · ${w} new`]}):null}function Wt({loading:e,onLoad:o}){return t.jsx("div",{className:"flex justify-center px-4 py-3",children:t.jsxs(we,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:e,"data-testid":"room-load-older",className:"text-muted-foreground hover:text-foreground h-7 gap-2 text-xs",children:[e&&t.jsx(He,{size:"xs"}),e?"Loading older messages…":"Older messages"]})})}const Bt="room-load-older",Kt=4;function Pe({roomName:e}){return t.jsx(Et,{label:e===void 0?"Messages":`Messages in ${e}`,busy:!0,className:"flex flex-col gap-4 p-4","data-testid":"room-timeline-loading",children:Array.from({length:Kt},(o,r)=>t.jsxs("div",{className:"flex gap-3",children:[t.jsx(Q,{className:"size-7 shrink-0 rounded-full"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[t.jsx(Q,{className:"h-3 w-24"}),t.jsx(Q,{className:"h-3 w-full max-w-md"})]})]},`room-skeleton-${r}`))})}function Gt({roomId:e,roomName:o,viewerAuthorId:r,entries:u,members:R,formerAuthors:i,lastReadSeq:d,reactionFrequents:w,streamStalled:y,isLoading:x,error:p,onAddAgents:f,openThreadId:v,onOpenThread:I,resumeRow:k,landOnRow:A,onTopRow:j,canLoadOlder:S=!1,isLoadingOlder:l=!1,onLoadOlder:c,ref:C}){const N=s.useMemo(()=>le(R,i),[R,i]),P=Ie(R,r),E=ue(),T=s.useMemo(()=>new Map([...N].map(([n,m])=>[n,m.displayName])),[N]),M=qe(),L=ke(e,null),{topLevel:H,repliesByRoot:F,orphaned:D}=s.useMemo(()=>kt(u),[u]),q=s.useMemo(()=>new Map(u.map(n=>[n.id,n])),[u]),z=s.useMemo(()=>{const n=$e(H,d),m=We(H.map(a=>({id:a.id,authorId:a.body.moment?`moment:${a.id}`:a.authorId,timestamp:a.createdAt})),{now:M,lastSeenId:n.lastSeenId,unreadFromStart:n.fromStart}),b=[];S&&!x&&b.push({kind:"load-older",id:Bt});for(const a of m){if(a.kind==="day-divider"){b.push({kind:"day-divider",id:a.key,label:a.label});continue}if(a.kind==="unread-divider"){b.push({kind:"unread-divider",id:a.key});continue}const h=H[a.index];b.push({kind:"message",id:h.id,entry:h,grouping:a.grouping,position:a.index+1,answers:Ae(h,H[a.index-1],q.get.bind(q))});const g=F.get(h.id);g&&b.push({kind:"thread-reply",id:At(h.id),rootId:h.id,replies:g,totalReplies:h.threadReplyCount})}return b},[H,F,q,d,M,S,x]),$=s.useMemo(()=>z.map(n=>n.kind==="load-older"?{kind:"notice",id:n.id,at:"",body:null}:n.kind==="day-divider"?{kind:"day-divider",id:n.id,label:n.label}:n.kind==="unread-divider"?{kind:"unread-divider",id:n.id}:n.kind==="thread-reply"?{kind:"thread-reply",id:n.id,rootId:n.rootId,replyCount:Ne(n.replies.length,n.totalReplies),lastAt:n.replies[n.replies.length-1].createdAt}:{kind:"message",id:n.id,payload:n.entry,grouping:n.grouping,author:G(V(n.entry,N),N,E.faces),at:n.entry.createdAt}),[z,N,E.faces]),K=s.useCallback((n,m)=>{const b=z[m.index];if(b.kind==="load-older")return c===void 0?null:t.jsx(Wt,{loading:l,onLoad:c});if(b.kind==="day-divider")return t.jsx(bt,{label:b.label});if(b.kind==="unread-divider")return t.jsx(jt,{});if(b.kind==="thread-reply"){if(m.onOpenThread===void 0)return null;const h=m.onOpenThread;return t.jsx($t,{id:re(b.rootId),summary:Nt(b.replies,d,b.totalReplies),open:v===b.rootId,onOpen:()=>h(b.rootId)})}const a=V(b.entry,N);return t.jsx(oe,{roomId:e,entry:b.entry,author:G(a,N,E.faces),authorRef:N.get(a),authors:N,viewerAuthorId:r,authorNames:T,reactionFrequents:w,streamStalled:y,isMember:P,grouping:b.grouping,orphanedReply:D.has(b.entry.id),answers:b.answers,feedPosition:{index:b.position,total:-1},rowId:ae(b.entry.id)})},[z,e,N,E.faces,r,T,w,y,P,D,d,v,l,c]),O=s.useCallback(n=>{if(n.kind==="message")return ae(n.id);if(n.kind==="thread-reply")return re(n.rootId)},[]);if(p)return t.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[t.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load these messages"}),t.jsx("p",{className:"max-w-sm",children:"Nothing was lost. Reload to try again."})]});const W=R.some(n=>n.author.kind==="agent"),B=t.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[t.jsx(Be,{className:"text-muted-foreground/50 size-8","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:"Nothing said here yet"}),t.jsx("p",{className:"max-w-sm",children:W?"Say something to get it going.":"Nothing answers until you add an agent."}),t.jsx(we,{type:"button",size:"sm",variant:W?"ghost":"default",onClick:f,className:"mt-1",children:W?"Add more agents":"Add agents"})]});return t.jsx(Se,{known:E,children:t.jsx(X.Timeline,{ref:C,conversationId:e,label:`Messages in ${o}`,rows:$,renderRow:K,onOpenThread:I,domIdOf:O,...k===void 0?{}:{resumeRow:k},...A===void 0?{}:{landOnRow:A},...j===void 0?{}:{onTopRow:j},pending:L,viewerAuthorId:r,loading:x?t.jsx(Pe,{roomName:o}):void 0,empty:B,feedTestId:"room-timeline"})})}function Ut(e){const{roomId:o,entrySeq:r,entries:u,historyLoaded:R}=e,i=r===void 0?null:`${o}:${r}`,d=s.useMemo(()=>{if(r===void 0)return null;const k=u.find(l=>l.seq===r);if(k===void 0)return null;const A=Ce(u,k.id);if(A===null)return null;const j=ce(k)??null,S=j!==null&&A.rowId!==k.id;return{roomRowId:A.rowId,threadRootId:S?j:null,entryId:k.id}},[u,r]),w=s.useRef(null),y=(d==null?void 0:d.threadRootId)??null;s.useEffect(()=>{i===null||y===null||w.current!==i&&(w.current=i,U.getState().openThread(o,y))},[i,o,y]);const x=s.useRef(null);s.useEffect(()=>{i===null||!R||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,R,d]);const p=s.useRef(null),f=s.useCallback(()=>{if(!(i===null||p.current===i))return p.current=i,d==null?void 0:d.roomRowId},[i,d]),v=s.useRef(null),I=s.useCallback(()=>{if(!(i===null||v.current===i))return v.current=i,(d==null?void 0:d.threadRootId)===null||d==null?void 0:d.entryId},[i,d]);return{roomRow:r===void 0?void 0:f,threadRow:r===void 0?void 0:I}}function Xt(e,o){const[r,u]=s.useState({roomId:null,seq:null});return r.roomId===e?r.seq:e===null?(u({roomId:null,seq:null}),null):o===null?null:(u({roomId:e,seq:o}),o)}const Yt=600;function Qt(e){return document.getElementById(re(e))??document.getElementById(ae(e))}function Vt(){const e=s.useRef(null);return s.useEffect(()=>()=>{var r;return(r=e.current)==null?void 0:r.call(e)},[]),{arm:s.useCallback(r=>{var w;(w=e.current)==null||w.call(e);let u=0;const R=Date.now()+Yt;let i=!1;const d=()=>{if(i)return;const y=document.activeElement;if(y===null||y===document.body||!y.isConnected){const p=Qt(r);if(p!==null){p.focus();return}}Date.now()>=R||(u=requestAnimationFrame(d))};u=requestAnimationFrame(d),e.current=()=>{i=!0,cancelAnimationFrame(u)}},[])}}function Zt({roomId:e,route:o,urlThreadId:r,openThreadId:u,entries:R,historyLoaded:i}){const d=Ge(),w=s.useRef(null);s.useEffect(()=>{if(e!==null){if(w.current!==e&&(w.current=e,r!==void 0)){U.getState().openThread(e,r);return}if(i&&u!==void 0){const y=R.find(p=>p.id===u),x=y===void 0?void 0:St(y);if(x!==void 0&&x!==u){const p=U.getState().open[e];U.getState().openThread(e,x,(p==null?void 0:p.focusComposer)??!1);return}}u!==r&&(d==null||d({to:o,search:y=>({...y,thread:u}),replace:!0}))}},[e,o,u,r,R,i,d])}function Jt(e){return e.kind!=="channel"||e.bridge!=null||e.archived?!1:!e.members.some(o=>o.author.kind==="agent")}function en({room:e,hasEntries:o,onAddAgents:r}){return!o||!Jt(e)?null:t.jsxs("p",{className:"text-muted-foreground shrink-0 px-4 pb-1 text-xs","data-testid":"no-agent-hint",children:["No agent is in this channel to answer."," ",t.jsx("button",{type:"button",onClick:r,className:"text-foreground focus-visible:ring-ring rounded-sm underline underline-offset-2 focus-visible:ring-2 focus-visible:outline-none",children:"Add one"})," ","to get answers here."]})}function tn({roomId:e}){const{approvals:o}=Ue(),r=Xe(o).filter(u=>u.roomId===e);return r.length===0?null:t.jsx("section",{"data-slot":"room-approvals","aria-label":"Requests waiting on you",className:"shrink-0 px-3 pb-2 md:px-4",children:t.jsx(Ye,{approvals:r})})}function nn({roomId:e}){const{data:o}=Lt("pending"),r=(o??[]).filter(u=>u.roomId===e);return r.length===0?null:t.jsx("section",{"data-slot":"room-agent-requests","aria-label":"Apps agents are asking for",className:"shrink-0 space-y-2 px-3 pb-2 md:px-4",children:r.map(u=>t.jsx(Ft,{request:u},u.requestId))})}const sn="An agent",xe=64,se=3,rn=new Set;function Ee({room:e,entries:o,scope:r,laneScope:u,stalled:R,unavailable:i=!1,onRetry:d,onScrollToRow:w}){const y=Qe(),x=Ve(e.id,r),p=Ze(e.id,r),f=Je(e.id,r),[v,I]=s.useState(!1),k=Dt(e.id,{enabled:v}),A=et(),{mutate:j}=zt(),[S,l]=s.useState(rn),c=s.useCallback(a=>{l(h=>new Set(h).add(a)),j({roomId:e.id,authorId:a},{onSettled:()=>l(h=>{const g=new Set(h);return g.delete(a),g})})},[j,e.id]),C=Ht(),[N,P]=s.useState(()=>new Map),E=tt(),T=ue(),M=s.useMemo(()=>le(e.members,e.formerAuthors),[e.members,e.formerAuthors]),L=s.useCallback(a=>{var h;return((h=M.get(a))==null?void 0:h.displayName)??sn},[M]),{interactions:H}=nt(),F=s.useMemo(()=>H.filter(a=>a.roomId===e.id),[H,e.id]),D=s.useMemo(()=>{var h;const a={};for(const g of F){if(g.roomAuthorId===void 0)continue;const _=(h=M.get(g.roomAuthorId))==null?void 0:h.displayName;_!==void 0&&(a[g.sessionId]=_)}return a},[F,M]),q=s.useMemo(()=>x.map(a=>({authorId:a.authorId,name:L(a.authorId),state:a.state,since:a.since,activity:a.activity??null})),[x,L]),z=s.useMemo(()=>p.map(a=>{var g;const h=(g=E.data)==null?void 0:g.find(_=>_.id===a.behindRoomId);return{authorId:a.authorId,name:L(a.authorId),since:a.since,behind:{roomId:a.behindRoomId,title:h===void 0?null:Y(h)},othersWaiting:a.othersWaiting,severalInTheWay:a.severalInTheWay}}),[p,L,E.data]),$=s.useMemo(()=>{const a=new Set;for(const h of p)N.get(h.authorId)===h.entryId&&a.add(h.authorId);return a},[p,N]),K=s.useMemo(()=>f===null?null:{authorId:f.authorId,name:L(f.authorId)},[f,L]),O=s.useMemo(()=>Ot({capabilities:fe,asks:F,agentNames:D,stalled:R,presence:q,held:z,silentFinish:K,turn:null}),[F,D,q,z,K,R]),W=s.useMemo(()=>{var h;const a=new Map;for(const g of((h=k.data)==null?void 0:h.bindings)??[])a.set(g.authorId,g.sessionId);return a},[k.data]),B=s.useCallback(a=>{const h=o.find(_=>_.id===a);if(h===void 0)return null;const g=h.body.text.replace(/\s+/gu," ").trim();return g.length===0?null:g.length>xe?`${g.slice(0,xe).trimEnd()}…`:g},[o]),n=s.useCallback(a=>{var h;return u==="thread"?J(a):((h=Ce(o,a))==null?void 0:h.domId)??null},[o,u]),m=s.useMemo(()=>{const a=x.map(g=>{const _=B(g.entryId),Z=n(g.entryId);return{authorId:g.authorId,author:G(g.authorId,M,T.faces),state:g.state,since:g.since,doing:st(g.activity),replyingTo:_===null||Z===null?null:{entryId:g.entryId,excerpt:_,rowId:Z},sessionId:W.get(g.authorId)??null}}),h=z.map(g=>({authorId:g.authorId,author:G(g.authorId,M,T.faces),state:"held",since:g.since,doing:null,replyingTo:null,sessionId:null,behind:g.behind,othersWaiting:g.othersWaiting}));return[...a,...h]},[x,z,M,T.faces,B,n,W]),b=s.useMemo(()=>{if(x.length===0)return null;const a=x.slice(0,se);return t.jsxs("span",{"aria-hidden":"true",className:"flex shrink-0 -space-x-1",children:[a.map(h=>t.jsx(_t,{author:G(h.authorId,M,T.faces),className:"ring-background size-4 ring-2"},h.authorId)),x.length>se&&t.jsx("span",{className:"bg-muted text-muted-foreground ring-background text-3xs flex size-4 items-center justify-center rounded-full ring-2",children:`+${x.length-se}`})]})},[x,M,T.faces]);return t.jsx(X.LiveLane,{state:O,scope:u,onRetry:d,unavailable:i,faces:b,onPeekOpenChange:I,askCard:O.kind==="ask"?t.jsx(ot,{ask:O.ask,...D[O.ask.sessionId]?{agentName:D[O.ask.sessionId]}:{},onOpenSession:a=>{y(he({session:a}))},className:"border-l-0"}):void 0,peek:t.jsx(X.LivePeek,{rows:m,onScrollToRow:w,onOpenSession:a=>{y(he({session:a}))},onOpenRoom:a=>{y({...rt.channels(),search:{id:a}})},onAnswerFirst:a=>{const h=p.find(g=>g.authorId===a);h!==void 0&&P(g=>new Map(g).set(a,h.entryId)),C.mutate({roomId:e.id,authorId:a})},promoted:$,onStopAll:()=>A.mutate({roomId:e.id}),stopping:A.isPending,onStopAgent:c,stoppingAgents:S})})}const ye=3e3;function on(e,o,r,u=Date.now){const R=s.useRef(null),i=s.useRef(new Map),d=s.useRef(new Map),w=R.current,y=i.current,x=d.current,p=u();for(const f of e){if(x.has(f.id))continue;if(w===null){x.set(f.id,"at-rest");continue}const v=y.get(f.authorId);x.set(f.id,v!==void 0&&p-v<ye?"handed-off":"dropped")}return s.useEffect(()=>{if(!r)return;R.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>ye&&i.current.delete(v);for(const v of d.current.keys())R.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:R,streamStalled:i,streamUnavailable:d,onRetryStream:w,historyLoaded:y,historyFailed:x=!1,landOnRow:p,pushed:f,onClose:v}){const I=s.useMemo(()=>le(e.members,e.formerAuthors),[e.members,e.formerAuthors]),k=Me({room:e,threadRootId:o}),A=Ie(e.members,e.viewerAuthorId),j=ue(),S=s.useMemo(()=>new Map([...I].map(([n,m])=>[n,m.displayName])),[I]),{root:l,replies:c}=s.useMemo(()=>{let n;const m=[];for(const b of u)b.id===o?n=b:ce(b)===o&&m.push(b);return{root:n,replies:m}},[u,o]),C=l==null?void 0:l.threadReplyCount,N=C!==void 0&&C>c.length,P=!f,E=l===void 0||N?-1:(P?1:0)+c.length,T=Ne(c.length,C),M=s.useMemo(()=>new Set(c.map(n=>n.id)),[c]),L=s.useMemo(()=>({replyIds:M,inside:!0}),[M]),H=at(e.id,L),F=ke(e.id,o),D=on(c,H,y),q=s.useRef(null),z=s.useCallback(n=>{var m;(m=q.current)==null||m.scrollToRow(n)},[]),$=s.useRef(null);s.useEffect(()=>{var n;r||(n=$.current)==null||n.focus()},[o,r]);const K=n=>{n.key!=="Escape"||n.defaultPrevented||(n.stopPropagation(),v())},O=s.useMemo(()=>{const n=[];if(l===void 0){const m=x?"thread-error":y?"thread-orphan":"thread-waiting";n.push({kind:"notice",id:m,at:"",body:null})}else P&&n.push({kind:"message",id:l.id,payload:l,grouping:{position:"only"},author:G(V(l,I),I,j.faces),at:l.createdAt});for(const m of c)n.push({kind:"message",id:m.id,payload:m,grouping:{position:"only"},author:G(V(m,I),I,j.faces),at:m.createdAt});return n},[l,P,c,I,j.faces,x,y]),W=s.useCallback(n=>{if(n.kind==="notice")return t.jsx(an,{kind:n.id});if(n.kind!=="message")return null;const m=n.payload,b=l!==void 0&&m.id===l.id,a=c.findIndex(_=>_.id===m.id),h=t.jsx(oe,{roomId:e.id,entry:m,rowId:J(m.id),author:n.author,authorRef:I.get(m.authorId),authors:I,viewerAuthorId:e.viewerAuthorId,authorNames:S,reactionFrequents:R,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(Re,{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,R,i,A,E]),B=s.useCallback(n=>n.kind==="message"?J(n.id):void 0,[]);return t.jsx(Se,{known:j,children:t.jsx(X.Root,{surface:"room",capabilities:fe,target:k.target,anchor:"rail",children:t.jsxs("section",{ref:$,"aria-label":"Thread","data-testid":"room-thread-panel",tabIndex:-1,onKeyDown:K,className:ee("bg-card flex min-h-0 flex-col outline-none",f?"h-full w-full":"w-full border-l"),children:[f?t.jsxs("header",{className:"flex items-center gap-2 border-b px-1 py-1",children:[t.jsxs("button",{type:"button",onClick:v,"aria-label":`Back to ${Y(e)}`,"data-testid":"room-thread-back",className:"focus-ring text-muted-foreground hover:text-foreground flex h-11 min-w-0 items-center gap-1 rounded px-2 text-sm",children:[t.jsx(it,{"aria-hidden":!0,className:"size-4 shrink-0"}),t.jsx("span",{className:"truncate",children:Y(e)})]}),t.jsx("p",{className:"ml-auto shrink-0 pr-3 text-sm font-medium",children:"Thread"})]}):t.jsxs("header",{className:"flex items-center gap-2 border-b px-3 py-2",children:[t.jsx("button",{type:"button",onClick:v,"aria-label":"Close thread",className:"focus-ring text-muted-foreground hover:text-foreground relative -ml-1 rounded p-1",children:t.jsx(dt,{"aria-hidden":!0,className:"size-4"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm font-medium",children:"Thread"}),t.jsx("p",{className:"text-muted-foreground truncate text-xs",children:Y(e)})]})]}),f&&l!==void 0&&t.jsxs("div",{"data-testid":"room-thread-pinned-root",className:"max-h-[40%] shrink-0 overflow-y-auto border-b pt-2",children:[t.jsx(oe,{roomId:e.id,entry:l,rowId:J(l.id),author:G(V(l,I),I,j.faces),authorRef:I.get(l.authorId),authors:I,viewerAuthorId:e.viewerAuthorId,authorNames:S,reactionFrequents:R,streamStalled:i,isMember:A,grouping:{position:"only"}}),t.jsx(Re,{count:T})]}),t.jsx(X.Timeline,{ref:q,conversationId:`thread-${o}`,label:`Thread in ${Y(e)}`,busy:!y&&!x,rows:O,renderRow:W,domIdOf:B,...p===void 0?{}:{landOnRow:p},pending:F,viewerAuthorId:e.viewerAuthorId,className:"py-3",feedTestId:"room-thread-feed"}),t.jsx(Ee,{room:e,entries:u,scope:L,laneScope:"thread",stalled:f&&i===!0,unavailable:d,onRetry:f?w:void 0,onScrollToRow:z}),t.jsx(Te,{room:e,threadRootId:o,attachments:k.attachments,focusOnMount:r},o)]})})})}function Re({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:(R,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 yn(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 Rn(e,o,r){if(e===null||o===null||o<=0)return r.defaultPct;const u=e/o*100;return Math.round(Math.min(Math.max(u,r.minPct),r.maxPct)*10)/10}function vn(e){try{const o=localStorage.getItem(e),r=o===null?NaN:Number(o);return Number.isFinite(r)&&r>0?r:null}catch{return null}}function bn(e,o){try{localStorage.setItem(e,String(Math.round(o)))}catch{}}const jn="react-resizable-panels:room-thread-split";function wn(){try{localStorage.removeItem(jn)}catch{}}function In(){const[e,o]=s.useState(null),[r,u]=s.useState(null);return{ref:s.useCallback(i=>{if(i===null)return;o(i);const d=()=>u(i.offsetWidth);d();const w=new ResizeObserver(d);return w.observe(i),()=>{w.disconnect(),o(null),u(null)}},[]),element:e,width:r,sizing:yn(r??0)}}const kn=`${te}-room`,be=`${te}-thread`,je=`${te}-handle`,An=4;function Nn({room:e,thread:o,storageKey:r=ft.ROOM_THREAD_WIDTH}){const{ref:u,element:R,width:i,sizing:d}=In(),[w,y]=s.useState(()=>vn(r)),[x,p]=s.useState(null),f=s.useRef(null),v=Rn(w,i,d),I=i===null||(d.maxPct-d.minPct)/100*i<An,k=o!==!1;s.useEffect(wn,[]);const A=s.useRef(!1);s.useLayoutEffect(()=>{var c;A.current&&((c=f.current)==null||c.resize(v))},[v,k]);const j=s.useRef(null),S=()=>{var P;const c=(P=f.current)==null?void 0:P.getSize(),C=j.current;if(j.current=null,c===void 0||i===null||i<=0||C===c)return;const N=Math.round(c/100*i);y(N),bn(r,N)},l=x??v;return s.useLayoutEffect(()=>{const c=R==null?void 0:R.querySelector(`[data-panel-resize-handle-id="${je}"]`);c&&(c.setAttribute("aria-controls",be),c.setAttribute("aria-valuenow",String(Math.round(l))),c.setAttribute("aria-valuemin",String(Math.round(d.minPct))),c.setAttribute("aria-valuemax",String(Math.round(d.maxPct))))}),t.jsx("div",{ref:u,className:"h-full overflow-hidden",children:t.jsxs(ct,{direction:"horizontal",id:te,onLayout:c=>{A.current=c.length>1,p(A.current?c[1]:null)},children:[t.jsx(pe,{id:kn,order:1,className:"flex",children:e}),k&&t.jsxs(t.Fragment,{children:[t.jsx(Rt,{id:je,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:I,onDragging:c=>{var C;c&&(j.current=((C=f.current)==null?void 0:C.getSize())??null)},onKeyDownCapture:c=>{var C,N;I||(j.current=((C=f.current)==null?void 0:C.getSize())??null,!(c.key!=="Home"&&c.key!=="End")&&(c.preventDefault(),(N=f.current)==null||N.resize(c.key==="Home"?d.minPct:d.maxPct)))},onResizeEnd:S}),t.jsx(pe,{ref:f,id:be,order:2,defaultSize:v,minSize:d.minPct,maxSize:d.maxPct,className:"flex",children:o})]})]})})}function Fn({roomId:e,threadId:o,entrySeq:r,threadRoute:u,aboveTimeline:R,aboveComposer:i,offerJumpBackIn:d,onComposerFocusChange:w}){const y=mt(),x=vt(),p=ht(e),f=p==null?void 0:p.rootEntryId,v=Vt(),I=s.useCallback(()=>{var m;const n=(m=U.getState().open[e])==null?void 0:m.rootEntryId;U.getState().closeThread(e),n!==void 0&&v.arm(n)},[e,v]),k=s.useCallback(n=>{U.getState().openThread(e,n)},[e]),A=pt(e),j=gt(e),S=wt(e,j.isSuccess);It(e);const l=A.data,c=s.useMemo(()=>j.data??[],[j.data]),C=Me({room:l});Zt({roomId:e,route:u,urlThreadId:o,openThreadId:f,entries:c,historyLoaded:j.isSuccess});const N=s.useMemo(()=>{var n;return((n=l==null?void 0:l.members.find(m=>m.author.id===l.viewerAuthorId))==null?void 0:n.lastReadSeq)??null},[l]),P=Xt(e,N);xt(l,c);const E=s.useRef(null),T=s.useRef(void 0),M=s.useCallback(n=>{T.current=n},[]),L=s.useCallback(()=>T.current,[]);s.useLayoutEffect(()=>{T.current=void 0},[e]);const H=s.useCallback(n=>{var m;(m=E.current)==null||m.scrollToRow(n)},[]),F=qt(e),{loadOlder:D,cursor:q}=F,z=s.useCallback(()=>{const n=Ct(c,q);D().then(()=>{n!==null&&requestAnimationFrame(()=>{var m;return(m=E.current)==null?void 0:m.scrollToRow(n.domId)})})},[c,q,D]),$=Ut({roomId:e,entrySeq:r,entries:c,historyLoaded:j.isSuccess}),K=s.useMemo(()=>f===void 0?void 0:{replyIds:new Set(c.filter(m=>ce(m)===f).map(m=>m.id)),inside:!1},[c,f]);if(A.isLoading)return t.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:t.jsx(Pe,{})});if(A.isError||!l)return t.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[t.jsx("p",{className:"text-foreground font-medium",children:"That channel or DM isn’t here"}),t.jsx("p",{className:"max-w-sm",children:"It may be archived, or the link is old."})]});const O=p!==void 0&&t.jsx(dn,{room:l,rootEntryId:p.rootEntryId,focusComposer:p.focusComposer,entries:c,reactionFrequents:l.reactionFrequents,streamStalled:S.stalled,streamUnavailable:S.unavailable,onRetryStream:S.retry,historyLoaded:j.isSuccess,historyFailed:j.isError,...$.threadRow===void 0?{}:{landOnRow:$.threadRow},pushed:y,onClose:I},p.rootEntryId),W=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[R,t.jsx(Gt,{ref:E,roomId:l.id,roomName:Y(l),viewerAuthorId:l.viewerAuthorId,entries:c,members:l.members,formerAuthors:l.formerAuthors,lastReadSeq:P,reactionFrequents:l.reactionFrequents,streamStalled:S.stalled,isLoading:j.isLoading,error:j.error,onAddAgents:()=>ge("add",l.id),openThreadId:f,onOpenThread:k,resumeRow:L,...$.roomRow===void 0?{}:{landOnRow:$.roomRow},onTopRow:M,canLoadOlder:F.canLoadOlder,isLoadingOlder:F.isLoadingOlder,onLoadOlder:z}),i,t.jsx(tn,{roomId:l.id}),t.jsx(nn,{roomId:l.id}),t.jsx(Ee,{room:l,entries:c,scope:K,laneScope:"room",stalled:S.stalled,unavailable:S.unavailable,onRetry:S.retry,onScrollToRow:H}),t.jsx(en,{room:l,hasEntries:c.length>0,onAddAgents:()=>ge("add",l.id)}),t.jsx(Te,{room:l,attachments:C.attachments,offerJumpBackIn:d,onFocusChange:w},l.id)]}),B={surface:"room",capabilities:fe,target:C.target,anchor:"rail"};return y?t.jsx(X.Root,{...B,children:t.jsx("div",{style:{paddingBottom:x},"data-testid":"room-surface",className:"flex h-full flex-col overflow-hidden",children:t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col overflow-hidden",children:[t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",inert:O!==!1,"data-testid":"room-under-thread",children:W}),t.jsx(yt,{initial:!1,children:O!==!1&&t.jsx(fn,{onClose:I,children:O},`thread-${f}`)})]})})}):t.jsx(X.Root,{...B,children:t.jsx(Nn,{room:W,thread:O})})}export{Fn as R,$t as T,Pe as a};
|
|
1
|
+
import{a1 as ie,a4 as de,a3 as Oe,iZ as _e,i_ as ne,i$ as me,j0 as Le,j1 as Fe,j2 as De,aP as ze,r as s,j as t,G as ee,B as we,x as He,e as Q,gy as Ie,hh as qe,gx as ke,j3 as $e,j4 as We,n as Be,gB as U,a7 as Ke,fy as Ge,j5 as Ue,j6 as Xe,j7 as Ye,cu as Qe,j8 as Ve,j9 as Ze,ja as Je,jb as et,cq as tt,jc as nt,gw as Y,jd as st,l as rt,s as he,je as ot,jf as at,e7 as it,X as dt,e4 as lt,ar as ut,jg as ct,jh as pe,ji as ft,ad as mt,jj as ht,gv as pt,gu as gt,jk as xt,aF as ge,by as yt}from"./index-p3WivF1M.js";import{P as Rt,u as vt}from"./pane-resize-handle-OBc3uYxQ.js";import{D as bt,U as jt,u as wt}from"./UnreadDivider-BoLcTO_Z.js";import{u as It}from"./use-room-follow-claim-BSijPV3c.js";import{a as le,e as ue,g as kt,f as Ae,h as At,i as Ne,c as G,d as V,j as Nt,k as re,b as oe,l as ae,A as Se,m as Ce,t as ce,r as St,n as J,R as fe,u as Me,C as Te,o as Ct}from"./ChannelComposer-7KpffyFv.js";import{u as Mt,f as Tt,a as Pt,F as Et,C as X,d as Ot,M as _t}from"./registry-Cog_2xvt.js";import{u as Lt}from"./use-connector-management-COqWo76Y.js";import{A as Ft}from"./AgentRequestCard-BoRmxLKy.js";import{u as Dt}from"./use-room-sessions-CNqHgLVa.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),R=ne(p=>{var f;return e===null?null:((f=p.paging[e])==null?void 0:f.cursor)??null}),i=de({mutationFn:async p=>{var j;const f=(j=ne.getState().paging[p])==null?void 0:j.cursor;if(f==null)return;const v=await o.listRoomEntries(p,{before:f,limit:me}),I=ze.entries(p),k=r.getQueryData(I),A=Le(k,v);r.setQueryData(I,A),ne.getState().notePage(p,Fe(v)??f,De(v,me)||A.length===((k==null?void 0:k.length)??0))},meta:{errorLabel:"Couldn't load older messages"}}),{mutateAsync:d,isPending:w}=i,y=s.useRef(!1),x=s.useCallback(async()=>{if(!(e===null||y.current)){y.current=!0;try{await d(e).catch(()=>{})}finally{y.current=!1}}},[e,d]);return{canLoadOlder:u,isLoadingOlder:w,cursor:R,loadOlder:x}}function $t({id:e,summary:o,open:r,onOpen:u}){const{capabilities:R}=Mt(),{count:i,lastAt:d,unread:w}=o,y=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 R.threads?t.jsxs("button",{type:"button",id:e,"data-slot":"thread-reply-row","data-testid":"room-thread-replies","data-unread":w>0?"":void 0,"aria-expanded":r,onClick:u,className:ee("focus-ring ml-[calc(var(--msg-padding-x)_+_var(--msg-gutter-width)_+_var(--msg-gap))]","mb-1 w-fit rounded text-left text-xs transition-colors","px-2 py-2 md:px-1 md:py-0.5",w>0?"text-primary hover:text-primary/80 font-medium":"text-muted-foreground hover:text-foreground"),children:[t.jsx("span",{"aria-hidden":!0,className:"mr-1",children:"↳"}),t.jsx("span",{className:ee(f&&"motion-safe:animate-count-flip"),"data-testid":"room-thread-reply-count",children:i},i),i===1?" reply":" replies",y.length>0&&t.jsxs(t.Fragment,{children:[" · last ",t.jsx("time",{dateTime:d,title:Pt(d),children:y})]}),w>0&&` · ${w} new`]}):null}function Wt({loading:e,onLoad:o}){return t.jsx("div",{className:"flex justify-center px-4 py-3",children:t.jsxs(we,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:e,"data-testid":"room-load-older",className:"text-muted-foreground hover:text-foreground h-7 gap-2 text-xs",children:[e&&t.jsx(He,{size:"xs"}),e?"Loading older messages…":"Older messages"]})})}const Bt="room-load-older",Kt=4;function Pe({roomName:e}){return t.jsx(Et,{label:e===void 0?"Messages":`Messages in ${e}`,busy:!0,className:"flex flex-col gap-4 p-4","data-testid":"room-timeline-loading",children:Array.from({length:Kt},(o,r)=>t.jsxs("div",{className:"flex gap-3",children:[t.jsx(Q,{className:"size-7 shrink-0 rounded-full"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[t.jsx(Q,{className:"h-3 w-24"}),t.jsx(Q,{className:"h-3 w-full max-w-md"})]})]},`room-skeleton-${r}`))})}function Gt({roomId:e,roomName:o,viewerAuthorId:r,entries:u,members:R,formerAuthors:i,lastReadSeq:d,reactionFrequents:w,streamStalled:y,isLoading:x,error:p,onAddAgents:f,openThreadId:v,onOpenThread:I,resumeRow:k,landOnRow:A,onTopRow:j,canLoadOlder:S=!1,isLoadingOlder:l=!1,onLoadOlder:c,ref:C}){const N=s.useMemo(()=>le(R,i),[R,i]),P=Ie(R,r),E=ue(),T=s.useMemo(()=>new Map([...N].map(([n,m])=>[n,m.displayName])),[N]),M=qe(),L=ke(e,null),{topLevel:H,repliesByRoot:F,orphaned:D}=s.useMemo(()=>kt(u),[u]),q=s.useMemo(()=>new Map(u.map(n=>[n.id,n])),[u]),z=s.useMemo(()=>{const n=$e(H,d),m=We(H.map(a=>({id:a.id,authorId:a.body.moment?`moment:${a.id}`:a.authorId,timestamp:a.createdAt})),{now:M,lastSeenId:n.lastSeenId,unreadFromStart:n.fromStart}),b=[];S&&!x&&b.push({kind:"load-older",id:Bt});for(const a of m){if(a.kind==="day-divider"){b.push({kind:"day-divider",id:a.key,label:a.label});continue}if(a.kind==="unread-divider"){b.push({kind:"unread-divider",id:a.key});continue}const h=H[a.index];b.push({kind:"message",id:h.id,entry:h,grouping:a.grouping,position:a.index+1,answers:Ae(h,H[a.index-1],q.get.bind(q))});const g=F.get(h.id);g&&b.push({kind:"thread-reply",id:At(h.id),rootId:h.id,replies:g,totalReplies:h.threadReplyCount})}return b},[H,F,q,d,M,S,x]),$=s.useMemo(()=>z.map(n=>n.kind==="load-older"?{kind:"notice",id:n.id,at:"",body:null}:n.kind==="day-divider"?{kind:"day-divider",id:n.id,label:n.label}:n.kind==="unread-divider"?{kind:"unread-divider",id:n.id}:n.kind==="thread-reply"?{kind:"thread-reply",id:n.id,rootId:n.rootId,replyCount:Ne(n.replies.length,n.totalReplies),lastAt:n.replies[n.replies.length-1].createdAt}:{kind:"message",id:n.id,payload:n.entry,grouping:n.grouping,author:G(V(n.entry,N),N,E.faces),at:n.entry.createdAt}),[z,N,E.faces]),K=s.useCallback((n,m)=>{const b=z[m.index];if(b.kind==="load-older")return c===void 0?null:t.jsx(Wt,{loading:l,onLoad:c});if(b.kind==="day-divider")return t.jsx(bt,{label:b.label});if(b.kind==="unread-divider")return t.jsx(jt,{});if(b.kind==="thread-reply"){if(m.onOpenThread===void 0)return null;const h=m.onOpenThread;return t.jsx($t,{id:re(b.rootId),summary:Nt(b.replies,d,b.totalReplies),open:v===b.rootId,onOpen:()=>h(b.rootId)})}const a=V(b.entry,N);return t.jsx(oe,{roomId:e,entry:b.entry,author:G(a,N,E.faces),authorRef:N.get(a),authors:N,viewerAuthorId:r,authorNames:T,reactionFrequents:w,streamStalled:y,isMember:P,grouping:b.grouping,orphanedReply:D.has(b.entry.id),answers:b.answers,feedPosition:{index:b.position,total:-1},rowId:ae(b.entry.id)})},[z,e,N,E.faces,r,T,w,y,P,D,d,v,l,c]),O=s.useCallback(n=>{if(n.kind==="message")return ae(n.id);if(n.kind==="thread-reply")return re(n.rootId)},[]);if(p)return t.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[t.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load these messages"}),t.jsx("p",{className:"max-w-sm",children:"Nothing was lost. Reload to try again."})]});const W=R.some(n=>n.author.kind==="agent"),B=t.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[t.jsx(Be,{className:"text-muted-foreground/50 size-8","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:"Nothing said here yet"}),t.jsx("p",{className:"max-w-sm",children:W?"Say something to get it going.":"Nothing answers until you add an agent."}),t.jsx(we,{type:"button",size:"sm",variant:W?"ghost":"default",onClick:f,className:"mt-1",children:W?"Add more agents":"Add agents"})]});return t.jsx(Se,{known:E,children:t.jsx(X.Timeline,{ref:C,conversationId:e,label:`Messages in ${o}`,rows:$,renderRow:K,onOpenThread:I,domIdOf:O,...k===void 0?{}:{resumeRow:k},...A===void 0?{}:{landOnRow:A},...j===void 0?{}:{onTopRow:j},pending:L,viewerAuthorId:r,loading:x?t.jsx(Pe,{roomName:o}):void 0,empty:B,feedTestId:"room-timeline"})})}function Ut(e){const{roomId:o,entrySeq:r,entries:u,historyLoaded:R}=e,i=r===void 0?null:`${o}:${r}`,d=s.useMemo(()=>{if(r===void 0)return null;const k=u.find(l=>l.seq===r);if(k===void 0)return null;const A=Ce(u,k.id);if(A===null)return null;const j=ce(k)??null,S=j!==null&&A.rowId!==k.id;return{roomRowId:A.rowId,threadRootId:S?j:null,entryId:k.id}},[u,r]),w=s.useRef(null),y=(d==null?void 0:d.threadRootId)??null;s.useEffect(()=>{i===null||y===null||w.current!==i&&(w.current=i,U.getState().openThread(o,y))},[i,o,y]);const x=s.useRef(null);s.useEffect(()=>{i===null||!R||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,R,d]);const p=s.useRef(null),f=s.useCallback(()=>{if(!(i===null||p.current===i))return p.current=i,d==null?void 0:d.roomRowId},[i,d]),v=s.useRef(null),I=s.useCallback(()=>{if(!(i===null||v.current===i))return v.current=i,(d==null?void 0:d.threadRootId)===null||d==null?void 0:d.entryId},[i,d]);return{roomRow:r===void 0?void 0:f,threadRow:r===void 0?void 0:I}}function Xt(e,o){const[r,u]=s.useState({roomId:null,seq:null});return r.roomId===e?r.seq:e===null?(u({roomId:null,seq:null}),null):o===null?null:(u({roomId:e,seq:o}),o)}const Yt=600;function Qt(e){return document.getElementById(re(e))??document.getElementById(ae(e))}function Vt(){const e=s.useRef(null);return s.useEffect(()=>()=>{var r;return(r=e.current)==null?void 0:r.call(e)},[]),{arm:s.useCallback(r=>{var w;(w=e.current)==null||w.call(e);let u=0;const R=Date.now()+Yt;let i=!1;const d=()=>{if(i)return;const y=document.activeElement;if(y===null||y===document.body||!y.isConnected){const p=Qt(r);if(p!==null){p.focus();return}}Date.now()>=R||(u=requestAnimationFrame(d))};u=requestAnimationFrame(d),e.current=()=>{i=!0,cancelAnimationFrame(u)}},[])}}function Zt({roomId:e,route:o,urlThreadId:r,openThreadId:u,entries:R,historyLoaded:i}){const d=Ge(),w=s.useRef(null);s.useEffect(()=>{if(e!==null){if(w.current!==e&&(w.current=e,r!==void 0)){U.getState().openThread(e,r);return}if(i&&u!==void 0){const y=R.find(p=>p.id===u),x=y===void 0?void 0:St(y);if(x!==void 0&&x!==u){const p=U.getState().open[e];U.getState().openThread(e,x,(p==null?void 0:p.focusComposer)??!1);return}}u!==r&&(d==null||d({to:o,search:y=>({...y,thread:u}),replace:!0}))}},[e,o,u,r,R,i,d])}function Jt(e){return e.kind!=="channel"||e.bridge!=null||e.archived?!1:!e.members.some(o=>o.author.kind==="agent")}function en({room:e,hasEntries:o,onAddAgents:r}){return!o||!Jt(e)?null:t.jsxs("p",{className:"text-muted-foreground shrink-0 px-4 pb-1 text-xs","data-testid":"no-agent-hint",children:["No agent is in this channel to answer."," ",t.jsx("button",{type:"button",onClick:r,className:"text-foreground focus-visible:ring-ring rounded-sm underline underline-offset-2 focus-visible:ring-2 focus-visible:outline-none",children:"Add one"})," ","to get answers here."]})}function tn({roomId:e}){const{approvals:o}=Ue(),r=Xe(o).filter(u=>u.roomId===e);return r.length===0?null:t.jsx("section",{"data-slot":"room-approvals","aria-label":"Requests waiting on you",className:"shrink-0 px-3 pb-2 md:px-4",children:t.jsx(Ye,{approvals:r})})}function nn({roomId:e}){const{data:o}=Lt("pending"),r=(o??[]).filter(u=>u.roomId===e);return r.length===0?null:t.jsx("section",{"data-slot":"room-agent-requests","aria-label":"Apps agents are asking for",className:"shrink-0 space-y-2 px-3 pb-2 md:px-4",children:r.map(u=>t.jsx(Ft,{request:u},u.requestId))})}const sn="An agent",xe=64,se=3,rn=new Set;function Ee({room:e,entries:o,scope:r,laneScope:u,stalled:R,unavailable:i=!1,onRetry:d,onScrollToRow:w}){const y=Qe(),x=Ve(e.id,r),p=Ze(e.id,r),f=Je(e.id,r),[v,I]=s.useState(!1),k=Dt(e.id,{enabled:v}),A=et(),{mutate:j}=zt(),[S,l]=s.useState(rn),c=s.useCallback(a=>{l(h=>new Set(h).add(a)),j({roomId:e.id,authorId:a},{onSettled:()=>l(h=>{const g=new Set(h);return g.delete(a),g})})},[j,e.id]),C=Ht(),[N,P]=s.useState(()=>new Map),E=tt(),T=ue(),M=s.useMemo(()=>le(e.members,e.formerAuthors),[e.members,e.formerAuthors]),L=s.useCallback(a=>{var h;return((h=M.get(a))==null?void 0:h.displayName)??sn},[M]),{interactions:H}=nt(),F=s.useMemo(()=>H.filter(a=>a.roomId===e.id),[H,e.id]),D=s.useMemo(()=>{var h;const a={};for(const g of F){if(g.roomAuthorId===void 0)continue;const _=(h=M.get(g.roomAuthorId))==null?void 0:h.displayName;_!==void 0&&(a[g.sessionId]=_)}return a},[F,M]),q=s.useMemo(()=>x.map(a=>({authorId:a.authorId,name:L(a.authorId),state:a.state,since:a.since,activity:a.activity??null})),[x,L]),z=s.useMemo(()=>p.map(a=>{var g;const h=(g=E.data)==null?void 0:g.find(_=>_.id===a.behindRoomId);return{authorId:a.authorId,name:L(a.authorId),since:a.since,behind:{roomId:a.behindRoomId,title:h===void 0?null:Y(h)},othersWaiting:a.othersWaiting,severalInTheWay:a.severalInTheWay}}),[p,L,E.data]),$=s.useMemo(()=>{const a=new Set;for(const h of p)N.get(h.authorId)===h.entryId&&a.add(h.authorId);return a},[p,N]),K=s.useMemo(()=>f===null?null:{authorId:f.authorId,name:L(f.authorId)},[f,L]),O=s.useMemo(()=>Ot({capabilities:fe,asks:F,agentNames:D,stalled:R,presence:q,held:z,silentFinish:K,turn:null}),[F,D,q,z,K,R]),W=s.useMemo(()=>{var h;const a=new Map;for(const g of((h=k.data)==null?void 0:h.bindings)??[])a.set(g.authorId,g.sessionId);return a},[k.data]),B=s.useCallback(a=>{const h=o.find(_=>_.id===a);if(h===void 0)return null;const g=h.body.text.replace(/\s+/gu," ").trim();return g.length===0?null:g.length>xe?`${g.slice(0,xe).trimEnd()}…`:g},[o]),n=s.useCallback(a=>{var h;return u==="thread"?J(a):((h=Ce(o,a))==null?void 0:h.domId)??null},[o,u]),m=s.useMemo(()=>{const a=x.map(g=>{const _=B(g.entryId),Z=n(g.entryId);return{authorId:g.authorId,author:G(g.authorId,M,T.faces),state:g.state,since:g.since,doing:st(g.activity),replyingTo:_===null||Z===null?null:{entryId:g.entryId,excerpt:_,rowId:Z},sessionId:W.get(g.authorId)??null}}),h=z.map(g=>({authorId:g.authorId,author:G(g.authorId,M,T.faces),state:"held",since:g.since,doing:null,replyingTo:null,sessionId:null,behind:g.behind,othersWaiting:g.othersWaiting}));return[...a,...h]},[x,z,M,T.faces,B,n,W]),b=s.useMemo(()=>{if(x.length===0)return null;const a=x.slice(0,se);return t.jsxs("span",{"aria-hidden":"true",className:"flex shrink-0 -space-x-1",children:[a.map(h=>t.jsx(_t,{author:G(h.authorId,M,T.faces),className:"ring-background size-4 ring-2"},h.authorId)),x.length>se&&t.jsx("span",{className:"bg-muted text-muted-foreground ring-background text-3xs flex size-4 items-center justify-center rounded-full ring-2",children:`+${x.length-se}`})]})},[x,M,T.faces]);return t.jsx(X.LiveLane,{state:O,scope:u,onRetry:d,unavailable:i,faces:b,onPeekOpenChange:I,askCard:O.kind==="ask"?t.jsx(ot,{ask:O.ask,...D[O.ask.sessionId]?{agentName:D[O.ask.sessionId]}:{},onOpenSession:a=>{y(he({session:a}))},className:"border-l-0"}):void 0,peek:t.jsx(X.LivePeek,{rows:m,onScrollToRow:w,onOpenSession:a=>{y(he({session:a}))},onOpenRoom:a=>{y({...rt.channels(),search:{id:a}})},onAnswerFirst:a=>{const h=p.find(g=>g.authorId===a);h!==void 0&&P(g=>new Map(g).set(a,h.entryId)),C.mutate({roomId:e.id,authorId:a})},promoted:$,onStopAll:()=>A.mutate({roomId:e.id}),stopping:A.isPending,onStopAgent:c,stoppingAgents:S})})}const ye=3e3;function on(e,o,r,u=Date.now){const R=s.useRef(null),i=s.useRef(new Map),d=s.useRef(new Map),w=R.current,y=i.current,x=d.current,p=u();for(const f of e){if(x.has(f.id))continue;if(w===null){x.set(f.id,"at-rest");continue}const v=y.get(f.authorId);x.set(f.id,v!==void 0&&p-v<ye?"handed-off":"dropped")}return s.useEffect(()=>{if(!r)return;R.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>ye&&i.current.delete(v);for(const v of d.current.keys())R.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:R,streamStalled:i,streamUnavailable:d,onRetryStream:w,historyLoaded:y,historyFailed:x=!1,landOnRow:p,pushed:f,onClose:v}){const I=s.useMemo(()=>le(e.members,e.formerAuthors),[e.members,e.formerAuthors]),k=Me({room:e,threadRootId:o}),A=Ie(e.members,e.viewerAuthorId),j=ue(),S=s.useMemo(()=>new Map([...I].map(([n,m])=>[n,m.displayName])),[I]),{root:l,replies:c}=s.useMemo(()=>{let n;const m=[];for(const b of u)b.id===o?n=b:ce(b)===o&&m.push(b);return{root:n,replies:m}},[u,o]),C=l==null?void 0:l.threadReplyCount,N=C!==void 0&&C>c.length,P=!f,E=l===void 0||N?-1:(P?1:0)+c.length,T=Ne(c.length,C),M=s.useMemo(()=>new Set(c.map(n=>n.id)),[c]),L=s.useMemo(()=>({replyIds:M,inside:!0}),[M]),H=at(e.id,L),F=ke(e.id,o),D=on(c,H,y),q=s.useRef(null),z=s.useCallback(n=>{var m;(m=q.current)==null||m.scrollToRow(n)},[]),$=s.useRef(null);s.useEffect(()=>{var n;r||(n=$.current)==null||n.focus()},[o,r]);const K=n=>{n.key!=="Escape"||n.defaultPrevented||(n.stopPropagation(),v())},O=s.useMemo(()=>{const n=[];if(l===void 0){const m=x?"thread-error":y?"thread-orphan":"thread-waiting";n.push({kind:"notice",id:m,at:"",body:null})}else P&&n.push({kind:"message",id:l.id,payload:l,grouping:{position:"only"},author:G(V(l,I),I,j.faces),at:l.createdAt});for(const m of c)n.push({kind:"message",id:m.id,payload:m,grouping:{position:"only"},author:G(V(m,I),I,j.faces),at:m.createdAt});return n},[l,P,c,I,j.faces,x,y]),W=s.useCallback(n=>{if(n.kind==="notice")return t.jsx(an,{kind:n.id});if(n.kind!=="message")return null;const m=n.payload,b=l!==void 0&&m.id===l.id,a=c.findIndex(_=>_.id===m.id),h=t.jsx(oe,{roomId:e.id,entry:m,rowId:J(m.id),author:n.author,authorRef:I.get(m.authorId),authors:I,viewerAuthorId:e.viewerAuthorId,authorNames:S,reactionFrequents:R,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(Re,{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,R,i,A,E]),B=s.useCallback(n=>n.kind==="message"?J(n.id):void 0,[]);return t.jsx(Se,{known:j,children:t.jsx(X.Root,{surface:"room",capabilities:fe,target:k.target,anchor:"rail",children:t.jsxs("section",{ref:$,"aria-label":"Thread","data-testid":"room-thread-panel",tabIndex:-1,onKeyDown:K,className:ee("bg-card flex min-h-0 flex-col outline-none",f?"h-full w-full":"w-full border-l"),children:[f?t.jsxs("header",{className:"flex items-center gap-2 border-b px-1 py-1",children:[t.jsxs("button",{type:"button",onClick:v,"aria-label":`Back to ${Y(e)}`,"data-testid":"room-thread-back",className:"focus-ring text-muted-foreground hover:text-foreground flex h-11 min-w-0 items-center gap-1 rounded px-2 text-sm",children:[t.jsx(it,{"aria-hidden":!0,className:"size-4 shrink-0"}),t.jsx("span",{className:"truncate",children:Y(e)})]}),t.jsx("p",{className:"ml-auto shrink-0 pr-3 text-sm font-medium",children:"Thread"})]}):t.jsxs("header",{className:"flex items-center gap-2 border-b px-3 py-2",children:[t.jsx("button",{type:"button",onClick:v,"aria-label":"Close thread",className:"focus-ring text-muted-foreground hover:text-foreground relative -ml-1 rounded p-1",children:t.jsx(dt,{"aria-hidden":!0,className:"size-4"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm font-medium",children:"Thread"}),t.jsx("p",{className:"text-muted-foreground truncate text-xs",children:Y(e)})]})]}),f&&l!==void 0&&t.jsxs("div",{"data-testid":"room-thread-pinned-root",className:"max-h-[40%] shrink-0 overflow-y-auto border-b pt-2",children:[t.jsx(oe,{roomId:e.id,entry:l,rowId:J(l.id),author:G(V(l,I),I,j.faces),authorRef:I.get(l.authorId),authors:I,viewerAuthorId:e.viewerAuthorId,authorNames:S,reactionFrequents:R,streamStalled:i,isMember:A,grouping:{position:"only"}}),t.jsx(Re,{count:T})]}),t.jsx(X.Timeline,{ref:q,conversationId:`thread-${o}`,label:`Thread in ${Y(e)}`,busy:!y&&!x,rows:O,renderRow:W,domIdOf:B,...p===void 0?{}:{landOnRow:p},pending:F,viewerAuthorId:e.viewerAuthorId,className:"py-3",feedTestId:"room-thread-feed"}),t.jsx(Ee,{room:e,entries:u,scope:L,laneScope:"thread",stalled:f&&i===!0,unavailable:d,onRetry:f?w:void 0,onScrollToRow:z}),t.jsx(Te,{room:e,threadRootId:o,attachments:k.attachments,focusOnMount:r},o)]})})})}function Re({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:(R,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 yn(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 Rn(e,o,r){if(e===null||o===null||o<=0)return r.defaultPct;const u=e/o*100;return Math.round(Math.min(Math.max(u,r.minPct),r.maxPct)*10)/10}function vn(e){try{const o=localStorage.getItem(e),r=o===null?NaN:Number(o);return Number.isFinite(r)&&r>0?r:null}catch{return null}}function bn(e,o){try{localStorage.setItem(e,String(Math.round(o)))}catch{}}const jn="react-resizable-panels:room-thread-split";function wn(){try{localStorage.removeItem(jn)}catch{}}function In(){const[e,o]=s.useState(null),[r,u]=s.useState(null);return{ref:s.useCallback(i=>{if(i===null)return;o(i);const d=()=>u(i.offsetWidth);d();const w=new ResizeObserver(d);return w.observe(i),()=>{w.disconnect(),o(null),u(null)}},[]),element:e,width:r,sizing:yn(r??0)}}const kn=`${te}-room`,be=`${te}-thread`,je=`${te}-handle`,An=4;function Nn({room:e,thread:o,storageKey:r=ft.ROOM_THREAD_WIDTH}){const{ref:u,element:R,width:i,sizing:d}=In(),[w,y]=s.useState(()=>vn(r)),[x,p]=s.useState(null),f=s.useRef(null),v=Rn(w,i,d),I=i===null||(d.maxPct-d.minPct)/100*i<An,k=o!==!1;s.useEffect(wn,[]);const A=s.useRef(!1);s.useLayoutEffect(()=>{var c;A.current&&((c=f.current)==null||c.resize(v))},[v,k]);const j=s.useRef(null),S=()=>{var P;const c=(P=f.current)==null?void 0:P.getSize(),C=j.current;if(j.current=null,c===void 0||i===null||i<=0||C===c)return;const N=Math.round(c/100*i);y(N),bn(r,N)},l=x??v;return s.useLayoutEffect(()=>{const c=R==null?void 0:R.querySelector(`[data-panel-resize-handle-id="${je}"]`);c&&(c.setAttribute("aria-controls",be),c.setAttribute("aria-valuenow",String(Math.round(l))),c.setAttribute("aria-valuemin",String(Math.round(d.minPct))),c.setAttribute("aria-valuemax",String(Math.round(d.maxPct))))}),t.jsx("div",{ref:u,className:"h-full overflow-hidden",children:t.jsxs(ct,{direction:"horizontal",id:te,onLayout:c=>{A.current=c.length>1,p(A.current?c[1]:null)},children:[t.jsx(pe,{id:kn,order:1,className:"flex",children:e}),k&&t.jsxs(t.Fragment,{children:[t.jsx(Rt,{id:je,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:I,onDragging:c=>{var C;c&&(j.current=((C=f.current)==null?void 0:C.getSize())??null)},onKeyDownCapture:c=>{var C,N;I||(j.current=((C=f.current)==null?void 0:C.getSize())??null,!(c.key!=="Home"&&c.key!=="End")&&(c.preventDefault(),(N=f.current)==null||N.resize(c.key==="Home"?d.minPct:d.maxPct)))},onResizeEnd:S}),t.jsx(pe,{ref:f,id:be,order:2,defaultSize:v,minSize:d.minPct,maxSize:d.maxPct,className:"flex",children:o})]})]})})}function Fn({roomId:e,threadId:o,entrySeq:r,threadRoute:u,aboveTimeline:R,aboveComposer:i,offerJumpBackIn:d,onComposerFocusChange:w}){const y=mt(),x=vt(),p=ht(e),f=p==null?void 0:p.rootEntryId,v=Vt(),I=s.useCallback(()=>{var m;const n=(m=U.getState().open[e])==null?void 0:m.rootEntryId;U.getState().closeThread(e),n!==void 0&&v.arm(n)},[e,v]),k=s.useCallback(n=>{U.getState().openThread(e,n)},[e]),A=pt(e),j=gt(e),S=wt(e,j.isSuccess);It(e);const l=A.data,c=s.useMemo(()=>j.data??[],[j.data]),C=Me({room:l});Zt({roomId:e,route:u,urlThreadId:o,openThreadId:f,entries:c,historyLoaded:j.isSuccess});const N=s.useMemo(()=>{var n;return((n=l==null?void 0:l.members.find(m=>m.author.id===l.viewerAuthorId))==null?void 0:n.lastReadSeq)??null},[l]),P=Xt(e,N);xt(l,c);const E=s.useRef(null),T=s.useRef(void 0),M=s.useCallback(n=>{T.current=n},[]),L=s.useCallback(()=>T.current,[]);s.useLayoutEffect(()=>{T.current=void 0},[e]);const H=s.useCallback(n=>{var m;(m=E.current)==null||m.scrollToRow(n)},[]),F=qt(e),{loadOlder:D,cursor:q}=F,z=s.useCallback(()=>{const n=Ct(c,q);D().then(()=>{n!==null&&requestAnimationFrame(()=>{var m;return(m=E.current)==null?void 0:m.scrollToRow(n.domId)})})},[c,q,D]),$=Ut({roomId:e,entrySeq:r,entries:c,historyLoaded:j.isSuccess}),K=s.useMemo(()=>f===void 0?void 0:{replyIds:new Set(c.filter(m=>ce(m)===f).map(m=>m.id)),inside:!1},[c,f]);if(A.isLoading)return t.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:t.jsx(Pe,{})});if(A.isError||!l)return t.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[t.jsx("p",{className:"text-foreground font-medium",children:"That channel or DM isn’t here"}),t.jsx("p",{className:"max-w-sm",children:"It may be archived, or the link is old."})]});const O=p!==void 0&&t.jsx(dn,{room:l,rootEntryId:p.rootEntryId,focusComposer:p.focusComposer,entries:c,reactionFrequents:l.reactionFrequents,streamStalled:S.stalled,streamUnavailable:S.unavailable,onRetryStream:S.retry,historyLoaded:j.isSuccess,historyFailed:j.isError,...$.threadRow===void 0?{}:{landOnRow:$.threadRow},pushed:y,onClose:I},p.rootEntryId),W=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[R,t.jsx(Gt,{ref:E,roomId:l.id,roomName:Y(l),viewerAuthorId:l.viewerAuthorId,entries:c,members:l.members,formerAuthors:l.formerAuthors,lastReadSeq:P,reactionFrequents:l.reactionFrequents,streamStalled:S.stalled,isLoading:j.isLoading,error:j.error,onAddAgents:()=>ge("add",l.id),openThreadId:f,onOpenThread:k,resumeRow:L,...$.roomRow===void 0?{}:{landOnRow:$.roomRow},onTopRow:M,canLoadOlder:F.canLoadOlder,isLoadingOlder:F.isLoadingOlder,onLoadOlder:z}),i,t.jsx(tn,{roomId:l.id}),t.jsx(nn,{roomId:l.id}),t.jsx(Ee,{room:l,entries:c,scope:K,laneScope:"room",stalled:S.stalled,unavailable:S.unavailable,onRetry:S.retry,onScrollToRow:H}),t.jsx(en,{room:l,hasEntries:c.length>0,onAddAgents:()=>ge("add",l.id)}),t.jsx(Te,{room:l,attachments:C.attachments,offerJumpBackIn:d,onFocusChange:w},l.id)]}),B={surface:"room",capabilities:fe,target:C.target,anchor:"rail"};return y?t.jsx(X.Root,{...B,children:t.jsx("div",{style:{paddingBottom:x},"data-testid":"room-surface",className:"flex h-full flex-col overflow-hidden",children:t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col overflow-hidden",children:[t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",inert:O!==!1,"data-testid":"room-under-thread",children:W}),t.jsx(yt,{initial:!1,children:O!==!1&&t.jsx(fn,{onClose:I,children:O},`thread-${f}`)})]})})}):t.jsx(X.Root,{...B,children:t.jsx(Nn,{room:W,thread:O})})}export{Fn as R,$t as T,Pe as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as d,i as l,j as e,e as m,k as u,C as c,l as x,n as h,H as f}from"./index-
|
|
1
|
+
import{h as d,i as l,j as e,e as m,k as u,C as c,l as x,n as h,H as f}from"./index-p3WivF1M.js";function g({kind:s}){const r="text-muted-foreground size-3.5 shrink-0";return s==="dm"?e.jsx(h,{"aria-hidden":!0,className:r}):e.jsx(f,{"aria-hidden":!0,className:r})}function p(s){return s===1?"1 member":`${s} members`}function N({member:s}){var i;const r=d(),n=l(s.id);if(n.isPending)return e.jsx(m,{className:"h-16 w-full"});if(n.isError)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this member’s rooms."});const a=((i=n.data)==null?void 0:i.rooms)??[];return a.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.isSelf?"You aren’t":`${s.displayName} isn’t`," in any rooms yet."]}):e.jsx("div",{className:"flex flex-col",children:a.map(t=>{const o=e.jsxs(e.Fragment,{children:[e.jsx(g,{kind:t.kind}),e.jsx("span",{className:"min-w-0 truncate text-sm",children:u({kind:t.kind,slug:t.slug,title:t.name})}),e.jsx("span",{className:"text-muted-foreground ml-auto shrink-0 text-xs",children:p(t.memberCount)})]});return r?e.jsxs("button",{type:"button","data-slot":"profile-room-row",onClick:()=>void r({...x.channels(),search:{id:t.id}}),className:"focus-ring hover:bg-muted/50 flex h-9 items-center gap-2 rounded-md px-2 text-left transition-colors",children:[o,e.jsx(c,{"aria-hidden":!0,className:"text-muted-foreground/70 size-3.5 shrink-0"})]},t.id):e.jsx("div",{"data-slot":"profile-room-row",className:"flex h-9 items-center gap-2 rounded-md px-2",children:o},t.id)})})}export{N as RoomsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as D,j as e,a0 as ye,by as Ee,ar as we,G as N,e8 as de,bz as ue,bA as fe,bB as me,bD as xe,e9 as Ae,a1 as Te,a3 as ke,a4 as De,ad as pe,aN as Le,ea as he,eb as Oe,ec as Ie,ed as Pe,a8 as j,ee as _e,ef as H,eg as Ue,am as be,B as $e,U as Re,b as He,e as Me,eh as Be,ei as ze,ej as Ke,ek as qe,el as Qe,em as Ve}from"./index-B6Scr7KJ.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-Bej0Ot8e.js";import{U as Xe}from"./unverified-catalog-notice-6pwZtIjx.js";import{s as Ye}from"./settings-for-runtime-BoOa-ZFG.js";const Je={duration:.12,ease:"easeOut"},Ze={type:"spring",stiffness:320,damping:28};function ge({isSetHere:a,serverDefault:l,onUseServerDefault:d,warning:r,className:s,"data-testid":i}){const[u,f]=D.useState(!1),o=a?"Set here":`Server default · ${l??"none"}`,n=a&&!!d,x=e.jsxs("span",{className:N("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",r?de.warning:de.neutral,n&&"hover:bg-accent hover:text-accent-foreground transition-colors",s),"data-testid":i,children:[r&&e.jsx(ye,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(Ee,{mode:"wait",initial:!1,children:e.jsx(we.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:Ze},exit:{opacity:0},transition:Je,children:o},o)})]});return n?e.jsxs(ue,{open:u,onOpenChange:f,children:[e.jsx(fe,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${r?`: ${r}`:""}`,children:x})}),e.jsxs(me,{className:"w-64 p-2",align:"start",children:[e.jsx(xe,{children:"Where this value comes from"}),r&&e.jsx("p",{className:N("px-2 pt-1 text-xs",Ae.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{d(),f(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":i?`${i}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["Currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"Not set. Uses the built-in default."})]})]})]}):r?e.jsx("span",{title:r,"aria-label":`${o}: ${r}`,children:x}):x}const et=["agents"];function tt(a){const l=Te(),d=ke();return De({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:r=>l.updateMeshAgent(r.id,r.updates),onSuccess:()=>{d.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{d.invalidateQueries({queryKey:et})}})}const ve="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function $({label:a,valueLabel:l,options:d,selected:r,isSetHere:s,serverDefault:i,warning:u,onSelect:f,onInherit:o,testId:n,showHeader:x=!0,className:C,describedBy:m,inheritText:L}){const w=pe(),[S,h]=D.useState(!1);return e.jsxs("div",{className:N("space-y-1",C),children:[x&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ve,children:a}),!w&&e.jsx(ge,{isSetHere:s,serverDefault:i,warning:u,onUseServerDefault:o,"data-testid":`${n}-chip`})]}),e.jsxs(ue,{open:S,onOpenChange:h,children:[e.jsx(fe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...m?{"aria-describedby":m}:{},"data-testid":n,children:[e.jsx("span",{className:N("truncate",u?"text-status-warning-fg":s?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(Re,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(me,{className:"w-64 p-1",align:"start",children:[e.jsx(xe,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:d.map(c=>e.jsxs("button",{type:"button","data-testid":`${n}-option-${c.value}`,onClick:()=>{f(c.value),h(!1)},className:N("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",c.value===r&&"bg-accent"),children:[c.label,c.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:c.hint})]},c.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),h(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${n}-inherit`,children:L??(i?`Use server default: ${i}`:"Use server default")})]})]})]})}function st({agent:a,onUpdate:l,className:d}){var ee,te,se,ae,ne,le,oe,re,ie;const r=pe(),{data:s}=Le(),{data:i,isPending:u}=he(),f=((ee=s==null?void 0:s.executionDefaults)==null?void 0:ee.runtime)??"claude-code",o=a.runtime??f,n=(te=s==null?void 0:s.executionDefaults)==null?void 0:te.perRuntime.find(t=>t.runtime===o),{data:x}=Oe(),C=Fe(a,{defaultRuntime:f,runtimeDeclaresCredits:t=>{var b;return((b=i==null?void 0:i.capabilities[t])==null?void 0:b.credits)!==void 0},credits:(se=s==null?void 0:s.claudeCode)==null?void 0:se.credits,runtimeDefaultsToCredits:t=>{var b,T;return((T=(b=x==null?void 0:x.defaults)==null?void 0:b[t])==null?void 0:T.runsOn)==="credits"}}),{data:m,isError:L}=Ie({runtime:o,...C?{account:j}:{}}),w=a.model!=null,S=a.effort!=null,h=(n==null?void 0:n.model)??null,c=C&&(m??[]).some(t=>t.paidFromCredits),y=c?(m??[]).find(t=>t.isDefault):void 0,A=a.model??h??(y==null?void 0:y.value)??null,M=o==="doe"&&c&&!w&&!h,p=A?(m??[]).find(t=>t.value===A):void 0,O=(n==null?void 0:n.supportsEffort)??((ae=Ye(i,o))==null?void 0:ae.supportsEffort),B=O===void 0&&u,z=O!==!1,K=p?p.supportsEffort??!1:void 0,q=(ne=s==null?void 0:s.claudeCode)==null?void 0:ne.accounts,{nameFor:Q,creditsEntry:je,resolvedAccount:V}=Pe(),F=je??(a.account===j&&((le=s==null?void 0:s.claudeCode)!=null&&le.credits)?{path:s.claudeCode.credits.path}:null),g=q&&[...q.flatMap(t=>t.id===null?[]:[{id:t.id,label:Q(t.path),path:t.path}]),...F?[{id:j,label:_e,path:F.path}]:[]],v=a.account??null,G=v!==null,W=o==="claude-code"&&v===j&&((oe=s==null?void 0:s.claudeCode)==null?void 0:oe.credits)!==void 0&&!s.claudeCode.credits.allowedAgents.includes(a.id),I=s!=null&&s.claudeCode&&V?Q(V):null,P=tt({errorLabel:"Couldn’t change this agent’s account"}),_=D.useCallback(t=>{P.mutate({id:a.id,updates:{account:t}})},[a.id,P]),Ne=Ge({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:f,serverDefaultModel:h,knownModels:We(m),knownAccounts:g,accountsUnavailable:(re=s==null?void 0:s.claudeCode)==null?void 0:re.accountsUnavailable,modelSupportsEffort:K,runtimeSupportsEffort:O,runtimeLabel:t=>H(t).label}),E=t=>{var b;return((b=Ne.breakages.find(T=>t.includes(T.kind)))==null?void 0:b.message)??null},U=!B&&z&&K!==!1,X=a.effort??(n==null?void 0:n.effort)??null,Y=H(o).label,Ce=o==="claude-code"&&g!==void 0&&(g.length>1||G),Se=E(["account-unregistered"]),J=(m??[]).some(t=>t.unverified),Z=D.useId();return e.jsxs("div",{className:N("grid grid-cols-2 gap-3",d),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{label:"Model",valueLabel:M?ce:(p==null?void 0:p.displayName)??A??(c?"Default":"Automatic"),options:[...(m??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:A,isSetHere:w,serverDefault:(n==null?void 0:n.model)??null,warning:E(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:J?Z:void 0,inheritText:M?ce:c&&!h?y?`Use the suggested model: ${y.displayName}`:"Use the default model":void 0}),J&&e.jsx(Xe,{id:Z}),c&&(m??[]).some(t=>t.creditsListOutOfDate)&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-out-of-date",children:"The models your DorkOS credits cover may be out of date."}),C&&L&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-unavailable",children:"Couldn’t load the models DorkOS credits cover. Try again in a moment."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ve,children:"Effort"}),(!r||!U)&&(S||U)&&e.jsx(ge,{isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:E(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),B?e.jsx(R,{testId:"agent-effort-pending",text:`Checking what ${Y} supports`,warning:null}):z?U?e.jsx($,{label:"Effort",valueLabel:k(X),options:Ue.filter(t=>!(p!=null&&p.supportedEffortLevels)||p.supportedEffortLevels.includes(t)).map(t=>({value:t,label:k(t)})),selected:X,isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(R,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:E(["effort-unsupported-model"])}):e.jsx(R,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${Y}`,warning:E(["effort-unsupported-runtime"])})]}),Ce&&e.jsx($,{label:"Account",valueLabel:W?I??"Default":v!==null?((ie=g==null?void 0:g.find(t=>t.id===v))==null?void 0:ie.label)??v:I??"Default",options:(g??[]).map(t=>({value:t.id,label:t.label,hint:t.id===j?"Paid from your DorkOS account":be(t.path)})),selected:v,isSetHere:G,serverDefault:I,warning:Se,onSelect:t=>_(t),onInherit:()=>_(null),testId:"agent-account-row",className:"col-span-full"}),W&&e.jsxs("div",{className:"text-muted-foreground col-span-full flex flex-wrap items-center gap-2 text-xs","data-testid":"agent-credits-not-allowed",children:[e.jsx("span",{children:"This agent’s settings name DorkOS credits. It uses your default until you allow it."}),e.jsx($e,{size:"sm",variant:"outline",className:"h-6 px-2 text-xs",disabled:P.isPending,onClick:()=>_(j),children:"Allow"})]})]})}function R({text:a,warning:l,testId:d}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":d,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const at="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function dt({member:a}){const{agent:l,projectPath:d,isPending:r,update:s}=He(a),{data:i}=he();if(r)return e.jsx(Me,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const u=i?Object.keys(i.capabilities):[l.runtime],f=u.includes(l.runtime)?u:[l.runtime,...u];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:at,children:"Runs on"}),e.jsxs(Be,{value:l.runtime??"claude-code",onValueChange:o=>s({runtime:o}),children:[e.jsx(ze,{className:"h-8 text-sm",responsive:!1,children:e.jsx(Ke,{})}),e.jsx(qe,{children:f.map(o=>e.jsx(Qe,{value:o,responsive:!1,children:H(o).label},o))})]})]}),e.jsx(st,{agent:l,onUpdate:s,className:"grid-cols-1"}),d&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(Ve,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:be(d)})]})]})}export{dt as RunsOnPopover};
|
|
1
|
+
import{r as D,j as e,a0 as ye,by as Ee,ar as we,G as N,e8 as de,bz as ue,bA as fe,bB as me,bD as xe,e9 as Ae,a1 as Te,a3 as ke,a4 as De,ad as pe,aN as Le,ea as he,eb as Oe,ec as Ie,ed as Pe,a8 as j,ee as _e,ef as H,eg as Ue,am as be,B as $e,U as Re,b as He,e as Me,eh as Be,ei as ze,ej as Ke,ek as qe,el as Qe,em as Ve}from"./index-p3WivF1M.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-DRqIsff0.js";import{U as Xe}from"./unverified-catalog-notice-9mykZSlO.js";import{s as Ye}from"./settings-for-runtime-BoOa-ZFG.js";const Je={duration:.12,ease:"easeOut"},Ze={type:"spring",stiffness:320,damping:28};function ge({isSetHere:a,serverDefault:l,onUseServerDefault:d,warning:r,className:s,"data-testid":i}){const[u,f]=D.useState(!1),o=a?"Set here":`Server default · ${l??"none"}`,n=a&&!!d,x=e.jsxs("span",{className:N("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",r?de.warning:de.neutral,n&&"hover:bg-accent hover:text-accent-foreground transition-colors",s),"data-testid":i,children:[r&&e.jsx(ye,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(Ee,{mode:"wait",initial:!1,children:e.jsx(we.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:Ze},exit:{opacity:0},transition:Je,children:o},o)})]});return n?e.jsxs(ue,{open:u,onOpenChange:f,children:[e.jsx(fe,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${r?`: ${r}`:""}`,children:x})}),e.jsxs(me,{className:"w-64 p-2",align:"start",children:[e.jsx(xe,{children:"Where this value comes from"}),r&&e.jsx("p",{className:N("px-2 pt-1 text-xs",Ae.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{d(),f(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":i?`${i}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["Currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"Not set. Uses the built-in default."})]})]})]}):r?e.jsx("span",{title:r,"aria-label":`${o}: ${r}`,children:x}):x}const et=["agents"];function tt(a){const l=Te(),d=ke();return De({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:r=>l.updateMeshAgent(r.id,r.updates),onSuccess:()=>{d.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{d.invalidateQueries({queryKey:et})}})}const ve="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function $({label:a,valueLabel:l,options:d,selected:r,isSetHere:s,serverDefault:i,warning:u,onSelect:f,onInherit:o,testId:n,showHeader:x=!0,className:C,describedBy:m,inheritText:L}){const w=pe(),[S,h]=D.useState(!1);return e.jsxs("div",{className:N("space-y-1",C),children:[x&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ve,children:a}),!w&&e.jsx(ge,{isSetHere:s,serverDefault:i,warning:u,onUseServerDefault:o,"data-testid":`${n}-chip`})]}),e.jsxs(ue,{open:S,onOpenChange:h,children:[e.jsx(fe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...m?{"aria-describedby":m}:{},"data-testid":n,children:[e.jsx("span",{className:N("truncate",u?"text-status-warning-fg":s?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(Re,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(me,{className:"w-64 p-1",align:"start",children:[e.jsx(xe,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:d.map(c=>e.jsxs("button",{type:"button","data-testid":`${n}-option-${c.value}`,onClick:()=>{f(c.value),h(!1)},className:N("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",c.value===r&&"bg-accent"),children:[c.label,c.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:c.hint})]},c.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),h(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${n}-inherit`,children:L??(i?`Use server default: ${i}`:"Use server default")})]})]})]})}function st({agent:a,onUpdate:l,className:d}){var ee,te,se,ae,ne,le,oe,re,ie;const r=pe(),{data:s}=Le(),{data:i,isPending:u}=he(),f=((ee=s==null?void 0:s.executionDefaults)==null?void 0:ee.runtime)??"claude-code",o=a.runtime??f,n=(te=s==null?void 0:s.executionDefaults)==null?void 0:te.perRuntime.find(t=>t.runtime===o),{data:x}=Oe(),C=Fe(a,{defaultRuntime:f,runtimeDeclaresCredits:t=>{var b;return((b=i==null?void 0:i.capabilities[t])==null?void 0:b.credits)!==void 0},credits:(se=s==null?void 0:s.claudeCode)==null?void 0:se.credits,runtimeDefaultsToCredits:t=>{var b,T;return((T=(b=x==null?void 0:x.defaults)==null?void 0:b[t])==null?void 0:T.runsOn)==="credits"}}),{data:m,isError:L}=Ie({runtime:o,...C?{account:j}:{}}),w=a.model!=null,S=a.effort!=null,h=(n==null?void 0:n.model)??null,c=C&&(m??[]).some(t=>t.paidFromCredits),y=c?(m??[]).find(t=>t.isDefault):void 0,A=a.model??h??(y==null?void 0:y.value)??null,M=o==="doe"&&c&&!w&&!h,p=A?(m??[]).find(t=>t.value===A):void 0,O=(n==null?void 0:n.supportsEffort)??((ae=Ye(i,o))==null?void 0:ae.supportsEffort),B=O===void 0&&u,z=O!==!1,K=p?p.supportsEffort??!1:void 0,q=(ne=s==null?void 0:s.claudeCode)==null?void 0:ne.accounts,{nameFor:Q,creditsEntry:je,resolvedAccount:V}=Pe(),F=je??(a.account===j&&((le=s==null?void 0:s.claudeCode)!=null&&le.credits)?{path:s.claudeCode.credits.path}:null),g=q&&[...q.flatMap(t=>t.id===null?[]:[{id:t.id,label:Q(t.path),path:t.path}]),...F?[{id:j,label:_e,path:F.path}]:[]],v=a.account??null,G=v!==null,W=o==="claude-code"&&v===j&&((oe=s==null?void 0:s.claudeCode)==null?void 0:oe.credits)!==void 0&&!s.claudeCode.credits.allowedAgents.includes(a.id),I=s!=null&&s.claudeCode&&V?Q(V):null,P=tt({errorLabel:"Couldn’t change this agent’s account"}),_=D.useCallback(t=>{P.mutate({id:a.id,updates:{account:t}})},[a.id,P]),Ne=Ge({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:f,serverDefaultModel:h,knownModels:We(m),knownAccounts:g,accountsUnavailable:(re=s==null?void 0:s.claudeCode)==null?void 0:re.accountsUnavailable,modelSupportsEffort:K,runtimeSupportsEffort:O,runtimeLabel:t=>H(t).label}),E=t=>{var b;return((b=Ne.breakages.find(T=>t.includes(T.kind)))==null?void 0:b.message)??null},U=!B&&z&&K!==!1,X=a.effort??(n==null?void 0:n.effort)??null,Y=H(o).label,Ce=o==="claude-code"&&g!==void 0&&(g.length>1||G),Se=E(["account-unregistered"]),J=(m??[]).some(t=>t.unverified),Z=D.useId();return e.jsxs("div",{className:N("grid grid-cols-2 gap-3",d),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{label:"Model",valueLabel:M?ce:(p==null?void 0:p.displayName)??A??(c?"Default":"Automatic"),options:[...(m??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:A,isSetHere:w,serverDefault:(n==null?void 0:n.model)??null,warning:E(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:J?Z:void 0,inheritText:M?ce:c&&!h?y?`Use the suggested model: ${y.displayName}`:"Use the default model":void 0}),J&&e.jsx(Xe,{id:Z}),c&&(m??[]).some(t=>t.creditsListOutOfDate)&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-out-of-date",children:"The models your DorkOS credits cover may be out of date."}),C&&L&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-unavailable",children:"Couldn’t load the models DorkOS credits cover. Try again in a moment."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ve,children:"Effort"}),(!r||!U)&&(S||U)&&e.jsx(ge,{isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:E(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),B?e.jsx(R,{testId:"agent-effort-pending",text:`Checking what ${Y} supports`,warning:null}):z?U?e.jsx($,{label:"Effort",valueLabel:k(X),options:Ue.filter(t=>!(p!=null&&p.supportedEffortLevels)||p.supportedEffortLevels.includes(t)).map(t=>({value:t,label:k(t)})),selected:X,isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(R,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:E(["effort-unsupported-model"])}):e.jsx(R,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${Y}`,warning:E(["effort-unsupported-runtime"])})]}),Ce&&e.jsx($,{label:"Account",valueLabel:W?I??"Default":v!==null?((ie=g==null?void 0:g.find(t=>t.id===v))==null?void 0:ie.label)??v:I??"Default",options:(g??[]).map(t=>({value:t.id,label:t.label,hint:t.id===j?"Paid from your DorkOS account":be(t.path)})),selected:v,isSetHere:G,serverDefault:I,warning:Se,onSelect:t=>_(t),onInherit:()=>_(null),testId:"agent-account-row",className:"col-span-full"}),W&&e.jsxs("div",{className:"text-muted-foreground col-span-full flex flex-wrap items-center gap-2 text-xs","data-testid":"agent-credits-not-allowed",children:[e.jsx("span",{children:"This agent’s settings name DorkOS credits. It uses your default until you allow it."}),e.jsx($e,{size:"sm",variant:"outline",className:"h-6 px-2 text-xs",disabled:P.isPending,onClick:()=>_(j),children:"Allow"})]})]})}function R({text:a,warning:l,testId:d}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":d,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const at="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function dt({member:a}){const{agent:l,projectPath:d,isPending:r,update:s}=He(a),{data:i}=he();if(r)return e.jsx(Me,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const u=i?Object.keys(i.capabilities):[l.runtime],f=u.includes(l.runtime)?u:[l.runtime,...u];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:at,children:"Runs on"}),e.jsxs(Be,{value:l.runtime??"claude-code",onValueChange:o=>s({runtime:o}),children:[e.jsx(ze,{className:"h-8 text-sm",responsive:!1,children:e.jsx(Ke,{})}),e.jsx(qe,{children:f.map(o=>e.jsx(Qe,{value:o,responsive:!1,children:H(o).label},o))})]})]}),e.jsx(st,{agent:l,onUpdate:s,className:"grid-cols-1"}),d&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(Ve,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:be(d)})]})]})}export{dt as RunsOnPopover};
|