dorkos 0.118.0 → 0.120.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 +3588 -3000
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-BOS59p1y.js → AboutPage-Y8O56Cz5.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-DOmV85tr.js → ActivityErrorState-DlROxqde.js} +1 -1
- package/dist/client/assets/{ActivityPage-DbsBpb6N.js → ActivityPage-BdV90CV2.js} +1 -1
- package/dist/client/assets/{ActivityRow-B1ZeL7Jb.js → ActivityRow-B5yiD_uD.js} +1 -1
- package/dist/client/assets/{AdapterIcon-XPLZ-NAi.js → AdapterIcon-Dyq92Eup.js} +1 -1
- package/dist/client/assets/AdapterSetupWizard-D9tqz7Hl.js +2 -0
- package/dist/client/assets/{AgentOptionRow-C15RQsub.js → AgentOptionRow-BeRqDo7c.js} +1 -1
- package/dist/client/assets/{AgentPicker-CydNJYi_.js → AgentPicker-BRyYVJZu.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-BBSbluBs.js → AgentRequestCard-xX6fAKgO.js} +4 -4
- package/dist/client/assets/AppearancePage-DKF9BqRt.js +1 -0
- package/dist/client/assets/{ApplyToOverridesDialog-Cv3KEf7T.js → ApplyToOverridesDialog-CPvtr_-f.js} +1 -1
- package/dist/client/assets/AttentionSignalRow-vBfioH1A.js +1 -0
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Re2CfOlC.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-B50zNtwB.js} +1 -1
- package/dist/client/assets/{BindingDialog-8xnsM47D.js → BindingDialog-CSNjws3F.js} +1 -1
- package/dist/client/assets/{BlintzCanvas-DUDSNxlM.js → BlintzCanvas-ClOKWzws.js} +80 -79
- package/dist/client/assets/{CanvasCsvContent-D697P3sa.js → CanvasCsvContent-0Mb7uOuA.js} +6 -6
- package/dist/client/assets/CanvasFileContent-B_8zsIas.js +2 -0
- package/dist/client/assets/CanvasModel3dContent-UokbHY9i.js +2 -0
- package/dist/client/assets/{ChatAppsOff-CFEmPGm1.js → ChatAppsOff-CLRB0YU5.js} +1 -1
- package/dist/client/assets/{CodeMirrorDiff-B7VUevZG.js → CodeMirrorDiff-B4uFJD6g.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BX1bJlnT.js → CodeMirrorEditor-rYOrBAZc.js} +1 -1
- package/dist/client/assets/{CommitmentList-CDocwl5K.js → CommitmentList-i-IZ4gbr.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-Cr_MvU96.js → CommitmentsPage-ChO1JkrE.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-CJMUZPDy.js → ComputerResourceView-pLuD2ie6.js} +1 -1
- package/dist/client/assets/{ComputerViewer-BA-9lBBN.js → ComputerViewer-D7tPmpY5.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-BLLpxhn3.js → ConnectionAccessLists-D6VH1vX3.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-BWVfAPd1.js → ConnectionsPage-7x5olD9q.js} +2 -2
- package/dist/client/assets/{ConventionPage-EK3WUWVa.js → ConventionPage-BTYLWw6p.js} +1 -1
- package/dist/client/assets/{ExtensionPageRoute-C9hsJNX2.js → ExtensionPageRoute-A9AdBBbw.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-BeyAgBfh.js → FloatingTanStackRouterDevtools-CqogiFob-ayv0yz1C.js} +1 -1
- package/dist/client/assets/HandlePage-BdRWgke2.js +1 -0
- package/dist/client/assets/{HeartbeatPage-DfbNenFv.js → HeartbeatPage-Dh6W9Qg5.js} +1 -1
- package/dist/client/assets/KeyEntry-owhPGtw3.js +1 -0
- package/dist/client/assets/{LexicalField-DC_6Z-Ye.js → LexicalField-B1NFMLD6.js} +2 -2
- package/dist/client/assets/{ManagesPage-CYnGvNM2.js → ManagesPage-BAnBmBdo.js} +1 -1
- package/dist/client/assets/{Marketplace-CWiiq8of.js → Marketplace-67maxdwz.js} +2 -2
- package/dist/client/assets/{MarketplaceSourcesView-DF3cHMR0.js → MarketplaceSourcesView-CzPBNJJj.js} +1 -1
- package/dist/client/assets/{McpAppFrame-D5Muf5Sf.js → McpAppFrame-CuObpQTg.js} +2 -2
- package/dist/client/assets/McpSigninBody-B-ayj6bQ.js +1 -0
- package/dist/client/assets/{Model3dViewer-C9ODHy5I.js → Model3dViewer-DRVqxazk.js} +1 -1
- package/dist/client/assets/NamePage-DyH8JAqT.js +1 -0
- package/dist/client/assets/NewDirectMessageMenu-B3DxayR2.js +1 -0
- package/dist/client/assets/{NotificationsPage-ldulSpVu.js → NotificationsPage-BavEo7VZ.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-BfEvR7s7.js → OpenMeshSwitch-BwkX2Toa.js} +2 -2
- package/dist/client/assets/{OperatorIdentityForm-ZM_zDnjM.js → OperatorIdentityForm-CtWgz2yi.js} +1 -1
- package/dist/client/assets/{PermissionHistory-liL_pJDR.js → PermissionHistory-DvM0F2bS.js} +1 -1
- package/dist/client/assets/{PermissionsPage-DFMjDQby.js → PermissionsPage-D1DJHezV.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-CITFG0_N.js → PersonalityPopover-BV-9wfIl.js} +1 -1
- package/dist/client/assets/PhotoPage-BHvRQnex.js +1 -0
- package/dist/client/assets/{PresetPicker-CpYu7nb6.js → PresetPicker-BOQKgYAK.js} +2 -2
- package/dist/client/assets/{PreviewRefusedNotice-CF3bzfSe.js → PreviewRefusedNotice-BdhUln2h.js} +1 -1
- package/dist/client/assets/{ProfileFields-D4p6bhIa.js → ProfileFields-DFRnRR38.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-XCuCnd1t.js → ProfilePanelContainer-CkxX9Dps.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-qRf3DSdk.js → ProfileRolePicker-BSYi_luB.js} +1 -1
- package/dist/client/assets/PromptSuggestionChips-r08GqBH1.js +1 -0
- package/dist/client/assets/{ReportsToPopover-Cu-Cnzij.js → ReportsToPopover-BcsM5Eia.js} +1 -1
- package/dist/client/assets/{RoomSurface-CsAifwp2.js → RoomSurface-DaRCf4og.js} +7 -7
- package/dist/client/assets/{RoomsPage-DZYMR2in.js → RoomsPage-CQqsdVvB.js} +1 -1
- package/dist/client/assets/RunsOnPopover-DFb4xEhP.js +1 -0
- package/dist/client/assets/RuntimeConnectFlow-pKFJlNSJ.js +1 -0
- package/dist/client/assets/RuntimeSetupDialog-DvBJbrmj.js +1 -0
- package/dist/client/assets/{SessionsPage-thndqcpY.js → SessionsPage-CGgnEPh7.js} +1 -1
- package/dist/client/assets/SettingsDialog-D0cmzjrH.js +12 -0
- package/dist/client/assets/{SkillsPage-CmXyAw3J.js → SkillsPage-DDoPlsn2.js} +1 -1
- package/dist/client/assets/TaskDialogWrapper-DoIVzbKU.js +1 -0
- package/dist/client/assets/TasksEmptyState-B68O6dnT.js +3 -0
- package/dist/client/assets/{TasksPage-DGNXrDAk.js → TasksPage-BsBDphim.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-CIfFRo6-.js → TeamComputerEntry-CoQ4EsDm.js} +1 -1
- package/dist/client/assets/{ToolsPage-BKZkSarf.js → ToolsPage-Cl1aOpev.js} +2 -2
- package/dist/client/assets/{TopologyGraph-og2tlLj7.js → TopologyGraph-D3CxaLGX.js} +2 -2
- package/dist/client/assets/TourHost-4O6TJzc-.js +1 -0
- package/dist/client/assets/{UnlinkDialog-BTYC_Sit.js → UnlinkDialog-DIMY60Fi.js} +1 -1
- package/dist/client/assets/WidgetErrorCard-CzWw_SPD.js +108 -0
- package/dist/client/assets/_shell-BRH2Y-U-.js +80 -0
- package/dist/client/assets/{_shell._home-CP7HQ7Cs.js → _shell._home-DG3Vw7S5.js} +1 -1
- package/dist/client/assets/_shell._home.activity-COI96oAO.js +1 -0
- package/dist/client/assets/_shell._home.index-CTwsTjcQ.js +3 -0
- package/dist/client/assets/_shell._home.tasks-DOVoPYaf.js +1 -0
- package/dist/client/assets/{_shell._home.workspaces-Cdsw2-jI.js → _shell._home.workspaces-ApZhnjwy.js} +1 -1
- package/dist/client/assets/_shell.channels-CRkJHU5R.js +10 -0
- package/dist/client/assets/{_shell.connections-sF5vS-Lm.js → _shell.connections-bhAK3jnE.js} +1 -1
- package/dist/client/assets/{_shell.feedback-requests-hu21WXyA.js → _shell.feedback-requests-k43R8-rW.js} +2 -2
- package/dist/client/assets/_shell.marketplace-DGN_IdZY.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-2YMpLInp.js +1 -0
- package/dist/client/assets/_shell.session-D871zZl3.js +61 -0
- package/dist/client/assets/{_shell.team-raG7wRwF.js → _shell.team-DHCM1QoO.js} +6 -6
- package/dist/client/assets/_shell.x._extensionId-D3-n5IRW.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-D3-n5IRW.js +1 -0
- package/dist/client/assets/{access-copy-CcG3wpsK.js → access-copy-BVzi1REx.js} +1 -1
- package/dist/client/assets/{banner-nt7EFLr6.js → banner-3xXXsU5J.js} +2 -2
- package/dist/client/assets/{card-B_zeSZiU.js → card-Bt6IU-Bh.js} +1 -1
- package/dist/client/assets/{command-CDfYcQI6.js → command-CWokzKS1.js} +1 -1
- package/dist/client/assets/{cpu-D861493C.js → cpu-BzByzE9V.js} +1 -1
- package/dist/client/assets/{empty-state-CQ1oXLFa.js → empty-state-BgnQDiMZ.js} +1 -1
- package/dist/client/assets/{execution-config-on8kVvnW.js → execution-config-D5-SEt2t.js} +1 -1
- package/dist/client/assets/{file-Bwo21EVR.js → file-VHDTQub2.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-BedYLbs2.js → file-exclamation-point-DbWvGys0.js} +1 -1
- package/dist/client/assets/{file-text-BTj3WyHS.js → file-text-BAhi2zct.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-B8fM5rIs.js → find-latest-widget-fence-Z0HPVqeK.js} +2 -2
- package/dist/client/assets/{form-lSBktWDn.js → form-Blrb1xBU.js} +1 -1
- package/dist/client/assets/{format-cron-W7G0In8e.js → format-cron-lKWqEmle.js} +1 -1
- package/dist/client/assets/{git-branch-CKlZ81Bg.js → git-branch-BObm8Rlz.js} +1 -1
- package/dist/client/assets/{heart-BSVjeGLA.js → heart-Du7nuefC.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-Ct8vmPkj.js → highlighted-body-KPVGNVTW-B_GO7V1P.js} +1 -1
- package/dist/client/assets/image-lightbox-BZ1TV3mN.js +1 -0
- package/dist/client/assets/image-off-hnjcBIzN.js +6 -0
- package/dist/client/assets/{index-6pYWHTBx.js → index-1I8qHZDt.js} +1 -1
- package/dist/client/assets/{index-CeZ13dpH.js → index-4GC2fkeO.js} +1 -1
- package/dist/client/assets/index-4PAAWURd.js +1 -0
- package/dist/client/assets/{index-CaKe9EaL.js → index-B0tAedq7.js} +1 -1
- package/dist/client/assets/{index-BVedye9r.js → index-BP68J4pb.js} +1 -1
- package/dist/client/assets/{index-gbNK9zj5.js → index-BUOcbPfv.js} +3 -3
- package/dist/client/assets/{index-DShrfGYE.js → index-BVKXIbLh.js} +1 -1
- package/dist/client/assets/{index-CeeHkxIC.js → index-BaRQVgiN.js} +1 -1
- package/dist/client/assets/{index-B-C_A3lP.js → index-BeVbHOwX.js} +2 -2
- package/dist/client/assets/{index-KaSZDcGa.js → index-BgzgdvDn.js} +1 -1
- package/dist/client/assets/{index-C0TknRcB.js → index-Bm0z9mHt.js} +1 -1
- package/dist/client/assets/{index-bvqpTKLz.js → index-BnNTKsbt.js} +1 -1
- package/dist/client/assets/{index-DjI5vH_U.js → index-BtbZpz4b.js} +1 -1
- package/dist/client/assets/{index-D7kjWnlR.js → index-BvjuGXcS.js} +1 -1
- package/dist/client/assets/{index-7Fd_Eeda.js → index-C60RrnTd.js} +1 -1
- package/dist/client/assets/{index-CQrM6oF9.js → index-CBm3whA-.js} +1 -1
- package/dist/client/assets/{index-C96eZrOR.js → index-CCg7yRe1.js} +1 -1
- package/dist/client/assets/{index-Dh8D-3Sb.js → index-CQCN6kWR.js} +1 -1
- package/dist/client/assets/index-Cdyszxoa.js +17 -0
- package/dist/client/assets/index-Ch-ON5gw.js +1 -0
- package/dist/client/assets/{index-UNxDevG6.js → index-Ci74HAFs.js} +1 -1
- package/dist/client/assets/{index-Dq4bx2np.js → index-CiQxS4Bn.js} +1 -1
- package/dist/client/assets/{index-DEOzZEcu.js → index-CqoIjNC2.js} +3 -3
- package/dist/client/assets/index-CrflCTqO.css +1 -0
- package/dist/client/assets/index-D5TZCu8j.js +1 -0
- package/dist/client/assets/{index-CNnnXzI4.js → index-D6y4WeTi.js} +1 -1
- package/dist/client/assets/{index-BjTJ6p2k.js → index-DB8TDRSm.js} +1 -1
- package/dist/client/assets/index-DCOOlbEt.js +1 -0
- package/dist/client/assets/index-DHYvT3nr.js +23 -0
- package/dist/client/assets/{index-GINKfP45.js → index-DRea_Gi0.js} +1 -1
- package/dist/client/assets/index-Dain_3cO.js +1 -0
- package/dist/client/assets/index-Dc5cpBoO.js +1023 -0
- package/dist/client/assets/{index-DOuj--Yi.js → index-Df7a-2P5.js} +1 -1
- package/dist/client/assets/{index-BHt5KOZA.js → index-DkhM0fDi.js} +1 -1
- package/dist/client/assets/{index-CCWSicoJ.js → index-DoMJUxt_.js} +1 -1
- package/dist/client/assets/{index-09EqfhW0.js → index-EZHlD3gf.js} +1 -1
- package/dist/client/assets/{index-SdTS2P3x.js → index-HxT_wkaZ.js} +1 -1
- package/dist/client/assets/{index-RFknyjho.js → index-Lh82Rz5C.js} +1 -1
- package/dist/client/assets/{index-DgRqCuFH.js → index-WxtASL5_.js} +1 -1
- package/dist/client/assets/{index-CF73kwtO.js → index-_5Dn0bFm.js} +17 -17
- package/dist/client/assets/{index-V_EcsvR4.js → index-aXm0xP_2.js} +1 -1
- package/dist/client/assets/{index-DeNVXdMl.js → index-ox3ce99A.js} +1 -1
- package/dist/client/assets/{index-BdrbKBym.js → index-r_O6CmXY.js} +1 -1
- package/dist/client/assets/index.esm-DXsF3Bua.js +41 -0
- package/dist/client/assets/{inline-code-Beal0546.js → inline-code-DAEoWvTf.js} +1 -1
- package/dist/client/assets/{layers-DUfQMkMa.js → layers-CsM34LRv.js} +1 -1
- package/dist/client/assets/{lightbulb-DTSn-mNB.js → lightbulb-B8JAixK_.js} +1 -1
- package/dist/client/assets/{link-2-CHr2s4m2.js → link-2-Csc6okl3.js} +1 -1
- package/dist/client/assets/{list-runtime-types-CwEp9Lg4.js → list-runtime-types-DQrZNB7x.js} +1 -1
- package/dist/client/assets/markdown-content-DPc7aD1j.js +1 -0
- package/dist/client/assets/{mention-pill-XE9mX9G8.js → mention-pill-8P_w4muj.js} +1 -1
- package/dist/client/assets/{message-square-off-DUkKSITA.js → message-square-off-D5DXu2cY.js} +1 -1
- package/dist/client/assets/{more-details-3dDtVYc6.js → more-details-DEeu2M-p.js} +1 -1
- package/dist/client/assets/{owner-notice-BKmuWRki.js → owner-notice-BW4k1ycg.js} +1 -1
- package/dist/client/assets/{package-DM7e-GVa.js → package-BSwwAFVm.js} +1 -1
- package/dist/client/assets/{page-container-nGewlFnj.js → page-container-CjPUNtNw.js} +1 -1
- package/dist/client/assets/{paperclip-BgXlvBBI.js → paperclip-DQaRz34E.js} +1 -1
- package/dist/client/assets/{path-input-RzOiTE45.js → path-input-CgXSYNZn.js} +1 -1
- package/dist/client/assets/plug-BaUXMfIl.js +11 -0
- package/dist/client/assets/primer-trigger-DHB0vilf.js +3 -0
- package/dist/client/assets/{profile-errors-CFZN0y6a.js → profile-errors-JW2XTgia.js} +1 -1
- package/dist/client/assets/{progress-Cvnh4Qcr.js → progress-CErAw8zp.js} +1 -1
- package/dist/client/assets/{query-error-state-CfJfYpa3.js → query-error-state-BFWpEXsl.js} +1 -1
- package/dist/client/assets/{radio-BOcAjXVO.js → radio-Bkx216ga.js} +1 -1
- package/dist/client/assets/registry-Ce1VRIS3.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-Cvb7RGjg.js → relay-trace-schemas-DiZj_AFV.js} +2 -2
- package/dist/client/assets/{room-files-source-B-ZJA_NM.js → room-files-source-BilZvdpf.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-vRQP4hWE.js → rotate-ccw-clock-D_SO1stN.js} +1 -1
- package/dist/client/assets/{rotate-cw-DD2nOAQ-.js → rotate-cw-C68kM23F.js} +1 -1
- package/dist/client/assets/{scroll-area-DTvv8_DS.js → scroll-area-CVWFUmJV.js} +1 -1
- package/dist/client/assets/{search-x-Ig8nk-DU.js → search-x-BTFVvyA2.js} +1 -1
- package/dist/client/assets/{shield-check-DjnWx7aT.js → shield-check-Dpxi6WqO.js} +1 -1
- package/dist/client/assets/{shield-x-BrtccpM7.js → shield-x-CdCCgyXk.js} +1 -1
- package/dist/client/assets/signed-in-BxAnDo0S.js +1 -0
- package/dist/client/assets/{soul-file-C5mMIP4v.js → soul-file-CRfKVJX3.js} +1 -1
- package/dist/client/assets/{table-Rll_Jxd8.js → table-BL3xUC41.js} +1 -1
- package/dist/client/assets/{terminal-Bjss9oke.js → terminal-u_UCRzSM.js} +1 -1
- package/dist/client/assets/{trust-posture-Dmk2WlZv.js → trust-posture-B-v4BWo7.js} +1 -1
- package/dist/client/assets/{unplug-BHYMc4ND.js → unplug-CFbC-L5W.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-BmIVQhjE.js → unverified-catalog-notice-ZUqscVFM.js} +1 -1
- package/dist/client/assets/{use-adapter-catalog-RzlxX2Wa.js → use-adapter-catalog-Z4MDWZAZ.js} +1 -1
- package/dist/client/assets/{use-bindings-Ds_MAC67.js → use-bindings-CsTavmf-.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-ckA_eZQS.js → use-composer-prefs-BY2dTvep.js} +1 -1
- package/dist/client/assets/{use-connector-management-oEqok0QG.js → use-connector-management-L9l21yTi.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-Clu9Sz2-.js → use-deep-link-scroll-Bn2ZUtDY.js} +1 -1
- package/dist/client/assets/{use-delete-binding-B_zHPcy8.js → use-delete-binding-DLvdHtPD.js} +1 -1
- package/dist/client/assets/{use-dev-links-BO7-IHe9.js → use-dev-links-DFvL8mIg.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-7lRWtn7J.js → use-external-adapter-catalog-Be57G4tz.js} +1 -1
- package/dist/client/assets/{use-full-activity-feed-DrcMJL9m.js → use-full-activity-feed-Cp3lYXdi.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-DmekpHAF.js +1 -0
- package/dist/client/assets/use-is-hub-el7LTkg3.js +1 -0
- package/dist/client/assets/{use-jump-back-in-Dav0ttfs.js → use-jump-back-in-ChH1FSEK.js} +3 -3
- package/dist/client/assets/{use-local-browser-CtltDlof.js → use-local-browser-zA8gMhcC.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-CiS9XQsg.js → use-mesh-topology-CvoD-L1G.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-DuK0vm9N.js → use-mounted-ref-Ch0wqQry.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-Chf4UNbq.js → use-notification-prefs-DeR05zhp.js} +1 -1
- package/dist/client/assets/{use-panel-tab-placements-C5y831aL.js → use-panel-tab-placements-DdjrmaoK.js} +1 -1
- package/dist/client/assets/use-pending-read-DBpte0GI.js +1 -0
- package/dist/client/assets/use-personality-commit-qQfISO2-.js +1 -0
- package/dist/client/assets/use-promo-activation-CwGoE7b-.js +11 -0
- package/dist/client/assets/{use-promo-dismissals-8-hGry_v.js → use-promo-dismissals-BBqVN4hx.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-CWudgqNc.js → use-pulse-freshness-BKW7tjvX.js} +1 -1
- package/dist/client/assets/{use-relay-config-8mXfegbP.js → use-relay-config-D5iieBXl.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-DgEWUsoP.js → use-room-follow-claim-BwZh2ZPH.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-CXy0Hv5J.js → use-roving-tab-list-Ct7yDAUE.js} +1 -1
- package/dist/client/assets/use-session-canvas-CJrfZrYG.js +24 -0
- package/dist/client/assets/{use-session-diagnostics-LKiXub1H.js → use-session-diagnostics-Dn-Wnyhh.js} +4 -4
- package/dist/client/assets/{use-unclaimed-chats-Cr812OTh.js → use-unclaimed-chats-M-c5tjXH.js} +1 -1
- package/dist/client/assets/use-update-config-DhlbZldm.js +1 -0
- package/dist/client/assets/{useMutationState-BnXJ-0A_.js → useMutationState-Cd-VqRAv.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261017113300_session_public_computer.sql +1 -0
- package/dist/drizzle/meta/20261017113300_snapshot.json +14020 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/server/index.js +128843 -121508
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/AdapterSetupWizard-DfNJz5SD.js +0 -2
- package/dist/client/assets/AppearancePage-8ALtWGZZ.js +0 -1
- package/dist/client/assets/AttentionSignalRow-c-u1cE1l.js +0 -1
- package/dist/client/assets/CanvasFileContent-BJ39nHuR.js +0 -2
- package/dist/client/assets/CanvasModel3dContent-TaunlbT2.js +0 -2
- package/dist/client/assets/HandlePage-CfeEzfDk.js +0 -1
- package/dist/client/assets/KeyEntry-CEbe5Xvn.js +0 -6
- package/dist/client/assets/McpSigninBody-CLZFoQgC.js +0 -1
- package/dist/client/assets/NamePage-B4YrH-ug.js +0 -1
- package/dist/client/assets/NewDirectMessageMenu-Co9Uv5t5.js +0 -1
- package/dist/client/assets/PhotoPage-DYDJPBfu.js +0 -1
- package/dist/client/assets/PromptSuggestionChips-CUwLk83h.js +0 -1
- package/dist/client/assets/RunsOnPopover-CTBEMstG.js +0 -1
- package/dist/client/assets/RuntimeConnectFlow-DY4sjRgN.js +0 -1
- package/dist/client/assets/RuntimeSetupDialog-DJu_-eNa.js +0 -1
- package/dist/client/assets/SettingsDialog-CKmcLF66.js +0 -12
- package/dist/client/assets/TaskDialogWrapper-Boxr_hgF.js +0 -1
- package/dist/client/assets/TasksEmptyState-CQf1YroK.js +0 -3
- package/dist/client/assets/TourHost-DzEG8bZP.js +0 -1
- package/dist/client/assets/WidgetErrorCard-CT4sl_T6.js +0 -108
- package/dist/client/assets/_shell-BDlkTSin.js +0 -90
- package/dist/client/assets/_shell._home.activity-DGXa_ouh.js +0 -1
- package/dist/client/assets/_shell._home.index-D5kOfqnL.js +0 -3
- package/dist/client/assets/_shell._home.tasks-BSMD-atB.js +0 -1
- package/dist/client/assets/_shell.channels-B4VQ7tiZ.js +0 -10
- package/dist/client/assets/_shell.marketplace-B-T-ALMv.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-Chu-9-Vi.js +0 -1
- package/dist/client/assets/_shell.session-Bz6wvDBp.js +0 -66
- package/dist/client/assets/_shell.x._extensionId-DSqMu6Ey.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-DSqMu6Ey.js +0 -1
- package/dist/client/assets/index-BDCqg2iM.css +0 -1
- package/dist/client/assets/index-C8-dwIPp.js +0 -1018
- package/dist/client/assets/index-CAv_6Po4.js +0 -1
- package/dist/client/assets/index-ClELcMX1.js +0 -1
- package/dist/client/assets/index-CrEyJcPM.js +0 -17
- package/dist/client/assets/index-DQJM5kjJ.js +0 -1
- package/dist/client/assets/index-DURo45pu.js +0 -1
- package/dist/client/assets/index-sfSRuIXm.js +0 -23
- package/dist/client/assets/markdown-content-GoymYcRL.js +0 -1
- package/dist/client/assets/primer-trigger-B60oEVY7.js +0 -3
- package/dist/client/assets/registry-B9wsS5De.js +0 -1
- package/dist/client/assets/use-is-below-desktop-BhzXZsbH.js +0 -1
- package/dist/client/assets/use-pending-read-i6TB4gGQ.js +0 -1
- package/dist/client/assets/use-personality-commit-KKJ2ve1V.js +0 -1
- package/dist/client/assets/use-promo-activation-D45fuXdT.js +0 -11
- package/dist/client/assets/use-session-canvas-CUvHGgMf.js +0 -64
- package/dist/client/assets/use-update-config-Bad4g6mB.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: 61079069 bytes
|
|
4
|
+
sha256: 675e8e226692811aa34bccc18e63dae49da8f7e68b4adaa6941c0f732604a796
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dorkos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.120.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/db": "0.0.0",
|
|
86
85
|
"@dorkos/browser": "0.0.0",
|
|
86
|
+
"@dorkos/client": "0.0.0",
|
|
87
|
+
"@dorkos/db": "0.0.0",
|
|
87
88
|
"@dorkos/eslint-config": "0.0.0",
|
|
89
|
+
"@dorkos/server": "0.0.0",
|
|
88
90
|
"@dorkos/harness": "0.0.0",
|
|
89
91
|
"@dorkos/shared": "0.0.0",
|
|
90
|
-
"@dorkos/server": "0.0.0",
|
|
91
|
-
"@dorkos/typescript-config": "0.0.0",
|
|
92
92
|
"@dorkos/marketplace": "0.0.0",
|
|
93
|
-
"@dorkos/
|
|
93
|
+
"@dorkos/typescript-config": "0.0.0"
|
|
94
94
|
},
|
|
95
95
|
"scripts": {
|
|
96
96
|
"build": "tsx scripts/build.ts",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a1 as be,a3 as Ne,a4 as ze,j as e,bd as qe,be as Ee,r as m,cS as ie,gZ as Te,cT as oe,gI as le,$ as $e,Q as ce,R as de,g_ as ue,T as he,U as pe,bw as K,O as J,g$ as me,h0 as Me,G as I,dP as X,dQ as Z,dR as ee,dS as se,dT as te,I as re,dX as xe,J as We,bv as Ve,B as k,h1 as Se,dY as Pe,dW as ae,x as ke,bb as Re,ba as De,a0 as Oe,ak as ge,h2 as Le,h3 as _e,h4 as Ge,h5 as Ie,h6 as Qe,cu as Ue,a7 as G,en as He,eo as Ye,ep as Ke,eq as Je,er as Xe,es as Ze,h7 as fe,h8 as H}from"./index-C8-dwIPp.js";import{B as es}from"./use-bindings-Ds_MAC67.js";import{M as Q}from"./markdown-content-GoymYcRL.js";import{a as ss,b as ts,c as rs}from"./use-adapter-catalog-RzlxX2Wa.js";import{u as as}from"./form-lSBktWDn.js";import{a as ns}from"./BindingDialog-8xnsM47D.js";import"./relay-trace-schemas-Cvb7RGjg.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(Te,{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($e,{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(J.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(Z,{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(Me,{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(J.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(qe,{children:e.jsx(Ee,{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(We,{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(Pe,{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(Re,{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(De,{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(Z,{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(Z,{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(Le,{open:s,onOpenChange:t,children:e.jsxs(_e,{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 Y(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,R]=m.useState(""),[$,D]=m.useState("per-chat"),E=ss(),z=ts(),S=rs(),M=ns(),{data:F}=Ue(),w=be(),q=Ne(),T=(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()=>{}}),W=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 W)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,W]),L=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:Y(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]),P=m.useCallback(async p=>{try{return await w.removeRelayAdapter(p),!0}catch{return!1}finally{q.invalidateQueries({queryKey:["relay"]})}},[w,q]),U=m.useCallback(()=>{const p=j.state.values,g=Y(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}E.mutate({type:s.type,id:h,config:u},{onSuccess:()=>{M.mutate({adapterId:h,agentId:c,sessionStrategy:$,label:""},{onSuccess:()=>{var A;const f=((A=T.find(_=>_.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"),P(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,_,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."}):((_=f.message)!=null&&_.includes("duplicate")||(ne=f.message)!=null&&ne.includes("exists"))&&(n("configure"),b(0))}})},[j,l,t,z,E,M,s,h,x,c,$,T,P,r]),Ce=m.useCallback(p=>{p||(n(l?"configure":"agent"),b(0),y(""),C(""),R(""),D("per-chat"),v(!1),j.reset(),S.reset()),r(p)},[r,j,S,l]),Ae=m.useCallback(()=>{S.mutate({type:s.type,config:Y(j.state.values)})},[S,s.type,j]),Fe=E.isPending||z.isPending||M.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:W,bindAgentId:c,setBindAgentId:R,bindStrategy:$,setBindStrategy:D,agentOptions:T,isSaving:Fe,hasSetupSteps:B,setupStepIndex:d,currentSetupStep:Be,testConnection:S,handleContinue:L,handleBack:V,handleSave:U,handleOpenChange:Ce,handleRetryTest:Ae}}function qs({open:s,onOpenChange:t,manifest:a,existingInstance:r,existingAdapterIds:l=[]}){var L;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:R,bindStrategy:$,setBindStrategy:D,agentOptions:E,isSaving:z,hasSetupSteps:S,setupStepIndex:M,currentSetupStep:F,testConnection:w,handleContinue:q,handleBack:T,handleSave:B,handleOpenChange:j,handleRetryTest:W}=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(He,{open:s,onOpenChange:j,children:e.jsxs(Ye,{className:"flex max-h-[85vh] max-w-lg flex-col",children:[e.jsxs(Ke,{children:[e.jsx(Je,{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(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[n==="agent"&&e.jsx(xs,{agentOptions:E,agentId:c,onAgentIdChange:R,strategy:$,onStrategyChange:D}),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:(L=w.error)==null?void 0:L.message,botUsername:y,onRetry:W}),n==="confirm"&&e.jsx(N.Subscribe,{selector:V=>V.values,children:V=>{var P;return e.jsx(ms,{manifest:a,adapterId:v,isEditMode:o,values:V,botUsername:y,agentName:((P=E.find(U=>U.id===c))==null?void 0:P.name)||c})}})]},n)})]}),e.jsxs(Ze,{className:"flex items-center justify-between sm:justify-between",children:[e.jsxs("div",{children:[(n==="test"||n==="confirm")&&e.jsxs(k,{variant:"ghost",onClick:T,disabled:z,children:[e.jsx(fe,{className:"mr-1 size-4"}),"Back"]}),n==="configure"&&(S?M>0:!o)&&e.jsxs(k,{variant:"ghost",onClick:T,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:q,disabled:!c,children:["Continue",e.jsx(H,{className:"ml-1 size-4"})]}),n==="configure"&&e.jsxs(k,{onClick:q,children:["Continue",e.jsx(H,{className:"ml-1 size-4"})]}),n==="test"&&!w.isPending&&!w.isSuccess&&e.jsx(k,{variant:"ghost",onClick:q,children:"Skip"}),n==="test"&&w.isSuccess&&e.jsxs(k,{onClick:q,children:["Continue",e.jsx(H,{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{qs as A,zs as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,cL as F,cM as G,G as b,O as f,bw as v,cN as U,cO as $,cP as B,J as D,r as u,cQ as E,B as W,X as V,cR as J,b as q,e as K,t as Q,g as X}from"./index-C8-dwIPp.js";import{u as Y,P as Z}from"./use-personality-commit-KKJ2ve1V.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-C5mMIP4v.js";const H={hidden:{},visible:{transition:{staggerChildren:.04}}},O={hidden:{opacity:0,scale:.5},visible:{opacity:1,scale:1,transition:{type:"spring",stiffness:500,damping:25}}};function I(){return e.jsx(f.span,{className:"pointer-events-none absolute inset-0 flex items-center justify-center",initial:{scale:0,opacity:1},animate:{scale:1,opacity:0},transition:{duration:.6,ease:[.34,1.56,.64,1]},"aria-hidden":!0,children:e.jsx(D,{className:"size-4 text-white drop-shadow-md",strokeWidth:3})})}function _({celebratory:s,className:t,children:a}){return s?e.jsx(f.div,{className:t,variants:H,initial:"hidden",animate:"visible",children:a}):e.jsx("div",{className:t,children:a})}function A({celebratory:s,children:t}){return s?e.jsx(f.div,{variants:O,children:t}):t}const ee=e.jsx("span",{className:"text-3xs leading-none font-bold",children:"A"}),te="ring-muted-foreground/50 ring-dashed ring-2 ring-offset-2",se="Select default color";function ae({value:s,autoColor:t,onSelect:a,onHoverChange:i,justSelectedKey:o,celebratory:n=!1,autoIcon:r=ee,autoActiveRing:c=te,autoLabel:d=se}){const x=s!=null;return e.jsxs(_,{celebratory:n,className:"flex flex-wrap items-center gap-2",children:[e.jsx(A,{celebratory:n,children:e.jsx(T,{active:!x,activeRing:c,color:t,label:d,tooltip:"Unique, derived from agent name",onClick:()=>a(null),onHoverChange:i,justSelected:o==="auto",celebratory:n,children:r})}),e.jsx("div",{className:"bg-border mx-0.5 h-5 w-px"}),F.map(l=>e.jsx(A,{celebratory:n,children:e.jsx(T,{active:s===l.hex,activeRing:"ring-foreground ring-2 ring-offset-2",color:l.hex,label:`Select ${l.name}`,tooltip:l.name,onClick:()=>a(l.hex),onHoverChange:i,justSelected:o===l.hex,celebratory:n})},l.hex))]})}function T({active:s,activeRing:t,color:a,label:i,tooltip:o,tooltipSide:n="bottom",onClick:r,onHoverChange:c,justSelected:d,celebratory:x,children:l}){const h=e.jsxs("button",{type:"button",onClick:r,onMouseEnter:()=>c==null?void 0:c(a),onMouseLeave:()=>c==null?void 0:c(null),className:b("group/swatch relative size-8 rounded-full transition-[scale,box-shadow] duration-150",s?t:"hover:scale-110"),style:{backgroundColor:a},"aria-label":i,children:[l&&e.jsx("span",{className:"bg-background/80 text-foreground absolute inset-0 flex items-center justify-center rounded-full",children:l}),x&&e.jsx("span",{className:"absolute inset-[-4px] -z-10 rounded-full opacity-0 blur-md transition-opacity duration-200 group-hover/swatch:opacity-50",style:{backgroundColor:a},"aria-hidden":!0}),e.jsx(v,{children:d&&e.jsx(I,{})})]});return x?e.jsxs(U,{children:[e.jsx($,{asChild:!0,children:h}),e.jsx(B,{side:n,className:"text-3xs",children:o})]}):h}function ne({value:s,autoEmoji:t,hasOverride:a,onSelect:i,justSelectedKey:o,celebratory:n=!1}){return e.jsx(_,{celebratory:n,className:"grid grid-cols-6 gap-1.5",children:G.map(r=>{const c=r===s,d=r===t&&!a,x=b("relative flex size-9 items-center justify-center rounded-md text-lg transition-colors duration-150",c?b(d?"bg-accent ring-muted-foreground/50 ring-1":"bg-accent ring-foreground ring-1",d&&!n&&"ring-dashed"):"hover:bg-accent/50 active:scale-90");return e.jsx(ie,{celebratory:n,onClick:()=>i(r),className:x,ariaLabel:`Select icon ${r}`,justSelected:o===`emoji-${r}`,children:r},r)})})}function ie({celebratory:s,onClick:t,className:a,ariaLabel:i,justSelected:o,children:n}){const r=e.jsx(v,{children:o&&e.jsx(I,{})});return s?e.jsxs(f.button,{type:"button",onClick:t,className:a,"aria-label":i,variants:O,whileHover:{scale:1.25},whileTap:{scale:.85},transition:{type:"spring",stiffness:500,damping:20},children:[n,r]}):e.jsxs("button",{type:"button",onClick:t,className:a,"aria-label":i,children:[n,r]})}const re=e.jsx(J,{className:"size-3"}),oe="ring-muted-foreground/50 ring-2 ring-offset-2",ce="Select unique auto-generated color",C="dorkos:avatar-first-customization",le={hidden:{},visible:{transition:{staggerChildren:.04}}},w={hidden:{opacity:0,y:4},visible:{opacity:1,y:0,transition:{duration:.2,ease:"easeOut"}}};function ue(){const[s]=u.useState(()=>Array.from({length:14},(a,i)=>{const o=Math.PI*2*i/14,n=28+Math.random()*20,r=360*i/14;return{x:Math.cos(o)*n,y:Math.sin(o)*n,size:3+Math.random()*3,hue:r,delay:i*.02}}));return e.jsx("div",{className:"pointer-events-none absolute inset-0 z-50 overflow-visible","aria-hidden":!0,children:s.map((t,a)=>e.jsx(f.span,{className:"absolute top-1/2 left-1/2 rounded-full",style:{width:t.size,height:t.size,background:`hsl(${t.hue}, 80%, 70%)`,boxShadow:`0 0 6px hsl(${t.hue}, 80%, 70%)`},initial:{x:"-50%",y:"-50%",scale:0,opacity:1},animate:{x:t.x,y:t.y,scale:1,opacity:0},transition:{duration:.6,ease:"easeOut",delay:t.delay}},a))})}function de({agent:s,onUpdate:t,onPreviewColor:a,title:i,onClose:o}){const n=u.useMemo(()=>E(s.id),[s.id]),r=n.color,c=n.icon,d=s.icon??c,x=s.color!=null,l=s.icon!=null,h=x||l,[y,S]=u.useState(null),p=u.useRef(null),[R,k]=u.useState(!1),N=u.useRef(!1);u.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const g=u.useCallback(()=>{if(!N.current){try{if(localStorage.getItem(C))return;localStorage.setItem(C,"true")}catch{return}N.current=!0,k(!0),setTimeout(()=>k(!1),800)}},[]),j=u.useCallback(m=>{p.current&&clearTimeout(p.current),S(m),p.current=setTimeout(()=>S(null),600)},[]),z=u.useCallback(()=>{t({color:null,icon:null})},[t]),P=u.useCallback(m=>{t({color:m}),a(null),j(m??"auto"),g()},[t,a,j,g]),L=u.useCallback(m=>{t({icon:m===c?null:m}),j(`emoji-${m}`),g()},[t,c,j,g]),M=u.useCallback(m=>{a(m)},[a]);return e.jsxs("div",{className:"flex flex-1 flex-col overflow-auto","data-testid":"avatar-picker-panel",children:[(i||o||h)&&e.jsxs("div",{className:b("flex items-center justify-between px-4 py-2",(i||o)&&"border-b"),children:[i&&e.jsx("span",{className:"text-xs font-semibold",children:i}),e.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e.jsx(v,{children:h&&e.jsx(f.button,{type:"button",onClick:z,className:"text-muted-foreground hover:text-foreground text-3xs transition-colors",initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:8},transition:{duration:.2},children:"Reset to defaults"})}),o&&e.jsx(W,{variant:"ghost",size:"icon-md",className:"size-6",onClick:o,"aria-label":"Close appearance picker",children:e.jsx(V,{className:"size-3.5"})})]})]}),e.jsxs(f.div,{className:"space-y-5 p-4",variants:le,initial:"hidden",animate:"visible",children:[e.jsxs(f.div,{variants:w,children:[e.jsx("div",{className:"text-muted-foreground text-3xs mb-2 font-medium tracking-wider uppercase",children:"Color"}),e.jsx(ae,{value:s.color,autoColor:r,onSelect:P,onHoverChange:M,justSelectedKey:y,celebratory:!0,autoIcon:re,autoActiveRing:oe,autoLabel:ce})]}),e.jsxs(f.div,{variants:w,children:[e.jsx("div",{className:"text-muted-foreground text-3xs mb-2 font-medium tracking-wider uppercase",children:"Icon"}),e.jsx(ne,{value:d,autoEmoji:c,hasOverride:l,onSelect:L,justSelectedKey:y,celebratory:!0})]})]}),e.jsx(v,{children:R&&e.jsx(ue,{})})]})}function xe({children:s}){return e.jsx("h3",{className:"text-muted-foreground text-3xs font-medium tracking-wider uppercase",children:s})}function be({member:s}){const{agent:t,isPending:a,update:i}=q(s),o=Y(t,i),[n,r]=u.useState(null);if(a)return e.jsx(K,{className:"h-64 w-full"});if(!t)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s appearance."});const c=Q(s),d=E(t.id),x=n??t.color??d.color,l=t.icon??d.icon;return e.jsxs("div",{className:"flex flex-col gap-5","data-slot":"profile-appearance",children:[e.jsx("div",{className:"flex justify-center pt-1",children:e.jsx(X,{size:"lg",kind:c.kind,color:x,emoji:l,fallback:c.fallback,origin:c.origin})}),e.jsx(de,{agent:t,onUpdate:i,onPreviewColor:r}),e.jsxs("div",{className:"space-y-2 border-t pt-4",children:[e.jsx(xe,{children:"Personality"}),e.jsx(Z,{traits:o.traits,onTraitsChange:o.onTraitsChange,compact:!0})]})]})}export{be as AppearancePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aw as r,ax as n,j as e,O as i,a0 as o,B as d}from"./index-C8-dwIPp.js";const c={initial:{opacity:0,y:8},animate:{opacity:1,y:0}};function l({signal:t}){const a=r(),s=n(t.since);return e.jsxs(i.div,{variants:c,"data-slot":"attention-signal-row",className:"hover:bg-accent/50 flex min-w-0 items-center gap-2.5 rounded-md px-2 py-1 transition-colors",children:[e.jsx("span",{className:"bg-status-error size-1.5 shrink-0 rounded-full","aria-hidden":!0}),e.jsx(o,{className:"text-status-error/70 size-3.5 shrink-0","aria-hidden":!0}),e.jsxs("span",{className:"text-foreground/90 min-w-0 flex-1 truncate text-xs",children:[t.primary,t.secondary!==void 0&&e.jsxs("span",{className:"text-muted-foreground",children:[" · ",t.secondary]})]}),e.jsx("span",{className:"text-muted-foreground shrink-0 text-xs tabular-nums",children:s}),e.jsx(d,{variant:"ghost",size:"sm",className:"relative h-6 shrink-0 px-2 text-xs after:absolute after:-inset-3 md:after:hidden","aria-label":`Open ${t.primary}`,onClick:()=>void a.navigate({href:t.deepLink}),children:"Open →"})]})}export{l as A};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-BX1bJlnT.js","assets/index-C8-dwIPp.js","assets/index-BDCqg2iM.css","assets/index-CQrM6oF9.js","assets/index-gbNK9zj5.js","assets/BlintzCanvas-DUDSNxlM.js","assets/BlintzCanvas-GgiCXV7C.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as n,aV as D,gl as re,j as t,B as S,a3 as ne,G as se,J as ae,gb as ie,gm as ce,aW as $,a1 as ue,gn as oe,a2 as le}from"./index-C8-dwIPp.js";import{u as de,a as fe}from"./use-session-canvas-CUvHGgMf.js";import{R as he}from"./rotate-cw-DD2nOAQ-.js";import"./WidgetErrorCard-CT4sl_T6.js";import"./card-B_zeSZiU.js";import"./progress-Cvnh4Qcr.js";import"./markdown-content-GoymYcRL.js";import"./table-Rll_Jxd8.js";import"./terminal-Bjss9oke.js";import"./package-DM7e-GVa.js";import"./heart-BSVjeGLA.js";import"./git-branch-CKlZ81Bg.js";import"./file-text-BTj3WyHS.js";import"./file-Bwo21EVR.js";import"./McpAppFrame-D5Muf5Sf.js";import"./more-details-3dDtVYc6.js";function O(e,i){return["canvas-file",e,i]}function ve({documentId:e,sourcePath:i,binding:j,save:o,draftRef:x,revisionRef:r,finishAttemptRef:C,timerRef:g,finalSaveRef:b,invalidateConfirmedFile:d}){const m=n.useRef({binding:j,save:o,invalidateConfirmedFile:d}),F=n.useRef(null),l=n.useRef(null);return n.useLayoutEffect(()=>{m.current={binding:j,save:o,invalidateConfirmedFile:d}}),n.useLayoutEffect(()=>{const k=D.getState().openDocuments.find(f=>f.id===e);if(!k||typeof k.openedAt!="number")return;const w=re(e,k.openedAt,i,{required:()=>!!m.current.binding,current:()=>{const f=l.current;return!!f&&f.revision===r.current&&f.attempt===C.current&&f.binding===m.current.binding&&f.save===m.current.save&&f.binding.current()},invalidateConfirmedFile:()=>m.current.invalidateConfirmedFile(),prepare:async()=>{var a;l.current=null;const{binding:f,save:_}=m.current;if(!(f!=null&&f.current()))return!1;g.current&&(clearTimeout(g.current),g.current=null);const N=x.current,y=r.current,u=++C.current,s=await _(N);return s.status!=="changed"&&s.status!=="no_op"||s.confirmed.content!==N||r.current!==y||C.current!==u||m.current.binding!==f||m.current.save!==_||!f.current()?!1:((a=b.current)==null||a.cancel(),b.current=null,l.current={revision:y,attempt:u,binding:f,save:_},!0)}});return F.current=w,()=>w.retire()},[e,i,x,r,C,g,b]),F}function pe(e,i,j){var u;const o=n.useRef(e),x=n.useRef(null),r=n.useRef(null),[C,g]=n.useState({identity:e.identity,phase:"pending",busy:!1});n.useLayoutEffect(()=>{o.current=e},[e]);const b=n.useCallback((s,a)=>{x.current===s&&o.current.identity===s&&o.current.current()&&g(h=>({identity:s,...a,historical:a.historical??(h.identity===s?h.historical:void 0)}))},[]),d=n.useCallback(s=>{x.current!==s||o.current.identity!==s||g(a=>a.identity===s?{...a,phase:"unavailable",busy:!1}:{identity:s,phase:"unavailable",busy:!1})},[]),m=e.identity,F=e.supported;n.useLayoutEffect(()=>{const s=o.current;r.current=null,x.current=m;let a=!1;return F&&i==="ready"&&s.discover().then(h=>{a||(h.status==="observed"?b(m,{phase:"ready",discovery:h.value,busy:!1}):h.status!=="idle"?b(m,{phase:"unavailable",busy:!1}):d(m))}),()=>{a=!0,r.current=null,x.current===m&&(x.current=null)}},[m,F,i,j,b,d]);const l=C.identity===e.identity?C:void 0,k=n.useCallback(async()=>{const s=o.current,a=s.identity;if(x.current!==a||!s.current())return;r.current=null,g(c=>({identity:a,phase:"pending",busy:!0,historical:c.identity===a?c.historical:void 0}));const h=await s.discover(!0);h.status==="observed"?b(a,{phase:"ready",discovery:h.value,busy:!1}):h.status!=="idle"?b(a,{phase:"unavailable",busy:!1}):d(a)},[b,d]),w=n.useCallback(async s=>{const a=o.current,h=a.identity;if(x.current!==h||!a.current())return;r.current=null,g(p=>({identity:h,phase:"pending",busy:!0,discovery:p.identity===h?p.discovery:void 0,historical:p.identity===h?p.historical:void 0}));const c=await a.recover(s);c.status==="observed"?b(h,{phase:"ready",discovery:c.value.discovery,historical:c.value.result.entry,busy:!1}):c.status!=="idle"?b(h,{phase:c.status==="local_uncertain"?"local_uncertain":"unavailable",busy:!1}):d(h)},[b,d]),f=n.useCallback(async()=>{const s=o.current,a=s.identity;if(x.current!==a||!s.current())return{status:"idle"};const h={};r.current=h,g(p=>p.identity===a?{...p,phase:"pending",busy:!0}:p);const c=await s.inspectCurrent();return r.current!==h?{status:"idle"}:(r.current=null,c.status==="idle"&&d(a),x.current===a&&o.current.identity===a&&s.current()&&c.status!=="idle"&&g(p=>p.identity===a?{...p,phase:c.status==="observed"?"ready":c.status==="local_uncertain"?"local_uncertain":"unavailable",busy:!1}:p),c)},[d]),_=e.supported&&i==="ready",N=i==="pending"?"pending":(l==null?void 0:l.phase)??"pending",y=_&&(N!=="ready"||((u=l==null?void 0:l.discovery)==null?void 0:u.admission)==="blocked");return{supported:_,phase:N,editBlocked:y,busy:(l==null?void 0:l.busy)??N==="pending",discovery:l==null?void 0:l.discovery,historical:l==null?void 0:l.historical,refresh:k,recover:w,inspectCurrent:f}}function me({recovery:e,editing:i,loadCurrent:j}){var o,x;return e.supported?t.jsxs("section",{"aria-label":"Previous file saves",className:"mx-2 mt-2 rounded border p-2 text-sm",children:[e.phase==="pending"&&t.jsx("p",{role:"status",children:"Checking previous saves…"}),e.phase==="unavailable"&&t.jsx("p",{role:"alert",children:"Previous save evidence is unavailable. New saves stay blocked until it can be checked."}),e.phase==="local_uncertain"&&t.jsx("p",{role:"alert",children:"Use Retry original save. Checking previous saves won’t confirm this save."}),((o=e.discovery)==null?void 0:o.admission)==="blocked"&&t.jsx("p",{role:"alert",children:"An unresolved original save blocks this file. This list may not include the blocking operation."}),e.discovery&&t.jsxs(t.Fragment,{children:[!e.discovery.entries.length&&t.jsx("p",{children:"No matching recent saves."}),e.discovery.hasMore&&t.jsx("p",{children:"Only the latest 25 matching saves are shown. Older evidence is omitted."}),t.jsx("ul",{children:e.discovery.entries.map(r=>t.jsxs("li",{children:[t.jsxs("span",{children:[r.eventId,":"," ",r.state==="receipt"?"Historical save recorded":r.state==="review"?"Original save needs review":r.state==="no_op"?"Original save made no change":"Original save failed before replacement"]}),r.state==="review"&&(r.reason==="prepared_without_replacement"?t.jsx("p",{children:"This save needs manual review. These controls won’t write the file."}):t.jsxs(t.Fragment,{children:[t.jsx("p",{children:"The original saved replacement must be proven before its receipt can be settled."}),t.jsx(S,{type:"button",size:"sm",variant:"ghost",disabled:e.busy||i,onClick:()=>void e.recover(r.eventId),children:"Recover original receipt"})]}))]},r.eventId))})]}),((x=e.historical)==null?void 0:x.state)==="receipt"&&t.jsxs("div",{role:"status",children:[t.jsx("p",{children:"Previous save confirmed. Your current draft may differ."}),t.jsx("p",{children:e.historical.currentFileMatch==="different"?"The current file differs from that historical save.":e.historical.currentFileMatch==="same_saved_replacement"?"The saved replacement matched when checked; current bytes still require a fresh load.":"The current file was not checked."})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(S,{type:"button",size:"sm",variant:"ghost",disabled:e.busy||i,onClick:()=>void e.refresh(),children:"Check previous saves"}),t.jsx(S,{type:"button",size:"sm",variant:"ghost",disabled:i||e.editBlocked||e.busy,onClick:j,children:"Load current file"})]}),t.jsx("p",{children:"These controls don’t resend drafts or confirm agent delivery. Use Load current file."})]}):null}const ye=n.lazy(()=>$(()=>import("./CodeMirrorEditor-BX1bJlnT.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),xe=n.lazy(()=>$(()=>import("./BlintzCanvas-DUDSNxlM.js"),__vite__mapDeps([5,1,2,4,6])).then(e=>({default:e.BlintzCanvas}))),be=500;function ge(e,i){return i==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function je(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";case"uncertain":return"Save not confirmed";default:return null}}function G({content:e,documentId:i,cwd:j,loaded:o,theme:x,isEditing:r,onEditingChange:C,setDocumentEditing:g,observedBinding:b,fileSaveObservation:d="unavailable",recoveryBinding:m}){const F=e.readOnly!==!0,l=ge(e.sourcePath,e.language),k=ne(),[w,f]=n.useState(o),[_,N]=n.useState(),y=n.useRef(b);n.useLayoutEffect(()=>{y.current=b},[b]);const u=de({documentId:i,sourcePath:e.sourcePath,cwd:j,loadedContent:o,documentSaveBinding:_,documentRecoveryBinding:m}),s=pe(u.recovery,d,m),a=n.useRef(!1),h=n.useRef(r);n.useLayoutEffect(()=>(a.current=!0,h.current=r,()=>{a.current=!1}),[r]);const c=n.useRef(null),p=n.useRef(w),L=n.useRef(0),B=n.useRef(0),E=n.useRef(u.save),I=n.useRef(u.prepareFinalSave),Q=n.useRef(u.waitForCloseDrain),z=n.useRef(null),U=n.useRef(C),H=ve({documentId:i,sourcePath:e.sourcePath,binding:_,save:u.save,draftRef:p,revisionRef:L,finishAttemptRef:B,timerRef:c,finalSaveRef:z,invalidateConfirmedFile:()=>{k.invalidateQueries({queryKey:O(j,e.sourcePath)}).catch(()=>{})}});n.useEffect(()=>{p.current=w,E.current=u.save,I.current=u.prepareFinalSave,Q.current=u.waitForCloseDrain,U.current=C});const K=n.useCallback(v=>{var R;L.current+=1,p.current=v,f(v),(R=z.current)==null||R.cancel(),z.current=I.current(v),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,E.current(p.current)},be)},[]),J=()=>{var P;if(s.editBlocked||d==="pending"||d==="ready"&&!((P=y.current)!=null&&P.current()))return;const v=y.current,R=v&&Object.freeze({...v.incarnation});N(v!=null&&v.current()&&R?{incarnation:R,current:()=>{const T=y.current;return!!T&&ce(R,T.incarnation)&&T.current()}}:void 0),L.current+=1,p.current=o,f(o),C(!0),g(i,!0)},W=async()=>{c.current&&(clearTimeout(c.current),c.current=null);const v=p.current,R=L.current,P=++B.current,T=await E.current(v);if(T.status!=="changed"&&T.status!=="no_op"||L.current!==R||B.current!==P||T.confirmed.content!==v)return;const A=T.confirmed;A.content===p.current&&k.setQueryData(O(j,e.sourcePath),M=>M&&{...M,content:A.content,hash:A.hash}),C(!1),g(i,!1)},X=()=>{k.invalidateQueries({queryKey:O(j,e.sourcePath)})};n.useEffect(()=>{var v;r||(c.current&&clearTimeout(c.current),c.current=null,(v=z.current)==null||v.cancel(),z.current=null)},[r]),n.useEffect(()=>{const v=H.current;return()=>{var T;c.current&&(clearTimeout(c.current),c.current=null);const R=(T=z.current)==null?void 0:T.flush(),P=p.current;v==null||v.settleRetirement(Promise.resolve(R).then(()=>Q.current(P))),z.current=null,g(i,!1),U.current(!1)}},[i,g,H]);const Z=async()=>{if(r||!a.current||s.editBlocked)return;const v=L.current,R=await s.inspectCurrent();R.status!=="observed"||!a.current||h.current||L.current!==v||!u.recovery.current()||k.setQueryData(O(j,e.sourcePath),P=>P&&{...P,...R.value})},ee=()=>{const v=u.adoptDisk();v!=null&&f(v)},te=()=>{u.overwrite(p.current)},V=u.status==="saved"?u.confirmedContent!==w?"Unsaved changes":u.documentReceipt?"Save recorded":"Saved to file":je(u.status),Y=r?w:o;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:[F&&V&&t.jsx("span",{className:se("mt-3 text-xs",u.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:V}),!r&&d==="pending"&&t.jsx("span",{role:"status",children:"Checking document…"}),!r&&t.jsx(S,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:X,"aria-label":"Refresh from disk",children:t.jsx(he,{className:"size-4"})}),F&&t.jsx(S,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:r?()=>void W():J,"aria-label":r?"Finish editing":"Edit file",disabled:!r&&(d==="pending"||s.editBlocked),"data-document-save-observation":d,children:r?t.jsx(ae,{className:"size-4"}):t.jsx(ie,{className:"size-4"})})]}),t.jsx(me,{recovery:s,editing:r,loadCurrent:()=>void Z()}),u.status==="uncertain"&&t.jsxs("div",{role:"status",className:"mx-2 mt-2 flex items-center gap-2 text-sm",children:[t.jsx("span",{children:"Save not confirmed. Retry the original save before saving another draft."}),t.jsx(S,{type:"button",variant:"ghost",size:"sm",onClick:()=>void u.retryUnconfirmed(),children:"Retry original save"})]}),u.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(S,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:ee,children:"Reload"}),t.jsx(S,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:te,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(n.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:l?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(xe,{value:Y,editable:r,onChange:r?K:void 0})}):t.jsx(ye,{value:Y,editable:r,filename:e.sourcePath,languageHint:e.language,theme:x,onChange:r?K:void 0})})})]})}function Ce(e){const{fileSaveBinding:i,fileSaveObservation:j}=fe(e.documentId);return t.jsx(G,{...e,observedBinding:i,recoveryBinding:i,fileSaveObservation:j})}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 qe({content:e,documentId:i}){const j=ue(),o=D(y=>y.selectedCwd),x=D(y=>y.setDocumentEditing),r=D(y=>{var u;return((u=y.openDocuments.find(s=>s.id===i))==null?void 0:u.editing)??!1}),C=oe(),g=D(y=>y.canvasSessionId),b=D(y=>y.roomCanvasLiveRoomId),{data:d,error:m,isLoading:F}=le({queryKey:O(o,e.sourcePath),enabled:o!==null,queryFn:()=>j.readFileContent(o,e.sourcePath),staleTime:3e4,retry:!1}),[l,k]=n.useState(null),w=y=>{k(y&&d?{pinnedHash:d.hash}:null)};if(o===null)return t.jsx(q,{children:"Open a chat to view files."});if(F)return t.jsx(q,{children:"Loading file…"});if(m||!d)return t.jsx(q,{children:Re(m)});const f=l!==null&&r,_=(f?l==null?void 0:l.pinnedHash:null)??d.hash,N=g&&!b?Ce:G;return t.jsx(N,{content:e,documentId:i,cwd:o,loaded:d.content,theme:C,isEditing:f,onEditingChange:w,setDocumentEditing:x},`${e.sourcePath}:${_}`)}function q({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{qe as CanvasFileContent};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-C9ODHy5I.js","assets/index-C8-dwIPp.js","assets/index-BDCqg2iM.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a1 as m,aV as n,r as o,j as t,aW as u}from"./index-C8-dwIPp.js";import{r as d}from"./use-session-canvas-CUvHGgMf.js";import"./rotate-cw-DD2nOAQ-.js";import"./WidgetErrorCard-CT4sl_T6.js";import"./card-B_zeSZiU.js";import"./progress-Cvnh4Qcr.js";import"./markdown-content-GoymYcRL.js";import"./table-Rll_Jxd8.js";import"./terminal-Bjss9oke.js";import"./package-DM7e-GVa.js";import"./heart-BSVjeGLA.js";import"./git-branch-CKlZ81Bg.js";import"./file-text-BTj3WyHS.js";import"./file-Bwo21EVR.js";import"./McpAppFrame-D5Muf5Sf.js";import"./more-details-3dDtVYc6.js";const p=o.lazy(()=>u(()=>import("./Model3dViewer-C9ODHy5I.js"),__vite__mapDeps([0,1,2])).then(e=>({default:e.Model3dViewer})));function f(e){var s;const r=(s=e.split(".").pop())==null?void 0:s.toLowerCase();return r==="glb"||r==="gltf"?"gltf":r==="stl"?"stl":r==="obj"?"obj":r==="3mf"?"3mf":r==="ply"?"ply":r==="fbx"?"fbx":r==="dae"?"dae":null}function N({content:e}){const r=m(),s=n(l=>l.selectedCwd),i=o.useMemo(()=>d(e.src,l=>r.mediaUrl(s??"",l)),[e.src,r,s]),a=o.useMemo(()=>f(e.src),[e.src]);return i.url===null||a===null?t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:"This 3D model can’t be displayed here."})}):t.jsx("div",{className:"bg-muted/40 h-full w-full",children:t.jsx(o.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading 3D viewer…"}),children:t.jsx(p,{url:i.url,format:a,label:e.title??"Canvas 3D model"})})})}export{N as CanvasModel3dContent,f as formatOf};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-C8-dwIPp.js";import{a as t}from"./ProfileFields-D4p6bhIa.js";import"./profile-errors-CFZN0y6a.js";import"./use-mounted-ref-DuK0vm9N.js";function n({member:r}){return o.jsx(t,{member:r})}export{n as HandlePage};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{W as j,a1 as i,a2 as k,aP as x,a3 as y,a4 as v,r as m,j as t,dW as b,dX as P,B as p}from"./index-C8-dwIPp.js";import{c as N}from"./connection-copy--MA7AN04.js";/**
|
|
2
|
-
* @license lucide-react v1.48.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const C={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};C.node;const R=j(C);function f(e){const n=i();return k({queryKey:x.providers(),queryFn:()=>n.getConnectorProviders(),select:e,refetchInterval:r=>{var s;return(s=r.state.data)!=null&&s.providers.some(o=>o.recheckAt!==void 0)?S:!1}})}const S=3e4,K=e=>e.providers,I=e=>e.appConnections;function q(){return f(K)}function _(){return f(I)}function L(){const e=i(),n=y();return v({mutationFn:({provider:r,secret:s})=>e.putConnectorCredential(r,s),meta:{errorLabel:"Couldn’t save the key"},onSuccess:()=>h(n)})}function w(){const e=i(),n=y();return v({mutationFn:({provider:r})=>e.deleteConnectorCredential(r),meta:{errorLabel:"Couldn’t remove the key"},onSuccess:()=>h(n)})}function h(e){e.invalidateQueries({queryKey:x.all})}function A({type:e,submitLabel:n,onSaved:r,onCancel:s}){const[o,d]=m.useState(""),a=L(),l=m.useId(),g=N(e);return t.jsxs("form",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",onSubmit:c=>{c.preventDefault();const u=o.trim();u&&a.mutate({provider:e,secret:u},{onSuccess:()=>{d(""),r==null||r()}})},children:[t.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[t.jsx(b,{htmlFor:l,className:"text-xs",children:e==="composio"?"Composio project key":`${g} API key`}),t.jsx(P,{id:l,value:o,onChange:c=>d(c.target.value),placeholder:"Paste your key",autoComplete:"off"})]}),t.jsxs("div",{className:"flex gap-2",children:[s&&t.jsx(p,{type:"button",size:"sm",variant:"ghost",onClick:s,children:"Cancel"}),t.jsx(p,{type:"submit",size:"sm",disabled:!o.trim()||a.isPending,children:a.isPending?"Saving…":n})]})]})}function z({status:e}){return t.jsxs("div",{"data-testid":`provider-card-${e.type}`,className:"space-y-2",children:[t.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:e.disclosure}),e.error&&t.jsx("p",{role:"alert",className:"text-destructive border-destructive/30 bg-destructive/5 rounded-md border px-3 py-2 text-xs leading-relaxed",children:e.error}),e.type==="composio"&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"Use the project key from your Composio dashboard."}),t.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"An account key, like the command-line tool’s, can’t run app actions."})]}),t.jsx(A,{type:e.type,submitLabel:"Save key"})]})}export{A as C,z as K,_ as a,R as b,w as c,q as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a1 as q,a3 as B,r as l,dV as K,a4 as T,a2 as Q,j as s,dW as U,I as W,dX as Y,B as b,x as z,G as S,dY as H,dZ as V,bb as X}from"./index-C8-dwIPp.js";import{S as Z}from"./shield-check-DjnWx7aT.js";const P={SIGNIN_NO_APP_REGISTRATION:"This server doesn’t let DorkOS register itself. Add your own app credentials to try again.",SIGNIN_NO_SIGNIN_SUPPORT:"This server doesn’t offer sign-in the way DorkOS expects.",SIGNIN_UNREACHABLE:"Couldn’t reach the server to start the sign-in."};function J(e){return e!==void 0&&e in P}function k(e){const{message:t,code:i,detail:c}=e;return J(i)?{message:P[i],detail:c??t??null,canUseOwnCredentials:i==="SIGNIN_NO_APP_REGISTRATION"}:{message:t??"Sign-in didn’t finish. Try again.",detail:c??null,canUseOwnCredentials:!1}}function ee(e){if(typeof e!="object"||e===null)return{};const{code:t,body:i}=e,c=typeof i=="object"&&i!==null?i.detail:void 0;return{...typeof t=="string"?{code:t}:{},...typeof c=="string"?{detail:c}:{}}}const _=2e3,F=5,se="Couldn’t check the sign-in. Retrying.",te="Couldn’t check if the sign-in finished. Try again in a moment.",j={phase:"idle",disclosure:null,authorizeUrl:null,startFailure:null,credentialsError:null,flowId:null,watching:!1};function ne(e){const t=e==null?void 0:e.toolCount;return typeof t!="number"||!Number.isFinite(t)||t<0?null:t}function re(e,t){return(e==null?void 0:e.status)==="failed"?e.error??"Sign-in didn’t finish. Try again.":t>=F?te:null}function ie(e){return{...j,phase:"failed",startFailure:k({message:e.message,...ee(e)})}}function le(e){return e===null?null:k({message:e})}function O(e){return e.flowId===null?!1:e.phase==="waiting"||e.phase==="disclosure"&&e.watching}function ae(e,t,i){return O(e)?(t==null?void 0:t.status)==="connected"?"connected":(t==null?void 0:t.status)==="failed"?"failed":e.phase!=="waiting"?e.phase:i>=F?"failed":"waiting":e.phase}function pe(e,t){const i=q(),c=B(),[o,r]=l.useState(j),h=l.useRef(0),[x,C]=l.useState(0),g=l.useRef(null),d=l.useCallback(n=>{g.current=n,h.current=0,C(0)},[]),p=l.useCallback((n,u)=>{u===g.current&&(h.current=n==="ok"?0:h.current+1,C(h.current))},[]),f=l.useCallback(()=>{c.invalidateQueries({queryKey:K.mcpServers(e)}),c.invalidateQueries({queryKey:["mcp-config"]})},[c,e]),a=T({mutationFn:()=>i.startMcpSignin(e,t),meta:{suppressErrorToast:!0}}),v=l.useCallback(()=>{d(null),r({...j,phase:"starting"}),a.mutate(void 0,{onSuccess:n=>{if(!n.alreadyConnected&&!n.authorizeUrl){r({...j,phase:"failed",startFailure:k({message:"Couldn’t make a sign-in link for this server."})});return}d(n.flowId),r({phase:n.alreadyConnected?"connected":"disclosure",disclosure:n.disclosure,authorizeUrl:n.authorizeUrl??null,startFailure:null,credentialsError:null,flowId:n.flowId,watching:!1})},onError:n=>r(ie(n))})},[a,d]),I=T({mutationFn:n=>i.setMcpClientCredentials(e,t,n),meta:{suppressErrorToast:!0}}),A=l.useCallback(n=>{r(u=>u.credentialsError===null?u:{...u,credentialsError:null}),I.mutate(n,{onSuccess:()=>{f(),v()},onError:u=>r(N=>({...N,credentialsError:u.message}))})},[I,f,v]),M=l.useCallback(n=>{g.current!==n.flowId&&(f(),d(n.flowId),r({phase:"disclosure",disclosure:n.disclosure,authorizeUrl:n.authorizeUrl,startFailure:null,credentialsError:null,flowId:n.flowId,watching:!0}))},[d]),D=l.useCallback(()=>{r(n=>n.phase==="disclosure"?{...n,phase:"waiting"}:n)},[]),G=l.useCallback(()=>{d(null),r(j)},[d]),E=Q({queryKey:["mcp-signin",e,t,o.flowId??""],queryFn:async()=>{const n=o.flowId??"";try{const u=await i.pollMcpSignin(n);return p("ok",n),u}catch(u){throw p("failed",n),u}},enabled:O(o),refetchInterval:n=>{var R;const u=(R=n.state.data)==null?void 0:R.status;if(u==="connected"||u==="failed")return!1;const N=h.current;return N===0?_:N>=F?!1:_*(N+1)},retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,gcTime:0,staleTime:0,meta:{suppressErrorToast:!0}}),w=x,y=ae(o,E.data,w);l.useEffect(()=>{y==="connected"&&f()},[y,f]);const m=O(o)?le(re(E.data,w)):o.startFailure,$=y==="waiting"&&w>0?se:null;return{state:{step:y,disclosure:o.disclosure,authorizeUrl:o.authorizeUrl,error:(m==null?void 0:m.message)??null,errorDetail:(m==null?void 0:m.detail)??null,canUseOwnCredentials:(m==null?void 0:m.canUseOwnCredentials)??!1,savingCredentials:I.isPending,credentialsError:o.credentialsError,retryNotice:$,toolCount:y==="connected"?ne(E.data):null},start:v,adopt:M,authOpened:D,useOwnCredentials:A,reset:G}}function ce({onSave:e,onCancel:t,saving:i=!1,error:c=null,className:o}){const r=l.useId(),h=l.useRef(null),[x,C]=l.useState(""),[g,d]=l.useState(""),p=x.trim(),f=g.trim();return l.useEffect(()=>{var a;(a=h.current)==null||a.focus()},[]),s.jsxs("form",{className:S("space-y-2",o),onSubmit:a=>{a.preventDefault(),!(!p||i)&&e({clientId:p,...f?{clientSecret:f}:{}})},children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(U,{htmlFor:`${r}-client-id`,className:"text-xs",children:"Client ID"}),s.jsx(W,{id:`${r}-client-id`,ref:h,value:x,onChange:a=>C(a.target.value),autoComplete:"off",spellCheck:!1,disabled:i,className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(U,{htmlFor:`${r}-client-secret`,className:"text-xs",children:["Client secret ",s.jsx("span",{className:"text-muted-foreground font-normal",children:"(if you got one)"})]}),s.jsx(Y,{id:`${r}-client-secret`,value:g,onChange:a=>d(a.target.value),autoComplete:"off",disabled:i,className:"h-8 text-xs"})]}),s.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"From the service’s developer settings. Kept encrypted here; agents never see it."}),c&&s.jsx("p",{role:"alert",className:"text-destructive text-xs leading-relaxed",children:c}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(b,{type:"submit",size:"sm",disabled:!p||i,className:"gap-1.5 focus-visible:ring-2",children:[i&&s.jsx(z,{size:"xs"}),"Save and sign in"]}),s.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:t,disabled:i,className:"focus-visible:ring-2",children:"Cancel"})]})]})}function L({children:e}){return s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[s.jsx(z,{size:"xs"}),e]})}function oe(e){return e===null?"Signed in. Its tools are available on the next turn.":`Connected · ${e} tool${e===1?"":"s"}.`}function ue(e){return`DorkOS keeps the key from ${e} here, never your agent. Removing the server deletes it.`}function de(e){const{state:t}=e;return t.step==="starting"?s.jsx(L,{children:"Starting sign-in…"}):t.step==="waiting"?s.jsxs("div",{className:"space-y-1",children:[s.jsx(L,{children:"Waiting for you to sign in… Close the tab when done."}),t.retryNotice&&s.jsx("p",{className:"text-muted-foreground text-xs",children:t.retryNotice})]}):t.step==="connected"?s.jsxs("p",{className:"text-status-success-fg flex items-center gap-2 text-xs",children:[s.jsx(X,{className:"size-3.5","aria-hidden":!0}),oe(t.toolCount)]}):null}function me({flow:e,serverName:t,className:i,failedActions:c,connectedActions:o}){const{state:r}=e,h=l.useRef(null),x=r.step==="disclosure",C=l.useRef(null),[g,d]=l.useState(!1),p=g&&r.canUseOwnCredentials;l.useEffect(()=>{var a;x&&((a=h.current)==null||a.focus())},[x]);const f=l.useRef(!1);return l.useEffect(()=>{var a;!f.current||p||(f.current=!1,(a=C.current)==null||a.focus())},[p]),s.jsxs(s.Fragment,{children:[s.jsx("div",{role:"status",className:S("[&:not(:empty)]:mt-1",i),children:de(e)}),x&&s.jsxs("div",{className:S("mt-1 space-y-2",i),children:[s.jsxs("div",{ref:h,tabIndex:-1,className:"border-status-success-border bg-status-success-bg text-status-success-fg flex items-start gap-2 rounded-md border px-3 py-2 focus-visible:ring-2",children:[s.jsx(Z,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-xs font-semibold",children:"Your sign-in stays on this computer."}),s.jsx("p",{className:"text-xs leading-relaxed",children:r.disclosure??ue(t)})]})]}),r.authorizeUrl&&s.jsx(b,{asChild:!0,size:"sm",className:"gap-1.5 focus-visible:ring-2",children:s.jsxs(H,{href:r.authorizeUrl,onOpened:()=>e.authOpened(),"aria-label":`Open the sign-in page for ${t}`,children:["Open the sign-in page",s.jsx(V,{className:"size-3.5","aria-hidden":!0})]})})]}),r.step==="failed"&&s.jsxs("div",{className:S("mt-1 space-y-2",i),children:[s.jsx("p",{role:"alert",className:"text-destructive text-xs leading-relaxed",children:r.error??"Sign-in didn’t finish. Try again."}),r.errorDetail&&s.jsxs("details",{className:"text-muted-foreground text-xs",children:[s.jsx("summary",{className:"cursor-pointer focus-visible:ring-2",children:"Details"}),s.jsx("code",{className:"text-2xs mt-1 block font-mono break-all",children:r.errorDetail})]}),p?s.jsx(ce,{onSave:a=>e.useOwnCredentials(a),onCancel:()=>{d(!1),f.current=!0},saving:r.savingCredentials,error:r.credentialsError}):s.jsxs("div",{className:"flex flex-wrap gap-2",children:[c,r.canUseOwnCredentials&&s.jsx(b,{ref:C,variant:"secondary",size:"sm",onClick:()=>d(!0),className:"focus-visible:ring-2",children:"Use your own app credentials"})]})]}),r.step==="connected"&&o&&s.jsx("div",{className:S("mt-1",i),children:o})]})}export{me as M,pe as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-C8-dwIPp.js";import{P as m}from"./ProfileFields-D4p6bhIa.js";import"./profile-errors-CFZN0y6a.js";import"./use-mounted-ref-DuK0vm9N.js";function a({member:r}){return o.jsx(m,{member:r})}export{a as NamePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a1 as b,a3 as R,a4 as j,bj as x,a7 as P,e8 as C,r as d,j as e,cx as E,cy as M,cA as k,cB as T,cC as K,du as L,dW as B,I,aD as N,B as D,bx as F,by as O,e9 as Q,f as _,bz as q,bB as z,ea as H}from"./index-C8-dwIPp.js";function w(t){return Promise.all([t.invalidateQueries({queryKey:x.lists()}),t.invalidateQueries({queryKey:x.details()}),t.invalidateQueries({queryKey:x.threads()})]).then(()=>{})}function A(t){return(t==null?void 0:t.code)==="SLUG_TAKEN"}function 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=>{A(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 X({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=A(o.error)?o.error.message:null,f=l.trim(),p=f.length>0&&f.length<=y,v=s=>{!p||o.isPending||o.mutate({title:f,agentPaths:s.map(i=>i.agentPath)},{onSuccess:i=>{n(!1),r(i)}})},S=s=>{var i;s.key==="Enter"&&(s.preventDefault(),p&&((i=c.current)==null||i.focus()))};return e.jsx(E,{open:t,onOpenChange:n,children:e.jsxs(M,{className:"sm:max-w-md",onOpenAutoFocus:s=>{var i;s.preventDefault(),(i=h.current)==null||i.focus()},children:[e.jsxs(k,{children:[e.jsx(T,{children:"New channel"}),e.jsx(K,{children:"Name it, then pick who’s in it."})]}),e.jsxs(L,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"channel-name",children:"Channel name"}),e.jsx(I,{ref:h,id:"channel-name",value:l,maxLength:y,placeholder:"Backend",autoComplete:"off",onChange:s=>{m(s.target.value),o.error&&o.reset()},onKeyDown:S,"aria-invalid":g?!0:void 0,"aria-describedby":g?"channel-name-error":void 0}),g&&e.jsx("p",{id:"channel-name-error",role:"alert",className:"text-destructive text-xs",children:g})]}),e.jsxs("section",{"aria-label":"Agents in this channel",className:"space-y-2 border-t pt-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Who’s in it"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Agents read everything here and reply when @mentioned."}),e.jsx(N,{roster:a,onSubmit:v,submitLabel:s=>s.length===0?"Create channel":s.length===1?"Create channel with 1 agent":`Create channel with ${s.length} agents`,emptyRosterMessage:"You don’t have any agents yet. You can add them to the channel later.",allChosenMessage:"That’s every agent you have.",isSubmitting:o.isPending,submitDisabled:!p,inputRef:c})]}),e.jsx("div",{className:"flex justify-center border-t pt-3",children:e.jsx(D,{type:"button",variant:"ghost",size:"sm",disabled:!p||o.isPending,onClick:()=>v([]),children:"Create it without agents"})})]})]})})}const G="One agent opens a chat. Two or more start a group message.";function V(t){return t.length===1}function W(t){const n=t[0];return n!==void 0&&V(t)?`Open chat with ${n.displayName}`:"Start group message"}function J({onStart:t,open:n,onOpenChange:r,hideTrigger:a=!1}){const l=C(),m=d.useRef(null),h=()=>{r(!1),H.getState().open()};return e.jsxs(F,{open:n,onOpenChange:r,modal:!0,fullHeight:!0,children:[e.jsx(O,{asChild:!0,children:e.jsx(Q,{...a?{"aria-hidden":!0,tabIndex:-1,className:"sr-only"}:{"aria-label":"New message"},children:e.jsx(_,{})})}),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(z,{children:"New message"}),e.jsx(N,{inputRef:m,roster:l,onSubmit:c=>{r(!1),t(c)},submitLabel:W,emptyRosterMessage:"You don’t have any agents yet.",emptyRosterAction:e.jsx(D,{type:"button",size:"sm",variant:"outline",onClick:h,children:"Create agent"}),allChosenMessage:"Everyone is already here."}),e.jsx("p",{className:"text-muted-foreground mt-2 shrink-0 px-2 text-xs",children:G})]})]})}export{X as C,J as N,G as O,V as a,W as o,U as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-C8-dwIPp.js";import{b as t}from"./ProfileFields-D4p6bhIa.js";import"./profile-errors-CFZN0y6a.js";import"./use-mounted-ref-DuK0vm9N.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,O as c,aM as l,G as i}from"./index-C8-dwIPp.js";const p=4,m={compact:"max-w-[200px] gap-1.5 px-2.5 py-1 text-xs",comfortable:"min-h-9 max-w-[280px] gap-2 px-3 py-1.5 text-sm"};function u({suggestions:o,onChipClick:s,ariaLabel:r="Suggested follow-ups",size:a="compact"}){const n=o.slice(0,p);return e.jsx(c.div,{"data-slot":"prompt-suggestion-chips",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},role:"group","aria-label":r,className:"mt-1.5 flex flex-wrap items-center gap-2",children:n.map(t=>e.jsxs("button",{type:"button","aria-label":t,title:t,onClick:()=>s(t),className:i("bg-secondary text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:ring-ring inline-flex items-center truncate rounded-md transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-offset-2",m[a]),children:[e.jsx(l,{className:i("shrink-0",a==="compact"?"size-3":"size-3.5")}),e.jsx("span",{className:"truncate",children:t})]},t))})}export{u as P};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as O,j as e,a0 as ye,bw as Ee,O as we,G as N,dI as ie,bx as ue,by as fe,bz as me,bB as xe,dJ as Te,a1 as Ae,a3 as ke,a4 as Oe,ad as pe,ar as Le,ds as he,dK as Ie,dL as De,dM as Pe,a8 as j,dN as _e,dv as H,dO as Ue,am as be,B as $e,T as Re,b as He,e as Me,dP as Be,dQ as Ke,dR as ze,dS as Qe,dT as qe,dU as Ve}from"./index-C8-dwIPp.js";import{C as ce}from"./runtime-connect-Dn0T5YWv.js";import{a as Fe,d as Ge,k as We,e as k}from"./execution-config-on8kVvnW.js";import{U as Xe}from"./unverified-catalog-notice-BmIVQhjE.js";import{s as Ye}from"./settings-for-runtime-BoOa-ZFG.js";const Je={duration:.12,ease:"easeOut"},Ze={type:"spring",stiffness:320,damping:28};function ve({isSetHere:a,serverDefault:l,onUseServerDefault:i,warning:r,className:s,"data-testid":d}){const[u,f]=O.useState(!1),o=a?"Set here":`Server default · ${l??"none"}`,n=a&&!!i,x=e.jsxs("span",{className:N("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",r?ie.warning:ie.neutral,n&&"hover:bg-accent hover:text-accent-foreground transition-colors",s),"data-testid":d,children:[r&&e.jsx(ye,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(Ee,{mode:"wait",initial:!1,children:e.jsx(we.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:Ze},exit:{opacity:0},transition:Je,children:o},o)})]});return n?e.jsxs(ue,{open:u,onOpenChange:f,children:[e.jsx(fe,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${r?`: ${r}`:""}`,children:x})}),e.jsxs(me,{className:"w-64 p-2",align:"start",children:[e.jsx(xe,{children:"Where this value comes from"}),r&&e.jsx("p",{className:N("px-2 pt-1 text-xs",Te.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{i(),f(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":d?`${d}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["Currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"Not set. Uses the built-in default."})]})]})]}):r?e.jsx("span",{title:r,"aria-label":`${o}: ${r}`,children:x}):x}const et=["agents"];function tt(a){const l=Ae(),i=ke();return Oe({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:r=>l.updateMeshAgent(r.id,r.updates),onSuccess:()=>{i.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{i.invalidateQueries({queryKey:et})}})}const ge="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function $({label:a,valueLabel:l,options:i,selected:r,isSetHere:s,serverDefault:d,warning:u,onSelect:f,onInherit:o,testId:n,showHeader:x=!0,className:C,describedBy:m,inheritText:L}){const w=pe(),[S,h]=O.useState(!1);return e.jsxs("div",{className:N("space-y-1",C),children:[x&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ge,children:a}),!w&&e.jsx(ve,{isSetHere:s,serverDefault:d,warning:u,onUseServerDefault:o,"data-testid":`${n}-chip`})]}),e.jsxs(ue,{open:S,onOpenChange:h,children:[e.jsx(fe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...m?{"aria-describedby":m}:{},"data-testid":n,children:[e.jsx("span",{className:N("truncate",u?"text-status-warning-fg":s?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(Re,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(me,{className:"w-64 p-1",align:"start",children:[e.jsx(xe,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:i.map(c=>e.jsxs("button",{type:"button","data-testid":`${n}-option-${c.value}`,onClick:()=>{f(c.value),h(!1)},className:N("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",c.value===r&&"bg-accent"),children:[c.label,c.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:c.hint})]},c.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),h(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${n}-inherit`,children:L??(d?`Use server default: ${d}`:"Use server default")})]})]})]})}function st({agent:a,onUpdate:l,className:i}){var ee,te,se,ae,ne,le,oe,re,de;const r=pe(),{data:s}=Le(),{data:d,isPending:u}=he(),f=((ee=s==null?void 0:s.executionDefaults)==null?void 0:ee.runtime)??"claude-code",o=a.runtime??f,n=(te=s==null?void 0:s.executionDefaults)==null?void 0:te.perRuntime.find(t=>t.runtime===o),{data:x}=Ie(),C=Fe(a,{defaultRuntime:f,runtimeDeclaresCredits:t=>{var b;return((b=d==null?void 0:d.capabilities[t])==null?void 0:b.credits)!==void 0},credits:(se=s==null?void 0:s.claudeCode)==null?void 0:se.credits,runtimeDefaultsToCredits:t=>{var b,A;return((A=(b=x==null?void 0:x.defaults)==null?void 0:b[t])==null?void 0:A.runsOn)==="credits"}}),{data:m,isError:L}=De({runtime:o,...C?{account:j}:{}}),w=a.model!=null,S=a.effort!=null,h=(n==null?void 0:n.model)??null,c=C&&(m??[]).some(t=>t.paidFromCredits),y=c?(m??[]).find(t=>t.isDefault):void 0,T=a.model??h??(y==null?void 0:y.value)??null,M=o==="doe"&&c&&!w&&!h,p=T?(m??[]).find(t=>t.value===T):void 0,I=(n==null?void 0:n.supportsEffort)??((ae=Ye(d,o))==null?void 0:ae.supportsEffort),B=I===void 0&&u,K=I!==!1,z=p?p.supportsEffort??!1:void 0,Q=(ne=s==null?void 0:s.claudeCode)==null?void 0:ne.accounts,{nameFor:q,creditsEntry:je,resolvedAccount:V}=Pe(),F=je??(a.account===j&&((le=s==null?void 0:s.claudeCode)!=null&&le.credits)?{path:s.claudeCode.credits.path}:null),v=Q&&[...Q.flatMap(t=>t.id===null?[]:[{id:t.id,label:q(t.path),path:t.path}]),...F?[{id:j,label:_e,path:F.path}]:[]],g=a.account??null,G=g!==null,W=o==="claude-code"&&g===j&&((oe=s==null?void 0:s.claudeCode)==null?void 0:oe.credits)!==void 0&&!s.claudeCode.credits.allowedAgents.includes(a.id),D=s!=null&&s.claudeCode&&V?q(V):null,P=tt({errorLabel:"Couldn’t change this agent’s account"}),_=O.useCallback(t=>{P.mutate({id:a.id,updates:{account:t}})},[a.id,P]),Ne=Ge({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:f,serverDefaultModel:h,knownModels:We(m),knownAccounts:v,accountsUnavailable:(re=s==null?void 0:s.claudeCode)==null?void 0:re.accountsUnavailable,modelSupportsEffort:z,runtimeSupportsEffort:I,runtimeLabel:t=>H(t).label}),E=t=>{var b;return((b=Ne.breakages.find(A=>t.includes(A.kind)))==null?void 0:b.message)??null},U=!B&&K&&z!==!1,X=a.effort??(n==null?void 0:n.effort)??null,Y=H(o).label,Ce=o==="claude-code"&&v!==void 0&&(v.length>1||G),Se=E(["account-unregistered"]),J=(m??[]).some(t=>t.unverified),Z=O.useId();return e.jsxs("div",{className:N("grid grid-cols-2 gap-3",i),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{label:"Model",valueLabel:M?ce:(p==null?void 0:p.displayName)??T??(c?"Default":"Automatic"),options:[...(m??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:T,isSetHere:w,serverDefault:(n==null?void 0:n.model)??null,warning:E(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:J?Z:void 0,inheritText:M?ce:c&&!h?y?`Use the suggested model: ${y.displayName}`:"Use the default model":void 0}),J&&e.jsx(Xe,{id:Z}),c&&(m??[]).some(t=>t.creditsListOutOfDate)&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-out-of-date",children:"The models your DorkOS credits cover may be out of date."}),C&&L&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-unavailable",children:"Couldn’t load the models DorkOS credits cover. Try again in a moment."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ge,children:"Effort"}),(!r||!U)&&(S||U)&&e.jsx(ve,{isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:E(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),B?e.jsx(R,{testId:"agent-effort-pending",text:`Checking what ${Y} supports`,warning:null}):K?U?e.jsx($,{label:"Effort",valueLabel:k(X),options:Ue.filter(t=>!(p!=null&&p.supportedEffortLevels)||p.supportedEffortLevels.includes(t)).map(t=>({value:t,label:k(t)})),selected:X,isSetHere:S,serverDefault:n!=null&&n.effort?k(n.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(R,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:E(["effort-unsupported-model"])}):e.jsx(R,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${Y}`,warning:E(["effort-unsupported-runtime"])})]}),Ce&&e.jsx($,{label:"Account",valueLabel:W?D??"Default":g!==null?((de=v==null?void 0:v.find(t=>t.id===g))==null?void 0:de.label)??g:D??"Default",options:(v??[]).map(t=>({value:t.id,label:t.label,hint:t.id===j?"Paid from your DorkOS account":be(t.path)})),selected:g,isSetHere:G,serverDefault:D,warning:Se,onSelect:t=>_(t),onInherit:()=>_(null),testId:"agent-account-row",className:"col-span-full"}),W&&e.jsxs("div",{className:"text-muted-foreground col-span-full flex flex-wrap items-center gap-2 text-xs","data-testid":"agent-credits-not-allowed",children:[e.jsx("span",{children:"This agent’s settings name DorkOS credits. It uses your default until you allow it."}),e.jsx($e,{size:"sm",variant:"outline",className:"h-6 px-2 text-xs",disabled:P.isPending,onClick:()=>_(j),children:"Allow"})]})]})}function R({text:a,warning:l,testId:i}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":i,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const at="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function it({member:a}){const{agent:l,projectPath:i,isPending:r,update:s}=He(a),{data:d}=he();if(r)return e.jsx(Me,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const u=d?Object.keys(d.capabilities):[l.runtime],f=u.includes(l.runtime)?u:[l.runtime,...u];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:at,children:"Runs on"}),e.jsxs(Be,{value:l.runtime??"claude-code",onValueChange:o=>s({runtime:o}),children:[e.jsx(Ke,{className:"h-8 text-sm",responsive:!1,children:e.jsx(ze,{})}),e.jsx(Qe,{children:f.map(o=>e.jsx(qe,{value:o,responsive:!1,children:H(o).label},o))})]})]}),e.jsx(st,{agent:l,onUpdate:s,className:"grid-cols-1"}),i&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(Ve,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:be(i)})]})]})}export{it as RunsOnPopover};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ar as Be,a1 as b,a3 as K,r as x,a4 as R,iW as F,iX as T,a2 as z,j as e,hf as Ee,dY as Qe,dZ as W,Q as we,R as Re,U as Ie,B as C,hc as Ye,G as H,dr as Ge,dK as We,iY as He,iZ as Ve,dw as Le,O as te,x as de,bw as Je,J as ue,dv as me,dW as S,dX as ne,at as Xe,i_ as Ze,I as _,i$ as es,j0 as Ae,j1 as ss,_ as De,fj as ts,dP as ns,dQ as rs,dR as as,dS as is,dT as be,hq as os,C as ls,j2 as cs,j3 as ds,j4 as us,T as ms}from"./index-C8-dwIPp.js";import{I as xs}from"./inline-code-Beal0546.js";import{u as hs}from"./useMutationState-BnXJ-0A_.js";import{O as fs,a as G}from"./runtime-connect-Dn0T5YWv.js";import{T as ps}from"./terminal-Bjss9oke.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,p=!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:p,errorMessage:p?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(ps,{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(W,{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:H("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=Ge(),{data:n}=We();return s?He(Ve(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:H("text-muted-foreground shrink-0",t&&"animate-none")}),e.jsx(Je,{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 p,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=(p=l.data)!=null&&p.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(W,{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,J,Y,X,y,$,fe,pe,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(((J=s.inference)==null?void 0:J.protocol)??"openai-chat-completions"),[m,h]=x.useState(((Y=s.inference)==null?void 0:Y.endpoint)??""),[g,p]=x.useState(((X=s.inference)==null?void 0:X.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(((fe=s.inference)==null?void 0:fe.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"?(pe=k.data)==null?void 0:pe.models.find(f=>f.id===j):void 0,ee=s.hasKey&&((ge=s.inference)==null?void 0:ge.endpoint)===m&&s.inference.source==="api-key",V=R({mutationFn:async f=>{if(n)return n(f,P.trim()||null);o==="api-key"&&P.trim()?await i.storeDoeCredential(f,P.trim()):await i.setDoeInference(f),(await i.getCloudCredits()).linked&&await i.setCloudCreditsDefault("doe",o==="dorkos-credits")},onSuccess:()=>{N("");for(const f of[["doe-inference"],F,T,Xe.all,Ze.status()])a.invalidateQueries({queryKey:f});t==null||t({title:"DorkOS model settings saved",body:"New chats use this source and model."})},onError:f=>E(n&&f instanceof Error&&f.message?f.message:"Couldn’t save model settings. Try again.")});function re(f){var ke,Ne;if(f.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}V.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:f=>{c(f.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:f=>{d(f.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:f=>v(f.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(f=>e.jsx("option",{value:f.id,children:f.displayName},f.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:f=>p(f.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:f=>h(f.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:f=>v(f.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:f=>M(f.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:f=>w(f.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:f=>N(f.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:V.isPending,children:V.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 Gs({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(Ws,{}),n?e.jsx(Hs,{provision:t}):e.jsx(Vs,{}),e.jsx(Js,{})]})}function Ws(){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 Hs({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 Vs(){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 Js(){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(W,{className:"size-3"})]})}const Xs="https://ollama.com/library",Zs={"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(Gs,{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 p=i.data,j=(p==null?void 0:p.installed)??[],v=((L=p==null?void 0:p.installed)==null?void 0:L.length)??(p==null?void 0:p.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=Zs[s];return e.jsxs("div",{"data-testid":"ollama-verdict","data-verdict":s,children:[e.jsx("p",{className:H("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=fs.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:Xs,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(W,{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:H("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:p,state:j})=>{if(!ts(p)){r("Couldn’t open the OpenRouter sign-in page.");return}i(j)},onError:p=>r(p.message??"Couldn’t start OpenRouter sign-in.")}),o=z({queryKey:["runtime-connect","openrouter","oauth",n],queryFn:()=>s.getOpenRouterOAuthStatus(n),enabled:n!==null,refetchInterval:p=>{var j;return((j=p.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(W,{className:"size-3"})]}),e.jsx(C,{type:"submit",size:"sm",variant:"outline",disabled:t.trim().length===0,children:"Save key"})]})]})]})}const se="other";function Z(s){return G.find(t=>t.id===s)}function ut(s){var t;return((t=Z(s))==null?void 0:t.id)??"openai"}function ce(s){var t;return((t=G.find(n=>n.id===s))==null?void 0:t.defaultBaseURL)??G[0].defaultBaseURL}function ze(s){return G.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 X;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=Z(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!==(($=Z(y))==null?void 0:$.defaultBaseURL)}),m=_s(),h=$s(),g=Z(i),p=ut(i),j=n!=null&&n.key.saved&&n.providerId===p?n.key.last4:null,v=o.trim(),O=i===se,M=!O||v.length>0,I=ce(p),w=v||I,P=w===I?"":w,N=n===null?null:n.baseURL??ce(n.providerId),L=p!==((n==null?void 0:n.providerId)??null)||w!==N,E=r.trim().length>0,q=(E||j!==null&&!L)&&M,ee=E&&M,V=!E&&j!==null&&L,re=w.startsWith("http://"),Q={providerId:p,key:r,baseURL:P},D=m.isPending||h.isPending,J=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=J.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((($=Z(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:[G.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:J,value:r,disabled:D,onChange:y=>{l(y.target.value),Y()},placeholder:j===null?(g==null?void 0:g.keyPlaceholder)??G[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}),V&&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(W,{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…"}):((X=h.result)==null?void 0:X.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=ft();if(n==="choose")return e.jsx(pt,{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 ft(){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 pt({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:H("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(p=>` ${p}`).join("")]})]}),e.jsx(le,{collapsed:!0,children:d})]});const g=p=>l==null?void 0:l({runtime:s,origin:`runtime-connect:${s}`,fullWidth:p,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:H("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,bo as K,di as I,dj as Y,j as e,dk as G,dl as W,bn as Q,bl as C,bk as U,dm as J,bm as V,dn as X,dp as Z,dq as q,bt as ee,dr as te,ds as ne,dt as A,cx as se,cy as re,cA as ae,cB as oe,cC as ie,du as ce,dv as k,J as D,B as S,dw as M,dx as le,G as E,Q as de,R as ue,T as fe,U as me,dy as xe,aI as pe,a9 as ve,bM as he,O as $,x as ge,bw as Ce}from"./index-C8-dwIPp.js";import{I as be}from"./inline-code-Beal0546.js";import{l as je}from"./list-runtime-types-CwEp9Lg4.js";import{D as O,u as Re,C as Ne}from"./RuntimeConnectFlow-DY4sjRgN.js";var Pe=Object.defineProperty,b=(t,n)=>Pe(t,"name",{value:n,configurable:!0}),y,_="HoverCard",[z,Xe]=K(_,[I]),L=I(),[Se,T]=z(_),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"),Te="HoverCardTrigger",ye=l.forwardRef(b(function(n,r){const{__scopeHoverCard:a,...s}=n,c=T(Te,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")),F="HoverCardPortal",[He,ke]=z(F,{forceMount:void 0}),De=b(t=>{const{__scopeHoverCard:n,forceMount:r,children:a,container:s}=t,c=T(F,n);return e.jsx(He,{scope:n,forceMount:r,children:e.jsx(U,{present:r||c.open,children:e.jsx(J,{asChild:!0,container:s,children:a})})})},"HoverCardPortal"),H="HoverCardContent",Ee=l.forwardRef(b(function(n,r){const a=ke(H,n.__scopeHoverCard),{forceMount:s=a.forceMount,...c}=n,o=T(H,n.__scopeHoverCard);return e.jsx(U,{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=T(H,a),p=L(a),v=l.useRef(null),g=V(r,v),[u,f]=l.useState(!1);return l.useEffect(()=>{if(u){const d=document.body;return y=d.style.userSelect||d.style.webkitUserSelect,d.style.userSelect="none",d.style.webkitUserSelect="none",()=>{d.style.userSelect=y,d.style.webkitUserSelect=y}}},[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(X,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:m,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:C(o,d=>{d.preventDefault()}),onDismiss:i.onDismiss,children:e.jsx(Z,{...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=ye,$e=De,Ie=Ee;function Ze({...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 Ue(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=M(),x=Ue(t,n,a);return e.jsxs("div",{className:"space-y-4","data-testid":"runtime-setup-panel",children:[x.map(i=>e.jsx(ze,{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:E("size-3.5",c&&!m&&"animate-spin")}),"Check again"]})]})]})}function Me(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 ze({type:t,requirements:n,registered:r,renderConnect:a}){var R,N;const s=k(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?Me(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(D,{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(Fe,{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:E("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 Fe({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=k(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=M();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:E("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(D,{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?k(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(D,{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{Ze as H,tt as R,qe as a,et as b,Ae as c};
|