dorkos 0.117.0 → 0.118.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 +1266 -938
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-H-acF3Uh.js → AboutPage-BOS59p1y.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-DHDeFsXG.js → ActivityErrorState-DOmV85tr.js} +1 -1
- package/dist/client/assets/{ActivityPage-xyMrmAY2.js → ActivityPage-DbsBpb6N.js} +1 -1
- package/dist/client/assets/ActivityRow-B1ZeL7Jb.js +1 -0
- package/dist/client/assets/AdapterIcon-XPLZ-NAi.js +1 -0
- package/dist/client/assets/AdapterSetupWizard-DfNJz5SD.js +2 -0
- package/dist/client/assets/{AgentOptionRow-BgPnj-jY.js → AgentOptionRow-C15RQsub.js} +1 -1
- package/dist/client/assets/{AgentPicker-3POlE_TY.js → AgentPicker-CydNJYi_.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-CL5bwXYH.js → AgentRequestCard-BBSbluBs.js} +3 -3
- package/dist/client/assets/{AppearancePage-D3z40f_b.js → AppearancePage-8ALtWGZZ.js} +1 -1
- package/dist/client/assets/{ApplyToOverridesDialog-GafmL5mr.js → ApplyToOverridesDialog-Cv3KEf7T.js} +1 -1
- package/dist/client/assets/{AttentionSignalRow-4ZSIhmin.js → AttentionSignalRow-c-u1cE1l.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-CD8bGnb5.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-Re2CfOlC.js} +3 -3
- package/dist/client/assets/BindingDialog-8xnsM47D.js +1 -0
- package/dist/client/assets/{BlintzCanvas-B-PoJThg.js → BlintzCanvas-DUDSNxlM.js} +1 -1
- package/dist/client/assets/{CanvasCsvContent-CgiQWBJA.js → CanvasCsvContent-D697P3sa.js} +6 -6
- package/dist/client/assets/CanvasFileContent-BJ39nHuR.js +2 -0
- package/dist/client/assets/{CanvasModel3dContent-BXCQRGHN.js → CanvasModel3dContent-TaunlbT2.js} +2 -2
- package/dist/client/assets/{ChatAppsOff-C60EWHju.js → ChatAppsOff-CFEmPGm1.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-B5dKqE-I.js → CodeMirrorDiff-B7VUevZG.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BzB4Bznz.js → CodeMirrorEditor-BX1bJlnT.js} +1 -1
- package/dist/client/assets/CommitmentList-CDocwl5K.js +1 -0
- package/dist/client/assets/{CommitmentsPage-ChzV2lIP.js → CommitmentsPage-Cr_MvU96.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-mF8l9rkm.js → ComputerResourceView-CJMUZPDy.js} +1 -1
- package/dist/client/assets/{ComputerViewer-CKR_ZSO1.js → ComputerViewer-BA-9lBBN.js} +1 -1
- package/dist/client/assets/ConnectionAccessLists-BLLpxhn3.js +1 -0
- package/dist/client/assets/{ConnectionsPage-6PEoOCSe.js → ConnectionsPage-BWVfAPd1.js} +2 -2
- package/dist/client/assets/ConventionPage-EK3WUWVa.js +11 -0
- package/dist/client/assets/{ExtensionPageRoute-Bv2i-Pqm.js → ExtensionPageRoute-C9hsJNX2.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-C5S-Mncm.js → FloatingTanStackRouterDevtools-CqogiFob-BeyAgBfh.js} +1 -1
- package/dist/client/assets/HandlePage-CfeEzfDk.js +1 -0
- package/dist/client/assets/HeartbeatPage-DfbNenFv.js +1 -0
- package/dist/client/assets/{KeyEntry-IgIIE1HE.js → KeyEntry-CEbe5Xvn.js} +2 -2
- package/dist/client/assets/{LexicalField-B3neANKd.js → LexicalField-DC_6Z-Ye.js} +1 -1
- package/dist/client/assets/{ManagesPage-gDDvLXjS.js → ManagesPage-CYnGvNM2.js} +1 -1
- package/dist/client/assets/{Marketplace-DAe-slPr.js → Marketplace-CWiiq8of.js} +1 -1
- package/dist/client/assets/{MarketplaceSourcesView-jhoKlyGb.js → MarketplaceSourcesView-DF3cHMR0.js} +1 -1
- package/dist/client/assets/{McpAppFrame-BQxyYB23.js → McpAppFrame-D5Muf5Sf.js} +2 -2
- package/dist/client/assets/{McpSigninBody-DNB9IVJs.js → McpSigninBody-CLZFoQgC.js} +1 -1
- package/dist/client/assets/{Model3dViewer-CZYCij-x.js → Model3dViewer-C9ODHy5I.js} +1 -1
- package/dist/client/assets/NamePage-B4YrH-ug.js +1 -0
- package/dist/client/assets/NewDirectMessageMenu-Co9Uv5t5.js +1 -0
- package/dist/client/assets/{NotificationsPage-BZIME3p9.js → NotificationsPage-ldulSpVu.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-C1E_5NM2.js → OpenMeshSwitch-BfEvR7s7.js} +2 -2
- package/dist/client/assets/{OperatorIdentityForm-BV0aT5IX.js → OperatorIdentityForm-ZM_zDnjM.js} +1 -1
- package/dist/client/assets/{PermissionHistory-Btciwm3c.js → PermissionHistory-liL_pJDR.js} +1 -1
- package/dist/client/assets/{PermissionsPage-CdLK-g0S.js → PermissionsPage-DFMjDQby.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-D7hczXpC.js → PersonalityPopover-CITFG0_N.js} +1 -1
- package/dist/client/assets/PhotoPage-DYDJPBfu.js +1 -0
- package/dist/client/assets/{PresetPicker-Cw2jlFQM.js → PresetPicker-CpYu7nb6.js} +2 -2
- package/dist/client/assets/{PreviewRefusedNotice-CcoKHPsy.js → PreviewRefusedNotice-CF3bzfSe.js} +1 -1
- package/dist/client/assets/{ProfileFields-xAsiq8Mz.js → ProfileFields-D4p6bhIa.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-DM8F3Evu.js → ProfilePanelContainer-XCuCnd1t.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-CJYZpLNj.js → ProfileRolePicker-qRf3DSdk.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-CHWGhlr1.js → PromptSuggestionChips-CUwLk83h.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-D781EUfA.js → ReportsToPopover-Cu-Cnzij.js} +1 -1
- package/dist/client/assets/{RoomSurface-CT_OGVWw.js → RoomSurface-CsAifwp2.js} +7 -7
- package/dist/client/assets/{RoomsPage-DcoGt4-A.js → RoomsPage-DZYMR2in.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-6PnPqbut.js → RunsOnPopover-CTBEMstG.js} +1 -1
- package/dist/client/assets/RuntimeConnectFlow-DY4sjRgN.js +1 -0
- package/dist/client/assets/RuntimeSetupDialog-DJu_-eNa.js +1 -0
- package/dist/client/assets/{SessionsPage-Cnai5quH.js → SessionsPage-thndqcpY.js} +1 -1
- package/dist/client/assets/{SettingsDialog-DUWvCqf_.js → SettingsDialog-CKmcLF66.js} +3 -3
- package/dist/client/assets/SkillsPage-CmXyAw3J.js +1 -0
- package/dist/client/assets/{TaskDialogWrapper-CepIueBg.js → TaskDialogWrapper-Boxr_hgF.js} +1 -1
- package/dist/client/assets/{TasksEmptyState-CCPObBmm.js → TasksEmptyState-CQf1YroK.js} +2 -2
- package/dist/client/assets/{TasksPage-CqoHRhDG.js → TasksPage-DGNXrDAk.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-mHbMrj9_.js → TeamComputerEntry-CIfFRo6-.js} +1 -1
- package/dist/client/assets/ToolsPage-BKZkSarf.js +2 -0
- package/dist/client/assets/{TopologyGraph-Br4qaSXn.js → TopologyGraph-og2tlLj7.js} +1 -1
- package/dist/client/assets/{TourHost-BNT2J0zS.js → TourHost-DzEG8bZP.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-CPtwQ55a.js → UnlinkDialog-BTYC_Sit.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-BeQ2x8Ar.js → WidgetErrorCard-CT4sl_T6.js} +8 -8
- package/dist/client/assets/_shell-BDlkTSin.js +90 -0
- package/dist/client/assets/{_shell._home-DzhKFHpd.js → _shell._home-CP7HQ7Cs.js} +1 -1
- package/dist/client/assets/_shell._home.activity-DGXa_ouh.js +1 -0
- package/dist/client/assets/_shell._home.index-D5kOfqnL.js +3 -0
- package/dist/client/assets/_shell._home.tasks-BSMD-atB.js +1 -0
- package/dist/client/assets/_shell._home.workspaces-Cdsw2-jI.js +1 -0
- package/dist/client/assets/_shell.channels-B4VQ7tiZ.js +10 -0
- package/dist/client/assets/_shell.connections-sF5vS-Lm.js +1 -0
- package/dist/client/assets/{_shell.feedback-requests-dFRmIBE1.js → _shell.feedback-requests-hu21WXyA.js} +2 -2
- package/dist/client/assets/_shell.marketplace-B-T-ALMv.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-Chu-9-Vi.js +1 -0
- package/dist/client/assets/{_shell.session-DnREJ52s.js → _shell.session-Bz6wvDBp.js} +3 -3
- package/dist/client/assets/{_shell.team-B1hbq8aH.js → _shell.team-raG7wRwF.js} +4 -4
- package/dist/client/assets/_shell.x._extensionId-DSqMu6Ey.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-DSqMu6Ey.js +1 -0
- package/dist/client/assets/{access-copy-BLfnVgF5.js → access-copy-CcG3wpsK.js} +1 -1
- package/dist/client/assets/{banner-Cqt8YzUW.js → banner-nt7EFLr6.js} +2 -2
- package/dist/client/assets/card-B_zeSZiU.js +1 -0
- package/dist/client/assets/{command-C9CeOcFB.js → command-CDfYcQI6.js} +1 -1
- package/dist/client/assets/{cpu-D0mdP6ki.js → cpu-D861493C.js} +1 -1
- package/dist/client/assets/empty-state-CQ1oXLFa.js +1 -0
- package/dist/client/assets/{execution-config-AW7ORH0Y.js → execution-config-on8kVvnW.js} +1 -1
- package/dist/client/assets/{file-D3iv2i0G.js → file-Bwo21EVR.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-zZf2-mqw.js → file-exclamation-point-BedYLbs2.js} +1 -1
- package/dist/client/assets/{file-text-CwK7EV60.js → file-text-BTj3WyHS.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-DW1zqXSL.js → find-latest-widget-fence-B8fM5rIs.js} +3 -3
- package/dist/client/assets/form-lSBktWDn.js +1 -0
- package/dist/client/assets/{format-cron-BtOOA5e7.js → format-cron-W7G0In8e.js} +1 -1
- package/dist/client/assets/{git-branch-DPgttvPa.js → git-branch-CKlZ81Bg.js} +1 -1
- package/dist/client/assets/{heart-BwQb2EFQ.js → heart-BSVjeGLA.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-GGvkvk_S.js → highlighted-body-KPVGNVTW-Ct8vmPkj.js} +1 -1
- package/dist/client/assets/index-09EqfhW0.js +1 -0
- package/dist/client/assets/{index-C7BvPaXV.js → index-6pYWHTBx.js} +1 -1
- package/dist/client/assets/{index-ukv5t1cK.js → index-7Fd_Eeda.js} +1 -1
- package/dist/client/assets/{index-CkluSB9W.js → index-B-C_A3lP.js} +2 -2
- package/dist/client/assets/index-BDCqg2iM.css +1 -0
- package/dist/client/assets/index-BHt5KOZA.js +1 -0
- package/dist/client/assets/{index-2MwCJp-O.js → index-BVedye9r.js} +1 -1
- package/dist/client/assets/{index-C1zEos_1.js → index-BdrbKBym.js} +1 -1
- package/dist/client/assets/index-BjTJ6p2k.js +1 -0
- package/dist/client/assets/{index-DUvx8VEa.js → index-C0TknRcB.js} +1 -1
- package/dist/client/assets/index-C8-dwIPp.js +1018 -0
- package/dist/client/assets/{index-BCwnroTw.js → index-C96eZrOR.js} +1 -1
- package/dist/client/assets/index-CAv_6Po4.js +1 -0
- package/dist/client/assets/index-CCWSicoJ.js +1 -0
- package/dist/client/assets/{index-DvpWMPrj.js → index-CF73kwtO.js} +36 -36
- package/dist/client/assets/{index-DxU-VkDj.js → index-CNnnXzI4.js} +1 -1
- package/dist/client/assets/{index-Dk05g-u9.js → index-CQrM6oF9.js} +1 -1
- package/dist/client/assets/{index-6TyLF_Kz.js → index-CaKe9EaL.js} +1 -1
- package/dist/client/assets/{index-obbYyK_q.js → index-CeZ13dpH.js} +1 -1
- package/dist/client/assets/{index-DylucJZe.js → index-CeeHkxIC.js} +1 -1
- package/dist/client/assets/index-ClELcMX1.js +1 -0
- package/dist/client/assets/{index-B-032E-J.js → index-CrEyJcPM.js} +3 -3
- package/dist/client/assets/{index-CmELWXLL.js → index-D7kjWnlR.js} +1 -1
- package/dist/client/assets/{index-8XbUBB9y.js → index-DEOzZEcu.js} +3 -3
- package/dist/client/assets/{index-2kcIgMts.js → index-DOuj--Yi.js} +1 -1
- package/dist/client/assets/{index-DsRVcCEI.js → index-DQJM5kjJ.js} +1 -1
- package/dist/client/assets/{index-D09-6MJl.js → index-DShrfGYE.js} +1 -1
- package/dist/client/assets/{index-BSGR71VY.js → index-DURo45pu.js} +1 -1
- package/dist/client/assets/{index-mPmWFWvR.js → index-DeNVXdMl.js} +1 -1
- package/dist/client/assets/{index-CYRBybyy.js → index-DgRqCuFH.js} +1 -1
- package/dist/client/assets/{index-BzHf9H2D.js → index-Dh8D-3Sb.js} +1 -1
- package/dist/client/assets/{index-5jiMMwFO.js → index-DjI5vH_U.js} +1 -1
- package/dist/client/assets/{index-BBKtLMOE.js → index-Dq4bx2np.js} +1 -1
- package/dist/client/assets/{index-BtUom5gL.js → index-GINKfP45.js} +1 -1
- package/dist/client/assets/{index-DhWcN0iH.js → index-KaSZDcGa.js} +1 -1
- package/dist/client/assets/{index-Xmzz0kKG.js → index-RFknyjho.js} +1 -1
- package/dist/client/assets/{index-BYRhWLhr.js → index-SdTS2P3x.js} +1 -1
- package/dist/client/assets/{index-aRrsIRtW.js → index-UNxDevG6.js} +1 -1
- package/dist/client/assets/{index-D_bIHF5l.js → index-V_EcsvR4.js} +1 -1
- package/dist/client/assets/{index--IvDgnWz.js → index-bvqpTKLz.js} +1 -1
- package/dist/client/assets/{index-Bw9sMeWJ.js → index-gbNK9zj5.js} +3 -3
- package/dist/client/assets/{index-aqnG9V3q.js → index-sfSRuIXm.js} +6 -6
- package/dist/client/assets/{inline-code-BDPvCbUE.js → inline-code-Beal0546.js} +1 -1
- package/dist/client/assets/{layers-C0fTjhD3.js → layers-DUfQMkMa.js} +1 -1
- package/dist/client/assets/{lightbulb-CauvTp1H.js → lightbulb-DTSn-mNB.js} +2 -2
- package/dist/client/assets/{link-2-BFWagtwF.js → link-2-CHr2s4m2.js} +2 -2
- package/dist/client/assets/{list-runtime-types-DWuilOeW.js → list-runtime-types-CwEp9Lg4.js} +1 -1
- package/dist/client/assets/{markdown-content-irJMN3oI.js → markdown-content-GoymYcRL.js} +1 -1
- package/dist/client/assets/mention-pill-XE9mX9G8.js +1 -0
- package/dist/client/assets/{message-square-off-CEgJ9mPa.js → message-square-off-DUkKSITA.js} +1 -1
- package/dist/client/assets/more-details-3dDtVYc6.js +1 -0
- package/dist/client/assets/{owner-notice-D0r6ZH_Y.js → owner-notice-BKmuWRki.js} +1 -1
- package/dist/client/assets/{package-DzrvXxqm.js → package-DM7e-GVa.js} +1 -1
- package/dist/client/assets/page-container-nGewlFnj.js +1 -0
- package/dist/client/assets/{paperclip-C_2eggQt.js → paperclip-BgXlvBBI.js} +1 -1
- package/dist/client/assets/{path-input-ExHSfE6J.js → path-input-RzOiTE45.js} +1 -1
- package/dist/client/assets/primer-trigger-B60oEVY7.js +3 -0
- package/dist/client/assets/{profile-errors-C-4JXW0u.js → profile-errors-CFZN0y6a.js} +1 -1
- package/dist/client/assets/{progress--zm5Rh4c.js → progress-Cvnh4Qcr.js} +1 -1
- package/dist/client/assets/{query-error-state-CPMymRkX.js → query-error-state-CfJfYpa3.js} +1 -1
- package/dist/client/assets/{radio-oT4bYZ-T.js → radio-BOcAjXVO.js} +1 -1
- package/dist/client/assets/registry-B9wsS5De.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-CfXA97kO.js → relay-trace-schemas-Cvb7RGjg.js} +2 -2
- package/dist/client/assets/{room-files-source-BgBqLMLB.js → room-files-source-B-ZJA_NM.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-CrElPm6O.js → rotate-ccw-clock-vRQP4hWE.js} +1 -1
- package/dist/client/assets/{rotate-cw-CdW7VTvV.js → rotate-cw-DD2nOAQ-.js} +2 -2
- package/dist/client/assets/{scroll-area-BqDwmAjQ.js → scroll-area-DTvv8_DS.js} +1 -1
- package/dist/client/assets/search-x-Ig8nk-DU.js +6 -0
- package/dist/client/assets/{shield-check-B7JJvCBE.js → shield-check-DjnWx7aT.js} +1 -1
- package/dist/client/assets/{shield-x-DvFRtrsO.js → shield-x-BrtccpM7.js} +1 -1
- package/dist/client/assets/{soul-file-BDthDhZW.js → soul-file-C5mMIP4v.js} +1 -1
- package/dist/client/assets/{table-CK_OyzSy.js → table-Rll_Jxd8.js} +1 -1
- package/dist/client/assets/{terminal-CqyyqODz.js → terminal-Bjss9oke.js} +1 -1
- package/dist/client/assets/{trust-posture-JGG7FWhE.js → trust-posture-Dmk2WlZv.js} +1 -1
- package/dist/client/assets/{unplug-D2Avzz6s.js → unplug-BHYMc4ND.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-BgsW86t7.js → unverified-catalog-notice-BmIVQhjE.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-NFvlYTrH.js → use-adapter-catalog-RzlxX2Wa.js} +1 -1
- package/dist/client/assets/{use-bindings-Ofq1UjvW.js → use-bindings-Ds_MAC67.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-Cr3bdM7x.js → use-composer-prefs-ckA_eZQS.js} +1 -1
- package/dist/client/assets/{use-connector-management-Dz2D5qIt.js → use-connector-management-oEqok0QG.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-wwMMFsmG.js → use-deep-link-scroll-Clu9Sz2-.js} +1 -1
- package/dist/client/assets/use-delete-binding-B_zHPcy8.js +1 -0
- package/dist/client/assets/{use-dev-links-Buq6rA0h.js → use-dev-links-BO7-IHe9.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-DXgiQHcR.js → use-external-adapter-catalog-7lRWtn7J.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-FN5AfUr-.js → use-full-activity-feed-DrcMJL9m.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-BhzXZsbH.js +1 -0
- package/dist/client/assets/{use-jump-back-in-CF-nu5zW.js → use-jump-back-in-Dav0ttfs.js} +3 -3
- package/dist/client/assets/use-local-browser-CtltDlof.js +1 -0
- package/dist/client/assets/{use-mesh-topology-BdnC6sCG.js → use-mesh-topology-CiS9XQsg.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-B5J2da-A.js → use-mounted-ref-DuK0vm9N.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-B1iYUOEO.js → use-notification-prefs-Chf4UNbq.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-J6Ed141H.js → use-panel-tab-placements-C5y831aL.js} +1 -1
- package/dist/client/assets/use-pending-read-i6TB4gGQ.js +1 -0
- package/dist/client/assets/use-personality-commit-KKJ2ve1V.js +1 -0
- package/dist/client/assets/{use-promo-activation-CZfM_gjU.js → use-promo-activation-D45fuXdT.js} +3 -3
- package/dist/client/assets/{use-promo-dismissals-DlSguZS3.js → use-promo-dismissals-8-hGry_v.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-Bxf5sc_M.js → use-pulse-freshness-CWudgqNc.js} +1 -1
- package/dist/client/assets/{use-relay-config-BwMES9xB.js → use-relay-config-8mXfegbP.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-lzWFVGRY.js → use-room-follow-claim-DgEWUsoP.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-0RaD5Yyr.js → use-roving-tab-list-CXy0Hv5J.js} +1 -1
- package/dist/client/assets/use-session-canvas-CUvHGgMf.js +64 -0
- package/dist/client/assets/{use-session-diagnostics-gBgn5q2r.js → use-session-diagnostics-LKiXub1H.js} +3 -3
- package/dist/client/assets/{use-unclaimed-chats-DOqEolFt.js → use-unclaimed-chats-Cr812OTh.js} +1 -1
- package/dist/client/assets/use-update-config-Bad4g6mB.js +1 -0
- package/dist/client/assets/useMutationState-BnXJ-0A_.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261015190907_bored_skreet.sql +30 -0
- package/dist/drizzle/20261016144104_remote_command_hub_kinds.sql +21 -0
- package/dist/drizzle/meta/20261015190907_snapshot.json +14012 -0
- package/dist/drizzle/meta/20261016144104_snapshot.json +14012 -0
- package/dist/drizzle/meta/_journal.json +14 -0
- package/dist/server/index.js +130465 -126661
- package/dist/server/index.js.map +2 -2
- package/package.json +4 -4
- package/dist/client/assets/ActivityRow-CXLwJ28E.js +0 -1
- package/dist/client/assets/AdapterIcon-DsMXg2AE.js +0 -1
- package/dist/client/assets/AdapterSetupWizard-CuKhSucd.js +0 -2
- package/dist/client/assets/BindingDialog-DUqmAWDb.js +0 -1
- package/dist/client/assets/CanvasFileContent-D5egw6o3.js +0 -2
- package/dist/client/assets/CommitmentList-EjCcpBJ1.js +0 -1
- package/dist/client/assets/ConnectionAccessLists-BkFNTeLh.js +0 -1
- package/dist/client/assets/ConventionPage-Cc1bx5BQ.js +0 -11
- package/dist/client/assets/HandlePage-B0l9YTdO.js +0 -1
- package/dist/client/assets/HeartbeatPage-COV5M0c_.js +0 -1
- package/dist/client/assets/NamePage-BaS8zqwG.js +0 -1
- package/dist/client/assets/NewDirectMessageMenu-Dvmoevnh.js +0 -1
- package/dist/client/assets/PhotoPage-Copz-uyh.js +0 -1
- package/dist/client/assets/RuntimeConnectFlow-COnfwsEa.js +0 -1
- package/dist/client/assets/RuntimeSetupDialog-cfZVbgJJ.js +0 -1
- package/dist/client/assets/SkillsPage-BVt3zxB-.js +0 -1
- package/dist/client/assets/ToolsPage-IYUQ8OGL.js +0 -2
- package/dist/client/assets/_shell-TKho4VPJ.js +0 -90
- package/dist/client/assets/_shell._home.activity-DyrGuSto.js +0 -1
- package/dist/client/assets/_shell._home.index-jWJ7womG.js +0 -3
- package/dist/client/assets/_shell._home.tasks-tOBxVLcL.js +0 -1
- package/dist/client/assets/_shell._home.workspaces-B0ovWo_a.js +0 -1
- package/dist/client/assets/_shell.channels-Cs-s7a-W.js +0 -10
- package/dist/client/assets/_shell.connections-BXVkOfW_.js +0 -1
- package/dist/client/assets/_shell.marketplace-CuTHl0Cy.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-UWbdjpMd.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-DdiN22Ga.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-DdiN22Ga.js +0 -1
- package/dist/client/assets/agent-browser-BkFCE19g.js +0 -1
- package/dist/client/assets/card-BaRHWQF1.js +0 -1
- package/dist/client/assets/empty-state-C0Xjezko.js +0 -1
- package/dist/client/assets/form-CwnBnnFI.js +0 -1
- package/dist/client/assets/index-CMaIfS_G.js +0 -1018
- package/dist/client/assets/index-CTxREsg3.js +0 -1
- package/dist/client/assets/index-D5QS-i8I.css +0 -1
- package/dist/client/assets/index-DLE5hltn.js +0 -1
- package/dist/client/assets/index-DaWx8Mly.js +0 -1
- package/dist/client/assets/index-GvMV_K0T.js +0 -1
- package/dist/client/assets/index-lbAGzLtf.js +0 -1
- package/dist/client/assets/mention-pill-C0AzfrQH.js +0 -1
- package/dist/client/assets/more-details-CwkthrCT.js +0 -1
- package/dist/client/assets/page-container-CH8mJ_Yk.js +0 -1
- package/dist/client/assets/primer-trigger-CgHlhMZL.js +0 -3
- package/dist/client/assets/registry-DLUlxXR7.js +0 -1
- package/dist/client/assets/search-x-DqLtufOG.js +0 -6
- package/dist/client/assets/use-delete-binding-j0PZzvHt.js +0 -1
- package/dist/client/assets/use-is-below-desktop-BudV2uCQ.js +0 -1
- package/dist/client/assets/use-pending-read-BNKrtv93.js +0 -1
- package/dist/client/assets/use-personality-commit-CWBNZX4E.js +0 -1
- package/dist/client/assets/use-session-canvas-CAxswuAf.js +0 -64
- package/dist/client/assets/use-update-config-9fndji1c.js +0 -1
- package/dist/client/assets/useMutationState-CtolUzjw.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: 60330606 bytes
|
|
4
|
+
sha256: c0ffc6a13c2a6276b78f5212e0b1645c0b7b93b24da742bb5f1e36ce2d62e727
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dorkos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.118.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",
|
|
@@ -82,15 +82,15 @@
|
|
|
82
82
|
"tsx": "^4.23.15",
|
|
83
83
|
"typescript": "^5.9.3",
|
|
84
84
|
"vitest": "^4.1.11",
|
|
85
|
-
"@dorkos/client": "0.0.0",
|
|
86
85
|
"@dorkos/db": "0.0.0",
|
|
87
86
|
"@dorkos/browser": "0.0.0",
|
|
88
87
|
"@dorkos/eslint-config": "0.0.0",
|
|
89
|
-
"@dorkos/shared": "0.0.0",
|
|
90
88
|
"@dorkos/harness": "0.0.0",
|
|
89
|
+
"@dorkos/shared": "0.0.0",
|
|
90
|
+
"@dorkos/server": "0.0.0",
|
|
91
91
|
"@dorkos/typescript-config": "0.0.0",
|
|
92
92
|
"@dorkos/marketplace": "0.0.0",
|
|
93
|
-
"@dorkos/
|
|
93
|
+
"@dorkos/client": "0.0.0"
|
|
94
94
|
},
|
|
95
95
|
"scripts": {
|
|
96
96
|
"build": "tsx scripts/build.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bf as d,dd as x,j as e,a5 as u,Q as l,ce as m,de as g,B as h}from"./index-CMaIfS_G.js";import{b as f,c}from"./table-CK_OyzSy.js";const k={tasks:{text:"text-purple-500",bg:"bg-purple-500/10",label:"Schedules"},relay:{text:"text-teal-500",bg:"bg-teal-500/10",label:"Messages"},agent:{text:"text-indigo-500",bg:"bg-indigo-500/10",label:"Agent"},config:{text:"text-amber-500",bg:"bg-amber-500/10",label:"Settings"},system:{text:"text-neutral-500",bg:"bg-neutral-500/10",label:"System"},permissions:{text:"text-sky-500",bg:"bg-sky-500/10",label:"Permissions"}},p={user:{text:"text-muted-foreground"},agent:{text:"text-foreground"},system:{icon:x,text:"text-neutral-500"},tasks:{icon:d,text:"text-purple-500"}};function b({actorType:s,actorLabel:r,agentColor:a,className:n}){const i=p[s],t=i.icon;return s==="user"?e.jsx(u,{shape:"pill",variant:"outline",className:l("text-muted-foreground",n),children:r}):s==="agent"?e.jsxs("span",{"data-slot":"actor-badge",className:l("inline-flex items-center gap-1.5 text-xs font-medium",i.text,n),children:[e.jsx("span",{className:"size-2 shrink-0 rounded-full",style:a?{backgroundColor:a}:void 0,"aria-hidden":!0}),e.jsx("span",{className:"truncate",children:r})]}):e.jsxs("span",{"data-slot":"actor-badge",className:l("inline-flex items-center gap-1 text-xs font-medium",i.text,n),children:[t&&e.jsx(t,{className:"size-3 shrink-0","aria-hidden":!0}),e.jsx("span",{children:r})]})}function y(s,r=new Date){const a=new Date(s),n=new Date(r);n.setHours(0,0,0,0);const i=new Date(n);i.setDate(i.getDate()-1);const t=new Date(n);t.setDate(t.getDate()-t.getDay());const o=a.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return a>=n?o:a>=i?`Yesterday ${o}`:a>=t?`${a.toLocaleDateString("en-US",{weekday:"long"})} ${o}`:a.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function v({item:s,compact:r=!1,className:a}){const n=m(),i=y(s.occurredAt),t=s.linkPath?g(s.linkPath):null;return e.jsxs(f,{"data-slot":"activity-row","data-activity-row":t?"":void 0,tabIndex:t?0:void 0,onKeyDown:t?o=>{o.key==="Enter"&&n({href:t,replace:!1})}:void 0,className:l(t?"focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none":"hover:bg-transparent",a),children:[!r&&e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"w-28 py-1.5 pr-0 pl-2 max-sm:hidden",children:e.jsx("span",{className:"text-muted-foreground text-xs tabular-nums",children:i})}),e.jsx(c,{className:"w-24 py-1.5 pr-0 max-sm:hidden",children:e.jsx(b,{actorType:s.actorType,actorLabel:s.actorLabel})})]}),e.jsx(c,{className:l("max-w-0 py-1.5",r?"pl-2":"max-sm:pl-2"),children:e.jsxs("span",{className:"text-foreground/80 block truncate text-sm",children:[e.jsx("span",{className:l("text-muted-foreground mr-1 text-xs font-medium",!r&&"sm:hidden"),children:s.actorLabel}),s.summary]})}),e.jsx(c,{className:l("py-1.5 pr-2 text-right",r?"w-10":"w-16 max-sm:w-10"),children:t&&e.jsx(h,{variant:"ghost",size:"sm",className:"h-6 min-h-[44px] px-2 text-xs sm:min-h-0",onClick:()=>n({href:t,replace:!1}),children:"Open →"})})]})}export{v as A,k as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bL as n,bM as r,j as c,bN as s,aY as A}from"./index-CMaIfS_G.js";const g={connected:n.success,disconnected:n.neutral,error:n.error,starting:`${n.warning} ${r}`,stopping:`${n.warning} ${r}`,reconnecting:`${n.warning} ${r}`},_={connected:"Connected",disconnected:"Ready",error:"Error",starting:"Connecting…",stopping:"Stopping…",reconnecting:"Reconnecting…"};function d({iconId:i,adapterType:a,size:t=16,className:o}){const e=s[i??""]??s[a??""];return e?c.jsx(e,{size:t,className:o}):c.jsx(A,{className:o,style:{width:t,height:t}})}export{d as A,g as a,_ as b};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a8 as be,aa as Ne,ab as ze,j as e,bm as Ee,bn as qe,r as m,c$ as ie,gW as $e,d0 as oe,gE as le,a6 as Te,Y as ce,Z as de,gX as ue,$ as he,a0 as pe,bF as K,W as Z,gY as me,gZ as We,Q as I,dY as X,dZ as J,d_ as ee,d$ as se,e0 as te,I as re,e4 as xe,R as Me,bE as Ve,B as k,g_ as Se,e5 as De,e3 as ae,x as ke,bk as Pe,bj as Re,a7 as Oe,ar as ge,g$ as _e,h0 as Le,h1 as Ge,h2 as Ie,h3 as Qe,cD as Ue,ae as G,ew as Ye,ex as He,ey as Ke,ez as Ze,eA as Xe,eB as Je,h4 as fe,h5 as Y}from"./index-CMaIfS_G.js";import{B as es}from"./use-bindings-Ofq1UjvW.js";import{M as Q}from"./markdown-content-irJMN3oI.js";import{a as ss,b as ts,c as rs}from"./use-adapter-catalog-NFvlYTrH.js";import{u as as}from"./form-CwnBnnFI.js";import{a as ns}from"./BindingDialog-DUqmAWDb.js";import"./relay-trace-schemas-CfXA97kO.js";function zs(s={}){const t=be(),a=Ne();return ze({mutationFn:({id:r,updates:l})=>t.updateBinding(r,l),onSuccess:()=>{a.invalidateQueries({queryKey:[...es]})},meta:s.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:s.errorLabel??"Couldn’t update that connection"}})}function is({field:s,value:t,onChange:a,error:r,allValues:l}){const[i,n]=m.useState("");if(s.showWhen&&l[s.showWhen.field]!==s.showWhen.equals)return null;const o=`config-field-${s.key}`,v=s.type==="select"&&s.displayAs==="radio-cards",h=t!=null?String(t):"",x=h==="***",y=()=>{if(x){n("");return}if(s.pattern&&h&&!new RegExp(s.pattern).test(h)){n(s.patternMessage??"Check the format");return}n("")},d=r??i;if(s.type==="boolean")return e.jsxs("div",{children:[e.jsxs(ie,{orientation:"horizontal",className:"items-center justify-between gap-4",children:[e.jsxs($e,{className:"min-w-0",children:[e.jsxs(oe,{htmlFor:o,className:"text-sm font-medium",children:[s.label,s.required&&e.jsx("span",{"aria-hidden":"true",className:"text-destructive ml-0.5",children:"*"})]}),s.description&&e.jsx(le,{className:"text-xs",children:s.description})]}),e.jsx(Te,{id:o,checked:!!t,onCheckedChange:N=>a(s.key,N)})]}),s.helpMarkdown&&e.jsxs(ce,{children:[e.jsxs(de,{className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ue,{className:"size-3"}),"Where do I find this?",e.jsx(he,{className:"size-3 transition-transform [[data-state=open]_&]:rotate-180"})]}),e.jsx(pe,{children:e.jsx("div",{className:"bg-muted/50 mt-2 rounded-md border p-3",children:e.jsx(Q,{content:s.helpMarkdown,className:"text-xs"})})})]}),e.jsx(K,{children:d&&e.jsx(Z.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsx(me,{className:"mt-1.5",children:d})})})]});const b=()=>{var N,C;switch(s.type){case"text":case"url":return e.jsx(re,{id:o,type:s.type==="url"?"url":"text",value:h,onChange:c=>a(s.key,c.target.value),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"password":return x?e.jsx(xe,{id:o,value:h,showPassword:!1,onChange:c=>{a(s.key,c.target.value.trim()),i&&n("")},onFocus:()=>a(s.key,""),onBlur:y,placeholder:"Saved · type to replace"}):e.jsx(xe,{id:o,value:h,visibleByDefault:s.visibleByDefault??!1,onChange:c=>{a(s.key,c.target.value.trim()),i&&n("")},onBlur:y,onPaste:()=>setTimeout(y,0),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"number":return e.jsx(re,{id:o,type:"number",value:h,onChange:c=>a(s.key,c.target.value?Number(c.target.value):void 0),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"select":return s.displayAs==="radio-cards"?e.jsx("div",{className:"grid grid-cols-2 gap-3",role:"radiogroup","aria-labelledby":`${o}-label`,"aria-required":s.required||void 0,children:(N=s.options)==null?void 0:N.map(c=>e.jsxs("button",{type:"button",role:"radio","aria-checked":h===c.value,onClick:()=>a(s.key,c.value),className:I("hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-ring flex flex-col items-start rounded-md border p-3 text-left transition outline-none focus-visible:ring-[3px]",h===c.value&&"border-primary ring-primary bg-accent/30 ring-1"),children:[e.jsx("span",{className:"text-sm font-medium",children:c.label}),c.description&&e.jsx("span",{className:"text-muted-foreground mt-1 text-xs",children:c.description})]},c.value))}):e.jsxs(X,{value:h,onValueChange:c=>a(s.key,c),children:[e.jsx(J,{id:o,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0,children:e.jsx(ee,{placeholder:s.placeholder??"Select…"})}),e.jsx(se,{children:(C=s.options)==null?void 0:C.map(c=>e.jsx(te,{value:c.value,children:c.label},c.value))})]});case"textarea":return e.jsx(We,{id:o,value:h,onChange:c=>a(s.key,c.target.value),placeholder:s.placeholder,rows:3,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});default:return null}};return e.jsxs(ie,{children:[e.jsxs(oe,{id:`${o}-label`,htmlFor:v?void 0:o,children:[s.label,s.required&&!x&&e.jsx("span",{"aria-hidden":"true",className:"text-destructive ml-0.5",children:"*"})]}),b(),s.description&&e.jsx(le,{className:"text-xs",children:s.description}),s.helpMarkdown&&e.jsxs(ce,{children:[e.jsxs(de,{className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ue,{className:"size-3"}),"Where do I find this?",e.jsx(he,{className:"size-3 transition-transform [[data-state=open]_&]:rotate-180"})]}),e.jsx(pe,{children:e.jsx("div",{className:"bg-muted/50 mt-2 rounded-md border p-3",children:e.jsx(Q,{content:s.helpMarkdown,className:"text-xs"})})})]}),e.jsx(K,{children:d&&e.jsx(Z.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsx(me,{children:d})})})]})}function os(s,t){return s.showWhen?t[s.showWhen.field]===s.showWhen.equals:!0}function ls({fields:s,allValues:t,renderField:a}){const r=new Map;for(const l of s){const i=l.section;r.has(i)||r.set(i,[]),r.get(i).push(l)}return e.jsx("div",{className:"space-y-6",children:Array.from(r.entries()).map(([l,i])=>{const n=i.filter(o=>os(o,t));return n.length===0?null:e.jsxs("div",{className:"space-y-3",children:[l&&e.jsx("h4",{className:"text-sm font-semibold",children:l}),e.jsx(Ee,{children:e.jsx(qe,{children:n.map(o=>a(o))})})]},l??"__default")})})}const je=["agent","configure","test","confirm"],cs={agent:"Agent",configure:"Set up",test:"Check",confirm:"Review"};function ds({current:s,showAgentStep:t}){const a=t?je:je.filter(l=>l!=="agent"),r=a.indexOf(s);return e.jsx("div",{className:"flex items-start justify-between px-1",role:"navigation","aria-label":"Setup steps",children:a.map((l,i)=>{const n=i<r,o=i===r,v=i>r;return e.jsxs(m.Fragment,{children:[i>0&&e.jsx("div",{className:I("mt-3 h-px flex-1",n||o?"bg-primary":"border-muted-foreground/40 border-t border-dashed")}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:I("flex size-6 items-center justify-center rounded-full text-xs font-medium",n&&"bg-primary text-primary-foreground",o&&"bg-primary text-primary-foreground ring-primary/30 ring-2",v&&"border-muted-foreground text-muted-foreground border"),"aria-current":o?"step":void 0,children:n?e.jsx(Me,{className:"size-3"}):i+1}),e.jsx("span",{className:I("text-3xs",o?"text-foreground font-medium":"text-muted-foreground"),children:cs[l]})]})]},l)})})}function us({manifest:s,label:t,onLabelChange:a,fields:r,form:l,currentSetupStep:i,hasSetupGuide:n,onOpenGuide:o}){const{Subscribe:v,AppField:h}=l;return e.jsxs("div",{className:"space-y-4",children:[s.setupInstructions&&e.jsxs("div",{className:"flex gap-2 rounded-md border border-blue-200 bg-blue-50 p-3 text-sm text-blue-800 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-200",children:[e.jsx(Ve,{className:"mt-0.5 size-4 shrink-0"}),e.jsx(Q,{content:s.setupInstructions,className:"text-sm text-blue-800 dark:text-blue-200"})]}),(s.actionButton||n)&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n&&e.jsxs(k,{type:"button",variant:"outline",size:"sm",onClick:o,children:[e.jsx(Se,{className:"mr-1.5 size-3.5"}),"Setup guide"]}),s.actionButton&&e.jsx(k,{asChild:!0,type:"button",variant:"outline",size:"sm",children:e.jsx(De,{href:s.actionButton.url,children:s.actionButton.label})})]}),i&&e.jsx("h4",{className:"text-sm font-medium",children:i.title}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"adapter-label",children:"Name (optional)"}),e.jsx(re,{id:"adapter-label",placeholder:s.displayName,value:t,onChange:x=>a(x.target.value)}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Helps you tell this connection apart."})]}),e.jsx(v,{selector:x=>x.values,children:x=>e.jsx(ls,{fields:r,allValues:x,renderField:y=>e.jsx(h,{name:y.key,children:d=>{var b;return e.jsx(is,{field:y,value:d.state.value,onChange:(N,C)=>d.handleChange(C),onBlur:d.handleBlur,error:d.state.meta.isTouched?(b=d.state.meta.errors[0])==null?void 0:b.toString():void 0,allValues:x})}},y.key)})})]})}function hs({isPending:s,isSuccess:t,isError:a,errorMessage:r,botUsername:l,onRetry:i}){return e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx(ke,{size:"lg",className:"text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Trying to reach it…"})]}),t&&e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(Pe,{className:"text-status-success size-8"}),e.jsx("p",{className:"text-status-success-fg text-sm",children:"Reachable"}),l&&e.jsx("div",{className:"flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:e.jsxs("span",{className:"font-mono",children:["@",l]})})]}),a&&e.jsxs(e.Fragment,{children:[e.jsx(Re,{className:"text-destructive size-8"}),e.jsx("p",{className:"text-destructive text-sm",children:"Not reachable"}),r&&e.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-xs text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-300",children:[e.jsx(Oe,{className:"mt-0.5 size-3 shrink-0"}),e.jsx("span",{children:r})]}),e.jsx(k,{variant:"outline",size:"sm",onClick:i,children:"Retry"})]})]})}function ps(s){return s.length>8?"•••• "+s.slice(-4):"•••"}function ms({manifest:s,adapterId:t,isEditMode:a,values:r,botUsername:l,agentName:i}){return e.jsxs("div",{className:"space-y-3",children:[!a&&i&&e.jsxs("p",{className:"bg-accent/30 rounded-md border px-3 py-2 text-sm",children:["Messages here go to ",e.jsx("span",{className:"font-medium",children:i}),"."]}),!a&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Connection ID"}),e.jsx("span",{className:"font-mono",children:t})]}),s.configFields.map(n=>{if(n.showWhen&&r[n.showWhen.field]!==n.showWhen.equals)return null;const o=String(r[n.key]??""),v=n.type==="password"?ps(o):o;return e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:n.label}),e.jsx("span",{className:"max-w-[200px] truncate font-mono",children:v})]},n.key)}),l&&s.type==="telegram"&&e.jsxs("a",{href:`https://t.me/${l}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary inline-flex items-center gap-1.5 text-sm underline-offset-4 hover:underline",children:["Message @",l," in Telegram"]})]})}const ye=[{value:"per-chat",label:"One shared chat per group or channel",hint:"Everyone there shares one chat with the agent."},{value:"per-user",label:"One chat per person",hint:"Each person gets their own chat, even in a group."},{value:"stateless",label:"A fresh start every message",hint:"Nothing carries over from the message before."}];function xs({agentOptions:s,agentId:t,onAgentIdChange:a,strategy:r,onStrategyChange:l}){var n;const i=s.length===1?s[0]:void 0;return m.useEffect(()=>{i&&!t&&a(i.id)},[i,t,a]),s.length===0?e.jsx("p",{role:"alert",className:"text-muted-foreground rounded-md border border-dashed px-4 py-6 text-center text-sm",children:"No agents yet. Add one from the Team page first."}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Messages here go to this agent."}),i?e.jsxs("div",{className:"bg-accent/30 rounded-md border px-4 py-3 text-sm",children:[e.jsx("span",{className:"font-medium",children:ge(i)})," will answer."]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"wizard-agent",children:"Who should answer?"}),e.jsxs(X,{value:t,onValueChange:a,children:[e.jsx(J,{id:"wizard-agent",className:"w-full",children:e.jsx(ee,{placeholder:"Pick an agent"})}),e.jsx(se,{children:s.map(o=>e.jsx(te,{value:o.id,children:ge(o)},o.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"wizard-memory",children:"How the agent remembers"}),e.jsxs(X,{value:r,onValueChange:o=>l(o),children:[e.jsx(J,{id:"wizard-memory",className:"w-full",children:e.jsx(ee,{})}),e.jsx(se,{children:ye.map(o=>e.jsx(te,{value:o.value,children:o.label},o.value))})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:(n=ye.find(o=>o.value===r))==null?void 0:n.hint})]})]})}function gs({open:s,onOpenChange:t,title:a,content:r}){return e.jsx(_e,{open:s,onOpenChange:t,children:e.jsxs(Le,{side:"right",className:"w-[480px] overflow-y-auto sm:max-w-lg",children:[e.jsxs(Ge,{children:[e.jsxs(Ie,{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"size-4"}),a," setup guide"]}),e.jsx(Qe,{children:"Step-by-step setup instructions."})]}),e.jsx("div",{className:"mt-4 px-4",children:e.jsx(Q,{content:r})})]})})}function we(s){const t=s.setupSteps;if(!t||t.length===0)return[];const a=new Set(t.flatMap(r=>r.fields));return s.configFields.filter(r=>!a.has(r.key))}function fs(s,t){return typeof t=="string"||t===void 0||t===null?t:s.valueShape==="id-list"?Array.isArray(t)?t.join(`
|
|
2
|
-
`):t:s.valueShape==="json-object"&&typeof t=="object"?JSON.stringify(t,null,2):t}function js(s,t){const a=s.setupSteps;if(!a||a.length===0)return s.configFields;const r=a[t];if(!r)return s.configFields;const l=s.configFields.filter(i=>r.fields.includes(i.key));return t!==a.length-1?l:[...l,...we(s)]}const ys="Advanced";function H(s){const t={};for(const[a,r]of Object.entries(s)){const l=a.split(".");let i=t;for(let n=0;n<l.length-1;n++){const o=l[n];(!(o in i)||typeof i[o]!="object"||i[o]===null)&&(i[o]={}),i=i[o]}i[l[l.length-1]]=r}return t}function ve(s,t){const a=t.split(".");let r=s;for(const l of a){if(r==null||typeof r!="object")return;r=r[l]}return r}function vs(s,t){const a={};for(const r of s.configFields){const l=t?ve(t,r.key):void 0;l!==void 0&&r.type!=="password"?a[r.key]=fs(r,l):r.type==="password"&&t&&ve(t,r.key)!==void 0?a[r.key]="***":r.default!==void 0?a[r.key]=r.default:a[r.key]=r.type==="boolean"?!1:""}return a}function bs(s,t=[]){const a=s.type;if(!t.includes(a))return a;let r=2;for(;t.includes(`${a}-${r}`);)r++;return`${a}-${r}`}function Ns({manifest:s,existingInstance:t,existingAdapterIds:a=[],onOpenChange:r}){const l=!!t,[i,n]=m.useState(t?"configure":"agent"),[o,v]=m.useState(!1),[h]=m.useState(()=>(t==null?void 0:t.id)??bs(s,a)),[x,y]=m.useState(()=>{var p;return((p=t==null?void 0:t.config)==null?void 0:p.label)??""}),[d,b]=m.useState(0),[N,C]=m.useState(""),[c,P]=m.useState(""),[T,R]=m.useState("per-chat"),q=ss(),z=ts(),S=rs(),W=ns(),{data:F}=Ue(),w=be(),E=Ne(),$=(F==null?void 0:F.agents)??[],B=s.setupSteps&&s.setupSteps.length>0,j=as({defaultValues:vs(s,t==null?void 0:t.config),validators:{onSubmit:({value:p})=>{const g={};for(const u of s.configFields)if(!(u.showWhen&&p[u.showWhen.field]!==u.showWhen.equals)&&u.required){const f=p[u.key];(f==null||f==="")&&(g[u.key]=`${u.label} is required`)}return Object.keys(g).length>0?{fields:g}:void 0}},onSubmit:async()=>{}}),M=m.useMemo(()=>{const p=new Set(we(s).map(g=>g.key));return js(s,d).map(g=>p.has(g.key)&&!g.section?{...g,section:ys}:g)},[s,d]),O=m.useCallback(()=>{const p=j.state.values;let g=!0;for(const u of M)if(!(u.showWhen&&p[u.showWhen.field]!==u.showWhen.equals)&&u.required){const f=p[u.key];(f==null||f==="")&&(j.setFieldMeta(u.key,A=>({...A,isTouched:!0,errors:[`${u.label} is required`],errorMap:{onSubmit:`${u.label} is required`}})),g=!1)}return g},[j,M]),_=m.useCallback(()=>{if(i==="agent"){if(!c)return;n("configure");return}if(i==="configure"){if(!O())return;if(B&&s.setupSteps&&d<s.setupSteps.length-1){b(u=>u+1);return}const g=j.state.values;n("test"),S.mutate({type:s.type,config:H(g)},{onSuccess:u=>{u.botUsername&&(C(u.botUsername),x||y(`@${u.botUsername}`))}})}else i==="test"&&n("confirm")},[i,c,B,s,d,O,j,S,x]),V=m.useCallback(()=>{i==="test"?(n("configure"),S.reset()):i==="confirm"?n("test"):i==="configure"&&(B&&d>0?b(p=>p-1):l||n("agent"))},[i,B,d,S,l]),D=m.useCallback(async p=>{try{return await w.removeRelayAdapter(p),!0}catch{return!1}finally{E.invalidateQueries({queryKey:["relay"]})}},[w,E]),U=m.useCallback(()=>{const p=j.state.values,g=H(p),u=x?{...g,label:x}:g;if(l&&t){z.mutate({id:t.id,config:u},{onSuccess:()=>r(!1)});return}if(!c){n("agent");return}q.mutate({type:s.type,id:h,config:u},{onSuccess:()=>{W.mutate({adapterId:h,agentId:c,sessionStrategy:T,label:""},{onSuccess:()=>{var A;const f=((A=$.find(L=>L.id===c))==null?void 0:A.name)??c;G.success(`${s.displayName} is connected`,{description:`Messages here go to ${f}.`}),r(!1)},onError:f=>{n("agent"),D(h).then(A=>{A?G.error("Nothing was set up",{description:`${s.displayName} couldn’t be linked to an agent, so it wasn’t saved. ${f.message}`}):G.error("Couldn’t finish undoing",{description:`${s.displayName} was added with no agent to answer it. Remove it from Messaging. ${f.message}`})})}})},onError:f=>{var A,L,ne;(A=f.message)!=null&&A.includes("timed out")?G.error(`Couldn’t reach ${s.displayName}`,{description:"Check your token and network, then try again."}):((L=f.message)!=null&&L.includes("duplicate")||(ne=f.message)!=null&&ne.includes("exists"))&&(n("configure"),b(0))}})},[j,l,t,z,q,W,s,h,x,c,T,$,D,r]),Ce=m.useCallback(p=>{p||(n(l?"configure":"agent"),b(0),y(""),C(""),P(""),R("per-chat"),v(!1),j.reset(),S.reset()),r(p)},[r,j,S,l]),Ae=m.useCallback(()=>{S.mutate({type:s.type,config:H(j.state.values)})},[S,s.type,j]),Fe=q.isPending||z.isPending||W.isPending,Be=B&&s.setupSteps?s.setupSteps[d]:void 0;return{step:i,isEditMode:l,adapterId:h,label:x,setLabel:y,botUsername:N,guideOpen:o,setGuideOpen:v,form:j,visibleFields:M,bindAgentId:c,setBindAgentId:P,bindStrategy:T,setBindStrategy:R,agentOptions:$,isSaving:Fe,hasSetupSteps:B,setupStepIndex:d,currentSetupStep:Be,testConnection:S,handleContinue:_,handleBack:V,handleSave:U,handleOpenChange:Ce,handleRetryTest:Ae}}function Es({open:s,onOpenChange:t,manifest:a,existingInstance:r,existingAdapterIds:l=[]}){var _;const i=Ns({manifest:a,existingInstance:r,existingAdapterIds:l,onOpenChange:t}),{step:n,isEditMode:o,adapterId:v,label:h,setLabel:x,botUsername:y,guideOpen:d,setGuideOpen:b,form:N,visibleFields:C,bindAgentId:c,setBindAgentId:P,bindStrategy:T,setBindStrategy:R,agentOptions:q,isSaving:z,hasSetupSteps:S,setupStepIndex:W,currentSetupStep:F,testConnection:w,handleContinue:E,handleBack:$,handleSave:B,handleOpenChange:j,handleRetryTest:M}=i,O={agent:"Pick who answers messages here.",configure:(F==null?void 0:F.description)??"Fill in the settings this needs.",test:"Checking the connection…",confirm:"Check it over, then save."}[n];return e.jsxs(m.Fragment,{children:[e.jsx(Ye,{open:s,onOpenChange:j,children:e.jsxs(He,{className:"flex max-h-[85vh] max-w-lg flex-col",children:[e.jsxs(Ke,{children:[e.jsx(Ze,{children:o?`Edit ${a.displayName}`:`Add ${a.displayName}`}),e.jsx(Xe,{children:O})]}),e.jsxs("div",{className:"min-h-0 space-y-4 overflow-y-auto py-2",children:[e.jsx(ds,{current:n,showAgentStep:!o}),e.jsx(K,{mode:"wait",children:e.jsxs(Z.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[n==="agent"&&e.jsx(xs,{agentOptions:q,agentId:c,onAgentIdChange:P,strategy:T,onStrategyChange:R}),n==="configure"&&e.jsx(us,{manifest:a,label:h,onLabelChange:x,fields:C,form:N,currentSetupStep:F,hasSetupGuide:!!a.setupGuide,onOpenGuide:()=>b(!0)}),n==="test"&&e.jsx(hs,{isPending:w.isPending,isSuccess:w.isSuccess,isError:w.isError,errorMessage:(_=w.error)==null?void 0:_.message,botUsername:y,onRetry:M}),n==="confirm"&&e.jsx(N.Subscribe,{selector:V=>V.values,children:V=>{var D;return e.jsx(ms,{manifest:a,adapterId:v,isEditMode:o,values:V,botUsername:y,agentName:((D=q.find(U=>U.id===c))==null?void 0:D.name)||c})}})]},n)})]}),e.jsxs(Je,{className:"flex items-center justify-between sm:justify-between",children:[e.jsxs("div",{children:[(n==="test"||n==="confirm")&&e.jsxs(k,{variant:"ghost",onClick:$,disabled:z,children:[e.jsx(fe,{className:"mr-1 size-4"}),"Back"]}),n==="configure"&&(S?W>0:!o)&&e.jsxs(k,{variant:"ghost",onClick:$,children:[e.jsx(fe,{className:"mr-1 size-4"}),"Back"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{variant:"outline",onClick:()=>j(!1),children:"Cancel"}),n==="agent"&&e.jsxs(k,{onClick:E,disabled:!c,children:["Continue",e.jsx(Y,{className:"ml-1 size-4"})]}),n==="configure"&&e.jsxs(k,{onClick:E,children:["Continue",e.jsx(Y,{className:"ml-1 size-4"})]}),n==="test"&&!w.isPending&&!w.isSuccess&&e.jsx(k,{variant:"ghost",onClick:E,children:"Skip"}),n==="test"&&w.isSuccess&&e.jsxs(k,{onClick:E,children:["Continue",e.jsx(Y,{className:"ml-1 size-4"})]}),n==="confirm"&&e.jsxs(k,{onClick:B,disabled:z,children:[z&&e.jsx(ke,{className:"mr-2"}),o?"Save changes":"Connect"]})]})]})]})}),a.setupGuide&&e.jsx(gs,{open:d,onOpenChange:b,title:a.displayName,content:a.setupGuide})]})}export{Es as A,zs as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gt as v,gu as fe,g8 as be,gv as Ce,j as e,fZ as ee,f_ as ne,f$ as te,g0 as se,gw as Ne,g1 as ae,gx as ie,g2 as re,g3 as ce,g4 as oe,a8 as de,aa as Ie,ab as Te,a9 as Ae,y as le,gy as Se,r as A,gz as he,e3 as g,dY as S,dZ as k,d_ as R,d$ as F,e0 as b,gA as ke,gB as Re,a6 as E,a5 as pe,ay as Fe,gC as Oe,gD as we,cD as Me,cG as De,cH as Ee,cJ as Be,cK as $e,cL as _e,ar as Le,I as Pe,gE as Z,B,dj as ze,gF as He,ev as qe,gG as Ge,x as Ye}from"./index-CMaIfS_G.js";import{B as Ke}from"./use-bindings-Ofq1UjvW.js";import{u as Qe}from"./form-CwnBnnFI.js";import{u as Ue}from"./use-adapter-catalog-NFvlYTrH.js";import{I as We,t as Ve}from"./trust-posture-JGG7FWhE.js";function J(n){return`Turn on ${be(n.stop)}`}function Ze(n){return!v(n)||fe(n)?null:"This stop never pauses to ask. It acts without checking with you."}function Je({descriptor:n,consequence:i,onCancel:o,onConfirm:h}){const d=Ce(n??void 0),y=n?Ze(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&&J(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&&J(n)})]})]})})}function ln(n={}){const i=de(),o=Ie();return Te({mutationFn:h=>i.createBinding(h),onSuccess:()=>{o.invalidateQueries({queryKey:[...Ke]})},meta:n.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:n.errorLabel??"Couldn’t add that connection"}})}function Xe(n){const i=de();return Ae({queryKey:["relay","observed-chats",n],queryFn:()=>i.getObservedChats(n),enabled:!!n,staleTime:3e4})}const X=[{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:H}){const u=X.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 q(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:H?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(g,{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(g,{htmlFor:"binding-session-strategy",children:"How the agent remembers"}),e.jsxs(S,{value:n,onValueChange:l=>i(l),children:[e.jsx(k,{id:"binding-session-strategy",className:"w-full",children:e.jsx(R,{})}),e.jsx(F,{children:X.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(ke,{mode:o,descriptors:c,onChangeMode:q,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(g,{htmlFor:"perm-initiate",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal",children:[e.jsx(Re,{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(g,{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(g,{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(g,{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(Je,{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(We,{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 ge(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} · ${ge(o)}`:h}function hn(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 pn(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 mn({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,H]=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=Qe({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=[]}=Ue(),{data:f}=Me(),[I,q]=A.useState(()=>(d==null?void 0:d.adapterId)??""),{data:l=[]}=Xe(I||void 0),N=D.flatMap(t=>t.instances.filter(x=>x.enabled).map(x=>({id:x.id,label:x.label?`${x.label} (${t.manifest.displayName})`:`${x.id} (${t.manifest.displayName})`}))),T=(f==null?void 0:f.agents)??[];function xe(){r.setFieldValue("chatId",m),r.setFieldValue("channelType",m)}return e.jsx(De,{open:n,onOpenChange:i,children:e.jsxs(Ee,{className:"max-h-[85vh] max-w-md gap-0 p-0",children:[e.jsxs(Be,{className:"border-b px-4 py-3",children:[e.jsx($e,{children:p?"Edit connection":"Add connection"}),e.jsx(_e,{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:x})=>{var V;const Y=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,K=p?C:(V=T.find(s=>s.id===t.agentId))==null?void 0:V.name,Q=Y&&K?`${nn({sessionStrategy:t.strategy,chatDisplayName:t.chatId!==m?`#${t.chatId}`:void 0,channelType:t.channelType!==m?t.channelType:void 0})}. Routed to ${K}.`:null,U=t.chatId!==m||t.channelType!==m,ye=t.strategy!=="per-chat"||t.permissionMode!=="acceptEdits"||t.canInitiate||!t.canReply||!t.canReceive||!t.notifyOnTaskComplete,je=!Y||!ue||!!M||x,W=!!M||x;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(g,{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),q(a)},children:[e.jsx(k,{id:"binding-adapter",className:"w-full",children:e.jsx(R,{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(g,{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(k,{id:"binding-agent",className:"w-full",children:e.jsx(R,{placeholder:"Select an agent"})}),e.jsx(F,{children:T.map(a=>e.jsx(b,{value:a.id,children:Le(a)},a.id))})]})})]})]}),e.jsx(r.AppField,{name:"label",children:s=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"binding-label",children:"Label (optional)"}),e.jsx(Pe,{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(Z,{children:"A name to tell this connection apart"})]})}),e.jsxs(he,{open:L,onOpenChange:P,trigger:"Chat filter",badge:U?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(g,{htmlFor:"binding-chat-id",children:"Chat ID"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-chat-id",className:"w-full",children:e.jsx(R,{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?ge(a.channelType):null,`${a.messageCount} messages`].filter(Boolean).join(" · ")})]},a.chatId))]})]}),e.jsx(Z,{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(g,{htmlFor:"binding-channel-type",children:"Chat type"}),e.jsxs(S,{value:s.state.value,onValueChange:s.handleChange,children:[e.jsx(k,{id:"binding-channel-type",className:"w-full",children:e.jsx(R,{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))]})]})]})}),U&&e.jsx("div",{className:"px-4 py-3",children:e.jsx(B,{variant:"ghost",size:"sm",onClick:xe,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:H,hasChanges:ye}),Q&&e.jsx("p",{className:"text-muted-foreground bg-muted/50 rounded-md px-3 py-2 text-xs italic",children:Q})]}),e.jsxs(ze,{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(qe,{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:Ge({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:[W&&e.jsx(Ye,{size:"xs",className:"mr-1.5"}),W?"Saving…":p?"Save changes":"Add connection"]})]})]})}})]})})}export{mn as B,ln as a,nn as b,hn as c,ge as d,pn as t,Xe as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-BzB4Bznz.js","assets/index-CMaIfS_G.js","assets/index-D5QS-i8I.css","assets/index-Dk05g-u9.js","assets/index-Bw9sMeWJ.js","assets/BlintzCanvas-B-PoJThg.js","assets/BlintzCanvas-GgiCXV7C.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a8 as K,b0 as w,b1 as V,a9 as $,r,j as t,aa as U,Q as Y,B as C,R as G,b2 as I,b3 as A}from"./index-CMaIfS_G.js";import{u as J}from"./use-session-canvas-CAxswuAf.js";import{R as W}from"./rotate-cw-CdW7VTvV.js";import"./WidgetErrorCard-BeQ2x8Ar.js";import"./card-BaRHWQF1.js";import"./progress--zm5Rh4c.js";import"./markdown-content-irJMN3oI.js";import"./table-CK_OyzSy.js";import"./terminal-CqyyqODz.js";import"./package-DzrvXxqm.js";import"./heart-BwQb2EFQ.js";import"./git-branch-DPgttvPa.js";import"./file-text-CwK7EV60.js";import"./file-D3iv2i0G.js";import"./McpAppFrame-BQxyYB23.js";import"./more-details-CwkthrCT.js";const X=r.lazy(()=>A(()=>import("./CodeMirrorEditor-BzB4Bznz.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),Z=r.lazy(()=>A(()=>import("./BlintzCanvas-B-PoJThg.js"),__vite__mapDeps([5,1,2,4,6])).then(e=>({default:e.BlintzCanvas}))),ee=500;function E(e,i){return["canvas-file",e,i]}function te(e,i){return i==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function re(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 se(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";default:return null}}function ye({content:e,documentId:i}){const p=K(),u=w(n=>n.selectedCwd),b=w(n=>n.setDocumentEditing),o=w(n=>{var f;return((f=n.openDocuments.find(j=>j.id===i))==null?void 0:f.editing)??!1}),h=V(),{data:l,error:v,isLoading:T}=$({queryKey:E(u,e.sourcePath),enabled:u!==null,queryFn:()=>p.readFileContent(u,e.sourcePath),staleTime:3e4,retry:!1}),[d,x]=r.useState(null),R=n=>{x(n&&l?{pinnedHash:l.hash}:null)};if(u===null)return t.jsx(S,{children:"Open a chat to view files."});if(T)return t.jsx(S,{children:"Loading file…"});if(v||!l)return t.jsx(S,{children:re(v)});const c=d!==null&&o,s=(c?d==null?void 0:d.pinnedHash:null)??l.hash;return t.jsx(ne,{content:e,documentId:i,cwd:u,loaded:l.content,theme:h,isEditing:c,onEditingChange:R,setDocumentEditing:b},`${e.sourcePath}:${s}`)}function ne({content:e,documentId:i,cwd:p,loaded:u,theme:b,isEditing:o,onEditingChange:h,setDocumentEditing:l}){const v=e.readOnly!==!0,T=te(e.sourcePath,e.language),d=U(),[x,R]=r.useState(u),c=J({documentId:i,sourcePath:e.sourcePath,cwd:p,loadedContent:u}),s=r.useRef(null),n=r.useRef(x),f=r.useRef(0),j=r.useRef(0),N=r.useRef(c.save),F=r.useRef(c.prepareFinalSave),m=r.useRef(null),P=r.useRef(h);r.useEffect(()=>{n.current=x,N.current=c.save,F.current=c.prepareFinalSave,P.current=h});const z=r.useCallback(a=>{var g;f.current+=1,n.current=a,R(a),(g=m.current)==null||g.cancel(),m.current=F.current(a),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,N.current(n.current)},ee)},[]),D=()=>{f.current+=1,n.current=u,R(u),h(!0),l(i,!0)},M=async()=>{s.current&&(clearTimeout(s.current),s.current=null);const a=n.current,g=f.current,H=++j.current,y=await N.current(a);if(y.status!=="changed"&&y.status!=="no_op"||f.current!==g||j.current!==H||y.confirmed.content!==a)return;const _=y.confirmed;_.content===n.current&&d.setQueryData(E(p,e.sourcePath),k=>k&&{...k,content:_.content,hash:_.hash}),h(!1),l(i,!1)},Q=()=>{d.invalidateQueries({queryKey:E(p,e.sourcePath)})};r.useEffect(()=>{var a;o||(s.current&&clearTimeout(s.current),s.current=null,(a=m.current)==null||a.cancel(),m.current=null)},[o]),r.useEffect(()=>()=>{var a;s.current&&(clearTimeout(s.current),s.current=null),(a=m.current)==null||a.flush(),m.current=null,l(i,!1),P.current(!1)},[i,l]);const B=()=>{const a=c.adoptDisk();a!=null&&R(a)},q=()=>{c.overwrite(n.current)},O=se(c.status),L=o?x:u;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsxs("div",{className:"sticky top-0 z-10 flex h-0 items-start justify-end gap-2 pr-2",children:[v&&O&&t.jsx("span",{className:Y("mt-3 text-xs",c.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:O}),!o&&t.jsx(C,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:Q,"aria-label":"Refresh from disk",children:t.jsx(W,{className:"size-4"})}),v&&t.jsx(C,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:o?()=>void M():D,"aria-label":o?"Finish editing":"Edit file",children:o?t.jsx(G,{className:"size-4"}):t.jsx(I,{className:"size-4"})})]}),c.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(C,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:B,children:"Reload"}),t.jsx(C,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:q,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(r.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:T?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(Z,{value:L,editable:o,onChange:o?z:void 0})}):t.jsx(X,{value:L,editable:o,filename:e.sourcePath,languageHint:e.language,theme:b,onChange:o?z:void 0})})})]})}function S({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{ye as CanvasFileContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a8 as A,aa as E,ab as k,fw as I,fx as $,_ as z,z as j,G as o,D as P,fy as R,J as q,r as p,j as t,I as y,B as v,Q as w,fz as W,e as F,Y as U,Z as X,C as K,a0 as Q,f as B,ae as H}from"./index-CMaIfS_G.js";function Z(){const e=A(),s=E();return k({mutationFn:({agentId:n,body:a})=>e.createCommitment(n,a),onSettled:()=>s.invalidateQueries({queryKey:I.all})})}function G(){const e=A(),s=E();return k({mutationFn:({id:n,body:a})=>e.updateCommitment(n,a),onSettled:()=>s.invalidateQueries({queryKey:I.all})})}$();const _=300,J=500,Y=200,D="external:",T=z(["open","kept","missed","dropped"]).openapi("CommitmentState"),O=j({id:o(),agentId:o(),to:o().nullable(),what:o(),dueAt:o().nullable(),state:T,overdue:P(),sourceSessionId:o().nullable(),sourceRoomEntryId:o().nullable(),createdAt:o(),closedAt:o().nullable(),note:o().nullable()}).openapi("Commitment"),L=o().datetime({offset:!0});j({what:o().trim().min(1).max(_),to:o().trim().min(1).max(Y).optional(),dueAt:L.optional()}).openapi("CreateCommitmentRequest");j({state:T,dueAt:L.nullable().optional(),note:o().trim().max(J).optional(),from:T.optional()}).openapi("UpdateCommitmentRequest");const V=500;j({agentId:o().min(1).optional(),state:T.optional(),to:o().min(1).optional(),limit:R().int().min(1).max(V).optional()}).openapi("ListCommitmentsQuery");j({commitments:q(O)}).openapi("ListCommitmentsResponse");function ee(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",d=n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"});return n.toDateString()===s.toDateString()?`${a} ${d}`:Math.abs(n.getTime()-s.getTime())/864e5<6?`${a} ${n.toLocaleDateString(void 0,{weekday:"short"})} ${d}`:`${a} ${n.toLocaleDateString(void 0,{month:"short",day:"numeric"})}`}function te(e,s){return e?e.startsWith(D)?`To ${e.slice(D.length)}`:`To ${(s==null?void 0:s(e))??e}`:null}function se(e){return{open:e.filter(s=>s.state==="open"),closed:e.filter(s=>s.state!=="open")}}const ae={kept:"Kept",missed:"Missed",dropped:"Dropped"};function de(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 ne=6e4;function oe(){const e=new Date;return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function ie({agentId:e,onDone:s}){var m;const n=Z(),[a,d]=p.useState(""),[r,l]=p.useState(""),u=p.useId(),g=p.useId(),x=a.trim(),b=n.isError&&((m=n.error)==null?void 0:m.code)==="PAST_DUE",h=r?new Date(r).getTime():null,[c,S]=p.useState(!1),[N]=p.useState(oe);function i(C){if(C.preventDefault(),!x||c)return;const f=h!==null?new Date(h).toISOString():void 0;n.mutate({agentId:e,body:{what:x,...f?{dueAt:f}:{}}},{onSuccess:s})}return t.jsxs("form",{onSubmit:i,"data-slot":"add-commitment-form",className:"flex flex-col gap-2 rounded-md border p-3",children:[t.jsx("label",{htmlFor:u,className:"text-xs font-medium",children:"What was promised"}),t.jsx(y,{id:u,value:a,maxLength:_,onChange:C=>d(C.target.value),placeholder:"Send Acme the revised quote"}),t.jsx("label",{htmlFor:g,className:"text-xs font-medium",children:"Due (optional)"}),t.jsx(y,{id:g,type:"datetime-local",value:r,min:N,"aria-invalid":c||void 0,onChange:C=>{const f=C.target.value;l(f),S(f!==""&&new Date(f).getTime()<Date.now()-ne)}}),(c||b)&&t.jsx("p",{className:"text-destructive text-xs",children:"That time has passed."}),n.isError&&!b&&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||c||n.isPending,children:"Add commitment"})]})]})}function M({commitment:e,agentName:s,nameOf:n,onClose:a,busy:d}){const r=e.state==="open",l=[s,te(e.to,n)].filter(Boolean).join(" · "),u=r?ee(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:w("text-sm break-words",!r&&"text-muted-foreground",e.state==="dropped"&&"line-through"),children:e.what}),(l||u||!r)&&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:ae[e.state]}),l&&t.jsx("span",{className:"min-w-0 truncate",children:l}),u&&t.jsx("span",{className:w(e.overdue&&"text-destructive font-medium"),children:u})]})]}),r&&a&&t.jsxs("div",{className:"flex shrink-0 gap-1",children:[t.jsx(v,{size:"xs",variant:"outline",disabled:d,onClick:()=>a("kept"),"aria-label":`Mark kept: ${e.what}`,children:"Mark kept"}),t.jsx(v,{size:"xs",variant:"ghost",disabled:d,onClick:()=>a("dropped"),"aria-label":`Drop: ${e.what}`,children:"Drop"})]})]})}const re={kept:"Marked kept",dropped:"Commitment dropped"};function ue({agentId:e,nameOf:s,canAdd:n=!1,readOnly:a=!1,canChange:d}){var N;const r=W(e?{agentId:e}:{}),l=G(),[u,g]=p.useState(!1),x=e===void 0;function b(i,m){l.mutate({id:i.id,body:{state:m}},{onSuccess:()=>H.success(re[m],{action:{label:"Undo",onClick:()=>l.mutate({id:i.id,body:{state:"open",from:m}})}})})}if(r.isPending)return t.jsx(F,{className:"h-16 w-full"});if(r.isError)return t.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read commitments."});const{open:h,closed:c}=se(r.data),S=l.isPending?(N=l.variables)==null?void 0:N.id:void 0;return t.jsxs("div",{"data-slot":"commitment-list",className:"flex flex-col gap-2",children:[h.length===0&&c.length===0&&!u&&t.jsx("p",{className:"text-muted-foreground text-sm",children:"No commitments yet."}),h.length>0&&t.jsx("ul",{className:"flex flex-col","aria-label":"Open commitments",children:h.map(i=>t.jsx(M,{commitment:i,agentName:x?s==null?void 0:s(i.agentId):void 0,nameOf:s,busy:S===i.id,...a||d&&!d(i)?{}:{onClose:m=>b(i,m)}},i.id))}),l.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t change that commitment. Try again."}),c.length>0&&t.jsxs(U,{children:[t.jsxs(X,{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(K,{"aria-hidden":!0,className:"size-3.5 transition-transform group-data-[state=open]:rotate-90"}),"Closed (",c.length,")"]}),t.jsx(Q,{children:t.jsx("ul",{className:"flex flex-col","aria-label":"Closed commitments",children:c.map(i=>t.jsx(M,{commitment:i,agentName:x?s==null?void 0:s(i.agentId):void 0,nameOf:s},i.id))})})]}),n&&!a&&e&&u&&t.jsx(ie,{agentId:e,onDone:()=>g(!1)}),n&&!a&&e&&!u&&t.jsxs(v,{size:"sm",variant:"ghost",className:"self-start",onClick:()=>g(!0),children:[t.jsx(B,{"aria-hidden":!0}),"Add commitment"]})]})}export{ue as C,de as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,e as x,B as o,a3 as m,a4 as u,a5 as h,a6 as g}from"./index-CMaIfS_G.js";import{u as p,s as l,a as j,b as f}from"./access-copy-BLfnVgF5.js";import{Q as N}from"./query-error-state-CPMymRkX.js";const v={agent:"From the agent",this_chat:"Only in this chat"};function k({agentId:n,onManage:e}){var i;const a=p(n);if(a.isPending)return s.jsx(x,{className:"h-24 w-full rounded-lg"});if(a.isError)return s.jsx(N,{title:"Couldn’t load account access",description:"Nothing changed. Try again.",onRetry:()=>void a.refetch(),isRetrying:a.isFetching});const c=((i=a.data)==null?void 0:i.connections)??[];return s.jsxs("section",{"aria-labelledby":"agent-account-access",className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h3",{id:"agent-account-access",className:"text-sm font-semibold",children:"Account access"}),s.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Accounts this agent can use."})]}),e&&s.jsxs(o,{variant:"ghost",size:"sm",onClick:e,children:["Manage",s.jsx(m,{className:"size-3.5","aria-hidden":!0})]})]}),c.length===0?s.jsxs("div",{className:"bg-muted/40 rounded-lg p-4 text-sm",children:[s.jsx("p",{className:"font-medium",children:"No account access"}),s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Give access from the Connections page."})]}):s.jsx("ul",{className:"space-y-1.5",children:c.map(t=>{const r=t.readiness.state==="ready";return s.jsxs("li",{"data-testid":`agent-connection-${t.connectionId}`,className:"bg-muted/40 flex min-h-11 items-center gap-3 rounded-lg px-3 py-2",children:[s.jsx(u,{iconKey:t.toolkit,displayName:l(t.toolkit),className:"size-7"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"truncate text-sm font-medium",children:[l(t.toolkit)," (",t.label,")"]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.operationRevisionIds.length," approved"," ",t.operationRevisionIds.length===1?"action":"actions",t.everyAgent&&" · given to every agent"]})]}),s.jsx(h,{size:"xs",variant:r?"secondary":"outline",title:r?void 0:t.readiness.copy.owner,children:r?"Available":"Unavailable"})]},t.connectionId)})})]})}const y="This only affects this chat. Turning an app back on never adds access.",C="Couldn’t change access for this chat. Try again.";function b(n){return(n==null?void 0:n.code)==="session_access_other_agent"?n.message:C}function T({sessionId:n,onManage:e,emptyAction:a,footer:c}){var r;const i=j(n);if(i.isPending)return s.jsx(x,{className:"h-16 w-full rounded-lg"});if(i.isError)return s.jsxs("section",{"data-testid":"session-connectors",className:"space-y-2",children:[s.jsx("p",{role:"alert",className:"text-destructive px-1 text-xs",children:"Couldn’t load account access."}),s.jsx(o,{variant:"ghost",size:"sm",onClick:()=>void i.refetch(),children:"Try again"})]});const t=((r=i.data)==null?void 0:r.connections)??[];return s.jsxs("section",{"data-testid":"session-connectors","aria-labelledby":"session-account-access",className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[s.jsx("h3",{id:"session-account-access",className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:"Connections"}),e&&s.jsxs(o,{variant:"ghost",size:"xs",onClick:e,children:["Manage agent access",s.jsx(m,{className:"size-3","aria-hidden":!0})]})]}),t.length===0?s.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md px-2.5 py-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"No account access"}),s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Ask this agent to request the access it needs."})]}),a]}):s.jsxs(s.Fragment,{children:[t.some(d=>d.thisChat)&&s.jsx("p",{className:"text-muted-foreground px-1 pb-1 text-xs",children:y}),t.map(d=>s.jsx(S,{sessionId:n,connection:d},d.connectionId))]}),t.length>0&&c]})}function S({sessionId:n,connection:e}){const a=f(n),c=e.readiness.state==="ready",i=`${l(e.toolkit)} (${e.label})`;return s.jsxs("div",{"data-testid":`session-connection-${e.connectionId}`,"data-reason":e.readiness.reason,className:"bg-muted/40 rounded-md px-2.5 py-2",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx("span",{className:"text-sm font-medium",children:i}),s.jsx(h,{size:"xs",variant:c?"secondary":"outline",children:c?v[e.source]:"Not available"})]}),s.jsx("p",{className:c?"text-muted-foreground mt-1 text-xs":"text-status-warning-fg mt-1 text-xs",children:c?`${e.operationRevisionIds.length} ${e.operationRevisionIds.length===1?"action":"actions"} available in this chat.`:e.readiness.copy.owner})]}),e.thisChat&&s.jsx(g,{"aria-label":`${i} in this chat`,"data-testid":`session-connection-switch-${e.connectionId}`,checked:e.thisChat==="on",disabled:a.isPending,onCheckedChange:t=>a.mutate({connectionId:e.connectionId,on:t}),className:"mt-0.5 shrink-0"})]}),a.isError&&e.thisChat&&s.jsx("p",{role:"alert",className:"text-destructive mt-1 text-xs",children:b(a.error)})]})}export{k as A,T as S};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{r as d,j as n,bm as D,bn as F,c$ as Y,d0 as B,a6 as G,Q as h,Y as H,Z as U,C as W,a0 as X,d1 as z,U as T,d2 as j,d3 as V,d4 as K,d5 as N,d6 as Z,d7 as Q,d8 as q,d9 as J,da as ee,db as te,b as ne,dc as se,e as ae,B as S,ae as oe}from"./index-CMaIfS_G.js";import{M as re}from"./more-details-CwkthrCT.js";import"./relay-trace-schemas-CfXA97kO.js";import"./agent-browser-BkFCE19g.js";import{d as ie,A as le}from"./untrusted-text-pHjcUwfI.js";import{s as A}from"./soul-file-BDthDhZW.js";import"./form-CwnBnnFI.js";function ce({title:e,content:t,enabled:s,maxChars:o,charCount:i,disclaimer:a,onChange:x,onBlur:b,onToggle:u,fill:r=!1}){const l=d.useCallback(g=>{x(g.target.value)},[x]);return n.jsx(D,{className:h(!s&&"opacity-60",r&&"flex min-h-0 flex-1 flex-col"),children:n.jsxs(F,{className:h(r&&"flex min-h-0 flex-1 flex-col"),children:[n.jsxs(Y,{orientation:"horizontal",className:"items-center justify-between",children:[n.jsx(B,{className:"text-sm font-medium",children:e}),u&&n.jsx(G,{checked:s,onCheckedChange:u,"aria-label":`Toggle ${e}`})]}),a&&n.jsx("p",{className:"text-muted-foreground text-xs italic",children:a}),n.jsxs("div",{className:h("space-y-2",r&&"flex min-h-0 flex-1 flex-col"),children:[n.jsx("textarea",{value:t,onChange:l,onBlur:b,rows:r?void 0:8,maxLength:o,className:h("border-border bg-background text-foreground placeholder:text-muted-foreground focus-visible:ring-ring w-full resize-none rounded-md border px-3 py-2 font-mono text-sm focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",r&&"min-h-40 flex-1"),placeholder:s?"Write markdown here…":"Turn this on to use it"}),n.jsxs("p",{className:"text-muted-foreground text-right text-xs",children:[i??t.length," / ",o.toLocaleString()]})]})]})})}const w="[new code each turn]",de=[...new Set([...Object.values(q),...le,"system-reminder"])];function ue(e){const t=e.length>j,s=t?e.slice(0,j):e,o=ie(s,de);return["<agent_memory>",V,K,`--- BEGIN ${N} ${w} ---`,Z,...t?[Q]:[],o,`--- END ${N} ${w} ---`,"</agent_memory>"].join(`
|
|
2
|
-
`)}function me(e){var o;const s=[`<agent_identity>
|
|
3
|
-
${[`Name: ${e.name}`,`ID: ${e.id}`,e.description?`Description: ${e.description}`:null,(o=e.capabilities)!=null&&o.length?`Capabilities: ${e.capabilities.join(", ")}`:null].filter(i=>i!==null).join(`
|
|
4
|
-
`)}
|
|
5
|
-
</agent_identity>`];if(e.conventions.soul){const i=e.soulContent.includes(z)?A(e.traits,T(e.soulContent)):e.soulContent;i.trim()&&s.push(`<agent_persona>
|
|
6
|
-
${i}
|
|
7
|
-
</agent_persona>`)}return e.conventions.nope&&e.nopeContent.trim()&&s.push(`<agent_safety_boundaries>
|
|
8
|
-
${e.nopeContent}
|
|
9
|
-
</agent_safety_boundaries>`),e.conventions.memory&&e.memoryContent.trim()&&s.push(ue(e.memoryContent)),s.join(`
|
|
10
|
-
|
|
11
|
-
`)}function he(e){const[t,s]=d.useState(!1),o=d.useMemo(()=>me(e),[e]);return n.jsxs(H,{open:t,onOpenChange:s,"data-slot":"profile-injection-preview",children:[n.jsxs(U,{className:"focus-ring text-muted-foreground hover:text-foreground flex items-center gap-1 rounded-md py-1 text-xs transition-colors",children:[n.jsx(W,{"aria-hidden":!0,className:h("size-3.5 transition-transform",t&&"rotate-90")}),"Preview what ",e.displayName," will see"]}),n.jsx(X,{children:n.jsx("pre",{"data-testid":"injected-prompt","data-slot":"profile-injection-preview-text",className:"bg-muted text-muted-foreground mt-1 max-h-56 overflow-auto rounded-md p-3 text-xs whitespace-pre-wrap",children:n.jsx("code",{children:o})})})]})}const xe="These guide your agent but aren’t enforced. Treat them as strong instructions.",ge="Anything here can come up in any chat. Never keep secrets, passwords or keys here.",fe="Your agent writes notes here as it works.",Ce=["Each note says where it was written.","Deleting a line makes your agent forget it."];function M(e,t){return A(e.traits,t)}const y={instructions:{title:"Custom instructions (SOUL.md)",errorLabel:"Couldn’t save your instructions",key:"soul",maxChars:te,read:e=>T(e.soulContent??""),write:(e,t)=>({soulContent:M(e,t)}),count:(e,t)=>M(e,t).length},boundaries:{title:"Safety boundaries (NOPE.md)",errorLabel:"Couldn’t save your boundaries",key:"nope",maxChars:J,disclaimer:xe,read:e=>e.nopeContent??"",write:(e,t)=>({nopeContent:t}),count:(e,t)=>t.length},memory:{title:"Agent memory (MEMORY.md)",errorLabel:"Couldn’t save your agent’s memory",key:"memory",maxChars:j,disclaimer:ge,note:fe,details:Ce,read:e=>e.memoryContent??"",write:(e,t)=>({memoryContent:t}),count:(e,t)=>t.length},heartbeat:{title:"What it watches (HEARTBEAT.md)",errorLabel:"Couldn’t save the heartbeat file",maxChars:ee,note:"Changes apply at the next check.",read:e=>e.heartbeatContent??"",write:(e,t)=>({heartbeatContent:t}),count:(e,t)=>t.length}};function ye(e){const t=Math.max(0,Date.now()-e),s=Math.floor(t/6e4);return s<1?"Saved just now":s<60?`Saved ${s}m ago`:`Saved ${Math.floor(s/60)}h ago`}function Ee(e,t,s,o){if(e>0){const i=t>0?`. The personality block takes ${t.toLocaleString()} of them`:"";return`Too long by ${e.toLocaleString()} character${e===1?"":"s"}${i}`}return s?"Unsaved changes":o!==null?ye(o):""}function E({member:e,file:t,fill:s=!0,onSaved:o,onCancel:i}){const{agent:a,isPending:x,isSaving:b,update:u}=ne(e,{errorLabel:t.errorLabel}),r=a?t.read(a):"",[l,g]=d.useState(r),[R,v]=d.useState(r),[k,L]=d.useState(r),[O,$]=d.useState(null),f=l!==R;if(k!==r&&(L(r),f||(g(r),v(r))),se(f),x)return n.jsx(ae,{className:"h-40 w-full"});if(!a)return n.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this file."});const p=a.conventions??{soul:!0,nope:!0,memory:!0,dorkosKnowledge:!0},_=t.count(a,l),m=t.key,C=_-t.maxChars,I=_-l.length;function P(){if(!a||C>0)return;const c=l;u(t.write(a,c),()=>{v(c),$(Date.now()),oe.success("Saved"),o==null||o()})}return n.jsxs("div",{className:s?"flex min-h-0 flex-1 flex-col gap-2":"flex flex-col gap-2","data-slot":"profile-convention",children:[n.jsx(ce,{fill:s,title:t.title,content:l,enabled:m?p[m]:!0,maxChars:t.maxChars,charCount:_,disclaimer:t.disclaimer,onChange:g,...m?{onToggle:c=>u({conventions:{...p,[m]:c}})}:{}}),t.note&&n.jsx("p",{className:"text-muted-foreground shrink-0 text-xs",children:t.note}),t.details&&n.jsx(re,{className:"shrink-0",children:t.details.map(c=>n.jsx("p",{children:c},c))}),n.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[n.jsx("span",{"data-slot":"profile-convention-status",className:C>0?"text-destructive text-xs":"text-muted-foreground text-xs",children:Ee(C,I,f,O)}),i&&n.jsx(S,{size:"sm",variant:"ghost",className:"ml-auto",onClick:i,children:"Cancel"}),n.jsx(S,{size:"sm",className:i?void 0:"ml-auto",disabled:!f||C>0||b,onClick:P,children:"Save"})]}),m&&n.jsx("div",{className:"shrink-0",children:n.jsx(he,{name:a.name,displayName:a.displayName||a.name,id:a.id,description:a.description,capabilities:a.capabilities,traits:a.traits,conventions:p,soulContent:a.soulContent??"",nopeContent:a.nopeContent??"",memoryContent:a.memoryContent??"",...t.write(a,l)})})]})}function we(e){return n.jsx(E,{...e,file:y.instructions})}function Me(e){return n.jsx(E,{...e,file:y.boundaries})}function Te(e){return n.jsx(E,{...e,file:y.memory})}function Ae(e){return n.jsx(E,{...e,file:y.heartbeat,fill:!1})}export{Me as BoundariesPage,Ae as HeartbeatFileEditor,we as InstructionsPage,Te as MemoryPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-CMaIfS_G.js";import{a as t}from"./ProfileFields-xAsiq8Mz.js";import"./profile-errors-C-4JXW0u.js";import"./use-mounted-ref-B5J2da-A.js";function n({member:r}){return o.jsx(t,{member:r})}export{n as HandlePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a8 as T,aa as w,ab as B,gM as v,gN as $,h as O,j as s,gO as A,be as E,gP as P,a5 as R,B as h,s as W,ag as M,gQ as D,gR as H,d as L,r as x,gS as F,e as S,gT as I,gU as q,b as U,gV as Q}from"./index-CMaIfS_G.js";import{M as C}from"./more-details-CwkthrCT.js";import{HeartbeatFileEditor as z}from"./ConventionPage-Cc1bx5BQ.js";import"./relay-trace-schemas-CfXA97kO.js";import"./form-CwnBnnFI.js";import"./agent-browser-BkFCE19g.js";import"./untrusted-text-pHjcUwfI.js";import"./soul-file-BDthDhZW.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 V(e){return Number.isNaN(e.getTime())?null:e.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function J({beat:e,onOpenChat:t}){const a=A[e.outcome],n=V(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:P[e.kind]}),s.jsx(R,{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(h,{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(W({session:r})):void 0;return s.jsx(J,{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 ${M(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(h,{size:"sm",disabled:e.isPending,onClick:()=>e.mutate(!0),children:"Use credits"}),s.jsx(h,{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=D(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"?I(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:q(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:Q(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]=x.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(h,{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(z,{member:t,roster:a,onPush:n,...m?{onCancel:()=>c(!1)}:{},onSaved:()=>void l.invalidateQueries({queryKey:v.agent(d)})})]})}function be(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=x.useMemo(()=>$(a,t),[a,t]),j=x.useMemo(()=>G(a,t),[a,t]),c=F(3e4),[d,m]=x.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{be as HeartbeatPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-CMaIfS_G.js";import{P as m}from"./ProfileFields-xAsiq8Mz.js";import"./profile-errors-C-4JXW0u.js";import"./use-mounted-ref-B5J2da-A.js";function a({member:r}){return o.jsx(m,{member:r})}export{a as NamePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a8 as b,aa as R,ab as j,bs as x,ae as P,eh as C,r as d,j as e,cG as E,cH as M,cJ as k,cK as K,cL as T,dD as L,e3 as I,I as F,aK as N,B as D,bG as H,bH as O,ei as B,f as G,bI as Q,bK as _,ej as q}from"./index-CMaIfS_G.js";function w(t){return Promise.all([t.invalidateQueries({queryKey:x.lists()}),t.invalidateQueries({queryKey:x.details()}),t.invalidateQueries({queryKey:x.threads()})]).then(()=>{})}function S(t){return(t==null?void 0:t.code)==="SLUG_TAKEN"}function Y({isInlineErrorVisible:t}){const n=b(),r=R();return j({mutationFn:({title:a,agentPaths:l})=>n.createRoom({kind:"channel",title:a,members:[],agentPaths:l}),onSuccess:()=>w(r),meta:{suppressErrorToast:!0},onError:a=>{S(a)&&t()||P.error("Couldn’t create that channel.",{description:a.message})}})}function U(){const t=b(),n=R();return j({mutationFn:({agentPaths:r,title:a})=>t.createRoom({kind:"dm",title:a,members:[],agentPaths:r}),onSettled:()=>w(n),meta:{errorLabel:"Couldn’t start that DM"}})}const y=200;function W({open:t,onOpenChange:n,onCreated:r}){const a=C(),[l,m]=d.useState(""),h=d.useRef(null),c=d.useRef(null),u=d.useRef(!0);d.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const o=Y({isInlineErrorVisible:()=>u.current}),g=S(o.error)?o.error.message:null,f=l.trim(),p=f.length>0&&f.length<=y,v=s=>{!p||o.isPending||o.mutate({title:f,agentPaths:s.map(i=>i.agentPath)},{onSuccess:i=>{n(!1),r(i)}})},A=s=>{var i;s.key==="Enter"&&(s.preventDefault(),p&&((i=c.current)==null||i.focus()))};return e.jsx(E,{open:t,onOpenChange:n,children:e.jsxs(M,{className:"sm:max-w-md",onOpenAutoFocus:s=>{var i;s.preventDefault(),(i=h.current)==null||i.focus()},children:[e.jsxs(k,{children:[e.jsx(K,{children:"New channel"}),e.jsx(T,{children:"Name it, then pick who’s in it."})]}),e.jsxs(L,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{htmlFor:"channel-name",children:"Channel name"}),e.jsx(F,{ref:h,id:"channel-name",value:l,maxLength:y,placeholder:"Backend",autoComplete:"off",onChange:s=>{m(s.target.value),o.error&&o.reset()},onKeyDown:A,"aria-invalid":g?!0:void 0,"aria-describedby":g?"channel-name-error":void 0}),g&&e.jsx("p",{id:"channel-name-error",role:"alert",className:"text-destructive text-xs",children:g})]}),e.jsxs("section",{"aria-label":"Agents in this channel",className:"space-y-2 border-t pt-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Who’s in it"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Agents read everything here and reply when @mentioned."}),e.jsx(N,{roster:a,onSubmit:v,submitLabel:s=>s.length===0?"Create channel":s.length===1?"Create channel with 1 agent":`Create channel with ${s.length} agents`,emptyRosterMessage:"You don’t have any agents yet. You can add them to the channel later.",allChosenMessage:"That’s every agent you have.",isSubmitting:o.isPending,submitDisabled:!p,inputRef:c})]}),e.jsx("div",{className:"flex justify-center border-t pt-3",children:e.jsx(D,{type:"button",variant:"ghost",size:"sm",disabled:!p||o.isPending,onClick:()=>v([]),children:"Create it without agents"})})]})]})})}const z="One agent opens a chat. Two or more start a group message.";function V(t){return t.length===1}function $(t){const n=t[0];return n!==void 0&&V(t)?`Open chat with ${n.displayName}`:"Start group message"}function X({onStart:t,open:n,onOpenChange:r,hideTrigger:a=!1}){const l=C(),m=d.useRef(null),h=()=>{r(!1),q.getState().open()};return e.jsxs(H,{open:n,onOpenChange:r,modal:!0,fullHeight:!0,children:[e.jsx(O,{asChild:!0,children:e.jsx(B,{...a?{"aria-hidden":!0,tabIndex:-1,className:"sr-only"}:{"aria-label":"New message"},children:e.jsx(G,{})})}),e.jsxs(Q,{side:"right",align:"start",className:"flex w-64 flex-col p-2","aria-label":"New message",onOpenAutoFocus:c=>{var u;c.preventDefault(),(u=m.current)==null||u.focus()},children:[e.jsx(_,{children:"New message"}),e.jsx(N,{inputRef:m,roster:l,onSubmit:c=>{r(!1),t(c)},submitLabel:$,emptyRosterMessage:"You don’t have any agents yet.",emptyRosterAction:e.jsx(D,{type:"button",size:"sm",variant:"outline",onClick:h,children:"Create agent"}),allChosenMessage:"Everyone is already here."}),e.jsx("p",{className:"text-muted-foreground mt-2 shrink-0 px-2 text-xs",children:z})]})]})}export{W as C,X as N,z as O,V as a,$ as o,U as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-CMaIfS_G.js";import{b as t}from"./ProfileFields-xAsiq8Mz.js";import"./profile-errors-C-4JXW0u.js";import"./use-mounted-ref-B5J2da-A.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ay as Be,a8 as b,aa as K,r as x,ab as R,iU as F,iV as T,a9 as z,j as e,hc as Ee,e5 as Qe,e6 as G,Y as we,Z as Re,a0 as Ie,B as C,h9 as Ye,Q as V,dA as We,dT as Ge,iW as Ve,iX as He,dF as Le,W as te,x as de,bF as Ze,R as ue,dE as me,e3 as S,e4 as ne,aA as Je,iY as Xe,I as _,iZ as es,i_ as Ae,i$ as ss,a5 as De,fs as ts,dY as ns,dZ as rs,d_ as as,d$ as is,e0 as be,hn as os,C as ls,j0 as cs,j1 as ds,j2 as us,$ as ms}from"./index-CMaIfS_G.js";import{I as xs}from"./inline-code-BDPvCbUE.js";import{u as hs}from"./useMutationState-CtolUzjw.js";import{O as ps,a as W}from"./runtime-connect-Dn0T5YWv.js";import{T as fs}from"./terminal-CqyyqODz.js";function gs(){var s;return((s=Be().data)==null?void 0:s.isLocalCaller)!==!1}function St(s){var u,d;const t=b(),n=K(),[i,a]=x.useState(null),r=R({mutationFn:()=>(a(null),t.provisionRuntime(s,m=>a(m))),onSuccess:m=>{m.ok&&(n.invalidateQueries({queryKey:[...F]}),n.invalidateQueries({queryKey:[...T]}))}}),l=r.isError||((u=r.data)==null?void 0:u.ok)===!1,o=r.isError?r.error.message:((d=r.data)==null?void 0:d.error)??null,c=(o==null?void 0:o.trim().toLowerCase())==="not found"?"One-click install isn’t available here.":o;return{provision:()=>r.mutate(),isPending:r.isPending,isError:l,errorMessage:l?c??"Couldn’t install. Try again.":null,progress:i,result:r.data}}function Ke(s){return["runtime-key-status",s]}function ys(s,t=!0){const n=b();return z({queryKey:Ke(s),queryFn:()=>n.getRuntimeKeyStatus(s),enabled:t,staleTime:3e4})}function js(s){const t=b(),n=R({mutationFn:a=>t.checkRuntimeCredential(s,a.trim().length>0?a:null),meta:{suppressErrorToast:!0}}),i=n.data??(n.isError?{ok:!1,reason:"unexpected",message:n.error.message||"Couldn’t check the key."}:null);return{check:a=>n.mutate(a),isPending:n.isPending,result:i,checkedSavedKey:i!==null&&(n.variables??"").trim().length===0,reset:n.reset}}function vs(s){var o,c,u;const t=b(),n=K(),[i,a]=x.useState(null),r=R({mutationFn:async d=>{a("checking");const m=await t.checkRuntimeCredential(s,d);return m.ok?(a("saving"),await t.storeRuntimeCredential(s,d),{saved:!0,message:null}):{saved:!1,message:m.message}},onSettled:()=>a(null),meta:{suppressErrorToast:!0},onSuccess:d=>{d.saved&&(n.invalidateQueries({queryKey:[...F]}),n.invalidateQueries({queryKey:[...T]}),n.invalidateQueries({queryKey:[...Ke(s)]}))}}),l=((o=r.data)==null?void 0:o.saved)===!1;return{store:d=>{d.trim().length!==0&&r.mutate(d)},isPending:r.isPending,phase:i,isSuccess:((c=r.data)==null?void 0:c.saved)===!0,isError:r.isError||l,errorMessage:l?((u=r.data)==null?void 0:u.message)??null:r.isError?r.error.message??"Couldn’t save the API key.":null,reset:r.reset}}const Se=new WeakMap;function ks(s){const t=Se.get(s);if(t)return t;const n=new Set;return Se.set(s,n),n}function Ns(s,t){var M,I,w,P;const n=b(),i=K(),{sessionId:a,accountRoot:r,onCompleted:l}=t??{},o=x.useMemo(()=>["runtime-login",s,a??"",r??""],[s,a,r]),c=R({mutationKey:o,mutationFn:()=>n.delegateRuntimeLogin(s,a===void 0&&r===void 0?void 0:{sessionId:a,accountRoot:r}),onSuccess:N=>{N.ok&&(i.invalidateQueries({queryKey:[...F]}),i.invalidateQueries({queryKey:[...T]}))}}),u=hs({filters:{mutationKey:o,exact:!0},select:N=>({id:N.mutationId,state:N.state})}),d=u.some(N=>N.state.status==="pending"),m=u[u.length-1],h=d||m==null?void 0:m.state,g=d||m==null?void 0:m.id,f=!d&&((h==null?void 0:h.status)==="error"||((M=h==null?void 0:h.data)==null?void 0:M.ok)===!1),j=(h==null?void 0:h.status)==="error"?((I=h.error)==null?void 0:I.message)??null:((w=h==null?void 0:h.data)==null?void 0:w.error)??null,v=((P=h==null?void 0:h.data)==null?void 0:P.ok)===!0,O=x.useRef(l);return O.current=l,x.useEffect(()=>{var L;if(!v||g===void 0)return;const N=ks(i);N.has(g)||(N.add(g),(L=O.current)==null||L.call(O))},[v,g,i]),{login:()=>{d||c.mutate()},isPending:d,isSuccess:v,isError:f,errorMessage:f?j??"Couldn’t sign in. Try again.":null}}const Ce={"claude-code":{signInLabel:"Sign in",otherWayLabel:"Sign in with Claude",signInHint:"Use your Claude subscription or Anthropic account.",signInPending:"Waiting for sign-in to complete…",keyLabel:"Anthropic API key",keyPlaceholder:"sk-ant-…",getKeyUrl:"https://console.anthropic.com/settings/keys"},codex:{signInLabel:"Sign in with ChatGPT",otherWayLabel:"Sign in with ChatGPT",signInHint:"Use your ChatGPT account.",signInPending:"Waiting for sign-in to complete…",keyLabel:"OpenAI API key",keyPlaceholder:"sk-…",getKeyUrl:"https://platform.openai.com/api-keys"}};function bs(s){return Ce[s]??Ce["claude-code"]}function Ss({command:s,infoUrl:t,copyLabel:n}){return!s&&!t?null:e.jsxs("div",{className:"space-y-2",children:[s&&e.jsxs("div",{className:"bg-muted flex items-center justify-between gap-2 rounded-lg px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[e.jsx(fs,{className:"text-muted-foreground size-3.5 shrink-0"}),e.jsx("code",{className:"truncate text-xs",children:s})]}),e.jsx(Ee,{value:s,label:n??"Copy install command",className:"shrink-0"})]}),t&&e.jsxs(Qe,{href:t,className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:["Learn more ",e.jsx(G,{className:"size-3"})]})]})}function Ct({command:s,runtimeLabel:t}){const[n,i]=x.useState(!1);return e.jsxs(we,{open:n,onOpenChange:i,className:"mt-2",children:[e.jsxs("p",{className:"text-muted-foreground text-xs",children:["DorkOS installs ",t," for you."," ",e.jsx(Re,{className:"hover:text-foreground underline decoration-dotted underline-offset-2 transition-colors",children:n?"Hide command":"What runs?"})]}),e.jsxs(Ie,{className:"mt-1.5 flex items-center gap-1.5",children:[e.jsx(xs,{children:s}),e.jsx(Ee,{value:s,label:`Copy command: ${s}`,className:"shrink-0"})]})]})}function Oe({onRetry:s}){return e.jsxs("div",{"data-testid":"remote-signin-notice",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Signing in needs the computer DorkOS runs on."}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:s?"Sign in to DorkOS there, then press Retry.":"Sign in to DorkOS there."}),e.jsx("p",{className:"text-muted-foreground/80 mt-2 text-xs",children:"Already on that computer? Open DorkOS at localhost instead."}),s&&e.jsxs(C,{variant:"outline",size:"sm",onClick:s,className:"mt-3 gap-1.5",children:[e.jsx(Ye,{className:"size-3"}),"Retry"]})]})}function Cs({ollama:s=!1,remote:t=!1,className:n}){return e.jsxs("p",{className:V("text-muted-foreground text-xs",n),"data-testid":"keep-it-local-note",children:[t?"Prefer everything on the computer DorkOS runs on? Use your own sign-in there":"Prefer to keep everything on this computer? Use your own sign-in",s?", or Ollama":"","."]})}function Os(s){const t=We(),{data:n}=Ge();return s?Ve(He(t.data,s),n,s):"none"}const xe="OpenCode is connected",he="This chat uses OpenCode. Change models from the model menu.",Ps={title:xe,body:`Frontier models are unlocked. ${he}`},Es={title:xe,body:he},Pe={title:xe,body:`Your local models are ready. ${he}`};function Te(s){return{title:`${s} is connected`,body:`This chat uses ${s}. Change models from the model menu.`}}function ws(s){return{title:`${s} is ready`,body:`New work on ${s} runs on your DorkOS credits. Change it any time in Settings › Runtimes.`}}function A({message:s}){const t=Le();return e.jsxs(te.div,{role:"status",className:"bg-muted flex items-center gap-2 rounded-lg px-3 py-2.5",initial:t?!1:{opacity:0},animate:{opacity:1},"data-testid":"connect-progress",children:[e.jsx(de,{size:"xs",className:V("text-muted-foreground shrink-0",t&&"animate-none")}),e.jsx(Ze,{mode:"wait",children:e.jsx(te.span,{className:"truncate text-xs",initial:t?!1:{opacity:0},animate:{opacity:1},exit:t?void 0:{opacity:0},transition:{duration:.2},children:s},s)})]})}function U({message:s="Connected"}){return e.jsxs("div",{role:"status",className:"text-status-success-fg flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs","data-testid":"connect-connected",children:[e.jsx(ue,{className:"size-3.5"}),s]})}function B({message:s,onRetry:t}){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:s}),e.jsx(C,{size:"sm",onClick:t,children:"Try again"})]})}function Rs({type:s,onConnected:t,asOtherWay:n=!1}){const i=bs(s),a=Ns(s),[r,l]=x.useState(!1),o=x.useRef(!1);return x.useEffect(()=>{!a.isSuccess||o.current||(o.current=!0,t==null||t(Te(me(s).label)))},[a.isSuccess,t,s]),e.jsxs("div",{className:"space-y-4","data-testid":`login-connect-${s}`,children:[e.jsx("div",{className:"space-y-2",children:a.isPending?e.jsx(A,{message:i.signInPending}):a.isSuccess?e.jsx(U,{message:"Signed in"}):a.isError?e.jsx(B,{message:a.errorMessage??"Couldn’t sign in.",onRetry:a.login}):e.jsxs(e.Fragment,{children:[e.jsx(C,{size:"sm",variant:n?"outline":"default",className:"w-full",onClick:a.login,children:n?i.otherWayLabel:i.signInLabel}),e.jsx("p",{className:"text-muted-foreground text-xs",children:i.signInHint})]})}),r?e.jsxs("div",{className:"space-y-3","data-testid":`login-connect-key-${s}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"bg-border h-px flex-1"}),e.jsx("span",{className:"text-muted-foreground text-2xs tracking-wide uppercase",children:"or"}),e.jsx("span",{className:"bg-border h-px flex-1"})]}),e.jsx(Is,{type:s,copy:i,onConnected:t}),e.jsx("button",{type:"button",onClick:()=>l(!1),className:"text-muted-foreground hover:text-foreground text-xs underline decoration-dotted underline-offset-2 transition-colors",children:"Back to sign in"})]}):n?e.jsx(C,{size:"sm",variant:"outline",className:"w-full",onClick:()=>l(!0),"data-testid":`login-connect-use-key-${s}`,children:"Paste a key"}):e.jsx("button",{type:"button",onClick:()=>l(!0),className:"text-muted-foreground hover:text-foreground text-xs underline decoration-dotted underline-offset-2 transition-colors","data-testid":`login-connect-use-key-${s}`,children:"Use an API key instead"})]})}function Is({type:s,copy:t,onConnected:n}){var f,j;const[i,a]=x.useState(""),r=vs(s),l=ys(s),o=js(s),c=x.useRef(!1),u=x.useRef(null);if(x.useEffect(()=>{!r.isSuccess||c.current||(c.current=!0,n==null||n(Te(me(s).label)))},[r.isSuccess,n,s]),x.useEffect(()=>{var v;r.isError&&((v=u.current)==null||v.focus())},[r.isError]),r.isSuccess)return e.jsx(U,{});const d=(f=l.data)!=null&&f.key.saved?l.data.key:null,m=i.trim().length>0,h=r.isPending||o.isPending,g=()=>{o.reset(),r.reset()};return e.jsxs("form",{className:"space-y-2",onSubmit:v=>{v.preventDefault(),o.reset(),r.store(i)},children:[e.jsx(S,{htmlFor:`api-key-${s}`,className:"text-xs",children:t.keyLabel}),e.jsx(ne,{id:`api-key-${s}`,ref:u,value:i,disabled:h,onChange:v=>{a(v.target.value),g()},placeholder:d?`Saved key ends in ${d.last4}. Paste to replace.`:t.keyPlaceholder,autoComplete:"off",spellCheck:!1}),r.isError&&e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:r.errorMessage}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.getKeyUrl?e.jsxs("a",{href:t.getKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:["Get an API key ",e.jsx(G,{className:"size-3"})]}):e.jsx("span",{}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{type:"button",size:"sm",variant:"ghost",disabled:!m&&d===null||h,"data-testid":`api-key-test-${s}`,onClick:()=>{r.reset(),o.reset(),o.check(i)},children:"Test key"}),e.jsx(C,{type:"submit",size:"sm",variant:"outline",disabled:!m||h,children:"Save key"})]})]}),h?e.jsx(A,{message:r.phase==="saving"?"Saving…":"Checking your key…"}):((j=o.result)==null?void 0:j.ok)===!0?e.jsx(U,{message:o.checkedSavedKey?"Your saved key works":"Key works"}):o.result?e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:o.result.message}):null]})}function Ls(s){const t=b(),n=z({queryKey:["doe-inference"],queryFn:()=>t.getDoeInference()});return n.isPending?e.jsx(de,{"aria-label":"Loading model settings"}):n.isError?e.jsx("p",{role:"alert",children:"Couldn’t load model settings. Try again."}):e.jsx(As,{saved:n.data,...s},JSON.stringify(n.data))}function As({saved:s,onConnected:t,onSave:n}){var D,Z,Y,J,y,$,pe,fe,ge,ye,je,ve;const i=b(),a=K(),r=x.useId(),l=((D=s.inference)==null?void 0:D.source)??"api-key",[o,c]=x.useState(n&&l==="dorkos-credits"?"api-key":l),[u,d]=x.useState(((Z=s.inference)==null?void 0:Z.protocol)??"openai-chat-completions"),[m,h]=x.useState(((Y=s.inference)==null?void 0:Y.endpoint)??""),[g,f]=x.useState(((J=s.inference)==null?void 0:J.provider)??""),[j,v]=x.useState(((y=s.inference)==null?void 0:y.model)??""),[O,M]=x.useState(String((($=s.inference)==null?void 0:$.contextWindow)??8192)),[I,w]=x.useState(String(((pe=s.inference)==null?void 0:pe.maxOutputTokens)??1024)),[P,N]=x.useState(""),[L,E]=x.useState(null),k=z({queryKey:["doe-credits-models",u],queryFn:()=>i.getDoeCreditsModels(u),enabled:o==="dorkos-credits"}),q=o==="dorkos-credits"?(fe=k.data)==null?void 0:fe.models.find(p=>p.id===j):void 0,ee=s.hasKey&&((ge=s.inference)==null?void 0:ge.endpoint)===m&&s.inference.source==="api-key",H=R({mutationFn:async p=>{if(n)return n(p,P.trim()||null);o==="api-key"&&P.trim()?await i.storeDoeCredential(p,P.trim()):await i.setDoeInference(p),(await i.getCloudCredits()).linked&&await i.setCloudCreditsDefault("doe",o==="dorkos-credits")},onSuccess:()=>{N("");for(const p of[["doe-inference"],F,T,Je.all,Xe.status()])a.invalidateQueries({queryKey:p});t==null||t({title:"DorkOS model settings saved",body:"New chats use this source and model."})},onError:p=>E(n&&p instanceof Error&&p.message?p.message:"Couldn’t save model settings. Try again.")});function re(p){var ke,Ne;if(p.preventDefault(),E(null),P.trim().startsWith("sk-ant-oat")){E("Anthropic subscription tokens cannot run DorkOS agents. Use an API key.");return}if(o==="api-key"&&!P.trim()&&!ee){E("Enter an API key.");return}if(o==="dorkos-credits"&&(!q||!((ke=k.data)!=null&&ke.endpoint))){E("Link DorkOS credits and choose an available model.");return}const ae=es.safeParse({source:o,protocol:u,provider:o==="dorkos-credits"?"dorkos":g,endpoint:o==="dorkos-credits"?(Ne=k.data)==null?void 0:Ne.endpoint:m,model:j,contextWindow:(q==null?void 0:q.contextWindow)??Number(O),maxOutputTokens:(q==null?void 0:q.maxOutputTokens)??Number(I)});if(!ae.success){E("Check the model, endpoint, and token limits.");return}H.mutate(ae.data)}const Q="bg-background border-input focus-visible:ring-ring h-11 w-full rounded-md md:h-9 border px-3 text-sm focus-visible:ring-2";return e.jsxs("form",{onSubmit:re,className:"space-y-3","aria-label":"DorkOS model settings",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:`${r}-source`,children:"Runs on"}),e.jsxs("select",{id:`${r}-source`,className:Q,value:o,onChange:p=>{c(p.target.value),v("")},children:[e.jsx("option",{value:"api-key",children:"My API key"}),e.jsx("option",{value:"local",children:"Local model"}),!n&&e.jsx("option",{value:"dorkos-credits",children:"DorkOS credits"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:`${r}-protocol`,children:"Model protocol"}),e.jsxs("select",{id:`${r}-protocol`,className:Q,value:u,onChange:p=>{d(p.target.value),o==="dorkos-credits"&&v("")},children:[e.jsx("option",{value:"openai-chat-completions",children:"OpenAI Chat Completions"}),e.jsx("option",{value:"openai-responses",children:"OpenAI Responses"}),e.jsx("option",{value:"anthropic-messages",children:"Anthropic Messages"})]})]}),o==="dorkos-credits"?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:`${r}-model`,children:"Model"}),e.jsxs("select",{id:`${r}-model`,className:Q,value:j,onChange:p=>v(p.target.value),disabled:k.isPending||!((ye=k.data)!=null&&ye.endpoint),children:[e.jsx("option",{value:"",children:"Choose a model"}),(je=k.data)==null?void 0:je.models.map(p=>e.jsx("option",{value:p.id,children:p.displayName},p.id))]}),!((ve=k.data)!=null&&ve.endpoint)&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"Link DorkOS credits in Settings to choose a model."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:`${r}-service`,children:"Service name"}),e.jsx(_,{id:`${r}-service`,value:g,onChange:p=>f(p.target.value),required:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:`${r}-endpoint`,children:"Model endpoint"}),e.jsx(_,{id:`${r}-endpoint`,type:"url",value:m,onChange:p=>h(p.target.value),required:!0}),o==="local"&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"Use a loopback address. No API key is needed."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:`${r}-model`,children:"Model ID"}),e.jsx(_,{id:`${r}-model`,value:j,onChange:p=>v(p.target.value),required:!0})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:`${r}-context`,children:"Context tokens"}),e.jsx(_,{id:`${r}-context`,type:"number",min:1,value:O,onChange:p=>M(p.target.value),required:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:`${r}-output`,children:"Output tokens"}),e.jsx(_,{id:`${r}-output`,type:"number",min:1,value:I,onChange:p=>w(p.target.value),required:!0})]})]}),o==="api-key"&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:`${r}-key`,children:"API key"}),e.jsx(ne,{id:`${r}-key`,value:P,onChange:p=>N(p.target.value),autoComplete:"off"}),ee&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"API key saved. Leave blank to keep it."})]})]}),L&&e.jsx("p",{role:"alert",className:"text-destructive text-xs",children:L}),e.jsx(C,{type:"submit",disabled:H.isPending,children:H.isPending?"Saving…":n?"Save":"Save model settings"})]})}const Ds={openai:"OpenAI",anthropic:"Anthropic"};function Ks(s){return Ds[s]??s}function Ts(s){switch(s){case"ollama":return"On your computer (Ollama)";case"openrouter":return"Cloud via OpenRouter";default:return`Your own API key (${Ks(s)})`}}const Me="ollama",qe=["runtime-connect","ollama"];function Ms(s){const t=b();return z({queryKey:qe,queryFn:()=>t.detectOllama(),enabled:s,staleTime:3e4})}function qs(){const s=b(),t=K(),n=R({mutationFn:i=>s.updateConfig({runtimes:{opencode:{provider:Me}}}),onSuccess:()=>{t.invalidateQueries({queryKey:[...F]}),t.invalidateQueries({queryKey:[...T]})}});return{connect:i=>n.mutate(i),isPending:n.isPending,isSuccess:n.isSuccess,isError:n.isError,errorMessage:n.isError?n.error.message??"Couldn’t connect to Ollama.":null}}const Fe=["runtime-connect","opencode","direct"];function Fs(){const s=b();return z({queryKey:Fe,queryFn:()=>s.getOpenCodeDirectSetup(),staleTime:3e4})}function $s(){var i;const s=b(),t=R({mutationFn:({providerId:a,key:r,baseURL:l})=>s.checkProviderCredential(a,r.trim().length>0?r:null,(l==null?void 0:l.trim())||null),meta:{suppressErrorToast:!0}}),n=t.data??(t.isError?{ok:!1,reason:"unexpected",message:t.error.message||"Couldn’t check the key."}:null);return{check:a=>t.mutate(a),isPending:t.isPending,result:n,checkedSavedKey:n!==null&&(((i=t.variables)==null?void 0:i.key)??"").trim().length===0,reset:t.reset}}function _s(){var l,o,c;const s=b(),t=K(),[n,i]=x.useState(null),a=R({mutationFn:async({providerId:u,key:d,baseURL:m})=>{const h=(m==null?void 0:m.trim())||null;i("checking");const g=await s.checkProviderCredential(u,d.trim().length>0?d:null,h);return g.ok?(i("saving"),await s.storeProviderCredential(u,d,h),{saved:!0,message:null}):{saved:!1,message:g.message}},onSettled:()=>i(null),meta:{suppressErrorToast:!0},onSuccess:u=>{u.saved&&(t.invalidateQueries({queryKey:[...F]}),t.invalidateQueries({queryKey:[...T]}),t.invalidateQueries({queryKey:[...Fe]}))}}),r=((l=a.data)==null?void 0:l.saved)===!1;return{connect:u=>{u.providerId.trim().length!==0&&a.mutate(u)},isPending:a.isPending,phase:n,isSuccess:((o=a.data)==null?void 0:o.saved)===!0,isError:a.isError||r,errorMessage:r?((c=a.data)==null?void 0:c.message)??null:a.isError?a.error.message??"Couldn’t save your key.":null,reset:a.reset}}function Us(s){const t=b();return z({queryKey:["runtime-connect","ollama","catalog"],queryFn:()=>t.getOllamaModelCatalog(),enabled:s,staleTime:6e4})}function zs(){var o,c;const s=b(),t=K(),[n,i]=x.useState(null),a=R({mutationFn:async u=>{i(null);const d=await s.pullOllamaModel(u,m=>i(m));return d.ok&&await s.updateConfig({runtimes:{opencode:{provider:Me}}}),d},onSuccess:u=>{u.ok&&(t.invalidateQueries({queryKey:[...F]}),t.invalidateQueries({queryKey:[...T]}))}}),r=a.isError||((o=a.data)==null?void 0:o.ok)===!1,l=a.isError?a.error.message:((c=a.data)==null?void 0:c.error)??null;return{pull:u=>a.mutate(u),isPending:a.isPending,isError:r,errorMessage:r?l??"Couldn’t download the model.":null,progress:n,result:a.data}}function Bs(){var o,c;const s=b(),t=K(),[n,i]=x.useState(null),a=R({mutationFn:()=>(i(null),s.provisionOllama(u=>i(u))),onSuccess:u=>{u.ok&&(t.invalidateQueries({queryKey:qe}),t.invalidateQueries({queryKey:[...T]}))}}),r=a.isError||((o=a.data)==null?void 0:o.ok)===!1,l=a.isError?a.error.message:((c=a.data)==null?void 0:c.error)??null;return{provision:()=>a.mutate(),isPending:a.isPending,isError:r,errorMessage:r?l??"Couldn’t install Ollama.":null,progress:n,result:a.data}}const Qs="https://ollama.com/download",Ys="curl -fsSL https://ollama.com/install.sh | sh";function Ws({installMethod:s}){const t=Bs(),n=s==="brew"||s==="winget";return e.jsxs("div",{className:"space-y-3","data-testid":"ollama-absent",children:[e.jsx(Gs,{}),n?e.jsx(Vs,{provision:t}):e.jsx(Hs,{}),e.jsx(Zs,{})]})}function Gs(){const s=Ae();return e.jsxs("div",{className:"space-y-1.5","data-testid":"ollama-explainer",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Run AI models on ",s]}),e.jsxs("p",{className:"text-muted-foreground text-xs leading-relaxed",children:["Ollama is a free app that runs AI models on ",s,"."]}),e.jsxs("p",{className:"text-muted-foreground text-xs leading-relaxed",children:["Nothing you type leaves ",s,"."]})]})}function Vs({provision:s}){var t,n,i;return s.isPending?e.jsx(A,{message:((t=s.progress)==null?void 0:t.message)??"Installing Ollama…"}):(n=s.result)!=null&&n.ok?(i=s.result.status)!=null&&i.running?e.jsx(A,{message:"Ollama is ready…"}):e.jsx("p",{className:"text-xs","data-testid":"ollama-installed-not-running",children:"Ollama isn’t running. Open the Ollama app to start it."}):s.isError?e.jsx(B,{message:s.errorMessage??"Couldn’t install Ollama.",onRetry:s.provision}):e.jsx(C,{size:"sm",onClick:s.provision,"data-testid":"ollama-install-oneclick",children:"Install Ollama"})}function Hs(){return e.jsxs("div",{className:"space-y-2","data-testid":"ollama-manual-install",children:[e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"Installing Ollama needs administrator access. Run this in a terminal:"}),e.jsx(Ss,{command:Ys,copyLabel:"Copy the Ollama install command"})]})}function Zs(){return e.jsxs("a",{href:Qs,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:["Or download Ollama from ollama.com ",e.jsx(G,{className:"size-3"})]})}const Js="https://ollama.com/library",Xs={"runs-well":{label:"Runs well on your machine",tone:"text-status-success-fg"},"may-be-slow":{label:"May be slow on your machine",tone:"text-status-warning-fg"},"too-large":{label:"Too large for your machine",tone:"text-destructive"}},et={frontier:"Frontier","solid-coder":"Solid coder","quick-helper":"Quick helper"};function st({active:s,onConnected:t,onConnectDirectly:n}){var I,w,P,N,L,E;const i=Ms(s),a=qs(),r=zs(),l=((I=i.data)==null?void 0:I.running)??!1,o=Us(l),[c,u]=x.useState(null),[d,m]=x.useState(null);x.useEffect(()=>{a.isSuccess&&(t==null||t(Pe))},[a.isSuccess,t]),x.useEffect(()=>{var k;(k=r.result)!=null&&k.ok&&(t==null||t(Pe))},[(w=r.result)==null?void 0:w.ok,t]);const h=k=>{u(k),a.connect(k)},g=k=>{m(k),r.pull(k)};if(i.isPending)return e.jsx(A,{message:"Looking for Ollama on your machine…"});if(!l)return e.jsx(Ws,{installMethod:(P=i.data)==null?void 0:P.installMethod});if(a.isSuccess)return t?null:e.jsx(U,{message:"Connected to Ollama"});if((N=r.result)!=null&&N.ok)return t?null:e.jsxs("div",{className:"text-status-success-fg flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs","data-testid":"guided-pull-connected",children:[e.jsx(ue,{className:"size-3.5 shrink-0"}),e.jsx("span",{children:"Connected:"}),e.jsx(ss,{runtime:"opencode",model:r.result.model,className:"text-xs"})]});const f=i.data,j=(f==null?void 0:f.installed)??[],v=((L=f==null?void 0:f.installed)==null?void 0:L.length)??(f==null?void 0:f.models.length)??0,O=((E=o.data)==null?void 0:E.models.some(k=>k.model.id===d))??!1,M=d!==null&&!O?d:null;return e.jsxs("div",{className:"space-y-4","data-testid":"ollama-running",children:[e.jsx(tt,{count:v}),j.length>0&&e.jsx(nt,{installed:j,connect:a,connectingId:c,onUse:h}),e.jsx(rt,{catalogQuery:o,pull:r,pullingId:d,onGet:g}),e.jsx(at,{pull:r,activePull:M,onSubmit:g}),e.jsx(it,{}),n&&e.jsxs("button",{type:"button",onClick:n,"data-testid":"local-connect-directly",className:"focus-ring text-muted-foreground hover:text-foreground block rounded-md text-left text-xs transition-colors",children:["Using LM Studio or another server? ",e.jsx("span",{className:"underline",children:"Connect it directly"})]})]})}function tt({count:s}){return e.jsxs("p",{className:"flex items-center gap-1.5 text-xs","data-testid":"ollama-status-line",children:[e.jsx("span",{className:"size-1.5 shrink-0 rounded-full bg-emerald-500","aria-hidden":!0}),e.jsxs("span",{children:["Ollama is running · ",s," ",s===1?"model":"models"," installed"]})]})}function $e({verdict:s,explanation:t}){const n=Xs[s];return e.jsxs("div",{"data-testid":"ollama-verdict","data-verdict":s,children:[e.jsx("p",{className:V("text-xs font-medium",n.tone),children:n.label}),e.jsx("p",{className:"text-muted-foreground/80 text-2xs leading-snug",children:t})]})}function _e({tier:s}){return e.jsx(De,{size:"xs",variant:"outline",className:"font-normal",children:et[s]})}function nt({installed:s,connect:t,connectingId:n,onUse:i}){return e.jsxs("div",{className:"space-y-2","data-testid":"ollama-installed",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Installed"}),e.jsx("ul",{className:"space-y-1.5",children:s.map(a=>{const r=n===a.id&&t.isPending,l=n===a.id&&t.isError,o=()=>i(a.id);let c=e.jsx(C,{size:"sm",onClick:o,children:"Use"});return r?c=e.jsx(A,{message:"Connecting…"}):l&&(c=e.jsx(B,{message:t.errorMessage??"Couldn’t connect to Ollama.",onRetry:o})),e.jsxs("li",{className:"border-border flex items-center justify-between gap-3 rounded-lg border p-3","data-testid":"ollama-installed-item",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:a.id}),a.assessment.model.tier&&e.jsx(_e,{tier:a.assessment.model.tier})]}),e.jsx($e,{verdict:a.assessment.verdict,explanation:a.assessment.explanation})]}),c]},a.id)})})]})}function rt({catalogQuery:s,pull:t,pullingId:n,onGet:i}){var r;if(s.isPending)return e.jsx(A,{message:"Checking which models fit your machine…"});const a=((r=s.data)==null?void 0:r.models)??[];return s.isError||a.length===0?null:e.jsxs("div",{className:"space-y-2","data-testid":"ollama-shelf",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Add a model"}),e.jsx("ul",{className:"space-y-1.5",children:a.map(({model:l,verdict:o,explanation:c})=>{const u=n===l.id,d=()=>i(l.id);return u&&(t.isPending||t.isError)?e.jsxs("li",{className:"border-border rounded-lg border p-3","data-testid":"shelf-item",children:[e.jsx("p",{className:"mb-2 text-sm font-medium",children:l.label}),t.isPending?e.jsx(Ue,{progress:t.progress}):e.jsx(B,{message:t.errorMessage??"Couldn’t download the model.",onRetry:d})]},l.id):e.jsxs("li",{className:"border-border flex items-center justify-between gap-3 rounded-lg border p-3","data-testid":"shelf-item",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:l.label}),l.tier&&e.jsx(_e,{tier:l.tier}),e.jsx("span",{className:"text-muted-foreground text-xs",children:l.sizeLabel})]}),e.jsx($e,{verdict:o,explanation:c})]}),e.jsx(C,{size:"sm",variant:"outline",disabled:o==="too-large"||t.isPending,onClick:d,children:"Get"})]},l.id)})})]})}function at({pull:s,activePull:t,onSubmit:n}){const[i,a]=x.useState(""),r=i.trim(),l=ps.test(r);if(t&&s.isPending)return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Downloading ",t,"…"]}),e.jsx(Ue,{progress:s.progress})]});const o=c=>{c.preventDefault(),l&&n(r)};return e.jsxs("form",{onSubmit:o,className:"space-y-1.5",children:[e.jsx(S,{htmlFor:"ollama-pull-tag",className:"text-xs font-normal",children:"Download any model by name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(_,{id:"ollama-pull-tag","data-testid":"ollama-pull-by-name",value:i,onChange:c=>a(c.target.value),placeholder:"qwen2.5-coder:32b","aria-invalid":r.length>0&&!l}),e.jsx(C,{type:"submit",size:"sm",disabled:!l||s.isPending,children:"Download"})]}),r.length>0&&!l&&e.jsxs("p",{className:"text-muted-foreground text-2xs",children:["Use a tag like ",e.jsx("code",{className:"text-2xs",children:"qwen2.5-coder:32b"}),"."]}),t&&s.isError&&e.jsx(B,{message:s.errorMessage??"Couldn’t download the model.",onRetry:()=>n(t)})]})}function it(){return e.jsxs("a",{href:Js,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:["Browse the library ",e.jsx(G,{className:"size-3"})]})}function Ue({progress:s}){const t=Le(),n=s==null?void 0:s.percent,i=(s==null?void 0:s.status)??"Starting download…";return e.jsxs("div",{className:"space-y-2","data-testid":"guided-pull-progress",children:[e.jsx("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:n===void 0?e.jsx(te.div,{className:"bg-primary/70 h-full w-1/3 rounded-full",animate:t?{}:{x:["-100%","300%"]},transition:{duration:1.2,repeat:1/0,ease:"easeInOut"}}):e.jsx(te.div,{className:"bg-primary h-full rounded-full",initial:!1,animate:{width:`${Math.min(100,Math.max(0,n))}%`},transition:t?{duration:0}:{duration:.3,ease:"easeOut"},"data-testid":"guided-pull-bar"})}),e.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[e.jsx(de,{size:"xs",className:V("shrink-0",t&&"animate-none")}),e.jsxs("span",{className:"truncate",children:[i,n!==void 0?` · ${Math.round(n)}%`:""]})]})]})}function ot(){var r,l,o;const s=b(),t=K(),n=R({mutationFn:c=>s.storeOpenRouterKey(c),onSuccess:c=>{c.ok&&(t.invalidateQueries({queryKey:[...F]}),t.invalidateQueries({queryKey:[...T]}))}}),i=n.isError||((r=n.data)==null?void 0:r.ok)===!1,a=n.isError?n.error.message:((l=n.data)==null?void 0:l.error)??null;return{store:c=>{c.trim().length!==0&&n.mutate(c)},isPending:n.isPending,isSuccess:((o=n.data)==null?void 0:o.ok)===!0,isError:i,errorMessage:i?a??"Couldn’t save the OpenRouter key.":null}}function lt(){var h,g;const s=b(),t=K(),[n,i]=x.useState(null),[a,r]=x.useState(null),l=R({mutationFn:()=>s.startOpenRouterOAuth(),onMutate:()=>r(null),onSuccess:({authorizeUrl:f,state:j})=>{if(!ts(f)){r("Couldn’t open the OpenRouter sign-in page.");return}i(j)},onError:f=>r(f.message??"Couldn’t start OpenRouter sign-in.")}),o=z({queryKey:["runtime-connect","openrouter","oauth",n],queryFn:()=>s.getOpenRouterOAuthStatus(n),enabled:n!==null,refetchInterval:f=>{var j;return((j=f.state.data)==null?void 0:j.status)==="pending"?1500:!1}}),c=(h=o.data)==null?void 0:h.status;x.useEffect(()=>{c==="connected"&&(t.invalidateQueries({queryKey:[...F]}),t.invalidateQueries({queryKey:[...T]}))},[c,t]);const u=l.isPending||n!==null&&c==="pending",d=!!a||c==="error",m=d?a??((g=o.data)==null?void 0:g.error)??"Couldn’t sign in to OpenRouter. Try again.":null;return{begin:()=>l.mutate(),isPending:u,isSuccess:c==="connected",isError:d,errorMessage:m}}const ct="https://openrouter.ai/keys";function dt({onConnected:s}){const[t,n]=x.useState(""),i=ot(),a=lt(),r=i.isSuccess||a.isSuccess;return x.useEffect(()=>{r&&(s==null||s(Ps))},[r,s]),r?e.jsx(U,{message:"Connected to OpenRouter"}):e.jsxs("div",{className:"space-y-4","data-testid":"openrouter-gateway",children:[e.jsx("div",{className:"space-y-2",children:a.isPending?e.jsx(A,{message:"Sign in to OpenRouter in the new tab…"}):a.isError?e.jsx(B,{message:a.errorMessage??"Couldn’t sign in to OpenRouter.",onRetry:a.begin}):e.jsxs(e.Fragment,{children:[e.jsx(C,{size:"sm",className:"w-full",onClick:a.begin,children:"Connect OpenRouter"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Makes a limited key for you."})]})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"bg-border h-px flex-1"}),e.jsx("span",{className:"text-muted-foreground text-2xs tracking-wide uppercase",children:"or"}),e.jsx("span",{className:"bg-border h-px flex-1"})]}),i.isPending?e.jsx(A,{message:"Checking your OpenRouter key…"}):e.jsxs("form",{className:"space-y-2",onSubmit:l=>{l.preventDefault(),i.store(t)},children:[e.jsx(S,{htmlFor:"openrouter-key",className:"text-xs",children:"OpenRouter key"}),e.jsx(ne,{id:"openrouter-key",value:t,onChange:l=>n(l.target.value),placeholder:"sk-or-…",autoComplete:"off",spellCheck:!1}),i.isError&&e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:i.errorMessage}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("a",{href:ct,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:["Get an OpenRouter key ",e.jsx(G,{className:"size-3"})]}),e.jsx(C,{type:"submit",size:"sm",variant:"outline",disabled:t.trim().length===0,children:"Save key"})]})]})]})}const se="other";function X(s){return W.find(t=>t.id===s)}function ut(s){var t;return((t=X(s))==null?void 0:t.id)??"openai"}function ce(s){var t;return((t=W.find(n=>n.id===s))==null?void 0:t.defaultBaseURL)??W[0].defaultBaseURL}function ze(s){return W.some(t=>t.id===s.providerId)}function ie(s){return ze(s)?s.providerId==="anthropic"?"anthropic":s.baseURL===null||s.baseURL===ce(s.providerId)?s.providerId:se:"openai"}function mt({onConnected:s}){const t=Fs();return t.isError&&!t.data?e.jsx(B,{message:"Couldn’t load your saved settings.",onRetry:()=>void t.refetch()}):t.data?e.jsx(xt,{setup:t.data,onConnected:s},`${t.data.providerId??""}|${t.data.baseURL??""}`):e.jsx(A,{message:"Loading what you saved…"})}function xt({setup:s,onConnected:t}){var J;const n=ze(s)?s:null,[i,a]=x.useState(()=>ie(s)),[r,l]=x.useState(""),[o,c]=x.useState(()=>{var y;return(n==null?void 0:n.baseURL)??((y=X(ie(s)))==null?void 0:y.defaultBaseURL)??""}),[u,d]=x.useState(()=>{var $;const y=ie(s);return y!==se&&n!==null&&n.baseURL!==null&&n.baseURL!==(($=X(y))==null?void 0:$.defaultBaseURL)}),m=_s(),h=$s(),g=X(i),f=ut(i),j=n!=null&&n.key.saved&&n.providerId===f?n.key.last4:null,v=o.trim(),O=i===se,M=!O||v.length>0,I=ce(f),w=v||I,P=w===I?"":w,N=n===null?null:n.baseURL??ce(n.providerId),L=f!==((n==null?void 0:n.providerId)??null)||w!==N,E=r.trim().length>0,q=(E||j!==null&&!L)&&M,ee=E&&M,H=!E&&j!==null&&L,re=w.startsWith("http://"),Q={providerId:f,key:r,baseURL:P},D=m.isPending||h.isPending,Z=x.useRef(null),Y=()=>{h.reset(),m.reset()};return x.useEffect(()=>{m.isSuccess&&(t==null||t(Es))},[m.isSuccess,t]),x.useEffect(()=>{var y;m.isError&&((y=Z.current)==null||y.focus())},[m.isError]),m.isSuccess?e.jsx(U,{}):e.jsxs("form",{className:"space-y-3","data-testid":"direct-provider",onSubmit:y=>{y.preventDefault(),h.reset(),m.connect(Q)},children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:"direct-provider-source",className:"text-xs",children:"Power source"}),e.jsxs(ns,{value:i,disabled:D,onValueChange:y=>{var $;a(y),c((($=X(y))==null?void 0:$.defaultBaseURL)??""),Y()},children:[e.jsx(rs,{id:"direct-provider-source","data-testid":"direct-provider-source",children:e.jsx(as,{})}),e.jsxs(is,{children:[W.map(y=>e.jsx(be,{value:y.id,children:y.label},y.id)),e.jsx(be,{value:se,children:"Other (OpenAI-compatible)"})]})]})]}),(O||u)&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(S,{htmlFor:"direct-provider-base-url",className:"text-xs",children:["Base URL ",!O&&e.jsx("span",{className:"text-muted-foreground",children:"(optional)"})]}),e.jsx(_,{id:"direct-provider-base-url",value:o,disabled:D,onChange:y=>{c(y.target.value),Y()},placeholder:"https://api.example.com/v1",autoComplete:"off",spellCheck:!1})]}),!O&&!u&&e.jsx("button",{type:"button",onClick:()=>d(!0),disabled:D,"data-testid":"direct-provider-advanced",className:"text-muted-foreground hover:text-foreground text-xs underline decoration-dotted underline-offset-2 transition-colors",children:"Advanced"}),re&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"direct-provider-insecure",children:"This address isn’t encrypted. Your key travels in the open."}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{htmlFor:"direct-provider-key",className:"text-xs",children:"API key"}),e.jsx(ne,{id:"direct-provider-key",ref:Z,value:r,disabled:D,onChange:y=>{l(y.target.value),Y()},placeholder:j===null?(g==null?void 0:g.keyPlaceholder)??W[0].keyPlaceholder:`Saved key ends in ${j}. Paste to replace.`,autoComplete:"off",spellCheck:!1})]}),m.isError&&e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:m.errorMessage}),H&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"direct-provider-repaste",children:"Paste your key again to change the address."}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g===void 0?e.jsx("span",{}):e.jsxs("a",{href:g.getKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:["Get an API key ",e.jsx(G,{className:"size-3"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{type:"button",size:"sm",variant:"outline",disabled:!q||D,"data-testid":"direct-provider-test",onClick:()=>{m.reset(),h.reset(),h.check(Q)},children:"Test key"}),e.jsx(C,{type:"submit",size:"sm",disabled:!ee||D,children:"Save & connect"})]})]}),D?e.jsx(A,{message:m.phase==="saving"?"Saving…":"Checking your key…"}):((J=h.result)==null?void 0:J.ok)===!0?e.jsx(U,{message:h.checkedSavedKey?"Your saved key works":"Key works"}):h.result?e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:h.result.message}):null]})}function ht({currentProvider:s,onConnected:t}){const[n,i]=x.useState("choose"),a=pt();if(n==="choose")return e.jsx(ft,{sources:a,onChoose:i,currentProvider:s});const r=()=>i("choose");return n==="cloud"?e.jsx(oe,{source:a.cloud,onBack:r,children:e.jsx(dt,{onConnected:t})}):n==="local"?e.jsx(oe,{source:a.local,onBack:r,children:e.jsx(st,{active:!0,onConnected:t,onConnectDirectly:()=>i("direct")})}):e.jsx(oe,{source:a.direct,onBack:r,children:e.jsx(mt,{onConnected:t})})}function pt(){return{cloud:{step:"cloud",title:"Best models, zero setup",description:"Claude, GPT, Gemini and 300+ more, in the cloud.",sub:"One OpenRouter account covers them all. Pay for what you use.",tradeOff:"Your prompts and code are sent to the model’s provider.",recommended:!0},local:{step:"local",title:"Private and free, on your computer",description:`Models run on ${Ae()}. Nothing you type ever leaves it.`,sub:"Runs Quick helpers and Solid coders. Frontier models stay cloud-only.",tradeOff:"Smaller models: good for edits and quick help."},direct:{step:"direct",title:"Use your own API key",stepTitle:"Your own API key",description:"Anthropic, OpenAI, or any OpenAI-compatible server, like LM Studio.",sub:"",quiet:!0}}}function ft({sources:s,onChoose:t,currentProvider:n}){return e.jsxs("div",{className:"space-y-2","data-testid":"opencode-power-sources",children:[n&&e.jsxs("p",{className:"text-muted-foreground text-xs","data-testid":"opencode-current-source",children:["Currently: ",Ts(n)]}),Object.values(s).map(i=>e.jsx(gt,{source:i,onChoose:t},i.step))]})}function gt({source:s,onChoose:t}){return e.jsxs("button",{type:"button",onClick:()=>t(s.step),"data-testid":`power-source-${s.step}`,className:V("card-interactive focus-ring group flex w-full items-start gap-3 rounded-lg border p-3 text-left",s.recommended?"border-primary/40 bg-card shadow-soft":"border-border bg-card shadow-soft",s.quiet&&"shadow-none"),children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:s.title}),s.recommended&&e.jsx(De,{size:"xs",variant:"secondary",children:"Recommended"})]}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:s.description})]}),e.jsx(ls,{className:"text-muted-foreground/60 mt-0.5 size-4 shrink-0"})]})}function oe({source:s,onBack:t,children:n}){const i=!!(s.sub||s.tradeOff);return e.jsxs("div",{className:"space-y-3","data-testid":"opencode-connect-step",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{type:"button",onClick:t,className:"focus-ring text-muted-foreground hover:text-foreground -ml-1 inline-flex items-center gap-1 rounded-md px-1 py-0.5 text-xs transition-colors","data-testid":"connect-step-back",children:[e.jsx(os,{className:"size-3.5"}),"Back"]}),e.jsx("span",{className:"text-muted-foreground/40",children:"·"}),e.jsx("span",{className:"text-sm font-medium",children:s.stepTitle??s.title})]}),i&&e.jsxs("div",{className:"space-y-1","data-testid":"connect-step-details",children:[s.sub&&e.jsx("p",{className:"text-muted-foreground/80 text-xs",children:s.sub}),s.tradeOff&&e.jsxs("p",{className:"text-muted-foreground/70 text-2xs leading-snug",children:[e.jsx("span",{className:"font-medium",children:"Trade-off:"})," ",s.tradeOff]})]}),n]})}function yt({type:s,connect:t,currentProvider:n,onConnected:i}){const a=gs(),r=Os(s),l=cs(),o=ds(),c=us([s]);if(s==="doe")return a?e.jsx(Ls,{onConnected:i}):e.jsx(Oe,{});const u=r==="lead"&&l!==null,d=a?t.kind==="provider-picker"?e.jsx(ht,{currentProvider:n,onConnected:i}):t.kind==="login"?e.jsx(Rs,{type:s,onConnected:i,asOtherWay:u}):null:e.jsx(Oe,{});if(d===null)return null;const m=me(s).label,h=t.kind==="provider-picker";if(r==="on-credits")return e.jsxs("div",{className:"space-y-3","data-testid":`credits-ready-${s}`,children:[e.jsxs("div",{role:"status",children:[e.jsxs("p",{className:"text-status-success-fg flex items-center gap-1.5 text-sm font-medium",children:[e.jsx(ue,{className:"size-3.5","aria-hidden":!0}),"You’re ready"]}),e.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:["New work on ",m," runs on your DorkOS credits.",c.map(f=>` ${f}`).join("")]})]}),e.jsx(le,{collapsed:!0,children:d})]});const g=f=>l==null?void 0:l({runtime:s,origin:`runtime-connect:${s}`,fullWidth:f,onChoose:async()=>{await o.mutateAsync({runtime:s,useCredits:!0}),i==null||i(ws(m))}});return u?e.jsxs("div",{className:"space-y-4","data-testid":`default-first-${s}`,children:[g(!0),e.jsx(le,{children:d}),e.jsx(Cs,{ollama:h,remote:!a})]}):r==="other-way"&&l!==null?e.jsxs("div",{className:"space-y-4","data-testid":`credits-other-way-${s}`,children:[d,e.jsx(le,{children:g(!1)})]}):d}function le({collapsed:s=!1,children:t}){const[n,i]=x.useState(!s);return s?e.jsxs(we,{open:n,onOpenChange:i,children:[e.jsxs(Re,{className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ms,{className:V("size-3.5 transition-transform",n&&"rotate-180")}),"Other ways"]}),e.jsx(Ie,{className:"mt-3",children:t})]}):e.jsxs("section",{className:"space-y-2","aria-label":"Other ways",children:[e.jsx("p",{className:"text-muted-foreground text-2xs font-medium tracking-wide uppercase",children:"Other ways"}),t]})}const Ot=s=>e.jsx(yt,{...s});export{Ct as C,Ss as D,Cs as K,Oe as R,gs as a,Os as b,Ns as c,Ts as d,Ls as e,bs as g,Ot as r,St as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,bx as K,ds as I,dt as Y,j as e,du as G,dv as W,bw as Q,bu as C,bt as z,dw as V,bv as J,dx as Z,dy as X,dz as q,bC as ee,dA as te,dB as ne,dC as A,cG as se,cH as re,cJ as ae,cK as oe,cL as ie,dD as ce,dE as D,R as E,B as S,dF as U,dG as le,Q as k,Y as de,Z as ue,$ as fe,a0 as me,dH as xe,aP as pe,ag as ve,bV as he,W as $,x as ge,bF as Ce}from"./index-CMaIfS_G.js";import{I as be}from"./inline-code-BDPvCbUE.js";import{l as je}from"./list-runtime-types-DWuilOeW.js";import{D as O,u as Re,C as Ne}from"./RuntimeConnectFlow-COnfwsEa.js";var Pe=Object.defineProperty,b=(t,n)=>Pe(t,"name",{value:n,configurable:!0}),T,_="HoverCard",[F,Ze]=K(_,[I]),L=I(),[Se,H]=F(_),we=b(t=>{const{__scopeHoverCard:n,children:r,open:a,defaultOpen:s,onOpenChange:c,openDelay:o=700,closeDelay:m=300}=t,x=L(n),i=l.useRef(0),p=l.useRef(0),v=l.useRef(!1),g=l.useRef(!1),[u,f]=Y({prop:a,defaultProp:s??!1,onChange:c,caller:_}),d=l.useCallback(()=>{clearTimeout(p.current),i.current=window.setTimeout(()=>f(!0),o)},[o,f]),j=l.useCallback(()=>{clearTimeout(i.current),!v.current&&!g.current&&(p.current=window.setTimeout(()=>f(!1),m))},[m,f]),h=l.useCallback(()=>f(!1),[f]);return l.useEffect(()=>()=>{clearTimeout(i.current),clearTimeout(p.current)},[]),e.jsx(Se,{scope:n,open:u,onOpenChange:f,onOpen:d,onClose:j,onDismiss:h,hasSelectionRef:v,isPointerDownOnContentRef:g,children:e.jsx(G,{...x,children:r})})},"HoverCard"),He="HoverCardTrigger",Te=l.forwardRef(b(function(n,r){const{__scopeHoverCard:a,...s}=n,c=H(He,a),o=L(a);return e.jsx(W,{asChild:!0,...o,children:e.jsx(Q.a,{"data-state":c.open?"open":"closed",...s,ref:r,onPointerEnter:C(n.onPointerEnter,w(c.onOpen)),onPointerLeave:C(n.onPointerLeave,w(c.onClose)),onFocus:C(n.onFocus,c.onOpen),onBlur:C(n.onBlur,c.onClose),onTouchStart:C(n.onTouchStart,m=>m.preventDefault())})})},"HoverCardTrigger")),M="HoverCardPortal",[ye,De]=F(M,{forceMount:void 0}),Ee=b(t=>{const{__scopeHoverCard:n,forceMount:r,children:a,container:s}=t,c=H(M,n);return e.jsx(ye,{scope:n,forceMount:r,children:e.jsx(z,{present:r||c.open,children:e.jsx(V,{asChild:!0,container:s,children:a})})})},"HoverCardPortal"),y="HoverCardContent",ke=l.forwardRef(b(function(n,r){const a=De(y,n.__scopeHoverCard),{forceMount:s=a.forceMount,...c}=n,o=H(y,n.__scopeHoverCard);return e.jsx(z,{present:s||o.open,children:e.jsx(Oe,{"data-state":o.open?"open":"closed",...c,onPointerEnter:C(n.onPointerEnter,w(o.onOpen)),onPointerLeave:C(n.onPointerLeave,w(o.onClose)),ref:r})})},"HoverCardContent")),Oe=l.forwardRef(b(function(n,r){const{__scopeHoverCard:a,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:o,onInteractOutside:m,...x}=n,i=H(y,a),p=L(a),v=l.useRef(null),g=J(r,v),[u,f]=l.useState(!1);return l.useEffect(()=>{if(u){const d=document.body;return T=d.style.userSelect||d.style.webkitUserSelect,d.style.userSelect="none",d.style.webkitUserSelect="none",()=>{d.style.userSelect=T,d.style.webkitUserSelect=T}}},[u]),l.useEffect(()=>{if(v.current){const d=b(()=>{f(!1),i.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var h;((h=document.getSelection())==null?void 0:h.toString())!==""&&(i.hasSelectionRef.current=!0)})},"handlePointerUp");return document.addEventListener("pointerup",d),()=>{document.removeEventListener("pointerup",d),i.hasSelectionRef.current=!1,i.isPointerDownOnContentRef.current=!1}}},[i.isPointerDownOnContentRef,i.hasSelectionRef]),l.useEffect(()=>{v.current&&B(v.current).forEach(j=>j.setAttribute("tabindex","-1"))}),e.jsx(Z,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:m,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:C(o,d=>{d.preventDefault()}),onDismiss:i.onDismiss,children:e.jsx(X,{...p,...x,onPointerDown:C(x.onPointerDown,d=>{d.currentTarget.contains(d.target)&&f(!0),i.hasSelectionRef.current=!1,i.isPointerDownOnContentRef.current=!0}),ref:g,style:{...x.style,userSelect:u?"text":void 0,WebkitUserSelect:u?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})},"HoverCardContentImpl"));function w(t){return n=>n.pointerType==="touch"?void 0:t()}b(w,"excludeTouch");function B(t){const n=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:b(a=>a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP,"acceptNode")});for(;r.nextNode();)n.push(r.currentNode);return n}b(B,"getTabbableNodes");var _e=we,Le=Te,$e=Ee,Ie=ke;function Xe({...t}){return e.jsx(_e,{"data-slot":"hover-card",...t})}function qe({...t}){return e.jsx(Le,{"data-slot":"hover-card-trigger",...t})}function et({className:t,align:n="center",sideOffset:r=4,...a}){const s=q();return e.jsx($e,{"data-slot":"hover-card-portal",container:s,children:e.jsx(Ie,{"data-slot":"hover-card-content",align:n,sideOffset:r,className:ee("bg-dui-popover text-dui-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 border-dui-border z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden motion-reduce:animate-none!",t),...a})})}function ze(t,n,r){return t?[t]:n||je(r)}function Ae({runtime:t,types:n,requirements:r,registeredTypes:a=[],onRecheck:s,isRechecking:c=!1,renderConnect:o}){const m=U(),x=ze(t,n,a);return e.jsxs("div",{className:"space-y-4","data-testid":"runtime-setup-panel",children:[x.map(i=>e.jsx(Fe,{type:i,requirements:r,registered:a.includes(i),renderConnect:o},i)),s&&e.jsxs("div",{className:"flex items-center justify-end gap-3 pt-1",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"Refresh after connecting."}),e.jsxs(S,{variant:"outline",size:"sm",className:"gap-2",onClick:s,disabled:c,children:[e.jsx(le,{className:k("size-3.5",c&&!m&&"animate-spin")}),"Check again"]})]})]})}function Ue(t,n,r){return r?xe(t)==="provider-picker"?n?{idPrefix:"change",triggerLabel:"Change",cancelLabel:"Keep current source",connect:{kind:"provider-picker",label:"Change power source"},currentProvider:n}:null:pe.includes(t)?{idPrefix:"reconnect",triggerLabel:"Fix sign-in",cancelLabel:"Keep current sign-in",connect:{kind:"login",label:`Reconnect ${ve(t)}`}}:null:null}function Fe({type:t,requirements:n,registered:r,renderConnect:a}){var R,N;const s=D(t),c=s.icon,o=n==null?void 0:n.runtimes[t],m=A(n,t,r),x=m.state==="ready",[i,p]=l.useState(!1),[v,g]=l.useState(!1);!x&&v&&g(!1);const u=x?Ue(t,o==null?void 0:o.provider,!!a):null,f=o==null?void 0:o.dependencies.find(P=>P.status!=="satisfied"&&P.installHint),d=(f==null?void 0:f.installHint)??((R=s.setup)==null?void 0:R.installCommand),j=(f==null?void 0:f.infoUrl)??((N=s.setup)==null?void 0:N.infoUrl),h=!!o||!!s.setup;return e.jsxs("section",{className:"border-border rounded-xl border p-4","data-testid":`runtime-section-${t}`,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(c,{className:"size-4"}),e.jsx("span",{className:"text-sm font-medium",children:s.label})]}),x&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-status-success-fg inline-flex items-center gap-1 text-xs","data-testid":`runtime-ready-${t}`,children:[e.jsx(E,{className:"size-3.5"})," Ready"]}),u&&!v&&e.jsx("button",{type:"button",onClick:()=>g(!0),className:"text-muted-foreground hover:text-foreground text-xs underline-offset-2 transition-colors hover:underline","data-testid":`runtime-${u.idPrefix}-${t}`,children:u.triggerLabel})]})]}),u&&v&&e.jsxs("div",{className:"mt-3 space-y-2","data-testid":`runtime-${u.idPrefix}-panel-${t}`,children:[a==null?void 0:a({type:t,connect:u.connect,...u.currentProvider?{currentProvider:u.currentProvider}:{},onConnected:()=>g(!1)}),e.jsx("button",{type:"button",onClick:()=>g(!1),className:"text-muted-foreground hover:text-foreground text-xs transition-colors","data-testid":`runtime-${u.idPrefix}-cancel-${t}`,children:u.cancelLabel})]}),!x&&m.connect&&e.jsx("div",{className:"mt-3",children:e.jsx(Me,{type:t,connect:m.connect,renderConnect:a,installCommand:d,installInfoUrl:j,onShowDetails:()=>p(!0)})}),h&&e.jsxs(de,{open:i,onOpenChange:p,className:"mt-3",children:[e.jsxs(ue,{className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:[e.jsx(fe,{className:k("size-3.5 transition-transform",i&&"rotate-180")}),"Setup details"]}),e.jsx(me,{className:"mt-3 space-y-3",children:o?o.dependencies.map(P=>e.jsx(Ye,{dep:P},P.name)):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted-foreground text-xs",children:["Not registered with this server. Install it, then enable"," ",e.jsxs(be,{children:["runtimes.",t]})," in your DorkOS config."]}),s.setup&&e.jsx(O,{command:s.setup.installCommand,infoUrl:s.setup.infoUrl,copyLabel:`Copy install command for ${s.label}`})]})})]})]})}function Me({type:t,connect:n,renderConnect:r,installCommand:a,installInfoUrl:s,onShowDetails:c}){return n.kind==="install"?e.jsx(Be,{type:t,label:n.label,installCommand:a,installInfoUrl:s}):r&&(n.kind==="login"||n.kind==="provider-picker")?e.jsx(e.Fragment,{children:r({type:t,connect:n})}):e.jsx(S,{size:"sm",onClick:c,children:n.label})}function Be({type:t,label:n,installCommand:r,installInfoUrl:a}){const s=D(t),{provision:c,isPending:o,isError:m,errorMessage:x,progress:i,result:p}=Re(t);return o||p!=null&&p.ok?e.jsx(Ke,{message:(i==null?void 0:i.message)??`Installing ${s.label}…`}):m?e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:x}),r&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"You can install it yourself instead:"}),e.jsx(O,{command:r,infoUrl:a,copyLabel:`Copy install command for ${s.label}`})]}),e.jsx(S,{size:"sm",onClick:c,children:"Try again"})]}):e.jsxs("div",{children:[e.jsx(S,{size:"sm",onClick:c,children:n}),r&&e.jsx(Ne,{command:r,runtimeLabel:s.label})]})}function Ke({message:t}){const n=U();return e.jsxs($.div,{className:"bg-muted flex items-center gap-2 rounded-lg px-3 py-2.5",initial:n?!1:{opacity:0},animate:{opacity:1},"data-testid":"provision-progress",children:[e.jsx(ge,{size:"xs",className:k("text-muted-foreground shrink-0",n&&"animate-none")}),e.jsx(Ce,{mode:"wait",children:e.jsx($.span,{className:"truncate text-xs",initial:n?!1:{opacity:0},animate:{opacity:1},exit:n?void 0:{opacity:0},transition:{duration:.2},children:t},t)})]})}function Ye({dep:t}){const n=t.status==="satisfied";return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-x-2",children:[n?e.jsx(E,{className:"text-status-success size-3.5 shrink-0"}):e.jsx(he,{className:"text-status-warning-dot size-3.5 shrink-0"}),e.jsx("span",{className:"text-sm",children:t.name}),e.jsx("p",{className:"text-muted-foreground col-start-2 mt-1 text-xs",children:n&&t.version?`v${t.version}`:t.description})]}),!n&&(t.installHint||t.infoUrl)&&e.jsx(O,{command:t.installHint,infoUrl:t.infoUrl,copyLabel:`Copy install command for ${t.name}`})]})}function tt({runtime:t,open:n,onOpenChange:r,renderConnect:a,onRuntimeReady:s,showConnectSuccess:c=!1}){const o=te(),{data:m}=ne(),x=t?D(t):null,i=A(o.data,t??"",m?t!==void 0&&t in m.capabilities:!0),p=o.data!==void 0,v=x!==null&&p&&i.state==="ready",g=l.useRef(null);l.useEffect(()=>{if(!n){g.current=null;return}if(t===void 0||!p)return;const h=g.current;g.current={runtime:t,ready:v},h!==null&&h.runtime===t&&!h.ready&&v&&(s==null||s(t))},[n,p,v,t,s]);const[u,f]=l.useState(null),d=l.useRef(n);l.useEffect(()=>{d.current&&!n&&f(null),d.current=n},[n]);const j=a&&(c?h=>a({...h,onConnected:R=>{var N;(N=h.onConnected)==null||N.call(h,R),f(R)}}):a);return e.jsx(se,{open:n,onOpenChange:r,children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(ae,{children:[e.jsx(oe,{children:x?x.label:"Your runtimes"}),e.jsx(ie,{children:u?"Connected.":x?v?"Ready to use.":"Connect it to start a chat.":"Connect one to start a chat."})]}),e.jsx(ce,{children:u?e.jsx(Ge,{success:u,onDone:()=>r(!1)}):e.jsx(Ae,{runtime:t,requirements:o.data,registeredTypes:m?Object.keys(m.capabilities):void 0,onRecheck:()=>void o.refetch(),isRechecking:o.isFetching,renderConnect:j})})]})})}function Ge({success:t,onDone:n}){return e.jsxs("div",{className:"space-y-4","data-testid":"runtime-connected-panel",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(E,{className:"text-status-success mt-0.5 size-4 shrink-0"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:t.title}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:t.body})]})]}),e.jsx(S,{size:"sm",className:"w-full",onClick:n,"data-testid":"runtime-connected-done",children:"Done"})]})}export{Xe as H,tt as R,qe as a,et as b,Ae as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a8 as b,a9 as z,h6 as p,h7 as g,aa as w,ab as A,ae as M,aw as I,j as e,r as d,$ as O,Q as N,B as j,a7 as q,dR as y,fZ as K,f_ as Q,f$ as W,g0 as U,g1 as G,g2 as Y,g3 as J,g4 as Z,h as H,l as E,e3 as V,a6 as X,e as D,e5 as ee,h8 as se,gz as R,a5 as L}from"./index-CMaIfS_G.js";import{B as P}from"./banner-Cqt8YzUW.js";import{I as C}from"./inline-code-BDPvCbUE.js";import{P as _}from"./package-DzrvXxqm.js";function $(s){const t=b();return z({queryKey:p.status(s),queryFn:()=>t.getHarnessStatus(s),staleTime:3e4,refetchOnMount:"always"})}const te={native:"reads it",projected:"shared",drifted:"out of date",dropped:"can’t see it",warned:"may not work",conflict:"blocked","pending-approval":"needs your OK"},ne={native:"neutral",projected:"neutral",drifted:"info",dropped:"muted",warned:"warning",conflict:"warning","pending-approval":"warning"},k="\0",ae=new Set(["native","projected"]);function T(s){return`${s.scope??"project"}${k}${s.artifact}${k}${s.source??""}${k}${s.name}`}function re(s,t){return`${g[s]} ${te[t]}`}function le(s){return s.reason??s.target}function B(s,t){return t.flatMap(n=>{const a=s.cells[n];return a===void 0?[]:[{harness:n,cell:a}]})}function ie(s,t){if(t.length===0)return!1;const n=B(s,t);return n.length===t.length&&n.every(({cell:a})=>{var r;return ae.has(a.state)&&!((r=a.warnings)!=null&&r.length)})}function S(s){return`${s} ${s===1?"file":"files"}`}function oe(s){return s===1?"One package is waiting for your approval.":`${s} packages are waiting for your approval.`}function ce(s){return`Shared with all ${s}`}function de(s){return s===1?"1 agent file":`${s} agent files`}function ue(s){return`Agent files ${s} can’t see: skills, rules, commands and more.`}function xe(s){return s===1?"1 entry":`${s} entries`}function fe(s,t){return t.flatMap(n=>{const a=s.flatMap(r=>{const l=r.cells[n];return l===void 0||l.state!=="dropped"?[]:[{key:T(r),artifact:r.artifact,name:r.name,...l.reason===void 0?{}:{reason:l.reason}}]});return a.length===0?[]:[{harness:n,label:g[n],entries:a}]})}const me={drop:"Not shared",warning:"Couldn’t read",write:"Will be written",notice:"Notice"};function he(s){return`${me[s.kind]} · ${s.artifact} ${s.name}`}function pe(s){const t=b(),n=w();return A({mutationFn:()=>t.syncHarness(s),meta:{errorLabel:"Couldn’t share your agent files"},onSuccess:a=>{n.setQueryData(p.status(s),a.status),M.success("Agent files updated.")}})}function ge(s){const t=w();I("approval_resolved",()=>{t.invalidateQueries({queryKey:p.status(s)})})}function je({result:s,onDismiss:t}){const{applied:n,removals:a,askedAbout:r}=s;return e.jsx(P,{variant:"neutral",onDismiss:t,dismissLabel:"Dismiss what changed","data-slot":"harness-sync-summary",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Agent files updated."}),n>0&&e.jsxs(e.Fragment,{children:[" ",S(n)," written."]})]}),a.length>0&&e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("p",{className:"font-medium",children:["Removed ",S(a.length)," DorkOS put here:"]}),e.jsx("ul",{className:"flex flex-col gap-0.5",children:a.map(({path:l,reason:c})=>e.jsxs("li",{className:"text-3xs flex flex-col",children:[e.jsx("code",{className:"font-mono",children:l}),e.jsx("span",{className:"opacity-80",children:c})]},l))})]}),r.length>0&&e.jsx("p",{children:oe(r.length)})]})})}function ve(s){const{counts:t,sweepPreview:n}=s;return t.drifted>0||n.length>0?{message:"Some agent files are out of date.",variant:n.length>0?"warning":"info",actionable:!0}:t.conflicts>0?{message:"DorkOS can’t update some files. Something blocks them.",variant:"warning",actionable:!1}:t.adoptable>0?{message:"Some skills only reach a few of your agents.",variant:"info",actionable:!1}:null}function Ne({projectPath:s}){return ge(s),null}function ye({projectPath:s}){const{data:t}=$(s),n=pe(s),[a,r]=d.useState(!1),[l,c]=d.useState(!1);if(t===void 0||t.state!=="ready")return null;const u=e.jsx(Ne,{projectPath:s});if(n.data!==void 0&&!l)return e.jsxs(e.Fragment,{children:[u,e.jsx(je,{result:n.data,onDismiss:()=>c(!0)})]});const o=ve(t);if(o===null)return u;const{removals:x,sweepPreview:m}=t,i=m.length;return e.jsxs(e.Fragment,{children:[u,e.jsx(P,{variant:o.variant,"data-slot":"harness-drift-banner",detailsOpen:a,details:i===0?void 0:e.jsx("ul",{className:"flex flex-col gap-0.5",children:x.map(({path:f,reason:v})=>e.jsxs("li",{className:"text-3xs flex flex-col",children:[e.jsx("code",{className:"font-mono",children:f}),e.jsx("span",{className:"opacity-80",children:v})]},f))}),actions:o.actionable?e.jsx(j,{size:"sm",variant:"outline",className:"h-6 text-xs",disabled:n.isPending,onClick:()=>{c(!1),n.mutate()},children:n.isPending?"Syncing…":"Sync now"}):void 0,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("p",{children:o.message}),i>0&&e.jsxs("button",{type:"button","aria-expanded":a,onClick:()=>r(f=>!f),className:"text-3xs flex w-fit items-center gap-1 underline underline-offset-2 opacity-90 hover:opacity-100",children:["Syncing also removes ",S(i)," DorkOS put here",e.jsx(O,{"aria-hidden":!0,className:N("size-3 transition-transform",a&&"rotate-180")})]})]})})]})}function ke(s){const t=b(),n=w();return A({mutationFn:a=>t.adoptHarness(s,a),meta:{errorLabel:"Couldn’t move that skill"},onSuccess:a=>{n.setQueryData(p.status(s),a.status),n.setQueriesData({queryKey:p.all,predicate:r=>{var l;return((l=r.state.data)==null?void 0:l.projectPath)===a.status.projectPath}},a.status)}})}const Se={neutral:y.neutral,info:y.info,warning:y.warning,muted:"border border-dashed border-border text-muted-foreground"};function be({harness:s,cell:t}){var l;const n=re(s,t.state),a=le(t),r=(l=t.warnings)!=null&&l.length?t.warnings.join(" · "):void 0;return e.jsxs("li",{"aria-label":n,...a===void 0?{}:{title:a},className:N("text-3xs inline-flex items-center gap-1 rounded-full px-2 py-0.5 leading-tight",Se[ne[t.state]]),children:[n,r!==void 0&&e.jsx("span",{role:"img","aria-label":"May not work",title:r,className:"inline-flex",children:e.jsx(q,{"aria-hidden":!0,className:"text-status-warning-fg size-2.5"})})]})}function we(s){const t=s===void 0?-1:s.lastIndexOf("/"),n=t>0?s==null?void 0:s.slice(0,t):void 0;return n===void 0?"Only some agents can see it. Move it to .agents/skills to share it.":`Lives in ${n}. Move it to .agents/skills to share it.`}function Ce(s,t){return`dorkos harness adopt ${s} --project ${t}`}const $e="Share with every agent";function De(s,t,n){const a=`It moves from ${t} to .agents/skills/${s}`;return n?`${a}. A link stays behind for Claude Code.`:`${a}, where every agent reads it.`}const Ae="for all your projects";function Oe({row:s,enabled:t,projectPath:n,showEveryHarness:a}){var v;const[r,l]=d.useState(!1),[c,u]=d.useState(!1),o=ke(n),x=B(s,t),m=ie(s,t)&&!a,i=m&&!r,f=(v=o.data)==null?void 0:v.refusals[0];return e.jsxs("div",{role:"group","aria-label":s.name,className:"flex flex-col gap-1 py-1.5",children:[e.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"min-w-0 shrink truncate text-xs font-medium",children:s.name}),s.scope==="global"&&e.jsx("span",{className:"text-muted-foreground text-3xs shrink-0",children:Ae}),s.source!==void 0&&e.jsx("span",{dir:"rtl",title:s.source,className:"text-muted-foreground text-3xs ml-auto min-w-0 truncate text-left font-mono",children:e.jsx("bdi",{dir:"ltr",children:s.source})})]}),e.jsxs("ul",{"aria-label":"Agent tools",className:"flex flex-wrap items-center gap-1",children:[m&&e.jsx("li",{children:e.jsxs("button",{type:"button","aria-expanded":!i,title:x.map(({harness:h})=>g[h]).join(" · "),onClick:()=>l(h=>!h),className:"bg-muted text-muted-foreground hover:bg-accent hover:text-accent-foreground text-3xs focus-visible:ring-ring inline-flex items-center gap-1 rounded-full px-2 py-0.5 leading-tight transition-colors focus-visible:ring-2 focus-visible:outline-none",children:[ce(x.length),e.jsx(O,{"aria-hidden":!0,className:N("size-2.5 transition-transform",i&&"-rotate-90")})]})}),!i&&x.map(({harness:h,cell:F})=>e.jsx(be,{harness:h,cell:F},h))]}),s.adoptable&&e.jsxs(e.Fragment,{children:[e.jsx("p",{role:"status","aria-live":"polite",className:"text-muted-foreground text-3xs",children:(f==null?void 0:f.reason)||we(s.source)}),e.jsxs("p",{className:"text-muted-foreground text-3xs",children:["Run: ",e.jsx(C,{children:Ce(s.name,n)})]}),e.jsx("div",{children:e.jsx(j,{size:"sm",variant:"outline",className:"h-6 text-xs",disabled:o.isPending,onClick:()=>u(!0),children:$e})}),e.jsx(K,{open:c,onOpenChange:u,children:e.jsxs(Q,{children:[e.jsxs(W,{children:[e.jsxs(U,{children:["Move ",s.name," so every agent can read it?"]}),e.jsx(G,{children:De(s.name,s.source??"",t.includes("claude-code"))})]}),e.jsxs(Y,{children:[e.jsx(J,{children:"Cancel"}),e.jsx(Z,{onClick:()=>o.mutate(s.name),children:"Move it"})]})]})})]})]})}const He=se("/guides/cli-usage#agent-files");function Ee(){return e.jsxs(e.Fragment,{children:[e.jsx("span",{role:"status",className:"sr-only",children:"Loading skills…"}),e.jsx("div",{"aria-hidden":!0,className:"flex flex-col gap-3 py-1",children:[0,1,2].map(s=>e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(D,{className:"h-3 w-32"}),e.jsx(D,{className:"h-3 w-48"})]},s))})]})}function Re({projectPath:s,showBrowseLink:t=!0}){const{data:n,isPending:a,error:r,refetch:l}=$(s),[c,u]=d.useState(!1),o=d.useId(),x=H();if(a)return e.jsx(Ee,{});if(r)return e.jsxs("div",{className:"flex items-center gap-2 py-2",children:[e.jsx("p",{className:"text-destructive text-xs",children:"Couldn’t load skills."}),e.jsx(j,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>void l(),children:"Retry"})]});if(n.state!=="ready")return e.jsx(Le,{status:n});const m=n.rows.filter(i=>i.artifact==="skill");return m.length===0?e.jsxs("div",{className:"flex flex-col items-start gap-1 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"No skills here yet."}),t&&x&&e.jsxs(j,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground h-6 px-1 text-xs",onClick:()=>void x({...E.marketplace(),search:{type:"skill-pack"}}),children:[e.jsx(_,{"aria-hidden":!0,className:"mr-1.5 size-3.5"}),"Browse skill-packs"]})]}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 pb-1",children:[e.jsx(V,{htmlFor:o,className:"text-muted-foreground text-3xs",children:"Show every agent tool"}),e.jsx(X,{id:o,size:"sm",checked:c,onCheckedChange:u})]}),e.jsx("div",{className:"divide-border divide-y",children:m.map(i=>e.jsx(Oe,{row:i,enabled:n.enabled,projectPath:n.projectPath,showEveryHarness:c},T(i)))})]})}function Le({status:s}){return s.state==="not-set-up"?e.jsxs("div",{className:"flex flex-col gap-1 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"DorkOS isn’t sharing agent files for this folder yet."}),e.jsxs("p",{className:"text-muted-foreground text-3xs",children:["Run ",e.jsx(C,{children:"dorkos harness sync --fix"})," in this folder to set it up."]}),e.jsx(ee,{href:He,className:"text-3xs text-muted-foreground hover:text-foreground underline underline-offset-2",children:"How agent file sharing works"})]}):s.state==="unreadable"?e.jsxs("div",{className:"flex flex-col gap-1 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"DorkOS can’t read this folder’s agent file settings."}),s.detail!==void 0&&e.jsx("p",{className:"text-muted-foreground text-3xs",children:s.detail})]}):e.jsx("p",{className:"text-muted-foreground py-2 text-xs",children:"Agent file sharing runs in the DorkOS app."})}function Pe({group:s}){const[t,n]=d.useState(!1);return e.jsxs(R,{open:t,onOpenChange:n,trigger:e.jsxs("span",{className:"text-xs",children:["Not shared with ",s.label]}),badge:e.jsx(L,{variant:"secondary",size:"xs",className:"whitespace-nowrap",children:de(s.entries.length)}),children:[e.jsx("p",{className:"text-muted-foreground text-3xs px-4 pt-3",children:ue(s.label)}),e.jsx("ul",{className:"space-y-2 px-4 pt-2 pb-3",children:s.entries.map(a=>e.jsxs("li",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"text-3xs font-medium",children:[a.artifact," ",a.name]}),a.reason!==void 0&&e.jsx("span",{className:"text-muted-foreground text-3xs",children:a.reason})]},a.key))})]})}function _e({rows:s,enabled:t}){const n=fe(s,t);return n.length===0?null:e.jsx("div",{className:"flex flex-col gap-1.5",children:n.map(a=>e.jsx(Pe,{group:a},a.harness))})}function Te({entries:s}){const[t,n]=d.useState(!1);return s.length===0?null:e.jsx(R,{open:t,onOpenChange:n,trigger:e.jsx("span",{className:"text-xs",children:"Project-level notices"}),badge:e.jsx(L,{variant:"secondary",size:"xs",className:"whitespace-nowrap",children:xe(s.length)}),children:e.jsx("ul",{className:"space-y-2 px-4 pb-3",children:s.map(a=>e.jsxs("li",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:N("text-3xs font-medium",a.kind==="notice"&&"text-muted-foreground font-normal"),children:he(a)}),e.jsx("span",{className:"text-muted-foreground text-3xs",children:a.reason})]},`${a.kind} ${a.artifact} ${a.source??""} ${a.name}`))})})}function Be({command:s}){return e.jsx(C,{className:"break-normal",children:s.split(" ").map((t,n)=>e.jsxs(d.Fragment,{children:[n>0&&" ",e.jsx("span",{className:"whitespace-nowrap",children:t})]},`${n}-${t}`))})}function Fe({notEnabled:s}){return s.length===0?null:e.jsx("div",{className:"flex flex-col gap-1.5 py-1",children:s.map(({harness:t,why:n,signal:a})=>e.jsxs("div",{title:a,className:"flex flex-col gap-0.5",children:[e.jsx("p",{className:"text-xs font-medium",children:n==="dorkos-runtime"?`DorkOS runs ${g[t]} here, but isn’t sharing to it.`:`${g[t]} files are here, but DorkOS isn’t sharing to it.`}),e.jsxs("p",{className:"text-muted-foreground text-3xs",children:["Run ",e.jsx(Be,{command:`dorkos harness sync --fix --enable ${t}`})," in this folder to turn it on."]})]},t))})}function ze({projectPath:s}){const t=H(),{data:n}=$(s),a=(n==null?void 0:n.state)==="ready"?n:null;return e.jsxs("div",{className:"flex flex-col gap-2","data-slot":"profile-skills",children:[e.jsx(ye,{projectPath:s}),a&&e.jsx(Fe,{notEnabled:a.notEnabled}),e.jsx(Re,{projectPath:s,showBrowseLink:!1}),a&&e.jsx(_e,{rows:a.rows,enabled:a.enabled}),a&&e.jsx(Te,{entries:a.projectLevel}),t&&e.jsxs(j,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground w-full",onClick:()=>void t({...E.marketplace(),search:{type:"skill-pack"}}),children:[e.jsx(_,{"aria-hidden":!0,className:"mr-1.5 size-3.5"}),"Browse skill-packs"]})]})}function Qe({member:s}){var n;const t=((n=s.agent)==null?void 0:n.projectPath)??null;return t===null?e.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent’s folder isn’t known here."}):e.jsx(ze,{projectPath:t})}export{Qe as SkillsPage};
|