@readmagic/workmate 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddWorkspaceDirectory-Y5S_lMjD.js → AddWorkspaceDirectory-mS8iUoWY.js} +1 -1
- package/dist/chunks/{AgentsMdExternalIncludesDialog-DVbU-BaD.js → AgentsMdExternalIncludesDialog-BHBkysy0.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-DuStmCjj.js +1 -0
- package/dist/chunks/App-D--vtCyq.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-mcDuiNGs.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-DjqGAL4C.js → BypassPermissionsModeDialog-DyqI98d2.js} +1 -1
- package/dist/chunks/CustomSelect-CpMbxYbt.js +1 -0
- package/dist/chunks/DiffDialog-BQAU2pJx.js +6 -0
- package/dist/chunks/Doctor-BU69VQzw.js +1 -0
- package/dist/chunks/Doctor-DJOMbSDE.js +3 -0
- package/dist/chunks/{ExitFlow-Dh9QdaYK.js → ExitFlow-xBOnvhiW.js} +2 -2
- package/dist/chunks/{InvalidConfigDialog-C9boykQn.js → InvalidConfigDialog-NiuhcaG5.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-UN5mleCK.js → InvalidSettingsDialog-DrromC1I.js} +1 -1
- package/dist/chunks/KeybindingProviderSetup-CSUkJHTT.js +1 -0
- package/dist/chunks/MCPConnectionManager-Bn1PDn3R.js +1 -0
- package/dist/chunks/MCPToolListView-BRxjOaOL.js +1 -0
- package/dist/chunks/{McpParsingWarnings-zkM_lGd0.js → McpParsingWarnings-BYG2yqjO.js} +1 -1
- package/dist/chunks/MessageSelector-B7xAQqZI.js +3 -0
- package/dist/chunks/Messages-CxMsfjOa.js +10 -0
- package/dist/chunks/{Onboarding-BT90cFkn.js → Onboarding-CkATe87e.js} +1 -1
- package/dist/chunks/{PermissionDialog-BaibiQae.js → PermissionDialog-tEMMa5-a.js} +1 -1
- package/dist/chunks/{PressEnterToContinue-DZc_s_pE.js → PressEnterToContinue-CPOaYnym.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-CCTZYbWI.js → PromptInputFooterSuggestions-CwqAsTI2.js} +1 -1
- package/dist/chunks/PromptInputHelpMenu-krq-hiFO.js +1 -0
- package/dist/chunks/{ProviderSetup-yIj8YOKF.js → ProviderSetup-J6Ty-Wj8.js} +1 -1
- package/dist/chunks/QueryEngine-Mdi_kUaL.js +1 -0
- package/dist/chunks/REPL-BgzQtSFF.js +1 -0
- package/dist/chunks/REPL-rirm6s_7.js +124 -0
- package/dist/chunks/ResumeConversation-Cmsbo5m7.js +1 -0
- package/dist/chunks/{SearchBox-C9xxQzh1.js → SearchBox-DQBLKyzJ.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-D1-7C04z.js +1 -0
- package/dist/chunks/{SelectMulti-BW7Ffk1G.js → SelectMulti-BpAjjhsn.js} +1 -1
- package/dist/chunks/Settings-B6DImvca.js +2 -0
- package/dist/chunks/Spinner-DhhSOFcN.js +1 -0
- package/dist/chunks/{SpinnerGlyph-CqrOK3Mx.js → SpinnerGlyph-CmVXC-_9.js} +1 -1
- package/dist/chunks/{TextInput-Cev5Awdd.js → TextInput-BboKIug2.js} +11 -11
- package/dist/chunks/ThemePicker-DTpXbEY0.js +1 -0
- package/dist/chunks/{TrustDialog-8Sjmuu0e.js → TrustDialog-CZ8JpySm.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-INwwoerV.js → ValidationErrorsList-C_gDQfm1.js} +1 -1
- package/dist/chunks/{_baseEach-DrPH_FGo.js → _baseEach-DGbaIpJA.js} +1 -1
- package/dist/chunks/_baseSlice-D67_NpZ1.js +1 -0
- package/dist/chunks/{add-dir-D3RMaYxy.js → add-dir-B576wzi9.js} +1 -1
- package/dist/chunks/{agentDisplay-B3npXoCS.js → agentDisplay-ZuFoBZYu.js} +1 -1
- package/dist/chunks/{agents-2mPGmeq6.js → agents-Dy4_hDic.js} +1 -1
- package/dist/chunks/agents-HIOBiw4w.js +101 -0
- package/dist/chunks/allErrors-CxPNR2WN.js +1 -0
- package/dist/chunks/appleTerminalBackup-C9kjzdM9.js +1 -0
- package/dist/chunks/{backgroundHousekeeping-BkFxfjOf.js → backgroundHousekeeping-PyLNnGdw.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-ZCMPmQuU.js +1 -0
- package/dist/chunks/{banner-DHpTmEO7.js → banner-DqFectPg.js} +2 -2
- package/dist/chunks/{branch-Be_yDFU8.js → branch-B_BL5N9N.js} +2 -2
- package/dist/chunks/{break-cache-UUt6Dkf2.js → break-cache-DL95nKZl.js} +2 -2
- package/dist/chunks/{btw-DUml5L1w.js → btw-Y44ctueB.js} +1 -1
- package/dist/chunks/bundledMode-BxyD5cqq.js +1 -0
- package/dist/chunks/caches-5xZ4dSXt.js +1 -0
- package/dist/chunks/caches-Be9saXxV.js +1 -0
- package/dist/chunks/{claudeDesktop-mBGFDbI6.js → claudeDesktop-g8eUUY2E.js} +1 -1
- package/dist/chunks/{clear-CrGjNe6E.js → clear-DtTkA707.js} +1 -1
- package/dist/chunks/{client-BDuhbzLD.js → client-Bw_L3lSc.js} +1 -1
- package/dist/chunks/{client-BYFVVMcf.js → client-aJ2Nr_sh.js} +1 -1
- package/dist/chunks/client-mnUISv_N.js +1 -0
- package/dist/chunks/client-wPqIdEVm.js +1 -0
- package/dist/chunks/commands-wfE12a4L.js +1 -0
- package/dist/chunks/compact-CvNOtu7J.js +2 -0
- package/dist/chunks/config-D3K87Mm1.js +3 -0
- package/dist/chunks/config-DTga6Ku8.js +1 -0
- package/dist/chunks/config-DtmqWusU.js +1 -0
- package/dist/chunks/{context-mV5zjqmc.js → context-Opu4E8dL.js} +1 -1
- package/dist/chunks/{context-noninteractive-DvfVvmSE.js → context-noninteractive-B1V2Mp26.js} +5 -5
- package/dist/chunks/context-noninteractive-eIlneYiL.js +1 -0
- package/dist/chunks/conversation-CG_z7TLE.js +1 -0
- package/dist/chunks/conversation-CHesBfFZ.js +1 -0
- package/dist/chunks/conversationRecovery-OhitW-7g.js +1 -0
- package/dist/chunks/crossProjectResume-mmYx8PrZ.js +40 -0
- package/dist/chunks/cwd-BH2f3u0o.js +1 -0
- package/dist/chunks/{cwd-BvNt_018.js → cwd-DrEEb4f5.js} +1 -1
- package/dist/chunks/{debug-CRnGsZOV.js → debug-kBjDaVkQ.js} +3 -3
- package/dist/chunks/{detectRepository-CsJLbVEe.js → detectRepository-M6K2wc7h.js} +1 -1
- package/dist/chunks/{diff-DUEoNCnJ.js → diff-Cv7tX2-P.js} +1 -1
- package/dist/chunks/{directoryCompletion-Bgi8DBT5.js → directoryCompletion-BHyjyKAM.js} +1 -1
- package/dist/chunks/doctor-DeBG5SL5.js +1 -0
- package/dist/chunks/{entry-D1iD76SW.js → entry-CbhyIWgj.js} +5 -5
- package/dist/chunks/envUtils-DZ_SvEVz.js +1 -0
- package/dist/chunks/execFileNoThrow-BfZFnCGa.js +1 -0
- package/dist/chunks/execa-CBhG1doD.js +34 -0
- package/dist/chunks/exit-OKEV_ddw.js +1 -0
- package/dist/chunks/{extraUsage-BtHE-SBX.js → extraUsage-BlRL3yeb.js} +1 -1
- package/dist/chunks/extractMemories-jnsv-_n_.js +1 -0
- package/dist/chunks/fast-4I_qPJCd.js +1 -0
- package/dist/chunks/fast-DiolM1M7.js +1 -0
- package/dist/chunks/{fetchModelList-Cjow_QGy.js → fetchModelList-BRFTQim4.js} +1 -1
- package/dist/chunks/fetchModelList-qPKAuu4m.js +1 -0
- package/dist/chunks/{fileSuggestions-C96V9-Ne.js → fileSuggestions-iWVXvvLB.js} +3 -3
- package/dist/chunks/{fpsMetrics-wxj9GAsd.js → fpsMetrics-Ixd0J4CH.js} +1 -1
- package/dist/chunks/{gemini-4YGElN3H.js → gemini-BfVyavwQ.js} +2 -2
- package/dist/chunks/{generateSessionName-BHIKyXpz.js → generateSessionName-CGaTTXCA.js} +1 -1
- package/dist/chunks/genericProcessUtils-CVtQOTO2.js +12 -0
- package/dist/chunks/{goal-ePK_jLo3.js → goal-BidR-GFa.js} +1 -1
- package/dist/chunks/grok-DLcuI-U7.js +1 -0
- package/dist/chunks/{help-B7xRle-V.js → help-CZuvYhXj.js} +1 -1
- package/dist/chunks/history-BxPGftQw.js +1 -0
- package/dist/chunks/hooks-Bg9WIjZQ.js +1 -0
- package/dist/chunks/{hooks-BN5f58HY.js → hooks-ehqfAM5F.js} +2 -2
- package/dist/chunks/install-ACGY0vhM.js +1 -0
- package/dist/chunks/{instrumentation-Oj5xagJG.js → instrumentation-B9bfF2mA.js} +5 -5
- package/dist/chunks/{job-D9ypO0cd.js → job-Coztdn6A.js} +1 -1
- package/dist/chunks/keybindings-DwSdLpaE.js +1 -0
- package/dist/chunks/{launchLocalMemory-DliLezJw.js → launchLocalMemory-DRzfpIOB.js} +1 -1
- package/dist/chunks/{launchOnboarding-A-kk-7ID.js → launchOnboarding-D2zFCJf-.js} +1 -1
- package/dist/chunks/{loadAgentsDir-DGozQu_6.js → loadAgentsDir-DR5PVAc3.js} +557 -561
- package/dist/chunks/loadAgentsDir-DqAbnpB-.js +1 -0
- package/dist/chunks/{loadPluginHooks-BiHPKDaY.js → loadPluginHooks-BiQgGfUJ.js} +1 -1
- package/dist/chunks/{loader-CtoR-vO-.js → loader-6MqzNGmV.js} +1 -1
- package/dist/chunks/{localSearch-BU02Qsv9.js → localSearch-CzkxDuOR.js} +1 -1
- package/dist/chunks/localSearch-DW3JT2MA.js +1 -0
- package/dist/chunks/lockfile-D_9vif6E.js +1 -0
- package/dist/chunks/{log-DoSpAwRP.js → log-DWZny1vM.js} +1 -1
- package/dist/chunks/{logoUtils-DLd6JKqW.js → logoUtils-DR5T0pr3.js} +1 -1
- package/dist/chunks/{magicDocs-Bj8LYrN2.js → magicDocs-BwBxjfLo.js} +2 -2
- package/dist/chunks/main-Ryi27wYq.js +345 -0
- package/dist/chunks/managedEnv-DCEJh3z3.js +1 -0
- package/dist/chunks/managedEnv-Do9fgLpk.js +1 -0
- package/dist/chunks/managedEnvConstants-CWcT7nYr.js +1 -0
- package/dist/chunks/mcp-BCpnF6wD.js +1 -0
- package/dist/chunks/mcp-CJ6SDJEK.js +6 -0
- package/dist/chunks/mcp-CZBTxbhu.js +2 -0
- package/dist/chunks/memory-BQO6Y0ak.js +1 -0
- package/dist/chunks/{modalContext-DDZdU1J8.js → modalContext-CBE8xuck.js} +1 -1
- package/dist/chunks/{mode-CBKawxnD.js → mode-wq70cR44.js} +1 -1
- package/dist/chunks/model-D42epddJ.js +1 -0
- package/dist/chunks/{model-DwbqvCY2.js → model-DVk9-2dk.js} +1 -1
- package/dist/chunks/{modelOptions-CXBfKFXA.js → modelOptions-beLgXORr.js} +1 -1
- package/dist/chunks/nativeInstaller-ChGSz1lb.js +1 -0
- package/dist/chunks/{notifications-ql0eSo0Y.js → notifications-dGBuNvFj.js} +1 -1
- package/dist/chunks/{onChangeAppState-D85b33R5.js → onChangeAppState-B4K-rSaF.js} +1 -1
- package/dist/chunks/openai-DAwnAV9K.js +2 -0
- package/dist/chunks/{overlayContext-CLjlCFBl.js → overlayContext-B6i_6y_0.js} +1 -1
- package/dist/chunks/{panel-DMZkOEiU.js → panel-C0CF3noE.js} +1 -1
- package/dist/chunks/parser-BZt0VFd_.js +1 -0
- package/dist/chunks/{parser-UqADrvxF.js → parser-DThLwgdM.js} +1 -1
- package/dist/chunks/{partition-CwxTlmMd.js → partition-BRQHofxD.js} +1 -1
- package/dist/chunks/{pasteStore-ovtxMVR5.js → pasteStore-BmehVo5j.js} +1 -1
- package/dist/chunks/{permissions-CgsvWOk_.js → permissions-DkfWKN-B.js} +3 -3
- package/dist/chunks/pidLock-YvAaIrIY.js +3 -0
- package/dist/chunks/plan-B6U3ioer.js +1 -0
- package/dist/chunks/{platform-DsMIk3eq.js → platform-Vl9IynC3.js} +1 -1
- package/dist/chunks/plugin-CTA2_-F7.js +17 -0
- package/dist/chunks/{pluginAutoupdate-DQqYDPVg.js → pluginAutoupdate-Dy5W3HWE.js} +1 -1
- package/dist/chunks/{pluginBlocklist-BAr9WTup.js → pluginBlocklist-DAoUENwc.js} +1 -1
- package/dist/chunks/pluginCliCommands-CaHnj0C_.js +1 -0
- package/dist/chunks/{pluginFlagging-BO_3qjfs.js → pluginFlagging-BCj9LJP3.js} +1 -1
- package/dist/chunks/pluginOperations-ClXNOOG6.js +2 -0
- package/dist/chunks/pluginStartupCheck-CiwMKGjx.js +1 -0
- package/dist/chunks/{pluginStartupCheck-BX6cv-vs.js → pluginStartupCheck-U8_xk25t.js} +1 -1
- package/dist/chunks/{plugins-9crasx2V.js → plugins-D7zyI9c4.js} +4 -4
- package/dist/chunks/{poller-CpLBoB-N.js → poller-BeyVwHAf.js} +1 -1
- package/dist/chunks/poorMode-DtzWNhsY.js +1 -0
- package/dist/chunks/poorMode-Ocff_UT1.js +1 -0
- package/dist/chunks/print-BzljdXem.js +13 -0
- package/dist/chunks/processBashCommand-RUkmyAl4.js +1 -0
- package/dist/chunks/processSlashCommand-DRLO-jNV.js +5 -0
- package/dist/chunks/{projectContext-5fmRr6Sd.js → projectContext-COeHKDrk.js} +1 -1
- package/dist/chunks/{projectContext-DhtjLv3k.js → projectContext-QN5U3Ggr.js} +1 -1
- package/dist/chunks/{projectOnboardingState--L3BKjOE.js → projectOnboardingState-KqcpRXls.js} +1 -1
- package/dist/chunks/{prompt-DzO1um1h.js → prompt-CTByhpUI.js} +20 -20
- package/dist/chunks/prompt-DTpfW6yP.js +1 -0
- package/dist/chunks/prompt-D__eHY_5.js +1 -0
- package/dist/chunks/promptEditor-CpUFgGzc.js +4 -0
- package/dist/chunks/{protocolHandler-BWgH1jaF.js → protocolHandler-BQSLVGnG.js} +2 -2
- package/dist/chunks/{proxy-BjkGlmBu.js → proxy-BtWuysHM.js} +2 -2
- package/dist/chunks/{reconciler-CVMmAaCy.js → reconciler-D6BUq8WB.js} +1 -1
- package/dist/chunks/refresh-B4pqFp12.js +1 -0
- package/dist/chunks/reject-C6IvUvBt.js +1 -0
- package/dist/chunks/{reload-plugins-DeyJTx4s.js → reload-plugins-DXQqk7q6.js} +1 -1
- package/dist/chunks/rename-D4XBmTBI.js +1 -0
- package/dist/chunks/{renderOptions-DRS2EslG.js → renderOptions-DkP98P_d.js} +1 -1
- package/dist/chunks/{resume-N4O5YI-S.js → resume-DzIev0JI.js} +2 -2
- package/dist/chunks/ripgrep-CYP26Fhg.js +1 -0
- package/dist/chunks/ripgrep-D1f1pbCz.js +5 -0
- package/dist/chunks/{runtimeObserver-DMSzdFWt.js → runtimeObserver-BPqlbu0B.js} +4 -4
- package/dist/chunks/{runtimeObserver-C0CJvA3q.js → runtimeObserver-BUHs3qjs.js} +1 -1
- package/dist/chunks/sandbox-adapter-CumL75tU.js +1 -0
- package/dist/chunks/{sandbox-toggle-Tbbaw18C.js → sandbox-toggle-CTtET6Xq.js} +1 -1
- package/dist/chunks/searchExtraTools-BMCU2zEf.js +1 -0
- package/dist/chunks/{select-Fq6g2Ejk.js → select-FrwoTzuc.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-WO8WTdT9.js +1 -0
- package/dist/chunks/{sessionObserver-CRie77tp.js → sessionObserver-B6xzxckA.js} +2 -2
- package/dist/chunks/sessionObserver-CBrM4opL.js +1 -0
- package/dist/chunks/sessionStorage-C1EAxDWG.js +1 -0
- package/dist/chunks/sessionTracing-UFK96PxT.js +11 -0
- package/dist/chunks/settings-BK6gCko-.js +1 -0
- package/dist/chunks/settings-YIDksG5Z.js +24 -0
- package/dist/chunks/setup-BBvZyrfz.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-CTnYVrmP.js → shadowedRuleDetection-D6R2OeoH.js} +1 -1
- package/dist/chunks/{sideQuestion-Cl8m2qYx.js → sideQuestion-5jcbOMsR.js} +3 -3
- package/dist/chunks/{sinks-CiupmfTg.js → sinks-B-kFqjjd.js} +1 -1
- package/dist/chunks/sinks-DB_D4lmu.js +1 -0
- package/dist/chunks/skillChangeDetector-103-nEle.js +1 -0
- package/dist/chunks/{skillGapStore-es3K-aYe.js → skillGapStore-DOz1KCqo.js} +2 -2
- package/dist/chunks/{skillLifecycle-BcgoOQBk.js → skillLifecycle-D9NkIwFQ.js} +2 -2
- package/dist/chunks/{skillSearchPanel-CuDDb1L-.js → skillSearchPanel-DFiSZaJ4.js} +2 -2
- package/dist/chunks/skills-DgeLr52a.js +1 -0
- package/dist/chunks/sleep-BbWr_FL1.js +1 -0
- package/dist/chunks/{src-9vmGsuSI.js → src-Cy5_qH26.js} +1 -1
- package/dist/chunks/{src-DL3w8VPk.js → src-WZ94ZKI3.js} +4 -4
- package/dist/chunks/{startupProfiler-DF0AjiDf.js → startupProfiler-DIM_Ihyp.js} +2 -2
- package/dist/chunks/startupProfiler-FpGsKWYk.js +1 -0
- package/dist/chunks/{state-BQ4BEGin.js → state-CXY-q5gr.js} +1 -1
- package/dist/chunks/state-DXt6rahM.js +1 -0
- package/dist/chunks/{staticRender-BVWx0IM1.js → staticRender-RHUIg5ln.js} +1 -1
- package/dist/chunks/status-CKLecQZV.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-BfmIub5L.js → statusNoticeHelpers-DI45AH-c.js} +1 -1
- package/dist/chunks/stringUtils-D_xPrwGQ.js +4 -0
- package/dist/chunks/switcher-D2Z2ZNQ0.js +1 -0
- package/dist/chunks/switcher-DhZCaAun.js +1 -0
- package/dist/chunks/{tasks-B6gYXxOx.js → tasks-6suPhqsK.js} +1 -1
- package/dist/chunks/{templateJobs-BW6TaqEC.js → templateJobs-BKVEWCsb.js} +1 -1
- package/dist/chunks/{terminalSetup-C-g9Xvj3.js → terminalSetup-7PUR4hfo.js} +1 -1
- package/dist/chunks/{terminalSetup-BgIXFBpd.js → terminalSetup-Cqy5_PhJ.js} +4 -4
- package/dist/chunks/{theme-9AZceq_m.js → theme-B-HG2PUs.js} +1 -1
- package/dist/chunks/tipRegistry-BR_lSGRw.js +2 -0
- package/dist/chunks/{toolEventObserver-DTuJcREC.js → toolEventObserver-BY3QVnr6.js} +1 -1
- package/dist/chunks/toolPool-BcwIF8Q_.js +1 -0
- package/dist/chunks/{types-97nL3naE.js → types-CD25a50S.js} +1 -1
- package/dist/chunks/udsClient-CCxgLiZy.js +1 -0
- package/dist/chunks/urlHandler-BNsQKqba.js +1 -0
- package/dist/chunks/{use-select-navigation-BStVRvcX.js → use-select-navigation-CW5alA9r.js} +1 -1
- package/dist/chunks/{useDoublePress-C9xxQzh1.js → useDoublePress-DQBLKyzJ.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-DWRFdFoU.js → useExitOnCtrlCDWithKeybindings-BgJrnuDl.js} +1 -1
- package/dist/chunks/useMainLoopModel-BVgJo4hN.js +1 -0
- package/dist/chunks/useManagePlugins-CrWjzESW.js +1 -0
- package/dist/chunks/useMergedTools-r6GQq5mI.js +1 -0
- package/dist/chunks/{useSearchInput-B_mY9wBq.js → useSearchInput-BITV_Txn.js} +1 -1
- package/dist/chunks/{useSettingsErrors-CM7tThcp.js → useSettingsErrors-CO0fTNzn.js} +1 -1
- package/dist/chunks/{util-Bb2S6g9N.js → util-_zo3I1y8.js} +1 -1
- package/dist/chunks/validatePlugin-DFGdRhA-.js +1 -0
- package/dist/chunks/{vim-Dpnhgoz_.js → vim-qgMS88ss.js} +1 -1
- package/dist/chunks/worktree-CR_M6Qfy.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.cjs +16 -16
- package/dist/chunks/AgentsMdExternalIncludesDialog-Bnb1jWcg.js +0 -1
- package/dist/chunks/App-B8q8PV77.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-i0TkZgQp.js +0 -2
- package/dist/chunks/CustomSelect-BvTftqEH.js +0 -1
- package/dist/chunks/DiffDialog-v5r8cBKW.js +0 -6
- package/dist/chunks/Doctor-DKpBnbuI.js +0 -1
- package/dist/chunks/Doctor-uvO6NM5m.js +0 -3
- package/dist/chunks/KeybindingProviderSetup-DsJqfEt-.js +0 -1
- package/dist/chunks/MCPConnectionManager-DkZVxLEj.js +0 -1
- package/dist/chunks/MCPToolListView-De1W4jpj.js +0 -1
- package/dist/chunks/MessageSelector-DW_itlX-.js +0 -3
- package/dist/chunks/Messages-BFsCpACq.js +0 -10
- package/dist/chunks/PromptInputHelpMenu-Bm5KY0Ma.js +0 -1
- package/dist/chunks/QueryEngine-egz5mbaW.js +0 -1
- package/dist/chunks/REPL-D27CE4WN.js +0 -124
- package/dist/chunks/REPL-e8wAT1wN.js +0 -1
- package/dist/chunks/ResumeConversation-CWA27Lke.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BRchtZ9Q.js +0 -1
- package/dist/chunks/Settings-axHLvYIy.js +0 -3
- package/dist/chunks/Spinner-VjwI7m_g.js +0 -1
- package/dist/chunks/ThemePicker-CtQYHmOr.js +0 -1
- package/dist/chunks/agents-DEnmg8Xo.js +0 -101
- package/dist/chunks/allErrors-C9kx6lnk.js +0 -1
- package/dist/chunks/appleTerminalBackup-CT7g8yOs.js +0 -1
- package/dist/chunks/backgroundHousekeeping-CvWfd99M.js +0 -1
- package/dist/chunks/caches-DWjwe-DN.js +0 -1
- package/dist/chunks/caches-VLs1tQkZ.js +0 -1
- package/dist/chunks/client-CO_6v4yl.js +0 -1
- package/dist/chunks/client-DO-O441l.js +0 -1
- package/dist/chunks/commands-Cn1P7Tms.js +0 -1
- package/dist/chunks/compact-DGUhdXcc.js +0 -2
- package/dist/chunks/config-C7GTF4iI.js +0 -1
- package/dist/chunks/config-CWPHVTic.js +0 -3
- package/dist/chunks/config-Cox0TM2Z.js +0 -1
- package/dist/chunks/context-noninteractive--OuiZUzL.js +0 -1
- package/dist/chunks/conversation--y8PD2Lk.js +0 -1
- package/dist/chunks/conversation-BIPJEOwO.js +0 -1
- package/dist/chunks/conversationRecovery-BBJzrA0g.js +0 -1
- package/dist/chunks/crossProjectResume-CwZb3cEU.js +0 -40
- package/dist/chunks/cwd-BZMp3CZ8.js +0 -1
- package/dist/chunks/doctor-4NiE46ZG.js +0 -1
- package/dist/chunks/envUtils-DfkgIdYf.js +0 -1
- package/dist/chunks/execFileNoThrow-BgRsj_SW.js +0 -34
- package/dist/chunks/exit-CrsQsjbx.js +0 -1
- package/dist/chunks/extractMemories-kogJzpit.js +0 -1
- package/dist/chunks/fast-CuNVwVTr.js +0 -1
- package/dist/chunks/fast-RlFnwGRV.js +0 -1
- package/dist/chunks/fetchModelList-uiCPVqbJ.js +0 -1
- package/dist/chunks/genericProcessUtils-BNlr-QxM.js +0 -23
- package/dist/chunks/grok-DnmklTrm.js +0 -1
- package/dist/chunks/history-kOw3CcLT.js +0 -1
- package/dist/chunks/hooks-BDY1jMbS.js +0 -1
- package/dist/chunks/install-DrMiHa2Q.js +0 -1
- package/dist/chunks/keybindings-BRRN_eap.js +0 -1
- package/dist/chunks/loadAgentsDir-CJAK4kif.js +0 -1
- package/dist/chunks/localSearch-DyaB2Rm-.js +0 -1
- package/dist/chunks/main-B_09WbaG.js +0 -345
- package/dist/chunks/managedEnv-BJGfe3m7.js +0 -1
- package/dist/chunks/managedEnv-CIWJsuty.js +0 -1
- package/dist/chunks/managedEnvConstants-BPwL2aWI.js +0 -1
- package/dist/chunks/mcp-1nBvcNxw.js +0 -1
- package/dist/chunks/mcp-7DXpXMdT.js +0 -2
- package/dist/chunks/mcp-kw99WVi2.js +0 -6
- package/dist/chunks/memory-CjWvzR_9.js +0 -1
- package/dist/chunks/model-DpZaKZMb.js +0 -1
- package/dist/chunks/nativeInstaller-SmPeEisk.js +0 -1
- package/dist/chunks/openai-D_j7-KW6.js +0 -2
- package/dist/chunks/parser-2usBI4G-.js +0 -1
- package/dist/chunks/pidLock-B-SW3Nhx.js +0 -3
- package/dist/chunks/plan-BJrWtXEh.js +0 -1
- package/dist/chunks/plugin-D97VJAxW.js +0 -17
- package/dist/chunks/pluginCliCommands-CUGPc853.js +0 -1
- package/dist/chunks/pluginOperations-rTrzu6Vg.js +0 -2
- package/dist/chunks/pluginStartupCheck-BRHnXlym.js +0 -1
- package/dist/chunks/poorMode-BaS0DBUO.js +0 -1
- package/dist/chunks/poorMode-DmvzFAz_.js +0 -1
- package/dist/chunks/print-Bi3xVdB3.js +0 -13
- package/dist/chunks/processBashCommand-BBtnCx-7.js +0 -1
- package/dist/chunks/processSlashCommand-jzF0GmLO.js +0 -5
- package/dist/chunks/prompt-CmijKW7G.js +0 -1
- package/dist/chunks/prompt-DYBx_D0H.js +0 -1
- package/dist/chunks/promptEditor-B6S_Rzcu.js +0 -4
- package/dist/chunks/refresh-CAGv8BJY.js +0 -1
- package/dist/chunks/reject-CEUkoI2G.js +0 -1
- package/dist/chunks/rename-DPFis9g_.js +0 -1
- package/dist/chunks/ripgrep-3omwGI-l.js +0 -1
- package/dist/chunks/ripgrep-CgQrN3XX.js +0 -5
- package/dist/chunks/sandbox-adapter-D15jjHJR.js +0 -1
- package/dist/chunks/searchExtraTools-BoFc__Eg.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-Rgsp4_Ex.js +0 -1
- package/dist/chunks/sessionObserver-PcaVCVkX.js +0 -1
- package/dist/chunks/sessionStorage-Dkf7FRgA.js +0 -1
- package/dist/chunks/sessionTracing-D7rekMdW.js +0 -11
- package/dist/chunks/settings-8fwIkMDV.js +0 -1
- package/dist/chunks/settings-CodSADx8.js +0 -24
- package/dist/chunks/setup-DBiIrXrh.js +0 -3
- package/dist/chunks/sinks-DH83d_kd.js +0 -1
- package/dist/chunks/skillChangeDetector-BrrZaFkT.js +0 -1
- package/dist/chunks/skills-BRtgqnLz.js +0 -1
- package/dist/chunks/startupProfiler-D1NRu2nj.js +0 -1
- package/dist/chunks/state-D3gvDiu8.js +0 -1
- package/dist/chunks/status-WXA16wIM.js +0 -1
- package/dist/chunks/stringUtils-Bu_lJH5c.js +0 -4
- package/dist/chunks/switcher-5gilU5_R.js +0 -1
- package/dist/chunks/switcher-DMfuKuw_.js +0 -1
- package/dist/chunks/tipRegistry-DtO1H_Wo.js +0 -2
- package/dist/chunks/toolPool-DHS8jWaL.js +0 -1
- package/dist/chunks/udsClient-CmYHFiBD.js +0 -1
- package/dist/chunks/urlHandler-DLz3FZm1.js +0 -1
- package/dist/chunks/useMainLoopModel-DSN5HjV1.js +0 -1
- package/dist/chunks/useManagePlugins-ntnOf5OU.js +0 -1
- package/dist/chunks/useMergedTools-C5Yns9Ij.js +0 -1
- package/dist/chunks/validatePlugin-D8WQ5z4W.js +0 -1
- package/dist/chunks/worktree-a5oOPSYl.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./REPL-D27CE4WN.js";export{e as REPL};
|
|
@@ -1 +0,0 @@
|
|
|
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 ee,t as o}from"./src-DL3w8VPk.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{Hn as te,Pt as c}from"./state-BQ4BEGin.js";import{Bp as ne,Cb as l,Cm as re,Er as ie,Hp as ae,In as oe,Kn as u,Rr as d,Xr as f,Xs as p,Yr as se,ec as m,f_ as h,gr as g,jr as _,kb as v,p_ as y,vr as b,wm as x,zp as S}from"./loadAgentsDir-DGozQu_6.js";import{o as C,s as w}from"./log-DoSpAwRP.js";import{n as T}from"./analytics-COpjZpvd.js";import{n as ce}from"./conversationRecovery-BBJzrA0g.js";import{r as E,t as D}from"./Spinner-VjwI7m_g.js";import{a as le,n as ue,s as de}from"./skillChangeDetector-BrrZaFkT.js";import{t as fe}from"./REPL-D27CE4WN.js";import{a as O,i as k,n as A,o as j,r as M,t as N}from"./crossProjectResume-CwZb3cEU.js";import{dirname as P}from"path";var F=e(i(),1);v(),c(),j(),E(),h(),o(),l(),T(),S(),x(),k(),p(),A(),C(),g();var I=s();function L(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 R({commands:e,worktreePaths:r,initialTools:i,mcpClients:o,dynamicMcpConfig:s,debug:c,mainThreadAgentDefinition:l,autoConnectIdeFlag:p,strictMcpConfig:h=!1,systemPrompt:g,appendSystemPrompt:v,initialSearchQuery:x,disableSlashCommands:S=!1,forkSession:C,taskListId:T,filterByPr:E,thinkingConfig:k,onTurnComplete:A}){let{rows:j}=ee(),R=ne(e=>e.agentDefinitions),V=ae(),[H,U]=F.useState([]),[pe,W]=F.useState(!0),[me,he]=F.useState(!1),[G,ge]=F.useState(!1),[K,q]=F.useState(null),[J,_e]=F.useState(null),Y=F.useRef(null),X=F.useRef(0),Z=F.useMemo(()=>{let e=H.filter(e=>!e.isSidechain);if(E!==void 0){if(E===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof E==`number`)e=e.filter(e=>e.prNumber===E);else if(typeof E==`string`){let t=L(E);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[H,E]),ve=b();F.useEffect(()=>{_(r).then(e=>{Y.current=e,X.current=e.logs.length,U(e.logs),W(!1)}).catch(e=>{w(e),W(!1)})},[r]);let Q=F.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||u(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}),U(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=F.useCallback(e=>{W(!0),(e?ie():_(r)).then(e=>{Y.current=e,X.current=e.logs.length,U(e.logs)}).catch(e=>{w(e)}).finally(()=>{W(!1)})},[r]),ye=F.useCallback(()=>{let e=!G;ge(e),$(e)},[G,$]);function be(){process.exit(1)}async function xe(e){he(!0);let t=performance.now(),n=N(e,G);if(n.isCrossProject&&!n.isSameRepoWorktree){let e=n.command,t=await a(e);t&&process.stdout.write(t),_e(e);return}try{let n=await ce(e,void 0);if(!n)throw Error(`Failed to load conversation`);n.sessionId&&!C?(te(re(n.sessionId),e.fullPath?P(e.fullPath):null),await se(),y(n.sessionId)):C&&n.contentReplacements?.length&&await d(n.contentReplacements);let{agentDefinition:r}=le(n.agentSetting,l,R);V(e=>({...e,agent:r?.agentType}));let i=ue(n.agentName,n.agentColor);i&&V(e=>({...e,standaloneAgentContext:i})),m(n.agentName),f(C?{...n,worktreeSession:void 0}:n),C||(de(n.worktreeSession),n.sessionId&&oe()),Math.round(performance.now()-t),U([]),q({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,I.jsx)(B,{command:J}):K?(0,I.jsx)(fe,{debug:c,commands:e,initialTools:i,initialMessages:K.messages,initialFileHistorySnapshots:K.fileHistorySnapshots,initialContentReplacements:K.contentReplacements,initialAgentName:K.agentName,initialAgentColor:K.agentColor,mcpClients:o,dynamicMcpConfig:s,strictMcpConfig:h,systemPrompt:g,appendSystemPrompt:v,mainThreadAgentDefinition:K.mainThreadAgentDefinition,autoConnectIdeFlag:p,disableSlashCommands:S,taskListId:T,thinkingConfig:k,onTurnComplete:A}):pe?(0,I.jsxs)(t,{children:[(0,I.jsx)(D,{}),(0,I.jsx)(n,{children:` Loading conversations…`})]}):me?(0,I.jsxs)(t,{children:[(0,I.jsx)(D,{}),(0,I.jsx)(n,{children:` Resuming conversation…`})]}):Z.length===0?(0,I.jsx)(z,{}):(0,I.jsx)(O,{logs:Z,maxHeight:j,onCancel:be,onSelect:xe,onLogsChanged:ve?()=>$(G):void 0,onLoadMore:Q,initialSearchQuery:x,showAllProjects:G,onToggleAllProjects:ye,onAgenticSearch:M})}function z(){return r(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,I.jsxs)(t,{flexDirection:`column`,children:[(0,I.jsx)(n,{children:`No conversations found to resume.`}),(0,I.jsx)(n,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function B({command:e}){return F.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,I.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,I.jsx)(n,{children:`This conversation is from a different directory.`}),(0,I.jsxs)(t,{flexDirection:`column`,children:[(0,I.jsx)(n,{children:`To resume, run:`}),(0,I.jsxs)(n,{children:[` `,e]})]}),(0,I.jsx)(n,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{R as ResumeConversation};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fh as e,ph as t}from"./loadAgentsDir-DGozQu_6.js";t();export{e as clearSearchExtraToolsDescriptionCache};
|
|
@@ -1,3 +0,0 @@
|
|
|
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-DfkgIdYf.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-DL3w8VPk.js";import{t as y}from"./jsx-runtime-Bb4Xn-E0.js";import{Pt as b,at as ue}from"./state-BQ4BEGin.js";import{A_ as x,Bp as S,Cb as de,D_ as fe,Da as C,E_ as pe,Ea as me,H_ as he,Hp as ge,L_ as _e,Mp as ve,O_ as ye,Oa as w,R_ as be,V_ as xe,Vp as Se,W_ as T,XC as Ce,YC as we,ZC as Te,aw as Ee,b as E,er as D,gr as O,hd as De,j as Oe,jp as ke,k_ as Ae,kb as je,md as k,nw as A,ow as Me,rw as Ne,w_ as j,z_ as Pe,zp as Fe}from"./loadAgentsDir-DGozQu_6.js";import{n as Ie,t as Le}from"./cwd-BvNt_018.js";import{Ft as Re,Nt as ze,Pt as Be,Rt as Ve,an as M,b as N,h as He,i as P,in as Ue,jt as We,ln as Ge,n as Ke,s as qe,t as Je,wn as Ye,xn as Xe,zt as Ze}from"./settings-CodSADx8.js";import{a as Qe,d as F,h as I,i as $e,o as L,r as et}from"./config-CWPHVTic.js";import{o as tt,s as nt}from"./log-DoSpAwRP.js";import{n as R}from"./analytics-COpjZpvd.js";import{_ as z,f as B}from"./startupProfiler-DF0AjiDf.js";import{Mt as V,Pt as H,f as rt,g as it,h as at}from"./model-DpZaKZMb.js";import{a as ot,c as st,f as ct,m as lt}from"./proxy-BjkGlmBu.js";import{n as ut,t as U}from"./TextInput-Cev5Awdd.js";import{n as dt,t as ft}from"./useExitOnCtrlCDWithKeybindings-DWRFdFoU.js";import{n as pt,t as mt}from"./select-Fq6g2Ejk.js";import{i as W,n as ht,r as gt}from"./modalContext-DDZdU1J8.js";import{g as _t,h as vt}from"./pidLock-B-SW3Nhx.js";import{n as G,t as yt}from"./nativeInstaller-SmPeEisk.js";import{n as bt,t as xt}from"./allErrors-C9kx6lnk.js";import{t as St}from"./CustomSelect-BvTftqEH.js";import{n as Ct,t as wt}from"./ThemePicker-CtQYHmOr.js";import{i as Tt,n as Et,r as Dt,t as Ot}from"./extraUsage-BtHE-SBX.js";import{n as kt,t as At}from"./AgentsMdExternalIncludesDialog-DVbU-BaD.js";import{t as jt}from"./SearchBox-C9xxQzh1.js";import{n as Mt,t as Nt}from"./useSearchInput-B_mY9wBq.js";function Pt(){return[]}function Ft(e,t=null,n){let r=e?.find(e=>e.name===`ide`);if(t){let e=T(t.ideType),i=xe(t.ideType)?`plugin`:`extension`;if(t.error)return[{label:`IDE`,value:(0,Wt.jsxs)(u,{children:[m(`error`,n)(s.cross),` Error installing `,e,` `,i,`:`,` `,t.error,`
|
|
2
|
-
`,`Please restart your IDE and try again.`]})}];if(t.installed)return r&&r.type===`connected`?t.installedVersion===r.serverInfo?.version?[{label:`IDE`,value:`Connected to ${e} ${i} version ${t.installedVersion}`}]:[{label:`IDE`,value:`Connected to ${e} ${i} version ${t.installedVersion} (server version: ${r.serverInfo?.version})`}]:[{label:`IDE`,value:`Installed ${e} ${i}`}]}else if(r){let e=_e(r)??`IDE`;return r.type===`connected`?[{label:`IDE`,value:`Connected to ${e} extension`}]:[{label:`IDE`,value:`${m(`error`,n)(s.cross)} Not connected to ${e}`}]}return[]}function It(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 Lt(){let e=fe(await ye()),t=[];return e.forEach(e=>{let n=Xe(e.path);t.push(`Large ${n} will impact performance (${B(e.content.length)} chars > ${B(j)})`)}),t}function Rt(){return[{label:`Setting sources`,value:Ue().filter(e=>{let t=qe(e);return t!==null&&Object.keys(t).length>0}).map(e=>{if(e===`policySettings`){let e=P();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}=Ke();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 M(e)}).filter(e=>e!==null)}]}async function zt(){return(await G()).map(e=>e.message)}async function Bt(){let e=await vt(),t=[],{errors:n}=xt();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 Vt(){return[]}function Ht(){let e=V(),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.CLAUDE_CODE_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.CLAUDE_CODE_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.CLAUDE_CODE_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=ot();i&&t.push({label:`Proxy`,value:i});let o=ct();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.CLAUDE_CODE_CLIENT_CERT&&t.push({label:`mTLS client cert`,value:process.env.CLAUDE_CODE_CLIENT_CERT}),o.key&&process.env.CLAUDE_CODE_CLIENT_KEY&&t.push({label:`mTLS client key`,value:process.env.CLAUDE_CODE_CLIENT_KEY})),t}function Ut(e){return it(e)}var Wt,Gt=e((()=>{o(),_(),x(),_t(),i(),Ye(),z(),Pe(),rt(),H(),lt(),yt(),st(),bt(),Ge(),He(),Wt=y()}));function Kt(){let e=ue();return[{label:`Version`,value:`0.0.25`},{label:`Session name`,value:D(e)??(0,K.jsx)(u,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:Le()},...Vt(),...Ht()]}function qt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:Ut(e)},...Ft(t.clients,r.options.ideInstallationStatus,n),...It(t.clients,n),...Pt(),...Rt()]}async function Jt(){return[...await zt(),...await Bt(),...await Lt()]}function Yt({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 Xt({context:e,diagnosticsPromise:t}){let n=S(e=>e.mainLoopModel),r=S(e=>e.mcp),[i]=te(),a=Qt.useMemo(()=>[Kt(),qt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=gt()?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)(Yt,{value:t})]},n))},t)),(0,K.jsx)($t.Suspense,{fallback:null,children:(0,K.jsx)(Zt,{promise:t})})]}),(0,K.jsx)(u,{dimColor:!0,children:(0,K.jsx)(k,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Zt({promise:e}){let t=(0,$t.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 Qt,$t,K,en=e((()=>{o(),Qt=t(f(),1),$t=t(f(),1),b(),ht(),_(),Fe(),Ie(),O(),Gt(),De(),K=y()}));function tn({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,nn.jsxs)(le,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,nn.jsxs)(u,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,nn.jsx)(u,{dimColor:!0,children:`How would you like to handle this?`}),(0,nn.jsx)(mt,{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 nn,rn=e((()=>{_(),St(),nn=y()}));function an(e){return Object.entries(e).map(([e,t])=>({label:t?.name??cn,value:e,description:t?.description??ln}))}function on({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,sn.useState)([]),[o,s]=(0,sn.useState)(!0);(0,sn.useEffect)(()=>{C(Le()).then(e=>{let t=an(e);a(t),s(!1)}).catch(()=>{let e=an(me);a(e),s(!1)})},[]);let c=(0,sn.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)(mt,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var sn,q,cn,ln,un=e((()=>{sn=t(f(),1),w(),_(),Ie(),pt(),q=y(),cn=`Default`,ln=`Work Mate completes coding tasks efficiently and provides concise responses`}));function dn({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,fn.useState)(e),[a,o]=(0,fn.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)(U,{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 fn,J,pn=e((()=>{o(),fn=t(f(),1),_(),de(),ut(),J=y()}));function mn({onClose:e,context:t,setTabsHidden:r,onIsSearchModeChange:i,contentHeight:a}){let{headerFocused:o,focusHeader:f}=ae(),oe=gt(),[,m]=te(),h=ne(),[g,_]=(0,X.useState)(L()),v=Y.useRef(L()),[y,b]=(0,X.useState)(Je()),ue=Y.useRef(Je()),[x,de]=(0,X.useState)(y?.outputStyle||`default`),fe=Y.useRef(x),[C,me]=(0,X.useState)(y?.language),_e=Y.useRef(C),[w,xe]=(0,X.useState)(0),[T,E]=(0,X.useState)(0),[D,O]=(0,X.useState)(!1),De=ie(),{rows:ke}=ce(),je=a??Math.min(Math.floor(ke*.8),30),A=Math.max(5,je-10),j=S(e=>e.mainLoopModel),Pe=S(e=>e.verbose),Fe=S(e=>e.thinkingEnabled),Ie=S(e=>Ee()?e.fastMode:!1);S(e=>e.promptSuggestionEnabled);let Le=Be(y?.permissions?.defaultMode??`default`),M=ge(),[He,P]=(0,X.useState)({}),Ue=Y.useRef(Fe),[We]=(0,X.useState)(()=>qe(`localSettings`)),[Ge]=(0,X.useState)(()=>qe(`userSettings`)),Ke=Y.useRef(h),Ye=Se(),[Xe]=(0,X.useState)(()=>{let e=Ye.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,settings:e.settings}}),F=Y.useRef(!1),[tt,R]=(0,X.useState)(!1),[z,B]=(0,X.useState)(null),{query:V,setQuery:H,cursorOffset:rt}=Mt({isActive:D&&z===null&&!o,onExit:()=>O(!1),onExitUp:f,passthroughCtrlKeys:[`c`,`d`]}),ot=D&&!o;Y.useEffect(()=>{i?.(ot)},[ot,i]);let st=be(t.options.mcpClients),ct=!n(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),lt=Y.use(ye(!0)),ut=Ae(lt),U=$e();function dt(e){M(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),P(t=>{let n=it(e)+(Et(e,!1,at())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function ft(e){I(t=>({...t,verbose:e})),_({...L(),verbose:e}),M(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){I(t=>({...t,autoCompactEnabled:e})),_({...L(),autoCompactEnabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:y?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){N(`localSettings`,{spinnerTipsEnabled:e}),b(t=>({...t,spinnerTipsEnabled:e}))}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:y?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){N(`localSettings`,{cacheWarningEnabled:e}),b(t=>({...t,cacheWarningEnabled:e}))}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:y?.prefersReducedMotion??!1,type:`boolean`,onChange(e){N(`localSettings`,{prefersReducedMotion:e}),b(t=>({...t,prefersReducedMotion:e})),M(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}}))}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Fe??!0,type:`boolean`,onChange(e){M(t=>({...t,thinkingEnabled:e})),N(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1})}},...Ee()&&Ne()?[{id:`fastMode`,label:`Fast mode (${we} only)`,value:!!Ie,type:`boolean`,onChange(e){Ce(),N(`userSettings`,{fastMode:e?!0:void 0}),e?(M(e=>({...e,mainLoopModel:Te(),mainLoopModelForSession:null,fastMode:!0})),P(e=>({...e,model:Te(),"Fast mode":`ON`}))):(M(e=>({...e,fastMode:!1})),P(e=>({...e,"Fast mode":`OFF`})))}}]:[],...ct?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:g.fileCheckpointingEnabled,type:`boolean`,onChange(e){I(t=>({...t,fileCheckpointingEnabled:e})),_({...L(),fileCheckpointingEnabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Pe,type:`boolean`,onChange:ft},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:g.terminalProgressBarEnabled,type:`boolean`,onChange(e){I(t=>({...t,terminalProgressBarEnabled:e})),_({...L(),terminalProgressBarEnabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:g.showTurnDuration,type:`boolean`,onChange(e){I(t=>({...t,showTurnDuration:e})),_({...L(),showTurnDuration:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:Le,options:(()=>{let e=[`default`,`plan`];return[...e,...Ze.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=Be(e),n=t===`auto`?t:ze(t)?Ve(t):t,r=N(`userSettings`,{permissions:{...y?.permissions,defaultMode:n}});if(r.error){nt(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){I(t=>({...t,respectGitignore:e})),_({...L(),respectGitignore:e})}},...ve()?[{id:`copyOnSelect`,label:`Copy on select`,value:g.copyOnSelect??!0,type:`boolean`,onChange(e){I(t=>({...t,copyOnSelect:e})),_({...L(),copyOnSelect:e})}}]:[],U?{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){I(t=>({...t,preferredNotifChannel:e})),_({...L(),preferredNotifChannel:e})}},{id:`outputStyle`,label:`Output style`,value:x,type:`managedEnum`,onChange:()=>{}},{id:`language`,label:`Language`,value:C??`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){I(t=>({...t,editorMode:e})),_({...L(),editorMode:e})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:g.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){I(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),_({...L(),prStatusFooterEnabled:e})}},{id:`model`,label:`Model`,value:j===null?`Default (recommended)`:j,type:`managedEnum`,onChange:dt},...st?[{id:`diffTool`,label:`Diff tool`,value:g.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){I(t=>({...t,diffTool:e})),_({...L(),diffTool:e})}}]:[],...he()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:g.autoConnectIde??!1,type:`boolean`,onChange(e){I(t=>({...t,autoConnectIde:e})),_({...L(),autoConnectIde:e})}}],...he()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:g.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){I(t=>({...t,autoInstallIdeExtension:e})),_({...L(),autoInstallIdeExtension:e})}}]:[],...ut?[{id:`showExternalIncludesDialog`,label:`External AGENTS.md includes`,value:Qe().hasAgentsMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[]],W=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(w>=W.length){let e=Math.max(0,W.length-1);xe(e),E(Math.max(0,e-A+1));return}E(e=>w<e?w:w>=e+A?w-A+1:e)},[W.length,w,A]);let ht=(0,X.useCallback)(e=>{E(t=>e<t?e:e>=t+A?e-A+1:t)},[A]),_t=(0,X.useCallback)(()=>{if(z!==null)return;let t=Object.entries(He).map(([e,t])=>`Set ${e} to ${p.bold(t)}`);g.theme!==v.current.theme&&t.push(`Set theme to ${p.bold(g.theme)}`),g.preferredNotifChannel!==v.current.preferredNotifChannel&&t.push(`Set notifications to ${p.bold(g.preferredNotifChannel)}`),x!==fe.current&&t.push(`Set output style to ${p.bold(x)}`),C!==_e.current&&t.push(`Set response language to ${p.bold(C??`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.autoConnectIde!==v.current.autoConnectIde&&t.push(`${g.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),g.autoInstallIdeExtension!==v.current.autoInstallIdeExtension&&t.push(`${g.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),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!==ue.current?.autoUpdatesChannel&&t.push(`Set auto-update channel to ${p.bold(y?.autoUpdatesChannel??`latest`)}`),t.length>0?e(t.join(`
|
|
3
|
-
`)):e(`Config dialog dismissed`,{display:`system`})},[z,He,g,j,x,C,y?.autoUpdatesChannel,Ee()?y?.fastMode:void 0,e]),vt=(0,X.useCallback)(()=>{h!==Ke.current&&m(Ke.current),I(()=>v.current);let e=We;N(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=Ge;N(`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=Xe;M(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,settings:n.settings,toolPermissionContext:Oe(e.toolPermissionContext)}))},[h,m,We,Ge,Xe,M]);re(`confirm:no`,(0,X.useCallback)(()=>{z===null&&(F.current&&vt(),e(`Config dialog dismissed`,{display:`system`}))},[z,vt,e]),{context:`Settings`,isActive:z===null&&!D&&!o}),re(`settings:close`,_t,{context:`Settings`,isActive:z===null&&!D&&!o});let G=(0,X.useCallback)(()=>{let e=W[w];if(e?.onChange){if(e.type===`boolean`){F.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===Ue.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(U){B(`EnableAutoUpdates`),r(!0);return}(y?.autoUpdatesChannel??`latest`)===`latest`?(B(`ChannelDowngrade`),r(!0)):(F.current=!0,N(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),b(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})));return}if(e.type===`enum`){F.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[U,W,w,y?.autoUpdatesChannel,r]),yt=e=>{R(!1);let t=Math.max(0,Math.min(W.length-1,w+e));xe(t),ht(t)};return ee({"select:previous":()=>{w===0?(R(!1),O(!0),E(0)):yt(-1)},"select:next":()=>yt(1),"scroll:lineUp":()=>yt(-1),"scroll:lineDown":()=>yt(1),"select:accept":G,"select:previousValue":()=>G(),"select:nextValue":()=>G(),"settings:search":()=>{O(!0),H(``)}},{context:`Settings`,isActive:z===null&&!D&&!o}),(0,Z.jsx)(l,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(z===null&&!o){if(D){if(e.key===`escape`){e.preventDefault(),V.length>0?H(``):O(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),O(!1),xe(0),E(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),G();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),O(!0),H(e.key))}},[z,o,D,V,H,G]),children:z===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wt,{onThemeSelect:e=>{F.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)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):z===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Dt,{initial:j,onSelect:e=>{F.current=!0,dt(e),B(null),r(!1)},onCancel:()=>{B(null),r(!1)},showFastModeNotice:Ee()?Ie&&Me(j)&&Ne():!1}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):z===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(At,{onDone:()=>{B(null),r(!1)},externalIncludes:pe(lt)}),(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):z===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(on,{initialStyle:x,onComplete:e=>{F.current=!0,de(e??`default`),B(null),r(!1),N(`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)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):z===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(dn,{initialLanguage:C,onComplete:e=>{F.current=!0,me(e),B(null),r(!1),N(`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)(k,{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:U?.type===`config`?(0,Z.jsx)(mt,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{F.current=!0,B(null),r(!1),I(e=>({...e,autoUpdates:!0})),_({...L(),autoUpdates:!0}),N(`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:U?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),U?.type===`env`&&(0,Z.jsxs)(u,{dimColor:!0,children:[`Unset `,U.envVar,` to re-enable auto-updates.`]})]})}):z===`ChannelDowngrade`?(0,Z.jsx)(tn,{currentVersion:`0.0.25`,onChoice:e=>{if(B(null),r(!1),e===`cancel`)return;F.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.25`),N(`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:D&&!o,isTerminalFocused:De,cursorOffset:rt,placeholder:`Search settings…`}),(0,Z.jsx)(l,{flexDirection:`column`,children:W.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`]}),W.slice(T,T+A).map((e,t)=>{let n=T+t===w&&!o&&!D;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()}),tt&&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:gn[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(hn,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:Re(e.value)}):e.id===`autoUpdatesChannel`&&U?(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:[`(`,et(U),`)`]})]}):(0,Z.jsx)(u,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),T+A<W.length&&(0,Z.jsxs)(u,{dimColor:!0,children:[s.arrowDown,` `,W.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)(k,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):D?(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)(k,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(u,{dimColor:!0,children:(0,Z.jsxs)(d,{children:[(0,Z.jsx)(k,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(k,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(k,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(k,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function hn({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,gn,_n=e((()=>{_(),Y=t(f(),1),X=t(f(),1),de(),o(),F(),oe(),We(),E(),tt(),R(),Ct(),Fe(),Tt(),rt(),Ot(),kt(),rn(),St(),un(),pn(),x(),De(),ht(),jt(),Pe(),He(),w(),i(),Nt(),je(),A(),ke(),Z=y(),gn={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 vn({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=gt(),{rows:te}=W(ce()),l=ee?te+1:Math.max(15,Math.min(Math.floor(te*.8),30)),[u]=(0,Q.useState)(()=>Jt().catch(()=>[]));return dt(),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)(Xt,{context:t,diagnosticsPromise:u})},`status`),(0,$.jsx)(h,{title:`Config`,children:(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(mn,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:l})})},`config`)]})})}var Q,$,yn=e((()=>{Q=t(f(),1),de(),ft(),je(),ht(),_(),en(),_n(),$=y()}));export{yn as n,vn as t};
|
|
@@ -1 +0,0 @@
|
|
|
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-DL3w8VPk.js";import{t as w}from"./jsx-runtime-Bb4Xn-E0.js";import{Gn as T,Kn as E,Pt as te,m as D}from"./state-BQ4BEGin.js";import{Bp as ne,FC as re,Fp as O,Hp as ie,IC as ae,Ip as oe,ab as se,db as k,eb as ce,fb as le,ib as A,kb as ue,ms as de,nb as fe,ob as pe,ps as j,rb as me,tb as he,zp as ge}from"./loadAgentsDir-DGozQu_6.js";import{Hn as _e,Vn as M,h as N,t as P}from"./settings-CodSADx8.js";import{d as ve,o as ye}from"./config-CWPHVTic.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-DF0AjiDf.js";import{o as Ee}from"./TextInput-Cev5Awdd.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-CqrOK3Mx.js";import{watch as Ie}from"fs";var Le,Re,ze=e((()=>{te(),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??D,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=P().spinnerVerbs;return e?e.mode===`replace`?e.verbs.length>0?e.verbs:Ve:[...Ve,...e.verbs]:Ve}var Ve,He=e((()=>{N(),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]=I.useState(0),{rows:r,columns:i}=ee(),a=I.useRef(new Map),o=I.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,I.useEffect(()=>{if(a.current.size===0)return;let e=Date.now(),t=1/0;for(let n of a.current.values()){let r=n+Ke;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]),!me()||e.length===0)return null;let u=M(e,e=>e.status===`completed`),d=M(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<Ke?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=M(g,e=>e.status===`pending`),n=M(g,e=>e.status===`in_progress`),r=M(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,L.jsxs)(L.Fragment,{children:[h.map(e=>(0,L.jsx)(Ge,{task:e,openBlockers:e.blockedBy.filter(e=>p.has(e)),columns:i},e.id)),s>0&&_&&(0,L.jsx)(y,{dimColor:!0,children:_})]});return t?(0,L.jsxs)(v,{flexDirection:`column`,marginTop:1,marginLeft:2,children:[(0,L.jsx)(v,{children:(0,L.jsxs)(y,{dimColor:!0,children:[(0,L.jsx)(y,{bold:!0,children:e.length}),` tasks (`,(0,L.jsx)(y,{bold:!0,children:u}),` done, `,f>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(y,{bold:!0,children:f}),` in progress, `]}),(0,L.jsx)(y,{bold:!0,children:d}),` open)`]})}),b]}):(0,L.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,L.jsx)(v,{flexDirection:`column`,children:(0,L.jsxs)(v,{children:[(0,L.jsxs)(y,{color:s,children:[o,` `]}),(0,L.jsx)(y,{bold:i,strikethrough:r,dimColor:r||a,children:l}),a&&(0,L.jsxs)(y,{dimColor:!0,children:[` `,h.pointerSmall,` blocked by`,` `,[...t].sort((e,t)=>parseInt(e,10)-parseInt(t,10)).map(e=>`#${e}`).join(`, `)]})]})})}var I,L,Ke,qe=e((()=>{m(),I=t(x(),1),ue(),C(),_e(),Ce(),fe(),L=w(),Ke=3e4}));function Je(){l(ot,this).emit()}function Ye(e){if(!(e===l(V,this)&&l(B,this)!==null)){l(B,this)?.close(),d(B,this,null),d(V,this,e);try{d(B,this,Ie(e,l(st,this))),l(B,this).unref()}catch{}}}function Xe(e){d(H,this,null);let t=ce();t===e&&A(t).then(async e=>{e.length>0&&e.every(e=>e.status===`completed`)&&(await pe(t),d(R,this,[]),d(z,this,!0)),i(J,this,Je).call(this)})}function Ze(){l(H,this)&&(clearTimeout(l(H,this)),d(H,this,null))}function Qe(){l(B,this)?.close(),d(B,this,null),d(V,this,null),l(G,this)?.call(this),d(G,this,null),i(J,this,Ze).call(this),l(U,this)&&clearTimeout(l(U,this)),l(W,this)&&clearTimeout(l(W,this)),d(U,this,null),d(W,this,null),d(q,this,!1)}function $e(){return ut??(ut=new lt)}function et(){let e=me()?$e():null;return(0,nt.useSyncExternalStore)(e?e.subscribe:ft,e?e.getSnapshot:pt)}function tt(){let e=et(),t=ie(),n=e===void 0;return(0,nt.useEffect)(()=>{n&&t(e=>e.expandedView===`tasks`?{...e,expandedView:`none`}:e)},[n,t]),e}var nt,rt,it,at,R,z,B,V,H,U,W,G,ot,K,q,J,st,ct,lt,ut,dt,ft,pt,mt=e((()=>{nt=t(x(),1),ge(),E(),fe(),f(),a(),n(),o(),s(),c(),rt=5e3,it=50,at=5e3,R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,G=new WeakMap,ot=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakSet,st=new WeakMap,ct=new WeakMap,lt=class{constructor(){p(this,J),u(this,R,void 0),u(this,z,!1),u(this,B,null),u(this,V,null),u(this,H,null),u(this,U,null),u(this,W,null),u(this,G,null),u(this,ot,T()),u(this,K,0),u(this,q,!1),r(this,`getSnapshot`,()=>l(z,this)?void 0:l(R,this)),r(this,`subscribe`,e=>{var t;let n=l(ot,this).subscribe(e);d(K,this,(t=l(K,this),t++,t)),l(q,this)||(d(q,this,!0),d(G,this,se(l(st,this))),l(ct,this).call(this));let r=!1;return()=>{var e;r||(r=!0,n(),d(K,this,(e=l(K,this),e--,e)),l(K,this)===0&&i(J,this,Qe).call(this))}}),u(this,st,()=>{l(U,this)&&clearTimeout(l(U,this)),d(U,this,setTimeout(()=>void l(ct,this).call(this),it)),l(U,this).unref()}),u(this,ct,async()=>{let e=ce();i(J,this,Ye).call(this,he(e));let t=(await A(e)).filter(e=>!e.metadata?._internal);d(R,this,t);let n=t.some(e=>e.status!==`completed`);n||t.length===0?(d(z,this,t.length===0),i(J,this,Ze).call(this)):l(H,this)===null&&!l(z,this)&&(d(H,this,setTimeout(i(J,this,Xe).bind(this,e),rt)),l(H,this).unref()),i(J,this,Je).call(this),l(W,this)&&(clearTimeout(l(W,this)),d(W,this,null)),n&&(d(W,this,setTimeout(l(st,this),at)),l(W,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]),ie=O+20,ae=Math.floor(C/re),oe=t||te?-100:e===`requesting`?ae%ie-10:O+10-ae%ie,se=t?0:e===`tool-use`?(Math.sin(C/1e3*Math.PI)+1)/2:0,k=(0,Ot.useRef)(E);if(t)k.current=E;else{let e=E-k.current;if(e>0){let t;t=e<70?3:e<200?Math.max(8,Math.ceil(e*.15)):50,k.current=Math.min(k.current+t,E)}}let ce=k.current,le=Math.round(ce/4),A=Te(T),ue=g(A),de=le+m,fe=we(de),pe=g(`${h.arrowDown} ${fe} tokens`),j=x===`thinking`?`thinking`:typeof x==`number`?`thought for ${Math.max(1,Math.round(x/1e3))}s`:null,me=j?g(j):0,he=O+2,ge=kt,_e=x!==null,M=f||T>jt,N=p-he-5,P=_e&&N>me;!P&&_e&&x===`thinking`&&N>At&&(j=`thinking`,me=At,P=!0);let ve=P?me+ge:0,ye=M&&N>ve+ue,be=ve+(ye?ue+ge:0),xe=M&&de>0&&N>be+pe,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:A},`elapsedTime`)]:[],...xe?[(0,Z.jsxs)(v,{flexDirection:`row`,children:[(0,Z.jsx)(Dt,{mode:e}),(0,Z.jsxs)(y,{dimColor:!0,children:[fe,` tokens`]})]},`tokens`)]:[],...P&&j?[x===`thinking`&&!t?(0,Z.jsx)(y,{color:De,children:Se?`(${j})`:j},`thinking`):(0,Z.jsx)(y,{dimColor:!0,children:j},`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:oe,flashOpacity:se,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=oe(),m=p.prefersReducedMotion??!1,h=ne(e=>e.tasks),g=ne(e=>e.expandedView)===`tasks`,{columns:_}=ee(),b=et(),[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)(()=>ae(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`&&de(e)&&e.progress?.tokenCount&&(D+=e.progress.tokenCount);let re=r.current===null?Date.now()-t.current-n.current:r.current-t.current-n.current,O=o??`claude`,ie=s??`claudeShimmer`,se=p.spinnerTipsEnabled!==!1,ce=se&&re>18e5,le=se&&re>3e4&&!ye().btwUseCount,A=ce&&!T?`Use /clear to start fresh when switching topics and free up context`:le&&!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:O,shimmerColor:ie,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)(k,{children:(0,$.jsx)(Ue,{tasks:b})})}):T||A?(0,$.jsxs)(v,{width:`100%`,flexDirection:`column`,children:[null,(T||A)&&(0,$.jsx)(k,{children:(0,$.jsx)(y,{dimColor:!0,children:T?`Next: ${T.subject}`:`Tip: ${A}`})})]}):null]})}function zt(){let e=oe().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),re(),Ce(),ze(),He(),le(),qe(),mt(),ge(),ue(),Tt(),It(),O(),j(),te(),ve(),$=w(),Vt=Me(),Ht=[...Vt,...[...Vt].reverse()]}));export{bt as a,tt as c,Re as d,ze as f,St as i,Ue as l,Lt as n,mt as o,Ut as r,et as s,zt as t,qe as u};
|
|
@@ -1 +0,0 @@
|
|
|
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-DL3w8VPk.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{Bp as p,Cb as m,Dp as h,Eb as g,Ep as _,Hp as v,Sp as y,Tb as b,Tp as x,gi as S,kb as C,mi as w,wb as T,xp as E,zp as D}from"./loadAgentsDir-DGozQu_6.js";import{b as O,h as k}from"./settings-CodSADx8.js";import{n as A,t as j}from"./useExitOnCtrlCDWithKeybindings-DWRFdFoU.js";import{t as M}from"./select-Fq6g2Ejk.js";import{t as N}from"./CustomSelect-BvTftqEH.js";function P({onThemeSelect:e,showIntroText:d=!1,helpText:f=``,showHelpTextBelow:m=!1,hideEscToCancel:h=!1,skipExitHandling:g=!1,onCancel:y}){let[S]=n(),C=o(),{columns:T}=u(),D=x(),k=D===null?_(S):null,{setPreviewTheme:j,savePreview:N,cancelPreview:P}=s(),I=p(e=>e.settings.syntaxHighlightingDisabled)??!1,L=v();l(`ThemePicker`);let R=b(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);c(`theme:toggleSyntaxHighlighting`,()=>{if(D===null){let e=!I;O(`userSettings`,{syntaxHighlightingDisabled:e}),L(t=>({...t,settings:{...t.settings,syntaxHighlightingDisabled:e}}))}},{context:`ThemePicker`});let z=A(g?()=>{}: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&&!m&&(0,F.jsx)(i,{dimColor:!0,children:f})]}),(0,F.jsx)(M,{options:B,onFocus:e=>{j(e)},onChange:t=>{N(),e(t)},onCancel:g?()=>{P(),y?.()}:async()=>{P(),await w(0)},visibleOptionCount:B.length,defaultValue:C,defaultFocusValue:C})]}),(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)(E,{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:T})}),(0,F.jsxs)(i,{dimColor:!0,children:[` `,D===`env`?`Syntax highlighting disabled (via CLAUDE_CODE_SYNTAX_HIGHLIGHT=${process.env.CLAUDE_CODE_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:[m&&f&&(0,F.jsx)(r,{marginLeft:3,children:(0,F.jsx)(i,{dimColor:!0,children:f})}),!h&&(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(),C(),d(),g(),m(),T(),D(),S(),k(),N(),h(),y(),F=f()}));export{I as n,P as t};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{i as n,o as r}from"./envUtils-DfkgIdYf.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{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-DL3w8VPk.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{$f as v,$g as y,Au as b,Bf as x,Bp as S,Cb as C,Cv as w,Dc as ee,Dl as te,Ec as ne,El as re,Fd as ie,Fh as ae,Gd as oe,Hd as se,Hp as ce,Id as le,Ih as ue,Jf as de,Ji as fe,Kf as pe,Ld as me,Md as he,Mf as ge,Mu as _e,Nd as ve,Nu as ye,Pd as be,Q as xe,Rd as Se,Rl as Ce,Tl as we,UC as Te,Ud as Ee,Vf as De,WC as Oe,X as ke,Yf as Ae,aT as je,c as Me,cb as Ne,cy as Pe,dd as Fe,dy as Ie,ep as Le,et as Re,fy as ze,hd as T,iT as Be,jd as Ve,jf as He,ju as Ue,l as We,ld as Ge,ly as Ke,md as E,nt as qe,o as Je,pC as Ye,py as Xe,qf as Ze,r as Qe,rT as $e,s as et,sb as tt,t as nt,ua as rt,uy as it,wl as at,wv as ot,xS as st,zl as ct,zp as lt}from"./loadAgentsDir-DGozQu_6.js";import{n as ut,t as dt}from"./cwd-BvNt_018.js";import{H as ft,I as pt,N as mt,S as ht,V as gt,Y as _t,x as vt}from"./debug-CRnGsZOV.js";import{Hn as yt,Qt as bt,Vn as xt,Xt as St,Z as Ct,it as wt,ln as Tt,q as Et,rt as Dt,sn as Ot}from"./settings-CodSADx8.js";import{E as kt,O as At}from"./config-CWPHVTic.js";import{o as jt,s as Mt}from"./log-DoSpAwRP.js";import{l as Nt,n as Pt,o as Ft}from"./stringUtils-Bu_lJH5c.js";import{n as It}from"./analytics-COpjZpvd.js";import{S as Lt,_ as Rt}from"./startupProfiler-DF0AjiDf.js";import{_n as zt,vn as Bt}from"./prompt-DzO1um1h.js";import{a as Vt,i as Ht,n as Ut,o as Wt,r as Gt,t as Kt}from"./agentDisplay-B3npXoCS.js";import{n as qt,t as Jt}from"./TextInput-Cev5Awdd.js";import{n as Yt,t as Xt}from"./useExitOnCtrlCDWithKeybindings-DWRFdFoU.js";import{n as Zt,t as Qt}from"./select-Fq6g2Ejk.js";import{r as $t,t as en}from"./Spinner-VjwI7m_g.js";import{n as tn,t as nn}from"./useMergedTools-C5Yns9Ij.js";import{n as rn,r as an,t as on}from"./promptEditor-B6S_Rzcu.js";import{n as sn,t as cn}from"./useMainLoopModel-DSN5HjV1.js";import{join as D}from"path";import{mkdir as ln,open as un,unlink as dn}from"fs/promises";var O,fn=e((()=>{O={FOLDER_NAME:`.workmate`,AGENTS_DIR:`agents`}}));function pn(e,t,n,r,i,a,o){return`---
|
|
2
|
-
name: ${e}
|
|
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
|
-
---
|
|
5
|
-
|
|
6
|
-
${r}
|
|
7
|
-
`}function mn(e){switch(e){case`flagSettings`:throw Error(`Cannot get directory path for ${e} agents`);case`userSettings`:return D(n(),O.AGENTS_DIR);case`projectSettings`:return D(dt(),O.FOLDER_NAME,O.AGENTS_DIR);case`policySettings`:return D(St(),O.FOLDER_NAME,O.AGENTS_DIR);case`localSettings`:return D(dt(),O.FOLDER_NAME,O.AGENTS_DIR)}}function hn(e){switch(e){case`projectSettings`:return D(`.`,O.FOLDER_NAME,O.AGENTS_DIR);default:return mn(e)}}function gn(e){return D(mn(e.source),`${e.agentType}.md`)}function _n(e){if(e.source===`built-in`)return`Built-in`;if(e.source===`plugin`)throw Error(`Cannot get file path for plugin agents`);return D(mn(e.source),`${e.filename||e.agentType}.md`)}function vn(e){return e.source===`built-in`?`Built-in`:D(hn(e.source),`${e.agentType}.md`)}function yn(e){return et(e)?`Built-in`:We(e)?`Plugin: ${e.plugin||`Unknown`}`:e.source===`flagSettings`?`CLI argument`:D(hn(e.source),`${e.filename||e.agentType}.md`)}async function bn(e){let t=mn(e);return await ln(t,{recursive:!0}),t}async function xn(e,t,n,r,i,a=!0,o,s,c){if(e===`built-in`)throw Error(`Cannot save built-in agents`);await bn(e);let l=gn({source:e,agentType:t}),u=pn(t,n,r,i,o,s,c);try{await wn(l,u,a?`wx`:`w`)}catch(e){throw mt(e)===`EEXIST`?Error(`Agent file already exists: ${l}`):e}}async function Sn(e,t,n,r,i,a,o){if(e.source===`built-in`)throw Error(`Cannot update built-in agents`);await wn(_n(e),pn(e.agentType,t,n,r,i,a,o))}async function Cn(e){if(e.source===`built-in`)throw Error(`Cannot delete built-in agents`);let t=_n(e);try{await dn(t)}catch(e){if(mt(e)!==`ENOENT`)throw e}}async function wn(e,t,n=`w`){let r=await un(e,n);try{await r.writeFile(t,{encoding:`utf-8`}),await r.datasync()}finally{await r.close()}}var Tn=e((()=>{bt(),Je(),ut(),r(),pt(),fn()}));function En({agent:e,tools:t,onBack:n}){let r=ve(e,t,!1),i=yn(e),o=le(e.agentType);d(`confirm:no`,n,{context:`Confirmation`});let s=e=>{e.key===`return`&&(e.preventDefault(),n())};function u(){return r.hasWildcard?(0,k.jsx)(l,{children:`All tools`}):!e.tools||e.tools.length===0?(0,k.jsx)(l,{children:`None`}):(0,k.jsxs)(k.Fragment,{children:[r.validTools.length>0&&(0,k.jsx)(l,{children:r.validTools.join(`, `)}),r.invalidTools.length>0&&(0,k.jsxs)(l,{color:`warning`,children:[a.warning,` Unrecognized: `,r.invalidTools.join(`, `)]})]})}return(0,k.jsxs)(c,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,k.jsx)(l,{dimColor:!0,children:i}),(0,k.jsxs)(c,{flexDirection:`column`,children:[(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Description`}),` (tells Work Mate when to use this agent):`]}),(0,k.jsx)(c,{marginLeft:2,children:(0,k.jsx)(l,{children:e.whenToUse})})]}),(0,k.jsxs)(c,{children:[(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Tools`}),`:`,` `]}),u()]}),(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Model`}),`: `,se(e.model)]}),e.permissionMode&&(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Permission mode`}),`: `,e.permissionMode]}),e.memory&&(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Memory`}),`: `,$e(e.memory)]}),e.hooks&&Object.keys(e.hooks).length>0&&(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Hooks`}),`: `,Object.keys(e.hooks).join(`, `)]}),e.skills&&e.skills.length>0&&(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Skills`}),`:`,` `,e.skills.length>10?`${e.skills.length} skills`:e.skills.join(`, `)]}),o&&(0,k.jsx)(c,{children:(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`Color`}),`:`,` `,(0,k.jsxs)(l,{backgroundColor:o,color:`inverseText`,children:[` `,e.agentType,` `]})]})}),!et(e)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(c,{children:(0,k.jsxs)(l,{children:[(0,k.jsx)(l,{bold:!0,children:`System prompt`}),`:`]})}),(0,k.jsx)(c,{marginLeft:2,marginRight:2,children:(0,k.jsx)(Ge,{children:e.getSystemPrompt()})})]})]})}var k,Dn=e((()=>{i(),h(),C(),me(),Be(),he(),Je(),oe(),Fe(),Tn(),k=_()}));function On({agentName:e,currentColor:t=`automatic`,onConfirm:n}){let[r,i]=(0,kn.useState)(Math.max(0,j.indexOf(t))),o=e=>{if(e.key===`up`)e.preventDefault(),i(e=>e>0?e-1:j.length-1);else if(e.key===`down`)e.preventDefault(),i(e=>e<j.length-1?e+1:0);else if(e.key===`return`){e.preventDefault();let t=j[r];n(t===`automatic`?void 0:t)}},s=j[r];return(0,A.jsxs)(c,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:o,children:[(0,A.jsx)(c,{flexDirection:`column`,children:j.map((e,t)=>{let n=t===r;return(0,A.jsxs)(c,{flexDirection:`row`,gap:1,children:[(0,A.jsx)(l,{color:n?`suggestion`:void 0,children:n?a.pointer:` `}),e===`automatic`?(0,A.jsx)(l,{bold:n,children:`Automatic color`}):(0,A.jsxs)(c,{gap:1,children:[(0,A.jsx)(l,{backgroundColor:ie[e],color:`inverseText`,children:` `}),(0,A.jsx)(l,{bold:n,children:Pt(e)})]})]},e)})}),(0,A.jsxs)(c,{marginTop:1,children:[(0,A.jsx)(l,{children:`Preview: `}),s===void 0||s===`automatic`?(0,A.jsxs)(l,{inverse:!0,bold:!0,children:[` `,`@`,e,` `]}):(0,A.jsxs)(l,{backgroundColor:ie[s],color:`inverseText`,bold:!0,children:[` `,`@`,e,` `]})]})]})}var kn,A,j,An=e((()=>{i(),kn=t(f(),1),h(),me(),Ft(),A=_(),j=[`automatic`,...be]}));function jn({initialModel:e,onComplete:t,onCancel:n}){let r=Mn.useMemo(()=>{let t=Ee();return e&&!t.some(t=>t.value===e)?[{value:e,label:e,description:`Current model (custom ID)`},...t]:t},[e]);return(0,Nn.jsxs)(c,{flexDirection:`column`,children:[(0,Nn.jsx)(c,{marginBottom:1,children:(0,Nn.jsx)(l,{dimColor:!0,children:`Model determines the agent's reasoning capabilities and speed.`})}),(0,Nn.jsx)(Qt,{options:r,defaultValue:e??`sonnet`,onChange:t,onCancel:()=>n?n():t(void 0)})]})}var Mn,Nn,Pn=e((()=>{Mn=t(f(),1),h(),oe(),Zt(),Nn=_()}));function Fn(){return{READ_ONLY:{name:`Read-only tools`,toolNames:new Set([pe.name,de.name,at.name,tt.name,x.name,Ce.name,re.name,ze.name,it.name])},EDIT:{name:`Edit tools`,toolNames:new Set([_e.name,v.name,b.name])},EXECUTION:{name:`Execution tools`,toolNames:new Set([He.name])},MCP:{name:`MCP tools`,toolNames:new Set,isMcp:!0},OTHER:{name:`Other tools`,toolNames:new Set}}}function In(e){let t=new Map;return e.forEach(e=>{if(ot(e)){let n=wt(e.name);if(n?.serverName){let r=t.get(n.serverName)||[];r.push(e),t.set(n.serverName,r)}}}),Array.from(t.entries()).map(([e,t])=>({serverName:e,tools:t})).sort((e,t)=>e.serverName.localeCompare(t.serverName))}function Ln({tools:e,initialTools:t,onComplete:n,onCancel:r}){let i=(0,M.useMemo)(()=>Ve({tools:e,isBuiltIn:!1,isAsync:!1}),[e]),[s,u]=(0,M.useState)(!t||t.includes(`*`)?i.map(e=>e.name):t),[f,p]=(0,M.useState)(0),[m,h]=(0,M.useState)(!1),g=(0,M.useMemo)(()=>{let e=new Set(i.map(e=>e.name));return s.filter(t=>e.has(t))},[s,i]),_=new Set(g),v=g.length===i.length&&i.length>0,y=e=>{e&&u(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=(e,t)=>{u(n=>{if(t){let t=e.filter(e=>!n.includes(e));return[...n,...t]}else return n.filter(t=>!e.includes(t))})},x=()=>{let e=i.map(e=>e.name);n(g.length===e.length&&e.every(e=>g.includes(e))?void 0:g)},S=(0,M.useMemo)(()=>{let e=Fn(),t={readOnly:[],edit:[],execution:[],mcp:[],other:[]};return i.forEach(n=>{ot(n)?t.mcp.push(n):e.READ_ONLY.toolNames.has(n.name)?t.readOnly.push(n):e.EDIT.toolNames.has(n.name)?t.edit.push(n):e.EXECUTION.toolNames.has(n.name)?t.execution.push(n):n.name!==`Agent`&&t.other.push(n)}),t},[i]),C=e=>{let t=xt(e,e=>_.has(e.name))<e.length;return()=>{let n=e.map(e=>e.name);b(n,t)}},w=[];w.push({id:`continue`,label:`Continue`,action:x,isContinue:!0}),w.push({id:`bucket-all`,label:`${v?a.checkboxOn:a.checkboxOff} All tools`,action:()=>{let e=i.map(e=>e.name);b(e,!v)}});let ee=Fn();[{id:`bucket-readonly`,name:ee.READ_ONLY.name,tools:S.readOnly},{id:`bucket-edit`,name:ee.EDIT.name,tools:S.edit},{id:`bucket-execution`,name:ee.EXECUTION.name,tools:S.execution},{id:`bucket-mcp`,name:ee.MCP.name,tools:S.mcp},{id:`bucket-other`,name:ee.OTHER.name,tools:S.other}].forEach(({id:e,name:t,tools:n})=>{if(n.length===0)return;let r=xt(n,e=>_.has(e.name))===n.length;w.push({id:e,label:`${r?a.checkboxOn:a.checkboxOff} ${t}`,action:C(n)})});let te=w.length;w.push({id:`toggle-individual`,label:m?`Hide advanced options`:`Show advanced options`,action:()=>{h(!m),m&&f>te&&p(te)},isToggle:!0});let ne=(0,M.useMemo)(()=>In(i),[i]);return m&&(ne.length>0&&(w.push({id:`mcp-servers-header`,label:`MCP Servers:`,action:()=>{},isHeader:!0}),ne.forEach(({serverName:e,tools:t})=>{let n=xt(t,e=>_.has(e.name))===t.length;w.push({id:`mcp-server-${e}`,label:`${n?a.checkboxOn:a.checkboxOff} ${e} (${t.length} ${Nt(t.length,`tool`)})`,action:()=>{let e=t.map(e=>e.name);b(e,!n)}})}),w.push({id:`tools-header`,label:`Individual Tools:`,action:()=>{},isHeader:!0})),i.forEach(e=>{let t=e.name;if(e.name.startsWith(`mcp__`)){let n=wt(e.name);t=n?`${n.toolName} (${n.serverName})`:e.name}w.push({id:`tool-${e.name}`,label:`${_.has(e.name)?a.checkboxOn:a.checkboxOff} ${t}`,action:()=>y(e.name)})})),d(`confirm:no`,(0,M.useCallback)(()=>{r?r():n(t)},[r,n,t]),{context:`Confirmation`}),(0,N.jsxs)(c,{flexDirection:`column`,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(e.key===`return`){e.preventDefault();let t=w[f];t&&!t.isHeader&&t.action()}else if(e.key===`up`){e.preventDefault();let t=f-1;for(;t>0&&w[t]?.isHeader;)t--;p(Math.max(0,t))}else if(e.key===`down`){e.preventDefault();let t=f+1;for(;t<w.length-1&&w[t]?.isHeader;)t++;p(Math.min(w.length-1,t))}},children:[(0,N.jsxs)(l,{color:f===0?`suggestion`:void 0,bold:f===0,children:[f===0?`${a.pointer} `:` `,`[ Continue ]`]}),(0,N.jsx)(o,{width:40}),w.slice(1).map((e,t)=>{let n=t+1===f,r=e.isToggle,i=e.isHeader;return(0,N.jsxs)(M.Fragment,{children:[r&&(0,N.jsx)(o,{width:40}),i&&t>0&&(0,N.jsx)(c,{marginTop:1}),(0,N.jsxs)(l,{color:i?void 0:n?`suggestion`:void 0,dimColor:i,bold:r&&n,children:[i?``:n?`${a.pointer} `:` `,r?`[ ${e.label} ]`:e.label]})]},e.id)}),(0,N.jsx)(c,{marginTop:1,flexDirection:`column`,children:(0,N.jsx)(l,{dimColor:!0,children:v?`All tools selected`:`${_.size} of ${i.length} tools selected`})})]})}var M,N,Rn=e((()=>{i(),M=t(f(),1),Dt(),w(),he(),Ct(),ge(),we(),ye(),Ne(),Le(),Ze(),Ae(),Xe(),Ue(),Ie(),te(),ct(),De(),h(),C(),yt(),Ft(),N=_()}));function zn(e){return e===`all`?`Agents`:e===`built-in`?`Built-in agents`:e===`plugin`?`Plugin agents`:Te(Ot(e))}var Bn=e((()=>{Oe(),Tt()}));function Vn({agent:e,tools:t,onSaved:n,onBack:r}){let i=ce(),[o,s]=(0,P.useState)(`menu`),[u,f]=(0,P.useState)(0),[m,h]=(0,P.useState)(null),[g,_]=(0,P.useState)(e.color),v=(0,P.useCallback)(async()=>{let t=await on(_n(e));t.error?h(t.error):n(`Opened ${e.agentType} in editor. If you made edits, restart to load the latest version.`)},[e,n]),y=(0,P.useCallback)(async(t={})=>{let{tools:r,color:a,model:o}=t,s=a??g,c=r!==void 0,l=o!==void 0,u=s!==e.color;if(!c&&!l&&!u)return!1;try{return!Me(e)&&!We(e)?!1:(await Sn(e,e.whenToUse,r??e.tools,e.getSystemPrompt(),s,o??e.model),u&&s&&Se(e.agentType,s),i(t=>{let n=t.agentDefinitions.allAgents.map(t=>t.agentType===e.agentType?{...t,tools:r??t.tools,color:s,model:o??t.model}:t);return{...t,agentDefinitions:{...t.agentDefinitions,activeAgents:Qe(n),allAgents:n}}}),n(`Updated agent: ${p.bold(e.agentType)}`),!0)}catch(e){return h(e instanceof Error?e.message:`Failed to save agent`),!1}},[e,g,n,i]),b=(0,P.useMemo)(()=>[{label:`Open in editor`,action:v},{label:`Edit tools`,action:()=>s(`edit-tools`)},{label:`Edit model`,action:()=>s(`edit-model`)},{label:`Edit color`,action:()=>s(`edit-color`)}],[v]),x=(0,P.useCallback)(()=>{h(null),o===`menu`?r():s(`menu`)},[o,r]),S=(0,P.useCallback)(e=>{if(e.key===`up`)e.preventDefault(),f(e=>Math.max(0,e-1));else if(e.key===`down`)e.preventDefault(),f(e=>Math.min(b.length-1,e+1));else if(e.key===`return`){e.preventDefault();let t=b[u];t&&t.action()}},[b,u]);d(`confirm:no`,x,{context:`Confirmation`});let C=()=>(0,F.jsxs)(c,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:S,children:[(0,F.jsxs)(l,{dimColor:!0,children:[`Source: `,zn(e.source)]}),(0,F.jsx)(c,{marginTop:1,flexDirection:`column`,children:b.map((e,t)=>(0,F.jsxs)(l,{color:t===u?`suggestion`:void 0,children:[t===u?`${a.pointer} `:` `,e.label]},e.label))}),m&&(0,F.jsx)(c,{marginTop:1,children:(0,F.jsx)(l,{color:`error`,children:m})})]});switch(o){case`menu`:return C();case`edit-tools`:return(0,F.jsx)(Ln,{tools:t,initialTools:e.tools,onComplete:async e=>{s(`menu`),await y({tools:e})}});case`edit-color`:return(0,F.jsx)(On,{agentName:e.agentType,currentColor:g||e.color||`automatic`,onConfirm:async e=>{_(e),s(`menu`),await y({color:e})}});case`edit-model`:return(0,F.jsx)(jn,{initialModel:e.model,onComplete:async e=>{s(`menu`),await y({model:e})}});default:return null}}var P,F,Hn=e((()=>{m(),i(),P=t(f(),1),lt(),h(),C(),me(),Je(),an(),Tn(),An(),Pn(),Rn(),Bn(),F=_()}));function Un({instructions:e=`Press ↑↓ to navigate · Enter to select · Esc to go back`}){let t=Yt();return(0,Wn.jsx)(c,{marginLeft:2,children:(0,Wn.jsx)(l,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var Wn,Gn=e((()=>{Xt(),h(),Wn=_()}));function Kn({source:e,agents:t,onBack:n,onSelect:r,onCreateNew:i,changes:s}){let[u,d]=I.useState(null),[f,p]=I.useState(!0),m=I.useMemo(()=>[...t].sort(Ut),[t]),h=e=>({isOverridden:!!e.overriddenBy,overriddenBy:e.overriddenBy||null}),_=()=>(0,L.jsxs)(c,{children:[(0,L.jsx)(l,{color:f?`suggestion`:void 0,children:f?`${a.pointer} `:` `}),(0,L.jsx)(l,{color:f?`suggestion`:void 0,children:`Create new agent`})]}),v=e=>{let t=e.source===`built-in`,n=!t&&!f&&u?.agentType===e.agentType&&u?.source===e.source,{isOverridden:r,overriddenBy:i}=h(e),o=t||r,s=!t&&n?`suggestion`:void 0,d=Vt(e);return(0,L.jsxs)(c,{children:[(0,L.jsx)(l,{dimColor:o&&!n,color:s,children:t?``:n?`${a.pointer} `:` `}),(0,L.jsx)(l,{dimColor:o&&!n,color:s,children:e.agentType}),d&&(0,L.jsxs)(l,{dimColor:!0,color:s,children:[` · `,d]}),e.memory&&(0,L.jsxs)(l,{dimColor:!0,color:s,children:[` · `,e.memory,` memory`]}),i&&(0,L.jsxs)(l,{dimColor:!n,color:n?`warning`:void 0,children:[` `,a.warning,` shadowed by `,Gt(i)]})]},`${e.agentType}-${e.source}`)},y=I.useMemo(()=>{let t=m.filter(e=>e.source!==`built-in`);return e===`all`?Kt.filter(e=>e.source!==`built-in`).flatMap(({source:e})=>t.filter(t=>t.source===e)):t},[m,e]);I.useEffect(()=>{!u&&!f&&y.length>0&&(i?p(!0):d(y[0]||null))},[y,u,f,i]);let b=e=>{if(e.key===`return`){e.preventDefault(),f&&i?i():u&&r(u);return}if(e.key!==`up`&&e.key!==`down`)return;e.preventDefault();let t=!!i,n=y.length+ +!!t;if(n===0)return;let a=0;if(!f&&u){let e=y.findIndex(e=>e.agentType===u.agentType&&e.source===u.source);e>=0&&(a=t?e+1:e)}let o=e.key===`up`?a===0?n-1:a-1:a===n-1?0:a+1;if(t&&o===0)p(!0),d(null);else{let e=t?o-1:o,n=y[e];n&&(p(!1),d(n))}},x=(e=`Built-in (always available):`)=>{let t=m.filter(e=>e.source===`built-in`);return(0,L.jsxs)(c,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,L.jsx)(l,{bold:!0,dimColor:!0,children:e}),t.map(v)]})},S=(e,t)=>{if(!t.length)return null;let n=t[0]?.baseDir;return(0,L.jsxs)(c,{flexDirection:`column`,marginBottom:1,children:[(0,L.jsxs)(c,{paddingLeft:2,children:[(0,L.jsx)(l,{bold:!0,dimColor:!0,children:e}),n&&(0,L.jsxs)(l,{dimColor:!0,children:[` (`,n,`)`]})]}),t.map(e=>v(e))]})},C=zn(e),w=m.filter(e=>e.source===`built-in`);return!m.length||e!==`built-in`&&!m.some(e=>e.source!==`built-in`)?(0,L.jsx)(g,{title:C,subtitle:`No agents found`,onCancel:n,hideInputGuide:!0,children:(0,L.jsxs)(c,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:b,children:[i&&(0,L.jsx)(c,{children:_()}),(0,L.jsx)(l,{dimColor:!0,children:`No agents found. Create specialized subagents that Work Mate can delegate to.`}),(0,L.jsx)(l,{dimColor:!0,children:`Each subagent has its own context window, custom system prompt, and specific tools.`}),(0,L.jsx)(l,{dimColor:!0,children:`Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer.`}),e!==`built-in`&&m.some(e=>e.source===`built-in`)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(o,{}),x()]})]})}):(0,L.jsxs)(g,{title:C,subtitle:`${xt(m,e=>!e.overriddenBy)} agents`,onCancel:n,hideInputGuide:!0,children:[s&&s.length>0&&(0,L.jsx)(c,{marginTop:1,children:(0,L.jsx)(l,{dimColor:!0,children:s[s.length-1]})}),(0,L.jsxs)(c,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:b,children:[i&&(0,L.jsx)(c,{marginBottom:1,children:_()}),e===`all`?(0,L.jsxs)(L.Fragment,{children:[Kt.filter(e=>e.source!==`built-in`).map(({label:e,source:t})=>(0,L.jsx)(I.Fragment,{children:S(e,m.filter(e=>e.source===t))},t)),w.length>0&&(0,L.jsxs)(c,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,L.jsxs)(l,{dimColor:!0,children:[(0,L.jsx)(l,{bold:!0,children:`Built-in agents`}),` (always available)`]}),w.map(v)]})]}):e===`built-in`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(l,{dimColor:!0,italic:!0,children:`Built-in agents are provided by default and cannot be modified.`}),(0,L.jsx)(c,{marginTop:1,flexDirection:`column`,children:m.map(e=>v(e))})]}):(0,L.jsxs)(L.Fragment,{children:[m.filter(e=>e.source!==`built-in`).map(e=>v(e)),m.some(e=>e.source===`built-in`)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(o,{}),x()]})]})]})]})}var I,L,qn=e((()=>{i(),I=t(f(),1),h(),Ht(),yt(),Bn(),L=_()}));function Jn({steps:e,initialData:t={},onComplete:n,onCancel:r,children:i,title:a,showStepCounter:o=!0}){let[s,c]=(0,R.useState)(0),[l,u]=(0,R.useState)(t),[d,f]=(0,R.useState)(!1),[p,m]=(0,R.useState)([]);Yt(),(0,R.useEffect)(()=>{d&&(m([]),n(l))},[d,l,n]);let h=(0,R.useCallback)(()=>{s<e.length-1?(p.length>0&&m(e=>[...e,s]),c(e=>e+1)):f(!0)},[s,e.length,p]),g=(0,R.useCallback)(()=>{if(p.length>0){let e=p[p.length-1];e!==void 0&&(m(e=>e.slice(0,-1)),c(e))}else s>0?c(e=>e-1):r&&r()},[s,p,r]),_=(0,R.useCallback)(t=>{t>=0&&t<e.length&&(m(e=>[...e,s]),c(t))},[s,e.length]),v=(0,R.useCallback)(()=>{m([]),r&&r()},[r]),y=(0,R.useCallback)(e=>{u(t=>({...t,...e}))},[]),b=(0,R.useMemo)(()=>({currentStepIndex:s,totalSteps:e.length,wizardData:l,setWizardData:u,updateWizardData:y,goNext:h,goBack:g,goToStep:_,cancel:v,title:a,showStepCounter:o}),[s,e.length,l,y,h,g,_,v,a,o]),x=e[s];return!x||d?null:(0,Yn.jsx)(Xn.Provider,{value:b,children:i||(0,Yn.jsx)(x,{})})}var R,Yn,Xn,Zn=e((()=>{R=t(f(),1),Xt(),Yn=_(),Xn=(0,R.createContext)(null)}));function z(){let e=(0,Qn.useContext)(Xn);if(!e)throw Error(`useWizard must be used within a WizardProvider`);return e}var Qn,$n=e((()=>{Qn=t(f(),1),Zn()}));function er({instructions:e=(0,tr.jsxs)(u,{children:[(0,tr.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,tr.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,tr.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})}){let t=Yt();return(0,tr.jsx)(c,{marginLeft:3,marginTop:1,children:(0,tr.jsx)(l,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var tr,nr=e((()=>{Xt(),h(),T(),tr=_()}));function B({title:e,color:t=`suggestion`,children:n,subtitle:r,footerText:i}){let{currentStepIndex:a,totalSteps:o,title:s,showStepCounter:c,goBack:l}=z();return(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(g,{title:`${e||s||`Wizard`}${c===!1?``:` (${a+1}/${o})`}`,subtitle:r,onCancel:l,color:t,hideInputGuide:!0,isCancelActive:!1,children:n}),(0,rr.jsx)(er,{instructions:i})]})}var rr,V=e((()=>{h(),$n(),nr(),rr=_()})),H=e((()=>{$n(),V(),nr(),Zn()}));function ir(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z();return d(`confirm:no`,t,{context:`Confirmation`}),(0,U.jsx)(B,{subtitle:`Choose background color`,footerText:(0,U.jsxs)(u,{children:[(0,U.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,U.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,U.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,U.jsx)(c,{children:(0,U.jsx)(On,{agentName:r.agentType||`agent`,currentColor:`automatic`,onConfirm:t=>{n({selectedColor:t,finalAgent:{agentType:r.agentType,whenToUse:r.whenToUse,getSystemPrompt:()=>r.systemPrompt,tools:r.selectedTools,...r.selectedModel?{model:r.selectedModel}:{},...t?{color:t}:{},source:r.location}}),e()}})})})}var U,ar=e((()=>{h(),C(),T(),H(),V(),An(),U=_()}));function or(e){return e?/^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$/.test(e)?e.length<3?`Agent type must be at least 3 characters long`:e.length>50?`Agent type must be less than 50 characters`:null:`Agent type must start and end with alphanumeric characters and contain only letters, numbers, and hyphens`:`Agent type is required`}function sr(e,t,n){let r=[],i=[];if(!e.agentType)r.push(`Agent type is required`);else{let t=or(e.agentType);t&&r.push(t);let i=n.find(t=>t.agentType===e.agentType&&t.source!==e.source);i&&r.push(`Agent type "${e.agentType}" already exists in ${zn(i.source)}`)}if(e.whenToUse?e.whenToUse.length<10?i.push(`Description should be more descriptive (at least 10 characters)`):e.whenToUse.length>5e3&&i.push(`Description is very long (over 5000 characters)`):r.push(`Description (description) is required`),e.tools!==void 0&&!Array.isArray(e.tools))r.push(`Tools must be an array`);else{e.tools===void 0?i.push(`Agent has access to all tools`):e.tools.length===0&&i.push(`No tools selected - agent will have very limited capabilities`);let n=ve(e,t,!1);n.invalidTools.length>0&&r.push(`Invalid tools: ${n.invalidTools.join(`, `)}`)}let a=e.getSystemPrompt();return a?a.length<20?r.push(`System prompt is too short (minimum 20 characters)`):a.length>1e4&&i.push(`System prompt is very long (over 10,000 characters)`):r.push(`System prompt is required`),{isValid:r.length===0,errors:r,warnings:i}}var cr=e((()=>{he(),Bn()}));function lr({tools:e,existingAgents:t,onSave:n,onSaveAndEdit:r,error:i}){let{goBack:a,wizardData:o}=z();d(`confirm:no`,a,{context:`Confirmation`});let f=e=>{e.key===`s`||e.key===`return`?(e.preventDefault(),n()):e.key===`e`&&(e.preventDefault(),r())},p=o.finalAgent,m=sr(p,e,t),h=Lt(p.getSystemPrompt(),240),g=Lt(p.whenToUse,240),_=e=>e===void 0?`All tools`:e.length===0?`None`:e.length===1?e[0]||`None`:e.length===2?e.join(` and `):`${e.slice(0,-1).join(`, `)}, and ${e[e.length-1]}`,v=At()?(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`Memory`}),`: `,$e(p.memory)]}):null;return(0,W.jsx)(B,{subtitle:`Confirm and save`,footerText:(0,W.jsxs)(u,{children:[(0,W.jsx)(s,{shortcut:`s/Enter`,action:`save`}),(0,W.jsx)(s,{shortcut:`e`,action:`edit in your editor`}),(0,W.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,W.jsxs)(c,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:f,children:[(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`Name`}),`: `,p.agentType]}),(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`Location`}),`:`,` `,vn({source:o.location,agentType:p.agentType})]}),(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`Tools`}),`: `,_(p.tools)]}),(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`Model`}),`: `,se(p.model)]}),v,(0,W.jsx)(c,{marginTop:1,children:(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`Description`}),` (tells Work Mate when to use this agent):`]})}),(0,W.jsx)(c,{marginLeft:2,marginTop:1,children:(0,W.jsx)(l,{children:g})}),(0,W.jsx)(c,{marginTop:1,children:(0,W.jsxs)(l,{children:[(0,W.jsx)(l,{bold:!0,children:`System prompt`}),`:`]})}),(0,W.jsx)(c,{marginLeft:2,marginTop:1,children:(0,W.jsx)(l,{children:h})}),m.warnings.length>0&&(0,W.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(l,{color:`warning`,children:`Warnings:`}),m.warnings.map((e,t)=>(0,W.jsxs)(l,{dimColor:!0,children:[` `,`• `,e]},t))]}),m.errors.length>0&&(0,W.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(l,{color:`error`,children:`Errors:`}),m.errors.map((e,t)=>(0,W.jsxs)(l,{color:`error`,children:[` `,`• `,e]},t))]}),i&&(0,W.jsx)(c,{marginTop:1,children:(0,W.jsx)(l,{color:`error`,children:i})}),(0,W.jsx)(c,{marginTop:2,children:(0,W.jsxs)(l,{color:`success`,children:[`Press `,(0,W.jsx)(l,{bold:!0,children:`s`}),` or `,(0,W.jsx)(l,{bold:!0,children:`Enter`}),` to save, `,(0,W.jsx)(l,{bold:!0,children:`e`}),` to save and edit`]})})]})})}var W,ur=e((()=>{h(),C(),kt(),Be(),Rt(),oe(),T(),H(),V(),Tn(),cr(),W=_()}));function dr({tools:e,existingAgents:t,onComplete:n}){let{wizardData:r}=z(),[i,a]=(0,fr.useState)(null),o=ce(),s=(0,fr.useCallback)(async e=>{if(r?.finalAgent)try{await xn(r.location,r.finalAgent.agentType,r.finalAgent.whenToUse,r.finalAgent.tools,r.finalAgent.getSystemPrompt(),!0,r.finalAgent.color,r.finalAgent.model,r.finalAgent.memory),o(e=>{if(!r.finalAgent)return e;let t=e.agentDefinitions.allAgents.concat(r.finalAgent);return{...e,agentDefinitions:{...e.agentDefinitions,activeAgents:Qe(t),allAgents:t}}}),nt(),e&&await on(gn({source:r.location,agentType:r.finalAgent.agentType})),r.finalAgent.agentType,r.wasGenerated,r.location,r.finalAgent.tools?.length,r.finalAgent.model,r.finalAgent.color,r.finalAgent.memory,r.finalAgent.memory,{...e?{opened_in_editor:!0}:{}},n(e?`Created agent: ${p.bold(r.finalAgent.agentType)} and opened in editor. If you made edits, restart to load the latest version.`:`Created agent: ${p.bold(r.finalAgent.agentType)}`)}catch(e){a(e instanceof Error?e.message:`Failed to save agent`)}},[r,n,o]);return(0,pr.jsx)(lr,{tools:e,existingAgents:t,onSave:(0,fr.useCallback)(()=>s(!1),[s]),onSaveAndEdit:(0,fr.useCallback)(()=>s(!0),[s]),error:i})}var fr,pr,mr=e((()=>{m(),fr=t(f(),1),It(),lt(),Je(),an(),H(),Tn(),ur(),pr=_()}));function hr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z(),[i,a]=(0,gr.useState)(r.whenToUse||``),[o,f]=(0,gr.useState)(i.length),[p,m]=(0,gr.useState)(null);return d(`confirm:no`,t,{context:`Settings`}),d(`chat:externalEditor`,(0,gr.useCallback)(async()=>{let e=await rn(i);e.content!==null&&(a(e.content),f(e.content.length))},[i]),{context:`Chat`}),(0,G.jsx)(B,{subtitle:`Description (tell Work Mate when to use this agent)`,footerText:(0,G.jsxs)(u,{children:[(0,G.jsx)(s,{shortcut:`Type`,action:`enter text`}),(0,G.jsx)(s,{shortcut:`Enter`,action:`continue`}),(0,G.jsx)(E,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,G.jsx)(E,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,G.jsxs)(c,{flexDirection:`column`,children:[(0,G.jsx)(l,{children:`When should Work Mate use this agent?`}),(0,G.jsx)(c,{marginTop:1,children:(0,G.jsx)(Jt,{value:i,onChange:a,onSubmit:t=>{let r=t.trim();if(!r){m(`Description is required`);return}m(null),n({whenToUse:r}),e()},placeholder:`e.g., use this agent after you're done writing code...`,columns:80,cursorOffset:o,onChangeCursorOffset:f,focus:!0,showCursor:!0})}),p&&(0,G.jsx)(c,{marginTop:1,children:(0,G.jsx)(l,{color:`error`,children:p})})]})})}var gr,G,_r=e((()=>{gr=t(f(),1),h(),C(),an(),T(),qt(),H(),V(),G=_()}));async function vr(e,t,n,r){let i=st({content:`Create an agent configuration based on this request: "${e}".${n.length>0?`\n\nIMPORTANT: The following identifiers already exist and must NOT be used: ${n.join(`, `)}`:``}
|
|
8
|
-
Return ONLY the JSON object, no other text.`}),a=await ae(),o=qe([i],a),s=At()?yr+br:yr,c=await xe({messages:rt(o),systemPrompt:Ye([s]),thinkingConfig:{type:`disabled`},tools:[],signal:r,options:{getToolPermissionContext:async()=>zt(),model:t,toolChoice:void 0,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,querySource:`agent_creation`,mcpTools:[]}}),l=(Array.isArray(c.message.content)?c.message.content:[]).filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
9
|
-
`),u;try{u=ht(l.trim())}catch{let e=l.match(/\{[\s\S]*\}/);if(!e)throw Error(`No JSON object found in response`);u=ht(e[0])}if(!u.identifier||!u.whenToUse||!u.systemPrompt)throw Error(`Invalid agent configuration generated`);return u.identifier,{identifier:u.identifier,whenToUse:u.whenToUse,systemPrompt:u.systemPrompt}}var yr,br,xr=e((()=>{ue(),ke(),Bt(),Ct(),Re(),fe(),kt(),It(),vt(),y(),yr=`You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.
|
|
10
|
-
|
|
11
|
-
**Important Context**: You may have access to project-specific instructions from AGENTS.md files and other context that may include coding standards, project structure, and custom requirements. Consider this context when creating agents to ensure they align with the project's established patterns and practices.
|
|
12
|
-
|
|
13
|
-
When a user describes what they want an agent to do, you will:
|
|
14
|
-
|
|
15
|
-
1. **Extract Core Intent**: Identify the fundamental purpose, key responsibilities, and success criteria for the agent. Look for both explicit requirements and implicit needs. Consider any project-specific context from AGENTS.md files. For agents that are meant to review code, you should assume that the user is asking to review recently written code and not the whole codebase, unless the user has explicitly instructed you otherwise.
|
|
16
|
-
|
|
17
|
-
2. **Design Expert Persona**: Create a compelling expert identity that embodies deep domain knowledge relevant to the task. The persona should inspire confidence and guide the agent's decision-making approach.
|
|
18
|
-
|
|
19
|
-
3. **Architect Comprehensive Instructions**: Develop a system prompt that:
|
|
20
|
-
- Establishes clear behavioral boundaries and operational parameters
|
|
21
|
-
- Provides specific methodologies and best practices for task execution
|
|
22
|
-
- Anticipates edge cases and provides guidance for handling them
|
|
23
|
-
- Incorporates any specific requirements or preferences mentioned by the user
|
|
24
|
-
- Defines output format expectations when relevant
|
|
25
|
-
- Aligns with project-specific coding standards and patterns from AGENTS.md
|
|
26
|
-
|
|
27
|
-
4. **Optimize for Performance**: Include:
|
|
28
|
-
- Decision-making frameworks appropriate to the domain
|
|
29
|
-
- Quality control mechanisms and self-verification steps
|
|
30
|
-
- Efficient workflow patterns
|
|
31
|
-
- Clear escalation or fallback strategies
|
|
32
|
-
|
|
33
|
-
5. **Create Identifier**: Design a concise, descriptive identifier that:
|
|
34
|
-
- Uses lowercase letters, numbers, and hyphens only
|
|
35
|
-
- Is typically 2-4 words joined by hyphens
|
|
36
|
-
- Clearly indicates the agent's primary function
|
|
37
|
-
- Is memorable and easy to type
|
|
38
|
-
- Avoids generic terms like "helper" or "assistant"
|
|
39
|
-
|
|
40
|
-
6 **Example agent descriptions**:
|
|
41
|
-
- in the 'whenToUse' field of the JSON object, you should include examples of when this agent should be used.
|
|
42
|
-
- examples should be of the form:
|
|
43
|
-
- <example>
|
|
44
|
-
Context: The user is creating a test-runner agent that should be called after a logical chunk of code is written.
|
|
45
|
-
user: "Please write a function that checks if a number is prime"
|
|
46
|
-
assistant: "Here is the relevant function: "
|
|
47
|
-
<function call omitted for brevity only for this example>
|
|
48
|
-
<commentary>
|
|
49
|
-
Since a significant piece of code was written, use the ${Et} tool to launch the test-runner agent to run the tests.
|
|
50
|
-
</commentary>
|
|
51
|
-
assistant: "Now let me use the test-runner agent to run the tests"
|
|
52
|
-
</example>
|
|
53
|
-
- <example>
|
|
54
|
-
Context: User is creating an agent to respond to the word "hello" with a friendly jok.
|
|
55
|
-
user: "Hello"
|
|
56
|
-
assistant: "I'm going to use the ${Et} tool to launch the greeting-responder agent to respond with a friendly joke"
|
|
57
|
-
<commentary>
|
|
58
|
-
Since the user is greeting, use the greeting-responder agent to respond with a friendly joke.
|
|
59
|
-
</commentary>
|
|
60
|
-
</example>
|
|
61
|
-
- If the user mentioned or implied that the agent should be used proactively, you should include examples of this.
|
|
62
|
-
- NOTE: Ensure that in the examples, you are making the assistant use the Agent tool and not simply respond directly to the task.
|
|
63
|
-
|
|
64
|
-
Your output must be a valid JSON object with exactly these fields:
|
|
65
|
-
{
|
|
66
|
-
"identifier": "A unique, descriptive identifier using lowercase letters, numbers, and hyphens (e.g., 'test-runner', 'api-docs-writer', 'code-formatter')",
|
|
67
|
-
"whenToUse": "A precise, actionable description starting with 'Use this agent when...' that clearly defines the triggering conditions and use cases. Ensure you include examples as described above.",
|
|
68
|
-
"systemPrompt": "The complete system prompt that will govern the agent's behavior, written in second person ('You are...', 'You will...') and structured for maximum clarity and effectiveness"
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
Key principles for your system prompts:
|
|
72
|
-
- Be specific rather than generic - avoid vague instructions
|
|
73
|
-
- Include concrete examples when they would clarify behavior
|
|
74
|
-
- Balance comprehensiveness with clarity - every instruction should add value
|
|
75
|
-
- Ensure the agent has enough context to handle variations of the core task
|
|
76
|
-
- Make the agent proactive in seeking clarification when needed
|
|
77
|
-
- Build in quality assurance and self-correction mechanisms
|
|
78
|
-
|
|
79
|
-
Remember: The agents you create should be autonomous experts capable of handling their designated tasks with minimal additional guidance. Your system prompts are their complete operational manual.
|
|
80
|
-
`,br=`
|
|
81
|
-
|
|
82
|
-
7. **Agent Memory Instructions**: If the user mentions "memory", "remember", "learn", "persist", or similar concepts, OR if the agent would benefit from building up knowledge across conversations (e.g., code reviewers learning patterns, architects learning codebase structure, etc.), include domain-specific memory update instructions in the systemPrompt.
|
|
83
|
-
|
|
84
|
-
Add a section like this to the systemPrompt, tailored to the agent's specific domain:
|
|
85
|
-
|
|
86
|
-
"**Update your agent memory** as you discover [domain-specific items]. This builds up institutional knowledge across conversations. Write concise notes about what you found and where.
|
|
87
|
-
|
|
88
|
-
Examples of what to record:
|
|
89
|
-
- [domain-specific item 1]
|
|
90
|
-
- [domain-specific item 2]
|
|
91
|
-
- [domain-specific item 3]"
|
|
92
|
-
|
|
93
|
-
Examples of domain-specific memory instructions:
|
|
94
|
-
- For a code-reviewer: "Update your agent memory as you discover code patterns, style conventions, common issues, and architectural decisions in this codebase."
|
|
95
|
-
- For a test-runner: "Update your agent memory as you discover test patterns, common failure modes, flaky tests, and testing best practices."
|
|
96
|
-
- For an architect: "Update your agent memory as you discover codepaths, library locations, key architectural decisions, and component relationships."
|
|
97
|
-
- For a documentation writer: "Update your agent memory as you discover documentation patterns, API structures, and terminology conventions."
|
|
98
|
-
|
|
99
|
-
The memory instructions should be specific to what the agent would naturally learn while performing its core tasks.
|
|
100
|
-
`}));function Sr(){let{updateWizardData:e,goBack:t,goToStep:n,wizardData:r}=z(),[i,a]=(0,K.useState)(r.generationPrompt||``),[o,s]=(0,K.useState)(!1),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(i.length),g=sn(),_=(0,K.useRef)(null);d(`confirm:no`,(0,K.useCallback)(()=>{_.current&&(_.current.abort(),_.current=null,s(!1),p(`Generation cancelled`))},[]),{context:`Settings`,isActive:o}),d(`chat:externalEditor`,(0,K.useCallback)(async()=>{let e=await rn(i);e.content!==null&&(a(e.content),h(e.content.length))},[i]),{context:`Chat`,isActive:!o}),d(`confirm:no`,(0,K.useCallback)(()=>{e({generationPrompt:``,agentType:``,systemPrompt:``,whenToUse:``,generatedAgent:void 0,wasGenerated:!1}),a(``),p(null),t()},[e,t]),{context:`Settings`,isActive:!o});let v=async()=>{let t=i.trim();if(!t){p(`Please describe what the agent should do`);return}p(null),s(!0),e({generationPrompt:t,isGenerating:!0});let r=Pe();_.current=r;try{let i=await vr(t,g,[],r.signal);e({agentType:i.identifier,whenToUse:i.whenToUse,systemPrompt:i.systemPrompt,generatedAgent:i,isGenerating:!1,wasGenerated:!0}),n(6)}catch(t){t instanceof _t||t instanceof Error&&!t.message.includes(`No assistant message found`)&&p(t.message||`Failed to generate agent`),e({isGenerating:!1})}finally{s(!1),_.current=null}},y=`Describe what this agent should do and when it should be used (be comprehensive for best results)`;return o?(0,q.jsx)(B,{subtitle:y,footerText:(0,q.jsx)(E,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`}),children:(0,q.jsxs)(c,{flexDirection:`row`,alignItems:`center`,children:[(0,q.jsx)(en,{}),(0,q.jsx)(l,{color:`suggestion`,children:` Generating agent from description...`})]})}):(0,q.jsx)(B,{subtitle:y,footerText:(0,q.jsxs)(u,{children:[(0,q.jsx)(E,{action:`confirm:yes`,context:`Confirmation`,fallback:`Enter`,description:`submit`}),(0,q.jsx)(E,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,q.jsx)(E,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,q.jsxs)(c,{flexDirection:`column`,children:[f&&(0,q.jsx)(c,{marginBottom:1,children:(0,q.jsx)(l,{color:`error`,children:f})}),(0,q.jsx)(Jt,{value:i,onChange:a,onSubmit:v,placeholder:`e.g., Help me write unit tests for my code...`,columns:80,cursorOffset:m,onChangeCursorOffset:h,focus:!0,showCursor:!0})]})})}var K,q,Cr=e((()=>{ft(),K=t(f(),1),cn(),h(),C(),Ke(),an(),T(),$t(),qt(),H(),V(),xr(),q=_()}));function wr(){let{goNext:e,updateWizardData:t,cancel:n}=z();return(0,J.jsx)(B,{subtitle:`Choose location`,footerText:(0,J.jsxs)(u,{children:[(0,J.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,J.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,J.jsx)(c,{children:(0,J.jsx)(Qt,{options:[{label:`Project (.workmate/agents/)`,value:`projectSettings`},{label:`Personal (~/.workmate/agents/)`,value:`userSettings`}],onChange:n=>{t({location:n}),e()},onCancel:()=>n()},`location-select`)})})}var J,Tr=e((()=>{h(),T(),Zt(),H(),V(),J=_()}));function Er(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z();d(`confirm:no`,t,{context:`Confirmation`});let i=r.location===`userSettings`?[{label:`User scope (~/.workmate/agent-memory/) (Recommended)`,value:`user`},{label:`None (no persistent memory)`,value:`none`},{label:`Project scope (.workmate/agent-memory/)`,value:`project`},{label:`Local scope (.workmate/agent-memory-local/)`,value:`local`}]:[{label:`Project scope (.workmate/agent-memory/) (Recommended)`,value:`project`},{label:`None (no persistent memory)`,value:`none`},{label:`User scope (~/.workmate/agent-memory/)`,value:`user`},{label:`Local scope (.workmate/agent-memory-local/)`,value:`local`}];return(0,Y.jsx)(B,{subtitle:`Configure agent memory`,footerText:(0,Y.jsxs)(u,{children:[(0,Y.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,Y.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Y.jsx)(c,{children:(0,Y.jsx)(Qt,{options:i,onChange:t=>{let i=t===`none`?void 0:t,a=r.finalAgent?.agentType;n({selectedMemory:i,finalAgent:r.finalAgent?{...r.finalAgent,memory:i,getSystemPrompt:At()&&i&&a?()=>`${r.systemPrompt}\n\n${je(a,i)}`:()=>r.systemPrompt}:void 0}),e()},onCancel:t},`memory-select`)})})}var Y,Dr=e((()=>{h(),C(),kt(),Be(),T(),Zt(),H(),V(),Y=_()}));function Or(){let{goNext:e,goBack:t,updateWizardData:n,goToStep:r}=z();return(0,X.jsx)(B,{subtitle:`Creation method`,footerText:(0,X.jsxs)(u,{children:[(0,X.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,X.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,X.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,X.jsx)(c,{children:(0,X.jsx)(Qt,{options:[{label:`Generate with Work Mate (recommended)`,value:`generate`},{label:`Manual configuration`,value:`manual`}],onChange:t=>{let i=t;n({method:i,wasGenerated:i===`generate`}),i===`generate`?e():r(3)},onCancel:()=>t()},`method-select`)})})}var X,kr=e((()=>{h(),T(),Zt(),H(),V(),X=_()}));function Ar(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z();return(0,jr.jsx)(B,{subtitle:`Select model`,footerText:(0,jr.jsxs)(u,{children:[(0,jr.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,jr.jsx)(s,{shortcut:`Enter`,action:`select`}),(0,jr.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,jr.jsx)(jn,{initialModel:r.selectedModel,onComplete:t=>{n({selectedModel:t}),e()},onCancel:t})})}var jr,Mr=e((()=>{T(),h(),H(),V(),Pn(),jr=_()}));function Nr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z(),[i,a]=(0,Pr.useState)(r.systemPrompt||``),[o,f]=(0,Pr.useState)(i.length),[p,m]=(0,Pr.useState)(null);return d(`confirm:no`,t,{context:`Settings`}),d(`chat:externalEditor`,(0,Pr.useCallback)(async()=>{let e=await rn(i);e.content!==null&&(a(e.content),f(e.content.length))},[i]),{context:`Chat`}),(0,Z.jsx)(B,{subtitle:`System prompt`,footerText:(0,Z.jsxs)(u,{children:[(0,Z.jsx)(s,{shortcut:`Type`,action:`enter text`}),(0,Z.jsx)(s,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(E,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,Z.jsx)(E,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Z.jsxs)(c,{flexDirection:`column`,children:[(0,Z.jsx)(l,{children:`Enter the system prompt for your agent:`}),(0,Z.jsx)(l,{dimColor:!0,children:`Be comprehensive for best results`}),(0,Z.jsx)(c,{marginTop:1,children:(0,Z.jsx)(Jt,{value:i,onChange:a,onSubmit:()=>{let t=i.trim();if(!t){m(`System prompt is required`);return}m(null),n({systemPrompt:t}),e()},placeholder:`You are a helpful code reviewer who...`,columns:80,cursorOffset:o,onChangeCursorOffset:f,focus:!0,showCursor:!0})}),p&&(0,Z.jsx)(c,{marginTop:1,children:(0,Z.jsx)(l,{color:`error`,children:p})})]})})}var Pr,Z,Fr=e((()=>{Pr=t(f(),1),h(),C(),an(),T(),qt(),H(),V(),Z=_()}));function Ir({tools:e}){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=z(),a=e=>{r({selectedTools:e}),t()},o=i.selectedTools;return(0,Lr.jsx)(B,{subtitle:`Select tools`,footerText:(0,Lr.jsxs)(u,{children:[(0,Lr.jsx)(s,{shortcut:`Enter`,action:`toggle selection`}),(0,Lr.jsx)(s,{shortcut:`↑↓`,action:`navigate`}),(0,Lr.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Lr.jsx)(Ln,{tools:e,initialTools:o,onComplete:a,onCancel:n})})}var Lr,Rr=e((()=>{h(),T(),H(),V(),Rn(),Lr=_()}));function zr(e){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=z(),[a,o]=(0,Br.useState)(i.agentType||``),[f,p]=(0,Br.useState)(null),[m,h]=(0,Br.useState)(a.length);return d(`confirm:no`,n,{context:`Settings`}),(0,Q.jsx)(B,{subtitle:`Agent type (identifier)`,footerText:(0,Q.jsxs)(u,{children:[(0,Q.jsx)(s,{shortcut:`Type`,action:`enter text`}),(0,Q.jsx)(s,{shortcut:`Enter`,action:`continue`}),(0,Q.jsx)(E,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Q.jsxs)(c,{flexDirection:`column`,children:[(0,Q.jsx)(l,{children:`Enter a unique identifier for your agent:`}),(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(Jt,{value:a,onChange:o,onSubmit:e=>{let n=e.trim(),i=or(n);if(i){p(i);return}p(null),r({agentType:n}),t()},placeholder:`e.g., test-runner, tech-lead, etc`,columns:60,cursorOffset:m,onChangeCursorOffset:h,focus:!0,showCursor:!0})}),f&&(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(l,{color:`error`,children:f})})]})})}var Br,Q,Vr=e((()=>{Br=t(f(),1),h(),C(),T(),qt(),H(),V(),cr(),Q=_()}));function Hr({tools:e,existingAgents:t,onComplete:n,onCancel:r}){return(0,Ur.jsx)(Jn,{steps:[wr,Or,Sr,()=>(0,Ur.jsx)(zr,{existingAgents:t}),Nr,hr,()=>(0,Ur.jsx)(Ir,{tools:e}),Ar,ir,...At()?[Er]:[],()=>(0,Ur.jsx)(dr,{tools:e,existingAgents:t,onComplete:n})],initialData:{},onComplete:()=>{},onCancel:r,title:`Create new agent`,showStepCounter:!1})}var Ur,Wr=e((()=>{kt(),H(),ar(),mr(),_r(),Cr(),Tr(),Dr(),kr(),Mr(),Fr(),Rr(),Vr(),Ur=_()}));function Gr({tools:e,onExit:t}){let[n,r]=(0,Kr.useState)({mode:`list-agents`,source:`all`}),i=S(e=>e.agentDefinitions),a=S(e=>e.mcp.tools),o=S(e=>e.toolPermissionContext),s=ce(),{allAgents:u,activeAgents:d}=i,[f,m]=(0,Kr.useState)([]),h=tn(e,a,o);Yt();let _=(0,Kr.useMemo)(()=>({"built-in":u.filter(e=>e.source===`built-in`),userSettings:u.filter(e=>e.source===`userSettings`),projectSettings:u.filter(e=>e.source===`projectSettings`),policySettings:u.filter(e=>e.source===`policySettings`),localSettings:u.filter(e=>e.source===`localSettings`),flagSettings:u.filter(e=>e.source===`flagSettings`),plugin:u.filter(e=>e.source===`plugin`),all:u}),[u]),v=(0,Kr.useCallback)(e=>{m(t=>[...t,e]),r({mode:`list-agents`,source:`all`})},[]),y=(0,Kr.useCallback)(async e=>{try{await Cn(e),s(t=>{let n=t.agentDefinitions.allAgents.filter(t=>!(t.agentType===e.agentType&&t.source===e.source));return{...t,agentDefinitions:{...t.agentDefinitions,allAgents:n,activeAgents:Qe(n)}}}),m(t=>[...t,`Deleted agent: ${p.bold(e.agentType)}`]),r({mode:`list-agents`,source:`all`})}catch(e){Mt(gt(e))}},[s]);switch(n.mode){case`list-agents`:{let e=Wt(n.source===`all`?[..._[`built-in`],..._.userSettings,..._.projectSettings,..._.localSettings,..._.policySettings,..._.flagSettings,..._.plugin]:_[n.source],d);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Kn,{source:n.source,agents:e,onBack:()=>{t((f.length>0?`Agent changes:\n${f.join(`
|
|
101
|
-
`)}`:void 0)??`Agents dialog dismissed`,{display:f.length===0?`system`:void 0})},onSelect:e=>r({mode:`agent-menu`,agent:e,previousMode:n}),onCreateNew:()=>r({mode:`create-agent`}),changes:f}),(0,$.jsx)(Un,{})]})}case`create-agent`:return(0,$.jsx)(Hr,{tools:h,existingAgents:d,onComplete:v,onCancel:()=>r({mode:`list-agents`,source:`all`})});case`agent-menu`:{let e=u.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent,t=[{label:`View agent`,value:`view`},...e.source!==`built-in`&&e.source!==`plugin`&&e.source!==`flagSettings`?[{label:`Edit agent`,value:`edit`},{label:`Delete agent`,value:`delete`}]:[],{label:`Back`,value:`back`}];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{title:n.agent.agentType,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsxs)(c,{flexDirection:`column`,children:[(0,$.jsx)(Qt,{options:t,onChange:t=>{switch(t){case`view`:r({mode:`view-agent`,agent:e,previousMode:n.previousMode});break;case`edit`:r({mode:`edit-agent`,agent:e,previousMode:n});break;case`delete`:r({mode:`delete-confirm`,agent:e,previousMode:n});break;case`back`:r(n.previousMode);break}},onCancel:()=>r(n.previousMode)}),f.length>0&&(0,$.jsx)(c,{marginTop:1,children:(0,$.jsx)(l,{dimColor:!0,children:f[f.length-1]})})]})}),(0,$.jsx)(Un,{})]})}case`view-agent`:{let e=u.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{title:e.agentType,onCancel:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode}),hideInputGuide:!0,children:(0,$.jsx)(En,{agent:e,tools:h,allAgents:u,onBack:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode})})}),(0,$.jsx)(Un,{instructions:`Press Enter or Esc to go back`})]})}case`delete-confirm`:return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(g,{title:`Delete agent`,onCancel:()=>{`previousMode`in n&&r(n.previousMode)},color:`error`,children:[(0,$.jsxs)(l,{children:[`Are you sure you want to delete the agent `,(0,$.jsx)(l,{bold:!0,children:n.agent.agentType}),`?`]}),(0,$.jsx)(c,{marginTop:1,children:(0,$.jsxs)(l,{dimColor:!0,children:[`Source: `,n.agent.source]})}),(0,$.jsx)(c,{marginTop:1,children:(0,$.jsx)(Qt,{options:[{label:`Yes, delete`,value:`yes`},{label:`No, cancel`,value:`no`}],onChange:e=>{e===`yes`?y(n.agent):`previousMode`in n&&r(n.previousMode)},onCancel:()=>{`previousMode`in n&&r(n.previousMode)}})})]}),(0,$.jsx)(Un,{instructions:`Press ↑↓ to navigate, Enter to select, Esc to cancel`})]});case`edit-agent`:{let e=u.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{title:`Edit agent: ${e.agentType}`,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsx)(Vn,{agent:e,tools:h,onSaved:e=>{v(e),r(n.previousMode)},onBack:()=>r(n.previousMode)})}),(0,$.jsx)(Un,{})]})}default:return null}}var Kr,$,qr=e((()=>{m(),Kr=t(f(),1),Xt(),nn(),h(),lt(),Ht(),Je(),pt(),jt(),Zt(),Dn(),Hn(),Gn(),qn(),Tn(),Wr(),$=_()}));async function Jr(e,t){let n=t.getAppState().toolPermissionContext;return(0,Yr.jsx)(Gr,{tools:ne(n),onExit:e})}var Yr;e((()=>{qr(),ee(),Yr=_()}))();export{Jr as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Mv as t,Pv as n}from"./loadAgentsDir-DGozQu_6.js";import{h as r,l as i}from"./settings-CodSADx8.js";function a(){let e=i(),n=[`user`,`project`,`local`].flatMap(e=>t(e).errors);return{settings:e.settings,errors:[...e.errors,...n]}}var o=e((()=>{n(),r()}));export{o as n,a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,h as n,o as r}from"./config-CWPHVTic.js";import{i,t as a}from"./execFileNoThrow-BgRsj_SW.js";import{o,s}from"./log-DoSpAwRP.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 a(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await u(e)}catch{return null}return await a(`defaults`,[`export`,`com.apple.Terminal`,t]),d(t),t}catch(e){return s(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 a(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await a(`killall`,[`cfprefsd`]),f(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return s(Error(`Failed to restore Terminal.app settings with: ${e}`)),f(),{status:`failed`,backupPath:t}}}var _=e((()=>{t(),i(),o()}));export{f as a,_ as i,g as n,m as r,h as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./backgroundHousekeeping-BkFxfjOf.js";export{e as startBackgroundHousekeeping};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Pt as t,l as n,mn as r}from"./state-BQ4BEGin.js";import{A_ as i,Ad as a,Bi as o,Ci as s,Fh as c,G as l,Gb as u,Ih as d,Iu as f,Lh as p,Mi as m,Nh as h,Od as g,Ph as _,Rh as v,Ru as y,Sf as b,Wb as x,Wi as S,j_ as C,lp as w,ns as T,q as E,qd as D,ts as O,up as k,wf as A,zh as j}from"./loadAgentsDir-DGozQu_6.js";import{Hr as M,Rr as N}from"./settings-CodSADx8.js";import{a as P,n as F}from"./fileSuggestions-C96V9-Ne.js";import{r as I,t as L}from"./magicDocs-Bj8LYrN2.js";import{r as R,t as z}from"./detectRepository-CsJLbVEe.js";function B(e=new Set){let t=e.size>0;c.cache.clear?.(),_.cache.clear?.(),h.cache.clear?.(),v.cache.clear?.(),F(),s(),t||a(),p(null),r(null),A(),T(),C(`session_start`),f(),z(),l(),n(e),N(),o(),k(),L(),x(),import(`./SearchExtraToolsTool-BRchtZ9Q.js`).then(({clearSearchExtraToolsDescriptionCache:e})=>e()),import(`./loadAgentsDir-CJAK4kif.js`).then(({clearAgentDefinitionsCache:e})=>e()),import(`./prompt-DYBx_D0H.js`).then(({clearPromptCache:e})=>e())}var V=e((()=>{t(),m(),j(),d(),P(),D(),g(),b(),w(),I(),S(),O(),E(),i(),R(),M(),y(),u()}));export{V as n,B as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./caches-DWjwe-DN.js";e();export{t as clearSessionCaches};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./client-BDuhbzLD.js";e();export{t as getGrokClient};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./client-BYFVVMcf.js";e();export{t as clearOpenAIClientCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ci as e,Di as t,Mi as n}from"./loadAgentsDir-DGozQu_6.js";n();export{e as clearCommandsCache,t as getCommands};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{di as t,fi as n}from"./src-DL3w8VPk.js";import{It as r,Pt as i}from"./state-BQ4BEGin.js";import{$h as a,Bh as o,Db as s,Fh as c,Gh as l,Ih as u,Ji as d,Jm as f,Mh as p,Ob as m,Od as h,Ph as g,Sf as _,Vh as v,Wh as y,Xm as b,Zm as x,_f as S,ag as C,jh as w,kd as T,mn as E,nd as D,oS as O,ot as k,qm as A,st as j,td as M,vf as N,wf as P}from"./loadAgentsDir-DGozQu_6.js";import{F,I}from"./debug-CRnGsZOV.js";import{o as L,s as R}from"./log-DoSpAwRP.js";function z(e,n){let r=M(`tip`),i=s(`app:toggleTranscript`,`Global`,`ctrl+o`),a=[...e.options.verbose?[]:[`(${i} to see full summary)`],...n?[n]:[],...r?[r]:[]];return t.dim(`Compacted ${a.join(`
|
|
2
|
-
`)}`)}async function B(e,t){let n=e.getAppState(),r=await k(e.options.tools,e.options.mainLoopModel,Array.from(n.toolPermissionContext.additionalWorkingDirectories.keys()),e.options.mcpClients),i=w({mainThreadAgentDefinition:void 0,toolUseContext:e,customSystemPrompt:e.options.customSystemPrompt,defaultSystemPrompt:r,appendSystemPrompt:e.options.appendSystemPrompt}),[a,o]=await Promise.all([c(),g()]);return{systemPrompt:i,userContext:a,systemContext:o,toolUseContext:e,forkContextMessages:t}}var V;e((()=>{n(),i(),j(),u(),m(),h(),x(),y(),o(),_(),S(),a(),I(),E(),L(),d(),D(),p(),V=async(e,t)=>{let{abortController:n}=t,{messages:i}=t;if(i=O(i),i.length===0)throw Error(`No messages to compact`);let a=e.trim();try{if(!a){let e=await N(i,t.agentId);if(e)return c.cache.clear?.(),P(),T(t.options.querySource??`compact`,t.agentId),r(),l(),{type:`compact`,compactionResult:e,displayText:z(t)}}let e=(await v(i,t)).messages,n=await b(e,t,await B(t,e),!1,a,!1);return C(void 0),l(),c.cache.clear?.(),P(),{type:`compact`,compactionResult:n,displayText:z(t,n.userDisplayMessage)}}catch(e){throw n.signal.aborted?Error(`Compaction canceled.`):F(e,`Not enough messages to compact. Send a few more messages first, then try again.`)?Error(f):F(e,`Compaction interrupted · This may be due to network issues — please try again.`)?Error(A):(R(e),Error(`Error during compaction: ${e}`))}}}))();export{V as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Settings-axHLvYIy.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Config`})}))();export{a as call};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t,t as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./isObject-C6qM3WEW.js";import{n as a,t as o}from"./memoize-BK3gG5ob.js";import{c as s,i as c,l,o as u}from"./envUtils-DfkgIdYf.js";import{t as d}from"./graceful-fs-DDVg0cja.js";import{d as f,l as p,m,p as h}from"./types-97nL3naE.js";import{Hr as g,Jr as _,Pt as v,Ur as ee,X as y,Xr as te,Yr as ne,Zr as re,_r as ie,ai as ae,ar as oe,cr as se,dr as ce,ei as le,fr as ue,gr as de,ii as fe,ir as pe,lr as me,pr as he,q as ge,st as _e,ti as ve,ur as ye}from"./state-BQ4BEGin.js";import{n as be,t as xe}from"./cwd-BvNt_018.js";import{$ as Se,C as b,I as Ce,N as x,O as S,S as we,c as C,et as Te,f as Ee,i as De,u as w,x as Oe}from"./debug-CRnGsZOV.js";import{Dr as ke,Fn as Ae,Ir as je,Jr as Me,Kt as T,Qt as Ne,Xt as Pe,Yr as Fe,h as Ie,ii as Le,li as Re,mi as ze,nr as Be,pi as Ve,qt as He,ri as Ue,rr as E,s as D,t as We,ui as Ge,vr as Ke,wn as qe}from"./settings-CodSADx8.js";import{d as Je,o as Ye,s as Xe,u as Ze}from"./log-DoSpAwRP.js";import{n as Qe}from"./analytics-COpjZpvd.js";import{homedir as $e}from"os";import{basename as O,dirname as k,isAbsolute as et,join as A,normalize as j,resolve as tt,sep as nt}from"path";import{unwatchFile as rt,watchFile as it}from"fs";import{randomBytes as at}from"crypto";var M,ot=t((()=>{ae(),Le(),ne(),te(),M=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)fe(t,_(e)),e=Ue(e);return t}:re}));function st(e){return le(e,Ge,M)}var ct=t((()=>{ve(),ot(),Re()}));function lt(){let e=process.env.CLAUDE_CODE_DISABLE_AUTO_MEMORY;if(l(e))return!1;if(s(e))return!0;if(l(process.env.CLAUDE_CODE_SIMPLE)||l(process.env.CLAUDE_CODE_REMOTE)&&!process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return!1;let t=We();return t.autoMemoryEnabled===void 0||t.autoMemoryEnabled}function ut(){return!1}function dt(){return process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR?process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR:c()}function ft(e,t){if(!e)return;let n=e;if(t&&(n.startsWith(`~/`)||n.startsWith(`~\\`))){let e=n.slice(2),t=j(e||`.`);if(t===`.`||t===`..`)return;n=A($e(),e)}let r=j(n).replace(/[/\\]+$/,``);if(!(!et(r)||r.length<3||/^[A-Za-z]:$/.test(r)||r.startsWith(`\\\\`)||r.startsWith(`//`)||r.includes(`\0`)))return(r+nt).normalize(`NFC`)}function pt(){return ft(process.env.CLAUDE_COWORK_MEMORY_PATH_OVERRIDE,!1)}function mt(){return ft(D(`policySettings`)?.autoMemoryDirectory??D(`flagSettings`)?.autoMemoryDirectory??D(`localSettings`)?.autoMemoryDirectory??D(`userSettings`)?.autoMemoryDirectory,!0)}function ht(){return pt()!==void 0}function gt(){return ke(y())??y()}function _t(){return A(N(),bt)}function vt(e){return j(e).startsWith(N())}var yt,bt,N,xt=t((()=>{o(),v(),u(),je(),Be(),Ie(),yt=`memory`,bt=`MEMORY.md`,N=a(()=>(pt()??mt())||(A(A(dt(),`projects`),Ke(gt()),yt)+nt).normalize(`NFC`),()=>y())}));function St(e,t,n,i){if(!r(e))return e;t=ue(t,e);for(var a=-1,o=t.length,s=o-1,c=e;c!=null&&++a<o;){var l=ce(t[a]),u=n;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(a!=s){var d=c[l];u=i?i(d,l,c):void 0,u===void 0&&(u=r(d)?d:ee(t[a+1])?[]:{})}Ve(c,l,u),c=c[l]}return e}var Ct=t((()=>{ze(),he(),g(),i(),ye()}));function wt(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=se(e,o);n(s,o)&&St(a,ue(o,e),s)}return a}var Tt=t((()=>{me(),Ct(),he()}));function Et(e,t){if(e==null)return{};var n=de(st(e),function(e){return[e]});return t=pe(t),wt(e,n,function(e,n){return t(e,n[0])})}var Dt=t((()=>{ie(),oe(),Tt(),ct()})),Ot=n(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),n=this._timeouts.shift();else return!1;var r=this,i=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n);return this._options.unref&&i.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),kt=n((e=>{var t=Ot();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&n.forever,unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*t.minTimeout*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),At=n(((e,t)=>{t.exports=kt()})),jt=n(((e,t)=>{t.exports=[`SIGABRT`,`SIGALRM`,`SIGHUP`,`SIGINT`,`SIGTERM`],process.platform!==`win32`&&t.exports.push(`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&t.exports.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`,`SIGUNUSED`)})),Mt=n(((t,n)=>{var r=global.process,i=function(e){return e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`};if(!i(r))n.exports=function(){return function(){}};else{var a=e(`assert`),o=jt(),s=/^win/i.test(r.platform),c=e(`events`);typeof c!=`function`&&(c=c.EventEmitter);var l;r.__signal_exit_emitter__?l=r.__signal_exit_emitter__:(l=r.__signal_exit_emitter__=new c,l.count=0,l.emitted={}),l.infinite||(l.setMaxListeners(1/0),l.infinite=!0),n.exports=function(e,t){if(!i(global.process))return function(){};a.equal(typeof e,`function`,`a callback must be provided for exit handler`),p===!1&&m();var n=`exit`;return t&&t.alwaysLast&&(n=`afterexit`),l.on(n,e),function(){l.removeListener(n,e),l.listeners(`exit`).length===0&&l.listeners(`afterexit`).length===0&&u()}};var u=function(){!p||!i(global.process)||(p=!1,o.forEach(function(e){try{r.removeListener(e,f[e])}catch{}}),r.emit=_,r.reallyExit=h,--l.count)};n.exports.unload=u;var d=function(e,t,n){l.emitted[e]||(l.emitted[e]=!0,l.emit(e,t,n))},f={};o.forEach(function(e){f[e]=function(){i(global.process)&&r.listeners(e).length===l.count&&(u(),d(`exit`,null,e),d(`afterexit`,null,e),s&&e===`SIGHUP`&&(e=`SIGINT`),r.kill(r.pid,e))}}),n.exports.signals=function(){return o};var p=!1,m=function(){p||!i(global.process)||(p=!0,l.count+=1,o=o.filter(function(e){try{return r.on(e,f[e]),!0}catch{return!1}}),r.emit=v,r.reallyExit=g)};n.exports.load=m;var h=r.reallyExit,g=function(e){i(global.process)&&(r.exitCode=e||0,d(`exit`,r.exitCode,null),d(`afterexit`,r.exitCode,null),h.call(r,r.exitCode))},_=r.emit,v=function(e,t){if(e===`exit`&&i(global.process)){t!==void 0&&(r.exitCode=t);var n=_.apply(this,arguments);return d(`exit`,r.exitCode,null),d(`afterexit`,r.exitCode,null),n}else return _.apply(this,arguments)}}})),Nt=n(((e,t)=>{var n=Symbol();function r(e,t,r){let i=t[n];if(i)return t.stat(e,(e,t)=>{if(e)return r(e);r(null,t.mtime,i)});let a=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,a,a,i=>{if(i)return r(i);t.stat(e,(e,i)=>{if(e)return r(e);let a=i.mtime.getTime()%1e3==0?`s`:`ms`;Object.defineProperty(t,n,{value:a}),r(null,i.mtime,a)})})}function i(e){let t=Date.now();return e===`s`&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}t.exports.probe=r,t.exports.getMtime=i})),Pt=n(((t,n)=>{var r=e(`path`),i=d(),a=At(),o=Mt(),s=Nt(),c={};function l(e,t){return t.lockfilePath||`${e}.lock`}function u(e,t,n){if(!t.realpath)return n(null,r.resolve(e));t.fs.realpath(e,n)}function f(e,t,n){let r=l(e,t);t.fs.mkdir(r,i=>{if(!i)return s.probe(r,t.fs,(e,i,a)=>{if(e)return t.fs.rmdir(r,()=>{}),n(e);n(null,i,a)});if(i.code!==`EEXIST`)return n(i);if(t.stale<=0)return n(Object.assign(Error(`Lock file is already being held`),{code:`ELOCKED`,file:e}));t.fs.stat(r,(r,i)=>{if(r)return r.code===`ENOENT`?f(e,{...t,stale:0},n):n(r);if(!p(i,t))return n(Object.assign(Error(`Lock file is already being held`),{code:`ELOCKED`,file:e}));m(e,t,r=>{if(r)return n(r);f(e,{...t,stale:0},n)})})})}function p(e,t){return e.mtime.getTime()<Date.now()-t.stale}function m(e,t,n){t.fs.rmdir(l(e,t),e=>{if(e&&e.code!==`ENOENT`)return n(e);n()})}function h(e,t){let n=c[e];n.updateTimeout||(n.updateDelay=n.updateDelay||t.update,n.updateTimeout=setTimeout(()=>{n.updateTimeout=null,t.fs.stat(n.lockfilePath,(r,i)=>{let a=n.lastUpdate+t.stale<Date.now();if(r)return r.code===`ENOENT`||a?g(e,n,Object.assign(r,{code:`ECOMPROMISED`})):(n.updateDelay=1e3,h(e,t));if(n.mtime.getTime()!==i.mtime.getTime())return g(e,n,Object.assign(Error(`Unable to update lock within the stale threshold`),{code:`ECOMPROMISED`}));let o=s.getMtime(n.mtimePrecision);t.fs.utimes(n.lockfilePath,o,o,r=>{let i=n.lastUpdate+t.stale<Date.now();if(!n.released){if(r)return r.code===`ENOENT`||i?g(e,n,Object.assign(r,{code:`ECOMPROMISED`})):(n.updateDelay=1e3,h(e,t));n.mtime=o,n.lastUpdate=Date.now(),n.updateDelay=null,h(e,t)}})})},n.updateDelay),n.updateTimeout.unref&&n.updateTimeout.unref())}function g(e,t,n){t.released=!0,t.updateTimeout&&clearTimeout(t.updateTimeout),c[e]===t&&delete c[e],t.options.onCompromised(n)}function _(e,t,n){t={stale:1e4,update:null,realpath:!0,retries:0,fs:i,onCompromised:e=>{throw e},...t},t.retries=t.retries||0,t.retries=typeof t.retries==`number`?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),u(e,t,(e,r)=>{if(e)return n(e);let i=a.operation(t.retries);i.attempt(()=>{f(r,t,(e,a,o)=>{if(i.retry(e))return;if(e)return n(i.mainError());let s=c[r]={lockfilePath:l(r,t),mtime:a,mtimePrecision:o,options:t,lastUpdate:Date.now()};h(r,t),n(null,e=>{if(s.released)return e&&e(Object.assign(Error(`Lock is already released`),{code:`ERELEASED`}));v(r,{...t,realpath:!1},e)})})})})}function v(e,t,n){t={fs:i,realpath:!0,...t},u(e,t,(e,r)=>{if(e)return n(e);let i=c[r];if(!i)return n(Object.assign(Error(`Lock is not acquired/owned by you`),{code:`ENOTACQUIRED`}));i.updateTimeout&&clearTimeout(i.updateTimeout),i.released=!0,delete c[r],m(r,t,n)})}function ee(e,t,n){t={stale:1e4,realpath:!0,fs:i,...t},t.stale=Math.max(t.stale||0,2e3),u(e,t,(e,r)=>{if(e)return n(e);t.fs.stat(l(r,t),(e,r)=>e?e.code===`ENOENT`?n(null,!1):n(e):n(null,!p(r,t)))})}function y(){return c}o(()=>{for(let e in c){let t=c[e].options;try{t.fs.rmdirSync(l(e,t))}catch{}}}),n.exports.lock=_,n.exports.unlock=v,n.exports.check=ee,n.exports.getLocks=y})),Ft=n(((e,t)=>{var n=d();function r(e){let t=[`mkdir`,`realpath`,`stat`,`rmdir`,`utimes`],n={...e};return t.forEach(t=>{n[t]=(...n)=>{let r=n.pop(),i;try{i=e[`${t}Sync`](...n)}catch(e){return r(e)}r(null,i)}}),n}function i(e){return(...t)=>new Promise((n,r)=>{t.push((e,t)=>{e?r(e):n(t)}),e(...t)})}function a(e){return(...t)=>{let n,r;if(t.push((e,t)=>{n=e,r=t}),e(...t),n)throw n;return r}}function o(e){if(e={...e},e.fs=r(e.fs||n),typeof e.retries==`number`&&e.retries>0||e.retries&&typeof e.retries.retries==`number`&&e.retries.retries>0)throw Object.assign(Error(`Cannot use retries with the sync api`),{code:`ESYNC`});return e}t.exports={toPromise:i,toSync:a,toSyncOptions:o}})),It=n(((e,t)=>{var n=Pt(),{toPromise:r,toSync:i,toSyncOptions:a}=Ft();async function o(e,t){return r(await r(n.lock)(e,t))}function s(e,t){return i(i(n.lock)(e,a(t)))}function c(e,t){return r(n.unlock)(e,t)}function l(e,t){return i(n.unlock)(e,a(t))}function u(e,t){return r(n.check)(e,t)}function d(e,t){return i(n.check)(e,a(t))}t.exports=o,t.exports.lock=o,t.exports.unlock=c,t.exports.lockSync=s,t.exports.unlockSync=l,t.exports.check=u,t.exports.checkSync=d}));function P(){return F||(F=It()),F}function Lt(e,t){return P().lock(e,t)}function Rt(e,t){return P().lockSync(e,t)}function zt(e,t){return P().check(e,t)}var F,Bt=t((()=>{}));function I(){return{numStartups:0,installMethod:void 0,autoUpdates:void 0,theme:`dark`,preferredNotifChannel:`auto`,verbose:!1,editorMode:`normal`,autoCompactEnabled:!0,showTurnDuration:!0,hasSeenTasksHint:!1,hasUsedStash:!1,hasUsedBackgroundTask:!1,queuedCommandUpHintCount:0,diffTool:`auto`,env:{},tipsHistory:{},memoryUsageCount:0,promptQueueUseCount:0,btwUseCount:0,todoFeatureEnabled:!0,showExpandedTodos:!1,messageIdleNotifThresholdMs:6e4,autoConnectIde:!1,autoInstallIdeExtension:!0,fileCheckpointingEnabled:!0,terminalProgressBarEnabled:!0,cachedStatsigGates:{},cachedDynamicConfigs:{},respectGitignore:!0}}function Vt(){return ln||(ln=Ht())}function Ht(){if(_e())return!0;let e=V(),t=$();if(e.projects?.[t]?.hasTrustDialogAccepted)return!0;let n=E(xe());for(;;){if(e.projects?.[n]?.hasTrustDialogAccepted)return!0;let t=E(tt(n,`..`));if(t===n)break;n=t}return!1}function L(e){let t=K.config;return t?t.hasCompletedOnboarding===!0&&e.hasCompletedOnboarding!==!0:!1}function R(e){let t=null;try{qt(T(),I,n=>{let r=e(n);return r===n?n:(t={...r,projects:Wt(n.projects)},t)})&&t&&B(t)}catch(n){C(`Failed to save config with lock: ${n}`,{level:`error`});let r=H(T(),I);if(L(r)){C(`saveGlobalConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.`,{level:`error`});return}let i=e(r);if(i===r)return;t={...i,projects:Wt(r.projects)},Kt(T(),t,G),B(t)}}function Ut(){let e=J+Y;e>0&&J/e,J=0,Y=0}function z(e){if(e.installMethod!==void 0)return e;let t=e,n=`unknown`,r=e.autoUpdates??!0;switch(t.autoUpdaterStatus){case`migrated`:n=`local`;break;case`installed`:n=`native`;break;case`disabled`:r=!1;break;case`enabled`:case`no_permissions`:case`not_configured`:n=`global`;break;case void 0:break}return{...e,installMethod:n,autoUpdates:r}}function Wt(e){if(!e)return e;let t={},n=!1;for(let[r,i]of Object.entries(e)){let e=i;if(e.history!==void 0){n=!0;let{history:i,...a}=e;t[r]=a}else t[r]=i}return n?t:e}function Gt(){if(Z)return;Z=!0;let e=T();it(e,{interval:un,persistent:!1},t=>{t.mtimeMs<=K.mtime||w().readFile(e,{encoding:`utf-8`}).then(e=>{if(t.mtimeMs<=K.mtime)return;let n=f(m(e));typeof n!=`object`||!n||(K={config:z({...I(),...n}),mtime:t.mtimeMs},q={mtime:t.mtimeMs,size:t.size})}).catch(()=>{})}),Te(async()=>{rt(e),Z=!1})}function B(e){K={config:e,mtime:Date.now()},q=null}function V(){if(K.config)return J++,K.config;Y++;try{let e=null;try{e=w().statSync(T())}catch{}let t=z(H(T(),I));return K={config:t,mtime:e?.mtimeMs??Date.now()},q=e?{mtime:e.mtimeMs,size:e.size}:null,Gt(),t}catch{return z(H(T(),I))}}function Kt(e,t,n){let r=k(e);w().mkdirSync(r),Ae(e,b(Et(t,(e,t)=>b(e)!==b(n[t])),null,2),{encoding:`utf-8`,mode:384}),e===T()&&X++}function qt(e,t,n){let r=t(),i=k(e),a=w();a.mkdirSync(i);let o;try{let i=`${e}.lock`,s=Date.now();if(o=Rt(e,{lockfilePath:i,onCompromised:e=>{C(`Config lock compromised: ${e}`,{level:`error`})}}),Date.now()-s>100&&C(`Lock acquisition took longer than expected - another Work Mate instance may be running`),q&&e===T())try{let t=a.statSync(e);(t.mtimeMs!==q.mtime||t.size!==q.size)&&(q.mtime,t.mtimeMs,q.size,t.size)}catch(e){if(x(e)!==`ENOENT`)throw e}let c=H(e,t);if(e===T()&&L(c))return C(`saveConfigWithLock: re-read config is missing auth that cache has; refusing to write to avoid wiping ~/.workmate.json. See GH #3117.`,{level:`error`}),!1;let l=n(c);if(l===c)return!1;let u=Et(l,(e,t)=>b(e)!==b(r[t]));try{let t=O(e),n=Yt();try{a.mkdirSync(n)}catch(e){if(x(e)!==`EEXIST`)throw e}let r=a.readdirStringSync(n).filter(e=>e.startsWith(`${t}.backup.`)).sort().reverse(),i=r[0],o=i?Number(i.split(`.backup.`).pop()):0,s=Number.isNaN(o)||Date.now()-o>=6e4;if(s){let r=A(n,`${t}.backup.${Date.now()}`);a.copyFileSync(e,r)}let c=s?a.readdirStringSync(n).filter(e=>e.startsWith(`${t}.backup.`)).sort().reverse():r;for(let e of c.slice(5))try{a.unlinkSync(A(n,e))}catch{}}catch(e){x(e)!==`ENOENT`&&C(`Failed to backup config: ${e}`,{level:`error`})}return Ae(e,b(u,null,2),{encoding:`utf-8`,mode:384}),e===T()&&X++,!0}finally{o&&o()}}function Jt(){if(Q)return;let e=Date.now();Fe(`info`,`enable_configs_started`),Q=!0,H(T(),I,!0),Fe(`info`,`enable_configs_completed`,{duration_ms:Date.now()-e})}function Yt(){return A(c(),`backups`)}function Xt(e){let t=w(),n=O(e),r=Yt();try{let e=t.readdirStringSync(r).filter(e=>e.startsWith(`${n}.backup.`)).sort().at(-1);if(e)return A(r,e)}catch{}let i=k(e);try{let r=t.readdirStringSync(i).filter(e=>e.startsWith(`${n}.backup.`)).sort().at(-1);if(r)return A(i,r);let a=`${e}.backup`;try{return t.statSync(a),a}catch{}}catch{}return null}function H(e,t,n){if(!Q)throw Error(`Config accessed before allowed.`);let r=w();try{let n=r.readFileSync(e,{encoding:`utf-8`});try{let e=we(m(n));return{...t(),...e}}catch(n){throw new S(n instanceof Error?n.message:String(n),e,t())}}catch(i){if(x(i)===`ENOENT`){let n=Xt(e);return n&&process.stderr.write(`\nWork Mate configuration file not found at: ${e}\nA backup file exists at: ${n}\nYou can manually restore it by running: cp "${n}" "${e}"\n\n`),t()}if(i instanceof S&&n)throw i;if(i instanceof S){if(C(`Config file corrupted, resetting to defaults: ${i.message}`,{level:`error`}),!U){U=!0;try{Xe(i);try{r.statSync(`${e}.backup`)}catch{}}finally{U=!1}}process.stderr.write(`\nWork Mate configuration file at ${e} is corrupted: ${i.message}\n`);let t=O(e),n=Yt();try{r.mkdirSync(n)}catch(e){if(x(e)!==`EEXIST`)throw e}let a=r.readdirStringSync(n).filter(e=>e.startsWith(`${t}.corrupted.`)),o,s=!1,c=r.readFileSync(e,{encoding:`utf-8`});for(let e of a)try{if(c===r.readFileSync(A(n,e),{encoding:`utf-8`})){s=!0;break}}catch{}if(!s){o=A(n,`${t}.corrupted.${Date.now()}`);try{r.copyFileSync(e,o),C(`Corrupted config backed up to: ${o}`,{level:`error`})}catch{}}let l=Xt(e);o?process.stderr.write(`The corrupted file has been backed up to: ${o}\n`):s&&process.stderr.write(`The corrupted file has already been backed up.
|
|
2
|
-
`),l?process.stderr.write(`A backup file exists at: ${l}\nYou can manually restore it by running: cp "${l}" "${e}"\n\n`):process.stderr.write(`
|
|
3
|
-
`)}return t()}}function Zt(){let e=$(),t=V();if(!t.projects)return W;let n=t.projects[e]??W;return typeof n.allowedTools==`string`&&(n.allowedTools=f(n.allowedTools)??[]),n}function Qt(e){let t=$(),n=null;try{qt(T(),I,r=>{let i=r.projects?.[t]??W,a=e(i);return a===i?r:(n={...r,projects:{...r.projects,[t]:a}},n)})&&n&&B(n)}catch(r){C(`Failed to save config with lock: ${r}`,{level:`error`});let i=H(T(),I);if(L(i)){C(`saveCurrentProjectConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.`,{level:`error`});return}let a=i.projects?.[t]??W,o=e(a);if(o===a)return;n={...i,projects:{...i.projects,[t]:o}},Kt(T(),n,G),B(n)}}function $t(){return nn()!==null}function en(){return $t()&&!l(process.env.FORCE_AUTOUPDATE_PLUGINS)}function tn(e){switch(e.type){case`development`:return`development build`;case`env`:return`${e.envVar} set`;case`config`:return`config`}}function nn(){if(!l(process.env.ENABLE_AUTOUPDATER))return{type:`config`};if(l(process.env.DISABLE_AUTOUPDATER))return{type:`env`,envVar:`DISABLE_AUTOUPDATER`};let e=Ze();if(e)return{type:`env`,envVar:e};let t=V();return t.autoUpdates===!1&&(t.installMethod!==`native`||t.autoUpdatesProtectedForNative!==!0)?{type:`config`}:null}function rn(){let e=V();if(e.userID)return e.userID;let t=at(32).toString(`hex`);return R(e=>({...e,userID:t})),t}function an(){if(!V().firstStartTime){let e=new Date().toISOString();R(t=>({...t,firstStartTime:t.firstStartTime??e}))}}function on(e){let t=ge();switch(e){case`User`:return A(c(),`AGENTS.md`);case`Local`:return A(t,`AGENTS.local.md`);case`Project`:return A(t,`AGENTS.md`);case`Managed`:return A(Pe(),`AGENTS.md`);case`AutoMem`:return _t();default:return A(c(),`AGENTS.md`)}}function sn(){return A(Pe(),`.workmate`,`rules`)}function cn(){return A(c(),`rules`)}var U,W,G,ln,K,q,J,Y,X,un,Z,Q,$,dn=t((()=>{o(),Dt(),v(),xt(),Qe(),be(),Se(),De(),Me(),He(),u(),Ce(),qe(),Ee(),je(),p(),h(),Bt(),Ye(),Be(),Je(),Ne(),Oe(),U=!1,W={allowedTools:[],mcpContextUris:[],mcpServers:{},enabledMcpjsonServers:[],disabledMcpjsonServers:[],hasTrustDialogAccepted:!1,projectOnboardingSeenCount:0,hasAgentsMdExternalIncludesApproved:!1,hasAgentsMdExternalIncludesWarningShown:!1},G=I(),ln=!1,{...G},{...W},K={config:null,mtime:0},q=null,J=0,Y=0,X=0,Te(async()=>{Ut()}),un=1e3,Z=!1,Q=!1,$=a(()=>{let e=ge();return E(ke(e)||tt(e))})}));export{st as A,N as C,vt as D,xt as E,M,ot as N,lt as O,_t as S,ht as T,zt as _,Zt as a,St as b,on as c,dn as d,$t as f,en as g,R as h,nn as i,ct as j,ut as k,rn as l,Qt as m,Jt as n,V as o,an as p,tn as r,sn as s,Vt as t,cn as u,Bt as v,dt as w,Ct as x,Lt as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,n as t}from"./config-CWPHVTic.js";e();export{t as enableConfigs};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./context-noninteractive-DvfVvmSE.js";t();export{n as call,e as collectContextData};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t}from"./rolldown-runtime-DaDcL9Zw.js";import{B as n,Pt as r,Ut as i,Vt as a,dn as o,pn as s,q as c,un as l}from"./state-BQ4BEGin.js";import{$w as u,Cn as d,En as f,Hb as p,Kw as m,Qn as h,Sm as g,St as _,Tn as v,Ub as y,Wn as b,Yr as x,_m as S,ai as C,ci as w,dp as T,gm as E,gr as D,gw as O,mn as k,ms as A,nh as j,on as M,pp as N,ps as P,qt as F,th as I,wm as L,xw as R,yt as z}from"./loadAgentsDir-DGozQu_6.js";import{o as B,s as V}from"./log-DoSpAwRP.js";import{n as H}from"./analytics-COpjZpvd.js";import{n as U,t as W}from"./caches-DWjwe-DN.js";import{randomUUID as G}from"crypto";async function K({setMessages:t,readFileState:r,discoveredSkillNames:u,loadedNestedMemoryPaths:f,getAppState:p,setAppState:_,setConversationId:E}){let k=M();await F(`clear`,{getAppState:p,setAppState:_,signal:AbortSignal.timeout(k),timeoutMs:k}),n();let N=new Set,P=[],I=e=>`isBackgrounded`in e&&e.isBackgrounded===!1;if(p)for(let e of Object.values(p().tasks))I(e)||A(e)&&(N.add(e.agentId),P.push(e));t(()=>[]);let{setContextBlocked:L}=(O(),e(R));L(!1),E&&E(G()),W(N),l(null),o(null),s(null),i(),y(c()),r.clear(),u?.clear(),f?.clear(),_&&_(e=>{let t={};for(let[n,r]of Object.entries(e.tasks)){if(!I(r)){t[n]=r;continue}try{r.status===`running`&&(S(r)&&(r.shellCommand?.kill(),r.shellCommand?.cleanup(),r.cleanupTimeoutId&&clearTimeout(r.cleanupTimeoutId)),`abortController`in r&&r.abortController?.abort(),`unregisterCleanup`in r&&r.unregisterCleanup?.())}catch(e){V(e)}d(n)}return{...e,tasks:t,attribution:T(),standaloneAgentContext:void 0,fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:e.mcp.pluginReconnectKey}}}),m(),b(),a({setCurrentAsParent:!0}),await x();for(let e of P)e.status===`running`&&v(e.id,h(g(e.agentId)));let{saveMode:B}=(D(),e(w));B(`normal`);let H=z();H&&C(H);let U=await j(`clear`);U.length>0&&t(()=>U)}var q=t((()=>{r(),H(),P(),E(),L(),N(),k(),B(),u(),p(),I(),D(),f(),_(),U()}));export{q as n,K as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./conversation--y8PD2Lk.js";e();export{t as clearConversation};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Pt as e,t}from"./state-BQ4BEGin.js";import{$w as n,AS as r,Cm as i,Gr as a,Ji as o,Jw as s,Ln as c,Nr as l,Or as u,Zp as d,_a as f,am as p,br as m,gr as h,is as g,kr as _,la as v,lr as y,nh as b,nr as x,oa as S,pS as C,rs as w,th as T,ts as E,va as D,wa as O,wm as k,xS as A,zn as j}from"./loadAgentsDir-DGozQu_6.js";import{n as M,t as N}from"./cwd-BvNt_018.js";import{Bt as P,zt as F}from"./settings-CodSADx8.js";import{o as I,s as L}from"./log-DoSpAwRP.js";import{relative as R}from"path";M(),e(),k(),P(),E(),p(),I(),o(),n(),T(),h();function z(e){if(e.type!==`attachment`)return e;let t=e.attachment;if(t.type===`new_file`)return{...e,attachment:{...t,type:`file`,displayPath:R(N(),t.filename)}};if(t.type===`new_directory`)return{...e,attachment:{...t,type:`directory`,displayPath:R(N(),t.path)}};if(!(`displayPath`in t)){let n=`filename`in t?t.filename:`path`in t?t.path:`skillDir`in t?t.skillDir:void 0;if(n)return{...e,attachment:{...t,displayPath:R(N(),n)}}}return e}function B(e){return V(e).messages}function V(e){try{let t=e.map(z),n=new Set(F);for(let e of t)e.type===`user`&&e.permissionMode!==void 0&&!n.has(e.permissionMode)&&(e.permissionMode=void 0);let i=S(f(D(t))),a=H(i),o;if(a.kind===`interrupted_turn`){let[e]=v([A({content:`Continue from where you left off.`,isMeta:!0})]);i.push(e),o={kind:`interrupted_prompt`,message:e}}else o=a;let s=i.findLastIndex(e=>e.type!==`system`&&e.type!==`progress`);return s!==-1&&i[s].type===`user`&&i.splice(s+1,0,C({content:r})),{messages:i,turnInterruptionState:o}}catch(e){throw L(e),e}}function H(e){if(e.length===0)return{kind:`none`};let t=e.findLastIndex(e=>e.type!==`system`&&e.type!==`progress`&&!(e.type===`assistant`&&e.isApiErrorMessage)),n=t===-1?void 0:e[t];return!n||n.type===`assistant`?{kind:`none`}:n.type===`user`?n.isMeta||n.isCompactSummary?{kind:`none`}:O(n)?{kind:`interrupted_turn`}:{kind:`interrupted_prompt`,message:n}:n.type===`attachment`?{kind:`interrupted_turn`}:{kind:`none`}}function U(e){for(let n of e)if(n.type===`attachment`){if(n.attachment.type===`invoked_skills`){let e=n.attachment.skills;for(let n of e)n.name&&n.path&&n.content&&t(n.name,n.path,n.content,null)}n.attachment.type===`skill_listing`&&g()}g(),w()}async function W(e){let{messages:t,leafUuids:n}=await l(e),r=null,i=0;for(let e of t.values()){if(e.isSidechain||!n.has(e.uuid))continue;let t=new Date(e.timestamp).getTime();t>i&&(i=t,r=e)}return r?{messages:a(c(t,r)),sessionId:r.sessionId}:{messages:[],sessionId:void 0}}async function G(e,t){try{let n=null,r=null,a;if(e===void 0){let e=_(),t=new Set;try{let{listAllLiveSessions:e}=await import(`./udsClient-CmYHFiBD.js`),n=await e();t=new Set(n.flatMap(e=>e.kind&&e.kind!==`interactive`&&e.sessionId?[e.sessionId]:[]))}catch{}n=(await e).find(e=>{let n=y(e);return!n||!t.has(n)})??null}else if(t){let e=await W(t);r=e.messages,a=e.sessionId}else typeof e==`string`?(n=await x(e),a=e):n=e;if(!n&&!r)return null;n&&(m(n)&&(n=await u(n)),a||(a=y(n)),a&&await s(n,i(a)),d(n),r=n.messages,j(r)),U(r);let o=V(r);r=o.messages;let c=await b(`resume`,{sessionId:a});return r.push(...c),{messages:r,turnInterruptionState:o.turnInterruptionState,fileHistorySnapshots:n?.fileHistorySnapshots,attributionSnapshots:n?.attributionSnapshots,contentReplacements:n?.contentReplacements,contextCollapseCommits:n?.contextCollapseCommits,contextCollapseSnapshot:n?.contextCollapseSnapshot,sessionId:a,agentName:n?.agentName,agentColor:n?.agentColor,agentSetting:n?.agentSetting,customTitle:n?.customTitle,tag:n?.tag,mode:n?.mode,worktreeSession:n?.worktreeSession,prNumber:n?.prNumber,prUrl:n?.prUrl,prRepository:n?.prRepository,fullPath:n?.fullPath,goal:n?.goal}}catch(e){throw L(e),e}}export{G as n,B as t};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{C as n,D as r,Gr as i,H as a,I as o,P as s,T as c,Wt as l,Xn as u,ai as d,di as f,fi as p,hn as m,k as ee,oi as te,ot as ne,p as h,t as g}from"./src-DL3w8VPk.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{Pt as v,at as re,q as ie}from"./state-BQ4BEGin.js";import{BS as y,Cb as ae,Dc as b,Kb as oe,Or as x,Tc as S,VS as se,bi as ce,br as C,ei as le,gr as w,hd as ue,kb as T,lr as E,md as D,qb as de,tr as fe,vr as pe,yi as me}from"./loadAgentsDir-DGozQu_6.js";import{S as he,c as O,i as k,x as ge}from"./debug-CRnGsZOV.js";import{Hn as _e,Ir as ve,Vn as A,kr as ye}from"./settings-CodSADx8.js";import{a as j,o as be,s as xe}from"./log-DoSpAwRP.js";import{n as Se}from"./analytics-COpjZpvd.js";import{S as Ce,_ as M,d as we,p as Te}from"./startupProfiler-DF0AjiDf.js";import{f as Ee,u as De}from"./model-DpZaKZMb.js";import{n as N,t as Oe}from"./TextInput-Cev5Awdd.js";import{n as ke,t as P}from"./useExitOnCtrlCDWithKeybindings-DWRFdFoU.js";import{n as Ae,t as je}from"./select-Fq6g2Ejk.js";import{r as Me,t as Ne}from"./Spinner-VjwI7m_g.js";import{l as Pe,u as Fe}from"./SpinnerGlyph-CqrOK3Mx.js";import{t as Ie}from"./SearchBox-C9xxQzh1.js";import{n as Le,t as Re}from"./useSearchInput-B_mY9wBq.js";import{n as F,t as I}from"./Messages-BFsCpACq.js";function ze({log:e,onExit:t,onSelect:n}){let[i,a]=L.useState(null);L.useEffect(()=>{a(null),C(e)&&x(e).then(a)},[e]);let u=C(e)&&i===null,d=i??e,f=E(d)||``,p=S();return l(`confirm:no`,t,{context:`Confirmation`}),l(`confirm:yes`,(0,L.useCallback)(()=>{n(i??e)},[n,i,e]),{context:`Confirmation`}),u?(0,R.jsxs)(o,{flexDirection:`column`,padding:1,children:[(0,R.jsx)(h,{message:`Loading session…`}),(0,R.jsx)(s,{dimColor:!0,children:(0,R.jsx)(c,{children:(0,R.jsx)(D,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})})})]}):(0,R.jsxs)(o,{flexDirection:`column`,children:[(0,R.jsx)(I,{messages:d.messages,tools:p,commands:[],verbose:!0,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:f,screen:`transcript`,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}),(0,R.jsxs)(o,{flexShrink:0,flexDirection:`column`,borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:`single`,paddingLeft:2,children:[(0,R.jsxs)(s,{children:[Te(d.modified),` · `,d.messageCount,` messages`,d.gitBranch?` · ${d.gitBranch}`:``]}),(0,R.jsx)(s,{dimColor:!0,children:(0,R.jsxs)(c,{children:[(0,R.jsx)(r,{shortcut:`Enter`,action:`resume`}),(0,R.jsx)(D,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})]})}var L,R,Be=e((()=>{L=t(d(),1),g(),ae(),b(),M(),w(),ue(),F(),R=_()}));function z(e,t){if(e===V)return 5;let n=i(e),r=t?Math.min(n,t-H-U):n;return Math.max(0,r)+H+U}function Ve(e,t){let n=t-H-U;return i(e)<=n?e:n<=1?e.charAt(0):Ce(e,n)}function He({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let i=r?`Resume (All Projects)`:`Resume`,a=i.length+1,c=Math.max(qe,G),l=n-a-c-2,u=Math.max(0,Math.min(t,e.length-1)),d=Math.max(20,Math.floor(l/2)),f=e.map(e=>z(e,d)),p=0,m=e.length;if(f.reduce((e,t,n)=>e+t+ +(n<f.length-1),0)>l){let t=l-Ke,n=f[u]??0;for(p=u,m=u+1;p>0||m<e.length;){let r=p>0,i=m<e.length;if(r){let e=(f[p-1]??0)+1;if(n+e<=t){p--,n+=e;continue}}if(i){let e=(f[m]??0)+1;if(n+e<=t){m++,n+=e;continue}}break}}let ee=p,te=e.length-m,ne=e.slice(p,m),h=ne.map((e,t)=>p+t);return(0,B.jsxs)(o,{flexDirection:`row`,gap:1,children:[(0,B.jsx)(s,{color:`suggestion`,children:i}),ee>0&&(0,B.jsxs)(s,{dimColor:!0,children:[W,ee]}),ne.map((e,t)=>{let n=h[t]===u,r=e===V?e:`#${Ve(e,d-H)}`;return(0,B.jsxs)(s,{backgroundColor:n?`suggestion`:void 0,color:n?`inverseText`:void 0,bold:n,children:[` `,r,` `]},e)}),te>0?(0,B.jsxs)(s,{dimColor:!0,children:[Ue,te,We]}):(0,B.jsx)(s,{dimColor:!0,children:Ge})]})}var B,V,H,U,W,Ue,We,Ge,Ke,qe,G,K=e((()=>{g(),M(),B=_(),V=`All`,H=2,U=1,W=`← `,Ue=`→`,We=` (tab to cycle)`,Ge=`(tab to cycle)`,Ke=5,qe=18,G=14}));function Je({nodes:e,onSelect:t,onCancel:n,onFocus:r,focusNodeId:i,visibleOptionCount:a,layout:s=`expanded`,isDisabled:c=!1,hideIndexes:l=!1,isNodeExpanded:u,onExpand:d,onCollapse:f,getParentPrefix:p,getChildPrefix:m,onUpFromFirstItem:ee}){let[te,ne]=q.useState(new Set),h=q.useRef(!1),g=q.useRef(null),_=q.useCallback(e=>u?u(e):te.has(e),[u,te]),v=q.useMemo(()=>{let t=[];function n(e,r,i){let a=!!e.children&&e.children.length>0,o=_(e.id);if(t.push({node:e,depth:r,isExpanded:o,hasChildren:a,parentId:i}),a&&o&&e.children)for(let t of e.children)n(t,r+1,e.id)}for(let t of e)n(t,0);return t},[e,_]),re=q.useCallback(e=>e?`▼ `:`▶ `,[]),ie=q.useCallback(e=>` ▸ `,[]),y=p??re,ae=m??ie,b=q.useCallback(e=>{let t=``;return e.hasChildren?t=y(e.isExpanded):e.depth>0&&(t=ae(e.depth)),t+e.node.label},[y,ae]),oe=q.useMemo(()=>v.map(e=>({label:b(e),description:e.node.description,dimDescription:e.node.dimDescription??!0,value:e.node.id})),[v,b]),x=q.useMemo(()=>{let e=new Map;return v.forEach(t=>e.set(t.node.id,t.node)),e},[v]),S=q.useCallback(e=>v.find(t=>t.node.id===e),[v]),se=q.useCallback((e,t)=>{S(e)?.hasChildren&&(t?d?d(e):ne(t=>new Set(t).add(e)):f?f(e):ne(t=>{let n=new Set(t);return n.delete(e),n}))},[S,d,f]);return(0,Ye.jsx)(o,{tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(!i||c)return;let t=S(i);if(t){if(e.key===`right`&&t.hasChildren)e.preventDefault(),se(i,!0);else if(e.key===`left`){if(t.hasChildren&&t.isExpanded)e.preventDefault(),se(i,!1);else if(t.parentId!==void 0&&(e.preventDefault(),h.current=!0,se(t.parentId,!1),r)){let e=x.get(t.parentId);e&&r(e)}}}},children:(0,Ye.jsx)(je,{options:oe,onChange:q.useCallback(e=>{let n=x.get(e);n&&t(n)},[x,t]),onFocus:q.useCallback(e=>{if(h.current){h.current=!1;return}if(g.current!==e&&(g.current=e,r)){let t=x.get(e);t&&r(t)}},[r,x]),onCancel:n,defaultFocusValue:i,visibleOptionCount:a,layout:s,isDisabled:c,hideIndexes:l,onUpFromFirstItem:ee})})}var q,Ye,Xe=e((()=>{q=t(d(),1),g(),Ae(),Ye=_()}));function Ze(e,t){return Ce(e.replace(/\s+/g,` `).trim(),t)}function Qe({before:e,match:t,after:n},r){return f.dim(e)+r(t)+f.dim(n)}function $e(e,t,n){let r=e.toLowerCase().indexOf(t.toLowerCase());if(r===-1)return null;let i=r+t.length,a=Math.max(0,r-n),o=Math.min(e.length,i+n),s=e.slice(a,r),c=e.slice(r,i),l=e.slice(i,o);return{before:(a>0?`…`:``)+s.replace(/\s+/g,` `).trimStart(),match:c.trim(),after:l.replace(/\s+/g,` `).trimEnd()+(o<e.length?`…`:``)}}function et(e,t,n){let{isGroupHeader:r=!1,isChild:i=!1,forkCount:a=0}=n||{},o=r&&a>0?st:i?ct:0,s=r&&a>0?` (+${a} other ${a===1?`session`:`sessions`})`:``,c=e.isSidechain?` (sidechain)`:``,l=t-o-c.length-s.length;return`${Ze(j(e),l)}${c}${s}`}function tt(e,t){let{isChild:n=!1,showProjectPath:r=!1}=t||{},i=n?` `:``,a=we(e),o=r&&e.projectPath?` · ${e.projectPath}`:``;return i+a+o}function nt({logs:e,maxHeight:t=1/0,forceWidth:i,onCancel:d,onSelect:f,onLogsChanged:p,onLoadMore:h,initialSearchQuery:g,showAllProjects:_=!1,onToggleAllProjects:v,onAgenticSearch:y}){let ae=ne(),b=i===void 0?ae.columns:i,oe=ke(d),x=u(),S=pe(),[se]=a(),ce=Pe(se),C=J.useMemo(()=>e=>te(e,ce.warning),[ce.warning]),[w,ue]=J.useState(null),[T,de]=J.useState(!1),[he,O]=J.useState(!1),[k,ge]=J.useState(!1),_e=J.useMemo(()=>ie(),[]),[ve,A]=J.useState(``),[be,xe]=J.useState(0),[Se,Ce]=J.useState(new Set),[M,Te]=J.useState(null),[Ee,De]=J.useState(1),[N,P]=J.useState(`list`),[Ae,Me]=J.useState(null),Fe=J.useRef(null),[Ie,Re]=J.useState(0),[F,I]=J.useState({status:`idle`}),[L,R]=J.useState(!1),Be=J.useRef(null),{query:z,setQuery:Ve,cursorOffset:B}=Le({isActive:N===`search`&&F.status!==`searching`,onExit:()=>{P(`list`)},onExitUp:()=>{P(`list`)},passthroughCtrlKeys:[`n`],initialQuery:g||``}),V=J.useDeferredValue(z),[H,U]=J.useState(``);J.useEffect(()=>{if(!V){U(``);return}let e=setTimeout(U,300,V);return()=>clearTimeout(e)},[V]);let[W,Ue]=J.useState(null),[We,Ge]=J.useState(!1);J.useEffect(()=>{ye().then(e=>ue(e)),me(_e).then(e=>{ge(e.length>1)})},[_e]);let Ke=J.useMemo(()=>new Map(e.map(e=>[e,it(e)])),[e]),qe=J.useMemo(()=>null,[e,Ke,!1]),G=J.useMemo(()=>ot(e),[e]),K=G.length>0,q=J.useMemo(()=>K?[`All`,...G]:[],[K,G]),Ye=q.length>0&&Ie<q.length?Ie:0,Xe=q[Ye],nt=Xe===`All`?void 0:Xe,rt=+!!K,st=J.useMemo(()=>{let t=e;return S&&(t=e.filter(e=>{let t=re(),n=E(e);return!!(t&&n===t||e.customTitle||fe(e.messages)||e.firstPrompt||e.customTitle)})),nt!==void 0&&(t=t.filter(e=>e.tag===nt)),T&&w&&(t=t.filter(e=>e.gitBranch===w)),k&&!he&&(t=t.filter(e=>e.projectPath===_e)),t},[e,S,nt,T,w,k,he,_e]),ct=J.useMemo(()=>{if(!z)return st;let e=z.toLowerCase();return st.filter(t=>{let n=j(t).toLowerCase(),r=(t.gitBranch||``).toLowerCase(),i=(t.tag||``).toLowerCase(),a=t.prNumber?`pr #${t.prNumber} ${t.prRepository||``}`.toLowerCase():``;return n.includes(e)||r.includes(e)||i.includes(e)||a.includes(e)})},[st,z]);J.useEffect(()=>{},[V,H,!1]),J.useEffect(()=>{Ue(null),Ge(!1)},[H,qe,!1]);let{filteredLogs:lt,snippets:X}=J.useMemo(()=>{let e=new Map,t=ct;if(W&&H&&W.query===H){for(let t of W.results)if(t.searchableText){let n=$e(t.searchableText,H,ut);n&&e.set(t.log,n)}let n=new Set(t.map(e=>e.messages[0]?.uuid)),r=W.results.map(e=>e.log).filter(e=>!n.has(e.messages[0]?.uuid));t=[...t,...r]}return{filteredLogs:t,snippets:e}},[ct,W,H]),Z=J.useMemo(()=>F.status===`results`&&F.results.length>0?F.results:lt,[F,lt]),Q=Math.max(30,b-4),dt=J.useMemo(()=>{if(!S)return[];let e=at(Z);return Array.from(e.entries()).map(([e,t])=>{let n=t[0],r=Z.indexOf(n),i=X.get(n),a=i?Qe(i,C):null;if(t.length===1){let t=tt(n,{showProjectPath:_});return{id:`log:${e}:0`,value:{log:n,indexInFiltered:r},label:et(n,Q),description:a?`${t}\n ${a}`:t,dimDescription:!0}}let o=t.length-1,s=t.slice(1).map((t,n)=>{let r=Z.indexOf(t),i=X.get(t),a=i?Qe(i,C):null,o=tt(t,{isChild:!0,showProjectPath:_});return{id:`log:${e}:${n+1}`,value:{log:t,indexInFiltered:r},label:et(t,Q,{isChild:!0}),description:a?`${o}\n ${a}`:o,dimDescription:!0}}),c=tt(n,{showProjectPath:_});return{id:`group:${e}`,value:{log:n,indexInFiltered:r},label:et(n,Q,{isGroupHeader:!0,forkCount:o}),description:a?`${c}\n ${a}`:c,dimDescription:!0,children:s}})},[S,Z,Q,_,X,C]),ft=J.useMemo(()=>S?[]:Z.map((e,t)=>{let n=Ze(j(e)+(e.isSidechain?` (sidechain)`:``),Q),r=we(e),i=_&&e.projectPath?` · ${e.projectPath}`:``,a=X.get(e),o=a?Qe(a,C):null;return{label:n,description:o?`${r}${i}\n ${o}`:r+i,dimDescription:!0,value:t.toString()}}),[S,Z,C,Q,_,X]),$=M?.value.log??null,pt=()=>{if(!S||!$)return``;let e=E($);if(!e)return``;let t=Z.filter(t=>E(t)===e);if(!(t.length>1))return``;let n=Se.has(e);return t.indexOf($)>0||n?`← to collapse`:`→ to expand`},mt=J.useCallback(async()=>{let e=$?E($):void 0;if(!$||!e){P(`list`),A(``);return}ve.trim()&&(await le(e,ve.trim(),$.fullPath),S&&p&&p()),P(`list`),A(``)},[$,ve,p,S]),ht=J.useCallback(()=>{P(`list`)},[]),gt=J.useCallback(()=>{P(`search`)},[]),_t=J.useCallback(async()=>{if(!z.trim()||!y||!0)return;Be.current?.abort();let t=new AbortController;Be.current=t,I({status:`searching`}),z.length;try{let n=await y(z,e,t.signal);if(t.signal.aborted)return;I({status:`results`,results:n,query:z}),z.length,n.length}catch(e){if(t.signal.aborted)return;I({status:`error`,message:e instanceof Error?e.message:`Search failed`}),z.length}},[z,y,!1,e]);J.useEffect(()=>{F.status!==`idle`&&F.status!==`searching`&&(F.status===`results`&&F.query!==z||F.status===`error`)&&I({status:`idle`})},[z,F]),J.useEffect(()=>()=>{Be.current?.abort()},[]);let vt=J.useRef(F.status);J.useEffect(()=>{let e=vt.current;if(vt.current=F.status,e===`searching`&&F.status===`results`){if(S&&dt.length>0)Te(dt[0]);else if(!S&&Z.length>0){let e=Z[0];Te({id:`0`,value:{log:e,indexInFiltered:0},label:``})}}},[F.status,S,dt,Z]);let yt=J.useCallback(e=>{let t=parseInt(e,10),n=Z[t];!n||Fe.current===t.toString()||(Fe.current=t.toString(),Te({id:t.toString(),value:{log:n,indexInFiltered:t},label:``}),De(t+1))},[Z]),bt=J.useCallback(e=>{Te(e);let t=Z.findIndex(t=>E(t)===E(e.value.log));t>=0&&De(t+1)},[Z]);l(`confirm:no`,()=>{Be.current?.abort(),I({status:`idle`})},{context:`Confirmation`,isActive:N!==`preview`&&F.status===`searching`}),l(`confirm:no`,()=>{P(`list`),A(``)},{context:`Settings`,isActive:N===`rename`&&F.status!==`searching`}),l(`confirm:no`,()=>{Ve(``),R(!1),d?.()},{context:`Confirmation`,isActive:N!==`preview`&&N!==`rename`&&N!==`search`&&L&&F.status!==`searching`}),m((e,t)=>{if(N!==`preview`&&F.status!==`searching`&&N!==`rename`)if(N===`search`)e.toLowerCase()===`n`&&t.ctrl?ht():(t.return||t.downArrow)&&z.trim();else{if(L){if(t.return){_t(),R(!1);return}else if(t.downArrow){R(!1);return}else if(t.upArrow){P(`search`),R(!1);return}}if(K&&t.tab){let e=t.shift?-1:1;Re(t=>{let n=((t<q.length?t:0)+q.length+e)%q.length;return q[n],G.length,n});return}let n=!t.ctrl&&!t.meta,r=e.toLowerCase();r===`a`&&t.ctrl&&v?v():r===`b`&&t.ctrl?de(!T):r===`w`&&t.ctrl&&k?O(!he):r===`/`&&n?P(`search`):r===`r`&&t.ctrl&&$?(P(`rename`),A(``)):r===`v`&&t.ctrl&&$?(Me($),P(`preview`),$.messageCount):$&&n&&e.length>0&&!/^\s+$/.test(e)&&(P(`search`),Ve(e))}},{isActive:!0});let xt=[];T&&w&&xt.push(w),k&&!he&&xt.push(`current worktree`);let St=8+ +(xt.length>0&&N!==`search`)+rt,Ct=Math.max(1,Math.floor((t-St-2)/3));return J.useEffect(()=>{if(!h)return;let e=Ct*2;Ee+e>=Z.length&&h(Ct*3)},[Ee,Ct,Z.length,h]),e.length===0?null:N===`preview`&&Ae&&S?(0,Y.jsx)(ze,{log:Ae,onExit:()=>{P(`list`),Me(null)},onSelect:f}):(0,Y.jsxs)(o,{flexDirection:`column`,height:t-1,children:[(0,Y.jsx)(o,{flexShrink:0,children:(0,Y.jsx)(n,{color:`suggestion`})}),(0,Y.jsx)(o,{flexShrink:0,children:(0,Y.jsx)(s,{children:` `})}),K?(0,Y.jsx)(He,{tabs:q,selectedIndex:Ye,availableWidth:b,showAllProjects:_}):(0,Y.jsx)(o,{flexShrink:0,children:(0,Y.jsxs)(s,{bold:!0,color:`suggestion`,children:[`Resume Session`,N===`list`&&Z.length>Ct&&(0,Y.jsxs)(s,{dimColor:!0,children:[` `,`(`,Ee,` of `,Z.length,`)`]})]})}),(0,Y.jsx)(ee,{query:z,isFocused:N===`search`,isTerminalFocused:x,cursorOffset:B}),xt.length>0&&N!==`search`&&(0,Y.jsx)(o,{flexShrink:0,paddingLeft:2,children:(0,Y.jsx)(s,{dimColor:!0,children:(0,Y.jsx)(c,{children:xt})})}),(0,Y.jsx)(o,{flexShrink:0,children:(0,Y.jsx)(s,{children:` `})}),F.status===`searching`&&(0,Y.jsxs)(o,{paddingLeft:1,flexShrink:0,children:[(0,Y.jsx)(Ne,{}),(0,Y.jsx)(s,{children:` Searching…`})]}),F.status===`results`&&F.results.length>0&&(0,Y.jsx)(o,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(s,{dimColor:!0,italic:!0,children:`Work Mate found these results:`})}),F.status===`results`&&F.results.length===0&<.length===0&&(0,Y.jsx)(o,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(s,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),F.status===`error`&<.length===0&&(0,Y.jsx)(o,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(s,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),!!z.trim()&&y&&!1,F.status===`searching`?null:N===`rename`&&$?(0,Y.jsxs)(o,{paddingLeft:2,flexDirection:`column`,children:[(0,Y.jsx)(s,{bold:!0,children:`Rename session:`}),(0,Y.jsx)(o,{paddingTop:1,children:(0,Y.jsx)(Oe,{value:ve,onChange:A,onSubmit:mt,placeholder:j($,`Enter new session name`),columns:b,cursorOffset:be,onChangeCursorOffset:xe,showCursor:!0})})]}):S?(0,Y.jsx)(Je,{nodes:dt,onSelect:e=>{f(e.value.log)},onFocus:bt,onCancel:d,focusNodeId:M?.id,visibleOptionCount:Ct,layout:`expanded`,isDisabled:N===`search`||L,hideIndexes:!1,isNodeExpanded:e=>{if(N===`search`||T)return!0;let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;return t?Se.has(t):!1},onExpand:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&Ce(e=>new Set(e).add(t))},onCollapse:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&Ce(e=>{let n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:gt}):(0,Y.jsx)(je,{options:ft,onChange:e=>{let t=Z[parseInt(e,10)];t&&f(t)},visibleOptionCount:Ct,onCancel:d,onFocus:yt,defaultFocusValue:M?.id.toString(),layout:`expanded`,isDisabled:N===`search`||L,onUpFromFirstItem:gt}),(0,Y.jsx)(o,{paddingLeft:2,children:oe.pending?(0,Y.jsxs)(s,{dimColor:!0,children:[`Press `,oe.keyName,` again to exit`]}):N===`rename`?(0,Y.jsx)(s,{dimColor:!0,children:(0,Y.jsxs)(c,{children:[(0,Y.jsx)(r,{shortcut:`Enter`,action:`save`}),(0,Y.jsx)(D,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):F.status===`searching`?(0,Y.jsx)(s,{dimColor:!0,children:(0,Y.jsxs)(c,{children:[(0,Y.jsx)(s,{children:`Searching with Work Mate…`}),(0,Y.jsx)(D,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):L?(0,Y.jsx)(s,{dimColor:!0,children:(0,Y.jsxs)(c,{children:[(0,Y.jsx)(r,{shortcut:`Enter`,action:`search`}),(0,Y.jsx)(r,{shortcut:`↓`,action:`skip`}),(0,Y.jsx)(D,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):N===`search`?(0,Y.jsx)(s,{dimColor:!0,children:(0,Y.jsxs)(c,{children:[(0,Y.jsx)(s,{children:`Type to Search`}),(0,Y.jsx)(r,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(D,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`clear`})]})}):(0,Y.jsx)(s,{dimColor:!0,children:(0,Y.jsxs)(c,{children:[v&&(0,Y.jsx)(r,{shortcut:`Ctrl+A`,action:`show ${_?`current dir`:`all projects`}`}),w&&(0,Y.jsx)(r,{shortcut:`Ctrl+B`,action:`toggle branch`}),k&&(0,Y.jsx)(r,{shortcut:`Ctrl+W`,action:`show ${he?`current worktree`:`all worktrees`}`}),(0,Y.jsx)(r,{shortcut:`Ctrl+V`,action:`preview`}),(0,Y.jsx)(r,{shortcut:`Ctrl+R`,action:`rename`}),(0,Y.jsx)(s,{children:`Type to search`}),(0,Y.jsx)(D,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`}),pt()&&(0,Y.jsx)(s,{children:pt()})]})})})]})}function rt(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function it(e){let t=(e.messages.length<=lt?e.messages:[...e.messages.slice(0,X),...e.messages.slice(-1e3)]).map(rt).filter(Boolean).join(` `),n=`${[e.customTitle,e.summary,e.firstPrompt,e.gitBranch,e.tag,e.prNumber?`PR #${e.prNumber}`:void 0,e.prRepository].filter(Boolean).join(` `)} ${t}`.trim();return n.length>Z?n.slice(0,Z):n}function at(e){let t=new Map;for(let n of e){let e=E(n);if(e){let r=t.get(e);r?r.push(n):t.set(e,[n])}}return t.forEach(e=>e.sort((e,t)=>new Date(t.modified).getTime()-new Date(e.modified).getTime())),t}function ot(e){let t=new Set;for(let n of e)n.tag&&t.add(n.tag);return Array.from(t).sort((e,t)=>e.localeCompare(t))}var J,Y,st,ct,lt,X,Z,ut,Q=e((()=>{p(),J=t(d(),1),v(),P(),Re(),T(),g(),ae(),Se(),M(),ce(),ve(),be(),w(),Fe(),ue(),Ae(),Ie(),Be(),Me(),K(),N(),Xe(),Y=_(),st=2,ct=4,lt=2e3,X=1e3,Z=5e4,ut=50}));function dt(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function ft(e){if(e.length===0)return``;let t=(e.length<=ht?e:[...e.slice(0,ht/2),...e.slice(-100/2)]).map(dt).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();return t.length>mt?`${t.slice(0,mt)}…`:t}function $(e,t){return!!(j(e).toLowerCase().includes(t)||e.customTitle?.toLowerCase().includes(t)||e.tag?.toLowerCase().includes(t)||e.gitBranch?.toLowerCase().includes(t)||e.summary?.toLowerCase().includes(t)||e.firstPrompt?.toLowerCase().includes(t)||e.messages&&e.messages.length>0&&ft(e.messages).toLowerCase().includes(t))}async function pt(e,t,n){if(!e.trim()||t.length===0)return[];let r=e.toLowerCase(),i=t.filter(e=>$(e,r)),a;if(i.length>=gt)a=i.slice(0,gt);else{let e=t.filter(e=>!$(e,r)),n=gt-i.length;a=[...i,...e.slice(0,n)]}O(`Agentic search: ${a.length}/${t.length} logs, query="${e}", matching: ${i.length}, with messages: ${A(a,e=>e.messages?.length>0)}`);let o=a.map(async e=>{if(C(e))try{return await x(e)}catch(t){return xe(t),e}return e}),s=await Promise.all(o);O(`Agentic search: loaded ${A(s,e=>e.messages?.length>0)}/${a.length} logs with transcripts`);let c=`Sessions:
|
|
2
|
-
${s.map((e,t)=>{let n=[`${t}:`],r=j(e);if(n.push(r),e.customTitle&&e.customTitle!==r&&n.push(`[custom title: ${e.customTitle}]`),e.tag&&n.push(`[tag: ${e.tag}]`),e.gitBranch&&n.push(`[branch: ${e.gitBranch}]`),e.summary&&n.push(`- Summary: ${e.summary}`),e.firstPrompt&&e.firstPrompt!==`No prompt`&&n.push(`- First message: ${e.firstPrompt.slice(0,300)}`),e.messages&&e.messages.length>0){let t=ft(e.messages);t&&n.push(`- Transcript: ${t}`)}return n.join(` `)}).join(`
|
|
3
|
-
`)}
|
|
4
|
-
|
|
5
|
-
Search query: "${e}"
|
|
6
|
-
|
|
7
|
-
Find the sessions that are most relevant to this query.`;O(`Agentic search prompt (first 500 chars): ${c.slice(0,500)}...`);try{let e=De();O(`Agentic search using model: ${e}`);let t=(await se({model:e,system:_t,messages:[{role:`user`,content:c}],signal:n,querySource:`session_search`})).content.find(e=>e.type===`text`);if(t?.type!==`text`)return O(`No text content in agentic search response`),[];O(`Agentic search response: ${t.text}`);let r=t.text.match(/\{[\s\S]*\}/);if(!r)return O(`Could not find JSON in agentic search response`),[];let i=(he(r[0]).relevant_indices||[]).filter(e=>e>=0&&e<s.length).map(e=>s[e]);return O(`Agentic search found ${i.length} relevant sessions`),i}catch(e){return xe(e),O(`Agentic search error: ${e}`),[]}}var mt,ht,gt,_t,vt=e((()=>{_e(),k(),be(),Ee(),w(),y(),ge(),mt=2e3,ht=100,gt=100,_t=`Your goal is to find relevant sessions based on a user's search query.
|
|
8
|
-
|
|
9
|
-
You will be given a list of sessions with their metadata and a search query. Identify which sessions are most relevant to the query.
|
|
10
|
-
|
|
11
|
-
Each session may include:
|
|
12
|
-
- Title (display name or custom title)
|
|
13
|
-
- Tag (user-assigned category, shown as [tag: name] - users tag sessions with /tag command to categorize them)
|
|
14
|
-
- Branch (git branch name, shown as [branch: name])
|
|
15
|
-
- Summary (AI-generated summary)
|
|
16
|
-
- First message (beginning of the conversation)
|
|
17
|
-
- Transcript (excerpt of conversation content)
|
|
18
|
-
|
|
19
|
-
IMPORTANT: Tags are user-assigned labels that indicate the session's topic or category. If the query matches a tag exactly or partially, those sessions should be highly prioritized.
|
|
20
|
-
|
|
21
|
-
For each session, consider (in order of priority):
|
|
22
|
-
1. Exact tag matches (highest priority - user explicitly categorized this session)
|
|
23
|
-
2. Partial tag matches or tag-related terms
|
|
24
|
-
3. Title matches (custom titles or first message content)
|
|
25
|
-
4. Branch name matches
|
|
26
|
-
5. Summary and transcript content matches
|
|
27
|
-
6. Semantic similarity and related concepts
|
|
28
|
-
|
|
29
|
-
CRITICAL: Be VERY inclusive in your matching. Include sessions that:
|
|
30
|
-
- Contain the query term anywhere in any field
|
|
31
|
-
- Are semantically related to the query (e.g., "testing" matches sessions about "tests", "unit tests", "QA", etc.)
|
|
32
|
-
- Discuss topics that could be related to the query
|
|
33
|
-
- Have transcripts that mention the concept even in passing
|
|
34
|
-
|
|
35
|
-
When in doubt, INCLUDE the session. It's better to return too many results than too few. The user can easily scan through results, but missing relevant sessions is frustrating.
|
|
36
|
-
|
|
37
|
-
Return sessions ordered by relevance (most relevant first). If truly no sessions have ANY connection to the query, return an empty array - but this should be rare.
|
|
38
|
-
|
|
39
|
-
Respond with ONLY the JSON object, no markdown formatting:
|
|
40
|
-
{"relevant_indices": [2, 5, 0]}`}));function yt(e,t){let n=ie();if(!t||!e.projectPath||e.projectPath===n)return{isCrossProject:!1};let r=E(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${de([e.projectPath])} && claude --resume ${r}`,projectPath:e.projectPath}}var bt=e((()=>{v(),oe(),w()}));export{nt as a,vt as i,bt as n,Q as o,pt as r,yt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./cwd-BvNt_018.js";e();export{t as getCwd};
|