@readmagic/workmate 0.0.27 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddWorkspaceDirectory-DqlPtsVK.js → AddWorkspaceDirectory-Bmgh8VS3.js} +1 -1
- package/dist/chunks/{AgentsMdExternalIncludesDialog-rJS5l6yk.js → AgentsMdExternalIncludesDialog-BJfHqScU.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-BjbUilCE.js +1 -0
- package/dist/chunks/{App-DzRQpRKr.js → App-COdpsR2w.js} +1 -1
- package/dist/chunks/{BackgroundTasksDialog-CBhSmdz_.js → BackgroundTasksDialog-WkoL4g5Q.js} +1 -1
- package/dist/chunks/{BypassPermissionsModeDialog-zz-lnmJt.js → BypassPermissionsModeDialog-BT9yl0Qt.js} +1 -1
- package/dist/chunks/{CustomSelect-CYmc4vRh.js → CustomSelect-t4wXuXWH.js} +1 -1
- package/dist/chunks/{DiffDialog-CTUIAcEE.js → DiffDialog-CXZxnb7Y.js} +1 -1
- package/dist/chunks/Doctor-B6isid5K.js +1 -0
- package/dist/chunks/{Doctor-CLOYkPRR.js → Doctor-COj-tZBc.js} +1 -1
- package/dist/chunks/{ExitFlow-CATwJC4c.js → ExitFlow-CcMYH5iI.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-B-9Z58oD.js → InvalidConfigDialog-riLYEaUP.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-B4EWjbp7.js → InvalidSettingsDialog-BGXl3V1A.js} +1 -1
- package/dist/chunks/{KeybindingProviderSetup-Dzg77_Xn.js → KeybindingProviderSetup-syiDgtpB.js} +1 -1
- package/dist/chunks/{MCPConnectionManager-CBY8nqdU.js → MCPConnectionManager-C7RmKzJh.js} +1 -1
- package/dist/chunks/{MCPToolListView-C7HT6rrl.js → MCPToolListView-CewNLJus.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-Dj_Fu5o-.js → McpParsingWarnings-Czze2JPd.js} +1 -1
- package/dist/chunks/{MessageSelector-Dw_ERK_Z.js → MessageSelector-Kc6JlnDX.js} +1 -1
- package/dist/chunks/{Messages-RBfRELKn.js → Messages-BvFYO4Zn.js} +1 -1
- package/dist/chunks/{Onboarding-BRSXxc2E.js → Onboarding-CD_Uv5h9.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-ChpyD9B7.js → PromptInputFooterSuggestions-CHXJsTtQ.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-CrTT8MKE.js → PromptInputHelpMenu-BZIVCV7V.js} +1 -1
- package/dist/chunks/{ProviderSetup-BEV95bnz.js → ProviderSetup-CwMvjmjh.js} +1 -1
- package/dist/chunks/{QueryEngine-BBBkZWu2.js → QueryEngine-DAwfp_ht.js} +1 -1
- package/dist/chunks/{REPL-BDnZnm__.js → REPL-CtFtb35A.js} +4 -4
- package/dist/chunks/REPL-tFT1FGQF.js +1 -0
- package/dist/chunks/{ResumeConversation-BuSqBrm1.js → ResumeConversation-CERzSBvg.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-ndh4aEwQ.js +1 -0
- package/dist/chunks/{Settings-DYKmPdbd.js → Settings-CPaqWNdP.js} +2 -2
- package/dist/chunks/{Spinner-DOI8qqZi.js → Spinner-C0qHjfIY.js} +1 -1
- package/dist/chunks/{TextInput-ZKU-x_FD.js → TextInput-ou7ZhpVY.js} +1 -1
- package/dist/chunks/{ThemePicker-B69oDgXN.js → ThemePicker-CVFWqSc7.js} +1 -1
- package/dist/chunks/{TrustDialog-BSG8Ibh8.js → TrustDialog-CGXv_LF4.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-BUYHEft4.js → ValidationErrorsList-CKeHoN2Z.js} +1 -1
- package/dist/chunks/{_baseEach-P0u1zIx6.js → _baseEach-BYhqv77g.js} +1 -1
- package/dist/chunks/{add-dir-C8RmmyQK.js → add-dir-BSizpuef.js} +1 -1
- package/dist/chunks/{agentDisplay-np7CH47m.js → agentDisplay-JKfYFD1m.js} +1 -1
- package/dist/chunks/{agents-DRQlR5M1.js → agents-BDTCH6YB.js} +1 -1
- package/dist/chunks/{agents-DedoH0Q4.js → agents-MEaV8P2G.js} +1 -1
- package/dist/chunks/{allErrors-DvcU0w0F.js → allErrors-Dhnf6rqg.js} +1 -1
- package/dist/chunks/{appleTerminalBackup-Bemd4RXh.js → appleTerminalBackup-CN8kS74J.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-Bu-zRFCx.js +1 -0
- package/dist/chunks/{backgroundHousekeeping-BtEJ6TeC.js → backgroundHousekeeping-CsXlkIg3.js} +1 -1
- package/dist/chunks/{banner-CuoceXzz.js → banner-BKOzHotb.js} +1 -1
- package/dist/chunks/{branch-ClhlS7f8.js → branch-BllXcYwS.js} +1 -1
- package/dist/chunks/bridgeControl-aDnUrYZR.js +2 -0
- package/dist/chunks/{btw-B-FLxlx-.js → btw-DzaRBa6o.js} +1 -1
- package/dist/chunks/caches-CMF-MmR-.js +1 -0
- package/dist/chunks/{caches-Dn8yrJmL.js → caches-CW5YnYNS.js} +1 -1
- package/dist/chunks/channel-DVx21qde.js +1 -0
- package/dist/chunks/channel-Gw6skpUh.js +1 -0
- package/dist/chunks/{clear-BnWv0i65.js → clear-CDQs9_5P.js} +1 -1
- package/dist/chunks/commands-CfYMwgP7.js +1 -0
- package/dist/chunks/{compact-Banc-SNk.js → compact-6F2tuItE.js} +1 -1
- package/dist/chunks/config-BDkzWBnL.js +1 -0
- package/dist/chunks/{config-BDn2YIjC.js → config-Bio2EjUK.js} +1 -1
- package/dist/chunks/config-C_AEhZrn.js +1 -0
- package/dist/chunks/{context-BvDBAyJ9.js → context-TkdzCK3Y.js} +1 -1
- package/dist/chunks/{context-noninteractive-CuHHniJn.js → context-noninteractive-BcBo64vo.js} +1 -1
- package/dist/chunks/context-noninteractive-oFcnY1Er.js +1 -0
- package/dist/chunks/{conversation-Cjaftrrw.js → conversation-CYZyg1U1.js} +1 -1
- package/dist/chunks/conversation-DXzlRhNw.js +1 -0
- package/dist/chunks/{conversationRecovery-NL05oJb1.js → conversationRecovery-_hWC7JBO.js} +1 -1
- package/dist/chunks/{crossProjectResume-BzltC4NJ.js → crossProjectResume-CCo3iZrB.js} +1 -1
- package/dist/chunks/{diff--6gQCx_x.js → diff-BzVUPO4Z.js} +1 -1
- package/dist/chunks/doctor-B4jQbGQr.js +1 -0
- package/dist/chunks/{entry-DWYOrkFS.js → entry-333L52Lo.js} +1 -1
- package/dist/chunks/{exit-uKtXb5U3.js → exit-D5DYnRvR.js} +1 -1
- package/dist/chunks/{extraUsage-Dr0YXm1w.js → extraUsage-CmgRR-zH.js} +1 -1
- package/dist/chunks/extractMemories-CVUrBFMj.js +1 -0
- package/dist/chunks/fast-CRhW9zha.js +1 -0
- package/dist/chunks/{fast-C5-lNCQi.js → fast-D7oNjaZ3.js} +1 -1
- package/dist/chunks/{fetchModelList-9w1E4Ue8.js → fetchModelList-Cv1vWIpC.js} +1 -1
- package/dist/chunks/fetchModelList-DIa1HwAJ.js +1 -0
- package/dist/chunks/{fileSuggestions-BYD78vcF.js → fileSuggestions-DF3HTRKr.js} +1 -1
- package/dist/chunks/{gemini-BNBptTET.js → gemini-ou7_YyXc.js} +1 -1
- package/dist/chunks/{generateSessionName-CO2484aJ.js → generateSessionName-CeN9EZNY.js} +1 -1
- package/dist/chunks/{goal-j0wdadwM.js → goal-CCxo4Wyf.js} +1 -1
- package/dist/chunks/{grok-BpO1ZwK_.js → grok-BMmUcNbI.js} +1 -1
- package/dist/chunks/{help-DwhA0qQ6.js → help-CYtogTZk.js} +1 -1
- package/dist/chunks/{hooks-DG4_WdZ2.js → hooks-ByVkvodY.js} +1 -1
- package/dist/chunks/hooks-CBGUcyCs.js +1 -0
- package/dist/chunks/{install-BbmCNCuM.js → install-DIxyfdXG.js} +1 -1
- package/dist/chunks/{instrumentation-DpPmDyNF.js → instrumentation-BmHivmxs.js} +3 -3
- package/dist/chunks/{job-GcmX1ALd.js → job-D534P26R.js} +1 -1
- package/dist/chunks/{launchLocalMemory-CDgT5lst.js → launchLocalMemory-CWXLb3KF.js} +1 -1
- package/dist/chunks/{launchOnboarding-uQ_ux9sS.js → launchOnboarding-CocPmwzz.js} +1 -1
- package/dist/chunks/loadAgentsDir-Zw648oQO.js +1 -0
- package/dist/chunks/{loadAgentsDir-uuZYOgKn.js → loadAgentsDir-bmpKLPdG.js} +343 -343
- package/dist/chunks/{loadPluginHooks-QoVXsBjy.js → loadPluginHooks-BIfM53-_.js} +1 -1
- package/dist/chunks/{localSearch-yVCDrVrf.js → localSearch-Da8cVYoI.js} +1 -1
- package/dist/chunks/localSearch-Dbj8cXyO.js +1 -0
- package/dist/chunks/{logoUtils-B4wCDKs9.js → logoUtils-qNuBc2nI.js} +1 -1
- package/dist/chunks/{magicDocs-D53lV8b5.js → magicDocs-BsEiBLQl.js} +1 -1
- package/dist/chunks/{main-fy_XSXGj.js → main-B31aPMPP.js} +6 -6
- package/dist/chunks/managedEnv-DCGLDTP_.js +1 -0
- package/dist/chunks/{managedEnv-B8YWmM4A.js → managedEnv-EZ2IirNa.js} +1 -1
- package/dist/chunks/{mcp-DCl-Tz-C.js → mcp-BMeWtYCx.js} +1 -1
- package/dist/chunks/{mcp--LmEVBRg.js → mcp-CYbesbfl.js} +1 -1
- package/dist/chunks/{mcp-CZUVaPb3.js → mcp-Dd8TBfQQ.js} +1 -1
- package/dist/chunks/{memory-Bu5ku7y9.js → memory-DtQQGyPS.js} +1 -1
- package/dist/chunks/{mode-Bteqe2QG.js → mode-SM8doWgC.js} +1 -1
- package/dist/chunks/{model-CHDU5yqH.js → model-C2r-PaR4.js} +1 -1
- package/dist/chunks/{model-CcHyMyBv.js → model-Dd3x121y.js} +1 -1
- package/dist/chunks/{modelOptions-CJV1R3Jt.js → modelOptions-BQL4gbNk.js} +1 -1
- package/dist/chunks/{nativeInstaller-CIUYh1aD.js → nativeInstaller-DMkZdsof.js} +1 -1
- package/dist/chunks/{notifications-GLnjirCl.js → notifications-BwS1XsnZ.js} +1 -1
- package/dist/chunks/{onChangeAppState-CxGW2d-l.js → onChangeAppState-C9cYQJPF.js} +1 -1
- package/dist/chunks/{openai-BpGQT2Iv.js → openai-Bea4I2Od.js} +1 -1
- package/dist/chunks/{overlayContext-7wgLio1O.js → overlayContext-C5WPACKC.js} +1 -1
- package/dist/chunks/{partition-djFY9gGI.js → partition-CKgWl7p4.js} +1 -1
- package/dist/chunks/{permissions-DNedQyLg.js → permissions-Dv_PCfY0.js} +1 -1
- package/dist/chunks/{pidLock-CFUBtZck.js → pidLock-CqkC3-nD.js} +2 -2
- package/dist/chunks/{plan-DI0n7LIV.js → plan-Ce6wfjjI.js} +1 -1
- package/dist/chunks/{plugin-BQ8gRVYF.js → plugin-aK4tDrVg.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-CNrHb4RJ.js → pluginAutoupdate-ByokIVEs.js} +1 -1
- package/dist/chunks/{pluginBlocklist-CKCsgWdY.js → pluginBlocklist-ByRQaVPu.js} +1 -1
- package/dist/chunks/{pluginCliCommands-CACeyIwz.js → pluginCliCommands-Dyk4HYHs.js} +1 -1
- package/dist/chunks/{pluginFlagging-CUvkKGOB.js → pluginFlagging-B2ZX5_oB.js} +1 -1
- package/dist/chunks/{pluginOperations-Ca_T-HYn.js → pluginOperations-BCvJvfOC.js} +1 -1
- package/dist/chunks/{pluginStartupCheck-DftTiXct.js → pluginStartupCheck-QG0d95dE.js} +1 -1
- package/dist/chunks/pluginStartupCheck-o_TC7wIt.js +1 -0
- package/dist/chunks/{plugins-Divl-P-X.js → plugins-DzsTDNWJ.js} +1 -1
- package/dist/chunks/{print-DSHypGJa.js → print-dUT7E1g9.js} +2 -2
- package/dist/chunks/{processBashCommand-BLcFmbyG.js → processBashCommand-DtGCgTkF.js} +1 -1
- package/dist/chunks/{processSlashCommand-Caif46Gi.js → processSlashCommand-wXblpK2C.js} +1 -1
- package/dist/chunks/{projectOnboardingState-nTCycGCD.js → projectOnboardingState-D-_ijZnG.js} +1 -1
- package/dist/chunks/prompt-BdH2zk0S.js +1 -0
- package/dist/chunks/{prompt-BfXryFt-.js → prompt-BnDapYGL.js} +1 -1
- package/dist/chunks/prompt-D0TFER0A.js +1 -0
- package/dist/chunks/{protocolHandler-VigBkAQQ.js → protocolHandler-CJO3CRYW.js} +1 -1
- package/dist/chunks/{reconciler-B9XFdL4f.js → reconciler-C_HKsocm.js} +1 -1
- package/dist/chunks/{refresh-CBHbWTGg.js → refresh-Cm4jZzLa.js} +1 -1
- package/dist/chunks/{reject-CBxnwckZ.js → reject-Tug1RmkE.js} +1 -1
- package/dist/chunks/{reload-plugins-5eFWrQlL.js → reload-plugins-CL9LWzpq.js} +1 -1
- package/dist/chunks/{rename-Cw7cMerG.js → rename-OfKJSazJ.js} +1 -1
- package/dist/chunks/{resume-U2D0ybfU.js → resume-BZ42SpS2.js} +1 -1
- package/dist/chunks/{runtimeObserver-DOYlxx9H.js → runtimeObserver-BLq2guVy.js} +1 -1
- package/dist/chunks/{runtimeObserver-CWaYMJG8.js → runtimeObserver-DT5P2_XL.js} +2 -2
- package/dist/chunks/sandbox-adapter-982rx2cm.js +1 -0
- package/dist/chunks/{sandbox-toggle-BtiPyjT3.js → sandbox-toggle-DghmaJhK.js} +1 -1
- package/dist/chunks/searchExtraTools-B4N1bpy0.js +1 -0
- package/dist/chunks/{select-BuTJbu_Q.js → select-CaxQ-BVq.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-BqQ58T7e.js +1 -0
- package/dist/chunks/{sessionObserver-cfwD8pV8.js → sessionObserver-DBoZUvWL.js} +1 -1
- package/dist/chunks/sessionObserver-qYpA90El.js +1 -0
- package/dist/chunks/sessionStorage-CC0v4zMs.js +1 -0
- package/dist/chunks/{sessionTracing-DsdcOqvc.js → sessionTracing-5a7HDF4e.js} +1 -1
- package/dist/chunks/{setup-DR-KEmxL.js → setup-DVLnIlse.js} +2 -2
- package/dist/chunks/{shadowedRuleDetection-DiZUDzxU.js → shadowedRuleDetection-L3tnySui.js} +1 -1
- package/dist/chunks/{sideQuestion-CdgUarC2.js → sideQuestion-BJTVma-5.js} +1 -1
- package/dist/chunks/sinks-C9NdbjLo.js +1 -0
- package/dist/chunks/{sinks-Cy3NqVbk.js → sinks-CV0SWuZW.js} +1 -1
- package/dist/chunks/{skillChangeDetector-CVFCJcG7.js → skillChangeDetector-DlodgOyC.js} +1 -1
- package/dist/chunks/{skillGapStore-BJV8ZIB1.js → skillGapStore-Cposc03e.js} +2 -2
- package/dist/chunks/{skillLifecycle-iO_3s9Ff.js → skillLifecycle-RXQp0JU7.js} +2 -2
- package/dist/chunks/{skillSearchPanel-BL5gXTHU.js → skillSearchPanel-B2pjskqk.js} +2 -2
- package/dist/chunks/{skills-BEp3_RyT.js → skills-D2ZjMtv4.js} +1 -1
- package/dist/chunks/status-BcSkj9nE.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-BoloSeXY.js → statusNoticeHelpers-DsrqBOQt.js} +1 -1
- package/dist/chunks/switcher-BietN6il.js +1 -0
- package/dist/chunks/{switcher-DSt2cVjA.js → switcher-rep86o4_.js} +1 -1
- package/dist/chunks/{tasks-DyBUXnQb.js → tasks-B4coTfrq.js} +1 -1
- package/dist/chunks/{templateJobs-BBnReWWj.js → templateJobs-C5ukh6H3.js} +1 -1
- package/dist/chunks/{terminalSetup-CDpFfqqV.js → terminalSetup-CaGbEVjB.js} +1 -1
- package/dist/chunks/{terminalSetup-DedaY1P7.js → terminalSetup-xe_P98fY.js} +1 -1
- package/dist/chunks/{theme-BZOy9Iqh.js → theme-7RmvErYJ.js} +1 -1
- package/dist/chunks/{tipRegistry-Cl5sdLRX.js → tipRegistry-BYpJZIjR.js} +1 -1
- package/dist/chunks/{toolEventObserver-ClwWmVbH.js → toolEventObserver-Dzwzi5Vi.js} +1 -1
- package/dist/chunks/{toolPool-DSTbgGmX.js → toolPool-BGfiNj6h.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-ClN4NJnB.js → useExitOnCtrlCDWithKeybindings-BT0nexZw.js} +1 -1
- package/dist/chunks/useMainLoopModel-QuE7VkgX.js +1 -0
- package/dist/chunks/{useManagePlugins-CxHz-gUP.js → useManagePlugins-pGaGzsEg.js} +1 -1
- package/dist/chunks/{useMergedTools-BUuWew0-.js → useMergedTools-BLsIT3R_.js} +1 -1
- package/dist/chunks/{useSearchInput-BIQN_-Hm.js → useSearchInput-j12K4wEo.js} +1 -1
- package/dist/chunks/{useSettingsErrors-BDJCLei_.js → useSettingsErrors-C8VIzdws.js} +1 -1
- package/dist/chunks/{util-BHr5l6Bx.js → util-CCEK8oze.js} +1 -1
- package/dist/chunks/{validatePlugin-fx1Y8vam.js → validatePlugin-CTVnWx9H.js} +1 -1
- package/dist/chunks/{vim-CYjMtnwH.js → vim-BlO9V5_5.js} +1 -1
- package/dist/chunks/worktree-BWL0vR4o.js +1 -0
- package/dist/chunks/wrapper-B-Q3Illb.js +1 -0
- package/dist/chunks/{wrapper-K8ZapJVu.js → wrapper-DVKxC5fR.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +2 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-CgSethgo.js +0 -1
- package/dist/chunks/Doctor-CiZNe_qx.js +0 -1
- package/dist/chunks/REPL-BHk0vZDf.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-CdWB9sO8.js +0 -1
- package/dist/chunks/backgroundHousekeeping-B56nFTzq.js +0 -1
- package/dist/chunks/caches-D7arwhaa.js +0 -1
- package/dist/chunks/commands-AcfFLgl5.js +0 -1
- package/dist/chunks/config-BhBcadjZ.js +0 -1
- package/dist/chunks/config-Bm5pVdCq.js +0 -1
- package/dist/chunks/context-noninteractive-BK2IDLSS.js +0 -1
- package/dist/chunks/conversation-B2dX3X4Z.js +0 -1
- package/dist/chunks/doctor-CQf8xPZH.js +0 -1
- package/dist/chunks/extractMemories-8yvMGZ1J.js +0 -1
- package/dist/chunks/fast-aNkj6WvB.js +0 -1
- package/dist/chunks/fetchModelList-D2quBF6M.js +0 -1
- package/dist/chunks/hooks-B5Wq-KxE.js +0 -1
- package/dist/chunks/loadAgentsDir-BBbIAiay.js +0 -1
- package/dist/chunks/localSearch-D6MhwvnR.js +0 -1
- package/dist/chunks/managedEnv-ulQBH73B.js +0 -1
- package/dist/chunks/pluginStartupCheck-Du9yx2P8.js +0 -1
- package/dist/chunks/prompt-BZmu5CeK.js +0 -1
- package/dist/chunks/prompt-Cogr_WZr.js +0 -1
- package/dist/chunks/sandbox-adapter-Df7Wpt77.js +0 -1
- package/dist/chunks/searchExtraTools-CbJVb_Zk.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-_mxyfQmn.js +0 -1
- package/dist/chunks/sessionObserver-BZVgzp3W.js +0 -1
- package/dist/chunks/sessionStorage-SC5RfnUP.js +0 -1
- package/dist/chunks/sinks-D41OiGE4.js +0 -1
- package/dist/chunks/status-6JMz8jmM.js +0 -1
- package/dist/chunks/switcher-95d4TrQH.js +0 -1
- package/dist/chunks/useMainLoopModel-Bgxpmn2Q.js +0 -1
- package/dist/chunks/worktree-CGu_58ue.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./REPL-CtFtb35A.js";export{e as REPL};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,Wt as r,ai as i,dr as a,ot as o,t as s}from"./src-BX54x08P.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Hn as l,Pt as u}from"./state-CXY-q5gr.js";import{Bh as ee,Cg as te,Er as ne,Hh as re,In as ie,Kn as ae,Rr as oe,Xr as se,Xs as d,Yr as f,dy as p,ec as m,fy as h,gr as g,jr as _,sb as v,tb as y,vr as b,wg as x,zh as S}from"./loadAgentsDir-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,Wt as r,ai as i,dr as a,ot as o,t as s}from"./src-BX54x08P.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Hn as l,Pt as u}from"./state-CXY-q5gr.js";import{Bh as ee,Cg as te,Er as ne,Hh as re,In as ie,Kn as ae,Rr as oe,Xr as se,Xs as d,Yr as f,dy as p,ec as m,fy as h,gr as g,jr as _,sb as v,tb as y,vr as b,wg as x,zh as S}from"./loadAgentsDir-bmpKLPdG.js";import{o as C,s as w}from"./log-L1kqxa_P.js";import{n as T}from"./analytics-COpjZpvd.js";import{n as E}from"./conversationRecovery-_hWC7JBO.js";import{r as D,t as O}from"./Spinner-C0qHjfIY.js";import{a as ce,n as le,s as ue}from"./skillChangeDetector-DlodgOyC.js";import{t as k}from"./REPL-CtFtb35A.js";import{a as A,i as j,n as M,o as N,r as P,t as F}from"./crossProjectResume-CCo3iZrB.js";import{dirname as I}from"path";var L=e(i(),1);v(),u(),N(),D(),p(),s(),y(),T(),S(),x(),j(),d(),M(),C(),g();var R=c();function z(e){let t=parseInt(e,10);if(!isNaN(t)&&t>0)return t;let n=e.match(/github\.com\/[^/]+\/[^/]+\/pull\/(\d+)/);return n?.[1]?parseInt(n[1],10):null}function B({commands:e,worktreePaths:r,initialTools:i,mcpClients:s,dynamicMcpConfig:c,debug:u,mainThreadAgentDefinition:d,strictMcpConfig:p=!1,systemPrompt:g,appendSystemPrompt:v,initialSearchQuery:y,disableSlashCommands:x=!1,forkSession:S,taskListId:C,filterByPr:T,thinkingConfig:D,onTurnComplete:j}){let{rows:M}=o(),N=ee(e=>e.agentDefinitions),B=re(),[U,W]=L.useState([]),[de,G]=L.useState(!0),[fe,pe]=L.useState(!1),[K,me]=L.useState(!1),[q,he]=L.useState(null),[J,ge]=L.useState(null),Y=L.useRef(null),X=L.useRef(0),Z=L.useMemo(()=>{let e=U.filter(e=>!e.isSidechain);if(T!==void 0){if(T===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof T==`number`)e=e.filter(e=>e.prNumber===T);else if(typeof T==`string`){let t=z(T);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[U,T]),_e=b();L.useEffect(()=>{_(r).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs),G(!1)}).catch(e=>{w(e),G(!1)})},[r]);let Q=L.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||ae(t.allStatLogs,t.nextIndex,e).then(n=>{if(t.nextIndex=n.nextIndex,n.logs.length>0){let e=X.current;n.logs.forEach((t,n)=>{t.value=e+n}),W(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=L.useCallback(e=>{G(!0),(e?ne():_(r)).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs)}).catch(e=>{w(e)}).finally(()=>{G(!1)})},[r]),ve=L.useCallback(()=>{let e=!K;me(e),$(e)},[K,$]);function ye(){process.exit(1)}async function be(e){pe(!0);let t=performance.now(),n=F(e,K);if(n.isCrossProject&&!n.isSameRepoWorktree){let e=n.command,t=await a(e);t&&process.stdout.write(t),ge(e);return}try{let n=await E(e,void 0);if(!n)throw Error(`Failed to load conversation`);n.sessionId&&!S?(l(te(n.sessionId),e.fullPath?I(e.fullPath):null),await f(),h(n.sessionId)):S&&n.contentReplacements?.length&&await oe(n.contentReplacements);let{agentDefinition:r}=ce(n.agentSetting,d,N);B(e=>({...e,agent:r?.agentType}));let i=le(n.agentName,n.agentColor);i&&B(e=>({...e,standaloneAgentContext:i})),m(n.agentName),se(S?{...n,worktreeSession:void 0}:n),S||(ue(n.worktreeSession),n.sessionId&&ie()),Math.round(performance.now()-t),W([]),he({messages:n.messages,fileHistorySnapshots:n.fileHistorySnapshots,contentReplacements:n.contentReplacements,agentName:n.agentName,agentColor:n.agentColor==="default"?void 0:n.agentColor,mainThreadAgentDefinition:r})}catch(e){throw w(e),e}}return J?(0,R.jsx)(H,{command:J}):q?(0,R.jsx)(k,{debug:u,commands:e,initialTools:i,initialMessages:q.messages,initialFileHistorySnapshots:q.fileHistorySnapshots,initialContentReplacements:q.contentReplacements,initialAgentName:q.agentName,initialAgentColor:q.agentColor,mcpClients:s,dynamicMcpConfig:c,strictMcpConfig:p,systemPrompt:g,appendSystemPrompt:v,mainThreadAgentDefinition:q.mainThreadAgentDefinition,disableSlashCommands:x,taskListId:C,thinkingConfig:D,onTurnComplete:j}):de?(0,R.jsxs)(t,{children:[(0,R.jsx)(O,{}),(0,R.jsx)(n,{children:` Loading conversations…`})]}):fe?(0,R.jsxs)(t,{children:[(0,R.jsx)(O,{}),(0,R.jsx)(n,{children:` Resuming conversation…`})]}):Z.length===0?(0,R.jsx)(V,{}):(0,R.jsx)(A,{logs:Z,maxHeight:M,onCancel:ye,onSelect:be,onLogsChanged:_e?()=>$(K):void 0,onLoadMore:Q,initialSearchQuery:y,showAllProjects:K,onToggleAllProjects:ve,onAgenticSearch:P})}function V(){return r(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,R.jsxs)(t,{flexDirection:`column`,children:[(0,R.jsx)(n,{children:`No conversations found to resume.`}),(0,R.jsx)(n,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function H({command:e}){return L.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,R.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,R.jsx)(n,{children:`This conversation is from a different directory.`}),(0,R.jsxs)(t,{flexDirection:`column`,children:[(0,R.jsx)(n,{children:`To resume, run:`}),(0,R.jsxs)(n,{children:[` `,e]})]}),(0,R.jsx)(n,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{B as ResumeConversation};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f_ as e,p_ as t}from"./loadAgentsDir-bmpKLPdG.js";t();export{e as clearSearchExtraToolsDescriptionCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,n as r,o as i,t as a}from"./envUtils-QyzA_cFM.js";import{n as o,t as s}from"./figures-5ThXQEtq.js";import{D as c,Gt as ee,H as te,I as l,P as u,T as d,U as ne,Wt as re,Xn as ie,a as ae,ai as f,di as p,fi as oe,j as m,k as se,n as h,ot as ce,r as g,t as _,x as v,y as le}from"./src-BX54x08P.js";import{t as y}from"./jsx-runtime-Bb4Xn-E0.js";import{Ht as ue,In as b,It as de,Lt as fe,Nn as pe,Pt as x,Rt as me,Vt as he,i as ge,ln as _e,m as S,mn as ve,n as ye,s as be,t as xe,un as C,y as w}from"./settings-D4M13toi.js";import{Pt as Se,at as T}from"./state-CXY-q5gr.js";import{AC as E,Bh as D,CC as Ce,Cy as O,Da as k,Dy as we,Ea as Te,Ey as Ee,Hh as De,Mh as Oe,NC as ke,Oa as Ae,Oy as je,PC as Me,TC as Ne,Ty as Pe,Vh as Fe,b as A,er as j,gr as Ie,hd as Le,j as Re,jC as ze,jh as Be,ky as Ve,md as M,sb as N,tb as He,wC as Ue,zh as P}from"./loadAgentsDir-uuZYOgKn.js";import{n as We,t as Ge}from"./cwd-DrEEb4f5.js";import{a as Ke,d as qe,h as F,i as Je,o as I,r as Ye}from"./config-BDn2YIjC.js";import{o as Xe,s as Ze}from"./log-L1kqxa_P.js";import{n as Qe}from"./analytics-COpjZpvd.js";import{_ as $e,f as L}from"./startupProfiler-B9Qv2QGH.js";import{Mt as et,Pt as tt,f as R,g as nt,h as rt}from"./model-CcHyMyBv.js";import{a as z,c as B,f as it,m as at}from"./proxy--_NfbJhm.js";import{n as ot,t as st}from"./useExitOnCtrlCDWithKeybindings-ClN4NJnB.js";import{n as ct,t as lt}from"./TextInput-ZKU-x_FD.js";import{n as V,t as ut}from"./select-BuTJbu_Q.js";import{i as dt,n as ft,r as pt}from"./modalContext-sU2lfR08.js";import{g as mt,h as H}from"./pidLock-CFUBtZck.js";import{n as ht,t as gt}from"./nativeInstaller-CIUYh1aD.js";import{n as _t,t as U}from"./allErrors-DvcU0w0F.js";import{t as W}from"./CustomSelect-CYmc4vRh.js";import{n as vt,t as yt}from"./ThemePicker-B69oDgXN.js";import{i as bt,n as xt,r as St,t as Ct}from"./extraUsage-Dr0YXm1w.js";import{n as wt,t as Tt}from"./AgentsMdExternalIncludesDialog-rJS5l6yk.js";import{t as Et}from"./SearchBox-zA5QwIpO.js";import{n as Dt,t as Ot}from"./useSearchInput-BIQN_-Hm.js";function kt(){return[]}function At(e=[],t){let n=e.filter(e=>e.name!==`ide`);if(!n.length)return[];let r={connected:0,pending:0,needsAuth:0,failed:0};for(let e of n)e.type===`connected`?r.connected++:e.type===`pending`?r.pending++:e.type===`needs-auth`?r.needsAuth++:r.failed++;let i=[];return r.connected&&i.push(m(`success`,t)(`${r.connected} connected`)),r.needsAuth&&i.push(m(`warning`,t)(`${r.needsAuth} need auth`)),r.pending&&i.push(m(`inactive`,t)(`${r.pending} pending`)),r.failed&&i.push(m(`error`,t)(`${r.failed} failed`)),[{label:`MCP servers`,value:`${i.join(`, `)} ${m(`inactive`,t)(`· /mcp`)}`}]}async function jt(){let e=Ee(await we()),t=[];return e.forEach(e=>{let n=pe(e.path);t.push(`Large ${n} will impact performance (${L(e.content.length)} chars > ${L(O)})`)}),t}function Mt(){return[{label:`Setting sources`,value:_e().filter(e=>{let t=be(e);return t!==null&&Object.keys(t).length>0}).map(e=>{if(e===`policySettings`){let e=ge();if(e===null)return null;switch(e){case`plist`:return`Enterprise managed settings (plist)`;case`hklm`:return`Enterprise managed settings (HKLM)`;case`file`:{let{hasBase:e,hasDropIns:t}=ye();return e&&t?`Enterprise managed settings (file + drop-ins)`:t?`Enterprise managed settings (drop-ins)`:`Enterprise managed settings (file)`}case`hkcu`:return`Enterprise managed settings (HKCU)`}}return C(e)}).filter(e=>e!==null)}]}async function Nt(){return(await ht()).map(e=>e.message)}async function Pt(){let e=await H(),t=[],{errors:n}=U();if(n.length>0){let e=Array.from(new Set(n.map(e=>e.file))).join(`, `);t.push(`Found invalid settings files: ${e}. They will be ignored.`)}return e.warnings.forEach(e=>{t.push(e.issue)}),e.hasUpdatePermissions===!1&&t.push(`No write permissions for auto-updates (requires sudo)`),t}function Ft(){return[]}function It(){let e=et(),t=[];if(e!==`firstParty`){let n={bedrock:`AWS Bedrock`,vertex:`Google Vertex AI`,foundry:`Microsoft Foundry`,gemini:`Gemini API`,grok:`Grok API`,openai:`OpenAI API`}[e];t.push({label:`API provider`,value:n})}if(e===`firstParty`){let e=process.env.ANTHROPIC_BASE_URL;e&&t.push({label:`API base URL`,value:e})}else if(e===`bedrock`){let e=process.env.BEDROCK_BASE_URL;e&&t.push({label:`Bedrock base URL`,value:e}),t.push({label:`AWS region`,value:a()}),n(process.env.WORKMATE_SKIP_BEDROCK_AUTH)&&t.push({value:`AWS auth skipped`})}else if(e===`vertex`){let e=process.env.VERTEX_BASE_URL;e&&t.push({label:`Vertex base URL`,value:e});let i=process.env.ANTHROPIC_VERTEX_PROJECT_ID;i&&t.push({label:`GCP project`,value:i}),t.push({label:`Default region`,value:r()}),n(process.env.WORKMATE_SKIP_VERTEX_AUTH)&&t.push({value:`GCP auth skipped`})}else if(e===`foundry`){let e=process.env.ANTHROPIC_FOUNDRY_BASE_URL;e&&t.push({label:`Microsoft Foundry base URL`,value:e});let r=process.env.ANTHROPIC_FOUNDRY_RESOURCE;r&&t.push({label:`Microsoft Foundry resource`,value:r}),n(process.env.WORKMATE_SKIP_FOUNDRY_AUTH)&&t.push({value:`Microsoft Foundry auth skipped`})}else if(e===`gemini`){let e=process.env.GEMINI_BASE_URL||`https://generativelanguage.googleapis.com/v1beta`;t.push({label:`Gemini base URL`,value:e})}else if(e===`grok`){let e=process.env.GROK_BASE_URL;t.push({label:`Grok base URL`,value:e})}else if(e===`openai`){let e=process.env.OPENAI_BASE_URL;t.push({label:`OpenAI base URL`,value:e})}let i=z();i&&t.push({label:`Proxy`,value:i});let o=it();return process.env.NODE_EXTRA_CA_CERTS&&t.push({label:`Additional CA cert(s)`,value:process.env.NODE_EXTRA_CA_CERTS}),o&&(o.cert&&process.env.WORKMATE_CLIENT_CERT&&t.push({label:`mTLS client cert`,value:process.env.WORKMATE_CLIENT_CERT}),o.key&&process.env.WORKMATE_CLIENT_KEY&&t.push({label:`mTLS client key`,value:process.env.WORKMATE_CLIENT_KEY})),t}function Lt(e){return nt(e)}var Rt=e((()=>{_(),Ve(),mt(),i(),b(),$e(),R(),tt(),at(),gt(),B(),_t(),ve(),S()}));function zt(){let e=T();return[{label:`Version`,value:`0.0.27`},{label:`Session name`,value:j(e)??(0,G.jsx)(u,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:Ge()},...Ft(),...It()]}function Bt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:Lt(e)},...At(t.clients,n),...kt(),...Mt()]}async function Vt(){return[...await Nt(),...await Pt(),...await jt()]}function Ht({value:e}){return Array.isArray(e)?(0,G.jsx)(l,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,G.jsxs)(u,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,G.jsx)(u,{children:e}):e}function Ut({context:e,diagnosticsPromise:t}){let n=D(e=>e.mainLoopModel),r=D(e=>e.mcp),[i]=te(),a=Gt.useMemo(()=>[zt(),Bt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=pt()?1:void 0;return(0,G.jsxs)(l,{flexDirection:`column`,flexGrow:o,children:[(0,G.jsxs)(l,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,G.jsx)(l,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,G.jsxs)(l,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,G.jsxs)(u,{bold:!0,children:[e,`:`]}),(0,G.jsx)(Ht,{value:t})]},n))},t)),(0,G.jsx)(Kt.Suspense,{fallback:null,children:(0,G.jsx)(Wt,{promise:t})})]}),(0,G.jsx)(u,{dimColor:!0,children:(0,G.jsx)(M,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Wt({promise:e}){let t=(0,Kt.use)(e);return t.length===0?null:(0,G.jsxs)(l,{flexDirection:`column`,paddingBottom:1,children:[(0,G.jsx)(u,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,G.jsxs)(l,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,G.jsx)(u,{color:`error`,children:s.warning}),typeof e==`string`?(0,G.jsx)(u,{wrap:`wrap`,children:e}):e]},t))]})}var Gt,Kt,G,qt=e((()=>{o(),Gt=t(f(),1),Kt=t(f(),1),Se(),ft(),_(),P(),We(),Ie(),Rt(),Le(),G=y()}));function Jt({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,K.jsxs)(le,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,K.jsxs)(u,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,K.jsx)(u,{dimColor:!0,children:`How would you like to handle this?`}),(0,K.jsx)(ut,{options:[{label:`Allow possible downgrade to stable version`,value:`downgrade`},{label:`Stay on current version (${e}) until stable catches up`,value:`stay`}],onChange:n})]})}var K,Yt=e((()=>{_(),W(),K=y()}));function Xt(e){return Object.entries(e).map(([e,t])=>({label:t?.name??$t,value:e,description:t?.description??en}))}function Zt({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,Qt.useState)([]),[o,s]=(0,Qt.useState)(!0);(0,Qt.useEffect)(()=>{k(Ge()).then(e=>{let t=Xt(e);a(t),s(!1)}).catch(()=>{let e=Xt(Te);a(e),s(!1)})},[]);let c=(0,Qt.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(le,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(l,{marginTop:1,children:(0,q.jsx)(u,{dimColor:!0,children:`This changes how Work Mate communicates with you`})}),o?(0,q.jsx)(u,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(ut,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var Qt,q,$t,en,tn=e((()=>{Qt=t(f(),1),Ae(),_(),We(),V(),q=y(),$t=`Default`,en=`Work Mate completes coding tasks efficiently and provides concise responses`}));function nn({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,rn.useState)(e),[a,o]=(0,rn.useState)((e??``).length);re(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(u,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(l,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(u,{children:s.pointer}),(0,J.jsx)(lt,{value:r??``,onChange:i,onSubmit:c,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, 日本語, Español${s.ellipsis}`,columns:60,cursorOffset:a,onChangeCursorOffset:o})]}),(0,J.jsx)(u,{dimColor:!0,children:`Leave empty for default (English)`})]})}var rn,J,an=e((()=>{o(),rn=t(f(),1),_(),He(),ct(),J=y()}));function on({onClose:e,context:t,setTabsHidden:r,onIsSearchModeChange:i,contentHeight:a}){let{headerFocused:o,focusHeader:f}=ae(),oe=pt(),[,m]=te(),h=ne(),[g,_]=(0,X.useState)(I()),v=Y.useRef(I()),[y,b]=(0,X.useState)(xe()),pe=Y.useRef(xe()),[x,ge]=(0,X.useState)(y?.outputStyle||`default`),_e=Y.useRef(x),[S,ve]=(0,X.useState)(y?.language),ye=Y.useRef(S),[C,Se]=(0,X.useState)(0),[T,E]=(0,X.useState)(0),[O,k]=(0,X.useState)(!1),Te=ie(),{rows:Ee}=ce(),Ae=a??Math.min(Math.floor(Ee*.8),30),A=Math.max(5,Ae-10),j=D(e=>e.mainLoopModel),Ie=D(e=>e.verbose),Le=D(e=>e.thinkingEnabled),Be=D(e=>ke()?e.fastMode:!1);D(e=>e.promptSuggestionEnabled);let Ve=fe(y?.permissions?.defaultMode??`default`),N=De(),[He,P]=(0,X.useState)({}),We=Y.useRef(Le),[Ge]=(0,X.useState)(()=>be(`localSettings`)),[qe]=(0,X.useState)(()=>be(`userSettings`)),Xe=Y.useRef(h),Qe=Fe(),[$e]=(0,X.useState)(()=>{let e=Qe.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,settings:e.settings}}),L=Y.useRef(!1),[et,tt]=(0,X.useState)(!1),[R,z]=(0,X.useState)(null),{query:B,setQuery:it,cursorOffset:at}=Dt({isActive:O&&R===null&&!o,onExit:()=>k(!1),onExitUp:f,passthroughCtrlKeys:[`c`,`d`]}),ot=O&&!o;Y.useEffect(()=>{i?.(ot)},[ot,i]);let st=!n(process.env.WORKMATE_DISABLE_FILE_CHECKPOINTING),ct=Y.use(we(!0)),lt=je(ct),V=Je();function dt(e){N(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),P(t=>{let n=nt(e)+(xt(e,!1,rt())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function ft(e){F(t=>({...t,verbose:e})),_({...I(),verbose:e}),N(t=>({...t,verbose:e})),P(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let mt=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:g.autoCompactEnabled,type:`boolean`,onChange(e){F(t=>({...t,autoCompactEnabled:e})),_({...I(),autoCompactEnabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:y?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){w(`localSettings`,{spinnerTipsEnabled:e}),b(t=>({...t,spinnerTipsEnabled:e}))}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:y?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){w(`localSettings`,{cacheWarningEnabled:e}),b(t=>({...t,cacheWarningEnabled:e}))}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:y?.prefersReducedMotion??!1,type:`boolean`,onChange(e){w(`localSettings`,{prefersReducedMotion:e}),b(t=>({...t,prefersReducedMotion:e})),N(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}}))}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Le??!0,type:`boolean`,onChange(e){N(t=>({...t,thinkingEnabled:e})),w(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1})}},...ke()&&ze()?[{id:`fastMode`,label:`Fast mode (${Ce} only)`,value:!!Be,type:`boolean`,onChange(e){Ue(),w(`userSettings`,{fastMode:e?!0:void 0}),e?(N(e=>({...e,mainLoopModel:Ne(),mainLoopModelForSession:null,fastMode:!0})),P(e=>({...e,model:Ne(),"Fast mode":`ON`}))):(N(e=>({...e,fastMode:!1})),P(e=>({...e,"Fast mode":`OFF`})))}}]:[],...st?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:g.fileCheckpointingEnabled,type:`boolean`,onChange(e){F(t=>({...t,fileCheckpointingEnabled:e})),_({...I(),fileCheckpointingEnabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Ie,type:`boolean`,onChange:ft},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:g.terminalProgressBarEnabled,type:`boolean`,onChange(e){F(t=>({...t,terminalProgressBarEnabled:e})),_({...I(),terminalProgressBarEnabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:g.showTurnDuration,type:`boolean`,onChange(e){F(t=>({...t,showTurnDuration:e})),_({...I(),showTurnDuration:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:Ve,options:(()=>{let e=[`default`,`plan`];return[...e,...ue.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=fe(e),n=t===`auto`?t:de(t)?he(t):t,r=w(`userSettings`,{permissions:{...y?.permissions,defaultMode:n}});if(r.error){Ze(r.error);return}b(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),P(t=>({...t,defaultPermissionMode:e}))}},{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:g.respectGitignore,type:`boolean`,onChange(e){F(t=>({...t,respectGitignore:e})),_({...I(),respectGitignore:e})}},...Oe()?[{id:`copyOnSelect`,label:`Copy on select`,value:g.copyOnSelect??!0,type:`boolean`,onChange(e){F(t=>({...t,copyOnSelect:e})),_({...I(),copyOnSelect:e})}}]:[],V?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:y?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:h,type:`managedEnum`,onChange:m},{id:`notifChannel`,label:`Notifications`,value:g.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){F(t=>({...t,preferredNotifChannel:e})),_({...I(),preferredNotifChannel:e})}},{id:`outputStyle`,label:`Output style`,value:x,type:`managedEnum`,onChange:()=>{}},{id:`language`,label:`Language`,value:S??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:g.editorMode===`emacs`?`normal`:g.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){F(t=>({...t,editorMode:e})),_({...I(),editorMode:e})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:g.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){F(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),_({...I(),prStatusFooterEnabled:e})}},{id:`model`,label:`Model`,value:j===null?`Default (recommended)`:j,type:`managedEnum`,onChange:dt},...lt?[{id:`showExternalIncludesDialog`,label:`External AGENTS.md includes`,value:Ke().hasAgentsMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[]],H=Y.useMemo(()=>{if(!B)return mt;let e=B.toLowerCase();return mt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[mt,B]);Y.useEffect(()=>{if(C>=H.length){let e=Math.max(0,H.length-1);Se(e),E(Math.max(0,e-A+1));return}E(e=>C<e?C:C>=e+A?C-A+1:e)},[H.length,C,A]);let ht=(0,X.useCallback)(e=>{E(t=>e<t?e:e>=t+A?e-A+1:t)},[A]),gt=(0,X.useCallback)(()=>{if(R!==null)return;let t=Object.entries(He).map(([e,t])=>`Set ${e} to ${p.bold(t)}`);g.theme!==v.current.theme&&t.push(`Set theme to ${p.bold(g.theme)}`),g.preferredNotifChannel!==v.current.preferredNotifChannel&&t.push(`Set notifications to ${p.bold(g.preferredNotifChannel)}`),x!==_e.current&&t.push(`Set output style to ${p.bold(x)}`),S!==ye.current&&t.push(`Set response language to ${p.bold(S??`Default (English)`)}`),g.editorMode!==v.current.editorMode&&t.push(`Set editor mode to ${p.bold(g.editorMode||`emacs`)}`),g.diffTool!==v.current.diffTool&&t.push(`Set diff tool to ${p.bold(g.diffTool)}`),g.autoCompactEnabled!==v.current.autoCompactEnabled&&t.push(`${g.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),g.respectGitignore!==v.current.respectGitignore&&t.push(`${g.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),g.copyOnSelect!==v.current.copyOnSelect&&t.push(`${g.copyOnSelect?`Enabled`:`Disabled`} copy on select`),g.terminalProgressBarEnabled!==v.current.terminalProgressBarEnabled&&t.push(`${g.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),g.showStatusInTerminalTab!==v.current.showStatusInTerminalTab&&t.push(`${g.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),g.showTurnDuration!==v.current.showTurnDuration&&t.push(`${g.showTurnDuration?`Enabled`:`Disabled`} turn duration`),y?.autoUpdatesChannel!==pe.current?.autoUpdatesChannel&&t.push(`Set auto-update channel to ${p.bold(y?.autoUpdatesChannel??`latest`)}`),t.length>0?e(t.join(`
|
|
2
|
-
`)):e(`Config dialog dismissed`,{display:`system`})},[R,He,g,j,x,S,y?.autoUpdatesChannel,ke()?y?.fastMode:void 0,e]),_t=(0,X.useCallback)(()=>{h!==Xe.current&&m(Xe.current),F(()=>v.current);let e=Ge;w(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=qe;w(`userSettings`,{alwaysThinkingEnabled:t?.alwaysThinkingEnabled,fastMode:t?.fastMode,promptSuggestionEnabled:t?.promptSuggestionEnabled,autoUpdatesChannel:t?.autoUpdatesChannel,minimumVersion:t?.minimumVersion,language:t?.language,syntaxHighlightingDisabled:t?.syntaxHighlightingDisabled,permissions:t?.permissions===void 0?void 0:{...t.permissions,defaultMode:t.permissions.defaultMode}});let n=$e;N(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,settings:n.settings,toolPermissionContext:Re(e.toolPermissionContext)}))},[h,m,Ge,qe,$e,N]);re(`confirm:no`,(0,X.useCallback)(()=>{R===null&&(L.current&&_t(),e(`Config dialog dismissed`,{display:`system`}))},[R,_t,e]),{context:`Settings`,isActive:R===null&&!O&&!o}),re(`settings:close`,gt,{context:`Settings`,isActive:R===null&&!O&&!o});let U=(0,X.useCallback)(()=>{let e=H[C];if(e?.onChange){if(e.type===`boolean`){L.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===We.current?tt(!1):t.messages.some(e=>e.type===`assistant`)&&tt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:z(`Theme`),r(!0);return;case`model`:z(`Model`),r(!0);return;case`showExternalIncludesDialog`:z(`ExternalIncludes`),r(!0);return;case`outputStyle`:z(`OutputStyle`),r(!0);return;case`language`:z(`Language`),r(!0);return}if(e.id===`autoUpdatesChannel`){if(V){z(`EnableAutoUpdates`),r(!0);return}(y?.autoUpdatesChannel??`latest`)===`latest`?(z(`ChannelDowngrade`),r(!0)):(L.current=!0,w(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),b(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})));return}if(e.type===`enum`){L.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[V,H,C,y?.autoUpdatesChannel,r]),W=e=>{tt(!1);let t=Math.max(0,Math.min(H.length-1,C+e));Se(t),ht(t)};return ee({"select:previous":()=>{C===0?(tt(!1),k(!0),E(0)):W(-1)},"select:next":()=>W(1),"scroll:lineUp":()=>W(-1),"scroll:lineDown":()=>W(1),"select:accept":U,"select:previousValue":()=>U(),"select:nextValue":()=>U(),"settings:search":()=>{k(!0),it(``)}},{context:`Settings`,isActive:R===null&&!O&&!o}),(0,Z.jsx)(l,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(R===null&&!o){if(O){if(e.key===`escape`){e.preventDefault(),B.length>0?it(``):k(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),k(!1),Se(0),E(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),U();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),k(!0),it(e.key))}},[R,o,O,B,it,U]),children:R===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(yt,{onThemeSelect:e=>{L.current=!0,m(e),z(null),r(!1)},onCancel:()=>{z(null),r(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(l,{children:(0,Z.jsx)(u,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):R===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(St,{initial:j,onSelect:e=>{L.current=!0,dt(e),z(null),r(!1)},onCancel:()=>{z(null),r(!1)},showFastModeNotice:ke()?Be&&Me(j)&&ze():!1}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):R===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Tt,{onDone:()=>{z(null),r(!1)},externalIncludes:Pe(ct)}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):R===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Zt,{initialStyle:x,onComplete:e=>{L.current=!0,ge(e??`default`),z(null),r(!1),w(`localSettings`,{outputStyle:e})},onCancel:()=>{z(null),r(!1)}}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):R===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(nn,{initialLanguage:S,onComplete:e=>{L.current=!0,ve(e),z(null),r(!1),w(`userSettings`,{language:e})},onCancel:()=>{z(null),r(!1)}}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):R===`EnableAutoUpdates`?(0,Z.jsx)(le,{title:`Enable Auto-Updates`,onCancel:()=>{z(null),r(!1)},hideBorder:!0,hideInputGuide:!0,children:V?.type===`config`?(0,Z.jsx)(ut,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{L.current=!0,z(null),r(!1),F(e=>({...e,autoUpdates:!0})),_({...I(),autoUpdates:!0}),w(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),b(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0}))}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u,{children:V?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),V?.type===`env`&&(0,Z.jsxs)(u,{dimColor:!0,children:[`Unset `,V.envVar,` to re-enable auto-updates.`]})]})}):R===`ChannelDowngrade`?(0,Z.jsx)(Jt,{currentVersion:`0.0.27`,onChoice:e=>{if(z(null),r(!1),e===`cancel`)return;L.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.27`),w(`userSettings`,t),b(e=>({...e,...t}))}}):(0,Z.jsxs)(l,{flexDirection:`column`,gap:1,marginY:oe?void 0:1,children:[(0,Z.jsx)(se,{query:B,isFocused:O&&!o,isTerminalFocused:Te,cursorOffset:at,placeholder:`Search settings…`}),(0,Z.jsx)(l,{flexDirection:`column`,children:H.length===0?(0,Z.jsxs)(u,{dimColor:!0,italic:!0,children:[`No settings match "`,B,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[T>0&&(0,Z.jsxs)(u,{dimColor:!0,children:[s.arrowUp,` `,T,` more above`]}),H.slice(T,T+A).map((e,t)=>{let n=T+t===C&&!o&&!O;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(l,{width:`100%`,children:[(0,Z.jsx)(l,{width:44,children:(0,Z.jsxs)(u,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(l,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:e.value.toString()}),et&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(u,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:cn[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(sn,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:me(e.value)}):e.id===`autoUpdatesChannel`&&V?(0,Z.jsxs)(l,{flexDirection:`column`,children:[(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(u,{dimColor:!0,children:[`(`,Ye(V),`)`]})]}):(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),T+A<H.length&&(0,Z.jsxs)(u,{dimColor:!0,children:[s.arrowDown,` `,H.length-T-A,` more below`]})]})}),o?(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(c,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):O?(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(u,{children:`Type to filter`}),(0,Z.jsx)(c,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(c,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(M,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(M,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(M,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function sn({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(u,{children:[`iTerm2 `,(0,Z.jsx)(u,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(u,{children:[`Terminal Bell `,(0,Z.jsx)(u,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(u,{children:[`Kitty `,(0,Z.jsx)(u,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(u,{children:[`Ghostty `,(0,Z.jsx)(u,{dimColor:!0,children:`(OSC 777)`})]});case`iterm2_with_bell`:return`iTerm2 w/ Bell`;case`notifications_disabled`:return`Disabled`;default:return e}}var Y,X,Z,cn,ln=e((()=>{_(),Y=t(f(),1),X=t(f(),1),He(),o(),qe(),oe(),x(),A(),Xe(),Qe(),vt(),P(),bt(),R(),Ct(),wt(),Yt(),W(),tn(),an(),Ve(),Le(),ft(),Et(),S(),Ae(),i(),Ot(),N(),E(),Be(),Z=y(),cn={auto:`Auto (match terminal)`,dark:`Dark mode`,light:`Light mode`,"dark-daltonized":`Dark mode (colorblind-friendly)`,"light-daltonized":`Light mode (colorblind-friendly)`,"dark-ansi":`Dark mode (ANSI colors only)`,"light-ansi":`Light mode (ANSI colors only)`}}));function un({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,Q.useState)(n),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1),ee=pt(),{rows:te}=dt(ce()),l=ee?te+1:Math.max(15,Math.min(Math.floor(te*.8),30)),[u]=(0,Q.useState)(()=>Vt().catch(()=>[]));return ot(),re(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(v,{color:`permission`,children:(0,$.jsx)(g,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||ee?void 0:l,children:[(0,$.jsx)(h,{title:`Status`,children:(0,$.jsx)(Ut,{context:t,diagnosticsPromise:u})},`status`),(0,$.jsx)(h,{title:`Config`,children:(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(on,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:l})})},`config`)]})})}var Q,$,dn=e((()=>{Q=t(f(),1),He(),st(),N(),ft(),_(),qt(),ln(),$=y()}));export{dn as n,un as t};
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,n as r,o as i,t as a}from"./envUtils-QyzA_cFM.js";import{n as o,t as s}from"./figures-5ThXQEtq.js";import{D as c,Gt as ee,H as te,I as l,P as u,T as d,U as ne,Wt as re,Xn as ie,a as ae,ai as f,di as p,fi as oe,j as m,k as se,n as h,ot as ce,r as g,t as _,x as v,y as le}from"./src-BX54x08P.js";import{t as y}from"./jsx-runtime-Bb4Xn-E0.js";import{Ht as ue,In as b,It as de,Lt as fe,Nn as pe,Pt as x,Rt as me,Vt as he,i as ge,ln as _e,m as S,mn as ve,n as ye,s as be,t as xe,un as C,y as w}from"./settings-D4M13toi.js";import{Pt as Se,at as T}from"./state-CXY-q5gr.js";import{AC as E,Bh as D,CC as Ce,Cy as O,Da as k,Dy as we,Ea as Te,Ey as Ee,Hh as De,Mh as Oe,NC as ke,Oa as Ae,Oy as je,PC as Me,TC as Ne,Ty as Pe,Vh as Fe,b as A,er as j,gr as Ie,hd as Le,j as Re,jC as ze,jh as Be,ky as Ve,md as M,sb as N,tb as He,wC as Ue,zh as P}from"./loadAgentsDir-bmpKLPdG.js";import{n as We,t as Ge}from"./cwd-DrEEb4f5.js";import{a as Ke,d as qe,h as F,i as Je,o as I,r as Ye}from"./config-Bio2EjUK.js";import{o as Xe,s as Ze}from"./log-L1kqxa_P.js";import{n as Qe}from"./analytics-COpjZpvd.js";import{_ as $e,f as L}from"./startupProfiler-B9Qv2QGH.js";import{Mt as et,Pt as tt,f as R,g as nt,h as rt}from"./model-Dd3x121y.js";import{a as z,c as B,f as it,m as at}from"./proxy--_NfbJhm.js";import{n as ot,t as st}from"./useExitOnCtrlCDWithKeybindings-BT0nexZw.js";import{n as ct,t as lt}from"./TextInput-ou7ZhpVY.js";import{n as V,t as ut}from"./select-CaxQ-BVq.js";import{i as dt,n as ft,r as pt}from"./modalContext-sU2lfR08.js";import{g as mt,h as H}from"./pidLock-CqkC3-nD.js";import{n as ht,t as gt}from"./nativeInstaller-DMkZdsof.js";import{n as _t,t as U}from"./allErrors-Dhnf6rqg.js";import{t as W}from"./CustomSelect-t4wXuXWH.js";import{n as vt,t as yt}from"./ThemePicker-CVFWqSc7.js";import{i as bt,n as xt,r as St,t as Ct}from"./extraUsage-CmgRR-zH.js";import{n as wt,t as Tt}from"./AgentsMdExternalIncludesDialog-BJfHqScU.js";import{t as Et}from"./SearchBox-zA5QwIpO.js";import{n as Dt,t as Ot}from"./useSearchInput-j12K4wEo.js";function kt(){return[]}function At(e=[],t){let n=e.filter(e=>e.name!==`ide`);if(!n.length)return[];let r={connected:0,pending:0,needsAuth:0,failed:0};for(let e of n)e.type===`connected`?r.connected++:e.type===`pending`?r.pending++:e.type===`needs-auth`?r.needsAuth++:r.failed++;let i=[];return r.connected&&i.push(m(`success`,t)(`${r.connected} connected`)),r.needsAuth&&i.push(m(`warning`,t)(`${r.needsAuth} need auth`)),r.pending&&i.push(m(`inactive`,t)(`${r.pending} pending`)),r.failed&&i.push(m(`error`,t)(`${r.failed} failed`)),[{label:`MCP servers`,value:`${i.join(`, `)} ${m(`inactive`,t)(`· /mcp`)}`}]}async function jt(){let e=Ee(await we()),t=[];return e.forEach(e=>{let n=pe(e.path);t.push(`Large ${n} will impact performance (${L(e.content.length)} chars > ${L(O)})`)}),t}function Mt(){return[{label:`Setting sources`,value:_e().filter(e=>{let t=be(e);return t!==null&&Object.keys(t).length>0}).map(e=>{if(e===`policySettings`){let e=ge();if(e===null)return null;switch(e){case`plist`:return`Enterprise managed settings (plist)`;case`hklm`:return`Enterprise managed settings (HKLM)`;case`file`:{let{hasBase:e,hasDropIns:t}=ye();return e&&t?`Enterprise managed settings (file + drop-ins)`:t?`Enterprise managed settings (drop-ins)`:`Enterprise managed settings (file)`}case`hkcu`:return`Enterprise managed settings (HKCU)`}}return C(e)}).filter(e=>e!==null)}]}async function Nt(){return(await ht()).map(e=>e.message)}async function Pt(){let e=await H(),t=[],{errors:n}=U();if(n.length>0){let e=Array.from(new Set(n.map(e=>e.file))).join(`, `);t.push(`Found invalid settings files: ${e}. They will be ignored.`)}return e.warnings.forEach(e=>{t.push(e.issue)}),e.hasUpdatePermissions===!1&&t.push(`No write permissions for auto-updates (requires sudo)`),t}function Ft(){return[]}function It(){let e=et(),t=[];if(e!==`firstParty`){let n={bedrock:`AWS Bedrock`,vertex:`Google Vertex AI`,foundry:`Microsoft Foundry`,gemini:`Gemini API`,grok:`Grok API`,openai:`OpenAI API`}[e];t.push({label:`API provider`,value:n})}if(e===`firstParty`){let e=process.env.ANTHROPIC_BASE_URL;e&&t.push({label:`API base URL`,value:e})}else if(e===`bedrock`){let e=process.env.BEDROCK_BASE_URL;e&&t.push({label:`Bedrock base URL`,value:e}),t.push({label:`AWS region`,value:a()}),n(process.env.WORKMATE_SKIP_BEDROCK_AUTH)&&t.push({value:`AWS auth skipped`})}else if(e===`vertex`){let e=process.env.VERTEX_BASE_URL;e&&t.push({label:`Vertex base URL`,value:e});let i=process.env.ANTHROPIC_VERTEX_PROJECT_ID;i&&t.push({label:`GCP project`,value:i}),t.push({label:`Default region`,value:r()}),n(process.env.WORKMATE_SKIP_VERTEX_AUTH)&&t.push({value:`GCP auth skipped`})}else if(e===`foundry`){let e=process.env.ANTHROPIC_FOUNDRY_BASE_URL;e&&t.push({label:`Microsoft Foundry base URL`,value:e});let r=process.env.ANTHROPIC_FOUNDRY_RESOURCE;r&&t.push({label:`Microsoft Foundry resource`,value:r}),n(process.env.WORKMATE_SKIP_FOUNDRY_AUTH)&&t.push({value:`Microsoft Foundry auth skipped`})}else if(e===`gemini`){let e=process.env.GEMINI_BASE_URL||`https://generativelanguage.googleapis.com/v1beta`;t.push({label:`Gemini base URL`,value:e})}else if(e===`grok`){let e=process.env.GROK_BASE_URL;t.push({label:`Grok base URL`,value:e})}else if(e===`openai`){let e=process.env.OPENAI_BASE_URL;t.push({label:`OpenAI base URL`,value:e})}let i=z();i&&t.push({label:`Proxy`,value:i});let o=it();return process.env.NODE_EXTRA_CA_CERTS&&t.push({label:`Additional CA cert(s)`,value:process.env.NODE_EXTRA_CA_CERTS}),o&&(o.cert&&process.env.WORKMATE_CLIENT_CERT&&t.push({label:`mTLS client cert`,value:process.env.WORKMATE_CLIENT_CERT}),o.key&&process.env.WORKMATE_CLIENT_KEY&&t.push({label:`mTLS client key`,value:process.env.WORKMATE_CLIENT_KEY})),t}function Lt(e){return nt(e)}var Rt=e((()=>{_(),Ve(),mt(),i(),b(),$e(),R(),tt(),at(),gt(),B(),_t(),ve(),S()}));function zt(){let e=T();return[{label:`Version`,value:`0.0.28`},{label:`Session name`,value:j(e)??(0,G.jsx)(u,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:Ge()},...Ft(),...It()]}function Bt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:Lt(e)},...At(t.clients,n),...kt(),...Mt()]}async function Vt(){return[...await Nt(),...await Pt(),...await jt()]}function Ht({value:e}){return Array.isArray(e)?(0,G.jsx)(l,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,G.jsxs)(u,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,G.jsx)(u,{children:e}):e}function Ut({context:e,diagnosticsPromise:t}){let n=D(e=>e.mainLoopModel),r=D(e=>e.mcp),[i]=te(),a=Gt.useMemo(()=>[zt(),Bt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=pt()?1:void 0;return(0,G.jsxs)(l,{flexDirection:`column`,flexGrow:o,children:[(0,G.jsxs)(l,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,G.jsx)(l,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,G.jsxs)(l,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,G.jsxs)(u,{bold:!0,children:[e,`:`]}),(0,G.jsx)(Ht,{value:t})]},n))},t)),(0,G.jsx)(Kt.Suspense,{fallback:null,children:(0,G.jsx)(Wt,{promise:t})})]}),(0,G.jsx)(u,{dimColor:!0,children:(0,G.jsx)(M,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Wt({promise:e}){let t=(0,Kt.use)(e);return t.length===0?null:(0,G.jsxs)(l,{flexDirection:`column`,paddingBottom:1,children:[(0,G.jsx)(u,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,G.jsxs)(l,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,G.jsx)(u,{color:`error`,children:s.warning}),typeof e==`string`?(0,G.jsx)(u,{wrap:`wrap`,children:e}):e]},t))]})}var Gt,Kt,G,qt=e((()=>{o(),Gt=t(f(),1),Kt=t(f(),1),Se(),ft(),_(),P(),We(),Ie(),Rt(),Le(),G=y()}));function Jt({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,K.jsxs)(le,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,K.jsxs)(u,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,K.jsx)(u,{dimColor:!0,children:`How would you like to handle this?`}),(0,K.jsx)(ut,{options:[{label:`Allow possible downgrade to stable version`,value:`downgrade`},{label:`Stay on current version (${e}) until stable catches up`,value:`stay`}],onChange:n})]})}var K,Yt=e((()=>{_(),W(),K=y()}));function Xt(e){return Object.entries(e).map(([e,t])=>({label:t?.name??$t,value:e,description:t?.description??en}))}function Zt({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,Qt.useState)([]),[o,s]=(0,Qt.useState)(!0);(0,Qt.useEffect)(()=>{k(Ge()).then(e=>{let t=Xt(e);a(t),s(!1)}).catch(()=>{let e=Xt(Te);a(e),s(!1)})},[]);let c=(0,Qt.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(le,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(l,{marginTop:1,children:(0,q.jsx)(u,{dimColor:!0,children:`This changes how Work Mate communicates with you`})}),o?(0,q.jsx)(u,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(ut,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var Qt,q,$t,en,tn=e((()=>{Qt=t(f(),1),Ae(),_(),We(),V(),q=y(),$t=`Default`,en=`Work Mate completes coding tasks efficiently and provides concise responses`}));function nn({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,rn.useState)(e),[a,o]=(0,rn.useState)((e??``).length);re(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(u,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(l,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(u,{children:s.pointer}),(0,J.jsx)(lt,{value:r??``,onChange:i,onSubmit:c,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, 日本語, Español${s.ellipsis}`,columns:60,cursorOffset:a,onChangeCursorOffset:o})]}),(0,J.jsx)(u,{dimColor:!0,children:`Leave empty for default (English)`})]})}var rn,J,an=e((()=>{o(),rn=t(f(),1),_(),He(),ct(),J=y()}));function on({onClose:e,context:t,setTabsHidden:r,onIsSearchModeChange:i,contentHeight:a}){let{headerFocused:o,focusHeader:f}=ae(),oe=pt(),[,m]=te(),h=ne(),[g,_]=(0,X.useState)(I()),v=Y.useRef(I()),[y,b]=(0,X.useState)(xe()),pe=Y.useRef(xe()),[x,ge]=(0,X.useState)(y?.outputStyle||`default`),_e=Y.useRef(x),[S,ve]=(0,X.useState)(y?.language),ye=Y.useRef(S),[C,Se]=(0,X.useState)(0),[T,E]=(0,X.useState)(0),[O,k]=(0,X.useState)(!1),Te=ie(),{rows:Ee}=ce(),Ae=a??Math.min(Math.floor(Ee*.8),30),A=Math.max(5,Ae-10),j=D(e=>e.mainLoopModel),Ie=D(e=>e.verbose),Le=D(e=>e.thinkingEnabled),Be=D(e=>ke()?e.fastMode:!1);D(e=>e.promptSuggestionEnabled);let Ve=fe(y?.permissions?.defaultMode??`default`),N=De(),[He,P]=(0,X.useState)({}),We=Y.useRef(Le),[Ge]=(0,X.useState)(()=>be(`localSettings`)),[qe]=(0,X.useState)(()=>be(`userSettings`)),Xe=Y.useRef(h),Qe=Fe(),[$e]=(0,X.useState)(()=>{let e=Qe.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,settings:e.settings}}),L=Y.useRef(!1),[et,tt]=(0,X.useState)(!1),[R,z]=(0,X.useState)(null),{query:B,setQuery:it,cursorOffset:at}=Dt({isActive:O&&R===null&&!o,onExit:()=>k(!1),onExitUp:f,passthroughCtrlKeys:[`c`,`d`]}),ot=O&&!o;Y.useEffect(()=>{i?.(ot)},[ot,i]);let st=!n(process.env.WORKMATE_DISABLE_FILE_CHECKPOINTING),ct=Y.use(we(!0)),lt=je(ct),V=Je();function dt(e){N(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),P(t=>{let n=nt(e)+(xt(e,!1,rt())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function ft(e){F(t=>({...t,verbose:e})),_({...I(),verbose:e}),N(t=>({...t,verbose:e})),P(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let mt=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:g.autoCompactEnabled,type:`boolean`,onChange(e){F(t=>({...t,autoCompactEnabled:e})),_({...I(),autoCompactEnabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:y?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){w(`localSettings`,{spinnerTipsEnabled:e}),b(t=>({...t,spinnerTipsEnabled:e}))}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:y?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){w(`localSettings`,{cacheWarningEnabled:e}),b(t=>({...t,cacheWarningEnabled:e}))}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:y?.prefersReducedMotion??!1,type:`boolean`,onChange(e){w(`localSettings`,{prefersReducedMotion:e}),b(t=>({...t,prefersReducedMotion:e})),N(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}}))}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Le??!0,type:`boolean`,onChange(e){N(t=>({...t,thinkingEnabled:e})),w(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1})}},...ke()&&ze()?[{id:`fastMode`,label:`Fast mode (${Ce} only)`,value:!!Be,type:`boolean`,onChange(e){Ue(),w(`userSettings`,{fastMode:e?!0:void 0}),e?(N(e=>({...e,mainLoopModel:Ne(),mainLoopModelForSession:null,fastMode:!0})),P(e=>({...e,model:Ne(),"Fast mode":`ON`}))):(N(e=>({...e,fastMode:!1})),P(e=>({...e,"Fast mode":`OFF`})))}}]:[],...st?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:g.fileCheckpointingEnabled,type:`boolean`,onChange(e){F(t=>({...t,fileCheckpointingEnabled:e})),_({...I(),fileCheckpointingEnabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Ie,type:`boolean`,onChange:ft},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:g.terminalProgressBarEnabled,type:`boolean`,onChange(e){F(t=>({...t,terminalProgressBarEnabled:e})),_({...I(),terminalProgressBarEnabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:g.showTurnDuration,type:`boolean`,onChange(e){F(t=>({...t,showTurnDuration:e})),_({...I(),showTurnDuration:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:Ve,options:(()=>{let e=[`default`,`plan`];return[...e,...ue.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=fe(e),n=t===`auto`?t:de(t)?he(t):t,r=w(`userSettings`,{permissions:{...y?.permissions,defaultMode:n}});if(r.error){Ze(r.error);return}b(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),P(t=>({...t,defaultPermissionMode:e}))}},{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:g.respectGitignore,type:`boolean`,onChange(e){F(t=>({...t,respectGitignore:e})),_({...I(),respectGitignore:e})}},...Oe()?[{id:`copyOnSelect`,label:`Copy on select`,value:g.copyOnSelect??!0,type:`boolean`,onChange(e){F(t=>({...t,copyOnSelect:e})),_({...I(),copyOnSelect:e})}}]:[],V?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:y?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:h,type:`managedEnum`,onChange:m},{id:`notifChannel`,label:`Notifications`,value:g.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){F(t=>({...t,preferredNotifChannel:e})),_({...I(),preferredNotifChannel:e})}},{id:`outputStyle`,label:`Output style`,value:x,type:`managedEnum`,onChange:()=>{}},{id:`language`,label:`Language`,value:S??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:g.editorMode===`emacs`?`normal`:g.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){F(t=>({...t,editorMode:e})),_({...I(),editorMode:e})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:g.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){F(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),_({...I(),prStatusFooterEnabled:e})}},{id:`model`,label:`Model`,value:j===null?`Default (recommended)`:j,type:`managedEnum`,onChange:dt},...lt?[{id:`showExternalIncludesDialog`,label:`External AGENTS.md includes`,value:Ke().hasAgentsMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[]],H=Y.useMemo(()=>{if(!B)return mt;let e=B.toLowerCase();return mt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[mt,B]);Y.useEffect(()=>{if(C>=H.length){let e=Math.max(0,H.length-1);Se(e),E(Math.max(0,e-A+1));return}E(e=>C<e?C:C>=e+A?C-A+1:e)},[H.length,C,A]);let ht=(0,X.useCallback)(e=>{E(t=>e<t?e:e>=t+A?e-A+1:t)},[A]),gt=(0,X.useCallback)(()=>{if(R!==null)return;let t=Object.entries(He).map(([e,t])=>`Set ${e} to ${p.bold(t)}`);g.theme!==v.current.theme&&t.push(`Set theme to ${p.bold(g.theme)}`),g.preferredNotifChannel!==v.current.preferredNotifChannel&&t.push(`Set notifications to ${p.bold(g.preferredNotifChannel)}`),x!==_e.current&&t.push(`Set output style to ${p.bold(x)}`),S!==ye.current&&t.push(`Set response language to ${p.bold(S??`Default (English)`)}`),g.editorMode!==v.current.editorMode&&t.push(`Set editor mode to ${p.bold(g.editorMode||`emacs`)}`),g.diffTool!==v.current.diffTool&&t.push(`Set diff tool to ${p.bold(g.diffTool)}`),g.autoCompactEnabled!==v.current.autoCompactEnabled&&t.push(`${g.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),g.respectGitignore!==v.current.respectGitignore&&t.push(`${g.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),g.copyOnSelect!==v.current.copyOnSelect&&t.push(`${g.copyOnSelect?`Enabled`:`Disabled`} copy on select`),g.terminalProgressBarEnabled!==v.current.terminalProgressBarEnabled&&t.push(`${g.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),g.showStatusInTerminalTab!==v.current.showStatusInTerminalTab&&t.push(`${g.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),g.showTurnDuration!==v.current.showTurnDuration&&t.push(`${g.showTurnDuration?`Enabled`:`Disabled`} turn duration`),y?.autoUpdatesChannel!==pe.current?.autoUpdatesChannel&&t.push(`Set auto-update channel to ${p.bold(y?.autoUpdatesChannel??`latest`)}`),t.length>0?e(t.join(`
|
|
2
|
+
`)):e(`Config dialog dismissed`,{display:`system`})},[R,He,g,j,x,S,y?.autoUpdatesChannel,ke()?y?.fastMode:void 0,e]),_t=(0,X.useCallback)(()=>{h!==Xe.current&&m(Xe.current),F(()=>v.current);let e=Ge;w(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=qe;w(`userSettings`,{alwaysThinkingEnabled:t?.alwaysThinkingEnabled,fastMode:t?.fastMode,promptSuggestionEnabled:t?.promptSuggestionEnabled,autoUpdatesChannel:t?.autoUpdatesChannel,minimumVersion:t?.minimumVersion,language:t?.language,syntaxHighlightingDisabled:t?.syntaxHighlightingDisabled,permissions:t?.permissions===void 0?void 0:{...t.permissions,defaultMode:t.permissions.defaultMode}});let n=$e;N(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,settings:n.settings,toolPermissionContext:Re(e.toolPermissionContext)}))},[h,m,Ge,qe,$e,N]);re(`confirm:no`,(0,X.useCallback)(()=>{R===null&&(L.current&&_t(),e(`Config dialog dismissed`,{display:`system`}))},[R,_t,e]),{context:`Settings`,isActive:R===null&&!O&&!o}),re(`settings:close`,gt,{context:`Settings`,isActive:R===null&&!O&&!o});let U=(0,X.useCallback)(()=>{let e=H[C];if(e?.onChange){if(e.type===`boolean`){L.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===We.current?tt(!1):t.messages.some(e=>e.type===`assistant`)&&tt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:z(`Theme`),r(!0);return;case`model`:z(`Model`),r(!0);return;case`showExternalIncludesDialog`:z(`ExternalIncludes`),r(!0);return;case`outputStyle`:z(`OutputStyle`),r(!0);return;case`language`:z(`Language`),r(!0);return}if(e.id===`autoUpdatesChannel`){if(V){z(`EnableAutoUpdates`),r(!0);return}(y?.autoUpdatesChannel??`latest`)===`latest`?(z(`ChannelDowngrade`),r(!0)):(L.current=!0,w(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),b(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})));return}if(e.type===`enum`){L.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[V,H,C,y?.autoUpdatesChannel,r]),W=e=>{tt(!1);let t=Math.max(0,Math.min(H.length-1,C+e));Se(t),ht(t)};return ee({"select:previous":()=>{C===0?(tt(!1),k(!0),E(0)):W(-1)},"select:next":()=>W(1),"scroll:lineUp":()=>W(-1),"scroll:lineDown":()=>W(1),"select:accept":U,"select:previousValue":()=>U(),"select:nextValue":()=>U(),"settings:search":()=>{k(!0),it(``)}},{context:`Settings`,isActive:R===null&&!O&&!o}),(0,Z.jsx)(l,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(R===null&&!o){if(O){if(e.key===`escape`){e.preventDefault(),B.length>0?it(``):k(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),k(!1),Se(0),E(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),U();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),k(!0),it(e.key))}},[R,o,O,B,it,U]),children:R===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(yt,{onThemeSelect:e=>{L.current=!0,m(e),z(null),r(!1)},onCancel:()=>{z(null),r(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(l,{children:(0,Z.jsx)(u,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):R===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(St,{initial:j,onSelect:e=>{L.current=!0,dt(e),z(null),r(!1)},onCancel:()=>{z(null),r(!1)},showFastModeNotice:ke()?Be&&Me(j)&&ze():!1}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):R===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Tt,{onDone:()=>{z(null),r(!1)},externalIncludes:Pe(ct)}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):R===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Zt,{initialStyle:x,onComplete:e=>{L.current=!0,ge(e??`default`),z(null),r(!1),w(`localSettings`,{outputStyle:e})},onCancel:()=>{z(null),r(!1)}}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):R===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(nn,{initialLanguage:S,onComplete:e=>{L.current=!0,ve(e),z(null),r(!1),w(`userSettings`,{language:e})},onCancel:()=>{z(null),r(!1)}}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):R===`EnableAutoUpdates`?(0,Z.jsx)(le,{title:`Enable Auto-Updates`,onCancel:()=>{z(null),r(!1)},hideBorder:!0,hideInputGuide:!0,children:V?.type===`config`?(0,Z.jsx)(ut,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{L.current=!0,z(null),r(!1),F(e=>({...e,autoUpdates:!0})),_({...I(),autoUpdates:!0}),w(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),b(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0}))}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u,{children:V?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),V?.type===`env`&&(0,Z.jsxs)(u,{dimColor:!0,children:[`Unset `,V.envVar,` to re-enable auto-updates.`]})]})}):R===`ChannelDowngrade`?(0,Z.jsx)(Jt,{currentVersion:`0.0.28`,onChoice:e=>{if(z(null),r(!1),e===`cancel`)return;L.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.28`),w(`userSettings`,t),b(e=>({...e,...t}))}}):(0,Z.jsxs)(l,{flexDirection:`column`,gap:1,marginY:oe?void 0:1,children:[(0,Z.jsx)(se,{query:B,isFocused:O&&!o,isTerminalFocused:Te,cursorOffset:at,placeholder:`Search settings…`}),(0,Z.jsx)(l,{flexDirection:`column`,children:H.length===0?(0,Z.jsxs)(u,{dimColor:!0,italic:!0,children:[`No settings match "`,B,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[T>0&&(0,Z.jsxs)(u,{dimColor:!0,children:[s.arrowUp,` `,T,` more above`]}),H.slice(T,T+A).map((e,t)=>{let n=T+t===C&&!o&&!O;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(l,{width:`100%`,children:[(0,Z.jsx)(l,{width:44,children:(0,Z.jsxs)(u,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(l,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:e.value.toString()}),et&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(u,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:cn[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(sn,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:me(e.value)}):e.id===`autoUpdatesChannel`&&V?(0,Z.jsxs)(l,{flexDirection:`column`,children:[(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(u,{dimColor:!0,children:[`(`,Ye(V),`)`]})]}):(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),T+A<H.length&&(0,Z.jsxs)(u,{dimColor:!0,children:[s.arrowDown,` `,H.length-T-A,` more below`]})]})}),o?(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(c,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):O?(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(u,{children:`Type to filter`}),(0,Z.jsx)(c,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(c,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(M,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(M,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(M,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(M,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function sn({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(u,{children:[`iTerm2 `,(0,Z.jsx)(u,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(u,{children:[`Terminal Bell `,(0,Z.jsx)(u,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(u,{children:[`Kitty `,(0,Z.jsx)(u,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(u,{children:[`Ghostty `,(0,Z.jsx)(u,{dimColor:!0,children:`(OSC 777)`})]});case`iterm2_with_bell`:return`iTerm2 w/ Bell`;case`notifications_disabled`:return`Disabled`;default:return e}}var Y,X,Z,cn,ln=e((()=>{_(),Y=t(f(),1),X=t(f(),1),He(),o(),qe(),oe(),x(),A(),Xe(),Qe(),vt(),P(),bt(),R(),Ct(),wt(),Yt(),W(),tn(),an(),Ve(),Le(),ft(),Et(),S(),Ae(),i(),Ot(),N(),E(),Be(),Z=y(),cn={auto:`Auto (match terminal)`,dark:`Dark mode`,light:`Light mode`,"dark-daltonized":`Dark mode (colorblind-friendly)`,"light-daltonized":`Light mode (colorblind-friendly)`,"dark-ansi":`Dark mode (ANSI colors only)`,"light-ansi":`Light mode (ANSI colors only)`}}));function un({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,Q.useState)(n),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1),ee=pt(),{rows:te}=dt(ce()),l=ee?te+1:Math.max(15,Math.min(Math.floor(te*.8),30)),[u]=(0,Q.useState)(()=>Vt().catch(()=>[]));return ot(),re(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(v,{color:`permission`,children:(0,$.jsx)(g,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||ee?void 0:l,children:[(0,$.jsx)(h,{title:`Status`,children:(0,$.jsx)(Ut,{context:t,diagnosticsPromise:u})},`status`),(0,$.jsx)(h,{title:`Config`,children:(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(on,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:l})})},`config`)]})})}var Q,$,dn=e((()=>{Q=t(f(),1),He(),st(),N(),ft(),_(),qt(),ln(),$=y()}));export{dn as n,un as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as f,t as p}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{n as m,t as h}from"./figures-5ThXQEtq.js";import{Gr as g,H as _,I as v,P as y,T as b,ai as x,mt as S,ot as ee,t as C}from"./src-BX54x08P.js";import{t as w}from"./jsx-runtime-Bb4Xn-E0.js";import{$n as T,Qn as E,m as te,t as D}from"./settings-D4M13toi.js";import{Gn as ne,Kn as re,Pt as O,m as k}from"./state-CXY-q5gr.js";import{Bh as ie,Fh as ae,Fy as oe,Hh as A,Ih as se,Iy as ce,Ly as le,My as ue,Ny as de,Py as fe,Ry as pe,Uy as j,Wy as me,mC as he,ms as ge,pC as _e,ps as ve,sb as M,zh as N}from"./loadAgentsDir-uuZYOgKn.js";import{d as ye,o as be}from"./config-BDn2YIjC.js";import{n as xe,o as Se}from"./intl-D2kgJmX7.js";import{S as Ce,_ as we,f as Te,l as Ee}from"./startupProfiler-B9Qv2QGH.js";import{o as De}from"./TextInput-ZKU-x_FD.js";import{a as Oe,c as ke,l as Ae,n as je,o as Me,r as Ne,s as Pe,t as Fe,u as Ie}from"./SpinnerGlyph-BR_SiV9L.js";import{watch as Le}from"fs";var Re,ze,Be=e((()=>{O(),n(),Re=class e{constructor(e){r(this,`activeOperations`,new Set),r(this,`lastUserActivityTime`,0),r(this,`lastCLIRecordedTime`,void 0),r(this,`isCLIActive`,!1),r(this,`USER_ACTIVITY_TIMEOUT_MS`,5e3),r(this,`getNow`,void 0),r(this,`getActiveTimeCounter`,void 0),this.getNow=e?.getNow??(()=>Date.now()),this.getActiveTimeCounter=e?.getActiveTimeCounter??k,this.lastCLIRecordedTime=this.getNow()}static getInstance(){return e.instance||(e.instance=new e),e.instance}static resetInstance(){e.instance=null}static createInstance(t){return e.instance=new e(t),e.instance}recordUserActivity(){if(!this.isCLIActive&&this.lastUserActivityTime!==0){let e=(this.getNow()-this.lastUserActivityTime)/1e3;if(e>0){let t=this.getActiveTimeCounter();t&&e<this.USER_ACTIVITY_TIMEOUT_MS/1e3&&t.add(e,{type:`user`})}}this.lastUserActivityTime=this.getNow()}startCLIActivity(e){this.activeOperations.has(e)&&this.endCLIActivity(e);let t=this.activeOperations.size===0;this.activeOperations.add(e),t&&(this.isCLIActive=!0,this.lastCLIRecordedTime=this.getNow())}endCLIActivity(e){if(this.activeOperations.delete(e),this.activeOperations.size===0){let e=this.getNow(),t=(e-this.lastCLIRecordedTime)/1e3;if(t>0){let e=this.getActiveTimeCounter();e&&e.add(t,{type:`cli`})}this.lastCLIRecordedTime=e,this.isCLIActive=!1}}async trackOperation(e,t){this.startCLIActivity(e);try{return await t()}finally{this.endCLIActivity(e)}}getActivityStates(){return{isUserActive:(this.getNow()-this.lastUserActivityTime)/1e3<this.USER_ACTIVITY_TIMEOUT_MS/1e3,isCLIActive:this.isCLIActive,activeOperationCount:this.activeOperations.size}}},r(Re,`instance`,null),ze=Re.getInstance()}));function Ve(){let e=D().spinnerVerbs;return e?e.mode===`replace`?e.verbs.length>0?e.verbs:He:[...He,...e.verbs]:He}var He,Ue=e((()=>{te(),He=`Accomplishing.Actioning.Actualizing.Architecting.Baking.Beaming.Beboppin'.Befuddling.Billowing.Blanching.Bloviating.Boogieing.Boondoggling.Booping.Bootstrapping.Brewing.Bunning.Burrowing.Calculating.Canoodling.Caramelizing.Cascading.Catapulting.Cerebrating.Channeling.Channelling.Choreographing.Churning.Clauding.Coalescing.Cogitating.Combobulating.Composing.Computing.Concocting.Considering.Contemplating.Cooking.Crafting.Creating.Crunching.Crystallizing.Cultivating.Deciphering.Deliberating.Determining.Dilly-dallying.Discombobulating.Doing.Doodling.Drizzling.Ebbing.Effecting.Elucidating.Embellishing.Enchanting.Envisioning.Evaporating.Fermenting.Fiddle-faddling.Finagling.Flambéing.Flibbertigibbeting.Flowing.Flummoxing.Fluttering.Forging.Forming.Frolicking.Frosting.Gallivanting.Galloping.Garnishing.Generating.Gesticulating.Germinating.Gitifying.Grooving.Gusting.Harmonizing.Hashing.Hatching.Herding.Honking.Hullaballooing.Hyperspacing.Ideating.Imagining.Improvising.Incubating.Inferring.Infusing.Ionizing.Jitterbugging.Julienning.Kneading.Leavening.Levitating.Lollygagging.Manifesting.Marinating.Meandering.Metamorphosing.Misting.Moonwalking.Moseying.Mulling.Mustering.Musing.Nebulizing.Nesting.Newspapering.Noodling.Nucleating.Orbiting.Orchestrating.Osmosing.Perambulating.Percolating.Perusing.Philosophising.Photosynthesizing.Pollinating.Pondering.Pontificating.Pouncing.Precipitating.Prestidigitating.Processing.Proofing.Propagating.Puttering.Puzzling.Quantumizing.Razzle-dazzling.Razzmatazzing.Recombobulating.Reticulating.Roosting.Ruminating.Sautéing.Scampering.Schlepping.Scurrying.Seasoning.Shenaniganing.Shimmying.Simmering.Skedaddling.Sketching.Slithering.Smooshing.Sock-hopping.Spelunking.Spinning.Sprouting.Stewing.Sublimating.Swirling.Swooping.Symbioting.Synthesizing.Tempering.Thinking.Thundering.Tinkering.Tomfoolering.Topsy-turvying.Transfiguring.Transmuting.Twisting.Undulating.Unfurling.Unravelling.Vibing.Waddling.Wandering.Warping.Whatchamacalliting.Whirlpooling.Whirring.Whisking.Wibbling.Working.Wrangling.Zesting.Zigzagging`.split(`.`)}));function P(e,t){let n=parseInt(e.id,10),r=parseInt(t.id,10);return!isNaN(n)&&!isNaN(r)?n-r:e.id.localeCompare(t.id)}function We({tasks:e,isStandalone:t=!1}){let[,n]=F.useState(0),{rows:r,columns:i}=ee(),a=F.useRef(new Map),o=F.useRef(null);o.current===null&&(o.current=new Set(e.filter(e=>e.status===`completed`).map(e=>e.id)));let s=r<=10?0:Math.min(10,Math.max(3,r-14)),c=new Set(e.filter(e=>e.status===`completed`).map(e=>e.id)),l=Date.now();for(let e of c)o.current.has(e)||a.current.set(e,l);for(let e of a.current.keys())c.has(e)||a.current.delete(e);if(o.current=c,F.useEffect(()=>{if(a.current.size===0)return;let e=Date.now(),t=1/0;for(let n of a.current.values()){let r=n+qe;r>e&&r<t&&(t=r)}if(t===1/0)return;let r=setTimeout(e=>e(e=>e+1),t-e,n);return()=>clearTimeout(r)},[e]),!oe()||e.length===0)return null;let u=E(e,e=>e.status===`completed`),d=E(e,e=>e.status===`pending`),f=e.length-u-d,p=new Set(e.filter(e=>e.status!==`completed`).map(e=>e.id)),m=e.length>s,h,g;if(m){let t=[],n=[];for(let r of e.filter(e=>e.status===`completed`)){let e=a.current.get(r.id);e&&l-e<qe?t.push(r):n.push(r)}t.sort(P),n.sort(P);let r=e.filter(e=>e.status===`in_progress`).sort(P),i=e.filter(e=>e.status===`pending`).sort((e,t)=>{let n=e.blockedBy.some(e=>p.has(e));return n===t.blockedBy.some(e=>p.has(e))?P(e,t):n?1:-1}),o=[...t,...r,...i,...n];h=o.slice(0,s),g=o.slice(s)}else h=[...e].sort(P),g=[];let _=``;if(g.length>0){let e=[],t=E(g,e=>e.status===`pending`),n=E(g,e=>e.status===`in_progress`),r=E(g,e=>e.status===`completed`);n>0&&e.push(`${n} in progress`),t>0&&e.push(`${t} pending`),r>0&&e.push(`${r} completed`),_=` … +${e.join(`, `)}`}let b=(0,I.jsxs)(I.Fragment,{children:[h.map(e=>(0,I.jsx)(Ke,{task:e,openBlockers:e.blockedBy.filter(e=>p.has(e)),columns:i},e.id)),s>0&&_&&(0,I.jsx)(y,{dimColor:!0,children:_})]});return t?(0,I.jsxs)(v,{flexDirection:`column`,marginTop:1,marginLeft:2,children:[(0,I.jsx)(v,{children:(0,I.jsxs)(y,{dimColor:!0,children:[(0,I.jsx)(y,{bold:!0,children:e.length}),` tasks (`,(0,I.jsx)(y,{bold:!0,children:u}),` done, `,f>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(y,{bold:!0,children:f}),` in progress, `]}),(0,I.jsx)(y,{bold:!0,children:d}),` open)`]})}),b]}):(0,I.jsx)(v,{flexDirection:`column`,children:b})}function Ge(e){switch(e){case`completed`:return{icon:h.tick,color:`success`};case`in_progress`:return{icon:h.squareSmallFilled,color:`claude`};case`pending`:return{icon:h.squareSmall,color:void 0}}}function Ke({task:e,openBlockers:t,columns:n}){let r=e.status===`completed`,i=e.status===`in_progress`,a=t.length>0,{icon:o,color:s}=Ge(e.status),c=Math.max(15,n-15),l=Ce(e.subject,c);return(0,I.jsx)(v,{flexDirection:`column`,children:(0,I.jsxs)(v,{children:[(0,I.jsxs)(y,{color:s,children:[o,` `]}),(0,I.jsx)(y,{bold:i,strikethrough:r,dimColor:r||a,children:l}),a&&(0,I.jsxs)(y,{dimColor:!0,children:[` `,h.pointerSmall,` blocked by`,` `,[...t].sort((e,t)=>parseInt(e,10)-parseInt(t,10)).map(e=>`#${e}`).join(`, `)]})]})})}var F,I,qe,Je=e((()=>{m(),F=t(x(),1),M(),C(),T(),we(),fe(),I=w(),qe=3e4}));function Ye(){l(st,this).emit()}function Xe(e){if(!(e===l(B,this)&&l(z,this)!==null)){l(z,this)?.close(),d(z,this,null),d(B,this,e);try{d(z,this,Le(e,l(J,this))),l(z,this).unref()}catch{}}}function Ze(e){d(V,this,null);let t=ue();t===e&&ce(t).then(async e=>{e.length>0&&e.every(e=>e.status===`completed`)&&(await pe(t),d(L,this,[]),d(R,this,!0)),i(q,this,Ye).call(this)})}function Qe(){l(V,this)&&(clearTimeout(l(V,this)),d(V,this,null))}function $e(){l(z,this)?.close(),d(z,this,null),d(B,this,null),l(W,this)?.call(this),d(W,this,null),i(q,this,Qe).call(this),l(H,this)&&clearTimeout(l(H,this)),l(U,this)&&clearTimeout(l(U,this)),d(H,this,null),d(U,this,null),d(K,this,!1)}function et(){return ut??(ut=new lt)}function tt(){let e=oe()?et():null;return(0,rt.useSyncExternalStore)(e?e.subscribe:ft,e?e.getSnapshot:pt)}function nt(){let e=tt(),t=A(),n=e===void 0;return(0,rt.useEffect)(()=>{n&&t(e=>e.expandedView===`tasks`?{...e,expandedView:`none`}:e)},[n,t]),e}var rt,it,at,ot,L,R,z,B,V,H,U,W,st,G,K,q,J,ct,lt,ut,dt,ft,pt,mt=e((()=>{rt=t(x(),1),N(),re(),fe(),f(),a(),n(),o(),s(),c(),it=5e3,at=50,ot=5e3,L=new WeakMap,R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,st=new WeakMap,G=new WeakMap,K=new WeakMap,q=new WeakSet,J=new WeakMap,ct=new WeakMap,lt=class{constructor(){p(this,q),u(this,L,void 0),u(this,R,!1),u(this,z,null),u(this,B,null),u(this,V,null),u(this,H,null),u(this,U,null),u(this,W,null),u(this,st,ne()),u(this,G,0),u(this,K,!1),r(this,`getSnapshot`,()=>l(R,this)?void 0:l(L,this)),r(this,`subscribe`,e=>{var t;let n=l(st,this).subscribe(e);d(G,this,(t=l(G,this),t++,t)),l(K,this)||(d(K,this,!0),d(W,this,le(l(J,this))),l(ct,this).call(this));let r=!1;return()=>{var e;r||(r=!0,n(),d(G,this,(e=l(G,this),e--,e)),l(G,this)===0&&i(q,this,$e).call(this))}}),u(this,J,()=>{l(H,this)&&clearTimeout(l(H,this)),d(H,this,setTimeout(()=>void l(ct,this).call(this),at)),l(H,this).unref()}),u(this,ct,async()=>{let e=ue();i(q,this,Xe).call(this,de(e));let t=(await ce(e)).filter(e=>!e.metadata?._internal);d(L,this,t);let n=t.some(e=>e.status!==`completed`);n||t.length===0?(d(R,this,t.length===0),i(q,this,Qe).call(this)):l(V,this)===null&&!l(R,this)&&(d(V,this,setTimeout(i(q,this,Ze).bind(this,e),it)),l(V,this).unref()),i(q,this,Ye).call(this),l(U,this)&&(clearTimeout(l(U,this)),d(U,this,null)),n&&(d(U,this,setTimeout(l(J,this),ot)),l(U,this).unref())})}},ut=null,dt=()=>{},ft=()=>dt,pt=()=>void 0})),ht=e((()=>{C(),Ie(),w()}));function gt({message:e,mode:t,messageColor:n,glimmerIndex:r,flashOpacity:i,shimmerColor:a,stalledIntensity:o=0}){let[s]=_(),c=Ae(s),{segments:l,messageWidth:u}=_t.useMemo(()=>{let t=[];for(let{segment:n}of xe().segment(e))t.push({segment:n,width:g(n)});return{segments:t,messageWidth:g(e)}},[e]);if(!e)return null;if(o>0){let t=c[n],r=t?Pe(t):null;if(r){let t=ke(Me(r,vt,o));return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{color:t,children:e}),(0,Y.jsx)(y,{color:t,children:` `})]})}let i=o>.5?`error`:n;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{color:i,children:e}),(0,Y.jsx)(y,{color:i,children:` `})]})}if(t===`tool-use`){let t=c[n],r=c[a],o=t?Pe(t):null,s=r?Pe(r):null;return o&&s?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{color:ke(Me(o,s,i)),children:e}),(0,Y.jsx)(y,{color:n,children:` `})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{color:i>.5?a:n,children:e}),(0,Y.jsx)(y,{color:n,children:` `})]})}let d=r-1,f=r+1;if(d>=u||f<0)return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{color:n,children:e}),(0,Y.jsx)(y,{color:n,children:` `})]});let p=Math.max(0,d),m=0,h=``,v=``,b=``;for(let{segment:e,width:t}of l)m+t<=p?h+=e:m>f?b+=e:v+=e,m+=t;return(0,Y.jsxs)(Y.Fragment,{children:[h&&(0,Y.jsx)(y,{color:n,children:h}),(0,Y.jsx)(y,{color:a,children:v}),b&&(0,Y.jsx)(y,{color:n,children:b}),(0,Y.jsx)(y,{color:n,children:` `})]})}var _t,Y,vt,yt=e((()=>{_t=t(x(),1),C(),Se(),Ie(),Oe(),Y=w(),vt={r:171,g:43,b:63}}));function bt(e,t,n){let r=e===`requesting`?50:200,[i,a]=S(n?null:r),o=(0,xt.useMemo)(()=>g(t),[t]);if(n)return[i,-100];let s=Math.floor(a/r),c=o+20;return e===`requesting`?[i,s%c-10]:[i,o+10-s%c]}var xt,St=e((()=>{xt=t(x(),1),C()}));function Ct(e,t,n=!1,r=!1){let i=(0,X.useRef)(e),a=(0,X.useRef)(t),o=(0,X.useRef)(e),s=(0,X.useRef)(0),c=(0,X.useRef)(e);t>a.current&&(i.current=e,a.current=t,s.current=0,c.current=e);let l;n?(l=0,i.current=e):l=t>0?e-i.current:e-o.current;let u=l>3e3&&!n,d=u?Math.min((l-3e3)/2e3,1):0;if(!r&&(d>0||s.current>0)){let t=e-c.current;if(t>=50){let n=Math.floor(t/50),r=s.current;for(let e=0;e<n;e++){let e=d-r;if(Math.abs(e)<.01){r=d;break}r+=e*.1}s.current=r,c.current=e}}else s.current=d,c.current=e;return{isStalled:u,stalledIntensity:r?d:s.current}}var X,wt=e((()=>{X=t(x(),1)})),Tt=e((()=>{ht(),yt(),De(),je(),St(),wt(),Oe()}));function Et({mode:e,reducedMotion:t,hasActiveTools:n,responseLengthRef:r,message:i,messageColor:a,shimmerColor:o,overrideColor:s,loadingStartTimeRef:c,totalPausedMsRef:l,pauseStartTimeRef:u,spinnerSuffix:d,verbose:f,columns:p,agentTokens:m,leaderIsIdle:_=!1,thinkingStatus:x}){let[ee,C]=S(t?null:50),w=Date.now(),T=u.current===null?w-c.current-l.current:u.current-c.current-l.current,E=r.current,{isStalled:te,stalledIntensity:D}=Ct(C,E,n||_,t),ne=t?0:Math.floor(C/120),re=e===`requesting`?50:200,O=(0,Ot.useMemo)(()=>g(i),[i]),k=O+20,ie=Math.floor(C/re),ae=t||te?-100:e===`requesting`?ie%k-10:O+10-ie%k,oe=t?0:e===`tool-use`?(Math.sin(C/1e3*Math.PI)+1)/2:0,A=(0,Ot.useRef)(E);if(t)A.current=E;else{let e=E-A.current;if(e>0){let t;t=e<70?3:e<200?Math.max(8,Math.ceil(e*.15)):50,A.current=Math.min(A.current+t,E)}}let se=A.current,ce=Math.round(se/4),le=Ee(T),ue=g(le),de=ce+m,fe=Te(de),pe=g(`${h.arrowDown} ${fe} tokens`),j=x===`thinking`?`thinking`:typeof x==`number`?`thought for ${Math.max(1,Math.round(x/1e3))}s`:null,me=j?g(j):0,he=O+2,ge=kt,_e=x!==null,ve=f||T>jt,M=p-he-5,N=_e&&M>me;!N&&_e&&x===`thinking`&&M>At&&(j=`thinking`,me=At,N=!0);let ye=N?me+ge:0,be=ve&&M>ye+ue,xe=ye+(be?ue+ge:0),Se=ve&&de>0&&M>xe+pe,Ce=N&&x===`thinking`&&!d&&!be&&!Se&&!0,we=(C-Pt)/1e3,De=C<Pt?0:(Math.sin(we*Math.PI*2/Ft)+1)/2,Oe=ke(Me(Mt,Nt,De)),Ae=[...d?[(0,Z.jsx)(y,{dimColor:!0,children:d},`suffix`)]:[],...be?[(0,Z.jsx)(y,{dimColor:!0,children:le},`elapsedTime`)]:[],...Se?[(0,Z.jsxs)(v,{flexDirection:`row`,children:[(0,Z.jsx)(Dt,{mode:e}),(0,Z.jsxs)(y,{dimColor:!0,children:[fe,` tokens`]})]},`tokens`)]:[],...N&&j?[x===`thinking`&&!t?(0,Z.jsx)(y,{color:Oe,children:Ce?`(${j})`:j},`thinking`):(0,Z.jsx)(y,{dimColor:!0,children:j},`thinking`)]:[]],je=Ae.length>0?Ce?(0,Z.jsx)(b,{children:Ae}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(y,{dimColor:!0,children:`(`}),(0,Z.jsx)(b,{children:Ae}),(0,Z.jsx)(y,{dimColor:!0,children:`)`})]}):null;return(0,Z.jsxs)(v,{ref:ee,flexDirection:`row`,flexWrap:`wrap`,marginTop:1,width:`100%`,children:[(0,Z.jsx)(Fe,{frame:ne,messageColor:a,stalledIntensity:s?0:D,reducedMotion:t,time:C}),(0,Z.jsx)(gt,{message:i,mode:e,messageColor:a,glimmerIndex:ae,flashOpacity:oe,shimmerColor:o,stalledIntensity:s?0:D}),je]})}function Dt({mode:e}){switch(e){case`tool-input`:case`tool-use`:case`responding`:case`thinking`:return(0,Z.jsx)(v,{width:2,children:(0,Z.jsx)(y,{dimColor:!0,children:h.arrowDown})});case`requesting`:return(0,Z.jsx)(v,{width:2,children:(0,Z.jsx)(y,{dimColor:!0,children:h.arrowUp})})}}var Ot,Z,kt,At,jt,Mt,Nt,Pt,Ft,It=e((()=>{m(),Ot=t(x(),1),C(),we(),yt(),je(),wt(),Oe(),Z=w(),kt=g(` · `),At=g(`thinking`),jt=3e4,Mt={r:153,g:153,b:153},Nt={r:185,g:185,b:185},Pt=3e3,Ft=2}));function Lt(e){return(0,$.jsx)(Rt,{...e})}function Rt({mode:e,loadingStartTimeRef:t,totalPausedMsRef:n,pauseStartTimeRef:r,spinnerTip:i,responseLengthRef:a,overrideColor:o,overrideShimmerColor:s,overrideMessage:c,spinnerSuffix:l,verbose:u,hasActiveTools:d=!1,leaderIsIdle:f=!1}){let p=se(),m=p.prefersReducedMotion??!1,h=ie(e=>e.tasks),g=ie(e=>e.expandedView)===`tasks`,{columns:_}=ee(),b=tt(),[x,S]=(0,Q.useState)(null),C=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{let t=null,n=null;if(e===`thinking`)C.current===null&&(C.current=Date.now(),S(`thinking`));else if(C.current!==null){let e=Date.now()-C.current,r=Date.now()-C.current,i=Math.max(0,2e3-r);C.current=null;let a=()=>{S(e),n=setTimeout(S,2e3,null)};i>0?t=setTimeout(a,i):a()}return()=>{t&&clearTimeout(t),n&&clearTimeout(n)}},[e]);let w=b?.find(e=>e.status!==`pending`&&e.status!==`completed`),T=Bt(b),[E]=(0,Q.useState)(()=>he(Ve())),te=`${c??w?.activeForm??w?.subject??E}…`;(0,Q.useEffect)(()=>{let t=`spinner-${e}`;return ze.startCLIActivity(t),()=>{ze.endCLIActivity(t)}},[e]);let D=0;for(let e of Object.values(h))e.status===`running`&&ge(e)&&e.progress?.tokenCount&&(D+=e.progress.tokenCount);let ne=r.current===null?Date.now()-t.current-n.current:r.current-t.current-n.current,re=o??`claude`,O=s??`workmateShimmer`,k=p.spinnerTipsEnabled!==!1,ae=k&&ne>18e5,oe=k&&ne>3e4&&!be().btwUseCount,A=ae&&!T?`Use /clear to start fresh when switching topics and free up context`:oe&&!T?`Use /btw to ask a quick side question without interrupting Work Mate's current work`:i;return(0,$.jsxs)(v,{flexDirection:`column`,width:`100%`,alignItems:`flex-start`,children:[(0,$.jsx)(Et,{mode:e,reducedMotion:m,hasActiveTools:d,responseLengthRef:a,message:te,messageColor:re,shimmerColor:O,overrideColor:o,loadingStartTimeRef:t,totalPausedMsRef:n,pauseStartTimeRef:r,spinnerSuffix:l,verbose:u,columns:_,agentTokens:D,leaderIsIdle:f,thinkingStatus:x}),g&&b&&b.length>0?(0,$.jsx)(v,{width:`100%`,flexDirection:`column`,children:(0,$.jsx)(j,{children:(0,$.jsx)(We,{tasks:b})})}):T||A?(0,$.jsxs)(v,{width:`100%`,flexDirection:`column`,children:[null,(T||A)&&(0,$.jsx)(j,{children:(0,$.jsx)(y,{dimColor:!0,children:T?`Next: ${T.subject}`:`Tip: ${A}`})})]}):null]})}function zt(){let e=se().prefersReducedMotion??!1,[t,n]=S(e?null:120);if(e)return(0,$.jsx)(v,{ref:t,flexWrap:`wrap`,height:1,width:2,children:(0,$.jsx)(y,{color:`text`,children:`●`})});let r=Math.floor(n/120)%Ht.length;return(0,$.jsx)(v,{ref:t,flexWrap:`wrap`,height:1,width:2,children:(0,$.jsx)(y,{color:`text`,children:Ht[r]})})}function Bt(e){if(!e)return;let t=e.filter(e=>e.status===`pending`);if(t.length===0)return;let n=new Set(e.filter(e=>e.status!==`completed`).map(e=>e.id));return t.find(e=>!e.blockedBy.some(e=>n.has(e)))??t[0]}var Q,$,Vt,Ht,Ut=e((()=>{C(),Q=t(x(),1),_e(),we(),Be(),Ue(),me(),Je(),mt(),N(),M(),Tt(),It(),ae(),ve(),O(),ye(),$=w(),Vt=Ne(),Ht=[...Vt,...[...Vt].reverse()]}));export{bt as a,nt as c,ze as d,Be as f,St as i,We as l,Lt as n,mt as o,Ut as r,tt as s,zt as t,Je as u};
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as f,t as p}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{n as m,t as h}from"./figures-5ThXQEtq.js";import{Gr as g,H as _,I as v,P as y,T as b,ai as x,mt as S,ot as ee,t as C}from"./src-BX54x08P.js";import{t as w}from"./jsx-runtime-Bb4Xn-E0.js";import{$n as T,Qn as E,m as te,t as D}from"./settings-D4M13toi.js";import{Gn as ne,Kn as re,Pt as O,m as k}from"./state-CXY-q5gr.js";import{Bh as ie,Fh as ae,Fy as oe,Hh as A,Ih as se,Iy as ce,Ly as le,My as ue,Ny as de,Py as fe,Ry as pe,Uy as j,Wy as me,mC as he,ms as ge,pC as _e,ps as ve,sb as M,zh as N}from"./loadAgentsDir-bmpKLPdG.js";import{d as ye,o as be}from"./config-Bio2EjUK.js";import{n as xe,o as Se}from"./intl-D2kgJmX7.js";import{S as Ce,_ as we,f as Te,l as Ee}from"./startupProfiler-B9Qv2QGH.js";import{o as De}from"./TextInput-ou7ZhpVY.js";import{a as Oe,c as ke,l as Ae,n as je,o as Me,r as Ne,s as Pe,t as Fe,u as Ie}from"./SpinnerGlyph-BR_SiV9L.js";import{watch as Le}from"fs";var Re,ze,Be=e((()=>{O(),n(),Re=class e{constructor(e){r(this,`activeOperations`,new Set),r(this,`lastUserActivityTime`,0),r(this,`lastCLIRecordedTime`,void 0),r(this,`isCLIActive`,!1),r(this,`USER_ACTIVITY_TIMEOUT_MS`,5e3),r(this,`getNow`,void 0),r(this,`getActiveTimeCounter`,void 0),this.getNow=e?.getNow??(()=>Date.now()),this.getActiveTimeCounter=e?.getActiveTimeCounter??k,this.lastCLIRecordedTime=this.getNow()}static getInstance(){return e.instance||(e.instance=new e),e.instance}static resetInstance(){e.instance=null}static createInstance(t){return e.instance=new e(t),e.instance}recordUserActivity(){if(!this.isCLIActive&&this.lastUserActivityTime!==0){let e=(this.getNow()-this.lastUserActivityTime)/1e3;if(e>0){let t=this.getActiveTimeCounter();t&&e<this.USER_ACTIVITY_TIMEOUT_MS/1e3&&t.add(e,{type:`user`})}}this.lastUserActivityTime=this.getNow()}startCLIActivity(e){this.activeOperations.has(e)&&this.endCLIActivity(e);let t=this.activeOperations.size===0;this.activeOperations.add(e),t&&(this.isCLIActive=!0,this.lastCLIRecordedTime=this.getNow())}endCLIActivity(e){if(this.activeOperations.delete(e),this.activeOperations.size===0){let e=this.getNow(),t=(e-this.lastCLIRecordedTime)/1e3;if(t>0){let e=this.getActiveTimeCounter();e&&e.add(t,{type:`cli`})}this.lastCLIRecordedTime=e,this.isCLIActive=!1}}async trackOperation(e,t){this.startCLIActivity(e);try{return await t()}finally{this.endCLIActivity(e)}}getActivityStates(){return{isUserActive:(this.getNow()-this.lastUserActivityTime)/1e3<this.USER_ACTIVITY_TIMEOUT_MS/1e3,isCLIActive:this.isCLIActive,activeOperationCount:this.activeOperations.size}}},r(Re,`instance`,null),ze=Re.getInstance()}));function Ve(){let e=D().spinnerVerbs;return e?e.mode===`replace`?e.verbs.length>0?e.verbs:He:[...He,...e.verbs]:He}var He,Ue=e((()=>{te(),He=`Accomplishing.Actioning.Actualizing.Architecting.Baking.Beaming.Beboppin'.Befuddling.Billowing.Blanching.Bloviating.Boogieing.Boondoggling.Booping.Bootstrapping.Brewing.Bunning.Burrowing.Calculating.Canoodling.Caramelizing.Cascading.Catapulting.Cerebrating.Channeling.Channelling.Choreographing.Churning.Clauding.Coalescing.Cogitating.Combobulating.Composing.Computing.Concocting.Considering.Contemplating.Cooking.Crafting.Creating.Crunching.Crystallizing.Cultivating.Deciphering.Deliberating.Determining.Dilly-dallying.Discombobulating.Doing.Doodling.Drizzling.Ebbing.Effecting.Elucidating.Embellishing.Enchanting.Envisioning.Evaporating.Fermenting.Fiddle-faddling.Finagling.Flambéing.Flibbertigibbeting.Flowing.Flummoxing.Fluttering.Forging.Forming.Frolicking.Frosting.Gallivanting.Galloping.Garnishing.Generating.Gesticulating.Germinating.Gitifying.Grooving.Gusting.Harmonizing.Hashing.Hatching.Herding.Honking.Hullaballooing.Hyperspacing.Ideating.Imagining.Improvising.Incubating.Inferring.Infusing.Ionizing.Jitterbugging.Julienning.Kneading.Leavening.Levitating.Lollygagging.Manifesting.Marinating.Meandering.Metamorphosing.Misting.Moonwalking.Moseying.Mulling.Mustering.Musing.Nebulizing.Nesting.Newspapering.Noodling.Nucleating.Orbiting.Orchestrating.Osmosing.Perambulating.Percolating.Perusing.Philosophising.Photosynthesizing.Pollinating.Pondering.Pontificating.Pouncing.Precipitating.Prestidigitating.Processing.Proofing.Propagating.Puttering.Puzzling.Quantumizing.Razzle-dazzling.Razzmatazzing.Recombobulating.Reticulating.Roosting.Ruminating.Sautéing.Scampering.Schlepping.Scurrying.Seasoning.Shenaniganing.Shimmying.Simmering.Skedaddling.Sketching.Slithering.Smooshing.Sock-hopping.Spelunking.Spinning.Sprouting.Stewing.Sublimating.Swirling.Swooping.Symbioting.Synthesizing.Tempering.Thinking.Thundering.Tinkering.Tomfoolering.Topsy-turvying.Transfiguring.Transmuting.Twisting.Undulating.Unfurling.Unravelling.Vibing.Waddling.Wandering.Warping.Whatchamacalliting.Whirlpooling.Whirring.Whisking.Wibbling.Working.Wrangling.Zesting.Zigzagging`.split(`.`)}));function P(e,t){let n=parseInt(e.id,10),r=parseInt(t.id,10);return!isNaN(n)&&!isNaN(r)?n-r:e.id.localeCompare(t.id)}function We({tasks:e,isStandalone:t=!1}){let[,n]=F.useState(0),{rows:r,columns:i}=ee(),a=F.useRef(new Map),o=F.useRef(null);o.current===null&&(o.current=new Set(e.filter(e=>e.status===`completed`).map(e=>e.id)));let s=r<=10?0:Math.min(10,Math.max(3,r-14)),c=new Set(e.filter(e=>e.status===`completed`).map(e=>e.id)),l=Date.now();for(let e of c)o.current.has(e)||a.current.set(e,l);for(let e of a.current.keys())c.has(e)||a.current.delete(e);if(o.current=c,F.useEffect(()=>{if(a.current.size===0)return;let e=Date.now(),t=1/0;for(let n of a.current.values()){let r=n+qe;r>e&&r<t&&(t=r)}if(t===1/0)return;let r=setTimeout(e=>e(e=>e+1),t-e,n);return()=>clearTimeout(r)},[e]),!oe()||e.length===0)return null;let u=E(e,e=>e.status===`completed`),d=E(e,e=>e.status===`pending`),f=e.length-u-d,p=new Set(e.filter(e=>e.status!==`completed`).map(e=>e.id)),m=e.length>s,h,g;if(m){let t=[],n=[];for(let r of e.filter(e=>e.status===`completed`)){let e=a.current.get(r.id);e&&l-e<qe?t.push(r):n.push(r)}t.sort(P),n.sort(P);let r=e.filter(e=>e.status===`in_progress`).sort(P),i=e.filter(e=>e.status===`pending`).sort((e,t)=>{let n=e.blockedBy.some(e=>p.has(e));return n===t.blockedBy.some(e=>p.has(e))?P(e,t):n?1:-1}),o=[...t,...r,...i,...n];h=o.slice(0,s),g=o.slice(s)}else h=[...e].sort(P),g=[];let _=``;if(g.length>0){let e=[],t=E(g,e=>e.status===`pending`),n=E(g,e=>e.status===`in_progress`),r=E(g,e=>e.status===`completed`);n>0&&e.push(`${n} in progress`),t>0&&e.push(`${t} pending`),r>0&&e.push(`${r} completed`),_=` … +${e.join(`, `)}`}let b=(0,I.jsxs)(I.Fragment,{children:[h.map(e=>(0,I.jsx)(Ke,{task:e,openBlockers:e.blockedBy.filter(e=>p.has(e)),columns:i},e.id)),s>0&&_&&(0,I.jsx)(y,{dimColor:!0,children:_})]});return t?(0,I.jsxs)(v,{flexDirection:`column`,marginTop:1,marginLeft:2,children:[(0,I.jsx)(v,{children:(0,I.jsxs)(y,{dimColor:!0,children:[(0,I.jsx)(y,{bold:!0,children:e.length}),` tasks (`,(0,I.jsx)(y,{bold:!0,children:u}),` done, `,f>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(y,{bold:!0,children:f}),` in progress, `]}),(0,I.jsx)(y,{bold:!0,children:d}),` open)`]})}),b]}):(0,I.jsx)(v,{flexDirection:`column`,children:b})}function Ge(e){switch(e){case`completed`:return{icon:h.tick,color:`success`};case`in_progress`:return{icon:h.squareSmallFilled,color:`claude`};case`pending`:return{icon:h.squareSmall,color:void 0}}}function Ke({task:e,openBlockers:t,columns:n}){let r=e.status===`completed`,i=e.status===`in_progress`,a=t.length>0,{icon:o,color:s}=Ge(e.status),c=Math.max(15,n-15),l=Ce(e.subject,c);return(0,I.jsx)(v,{flexDirection:`column`,children:(0,I.jsxs)(v,{children:[(0,I.jsxs)(y,{color:s,children:[o,` `]}),(0,I.jsx)(y,{bold:i,strikethrough:r,dimColor:r||a,children:l}),a&&(0,I.jsxs)(y,{dimColor:!0,children:[` `,h.pointerSmall,` blocked by`,` `,[...t].sort((e,t)=>parseInt(e,10)-parseInt(t,10)).map(e=>`#${e}`).join(`, `)]})]})})}var F,I,qe,Je=e((()=>{m(),F=t(x(),1),M(),C(),T(),we(),fe(),I=w(),qe=3e4}));function Ye(){l(st,this).emit()}function Xe(e){if(!(e===l(B,this)&&l(z,this)!==null)){l(z,this)?.close(),d(z,this,null),d(B,this,e);try{d(z,this,Le(e,l(J,this))),l(z,this).unref()}catch{}}}function Ze(e){d(V,this,null);let t=ue();t===e&&ce(t).then(async e=>{e.length>0&&e.every(e=>e.status===`completed`)&&(await pe(t),d(L,this,[]),d(R,this,!0)),i(q,this,Ye).call(this)})}function Qe(){l(V,this)&&(clearTimeout(l(V,this)),d(V,this,null))}function $e(){l(z,this)?.close(),d(z,this,null),d(B,this,null),l(W,this)?.call(this),d(W,this,null),i(q,this,Qe).call(this),l(H,this)&&clearTimeout(l(H,this)),l(U,this)&&clearTimeout(l(U,this)),d(H,this,null),d(U,this,null),d(K,this,!1)}function et(){return ut??(ut=new lt)}function tt(){let e=oe()?et():null;return(0,rt.useSyncExternalStore)(e?e.subscribe:ft,e?e.getSnapshot:pt)}function nt(){let e=tt(),t=A(),n=e===void 0;return(0,rt.useEffect)(()=>{n&&t(e=>e.expandedView===`tasks`?{...e,expandedView:`none`}:e)},[n,t]),e}var rt,it,at,ot,L,R,z,B,V,H,U,W,st,G,K,q,J,ct,lt,ut,dt,ft,pt,mt=e((()=>{rt=t(x(),1),N(),re(),fe(),f(),a(),n(),o(),s(),c(),it=5e3,at=50,ot=5e3,L=new WeakMap,R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,st=new WeakMap,G=new WeakMap,K=new WeakMap,q=new WeakSet,J=new WeakMap,ct=new WeakMap,lt=class{constructor(){p(this,q),u(this,L,void 0),u(this,R,!1),u(this,z,null),u(this,B,null),u(this,V,null),u(this,H,null),u(this,U,null),u(this,W,null),u(this,st,ne()),u(this,G,0),u(this,K,!1),r(this,`getSnapshot`,()=>l(R,this)?void 0:l(L,this)),r(this,`subscribe`,e=>{var t;let n=l(st,this).subscribe(e);d(G,this,(t=l(G,this),t++,t)),l(K,this)||(d(K,this,!0),d(W,this,le(l(J,this))),l(ct,this).call(this));let r=!1;return()=>{var e;r||(r=!0,n(),d(G,this,(e=l(G,this),e--,e)),l(G,this)===0&&i(q,this,$e).call(this))}}),u(this,J,()=>{l(H,this)&&clearTimeout(l(H,this)),d(H,this,setTimeout(()=>void l(ct,this).call(this),at)),l(H,this).unref()}),u(this,ct,async()=>{let e=ue();i(q,this,Xe).call(this,de(e));let t=(await ce(e)).filter(e=>!e.metadata?._internal);d(L,this,t);let n=t.some(e=>e.status!==`completed`);n||t.length===0?(d(R,this,t.length===0),i(q,this,Qe).call(this)):l(V,this)===null&&!l(R,this)&&(d(V,this,setTimeout(i(q,this,Ze).bind(this,e),it)),l(V,this).unref()),i(q,this,Ye).call(this),l(U,this)&&(clearTimeout(l(U,this)),d(U,this,null)),n&&(d(U,this,setTimeout(l(J,this),ot)),l(U,this).unref())})}},ut=null,dt=()=>{},ft=()=>dt,pt=()=>void 0})),ht=e((()=>{C(),Ie(),w()}));function gt({message:e,mode:t,messageColor:n,glimmerIndex:r,flashOpacity:i,shimmerColor:a,stalledIntensity:o=0}){let[s]=_(),c=Ae(s),{segments:l,messageWidth:u}=_t.useMemo(()=>{let t=[];for(let{segment:n}of xe().segment(e))t.push({segment:n,width:g(n)});return{segments:t,messageWidth:g(e)}},[e]);if(!e)return null;if(o>0){let t=c[n],r=t?Pe(t):null;if(r){let t=ke(Me(r,vt,o));return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{color:t,children:e}),(0,Y.jsx)(y,{color:t,children:` `})]})}let i=o>.5?`error`:n;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{color:i,children:e}),(0,Y.jsx)(y,{color:i,children:` `})]})}if(t===`tool-use`){let t=c[n],r=c[a],o=t?Pe(t):null,s=r?Pe(r):null;return o&&s?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{color:ke(Me(o,s,i)),children:e}),(0,Y.jsx)(y,{color:n,children:` `})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{color:i>.5?a:n,children:e}),(0,Y.jsx)(y,{color:n,children:` `})]})}let d=r-1,f=r+1;if(d>=u||f<0)return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{color:n,children:e}),(0,Y.jsx)(y,{color:n,children:` `})]});let p=Math.max(0,d),m=0,h=``,v=``,b=``;for(let{segment:e,width:t}of l)m+t<=p?h+=e:m>f?b+=e:v+=e,m+=t;return(0,Y.jsxs)(Y.Fragment,{children:[h&&(0,Y.jsx)(y,{color:n,children:h}),(0,Y.jsx)(y,{color:a,children:v}),b&&(0,Y.jsx)(y,{color:n,children:b}),(0,Y.jsx)(y,{color:n,children:` `})]})}var _t,Y,vt,yt=e((()=>{_t=t(x(),1),C(),Se(),Ie(),Oe(),Y=w(),vt={r:171,g:43,b:63}}));function bt(e,t,n){let r=e===`requesting`?50:200,[i,a]=S(n?null:r),o=(0,xt.useMemo)(()=>g(t),[t]);if(n)return[i,-100];let s=Math.floor(a/r),c=o+20;return e===`requesting`?[i,s%c-10]:[i,o+10-s%c]}var xt,St=e((()=>{xt=t(x(),1),C()}));function Ct(e,t,n=!1,r=!1){let i=(0,X.useRef)(e),a=(0,X.useRef)(t),o=(0,X.useRef)(e),s=(0,X.useRef)(0),c=(0,X.useRef)(e);t>a.current&&(i.current=e,a.current=t,s.current=0,c.current=e);let l;n?(l=0,i.current=e):l=t>0?e-i.current:e-o.current;let u=l>3e3&&!n,d=u?Math.min((l-3e3)/2e3,1):0;if(!r&&(d>0||s.current>0)){let t=e-c.current;if(t>=50){let n=Math.floor(t/50),r=s.current;for(let e=0;e<n;e++){let e=d-r;if(Math.abs(e)<.01){r=d;break}r+=e*.1}s.current=r,c.current=e}}else s.current=d,c.current=e;return{isStalled:u,stalledIntensity:r?d:s.current}}var X,wt=e((()=>{X=t(x(),1)})),Tt=e((()=>{ht(),yt(),De(),je(),St(),wt(),Oe()}));function Et({mode:e,reducedMotion:t,hasActiveTools:n,responseLengthRef:r,message:i,messageColor:a,shimmerColor:o,overrideColor:s,loadingStartTimeRef:c,totalPausedMsRef:l,pauseStartTimeRef:u,spinnerSuffix:d,verbose:f,columns:p,agentTokens:m,leaderIsIdle:_=!1,thinkingStatus:x}){let[ee,C]=S(t?null:50),w=Date.now(),T=u.current===null?w-c.current-l.current:u.current-c.current-l.current,E=r.current,{isStalled:te,stalledIntensity:D}=Ct(C,E,n||_,t),ne=t?0:Math.floor(C/120),re=e===`requesting`?50:200,O=(0,Ot.useMemo)(()=>g(i),[i]),k=O+20,ie=Math.floor(C/re),ae=t||te?-100:e===`requesting`?ie%k-10:O+10-ie%k,oe=t?0:e===`tool-use`?(Math.sin(C/1e3*Math.PI)+1)/2:0,A=(0,Ot.useRef)(E);if(t)A.current=E;else{let e=E-A.current;if(e>0){let t;t=e<70?3:e<200?Math.max(8,Math.ceil(e*.15)):50,A.current=Math.min(A.current+t,E)}}let se=A.current,ce=Math.round(se/4),le=Ee(T),ue=g(le),de=ce+m,fe=Te(de),pe=g(`${h.arrowDown} ${fe} tokens`),j=x===`thinking`?`thinking`:typeof x==`number`?`thought for ${Math.max(1,Math.round(x/1e3))}s`:null,me=j?g(j):0,he=O+2,ge=kt,_e=x!==null,ve=f||T>jt,M=p-he-5,N=_e&&M>me;!N&&_e&&x===`thinking`&&M>At&&(j=`thinking`,me=At,N=!0);let ye=N?me+ge:0,be=ve&&M>ye+ue,xe=ye+(be?ue+ge:0),Se=ve&&de>0&&M>xe+pe,Ce=N&&x===`thinking`&&!d&&!be&&!Se&&!0,we=(C-Pt)/1e3,De=C<Pt?0:(Math.sin(we*Math.PI*2/Ft)+1)/2,Oe=ke(Me(Mt,Nt,De)),Ae=[...d?[(0,Z.jsx)(y,{dimColor:!0,children:d},`suffix`)]:[],...be?[(0,Z.jsx)(y,{dimColor:!0,children:le},`elapsedTime`)]:[],...Se?[(0,Z.jsxs)(v,{flexDirection:`row`,children:[(0,Z.jsx)(Dt,{mode:e}),(0,Z.jsxs)(y,{dimColor:!0,children:[fe,` tokens`]})]},`tokens`)]:[],...N&&j?[x===`thinking`&&!t?(0,Z.jsx)(y,{color:Oe,children:Ce?`(${j})`:j},`thinking`):(0,Z.jsx)(y,{dimColor:!0,children:j},`thinking`)]:[]],je=Ae.length>0?Ce?(0,Z.jsx)(b,{children:Ae}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(y,{dimColor:!0,children:`(`}),(0,Z.jsx)(b,{children:Ae}),(0,Z.jsx)(y,{dimColor:!0,children:`)`})]}):null;return(0,Z.jsxs)(v,{ref:ee,flexDirection:`row`,flexWrap:`wrap`,marginTop:1,width:`100%`,children:[(0,Z.jsx)(Fe,{frame:ne,messageColor:a,stalledIntensity:s?0:D,reducedMotion:t,time:C}),(0,Z.jsx)(gt,{message:i,mode:e,messageColor:a,glimmerIndex:ae,flashOpacity:oe,shimmerColor:o,stalledIntensity:s?0:D}),je]})}function Dt({mode:e}){switch(e){case`tool-input`:case`tool-use`:case`responding`:case`thinking`:return(0,Z.jsx)(v,{width:2,children:(0,Z.jsx)(y,{dimColor:!0,children:h.arrowDown})});case`requesting`:return(0,Z.jsx)(v,{width:2,children:(0,Z.jsx)(y,{dimColor:!0,children:h.arrowUp})})}}var Ot,Z,kt,At,jt,Mt,Nt,Pt,Ft,It=e((()=>{m(),Ot=t(x(),1),C(),we(),yt(),je(),wt(),Oe(),Z=w(),kt=g(` · `),At=g(`thinking`),jt=3e4,Mt={r:153,g:153,b:153},Nt={r:185,g:185,b:185},Pt=3e3,Ft=2}));function Lt(e){return(0,$.jsx)(Rt,{...e})}function Rt({mode:e,loadingStartTimeRef:t,totalPausedMsRef:n,pauseStartTimeRef:r,spinnerTip:i,responseLengthRef:a,overrideColor:o,overrideShimmerColor:s,overrideMessage:c,spinnerSuffix:l,verbose:u,hasActiveTools:d=!1,leaderIsIdle:f=!1}){let p=se(),m=p.prefersReducedMotion??!1,h=ie(e=>e.tasks),g=ie(e=>e.expandedView)===`tasks`,{columns:_}=ee(),b=tt(),[x,S]=(0,Q.useState)(null),C=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{let t=null,n=null;if(e===`thinking`)C.current===null&&(C.current=Date.now(),S(`thinking`));else if(C.current!==null){let e=Date.now()-C.current,r=Date.now()-C.current,i=Math.max(0,2e3-r);C.current=null;let a=()=>{S(e),n=setTimeout(S,2e3,null)};i>0?t=setTimeout(a,i):a()}return()=>{t&&clearTimeout(t),n&&clearTimeout(n)}},[e]);let w=b?.find(e=>e.status!==`pending`&&e.status!==`completed`),T=Bt(b),[E]=(0,Q.useState)(()=>he(Ve())),te=`${c??w?.activeForm??w?.subject??E}…`;(0,Q.useEffect)(()=>{let t=`spinner-${e}`;return ze.startCLIActivity(t),()=>{ze.endCLIActivity(t)}},[e]);let D=0;for(let e of Object.values(h))e.status===`running`&&ge(e)&&e.progress?.tokenCount&&(D+=e.progress.tokenCount);let ne=r.current===null?Date.now()-t.current-n.current:r.current-t.current-n.current,re=o??`claude`,O=s??`workmateShimmer`,k=p.spinnerTipsEnabled!==!1,ae=k&&ne>18e5,oe=k&&ne>3e4&&!be().btwUseCount,A=ae&&!T?`Use /clear to start fresh when switching topics and free up context`:oe&&!T?`Use /btw to ask a quick side question without interrupting Work Mate's current work`:i;return(0,$.jsxs)(v,{flexDirection:`column`,width:`100%`,alignItems:`flex-start`,children:[(0,$.jsx)(Et,{mode:e,reducedMotion:m,hasActiveTools:d,responseLengthRef:a,message:te,messageColor:re,shimmerColor:O,overrideColor:o,loadingStartTimeRef:t,totalPausedMsRef:n,pauseStartTimeRef:r,spinnerSuffix:l,verbose:u,columns:_,agentTokens:D,leaderIsIdle:f,thinkingStatus:x}),g&&b&&b.length>0?(0,$.jsx)(v,{width:`100%`,flexDirection:`column`,children:(0,$.jsx)(j,{children:(0,$.jsx)(We,{tasks:b})})}):T||A?(0,$.jsxs)(v,{width:`100%`,flexDirection:`column`,children:[null,(T||A)&&(0,$.jsx)(j,{children:(0,$.jsx)(y,{dimColor:!0,children:T?`Next: ${T.subject}`:`Tip: ${A}`})})]}):null]})}function zt(){let e=se().prefersReducedMotion??!1,[t,n]=S(e?null:120);if(e)return(0,$.jsx)(v,{ref:t,flexWrap:`wrap`,height:1,width:2,children:(0,$.jsx)(y,{color:`text`,children:`●`})});let r=Math.floor(n/120)%Ht.length;return(0,$.jsx)(v,{ref:t,flexWrap:`wrap`,height:1,width:2,children:(0,$.jsx)(y,{color:`text`,children:Ht[r]})})}function Bt(e){if(!e)return;let t=e.filter(e=>e.status===`pending`);if(t.length===0)return;let n=new Set(e.filter(e=>e.status!==`completed`).map(e=>e.id));return t.find(e=>!e.blockedBy.some(e=>n.has(e)))??t[0]}var Q,$,Vt,Ht,Ut=e((()=>{C(),Q=t(x(),1),_e(),we(),Be(),Ue(),me(),Je(),mt(),N(),M(),Tt(),It(),ae(),ve(),O(),ye(),$=w(),Vt=Ne(),Ht=[...Vt,...[...Vt].reverse()]}));export{bt as a,nt as c,ze as d,Be as f,St as i,We as l,Lt as n,mt as o,Ut as r,tt as s,zt as t,Je as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{l as r,o as i}from"./envUtils-QyzA_cFM.js";import{n as a,t as o}from"./defineProperty-C-QyHrDq.js";import{Fr as s,Ft as c,G as l,Gr as u,H as d,Hr as f,I as p,Kr as m,Lr as h,P as g,Pr as _,Vr as v,Xn as y,ai as b,di as x,et as S,fi as C,hn as w,j as T,mt as E,qr as ee,t as D,vn as te,yn as ne,zr as re}from"./src-BX54x08P.js";import{t as O}from"./jsx-runtime-Bb4Xn-E0.js";import{Xt as ie,qt as ae}from"./settings-D4M13toi.js";import{Fh as oe,Gb as se,Hb as k,Ih as ce,Jb as le,Kb as ue,Mh as de,Ub as fe,ab as pe,jh as me,ob as he,qb as ge}from"./loadAgentsDir-
|
|
1
|
+
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{l as r,o as i}from"./envUtils-QyzA_cFM.js";import{n as a,t as o}from"./defineProperty-C-QyHrDq.js";import{Fr as s,Ft as c,G as l,Gr as u,H as d,Hr as f,I as p,Kr as m,Lr as h,P as g,Pr as _,Vr as v,Xn as y,ai as b,di as x,et as S,fi as C,hn as w,j as T,mt as E,qr as ee,t as D,vn as te,yn as ne,zr as re}from"./src-BX54x08P.js";import{t as O}from"./jsx-runtime-Bb4Xn-E0.js";import{Xt as ie,qt as ae}from"./settings-D4M13toi.js";import{Fh as oe,Gb as se,Hb as k,Ih as ce,Jb as le,Kb as ue,Mh as de,Ub as fe,ab as pe,jh as me,ob as he,qb as ge}from"./loadAgentsDir-bmpKLPdG.js";import{c as _e,f as ve,i as ye,u as A}from"./debug-2pVES-2G.js";import{r as j,t as M}from"./execa-CBhG1doD.js";import{o as be,s as N}from"./log-L1kqxa_P.js";import{i as xe,n as Se}from"./execFileNoThrow-DXSEj8ZO.js";import{i as Ce,o as we}from"./bundledMode-D9omqD3L.js";import{a as Te,n as P,o as Ee,t as De}from"./intl-D2kgJmX7.js";import{n as Oe,t as ke}from"./notifications-BwS1XsnZ.js";import{t as Ae}from"./useDoublePress-zA5QwIpO.js";import{i as je,o as Me}from"./terminalSetup-xe_P98fY.js";import{s as Ne,t as Pe}from"./history-CUrqO9rV.js";import{r as Fe,t as Ie}from"./modifiersNative-BYHdmWw1.js";import{tmpdir as Le}from"os";import{basename as Re,extname as ze,isAbsolute as Be,join as F}from"path";import{randomBytes as Ve}from"crypto";function He(){let e=process.platform,t=process.env.WORKMATE_TMPDIR||(e===`win32`?process.env.TEMP||`C:\\Temp`:Le()),n=`claude_cli_latest_screenshot.png`,r={darwin:F(t,n),linux:F(t,n),win32:F(t,n)},i=r[e]||r.linux,a={darwin:{checkImage:`osascript -e 'the clipboard as «class PNGf»'`,saveImage:`osascript -e 'set png_data to (the clipboard as «class PNGf»)' -e 'set fp to open for access POSIX file "${i}" with write permission' -e 'write png_data to fp' -e 'close access fp'`,getPath:`osascript -e 'get POSIX path of (the clipboard as «class furl»)'`,deleteFile:`rm -f "${i}"`},linux:{checkImage:`xclip -selection clipboard -t TARGETS -o 2>/dev/null | grep -E "image/(png|jpeg|jpg|gif|webp|bmp)" || wl-paste -l 2>/dev/null | grep -E "image/(png|jpeg|jpg|gif|webp|bmp)"`,saveImage:`xclip -selection clipboard -t image/png -o > "${i}" 2>/dev/null || wl-paste --type image/png > "${i}" 2>/dev/null || xclip -selection clipboard -t image/bmp -o > "${i}" 2>/dev/null || wl-paste --type image/bmp > "${i}"`,getPath:`xclip -selection clipboard -t text/plain -o 2>/dev/null || wl-paste 2>/dev/null`,deleteFile:`rm -f "${i}"`},win32:{checkImage:`powershell -NoProfile -Command "(Get-Clipboard -Format Image) -ne $null"`,saveImage:`powershell -NoProfile -Command "$img = Get-Clipboard -Format Image; if ($img) { $img.Save('${i.replace(/\\/g,`\\\\`)}', [System.Drawing.Imaging.ImageFormat]::Png) }"`,getPath:`powershell -NoProfile -Command "Get-Clipboard"`,deleteFile:`del /f "${i}"`}};return{commands:a[e]||a.linux,screenshotPath:i}}async function Ue(){return process.platform===`darwin`&&(await Se(`osascript`,[`-e`,`the clipboard as «class PNGf»`])).code===0}async function We(){let{commands:e,screenshotPath:t}=He();try{if((await M(e.checkImage,{shell:!0,reject:!1})).exitCode!==0||(await M(e.saveImage,{shell:!0,reject:!1})).exitCode!==0)return null;let n=A().readFileBytesSync(t);n.length>=2&&n[0]===66&&n[1]===77&&(n=await(await ue())(n).png().toBuffer());let r=await se(n,n.length,`png`),i=r.buffer.toString(`base64`),a=k(i);return M(e.deleteFile,{shell:!0,reject:!1}),{base64:i,mediaType:a,dimensions:r.dimensions}}catch{return null}}async function Ge(){let{commands:e}=He();try{let t=await M(e.getPath,{shell:!0,reject:!1});return t.exitCode!==0||!t.stdout?null:t.stdout.trim()}catch(e){return N(e),null}}function Ke(e){return e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`)?e.slice(1,-1):e}function qe(e){if(process.platform===`win32`)return e;let t=`__DOUBLE_BACKSLASH_${Ve(8).toString(`hex`)}__`;return e.replace(/\\\\/g,t).replace(/\\(.)/g,`$1`).replace(new RegExp(t,`g`),`\\`)}function I(e){let t=qe(Ke(e.trim()));return L.test(t)}function Je(e){let t=qe(Ke(e.trim()));return L.test(t)?t:null}async function Ye(e){let t=Je(e);if(!t)return null;let n=t,r;try{if(Be(n))r=A().readFileBytesSync(n);else{let e=await Ge();e&&n===Re(e)&&(r=A().readFileBytesSync(e))}}catch(e){return N(e),null}if(!r)return null;if(r.length===0)return _e(`Image file is empty: ${n}`,{level:`warn`}),null;r.length>=2&&r[0]===66&&r[1]===77&&(r=await(await ue())(r).png().toBuffer());let i=ze(n).slice(1).toLowerCase()||`png`,a=await se(r,r.length,i),o=a.buffer.toString(`base64`);return{path:n,base64:o,mediaType:k(o),dimensions:a.dimensions}}var L,Xe=t((()=>{j(),le(),ge(),ye(),xe(),ve(),fe(),be(),L=/\.(png|jpe?g|gif|webp)$/i}));function Ze(e,t){let{addNotification:n}=Oe(),r=(0,R.useRef)(e),i=(0,R.useRef)(0),a=(0,R.useRef)(null);(0,R.useEffect)(()=>{let o=r.current;if(r.current=e,!(!t||!e||o))return a.current&&clearTimeout(a.current),a.current=setTimeout(async(e,t,n)=>{e.current=null;let r=Date.now();r-t.current<et||await Ue()&&(t.current=r,n({key:Qe,text:`Image in clipboard · ${pe(`chat:imagePaste`,`Chat`,`ctrl+v`)} to paste`,priority:`immediate`,timeoutMs:8e3}))},$e,a,i,n),()=>{a.current&&(clearTimeout(a.current),a.current=null)}},[e,t,n])}var R,Qe,$e,et,tt=t((()=>{R=n(b(),1),ke(),he(),Xe(),Qe=`clipboard-image-hint`,$e=1e3,et=3e4}));function nt(e,t){switch(t){case`bash`:return`!${e}`;default:return e}}function rt(e){return e.startsWith(`!`)?`bash`:`prompt`}function it(e){return rt(e)===`prompt`?e:e.slice(1)}function at(e){return e===`!`}var ot=t((()=>{}));function z(e,t=`append`){e.length>0&&(H&&B.length>0?t===`prepend`?B[0]=e+B[0]:B[0]+=e:(B.unshift(e),B.length>pt&&B.pop()),H=!0,W=!1)}function st(){return B[0]??``}function ct(){H=!1}function lt(e,t){mt=e,U=t,W=!0,V=0}function ut(){return!W||B.length<=1?null:(V=(V+1)%B.length,{text:B[V]??``,start:mt,length:U})}function dt(e){U=e}function ft(){W=!1}var pt,B,V,H,mt,U,W,ht,G,K,gt,q,J,Y,_t,vt=t((()=>{D(),Ee(),a(),pt=10,B=[],V=0,H=!1,mt=0,U=0,W=!1,ht=/^[\p{L}\p{N}\p{M}_]$/u,G=/\s/,K=e=>ht.test(e),gt=e=>G.test(e),q=e=>e.length>0&&!gt(e)&&!K(e),J=class e{constructor(e,t=0,n=0){o(this,`measuredText`,void 0),o(this,`selection`,void 0),o(this,`offset`,void 0),this.measuredText=e,this.selection=n,this.offset=Math.max(0,Math.min(this.text.length,t))}static fromText(t,n,r=0,i=0){return new e(new _t(t,n-1),r,i)}getViewportStartLine(e){if(e===void 0||e<=0)return 0;let{line:t}=this.getPosition(),n=this.measuredText.getWrappedText();if(n.length<=e)return 0;let r=Math.floor(e/2),i=Math.max(0,t-r),a=Math.min(n.length,i+e);return a-i<e&&(i=Math.max(0,a-e)),i}getViewportCharOffset(e){let t=this.getViewportStartLine(e);return t===0?0:this.measuredText.getWrappedLines()[t]?.startOffset??0}getViewportCharEnd(e){let t=this.getViewportStartLine(e),n=this.measuredText.getWrappedLines();if(e===void 0||e<=0)return this.text.length;let r=Math.min(n.length,t+e);return r>=n.length?this.text.length:n[r]?.startOffset??this.text.length}render(e,t,n,r,i){let{line:a,column:o}=this.getPosition(),s=this.measuredText.getWrappedText(),c=this.getViewportStartLine(i),l=i!==void 0&&i>0?Math.min(s.length,c+i):s.length;return s.slice(c,l).map((i,l)=>{let d=l+c,f=i;if(t){let e=Array.from(P().segment(i));if(d===s.length-1){let n=Math.min(6,e.length),r=e.length-n,a=e.length>n?e[r].index:0;f=t.repeat(r)+i.slice(a)}else f=t.repeat(e.length)}if(a!==d)return f.trimEnd();let p=``,m=e,h=``,g=0,_=!1;for(let{segment:e}of P().segment(f)){if(_){h+=e;continue}let t=g+u(e);t>o?(m=e,_=!0):(g=t,p+=e)}let v,y=``;if(r&&d===s.length-1&&this.isAtEnd()&&r.text.length>0){let t=De(r.text)||r.text[0];v=e?n(t):t;let i=r.text.slice(t.length);i.length>0&&(y=r.dim(i))}else v=e?n(m):m;return p+v+y+h.trimEnd()}).join(`
|
|
2
2
|
`)}left(){if(this.offset===0)return this;let t=this.imageRefEndingAt(this.offset);if(t)return new e(this.measuredText,t.start);let n=this.measuredText.prevOffset(this.offset);return new e(this.measuredText,n)}right(){if(this.offset>=this.text.length)return this;let t=this.imageRefStartingAt(this.offset);if(t)return new e(this.measuredText,t.end);let n=this.measuredText.nextOffset(this.offset);return new e(this.measuredText,Math.min(n,this.text.length))}imageRefEndingAt(e){let t=this.text.slice(0,e).match(/\[Image #\d+\]$/);return t?{start:e-t[0].length,end:e}:null}imageRefStartingAt(e){let t=this.text.slice(e).match(/^\[Image #\d+\]/);return t?{start:e,end:e+t[0].length}:null}snapOutOfImageRef(e,t){let n=/\[Image #\d+\]/g,r;for(;(r=n.exec(this.text))!==null;){let n=r.index,i=n+r[0].length;if(e>n&&e<i)return t===`start`?n:i}return e}up(){let{line:t,column:n}=this.getPosition();if(t===0)return this;let r=this.measuredText.getWrappedText()[t-1];if(r===void 0)return this;let i=u(r);if(n>i){let n=this.getOffset({line:t-1,column:i});return new e(this.measuredText,n,0)}let a=this.getOffset({line:t-1,column:n});return new e(this.measuredText,a,0)}down(){let{line:t,column:n}=this.getPosition();if(t>=this.measuredText.lineCount-1)return this;let r=this.measuredText.getWrappedText()[t+1];if(r===void 0)return this;let i=u(r);if(n>i){let n=this.getOffset({line:t+1,column:i});return new e(this.measuredText,n,0)}let a=this.getOffset({line:t+1,column:n});return new e(this.measuredText,a,0)}startOfCurrentLine(){let{line:t}=this.getPosition();return new e(this.measuredText,this.getOffset({line:t,column:0}),0)}startOfLine(){let{line:t,column:n}=this.getPosition();return n===0&&t>0?new e(this.measuredText,this.getOffset({line:t-1,column:0}),0):this.startOfCurrentLine()}firstNonBlankInLine(){let{line:t}=this.getPosition(),n=(this.measuredText.getWrappedText()[t]||``).match(/^\s*\S/),r=n?.index?n.index+n[0].length-1:0,i=this.getOffset({line:t,column:r});return new e(this.measuredText,i,0)}endOfLine(){let{line:t}=this.getPosition(),n=this.measuredText.getLineLength(t),r=this.getOffset({line:t,column:n});return new e(this.measuredText,r,0)}findLogicalLineStart(e=this.offset){let t=this.text.lastIndexOf(`
|
|
3
3
|
`,e-1);return t===-1?0:t+1}findLogicalLineEnd(e=this.offset){let t=this.text.indexOf(`
|
|
4
4
|
`,e);return t===-1?this.text.length:t}getLogicalLineBounds(){return{start:this.findLogicalLineStart(),end:this.findLogicalLineEnd()}}createCursorWithColumn(t,n,r){let i=n-t,a=t+Math.min(r,i),o=this.measuredText.snapToGraphemeBoundary(a);return new e(this.measuredText,o,0)}endOfLogicalLine(){return new e(this.measuredText,this.findLogicalLineEnd(),0)}startOfLogicalLine(){return new e(this.measuredText,this.findLogicalLineStart(),0)}firstNonBlankInLogicalLine(){let{start:t,end:n}=this.getLogicalLineBounds(),r=t+(this.text.slice(t,n).match(/\S/)?.index??0);return new e(this.measuredText,r,0)}upLogicalLine(){let{start:t}=this.getLogicalLineBounds();if(t===0)return new e(this.measuredText,0,0);let n=this.offset-t,r=t-1,i=this.findLogicalLineStart(r);return this.createCursorWithColumn(i,r,n)}downLogicalLine(){let{start:t,end:n}=this.getLogicalLineBounds();if(n>=this.text.length)return new e(this.measuredText,this.text.length,0);let r=this.offset-t,i=n+1,a=this.findLogicalLineEnd(i);return this.createCursorWithColumn(i,a,r)}nextWord(){if(this.isAtEnd())return this;let t=this.measuredText.getWordBoundaries();for(let n of t)if(n.isWordLike&&n.start>this.offset)return new e(this.measuredText,n.start);return new e(this.measuredText,this.text.length)}endOfWord(){if(this.isAtEnd())return this;let t=this.measuredText.getWordBoundaries();for(let n of t)if(n.isWordLike){if(this.offset>=n.start&&this.offset<n.end-1)return new e(this.measuredText,n.end-1);if(this.offset===n.end-1){for(let n of t)if(n.isWordLike&&n.start>this.offset)return new e(this.measuredText,n.end-1);return this}}for(let n of t)if(n.isWordLike&&n.start>this.offset)return new e(this.measuredText,n.end-1);return this}prevWord(){if(this.isAtStart())return this;let t=this.measuredText.getWordBoundaries(),n=null;for(let r of t)if(r.isWordLike&&r.start<this.offset){if(this.offset>r.start&&this.offset<=r.end)return new e(this.measuredText,r.start);n=r.start}return n===null?new e(this.measuredText,0):new e(this.measuredText,n)}nextVimWord(){if(this.isAtEnd())return this;let t=this.offset,n=e=>this.measuredText.nextOffset(e),r=this.graphemeAt(t);if(!r)return this;if(K(r))for(;t<this.text.length&&K(this.graphemeAt(t));)t=n(t);else if(q(r))for(;t<this.text.length&&q(this.graphemeAt(t));)t=n(t);for(;t<this.text.length&&G.test(this.graphemeAt(t));)t=n(t);return new e(this.measuredText,t)}endOfVimWord(){if(this.isAtEnd())return this;let t=this.text,n=this.offset,r=e=>this.measuredText.nextOffset(e);if(this.graphemeAt(n)===``)return this;for(n=r(n);n<t.length&&G.test(this.graphemeAt(n));)n=r(n);if(n>=t.length)return new e(this.measuredText,t.length);let i=this.graphemeAt(n);if(K(i))for(;n<t.length;){let e=r(n);if(e>=t.length||!K(this.graphemeAt(e)))break;n=e}else if(q(i))for(;n<t.length;){let e=r(n);if(e>=t.length||!q(this.graphemeAt(e)))break;n=e}return new e(this.measuredText,n)}prevVimWord(){if(this.isAtStart())return this;let t=this.offset,n=e=>this.measuredText.prevOffset(e);for(t=n(t);t>0&&G.test(this.graphemeAt(t));)t=n(t);if(t===0&&G.test(this.graphemeAt(0)))return new e(this.measuredText,0);let r=this.graphemeAt(t);if(K(r))for(;t>0;){let e=n(t);if(!K(this.graphemeAt(e)))break;t=e}else if(q(r))for(;t>0;){let e=n(t);if(!q(this.graphemeAt(e)))break;t=e}return new e(this.measuredText,t)}nextWORD(){let e=this;for(;!e.isOverWhitespace()&&!e.isAtEnd();)e=e.right();for(;e.isOverWhitespace()&&!e.isAtEnd();)e=e.right();return e}endOfWORD(){if(this.isAtEnd())return this;let e=this;if(!e.isOverWhitespace()&&(e.right().isOverWhitespace()||e.right().isAtEnd()))return e=e.right(),e.endOfWORD();for(e.isOverWhitespace()&&(e=e.nextWORD());!e.right().isOverWhitespace()&&!e.isAtEnd();)e=e.right();return e}prevWORD(){let e=this;for(e.left().isOverWhitespace()&&(e=e.left());e.isOverWhitespace()&&!e.isAtStart();)e=e.left();if(!e.isOverWhitespace())for(;!e.left().isOverWhitespace()&&!e.isAtStart();)e=e.left();return e}modifyText(t,n=``){let r=this.offset,i=t.offset,a=this.text.slice(0,r)+n+this.text.slice(i);return e.fromText(a,this.columns,r+n.normalize(`NFC`).length)}insert(e){return this.modifyText(this,e)}del(){return this.isAtEnd()?this:this.modifyText(this.right())}backspace(){return this.isAtStart()?this:this.left().modifyText(this)}deleteToLineStart(){if(this.offset>0&&this.text[this.offset-1]===`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,H as n,I as r,P as i,T as a,U as o,V as s,Wt as c,Xt as l,ot as u,t as d}from"./src-BX54x08P.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{m as p,y as m}from"./settings-D4M13toi.js";import{Bh as h,Dh as g,Eh as _,Hh as v,Sh as y,Th as b,gi as x,ib as S,mi as C,nb as w,rb as T,sb as E,tb as D,xh as O,zh as k}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,H as n,I as r,P as i,T as a,U as o,V as s,Wt as c,Xt as l,ot as u,t as d}from"./src-BX54x08P.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{m as p,y as m}from"./settings-D4M13toi.js";import{Bh as h,Dh as g,Eh as _,Hh as v,Sh as y,Th as b,gi as x,ib as S,mi as C,nb as w,rb as T,sb as E,tb as D,xh as O,zh as k}from"./loadAgentsDir-bmpKLPdG.js";import{n as A,t as j}from"./useExitOnCtrlCDWithKeybindings-BT0nexZw.js";import{t as M}from"./select-CaxQ-BVq.js";import{t as N}from"./CustomSelect-t4wXuXWH.js";function P({onThemeSelect:e,showIntroText:d=!1,helpText:f=``,showHelpTextBelow:p=!1,hideEscToCancel:g=!1,skipExitHandling:y=!1,onCancel:x}){let[S]=n(),w=o(),{columns:E}=u(),D=b(),k=D===null?_(S):null,{setPreviewTheme:j,savePreview:N,cancelPreview:P}=s(),I=h(e=>e.settings.syntaxHighlightingDisabled)??!1,L=v();l(`ThemePicker`);let R=T(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);c(`theme:toggleSyntaxHighlighting`,()=>{if(D===null){let e=!I;m(`userSettings`,{syntaxHighlightingDisabled:e}),L(t=>({...t,settings:{...t.settings,syntaxHighlightingDisabled:e}}))}},{context:`ThemePicker`});let z=A(y?()=>{}:void 0),B=[{label:`Dark mode`,value:`dark`},{label:`Light mode`,value:`light`},{label:`Dark mode (colorblind-friendly)`,value:`dark-daltonized`},{label:`Light mode (colorblind-friendly)`,value:`light-daltonized`},{label:`Dark mode (ANSI colors only)`,value:`dark-ansi`},{label:`Light mode (ANSI colors only)`,value:`light-ansi`}],V=(0,F.jsxs)(r,{flexDirection:`column`,gap:1,children:[(0,F.jsxs)(r,{flexDirection:`column`,gap:1,children:[d?(0,F.jsx)(i,{children:`Let's get started.`}):(0,F.jsx)(i,{bold:!0,color:`permission`,children:`Theme`}),(0,F.jsxs)(r,{flexDirection:`column`,children:[(0,F.jsx)(i,{bold:!0,children:`Choose the text style that looks best with your terminal`}),f&&!p&&(0,F.jsx)(i,{dimColor:!0,children:f})]}),(0,F.jsx)(M,{options:B,onFocus:e=>{j(e)},onChange:t=>{N(),e(t)},onCancel:y?()=>{P(),x?.()}:async()=>{P(),await C(0)},visibleOptionCount:B.length,defaultValue:w,defaultFocusValue:w})]}),(0,F.jsxs)(r,{flexDirection:`column`,width:`100%`,children:[(0,F.jsx)(r,{flexDirection:`column`,borderTop:!0,borderBottom:!0,borderLeft:!1,borderRight:!1,borderStyle:`dashed`,borderColor:`subtle`,children:(0,F.jsx)(O,{patch:{oldStart:1,newStart:1,oldLines:3,newLines:3,lines:[` function greet() {`,`- console.log("Hello, World!");`,`+ console.log("Hello, Work Mate!");`,` }`]},dim:!1,filePath:`demo.js`,firstLine:null,width:E})}),(0,F.jsxs)(i,{dimColor:!0,children:[` `,D===`env`?`Syntax highlighting disabled (via WORKMATE_SYNTAX_HIGHLIGHT=${process.env.WORKMATE_SYNTAX_HIGHLIGHT})`:I?`Syntax highlighting disabled (${R} to enable)`:k?`Syntax theme: ${k.theme}${k.source?` (from ${k.source})`:``} (${R} to disable)`:`Syntax highlighting enabled (${R} to disable)`]})]})]});return d?V:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(r,{flexDirection:`column`,children:V}),(0,F.jsxs)(r,{marginTop:1,children:[p&&f&&(0,F.jsx)(r,{marginLeft:3,children:(0,F.jsx)(i,{dimColor:!0,children:f})}),!g&&(0,F.jsx)(r,{children:(0,F.jsx)(i,{dimColor:!0,italic:!0,children:z.pending?(0,F.jsxs)(F.Fragment,{children:[`Press `,z.keyName,` again to exit`]}):(0,F.jsxs)(a,{children:[(0,F.jsx)(t,{shortcut:`Enter`,action:`select`}),(0,F.jsx)(t,{shortcut:`Esc`,action:`cancel`})]})})})]})]})}var F,I=e((()=>{j(),E(),d(),S(),D(),w(),k(),x(),p(),N(),g(),y(),F=f()}));export{I as n,P as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,Wt as r,ai as i,t as a}from"./src-BX54x08P.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{m as s,s as c}from"./settings-D4M13toi.js";import{In as l,Pt as u}from"./state-CXY-q5gr.js";import{Ig as d,Lg as f,cf as p,gi as m,hi as h,tb as g,uf as _}from"./loadAgentsDir-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,Wt as r,ai as i,t as a}from"./src-BX54x08P.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{m as s,s as c}from"./settings-D4M13toi.js";import{In as l,Pt as u}from"./state-CXY-q5gr.js";import{Ig as d,Lg as f,cf as p,gi as m,hi as h,tb as g,uf as _}from"./loadAgentsDir-bmpKLPdG.js";import{n as v,t as y}from"./cwd-DrEEb4f5.js";import{f as b,u as x}from"./debug-2pVES-2G.js";import{d as S,m as C,t as w}from"./config-Bio2EjUK.js";import{n as T}from"./analytics-COpjZpvd.js";import{in as E}from"./prompt-BnDapYGL.js";import{n as D,t as O}from"./useExitOnCtrlCDWithKeybindings-BT0nexZw.js";import{t as k}from"./select-CaxQ-BVq.js";import{t as A}from"./CustomSelect-t4wXuXWH.js";import{n as j,t as M}from"./PermissionDialog-DjCRuzSm.js";import{n as N,t as P}from"./managedEnvConstants-BPY8yF1A.js";import{homedir as F}from"os";var I=e(i(),1),L=o();a(),u(),v(),b(),T(),S(),g(),_(),m(),O(),A(),j(),s(),E(),N(),f();function R(e){if(e===null||e.disableAllHooks)return!1;if(e.statusLine||e.fileSuggestion)return!0;if(!e.hooks)return!1;for(let t of Object.values(e.hooks))if(t.length>0)return!0;return!1}function z(){let e=[];return R(c(`projectSettings`))&&e.push(`.workmate/settings.json`),R(c(`localSettings`))&&e.push(`.workmate/settings.local.json`),e}function B(e){return e.some(e=>e.ruleBehavior===`allow`&&(e.ruleValue.toolName===`Bash`||e.ruleValue.toolName.startsWith(`Bash(`)))}function V(){let e=[];return B(d(`projectSettings`))&&e.push(`.workmate/settings.json`),B(d(`localSettings`))&&e.push(`.workmate/settings.local.json`),e}function H(e){return e?.env?Object.keys(e.env).some(e=>!P.has(e.toUpperCase())):!1}function U(){let e=[];return H(c(`projectSettings`))&&e.push(`.workmate/settings.json`),H(c(`localSettings`))&&e.push(`.workmate/settings.local.json`),e}E();function W({onDone:e,commands:i}){let{servers:a}=p(`project`),o=Object.keys(a).length>0,s=z().length>0,c=V(),u=U().length>0,d=i?.some(e=>e.type===`prompt`&&e.loadedFrom===`commands_DEPRECATED`&&(e.source===`projectSettings`||e.source===`localSettings`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,f=i?.some(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`)&&(e.source===`projectSettings`||e.source===`localSettings`||e.source===`plugin`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,m=c.length>0||d||f,g=w(),[_,v]=I.useState(null);I.useEffect(()=>{if(_!==null){let e=_,t=setTimeout(()=>h(e));return()=>clearTimeout(t)}},[_]),I.useEffect(()=>{F(),y()},[o,s,m,u]);function b(t){if(t===`exit`){v(1);return}F()===y()?l(!0):C(e=>({...e,hasTrustDialogAccepted:!0})),e()}let S=D(()=>v(1));return r(`confirm:no`,()=>{v(0)},{context:`Confirmation`}),_===null?g?(setTimeout(e),null):(0,L.jsx)(M,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,L.jsxs)(t,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,L.jsx)(n,{bold:!0,children:x().cwd()}),(0,L.jsx)(n,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,L.jsx)(n,{children:`Once trusted, Work Mate can read, edit, and run commands in this folder.`}),(0,L.jsx)(k,{options:[{label:`Yes, I trust this folder`,value:`enable_all`},{label:`No, exit`,value:`exit`}],onChange:e=>b(e),onCancel:()=>b(`exit`)}),(0,L.jsx)(n,{dimColor:!0,children:S.pending?(0,L.jsxs)(L.Fragment,{children:[`Press `,S.keyName,` again to exit`]}):(0,L.jsx)(L.Fragment,{children:`Enter to confirm · Esc to cancel`})})]})}):null}export{W as TrustDialog};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{H as r,I as i,P as a,j as o,t as s}from"./src-BX54x08P.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{_ as l,v as u}from"./config-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{H as r,I as i,P as a,j as o,t as s}from"./src-BX54x08P.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{_ as l,v as u}from"./config-Bio2EjUK.js";function d(e,t,n,r){return r=typeof r==`function`?r:void 0,e==null?e:l(e,t,n,r)}var f=e((()=>{u()}));function p(e,t={}){let{showValues:n=!0,hideFunctions:r=!1,themeName:i=`dark`,treeCharColors:a={}}=t,s=[],c=new WeakSet;function l(e,t){return t?o(t,i)(e):e}function u(e,t,i,o=0){if(typeof e==`string`){s.push(t+l(e,a.value));return}if(typeof e!=`object`||!e){if(n){let n=String(e);s.push(t+l(n,a.value))}return}if(c.has(e)){s.push(t+l(`[Circular]`,a.value));return}c.add(e);let d=Object.keys(e).filter(t=>{let n=e[t];return!(r&&typeof n==`function`)});d.forEach((r,i)=>{let f=e[r],p=i===d.length-1,h=o===0&&i===0?``:t,g=l(p?m.lastBranch:m.branch,a.treeChar),_=r.trim()===``?``:l(r,a.key),v=h+g+(_?` ${_}`:``),y=r.trim()!==``;if(f&&typeof f==`object`&&c.has(f)){let e=l(`[Circular]`,a.value);s.push(v+(y?`: `:v?` `:``)+e)}else if(f&&typeof f==`object`&&!Array.isArray(f))s.push(v),u(f,`${h+l(p?m.empty:m.line,a.treeChar)} `,p,o+1);else if(Array.isArray(f))s.push(v+(y?`: `:v?` `:``)+`[Array(`+f.length+`)]`);else if(n){let e=l(typeof f==`function`?`[Function]`:String(f),a.value);v+=(y?`: `:v?` `:``)+e,s.push(v)}else s.push(v)})}let d=Object.keys(e);if(d.length===0)return l(`(empty)`,a.value);if(d.length===1&&d[0]!==void 0&&d[0].trim()===``&&typeof e[d[0]]==`string`){let t=d[0];return`${l(m.lastBranch,a.treeChar)} ${l(e[t],a.value)}`}return u(e,``,!0),s.join(`
|
|
2
2
|
`)}var m,h=e((()=>{t(),s(),m={branch:n.lineUpDownRight,lastBranch:n.lineUpRight,line:n.lineVertical,empty:` `}}));function g(e){let t={};return e.forEach(e=>{if(!e.path){t[``]=e.message;return}let n=e.path.split(`.`),r=e.path;if(e.invalidValue!==null&&e.invalidValue!==void 0&&n.length>0){let t=[];for(let r=0;r<n.length;r++){let i=n[r];if(i)if(!isNaN(parseInt(i,10))&&r===n.length-1){let n;n=typeof e.invalidValue==`string`?`"${e.invalidValue}"`:e.invalidValue===null?`null`:e.invalidValue===void 0?`undefined`:String(e.invalidValue),t.push(n)}else t.push(i)}r=t.join(`.`)}d(t,r,e.message,Object)}),t}function _({errors:e}){let[t]=r();if(e.length===0)return null;let n=e.reduce((e,t)=>{let n=t.file||`(file not specified)`;return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,v.jsx)(i,{flexDirection:`column`,children:Object.keys(n).sort().map(e=>{let r=n[e]||[];r.sort((e,t)=>!e.path&&t.path?-1:e.path&&!t.path?1:(e.path||``).localeCompare(t.path||``));let o=g(r),s=new Map;r.forEach(e=>{if(e.suggestion||e.docLink){let t=`${e.suggestion||``}|${e.docLink||``}`;s.has(t)||s.set(t,{suggestion:e.suggestion,docLink:e.docLink})}});let c=p(o,{showValues:!0,themeName:t,treeCharColors:{treeChar:`inactive`,key:`text`,value:`inactive`}});return(0,v.jsxs)(i,{flexDirection:`column`,children:[(0,v.jsx)(a,{children:e}),(0,v.jsx)(i,{marginLeft:1,children:(0,v.jsx)(a,{dimColor:!0,children:c})}),s.size>0&&(0,v.jsx)(i,{flexDirection:`column`,marginTop:1,children:Array.from(s.values()).map((e,t)=>(0,v.jsxs)(i,{flexDirection:`column`,marginBottom:1,children:[e.suggestion&&(0,v.jsx)(a,{dimColor:!0,wrap:`wrap`,children:e.suggestion}),e.docLink&&(0,v.jsxs)(a,{dimColor:!0,wrap:`wrap`,children:[`Learn more: `,e.docLink]})]},`suggestion-pair-${t}`))})]},e)})})}var v,y=e((()=>{f(),s(),h(),v=c()}));export{y as n,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Or as t,kr as n}from"./state-CXY-q5gr.js";import{bC as r,yC as i}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Or as t,kr as n}from"./state-CXY-q5gr.js";import{bC as r,yC as i}from"./loadAgentsDir-bmpKLPdG.js";function a(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}var o=e((()=>{t()})),s,c=e((()=>{r(),o(),s=a(i)}));export{c as n,s 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{I as i,P as a,ai as o,di as s,fi as c,t as l}from"./src-BX54x08P.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{Pt as d,h as f,qt as p}from"./state-CXY-q5gr.js";import{F as m,Mg as h,N as g,Ng as _,P as v,Uy as y,Wy as b,aC as x,kg as S,sC as C}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{I as i,P as a,ai as o,di as s,fi as c,t as l}from"./src-BX54x08P.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{Pt as d,h as f,qt as p}from"./state-CXY-q5gr.js";import{F as m,Mg as h,N as g,Ng as _,P as v,Uy as y,Wy as b,aC as x,kg as S,sC as C}from"./loadAgentsDir-bmpKLPdG.js";import{n as w,t as T}from"./AddWorkspaceDirectory-Bmgh8VS3.js";function E({message:e,args:t,onDone:n}){return(0,O.useEffect)(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,k.jsxs)(i,{flexDirection:`column`,children:[(0,k.jsxs)(a,{dimColor:!0,children:[r.pointer,` /add-dir `,t]}),(0,k.jsx)(y,{children:(0,k.jsx)(a,{children:e})})]})}async function D(e,t,n){let r=(n??``).trim(),i=t.getAppState(),a=async(n,r=!1)=>{let i={type:`addDirectories`,directories:[n],destination:r?`localSettings`:`session`},a=S(t.getAppState().toolPermissionContext,i);t.setAppState(e=>({...e,toolPermissionContext:a}));let o=f();o.includes(n)||p([...o,n]),x.refreshConfig();let c;if(r)try{_(i),c=`Added ${s.bold(n)} as a working directory and saved to local settings`}catch(e){c=`Added ${s.bold(n)} as a working directory. Failed to save to local settings: ${e instanceof Error?e.message:`Unknown error`}`}else c=`Added ${s.bold(n)} as a working directory for this session`;e(`${c} ${s.dim(`· /permissions to manage`)}`)};if(!r)return(0,k.jsx)(T,{permissionContext:i.toolPermissionContext,onAddDirectory:a,onCancel:()=>{e(`Did not add a working directory.`)}});let o=await m(r,i.toolPermissionContext);if(o.resultType!==`success`){let t=g(o);return(0,k.jsx)(E,{message:t,args:n??``,onDone:()=>e(t)})}return(0,k.jsx)(T,{directoryPath:o.absolutePath,permissionContext:i.toolPermissionContext,onAddDirectory:a,onCancel:()=>{e(`Did not add ${s.bold(o.absolutePath)} as a working directory.`)}})}var O,k;e((()=>{c(),n(),O=t(o(),1),d(),b(),w(),l(),h(),C(),v(),k=u()}))();export{D as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{mn as t,pn as n}from"./settings-D4M13toi.js";import{Ap as r,kp as i}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{mn as t,pn as n}from"./settings-D4M13toi.js";import{Ap as r,kp as i}from"./loadAgentsDir-bmpKLPdG.js";function a(e,t){let n=new Map;for(let e of t)n.set(e.agentType,e);let r=new Set,i=[];for(let t of e){let e=`${t.agentType}:${t.source}`;if(r.has(e))continue;r.add(e);let a=n.get(t.agentType),o=a&&a.source!==t.source?a.source:void 0;i.push({...t,overriddenBy:o})}return i}function o(e){let t=e.model||i();if(t)return t===`inherit`?`inherit`:t}function s(e){return n(e).toLowerCase()}function c(e,t){return e.agentType.localeCompare(t.agentType,void 0,{sensitivity:`base`})}var l,u=e((()=>{r(),t(),l=[{label:`User agents`,source:`userSettings`},{label:`Project agents`,source:`projectSettings`},{label:`Local agents`,source:`localSettings`},{label:`Managed agents`,source:`policySettings`},{label:`Plugin agents`,source:`plugin`},{label:`CLI arg agents`,source:`flagSettings`},{label:`Built-in agents`,source:`built-in`}]}));export{o as a,u as i,c as n,a as o,s as r,l as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e,o as t,r as n}from"./loadAgentsDir-
|
|
1
|
+
import{i as e,o as t,r as n}from"./loadAgentsDir-bmpKLPdG.js";import{n as r,t as i}from"./cwd-DrEEb4f5.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./agentDisplay-JKfYFD1m.js";o(),t(),r();function d(e){let t=a(e),n=[e.agentType];return t&&n.push(t),e.memory&&n.push(`${e.memory} memory`),n.join(` · `)}async function f(){let{allAgents:t}=await e(i()),r=c(t,n(t)),a=[],o=0;for(let{label:e,source:t}of u){let n=r.filter(e=>e.source===t).sort(s);if(n.length!==0){a.push(`${e}:`);for(let e of n)if(e.overriddenBy){let t=l(e.overriddenBy);a.push(` (shadowed by ${t}) ${d(e)}`)}else a.push(` ${d(e)}`),o++;a.push(``)}}a.length===0?console.log(`No agents found.`):(console.log(`${o} active agents\n`),console.log(a.join(`
|
|
2
2
|
`).trimEnd()))}export{f as agentsHandler};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{i as n,o as r}from"./envUtils-QyzA_cFM.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{C as o,D as s,I as c,P as l,T as u,Wt as d,ai as f,di as p,fi as m,t as h,y as g}from"./src-BX54x08P.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{$n as v,K as y,Qn as b,X as x,fn as ee,mn as S,nt as te,rn as C,rt as ne,tn as re}from"./settings-D4M13toi.js";import{hr as ie,mr as ae}from"./state-CXY-q5gr.js";import{$d as oe,$x as se,Ap as ce,Au as le,Bh as ue,Bv as de,By as fe,Cf as pe,Cp as me,Dc as he,Dl as ge,Dp as _e,Ec as ve,Ef as ye,El as be,Em as xe,F_ as Se,GS as Ce,Hh as we,I_ as Te,Ji as Ee,Mm as De,Mu as Oe,Nm as ke,Nu as Ae,Op as je,Pm as Me,Q as Ne,Rl as Pe,Rm as Fe,Sp as Ie,Tf as Le,Tl as Re,Tm as ze,X as Be,_m as Ve,_p as He,bp as Ue,c as We,dd as Ge,ef as Ke,et as qe,fw as Je,gm as Ye,gp as Xe,hd as w,jm as Ze,ju as Qe,l as $e,ld as et,md as T,mw as tt,nt,o as rt,pw as it,r as at,s as ot,t as st,tb as E,ty as ct,ua as lt,vp as ut,wf as dt,wl as ft,xp as pt,yp as mt,zh as ht,zl as gt,zm as _t,zv as vt,zy as yt}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{i as n,o as r}from"./envUtils-QyzA_cFM.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{C as o,D as s,I as c,P as l,T as u,Wt as d,ai as f,di as p,fi as m,t as h,y as g}from"./src-BX54x08P.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{$n as v,K as y,Qn as b,X as x,fn as ee,mn as S,nt as te,rn as C,rt as ne,tn as re}from"./settings-D4M13toi.js";import{hr as ie,mr as ae}from"./state-CXY-q5gr.js";import{$d as oe,$x as se,Ap as ce,Au as le,Bh as ue,Bv as de,By as fe,Cf as pe,Cp as me,Dc as he,Dl as ge,Dp as _e,Ec as ve,Ef as ye,El as be,Em as xe,F_ as Se,GS as Ce,Hh as we,I_ as Te,Ji as Ee,Mm as De,Mu as Oe,Nm as ke,Nu as Ae,Op as je,Pm as Me,Q as Ne,Rl as Pe,Rm as Fe,Sp as Ie,Tf as Le,Tl as Re,Tm as ze,X as Be,_m as Ve,_p as He,bp as Ue,c as We,dd as Ge,ef as Ke,et as qe,fw as Je,gm as Ye,gp as Xe,hd as w,jm as Ze,ju as Qe,l as $e,ld as et,md as T,mw as tt,nt,o as rt,pw as it,r as at,s as ot,t as st,tb as E,ty as ct,ua as lt,vp as ut,wf as dt,wl as ft,xp as pt,yp as mt,zh as ht,zl as gt,zm as _t,zv as vt,zy as yt}from"./loadAgentsDir-bmpKLPdG.js";import{n as bt,t as xt}from"./cwd-DrEEb4f5.js";import{H as St,I as Ct,N as wt,S as Tt,V as Et,Y as Dt,x as Ot}from"./debug-2pVES-2G.js";import{C as kt,T as At}from"./config-Bio2EjUK.js";import{o as jt,s as Mt}from"./log-L1kqxa_P.js";import{n as Nt}from"./analytics-COpjZpvd.js";import{S as Pt,_ as Ft}from"./startupProfiler-B9Qv2QGH.js";import{l as It,n as Lt,o as Rt}from"./stringUtils-Cs6E5f-B.js";import{_n as zt,vn as Bt}from"./prompt-BnDapYGL.js";import{n as Vt,t as Ht}from"./_baseSlice-D67_NpZ1.js";import{a as Ut,i as Wt,n as Gt,o as Kt,r as qt,t as Jt}from"./agentDisplay-JKfYFD1m.js";import{n as Yt,t as Xt}from"./useExitOnCtrlCDWithKeybindings-BT0nexZw.js";import{n as Zt,t as Qt}from"./TextInput-ou7ZhpVY.js";import{n as $t,t as en}from"./select-CaxQ-BVq.js";import{r as tn,t as nn}from"./Spinner-C0qHjfIY.js";import{n as rn,t as an}from"./useMergedTools-BLsIT3R_.js";import{n as on,r as sn,t as cn}from"./promptEditor-14TB3MYt.js";import{n as ln,t as un}from"./useMainLoopModel-QuE7VkgX.js";import{join as D}from"path";import{mkdir as dn,open as fn,unlink as pn}from"fs/promises";function mn(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Ht(e,t,n)}var hn=e((()=>{Vt()}));function gn(e){return _n.test(e)}var _n,vn=e((()=>{_n=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`)}));function yn(e){return e.split(``)}var bn=e((()=>{}));function xn(e){return e.match(Rn)||[]}var Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn=e((()=>{Sn=`\\ud800-\\udfff`,Cn=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,wn=`\\ufe0e\\ufe0f`,Tn=`[`+Sn+`]`,En=`[`+Cn+`]`,Dn=`\\ud83c[\\udffb-\\udfff]`,On=`(?:`+En+`|`+Dn+`)`,kn=`[^`+Sn+`]`,An=`(?:\\ud83c[\\udde6-\\uddff]){2}`,jn=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Mn=`\\u200d`,Nn=On+`?`,Pn=`[`+wn+`]?`,Fn=`(?:`+Mn+`(?:`+[kn,An,jn].join(`|`)+`)`+Pn+Nn+`)*`,In=Pn+Nn+Fn,Ln=`(?:`+[kn+En+`?`,En,An,jn,Tn].join(`|`)+`)`,Rn=RegExp(Dn+`(?=`+Dn+`)|`+Ln+In,`g`)}));function Bn(e){return gn(e)?xn(e):yn(e)}var Vn=e((()=>{bn(),vn(),zn()}));function Hn(e){return function(t){t=ie(t);var n=gn(t)?Bn(t):void 0,r=n?n[0]:t.charAt(0),i=n?mn(n,1).join(``):t.slice(1);return r[e]()+i}}var Un=e((()=>{hn(),vn(),Vn(),ae()})),Wn,Gn=e((()=>{Un(),Wn=Hn(`toUpperCase`)}));function Kn(e){return Wn(ie(e).toLowerCase())}var qn=e((()=>{ae(),Gn()})),O,Jn=e((()=>{O={FOLDER_NAME:`.workmate`,AGENTS_DIR:`agents`}}));function Yn(e,t,n,r,i,a,o){return`---
|
|
2
2
|
name: ${e}
|
|
3
3
|
description: "${t.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\n/g,`\\\\n`)}"${n===void 0||n.length===1&&n[0]===`*`?``:`\ntools: ${n.join(`, `)}`}${a?`\nmodel: ${a}`:``}${i?`\ncolor: ${i}`:``}${o?`\nmemory: ${o}`:``}
|
|
4
4
|
---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,m as n}from"./settings-D4M13toi.js";import{cf as r,uf as i}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,m as n}from"./settings-D4M13toi.js";import{cf as r,uf as i}from"./loadAgentsDir-bmpKLPdG.js";function a(){let e=t(),n=[`user`,`project`,`local`].flatMap(e=>r(e).errors);return{settings:e.settings,errors:[...e.errors,...n]}}var o=e((()=>{i(),n()}));export{o as n,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,h as n,o as r}from"./config-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,h as n,o as r}from"./config-Bio2EjUK.js";import{o as i,s as a}from"./log-L1kqxa_P.js";import{i as o,t as s}from"./execFileNoThrow-DXSEj8ZO.js";import{homedir as c}from"os";import{join as l}from"path";import{stat as u}from"fs/promises";function d(e){n(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function f(){n(e=>({...e,appleTerminalSetupInProgress:!1}))}function p(){let e=r();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function m(){return l(c(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function h(){let e=m(),t=`${e}.bak`;try{let{code:n}=await s(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await u(e)}catch{return null}return await s(`defaults`,[`export`,`com.apple.Terminal`,t]),d(t),t}catch(e){return a(e),null}}async function g(){let{inProgress:e,backupPath:t}=p();if(!e)return{status:`no_backup`};if(!t)return f(),{status:`no_backup`};try{await u(t)}catch{return f(),{status:`no_backup`}}try{let{code:e}=await s(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await s(`killall`,[`cfprefsd`]),f(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return a(Error(`Failed to restore Terminal.app settings with: ${e}`)),f(),{status:`failed`,backupPath:t}}}var _=e((()=>{t(),o(),i()}));export{f as a,_ as i,g as n,m as r,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./backgroundHousekeeping-CsXlkIg3.js";export{e as startBackgroundHousekeeping};
|
package/dist/chunks/{backgroundHousekeeping-BtEJ6TeC.js → backgroundHousekeeping-CsXlkIg3.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,o as t}from"./envUtils-QyzA_cFM.js";import{_ as n,d as r,m as i}from"./settings-D4M13toi.js";import{P as a,Pt as o,z as s}from"./state-CXY-q5gr.js";import{Fu as c,Ru as l,St as u,db as d,ft as f,gr as p,ic as m,or as h,pb as g,rc as _}from"./loadAgentsDir-
|
|
1
|
+
import{i as e,o as t}from"./envUtils-QyzA_cFM.js";import{_ as n,d as r,m as i}from"./settings-D4M13toi.js";import{P as a,Pt as o,z as s}from"./state-CXY-q5gr.js";import{Fu as c,Ru as l,St as u,db as d,ft as f,gr as p,ic as m,or as h,pb as g,rc as _}from"./loadAgentsDir-bmpKLPdG.js";import{c as v,f as y,i as b,u as x}from"./debug-2pVES-2G.js";import{_ as S,o as C,s as w,v as T}from"./log-L1kqxa_P.js";import{n as E}from"./analytics-COpjZpvd.js";import{r as D,t as O}from"./pasteStore-njJCBMKr.js";import{r as k}from"./magicDocs-BsEiBLQl.js";import{i as A,t as j}from"./nativeInstaller-DMkZdsof.js";import{n as M,t as N}from"./allErrors-Dhnf6rqg.js";import{n as P,t as F}from"./pluginAutoupdate-ByokIVEs.js";import{join as I}from"path";o(),m(),k(),E(),T(),b(),t(),y(),l(),C(),D(),p(),M(),i(),g(),u();var L=30;function R(){let e=((r()||{}).cleanupPeriodDays??L)*24*60*60*1e3;return new Date(Date.now()-e)}function z(e,t){return{messages:e.messages+t.messages,errors:e.errors+t.errors}}function B(e){let t=e.split(`.`)[0].replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/,`T$1:$2:$3.$4Z`);return new Date(t)}async function V(e,t,n){let r={messages:0,errors:0};try{let i=await x().readdir(e);for(let a of i)try{B(a.name)<t&&(await x().unlink(I(e,a.name)),n?r.messages++:r.errors++)}catch(e){w(e)}}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&w(e)}return r}async function H(){let e=x(),t=R(),n=S.errors(),r=S.baseLogs(),i=await V(n,t,!1);try{let n;try{n=await e.readdir(r)}catch{return i}let a=n.filter(e=>e.isDirectory()&&e.name.startsWith(`mcp-logs-`)).map(e=>I(r,e.name));for(let n of a)i=z(i,await V(n,t,!0)),await W(n,e)}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&w(e)}return i}async function U(e,t,n){return(await n.stat(e)).mtime<t?(await n.unlink(e),!0):!1}async function W(e,t){try{await t.rmdir(e)}catch{}}async function G(){let e=R(),t={messages:0,errors:0},n=h(),r=x(),i;try{i=await r.readdir(n)}catch{return t}for(let a of i){if(!a.isDirectory())continue;let i=I(n,a.name),o;try{o=await r.readdir(i)}catch{t.errors++;continue}for(let n of o)if(n.isFile()){if(!n.name.endsWith(`.jsonl`)&&!n.name.endsWith(`.cast`))continue;try{await U(I(i,n.name),e,r)&&t.messages++}catch{t.errors++}}else if(n.isDirectory()){let a=I(i,n.name),o=I(a,d),s;try{s=await r.readdir(o)}catch{await W(a,r);continue}for(let n of s)if(n.isFile())try{await U(I(o,n.name),e,r)&&t.messages++}catch{t.errors++}else if(n.isDirectory()){let i=I(o,n.name),a;try{a=await r.readdir(i)}catch{continue}for(let n of a)if(n.isFile())try{await U(I(i,n.name),e,r)&&t.messages++}catch{t.errors++}await W(i,r)}await W(o,r),await W(a,r)}await W(i,r)}return t}async function K(e,t,n=!0){let r=R(),i={messages:0,errors:0},a=x(),o;try{o=await a.readdir(e)}catch{return i}for(let n of o)if(!(!n.isFile()||!n.name.endsWith(t)))try{await U(I(e,n.name),r,a)&&i.messages++}catch{i.errors++}return n&&await W(e,a),i}function q(){return K(I(e(),`plans`),`.md`)}async function J(){let t=R(),n={messages:0,errors:0},r=x();try{let i=I(e(),`file-history`),a;try{a=await r.readdir(i)}catch{return n}let o=a.filter(e=>e.isDirectory()).map(e=>I(i,e.name));await Promise.all(o.map(async e=>{try{(await r.stat(e)).mtime<t&&(await r.rm(e,{recursive:!0,force:!0}),n.messages++)}catch{n.errors++}})),await W(i,r)}catch(e){w(e)}return n}async function Y(){let t=R(),n={messages:0,errors:0},r=x();try{let i=I(e(),`session-env`),a;try{a=await r.readdir(i)}catch{return n}let o=a.filter(e=>e.isDirectory()).map(e=>I(i,e.name));for(let e of o)try{(await r.stat(e)).mtime<t&&(await r.rm(e,{recursive:!0,force:!0}),n.messages++)}catch{n.errors++}await W(i,r)}catch(e){w(e)}return n}async function X(){let t=R(),n={messages:0,errors:0},r=x(),i=I(e(),`debug`),a;try{a=await r.readdir(i)}catch{return n}for(let e of a)if(!(!e.isFile()||!e.name.endsWith(`.txt`)||e.name===`latest`))try{await U(I(i,e.name),t,r)&&n.messages++}catch{n.errors++}return n}async function Z(){let{errors:e}=N();if(e.length>0&&n(`cleanupPeriodDays`)){v(`Skipping cleanup: settings have validation errors but cleanupPeriodDays was explicitly set. Fix settings errors to enable cleanup.`);return}await H(),await G(),await q(),await J(),await Y(),await X(),await c(),await O(R()),await f(R())}j(),P();var Q=600*1e3;function $(){import(`./extractMemories-CVUrBFMj.js`).then(({initExtractMemories:e})=>{e()}).catch(()=>{}),_(),F();let e=!0;async function t(){if(a()&&s()>Date.now()-1e3*60){setTimeout(t,Q).unref();return}if(e&&(e=!1,await Z()),a()&&s()>Date.now()-1e3*60){setTimeout(t,Q).unref();return}await A()}setTimeout(t,Q).unref()}export{$ as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Hr as e,In as t,Vn as n,ii as r,qr as i,ti as a,zr as o}from"./settings-D4M13toi.js";import{Pt as s,q as c}from"./state-CXY-q5gr.js";import{c as l,i as u}from"./debug-2pVES-2G.js";import{d,h as f,o as p}from"./config-
|
|
1
|
+
import{Hr as e,In as t,Vn as n,ii as r,qr as i,ti as a,zr as o}from"./settings-D4M13toi.js";import{Pt as s,q as c}from"./state-CXY-q5gr.js";import{c as l,i as u}from"./debug-2pVES-2G.js";import{d,h as f,o as p}from"./config-Bio2EjUK.js";import{_ as m,f as h,p as g}from"./startupProfiler-B9Qv2QGH.js";import{n as _,r as v}from"./detectRepository--luIRv5H.js";import{homedir as y}from"os";import{join as b,sep as x}from"path";import{realpath as S,stat as C}from"fs/promises";s(),d(),u(),v(),t(),r(),i();async function w(){try{let e=await _();if(!e){l(`Not in a GitHub repository, skipping path mapping update`);return}let t=c(),n=o(t)??t,r;try{r=(await S(n)).normalize(`NFC`)}catch{r=n}let i=e.toLowerCase(),a=p().githubRepoPaths?.[i]??[];if(a[0]===r){l(`Path ${r} already tracked for repo ${i}`);return}let s=a.filter(e=>e!==r),u=[r,...s];f(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[i]:u}})),l(`Added ${r} to tracked paths for repo ${i}`)}catch(e){l(`Error updating repo path mapping: ${e}`)}}function T(e){let t=p(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function E(e){let t=await Promise.all(e.map(n));return e.filter((e,n)=>t[n])}m(),r(),i();var D=10080*60*1e3,O=1e3;function k(e){let t=[`This session was opened by an external deep link in ${M(e.cwd)}`];if(e.repo){let n=e.lastFetch?g(e.lastFetch):`never`,r=!e.lastFetch||Date.now()-e.lastFetch.getTime()>D;t.push(`Resolved ${e.repo} from local clones · last fetched ${n}${r?` — AGENTS.md may be stale`:``}`)}return e.prefillLength&&t.push(e.prefillLength>O?`The prompt below (${h(e.prefillLength)} chars) was supplied by the link — scroll to review the entire prompt before pressing Enter.`:`The prompt below was supplied by the link — review carefully before pressing Enter.`),t.join(`
|
|
2
2
|
`)}async function A(t){let n=await e(t);if(!n)return;let r=await a(n),[i,o]=await Promise.all([j(b(n,`FETCH_HEAD`)),r?j(b(r,`FETCH_HEAD`)):Promise.resolve(void 0)]);return i&&o?i>o?i:o:i??o}async function j(e){try{let{mtime:t}=await C(e);return t}catch{return}}function M(e){let t=y();return e===t?`~`:e.startsWith(t+x)?`~${e.slice(t.length)}`:e}export{w as a,T as i,A as n,E as r,k as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{vn as t,yn as n}from"./settings-D4M13toi.js";import{Pt as r,at as i,q as a}from"./state-CXY-q5gr.js";import{Sr as o,ar as s,ei as c,fr as l,gr as u,oi as d,pr as f}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{vn as t,yn as n}from"./settings-D4M13toi.js";import{Pt as r,at as i,q as a}from"./state-CXY-q5gr.js";import{Sr as o,ar as s,ei as c,fr as l,gr as u,oi as d,pr as f}from"./loadAgentsDir-bmpKLPdG.js";import{C as p,x as m}from"./debug-2pVES-2G.js";import{n as h}from"./analytics-COpjZpvd.js";import{i as g,o as _}from"./stringUtils-Cs6E5f-B.js";import{randomUUID as v}from"crypto";import{mkdir as y,readFile as b,writeFile as x}from"fs/promises";function S(e){let t=e?.message?.content;if(!t)return`Branched conversation`;let n=typeof t==`string`?t:t.find(e=>e.type===`text`)?.text;return n&&n.replace(/\s+/g,` `).trim().slice(0,100)||`Branched conversation`}async function C(e){let t=v(),r=i(),c=s(a()),u=f(t),d=l();await y(c,{recursive:!0,mode:448});let m;try{m=await b(d)}catch{throw Error(`No conversation to branch`)}if(m.length===0)throw Error(`No conversation to branch`);let h=n(m),g=h.filter(e=>o(e)&&!e.isSidechain),_=h.filter(e=>e.type===`content-replacement`&&e.sessionId===r).flatMap(e=>e.replacements);if(g.length===0)throw Error(`No messages to branch`);let S=null,C=[],w=[];for(let e of g){let n={...e,sessionId:t,parentUuid:S,isSidechain:!1,forkedFrom:{sessionId:r,messageUuid:e.uuid}},i={...e,sessionId:t};w.push(i),C.push(p(n)),e.type!==`progress`&&(S=e.uuid)}if(_.length>0){let e={type:`content-replacement`,sessionId:t,replacements:_};C.push(p(e))}return await x(u,`${C.join(`
|
|
2
2
|
`)}\n`,{encoding:`utf8`,mode:384}),{sessionId:t,title:e,forkPath:u,serializedMessages:w,contentReplacementRecords:_}}async function w(e){let t=`${e} (Branch)`;if((await d(t,{exact:!0})).length===0)return t;let n=await d(`${e} (Branch`),r=new Set([1]),i=RegExp(`^${g(e)} \\(Branch(?: (\\d+))?\\)$`);for(let e of n){let t=e.customTitle?.match(i);t&&(t[1]?r.add(parseInt(t[1],10)):r.add(1))}let a=2;for(;r.has(a);)a++;return`${e} (Branch ${a})`}async function T(e,t,n){let r=n?.trim()||void 0,a=i();try{let{sessionId:n,title:i,forkPath:o,serializedMessages:s,contentReplacementRecords:l}=await C(r),u=new Date,d=S(s.find(e=>e.type===`user`)),f=await w(i??d);await c(n,f,o),s.length;let p={date:u.toISOString().split(`T`)[0],messages:s,fullPath:o,value:u.getTime(),created:u,modified:u,firstPrompt:d,messageCount:s.length,isSidechain:!1,sessionId:n,customTitle:f,contentReplacements:l},m=i?` "${i}"`:``,h=`Branched conversation${m}. You are now in the branch.${`\nTo resume the original: claude -r ${a}`}`;return t.resume?(await t.resume(n,p,`fork`),e(h,{display:`system`})):e(`Branched conversation${m}. Resume with: /resume ${n}`),null}catch(t){return e(`Failed to branch conversation: ${t instanceof Error?t.message:`Unknown error occurred`}`),null}}e((()=>{r(),h(),t(),u(),m(),_()}))();export{T as call,S as deriveFirstPrompt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-QyzA_cFM.js";import{Gi as r,Ni as i,Vi as a,Wi as o,ea as s,ia as c,oa as l,ta as u}from"./settings-D4M13toi.js";import{c as d,i as f}from"./debug-2pVES-2G.js";import{o as p,s as m}from"./log-L1kqxa_P.js";import{join as h}from"node:path";import{spawn as g,spawnSync as _}from"node:child_process";import{chmodSync as v,existsSync as y,mkdirSync as b,readFileSync as x,renameSync as S,writeFileSync as C}from"node:fs";function w(){return h(t(),`channel`)}function T(){return h(w(),`dingtalk.json`)}function E(){return M.parse({})}function D(){let e=T();try{if(!y(e))return E();let t=x(e,`utf8`),n=JSON.parse(t);return M.parse(n)}catch(e){return m(e),E()}}function O(e){let t=T(),n=e(D());b(w(),{recursive:!0});let r=`${t}.${process.pid}.tmp`;C(r,`${JSON.stringify(n,null,2)}\n`,{mode:384}),S(r,t);try{v(t,384)}catch{}return n}function k(e){return e.channel?.enabled===!0&&e.channel?.activePlugin===`dingtalk`}function A(e){return e.permissionMode}var j,M,N=e((()=>{i(),n(),p(),j=u({workmateSessionId:l(),lastActiveAt:s(),senderId:l().optional()}),M=u({corpid:l().default(``),appKey:l().default(``),appSecret:l().default(``),robotName:l().default(`workmate`),cardTemplateId:l().default(``),permissionMode:a([`default`,`acceptEdits`,`bypassPermissions`,`plan`,`dontAsk`,`auto`]).default(`acceptEdits`),sessionStrategy:a([`perConversation`,`perUser`,`shared`]).default(`perConversation`),confirmDangerous:r().default(!0),admins:o(l()).default([]),sessions:c(l(),j).default({})})}));function P(){let e=R();if(e)return d(`[channel] bridge 已在运行,pid=${e}`,{level:`debug`}),{pid:e,started:!1};let t=process.argv[1],n=t&&/\.(cjs|js|mjs)$/.test(t)?[t,`channel`,`start`]:[`channel`,`start`],r=g(process.execPath,n,{detached:!0,stdio:`ignore`,cwd:process.cwd()});r.unref();let i=r.pid;return i?(d(`[channel] bridge 已启动,pid=${i}`,{level:`debug`}),{pid:i,started:!0}):{pid:0,started:!1}}function F(){let e=R();if(!e)return!1;try{return process.kill(e,`SIGTERM`),d(`[channel] 已发 SIGTERM 给 bridge pid=${e}`,{level:`debug`}),!0}catch(e){return m(e),!1}}function I(){return R()!==null}function L(){return R()}function R(){let e=_(`pgrep`,[`-f`,z],{encoding:`utf8`});if(e.status!==0||!e.stdout.trim())return null;let t=e.stdout.trim().split(`
|
|
2
|
+
`).map(Number).filter(e=>e&&e!==process.pid);return t.length?t[t.length-1]:null}var z,B=e((()=>{f(),p(),z=`channel start`}));export{F as a,N as c,P as i,k as l,B as n,D as o,I as r,A as s,L as t,O as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,ai as i,bn as a,ot as o,t as s,vn as c,xt as l}from"./src-BX54x08P.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{Gt as d}from"./settings-D4M13toi.js";import{Bv as f,F_ as p,GS as m,I_ as h,Ji as g,P_ as _,Rx as v,Us as y,Ws as b,dd as x,ld as S,ot as C,sb as w,st as T,ty as E,zv as D}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,ai as i,bn as a,ot as o,t as s,vn as c,xt as l}from"./src-BX54x08P.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{Gt as d}from"./settings-D4M13toi.js";import{Bv as f,F_ as p,GS as m,I_ as h,Ji as g,P_ as _,Rx as v,Us as y,Ws as b,dd as x,ld as S,ot as C,sb as w,st as T,ty as E,zv as D}from"./loadAgentsDir-bmpKLPdG.js";import{I as O,M as k}from"./debug-2pVES-2G.js";import{d as A,h as j}from"./config-Bio2EjUK.js";import{n as M,t as N}from"./SpinnerGlyph-BR_SiV9L.js";import{n as P,r as F}from"./sideQuestion-BJTVma-5.js";import{i as I,n as L}from"./modalContext-sU2lfR08.js";function R({question:e,context:t,onDone:i}){let[s,c]=(0,H.useState)(null),[u,d]=(0,H.useState)(null),[f,p]=(0,H.useState)(0),m=(0,H.useRef)(null),{rows:h}=I(o());a(()=>p(e=>e+1),s||u?null:80);function g(e){if(e.key===`escape`||e.key===`return`||e.key===` `||e.ctrl&&(e.key===`c`||e.key===`d`)){e.preventDefault(),i(void 0,{display:`skip`});return}(e.key===`up`||e.ctrl&&e.key===`p`)&&(e.preventDefault(),m.current?.scrollBy(-3)),(e.key===`down`||e.ctrl&&e.key===`n`)&&(e.preventDefault(),m.current?.scrollBy(K))}(0,H.useEffect)(()=>{let n=D();async function r(){try{let r=await F({question:e,cacheSafeParams:await B(t)});n.signal.aborted||(r.response?c(r.response):d(`No response received`))}catch(e){n.signal.aborted||d(k(e)||`Failed to get response`)}}return r(),()=>{n.abort()}},[e,t]);let _=Math.max(5,h-W-G);return(0,U.jsxs)(n,{flexDirection:`column`,paddingLeft:2,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:g,children:[(0,U.jsxs)(n,{children:[(0,U.jsxs)(r,{color:`warning`,bold:!0,children:[`/btw`,` `]}),(0,U.jsx)(r,{dimColor:!0,children:e})]}),(0,U.jsx)(n,{marginTop:1,marginLeft:2,maxHeight:_,children:(0,U.jsx)(l,{ref:m,flexDirection:`column`,flexGrow:1,children:u?(0,U.jsx)(r,{color:`error`,children:u}):s?(0,U.jsx)(S,{children:s}):(0,U.jsxs)(n,{children:[(0,U.jsx)(N,{frame:f,messageColor:`warning`}),(0,U.jsx)(r,{color:`warning`,children:`Answering...`})]})})}),(s||u)&&(0,U.jsx)(n,{marginTop:1,children:(0,U.jsxs)(r,{dimColor:!0,children:[`↑`,`/`,`↓`,` to scroll · Space, Enter, or Escape to dismiss`]})})]})}function z(e){let t=e.at(-1);return t?.type===`assistant`&&t.message.stop_reason===null?e.slice(0,-1):e}async function B(e){let t=v(z(e.messages)),n=y();if(n)return{systemPrompt:n.systemPrompt,userContext:n.userContext,systemContext:n.systemContext,toolUseContext:e,forkContextMessages:t};let[r,i,a]=await Promise.all([C(e.options.tools,e.options.mainLoopModel,[],e.options.mcpClients),p(),_()]);return{systemPrompt:m(r),userContext:i,systemContext:a,toolUseContext:e,forkContextMessages:t}}async function V(e,t,n){let r=n?.trim();return r?(j(e=>({...e,btwUseCount:e.btwUseCount+1})),(0,U.jsx)(R,{question:r,context:t,onDone:e})):(e(`Usage: /btw <your question>`,{display:`system`}),null)}var H,U,W,G,K;e((()=>{H=t(i(),1),c(),x(),M(),d(),T(),L(),h(),w(),s(),f(),A(),O(),b(),g(),P(),E(),U=u(),W=5,G=6,K=3}))();export{V as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./caches-CW5YnYNS.js";e();export{t as clearSessionCaches};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ei as t,ii as n}from"./settings-D4M13toi.js";import{Pt as r,l as i,mn as a}from"./state-CXY-q5gr.js";import{Ay as o,Bi as s,Cb as c,Ci as l,F_ as u,G as d,I_ as f,Iu as p,L_ as m,Mi as h,Mp as g,N_ as _,P_ as v,R_ as y,Ru as b,Sb as x,Wi as S,hp as C,ky as w,lh as T,lm as E,ns as D,pp as O,q as k,sm as A,ts as j,uh as M,z_ as N}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ei as t,ii as n}from"./settings-D4M13toi.js";import{Pt as r,l as i,mn as a}from"./state-CXY-q5gr.js";import{Ay as o,Bi as s,Cb as c,Ci as l,F_ as u,G as d,I_ as f,Iu as p,L_ as m,Mi as h,Mp as g,N_ as _,P_ as v,R_ as y,Ru as b,Sb as x,Wi as S,hp as C,ky as w,lh as T,lm as E,ns as D,pp as O,q as k,sm as A,ts as j,uh as M,z_ as N}from"./loadAgentsDir-bmpKLPdG.js";import{a as P,n as F}from"./fileSuggestions-DF3HTRKr.js";import{r as I,t as L}from"./magicDocs-BsEiBLQl.js";import{r as R,t as z}from"./detectRepository--luIRv5H.js";function B(e=new Set){let n=e.size>0;u.cache.clear?.(),v.cache.clear?.(),_.cache.clear?.(),y.cache.clear?.(),F(),l(),n||C(),m(null),a(null),E(),D(),o(`session_start`),p(),z(),d(),i(e),t(),s(),M(),L(),x(),import(`./SearchExtraToolsTool-ndh4aEwQ.js`).then(({clearSearchExtraToolsDescriptionCache:e})=>e()),import(`./loadAgentsDir-Zw648oQO.js`).then(({clearAgentDefinitionsCache:e})=>e()),import(`./prompt-BdH2zk0S.js`).then(({clearPromptCache:e})=>e())}var V=e((()=>{r(),h(),N(),f(),P(),g(),O(),A(),T(),I(),S(),j(),k(),w(),R(),n(),b(),c()}));export{V as n,B as t};
|