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
package/dist/server/index.js.map
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/dist/server/index.js.map
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 67544843 bytes
|
|
4
|
+
sha256: 5f5886b2e6592c4c58df1d08060e24b19e2150bbbb93427150832b495c0d3d50
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dorkos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.133.0",
|
|
4
4
|
"description": "You, multiplied. Build and run your business with an agent team. Your agents join your team chat, take on real work, and build the tools your company runs on.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Dorian Collier",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"express": "^5.2.1",
|
|
67
67
|
"hono": "^4.13.9",
|
|
68
68
|
"node-pty": "^1.1.0",
|
|
69
|
-
"playwright-core": "1.
|
|
69
|
+
"playwright-core": "1.65.0-alpha-2026-10-30",
|
|
70
70
|
"qrcode-terminal": "^0.12.0",
|
|
71
71
|
"uuid": "^13.0.2",
|
|
72
72
|
"ws": "^8.22.0",
|
|
@@ -85,13 +85,13 @@
|
|
|
85
85
|
"vitest": "^4.1.11",
|
|
86
86
|
"@dorkos/browser": "0.0.0",
|
|
87
87
|
"@dorkos/db": "0.0.0",
|
|
88
|
-
"@dorkos/client": "0.0.0",
|
|
89
88
|
"@dorkos/eslint-config": "0.0.0",
|
|
90
89
|
"@dorkos/harness": "0.0.0",
|
|
91
|
-
"@dorkos/shared": "0.0.0",
|
|
92
90
|
"@dorkos/server": "0.0.0",
|
|
91
|
+
"@dorkos/typescript-config": "0.0.0",
|
|
92
|
+
"@dorkos/shared": "0.0.0",
|
|
93
93
|
"@dorkos/marketplace": "0.0.0",
|
|
94
|
-
"@dorkos/
|
|
94
|
+
"@dorkos/client": "0.0.0"
|
|
95
95
|
},
|
|
96
96
|
"scripts": {
|
|
97
97
|
"build": "tsx scripts/build.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as A,a6 as k,gU as x,gV as C,a7 as T,a8 as R,aJ as j,gW as D,gX as E,dS as I,j as n,bz as N,bA as P,G as L,bB as B,bD as _,r as F,d3 as q,d4 as O,d6 as K,d7 as W,d8 as M,eT as U,gY as z,eE as Q,e0 as H,B as p}from"./index-BwTGkJbK.js";function V(){const e=A();return k({queryKey:x.overview(),queryFn:()=>e.getPermissions()})}function Z(e,s){const a=new Set(e.filesAndCommands.followingAgentIds);if(s.kind==="files")return a.size;const t=e.exceptions.filter(r=>r.action===void 0),o=new Set;if(s.kind==="preset"){const r=new Map;for(const c of t){const l=r.get(c.agentId)??new Set;l.add(c.area),r.set(c.agentId,l)}for(const[c,l]of r)l.size>=C.length&&!a.has(c)&&o.add(c)}else{for(const r of t)r.area===s.area&&o.add(r.agentId);if(s.kind==="action")for(const r of e.exceptions)r.action===s.action&&o.add(r.agentId)}return Math.max(0,e.agentCount-o.size)}function ee(e){return`affects ${e} ${e===1?"agent":"agents"}`}function se(e){const s=A(),a=T();return R({mutationFn:async t=>{if(t.kind==="preset"){if(e.kind!=="default")throw new Error("A preset is chosen for everyone.");return s.setPermissionPreset({preset:t.preset,surface:t.surface,...t.applyToAgents?{applyToAgents:t.applyToAgents}:{}})}const o={...t.areas?{areas:t.areas}:{},...t.actions?{actions:t.actions}:{},surface:t.surface};return e.kind==="agent"?s.patchAgentPermissions(e.agentId,{...o,...t.filesAndCommands!==void 0?{filesAndCommands:t.filesAndCommands}:{}}):s.patchPermissionDefaults({...o,...t.applyToAgents?{applyToAgents:t.applyToAgents}:{}})},onSettled:()=>{a.invalidateQueries({queryKey:x.all}),a.invalidateQueries({queryKey:["mesh","agents"]}),a.invalidateQueries({queryKey:j.all})}})}const h={blocked:"Blocked",ask:"Ask",allowed:"Allowed"},v={careful:"Careful",balanced:"Balanced",full:"Full power",trusted:"Trusted"},te={careful:"Agents ask before they change anything, and can’t reach outside DorkOS.",balanced:"Agents run their rooms and ask before anything wider.",full:"Agents do everyday work alone and ask before installs or settings changes.",trusted:"Agents work on their own, and everything they do is recorded."};function ne(e,s){switch(e){case"default-area":case"default-action":return"Changed from your preset";case"preset":return`From ${v[s??"trusted"]}`;case"floor":return"Never Allowed";case"always-asks":return"Always asks, so you see the change first";default:return""}}const ae="Blocked stops agents that follow the rules. It isn’t a sandbox.",oe=["Rules limit tools, not what an agent can see in its own folder.","Keep secrets outside it."];function re(e){switch(e){case"agent":return"Set for this agent";case"runtime":return"Set in Settings → Runtimes";case"default":return"The setting everyone has";case"runtime-own":return"Not set, so each AI tool uses its own default"}}function w(e){return`the default (${v[e??"trusted"]})`}function ie(e){const s=h[e.state],a=e.agentName??"this agent";switch(e.source){case"inactive":return"Blocked, because this agent’s access was turned off.";case"floor":return`${s}. This area is locked, so it’s never Allowed.`;case"always-asks":return e.fromExtension?`${s}. Extension tools that can delete things always ask.`:`${s}. It always shows you the change first, so it’s never Allowed.`}if(e.destructiveAsk)return"Ask. Actions that run someone else’s code ask unless set one by one.";switch(e.source){case"agent-area":return`${s}, set for ${a}.`;case"agent-action":return`${s}, set for this one action on ${a}.`;case"default-area":return`${s} for everyone, changed from ${w(e.preset)}.`;case"default-action":return`${s} for everyone, set for this one action.`;case"preset":return`${s}, from ${w(e.preset)}.`}}function ce(e,s,a){const t=e?D(e):null;switch(s){case"agent":return`${t}, set for ${a??"this agent"}.`;case"runtime":return`${t}, set in Settings → Runtimes.`;case"default":return`${t}, the setting everyone has.`;case"runtime-own":return"Not set, so each AI tool uses its own default."}}const X={settings:" in Settings","agent-page":" on the agent’s page","control-center":" in the Control Center","request-card":" from a request card","first-run":" during setup","agent-request":" from an agent's request",api:" through the API",cli:" from the command line",upgrade:"",undo:" with Undo","file-edit":""};function Y(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function G(e){if(!e)return null;const s=`on ${Y(e.occurredAt)}`,a=X[e.surface];switch(e.attribution){case"signed-in":return`Changed by ${e.actorLabel.charAt(0).toLowerCase()+e.actorLabel.slice(1)} ${s}${a}.`;case"local-trust":return`Changed ${s}${a}. With login off, who is unknown.`;case"agent-request-approved":return`Changed ${s}: ${e.actorLabel}.`;case"agent":return`Changed by ${e.actorLabel} ${s}.`;case"upgrade":return`Set by an upgrade ${s}.`;case"outside":return`Changed outside DorkOS ${s}, in the agent’s settings file.`}}function le(e){E(e)||I.error(e instanceof Error&&e.message?e.message:"Couldn’t save that change. Try again.")}function de({question:e,sentence:s,lastChange:a,className:t}){const o=G(a);return n.jsxs(N,{children:[n.jsx(P,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":e,className:L("text-muted-foreground hover:text-foreground focus-visible:ring-ring inline rounded-sm py-2 text-xs underline decoration-dotted underline-offset-2 transition-colors focus-visible:ring-2 focus-visible:outline-none md:py-0",t),children:"Why?"})}),n.jsxs(B,{className:"w-72 space-y-1.5",align:"start",children:[n.jsx(_,{className:"text-sm font-medium",children:e}),n.jsx("p",{className:"text-sm","data-testid":"permission-why-source",children:s}),o?n.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"permission-why-change",children:o}):null]})]})}function ue({open:e,onCancel:s,subject:a,title:t,next:o,agents:r,affectedCount:c,onKeep:l,onUpdate:S,pending:m=!1}){const[u,f]=F.useState(new Set),b=o in h?h[o]:o,y=r.length,$=(i,g)=>{const d=new Set(u);g?d.add(i):d.delete(i),f(d)};return n.jsx(q,{open:e,onOpenChange:i=>{i||(f(new Set),s())},children:n.jsxs(O,{className:"!min-h-0 sm:max-w-md",children:[n.jsxs(K,{children:[n.jsx(W,{children:t??`Set ${a} to ${b} for everyone?`}),n.jsxs(M,{children:[y===1?"1 agent is":`${y} agents are`," set differently. Pick any that should follow."]})]}),n.jsxs(U,{className:"space-y-3",children:[n.jsx("ul",{className:"space-y-2","aria-label":"Agents set differently",children:r.map(i=>{const g=`apply-${i.agentId}`;return n.jsxs("li",{className:"flex items-center gap-2",children:[n.jsx(z,{id:g,checked:u.has(i.agentId),onCheckedChange:d=>$(i.agentId,d===!0)}),n.jsxs(Q,{htmlFor:g,className:"text-sm font-normal",children:[i.agentName,": ",i.detail]})]},i.agentId)})}),n.jsxs("p",{className:"text-muted-foreground text-sm",children:["This affects ",c," ",c===1?"agent":"agents"," now."]})]}),n.jsxs(H,{className:"gap-2",children:[n.jsx(p,{variant:"outline",onClick:()=>{f(new Set),l()},disabled:m,children:"Keep their settings"}),n.jsx(p,{onClick:()=>{const i=[...u];f(new Set),S(i)},disabled:m||u.size===0,children:"Update selected"})]})]})})}export{ue as A,ae as B,de as P,oe as R,h as S,se as a,ce as b,Z as c,ee as d,v as e,re as f,ne as g,te as h,G as l,le as r,ie as s,V as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gZ as v,g_ as fe,gW as be,g$ as Ce,j as e,bP as ee,bQ as ne,bR as te,bS as se,h0 as Ne,bT as ae,h1 as ie,bU as re,bV as ce,bX as oe,a5 as de,a7 as Ie,a8 as Te,a6 as Ae,y as le,h2 as Se,r as A,h3 as he,eE as x,ex as S,ey as R,ez as k,eA as F,eB as b,h4 as Re,h5 as ke,a3 as E,a2 as pe,aO as Fe,h6 as Oe,h7 as we,a9 as Me,d0 as De,d3 as Ee,d4 as Be,d6 as $e,d7 as _e,d8 as Le,am as Pe,I as ze,h8 as X,B,e0 as qe,h9 as He,fE as Ge,ha as Qe,x as Ue}from"./index-BwTGkJbK.js";import{B as We}from"./use-bindings-CltfjAWW.js";import{u as Ye}from"./form-D3VdAYl4.js";import{I as Ke,t as Ve}from"./trust-posture-atZIh8tf.js";function Z(n){return`Turn on ${be(n.stop)}`}function Xe(n){return!v(n)||fe(n)?null:"This stop never pauses to ask. It acts without checking with you."}function Ze({descriptor:n,consequence:i,onCancel:o,onConfirm:h}){const d=Ce(n??void 0),y=n?Xe(n):null;return e.jsx(ee,{open:n!==null,onOpenChange:C=>!C&&o(),children:e.jsxs(ne,{children:[e.jsxs(te,{children:[e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Ne,{descriptor:n??void 0,className:`size-4 ${d}`}),n&&Z(n)]}),e.jsxs(ae,{children:[n==null?void 0:n.promise,y&&" ",y&&e.jsx("span",{className:"text-foreground mt-2 block","data-testid":"consent-asks-note",children:y})]})]}),e.jsx("div",{className:"text-muted-foreground space-y-2 text-sm",children:i}),n&&e.jsx(ie,{mode:n.id,descriptor:n}),e.jsxs(re,{children:[e.jsx(ce,{children:"Cancel"}),e.jsx(oe,{onClick:h,children:n&&Z(n)})]})]})})}function dn(n={}){const i=de(),o=Ie();return Te({mutationFn:h=>i.createBinding(h),onSuccess:()=>{o.invalidateQueries({queryKey:[...We]})},meta:n.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:n.errorLabel??"Couldn’t add that connection"}})}function Je(n){const i=de();return Ae({queryKey:["relay","observed-chats",n],queryFn:()=>i.getObservedChats(n),enabled:!!n,staleTime:3e4})}const J=[{value:"per-chat",label:"One shared chat per group or channel",description:"Everyone there shares one chat with the agent."},{value:"per-user",label:"One chat per person",description:"Each person gets their own chat, even in a group."},{value:"stateless",label:"A fresh start every message",description:"Nothing carries over from the message before."}],G="claude-code";function ve({strategy:n,onStrategyChange:i,permissionMode:o,onPermissionModeChange:h,canInitiate:d,onCanInitiateChange:y,canReply:C,onCanReplyChange:O,canReceive:w,onCanReceiveChange:M,notifyOnTaskComplete:$,onNotifyOnTaskCompleteChange:_,notifyBootstrapHint:p,bridged:L,open:P,onOpenChange:z,hasChanges:q}){const u=J.find(l=>l.value===n),j=le(G),c=(j==null?void 0:j.permissionModes.values)??[],r=c.find(l=>l.id===o),D=(r==null?void 0:r.label)??Se(o),[f,I]=A.useState(null);function H(l){const N=c.find(T=>T.id===l);if(N&&v(N)){I(N);return}h(l)}return e.jsxs(e.Fragment,{children:[e.jsxs(he,{open:P,onOpenChange:z,trigger:"Advanced",badge:q?e.jsx(pe,{variant:"secondary",children:"Modified"}):void 0,children:[L?e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(x,{children:"How the agent remembers"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Kept in the channel this chat is linked to."})]}):e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(x,{htmlFor:"binding-session-strategy",children:"How the agent remembers"}),e.jsxs(S,{value:n,onValueChange:l=>i(l),children:[e.jsx(R,{id:"binding-session-strategy",className:"w-full",children:e.jsx(k,{})}),e.jsx(F,{children:J.map(l=>e.jsx(b,{value:l.value,children:l.label},l.value))})]}),u&&e.jsx("p",{className:"text-muted-foreground text-xs",children:u.description})]}),e.jsxs("div",{className:"space-y-2 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Permissions"}),c.length===0?e.jsxs("p",{"data-testid":"trust-dial-unavailable",className:"text-muted-foreground px-1 text-xs leading-relaxed",children:["Set to “",D,"”. No other levels to choose yet. Saving keeps it."]}):e.jsxs(e.Fragment,{children:[e.jsx(Re,{mode:o,descriptors:c,onChangeMode:H,strandsWorkingMode:!0,strandedNote:e.jsxs(e.Fragment,{children:["Set to “",D,"”. Saving keeps it, or pick a stop."]})}),e.jsx(ie,{mode:o,...r?{descriptor:r}:{},className:"px-1"})]})]}),e.jsxs("div",{className:"space-y-2.5 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Message direction"}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsxs(x,{htmlFor:"perm-initiate",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal",children:[e.jsx(ke,{className:"text-muted-foreground size-3"}),"Agent can message first"]}),e.jsx(E,{id:"perm-initiate",checked:d,onCheckedChange:y,"aria-label":"Agent can message first"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(x,{htmlFor:"perm-reply",className:"cursor-pointer text-xs font-normal",children:"Agent can reply to messages"}),e.jsx(E,{id:"perm-reply",checked:C,onCheckedChange:O,"aria-label":"Agent can reply to messages"})]}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(x,{htmlFor:"perm-receive",className:"cursor-pointer text-xs font-normal",children:"Agent receives new messages"}),e.jsx(E,{id:"perm-receive",checked:w,onCheckedChange:M,"aria-label":"Agent receives new messages"})]})]}),e.jsxs("div",{className:"space-y-2.5 px-4 py-3",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Notifications"}),e.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-3",children:[e.jsx(x,{htmlFor:"notify-task-complete",className:"cursor-pointer text-xs font-normal",children:"Message me when scheduled tasks finish"}),e.jsx(E,{id:"notify-task-complete",checked:$,onCheckedChange:_,"aria-label":"Message me when scheduled tasks finish"})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"When off, you still hear about runs that didn’t finish."}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Needs “Agent can message first”."}),p&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"Message your bot once to start. Bots can’t write first."})]})]}),e.jsx(Ze,{descriptor:f,consequence:e.jsxs(e.Fragment,{children:["Anyone who can message this connection can make the agent act, with no one asked."," ",e.jsxs(Ke,{label:"About asking in the chat",title:"At a stop that asks",children:[e.jsx("p",{children:"Where your connection can show buttons, the agent waits for Approve or Deny."}),e.jsx("p",{children:"Only people on the approver list can answer."}),e.jsx("p",{children:"An ask nobody answers is refused after 10 minutes, and the agent carries on."})]})]}),onCancel:()=>I(null),onConfirm:()=>{f&&h(f.id),I(null)}})]})}const m="__any__",en={"per-chat":"One shared chat per group or channel","per-user":"One chat for each person",stateless:"No memory between messages"},me=[{value:"dm",label:"Direct message"},{value:"group",label:"Group"},{value:"channel",label:"Broadcast channel"},{value:"thread",label:"Thread"}];function xe(n){var i;return((i=me.find(o=>o.value===n))==null?void 0:i.label)??n}function nn({sessionStrategy:n,chatDisplayName:i,channelType:o}){const h=en[n];return i?`${h} in ${i}`:o?`${h} · ${xe(o)}`:h}function ln(n){return{adapterId:n.adapterId,agentId:n.agentId,sessionStrategy:n.sessionStrategy,label:n.label,permissionMode:n.permissionMode,chatId:n.chatId,channelType:n.channelType,canInitiate:n.canInitiate,canReply:n.canReply,canReceive:n.canReceive,notifyOnTaskComplete:n.notifyOnTaskComplete}}function hn(n){return{sessionStrategy:n.sessionStrategy,label:n.label,permissionMode:n.permissionMode,chatId:n.chatId??null,channelType:n.channelType??null,canInitiate:n.canInitiate,canReply:n.canReply,canReceive:n.canReceive,notifyOnTaskComplete:n.notifyOnTaskComplete}}function tn(n){return!!(n!=null&&n.canInitiate||(n==null?void 0:n.canReply)===!1||(n==null?void 0:n.canReceive)===!1||(n==null?void 0:n.notifyOnTaskComplete)===!1||(n==null?void 0:n.permissionMode)!==void 0&&n.permissionMode!=="acceptEdits"||n!=null&&n.sessionStrategy&&n.sessionStrategy!=="per-chat")}function sn(n,i){return{adapterId:(n==null?void 0:n.adapterId)??"",agentId:(n==null?void 0:n.agentId)??"",strategy:(n==null?void 0:n.sessionStrategy)??"per-chat",label:(n==null?void 0:n.label)??"",chatId:(n==null?void 0:n.chatId)??m,channelType:(n==null?void 0:n.channelType)??m,permissionMode:(n==null?void 0:n.permissionMode)??(i==null?void 0:i.defaultPermissionMode)??"acceptEdits",canInitiate:(n==null?void 0:n.canInitiate)??(i==null?void 0:i.defaultCanInitiate)??!1,canReply:(n==null?void 0:n.canReply)??!0,canReceive:(n==null?void 0:n.canReceive)??!0,notifyOnTaskComplete:(n==null?void 0:n.notifyOnTaskComplete)??!0}}function pn({open:n,onOpenChange:i,onConfirm:o,mode:h,initialValues:d,adapterName:y,agentName:C,onDelete:O,bindingId:w,isPending:M,bridged:$,bridgeSlot:_}){const p=h==="edit",[L,P]=A.useState(()=>!!(d!=null&&d.chatId||d!=null&&d.channelType)),[z,q]=A.useState(()=>tn(d)),{data:u}=Fe(),j=le(G),[c]=A.useState(()=>{var t;return sn(d,p?void 0:{defaultPermissionMode:Oe(we(u==null?void 0:u.executionDefaults,G),(j==null?void 0:j.permissionModes.values)??[]),defaultCanInitiate:u!=null&&Ve((t=u.permissions)==null?void 0:t.preset)==="trusted"})}),r=Ye({defaultValues:c,onSubmit:async({value:t})=>{await o({adapterId:t.adapterId,agentId:t.agentId,sessionStrategy:t.strategy,label:t.label,permissionMode:t.permissionMode,chatId:t.chatId===m?void 0:t.chatId,channelType:t.channelType===m?void 0:t.channelType,canInitiate:t.canInitiate,canReply:t.canReply,canReceive:t.canReceive,notifyOnTaskComplete:t.notifyOnTaskComplete}),p||r.reset()}}),{data:D=[]}=Me(),{data:f}=De(),[I,H]=A.useState(()=>(d==null?void 0:d.adapterId)??""),{data:l=[]}=Je(I||void 0),N=D.flatMap(t=>t.instances.filter(g=>g.enabled).map(g=>({id:g.id,label:g.label?`${g.label} (${t.manifest.displayName})`:`${g.id} (${t.manifest.displayName})`}))),T=(f==null?void 0:f.agents)??[];function ge(){r.setFieldValue("chatId",m),r.setFieldValue("channelType",m)}return e.jsx(Ee,{open:n,onOpenChange:i,children:e.jsxs(Be,{className:"max-h-[85vh] max-w-md gap-0 p-0",children:[e.jsxs($e,{className:"border-b px-4 py-3",children:[e.jsx(_e,{children:p?"Edit connection":"Add connection"}),e.jsx(Le,{className:"sr-only",children:p?"Edit this connection’s settings":"Connect this agent to a chat"})]}),e.jsx(r.Subscribe,{selector:t=>({values:t.values,isSubmitting:t.isSubmitting}),children:({values:t,isSubmitting:g})=>{var V;const Q=p||!!t.adapterId&&!!t.agentId,ue=!p||t.adapterId!==c.adapterId||t.agentId!==c.agentId||t.strategy!==c.strategy||t.label!==c.label||t.chatId!==c.chatId||t.channelType!==c.channelType||t.permissionMode!==c.permissionMode||t.canInitiate!==c.canInitiate||t.canReply!==c.canReply||t.canReceive!==c.canReceive||t.notifyOnTaskComplete!==c.notifyOnTaskComplete,U=p?C:(V=T.find(s=>s.id===t.agentId))==null?void 0:V.name,W=Q&&U?`${nn({sessionStrategy:t.strategy,chatDisplayName:t.chatId!==m?`#${t.chatId}`:void 0,channelType:t.channelType!==m?t.channelType:void 0})}. Routed to ${U}.`:null,Y=t.chatId!==m||t.channelType!==m,ye=t.strategy!=="per-chat"||t.permissionMode!=="acceptEdits"||t.canInitiate||!t.canReply||!t.canReceive||!t.notifyOnTaskComplete,je=!Q||!ue||!!M||g,K=!!M||g;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-5 overflow-y-auto px-4 py-5",children:[p?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Connection:"," ",e.jsx("span",{className:"text-foreground font-medium",children:y})," →"," ",e.jsx("span",{className:"text-foreground font-medium",children:C})]}),_]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"binding-adapter",children:"Source"}),N.length===0?e.jsx("p",{className:"text-muted-foreground border-input rounded-md border px-3 py-2 text-sm opacity-50",children:"Nothing set up yet"}):e.jsx(r.AppField,{name:"adapterId",children:s=>e.jsxs(S,{value:s.state.value,onValueChange:a=>{s.handleChange(a),H(a)},children:[e.jsx(R,{id:"binding-adapter",className:"w-full",children:e.jsx(k,{placeholder:"Pick a source"})}),e.jsx(F,{children:N.map(a=>e.jsx(b,{value:a.id,children:a.label},a.id))})]})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"binding-agent",children:"Agent"}),T.length===0?e.jsx("p",{className:"text-muted-foreground border-input rounded-md border px-3 py-2 text-sm opacity-50",children:"No agents yet"}):e.jsx(r.AppField,{name:"agentId",children:s=>e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(R,{id:"binding-agent",className:"w-full",children:e.jsx(k,{placeholder:"Select an agent"})}),e.jsx(F,{children:T.map(a=>e.jsx(b,{value:a.id,children:Pe(a)},a.id))})]})})]})]}),e.jsx(r.AppField,{name:"label",children:s=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"binding-label",children:"Label (optional)"}),e.jsx(ze,{id:"binding-label",placeholder:"e.g., Customer support bot",value:s.state.value,onBlur:s.handleBlur,onChange:a=>s.handleChange(a.target.value)}),e.jsx(X,{children:"A name to tell this connection apart"})]})}),e.jsxs(he,{open:L,onOpenChange:P,trigger:"Chat filter",badge:Y?e.jsx(pe,{variant:"secondary",children:"Active"}):void 0,children:[e.jsx(r.AppField,{name:"chatId",children:s=>e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(x,{htmlFor:"binding-chat-id",children:"Chat ID"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(R,{id:"binding-chat-id",className:"w-full",children:e.jsx(k,{placeholder:"Any chat"})}),e.jsxs(F,{children:[e.jsx(b,{value:m,children:"Any chat"}),l.map(a=>e.jsxs(b,{value:a.chatId,children:[e.jsx("span",{children:a.displayName??a.chatId}),(a.channelType||a.messageCount>0)&&e.jsx("span",{className:"text-muted-foreground ml-2 text-xs",children:[a.channelType?xe(a.channelType):null,`${a.messageCount} messages`].filter(Boolean).join(" · ")})]},a.chatId))]})]}),e.jsx(X,{children:"Only take messages from this chat"})]})}),e.jsx(r.AppField,{name:"channelType",children:s=>e.jsxs("div",{className:"space-y-1.5 px-4 py-3",children:[e.jsx(x,{htmlFor:"binding-channel-type",children:"Chat type"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(R,{id:"binding-channel-type",className:"w-full",children:e.jsx(k,{placeholder:"Any type"})}),e.jsxs(F,{children:[e.jsx(b,{value:m,children:"Any type"}),me.map(a=>e.jsx(b,{value:a.value,children:a.label},a.value))]})]})]})}),Y&&e.jsx("div",{className:"px-4 py-3",children:e.jsx(B,{variant:"ghost",size:"sm",onClick:ge,children:"Clear filters"})})]}),e.jsx(ve,{strategy:t.strategy,onStrategyChange:s=>r.setFieldValue("strategy",s),permissionMode:t.permissionMode,onPermissionModeChange:s=>r.setFieldValue("permissionMode",s),canInitiate:t.canInitiate,onCanInitiateChange:s=>r.setFieldValue("canInitiate",s),canReply:t.canReply,onCanReplyChange:s=>r.setFieldValue("canReply",s),canReceive:t.canReceive,onCanReceiveChange:s=>r.setFieldValue("canReceive",s),notifyOnTaskComplete:t.notifyOnTaskComplete,onNotifyOnTaskCompleteChange:s=>r.setFieldValue("notifyOnTaskComplete",s),notifyBootstrapHint:l.length===0,bridged:$,open:z,onOpenChange:q,hasChanges:ye}),W&&e.jsx("p",{className:"text-muted-foreground bg-muted/50 rounded-md px-3 py-2 text-xs italic",children:W})]}),e.jsxs(qe,{className:"border-t px-4 py-3",children:[p&&O&&w&&e.jsxs(ee,{children:[e.jsx(He,{asChild:!0,children:e.jsxs(B,{variant:"ghost",size:"sm",className:"mr-auto text-red-600 hover:bg-red-50 hover:text-red-700 dark:hover:bg-red-950",children:[e.jsx(Ge,{className:"mr-1.5 size-3.5"}),"Remove"]})}),e.jsxs(ne,{children:[e.jsxs(te,{children:[e.jsx(se,{children:"Remove this connection?"}),e.jsx(ae,{children:"This agent stops getting messages from it."})]}),e.jsxs(re,{children:[e.jsx(ce,{children:"Cancel"}),e.jsx(oe,{onClick:()=>O(w),className:Qe({variant:"destructive"}),children:"Remove connection"})]})]})]}),e.jsx(B,{variant:"ghost",size:"sm",onClick:()=>i(!1),children:"Cancel"}),e.jsxs(B,{size:"sm",onClick:()=>r.handleSubmit(),disabled:je,children:[K&&e.jsx(Ue,{size:"xs",className:"mr-1.5"}),K?"Saving…":p?"Save changes":"Add connection"]})]})]})}})]})})}export{pn as B,dn as a,nn as b,ln as c,xe as d,hn as t,Je as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-DGccoZ8Q.js","assets/index-BwTGkJbK.js","assets/index-MpS13vhQ.css","assets/index-264YDu-W.js","assets/index-Di-MIFQG.js","assets/BlintzCanvas-CMzZnmWK.js","assets/index-Dpu2CORc.js","assets/BlintzCanvas-DCXOV_yN.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as a,a_ as z,hf as ce,j as t,G as O,g7 as oe,g8 as le,B as D,g9 as ue,ga as de,gb as X,hg as fe,dp as he,dq as pe,J as me,go as ve,dr as xe,a7 as ge,hh as be,a$ as ee,a5 as ye,hi as je,a6 as Ce}from"./index-BwTGkJbK.js";import{u as ke,a as we,b as Re}from"./use-session-canvas-BvvO-_V1.js";import{R as Te}from"./rotate-cw-uoeBxIeM.js";import"./query-keys-DeYqUDia.js";import"./index.esm-CYmalBux.js";import"./WidgetErrorCard-Bwlfu514.js";import"./index-Ci_J5Q-6.js";import"./progress-Cr-4myw6.js";import"./markdown-content-BRaPEOC7.js";import"./table-dWrfPeX-.js";import"./package-DBsl3ao5.js";import"./heart-BHMhDZ0K.js";import"./git-branch-Df7a5_fb.js";import"./file-text-C_NPIQr4.js";import"./file-BIF-4ARS.js";import"./McpAppFrame-Dm7MqOhc.js";import"./more-details-oDazWBxm.js";function B(e,r){return["canvas-file",e,r]}function Ne({documentId:e,sourcePath:r,binding:d,save:n,draftRef:o,revisionRef:s,finishAttemptRef:C,timerRef:y,finalSaveRef:b,invalidateConfirmedFile:p}){const x=a.useRef({binding:d,save:n,invalidateConfirmedFile:p}),_=a.useRef(null),f=a.useRef(null);return a.useLayoutEffect(()=>{x.current={binding:d,save:n,invalidateConfirmedFile:p}}),a.useLayoutEffect(()=>{const w=z.getState().openDocuments.find(m=>m.id===e);if(!w||typeof w.openedAt!="number")return;const R=ce(e,w.openedAt,r,{required:()=>!!x.current.binding,current:()=>{const m=f.current;return!!m&&m.revision===s.current&&m.attempt===C.current&&m.binding===x.current.binding&&m.save===x.current.save&&m.binding.current()},invalidateConfirmedFile:()=>x.current.invalidateConfirmedFile(),prepare:async()=>{var c;f.current=null;const{binding:m,save:T}=x.current;if(!(m!=null&&m.current()))return!1;y.current&&(clearTimeout(y.current),y.current=null);const F=o.current,g=s.current,l=++C.current,i=await T(F);return i.status!=="changed"&&i.status!=="no_op"||i.confirmed.content!==F||s.current!==g||C.current!==l||x.current.binding!==m||x.current.save!==T||!m.current()?!1:((c=b.current)==null||c.cancel(),b.current=null,f.current={revision:g,attempt:l,binding:m,save:T},!0)}});return _.current=R,()=>R.retire()},[e,r,o,s,C,y,b]),_}function M(e){return e.status==="refused"||e.status==="local_uncertain"?e.status:"unavailable"}function _e(e,r,d){var l;const n=a.useRef(e),o=a.useRef(null),s=a.useRef(null),[C,y]=a.useState({identity:e.identity,phase:"pending",busy:!1});a.useLayoutEffect(()=>{n.current=e},[e]);const b=a.useCallback((i,c)=>{o.current===i&&n.current.identity===i&&n.current.current()&&y(u=>({identity:i,...c,historical:c.historical??(u.identity===i?u.historical:void 0)}))},[]),p=a.useCallback(i=>{o.current!==i||n.current.identity!==i||y(c=>c.identity===i?{...c,phase:"unavailable",busy:!1}:{identity:i,phase:"unavailable",busy:!1})},[]),x=e.identity,_=e.supported;a.useLayoutEffect(()=>{const i=n.current;s.current=null,o.current=x;let c=!1;return _&&r==="ready"&&i.discover().then(u=>{c||(u.status==="observed"?b(x,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(x,{phase:M(u),busy:!1}):p(x))}),()=>{c=!0,s.current=null,o.current===x&&(o.current=null)}},[x,_,r,d,b,p]);const f=C.identity===e.identity?C:void 0,w=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return;s.current=null,y(j=>({identity:c,phase:"pending",busy:!0,historical:j.identity===c?j.historical:void 0}));const u=await i.discover(!0);u.status==="observed"?b(c,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(c,{phase:M(u),busy:!1}):p(c)},[b,p]),R=a.useCallback(async i=>{const c=n.current,u=c.identity;if(o.current!==u||!c.current())return;s.current=null,y(h=>({identity:u,phase:"pending",busy:!0,discovery:h.identity===u?h.discovery:void 0,historical:h.identity===u?h.historical:void 0}));const j=await c.recover(i);j.status==="observed"?b(u,{phase:"ready",discovery:j.value.discovery,historical:j.value.result.entry,busy:!1}):j.status!=="idle"?b(u,{phase:M(j),busy:!1}):p(u)},[b,p]),m=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return{status:"idle"};const u={};s.current=u,y(h=>h.identity===c?{...h,phase:"pending",busy:!0}:h);const j=await i.inspectCurrent();return s.current!==u?{status:"idle"}:(s.current=null,j.status==="idle"&&p(c),o.current===c&&n.current.identity===c&&i.current()&&j.status!=="idle"&&y(h=>h.identity===c?{...h,phase:j.status==="observed"?"ready":M(j),busy:!1}:h),j)},[p]),T=e.supported&&r==="ready",F=r==="pending"?"pending":(f==null?void 0:f.phase)??"pending",g=T&&(F!=="ready"||((l=f==null?void 0:f.discovery)==null?void 0:l.admission)==="blocked");return{supported:T,phase:F,editBlocked:g,busy:(f==null?void 0:f.busy)??F==="pending",discovery:f==null?void 0:f.discovery,historical:f==null?void 0:f.historical,refresh:w,recover:R,inspectCurrent:m}}const Fe={unavailable:"Couldn’t check previous saves, so editing is off.",refused:"This file can’t be edited from this canvas."};function Pe(e){var r,d,n;return e.supported?e.phase==="unavailable"||e.phase==="refused"||e.phase==="local_uncertain"?!0:((r=e.discovery)==null?void 0:r.admission)==="blocked"||((d=e.discovery)==null?void 0:d.entries.some(o=>o.state==="review"))===!0||((n=e.historical)==null?void 0:n.state)==="receipt":!1}function Z({recovery:e,editing:r,loadCurrent:d}){var o;if(e.phase==="unavailable"||e.phase==="refused")return t.jsxs(t.Fragment,{children:[t.jsx("p",{role:"alert",className:"col-start-1 row-start-1 py-1.5",children:Fe[e.phase]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",className:"col-span-2 col-start-1 row-start-2 mb-1.5 justify-self-start @md:col-span-1 @md:col-start-2 @md:row-start-1 @md:mb-0",disabled:e.busy||r,onClick:()=>void e.refresh(),children:"Check again"})]});if(e.phase==="local_uncertain")return t.jsx("p",{role:"alert",children:"Use Retry original save. Checking previous saves won’t confirm this save."});const n=e.discovery;return t.jsxs("div",{className:"space-y-1",children:[(n==null?void 0:n.admission)==="blocked"&&t.jsx("p",{role:"alert",children:"An unresolved original save blocks this file. This list may not include the blocking operation."}),(n==null?void 0:n.hasMore)&&t.jsx("p",{children:"Only the latest 25 matching saves are shown. Older evidence is omitted."}),n&&n.entries.length>0&&t.jsx(t.Fragment,{children:t.jsx("ul",{children:n.entries.map(s=>t.jsxs("li",{children:[t.jsxs("span",{children:[s.eventId,":"," ",s.state==="receipt"?"Historical save recorded":s.state==="review"?"Original save needs review":s.state==="no_op"?"Original save made no change":"Original save failed before replacement"]}),s.state==="review"&&(s.reason==="prepared_without_replacement"?t.jsx("p",{children:"This save needs manual review. These controls won’t write the file."}):t.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsx("p",{children:"The original saved replacement must be proven before its receipt can be settled."}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:e.busy||r,onClick:()=>void e.recover(s.eventId),children:"Recover original receipt"})]}))]},s.eventId))})}),(n==null?void 0:n.admission)==="blocked"&&n.entries.length===0&&t.jsx("p",{children:"No matching recent saves."}),((o=e.historical)==null?void 0:o.state)==="receipt"&&t.jsxs("div",{role:"status",className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsxs("div",{children:[t.jsx("p",{children:"Previous save confirmed. Your current draft may differ."}),t.jsx("p",{children:e.historical.currentFileMatch==="different"?"The current file differs from that historical save.":e.historical.currentFileMatch==="same_saved_replacement"?"The saved replacement matched when checked; current bytes still require a fresh load.":"The current file was not checked."})]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:r||e.editBlocked||e.busy,onClick:d,children:"Load current file"})]})]})}function Se({recovery:e,editing:r,loadCurrent:d}){return!e.supported||r?null:t.jsxs(oe,{children:[t.jsx(le,{asChild:!0,children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground","aria-label":"More file actions",children:t.jsx(ue,{className:"size-4"})})}),t.jsxs(de,{align:"end",children:[t.jsx(X,{disabled:e.busy,onSelect:()=>void e.refresh(),children:"Check previous saves"}),t.jsx(X,{disabled:e.editBlocked||e.busy,onSelect:()=>d(),children:"Load current file"})]})]})}function De({recovery:e,editing:r,loadCurrent:d,toolbar:n}){const o=Pe(e),s=e.phase==="unavailable"||e.phase==="refused";return t.jsxs(t.Fragment,{children:[e.supported&&e.phase==="pending"&&t.jsx("p",{role:"status",className:"sr-only",children:"Checking previous saves…"}),t.jsx("div",{...o?{role:"region","aria-label":"Previous file saves"}:{},className:O("shrink-0",o?"bg-muted text-foreground mx-2 mt-2 rounded-md py-1 pr-1 pl-3 text-sm":"flex justify-end px-2 pt-1",o&&(s?"@container":"flow-root")),children:t.jsxs("div",{className:O(o&&s&&"grid grid-cols-[1fr_auto] items-center gap-x-2 @md:grid-cols-[1fr_auto_auto]"),children:[t.jsx("div",{className:O("flex items-center gap-1",o&&!s&&"float-right ml-2",o&&s&&"col-start-2 row-start-1 @md:col-start-3"),children:n}),o&&(s?t.jsx(Z,{recovery:e,editing:r,loadCurrent:d}):t.jsx("div",{className:"py-1.5",children:t.jsx(Z,{recovery:e,editing:r,loadCurrent:d})}))]})})]})}function Le({editing:e,off:r,observation:d,onClick:n}){return t.jsx(fe,{children:t.jsxs(he,{...r?{}:{open:!1},children:[t.jsx(pe,{asChild:!0,children:t.jsx("span",{className:"inline-flex",children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:n,"aria-label":e?"Finish editing":"Edit file",disabled:r,"data-document-save-observation":d,children:e?t.jsx(me,{className:"size-4"}):t.jsx(ve,{className:"size-4"})})})}),t.jsx(xe,{children:"Editing is off"})]})})}const Ee=a.lazy(()=>ee(()=>import("./CodeMirrorEditor-DGccoZ8Q.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),ze=a.lazy(()=>ee(()=>import("./BlintzCanvas-CMzZnmWK.js").then(e=>e.B),__vite__mapDeps([5,1,2,6,4,7])).then(e=>({default:e.BlintzCanvas}))),Be=500;function Me(e,r){return r==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function Oe(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";case"uncertain":return"Save not confirmed";default:return null}}function te({content:e,documentId:r,cwd:d,loaded:n,theme:o,isEditing:s,onEditingChange:C,setDocumentEditing:y,observedBinding:b,fileSaveObservation:p="unavailable",recoveryBinding:x}){const _=e.readOnly!==!0,f=Me(e.sourcePath,e.language),w=ge(),[R,m]=a.useState(n),[T,F]=a.useState(),g=a.useRef(b);a.useLayoutEffect(()=>{g.current=b},[b]);const l=ke({documentId:r,sourcePath:e.sourcePath,cwd:d,loadedContent:n,documentSaveBinding:T,documentRecoveryBinding:x}),i=_e(l.recovery,p,x),c=we({cwd:d,sourcePath:f?e.sourcePath:null,content:R,saved:l.status==="saved"}),u=a.useRef(!1),j=a.useRef(s);a.useLayoutEffect(()=>(u.current=!0,j.current=s,()=>{u.current=!1}),[s]);const h=a.useRef(null),S=a.useRef(R),L=a.useRef(0),A=a.useRef(0),I=a.useRef(l.save),K=a.useRef(l.prepareFinalSave),U=a.useRef(l.waitForCloseDrain),E=a.useRef(null),$=a.useRef(C),V=Ne({documentId:r,sourcePath:e.sourcePath,binding:T,save:l.save,draftRef:S,revisionRef:L,finishAttemptRef:A,timerRef:h,finalSaveRef:E,invalidateConfirmedFile:()=>{w.invalidateQueries({queryKey:B(d,e.sourcePath)}).catch(()=>{})}});a.useEffect(()=>{S.current=R,I.current=l.save,K.current=l.prepareFinalSave,U.current=l.waitForCloseDrain,$.current=C});const Y=a.useCallback(v=>{var k;L.current+=1,S.current=v,m(v),(k=E.current)==null||k.cancel(),E.current=K.current(v),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,I.current(S.current)},Be)},[]),se=()=>{var P;if(i.editBlocked||p==="pending"||p==="ready"&&!((P=g.current)!=null&&P.current()))return;const v=g.current,k=v&&Object.freeze({...v.incarnation});F(v!=null&&v.current()&&k?{incarnation:k,current:()=>{const N=g.current;return!!N&&be(k,N.incarnation)&&N.current()}}:void 0),L.current+=1,S.current=n,m(n),C(!0),y(r,!0)},ne=async()=>{h.current&&(clearTimeout(h.current),h.current=null);const v=S.current,k=L.current,P=++A.current,N=await I.current(v);if(N.status!=="changed"&&N.status!=="no_op"||L.current!==k||A.current!==P||N.confirmed.content!==v)return;const q=N.confirmed;q.content===S.current&&w.setQueryData(B(d,e.sourcePath),Q=>Q&&{...Q,content:q.content,hash:q.hash}),C(!1),y(r,!1)},re=()=>{w.invalidateQueries({queryKey:B(d,e.sourcePath)})};a.useEffect(()=>{var v;s||(h.current&&clearTimeout(h.current),h.current=null,(v=E.current)==null||v.cancel(),E.current=null)},[s]),a.useEffect(()=>{const v=V.current;return()=>{var N;h.current&&(clearTimeout(h.current),h.current=null);const k=(N=E.current)==null?void 0:N.flush(),P=S.current;v==null||v.settleRetirement(Promise.resolve(k).then(()=>U.current(P))),E.current=null,y(r,!1),$.current(!1)}},[r,y,V]);const G=async()=>{if(s||!u.current||i.editBlocked)return;const v=L.current,k=await i.inspectCurrent();k.status!=="observed"||!u.current||j.current||L.current!==v||!l.recovery.current()||w.setQueryData(B(d,e.sourcePath),P=>P&&{...P,...k.value})},ae=()=>{const v=l.adoptDisk();v!=null&&m(v)},ie=()=>{l.overwrite(S.current)},J=l.status==="saved"?l.confirmedContent!==R?"Unsaved changes":l.documentReceipt?"Save recorded":"Saved to file":Oe(l.status),W=s?R:n;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsx(De,{recovery:i,editing:s,loadCurrent:()=>void G(),toolbar:t.jsxs(t.Fragment,{children:[_&&J&&t.jsx("span",{className:O("mr-1 text-xs",l.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:J}),!s&&p==="pending"&&t.jsx("span",{role:"status",children:"Checking document…"}),!s&&t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:re,"aria-label":"Refresh from disk",children:t.jsx(Te,{className:"size-4"})}),_&&t.jsx(Le,{editing:s,off:!s&&(p==="pending"||i.editBlocked),observation:p,onClick:s?()=>void ne():se}),t.jsx(Se,{recovery:i,editing:s,loadCurrent:()=>void G()})]})}),l.status==="uncertain"&&t.jsxs("div",{role:"status",className:"mx-2 mt-2 flex items-center gap-2 text-sm",children:[t.jsx("span",{children:"Save not confirmed. Retry the original save before saving another draft."}),t.jsx(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>void l.retryUnconfirmed(),children:"Retry original save"})]}),l.status==="conflict"&&t.jsxs("div",{className:"bg-destructive/10 text-destructive mx-2 mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-3 py-2 text-sm",children:[t.jsx("span",{className:"flex-1",children:"This file changed on disk since you opened it."}),t.jsx(D,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:ae,children:"Reload"}),t.jsx(D,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:ie,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(a.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:f?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(ze,{value:W,editable:s,onChange:s?Y:void 0,wikiLinks:c})}):t.jsx(Ee,{value:W,editable:s,filename:e.sourcePath,languageHint:e.language,theme:o,onChange:s?Y:void 0})})})]})}function Ae(e){const{fileSaveBinding:r,fileSaveObservation:d}=Re(e.documentId);return t.jsx(te,{...e,observedBinding:r,recoveryBinding:r,fileSaveObservation:d})}function Ie(e){switch(e==null?void 0:e.code){case"NOT_FOUND":return"This file doesn’t exist.";case"NOT_A_FILE":return"This path is a directory, not a file.";case"TOO_LARGE":return"This file is too large to open here.";case"BINARY_FILE":return"This file isn’t text, so the editor can’t show it.";default:return"This file couldn’t be loaded."}}function rt({content:e,documentId:r}){const d=ye(),n=z(g=>g.selectedCwd),o=z(g=>g.setDocumentEditing),s=z(g=>{var l;return((l=g.openDocuments.find(i=>i.id===r))==null?void 0:l.editing)??!1}),C=je(),y=z(g=>g.canvasSessionId),b=z(g=>g.roomCanvasLiveRoomId),{data:p,error:x,isLoading:_}=Ce({queryKey:B(n,e.sourcePath),enabled:n!==null,queryFn:()=>d.readFileContent(n,e.sourcePath),staleTime:3e4,retry:!1}),[f,w]=a.useState(null),R=g=>{w(g&&p?{pinnedHash:p.hash}:null)};if(n===null)return t.jsx(H,{children:"Open a chat to view files."});if(_)return t.jsx(H,{children:"Loading file…"});if(x||!p)return t.jsx(H,{children:Ie(x)});const m=f!==null&&s,T=(m?f==null?void 0:f.pinnedHash:null)??p.hash,F=y&&!b?Ae:te;return t.jsx(F,{content:e,documentId:r,cwd:n,loaded:p.content,theme:C,isEditing:m,onEditingChange:R,setDocumentEditing:o},`${e.sourcePath}:${T}`)}function H({children:e}){return t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:e})})}export{rt as CanvasFileContent};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-DOl8ZkrU.js","assets/index-BwTGkJbK.js","assets/index-MpS13vhQ.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a5 as m,a_ as n,r as s,j as t,a$ as p}from"./index-BwTGkJbK.js";import{r as u}from"./use-session-canvas-BvvO-_V1.js";import"./rotate-cw-uoeBxIeM.js";import"./query-keys-DeYqUDia.js";import"./index.esm-CYmalBux.js";import"./WidgetErrorCard-Bwlfu514.js";import"./index-Ci_J5Q-6.js";import"./progress-Cr-4myw6.js";import"./markdown-content-BRaPEOC7.js";import"./table-dWrfPeX-.js";import"./package-DBsl3ao5.js";import"./heart-BHMhDZ0K.js";import"./git-branch-Df7a5_fb.js";import"./file-text-C_NPIQr4.js";import"./file-BIF-4ARS.js";import"./McpAppFrame-Dm7MqOhc.js";import"./more-details-oDazWBxm.js";const d=s.lazy(()=>p(()=>import("./Model3dViewer-DOl8ZkrU.js"),__vite__mapDeps([0,1,2])).then(e=>({default:e.Model3dViewer})));function f(e){var o;const r=(o=e.split(".").pop())==null?void 0:o.toLowerCase();return r==="glb"||r==="gltf"?"gltf":r==="stl"?"stl":r==="obj"?"obj":r==="3mf"?"3mf":r==="ply"?"ply":r==="fbx"?"fbx":r==="dae"?"dae":null}function V({content:e}){const r=m(),o=n(l=>l.selectedCwd),i=s.useMemo(()=>u(e.src,l=>r.mediaUrl(o??"",l)),[e.src,r,o]),a=s.useMemo(()=>f(e.src),[e.src]);return i.url===null||a===null?t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:"This 3D model can’t be displayed here."})}):t.jsx("div",{className:"bg-muted/40 h-full w-full",children:t.jsx(s.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading 3D viewer…"}),children:t.jsx(d,{url:i.url,format:a,label:e.title??"Canvas 3D model"})})})}export{V as CanvasModel3dContent,f as formatOf};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as w,a7 as D,a8 as k,fx as E,fy as y,r as m,j as t,I as S,fz as M,B as v,G as b,fA as A,e as L,Q as I,T as $,C as _,V as P,f as z,dS as q}from"./index-BwTGkJbK.js";function F(){const e=w(),s=D();return k({mutationFn:({agentId:n,body:a})=>e.createCommitment(n,a),onSettled:()=>s.invalidateQueries({queryKey:E.all})})}function W(){const e=w(),s=D();return k({mutationFn:({id:n,body:a})=>e.updateCommitment(n,a),onSettled:()=>s.invalidateQueries({queryKey:E.all})})}function K(e,s=new Date){if(!e)return null;const n=new Date(e);if(Number.isNaN(n.getTime()))return null;const a=n.getTime()<s.getTime()?"Overdue ·":"Due",l=n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"});return n.toDateString()===s.toDateString()?`${a} ${l}`:Math.abs(n.getTime()-s.getTime())/864e5<6?`${a} ${n.toLocaleDateString(void 0,{weekday:"short"})} ${l}`:`${a} ${n.toLocaleDateString(void 0,{month:"short",day:"numeric"})}`}function R(e,s){return e?e.startsWith(y)?`To ${e.slice(y.length)}`:`To ${(s==null?void 0:s(e))??e}`:null}function U(e){return{open:e.filter(s=>s.state==="open"),closed:e.filter(s=>s.state!=="open")}}const B={kept:"Kept",missed:"Missed",dropped:"Dropped"};function J(e){var n;const s=new Map;for(const a of e)s.set(a.id,a.displayName),(n=a.agent)!=null&&n.manifestId&&s.set(a.agent.manifestId,a.displayName);return a=>s.get(a)}const Q=6e4;function H(){const e=new Date;return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function X({agentId:e,onDone:s}){var c;const n=F(),[a,l]=m.useState(""),[i,o]=m.useState(""),d=m.useId(),f=m.useId(),x=a.trim(),j=n.isError&&((c=n.error)==null?void 0:c.code)==="PAST_DUE",p=i?new Date(i).getTime():null,[u,N]=m.useState(!1),[C]=m.useState(H);function r(g){if(g.preventDefault(),!x||u)return;const h=p!==null?new Date(p).toISOString():void 0;n.mutate({agentId:e,body:{what:x,...h?{dueAt:h}:{}}},{onSuccess:s})}return t.jsxs("form",{onSubmit:r,"data-slot":"add-commitment-form",className:"flex flex-col gap-2 rounded-md border p-3",children:[t.jsx("label",{htmlFor:d,className:"text-xs font-medium",children:"What was promised"}),t.jsx(S,{id:d,value:a,maxLength:M,onChange:g=>l(g.target.value),placeholder:"Send Acme the revised quote"}),t.jsx("label",{htmlFor:f,className:"text-xs font-medium",children:"Due (optional)"}),t.jsx(S,{id:f,type:"datetime-local",value:i,min:C,"aria-invalid":u||void 0,onChange:g=>{const h=g.target.value;o(h),N(h!==""&&new Date(h).getTime()<Date.now()-Q)}}),(u||j)&&t.jsx("p",{className:"text-destructive text-xs",children:"That time has passed."}),n.isError&&!j&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t save the commitment. Try again."}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx(v,{type:"button",size:"sm",variant:"ghost",onClick:s,children:"Cancel"}),t.jsx(v,{type:"submit",size:"sm",disabled:!x||u||n.isPending,children:"Add commitment"})]})]})}function T({commitment:e,agentName:s,nameOf:n,onClose:a,busy:l}){const i=e.state==="open",o=[s,R(e.to,n)].filter(Boolean).join(" · "),d=i?K(e.dueAt):null;return t.jsxs("li",{"data-slot":"commitment-row","data-state":e.state,"data-overdue":e.overdue||void 0,className:"flex flex-col gap-2 rounded-md px-2 py-2 sm:flex-row sm:items-center sm:gap-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:b("text-sm break-words",!i&&"text-muted-foreground",e.state==="dropped"&&"line-through"),children:e.what}),(o||d||!i)&&t.jsxs("div",{className:"text-muted-foreground mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[e.state!=="open"&&t.jsx("span",{children:B[e.state]}),o&&t.jsx("span",{className:"min-w-0 truncate",children:o}),d&&t.jsx("span",{className:b(e.overdue&&"text-destructive font-medium"),children:d})]})]}),i&&a&&t.jsxs("div",{className:"flex shrink-0 gap-1",children:[t.jsx(v,{size:"xs",variant:"outline",disabled:l,onClick:()=>a("kept"),"aria-label":`Mark kept: ${e.what}`,children:"Mark kept"}),t.jsx(v,{size:"xs",variant:"ghost",disabled:l,onClick:()=>a("dropped"),"aria-label":`Drop: ${e.what}`,children:"Drop"})]})]})}const G={kept:"Marked kept",dropped:"Commitment dropped"};function Y({agentId:e,nameOf:s,canAdd:n=!1,readOnly:a=!1,canChange:l}){var C;const i=A(e?{agentId:e}:{}),o=W(),[d,f]=m.useState(!1),x=e===void 0;function j(r,c){o.mutate({id:r.id,body:{state:c}},{onSuccess:()=>q.success(G[c],{action:{label:"Undo",onClick:()=>o.mutate({id:r.id,body:{state:"open",from:c}})}})})}if(i.isPending)return t.jsx(L,{className:"h-16 w-full"});if(i.isError)return t.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read commitments."});const{open:p,closed:u}=U(i.data),N=o.isPending?(C=o.variables)==null?void 0:C.id:void 0;return t.jsxs("div",{"data-slot":"commitment-list",className:"flex flex-col gap-2",children:[p.length===0&&u.length===0&&!d&&t.jsx("p",{className:"text-muted-foreground text-sm",children:"No commitments yet."}),p.length>0&&t.jsx("ul",{className:"flex flex-col","aria-label":"Open commitments",children:p.map(r=>t.jsx(T,{commitment:r,agentName:x?s==null?void 0:s(r.agentId):void 0,nameOf:s,busy:N===r.id,...a||l&&!l(r)?{}:{onClose:c=>j(r,c)}},r.id))}),o.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t change that commitment. Try again."}),u.length>0&&t.jsxs(I,{children:[t.jsxs($,{className:"focus-ring text-muted-foreground hover:text-foreground group flex items-center gap-1 rounded-md px-2 py-1 text-xs",children:[t.jsx(_,{"aria-hidden":!0,className:"size-3.5 transition-transform group-data-[state=open]:rotate-90"}),"Closed (",u.length,")"]}),t.jsx(P,{children:t.jsx("ul",{className:"flex flex-col","aria-label":"Closed commitments",children:u.map(r=>t.jsx(T,{commitment:r,agentName:x?s==null?void 0:s(r.agentId):void 0,nameOf:s},r.id))})})]}),n&&!a&&e&&d&&t.jsx(X,{agentId:e,onDone:()=>f(!1)}),n&&!a&&e&&!d&&t.jsxs(v,{size:"sm",variant:"ghost",className:"self-start",onClick:()=>f(!0),children:[t.jsx(z,{"aria-hidden":!0}),"Add commitment"]})]})}export{Y as C,J as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,d,j as m}from"./index-BwTGkJbK.js";import{r as c,C as l}from"./CommitmentList-DOvfnyDA.js";function u({member:s,roster:t}){var o;const e=(o=s.agent)==null?void 0:o.manifestId,i=r.useMemo(()=>c(t),[t]),n=d(s,t),a=n==="managed"||n==="system";return e?m.jsx("div",{className:"min-h-0 flex-1","data-slot":"profile-commitments",children:m.jsx(l,{agentId:e,nameOf:i,canAdd:a,readOnly:!a})}):null}export{u as CommitmentsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BwTGkJbK.js";import{a as t}from"./ProfileFields-DiarOK2y.js";import"./profile-errors-B8XkL2Rp.js";import"./use-mounted-ref-DSSTCJfY.js";function n({member:r}){return o.jsx(t,{member:r})}export{n as HandlePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as T,a7 as w,a8 as B,hj as v,hk as $,h as O,j as s,hl as A,ba as E,hm as W,a2 as P,B as x,s as R,ab as D,hn as M,ho as H,d as L,r as h,hp as q,e as S,hq as F,hr as I,b as U,hs as z}from"./index-BwTGkJbK.js";import{M as C}from"./more-details-oDazWBxm.js";import{HeartbeatFileEditor as Q}from"./ConventionPage-BxWLIUUC.js";import"./relay-trace-schemas-ZLR1S8ft.js";import"./form-D3VdAYl4.js";import"./untrusted-text-BDygHCRk.js";import"./soul-file-BwiyiI5v.js";function _(){const e=T(),t=w();return B({mutationFn:a=>e.chooseTriageCredits(a),onSettled:()=>t.invalidateQueries({queryKey:v.all})})}function K(e,t){if(e.cadence==="off")return"Sends no reports.";const a=e.cadence==="weekly"?"each week":"each workday",n=e.items===0?"Nothing to report yet.":`${e.items} ${e.items===1?"item":"items"} so far.`;return`Reports to ${t} ${a}. ${n}`}function G(e,t){const a=$(e,t);return n=>{var r;return((r=e.find(l=>{var o;return((o=l.agent)==null?void 0:o.manifestId)===n}))==null?void 0:r.displayName)??a(n)}}function J(e){return Number.isNaN(e.getTime())?null:e.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function V({beat:e,onOpenChat:t}){const a=A[e.outcome],n=J(new Date(e.startedAt));return s.jsxs("li",{"data-slot":"heartbeat-beat","data-outcome":e.outcome,className:"flex flex-col gap-1 rounded-md px-2 py-2",children:[s.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[s.jsx("time",{dateTime:e.startedAt,title:n??void 0,children:E(e.startedAt)}),s.jsx("span",{children:W[e.kind]}),s.jsx(P,{variant:"outline",size:"xs",tone:a.tone,className:"ml-auto",children:a.label})]}),e.summary&&s.jsx("p",{className:"text-sm break-words",children:e.summary}),t&&s.jsx(x,{size:"xs",variant:"ghost",className:"-ml-2 self-start","aria-label":n?`Open chat from the check at ${n}`:"Open chat from this check",onClick:t,children:"Open chat"})]})}function X({beats:e,canOpenChat:t}){const a=O();return e.length===0?s.jsx("p",{className:"text-muted-foreground px-2 text-sm",children:"No checks yet."}):s.jsx("ul",{className:"flex flex-col","aria-label":"Last checks",children:e.map(n=>{const r=n.sessionId,l=t&&r&&a?()=>void a(R({session:r})):void 0;return s.jsx(V,{beat:n,...l?{onOpenChat:l}:{}},n.id)})})}function Y(e){return e.runsOn==="credits"?`Checks run on DorkOS credits. ${e.today} today.`:`Checks run on ${D(e.runtime)}.`}function Z(e){if(e.today===0)return null;const t=`${e.tokens.toLocaleString("en-US")} tokens`;return e.runsOn==="credits"?`${t} today.`:`${`${e.today} ${e.today===1?"check":"checks"}`} on credits earlier today, ${t}.`}function ee(){const e=_();return s.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md border px-3 py-3","data-slot":"heartbeat-credits-offer",children:[s.jsx("p",{className:"text-sm font-medium",children:"Run cheap checks on DorkOS credits?"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Quick checks skip most full runs. Nothing is spent until you say yes."}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(x,{size:"sm",disabled:e.isPending,onClick:()=>e.mutate(!0),children:"Use credits"}),s.jsx(x,{size:"sm",variant:"ghost",disabled:e.isPending,onClick:()=>e.mutate(!1),children:"Not now"})]}),e.isError&&s.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t save your answer. Try again."})]})}function se({checks:e}){const t=Z(e);return s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-checks",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Checks"}),s.jsx("p",{className:"text-sm",children:Y(e)}),t&&s.jsx("p",{className:"text-muted-foreground text-xs",children:t}),e.offer&&s.jsx(ee,{})]})}function te({held:e,nameOf:t,now:a}){return e.length===0?null:s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-held",children:[s.jsxs("h3",{className:"text-sm font-semibold",children:["Held until working hours: ",e.length,"."]}),s.jsx("ul",{className:"flex flex-col","aria-label":"Held messages",children:e.map(n=>{const r=M(n.deliverAfter,new Date(a));return s.jsxs("li",{className:"flex flex-col gap-0.5 rounded-md px-2 py-2",children:[n.text&&s.jsx("p",{className:"line-clamp-3 text-sm break-words whitespace-pre-line",children:n.text}),s.jsx("p",{className:"text-muted-foreground text-xs",children:[`To ${t(n.to)}`,r].filter(Boolean).join(" · ")})]},n.id)})})]})}function f(e){return e.value===null?null:`${Math.round(e.value*100)}%`}function p(e){return`${e.part} of ${e.whole}`}function ae(e){return`Target ${e.charAt(0).toLowerCase()}${e.slice(1)}`}function ne(e){return e.value!==null?e.value.toFixed(1):e.messages>0?`${e.messages} sent, none useful`:null}function re(e){return e.windowDays===1?"No checks in the last day.":`No checks in the last ${e.windowDays} days.`}function oe(e){return e.windowDays===1?"Last day.":`Last ${e.windowDays} days.`}function N(e,t,a){return`${e} ${e===1?t:a}`}function le(e){const{pauses:t,wakeOff:a,mutes:n}=e.mutesAndPauses,r=[t>0?N(t,"pause","pauses"):null,a>0?N(a,"switch-off","switch-offs"):null,n>0?N(n,"mute","mutes"):null].filter(l=>l!==null);return r.length===0?null:r.join(", ")}function ie(e){const t=e.supporting,a=o=>Math.round(o).toLocaleString("en-US"),n=f(t.quietBeats),r=f(t.commitmentsOnTime);return[n?`Quiet checks: ${n}, ${p(t.quietBeats)}.`:null,r?`Promises kept on time: ${r}, ${p(t.commitmentsOnTime)}.`:"No promises came due.",t.noEndBeat>0?`Ended without a summary: ${t.noEndBeat}.`:null,t.triage.checks>0?`Cheap checks: ${t.triage.checks}, ${a(t.triage.tokens)} tokens.`:null,t.turns.count>0?t.turns.tokensPerTurn===null?`Full runs: ${t.turns.count}.`:`Full runs: ${t.turns.count}, about ${a(t.turns.tokensPerTurn)} tokens each.`:null,t.bypass>0?`Posted outside a check’s summary: ${t.bypass}.`:null,t.held>0?`Held for people’s hours: ${t.held}.`:null].filter(o=>o!==null)}function u({label:e,value:t,detail:a,target:n,source:r}){return s.jsxs("div",{"data-slot":"heartbeat-measure",className:"grid grid-cols-[1fr_auto] items-baseline gap-x-2 gap-y-0.5 py-1.5",children:[s.jsx("dt",{className:"text-sm",children:e}),s.jsx("dd",{className:"text-sm font-medium tabular-nums",children:t}),(a||n)&&s.jsxs("dd",{className:"text-muted-foreground col-span-2 flex flex-wrap gap-x-2 text-xs",children:[a&&s.jsx("span",{className:"tabular-nums",children:a}),n&&s.jsx("span",{children:ae(n)})]}),s.jsx("dd",{className:"text-muted-foreground col-span-2 text-xs",children:r})]})}function k({measures:e}){const{mutesAndPauses:t}=e;return s.jsx(u,{label:"Mutes and pauses",value:String(t.total),detail:le(e),target:t.target,source:t.source})}function ce({measures:e}){const t="Nothing to count yet";if(e.supporting.beats===0)return s.jsxs("section",{className:"space-y-1","data-slot":"heartbeat-measures","data-state":"empty",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Measures"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:re(e)}),s.jsx("dl",{children:s.jsx(k,{measures:e})})]});const{keptRate:a,usefulRaiseRate:n,interruptions:r}=e,l=ie(e);return s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-measures","data-state":"measured",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Measures"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[oe(e)," Targets are starting points, not grades."]})]}),s.jsxs("dl",{className:"divide-y",children:[s.jsx(u,{label:"Work that stuck",value:f(a)??t,detail:a.whole>0?p(a):null,target:a.target,source:a.source}),s.jsx(u,{label:"Useful messages",value:f(n)??t,detail:n.whole>0?p(n):null,target:n.target,source:n.source}),s.jsx(u,{label:"Interruptions per useful outcome",value:ne(r)??t,detail:r.value===null?null:`${r.messages} sent, ${r.usefulOutcomes} useful`,target:r.target,source:r.source}),s.jsx(u,{label:"Surprises",value:"Not measured yet",source:e.surprises.source}),s.jsx(k,{measures:e})]}),l.length>0&&s.jsx(C,{label:"Supporting measures",openLabel:"Fewer measures",children:s.jsx("ul",{className:"space-y-1 text-xs","aria-label":"Supporting measures",children:l.map(o=>s.jsx("li",{children:o},o))})})]})}function ue({status:e,now:t,readerName:a}){const n=e.enabled&&e.wake==="timed"?F(e.nextBeatAt,new Date(t)):null,r=e.enabled&&e.skippedReason===null;return s.jsxs("section",{className:"space-y-1","data-slot":"heartbeat-wake",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"How it wakes"}),s.jsx("p",{className:"text-sm",children:I(e)}),n&&s.jsx("p",{className:"text-muted-foreground text-xs",children:n}),r&&s.jsx("p",{className:"text-muted-foreground text-xs","data-slot":"heartbeat-next-report",children:K(e.report,a(e.report.to))})]})}function de({error:e}){return s.jsxs("div",{role:"alert",className:"space-y-1","data-slot":"heartbeat-file-problem",children:[s.jsx("p",{className:"text-destructive text-sm",children:"These settings don’t read. The last good ones still apply."}),s.jsx("p",{className:"text-sm",children:z(e)}),s.jsx(C,{children:s.jsx("p",{className:"font-mono break-words",children:e})})]})}function me(e){var i;const{member:t,roster:a,onPush:n,status:r}=e,l=w(),{agent:o,isPending:g}=U(t),[j,c]=h.useState(!1),d=((i=t.agent)==null?void 0:i.manifestId)??"";if(g)return s.jsx(S,{className:"h-40 w-full"});const m=!!o&&((o==null?void 0:o.heartbeatContent)??null)===null;return m&&!j?s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-file-empty",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"No HEARTBEAT.md yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"It wakes only when something happens."}),s.jsx(x,{size:"sm",variant:"outline",onClick:()=>c(!0),children:"Write one"})]}):s.jsxs("section",{className:"space-y-2",children:[r.fileError&&s.jsx(de,{error:r.fileError}),s.jsx(Q,{member:t,roster:a,onPush:n,...m?{onCancel:()=>c(!1)}:{},onSaved:()=>void l.invalidateQueries({queryKey:v.agent(d)})})]})}function ye(e){var y,b;const{member:t,roster:a}=e,n=((y=t.agent)==null?void 0:y.manifestId)??null,r=H(n,{live:!0}),l=L(t,a),o=l==="managed"||l==="system",g=h.useMemo(()=>$(a,t),[a,t]),j=h.useMemo(()=>G(a,t),[a,t]),c=q(3e4),[d,m]=h.useState(!1);if(o&&((b=r.data)!=null&&b.enabled)&&!d&&m(!0),!n)return null;if(r.isPending)return s.jsx(S,{className:"h-24 w-full"});if(!r.data)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this heartbeat."});const i=r.data;return s.jsxs("div",{className:"space-y-6","data-slot":"profile-heartbeat",children:[s.jsx(ue,{status:i,now:c,readerName:j}),i.enabled&&s.jsx(se,{checks:i.checks}),o&&d&&s.jsx(me,{...e,status:i}),s.jsx(te,{held:i.held,nameOf:g,now:c}),s.jsx(ce,{measures:i.measures}),s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-beats",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Last checks"}),s.jsx(X,{beats:i.lastBeats,now:c,canOpenChat:i.enabled})]})]})}export{ye as HeartbeatPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BwTGkJbK.js";import{P as m}from"./ProfileFields-DiarOK2y.js";import"./profile-errors-B8XkL2Rp.js";import"./use-mounted-ref-DSSTCJfY.js";function a({member:r}){return o.jsx(m,{member:r})}export{a as NamePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,hx as A,hy as P,G as k,gv as Y,a5 as E,a6 as W,gU as R,r as N,a7 as Z,a8 as ee,aJ as se,bc as te,B as x,i2 as v,bz as q,bA as U,C as L,bB as D,bD as B,U as ne,gW as g,i3 as w,h0 as M,h1 as _,e as C,ba as ae,i4 as ie,i5 as le,i6 as re}from"./index-BwTGkJbK.js";import{u as y,c as oe,a as p,l as H,S as f,P as b,s as z,d as T,r as j,f as $,b as K,e as S,g as de,A as ce}from"./ApplyToOverridesDialog-DE9VVQCA.js";const I=[{value:"blocked",label:"Blocked"},{value:"ask",label:"Ask"},{value:"allowed",label:"Allowed"}];function Q({value:e,onChange:t,floor:n=!1,disabled:a=!1,className:l,"aria-label":o}){const d=n?I.filter(i=>i.value!=="allowed"):I;return s.jsx(A,{"aria-label":o,value:e??"",onValueChange:i=>t(i),disabled:a,className:k("w-full md:w-auto",l),children:d.map(i=>s.jsx(P,{value:i.value,className:k(Y,"md:min-h-0 md:min-w-16"),children:i.label},i.value))})}function ue(e){const t=E();return W({queryKey:R.agent(e??""),queryFn:()=>t.getAgentPermissions(e),enabled:!!e})}function me(e){const{data:t}=y();return N.useMemo(()=>{const n=new Map;for(const a of(t==null?void 0:t.exceptions)??[]){if(a.area!==e)continue;const l=n.get(a.agentId);(!l||l.action&&!a.action)&&n.set(a.agentId,a)}return[...n.values()]},[t,e])}function he(e){const t=E();return W({queryKey:R.history(e),queryFn:()=>t.getPermissionHistory(e?{agentId:e,limit:50}:{limit:50})})}function xe(e){var n;const t=e;return(t==null?void 0:t.code)!=="UNDO_CONFLICT"?null:((n=t.body)==null?void 0:n.conflicts)??[]}function fe(){const e=E(),t=Z();return ee({mutationFn:({eventId:n,force:a})=>e.undoPermissionChange(n,a?{force:!0}:{}),meta:{suppressErrorToast:!0},onSettled:()=>{t.invalidateQueries({queryKey:R.all}),t.invalidateQueries({queryKey:["mesh","agents"]}),t.invalidateQueries({queryKey:se.all})}})}function F(e){const{data:t}=y();return t?oe(t,e):void 0}function V({areaId:e,label:t,description:n,floor:a,value:l,sourceText:o,why:d,changed:i=!1,onChange:m,onReset:r,disabled:u=!1,footer:c,details:h}){return s.jsxs("div",{className:"@container","data-testid":`permission-row-${e}`,children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[i?s.jsx("span",{className:"bg-primary size-1.5 shrink-0 rounded-full","aria-label":"Set differently for this agent",role:"img"}):null,s.jsx("span",{className:"text-sm font-medium",children:t}),a?s.jsx(te,{className:"text-muted-foreground size-3.5","aria-label":"Never Allowed"}):null]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:n}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:o}),d?s.jsxs(s.Fragment,{children:[o?" · ":null,d]}):null]})]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(Q,{value:l,onChange:m,floor:a,disabled:u,"aria-label":t}),i&&r?s.jsxs(x,{variant:"ghost",size:"sm",className:"self-start @lg:self-end",onClick:r,disabled:u,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset to default"]}):null,c]})]}),h]})}function ge({area:e,exception:t}){const n=p({kind:"agent",agentId:t.agentId}),a=()=>n.mutate({kind:"patch",...t.action?{actions:{[t.action]:null}}:{areas:{[e]:null}},surface:"settings"}),l=H(t.lastChange);return s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"min-w-0 text-sm",children:[s.jsxs("span",{className:"block break-words",children:[t.agentName,": ",f[t.state],t.action?" (one action)":""]}),l?s.jsx("span",{className:"text-muted-foreground block text-xs",children:l}):null]}),s.jsxs(x,{variant:"ghost",size:"sm",onClick:a,disabled:n.isPending,"aria-label":`Reset ${t.agentName} to the default`,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]})]})}function pe({area:e,areaLabel:t,agents:n}){if(n.length===0)return null;const a=n.length===1?"1 agent differs":`${n.length} agents differ`;return s.jsxs(q,{children:[s.jsx(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(B,{className:"text-sm font-medium",children:["Set differently for ",t]}),s.jsx("ul",{className:"space-y-1",children:n.map(l=>s.jsx(ge,{area:e,exception:l},l.agentId))})]})]})}function G(e,t){return e.resolved.source===(t.kind==="agent"?"agent-action":"default-action")}function J({action:e,preset:t,agentName:n}){const a=f[e.resolved.state];return s.jsx(b,{question:`Why is ${e.title} set to ${a}${n?` for ${n}`:""}?`,sentence:z({...e.resolved,preset:t,fromExtension:e.source!==void 0}),...e.lastChange?{lastChange:e.lastChange}:{}})}function je({action:e,area:t,scope:n,preset:a,agentName:l,disabled:o,reset:d,onSave:i}){const m=G(e,n),r=F({kind:"action",action:e.id,area:t.id}),u=m?"Set on its own":e.alwaysAsks?e.source?"Always asks: an extension tool that can delete things":"Always asks, so you see the change first":e.resolved.destructiveAsk?"Always asks unless you set it here":`Follows ${t.label}`,c=n.kind==="default"&&r!==void 0?T(r):null;return s.jsxs("li",{className:"flex flex-col gap-2 py-2 @md:flex-row @md:items-center @md:justify-between","data-testid":`permission-action-${e.id}`,children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm",children:e.title}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.source?s.jsxs("span",{children:["From ",e.source.name," · "]}):null,s.jsx("span",{children:u}),c?s.jsxs("span",{children:[" · ",c]}):null," ·"," ",s.jsx(J,{action:e,preset:a,...l?{agentName:l}:{}})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[m?d:null,s.jsx(Q,{value:e.resolved.state,floor:t.floor||e.alwaysAsks===!0,disabled:o,"aria-label":e.title,onChange:h=>{h!==e.resolved.state&&i(h)}})]})]})}function X({scope:e,area:t,surface:n,preset:a,agentName:l}){const o=p(e),[d,i]=N.useState(!1);if(t.actions.length===0)return null;const m=t.actions.filter(c=>G(c,e)),r=(c,h)=>o.mutate({kind:"patch",actions:{[c.id]:h},surface:n},{onError:j}),u=c=>s.jsxs(x,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs",disabled:o.isPending,"aria-label":`Put ${c.title} back to ${t.label}`,onClick:()=>r(c,null),children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]});return s.jsxs("div",{className:"flex flex-col items-start gap-1 pb-3","data-testid":`permission-actions-${t.id}`,children:[!d&&m.length>0?s.jsx("ul",{className:"w-full space-y-1","data-testid":`permission-action-exceptions-${t.id}`,children:m.map(c=>s.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:"text-muted-foreground min-w-0",children:[s.jsxs("span",{children:["Except ",c.title,": ",f[c.resolved.state]]})," ","·"," ",s.jsx(J,{action:c,preset:a,...l?{agentName:l}:{}})]}),u(c)]},c.id))}):null,s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground -ml-2 h-7 px-2 text-xs","aria-expanded":d,onClick:()=>i(c=>!c),children:[s.jsx(ne,{className:k("size-3.5 transition-transform",d&&"rotate-180"),"aria-hidden":!0}),d?"Hide individual actions":"Show individual actions"]}),d?s.jsx("ul",{className:"divide-border w-full divide-y","aria-label":`${t.label} actions`,children:t.actions.map(c=>s.jsx(je,{action:c,area:t,scope:e,preset:a,...l?{agentName:l}:{},disabled:o.isPending,reset:u(c),onSave:h=>r(c,h)},c.id))}):null]})}function Ne({agentId:e,agentName:t,files:n}){const a=p({kind:"agent",agentId:e}),l=n.source==="agent",o=n.inherited.stop,d=n.stop,i=r=>a.mutate({kind:"patch",filesAndCommands:r,surface:"agent-page"},{onError:j}),m=o?`${l?`Everyone else: ${g(o)}`:`Same as everyone (${g(o)})`}${n.inherited.source==="runtime"?` · ${$("runtime")}`:""}`:$(n.inherited.source);return s.jsxs("div",{className:"@container","data-testid":"permission-row-files",children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[l?s.jsx("span",{className:"bg-primary size-1.5 shrink-0 rounded-full","aria-label":"Set differently for this agent",role:"img"}):null,s.jsx("span",{className:"text-sm font-medium",children:"Files & commands"})]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Editing files and running commands in this agent’s chats"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:m})," ·"," ",s.jsx(b,{question:`Why is Files & commands ${d?`set to ${g(d)}`:"not set"} for ${t}?`,sentence:K(d,n.source),...n.lastChange?{lastChange:n.lastChange}:{}})]})]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(A,{"aria-label":"Files & commands",className:"w-full @lg:w-auto",value:d??"",disabled:a.isPending,onValueChange:r=>{r&&r!==d&&i(r)},children:w.map(r=>s.jsxs(P,{value:r.id,"aria-label":r.label,children:[s.jsx(M,{descriptor:r,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:r.label})]},r.id))}),l?s.jsxs(x,{variant:"ghost",size:"sm",className:"self-start @lg:self-end",onClick:()=>i(null),disabled:a.isPending,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset to default"]}):null]})]}),s.jsx(_,{descriptor:w.find(r=>r.stop===d),className:"pb-3"})]})}function Re({files:e,preset:t,onChange:n,disabled:a=!1,runtimeLabel:l=o=>o}){const o=F({kind:"files"}),d=e.stop===null?$("runtime-own"):e.stop===e.presetStop?`From ${S[t??"trusted"]}`:"Changed from your preset";return s.jsxs("div",{className:"@container","data-testid":"permission-row-files",children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("span",{className:"text-sm font-medium",children:"Files & commands"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Editing files and running commands"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:[d,o!==void 0?T(o):""].filter(Boolean).join(" · ")})," ","·"," ",s.jsx(b,{question:`Why is Files & commands ${e.stop?`set to ${g(e.stop)}`:"not set"}?`,sentence:K(e.stop,e.stop===null?"runtime-own":"default"),...e.lastChange?{lastChange:e.lastChange}:{}})]}),e.runtimes.map(i=>s.jsxs("p",{className:"text-muted-foreground text-xs",children:[l(i.runtime)," starts at ",g(i.stop)," (Settings → Runtimes)"]},i.runtime))]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(A,{"aria-label":"Files & commands",className:"w-full @lg:w-auto",value:e.stop??"",disabled:a,onValueChange:i=>{i&&i!==e.stop&&n(i)},children:w.map(i=>s.jsxs(P,{value:i.id,"aria-label":i.label,children:[s.jsx(M,{descriptor:i,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:i.label})]},i.id))}),s.jsx(be,{agents:e.exceptions})]})]}),s.jsx(_,{descriptor:w.find(i=>i.stop===e.stop),className:"pb-3"})]})}function ve({agent:e}){const t=p({kind:"agent",agentId:e.agentId}),n=H(e.lastChange);return s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"min-w-0 text-sm",children:[s.jsxs("span",{className:"block break-words",children:[e.agentName,": ",g(e.stop)]}),n?s.jsx("span",{className:"text-muted-foreground block text-xs",children:n}):null]}),s.jsxs(x,{variant:"ghost",size:"sm",disabled:t.isPending,"aria-label":`Reset ${e.agentName} to the default`,onClick:()=>t.mutate({kind:"patch",filesAndCommands:null,surface:"settings"},{onError:j}),children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]})]})}function be({agents:e}){return e.length===0?null:s.jsxs(q,{children:[s.jsx(U,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start @lg:self-end",children:[e.length===1?"1 agent differs":`${e.length} agents differ`,s.jsx(L,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsx(B,{className:"text-sm font-medium",children:"Set differently for Files & commands"}),s.jsx("ul",{className:"space-y-1",children:e.map(t=>s.jsx(ve,{agent:t},t.agentId))})]})]})}function O(e){return e.filter(t=>t.kind==="state")}function we({area:e,overview:t}){const n=p({kind:"default"}),a=me(e.id),l=F({kind:"area",area:e.id})??0,[o,d]=N.useState(null),i=(r,u)=>{n.mutate({kind:"patch",areas:{[e.id]:r},...u&&u.length>0?{applyToAgents:u}:{},surface:"settings"},{onError:j,onSettled:()=>d(null)})},m=r=>{r!==e.resolved.state&&(a.length>0?d(r):i(r))};return s.jsxs(s.Fragment,{children:[s.jsx(V,{areaId:e.id,label:e.label,description:e.description,floor:e.floor,value:e.resolved.state,sourceText:[de(e.resolved.source,t.preset),T(l)].filter(Boolean).join(" · "),why:s.jsx(b,{question:`Why is ${e.label} set to ${f[e.resolved.state]}?`,sentence:z({...e.resolved,preset:t.preset}),...e.lastChange?{lastChange:e.lastChange}:{}}),onChange:m,disabled:n.isPending,footer:s.jsx(pe,{area:e.id,areaLabel:e.label,agents:a}),details:s.jsx(X,{scope:{kind:"default"},area:e,surface:"settings",preset:t.preset})}),s.jsx(ce,{open:o!==null,onCancel:()=>d(null),subject:e.label,next:o??"ask",agents:a.map(r=>({agentId:r.agentId,agentName:r.agentName,detail:`${f[r.state]}${r.action?" (one action)":""}`})),affectedCount:l,onKeep:()=>o&&i(o),onUpdate:r=>o&&i(o,r),pending:n.isPending})]})}function ye({agentId:e,agentName:t,area:n}){var r;const a=((r=y().data)==null?void 0:r.preset)??null,l=p({kind:"agent",agentId:e}),o=n.resolved.source==="agent-area"||n.resolved.source==="agent-action",d=o?`Everyone else: ${f[n.inherited.state]}`:`Same as everyone (${f[n.inherited.state]})`,i=n.changedOutsideAt?`Changed outside DorkOS · ${d}`:d,m=u=>l.mutate({kind:"patch",areas:{[n.id]:u},surface:"agent-page"},{onError:j});return s.jsx(V,{areaId:n.id,label:n.label,description:n.description,floor:n.floor,value:n.resolved.state,sourceText:i,why:s.jsx(b,{question:`Why is ${n.label} set to ${f[n.resolved.state]} for ${t}?`,sentence:z({...n.resolved,preset:a}),...n.lastChange?{lastChange:n.lastChange}:{}}),changed:o,onChange:u=>{u!==n.resolved.state&&m(u)},onReset:()=>m(null),disabled:l.isPending,details:s.jsx(X,{scope:{kind:"agent",agentId:e},area:n,surface:"agent-page",preset:a,agentName:t})})}function ze({scope:e}){const t=y(),n=ue(e.kind==="agent"?e.agentId:void 0);return e.kind==="default"?t.isError?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read the permissions."}):t.data?s.jsx("div",{className:"divide-border divide-y","data-testid":"permission-list-default",children:O(t.data.areas).map(a=>s.jsx(we,{area:a,overview:t.data},a.id))}):s.jsx(C,{className:"h-20 w-full"}):n.isError?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s permissions."}):n.data?s.jsxs("div",{className:"divide-border divide-y","data-testid":"permission-list-agent",children:[s.jsx(Ne,{agentId:e.agentId,agentName:n.data.agentName,files:n.data.filesAndCommands}),O(n.data.areas).map(a=>s.jsx(ye,{agentId:e.agentId,agentName:n.data.agentName,area:a},a.id))]}):s.jsx(C,{className:"h-20 w-full"})}function ke(e,t){if(t.key.kind==="chat")return ie(e);if(t.key.kind==="account")return le(e);if(e===null)return t.target.kind==="agent"?"the default":"the preset";switch(t.key.kind){case"files":return Ce(e)?g(e):e;case"preset":return e in S?S[e]:e;default:return e in f?f[e]:e}}function Ce(e){return re.includes(e)}function $e(e){if(e.length===1){const{change:t}=e[0];return`This has changed since. Set it back to ${ke(t.before,t)} anyway?`}return"Some of this has changed since. Set it all back anyway?"}function Se(e){if(e.suggestionRestored)return null;if(e.changes.length===0&&e.skipped.length===0)return"Nothing to undo. It was already back.";if(e.skipped.length===0)return null;const t=e.changes.length,n=`Undid ${t} ${t===1?"change":"changes"}.`,a=e.skipped.filter(i=>i.reason==="changed-since").length,l=e.skipped.filter(i=>i.reason==="floor").length,o=e.skipped.filter(i=>i.reason==="gone").length,d=[];if(a>0&&d.push(`${a} had changed since and ${a===1?"was":"were"} left alone.`),l>0&&d.push(`${l} can’t be set to Allowed and ${l===1?"was":"were"} left alone.`),o>0&&d.push(`${o} ${o===1?"was about an agent":"were about agents"} no longer here.`),d.length>1){const i=e.skipped.length;return`${n} ${i} ${i===1?"was":"were"} left alone.`}return[n,...d].join(" ")}function Ae({item:e}){const t=fe(),[n,a]=N.useState(null),[l,o]=N.useState(null),d=e.undone,i=e.undoable&&!d,m=ae(e.occurredAt),r=u=>t.mutate({eventId:e.id,...u?{force:!0}:{}},{onSuccess:c=>{a(null),o(Se(c))},onError:c=>{const h=xe(c);h?a(h):j(c)}});return s.jsxs("li",{className:"space-y-1","data-testid":"permission-history-row",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0 space-y-0.5",children:[s.jsx("p",{className:"text-sm",children:e.summary}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.actorLabel," · ",m]}),e.actorDetail?s.jsx("p",{className:"text-muted-foreground text-xs",children:e.actorDetail}):null]}),d?s.jsx("span",{className:"text-muted-foreground shrink-0 pt-0.5 text-xs",children:"Undone"}):i&&n===null?s.jsx(x,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs",disabled:t.isPending,"aria-label":`Undo: ${e.summary}, ${m}`,onClick:()=>r(!1),children:"Undo"}):null]}),n!==null?s.jsxs("div",{role:"group","aria-label":"Undo conflict",className:"bg-muted/50 flex flex-col gap-2 rounded-md p-2 @md:flex-row @md:items-center @md:justify-between",children:[s.jsx("p",{className:"text-sm",children:$e(n)}),s.jsxs("div",{className:"flex shrink-0 gap-2",children:[s.jsx(x,{variant:"outline",size:"sm",disabled:t.isPending,onClick:()=>a(null),children:"Cancel"}),s.jsx(x,{size:"sm",disabled:t.isPending,onClick:()=>r(!0),children:"Set it back"})]})]}):null,l?s.jsx("p",{className:"text-muted-foreground text-xs",role:"status",children:l}):null]})}function Te({agentId:e}){const{data:t,isPending:n,isError:a}=he(e);if(a)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read the history."});if(n)return s.jsx(C,{className:"h-12 w-full"});const l=(t==null?void 0:t.items)??[];return l.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No permission changes yet."}):s.jsx("ul",{className:"@container space-y-3","aria-label":"Permission history",children:l.map(o=>s.jsx(Ae,{item:o},o.id))})}export{Re as D,ze as P,Te as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{y as i,j as s}from"./index-BwTGkJbK.js";import{P as a,a as m}from"./PermissionHistory-Bhl2kr1R.js";import{R as n}from"./ApplyToOverridesDialog-DE9VVQCA.js";function l({member:t}){var o;const e=i((o=t.agent)==null?void 0:o.runtime),r=(e==null?void 0:e.supportsMcp)??!0;return s.jsxs("div",{className:"space-y-6",children:[r?null:s.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent can’t use DorkOS tools, so these don’t apply."}),s.jsx(a,{scope:{kind:"agent",agentId:t.id}}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:[n[0]," ",n[1]]}),s.jsxs("section",{className:"space-y-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"History"}),s.jsx(m,{agentId:t.id})]})]})}export{l as PermissionsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-BwTGkJbK.js";import{b as t}from"./ProfileFields-DiarOK2y.js";import"./profile-errors-B8XkL2Rp.js";import"./use-mounted-ref-DSSTCJfY.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bh as I,b1 as F,r as i,a_ as c,d0 as R,b4 as P,j as e,Z as O,_ as B,d1 as M,d2 as W,d3 as L,d4 as _,d5 as z,d6 as H,d7 as Z,d8 as q}from"./index-BwTGkJbK.js";import{F as G}from"./FeatureDisabledState-By2dhVpu.js";import{i as J}from"./registry-HencHRXy.js";import{T as K,C as S}from"./TasksEmptyState-RkUEEU2r.js";import"./copy-button-DjAoGwds.js";import"./inline-code-DyTKSC5b.js";import"./form-D3VdAYl4.js";import"./command-CxGYZKco.js";import"./AgentPicker-BcURPZQp.js";import"./AgentOptionRow-BGRvUeF7.js";import"./execution-config-ClQZyDs9.js";import"./settings-for-runtime-BoOa-ZFG.js";import"./list-runtime-types-VNj1C8TB.js";import"./format-cron-BqRDcFZM.js";function Q(){const l=I(),{data:n=[],isLoading:m}=F(l),[h,a]=i.useState(!1),[g,r]=i.useState(),[f,w]=i.useState(null),[v,u]=i.useState(null),t=c(s=>s.tasksAgentFilter),j=c(s=>s.setTasksAgentFilter),p=c(s=>s.tasksEditScheduleId),b=c(s=>s.setTasksEditScheduleId),N=t?n.filter(s=>s.agentId===t):n,E=n.some(s=>s.agentId),{data:o}=R(void 0,E),x=i.useMemo(()=>{const s=new Map;for(const d of(o==null?void 0:o.agents)??[])s.set(d.id,d);return s},[o]);i.useEffect(()=>{if(!p||m)return;const s=n.find(d=>d.id===p);s&&(r(s),a(!0)),b(null)},[p,n,m,b]);const k=i.useMemo(()=>{var s;return t?((s=x.get(t))==null?void 0:s.name)??t:null},[t,x]),{externalTrigger:y}=P();i.useEffect(()=>{y&&(r(void 0),a(!0))},[y]);const A=s=>{u(s),r(void 0),a(!0)},T=()=>{u(null),r(void 0),a(!0)},D=s=>{a(s),s||u(null)};return l?m?e.jsx("div",{className:"space-y-2 p-4",children:[1,2,3].map(s=>e.jsx("div",{className:"rounded-lg border p-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"bg-muted animate-breath size-2 rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("div",{className:"bg-muted animate-breath h-4 w-32 rounded"}),e.jsx("div",{className:"bg-muted animate-breath h-3 w-48 rounded"})]})]})},s))}):N.length===0?e.jsxs(e.Fragment,{children:[t?e.jsxs("div",{className:"flex flex-col items-center gap-3 p-8",children:[e.jsx(C,{name:k,onClear:()=>j(null)}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"No schedules for this agent."}),e.jsx("button",{onClick:T,className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-3 py-1.5 text-sm font-medium shadow-xs transition-colors",children:"New schedule"})]}):e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 pt-6",children:e.jsx(K,{onCreateWithPreset:A,onCreateBlank:T})}),e.jsx(S,{open:h,onOpenChange:D,editTask:g,initialPreset:v,initialAgentId:t??void 0})]}):e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[e.jsx("div",{className:"space-y-2 p-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-muted-foreground text-sm font-medium",children:"Schedules"}),t&&e.jsx(C,{name:k,onClear:()=>j(null)})]}),e.jsx("button",{onClick:()=>{r(void 0),a(!0)},className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-3 py-1.5 text-sm font-medium shadow-xs transition-colors",children:"New schedule"})]})}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pb-4",children:e.jsx(O,{initial:!1,children:N.map(s=>e.jsx(B.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.2,ease:[0,0,.2,1]},className:"mb-2",children:e.jsx(M,{task:s,agent:s.agentId?x.get(s.agentId)??null:null,expanded:f===s.id,onToggleExpand:()=>w(f===s.id?null:s.id),onEdit:()=>{r(s),a(!0)}})},s.id))})}),e.jsx(S,{open:h,onOpenChange:a,editTask:g,initialPreset:v,initialAgentId:t??void 0})]}):e.jsx(G,{icon:J.tasks,name:"Scheduling",description:"Scheduled tasks let your agents work on a timer, even when you’re not here.",command:"dorkos --tasks"})}function C({name:l,onClear:n}){return e.jsx(W,{onRemove:n,removeLabel:"Clear agent filter",children:l??"Agent"})}function de({open:l,onOpenChange:n}){return e.jsx(L,{open:l,onOpenChange:n,children:e.jsxs(_,{className:"h-[85vh] max-w-2xl gap-0 p-0",children:[e.jsx(z,{}),e.jsxs(H,{className:"border-b px-4 py-3",children:[e.jsx(Z,{className:"text-sm font-medium",children:"Scheduled tasks"}),e.jsx(q,{className:"sr-only",children:"See and change your scheduled tasks"})]}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:e.jsx(Q,{})})]})})}export{de as TasksDialogWrapper};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as m,ek as Ve,j as e,a3 as fe,G as Y,I as Be,ex as q,ey as U,ez as G,eA as K,eB as L,Z as le,_ as ce,iU as de,iV as ue,e3 as Re,an as We,J as me,eE as R,e as ge,ak as qe,al as Ue,am as Ge,iW as Ke,a5 as Ye,eq as xe,a6 as He,iX as Xe,ev as ne,ew as Ze,iY as Qe,a4 as Je,iZ as Ee,i_ as Oe,i$ as es,B as W,$ as ss,h3 as je,a2 as ve,h2 as ts,h4 as ns,h1 as rs,e0 as as,fE as os,j0 as is,j1 as ls,c4 as cs,aO as ds,y as us,h6 as ms,h7 as hs,b1 as fs,b4 as xs,d3 as ps,d4 as gs,d6 as js,en as vs,d7 as ys,d8 as bs,gY as Ns,fF as ws,fG as Cs,fH as Ss,fI as ks,fJ as Rs,fK as Es}from"./index-BwTGkJbK.js";import{a as Os,u as Ms}from"./form-D3VdAYl4.js";import{C as As,a as Fs,b as Ds,c as $s,d as ye,e as he}from"./command-CxGYZKco.js";import{A as Ls}from"./AgentPicker-BcURPZQp.js";import{d as zs,k as Is,e as be}from"./execution-config-ClQZyDs9.js";import{s as Ts}from"./settings-for-runtime-BoOa-ZFG.js";import{l as _s}from"./list-runtime-types-VNj1C8TB.js";import{f as Ps,u as Vs}from"./format-cron-BqRDcFZM.js";const I=(s,r=i=>i,t)=>Os(s,r,{compare:t});function Bs(){const[s,r]=m.useState({x:0,y:0}),[t,i]=m.useState(!1),a=Ve(),l=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: none)").matches,c=a||l,d=m.useCallback(x=>{if(c)return;const j=x.currentTarget.getBoundingClientRect();r({x:x.clientX-j.left,y:x.clientY-j.top}),i(!0)},[c]),h=m.useCallback(()=>{i(!1)},[]),v=!c&&t?{background:`radial-gradient(350px circle at ${s.x}px ${s.y}px, rgba(59,130,246,0.06), transparent 80%)`}:void 0;return{position:s,isActive:t,onMouseMove:d,onMouseLeave:h,spotlightStyle:v}}function Ws({preset:s,variant:r,checked:t,onCheckedChange:i,onSelect:a,selected:l=!1,className:c}){const{onMouseMove:d,onMouseLeave:h,spotlightStyle:v}=Bs(),x=()=>{r==="toggle"?i==null||i(!t):a==null||a(s)};return e.jsxs("button",{type:"button",onClick:x,onMouseMove:d,onMouseLeave:h,"aria-label":`${s.name}: ${s.description}`,className:Y("relative flex w-full items-start gap-4 rounded-lg border p-4 text-left transition","hover:bg-accent/50 focus-ring","min-h-11",r==="toggle"&&t&&"border-primary/40 bg-accent/30",r==="selectable"&&l&&"border-primary ring-primary bg-accent/30 ring-1",c),children:[v&&e.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-lg",style:v}),r==="toggle"&&e.jsx("div",{className:"flex size-11 shrink-0 items-center justify-center",children:e.jsx(fe,{checked:t??!1,onCheckedChange:i,"aria-label":`Enable ${s.name}`,onClick:j=>j.stopPropagation()})}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("div",{className:"font-medium",children:s.name}),e.jsx("p",{className:"text-muted-foreground text-sm",children:s.description}),e.jsx("p",{"aria-hidden":"true",className:"text-muted-foreground text-xs",children:Ps(s.cron)}),e.jsx("p",{"aria-hidden":"true",className:"text-muted-foreground/80 line-clamp-2 text-sm",children:s.prompt})]})]})}function Me({onSelect:s,selectedId:r,className:t}){const{data:i,isLoading:a,isError:l}=Vs();return a?e.jsx("div",{className:Y("grid grid-cols-2 gap-3",t),children:[0,1,2,3].map(c=>e.jsx("div",{className:"bg-muted animate-breath h-28 rounded-lg border"},c))}):l?e.jsx("p",{className:"text-destructive text-sm",children:"Couldn’t load ready-made tasks. Start from scratch instead."}):!i||i.length===0?e.jsx("p",{className:"text-muted-foreground text-sm",children:"No ready-made tasks yet."}):e.jsx("div",{className:Y("grid grid-cols-2 gap-3",t),children:i.map(c=>e.jsx(Ws,{preset:c,variant:"selectable",selected:c.id===r,onSelect:s},c.id))})}const B={frequency:"daily",hour:9,days:[1,2,3,4,5],dayOfMonth:1},qs=[{value:"15m",label:"Every 15 minutes"},{value:"hourly",label:"Every hour"},{value:"daily",label:"Every day"},{value:"weekly",label:"Every week"},{value:"monthly",label:"Every month"}],Us=[{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"},{value:0,label:"Sun"}],Gs=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ks=[1,2,3,4,5],Ys=[0,6];function Ne(s){const r=s.trim();if(!r)return null;const t=r.split(/\s+/);if(t.length!==5)return null;const[i,a,l,c,d]=t;if(c!=="*")return null;if(i==="*/15"&&a==="*"&&l==="*"&&d==="*")return{...B,frequency:"15m"};if(i!=="0")return null;if(a==="*"&&l==="*"&&d==="*")return{...B,frequency:"hourly"};const h=Number(a);if(!Number.isInteger(h)||h<0||h>23)return null;if(l!=="*"&&d==="*"){const v=Number(l);return!Number.isInteger(v)||v<1||v>31?null:{...B,frequency:"monthly",hour:h,dayOfMonth:v}}if(l==="*"&&d==="*")return{...B,frequency:"daily",hour:h};if(l==="*"&&d!=="*"){const v=Hs(d);return v?{...B,frequency:"weekly",hour:h,days:v}:null}return null}function Hs(s){const r=[];for(const t of s.split(",")){const i=t.match(/^(\d)-(\d)$/);if(i){const a=Number(i[1]),l=Number(i[2]);if(a>6||l>6||a>l)return null;for(let c=a;c<=l;c++)r.push(c)}else{const a=Number(t);if(!Number.isInteger(a)||a<0||a>6)return null;r.push(a)}}return r.length>0?r.sort((t,i)=>t-i):null}function we(s){switch(s.frequency){case"15m":return"*/15 * * * *";case"hourly":return"0 * * * *";case"daily":return`0 ${s.hour} * * *`;case"weekly":return`0 ${s.hour} * * ${s.days.join(",")}`;case"monthly":return`0 ${s.hour} ${s.dayOfMonth} * *`}}function Ae(s){const r=s<12?"AM":"PM";return`${s%12||12}:00 ${r}`}function Fe(s){const r=s%100;if(r>=11&&r<=13)return`${s}th`;const t=s%10;return t===1?`${s}st`:t===2?`${s}nd`:t===3?`${s}rd`:`${s}th`}function Ce(s,r){return s.length===r.length&&s.every((t,i)=>t===r[i])}function Xs(s){const r=Ae(s.hour);switch(s.frequency){case"15m":return"Runs every 15 minutes";case"hourly":return"Runs every hour, on the hour";case"daily":return`Runs every day at ${r}`;case"weekly":{const t=[...s.days].sort((c,d)=>c-d);if(Ce(t,Ks))return`Runs every weekday at ${r}`;if(Ce(t,Ys))return`Runs every Saturday and Sunday at ${r}`;const a=t.filter(c=>c!==0).concat(t.includes(0)?[0]:[]).map(c=>Gs[c]);if(a.length===1)return`Runs every ${a[0]} at ${r}`;if(a.length===2)return`Runs every ${a[0]} and ${a[1]} at ${r}`;const l=a.pop();return`Runs every ${a.join(", ")}, and ${l} at ${r}`}case"monthly":return`Runs on the ${Fe(s.dayOfMonth)} of every month at ${r}`}}const Zs="Can’t read this timing. Check the format.";function oe(s){const r=s.trim();if(!r)return!0;try{return Re.toString(r),!0}catch{return!1}}function Qs(s){const r=s.trim();return r?oe(r)?Re.toString(r):Zs:""}function Js({value:s,onChange:r}){const t=Ne(s),[i,a]=m.useState(t?"simple":s.trim()?"cron":"simple"),[l,c]=m.useState(t??B),d=m.useRef(s);m.useEffect(()=>{if(s===d.current)return;d.current=s;const o=Ne(s);o?(a("simple"),c(o)):s.trim()&&a("cron")},[s]);function h(o){c(o);const g=we(o);d.current=g,r(g)}function v(o){h({...l,frequency:o})}function x(o){h({...l,hour:Number(o)})}function j(o){const g=l.days.includes(o);if(g&&l.days.length<=1)return;const w=g?l.days.filter(S=>S!==o):[...l.days,o].sort((S,N)=>S-N);h({...l,days:w})}function p(o){h({...l,dayOfMonth:Number(o)})}function k(){a("cron")}function C(){a("simple");const o=we(l);d.current=o,r(o)}const u=l.frequency!=="15m"&&l.frequency!=="hourly";return i==="cron"?e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{type:"button",onClick:C,className:"text-muted-foreground hover:text-foreground text-xs underline-offset-4 hover:underline",children:"Back to simple schedule"}),e.jsx(Be,{className:"font-mono",value:s,onChange:o=>r(o.target.value),placeholder:"0 9 * * 1-5"}),s.trim()&&e.jsx("p",{className:Y("text-xs",oe(s)?"text-muted-foreground":"text-destructive"),children:Qs(s)}),e.jsx("a",{href:"https://crontab.guru",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground block text-xs hover:underline",children:"Learn about cron expressions"})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs(q,{value:l.frequency,onValueChange:v,children:[e.jsx(U,{"aria-label":"Frequency",children:e.jsx(G,{})}),e.jsx(K,{children:qs.map(o=>e.jsx(L,{value:o.value,children:o.label},o.value))})]}),e.jsx(le,{initial:!1,mode:"wait",children:u&&e.jsx(ce.div,{variants:ue,initial:"initial",animate:"animate",exit:"exit",transition:de,className:"overflow-hidden",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-sm",children:"at"}),e.jsxs(q,{value:String(l.hour),onValueChange:x,children:[e.jsx(U,{className:"w-32","aria-label":"Time",children:e.jsx(G,{})}),e.jsx(K,{children:Array.from({length:24},(o,g)=>e.jsx(L,{value:String(g),children:Ae(g)},g))})]})]})},"time")}),e.jsx(le,{initial:!1,children:l.frequency==="weekly"&&e.jsx(ce.div,{variants:ue,initial:"initial",animate:"animate",exit:"exit",transition:de,className:"overflow-hidden",children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Us.map(o=>{const g=l.days.includes(o.value);return e.jsx("button",{type:"button","aria-label":o.label,"aria-pressed":g,className:Y("inline-flex min-h-11 items-center justify-center rounded-md border px-2.5 py-1 text-xs font-medium transition-colors md:min-h-0",g?"border-primary bg-primary/10 text-primary":"border-input text-muted-foreground hover:bg-accent hover:text-accent-foreground"),onClick:()=>j(o.value),children:o.label},o.value)})})},"days")}),e.jsx(le,{initial:!1,children:l.frequency==="monthly"&&e.jsx(ce.div,{variants:ue,initial:"initial",animate:"animate",exit:"exit",transition:de,className:"overflow-hidden",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-sm",children:"on day"}),e.jsxs(q,{value:String(l.dayOfMonth),onValueChange:p,children:[e.jsx(U,{className:"w-20","aria-label":"Day of month",children:e.jsx(G,{})}),e.jsx(K,{children:Array.from({length:31},(o,g)=>e.jsx(L,{value:String(g+1),children:Fe(g+1)},g+1))})]})]})},"dom")}),e.jsx("p",{className:"text-muted-foreground text-xs",children:Xs(l)}),e.jsx("button",{type:"button",onClick:k,className:"text-muted-foreground hover:text-foreground text-xs underline-offset-4 hover:underline",children:"Use a cron expression"})]})}function et(s){const r=new Map;for(const t of s){const[i]=t.split("/");r.has(i)||r.set(i,[]),r.get(i).push(t)}return r}function st({value:s,onChange:r}){const[t,i]=m.useState(!1),a=m.useRef(null),l=m.useMemo(()=>{try{return Intl.supportedValuesOf("timeZone")}catch{return[]}},[]),c=m.useMemo(()=>et(l),[l]),d=m.useMemo(()=>Intl.DateTimeFormat().resolvedOptions().timeZone,[]);m.useEffect(()=>{if(!t)return;function x(j){a.current&&!a.current.contains(j.target)&&i(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[t]);const h=s||"System default";function v(x){r(x),i(!1)}return e.jsxs("div",{ref:a,className:"relative w-full",children:[e.jsxs("button",{type:"button","aria-expanded":t,"aria-haspopup":"listbox",className:Y("border-input ring-offset-background flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-colors","focus-visible:ring-ring focus-visible:ring-1 focus-visible:outline-none","hover:bg-accent/50"),onClick:()=>i(x=>!x),children:[e.jsx("span",{className:"truncate",children:h}),e.jsx(We,{className:"ml-2 size-4 shrink-0 opacity-50"})]}),t&&e.jsx("div",{className:"bg-popover text-popover-foreground absolute top-full left-0 z-50 mt-1 w-full rounded-md border shadow-md",children:e.jsxs(As,{children:[e.jsx(Fs,{placeholder:"Search timezone…"}),e.jsxs(Ds,{className:"max-h-60",children:[e.jsx($s,{children:"No timezone found."}),e.jsxs(ye,{heading:"Default",children:[e.jsxs(he,{value:"system-default",onSelect:()=>v(""),children:[e.jsx("span",{children:"System default"}),s===""&&e.jsx(me,{className:"ml-auto size-4"})]}),d&&e.jsxs(he,{value:`${d}-detected`,onSelect:()=>v(d),children:[e.jsxs("span",{children:[d," (detected)"]}),s===d&&e.jsx(me,{className:"ml-auto size-4"})]})]}),[...c.entries()].map(([x,j])=>e.jsx(ye,{heading:x,children:j.map(p=>e.jsxs(he,{value:p,onSelect:()=>v(p),children:[e.jsx("span",{children:p.replace(`${x}/`,"").replace(/_/g," ")}),p===s&&e.jsx(me,{className:"ml-auto size-4"})]},p))},x))]})]})})]})}function tt({roster:s,value:r}){const t="flex h-9 w-full items-center gap-2 text-sm";if(!r)return e.jsx("p",{"data-testid":"settled-agent",className:`${t} text-muted-foreground`,children:"No agent"});if(s.unreadable)return e.jsx("p",{"data-testid":"settled-agent",className:`${t} text-muted-foreground`,children:"Couldn’t load your agents to show this one."});if(!s.answered)return e.jsxs("div",{"data-testid":"settled-agent-loading",className:t,"aria-hidden":!0,children:[e.jsx(ge,{className:"size-5 rounded-full"}),e.jsx(ge,{className:"h-4 w-32"})]});const i=s.agents.find(l=>l.id===r);if(!i)return e.jsx("p",{"data-testid":"settled-agent",className:`${t} text-muted-foreground`,children:"This agent isn’t registered any more."});const a=qe(i);return e.jsxs("p",{"data-testid":"settled-agent",className:t,children:[e.jsx(Ue,{color:a.color,emoji:a.emoji,size:"xs"}),e.jsx("span",{className:"truncate",children:Ge(i)})]})}function nt({roster:s,value:r,locked:t,onChange:i}){return e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{children:"Agent"}),t?e.jsxs(e.Fragment,{children:[e.jsx(tt,{roster:s,value:r}),e.jsx("p",{"data-testid":"agent-locked-note",className:"text-muted-foreground text-xs leading-relaxed",children:"The agent is set once. For another agent, make a new task."})]}):e.jsx(Ls,{agents:s.agents,value:r||void 0,onValueChange:a=>i(a??"")})]})}function De(s,r){var c,d;const t=s.map(h=>h.projectPath).join(`
|
|
2
|
-
`),i=m.useMemo(()=>t?t.split(`
|
|
3
|
-
`):[],[t]),{data:a}=Ke(i),l=r?(c=s.find(h=>h.id===r))==null?void 0:c.projectPath:void 0;return l?((d=a==null?void 0:a[l])==null?void 0:d.runtime)??null:null}const $="__inherit__";function rt(s){var _;const{runtime:r,model:t,effort:i,agentRuntime:a}=s,l=Ye(),{data:c}=xe(),d=c?Object.keys(c.capabilities):void 0,h=(c==null?void 0:c.defaultRuntime)??null,x=(y=>y!==null&&d!==void 0&&d.includes(y))(a),j=x?a:h,p=r||j,k=p??void 0,C=k!==void 0&&d!==void 0&&d.includes(k),{data:u}=He({...Xe(l,k?{runtime:k}:{}),enabled:C,retry:!1}),o=t?u==null?void 0:u.find(y=>y.value===t):void 0,g=(_=Ts(c,p))==null?void 0:_.supportsEffort,w=p?zs({agent:{runtime:p,model:t||null,effort:i||null},defaultRuntime:p,knownRuntimes:d,knownModels:Is(u),modelSupportsEffort:o?o.supportsEffort??!1:void 0,runtimeSupportsEffort:g,runtimeLabel:y=>ne(y).label}):null,S=y=>{var b;return((b=w==null?void 0:w.breakages.find(M=>y.includes(M.kind)))==null?void 0:b.message)??null},N=d==null?void 0:d.join(","),T=m.useMemo(()=>{const y=N===void 0?[]:N.split(",").filter(Boolean),b=_s(y).filter(M=>y.includes(M));return r&&!b.includes(r)&&b.push(r),b.map(M=>({value:M,label:ne(M).label}))},[N,r]),F=m.useMemo(()=>{const y=(u??[]).map(b=>({value:b.value,label:b.displayName}));return t&&!y.some(b=>b.value===t)&&y.push({value:t,label:t}),y},[u,t]),H=m.useMemo(()=>{const y=Ze.filter(b=>!(o!=null&&o.supportedEffortLevels)||o.supportedEffortLevels.includes(b)).map(b=>({value:b,label:be(b)}));return i&&!y.some(b=>b.value===i)&&y.push({value:i,label:be(i)}),y},[o,i]),D=j===null?"Same as agent":x?`Same as agent (${ne(j).label})`:`Server default (${ne(j).label})`;return{effectiveRuntime:p,runtimeOptions:T,inheritRuntimeLabel:D,modelOptions:F,supportsEffort:g===!0,effortOptions:H,runtimeWarning:S(["runtime-not-connected"]),modelWarning:S(["model-unavailable"]),effortWarning:S(["effort-unsupported-runtime","effort-unsupported-model"])}}const re="text-xs text-status-warning-fg";function at({runtime:s,model:r,effort:t,execution:i,onRuntimeChange:a,onModelChange:l,onEffortChange:c}){const{runtimeOptions:d,inheritRuntimeLabel:h,modelOptions:v,supportsEffort:x,effortOptions:j,runtimeWarning:p,modelWarning:k,effortWarning:C}=i;return e.jsxs("fieldset",{className:"space-y-3",children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Runs on"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-runtime",children:"Runs on"}),e.jsxs(q,{value:s||$,onValueChange:u=>a(u===$?"":u),children:[e.jsx(U,{id:"schedule-runtime",responsive:!1,className:"text-sm","data-testid":"task-runtime-select",children:e.jsx(G,{})}),e.jsxs(K,{children:[e.jsx(L,{value:$,children:h}),d.map(u=>e.jsx(L,{value:u.value,children:u.label},u.value))]})]}),p&&e.jsx("p",{"data-testid":"task-runtime-warning",className:re,children:p})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-model",children:"Model"}),e.jsxs(q,{value:r||$,onValueChange:u=>l(u===$?"":u),children:[e.jsx(U,{id:"schedule-model",responsive:!1,className:"text-sm","data-testid":"task-model-select",children:e.jsx(G,{})}),e.jsxs(K,{children:[e.jsx(L,{value:$,children:"Agent default"}),v.map(u=>e.jsx(L,{value:u.value,children:u.label},u.value))]})]}),k&&e.jsx("p",{"data-testid":"task-model-warning",className:re,children:k})]}),x?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-effort",children:"Effort"}),e.jsxs(q,{value:t||$,onValueChange:u=>c(u===$?"":u),children:[e.jsx(U,{id:"schedule-effort",responsive:!1,className:"text-sm","data-testid":"task-effort-select",children:e.jsx(G,{})}),e.jsxs(K,{children:[e.jsx(L,{value:$,children:"Agent default"}),j.map(u=>e.jsx(L,{value:u.value,children:u.label},u.value))]})]}),C&&e.jsx("p",{"data-testid":"task-effort-warning",className:re,children:C})]}):t&&e.jsxs("div",{className:"space-y-1.5","data-testid":"task-effort-stranded",children:[e.jsx(R,{children:"Effort"}),e.jsx("p",{className:re,children:C??"No effort setting here, so this does nothing."}),e.jsx("button",{type:"button",onClick:()=>c(""),className:"focus-ring text-status-warning-fg rounded-sm text-xs underline-offset-2 hover:underline","data-testid":"task-effort-clear",children:"Clear it"})]})]})}function ot(s){return s.asks!=="never"&&s.id!==Qe}function it(){return e.jsxs("div",{role:"note","data-testid":"task-unattended-warning",className:"bg-status-warning-bg border-status-warning-border text-status-warning-fg flex gap-2 rounded-md border px-2.5 py-2 text-xs leading-relaxed",children:[e.jsx(Je,{className:"mt-0.5 size-5 shrink-0 sm:size-3.5","aria-hidden":!0}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"Nobody is there to approve asks on a scheduled run."}),e.jsx("p",{children:"Each ask is refused, so the run will need attention."}),e.jsx("p",{children:"Use Never ask with an allow list for the commands it needs."}),e.jsx("p",{children:"“Run now” still asks you."})]})]})}const ae="10m";function lt(s){return`${Math.round(s/6e4)}m`}function P(s,r,t,i="acceptEdits"){return s?{name:s.name,description:s.description??"",prompt:s.prompt,cron:s.cron??"",agentId:s.agentId??"",timezone:s.timezone??"",permissionMode:s.permissionMode,maxRuntime:s.maxRuntime?lt(s.maxRuntime):ae,sticky:s.sticky,runtime:s.runtime??"",model:s.model??"",effort:s.effort??""}:r?{name:r.name,description:r.description,prompt:r.prompt,cron:r.cron,agentId:t??"",timezone:r.timezone??"",permissionMode:i,maxRuntime:ae,sticky:!1,runtime:"",model:"",effort:""}:{name:"",description:"",prompt:"",cron:"",agentId:t??"",timezone:"",permissionMode:i,maxRuntime:ae,sticky:!1,runtime:"",model:"",effort:""}}function Se(s){const r=s.cron.trim();return{name:s.name.trim(),description:s.description.trim(),prompt:s.prompt.trim(),cron:r||null,...r&&s.timezone?{timezone:s.timezone}:{},permissionMode:s.permissionMode,maxRuntime:s.maxRuntime.trim()||void 0,sticky:s.sticky,runtime:s.runtime||null,model:s.model||null,effort:s.effort||null}}function ct(s,r){const t=Se(s),i=Se(r);return Object.fromEntries(Object.entries(i).filter(([a,l])=>l!==t[a]))}const $e=100;function dt(s,r=[]){const t=new Set([...r].map(a=>a.toLowerCase())),i=s.name.trim();for(let a=1;;a++){const l=a===1?"-copy":`-copy-${a}`,c=`${i.slice(0,$e-l.length)}${l}`;if(!t.has(c.toLowerCase()))return{...s,name:c}}}const ut={record:["This schedule came with a package. Only the package can change what it does.","You can still turn it on or off, or change when it runs."],legacy:["This schedule came with a package from an older DorkOS.","DorkOS can’t yet tell its files from yours.","You can still turn it on or off, or change when it runs.","To edit the rest, choose Check files on its package in Marketplace › Installed."]};function ke(s){var t;const r=s;return(r==null?void 0:r.code)!==is?null:{message:r.message,ownedBy:((t=r.body)==null?void 0:t.ownedBy)==="legacy"?"legacy":"record"}}function mt({defaultValues:s,roster:r,editTask:t,onSubmitSuccess:i,onCancel:a,onDeleteClick:l,isPending:c,onMakeCopy:d,leading:h}){var ee,se;const v=Ee(),x=m.useRef(!0);m.useEffect(()=>(x.current=!0,()=>{x.current=!1}),[]);const j=Oe({isShownInline:n=>x.current&&ke(n)!==null}),p=t?ke(j.error):null,k=(t==null?void 0:t.packageOwned)??null,C=k??(p==null?void 0:p.ownedBy)??null,u=k!==null,o=Ms({defaultValues:s,onSubmit:({value:n})=>{const f=n.agentId.trim()||void 0,A=n.cron.trim();if(t){const O=ct(s,n);if(Object.keys(O).length===0){i();return}j.mutate({id:t.id,...O},{onSuccess:i})}else{const O=f??"global",te={name:n.name.trim(),description:n.description.trim()||n.name.trim(),prompt:n.prompt.trim(),target:O,cron:A||void 0,...A&&n.timezone?{timezone:n.timezone}:{},permissionMode:n.permissionMode,maxRuntime:n.maxRuntime.trim()||void 0,...n.sticky?{sticky:!0}:{},...n.runtime?{runtime:n.runtime}:{},...n.model?{model:n.model}:{},...n.effort?{effort:n.effort}:{}};v.mutate(te,{onSuccess:i})}}}),g=I(o.store,n=>n.values.agentId),w=I(o.store,n=>n.values.runtime),S=I(o.store,n=>n.values.model),N=I(o.store,n=>n.values.effort),T=I(o.store,n=>n.values.permissionMode),F=I(o.store,n=>n.values.cron),[H,D]=m.useState(!!s.cron),[_,y]=m.useState(!1),b=I(o.store,n=>n.values.maxRuntime),M=I(o.store,n=>n.values.sticky),z=[w!=="",S!=="",N!=="",b!==ae,M,es(T)].filter(Boolean).length,J=De(r.agents,g),V=rt({runtime:w,model:S,effort:N,agentRuntime:J}),{data:X}=xe(),Z=(V.effectiveRuntime?(se=(ee=X==null?void 0:X.capabilities[V.effectiveRuntime])==null?void 0:ee.permissionModes)==null?void 0:se.values:void 0)??[];return e.jsxs(o.AppForm,{children:[e.jsx("form",{onSubmit:n=>{n.preventDefault(),o.handleSubmit()},id:"schedule-form",className:"min-h-0 flex-1 overflow-y-auto",children:e.jsxs("div",{className:"space-y-5 px-4 py-5",children:[C!==null&&e.jsxs("div",{role:"status","data-slot":"package-owned-notice",className:"bg-muted/40 space-y-2 rounded-md border px-3 py-2 text-xs",children:[p?e.jsx("p",{children:p.message}):ut[C].map(n=>e.jsx("p",{children:n},n)),C==="record"&&d&&e.jsxs(W,{type:"button",variant:"outline",size:"xs",onClick:()=>d(o.state.values),children:[e.jsx(ss,{}),"Make a copy"]})]}),h,e.jsx(nt,{roster:r,value:g,locked:t!==void 0,onChange:n=>o.setFieldValue("agentId",n)}),e.jsxs("fieldset",{disabled:u,className:"min-w-0 space-y-5",children:[e.jsx(o.AppField,{name:"name",children:n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-name",children:"Name *"}),e.jsx("input",{id:"schedule-name",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:n.state.value,onChange:f=>n.handleChange(f.target.value),onBlur:n.handleBlur,maxLength:$e,placeholder:"Daily code review"}),n.state.meta.isTouched&&n.state.meta.errors.length>0&&e.jsx("p",{className:"text-destructive text-xs",children:String(n.state.meta.errors[0])})]})}),e.jsx(o.AppField,{name:"description",children:n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-description",children:"Description *"}),e.jsx("input",{id:"schedule-description",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:n.state.value,onChange:f=>n.handleChange(f.target.value),onBlur:n.handleBlur,placeholder:"A short description of this schedule"}),n.state.meta.isTouched&&n.state.meta.errors.length>0&&e.jsx("p",{className:"text-destructive text-xs",children:String(n.state.meta.errors[0])})]})}),e.jsx(o.AppField,{name:"prompt",children:n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-prompt",children:"Prompt *"}),e.jsx("textarea",{id:"schedule-prompt",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:n.state.value,onChange:f=>n.handleChange(f.target.value),onBlur:n.handleBlur,rows:4,placeholder:"Review all pending PRs and summarize findings…"}),n.state.meta.isTouched&&n.state.meta.errors.length>0&&e.jsx("p",{className:"text-destructive text-xs",children:String(n.state.meta.errors[0])})]})})]}),e.jsx(je,{open:H,onOpenChange:D,trigger:"Schedule",badge:e.jsx(ve,{variant:"secondary",className:"text-xs",children:F?"On a schedule":"Optional"}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(o.AppField,{name:"cron",children:n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{children:"When it runs"}),e.jsx(Js,{value:n.state.value,onChange:f=>n.handleChange(f)})]})}),e.jsx(o.AppField,{name:"timezone",children:n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{children:"Timezone"}),e.jsx(st,{value:n.state.value,onChange:f=>n.handleChange(f)})]})})]})}),e.jsx(o.Subscribe,{selector:n=>!oe(n.values.cron),children:n=>n?e.jsx("p",{role:"alert","data-testid":"cron-blocks-save",className:"text-destructive text-xs",children:"Fix the timing under Schedule before saving."}):null}),e.jsx(je,{open:_,onOpenChange:y,trigger:"Advanced settings",badge:z>0?e.jsxs(ve,{variant:"secondary",className:"text-xs",children:[z," changed"]}):void 0,children:e.jsxs("fieldset",{disabled:u,className:"min-w-0 space-y-4",children:[e.jsx(at,{runtime:w,model:S,effort:N,execution:V,onRuntimeChange:n=>o.setFieldValue("runtime",n),onModelChange:n=>o.setFieldValue("model",n),onEffortChange:n=>o.setFieldValue("effort",n)}),e.jsx(o.AppField,{name:"permissionMode",children:n=>{const f=Z.find(O=>O.id===n.state.value),A=(f==null?void 0:f.label)??ts(n.state.value);return Z.length===0?e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Permissions"}),e.jsxs("p",{"data-testid":"trust-dial-unavailable",className:"text-muted-foreground px-1 text-xs leading-relaxed",children:["Set to “",A,"”. No other options to choose yet. Saving keeps it."]})]}):e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Permissions"}),e.jsx(ns,{mode:n.state.value,descriptors:Z,onChangeMode:O=>n.handleChange(O),strandsWorkingMode:!0,strandedNote:e.jsxs(e.Fragment,{children:["Set to “",A,"”, which isn’t listed. Saving keeps it. Pick a stop to change it."]})}),f!==void 0&&ot(f)&&e.jsx(it,{}),e.jsx(rs,{mode:n.state.value,...f?{descriptor:f}:{},className:"px-1"})]})}}),e.jsx(o.AppField,{name:"maxRuntime",children:n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-max-runtime",children:"Stop after"}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"Ends the run if it takes longer."}),e.jsx("input",{id:"schedule-max-runtime",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-24 rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:n.state.value,onChange:f=>n.handleChange(f.target.value),onBlur:n.handleBlur,placeholder:"10m"})]})}),e.jsx(o.AppField,{name:"sticky",children:n=>e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(R,{htmlFor:"schedule-sticky",children:"Remember the last run"}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"Pick up where the last run left off. Off starts fresh each time."})]}),e.jsx(fe,{id:"schedule-sticky",checked:n.state.value,onCheckedChange:f=>n.handleChange(f)})]})})]})})]})}),e.jsxs(as,{className:"shrink-0 border-t px-4 py-3",children:[t&&e.jsxs(W,{type:"button",variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive mr-auto",onClick:l,children:[e.jsx(os,{className:"mr-1.5 size-4"}),"Delete"]}),e.jsx(W,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e.jsx(o.Subscribe,{selector:n=>n.values.name.trim()!==""&&n.values.prompt.trim()!==""&&oe(n.values.cron),children:n=>e.jsx(W,{type:"submit",size:"sm",form:"schedule-form",disabled:!n||c,children:c?"Saving…":t?"Save":"Create task"})})]})]})}function bt({open:s,onOpenChange:r,editTask:t,initialPreset:i,initialAgentId:a}){var pe;const l=ls(),c=Oe(),d=Ee(),{data:h,isError:v}=cs(),x={agents:(h==null?void 0:h.agents)??[],answered:h!==void 0,unreadable:v},{data:j}=xe(),p=De(x.agents,a),C=p!==null&&j!==void 0&&Object.hasOwn(j.capabilities,p)?p:(j==null?void 0:j.defaultRuntime)??null,{data:u}=ds(),o=us(C),g=ms(C?hs(u==null?void 0:u.executionDefaults,C):null,((pe=o==null?void 0:o.permissionModes)==null?void 0:pe.values)??[]),w=m.useRef(g);m.useLayoutEffect(()=>{w.current=g},[g]);const[S,N]=m.useState(()=>t?"form":"preset-picker"),[T,F]=m.useState(null),[H,D]=m.useState(!1),[_,y]=m.useState((t==null?void 0:t.enabled)??!0),[b,M]=m.useState(!1),z=b?void 0:t,[J,V]=m.useState(!0),{data:X}=fs(),[Z,ee]=m.useState(()=>P(t,void 0,a,g)),[se,n]=m.useState(0);function f(E,ie=!1){ee(E),n(Q=>Q+1),M(ie)}m.useEffect(()=>{if(!s){f(P(t,void 0,a,w.current)),F(null),D(!1),N(t?"form":"preset-picker");return}t?(f(P(t)),y(t.enabled),N("form")):i?(f(P(void 0,i,a,w.current)),F(i),N("form")):(f(P(void 0,void 0,a,w.current)),N("preset-picker"))},[t,s,i,a]);const{pendingTemplate:A,externalTrigger:O,clear:te}=xs();m.useEffect(()=>{O&&A&&(f(P(void 0,A,a,w.current)),F(A),N("form"),te())},[O,A,te,a]);function Le(E){f(P(void 0,E,a,w.current)),F(E),N("form")}function ze(E){const ie=(X??[]).filter(Q=>(Q.agentId??"")===E.agentId).map(Q=>Q.name);V(!0),f(dt(E,ie),!0)}function Ie(){b&&J&&t&&c.mutate({id:t.id,enabled:!1}),r(!1)}function Te(){t&&l.mutate(t.id,{onSuccess:()=>{D(!1),r(!1)}})}function _e(E){t&&(y(E),c.mutate({id:t.id,enabled:E},{onError:()=>y(t.enabled)}))}const Pe=d.isPending||c.isPending;return e.jsxs(ps,{open:s,onOpenChange:r,children:[e.jsxs(gs,{className:"flex max-h-[85vh] max-w-lg flex-col gap-0 p-0",children:[e.jsxs(js,{className:"shrink-0 border-b px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[S==="form"&&!z&&!b&&e.jsxs("button",{type:"button",onClick:()=>N("preset-picker"),className:"text-muted-foreground hover:text-foreground flex items-center gap-1 text-sm","aria-label":"Back to preset picker",children:[e.jsx(vs,{className:"size-4"}),"Back"]}),e.jsx(ys,{children:z?"Edit schedule":"New schedule"}),z&&e.jsx(fe,{className:"ml-auto",checked:_,onCheckedChange:_e,disabled:c.isPending,"aria-label":_?"Disable schedule":"Enable schedule"})]}),e.jsx(bs,{className:"sr-only",children:z?"Edit an existing schedule":"Create a new schedule"})]}),S==="preset-picker"&&e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsxs("div",{className:"space-y-4 px-4 py-5",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Start from a template"}),e.jsx(Me,{onSelect:Le,selectedId:T==null?void 0:T.id}),e.jsx("button",{type:"button",onClick:()=>{F(null),N("form")},className:"text-muted-foreground hover:text-foreground w-full text-center text-sm transition-colors",children:"Start from scratch"})]})}),S==="form"&&e.jsx(mt,{defaultValues:Z,roster:x,editTask:z,onSubmitSuccess:Ie,onCancel:()=>r(!1),onDeleteClick:()=>D(!0),isPending:Pe,onMakeCopy:ze,leading:b&&t?e.jsxs("div",{className:"flex items-start gap-2 rounded-md border px-3 py-2",children:[e.jsx(Ns,{id:"copy-switch-off-original",checked:J,onCheckedChange:E=>V(E===!0)}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(R,{htmlFor:"copy-switch-off-original",className:"text-sm font-normal",children:"Switch off the package’s schedule"}),e.jsxs("p",{className:"text-muted-foreground text-xs",children:["So “",t.name,"” and your copy don’t both run."]})]})]}):void 0},se)]}),t&&e.jsx(ws,{open:H,onOpenChange:D,children:e.jsxs(Cs,{children:[e.jsxs(Ss,{children:[e.jsxs(ks,{children:["Delete “",t.name,"”?"]}),e.jsx(Rs,{children:"Its run history is deleted too. This can’t be undone."})]}),e.jsxs(Es,{children:[e.jsx("button",{onClick:()=>D(!1),className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-3 py-1.5 text-sm font-medium shadow-xs transition-colors",children:"Cancel"}),e.jsx(W,{variant:"destructive",size:"sm",onClick:Te,loading:l.isPending,loadingLabel:"Deleting…",children:"Delete task"})]})]})})]})}function Nt({onCreateWithPreset:s,onCreateBlank:r}){return e.jsxs("div",{className:"flex flex-col items-center pb-8 md:pb-12",children:[e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No schedules yet"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-sm text-center text-sm",children:"Put a skill on a timer and it runs without you."}),e.jsx("div",{className:"w-full max-w-lg",children:e.jsx(Me,{onSelect:s})}),e.jsx(W,{variant:"ghost",className:"mt-4",onClick:r,children:"New custom schedule"})]})}export{bt as C,Nt as T};
|