@readmagic/workmate 0.0.26 → 0.0.28
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-mS8iUoWY.js → AddWorkspaceDirectory-Bmgh8VS3.js} +1 -1
- package/dist/chunks/{AgentsMdExternalIncludesDialog-BHBkysy0.js → AgentsMdExternalIncludesDialog-BJfHqScU.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-BjbUilCE.js +1 -0
- package/dist/chunks/{App-D--vtCyq.js → App-COdpsR2w.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-WkoL4g5Q.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-DyqI98d2.js → BypassPermissionsModeDialog-BT9yl0Qt.js} +1 -1
- package/dist/chunks/CustomSelect-t4wXuXWH.js +1 -0
- package/dist/chunks/{DiffDialog-BQAU2pJx.js → DiffDialog-CXZxnb7Y.js} +6 -6
- package/dist/chunks/Doctor-B6isid5K.js +1 -0
- package/dist/chunks/{Doctor-DJOMbSDE.js → Doctor-COj-tZBc.js} +2 -2
- package/dist/chunks/{ExitFlow-xBOnvhiW.js → ExitFlow-CcMYH5iI.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-NiuhcaG5.js → InvalidConfigDialog-riLYEaUP.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-DrromC1I.js → InvalidSettingsDialog-BGXl3V1A.js} +1 -1
- package/dist/chunks/KeybindingProviderSetup-syiDgtpB.js +1 -0
- package/dist/chunks/MCPConnectionManager-C7RmKzJh.js +1 -0
- package/dist/chunks/MCPToolListView-CewNLJus.js +1 -0
- package/dist/chunks/{McpParsingWarnings-BYG2yqjO.js → McpParsingWarnings-Czze2JPd.js} +1 -1
- package/dist/chunks/MessageSelector-Kc6JlnDX.js +3 -0
- package/dist/chunks/Messages-BvFYO4Zn.js +10 -0
- package/dist/chunks/Onboarding-CD_Uv5h9.js +1 -0
- package/dist/chunks/{PermissionDialog-tEMMa5-a.js → PermissionDialog-DjCRuzSm.js} +1 -1
- package/dist/chunks/{PressEnterToContinue-CPOaYnym.js → PressEnterToContinue-DE1RxMX_.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-CwqAsTI2.js → PromptInputFooterSuggestions-CHXJsTtQ.js} +1 -1
- package/dist/chunks/PromptInputHelpMenu-BZIVCV7V.js +1 -0
- package/dist/chunks/{ProviderSetup-J6Ty-Wj8.js → ProviderSetup-CwMvjmjh.js} +1 -1
- package/dist/chunks/QueryEngine-DAwfp_ht.js +1 -0
- package/dist/chunks/REPL-CtFtb35A.js +124 -0
- package/dist/chunks/REPL-tFT1FGQF.js +1 -0
- package/dist/chunks/{ResumeConversation-Cmsbo5m7.js → ResumeConversation-CERzSBvg.js} +1 -1
- package/dist/chunks/{SearchBox-DQBLKyzJ.js → SearchBox-zA5QwIpO.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-ndh4aEwQ.js +1 -0
- package/dist/chunks/Settings-CPaqWNdP.js +2 -0
- package/dist/chunks/Spinner-C0qHjfIY.js +1 -0
- package/dist/chunks/SpinnerGlyph-BR_SiV9L.js +1 -0
- package/dist/chunks/{TextInput-BboKIug2.js → TextInput-ou7ZhpVY.js} +7 -7
- package/dist/chunks/{ThemePicker-DTpXbEY0.js → ThemePicker-CVFWqSc7.js} +1 -1
- package/dist/chunks/TrustDialog-CGXv_LF4.js +1 -0
- package/dist/chunks/{ValidationErrorsList-C_gDQfm1.js → ValidationErrorsList-CKeHoN2Z.js} +1 -1
- package/dist/chunks/{_baseEach-DGbaIpJA.js → _baseEach-BYhqv77g.js} +1 -1
- package/dist/chunks/{add-dir-B576wzi9.js → add-dir-BSizpuef.js} +1 -1
- package/dist/chunks/{agentDisplay-ZuFoBZYu.js → agentDisplay-JKfYFD1m.js} +1 -1
- package/dist/chunks/{agents-Dy4_hDic.js → agents-BDTCH6YB.js} +1 -1
- package/dist/chunks/agents-MEaV8P2G.js +101 -0
- package/dist/chunks/allErrors-Dhnf6rqg.js +1 -0
- package/dist/chunks/{appleTerminalBackup-C9kjzdM9.js → appleTerminalBackup-CN8kS74J.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-Bu-zRFCx.js +1 -0
- package/dist/chunks/{backgroundHousekeeping-PyLNnGdw.js → backgroundHousekeeping-CsXlkIg3.js} +1 -1
- package/dist/chunks/banner-BKOzHotb.js +2 -0
- package/dist/chunks/branch-BllXcYwS.js +2 -0
- package/dist/chunks/{break-cache-DL95nKZl.js → break-cache-B1nuWtD_.js} +2 -2
- package/dist/chunks/bridgeControl-aDnUrYZR.js +2 -0
- package/dist/chunks/{btw-Y44ctueB.js → btw-DzaRBa6o.js} +1 -1
- package/dist/chunks/bundledMode-D9omqD3L.js +2 -0
- package/dist/chunks/caches-CMF-MmR-.js +1 -0
- package/dist/chunks/caches-CW5YnYNS.js +1 -0
- package/dist/chunks/channel-DVx21qde.js +1 -0
- package/dist/chunks/channel-Gw6skpUh.js +1 -0
- package/dist/chunks/{clear-DtTkA707.js → clear-CDQs9_5P.js} +1 -1
- package/dist/chunks/{client-aJ2Nr_sh.js → client-2w-g5kMx.js} +1 -1
- package/dist/chunks/client-B0ngS4Uu.js +1 -0
- package/dist/chunks/client-BP4DOH3K.js +1 -0
- package/dist/chunks/{client-Bw_L3lSc.js → client-pA7fKk0-.js} +1 -1
- package/dist/chunks/commands-CfYMwgP7.js +1 -0
- package/dist/chunks/{compact-CvNOtu7J.js → compact-6F2tuItE.js} +1 -1
- package/dist/chunks/config-BDkzWBnL.js +1 -0
- package/dist/chunks/config-Bio2EjUK.js +3 -0
- package/dist/chunks/config-C_AEhZrn.js +1 -0
- package/dist/chunks/{context-Opu4E8dL.js → context-TkdzCK3Y.js} +1 -1
- package/dist/chunks/{context-noninteractive-B1V2Mp26.js → context-noninteractive-BcBo64vo.js} +9 -9
- package/dist/chunks/context-noninteractive-oFcnY1Er.js +1 -0
- package/dist/chunks/{conversation-CG_z7TLE.js → conversation-CYZyg1U1.js} +1 -1
- package/dist/chunks/conversation-DXzlRhNw.js +1 -0
- package/dist/chunks/conversationRecovery-_hWC7JBO.js +1 -0
- package/dist/chunks/crossProjectResume-CCo3iZrB.js +40 -0
- package/dist/chunks/{debug-kBjDaVkQ.js → debug-2pVES-2G.js} +1 -1
- package/dist/chunks/detectRepository--luIRv5H.js +1 -0
- package/dist/chunks/{diff-Cv7tX2-P.js → diff-BzVUPO4Z.js} +1 -1
- package/dist/chunks/directoryCompletion-BC0qRmrz.js +1 -0
- package/dist/chunks/doctor-B4jQbGQr.js +1 -0
- package/dist/chunks/entry-333L52Lo.js +13 -0
- package/dist/chunks/{envUtils-DZ_SvEVz.js → envUtils-QyzA_cFM.js} +1 -1
- package/dist/chunks/{execFileNoThrow-BfZFnCGa.js → execFileNoThrow-DXSEj8ZO.js} +1 -1
- package/dist/chunks/{exit-OKEV_ddw.js → exit-D5DYnRvR.js} +1 -1
- package/dist/chunks/{extraUsage-BlRL3yeb.js → extraUsage-CmgRR-zH.js} +1 -1
- package/dist/chunks/extractMemories-CVUrBFMj.js +1 -0
- package/dist/chunks/fast-CRhW9zha.js +1 -0
- package/dist/chunks/fast-D7oNjaZ3.js +1 -0
- package/dist/chunks/fetchModelList-Cv1vWIpC.js +1 -0
- package/dist/chunks/fetchModelList-DIa1HwAJ.js +1 -0
- package/dist/chunks/fileSuggestions-DF3HTRKr.js +3 -0
- package/dist/chunks/{fpsMetrics-Ixd0J4CH.js → fpsMetrics-DIpm2-xw.js} +1 -1
- package/dist/chunks/{gemini-BfVyavwQ.js → gemini-ou7_YyXc.js} +1 -1
- package/dist/chunks/generateSessionName-CeN9EZNY.js +1 -0
- package/dist/chunks/{genericProcessUtils-CVtQOTO2.js → genericProcessUtils-GqURdVAv.js} +1 -1
- package/dist/chunks/{goal-BidR-GFa.js → goal-CCxo4Wyf.js} +1 -1
- package/dist/chunks/{grok-DLcuI-U7.js → grok-BMmUcNbI.js} +1 -1
- package/dist/chunks/{help-CZuvYhXj.js → help-CYtogTZk.js} +1 -1
- package/dist/chunks/{history-BxPGftQw.js → history-CUrqO9rV.js} +1 -1
- package/dist/chunks/{hooks-ehqfAM5F.js → hooks-ByVkvodY.js} +2 -2
- package/dist/chunks/hooks-CBGUcyCs.js +1 -0
- package/dist/chunks/install-DIxyfdXG.js +1 -0
- package/dist/chunks/{instrumentation-B9bfF2mA.js → instrumentation-BmHivmxs.js} +4 -4
- package/dist/chunks/{job-Coztdn6A.js → job-D534P26R.js} +1 -1
- package/dist/chunks/{keybindings-DwSdLpaE.js → keybindings-CxgQqQJe.js} +1 -1
- package/dist/chunks/{launchLocalMemory-DRzfpIOB.js → launchLocalMemory-CWXLb3KF.js} +1 -1
- package/dist/chunks/{launchOnboarding-D2zFCJf-.js → launchOnboarding-CocPmwzz.js} +1 -1
- package/dist/chunks/loadAgentsDir-Zw648oQO.js +1 -0
- package/dist/chunks/{loadAgentsDir-DR5PVAc3.js → loadAgentsDir-bmpKLPdG.js} +483 -483
- package/dist/chunks/{loadPluginHooks-BiQgGfUJ.js → loadPluginHooks-BIfM53-_.js} +1 -1
- package/dist/chunks/loader-BMAtuwRa.js +1 -0
- package/dist/chunks/{localSearch-CzkxDuOR.js → localSearch-Da8cVYoI.js} +1 -1
- package/dist/chunks/localSearch-Dbj8cXyO.js +1 -0
- package/dist/chunks/{log-DWZny1vM.js → log-L1kqxa_P.js} +1 -1
- package/dist/chunks/{logoUtils-DR5T0pr3.js → logoUtils-qNuBc2nI.js} +1 -1
- package/dist/chunks/{magicDocs-BwBxjfLo.js → magicDocs-BsEiBLQl.js} +2 -2
- package/dist/chunks/{main-Ryi27wYq.js → main-B31aPMPP.js} +34 -34
- package/dist/chunks/managedEnv-DCGLDTP_.js +1 -0
- package/dist/chunks/{managedEnv-Do9fgLpk.js → managedEnv-EZ2IirNa.js} +1 -1
- package/dist/chunks/{managedEnvConstants-CWcT7nYr.js → managedEnvConstants-BPY8yF1A.js} +1 -1
- package/dist/chunks/{mcp-CZBTxbhu.js → mcp-BMeWtYCx.js} +1 -1
- package/dist/chunks/{mcp-BCpnF6wD.js → mcp-CYbesbfl.js} +1 -1
- package/dist/chunks/mcp-Dd8TBfQQ.js +5 -0
- package/dist/chunks/memory-DtQQGyPS.js +1 -0
- package/dist/chunks/{modalContext-CBE8xuck.js → modalContext-sU2lfR08.js} +1 -1
- package/dist/chunks/{mode-wq70cR44.js → mode-SM8doWgC.js} +1 -1
- package/dist/chunks/{model-DVk9-2dk.js → model-C2r-PaR4.js} +1 -1
- package/dist/chunks/model-Dd3x121y.js +1 -0
- package/dist/chunks/modelOptions-BQL4gbNk.js +1 -0
- package/dist/chunks/nativeInstaller-DMkZdsof.js +1 -0
- package/dist/chunks/{notifications-dGBuNvFj.js → notifications-BwS1XsnZ.js} +1 -1
- package/dist/chunks/{observationStore-D0rm3GhP.js → observationStore-pnSSxec_.js} +1 -1
- package/dist/chunks/{onChangeAppState-B4K-rSaF.js → onChangeAppState-C9cYQJPF.js} +1 -1
- package/dist/chunks/{openai-DAwnAV9K.js → openai-Bea4I2Od.js} +1 -1
- package/dist/chunks/{overlayContext-B6i_6y_0.js → overlayContext-C5WPACKC.js} +1 -1
- package/dist/chunks/{panel-C0CF3noE.js → panel-DNiXDhBX.js} +1 -1
- package/dist/chunks/{parser-DThLwgdM.js → parser-CTnaXFVJ.js} +1 -1
- package/dist/chunks/parser-Diihup2V.js +1 -0
- package/dist/chunks/{partition-BRQHofxD.js → partition-CKgWl7p4.js} +1 -1
- package/dist/chunks/{pasteStore-BmehVo5j.js → pasteStore-njJCBMKr.js} +1 -1
- package/dist/chunks/permissions-Dv_PCfY0.js +3 -0
- package/dist/chunks/pidLock-CqkC3-nD.js +3 -0
- package/dist/chunks/{plan-B6U3ioer.js → plan-Ce6wfjjI.js} +1 -1
- package/dist/chunks/plugin-aK4tDrVg.js +17 -0
- package/dist/chunks/pluginAutoupdate-ByokIVEs.js +1 -0
- package/dist/chunks/{pluginBlocklist-DAoUENwc.js → pluginBlocklist-ByRQaVPu.js} +1 -1
- package/dist/chunks/{pluginCliCommands-CaHnj0C_.js → pluginCliCommands-Dyk4HYHs.js} +1 -1
- package/dist/chunks/{pluginFlagging-BCj9LJP3.js → pluginFlagging-B2ZX5_oB.js} +1 -1
- package/dist/chunks/pluginOperations-BCvJvfOC.js +2 -0
- package/dist/chunks/pluginStartupCheck-QG0d95dE.js +1 -0
- package/dist/chunks/pluginStartupCheck-o_TC7wIt.js +1 -0
- package/dist/chunks/{plugins-D7zyI9c4.js → plugins-DzsTDNWJ.js} +1 -1
- package/dist/chunks/{poorMode-Ocff_UT1.js → poorMode-CG2JNTD0.js} +1 -1
- package/dist/chunks/poorMode-eMIFCAC_.js +1 -0
- package/dist/chunks/print-dUT7E1g9.js +13 -0
- package/dist/chunks/processBashCommand-DtGCgTkF.js +1 -0
- package/dist/chunks/processSlashCommand-wXblpK2C.js +5 -0
- package/dist/chunks/{projectContext-QN5U3Ggr.js → projectContext-BFfHgAMh.js} +1 -1
- package/dist/chunks/{projectContext-COeHKDrk.js → projectContext-DnJHynXv.js} +1 -1
- package/dist/chunks/{projectOnboardingState-KqcpRXls.js → projectOnboardingState-D-_ijZnG.js} +1 -1
- package/dist/chunks/prompt-BdH2zk0S.js +1 -0
- package/dist/chunks/{prompt-CTByhpUI.js → prompt-BnDapYGL.js} +8 -8
- package/dist/chunks/prompt-D0TFER0A.js +1 -0
- package/dist/chunks/promptEditor-14TB3MYt.js +4 -0
- package/dist/chunks/protocolHandler-CJO3CRYW.js +13 -0
- package/dist/chunks/{proxy-BtWuysHM.js → proxy--_NfbJhm.js} +1 -1
- package/dist/chunks/reconciler-C_HKsocm.js +1 -0
- package/dist/chunks/{refresh-B4pqFp12.js → refresh-Cm4jZzLa.js} +1 -1
- package/dist/chunks/reject-Tug1RmkE.js +1 -0
- package/dist/chunks/{reload-plugins-DXQqk7q6.js → reload-plugins-CL9LWzpq.js} +1 -1
- package/dist/chunks/{rename-D4XBmTBI.js → rename-OfKJSazJ.js} +1 -1
- package/dist/chunks/{renderOptions-DkP98P_d.js → renderOptions-B0RFpjRI.js} +1 -1
- package/dist/chunks/{resume-DzIev0JI.js → resume-BZ42SpS2.js} +1 -1
- package/dist/chunks/ripgrep-67m14ImZ.js +5 -0
- package/dist/chunks/ripgrep-DB7KB8RZ.js +1 -0
- package/dist/chunks/{runtimeObserver-BUHs3qjs.js → runtimeObserver-BLq2guVy.js} +1 -1
- package/dist/chunks/{runtimeObserver-BPqlbu0B.js → runtimeObserver-DT5P2_XL.js} +2 -2
- package/dist/chunks/sandbox-adapter-982rx2cm.js +1 -0
- package/dist/chunks/sandbox-toggle-DghmaJhK.js +1 -0
- package/dist/chunks/searchExtraTools-B4N1bpy0.js +1 -0
- package/dist/chunks/select-CaxQ-BVq.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-BqQ58T7e.js +1 -0
- package/dist/chunks/{sessionObserver-B6xzxckA.js → sessionObserver-DBoZUvWL.js} +1 -1
- package/dist/chunks/sessionObserver-qYpA90El.js +1 -0
- package/dist/chunks/sessionStorage-CC0v4zMs.js +1 -0
- package/dist/chunks/sessionTracing-5a7HDF4e.js +11 -0
- package/dist/chunks/settings-D4M13toi.js +104 -0
- package/dist/chunks/settings-Dfit5gGT.js +1 -0
- package/dist/chunks/setup-DVLnIlse.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-D6R2OeoH.js → shadowedRuleDetection-L3tnySui.js} +1 -1
- package/dist/chunks/{sideQuestion-5jcbOMsR.js → sideQuestion-BJTVma-5.js} +1 -1
- package/dist/chunks/sinks-C9NdbjLo.js +1 -0
- package/dist/chunks/{sinks-B-kFqjjd.js → sinks-CV0SWuZW.js} +1 -1
- package/dist/chunks/{skillChangeDetector-103-nEle.js → skillChangeDetector-DlodgOyC.js} +1 -1
- package/dist/chunks/{skillGapStore-DOz1KCqo.js → skillGapStore-Cposc03e.js} +2 -2
- package/dist/chunks/{skillLifecycle-D9NkIwFQ.js → skillLifecycle-RXQp0JU7.js} +2 -2
- package/dist/chunks/{skillSearchPanel-DFiSZaJ4.js → skillSearchPanel-B2pjskqk.js} +2 -2
- package/dist/chunks/skills-D2ZjMtv4.js +1 -0
- package/dist/chunks/sleep-xKMbXTJe.js +1 -0
- package/dist/chunks/{src-WZ94ZKI3.js → src-BX54x08P.js} +1 -1
- package/dist/chunks/{src-Cy5_qH26.js → src-HB5wLari.js} +1 -1
- package/dist/chunks/{startupProfiler-DIM_Ihyp.js → startupProfiler-B9Qv2QGH.js} +1 -1
- package/dist/chunks/startupProfiler-DWcM4QBl.js +1 -0
- package/dist/chunks/{staticRender-RHUIg5ln.js → staticRender-Bt82RvGc.js} +1 -1
- package/dist/chunks/status-BcSkj9nE.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-DI45AH-c.js → statusNoticeHelpers-DsrqBOQt.js} +1 -1
- package/dist/chunks/{stringUtils-D_xPrwGQ.js → stringUtils-Cs6E5f-B.js} +1 -1
- package/dist/chunks/switcher-BietN6il.js +1 -0
- package/dist/chunks/{switcher-DhZCaAun.js → switcher-rep86o4_.js} +1 -1
- package/dist/chunks/{tasks-6suPhqsK.js → tasks-B4coTfrq.js} +1 -1
- package/dist/chunks/{templateJobs-BKVEWCsb.js → templateJobs-C5ukh6H3.js} +7 -7
- package/dist/chunks/{terminalSetup-7PUR4hfo.js → terminalSetup-CaGbEVjB.js} +1 -1
- package/dist/chunks/{terminalSetup-Cqy5_PhJ.js → terminalSetup-xe_P98fY.js} +4 -4
- package/dist/chunks/{theme-B-HG2PUs.js → theme-7RmvErYJ.js} +1 -1
- package/dist/chunks/tipRegistry-BYpJZIjR.js +2 -0
- package/dist/chunks/{toolEventObserver-BY3QVnr6.js → toolEventObserver-Dzwzi5Vi.js} +1 -1
- package/dist/chunks/{toolPool-BcwIF8Q_.js → toolPool-BGfiNj6h.js} +1 -1
- package/dist/chunks/{udsClient-CCxgLiZy.js → udsClient-CWeoNrm3.js} +1 -1
- package/dist/chunks/{useDoublePress-DQBLKyzJ.js → useDoublePress-zA5QwIpO.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-BgJrnuDl.js → useExitOnCtrlCDWithKeybindings-BT0nexZw.js} +1 -1
- package/dist/chunks/useMainLoopModel-QuE7VkgX.js +1 -0
- package/dist/chunks/useManagePlugins-pGaGzsEg.js +1 -0
- package/dist/chunks/useMergedTools-BLsIT3R_.js +1 -0
- package/dist/chunks/{useSearchInput-BITV_Txn.js → useSearchInput-j12K4wEo.js} +1 -1
- package/dist/chunks/{useSettingsErrors-CO0fTNzn.js → useSettingsErrors-C8VIzdws.js} +1 -1
- package/dist/chunks/util-CCEK8oze.js +1 -0
- package/dist/chunks/validatePlugin-CTVnWx9H.js +1 -0
- package/dist/chunks/{vim-qgMS88ss.js → vim-BlO9V5_5.js} +1 -1
- package/dist/chunks/worktree-BWL0vR4o.js +1 -0
- package/dist/chunks/wrapper-B-Q3Illb.js +1 -0
- package/dist/chunks/{wrapper-K8ZapJVu.js → wrapper-DVKxC5fR.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +3 -2
- package/dist/chunks/AgentsMdExternalIncludesDialog-DuStmCjj.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-mcDuiNGs.js +0 -2
- package/dist/chunks/CustomSelect-CpMbxYbt.js +0 -1
- package/dist/chunks/Doctor-BU69VQzw.js +0 -1
- package/dist/chunks/KeybindingProviderSetup-CSUkJHTT.js +0 -1
- package/dist/chunks/MCPConnectionManager-Bn1PDn3R.js +0 -1
- package/dist/chunks/MCPToolListView-BRxjOaOL.js +0 -1
- package/dist/chunks/MessageSelector-B7xAQqZI.js +0 -3
- package/dist/chunks/Messages-CxMsfjOa.js +0 -10
- package/dist/chunks/Onboarding-CkATe87e.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-krq-hiFO.js +0 -1
- package/dist/chunks/QueryEngine-Mdi_kUaL.js +0 -1
- package/dist/chunks/REPL-BgzQtSFF.js +0 -1
- package/dist/chunks/REPL-rirm6s_7.js +0 -124
- package/dist/chunks/SearchExtraToolsTool-D1-7C04z.js +0 -1
- package/dist/chunks/SelectMulti-BpAjjhsn.js +0 -1
- package/dist/chunks/Settings-B6DImvca.js +0 -2
- package/dist/chunks/Spinner-DhhSOFcN.js +0 -1
- package/dist/chunks/SpinnerGlyph-CmVXC-_9.js +0 -1
- package/dist/chunks/TrustDialog-CZ8JpySm.js +0 -1
- package/dist/chunks/agents-HIOBiw4w.js +0 -101
- package/dist/chunks/allErrors-CxPNR2WN.js +0 -1
- package/dist/chunks/backgroundHousekeeping-ZCMPmQuU.js +0 -1
- package/dist/chunks/banner-DqFectPg.js +0 -2
- package/dist/chunks/branch-B_BL5N9N.js +0 -2
- package/dist/chunks/bundledMode-BxyD5cqq.js +0 -1
- package/dist/chunks/caches-5xZ4dSXt.js +0 -1
- package/dist/chunks/caches-Be9saXxV.js +0 -1
- package/dist/chunks/claudeDesktop-g8eUUY2E.js +0 -1
- package/dist/chunks/client-mnUISv_N.js +0 -1
- package/dist/chunks/client-wPqIdEVm.js +0 -1
- package/dist/chunks/commands-wfE12a4L.js +0 -1
- package/dist/chunks/config-D3K87Mm1.js +0 -3
- package/dist/chunks/config-DTga6Ku8.js +0 -1
- package/dist/chunks/config-DtmqWusU.js +0 -1
- package/dist/chunks/context-noninteractive-eIlneYiL.js +0 -1
- package/dist/chunks/conversation-CHesBfFZ.js +0 -1
- package/dist/chunks/conversationRecovery-OhitW-7g.js +0 -1
- package/dist/chunks/crossProjectResume-mmYx8PrZ.js +0 -40
- package/dist/chunks/detectRepository-M6K2wc7h.js +0 -1
- package/dist/chunks/directoryCompletion-BHyjyKAM.js +0 -1
- package/dist/chunks/doctor-DeBG5SL5.js +0 -1
- package/dist/chunks/entry-CbhyIWgj.js +0 -13
- package/dist/chunks/extractMemories-jnsv-_n_.js +0 -1
- package/dist/chunks/fast-4I_qPJCd.js +0 -1
- package/dist/chunks/fast-DiolM1M7.js +0 -1
- package/dist/chunks/fetchModelList-BRFTQim4.js +0 -1
- package/dist/chunks/fetchModelList-qPKAuu4m.js +0 -1
- package/dist/chunks/fileSuggestions-iWVXvvLB.js +0 -3
- package/dist/chunks/generateSessionName-CGaTTXCA.js +0 -1
- package/dist/chunks/hooks-Bg9WIjZQ.js +0 -1
- package/dist/chunks/install-ACGY0vhM.js +0 -1
- package/dist/chunks/loadAgentsDir-DqAbnpB-.js +0 -1
- package/dist/chunks/loader-6MqzNGmV.js +0 -1
- package/dist/chunks/localSearch-DW3JT2MA.js +0 -1
- package/dist/chunks/managedEnv-DCEJh3z3.js +0 -1
- package/dist/chunks/mcp-CJ6SDJEK.js +0 -6
- package/dist/chunks/memory-BQO6Y0ak.js +0 -1
- package/dist/chunks/model-D42epddJ.js +0 -1
- package/dist/chunks/modelOptions-beLgXORr.js +0 -1
- package/dist/chunks/nativeInstaller-ChGSz1lb.js +0 -1
- package/dist/chunks/parser-BZt0VFd_.js +0 -1
- package/dist/chunks/permissions-DkfWKN-B.js +0 -3
- package/dist/chunks/pidLock-YvAaIrIY.js +0 -3
- package/dist/chunks/platform-Vl9IynC3.js +0 -2
- package/dist/chunks/plugin-CTA2_-F7.js +0 -17
- package/dist/chunks/pluginAutoupdate-Dy5W3HWE.js +0 -1
- package/dist/chunks/pluginOperations-ClXNOOG6.js +0 -2
- package/dist/chunks/pluginStartupCheck-CiwMKGjx.js +0 -1
- package/dist/chunks/pluginStartupCheck-U8_xk25t.js +0 -1
- package/dist/chunks/poorMode-DtzWNhsY.js +0 -1
- package/dist/chunks/print-BzljdXem.js +0 -13
- package/dist/chunks/processBashCommand-RUkmyAl4.js +0 -1
- package/dist/chunks/processSlashCommand-DRLO-jNV.js +0 -5
- package/dist/chunks/prompt-DTpfW6yP.js +0 -1
- package/dist/chunks/prompt-D__eHY_5.js +0 -1
- package/dist/chunks/promptEditor-CpUFgGzc.js +0 -4
- package/dist/chunks/protocolHandler-BQSLVGnG.js +0 -13
- package/dist/chunks/reconciler-D6BUq8WB.js +0 -1
- package/dist/chunks/reject-C6IvUvBt.js +0 -1
- package/dist/chunks/ripgrep-CYP26Fhg.js +0 -1
- package/dist/chunks/ripgrep-D1f1pbCz.js +0 -5
- package/dist/chunks/sandbox-adapter-CumL75tU.js +0 -1
- package/dist/chunks/sandbox-toggle-CTtET6Xq.js +0 -1
- package/dist/chunks/searchExtraTools-BMCU2zEf.js +0 -1
- package/dist/chunks/select-FrwoTzuc.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-WO8WTdT9.js +0 -1
- package/dist/chunks/sessionObserver-CBrM4opL.js +0 -1
- package/dist/chunks/sessionStorage-C1EAxDWG.js +0 -1
- package/dist/chunks/sessionTracing-UFK96PxT.js +0 -11
- package/dist/chunks/settings-BK6gCko-.js +0 -1
- package/dist/chunks/settings-YIDksG5Z.js +0 -24
- package/dist/chunks/setup-BBvZyrfz.js +0 -3
- package/dist/chunks/sinks-DB_D4lmu.js +0 -1
- package/dist/chunks/skills-DgeLr52a.js +0 -1
- package/dist/chunks/sleep-BbWr_FL1.js +0 -1
- package/dist/chunks/startupProfiler-FpGsKWYk.js +0 -1
- package/dist/chunks/status-CKLecQZV.js +0 -1
- package/dist/chunks/switcher-D2Z2ZNQ0.js +0 -1
- package/dist/chunks/tipRegistry-BR_lSGRw.js +0 -2
- package/dist/chunks/types-CD25a50S.js +0 -81
- package/dist/chunks/use-select-navigation-CW5alA9r.js +0 -1
- package/dist/chunks/useMainLoopModel-BVgJo4hN.js +0 -1
- package/dist/chunks/useManagePlugins-CrWjzESW.js +0 -1
- package/dist/chunks/useMergedTools-r6GQq5mI.js +0 -1
- package/dist/chunks/util-_zo3I1y8.js +0 -1
- package/dist/chunks/validatePlugin-DFGdRhA-.js +0 -1
- package/dist/chunks/worktree-CR_M6Qfy.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bt as t,di as n,fi as r,j as i,t as a}from"./src-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bt as t,di as n,fi as r,j as i,t as a}from"./src-BX54x08P.js";import{Xt as o,_n as s,qt as c,vn as l,xn as u}from"./settings-D4M13toi.js";import{C as d,I as f,S as p,x as m,z as h}from"./debug-2pVES-2G.js";import{d as g,h as _,o as v}from"./config-Bio2EjUK.js";import{o as ee,s as y}from"./log-L1kqxa_P.js";import{i as b,t as x}from"./execFileNoThrow-DXSEj8ZO.js";import{i as S,o as C}from"./bundledMode-D9omqD3L.js";import{i as w,r as T}from"./projectOnboardingState-D-_ijZnG.js";import{a as E,i as D,n as O,r as k,t as A}from"./appleTerminalBackup-CN8kS74J.js";import{homedir as j,platform as M}from"os";import{dirname as te,join as N}from"path";import{randomBytes as P}from"crypto";import{copyFile as F,mkdir as I,readFile as L,writeFile as R}from"fs/promises";import{pathToFileURL as z}from"url";function B(){let e=process.env.VSCODE_GIT_ASKPASS_MAIN??``,t=process.env.PATH??``;return e.includes(`.vscode-server`)||e.includes(`.cursor-server`)||e.includes(`.windsurf-server`)||t.includes(`.vscode-server`)||t.includes(`.cursor-server`)||t.includes(`.windsurf-server`)}function V(){return!c.terminal||!(c.terminal in $)?null:$[c.terminal]??null}function H(e){return t()?`\x1b]8;;${z(e).href}\x07${e}\x1b]8;;\x07`:e}function U(){return M()===`darwin`&&c.terminal===`Apple_Terminal`||c.terminal===`vscode`||c.terminal===`cursor`||c.terminal===`windsurf`||c.terminal===`alacritty`||c.terminal===`zed`}async function W(e){let t=``;switch(c.terminal){case`Apple_Terminal`:t=await ne(e);break;case`vscode`:t=await Y(`VSCode`,e);break;case`cursor`:t=await Y(`Cursor`,e);break;case`windsurf`:t=await Y(`Windsurf`,e);break;case`alacritty`:t=await re(e);break;case`zed`:t=await ie(e);break;case null:break}return _(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(c.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:c.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),w(),t}function G(){return v().shiftEnterKeyBindingInstalled===!0}function K(){return v().hasUsedBackslashReturn===!0}function q(){v().hasUsedBackslashReturn||_(e=>({...e,hasUsedBackslashReturn:!0}))}async function J(e,t,r){if(c.terminal&&c.terminal in $)return e(`Shift+Enter is natively supported in ${$[c.terminal]}.
|
|
2
2
|
|
|
3
|
-
No configuration needed. Just use Shift+Enter to add newlines.`),null;if(!U()){let t=
|
|
3
|
+
No configuration needed. Just use Shift+Enter to add newlines.`),null;if(!U()){let t=c.terminal||`your current terminal`,r=S(),i=``;return r===`macos`?i=` • macOS: Apple Terminal
|
|
4
4
|
`:r===`windows`&&(i=` • Windows: Windows Terminal
|
|
5
5
|
`),e(`Terminal setup cannot be run from ${t}.
|
|
6
6
|
|
|
@@ -21,12 +21,12 @@ ${n.dim(`Note: iTerm2, WezTerm, Ghostty, Kitty, and Warp support Shift+Enter nat
|
|
|
21
21
|
"args": { "text": "\\u001b\\r" },
|
|
22
22
|
"when": "terminalFocus"
|
|
23
23
|
}
|
|
24
|
-
]`)}${Q}`;let r=e===`VSCode`?`Code`:e,a=N(j(),M()===`win32`?N(`AppData`,`Roaming`,r,`User`):M()===`darwin`?N(`Library`,`Application Support`,r,`User`):N(`.config`,r,`User`)),
|
|
24
|
+
]`)}${Q}`;let r=e===`VSCode`?`Code`:e,a=N(j(),M()===`win32`?N(`AppData`,`Roaming`,r,`User`):M()===`darwin`?N(`Library`,`Application Support`,r,`User`):N(`.config`,r,`User`)),o=N(a,`keybindings.json`);try{await I(a,{recursive:!0});let r=`[]`,c=[],l=!1;try{r=await L(o,{encoding:`utf-8`}),l=!0,c=u(r)??[]}catch(e){if(!h(e))throw e}if(l){let r=`${o}.${P(4).toString(`hex`)}.bak`;try{await F(o,r)}catch{return`${i(`warning`,t)(`Error backing up existing ${e} terminal keybindings. Bailing out.`)}${Q}${n.dim(`See ${H(o)}`)}${Q}${n.dim(`Backup path: ${H(r)}`)}${Q}`}}return c.find(e=>e.key===`shift+enter`&&e.command===`workbench.action.terminal.sendSequence`&&e.when===`terminalFocus`)?`${i(`warning`,t)(`Found existing ${e} terminal Shift+Enter key binding. Remove it to continue.`)}${Q}${n.dim(`See ${H(o)}`)}${Q}`:(await R(o,s(r,{key:`shift+enter`,command:`workbench.action.terminal.sendSequence`,args:{text:`\x1B\r`},when:`terminalFocus`}),{encoding:`utf-8`}),`${i(`success`,t)(`Installed ${e} terminal Shift+Enter key binding`)}${Q}${n.dim(`See ${H(o)}`)}${Q}`)}catch(t){throw y(t),Error(`Failed to install ${e} terminal Shift+Enter key binding`)}}async function X(e){let{code:t}=await x(`/usr/libexec/PlistBuddy`,[`-c`,`Add :'Window Settings':'${e}':useOptionAsMetaKey bool true`,k()]);if(t!==0){let{code:t}=await x(`/usr/libexec/PlistBuddy`,[`-c`,`Set :'Window Settings':'${e}':useOptionAsMetaKey true`,k()]);if(t!==0)return y(Error(`Failed to enable Option as Meta key for Terminal.app profile: ${e}`)),!1}return!0}async function Z(e){let{code:t}=await x(`/usr/libexec/PlistBuddy`,[`-c`,`Add :'Window Settings':'${e}':Bell bool false`,k()]);if(t!==0){let{code:t}=await x(`/usr/libexec/PlistBuddy`,[`-c`,`Set :'Window Settings':'${e}':Bell false`,k()]);if(t!==0)return y(Error(`Failed to disable audio bell for Terminal.app profile: ${e}`)),!1}return!0}async function ne(e){try{if(!await A())throw Error(`Failed to create backup of Terminal.app preferences, bailing out`);let{stdout:t,code:r}=await x(`defaults`,[`read`,`com.apple.Terminal`,`Default Window Settings`]);if(r!==0||!t.trim())throw Error(`Failed to read default Terminal.app profile`);let{stdout:a,code:o}=await x(`defaults`,[`read`,`com.apple.Terminal`,`Startup Window Settings`]);if(o!==0||!a.trim())throw Error(`Failed to read startup Terminal.app profile`);let s=!1,c=t.trim(),l=await X(c),u=await Z(c);(l||u)&&(s=!0);let d=a.trim();if(d!==c){let e=await X(d),t=await Z(d);(e||t)&&(s=!0)}if(!s)throw Error(`Failed to enable Option as Meta key or disable audio bell for any Terminal.app profile`);return await x(`killall`,[`cfprefsd`]),E(),`${i(`success`,e)(`Configured Terminal.app settings:`)}${Q}${i(`success`,e)(`- Enabled "Use Option as Meta key"`)}${Q}${i(`success`,e)(`- Switched to visual bell`)}${Q}${n.dim(`Option+Enter will now enter a newline.`)}${Q}${n.dim(`You must restart Terminal.app for changes to take effect.`,e)}${Q}`}catch(e){y(e);let t=await O(),n=`Failed to enable Option as Meta key for Terminal.app.`;throw t.status===`restored`?Error(`${n} Your settings have been restored from backup.`):t.status===`failed`?Error(`${n} Restoring from backup failed, try manually with: defaults import com.apple.Terminal ${t.backupPath}`):Error(`${n} No backup was available to restore from.`)}}async function re(e){let t=[],r=process.env.XDG_CONFIG_HOME;if(r?t.push(N(r,`alacritty`,`alacritty.toml`)):t.push(N(j(),`.config`,`alacritty`,`alacritty.toml`)),M()===`win32`){let e=process.env.APPDATA;e&&t.push(N(e,`alacritty`,`alacritty.toml`))}let a=null,o=``,s=!1;for(let e of t)try{o=await L(e,{encoding:`utf-8`}),a=e,s=!0;break}catch(e){if(!h(e))throw e}if(a||(a=t[0]??null),!a)throw Error(`No valid config path found for Alacritty`);try{if(s){if(o.includes(`mods = "Shift"`)&&o.includes(`key = "Return"`))return`${i(`warning`,e)(`Found existing Alacritty Shift+Enter key binding. Remove it to continue.`)}${Q}${n.dim(`See ${H(a)}`)}${Q}`;let t=P(4).toString(`hex`),r=`${a}.${t}.bak`;try{await F(a,r)}catch{return`${i(`warning`,e)(`Error backing up existing Alacritty config. Bailing out.`)}${Q}${n.dim(`See ${H(a)}`)}${Q}${n.dim(`Backup path: ${H(r)}`)}${Q}`}}else await I(te(a),{recursive:!0});let t=o;return o&&!o.endsWith(`
|
|
25
25
|
`)&&(t+=`
|
|
26
26
|
`),t+=`
|
|
27
27
|
[[keyboard.bindings]]
|
|
28
28
|
key = "Return"
|
|
29
29
|
mods = "Shift"
|
|
30
30
|
chars = "\\u001B\\r"
|
|
31
|
-
`,await R(a,t,{encoding:`utf-8`}),`${i(`success`,e)(`Installed Alacritty Shift+Enter key binding`)}${Q}${i(`success`,e)(`You may need to restart Alacritty for changes to take effect`)}${Q}${n.dim(`See ${H(a)}`)}${Q}`}catch(e){throw
|
|
31
|
+
`,await R(a,t,{encoding:`utf-8`}),`${i(`success`,e)(`Installed Alacritty Shift+Enter key binding`)}${Q}${i(`success`,e)(`You may need to restart Alacritty for changes to take effect`)}${Q}${n.dim(`See ${H(a)}`)}${Q}`}catch(e){throw y(e),Error(`Failed to install Alacritty Shift+Enter key binding`)}}async function ie(e){let t=N(j(),`.config`,`zed`),r=N(t,`keymap.json`);try{await I(t,{recursive:!0});let a=`[]`,o=!1;try{a=await L(r,{encoding:`utf-8`}),o=!0}catch(e){if(!h(e))throw e}if(o){if(a.includes(`shift-enter`))return`${i(`warning`,e)(`Found existing Zed Shift+Enter key binding. Remove it to continue.`)}${Q}${n.dim(`See ${H(r)}`)}${Q}`;let t=`${r}.${P(4).toString(`hex`)}.bak`;try{await F(r,t)}catch{return`${i(`warning`,e)(`Error backing up existing Zed keymap. Bailing out.`)}${Q}${n.dim(`See ${H(r)}`)}${Q}${n.dim(`Backup path: ${H(t)}`)}${Q}`}}let s;try{s=p(a),Array.isArray(s)||(s=[])}catch{s=[]}return s.push({context:`Terminal`,bindings:{"shift-enter":[`terminal::SendText`,`\x1B\r`]}}),await R(r,`${d(s,null,2)}\n`,{encoding:`utf-8`}),`${i(`success`,e)(`Installed Zed Shift+Enter key binding`)}${Q}${n.dim(`See ${H(r)}`)}${Q}`}catch(e){throw y(e),Error(`Failed to install Zed Shift+Enter key binding`)}}var Q,$,ae=e((()=>{r(),a(),T(),D(),g(),o(),f(),b(),l(),ee(),C(),m(),Q=`
|
|
32
32
|
`,$={ghostty:`Ghostty`,kitty:`Kitty`,"iTerm.app":`iTerm2`,WezTerm:`WezTerm`,WarpTerminal:`Warp`}}));export{G as a,U as c,ae as i,V as n,q as o,K as r,W as s,J as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,t as n,x as r}from"./src-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,t as n,x as r}from"./src-BX54x08P.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{n as a,t as o}from"./ThemePicker-CVFWqSc7.js";function s({onDone:e}){let[,n]=t();return(0,c.jsx)(r,{color:`permission`,children:(0,c.jsx)(o,{onThemeSelect:t=>{n(t),e(`Theme set to ${t}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var c,l;e((()=>{n(),a(),c=i(),l=async(e,t)=>(0,c.jsx)(s,{onDone:e})}))();export{l as call};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,t}from"./memoize-BK3gG5ob.js";import{l as n,o as r}from"./envUtils-QyzA_cFM.js";import{di as i,fi as a,j as o,t as s}from"./src-BX54x08P.js";import{Gr as c,Jt as l,Kr as u,Ur as d,Xt as f,d as p,m,qr as h,qt as g,t as _}from"./settings-D4M13toi.js";import{Pt as v,at as y}from"./state-CXY-q5gr.js";import{$a as b,$h as x,Gv as S,Hv as C,Ya as w,_x as T,ab as E,ag as ee,fo as te,gr as ne,mC as D,ob as O,pC as k,uo as A,vr as j,yx as M}from"./loadAgentsDir-bmpKLPdG.js";import{n as N,t as P}from"./cwd-DrEEb4f5.js";import{c as F,i as I}from"./debug-2pVES-2G.js";import{a as L,d as R,h as z,l as B,m as V,o as H}from"./config-Bio2EjUK.js";import{r as U,t as W}from"./execa-CBhG1doD.js";import{o as G,s as K}from"./log-L1kqxa_P.js";import{i as q,n as J}from"./execFileNoThrow-DXSEj8ZO.js";import{i as Y,o as re}from"./bundledMode-D9omqD3L.js";import{Mt as X,Pt as ie}from"./model-Dd3x121y.js";import{c as ae,i as oe}from"./terminalSetup-xe_P98fY.js";I(),G(),q(),h(),k(),U(),t(),v(),R(),N(),f(),r();async function se(){}e(e=>({deviceId:B(),sessionId:y(),email:void 0,appVersion:`0.0.28`,platform:l(),userType:process.env.USER_TYPE,...n(process.env.GITHUB_ACTIONS)&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}));var ce=e(async()=>{let e=await W(`git config --get user.email`,{shell:!0,reject:!1,cwd:P()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0});t(),N(),R(),f();var le=[/(?:^|\/)(?:package-lock\.json|yarn\.lock|bun\.lock|bun\.lockb|pnpm-lock\.yaml|Pipfile\.lock|poetry\.lock|Cargo\.lock|Gemfile\.lock|go\.sum|composer\.lock|uv\.lock)$/,/\.generated\./,/(?:^|\/)(?:dist|build|out|target|node_modules|\.next|__pycache__)\//,/\.(?:min\.js|min\.css|map|pyc|pyo)$/,/\.(?:json|ya?ml|toml|xml|ini|cfg|conf|env|lock|txt|md|mdx|rst|csv|log|svg)$/i,/(?:^|\/)\.?(?:eslintrc|prettierrc|babelrc|editorconfig|gitignore|gitattributes|dockerignore|npmrc)/,/(?:^|\/)(?:tsconfig|jsconfig|biome|vitest\.config|jest\.config|webpack\.config|vite\.config|rollup\.config)\.[a-z]+$/,/(?:^|\/)\.(?:github|vscode|idea|claude)\//,/(?:^|\/)(?:CHANGELOG|LICENSE|CONTRIBUTING|CODEOWNERS|README)(?:\.[a-z]+)?$/i];function ue(e){return!le.some(t=>t.test(e))}function de(e,t){let n=[],r=new Set,i=new Map;for(let a=1;n.length<t&&a<=t;a++)for(let o of e){if(n.length>=t)break;if(!ue(o))continue;let e=Math.max(o.lastIndexOf(`/`),o.lastIndexOf(`\\`)),s=e>=0?o.slice(e+1):o;if(!s||r.has(s))continue;let c=e>=0?o.slice(0,e):`.`;(i.get(c)??0)>=a||(n.push(s),r.add(s),i.set(c,(i.get(c)??0)+1))}return n.length>=t?n:[]}async function fe(){if(g.platform===`win32`||!await d())return[];try{let e=await ce(),t=[`log`,`-n`,`1000`,`--pretty=format:`,`--name-only`,`--diff-filter=M`],n=new Map,r=e=>{for(let t of e.split(`
|
|
2
|
+
`)){let e=t.trim();e&&n.set(e,(n.get(e)??0)+1)}};if(e){let{stdout:n}=await J(`git`,[...t,`--author=${e}`],{cwd:P()});r(n)}if(n.size<10){let{stdout:e}=await J(u(),t,{cwd:P()});r(e)}return de(Array.from(n.entries()).sort((e,t)=>t[1]-e[1]).map(([e])=>e),5)}catch(e){return K(e),[]}}var pe=10080*60*1e3,me=e(()=>{let e=L(),t=e.exampleFiles?.length?D(e.exampleFiles):`<filepath>`;return`Try "${D([`fix lint errors`,`fix typecheck errors`,`how does ${t} work?`,`refactor ${t}`,`how do I log an error?`,`edit ${t} to...`,`write a test for ${t}`,`create a util logging.py that...`])}"`}),he=e(async()=>{let e=L();Date.now()-(e.exampleFilesGeneratedAt??0)>pe&&(e.exampleFiles=[]),e.exampleFiles?.length||fe().then(e=>{e.length&&V(t=>({...t,exampleFiles:e,exampleFilesGeneratedAt:Date.now()}))})});ie();var ge={"claude-3-opus":{modelName:`Work Mate 3 Opus`,retirementDates:{firstParty:`January 5, 2026`,bedrock:`January 15, 2026`,vertex:`January 5, 2026`,foundry:`January 5, 2026`}},"claude-3-7-sonnet":{modelName:`Work Mate 3.7 Sonnet`,retirementDates:{firstParty:`February 19, 2026`,bedrock:`April 28, 2026`,vertex:`May 11, 2026`,foundry:`February 19, 2026`}},"claude-3-5-haiku":{modelName:`Work Mate 3.5 Haiku`,retirementDates:{firstParty:`February 19, 2026`,bedrock:null,vertex:null,foundry:null}}};function _e(e){let t=e.toLowerCase(),n=X();for(let[e,r]of Object.entries(ge)){let i=r.retirementDates[n];if(!(!t.includes(e)||!i))return{isDeprecated:!0,modelName:r.modelName,retirementDate:i}}return{isDeprecated:!1}}function ve(e){if(!e)return null;let t=_e(e);return t.isDeprecated?`⚠ ${t.modelName} will be retired on ${t.retirementDate}. Consider switching to a newer model.`:null}a(),s(),re(),m(),M(),O(),S(),ee(),A(),w(),ne(),oe(),R();function ye(e){let t=H().numStartups;z(n=>{let r=n.tipsHistory??{};return r[e]===t?n:{...n,tipsHistory:{...r,[e]:t}}})}function Z(e){let t=H(),n=t.tipsHistory?.[e];return n?t.numStartups-n:1/0}R(),f(),h();var Q;async function be(){return Q===void 0&&(Q=T in await te()),Q}async function $(e,t,n){if(!await be()||b(`${e}@claude-plugins-official`))return!1;let{bashTools:r}=t??{};return!!(n.cli&&r?.size&&n.cli.some(e=>r.has(e))||n.filePath&&t?.readFileState&&C(t.readFileState).some(e=>n.filePath.test(e)))}var xe=[{id:`new-user-warmup`,content:async()=>`Start with small features or bug fixes, tell Work Mate to propose a plan, and verify its suggested edits`,cooldownSessions:3,async isRelevant(){return H().numStartups<10}},{id:`plan-mode-for-complex-tasks`,content:async()=>`Use Plan Mode to prepare for a complex request before making changes. Press ${E(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to enable.`,cooldownSessions:5,isRelevant:async()=>{let e=H();return(e.lastPlanModeUse?(Date.now()-e.lastPlanModeUse)/(1e3*60*60*24):1/0)>7}},{id:`default-permission-mode-config`,content:async()=>`Use /config to change your default permission mode (including Plan Mode)`,cooldownSessions:10,isRelevant:async()=>{try{let e=H(),t=p(),n=!!e.lastPlanModeUse,r=!!t?.permissions?.defaultMode;return n&&!r}catch(e){return F(`Failed to check default-permission-mode-config tip relevance: ${e}`,{level:`warn`}),!1}}},{id:`git-worktrees`,content:async()=>`Use git worktrees to run multiple Work Mate sessions in parallel.`,cooldownSessions:10,isRelevant:async()=>{try{let e=H();return await c()<=1&&e.numStartups>50}catch{return!1}}},{id:`terminal-setup`,content:async()=>g.terminal===`Apple_Terminal`?`Run /terminal-setup to enable convenient terminal integration like Option + Enter for new line and more`:`Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more`,cooldownSessions:10,async isRelevant(){let e=H();return g.terminal===`Apple_Terminal`?!e.optionAsMetaKeyInstalled:!e.shiftEnterKeyBindingInstalled}},{id:`shift-enter`,content:async()=>g.terminal===`Apple_Terminal`?`Press Option+Enter to send a multi-line message`:`Press Shift+Enter to send a multi-line message`,cooldownSessions:10,async isRelevant(){let e=H();return!!((g.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)&&e.numStartups>3)}},{id:`shift-enter-setup`,content:async()=>g.terminal===`Apple_Terminal`?`Run /terminal-setup to enable Option+Enter for new lines`:`Run /terminal-setup to enable Shift+Enter for new lines`,cooldownSessions:10,async isRelevant(){if(!ae())return!1;let e=H();return!(g.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)}},{id:`memory-command`,content:async()=>`Use /memory to view and manage Work Mate memory`,cooldownSessions:15,async isRelevant(){return H().memoryUsageCount<=0}},{id:`theme-command`,content:async()=>`Use /theme to change the color theme`,cooldownSessions:20,isRelevant:async()=>!0},{id:`colorterm-truecolor`,content:async()=>`Try setting environment variable COLORTERM=truecolor for richer colors`,cooldownSessions:30,isRelevant:async()=>!process.env.COLORTERM&&i.level<3},{id:`powershell-tool-env`,content:async()=>`Set WORKMATE_USE_POWERSHELL_TOOL=1 to enable the PowerShell tool (preview)`,cooldownSessions:10,isRelevant:async()=>Y()===`windows`&&process.env.WORKMATE_USE_POWERSHELL_TOOL===void 0},{id:`status-line`,content:async()=>`Use /statusline to set up a custom status line that will display beneath the input box`,cooldownSessions:25,isRelevant:async()=>p().statusLine===void 0},{id:`prompt-queue`,content:async()=>`Hit Enter to queue up additional messages while Work Mate is working.`,cooldownSessions:5,async isRelevant(){return H().promptQueueUseCount<=3}},{id:`enter-to-steer-in-relatime`,content:async()=>`Send messages to Work Mate while it works to steer Work Mate in real-time`,cooldownSessions:20,isRelevant:async()=>!0},{id:`todo-list`,content:async()=>`Ask Work Mate to create a todo list when working on complex tasks to track progress and remain on track`,cooldownSessions:20,isRelevant:async()=>!0},{id:`permissions`,content:async()=>`Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools`,cooldownSessions:10,async isRelevant(){return H().numStartups>10}},{id:`drag-and-drop-images`,content:async()=>`Did you know you can drag and drop image files into your terminal?`,cooldownSessions:10,isRelevant:async()=>!g.isSSH()},{id:`paste-images-mac`,content:async()=>`Paste images into Work Mate using control+v (not cmd+v!)`,cooldownSessions:10,isRelevant:async()=>Y()===`macos`},{id:`double-esc`,content:async()=>`Double-tap esc to rewind the conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>!x()},{id:`double-esc-code-restore`,content:async()=>`Double-tap esc to rewind the code and/or conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>x()},{id:`continue`,content:async()=>`Run claude --continue or claude --resume to resume a conversation`,cooldownSessions:10,isRelevant:async()=>!0},{id:`rename-conversation`,content:async()=>`Name your conversations with /rename to find them easily in /resume later`,cooldownSessions:15,isRelevant:async()=>j()&&H().numStartups>10},{id:`custom-commands`,content:async()=>`Create skills by adding .md files to .workmate/skills/ in your project or ~/.workmate/skills/ for skills that work in any project`,cooldownSessions:15,async isRelevant(){return H().numStartups>10}},{id:`shift-tab`,content:async()=>`Hit ${E(`chat:cycleMode`,`Chat`,`shift+tab`)} to cycle between default, accept edits, plan, auto, and bypass modes`,cooldownSessions:10,isRelevant:async()=>!0},{id:`image-paste`,content:async()=>`Use ${E(`chat:imagePaste`,`Chat`,`ctrl+v`)} to paste images from your clipboard`,cooldownSessions:20,isRelevant:async()=>!0},{id:`custom-agents`,content:async()=>`Use /agents to optimize specific tasks. Eg. Software Architect, Code Writer, Code Reviewer`,cooldownSessions:15,async isRelevant(){return H().numStartups>5}},{id:`agent-flag`,content:async()=>`Use --agent <agent_name> to directly start a conversation with a subagent`,cooldownSessions:15,async isRelevant(){return H().numStartups>5}},{id:`frontend-design-plugin`,content:async e=>`Working with HTML/CSS? Install the frontend-design plugin:\n${o(`suggestion`,e?.theme??`dark`)(`/plugin install frontend-design@${T}`)}`,cooldownSessions:3,isRelevant:async e=>$(`frontend-design`,e,{filePath:/\.(html|css|htm)$/i})},{id:`vercel-plugin`,content:async e=>`Working with Vercel? Install the vercel plugin:\n${o(`suggestion`,e?.theme??`dark`)(`/plugin install vercel@${T}`)}`,cooldownSessions:3,isRelevant:async e=>$(`vercel`,e,{filePath:/(?:^|[/\\])vercel\.json$/i,cli:[`vercel`]})},{id:`subagent-fanout-nudge`,content:async e=>`Say ${o(`suggestion`,e?.theme??`dark`)(`"fan out subagents"`)} and Work Mate sends a team. Each one digs deep so nothing gets missed.`,cooldownSessions:3,isRelevant:async()=>!1}],Se=[];function Ce(){let e=_().spinnerTipsOverride;return e?.tips?.length?e.tips.map((e,t)=>({id:`custom-tip-${t}`,content:async()=>e,cooldownSessions:0,isRelevant:async()=>!0})):[]}async function we(e){let t=_().spinnerTipsOverride,n=Ce();if(t?.excludeDefault&&n.length>0)return n;let r=[...xe,...Se],i=await Promise.all(r.map(t=>t.isRelevant?.(e)??Promise.resolve(!0)));return[...r.filter((e,t)=>i[t]).filter(e=>Z(e.id)>=e.cooldownSessions),...n]}export{me as a,ve as i,Z as n,he as o,ye as r,se as s,we as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n}from"./debug-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n}from"./debug-2pVES-2G.js";import{o as r,s as i}from"./log-L1kqxa_P.js";import{r as a,t as o}from"./observationStore-pnSSxec_.js";import{randomUUID as s}from"node:crypto";function c(){for(let[e,t]of T)if(t.size>x){let e=t.values(),n=t.size-S;for(let r=0;r<n;r++){let n=e.next();if(n.done)break;t.delete(n.value)}}if(T.size>C){let e=T.size-w,t=0;for(let n of T.keys()){if(t>=e)break;T.delete(n),t++}}}function l(e,t){let n=T.get(e)??new Set;n.add(t),T.delete(e),T.set(e,n),c()}function u(e,t){return T.get(e)?.has(t)??!1}function d(){T.clear()}function f(e){return{id:s(),sessionId:e.sessionId,projectId:e.projectId,projectName:e.projectName,cwd:e.cwd,timestamp:new Date().toISOString(),source:`tool-hook`,turn:e.turn}}function p(){return E||(E=Promise.all([import(`./projectContext-DnJHynXv.js`),import(`./featureCheck-JOur3pHb.js`),import(`./runtimeObserver-BLq2guVy.js`)]).then(([e,t,n])=>({resolveProjectContext:e.resolveProjectContext,isSkillLearningEnabled:t.isSkillLearningEnabled,RUNTIME_SESSION_ID:n.RUNTIME_SESSION_ID,getRuntimeTurn:n.getRuntimeTurn}))),E}function m(){E=void 0}async function h(e,n,r,a){let o;try{let{resolveProjectContext:s,isSkillLearningEnabled:c,RUNTIME_SESSION_ID:l,getRuntimeTurn:u}=await p();if(!c())return a();let d=s(process.cwd());o={sessionId:r.sessionId??l,turn:r.turn??u(),projectId:d.projectId,projectName:d.projectName,cwd:d.cwd,project:d},g(o,e,n).catch(e=>{t(`skill-learning: recordToolStart error`),i(e)})}catch(e){t(`skill-learning: hook setup error`),i(e)}try{let n=await a();return o&&_(o,e,n,`success`).catch(e=>{t(`skill-learning: recordToolComplete error`),i(e)}),n}catch(n){throw o&&v(o,e,n).catch(e=>{t(`skill-learning: recordToolError error`),i(e)}),n}}async function g(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_start`,toolName:t,toolInput:b(n)},{project:e.project})}async function _(e,t,n,r=`success`){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:r},{project:e.project})}async function v(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:`failure`},{project:e.project})}async function y(e,t){return l(e.sessionId,e.turn),o({...f(e),event:`user_message`,messageText:t},{project:e.project})}function b(e){if(e!=null){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}}var x,S,C,w,T,E;e((()=>{a(),n(),r(),x=500,S=250,C=50,w=25,T=new Map}))();export{u as hasToolHookObservationsForTurn,c as pruneEmittedTurns,_ as recordToolComplete,v as recordToolError,g as recordToolStart,y as recordUserCorrection,d as resetToolHookBookkeeping,m as resetToolHookDepsCache,h as runToolCallWithSkillLearningHooks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$d as t,dC as n,ef as r,fC as i}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$d as t,dC as n,ef as r,fC as i}from"./loadAgentsDir-bmpKLPdG.js";import{n as a,t as o}from"./partition-CKgWl7p4.js";function s(e,t,n){let[o,s]=a(i([...e,...t],`name`),r),c=(e,t)=>e.name.localeCompare(t.name);return[...s.sort(c),...o.sort(c)]}var c=e((()=>{o(),n(),t()}));export{s as n,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,o as t}from"./envUtils-
|
|
1
|
+
import{i as e,o as t}from"./envUtils-QyzA_cFM.js";import{I as n,M as r,S as i,c as a,i as o,x as s,z as c}from"./debug-2pVES-2G.js";import{o as l}from"./log-L1kqxa_P.js";import{i as u,r as d}from"./genericProcessUtils-GqURdVAv.js";import"os";import{join as f}from"path";import"crypto";import{readFile as p,readdir as m}from"fs/promises";import"node:string_decoder";t(),o(),d(),n(),s(),n(),l(),s(),t(),o(),n(),s();function h(){return f(e(),`sessions`)}async function g(){let e=h(),t;try{t=await m(e)}catch(e){return c(e)||a(`[udsClient] readdir failed: ${r(e)}`),[]}let n=[];for(let r of t){if(!/^\d+\.json$/.test(r))continue;let t=parseInt(r.slice(0,-5),10);if(u(t))try{let a=i(await p(f(e,r),`utf8`));n.push({pid:t,sessionId:a.sessionId,cwd:a.cwd,startedAt:a.startedAt,kind:a.kind,name:a.name,messagingSocketPath:a.messagingSocketPath,entrypoint:a.entrypoint,bridgeSessionId:a.bridgeSessionId,alive:!0})}catch{}}return n}export{g as listAllLiveSessions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./src-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./src-BX54x08P.js";var n=e((()=>{t()}));export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,ai as r,et as i,t as a,vt as o}from"./src-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,ai as r,et as i,t as a,vt as o}from"./src-BX54x08P.js";import{tb as s}from"./loadAgentsDir-bmpKLPdG.js";import{t as c}from"./useDoublePress-zA5QwIpO.js";function l(e,t,n,r=!0){let{exit:a}=o(),[s,c]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>n??a,[n,a]),d=i(e=>c({pending:e,keyName:`Ctrl-C`}),l),f=i(e=>c({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:r}),s}var u,d=e((()=>{u=t(r(),1),a(),c()}));function f(e,t,r){return l(n,t,e,r)}var p=e((()=>{s(),d()}));export{f as n,p as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bh as t,zh as n}from"./loadAgentsDir-bmpKLPdG.js";import{f as r,i,v as a}from"./model-Dd3x121y.js";function o(){let e=t(e=>e.mainLoopModel);return a(t(e=>e.mainLoopModelForSession)??e??i())}var s=e((()=>{n(),r()}));export{o as n,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-BX54x08P.js";import{$n as n,Qn as r,di as i,ui as a}from"./settings-D4M13toi.js";import{Bh as o,Fa as s,Go as c,Hh as l,Hm as u,Km as d,Ko as f,Pa as p,Wm as m,Xo as h,Zo as g,_f as _,c_ as v,qm as y,s_ as b,vf as x,zh as S}from"./loadAgentsDir-bmpKLPdG.js";import{I as C,V as w,c as T,i as E}from"./debug-2pVES-2G.js";import{o as D,s as O}from"./log-L1kqxa_P.js";import{n as k}from"./analytics-COpjZpvd.js";import{n as A,t as j}from"./notifications-BwS1XsnZ.js";import{n as M,r as N}from"./pluginFlagging-B2ZX5_oB.js";import{t as P}from"./pluginBlocklist-ByRQaVPu.js";var F=e(t(),1);j(),k(),u(),S(),n(),E(),a(),C(),D(),h(),f(),b(),d(),_(),N(),p();function I({enabled:e=!0}={}){let t=l(),n=o(e=>e.plugins.needsRefresh),{addNotification:a}=A(),u=(0,F.useCallback)(async()=>{try{let{enabled:e,disabled:n,errors:i}=await s();await P();let o=M();Object.keys(o).length>0&&a({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let l=[],u=[];try{l=await c()}catch(e){let t=e instanceof Error?e.message:String(e);i.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{u=await g()}catch(e){let t=e instanceof Error?e.message:String(e);i.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await v()}catch(e){let t=e instanceof Error?e.message:String(e);i.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let d=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await x(e,i);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),f=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await y(e,i);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);m(),t(t=>{let r=t.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),a=new Set(i.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),o=[...r.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!a.has(t)}),...i];return{...t,plugins:{...t.plugins,enabled:e,disabled:n,commands:l,errors:o}}}),T(`Loaded plugins - Enabled: ${e.length}, Disabled: ${n.length}, Commands: ${l.length}, Agents: ${u.length}, Errors: ${i.length}`);let p=e.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return{enabled_count:e.length,disabled_count:n.length,inline_count:r(e,e=>e.source.endsWith(`@inline`)),marketplace_count:r(e,e=>!e.source.endsWith(`@inline`)),error_count:i.length,skill_count:l.length,agent_count:u.length,hook_count:p,mcp_count:d,lsp_count:f}}catch(e){let n=w(e);return O(n),T(`Error loading plugins: ${e}`),t(e=>{let t=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:n.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...t,r]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[t,a]);(0,F.useEffect)(()=>{e&&u().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.WORKMATE_PLUGIN_CACHE_DIR};({...r,...t!==void 0&&{enabled_names:t}}),i(`info`,`tengu_plugins_loaded`,r)})},[u,e]),(0,F.useEffect)(()=>{!e||!n||a({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,n,a])}export{I as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as n}from"./src-BX54x08P.js";import{Cc as r,Dc as i}from"./loadAgentsDir-bmpKLPdG.js";import{n as a,t as o}from"./toolPool-BGfiNj6h.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,r(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(n(),1),i(),o()}));export{s as n,l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Vn as n,ai as r,hn as i,ot as a,t as o}from"./src-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Vn as n,ai as r,hn as i,ot as a,t as o}from"./src-BX54x08P.js";import{sb as s}from"./loadAgentsDir-bmpKLPdG.js";import{_ as c,b as l,d as u,g as d,h as f,l as p,u as m,v as h,y as g}from"./TextInput-ou7ZhpVY.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:r,onExitUp:o,columns:s,passthroughCtrlKeys:u=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=a(),w=s??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=n=>{if(!e)return;let i=p.fromText(T,w,D);if(!(n.ctrl&&u.includes(n.key.toLowerCase()))){if(_(n)||c(),v(n)||h(),n.key===`return`||n.key===`down`){n.preventDefault(),t();return}if(n.key===`up`){n.preventDefault(),o&&o();return}if(n.key===`escape`){n.preventDefault(),r?r():T.length>0?(E(``),O(0)):t();return}if(n.key===`backspace`){if(n.preventDefault(),n.meta){let{cursor:e,killed:t}=i.deleteWordBefore();f(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}if(n.key===`delete`){n.preventDefault();let e=i.del();E(e.text),O(e.offset);return}if(n.key===`left`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.prevWord();O(e.offset);return}if(n.key===`right`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.nextWord();O(e.offset);return}if(n.key===`left`){n.preventDefault();let e=i.left();O(e.offset);return}if(n.key===`right`){n.preventDefault();let e=i.right();O(e.offset);return}if(n.key===`home`){n.preventDefault(),O(0);return}if(n.key===`end`){n.preventDefault(),O(T.length);return}if(n.ctrl){switch(n.preventDefault(),n.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(i.left().offset);return;case`f`:O(i.right().offset);return;case`d`:{if(T.length===0){(r??t)();return}let e=i.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=i.deleteToLineEnd();f(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=i.deleteToLineStart();f(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=i.deleteWordBefore();f(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=m();if(e.length>0){let t=i.offset,n=i.insert(e);d(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(r){r();return}}return}if(n.meta){switch(n.preventDefault(),n.key.toLowerCase()){case`b`:O(i.prevWord().offset);return;case`f`:O(i.nextWord().offset);return;case`d`:{let e=i.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=l();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;g(t.length),E(o),O(s)}return}}return}if(n.key!==`tab`&&n.key.length>=1&&!x.has(n.key)){n.preventDefault();let e=i.insert(n.key);E(e.text),O(e.offset)}}};return i((e,t,r)=>{A(new n(r.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(r(),1),o(),u(),s(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as n}from"./src-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as n}from"./src-BX54x08P.js";import{Gh as r,Kh as i}from"./loadAgentsDir-bmpKLPdG.js";import{n as a,t as o}from"./notifications-BwS1XsnZ.js";import{n as s,t as c}from"./allErrors-Dhnf6rqg.js";function l(){let{addNotification:e,removeNotification:t}=a(),[n,r]=(0,u.useState)(()=>{let{errors:e}=c();return e});return i((0,u.useCallback)(()=>{let{errors:e}=c();r(e)},[])),(0,u.useEffect)(()=>{if(n.length>0){let t=`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`;e({key:d,text:t,color:`warning`,priority:`high`,timeoutMs:6e4})}else t(d)},[n,e,t]),n}var u,d,f=e((()=>{u=t(n(),1),o(),s(),r(),d=`settings-errors`}));export{l as n,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-BX54x08P.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{Lh as r,zh as i}from"./loadAgentsDir-bmpKLPdG.js";import{n as a}from"./analytics-COpjZpvd.js";import{t as o}from"./useManagePlugins-pGaGzsEg.js";import{t as s}from"./KeybindingProviderSetup-syiDgtpB.js";import{n as c,t as l}from"./MCPConnectionManager-C7RmKzJh.js";import{cwd as u}from"process";var d=e(t(),1);a(),c(),i();var f=n(),p=d.lazy(()=>import(`./Doctor-B6isid5K.js`).then(e=>({default:e.Doctor})));function m({onDone:e}){return o(),(0,f.jsx)(d.Suspense,{fallback:null,children:(0,f.jsx)(p,{onDone:e})})}async function h(e){await new Promise(t=>{e.render((0,f.jsx)(r,{children:(0,f.jsx)(s,{children:(0,f.jsx)(l,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,f.jsx)(m,{onDone:()=>{t()}})})})}))}),e.unmount(),process.exit(0)}async function g(e,t){let{setup:n}=await import(`./setup-DVLnIlse.js`);await n(u(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-DIxyfdXG.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{h as doctorHandler,g as installHandler};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{Ni as r,Wi as i,dt as a,gt as o,ht as s,mt as c,pt as l}from"./settings-D4M13toi.js";import{_w as u,bw as d,cx as f,gx as p,hx as m,lx as ee,mx as te,vw as h,xw as g}from"./loadAgentsDir-bmpKLPdG.js";import{C as _,I as v,M as y,N as b,R as x,S,c as C,f as w,i as T,u as E,x as D}from"./debug-2pVES-2G.js";import{o as ne,s as O}from"./log-L1kqxa_P.js";import{homedir as re}from"os";import*as k from"path";import{join as ie,resolve as ae}from"path";import{randomBytes as oe}from"crypto";import{readFile as A,readdir as j,rename as M,stat as N,unlink as P,writeFile as F}from"fs/promises";function I(){return ie(f(),U)}async function L(){let e=I();try{let t=S(await A(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return C(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==H)return C(`Install counts cache version mismatch (got ${n.version}, expected ${H})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return C(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(C(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>G?(C(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(C(`Install counts cache has malformed entries`),null)}catch(e){return b(e)!==`ENOENT`&&C(`Failed to load install counts cache: ${y(e)}`),null}}async function R(e){let t=I(),n=`${t}.${oe(8).toString(`hex`)}.tmp`;try{let r=f();await E().mkdir(r),await F(n,_(e,null,2),{encoding:`utf-8`,mode:384}),await M(n,t),C(`Install counts cache saved successfully`)}catch(e){O(e);try{await P(n)}catch{}}}async function z(){C(`Fetching install counts from ${W}`);let e=performance.now();try{let n=await t.get(W,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return p(`install_counts`,W,`success`,performance.now()-e),n.data.plugins}catch(t){throw p(`install_counts`,W,`failure`,performance.now()-e,te(t)),t}}async function B(){let e=await L();if(e){C(`Using cached install counts`),p(`install_counts`,W,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await z();await R({version:H,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return O(e),C(`Failed to fetch install counts: ${y(e)}`),null}}function V(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var H,U,W,G,K=e((()=>{n(),T(),v(),w(),ne(),D(),m(),ee(),H=1,U=`install-counts-cache.json`,W=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,G=1440*60*1e3}));async function se(e){let t=e.trim(),n=E(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=ae(t.startsWith(`~`)?t.replace(/^~/,re()):t),r;try{r=await n.stat(e)}catch(t){let n=b(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{v(),w()}));function le(e){let t=k.basename(e),n=k.basename(k.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=k.resolve(e),i;try{i=await A(r,{encoding:`utf-8`})}catch(e){let t=b(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${y(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=S(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=l().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],r=k.resolve(e),a;try{a=await A(r,{encoding:`utf-8`})}catch(e){let t=b(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${y(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`marketplace`}}let o;try{o=S(a)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(e)}`}],warnings:[],filePath:r,fileType:`marketplace`}}if(o&&typeof o==`object`){let e=o;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let l=s().extend({plugins:i(c().strict())}).strict().safeParse(o);if(l.success||t.push(...q(l.error)),l.success){let e=l.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let i=k.dirname(r),a=k.basename(i)===`.claude-plugin`?k.dirname(i):i;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=k.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=S(await A(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],a=t.match(u);if(!a)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let o=a[1]||``,s;try{s=g(o)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${y(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof s!=`object`||!s||Array.isArray(s))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(s)?`an array`:s===null?`null`:typeof s}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let c=s;if(c.description!==void 0){let e=c.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Work Mate understand when to use this ${n}.`});c.name!==void 0&&c.name!==null&&typeof c.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof c.name}.`});let l=c[`allowed-tools`];l!=null&&(typeof l!=`string`&&!Array.isArray(l)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof l}.`}):Array.isArray(l)&&l.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let d=c.shell;if(d!=null)if(typeof d!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof d}.`});else{let e=d.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${d}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await A(e,{encoding:`utf-8`})}catch(t){return b(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${y(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=S(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=a().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await j(e,{withFileTypes:!0})}catch(e){let t=b(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>k.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=k.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,k.join(e,`skills`)],[`agent`,k.join(e,`agents`)],[`command`,k.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await A(r,{encoding:`utf-8`})}catch(n){if(x(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${y(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(k.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=k.resolve(e),n=null;try{n=await N(t)}catch(e){if(!x(e))throw e}if(n?.isDirectory()){let e=await X(k.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(k.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=S(await A(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(b(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{r(),v(),h(),D(),d(),o(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{se as a,K as c,ce as i,pe as n,V as o,fe as r,B as s,me as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,h as n,o as r}from"./config-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,h as n,o as r}from"./config-Bio2EjUK.js";import{n as i}from"./analytics-COpjZpvd.js";var a;e((()=>{i(),t(),a=async()=>{let e=r().editorMode||`normal`;e===`emacs`&&(e=`normal`);let t=e===`normal`?`vim`:`normal`;return n(e=>({...e,editorMode:t})),{type:`text`,value:`Editor mode set to ${t}. ${t===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{a as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{St as e,_t as t}from"./loadAgentsDir-bmpKLPdG.js";e();export{t as execIntoTmuxWorktree};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./wrapper-DVKxC5fR.js";e();export{t as default};
|
|
@@ -3,4 +3,4 @@ import{a as e,i as t,n,o as r,r as i,t as a}from"./rolldown-runtime-DaDcL9Zw.js"
|
|
|
3
3
|
`)),i.removeListener(`error`,T),d.setSocket(i,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on(`close`,()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(w,this)})),o(d,r)}};function S(e,t){for(let n of Object.keys(t))e.on(n,t[n]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function w(e){e._state=y,e.emit(`close`)}function T(){this.destroy()}function E(e,t,n,r){n=n||i.STATUS_CODES[t],r={Connection:`close`,"Content-Type":`text/html`,"Content-Length":Buffer.byteLength(n),...r},e.once(`finish`,e.destroy),e.end(`HTTP/1.1 ${t} ${i.STATUS_CODES[t]}\r\n`+Object.keys(r).map(e=>`${e}: ${r[e]}`).join(`\r
|
|
4
4
|
`)+`\r
|
|
5
5
|
\r
|
|
6
|
-
`+n)}function D(e,t,n,r,i,a){if(e.listenerCount(`wsClientError`)){let r=Error(i);Error.captureStackTrace(r,D),e.emit(`wsClientError`,r,n,t)}else E(n,r,i,a)}})),T,E
|
|
6
|
+
`+n)}function D(e,t,n,r,i,a){if(e.listenerCount(`wsClientError`)){let r=Error(i);Error.captureStackTrace(r,D),e.emit(`wsClientError`,r,n,t)}else E(n,r,i,a)}})),T,E,D=n((()=>{S(),b(),f(),_(),v(),C(),T=r(x(),1),w(),E=T.default}));export{D as n,E as r,T as t};
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import{l as e,o as t}from"./chunks/envUtils-
|
|
2
|
+
import{l as e,o as t}from"./chunks/envUtils-QyzA_cFM.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),t(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.WORKMATE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),e(process.env.WORKMATE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,"isTTY",{value:!0,configurable:!0})}catch{}}process.env.COREPACK_ENABLE_AUTO_PIN=`0`;async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`0.0.28 (Work Mate)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-DWcM4QBl.js`);if(t(`cli_entry`),process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-333L52Lo.js`);await e();return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-C5ukh6H3.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: wm job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-C5ukh6H3.js`);await n(e),process.exit(0)}if(e[0]===`channel`){t(`cli_channel_path`);let{enableConfigs:n}=await import(`./chunks/config-C_AEhZrn.js`);n();let{channelMain:r}=await import(`./chunks/channel-DVx21qde.js`);await r(e.slice(1));return}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-C_AEhZrn.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-D68iEHpC.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-BWL0vR4o.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CNfq37LF.js`);e(n.error)}}}e.includes(`--bare`)&&(process.env.WORKMATE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-BEjRkAtH.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-B31aPMPP.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@readmagic/workmate",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"description": "workMate",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Frandy",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@agentclientprotocol/sdk": "^0.19.0",
|
|
70
|
+
"dingtalk-stream": "^2.1.6-beta.1",
|
|
70
71
|
"highlight.js": "^11.11.1",
|
|
71
72
|
"ws": "^8.20.0"
|
|
72
73
|
},
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
"@anthropic-ai/sandbox-runtime": "^0.0.44",
|
|
81
82
|
"@anthropic-ai/sdk": "^0.81.0",
|
|
82
83
|
"@anthropic-ai/vertex-sdk": "^0.16.0",
|
|
83
|
-
"@
|
|
84
|
+
"@readmagic/ink": "workspace:*",
|
|
84
85
|
"@aws-sdk/client-bedrock": "^3.1037.0",
|
|
85
86
|
"@aws-sdk/client-bedrock-runtime": "^3.1037.0",
|
|
86
87
|
"@aws-sdk/credential-provider-node": "^3.972.36",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./AgentsMdExternalIncludesDialog-BHBkysy0.js";e();export{t as AgentsMdExternalIncludesDialog};
|
|
@@ -1,2 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./Doctor-DJOMbSDE.js";e();export{t as Doctor};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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,3 +0,0 @@
|
|
|
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};
|