@readmagic/workmate 0.0.25 → 0.0.26
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/chunks/{AddWorkspaceDirectory-Y5S_lMjD.js → AddWorkspaceDirectory-mS8iUoWY.js} +1 -1
- package/dist/chunks/{AgentsMdExternalIncludesDialog-DVbU-BaD.js → AgentsMdExternalIncludesDialog-BHBkysy0.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-DuStmCjj.js +1 -0
- package/dist/chunks/App-D--vtCyq.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-mcDuiNGs.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-DjqGAL4C.js → BypassPermissionsModeDialog-DyqI98d2.js} +1 -1
- package/dist/chunks/CustomSelect-CpMbxYbt.js +1 -0
- package/dist/chunks/DiffDialog-BQAU2pJx.js +6 -0
- package/dist/chunks/Doctor-BU69VQzw.js +1 -0
- package/dist/chunks/Doctor-DJOMbSDE.js +3 -0
- package/dist/chunks/{ExitFlow-Dh9QdaYK.js → ExitFlow-xBOnvhiW.js} +2 -2
- package/dist/chunks/{InvalidConfigDialog-C9boykQn.js → InvalidConfigDialog-NiuhcaG5.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-UN5mleCK.js → InvalidSettingsDialog-DrromC1I.js} +1 -1
- package/dist/chunks/KeybindingProviderSetup-CSUkJHTT.js +1 -0
- package/dist/chunks/MCPConnectionManager-Bn1PDn3R.js +1 -0
- package/dist/chunks/MCPToolListView-BRxjOaOL.js +1 -0
- package/dist/chunks/{McpParsingWarnings-zkM_lGd0.js → McpParsingWarnings-BYG2yqjO.js} +1 -1
- package/dist/chunks/MessageSelector-B7xAQqZI.js +3 -0
- package/dist/chunks/Messages-CxMsfjOa.js +10 -0
- package/dist/chunks/{Onboarding-BT90cFkn.js → Onboarding-CkATe87e.js} +1 -1
- package/dist/chunks/{PermissionDialog-BaibiQae.js → PermissionDialog-tEMMa5-a.js} +1 -1
- package/dist/chunks/{PressEnterToContinue-DZc_s_pE.js → PressEnterToContinue-CPOaYnym.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-CCTZYbWI.js → PromptInputFooterSuggestions-CwqAsTI2.js} +1 -1
- package/dist/chunks/PromptInputHelpMenu-krq-hiFO.js +1 -0
- package/dist/chunks/{ProviderSetup-yIj8YOKF.js → ProviderSetup-J6Ty-Wj8.js} +1 -1
- package/dist/chunks/QueryEngine-Mdi_kUaL.js +1 -0
- package/dist/chunks/REPL-BgzQtSFF.js +1 -0
- package/dist/chunks/REPL-rirm6s_7.js +124 -0
- package/dist/chunks/ResumeConversation-Cmsbo5m7.js +1 -0
- package/dist/chunks/{SearchBox-C9xxQzh1.js → SearchBox-DQBLKyzJ.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-D1-7C04z.js +1 -0
- package/dist/chunks/{SelectMulti-BW7Ffk1G.js → SelectMulti-BpAjjhsn.js} +1 -1
- package/dist/chunks/Settings-B6DImvca.js +2 -0
- package/dist/chunks/Spinner-DhhSOFcN.js +1 -0
- package/dist/chunks/{SpinnerGlyph-CqrOK3Mx.js → SpinnerGlyph-CmVXC-_9.js} +1 -1
- package/dist/chunks/{TextInput-Cev5Awdd.js → TextInput-BboKIug2.js} +11 -11
- package/dist/chunks/ThemePicker-DTpXbEY0.js +1 -0
- package/dist/chunks/{TrustDialog-8Sjmuu0e.js → TrustDialog-CZ8JpySm.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-INwwoerV.js → ValidationErrorsList-C_gDQfm1.js} +1 -1
- package/dist/chunks/{_baseEach-DrPH_FGo.js → _baseEach-DGbaIpJA.js} +1 -1
- package/dist/chunks/_baseSlice-D67_NpZ1.js +1 -0
- package/dist/chunks/{add-dir-D3RMaYxy.js → add-dir-B576wzi9.js} +1 -1
- package/dist/chunks/{agentDisplay-B3npXoCS.js → agentDisplay-ZuFoBZYu.js} +1 -1
- package/dist/chunks/{agents-2mPGmeq6.js → agents-Dy4_hDic.js} +1 -1
- package/dist/chunks/agents-HIOBiw4w.js +101 -0
- package/dist/chunks/allErrors-CxPNR2WN.js +1 -0
- package/dist/chunks/appleTerminalBackup-C9kjzdM9.js +1 -0
- package/dist/chunks/{backgroundHousekeeping-BkFxfjOf.js → backgroundHousekeeping-PyLNnGdw.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-ZCMPmQuU.js +1 -0
- package/dist/chunks/{banner-DHpTmEO7.js → banner-DqFectPg.js} +2 -2
- package/dist/chunks/{branch-Be_yDFU8.js → branch-B_BL5N9N.js} +2 -2
- package/dist/chunks/{break-cache-UUt6Dkf2.js → break-cache-DL95nKZl.js} +2 -2
- package/dist/chunks/{btw-DUml5L1w.js → btw-Y44ctueB.js} +1 -1
- package/dist/chunks/bundledMode-BxyD5cqq.js +1 -0
- package/dist/chunks/caches-5xZ4dSXt.js +1 -0
- package/dist/chunks/caches-Be9saXxV.js +1 -0
- package/dist/chunks/{claudeDesktop-mBGFDbI6.js → claudeDesktop-g8eUUY2E.js} +1 -1
- package/dist/chunks/{clear-CrGjNe6E.js → clear-DtTkA707.js} +1 -1
- package/dist/chunks/{client-BDuhbzLD.js → client-Bw_L3lSc.js} +1 -1
- package/dist/chunks/{client-BYFVVMcf.js → client-aJ2Nr_sh.js} +1 -1
- package/dist/chunks/client-mnUISv_N.js +1 -0
- package/dist/chunks/client-wPqIdEVm.js +1 -0
- package/dist/chunks/commands-wfE12a4L.js +1 -0
- package/dist/chunks/compact-CvNOtu7J.js +2 -0
- package/dist/chunks/config-D3K87Mm1.js +3 -0
- package/dist/chunks/config-DTga6Ku8.js +1 -0
- package/dist/chunks/config-DtmqWusU.js +1 -0
- package/dist/chunks/{context-mV5zjqmc.js → context-Opu4E8dL.js} +1 -1
- package/dist/chunks/{context-noninteractive-DvfVvmSE.js → context-noninteractive-B1V2Mp26.js} +5 -5
- package/dist/chunks/context-noninteractive-eIlneYiL.js +1 -0
- package/dist/chunks/conversation-CG_z7TLE.js +1 -0
- package/dist/chunks/conversation-CHesBfFZ.js +1 -0
- package/dist/chunks/conversationRecovery-OhitW-7g.js +1 -0
- package/dist/chunks/crossProjectResume-mmYx8PrZ.js +40 -0
- package/dist/chunks/cwd-BH2f3u0o.js +1 -0
- package/dist/chunks/{cwd-BvNt_018.js → cwd-DrEEb4f5.js} +1 -1
- package/dist/chunks/{debug-CRnGsZOV.js → debug-kBjDaVkQ.js} +3 -3
- package/dist/chunks/{detectRepository-CsJLbVEe.js → detectRepository-M6K2wc7h.js} +1 -1
- package/dist/chunks/{diff-DUEoNCnJ.js → diff-Cv7tX2-P.js} +1 -1
- package/dist/chunks/{directoryCompletion-Bgi8DBT5.js → directoryCompletion-BHyjyKAM.js} +1 -1
- package/dist/chunks/doctor-DeBG5SL5.js +1 -0
- package/dist/chunks/{entry-D1iD76SW.js → entry-CbhyIWgj.js} +5 -5
- package/dist/chunks/envUtils-DZ_SvEVz.js +1 -0
- package/dist/chunks/execFileNoThrow-BfZFnCGa.js +1 -0
- package/dist/chunks/execa-CBhG1doD.js +34 -0
- package/dist/chunks/exit-OKEV_ddw.js +1 -0
- package/dist/chunks/{extraUsage-BtHE-SBX.js → extraUsage-BlRL3yeb.js} +1 -1
- package/dist/chunks/extractMemories-jnsv-_n_.js +1 -0
- package/dist/chunks/fast-4I_qPJCd.js +1 -0
- package/dist/chunks/fast-DiolM1M7.js +1 -0
- package/dist/chunks/{fetchModelList-Cjow_QGy.js → fetchModelList-BRFTQim4.js} +1 -1
- package/dist/chunks/fetchModelList-qPKAuu4m.js +1 -0
- package/dist/chunks/{fileSuggestions-C96V9-Ne.js → fileSuggestions-iWVXvvLB.js} +3 -3
- package/dist/chunks/{fpsMetrics-wxj9GAsd.js → fpsMetrics-Ixd0J4CH.js} +1 -1
- package/dist/chunks/{gemini-4YGElN3H.js → gemini-BfVyavwQ.js} +2 -2
- package/dist/chunks/{generateSessionName-BHIKyXpz.js → generateSessionName-CGaTTXCA.js} +1 -1
- package/dist/chunks/genericProcessUtils-CVtQOTO2.js +12 -0
- package/dist/chunks/{goal-ePK_jLo3.js → goal-BidR-GFa.js} +1 -1
- package/dist/chunks/grok-DLcuI-U7.js +1 -0
- package/dist/chunks/{help-B7xRle-V.js → help-CZuvYhXj.js} +1 -1
- package/dist/chunks/history-BxPGftQw.js +1 -0
- package/dist/chunks/hooks-Bg9WIjZQ.js +1 -0
- package/dist/chunks/{hooks-BN5f58HY.js → hooks-ehqfAM5F.js} +2 -2
- package/dist/chunks/install-ACGY0vhM.js +1 -0
- package/dist/chunks/{instrumentation-Oj5xagJG.js → instrumentation-B9bfF2mA.js} +5 -5
- package/dist/chunks/{job-D9ypO0cd.js → job-Coztdn6A.js} +1 -1
- package/dist/chunks/keybindings-DwSdLpaE.js +1 -0
- package/dist/chunks/{launchLocalMemory-DliLezJw.js → launchLocalMemory-DRzfpIOB.js} +1 -1
- package/dist/chunks/{launchOnboarding-A-kk-7ID.js → launchOnboarding-D2zFCJf-.js} +1 -1
- package/dist/chunks/{loadAgentsDir-DGozQu_6.js → loadAgentsDir-DR5PVAc3.js} +557 -561
- package/dist/chunks/loadAgentsDir-DqAbnpB-.js +1 -0
- package/dist/chunks/{loadPluginHooks-BiHPKDaY.js → loadPluginHooks-BiQgGfUJ.js} +1 -1
- package/dist/chunks/{loader-CtoR-vO-.js → loader-6MqzNGmV.js} +1 -1
- package/dist/chunks/{localSearch-BU02Qsv9.js → localSearch-CzkxDuOR.js} +1 -1
- package/dist/chunks/localSearch-DW3JT2MA.js +1 -0
- package/dist/chunks/lockfile-D_9vif6E.js +1 -0
- package/dist/chunks/{log-DoSpAwRP.js → log-DWZny1vM.js} +1 -1
- package/dist/chunks/{logoUtils-DLd6JKqW.js → logoUtils-DR5T0pr3.js} +1 -1
- package/dist/chunks/{magicDocs-Bj8LYrN2.js → magicDocs-BwBxjfLo.js} +2 -2
- package/dist/chunks/main-Ryi27wYq.js +345 -0
- package/dist/chunks/managedEnv-DCEJh3z3.js +1 -0
- package/dist/chunks/managedEnv-Do9fgLpk.js +1 -0
- package/dist/chunks/managedEnvConstants-CWcT7nYr.js +1 -0
- package/dist/chunks/mcp-BCpnF6wD.js +1 -0
- package/dist/chunks/mcp-CJ6SDJEK.js +6 -0
- package/dist/chunks/mcp-CZBTxbhu.js +2 -0
- package/dist/chunks/memory-BQO6Y0ak.js +1 -0
- package/dist/chunks/{modalContext-DDZdU1J8.js → modalContext-CBE8xuck.js} +1 -1
- package/dist/chunks/{mode-CBKawxnD.js → mode-wq70cR44.js} +1 -1
- package/dist/chunks/model-D42epddJ.js +1 -0
- package/dist/chunks/{model-DwbqvCY2.js → model-DVk9-2dk.js} +1 -1
- package/dist/chunks/{modelOptions-CXBfKFXA.js → modelOptions-beLgXORr.js} +1 -1
- package/dist/chunks/nativeInstaller-ChGSz1lb.js +1 -0
- package/dist/chunks/{notifications-ql0eSo0Y.js → notifications-dGBuNvFj.js} +1 -1
- package/dist/chunks/{onChangeAppState-D85b33R5.js → onChangeAppState-B4K-rSaF.js} +1 -1
- package/dist/chunks/openai-DAwnAV9K.js +2 -0
- package/dist/chunks/{overlayContext-CLjlCFBl.js → overlayContext-B6i_6y_0.js} +1 -1
- package/dist/chunks/{panel-DMZkOEiU.js → panel-C0CF3noE.js} +1 -1
- package/dist/chunks/parser-BZt0VFd_.js +1 -0
- package/dist/chunks/{parser-UqADrvxF.js → parser-DThLwgdM.js} +1 -1
- package/dist/chunks/{partition-CwxTlmMd.js → partition-BRQHofxD.js} +1 -1
- package/dist/chunks/{pasteStore-ovtxMVR5.js → pasteStore-BmehVo5j.js} +1 -1
- package/dist/chunks/{permissions-CgsvWOk_.js → permissions-DkfWKN-B.js} +3 -3
- package/dist/chunks/pidLock-YvAaIrIY.js +3 -0
- package/dist/chunks/plan-B6U3ioer.js +1 -0
- package/dist/chunks/{platform-DsMIk3eq.js → platform-Vl9IynC3.js} +1 -1
- package/dist/chunks/plugin-CTA2_-F7.js +17 -0
- package/dist/chunks/{pluginAutoupdate-DQqYDPVg.js → pluginAutoupdate-Dy5W3HWE.js} +1 -1
- package/dist/chunks/{pluginBlocklist-BAr9WTup.js → pluginBlocklist-DAoUENwc.js} +1 -1
- package/dist/chunks/pluginCliCommands-CaHnj0C_.js +1 -0
- package/dist/chunks/{pluginFlagging-BO_3qjfs.js → pluginFlagging-BCj9LJP3.js} +1 -1
- package/dist/chunks/pluginOperations-ClXNOOG6.js +2 -0
- package/dist/chunks/pluginStartupCheck-CiwMKGjx.js +1 -0
- package/dist/chunks/{pluginStartupCheck-BX6cv-vs.js → pluginStartupCheck-U8_xk25t.js} +1 -1
- package/dist/chunks/{plugins-9crasx2V.js → plugins-D7zyI9c4.js} +4 -4
- package/dist/chunks/{poller-CpLBoB-N.js → poller-BeyVwHAf.js} +1 -1
- package/dist/chunks/poorMode-DtzWNhsY.js +1 -0
- package/dist/chunks/poorMode-Ocff_UT1.js +1 -0
- package/dist/chunks/print-BzljdXem.js +13 -0
- package/dist/chunks/processBashCommand-RUkmyAl4.js +1 -0
- package/dist/chunks/processSlashCommand-DRLO-jNV.js +5 -0
- package/dist/chunks/{projectContext-5fmRr6Sd.js → projectContext-COeHKDrk.js} +1 -1
- package/dist/chunks/{projectContext-DhtjLv3k.js → projectContext-QN5U3Ggr.js} +1 -1
- package/dist/chunks/{projectOnboardingState--L3BKjOE.js → projectOnboardingState-KqcpRXls.js} +1 -1
- package/dist/chunks/{prompt-DzO1um1h.js → prompt-CTByhpUI.js} +20 -20
- package/dist/chunks/prompt-DTpfW6yP.js +1 -0
- package/dist/chunks/prompt-D__eHY_5.js +1 -0
- package/dist/chunks/promptEditor-CpUFgGzc.js +4 -0
- package/dist/chunks/{protocolHandler-BWgH1jaF.js → protocolHandler-BQSLVGnG.js} +2 -2
- package/dist/chunks/{proxy-BjkGlmBu.js → proxy-BtWuysHM.js} +2 -2
- package/dist/chunks/{reconciler-CVMmAaCy.js → reconciler-D6BUq8WB.js} +1 -1
- package/dist/chunks/refresh-B4pqFp12.js +1 -0
- package/dist/chunks/reject-C6IvUvBt.js +1 -0
- package/dist/chunks/{reload-plugins-DeyJTx4s.js → reload-plugins-DXQqk7q6.js} +1 -1
- package/dist/chunks/rename-D4XBmTBI.js +1 -0
- package/dist/chunks/{renderOptions-DRS2EslG.js → renderOptions-DkP98P_d.js} +1 -1
- package/dist/chunks/{resume-N4O5YI-S.js → resume-DzIev0JI.js} +2 -2
- package/dist/chunks/ripgrep-CYP26Fhg.js +1 -0
- package/dist/chunks/ripgrep-D1f1pbCz.js +5 -0
- package/dist/chunks/{runtimeObserver-DMSzdFWt.js → runtimeObserver-BPqlbu0B.js} +4 -4
- package/dist/chunks/{runtimeObserver-C0CJvA3q.js → runtimeObserver-BUHs3qjs.js} +1 -1
- package/dist/chunks/sandbox-adapter-CumL75tU.js +1 -0
- package/dist/chunks/{sandbox-toggle-Tbbaw18C.js → sandbox-toggle-CTtET6Xq.js} +1 -1
- package/dist/chunks/searchExtraTools-BMCU2zEf.js +1 -0
- package/dist/chunks/{select-Fq6g2Ejk.js → select-FrwoTzuc.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-WO8WTdT9.js +1 -0
- package/dist/chunks/{sessionObserver-CRie77tp.js → sessionObserver-B6xzxckA.js} +2 -2
- package/dist/chunks/sessionObserver-CBrM4opL.js +1 -0
- package/dist/chunks/sessionStorage-C1EAxDWG.js +1 -0
- package/dist/chunks/sessionTracing-UFK96PxT.js +11 -0
- package/dist/chunks/settings-BK6gCko-.js +1 -0
- package/dist/chunks/settings-YIDksG5Z.js +24 -0
- package/dist/chunks/setup-BBvZyrfz.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-CTnYVrmP.js → shadowedRuleDetection-D6R2OeoH.js} +1 -1
- package/dist/chunks/{sideQuestion-Cl8m2qYx.js → sideQuestion-5jcbOMsR.js} +3 -3
- package/dist/chunks/{sinks-CiupmfTg.js → sinks-B-kFqjjd.js} +1 -1
- package/dist/chunks/sinks-DB_D4lmu.js +1 -0
- package/dist/chunks/skillChangeDetector-103-nEle.js +1 -0
- package/dist/chunks/{skillGapStore-es3K-aYe.js → skillGapStore-DOz1KCqo.js} +2 -2
- package/dist/chunks/{skillLifecycle-BcgoOQBk.js → skillLifecycle-D9NkIwFQ.js} +2 -2
- package/dist/chunks/{skillSearchPanel-CuDDb1L-.js → skillSearchPanel-DFiSZaJ4.js} +2 -2
- package/dist/chunks/skills-DgeLr52a.js +1 -0
- package/dist/chunks/sleep-BbWr_FL1.js +1 -0
- package/dist/chunks/{src-9vmGsuSI.js → src-Cy5_qH26.js} +1 -1
- package/dist/chunks/{src-DL3w8VPk.js → src-WZ94ZKI3.js} +4 -4
- package/dist/chunks/{startupProfiler-DF0AjiDf.js → startupProfiler-DIM_Ihyp.js} +2 -2
- package/dist/chunks/startupProfiler-FpGsKWYk.js +1 -0
- package/dist/chunks/{state-BQ4BEGin.js → state-CXY-q5gr.js} +1 -1
- package/dist/chunks/state-DXt6rahM.js +1 -0
- package/dist/chunks/{staticRender-BVWx0IM1.js → staticRender-RHUIg5ln.js} +1 -1
- package/dist/chunks/status-CKLecQZV.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-BfmIub5L.js → statusNoticeHelpers-DI45AH-c.js} +1 -1
- package/dist/chunks/stringUtils-D_xPrwGQ.js +4 -0
- package/dist/chunks/switcher-D2Z2ZNQ0.js +1 -0
- package/dist/chunks/switcher-DhZCaAun.js +1 -0
- package/dist/chunks/{tasks-B6gYXxOx.js → tasks-6suPhqsK.js} +1 -1
- package/dist/chunks/{templateJobs-BW6TaqEC.js → templateJobs-BKVEWCsb.js} +1 -1
- package/dist/chunks/{terminalSetup-C-g9Xvj3.js → terminalSetup-7PUR4hfo.js} +1 -1
- package/dist/chunks/{terminalSetup-BgIXFBpd.js → terminalSetup-Cqy5_PhJ.js} +4 -4
- package/dist/chunks/{theme-9AZceq_m.js → theme-B-HG2PUs.js} +1 -1
- package/dist/chunks/tipRegistry-BR_lSGRw.js +2 -0
- package/dist/chunks/{toolEventObserver-DTuJcREC.js → toolEventObserver-BY3QVnr6.js} +1 -1
- package/dist/chunks/toolPool-BcwIF8Q_.js +1 -0
- package/dist/chunks/{types-97nL3naE.js → types-CD25a50S.js} +1 -1
- package/dist/chunks/udsClient-CCxgLiZy.js +1 -0
- package/dist/chunks/urlHandler-BNsQKqba.js +1 -0
- package/dist/chunks/{use-select-navigation-BStVRvcX.js → use-select-navigation-CW5alA9r.js} +1 -1
- package/dist/chunks/{useDoublePress-C9xxQzh1.js → useDoublePress-DQBLKyzJ.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-DWRFdFoU.js → useExitOnCtrlCDWithKeybindings-BgJrnuDl.js} +1 -1
- package/dist/chunks/useMainLoopModel-BVgJo4hN.js +1 -0
- package/dist/chunks/useManagePlugins-CrWjzESW.js +1 -0
- package/dist/chunks/useMergedTools-r6GQq5mI.js +1 -0
- package/dist/chunks/{useSearchInput-B_mY9wBq.js → useSearchInput-BITV_Txn.js} +1 -1
- package/dist/chunks/{useSettingsErrors-CM7tThcp.js → useSettingsErrors-CO0fTNzn.js} +1 -1
- package/dist/chunks/{util-Bb2S6g9N.js → util-_zo3I1y8.js} +1 -1
- package/dist/chunks/validatePlugin-DFGdRhA-.js +1 -0
- package/dist/chunks/{vim-Dpnhgoz_.js → vim-qgMS88ss.js} +1 -1
- package/dist/chunks/worktree-CR_M6Qfy.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.cjs +16 -16
- package/dist/chunks/AgentsMdExternalIncludesDialog-Bnb1jWcg.js +0 -1
- package/dist/chunks/App-B8q8PV77.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-i0TkZgQp.js +0 -2
- package/dist/chunks/CustomSelect-BvTftqEH.js +0 -1
- package/dist/chunks/DiffDialog-v5r8cBKW.js +0 -6
- package/dist/chunks/Doctor-DKpBnbuI.js +0 -1
- package/dist/chunks/Doctor-uvO6NM5m.js +0 -3
- package/dist/chunks/KeybindingProviderSetup-DsJqfEt-.js +0 -1
- package/dist/chunks/MCPConnectionManager-DkZVxLEj.js +0 -1
- package/dist/chunks/MCPToolListView-De1W4jpj.js +0 -1
- package/dist/chunks/MessageSelector-DW_itlX-.js +0 -3
- package/dist/chunks/Messages-BFsCpACq.js +0 -10
- package/dist/chunks/PromptInputHelpMenu-Bm5KY0Ma.js +0 -1
- package/dist/chunks/QueryEngine-egz5mbaW.js +0 -1
- package/dist/chunks/REPL-D27CE4WN.js +0 -124
- package/dist/chunks/REPL-e8wAT1wN.js +0 -1
- package/dist/chunks/ResumeConversation-CWA27Lke.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BRchtZ9Q.js +0 -1
- package/dist/chunks/Settings-axHLvYIy.js +0 -3
- package/dist/chunks/Spinner-VjwI7m_g.js +0 -1
- package/dist/chunks/ThemePicker-CtQYHmOr.js +0 -1
- package/dist/chunks/agents-DEnmg8Xo.js +0 -101
- package/dist/chunks/allErrors-C9kx6lnk.js +0 -1
- package/dist/chunks/appleTerminalBackup-CT7g8yOs.js +0 -1
- package/dist/chunks/backgroundHousekeeping-CvWfd99M.js +0 -1
- package/dist/chunks/caches-DWjwe-DN.js +0 -1
- package/dist/chunks/caches-VLs1tQkZ.js +0 -1
- package/dist/chunks/client-CO_6v4yl.js +0 -1
- package/dist/chunks/client-DO-O441l.js +0 -1
- package/dist/chunks/commands-Cn1P7Tms.js +0 -1
- package/dist/chunks/compact-DGUhdXcc.js +0 -2
- package/dist/chunks/config-C7GTF4iI.js +0 -1
- package/dist/chunks/config-CWPHVTic.js +0 -3
- package/dist/chunks/config-Cox0TM2Z.js +0 -1
- package/dist/chunks/context-noninteractive--OuiZUzL.js +0 -1
- package/dist/chunks/conversation--y8PD2Lk.js +0 -1
- package/dist/chunks/conversation-BIPJEOwO.js +0 -1
- package/dist/chunks/conversationRecovery-BBJzrA0g.js +0 -1
- package/dist/chunks/crossProjectResume-CwZb3cEU.js +0 -40
- package/dist/chunks/cwd-BZMp3CZ8.js +0 -1
- package/dist/chunks/doctor-4NiE46ZG.js +0 -1
- package/dist/chunks/envUtils-DfkgIdYf.js +0 -1
- package/dist/chunks/execFileNoThrow-BgRsj_SW.js +0 -34
- package/dist/chunks/exit-CrsQsjbx.js +0 -1
- package/dist/chunks/extractMemories-kogJzpit.js +0 -1
- package/dist/chunks/fast-CuNVwVTr.js +0 -1
- package/dist/chunks/fast-RlFnwGRV.js +0 -1
- package/dist/chunks/fetchModelList-uiCPVqbJ.js +0 -1
- package/dist/chunks/genericProcessUtils-BNlr-QxM.js +0 -23
- package/dist/chunks/grok-DnmklTrm.js +0 -1
- package/dist/chunks/history-kOw3CcLT.js +0 -1
- package/dist/chunks/hooks-BDY1jMbS.js +0 -1
- package/dist/chunks/install-DrMiHa2Q.js +0 -1
- package/dist/chunks/keybindings-BRRN_eap.js +0 -1
- package/dist/chunks/loadAgentsDir-CJAK4kif.js +0 -1
- package/dist/chunks/localSearch-DyaB2Rm-.js +0 -1
- package/dist/chunks/main-B_09WbaG.js +0 -345
- package/dist/chunks/managedEnv-BJGfe3m7.js +0 -1
- package/dist/chunks/managedEnv-CIWJsuty.js +0 -1
- package/dist/chunks/managedEnvConstants-BPwL2aWI.js +0 -1
- package/dist/chunks/mcp-1nBvcNxw.js +0 -1
- package/dist/chunks/mcp-7DXpXMdT.js +0 -2
- package/dist/chunks/mcp-kw99WVi2.js +0 -6
- package/dist/chunks/memory-CjWvzR_9.js +0 -1
- package/dist/chunks/model-DpZaKZMb.js +0 -1
- package/dist/chunks/nativeInstaller-SmPeEisk.js +0 -1
- package/dist/chunks/openai-D_j7-KW6.js +0 -2
- package/dist/chunks/parser-2usBI4G-.js +0 -1
- package/dist/chunks/pidLock-B-SW3Nhx.js +0 -3
- package/dist/chunks/plan-BJrWtXEh.js +0 -1
- package/dist/chunks/plugin-D97VJAxW.js +0 -17
- package/dist/chunks/pluginCliCommands-CUGPc853.js +0 -1
- package/dist/chunks/pluginOperations-rTrzu6Vg.js +0 -2
- package/dist/chunks/pluginStartupCheck-BRHnXlym.js +0 -1
- package/dist/chunks/poorMode-BaS0DBUO.js +0 -1
- package/dist/chunks/poorMode-DmvzFAz_.js +0 -1
- package/dist/chunks/print-Bi3xVdB3.js +0 -13
- package/dist/chunks/processBashCommand-BBtnCx-7.js +0 -1
- package/dist/chunks/processSlashCommand-jzF0GmLO.js +0 -5
- package/dist/chunks/prompt-CmijKW7G.js +0 -1
- package/dist/chunks/prompt-DYBx_D0H.js +0 -1
- package/dist/chunks/promptEditor-B6S_Rzcu.js +0 -4
- package/dist/chunks/refresh-CAGv8BJY.js +0 -1
- package/dist/chunks/reject-CEUkoI2G.js +0 -1
- package/dist/chunks/rename-DPFis9g_.js +0 -1
- package/dist/chunks/ripgrep-3omwGI-l.js +0 -1
- package/dist/chunks/ripgrep-CgQrN3XX.js +0 -5
- package/dist/chunks/sandbox-adapter-D15jjHJR.js +0 -1
- package/dist/chunks/searchExtraTools-BoFc__Eg.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-Rgsp4_Ex.js +0 -1
- package/dist/chunks/sessionObserver-PcaVCVkX.js +0 -1
- package/dist/chunks/sessionStorage-Dkf7FRgA.js +0 -1
- package/dist/chunks/sessionTracing-D7rekMdW.js +0 -11
- package/dist/chunks/settings-8fwIkMDV.js +0 -1
- package/dist/chunks/settings-CodSADx8.js +0 -24
- package/dist/chunks/setup-DBiIrXrh.js +0 -3
- package/dist/chunks/sinks-DH83d_kd.js +0 -1
- package/dist/chunks/skillChangeDetector-BrrZaFkT.js +0 -1
- package/dist/chunks/skills-BRtgqnLz.js +0 -1
- package/dist/chunks/startupProfiler-D1NRu2nj.js +0 -1
- package/dist/chunks/state-D3gvDiu8.js +0 -1
- package/dist/chunks/status-WXA16wIM.js +0 -1
- package/dist/chunks/stringUtils-Bu_lJH5c.js +0 -4
- package/dist/chunks/switcher-5gilU5_R.js +0 -1
- package/dist/chunks/switcher-DMfuKuw_.js +0 -1
- package/dist/chunks/tipRegistry-DtO1H_Wo.js +0 -2
- package/dist/chunks/toolPool-DHS8jWaL.js +0 -1
- package/dist/chunks/udsClient-CmYHFiBD.js +0 -1
- package/dist/chunks/urlHandler-DLz3FZm1.js +0 -1
- package/dist/chunks/useMainLoopModel-DSN5HjV1.js +0 -1
- package/dist/chunks/useManagePlugins-ntnOf5OU.js +0 -1
- package/dist/chunks/useMergedTools-C5Yns9Ij.js +0 -1
- package/dist/chunks/validatePlugin-D8WQ5z4W.js +0 -1
- package/dist/chunks/worktree-a5oOPSYl.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{D as i,I as a,P as o,T as s,Wt as c,ai as l,t as u,vn as d,y as f,yn as p}from"./src-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{D as i,I as a,P as o,T as s,Wt as c,ai as l,t as u,vn as d,y as f,yn as p}from"./src-WZ94ZKI3.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";import{F as h,N as g,P as _,hd as v,md as y,tb as b}from"./loadAgentsDir-DR5PVAc3.js";import{n as x,t as S}from"./TextInput-BboKIug2.js";import{n as C,t as w}from"./select-FrwoTzuc.js";import{r as T,t as E}from"./directoryCompletion-BHyjyKAM.js";import{r as D,t as O}from"./PromptInputFooterSuggestions-CwqAsTI2.js";function k(){return(0,P.jsx)(o,{dimColor:!0,children:`Work Mate will be able to read files in this directory and make edits when auto-accept edits is on.`})}function A({path:e}){return(0,P.jsxs)(a,{flexDirection:`column`,paddingX:2,gap:1,children:[(0,P.jsx)(o,{color:`permission`,children:e}),(0,P.jsx)(k,{})]})}function j({value:e,onChange:t,onSubmit:n,error:i,suggestions:s,selectedSuggestion:c}){return(0,P.jsxs)(a,{flexDirection:`column`,children:[(0,P.jsx)(o,{children:`Enter the path to the directory:`}),(0,P.jsx)(a,{borderDimColor:!0,borderStyle:`round`,marginY:1,paddingLeft:1,children:(0,P.jsx)(S,{showCursor:!0,placeholder:`Directory path${r.ellipsis}`,value:e,onChange:t,onSubmit:n,columns:80,cursorOffset:e.length,onChangeCursorOffset:()=>{}})}),s.length>0&&(0,P.jsx)(a,{marginBottom:1,children:(0,P.jsx)(O,{suggestions:s,selectedSuggestion:c})}),i&&(0,P.jsx)(o,{color:`error`,children:i})]})}function M({onAddDirectory:e,onCancel:t,permissionContext:n,directoryPath:r}){let[l,u]=(0,N.useState)(``),[d,m]=(0,N.useState)(null),[_,v]=(0,N.useState)([]),[b,x]=(0,N.useState)(0),S=(0,N.useMemo)(()=>F,[]),C=p((0,N.useCallback)(async e=>{if(!e){v([]),x(0);return}let t=await E(e);v(t),x(0)},[]),100);(0,N.useEffect)(()=>{C(l)},[l,C]);let T=(0,N.useCallback)(e=>{let t=`${e.id}/`;u(t),m(null)},[]),D=(0,N.useCallback)(async t=>{let r=await h(t,n);r.resultType===`success`?e(r.absolutePath,!1):m(g(r))},[n,e]);c(`confirm:no`,t,{context:`Settings`});let O=(0,N.useCallback)(e=>{if(_.length>0){if(e.key===`tab`){e.preventDefault();let t=_[b];t&&T(t);return}if(e.key===`return`){e.preventDefault();let t=_[b];t&&D(`${t.id}/`);return}if(e.key===`up`||e.ctrl&&e.key===`p`){e.preventDefault(),x(e=>e<=0?_.length-1:e-1);return}if(e.key===`down`||e.ctrl&&e.key===`n`){e.preventDefault(),x(e=>e>=_.length-1?0:e+1);return}}},[_,b,T,D]),M=(0,N.useCallback)(n=>{if(r)switch(n){case`yes-session`:e(r,!1);break;case`yes-remember`:e(r,!0);break;case`no`:t();break}},[r,e,t]);return(0,P.jsx)(a,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:O,children:(0,P.jsx)(f,{title:`Add directory to workspace`,onCancel:t,color:`permission`,isCancelActive:!1,inputGuide:r?void 0:e=>e.pending?(0,P.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):(0,P.jsxs)(s,{children:[(0,P.jsx)(i,{shortcut:`Tab`,action:`complete`}),(0,P.jsx)(i,{shortcut:`Enter`,action:`add`}),(0,P.jsx)(y,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]}),children:r?(0,P.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,P.jsx)(A,{path:r}),(0,P.jsx)(w,{options:S,onChange:M,onCancel:()=>M(`no`)})]}):(0,P.jsxs)(a,{flexDirection:`column`,gap:1,marginX:2,children:[(0,P.jsx)(k,{}),(0,P.jsx)(j,{value:l,onChange:u,onSubmit:D,error:d,suggestions:_,selectedSuggestion:b})]})})})}var N,P,F,I=e((()=>{n(),N=t(l(),1),d(),_(),x(),u(),b(),T(),v(),C(),D(),P=m(),F=[{value:`yes-session`,label:`Yes, for this session`},{value:`yes-remember`,label:`Yes, and remember this directory`},{value:`no`,label:`No`}]}));export{I as n,M as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,ai as a,t as o,y as s}from"./src-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,ai as a,t as o,y as s}from"./src-WZ94ZKI3.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{d as l,m as u}from"./config-D3K87Mm1.js";import{n as d}from"./analytics-COpjZpvd.js";import{t as f}from"./select-FrwoTzuc.js";import{t as p}from"./CustomSelect-CpMbxYbt.js";function m({onDone:e,isStandaloneDialog:t,externalIncludes:a}){h.useEffect(()=>{},[]);let o=(0,h.useCallback)(t=>{u(t===`no`?e=>({...e,hasAgentsMdExternalIncludesApproved:!1,hasAgentsMdExternalIncludesWarningShown:!0}):e=>({...e,hasAgentsMdExternalIncludesApproved:!0,hasAgentsMdExternalIncludesWarningShown:!0})),e()},[e]);return(0,g.jsxs)(s,{title:`Allow external AGENTS.md file imports?`,color:`warning`,onCancel:(0,h.useCallback)(()=>{o(`no`)},[o]),hideBorder:!t,hideInputGuide:!t,children:[(0,g.jsx)(i,{children:`This project's AGENTS.md imports files outside the current working directory. Never allow this for third-party repositories.`}),a&&a.length>0&&(0,g.jsxs)(n,{flexDirection:`column`,children:[(0,g.jsx)(i,{dimColor:!0,children:`External imports:`}),a.map((e,t)=>(0,g.jsxs)(i,{dimColor:!0,children:[` `,e.path]},t))]}),(0,g.jsxs)(i,{dimColor:!0,children:[`Important: Only use Work Mate with files you trust. Accessing untrusted files may pose security risks`,` `,(0,g.jsx)(r,{url:`https://code.workmate.com/docs/en/security`}),` `]}),(0,g.jsx)(f,{options:[{label:`Yes, allow external imports`,value:`yes`},{label:`No, disable external imports`,value:`no`}],onChange:e=>o(e)})]})}var h,g,_=e((()=>{h=t(a(),1),d(),o(),l(),p(),g=c()}));export{_ as n,m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./AgentsMdExternalIncludesDialog-BHBkysy0.js";e();export{t as AgentsMdExternalIncludesDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as e,t}from"./src-WZ94ZKI3.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{Lh as r,zh as i}from"./loadAgentsDir-DR5PVAc3.js";import{d as a,h as o,o as s}from"./config-D3K87Mm1.js";import{t as c}from"./fpsMetrics-Ixd0J4CH.js";import{n as l,t as u}from"./onChangeAppState-B4K-rSaF.js";i(),t(),a();var d=n();function f({getFpsMetrics:t,stats:n,initialState:i,children:a}){return(0,d.jsx)(c,{getFpsMetrics:t,children:(0,d.jsx)(l,{store:n,children:(0,d.jsx)(r,{initialState:i,onChangeAppState:u,children:(0,d.jsx)(e,{initialState:s().theme,onThemeSave:e=>o(t=>({...t,theme:e})),children:a})})})})}export{f as App};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{D as i,Gt as a,H as o,I as s,P as c,T as l,ai as u,ot as d,t as f,y as p}from"./src-WZ94ZKI3.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";import{Bh as h,Dc as g,Ec as _,En as v,Gl as y,Hh as ee,Hl as b,Ji as x,Px as S,Ul as C,Wl as te,Xu as w,Yu as T,_u as E,fg as ne,fs as re,gu as D,hg as O,nb as k,ps as A,rb as ie,sb as j,tb as M,wn as N,zh as P}from"./loadAgentsDir-DR5PVAc3.js";import{_ as ae,f as oe}from"./debug-kBjDaVkQ.js";import{Bn as se,Vn as ce,zn as le}from"./settings-YIDksG5Z.js";import{S as ue,_ as F,f as de,l as fe,u as pe,y as I}from"./startupProfiler-DIM_Ihyp.js";import{l as L,o as R}from"./stringUtils-D_xPrwGQ.js";import{_n as me,gn as he,vn as ge}from"./prompt-CTByhpUI.js";import{i as _e,t as ve}from"./overlayContext-B6i_6y_0.js";function z(e,t,n=1e3,r=0,i){let a=()=>fe(Math.max(0,(i??Date.now())-e-r));return(0,B.useSyncExternalStore)((0,B.useCallback)(e=>{if(!t)return()=>{};let r=setInterval(e,n);return()=>clearInterval(r)},[t,n]),a,a)}var B,V=e((()=>{B=t(u(),1),F()}));function ye(e,t,n){let r=he(t,e.toolName);if(!r)return e.toolName;try{let t=r.inputSchema.safeParse(e.input),i=t.success?t.data:{},a=r.userFacingName(i);if(!a)return e.toolName;let o=r.renderToolUseMessage(i,{theme:n,verbose:!1});return o?(0,be.jsxs)(c,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var be,xe=e((()=>{f(),ge(),be=m()}));function Se(e,t){let{isIdle:n,awaitingApproval:i,hasError:a,shutdownRequested:o}=t??{};return a?r.cross:i?r.questionMarkPrefix:o?r.warning:e===`running`?n?r.ellipsis:r.play:e===`completed`?r.tick:e===`failed`||e===`killed`?r.cross:r.bullet}function Ce(e,t){let{isIdle:n,awaitingApproval:r,hasError:i,shutdownRequested:a}=t??{};return i?`error`:r||a?`warning`:n?`background`:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:`background`}function we(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(E(t))return n=!0,!1;return n}var Te=e((()=>{n(),D()}));function Ee({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[u]=o(),d=(0,De.useMemo)(()=>_(me()),[]),f=z(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);a({"confirm:yes":t},{context:`Confirmation`});let m=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},h=S(e.prompt,`plan`),g=e.prompt.length>300?`${e.prompt.substring(0,297)}…`:e.prompt,v=e.result?.totalTokens??e.progress?.tokenCount,y=e.result?.totalToolUseCount??e.progress?.toolUseCount;return(0,H.jsx)(s,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:m,children:(0,H.jsx)(p,{title:(0,H.jsxs)(c,{children:[e.selectedAgent?.agentType??`agent`,` › `,e.description||`Async agent`]}),subtitle:(0,H.jsxs)(c,{children:[e.status!==`running`&&(0,H.jsxs)(c,{color:Ce(e.status),children:[Se(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,H.jsxs)(c,{dimColor:!0,children:[f,v!==void 0&&v>0&&(0,H.jsxs)(H.Fragment,{children:[` · `,de(v),` tokens`]}),y!==void 0&&y>0&&(0,H.jsxs)(H.Fragment,{children:[` `,`· `,y,` `,y===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,H.jsxs)(c,{children:[`Press `,t.keyName,` again to exit`]}):(0,H.jsxs)(l,{children:[r&&(0,H.jsx)(i,{shortcut:`←`,action:`go back`}),(0,H.jsx)(i,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,H.jsx)(i,{shortcut:`x`,action:`stop`})]}),children:(0,H.jsxs)(s,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,H.jsxs)(s,{flexDirection:`column`,children:[(0,H.jsx)(c,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,H.jsxs)(c,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,ye(t,d,u)]},n))]}),h?(0,H.jsx)(s,{marginTop:1,children:(0,H.jsx)(T,{addMargin:!1,planContent:h})}):(0,H.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,H.jsx)(c,{bold:!0,dimColor:!0,children:`Prompt`}),(0,H.jsx)(c,{wrap:`wrap`,children:g})]}),e.status===`failed`&&e.error&&(0,H.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,H.jsx)(c,{bold:!0,color:`error`,children:`Error`}),(0,H.jsx)(c,{color:`error`,wrap:`wrap`,children:e.error})]})]})})})}var De,H,Oe=e((()=>{De=t(u(),1),V(),f(),M(),ge(),g(),F(),x(),w(),xe(),Te(),H=m()}));function U({status:e,label:t,suffix:n}){return(0,W.jsxs)(c,{color:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:void 0,dimColor:!0,children:[`(`,t??e,n,`)`]})}function ke({shell:e}){switch(e.status){case`completed`:return(0,W.jsx)(U,{status:`completed`,label:`done`});case`failed`:return(0,W.jsx)(U,{status:`failed`,label:`error`});case`killed`:return(0,W.jsx)(U,{status:`killed`,label:`stopped`});case`running`:case`pending`:return(0,W.jsx)(U,{status:`running`})}}var W,Ae=e((()=>{f(),W=m()}));function je({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,G.jsxs)(c,{children:[I(e.command,n,!0),` `,(0,G.jsx)(ke,{shell:e})]});case`local_agent`:return(0,G.jsxs)(c,{children:[I(e.description,n,!0),` `,(0,G.jsx)(U,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`local_workflow`:{let t=e;return(0,G.jsxs)(c,{children:[I(t.workflowName??e.summary??e.description,n,!0),` `,(0,G.jsx)(U,{status:e.status,label:e.status===`running`?`${t.agentCount} ${L(t.agentCount,`agent`)}`:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}case`dream`:{let t=e.filesTouched.length,n=e.phase===`updating`&&t>0?`${t} ${L(t,`file`)}`:`${e.sessionsReviewing} ${L(e.sessionsReviewing,`session`)}`;return(0,G.jsxs)(c,{children:[e.description,` `,(0,G.jsxs)(c,{dimColor:!0,children:[`· `,e.phase,` · `,n]}),` `,(0,G.jsx)(U,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}}}var G,Me=e((()=>{f(),F(),R(),Ae(),G=m()}));function Ne({task:e,onDone:t,onBack:n,onKill:r}){let o=z(e.startTime,e.status===`running`,1e3,0);a({"confirm:yes":t},{context:`Confirmation`});let u=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&n?(i.preventDefault(),n()):i.key===`x`&&e.status===`running`&&r&&(i.preventDefault(),r())},d=e.turns.filter(e=>e.text!==``),f=d.slice(-6),m=d.length-f.length;return(0,K.jsx)(s,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:u,children:(0,K.jsx)(p,{title:`Memory consolidation`,subtitle:(0,K.jsxs)(c,{dimColor:!0,children:[o,` · reviewing `,e.sessionsReviewing,` `,L(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,K.jsxs)(K.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,L(e.filesTouched.length,`file`),` touched`]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,K.jsxs)(c,{children:[`Press `,t.keyName,` again to exit`]}):(0,K.jsxs)(l,{children:[n&&(0,K.jsx)(i,{shortcut:`←`,action:`go back`}),(0,K.jsx)(i,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,K.jsx)(i,{shortcut:`x`,action:`stop`})]}),children:(0,K.jsxs)(s,{flexDirection:`column`,gap:1,children:[(0,K.jsxs)(c,{children:[(0,K.jsx)(c,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,K.jsx)(c,{color:`background`,children:`running`}):e.status===`completed`?(0,K.jsx)(c,{color:`success`,children:e.status}):(0,K.jsx)(c,{color:`error`,children:e.status})]}),f.length===0?(0,K.jsx)(c,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,K.jsxs)(K.Fragment,{children:[m>0&&(0,K.jsxs)(c,{dimColor:!0,children:[`(`,m,` earlier `,L(m,`turn`),`)`]}),f.map((e,t)=>(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(c,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,K.jsxs)(c,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,L(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var K,Pe=e((()=>{V(),f(),M(),R(),K=m()}));async function Fe(e){let t=N(e.id);try{let e=await ae(t,Y);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function Ie({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:o}=d(),[u,f]=(0,q.useState)(()=>Fe(e)),m=(0,q.useDeferredValue)(u);(0,q.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(Fe(t)),1e3,f,e);return()=>clearInterval(t)},[e.id,e.status]);let h=()=>t(`Shell details dismissed`,{display:`system`});a({"confirm:yes":h},{context:`Confirmation`});let g=i=>{i.key===` `?(i.preventDefault(),t(`Shell details dismissed`,{display:`system`})):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},_=ue(e.command,280);return(0,J.jsx)(s,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:(0,J.jsxs)(p,{title:`Shell details`,onCancel:h,color:`background`,inputGuide:t=>t.pending?(0,J.jsxs)(c,{children:[`Press `,t.keyName,` again to exit`]}):(0,J.jsxs)(l,{children:[r&&(0,J.jsx)(i,{shortcut:`←`,action:`go back`}),(0,J.jsx)(i,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,J.jsx)(i,{shortcut:`x`,action:`stop`})]}),children:[(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsxs)(c,{children:[(0,J.jsx)(c,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,J.jsxs)(c,{color:`background`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):e.status===`completed`?(0,J.jsxs)(c,{color:`success`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):(0,J.jsxs)(c,{color:`error`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]})]}),(0,J.jsxs)(c,{children:[(0,J.jsx)(c,{bold:!0,children:`Runtime:`}),` `,fe((e.endTime??Date.now())-e.startTime)]}),(0,J.jsxs)(c,{wrap:`wrap`,children:[(0,J.jsx)(c,{bold:!0,children:`Command:`}),` `,_]})]}),(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsx)(c,{bold:!0,children:`Output:`}),(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(c,{dimColor:!0,children:`Loading output…`}),children:(0,J.jsx)(Le,{outputPromise:m,columns:o})})]})]})})}function Le({outputPromise:e,columns:t}){let{content:n,bytesTotal:r}=(0,q.use)(e);if(!n)return(0,J.jsx)(c,{dimColor:!0,children:`No output available`});let i=[],a=n.length;for(let e=0;e<10&&a>0;e++){let e=n.lastIndexOf(`
|
|
2
|
+
`,a-1);i.push(e+1),a=e}i.reverse();let o=r>n.length,l=[];for(let e=0;e<i.length;e++){let t=i[e],r=e<i.length-1?i[e+1]-1:n.length,a=n.slice(t,r);a&&l.push(a)}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(s,{borderStyle:`round`,paddingX:1,flexDirection:`column`,height:12,maxWidth:t-6,children:l.map((e,t)=>(0,J.jsx)(c,{wrap:`truncate-end`,children:e},t))}),(0,J.jsxs)(c,{dimColor:!0,italic:!0,children:[`Showing ${l.length} lines`,o?` of ${pe(r)}`:``]})]})}var q,J,Y,Re=e((()=>{q=t(u(),1),j(),f(),M(),F(),oe(),v(),J=m(),Y=8192}));function ze(e,t){return Object.values(e??{}).filter(E).filter(e=>!(e.type===`local_agent`&&e.id===t))}function Be({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=h(e=>e.tasks),o=h(e=>e.foregroundedTaskId),u=ee(),d=ie(`chat:killAgents`,`Chat`,`ctrl+x ctrl+k`),f=r,m=(0,Z.useRef)(!1),[g,_]=(0,Z.useState)(()=>{if(n)return m.current=!0,{mode:`detail`,itemId:n};let e=ze(f,o);return e.length===1?(m.current=!0,{mode:`detail`,itemId:e[0].id}):{mode:`list`}}),[v,y]=(0,Z.useState)(0);_e(`background-tasks-dialog`);let{bashTasks:b,agentTasks:x,workflowTasks:S,dreamTasks:C,allSelectableItems:w}=(0,Z.useMemo)(()=>{let e=Object.values(f??{}).filter(E).map(Ve).sort((e,t)=>{let n=e.status,r=t.status;if(n===`running`&&r!==`running`)return-1;if(n!==`running`&&r===`running`)return 1;let i=`task`in e?e.task.startTime:0;return(`task`in t?t.task.startTime:0)-i}),t=e.filter(e=>e.type===`local_bash`),n=e.filter(e=>e.type===`local_agent`&&e.id!==o),r=e.filter(e=>e.type===`local_workflow`),i=e.filter(e=>e.type===`dream`);return{bashTasks:t,agentTasks:n,workflowTasks:r,dreamTasks:i,allSelectableItems:[...t,...n,...r,...i]}},[f,o]),T=w[v]??null;a({"confirm:previous":()=>y(e=>Math.max(0,e-1)),"confirm:next":()=>y(e=>Math.min(w.length-1,e+1)),"confirm:yes":()=>{let e=w[v];e&&_({mode:`detail`,itemId:e.id})}},{context:`Confirmation`,isActive:g.mode===`list`});let D=t=>{if(g.mode!==`list`)return;if(t.key===`left`){t.preventDefault(),e(`Background tasks dialog dismissed`,{display:`system`});return}let n=w[v];n&&t.key===`x`&&(t.preventDefault(),n.type===`local_bash`&&n.status===`running`?O(n.id):n.type===`local_agent`&&n.status===`running`?k(n.id):n.type===`local_workflow`&&n.status===`running`?$(n.id,u):n.type===`dream`&&n.status===`running`&&A(n.id))};async function O(e){await ne.kill(e,u)}async function k(e){await re.kill(e,u)}async function A(e){await te.kill(e,u)}let j=(0,Z.useEffectEvent)(e);(0,Z.useEffect)(()=>{if(g.mode!==`list`){let e=f?.[g.itemId];(!e||e.type!==`local_workflow`&&!E(e))&&(m.current?j(`Background tasks dialog dismissed`,{display:`system`}):_({mode:`list`}))}let e=w.length;v>=e&&e>0&&y(e-1)},[g,f,v,w,j]);let M=()=>{m.current&&w.length<=1?e(`Background tasks dialog dismissed`,{display:`system`}):(m.current=!1,_({mode:`list`}))};if(g.mode!==`list`&&f){let t=f[g.itemId];if(!t)return null;switch(t.type){case`local_bash`:return(0,Q.jsx)(Ie,{shell:t,onDone:e,onKillShell:()=>void O(t.id),onBack:M},`shell-${t.id}`);case`local_agent`:return(0,Q.jsx)(Ee,{agent:t,onDone:e,onKillAgent:()=>void k(t.id),onBack:M},`agent-${t.id}`);case`local_workflow`:{let e=t.status===`running`?()=>$(t.id,u):void 0;return(0,Q.jsx)(s,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:t=>{t.key===`left`?(t.preventDefault(),M()):t.key===`x`&&e&&(t.preventDefault(),e())},children:(0,Q.jsx)(p,{title:t.workflowName,subtitle:(0,Q.jsxs)(c,{dimColor:!0,children:[t.status,t.summary?` · ${t.summary}`:``]}),onCancel:M,inputGuide:()=>(0,Q.jsxs)(l,{children:[(0,Q.jsx)(i,{shortcut:`←`,action:`go back`}),(0,Q.jsx)(i,{shortcut:`Esc`,action:`close`}),e&&(0,Q.jsx)(i,{shortcut:`x`,action:`stop`})]}),children:t.status===`failed`&&t.error?(0,Q.jsxs)(c,{color:`error`,children:[`失败原因:`,t.error]}):null})},`workflow-${t.id}`)}case`dream`:return(0,Q.jsx)(Ne,{task:t,onDone:()=>e(`Background tasks dialog dismissed`,{display:`system`}),onBack:M,onKill:t.status===`running`?()=>void A(t.id):void 0},`dream-${t.id}`)}}let N=le(b,e=>e.status===`running`),P=le(x,e=>e.status===`running`),ae=ce([...N>0?[(0,Q.jsxs)(c,{children:[N,` `,N===1?`active shell`:`active shells`]},`shells`)]:[],...P>0?[(0,Q.jsxs)(c,{children:[P,` `,P===1?`active agent`:`active agents`]},`agents`)]:[]],e=>(0,Q.jsx)(c,{children:` · `},`separator-${e}`)),oe=[(0,Q.jsx)(i,{shortcut:`↑/↓`,action:`select`},`upDown`),(0,Q.jsx)(i,{shortcut:`Enter`,action:`view`},`enter`),...(T?.type===`local_bash`||T?.type===`local_agent`||T?.type===`local_workflow`||T?.type===`dream`)&&T.status===`running`?[(0,Q.jsx)(i,{shortcut:`x`,action:`stop`},`kill`)]:[],...x.some(e=>e.status===`running`)?[(0,Q.jsx)(i,{shortcut:d,action:`stop all agents`},`kill-all`)]:[],(0,Q.jsx)(i,{shortcut:`←/Esc`,action:`close`},`esc`)],se=()=>e(`Background tasks dialog dismissed`,{display:`system`});function ue(e){return e.pending?(0,Q.jsxs)(c,{children:[`Press `,e.keyName,` again to exit`]}):(0,Q.jsx)(l,{children:oe})}return(0,Q.jsx)(s,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:D,children:(0,Q.jsx)(p,{title:`Background tasks`,subtitle:ae,onCancel:se,color:`background`,inputGuide:ue,children:w.length===0?(0,Q.jsx)(c,{dimColor:!0,children:`No tasks currently running`}):(0,Q.jsxs)(s,{flexDirection:`column`,children:[b.length>0&&(0,Q.jsxs)(s,{flexDirection:`column`,children:[x.length>0&&(0,Q.jsxs)(c,{dimColor:!0,children:[(0,Q.jsxs)(c,{bold:!0,children:[` `,`Shells`]}),` (`,b.length,`)`]}),(0,Q.jsx)(s,{flexDirection:`column`,children:b.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===T?.id},e.id))})]}),x.length>0&&(0,Q.jsxs)(s,{flexDirection:`column`,marginTop:+(b.length>0),children:[(0,Q.jsxs)(c,{dimColor:!0,children:[(0,Q.jsxs)(c,{bold:!0,children:[` `,`Local agents`]}),` (`,x.length,`)`]}),(0,Q.jsx)(s,{flexDirection:`column`,children:x.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===T?.id},e.id))})]}),S.length>0&&(0,Q.jsxs)(s,{flexDirection:`column`,marginTop:+(b.length>0||x.length>0),children:[(0,Q.jsxs)(c,{dimColor:!0,children:[(0,Q.jsxs)(c,{bold:!0,children:[` `,`Workflows`]}),` (`,S.length,`)`]}),(0,Q.jsx)(s,{flexDirection:`column`,children:S.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===T?.id},e.id))})]}),C.length>0&&(0,Q.jsx)(s,{flexDirection:`column`,marginTop:+(b.length>0||x.length>0||S.length>0),children:(0,Q.jsx)(s,{flexDirection:`column`,children:C.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===T?.id},e.id))})})]})})})}function Ve(e){switch(e.type){case`local_bash`:return{id:e.id,type:`local_bash`,label:e.command,status:e.status,task:e};case`local_agent`:return{id:e.id,type:`local_agent`,label:e.description,status:e.status,task:e};case`local_workflow`:return{id:e.id,type:`local_workflow`,label:e.summary??e.description,status:e.status,task:e};case`dream`:return{id:e.id,type:`dream`,label:e.description,status:e.status,task:e}}}function X({item:e,isSelected:t}){let{columns:n}=d(),i=Math.max(30,n-26);return(0,Q.jsxs)(s,{flexDirection:`row`,children:[(0,Q.jsx)(c,{children:t?`${r.pointer} `:` `}),(0,Q.jsx)(c,{color:t?`suggestion`:void 0,children:(0,Q.jsx)(je,{task:e.task,maxActivityWidth:i})})]})}var Z,Q,$,He=e((()=>{n(),Z=t(u(),1),j(),P(),y(),A(),O(),D(),se(),ve(),f(),M(),k(),Oe(),Me(),Pe(),Re(),b(),Q=m(),$=C}));export{V as a,we as i,He as n,z as o,Te as r,Be as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,Lt as n,P as r,ai as i,kt as a,t as o,y as s}from"./src-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,Lt as n,P as r,ai as i,kt as a,t as o,y as s}from"./src-WZ94ZKI3.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{gi as l,hi as u}from"./loadAgentsDir-DR5PVAc3.js";import{m as d,y as f}from"./settings-YIDksG5Z.js";import{n as p}from"./analytics-COpjZpvd.js";import{t as m}from"./select-FrwoTzuc.js";import{t as h}from"./CustomSelect-CpMbxYbt.js";var g=e(i(),1);p(),o(),l(),d(),h();var _=c();function v({onAccept:e}){let[i,o]=g.useState(null);g.useEffect(()=>{if(i!==null){let e=i,t=setTimeout(()=>u(e));return()=>clearTimeout(t)}},[i]),g.useEffect(()=>{},[]);function c(t){switch(t){case`accept`:f(`userSettings`,{skipDangerousModePermissionPrompt:!0}),e();break;case`decline`:o(1);break}}let l=(0,g.useCallback)(()=>{o(0)},[]);return i===null?(0,_.jsxs)(s,{title:`WARNING: Work Mate running in Bypass Permissions mode`,color:`error`,onCancel:l,children:[(0,_.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,_.jsxs)(r,{children:[`In Bypass Permissions mode, Work Mate will not ask for your approval before running potentially dangerous commands.`,(0,_.jsx)(a,{}),`This mode should only be used in a sandboxed container/VM that has restricted internet access and can easily be restored if damaged.`]}),(0,_.jsx)(r,{children:`By proceeding, you accept all responsibility for actions taken while running in Bypass Permissions mode.`}),(0,_.jsx)(n,{url:`https://code.workmate.com/docs/en/security`})]}),(0,_.jsx)(m,{options:[{label:`No, exit`,value:`decline`},{label:`Yes, I accept`,value:`accept`}],onChange:e=>c(e)})]}):null}export{v as BypassPermissionsModeDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t}from"./SelectMulti-BpAjjhsn.js";import{n}from"./select-FrwoTzuc.js";var r=e((()=>{t(),n()}));export{r as t};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{C as i,Gt as a,I as o,P as s,T as c,ai as l,ot as u,t as d,y as f}from"./src-WZ94ZKI3.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{Sh as m,nb as h,rb as ee,sb as g,tb as _,xh as v}from"./loadAgentsDir-DR5PVAc3.js";import{n as y,t as b}from"./cwd-DrEEb4f5.js";import{Ar as x,Cn as S,Nr as C,Pr as w,kn as T,kr as E}from"./settings-YIDksG5Z.js";import{i as D,t as O}from"./execFileNoThrow-BfZFnCGa.js";import{_ as k,x as te}from"./startupProfiler-DIM_Ihyp.js";import{l as A,o as j}from"./stringUtils-D_xPrwGQ.js";import{i as ne,t as re}from"./overlayContext-B6i_6y_0.js";import{r as ie}from"./detectRepository-M6K2wc7h.js";import{join as ae,resolve as oe}from"path";import{access as M}from"fs/promises";async function se(){if(!await x()||await N())return null;let{stdout:e,code:t}=await O(C(),[`--no-optional-locks`,`diff`,`HEAD`,`--shortstat`],{timeout:F,preserveOutputOnError:!1});if(t===0){let t=de(e);if(t&&t.filesCount>z)return{stats:t,perFileStats:new Map,hunks:new Map}}let{stdout:n,code:r}=await O(C(),[`--no-optional-locks`,`diff`,`HEAD`,`--numstat`],{timeout:F,preserveOutputOnError:!1});if(r!==0)return null;let{stats:i,perFileStats:a}=le(n),o=I-a.size;if(o>0){let e=await P(o);if(e){i.filesCount+=e.size;for(let[t,n]of e)a.set(t,n)}}return{stats:i,perFileStats:a,hunks:new Map}}async function ce(){if(!await x()||await N())return new Map;let{stdout:e,code:t}=await O(C(),[`--no-optional-locks`,`diff`,`HEAD`],{timeout:F,preserveOutputOnError:!1});return t===0?ue(e):new Map}function le(e){let t=e.trim().split(`
|
|
2
|
+
`).filter(Boolean),n=0,r=0,i=0,a=new Map;for(let e of t){let t=e.split(` `);if(t.length<3)continue;i++;let o=t[0],s=t[1],c=t.slice(2).join(` `),l=o===`-`||s===`-`,u=l?0:parseInt(o??`0`,10)||0,d=l?0:parseInt(s??`0`,10)||0;n+=u,r+=d,a.size<I&&a.set(c,{added:u,removed:d,isBinary:l})}return{stats:{filesCount:i,linesAdded:n,linesRemoved:r},perFileStats:a}}function ue(e){let t=new Map;if(!e.trim())return t;let n=e.split(/^diff --git /m).filter(Boolean);for(let e of n){if(t.size>=I)break;if(e.length>L)continue;let n=e.split(`
|
|
3
|
+
`),r=n[0]?.match(/^a\/(.+?) b\/(.+)$/);if(!r)continue;let i=r[2]??r[1]??``,a=[],o=null,s=0;for(let e=1;e<n.length;e++){let t=n[e]??``,r=t.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);if(r){o&&a.push(o),o={oldStart:parseInt(r[1]??`0`,10),oldLines:parseInt(r[2]??`1`,10),newStart:parseInt(r[3]??`0`,10),newLines:parseInt(r[4]??`1`,10),lines:[]};continue}if(!(t.startsWith(`index `)||t.startsWith(`---`)||t.startsWith(`+++`)||t.startsWith(`new file`)||t.startsWith(`deleted file`)||t.startsWith(`old mode`)||t.startsWith(`new mode`)||t.startsWith(`Binary files`))&&o&&(t.startsWith(`+`)||t.startsWith(`-`)||t.startsWith(` `)||t===``)){if(s>=R)continue;o.lines.push(`${t}`),s++}}o&&a.push(o),a.length>0&&t.set(i,a)}return t}async function N(){let e=await E(b());return e?(await Promise.all([`MERGE_HEAD`,`REBASE_HEAD`,`CHERRY_PICK_HEAD`,`REVERT_HEAD`].map(t=>M(ae(e,t)).then(()=>!0).catch(()=>!1)))).some(Boolean):!1}async function P(e){let{stdout:t,code:n}=await O(C(),[`--no-optional-locks`,`ls-files`,`--others`,`--exclude-standard`],{timeout:F,preserveOutputOnError:!1});if(n!==0||!t.trim())return null;let r=t.trim().split(`
|
|
4
|
+
`).filter(Boolean);if(r.length===0)return null;let i=new Map;for(let t of r.slice(0,e))i.set(t,{added:0,removed:0,isBinary:!1,isUntracked:!0});return i}function de(e){let t=e.match(/(\d+)\s+files?\s+changed(?:,\s+(\d+)\s+insertions?\(\+\))?(?:,\s+(\d+)\s+deletions?\(-\))?/);return t?{filesCount:parseInt(t[1]??`0`,10),linesAdded:parseInt(t[2]??`0`,10),linesRemoved:parseInt(t[3]??`0`,10)}:null}var F,I,L,R,z,B=e((()=>{y(),ie(),D(),S(),w(),F=5e3,I=50,L=1e6,R=400,z=500}));function V(){let[e,t]=(0,H.useState)(null),[n,r]=(0,H.useState)(new Map),[i,a]=(0,H.useState)(!0);return(0,H.useEffect)(()=>{let e=!1;async function n(){try{let[n,i]=await Promise.all([se(),ce()]);e||(t(n),r(i),a(!1))}catch{e||(t(null),r(new Map),a(!1))}}return n(),()=>{e=!0}},[]),(0,H.useMemo)(()=>{if(!e)return{stats:null,files:[],hunks:new Map,loading:i};let{stats:t,perFileStats:r}=e,a=[];for(let[e,t]of r){let r=n.get(e),i=t.isUntracked??!1,o=!t.isBinary&&!i&&!r,s=t.added+t.removed,c=!o&&!t.isBinary&&s>U;a.push({path:e,linesAdded:t.added,linesRemoved:t.removed,isBinary:t.isBinary,isLargeFile:o,isTruncated:c,isUntracked:i})}return a.sort((e,t)=>e.path.localeCompare(t.path)),{stats:t,files:a,hunks:n,loading:!1}},[e,n,i])}var H,U,fe=e((()=>{H=t(l(),1),B(),U=400}));function pe(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.filePath==`string`,r=Array.isArray(t.structuredPatch)&&t.structuredPatch.length>0,i=t.type===`create`&&typeof t.content==`string`;return n&&(r||i)}function W(e){return`type`in e&&(e.type===`create`||e.type===`update`)}function me(e){let t=0,n=0;for(let r of e)for(let e of r.lines)e.startsWith(`+`)?t++:e.startsWith(`-`)&&n++;return{added:t,removed:n}}function he(e){if(e.type!==`user`)return``;let t=e.message.content,n=typeof t==`string`?t:``;return n.length<=30?n:`${n.slice(0,29)}…`}function G(e){let t=0,n=0;for(let r of e.files.values())t+=r.linesAdded,n+=r.linesRemoved;e.stats={filesChanged:e.files.size,linesAdded:t,linesRemoved:n}}function ge(e){let t=(0,K.useRef)({completedTurns:[],currentTurn:null,lastProcessedIndex:0,lastTurnIndex:0});return(0,K.useMemo)(()=>{let n=t.current;e.length<n.lastProcessedIndex&&(n.completedTurns=[],n.currentTurn=null,n.lastProcessedIndex=0,n.lastTurnIndex=0);for(let t=n.lastProcessedIndex;t<e.length;t++){let r=e[t];if(r?.type===`user`){if(!(r.toolUseResult||Array.isArray(r.message.content)&&r.message.content[0]?.type===`tool_result`)&&!r.isMeta)n.currentTurn&&n.currentTurn.files.size>0&&(G(n.currentTurn),n.completedTurns.push(n.currentTurn)),n.lastTurnIndex++,n.currentTurn={turnIndex:n.lastTurnIndex,userPromptPreview:he(r),timestamp:r.timestamp,files:new Map,stats:{filesChanged:0,linesAdded:0,linesRemoved:0}};else if(n.currentTurn&&r.toolUseResult){let e=r.toolUseResult;if(pe(e)){let{filePath:t,structuredPatch:r}=e,i=`type`in e&&e.type===`create`,a=n.currentTurn.files.get(t);if(a||(a={filePath:t,hunks:[],isNewFile:i,linesAdded:0,linesRemoved:0},n.currentTurn.files.set(t,a)),i&&r.length===0&&W(e)){let t=e.content.split(`
|
|
5
|
+
`),n={oldStart:0,oldLines:0,newStart:1,newLines:t.length,lines:t.map(e=>`+${e}`)};a.hunks.push(n),a.linesAdded+=t.length}else{a.hunks.push(...r);let{added:e,removed:t}=me(r);a.linesAdded+=e,a.linesRemoved+=t}i&&(a.isNewFile=!0)}}}}n.lastProcessedIndex=e.length;let r=[...n.completedTurns];return n.currentTurn&&n.currentTurn.files.size>0&&(G(n.currentTurn),r.push(n.currentTurn)),r.reverse()},[e])}var K,_e=e((()=>{K=t(l(),1)}));function ve({filePath:e,hunks:t,isLargeFile:n,isBinary:r,isTruncated:a,isUntracked:c}){let{columns:l}=u(),{firstLine:d,fileContent:f}=(0,q.useMemo)(()=>{if(!e)return{firstLine:null,fileContent:void 0};let t=T(oe(b(),e));return{firstLine:t?.split(`
|
|
6
|
+
`)[0]??null,fileContent:t??void 0}},[e]);return c?(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(o,{children:[(0,J.jsx)(s,{bold:!0,children:e}),(0,J.jsx)(s,{dimColor:!0,children:` (untracked)`})]}),(0,J.jsx)(i,{padding:4}),(0,J.jsxs)(o,{flexDirection:`column`,children:[(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`New file not yet staged.`}),(0,J.jsxs)(s,{dimColor:!0,italic:!0,children:["Run `git add ",e,"` to see line counts."]})]})]}):r?(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(o,{children:(0,J.jsx)(s,{bold:!0,children:e})}),(0,J.jsx)(i,{padding:4}),(0,J.jsx)(o,{flexDirection:`column`,children:(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`Binary file - cannot display diff`})})]}):n?(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(o,{children:(0,J.jsx)(s,{bold:!0,children:e})}),(0,J.jsx)(i,{padding:4}),(0,J.jsx)(o,{flexDirection:`column`,children:(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`Large file - diff exceeds 1 MB limit`})})]}):(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(o,{children:[(0,J.jsx)(s,{bold:!0,children:e}),a&&(0,J.jsx)(s,{dimColor:!0,children:` (truncated)`})]}),(0,J.jsx)(i,{padding:4}),(0,J.jsx)(o,{flexDirection:`column`,children:t.length===0?(0,J.jsx)(s,{dimColor:!0,children:`No diff content`}):t.map((t,n)=>(0,J.jsx)(v,{patch:t,filePath:e,firstLine:d,fileContent:f,dim:!1,width:l-2-2},n))}),a&&(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`… diff truncated (exceeded 400 line limit)`})]})}var q,J,ye=e((()=>{q=t(l(),1),g(),d(),y(),S(),m(),J=p()}));function be({files:e,selectedIndex:t}){let{columns:n}=u(),{startIndex:r,endIndex:i}=(0,Y.useMemo)(()=>{if(e.length===0||e.length<=Z)return{startIndex:0,endIndex:e.length};let n=Math.max(0,t-Math.floor(Z/2)),r=n+Z;return r>e.length&&(r=e.length,n=Math.max(0,r-Z)),{startIndex:n,endIndex:r}},[e.length,t]);if(e.length===0)return(0,X.jsx)(s,{dimColor:!0,children:`No changed files`});let a=e.slice(r,i),c=r>0,l=i<e.length,d=e.length>Z,f=Math.max(20,n-16-3-4);return(0,X.jsxs)(o,{flexDirection:`column`,children:[d&&(0,X.jsx)(s,{dimColor:!0,children:c?` ↑ ${r} more ${A(r,`file`)}`:` `}),a.map((e,n)=>(0,X.jsx)(xe,{file:e,isSelected:r+n===t,maxPathWidth:f},e.path)),d&&(0,X.jsx)(s,{dimColor:!0,children:l?` ↓ ${e.length-i} more ${A(e.length-i,`file`)}`:` `})]})}function xe({file:e,isSelected:t,maxPathWidth:n}){let i=te(e.path,n),a=`${t?`${r.pointer} `:` `}${i}`;return(0,X.jsxs)(o,{flexDirection:`row`,children:[(0,X.jsx)(s,{bold:t,color:t?`background`:void 0,inverse:t,children:a}),(0,X.jsx)(o,{flexGrow:1}),(0,X.jsx)(Se,{file:e,isSelected:t})]})}function Se({file:e,isSelected:t}){return e.isUntracked?(0,X.jsx)(s,{dimColor:!t,italic:!0,children:`untracked`}):e.isBinary?(0,X.jsx)(s,{dimColor:!t,italic:!0,children:`Binary file`}):e.isLargeFile?(0,X.jsx)(s,{dimColor:!t,italic:!0,children:`Large file modified`}):(0,X.jsxs)(s,{children:[e.linesAdded>0&&(0,X.jsxs)(s,{color:`diffAddedWord`,bold:t,children:[`+`,e.linesAdded]}),e.linesAdded>0&&e.linesRemoved>0&&` `,e.linesRemoved>0&&(0,X.jsxs)(s,{color:`diffRemovedWord`,bold:t,children:[`-`,e.linesRemoved]}),e.isTruncated&&(0,X.jsx)(s,{dimColor:!t,children:` (truncated)`})]})}var Y,X,Z,Ce=e((()=>{n(),Y=t(l(),1),g(),d(),k(),j(),X=p(),Z=5}));function we(e){let t=Array.from(e.files.values()).map(e=>({path:e.filePath,linesAdded:e.linesAdded,linesRemoved:e.linesRemoved,isBinary:!1,isLargeFile:!1,isTruncated:!1,isNewFile:e.isNewFile})).sort((e,t)=>e.path.localeCompare(t.path)),n=new Map;for(let t of e.files.values())n.set(t.filePath,t.hunks);return{stats:{filesCount:e.stats.filesChanged,linesAdded:e.stats.linesAdded,linesRemoved:e.stats.linesRemoved},files:t,hunks:n,loading:!1}}function Te({messages:e,onDone:t}){let n=V(),r=ge(e),[i,l]=(0,Q.useState)(`list`),[u,d]=(0,Q.useState)(0),[p,m]=(0,Q.useState)(0),h=(0,Q.useMemo)(()=>[{type:`current`},...r.map(e=>({type:`turn`,turn:e}))],[r]),g=h[p],_=g?.type===`turn`?g.turn:null,v=(0,Q.useMemo)(()=>_?we(_):n,[_,n]),y=v.files[u],b=(0,Q.useMemo)(()=>y&&v.hunks.get(y.path)||[],[y,v.hunks]);(0,Q.useEffect)(()=>{p>=h.length&&m(Math.max(0,h.length-1))},[h.length,p]);let x=(0,Q.useRef)(p);(0,Q.useEffect)(()=>{x.current!==p&&(d(0),x.current=p)},[p]),ne(`diff-dialog`),a({"diff:previousSource":()=>{i===`detail`?l(`list`):i===`list`&&h.length>1&&m(e=>Math.max(0,e-1))},"diff:nextSource":()=>{i===`list`&&h.length>1&&m(e=>Math.min(h.length-1,e+1))},"diff:back":()=>{i===`detail`&&l(`list`)},"diff:viewDetails":()=>{i===`list`&&y&&l(`detail`)},"diff:previousFile":()=>{i===`list`&&d(e=>Math.max(0,e-1))},"diff:nextFile":()=>{i===`list`&&d(e=>Math.min(v.files.length-1,e+1))}},{context:`DiffDialog`});let S=v.stats?(0,$.jsxs)(s,{dimColor:!0,children:[v.stats.filesCount,` `,A(v.stats.filesCount,`file`),` changed`,v.stats.linesAdded>0&&(0,$.jsxs)(s,{color:`diffAddedWord`,children:[` +`,v.stats.linesAdded]}),v.stats.linesRemoved>0&&(0,$.jsxs)(s,{color:`diffRemovedWord`,children:[` -`,v.stats.linesRemoved]})]}):null,C=_?`Turn ${_.turnIndex}`:`Uncommitted changes`,w=_?_.userPromptPreview?`"${_.userPromptPreview}"`:``:`(git diff HEAD)`,T=h.length>1?(0,$.jsxs)(o,{children:[p>0&&(0,$.jsx)(s,{dimColor:!0,children:`◀ `}),h.map((e,t)=>{let n=t===p,r=e.type===`current`?`Current`:`T${e.turn.turnIndex}`;return(0,$.jsxs)(s,{dimColor:!n,bold:n,children:[t>0?` · `:``,r]},t)}),p<h.length-1&&(0,$.jsx)(s,{dimColor:!0,children:` ▶`})]}):null,E=ee(`diff:dismiss`,`DiffDialog`,`esc`),D=v.loading?`Loading diff…`:_?`No file changes in this turn`:v.stats&&v.stats.filesCount>0&&v.files.length===0?`Too many files to display details`:`Working tree is clean`,O=(0,$.jsxs)(s,{children:[C,w&&(0,$.jsxs)(s,{dimColor:!0,children:[` `,w]})]});function k(){i===`detail`?l(`list`):t(`Diff dialog dismissed`,{display:`system`})}return(0,$.jsxs)(f,{title:O,onCancel:k,color:`background`,inputGuide:e=>e.pending?(0,$.jsxs)(s,{children:[`Press `,e.keyName,` again to exit`]}):i===`list`?(0,$.jsxs)(c,{children:[h.length>1&&(0,$.jsx)(s,{children:`←/→ source`}),(0,$.jsx)(s,{children:`↑/↓ select`}),(0,$.jsx)(s,{children:`Enter view`}),(0,$.jsxs)(s,{children:[E,` close`]})]}):(0,$.jsxs)(c,{children:[(0,$.jsx)(s,{children:`← back`}),(0,$.jsxs)(s,{children:[E,` close`]})]}),children:[T,S,v.files.length===0?(0,$.jsx)(o,{marginTop:1,children:(0,$.jsx)(s,{dimColor:!0,children:D})}):i===`list`?(0,$.jsx)(o,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(be,{files:v.files,selectedIndex:u})}):(0,$.jsx)(o,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(ve,{filePath:y?.path||``,hunks:b,isLargeFile:y?.isLargeFile,isBinary:y?.isBinary,isTruncated:y?.isTruncated,isUntracked:y?.isUntracked})})]})}var Q,$;e((()=>{Q=t(l(),1),re(),fe(),_e(),d(),_(),h(),j(),ye(),Ce(),$=p()}))();export{Te as DiffDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./Doctor-DJOMbSDE.js";e();export{t as Doctor};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{i as n,o as r}from"./envUtils-DZ_SvEVz.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{Gt as o,I as s,P as c,ai as l,t as u,x as d}from"./src-WZ94ZKI3.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{Pt as p,q as ee}from"./state-CXY-q5gr.js";import{A_ as m,Al as h,Bb as g,Bh as _,Cy as v,Dy as y,Ey as b,Ib as te,Ki as x,Lb as ne,Mx as re,Nx as S,Ol as ie,Rb as C,aC as w,k_ as ae,kl as oe,ky as se,qi as T,sC as E,tb as ce,zb as D,zh as O}from"./loadAgentsDir-DR5PVAc3.js";import{B as k,Cn as A,L as j,On as M}from"./settings-YIDksG5Z.js";import{l as N,o as P}from"./stringUtils-D_xPrwGQ.js";import{at as F,f as I,nt as L,s as R}from"./model-D42epddJ.js";import{a as z,i as B,r as V,s as H}from"./sleep-BbWr_FL1.js";import{n as U,t as W}from"./ValidationErrorsList-C_gDQfm1.js";import{n as G,t as le}from"./useExitOnCtrlCDWithKeybindings-BgJrnuDl.js";import{f as ue,g as de,h as fe,i as pe,n as me,o as he,p as ge,r as _e}from"./pidLock-YvAaIrIY.js";import{n as ve,t as ye}from"./McpParsingWarnings-BYG2yqjO.js";import{n as be,t as xe}from"./PressEnterToContinue-CPOaYnym.js";import{n as Se,t as Ce}from"./useSettingsErrors-CO0fTNzn.js";import{n as we,t as Te}from"./shadowedRuleDetection-D6R2OeoH.js";import{n as Ee,r as De,t as K}from"./statusNoticeHelpers-DI45AH-c.js";import{join as q}from"path";function Oe(){if(!H())return null;let e=V();if(e.length===0)return null;let t=e.filter(e=>e.severity===`error`),n=e.filter(e=>e.severity===`warning`);return(0,J.jsxs)(s,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,J.jsx)(c,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`Location: `}),(0,J.jsx)(c,{dimColor:!0,children:B()})]}),(0,J.jsxs)(s,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`└ `}),(0,J.jsx)(c,{color:`error`,children:`[Error]`}),(0,J.jsxs)(c,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(s,{marginLeft:3,children:(0,J.jsxs)(c,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`└ `}),(0,J.jsx)(c,{color:`warning`,children:`[Warning]`}),(0,J.jsxs)(c,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(s,{marginLeft:3,children:(0,J.jsxs)(c,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var J,ke=e((()=>{u(),z(),J=f()}));function Ae(){if(!w.isSupportedPlatform()||!w.isSandboxEnabledInSettings())return null;let e=w.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,Y.jsxs)(s,{flexDirection:`column`,children:[(0,Y.jsx)(c,{bold:!0,children:`Sandbox`}),(0,Y.jsxs)(c,{children:[`└ Status: `,(0,Y.jsx)(c,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,Y.jsxs)(c,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,Y.jsxs)(c,{color:`warning`,children:[`└ `,e]},t)),t&&(0,Y.jsx)(c,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var Y,je=e((()=>{u(),E(),Y=f()}));async function Me(){let e=b(await y());if(e.length===0)return null;let t=e.sort((e,t)=>t.content.length-e.content.length).map(e=>`${e.path}: ${e.content.length.toLocaleString()} chars`);return{type:`agentsmd_files`,severity:`warning`,message:e.length===1?`Large AGENTS.md file detected (${e[0].content.length.toLocaleString()} chars > ${v.toLocaleString()})`:`${e.length} large AGENTS.md files detected (each > ${v.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:v}}async function Ne(e){if(!e)return null;let t=Ee(e);if(t<=15e3)return null;let n=e.activeAgents.filter(e=>e.source!==`built-in`).map(e=>{let t=`${e.agentType}: ${e.whenToUse}`;return{name:e.agentType,tokens:T(t)}}).sort((e,t)=>t.tokens-e.tokens),r=n.slice(0,5).map(e=>`${e.name}: ~${e.tokens.toLocaleString()} tokens`);return n.length>5&&r.push(`(${n.length-5} more custom agents)`),{type:`agent_descriptions`,severity:`warning`,message:`Large agent descriptions (~${t.toLocaleString()} tokens > ${K.toLocaleString()})`,details:r,currentValue:t,threshold:K}}async function X(e,t,n){let r=e.filter(e=>e.isMcp);if(r.length===0)return null;try{let{mcpToolTokens:r,mcpToolDetails:i}=await ae(e,t,n,R());if(r<=Z)return null;let a=new Map;for(let e of i){let t=e.name.split(`__`)[1]||`unknown`,n=a.get(t)||{count:0,tokens:0};a.set(t,{count:n.count+1,tokens:n.tokens+e.tokens})}let o=Array.from(a.entries()).sort((e,t)=>t[1].tokens-e[1].tokens),s=o.slice(0,5).map(([e,t])=>`${e}: ${t.count} tools (~${t.tokens.toLocaleString()} tokens)`);return o.length>5&&s.push(`(${o.length-5} more servers)`),{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${r.toLocaleString()} tokens > ${Z.toLocaleString()})`,details:s,currentValue:r,threshold:Z}}catch{let e=r.reduce((e,t)=>e+T(((t.name?.length||0)+t.description.length).toString()),0);return e<=Z?null:{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${e.toLocaleString()} tokens estimated > ${Z.toLocaleString()})`,details:[`${r.length} MCP tools detected (token count estimated)`],currentValue:e,threshold:Z}}}async function Pe(e){let t=Te(await e(),{sandboxAutoAllowEnabled:w.isSandboxingEnabled()&&w.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${k(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${N(t.length,`unreachable permission rule`)} detected`,details:n,currentValue:t.length,threshold:0}}async function Fe(e,t,n){let[r,i,a,o]=await Promise.all([Me(),Ne(t),X(e,n,t),Pe(n)]);return{agentsMdWarning:r,agentWarning:i,mcpWarning:a,unreachableRulesWarning:o}}var Z,Ie=e((()=>{x(),m(),se(),I(),j(),we(),E(),De(),P(),Z=25e3}));function Le({onDone:e}){let t=_(e=>e.agentDefinitions),r=_(e=>e.mcp.tools),i=_(e=>e.toolPermissionContext),l=_(e=>e.plugins.errors);G();let u=(0,Q.useMemo)(()=>r||[],[r]),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(null),S=Se().filter(e=>e.mcpErrorMetadata===void 0),C=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:te,upperLimit:ne},{name:`TASK_MAX_OUTPUT_LENGTH`,default:ie,upperLimit:oe},{name:`WORKMATE_MAX_OUTPUT_TOKENS`,...L(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=g(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{fe().then(p),(async()=>{let e=q(n(),`agents`),r=q(ee(),`.workmate`,`agents`),{activeAgents:a,allAgents:o,failedFiles:s}=t,[c,l]=await Promise.all([M(e),M(r)]),d={activeAgents:a.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:r,userDirExists:c,projectDirExists:l,failedFiles:s};h(d);let f=await Fe(u,{activeAgents:a,allAgents:o,failedFiles:s},async()=>i);if(y(f),he()){let e=q(ue(),`claude`,`locks`),t=me(e),n=_e(e);x({enabled:!0,locks:n,locksDir:e,staleLocksCleaned:t})}else x({enabled:!1,locks:[],locksDir:``,staleLocksCleaned:0})})()},[i,u,t]);let w=(0,Q.useCallback)(()=>{e(`Work Mate diagnostics dismissed`,{display:`system`})},[e]);return o({"confirm:yes":w,"confirm:no":w},{context:`Confirmation`}),f?(0,$.jsxs)(d,{children:[(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Diagnostics`}),(0,$.jsxs)(c,{children:[`└ Currently running: `,f.installationType,` (`,f.version,`)`]}),f.packageManager&&(0,$.jsxs)(c,{children:[`└ Package manager: `,f.packageManager]}),(0,$.jsxs)(c,{children:[`└ Path: `,f.installationPath]}),(0,$.jsxs)(c,{children:[`└ Invoked: `,f.invokedBinary]}),(0,$.jsxs)(c,{children:[`└ Config install method: `,f.configInstallMethod]}),(0,$.jsxs)(c,{children:[`└ Search: `,f.ripgrepStatus.working?`OK`:`Not working`,` (`,f.ripgrepStatus.mode===`embedded`?`bundled`:f.ripgrepStatus.mode===`builtin`?`vendor`:f.ripgrepStatus.systemPath||`system`,`)`]}),f.ripgrepStatus.note&&(0,$.jsxs)(c,{color:`warning`,children:[`└ Note: `,f.ripgrepStatus.note]}),f.recommendation&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),(0,$.jsxs)(c,{color:`warning`,children:[`Recommendation: `,f.recommendation.split(`
|
|
2
|
+
`)[0]]}),(0,$.jsx)(c,{dimColor:!0,children:f.recommendation.split(`
|
|
3
|
+
`)[1]})]}),f.multipleInstallations.length>1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),(0,$.jsx)(c,{color:`warning`,children:`Warning: Multiple installations found`}),f.multipleInstallations.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.type,` at `,e.path]},t))]}),f.warnings.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),f.warnings.map((e,t)=>(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsxs)(c,{color:`warning`,children:[`Warning: `,e.issue]}),(0,$.jsxs)(c,{children:[`Fix: `,e.fix]})]},t))]}),S.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,$.jsx)(c,{bold:!0,children:`Invalid Settings`}),(0,$.jsx)(W,{errors:S})]})]}),(0,$.jsx)(Ae,{}),(0,$.jsx)(ye,{}),(0,$.jsx)(Oe,{}),C.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Environment Variables`}),C.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.name,`:`,` `,(0,$.jsx)(c,{color:e.status===`capped`?`warning`:`error`,children:e.message})]},t))]}),b?.enabled&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Version Locks`}),b.staleLocksCleaned>0&&(0,$.jsxs)(c,{dimColor:!0,children:[`└ Cleaned `,b.staleLocksCleaned,` stale lock(s)`]}),b.locks.length===0?(0,$.jsx)(c,{dimColor:!0,children:`└ No active version locks`}):b.locks.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.version,`: PID `,e.pid,` `,e.isProcessRunning?(0,$.jsx)(c,{children:`(running)`}):(0,$.jsx)(c,{color:`warning`,children:`(stale)`})]},t))]}),m?.failedFiles&&m.failedFiles.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`error`,children:`Agent Parse Errors`}),(0,$.jsxs)(c,{color:`error`,children:[`└ Failed to parse `,m.failedFiles.length,` agent file(s):`]}),m.failedFiles.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e.path,`: `,e.error]},t))]}),l.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`error`,children:`Plugin Errors`}),(0,$.jsxs)(c,{color:`error`,children:[`└ `,l.length,` plugin error(s) detected:`]}),l.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e.source||`unknown`,`plugin`in e&&e.plugin?` [${e.plugin}]`:``,`: `,re(e)]},t))]}),v?.unreachableRulesWarning&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`warning`,children:`Unreachable Permission Rules`}),(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,v.unreachableRulesWarning.message]})]}),v.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),v&&(v.agentsMdWarning||v.agentWarning||v.mcpWarning)&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Context Usage Warnings`}),v.agentsMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,v.agentsMdWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ Files:`]}),v.agentsMdWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),v.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,v.agentWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ Top contributors:`]}),v.agentWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),v.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,v.mcpWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ MCP servers:`]}),v.mcpWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(s,{children:(0,$.jsx)(xe,{})})]}):(0,$.jsx)(d,{children:(0,$.jsx)(c,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,Re=e((()=>{i(),Q=t(l(),1),ke(),ve(),F(),r(),p(),u(),be(),je(),U(),Ce(),le(),ce(),O(),S(),Ie(),de(),D(),A(),pe(),C(),h(),ge(),$=f()}));export{Re as n,Le as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{I as r,P as i,ai as a,t as o,y as s}from"./src-
|
|
2
|
-
`).filter(e=>e.trim()!==``),c(e)),m){let{stdout:t}=await D(`git`,[`rev-list`,`--count`,`${m.originalHeadCommit}..HEAD`]),n=parseInt(t.trim(),10)||0;if(
|
|
1
|
+
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{I as r,P as i,ai as a,t as o,y as s}from"./src-WZ94ZKI3.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{St as l,Tt as u,bb as d,ci as f,cw as p,gi as m,gr as h,mC as g,mi as _,pC as v,pt as y,sw as b,wt as x,xb as S,yt as C}from"./loadAgentsDir-DR5PVAc3.js";import{c as w,i as T}from"./debug-kBjDaVkQ.js";import{i as E,t as D}from"./execFileNoThrow-BfZFnCGa.js";import{n as O}from"./analytics-COpjZpvd.js";import{n as k,t as A}from"./select-FrwoTzuc.js";import{r as j,t as M}from"./Spinner-DhhSOFcN.js";function N(){(h(),e(f)).saveWorktreeState(null)}function P({onDone:e,onCancel:t}){let[n,a]=(0,F.useState)(`loading`),[o,c]=(0,F.useState)([]),[l,d]=(0,F.useState)(0),[f,p]=(0,F.useState)(),m=C();if((0,F.useEffect)(()=>{async function e(){let e=[],t=await D(`git`,[`status`,`--porcelain`]);if(t.stdout&&(e=t.stdout.split(`
|
|
2
|
+
`).filter(e=>e.trim()!==``),c(e)),m){let{stdout:t}=await D(`git`,[`rev-list`,`--count`,`${m.originalHeadCommit}..HEAD`]),n=parseInt(t.trim(),10)||0;if(d(n),e.length===0&&n===0){a(`removing`),y().then(()=>{process.chdir(m.originalCwd),S(m.originalCwd),N(),b.cache.clear?.(),p(`Worktree removed (no changes)`)}).catch(e=>{w(`Failed to clean up worktree: ${e}`,{level:`error`}),p(`Worktree cleanup failed, exiting anyway`)}).then(()=>{a(`done`)});return}else a(`asking`)}}e()},[m]),(0,F.useEffect)(()=>{n===`done`&&e(f)},[n,e,f]),!m)return e(`No active worktree session found`,{display:`system`}),null;if(n===`loading`||n===`done`)return null;async function h(e){if(!m)return;let t=!!m.tmuxSessionName;if(e===`keep`||e===`keep-with-tmux`)a(`keeping`),o.length,await x(),process.chdir(m.originalCwd),S(m.originalCwd),N(),b.cache.clear?.(),p(t?`Worktree kept. Your work is saved at ${m.worktreePath} on branch ${m.worktreeBranch}. Reattach to tmux session with: tmux attach -t ${m.tmuxSessionName}`:`Worktree kept. Your work is saved at ${m.worktreePath} on branch ${m.worktreeBranch}`),a(`done`);else if(e===`keep-kill-tmux`)a(`keeping`),o.length,m.tmuxSessionName&&await u(m.tmuxSessionName),await x(),process.chdir(m.originalCwd),S(m.originalCwd),N(),b.cache.clear?.(),p(`Worktree kept at ${m.worktreePath} on branch ${m.worktreeBranch}. Tmux session terminated.`),a(`done`);else if(e===`remove`||e===`remove-with-tmux`){a(`removing`),o.length,m.tmuxSessionName&&await u(m.tmuxSessionName);try{await y(),process.chdir(m.originalCwd),S(m.originalCwd),N(),b.cache.clear?.()}catch(e){w(`Failed to clean up worktree: ${e}`,{level:`error`}),p(`Worktree cleanup failed, exiting anyway`),a(`done`);return}let e=t?` Tmux session terminated.`:``;l>0&&o.length>0?p(`Worktree removed. ${l} ${l===1?`commit`:`commits`} and uncommitted changes were discarded.${e}`):l>0?p(`Worktree removed. ${l} ${l===1?`commit`:`commits`} on ${m.worktreeBranch} ${l===1?`was`:`were`} discarded.${e}`):o.length>0?p(`Worktree removed. Uncommitted changes were discarded.${e}`):p(`Worktree removed.${e}`),a(`done`)}}if(n===`keeping`)return(0,I.jsxs)(r,{flexDirection:`row`,marginY:1,children:[(0,I.jsx)(M,{}),(0,I.jsx)(i,{children:`Keeping worktree…`})]});if(n===`removing`)return(0,I.jsxs)(r,{flexDirection:`row`,marginY:1,children:[(0,I.jsx)(M,{}),(0,I.jsx)(i,{children:`Removing worktree…`})]});let g=m.worktreeBranch,_=o.length>0,v=l>0,T=``;T=_&&v?`You have ${o.length} uncommitted ${o.length===1?`file`:`files`} and ${l} ${l===1?`commit`:`commits`} on ${g}. All will be lost if you remove.`:_?`You have ${o.length} uncommitted ${o.length===1?`file`:`files`}. These will be lost if you remove the worktree.`:v?`You have ${l} ${l===1?`commit`:`commits`} on ${g}. The branch will be deleted if you remove the worktree.`:`You are working in a worktree. Keep it to continue working there, or remove it to clean up.`;function E(){if(t){t();return}h(`keep`)}let O=_||v?`All changes and commits will be lost.`:`Clean up the worktree directory.`,k=!!m.tmuxSessionName,j=k?[{label:`Keep worktree and tmux session`,value:`keep-with-tmux`,description:`Stays at ${m.worktreePath}. Reattach with: tmux attach -t ${m.tmuxSessionName}`},{label:`Keep worktree, kill tmux session`,value:`keep-kill-tmux`,description:`Keeps worktree at ${m.worktreePath}, terminates tmux session.`},{label:`Remove worktree and tmux session`,value:`remove-with-tmux`,description:O}]:[{label:`Keep worktree`,value:`keep`,description:`Stays at ${m.worktreePath}`},{label:`Remove worktree`,value:`remove`,description:O}];return(0,I.jsx)(s,{title:`Exiting worktree session`,subtitle:T,onCancel:E,children:(0,I.jsx)(A,{defaultFocusValue:k?`keep-with-tmux`:`keep`,options:j,onChange:h})})}var F,I,L=t((()=>{F=n(a(),1),O(),T(),o(),E(),p(),d(),l(),k(),j(),I=c()}));function R(){return g(V)??`Goodbye!`}function z({showWorktree:e,onDone:t,onCancel:n}){async function r(e){t(e??R()),await _(0,`prompt_input_exit`)}return e?(0,B.jsx)(P,{onDone:r,onCancel:n}):null}var B,V,H=t((()=>{v(),m(),L(),B=c(),V=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}));export{H as n,z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e,P as t,kn as n,t as r,y as i}from"./src-
|
|
1
|
+
import{I as e,P as t,kn as n,t as r,y as i}from"./src-WZ94ZKI3.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Lh as o,zh as s}from"./loadAgentsDir-DR5PVAc3.js";import{C as c,T as l,x as u}from"./debug-kBjDaVkQ.js";import{t as d}from"./KeybindingProviderSetup-CSUkJHTT.js";import{t as f}from"./select-FrwoTzuc.js";import{t as p}from"./CustomSelect-CpMbxYbt.js";import{t as m}from"./renderOptions-DkP98P_d.js";r(),s(),u(),p();var h=a();function g({filePath:n,errorDescription:r,onExit:a,onReset:o}){return(0,h.jsxs)(i,{title:`Configuration Error`,color:`error`,onCancel:a,children:[(0,h.jsxs)(e,{flexDirection:`column`,gap:1,children:[(0,h.jsxs)(t,{children:[`The configuration file at `,(0,h.jsx)(t,{bold:!0,children:n}),` contains invalid JSON.`]}),(0,h.jsx)(t,{children:r})]}),(0,h.jsxs)(e,{flexDirection:`column`,children:[(0,h.jsx)(t,{bold:!0,children:`Choose an option:`}),(0,h.jsx)(f,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Reset with default configuration`,value:`reset`}],onChange:e=>{e===`exit`?a():o()},onCancel:a})]})]})}var _=`dark`;async function v({error:e}){let t={...m(!1),theme:_};await new Promise(async r=>{let{unmount:i}=await n((0,h.jsx)(o,{children:(0,h.jsx)(d,{children:(0,h.jsx)(g,{filePath:e.filePath,errorDescription:e.message,onExit:()=>{i(),r(),process.exit(1)},onReset:()=>{l(e.filePath,c(e.defaultConfig,null,2),{flush:!1,encoding:`utf8`}),i(),r(),process.exit(0)}})})}),t)})}export{v as showInvalidConfigDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as e,t,y as n}from"./src-
|
|
1
|
+
import{P as e,t,y as n}from"./src-WZ94ZKI3.js";import{t as r}from"./jsx-runtime-Bb4Xn-E0.js";import{n as i,t as a}from"./ValidationErrorsList-C_gDQfm1.js";import{t as o}from"./select-FrwoTzuc.js";import{t as s}from"./CustomSelect-CpMbxYbt.js";t(),s(),i();var c=r();function l({settingsErrors:t,onContinue:r,onExit:i}){function s(e){e===`exit`?i():r()}return(0,c.jsxs)(n,{title:`Settings Error`,onCancel:i,color:`warning`,children:[(0,c.jsx)(a,{errors:t}),(0,c.jsx)(e,{dimColor:!0,children:`Files with errors are skipped entirely, not just the invalid settings.`}),(0,c.jsx)(o,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Continue without these settings`,value:`continue`}],onChange:s})]})}export{l as InvalidSettingsDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Vt as t,ai as n,t as r}from"./src-WZ94ZKI3.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{c as a,i as o}from"./debug-kBjDaVkQ.js";import{Bn as s,zn as c}from"./settings-YIDksG5Z.js";import{l,o as u}from"./stringUtils-D_xPrwGQ.js";import{a as d,l as f,o as p,u as m}from"./sleep-BbWr_FL1.js";import{n as h,t as g}from"./notifications-dGBuNvFj.js";var _=e(n(),1);g(),s(),o(),u(),r(),d();var v=i();function y({children:e}){let{addNotification:n,removeNotification:r}=h();return(0,v.jsx)(t,{loadBindings:f,subscribeToChanges:m,initWatcher:p,onWarnings:(0,_.useCallback)((e,t)=>{let i=`keybinding-config-warning`;if(e.length===0){r(i);return}let a=c(e,e=>e.severity===`error`),o=c(e,e=>e.severity===`warning`),s;s=a>0&&o>0?`Found ${a} keybinding ${l(a,`error`)} and ${o} ${l(o,`warning`)}`:a>0?`Found ${a} keybinding ${l(a,`error`)}`:`Found ${o} keybinding ${l(o,`warning`)}`,s+=` · /doctor for details`,n({key:i,text:s,color:a>0?`error`:`warning`,priority:a>0?`immediate`:`high`,timeoutMs:6e4})},[n,r]),onDebugLog:a,children:e})}export{y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as n}from"./src-WZ94ZKI3.js";import{t as r}from"./jsx-runtime-Bb4Xn-E0.js";import{Pt as i,at as a}from"./state-CXY-q5gr.js";import{$d as o,Bd as s,Bh as c,Fd as l,Hh as u,Id as d,Kd as f,Md as p,Nd as m,Rd as h,Vh as g,bf as _,cp as v,df as y,hf as b,ip as x,jd as S,kd as C,lf as w,rp as ee,sp as T,uf as E,yf as D,zh as O}from"./loadAgentsDir-DR5PVAc3.js";import{I as k,M as A,c as te,i as j}from"./debug-kBjDaVkQ.js";import{et as M,nt as N}from"./settings-YIDksG5Z.js";import{c as P,l as F,o as I}from"./log-DWZny1vM.js";import{n as L}from"./analytics-COpjZpvd.js";import{i as R,n as z,r as B,t as V}from"./reject-C6IvUvBt.js";import{n as H,t as U}from"./notifications-dGBuNvFj.js";function W(e){let t=`plugin`in e?e.plugin:`no-plugin`;return`${e.type}:${e.source}:${t}`}function G(e,t){t.length!==0&&e(e=>{let n=new Set(e.plugins.errors.map(e=>W(e))),r=t.filter(e=>!n.has(W(e)));return r.length===0?e:{...e,plugins:{...e.plugins,errors:[...e.plugins.errors,...r]}}})}function K(e,t=!1){let n=g(),r=c(e=>e.mcp.pluginReconnectKey),i=u(),o=(0,q.useRef)(new Map),{addNotification:d}=H(),v=(0,q.useRef)([]),E=(0,q.useRef)(null),D=(0,q.useCallback)(()=>{E.current=null;let e=v.current;e.length!==0&&(v.current=[],i(t=>{let n=t.mcp;for(let t of e){let{tools:e,commands:r,resources:i,...a}=t,o=a.type===`disabled`||a.type===`failed`?e??[]:e,c=a.type===`disabled`||a.type===`failed`?r??[]:r,l=a.type===`disabled`||a.type===`failed`?i??[]:i,u=M(a.name),d=n.clients.findIndex(e=>e.name===a.name)===-1?[...n.clients,a]:n.clients.map(e=>e.name===a.name?a:e),f=o===void 0?n.tools:[...z(n.tools,e=>e.name?.startsWith(u)),...o],p=c===void 0?n.commands:[...z(n.commands,e=>s(e,a.name)),...c],m=l===void 0?n.resources:{...n.resources,...l.length>0?{[a.name]:l}:R(n.resources,a.name)};n={...n,clients:d,tools:f,commands:p,resources:m}}return{...t,mcp:n}}))},[i]),O=(0,q.useCallback)(e=>{v.current.push(e),E.current===null&&(E.current=setTimeout(D,16))},[D]),k=(0,q.useCallback)(({client:e,tools:t,commands:n,resources:r})=>{switch(O({...e,tools:t,commands:n,resources:r}),e.type){case`connected`:_(e.client,e.name,i),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(C(e.name,e.config).catch(()=>{te(`Failed to invalidate the server cache: ${e.name}`)}),y(e.name)){P(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=ne(t);P(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=o.current.get(e.name);r&&(clearTimeout(r),o.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(y(e.name)){P(e.name,`Server disabled during reconnection, stopping retry`),o.current.delete(e.name);return}O({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await h(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){P(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),o.current.delete(e.name),k(i);return}if(P(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){P(e.name,`Max reconnection attempts (${J}) reached, giving up`),o.current.delete(e.name),k(i);return}}catch(i){let a=Date.now()-r;if(F(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){P(e.name,`Max reconnection attempts (${J}) reached, giving up`),o.current.delete(e.name),O({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);P(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);o.current.set(e.name,n)})}})()}else O({...e,type:`failed`})},e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(T,async()=>{P(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=m.cache.get(e.name);m.cache.delete(e.name);let n=await m(e);n.length,t&&t.then(e=>{e.length},()=>{}),O({...e,tools:n})}catch(t){F(e.name,`Failed to refresh tools after list_changed notification: ${A(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(ee,async()=>{P(e.name,`Received prompts/list_changed notification, refreshing prompts`);try{S.cache.delete(e.name);let t=await S(e);O({...e,commands:t})}catch(t){F(e.name,`Failed to refresh prompts after list_changed notification: ${A(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(x,async()=>{P(e.name,`Received resources/list_changed notification, refreshing resources`);try{p.cache.delete(e.name);let t=await p(e);O({...e,resources:t})}catch(t){F(e.name,`Failed to refresh resources after list_changed notification: ${A(t)}`)}});break;case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[O]),j=a();return(0,q.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await w(e),a={...n,...e};G(i,r),i(e=>{let{stale:t,...n}=f(e.mcp,a);for(let e of t){let t=o.current.get(e.name);t&&(clearTimeout(t),o.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,C(e.name,e.config).catch(()=>{}))}let r=new Set(n.clients.map(e=>e.name)),i=Object.entries(a).filter(([e])=>!r.has(e)).map(([e,t])=>({name:e,type:y(e)?`disabled`:`pending`,config:t}));return i.length===0&&t.length===0?e:{...e,mcp:{...e.mcp,...n,clients:[...n.clients,...i]}}})}n().catch(e=>{F(`useManageMCPConnections`,`Failed to initialize servers as pending: ${A(e)}`)})},[t,e,i,j,r]),(0,q.useEffect)(()=>{let n=!1;async function r(){let r=Promise.resolve({}),{servers:a,errors:o}=t?{servers:{},errors:[]}:await w(e,r);if(n)return;G(i,o);let s={...a,...e},c=Object.fromEntries(Object.entries(s).filter(([e])=>!y(e)));l(k,c).catch(e=>{F(`useManageMcpConnections`,`Failed to get MCP resources: ${A(e)}`)});let u={},d={...s,...u},f={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0};for(let[e,t]of Object.entries(d))t.scope===`enterprise`?f.enterprise++:t.scope===`user`?f.global++:t.scope===`project`?f.project++:t.scope===`local`?f.user++:t.scope===`dynamic`?f.plugin++:t.scope===`claudeai`&&f.claudeai++;({...f})}return r(),()=>{n=!0}},[t,e,k,i,j,r]),(0,q.useEffect)(()=>{let e=o.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),E.current!==null&&(clearTimeout(E.current),E.current=null,D())}},[D]),{reconnectMcpServer:(0,q.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);let r=o.current.get(e);r&&(clearTimeout(r),o.current.delete(e));let i=await h(e,t.config);return k(i),i},[n,k]),toggleMcpServer:(0,q.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);if(t.type!==`disabled`){let n=o.current.get(e);n&&(clearTimeout(n),o.current.delete(e)),b(e,!1),t.type===`connected`&&await C(e,t.config),O({name:e,type:`disabled`,config:t.config})}else{b(e,!0),O({name:e,type:`pending`,config:t.config});let n=await h(e,t.config);k(n)}},[n,O,k])}}function ne(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var q,J,Y,X,re=e((()=>{q=t(n(),1),i(),d(),v(),B(),V(),L(),E(),j(),U(),O(),k(),I(),D(),N(),o(),J=5,Y=1e3,X=3e4}));function ie(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function ae(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpToggleEnabled must be used within MCPConnectionManager`);return e.toggleMcpServer}function oe({children:e,dynamicMcpConfig:t,isStrictMcpConfig:n}){let{reconnectMcpServer:r,toggleMcpServer:i}=K(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,se=e((()=>{Z=t(n(),1),re(),Q=r(),$=(0,Z.createContext)(null)}));export{ae as i,se as n,ie as r,oe as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{D as i,H as a,I as o,P as s,T as c,ai as l,j as u,t as d,y as f}from"./src-WZ94ZKI3.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{$d as m,Bh as h,Gd as g,Hh as ee,Id as _,Vd as te,Wd as ne,Xd as v,Yd as y,hd as b,kd as x,md as S,qd as re,sf as C,uf as w,zh as T}from"./loadAgentsDir-DR5PVAc3.js";import{I as E,M as D}from"./debug-kBjDaVkQ.js";import{$ as O,Q as k,nt as A}from"./settings-YIDksG5Z.js";import{n as j}from"./analytics-COpjZpvd.js";import{l as M,n as N,o as P}from"./stringUtils-D_xPrwGQ.js";import{i as ie,n as ae,r as oe}from"./MCPConnectionManager-Bn1PDn3R.js";import{n as F,t as I}from"./useExitOnCtrlCDWithKeybindings-BgJrnuDl.js";import{t as L}from"./select-FrwoTzuc.js";import{r as R,t as z}from"./Spinner-DhhSOFcN.js";import{t as B}from"./CustomSelect-CpMbxYbt.js";function V({serverToolsCount:e,serverPromptsCount:t,serverResourcesCount:n}){let r=[];return e>0&&r.push(`tools`),n>0&&r.push(`resources`),t>0&&r.push(`prompts`),(0,H.jsxs)(o,{children:[(0,H.jsx)(s,{bold:!0,children:`Capabilities: `}),(0,H.jsx)(s,{color:`text`,children:r.length>0?(0,H.jsx)(c,{children:r}):`none`})]})}var H,U=e((()=>{d(),H=p()}));function W(e,t){switch(e.client.type){case`connected`:return{message:`Reconnected to ${t}.`,success:!0};case`needs-auth`:return{message:`${t} requires authentication. Use the 'Authenticate' option.`,success:!1};case`failed`:return{message:`Failed to reconnect to ${t}.`,success:!1};default:return{message:`Unknown result when reconnecting to ${t}.`,success:!1}}}function G(e,t){return`Error reconnecting to ${t}: ${e instanceof Error?e.message:String(e)}`}var K=e((()=>{}));function se({server:e,serverToolsCount:t,onViewTools:n,onCancel:l,onComplete:d,borderless:f=!1}){let[p]=a(),m=F(),_=h(e=>e.mcp),v=ee(),[b,C]=(0,q.useState)(!1),[w,T]=(0,q.useState)(null),E=oe(),O=ie(),k=N(String(e.name)),A=y(_.commands,e.name).length,j=q.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await O(e.name),e.config.type,l()}catch(n){d?.(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${D(n)}`)}},[e.client.type,e.config.type,e.name,O,l,d]);if(b)return(0,J.jsxs)(o,{flexDirection:`column`,gap:1,padding:1,children:[(0,J.jsxs)(s,{color:`text`,children:[`Connecting to `,(0,J.jsx)(s,{bold:!0,children:e.name}),`…`]}),(0,J.jsxs)(o,{children:[(0,J.jsx)(z,{}),(0,J.jsx)(s,{children:` Establishing connection to MCP server`})]}),(0,J.jsx)(s,{dimColor:!0,children:`This may take a few moments.`})]});let M=[];return e.client.type===`disabled`&&M.push({label:`Enable`,value:`toggle-enabled`}),e.client.type===`connected`&&t>0&&M.push({label:`View tools`,value:`tools`}),e.client.type!==`disabled`&&(e.client.type!==`needs-auth`&&M.push({label:`Reconnect`,value:`reconnectMcpServer`}),M.push({label:`Disable`,value:`toggle-enabled`})),M.length===0&&M.push({label:`Back`,value:`back`}),(0,J.jsxs)(o,{flexDirection:`column`,children:[(0,J.jsxs)(o,{flexDirection:`column`,paddingX:1,borderStyle:f?void 0:`round`,children:[(0,J.jsx)(o,{marginBottom:1,children:(0,J.jsxs)(s,{bold:!0,children:[k,` MCP Server`]})}),(0,J.jsxs)(o,{flexDirection:`column`,gap:0,children:[(0,J.jsxs)(o,{children:[(0,J.jsx)(s,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,J.jsxs)(s,{children:[u(`inactive`,p)(r.radioOff),` disabled`]}):e.client.type===`connected`?(0,J.jsxs)(s,{children:[u(`success`,p)(r.tick),` connected`]}):e.client.type===`pending`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(s,{dimColor:!0,children:r.radioOff}),(0,J.jsx)(s,{children:` connecting…`})]}):e.client.type===`needs-auth`?(0,J.jsxs)(s,{children:[u(`warning`,p)(r.triangleUpOutline),` needs authentication`]}):(0,J.jsxs)(s,{children:[u(`error`,p)(r.cross),` failed`]})]}),(0,J.jsxs)(o,{children:[(0,J.jsx)(s,{bold:!0,children:`URL: `}),(0,J.jsx)(s,{dimColor:!0,children:e.config.url})]}),(0,J.jsxs)(o,{children:[(0,J.jsx)(s,{bold:!0,children:`Config location: `}),(0,J.jsx)(s,{dimColor:!0,children:te(e.scope)})]}),e.client.type===`connected`&&(0,J.jsx)(V,{serverToolsCount:t,serverPromptsCount:A,serverResourcesCount:_.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,J.jsxs)(o,{children:[(0,J.jsx)(s,{bold:!0,children:`Tools: `}),(0,J.jsxs)(s,{dimColor:!0,children:[t,` tools`]})]})]}),w&&(0,J.jsx)(o,{marginTop:1,children:(0,J.jsxs)(s,{color:`error`,children:[`Error: `,w]})}),M.length>0&&(0,J.jsx)(o,{marginTop:1,children:(0,J.jsx)(L,{options:M,onChange:async t=>{switch(t){case`tools`:n();break;case`reconnectMcpServer`:C(!0),T(null);try{await x(e.name,{...e.config,scope:e.scope}),v(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`pending`}:t),r=re(t.mcp.tools,e.name),i=ne(t.mcp.commands,e.name),a=g(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}});let{message:t}=W(await E(e.name),e.name);d?.(t)}catch(t){d?.(G(t,e.name))}finally{C(!1)}break;case`toggle-enabled`:await j();break;case`back`:l();break}},onCancel:l})})]}),(0,J.jsx)(o,{marginTop:1,children:(0,J.jsx)(s,{dimColor:!0,italic:!0,children:m.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,m.keyName,` again to exit`]}):(0,J.jsxs)(c,{children:[(0,J.jsx)(i,{shortcut:`↑↓`,action:`navigate`}),(0,J.jsx)(i,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(S,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var q,J,ce=e((()=>{n(),q=t(l(),1),j(),I(),d(),_(),ae(),m(),T(),E(),P(),b(),B(),R(),U(),K(),J=p()}));function le({server:e,serverToolsCount:t,onViewTools:n,onCancel:l,onComplete:d,borderless:f=!1}){let[p]=a(),m=F(),g=h(e=>e.mcp),ee=oe(),_=ie(),[ne,v]=(0,Y.useState)(!1),b=Y.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await _(e.name),l()}catch(n){d(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${D(n)}`)}},[e.client.type,e.name,_,l,d]),x=N(String(e.name)),re=y(g.commands,e.name).length,w=[];return e.client.type!==`disabled`&&t>0&&w.push({label:`View tools`,value:`tools`}),e.client.type!==`disabled`&&w.push({label:`Reconnect`,value:`reconnectMcpServer`}),w.push({label:e.client.type===`disabled`?`Enable`:`Disable`,value:`toggle-enabled`}),w.length===0&&w.push({label:`Back`,value:`back`}),ne?(0,X.jsxs)(o,{flexDirection:`column`,gap:1,padding:1,children:[(0,X.jsxs)(s,{color:`text`,children:[`Reconnecting to `,(0,X.jsx)(s,{bold:!0,children:e.name})]}),(0,X.jsxs)(o,{children:[(0,X.jsx)(z,{}),(0,X.jsx)(s,{children:` Restarting MCP server process`})]}),(0,X.jsx)(s,{dimColor:!0,children:`This may take a few moments.`})]}):(0,X.jsxs)(o,{flexDirection:`column`,children:[(0,X.jsxs)(o,{flexDirection:`column`,paddingX:1,borderStyle:f?void 0:`round`,children:[(0,X.jsx)(o,{marginBottom:1,children:(0,X.jsxs)(s,{bold:!0,children:[x,` MCP Server`]})}),(0,X.jsxs)(o,{flexDirection:`column`,gap:0,children:[(0,X.jsxs)(o,{children:[(0,X.jsx)(s,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,X.jsxs)(s,{children:[u(`inactive`,p)(r.radioOff),` disabled`]}):e.client.type===`connected`?(0,X.jsxs)(s,{children:[u(`success`,p)(r.tick),` connected`]}):e.client.type===`pending`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(s,{dimColor:!0,children:r.radioOff}),(0,X.jsx)(s,{children:` connecting…`})]}):(0,X.jsxs)(s,{children:[u(`error`,p)(r.cross),` failed`]})]}),(0,X.jsxs)(o,{children:[(0,X.jsx)(s,{bold:!0,children:`Command: `}),(0,X.jsx)(s,{dimColor:!0,children:e.config.command})]}),e.config.args&&e.config.args.length>0&&(0,X.jsxs)(o,{children:[(0,X.jsx)(s,{bold:!0,children:`Args: `}),(0,X.jsx)(s,{dimColor:!0,children:e.config.args.join(` `)})]}),(0,X.jsxs)(o,{children:[(0,X.jsx)(s,{bold:!0,children:`Config location: `}),(0,X.jsx)(s,{dimColor:!0,children:te(C(e.name)?.scope??`dynamic`)})]}),e.client.type===`connected`&&(0,X.jsx)(V,{serverToolsCount:t,serverPromptsCount:re,serverResourcesCount:g.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,X.jsxs)(o,{children:[(0,X.jsx)(s,{bold:!0,children:`Tools: `}),(0,X.jsxs)(s,{dimColor:!0,children:[t,` tools`]})]})]}),w.length>0&&(0,X.jsx)(o,{marginTop:1,children:(0,X.jsx)(L,{options:w,onChange:async t=>{if(t===`tools`)n();else if(t===`reconnectMcpServer`){v(!0);try{let{message:t}=W(await ee(e.name),e.name);d?.(t)}catch(t){d?.(G(t,e.name))}finally{v(!1)}}else t===`toggle-enabled`?await b():t===`back`&&l()},onCancel:l})})]}),(0,X.jsx)(o,{marginTop:1,children:(0,X.jsx)(s,{dimColor:!0,italic:!0,children:m.pending?(0,X.jsxs)(X.Fragment,{children:[`Press `,m.keyName,` again to exit`]}):(0,X.jsxs)(c,{children:[(0,X.jsx)(i,{shortcut:`↑↓`,action:`navigate`}),(0,X.jsx)(i,{shortcut:`Enter`,action:`select`}),(0,X.jsx)(S,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var Y,X,ue=e((()=>{n(),Y=t(l(),1),I(),d(),w(),ae(),m(),T(),E(),P(),b(),B(),R(),U(),K(),X=p()}));function de({tool:e,server:t,onBack:n}){let[r,i]=Z.useState(``),a=O(e.name,t.name),c=k(e.userFacingName?e.userFacingName({}):a),l=e.isReadOnly?.({})??!1,u=e.isDestructive?.({})??!1,d=e.isOpenWorld?.({})??!1;return Z.useEffect(()=>{async function t(){try{let t=await e.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:`default`,additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]});i(t)}catch{i(`Failed to load description`)}}t()},[e]),(0,Q.jsx)(f,{title:(0,Q.jsxs)(Q.Fragment,{children:[c,l&&(0,Q.jsx)(s,{color:`success`,children:` [read-only]`}),u&&(0,Q.jsx)(s,{color:`error`,children:` [destructive]`}),d&&(0,Q.jsx)(s,{dimColor:!0,children:` [open-world]`})]}),subtitle:t.name,onCancel:n,inputGuide:e=>e.pending?(0,Q.jsxs)(s,{children:[`Press `,e.keyName,` again to exit`]}):(0,Q.jsx)(S,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`}),children:(0,Q.jsxs)(o,{flexDirection:`column`,children:[(0,Q.jsxs)(o,{children:[(0,Q.jsx)(s,{bold:!0,children:`Tool name: `}),(0,Q.jsx)(s,{dimColor:!0,children:a})]}),(0,Q.jsxs)(o,{children:[(0,Q.jsx)(s,{bold:!0,children:`Full name: `}),(0,Q.jsx)(s,{dimColor:!0,children:e.name})]}),r&&(0,Q.jsxs)(o,{flexDirection:`column`,marginTop:1,children:[(0,Q.jsx)(s,{bold:!0,children:`Description:`}),(0,Q.jsx)(s,{wrap:`wrap`,children:r})]}),e.inputJSONSchema?.properties&&Object.keys(e.inputJSONSchema.properties).length>0&&(0,Q.jsxs)(o,{flexDirection:`column`,marginTop:1,children:[(0,Q.jsx)(s,{bold:!0,children:`Parameters:`}),(0,Q.jsx)(o,{marginLeft:2,flexDirection:`column`,children:Object.entries(e.inputJSONSchema.properties).map(([t,n])=>{let r=(e.inputJSONSchema?.required)?.includes(t);return(0,Q.jsxs)(s,{children:[`• `,t,r&&(0,Q.jsx)(s,{dimColor:!0,children:` (required)`}),`:`,` `,(0,Q.jsx)(s,{dimColor:!0,children:typeof n==`object`&&n&&`type`in n?String(n.type):`unknown`}),typeof n==`object`&&n&&`description`in n&&(0,Q.jsxs)(s,{dimColor:!0,children:[` - `,String(n.description)]})]},t)})})]})]})})}var Z,Q,fe=e((()=>{Z=t(l(),1),d(),A(),b(),Q=p()}));function pe({server:e,onSelectTool:t,onBack:n}){let r=h(e=>e.mcp.tools),a=me.useMemo(()=>e.client.type===`connected`?v(r,e.name):[],[e,r]),o=a.map((t,n)=>{let r=O(t.name,e.name),i=k(t.userFacingName?t.userFacingName({}):r),a=t.isReadOnly?.({})??!1,o=t.isDestructive?.({})??!1,s=t.isOpenWorld?.({})??!1,c=[];return a&&c.push(`read-only`),o&&c.push(`destructive`),s&&c.push(`open-world`),{label:i,value:n.toString(),description:c.length>0?c.join(`, `):void 0,descriptionColor:o?`error`:a?`success`:void 0}});return(0,$.jsx)(f,{title:`Tools for ${e.name}`,subtitle:`${a.length} ${M(a.length,`tool`)}`,onCancel:n,inputGuide:e=>e.pending?(0,$.jsxs)(s,{children:[`Press `,e.keyName,` again to exit`]}):(0,$.jsxs)(c,{children:[(0,$.jsx)(i,{shortcut:`↑↓`,action:`navigate`}),(0,$.jsx)(i,{shortcut:`Enter`,action:`select`}),(0,$.jsx)(S,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]}),children:a.length===0?(0,$.jsx)(s,{dimColor:!0,children:`No tools available`}):(0,$.jsx)(L,{options:o,onChange:e=>{let n=parseInt(e,10),r=a[n];r&&t(r,n)},onCancel:n})})}var me,$,he=e((()=>{me=t(l(),1),d(),A(),m(),T(),P(),b(),B(),$=p()}));export{le as a,ce as c,fe as i,he as n,ue as o,de as r,se as s,pe as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,ai as a,t as o}from"./src-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,ai as a,t as o}from"./src-WZ94ZKI3.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{$d as c,Qd as l,Vd as u,cf as d,uf as f}from"./loadAgentsDir-DR5PVAc3.js";function p({scope:e,parsingErrors:t,warnings:r}){let a=t.length>0,o=r.length>0;return!a&&!o?null:(0,_.jsxs)(n,{flexDirection:`column`,marginTop:1,children:[(0,_.jsxs)(n,{children:[(a||o)&&(0,_.jsxs)(i,{color:a?`error`:`warning`,children:[`[`,a?`Failed to parse`:`Contains warnings`,`] `]}),(0,_.jsx)(i,{children:l(e)})]}),(0,_.jsxs)(n,{children:[(0,_.jsx)(i,{dimColor:!0,children:`Location: `}),(0,_.jsx)(i,{dimColor:!0,children:u(e)})]}),(0,_.jsxs)(n,{marginLeft:1,flexDirection:`column`,children:[t.map((e,t)=>{let r=e.mcpErrorMetadata?.serverName;return(0,_.jsx)(n,{children:(0,_.jsxs)(i,{children:[(0,_.jsx)(i,{dimColor:!0,children:`└ `}),(0,_.jsx)(i,{color:`error`,children:`[Error]`}),(0,_.jsxs)(i,{dimColor:!0,children:[` `,r&&`[${r}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`error-${t}`)}),r.map((e,t)=>{let r=e.mcpErrorMetadata?.serverName;return(0,_.jsx)(n,{children:(0,_.jsxs)(i,{children:[(0,_.jsx)(i,{dimColor:!0,children:`└ `}),(0,_.jsx)(i,{color:`warning`,children:`[Warning]`}),(0,_.jsxs)(i,{dimColor:!0,children:[` `,r&&`[${r}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`warning-${t}`)})]})]})}function m(){let e=(0,g.useMemo)(()=>[{scope:`user`,config:d(`user`)},{scope:`project`,config:d(`project`)},{scope:`local`,config:d(`local`)},{scope:`enterprise`,config:d(`enterprise`)}],[]),t=e.some(({config:e})=>h(e.errors,`fatal`).length>0),a=e.some(({config:e})=>h(e.errors,`warning`).length>0);return!t&&!a?null:(0,_.jsxs)(n,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,_.jsx)(i,{bold:!0,children:`MCP Config Diagnostics`}),(0,_.jsx)(n,{marginTop:1,children:(0,_.jsxs)(i,{dimColor:!0,children:[`For help configuring MCP servers, see:`,` `,(0,_.jsx)(r,{url:`https://code.workmate.com/docs/en/mcp`,children:`https://code.workmate.com/docs/en/mcp`})]})}),e.map(({scope:e,config:t})=>(0,_.jsx)(p,{scope:e,parsingErrors:h(t.errors,`fatal`),warnings:h(t.errors,`warning`)},e))]})}function h(e,t){return e.filter(e=>e.mcpErrorMetadata?.severity===t)}var g,_,v=e((()=>{g=t(a(),1),f(),c(),o(),_=s()}));export{v as n,m as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t,r as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./figures-5ThXQEtq.js";import{C as a,Gt as o,I as s,P as c,Wt as l,ai as u,ot as d,t as f}from"./src-WZ94ZKI3.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{An as m,Pt as h}from"./state-CXY-q5gr.js";import{$h as g,$o as _,$x as v,Bh as y,Bu as b,Ix as x,Ji as S,Px as C,Qh as ee,Qo as w,Ru as T,Ub as E,Vb as D,Wb as O,Xx as k,_c as A,ag as j,by as te,eg as ne,gc as M,hS as N,hc as re,mn as ie,nn as ae,sb as P,tb as oe,ts as F,un as se,wa as I,xa as ce,yc as L,yy as le,zh as R}from"./loadAgentsDir-DR5PVAc3.js";import{Bn as ue,zn as z}from"./settings-YIDksG5Z.js";import{D as B,h as de,m as V,o as H,q as fe,s as U}from"./log-DWZny1vM.js";import{n as W}from"./analytics-COpjZpvd.js";import{_ as pe,p as me,y as he}from"./startupProfiler-DIM_Ihyp.js";import{E as ge,T as _e,c as ve,d as ye,w as be}from"./sessionTracing-UFK96PxT.js";import{n as xe,t as Se}from"./useExitOnCtrlCDWithKeybindings-BgJrnuDl.js";import{n as Ce,t as we}from"./select-FrwoTzuc.js";import{r as Te,t as Ee}from"./Spinner-DhhSOFcN.js";import*as G from"path";import{randomUUID as K}from"crypto";var q=t(u(),1),J=p();f(),h(),fe(),V(),H(),ue(),W(),pe(),E(),le(),be(),T(),ve(),A(),re(),F(),S(),ie();function De(e){let t=e.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(t)}function Oe(e){let t=e.toLowerCase().trim();return t===`continue`||/\b(keep going|go on)\b/.test(t)}function ke(e,t,n,r,i,a,o){let s=K();m(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;ye(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&_e(`user_prompt`,{prompt_length:String(l.length),prompt:ge(l),"prompt.id":s}),De(c),Oe(c),t.length>0?{messages:[v({content:[...typeof e==`string`?e.trim()?[{type:`text`,text:e}]:[]:e,...t],uuid:i,imagePasteIds:n.length>0?n:void 0,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}:{messages:[v({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}W(),S();async function Ae({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,messages:o,setUserInputOnProcessing:s,uuid:c,isAlreadyProcessing:l,querySource:u,canUseTool:d,skipSlashCommands:f,bridgeOrigin:p,isMeta:m,skipAttachments:h,autonomy:g}){let _=typeof e==`string`?e:null,y=_?.startsWith(`/`)&&!f;n===`prompt`&&_!==null&&!m&&!y&&s?.(_),L(`query_process_user_input_base_start`);let b=i.getAppState(),S=await Me(e,n,r,i,a,o,c,l,u,d,b.toolPermissionContext.mode,f,p,m,h,t,g);if(L(`query_process_user_input_base_end`),!S.shouldQuery)return S;L(`query_hooks_start`);let C=x(e)||``;for await(let t of ae(C,b.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[k(`${se(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:S.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return S.messages.push(v({content:e})),S.shouldQuery=!1,S}if(t.additionalContexts&&t.additionalContexts.length>0&&S.messages.push(w({type:`hook_additional_context`,content:t.additionalContexts.map(je),hookName:`UserPromptSubmit`,toolUseID:`hook-${K()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;S.messages.push({...t.message,attachment:{...t.message.attachment,content:je(t.message.attachment.content)}});break;default:S.messages.push(t.message);break}}return L(`query_hooks_end`),S}var Y=1e4;function je(e){return e.length>Y?`${e.substring(0,Y)}… [output truncated - exceeded ${Y} characters]`:e}async function Me(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){let v=null,y=[],x=[],S=e;if(typeof e==`string`)v=e;else if(e.length>0){L(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await O(n);if(e.dimensions){let t=D(e.dimensions);t&&x.push(t)}t.push(e.block)}else t.push(n);S=t,L(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(v=n.text,y=t.slice(0,-1)):y=t}if(v===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let C=i?Object.values(i).filter(te):[],ee=C.map(e=>e.id),w=i?await b(i):new Map;L(`query_pasted_image_processing_start`);let T=await Promise.all(C.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return e.content.length,{resized:await O(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??w.get(e.id)}})),E=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of T){if(e.dimensions){let t=D(e.dimensions,n);t&&x.push(t)}else if(t){let e=D(t,n);e&&x.push(e)}else n&&x.push(`[Image source: ${n}]`);E.push(e.block)}L(`query_pasted_image_processing_end`);let k=d,A=!m&&v!==null&&(t!==`prompt`||k||!v.startsWith(`/`));L(`query_attachment_loading_start`);let j=A?await M(_(v,r,[],a,c)):[];if(L(`query_attachment_loading_end`),v!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-RUkmyAl4.js`);return X(await e(v,y,j,r,n),x)}if(v!==null&&!k&&v.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-DRLO-jNV.js`);return X(await e(v,y,E,j,r,n,o,s,l,g),x)}if(v!==null&&t===`prompt`){let e=v.trim(),t=j.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`;e.startsWith(n)}}return X(ke(S,E,ee,j,o,u,p),x)}function X(e,t){return t.length>0&&e.messages.push(v({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}var Ne=n({MessageSelector:()=>Fe,messagesAfterAreOnlySynthetic:()=>He,selectableUserMessagesFilter:()=>Q});function Pe(e){return e.type===`text`}function Z(e){return e===`summarize`}function Fe({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:u,onClose:d,preselectedMessage:f}){let p=y(e=>e.fileHistory),[m,h]=(0,q.useState)(void 0),_=g(),b=(0,q.useMemo)(K,[]),x=(0,q.useMemo)(()=>[...e.filter(Q),{...v({content:``}),uuid:b}],[e,b]),[S,C]=(0,q.useState)(x.length-1),w=Math.max(0,Math.min(S-Math.floor($/2),x.length-$)),T=x.length>1,[E,D]=(0,q.useState)(f),[O,k]=(0,q.useState)(void 0);(0,q.useEffect)(()=>{if(!f||!_)return;let e=!1;return ne(p,f.uuid).then(t=>{e||k(t)}),()=>{e=!0}},[f,_,p]);let[A,j]=(0,q.useState)(!1),[te,M]=(0,q.useState)(null),[N,re]=(0,q.useState)(`both`),[ie,ae]=(0,q.useState)(``);function P(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}];return t.push({value:`summarize`,label:`Summarize from here`,type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `,onChange:ae}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,q.useEffect)(()=>{},[]);async function oe(e){t(),j(!0);try{await n(e),j(!1),d()}catch(e){U(e),j(!1),h(`Failed to restore the conversation:\n${e}`)}}async function F(t){let n=e.indexOf(t);if(e.length-1-n,t.type,!e.includes(t)){d();return}if(!_){await oe(t);return}let r=await ne(p,t.uuid);D(t),k(r)}async function se(e){if(!E){h(`Message not found.`);return}if(e===`nevermind`){f?d():D(void 0);return}if(Z(e)){t(),j(!0),M(e),h(void 0);try{let e=ie.trim()||void 0;await u(E,e,`from`),j(!1),M(null),D(void 0),d()}catch(e){U(e),j(!1),M(null),D(void 0),h(`Failed to summarize:\n${e}`)}return}t(),j(!0),h(void 0);let i=null,a=null;if(e===`code`||e===`both`)try{await r(E)}catch(e){i=e,U(i)}if(e===`conversation`||e===`both`)try{await n(E)}catch(e){a=e,U(a)}j(!1),D(void 0),a&&i?h(`Failed to restore the conversation and code:\n${a}\n${i}`):a?h(`Failed to restore the conversation:\n${a}`):i?h(`Failed to restore the code:\n${i}`):d()}let I=xe(),ce=(0,q.useCallback)(()=>{if(E&&!f){D(void 0);return}d()},[d,E,f]),L=(0,q.useCallback)(()=>C(e=>Math.max(0,e-1)),[]),le=(0,q.useCallback)(()=>C(e=>Math.min(x.length-1,e+1)),[x.length]),R=(0,q.useCallback)(()=>C(0),[]),ue=(0,q.useCallback)(()=>C(x.length-1),[x.length]),z=(0,q.useCallback)(()=>{let e=x[S];e&&F(e)},[x,S,F]);l(`confirm:no`,ce,{context:`Confirmation`,isActive:!E}),o({"messageSelector:up":L,"messageSelector:down":le,"messageSelector:top":R,"messageSelector:bottom":ue,"messageSelector:select":z},{context:`MessageSelector`,isActive:!A&&!m&&!E&&T});let[B,de]=(0,q.useState)({});(0,q.useEffect)(()=>{async function t(){_&&Promise.all(x.map(async(t,n)=>{if(t.uuid!==b){let r=ee(p,t.uuid),i=x.at(n+1),a=r?Ve(e,t.uuid,i?.uuid===b?void 0:i?.uuid):void 0;de(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[x,e,b,p,_]);let V=_&&O?.filesChanged&&O.filesChanged.length>0,H=!m&&!E&&!f&&T;return(0,J.jsxs)(s,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(a,{color:`suggestion`}),(0,J.jsxs)(s,{flexDirection:`column`,marginX:1,gap:1,children:[(0,J.jsx)(c,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,J.jsxs)(c,{color:`error`,children:[`Error: `,m]}),!T&&(0,J.jsx)(c,{children:`Nothing to rewind to yet.`}),!m&&E&&T&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(c,{children:[`Confirm you want to restore `,!O&&`the conversation `,`to the point before you sent this message:`]}),(0,J.jsxs)(s,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,J.jsx)(Be,{userMessage:E,color:`text`,isCurrent:!1}),(0,J.jsxs)(c,{dimColor:!0,children:[`(`,me(new Date(E.timestamp)),`)`]})]}),(0,J.jsx)(Le,{selectedRestoreOption:N,canRestoreCode:!!V,diffStatsForRestore:O}),A&&Z(te)?(0,J.jsxs)(s,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(Ee,{}),(0,J.jsx)(c,{children:`Summarizing…`})]}):(0,J.jsx)(we,{isDisabled:A,options:P(!!V),defaultFocusValue:V?`both`:`conversation`,onFocus:e=>re(e),onChange:e=>se(e),onCancel:()=>f?d():D(void 0)}),V&&(0,J.jsx)(s,{marginBottom:1,children:(0,J.jsxs)(c,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),H&&(0,J.jsxs)(J.Fragment,{children:[_?(0,J.jsx)(c,{children:`Restore the code and/or conversation to the point before…`}):(0,J.jsx)(c,{children:`Restore and fork the conversation to the point before…`}),(0,J.jsx)(s,{width:`100%`,flexDirection:`column`,children:x.slice(w,w+$).map((e,t)=>{let n=w+t,r=n===S,a=e.uuid===b,o=n in B,l=B[n],u=l?.filesChanged?.length;return(0,J.jsxs)(s,{height:_?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,J.jsx)(s,{width:2,minWidth:2,children:r?(0,J.jsxs)(c,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,J.jsx)(c,{children:` `})}),(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsx)(s,{flexShrink:1,height:1,overflow:`hidden`,children:(0,J.jsx)(Be,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),_&&o&&(0,J.jsx)(s,{height:1,flexDirection:`row`,children:l?(0,J.jsx)(c,{dimColor:!r,color:`inactive`,children:u?(0,J.jsxs)(J.Fragment,{children:[u===1&&l.filesChanged[0]?`${G.basename(l.filesChanged[0])} `:`${u} files changed `,(0,J.jsx)(ze,{diffStats:l})]}):(0,J.jsx)(J.Fragment,{children:`No code changes`})}):(0,J.jsxs)(c,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!E&&(0,J.jsx)(c,{dimColor:!0,italic:!0,children:I.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,I.keyName,` again to exit`]}):(0,J.jsxs)(J.Fragment,{children:[!m&&T&&`Enter to continue · `,`Esc to exit`]})})]})]})}function Ie(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function Le({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsx)(c,{dimColor:!0,children:Ie(e)}),!Z(e)&&(r?(0,J.jsx)(Re,{diffStatsForRestore:n}):(0,J.jsx)(c,{dimColor:!0,children:`The code will be unchanged.`}))]})}function Re({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged?.[0])return(0,J.jsx)(c,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?G.basename(e.filesChanged[0]||``):t===2?`${G.basename(e.filesChanged[0]||``)} and ${G.basename(e.filesChanged[1]||``)}`:`${G.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,J.jsxs)(c,{dimColor:!0,children:[`The code will be restored `,(0,J.jsx)(ze,{diffStats:e}),` in `,n,`.`]})}function ze({diffStats:e}){if(e?.filesChanged)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(c,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,J.jsxs)(c,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function Be({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:a}=d();if(r)return(0,J.jsx)(s,{width:`100%`,children:(0,J.jsx)(c,{italic:!0,color:t,dimColor:n,children:`(current)`})});let o=e.message.content,l=typeof o==`string`?null:o[o.length-1],u=de(typeof o==`string`?o.trim():l&&Pe(l)?l.text.trim():`(no prompt)`);if(ce(u))return(0,J.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,J.jsx)(c,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=C(u,`bash-input`);if(e)return(0,J.jsxs)(s,{flexDirection:`row`,width:`100%`,children:[(0,J.jsx)(c,{color:`bashBorder`,children:`!`}),(0,J.jsxs)(c,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=C(u,B),r=C(u,`command-args`),i=C(u,`skill-format`)===`true`;if(e)return i?(0,J.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,J.jsxs)(c,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,J.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,J.jsxs)(c,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,J.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,J.jsx)(c,{color:t,dimColor:n,children:i?he(u,a-i,!0):u.slice(0,500).split(`
|
|
2
|
+
`).slice(0,4).join(`
|
|
3
|
+
`)})})}function Ve(e,t,n){let r=e.findIndex(e=>e.uuid===t);if(r===-1)return;let i=n?e.findIndex(e=>e.uuid===n):e.length;i===-1&&(i=e.length);let a=[],o=0,s=0;for(let t=r+1;t<i;t++){let n=e[t];if(!n||!I(n))continue;let r=n.toolUseResult;if(!(!r?.filePath||!r.structuredPatch)){a.includes(r.filePath)||a.push(r.filePath);try{if(`type`in r&&r.type===`create`)o+=r.content.split(/\r?\n/).length;else for(let e of r.structuredPatch){let t=z(e.lines,e=>e.startsWith(`+`)),n=z(e.lines,e=>e.startsWith(`-`));o+=t,s+=n}}catch{}}}return{filesChanged:a,insertions:o,deletions:s}}function Q(e){if(e.type!==`user`||Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_result`||N(e)||e.isMeta||e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;let t=e.message.content,n=typeof t==`string`?null:t[t.length-1],r=typeof t==`string`?t.trim():n&&Pe(n)?n.text.trim():``;return!(r.indexOf(`<local-command-stdout>`)!==-1||r.indexOf(`<local-command-stderr>`)!==-1||r.indexOf(`<bash-stdout>`)!==-1||r.indexOf(`<bash-stderr>`)!==-1||r.indexOf(`<task-notification>`)!==-1||r.indexOf(`<tick>`)!==-1)}function He(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!N(t)&&!I(t)&&t.type!==`progress`&&t.type!==`system`&&t.type!==`attachment`&&!(t.type===`user`&&t.isMeta)){if(t.type===`assistant`){let e=t.message.content;if(Array.isArray(e)&&e.some(e=>e.type===`text`&&e.text.trim()||e.type===`tool_use`))return!1;continue}if(t.type===`user`)return!1}}return!0}var $,Ue=e((()=>{r(),W(),R(),j(),Se(),oe(),S(),Ce(),Te(),P(),$=7}));export{Q as a,He as i,Ne as n,Ae as o,Ue as r,Fe as t};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DZ_SvEVz.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{C as o,Gr as s,I as c,N as l,P as u,Pn as d,Rn as f,ai as p,di as m,fi as h,j as g,mt as _,ot as v,t as y,xt as b}from"./src-WZ94ZKI3.js";import{t as x}from"./jsx-runtime-Bb4Xn-E0.js";import{$i as S,$u as C,$y as w,Bh as T,Cy as E,Du as D,Dy as O,Eu as k,Ey as A,Gx as ee,Ji as te,KC as ne,Mh as re,Ou as ie,Px as j,QS as M,Qi as N,Qy as P,Rx as ae,Sa as oe,Tu as F,WC as se,Xy as ce,Yy as le,ZS as I,Zy as ue,aC as de,aS as L,aa as fe,bm as R,bu as pe,da as me,dd as he,du as ge,ea as _e,ed as ve,fu as ye,ha as be,hg as xe,jh as Se,ku as Ce,ky as we,la as Te,na as Ee,nb as z,oS as De,pa as Oe,qy as ke,ra as Ae,rb as je,sC as Me,sS as Ne,sb as B,ta as Pe,ud as Fe,uu as Ie,vu as Le,wu as Re,xm as ze,xu as Be,yu as Ve,zh as He,zx as Ue}from"./loadAgentsDir-DR5PVAc3.js";import{n as We,t as Ge}from"./cwd-DrEEb4f5.js";import{a as Ke,c as V,i as qe,n as Je,o as Ye}from"./debug-kBjDaVkQ.js";import{Bt as Xe,Vt as Ze,m as Qe,t as $e}from"./settings-YIDksG5Z.js";import{d as et,h as tt,o as nt}from"./config-D3K87Mm1.js";import{B as rt,L as it,R as at,q as ot}from"./log-DWZny1vM.js";import{_ as st,f as ct,p as lt,y as ut}from"./startupProfiler-DIM_Ihyp.js";import{l as dt,o as ft}from"./stringUtils-D_xPrwGQ.js";import{f as pt,h as mt,x as ht}from"./model-D42epddJ.js";import{gn as gt,vn as _t}from"./prompt-CTByhpUI.js";import{a as vt,n as yt,r as bt,t as xt}from"./projectOnboardingState-KqcpRXls.js";import{n as St,t as Ct}from"./sleep-BbWr_FL1.js";import{n as wt,t as Tt}from"./systemTheme-Ceakddth.js";import{a as Et,c as Dt,i as Ot}from"./SpinnerGlyph-CmVXC-_9.js";import{n as kt,r as At}from"./PromptInputFooterSuggestions-CwqAsTI2.js";import{n as jt,t as Mt}from"./useMainLoopModel-BVgJo4hN.js";import{n as Nt,t as Pt}from"./modalContext-CBE8xuck.js";import{n as Ft,r as It,t as Lt}from"./statusNoticeHelpers-DI45AH-c.js";import{a as Rt,c as zt,i as Bt,l as Vt,n as Ht,o as Ut,r as Wt,t as Gt,u as Kt}from"./logoUtils-DR5T0pr3.js";import{homedir as qt}from"os";import{relative as Jt}from"path";import{fileURLToPath as Yt}from"url";function Xt(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var Zt=e((()=>{}));function Qt(e){if(e.type!==`user`)return!1;let t=Array.isArray(e.message.content)?e.message.content[0]:void 0;return!t||typeof t==`string`||t?.type!==`text`||!t.text.includes(`<task-notification`)||j(t.text,`status`)!==`completed`?!1:j(t.text,`summary`)?.startsWith(`Background command `)??!1}function $t(e,t){if(!re()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(Qt(t)){let i=0;for(;r<e.length&&Qt(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${rt}><${it}>completed</${it}><${at}>${i} background commands completed</${at}></${rt}>`}]}})}else n.push(t),r++}return n}var en=e((()=>{ot(),xe(),Se(),te()}));function tn(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function nn(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(tn(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!tn(t)||t.hookLabel!==i)break;a.push(t),n++}a.length===1?t.push(r):t.push({...r,hookCount:a.reduce((e,t)=>e+t.hookCount,0),hookInfos:a.flatMap(e=>e.hookInfos),hookErrors:a.flatMap(e=>e.hookErrors),preventedContinuation:a.some(e=>e.preventedContinuation),hasOutput:a.some(e=>e.hasOutput),totalDurationMs:Math.max(...a.map(e=>e.totalDurationMs??0))})}else t.push(r),n++}return t}var rn=e((()=>{}));function an(e){let t=cn.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),cn.set(e,t)),t}function on(e){if(e.type===`assistant`&&e.message?.content&&Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_use`){let t=e.message.content[0];return{messageId:e.message.id,toolUseId:t.id,toolName:t.name}}return null}function sn(e,t,n=!1){if(n)return{messages:e};let r=an(t),i=new Map;for(let t of e){let e=on(t);if(e&&r.has(e.toolName)){let n=`${e.messageId}:${e.toolName}`,r=i.get(n)??[];r.push(t),i.set(n,r)}}let a=new Map,o=new Set;for(let[e,t]of i)if(t.length>=2){a.set(e,t);for(let e of t){let t=on(e);t&&o.add(t.toolUseId)}}let s=new Map;for(let t of e)if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content))for(let e of t.message.content)e.type===`tool_result`&&o.has(e.tool_use_id)&&s.set(e.tool_use_id,t);let c=[],l=new Set;for(let t of e){let e=on(t);if(e){let t=`${e.messageId}:${e.toolName}`,n=a.get(t);if(n){if(!l.has(t)){l.add(t);let r=n[0],i=[];for(let e of n){let t=e.message.content[0].id,n=s.get(t);n&&i.push(n)}let a={type:`grouped_tool_use`,toolName:e.toolName,messages:n,results:i,displayMessage:r,uuid:`grouped-${r.uuid}`,timestamp:r.timestamp,messageId:e.messageId};c.push(a)}continue}}if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content)){let e=t.message.content.filter(e=>e.type===`tool_result`);if(e.length>0&&e.every(e=>o.has(e.tool_use_id)))continue}c.push(t)}return{messages:c}}var cn,ln=e((()=>{cn=new WeakMap}));function un(e){let t=gn.get(e);if(t!==void 0)return t;let n=dn(e).toLowerCase();return gn.set(e,n),n}function dn(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=hn.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?hn.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(pn(e.toolUseResult));t=r.join(`
|
|
2
|
+
`)}break}case`assistant`:{let n=e.message.content;Array.isArray(n)&&(t=n.flatMap(e=>e.type===`text`?[e.text]:e.type===`tool_use`?[fn(e.input)]:[]).join(`
|
|
3
|
+
`));break}case`attachment`:if(e.attachment.type===`relevant_memories`)t=(e.attachment.memories??[]).map(e=>e.content).join(`
|
|
4
|
+
`);else if(e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text]:[]).join(`
|
|
5
|
+
`)}break;case`collapsed_read_search`:e.relevantMemories&&(t=e.relevantMemories.map(e=>e.content).join(`
|
|
6
|
+
`));break;default:break}let n=t,r=n.indexOf(`<system-reminder>`);for(;r>=0;){let e=n.indexOf(mn,r);if(e<0)break;n=n.slice(0,r)+n.slice(e+18),r=n.indexOf(`<system-reminder>`)}return n}function fn(e){if(!e||typeof e!=`object`)return``;let t=e,n=[];for(let e of[`command`,`pattern`,`file_path`,`path`,`prompt`,`description`,`query`,`url`,`skill`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`args`,`files`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(` `))}return n.join(`
|
|
7
|
+
`)}function pn(e){if(!e||typeof e!=`object`)return typeof e==`string`?e:``;let t=e;if(typeof t.stdout==`string`){let e=typeof t.stderr==`string`?t.stderr:``;return t.stdout+(e?`\n${e}`:``)}if(t.file&&typeof t.file==`object`&&typeof t.file.content==`string`)return t.file.content;let n=[];for(let e of[`content`,`output`,`result`,`text`,`message`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`filenames`,`lines`,`results`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(`
|
|
8
|
+
`))}return n.join(`
|
|
9
|
+
`)}var mn,hn,gn,_n=e((()=>{te(),mn=`</system-reminder>`,hn=new Set([De,Ne]),gn=new WeakMap}));function vn({pose:e=`default`}={}){return(0,yn.jsxs)(c,{flexDirection:`column`,alignItems:`center`,children:[(0,yn.jsx)(u,{color:`clawd_body`,children:` █████ `}),(0,yn.jsx)(u,{color:`clawd_body`,children:`██ ● ● ██`}),(0,yn.jsx)(u,{color:`clawd_body`,children:`██ ▄▄▄ ██`}),(0,yn.jsx)(u,{color:`clawd_body`,children:` █ █ █ █ `})]})}var yn,bn=e((()=>{y(),yn=x()}));function xn(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=s(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,s(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?s(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=s(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,s(r))),o}function Sn({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,l=Math.max(0,...r.map(e=>e.timestamp?s(e.timestamp):0));return(0,H.jsxs)(c,{flexDirection:`column`,width:t,children:[(0,H.jsx)(u,{bold:!0,color:`claude`,children:n}),o?(0,H.jsxs)(H.Fragment,{children:[o.content,i&&(0,H.jsx)(u,{dimColor:!0,italic:!0,children:ut(i,t)})]}):r.length===0&&a?(0,H.jsx)(u,{dimColor:!0,children:ut(a,t)}):(0,H.jsxs)(H.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(l>0?l+2:0));return(0,H.jsxs)(u,{children:[l>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(u,{dimColor:!0,children:(e.timestamp||``).padEnd(l)}),` `]}),(0,H.jsx)(u,{children:ut(e.text,r)})]},n)}),i&&(0,H.jsx)(u,{dimColor:!0,italic:!0,children:ut(i,t)})]})]})}var H,Cn=e((()=>{y(),st(),H=x()}));function wn({feeds:e,maxWidth:t}){let n=e.map(e=>xn(e)),r=Math.max(...n),i=Math.min(r,t);return(0,En.jsx)(c,{flexDirection:`column`,children:e.map((t,n)=>(0,En.jsxs)(Tn.Fragment,{children:[(0,En.jsx)(Sn,{config:t,actualWidth:i}),n<e.length-1&&(0,En.jsx)(o,{color:`claude`,width:i})]},n))})}var Tn,En,Dn=e((()=>{Tn=t(p(),1),y(),Cn(),En=x()}));function On(e){let t=e.map(e=>{let t=lt(e.modified);return{text:(e.summary&&e.summary!==`No prompt`?e.summary:e.firstPrompt)||``,timestamp:t}});return{title:`Recent activity`,lines:t,footer:t.length>0?`/resume for more`:void 0,emptyMessage:`No recent activity`}}function kn(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${a.tick} `:``}${e}`})),n=Ge()===qt()?`Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.`:void 0;return n&&t.push({text:n}),{title:`Tips for getting started`,lines:t}}var An=e((()=>{i(),We(),st()}));function U(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function jn(){let{pose:e,bounceOffset:t,onClick:n}=Mn();return(0,Pn.jsx)(c,{height:Bn,flexDirection:`column`,onClick:n,children:(0,Pn.jsx)(c,{marginTop:t,flexShrink:0,children:(0,Pn.jsx)(vn,{pose:e})})})}function Mn(){let[e]=(0,Nn.useState)(()=>$e().prefersReducedMotion??!1),[t,n]=(0,Nn.useState)(-1),r=(0,Nn.useRef)(Fn),i=()=>{e||t!==-1||(r.current=In[Math.floor(Math.random()*In.length)],n(0))};(0,Nn.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,Rn,zn);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Ln;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn=e((()=>{Nn=t(p(),1),y(),Qe(),bn(),Pn=x(),Fn=[...U(`default`,1,2),...U(`arms-up`,0,3),...U(`default`,0,1),...U(`default`,1,2),...U(`arms-up`,0,3),...U(`default`,0,1)],In=[Fn,[...U(`look-right`,0,5),...U(`look-left`,0,5),...U(`default`,0,1)]],Ln={pose:`default`,offset:0},Rn=60,zn=e=>e+1,Bn=3}));function Hn(){let{columns:e}=v(),t=T(e=>e.agent),n=ht(jt()),{version:r,cwd:i,billingType:a,agentName:o}=Ut(),l=t??o,d=Math.max(e-15,20),f=ut(r,Math.max(d-11,6)),{shouldSplit:p,truncatedModel:m,truncatedBilling:h}=Wt(n,a,d),g=l?d-1-s(l)-3:d,_=Kt(i,Math.max(g,10));return(0,W.jsx)(R,{children:(0,W.jsxs)(c,{flexDirection:`row`,gap:2,alignItems:`center`,children:[re()?(0,W.jsx)(jn,{}):(0,W.jsx)(vn,{}),(0,W.jsxs)(c,{flexDirection:`column`,children:[(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Work Mate`}),` `,(0,W.jsxs)(u,{dimColor:!0,children:[`v`,f]})]}),p?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(u,{dimColor:!0,children:m}),(0,W.jsx)(u,{dimColor:!0,children:h})]}):(0,W.jsxs)(u,{dimColor:!0,children:[m,` · `,h]}),(0,W.jsx)(u,{dimColor:!0,children:l?`@${l} · ${_}`:_})]})]})})}var W,Un=e((()=>{Mt(),B(),y(),He(),st(),Se(),Vt(),pt(),ze(),Vn(),bn(),W=x()}));function Wn(){let e=(0,Kn.useMemo)(Gn,[]),t=(0,Kn.useMemo)(()=>nt().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,Kn.useEffect)(()=>{n&&tt(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,qn.jsx)(c,{paddingLeft:2,flexDirection:`column`,children:(0,qn.jsx)(u,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function Gn(){return Jn}var Kn,qn,Jn,Yn=e((()=>{Kn=t(p(),1),y(),et(),qn=x(),Jn={tip:``,color:`dim`}}));function Xn({char:e=`✻`}){let[t]=(0,Zn.useState)(()=>$e().prefersReducedMotion??!1),[n,r]=(0,Zn.useState)(t),i=(0,Zn.useRef)(null),[a,o]=_(n?null:50);return(0,Zn.useEffect)(()=>{if(n)return;let e=setTimeout(r,er,!0);return()=>clearTimeout(e)},[n]),n?(0,Qn.jsx)(c,{ref:a,children:(0,Qn.jsx)(u,{color:tr,children:e})}):(i.current===null&&(i.current=o),(0,Qn.jsx)(c,{ref:a,children:(0,Qn.jsx)(u,{color:Dt(Ot((o-i.current)/$n*360%360)),children:e})}))}var Zn,Qn,$n,er,tr,nr=e((()=>{Zn=t(p(),1),Ze(),y(),Qe(),Et(),Qn=x(),$n=1500,er=$n*2,tr=Dt({r:153,g:153,b:153})}));function rr(){return mt()&&(nt().opus1mMergeNoticeSeenCount??0)<sr}function ir(){let[e]=(0,ar.useState)(rr);return(0,ar.useEffect)(()=>{if(!e)return;let t=(nt().opus1mMergeNoticeSeenCount??0)+1;tt(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,or.jsxs)(c,{paddingLeft:2,children:[(0,or.jsx)(Xn,{char:`↑`}),(0,or.jsx)(u,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var ar,or,sr,cr=e((()=>{ar=t(p(),1),Ze(),y(),et(),pt(),nr(),or=x(),sr=6}));function lr(){let e=zt(),{columns:t}=v(),r=vt(),i=de.isSandboxingEnabled(),a=T(e=>e.agent),o=nt(),[l]=(0,ur.useState)(()=>{let e=$e().companyAnnouncements;if(!(!e||e.length===0))return o.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]});(0,ur.useEffect)(()=>{r&&yt()},[r]),!r&&n(process.env.WORKMATE_FORCE_FULL_LOGO);let d=ht(jt()),{version:f,cwd:p,billingType:m,agentName:h}=Ut(),_=a??h,y=ut(d,dr-20);if(!r&&!n(process.env.WORKMATE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Hn,{}),(0,G.jsx)(ir,{}),Ke()&&(0,G.jsxs)(c,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(u,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(u,{dimColor:!0,children:[`Logging to: `,Ye()?`stderr`:Je()]})]}),(0,G.jsx)(Wn,{}),process.env.WORKMATE_TMUX_SESSION&&(0,G.jsxs)(c,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(u,{dimColor:!0,children:[`tmux session: `,process.env.WORKMATE_TMUX_SESSION]}),(0,G.jsx)(u,{dimColor:!0,children:process.env.WORKMATE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.WORKMATE_TMUX_PREFIX} ${process.env.WORKMATE_TMUX_PREFIX} d (press prefix twice - Work Mate uses ${process.env.WORKMATE_TMUX_PREFIX})`:`Detach: ${process.env.WORKMATE_TMUX_PREFIX} d`})]}),l&&(0,G.jsx)(c,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(u,{children:l})})]});let b=Rt(t),x=wt(nt().theme),S=` ${g(`claude`,x)(`Work Mate`)} ${g(`inactive`,x)(`v${f}`)} `,C=g(`claude`,x)(` Work Mate `);if(b===`compact`){let e=Bt(null);s(e)>t-4&&(e=Bt(null));let n=_?t-4-1-s(_)-3:t-4,r=Kt(p,Math.max(n,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(R,{children:(0,G.jsxs)(c,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:C,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:t,children:[(0,G.jsx)(u,{bold:!0,children:e}),(0,G.jsx)(c,{marginY:1,children:(0,G.jsx)(vn,{})}),(0,G.jsx)(u,{dimColor:!0,children:y}),(0,G.jsx)(u,{dimColor:!0,children:m}),(0,G.jsx)(u,{dimColor:!0,children:_?`@${_} · ${r}`:r})]})}),(0,G.jsx)(ir,{}),i&&(0,G.jsx)(c,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(u,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})})]})}let w=Bt(null),E=`${y} · ${m}`,D=_?dr-1-s(_)-3:dr,O=Kt(p,Math.max(D,10)),k=_?`@${_} · ${O}`:O,{leftWidth:A,rightWidth:ee}=Gt(t,b,Ht(w,k,E));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(R,{children:(0,G.jsx)(c,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:S,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(c,{flexDirection:b===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(c,{flexDirection:`column`,width:A,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(c,{marginTop:1,children:(0,G.jsx)(u,{bold:!0,children:w})}),(0,G.jsx)(vn,{}),(0,G.jsxs)(c,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(u,{dimColor:!0,children:E}),(0,G.jsx)(u,{dimColor:!0,children:k})]})]}),b===`horizontal`&&(0,G.jsx)(c,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),b===`horizontal`&&(0,G.jsx)(wn,{feeds:r?[kn(xt()),On(e)]:[On(e)],maxWidth:ee})]})})}),(0,G.jsx)(ir,{}),Ke()&&(0,G.jsxs)(c,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(u,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(u,{dimColor:!0,children:[`Logging to: `,Ye()?`stderr`:Je()]})]}),(0,G.jsx)(Wn,{}),process.env.WORKMATE_TMUX_SESSION&&(0,G.jsxs)(c,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(u,{dimColor:!0,children:[`tmux session: `,process.env.WORKMATE_TMUX_SESSION]}),(0,G.jsx)(u,{dimColor:!0,children:process.env.WORKMATE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.WORKMATE_TMUX_PREFIX} ${process.env.WORKMATE_TMUX_PREFIX} d (press prefix twice - Work Mate uses ${process.env.WORKMATE_TMUX_PREFIX})`:`Detach: ${process.env.WORKMATE_TMUX_PREFIX} d`})]}),l&&(0,G.jsx)(c,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(u,{children:l})}),i&&(0,G.jsx)(c,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(u,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})})]})}var ur,G,dr,fr=e((()=>{y(),B(),Vt(),st(),bn(),Dn(),An(),et(),Tt(),Qe(),qe(),ur=t(p(),1),bt(),Un(),ze(),r(),Yn(),cr(),Me(),He(),Mt(),pt(),G=x(),dr=50}));function pr({message:e,isTranscriptMode:t}){let n=e.message?.content,r=Array.isArray(n)?n:[];if(!(t&&e.type===`assistant`&&e.message?.model&&r.some(e=>e?.type===`text`)))return null;let i=e.message.model;return(0,mr.jsx)(c,{minWidth:s(i)+8,children:(0,mr.jsx)(u,{dimColor:!0,children:i})})}var mr,hr=e((()=>{y(),mr=x()}));function gr({message:e,isTranscriptMode:t}){if(!(t&&e.timestamp&&e.type===`assistant`&&Array.isArray(e.message.content)&&e.message.content.some(e=>e.type===`text`)))return null;let n=new Date(e.timestamp).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!0});return(0,_r.jsx)(c,{minWidth:s(n),children:(0,_r.jsx)(u,{dimColor:!0,children:n})})}var _r,vr=e((()=>{y(),_r=x()}));function yr(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=Er(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(k(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&Er(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=Er(t.messages[0]?.message.content)?.input;if(k(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function br({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:l,canAnimate:u,lastThinkingBlockId:d,latestBashOutputUUID:f,columns:p,isLoading:m,lookups:h,shouldCollapseDiffs:g}){let _=l===`transcript`,v=e.type===`grouped_tool_use`,y=e.type===`collapsed_read_search`,b=y&&(ie(e,o)||m&&!n),x=v?e.displayMessage:y?F(e):e,S=v||y?[]:_e(e,h),C=Li(e,s,o,v||y?L:Pe(e,h),l,h),w=!1;if(u)if(v)w=e.messages.some(e=>{let t=Er(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(y)w=ie(e,o);else{let t=Ue(e);w=!t||o.has(t)}let T=_&&x.type===`assistant`&&Array.isArray(x.message.content)&&x.message.content.some(e=>e.type===`text`)&&(x.timestamp||x.message.model),E=(0,Tr.jsx)(Ie,{message:e,lookups:h,addMargin:!T,containerWidth:T?void 0:p,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:S,shouldAnimate:w,shouldShowDot:!0,isTranscriptMode:_,isStatic:C,isActiveCollapsedGroup:b,isUserContinuation:t,lastThinkingBlockId:d,latestBashOutputUUID:f,shouldCollapseDiffs:g});return T?(0,Tr.jsx)(R,{children:(0,Tr.jsxs)(c,{width:p,flexDirection:`column`,children:[(0,Tr.jsxs)(c,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,Tr.jsx)(gr,{message:x,isTranscriptMode:_}),(0,Tr.jsx)(pr,{message:x,isTranscriptMode:_})]}),E]})}):(0,Tr.jsx)(R,{children:E})}function xr(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=Er(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return D(e).some(e=>t.has(e));let n=Ue(e);return!!n&&t.has(n)}function Sr(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=Er(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return D(e).every(e=>t.has(e));if(e.type===`assistant`){let n=Er(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=Ue(e);return!n||t.has(n)}function Cr(e,t){if(e.message!==t.message||e.screen!==t.screen||e.verbose!==t.verbose||e.message.type===`collapsed_read_search`&&t.screen!==`transcript`||e.columns!==t.columns||e.latestBashOutputUUID===e.message.uuid!=(t.latestBashOutputUUID===t.message.uuid)||e.lastThinkingBlockId!==t.lastThinkingBlockId&&ge(t.message))return!1;let n=xr(e.message,e.streamingToolUseIDs),r=Sr(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var wr,Tr,Er,Dr,Or=e((()=>{wr=t(p(),1),y(),Ce(),te(),ye(),Tr=x(),hr(),Gi(),vr(),ze(),Er=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},Dr=wr.memo(br,Cr)}));function kr(e){return e.type===`attachment`&&Ar.has(e.attachment.type)}var Ar,jr=e((()=>{Ar=new Set(`hook_success.hook_additional_context.hook_cancelled.command_permissions.agent_mention.budget_usd.critical_system_reminder.edited_image_file.edited_text_file.opened_file_in_ide.output_style.plan_mode.plan_mode_exit.plan_mode_reentry.structured_output.todo_reminder.context_efficiency.deferred_tools_delta.mcp_instructions_delta.token_usage.max_turns_reached.task_reminder.auto_mode.auto_mode_exit.output_token_usage.verify_plan_reminder.current_session_memory.compaction_reminder.date_change`.split(`.`))}));function Mr(e){return Fr.filter(t=>t.isActive(e))}var K,Nr,Pr,Fr,Ir=e((()=>{y(),we(),i(),We(),st(),It(),K=x(),Nr={id:`large-memory-files`,type:`warning`,isActive:e=>A(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:A(e.memoryFiles).map(e=>{let t=e.path.startsWith(Ge())?Jt(Ge(),e.path):e.path;return(0,K.jsxs)(c,{flexDirection:`row`,children:[(0,K.jsx)(u,{color:`warning`,children:a.warning}),(0,K.jsxs)(u,{color:`warning`,children:[`Large `,(0,K.jsx)(u,{bold:!0,children:t}),` will impact performance (`,ct(e.content.length),` chars > `,ct(E),`)`,(0,K.jsx)(u,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Pr={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Ft(e.agentDefinitions)>Lt,render:e=>{let t=Ft(e.agentDefinitions);return(0,K.jsxs)(c,{flexDirection:`row`,children:[(0,K.jsx)(u,{color:`warning`,children:a.warning}),(0,K.jsxs)(u,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,ct(t),` tokens > `,ct(Lt),`)`,(0,K.jsx)(u,{dimColor:!0,children:` · /agents to manage`})]})]})}},Fr=[Nr,Pr]}));function Lr({agentDefinitions:e}={}){let t={config:nt(),agentDefinitions:e,memoryFiles:(0,zr.use)(O())},n=Mr(t);return n.length===0?null:(0,Br.jsx)(c,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Br.jsx)(Rr.Fragment,{children:e.render(t)},e.id))})}var Rr,zr,Br,Vr=e((()=>{Rr=t(p(),1),zr=t(p(),1),y(),we(),et(),Ir(),Br=x()}));function Hr(e,t,n){let r=(0,q.useRef)(new Map),i=(0,q.useRef)(0),a=(0,q.useRef)(0),o=(0,q.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,q.useRef)(new Map),c=(0,q.useRef)(new Map),l=(0,q.useRef)(n),u=(0,q.useRef)(!1),d=(0,q.useRef)(null),f=(0,q.useRef)(0);if(l.current!==n){let e=l.current/n;l.current=n;for(let[t,n]of r.current)r.current.set(t,Math.max(1,Math.round(n*e)));i.current++,u.current=!0,f.current=2}let p=f.current>0?d.current:null,m=(0,q.useRef)(0),h=(0,q.useRef)(null);(0,q.useSyncExternalStore)((0,q.useCallback)(t=>e.current?.subscribe(t)??Xr,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/Kr);return t.isSticky()?~r:r});let g=e.current?.getScrollTop()??-1,_=e.current?.getPendingDelta()??0,v=e.current?.getViewportHeight()??0,y=e.current?.isSticky()??!0;(0,q.useMemo)(()=>{let e=new Set(t),n=!1;for(let t of r.current.keys())e.has(t)||(r.current.delete(t),n=!0);for(let t of c.current.keys())e.has(t)||c.current.delete(t);n&&i.current++},[t]);let b=t.length;if(o.current.version!==i.current||o.current.n!==b){let e=o.current.arr.length>=b+1?o.current.arr:new Float64Array(b+1);e[0]=0;for(let n=0;n<b;n++)e[n+1]=e[n]+(r.current.get(t[n])??Ur);o.current={arr:e,version:i.current,n:b}}let x=o.current.arr,S=x[b],C,w;if(p)[C,w]=p,C=Math.min(C,b),w=Math.min(w,b);else if(v===0||g<0)C=Math.max(0,b-Gr),w=b;else{if(y){let e=v+Wr;for(C=b;C>0&&S-x[C-1]<e;)C--;w=b}else{let e=m.current,n=v*3,i=Math.min(g,g+_),a=Math.max(g,g+_),o=a-i,c=o>n&&_<0?a-n:i,l=c+Math.min(o,n),u=Math.max(0,c-e),f=l-e,p=u-Wr;{let e=0,t=b;for(;e<t;){let n=e+t>>1;x[n+1]<=p?e=n+1:t=n}C=e}{let e=d.current;if(e&&e[0]<C)for(let n=e[0];n<Math.min(C,e[1]);n++){let e=t[n];if(s.current.has(e)&&!r.current.has(e)){C=n;break}}}let h=v+2*Wr,y=Math.min(b,C+Jr),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+Wr);)S+=r.current.get(t[w])??qr,w++}let e=v+2*Wr,n=Math.max(0,w-Jr),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??qr;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??qr;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-Yr&&(C=e-Yr),w>t+Yr&&(w=t+Yr),C>w&&(w=Math.min(C+Yr,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let T=(0,q.useDeferredValue)(C),E=(0,q.useDeferredValue)(w),D=C<T?T:C,O=w>E?E:w;if((D>O||y)&&(D=C,O=w),_>0&&(O=w),O-D>Jr){let e=(x[D]+x[O])/2;g-m.current<e?O=D+Jr:D=O-Jr}let k=m.current,A=x[D],ee=D===0?0:A+k,te=O===b?1/0:Math.max(A,x[O]-v)+k;(0,q.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(ee,te)}),(0,q.useLayoutEffect)(()=>{let e=h.current?.yogaNode;if(e&&e.getComputedWidth()>0&&(m.current=e.getComputedTop()),u.current){u.current=!1;return}let t=!1;for(let[e,n]of s.current){let i=n.yogaNode;if(!i)continue;let a=i.getComputedHeight(),o=r.current.get(e);a>0?o!==a&&(r.current.set(e,a),t=!0):i.getComputedWidth()>0&&o!==0&&(r.current.set(e,0),t=!0)}t&&i.current++});let ne=(0,q.useCallback)(e=>{let t=c.current.get(e);return t||(t=t=>{if(t)s.current.set(e,t);else{let t=s.current.get(e)?.yogaNode;if(t&&!u.current){let n=t.getComputedHeight();(n>0||t.getComputedWidth()>0)&&r.current.get(e)!==n&&(r.current.set(e,n),i.current++)}s.current.delete(e)}},c.current.set(e,t)),t},[]),re=(0,q.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),ie=(0,q.useCallback)(e=>s.current.get(t[e])??null,[t]),j=(0,q.useCallback)(e=>r.current.get(t[e]),[t]),M=(0,q.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),N=S-x[O];return{range:[D,O],topSpacer:A,bottomSpacer:N,measureRef:ne,spacerRef:h,offsets:x,getItemTop:re,getItemElement:ie,getItemHeight:j,scrollToIndex:M}}var q,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr=e((()=>{q=t(p(),1),Ur=3,Wr=40,Gr=30,Kr=20,qr=1,Jr=200,Yr=25,Xr=()=>{}}));function Qr({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,ri.jsx)(ai.Provider,{value:n,children:(0,ri.jsx)(si.Provider,{value:i,children:(0,ri.jsx)(ii.Provider,{value:t,children:(0,ri.jsx)(oi.Provider,{value:r,children:e})})})})}function $r(){return(0,J.useContext)(ii)}function ei(){return(0,J.useContext)(oi)}function ti(e){let t=(0,J.useContext)(ai);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function ni(e){let t=(0,J.useContext)(si);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,ri,ii,ai,oi,si,ci=e((()=>{J=t(p(),1),ri=x(),ii=(0,J.createContext)(null),ai=(0,J.createContext)(null),oi=(0,J.createContext)(null),si=(0,J.createContext)(null)}));function li(e){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(e);r.current=e;let i=(0,Y.useRef)(null),a=(0,Y.useCallback)(()=>{n(null)},[]),o=(0,Y.useCallback)(e=>{let t=Math.max(0,e.getScrollHeight()-e.getViewportHeight());e.getScrollTop()+e.getPendingDelta()>=t||i.current===null&&(i.current=e.getScrollHeight(),n(r.current))},[]),s=(0,Y.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,Y.useEffect)(()=>{t===null?i.current=null:e<t&&(i.current=null,n(null))},[e,t]),{dividerIndex:t,dividerYRef:i,onScrollAway:o,onRepin:a,jumpToNew:s,shiftDivider:(0,Y.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function ui(e,t){let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t.type===`progress`||t.type===`assistant`&&!di(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function di(e){if(e.type!==`assistant`||!Array.isArray(e.message.content))return!1;for(let t of e.message.content)if(typeof t!=`string`&&t.type===`text`&&t.text.trim()!==``)return!0;return!1}function fi(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||kr(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=ui(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function pi({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:l=!1,hideSticky:d=!1,newMessageCount:p=0,onPillClick:m}){let{rows:h,columns:g}=v(),[_,y]=(0,Y.useState)(null),x=(0,Y.useMemo)(()=>({setStickyPrompt:y}),[]),S=(0,Y.useSyncExternalStore)((0,Y.useCallback)(e=>o?.current?.subscribe(e)??(()=>{}),[o]),()=>{let e=o?.current,t=s?.current;return!e||t==null?!1:e.getScrollTop()+e.getPendingDelta()+e.getViewportHeight()<t});if((0,Y.useLayoutEffect)(()=>{if(!re())return;let e=f.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{Be(Yt(e))}catch{}else pe(e)},()=>{e.onHyperlinkClick=void 0}},[]),re()){let s=d?null:_,f=s!=null&&s!==`clicked`&&n==null?s:null,v=s!=null&&n==null;return(0,X.jsxs)(Qr,{children:[(0,X.jsx)(c,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(c,{flexDirection:`column`,flexGrow:1,width:g,overflow:`hidden`,children:[(0,X.jsxs)(c,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[f&&(0,X.jsx)(hi,{text:f.text,onClick:f.scrollTo}),(0,X.jsxs)(b,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!v,stickyScroll:!0,children:[(0,X.jsx)(yi,{value:x,children:e}),n]}),!l&&S&&n==null&&(0,X.jsx)(mi,{count:p,onClick:m}),r!=null&&(0,X.jsx)(c,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(c,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(gi,{}),(0,X.jsx)(_i,{}),(0,X.jsx)(c,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(Pt,{value:{rows:h-vi-1,columns:g-4,scrollRef:a??null},children:(0,X.jsxs)(c,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:h-vi,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(c,{flexShrink:0,children:(0,X.jsx)(u,{color:`permission`,children:`▔`.repeat(g)})}),(0,X.jsx)(c,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function mi({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(c,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(c,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(u,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${dt(e,`message`)}`:`Jump to bottom`,` `,a.arrowDown,` `]})})})}function hi({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(c,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(u,{color:`subtle`,wrap:`truncate-end`,children:[a.pointer,` `,e]})})}function gi(){let e=$r();return!e||e.suggestions.length===0?null:(0,X.jsx)(c,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(kt,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function _i(){let e=ei();return e?(0,X.jsx)(c,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,vi,yi,bi=e((()=>{i(),Y=t(p(),1),Nt(),ci(),B(),y(),Ve(),Se(),ft(),jr(),At(),X=x(),vi=2,yi=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function xi(e){let t=ki.get(e);if(t!==void 0)return t;let n=un(e);return ki.set(e,n),n}function Si(e){let t=ji.get(e);if(t!==void 0)return t;let n=Ci(e);return ji.set(e,n),n}function Ci(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
|
|
10
|
+
`)}if(t===null)return null;let n=P(t);return n.startsWith(`<`)||n===``?null:n}function wi({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:u,onLeaveK:d,renderItem:f}){return(0,Di.jsx)(c,{ref:r(e),flexDirection:`column`,backgroundColor:i?`userMessageBackgroundHover`:void 0,paddingBottom:i?1:void 0,onClick:o?e=>s(t,e.cellIsBlank):void 0,onMouseEnter:o?()=>u(e):void 0,onMouseLeave:o?()=>d(e):void 0,children:(0,Di.jsx)(l.Provider,{value:a&&!i?`text`:void 0,children:f(t,n)})})}function Ti({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:l=xi,trackStickyPrompt:u,selectedIndex:d,cursorNavRef:f,setCursor:p,jumpRef:m,onSearchMatchesChange:h,scanElement:g,setPositions:_}){let v=(0,Z.useRef)([]),y=(0,Z.useRef)(e),b=(0,Z.useRef)(r);if(b.current!==r||e.length<v.current.length||e[0]!==y.current[0])v.current=e.map(e=>r(e));else for(let t=v.current.length;t<e.length;t++)v.current.push(r(e[t]));y.current=e,b.current=r;let x=v.current,{range:S,topSpacer:C,bottomSpacer:T,measureRef:E,spacerRef:D,offsets:O,getItemTop:k,getItemElement:A,getItemHeight:ee,scrollToIndex:te}=Hr(t,x,n),[ne,re]=S,ie=(0,Z.useCallback)(t=>ee(t)!==0&&ue(e[t]),[ee,e]);(0,Z.useImperativeHandle)(f,()=>{let n=e=>p?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:w(e)?.name}),r=d??-1,i=(t,r,i=ie)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>ie(t)&&e[t].type===`user`;return{enterCursor:()=>i(e.length-1,-1,a),navigatePrev:()=>i(r-1,-1),navigateNext:()=>{i(r+1,1)||(t.current?.scrollToBottom(),p?.(null))},navigatePrevUser:()=>i(r-1,-1,a),navigateNextUser:()=>i(r+1,1,a),navigateTop:()=>i(0,1),navigateBottom:()=>i(e.length-1,-1),getSelected:()=>r>=0?e[r]??null:null}},[e,d,p,ie]);let j=(0,Z.useRef)({offsets:O,start:ne,getItemElement:A,getItemTop:k,messages:e,scrollToIndex:te});j.current={offsets:O,start:ne,getItemElement:A,getItemTop:k,messages:e,scrollToIndex:te},(0,Z.useEffect)(()=>{if(d===void 0)return;let e=j.current,n=e.getItemElement(d);n?t.current?.scrollToElement(n,1):e.scrollToIndex(d)},[d,t]);let M=(0,Z.useRef)(null),N=(0,Z.useRef)({msgIdx:-1,positions:[]}),P=(0,Z.useRef)(-1),ae=(0,Z.useRef)(0),oe=(0,Z.useRef)(0),F=(0,Z.useRef)(()=>{}),se=(0,Z.useRef)(()=>{}),ce=(0,Z.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),le=(0,Z.useRef)(-1),I=(0,Z.useRef)(!1);function de(e){let t=j.current.getItemTop(e);return Math.max(0,t-Oi)}function L(e){let n=t.current,{msgIdx:r,positions:i}=N.current;if(!n||i.length===0||r<0){_?.(null);return}let a=Math.max(0,Math.min(e,i.length-1)),o=i[a],s=j.current.getItemTop(r),c=n.getViewportTop(),l=s-n.getScrollTop(),u=n.getViewportHeight(),d=c+l+o.row;(d<c||d>=c+u)&&(n.scrollTo(Math.max(0,s+o.row-Oi)),l=s-n.getScrollTop(),d=c+l+o.row),_?.({positions:i,rowOffset:c+l,currentIdx:a});let f=ce.current,p=f.prefixSum.at(-1)??0,m=(f.prefixSum[f.ptr]??0)+a+1;h?.(p,m),V(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${m}/${p}`)}se.current=L;let[fe,R]=(0,Z.useState)(0),pe=(0,Z.useCallback)(()=>R(e=>e+1),[]);(0,Z.useEffect)(()=>{let e=M.current;if(!e)return;let{idx:n,wantLast:r,tries:i}=e,a=t.current;if(!a)return;let{getItemElement:o,getItemTop:s,scrollToIndex:c}=j.current,l=o(n),u=l?.yogaNode?.getComputedHeight()??0;if(!l||u===0){if(i>1){M.current=null,V(`seek(i=${n}): no mount after scrollToIndex, skip`),F.current(r?-1:1);return}M.current={idx:n,wantLast:r,tries:i+1},c(n),pe();return}M.current=null,a.scrollTo(Math.max(0,s(n)-Oi));let d=g?.(l)??[];if(N.current={msgIdx:n,positions:d},V(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++ae.current>20){ae.current=0;return}F.current(r?-1:1);return}ae.current=0;let f=r?d.length-1:0;ce.current.screenOrd=f,P.current=-1,se.current(f);let p=oe.current;p&&(oe.current=0,F.current(p))},[fe]);function me(e,n){let r=t.current;if(!r)return;let i=j.current,{getItemElement:a,scrollToIndex:o}=i;if(e<0||e>=i.messages.length)return;_?.(null),N.current={msgIdx:-1,positions:[]},M.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(de(e)):o(e),pe()}function he(e){let t=ce.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(M.current){oe.current=e;return}P.current<0&&(P.current=t.ptr);let{positions:a}=N.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,L(o),P.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===P.current){_?.(null),P.current=-1,V(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,me(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;h?.(i,c)}F.current=he,(0,Z.useImperativeHandle)(m,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(de(e))},setSearchQuery:e=>{M.current=null,N.current={msgIdx:-1,positions:[]},P.current=-1,_?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=j.current.messages;for(let t=0;t<e.length;t++){let a=l(e[t]),o=a.indexOf(n),s=0;for(;o>=0;)s++,o=a.indexOf(n,o+n.length);s>0&&(r.push(t),i.push(i.at(-1)+s))}}let a=i.at(-1),o=0,s=t.current,{offsets:c,start:u,getItemTop:d}=j.current,f=d(u),p=f>=0?f-c[u]:0;if(r.length>0&&s){let t=le.current>=0?le.current:s.getScrollTop(),n=1/0;for(let e=0;e<r.length;e++){let i=Math.abs(p+c[r[e]]-t);i<=n&&(n=i,o=e)}V(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}ce.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?me(r[o],!0):le.current>=0&&s&&s.scrollTo(le.current),h?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>he(1),prevMatch:()=>he(-1),setAnchor:()=>{let e=t.current;e&&(le.current=e.getScrollTop())},disarmSearch:()=>{_?.(null),M.current=null,N.current={msgIdx:-1,positions:[]},P.current=-1},warmSearchIndex:async()=>{if(I.current)return 0;let e=j.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await St(0);let r=performance.now(),i=Math.min(n+500,e.length);for(let t=n;t<i;t++)l(e[t]);t+=performance.now()-r}let r=Math.round(performance.now()-n);return V(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),I.current=!0,Math.round(t)}}),[t]);let[ge,_e]=(0,Z.useState)(null),ve=(0,Z.useRef)({onItemClick:a,setHoveredKey:_e});ve.current={onItemClick:a,setHoveredKey:_e};let ye=(0,Z.useCallback)((e,t)=>{let n=ve.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),be=(0,Z.useCallback)(e=>{ve.current.setHoveredKey(e)},[]),xe=(0,Z.useCallback)(e=>{ve.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,Di.jsxs)(Di.Fragment,{children:[(0,Di.jsx)(c,{ref:D,height:C,flexShrink:0}),e.slice(ne,re).map((e,t)=>{let n=ne+t,r=x[n],c=!!a&&(o?.(e)??!0),l=c&&ge===r,u=s?.(e);return(0,Di.jsx)(wi,{itemKey:r,msg:e,idx:n,measureRef:E,expanded:u,hovered:l,clickable:c,onClickK:ye,onEnterK:be,onLeaveK:xe,renderItem:i},r)}),T>0&&(0,Di.jsx)(c,{height:T,flexShrink:0}),u&&(0,Di.jsx)(Ei,{messages:e,start:ne,end:re,offsets:O,getItemTop:k,getItemElement:A,scrollRef:t})]})}function Ei({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,Z.useContext)(yi);(0,Z.useSyncExternalStore)((0,Z.useCallback)(e=>o.current?.subscribe(e)??Mi,[o]),()=>{let e=o.current;if(!e)return NaN;let t=e.getScrollTop()+e.getPendingDelta();return e.isSticky()?-1-t:t});let c=o.current?.isSticky()??!0,l=Math.max(0,(o.current?.getScrollTop()??0)+(o.current?.getPendingDelta()??0)),u=t,d=-1;for(let e=n-1;e>=t;e--){let t=i(e);if(t>=0){if(t<l)break;d=t}u=e}let f=-1,p=null;if(u>0&&!c)for(let t=u-1;t>=0;t--){let n=Si(e[t]);if(n===null)continue;let r=i(t);if(!(r>=0&&r+1>=l)){f=t,p=n;break}}let m=d>=0?d-r[u]:0,h=f>=0?Math.max(0,m+r[f]):-1,g=(0,Z.useRef)({idx:-1,tries:0}),_=(0,Z.useRef)(`none`),v=(0,Z.useRef)(-1);return(0,Z.useEffect)(()=>{if(g.current.idx>=0)return;if(_.current===`armed`){_.current=`force`;return}let e=_.current===`force`;if(_.current=`none`,!e&&v.current===f)return;if(v.current=f,p===null){s(null);return}let t=p.trimStart(),n=t.search(/\n\s*\n/),r=(n>=0?t.slice(0,n):t).slice(0,Ai).replace(/\s+/g,` `).trim();if(r===``){s(null);return}let i=f,c=h;s({text:r,scrollTo:()=>{s(`clicked`),_.current=`armed`;let e=a(i);e?o.current?.scrollToElement(e,1):(o.current?.scrollTo(c),g.current={idx:i,tries:0})}})}),(0,Z.useEffect)(()=>{if(g.current.idx<0)return;let e=a(g.current.idx);e?(o.current?.scrollToElement(e,1),g.current={idx:-1,tries:0}):++g.current.tries>5&&(g.current={idx:-1,tries:0})}),null}var Z,Di,Oi,ki,Ai,ji,Mi,Ni=e((()=>{Z=t(p(),1),Zr(),y(),Le(),bi(),Di=x(),qe(),Ct(),_n(),ce(),Oi=3,ki=new WeakMap,Ai=500,ji=new WeakMap,Mi=()=>{}}));function Pi(e,t,n=Vi,r=Hi){let i=t.current,a=i?e.findIndex(e=>e.uuid===i.uuid):-1,o=a>=0?a:i?Math.min(i.idx,Math.max(0,e.length-n)):0;e.length-o>n+r&&(o=e.length-n);let s=e[o];return s&&(i?.uuid!==s.uuid||i.idx!==o)?t.current={uuid:s.uuid,idx:o}:!s&&i&&(t.current=null),o}function Fi(e){return(e.type===`assistant`||e.type===`user`?Ue(e):null)??e.uuid}function Ii(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Li(e,t,n,r,i,a){if(i===`transcript`)return!0;switch(e.type){case`attachment`:case`user`:case`assistant`:{if(e.type===`assistant`){let t=e.message.content[0];if(t?.type===`server_tool_use`)return a.resolvedToolUseIDs.has(t.id)}let i=Ue(e);return i?t.has(i)||n.has(i)||Ae(i,`PostToolUse`,a)?!1:Xt(r,a.resolvedToolUseIDs):!0}case`system`:return e.subtype!==`api_error`;case`grouped_tool_use`:return e.messages.every(e=>{let t=e.message.content[0];return t?.type===`tool_use`&&a.resolvedToolUseIDs.has(t.id)});case`collapsed_read_search`:return!1;default:return!0}}var Ri,Q,$,zi,Bi,Vi,Hi,Ui,Wi,Gi=e((()=>{h(),Ri=t(p(),1),Q=t(p(),1),Zt(),Ze(),B(),y(),z(),_t(),I(),en(),rn(),Ce(),et(),r(),Se(),ln(),te(),ft(),_n(),fr(),he(),Or(),ce(),ve(),jr(),ze(),Vr(),$=x(),se(),Ni(),zi=Ri.memo(function({agentDefinitions:e}){return(0,$.jsx)(R,{children:(0,$.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(lr,{}),(0,$.jsx)(Ri.Suspense,{fallback:null,children:(0,$.jsx)(Lr,{agentDefinitions:e})})]})})}),Bi=30,Vi=200,Hi=50,Ui=({messages:e,tools:t,commands:r,verbose:i,toolJSX:a,toolUseConfirmQueue:s,inProgressToolUseIDs:l,isMessageSelectorVisible:f,conversationId:p,screen:h,streamingToolUses:g,showAllInTranscript:_=!1,agentDefinitions:y,hideLogo:b=!1,isLoading:x,hidePastThinking:w=!1,streamingThinking:T,streamingText:E,unseenDivider:D,scrollRef:O,trackStickyPrompt:k,jumpRef:A,onSearchMatchesChange:te,scanElement:ie,setPositions:j,disableRenderCap:P=!1,cursor:F=null,setCursor:se,cursorNavRef:ce,renderRange:I})=>{let{columns:ue}=v(),de=je(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),L=(0,Q.useMemo)(()=>Te(e).filter(oe),[e]),R=(0,Q.useMemo)(()=>T?T.isStreaming?!0:T.streamingEndedAt?Date.now()-T.streamingEndedAt<3e4:!1:!1,[T]),{lastThinkingBlockId:pe,latestBashOutputUUID:he}=(0,Q.useMemo)(()=>{let e=null,t=null,n=w&&!R;w&&R&&(e=`streaming`);for(let r=L.length-1;r>=0;r--){let i=L[r];if(i?.type===`user`){let r=i.message.content;if(!t){for(let e of r)if(e.type===`text`){let n=e.text??``;if(n.startsWith(`<bash-stdout`)||n.startsWith(`<bash-stderr`)){t=i.uuid;break}}}n&&!e&&(r.some(e=>e.type===`tool_result`)||(e=`no-thinking`))}else if(i?.type===`assistant`&&n&&!e){let t=i.message.content;for(let n=t.length-1;n>=0;n--)if(t[n]?.type===`thinking`){e=`${i.uuid}:${n}`;break}}if(e!==null&&t)break}return w||(e=null),{lastThinkingBlockId:e,latestBashOutputUUID:t}},[L,w,R]),ge=(0,Q.useMemo)(()=>Ee(L),[L]),_e=(0,Q.useMemo)(()=>g.filter(e=>!l.has(e.contentBlock.id)&&!ge.has(e.contentBlock.id)),[g,l,ge]),ve=(0,Q.useMemo)(()=>_e.flatMap(e=>{let t=ee({content:[e.contentBlock]});return t.uuid=Oe(e.contentBlock.id,0),Te([t])}),[_e]),ye=h===`transcript`,xe=(0,Q.useMemo)(()=>n(process.env.WORKMATE_DISABLE_VIRTUAL_SCROLL),[]),Se=O!=null&&!xe,Ce=ye&&!_&&!Se,we=(0,Q.useRef)(null),z=(0,Q.useRef)(null),{collapsed:De,lookups:Ae,hasTruncatedMessages:Me,hiddenMessageCount:Ne}=(0,Q.useMemo)(()=>{let e=me((i||re()?L:ae(L,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!kr(e)&&be(e,ye)),ve),n=Ce?e.slice(-30):e,r=Ce&&e.length>Bi,{messages:a}=sn(n,t,i),o=$t(nn(Re(a,t)),i),s=S(L,n),c=(()=>{let e=n.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),l;if(z.current&&z.current.key===s)l=z.current.lookups;else if(z.current&&L.length>=z.current.normalizedCount&&n.length>=z.current.messageCount&&z.current.lastAssistantMsgId===c){let e=fe(z.current.lookups,z.current.normalizedCount,z.current.messageCount,L,n);e?(l=e,z.current={key:s,lookups:l,normalizedCount:L.length,messageCount:n.length,lastAssistantMsgId:c}):(l=N(L,n),z.current={key:s,lookups:l,normalizedCount:L.length,messageCount:n.length,lastAssistantMsgId:c})}else l=N(L,n),z.current={key:s,lookups:l,normalizedCount:L.length,messageCount:n.length,lastAssistantMsgId:c};let u=e.length-Bi;return{collapsed:o,lookups:l,hasTruncatedMessages:r,hiddenMessageCount:u}},[i,L,ye,ve,Ce,t]),B=(0,Q.useMemo)(()=>{let e=!Se&&!P?Pi(De,we):0;return I?De.slice(I[0],I[1]):e>0?De.slice(e):De},[De,I,Se,P]),Pe=(0,Q.useMemo)(()=>new Set(g.map(e=>e.contentBlock.id)),[g]),{dividerBeforeIndex:Ie,selectedIdx:Le}=(0,Q.useMemo)(()=>{if(!D&&!F)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=D?.firstUnseenUuid.slice(0,24);for(let r=0;r<B.length;r++){let i=B[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&F&&i.uuid===F.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[D,F,B]),[ze,Be]=(0,Q.useState)(()=>new Set),Ve=(0,Q.useCallback)(e=>{let t=Fi(e);Be(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),He=(0,Q.useCallback)(e=>ze.size>0&&ze.has(Fi(e)),[ze]),Ue=(0,Q.useRef)(Ae);Ue.current=Ae;let We=(0,Q.useCallback)(e=>{if(e.type===`collapsed_read_search`)return!0;if(e.type===`assistant`){let t=e.message.content,n=Array.isArray(t)?t[0]:void 0;return n!=null&&M(n)&&n.type===`advisor_tool_result`&&n.content.type===`advisor_result`}if(e.type!==`user`)return!1;let n=e.message.content[0];if(n?.type!==`tool_result`||n.is_error||!e.toolUseResult)return!1;let r=Ue.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?gt(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),Ge=(!a||!!a.shouldContinueAnimation)&&!s.length&&!f,Ke=l.size>0,{progress:V}=d(),qe=(0,Q.useRef)(null),Je=nt().terminalProgressBarEnabled&&!ne();(0,Q.useEffect)(()=>{let e=Je?Ke?`indeterminate`:`completed`:null;qe.current!==e&&(qe.current=e,V(e))},[V,Je,Ke]),(0,Q.useEffect)(()=>()=>V(null),[V]);let Ye=(0,Q.useCallback)(e=>`${e.uuid}-${p}`,[p]),Ze=(e,n)=>{let a=n>0?B[n-1]?.type:void 0,s=e.type===`user`&&a===`user`,u=e.type===`collapsed_read_search`&&(!!E||yr(B,n,t,Pe)),d=B.length-1-n>0,f=Ye(e),p=(0,$.jsx)(Dr,{message:e,isUserContinuation:s,hasContentAfter:u,tools:t,commands:r,verbose:i||He(e)||F?.expanded===!0&&n===Le,inProgressToolUseIDs:l,streamingToolUseIDs:Pe,screen:h,canAnimate:Ge,lastThinkingBlockId:pe,latestBashOutputUUID:he,columns:ue,isLoading:x,lookups:Ae,shouldCollapseDiffs:d},f),m=(0,$.jsx)(le.Provider,{value:n===Le,children:p},f);return D&&n===Ie?[(0,$.jsx)(c,{marginTop:1,children:(0,$.jsx)(o,{title:`${D.count} new ${dt(D.count,`message`)}`,width:ue,color:`inactive`})},`unseen-divider`),m]:m},Qe=(0,Q.useRef)(new WeakMap),$e=(0,Q.useCallback)(e=>{let n=Qe.current.get(e);if(n!==void 0)return n;let r=un(e);if(e.type===`user`&&e.toolUseResult&&Array.isArray(e.message.content)){let n=e.message.content.find(e=>e.type===`tool_result`);if(n&&`tool_use_id`in n){let i=Ae.toolUseByToolUseID.get(n.tool_use_id),a=(i&>(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return Qe.current.set(e,i),i},[t,Ae]);return(0,$.jsxs)($.Fragment,{children:[!b&&!(I&&I[0]>0)&&(0,$.jsx)(zi,{agentDefinitions:y}),Me&&(0,$.jsx)(o,{title:`${de} to show ${m.bold(Ne)} previous messages`,width:ue}),ye&&_&&Ne>0&&!P&&(0,$.jsx)(o,{title:`${de} to hide ${m.bold(Ne)} previous messages`,width:ue}),Se?(0,$.jsx)(ke.Provider,{value:!0,children:(0,$.jsx)(Ti,{messages:B,scrollRef:O,columns:ue,itemKey:Ye,renderItem:Ze,onItemClick:Ve,isItemClickable:We,isItemExpanded:He,trackStickyPrompt:k,selectedIndex:Le>=0?Le:void 0,cursorNavRef:ce,setCursor:se,jumpRef:A,onSearchMatchesChange:te,scanElement:ie,setPositions:j,extractSearchText:$e})}):B.flatMap(Ze),E&&(0,$.jsx)(c,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(c,{flexDirection:`row`,children:[(0,$.jsx)(c,{minWidth:2,children:(0,$.jsx)(u,{color:`text`,children:Xe})}),(0,$.jsx)(c,{flexDirection:`column`,children:(0,$.jsx)(Fe,{children:E})})]})}),R&&T&&(0,$.jsx)(c,{marginTop:1,children:(0,$.jsx)(C,{param:{type:`thinking`,thinking:T.thinking},addMargin:!1,isTranscriptMode:!0,verbose:i,hideInTranscript:!1})})]})},Wi=Ri.memo(Ui,(e,t)=>{let n=Object.keys(e);for(let r of n)if(!(r===`scrollRef`||r===`trackStickyPrompt`||r===`setCursor`||r===`cursorNavRef`||r===`jumpRef`||r===`onSearchMatchesChange`||r===`scanElement`||r===`setPositions`)&&e[r]!==t[r]){if(r===`streamingToolUses`){let n=e.streamingToolUses,r=t.streamingToolUses;if(n.length===r.length&&n.every((e,t)=>e.contentBlock===r[t]?.contentBlock))continue}if(r===`inProgressToolUseIDs`&&Ii(e.inProgressToolUseIDs,t.inProgressToolUseIDs))continue;if(r===`unseenDivider`){let n=e.unseenDivider,r=t.unseenDivider;if(n?.firstUnseenUuid===r?.firstUnseenUuid&&n?.count===r?.count)continue}if(r===`tools`){let n=e.tools,r=t.tools;if(n.length===r.length&&n.every((e,t)=>e.name===r[t]?.name))continue}return!1}return!0})}));export{bi as a,ti as c,fi as i,ni as l,Gi as n,li as o,pi as r,ci as s,Wi as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as t,H as n,I as r,Lt as i,P as a,ai as o,kt as s,t as c}from"./src-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as t,H as n,I as r,Lt as i,P as a,ai as o,kt as s,t as c}from"./src-WZ94ZKI3.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{tb as u}from"./loadAgentsDir-DR5PVAc3.js";import{Kt as d,Ut as f}from"./settings-YIDksG5Z.js";import{n as p}from"./analytics-COpjZpvd.js";import{c as m,i as h,s as g}from"./terminalSetup-Cqy5_PhJ.js";import{n as _,t as v}from"./useExitOnCtrlCDWithKeybindings-BgJrnuDl.js";import{n as y,t as b}from"./select-FrwoTzuc.js";import{r as x}from"./Spinner-DhhSOFcN.js";import{n as S,t as C}from"./ThemePicker-DTpXbEY0.js";import{n as w,t as T}from"./PressEnterToContinue-CPOaYnym.js";var E=e(o(),1),D=l();p(),d(),u(),h(),v(),c(),c(),x(),y(),c();var O=58;function k(){let[e]=n(),t=`Welcome to Work Mate`;return f.terminal===`Apple_Terminal`?(0,D.jsx)(A,{theme:e,welcomeMessage:t}):[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,D.jsxs)(r,{width:O,flexDirection:`column`,children:[(0,D.jsxs)(a,{children:[(0,D.jsxs)(a,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,D.jsxs)(a,{dimColor:!0,children:[`v`,`0.0.26`,` `]})]}),(0,D.jsx)(a,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,D.jsx)(a,{children:` ░░░░░░ `}),(0,D.jsx)(a,{children:` ░░░ ░░░░░░░░░░ `}),(0,D.jsx)(a,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{children:` `})]}):(0,D.jsxs)(r,{width:O,flexDirection:`column`,children:[(0,D.jsxs)(a,{children:[(0,D.jsxs)(a,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,D.jsxs)(a,{dimColor:!0,children:[`v`,`0.0.26`,` `]})]}),(0,D.jsx)(a,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,D.jsx)(a,{children:` * █████▓▓░ `}),(0,D.jsx)(a,{children:` * ███▓░ ░░ `}),(0,D.jsx)(a,{children:` ░░░░░░ ███▓░ `}),(0,D.jsx)(a,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,D.jsxs)(a,{children:[(0,D.jsx)(a,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{bold:!0,children:`*`}),(0,D.jsx)(a,{children:` ██▓░░ ▓ `})]}),(0,D.jsx)(a,{children:` ░▓▓███▓▓░ `}),(0,D.jsx)(a,{dimColor:!0,children:` * ░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` ░░░░░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` * `})]})}function A({theme:e,welcomeMessage:t}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,D.jsxs)(r,{width:O,flexDirection:`column`,children:[(0,D.jsxs)(a,{children:[(0,D.jsxs)(a,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,D.jsxs)(a,{dimColor:!0,children:[`v`,`0.0.26`,` `]})]}),(0,D.jsx)(a,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,D.jsx)(a,{children:` ░░░░░░ `}),(0,D.jsx)(a,{children:` ░░░ ░░░░░░░░░░ `}),(0,D.jsx)(a,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{children:` `})]}):(0,D.jsxs)(r,{width:O,flexDirection:`column`,children:[(0,D.jsxs)(a,{children:[(0,D.jsxs)(a,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,D.jsxs)(a,{dimColor:!0,children:[`v`,`0.0.26`,` `]})]}),(0,D.jsx)(a,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,D.jsx)(a,{children:` * █████▓▓░ `}),(0,D.jsx)(a,{children:` * ███▓░ ░░ `}),(0,D.jsx)(a,{children:` ░░░░░░ ███▓░ `}),(0,D.jsx)(a,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,D.jsxs)(a,{children:[(0,D.jsx)(a,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{bold:!0,children:`*`}),(0,D.jsx)(a,{children:` ██▓░░ ▓ `})]}),(0,D.jsx)(a,{children:` ░▓▓███▓▓░ `}),(0,D.jsx)(a,{dimColor:!0,children:` * ░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` ░░░░░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}S(),w(),c();var j=(0,E.createContext)({marker:``});function M({children:e}){let{marker:t}=(0,E.useContext)(j);return(0,D.jsxs)(r,{gap:1,children:[(0,D.jsx)(a,{dimColor:!0,children:t}),(0,D.jsx)(r,{flexDirection:`column`,children:e})]})}c();var N=(0,E.createContext)({marker:``});function P({children:e}){let{marker:t}=(0,E.useContext)(N),n=0;for(let t of E.Children.toArray(e))!(0,E.isValidElement)(t)||t.type!==M||n++;let i=String(n).length;return(0,D.jsx)(r,{flexDirection:`column`,children:E.Children.map(e,(e,n)=>{if(!(0,E.isValidElement)(e)||e.type!==M)return e;let r=`${String(n+1).padStart(i)}.`,a=`${t}${r}`;return(0,D.jsx)(N.Provider,{value:{marker:a},children:(0,D.jsx)(j.Provider,{value:{marker:a},children:e})})})})}P.Item=M;var F=P;c(),d();function I({onDone:e}){let[o,c]=(0,E.useState)(0),[l,u]=n();(0,E.useEffect)(()=>{},[]);function d(){if(o<x.length-1){let e=o+1;c(e),x[e]?.id}else e()}function p(e){u(e),d()}let h=_(),v=(0,D.jsx)(r,{marginX:1,children:(0,D.jsx)(C,{onThemeSelect:p,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),y=(0,D.jsxs)(r,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,D.jsx)(a,{bold:!0,children:`Before you start, keep in mind:`}),(0,D.jsx)(r,{flexDirection:`column`,width:70,children:(0,D.jsxs)(F,{children:[(0,D.jsxs)(F.Item,{children:[(0,D.jsx)(a,{children:`Always review changes before accepting`}),(0,D.jsxs)(a,{dimColor:!0,wrap:`wrap`,children:[`Work Mate can make mistakes — especially when running commands`,(0,D.jsx)(s,{}),`or editing files. You stay in control of every action.`,(0,D.jsx)(s,{})]})]}),(0,D.jsxs)(F.Item,{children:[(0,D.jsx)(a,{children:`Only use Work Mate on projects you trust`}),(0,D.jsxs)(a,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,D.jsx)(s,{}),(0,D.jsx)(i,{url:`https://code.workmate.com/docs/en/security`})]})]})]})}),(0,D.jsx)(T,{})]}),x=[];x.push({id:`theme`,component:v}),x.push({id:`security`,component:y}),m()&&x.push({id:`terminal-setup`,component:(0,D.jsxs)(r,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,D.jsx)(a,{bold:!0,children:`Use Work Mate's terminal setup?`}),(0,D.jsxs)(r,{flexDirection:`column`,width:70,gap:1,children:[(0,D.jsxs)(a,{children:[`For the optimal coding experience, enable the recommended settings`,(0,D.jsx)(s,{}),`for your terminal:`,` `,f.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,D.jsx)(b,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?g(l).catch(()=>{}).finally(d):d()},onCancel:()=>d()}),(0,D.jsx)(a,{dimColor:!0,children:h.pending?(0,D.jsxs)(D.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,D.jsx)(D.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let S=x[o],w=(0,E.useCallback)(()=>{o===x.length-1?e():d()},[o,x.length,e]),O=(0,E.useCallback)(()=>{d()},[o,x.length,e]);return t({"confirm:yes":w},{context:`Confirmation`,isActive:S?.id===`security`}),t({"confirm:no":O},{context:`Confirmation`,isActive:S?.id===`terminal-setup`}),(0,D.jsxs)(r,{flexDirection:`column`,children:[(0,D.jsx)(k,{}),(0,D.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[S?.component,h.pending&&(0,D.jsx)(r,{padding:1,children:(0,D.jsxs)(a,{dimColor:!0,children:[`Press `,h.keyName,` again to exit`]})})]})]})}export{I as Onboarding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,t as r}from"./src-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,t as r}from"./src-WZ94ZKI3.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";function a({title:e,subtitle:r,color:i=`permission`}){return(0,o.jsxs)(t,{flexDirection:`column`,children:[(0,o.jsx)(t,{flexDirection:`row`,gap:1,children:(0,o.jsx)(n,{bold:!0,color:i,children:e})}),r!=null&&(typeof r==`string`?(0,o.jsx)(n,{dimColor:!0,wrap:`truncate-start`,children:r}):r)]})}var o,s=e((()=>{r(),o=i()}));function c({title:e,subtitle:n,color:r=`permission`,titleColor:i,innerPaddingX:o=1,titleRight:s,children:c}){return(0,l.jsxs)(t,{flexDirection:`column`,borderStyle:`round`,borderColor:r,borderLeft:!1,borderRight:!1,borderBottom:!1,marginTop:1,children:[(0,l.jsx)(t,{paddingX:1,flexDirection:`column`,children:(0,l.jsxs)(t,{justifyContent:`space-between`,children:[(0,l.jsx)(a,{title:e,subtitle:n,color:i}),s]})}),(0,l.jsx)(t,{flexDirection:`column`,paddingX:o,children:c})]})}var l,u=e((()=>{r(),s(),l=i()}));export{s as i,u as n,a as r,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{P as t,t as n}from"./src-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{P as t,t as n}from"./src-WZ94ZKI3.js";import{t as r}from"./jsx-runtime-Bb4Xn-E0.js";function i(){return(0,a.jsxs)(t,{color:`permission`,children:[`Press `,(0,a.jsx)(t,{bold:!0,children:`Enter`}),` to continue…`]})}var a,o=e((()=>{n(),a=r()}));export{o as n,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gr as n,I as r,P as i,ai as a,ot as o,t as s}from"./src-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gr as n,I as r,P as i,ai as a,ot as o,t as s}from"./src-WZ94ZKI3.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{sb as l}from"./loadAgentsDir-DR5PVAc3.js";import{S as u,_ as d,b as f}from"./startupProfiler-DIM_Ihyp.js";function p(e){return e.startsWith(`file-`)?`+`:e.startsWith(`mcp-resource-`)?`◇`:e.startsWith(`agent-`)?`*`:`+`}function m(e){return e.startsWith(`file-`)||e.startsWith(`mcp-resource-`)||e.startsWith(`agent-`)}function h({suggestions:e,selectedSuggestion:t,maxColumnWidth:i,overlay:a}){let{rows:s}=o(),c=a?5:Math.min(6,Math.max(1,s-3));if(e.length===0)return null;let l=i??Math.max(...e.map(e=>n(e.displayText)))+5,u=Math.max(0,Math.min(t-Math.floor(c/2),e.length-c)),d=Math.min(u+c,e.length),f=e.slice(u,d);return(0,_.jsx)(r,{flexDirection:`column`,justifyContent:a?void 0:`flex-end`,children:f.map(n=>(0,_.jsx)(v,{item:n,maxColumnWidth:l,isSelected:n.id===e[t]?.id},n.id))})}var g,_,v,y,b=e((()=>{g=t(a(),1),l(),s(),d(),_=c(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:r}){let a=o().columns;if(m(e.id)){let t=p(e.id),o=r?`suggestion`:void 0,s=!r,c=e.id.startsWith(`file-`),l=e.id.startsWith(`mcp-resource-`),d=e.description?3:0,m;if(c){let t=e.description?Math.min(20,n(e.description)):0,r=a-2-4-d-t;m=f(e.displayText,r)}else m=l?u(e.displayText,30):e.displayText;let h=a-2-n(m)-d-4,g;if(e.description){let n=Math.max(0,h),r=u(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(i,{color:o,dimColor:s,wrap:`truncate`,children:g})}let s=Math.floor(a*.4),c=Math.min(t??n(e.displayText)+5,s),l=e.color||(r?`suggestion`:void 0),d=!r,h=e.displayText;n(h)>c-2&&(h=u(h,c-2));let g=h+` `.repeat(Math.max(0,c-n(h))),v=e.tag?`[${e.tag}] `:``,y=n(v),b=Math.max(0,a-c-y-4),x=e.description?u(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(i,{wrap:`truncate`,children:[(0,_.jsx)(i,{color:l,dimColor:d,children:g}),v?(0,_.jsx)(i,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(i,{color:r?`suggestion`:void 0,dimColor:!r,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,t as r}from"./src-WZ94ZKI3.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{AC as a,NC as o,jC as s,nb as c,rb as l}from"./loadAgentsDir-DR5PVAc3.js";import{Kt as u,Ut as d}from"./settings-YIDksG5Z.js";import{d as f,o as p}from"./config-D3K87Mm1.js";import{i as m,n as h}from"./platform-Vl9IynC3.js";import{a as g,s as _}from"./sleep-BbWr_FL1.js";import{a as v,i as y,r as b}from"./terminalSetup-Cqy5_PhJ.js";function x(){return p().editorMode===`vim`}function S(){return d.terminal===`Apple_Terminal`&&process.platform===`darwin`||v()?`shift + ⏎ for newline`:b()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function C(e,t){return t.ctrl||t.meta||t.escape||t.return||t.tab||t.backspace||t.delete||t.upArrow||t.downArrow||t.leftArrow||t.rightArrow||t.pageUp||t.pageDown||t.home||t.end?!1:e.length>0&&!/^\s/.test(e)&&!e.startsWith(`\x1B`)}var w=e((()=>{y(),f(),u()}));function T(e){return e.replace(/\+/g,` + `)}function E(e){let{dimColor:r,fixedWidth:i,gap:a,paddingX:c}=e,u=T(l(`app:toggleTranscript`,`Global`,`ctrl+o`)),d=T(l(`app:toggleTodos`,`Global`,`ctrl+t`)),f=T(l(`chat:undo`,`Chat`,`ctrl+_`)),p=T(l(`chat:stash`,`Chat`,`ctrl+s`)),m=T(l(`chat:cycleMode`,`Chat`,`shift+tab`)),g=T(l(`chat:modelPicker`,`Chat`,`alt+p`)),v=T(l(`chat:fastMode`,`Chat`,`alt+o`)),y=T(l(`chat:externalEditor`,`Chat`,`ctrl+g`));T(l(`app:toggleTerminal`,`Global`,`meta+j`));let b=T(l(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,D.jsxs)(t,{paddingX:c,flexDirection:`row`,gap:a,children:[(0,D.jsxs)(t,{flexDirection:`column`,width:i?24:void 0,children:[(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`! for bash mode`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`/ for commands`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`@ for file paths`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`& for background`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`/btw for side question`})})]}),(0,D.jsxs)(t,{flexDirection:`column`,width:i?35:void 0,children:[(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`double tap esc to clear input`})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[m,` to auto-accept edits`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[u,` for verbose output`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[d,` to toggle tasks`]})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:S()})})]}),(0,D.jsxs)(t,{flexDirection:`column`,children:[(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[f,` to undo`]})}),h()!==`windows`&&(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`ctrl + z to suspend`})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[b,` to paste images`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[g,` to switch model`]})}),o()&&s()&&(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[v,` to toggle fast mode`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[p,` to stash prompt`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[y,` to edit in $EDITOR`]})}),_()&&(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`/keybindings to customize`})})]})]})}var D,O=e((()=>{r(),m(),g(),c(),a(),w(),D=i()}));export{x as a,C as i,O as n,w as r,E as t};
|