@readmagic/workmate 0.0.30 → 0.0.32
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-B03NZZuQ.js → AddWorkspaceDirectory-vexJPqPV.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-C1YY3Zjr.js +1 -0
- package/dist/chunks/{AgentsMdExternalIncludesDialog-CIyefOzT.js → AgentsMdExternalIncludesDialog-DgfH_qbT.js} +1 -1
- package/dist/chunks/{App-WBysAL0_.js → App-Dc1bPgMO.js} +1 -1
- package/dist/chunks/{BackgroundTasksDialog-CvvrjBoq.js → BackgroundTasksDialog-By1aAUjA.js} +1 -1
- package/dist/chunks/{BypassPermissionsModeDialog-DdVbMyla.js → BypassPermissionsModeDialog-BfT29YcX.js} +1 -1
- package/dist/chunks/{CustomSelect-iSG1rbWU.js → CustomSelect-C1eyA6Kb.js} +1 -1
- package/dist/chunks/{DiffDialog-DSb46fzB.js → DiffDialog-DlzYbkSE.js} +1 -1
- package/dist/chunks/Doctor-BTo-aW25.js +1 -0
- package/dist/chunks/{Doctor-dR71Dg_D.js → Doctor-Bysh947B.js} +1 -1
- package/dist/chunks/{ExitFlow-BiBi5Sqk.js → ExitFlow-DdgKWYBy.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-7MkDSXXj.js → InvalidConfigDialog-B5hyg2fw.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-D8Ves3Th.js → InvalidSettingsDialog-NORkKmDs.js} +1 -1
- package/dist/chunks/{KeybindingProviderSetup-DJSFdVYv.js → KeybindingProviderSetup-Dfo4pevM.js} +1 -1
- package/dist/chunks/{MCPConnectionManager-BZxRMdGO.js → MCPConnectionManager-DTNuL42C.js} +1 -1
- package/dist/chunks/{MCPToolListView-H_Kvvelz.js → MCPToolListView-CmyNoMRA.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-D2xvaog9.js → McpParsingWarnings-F5n38r1V.js} +1 -1
- package/dist/chunks/{MessageSelector-DQgIgPij.js → MessageSelector-CB3shj7u.js} +1 -1
- package/dist/chunks/{Messages-DyQCr-od.js → Messages-DHOApZZj.js} +1 -1
- package/dist/chunks/{Onboarding-DFufTPIY.js → Onboarding-LjlAtPO-.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-B9JRcHHE.js → PromptInputFooterSuggestions-ChS18ulx.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-DcGXK5lt.js → PromptInputHelpMenu-BG4Xvwlp.js} +1 -1
- package/dist/chunks/{ProviderSetup-DJ_Z1BSe.js → ProviderSetup-ebTTSOUN.js} +1 -1
- package/dist/chunks/{QueryEngine-BQ5PSqKV.js → QueryEngine-D_X2cZgn.js} +1 -1
- package/dist/chunks/REPL-BmB39a3K.js +1 -0
- package/dist/chunks/REPL-CJAN4D4C.js +124 -0
- package/dist/chunks/{ResumeConversation-exTLviBY.js → ResumeConversation-Vsc6MgfT.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-DxijDdxt.js +1 -0
- package/dist/chunks/{Settings-nM6-cXh0.js → Settings-Bx9sAK4z.js} +2 -2
- package/dist/chunks/{Spinner-ChT4lOOg.js → Spinner-bYnSD54K.js} +1 -1
- package/dist/chunks/{TextInput-CanSwT9J.js → TextInput-DJaXm3Y2.js} +1 -1
- package/dist/chunks/{ThemePicker-CXzPiSy0.js → ThemePicker-DTRkcYKg.js} +1 -1
- package/dist/chunks/{TrustDialog-D0fJ-YIw.js → TrustDialog-CCLPfwKL.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-29bQ0l-Q.js → ValidationErrorsList-Cw-sjz1h.js} +1 -1
- package/dist/chunks/{_baseEach-DPcnudh_.js → _baseEach-CVpc553F.js} +1 -1
- package/dist/chunks/{add-dir-DbNz1SeY.js → add-dir-CC99_pE2.js} +1 -1
- package/dist/chunks/{agentDisplay-Bif3eE1e.js → agentDisplay-CouNgts6.js} +1 -1
- package/dist/chunks/{agents-CbsNbPbp.js → agents-B0CpBZFY.js} +1 -1
- package/dist/chunks/{agents-yvC-VikU.js → agents-ByQvpZ-y.js} +1 -1
- package/dist/chunks/{allErrors-Bv1e8fra.js → allErrors-BlYbbyyw.js} +1 -1
- package/dist/chunks/{appleTerminalBackup-Ct9hf1QQ.js → appleTerminalBackup-j8nI5uNK.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-C75FgxW1.js → backgroundHousekeeping-C86ALKjw.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-FTpq_e19.js +1 -0
- package/dist/chunks/{banner-D5m9LUjl.js → banner-BsO6K4Ve.js} +1 -1
- package/dist/chunks/{branch-DOQ3yNds.js → branch-BQ_M1T0j.js} +1 -1
- package/dist/chunks/{btw-DUjuwyMH.js → btw-y1tuqCvG.js} +1 -1
- package/dist/chunks/caches-CO82GKDD.js +1 -0
- package/dist/chunks/{caches-BKAPMXp9.js → caches-CcK6hjFh.js} +1 -1
- package/dist/chunks/{channel-C8JmEI06.js → channel-BocoQ6RM.js} +1 -1
- package/dist/chunks/{channel-TEYwDITo.js → channel-D0MXuZ5p.js} +1 -1
- package/dist/chunks/{clear-BFlTcvMt.js → clear-Dh0ZUTyq.js} +1 -1
- package/dist/chunks/commands-CqI8Xw3J.js +1 -0
- package/dist/chunks/{compact-CyR7Sbo1.js → compact-Drhb6hKF.js} +1 -1
- package/dist/chunks/{config-Bjwat4P6.js → config-CMtnYZR9.js} +1 -1
- package/dist/chunks/config-CgzzjTUe.js +1 -0
- package/dist/chunks/config-DFScnxW_.js +1 -0
- package/dist/chunks/{context-Cm_gyngQ.js → context-BsbQnZOh.js} +1 -1
- package/dist/chunks/context-noninteractive-4Vn-NMDi.js +1 -0
- package/dist/chunks/{context-noninteractive-BDmFfPRt.js → context-noninteractive-BmjENE43.js} +1 -1
- package/dist/chunks/conversation-CSnPSTPX.js +1 -0
- package/dist/chunks/{conversation-CYZKYlWc.js → conversation-CxvOL7c4.js} +1 -1
- package/dist/chunks/{conversationRecovery-BUqpxLl-.js → conversationRecovery-CM94gKCQ.js} +1 -1
- package/dist/chunks/{crossProjectResume-BCa2l0KZ.js → crossProjectResume-Cq1oZ0F6.js} +1 -1
- package/dist/chunks/{diff-BEvpLh_b.js → diff-DHn2Qup2.js} +1 -1
- package/dist/chunks/doctor-DmJqkQqg.js +1 -0
- package/dist/chunks/{entry-JGyBs1p5.js → entry-tt6FI8GT.js} +1 -1
- package/dist/chunks/{exit-DU2KGyDk.js → exit-Q-xc8GEs.js} +1 -1
- package/dist/chunks/{extraUsage-cZx2XLx4.js → extraUsage-CnQUVxGf.js} +1 -1
- package/dist/chunks/extractMemories-DOfFiInm.js +1 -0
- package/dist/chunks/{fast-DUJq6-QE.js → fast-BeKnNZaH.js} +1 -1
- package/dist/chunks/fast-ClJARykP.js +1 -0
- package/dist/chunks/{fetchModelList-Dn8OahtV.js → fetchModelList-531U79it.js} +1 -1
- package/dist/chunks/fetchModelList-6pNEKem5.js +1 -0
- package/dist/chunks/{fileSuggestions-XLnnVLwx.js → fileSuggestions-sTa3fiI8.js} +1 -1
- package/dist/chunks/{gemini-qzPNGqOX.js → gemini-BzN-GtAf.js} +1 -1
- package/dist/chunks/{generateSessionName-CA-cc58H.js → generateSessionName-DGzU61fU.js} +1 -1
- package/dist/chunks/{goal-x9Pkx5nv.js → goal-DOF3kWop.js} +1 -1
- package/dist/chunks/{grok-36CpLjsq.js → grok-jsEI7sLT.js} +1 -1
- package/dist/chunks/{help-DwfAEV0X.js → help-CYH2fCqh.js} +1 -1
- package/dist/chunks/{hooks-DBmA-DWx.js → hooks-BBL70Pl1.js} +1 -1
- package/dist/chunks/hooks-ujSG0QYH.js +1 -0
- package/dist/chunks/{install-DF4ep6nb.js → install-DIv3UQHd.js} +1 -1
- package/dist/chunks/{instrumentation-BAbhrE3f.js → instrumentation-CzXp-AVx.js} +3 -3
- package/dist/chunks/{job-CFWKIjNl.js → job-B38MURYt.js} +1 -1
- package/dist/chunks/{launchLocalMemory-Cf8l-1fz.js → launchLocalMemory-ClOCP1QH.js} +1 -1
- package/dist/chunks/{launchOnboarding-8CDef-v1.js → launchOnboarding-Km72c-fV.js} +1 -1
- package/dist/chunks/loadAgentsDir-DbkvUkkw.js +1 -0
- package/dist/chunks/{loadAgentsDir-DnHL_5cU.js → loadAgentsDir-izAo6rpy.js} +468 -468
- package/dist/chunks/{loadPluginHooks-BuunKr9m.js → loadPluginHooks-BBa5nd8Z.js} +1 -1
- package/dist/chunks/localSearch-BObbNIdd.js +1 -0
- package/dist/chunks/{localSearch-LFCzV7VE.js → localSearch-BqJfYIga.js} +1 -1
- package/dist/chunks/{logoUtils-B8MIA7c5.js → logoUtils-Mvbi4iz4.js} +1 -1
- package/dist/chunks/{magicDocs-BoxJusTI.js → magicDocs-Beuyy0aV.js} +1 -1
- package/dist/chunks/{main-B9ciFYnO.js → main-CkDjqZz5.js} +6 -6
- package/dist/chunks/managedEnv-BV6T_PdC.js +1 -0
- package/dist/chunks/{managedEnv-B0mj-wgE.js → managedEnv-O3Xqe_lk.js} +1 -1
- package/dist/chunks/{mcp-B3Ewo-_h.js → mcp-BQubBUXS.js} +1 -1
- package/dist/chunks/{mcp-CHlAZvpV.js → mcp-D8SeoRoL.js} +1 -1
- package/dist/chunks/{mcp-DVKuOqvY.js → mcp-YtIqT_CN.js} +1 -1
- package/dist/chunks/{memory-Cr0d-s7U.js → memory-CFvypHzK.js} +1 -1
- package/dist/chunks/{mode-DBNBDbVP.js → mode-CLmT-L6g.js} +1 -1
- package/dist/chunks/{model-B2r1Ms0g.js → model-BdWlSYyq.js} +1 -1
- package/dist/chunks/{model-C9ANf1-R.js → model-cu29eOoS.js} +1 -1
- package/dist/chunks/{modelOptions-B4BWYms0.js → modelOptions-d5F1-LIh.js} +1 -1
- package/dist/chunks/{nativeInstaller-BDJxBAPV.js → nativeInstaller-oMsFvcUC.js} +1 -1
- package/dist/chunks/{notifications-BV-VeXyJ.js → notifications-ClFVMgnt.js} +1 -1
- package/dist/chunks/{onChangeAppState-BGWWkhBg.js → onChangeAppState-CvlswuIl.js} +1 -1
- package/dist/chunks/{openai-BL_IWBTr.js → openai-BoYbxtOG.js} +1 -1
- package/dist/chunks/{overlayContext-DGUFuee9.js → overlayContext-DNYDip6r.js} +1 -1
- package/dist/chunks/{partition-B2VCm4vu.js → partition-DRloaIYE.js} +1 -1
- package/dist/chunks/{permissions-Bkj1UB1h.js → permissions-RfHevyA2.js} +1 -1
- package/dist/chunks/{pidLock-CawSx6hb.js → pidLock-Bn9y7GMY.js} +2 -2
- package/dist/chunks/{plan-D7Ki5ADu.js → plan-CWfN8okc.js} +1 -1
- package/dist/chunks/{plugin-D7I6VZjh.js → plugin-Bee-4gyo.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-Cr3jw-ky.js → pluginAutoupdate-xsdXYyA-.js} +1 -1
- package/dist/chunks/{pluginBlocklist-JG_kJSSK.js → pluginBlocklist-BTdbSAHE.js} +1 -1
- package/dist/chunks/{pluginCliCommands-BWIBBFJf.js → pluginCliCommands-AlVmiNIz.js} +1 -1
- package/dist/chunks/{pluginFlagging-yFcXMVin.js → pluginFlagging-BGOionRt.js} +1 -1
- package/dist/chunks/{pluginOperations-6QXjdPOb.js → pluginOperations-DYX4XPSc.js} +1 -1
- package/dist/chunks/{pluginStartupCheck-CkjyJ4RS.js → pluginStartupCheck-CGmmDw8e.js} +1 -1
- package/dist/chunks/pluginStartupCheck-CQi735a4.js +1 -0
- package/dist/chunks/{plugins-CMDfjFp-.js → plugins-_mf-Z_F5.js} +1 -1
- package/dist/chunks/{print-B6x_8O9w.js → print-9f_73BN2.js} +2 -2
- package/dist/chunks/{processBashCommand-D0BBcBHY.js → processBashCommand-Do8AJN_g.js} +1 -1
- package/dist/chunks/{processSlashCommand-BvjNuNyP.js → processSlashCommand-BcMLjAEQ.js} +1 -1
- package/dist/chunks/{projectOnboardingState-ofkjp9FJ.js → projectOnboardingState-DqGLXSM_.js} +1 -1
- package/dist/chunks/{prompt-DDlkyIzV.js → prompt-B4rM4cgp.js} +1 -1
- package/dist/chunks/prompt-BnLHkqxH.js +1 -0
- package/dist/chunks/prompt-Bxk7M5A5.js +1 -0
- package/dist/chunks/{protocolHandler-Bjmx7OmF.js → protocolHandler-DrGjosKa.js} +1 -1
- package/dist/chunks/{reconciler-CHbint0C.js → reconciler-BcpooxDV.js} +1 -1
- package/dist/chunks/{refresh-yut9uEfd.js → refresh-nrBMGYPi.js} +1 -1
- package/dist/chunks/{reject-CrNfit3M.js → reject-B3lkQjOv.js} +1 -1
- package/dist/chunks/{reload-plugins-labKy5Eh.js → reload-plugins-C6aSczZl.js} +1 -1
- package/dist/chunks/{rename-c8tElppw.js → rename-D3rmIsGf.js} +1 -1
- package/dist/chunks/{resume-C8xif2lo.js → resume-Cj_JBDJU.js} +1 -1
- package/dist/chunks/{runtimeObserver-DuJ8mRfr.js → runtimeObserver-4vJtpquK.js} +2 -2
- package/dist/chunks/{runtimeObserver-vmPplAGH.js → runtimeObserver-CgdVfPHy.js} +1 -1
- package/dist/chunks/sandbox-adapter-BNLLtZ41.js +1 -0
- package/dist/chunks/{sandbox-toggle-USHaZHD7.js → sandbox-toggle-Dt4lDgnB.js} +1 -1
- package/dist/chunks/searchExtraTools-C1v6F01_.js +1 -0
- package/dist/chunks/{select-BpiKdirZ.js → select-CPlgmbIJ.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-BnOpxVs-.js +1 -0
- package/dist/chunks/{sessionObserver-sO6PF7mV.js → sessionObserver-CFN7Ig3Q.js} +1 -1
- package/dist/chunks/sessionObserver-CnWQCO-S.js +1 -0
- package/dist/chunks/sessionStorage-Dr6JjGiG.js +1 -0
- package/dist/chunks/{sessionTracing-Bz89tYh5.js → sessionTracing-nqfu1pVT.js} +1 -1
- package/dist/chunks/{setup-B-FejaeH.js → setup-Im12wZpx.js} +2 -2
- package/dist/chunks/{shadowedRuleDetection-BI6Xz0pY.js → shadowedRuleDetection-CiG8S6iX.js} +1 -1
- package/dist/chunks/{sideQuestion-BEpCuv_7.js → sideQuestion-BW9eo3IE.js} +1 -1
- package/dist/chunks/{sinks-BvOPODnl.js → sinks-C7vJLHLA.js} +1 -1
- package/dist/chunks/sinks-DMDnR8N8.js +1 -0
- package/dist/chunks/{skillChangeDetector-D-fxaAMH.js → skillChangeDetector-CrsPxCzn.js} +1 -1
- package/dist/chunks/{skillGapStore-A1FCr8Mf.js → skillGapStore-BV5H9Flk.js} +2 -2
- package/dist/chunks/{skillLifecycle-CTVa34xO.js → skillLifecycle-EnEI14W2.js} +2 -2
- package/dist/chunks/{skillSearchPanel-CjekGkrw.js → skillSearchPanel-CSm2Eq_U.js} +2 -2
- package/dist/chunks/{skills-110JHHbj.js → skills-C69Im5ML.js} +1 -1
- package/dist/chunks/status-D2nNF67-.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-C5BRU3lw.js → statusNoticeHelpers-BHExATuY.js} +1 -1
- package/dist/chunks/{switcher-nLHGsxLw.js → switcher-BdsveDwj.js} +1 -1
- package/dist/chunks/switcher-DFyvU0Qc.js +1 -0
- package/dist/chunks/{tasks-CjYr59Ak.js → tasks-CJDAZERm.js} +1 -1
- package/dist/chunks/{templateJobs-ECX0rRRp.js → templateJobs-fCnSjC9_.js} +1 -1
- package/dist/chunks/{terminalSetup-AptBNs_i.js → terminalSetup-QvvwfSGV.js} +1 -1
- package/dist/chunks/{terminalSetup-CKO6eWhS.js → terminalSetup-h_TPZN2E.js} +1 -1
- package/dist/chunks/{theme-BCSx9irC.js → theme-B3baZuK8.js} +1 -1
- package/dist/chunks/{tipRegistry-CnQB3TaA.js → tipRegistry-devcMyyn.js} +1 -1
- package/dist/chunks/{toolEventObserver-Bqtypnkk.js → toolEventObserver-CNXN4TOt.js} +1 -1
- package/dist/chunks/{toolPool-B1sXN7SK.js → toolPool-B4XkmUDX.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-DegJrysj.js → useExitOnCtrlCDWithKeybindings-BfgcAS50.js} +1 -1
- package/dist/chunks/useMainLoopModel-CO_oa76K.js +1 -0
- package/dist/chunks/{useManagePlugins-BW2Zj_jf.js → useManagePlugins-CYUa0_Sn.js} +1 -1
- package/dist/chunks/{useMergedTools-CTm1AU9b.js → useMergedTools-By1K71LJ.js} +1 -1
- package/dist/chunks/{useSearchInput-DrY4BZKy.js → useSearchInput-C4O9vs6X.js} +1 -1
- package/dist/chunks/{useSettingsErrors-2uIAF6H8.js → useSettingsErrors-Cw8_cPbg.js} +1 -1
- package/dist/chunks/{util-BUgUtaUV.js → util-CEVuoH2G.js} +1 -1
- package/dist/chunks/{validatePlugin-BGB8T9Mb.js → validatePlugin-B7OHQSIx.js} +1 -1
- package/dist/chunks/vim-BX8ljWbJ.js +1 -0
- package/dist/chunks/worktree-C9F9fuJ9.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-45Ize2zR.js +0 -1
- package/dist/chunks/Doctor--yF3SBsD.js +0 -1
- package/dist/chunks/REPL-CjoJCy0g.js +0 -124
- package/dist/chunks/REPL-DGieTVDl.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BBhWAuoA.js +0 -1
- package/dist/chunks/backgroundHousekeeping-d0qpqWHe.js +0 -1
- package/dist/chunks/caches-he4NeZSK.js +0 -1
- package/dist/chunks/commands-BoGtXPAA.js +0 -1
- package/dist/chunks/config-B-hDBSL8.js +0 -1
- package/dist/chunks/config-DubkVeOw.js +0 -1
- package/dist/chunks/context-noninteractive-CmOFpwwP.js +0 -1
- package/dist/chunks/conversation-B7YCvyCD.js +0 -1
- package/dist/chunks/doctor-DYKr9Reu.js +0 -1
- package/dist/chunks/extractMemories-4wbv-mTc.js +0 -1
- package/dist/chunks/fast-BALHWqpd.js +0 -1
- package/dist/chunks/fetchModelList-OZ2sLDEx.js +0 -1
- package/dist/chunks/hooks-BofA8GeO.js +0 -1
- package/dist/chunks/loadAgentsDir-C-qRJlXH.js +0 -1
- package/dist/chunks/localSearch-BulDBrBk.js +0 -1
- package/dist/chunks/managedEnv-BFpXdDI8.js +0 -1
- package/dist/chunks/pluginStartupCheck-B-nYb61N.js +0 -1
- package/dist/chunks/prompt-Cpu4meqR.js +0 -1
- package/dist/chunks/prompt-HO8Docca.js +0 -1
- package/dist/chunks/sandbox-adapter-BKnsdtVj.js +0 -1
- package/dist/chunks/searchExtraTools-DV5iZPdw.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-nq8C34WL.js +0 -1
- package/dist/chunks/sessionObserver-CKp3uqPg.js +0 -1
- package/dist/chunks/sessionStorage-CuQf4d1y.js +0 -1
- package/dist/chunks/sinks-DLALCllz.js +0 -1
- package/dist/chunks/status-D_b3UMke.js +0 -1
- package/dist/chunks/switcher-BFzvv7KT.js +0 -1
- package/dist/chunks/useMainLoopModel-CPnigpM1.js +0 -1
- package/dist/chunks/vim-DdxGarvY.js +0 -1
- package/dist/chunks/worktree-DBZ7f9Lk.js +0 -1
|
@@ -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{Br as ee,Eg as d,Hh as te,Jn as ne,Nr as f,Or as re,Qr as ie,Qs as p,Rn as m,Tg as ae,Vh as h,Wh as g,Zr as oe,br as _,lb as v,my as y,nc as se,py as b,rb as x,vr 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{Br as ee,Eg as d,Hh as te,Jn as ne,Nr as f,Or as re,Qr as ie,Qs as p,Rn as m,Tg as ae,Vh as h,Wh as g,Zr as oe,br as _,lb as v,my as y,nc as se,py as b,rb as x,vr as S}from"./loadAgentsDir-izAo6rpy.js";import{o as C,s as w}from"./log-D98mO6yJ.js";import{n as T}from"./analytics-COpjZpvd.js";import{n as E}from"./conversationRecovery-CM94gKCQ.js";import{r as D,t as O}from"./Spinner-bYnSD54K.js";import{a as ce,n as le,s as ue}from"./skillChangeDetector-CrsPxCzn.js";import{t as k}from"./REPL-CJAN4D4C.js";import{a as A,i as j,n as M,o as N,r as P,t as F}from"./crossProjectResume-Cq1oZ0F6.js";import{dirname as I}from"path";var L=e(i(),1);v(),u(),N(),D(),b(),s(),x(),T(),h(),d(),j(),p(),M(),C(),S();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:h,appendSystemPrompt:v,initialSearchQuery:b,disableSlashCommands:x=!1,forkSession:S,taskListId:C,filterByPr:T,thinkingConfig:D,onTurnComplete:j}){let{rows:M}=o(),N=te(e=>e.agentDefinitions),B=g(),[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=_();L.useEffect(()=>{f(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||ne(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?re():f(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(ae(n.sessionId),e.fullPath?I(e.fullPath):null),await oe(),y(n.sessionId)):S&&n.contentReplacements?.length&&await ee(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})),se(n.agentName),ie(S?{...n,worktreeSession:void 0}:n),S||(ue(n.worktreeSession),n.sessionId&&m()),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:h,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:b,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{h_ as e,m_ as t}from"./loadAgentsDir-izAo6rpy.js";e();export{t 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-CA-5Px85.js";import{Pt as Se,at as T}from"./state-CXY-q5gr.js";import{Aa as E,Ay as Ce,DC as we,Dy as Te,EC as Ee,FC as De,Hh as D,IC as Oe,MC as O,NC as ke,Nh as k,Oa as Ae,Oy as je,Ph as Me,TC as Ne,Ty as Pe,Uh as Fe,Vh as A,Wh as Ie,_d as j,b as Le,gd as M,j as Re,jy as ze,ka as Be,ky as Ve,lb as He,nr as N,rb as Ue,vr as P}from"./loadAgentsDir-DnHL_5cU.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-Bjwat4P6.js";import{o as Xe,s as Ze}from"./log-D98mO6yJ.js";import{n as Qe}from"./analytics-COpjZpvd.js";import{_ as $e,f as L}from"./startupProfiler-C_xcIvEA.js";import{Mt as et,Pt as R,f as z,g as tt,h as nt}from"./model-C9ANf1-R.js";import{a as B,c as V,f as rt,m as it}from"./proxy-MzIsnPd7.js";import{n as at,t as ot}from"./useExitOnCtrlCDWithKeybindings-DegJrysj.js";import{n as st,t as ct}from"./TextInput-CanSwT9J.js";import{n as H,t as lt}from"./select-BpiKdirZ.js";import{i as ut,n as dt,r as ft}from"./modalContext-sU2lfR08.js";import{g as pt,h as U}from"./pidLock-CawSx6hb.js";import{n as mt,t as ht}from"./nativeInstaller-BDJxBAPV.js";import{n as gt,t as W}from"./allErrors-Bv1e8fra.js";import{t as G}from"./CustomSelect-iSG1rbWU.js";import{n as _t,t as vt}from"./ThemePicker-CXzPiSy0.js";import{i as yt,n as bt,r as xt,t as St}from"./extraUsage-cZx2XLx4.js";import{n as Ct,t as wt}from"./AgentsMdExternalIncludesDialog-CIyefOzT.js";import{t as Tt}from"./SearchBox-zA5QwIpO.js";import{n as Et,t as Dt}from"./useSearchInput-DrY4BZKy.js";function Ot(){return[]}function kt(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 At(){let e=je(await Ve()),t=[];return e.forEach(e=>{let n=pe(e.path);t.push(`Large ${n} will impact performance (${L(e.content.length)} chars > ${L(Pe)})`)}),t}function jt(){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 Mt(){return(await mt()).map(e=>e.message)}async function Nt(){let e=await U(),t=[],{errors:n}=W();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 Pt(){return[]}function Ft(){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=B();i&&t.push({label:`Proxy`,value:i});let o=rt();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 It(e){return tt(e)}var Lt=e((()=>{_(),ze(),pt(),i(),b(),$e(),z(),R(),it(),ht(),V(),gt(),ve(),S()}));function Rt(){let e=T();return[{label:`Version`,value:`0.0.30`},{label:`Session name`,value:N(e)??(0,K.jsx)(u,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:Ge()},...Pt(),...Ft()]}function zt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:It(e)},...kt(t.clients,n),...Ot(),...jt()]}async function Bt(){return[...await Mt(),...await Nt(),...await At()]}function Vt({value:e}){return Array.isArray(e)?(0,K.jsx)(l,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(u,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(u,{children:e}):e}function Ht({context:e,diagnosticsPromise:t}){let n=D(e=>e.mainLoopModel),r=D(e=>e.mcp),[i]=te(),a=Wt.useMemo(()=>[Rt(),zt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=ft()?1:void 0;return(0,K.jsxs)(l,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(l,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(l,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(l,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(u,{bold:!0,children:[e,`:`]}),(0,K.jsx)(Vt,{value:t})]},n))},t)),(0,K.jsx)(Gt.Suspense,{fallback:null,children:(0,K.jsx)(Ut,{promise:t})})]}),(0,K.jsx)(u,{dimColor:!0,children:(0,K.jsx)(M,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Ut({promise:e}){let t=(0,Gt.use)(e);return t.length===0?null:(0,K.jsxs)(l,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(u,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(l,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(u,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(u,{wrap:`wrap`,children:e}):e]},t))]})}var Wt,Gt,K,Kt=e((()=>{o(),Wt=t(f(),1),Gt=t(f(),1),Se(),dt(),_(),A(),We(),P(),Lt(),j(),K=y()}));function qt({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,Jt.jsxs)(le,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,Jt.jsxs)(u,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,Jt.jsx)(u,{dimColor:!0,children:`How would you like to handle this?`}),(0,Jt.jsx)(lt,{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 Jt,Yt=e((()=>{_(),G(),Jt=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)(()=>{Be(Ge()).then(e=>{let t=Xt(e);a(t),s(!1)}).catch(()=>{let e=Xt(Ae);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)(lt,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var Qt,q,$t,en,tn=e((()=>{Qt=t(f(),1),E(),_(),We(),H(),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)(ct,{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),_(),Ue(),st(),J=y()}));function on({onClose:e,context:t,setTabsHidden:r,onIsSearchModeChange:i,contentHeight:a}){let{headerFocused:o,focusHeader:f}=ae(),oe=ft(),[,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),Ae=ie(),{rows:je}=ce(),Pe=a??Math.min(Math.floor(je*.8),30),A=Math.max(5,Pe-10),j=D(e=>e.mainLoopModel),Le=D(e=>e.verbose),ze=D(e=>e.thinkingEnabled),Be=D(e=>De()?e.fastMode:!1);D(e=>e.promptSuggestionEnabled);let He=fe(y?.permissions?.defaultMode??`default`),N=Ie(),[Ue,P]=(0,X.useState)({}),We=Y.useRef(ze),[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,R]=(0,X.useState)(!1),[z,B]=(0,X.useState)(null),{query:V,setQuery:rt,cursorOffset:it}=Et({isActive:O&&z===null&&!o,onExit:()=>k(!1),onExitUp:f,passthroughCtrlKeys:[`c`,`d`]}),at=O&&!o;Y.useEffect(()=>{i?.(at)},[at,i]);let ot=!n(process.env.WORKMATE_DISABLE_FILE_CHECKPOINTING),st=Y.use(Ve(!0)),ct=Ce(st),H=Je();function ut(e){N(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),P(t=>{let n=tt(e)+(bt(e,!1,nt())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function dt(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 pt=[{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:ze??!0,type:`boolean`,onChange(e){N(t=>({...t,thinkingEnabled:e})),w(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1})}},...De()&&ke()?[{id:`fastMode`,label:`Fast mode (${Ne} only)`,value:!!Be,type:`boolean`,onChange(e){Ee(),w(`userSettings`,{fastMode:e?!0:void 0}),e?(N(e=>({...e,mainLoopModel:we(),mainLoopModelForSession:null,fastMode:!0})),P(e=>({...e,model:we(),"Fast mode":`ON`}))):(N(e=>({...e,fastMode:!1})),P(e=>({...e,"Fast mode":`OFF`})))}}]:[],...ot?[{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:Le,type:`boolean`,onChange:dt},{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:He,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})}},...Me()?[{id:`copyOnSelect`,label:`Copy on select`,value:g.copyOnSelect??!0,type:`boolean`,onChange(e){F(t=>({...t,copyOnSelect:e})),_({...I(),copyOnSelect:e})}}]:[],H?{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:ut},...ct?[{id:`showExternalIncludesDialog`,label:`External AGENTS.md includes`,value:Ke().hasAgentsMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[]],U=Y.useMemo(()=>{if(!V)return pt;let e=V.toLowerCase();return pt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[pt,V]);Y.useEffect(()=>{if(C>=U.length){let e=Math.max(0,U.length-1);Se(e),E(Math.max(0,e-A+1));return}E(e=>C<e?C:C>=e+A?C-A+1:e)},[U.length,C,A]);let mt=(0,X.useCallback)(e=>{E(t=>e<t?e:e>=t+A?e-A+1:t)},[A]),ht=(0,X.useCallback)(()=>{if(z!==null)return;let t=Object.entries(Ue).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`})},[z,Ue,g,j,x,S,y?.autoUpdatesChannel,De()?y?.fastMode:void 0,e]),gt=(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)(()=>{z===null&&(L.current&>(),e(`Config dialog dismissed`,{display:`system`}))},[z,gt,e]),{context:`Settings`,isActive:z===null&&!O&&!o}),re(`settings:close`,ht,{context:`Settings`,isActive:z===null&&!O&&!o});let W=(0,X.useCallback)(()=>{let e=U[C];if(e?.onChange){if(e.type===`boolean`){L.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===We.current?R(!1):t.messages.some(e=>e.type===`assistant`)&&R(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:B(`Theme`),r(!0);return;case`model`:B(`Model`),r(!0);return;case`showExternalIncludesDialog`:B(`ExternalIncludes`),r(!0);return;case`outputStyle`:B(`OutputStyle`),r(!0);return;case`language`:B(`Language`),r(!0);return}if(e.id===`autoUpdatesChannel`){if(H){B(`EnableAutoUpdates`),r(!0);return}(y?.autoUpdatesChannel??`latest`)===`latest`?(B(`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}}},[H,U,C,y?.autoUpdatesChannel,r]),G=e=>{R(!1);let t=Math.max(0,Math.min(U.length-1,C+e));Se(t),mt(t)};return ee({"select:previous":()=>{C===0?(R(!1),k(!0),E(0)):G(-1)},"select:next":()=>G(1),"scroll:lineUp":()=>G(-1),"scroll:lineDown":()=>G(1),"select:accept":W,"select:previousValue":()=>W(),"select:nextValue":()=>W(),"settings:search":()=>{k(!0),rt(``)}},{context:`Settings`,isActive:z===null&&!O&&!o}),(0,Z.jsx)(l,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(z===null&&!o){if(O){if(e.key===`escape`){e.preventDefault(),V.length>0?rt(``):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(),W();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),k(!0),rt(e.key))}},[z,o,O,V,rt,W]),children:z===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(vt,{onThemeSelect:e=>{L.current=!0,m(e),B(null),r(!1)},onCancel:()=>{B(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`})]})})})]}):z===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(xt,{initial:j,onSelect:e=>{L.current=!0,ut(e),B(null),r(!1)},onCancel:()=>{B(null),r(!1)},showFastModeNotice:De()?Be&&Oe(j)&&ke():!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`})]})})]}):z===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wt,{onDone:()=>{B(null),r(!1)},externalIncludes:Te(st)}),(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`})]})})]}):z===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Zt,{initialStyle:x,onComplete:e=>{L.current=!0,ge(e??`default`),B(null),r(!1),w(`localSettings`,{outputStyle:e})},onCancel:()=>{B(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`})]})})]}):z===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(nn,{initialLanguage:S,onComplete:e=>{L.current=!0,ve(e),B(null),r(!1),w(`userSettings`,{language:e})},onCancel:()=>{B(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`})]})})]}):z===`EnableAutoUpdates`?(0,Z.jsx)(le,{title:`Enable Auto-Updates`,onCancel:()=>{B(null),r(!1)},hideBorder:!0,hideInputGuide:!0,children:H?.type===`config`?(0,Z.jsx)(lt,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{L.current=!0,B(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:H?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),H?.type===`env`&&(0,Z.jsxs)(u,{dimColor:!0,children:[`Unset `,H.envVar,` to re-enable auto-updates.`]})]})}):z===`ChannelDowngrade`?(0,Z.jsx)(qt,{currentVersion:`0.0.30`,onChoice:e=>{if(B(null),r(!1),e===`cancel`)return;L.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.30`),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:V,isFocused:O&&!o,isTerminalFocused:Ae,cursorOffset:it,placeholder:`Search settings…`}),(0,Z.jsx)(l,{flexDirection:`column`,children:U.length===0?(0,Z.jsxs)(u,{dimColor:!0,italic:!0,children:[`No settings match "`,V,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[T>0&&(0,Z.jsxs)(u,{dimColor:!0,children:[s.arrowUp,` `,T,` more above`]}),U.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`&&H?(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(H),`)`]})]}):(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),T+A<U.length&&(0,Z.jsxs)(u,{dimColor:!0,children:[s.arrowDown,` `,U.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),Ue(),o(),qe(),oe(),x(),Le(),Xe(),Qe(),_t(),A(),yt(),z(),St(),Ct(),Yt(),G(),tn(),an(),ze(),j(),dt(),Tt(),S(),E(),i(),Dt(),He(),O(),k(),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=ft(),{rows:te}=ut(ce()),l=ee?te+1:Math.max(15,Math.min(Math.floor(te*.8),30)),[u]=(0,Q.useState)(()=>Bt().catch(()=>[]));return at(),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)(Ht,{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),Ue(),ot(),He(),dt(),_(),Kt(),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-CA-5Px85.js";import{Pt as Se,at as T}from"./state-CXY-q5gr.js";import{Aa as E,Ay as Ce,DC as we,Dy as Te,EC as Ee,FC as De,Hh as D,IC as Oe,MC as O,NC as ke,Nh as k,Oa as Ae,Oy as je,Ph as Me,TC as Ne,Ty as Pe,Uh as Fe,Vh as A,Wh as Ie,_d as j,b as Le,gd as M,j as Re,jy as ze,ka as Be,ky as Ve,lb as He,nr as N,rb as Ue,vr as P}from"./loadAgentsDir-izAo6rpy.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-CMtnYZR9.js";import{o as Xe,s as Ze}from"./log-D98mO6yJ.js";import{n as Qe}from"./analytics-COpjZpvd.js";import{_ as $e,f as L}from"./startupProfiler-C_xcIvEA.js";import{Mt as et,Pt as R,f as z,g as tt,h as nt}from"./model-cu29eOoS.js";import{a as B,c as V,f as rt,m as it}from"./proxy-MzIsnPd7.js";import{n as at,t as ot}from"./useExitOnCtrlCDWithKeybindings-BfgcAS50.js";import{n as st,t as ct}from"./TextInput-DJaXm3Y2.js";import{n as H,t as lt}from"./select-CPlgmbIJ.js";import{i as ut,n as dt,r as ft}from"./modalContext-sU2lfR08.js";import{g as pt,h as U}from"./pidLock-Bn9y7GMY.js";import{n as mt,t as ht}from"./nativeInstaller-oMsFvcUC.js";import{n as gt,t as W}from"./allErrors-BlYbbyyw.js";import{t as G}from"./CustomSelect-C1eyA6Kb.js";import{n as _t,t as vt}from"./ThemePicker-DTRkcYKg.js";import{i as yt,n as bt,r as xt,t as St}from"./extraUsage-CnQUVxGf.js";import{n as Ct,t as wt}from"./AgentsMdExternalIncludesDialog-DgfH_qbT.js";import{t as Tt}from"./SearchBox-zA5QwIpO.js";import{n as Et,t as Dt}from"./useSearchInput-C4O9vs6X.js";function Ot(){return[]}function kt(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 At(){let e=je(await Ve()),t=[];return e.forEach(e=>{let n=pe(e.path);t.push(`Large ${n} will impact performance (${L(e.content.length)} chars > ${L(Pe)})`)}),t}function jt(){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 Mt(){return(await mt()).map(e=>e.message)}async function Nt(){let e=await U(),t=[],{errors:n}=W();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 Pt(){return[]}function Ft(){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=B();i&&t.push({label:`Proxy`,value:i});let o=rt();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 It(e){return tt(e)}var Lt=e((()=>{_(),ze(),pt(),i(),b(),$e(),z(),R(),it(),ht(),V(),gt(),ve(),S()}));function Rt(){let e=T();return[{label:`Version`,value:`0.0.32`},{label:`Session name`,value:N(e)??(0,K.jsx)(u,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:Ge()},...Pt(),...Ft()]}function zt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:It(e)},...kt(t.clients,n),...Ot(),...jt()]}async function Bt(){return[...await Mt(),...await Nt(),...await At()]}function Vt({value:e}){return Array.isArray(e)?(0,K.jsx)(l,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(u,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(u,{children:e}):e}function Ht({context:e,diagnosticsPromise:t}){let n=D(e=>e.mainLoopModel),r=D(e=>e.mcp),[i]=te(),a=Wt.useMemo(()=>[Rt(),zt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=ft()?1:void 0;return(0,K.jsxs)(l,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(l,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(l,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(l,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(u,{bold:!0,children:[e,`:`]}),(0,K.jsx)(Vt,{value:t})]},n))},t)),(0,K.jsx)(Gt.Suspense,{fallback:null,children:(0,K.jsx)(Ut,{promise:t})})]}),(0,K.jsx)(u,{dimColor:!0,children:(0,K.jsx)(M,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Ut({promise:e}){let t=(0,Gt.use)(e);return t.length===0?null:(0,K.jsxs)(l,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(u,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(l,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(u,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(u,{wrap:`wrap`,children:e}):e]},t))]})}var Wt,Gt,K,Kt=e((()=>{o(),Wt=t(f(),1),Gt=t(f(),1),Se(),dt(),_(),A(),We(),P(),Lt(),j(),K=y()}));function qt({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,Jt.jsxs)(le,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,Jt.jsxs)(u,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,Jt.jsx)(u,{dimColor:!0,children:`How would you like to handle this?`}),(0,Jt.jsx)(lt,{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 Jt,Yt=e((()=>{_(),G(),Jt=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)(()=>{Be(Ge()).then(e=>{let t=Xt(e);a(t),s(!1)}).catch(()=>{let e=Xt(Ae);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)(lt,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var Qt,q,$t,en,tn=e((()=>{Qt=t(f(),1),E(),_(),We(),H(),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)(ct,{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),_(),Ue(),st(),J=y()}));function on({onClose:e,context:t,setTabsHidden:r,onIsSearchModeChange:i,contentHeight:a}){let{headerFocused:o,focusHeader:f}=ae(),oe=ft(),[,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),Ae=ie(),{rows:je}=ce(),Pe=a??Math.min(Math.floor(je*.8),30),A=Math.max(5,Pe-10),j=D(e=>e.mainLoopModel),Le=D(e=>e.verbose),ze=D(e=>e.thinkingEnabled),Be=D(e=>De()?e.fastMode:!1);D(e=>e.promptSuggestionEnabled);let He=fe(y?.permissions?.defaultMode??`default`),N=Ie(),[Ue,P]=(0,X.useState)({}),We=Y.useRef(ze),[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,R]=(0,X.useState)(!1),[z,B]=(0,X.useState)(null),{query:V,setQuery:rt,cursorOffset:it}=Et({isActive:O&&z===null&&!o,onExit:()=>k(!1),onExitUp:f,passthroughCtrlKeys:[`c`,`d`]}),at=O&&!o;Y.useEffect(()=>{i?.(at)},[at,i]);let ot=!n(process.env.WORKMATE_DISABLE_FILE_CHECKPOINTING),st=Y.use(Ve(!0)),ct=Ce(st),H=Je();function ut(e){N(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),P(t=>{let n=tt(e)+(bt(e,!1,nt())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function dt(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 pt=[{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:ze??!0,type:`boolean`,onChange(e){N(t=>({...t,thinkingEnabled:e})),w(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1})}},...De()&&ke()?[{id:`fastMode`,label:`Fast mode (${Ne} only)`,value:!!Be,type:`boolean`,onChange(e){Ee(),w(`userSettings`,{fastMode:e?!0:void 0}),e?(N(e=>({...e,mainLoopModel:we(),mainLoopModelForSession:null,fastMode:!0})),P(e=>({...e,model:we(),"Fast mode":`ON`}))):(N(e=>({...e,fastMode:!1})),P(e=>({...e,"Fast mode":`OFF`})))}}]:[],...ot?[{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:Le,type:`boolean`,onChange:dt},{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:He,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})}},...Me()?[{id:`copyOnSelect`,label:`Copy on select`,value:g.copyOnSelect??!0,type:`boolean`,onChange(e){F(t=>({...t,copyOnSelect:e})),_({...I(),copyOnSelect:e})}}]:[],H?{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??`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:ut},...ct?[{id:`showExternalIncludesDialog`,label:`External AGENTS.md includes`,value:Ke().hasAgentsMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[]],U=Y.useMemo(()=>{if(!V)return pt;let e=V.toLowerCase();return pt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[pt,V]);Y.useEffect(()=>{if(C>=U.length){let e=Math.max(0,U.length-1);Se(e),E(Math.max(0,e-A+1));return}E(e=>C<e?C:C>=e+A?C-A+1:e)},[U.length,C,A]);let mt=(0,X.useCallback)(e=>{E(t=>e<t?e:e>=t+A?e-A+1:t)},[A]),ht=(0,X.useCallback)(()=>{if(z!==null)return;let t=Object.entries(Ue).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||`normal`)}`),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`})},[z,Ue,g,j,x,S,y?.autoUpdatesChannel,De()?y?.fastMode:void 0,e]),gt=(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)(()=>{z===null&&(L.current&>(),e(`Config dialog dismissed`,{display:`system`}))},[z,gt,e]),{context:`Settings`,isActive:z===null&&!O&&!o}),re(`settings:close`,ht,{context:`Settings`,isActive:z===null&&!O&&!o});let W=(0,X.useCallback)(()=>{let e=U[C];if(e?.onChange){if(e.type===`boolean`){L.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===We.current?R(!1):t.messages.some(e=>e.type===`assistant`)&&R(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:B(`Theme`),r(!0);return;case`model`:B(`Model`),r(!0);return;case`showExternalIncludesDialog`:B(`ExternalIncludes`),r(!0);return;case`outputStyle`:B(`OutputStyle`),r(!0);return;case`language`:B(`Language`),r(!0);return}if(e.id===`autoUpdatesChannel`){if(H){B(`EnableAutoUpdates`),r(!0);return}(y?.autoUpdatesChannel??`latest`)===`latest`?(B(`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}}},[H,U,C,y?.autoUpdatesChannel,r]),G=e=>{R(!1);let t=Math.max(0,Math.min(U.length-1,C+e));Se(t),mt(t)};return ee({"select:previous":()=>{C===0?(R(!1),k(!0),E(0)):G(-1)},"select:next":()=>G(1),"scroll:lineUp":()=>G(-1),"scroll:lineDown":()=>G(1),"select:accept":W,"select:previousValue":()=>W(),"select:nextValue":()=>W(),"settings:search":()=>{k(!0),rt(``)}},{context:`Settings`,isActive:z===null&&!O&&!o}),(0,Z.jsx)(l,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(z===null&&!o){if(O){if(e.key===`escape`){e.preventDefault(),V.length>0?rt(``):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(),W();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),k(!0),rt(e.key))}},[z,o,O,V,rt,W]),children:z===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(vt,{onThemeSelect:e=>{L.current=!0,m(e),B(null),r(!1)},onCancel:()=>{B(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`})]})})})]}):z===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(xt,{initial:j,onSelect:e=>{L.current=!0,ut(e),B(null),r(!1)},onCancel:()=>{B(null),r(!1)},showFastModeNotice:De()?Be&&Oe(j)&&ke():!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`})]})})]}):z===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wt,{onDone:()=>{B(null),r(!1)},externalIncludes:Te(st)}),(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`})]})})]}):z===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Zt,{initialStyle:x,onComplete:e=>{L.current=!0,ge(e??`default`),B(null),r(!1),w(`localSettings`,{outputStyle:e})},onCancel:()=>{B(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`})]})})]}):z===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(nn,{initialLanguage:S,onComplete:e=>{L.current=!0,ve(e),B(null),r(!1),w(`userSettings`,{language:e})},onCancel:()=>{B(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`})]})})]}):z===`EnableAutoUpdates`?(0,Z.jsx)(le,{title:`Enable Auto-Updates`,onCancel:()=>{B(null),r(!1)},hideBorder:!0,hideInputGuide:!0,children:H?.type===`config`?(0,Z.jsx)(lt,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{L.current=!0,B(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:H?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),H?.type===`env`&&(0,Z.jsxs)(u,{dimColor:!0,children:[`Unset `,H.envVar,` to re-enable auto-updates.`]})]})}):z===`ChannelDowngrade`?(0,Z.jsx)(qt,{currentVersion:`0.0.32`,onChoice:e=>{if(B(null),r(!1),e===`cancel`)return;L.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.32`),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:V,isFocused:O&&!o,isTerminalFocused:Ae,cursorOffset:it,placeholder:`Search settings…`}),(0,Z.jsx)(l,{flexDirection:`column`,children:U.length===0?(0,Z.jsxs)(u,{dimColor:!0,italic:!0,children:[`No settings match "`,V,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[T>0&&(0,Z.jsxs)(u,{dimColor:!0,children:[s.arrowUp,` `,T,` more above`]}),U.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`&&H?(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(H),`)`]})]}):(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),T+A<U.length&&(0,Z.jsxs)(u,{dimColor:!0,children:[s.arrowDown,` `,U.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),Ue(),o(),qe(),oe(),x(),Le(),Xe(),Qe(),_t(),A(),yt(),z(),St(),Ct(),Yt(),G(),tn(),an(),ze(),j(),dt(),Tt(),S(),E(),i(),Dt(),He(),O(),k(),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=ft(),{rows:te}=ut(ce()),l=ee?te+1:Math.max(15,Math.min(Math.floor(te*.8),30)),[u]=(0,Q.useState)(()=>Bt().catch(()=>[]));return at(),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)(Ht,{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),Ue(),ot(),He(),dt(),_(),Kt(),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-CA-5Px85.js";import{Gn as ne,Kn as re,Pt as O,m as k}from"./state-CXY-q5gr.js";import{By as ie,Fy as ae,Gy as oe,Hh as A,Iy as j,Ky as se,Lh as ce,Ly as le,Py as ue,Rh as de,Ry as fe,Vh as M,Wh as pe,gC as me,gs as he,hC as ge,hs as _e,lb as N,zy as P}from"./loadAgentsDir-DnHL_5cU.js";import{d as ve,o as ye}from"./config-Bjwat4P6.js";import{n as be,o as xe}from"./intl-D2kgJmX7.js";import{S as Se,_ as Ce,f as we,l as Te}from"./startupProfiler-C_xcIvEA.js";import{o as Ee}from"./TextInput-CanSwT9J.js";import{a as De,c as Oe,l as ke,n as Ae,o as je,r as Me,s as Ne,t as Pe,u as Fe}from"./SpinnerGlyph-4aVLQdJf.js";import{watch as Ie}from"fs";var Le,Re,ze=e((()=>{O(),n(),Le=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(Le,`instance`,null),Re=Le.getInstance()}));function Be(){let e=D().spinnerVerbs;return e?e.mode===`replace`?e.verbs.length>0?e.verbs:Ve:[...Ve,...e.verbs]:Ve}var Ve,He=e((()=>{te(),Ve=`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 F(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 Ue({tasks:e,isStandalone:t=!1}){let[,n]=Ke.useState(0),{rows:r,columns:i}=ee(),a=Ke.useRef(new Map),o=Ke.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,Ke.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]),!le()||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(F),n.sort(F);let r=e.filter(e=>e.status===`in_progress`).sort(F),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))?F(e,t):n?1:-1}),o=[...t,...r,...i,...n];h=o.slice(0,s),g=o.slice(s)}else h=[...e].sort(F),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)(Ge,{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 We(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 Ge({task:e,openBlockers:t,columns:n}){let r=e.status===`completed`,i=e.status===`in_progress`,a=t.length>0,{icon:o,color:s}=We(e.status),c=Math.max(15,n-15),l=Se(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 Ke,I,qe,Je=e((()=>{m(),Ke=t(x(),1),N(),C(),T(),Ce(),j(),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,Ie(e,l(J,this))),l(z,this).unref()}catch{}}}function Ze(e){d(V,this,null);let t=ue();t===e&&fe(t).then(async e=>{e.length>0&&e.every(e=>e.status===`completed`)&&(await ie(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=le()?et():null;return(0,rt.useSyncExternalStore)(e?e.subscribe:ft,e?e.getSnapshot:pt)}function nt(){let e=tt(),t=pe(),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),M(),re(),j(),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,P(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,ae(e));let t=(await fe(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(),Fe(),w()}));function gt({message:e,mode:t,messageColor:n,glimmerIndex:r,flashOpacity:i,shimmerColor:a,stalledIntensity:o=0}){let[s]=_(),c=ke(s),{segments:l,messageWidth:u}=_t.useMemo(()=>{let t=[];for(let{segment:n}of be().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?Ne(t):null;if(r){let t=Oe(je(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?Ne(t):null,s=r?Ne(r):null;return o&&s?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{color:Oe(je(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(),xe(),Fe(),De(),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(),Ee(),Ae(),St(),wt(),De()}));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 j=A.current,se=Math.round(j/4),ce=Te(T),le=g(ce),ue=se+m,de=we(ue),fe=g(`${h.arrowDown} ${de} tokens`),M=x===`thinking`?`thinking`:typeof x==`number`?`thought for ${Math.max(1,Math.round(x/1e3))}s`:null,pe=M?g(M):0,me=O+2,he=kt,ge=x!==null,_e=f||T>jt,N=p-me-5,P=ge&&N>pe;!P&&ge&&x===`thinking`&&N>At&&(M=`thinking`,pe=At,P=!0);let ve=P?pe+he:0,ye=_e&&N>ve+le,be=ve+(ye?le+he:0),xe=_e&&ue>0&&N>be+fe,Se=P&&x===`thinking`&&!d&&!ye&&!xe&&!0,Ce=(C-Pt)/1e3,Ee=C<Pt?0:(Math.sin(Ce*Math.PI*2/Ft)+1)/2,De=Oe(je(Mt,Nt,Ee)),ke=[...d?[(0,Z.jsx)(y,{dimColor:!0,children:d},`suffix`)]:[],...ye?[(0,Z.jsx)(y,{dimColor:!0,children:ce},`elapsedTime`)]:[],...xe?[(0,Z.jsxs)(v,{flexDirection:`row`,children:[(0,Z.jsx)(Dt,{mode:e}),(0,Z.jsxs)(y,{dimColor:!0,children:[de,` tokens`]})]},`tokens`)]:[],...P&&M?[x===`thinking`&&!t?(0,Z.jsx)(y,{color:De,children:Se?`(${M})`:M},`thinking`):(0,Z.jsx)(y,{dimColor:!0,children:M},`thinking`)]:[]],Ae=ke.length>0?Se?(0,Z.jsx)(b,{children:ke}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(y,{dimColor:!0,children:`(`}),(0,Z.jsx)(b,{children:ke}),(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)(Pe,{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}),Ae]})}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(),Ce(),yt(),Ae(),wt(),De(),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=de(),m=p.prefersReducedMotion??!1,h=A(e=>e.tasks),g=A(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)(()=>me(Be())),te=`${c??w?.activeForm??w?.subject??E}…`;(0,Q.useEffect)(()=>{let t=`spinner-${e}`;return Re.startCLIActivity(t),()=>{Re.endCLIActivity(t)}},[e]);let D=0;for(let e of Object.values(h))e.status===`running`&&he(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,ie=k&&ne>18e5,ae=k&&ne>3e4&&!ye().btwUseCount,j=ie&&!T?`Use /clear to start fresh when switching topics and free up context`:ae&&!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)(oe,{children:(0,$.jsx)(Ue,{tasks:b})})}):T||j?(0,$.jsxs)(v,{width:`100%`,flexDirection:`column`,children:[null,(T||j)&&(0,$.jsx)(oe,{children:(0,$.jsx)(y,{dimColor:!0,children:T?`Next: ${T.subject}`:`Tip: ${j}`})})]}):null]})}function zt(){let e=de().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),ge(),Ce(),ze(),He(),se(),Je(),mt(),M(),N(),Tt(),It(),ce(),_e(),O(),ve(),$=w(),Vt=Me(),Ht=[...Vt,...[...Vt].reverse()]}));export{bt as a,nt as c,Re as d,ze as f,St as i,Ue 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-CA-5Px85.js";import{Gn as ne,Kn as re,Pt as O,m as k}from"./state-CXY-q5gr.js";import{By as ie,Fy as ae,Gy as oe,Hh as A,Iy as j,Ky as se,Lh as ce,Ly as le,Py as ue,Rh as de,Ry as fe,Vh as M,Wh as pe,gC as me,gs as he,hC as ge,hs as _e,lb as N,zy as P}from"./loadAgentsDir-izAo6rpy.js";import{d as ve,o as ye}from"./config-CMtnYZR9.js";import{n as be,o as xe}from"./intl-D2kgJmX7.js";import{S as Se,_ as Ce,f as we,l as Te}from"./startupProfiler-C_xcIvEA.js";import{o as Ee}from"./TextInput-DJaXm3Y2.js";import{a as De,c as Oe,l as ke,n as Ae,o as je,r as Me,s as Ne,t as Pe,u as Fe}from"./SpinnerGlyph-4aVLQdJf.js";import{watch as Ie}from"fs";var Le,Re,ze=e((()=>{O(),n(),Le=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(Le,`instance`,null),Re=Le.getInstance()}));function Be(){let e=D().spinnerVerbs;return e?e.mode===`replace`?e.verbs.length>0?e.verbs:Ve:[...Ve,...e.verbs]:Ve}var Ve,He=e((()=>{te(),Ve=`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 F(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 Ue({tasks:e,isStandalone:t=!1}){let[,n]=Ke.useState(0),{rows:r,columns:i}=ee(),a=Ke.useRef(new Map),o=Ke.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,Ke.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]),!le()||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(F),n.sort(F);let r=e.filter(e=>e.status===`in_progress`).sort(F),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))?F(e,t):n?1:-1}),o=[...t,...r,...i,...n];h=o.slice(0,s),g=o.slice(s)}else h=[...e].sort(F),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)(Ge,{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 We(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 Ge({task:e,openBlockers:t,columns:n}){let r=e.status===`completed`,i=e.status===`in_progress`,a=t.length>0,{icon:o,color:s}=We(e.status),c=Math.max(15,n-15),l=Se(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 Ke,I,qe,Je=e((()=>{m(),Ke=t(x(),1),N(),C(),T(),Ce(),j(),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,Ie(e,l(J,this))),l(z,this).unref()}catch{}}}function Ze(e){d(V,this,null);let t=ue();t===e&&fe(t).then(async e=>{e.length>0&&e.every(e=>e.status===`completed`)&&(await ie(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=le()?et():null;return(0,rt.useSyncExternalStore)(e?e.subscribe:ft,e?e.getSnapshot:pt)}function nt(){let e=tt(),t=pe(),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),M(),re(),j(),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,P(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,ae(e));let t=(await fe(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(),Fe(),w()}));function gt({message:e,mode:t,messageColor:n,glimmerIndex:r,flashOpacity:i,shimmerColor:a,stalledIntensity:o=0}){let[s]=_(),c=ke(s),{segments:l,messageWidth:u}=_t.useMemo(()=>{let t=[];for(let{segment:n}of be().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?Ne(t):null;if(r){let t=Oe(je(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?Ne(t):null,s=r?Ne(r):null;return o&&s?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{color:Oe(je(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(),xe(),Fe(),De(),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(),Ee(),Ae(),St(),wt(),De()}));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 j=A.current,se=Math.round(j/4),ce=Te(T),le=g(ce),ue=se+m,de=we(ue),fe=g(`${h.arrowDown} ${de} tokens`),M=x===`thinking`?`thinking`:typeof x==`number`?`thought for ${Math.max(1,Math.round(x/1e3))}s`:null,pe=M?g(M):0,me=O+2,he=kt,ge=x!==null,_e=f||T>jt,N=p-me-5,P=ge&&N>pe;!P&&ge&&x===`thinking`&&N>At&&(M=`thinking`,pe=At,P=!0);let ve=P?pe+he:0,ye=_e&&N>ve+le,be=ve+(ye?le+he:0),xe=_e&&ue>0&&N>be+fe,Se=P&&x===`thinking`&&!d&&!ye&&!xe&&!0,Ce=(C-Pt)/1e3,Ee=C<Pt?0:(Math.sin(Ce*Math.PI*2/Ft)+1)/2,De=Oe(je(Mt,Nt,Ee)),ke=[...d?[(0,Z.jsx)(y,{dimColor:!0,children:d},`suffix`)]:[],...ye?[(0,Z.jsx)(y,{dimColor:!0,children:ce},`elapsedTime`)]:[],...xe?[(0,Z.jsxs)(v,{flexDirection:`row`,children:[(0,Z.jsx)(Dt,{mode:e}),(0,Z.jsxs)(y,{dimColor:!0,children:[de,` tokens`]})]},`tokens`)]:[],...P&&M?[x===`thinking`&&!t?(0,Z.jsx)(y,{color:De,children:Se?`(${M})`:M},`thinking`):(0,Z.jsx)(y,{dimColor:!0,children:M},`thinking`)]:[]],Ae=ke.length>0?Se?(0,Z.jsx)(b,{children:ke}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(y,{dimColor:!0,children:`(`}),(0,Z.jsx)(b,{children:ke}),(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)(Pe,{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}),Ae]})}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(),Ce(),yt(),Ae(),wt(),De(),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=de(),m=p.prefersReducedMotion??!1,h=A(e=>e.tasks),g=A(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)(()=>me(Be())),te=`${c??w?.activeForm??w?.subject??E}…`;(0,Q.useEffect)(()=>{let t=`spinner-${e}`;return Re.startCLIActivity(t),()=>{Re.endCLIActivity(t)}},[e]);let D=0;for(let e of Object.values(h))e.status===`running`&&he(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,ie=k&&ne>18e5,ae=k&&ne>3e4&&!ye().btwUseCount,j=ie&&!T?`Use /clear to start fresh when switching topics and free up context`:ae&&!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)(oe,{children:(0,$.jsx)(Ue,{tasks:b})})}):T||j?(0,$.jsxs)(v,{width:`100%`,flexDirection:`column`,children:[null,(T||j)&&(0,$.jsx)(oe,{children:(0,$.jsx)(y,{dimColor:!0,children:T?`Next: ${T.subject}`:`Tip: ${j}`})})]}):null]})}function zt(){let e=de().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),ge(),Ce(),ze(),He(),se(),Je(),mt(),M(),N(),Tt(),It(),ce(),_e(),O(),ve(),$=w(),Vt=Me(),Ht=[...Vt,...[...Vt].reverse()]}));export{bt as a,nt as c,Re as d,ze as f,St as i,Ue 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-CA-5Px85.js";import{Gb as oe,Jb as se,Lh as ce,Nh as le,Ph as ue,Rh as de,Wb as fe,Xb as pe,Yb as me,cb as he,qb as k,sb 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-CA-5Px85.js";import{Gb as oe,Jb as se,Lh as ce,Nh as le,Ph as ue,Rh as de,Wb as fe,Xb as pe,Yb as me,cb as he,qb as k,sb as ge}from"./loadAgentsDir-izAo6rpy.js";import{c as _e,f as ve,i as ye,u as A}from"./debug-NBJH_NxR.js";import{r as j,t as M}from"./execa-CBhG1doD.js";import{o as be,s as N}from"./log-D98mO6yJ.js";import{i as xe,n as Se}from"./execFileNoThrow-7Ys9mO27.js";import{i as Ce,o as we}from"./bundledMode-Dqe4pz0a.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-ClFVMgnt.js";import{t as Ae}from"./useDoublePress-zA5QwIpO.js";import{i as je,o as Me}from"./terminalSetup-h_TPZN2E.js";import{s as Ne,t as Pe}from"./history-PZLMYab7.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 se())(n).png().toBuffer());let r=await k(n,n.length,`png`),i=r.buffer.toString(`base64`),a=fe(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 se())(r).png().toBuffer());let i=ze(n).slice(1).toLowerCase()||`png`,a=await k(r,r.length,i),o=a.buffer.toString(`base64`);return{path:n,base64:o,mediaType:fe(o),dimensions:a.dimensions}}var L,Xe=t((()=>{j(),pe(),me(),ye(),xe(),ve(),oe(),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 · ${ge(`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-CA-5Px85.js";import{Ch as h,Dh as g,Hh as _,Oh as v,Vh as y,Wh as b,ab as x,gi as S,ib as C,kh as w,lb as T,ob as E,rb as D,vi as O,wh 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-CA-5Px85.js";import{Ch as h,Dh as g,Hh as _,Oh as v,Vh as y,Wh as b,ab as x,gi as S,ib as C,kh as w,lb as T,ob as E,rb as D,vi as O,wh as k}from"./loadAgentsDir-izAo6rpy.js";import{n as A,t as j}from"./useExitOnCtrlCDWithKeybindings-BfgcAS50.js";import{t as M}from"./select-CPlgmbIJ.js";import{t as N}from"./CustomSelect-C1eyA6Kb.js";function P({onThemeSelect:e,showIntroText:d=!1,helpText:f=``,showHelpTextBelow:p=!1,hideEscToCancel:y=!1,skipExitHandling:C=!1,onCancel:w}){let[T]=n(),E=o(),{columns:D}=u(),O=g(),k=O===null?v(T):null,{setPreviewTheme:j,savePreview:N,cancelPreview:P}=s(),I=_(e=>e.settings.syntaxHighlightingDisabled)??!1,L=b();l(`ThemePicker`);let R=x(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);c(`theme:toggleSyntaxHighlighting`,()=>{if(O===null){let e=!I;m(`userSettings`,{syntaxHighlightingDisabled:e}),L(t=>({...t,settings:{...t.settings,syntaxHighlightingDisabled:e}}))}},{context:`ThemePicker`});let z=A(C?()=>{}: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:C?()=>{P(),w?.()}:async()=>{P(),await S(0)},visibleOptionCount:B.length,defaultValue:E,defaultFocusValue:E})]}),(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)(h,{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:D})}),(0,F.jsxs)(i,{dimColor:!0,children:[` `,O===`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})}),!y&&(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(),T(),d(),E(),D(),C(),y(),O(),p(),N(),w(),k(),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-CA-5Px85.js";import{In as l,Pt as u}from"./state-CXY-q5gr.js";import{Rg as d,_i as f,ff as p,rb as m,uf as h,vi as g,zg 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-CA-5Px85.js";import{In as l,Pt as u}from"./state-CXY-q5gr.js";import{Rg as d,_i as f,ff as p,rb as m,uf as h,vi as g,zg as _}from"./loadAgentsDir-izAo6rpy.js";import{n as v,t as y}from"./cwd-DrEEb4f5.js";import{f as b,u as x}from"./debug-NBJH_NxR.js";import{d as S,m as C,t as w}from"./config-CMtnYZR9.js";import{n as T}from"./analytics-COpjZpvd.js";import{in as E}from"./prompt-B4rM4cgp.js";import{n as D,t as O}from"./useExitOnCtrlCDWithKeybindings-BfgcAS50.js";import{t as k}from"./select-CPlgmbIJ.js";import{t as A}from"./CustomSelect-C1eyA6Kb.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(),m(),p(),g(),O(),A(),j(),s(),E(),N(),_();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}=h(`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,p=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||p,g=w(),[_,v]=I.useState(null);I.useEffect(()=>{if(_!==null){let e=_,t=setTimeout(()=>f(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-CMtnYZR9.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{SC as r,xC 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{SC as r,xC as i}from"./loadAgentsDir-izAo6rpy.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,Fg as h,Gy as g,Ky as _,N as v,P as y,Pg as b,jg as x,lC 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,Fg as h,Gy as g,Ky as _,N as v,P as y,Pg as b,jg as x,lC as S,sC as C}from"./loadAgentsDir-izAo6rpy.js";import{n as w,t as T}from"./AddWorkspaceDirectory-vexJPqPV.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)(g,{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=x(t.getAppState().toolPermissionContext,i);t.setAppState(e=>({...e,toolPermissionContext:a}));let o=f();o.includes(n)||p([...o,n]),C.refreshConfig();let c;if(r)try{h(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=v(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(),_(),w(),l(),b(),S(),y(),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-CA-5Px85.js";import{Mp as r,jp as i}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{mn as t,pn as n}from"./settings-CA-5Px85.js";import{Mp as r,jp as i}from"./loadAgentsDir-izAo6rpy.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-izAo6rpy.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-CouNgts6.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-CA-5Px85.js";import{hr as ie,mr as ae}from"./state-CXY-q5gr.js";import{Ap as oe,Bl as se,Bm as ce,Cp as le,Df as ue,Dl as de,Dm as fe,Ef as pe,El as me,Fm as he,Fu as ge,Hh as _e,Hv as ve,Hy as ye,Im as be,L_ as xe,Mp as Se,Mu as Ce,Nm as we,Nu as Te,Oc as Ee,Of as De,Ol as Oe,Om as ke,Pm as Ae,Pu as je,Q as Me,R_ as Ne,Sp as Pe,Tf as Fe,Tp as Ie,Vh as Le,Vl as Re,Vm as ze,Vv as Be,Vy as Ve,Wh as He,Xi as Ue,_d as w,bp as We,c as Ge,dd as Ke,et as qe,fa as Je,gd as T,gw as Ye,hw as Xe,it as Ze,kc as Qe,kl as $e,kp as et,l as tt,mw as nt,nf as rt,nt as it,o as at,pd as ot,qS as st,r as ct,rb as E,ry as lt,s as ut,t as dt,tS as ft,tf as pt,vm as mt,vp as ht,wp as gt,xp as _t,ym as vt,yp 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-CA-5Px85.js";import{hr as ie,mr as ae}from"./state-CXY-q5gr.js";import{Ap as oe,Bl as se,Bm as ce,Cp as le,Df as ue,Dl as de,Dm as fe,Ef as pe,El as me,Fm as he,Fu as ge,Hh as _e,Hv as ve,Hy as ye,Im as be,L_ as xe,Mp as Se,Mu as Ce,Nm as we,Nu as Te,Oc as Ee,Of as De,Ol as Oe,Om as ke,Pm as Ae,Pu as je,Q as Me,R_ as Ne,Sp as Pe,Tf as Fe,Tp as Ie,Vh as Le,Vl as Re,Vm as ze,Vv as Be,Vy as Ve,Wh as He,Xi as Ue,_d as w,bp as We,c as Ge,dd as Ke,et as qe,fa as Je,gd as T,gw as Ye,hw as Xe,it as Ze,kc as Qe,kl as $e,kp as et,l as tt,mw as nt,nf as rt,nt as it,o as at,pd as ot,qS as st,r as ct,rb as E,ry as lt,s as ut,t as dt,tS as ft,tf as pt,vm as mt,vp as ht,wp as gt,xp as _t,ym as vt,yp as yt}from"./loadAgentsDir-izAo6rpy.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-NBJH_NxR.js";import{C as kt,T as At}from"./config-CMtnYZR9.js";import{o as jt,s as Mt}from"./log-D98mO6yJ.js";import{n as Nt}from"./analytics-COpjZpvd.js";import{S as Pt,_ as Ft}from"./startupProfiler-C_xcIvEA.js";import{l as It,n as Lt,o as Rt}from"./stringUtils-CtJhTszO.js";import{_n as zt,vn as Bt}from"./prompt-B4rM4cgp.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-CouNgts6.js";import{n as Yt,t as Xt}from"./useExitOnCtrlCDWithKeybindings-BfgcAS50.js";import{n as Zt,t as Qt}from"./TextInput-DJaXm3Y2.js";import{n as $t,t as en}from"./select-CPlgmbIJ.js";import{r as tn,t as nn}from"./Spinner-bYnSD54K.js";import{n as rn,t as an}from"./useMergedTools-By1K71LJ.js";import{n as on,r as sn,t as cn}from"./promptEditor-CyMqa_av.js";import{n as ln,t as un}from"./useMainLoopModel-CO_oa76K.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-CA-5Px85.js";import{ff 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-CA-5Px85.js";import{ff as r,uf as i}from"./loadAgentsDir-izAo6rpy.js";function a(){let e=t(),n=[`user`,`project`,`local`].flatMap(e=>i(e).errors);return{settings:e.settings,errors:[...e.errors,...n]}}var o=e((()=>{r(),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-CMtnYZR9.js";import{o as i,s as a}from"./log-D98mO6yJ.js";import{i as o,t as s}from"./execFileNoThrow-7Ys9mO27.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};
|
package/dist/chunks/{backgroundHousekeeping-C75FgxW1.js → backgroundHousekeeping-C86ALKjw.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-CA-5Px85.js";import{P as a,Pt as o,z as s}from"./state-CXY-q5gr.js";import{Bu as c,Lu as l,ac as u,cr as d,hb as f,mt as p,oc as m,pb as h,vr as g,wt 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-CA-5Px85.js";import{P as a,Pt as o,z as s}from"./state-CXY-q5gr.js";import{Bu as c,Lu as l,ac as u,cr as d,hb as f,mt as p,oc as m,pb as h,vr as g,wt as _}from"./loadAgentsDir-izAo6rpy.js";import{c as v,f as y,i as b,u as x}from"./debug-NBJH_NxR.js";import{_ as S,o as C,s as w,v as T}from"./log-D98mO6yJ.js";import{n as E}from"./analytics-COpjZpvd.js";import{r as D,t as O}from"./pasteStore-2RafnH7M.js";import{r as k}from"./magicDocs-Beuyy0aV.js";import{i as A,t as j}from"./nativeInstaller-oMsFvcUC.js";import{n as M,t as N}from"./allErrors-BlYbbyyw.js";import{n as P,t as F}from"./pluginAutoupdate-xsdXYyA-.js";import{join as I}from"path";o(),m(),k(),E(),T(),b(),t(),y(),c(),C(),D(),g(),M(),i(),f(),_();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=d(),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,h),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 l(),await O(R()),await p(R())}j(),P();var Q=600*1e3;function $(){import(`./extractMemories-DOfFiInm.js`).then(({initExtractMemories:e})=>{e()}).catch(()=>{}),u(),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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./backgroundHousekeeping-C86ALKjw.js";export{e as startBackgroundHousekeeping};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Br as e,In as t,Jr as n,Ur as r,Vn as i,ai as a,ni as o}from"./settings-CA-5Px85.js";import{Pt as s,q as c}from"./state-CXY-q5gr.js";import{c as l,i as u}from"./debug-NBJH_NxR.js";import{d,h as f,o as p}from"./config-
|
|
1
|
+
import{Br as e,In as t,Jr as n,Ur as r,Vn as i,ai as a,ni as o}from"./settings-CA-5Px85.js";import{Pt as s,q as c}from"./state-CXY-q5gr.js";import{c as l,i as u}from"./debug-NBJH_NxR.js";import{d,h as f,o as p}from"./config-CMtnYZR9.js";import{_ as m,f as h,p as g}from"./startupProfiler-C_xcIvEA.js";import{n as _,r as v}from"./detectRepository-Bu0he_XM.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(),a(),n();async function w(){try{let t=await _();if(!t){l(`Not in a GitHub repository, skipping path mapping update`);return}let n=c(),r=e(n)??n,i;try{i=(await S(r)).normalize(`NFC`)}catch{i=r}let a=t.toLowerCase(),o=p().githubRepoPaths?.[a]??[];if(o[0]===i){l(`Path ${i} already tracked for repo ${a}`);return}let s=o.filter(e=>e!==i),u=[i,...s];f(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[a]:u}})),l(`Added ${i} to tracked paths for repo ${a}`)}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(i));return e.filter((e,n)=>t[n])}m(),a(),n();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(e){let t=await r(e);if(!t)return;let n=await o(t),[i,a]=await Promise.all([j(b(t,`FETCH_HEAD`)),n?j(b(n,`FETCH_HEAD`)):Promise.resolve(void 0)]);return i&&a?i>a?i:a:i??a}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-CA-5Px85.js";import{Pt as r,at as i,q as a}from"./state-CXY-q5gr.js";import{ci as o,hr as s,mr as c,ni as l,sr as u,vr as d,wr as f}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{vn as t,yn as n}from"./settings-CA-5Px85.js";import{Pt as r,at as i,q as a}from"./state-CXY-q5gr.js";import{ci as o,hr as s,mr as c,ni as l,sr as u,vr as d,wr as f}from"./loadAgentsDir-izAo6rpy.js";import{C as p,x as m}from"./debug-NBJH_NxR.js";import{n as h}from"./analytics-COpjZpvd.js";import{i as g,o as _}from"./stringUtils-CtJhTszO.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(),o=u(a()),l=s(t),d=c();await y(o,{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=>f(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(l,`${C.join(`
|
|
2
2
|
`)}\n`,{encoding:`utf8`,mode:384}),{sessionId:t,title:e,forkPath:l,serializedMessages:w,contentReplacementRecords:_}}async function w(e){let t=`${e} (Branch)`;if((await o(t,{exact:!0})).length===0)return t;let n=await o(`${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:c}=await C(r),u=new Date,d=S(s.find(e=>e.type===`user`)),f=await w(i??d);await l(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:c},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(),d(),m(),_()}))();export{T as call,S as deriveFirstPrompt};
|
|
@@ -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-CA-5Px85.js";import{Bx as f,Gs as p,Hv as m,I_ as h,Ks as g,L_ as _,R_ as v,Vv as y,Xi as b,ct as x,dd as S,lb as C,lt as w,pd as T,qS as E,ry 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-CA-5Px85.js";import{Bx as f,Gs as p,Hv as m,I_ as h,Ks as g,L_ as _,R_ as v,Vv as y,Xi as b,ct as x,dd as S,lb as C,lt as w,pd as T,qS as E,ry as D}from"./loadAgentsDir-izAo6rpy.js";import{I as O,M as k}from"./debug-NBJH_NxR.js";import{d as A,h as j}from"./config-CMtnYZR9.js";import{n as M,t as N}from"./SpinnerGlyph-4aVLQdJf.js";import{n as P,r as F}from"./sideQuestion-BW9eo3IE.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=y();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=f(z(e.messages)),n=p();if(n)return{systemPrompt:n.systemPrompt,userContext:n.userContext,systemContext:n.systemContext,toolUseContext:e,forkContextMessages:t};let[r,i,a]=await Promise.all([x(e.options.tools,e.options.mainLoopModel,[],e.options.mcpClients),_(),h()]);return{systemPrompt:E(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(),T(),M(),d(),w(),L(),v(),C(),s(),m(),A(),O(),g(),b(),P(),D(),U=u(),W=5,G=6,K=3}))();export{V as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./caches-CcK6hjFh.js";e();export{t as clearSessionCaches};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t,ti as n}from"./settings-CA-5Px85.js";import{Pt as r,l as i,mn as a}from"./state-CXY-q5gr.js";import{B_ as o,Bu as s,F_ as c,Hi as l,I_ as u,Ki as d,L_ as f,My as p,Pi as m,Pp as h,R_ as g,Ru as _,Tb as v,Ti as y,V_ as b,Y as x,_p as S,dh as C,dm as w,fh as T,hp as E,is as D,jy as O,lm as k,q as A,rs as j,wb as M,z_ as N}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t,ti as n}from"./settings-CA-5Px85.js";import{Pt as r,l as i,mn as a}from"./state-CXY-q5gr.js";import{B_ as o,Bu as s,F_ as c,Hi as l,I_ as u,Ki as d,L_ as f,My as p,Pi as m,Pp as h,R_ as g,Ru as _,Tb as v,Ti as y,V_ as b,Y as x,_p as S,dh as C,dm as w,fh as T,hp as E,is as D,jy as O,lm as k,q as A,rs as j,wb as M,z_ as N}from"./loadAgentsDir-izAo6rpy.js";import{a as P,n as F}from"./fileSuggestions-sTa3fiI8.js";import{r as I,t as L}from"./magicDocs-Beuyy0aV.js";import{r as R,t as z}from"./detectRepository-Bu0he_XM.js";function B(e=new Set){let t=e.size>0;f.cache.clear?.(),u.cache.clear?.(),c.cache.clear?.(),o.cache.clear?.(),F(),y(),t||S(),N(null),a(null),w(),D(),p(`session_start`),_(),z(),A(),i(e),n(),l(),T(),L(),M(),import(`./SearchExtraToolsTool-DxijDdxt.js`).then(({clearSearchExtraToolsDescriptionCache:e})=>e()),import(`./loadAgentsDir-DbkvUkkw.js`).then(({clearAgentDefinitionsCache:e})=>e()),import(`./prompt-BnLHkqxH.js`).then(({clearPromptCache:e})=>e())}var V=e((()=>{r(),m(),b(),g(),P(),h(),E(),k(),C(),I(),d(),j(),x(),O(),R(),t(),s(),v()}));export{V as n,B as t};
|