@readmagic/workmate 0.0.23 → 0.0.24
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-OgcBcK5A.js → AddWorkspaceDirectory-Ch8IcWXO.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-Cyia0s4g.js +1 -0
- package/dist/chunks/{AgentsMdExternalIncludesDialog-CNEifEyV.js → AgentsMdExternalIncludesDialog-LjI_H_Au.js} +1 -1
- package/dist/chunks/{App-B-3tPQ3k.js → App-BOqh_1tN.js} +1 -1
- package/dist/chunks/{BackgroundTasksDialog-COuhHcey.js → BackgroundTasksDialog-CSEuuoq9.js} +1 -1
- package/dist/chunks/{BypassPermissionsModeDialog-bJek4siJ.js → BypassPermissionsModeDialog-CwfCwUr9.js} +1 -1
- package/dist/chunks/CustomSelect-wmZ9jz0W.js +1 -0
- package/dist/chunks/{DiffDialog-B3X9FMpO.js → DiffDialog-BpXIEWiE.js} +1 -1
- package/dist/chunks/Doctor-CMpr7tdf.js +1 -0
- package/dist/chunks/{Doctor-6PXyjIi6.js → Doctor-DqW6j3_B.js} +1 -1
- package/dist/chunks/{ExitFlow-DgAZp_8U.js → ExitFlow-DacaBTlk.js} +1 -1
- package/dist/chunks/{Grove-CHatOzcE.js → Grove-CNqYPWI6.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-DXL92MN9.js → InvalidConfigDialog-0TMJItCC.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-Dtmpzeps.js → InvalidSettingsDialog-iwh8H52b.js} +1 -1
- package/dist/chunks/{KeybindingProviderSetup-DA37QUFs.js → KeybindingProviderSetup-D49HHTXD.js} +1 -1
- package/dist/chunks/{MCPConnectionManager-thZd-xA_.js → MCPConnectionManager-Cie77ZAK.js} +1 -1
- package/dist/chunks/{MCPToolListView-CpY-YJg4.js → MCPToolListView-B4ehtkXd.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-JvChf3xr.js → McpParsingWarnings-Bff66RtJ.js} +1 -1
- package/dist/chunks/{MessageSelector-C0_iw7SI.js → MessageSelector-Dpd6Iywp.js} +1 -1
- package/dist/chunks/{Messages-K4DDsDP9.js → Messages-DN7M3oS_.js} +1 -1
- package/dist/chunks/{Onboarding-C1UdzM-1.js → Onboarding-CQmE3rUf.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-AyLog8p7.js → PromptInputFooterSuggestions-HI6HH3TP.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-oyic20ip.js → PromptInputHelpMenu-3QNUC2Cg.js} +1 -1
- package/dist/chunks/{ProviderSetup-XcBHjUnd.js → ProviderSetup-BCSPsvfv.js} +1 -1
- package/dist/chunks/{QueryEngine-DYxBjJ4i.js → QueryEngine-DdLWvJv6.js} +1 -1
- package/dist/chunks/{REPL-CQBJRrT0.js → REPL-BqO9KcK_.js} +5 -5
- package/dist/chunks/REPL-CmZmypfF.js +1 -0
- package/dist/chunks/{ResumeConversation-Dl8H9Gfy.js → ResumeConversation-DBqX7gva.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-BsSoILFj.js +1 -0
- package/dist/chunks/{SelectMulti-Bc6l11_K.js → SelectMulti-BQRHed-d.js} +1 -1
- package/dist/chunks/{Settings-TGp3fPrS.js → Settings-B-7yBewS.js} +3 -3
- package/dist/chunks/{Spinner-zYPFVFHN.js → Spinner-ByQXTvAA.js} +1 -1
- package/dist/chunks/{TextInput-CD9iau2k.js → TextInput-B8ruWRf2.js} +1 -1
- package/dist/chunks/{ThemePicker-0F0hZYPX.js → ThemePicker-BQErFFW1.js} +1 -1
- package/dist/chunks/{TrustDialog-C76YiMKz.js → TrustDialog-BIhz6AZE.js} +1 -1
- package/dist/chunks/{_baseEach-4ff-vRlp.js → _baseEach-CsIRoaTH.js} +1 -1
- package/dist/chunks/{add-dir-JMsRLGfx.js → add-dir-CrUDs19x.js} +1 -1
- package/dist/chunks/{agentDisplay-BReJUBWg.js → agentDisplay-M4pfwbMC.js} +1 -1
- package/dist/chunks/{agents-9qQ8I6zW.js → agents-CGaCQeLw.js} +1 -1
- package/dist/chunks/{agents-B3x8yJ_r.js → agents-DddX7lLX.js} +1 -1
- package/dist/chunks/{allErrors-DfWylHSw.js → allErrors-BF73lon8.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-CVNIhQg8.js → backgroundHousekeeping-Bq3LMsVR.js} +2 -2
- package/dist/chunks/backgroundHousekeeping-Cl3Ox7Qh.js +1 -0
- package/dist/chunks/{branch-C4TsMEkx.js → branch-Yg_taNlT.js} +1 -1
- package/dist/chunks/{btw-Dn1eYFAz.js → btw-udbprVvu.js} +1 -1
- package/dist/chunks/caches-ChjIEcdd.js +1 -0
- package/dist/chunks/{caches-DArHxBgL.js → caches-DLJ6urv-.js} +1 -1
- package/dist/chunks/{clear-Bdhb6b39.js → clear-B8ZtFPOK.js} +1 -1
- package/dist/chunks/commands-CVCpJo7M.js +1 -0
- package/dist/chunks/{compact-Bu9BUpxV.js → compact-izk6RKHQ.js} +1 -1
- package/dist/chunks/config-CFqpXMFX.js +1 -0
- package/dist/chunks/{context-CY_yfdYa.js → context-BbVm4SWK.js} +1 -1
- package/dist/chunks/{context-noninteractive-Dd4xIoP1.js → context-noninteractive-C7wrRZnM.js} +1 -1
- package/dist/chunks/context-noninteractive-x0HAzWhc.js +1 -0
- package/dist/chunks/conversation-DouVzO0K.js +1 -0
- package/dist/chunks/{conversation-DUu9qBnq.js → conversation-DrVkifKy.js} +1 -1
- package/dist/chunks/{conversationRecovery-2ft8sCPE.js → conversationRecovery-DliPBo_z.js} +1 -1
- package/dist/chunks/{crossProjectResume-6boHMUBx.js → crossProjectResume-DxMy05_P.js} +1 -1
- package/dist/chunks/{datadog-BPuGcxxC.js → datadog-Cu3s7P48.js} +1 -1
- package/dist/chunks/{diff-BOAElpfQ.js → diff-DdpHThJ7.js} +1 -1
- package/dist/chunks/doctor-D_kV_D_l.js +1 -0
- package/dist/chunks/{entry-TNOoyy7_.js → entry-Bxseqbi_.js} +1 -1
- package/dist/chunks/{esm-eTAUP-La.js → esm-BXTZz3av.js} +1 -1
- package/dist/chunks/{exit-DXApFJIP.js → exit-C_R_FgzR.js} +1 -1
- package/dist/chunks/{extraUsage-CmQaLPV1.js → extraUsage-xMuDiNKh.js} +1 -1
- package/dist/chunks/extractMemories-D4Dl1itt.js +1 -0
- package/dist/chunks/{fast-eGx2IxD7.js → fast-DH-C5IZs.js} +1 -1
- package/dist/chunks/fast-bopOPrtf.js +1 -0
- package/dist/chunks/fetchModelList-DC4VQpqa.js +1 -0
- package/dist/chunks/{fetchModelList-CxLsVNsu.js → fetchModelList-FE8tzTDc.js} +1 -1
- package/dist/chunks/{fileSuggestions-DHxdwq28.js → fileSuggestions-C-9unnoJ.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-M6UMli2c.js → firstPartyEventLogger-QmjjQmgt.js} +2 -2
- package/dist/chunks/firstPartyEventLogger-lFeqhtfh.js +1 -0
- package/dist/chunks/{gemini-D_ORb_L6.js → gemini-C_ApXgwc.js} +1 -1
- package/dist/chunks/{generateSessionName-BQoDduyA.js → generateSessionName-CQ03xlYI.js} +1 -1
- package/dist/chunks/{goal-D7c2mSds.js → goal-CdL29Y8C.js} +1 -1
- package/dist/chunks/{grok-B2-ZbUiR.js → grok-C6WAslUT.js} +1 -1
- package/dist/chunks/{help-CZJdRviD.js → help-DxanITNN.js} +1 -1
- package/dist/chunks/{history-CQiUERTL.js → history-BMycjPTT.js} +1 -1
- package/dist/chunks/hooks-D9ApLkBp.js +1 -0
- package/dist/chunks/{hooks-DIvN6gdv.js → hooks-DR3IYPJ3.js} +1 -1
- package/dist/chunks/{install-T_CV1Slu.js → install-0D9u2dZw.js} +1 -1
- package/dist/chunks/{instrumentation-BjqUZ383.js → instrumentation-BFiGwntt.js} +3 -3
- package/dist/chunks/{job-R6c4-3c8.js → job-YhJQWgE0.js} +1 -1
- package/dist/chunks/{keybindings-CLRaiL_Z.js → keybindings-DZrF9iNd.js} +1 -1
- package/dist/chunks/{launchLocalMemory-DrbKrwXc.js → launchLocalMemory-DhJ56KDc.js} +1 -1
- package/dist/chunks/{launchOnboarding-tqsMD8ni.js → launchOnboarding-DmMoZwv5.js} +1 -1
- package/dist/chunks/{loadAgentsDir-DlPbtIsS.js → loadAgentsDir-B0Anodo0.js} +23 -23
- package/dist/chunks/loadAgentsDir-BbUR6pqH.js +1 -0
- package/dist/chunks/{loadPluginHooks-C_msxVIc.js → loadPluginHooks-BSwCtQ6T.js} +1 -1
- package/dist/chunks/{localSearch-CK-sFzPm.js → localSearch-BxLYi6w_.js} +1 -1
- package/dist/chunks/localSearch-zfn7jgrh.js +1 -0
- package/dist/chunks/{logoUtils-x2pHV-Nl.js → logoUtils-CRxTutvr.js} +1 -1
- package/dist/chunks/{magicDocs-BEF8D3if.js → magicDocs-Bkz7ZcmL.js} +1 -1
- package/dist/chunks/{main-kOVUGxOS.js → main-9ksgUUY_.js} +5 -5
- package/dist/chunks/{mcp-D0wAJrRT.js → mcp-ChF12reQ.js} +1 -1
- package/dist/chunks/{mcp-mgOlm1cY.js → mcp-DoEl5uah.js} +1 -1
- package/dist/chunks/{mcp-BNd29r6p.js → mcp-hp9qqjAy.js} +2 -2
- package/dist/chunks/{memory-DDLk9_LJ.js → memory-Qv-wGNQ5.js} +1 -1
- package/dist/chunks/{mode-CcNsWgK3.js → mode-bFXPCR2P.js} +1 -1
- package/dist/chunks/{model-DzCP4K-9.js → model-6lkW4o2c.js} +1 -1
- package/dist/chunks/{model-BwBG0V1u.js → model-BvQFFOf8.js} +1 -1
- package/dist/chunks/{modelOptions-DRaG3bo0.js → modelOptions-BBvF3wHK.js} +1 -1
- package/dist/chunks/{nativeInstaller-C3pVPqrZ.js → nativeInstaller-CdjmE9Zy.js} +1 -1
- package/dist/chunks/{notifications-4wP1Tx9Y.js → notifications-Bc6k-Ozy.js} +1 -1
- package/dist/chunks/{onChangeAppState-BlaoFbYF.js → onChangeAppState-DLjZ1x95.js} +1 -1
- package/dist/chunks/{openai-CDN71NdX.js → openai-D46QvESE.js} +1 -1
- package/dist/chunks/{overlayContext-BT2Lq8ei.js → overlayContext-8--_fbvY.js} +1 -1
- package/dist/chunks/{partition-CIl_ORUT.js → partition-DznN4XZH.js} +1 -1
- package/dist/chunks/{permissions-zSNOZSwr.js → permissions-DmGFViHI.js} +1 -1
- package/dist/chunks/{pidLock-BTqO-h7Y.js → pidLock-Cm4sW35f.js} +2 -2
- package/dist/chunks/{plan-Bs6em6lk.js → plan-CzGBz_87.js} +1 -1
- package/dist/chunks/{plugin-DDDxjBa0.js → plugin-CluR79xX.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-8qugAFhb.js → pluginAutoupdate-ennb9k8_.js} +1 -1
- package/dist/chunks/{pluginBlocklist-q01ackCf.js → pluginBlocklist-9OrNEh--.js} +1 -1
- package/dist/chunks/{pluginCliCommands-DXZfCZsv.js → pluginCliCommands-CJv5uhOG.js} +1 -1
- package/dist/chunks/{pluginFlagging-BG2MHCQJ.js → pluginFlagging-js_-WmYj.js} +1 -1
- package/dist/chunks/{pluginOperations-hXYLrzM2.js → pluginOperations-CcUSHAIa.js} +1 -1
- package/dist/chunks/pluginStartupCheck-CRBUO9gP.js +1 -0
- package/dist/chunks/{pluginStartupCheck-DTMa6TgL.js → pluginStartupCheck-SRXOyqr7.js} +1 -1
- package/dist/chunks/{plugins-COoGBYk6.js → plugins-IwwaCDba.js} +1 -1
- package/dist/chunks/{print-BASybEtO.js → print-CgszM1ea.js} +2 -2
- package/dist/chunks/{processBashCommand-DDi_Pymt.js → processBashCommand-D098WsqY.js} +1 -1
- package/dist/chunks/{processSlashCommand-Cq9kaoSF.js → processSlashCommand-DOQFjJ88.js} +1 -1
- package/dist/chunks/prompt-BKPmDAuL.js +1 -0
- package/dist/chunks/{prompt-mM79EGnT.js → prompt-CJ1l3XXk.js} +1 -1
- package/dist/chunks/prompt-CgOklk7z.js +1 -0
- package/dist/chunks/{promptEditor-DLGN_eLu.js → promptEditor-DoGHJN_W.js} +1 -1
- package/dist/chunks/{reconciler-CeXqh95g.js → reconciler-ykkSPR-i.js} +1 -1
- package/dist/chunks/{refresh-Ce2yk28a.js → refresh-Dn_I1R4v.js} +1 -1
- package/dist/chunks/{reject-Bld5E-bn.js → reject-DtcCfuZV.js} +1 -1
- package/dist/chunks/{reload-plugins-C42xSB5l.js → reload-plugins-CQZFQLWP.js} +1 -1
- package/dist/chunks/{rename-CtBghpxZ.js → rename-DyEfsZiq.js} +1 -1
- package/dist/chunks/{resume-BWkaTDqd.js → resume-BcXEDUqZ.js} +1 -1
- package/dist/chunks/{runtimeObserver-1wQO8HSZ.js → runtimeObserver-DEuR8z0f.js} +1 -1
- package/dist/chunks/{runtimeObserver-XQrOux41.js → runtimeObserver-PJ1o8GRA.js} +2 -2
- package/dist/chunks/sandbox-adapter-DfB9kgQD.js +1 -0
- package/dist/chunks/{sandbox-toggle-Dir9Polo.js → sandbox-toggle-D9GDUsTl.js} +1 -1
- package/dist/chunks/searchExtraTools-D4gMMQv0.js +1 -0
- package/dist/chunks/{select-Bxf5-5sI.js → select-DIxfl_VN.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-lbgHnVvi.js +1 -0
- package/dist/chunks/{sessionObserver-DS4G6mb9.js → sessionObserver-BtKjvteq.js} +1 -1
- package/dist/chunks/sessionObserver-D6qzEdGJ.js +1 -0
- package/dist/chunks/sessionStorage-C_7gow_z.js +1 -0
- package/dist/chunks/{sessionTracing-BoDDYLxW.js → sessionTracing-CtbeAD0s.js} +1 -1
- package/dist/chunks/{setup-BRypY6iT.js → setup-qecdf-ES.js} +2 -2
- package/dist/chunks/{shadowedRuleDetection-BRxZjobz.js → shadowedRuleDetection-Bg_aIc5Z.js} +1 -1
- package/dist/chunks/{sideQuestion-DLJxyrlp.js → sideQuestion-D49GsfH7.js} +1 -1
- package/dist/chunks/sinks-C-lP7uyO.js +1 -0
- package/dist/chunks/{sinks-Cz2HfgMU.js → sinks-De-B1lPQ.js} +1 -1
- package/dist/chunks/{skillChangeDetector-xviGstqm.js → skillChangeDetector-DkOJoNhT.js} +1 -1
- package/dist/chunks/{skillGapStore-CKN_d3pO.js → skillGapStore-CcFoHNLl.js} +2 -2
- package/dist/chunks/{skillLifecycle-BMY2JGGG.js → skillLifecycle-Bnz_4wE5.js} +2 -2
- package/dist/chunks/{skillSearchPanel-D9trHULQ.js → skillSearchPanel-C_5yUhqn.js} +2 -2
- package/dist/chunks/{skills-CX_AvwLG.js → skills-BE5scC-g.js} +1 -1
- package/dist/chunks/status-Dw09WZLd.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-vFVgIYuw.js → statusNoticeHelpers-BRQpUIlH.js} +1 -1
- package/dist/chunks/switcher-CgZVah7U.js +1 -0
- package/dist/chunks/{switcher-CAajZeNL.js → switcher-DZwUo5Ed.js} +1 -1
- package/dist/chunks/{tasks-BWNQr2d3.js → tasks-DdcUQEeD.js} +1 -1
- package/dist/chunks/{templateJobs-gUET39Ho.js → templateJobs-C8qsPrLj.js} +1 -1
- package/dist/chunks/{theme-B7fKI6E5.js → theme-f1h2QI8J.js} +1 -1
- package/dist/chunks/{tipRegistry-DamZr34w.js → tipRegistry-B71o4qWr.js} +1 -1
- package/dist/chunks/{toolEventObserver-BL06sDI4.js → toolEventObserver-7QP38x4t.js} +1 -1
- package/dist/chunks/{toolPool-CX5wDBi1.js → toolPool-V-7Yv0GA.js} +1 -1
- package/dist/chunks/{use-select-navigation-BiUJdWai.js → use-select-navigation-hWL5VHnL.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js → useExitOnCtrlCDWithKeybindings-BKwzUpgb.js} +1 -1
- package/dist/chunks/useMainLoopModel-DxvV70Ru.js +1 -0
- package/dist/chunks/{useManagePlugins-BqfIVa6E.js → useManagePlugins-BXLXazrR.js} +1 -1
- package/dist/chunks/useMergedTools-CCgnBJzO.js +1 -0
- package/dist/chunks/{useSearchInput-B25K1RnK.js → useSearchInput-CzopttqC.js} +1 -1
- package/dist/chunks/{useSettingsErrors-DYQ44kX4.js → useSettingsErrors-SFPWfxsA.js} +1 -1
- package/dist/chunks/{util-CtlC2dsN.js → util-Cbb3S6SX.js} +1 -1
- package/dist/chunks/{validatePlugin-D6tFo87L.js → validatePlugin-BMSoeb_b.js} +1 -1
- package/dist/chunks/worktree-Vm-SNY5x.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-CDNd5-7E.js +0 -1
- package/dist/chunks/CustomSelect-DoeEXOIP.js +0 -1
- package/dist/chunks/Doctor-DNgkgYhB.js +0 -1
- package/dist/chunks/REPL-CrVuMQY2.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-lv7VE50N.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BGxHB_OX.js +0 -1
- package/dist/chunks/caches-BGzKwpnc.js +0 -1
- package/dist/chunks/commands-QepeBbFn.js +0 -1
- package/dist/chunks/config-D58C3_Lu.js +0 -1
- package/dist/chunks/context-noninteractive-BDDi3NLF.js +0 -1
- package/dist/chunks/conversation-B0wxBwzv.js +0 -1
- package/dist/chunks/doctor-CkLzqAMd.js +0 -1
- package/dist/chunks/extractMemories-xP63mv6R.js +0 -1
- package/dist/chunks/fast-C5nQH8rm.js +0 -1
- package/dist/chunks/fetchModelList-D24lRIgR.js +0 -1
- package/dist/chunks/firstPartyEventLogger-BVAogAX8.js +0 -1
- package/dist/chunks/hooks-BNuUlMzL.js +0 -1
- package/dist/chunks/loadAgentsDir-CcmY8zCj.js +0 -1
- package/dist/chunks/localSearch-DrUj0B-d.js +0 -1
- package/dist/chunks/pluginStartupCheck-HS1ZceZa.js +0 -1
- package/dist/chunks/prompt-CHobfCB1.js +0 -1
- package/dist/chunks/prompt-CMm6RHHc.js +0 -1
- package/dist/chunks/sandbox-adapter-8GO6eJxw.js +0 -1
- package/dist/chunks/searchExtraTools-BhDq8DTJ.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-CozocHQE.js +0 -1
- package/dist/chunks/sessionObserver-DGEQM4cO.js +0 -1
- package/dist/chunks/sessionStorage-BcAscOGE.js +0 -1
- package/dist/chunks/sinks-CGdKmq_8.js +0 -1
- package/dist/chunks/status-Daaak6Bo.js +0 -1
- package/dist/chunks/switcher-BpgmH4AI.js +0 -1
- package/dist/chunks/useMainLoopModel-DwjSVzzO.js +0 -1
- package/dist/chunks/useMergedTools-Bw8FchX8.js +0 -1
- package/dist/chunks/worktree-B8apCnVe.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{F as i,N as a,P as o,mb as s,md as c,pd as l}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{F as i,N as a,P as o,mb as s,md as c,pd as l}from"./loadAgentsDir-B0Anodo0.js";import{D as u,I as d,P as f,T as p,Wt as m,ai as h,t as g,vn as _,y as v,yn as y}from"./src-DL3w8VPk.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{n as x,t as S}from"./TextInput-B8ruWRf2.js";import{n as C,t as w}from"./select-DIxfl_VN.js";import{r as T,t as E}from"./directoryCompletion-D_Rtg-4j.js";import{r as D,t as O}from"./PromptInputFooterSuggestions-HI6HH3TP.js";function k(){return(0,P.jsx)(f,{dimColor:!0,children:`Work Mate will be able to read files in this directory and make edits when auto-accept edits is on.`})}function A({path:e}){return(0,P.jsxs)(d,{flexDirection:`column`,paddingX:2,gap:1,children:[(0,P.jsx)(f,{color:`permission`,children:e}),(0,P.jsx)(k,{})]})}function j({value:e,onChange:t,onSubmit:n,error:i,suggestions:a,selectedSuggestion:o}){return(0,P.jsxs)(d,{flexDirection:`column`,children:[(0,P.jsx)(f,{children:`Enter the path to the directory:`}),(0,P.jsx)(d,{borderDimColor:!0,borderStyle:`round`,marginY:1,paddingLeft:1,children:(0,P.jsx)(S,{showCursor:!0,placeholder:`Directory path${r.ellipsis}`,value:e,onChange:t,onSubmit:n,columns:80,cursorOffset:e.length,onChangeCursorOffset:()=>{}})}),a.length>0&&(0,P.jsx)(d,{marginBottom:1,children:(0,P.jsx)(O,{suggestions:a,selectedSuggestion:o})}),i&&(0,P.jsx)(f,{color:`error`,children:i})]})}function M({onAddDirectory:e,onCancel:t,permissionContext:n,directoryPath:r}){let[o,s]=(0,N.useState)(``),[c,h]=(0,N.useState)(null),[g,_]=(0,N.useState)([]),[b,x]=(0,N.useState)(0),S=(0,N.useMemo)(()=>F,[]),C=y((0,N.useCallback)(async e=>{if(!e){_([]),x(0);return}let t=await E(e);_(t),x(0)},[]),100);(0,N.useEffect)(()=>{C(o)},[o,C]);let T=(0,N.useCallback)(e=>{let t=`${e.id}/`;s(t),h(null)},[]),D=(0,N.useCallback)(async t=>{let r=await i(t,n);r.resultType===`success`?e(r.absolutePath,!1):h(a(r))},[n,e]);m(`confirm:no`,t,{context:`Settings`});let O=(0,N.useCallback)(e=>{if(g.length>0){if(e.key===`tab`){e.preventDefault();let t=g[b];t&&T(t);return}if(e.key===`return`){e.preventDefault();let t=g[b];t&&D(`${t.id}/`);return}if(e.key===`up`||e.ctrl&&e.key===`p`){e.preventDefault(),x(e=>e<=0?g.length-1:e-1);return}if(e.key===`down`||e.ctrl&&e.key===`n`){e.preventDefault(),x(e=>e>=g.length-1?0:e+1);return}}},[g,b,T,D]),M=(0,N.useCallback)(n=>{if(r)switch(n){case`yes-session`:e(r,!1);break;case`yes-remember`:e(r,!0);break;case`no`:t();break}},[r,e,t]);return(0,P.jsx)(d,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:O,children:(0,P.jsx)(v,{title:`Add directory to workspace`,onCancel:t,color:`permission`,isCancelActive:!1,inputGuide:r?void 0:e=>e.pending?(0,P.jsxs)(f,{children:[`Press `,e.keyName,` again to exit`]}):(0,P.jsxs)(p,{children:[(0,P.jsx)(u,{shortcut:`Tab`,action:`complete`}),(0,P.jsx)(u,{shortcut:`Enter`,action:`add`}),(0,P.jsx)(l,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]}),children:r?(0,P.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,P.jsx)(A,{path:r}),(0,P.jsx)(w,{options:S,onChange:M,onCancel:()=>M(`no`)})]}):(0,P.jsxs)(d,{flexDirection:`column`,gap:1,marginX:2,children:[(0,P.jsx)(k,{}),(0,P.jsx)(j,{value:o,onChange:s,onSubmit:D,error:c,suggestions:g,selectedSuggestion:b})]})})})}var N,P,F,I=e((()=>{n(),N=t(h(),1),_(),o(),x(),g(),s(),T(),c(),C(),D(),P=b(),F=[{value:`yes-session`,label:`Yes, for this session`},{value:`yes-remember`,label:`Yes, and remember this directory`},{value:`no`,label:`No`}]}));export{I as n,M as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./AgentsMdExternalIncludesDialog-LjI_H_Au.js";e();export{t as AgentsMdExternalIncludesDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,ai as a,t as o,y as s}from"./src-DL3w8VPk.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{g as l,p as u}from"./config-C-Y2qtB2.js";import{n as d,r as f}from"./analytics-DJobLaWP.js";import{t as p}from"./select-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,ai as a,t as o,y as s}from"./src-DL3w8VPk.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{g as l,p as u}from"./config-C-Y2qtB2.js";import{n as d,r as f}from"./analytics-DJobLaWP.js";import{t as p}from"./select-DIxfl_VN.js";import{t as m}from"./CustomSelect-wmZ9jz0W.js";function h({onDone:e,isStandaloneDialog:t,externalIncludes:a}){g.useEffect(()=>{f(`tengu_claude_md_includes_dialog_shown`,{})},[]);let o=(0,g.useCallback)(t=>{t===`no`?(f(`tengu_claude_md_external_includes_dialog_declined`,{}),l(e=>({...e,hasAgentsMdExternalIncludesApproved:!1,hasAgentsMdExternalIncludesWarningShown:!0}))):(f(`tengu_claude_md_external_includes_dialog_accepted`,{}),l(e=>({...e,hasAgentsMdExternalIncludesApproved:!0,hasAgentsMdExternalIncludesWarningShown:!0}))),e()},[e]);return(0,_.jsxs)(s,{title:`Allow external AGENTS.md file imports?`,color:`warning`,onCancel:(0,g.useCallback)(()=>{o(`no`)},[o]),hideBorder:!t,hideInputGuide:!t,children:[(0,_.jsx)(i,{children:`This project's AGENTS.md imports files outside the current working directory. Never allow this for third-party repositories.`}),a&&a.length>0&&(0,_.jsxs)(n,{flexDirection:`column`,children:[(0,_.jsx)(i,{dimColor:!0,children:`External imports:`}),a.map((e,t)=>(0,_.jsxs)(i,{dimColor:!0,children:[` `,e.path]},t))]}),(0,_.jsxs)(i,{dimColor:!0,children:[`Important: Only use Work Mate with files you trust. Accessing untrusted files may pose security risks`,` `,(0,_.jsx)(r,{url:`https://code.workmate.com/docs/en/security`}),` `]}),(0,_.jsx)(p,{options:[{label:`Yes, allow external imports`,value:`yes`},{label:`No, disable external imports`,value:`no`}],onChange:e=>o(e)})]})}var g,_,v=e((()=>{g=t(a(),1),d(),o(),u(),m(),_=c()}));export{v as n,h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ip as e,Pp as t}from"./loadAgentsDir-
|
|
1
|
+
import{Ip as e,Pp as t}from"./loadAgentsDir-B0Anodo0.js";import{R as n,t as r}from"./src-DL3w8VPk.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{_ as a,p as o,s}from"./config-C-Y2qtB2.js";import{t as c}from"./fpsMetrics-wxj9GAsd.js";import{n as l,t as u}from"./onChangeAppState-DLjZ1x95.js";e(),r(),o();var d=i();function f({getFpsMetrics:e,stats:r,initialState:i,children:o}){return(0,d.jsx)(c,{getFpsMetrics:e,children:(0,d.jsx)(l,{store:r,children:(0,d.jsx)(t,{initialState:i,onChangeAppState:u,children:(0,d.jsx)(n,{initialState:s().theme,onThemeSave:e=>a(t=>({...t,theme:e})),children:o})})})})}export{f as App};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{Dn as i,Ec as a,Hl as o,Ip as s,Ju as c,Jx as l,Lp as u,Tc as d,Tn as f,Ul as p,Vl as m,Wl as h,Yi as g,Yu as _,bb as v,dm as ee,ds as te,fs as y,gb as ne,gu as b,hb as x,hu as S,mb as C,mm as w,zp as re}from"./loadAgentsDir-DlPbtIsS.js";import{D as T,Gt as E,H as D,I as O,P as k,T as A,ai as j,ot as M,t as N,y as P}from"./src-DL3w8VPk.js";import{t as F}from"./jsx-runtime-Bb4Xn-E0.js";import{_ as ie,f as ae}from"./debug-Bglx1aTu.js";import{Hn as oe,Un as se,Vn as ce}from"./settings-B2jvL8Dp.js";import{l as I,o as le}from"./stringUtils-C718f5ey.js";import{S as ue,_ as L,f as de,l as R,u as fe,y as z}from"./startupProfiler-CJdr3SxP.js";import{_n as pe,gn as me,vn as he}from"./prompt-mM79EGnT.js";import{i as ge,t as _e}from"./overlayContext-BT2Lq8ei.js";function B(e,t,n=1e3,r=0,i){let a=()=>R(Math.max(0,(i??Date.now())-e-r));return(0,V.useSyncExternalStore)((0,V.useCallback)(e=>{if(!t)return()=>{};let r=setInterval(e,n);return()=>clearInterval(r)},[t,n]),a,a)}var V,H=e((()=>{V=t(j(),1),L()}));function ve(e,t,n){let r=me(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,ye.jsxs)(k,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var ye,be=e((()=>{N(),he(),ye=F()}));function xe(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 Se(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 Ce(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(b(t))return n=!0,!1;return n}var we=e((()=>{n(),S()}));function Te({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[i]=D(),a=(0,Ee.useMemo)(()=>d(pe()),[]),o=B(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);E({"confirm:yes":t},{context:`Confirmation`});let s=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},u=l(e.prompt,`plan`),f=e.prompt.length>300?`${e.prompt.substring(0,297)}…`:e.prompt,p=e.result?.totalTokens??e.progress?.tokenCount,m=e.result?.totalToolUseCount??e.progress?.toolUseCount;return(0,U.jsx)(O,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:(0,U.jsx)(P,{title:(0,U.jsxs)(k,{children:[e.selectedAgent?.agentType??`agent`,` › `,e.description||`Async agent`]}),subtitle:(0,U.jsxs)(k,{children:[e.status!==`running`&&(0,U.jsxs)(k,{color:Se(e.status),children:[xe(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,U.jsxs)(k,{dimColor:!0,children:[o,p!==void 0&&p>0&&(0,U.jsxs)(U.Fragment,{children:[` · `,de(p),` tokens`]}),m!==void 0&&m>0&&(0,U.jsxs)(U.Fragment,{children:[` `,`· `,m,` `,m===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,U.jsxs)(k,{children:[`Press `,t.keyName,` again to exit`]}):(0,U.jsxs)(A,{children:[r&&(0,U.jsx)(T,{shortcut:`←`,action:`go back`}),(0,U.jsx)(T,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,U.jsx)(T,{shortcut:`x`,action:`stop`})]}),children:(0,U.jsxs)(O,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,U.jsxs)(O,{flexDirection:`column`,children:[(0,U.jsx)(k,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,U.jsxs)(k,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,ve(t,a,i)]},n))]}),u?(0,U.jsx)(O,{marginTop:1,children:(0,U.jsx)(c,{addMargin:!1,planContent:u})}):(0,U.jsxs)(O,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(k,{bold:!0,dimColor:!0,children:`Prompt`}),(0,U.jsx)(k,{wrap:`wrap`,children:f})]}),e.status===`failed`&&e.error&&(0,U.jsxs)(O,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(k,{bold:!0,color:`error`,children:`Error`}),(0,U.jsx)(k,{color:`error`,wrap:`wrap`,children:e.error})]})]})})})}var Ee,U,De=e((()=>{Ee=t(j(),1),H(),N(),C(),he(),a(),L(),g(),_(),be(),we(),U=F()}));function W({status:e,label:t,suffix:n}){return(0,G.jsxs)(k,{color:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:void 0,dimColor:!0,children:[`(`,t??e,n,`)`]})}function Oe({shell:e}){switch(e.status){case`completed`:return(0,G.jsx)(W,{status:`completed`,label:`done`});case`failed`:return(0,G.jsx)(W,{status:`failed`,label:`error`});case`killed`:return(0,G.jsx)(W,{status:`killed`,label:`stopped`});case`running`:case`pending`:return(0,G.jsx)(W,{status:`running`})}}var G,ke=e((()=>{N(),G=F()}));function Ae({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,K.jsxs)(k,{children:[z(e.command,n,!0),` `,(0,K.jsx)(Oe,{shell:e})]});case`local_agent`:return(0,K.jsxs)(k,{children:[z(e.description,n,!0),` `,(0,K.jsx)(W,{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,K.jsxs)(k,{children:[z(t.workflowName??e.summary??e.description,n,!0),` `,(0,K.jsx)(W,{status:e.status,label:e.status===`running`?`${t.agentCount} ${I(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} ${I(t,`file`)}`:`${e.sessionsReviewing} ${I(e.sessionsReviewing,`session`)}`;return(0,K.jsxs)(k,{children:[e.description,` `,(0,K.jsxs)(k,{dimColor:!0,children:[`· `,e.phase,` · `,n]}),` `,(0,K.jsx)(W,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}}}var K,je=e((()=>{N(),L(),le(),ke(),K=F()}));function Me({task:e,onDone:t,onBack:n,onKill:r}){let i=B(e.startTime,e.status===`running`,1e3,0);E({"confirm:yes":t},{context:`Confirmation`});let a=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&n?(i.preventDefault(),n()):i.key===`x`&&e.status===`running`&&r&&(i.preventDefault(),r())},o=e.turns.filter(e=>e.text!==``),s=o.slice(-6),c=o.length-s.length;return(0,q.jsx)(O,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:a,children:(0,q.jsx)(P,{title:`Memory consolidation`,subtitle:(0,q.jsxs)(k,{dimColor:!0,children:[i,` · reviewing `,e.sessionsReviewing,` `,I(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,q.jsxs)(q.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,I(e.filesTouched.length,`file`),` touched`]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,q.jsxs)(k,{children:[`Press `,t.keyName,` again to exit`]}):(0,q.jsxs)(A,{children:[n&&(0,q.jsx)(T,{shortcut:`←`,action:`go back`}),(0,q.jsx)(T,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,q.jsx)(T,{shortcut:`x`,action:`stop`})]}),children:(0,q.jsxs)(O,{flexDirection:`column`,gap:1,children:[(0,q.jsxs)(k,{children:[(0,q.jsx)(k,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,q.jsx)(k,{color:`background`,children:`running`}):e.status===`completed`?(0,q.jsx)(k,{color:`success`,children:e.status}):(0,q.jsx)(k,{color:`error`,children:e.status})]}),s.length===0?(0,q.jsx)(k,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,q.jsxs)(q.Fragment,{children:[c>0&&(0,q.jsxs)(k,{dimColor:!0,children:[`(`,c,` earlier `,I(c,`turn`),`)`]}),s.map((e,t)=>(0,q.jsxs)(O,{flexDirection:`column`,children:[(0,q.jsx)(k,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,q.jsxs)(k,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,I(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var q,Ne=e((()=>{H(),N(),C(),le(),q=F()}));async function Pe(e){let t=f(e.id);try{let e=await ie(t,Le);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function Fe({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:i}=M(),[a,o]=(0,J.useState)(()=>Pe(e)),s=(0,J.useDeferredValue)(a);(0,J.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(Pe(t)),1e3,o,e);return()=>clearInterval(t)},[e.id,e.status]);let c=()=>t(`Shell details dismissed`,{display:`system`});E({"confirm:yes":c},{context:`Confirmation`});let l=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())},u=ue(e.command,280);return(0,Y.jsx)(O,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:l,children:(0,Y.jsxs)(P,{title:`Shell details`,onCancel:c,color:`background`,inputGuide:t=>t.pending?(0,Y.jsxs)(k,{children:[`Press `,t.keyName,` again to exit`]}):(0,Y.jsxs)(A,{children:[r&&(0,Y.jsx)(T,{shortcut:`←`,action:`go back`}),(0,Y.jsx)(T,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,Y.jsx)(T,{shortcut:`x`,action:`stop`})]}),children:[(0,Y.jsxs)(O,{flexDirection:`column`,children:[(0,Y.jsxs)(k,{children:[(0,Y.jsx)(k,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,Y.jsxs)(k,{color:`background`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):e.status===`completed`?(0,Y.jsxs)(k,{color:`success`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):(0,Y.jsxs)(k,{color:`error`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]})]}),(0,Y.jsxs)(k,{children:[(0,Y.jsx)(k,{bold:!0,children:`Runtime:`}),` `,R((e.endTime??Date.now())-e.startTime)]}),(0,Y.jsxs)(k,{wrap:`wrap`,children:[(0,Y.jsx)(k,{bold:!0,children:`Command:`}),` `,u]})]}),(0,Y.jsxs)(O,{flexDirection:`column`,children:[(0,Y.jsx)(k,{bold:!0,children:`Output:`}),(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(k,{dimColor:!0,children:`Loading output…`}),children:(0,Y.jsx)(Ie,{outputPromise:s,columns:i})})]})]})})}function Ie({outputPromise:e,columns:t}){let{content:n,bytesTotal:r}=(0,J.use)(e);if(!n)return(0,Y.jsx)(k,{dimColor:!0,children:`No output available`});let i=[],a=n.length;for(let e=0;e<10&&a>0;e++){let e=n.lastIndexOf(`
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{Dn as i,Ec as a,Hl as o,Ip as s,Ju as c,Jx as l,Lp as u,Tc as d,Tn as f,Ul as p,Vl as m,Wl as h,Yi as g,Yu as _,bb as v,dm as ee,ds as te,fs as y,gb as ne,gu as b,hb as x,hu as S,mb as C,mm as w,zp as re}from"./loadAgentsDir-B0Anodo0.js";import{D as T,Gt as E,H as D,I as O,P as k,T as A,ai as j,ot as M,t as N,y as P}from"./src-DL3w8VPk.js";import{t as F}from"./jsx-runtime-Bb4Xn-E0.js";import{_ as ie,f as ae}from"./debug-Bglx1aTu.js";import{Hn as oe,Un as se,Vn as ce}from"./settings-B2jvL8Dp.js";import{l as I,o as le}from"./stringUtils-C718f5ey.js";import{S as ue,_ as L,f as de,l as R,u as fe,y as z}from"./startupProfiler-CJdr3SxP.js";import{_n as pe,gn as me,vn as he}from"./prompt-CJ1l3XXk.js";import{i as ge,t as _e}from"./overlayContext-8--_fbvY.js";function B(e,t,n=1e3,r=0,i){let a=()=>R(Math.max(0,(i??Date.now())-e-r));return(0,V.useSyncExternalStore)((0,V.useCallback)(e=>{if(!t)return()=>{};let r=setInterval(e,n);return()=>clearInterval(r)},[t,n]),a,a)}var V,H=e((()=>{V=t(j(),1),L()}));function ve(e,t,n){let r=me(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,ye.jsxs)(k,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var ye,be=e((()=>{N(),he(),ye=F()}));function xe(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 Se(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 Ce(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(b(t))return n=!0,!1;return n}var we=e((()=>{n(),S()}));function Te({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[i]=D(),a=(0,Ee.useMemo)(()=>d(pe()),[]),o=B(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);E({"confirm:yes":t},{context:`Confirmation`});let s=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},u=l(e.prompt,`plan`),f=e.prompt.length>300?`${e.prompt.substring(0,297)}…`:e.prompt,p=e.result?.totalTokens??e.progress?.tokenCount,m=e.result?.totalToolUseCount??e.progress?.toolUseCount;return(0,U.jsx)(O,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:(0,U.jsx)(P,{title:(0,U.jsxs)(k,{children:[e.selectedAgent?.agentType??`agent`,` › `,e.description||`Async agent`]}),subtitle:(0,U.jsxs)(k,{children:[e.status!==`running`&&(0,U.jsxs)(k,{color:Se(e.status),children:[xe(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,U.jsxs)(k,{dimColor:!0,children:[o,p!==void 0&&p>0&&(0,U.jsxs)(U.Fragment,{children:[` · `,de(p),` tokens`]}),m!==void 0&&m>0&&(0,U.jsxs)(U.Fragment,{children:[` `,`· `,m,` `,m===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,U.jsxs)(k,{children:[`Press `,t.keyName,` again to exit`]}):(0,U.jsxs)(A,{children:[r&&(0,U.jsx)(T,{shortcut:`←`,action:`go back`}),(0,U.jsx)(T,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,U.jsx)(T,{shortcut:`x`,action:`stop`})]}),children:(0,U.jsxs)(O,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,U.jsxs)(O,{flexDirection:`column`,children:[(0,U.jsx)(k,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,U.jsxs)(k,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,ve(t,a,i)]},n))]}),u?(0,U.jsx)(O,{marginTop:1,children:(0,U.jsx)(c,{addMargin:!1,planContent:u})}):(0,U.jsxs)(O,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(k,{bold:!0,dimColor:!0,children:`Prompt`}),(0,U.jsx)(k,{wrap:`wrap`,children:f})]}),e.status===`failed`&&e.error&&(0,U.jsxs)(O,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(k,{bold:!0,color:`error`,children:`Error`}),(0,U.jsx)(k,{color:`error`,wrap:`wrap`,children:e.error})]})]})})})}var Ee,U,De=e((()=>{Ee=t(j(),1),H(),N(),C(),he(),a(),L(),g(),_(),be(),we(),U=F()}));function W({status:e,label:t,suffix:n}){return(0,G.jsxs)(k,{color:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:void 0,dimColor:!0,children:[`(`,t??e,n,`)`]})}function Oe({shell:e}){switch(e.status){case`completed`:return(0,G.jsx)(W,{status:`completed`,label:`done`});case`failed`:return(0,G.jsx)(W,{status:`failed`,label:`error`});case`killed`:return(0,G.jsx)(W,{status:`killed`,label:`stopped`});case`running`:case`pending`:return(0,G.jsx)(W,{status:`running`})}}var G,ke=e((()=>{N(),G=F()}));function Ae({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,K.jsxs)(k,{children:[z(e.command,n,!0),` `,(0,K.jsx)(Oe,{shell:e})]});case`local_agent`:return(0,K.jsxs)(k,{children:[z(e.description,n,!0),` `,(0,K.jsx)(W,{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,K.jsxs)(k,{children:[z(t.workflowName??e.summary??e.description,n,!0),` `,(0,K.jsx)(W,{status:e.status,label:e.status===`running`?`${t.agentCount} ${I(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} ${I(t,`file`)}`:`${e.sessionsReviewing} ${I(e.sessionsReviewing,`session`)}`;return(0,K.jsxs)(k,{children:[e.description,` `,(0,K.jsxs)(k,{dimColor:!0,children:[`· `,e.phase,` · `,n]}),` `,(0,K.jsx)(W,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}}}var K,je=e((()=>{N(),L(),le(),ke(),K=F()}));function Me({task:e,onDone:t,onBack:n,onKill:r}){let i=B(e.startTime,e.status===`running`,1e3,0);E({"confirm:yes":t},{context:`Confirmation`});let a=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&n?(i.preventDefault(),n()):i.key===`x`&&e.status===`running`&&r&&(i.preventDefault(),r())},o=e.turns.filter(e=>e.text!==``),s=o.slice(-6),c=o.length-s.length;return(0,q.jsx)(O,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:a,children:(0,q.jsx)(P,{title:`Memory consolidation`,subtitle:(0,q.jsxs)(k,{dimColor:!0,children:[i,` · reviewing `,e.sessionsReviewing,` `,I(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,q.jsxs)(q.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,I(e.filesTouched.length,`file`),` touched`]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,q.jsxs)(k,{children:[`Press `,t.keyName,` again to exit`]}):(0,q.jsxs)(A,{children:[n&&(0,q.jsx)(T,{shortcut:`←`,action:`go back`}),(0,q.jsx)(T,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,q.jsx)(T,{shortcut:`x`,action:`stop`})]}),children:(0,q.jsxs)(O,{flexDirection:`column`,gap:1,children:[(0,q.jsxs)(k,{children:[(0,q.jsx)(k,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,q.jsx)(k,{color:`background`,children:`running`}):e.status===`completed`?(0,q.jsx)(k,{color:`success`,children:e.status}):(0,q.jsx)(k,{color:`error`,children:e.status})]}),s.length===0?(0,q.jsx)(k,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,q.jsxs)(q.Fragment,{children:[c>0&&(0,q.jsxs)(k,{dimColor:!0,children:[`(`,c,` earlier `,I(c,`turn`),`)`]}),s.map((e,t)=>(0,q.jsxs)(O,{flexDirection:`column`,children:[(0,q.jsx)(k,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,q.jsxs)(k,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,I(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var q,Ne=e((()=>{H(),N(),C(),le(),q=F()}));async function Pe(e){let t=f(e.id);try{let e=await ie(t,Le);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function Fe({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:i}=M(),[a,o]=(0,J.useState)(()=>Pe(e)),s=(0,J.useDeferredValue)(a);(0,J.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(Pe(t)),1e3,o,e);return()=>clearInterval(t)},[e.id,e.status]);let c=()=>t(`Shell details dismissed`,{display:`system`});E({"confirm:yes":c},{context:`Confirmation`});let l=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())},u=ue(e.command,280);return(0,Y.jsx)(O,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:l,children:(0,Y.jsxs)(P,{title:`Shell details`,onCancel:c,color:`background`,inputGuide:t=>t.pending?(0,Y.jsxs)(k,{children:[`Press `,t.keyName,` again to exit`]}):(0,Y.jsxs)(A,{children:[r&&(0,Y.jsx)(T,{shortcut:`←`,action:`go back`}),(0,Y.jsx)(T,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,Y.jsx)(T,{shortcut:`x`,action:`stop`})]}),children:[(0,Y.jsxs)(O,{flexDirection:`column`,children:[(0,Y.jsxs)(k,{children:[(0,Y.jsx)(k,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,Y.jsxs)(k,{color:`background`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):e.status===`completed`?(0,Y.jsxs)(k,{color:`success`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):(0,Y.jsxs)(k,{color:`error`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]})]}),(0,Y.jsxs)(k,{children:[(0,Y.jsx)(k,{bold:!0,children:`Runtime:`}),` `,R((e.endTime??Date.now())-e.startTime)]}),(0,Y.jsxs)(k,{wrap:`wrap`,children:[(0,Y.jsx)(k,{bold:!0,children:`Command:`}),` `,u]})]}),(0,Y.jsxs)(O,{flexDirection:`column`,children:[(0,Y.jsx)(k,{bold:!0,children:`Output:`}),(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(k,{dimColor:!0,children:`Loading output…`}),children:(0,Y.jsx)(Ie,{outputPromise:s,columns:i})})]})]})})}function Ie({outputPromise:e,columns:t}){let{content:n,bytesTotal:r}=(0,J.use)(e);if(!n)return(0,Y.jsx)(k,{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
2
|
`,a-1);i.push(e+1),a=e}i.reverse();let o=r>n.length,s=[];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&&s.push(a)}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(O,{borderStyle:`round`,paddingX:1,flexDirection:`column`,height:12,maxWidth:t-6,children:s.map((e,t)=>(0,Y.jsx)(k,{wrap:`truncate-end`,children:e},t))}),(0,Y.jsxs)(k,{dimColor:!0,italic:!0,children:[`Showing ${s.length} lines`,o?` of ${fe(r)}`:``]})]})}var J,Y,Le,Re=e((()=>{J=t(j(),1),v(),N(),C(),L(),ae(),i(),Y=F(),Le=8192}));function ze(e,t){return Object.values(e??{}).filter(b).filter(e=>!(e.type===`local_agent`&&e.id===t))}function Be({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=u(e=>e.tasks),i=u(e=>e.foregroundedTaskId),a=re(),o=ne(`chat:killAgents`,`Chat`,`ctrl+x ctrl+k`),s=r,c=(0,Z.useRef)(!1),[l,d]=(0,Z.useState)(()=>{if(n)return c.current=!0,{mode:`detail`,itemId:n};let e=ze(s,i);return e.length===1?(c.current=!0,{mode:`detail`,itemId:e[0].id}):{mode:`list`}}),[f,m]=(0,Z.useState)(0);ge(`background-tasks-dialog`);let{bashTasks:h,agentTasks:g,workflowTasks:_,dreamTasks:v,allSelectableItems:y}=(0,Z.useMemo)(()=>{let e=Object.values(s??{}).filter(b).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!==i),r=e.filter(e=>e.type===`local_workflow`),a=e.filter(e=>e.type===`dream`);return{bashTasks:t,agentTasks:n,workflowTasks:r,dreamTasks:a,allSelectableItems:[...t,...n,...r,...a]}},[s,i]),x=y[f]??null;E({"confirm:previous":()=>m(e=>Math.max(0,e-1)),"confirm:next":()=>m(e=>Math.min(y.length-1,e+1)),"confirm:yes":()=>{let e=y[f];e&&d({mode:`detail`,itemId:e.id})}},{context:`Confirmation`,isActive:l.mode===`list`});let S=t=>{if(l.mode!==`list`)return;if(t.key===`left`){t.preventDefault(),e(`Background tasks dialog dismissed`,{display:`system`});return}let n=y[f];n&&t.key===`x`&&(t.preventDefault(),n.type===`local_bash`&&n.status===`running`?C(n.id):n.type===`local_agent`&&n.status===`running`?w(n.id):n.type===`local_workflow`&&n.status===`running`?$(n.id,a):n.type===`dream`&&n.status===`running`&&D(n.id))};async function C(e){await ee.kill(e,a)}async function w(e){await te.kill(e,a)}async function D(e){await p.kill(e,a)}let j=(0,Z.useEffectEvent)(e);(0,Z.useEffect)(()=>{if(l.mode!==`list`){let e=s?.[l.itemId];(!e||e.type!==`local_workflow`&&!b(e))&&(c.current?j(`Background tasks dialog dismissed`,{display:`system`}):d({mode:`list`}))}let e=y.length;f>=e&&e>0&&m(e-1)},[l,s,f,y,j]);let M=()=>{c.current&&y.length<=1?e(`Background tasks dialog dismissed`,{display:`system`}):(c.current=!1,d({mode:`list`}))};if(l.mode!==`list`&&s){let t=s[l.itemId];if(!t)return null;switch(t.type){case`local_bash`:return(0,Q.jsx)(Fe,{shell:t,onDone:e,onKillShell:()=>void C(t.id),onBack:M},`shell-${t.id}`);case`local_agent`:return(0,Q.jsx)(Te,{agent:t,onDone:e,onKillAgent:()=>void w(t.id),onBack:M},`agent-${t.id}`);case`local_workflow`:{let e=t.status===`running`?()=>$(t.id,a):void 0;return(0,Q.jsx)(O,{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)(k,{dimColor:!0,children:[t.status,t.summary?` · ${t.summary}`:``]}),onCancel:M,inputGuide:()=>(0,Q.jsxs)(A,{children:[(0,Q.jsx)(T,{shortcut:`←`,action:`go back`}),(0,Q.jsx)(T,{shortcut:`Esc`,action:`close`}),e&&(0,Q.jsx)(T,{shortcut:`x`,action:`stop`})]}),children:t.status===`failed`&&t.error?(0,Q.jsxs)(k,{color:`error`,children:[`失败原因:`,t.error]}):null})},`workflow-${t.id}`)}case`dream`:return(0,Q.jsx)(Me,{task:t,onDone:()=>e(`Background tasks dialog dismissed`,{display:`system`}),onBack:M,onKill:t.status===`running`?()=>void D(t.id):void 0},`dream-${t.id}`)}}let N=ce(h,e=>e.status===`running`),F=ce(g,e=>e.status===`running`),ie=se([...N>0?[(0,Q.jsxs)(k,{children:[N,` `,N===1?`active shell`:`active shells`]},`shells`)]:[],...F>0?[(0,Q.jsxs)(k,{children:[F,` `,F===1?`active agent`:`active agents`]},`agents`)]:[]],e=>(0,Q.jsx)(k,{children:` · `},`separator-${e}`)),ae=[(0,Q.jsx)(T,{shortcut:`↑/↓`,action:`select`},`upDown`),(0,Q.jsx)(T,{shortcut:`Enter`,action:`view`},`enter`),...(x?.type===`local_bash`||x?.type===`local_agent`||x?.type===`local_workflow`||x?.type===`dream`)&&x.status===`running`?[(0,Q.jsx)(T,{shortcut:`x`,action:`stop`},`kill`)]:[],...g.some(e=>e.status===`running`)?[(0,Q.jsx)(T,{shortcut:o,action:`stop all agents`},`kill-all`)]:[],(0,Q.jsx)(T,{shortcut:`←/Esc`,action:`close`},`esc`)],oe=()=>e(`Background tasks dialog dismissed`,{display:`system`});function I(e){return e.pending?(0,Q.jsxs)(k,{children:[`Press `,e.keyName,` again to exit`]}):(0,Q.jsx)(A,{children:ae})}return(0,Q.jsx)(O,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:S,children:(0,Q.jsx)(P,{title:`Background tasks`,subtitle:ie,onCancel:oe,color:`background`,inputGuide:I,children:y.length===0?(0,Q.jsx)(k,{dimColor:!0,children:`No tasks currently running`}):(0,Q.jsxs)(O,{flexDirection:`column`,children:[h.length>0&&(0,Q.jsxs)(O,{flexDirection:`column`,children:[g.length>0&&(0,Q.jsxs)(k,{dimColor:!0,children:[(0,Q.jsxs)(k,{bold:!0,children:[` `,`Shells`]}),` (`,h.length,`)`]}),(0,Q.jsx)(O,{flexDirection:`column`,children:h.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===x?.id},e.id))})]}),g.length>0&&(0,Q.jsxs)(O,{flexDirection:`column`,marginTop:+(h.length>0),children:[(0,Q.jsxs)(k,{dimColor:!0,children:[(0,Q.jsxs)(k,{bold:!0,children:[` `,`Local agents`]}),` (`,g.length,`)`]}),(0,Q.jsx)(O,{flexDirection:`column`,children:g.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===x?.id},e.id))})]}),_.length>0&&(0,Q.jsxs)(O,{flexDirection:`column`,marginTop:+(h.length>0||g.length>0),children:[(0,Q.jsxs)(k,{dimColor:!0,children:[(0,Q.jsxs)(k,{bold:!0,children:[` `,`Workflows`]}),` (`,_.length,`)`]}),(0,Q.jsx)(O,{flexDirection:`column`,children:_.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===x?.id},e.id))})]}),v.length>0&&(0,Q.jsx)(O,{flexDirection:`column`,marginTop:+(h.length>0||g.length>0||_.length>0),children:(0,Q.jsx)(O,{flexDirection:`column`,children:v.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===x?.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}=M(),i=Math.max(30,n-26);return(0,Q.jsxs)(O,{flexDirection:`row`,children:[(0,Q.jsx)(k,{children:t?`${r.pointer} `:` `}),(0,Q.jsx)(k,{color:t?`suggestion`:void 0,children:(0,Q.jsx)(Ae,{task:e.task,maxActivityWidth:i})})]})}var Z,Q,$,He=e((()=>{n(),Z=t(j(),1),v(),s(),h(),y(),w(),S(),oe(),_e(),N(),C(),x(),De(),je(),Ne(),Re(),m(),Q=F(),$=o}));export{H as a,Ce as i,He as n,B as o,we as r,Be as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{_i as t,gi as n}from"./loadAgentsDir-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{_i as t,gi as n}from"./loadAgentsDir-B0Anodo0.js";import{I as r,Lt as i,P as a,ai as o,kt as s,t as c,y as l}from"./src-DL3w8VPk.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{b as d,h as f}from"./settings-B2jvL8Dp.js";import{n as p,r as m}from"./analytics-DJobLaWP.js";import{t as h}from"./select-DIxfl_VN.js";import{t as g}from"./CustomSelect-wmZ9jz0W.js";var _=e(o(),1);p(),c(),t(),f(),g();var v=u();function y({onAccept:e}){let[t,o]=_.useState(null);_.useEffect(()=>{if(t!==null){let e=t,r=setTimeout(()=>n(e));return()=>clearTimeout(r)}},[t]),_.useEffect(()=>{m(`tengu_bypass_permissions_mode_dialog_shown`,{})},[]);function c(t){switch(t){case`accept`:m(`tengu_bypass_permissions_mode_dialog_accept`,{}),d(`userSettings`,{skipDangerousModePermissionPrompt:!0}),e();break;case`decline`:o(1);break}}let u=(0,_.useCallback)(()=>{o(0)},[]);return t===null?(0,v.jsxs)(l,{title:`WARNING: Work Mate running in Bypass Permissions mode`,color:`error`,onCancel:u,children:[(0,v.jsxs)(r,{flexDirection:`column`,gap:1,children:[(0,v.jsxs)(a,{children:[`In Bypass Permissions mode, Work Mate will not ask for your approval before running potentially dangerous commands.`,(0,v.jsx)(s,{}),`This mode should only be used in a sandboxed container/VM that has restricted internet access and can easily be restored if damaged.`]}),(0,v.jsx)(a,{children:`By proceeding, you accept all responsibility for actions taken while running in Bypass Permissions mode.`}),(0,v.jsx)(i,{url:`https://code.workmate.com/docs/en/security`})]}),(0,v.jsx)(h,{options:[{label:`No, exit`,value:`decline`},{label:`Yes, I accept`,value:`accept`}],onChange:e=>c(e)})]}):null}export{y as BypassPermissionsModeDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t}from"./SelectMulti-BQRHed-d.js";import{n}from"./select-DIxfl_VN.js";var r=e((()=>{t(),n()}));export{r as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{bb as i,gb as a,hb as o,mb as s,vp as c,yp as l}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{bb as i,gb as a,hb as o,mb as s,vp as c,yp as l}from"./loadAgentsDir-B0Anodo0.js";import{C as u,Gt as d,I as f,P as p,T as m,ai as h,ot as g,t as _,y as ee}from"./src-DL3w8VPk.js";import{t as v}from"./jsx-runtime-Bb4Xn-E0.js";import{n as y,t as b}from"./cwd-Pa83R95t.js";import{Ir as x,Lr as S,Mr as C,jn as w,jr as T,wn as E}from"./settings-B2jvL8Dp.js";import{i as D,t as O}from"./execFileNoThrow-BTachNBI.js";import{l as k,o as A}from"./stringUtils-C718f5ey.js";import{_ as te,x as ne}from"./startupProfiler-CJdr3SxP.js";import{i as re,t as ie}from"./overlayContext-8--_fbvY.js";import{r as ae}from"./detectRepository-CfX8Lc0A.js";import{join as oe,resolve as j}from"path";import{access as M}from"fs/promises";async function se(){if(!await C()||await P())return null;let{stdout:e,code:t}=await O(x(),[`--no-optional-locks`,`diff`,`HEAD`,`--shortstat`],{timeout:F,preserveOutputOnError:!1});if(t===0){let t=de(e);if(t&&t.filesCount>z)return{stats:t,perFileStats:new Map,hunks:new Map}}let{stdout:n,code:r}=await O(x(),[`--no-optional-locks`,`diff`,`HEAD`,`--numstat`],{timeout:F,preserveOutputOnError:!1});if(r!==0)return null;let{stats:i,perFileStats:a}=le(n),o=I-a.size;if(o>0){let e=await ue(o);if(e){i.filesCount+=e.size;for(let[t,n]of e)a.set(t,n)}}return{stats:i,perFileStats:a,hunks:new Map}}async function ce(){if(!await C()||await P())return new Map;let{stdout:e,code:t}=await O(x(),[`--no-optional-locks`,`diff`,`HEAD`],{timeout:F,preserveOutputOnError:!1});return t===0?N(e):new Map}function le(e){let t=e.trim().split(`
|
|
2
2
|
`).filter(Boolean),n=0,r=0,i=0,a=new Map;for(let e of t){let t=e.split(` `);if(t.length<3)continue;i++;let o=t[0],s=t[1],c=t.slice(2).join(` `),l=o===`-`||s===`-`,u=l?0:parseInt(o??`0`,10)||0,d=l?0:parseInt(s??`0`,10)||0;n+=u,r+=d,a.size<I&&a.set(c,{added:u,removed:d,isBinary:l})}return{stats:{filesCount:i,linesAdded:n,linesRemoved:r},perFileStats:a}}function N(e){let t=new Map;if(!e.trim())return t;let n=e.split(/^diff --git /m).filter(Boolean);for(let e of n){if(t.size>=I)break;if(e.length>L)continue;let n=e.split(`
|
|
3
3
|
`),r=n[0]?.match(/^a\/(.+?) b\/(.+)$/);if(!r)continue;let i=r[2]??r[1]??``,a=[],o=null,s=0;for(let e=1;e<n.length;e++){let t=n[e]??``,r=t.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);if(r){o&&a.push(o),o={oldStart:parseInt(r[1]??`0`,10),oldLines:parseInt(r[2]??`1`,10),newStart:parseInt(r[3]??`0`,10),newLines:parseInt(r[4]??`1`,10),lines:[]};continue}if(!(t.startsWith(`index `)||t.startsWith(`---`)||t.startsWith(`+++`)||t.startsWith(`new file`)||t.startsWith(`deleted file`)||t.startsWith(`old mode`)||t.startsWith(`new mode`)||t.startsWith(`Binary files`))&&o&&(t.startsWith(`+`)||t.startsWith(`-`)||t.startsWith(` `)||t===``)){if(s>=R)continue;o.lines.push(`${t}`),s++}}o&&a.push(o),a.length>0&&t.set(i,a)}return t}async function P(){let e=await T(b());return e?(await Promise.all([`MERGE_HEAD`,`REBASE_HEAD`,`CHERRY_PICK_HEAD`,`REVERT_HEAD`].map(t=>M(oe(e,t)).then(()=>!0).catch(()=>!1)))).some(Boolean):!1}async function ue(e){let{stdout:t,code:n}=await O(x(),[`--no-optional-locks`,`ls-files`,`--others`,`--exclude-standard`],{timeout:F,preserveOutputOnError:!1});if(n!==0||!t.trim())return null;let r=t.trim().split(`
|
|
4
4
|
`).filter(Boolean);if(r.length===0)return null;let i=new Map;for(let t of r.slice(0,e))i.set(t,{added:0,removed:0,isBinary:!1,isUntracked:!0});return i}function de(e){let t=e.match(/(\d+)\s+files?\s+changed(?:,\s+(\d+)\s+insertions?\(\+\))?(?:,\s+(\d+)\s+deletions?\(-\))?/);return t?{filesCount:parseInt(t[1]??`0`,10),linesAdded:parseInt(t[2]??`0`,10),linesRemoved:parseInt(t[3]??`0`,10)}:null}var F,I,L,R,z,B=e((()=>{y(),ae(),D(),E(),S(),F=5e3,I=50,L=1e6,R=400,z=500}));function V(){let[e,t]=(0,H.useState)(null),[n,r]=(0,H.useState)(new Map),[i,a]=(0,H.useState)(!0);return(0,H.useEffect)(()=>{let e=!1;async function n(){try{let[n,i]=await Promise.all([se(),ce()]);e||(t(n),r(i),a(!1))}catch{e||(t(null),r(new Map),a(!1))}}return n(),()=>{e=!0}},[]),(0,H.useMemo)(()=>{if(!e)return{stats:null,files:[],hunks:new Map,loading:i};let{stats:t,perFileStats:r}=e,a=[];for(let[e,t]of r){let r=n.get(e),i=t.isUntracked??!1,o=!t.isBinary&&!i&&!r,s=t.added+t.removed,c=!o&&!t.isBinary&&s>U;a.push({path:e,linesAdded:t.added,linesRemoved:t.removed,isBinary:t.isBinary,isLargeFile:o,isTruncated:c,isUntracked:i})}return a.sort((e,t)=>e.path.localeCompare(t.path)),{stats:t,files:a,hunks:n,loading:!1}},[e,n,i])}var H,U,fe=e((()=>{H=t(h(),1),B(),U=400}));function W(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.filePath==`string`,r=Array.isArray(t.structuredPatch)&&t.structuredPatch.length>0,i=t.type===`create`&&typeof t.content==`string`;return n&&(r||i)}function pe(e){return`type`in e&&(e.type===`create`||e.type===`update`)}function me(e){let t=0,n=0;for(let r of e)for(let e of r.lines)e.startsWith(`+`)?t++:e.startsWith(`-`)&&n++;return{added:t,removed:n}}function he(e){if(e.type!==`user`)return``;let t=e.message.content,n=typeof t==`string`?t:``;return n.length<=30?n:`${n.slice(0,29)}…`}function G(e){let t=0,n=0;for(let r of e.files.values())t+=r.linesAdded,n+=r.linesRemoved;e.stats={filesChanged:e.files.size,linesAdded:t,linesRemoved:n}}function ge(e){let t=(0,K.useRef)({completedTurns:[],currentTurn:null,lastProcessedIndex:0,lastTurnIndex:0});return(0,K.useMemo)(()=>{let n=t.current;e.length<n.lastProcessedIndex&&(n.completedTurns=[],n.currentTurn=null,n.lastProcessedIndex=0,n.lastTurnIndex=0);for(let t=n.lastProcessedIndex;t<e.length;t++){let r=e[t];if(r?.type===`user`){if(!(r.toolUseResult||Array.isArray(r.message.content)&&r.message.content[0]?.type===`tool_result`)&&!r.isMeta)n.currentTurn&&n.currentTurn.files.size>0&&(G(n.currentTurn),n.completedTurns.push(n.currentTurn)),n.lastTurnIndex++,n.currentTurn={turnIndex:n.lastTurnIndex,userPromptPreview:he(r),timestamp:r.timestamp,files:new Map,stats:{filesChanged:0,linesAdded:0,linesRemoved:0}};else if(n.currentTurn&&r.toolUseResult){let e=r.toolUseResult;if(W(e)){let{filePath:t,structuredPatch:r}=e,i=`type`in e&&e.type===`create`,a=n.currentTurn.files.get(t);if(a||(a={filePath:t,hunks:[],isNewFile:i,linesAdded:0,linesRemoved:0},n.currentTurn.files.set(t,a)),i&&r.length===0&&pe(e)){let t=e.content.split(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./Doctor-DqW6j3_B.js";e();export{t as Doctor};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{i as n,o as r}from"./envUtils-DfkgIdYf.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$b as o,Dh as s,Dl as c,Eh as l,Ip as u,Ji as d,Kx as f,Lp as p,Ol as ee,Qb as m,Xb as te,Yb as ne,Zb as h,__ as g,aw as _,cw as v,gC as y,g_ as b,iw as x,kl as S,mb as re,ow as ie,p_ as C,qi as ae,qx as w,yC as T,y_ as oe}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{i as n,o as r}from"./envUtils-DfkgIdYf.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$b as o,Dh as s,Dl as c,Eh as l,Ip as u,Ji as d,Kx as f,Lp as p,Ol as ee,Qb as m,Xb as te,Yb as ne,Zb as h,__ as g,aw as _,cw as v,gC as y,g_ as b,iw as x,kl as S,mb as re,ow as ie,p_ as C,qi as ae,qx as w,yC as T,y_ as oe}from"./loadAgentsDir-B0Anodo0.js";import{Gt as se,I as E,P as D,ai as ce,t as O,x as k}from"./src-DL3w8VPk.js";import{t as A}from"./jsx-runtime-Bb4Xn-E0.js";import{It as j,J as M}from"./state-B4jiUise.js";import{R as N,V as P,kn as F,wn as I}from"./settings-B2jvL8Dp.js";import{l as L,o as R}from"./stringUtils-C718f5ey.js";import{_t as z,bt as B,d as V,o as H}from"./model-BvQFFOf8.js";import{n as U,t as W}from"./ValidationErrorsList-DgNzJQUP.js";import{n as G,t as le}from"./useExitOnCtrlCDWithKeybindings-BKwzUpgb.js";import{f as ue,g as de,h as fe,i as pe,n as me,o as he,p as ge,r as _e}from"./pidLock-Cm4sW35f.js";import{n as ve,t as ye}from"./McpParsingWarnings-Bff66RtJ.js";import{n as be,t as xe}from"./PressEnterToContinue-DZc_s_pE.js";import{n as Se,t as Ce}from"./useSettingsErrors-SFPWfxsA.js";import{n as we,t as Te}from"./shadowedRuleDetection-Bg_aIc5Z.js";import{n as Ee,r as De,t as K}from"./statusNoticeHelpers-BRQpUIlH.js";import{join as q}from"path";function Oe(){if(!v())return null;let e=x();if(e.length===0)return null;let t=e.filter(e=>e.severity===`error`),n=e.filter(e=>e.severity===`warning`);return(0,J.jsxs)(E,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,J.jsx)(D,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{dimColor:!0,children:`Location: `}),(0,J.jsx)(D,{dimColor:!0,children:_()})]}),(0,J.jsxs)(E,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,J.jsxs)(E,{flexDirection:`column`,children:[(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{dimColor:!0,children:`└ `}),(0,J.jsx)(D,{color:`error`,children:`[Error]`}),(0,J.jsxs)(D,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(E,{marginLeft:3,children:(0,J.jsxs)(D,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,J.jsxs)(E,{flexDirection:`column`,children:[(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{dimColor:!0,children:`└ `}),(0,J.jsx)(D,{color:`warning`,children:`[Warning]`}),(0,J.jsxs)(D,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(E,{marginLeft:3,children:(0,J.jsxs)(D,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var J,ke=e((()=>{O(),ie(),J=A()}));function Ae(){if(!y.isSupportedPlatform()||!y.isSandboxEnabledInSettings())return null;let e=y.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,Y.jsxs)(E,{flexDirection:`column`,children:[(0,Y.jsx)(D,{bold:!0,children:`Sandbox`}),(0,Y.jsxs)(D,{children:[`└ Status: `,(0,Y.jsx)(D,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,Y.jsxs)(D,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,Y.jsxs)(D,{color:`warning`,children:[`└ `,e]},t)),t&&(0,Y.jsx)(D,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var Y,je=e((()=>{O(),T(),Y=A()}));async function Me(){let e=b(await g());if(e.length===0)return null;let t=e.sort((e,t)=>t.content.length-e.content.length).map(e=>`${e.path}: ${e.content.length.toLocaleString()} chars`);return{type:`agentsmd_files`,severity:`warning`,message:e.length===1?`Large AGENTS.md file detected (${e[0].content.length.toLocaleString()} chars > ${C.toLocaleString()})`:`${e.length} large AGENTS.md files detected (each > ${C.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:C}}async function Ne(e){if(!e)return null;let t=Ee(e);if(t<=15e3)return null;let n=e.activeAgents.filter(e=>e.source!==`built-in`).map(e=>{let t=`${e.agentType}: ${e.whenToUse}`;return{name:e.agentType,tokens:d(t)}}).sort((e,t)=>t.tokens-e.tokens),r=n.slice(0,5).map(e=>`${e.name}: ~${e.tokens.toLocaleString()} tokens`);return n.length>5&&r.push(`(${n.length-5} more custom agents)`),{type:`agent_descriptions`,severity:`warning`,message:`Large agent descriptions (~${t.toLocaleString()} tokens > ${K.toLocaleString()})`,details:r,currentValue:t,threshold:K}}async function X(e,t,n){let r=e.filter(e=>e.isMcp);if(r.length===0)return null;try{let{mcpToolTokens:r,mcpToolDetails:i}=await l(e,t,n,H());if(r<=Z)return null;let a=new Map;for(let e of i){let t=e.name.split(`__`)[1]||`unknown`,n=a.get(t)||{count:0,tokens:0};a.set(t,{count:n.count+1,tokens:n.tokens+e.tokens})}let o=Array.from(a.entries()).sort((e,t)=>t[1].tokens-e[1].tokens),s=o.slice(0,5).map(([e,t])=>`${e}: ${t.count} tools (~${t.tokens.toLocaleString()} tokens)`);return o.length>5&&s.push(`(${o.length-5} more servers)`),{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${r.toLocaleString()} tokens > ${Z.toLocaleString()})`,details:s,currentValue:r,threshold:Z}}catch{let e=r.reduce((e,t)=>e+d(((t.name?.length||0)+t.description.length).toString()),0);return e<=Z?null:{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${e.toLocaleString()} tokens estimated > ${Z.toLocaleString()})`,details:[`${r.length} MCP tools detected (token count estimated)`],currentValue:e,threshold:Z}}}async function Pe(e){let t=Te(await e(),{sandboxAutoAllowEnabled:y.isSandboxingEnabled()&&y.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${P(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${L(t.length,`unreachable permission rule`)} detected`,details:n,currentValue:t.length,threshold:0}}async function Fe(e,t,n){let[r,i,a,o]=await Promise.all([Me(),Ne(t),X(e,n,t),Pe(n)]);return{agentsMdWarning:r,agentWarning:i,mcpWarning:a,unreachableRulesWarning:o}}var Z,Ie=e((()=>{ae(),s(),oe(),V(),N(),we(),T(),De(),R(),Z=25e3}));function Le({onDone:e}){let t=p(e=>e.agentDefinitions),r=p(e=>e.mcp.tools),i=p(e=>e.toolPermissionContext),s=p(e=>e.plugins.errors);G();let l=(0,Q.useMemo)(()=>r||[],[r]),[u,d]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(null),b=Se().filter(e=>e.mcpErrorMetadata===void 0),x=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:ne,upperLimit:te},{name:`TASK_MAX_OUTPUT_LENGTH`,default:c,upperLimit:ee},{name:`CLAUDE_CODE_MAX_OUTPUT_TOKENS`,...z(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=o(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{fe().then(d),(async()=>{let e=q(n(),`agents`),r=q(M(),`.workmate`,`agents`),{activeAgents:a,allAgents:o,failedFiles:s}=t,[c,u]=await Promise.all([F(e),F(r)]),d={activeAgents:a.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:r,userDirExists:c,projectDirExists:u,failedFiles:s};h(d);let f=await Fe(l,{activeAgents:a,allAgents:o,failedFiles:s},async()=>i);if(_(f),he()){let e=q(ue(),`claude`,`locks`),t=me(e),n=_e(e);y({enabled:!0,locks:n,locksDir:e,staleLocksCleaned:t})}else y({enabled:!1,locks:[],locksDir:``,staleLocksCleaned:0})})()},[i,l,t]);let S=(0,Q.useCallback)(()=>{e(`Work Mate diagnostics dismissed`,{display:`system`})},[e]);return se({"confirm:yes":S,"confirm:no":S},{context:`Confirmation`}),u?(0,$.jsxs)(k,{children:[(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Diagnostics`}),(0,$.jsxs)(D,{children:[`└ Currently running: `,u.installationType,` (`,u.version,`)`]}),u.packageManager&&(0,$.jsxs)(D,{children:[`└ Package manager: `,u.packageManager]}),(0,$.jsxs)(D,{children:[`└ Path: `,u.installationPath]}),(0,$.jsxs)(D,{children:[`└ Invoked: `,u.invokedBinary]}),(0,$.jsxs)(D,{children:[`└ Config install method: `,u.configInstallMethod]}),(0,$.jsxs)(D,{children:[`└ Search: `,u.ripgrepStatus.working?`OK`:`Not working`,` (`,u.ripgrepStatus.mode===`embedded`?`bundled`:u.ripgrepStatus.mode===`builtin`?`vendor`:u.ripgrepStatus.systemPath||`system`,`)`]}),u.ripgrepStatus.note&&(0,$.jsxs)(D,{color:`warning`,children:[`└ Note: `,u.ripgrepStatus.note]}),u.recommendation&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{}),(0,$.jsxs)(D,{color:`warning`,children:[`Recommendation: `,u.recommendation.split(`
|
|
2
2
|
`)[0]]}),(0,$.jsx)(D,{dimColor:!0,children:u.recommendation.split(`
|
|
3
3
|
`)[1]})]}),u.multipleInstallations.length>1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{}),(0,$.jsx)(D,{color:`warning`,children:`Warning: Multiple installations found`}),u.multipleInstallations.map((e,t)=>(0,$.jsxs)(D,{children:[`└ `,e.type,` at `,e.path]},t))]}),u.warnings.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{}),u.warnings.map((e,t)=>(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsxs)(D,{color:`warning`,children:[`Warning: `,e.issue]}),(0,$.jsxs)(D,{children:[`Fix: `,e.fix]})]},t))]}),b.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,$.jsx)(D,{bold:!0,children:`Invalid Settings`}),(0,$.jsx)(W,{errors:b})]})]}),(0,$.jsx)(Ae,{}),(0,$.jsx)(ye,{}),(0,$.jsx)(Oe,{}),x.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Environment Variables`}),x.map((e,t)=>(0,$.jsxs)(D,{children:[`└ `,e.name,`:`,` `,(0,$.jsx)(D,{color:e.status===`capped`?`warning`:`error`,children:e.message})]},t))]}),v?.enabled&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Version Locks`}),v.staleLocksCleaned>0&&(0,$.jsxs)(D,{dimColor:!0,children:[`└ Cleaned `,v.staleLocksCleaned,` stale lock(s)`]}),v.locks.length===0?(0,$.jsx)(D,{dimColor:!0,children:`└ No active version locks`}):v.locks.map((e,t)=>(0,$.jsxs)(D,{children:[`└ `,e.version,`: PID `,e.pid,` `,e.isProcessRunning?(0,$.jsx)(D,{children:`(running)`}):(0,$.jsx)(D,{color:`warning`,children:`(stale)`})]},t))]}),m?.failedFiles&&m.failedFiles.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,color:`error`,children:`Agent Parse Errors`}),(0,$.jsxs)(D,{color:`error`,children:[`└ Failed to parse `,m.failedFiles.length,` agent file(s):`]}),m.failedFiles.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e.path,`: `,e.error]},t))]}),s.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,color:`error`,children:`Plugin Errors`}),(0,$.jsxs)(D,{color:`error`,children:[`└ `,s.length,` plugin error(s) detected:`]}),s.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e.source||`unknown`,`plugin`in e&&e.plugin?` [${e.plugin}]`:``,`: `,f(e)]},t))]}),g?.unreachableRulesWarning&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,color:`warning`,children:`Unreachable Permission Rules`}),(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,g.unreachableRulesWarning.message]})]}),g.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]}),g&&(g.agentsMdWarning||g.agentWarning||g.mcpWarning)&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Context Usage Warnings`}),g.agentsMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,g.agentsMdWarning.message]})]}),(0,$.jsxs)(D,{children:[` `,`└ Files:`]}),g.agentsMdWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]}),g.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,g.agentWarning.message]})]}),(0,$.jsxs)(D,{children:[` `,`└ Top contributors:`]}),g.agentWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]}),g.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,g.mcpWarning.message]})]}),(0,$.jsxs)(D,{children:[` `,`└ MCP servers:`]}),g.mcpWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(E,{children:(0,$.jsx)(xe,{})})]}):(0,$.jsx)(k,{children:(0,$.jsx)(D,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,Re=e((()=>{i(),Q=t(ce(),1),ke(),ve(),B(),r(),j(),O(),be(),je(),U(),Ce(),le(),re(),u(),w(),Ie(),de(),m(),I(),pe(),h(),S(),ge(),$=A()}));export{Re as n,Le as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{AC as r,Aw as i,Ct as a,Nb as o,Pb as s,_i as c,_r as l,dt as u,hi as d,jC as f,kw as p,li as m,vt as h,wt as g,xt as _}from"./loadAgentsDir-
|
|
1
|
+
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{AC as r,Aw as i,Ct as a,Nb as o,Pb as s,_i as c,_r as l,dt as u,hi as d,jC as f,kw as p,li as m,vt as h,wt as g,xt as _}from"./loadAgentsDir-B0Anodo0.js";import{I as v,P as y,ai as b,t as x,y as S}from"./src-DL3w8VPk.js";import{t as C}from"./jsx-runtime-Bb4Xn-E0.js";import{c as w,i as T}from"./debug-Bglx1aTu.js";import{i as E,t as D}from"./execFileNoThrow-BTachNBI.js";import{n as O,r as k}from"./analytics-DJobLaWP.js";import{n as A,t as j}from"./select-DIxfl_VN.js";import{r as M,t as N}from"./Spinner-ByQXTvAA.js";function P(){(l(),e(m)).saveWorktreeState(null)}function F({onDone:e,onCancel:t}){let[n,r]=(0,I.useState)(`loading`),[i,o]=(0,I.useState)([]),[c,l]=(0,I.useState)(0),[d,f]=(0,I.useState)(),m=h();if((0,I.useEffect)(()=>{async function e(){let e=[],t=await D(`git`,[`status`,`--porcelain`]);if(t.stdout&&(e=t.stdout.split(`
|
|
2
2
|
`).filter(e=>e.trim()!==``),o(e)),m){let{stdout:t}=await D(`git`,[`rev-list`,`--count`,`${m.originalHeadCommit}..HEAD`]),n=parseInt(t.trim(),10)||0;if(l(n),e.length===0&&n===0){r(`removing`),u().then(()=>{process.chdir(m.originalCwd),s(m.originalCwd),P(),p.cache.clear?.(),f(`Worktree removed (no changes)`)}).catch(e=>{w(`Failed to clean up worktree: ${e}`,{level:`error`}),f(`Worktree cleanup failed, exiting anyway`)}).then(()=>{r(`done`)});return}else r(`asking`)}}e()},[m]),(0,I.useEffect)(()=>{n===`done`&&e(d)},[n,e,d]),!m)return e(`No active worktree session found`,{display:`system`}),null;if(n===`loading`||n===`done`)return null;async function _(e){if(!m)return;let t=!!m.tmuxSessionName;if(e===`keep`||e===`keep-with-tmux`)r(`keeping`),k(`tengu_worktree_kept`,{commits:c,changed_files:i.length}),await a(),process.chdir(m.originalCwd),s(m.originalCwd),P(),p.cache.clear?.(),f(t?`Worktree kept. Your work is saved at ${m.worktreePath} on branch ${m.worktreeBranch}. Reattach to tmux session with: tmux attach -t ${m.tmuxSessionName}`:`Worktree kept. Your work is saved at ${m.worktreePath} on branch ${m.worktreeBranch}`),r(`done`);else if(e===`keep-kill-tmux`)r(`keeping`),k(`tengu_worktree_kept`,{commits:c,changed_files:i.length}),m.tmuxSessionName&&await g(m.tmuxSessionName),await a(),process.chdir(m.originalCwd),s(m.originalCwd),P(),p.cache.clear?.(),f(`Worktree kept at ${m.worktreePath} on branch ${m.worktreeBranch}. Tmux session terminated.`),r(`done`);else if(e===`remove`||e===`remove-with-tmux`){r(`removing`),k(`tengu_worktree_removed`,{commits:c,changed_files:i.length}),m.tmuxSessionName&&await g(m.tmuxSessionName);try{await u(),process.chdir(m.originalCwd),s(m.originalCwd),P(),p.cache.clear?.()}catch(e){w(`Failed to clean up worktree: ${e}`,{level:`error`}),f(`Worktree cleanup failed, exiting anyway`),r(`done`);return}let e=t?` Tmux session terminated.`:``;c>0&&i.length>0?f(`Worktree removed. ${c} ${c===1?`commit`:`commits`} and uncommitted changes were discarded.${e}`):c>0?f(`Worktree removed. ${c} ${c===1?`commit`:`commits`} on ${m.worktreeBranch} ${c===1?`was`:`were`} discarded.${e}`):i.length>0?f(`Worktree removed. Uncommitted changes were discarded.${e}`):f(`Worktree removed.${e}`),r(`done`)}}if(n===`keeping`)return(0,L.jsxs)(v,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(N,{}),(0,L.jsx)(y,{children:`Keeping worktree…`})]});if(n===`removing`)return(0,L.jsxs)(v,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(N,{}),(0,L.jsx)(y,{children:`Removing worktree…`})]});let b=m.worktreeBranch,x=i.length>0,C=c>0,T=``;T=x&&C?`You have ${i.length} uncommitted ${i.length===1?`file`:`files`} and ${c} ${c===1?`commit`:`commits`} on ${b}. All will be lost if you remove.`:x?`You have ${i.length} uncommitted ${i.length===1?`file`:`files`}. These will be lost if you remove the worktree.`:C?`You have ${c} ${c===1?`commit`:`commits`} on ${b}. The branch will be deleted if you remove the worktree.`:`You are working in a worktree. Keep it to continue working there, or remove it to clean up.`;function E(){if(t){t();return}_(`keep`)}let O=x||C?`All changes and commits will be lost.`:`Clean up the worktree directory.`,A=!!m.tmuxSessionName,M=A?[{label:`Keep worktree and tmux session`,value:`keep-with-tmux`,description:`Stays at ${m.worktreePath}. Reattach with: tmux attach -t ${m.tmuxSessionName}`},{label:`Keep worktree, kill tmux session`,value:`keep-kill-tmux`,description:`Keeps worktree at ${m.worktreePath}, terminates tmux session.`},{label:`Remove worktree and tmux session`,value:`remove-with-tmux`,description:O}]:[{label:`Keep worktree`,value:`keep`,description:`Stays at ${m.worktreePath}`},{label:`Remove worktree`,value:`remove`,description:O}];return(0,L.jsx)(S,{title:`Exiting worktree session`,subtitle:T,onCancel:E,children:(0,L.jsx)(j,{defaultFocusValue:A?`keep-with-tmux`:`keep`,options:M,onChange:_})})}var I,L,R=t((()=>{I=n(b(),1),O(),T(),x(),E(),i(),o(),_(),A(),M(),L=C()}));function z(){return f(H)??`Goodbye!`}function B({showWorktree:e,onDone:t,onCancel:n}){async function r(e){t(e??z()),await d(0,`prompt_input_exit`)}return e?(0,V.jsx)(F,{onDone:r,onCancel:n}):null}var V,H,U=t((()=>{r(),c(),R(),V=C(),H=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}));export{U as n,B as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,I as n,Lt as r,P as i,T as a,ai as o,t as s,y as c}from"./src-DL3w8VPk.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,r as d}from"./analytics-DJobLaWP.js";import{t as f}from"./select-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,I as n,Lt as r,P as i,T as a,ai as o,t as s,y as c}from"./src-DL3w8VPk.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,r as d}from"./analytics-DJobLaWP.js";import{t as f}from"./select-DIxfl_VN.js";import{i as p,r as m,s as h,t as g}from"./grove-O6qp7ITR.js";import{t as _}from"./CustomSelect-wmZ9jz0W.js";var v=e(o(),1);u(),s(),_();var y=l(),b=` _____________
|
|
2
2
|
| \\ \\
|
|
3
3
|
| NEW TERMS \\__\\
|
|
4
4
|
| |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ip as e,Pp as t}from"./loadAgentsDir-
|
|
1
|
+
import{Ip as e,Pp as t}from"./loadAgentsDir-B0Anodo0.js";import{I as n,P as r,kn as i,t as a,y as o}from"./src-DL3w8VPk.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{C as c,T as l,x as u}from"./debug-Bglx1aTu.js";import{t as d}from"./KeybindingProviderSetup-D49HHTXD.js";import{t as f}from"./select-DIxfl_VN.js";import{t as p}from"./CustomSelect-wmZ9jz0W.js";import{t as m}from"./renderOptions-DV0dn0IW.js";a(),e(),u(),p();var h=s();function g({filePath:e,errorDescription:t,onExit:i,onReset:a}){return(0,h.jsxs)(o,{title:`Configuration Error`,color:`error`,onCancel:i,children:[(0,h.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,h.jsxs)(r,{children:[`The configuration file at `,(0,h.jsx)(r,{bold:!0,children:e}),` contains invalid JSON.`]}),(0,h.jsx)(r,{children:t})]}),(0,h.jsxs)(n,{flexDirection:`column`,children:[(0,h.jsx)(r,{bold:!0,children:`Choose an option:`}),(0,h.jsx)(f,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Reset with default configuration`,value:`reset`}],onChange:e=>{e===`exit`?i():a()},onCancel:i})]})]})}var _=`dark`;async function v({error:e}){let n={...m(!1),theme:_};await new Promise(async r=>{let{unmount:a}=await i((0,h.jsx)(t,{children:(0,h.jsx)(d,{children:(0,h.jsx)(g,{filePath:e.filePath,errorDescription:e.message,onExit:()=>{a(),r(),process.exit(1)},onReset:()=>{l(e.filePath,c(e.defaultConfig,null,2),{flush:!1,encoding:`utf8`}),a(),r(),process.exit(0)}})})}),n)})}export{v as showInvalidConfigDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as e,t,y as n}from"./src-DL3w8VPk.js";import{t as r}from"./jsx-runtime-Bb4Xn-E0.js";import{n as i,t as a}from"./ValidationErrorsList-DgNzJQUP.js";import{t as o}from"./select-
|
|
1
|
+
import{P as e,t,y as n}from"./src-DL3w8VPk.js";import{t as r}from"./jsx-runtime-Bb4Xn-E0.js";import{n as i,t as a}from"./ValidationErrorsList-DgNzJQUP.js";import{t as o}from"./select-DIxfl_VN.js";import{t as s}from"./CustomSelect-wmZ9jz0W.js";t(),s(),i();var c=r();function l({settingsErrors:t,onContinue:r,onExit:i}){function s(e){e===`exit`?i():r()}return(0,c.jsxs)(n,{title:`Settings Error`,onCancel:i,color:`warning`,children:[(0,c.jsx)(a,{errors:t}),(0,c.jsx)(e,{dimColor:!0,children:`Files with errors are skipped entirely, not just the invalid settings.`}),(0,c.jsx)(o,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Continue without these settings`,value:`continue`}],onChange:s})]})}export{l as InvalidSettingsDialog};
|
package/dist/chunks/{KeybindingProviderSetup-DA37QUFs.js → KeybindingProviderSetup-D49HHTXD.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{lw as t,ow as n,sw as r,uw as i}from"./loadAgentsDir-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{lw as t,ow as n,sw as r,uw as i}from"./loadAgentsDir-B0Anodo0.js";import{Vt as a,ai as o,t as s}from"./src-DL3w8VPk.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{c as l,i as u}from"./debug-Bglx1aTu.js";import{Hn as d,Vn as f}from"./settings-B2jvL8Dp.js";import{l as p,o as m}from"./stringUtils-C718f5ey.js";import{n as h,t as g}from"./notifications-Bc6k-Ozy.js";var _=e(o(),1);g(),d(),u(),m(),s(),n();var v=c();function y({children:e}){let{addNotification:n,removeNotification:o}=h();return(0,v.jsx)(a,{loadBindings:t,subscribeToChanges:i,initWatcher:r,onWarnings:(0,_.useCallback)((e,t)=>{let r=`keybinding-config-warning`;if(e.length===0){o(r);return}let i=f(e,e=>e.severity===`error`),a=f(e,e=>e.severity===`warning`),s;s=i>0&&a>0?`Found ${i} keybinding ${p(i,`error`)} and ${a} ${p(a,`warning`)}`:i>0?`Found ${i} keybinding ${p(i,`error`)}`:`Found ${a} keybinding ${p(a,`warning`)}`,s+=` · /doctor for details`,n({key:r,text:s,color:i>0?`error`:`warning`,priority:i>0?`immediate`:`high`,timeoutMs:6e4})},[n,o]),onDebugLog:l,children:e})}export{y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$_ as n,By as r,Dv as i,Ev as a,Fy as o,Ip as s,Iy as c,J_ as l,K_ as u,Lp as d,Mv as f,Ov as p,Q_ as m,Qv as ee,Rp as te,X_ as h,Y_ as g,Zv as ne,gv as _,lv as v,rv as y,tv as b,zp as re,zy as x}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$_ as n,By as r,Dv as i,Ev as a,Fy as o,Ip as s,Iy as c,J_ as l,K_ as u,Lp as d,Mv as f,Ov as p,Q_ as m,Qv as ee,Rp as te,X_ as h,Y_ as g,Zv as ne,gv as _,lv as v,rv as y,tv as b,zp as re,zy as x}from"./loadAgentsDir-B0Anodo0.js";import{ai as S}from"./src-DL3w8VPk.js";import{t as C}from"./jsx-runtime-Bb4Xn-E0.js";import{It as w,st as ie}from"./state-B4jiUise.js";import{I as T,M as E,c as D,i as O}from"./debug-Bglx1aTu.js";import{rt as k,tt as A}from"./settings-B2jvL8Dp.js";import{c as j,l as M,o as ae}from"./log-D2TIwHBV.js";import{n as N,r as P}from"./analytics-DJobLaWP.js";import{o as F,t as I}from"./localSearch-BxLYi6w_.js";import{i as L,n as R,r as z,t as B}from"./reject-DtcCfuZV.js";import{n as V,t as H}from"./notifications-Bc6k-Ozy.js";function U(e){let t=`plugin`in e?e.plugin:`no-plugin`;return`${e.type}:${e.source}:${t}`}function W(e,t){t.length!==0&&e(e=>{let n=new Set(e.plugins.errors.map(e=>U(e))),r=t.filter(e=>!n.has(U(e)));return r.length===0?e:{...e,plugins:{...e.plugins,errors:[...e.plugins.errors,...r]}}})}function G(e,t=!1){let n=te(),r=d(e=>e.mcp.pluginReconnectKey),i=re(),s=(0,q.useRef)(new Map),{addNotification:ne}=V(),_=(0,q.useRef)([]),S=(0,q.useRef)(null),C=(0,q.useCallback)(()=>{S.current=null;let e=_.current;e.length!==0&&(_.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,s=a.type===`disabled`||a.type===`failed`?r??[]:r,c=a.type===`disabled`||a.type===`failed`?i??[]:i,l=A(a.name),u=n.clients.findIndex(e=>e.name===a.name)===-1?[...n.clients,a]:n.clients.map(e=>e.name===a.name?a:e),d=o===void 0?n.tools:[...R(n.tools,e=>e.name?.startsWith(l)),...o],f=s===void 0?n.commands:[...R(n.commands,e=>y(e,a.name)),...s],p=c===void 0?n.resources:{...n.resources,...c.length>0?{[a.name]:c}:L(n.resources,a.name)};n={...n,clients:u,tools:d,commands:f,resources:p}}return{...t,mcp:n}}))},[i]),w=(0,q.useCallback)(e=>{_.current.push(e),S.current===null&&(S.current=setTimeout(C,16))},[C]),T=(0,q.useCallback)(({client:e,tools:t,commands:n,resources:r})=>{switch(w({...e,tools:t,commands:n,resources:r}),e.type){case`connected`:ee(e.client,e.name,i),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(u(e.name,e.config).catch(()=>{D(`Failed to invalidate the server cache: ${e.name}`)}),p(e.name)){j(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=K(t);j(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=s.current.get(e.name);r&&(clearTimeout(r),s.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(p(e.name)){j(e.name,`Server disabled during reconnection, stopping retry`),s.current.delete(e.name);return}w({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await b(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){j(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),s.current.delete(e.name),T(i);return}if(j(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){j(e.name,`Max reconnection attempts (${J}) reached, giving up`),s.current.delete(e.name),T(i);return}}catch(i){let a=Date.now()-r;if(M(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){j(e.name,`Max reconnection attempts (${J}) reached, giving up`),s.current.delete(e.name),w({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);j(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);s.current.set(e.name,n)})}})()}else w({...e,type:`failed`})},e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(x,async()=>{j(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=h.cache.get(e.name);h.cache.delete(e.name);let n=await h(e),r=n.length;t?t.then(e=>{P(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{P(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):P(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),w({...e,tools:n})}catch(t){M(e.name,`Failed to refresh tools after list_changed notification: ${E(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(o,async()=>{j(e.name,`Received prompts/list_changed notification, refreshing prompts`),P(`tengu_mcp_list_changed`,{type:`prompts`});try{l.cache.delete(e.name);let[t,n]=await Promise.all([l(e),Promise.resolve([])]);w({...e,commands:[...t,...n]}),I()}catch(t){M(e.name,`Failed to refresh prompts after list_changed notification: ${E(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(c,async()=>{j(e.name,`Received resources/list_changed notification, refreshing resources`),P(`tengu_mcp_list_changed`,{type:`resources`});try{g.cache.delete(e.name);{let t=await g(e);w({...e,resources:t})}}catch(t){M(e.name,`Failed to refresh resources after list_changed notification: ${E(t)}`)}});break;case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[w]),O=ie();return(0,q.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await a(e),o={...n,...e};W(i,r),i(e=>{let{stale:t,...n}=v(e.mcp,o);for(let e of t){let t=s.current.get(e.name);t&&(clearTimeout(t),s.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,u(e.name,e.config).catch(()=>{}))}let r=new Set(n.clients.map(e=>e.name)),i=Object.entries(o).filter(([e])=>!r.has(e)).map(([e,t])=>({name:e,type:p(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=>{M(`useManageMCPConnections`,`Failed to initialize servers as pending: ${E(e)}`)})},[t,e,i,O,r]),(0,q.useEffect)(()=>{let n=!1;async function r(){let r=Promise.resolve({}),{servers:o,errors:s}=t?{servers:{},errors:[]}:await a(e,r);if(n)return;W(i,s);let c={...o,...e},l=Object.fromEntries(Object.entries(c).filter(([e])=>!p(e)));m(T,l).catch(e=>{M(`useManageMcpConnections`,`Failed to get MCP resources: ${E(e)}`)});let u={},d={...c,...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++;P(`tengu_mcp_servers`,{...f})}return r(),()=>{n=!0}},[t,e,T,i,O,r]),(0,q.useEffect)(()=>{let e=s.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),S.current!==null&&(clearTimeout(S.current),S.current=null,C())}},[C]),{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=s.current.get(e);r&&(clearTimeout(r),s.current.delete(e));let i=await b(e,t.config);return T(i),i},[n,T]),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=s.current.get(e);n&&(clearTimeout(n),s.current.delete(e)),f(e,!1),t.type===`connected`&&await u(e,t.config),w({name:e,type:`disabled`,config:t.config})}else{f(e,!0),w({name:e,type:`pending`,config:t.config});let n=await b(e,t.config);T(n)}},[n,w,T])}}function K(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var q,J,Y,X,oe=e((()=>{q=t(S(),1),w(),n(),F(),r(),z(),B(),N(),i(),O(),H(),s(),T(),ae(),ne(),k(),_(),J=5,Y=1e3,X=3e4}));function se(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function ce(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpToggleEnabled must be used within MCPConnectionManager`);return e.toggleMcpServer}function le({children:e,dynamicMcpConfig:t,isStrictMcpConfig:n}){let{reconnectMcpServer:r,toggleMcpServer:i}=G(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,ue=e((()=>{Z=t(S(),1),oe(),Q=C(),$=(0,Z.createContext)(null)}));export{ce as i,ue as n,se as r,le as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{$_ as i,Dv as a,Ip as o,K_ as s,Lp as c,cv as l,fv as ee,gv as u,iv as te,md as d,pd as f,pv as p,sv as ne,uv as m,wv as h,zp as re}from"./loadAgentsDir-DlPbtIsS.js";import{D as g,H as _,I as v,P as y,T as b,ai as x,j as S,t as C,y as w}from"./src-DL3w8VPk.js";import{t as T}from"./jsx-runtime-Bb4Xn-E0.js";import{I as E,M as ie}from"./debug-Bglx1aTu.js";import{$ as D,et as O,rt as k}from"./settings-B2jvL8Dp.js";import{l as A,n as j,o as M}from"./stringUtils-C718f5ey.js";import{n as ae,r as oe}from"./analytics-DJobLaWP.js";import{i as N,n as P,r as F}from"./MCPConnectionManager-thZd-xA_.js";import{n as I,t as L}from"./useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js";import{t as R}from"./select-Bxf5-5sI.js";import{r as z,t as B}from"./Spinner-zYPFVFHN.js";import{t as V}from"./CustomSelect-DoeEXOIP.js";function H({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,U.jsxs)(v,{children:[(0,U.jsx)(y,{bold:!0,children:`Capabilities: `}),(0,U.jsx)(y,{color:`text`,children:r.length>0?(0,U.jsx)(b,{children:r}):`none`})]})}var U,W=e((()=>{C(),U=T()}));function G(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 K(e,t){return`Error reconnecting to ${t}: ${e instanceof Error?e.message:String(e)}`}var se=e((()=>{}));function ce({server:e,serverToolsCount:t,onViewTools:n,onCancel:i,onComplete:a,borderless:o=!1}){let[u]=_(),d=I(),p=c(e=>e.mcp),h=re(),[x,C]=(0,q.useState)(!1),[w,T]=(0,q.useState)(null),E=F(),D=N(),O=j(String(e.name)),k=ee(p.commands,e.name).length,A=q.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await D(e.name),e.config.type===`claudeai-proxy`&&oe(`tengu_claudeai_mcp_toggle`,{new_state:t?`disabled`:`enabled`}),i()}catch(n){a?.(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${ie(n)}`)}},[e.client.type,e.config.type,e.name,D,i,a]);if(x)return(0,J.jsxs)(v,{flexDirection:`column`,gap:1,padding:1,children:[(0,J.jsxs)(y,{color:`text`,children:[`Connecting to `,(0,J.jsx)(y,{bold:!0,children:e.name}),`…`]}),(0,J.jsxs)(v,{children:[(0,J.jsx)(B,{}),(0,J.jsx)(y,{children:` Establishing connection to MCP server`})]}),(0,J.jsx)(y,{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)(v,{flexDirection:`column`,children:[(0,J.jsxs)(v,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,J.jsx)(v,{marginBottom:1,children:(0,J.jsxs)(y,{bold:!0,children:[O,` MCP Server`]})}),(0,J.jsxs)(v,{flexDirection:`column`,gap:0,children:[(0,J.jsxs)(v,{children:[(0,J.jsx)(y,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,J.jsxs)(y,{children:[S(`inactive`,u)(r.radioOff),` disabled`]}):e.client.type===`connected`?(0,J.jsxs)(y,{children:[S(`success`,u)(r.tick),` connected`]}):e.client.type===`pending`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(y,{dimColor:!0,children:r.radioOff}),(0,J.jsx)(y,{children:` connecting…`})]}):e.client.type===`needs-auth`?(0,J.jsxs)(y,{children:[S(`warning`,u)(r.triangleUpOutline),` needs authentication`]}):(0,J.jsxs)(y,{children:[S(`error`,u)(r.cross),` failed`]})]}),(0,J.jsxs)(v,{children:[(0,J.jsx)(y,{bold:!0,children:`URL: `}),(0,J.jsx)(y,{dimColor:!0,children:e.config.url})]}),(0,J.jsxs)(v,{children:[(0,J.jsx)(y,{bold:!0,children:`Config location: `}),(0,J.jsx)(y,{dimColor:!0,children:te(e.scope)})]}),e.client.type===`connected`&&(0,J.jsx)(H,{serverToolsCount:t,serverPromptsCount:k,serverResourcesCount:p.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,J.jsxs)(v,{children:[(0,J.jsx)(y,{bold:!0,children:`Tools: `}),(0,J.jsxs)(y,{dimColor:!0,children:[t,` tools`]})]})]}),w&&(0,J.jsx)(v,{marginTop:1,children:(0,J.jsxs)(y,{color:`error`,children:[`Error: `,w]})}),M.length>0&&(0,J.jsx)(v,{marginTop:1,children:(0,J.jsx)(R,{options:M,onChange:async t=>{switch(t){case`tools`:n();break;case`reconnectMcpServer`:C(!0),T(null);try{await s(e.name,{...e.config,scope:e.scope}),h(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`pending`}:t),r=m(t.mcp.tools,e.name),i=ne(t.mcp.commands,e.name),a=l(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}});let{message:t}=G(await E(e.name),e.name);a?.(t)}catch(t){a?.(K(t,e.name))}finally{C(!1)}break;case`toggle-enabled`:await A();break;case`back`:i();break}},onCancel:i})})]}),(0,J.jsx)(v,{marginTop:1,children:(0,J.jsx)(y,{dimColor:!0,italic:!0,children:d.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,d.keyName,` again to exit`]}):(0,J.jsxs)(b,{children:[(0,J.jsx)(g,{shortcut:`↑↓`,action:`navigate`}),(0,J.jsx)(g,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(f,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var q,J,le=e((()=>{n(),q=t(x(),1),ae(),L(),C(),i(),P(),u(),o(),E(),M(),d(),V(),z(),W(),se(),J=T()}));function ue({server:e,serverToolsCount:t,onViewTools:n,onCancel:i,onComplete:a,borderless:o=!1}){let[s]=_(),l=I(),u=c(e=>e.mcp),d=F(),p=N(),[ne,m]=(0,Y.useState)(!1),re=Y.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await p(e.name),i()}catch(n){a(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${ie(n)}`)}},[e.client.type,e.name,p,i,a]),x=j(String(e.name)),C=ee(u.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)(v,{flexDirection:`column`,gap:1,padding:1,children:[(0,X.jsxs)(y,{color:`text`,children:[`Reconnecting to `,(0,X.jsx)(y,{bold:!0,children:e.name})]}),(0,X.jsxs)(v,{children:[(0,X.jsx)(B,{}),(0,X.jsx)(y,{children:` Restarting MCP server process`})]}),(0,X.jsx)(y,{dimColor:!0,children:`This may take a few moments.`})]}):(0,X.jsxs)(v,{flexDirection:`column`,children:[(0,X.jsxs)(v,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,X.jsx)(v,{marginBottom:1,children:(0,X.jsxs)(y,{bold:!0,children:[x,` MCP Server`]})}),(0,X.jsxs)(v,{flexDirection:`column`,gap:0,children:[(0,X.jsxs)(v,{children:[(0,X.jsx)(y,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,X.jsxs)(y,{children:[S(`inactive`,s)(r.radioOff),` disabled`]}):e.client.type===`connected`?(0,X.jsxs)(y,{children:[S(`success`,s)(r.tick),` connected`]}):e.client.type===`pending`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(y,{dimColor:!0,children:r.radioOff}),(0,X.jsx)(y,{children:` connecting…`})]}):(0,X.jsxs)(y,{children:[S(`error`,s)(r.cross),` failed`]})]}),(0,X.jsxs)(v,{children:[(0,X.jsx)(y,{bold:!0,children:`Command: `}),(0,X.jsx)(y,{dimColor:!0,children:e.config.command})]}),e.config.args&&e.config.args.length>0&&(0,X.jsxs)(v,{children:[(0,X.jsx)(y,{bold:!0,children:`Args: `}),(0,X.jsx)(y,{dimColor:!0,children:e.config.args.join(` `)})]}),(0,X.jsxs)(v,{children:[(0,X.jsx)(y,{bold:!0,children:`Config location: `}),(0,X.jsx)(y,{dimColor:!0,children:te(h(e.name)?.scope??`dynamic`)})]}),e.client.type===`connected`&&(0,X.jsx)(H,{serverToolsCount:t,serverPromptsCount:C,serverResourcesCount:u.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,X.jsxs)(v,{children:[(0,X.jsx)(y,{bold:!0,children:`Tools: `}),(0,X.jsxs)(y,{dimColor:!0,children:[t,` tools`]})]})]}),w.length>0&&(0,X.jsx)(v,{marginTop:1,children:(0,X.jsx)(R,{options:w,onChange:async t=>{if(t===`tools`)n();else if(t===`reconnectMcpServer`){m(!0);try{let{message:t}=G(await d(e.name),e.name);a?.(t)}catch(t){a?.(K(t,e.name))}finally{m(!1)}}else t===`toggle-enabled`?await re():t===`back`&&i()},onCancel:i})})]}),(0,X.jsx)(v,{marginTop:1,children:(0,X.jsx)(y,{dimColor:!0,italic:!0,children:l.pending?(0,X.jsxs)(X.Fragment,{children:[`Press `,l.keyName,` again to exit`]}):(0,X.jsxs)(b,{children:[(0,X.jsx)(g,{shortcut:`↑↓`,action:`navigate`}),(0,X.jsx)(g,{shortcut:`Enter`,action:`select`}),(0,X.jsx)(f,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var Y,X,de=e((()=>{n(),Y=t(x(),1),L(),C(),a(),P(),u(),o(),E(),M(),d(),V(),z(),W(),se(),X=T()}));function fe({tool:e,server:t,onBack:n}){let[r,i]=Z.useState(``),a=O(e.name,t.name),o=D(e.userFacingName?e.userFacingName({}):a),s=e.isReadOnly?.({})??!1,c=e.isDestructive?.({})??!1,l=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)(w,{title:(0,Q.jsxs)(Q.Fragment,{children:[o,s&&(0,Q.jsx)(y,{color:`success`,children:` [read-only]`}),c&&(0,Q.jsx)(y,{color:`error`,children:` [destructive]`}),l&&(0,Q.jsx)(y,{dimColor:!0,children:` [open-world]`})]}),subtitle:t.name,onCancel:n,inputGuide:e=>e.pending?(0,Q.jsxs)(y,{children:[`Press `,e.keyName,` again to exit`]}):(0,Q.jsx)(f,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`}),children:(0,Q.jsxs)(v,{flexDirection:`column`,children:[(0,Q.jsxs)(v,{children:[(0,Q.jsx)(y,{bold:!0,children:`Tool name: `}),(0,Q.jsx)(y,{dimColor:!0,children:a})]}),(0,Q.jsxs)(v,{children:[(0,Q.jsx)(y,{bold:!0,children:`Full name: `}),(0,Q.jsx)(y,{dimColor:!0,children:e.name})]}),r&&(0,Q.jsxs)(v,{flexDirection:`column`,marginTop:1,children:[(0,Q.jsx)(y,{bold:!0,children:`Description:`}),(0,Q.jsx)(y,{wrap:`wrap`,children:r})]}),e.inputJSONSchema?.properties&&Object.keys(e.inputJSONSchema.properties).length>0&&(0,Q.jsxs)(v,{flexDirection:`column`,marginTop:1,children:[(0,Q.jsx)(y,{bold:!0,children:`Parameters:`}),(0,Q.jsx)(v,{marginLeft:2,flexDirection:`column`,children:Object.entries(e.inputJSONSchema.properties).map(([t,n])=>{let r=(e.inputJSONSchema?.required)?.includes(t);return(0,Q.jsxs)(y,{children:[`• `,t,r&&(0,Q.jsx)(y,{dimColor:!0,children:` (required)`}),`:`,` `,(0,Q.jsx)(y,{dimColor:!0,children:typeof n==`object`&&n&&`type`in n?String(n.type):`unknown`}),typeof n==`object`&&n&&`description`in n&&(0,Q.jsxs)(y,{dimColor:!0,children:[` - `,String(n.description)]})]},t)})})]})]})})}var Z,Q,pe=e((()=>{Z=t(x(),1),C(),k(),d(),Q=T()}));function me({server:e,onSelectTool:t,onBack:n}){let r=c(e=>e.mcp.tools),i=he.useMemo(()=>e.client.type===`connected`?p(r,e.name):[],[e,r]),a=i.map((t,n)=>{let r=O(t.name,e.name),i=D(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)(w,{title:`Tools for ${e.name}`,subtitle:`${i.length} ${A(i.length,`tool`)}`,onCancel:n,inputGuide:e=>e.pending?(0,$.jsxs)(y,{children:[`Press `,e.keyName,` again to exit`]}):(0,$.jsxs)(b,{children:[(0,$.jsx)(g,{shortcut:`↑↓`,action:`navigate`}),(0,$.jsx)(g,{shortcut:`Enter`,action:`select`}),(0,$.jsx)(f,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]}),children:i.length===0?(0,$.jsx)(y,{dimColor:!0,children:`No tools available`}):(0,$.jsx)(R,{options:a,onChange:e=>{let n=parseInt(e,10),r=i[n];r&&t(r,n)},onCancel:n})})}var he,$,ge=e((()=>{he=t(x(),1),C(),k(),u(),o(),M(),d(),V(),$=T()}));export{ue as a,le as c,pe as i,ge as n,de as o,fe as r,ce as s,me as t};
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{$_ as i,Dv as a,Ip as o,K_ as s,Lp as c,cv as l,fv as ee,gv as u,iv as te,md as d,pd as f,pv as p,sv as ne,uv as m,wv as h,zp as re}from"./loadAgentsDir-B0Anodo0.js";import{D as g,H as _,I as v,P as y,T as b,ai as x,j as S,t as C,y as w}from"./src-DL3w8VPk.js";import{t as T}from"./jsx-runtime-Bb4Xn-E0.js";import{I as E,M as ie}from"./debug-Bglx1aTu.js";import{$ as D,et as O,rt as k}from"./settings-B2jvL8Dp.js";import{l as A,n as j,o as M}from"./stringUtils-C718f5ey.js";import{n as ae,r as oe}from"./analytics-DJobLaWP.js";import{i as N,n as P,r as F}from"./MCPConnectionManager-Cie77ZAK.js";import{n as I,t as L}from"./useExitOnCtrlCDWithKeybindings-BKwzUpgb.js";import{t as R}from"./select-DIxfl_VN.js";import{r as z,t as B}from"./Spinner-ByQXTvAA.js";import{t as V}from"./CustomSelect-wmZ9jz0W.js";function H({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,U.jsxs)(v,{children:[(0,U.jsx)(y,{bold:!0,children:`Capabilities: `}),(0,U.jsx)(y,{color:`text`,children:r.length>0?(0,U.jsx)(b,{children:r}):`none`})]})}var U,W=e((()=>{C(),U=T()}));function G(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 K(e,t){return`Error reconnecting to ${t}: ${e instanceof Error?e.message:String(e)}`}var se=e((()=>{}));function ce({server:e,serverToolsCount:t,onViewTools:n,onCancel:i,onComplete:a,borderless:o=!1}){let[u]=_(),d=I(),p=c(e=>e.mcp),h=re(),[x,C]=(0,q.useState)(!1),[w,T]=(0,q.useState)(null),E=F(),D=N(),O=j(String(e.name)),k=ee(p.commands,e.name).length,A=q.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await D(e.name),e.config.type===`claudeai-proxy`&&oe(`tengu_claudeai_mcp_toggle`,{new_state:t?`disabled`:`enabled`}),i()}catch(n){a?.(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${ie(n)}`)}},[e.client.type,e.config.type,e.name,D,i,a]);if(x)return(0,J.jsxs)(v,{flexDirection:`column`,gap:1,padding:1,children:[(0,J.jsxs)(y,{color:`text`,children:[`Connecting to `,(0,J.jsx)(y,{bold:!0,children:e.name}),`…`]}),(0,J.jsxs)(v,{children:[(0,J.jsx)(B,{}),(0,J.jsx)(y,{children:` Establishing connection to MCP server`})]}),(0,J.jsx)(y,{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)(v,{flexDirection:`column`,children:[(0,J.jsxs)(v,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,J.jsx)(v,{marginBottom:1,children:(0,J.jsxs)(y,{bold:!0,children:[O,` MCP Server`]})}),(0,J.jsxs)(v,{flexDirection:`column`,gap:0,children:[(0,J.jsxs)(v,{children:[(0,J.jsx)(y,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,J.jsxs)(y,{children:[S(`inactive`,u)(r.radioOff),` disabled`]}):e.client.type===`connected`?(0,J.jsxs)(y,{children:[S(`success`,u)(r.tick),` connected`]}):e.client.type===`pending`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(y,{dimColor:!0,children:r.radioOff}),(0,J.jsx)(y,{children:` connecting…`})]}):e.client.type===`needs-auth`?(0,J.jsxs)(y,{children:[S(`warning`,u)(r.triangleUpOutline),` needs authentication`]}):(0,J.jsxs)(y,{children:[S(`error`,u)(r.cross),` failed`]})]}),(0,J.jsxs)(v,{children:[(0,J.jsx)(y,{bold:!0,children:`URL: `}),(0,J.jsx)(y,{dimColor:!0,children:e.config.url})]}),(0,J.jsxs)(v,{children:[(0,J.jsx)(y,{bold:!0,children:`Config location: `}),(0,J.jsx)(y,{dimColor:!0,children:te(e.scope)})]}),e.client.type===`connected`&&(0,J.jsx)(H,{serverToolsCount:t,serverPromptsCount:k,serverResourcesCount:p.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,J.jsxs)(v,{children:[(0,J.jsx)(y,{bold:!0,children:`Tools: `}),(0,J.jsxs)(y,{dimColor:!0,children:[t,` tools`]})]})]}),w&&(0,J.jsx)(v,{marginTop:1,children:(0,J.jsxs)(y,{color:`error`,children:[`Error: `,w]})}),M.length>0&&(0,J.jsx)(v,{marginTop:1,children:(0,J.jsx)(R,{options:M,onChange:async t=>{switch(t){case`tools`:n();break;case`reconnectMcpServer`:C(!0),T(null);try{await s(e.name,{...e.config,scope:e.scope}),h(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`pending`}:t),r=m(t.mcp.tools,e.name),i=ne(t.mcp.commands,e.name),a=l(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}});let{message:t}=G(await E(e.name),e.name);a?.(t)}catch(t){a?.(K(t,e.name))}finally{C(!1)}break;case`toggle-enabled`:await A();break;case`back`:i();break}},onCancel:i})})]}),(0,J.jsx)(v,{marginTop:1,children:(0,J.jsx)(y,{dimColor:!0,italic:!0,children:d.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,d.keyName,` again to exit`]}):(0,J.jsxs)(b,{children:[(0,J.jsx)(g,{shortcut:`↑↓`,action:`navigate`}),(0,J.jsx)(g,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(f,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var q,J,le=e((()=>{n(),q=t(x(),1),ae(),L(),C(),i(),P(),u(),o(),E(),M(),d(),V(),z(),W(),se(),J=T()}));function ue({server:e,serverToolsCount:t,onViewTools:n,onCancel:i,onComplete:a,borderless:o=!1}){let[s]=_(),l=I(),u=c(e=>e.mcp),d=F(),p=N(),[ne,m]=(0,Y.useState)(!1),re=Y.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await p(e.name),i()}catch(n){a(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${ie(n)}`)}},[e.client.type,e.name,p,i,a]),x=j(String(e.name)),C=ee(u.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)(v,{flexDirection:`column`,gap:1,padding:1,children:[(0,X.jsxs)(y,{color:`text`,children:[`Reconnecting to `,(0,X.jsx)(y,{bold:!0,children:e.name})]}),(0,X.jsxs)(v,{children:[(0,X.jsx)(B,{}),(0,X.jsx)(y,{children:` Restarting MCP server process`})]}),(0,X.jsx)(y,{dimColor:!0,children:`This may take a few moments.`})]}):(0,X.jsxs)(v,{flexDirection:`column`,children:[(0,X.jsxs)(v,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,X.jsx)(v,{marginBottom:1,children:(0,X.jsxs)(y,{bold:!0,children:[x,` MCP Server`]})}),(0,X.jsxs)(v,{flexDirection:`column`,gap:0,children:[(0,X.jsxs)(v,{children:[(0,X.jsx)(y,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,X.jsxs)(y,{children:[S(`inactive`,s)(r.radioOff),` disabled`]}):e.client.type===`connected`?(0,X.jsxs)(y,{children:[S(`success`,s)(r.tick),` connected`]}):e.client.type===`pending`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(y,{dimColor:!0,children:r.radioOff}),(0,X.jsx)(y,{children:` connecting…`})]}):(0,X.jsxs)(y,{children:[S(`error`,s)(r.cross),` failed`]})]}),(0,X.jsxs)(v,{children:[(0,X.jsx)(y,{bold:!0,children:`Command: `}),(0,X.jsx)(y,{dimColor:!0,children:e.config.command})]}),e.config.args&&e.config.args.length>0&&(0,X.jsxs)(v,{children:[(0,X.jsx)(y,{bold:!0,children:`Args: `}),(0,X.jsx)(y,{dimColor:!0,children:e.config.args.join(` `)})]}),(0,X.jsxs)(v,{children:[(0,X.jsx)(y,{bold:!0,children:`Config location: `}),(0,X.jsx)(y,{dimColor:!0,children:te(h(e.name)?.scope??`dynamic`)})]}),e.client.type===`connected`&&(0,X.jsx)(H,{serverToolsCount:t,serverPromptsCount:C,serverResourcesCount:u.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,X.jsxs)(v,{children:[(0,X.jsx)(y,{bold:!0,children:`Tools: `}),(0,X.jsxs)(y,{dimColor:!0,children:[t,` tools`]})]})]}),w.length>0&&(0,X.jsx)(v,{marginTop:1,children:(0,X.jsx)(R,{options:w,onChange:async t=>{if(t===`tools`)n();else if(t===`reconnectMcpServer`){m(!0);try{let{message:t}=G(await d(e.name),e.name);a?.(t)}catch(t){a?.(K(t,e.name))}finally{m(!1)}}else t===`toggle-enabled`?await re():t===`back`&&i()},onCancel:i})})]}),(0,X.jsx)(v,{marginTop:1,children:(0,X.jsx)(y,{dimColor:!0,italic:!0,children:l.pending?(0,X.jsxs)(X.Fragment,{children:[`Press `,l.keyName,` again to exit`]}):(0,X.jsxs)(b,{children:[(0,X.jsx)(g,{shortcut:`↑↓`,action:`navigate`}),(0,X.jsx)(g,{shortcut:`Enter`,action:`select`}),(0,X.jsx)(f,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var Y,X,de=e((()=>{n(),Y=t(x(),1),L(),C(),a(),P(),u(),o(),E(),M(),d(),V(),z(),W(),se(),X=T()}));function fe({tool:e,server:t,onBack:n}){let[r,i]=Z.useState(``),a=O(e.name,t.name),o=D(e.userFacingName?e.userFacingName({}):a),s=e.isReadOnly?.({})??!1,c=e.isDestructive?.({})??!1,l=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)(w,{title:(0,Q.jsxs)(Q.Fragment,{children:[o,s&&(0,Q.jsx)(y,{color:`success`,children:` [read-only]`}),c&&(0,Q.jsx)(y,{color:`error`,children:` [destructive]`}),l&&(0,Q.jsx)(y,{dimColor:!0,children:` [open-world]`})]}),subtitle:t.name,onCancel:n,inputGuide:e=>e.pending?(0,Q.jsxs)(y,{children:[`Press `,e.keyName,` again to exit`]}):(0,Q.jsx)(f,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`}),children:(0,Q.jsxs)(v,{flexDirection:`column`,children:[(0,Q.jsxs)(v,{children:[(0,Q.jsx)(y,{bold:!0,children:`Tool name: `}),(0,Q.jsx)(y,{dimColor:!0,children:a})]}),(0,Q.jsxs)(v,{children:[(0,Q.jsx)(y,{bold:!0,children:`Full name: `}),(0,Q.jsx)(y,{dimColor:!0,children:e.name})]}),r&&(0,Q.jsxs)(v,{flexDirection:`column`,marginTop:1,children:[(0,Q.jsx)(y,{bold:!0,children:`Description:`}),(0,Q.jsx)(y,{wrap:`wrap`,children:r})]}),e.inputJSONSchema?.properties&&Object.keys(e.inputJSONSchema.properties).length>0&&(0,Q.jsxs)(v,{flexDirection:`column`,marginTop:1,children:[(0,Q.jsx)(y,{bold:!0,children:`Parameters:`}),(0,Q.jsx)(v,{marginLeft:2,flexDirection:`column`,children:Object.entries(e.inputJSONSchema.properties).map(([t,n])=>{let r=(e.inputJSONSchema?.required)?.includes(t);return(0,Q.jsxs)(y,{children:[`• `,t,r&&(0,Q.jsx)(y,{dimColor:!0,children:` (required)`}),`:`,` `,(0,Q.jsx)(y,{dimColor:!0,children:typeof n==`object`&&n&&`type`in n?String(n.type):`unknown`}),typeof n==`object`&&n&&`description`in n&&(0,Q.jsxs)(y,{dimColor:!0,children:[` - `,String(n.description)]})]},t)})})]})]})})}var Z,Q,pe=e((()=>{Z=t(x(),1),C(),k(),d(),Q=T()}));function me({server:e,onSelectTool:t,onBack:n}){let r=c(e=>e.mcp.tools),i=he.useMemo(()=>e.client.type===`connected`?p(r,e.name):[],[e,r]),a=i.map((t,n)=>{let r=O(t.name,e.name),i=D(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)(w,{title:`Tools for ${e.name}`,subtitle:`${i.length} ${A(i.length,`tool`)}`,onCancel:n,inputGuide:e=>e.pending?(0,$.jsxs)(y,{children:[`Press `,e.keyName,` again to exit`]}):(0,$.jsxs)(b,{children:[(0,$.jsx)(g,{shortcut:`↑↓`,action:`navigate`}),(0,$.jsx)(g,{shortcut:`Enter`,action:`select`}),(0,$.jsx)(f,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]}),children:i.length===0?(0,$.jsx)(y,{dimColor:!0,children:`No tools available`}):(0,$.jsx)(R,{options:a,onChange:e=>{let n=parseInt(e,10),r=i[n];r&&t(r,n)},onCancel:n})})}var he,$,ge=e((()=>{he=t(x(),1),C(),k(),u(),o(),M(),d(),V(),$=T()}));export{ue as a,le as c,pe as i,ge as n,de as o,fe as r,ce as s,me as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Dv as n,Tv as r,gv as i,hv as a,iv as o}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Dv as n,Tv as r,gv as i,hv as a,iv as o}from"./loadAgentsDir-B0Anodo0.js";import{I as s,Lt as c,P as l,ai as u,t as d}from"./src-DL3w8VPk.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";function p({scope:e,parsingErrors:t,warnings:n}){let r=t.length>0,i=n.length>0;return!r&&!i?null:(0,_.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,_.jsxs)(s,{children:[(r||i)&&(0,_.jsxs)(l,{color:r?`error`:`warning`,children:[`[`,r?`Failed to parse`:`Contains warnings`,`] `]}),(0,_.jsx)(l,{children:a(e)})]}),(0,_.jsxs)(s,{children:[(0,_.jsx)(l,{dimColor:!0,children:`Location: `}),(0,_.jsx)(l,{dimColor:!0,children:o(e)})]}),(0,_.jsxs)(s,{marginLeft:1,flexDirection:`column`,children:[t.map((e,t)=>{let n=e.mcpErrorMetadata?.serverName;return(0,_.jsx)(s,{children:(0,_.jsxs)(l,{children:[(0,_.jsx)(l,{dimColor:!0,children:`└ `}),(0,_.jsx)(l,{color:`error`,children:`[Error]`}),(0,_.jsxs)(l,{dimColor:!0,children:[` `,n&&`[${n}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`error-${t}`)}),n.map((e,t)=>{let n=e.mcpErrorMetadata?.serverName;return(0,_.jsx)(s,{children:(0,_.jsxs)(l,{children:[(0,_.jsx)(l,{dimColor:!0,children:`└ `}),(0,_.jsx)(l,{color:`warning`,children:`[Warning]`}),(0,_.jsxs)(l,{dimColor:!0,children:[` `,n&&`[${n}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`warning-${t}`)})]})]})}function m(){let e=(0,g.useMemo)(()=>[{scope:`user`,config:r(`user`)},{scope:`project`,config:r(`project`)},{scope:`local`,config:r(`local`)},{scope:`enterprise`,config:r(`enterprise`)}],[]),t=e.some(({config:e})=>h(e.errors,`fatal`).length>0),n=e.some(({config:e})=>h(e.errors,`warning`).length>0);return!t&&!n?null:(0,_.jsxs)(s,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,_.jsx)(l,{bold:!0,children:`MCP Config Diagnostics`}),(0,_.jsx)(s,{marginTop:1,children:(0,_.jsxs)(l,{dimColor:!0,children:[`For help configuring MCP servers, see:`,` `,(0,_.jsx)(c,{url:`https://code.workmate.com/docs/en/mcp`,children:`https://code.workmate.com/docs/en/mcp`})]})}),e.map(({scope:e,config:t})=>(0,_.jsx)(p,{scope:e,parsingErrors:h(t.errors,`fatal`),warnings:h(t.errors,`warning`)},e))]})}function h(e,t){return e.filter(e=>e.mcpErrorMetadata?.severity===t)}var g,_,v=e((()=>{g=t(u(),1),n(),i(),d(),_=f()}));export{v as n,m as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,o as t,r as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./figures-5ThXQEtq.js";import{$p as a,Ip as o,Jx as s,Lp as c,Lu as l,Qo as u,Qp as d,Sa as f,Ta as p,Xx as m,Yi as h,Zo as g,Zp as _,bb as v,es as y,gc as b,hc as x,im as S,ix as C,kS as w,l_ as T,mb as E,mc as D,mn as O,pS as k,rx as A,tn as j,tx as M,uS as N,u_ as ee,un as te,vc as P,zu as F}from"./loadAgentsDir-DlPbtIsS.js";import{C as ne,Gt as re,I,P as L,Wt as ie,ai as ae,ot as R,t as oe}from"./src-DL3w8VPk.js";import{t as se}from"./jsx-runtime-Bb4Xn-E0.js";import{It as ce,Mn as le}from"./state-B4jiUise.js";import{Hn as ue,Vn as z}from"./settings-B2jvL8Dp.js";import{D as B,h as de,m as V,o as fe,q as pe,s as H}from"./log-D2TIwHBV.js";import{n as U,r as W}from"./analytics-DJobLaWP.js";import{_ as me,p as he,y as ge}from"./startupProfiler-CJdr3SxP.js";import{E as _e,T as ve,c as ye,d as be,w as xe}from"./sessionTracing-BoDDYLxW.js";import{n as Se,t as Ce}from"./useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js";import{n as we,t as Te}from"./select-Bxf5-5sI.js";import{r as Ee,t as De}from"./Spinner-zYPFVFHN.js";import*as G from"path";import{randomUUID as K}from"crypto";var q=t(ae(),1),J=se();oe(),ce(),pe(),V(),fe(),ue(),U(),me(),A(),T(),xe(),l(),ye(),b(),D(),y(),h(),O();function Oe(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 ke(e){let t=e.toLowerCase().trim();return t===`continue`||/\b(keep going|go on)\b/.test(t)}function Ae(e,t,n,r,i,a,o){let s=K();le(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;be(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&ve(`user_prompt`,{prompt_length:String(l.length),prompt:_e(l),"prompt.id":s}),W(`tengu_input_prompt`,{is_negative:Oe(c),is_keep_going:ke(c)}),t.length>0?{messages:[k({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:[k({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}U(),h();async function je({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,ideSelection:o,messages:s,setUserInputOnProcessing:c,uuid:l,isAlreadyProcessing:u,querySource:d,canUseTool:f,skipSlashCommands:p,bridgeOrigin:h,isMeta:_,skipAttachments:v,autonomy:y}){let b=typeof e==`string`?e:null,x=b?.startsWith(`/`)&&!p;n===`prompt`&&b!==null&&!_&&!x&&c?.(b),P(`query_process_user_input_base_start`);let S=i.getAppState(),C=await Ne(e,n,r,i,a,o,s,l,u,d,f,S.toolPermissionContext.mode,p,h,_,v,t,y);if(P(`query_process_user_input_base_end`),!C.shouldQuery)return C;P(`query_hooks_start`);let w=m(e)||``;for await(let t of j(w,S.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[N(`${te(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:C.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return C.messages.push(k({content:e})),C.shouldQuery=!1,C}if(t.additionalContexts&&t.additionalContexts.length>0&&C.messages.push(g({type:`hook_additional_context`,content:t.additionalContexts.map(Me),hookName:`UserPromptSubmit`,toolUseID:`hook-${K()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;C.messages.push({...t.message,attachment:{...t.message.attachment,content:Me(t.message.attachment.content)}});break;default:C.messages.push(t.message);break}}return P(`query_hooks_end`),C}var Y=1e4;function Me(e){return e.length>Y?`${e.substring(0,Y)}… [output truncated - exceeded ${Y} characters]`:e}async function Ne(e,t,n,r,i,a,o,s,c,l,d,f,p,m,h,g,_,v){let y=null,b=[],S=[],w=e;if(typeof e==`string`)y=e;else if(e.length>0){P(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await C(n);if(e.dimensions){let t=M(e.dimensions);t&&S.push(t)}t.push(e.block)}else t.push(n);w=t,P(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(y=n.text,b=t.slice(0,-1)):b=t}if(y===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let T=i?Object.values(i).filter(ee):[],E=T.map(e=>e.id),D=i?await F(i):new Map;P(`query_pasted_image_processing_start`);let O=await Promise.all(T.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return W(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await C(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??D.get(e.id)}})),k=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of O){if(e.dimensions){let t=M(e.dimensions,n);t&&S.push(t)}else if(t){let e=M(t,n);e&&S.push(e)}else n&&S.push(`[Image source: ${n}]`);k.push(e.block)}P(`query_pasted_image_processing_end`);let A=p,j=!g&&y!==null&&(t!==`prompt`||A||!y.startsWith(`/`));P(`query_attachment_loading_start`);let N=j?await x(u(y,r,a??null,[],o,l)):[];if(P(`query_attachment_loading_end`),y!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-DDi_Pymt.js`);return X(await e(y,b,N,r,n),S)}if(y!==null&&!A&&y.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-Cq9kaoSF.js`);return X(await e(y,b,k,N,r,n,s,c,d,v),S)}if(y!==null&&t===`prompt`){let e=y.trim(),t=N.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;W(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return X(Ae(w,k,E,N,s,f,h),S)}function X(e,t){return t.length>0&&e.messages.push(k({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}var Pe=n({MessageSelector:()=>Ie,messagesAfterAreOnlySynthetic:()=>Ue,selectableUserMessagesFilter:()=>Q});function Fe(e){return e.type===`text`}function Z(e){return e===`summarize`}function Ie({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:o,onClose:s,preselectedMessage:l}){let u=c(e=>e.fileHistory),[f,p]=(0,q.useState)(void 0),m=d(),h=(0,q.useMemo)(K,[]),g=(0,q.useMemo)(()=>[...e.filter(Q),{...k({content:``}),uuid:h}],[e,h]),[v,y]=(0,q.useState)(g.length-1),b=Math.max(0,Math.min(v-Math.floor($/2),g.length-$)),x=g.length>1,[S,C]=(0,q.useState)(l),[w,T]=(0,q.useState)(void 0);(0,q.useEffect)(()=>{if(!l||!m)return;let e=!1;return a(u,l.uuid).then(t=>{e||T(t)}),()=>{e=!0}},[l,m,u]);let[E,D]=(0,q.useState)(!1),[O,A]=(0,q.useState)(null),[j,M]=(0,q.useState)(`both`),[N,ee]=(0,q.useState)(``);function te(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:ee}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,q.useEffect)(()=>{W(`tengu_message_selector_opened`,{})},[]);async function P(e){t(),D(!0);try{await n(e),D(!1),s()}catch(e){H(e),D(!1),p(`Failed to restore the conversation:\n${e}`)}}async function F(t){let n=e.indexOf(t);if(W(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){s();return}if(!m){await P(t);return}let r=await a(u,t.uuid);C(t),T(r)}async function ae(e){if(W(`tengu_message_selector_restore_option_selected`,{option:e}),!S){p(`Message not found.`);return}if(e===`nevermind`){l?s():C(void 0);return}if(Z(e)){t(),D(!0),A(e),p(void 0);try{let e=N.trim()||void 0;await o(S,e,`from`),D(!1),A(null),C(void 0),s()}catch(e){H(e),D(!1),A(null),C(void 0),p(`Failed to summarize:\n${e}`)}return}t(),D(!0),p(void 0);let i=null,a=null;if(e===`code`||e===`both`)try{await r(S)}catch(e){i=e,H(i)}if(e===`conversation`||e===`both`)try{await n(S)}catch(e){a=e,H(a)}D(!1),C(void 0),a&&i?p(`Failed to restore the conversation and code:\n${a}\n${i}`):a?p(`Failed to restore the conversation:\n${a}`):i?p(`Failed to restore the code:\n${i}`):s()}let R=Se(),oe=(0,q.useCallback)(()=>{if(S&&!l){C(void 0);return}W(`tengu_message_selector_cancelled`,{}),s()},[s,S,l]),se=(0,q.useCallback)(()=>y(e=>Math.max(0,e-1)),[]),ce=(0,q.useCallback)(()=>y(e=>Math.min(g.length-1,e+1)),[g.length]),le=(0,q.useCallback)(()=>y(0),[]),ue=(0,q.useCallback)(()=>y(g.length-1),[g.length]),z=(0,q.useCallback)(()=>{let e=g[v];e&&F(e)},[g,v,F]);ie(`confirm:no`,oe,{context:`Confirmation`,isActive:!S}),re({"messageSelector:up":se,"messageSelector:down":ce,"messageSelector:top":le,"messageSelector:bottom":ue,"messageSelector:select":z},{context:`MessageSelector`,isActive:!E&&!f&&!S&&x});let[B,de]=(0,q.useState)({});(0,q.useEffect)(()=>{async function t(){m&&Promise.all(g.map(async(t,n)=>{if(t.uuid!==h){let r=_(u,t.uuid),i=g.at(n+1),a=r?He(e,t.uuid,i?.uuid===h?void 0:i?.uuid):void 0;de(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[g,e,h,u,m]);let V=m&&w?.filesChanged&&w.filesChanged.length>0,fe=!f&&!S&&!l&&x;return(0,J.jsxs)(I,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(ne,{color:`suggestion`}),(0,J.jsxs)(I,{flexDirection:`column`,marginX:1,gap:1,children:[(0,J.jsx)(L,{bold:!0,color:`suggestion`,children:`Rewind`}),f&&(0,J.jsxs)(L,{color:`error`,children:[`Error: `,f]}),!x&&(0,J.jsx)(L,{children:`Nothing to rewind to yet.`}),!f&&S&&x&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(L,{children:[`Confirm you want to restore `,!w&&`the conversation `,`to the point before you sent this message:`]}),(0,J.jsxs)(I,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,J.jsx)(Ve,{userMessage:S,color:`text`,isCurrent:!1}),(0,J.jsxs)(L,{dimColor:!0,children:[`(`,he(new Date(S.timestamp)),`)`]})]}),(0,J.jsx)(Re,{selectedRestoreOption:j,canRestoreCode:!!V,diffStatsForRestore:w}),E&&Z(O)?(0,J.jsxs)(I,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(De,{}),(0,J.jsx)(L,{children:`Summarizing…`})]}):(0,J.jsx)(Te,{isDisabled:E,options:te(!!V),defaultFocusValue:V?`both`:`conversation`,onFocus:e=>M(e),onChange:e=>ae(e),onCancel:()=>l?s():C(void 0)}),V&&(0,J.jsx)(I,{marginBottom:1,children:(0,J.jsxs)(L,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),fe&&(0,J.jsxs)(J.Fragment,{children:[m?(0,J.jsx)(L,{children:`Restore the code and/or conversation to the point before…`}):(0,J.jsx)(L,{children:`Restore and fork the conversation to the point before…`}),(0,J.jsx)(I,{width:`100%`,flexDirection:`column`,children:g.slice(b,b+$).map((e,t)=>{let n=b+t,r=n===v,a=e.uuid===h,o=n in B,s=B[n],c=s?.filesChanged?.length;return(0,J.jsxs)(I,{height:m?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,J.jsx)(I,{width:2,minWidth:2,children:r?(0,J.jsxs)(L,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,J.jsx)(L,{children:` `})}),(0,J.jsxs)(I,{flexDirection:`column`,children:[(0,J.jsx)(I,{flexShrink:1,height:1,overflow:`hidden`,children:(0,J.jsx)(Ve,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),m&&o&&(0,J.jsx)(I,{height:1,flexDirection:`row`,children:s?(0,J.jsx)(L,{dimColor:!r,color:`inactive`,children:c?(0,J.jsxs)(J.Fragment,{children:[c===1&&s.filesChanged[0]?`${G.basename(s.filesChanged[0])} `:`${c} files changed `,(0,J.jsx)(Be,{diffStats:s})]}):(0,J.jsx)(J.Fragment,{children:`No code changes`})}):(0,J.jsxs)(L,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!S&&(0,J.jsx)(L,{dimColor:!0,italic:!0,children:R.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,R.keyName,` again to exit`]}):(0,J.jsxs)(J.Fragment,{children:[!f&&x&&`Enter to continue · `,`Esc to exit`]})})]})]})}function Le(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 Re({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,J.jsxs)(I,{flexDirection:`column`,children:[(0,J.jsx)(L,{dimColor:!0,children:Le(e)}),!Z(e)&&(r?(0,J.jsx)(ze,{diffStatsForRestore:n}):(0,J.jsx)(L,{dimColor:!0,children:`The code will be unchanged.`}))]})}function ze({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged?.[0])return(0,J.jsx)(L,{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)(L,{dimColor:!0,children:[`The code will be restored `,(0,J.jsx)(Be,{diffStats:e}),` in `,n,`.`]})}function Be({diffStats:e}){if(e?.filesChanged)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(L,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,J.jsxs)(L,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function Ve({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:a}=R();if(r)return(0,J.jsx)(I,{width:`100%`,children:(0,J.jsx)(L,{italic:!0,color:t,dimColor:n,children:`(current)`})});let o=e.message.content,c=typeof o==`string`?null:o[o.length-1],l=de(typeof o==`string`?o.trim():c&&Fe(c)?c.text.trim():`(no prompt)`);if(f(l))return(0,J.jsx)(I,{flexDirection:`row`,width:`100%`,children:(0,J.jsx)(L,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(l.includes(`<bash-input>`)){let e=s(l,`bash-input`);if(e)return(0,J.jsxs)(I,{flexDirection:`row`,width:`100%`,children:[(0,J.jsx)(L,{color:`bashBorder`,children:`!`}),(0,J.jsxs)(L,{color:t,dimColor:n,children:[` `,e]})]})}if(l.includes(`<command-message>`)){let e=s(l,B),r=s(l,`command-args`),i=s(l,`skill-format`)===`true`;if(e)return i?(0,J.jsx)(I,{flexDirection:`row`,width:`100%`,children:(0,J.jsxs)(L,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,J.jsx)(I,{flexDirection:`row`,width:`100%`,children:(0,J.jsxs)(L,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,J.jsx)(I,{flexDirection:`row`,width:`100%`,children:(0,J.jsx)(L,{color:t,dimColor:n,children:i?ge(l,a-i,!0):l.slice(0,500).split(`
|
|
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{$p as a,Ip as o,Jx as s,Lp as c,Lu as l,Qo as u,Qp as d,Sa as f,Ta as p,Xx as m,Yi as h,Zo as g,Zp as _,bb as v,es as y,gc as b,hc as x,im as S,ix as C,kS as w,l_ as T,mb as E,mc as D,mn as O,pS as k,rx as A,tn as j,tx as M,uS as N,u_ as ee,un as te,vc as P,zu as F}from"./loadAgentsDir-B0Anodo0.js";import{C as ne,Gt as re,I,P as L,Wt as ie,ai as ae,ot as R,t as oe}from"./src-DL3w8VPk.js";import{t as se}from"./jsx-runtime-Bb4Xn-E0.js";import{It as ce,Mn as le}from"./state-B4jiUise.js";import{Hn as ue,Vn as z}from"./settings-B2jvL8Dp.js";import{D as B,h as de,m as V,o as fe,q as pe,s as H}from"./log-D2TIwHBV.js";import{n as U,r as W}from"./analytics-DJobLaWP.js";import{_ as me,p as he,y as ge}from"./startupProfiler-CJdr3SxP.js";import{E as _e,T as ve,c as ye,d as be,w as xe}from"./sessionTracing-CtbeAD0s.js";import{n as Se,t as Ce}from"./useExitOnCtrlCDWithKeybindings-BKwzUpgb.js";import{n as we,t as Te}from"./select-DIxfl_VN.js";import{r as Ee,t as De}from"./Spinner-ByQXTvAA.js";import*as G from"path";import{randomUUID as K}from"crypto";var q=t(ae(),1),J=se();oe(),ce(),pe(),V(),fe(),ue(),U(),me(),A(),T(),xe(),l(),ye(),b(),D(),y(),h(),O();function Oe(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 ke(e){let t=e.toLowerCase().trim();return t===`continue`||/\b(keep going|go on)\b/.test(t)}function Ae(e,t,n,r,i,a,o){let s=K();le(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;be(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&ve(`user_prompt`,{prompt_length:String(l.length),prompt:_e(l),"prompt.id":s}),W(`tengu_input_prompt`,{is_negative:Oe(c),is_keep_going:ke(c)}),t.length>0?{messages:[k({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:[k({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}U(),h();async function je({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,ideSelection:o,messages:s,setUserInputOnProcessing:c,uuid:l,isAlreadyProcessing:u,querySource:d,canUseTool:f,skipSlashCommands:p,bridgeOrigin:h,isMeta:_,skipAttachments:v,autonomy:y}){let b=typeof e==`string`?e:null,x=b?.startsWith(`/`)&&!p;n===`prompt`&&b!==null&&!_&&!x&&c?.(b),P(`query_process_user_input_base_start`);let S=i.getAppState(),C=await Ne(e,n,r,i,a,o,s,l,u,d,f,S.toolPermissionContext.mode,p,h,_,v,t,y);if(P(`query_process_user_input_base_end`),!C.shouldQuery)return C;P(`query_hooks_start`);let w=m(e)||``;for await(let t of j(w,S.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[N(`${te(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:C.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return C.messages.push(k({content:e})),C.shouldQuery=!1,C}if(t.additionalContexts&&t.additionalContexts.length>0&&C.messages.push(g({type:`hook_additional_context`,content:t.additionalContexts.map(Me),hookName:`UserPromptSubmit`,toolUseID:`hook-${K()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;C.messages.push({...t.message,attachment:{...t.message.attachment,content:Me(t.message.attachment.content)}});break;default:C.messages.push(t.message);break}}return P(`query_hooks_end`),C}var Y=1e4;function Me(e){return e.length>Y?`${e.substring(0,Y)}… [output truncated - exceeded ${Y} characters]`:e}async function Ne(e,t,n,r,i,a,o,s,c,l,d,f,p,m,h,g,_,v){let y=null,b=[],S=[],w=e;if(typeof e==`string`)y=e;else if(e.length>0){P(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await C(n);if(e.dimensions){let t=M(e.dimensions);t&&S.push(t)}t.push(e.block)}else t.push(n);w=t,P(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(y=n.text,b=t.slice(0,-1)):b=t}if(y===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let T=i?Object.values(i).filter(ee):[],E=T.map(e=>e.id),D=i?await F(i):new Map;P(`query_pasted_image_processing_start`);let O=await Promise.all(T.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return W(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await C(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??D.get(e.id)}})),k=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of O){if(e.dimensions){let t=M(e.dimensions,n);t&&S.push(t)}else if(t){let e=M(t,n);e&&S.push(e)}else n&&S.push(`[Image source: ${n}]`);k.push(e.block)}P(`query_pasted_image_processing_end`);let A=p,j=!g&&y!==null&&(t!==`prompt`||A||!y.startsWith(`/`));P(`query_attachment_loading_start`);let N=j?await x(u(y,r,a??null,[],o,l)):[];if(P(`query_attachment_loading_end`),y!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-D098WsqY.js`);return X(await e(y,b,N,r,n),S)}if(y!==null&&!A&&y.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-DOQFjJ88.js`);return X(await e(y,b,k,N,r,n,s,c,d,v),S)}if(y!==null&&t===`prompt`){let e=y.trim(),t=N.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;W(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return X(Ae(w,k,E,N,s,f,h),S)}function X(e,t){return t.length>0&&e.messages.push(k({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}var Pe=n({MessageSelector:()=>Ie,messagesAfterAreOnlySynthetic:()=>Ue,selectableUserMessagesFilter:()=>Q});function Fe(e){return e.type===`text`}function Z(e){return e===`summarize`}function Ie({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:o,onClose:s,preselectedMessage:l}){let u=c(e=>e.fileHistory),[f,p]=(0,q.useState)(void 0),m=d(),h=(0,q.useMemo)(K,[]),g=(0,q.useMemo)(()=>[...e.filter(Q),{...k({content:``}),uuid:h}],[e,h]),[v,y]=(0,q.useState)(g.length-1),b=Math.max(0,Math.min(v-Math.floor($/2),g.length-$)),x=g.length>1,[S,C]=(0,q.useState)(l),[w,T]=(0,q.useState)(void 0);(0,q.useEffect)(()=>{if(!l||!m)return;let e=!1;return a(u,l.uuid).then(t=>{e||T(t)}),()=>{e=!0}},[l,m,u]);let[E,D]=(0,q.useState)(!1),[O,A]=(0,q.useState)(null),[j,M]=(0,q.useState)(`both`),[N,ee]=(0,q.useState)(``);function te(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:ee}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,q.useEffect)(()=>{W(`tengu_message_selector_opened`,{})},[]);async function P(e){t(),D(!0);try{await n(e),D(!1),s()}catch(e){H(e),D(!1),p(`Failed to restore the conversation:\n${e}`)}}async function F(t){let n=e.indexOf(t);if(W(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){s();return}if(!m){await P(t);return}let r=await a(u,t.uuid);C(t),T(r)}async function ae(e){if(W(`tengu_message_selector_restore_option_selected`,{option:e}),!S){p(`Message not found.`);return}if(e===`nevermind`){l?s():C(void 0);return}if(Z(e)){t(),D(!0),A(e),p(void 0);try{let e=N.trim()||void 0;await o(S,e,`from`),D(!1),A(null),C(void 0),s()}catch(e){H(e),D(!1),A(null),C(void 0),p(`Failed to summarize:\n${e}`)}return}t(),D(!0),p(void 0);let i=null,a=null;if(e===`code`||e===`both`)try{await r(S)}catch(e){i=e,H(i)}if(e===`conversation`||e===`both`)try{await n(S)}catch(e){a=e,H(a)}D(!1),C(void 0),a&&i?p(`Failed to restore the conversation and code:\n${a}\n${i}`):a?p(`Failed to restore the conversation:\n${a}`):i?p(`Failed to restore the code:\n${i}`):s()}let R=Se(),oe=(0,q.useCallback)(()=>{if(S&&!l){C(void 0);return}W(`tengu_message_selector_cancelled`,{}),s()},[s,S,l]),se=(0,q.useCallback)(()=>y(e=>Math.max(0,e-1)),[]),ce=(0,q.useCallback)(()=>y(e=>Math.min(g.length-1,e+1)),[g.length]),le=(0,q.useCallback)(()=>y(0),[]),ue=(0,q.useCallback)(()=>y(g.length-1),[g.length]),z=(0,q.useCallback)(()=>{let e=g[v];e&&F(e)},[g,v,F]);ie(`confirm:no`,oe,{context:`Confirmation`,isActive:!S}),re({"messageSelector:up":se,"messageSelector:down":ce,"messageSelector:top":le,"messageSelector:bottom":ue,"messageSelector:select":z},{context:`MessageSelector`,isActive:!E&&!f&&!S&&x});let[B,de]=(0,q.useState)({});(0,q.useEffect)(()=>{async function t(){m&&Promise.all(g.map(async(t,n)=>{if(t.uuid!==h){let r=_(u,t.uuid),i=g.at(n+1),a=r?He(e,t.uuid,i?.uuid===h?void 0:i?.uuid):void 0;de(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[g,e,h,u,m]);let V=m&&w?.filesChanged&&w.filesChanged.length>0,fe=!f&&!S&&!l&&x;return(0,J.jsxs)(I,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(ne,{color:`suggestion`}),(0,J.jsxs)(I,{flexDirection:`column`,marginX:1,gap:1,children:[(0,J.jsx)(L,{bold:!0,color:`suggestion`,children:`Rewind`}),f&&(0,J.jsxs)(L,{color:`error`,children:[`Error: `,f]}),!x&&(0,J.jsx)(L,{children:`Nothing to rewind to yet.`}),!f&&S&&x&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(L,{children:[`Confirm you want to restore `,!w&&`the conversation `,`to the point before you sent this message:`]}),(0,J.jsxs)(I,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,J.jsx)(Ve,{userMessage:S,color:`text`,isCurrent:!1}),(0,J.jsxs)(L,{dimColor:!0,children:[`(`,he(new Date(S.timestamp)),`)`]})]}),(0,J.jsx)(Re,{selectedRestoreOption:j,canRestoreCode:!!V,diffStatsForRestore:w}),E&&Z(O)?(0,J.jsxs)(I,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(De,{}),(0,J.jsx)(L,{children:`Summarizing…`})]}):(0,J.jsx)(Te,{isDisabled:E,options:te(!!V),defaultFocusValue:V?`both`:`conversation`,onFocus:e=>M(e),onChange:e=>ae(e),onCancel:()=>l?s():C(void 0)}),V&&(0,J.jsx)(I,{marginBottom:1,children:(0,J.jsxs)(L,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),fe&&(0,J.jsxs)(J.Fragment,{children:[m?(0,J.jsx)(L,{children:`Restore the code and/or conversation to the point before…`}):(0,J.jsx)(L,{children:`Restore and fork the conversation to the point before…`}),(0,J.jsx)(I,{width:`100%`,flexDirection:`column`,children:g.slice(b,b+$).map((e,t)=>{let n=b+t,r=n===v,a=e.uuid===h,o=n in B,s=B[n],c=s?.filesChanged?.length;return(0,J.jsxs)(I,{height:m?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,J.jsx)(I,{width:2,minWidth:2,children:r?(0,J.jsxs)(L,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,J.jsx)(L,{children:` `})}),(0,J.jsxs)(I,{flexDirection:`column`,children:[(0,J.jsx)(I,{flexShrink:1,height:1,overflow:`hidden`,children:(0,J.jsx)(Ve,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),m&&o&&(0,J.jsx)(I,{height:1,flexDirection:`row`,children:s?(0,J.jsx)(L,{dimColor:!r,color:`inactive`,children:c?(0,J.jsxs)(J.Fragment,{children:[c===1&&s.filesChanged[0]?`${G.basename(s.filesChanged[0])} `:`${c} files changed `,(0,J.jsx)(Be,{diffStats:s})]}):(0,J.jsx)(J.Fragment,{children:`No code changes`})}):(0,J.jsxs)(L,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!S&&(0,J.jsx)(L,{dimColor:!0,italic:!0,children:R.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,R.keyName,` again to exit`]}):(0,J.jsxs)(J.Fragment,{children:[!f&&x&&`Enter to continue · `,`Esc to exit`]})})]})]})}function Le(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 Re({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,J.jsxs)(I,{flexDirection:`column`,children:[(0,J.jsx)(L,{dimColor:!0,children:Le(e)}),!Z(e)&&(r?(0,J.jsx)(ze,{diffStatsForRestore:n}):(0,J.jsx)(L,{dimColor:!0,children:`The code will be unchanged.`}))]})}function ze({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged?.[0])return(0,J.jsx)(L,{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)(L,{dimColor:!0,children:[`The code will be restored `,(0,J.jsx)(Be,{diffStats:e}),` in `,n,`.`]})}function Be({diffStats:e}){if(e?.filesChanged)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(L,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,J.jsxs)(L,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function Ve({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:a}=R();if(r)return(0,J.jsx)(I,{width:`100%`,children:(0,J.jsx)(L,{italic:!0,color:t,dimColor:n,children:`(current)`})});let o=e.message.content,c=typeof o==`string`?null:o[o.length-1],l=de(typeof o==`string`?o.trim():c&&Fe(c)?c.text.trim():`(no prompt)`);if(f(l))return(0,J.jsx)(I,{flexDirection:`row`,width:`100%`,children:(0,J.jsx)(L,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(l.includes(`<bash-input>`)){let e=s(l,`bash-input`);if(e)return(0,J.jsxs)(I,{flexDirection:`row`,width:`100%`,children:[(0,J.jsx)(L,{color:`bashBorder`,children:`!`}),(0,J.jsxs)(L,{color:t,dimColor:n,children:[` `,e]})]})}if(l.includes(`<command-message>`)){let e=s(l,B),r=s(l,`command-args`),i=s(l,`skill-format`)===`true`;if(e)return i?(0,J.jsx)(I,{flexDirection:`row`,width:`100%`,children:(0,J.jsxs)(L,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,J.jsx)(I,{flexDirection:`row`,width:`100%`,children:(0,J.jsxs)(L,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,J.jsx)(I,{flexDirection:`row`,width:`100%`,children:(0,J.jsx)(L,{color:t,dimColor:n,children:i?ge(l,a-i,!0):l.slice(0,500).split(`
|
|
2
2
|
`).slice(0,4).join(`
|
|
3
3
|
`)})})}function He(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||!p(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`||w(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&&Fe(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 Ue(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!w(t)&&!p(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 $,We=e((()=>{r(),U(),o(),S(),Ce(),E(),h(),we(),Ee(),v(),$=7}));export{Q as a,Ue as i,Pe as n,je as o,We as r,Ie as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DfkgIdYf.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$i as o,$u as s,$x as c,Ca as l,Cu as u,Du as d,Eu as f,Ip as p,Jx as m,Lp as h,Mf as g,Nf as _,Op as v,Ou as y,Qu as b,Qx as x,Tu as S,YC as C,Yi as w,__ as T,_u as E,aS as D,bS as O,bb as ee,bu as te,cb as ne,dC as re,db as ie,du as k,ea as A,fC as ae,fa as j,fb as oe,gC as se,g_ as ce,ga as le,gb as ue,hb as M,ia as N,kp as de,lb as fe,ld as pe,lu as P,ma as me,mm as he,na as ge,oa as _e,ob as ve,p_ as ye,qC as be,ra as xe,ta as Se,ua as Ce,ub as we,ud as Te,uu as Ee,vu as De,wu as Oe,xS as ke,yC as F,yS as Ae,y_ as je,yu as Me}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DfkgIdYf.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$i as o,$u as s,$x as c,Ca as l,Cu as u,Du as d,Eu as f,Ip as p,Jx as m,Lp as h,Mf as g,Nf as _,Op as v,Ou as y,Qu as b,Qx as x,Tu as S,YC as C,Yi as w,__ as T,_u as E,aS as D,bS as O,bb as ee,bu as te,cb as ne,dC as re,db as ie,du as k,ea as A,fC as ae,fa as j,fb as oe,gC as se,g_ as ce,ga as le,gb as ue,hb as M,ia as N,kp as de,lb as fe,ld as pe,lu as P,ma as me,mm as he,na as ge,oa as _e,ob as ve,p_ as ye,qC as be,ra as xe,ta as Se,ua as Ce,ub as we,ud as Te,uu as Ee,vu as De,wu as Oe,xS as ke,yC as F,yS as Ae,y_ as je,yu as Me}from"./loadAgentsDir-B0Anodo0.js";import{C as Ne,Gr as I,I as L,N as Pe,P as R,Pn as Fe,Rn as Ie,ai as z,di as Le,fi as Re,j as ze,mt as Be,ot as Ve,t as B,xt as He}from"./src-DL3w8VPk.js";import{t as V}from"./jsx-runtime-Bb4Xn-E0.js";import{n as Ue,t as We}from"./cwd-Pa83R95t.js";import{a as Ge,c as H,i as Ke,n as qe,o as Je}from"./debug-Bglx1aTu.js";import{Ht as Ye,Vt as Xe,h as Ze,t as Qe}from"./settings-B2jvL8Dp.js";import{_ as $e,p as et,s as tt}from"./config-C-Y2qtB2.js";import{B as nt,L as rt,R as it,q as at}from"./log-D2TIwHBV.js";import{l as ot,o as st}from"./stringUtils-C718f5ey.js";import{_ as ct,f as lt,p as ut,y as dt}from"./startupProfiler-CJdr3SxP.js";import{b as ft,d as pt,m as mt}from"./model-BvQFFOf8.js";import{gn as ht,vn as gt}from"./prompt-CJ1l3XXk.js";import{a as _t,n as vt,r as yt,t as bt}from"./projectOnboardingState-B5YATuc6.js";import{h as xt,m as St}from"./firstPartyEventLogger-QmjjQmgt.js";import{n as Ct,t as wt}from"./systemTheme-Ceakddth.js";import{a as Tt,c as Et,i as Dt}from"./SpinnerGlyph-CmkRUvHe.js";import{n as Ot,r as kt}from"./PromptInputFooterSuggestions-HI6HH3TP.js";import{n as At,t as jt}from"./useMainLoopModel-DxvV70Ru.js";import{n as Mt,t as Nt}from"./modalContext-DDZdU1J8.js";import{n as Pt,r as Ft,t as It}from"./statusNoticeHelpers-BRQpUIlH.js";import{a as Lt,c as Rt,i as zt,l as Bt,n as Vt,o as Ht,r as Ut,t as Wt,u as Gt}from"./logoUtils-CRxTutvr.js";import{homedir as Kt}from"os";import{relative as qt}from"path";import{fileURLToPath as Jt}from"url";function Yt(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var Xt=e((()=>{}));function Zt(e){if(e.type!==`user`)return!1;let t=Array.isArray(e.message.content)?e.message.content[0]:void 0;return!t||typeof t==`string`||t?.type!==`text`||!t.text.includes(`<task-notification`)||m(t.text,`status`)!==`completed`?!1:m(t.text,`summary`)?.startsWith(`Background command `)??!1}function Qt(e,t){if(!de()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(Zt(t)){let i=0;for(;r<e.length&&Zt(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${nt}><${rt}>completed</${rt}><${it}>${i} background commands completed</${it}></${nt}>`}]}})}else n.push(t),r++}return n}var $t=e((()=>{at(),he(),v(),w()}));function en(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function tn(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(en(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!en(t)||t.hookLabel!==i)break;a.push(t),n++}a.length===1?t.push(r):t.push({...r,hookCount:a.reduce((e,t)=>e+t.hookCount,0),hookInfos:a.flatMap(e=>e.hookInfos),hookErrors:a.flatMap(e=>e.hookErrors),preventedContinuation:a.some(e=>e.preventedContinuation),hasOutput:a.some(e=>e.hasOutput),totalDurationMs:Math.max(...a.map(e=>e.totalDurationMs??0))})}else t.push(r),n++}return t}var nn=e((()=>{}));function rn(e){let t=sn.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),sn.set(e,t)),t}function an(e){if(e.type===`assistant`&&e.message?.content&&Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_use`){let t=e.message.content[0];return{messageId:e.message.id,toolUseId:t.id,toolName:t.name}}return null}function on(e,t,n=!1){if(n)return{messages:e};let r=rn(t),i=new Map;for(let t of e){let e=an(t);if(e&&r.has(e.toolName)){let n=`${e.messageId}:${e.toolName}`,r=i.get(n)??[];r.push(t),i.set(n,r)}}let a=new Map,o=new Set;for(let[e,t]of i)if(t.length>=2){a.set(e,t);for(let e of t){let t=an(e);t&&o.add(t.toolUseId)}}let s=new Map;for(let t of e)if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content))for(let e of t.message.content)e.type===`tool_result`&&o.has(e.tool_use_id)&&s.set(e.tool_use_id,t);let c=[],l=new Set;for(let t of e){let e=an(t);if(e){let t=`${e.messageId}:${e.toolName}`,n=a.get(t);if(n){if(!l.has(t)){l.add(t);let r=n[0],i=[];for(let e of n){let t=e.message.content[0].id,n=s.get(t);n&&i.push(n)}let a={type:`grouped_tool_use`,toolName:e.toolName,messages:n,results:i,displayMessage:r,uuid:`grouped-${r.uuid}`,timestamp:r.timestamp,messageId:e.messageId};c.push(a)}continue}}if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content)){let e=t.message.content.filter(e=>e.type===`tool_result`);if(e.length>0&&e.every(e=>o.has(e.tool_use_id)))continue}c.push(t)}return{messages:c}}var sn,cn=e((()=>{sn=new WeakMap}));function ln(e){let t=hn.get(e);if(t!==void 0)return t;let n=un(e).toLowerCase();return hn.set(e,n),n}function un(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=mn.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?mn.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(fn(e.toolUseResult));t=r.join(`
|
|
2
2
|
`)}break}case`assistant`:{let n=e.message.content;Array.isArray(n)&&(t=n.flatMap(e=>e.type===`text`?[e.text]:e.type===`tool_use`?[dn(e.input)]:[]).join(`
|
|
3
3
|
`));break}case`attachment`:if(e.attachment.type===`relevant_memories`)t=(e.attachment.memories??[]).map(e=>e.content).join(`
|
|
4
4
|
`);else if(e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text]:[]).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{mb as t}from"./loadAgentsDir-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{mb as t}from"./loadAgentsDir-B0Anodo0.js";import{Gt as n,H as r,I as i,Lt as a,P as o,ai as s,kt as c,t as l}from"./src-DL3w8VPk.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as d,qt as f}from"./settings-B2jvL8Dp.js";import{n as p,r as m}from"./analytics-DJobLaWP.js";import{c as h,i as g,s as _}from"./terminalSetup-B_10N_gE.js";import{n as v,t as y}from"./useExitOnCtrlCDWithKeybindings-BKwzUpgb.js";import{n as b,t as x}from"./select-DIxfl_VN.js";import{r as S}from"./Spinner-ByQXTvAA.js";import{n as C,t as w}from"./ThemePicker-BQErFFW1.js";import{n as T,t as E}from"./PressEnterToContinue-DZc_s_pE.js";var D=e(s(),1),O=u();p(),f(),t(),g(),y(),l(),l(),S(),b(),l();var k=58;function A(){let[e]=r(),t=`Welcome to Work Mate`;return d.terminal===`Apple_Terminal`?(0,O.jsx)(j,{theme:e,welcomeMessage:t}):[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,O.jsxs)(i,{width:k,flexDirection:`column`,children:[(0,O.jsxs)(o,{children:[(0,O.jsxs)(o,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,O.jsxs)(o,{dimColor:!0,children:[`v`,`0.0.24`,` `]})]}),(0,O.jsx)(o,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,O.jsx)(o,{children:` ░░░░░░ `}),(0,O.jsx)(o,{children:` ░░░ ░░░░░░░░░░ `}),(0,O.jsx)(o,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,O.jsx)(o,{children:` `})]}):(0,O.jsxs)(i,{width:k,flexDirection:`column`,children:[(0,O.jsxs)(o,{children:[(0,O.jsxs)(o,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,O.jsxs)(o,{dimColor:!0,children:[`v`,`0.0.24`,` `]})]}),(0,O.jsx)(o,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,O.jsx)(o,{children:` * █████▓▓░ `}),(0,O.jsx)(o,{children:` * ███▓░ ░░ `}),(0,O.jsx)(o,{children:` ░░░░░░ ███▓░ `}),(0,O.jsx)(o,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,O.jsxs)(o,{children:[(0,O.jsx)(o,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,O.jsx)(o,{bold:!0,children:`*`}),(0,O.jsx)(o,{children:` ██▓░░ ▓ `})]}),(0,O.jsx)(o,{children:` ░▓▓███▓▓░ `}),(0,O.jsx)(o,{dimColor:!0,children:` * ░░░░ `}),(0,O.jsx)(o,{dimColor:!0,children:` ░░░░░░░░ `}),(0,O.jsx)(o,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,O.jsx)(o,{dimColor:!0,children:` * `})]})}function j({theme:e,welcomeMessage:t}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,O.jsxs)(i,{width:k,flexDirection:`column`,children:[(0,O.jsxs)(o,{children:[(0,O.jsxs)(o,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,O.jsxs)(o,{dimColor:!0,children:[`v`,`0.0.24`,` `]})]}),(0,O.jsx)(o,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,O.jsx)(o,{children:` ░░░░░░ `}),(0,O.jsx)(o,{children:` ░░░ ░░░░░░░░░░ `}),(0,O.jsx)(o,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,O.jsx)(o,{children:` `})]}):(0,O.jsxs)(i,{width:k,flexDirection:`column`,children:[(0,O.jsxs)(o,{children:[(0,O.jsxs)(o,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,O.jsxs)(o,{dimColor:!0,children:[`v`,`0.0.24`,` `]})]}),(0,O.jsx)(o,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,O.jsx)(o,{children:` * █████▓▓░ `}),(0,O.jsx)(o,{children:` * ███▓░ ░░ `}),(0,O.jsx)(o,{children:` ░░░░░░ ███▓░ `}),(0,O.jsx)(o,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,O.jsxs)(o,{children:[(0,O.jsx)(o,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,O.jsx)(o,{bold:!0,children:`*`}),(0,O.jsx)(o,{children:` ██▓░░ ▓ `})]}),(0,O.jsx)(o,{children:` ░▓▓███▓▓░ `}),(0,O.jsx)(o,{dimColor:!0,children:` * ░░░░ `}),(0,O.jsx)(o,{dimColor:!0,children:` ░░░░░░░░ `}),(0,O.jsx)(o,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}C(),T(),l();var M=(0,D.createContext)({marker:``});function N({children:e}){let{marker:t}=(0,D.useContext)(M);return(0,O.jsxs)(i,{gap:1,children:[(0,O.jsx)(o,{dimColor:!0,children:t}),(0,O.jsx)(i,{flexDirection:`column`,children:e})]})}l();var P=(0,D.createContext)({marker:``});function F({children:e}){let{marker:t}=(0,D.useContext)(P),n=0;for(let t of D.Children.toArray(e))!(0,D.isValidElement)(t)||t.type!==N||n++;let r=String(n).length;return(0,O.jsx)(i,{flexDirection:`column`,children:D.Children.map(e,(e,n)=>{if(!(0,D.isValidElement)(e)||e.type!==N)return e;let i=`${String(n+1).padStart(r)}.`,a=`${t}${i}`;return(0,O.jsx)(P.Provider,{value:{marker:a},children:(0,O.jsx)(M.Provider,{value:{marker:a},children:e})})})})}F.Item=N;var I=F;l(),f();function L({onDone:e}){let[t,s]=(0,D.useState)(0),[l,u]=r();(0,D.useEffect)(()=>{m(`tengu_began_setup`,{})},[]);function f(){if(t<S.length-1){let e=t+1;s(e),m(`tengu_onboarding_step`,{stepId:S[e]?.id})}else e()}function p(e){u(e),f()}let g=v(),y=(0,O.jsx)(i,{marginX:1,children:(0,O.jsx)(w,{onThemeSelect:p,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),b=(0,O.jsxs)(i,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,O.jsx)(o,{bold:!0,children:`Before you start, keep in mind:`}),(0,O.jsx)(i,{flexDirection:`column`,width:70,children:(0,O.jsxs)(I,{children:[(0,O.jsxs)(I.Item,{children:[(0,O.jsx)(o,{children:`Always review changes before accepting`}),(0,O.jsxs)(o,{dimColor:!0,wrap:`wrap`,children:[`Work Mate can make mistakes — especially when running commands`,(0,O.jsx)(c,{}),`or editing files. You stay in control of every action.`,(0,O.jsx)(c,{})]})]}),(0,O.jsxs)(I.Item,{children:[(0,O.jsx)(o,{children:`Only use Work Mate on projects you trust`}),(0,O.jsxs)(o,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,O.jsx)(c,{}),(0,O.jsx)(a,{url:`https://code.workmate.com/docs/en/security`})]})]})]})}),(0,O.jsx)(E,{})]}),S=[];S.push({id:`theme`,component:y}),S.push({id:`security`,component:b}),h()&&S.push({id:`terminal-setup`,component:(0,O.jsxs)(i,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,O.jsx)(o,{bold:!0,children:`Use Work Mate's terminal setup?`}),(0,O.jsxs)(i,{flexDirection:`column`,width:70,gap:1,children:[(0,O.jsxs)(o,{children:[`For the optimal coding experience, enable the recommended settings`,(0,O.jsx)(c,{}),`for your terminal:`,` `,d.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,O.jsx)(x,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?_(l).catch(()=>{}).finally(f):f()},onCancel:()=>f()}),(0,O.jsx)(o,{dimColor:!0,children:g.pending?(0,O.jsxs)(O.Fragment,{children:[`Press `,g.keyName,` again to exit`]}):(0,O.jsx)(O.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let C=S[t],T=(0,D.useCallback)(()=>{t===S.length-1?e():f()},[t,S.length,e]),k=(0,D.useCallback)(()=>{f()},[t,S.length,e]);return n({"confirm:yes":T},{context:`Confirmation`,isActive:C?.id===`security`}),n({"confirm:no":k},{context:`Confirmation`,isActive:C?.id===`terminal-setup`}),(0,O.jsxs)(i,{flexDirection:`column`,children:[(0,O.jsx)(A,{}),(0,O.jsxs)(i,{flexDirection:`column`,marginTop:1,children:[C?.component,g.pending&&(0,O.jsx)(i,{padding:1,children:(0,O.jsxs)(o,{dimColor:!0,children:[`Press `,g.keyName,` again to exit`]})})]})]})}export{L as Onboarding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{bb as n}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{bb as n}from"./loadAgentsDir-B0Anodo0.js";import{Gr as r,I as i,P as a,ai as o,ot as s,t as c}from"./src-DL3w8VPk.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{S as u,_ as d,b as f}from"./startupProfiler-CJdr3SxP.js";function p(e){return e.startsWith(`file-`)?`+`:e.startsWith(`mcp-resource-`)?`◇`:e.startsWith(`agent-`)?`*`:`+`}function m(e){return e.startsWith(`file-`)||e.startsWith(`mcp-resource-`)||e.startsWith(`agent-`)}function h({suggestions:e,selectedSuggestion:t,maxColumnWidth:n,overlay:a}){let{rows:o}=s(),c=a?5:Math.min(6,Math.max(1,o-3));if(e.length===0)return null;let l=n??Math.max(...e.map(e=>r(e.displayText)))+5,u=Math.max(0,Math.min(t-Math.floor(c/2),e.length-c)),d=Math.min(u+c,e.length),f=e.slice(u,d);return(0,_.jsx)(i,{flexDirection:`column`,justifyContent:a?void 0:`flex-end`,children:f.map(n=>(0,_.jsx)(v,{item:n,maxColumnWidth:l,isSelected:n.id===e[t]?.id},n.id))})}var g,_,v,y,b=e((()=>{g=t(o(),1),n(),c(),d(),_=l(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:n}){let i=s().columns;if(m(e.id)){let t=p(e.id),o=n?`suggestion`:void 0,s=!n,c=e.id.startsWith(`file-`),l=e.id.startsWith(`mcp-resource-`),d=e.description?3:0,m;if(c){let t=e.description?Math.min(20,r(e.description)):0,n=i-2-4-d-t;m=f(e.displayText,n)}else m=l?u(e.displayText,30):e.displayText;let h=i-2-r(m)-d-4,g;if(e.description){let n=Math.max(0,h),r=u(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(a,{color:o,dimColor:s,wrap:`truncate`,children:g})}let o=Math.floor(i*.4),c=Math.min(t??r(e.displayText)+5,o),l=e.color||(n?`suggestion`:void 0),d=!n,h=e.displayText;r(h)>c-2&&(h=u(h,c-2));let g=h+` `.repeat(Math.max(0,c-r(h))),v=e.tag?`[${e.tag}] `:``,y=r(v),b=Math.max(0,i-c-y-4),x=e.description?u(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(a,{wrap:`truncate`,children:[(0,_.jsx)(a,{color:l,dimColor:d,children:g}),v?(0,_.jsx)(a,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(a,{color:n?`suggestion`:void 0,dimColor:!n,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
|