dorkos 0.131.0 → 0.133.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +499 -314
- package/dist/browser/fresh-verifier.mjs +13 -13
- package/dist/browser/native/darwin-supervisor-worker.mjs +3 -3
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-BZ2LLJ0k.js → AboutPage-D-EHHVPa.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-BnqAwUiy.js → ActivityErrorState-BTHnE1vP.js} +1 -1
- package/dist/client/assets/{ActivityPage-BlZKrSVo.js → ActivityPage-BfSLPIdR.js} +1 -1
- package/dist/client/assets/{ActivityRow-Ch8HxQ2m.js → ActivityRow-PwUBjQw8.js} +1 -1
- package/dist/client/assets/{AdapterIcon-CfocFMw-.js → AdapterIcon-DgkNN6bi.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-Dtjx1Oad.js → AdapterSetupWizard-DX0dzp7q.js} +2 -2
- package/dist/client/assets/{AgentOptionRow-BGRvUeF7.js → AgentOptionRow-ApuDEKqq.js} +1 -1
- package/dist/client/assets/{AgentPicker-BcURPZQp.js → AgentPicker-BDci-9aL.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-kNq5A_IN.js → AgentRequestCard-B2gxCMGi.js} +3 -3
- package/dist/client/assets/{AppearancePage-Cd-k7dcc.js → AppearancePage-8SVnFe0k.js} +1 -1
- package/dist/client/assets/ApplyToOverridesDialog-CnL1ubxL.js +1 -0
- package/dist/client/assets/{AttentionSignalRow-QY8AIjf9.js → AttentionSignalRow-CCKhUtil.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Cgkvajbw.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-B7wFPzG4.js} +3 -3
- package/dist/client/assets/BindingDialog-C4BHVXno.js +1 -0
- package/dist/client/assets/{BlintzCanvas-CMzZnmWK.js → BlintzCanvas-7E5uwVms.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent-uxMaHePf.js → CanvasCsvContent-l7lfyDGn.js} +4 -4
- package/dist/client/assets/CanvasFileContent-Bqd0IEfK.js +2 -0
- package/dist/client/assets/CanvasModel3dContent-DqL0Sy4r.js +2 -0
- package/dist/client/assets/{ChannelComposer-BAg0a29Q.js → ChannelComposer-CAYvz_ZB.js} +12 -17
- package/dist/client/assets/{ChatAppsOff-DD28V0vX.js → ChatAppsOff-CNeKBVNz.js} +2 -2
- package/dist/client/assets/{CodeMirrorDiff-CyoduBgM.js → CodeMirrorDiff-BZRcNFsS.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-DGccoZ8Q.js → CodeMirrorEditor-DD5tArRn.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-Dk98shko.js → ComputerResourceView-BUmsVssG.js} +1 -1
- package/dist/client/assets/{ComputerViewer-Broprz4q.js → ComputerViewer-BKMR5LkF.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-C_qLz8GJ.js → ConnectionAccessLists-DYUiFmPY.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-CmGgGmDO.js → ConnectionsPage-DR2Kfm9Q.js} +2 -2
- package/dist/client/assets/{ConventionPage-BxWLIUUC.js → ConventionPage-Do6q8873.js} +2 -2
- package/dist/client/assets/{ExtensionPageRoute-CyfIRaGs.js → ExtensionPageRoute-CP7NM7fw.js} +2 -2
- package/dist/client/assets/{FeatureDisabledState-By2dhVpu.js → FeatureDisabledState-Bi23k3rg.js} +1 -1
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-B6wKQpLR.js → FloatingTanStackRouterDevtools-CqogiFob-lRlmDXYz.js} +1 -1
- package/dist/client/assets/{ForwardConsentHost-kDdpyBgA.js → ForwardConsentHost-DSR1pEEK.js} +1 -1
- package/dist/client/assets/HandlePage-aHId3bYX.js +1 -0
- package/dist/client/assets/HeartbeatPage-BTNVcHOI.js +1 -0
- package/dist/client/assets/{KeyEntry-Ctc1zp2J.js → KeyEntry-67acsEG2.js} +1 -1
- package/dist/client/assets/{LexicalField-7zd4B8f1.js → LexicalField-Cb68LIar.js} +2 -2
- package/dist/client/assets/{ManagesPage-BG1TIMP3.js → ManagesPage-ChPlBF42.js} +1 -1
- package/dist/client/assets/{Marketplace-C9r4jRJf.js → Marketplace-CzPhJEE1.js} +4 -4
- package/dist/client/assets/{MarketplaceSourcesView-C01Cdrge.js → MarketplaceSourcesView-CmQgxQmU.js} +1 -1
- package/dist/client/assets/{McpAppFrame-Dm7MqOhc.js → McpAppFrame-z5JUaCSA.js} +2 -2
- package/dist/client/assets/{McpSigninBody-CsXP_7lE.js → McpSigninBody-ZrnzwrOH.js} +1 -1
- package/dist/client/assets/{Model3dViewer-DOl8ZkrU.js → Model3dViewer-HJpWK-JI.js} +1 -1
- package/dist/client/assets/NamePage-C7F-SotG.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-Dj-Qw8zA.js → NewDirectMessageMenu-CjBjzsDe.js} +1 -1
- package/dist/client/assets/{NotificationsPage-UExs4YE2.js → NotificationsPage-DwNUI0Z3.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-Dx3M3wwS.js → OpenMeshSwitch-RNAZY1vn.js} +2 -2
- package/dist/client/assets/{OperatorIdentityForm-Bz5570RF.js → OperatorIdentityForm-B7S2C_eT.js} +1 -1
- package/dist/client/assets/PermissionHistory-D0chstxf.js +1 -0
- package/dist/client/assets/PermissionsPage-ToK0DZVV.js +1 -0
- package/dist/client/assets/{PersonalityPopover-Do-k_Hhw.js → PersonalityPopover-BvMtUQRM.js} +1 -1
- package/dist/client/assets/PhotoPage-Cqo3PNO_.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-B-yyzQZP.js → PreviewRefusedNotice-DzbkMrUo.js} +1 -1
- package/dist/client/assets/{ProfileFields-DiarOK2y.js → ProfileFields-DU8dTGHT.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-33Xkwoc3.js → ProfilePanelContainer-BfT-ufV7.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-BI6T4hj8.js → ProfileRolePicker-DrOtV-0N.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-v5MScpZF.js → PromptSuggestionChips-CEnhme_V.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-BALADuTO.js → ReportsToPopover-CwjpR1Tw.js} +1 -1
- package/dist/client/assets/{RoomSurface-BatV7gf5.js → RoomSurface-CChzNJKw.js} +1 -1
- package/dist/client/assets/{RoomsPage-DCCC3Dst.js → RoomsPage-Dbf6ijKr.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-C7hMPyrb.js → RunsOnPopover-Bh5sSsSC.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-Dc5a8dlJ.js → RuntimeConnectFlow-BYQnY5vv.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-w90VGjJ4.js → RuntimeSetupDialog-DTO5v0dP.js} +1 -1
- package/dist/client/assets/{SeenDevices-BIMmbMWC.js → SeenDevices-cuY7ASEy.js} +3 -3
- package/dist/client/assets/{SessionsPage-0lwvSYHB.js → SessionsPage-BrqpVx-t.js} +1 -1
- package/dist/client/assets/{SettingsDialog-CrP6JzPg.js → SettingsDialog-DCAZX_1d.js} +4 -4
- package/dist/client/assets/{SkillsPage-BDgKWTfe.js → SkillsPage-D5who_ZH.js} +1 -1
- package/dist/client/assets/TaskDialogWrapper-BJ6XtOC5.js +1 -0
- package/dist/client/assets/TasksEmptyState-B3SjsxQa.js +3 -0
- package/dist/client/assets/{TasksPage-DjGbMGvn.js → TasksPage-B72w7J87.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-B_sM9Fik.js → TeamComputerEntry-B9ma5j-X.js} +1 -1
- package/dist/client/assets/TodoPromiseList-DDKWAfmv.js +1 -0
- package/dist/client/assets/TodoPromisesPage-BNXpvXzS.js +1 -0
- package/dist/client/assets/{ToolsPage-CeETRCd8.js → ToolsPage-DbJykCG3.js} +2 -2
- package/dist/client/assets/{TopologyGraph-CnpH2NjE.js → TopologyGraph-DKZS3nlr.js} +3 -3
- package/dist/client/assets/{TourHost-BQHrS47S.js → TourHost-Bw3Uoea5.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-DOQLeNx4.js → UnlinkDialog-B-XCFNSd.js} +1 -1
- package/dist/client/assets/{UnreadDivider-DhyK6uGG.js → UnreadDivider-1aPVzwd7.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-Bwlfu514.js → WidgetErrorCard-C5ieVv_9.js} +6 -6
- package/dist/client/assets/{WithheldExtensionsNotice-BDc-CM2t.js → WithheldExtensionsNotice-CCO4ClRZ.js} +1 -1
- package/dist/client/assets/{WorkQueuePage-iO_DO1YK.js → WorkQueuePage-BbPKNwDg.js} +1 -1
- package/dist/client/assets/WorkView-BRcytACJ.js +51 -0
- package/dist/client/assets/_shell-EwFeSIGp.js +80 -0
- package/dist/client/assets/{_shell._home-BWi5YPaR.js → _shell._home-DD2mg-iK.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-BU1NIGb7.js → _shell._home.activity-Z1QuU2M4.js} +1 -1
- package/dist/client/assets/_shell._home.index-BzTYr8Bw.js +3 -0
- package/dist/client/assets/_shell._home.tasks-BtC85Iut.js +1 -0
- package/dist/client/assets/{_shell._home.workspaces-wbnqJ58w.js → _shell._home.workspaces-qMG5OJYR.js} +1 -1
- package/dist/client/assets/{_shell.channels-D1KdvWZF.js → _shell.channels-BE4EK-iM.js} +2 -2
- package/dist/client/assets/_shell.connections-CBx0ogzx.js +1 -0
- package/dist/client/assets/{_shell.feedback-requests-DzHWC1fJ.js → _shell.feedback-requests-CwKSkkuD.js} +2 -2
- package/dist/client/assets/_shell.marketplace-CgWBUKSA.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-8HZpKFDI.js +1 -0
- package/dist/client/assets/_shell.session-D6HcVbnm.js +1 -0
- package/dist/client/assets/{_shell.team-BMNSUpQQ.js → _shell.team-Dm5a4f8_.js} +4 -4
- package/dist/client/assets/_shell.threads-BavVtQOE.js +1 -0
- package/dist/client/assets/_shell.todos-B6uWr0zA.js +6 -0
- package/dist/client/assets/_shell.x._extensionId-DaELdkCH.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-DaELdkCH.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-Co2k29JX.js → abnfDiagram-WEYOIA3C-Bu2T3jVw.js} +1 -1
- package/dist/client/assets/{access-copy-D6BUySpp.js → access-copy-tkiFMhRf.js} +1 -1
- package/dist/client/assets/{arc-DLZZpkuJ.js → arc-5q4SfXO9.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-ClS9xqK5.js → architectureDiagram-ZHVYKT53-BnDMOBhV.js} +1 -1
- package/dist/client/assets/{banner-B8iMuXCP.js → banner-CSKUrrI0.js} +2 -2
- package/dist/client/assets/{blockDiagram-RJAE7QA3-DheoOELu.js → blockDiagram-RJAE7QA3-CtushlEs.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-VWWZJ5x4.js → c4Diagram-XDPPPE54-7L-qYwKH.js} +1 -1
- package/dist/client/assets/channel-A3XT7_2L.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-BqPLJVkv.js → chunk-2E7WHVMD-ksBVyqQ3.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-DZn6OnKe.js → chunk-2Q5K7J3B-Bfqdkihb.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-Dl9Poajp.js → chunk-4EMNKR2T-Brf2dH9x.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-RoKuZPUc.js → chunk-55XCU76K-BlE7Cq40.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-DV_1XHtU.js → chunk-5VM5RSS4-Bkgg3j7L.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-B_IuS45y.js → chunk-JWPE2WC7-B9TRpN4O.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-DkLNi45x.js → chunk-VQ5W62QI-ZoILnIYi.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-ISM-1Dpw.js → chunk-XXDRQBXY-r2xNhaKz.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-MKaLMW8o.js → chunk-ZCHMQSOR-DfV3cF7d.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-CIWuu4ht.js → classDiagram-v2-4MYWR3UA-VOVqMNNP.js} +1 -1
- package/dist/client/assets/{command-CxGYZKco.js → command-CaUEAy3b.js} +1 -1
- package/dist/client/assets/{copy-button-DjAoGwds.js → copy-button-BOznikwM.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-HiCifRyi.js → cose-bilkent-JH36ORCC-CAdBvyLz.js} +1 -1
- package/dist/client/assets/{cpu-DHHTTvp_.js → cpu-j9vX9Wfk.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-DjJGZrPz.js → cynefin-EF2NZ3EQ-DcH1A9Oo.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-DE2NdiJ2.js → cynefinDiagram-WF24UDRP-DJuKBXHi.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-C6gDOD26.js → dagre-NK4GIZVX-D099H_0S.js} +1 -1
- package/dist/client/assets/{detail-row-CjwI1iuc.js → detail-row-Crl89jnh.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-38LckcsL.js → diagram-CBK3MWTC-Cd_4W9XO.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D--8L6D9Ra.js → diagram-I5XIIV2D-Bc7aQKt3.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-DGC2Inhd.js → diagram-ODIL2UCW-awVJZ4Bg.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-BDHp0AyR.js → diagram-PFBEJUXE-dhsj9aeU.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-uBatJYPi.js → diagram-RJA3I4VV-Dm59CbiV.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-C8e1EH9X.js → diagram-TYUNFSNR-BhvcIjA9.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-DimRzU5B.js → ebnfDiagram-V4P3TTPT-C4wT_MTC.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-Dz6_Y2-G.js → elk-QONTBCTQ-CPI0zjmW.js} +1 -1
- package/dist/client/assets/{empty-state-saV209Il.js → empty-state-BHcmkSzu.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-JeuTF8w6.js → erDiagram-KYQIGQAA-C_vGcbOB.js} +1 -1
- package/dist/client/assets/{execution-config-ClQZyDs9.js → execution-config-BS5rtvTZ.js} +1 -1
- package/dist/client/assets/{file-BIF-4ARS.js → file-CQGljfDT.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-DxadH2b-.js → file-exclamation-point-B0a55VME.js} +1 -1
- package/dist/client/assets/{file-text-C_NPIQr4.js → file-text-Cycq_S0e.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-CXai_zs0.js → find-latest-widget-fence-B6sJdG3Q.js} +4 -4
- package/dist/client/assets/{flowDiagram-IUGLLWBU-9FHDdK4j.js → flowDiagram-IUGLLWBU-_VNfmnxx.js} +1 -1
- package/dist/client/assets/{form-D3VdAYl4.js → form-BL14vwyB.js} +1 -1
- package/dist/client/assets/{format-cron-BqRDcFZM.js → format-cron-meJMgYNe.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-CLMuXlHt.js → ganttDiagram-R7GPNTJY-o0gGU7X_.js} +1 -1
- package/dist/client/assets/{git-branch-Df7a5_fb.js → git-branch-CsLE6G0Y.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-sE7Rlpr6.js → gitGraphDiagram-PDYL7XHY-DjXjUpJo.js} +1 -1
- package/dist/client/assets/{graph-iNVyFhBQ.js → graph-BMYee_VK.js} +1 -1
- package/dist/client/assets/{heart-BHMhDZ0K.js → heart-Cn3a-UQI.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-VvvsrJbu.js → highlighted-body-KPVGNVTW-DsX5yCC0.js} +1 -1
- package/dist/client/assets/{image-lightbox-CGEIRguA.js → image-lightbox-BZ_eBZgA.js} +1 -1
- package/dist/client/assets/{image-off-C5-TmSq8.js → image-off-DjR7LI5G.js} +1 -1
- package/dist/client/assets/{index-C3zS0ghJ.js → index-1MwES_vb.js} +1 -1
- package/dist/client/assets/{index-ClyRhxV_.js → index-47--OGKJ.js} +1 -1
- package/dist/client/assets/{index-CTgUh4p3.js → index-4rSR8lau.js} +1 -1
- package/dist/client/assets/{index-D9bEy8X-.js → index-B4TxpTKD.js} +1 -1
- package/dist/client/assets/{index-Dw-4S640.js → index-B8LqLhq7.js} +1 -1
- package/dist/client/assets/index-BJRgbiEd.js +1 -0
- package/dist/client/assets/{index-DWZ5M321.js → index-BOCclWF3.js} +1 -1
- package/dist/client/assets/index-BR1m9FON.js +1066 -0
- package/dist/client/assets/index-BcFn_S6b.js +1 -0
- package/dist/client/assets/{index-DRtg_sGG.js → index-BcnwvTnt.js} +1 -1
- package/dist/client/assets/index-BdVQOlVQ.css +1 -0
- package/dist/client/assets/{index-DEvpdTo6.js → index-BmKHO-FD.js} +1 -1
- package/dist/client/assets/{index-Bd0PAkxf.js → index-BsZkXHsH.js} +1 -1
- package/dist/client/assets/{index-Cudi8rs6.js → index-BxWr8Mrf.js} +1 -1
- package/dist/client/assets/index-C5EvpXcq.js +1 -0
- package/dist/client/assets/{index-CExh9cKN.js → index-Cb_p_ynP.js} +1 -1
- package/dist/client/assets/{index-YZbu9tke.js → index-CczLBUKI.js} +1 -1
- package/dist/client/assets/{index-264YDu-W.js → index-Cf4Gtxf9.js} +1 -1
- package/dist/client/assets/{index-Dpu2CORc.js → index-CfKSlYjb.js} +1 -1
- package/dist/client/assets/{index-Bzm9YMbr.js → index-Cgjq7a-8.js} +1 -1
- package/dist/client/assets/{index-Ci_J5Q-6.js → index-CpWxcN5D.js} +1 -1
- package/dist/client/assets/{index-BK5QrGfQ.js → index-Cv67OXfk.js} +1 -1
- package/dist/client/assets/{index-Di-MIFQG.js → index-D5Qmx1JR.js} +3 -3
- package/dist/client/assets/{index-LPrq0pOA.js → index-DARchye_.js} +1 -1
- package/dist/client/assets/{index-DMwivStD.js → index-DFb4kOjm.js} +2 -2
- package/dist/client/assets/{index-WeLoaNzW.js → index-DLN0kcME.js} +1 -1
- package/dist/client/assets/{index-BMLCfTba.js → index-DMSSN08i.js} +1 -1
- package/dist/client/assets/{index-Y6BDhuGt.js → index-DQ8uADJF.js} +1 -1
- package/dist/client/assets/index-DZhMvc9m.js +1 -0
- package/dist/client/assets/{index-CLsoFUml.js → index-Dfko0tSp.js} +1 -1
- package/dist/client/assets/{index-BgdYXP8E.js → index-DiM3QX-4.js} +3 -3
- package/dist/client/assets/{index-BxFLHNLg.js → index-DlvUENo4.js} +1 -1
- package/dist/client/assets/{index-BLUUshO9.js → index-DqZmnJED.js} +1 -1
- package/dist/client/assets/{index-D_bAtIJZ.js → index-DrlB9RSk.js} +1 -1
- package/dist/client/assets/{index-CgWzzIbx.js → index-H4e5Wpmi.js} +1 -1
- package/dist/client/assets/{index-k67dvyau.js → index-Joav7LQU.js} +1 -1
- package/dist/client/assets/{index-B0FHRkHM.js → index-KganLhU1.js} +2 -2
- package/dist/client/assets/{index-DFkofTx1.js → index-Kt6r3DQg.js} +1 -1
- package/dist/client/assets/{index-B8I1k-z9.js → index-Z2ApBQt4.js} +1 -1
- package/dist/client/assets/index-dY7IFpet.js +1 -0
- package/dist/client/assets/{index-DYVNSRDk.js → index-faSyUc2q.js} +1 -1
- package/dist/client/assets/{index-BgRYuqWs.js → index-gmyiXkmr.js} +1 -1
- package/dist/client/assets/{index-BZTLFzJp.js → index-o6kGmVGx.js} +1 -1
- package/dist/client/assets/{index-C_0JoCV6.js → index-vHKVYcH7.js} +1 -1
- package/dist/client/assets/{index.esm-CYmalBux.js → index.esm-CJIDYBqd.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-0aR9wjgO.js → infoDiagram-MVDRKAX5-B1mMyUlp.js} +1 -1
- package/dist/client/assets/{inline-code-DyTKSC5b.js → inline-code-mh48Uhbi.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-D1lN8x2t.js → ishikawaDiagram-HPEHV2GE-efEMQ0_X.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-CkXITXiJ.js → journeyDiagram-BOSHW7O7-DSAywiVk.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-ge33IiSq.js → kanban-definition-FNSA4HC5-B9pbU4zK.js} +1 -1
- package/dist/client/assets/{layers-Bx3K7OUm.js → layers-B0Z5Od3N.js} +1 -1
- package/dist/client/assets/{lightbulb-C5LvXkvM.js → lightbulb-Cfb5ecEd.js} +1 -1
- package/dist/client/assets/{link-2-Bj0_Zkvr.js → link-2-Dzy5BUL3.js} +1 -1
- package/dist/client/assets/{list-runtime-types-VNj1C8TB.js → list-runtime-types-DLmjtBMq.js} +1 -1
- package/dist/client/assets/{markdown-content-BRaPEOC7.js → markdown-content-DhAtZOfj.js} +1 -1
- package/dist/client/assets/{mention-pill-B_MiJWfo.js → mention-pill-DmA8FxL4.js} +1 -1
- package/dist/client/assets/{mermaid.core-B2hil_4a.js → mermaid.core-DUIkdbeL.js} +4 -4
- package/dist/client/assets/{message-square-off-T33FHpr7.js → message-square-off-BowIzJUV.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-Bu_Ia4Xz.js → mindmap-definition-6OY57UG3-Dz7ZOR4C.js} +1 -1
- package/dist/client/assets/{more-details-oDazWBxm.js → more-details-DV7LmY0E.js} +1 -1
- package/dist/client/assets/{owner-notice-VepbAQhj.js → owner-notice-DdFc2P8z.js} +1 -1
- package/dist/client/assets/{package-DBsl3ao5.js → package-BhKXbvU_.js} +1 -1
- package/dist/client/assets/{page-container-Bkarym6m.js → page-container-0sWZ3xh9.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-gBlb5k1v.js → pane-resize-handle-Bjy4udre.js} +1 -1
- package/dist/client/assets/{paperclip-BeFttiUK.js → paperclip-C-7LhBfl.js} +1 -1
- package/dist/client/assets/{path-input-NY_yCBHb.js → path-input-BPVyI72G.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-0KmJlW0E.js → pegDiagram-ECIUJNBX-C4EOP-Fa.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-IjeZXicv.js → pieDiagram-GNMPY74T-CQ1OxRkv.js} +1 -1
- package/dist/client/assets/{plug-CTqOZ7cA.js → plug-CIZ-wWL8.js} +1 -1
- package/dist/client/assets/{primer-trigger-CjaGrT2u.js → primer-trigger-XA5fLzR5.js} +2 -2
- package/dist/client/assets/{profile-errors-B8XkL2Rp.js → profile-errors-C1XACbc9.js} +1 -1
- package/dist/client/assets/{progress-Cr-4myw6.js → progress-BA2JPtb6.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-CP6kLJKa.js → quadrantDiagram-D57K4MC3-Cw4BdkpS.js} +1 -1
- package/dist/client/assets/{query-error-state-DvhY-YKM.js → query-error-state-Cm-Lozlb.js} +1 -1
- package/dist/client/assets/{radio-CmDmmJy6.js → radio-DQ29H26H.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-Bcto__oE.js → railroadDiagram-Y72NRBL7-CSKtYLmm.js} +1 -1
- package/dist/client/assets/registry-Tbt9pcZl.js +39 -0
- package/dist/client/assets/registry-jD9zw538.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-ZLR1S8ft.js → relay-trace-schemas-4AAUf-Zl.js} +2 -2
- package/dist/client/assets/{repeat-DVTM8et8.js → repeat-B8g-x-Sc.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-DNJrds3m.js → requirementDiagram-EQYSW5RA-BPSBZr7X.js} +1 -1
- package/dist/client/assets/{room-files-source-9Wdtc-bG.js → room-files-source-BkiK4-ZI.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-qJSWqifh.js → rotate-ccw-clock-DRtL-2nr.js} +1 -1
- package/dist/client/assets/{rotate-cw-uoeBxIeM.js → rotate-cw-BbHkWN-J.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-DNlU7xGI.js → sankeyDiagram-SY24JHO5-DVlHablQ.js} +1 -1
- package/dist/client/assets/{scroll-area-B1d3NfEn.js → scroll-area-DAC7NrVU.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-CRk71coF.js → sequenceDiagram-BLEHNHQU--wZkN8xk.js} +1 -1
- package/dist/client/assets/{shield-x-BpQmg1qz.js → shield-x-CEWfkzDN.js} +1 -1
- package/dist/client/assets/{signed-in-CTmJ3OqM.js → signed-in-CMhCR-m8.js} +1 -1
- package/dist/client/assets/{sizeCapture-INFHLROL-cihX3QNq.js → sizeCapture-INFHLROL-CLXc7d3S.js} +1 -1
- package/dist/client/assets/{soul-file-BwiyiI5v.js → soul-file-CbX7rNqz.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-BAwwRsnH.js → stateDiagram-v2-A6IESKWZ-5xa1FM_X.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-CpDB6CUC.js → swimlanes-B3ENRKFQ-DKgxJxjE.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-f6MOc3pl.js +8 -0
- package/dist/client/assets/{table-dWrfPeX-.js → table-D0EJT0uP.js} +1 -1
- package/dist/client/assets/{tabs-D4txthOi.js → tabs-Ctjzrm8t.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-RDrKgCoU.js → timeline-definition-JXYKGLGB-B9P7ituI.js} +1 -1
- package/dist/client/assets/trust-dial-D__tIhzt.js +11 -0
- package/dist/client/assets/{trust-posture-atZIh8tf.js → trust-posture-DaHHtOZn.js} +1 -1
- package/dist/client/assets/{unplug-CnevV4yX.js → unplug-B-ipHefz.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-BQwT36FA.js → unverified-catalog-notice-C8swqaTn.js} +1 -1
- package/dist/client/assets/{use-bindings-CltfjAWW.js → use-bindings-gLHRNAFU.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-D-Zlt6z2.js → use-composer-prefs-CjpxcBIe.js} +1 -1
- package/dist/client/assets/{use-connector-management-C3CLnOOt.js → use-connector-management-BLiCJMgU.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-DQlz-scx.js → use-deep-link-scroll-r2nKjzA-.js} +1 -1
- package/dist/client/assets/{use-delete-binding-D73CLm_7.js → use-delete-binding-BSiOik_K.js} +1 -1
- package/dist/client/assets/{use-dev-links-BqVFsMKU.js → use-dev-links-DXcIlMf-.js} +1 -1
- package/dist/client/assets/use-direct-message-panel-BbH8N4mE.js +1 -0
- package/dist/client/assets/{use-external-adapter-catalog-DrnksH0t.js → use-external-adapter-catalog-mmKni5ui.js} +1 -1
- package/dist/client/assets/{use-filter-state-D4i-hDOk.js → use-filter-state-CiPZ0AIH.js} +2 -2
- package/dist/client/assets/{use-full-activity-feed-DdDsRg8s.js → use-full-activity-feed-DXroUzfN.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-LUZL5z5t.js +1 -0
- package/dist/client/assets/{use-mesh-topology-B7aLtPkZ.js → use-mesh-topology-upehQ5Cv.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-DSSTCJfY.js → use-mounted-ref-IHwyriaF.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-DaF3kwmq.js → use-notification-prefs-BHOK2P2l.js} +1 -1
- package/dist/client/assets/use-pending-read-mVsOBTzn.js +1 -0
- package/dist/client/assets/{use-personality-commit-D5b90JPX.js → use-personality-commit-Chf3UX8P.js} +1 -1
- package/dist/client/assets/{use-promo-activation-CPAOQpfe.js → use-promo-activation-Dlw6bg7G.js} +2 -2
- package/dist/client/assets/{use-promo-dismissals-Bx1gz1R1.js → use-promo-dismissals-Dx_fli7I.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-DeulB37O.js → use-pulse-freshness-CG_I6a-O.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-Dwke6RFQ.js → use-room-follow-claim-Bgrpr3bO.js} +1 -1
- package/dist/client/assets/{use-room-sessions-iepVrIMm.js → use-room-sessions-DecGrP3E.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-pCPKNQKv.js → use-roving-tab-list-CDkh-Ujm.js} +1 -1
- package/dist/client/assets/{use-session-canvas-BvvO-_V1.js → use-session-canvas-tvLLPQcm.js} +6 -6
- package/dist/client/assets/{use-status-budget-Bs7MMriS.js → use-status-budget-BBl2yxLR.js} +2 -2
- package/dist/client/assets/{use-todos-C-eREuDS.js → use-todos-BzRauzdQ.js} +1 -1
- package/dist/client/assets/{use-transform-lj3TkjYO.js → use-transform-DzJeHpxm.js} +1 -1
- package/dist/client/assets/{use-unclaimed-chats-BF3-0jHC.js → use-unclaimed-chats--HZdmq4F.js} +1 -1
- package/dist/client/assets/use-update-config-DjL7-nUR.js +1 -0
- package/dist/client/assets/{useMutationState-B_x_4f2K.js → useMutationState-DIywUTDG.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-DBsRYa4J.js → usecaseDiagram-WPOLBNNX-C9aLJ03F.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-rFAXvcQI.js → vennDiagram-Q3Y3IDCW-ChBIWbL0.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-bI0JZkO3.js → wardleyDiagram-IVAIDKWA-DvQDOaTm.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-DZUd8iln.js → xychartDiagram-4URNHDU4-8FxLPP2c.js} +1 -1
- package/dist/client/assets/zap-DSllMMHe.js +6 -0
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261104060919_package_approval_request.sql +1 -0
- package/dist/drizzle/20261104081935_hook_decline_review.sql +3 -0
- package/dist/drizzle/20261107183323_dor3933_todos_rename.sql +64 -0
- package/dist/drizzle/20261108014418_dor3938_cross_agent_writer.sql +4 -0
- package/dist/drizzle/meta/20261104060919_snapshot.json +14889 -0
- package/dist/drizzle/meta/20261104081935_snapshot.json +14910 -0
- package/dist/drizzle/meta/20261107183323_snapshot.json +14910 -0
- package/dist/drizzle/meta/20261108014418_snapshot.json +14938 -0
- package/dist/drizzle/meta/_journal.json +28 -0
- package/dist/server/index.js +24875 -21931
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/ApplyToOverridesDialog-DE9VVQCA.js +0 -1
- package/dist/client/assets/BindingDialog-C_yflKOE.js +0 -1
- package/dist/client/assets/CanvasFileContent-C3ZKszxn.js +0 -2
- package/dist/client/assets/CanvasModel3dContent-CsNUuaj6.js +0 -2
- package/dist/client/assets/CommitmentList-DOvfnyDA.js +0 -1
- package/dist/client/assets/CommitmentsPage-D81vxHUk.js +0 -1
- package/dist/client/assets/HandlePage-vsG04kBg.js +0 -1
- package/dist/client/assets/HeartbeatPage-CMj1SS30.js +0 -1
- package/dist/client/assets/NamePage-DdX2yQ5f.js +0 -1
- package/dist/client/assets/PermissionHistory-Bhl2kr1R.js +0 -1
- package/dist/client/assets/PermissionsPage-DUbenFkt.js +0 -1
- package/dist/client/assets/PhotoPage-CExABoHA.js +0 -1
- package/dist/client/assets/TaskDialogWrapper-BVb8gAr0.js +0 -1
- package/dist/client/assets/TasksEmptyState-RkUEEU2r.js +0 -3
- package/dist/client/assets/WorkView-BDk_vwu3.js +0 -51
- package/dist/client/assets/_shell-CMNFxZKJ.js +0 -80
- package/dist/client/assets/_shell._home.index-BjR-d3_s.js +0 -3
- package/dist/client/assets/_shell._home.tasks-CqURPMQD.js +0 -1
- package/dist/client/assets/_shell.connections-D3gJrBTQ.js +0 -1
- package/dist/client/assets/_shell.marketplace-HdefWdN_.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-wAZKfDQF.js +0 -1
- package/dist/client/assets/_shell.session-C0utZeSI.js +0 -1
- package/dist/client/assets/_shell.threads-TvzYRNMt.js +0 -1
- package/dist/client/assets/_shell.todos-sOFmsIPE.js +0 -6
- package/dist/client/assets/_shell.x._extensionId-DiEQZIvl.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-DiEQZIvl.js +0 -1
- package/dist/client/assets/channel-B0WiEIVe.js +0 -1
- package/dist/client/assets/index-BwTGkJbK.js +0 -1071
- package/dist/client/assets/index-CCHGVclj.js +0 -1
- package/dist/client/assets/index-CiUmx-i3.js +0 -1
- package/dist/client/assets/index-Dd4JoHFP.js +0 -1
- package/dist/client/assets/index-DlmGvYpy.js +0 -1
- package/dist/client/assets/index-EXJsA5kw.js +0 -1
- package/dist/client/assets/index-MpS13vhQ.css +0 -1
- package/dist/client/assets/registry-BQTcAm5U.js +0 -39
- package/dist/client/assets/registry-HencHRXy.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-nJfOIWYW.js +0 -8
- package/dist/client/assets/use-direct-message-panel-B3qfpDjY.js +0 -1
- package/dist/client/assets/use-is-below-desktop-BXHT3oPL.js +0 -1
- package/dist/client/assets/use-local-browser-DDWknHZE.js +0 -1
- package/dist/client/assets/use-pending-read-uvmEJ7H9.js +0 -1
- package/dist/client/assets/use-update-config-D-OGlXGR.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a5 as q,a7 as
|
|
1
|
+
import{a5 as q,a7 as K,r as a,eK as B,a8 as T,a6 as Q,j as s,eL as U,I as W,eM as Y,B as b,x as z,G as S,eN as H,eO as V,eP as X,bf as J}from"./index-BR1m9FON.js";const P={SIGNIN_NO_APP_REGISTRATION:"This server doesn’t let DorkOS register itself. Add your own app credentials to try again.",SIGNIN_NO_SIGNIN_SUPPORT:"This server doesn’t offer sign-in the way DorkOS expects.",SIGNIN_UNREACHABLE:"Couldn’t reach the server to start the sign-in."};function Z(e){return e!==void 0&&e in P}function k(e){const{message:t,code:i,detail:o}=e;return Z(i)?{message:P[i],detail:o??t??null,canUseOwnCredentials:i==="SIGNIN_NO_APP_REGISTRATION"}:{message:t??"Sign-in didn’t finish. Try again.",detail:o??null,canUseOwnCredentials:!1}}function ee(e){if(typeof e!="object"||e===null)return{};const{code:t,body:i}=e,o=typeof i=="object"&&i!==null?i.detail:void 0;return{...typeof t=="string"?{code:t}:{},...typeof o=="string"?{detail:o}:{}}}const _=2e3,F=5,se="Couldn’t check the sign-in. Retrying.",te="Couldn’t check if the sign-in finished. Try again in a moment.",j={phase:"idle",disclosure:null,authorizeUrl:null,startFailure:null,credentialsError:null,flowId:null,watching:!1};function ne(e){const t=e==null?void 0:e.toolCount;return typeof t!="number"||!Number.isFinite(t)||t<0?null:t}function re(e,t){return(e==null?void 0:e.status)==="failed"?e.error??"Sign-in didn’t finish. Try again.":t>=F?te:null}function ie(e){return{...j,phase:"failed",startFailure:k({message:e.message,...ee(e)})}}function ae(e){return e===null?null:k({message:e})}function O(e){return e.flowId===null?!1:e.phase==="waiting"||e.phase==="disclosure"&&e.watching}function le(e,t,i){return O(e)?(t==null?void 0:t.status)==="connected"?"connected":(t==null?void 0:t.status)==="failed"?"failed":e.phase!=="waiting"?e.phase:i>=F?"failed":"waiting":e.phase}function he(e,t){const i=q(),o=K(),[u,r]=a.useState(j),h=a.useRef(0),[x,C]=a.useState(0),g=a.useRef(null),d=a.useCallback(n=>{g.current=n,h.current=0,C(0)},[]),p=a.useCallback((n,c)=>{c===g.current&&(h.current=n==="ok"?0:h.current+1,C(h.current))},[]),f=a.useCallback(()=>{o.invalidateQueries({queryKey:B.mcpServers(e)}),o.invalidateQueries({queryKey:["mcp-config"]})},[o,e]),l=T({mutationFn:()=>i.startMcpSignin(e,t),meta:{suppressErrorToast:!0}}),v=a.useCallback(()=>{d(null),r({...j,phase:"starting"}),l.mutate(void 0,{onSuccess:n=>{if(!n.alreadyConnected&&!n.authorizeUrl){r({...j,phase:"failed",startFailure:k({message:"Couldn’t make a sign-in link for this server."})});return}d(n.flowId),r({phase:n.alreadyConnected?"connected":"disclosure",disclosure:n.disclosure,authorizeUrl:n.authorizeUrl??null,startFailure:null,credentialsError:null,flowId:n.flowId,watching:!1})},onError:n=>r(ie(n))})},[l,d]),I=T({mutationFn:n=>i.setMcpClientCredentials(e,t,n),meta:{suppressErrorToast:!0}}),M=a.useCallback(n=>{r(c=>c.credentialsError===null?c:{...c,credentialsError:null}),I.mutate(n,{onSuccess:()=>{f(),v()},onError:c=>r(N=>({...N,credentialsError:c.message}))})},[I,f,v]),A=a.useCallback(n=>{g.current!==n.flowId&&(f(),d(n.flowId),r({phase:"disclosure",disclosure:n.disclosure,authorizeUrl:n.authorizeUrl,startFailure:null,credentialsError:null,flowId:n.flowId,watching:!0}))},[d]),D=a.useCallback(()=>{r(n=>n.phase==="disclosure"?{...n,phase:"waiting"}:n)},[]),G=a.useCallback(()=>{d(null),r(j)},[d]),E=Q({queryKey:["mcp-signin",e,t,u.flowId??""],queryFn:async()=>{const n=u.flowId??"";try{const c=await i.pollMcpSignin(n);return p("ok",n),c}catch(c){throw p("failed",n),c}},enabled:O(u),refetchInterval:n=>{var R;const c=(R=n.state.data)==null?void 0:R.status;if(c==="connected"||c==="failed")return!1;const N=h.current;return N===0?_:N>=F?!1:_*(N+1)},retry:!1,refetchOnWindowFocus:n=>{var c;return((c=n.state.data)==null?void 0:c.status)==="failed"},refetchOnReconnect:!1,gcTime:0,staleTime:0,meta:{suppressErrorToast:!0}}),w=x,y=le(u,E.data,w);a.useEffect(()=>{y==="connected"&&f()},[y,f]);const m=O(u)?ae(re(E.data,w)):u.startFailure,$=y==="waiting"&&w>0?se:null;return{state:{step:y,disclosure:u.disclosure,authorizeUrl:u.authorizeUrl,error:(m==null?void 0:m.message)??null,errorDetail:(m==null?void 0:m.detail)??null,canUseOwnCredentials:(m==null?void 0:m.canUseOwnCredentials)??!1,savingCredentials:I.isPending,credentialsError:u.credentialsError,retryNotice:$,toolCount:y==="connected"?ne(E.data):null},start:v,adopt:A,authOpened:D,useOwnCredentials:M,reset:G}}function ce({onSave:e,onCancel:t,saving:i=!1,error:o=null,className:u}){const r=a.useId(),h=a.useRef(null),[x,C]=a.useState(""),[g,d]=a.useState(""),p=x.trim(),f=g.trim();return a.useEffect(()=>{var l;(l=h.current)==null||l.focus()},[]),s.jsxs("form",{className:S("space-y-2",u),onSubmit:l=>{l.preventDefault(),!(!p||i)&&e({clientId:p,...f?{clientSecret:f}:{}})},children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(U,{htmlFor:`${r}-client-id`,className:"text-xs",children:"Client ID"}),s.jsx(W,{id:`${r}-client-id`,ref:h,value:x,onChange:l=>C(l.target.value),autoComplete:"off",spellCheck:!1,disabled:i,className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(U,{htmlFor:`${r}-client-secret`,className:"text-xs",children:["Client secret ",s.jsx("span",{className:"text-muted-foreground font-normal",children:"(if you got one)"})]}),s.jsx(Y,{id:`${r}-client-secret`,value:g,onChange:l=>d(l.target.value),autoComplete:"off",disabled:i,className:"h-8 text-xs"})]}),s.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"From the service’s developer settings. Kept encrypted here; agents never see it."}),o&&s.jsx("p",{role:"alert",className:"text-destructive text-xs leading-relaxed",children:o}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(b,{type:"submit",size:"sm",disabled:!p||i,className:"gap-1.5 focus-visible:ring-2",children:[i&&s.jsx(z,{size:"xs"}),"Save and sign in"]}),s.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:t,disabled:i,className:"focus-visible:ring-2",children:"Cancel"})]})]})}function L({children:e}){return s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[s.jsx(z,{size:"xs"}),e]})}function oe(e){return e===null?"Signed in. Its tools are available on the next turn.":`Connected · ${e} tool${e===1?"":"s"}.`}function ue(e){return`DorkOS keeps the key from ${e} here, never your agent. Removing the server deletes it.`}function de(e){const{state:t}=e;return t.step==="starting"?s.jsx(L,{children:"Starting sign-in…"}):t.step==="waiting"?s.jsxs("div",{className:"space-y-1",children:[s.jsx(L,{children:"Waiting for you to sign in… Close the tab when done."}),t.retryNotice&&s.jsx("p",{className:"text-muted-foreground text-xs",children:t.retryNotice})]}):t.step==="connected"?s.jsxs("p",{className:"text-status-success-fg flex items-center gap-2 text-xs",children:[s.jsx(J,{className:"size-3.5","aria-hidden":!0}),oe(t.toolCount)]}):null}function pe({flow:e,serverName:t,className:i,failedActions:o,connectedActions:u}){const{state:r}=e,h=a.useRef(null),x=r.step==="disclosure",C=a.useRef(null),[g,d]=a.useState(!1),p=g&&r.canUseOwnCredentials;a.useEffect(()=>{var l;x&&((l=h.current)==null||l.focus())},[x]);const f=a.useRef(!1);return a.useEffect(()=>{var l;!f.current||p||(f.current=!1,(l=C.current)==null||l.focus())},[p]),s.jsxs(s.Fragment,{children:[s.jsx("div",{role:"status",className:S("[&:not(:empty)]:mt-1",i),children:de(e)}),x&&s.jsxs("div",{className:S("mt-1 space-y-2",i),children:[s.jsxs("div",{ref:h,tabIndex:-1,className:"border-status-success-border bg-status-success-bg text-status-success-fg flex items-start gap-2 rounded-md border px-3 py-2 focus-visible:ring-2",children:[s.jsx(H,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-xs font-semibold",children:"Your sign-in stays on this computer."}),s.jsx("p",{className:"text-xs leading-relaxed",children:r.disclosure??ue(t)})]})]}),r.authorizeUrl&&s.jsx(b,{asChild:!0,size:"sm",className:"gap-1.5 focus-visible:ring-2",children:s.jsxs(V,{href:r.authorizeUrl,onOpened:()=>e.authOpened(),"aria-label":`Open the sign-in page for ${t}`,children:["Open the sign-in page",s.jsx(X,{className:"size-3.5","aria-hidden":!0})]})})]}),r.step==="failed"&&s.jsxs("div",{className:S("mt-1 space-y-2",i),children:[s.jsx("p",{role:"alert",className:"text-destructive text-xs leading-relaxed",children:r.error??"Sign-in didn’t finish. Try again."}),r.errorDetail&&s.jsxs("details",{className:"text-muted-foreground text-xs",children:[s.jsx("summary",{className:"cursor-pointer focus-visible:ring-2",children:"Details"}),s.jsx("code",{className:"text-2xs mt-1 block font-mono break-all",children:r.errorDetail})]}),p?s.jsx(ce,{onSave:l=>e.useOwnCredentials(l),onCancel:()=>{d(!1),f.current=!0},saving:r.savingCredentials,error:r.credentialsError}):s.jsxs("div",{className:"flex flex-wrap gap-2",children:[o,r.canUseOwnCredentials&&s.jsx(b,{ref:C,variant:"secondary",size:"sm",onClick:()=>d(!0),className:"focus-visible:ring-2",children:"Use your own app credentials"})]})]}),r.step==="connected"&&u&&s.jsx("div",{className:S("mt-1",i),children:u})]})}export{pe as M,he as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var i_=Object.defineProperty;var s_=(r,e,t)=>e in r?i_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jt=(r,e,t)=>s_(r,typeof e!="symbol"?e+"":e,t);import{r as Xc,j as Kc}from"./index-
|
|
1
|
+
var i_=Object.defineProperty;var s_=(r,e,t)=>e in r?i_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jt=(r,e,t)=>s_(r,typeof e!="symbol"?e+"":e,t);import{r as Xc,j as Kc}from"./index-BR1m9FON.js";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-BR1m9FON.js";import{P as m}from"./ProfileFields-DU8dTGHT.js";import"./profile-errors-C1XACbc9.js";import"./use-mounted-ref-IHwyriaF.js";function a({member:r}){return o.jsx(m,{member:r})}export{a as NamePage};
|
package/dist/client/assets/{NewDirectMessageMenu-Dj-Qw8zA.js → NewDirectMessageMenu-CjBjzsDe.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a5 as b,a7 as R,a8 as
|
|
1
|
+
import{a5 as b,a7 as R,a8 as C,aQ as x,dR as P,eZ as j,r as d,j as e,d2 as E,d3 as M,d5 as T,d6 as k,d7 as L,e_ as O,eL as I,I as K,aD as N,B as D,aZ as _,aE as F,by as Q,bz as B,e$ as q,f as z,bA as H,bC as V,f0 as Y}from"./index-BR1m9FON.js";function A(t){return Promise.all([t.invalidateQueries({queryKey:x.lists()}),t.invalidateQueries({queryKey:x.details()}),t.invalidateQueries({queryKey:x.threads()})]).then(()=>{})}function w(t){return(t==null?void 0:t.code)==="SLUG_TAKEN"}function $({isInlineErrorVisible:t}){const a=b(),r=R();return C({mutationFn:({title:n,agentPaths:l})=>a.createRoom({kind:"channel",title:n,members:[],agentPaths:l}),onSuccess:()=>A(r),meta:{suppressErrorToast:!0},onError:n=>{w(n)&&t()||P.error("Couldn’t create that channel.",{description:n.message})}})}function J(){const t=b(),a=R();return C({mutationFn:({agentPaths:r,title:n})=>t.createRoom({kind:"dm",title:n,members:[],agentPaths:r}),onSettled:()=>A(a),meta:{errorLabel:"Couldn’t start that DM"}})}const y=200;function G(){const t=_.getState();t.activeRightPanelTab==="canvas"&&t.setActiveRightPanelTabView(F)}function ee({open:t,onOpenChange:a,onCreated:r}){const n=j(),[l,m]=d.useState(""),h=d.useRef(null),c=d.useRef(null),u=d.useRef(!0);d.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const o=$({isInlineErrorVisible:()=>u.current}),g=w(o.error)?o.error.message:null,f=l.trim(),p=f.length>0&&f.length<=y,v=s=>{!p||o.isPending||o.mutate({title:f,agentPaths:s.map(i=>i.agentPath)},{onSuccess:i=>{a(!1),G(),r(i)}})},S=s=>{var i;s.key==="Enter"&&(s.preventDefault(),p&&((i=c.current)==null||i.focus()))};return e.jsx(E,{open:t,onOpenChange:a,children:e.jsxs(M,{className:"sm:max-w-md",onOpenAutoFocus:s=>{var i;s.preventDefault(),(i=h.current)==null||i.focus()},children:[e.jsxs(T,{children:[e.jsx(k,{children:"New channel"}),e.jsx(L,{children:"Name it, then pick who’s in it."})]}),e.jsxs(O,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{htmlFor:"channel-name",children:"Channel name"}),e.jsx(K,{ref:h,id:"channel-name",value:l,maxLength:y,placeholder:"Backend",autoComplete:"off",onChange:s=>{m(s.target.value),o.error&&o.reset()},onKeyDown:S,"aria-invalid":g?!0:void 0,"aria-describedby":g?"channel-name-error":void 0}),g&&e.jsx("p",{id:"channel-name-error",role:"alert",className:"text-destructive text-xs",children:g})]}),e.jsxs("section",{"aria-label":"Agents in this channel",className:"space-y-2 border-t pt-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Who’s in it"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Agents read everything here and reply when @mentioned."}),e.jsx(N,{roster:n,onSubmit:v,submitLabel:s=>s.length===0?"Create channel":s.length===1?"Create channel with 1 agent":`Create channel with ${s.length} agents`,emptyRosterMessage:"You don’t have any agents yet. You can add them to the channel later.",allChosenMessage:"That’s every agent you have.",isSubmitting:o.isPending,submitDisabled:!p,inputRef:c})]}),e.jsx("div",{className:"flex justify-center border-t pt-3",children:e.jsx(D,{type:"button",variant:"ghost",size:"sm",disabled:!p||o.isPending,onClick:()=>v([]),children:"Create it without agents"})})]})]})})}const Z="One agent opens a chat. Two or more start a group message.";function U(t){return t.length===1}function W(t){const a=t[0];return a!==void 0&&U(t)?`Open chat with ${a.displayName}`:"Start group message"}function te({onStart:t,open:a,onOpenChange:r,hideTrigger:n=!1}){const l=j(),m=d.useRef(null),h=()=>{r(!1),Y.getState().open()};return e.jsxs(Q,{open:a,onOpenChange:r,modal:!0,fullHeight:!0,children:[e.jsx(B,{asChild:!0,children:e.jsx(q,{...n?{"aria-hidden":!0,tabIndex:-1,className:"sr-only"}:{"aria-label":"New message"},children:e.jsx(z,{})})}),e.jsxs(H,{side:"right",align:"start",className:"flex w-64 flex-col p-2","aria-label":"New message",onOpenAutoFocus:c=>{var u;c.preventDefault(),(u=m.current)==null||u.focus()},children:[e.jsx(V,{children:"New message"}),e.jsx(N,{inputRef:m,roster:l,onSubmit:c=>{r(!1),t(c)},submitLabel:W,emptyRosterMessage:"You don’t have any agents yet.",emptyRosterAction:e.jsx(D,{type:"button",size:"sm",variant:"outline",onClick:h,children:"Create agent"}),allChosenMessage:"Everyone is already here."}),e.jsx("p",{className:"text-muted-foreground mt-2 shrink-0 px-2 text-xs",children:Z})]})]})}export{ee as C,te as N,Z as O,U as a,W as o,J as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,w as s}from"./index-
|
|
1
|
+
import{j as t,w as s}from"./index-BR1m9FON.js";function o({member:e}){var n;const i=((n=e.agent)==null?void 0:n.manifestId)??null;return i===null?t.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-notifications",children:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Notifications are set per agent."})}):t.jsx("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-notifications",children:t.jsx(s,{lens:{agentId:i},emptyLabel:`${e.displayName} has not told you anything yet.`})})}export{o as NotificationsPage};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fg as A,r as f,fh as K,fi as T,a5 as p,a6 as _,a7 as m,a8 as v,fj as M,j as d,fk as S,c$ as j,G as R}from"./index-BR1m9FON.js";import{u as w}from"./use-mesh-topology-upehQ5Cv.js";const O={activeWithinMs:3600*1e3,inactiveAfterMs:10080*60*1e3};function P(e){if(e.liveKinds.includes("pendingApproval")||e.liveKinds.includes("error")||e.hasBrokenExecutionConfig===!0)return"needs-attention";if(e.liveKinds.includes("streaming"))return"active";if(e.lastActivityAt===null)return"fresh";if(e.now-e.lastActivityAt<=O.activeWithinMs)return"active";const s=Math.max(e.lastActivityAt,e.lastInteractionAt??e.lastActivityAt);return e.now-s>O.inactiveAfterMs?"inactive":"idle"}function x(e,t,s){var a;const n=new Map;for(const[i,o]of Object.entries(e)){if(!s.has(o))continue;const r=T((a=t[i])==null?void 0:a.lifecycle);if(!r)continue;const c=n.get(o);c?c.push(r):n.set(o,[r])}return n}const q=Object.freeze({});function B(e,t=[],s=q){const n=e.join(`
|
|
2
2
|
`),a=t.join(`
|
|
3
3
|
`),i=A(f.useCallback(u=>u.statusCwds,[])),o=A(f.useCallback(u=>u.statuses,[])),{data:r}=K(),c=r==null?void 0:r.agentActivity;return f.useMemo(()=>{const u=n.length===0?[]:n.split(`
|
|
4
4
|
`),N=new Set(a.length===0?[]:a.split(`
|
|
5
|
-
`)),b=x(i,o,new Set(u)),k=Date.now(),y={};for(const l of u){const g=c==null?void 0:c[l];y[l]=P({liveKinds:b.get(l)??[],lastActivityAt:g?new Date(g).getTime():null,lastInteractionAt:s[l]??null,now:k,hasBrokenExecutionConfig:N.has(l)})}return y},[n,a,i,o,c,s])}function G(e){const t=p();return _({queryKey:["mesh","agent-health",e],queryFn:()=>t.getMeshAgentHealth(e),enabled:e!==null})}const h=["mesh","topology"];function W(){const e=p(),t=m();return v({mutationFn:s=>e.updateMeshAccessRule(s),onSuccess:()=>{t.invalidateQueries({queryKey:h})}})}function E(){const e=p(),t=m();return v({mutationFn:s=>e.updateMeshAccessRule({sourceNamespace:M,targetNamespace:M,action:s?"allow":"deny"}),onMutate:async s=>{await t.cancelQueries({queryKey:h});const n=t.getQueriesData({queryKey:h});return t.setQueriesData({queryKey:h},a=>a&&{...a,openMesh:s}),{previous:n}},onError:(s,n,a)=>{for(const[i,o]of(a==null?void 0:a.previous)??[])t.setQueryData(i,o)},onSettled:()=>{t.invalidateQueries({queryKey:h})}})}const C="Let all my agents talk to each other",L="On: any agent can message any other. Off: same project, plus pairs below.",D="New agents reach only their own project. Change it later in Team → Access.";function H({checked:e,onCheckedChange:t,disabled:s,className:n}){return d.jsx(S,{label:C,description:L,checked:e,onCheckedChange:t,disabled:s,className:n})}function Q({checked:e,onCheckedChange:t,disabled:s,className:n}){return d.jsx(S,{label:C,description:D,checked:e,onCheckedChange:t,disabled:s,className:
|
|
5
|
+
`)),b=x(i,o,new Set(u)),k=Date.now(),y={};for(const l of u){const g=c==null?void 0:c[l];y[l]=P({liveKinds:b.get(l)??[],lastActivityAt:g?new Date(g).getTime():null,lastInteractionAt:s[l]??null,now:k,hasBrokenExecutionConfig:N.has(l)})}return y},[n,a,i,o,c,s])}function G(e){const t=p();return _({queryKey:["mesh","agent-health",e],queryFn:()=>t.getMeshAgentHealth(e),enabled:e!==null})}const h=["mesh","topology"];function W(){const e=p(),t=m();return v({mutationFn:s=>e.updateMeshAccessRule(s),onSuccess:()=>{t.invalidateQueries({queryKey:h})}})}function E(){const e=p(),t=m();return v({mutationFn:s=>e.updateMeshAccessRule({sourceNamespace:M,targetNamespace:M,action:s?"allow":"deny"}),onMutate:async s=>{await t.cancelQueries({queryKey:h});const n=t.getQueriesData({queryKey:h});return t.setQueriesData({queryKey:h},a=>a&&{...a,openMesh:s}),{previous:n}},onError:(s,n,a)=>{for(const[i,o]of(a==null?void 0:a.previous)??[])t.setQueryData(i,o)},onSettled:()=>{t.invalidateQueries({queryKey:h})}})}const C="Let all my agents talk to each other",L="On: any agent can message any other. Off: same project, plus pairs below.",D="New agents reach only their own project. Change it later in Team → Access.";function H({checked:e,onCheckedChange:t,disabled:s,className:n}){return d.jsx(S,{label:C,description:L,checked:e,onCheckedChange:t,disabled:s,className:n})}function Q({checked:e,onCheckedChange:t,disabled:s,className:n}){return d.jsx(S,{label:C,description:D,checked:e,onCheckedChange:t,disabled:s,className:R("bg-muted/40 rounded-xl px-4 py-3",n)})}function Y(){const{data:e}=w(),{mutate:t,isPending:s}=E();return d.jsx(H,{checked:(e==null?void 0:e.openMesh)??!1,onCheckedChange:t,disabled:s})}function z({className:e}){const{data:t}=w(),{data:s}=j(),{mutate:n,isPending:a}=E(),i=((s==null?void 0:s.agents)??[]).filter(o=>!o.isSystem).length;return(t==null?void 0:t.openMesh)!==!1||i===0?null:d.jsx(Q,{checked:!1,onCheckedChange:n,disabled:a,className:e})}export{Y as O,W as a,G as b,z as c,B as u};
|
package/dist/client/assets/{OperatorIdentityForm-Bz5570RF.js → OperatorIdentityForm-B7S2C_eT.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bk as j,fS as F,fT as H,aZ as x,r as g,ch as P,cl as B,ct as w,fU as G,a5 as D,a6 as K,c6 as M,c1 as Y,fV as q,z,bl as W,j as i,eL as N,I as R,B as A}from"./index-BR1m9FON.js";import{d as U,c as V,n as Q,h as Z}from"./profile-errors-C1XACbc9.js";import{u as J}from"./use-mounted-ref-IHwyriaF.js";import{u as L,F as k}from"./ProfileFields-DU8dTGHT.js";function X(e){return{name:e.displayName.trim()===""||e.displayName===j,handle:!e.handle}}function de(e){const r=X(e);return r.name||r.handle}function $(e,r){var t,s,d;const a=(d=(s=(t=e.person)==null?void 0:t.email)==null?void 0:s.split("@")[0])==null?void 0:d.trim();if(!a)return"";const o=new Set([...F,...r.filter(l=>l.id!==e.id&&l.handle).map(l=>l.handle.toLowerCase())]);return H(a,o)??""}function ue(){const e=x(a=>a.setRightPanelOpen),r=x(a=>a.setActiveRightPanelTab);g.useEffect(()=>{const a=o=>{if((o.metaKey||o.ctrlKey)&&o.shiftKey&&o.key==="A"){o.preventDefault();const{rightPanelOpen:t,activeRightPanelTab:s}=x.getState();t&&s===P?e(!1):(r(P),e(!0))}};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,r])}const ee="agent-hub",te={sessions:"sessions",tasks:"tasks",tools:"tools",channels:"rooms",config:null,toolkit:null,identity:null,overview:null,profile:null,personality:null};function ae(e){return(typeof e=="string"?te[e]:null)??void 0}const I=new Set(["identity","personality","channels","tools"]);function ne(){var n;const e=w(),r=D(),a=K({queryKey:["profile-location",e.profileRef],queryFn:()=>r.getSessionLocation(e.profileRef),enabled:!!e.profileRef}),o=M(m=>m.openProfileDockedFromLink),t=x(m=>m.requestRightPanel),s=x(m=>m.setExplicitAgentPath),d=Y(),l=e.panel===P,c=e.agentPath??((n=a.data)==null?void 0:n.cwd)??null,u=q(e.profilePage)??void 0,h=g.useRef(null);g.useEffect(()=>{!l&&c&&h.current!==c&&(h.current=c,s(c))},[l,c,s]);const f=g.useRef(new Map);g.useEffect(()=>{if(!l){f.current.clear();return}if(e.profileRef&&!c)return;const m=c??d;if(m){const p=f.current.get(m);if(p!==void 0&&(u===void 0||p.has(u)))return;f.current.set(m,(p??new Set).add(u??"")),o(m,u);return}t(P,null)},[l,e.profileRef,c,d,u,o,t])}function se(){const e=w(),r=G(),a=D(),o=e.panel===ee,t=e.dialog==="agent"||!!e.agent&&I.has(e.agent),s=o||t,d=o?e.hubTab:e.agent;g.useEffect(()=>{if(!s&&!e.agentPath||!r)return;let l=!1;return(async()=>{const u=e.profileRef??(e.agentPath?(await a.createSessionLocation(e.agentPath)).id:void 0);if(l)return;const h=ae(d);r({search:f=>{const n={...f};return e.dialog==="agent"&&delete n.dialog,typeof n.agent=="string"&&I.has(n.agent)&&delete n.agent,u&&(n.profileRef=u,delete n.agentPath),s&&(delete n.hubTab,n.panel=P,h?n.profilePage=h:delete n.profilePage),n},replace:!0})})().catch(()=>{}),()=>{l=!0}},[s,e.dialog,e.agentPath,e.profileRef,d,r,a])}function fe(){se(),ne(),B()}function re(){var E,b;const r=((E=z().data)==null?void 0:E.members)??[],a=r.find(y=>y.isSelf),o=J(),t=U({isShownInline:()=>o.current}),s=V({isShownInline:()=>o.current}),[d,l]=g.useState(!1),c=!a||a.displayName===j?"":a.displayName,u=(a==null?void 0:a.handle)??"",[h,f]=L(c),[n,m]=L(a?u||$(a,r):""),p=h.trim(),v=n.trim(),S=a?W(a):null,T=p.length>0&&(p!==c||S!==null),C=t.isError&&t.variables===p?Q(t.error):null,O=s.isError&&((b=s.variables)==null?void 0:b.handle)===v?Z(s.error,v):null,_=async()=>{if(!a)return!1;l(!0);let y=!0;return T&&(y=await t.mutateAsync(p).then(()=>y,()=>!1)),v&&v!==u&&(y=await s.mutateAsync({authorId:a.id,handle:v}).then(()=>y,()=>!1)),l(!1),y};return{ready:a!==void 0,name:h,setName:f,handle:n,setHandle:m,canSave:a!==void 0&&!d&&(p.length>0||v.length>0),saving:d,nameError:C,nameSuggestion:S!==null&&p===c?S:null,handleError:O,save:_}}function he({onSaved:e,confirmLabel:r="Save",onSkip:a,skipLabel:o="Skip"}){const t=re(),s=g.useId(),d=g.useId(),l=g.useId(),c=f=>{f.preventDefault(),t.canSave&&t.save().then(n=>{n&&e()})},u=t.nameError!==null||t.handleError!==null;let h=r;return t.saving?h="Saving…":u&&(h="Try again"),i.jsxs("form",{onSubmit:c,className:"flex flex-col gap-3","data-testid":"operator-identity-form",children:[i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(N,{htmlFor:s,className:"text-xs",children:"Your name"}),i.jsx(R,{id:s,value:t.name,maxLength:80,autoComplete:"name",placeholder:"What you go by",disabled:!t.ready,onChange:f=>t.setName(f.target.value),className:"h-8 text-sm"}),t.nameSuggestion&&!t.nameError&&i.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.nameSuggestion,". Save it to make it yours."]}),t.nameError&&i.jsx(k,{tone:"error",children:t.nameError})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(N,{htmlFor:d,className:"text-xs",children:"Handle"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{"aria-hidden":!0,className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-sm",children:"@"}),i.jsx(R,{id:d,value:t.handle,maxLength:64,autoComplete:"username",autoCapitalize:"none",spellCheck:!1,placeholder:"yourname","aria-describedby":l,disabled:!t.ready,onChange:f=>t.setHandle(f.target.value),className:"h-8 pl-6 text-sm"})]}),i.jsx("p",{id:l,className:"text-muted-foreground text-xs",children:"What others type after @ to reach you."}),t.handleError&&i.jsx(k,{tone:"error",children:t.handleError})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(A,{type:"submit",size:"sm",disabled:!t.canSave,"data-testid":"confirm-identity",children:h}),a&&i.jsx(A,{type:"button",size:"sm",variant:"ghost",onClick:a,disabled:t.saving,"data-testid":"skip-identity",children:o})]})]})}export{he as O,ne as a,fe as b,ue as c,de as i,se as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s,eH as A,eI as P,G as k,gz as X,a5 as E,a6 as q,gZ as R,r as N,a7 as Y,a8 as ee,aJ as se,bb as te,B as x,i2 as v,by as W,bz as U,C as L,bA as D,bC as H,U as ne,h2 as M,e as C,b9 as ae,i3 as ie,i4 as le,i5 as re}from"./index-BR1m9FON.js";import{u as y,c as oe,a as p,l as _,S as f,P as b,s as z,d as T,r as j,f as $,b as B,e as S,g as de,A as ce}from"./ApplyToOverridesDialog-CnL1ubxL.js";import{s as g,C as w,T as K}from"./trust-dial-D__tIhzt.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(X,"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=Y();return ee({mutationFn:({eventId:n,force:a})=>e.undoPermissionChange(n,a?{force:!0}:{}),meta:{suppressErrorToast:!0},onSettled:()=>{t.invalidateQueries({queryKey:R.all}),t.invalidateQueries({queryKey:["mesh","agents"]}),t.invalidateQueries({queryKey:se.all})}})}function F(e){const{data:t}=y();return t?oe(t,e):void 0}function V({areaId:e,label:t,description:n,floor:a,value:l,sourceText:o,why:d,changed:i=!1,onChange:m,onReset:r,disabled:u=!1,footer:c,details:h}){return s.jsxs("div",{className:"@container","data-testid":`permission-row-${e}`,children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[i?s.jsx("span",{className:"bg-primary size-1.5 shrink-0 rounded-full","aria-label":"Set differently for this agent",role:"img"}):null,s.jsx("span",{className:"text-sm font-medium",children:t}),a?s.jsx(te,{className:"text-muted-foreground size-3.5","aria-label":"Never Allowed"}):null]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:n}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:o}),d?s.jsxs(s.Fragment,{children:[o?" · ":null,d]}):null]})]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(Q,{value:l,onChange:m,floor:a,disabled:u,"aria-label":t}),i&&r?s.jsxs(x,{variant:"ghost",size:"sm",className:"self-start @lg:self-end",onClick:r,disabled:u,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset to default"]}):null,c]})]}),h]})}function ge({area:e,exception:t}){const n=p({kind:"agent",agentId:t.agentId}),a=()=>n.mutate({kind:"patch",...t.action?{actions:{[t.action]:null}}:{areas:{[e]:null}},surface:"settings"}),l=_(t.lastChange);return s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"min-w-0 text-sm",children:[s.jsxs("span",{className:"block break-words",children:[t.agentName,": ",f[t.state],t.action?" (one action)":""]}),l?s.jsx("span",{className:"text-muted-foreground block text-xs",children:l}):null]}),s.jsxs(x,{variant:"ghost",size:"sm",onClick:a,disabled:n.isPending,"aria-label":`Reset ${t.agentName} to the default`,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]})]})}function pe({area:e,areaLabel:t,agents:n}){if(n.length===0)return null;const a=n.length===1?"1 agent differs":`${n.length} agents differ`;return s.jsxs(W,{children:[s.jsx(U,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start md:self-end",children:[a,s.jsx(L,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsxs(H,{className:"text-sm font-medium",children:["Set differently for ",t]}),s.jsx("ul",{className:"space-y-1",children:n.map(l=>s.jsx(ge,{area:e,exception:l},l.agentId))})]})]})}function G(e,t){return e.resolved.source===(t.kind==="agent"?"agent-action":"default-action")}function J({action:e,preset:t,agentName:n}){const a=f[e.resolved.state];return s.jsx(b,{question:`Why is ${e.title} set to ${a}${n?` for ${n}`:""}?`,sentence:z({...e.resolved,preset:t,fromExtension:e.source!==void 0}),...e.lastChange?{lastChange:e.lastChange}:{}})}function je({action:e,area:t,scope:n,preset:a,agentName:l,disabled:o,reset:d,onSave:i}){const m=G(e,n),r=F({kind:"action",action:e.id,area:t.id}),u=m?"Set on its own":e.alwaysAsks?e.source?"Always asks: an extension tool that can delete things":"Always asks, so you see the change first":e.resolved.destructiveAsk?"Always asks unless you set it here":`Follows ${t.label}`,c=n.kind==="default"&&r!==void 0?T(r):null;return s.jsxs("li",{className:"flex flex-col gap-2 py-2 @md:flex-row @md:items-center @md:justify-between","data-testid":`permission-action-${e.id}`,children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm",children:e.title}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.source?s.jsxs("span",{children:["From ",e.source.name," · "]}):null,s.jsx("span",{children:u}),c?s.jsxs("span",{children:[" · ",c]}):null," ·"," ",s.jsx(J,{action:e,preset:a,...l?{agentName:l}:{}})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[m?d:null,s.jsx(Q,{value:e.resolved.state,floor:t.floor||e.alwaysAsks===!0,disabled:o,"aria-label":e.title,onChange:h=>{h!==e.resolved.state&&i(h)}})]})]})}function Z({scope:e,area:t,surface:n,preset:a,agentName:l}){const o=p(e),[d,i]=N.useState(!1);if(t.actions.length===0)return null;const m=t.actions.filter(c=>G(c,e)),r=(c,h)=>o.mutate({kind:"patch",actions:{[c.id]:h},surface:n},{onError:j}),u=c=>s.jsxs(x,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs",disabled:o.isPending,"aria-label":`Put ${c.title} back to ${t.label}`,onClick:()=>r(c,null),children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]});return s.jsxs("div",{className:"flex flex-col items-start gap-1 pb-3","data-testid":`permission-actions-${t.id}`,children:[!d&&m.length>0?s.jsx("ul",{className:"w-full space-y-1","data-testid":`permission-action-exceptions-${t.id}`,children:m.map(c=>s.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:"text-muted-foreground min-w-0",children:[s.jsxs("span",{children:["Except ",c.title,": ",f[c.resolved.state]]})," ","·"," ",s.jsx(J,{action:c,preset:a,...l?{agentName:l}:{}})]}),u(c)]},c.id))}):null,s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground -ml-2 h-7 px-2 text-xs","aria-expanded":d,onClick:()=>i(c=>!c),children:[s.jsx(ne,{className:k("size-3.5 transition-transform",d&&"rotate-180"),"aria-hidden":!0}),d?"Hide individual actions":"Show individual actions"]}),d?s.jsx("ul",{className:"divide-border w-full divide-y","aria-label":`${t.label} actions`,children:t.actions.map(c=>s.jsx(je,{action:c,area:t,scope:e,preset:a,...l?{agentName:l}:{},disabled:o.isPending,reset:u(c),onSave:h=>r(c,h)},c.id))}):null]})}function Ne({agentId:e,agentName:t,files:n}){const a=p({kind:"agent",agentId:e}),l=n.source==="agent",o=n.inherited.stop,d=n.stop,i=r=>a.mutate({kind:"patch",filesAndCommands:r,surface:"agent-page"},{onError:j}),m=o?`${l?`Everyone else: ${g(o)}`:`Same as everyone (${g(o)})`}${n.inherited.source==="runtime"?` · ${$("runtime")}`:""}`:$(n.inherited.source);return s.jsxs("div",{className:"@container","data-testid":"permission-row-files",children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[l?s.jsx("span",{className:"bg-primary size-1.5 shrink-0 rounded-full","aria-label":"Set differently for this agent",role:"img"}):null,s.jsx("span",{className:"text-sm font-medium",children:"Files & commands"})]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Editing files and running commands in this agent’s chats"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:m})," ·"," ",s.jsx(b,{question:`Why is Files & commands ${d?`set to ${g(d)}`:"not set"} for ${t}?`,sentence:B(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(K,{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(M,{descriptor:w.find(r=>r.stop===d),className:"pb-3"})]})}function ze({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:B(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(K,{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(M,{descriptor:w.find(i=>i.stop===e.stop),className:"pb-3"})]})}function ve({agent:e}){const t=p({kind:"agent",agentId:e.agentId}),n=_(e.lastChange);return s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"min-w-0 text-sm",children:[s.jsxs("span",{className:"block break-words",children:[e.agentName,": ",g(e.stop)]}),n?s.jsx("span",{className:"text-muted-foreground block text-xs",children:n}):null]}),s.jsxs(x,{variant:"ghost",size:"sm",disabled:t.isPending,"aria-label":`Reset ${e.agentName} to the default`,onClick:()=>t.mutate({kind:"patch",filesAndCommands:null,surface:"settings"},{onError:j}),children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]})]})}function be({agents:e}){return e.length===0?null:s.jsxs(W,{children:[s.jsx(U,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start @lg:self-end",children:[e.length===1?"1 agent differs":`${e.length} agents differ`,s.jsx(L,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsx(H,{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(Z,{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(Z,{scope:{kind:"agent",agentId:e},area:n,surface:"agent-page",preset:a,agentName:t})})}function Te({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 Fe({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{ze as D,Te as P,Fe as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as n,j as s}from"./index-BR1m9FON.js";import{P as a,a as m}from"./PermissionHistory-D0chstxf.js";import{R as r}from"./ApplyToOverridesDialog-CnL1ubxL.js";import"./trust-dial-D__tIhzt.js";import"./zap-DSllMMHe.js";function x({member:t}){var o;const e=n((o=t.agent)==null?void 0:o.runtime),i=(e==null?void 0:e.supportsMcp)??!0;return s.jsxs("div",{className:"space-y-6",children:[i?null:s.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent can’t use DorkOS tools, so these don’t apply."}),s.jsx(a,{scope:{kind:"agent",agentId:t.id}}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:[r[0]," ",r[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{x as PermissionsPage};
|
package/dist/client/assets/{PersonalityPopover-Do-k_Hhw.js → PersonalityPopover-BvMtUQRM.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-BR1m9FON.js";import{u as m,P as p}from"./use-personality-commit-Chf3UX8P.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-CbX7rNqz.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-BR1m9FON.js";import{b as t}from"./ProfileFields-DU8dTGHT.js";import"./profile-errors-C1XACbc9.js";import"./use-mounted-ref-IHwyriaF.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
|
package/dist/client/assets/{PreviewRefusedNotice-B-yyzQZP.js → PreviewRefusedNotice-DzbkMrUo.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e0 as o,e1 as u,e2 as d,a5 as l,a6 as f,ac as h,j as n}from"./index-BR1m9FON.js";import{S as p}from"./shield-x-CEWfkzDN.js";const m={default:!1,plan:!1,acceptEdits:!1,dontAsk:!0,bypassPermissions:!0,auto:!0};function v(e){return m[e]??!1}function x(e){try{return d.toString(e)}catch{return`On the schedule ${e}`}}function w(e){const s=e.cron?x(e.cron):"Runs only when you ask",t=o(e.startsEnabled);return`${s}, ${t}. This job ${u(e.permissionMode)}.`}function g(e,s){const t=l(),{enabled:r=!0,...a}=s??{},i=Object.keys(a).length>0;return f({queryKey:h.permissionPreview(e??"",i?a:void 0),queryFn:()=>t.previewMarketplacePackage(e,i?a:void 0),enabled:r&&e!==null,staleTime:3e4,networkMode:"always"})}function c(e){const s=e==null?void 0:e.body,t=Array.isArray(s==null?void 0:s.errors)?s.errors.filter(r=>typeof r=="string"):[];return t.length>0?{reasons:t,checked:!0}:{reasons:e instanceof Error&&e.message?[e.message]:[],checked:!1}}function b(e){return c(e).checked}function j({error:e}){const{reasons:s,checked:t}=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(p,{className:"size-4 shrink-0","aria-hidden":!0}),"DorkOS won’t install this package"]}),n.jsx("p",{className:"text-muted-foreground text-xs",children:t?"What it found:":"It couldn’t check what this package does."}),s.length>0&&n.jsx("ul",{className:"text-muted-foreground list-disc space-y-1 pl-5 text-xs [overflow-wrap:anywhere]",children:s.map(r=>n.jsx("li",{children:r},r))})]})}export{j as P,w as d,b as i,v as r,g as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,t as E,j as e,
|
|
1
|
+
import{r as p,t as E,j as e,bh as m,bi as g,bj as x,g as y,B as u,I as f,bk as j,bl as b}from"./index-BR1m9FON.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-C1XACbc9.js";import{u as N}from"./use-mounted-ref-IHwyriaF.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-33Xkwoc3.js → ProfilePanelContainer-BfT-ufV7.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f,j as t,
|
|
1
|
+
import{r as f,j as t,bh as D,bi as R,bj as E,ew as H,ex as M,ey as _,ez as A,eA as Z,G as V,I as v,B as P,z as B}from"./index-BR1m9FON.js";import{F as j,b as K,P as Y,a as $,c as G}from"./ProfileFields-DU8dTGHT.js";import{u as I,P as q,b as J}from"./ProfileRolePicker-DrOtV-0N.js";function U(e,s){if(e.length!==s.length)return!1;const n=new Set(s);return e.every(r=>n.has(r))}function Q(){const{roles:e,isLoading:s,saveRoles:n}=I(),[r,i]=f.useState(e),[l,o]=f.useState(e),[d,u]=f.useState("idle"),[x,m]=f.useState(null);!s&&!U(l,e)&&(o(e),i(e));const h=()=>{u("saving"),n(r).then(()=>{u("idle"),m(r)}).catch(()=>u("error"))};return t.jsx(D,{children:t.jsxs(R,{className:"space-y-3",children:[t.jsx(E,{label:"What kind of work you do",description:"Only DorkBot and your agents read this. It stays on this machine.",orientation:"vertical",children:t.jsx(q,{selected:r,onChange:i,onConfirm:h,confirmLabel:d==="saving"?"Saving…":"Save",busy:d==="saving"||s})}),d==="error"&&t.jsx(j,{tone:"error",children:"Couldn’t save that. Try again."}),d!=="error"&&x&&U(r,x)&&t.jsx(j,{tone:"ok",children:"Saved."})]})})}const X=Object.freeze({days:[1,2,3,4,5],start:"09:00",end:"17:00"});function ee(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}const k=new Map;function te(e){let s=k.get(e);return s||(s=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",weekday:"short"}),k.set(e,s)),s}const ne={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};function w(e,s){const n={};for(const r of te(s).formatToParts(new Date(e)))n[r.type]=r.value;return{year:Number(n.year),month:Number(n.month),day:Number(n.day),hour:Number(n.hour),minute:Number(n.minute),second:Number(n.second),weekday:ne[n.weekday??""]??0}}function z(e,s){const n=w(e,s);return Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second)-Math.floor(e/1e3)*1e3}function se(e){const[s,n]=e.split(":").map(Number);return(s??0)*60+(n??0)}function ae(e,s,n,r,i){const l=se(r),o=Date.UTC(e,s-1,n,Math.floor(l/60),l%60),d=o-z(o-864e5,i),u=o-z(o+864e5,i),x=h=>{const y=w(h,i);return y.year===e&&y.month===s&&y.day===n&&y.hour*60+y.minute===l},m=[d,u].filter(x);return m.length>0?Math.min(...m):Math.max(d,u)}function re(e,s,n){const[r,i,l]=e.split("-").map(Number);return new Date(ae(r??1970,i??1,l??1,s,n))}function oe(e,s){const n=w(e.getTime(),s);return`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")}`}const ie=[{day:1,short:"M",name:"Monday"},{day:2,short:"T",name:"Tuesday"},{day:3,short:"W",name:"Wednesday"},{day:4,short:"T",name:"Thursday"},{day:5,short:"F",name:"Friday"},{day:6,short:"S",name:"Saturday"},{day:0,short:"S",name:"Sunday"}];function le(e){const s=typeof Intl.supportedValuesOf=="function"?Intl.supportedValuesOf("timeZone"):[];return s.includes(e)?s:[e,...s]}function de(e,s,n){const r=e??J()??ee(),i=s??X;return{timezone:r,days:[...i.days],start:i.start,end:i.end,awayUntil:n!=null&&n.until?oe(new Date(n.until),r):""}}function b(e,s){return e.timezone===s.timezone&&e.start===s.start&&e.end===s.end&&e.awayUntil===s.awayUntil&&[...e.days].sort().join()===[...s.days].sort().join()}function ue(e){return e.days.length===0?"Pick at least one working day.":!e.start||!e.end?"Set a start and an end time.":e.end<=e.start?"The day has to end after it starts.":null}function ce(e,s,n){return e.awayUntil===s.awayUntil?n:e.awayUntil?{...n,until:re(e.awayUntil,"00:00",e.timezone).toISOString()}:null}function me(){const{timezone:e,workingHours:s,away:n,isLoading:r,saveHours:i}=I(),l=de(e,s,n),[o,d]=f.useState(l),[u,x]=f.useState(l),[m,h]=f.useState("idle"),[y,C]=f.useState(null),[F,O]=f.useState(null);!r&&!b(u,l)&&(x(l),d(l));const p=ue(o),g=a=>d(c=>({...c,...a})),W=a=>g({days:o.days.includes(a)?o.days.filter(c=>c!==a):[...o.days,a]}),L=()=>{if(p)return;h("saving");const a=o;i({timezone:a.timezone,workingHours:{days:[...a.days].sort((c,S)=>c-S),start:a.start,end:a.end},away:ce(a,u,n)}).then(()=>{h("idle"),C(null),O(a)}).catch(c=>{h("error"),C(c instanceof Error?c.message:null)})};return t.jsx(D,{children:t.jsxs(R,{className:"space-y-4",children:[t.jsx(E,{label:"Your hours",description:"Your time zone and working hours.",orientation:"vertical",children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("label",{htmlFor:"profile-timezone",className:"text-muted-foreground text-xs",children:"Time zone"}),t.jsxs(H,{value:o.timezone,onValueChange:a=>g({timezone:a}),children:[t.jsx(M,{id:"profile-timezone",className:"h-8 text-sm",responsive:!1,children:t.jsx(_,{})}),t.jsx(A,{children:le(o.timezone).map(a=>t.jsx(Z,{value:a,responsive:!1,children:a.replace(/_/g," ")},a))})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{id:"profile-days-label",className:"text-muted-foreground text-xs",children:"Working days"}),t.jsx("div",{role:"group","aria-labelledby":"profile-days-label",className:"flex gap-1",children:ie.map(({day:a,short:c,name:S})=>{const T=o.days.includes(a);return t.jsx("button",{type:"button","aria-label":S,"aria-pressed":T,onClick:()=>W(a),className:V("size-8 rounded-md border text-xs font-medium",T?"bg-primary text-primary-foreground border-transparent":"text-muted-foreground hover:bg-accent"),children:c},a)})})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"flex-1 space-y-1",children:[t.jsx("label",{htmlFor:"profile-hours-start",className:"text-muted-foreground text-xs",children:"Start"}),t.jsx(v,{id:"profile-hours-start",type:"time",value:o.start,onChange:a=>g({start:a.target.value})})]}),t.jsxs("div",{className:"flex-1 space-y-1",children:[t.jsx("label",{htmlFor:"profile-hours-end",className:"text-muted-foreground text-xs",children:"End"}),t.jsx(v,{id:"profile-hours-end",type:"time",value:o.end,onChange:a=>g({end:a.target.value})})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("label",{htmlFor:"profile-away-until",className:"text-muted-foreground text-xs",children:"Away until"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(v,{id:"profile-away-until",type:"date",value:o.awayUntil,onChange:a=>g({awayUntil:a.target.value})}),o.awayUntil&&t.jsx(P,{type:"button",variant:"ghost",size:"sm",onClick:()=>g({awayUntil:""}),children:"Clear"})]})]})]})}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(P,{type:"button",size:"sm",onClick:L,disabled:r||m==="saving"||p!==null||b(o,u),children:m==="saving"?"Saving…":"Save"}),p&&t.jsx(j,{tone:"error",children:p}),!p&&m==="error"&&t.jsx(j,{tone:"error",children:y??"Couldn’t save that. Try again."}),!p&&m!=="error"&&F&&b(o,F)&&t.jsx(j,{tone:"ok",children:"Saved."})]})]})})}function fe({member:e}){return t.jsxs("div",{className:"space-y-4",children:[t.jsx("p",{className:"text-muted-foreground text-sm",children:"How you appear on your team page, in rooms and beside your messages."}),t.jsx(K,{member:e}),t.jsx(Y,{member:e}),t.jsx($,{member:e}),t.jsx(G,{member:e}),t.jsx(Q,{}),t.jsx(me,{})]})}function N({children:e}){return t.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:e})}function pe(){var n;const e=B(),s=(n=e.data)==null?void 0:n.members.find(r=>r.isSelf);return e.isPending?t.jsx(N,{children:"Loading your profile…"}):e.isError?t.jsx(N,{children:"Couldn’t load your profile. Reopen this tab to try again."}):s?t.jsx(fe,{member:s}):t.jsx(N,{children:"Couldn’t find your profile. Reopen this tab to try again."})}export{fe as P,pe as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a5 as O,a7 as E,a6 as I,aJ as h,a8 as j,aI as D,
|
|
1
|
+
import{a5 as O,a7 as E,a6 as I,aJ as h,a8 as j,aI as D,f1 as S,r as b,j as l,G as z,I as q,B as k}from"./index-BR1m9FON.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"}],M=6,F={developer:"software-development",engineer:"software-development",programmer:"software-development",coder:"software-development","software engineer":"software-development",recruiter:"hiring",recruiting:"hiring",talent:"hiring",marketer:"marketing",growth:"marketing",writer:"writing",author:"writing",researcher:"research",scientist:"research",founder:"business-ops",entrepreneur:"business-ops",operations:"business-ops",ops:"business-ops",designer:"design",seller:"sales",salesperson:"sales"};function H(r){var i;const s=r.trim().toLowerCase();if(s.length===0)return;const e=w.find(a=>a.id===s);if(e)return e.id;const o=F[s];return o||((i=w.find(a=>a.label.toLowerCase()===s))==null?void 0:i.id)}const A=10,N=60;function v(r,s){const e=s.trim().toLowerCase();return r.some(o=>o.trim().toLowerCase()===e)}function W({selected:r,onChange:s,onConfirm:e,confirmLabel:o,onSkip:i,skipLabel:a,busy:d=!1,error:c=null}){const[m,g]=b.useState(!1),[p,u]=b.useState(""),C=b.useRef(null),y=w.slice(0,M),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=H(t),R=n&&y.some(_=>_.id===n)?n:t;!v(r,R)&&r.length<A&&s([...r,R]),u("")};return l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"group","aria-label":"What kind of work you do",children:[y.map(t=>{const n=v(r,t.id);return l.jsx("button",{type:"button","aria-pressed":n,disabled:f&&!n,onClick:()=>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-v5MScpZF.js → PromptSuggestionChips-CEnhme_V.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,_ as c,aR as l,G as i}from"./index-
|
|
1
|
+
import{j as e,_ as c,aR as l,G as i}from"./index-BR1m9FON.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-BR1m9FON.js";import{u as Y}from"./use-mounted-ref-IHwyriaF.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{a5 as he,a8 as pe,a7 as Ke,jy as Ge,jz as le,jA as je,jB as Ue,jC as Xe,jD as Ye,aQ as Qe,r as n,j as t,G as ae,B as ge,x as Ve,a_ as we,jE as Ze,e as se,gF as Ee,hp as Je,gE as Pe,jF as et,jG as tt,_ as xe,jH as _e,jI as Le,C as nt,n as st,gI as Z,dS as ot,fN as rt,jJ as at,jK as it,jL as dt,cA as lt,jM as ut,jN as ct,jO as ft,jP as mt,cw as ht,jQ as pt,gD as te,jR as gt,l as xt,s as ke,jS as vt,jT as Rt,en as yt,X as bt,ek as jt,jU as wt,jV as Ne,jW as kt,af as Nt,jX as It,gC as At,gB as St,jY as Ct,aG as Ie,Z as Mt}from"./index-BwTGkJbK.js";import{P as Tt,u as Ot}from"./pane-resize-handle-gBlb5k1v.js";import{D as Et,U as Pt,u as _t}from"./UnreadDivider-DhyK6uGG.js";import{u as Lt}from"./use-room-follow-claim-Dwke6RFQ.js";import{i as Dt,a as ve,e as Re,g as Ft,f as De,h as zt,j as Fe,c as V,d as oe,k as Ht,l as ce,b as fe,m as me,A as ze,n as He,t as ye,r as $t,o as re,R as be,u as $e,C as qe,p as qt}from"./ChannelComposer-BAg0a29Q.js";import{u as Wt,f as Bt,a as Kt,F as Gt,C as J,d as Ut,M as Xt}from"./registry-BQTcAm5U.js";import{u as Yt}from"./use-connector-management-C3CLnOOt.js";import{A as Qt}from"./AgentRequestCard-kNq5A_IN.js";import{u as Vt}from"./use-room-sessions-iepVrIMm.js";function Zt(){const e=he();return pe({mutationFn:({roomId:s,authorId:o})=>e.haltRoomAgent(s,o),meta:{errorLabel:"Couldn’t stop this agent"}})}function Jt(){const e=he();return pe({mutationFn:({roomId:s,authorId:o})=>e.promoteHold(s,o),meta:{errorLabel:"Couldn’t ask to be answered first"}})}function en(e){const s=he(),o=Ke(),a=Ge(e),b=le(m=>{var f;return e===null?null:((f=m.paging[e])==null?void 0:f.cursor)??null}),r=pe({mutationFn:async m=>{var g;const f=(g=le.getState().paging[m])==null?void 0:g.cursor;if(f==null)return;const j=await s.listRoomEntries(m,{before:f,limit:je}),k=Qe.entries(m),I=o.getQueryData(k),A=Ue(I,j);o.setQueryData(k,A),le.getState().notePage(m,Xe(j)??f,Ye(j,je)||A.length===((I==null?void 0:I.length)??0))},meta:{errorLabel:"Couldn't load older messages"}}),{mutateAsync:i,isPending:p}=r,v=n.useRef(!1),h=n.useCallback(async()=>{if(!(e===null||v.current)){v.current=!0;try{await i(e).catch(()=>{})}finally{v.current=!1}}},[e,i]);return{canLoadOlder:a,isLoadingOlder:p,cursor:b,loadOlder:h}}function tn({id:e,summary:s,open:o,onOpen:a,endsGroup:b}){const{capabilities:r}=Wt(),{count:i,lastAt:p,unread:v}=s,h=Bt(p),[m,f]=n.useState({count:i,bumped:!1});m.count!==i&&f({count:i,bumped:!0});const j=m.count===i&&m.bumped;return r.threads?t.jsx("button",{type:"button",id:e,"data-slot":"thread-reply-row","data-testid":"room-thread-replies","data-unread":v>0?"":void 0,"aria-expanded":o,onClick:a,className:ae("focus-ring ml-[calc(var(--msg-padding-x)_+_var(--msg-gutter-width)_+_var(--msg-gap))]","hover:bg-row-hover flex w-fit items-center rounded-md text-left text-xs transition-colors",b===void 0?"mb-1":"mt-2",b===!0&&"mb-[var(--msg-padding-y-end)]",b===!1&&"mb-1","h-11 px-2 md:h-7",v>0?"text-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:t.jsxs("span",{children:[t.jsx("span",{"aria-hidden":!0,className:"mr-1",children:"↳"}),t.jsx("span",{className:ae(j&&"motion-safe:animate-count-flip"),"data-testid":"room-thread-reply-count",children:i},i),i===1?" reply":" replies",h.length>0&&t.jsxs(t.Fragment,{children:[" · last ",t.jsx("time",{dateTime:p,title:Kt(p),children:h})]}),v>0&&` · ${v} new`]})}):null}const nn=3;function sn(e,s){const o=[],a=new Map,b=new Map;let r=0;for(;r<e.length;){const i=r;for(;r<e.length&&e[r].kind==="notice";)r++;const p=e.slice(i,r);if(p.length===0){o.push(e[r]),r++;continue}const v=p[p.length-1],h=p.filter(g=>g!==v&&!Dt(g.body.notice));if(p.length<nn||h.length===0){o.push(...p);continue}const m=p[0].id,f=s.has(m),j={runId:m,count:h.length,expanded:f},k=new Set(h);for(const g of h)b.set(g.id,m);if(f){a.set(p[0].id,j),o.push(...p);continue}const I=p.findIndex(g=>k.has(g)),A=p.slice(I).find(g=>!k.has(g));a.set(A.id,j),o.push(...p.filter(g=>!k.has(g)))}return{visible:o,foldBefore:a,runOf:b}}function on({loading:e,onLoad:s}){return t.jsx("div",{className:"flex justify-center px-4 py-3",children:t.jsxs(ge,{type:"button",variant:"ghost",size:"sm",onClick:s,disabled:e,"data-testid":"room-load-older",className:"text-muted-foreground hover:text-foreground h-7 gap-2 text-xs",children:[e&&t.jsx(Ve,{size:"xs"}),e?"Loading older messages…":"Older messages"]})})}const rn="ROOM.md";function an(e){return e==null?void 0:e.find(s=>s.pinned&&s.content.type==="file"&&s.content.sourcePath===rn)}function dn({roomId:e}){const s=we(a=>an(a.roomCanvasDocuments[e]));if(!s)return null;const o=()=>{const a=we.getState();a.activateRoomCanvasDocument(e,s.id),Ze(a,"user")};return t.jsxs("p",{className:"max-w-sm text-xs","data-testid":"room-md-hint",children:["This channel has a ROOM.md for its goal and rules."," ",t.jsx("button",{type:"button",onClick:o,className:"text-foreground focus-ring rounded-sm underline underline-offset-2",children:"Open"})]})}const ln="room-load-older",un=4;function We({roomName:e}){return t.jsx(Gt,{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:un},(s,o)=>t.jsxs("div",{className:"flex gap-3",children:[t.jsx(se,{className:"size-7 shrink-0 rounded-full"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[t.jsx(se,{className:"h-3 w-24"}),t.jsx(se,{className:"h-3 w-full max-w-md"})]})]},`room-skeleton-${o}`))})}function cn({roomId:e,roomName:s,viewerAuthorId:o,entries:a,members:b,formerAuthors:r,lastReadSeq:i,reactionFrequents:p,streamStalled:v,isLoading:h,error:m,onAddAgents:f,openThreadId:j,onOpenThread:k,resumeRow:I,landOnRow:A,onTopRow:g,canLoadOlder:C=!1,isLoadingOlder:d=!1,onLoadOlder:u,ref:O,roomKind:_}){const S=n.useMemo(()=>ve(b,r),[b,r]),B=Ee(b,o),T=Re(),P=n.useMemo(()=>new Map([...S].map(([y,Y])=>[y,Y.displayName])),[S]),D=Je(),Q=Pe(e,null),{topLevel:H,repliesByRoot:$,orphaned:K}=n.useMemo(()=>Ft(a),[a]),[F,G]=n.useState(()=>new Set),[X,L]=n.useState(null),q=n.useMemo(()=>sn(H,F),[H,F]),W=q.visible,c=n.useCallback(y=>{const Y=!F.has(y),N=new Set(F);Y?N.add(y):N.delete(y),G(N),L(Y?y:null)},[F]),x=n.useMemo(()=>new Map(a.map(y=>[y.id,y])),[a]),z=n.useMemo(()=>{const y=et(W,i),Y=tt(W.map(M=>({id:M.id,authorId:M.body.moment?`moment:${M.id}`:M.authorId,timestamp:M.createdAt})),{now:D,lastSeenId:y.lastSeenId,unreadFromStart:y.fromStart}),N=[];C&&!h&&N.push({kind:"load-older",id:ln});for(const M of Y){if(M.kind==="day-divider"){N.push({kind:"day-divider",id:M.key,label:M.label});continue}if(M.kind==="unread-divider"){N.push({kind:"unread-divider",id:M.key});continue}const U=W[M.index],ne=q.foldBefore.get(U.id);ne&&N.push({kind:"notice-fold",id:`notice-fold:${ne.runId}`,fold:ne});const de=$.get(U.id);N.push({kind:"message",id:U.id,entry:U,grouping:M.grouping,position:M.index+1,answers:De(U,W[M.index-1],x.get.bind(x)),headsThread:de!==void 0}),de&&N.push({kind:"thread-reply",id:zt(U.id),rootId:U.id,replies:de,totalReplies:U.threadReplyCount,endsGroup:M.grouping.position==="last"||M.grouping.position==="only"})}return N},[W,q,$,x,i,D,C,h]),l=n.useMemo(()=>z.map(y=>y.kind==="load-older"?{kind:"notice",id:y.id,at:"",body:null}:y.kind==="notice-fold"?{kind:"notice",id:y.id,at:"",body:null}:y.kind==="day-divider"?{kind:"day-divider",id:y.id,label:y.label}:y.kind==="unread-divider"?{kind:"unread-divider",id:y.id}:y.kind==="thread-reply"?{kind:"thread-reply",id:y.id,rootId:y.rootId,replyCount:Fe(y.replies.length,y.totalReplies),lastAt:y.replies[y.replies.length-1].createdAt}:{kind:"message",id:y.id,payload:y.entry,grouping:y.grouping,author:V(oe(y.entry,S),S,T.faces),at:y.entry.createdAt}),[z,S,T.faces]),w=n.useCallback((y,Y)=>{const N=z[Y.index];if(N.kind==="load-older")return u===void 0?null:t.jsx(on,{loading:d,onLoad:u});if(N.kind==="notice-fold")return t.jsx(fn,{fold:N.fold,onToggle:()=>c(N.fold.runId)});if(N.kind==="day-divider")return t.jsx(Et,{label:N.label});if(N.kind==="unread-divider")return t.jsx(Pt,{});if(N.kind==="thread-reply"){if(Y.onOpenThread===void 0)return null;const ne=Y.onOpenThread;return t.jsx(tn,{id:ce(N.rootId),summary:Ht(N.replies,i,N.totalReplies),open:j===N.rootId,onOpen:()=>ne(N.rootId),endsGroup:N.endsGroup})}const M=oe(N.entry,S),U=t.jsx(fe,{roomId:e,entry:N.entry,author:V(M,S,T.faces),authorRef:S.get(M),authors:S,viewerAuthorId:o,authorNames:P,reactionFrequents:p,streamStalled:v,isMember:B,grouping:N.grouping,orphanedReply:K.has(N.entry.id),answers:N.answers,feedPosition:{index:N.position,total:-1},rowId:me(N.entry.id),roomKind:_,headsThread:N.headsThread});return X!==null&&q.runOf.get(N.entry.id)===X?t.jsx(xe.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:Le.normal,ease:_e.out},onAnimationComplete:()=>L(null),children:U}):U},[z,e,_,S,T.faces,o,P,p,v,B,K,i,j,d,u,q,X,c]),R=n.useCallback(y=>{if(y.kind==="message")return me(y.id);if(y.kind==="thread-reply")return ce(y.rootId)},[]);if(m)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 E=b.some(y=>y.author.kind==="agent"),ee=t.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[t.jsx(st,{className:"text-muted-foreground size-8 md:size-6","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:"Nothing said here yet"}),t.jsx("p",{className:"max-w-sm",children:E?"Say something to get it going.":"Nothing answers until you add an agent."}),t.jsx(ge,{type:"button",size:"sm",variant:E?"ghost":"default",onClick:f,className:"mt-1",children:E?"Add more agents":"Add agents"}),t.jsx(dn,{roomId:e})]});return t.jsx(ze,{known:T,children:t.jsx(J.Timeline,{ref:O,conversationId:e,label:`Messages in ${s}`,rows:l,renderRow:w,onOpenThread:k,domIdOf:R,...I===void 0?{}:{resumeRow:I},...A===void 0?{}:{landOnRow:A},...g===void 0?{}:{onTopRow:g},pending:Q,viewerAuthorId:o,loading:h?t.jsx(We,{roomName:s}):void 0,empty:ee,feedTestId:"room-timeline"})})}function fn({fold:e,onToggle:s}){const o=e.count===1?"notice":"notices";return t.jsx("div",{"data-testid":"room-notice-fold",className:"py-0.5 pr-[var(--msg-padding-x)] pl-[calc(var(--msg-padding-x)+var(--msg-gutter-width)+var(--msg-gap))]",children:t.jsxs(ge,{type:"button",variant:"ghost",size:"xs","aria-expanded":e.expanded,"aria-label":`${e.expanded?"Hide":"Show"} ${e.count} earlier ${o}`,onClick:s,className:"text-muted-foreground hover:text-foreground -ml-2 font-normal",children:[t.jsx(xe.span,{"aria-hidden":!0,className:"inline-flex",initial:!1,animate:{rotate:e.expanded?90:0},transition:{duration:Le.fast,ease:_e.out},children:t.jsx(nt,{className:"size-(--size-icon-xs)"})}),e.expanded?`Hide ${e.count} earlier`:`${e.count} earlier`]})})}function mn(e){const{roomId:s,entrySeq:o,entries:a,historyLoaded:b}=e,r=o===void 0?null:`${s}:${o}`,i=n.useMemo(()=>{if(o===void 0)return null;const I=a.find(d=>d.seq===o);if(I===void 0)return null;const A=He(a,I.id);if(A===null)return null;const g=ye(I)??null,C=g!==null&&A.rowId!==I.id;return{roomRowId:A.rowId,threadRootId:C?g:null,entryId:I.id}},[a,o]),p=n.useRef(null),v=(i==null?void 0:i.threadRootId)??null;n.useEffect(()=>{r===null||v===null||p.current!==r&&(p.current=r,Z.getState().openThread(s,v))},[r,s,v]);const h=n.useRef(null);n.useEffect(()=>{r===null||!b||i===null&&h.current!==r&&(h.current=r,ot.info("That message isn’t in the loaded history",{description:"Only recent messages are open. Nothing was lost."}))},[r,b,i]);const m=n.useRef(null),f=n.useCallback(()=>{if(!(r===null||m.current===r))return m.current=r,i==null?void 0:i.roomRowId},[r,i]),j=n.useRef(null),k=n.useCallback(()=>{if(!(r===null||j.current===r))return j.current=r,(i==null?void 0:i.threadRootId)===null||i==null?void 0:i.entryId},[r,i]);return{roomRow:o===void 0?void 0:f,threadRow:o===void 0?void 0:k}}function hn(e,s){const[o,a]=n.useState({roomId:null,seq:null});return o.roomId===e?o.seq:e===null?(a({roomId:null,seq:null}),null):s===null?null:(a({roomId:e,seq:s}),s)}const pn=600;function gn(e){return document.getElementById(ce(e))??document.getElementById(me(e))}function xn(){const e=n.useRef(null);return n.useEffect(()=>()=>{var o;return(o=e.current)==null?void 0:o.call(e)},[]),{arm:n.useCallback(o=>{var p;(p=e.current)==null||p.call(e);let a=0;const b=Date.now()+pn;let r=!1;const i=()=>{if(r)return;const v=document.activeElement;if(v===null||v===document.body||!v.isConnected){const m=gn(o);if(m!==null){m.focus();return}}Date.now()>=b||(a=requestAnimationFrame(i))};a=requestAnimationFrame(i),e.current=()=>{r=!0,cancelAnimationFrame(a)}},[])}}function vn({roomId:e,route:s,urlThreadId:o,openThreadId:a,entries:b,historyLoaded:r}){const i=rt(),p=n.useRef(null);n.useEffect(()=>{if(e!==null){if(p.current!==e&&(p.current=e,o!==void 0)){Z.getState().openThread(e,o);return}if(r&&a!==void 0){const v=b.find(m=>m.id===a),h=v===void 0?void 0:$t(v);if(h!==void 0&&h!==a){const m=Z.getState().open[e];Z.getState().openThread(e,h,(m==null?void 0:m.focusComposer)??!1);return}}a!==o&&(i==null||i({to:s,search:v=>({...v,thread:a}),replace:!0}))}},[e,s,a,o,b,r,i])}function Rn(e){return e.kind!=="channel"||e.bridge!=null||e.archived?!1:!e.members.some(s=>s.author.kind==="agent")}function yn({room:e,hasEntries:s,onAddAgents:o}){return!s||!Rn(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:o,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 bn({roomId:e}){const{approvals:s}=at(),o=it(s).filter(a=>a.roomId===e);return o.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(dt,{approvals:o})})}function jn({roomId:e}){const{data:s}=Yt("pending"),o=(s??[]).filter(a=>a.roomId===e);return o.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:o.map(a=>t.jsx(Qt,{request:a},a.requestId))})}const wn="An agent",Ae=64,ue=3,kn=new Set;function Be({room:e,entries:s,scope:o,laneScope:a,stalled:b,unavailable:r=!1,onRetry:i,onScrollToRow:p}){const v=lt(),h=ut(e.id,o),m=ct(e.id,o),f=ft(e.id,o),[j,k]=n.useState(!1),I=Vt(e.id,{enabled:j}),A=mt(),{mutate:g}=Zt(),[C,d]=n.useState(kn),u=n.useCallback(l=>{d(w=>new Set(w).add(l)),g({roomId:e.id,authorId:l},{onSettled:()=>d(w=>{const R=new Set(w);return R.delete(l),R})})},[g,e.id]),O=Jt(),[_,S]=n.useState(()=>new Map),B=ht(),T=Re(),P=n.useMemo(()=>ve(e.members,e.formerAuthors),[e.members,e.formerAuthors]),D=n.useCallback(l=>{var w;return((w=P.get(l))==null?void 0:w.displayName)??wn},[P]),{interactions:Q}=pt(),H=n.useMemo(()=>Q.filter(l=>l.roomId===e.id),[Q,e.id]),$=n.useMemo(()=>{var w;const l={};for(const R of H){if(R.roomAuthorId===void 0)continue;const E=(w=P.get(R.roomAuthorId))==null?void 0:w.displayName;E!==void 0&&(l[R.sessionId]=E)}return l},[H,P]),K=n.useMemo(()=>h.map(l=>({authorId:l.authorId,name:D(l.authorId),state:l.state,since:l.since,activity:l.activity??null})),[h,D]),F=n.useMemo(()=>m.map(l=>{var R;const w=(R=B.data)==null?void 0:R.find(E=>E.id===l.behindRoomId);return{authorId:l.authorId,name:D(l.authorId),since:l.since,behind:{roomId:l.behindRoomId,title:w===void 0?null:te(w)},othersWaiting:l.othersWaiting,severalInTheWay:l.severalInTheWay}}),[m,D,B.data]),G=n.useMemo(()=>{const l=new Set;for(const w of m)_.get(w.authorId)===w.entryId&&l.add(w.authorId);return l},[m,_]),X=n.useMemo(()=>f===null?null:{authorId:f.authorId,name:D(f.authorId)},[f,D]),L=n.useMemo(()=>Ut({capabilities:be,asks:H,agentNames:$,stalled:b,presence:K,held:F,silentFinish:X,turn:null}),[H,$,K,F,X,b]),q=n.useMemo(()=>{var w;const l=new Map;for(const R of((w=I.data)==null?void 0:w.bindings)??[])l.set(R.authorId,R.sessionId);return l},[I.data]),W=n.useCallback(l=>{const w=s.find(E=>E.id===l);if(w===void 0)return null;const R=w.body.text.replace(/\s+/gu," ").trim();return R.length===0?null:R.length>Ae?`${R.slice(0,Ae).trimEnd()}…`:R},[s]),c=n.useCallback(l=>{var w;return a==="thread"?re(l):((w=He(s,l))==null?void 0:w.domId)??null},[s,a]),x=n.useMemo(()=>{const l=h.map(R=>{const E=W(R.entryId),ee=c(R.entryId);return{authorId:R.authorId,author:V(R.authorId,P,T.faces),state:R.state,since:R.since,doing:gt(R.activity),replyingTo:E===null||ee===null?null:{entryId:R.entryId,excerpt:E,rowId:ee},sessionId:q.get(R.authorId)??null}}),w=F.map(R=>({authorId:R.authorId,author:V(R.authorId,P,T.faces),state:"held",since:R.since,doing:null,replyingTo:null,sessionId:null,behind:R.behind,othersWaiting:R.othersWaiting}));return[...l,...w]},[h,F,P,T.faces,W,c,q]),z=n.useMemo(()=>{if(h.length===0)return null;const l=h.slice(0,ue);return t.jsxs("span",{"aria-hidden":"true",className:"flex shrink-0 -space-x-1",children:[l.map(w=>t.jsx(Xt,{author:V(w.authorId,P,T.faces),className:"ring-background size-4 ring-2"},w.authorId)),h.length>ue&&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:`+${h.length-ue}`})]})},[h,P,T.faces]);return t.jsx(J.LiveLane,{state:L,scope:a,onRetry:i,unavailable:r,faces:z,onPeekOpenChange:k,askCard:L.kind==="ask"?t.jsx(vt,{ask:L.ask,...$[L.ask.sessionId]?{agentName:$[L.ask.sessionId]}:{},onOpenSession:l=>{v(ke({session:l}))},className:"border-l-0"}):void 0,peek:t.jsx(J.LivePeek,{rows:x,onScrollToRow:p,onOpenSession:l=>{v(ke({session:l}))},onOpenRoom:l=>{v({...xt.channels(),search:{id:l}})},onAnswerFirst:l=>{const w=m.find(R=>R.authorId===l);w!==void 0&&S(R=>new Map(R).set(l,w.entryId)),O.mutate({roomId:e.id,authorId:l})},promoted:G,onStopAll:()=>A.mutate({roomId:e.id}),stopping:A.isPending,onStopAgent:u,stoppingAgents:C})})}const Se=3e3;function Nn(e,s,o,a=Date.now){const b=n.useRef(null),r=n.useRef(new Map),i=n.useRef(new Map),p=b.current,v=r.current,h=i.current,m=a();for(const f of e){if(h.has(f.id))continue;if(p===null){h.set(f.id,"at-rest");continue}const j=v.get(f.authorId);h.set(f.id,j!==void 0&&m-j<Se?"handed-off":"dropped")}return n.useEffect(()=>{if(!o)return;b.current=new Set(e.map(j=>j.id));const f=a();for(const j of s)r.current.set(j,f);for(const[j,k]of r.current)f-k>Se&&r.current.delete(j);for(const j of i.current.keys())b.current.has(j)||i.current.delete(j)}),h}function In({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(se,{className:"h-3 w-24"}),t.jsx(se,{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",children:"This thread’s first message is gone. Its replies remain."})}function An({room:e,rootEntryId:s,focusComposer:o,entries:a,reactionFrequents:b,streamStalled:r,streamUnavailable:i,onRetryStream:p,historyLoaded:v,historyFailed:h=!1,landOnRow:m,pushed:f,onClose:j}){const k=n.useMemo(()=>ve(e.members,e.formerAuthors),[e.members,e.formerAuthors]),I=$e({room:e,threadRootId:s}),A=Ee(e.members,e.viewerAuthorId),g=Re(),C=n.useMemo(()=>new Map([...k].map(([c,x])=>[c,x.displayName])),[k]),{root:d,replies:u}=n.useMemo(()=>{let c;const x=[];for(const z of a)z.id===s?c=z:ye(z)===s&&x.push(z);return{root:c,replies:x}},[a,s]),O=d==null?void 0:d.threadReplyCount,_=O!==void 0&&O>u.length,S=!f,B=d===void 0||_?-1:(S?1:0)+u.length,T=Fe(u.length,O),P=n.useMemo(()=>new Set(u.map(c=>c.id)),[u]),D=n.useMemo(()=>({replyIds:P,inside:!0}),[P]),Q=Rt(e.id,D),H=Pe(e.id,s),$=Nn(u,Q,v),K=n.useRef(null),F=n.useCallback(c=>{var x;(x=K.current)==null||x.scrollToRow(c)},[]),G=n.useRef(null);n.useEffect(()=>{var c;o||(c=G.current)==null||c.focus()},[s,o]);const X=c=>{c.key!=="Escape"||c.defaultPrevented||(c.stopPropagation(),j())},L=n.useMemo(()=>{const c=[];if(d===void 0){const x=h?"thread-error":v?"thread-orphan":"thread-waiting";c.push({kind:"notice",id:x,at:"",body:null})}else S&&c.push({kind:"message",id:d.id,payload:d,grouping:{position:"only"},author:V(oe(d,k),k,g.faces),at:d.createdAt});for(const x of u)c.push({kind:"message",id:x.id,payload:x,grouping:{position:"only"},author:V(oe(x,k),k,g.faces),at:x.createdAt});return c},[d,S,u,k,g.faces,h,v]),q=n.useCallback(c=>{if(c.kind==="notice")return t.jsx(In,{kind:c.id});if(c.kind!=="message")return null;const x=c.payload,z=d!==void 0&&x.id===d.id,l=u.findIndex(E=>E.id===x.id),w=t.jsx(fe,{roomId:e.id,entry:x,rowId:re(x.id),roomKind:e.kind,author:c.author,authorRef:k.get(x.authorId),authors:k,viewerAuthorId:e.viewerAuthorId,authorNames:C,reactionFrequents:b,streamStalled:r,isMember:A,grouping:{position:"only"},answers:De(x,l<=0?d:u[l-1],E=>(d==null?void 0:d.id)===E?d:u.find(ee=>ee.id===E)),feedPosition:{index:z?1:(d===void 0||!S?0:1)+l+1,total:B}});if(z)return t.jsxs(t.Fragment,{children:[w,t.jsx(Ce,{count:T})]});const R=$.get(x.id)??"at-rest";return t.jsx("div",{className:ae(R==="dropped"&&"motion-safe:animate-thread-reply-in",R==="handed-off"&&"motion-safe:animate-reply-settle"),children:w})},[d,S,u,T,$,e.id,e.kind,e.viewerAuthorId,k,C,b,r,A,B]),W=n.useCallback(c=>c.kind==="message"?re(c.id):void 0,[]);return t.jsx(ze,{known:g,children:t.jsx(J.Root,{surface:"room",capabilities:be,target:I.target,anchor:"rail",children:t.jsxs("section",{ref:G,"aria-label":"Thread","data-testid":"room-thread-panel",tabIndex:-1,onKeyDown:X,className:ae("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:j,"aria-label":`Back to ${te(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(yt,{"aria-hidden":!0,className:"size-4 shrink-0"}),t.jsx("span",{className:"truncate",children:te(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:j,"aria-label":"Close thread",className:"focus-ring text-muted-foreground hover:text-foreground relative -ml-1 rounded p-1",children:t.jsx(bt,{"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:te(e)})]})]}),f&&d!==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(fe,{roomId:e.id,entry:d,rowId:re(d.id),roomKind:e.kind,author:V(oe(d,k),k,g.faces),authorRef:k.get(d.authorId),authors:k,viewerAuthorId:e.viewerAuthorId,authorNames:C,reactionFrequents:b,streamStalled:r,isMember:A,grouping:{position:"only"}}),t.jsx(Ce,{count:T})]}),t.jsx(J.Timeline,{ref:K,conversationId:`thread-${s}`,label:`Thread in ${te(e)}`,busy:!v&&!h,rows:L,renderRow:q,domIdOf:W,...m===void 0?{}:{landOnRow:m},pending:H,viewerAuthorId:e.viewerAuthorId,className:"py-3",feedTestId:"room-thread-feed"}),t.jsx(Be,{room:e,entries:a,scope:D,laneScope:"thread",stalled:f&&r===!0,unavailable:i,onRetry:f?p:void 0,onScrollToRow:F}),t.jsx(qe,{room:e,threadRootId:s,attachments:I.attachments,focusOnMount:o},s)]})})})}function Ce({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 Sn=96,Cn=500;function Mn(e){return e.offset.x>Sn||e.velocity.x>Cn}function Tn({children:e,onClose:s}){const o=jt()===!0,a=o?{x:0}:{x:"100%"};return t.jsx(xe.div,{"data-testid":"room-thread-sheet",className:"bg-card absolute inset-0 z-10 flex flex-col shadow-xl",initial:a,animate:{x:0},exit:a,transition:o?{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:(b,r)=>{Mn(r)&&s()},children:e})}const ie="room-thread-split",On=320,En=360,Pn=40,_n=50,Ln=25;function Me(e,s){return s<=0?Ln:Math.min(Math.round(e/s*1e3)/10,_n)}function Dn(e){const s=Me(On,e),o=Math.round((100-Me(En,e))*10)/10;return{minPct:s,maxPct:o,defaultPct:Math.min(Math.max(Pn,s),o)}}function Fn(e,s,o){if(e===null||s===null||s<=0)return o.defaultPct;const a=e/s*100;return Math.round(Math.min(Math.max(a,o.minPct),o.maxPct)*10)/10}function zn(e){try{const s=localStorage.getItem(e),o=s===null?NaN:Number(s);return Number.isFinite(o)&&o>0?o:null}catch{return null}}function Hn(e,s){try{localStorage.setItem(e,String(Math.round(s)))}catch{}}const $n="react-resizable-panels:room-thread-split";function qn(){try{localStorage.removeItem($n)}catch{}}function Wn(){const[e,s]=n.useState(null),[o,a]=n.useState(null);return{ref:n.useCallback(r=>{if(r===null)return;s(r);const i=()=>a(r.offsetWidth);i();const p=new ResizeObserver(i);return p.observe(r),()=>{p.disconnect(),s(null),a(null)}},[]),element:e,width:o,sizing:Dn(o??0)}}const Bn=`${ie}-room`,Te=`${ie}-thread`,Oe=`${ie}-handle`,Kn=4;function Gn({room:e,thread:s,storageKey:o=kt.ROOM_THREAD_WIDTH}){const{ref:a,element:b,width:r,sizing:i}=Wn(),[p,v]=n.useState(()=>zn(o)),[h,m]=n.useState(null),f=n.useRef(null),j=Fn(p,r,i),k=r===null||(i.maxPct-i.minPct)/100*r<Kn,I=s!==!1;n.useEffect(qn,[]);const A=n.useRef(!1);n.useLayoutEffect(()=>{var u;A.current&&((u=f.current)==null||u.resize(j))},[j,I]);const g=n.useRef(null),C=()=>{var S;const u=(S=f.current)==null?void 0:S.getSize(),O=g.current;if(g.current=null,u===void 0||r===null||r<=0||O===u)return;const _=Math.round(u/100*r);v(_),Hn(o,_)},d=h??j;return n.useLayoutEffect(()=>{const u=b==null?void 0:b.querySelector(`[data-panel-resize-handle-id="${Oe}"]`);u&&(u.setAttribute("aria-controls",Te),u.setAttribute("aria-valuenow",String(Math.round(d))),u.setAttribute("aria-valuemin",String(Math.round(i.minPct))),u.setAttribute("aria-valuemax",String(Math.round(i.maxPct))))}),t.jsx("div",{ref:a,className:"h-full overflow-hidden",children:t.jsxs(wt,{direction:"horizontal",id:ie,onLayout:u=>{A.current=u.length>1,m(A.current?u[1]:null)},children:[t.jsx(Ne,{id:Bn,order:1,className:"flex",children:e}),I&&t.jsxs(t.Fragment,{children:[t.jsx(Tt,{id:Oe,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:k,onDragging:u=>{var O;u&&(g.current=((O=f.current)==null?void 0:O.getSize())??null)},onKeyDownCapture:u=>{var O,_;k||(g.current=((O=f.current)==null?void 0:O.getSize())??null,!(u.key!=="Home"&&u.key!=="End")&&(u.preventDefault(),(_=f.current)==null||_.resize(u.key==="Home"?i.minPct:i.maxPct)))},onResizeEnd:C}),t.jsx(Ne,{ref:f,id:Te,order:2,defaultSize:j,minSize:i.minPct,maxSize:i.maxPct,className:"flex",children:s})]})]})})}function ns({roomId:e,threadId:s,entrySeq:o,threadRoute:a,aboveTimeline:b,aboveComposer:r,offerJumpBackIn:i,onComposerFocusChange:p}){const v=Nt(),h=Ot(),m=It(e),f=m==null?void 0:m.rootEntryId,j=xn(),k=n.useCallback(()=>{var x;const c=(x=Z.getState().open[e])==null?void 0:x.rootEntryId;Z.getState().closeThread(e),c!==void 0&&j.arm(c)},[e,j]),I=n.useCallback(c=>{Z.getState().openThread(e,c)},[e]),A=At(e),g=St(e),C=_t(e,g.isSuccess);Lt(e);const d=A.data,u=n.useMemo(()=>g.data??[],[g.data]),O=$e({room:d});vn({roomId:e,route:a,urlThreadId:s,openThreadId:f,entries:u,historyLoaded:g.isSuccess});const _=n.useMemo(()=>{var c;return((c=d==null?void 0:d.members.find(x=>x.author.id===d.viewerAuthorId))==null?void 0:c.lastReadSeq)??null},[d]),S=hn(e,_);Ct(d,u);const B=n.useRef(null),T=n.useRef(void 0),P=n.useCallback(c=>{T.current=c},[]),D=n.useCallback(()=>T.current,[]);n.useLayoutEffect(()=>{T.current=void 0},[e]);const Q=n.useCallback(c=>{var x;(x=B.current)==null||x.scrollToRow(c)},[]),H=en(e),{loadOlder:$,cursor:K}=H,F=n.useCallback(()=>{const c=qt(u,K);$().then(()=>{c!==null&&requestAnimationFrame(()=>{var x;return(x=B.current)==null?void 0:x.scrollToRow(c.domId)})})},[u,K,$]),G=mn({roomId:e,entrySeq:o,entries:u,historyLoaded:g.isSuccess}),X=n.useMemo(()=>f===void 0?void 0:{replyIds:new Set(u.filter(x=>ye(x)===f).map(x=>x.id)),inside:!1},[u,f]);if(A.isLoading)return t.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:t.jsx(We,{})});if(A.isError||!d)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 L=m!==void 0&&t.jsx(An,{room:d,rootEntryId:m.rootEntryId,focusComposer:m.focusComposer,entries:u,reactionFrequents:d.reactionFrequents,streamStalled:C.stalled,streamUnavailable:C.unavailable,onRetryStream:C.retry,historyLoaded:g.isSuccess,historyFailed:g.isError,...G.threadRow===void 0?{}:{landOnRow:G.threadRow},pushed:v,onClose:k},m.rootEntryId),q=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[b,t.jsx(cn,{ref:B,roomId:d.id,roomKind:d.kind,roomName:te(d),viewerAuthorId:d.viewerAuthorId,entries:u,members:d.members,formerAuthors:d.formerAuthors,lastReadSeq:S,reactionFrequents:d.reactionFrequents,streamStalled:C.stalled,isLoading:g.isLoading,error:g.error,onAddAgents:()=>Ie("add",d.id),openThreadId:f,onOpenThread:I,resumeRow:D,...G.roomRow===void 0?{}:{landOnRow:G.roomRow},onTopRow:P,canLoadOlder:H.canLoadOlder,isLoadingOlder:H.isLoadingOlder,onLoadOlder:F}),r,t.jsx(bn,{roomId:d.id}),t.jsx(jn,{roomId:d.id}),t.jsx(Be,{room:d,entries:u,scope:X,laneScope:"room",stalled:C.stalled,unavailable:C.unavailable,onRetry:C.retry,onScrollToRow:Q}),t.jsx(yn,{room:d,hasEntries:u.length>0,onAddAgents:()=>Ie("add",d.id)}),t.jsx(qe,{room:d,attachments:O.attachments,offerJumpBackIn:i,onFocusChange:p},d.id)]}),W={surface:"room",capabilities:be,target:O.target,anchor:"rail"};return v?t.jsx(J.Root,{...W,children:t.jsx("div",{style:{paddingBottom:h},"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:L!==!1,"data-testid":"room-under-thread",children:q}),t.jsx(Mt,{initial:!1,children:L!==!1&&t.jsx(Tn,{onClose:k,children:L},`thread-${f}`)})]})})}):t.jsx(J.Root,{...W,children:t.jsx(Gn,{room:q,thread:L})})}export{ns as R,tn as T,We as a};
|
|
1
|
+
import{a5 as he,a8 as pe,a7 as Ke,jB as Ge,jC as le,jD as je,jE as Ue,jF as Xe,jG as Ye,aQ as Qe,r as n,j as t,G as ae,B as ge,x as Ve,aZ as we,jH as Ze,e as se,gK as Ee,hr as Je,gJ as Pe,jI as et,jJ as tt,_ as xe,jK as _e,jL as Le,C as nt,n as st,gN as Z,dR as ot,fU as rt,jM as at,jN as it,jO as dt,cz as lt,jP as ut,jQ as ct,jR as ft,jS as mt,cv as ht,jT as pt,gI as te,jU as gt,l as xt,s as ke,jV as vt,jW as Rt,em as yt,X as bt,ej as jt,jX as wt,jY as Ne,jZ as kt,af as Nt,j_ as It,gH as At,gG as St,j$ as Ct,aG as Ie,Z as Mt}from"./index-BR1m9FON.js";import{P as Tt,u as Ot}from"./pane-resize-handle-Bjy4udre.js";import{D as Et,U as Pt,u as _t}from"./UnreadDivider-1aPVzwd7.js";import{u as Lt}from"./use-room-follow-claim-Bgrpr3bO.js";import{i as Dt,a as ve,e as Re,g as Ft,f as De,h as zt,j as Fe,c as V,d as oe,k as Ht,l as ce,b as fe,m as me,A as ze,n as He,t as ye,r as $t,o as re,R as be,u as $e,C as qe,p as qt}from"./ChannelComposer-CAYvz_ZB.js";import{u as Wt,f as Bt,a as Kt,F as Gt,C as J,d as Ut,M as Xt}from"./registry-Tbt9pcZl.js";import{u as Yt}from"./use-connector-management-BLiCJMgU.js";import{A as Qt}from"./AgentRequestCard-B2gxCMGi.js";import{u as Vt}from"./use-room-sessions-DecGrP3E.js";function Zt(){const e=he();return pe({mutationFn:({roomId:s,authorId:o})=>e.haltRoomAgent(s,o),meta:{errorLabel:"Couldn’t stop this agent"}})}function Jt(){const e=he();return pe({mutationFn:({roomId:s,authorId:o})=>e.promoteHold(s,o),meta:{errorLabel:"Couldn’t ask to be answered first"}})}function en(e){const s=he(),o=Ke(),a=Ge(e),b=le(m=>{var f;return e===null?null:((f=m.paging[e])==null?void 0:f.cursor)??null}),r=pe({mutationFn:async m=>{var g;const f=(g=le.getState().paging[m])==null?void 0:g.cursor;if(f==null)return;const j=await s.listRoomEntries(m,{before:f,limit:je}),k=Qe.entries(m),I=o.getQueryData(k),A=Ue(I,j);o.setQueryData(k,A),le.getState().notePage(m,Xe(j)??f,Ye(j,je)||A.length===((I==null?void 0:I.length)??0))},meta:{errorLabel:"Couldn't load older messages"}}),{mutateAsync:i,isPending:p}=r,v=n.useRef(!1),h=n.useCallback(async()=>{if(!(e===null||v.current)){v.current=!0;try{await i(e).catch(()=>{})}finally{v.current=!1}}},[e,i]);return{canLoadOlder:a,isLoadingOlder:p,cursor:b,loadOlder:h}}function tn({id:e,summary:s,open:o,onOpen:a,endsGroup:b}){const{capabilities:r}=Wt(),{count:i,lastAt:p,unread:v}=s,h=Bt(p),[m,f]=n.useState({count:i,bumped:!1});m.count!==i&&f({count:i,bumped:!0});const j=m.count===i&&m.bumped;return r.threads?t.jsx("button",{type:"button",id:e,"data-slot":"thread-reply-row","data-testid":"room-thread-replies","data-unread":v>0?"":void 0,"aria-expanded":o,onClick:a,className:ae("focus-ring ml-[calc(var(--msg-padding-x)_+_var(--msg-gutter-width)_+_var(--msg-gap))]","hover:bg-row-hover flex w-fit items-center rounded-md text-left text-xs transition-colors",b===void 0?"mb-1":"mt-2",b===!0&&"mb-[var(--msg-padding-y-end)]",b===!1&&"mb-1","h-11 px-2 md:h-7",v>0?"text-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:t.jsxs("span",{children:[t.jsx("span",{"aria-hidden":!0,className:"mr-1",children:"↳"}),t.jsx("span",{className:ae(j&&"motion-safe:animate-count-flip"),"data-testid":"room-thread-reply-count",children:i},i),i===1?" reply":" replies",h.length>0&&t.jsxs(t.Fragment,{children:[" · last ",t.jsx("time",{dateTime:p,title:Kt(p),children:h})]}),v>0&&` · ${v} new`]})}):null}const nn=3;function sn(e,s){const o=[],a=new Map,b=new Map;let r=0;for(;r<e.length;){const i=r;for(;r<e.length&&e[r].kind==="notice";)r++;const p=e.slice(i,r);if(p.length===0){o.push(e[r]),r++;continue}const v=p[p.length-1],h=p.filter(g=>g!==v&&!Dt(g.body.notice));if(p.length<nn||h.length===0){o.push(...p);continue}const m=p[0].id,f=s.has(m),j={runId:m,count:h.length,expanded:f},k=new Set(h);for(const g of h)b.set(g.id,m);if(f){a.set(p[0].id,j),o.push(...p);continue}const I=p.findIndex(g=>k.has(g)),A=p.slice(I).find(g=>!k.has(g));a.set(A.id,j),o.push(...p.filter(g=>!k.has(g)))}return{visible:o,foldBefore:a,runOf:b}}function on({loading:e,onLoad:s}){return t.jsx("div",{className:"flex justify-center px-4 py-3",children:t.jsxs(ge,{type:"button",variant:"ghost",size:"sm",onClick:s,disabled:e,"data-testid":"room-load-older",className:"text-muted-foreground hover:text-foreground h-7 gap-2 text-xs",children:[e&&t.jsx(Ve,{size:"xs"}),e?"Loading older messages…":"Older messages"]})})}const rn="ROOM.md";function an(e){return e==null?void 0:e.find(s=>s.pinned&&s.content.type==="file"&&s.content.sourcePath===rn)}function dn({roomId:e}){const s=we(a=>an(a.roomCanvasDocuments[e]));if(!s)return null;const o=()=>{const a=we.getState();a.activateRoomCanvasDocument(e,s.id),Ze(a,"user")};return t.jsxs("p",{className:"max-w-sm text-xs","data-testid":"room-md-hint",children:["This channel has a ROOM.md for its goal and rules."," ",t.jsx("button",{type:"button",onClick:o,className:"text-foreground focus-ring rounded-sm underline underline-offset-2",children:"Open"})]})}const ln="room-load-older",un=4;function We({roomName:e}){return t.jsx(Gt,{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:un},(s,o)=>t.jsxs("div",{className:"flex gap-3",children:[t.jsx(se,{className:"size-7 shrink-0 rounded-full"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[t.jsx(se,{className:"h-3 w-24"}),t.jsx(se,{className:"h-3 w-full max-w-md"})]})]},`room-skeleton-${o}`))})}function cn({roomId:e,roomName:s,viewerAuthorId:o,entries:a,members:b,formerAuthors:r,lastReadSeq:i,reactionFrequents:p,streamStalled:v,isLoading:h,error:m,onAddAgents:f,openThreadId:j,onOpenThread:k,resumeRow:I,landOnRow:A,onTopRow:g,canLoadOlder:C=!1,isLoadingOlder:d=!1,onLoadOlder:u,ref:O,roomKind:_}){const S=n.useMemo(()=>ve(b,r),[b,r]),B=Ee(b,o),T=Re(),P=n.useMemo(()=>new Map([...S].map(([y,Y])=>[y,Y.displayName])),[S]),D=Je(),Q=Pe(e,null),{topLevel:H,repliesByRoot:$,orphaned:K}=n.useMemo(()=>Ft(a),[a]),[F,G]=n.useState(()=>new Set),[X,L]=n.useState(null),q=n.useMemo(()=>sn(H,F),[H,F]),W=q.visible,c=n.useCallback(y=>{const Y=!F.has(y),N=new Set(F);Y?N.add(y):N.delete(y),G(N),L(Y?y:null)},[F]),x=n.useMemo(()=>new Map(a.map(y=>[y.id,y])),[a]),z=n.useMemo(()=>{const y=et(W,i),Y=tt(W.map(M=>({id:M.id,authorId:M.body.moment?`moment:${M.id}`:M.authorId,timestamp:M.createdAt})),{now:D,lastSeenId:y.lastSeenId,unreadFromStart:y.fromStart}),N=[];C&&!h&&N.push({kind:"load-older",id:ln});for(const M of Y){if(M.kind==="day-divider"){N.push({kind:"day-divider",id:M.key,label:M.label});continue}if(M.kind==="unread-divider"){N.push({kind:"unread-divider",id:M.key});continue}const U=W[M.index],ne=q.foldBefore.get(U.id);ne&&N.push({kind:"notice-fold",id:`notice-fold:${ne.runId}`,fold:ne});const de=$.get(U.id);N.push({kind:"message",id:U.id,entry:U,grouping:M.grouping,position:M.index+1,answers:De(U,W[M.index-1],x.get.bind(x)),headsThread:de!==void 0}),de&&N.push({kind:"thread-reply",id:zt(U.id),rootId:U.id,replies:de,totalReplies:U.threadReplyCount,endsGroup:M.grouping.position==="last"||M.grouping.position==="only"})}return N},[W,q,$,x,i,D,C,h]),l=n.useMemo(()=>z.map(y=>y.kind==="load-older"?{kind:"notice",id:y.id,at:"",body:null}:y.kind==="notice-fold"?{kind:"notice",id:y.id,at:"",body:null}:y.kind==="day-divider"?{kind:"day-divider",id:y.id,label:y.label}:y.kind==="unread-divider"?{kind:"unread-divider",id:y.id}:y.kind==="thread-reply"?{kind:"thread-reply",id:y.id,rootId:y.rootId,replyCount:Fe(y.replies.length,y.totalReplies),lastAt:y.replies[y.replies.length-1].createdAt}:{kind:"message",id:y.id,payload:y.entry,grouping:y.grouping,author:V(oe(y.entry,S),S,T.faces),at:y.entry.createdAt}),[z,S,T.faces]),w=n.useCallback((y,Y)=>{const N=z[Y.index];if(N.kind==="load-older")return u===void 0?null:t.jsx(on,{loading:d,onLoad:u});if(N.kind==="notice-fold")return t.jsx(fn,{fold:N.fold,onToggle:()=>c(N.fold.runId)});if(N.kind==="day-divider")return t.jsx(Et,{label:N.label});if(N.kind==="unread-divider")return t.jsx(Pt,{});if(N.kind==="thread-reply"){if(Y.onOpenThread===void 0)return null;const ne=Y.onOpenThread;return t.jsx(tn,{id:ce(N.rootId),summary:Ht(N.replies,i,N.totalReplies),open:j===N.rootId,onOpen:()=>ne(N.rootId),endsGroup:N.endsGroup})}const M=oe(N.entry,S),U=t.jsx(fe,{roomId:e,entry:N.entry,author:V(M,S,T.faces),authorRef:S.get(M),authors:S,viewerAuthorId:o,authorNames:P,reactionFrequents:p,streamStalled:v,isMember:B,grouping:N.grouping,orphanedReply:K.has(N.entry.id),answers:N.answers,feedPosition:{index:N.position,total:-1},rowId:me(N.entry.id),roomKind:_,headsThread:N.headsThread});return X!==null&&q.runOf.get(N.entry.id)===X?t.jsx(xe.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:Le.normal,ease:_e.out},onAnimationComplete:()=>L(null),children:U}):U},[z,e,_,S,T.faces,o,P,p,v,B,K,i,j,d,u,q,X,c]),R=n.useCallback(y=>{if(y.kind==="message")return me(y.id);if(y.kind==="thread-reply")return ce(y.rootId)},[]);if(m)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 E=b.some(y=>y.author.kind==="agent"),ee=t.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[t.jsx(st,{className:"text-muted-foreground size-8 md:size-6","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:"Nothing said here yet"}),t.jsx("p",{className:"max-w-sm",children:E?"Say something to get it going.":"Nothing answers until you add an agent."}),t.jsx(ge,{type:"button",size:"sm",variant:E?"ghost":"default",onClick:f,className:"mt-1",children:E?"Add more agents":"Add agents"}),t.jsx(dn,{roomId:e})]});return t.jsx(ze,{known:T,children:t.jsx(J.Timeline,{ref:O,conversationId:e,label:`Messages in ${s}`,rows:l,renderRow:w,onOpenThread:k,domIdOf:R,...I===void 0?{}:{resumeRow:I},...A===void 0?{}:{landOnRow:A},...g===void 0?{}:{onTopRow:g},pending:Q,viewerAuthorId:o,loading:h?t.jsx(We,{roomName:s}):void 0,empty:ee,feedTestId:"room-timeline"})})}function fn({fold:e,onToggle:s}){const o=e.count===1?"notice":"notices";return t.jsx("div",{"data-testid":"room-notice-fold",className:"py-0.5 pr-[var(--msg-padding-x)] pl-[calc(var(--msg-padding-x)+var(--msg-gutter-width)+var(--msg-gap))]",children:t.jsxs(ge,{type:"button",variant:"ghost",size:"xs","aria-expanded":e.expanded,"aria-label":`${e.expanded?"Hide":"Show"} ${e.count} earlier ${o}`,onClick:s,className:"text-muted-foreground hover:text-foreground -ml-2 font-normal",children:[t.jsx(xe.span,{"aria-hidden":!0,className:"inline-flex",initial:!1,animate:{rotate:e.expanded?90:0},transition:{duration:Le.fast,ease:_e.out},children:t.jsx(nt,{className:"size-(--size-icon-xs)"})}),e.expanded?`Hide ${e.count} earlier`:`${e.count} earlier`]})})}function mn(e){const{roomId:s,entrySeq:o,entries:a,historyLoaded:b}=e,r=o===void 0?null:`${s}:${o}`,i=n.useMemo(()=>{if(o===void 0)return null;const I=a.find(d=>d.seq===o);if(I===void 0)return null;const A=He(a,I.id);if(A===null)return null;const g=ye(I)??null,C=g!==null&&A.rowId!==I.id;return{roomRowId:A.rowId,threadRootId:C?g:null,entryId:I.id}},[a,o]),p=n.useRef(null),v=(i==null?void 0:i.threadRootId)??null;n.useEffect(()=>{r===null||v===null||p.current!==r&&(p.current=r,Z.getState().openThread(s,v))},[r,s,v]);const h=n.useRef(null);n.useEffect(()=>{r===null||!b||i===null&&h.current!==r&&(h.current=r,ot.info("That message isn’t in the loaded history",{description:"Only recent messages are open. Nothing was lost."}))},[r,b,i]);const m=n.useRef(null),f=n.useCallback(()=>{if(!(r===null||m.current===r))return m.current=r,i==null?void 0:i.roomRowId},[r,i]),j=n.useRef(null),k=n.useCallback(()=>{if(!(r===null||j.current===r))return j.current=r,(i==null?void 0:i.threadRootId)===null||i==null?void 0:i.entryId},[r,i]);return{roomRow:o===void 0?void 0:f,threadRow:o===void 0?void 0:k}}function hn(e,s){const[o,a]=n.useState({roomId:null,seq:null});return o.roomId===e?o.seq:e===null?(a({roomId:null,seq:null}),null):s===null?null:(a({roomId:e,seq:s}),s)}const pn=600;function gn(e){return document.getElementById(ce(e))??document.getElementById(me(e))}function xn(){const e=n.useRef(null);return n.useEffect(()=>()=>{var o;return(o=e.current)==null?void 0:o.call(e)},[]),{arm:n.useCallback(o=>{var p;(p=e.current)==null||p.call(e);let a=0;const b=Date.now()+pn;let r=!1;const i=()=>{if(r)return;const v=document.activeElement;if(v===null||v===document.body||!v.isConnected){const m=gn(o);if(m!==null){m.focus();return}}Date.now()>=b||(a=requestAnimationFrame(i))};a=requestAnimationFrame(i),e.current=()=>{r=!0,cancelAnimationFrame(a)}},[])}}function vn({roomId:e,route:s,urlThreadId:o,openThreadId:a,entries:b,historyLoaded:r}){const i=rt(),p=n.useRef(null);n.useEffect(()=>{if(e!==null){if(p.current!==e&&(p.current=e,o!==void 0)){Z.getState().openThread(e,o);return}if(r&&a!==void 0){const v=b.find(m=>m.id===a),h=v===void 0?void 0:$t(v);if(h!==void 0&&h!==a){const m=Z.getState().open[e];Z.getState().openThread(e,h,(m==null?void 0:m.focusComposer)??!1);return}}a!==o&&(i==null||i({to:s,search:v=>({...v,thread:a}),replace:!0}))}},[e,s,a,o,b,r,i])}function Rn(e){return e.kind!=="channel"||e.bridge!=null||e.archived?!1:!e.members.some(s=>s.author.kind==="agent")}function yn({room:e,hasEntries:s,onAddAgents:o}){return!s||!Rn(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:o,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 bn({roomId:e}){const{approvals:s}=at(),o=it(s).filter(a=>a.roomId===e);return o.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(dt,{approvals:o})})}function jn({roomId:e}){const{data:s}=Yt("pending"),o=(s??[]).filter(a=>a.roomId===e);return o.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:o.map(a=>t.jsx(Qt,{request:a},a.requestId))})}const wn="An agent",Ae=64,ue=3,kn=new Set;function Be({room:e,entries:s,scope:o,laneScope:a,stalled:b,unavailable:r=!1,onRetry:i,onScrollToRow:p}){const v=lt(),h=ut(e.id,o),m=ct(e.id,o),f=ft(e.id,o),[j,k]=n.useState(!1),I=Vt(e.id,{enabled:j}),A=mt(),{mutate:g}=Zt(),[C,d]=n.useState(kn),u=n.useCallback(l=>{d(w=>new Set(w).add(l)),g({roomId:e.id,authorId:l},{onSettled:()=>d(w=>{const R=new Set(w);return R.delete(l),R})})},[g,e.id]),O=Jt(),[_,S]=n.useState(()=>new Map),B=ht(),T=Re(),P=n.useMemo(()=>ve(e.members,e.formerAuthors),[e.members,e.formerAuthors]),D=n.useCallback(l=>{var w;return((w=P.get(l))==null?void 0:w.displayName)??wn},[P]),{interactions:Q}=pt(),H=n.useMemo(()=>Q.filter(l=>l.roomId===e.id),[Q,e.id]),$=n.useMemo(()=>{var w;const l={};for(const R of H){if(R.roomAuthorId===void 0)continue;const E=(w=P.get(R.roomAuthorId))==null?void 0:w.displayName;E!==void 0&&(l[R.sessionId]=E)}return l},[H,P]),K=n.useMemo(()=>h.map(l=>({authorId:l.authorId,name:D(l.authorId),state:l.state,since:l.since,activity:l.activity??null})),[h,D]),F=n.useMemo(()=>m.map(l=>{var R;const w=(R=B.data)==null?void 0:R.find(E=>E.id===l.behindRoomId);return{authorId:l.authorId,name:D(l.authorId),since:l.since,behind:{roomId:l.behindRoomId,title:w===void 0?null:te(w)},othersWaiting:l.othersWaiting,severalInTheWay:l.severalInTheWay}}),[m,D,B.data]),G=n.useMemo(()=>{const l=new Set;for(const w of m)_.get(w.authorId)===w.entryId&&l.add(w.authorId);return l},[m,_]),X=n.useMemo(()=>f===null?null:{authorId:f.authorId,name:D(f.authorId)},[f,D]),L=n.useMemo(()=>Ut({capabilities:be,asks:H,agentNames:$,stalled:b,presence:K,held:F,silentFinish:X,turn:null}),[H,$,K,F,X,b]),q=n.useMemo(()=>{var w;const l=new Map;for(const R of((w=I.data)==null?void 0:w.bindings)??[])l.set(R.authorId,R.sessionId);return l},[I.data]),W=n.useCallback(l=>{const w=s.find(E=>E.id===l);if(w===void 0)return null;const R=w.body.text.replace(/\s+/gu," ").trim();return R.length===0?null:R.length>Ae?`${R.slice(0,Ae).trimEnd()}…`:R},[s]),c=n.useCallback(l=>{var w;return a==="thread"?re(l):((w=He(s,l))==null?void 0:w.domId)??null},[s,a]),x=n.useMemo(()=>{const l=h.map(R=>{const E=W(R.entryId),ee=c(R.entryId);return{authorId:R.authorId,author:V(R.authorId,P,T.faces),state:R.state,since:R.since,doing:gt(R.activity),replyingTo:E===null||ee===null?null:{entryId:R.entryId,excerpt:E,rowId:ee},sessionId:q.get(R.authorId)??null}}),w=F.map(R=>({authorId:R.authorId,author:V(R.authorId,P,T.faces),state:"held",since:R.since,doing:null,replyingTo:null,sessionId:null,behind:R.behind,othersWaiting:R.othersWaiting}));return[...l,...w]},[h,F,P,T.faces,W,c,q]),z=n.useMemo(()=>{if(h.length===0)return null;const l=h.slice(0,ue);return t.jsxs("span",{"aria-hidden":"true",className:"flex shrink-0 -space-x-1",children:[l.map(w=>t.jsx(Xt,{author:V(w.authorId,P,T.faces),className:"ring-background size-4 ring-2"},w.authorId)),h.length>ue&&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:`+${h.length-ue}`})]})},[h,P,T.faces]);return t.jsx(J.LiveLane,{state:L,scope:a,onRetry:i,unavailable:r,faces:z,onPeekOpenChange:k,askCard:L.kind==="ask"?t.jsx(vt,{ask:L.ask,...$[L.ask.sessionId]?{agentName:$[L.ask.sessionId]}:{},onOpenSession:l=>{v(ke({session:l}))},className:"border-l-0"}):void 0,peek:t.jsx(J.LivePeek,{rows:x,onScrollToRow:p,onOpenSession:l=>{v(ke({session:l}))},onOpenRoom:l=>{v({...xt.channels(),search:{id:l}})},onAnswerFirst:l=>{const w=m.find(R=>R.authorId===l);w!==void 0&&S(R=>new Map(R).set(l,w.entryId)),O.mutate({roomId:e.id,authorId:l})},promoted:G,onStopAll:()=>A.mutate({roomId:e.id}),stopping:A.isPending,onStopAgent:u,stoppingAgents:C})})}const Se=3e3;function Nn(e,s,o,a=Date.now){const b=n.useRef(null),r=n.useRef(new Map),i=n.useRef(new Map),p=b.current,v=r.current,h=i.current,m=a();for(const f of e){if(h.has(f.id))continue;if(p===null){h.set(f.id,"at-rest");continue}const j=v.get(f.authorId);h.set(f.id,j!==void 0&&m-j<Se?"handed-off":"dropped")}return n.useEffect(()=>{if(!o)return;b.current=new Set(e.map(j=>j.id));const f=a();for(const j of s)r.current.set(j,f);for(const[j,k]of r.current)f-k>Se&&r.current.delete(j);for(const j of i.current.keys())b.current.has(j)||i.current.delete(j)}),h}function In({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(se,{className:"h-3 w-24"}),t.jsx(se,{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",children:"This thread’s first message is gone. Its replies remain."})}function An({room:e,rootEntryId:s,focusComposer:o,entries:a,reactionFrequents:b,streamStalled:r,streamUnavailable:i,onRetryStream:p,historyLoaded:v,historyFailed:h=!1,landOnRow:m,pushed:f,onClose:j}){const k=n.useMemo(()=>ve(e.members,e.formerAuthors),[e.members,e.formerAuthors]),I=$e({room:e,threadRootId:s}),A=Ee(e.members,e.viewerAuthorId),g=Re(),C=n.useMemo(()=>new Map([...k].map(([c,x])=>[c,x.displayName])),[k]),{root:d,replies:u}=n.useMemo(()=>{let c;const x=[];for(const z of a)z.id===s?c=z:ye(z)===s&&x.push(z);return{root:c,replies:x}},[a,s]),O=d==null?void 0:d.threadReplyCount,_=O!==void 0&&O>u.length,S=!f,B=d===void 0||_?-1:(S?1:0)+u.length,T=Fe(u.length,O),P=n.useMemo(()=>new Set(u.map(c=>c.id)),[u]),D=n.useMemo(()=>({replyIds:P,inside:!0}),[P]),Q=Rt(e.id,D),H=Pe(e.id,s),$=Nn(u,Q,v),K=n.useRef(null),F=n.useCallback(c=>{var x;(x=K.current)==null||x.scrollToRow(c)},[]),G=n.useRef(null);n.useEffect(()=>{var c;o||(c=G.current)==null||c.focus()},[s,o]);const X=c=>{c.key!=="Escape"||c.defaultPrevented||(c.stopPropagation(),j())},L=n.useMemo(()=>{const c=[];if(d===void 0){const x=h?"thread-error":v?"thread-orphan":"thread-waiting";c.push({kind:"notice",id:x,at:"",body:null})}else S&&c.push({kind:"message",id:d.id,payload:d,grouping:{position:"only"},author:V(oe(d,k),k,g.faces),at:d.createdAt});for(const x of u)c.push({kind:"message",id:x.id,payload:x,grouping:{position:"only"},author:V(oe(x,k),k,g.faces),at:x.createdAt});return c},[d,S,u,k,g.faces,h,v]),q=n.useCallback(c=>{if(c.kind==="notice")return t.jsx(In,{kind:c.id});if(c.kind!=="message")return null;const x=c.payload,z=d!==void 0&&x.id===d.id,l=u.findIndex(E=>E.id===x.id),w=t.jsx(fe,{roomId:e.id,entry:x,rowId:re(x.id),roomKind:e.kind,author:c.author,authorRef:k.get(x.authorId),authors:k,viewerAuthorId:e.viewerAuthorId,authorNames:C,reactionFrequents:b,streamStalled:r,isMember:A,grouping:{position:"only"},answers:De(x,l<=0?d:u[l-1],E=>(d==null?void 0:d.id)===E?d:u.find(ee=>ee.id===E)),feedPosition:{index:z?1:(d===void 0||!S?0:1)+l+1,total:B}});if(z)return t.jsxs(t.Fragment,{children:[w,t.jsx(Ce,{count:T})]});const R=$.get(x.id)??"at-rest";return t.jsx("div",{className:ae(R==="dropped"&&"motion-safe:animate-thread-reply-in",R==="handed-off"&&"motion-safe:animate-reply-settle"),children:w})},[d,S,u,T,$,e.id,e.kind,e.viewerAuthorId,k,C,b,r,A,B]),W=n.useCallback(c=>c.kind==="message"?re(c.id):void 0,[]);return t.jsx(ze,{known:g,children:t.jsx(J.Root,{surface:"room",capabilities:be,target:I.target,anchor:"rail",children:t.jsxs("section",{ref:G,"aria-label":"Thread","data-testid":"room-thread-panel",tabIndex:-1,onKeyDown:X,className:ae("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:j,"aria-label":`Back to ${te(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(yt,{"aria-hidden":!0,className:"size-4 shrink-0"}),t.jsx("span",{className:"truncate",children:te(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:j,"aria-label":"Close thread",className:"focus-ring text-muted-foreground hover:text-foreground relative -ml-1 rounded p-1",children:t.jsx(bt,{"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:te(e)})]})]}),f&&d!==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(fe,{roomId:e.id,entry:d,rowId:re(d.id),roomKind:e.kind,author:V(oe(d,k),k,g.faces),authorRef:k.get(d.authorId),authors:k,viewerAuthorId:e.viewerAuthorId,authorNames:C,reactionFrequents:b,streamStalled:r,isMember:A,grouping:{position:"only"}}),t.jsx(Ce,{count:T})]}),t.jsx(J.Timeline,{ref:K,conversationId:`thread-${s}`,label:`Thread in ${te(e)}`,busy:!v&&!h,rows:L,renderRow:q,domIdOf:W,...m===void 0?{}:{landOnRow:m},pending:H,viewerAuthorId:e.viewerAuthorId,className:"py-3",feedTestId:"room-thread-feed"}),t.jsx(Be,{room:e,entries:a,scope:D,laneScope:"thread",stalled:f&&r===!0,unavailable:i,onRetry:f?p:void 0,onScrollToRow:F}),t.jsx(qe,{room:e,threadRootId:s,attachments:I.attachments,focusOnMount:o},s)]})})})}function Ce({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 Sn=96,Cn=500;function Mn(e){return e.offset.x>Sn||e.velocity.x>Cn}function Tn({children:e,onClose:s}){const o=jt()===!0,a=o?{x:0}:{x:"100%"};return t.jsx(xe.div,{"data-testid":"room-thread-sheet",className:"bg-card absolute inset-0 z-10 flex flex-col shadow-xl",initial:a,animate:{x:0},exit:a,transition:o?{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:(b,r)=>{Mn(r)&&s()},children:e})}const ie="room-thread-split",On=320,En=360,Pn=40,_n=50,Ln=25;function Me(e,s){return s<=0?Ln:Math.min(Math.round(e/s*1e3)/10,_n)}function Dn(e){const s=Me(On,e),o=Math.round((100-Me(En,e))*10)/10;return{minPct:s,maxPct:o,defaultPct:Math.min(Math.max(Pn,s),o)}}function Fn(e,s,o){if(e===null||s===null||s<=0)return o.defaultPct;const a=e/s*100;return Math.round(Math.min(Math.max(a,o.minPct),o.maxPct)*10)/10}function zn(e){try{const s=localStorage.getItem(e),o=s===null?NaN:Number(s);return Number.isFinite(o)&&o>0?o:null}catch{return null}}function Hn(e,s){try{localStorage.setItem(e,String(Math.round(s)))}catch{}}const $n="react-resizable-panels:room-thread-split";function qn(){try{localStorage.removeItem($n)}catch{}}function Wn(){const[e,s]=n.useState(null),[o,a]=n.useState(null);return{ref:n.useCallback(r=>{if(r===null)return;s(r);const i=()=>a(r.offsetWidth);i();const p=new ResizeObserver(i);return p.observe(r),()=>{p.disconnect(),s(null),a(null)}},[]),element:e,width:o,sizing:Dn(o??0)}}const Bn=`${ie}-room`,Te=`${ie}-thread`,Oe=`${ie}-handle`,Kn=4;function Gn({room:e,thread:s,storageKey:o=kt.ROOM_THREAD_WIDTH}){const{ref:a,element:b,width:r,sizing:i}=Wn(),[p,v]=n.useState(()=>zn(o)),[h,m]=n.useState(null),f=n.useRef(null),j=Fn(p,r,i),k=r===null||(i.maxPct-i.minPct)/100*r<Kn,I=s!==!1;n.useEffect(qn,[]);const A=n.useRef(!1);n.useLayoutEffect(()=>{var u;A.current&&((u=f.current)==null||u.resize(j))},[j,I]);const g=n.useRef(null),C=()=>{var S;const u=(S=f.current)==null?void 0:S.getSize(),O=g.current;if(g.current=null,u===void 0||r===null||r<=0||O===u)return;const _=Math.round(u/100*r);v(_),Hn(o,_)},d=h??j;return n.useLayoutEffect(()=>{const u=b==null?void 0:b.querySelector(`[data-panel-resize-handle-id="${Oe}"]`);u&&(u.setAttribute("aria-controls",Te),u.setAttribute("aria-valuenow",String(Math.round(d))),u.setAttribute("aria-valuemin",String(Math.round(i.minPct))),u.setAttribute("aria-valuemax",String(Math.round(i.maxPct))))}),t.jsx("div",{ref:a,className:"h-full overflow-hidden",children:t.jsxs(wt,{direction:"horizontal",id:ie,onLayout:u=>{A.current=u.length>1,m(A.current?u[1]:null)},children:[t.jsx(Ne,{id:Bn,order:1,className:"flex",children:e}),I&&t.jsxs(t.Fragment,{children:[t.jsx(Tt,{id:Oe,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:k,onDragging:u=>{var O;u&&(g.current=((O=f.current)==null?void 0:O.getSize())??null)},onKeyDownCapture:u=>{var O,_;k||(g.current=((O=f.current)==null?void 0:O.getSize())??null,!(u.key!=="Home"&&u.key!=="End")&&(u.preventDefault(),(_=f.current)==null||_.resize(u.key==="Home"?i.minPct:i.maxPct)))},onResizeEnd:C}),t.jsx(Ne,{ref:f,id:Te,order:2,defaultSize:j,minSize:i.minPct,maxSize:i.maxPct,className:"flex",children:s})]})]})})}function ns({roomId:e,threadId:s,entrySeq:o,threadRoute:a,aboveTimeline:b,aboveComposer:r,offerJumpBackIn:i,onComposerFocusChange:p}){const v=Nt(),h=Ot(),m=It(e),f=m==null?void 0:m.rootEntryId,j=xn(),k=n.useCallback(()=>{var x;const c=(x=Z.getState().open[e])==null?void 0:x.rootEntryId;Z.getState().closeThread(e),c!==void 0&&j.arm(c)},[e,j]),I=n.useCallback(c=>{Z.getState().openThread(e,c)},[e]),A=At(e),g=St(e),C=_t(e,g.isSuccess);Lt(e);const d=A.data,u=n.useMemo(()=>g.data??[],[g.data]),O=$e({room:d});vn({roomId:e,route:a,urlThreadId:s,openThreadId:f,entries:u,historyLoaded:g.isSuccess});const _=n.useMemo(()=>{var c;return((c=d==null?void 0:d.members.find(x=>x.author.id===d.viewerAuthorId))==null?void 0:c.lastReadSeq)??null},[d]),S=hn(e,_);Ct(d,u);const B=n.useRef(null),T=n.useRef(void 0),P=n.useCallback(c=>{T.current=c},[]),D=n.useCallback(()=>T.current,[]);n.useLayoutEffect(()=>{T.current=void 0},[e]);const Q=n.useCallback(c=>{var x;(x=B.current)==null||x.scrollToRow(c)},[]),H=en(e),{loadOlder:$,cursor:K}=H,F=n.useCallback(()=>{const c=qt(u,K);$().then(()=>{c!==null&&requestAnimationFrame(()=>{var x;return(x=B.current)==null?void 0:x.scrollToRow(c.domId)})})},[u,K,$]),G=mn({roomId:e,entrySeq:o,entries:u,historyLoaded:g.isSuccess}),X=n.useMemo(()=>f===void 0?void 0:{replyIds:new Set(u.filter(x=>ye(x)===f).map(x=>x.id)),inside:!1},[u,f]);if(A.isLoading)return t.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:t.jsx(We,{})});if(A.isError||!d)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 L=m!==void 0&&t.jsx(An,{room:d,rootEntryId:m.rootEntryId,focusComposer:m.focusComposer,entries:u,reactionFrequents:d.reactionFrequents,streamStalled:C.stalled,streamUnavailable:C.unavailable,onRetryStream:C.retry,historyLoaded:g.isSuccess,historyFailed:g.isError,...G.threadRow===void 0?{}:{landOnRow:G.threadRow},pushed:v,onClose:k},m.rootEntryId),q=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[b,t.jsx(cn,{ref:B,roomId:d.id,roomKind:d.kind,roomName:te(d),viewerAuthorId:d.viewerAuthorId,entries:u,members:d.members,formerAuthors:d.formerAuthors,lastReadSeq:S,reactionFrequents:d.reactionFrequents,streamStalled:C.stalled,isLoading:g.isLoading,error:g.error,onAddAgents:()=>Ie("add",d.id),openThreadId:f,onOpenThread:I,resumeRow:D,...G.roomRow===void 0?{}:{landOnRow:G.roomRow},onTopRow:P,canLoadOlder:H.canLoadOlder,isLoadingOlder:H.isLoadingOlder,onLoadOlder:F}),r,t.jsx(bn,{roomId:d.id}),t.jsx(jn,{roomId:d.id}),t.jsx(Be,{room:d,entries:u,scope:X,laneScope:"room",stalled:C.stalled,unavailable:C.unavailable,onRetry:C.retry,onScrollToRow:Q}),t.jsx(yn,{room:d,hasEntries:u.length>0,onAddAgents:()=>Ie("add",d.id)}),t.jsx(qe,{room:d,attachments:O.attachments,offerJumpBackIn:i,onFocusChange:p},d.id)]}),W={surface:"room",capabilities:be,target:O.target,anchor:"rail"};return v?t.jsx(J.Root,{...W,children:t.jsx("div",{style:{paddingBottom:h},"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:L!==!1,"data-testid":"room-under-thread",children:q}),t.jsx(Mt,{initial:!1,children:L!==!1&&t.jsx(Tn,{onClose:k,children:L},`thread-${f}`)})]})})}):t.jsx(J.Root,{...W,children:t.jsx(Gn,{room:q,thread:L})})}export{ns as R,tn as T,We 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-BR1m9FON.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};
|