@readmagic/workmate 0.0.7 → 0.0.8
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-CwLtQld4.js +1 -0
- package/dist/chunks/App-Ba52HvYC.js +1 -0
- package/dist/chunks/{ApproveApiKey-B2HJUD7h.js → ApproveApiKey-CEIfuUh0.js} +1 -1
- package/dist/chunks/ApproveApiKey-D2MLQu2P.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-IGDrkbWl.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-DllL8dxU.js → BypassPermissionsModeDialog-GYhq--JR.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-BZSyRqeq.js → ClaudeMdExternalIncludesDialog-C-CTa-95.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-Catv6BCJ.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-BeQXqUtX.js +1 -0
- package/dist/chunks/{DiffDialog-B7hx8i_Y.js → DiffDialog-AC5DSJrq.js} +6 -6
- package/dist/chunks/Doctor-B9Rxsoy0.js +1 -0
- package/dist/chunks/Doctor-lhUBhEy5.js +3 -0
- package/dist/chunks/ExitFlow-Cu8SoQHs.js +2 -0
- package/dist/chunks/Grove-Bc4CofEj.js +11 -0
- package/dist/chunks/{HybridTransport-rK83Qijz.js → HybridTransport-BJPOG2wl.js} +3 -3
- package/dist/chunks/{InvalidConfigDialog-DdO0AxyF.js → InvalidConfigDialog-BI13il58.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-s1G0DwXF.js → InvalidSettingsDialog-CtOheV1K.js} +1 -1
- package/dist/chunks/MCPConnectionManager-ao-P3xSA.js +1 -0
- package/dist/chunks/MCPToolListView-dkofcJs4.js +1 -0
- package/dist/chunks/{McpParsingWarnings-Du5IxZos.js → McpParsingWarnings-BS4JoR5l.js} +1 -1
- package/dist/chunks/MessageSelector-B88b2ypw.js +3 -0
- package/dist/chunks/Messages-BPeI7lLV.js +11 -0
- package/dist/chunks/Onboarding-c2fQ8Io_.js +1 -0
- package/dist/chunks/{PromptInputFooterSuggestions-BmsFdOu9.js → PromptInputFooterSuggestions-D1cH9sDX.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-DX-0wEDo.js → PromptInputHelpMenu-DDD5WuK0.js} +1 -1
- package/dist/chunks/QueryEngine-Cv_meCam.js +1 -0
- package/dist/chunks/REPL-BXhAQOXb.js +139 -0
- package/dist/chunks/REPL-YqjLnr3A.js +1 -0
- package/dist/chunks/RemoteSessionManager-CT7T8BaR.js +2 -0
- package/dist/chunks/ResumeConversation-CIZCjms9.js +1 -0
- package/dist/chunks/{SSETransport-5VK5okFv.js → SSETransport-CrwbKuVt.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-Dx6093yw.js +1 -0
- package/dist/chunks/Settings-CyUm0AtU.js +2 -0
- package/dist/chunks/{TeleportProgress-DxN0bQL2.js → TeleportProgress-C3qyp5zy.js} +1 -1
- package/dist/chunks/TeleportRepoMismatchDialog-BV--nyYn.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-Blo2cZg-.js +1 -0
- package/dist/chunks/ThemePicker-EQ6hPUeI.js +1 -0
- package/dist/chunks/TrustDialog-BukWGvHZ.js +1 -0
- package/dist/chunks/{ValidationErrorsList-BYsDtAvX.js → ValidationErrorsList-DokTJQwi.js} +1 -1
- package/dist/chunks/{WelcomeV2-C1BfrqC5.js → WelcomeV2-Ci9VwPYh.js} +1 -1
- package/dist/chunks/{add-dir-DfLYgwox.js → add-dir-DPQV0qml.js} +1 -1
- package/dist/chunks/{agentDisplay-CMmHIl86.js → agentDisplay-DBQYOaOh.js} +1 -1
- package/dist/chunks/agents-DmybpgDN.js +103 -0
- package/dist/chunks/{agents-DE_4mAHG.js → agents-HlKk68Qc.js} +1 -1
- package/dist/chunks/allErrors-BPn_2TrB.js +1 -0
- package/dist/chunks/analytics-CkYUHW_U.js +1 -0
- package/dist/chunks/ant-DjdvlLOo.js +1 -0
- package/dist/chunks/api-AMgj1zf_.js +1 -0
- package/dist/chunks/api-CF5IVtj0.js +1 -0
- package/dist/chunks/{asciicast-CbAjUHT_.js → asciicast-BJNYO5sh.js} +1 -1
- package/dist/chunks/asciicast-CH6hdK0a.js +1 -0
- package/dist/chunks/auth-CNjDn1VY.js +15 -0
- package/dist/chunks/auth-CZzP483s.js +1 -0
- package/dist/chunks/auth-DDSBm_Yj.js +1 -0
- package/dist/chunks/{autoMode-ZW70mpr0.js → autoMode-Cr0AhS1G.js} +5 -5
- package/dist/chunks/{autonomy-CwbWsCnv.js → autonomy-ARUQt-Lu.js} +1 -1
- package/dist/chunks/{autonomy-Oui8yK8G.js → autonomy-D4xZLOdJ.js} +7 -7
- package/dist/chunks/{autonomyPanel-Mq50H7iM.js → autonomyPanel-BQK9MoeB.js} +1 -1
- package/dist/chunks/backgroundHousekeeping--eBgphcg.js +17 -0
- package/dist/chunks/backgroundHousekeeping-VV1V_Y2Z.js +1 -0
- package/dist/chunks/{banner-CWkrK10u.js → banner-Ca7rki2V.js} +2 -2
- package/dist/chunks/bg-BK_9J6F6.js +1 -0
- package/dist/chunks/{bg-WnYN5ifx.js → bg-DxRHF1yn.js} +2 -2
- package/dist/chunks/{branch-DU5O9KZ0.js → branch-BYq0zpzT.js} +1 -1
- package/dist/chunks/{break-cache-C_p7Kmx2.js → break-cache-BKvoMOZx.js} +2 -2
- package/dist/chunks/bridgeConfig-C82un7rJ.js +1 -0
- package/dist/chunks/{bridgeConfig-CE6dMsiJ.js → bridgeConfig-jDEva6Eh.js} +1 -1
- package/dist/chunks/bridgeMessaging-YqYdl6ej.js +1 -0
- package/dist/chunks/bridgePointer-DIM0sj0x.js +1 -0
- package/dist/chunks/btw-CUV3nRrE.js +1 -0
- package/dist/chunks/caches-BZ59_En6.js +1 -0
- package/dist/chunks/caches-Cg-HtWKG.js +1 -0
- package/dist/chunks/capacityWake-CKOiRELo.js +3 -0
- package/dist/chunks/ccrClient-BC2q3k44.js +1 -0
- package/dist/chunks/{claudeDesktop-Fe-QL-sN.js → claudeDesktop-DQXL5bGm.js} +1 -1
- package/dist/chunks/{clear-D8m2utXW.js → clear-1etSJhdg.js} +1 -1
- package/dist/chunks/{cliLaunch-BkPAatcs.js → cliLaunch-CQjLYRzM.js} +1 -1
- package/dist/chunks/client-DQXvVKND.js +1 -0
- package/dist/chunks/{client-C6MbjvOB.js → client-DQwf_b9o.js} +1 -1
- package/dist/chunks/client-DkgC-mFB.js +1 -0
- package/dist/chunks/{color-DWhgZH7A.js → color-CBsNbt1s.js} +1 -1
- package/dist/chunks/commands-qM5z_Uld.js +1 -0
- package/dist/chunks/compact-BclJiRJe.js +2 -0
- package/dist/chunks/completionCache-BMHAktkM.js +1 -0
- package/dist/chunks/config-CE058cvr.js +3 -0
- package/dist/chunks/config-D81avYye.js +1 -0
- package/dist/chunks/config-DpOOllGk.js +1 -0
- package/dist/chunks/context-noninteractive-Ct_ttQfP.js +29 -0
- package/dist/chunks/context-noninteractive-DJb8H_hN.js +1 -0
- package/dist/chunks/context-sR9fJmXE.js +1 -0
- package/dist/chunks/conversation-D48Kt3ar.js +1 -0
- package/dist/chunks/conversation-fOFTa7k5.js +1 -0
- package/dist/chunks/{createSSHSession-BOdTAX3N.js → createSSHSession-BmHXA2me.js} +1 -1
- package/dist/chunks/createSession-C4rukWkv.js +1 -0
- package/dist/chunks/createSession-CSwlW2T2.js +1 -0
- package/dist/chunks/crossProjectResume-lDFB2ZcY.js +40 -0
- package/dist/chunks/cwd-5Xr-Qka6.js +1 -0
- package/dist/chunks/cwd-C5ce-7WB.js +1 -0
- package/dist/chunks/{daemon-YtZbMQtn.js → daemon-ZtpTZWgQ.js} +1 -1
- package/dist/chunks/{datadog-DqHxqiwY.js → datadog-BJn5ECIu.js} +1 -1
- package/dist/chunks/{debug-BrXObCdR.js → debug-RZ4NuXyS.js} +1 -1
- package/dist/chunks/debugUtils-D30M1cbN.js +1 -0
- package/dist/chunks/{detached-TYk4hMFj.js → detached-jrVP11oU.js} +1 -1
- package/dist/chunks/{detectRepository-BPr0VWNO.js → detectRepository-CFiHe6Rv.js} +1 -1
- package/dist/chunks/detectRepository-DqQvyj_a.js +1 -0
- package/dist/chunks/{diff-CJEKvOA5.js → diff-BKiK3xHv.js} +1 -1
- package/dist/chunks/directoryCompletion-BagQcynj.js +1 -0
- package/dist/chunks/doctor-BEHYm34V.js +1 -0
- package/dist/chunks/{entry-DE0uMIf0.js → entry-BzL1MFQG.js} +4 -4
- package/dist/chunks/esm-BLPbfHQd.js +1 -0
- package/dist/chunks/{execFileNoThrow-D244NytW.js → execFileNoThrow-CCX-JY8h.js} +1 -1
- package/dist/chunks/{execSyncWrapper-CCMQShK-.js → execSyncWrapper-dhRSYGFW.js} +1 -1
- package/dist/chunks/exit-DE2YiAhQ.js +1 -0
- package/dist/chunks/{lazySchema-DULtBUCI.js → external-CEp-aPkt.js} +1 -1
- package/dist/chunks/extraUsage-Dw7AXiH7.js +1 -0
- package/dist/chunks/extractMemories-DxTUMiv3.js +1 -0
- package/dist/chunks/fast-CHmMkIpE.js +1 -0
- package/dist/chunks/fast-uQASHWqR.js +1 -0
- package/dist/chunks/fileSuggestions-Dyu2kQtE.js +3 -0
- package/dist/chunks/firstPartyEventLogger-D5ohKbIe.js +5 -0
- package/dist/chunks/firstPartyEventLogger-LsNY6yOt.js +1 -0
- package/dist/chunks/flushGate-Cnsu4HET.js +1 -0
- package/dist/chunks/gemini-Cudre91e.js +1 -0
- package/dist/chunks/generateRecap-CiFxXlmH.js +1 -0
- package/dist/chunks/generateSessionName-DitoBxJT.js +1 -0
- package/dist/chunks/{genericProcessUtils-CdQTApYX.js → genericProcessUtils-DVfMHhfy.js} +1 -1
- package/dist/chunks/git-BerW9bId.js +6 -0
- package/dist/chunks/git-D6dOU2mT.js +1 -0
- package/dist/chunks/githubRepoPathMapping-DGr0kJ8D.js +1 -0
- package/dist/chunks/{goal-B4GsR54_.js → goal-DuUayfDg.js} +3 -3
- package/dist/chunks/grok-tRbmZzEh.js +1 -0
- package/dist/chunks/grove-Cv19v6Sv.js +7 -0
- package/dist/chunks/help-DkqxbFDM.js +1 -0
- package/dist/chunks/{hooks-CkA9bhHl.js → hooks-BZJTWD07.js} +2 -2
- package/dist/chunks/hooks-CsP42iOp.js +1 -0
- package/dist/chunks/initReplBridge-DdsSWVqN.js +1 -0
- package/dist/chunks/{install-Dzlm4u58.js → install-BI---dv0.js} +1 -1
- package/dist/chunks/{instrumentation-Yt31gxWN.js → instrumentation-CcWzhGfE.js} +4 -4
- package/dist/chunks/{job-BXujwZNa.js → job-B0ftcqPF.js} +1 -1
- package/dist/chunks/{jwtUtils-DE2GPUcx.js → jwtUtils-C0cE-1Ey.js} +1 -1
- package/dist/chunks/keybindings-DZU3vwo3.js +2 -0
- package/dist/chunks/language-DHhXLb_Y.js +1 -0
- package/dist/chunks/{language-Ca4B018X.js → language-s-dLbdVz.js} +1 -1
- package/dist/chunks/launchLocalMemory-twLxpPvg.js +3 -0
- package/dist/chunks/{launchOnboarding-gOVAFEFp.js → launchOnboarding-BWz2XSb9.js} +1 -1
- package/dist/chunks/lazySchema-B4D4qJVE.js +1 -0
- package/dist/chunks/{loadAgentsDir-x3rlgED4.js → loadAgentsDir-ByO8eJqU.js} +1710 -1977
- package/dist/chunks/loadAgentsDir-CMNFLt7R.js +1 -0
- package/dist/chunks/loadPluginHooks-BPnxcgrL.js +1 -0
- package/dist/chunks/{localSearch-DtplGF-l.js → localSearch-CHHCH16D.js} +1 -1
- package/dist/chunks/localSearch-DzQODFap.js +1 -0
- package/dist/chunks/log-CZ0zYP_c.js +1 -0
- package/dist/chunks/logoV2Utils-CGUJ-5gY.js +1 -0
- package/dist/chunks/{magicDocs-qdDB_mKb.js → magicDocs-C5i5ruuU.js} +3 -3
- package/dist/chunks/{main-D862LI_d.js → main-BLD4QAQg.js} +2 -2
- package/dist/chunks/{main-OWFSddRx.js → main-D4Uk-WUs.js} +87 -84
- package/dist/chunks/{managedEnv-Aq5BXfY7.js → managedEnv-C-9XSN14.js} +1 -1
- package/dist/chunks/managedEnv-DLVRBaA9.js +1 -0
- package/dist/chunks/{mappers-04gNXJ3w.js → mappers-CHRFic5q.js} +1 -1
- package/dist/chunks/mcp-BMVdGknC.js +1 -0
- package/dist/chunks/mcp-COS5RJFS.js +6 -0
- package/dist/chunks/mcp-tGsOW1GN.js +2 -0
- package/dist/chunks/memoize-B8hfb1JN.js +1 -0
- package/dist/chunks/memory-DR6poqeH.js +1 -0
- package/dist/chunks/{mode-DY087x_x.js → mode-QV-NW1Wd.js} +2 -2
- package/dist/chunks/model-BF_4ebyl.js +1 -0
- package/dist/chunks/{model-D0EfJBuw.js → model-BNU_ulDJ.js} +1 -1
- package/dist/chunks/model-CwO-g1RW.js +1 -0
- package/dist/chunks/nativeInstaller-B-lNJjM-.js +1 -0
- package/dist/chunks/observationStore-BpjlK0pG.js +3 -0
- package/dist/chunks/omit-DZCEXri5.js +1 -0
- package/dist/chunks/onChangeAppState-BmfM5g-D.js +1 -0
- package/dist/chunks/{openai-EYRnUsco.js → openai-DPH6rXOZ.js} +3 -3
- package/dist/chunks/{panel-BSZGX6jN.js → panel-mD094ALT.js} +1 -1
- package/dist/chunks/{panelCall-dMvRPAGE.js → panelCall-SbffM7G4.js} +1 -1
- package/dist/chunks/parser-DrBC8nWp.js +1 -0
- package/dist/chunks/{parser-DFwaTGf7.js → parser-dbHRgXb8.js} +1 -1
- package/dist/chunks/partition-DKuAFJkc.js +1 -0
- package/dist/chunks/{path-D5U-tm91.js → path-Cv9QMBAX.js} +1 -1
- package/dist/chunks/permissions-ey-bfanE.js +3 -0
- package/dist/chunks/{pidLock-CbC_il6r.js → pidLock-DJnS_38v.js} +2 -2
- package/dist/chunks/{pipeTransport-CqCnc-Ys.js → pipeTransport-DVOKR4c_.js} +1 -1
- package/dist/chunks/{plan-rsb_83Fo.js → plan-Brg9XnRr.js} +1 -1
- package/dist/chunks/{platform-BrYefG_2.js → platform-DCXXznJg.js} +1 -1
- package/dist/chunks/plugin-CRwa39Y1.js +17 -0
- package/dist/chunks/{pluginAutoupdate-0k03PVff.js → pluginAutoupdate-D0LIP7cy.js} +1 -1
- package/dist/chunks/pluginBlocklist-PwHHD3nj.js +1 -0
- package/dist/chunks/pluginCliCommands-BJM5Bdpf.js +1 -0
- package/dist/chunks/pluginFlagging-pBxSselw.js +1 -0
- package/dist/chunks/pluginOperations-C7p_Qr2r.js +2 -0
- package/dist/chunks/pluginStartupCheck-C0HqhG6D.js +1 -0
- package/dist/chunks/pluginStartupCheck-Di4LjHXf.js +1 -0
- package/dist/chunks/{plugins-CQNKZmjP.js → plugins-DUKNjLq6.js} +4 -4
- package/dist/chunks/pollConfig-BgpfHQPJ.js +1 -0
- package/dist/chunks/{poorMode-CBOtooa0.js → poorMode-CYXmr_mU.js} +1 -1
- package/dist/chunks/poorMode-CejPNCp-.js +1 -0
- package/dist/chunks/print-gyTOCJzk.js +23 -0
- package/dist/chunks/processBashCommand-Cze9vCm6.js +1 -0
- package/dist/chunks/processSlashCommand-BRajh1v7.js +5 -0
- package/dist/chunks/prompt-B7joRiqj.js +139 -0
- package/dist/chunks/prompt-DqSMh2x9.js +1 -0
- package/dist/chunks/prompt-Eysh8Et_.js +1 -0
- package/dist/chunks/{promptEditor-CyTzyjwG.js → promptEditor-R_acDAgI.js} +2 -2
- package/dist/chunks/{protocolHandler-JR8pASdH.js → protocolHandler-RNKkhq91.js} +1 -1
- package/dist/chunks/{proxy-CRN7jYIi.js → proxy-BmtEnJ02.js} +1 -1
- package/dist/chunks/rcDebugLog-CARUIORE.js +1 -0
- package/dist/chunks/reconciler-BfkO6X2X.js +4 -0
- package/dist/chunks/refresh-C1X3sptR.js +1 -0
- package/dist/chunks/registerProtocol-DoKqmqu2.js +36 -0
- package/dist/chunks/{reload-plugins-B9ApSp2m.js → reload-plugins-C0osFcNh.js} +1 -1
- package/dist/chunks/remoteBridgeCore-Cddqv2WW.js +1 -0
- package/dist/chunks/remoteManagedSettings-B1mnRDmA.js +1 -0
- package/dist/chunks/rename-B3tf-YiD.js +1 -0
- package/dist/chunks/{renderOptions-BUJB9nAm.js → renderOptions-ChLwxtVu.js} +1 -1
- package/dist/chunks/replBridgeHandle-CNwNIijW.js +1 -0
- package/dist/chunks/{resume-BicEjsPd.js → resume-Be1G_GBL.js} +2 -2
- package/dist/chunks/ripgrep-C2PhTJDh.js +1 -0
- package/dist/chunks/{ripgrep-BXmXjAzA.js → ripgrep-gaT9Njwi.js} +1 -1
- package/dist/chunks/{runtimeObserver-CiwnPFjK.js → runtimeObserver-CsIwinzh.js} +1 -1
- package/dist/chunks/runtimeObserver-Dbxxw4ls.js +10 -0
- package/dist/chunks/sandbox-adapter-C6GBuJPB.js +1 -0
- package/dist/chunks/sandbox-toggle-jEySONTW.js +1 -0
- package/dist/chunks/searchExtraTools-C_UTryh_.js +1 -0
- package/dist/chunks/session-DDI1Eb2x.js +2 -0
- package/dist/chunks/sessionFileAccessHooks-DfJ7Htfl.js +1 -0
- package/dist/chunks/sessionIdCompat-DMayYBrf.js +1 -0
- package/dist/chunks/sessionMemory-CQBxPkTQ.js +1 -0
- package/dist/chunks/sessionMemory-s0ALUHvc.js +1 -0
- package/dist/chunks/sessionMemoryUtils-xt7dTHGC.js +1 -0
- package/dist/chunks/sessionObserver-C2sYqWL3.js +1 -0
- package/dist/chunks/sessionObserver-DoYc0ZOP.js +20 -0
- package/dist/chunks/sessionState-CjNY991n.js +11 -0
- package/dist/chunks/sessionStorage-DqsY-7pi.js +1 -0
- package/dist/chunks/{sessionTitle-DAnM73S0.js → sessionTitle-B0OYf5nM.js} +3 -3
- package/dist/chunks/sessionTracing-CwsXt_uA.js +11 -0
- package/dist/chunks/settings-BWtOA9A7.js +1 -0
- package/dist/chunks/settings-hQDLwPVj.js +20 -0
- package/dist/chunks/settingsSync-DdFagwHV.js +1 -0
- package/dist/chunks/setup-DzC22EkN.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-C6R5zOUe.js → shadowedRuleDetection-C86PTj1m.js} +1 -1
- package/dist/chunks/{shellQuote-DkSy9MYE.js → shellQuote-BUVKMu_P.js} +1 -1
- package/dist/chunks/{sideQuestion-hUhxls9r.js → sideQuestion-C780iYwd.js} +3 -3
- package/dist/chunks/sinks-5G_xhc1Q.js +1 -0
- package/dist/chunks/{sinks-BuE17DeZ.js → sinks-Cftq7Es0.js} +2 -2
- package/dist/chunks/skillChangeDetector-plLveEbf.js +1 -0
- package/dist/chunks/skillGapStore-Dc1arohs.js +5 -0
- package/dist/chunks/skillLifecycle-DP6mY1Kp.js +8 -0
- package/dist/chunks/{skillSearchPanel-Cll9ccA5.js → skillSearchPanel-CpLTImaL.js} +4 -4
- package/dist/chunks/{skills-BPPeYBy7.js → skills-zGYaYfFV.js} +1 -1
- package/dist/chunks/{src-D06Xyj4g.js → src-BN7QRYLl.js} +1 -1
- package/dist/chunks/startupProfiler-DCn_NxMH.js +3 -0
- package/dist/chunks/startupProfiler-JbpAkfNE.js +1 -0
- package/dist/chunks/{state-ix0xIunV.js → state-C2OSZkV1.js} +1 -1
- package/dist/chunks/state-DU9lRJ9x.js +1 -0
- package/dist/chunks/{stats-CqfF4Axp.js → stats-Duk7_xjQ.js} +1 -1
- package/dist/chunks/{status-D4IQpsNK.js → status-CFw-FpZM.js} +2 -2
- package/dist/chunks/{status-CC9Q-2Yn.js → status-peiVB_2j.js} +1 -1
- package/dist/chunks/statusNoticeHelpers-B5U5c9PE.js +1 -0
- package/dist/chunks/{stringUtils-DGLPkqJ4.js → stringUtils-B6FudhoZ.js} +1 -1
- package/dist/chunks/switcher-BAMqSX7Z.js +1 -0
- package/dist/chunks/switcher-hgBgVzLb.js +1 -0
- package/dist/chunks/syncCache-Zl9kZRRl.js +1 -0
- package/dist/chunks/{tasks-CZvWJYGr.js → tasks-BxpyRhmD.js} +1 -1
- package/dist/chunks/teleport-CwxeD5vL.js +1 -0
- package/dist/chunks/{templateJobs-D1BdhZsv.js → templateJobs-DR5fKFiO.js} +1 -1
- package/dist/chunks/{terminalSetup-Cn6jeYw1.js → terminalSetup-DgRBt-JJ.js} +1 -1
- package/dist/chunks/terminalSetup-DlaFWI81.js +33 -0
- package/dist/chunks/{theme-Cg4GNOoQ.js → theme-Bz6esfST.js} +1 -1
- package/dist/chunks/{tmux-BY7IdQ1f.js → tmux-DSU9tYIo.js} +1 -1
- package/dist/chunks/{toolEventObserver-SFwURL5F.js → toolEventObserver-BSekCkM2.js} +1 -1
- package/dist/chunks/toolPool-B7SIoDw5.js +1 -0
- package/dist/chunks/{trustedDevice-CKedohmT.js → trustedDevice-B0x9X0fb.js} +1 -1
- package/dist/chunks/trustedDevice-CjHQtVkO.js +1 -0
- package/dist/chunks/{types-Dut4311z.js → types-D7_37tP2.js} +2 -2
- package/dist/chunks/{udsClient-BuCtv7dN.js → udsClient-CHoMMH28.js} +1 -1
- package/dist/chunks/{up-BHkC97_C.js → up-B8wBSpLg.js} +1 -1
- package/dist/chunks/{updateCCB-C2G-U-qA.js → updateCCB-D_kGQKPT.js} +1 -1
- package/dist/chunks/{upstreamproxy-DyR_eXO8.js → upstreamproxy-Hmq-n8fw.js} +1 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-Cce612uS.js +1 -0
- package/dist/chunks/useMainLoopModel-BICP6_Fi.js +1 -0
- package/dist/chunks/useManagePlugins-DtbY_vPL.js +1 -0
- package/dist/chunks/useMergedTools-Ckx2IEhF.js +1 -0
- package/dist/chunks/{useSearchInput-C5OzQnX6.js → useSearchInput-BAgljZUl.js} +1 -1
- package/dist/chunks/useSettingsErrors-CAJR_wpd.js +1 -0
- package/dist/chunks/userAgent-BxTG7IMk.js +1 -0
- package/dist/chunks/{util-8EHwfg4A.js → util-DDtmyq_r.js} +1 -1
- package/dist/chunks/validatePlugin-AHl-g4ct.js +1 -0
- package/dist/chunks/{vim-CNDzwoTd.js → vim-kg-mRVbu.js} +1 -1
- package/dist/chunks/{which-CKQnSouy.js → which-CHLNJmtJ.js} +1 -1
- package/dist/chunks/windowsPaths-Pmx8LDR6.js +1 -0
- package/dist/chunks/{windowsPaths-DtapVxOo.js → windowsPaths-o62uq6LF.js} +1 -1
- package/dist/chunks/{workSecret-CNWiR2uQ.js → workSecret-DG9shvG0.js} +1 -1
- package/dist/chunks/workerRegistry-C7H_lsQX.js +6 -0
- package/dist/chunks/worktree-O2p-mJdF.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AddWorkspaceDirectory-CFrrXnt9.js +0 -1
- package/dist/chunks/App-Buad9Llp.js +0 -1
- package/dist/chunks/ApproveApiKey-BQbHdvc3.js +0 -1
- package/dist/chunks/AssistantSessionChooser-4lm4eXQ8.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-D4qA0M5O.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog--ywODh81.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-Wkfw7Ts-.js +0 -1
- package/dist/chunks/DesktopHandoff-DaP4Riar.js +0 -1
- package/dist/chunks/Dialog-vfLXEPed.js +0 -1
- package/dist/chunks/Doctor-89OgoAUA.js +0 -1
- package/dist/chunks/Doctor-CuKJ-nGt.js +0 -3
- package/dist/chunks/ExitFlow-DnPydE17.js +0 -2
- package/dist/chunks/Feedback-SmGiR3mf.js +0 -2
- package/dist/chunks/Grove-CjN9DO47.js +0 -11
- package/dist/chunks/Grove-Cq88VBmM.js +0 -1
- package/dist/chunks/ListItem-vfLXEPed.js +0 -1
- package/dist/chunks/MCPConnectionManager-NRfIjdlj.js +0 -1
- package/dist/chunks/MessageSelector-iIroHvXo.js +0 -3
- package/dist/chunks/Messages-D4Hm4gaY.js +0 -11
- package/dist/chunks/Onboarding-BiZByBK-.js +0 -1
- package/dist/chunks/OverageCreditUpsell-BM7szLgm.js +0 -1
- package/dist/chunks/PluginSettings-uY5KTCtK.js +0 -17
- package/dist/chunks/QueryEngine-CGYaShXD.js +0 -1
- package/dist/chunks/REPL-CRJB2t2z.js +0 -142
- package/dist/chunks/REPL-u4Yq29Du.js +0 -1
- package/dist/chunks/RemoteCallout-B-tyvQOe.js +0 -1
- package/dist/chunks/RemoteSessionManager-DCd0O5_l.js +0 -2
- package/dist/chunks/ResumeConversation-DAAXlOCd.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-B-7Bworf.js +0 -1
- package/dist/chunks/Settings-CUjWlncb.js +0 -2
- package/dist/chunks/TeleportRepoMismatchDialog-A5Ss0kuk.js +0 -1
- package/dist/chunks/TeleportResumeWrapper-Bz14mUqR.js +0 -1
- package/dist/chunks/ThemePicker-CVSRqTzW.js +0 -1
- package/dist/chunks/TrustDialog-CY8an_Tg.js +0 -1
- package/dist/chunks/TungstenTool-Cb7gJvq4.js +0 -1
- package/dist/chunks/TungstenTool-CxMQVCuF.js +0 -1
- package/dist/chunks/agents-DJtPfvnL.js +0 -103
- package/dist/chunks/allErrors-CQE2k0zO.js +0 -1
- package/dist/chunks/analytics-BotDBGh0.js +0 -1
- package/dist/chunks/ant-ClQkuQjZ.js +0 -1
- package/dist/chunks/api-2cdIPaeq.js +0 -1
- package/dist/chunks/api-CG-lhKe-.js +0 -1
- package/dist/chunks/asciicast-BsWpcxrc.js +0 -1
- package/dist/chunks/assistant-Bje16tQx.js +0 -1
- package/dist/chunks/assistant-C83quuNj.js +0 -1
- package/dist/chunks/assistant-z2o4-UJe.js +0 -1
- package/dist/chunks/auth-DMfEiQrC.js +0 -1
- package/dist/chunks/auth-D_cGl8WD.js +0 -1
- package/dist/chunks/auth-DqcKPbw8.js +0 -15
- package/dist/chunks/backgroundHousekeeping-BpLtI45r.js +0 -1
- package/dist/chunks/backgroundHousekeeping-DtJNx4Ja.js +0 -17
- package/dist/chunks/bg-B0iMGM9C.js +0 -1
- package/dist/chunks/bridge-DNNxtPlz.js +0 -2
- package/dist/chunks/bridgeConfig-DP9dD1Cv.js +0 -1
- package/dist/chunks/bridgeEnabled-Cc0mGlTb.js +0 -1
- package/dist/chunks/bridgeEnabled-D8wP3DWQ.js +0 -1
- package/dist/chunks/bridgeMain-CwxMa_pd.js +0 -1
- package/dist/chunks/bridgeMain-D11t1BYQ.js +0 -68
- package/dist/chunks/bridgeMessaging-DdvApEqW.js +0 -1
- package/dist/chunks/bridgePointer-DqHMHa2B.js +0 -1
- package/dist/chunks/browser-BmZuQom6.js +0 -1
- package/dist/chunks/btw-CejSEdNl.js +0 -1
- package/dist/chunks/caches-5HVQSevy.js +0 -3
- package/dist/chunks/caches-B-nJoHLM.js +0 -1
- package/dist/chunks/capacityWake-CV_x9H8j.js +0 -1
- package/dist/chunks/ccrClient-BFyfO67b.js +0 -1
- package/dist/chunks/client-DKXCfdde.js +0 -1
- package/dist/chunks/client-xxikkAoZ.js +0 -1
- package/dist/chunks/commands-CxJpmEKF.js +0 -1
- package/dist/chunks/commitAttribution-DM6SBMwl.js +0 -1
- package/dist/chunks/commitAttribution-DPnHHKSA.js +0 -2
- package/dist/chunks/compact-CblM7306.js +0 -2
- package/dist/chunks/completionCache-MN3_MqK8.js +0 -4
- package/dist/chunks/completionCache-c4aiyZ_f.js +0 -1
- package/dist/chunks/config-BLVBFi5v.js +0 -1
- package/dist/chunks/config-CMnqm6Se.js +0 -1
- package/dist/chunks/config-DRDuVyzE.js +0 -3
- package/dist/chunks/context-CdSMMM-0.js +0 -1
- package/dist/chunks/context-noninteractive-CPkf2vB9.js +0 -1
- package/dist/chunks/context-noninteractive-DNury4JI.js +0 -54
- package/dist/chunks/conversation-DCMw_rsE.js +0 -1
- package/dist/chunks/conversation-pUtvc-cE.js +0 -1
- package/dist/chunks/createSession-8Ei-Lj7V.js +0 -1
- package/dist/chunks/createSession-CjqxVh_Q.js +0 -1
- package/dist/chunks/cron-3LntnnhJ.js +0 -1
- package/dist/chunks/crossProjectResume-Bj_Pe8oe.js +0 -40
- package/dist/chunks/cwd--nvsx73T.js +0 -1
- package/dist/chunks/cwd-CYmmnQVS.js +0 -1
- package/dist/chunks/debugUtils-NO5KtXqi.js +0 -1
- package/dist/chunks/desktop-Z5FAfunZ.js +0 -1
- package/dist/chunks/detectRepository-BTPgN89l.js +0 -1
- package/dist/chunks/directoryCompletion-CW2ckkQg.js +0 -1
- package/dist/chunks/doctor-BA2ZLDTl.js +0 -1
- package/dist/chunks/envLessBridgeConfig-B-LKYNvv.js +0 -1
- package/dist/chunks/envLessBridgeConfig-DyD9XCda.js +0 -1
- package/dist/chunks/esm-5w3xFBnt.js +0 -1
- package/dist/chunks/exit-Dt9kHtJO.js +0 -1
- package/dist/chunks/extra-usage-C7E2Z1p1.js +0 -1
- package/dist/chunks/extra-usage-D0Kkjp-2.js +0 -1
- package/dist/chunks/extra-usage-core-DjdaD1qO.js +0 -1
- package/dist/chunks/extra-usage-noninteractive-BnD1RhKK.js +0 -1
- package/dist/chunks/extraUsage-CpgRTcMk.js +0 -1
- package/dist/chunks/extractMemories-DhUprYa7.js +0 -1
- package/dist/chunks/fast-C4ZevUNL.js +0 -1
- package/dist/chunks/fast-CChxlAAF.js +0 -1
- package/dist/chunks/feedback-BIhBhV6n.js +0 -1
- package/dist/chunks/file-DcZWPH2V.js +0 -12
- package/dist/chunks/fileStateCache-DDW5toIs.js +0 -1
- package/dist/chunks/files-Cz1-PK3r.js +0 -2
- package/dist/chunks/firstPartyEventLogger-BXY1IJ2D.js +0 -5
- package/dist/chunks/firstPartyEventLogger-CnkGSojw.js +0 -1
- package/dist/chunks/flushGate-CgHq81Gw.js +0 -1
- package/dist/chunks/gemini-C1J-x1g7.js +0 -1
- package/dist/chunks/generateRecap-C0jjCg0Z.js +0 -1
- package/dist/chunks/generateSessionName-w0BMtwS7.js +0 -1
- package/dist/chunks/git-CbcnOf0E.js +0 -1
- package/dist/chunks/git-Do0wJvux.js +0 -6
- package/dist/chunks/githubRepoPathMapping-8D0kpsif.js +0 -1
- package/dist/chunks/grok-ffNyU3Lt.js +0 -1
- package/dist/chunks/grove-BQisE2JM.js +0 -7
- package/dist/chunks/heapdump-DiCjAPR3.js +0 -5
- package/dist/chunks/help-2hn8VK2-.js +0 -1
- package/dist/chunks/hooks-CBmrBO-J.js +0 -1
- package/dist/chunks/hostGuard-BHI6Q8Mt.js +0 -1
- package/dist/chunks/inboundAttachments-C5K3XPTC.js +0 -1
- package/dist/chunks/inboundAttachments-IH-g95jo.js +0 -1
- package/dist/chunks/index.min-D75yiGLN.js +0 -1
- package/dist/chunks/initReplBridge-C-P4dgAG.js +0 -1
- package/dist/chunks/keybindings-D8FXoO89.js +0 -2
- package/dist/chunks/language-Baosud0X.js +0 -1
- package/dist/chunks/launchAgentsPlatform-D6DmNuDt.js +0 -1
- package/dist/chunks/launchCommand-1qkTCKpf.js +0 -1
- package/dist/chunks/launchLocalMemory-C0FzUq7x.js +0 -3
- package/dist/chunks/launchLocalVault-DkYAre4O.js +0 -3
- package/dist/chunks/launchMemoryStores-D2rKWAPs.js +0 -1
- package/dist/chunks/launchSchedule-IZdFstT_.js +0 -1
- package/dist/chunks/launchSkillStore-B7LamM1d.js +0 -1
- package/dist/chunks/launchTeleport-C2BQMfYP.js +0 -3
- package/dist/chunks/launchVault-C60WUcCI.js +0 -1
- package/dist/chunks/loadAgentsDir-B9c3Emvg.js +0 -1
- package/dist/chunks/loadPluginHooks-BhNdAjeY.js +0 -1
- package/dist/chunks/localSearch-BLCGsdyM.js +0 -1
- package/dist/chunks/log-BMCygSzM.js +0 -1
- package/dist/chunks/logoV2Utils-gGK9gErT.js +0 -1
- package/dist/chunks/managedEnv-BHoeDjpS.js +0 -1
- package/dist/chunks/mcp-BSNdwbxR.js +0 -1
- package/dist/chunks/mcp-CMnDNI-4.js +0 -6
- package/dist/chunks/mcp-D1yA9E56.js +0 -2
- package/dist/chunks/memoize-B0zhbT8Z.js +0 -1
- package/dist/chunks/memory-D1zbyjxN.js +0 -1
- package/dist/chunks/model-CZViyZnE.js +0 -1
- package/dist/chunks/model-DLLkVV6S.js +0 -1
- package/dist/chunks/nativeInstaller-yj81F75v.js +0 -1
- package/dist/chunks/observationStore-DzCdXq8U.js +0 -4
- package/dist/chunks/onChangeAppState-DhGKPG9g.js +0 -1
- package/dist/chunks/output-style-BM3qAHLA.js +0 -1
- package/dist/chunks/overageCreditGrant-Du3dOYVu.js +0 -1
- package/dist/chunks/panel-Be-OxtqL.js +0 -1
- package/dist/chunks/parser-Bf6iasPV.js +0 -1
- package/dist/chunks/partition-C4FWzYVm.js +0 -1
- package/dist/chunks/passes-Daz-ARWD.js +0 -1
- package/dist/chunks/permissions-CeYKbtSC.js +0 -1
- package/dist/chunks/permissions-Cn_6f8CB.js +0 -1
- package/dist/chunks/permissions-DF8tAmDF.js +0 -3
- package/dist/chunks/plugin-Cm31-nej.js +0 -1
- package/dist/chunks/pluginBlocklist-wPFCUPdm.js +0 -1
- package/dist/chunks/pluginCliCommands-DhL9LbH0.js +0 -1
- package/dist/chunks/pluginFlagging-CAdaFV_D.js +0 -1
- package/dist/chunks/pluginOperations-Cs_Z4C6O.js +0 -2
- package/dist/chunks/pluginStartupCheck-BRXGKGjG.js +0 -1
- package/dist/chunks/pluginStartupCheck-KeU0efTj.js +0 -1
- package/dist/chunks/policyLimits-D2s8M8P2.js +0 -1
- package/dist/chunks/pollConfig-2nFzv6Hy.js +0 -1
- package/dist/chunks/poor-DXumVTR4.js +0 -1
- package/dist/chunks/poorMode-yNZL5uYf.js +0 -1
- package/dist/chunks/print-uxCF5ka5.js +0 -23
- package/dist/chunks/privacy-settings-BncbJCV0.js +0 -1
- package/dist/chunks/processBashCommand-CGdwvPmD.js +0 -1
- package/dist/chunks/processSlashCommand-DQarepEb.js +0 -5
- package/dist/chunks/prompt-BgOdcHkd.js +0 -1
- package/dist/chunks/prompt-CE3sFmZV.js +0 -139
- package/dist/chunks/prompt-CLJKFebn.js +0 -1
- package/dist/chunks/rate-limit-options-C-EqWjeI.js +0 -1
- package/dist/chunks/rcDebugLog-DBB9r8aw.js +0 -11
- package/dist/chunks/reconciler-CYD_XpG4.js +0 -4
- package/dist/chunks/referral-CKmHHxj_.js +0 -1
- package/dist/chunks/refresh-ZqZdmLK5.js +0 -1
- package/dist/chunks/registerProtocol-wZv2uiW_.js +0 -36
- package/dist/chunks/release-notes-B5K7wVqZ.js +0 -4
- package/dist/chunks/releaseNotes-B8gbyFFJ.js +0 -2
- package/dist/chunks/remote-env-CAt1dHIS.js +0 -1
- package/dist/chunks/remoteBridgeCore-Bk3UdSLJ.js +0 -1
- package/dist/chunks/remoteManagedSettings-bswzAB6W.js +0 -1
- package/dist/chunks/rename-CE_U6KE6.js +0 -1
- package/dist/chunks/ripgrep-BfIpz5uC.js +0 -1
- package/dist/chunks/runtimeObserver-BrGF5QWX.js +0 -10
- package/dist/chunks/sandbox-adapter-BtMiHImm.js +0 -1
- package/dist/chunks/sandbox-toggle-D8eebdyI.js +0 -1
- package/dist/chunks/sanitization-DV-94a9Z.js +0 -1
- package/dist/chunks/searchExtraTools-hLLPuh7c.js +0 -1
- package/dist/chunks/semver-BMRJYn3q.js +0 -1
- package/dist/chunks/session-BZIlR9Gc.js +0 -2
- package/dist/chunks/sessionDiscovery-DfDqTrF1.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-Bm8wiqwe.js +0 -1
- package/dist/chunks/sessionMemory-D37S0-jX.js +0 -1
- package/dist/chunks/sessionMemory-DmlAG3jq.js +0 -1
- package/dist/chunks/sessionMemoryUtils-6EWDHSGU.js +0 -1
- package/dist/chunks/sessionObserver-BUw2rzKl.js +0 -1
- package/dist/chunks/sessionObserver-KgquhGWw.js +0 -20
- package/dist/chunks/sessionStorage-CucBSK5Q.js +0 -1
- package/dist/chunks/sessionTracing-_Hh5VXxt.js +0 -11
- package/dist/chunks/settings-BeLFUeie.js +0 -19
- package/dist/chunks/settings-Cl16Haug.js +0 -1
- package/dist/chunks/settingsSync-BNvFYH3c.js +0 -1
- package/dist/chunks/setup-D8kXv3ts.js +0 -3
- package/dist/chunks/sinks-FevoYQqP.js +0 -1
- package/dist/chunks/skill-learning-CMdxGtxr.js +0 -5
- package/dist/chunks/skillChangeDetector-C65ZLSYV.js +0 -1
- package/dist/chunks/skillGapStore-D18LRJAM.js +0 -5
- package/dist/chunks/skillGapStore-Ep62R-2_.js +0 -1
- package/dist/chunks/skillGenerator-Bc7WwNT8.js +0 -8
- package/dist/chunks/skillLearning-Cs9fJgkV.js +0 -1
- package/dist/chunks/skillLearning-duPZl69A.js +0 -1
- package/dist/chunks/skillPanel-Cyzby746.js +0 -28
- package/dist/chunks/slashCommandParsing-RQb_7Xzt.js +0 -1
- package/dist/chunks/startupProfiler-DIWVcO4e.js +0 -1
- package/dist/chunks/startupProfiler-xa3NmN7Z.js +0 -3
- package/dist/chunks/state-BOa-3Av3.js +0 -1
- package/dist/chunks/statusNoticeHelpers-CEGvdm5d.js +0 -1
- package/dist/chunks/stickers-D5teCKMN.js +0 -1
- package/dist/chunks/syncCache-CANQZ9mQ.js +0 -1
- package/dist/chunks/systemPromptSections-CR_AoPIX.js +0 -1
- package/dist/chunks/systemPromptSections-DN0HGVye.js +0 -1
- package/dist/chunks/tag-DDbNqBMu.js +0 -11
- package/dist/chunks/teleport-Dk5j03Ix.js +0 -1
- package/dist/chunks/terminalSetup-3JNy6i_J.js +0 -33
- package/dist/chunks/thinkback-p-vKIRW_.js +0 -1
- package/dist/chunks/thinkback-play-DnPTDE8B.js +0 -1
- package/dist/chunks/thinkback-rFA1do6F.js +0 -1
- package/dist/chunks/toolEventObserver-CzsCuUMc.js +0 -1
- package/dist/chunks/toolPool-BR27AMJO.js +0 -1
- package/dist/chunks/trustedDevice-BYt39fui.js +0 -1
- package/dist/chunks/tui-C2yuCuOU.js +0 -6
- package/dist/chunks/types-Bh9S_JG5.js +0 -3
- package/dist/chunks/types-DHkZVzJe.js +0 -1
- package/dist/chunks/ultrareviewCommand-C_4OSBTW.js +0 -3
- package/dist/chunks/undercover-D30rKimg.js +0 -31
- package/dist/chunks/undercover-DRSwLozU.js +0 -1
- package/dist/chunks/upgrade-Bi-bIz7R.js +0 -1
- package/dist/chunks/upgrade-Chs-OQFd.js +0 -1
- package/dist/chunks/upload-D8FWMSQx.js +0 -1
- package/dist/chunks/usage-BxVeUt60.js +0 -1
- package/dist/chunks/usage-DUO7Yy1f.js +0 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js +0 -1
- package/dist/chunks/useMainLoopModel-Gy1Vv4Qr.js +0 -1
- package/dist/chunks/useManagePlugins-B11_87VN.js +0 -1
- package/dist/chunks/useMergedTools-CR56my9t.js +0 -1
- package/dist/chunks/useSettingsErrors-B9vOZL41.js +0 -1
- package/dist/chunks/validatePlugin-6q1qmnAC.js +0 -1
- package/dist/chunks/windowsPaths-9pEkw0oV.js +0 -1
- package/dist/chunks/workerRegistry-CvyHvwx-.js +0 -1
- package/dist/chunks/worktree-ogmNCIpz.js +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,t as a}from"./rolldown-runtime-DaDcL9Zw.js";import{n as o,t as s}from"./memoize-BK3gG5ob.js";import{a as c,d as l,f as u,l as d,o as f,s as p,u as m}from"./envUtils-DSxRz_kt.js";import{n as ee,t as h}from"./defineProperty-C-QyHrDq.js";import{n as te,t as ne}from"./axios-DaWTGg7G.js";import{B as re,D as ie,I as ae,Lt as oe,P as se,R as ce,T as g,di as _,fi as le,rr as ue,t as de,ui as v,xr as fe,y as pe}from"./src-CDCSSo0U2.js";import{t as me}from"./jsx-runtime-Bb4Xn-E0.js";import{D as he,F as ge,N as y,P as _e,f as ve,g as ye,j as be,n as xe,p as Se,r as b,t as Ce}from"./lazySchema-DULtBUCI.js";import{An as we,En as Te,F as Ee,Gn as De,Mn as Oe,Nn as ke,Or as Ae,Pn as je,Sn as Me,Un as Ne,Wn as Pe,X as Fe,Zn as Ie,ar as Le,cr as Re,dr as x,en as S,gn as C,gr as ze,ht as Be,jn as Ve,kr as He,lr as Ue,mn as We,mt as Ge,nt as Ke,or as qe,pr as Je,pt as Ye,qt as Xe,rr as w,ur as Ze,vr as Qe,xn as $e,yn as et,z as tt}from"./state-ix0xIunV.js";import{$C as nt,$E as rt,$S as it,$g as at,$v as ot,AC as st,AD as T,AE as ct,AS as lt,A_ as ut,Ac as dt,At as ft,Ay as pt,C as mt,CE as ht,C_ as gt,Co as _t,Cr as vt,DS as yt,Dt as bt,Dy as xt,ES as St,E_ as Ct,Et as wt,Ey as Tt,FT as Et,F_ as Dt,Fa as Ot,Fi as kt,Gl as At,Ha as jt,Hi as Mt,Hu as Nt,I as Pt,Ia as Ft,JC as It,Jg as Lt,Jo as Rt,Ju as zt,Kg as Bt,LT as Vt,La as Ht,Ld as Ut,Ln as E,Lp as Wt,Ly as Gt,ME as Kt,M_ as D,Mo as O,N as qt,NS as k,Nn as A,Ny as Jt,O as Yt,OE as Xt,O_ as Zt,Oc as Qt,Ol as $t,Oy as en,PE as tn,PS as nn,P_ as rn,Pa as an,Pi as on,Pl as sn,Py as cn,QS as ln,Qd as un,Qg as dn,Qi as fn,Qv as pn,Ra as mn,Rd as hn,Rn as gn,Rp as _n,Ry as vn,SE as yn,SS as bn,S_ as j,Sf as xn,T as Sn,TC as Cn,TD as wn,TS as Tn,T_ as En,Ti as Dn,Ty as On,UE as kn,Uu as An,V_ as jn,WE as Mn,Wg as Nn,Wl as Pn,XC as Fn,Xg as In,Xn as Ln,Xr as Rn,YC as zn,Yg as Bn,Yh as Vn,Yi as Hn,Yo as Un,Yx as Wn,ZS as M,Zd as Gn,Zg as Kn,_D as qn,__ as Jn,_a as Yn,_l as Xn,_s as Zn,_y as Qn,aC as $n,aE as er,a_ as tr,as as nr,at as rr,bb as ir,bs as ar,by as or,cD as sr,c_ as cr,cy as lr,dC as ur,d_ as dr,dh as fr,dm as pr,e_ as mr,f as hr,fC as gr,fh as _r,fo as vr,fx as yr,gO as br,ga as N,gh as xr,gi as Sr,hO as Cr,ha as P,hh as wr,ho as Tr,i as Er,iC as Dr,i_ as Or,iw as kr,ix as Ar,j as jr,jD as Mr,j_ as Nr,jl as Pr,jr as Fr,jy as Ir,k as Lr,kC as Rr,kS as zr,kl as Br,ky as Vr,l_ as Hr,lf as Ur,mh as Wr,nC as Gr,n_ as Kr,nd as qr,ng as Jr,nw as Yr,o as Xr,oC as Zr,oD as Qr,ot as $r,ox as ei,oy as ti,pD as ni,pm as ri,px as ii,qi as ai,qu as oi,r as si,rC as ci,rD as li,r_ as ui,rc as di,rg as fi,rx as pi,s as mi,s_ as hi,sf as gi,ss as _i,sw as vi,sx as yi,sy as bi,tC as xi,tE as Si,tS as Ci,t_ as wi,tc as Ti,td as Ei,tg as Di,ts as Oi,uD as ki,u_ as Ai,uh as ji,um as Mi,v as Ni,vD as Pi,vl as Fi,vs as Ii,vy as Li,w as Ri,wC as zi,wD as Bi,wE as Vi,wS as Hi,w_ as Ui,wi as Wi,wt as Gi,wy as Ki,xS as qi,x_ as Ji,xf as Yi,y as Xi,yC as Zi,y_ as Qi,yb as $i,yr as ea,ys as ta,z_ as na,za as ra,zy as ia}from"./loadAgentsDir-x3rlgED4.js";import{n as aa,t as oa}from"./cwd-CYmmnQVS.js";import{C as sa,E as ca,F,I as la,N as ua,S as da,V as fa,W as pa,_ as ma,a as ha,d as ga,k as _a,l as I,n as va,nt as ya,p as ba,r as xa,rt as Sa,u as Ca,w as wa,z as Ta}from"./debug-BrXObCdR.js";import{J as Ea,Lt as Da,O as Oa,S as ka,T as Aa,c as ja,et as Ma,f as Na,g as L,h as Pa,hn as Fa,i as Ia,it as La,k as Ra,n as za,pn as Ba,q as Va,s as Ha,u as Ua,vn as Wa,x as R,xn as Ga,yn as Ka}from"./settings-BeLFUeie.js";import{D as qa,E as Ja,I as Ya,P as Xa,_ as Za,b as z,c as B,g as V,j as Qa,m as $a,n as eo,o as to,r as no,s as ro,v as io,y as ao}from"./config-DRDuVyzE.js";import{a as oo,n as so,r as co}from"./process-gEbdy6uY.js";import{M as H,_ as lo,d as uo,h as fo,i as po,j as mo,p as ho,r as go}from"./git-Do0wJvux.js";import{c as _o,o as vo}from"./execFileNoThrow-D244NytW.js";import{d as yo,f as bo,o as xo,s as U}from"./log-BMCygSzM.js";import{n as So,t as Co}from"./which-CKQnSouy.js";import{i as wo,o as To}from"./platform-BrYefG_2.js";import{i as Eo,o as Do}from"./windowsPaths-DtapVxOo.js";import{s as Oo,u as ko}from"./types-Dut4311z.js";import{n as W,r as G}from"./analytics-BotDBGh0.js";import{a as Ao,b as jo,d as Mo,i as K,n as No}from"./startupProfiler-xa3NmN7Z.js";import{l as Po,s as Fo,u as Io}from"./oauth-BqJqV-2M.js";import{n as Lo,t as Ro}from"./bundledMode--fG1S62b.js";import{l as zo,o as Bo}from"./stringUtils-DGLPkqJ4.js";import{r as Vo}from"./permissions-Cn_6f8CB.js";import{$t as Ho,Bt as Uo,C as Wo,Dn as Go,Ft as Ko,Jn as qo,Kn as Jo,Ot as Yo,Rr as Xo,S as Zo,Si as Qo,Tr as $o,Vn as es,Vr as ts,Xt as ns,Yn as rs,Z as is,_ as as,an as os,ar as ss,b as cs,bn as ls,cr as us,en as ds,et as fs,g as ps,ii as ms,in as hs,ir as gs,jn as _s,lt as vs,o as ys,oi as bs,or as xs,pn as Ss,rr as Cs,rt as ws,sr as Ts,ut as Es,v as Ds,wi as Os,wr as ks,xn as As,xt as js,yn as Ms,zt as Ns}from"./model-CZViyZnE.js";import{Bt as Ps,Et as Fs,Pt as Is,Rt as Ls,Tt as Rs,Ut as zs,Vt as Bs,dt as Vs,ft as Hs,ut as Us,zt as Ws}from"./prompt-CE3sFmZV.js";import{f as Gs,h as Ks,l as qs,n as Js}from"./proxy-CRN7jYIi.js";import{dt as Ys,ft as Xs}from"./esm-5w3xFBnt.js";import{n as Zs,t as Qs}from"./partition-C4FWzYVm.js";import{a as $s,n as ec}from"./ripgrep-BXmXjAzA.js";import{C as tc,D as nc,O as rc,y as ic}from"./rcDebugLog-DBB9r8aw.js";import{D as ac,O as oc,_ as sc,v as cc}from"./sessionTracing-_Hh5VXxt.js";import{l as lc,r as uc}from"./commitAttribution-DPnHHKSA.js";import{i as dc,n as fc,o as pc,r as mc}from"./detectRepository-BPr0VWNO.js";import{l as hc,o as gc,r as _c}from"./api-2cdIPaeq.js";import{d as vc,f as yc,l as bc,p as xc,u as Sc}from"./firstPartyEventLogger-BXY1IJ2D.js";import{c as Cc,s as wc}from"./referral-CKmHHxj_.js";import{n as Tc,t as Ec}from"./worktreeModeEnabled-BFOYTTTr.js";import{i as Dc,t as Oc}from"./assistant-C83quuNj.js";import{c as kc,l as Ac}from"./releaseNotes-B8gbyFFJ.js";import{a as jc,o as Mc}from"./grove-BQisE2JM.js";import{a as Nc,i as Pc,n as Fc,o as Ic,r as Lc}from"./remoteManagedSettings-bswzAB6W.js";import{n as Rc,t as zc}from"./allErrors-CQE2k0zO.js";import{n as Bc,t as q}from"./exit-BOhGfSlm.js";import{n as Vc,s as Hc,t as Uc}from"./pluginOperations-Cs_Z4C6O.js";import"./pluginCliCommands-DhL9LbH0.js";import{n as Wc,r as Gc,t as Kc}from"./managedEnv-Aq5BXfY7.js";import{n as qc}from"./onChangeAppState-DhGKPG9g.js";import{n as Jc}from"./asciicast-CbAjUHT_.js";import{i as Yc,t as Xc}from"./skillChangeDetector-C65ZLSYV.js";import{n as Zc}from"./stats-CqfF4Axp.js";import{t as Qc}from"./renderOptions-BUJB9nAm.js";import{i as $c,n as el,t as tl}from"./githubRepoPathMapping-8D0kpsif.js";import{i as nl,n as rl}from"./earlyInput-BTC_Wucv.js";import{t as il}from"./banner-CWkrK10u.js";import{c as al,n as ol,r as sl,u as cl}from"./RemoteSessionManager-DCd0O5_l.js";import{posix as ll,relative as ul,resolve as dl,win32 as fl}from"path";import{appendFileSync as pl,readFileSync as ml}from"fs";import{open as hl,stat as gl}from"fs/promises";var _l=a((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),vl=a((e=>{var{InvalidArgumentError:t}=_l(),n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),yl=a((e=>{var{humanReadableArgName:t}=vl(),n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,t as a}from"./rolldown-runtime-DaDcL9Zw.js";import{n as o,t as s}from"./memoize-BK3gG5ob.js";import{a as c,d as l,f as u,l as d,o as f,s as p,u as m}from"./envUtils-DSxRz_kt.js";import{n as ee,t as h}from"./defineProperty-C-QyHrDq.js";import{n as g,t as te}from"./axios-DaWTGg7G.js";import{B as ne,D as re,I as ie,Lt as _,P as v,R as y,T as ae,di as oe,fi as se,rr as ce,t as le,ui as b,xr as ue,y as de}from"./src-CDCSSo0U2.js";import{t as fe}from"./jsx-runtime-Bb4Xn-E0.js";import{A as x,M as pe,O as me,j as he,l as ge,p as _e,u as ve,w as S}from"./external-CEp-aPkt.js";import{n as ye,r as be,t as xe}from"./lazySchema-B4D4qJVE.js";import{$t as Se,An as Ce,Dr as C,Er as we,F as Te,Hn as Ee,Mn as De,Tn as Oe,Un as ke,Vn as Ae,Y as je,Yn as Me,bn as Ne,cr as Pe,dr as Fe,ft as Ie,gr as Le,hn as Re,ir as ze,jn as w,kn as Be,lr as Ve,mt as He,or as Ue,pn as We,pt as Ge,rr as Ke,sr as qe,tr as Je,tt as Ye,vn as Xe,xn as Ze,z as Qe}from"./state-C2OSZkV1.js";import{$f as $e,$m as et,AC as T,AE as tt,AS as nt,Af as rt,Am as it,At as at,BC as ot,Bf as st,Bi as ct,Bo as lt,Bx as ut,C as dt,Co as ft,Cr as pt,DC as mt,Db as ht,Dl as gt,Do as _t,Dt as vt,Dx as yt,ED as bt,Et as xt,FD as St,Fi as Ct,Fu as wt,Fy as Tt,Ga as Et,Gw as Dt,HC as Ot,HE as kt,Hp as At,Hw as E,Hx as jt,I as Mt,IC as Nt,IE as Pt,Iu as Ft,Iy as D,JT as It,Jc as O,Jf as Lt,Jm as k,Jp as A,Jw as Rt,Ki as zt,Km as j,Kw as Bt,Kx as Vt,Ky as Ht,LE as Ut,La as Wt,Lc as Gt,Ln as Kt,Lu as qt,MC as Jt,Mc as Yt,Mv as Xt,Mx as Zt,N as Qt,NC as $t,Nn as en,Nx as tn,O as nn,OD as rn,OS as an,Ol as on,Ox as sn,PC as cn,PD as ln,Pa as un,Pc as dn,Pd as fn,Pi as pn,Py as mn,QS as hn,Qf as gn,Qm as _n,RC as vn,Rn as yn,Ro as M,Rp as bn,SE as xn,SS as Sn,Sd as Cn,Ss as wn,Su as Tn,T as En,TC as Dn,TE as On,Ti as kn,Ty as An,UC as jn,UE as Mn,Uf as Nn,Uw as Pn,Vf as Fn,Vo as In,Vp as Ln,Wi as Rn,Wx as zn,Xf as Bn,Xm as Vn,Xn as Hn,Xr as Un,Xw as Wn,YC as Gn,YT as Kn,Yf as qn,Yi as Jn,Ys as Yn,Zf as Xn,Zm as Zn,Zs as Qn,Zw as $n,Zy as er,_C as tr,_c as nr,_g as rr,_o as ir,_v as ar,aC as or,ah as sr,at as cr,au as lr,bE as ur,bc as dr,bd as fr,bl as pr,bu as mr,cC as hr,ch as gr,dC as _r,dE as vr,dd as yr,eC as br,eh as xr,eo as Sr,ep as Cr,f as wr,fC as Tr,fd as Er,gC as Dr,gg as Or,gi as kr,go as Ar,gv as jr,hC as Mr,hE as Nr,hc as Pr,hg as Fr,hl as Ir,i as Lr,iC as Rr,ih as zr,j as Br,jC as Vr,jc as Hr,jd as Ur,jr as Wr,jv as Gr,jx as Kr,kC as qr,kD as Jr,kE as Yr,kS as Xr,kf as Zr,ko as Qr,kx as $r,lC as ei,lh as ti,mc as ni,ml as ri,nC as ii,na as N,np as ai,o as oi,oC as si,oh as ci,op as li,ot as ui,ou as di,pC as fi,pc as pi,qC as mi,qc as hi,qf as gi,qm as _i,qp as vi,qw as yi,qy as bi,r as xi,rC as Si,ra as P,rh as Ci,rp as wi,s as Ti,sC as Ei,sh as Di,sp as Oi,tE as ki,tb as Ai,th as ji,uC as Mi,v as Ni,vC as Pi,vE as Fi,vg as Ii,w as Li,wD as Ri,wb as zi,wi as Bi,wm as Vi,ws as Hi,wt as Ui,wy as Wi,y as Gi,yC as Ki,yd as qi,yg as Ji,yl as Yi,yr as Xi,zC as Zi,zo as Qi,zp as $i}from"./loadAgentsDir-ByO8eJqU.js";import{n as ea,t as ta}from"./cwd-C5ce-7WB.js";import{C as na,E as ra,F,I as ia,N as aa,S as oa,V as sa,W as ca,_ as la,a as ua,d as da,k as fa,l as I,n as pa,nt as ma,p as ha,r as ga,rt as _a,u as va,w as ya,z as ba}from"./debug-RZ4NuXyS.js";import{In as xa,J as Sa,Ln as Ca,O as wa,Q as Ta,S as Ea,T as Da,c as Oa,cn as ka,f as Aa,g as L,h as ja,i as Ma,jt as Na,k as Pa,n as Fa,s as Ia,u as La,un as Ra,x as R,zn as za,zt as Ba}from"./settings-hQDLwPVj.js";import{D as Va,E as Ha,I as Ua,P as Wa,_ as Ga,b as z,c as B,g as V,j as Ka,m as qa,n as Ja,o as Ya,r as Xa,s as Za,v as Qa,y as $a}from"./config-CE058cvr.js";import{a as eo,n as to,r as no}from"./process-gEbdy6uY.js";import{O as ro,f as io,i as ao,k as H,l as oo,m as so,r as co,u as lo}from"./git-BerW9bId.js";import{c as uo,o as fo}from"./execFileNoThrow-CCX-JY8h.js";import{d as po,f as mo,o as ho,s as U}from"./log-CZ0zYP_c.js";import{n as go,t as _o}from"./which-CHLNJmtJ.js";import{i as vo,o as yo}from"./platform-DCXXznJg.js";import{i as bo,o as xo}from"./windowsPaths-o62uq6LF.js";import{s as So,u as Co}from"./types-D7_37tP2.js";import{n as W,r as G}from"./analytics-CkYUHW_U.js";import{a as wo,d as To,i as K,n as Eo,y as Do}from"./startupProfiler-DCn_NxMH.js";import{l as Oo,s as ko,u as Ao}from"./oauth-BqJqV-2M.js";import{n as jo,t as Mo}from"./bundledMode--fG1S62b.js";import{l as No,o as Po}from"./stringUtils-B6FudhoZ.js";import{$t as Fo,Bt as Io,C as Lo,Dn as Ro,Fr as zo,Ft as Bo,Jn as Vo,Kn as Ho,Ot as Uo,Rr as Wo,S as Go,Sr as Ko,Vn as qo,Xt as Jo,Yn as Yo,Z as Xo,_ as Zo,an as Qo,ar as $o,b as es,bi as ts,bn as ns,en as rs,et as is,g as as,in as os,ir as ss,jn as cs,lt as ls,nr as us,o as ds,pn as fs,ri as ps,rr as ms,rt as hs,ti as gs,ut as _s,v as vs,vi as ys,xn as bs,xr as xs,xt as Ss,yn as Cs,zt as ws}from"./model-CwO-g1RW.js";import{Et as Ts,Mt as Es,Nt as Ds,Tt as Os,bt as ks,ct as As,jt as js,kt as Ms,ot as Ns,st as Ps,wt as Fs}from"./prompt-B7joRiqj.js";import{f as Is,h as Ls,l as Rs,n as zs}from"./proxy-BmtEnJ02.js";import{n as Bs,t as Vs}from"./userAgent-BxTG7IMk.js";import{C as Hs,D as Us,F as Ws,I as Gs}from"./sessionState-CjNY991n.js";import{dt as Ks,ft as qs}from"./esm-BLPbfHQd.js";import{n as Js,t as Ys}from"./partition-DKuAFJkc.js";import{a as Xs,n as Zs}from"./ripgrep-gaT9Njwi.js";import{C as Qs,D as $s,O as ec,S as tc}from"./sessionTracing-CwsXt_uA.js";import{i as nc,n as rc,o as ic,r as ac}from"./detectRepository-CFiHe6Rv.js";import{c as oc,o as sc,r as cc}from"./api-CF5IVtj0.js";import{d as lc,f as uc,l as dc,p as fc,u as pc}from"./firstPartyEventLogger-D5ohKbIe.js";import{n as mc,t as hc}from"./worktreeModeEnabled-BFOYTTTr.js";import{c as gc}from"./switcher-BAMqSX7Z.js";import{a as _c}from"./grove-Cv19v6Sv.js";import{a as vc,i as yc,n as bc,o as xc,r as Sc}from"./remoteManagedSettings-B1mnRDmA.js";import{n as Cc,t as wc}from"./allErrors-BPn_2TrB.js";import{n as Tc,t as q}from"./exit-BOhGfSlm.js";import{n as Ec,s as Dc,t as Oc}from"./pluginOperations-C7p_Qr2r.js";import"./pluginCliCommands-BJM5Bdpf.js";import{n as kc,r as Ac,t as jc}from"./managedEnv-C-9XSN14.js";import{n as Mc}from"./onChangeAppState-BmfM5g-D.js";import{n as Nc}from"./asciicast-BJNYO5sh.js";import{i as Pc,t as Fc}from"./skillChangeDetector-plLveEbf.js";import{n as Ic}from"./stats-Duk7_xjQ.js";import{t as Lc}from"./renderOptions-ChLwxtVu.js";import{i as Rc,n as zc,t as Bc}from"./githubRepoPathMapping-DGr0kJ8D.js";import{i as Vc,n as Hc}from"./earlyInput-BTC_Wucv.js";import{t as Uc}from"./banner-Ca7rki2V.js";import{c as Wc,n as Gc,o as Kc,r as qc}from"./RemoteSessionManager-CT7T8BaR.js";import{posix as Jc,relative as Yc,resolve as Xc,win32 as Zc}from"path";import{appendFileSync as Qc,readFileSync as $c}from"fs";import{open as el,stat as tl}from"fs/promises";var nl=a((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),rl=a((e=>{var{InvalidArgumentError:t}=nl(),n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),il=a((e=>{var{humanReadableArgName:t}=rl(),n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
2
2
|
`)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
|
|
3
3
|
`+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
|
|
4
|
-
`)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),
|
|
4
|
+
`)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),al=a((e=>{var{InvalidArgumentError:t}=nl(),n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
|
|
5
5
|
- a short flag is a single dash and a single character
|
|
6
6
|
- either use a single dash and a single character (for a short flag)
|
|
7
7
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(t)?Error(`${n}
|
|
8
8
|
- too many short flags`):i.test(t)?Error(`${n}
|
|
9
9
|
- too many long flags`):Error(`${n}
|
|
10
|
-
- unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),
|
|
10
|
+
- unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),ol=a((e=>{function t(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a=1;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function n(e,n){if(!n||n.length===0)return``;n=Array.from(new Set(n));let r=e.startsWith(`--`);r&&(e=e.slice(2),n=n.map(e=>e.slice(2)));let i=[],a=3;return n.forEach(n=>{if(n.length<=1)return;let r=t(e,n),o=Math.max(e.length,n.length);(o-r)/o>.4&&(r<a?(a=r,i=[n]):r===a&&i.push(n))}),i.sort((e,t)=>e.localeCompare(t)),r&&(i=i.map(e=>`--${e}`)),i.length>1?`\n(Did you mean one of ${i.join(`, `)}?)`:i.length===1?`\n(Did you mean ${i[0]}?)`:``}e.suggestSimilar=n})),sl=a((e=>{var n=t(`node:events`).EventEmitter,r=t(`node:child_process`),i=t(`node:path`),a=t(`node:fs`),o=t(`node:process`),{Argument:s,humanReadableArgName:c}=rl(),{CommanderError:l}=nl(),{Help:u,stripColor:d}=il(),{Option:f,DualOptions:p}=al(),{suggestSimilar:m}=ol(),ee=class e extends n{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>o.stdout.write(e),writeErr:e=>o.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>o.stdout.isTTY?o.stdout.columns:void 0,getErrHelpWidth:()=>o.stderr.isTTY?o.stderr.columns:void 0,getOutHasColors:()=>g()??(o.stdout.isTTY&&o.stdout.hasColors?.()),getErrHasColors:()=>g()??(o.stderr.isTTY&&o.stderr.hasColors?.()),stripColor:e=>d(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i=i||{};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new u,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
|
|
11
11
|
- specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new s(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,n,r]=(e??`help [command]`).match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
|
|
12
12
|
Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new l(e,t,n)),o.exit(e)}action(e){let t=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)};return this._actionHandler=t,this}createOption(e,t){return new f(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
13
13
|
- already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(n,e.defaultValue===void 0||e.defaultValue,`default`)}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._collectValue(t,a)),t??(t=e.negate?!1:e.isBoolean()||e.optional?!0:``),this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{let n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{let n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof f)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error(`call .storeOptionsAsProperties() before adding options`);if(Object.keys(this._optionValues).length)throw Error(`call .storeOptionsAsProperties() before setting option values`);return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t=t||{},e===void 0&&t.from===void 0){o.versions?.electron&&(t.from=`electron`);let e=o.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=o.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:o.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
@@ -16,13 +16,13 @@ Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._life
|
|
|
16
16
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
17
17
|
- ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let n=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function c(e,t){let n=i.resolve(e,t);if(a.existsSync(n))return n;if(s.includes(i.extname(t)))return;let r=s.find(e=>a.existsSync(`${n}${e}`));if(r)return`${n}${r}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=a.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=i.resolve(i.dirname(e),d)}if(d){let t=c(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=i.basename(this._scriptPath,i.extname(this._scriptPath));n!==this._name&&(t=c(d,`${n}-${e._name}`))}u=t||u}n=s.includes(i.extname(u));let f;o.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=h(o.execArgv).concat(t),f=r.spawn(o.execPath,t,{stdio:`inherit`})):n?(t.unshift(u),t=h(o.execArgv).concat(t),f=r.spawn(o.argv[0],t,{stdio:`inherit`})):f=r.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{o.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e=e??1,p?p(new l(e,`commander.executeSubCommandAsync`,`(close)`)):o.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(u,d,e._name);else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)o.exit(1);else{let e=new l(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)!==void 0&&this.getOptionValueSource(t)!=="default"});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l))){this.emit(`option:${o.name()}`,l);continue}if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}else if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
18
18
|
`),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in o.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,o.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new p(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=m(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=m(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||`-V, --version`,n=n||`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>c(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=i.basename(e,i.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e=e||{};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(o.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
|
|
19
|
-
Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function h(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function te(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=ee,e.useColor=te})),Cl=a((e=>{var{Argument:t}=vl(),{Command:n}=Sl(),{CommanderError:r,InvalidArgumentError:i}=_l(),{Help:a}=yl(),{Option:o}=bl();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i})),wl=a(((e,t)=>{var n=Cl();e=t.exports={},e.program=new n.Command,e.Argument=n.Argument,e.Command=n.Command,e.CommanderError=n.CommanderError,e.Help=n.Help,e.InvalidArgumentError=n.InvalidArgumentError,e.InvalidOptionArgumentError=n.InvalidArgumentError,e.Option=n.Option,e.createCommand=e=>new n.Command(e),e.createOption=(e,t)=>new n.Option(e,t),e.createArgument=(e,t)=>new n.Argument(e,t)}));s(),f(),ee(),Ae(),S(),ya(),Ta(),da(),ba(),so(),ha(),W(),No(),Oa(),ls();var{program:Tl,createCommand:El,createArgument:Dl,createOption:Ol,CommanderError:kl,InvalidArgumentError:Al,InvalidOptionArgumentError:jl,Command:Ml,Argument:Nl,Option:J,Help:Pl}=r(wl(),1).default;ne();var Fl=r(le(),1);_();var Y=me();de(),b(),aa(),mo(),_o(),xo(),Co(),lo(),To(),Eo(),Ka(),Oo(),jo(),Ba(),Ce(),Ro(),La(),Bo(),Aa(),L(),Xa(),Cr(),Os(),Ja(),V(),Ks(),qs(),bs(),Xo(),ks(),Ts(),xs(),Cs(),qo(),Jo(),_s(),Uo(),as(),T(),Bi(),$s(),sr(),zs(),Ls(),Vs(),Kt(),Vi(),st(),Cn(),Zi(),yc(),it(),rc(),pn(),jn(),D(),Qi(),wi(),Nn(),Jr(),_r(),Mi(),Ec(),An(),Br(),ta(),Ii(),nr(),O(),an(),P(),fn(),kt(),Fr(),E(),rr(),Io(),yo();var Il=!1;function Ll(){if(Il||(Il=!0,bo())||d(process.env.CLAUDE_CODE_USE_BEDROCK)||d(process.env.CLAUDE_CODE_USE_VERTEX)||d(process.env.CLAUDE_CODE_USE_FOUNDRY)||process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||process.env.ANTHROPIC_UNIX_SOCKET||process.env.CLAUDE_CODE_CLIENT_CERT||process.env.CLAUDE_CODE_CLIENT_KEY)return;let e=process.env.ANTHROPIC_BASE_URL||Po().BASE_API_URL;fetch(e,{method:`HEAD`,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}function Rl(){if(process.env.NODE_EXTRA_CA_CERTS)return;let e=zl();e&&(process.env.NODE_EXTRA_CA_CERTS=e,I(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${e}`))}function zl(){try{let e=B()?.env,t=ja(`userSettings`)?.env;I(`CA certs: Config fallback - globalEnv keys: ${e?Object.keys(e).join(`,`):`none`}, settingsEnv keys: ${t?Object.keys(t).join(`,`):`none`}`);let n=t?.NODE_EXTRA_CA_CERTS||e?.NODE_EXTRA_CA_CERTS;return n&&I(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${n}`),n}catch(e){I(`CA certs: Config fallback failed: ${e}`,{level:`error`});return}}V(),ha(),dc(),Xs(),f(),Gc(),sc(),oc(),Sc();var Bl=!1,Vl=o(async()=>{let e=Date.now();H(`info`,`init_started`),K(`init_function_start`);try{let t=Date.now();no(),re({loadTheme:()=>B().theme,saveTheme:e=>z(t=>({...t,theme:e}))}),H(`info`,`init_configs_enabled`,{duration_ms:Date.now()-t}),K(`init_configs_enabled`);let n=Date.now();Wc(),Rl(),H(`info`,`init_safe_env_vars_applied`,{duration_ms:Date.now()-n}),K(`init_safe_env_vars_applied`),xi(),K(`init_after_graceful_shutdown`),import(`./firstPartyEventLogger-CnkGSojw.js`).then(e=>{e.initialize1PEventLogging()}),K(`init_after_1p_event_logging`),import(`./poller-CpLBoB-N.js`).then(e=>e.startBalancePolling()),K(`init_after_balance_polling`),ts(),K(`init_after_oauth_populate`),Ys(),K(`init_after_jetbrains_detection`),fc(),Lc()&&Fc(),Ht()&&Ot(),K(`init_after_remote_settings_check`),io();let r=Date.now();I(`[init] configureGlobalMTLS starting`),Gs(),H(`info`,`init_mtls_configured`,{duration_ms:Date.now()-r}),I(`[init] configureGlobalMTLS complete`);let i=Date.now();if(I(`[init] configureGlobalAgents starting`),Js(),H(`info`,`init_proxy_configured`,{duration_ms:Date.now()-i}),I(`[init] configureGlobalAgents complete`),K(`init_network_configured`),await bc(),Ll(),d(process.env.CLAUDE_CODE_REMOTE))try{let{initUpstreamProxy:e,getUpstreamProxyEnv:t}=await import(`./upstreamproxy-DyR_eXO8.js`),{registerUpstreamProxyEnvFn:n}=await import(`./subprocessEnv-BSQSomcK.js`);n(t),await e()}catch(e){I(`[init] upstreamproxy init failed: ${e instanceof Error?e.message:String(e)}; continuing without proxy`,{level:`warn`})}if(Do(),Sa(ri),gn()){let e=Date.now();await A(),H(`info`,`init_scratchpad_created`,{duration_ms:Date.now()-e})}try{let{getRipgrepStatus:e}=await import(`./ripgrep-BfIpz5uC.js`),t=e();t.note&&process.stderr.write(`[ripgrep] ${t.note}\n`)}catch{I(`[init] ripgrep status check skipped`)}H(`info`,`init_completed`,{duration_ms:Date.now()-e}),K(`init_function_end`)}catch(e){if(e instanceof _a){if(tt()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}\n`),ln(1);return}return import(`./InvalidConfigDialog-DdO0AxyF.js`).then(t=>t.showInvalidConfigDialog({error:e}))}else throw e}});function Hl(){Lc()?(tt()&&cc()&&Ul().catch(e=>{I(`[3P telemetry] Eager telemetry init failed (beta tracing): ${F(e)}`,{level:`error`})}),I(`[3P telemetry] Waiting for remote managed settings before telemetry init`),Ic().then(async()=>{I(`[3P telemetry] Remote managed settings loaded, initializing telemetry`),Kc(),await Ul()}).catch(e=>{I(`[3P telemetry] Telemetry init failed (remote settings path): ${F(e)}`,{level:`error`})})):Ul().catch(e=>{I(`[3P telemetry] Telemetry init failed: ${F(e)}`,{level:`error`})})}async function Ul(){if(!Bl){if(!d(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)){Bl=!0,I(`[3P telemetry] Skipped — CLAUDE_CODE_ENABLE_TELEMETRY not set`);return}Bl=!0;try{await Wl()}catch(e){throw Bl=!1,e}}}async function Wl(){let{initializeTelemetry:e}=await import(`./instrumentation-Yt31gxWN.js`),t=await e();t&&(De(t,(e,n)=>{let r=t?.createCounter(e,n);return{add(e,t={}){let n={...ac(),...t};r?.add(e,n)}}}),Ge()?.add(1))}Ci();async function Gl(e,t,n,r){let{App:i}=await import(`./App-Buad9Llp.js`),{REPL:a}=await import(`./REPL-u4Yq29Du.js`);await r(e,(0,Y.jsx)(i,{...t,children:(0,Y.jsx)(a,{...n})}))}Yn(),Io(),V(),ha(),yo();var Kl=xe(()=>he({client_data:be(y(),ge()).nullish(),additional_model_options:ye(he({model:y(),name:y(),description:y()}).transform(({model:e,name:t,description:n})=>({value:e,label:t,description:n}))).nullish()}));async function ql(){if(bo())return I(`[Bootstrap] Skipped: Nonessential traffic disabled`),null;if(Qo()!==`firstParty`)return I(`[Bootstrap] Skipped: 3P provider`),null;let e=js();if(!(Yo()?.accessToken&&Ns())&&!e)return I(`[Bootstrap] Skipped: no usable OAuth or API key`),null;let t=`${Po().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await gs(async()=>{let n=Yo()?.accessToken,r;if(n&&Ns())r={Authorization:`Bearer ${n}`,"anthropic-beta":Fo};else if(e)r={"x-api-key":e};else return I(`[Bootstrap] No auth available on retry, aborting`),null;I(`[Bootstrap] Fetching`);let i=await te.get(t,{headers:{"Content-Type":`application/json`,"User-Agent":ss(),...r},timeout:5e3}),a=Kl().safeParse(i.data);return a.success?(I(`[Bootstrap] Fetch ok`),a.data):(I(`[Bootstrap] Response failed validation: ${a.error.message}`),null)})}catch(e){throw I(`[Bootstrap] Fetch failed: ${te.isAxiosError(e)?e.response?.status??e.code:`unknown`}`),e}}async function Jl(){try{let e=await ql();if(!e)return;let t=e.client_data??null,n=e.additional_model_options??[],r=B();if(us(r.clientDataCache,t)&&us(r.additionalModelOptionsCache,n)){I(`[Bootstrap] Cache unchanged, skipping write`);return}I(`[Bootstrap] Cache updated, persisting to disk`),z(e=>({...e,clientDataCache:t,additionalModelOptionsCache:n}))}catch(e){U(e)}}fs(),qn(),gc(),pt(),wc(),ha(),f();var Yl=new Map;function Xl(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;wo()===`windows`&&(e=e.split(fl.sep).join(ll.sep),t=t.split(fl.sep).join(ll.sep));let n=[e,t],r=[`/build-ant/`,`/build-external/`,`/build-external-native/`,`/build-ant-native/`];return n.some(e=>r.some(t=>e.includes(t)))}var Zl=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function Ql(e){let t=`${e.name}: ${e.message}`;return Zl.some(e=>e.test(t))}var $l=null;function eu(){let e=process.listeners(`warning`);$l&&e.includes($l)||(Xl()||process.removeAllListeners(`warning`),$l=e=>{try{let t=`${e.name}: ${e.message.slice(0,50)}`,n=Yl.get(t)||0;(Yl.has(t)||Yl.size<1e3)&&Yl.set(t,n+1);let r=Ql(e);G(`tengu_node_warning`,{is_internal:+!!r,occurrence_count:n+1,classname:e.name,...process.env.USER_TYPE===`ant`&&{message:e.message}}),d(process.env.CLAUDE_DEBUG)&&I(`${r?`[Internal Warning]`:`[Warning]`} ${e.toString()}`,{level:`warn`})}catch{}},process.on(`warning`,$l))}lt(),qi(),yi(),pi(),ir(),jc(),de();function tu(){return(0,Y.jsxs)(se,{children:[`MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the`,` `,(0,Y.jsx)(oe,{url:`https://code.claude.com/docs/en/mcp`,children:`MCP documentation`}),`.`]})}W(),L(),de();function nu({serverName:e,onDone:t}){function n(n){switch(G(`tengu_mcp_dialog_choice`,{choice:n}),n){case`yes`:case`yes_all`:{let r=(Na()||{}).enabledMcpjsonServers||[];r.includes(e)||R(`localSettings`,{enabledMcpjsonServers:[...r,e]}),n===`yes_all`&&R(`localSettings`,{enableAllProjectMcpServers:!0}),t();break}case`no`:{let n=(Na()||{}).disabledMcpjsonServers||[];n.includes(e)||R(`localSettings`,{disabledMcpjsonServers:[...n,e]}),t();break}}}return(0,Y.jsxs)(pe,{title:`New MCP server found in .mcp.json: ${e}`,color:`warning`,onCancel:()=>n(`no`),children:[(0,Y.jsx)(tu,{}),(0,Y.jsx)(Ar,{options:[{label:`Use this and all future MCP servers in this project`,value:`yes_all`},{label:`Use this MCP server`,value:`yes`},{label:`Continue without using this MCP server`,value:`no`}],onChange:e=>n(e),onCancel:()=>n(`no`)})]})}Qs(),W(),de(),L(),ii();function ru({serverNames:e,onDone:t}){function n(n){let r=Na()||{},i=r.enabledMcpjsonServers||[],a=r.disabledMcpjsonServers||[],[o,s]=Zs(e,e=>n.includes(e));G(`tengu_mcp_multidialog_choice`,{approved:o.length,rejected:s.length}),o.length>0&&R(`localSettings`,{enabledMcpjsonServers:[...new Set([...i,...o])]}),s.length>0&&R(`localSettings`,{disabledMcpjsonServers:[...new Set([...a,...s])]}),t()}let r=(0,Fl.useCallback)(()=>{let n=(Na()||{}).disabledMcpjsonServers||[];R(`localSettings`,{disabledMcpjsonServers:[...new Set([...n,...e])]}),t()},[e,t]);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(pe,{title:`${e.length} new MCP servers found in .mcp.json`,subtitle:`Select any you wish to enable.`,color:`warning`,onCancel:r,hideInputGuide:!0,children:[(0,Y.jsx)(tu,{}),(0,Y.jsx)(ei,{options:e.map(e=>({label:e,value:e})),defaultValue:e,onSubmit:n,onCancel:r,hideIndexes:!0})]}),(0,Y.jsx)(ae,{paddingX:1,children:(0,Y.jsx)(se,{dimColor:!0,italic:!0,children:(0,Y.jsxs)(g,{children:[(0,Y.jsx)(ie,{shortcut:`Space`,action:`select`}),(0,Y.jsx)(ie,{shortcut:`Enter`,action:`confirm`}),(0,Y.jsx)(yr,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`reject all`})]})})})]})}nn();async function iu(e){let{servers:t}=ut(`project`),n=Object.keys(t).filter(e=>Jn(e)===`pending`);n.length!==0&&await new Promise(t=>{let r=()=>void t();if(n.length===1&&n[0]!==void 0){let t=n[0];e.render((0,Y.jsx)(k,{children:(0,Y.jsx)($i,{children:(0,Y.jsx)(nu,{serverName:t,onDone:r})})}))}else e.render((0,Y.jsx)(k,{children:(0,Y.jsx)($i,{children:(0,Y.jsx)(ru,{serverNames:n,onDone:r})})}))})}Da(),Mn(),Vt(),kr(),lc(),nt(),Fn(),mt(),V(),ha();var au={iterm:`iTerm`,"iterm.app":`iTerm`,ghostty:`Ghostty`,kitty:`kitty`,alacritty:`Alacritty`,wezterm:`WezTerm`,apple_terminal:`Terminal`};function ou(){if(process.platform!==`darwin`)return;let e=process.env.TERM_PROGRAM;if(!e)return;let t=au[e.toLowerCase()];t&&B().deepLinkTerminal!==t&&(z(e=>({...e,deepLinkTerminal:t})),I(`Stored deep link terminal preference: ${t}`))}var su=class{constructor(){h(this,`frameDurations`,[]),h(this,`firstRenderTime`,void 0),h(this,`lastRenderTime`,void 0)}record(e){let t=performance.now();this.firstRenderTime===void 0&&(this.firstRenderTime=t),this.lastRenderTime=t,this.frameDurations.push(e)}getMetrics(){if(this.frameDurations.length===0||this.firstRenderTime===void 0||this.lastRenderTime===void 0)return;let e=this.lastRenderTime-this.firstRenderTime;if(e<=0)return;let t=this.frameDurations.length/(e/1e3),n=this.frameDurations.slice().sort((e,t)=>t-e),r=n[Math.max(0,Math.ceil(n.length*.01)-1)],i=r>0?1e3/r:0;return{averageFps:Math.round(t*100)/100,low1PctFps:Math.round(i*100)/100}}};W(),it(),S(),de(),ir(),nn(),V(),f(),Gc(),Rc(),L();function cu(){z(e=>({...e,hasCompletedOnboarding:!0,lastOnboardingVersion:`0.0.7`}))}function lu(e,t){return new Promise(n=>{e.render(t(e=>void n(e)))})}async function X(e,t,n){return uu(e,t,{color:`error`,beforeExit:n})}async function uu(e,t,n){let{Text:r}=await import(`./src-CST_jFnT.js`),i=n?.color,a=n?.exitCode??1;e.render(i?(0,Y.jsx)(r,{color:i,children:t}):(0,Y.jsx)(r,{children:t})),e.unmount(),await n?.beforeExit?.(),process.exit(a)}function Z(e,t,n){return lu(e,e=>(0,Y.jsx)(ce,{initialState:B().theme,onThemeSave:e=>z(t=>({...t,theme:e})),children:(0,Y.jsx)(k,{onChangeAppState:n?.onChangeAppState,children:(0,Y.jsx)($i,{children:t(e)})})}))}async function du(e,t){e.render(t),pf(),await e.waitUntilExit(),await M(0)}async function fu(e,t,n,r){if(d(!1)||process.env.IS_DEMO)return!1;let i=B(),a=!1;if(!i.theme||!i.hasCompletedOnboarding){a=!0;let{Onboarding:t}=await import(`./Onboarding-BiZByBK-.js`);await Z(e,e=>(0,Y.jsx)(t,{onDone:()=>{cu(),e()}}),{onChangeAppState:qc})}if(!d(process.env.CLAUBBIT)){if(!eo()){let{TrustDialog:t}=await import(`./TrustDialog-CY8an_Tg.js`);await Z(e,e=>(0,Y.jsx)(t,{commands:r,onDone:e}))}Ze(!0),yn();let{errors:t}=zc();if(t.length===0&&await iu(e),await tn()){let t=Xt(await ct(!0)),{ClaudeMdExternalIncludesDialog:n}=await import(`./ClaudeMdExternalIncludesDialog--ywODh81.js`);await Z(e,e=>(0,Y.jsx)(n,{onDone:e,isStandaloneDialog:!0,externalIncludes:t}))}}if($c(),ou(),Kc(),setImmediate(()=>Hl()),await Mc()){let{GroveDialog:t}=await import(`./Grove-Cq88VBmM.js`);if(await Z(e,e=>(0,Y.jsx)(t,{showIfAlreadyViewed:!1,location:a?`onboarding`:`policy_update_modal`,onDone:e}))===`escape`)return G(`tengu_grove_policy_exited`,{}),ln(0),!1}if(process.env.ANTHROPIC_API_KEY&&!l()){let t=$o(process.env.ANTHROPIC_API_KEY);if(ro(t)===`new`){let{ApproveApiKey:n}=await import(`./ApproveApiKey-BQbHdvc3.js`);await Z(e,e=>(0,Y.jsx)(n,{customApiKeyTruncated:t,onDone:e}),{onChangeAppState:qc})}}if((t===`bypassPermissions`||n)&&!Pa()){let{BypassPermissionsModeDialog:t}=await import(`./BypassPermissionsModeDialog-DllL8dxU.js`);await Z(e,e=>(0,Y.jsx)(t,{onAccept:e}))}return a}function pu(e){let t=0,n=Qc(e);n.stdin&&G(`tengu_stdin_interactive`,{});let r=new su,i=Zc();x(i);let a=process.env.CLAUDE_CODE_FRAME_TIMING_LOG;return{getFpsMetrics:()=>r.getMetrics(),stats:i,renderOptions:{...n,onFrame:e=>{if(r.record(e.durationMs),i.observe(`frame_duration_ms`,e.durationMs),a&&e.phases){let t=JSON.stringify({total:e.durationMs,...e.phases,rss:process.memoryUsage.rss(),cpu:process.cpuUsage()})+`
|
|
20
|
-
`;
|
|
21
|
-
1. **Simplify** — Invoke the \`${
|
|
19
|
+
Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function h(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function g(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=ee,e.useColor=g})),cl=a((e=>{var{Argument:t}=rl(),{Command:n}=sl(),{CommanderError:r,InvalidArgumentError:i}=nl(),{Help:a}=il(),{Option:o}=al();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i})),ll=a(((e,t)=>{var n=cl();e=t.exports={},e.program=new n.Command,e.Argument=n.Argument,e.Command=n.Command,e.CommanderError=n.CommanderError,e.Help=n.Help,e.InvalidArgumentError=n.InvalidArgumentError,e.InvalidOptionArgumentError=n.InvalidArgumentError,e.Option=n.Option,e.createCommand=e=>new n.Command(e),e.createOption=(e,t)=>new n.Option(e,t),e.createArgument=(e,t)=>new n.Argument(e,t)}));s(),f(),ee(),we(),Se(),ma(),ba(),oa(),ha(),to(),ua(),W(),Eo(),wa(),ns();var{program:ul,createCommand:dl,createArgument:fl,createOption:pl,CommanderError:ml,InvalidArgumentError:hl,InvalidOptionArgumentError:gl,Command:_l,Argument:vl,Option:J,Help:yl}=r(ll(),1).default;te();var bl=r(se(),1);oe();var Y=fe();le(),be(),ea(),ro(),uo(),ho(),_o(),so(),yo(),bo(),Ca(),So(),Do(),ka(),xe(),Mo(),Ta(),Po(),Da(),L(),Wa(),ln(),ts(),Ha(),V(),Ls(),Rs(),ps(),zo(),xs(),ss(),Bs(),us(),Vo(),Ho(),cs(),Io(),Zo(),Jr(),kt(),Pt(),Xs(),ur(),ki(),js(),Gn(),ot(),mt(),ei(),hn(),Gs(),Xr(),zn(),$r(),Fs(),Ps(),D(),An(),Ci(),uc(),k(),Zr(),qi(),hc(),Ir(),Yt(),lt(),Qi(),_t(),Sr(),N(),Jn(),Ct(),Wr(),Kt(),cr(),Ao(),po();var xl=!1;function Sl(){if(xl||(xl=!0,mo())||d(process.env.CLAUDE_CODE_USE_BEDROCK)||d(process.env.CLAUDE_CODE_USE_VERTEX)||d(process.env.CLAUDE_CODE_USE_FOUNDRY)||process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||process.env.ANTHROPIC_UNIX_SOCKET||process.env.CLAUDE_CODE_CLIENT_CERT||process.env.CLAUDE_CODE_CLIENT_KEY)return;let e=process.env.ANTHROPIC_BASE_URL||Oo().BASE_API_URL;fetch(e,{method:`HEAD`,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}function Cl(){if(process.env.NODE_EXTRA_CA_CERTS)return;let e=wl();e&&(process.env.NODE_EXTRA_CA_CERTS=e,I(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${e}`))}function wl(){try{let e=B()?.env,t=Oa(`userSettings`)?.env;I(`CA certs: Config fallback - globalEnv keys: ${e?Object.keys(e).join(`,`):`none`}, settingsEnv keys: ${t?Object.keys(t).join(`,`):`none`}`);let n=t?.NODE_EXTRA_CA_CERTS||e?.NODE_EXTRA_CA_CERTS;return n&&I(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${n}`),n}catch(e){I(`CA certs: Config fallback failed: ${e}`,{level:`error`});return}}V(),ua(),nc(),qs(),f(),Ac(),tc(),ec(),pc();var Tl=!1,El=o(async()=>{let e=Date.now();H(`info`,`init_started`),K(`init_function_start`);try{let t=Date.now();Xa(),ne({loadTheme:()=>B().theme,saveTheme:e=>z(t=>({...t,theme:e}))}),H(`info`,`init_configs_enabled`,{duration_ms:Date.now()-t}),K(`init_configs_enabled`);let n=Date.now();kc();try{let{restoreActiveProvider:e}=await import(`./switcher-hgBgVzLb.js`),t=await e();if(t?.warnings.length)for(let e of t.warnings)I(`[init] ${e}`)}catch(e){I(`[init] restoreActiveProvider failed: ${e instanceof Error?e.message:String(e)}`,{level:`warn`})}Cl(),H(`info`,`init_safe_env_vars_applied`,{duration_ms:Date.now()-n}),K(`init_safe_env_vars_applied`),Vn(),K(`init_after_graceful_shutdown`),import(`./firstPartyEventLogger-LsNY6yOt.js`).then(e=>{e.initialize1PEventLogging()}),K(`init_after_1p_event_logging`),import(`./poller-CpLBoB-N.js`).then(e=>e.startBalancePolling()),K(`init_after_balance_polling`),Wo(),K(`init_after_oauth_populate`),Ks(),K(`init_after_jetbrains_detection`),rc(),Sc()&&bc(),ci()&&zr(),K(`init_after_remote_settings_check`),Qa();let r=Date.now();I(`[init] configureGlobalMTLS starting`),Is(),H(`info`,`init_mtls_configured`,{duration_ms:Date.now()-r}),I(`[init] configureGlobalMTLS complete`);let i=Date.now();if(I(`[init] configureGlobalAgents starting`),zs(),H(`info`,`init_proxy_configured`,{duration_ms:Date.now()-i}),I(`[init] configureGlobalAgents complete`),K(`init_network_configured`),await dc(),Sl(),d(process.env.CLAUDE_CODE_REMOTE))try{let{initUpstreamProxy:e,getUpstreamProxyEnv:t}=await import(`./upstreamproxy-Hmq-n8fw.js`),{registerUpstreamProxyEnvFn:n}=await import(`./subprocessEnv-BSQSomcK.js`);n(t),await e()}catch(e){I(`[init] upstreamproxy init failed: ${e instanceof Error?e.message:String(e)}; continuing without proxy`,{level:`warn`})}if(xo(),_a(Cn),yn()){let e=Date.now();await en(),H(`info`,`init_scratchpad_created`,{duration_ms:Date.now()-e})}try{let{getRipgrepStatus:e}=await import(`./ripgrep-C2PhTJDh.js`),t=e();t.note&&process.stderr.write(`[ripgrep] ${t.note}\n`)}catch{I(`[init] ripgrep status check skipped`)}H(`info`,`init_completed`,{duration_ms:Date.now()-e}),K(`init_function_end`)}catch(e){if(e instanceof fa){if(Qe()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}\n`),_i(1);return}return import(`./InvalidConfigDialog-BI13il58.js`).then(t=>t.showInvalidConfigDialog({error:e}))}else throw e}});function Dl(){Sc()?(Qe()&&Qs()&&Ol().catch(e=>{I(`[3P telemetry] Eager telemetry init failed (beta tracing): ${F(e)}`,{level:`error`})}),I(`[3P telemetry] Waiting for remote managed settings before telemetry init`),xc().then(async()=>{I(`[3P telemetry] Remote managed settings loaded, initializing telemetry`),jc(),await Ol()}).catch(e=>{I(`[3P telemetry] Telemetry init failed (remote settings path): ${F(e)}`,{level:`error`})})):Ol().catch(e=>{I(`[3P telemetry] Telemetry init failed: ${F(e)}`,{level:`error`})})}async function Ol(){if(!Tl){if(!d(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)){Tl=!0,I(`[3P telemetry] Skipped — CLAUDE_CODE_ENABLE_TELEMETRY not set`);return}Tl=!0;try{await kl()}catch(e){throw Tl=!1,e}}}async function kl(){let{initializeTelemetry:e}=await import(`./instrumentation-CcWzhGfE.js`),t=await e();t&&(ke(t,(e,n)=>{let r=t?.createCounter(e,n);return{add(e,t={}){let n={...$s(),...t};r?.add(e,n)}}}),Ge()?.add(1))}it();async function Al(e,t,n,r){let{App:i}=await import(`./App-Ba52HvYC.js`),{REPL:a}=await import(`./REPL-YqjLnr3A.js`);await r(e,(0,Y.jsx)(i,{...t,children:(0,Y.jsx)(a,{...n})}))}gc(),Ao(),V(),ua(),po();var jl=ye(()=>S({client_data:me(x(),pe()).nullish(),additional_model_options:_e(S({model:x(),name:x(),description:x()}).transform(({model:e,name:t,description:n})=>({value:e,label:t,description:n}))).nullish()}));async function Ml(){if(mo())return I(`[Bootstrap] Skipped: Nonessential traffic disabled`),null;if(ys()!==`firstParty`)return I(`[Bootstrap] Skipped: 3P provider`),null;let e=Ss();if(!(Uo()?.accessToken&&ws())&&!e)return I(`[Bootstrap] Skipped: no usable OAuth or API key`),null;let t=`${Oo().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await ms(async()=>{let n=Uo()?.accessToken,r;if(n&&ws())r={Authorization:`Bearer ${n}`,"anthropic-beta":ko};else if(e)r={"x-api-key":e};else return I(`[Bootstrap] No auth available on retry, aborting`),null;I(`[Bootstrap] Fetching`);let i=await g.get(t,{headers:{"Content-Type":`application/json`,"User-Agent":Vs(),...r},timeout:5e3}),a=jl().safeParse(i.data);return a.success?(I(`[Bootstrap] Fetch ok`),a.data):(I(`[Bootstrap] Response failed validation: ${a.error.message}`),null)})}catch(e){throw I(`[Bootstrap] Fetch failed: ${g.isAxiosError(e)?e.response?.status??e.code:`unknown`}`),e}}async function Nl(){try{let e=await Ml();if(!e)return;let t=e.client_data??null,n=e.additional_model_options??[],r=B();if($o(r.clientDataCache,t)&&$o(r.additionalModelOptionsCache,n)){I(`[Bootstrap] Cache unchanged, skipping write`);return}I(`[Bootstrap] Cache updated, persisting to disk`),z(e=>({...e,clientDataCache:t,additionalModelOptionsCache:n}))}catch(e){U(e)}}is(),Yr(),$e(),ua(),f();var Pl=new Map;function Fl(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;vo()===`windows`&&(e=e.split(Zc.sep).join(Jc.sep),t=t.split(Zc.sep).join(Jc.sep));let n=[e,t],r=[`/build-ant/`,`/build-external/`,`/build-external-native/`,`/build-ant-native/`];return n.some(e=>r.some(t=>e.includes(t)))}var Il=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function Ll(e){let t=`${e.name}: ${e.message}`;return Il.some(e=>e.test(t))}var Rl=null;function zl(){let e=process.listeners(`warning`);Rl&&e.includes(Rl)||(Fl()||process.removeAllListeners(`warning`),Rl=e=>{try{let t=`${e.name}: ${e.message.slice(0,50)}`,n=Pl.get(t)||0;(Pl.has(t)||Pl.size<1e3)&&Pl.set(t,n+1);let r=Ll(e);G(`tengu_node_warning`,{is_internal:+!!r,occurrence_count:n+1,classname:e.name,...process.env.USER_TYPE===`ant`&&{message:e.message}}),d(process.env.CLAUDE_DEBUG)&&I(`${r?`[Internal Warning]`:`[Warning]`} ${e.toString()}`,{level:`warn`})}catch{}},process.on(`warning`,Rl))}$n(),E(),At(),bn(),Oi(),le();function Bl(){return(0,Y.jsxs)(v,{children:[`MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the`,` `,(0,Y.jsx)(_,{url:`https://code.claude.com/docs/en/mcp`,children:`MCP documentation`}),`.`]})}W(),L(),le();function Vl({serverName:e,onDone:t}){function n(n){switch(G(`tengu_mcp_dialog_choice`,{choice:n}),n){case`yes`:case`yes_all`:{let r=(Aa()||{}).enabledMcpjsonServers||[];r.includes(e)||R(`localSettings`,{enabledMcpjsonServers:[...r,e]}),n===`yes_all`&&R(`localSettings`,{enableAllProjectMcpServers:!0}),t();break}case`no`:{let n=(Aa()||{}).disabledMcpjsonServers||[];n.includes(e)||R(`localSettings`,{disabledMcpjsonServers:[...n,e]}),t();break}}}return(0,Y.jsxs)(de,{title:`New MCP server found in .mcp.json: ${e}`,color:`warning`,onCancel:()=>n(`no`),children:[(0,Y.jsx)(Bl,{}),(0,Y.jsx)($i,{options:[{label:`Use this and all future MCP servers in this project`,value:`yes_all`},{label:`Use this MCP server`,value:`yes`},{label:`Continue without using this MCP server`,value:`no`}],onChange:e=>n(e),onCancel:()=>n(`no`)})]})}Ys(),W(),le(),L(),A();function Hl({serverNames:e,onDone:t}){function n(n){let r=Aa()||{},i=r.enabledMcpjsonServers||[],a=r.disabledMcpjsonServers||[],[o,s]=Js(e,e=>n.includes(e));G(`tengu_mcp_multidialog_choice`,{approved:o.length,rejected:s.length}),o.length>0&&R(`localSettings`,{enabledMcpjsonServers:[...new Set([...i,...o])]}),s.length>0&&R(`localSettings`,{disabledMcpjsonServers:[...new Set([...a,...s])]}),t()}let r=(0,bl.useCallback)(()=>{let n=(Aa()||{}).disabledMcpjsonServers||[];R(`localSettings`,{disabledMcpjsonServers:[...new Set([...n,...e])]}),t()},[e,t]);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(de,{title:`${e.length} new MCP servers found in .mcp.json`,subtitle:`Select any you wish to enable.`,color:`warning`,onCancel:r,hideInputGuide:!0,children:[(0,Y.jsx)(Bl,{}),(0,Y.jsx)(Ln,{options:e.map(e=>({label:e,value:e})),defaultValue:e,onSubmit:n,onCancel:r,hideIndexes:!0})]}),(0,Y.jsx)(ie,{paddingX:1,children:(0,Y.jsx)(v,{dimColor:!0,italic:!0,children:(0,Y.jsxs)(ae,{children:[(0,Y.jsx)(re,{shortcut:`Space`,action:`select`}),(0,Y.jsx)(re,{shortcut:`Enter`,action:`confirm`}),(0,Y.jsx)(vi,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`reject all`})]})})})]})}ar();async function Ul(e){let{servers:t}=vn(`project`),n=Object.keys(t).filter(e=>Dn(e)===`pending`);n.length!==0&&await new Promise(t=>{let r=()=>void t();if(n.length===1&&n[0]!==void 0){let t=n[0];e.render((0,Y.jsx)(jr,{children:(0,Y.jsx)(li,{children:(0,Y.jsx)(Vl,{serverName:t,onDone:r})})}))}else e.render((0,Y.jsx)(jr,{children:(0,Y.jsx)(li,{children:(0,Y.jsx)(Hl,{serverNames:n,onDone:r})})}))})}Na(),bt(),ht(),bi(),Ur(),nr(),Pr(),dt(),V(),ua();var Wl={iterm:`iTerm`,"iterm.app":`iTerm`,ghostty:`Ghostty`,kitty:`kitty`,alacritty:`Alacritty`,wezterm:`WezTerm`,apple_terminal:`Terminal`};function Gl(){if(process.platform!==`darwin`)return;let e=process.env.TERM_PROGRAM;if(!e)return;let t=Wl[e.toLowerCase()];t&&B().deepLinkTerminal!==t&&(z(e=>({...e,deepLinkTerminal:t})),I(`Stored deep link terminal preference: ${t}`))}var Kl=class{constructor(){h(this,`frameDurations`,[]),h(this,`firstRenderTime`,void 0),h(this,`lastRenderTime`,void 0)}record(e){let t=performance.now();this.firstRenderTime===void 0&&(this.firstRenderTime=t),this.lastRenderTime=t,this.frameDurations.push(e)}getMetrics(){if(this.frameDurations.length===0||this.firstRenderTime===void 0||this.lastRenderTime===void 0)return;let e=this.lastRenderTime-this.firstRenderTime;if(e<=0)return;let t=this.frameDurations.length/(e/1e3),n=this.frameDurations.slice().sort((e,t)=>t-e),r=n[Math.max(0,Math.ceil(n.length*.01)-1)],i=r>0?1e3/r:0;return{averageFps:Math.round(t*100)/100,low1PctFps:Math.round(i*100)/100}}};W(),k(),Se(),le(),Oi(),ar(),V(),f(),Ac(),Cc(),L();function ql(){z(e=>({...e,hasCompletedOnboarding:!0,lastOnboardingVersion:`0.0.8`}))}function Jl(e,t){return new Promise(n=>{e.render(t(e=>void n(e)))})}async function X(e,t,n){return Yl(e,t,{color:`error`,beforeExit:n})}async function Yl(e,t,n){let{Text:r}=await import(`./src-CST_jFnT.js`),i=n?.color,a=n?.exitCode??1;e.render(i?(0,Y.jsx)(r,{color:i,children:t}):(0,Y.jsx)(r,{children:t})),e.unmount(),await n?.beforeExit?.(),process.exit(a)}function Z(e,t,n){return Jl(e,e=>(0,Y.jsx)(y,{initialState:B().theme,onThemeSave:e=>z(t=>({...t,theme:e})),children:(0,Y.jsx)(jr,{onChangeAppState:n?.onChangeAppState,children:(0,Y.jsx)(li,{children:t(e)})})}))}async function Xl(e,t){e.render(t),Wd(),await e.waitUntilExit(),await j(0)}async function Zl(e,t,n,r){if(d(!1)||process.env.IS_DEMO)return!1;let i=B(),a=!1;if(!i.theme||!i.hasCompletedOnboarding){a=!0;let{Onboarding:t}=await import(`./Onboarding-c2fQ8Io_.js`);await Z(e,e=>(0,Y.jsx)(t,{onDone:()=>{ql(),e()}}),{onChangeAppState:Mc})}if(!d(process.env.CLAUBBIT)){if(!Ja()){let{TrustDialog:t}=await import(`./TrustDialog-BukWGvHZ.js`);await Z(e,e=>(0,Y.jsx)(t,{commands:r,onDone:e}))}Pe(!0),mn();let{errors:t}=wc();if(t.length===0&&await Ul(e),await Vt()){let t=ut(await jt(!0)),{ClaudeMdExternalIncludesDialog:n}=await import(`./ClaudeMdExternalIncludesDialog-Catv6BCJ.js`);await Z(e,e=>(0,Y.jsx)(n,{onDone:e,isStandaloneDialog:!0,externalIncludes:t}))}}if(Rc(),Gl(),jc(),setImmediate(()=>Dl()),await _c()){let{GroveDialog:t}=await import(`./Grove-Bc4CofEj.js`);if(await Z(e,e=>(0,Y.jsx)(t,{showIfAlreadyViewed:!1,location:a?`onboarding`:`policy_update_modal`,onDone:e}))===`escape`)return G(`tengu_grove_policy_exited`,{}),_i(0),!1}if(process.env.ANTHROPIC_API_KEY&&!l()){let t=Ko(process.env.ANTHROPIC_API_KEY);if(Za(t)===`new`){let{ApproveApiKey:n}=await import(`./ApproveApiKey-D2MLQu2P.js`);await Z(e,e=>(0,Y.jsx)(n,{customApiKeyTruncated:t,onDone:e}),{onChangeAppState:Mc})}}if((t===`bypassPermissions`||n)&&!ja()){let{BypassPermissionsModeDialog:t}=await import(`./BypassPermissionsModeDialog-GYhq--JR.js`);await Z(e,e=>(0,Y.jsx)(t,{onAccept:e}))}return a}function Ql(e){let t=0,n=Lc(e);n.stdin&&G(`tengu_stdin_interactive`,{});let r=new Kl,i=Ic();Ve(i);let a=process.env.CLAUDE_CODE_FRAME_TIMING_LOG;return{getFpsMetrics:()=>r.getMetrics(),stats:i,renderOptions:{...n,onFrame:e=>{if(r.record(e.durationMs),i.observe(`frame_duration_ms`,e.durationMs),a&&e.phases){let t=JSON.stringify({total:e.durationMs,...e.phases,rss:process.memoryUsage.rss(),cpu:process.cpuUsage()})+`
|
|
20
|
+
`;Qc(a,t)}if(!ce())for(let n of e.flickers){if(n.reason===`resize`)continue;let e=Date.now();e-t<1e3&&G(`tengu_flicker`,{desiredHeight:n.desiredHeight,actualHeight:n.availableHeight,reason:n.reason}),t=e}}}}}Oi();async function $l(e,t){let{InvalidSettingsDialog:n}=await import(`./InvalidSettingsDialog-CtOheV1K.js`);return Z(e,e=>(0,Y.jsx)(n,{settingsErrors:t.settingsErrors,onContinue:e,onExit:t.onExit}))}async function eu(e){let{TeleportResumeWrapper:t}=await import(`./TeleportResumeWrapper-Blo2cZg-.js`);return Z(e,e=>(0,Y.jsx)(t,{onComplete:e,onCancel:()=>e(null),source:`cliArg`}))}async function tu(e,t){let{TeleportRepoMismatchDialog:n}=await import(`./TeleportRepoMismatchDialog-BV--nyYn.js`);return Z(e,e=>(0,Y.jsx)(n,{targetRepo:t.targetRepo,initialPaths:t.initialPaths,onSelectPath:e,onCancel:()=>e(null)}))}async function nu(e,t,n,r){let[i,{ResumeConversation:a},{App:o}]=await Promise.all([n,import(`./ResumeConversation-CIZCjms9.js`),import(`./App-Ba52HvYC.js`)]);await Xl(e,(0,Y.jsx)(o,{getFpsMetrics:t.getFpsMetrics,stats:t.stats,initialState:t.initialState,children:(0,Y.jsx)(li,{children:(0,Y.jsx)(a,{...r,worktreePaths:i})})}))}Ts(),Ds();var ru=5,iu=30,au=`After you finish implementing the change:
|
|
21
|
+
1. **Simplify** — Invoke the \`${Es}\` tool with \`skill: "simplify"\` to review and clean up your changes.
|
|
22
22
|
2. **Run unit tests** — Run the project's test suite (check for package.json scripts, Makefile targets, or common commands like \`npm test\`, \`bun test\`, \`pytest\`, \`go test\`). If tests fail, fix them.
|
|
23
23
|
3. **Test end-to-end** — Follow the e2e test recipe from the coordinator's prompt (below). If the recipe says to skip e2e for this unit, skip it.
|
|
24
24
|
4. **Commit and push** — Commit all changes with a clear message, push the branch, and create a PR with \`gh pr create\`. Use a descriptive title. If \`gh\` is not available or the push fails, note it in your final message.
|
|
25
|
-
5. **Report** — End with a single line: \`PR: <url>\` so the coordinator can track it. If no PR was created, end with \`PR: none — <reason>\`.`;function
|
|
25
|
+
5. **Report** — End with a single line: \`PR: <url>\` so the coordinator can track it. If no PR was created, end with \`PR: none — <reason>\`.`;function ou(e){return`# Batch: Parallel Work Orchestration
|
|
26
26
|
|
|
27
27
|
You are orchestrating a large, parallelizable change across this codebase.
|
|
28
28
|
|
|
@@ -32,16 +32,16 @@ ${e}
|
|
|
32
32
|
|
|
33
33
|
## Phase 1: Research and Plan (Plan Mode)
|
|
34
34
|
|
|
35
|
-
Call the \`${
|
|
35
|
+
Call the \`${Os}\` tool now to enter plan mode, then:
|
|
36
36
|
|
|
37
37
|
1. **Understand the scope.** Launch one or more subagents (in the foreground — you need their results) to deeply research what this instruction touches. Find all the files, patterns, and call sites that need to change. Understand the existing conventions so the migration is consistent.
|
|
38
38
|
|
|
39
|
-
2. **Decompose into independent units.** Break the work into ${
|
|
39
|
+
2. **Decompose into independent units.** Break the work into ${ru}–${iu} self-contained units. Each unit must:
|
|
40
40
|
- Be independently implementable in an isolated git worktree (no shared state with sibling units)
|
|
41
41
|
- Be mergeable on its own without depending on another unit's PR landing first
|
|
42
42
|
- Be roughly uniform in size (split large units, merge trivial ones)
|
|
43
43
|
|
|
44
|
-
Scale the count to the actual work: few files → closer to ${
|
|
44
|
+
Scale the count to the actual work: few files → closer to ${ru}; hundreds of files → closer to ${iu}. Prefer per-directory or per-module slicing over arbitrary file lists.
|
|
45
45
|
|
|
46
46
|
3. **Determine the e2e test recipe.** Figure out how a worker can verify its change actually works end-to-end — not just that unit tests pass. Look for:
|
|
47
47
|
- A \`claude-in-chrome\` skill or browser-automation tool (for UI changes: click through the affected flow, screenshot the result)
|
|
@@ -49,7 +49,7 @@ Call the \`${Ws}\` tool now to enter plan mode, then:
|
|
|
49
49
|
- A dev-server + curl pattern (for API changes: start the server, hit the affected endpoints)
|
|
50
50
|
- An existing e2e/integration test suite the worker can run
|
|
51
51
|
|
|
52
|
-
If you cannot find a concrete e2e path, use the \`${
|
|
52
|
+
If you cannot find a concrete e2e path, use the \`${ks}\` tool to ask the user how to verify this change end-to-end. Offer 2–3 specific options based on what you found (e.g., "Screenshot via chrome extension", "Run \`bun run dev\` and curl the endpoint", "No e2e — unit tests are sufficient"). Do not skip this — the workers cannot ask the user themselves.
|
|
53
53
|
|
|
54
54
|
Write the recipe as a short, concrete set of steps that a worker can execute autonomously. Include any setup (start a dev server, build first) and the exact command/interaction to verify.
|
|
55
55
|
|
|
@@ -59,11 +59,11 @@ Call the \`${Ws}\` tool now to enter plan mode, then:
|
|
|
59
59
|
- The e2e test recipe (or "skip e2e because …" if the user chose that)
|
|
60
60
|
- The exact worker instructions you will give each agent (the shared template)
|
|
61
61
|
|
|
62
|
-
5. Call \`${
|
|
62
|
+
5. Call \`${Ms}\` to present the plan for approval.
|
|
63
63
|
|
|
64
64
|
## Phase 2: Spawn Workers (After Plan Approval)
|
|
65
65
|
|
|
66
|
-
Once the plan is approved, spawn one background agent per work unit using the \`${
|
|
66
|
+
Once the plan is approved, spawn one background agent per work unit using the \`${Sa}\` tool. **All agents must use \`isolation: "worktree"\` and \`run_in_background: true\`.** Launch them all in a single message block so they run in parallel.
|
|
67
67
|
|
|
68
68
|
For each agent, the prompt must be fully self-contained. Include:
|
|
69
69
|
- The overall goal (the user's instruction)
|
|
@@ -73,7 +73,7 @@ For each agent, the prompt must be fully self-contained. Include:
|
|
|
73
73
|
- The worker instructions below, copied verbatim:
|
|
74
74
|
|
|
75
75
|
\`\`\`
|
|
76
|
-
${
|
|
76
|
+
${au}
|
|
77
77
|
\`\`\`
|
|
78
78
|
|
|
79
79
|
Use \`subagent_type: "general-purpose"\` unless a more specific agent type fits.
|
|
@@ -90,14 +90,14 @@ After launching all workers, render an initial status table:
|
|
|
90
90
|
As background-agent completion notifications arrive, parse the \`PR: <url>\` line from each agent's result and re-render the table with updated status (\`done\` / \`failed\`) and PR links. Keep a brief failure note for any agent that did not produce a PR.
|
|
91
91
|
|
|
92
92
|
When all agents have reported, render the final table and a one-line summary (e.g., "22/24 units landed as PRs").
|
|
93
|
-
`}var
|
|
93
|
+
`}var su="This is not a git repository. The `/batch` command requires a git repo because it spawns agents in isolated git worktrees and creates PRs from each. Initialize a repo first, or run this from inside an existing one.",cu=`Provide an instruction describing the batch change you want to make.
|
|
94
94
|
|
|
95
95
|
Examples:
|
|
96
96
|
/batch migrate from react to vue
|
|
97
97
|
/batch replace all uses of lodash with native equivalents
|
|
98
|
-
/batch add type annotations to all untyped function parameters`;function
|
|
98
|
+
/batch add type annotations to all untyped function parameters`;function lu(){P({name:`batch`,description:`Research and plan a large-scale change, then execute it in parallel across 5–30 isolated worktree agents that each open a PR.`,whenToUse:`Use when the user wants to make a sweeping, mechanical change across many files (migrations, refactors, bulk renames) that can be decomposed into independent parallel units.`,argumentHint:`<instruction>`,userInvocable:!0,disableModelInvocation:!0,async getPromptForCommand(e){let t=e.trim();return t?await oo()?[{type:`text`,text:ou(t)}]:[{type:`text`,text:su}]:[{type:`text`,text:cu}]}})}ir(),L(),ua(),ba(),N();var uu=20,du=64*1024;function fu(){P({name:`debug`,description:process.env.USER_TYPE===`ant`?`Debug your current Work Mate session by reading the session debug log. Includes all event logging`:`Enable debug logging for this session and help diagnose issues`,allowedTools:[`Read`,`Grep`,`Glob`],argumentHint:`[issue description]`,disableModelInvocation:!0,userInvocable:!0,async getPromptForCommand(e){let t=pa(),n=ga(),r;try{let e=await tl(n),t=Math.min(e.size,du),i=e.size-t,a=await el(n,`r`);try{let{buffer:n,bytesRead:o}=await a.read({buffer:Buffer.alloc(t),position:i}),s=n.toString(`utf-8`,0,o).split(`
|
|
99
99
|
`).slice(-20).join(`
|
|
100
|
-
`);r=`Log size: ${
|
|
100
|
+
`);r=`Log size: ${To(e.size)}\n\n### Last ${uu} lines\n\n\`\`\`\n${s}\n\`\`\``}finally{await a.close()}}catch(e){r=sa(e)?`No debug log exists yet — logging was just enabled.`:`Failed to read last ${uu} lines of debug log: ${F(e)}`}return[{type:`text`,text:`# Debug Skill
|
|
101
101
|
|
|
102
102
|
Help the user debug an issue they're encountering in this current Work Mate session.
|
|
103
103
|
${t?``:`
|
|
@@ -122,32 +122,32 @@ ${e||`The user did not describe a specific issue. Read the debug log and summari
|
|
|
122
122
|
## Settings
|
|
123
123
|
|
|
124
124
|
Remember that settings are in:
|
|
125
|
-
* user - ${
|
|
126
|
-
* project - ${
|
|
127
|
-
* local - ${
|
|
125
|
+
* user - ${Ia(`userSettings`)}
|
|
126
|
+
* project - ${Ia(`projectSettings`)}
|
|
127
|
+
* local - ${Ia(`localSettings`)}
|
|
128
128
|
|
|
129
129
|
## Instructions
|
|
130
130
|
|
|
131
131
|
1. Review the user's issue description
|
|
132
|
-
2. The last ${
|
|
133
|
-
3. Consider launching the ${
|
|
132
|
+
2. The last ${uu} lines show the debug file format. Look for [ERROR] and [WARN] entries, stack traces, and failure patterns across the file
|
|
133
|
+
3. Consider launching the ${Ar} subagent to understand the relevant Work Mate features
|
|
134
134
|
4. Explain what you found in plain language
|
|
135
135
|
5. Suggest concrete fixes or next steps
|
|
136
|
-
`}]}})}
|
|
137
|
-
`)}var
|
|
138
|
-
`),
|
|
139
|
-
`),
|
|
140
|
-
`),
|
|
141
|
-
`),
|
|
142
|
-
`),
|
|
143
|
-
`),
|
|
144
|
-
`),
|
|
145
|
-
`);function
|
|
146
|
-
|
|
147
|
-
`)}]}})}function
|
|
148
|
-
`)}
|
|
149
|
-
|
|
150
|
-
`)}return n.trim()}function
|
|
136
|
+
`}]}})}Rt(),xe();var pu=[`Global`,`Chat`,`Autocomplete`,`Confirmation`,`Help`,`Transcript`,`HistorySearch`,`Task`,`ThemePicker`,`Settings`,`Tabs`,`Attachments`,`Footer`,`MessageSelector`,`DiffDialog`,`ModelPicker`,`Select`,`Plugin`],mu={Global:`Active everywhere, regardless of focus`,Chat:`When the chat input is focused`,Autocomplete:`When autocomplete menu is visible`,Confirmation:`When a confirmation/permission dialog is shown`,Help:`When the help overlay is open`,Transcript:`When viewing the transcript`,HistorySearch:`When searching command history (ctrl+r)`,Task:`When a task/agent is running in the foreground`,ThemePicker:`When the theme picker is open`,Settings:`When the settings menu is open`,Tabs:`When tab navigation is active`,Attachments:`When navigating image attachments in a select dialog`,Footer:`When footer indicators are focused`,MessageSelector:`When the message selector (rewind) is open`,DiffDialog:`When the diff dialog is open`,ModelPicker:`When the model picker is open`,Select:`When a select/list component is focused`,Plugin:`When the plugin dialog is open`},hu=`app:interrupt.app:exit.app:toggleTodos.app:toggleTranscript.app:toggleBrief.app:toggleTeammatePreview.app:toggleTerminal.app:redraw.app:globalSearch.app:quickOpen.history:search.history:previous.history:next.chat:cancel.chat:killAgents.chat:cycleMode.chat:modelPicker.chat:fastMode.chat:thinkingToggle.chat:submit.chat:newline.chat:undo.chat:externalEditor.chat:stash.chat:imagePaste.chat:messageActions.autocomplete:accept.autocomplete:dismiss.autocomplete:previous.autocomplete:next.confirm:yes.confirm:no.confirm:previous.confirm:next.confirm:nextField.confirm:previousField.confirm:cycleMode.confirm:toggle.confirm:toggleExplanation.tabs:next.tabs:previous.transcript:toggleShowAll.transcript:exit.historySearch:next.historySearch:accept.historySearch:cancel.historySearch:execute.task:background.theme:toggleSyntaxHighlighting.help:dismiss.attachments:next.attachments:previous.attachments:remove.attachments:exit.footer:up.footer:down.footer:next.footer:previous.footer:openSelected.footer:clearSelection.footer:close.messageSelector:up.messageSelector:down.messageSelector:top.messageSelector:bottom.messageSelector:select.diff:dismiss.diff:previousSource.diff:nextSource.diff:back.diff:viewDetails.diff:previousFile.diff:nextFile.modelPicker:toggle1M.select:next.select:previous.select:accept.select:cancel.plugin:toggle.plugin:install.permission:toggleDebug.settings:search.settings:retry.settings:close.select:previousValue.select:nextValue`.split(`.`),gu=ye(()=>S({context:ge(pu).describe(`UI context where these bindings apply. Global bindings work everywhere.`),bindings:me(x().describe(`Keystroke pattern (e.g., "ctrl+k", "shift+tab")`),he([ge(hu),x().regex(/^command:[a-zA-Z0-9:\-_]+$/).describe(`Command binding (e.g., "command:help", "command:compact"). Executes the slash command as if typed.`),ve().describe(`Set to null to unbind a default shortcut`)]).describe(`Action to trigger, command to invoke, or null to unbind`)).describe(`Map of keystroke patterns to actions`)}).describe(`A block of keybindings for a specific context`));ye(()=>S({$schema:x().optional().describe(`JSON Schema URL for editor validation`),$docs:x().optional().describe(`Documentation URL`),bindings:_e(gu()).describe(`Array of keybinding blocks by context`)}).describe(`Work Mate keybindings configuration. Customize keyboard shortcuts by context.`)),N();function _u(){return Pu([`Context`,`Description`],pu.map(e=>[`\`${e}\``,mu[e]]))}function vu(){let e={};for(let t of Wn)for(let[n,r]of Object.entries(t.bindings))r&&(e[r]||(e[r]={keys:[],context:t.context}),e[r].keys.push(n));return Pu([`Action`,`Default Key(s)`,`Context`],hu.map(t=>{let n=e[t],r=n?n.keys.map(e=>`\`${e}\``).join(`, `):`(none)`,i=n?n.context:yu(t);return[`\`${t}\``,r,i]}))}function yu(e){return{app:`Global`,history:`Global or Chat`,chat:`Chat`,autocomplete:`Autocomplete`,confirm:`Confirmation`,tabs:`Tabs`,transcript:`Transcript`,historySearch:`HistorySearch`,task:`Task`,theme:`ThemePicker`,help:`Help`,attachments:`Attachments`,footer:`Footer`,messageSelector:`MessageSelector`,diff:`DiffDialog`,modelPicker:`ModelPicker`,select:`Select`,permission:`Confirmation`}[e.split(`:`)[0]??``]??`Unknown`}function bu(){let e=[];e.push(`### Non-rebindable (errors)`);for(let t of Bt)e.push(`- \`${t.key}\` — ${t.reason}`);e.push(``),e.push(`### Terminal reserved (errors/warnings)`);for(let t of yi)e.push(`- \`${t.key}\` — ${t.reason} (${t.severity===`error`?`will not work`:`may conflict`})`);e.push(``),e.push(`### macOS reserved (errors)`);for(let t of Dt)e.push(`- \`${t.key}\` — ${t.reason}`);return e.join(`
|
|
137
|
+
`)}var xu={$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.claude.com/docs/en/keybindings`,bindings:[{context:`Chat`,bindings:{"ctrl+e":`chat:externalEditor`}}]},Su={context:`Chat`,bindings:{"ctrl+s":null}},Cu={context:`Chat`,bindings:{"ctrl+g":null,"ctrl+e":`chat:externalEditor`}},wu={context:`Global`,bindings:{"ctrl+k ctrl+t":`app:toggleTodos`}},Tu=[`# Keybindings Skill`,``,"Create or modify `~/.claude/keybindings.json` to customize keyboard shortcuts.",``,`## CRITICAL: Read Before Write`,``,"**Always read `~/.claude/keybindings.json` first** (it may not exist yet). Merge changes with existing bindings — never replace the entire file.",``,`- Use **Edit** tool for modifications to existing files`,`- Use **Write** tool only if the file does not exist yet`].join(`
|
|
138
|
+
`),Eu=[`## File Format`,``,"```json",ya(xu,null,2),"```",``,"Always include the `$schema` and `$docs` fields."].join(`
|
|
139
|
+
`),Du=[`## Keystroke Syntax`,``,"**Modifiers** (combine with `+`):","- `ctrl` (alias: `control`)","- `alt` (aliases: `opt`, `option`) — note: `alt` and `meta` are identical in terminals","- `shift`","- `meta` (aliases: `cmd`, `command`)",``,"**Special keys**: `escape`/`esc`, `enter`/`return`, `tab`, `space`, `backspace`, `delete`, `up`, `down`, `left`, `right`",``,"**Chords**: Space-separated keystrokes, e.g. `ctrl+k ctrl+s` (1-second timeout between keystrokes)",``,"**Examples**: `ctrl+shift+p`, `alt+enter`, `ctrl+k ctrl+n`"].join(`
|
|
140
|
+
`),Ou=[`## Unbinding Default Shortcuts`,``,"Set a key to `null` to remove its default binding:",``,"```json",ya(Su,null,2),"```"].join(`
|
|
141
|
+
`),ku=[`## How User Bindings Interact with Defaults`,``,`- User bindings are **additive** — they are appended after the default bindings`,"- To **move** a binding to a different key: unbind the old key (`null`) AND add the new binding",`- A context only needs to appear in the user's file if they want to change something in that context`].join(`
|
|
142
|
+
`),Au=[`## Common Patterns`,``,`### Rebind a key`,"To change the external editor shortcut from `ctrl+g` to `ctrl+e`:","```json",ya(Cu,null,2),"```",``,`### Add a chord binding`,"```json",ya(wu,null,2),"```"].join(`
|
|
143
|
+
`),ju=[`## Behavioral Rules`,``,`1. Only include contexts the user wants to change (minimal overrides)`,`2. Validate that actions and contexts are from the known lists below`,"3. Warn the user proactively if they choose a key that conflicts with reserved shortcuts or common tools like tmux (`ctrl+b`) and screen (`ctrl+a`)",`4. When adding a new binding for an existing action, the new binding is additive (existing default still works unless explicitly unbound)`,`5. To fully replace a default binding, unbind the old key AND add the new one`].join(`
|
|
144
|
+
`),Mu=[`## Validation with /doctor`,``,'The `/doctor` command includes a "Keybinding Configuration Issues" section that validates `~/.claude/keybindings.json`.',``,`### Common Issues and Fixes`,``,Pu([`Issue`,`Cause`,`Fix`],[['`keybindings.json must have a "bindings" array`',`Missing wrapper object`,'Wrap bindings in `{ "bindings": [...] }`'],['`"bindings" must be an array`',"`bindings` is not an array",'Set `"bindings"` to an array: `[{ context: ..., bindings: ... }]`'],['`Unknown context "X"`',`Typo or invalid context name`,`Use exact context names from the Available Contexts table`],['`Duplicate key "X" in Y bindings`',`Same key defined twice in one context`,`Remove the duplicate; JSON uses only the last value`],['`"X" may not work: ...`',`Key conflicts with terminal/OS reserved shortcut`,`Choose a different key (see Reserved Shortcuts section)`],['`Could not parse keystroke "X"`',`Invalid key syntax`,"Check syntax: use `+` between modifiers, valid key names"],['`Invalid action for "X"`',`Action value is not a string or null`,'Actions must be strings like `"app:help"` or `null` to unbind']]),``,`### Example /doctor Output`,``,"```",`Keybinding Configuration Issues`,`Location: ~/.claude/keybindings.json`,` └ [Error] Unknown context "chat"`,` → Valid contexts: Global, Chat, Autocomplete, ...`,` └ [Warning] "ctrl+c" may not work: Terminal interrupt (SIGINT)`,"```",``,`**Errors** prevent bindings from working and must be fixed. **Warnings** indicate potential conflicts but the binding may still work.`].join(`
|
|
145
|
+
`);function Nu(){P({name:`keybindings-help`,description:`Use when the user wants to customize keyboard shortcuts, rebind keys, add chord bindings, or modify ~/.claude/keybindings.json. Examples: "rebind ctrl+s", "add a chord shortcut", "change the submit key", "customize keybindings".`,allowedTools:[`Read`],userInvocable:!1,isEnabled:Pn,async getPromptForCommand(e){let t=_u(),n=vu(),r=[Tu,Eu,Du,Ou,ku,Au,ju,Mu,`## Reserved Shortcuts\n\n${bu()}`,`## Available Contexts\n\n${t}`,`## Available Actions\n\n${n}`];return e&&r.push(`## User Request\n\n${e}`),[{type:`text`,text:r.join(`
|
|
146
|
+
|
|
147
|
+
`)}]}})}function Pu(e,t){let n=e.map(()=>`---`);return[`| ${e.join(` | `)} |`,`| ${n.join(` | `)} |`,...t.map(e=>`| ${e.join(` | `)} |`)].join(`
|
|
148
|
+
`)}N();var Fu=`the.a.an.I.you.he.she.it.we.they.me.him.her.us.them.my.your.his.its.our.this.that.what.who.is.are.was.were.be.been.have.has.had.do.does.did.will.would.can.could.may.might.must.shall.should.make.made.get.got.go.went.come.came.see.saw.know.take.think.look.want.use.find.give.tell.work.call.try.ask.need.feel.seem.leave.put.time.year.day.way.man.thing.life.hand.part.place.case.point.fact.good.new.first.last.long.great.little.own.other.old.right.big.high.small.large.next.early.young.few.public.bad.same.able.in.on.at.to.for.of.with.from.by.about.like.through.over.before.between.under.since.without.and.or.but.if.than.because.as.until.while.so.though.both.each.when.where.why.how.not.now.just.more.also.here.there.then.only.very.well.back.still.even.much.too.such.never.again.most.once.off.away.down.out.up.test.code.data.file.line.text.word.number.system.program.set.run.value.name.type.state.end.start`.split(`.`);function Iu(e){let t=0,n=``;for(;t<e;){let r=10+Math.floor(Math.random()*11),i=0;for(let a=0;a<r&&t<e;a++){let o=Fu[Math.floor(Math.random()*Fu.length)];n+=o,t++,i++,a===r-1||t>=e?n+=`. `:n+=` `}i>0&&Math.random()<.2&&t<e&&(n+=`
|
|
149
|
+
|
|
150
|
+
`)}return n.trim()}function Lu(){process.env.USER_TYPE===`ant`&&P({name:`lorem-ipsum`,description:`Generate filler text for long context testing. Specify token count as argument (e.g., /lorem-ipsum 50000). Outputs approximately the requested number of tokens. Ant-only.`,argumentHint:`[token_count]`,userInvocable:!0,async getPromptForCommand(e){let t=parseInt(e,10);if(e&&(isNaN(t)||t<=0))return[{type:`text`,text:`Invalid token count. Please provide a positive number (e.g., /lorem-ipsum 10000).`}];let n=t||1e4,r=Math.min(n,5e5);return r<n?[{type:`text`,text:`Requested ${n} tokens, but capped at 500,000 for safety.\n\n${Iu(r)}`}]:[{type:`text`,text:Iu(r)}]}})}N();function Ru(){process.env.USER_TYPE===`ant`&&P({name:`remember`,description:`Review auto-memory entries and propose promotions to CLAUDE.md, CLAUDE.local.md, or shared memory. Also detects outdated, conflicting, and duplicate entries across memory layers.`,whenToUse:`Use when the user wants to review, organize, or promote their auto-memory entries. Also useful for cleaning up outdated or conflicting entries across CLAUDE.md, CLAUDE.local.md, and auto-memory.`,userInvocable:!0,isEnabled:()=>Ua(),async getPromptForCommand(e){let t=`# Memory Review
|
|
151
151
|
|
|
152
152
|
## Goal
|
|
153
153
|
Review the user's memory landscape and produce a clear report of proposed changes, grouped by action type. Do NOT apply changes — present proposals for user approval.
|
|
@@ -200,7 +200,7 @@ If auto-memory is empty, say so and offer to review CLAUDE.md for cleanup.
|
|
|
200
200
|
- Do NOT modify files without explicit user approval
|
|
201
201
|
- Do NOT create new files unless the target doesn't exist yet
|
|
202
202
|
- Ask about ambiguous entries — don't guess
|
|
203
|
-
`;return e&&(t+=`\n## Additional context from user\n\n${e}`),[{type:`text`,text:t}]}})}
|
|
203
|
+
`;return e&&(t+=`\n## Additional context from user\n\n${e}`),[{type:`text`,text:t}]}})}Ta(),N();var zu=`# Simplify: Code Review and Cleanup
|
|
204
204
|
|
|
205
205
|
Review all changed files for reuse, quality, and efficiency. Fix any issues found.
|
|
206
206
|
|
|
@@ -210,7 +210,7 @@ Run \`git diff\` (or \`git diff HEAD\` if there are staged changes) to see what
|
|
|
210
210
|
|
|
211
211
|
## Phase 2: Launch Three Review Agents in Parallel
|
|
212
212
|
|
|
213
|
-
Use the ${
|
|
213
|
+
Use the ${Sa} tool to launch all three agents concurrently in a single message. Pass each agent the full diff so it has the complete context.
|
|
214
214
|
|
|
215
215
|
### Agent 1: Code Reuse Review
|
|
216
216
|
|
|
@@ -249,8 +249,8 @@ Review the same changes for efficiency:
|
|
|
249
249
|
Wait for all three agents to complete. Aggregate their findings and fix each issue directly. If a finding is a false positive or not worth addressing, note it and move on — do not argue with the finding, just skip it.
|
|
250
250
|
|
|
251
251
|
When done, briefly summarize what was fixed (or confirm the code was already clean).
|
|
252
|
-
`;function
|
|
253
|
-
`):``}).filter(e=>e.trim().length>0)}var
|
|
252
|
+
`;function Bu(){P({name:`simplify`,description:`Review changed code for reuse, quality, and efficiency, then fix any issues found.`,userInvocable:!0,async getPromptForCommand(e){let t=zu;return e&&(t+=`\n\n## Additional Focus\n\n${e}`),[{type:`text`,text:t}]}})}Ai(),N();function Vu(e){return e.filter(e=>e.type===`user`).map(e=>{let t=e.message?.content;return typeof t==`string`?t:Array.isArray(t)?t.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
253
|
+
`):``}).filter(e=>e.trim().length>0)}var Hu=`# Skillify {{userDescriptionBlock}}
|
|
254
254
|
|
|
255
255
|
You are capturing this session's repeatable process as a reusable skill.
|
|
256
256
|
|
|
@@ -384,11 +384,11 @@ After writing, tell the user:
|
|
|
384
384
|
- Where the skill was saved
|
|
385
385
|
- How to invoke it: \`/{{skill-name}} [arguments]\`
|
|
386
386
|
- That they can edit the SKILL.md directly to refine it
|
|
387
|
-
`;function
|
|
387
|
+
`;function Uu(){process.env.USER_TYPE===`ant`&&P({name:`skillify`,description:`Capture this session's repeatable process into a skill. Call at end of the process you want to capture with an optional description.`,allowedTools:[`Read`,`Write`,`Edit`,`Glob`,`Grep`,`AskUserQuestion`,`Bash(mkdir:*)`],userInvocable:!0,disableModelInvocation:!0,argumentHint:`[description of the process you want to capture]`,async getPromptForCommand(e,t){let n=await er()??`No session memory available.`,r=Vu(Et(t.messages)),i=e?`The user described this process as: "${e}"`:``;return[{type:`text`,text:Hu.replace(`{{sessionMemory}}`,n).replace(`{{userMessages}}`,r.join(`
|
|
388
388
|
|
|
389
389
|
---
|
|
390
390
|
|
|
391
|
-
`)).replace(`{{userDescriptionBlock}}`,i)}]}})}
|
|
391
|
+
`)).replace(`{{userDescriptionBlock}}`,i)}]}})}N();var Wu=`# /stuck — diagnose frozen/slow Work Mate sessions
|
|
392
392
|
|
|
393
393
|
The user thinks another Work Mate session on this machine is frozen, stuck, or very slow. Investigate and post a report to #claude-code-feedback.
|
|
394
394
|
|
|
@@ -441,7 +441,7 @@ If Slack MCP isn't available, format the report as a message the user can copy-p
|
|
|
441
441
|
## Notes
|
|
442
442
|
- Don't kill or signal any processes — this is diagnostic only.
|
|
443
443
|
- If the user gave an argument (e.g., a specific PID or symptom), focus there first.
|
|
444
|
-
`;function
|
|
444
|
+
`;function Gu(){process.env.USER_TYPE===`ant`&&P({name:`stuck`,description:`[ANT-ONLY] Investigate frozen/stuck/slow Work Mate sessions on this machine and post a diagnostic report to #claude-code-feedback.`,userInvocable:!0,async getPromptForCommand(e){let t=Wu;return e&&(t+=`\n## User-provided context\n\n${e}\n`),[{type:`text`,text:t}]}})}N();var Ku=`# /ultracode — Workflow Orchestration Playbook
|
|
445
445
|
|
|
446
446
|
Execute a workflow script that orchestrates multiple subagents deterministically. Workflows run in the background — this tool returns immediately with a task ID, and a \`<task-notification>\` arrives when the workflow completes. Use \`/workflows\` to watch live progress.
|
|
447
447
|
|
|
@@ -645,33 +645,33 @@ Use this tool for multi-step orchestration where control flow should be determin
|
|
|
645
645
|
## Resume
|
|
646
646
|
|
|
647
647
|
The tool result includes a runId. To resume after a pause, kill, or script edit, relaunch with \`Workflow({scriptPath, resumeFromRunId})\` — the longest unchanged prefix of agent() calls returns cached results instantly; the first edited/new call and everything after it runs live. Same script + same args → 100% cache hit. Date.now()/Math.random()/new Date() are unavailable in scripts (they would break this) — stamp results after the workflow returns, or pass timestamps via args. Fallback when no journal is available: Read agent-<id>.jsonl files in the transcript directory and hand-author a continuation script.
|
|
648
|
-
`;function
|
|
648
|
+
`;function qu(){P({name:`ultracode`,description:`Enter multi-agent workflow orchestration mode: when to use the Workflow tool, script primitives, quality patterns, determinism constraints, resume/budget, and files/commands.`,whenToUse:`When a task can be decomposed or parallelized, needs multi-perspective confidence (e.g. find then adversarially verify), exceeds a single context (large migrations, broad audits, long-tail enumeration), or needs resume/auditability — orchestrate multiple subagents with the Workflow tool.`,userInvocable:!0,async getPromptForCommand(e){let t=Ku;return e&&(t+=`\n## User input\n\n${e}\n`),[{type:`text`,text:t}]}})}N();function Ju(){P({name:`loop`,description:`Run a prompt or slash command on a recurring interval (e.g. /loop 5m /foo, defaults to 10m)`,whenToUse:`When the user wants to set up a recurring task, poll for status, or run something repeatedly on an interval (e.g. "check the deploy every 5 minutes", "keep running /babysit-prs"). Do NOT invoke for one-off tasks.`,argumentHint:`[interval] <prompt>`,userInvocable:!1,isEnabled:()=>!1,async getPromptForCommand(){return[{type:`text`,text:`The /loop command is no longer available.`}]}})}Wa(),O(),mr(),Se(),N();var Yu=`# Dream: Memory Consolidation (manual run)
|
|
649
649
|
|
|
650
650
|
You are performing a manual dream — a reflective pass over your memory files. Unlike the automatic background dream, this run has full tool permissions and the user is watching. Synthesize what you've learned recently into durable, well-organized memories so that future sessions can orient quickly.
|
|
651
651
|
|
|
652
|
-
`;function
|
|
653
|
-
`,
|
|
654
|
-
|
|
655
|
-
`,
|
|
652
|
+
`;function Xu(){P({name:`dream`,description:`Manually trigger memory consolidation — review, organize, and prune your auto-memory files.`,whenToUse:`Use when the user says /dream or wants to manually consolidate memories, organize memory files, or clean up stale entries.`,userInvocable:!0,isEnabled:()=>Ua(),async getPromptForCommand(e){let t=Ka(),n=Xi(Ye());await Tn();let r=Yu+hi(t,n,``);return e&&(r+=`\n\n## Additional context from user\n\n${e}`),[{type:`text`,text:r}]}})}var Zu=`# CLI
|
|
653
|
+
`,Qu=`# Server
|
|
654
|
+
`,$u=`# Skill
|
|
655
|
+
`,ed={"examples/cli.md":Zu,"examples/server.md":Qu};N();var{frontmatter:td,content:nd}=St($u),rd=typeof td.description==`string`?td.description:`Verify a code change does what it should by running the app.`;function id(){process.env.USER_TYPE===`ant`&&P({name:`verify`,description:rd,userInvocable:!0,files:ed,async getPromptForCommand(e){let t=[nd.trimStart()];return e&&t.push(`## User Request\n\n${e}`),[{type:`text`,text:t.join(`
|
|
656
656
|
|
|
657
|
-
`)}]}})}var
|
|
658
|
-
`)}function
|
|
659
|
-
`)}`}async function
|
|
657
|
+
`)}]}})}var ad=i({registerScheduleRemoteAgentsSkill:()=>pd});function od(e){if(!e.startsWith(`mcpsrv_`))return null;let t=e.slice(7).slice(2),n=0n;for(let e of t){let t=md.indexOf(e);if(t===-1)return null;n=n*58n+BigInt(t)}let r=n.toString(16).padStart(32,`0`);return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20,32)}`}function sd(e){let t=[];for(let n of e){if(n.type!==`connected`||n.config.type!==`claudeai-proxy`)continue;let e=od(n.config.id);e&&t.push({uuid:e,name:n.name,url:n.config.url})}return t}function cd(e){return e.replace(/^claude[.\s-]ai[.\s-]/i,``).replace(/[^a-zA-Z0-9_-]/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``)}function ld(e){if(e.length===0)return`No connected MCP connectors found. The user may need to connect servers at https://claude.ai/settings/connectors`;let t=[`Connected connectors (available for triggers):`];for(let n of e){let e=cd(n.name);t.push(`- ${n.name} (connector_uuid: ${n.uuid}, name: ${e}, url: ${n.url})`)}return t.join(`
|
|
658
|
+
`)}function ud(e){return`⚠ Heads-up:\n${e.map(e=>`- ${e}`).join(`
|
|
659
|
+
`)}`}async function dd(){let e=await lo();if(!e)return null;let t=ic(e);return t?`https://${t.host}/${t.owner}/${t.name}`:null}function fd(e){let{userTimezone:t,connectorsInfo:n,gitRepoUrl:r,environmentsInfo:i,createdEnvironment:a,setupNotes:o,needsGitHubAccessReminder:s,userArgs:c}=e,l=c&&o.length>0?`\n## Setup Notes\n\n${ud(o)}\n`:``,u=o.length>0?`${ud(o)}\n\n${hd}`:hd;return`# Schedule Remote Agents
|
|
660
660
|
|
|
661
661
|
You are helping the user schedule, update, list, or run **remote** Work Mate agents. These are NOT local cron jobs — each trigger spawns a fully isolated remote session (CCR) in cloud infrastructure on a cron schedule. The agent runs in a sandboxed environment with its own git checkout, tools, and optional MCP connections.
|
|
662
662
|
|
|
663
663
|
## First Step
|
|
664
664
|
|
|
665
|
-
${c?`The user has already told you what they want (see User Request at the bottom). Skip the initial question and go directly to the matching workflow.`:`Your FIRST action must be a single ${
|
|
665
|
+
${c?`The user has already told you what they want (see User Request at the bottom). Skip the initial question and go directly to the matching workflow.`:`Your FIRST action must be a single ${ks} tool call (no preamble). Use this EXACT string for the \`question\` field — do not paraphrase or shorten it:
|
|
666
666
|
|
|
667
|
-
${
|
|
667
|
+
${ya(u)}
|
|
668
668
|
|
|
669
669
|
Set \`header: "Action"\` and offer the four actions (create/list/update/run) as options. After the user picks, follow the matching workflow below.`}
|
|
670
670
|
${l}
|
|
671
671
|
|
|
672
672
|
## What You Can Do
|
|
673
673
|
|
|
674
|
-
Use the \`${
|
|
674
|
+
Use the \`${gt}\` tool (load it first with \`SearchExtraTools select:${gt}\`; auth is handled in-process — do not use curl):
|
|
675
675
|
|
|
676
676
|
- \`{action: "list"}\` — list all triggers
|
|
677
677
|
- \`{action: "get", trigger_id: "..."}\` — fetch one trigger
|
|
@@ -778,7 +778,7 @@ Minimum interval is 1 hour. \`*/30 * * * *\` will be rejected.
|
|
|
778
778
|
4. **Choose the model** — Default to \`claude-sonnet-4-6\`. Tell the user which model you're defaulting to and ask if they want a different one.
|
|
779
779
|
5. **Validate connections** — Infer what services the agent will need from the user's description. For example, if they say "check Datadog and Slack me errors," the agent needs both Datadog and Slack MCP connectors. Cross-reference with the connectors list above. If any are missing, warn the user and link them to https://claude.ai/settings/connectors to connect first.${r?` The default git repo is already set to \`${r}\`. Ask the user if this is the right repo or if they need a different one.`:` Ask which git repos the remote agent needs cloned into its environment.`}
|
|
780
780
|
6. **Review and confirm** — Show the full configuration before creating. Let them adjust.
|
|
781
|
-
7. **Create it** \u2014 Call \`${
|
|
781
|
+
7. **Create it** \u2014 Call \`${gt}\` with \`action: "create"\` and show the result. The response includes the trigger ID. Always output a link at the end: \`https://claude.ai/code/scheduled/{TRIGGER_ID}\`
|
|
782
782
|
|
|
783
783
|
### UPDATE a trigger:
|
|
784
784
|
|
|
@@ -807,8 +807,8 @@ Minimum interval is 1 hour. \`*/30 * * * *\` will be rejected.
|
|
|
807
807
|
- The prompt is the most important part — spend time getting it right. The remote agent starts with zero context, so the prompt must be self-contained.
|
|
808
808
|
- To delete a trigger, direct users to https://claude.ai/code/scheduled
|
|
809
809
|
${s?`- If the user's request seems to require GitHub repo access (e.g. cloning a repo, opening PRs, reading code), remind them that they need the Claude GitHub App installed on the repo — otherwise the remote agent won't be able to access it.`:``}
|
|
810
|
-
${c?`\n## User Request\n\nThe user said: "${c}"\n\nStart by understanding their intent and working through the appropriate workflow above.`:``}`}function
|
|
811
|
-
`),createdEnvironment:r,setupNotes:i,needsGitHubAccessReminder:a,userArgs:e})}]}})}var
|
|
810
|
+
${c?`\n## User Request\n\nThe user said: "${c}"\n\nStart by understanding their intent and working through the appropriate workflow above.`:``}`}function pd(){P({name:`schedule`,description:`Create, update, list, or run scheduled remote agents (triggers) that execute on a cron schedule.`,whenToUse:`When the user wants to schedule a recurring remote agent, set up automated tasks, create a cron job for Work Mate, or manage their scheduled agents/triggers.`,userInvocable:!0,isEnabled:()=>!1,allowedTools:[gt,ks],async getPromptForCommand(e,t){if(!Uo()?.accessToken)return[{type:`text`,text:`You need to authenticate with a claude.ai account first. API accounts are not supported.`}];let n;try{n=await xr()}catch(e){return I(`[schedule] Failed to fetch environments: ${e}`,{level:`warn`}),[{type:`text`,text:`We're having trouble connecting with your remote claude.ai account to set up a scheduled task. Please try /schedule again in a few minutes.`}]}let r=null;if(n.length===0)try{r=await et(`claude-code-default`),n=[r]}catch(e){return I(`[schedule] Failed to create environment: ${e}`,{level:`warn`}),[{type:`text`,text:`No remote environments found, and we could not create one automatically. Visit https://claude.ai/code to set one up, then run /schedule again.`}]}let i=[],a=!1,o=await ac();if(o===null)i.push(`Not in a git repo — you'll need to specify a repo URL manually (or skip repos entirely).`);else if(o.host===`github.com`){let{hasAccess:e}=await Zn(o.owner,o.name);if(!e){a=!0;let e=`Claude GitHub App not installed on ${o.owner}/${o.name} \u2014 install at https://claude.ai/code/onboarding?magic=github-app-setup if your trigger needs this repo.`;i.push(e)}}let s=sd(t.options.mcpClients);s.length===0&&i.push(`No MCP connectors — connect at https://claude.ai/settings/connectors if needed.`);let c=Intl.DateTimeFormat().resolvedOptions().timeZone,l=ld(s),u=await dd(),d=[`Available environments:`];for(let e of n)d.push(`- ${e.name} (id: ${e.environment_id}, kind: ${e.kind})`);return[{type:`text`,text:fd({userTimezone:c,connectorsInfo:l,gitRepoUrl:u,environmentsInfo:d.join(`
|
|
811
|
+
`),createdEnvironment:r,setupNotes:i,needsGitHubAccessReminder:a,userArgs:e})}]}})}var md,hd,gd=n((()=>{Ci(),Fs(),on(),Io(),_n(),ua(),nc(),so(),oa(),ji(),N(),md=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,hd=`What would you like to do with scheduled remote agents?`}));function _d(){Nu(),id(),fu(),Lu(),Uu(),Ru(),Bu(),lu(),Gu(),qu(),Ju(),Xu();{let{registerScheduleRemoteAgentsSkill:t}=(gd(),e(ad));t()}}rr(),ai(),oi();async function vd(){if(!await go(`gh`))return`not_installed`;let{exitCode:e}=await fo(`gh`,[`auth`,`token`],{stdout:`ignore`,stderr:`ignore`,timeout:5e3,reject:!1});return e===0?`authenticated`:`not_authenticated`}Er(),wt(),Hi(),W(),Nr();async function yd(e,t){let n=await zt(e),r=vr(t);for(let e of n)e.type===`prompt`&&G(`tengu_skill_loaded`,{_PROTO_skill_name:e.name,skill_source:e.source,skill_loaded_from:e.loadedFrom,skill_budget:r,...e.kind&&{skill_kind:e.kind}})}Xn(),W(),ot(),mt(),f(),oa();function bd(e){e.command(`add <name> <commandOrUrl> [args...]`).description(`Add an MCP server to Work Mate.
|
|
812
812
|
|
|
813
813
|
Examples:
|
|
814
814
|
# Add HTTP server:
|
|
@@ -821,39 +821,42 @@ Examples:
|
|
|
821
821
|
claude mcp add -e API_KEY=xxx my-server -- npx my-mcp-server
|
|
822
822
|
|
|
823
823
|
# Add stdio server with subprocess flags:
|
|
824
|
-
claude mcp add my-server -- my-command --some-flag arg1`).option(`-s, --scope <scope>`,`Configuration scope (local, user, or project)`,`local`).option(`-t, --transport <transport>`,`Transport type (stdio, sse, http). Defaults to stdio if not specified.`).option(`-e, --env <env...>`,`Set environment variables (e.g. -e KEY=value)`).option(`-H, --header <header...>`,`Set WebSocket headers (e.g. -H "X-Api-Key: abc123" -H "X-Custom: value")`).option(`--client-id <clientId>`,`OAuth client ID for HTTP/SSE servers`).option(`--client-secret`,`Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)`).option(`--callback-port <port>`,`Fixed port for OAuth callback (for servers requiring pre-registered redirect URIs)`).helpOption(`-h, --help`,`Display help for command`).addOption(new J(`--xaa`,`Enable XAA (SEP-990) for this server. Requires 'claude mcp xaa setup' first. Also requires --client-id and --client-secret (for the MCP server's AS).`).hideHelp(!
|
|
824
|
+
claude mcp add my-server -- my-command --some-flag arg1`).option(`-s, --scope <scope>`,`Configuration scope (local, user, or project)`,`local`).option(`-t, --transport <transport>`,`Transport type (stdio, sse, http). Defaults to stdio if not specified.`).option(`-e, --env <env...>`,`Set environment variables (e.g. -e KEY=value)`).option(`-H, --header <header...>`,`Set WebSocket headers (e.g. -H "X-Api-Key: abc123" -H "X-Custom: value")`).option(`--client-id <clientId>`,`OAuth client ID for HTTP/SSE servers`).option(`--client-secret`,`Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)`).option(`--callback-port <port>`,`Fixed port for OAuth callback (for servers requiring pre-registered redirect URIs)`).helpOption(`-h, --help`,`Display help for command`).addOption(new J(`--xaa`,`Enable XAA (SEP-990) for this server. Requires 'claude mcp xaa setup' first. Also requires --client-id and --client-secret (for the MCP server's AS).`).hideHelp(!Mi())).action(async(e,t,n,r)=>{let i=t,a=n;e?i||q(`Error: Command is required when server name is provided.
|
|
825
825
|
Usage: claude mcp add <name> <command> [args...]`):q(`Error: Server name is required.
|
|
826
|
-
Usage: claude mcp add <name> <command> [args...]`);try{let t=
|
|
827
|
-
`),!s&&c&&(process.stderr.write(`\nWarning: The command "${i}" looks like a URL, but is being interpreted as a stdio server as --transport was not specified.\n`),process.stderr.write(`If this is an HTTP server, use: claude mcp add --transport http ${e} ${i}\n`),process.stderr.write(`If this is an SSE server, use: claude mcp add --transport sse ${e} ${i}\n`)),await j(e,{type:`stdio`,command:i,args:a,env:u(r.env)},t),process.stdout.write(`Added stdio MCP server ${e} with command: ${i} ${a.join(` `)} to ${t} config\n`);Bc(`File modified: ${hi(t)}`)}catch(e){q(e.message)}})}wi(),Ta(),L();function Rd(e){let t=e.command(`xaa`).description(`Manage the XAA (SEP-990) IdP connection`);t.command(`setup`).description(`Configure the IdP connection (one-time setup for all XAA-enabled servers)`).requiredOption(`--issuer <url>`,`IdP issuer URL (OIDC discovery)`).requiredOption(`--client-id <id>`,`Work Mate's client_id at the IdP`).option(`--client-secret`,`Read IdP client secret from MCP_XAA_IDP_CLIENT_SECRET env var`).option(`--callback-port <port>`,`Fixed loopback callback port (only if IdP does not honor RFC 8252 port-any matching)`).action(e=>{let t;try{t=new URL(e.issuer)}catch{return q(`Error: --issuer must be a valid URL (got "${e.issuer}")`)}if(t.protocol!==`https:`&&!(t.protocol===`http:`&&(t.hostname===`localhost`||t.hostname===`127.0.0.1`||t.hostname===`[::1]`)))return q(`Error: --issuer must use https:// (got "${t.protocol}//${t.host}")`);let n=e.callbackPort?parseInt(e.callbackPort,10):void 0;if(n!==void 0&&(!Number.isInteger(n)||n<=0))return q(`Error: --callback-port must be a positive integer`);let r=e.clientSecret?process.env.MCP_XAA_IDP_CLIENT_SECRET:void 0;if(e.clientSecret&&!r)return q(`Error: --client-secret requires MCP_XAA_IDP_CLIENT_SECRET env var`);let i=mr(),a=i?.issuer,o=i?.clientId,{error:s}=R(`userSettings`,{xaaIdp:{issuer:e.issuer,clientId:e.clientId,callbackPort:n}});if(s)return q(`Error writing settings: ${s.message}`);if(a&&(ui(a)===ui(e.issuer)?o!==e.clientId&&(Kn(a),In(a)):(Kn(a),In(a))),r){let{success:t,warning:n}=Or(e.issuer,r);if(!t)return q(`Error: settings written but keychain save failed${n?` — ${n}`:``}. Re-run with --client-secret once keychain is available.`)}Bc(`XAA IdP connection configured for ${e.issuer}`)}),t.command(`login`).description(`Cache an IdP id_token so XAA-enabled MCP servers authenticate silently. Default: run the OIDC browser login. With --id-token: write a pre-obtained JWT directly (used by conformance/e2e tests where the mock IdP does not serve /authorize).`).option(`--force`,`Ignore any cached id_token and re-login (useful after IdP-side revocation)`).option(`--id-token <jwt>`,`Write this pre-obtained id_token directly to cache, skipping the OIDC browser login`).action(async e=>{let t=mr();if(!t)return q(`Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.`);if(e.idToken){let n=tr(t.issuer,e.idToken);return Bc(`id_token cached for ${t.issuer} (expires ${new Date(n).toISOString()})`)}if(e.force&&Kn(t.issuer),dn(t.issuer)!==void 0)return Bc(`Already logged in to ${t.issuer} (cached id_token still valid). Use --force to re-login.`);process.stdout.write(`Opening browser for IdP login at ${t.issuer}…\n`);try{await Bn({idpIssuer:t.issuer,idpClientId:t.clientId,idpClientSecret:at(t.issuer),callbackPort:t.callbackPort,onAuthorizationUrl:e=>{process.stdout.write(`If the browser did not open, visit:\n ${e}\n`)}}),Bc(`Logged in. MCP servers with --xaa will now authenticate silently.`)}catch(e){q(`IdP login failed: ${F(e)}`)}}),t.command(`show`).description(`Show the current IdP connection config`).action(()=>{let e=mr();if(!e)return Bc(`No XAA IdP connection configured.`);let t=at(e.issuer)!==void 0,n=dn(e.issuer)!==void 0;process.stdout.write(`Issuer: ${e.issuer}\n`),process.stdout.write(`Client ID: ${e.clientId}\n`),e.callbackPort!==void 0&&process.stdout.write(`Callback port: ${e.callbackPort}\n`),process.stdout.write(`Client secret: ${t?`(stored in keychain)`:`(not set — PKCE-only)`}\n`),process.stdout.write(`Logged in: ${n?`yes (id_token cached)`:`no — run 'claude mcp xaa login'`}\n`),Bc()}),t.command(`clear`).description(`Clear the IdP connection config and cached id_token`).action(()=>{let e=mr(),{error:t}=R(`userSettings`,{xaaIdp:void 0});if(t)return q(`Error writing settings: ${t.message}`);e&&(Kn(e.issuer),In(e.issuer)),Bc(`XAA IdP connection cleared`)})}Xn();function zd(e,t=process.argv){for(let n=0;n<t.length;n++){let r=t[n];if(r?.startsWith(`${e}=`))return r.slice(e.length+1);if(r===e&&n+1<t.length)return t[n+1]}}ni(),Wt(),Qt(),W(),V(),xo(),L();function Bd(){if(B().bypassPermissionsModeAccepted)try{Pa()||R(`userSettings`,{skipDangerousModePermissionPrompt:!0}),G(`tengu_migrate_bypass_permissions_accepted`,{}),z(e=>{if(!(`bypassPermissionsModeAccepted`in e))return e;let{bypassPermissionsModeAccepted:t,...n}=e;return n})}catch(e){U(Error(`Failed to migrate bypass permissions accepted: ${e}`))}}W(),V(),xo(),L();function Vd(){let e=to(),t=e.enableAllProjectMcpServers!==void 0,n=e.enabledMcpjsonServers&&e.enabledMcpjsonServers.length>0,r=e.disabledMcpjsonServers&&e.disabledMcpjsonServers.length>0;if(!(!t&&!n&&!r))try{let i=ja(`localSettings`)||{},a={},o=[];if(t&&i.enableAllProjectMcpServers===void 0?(a.enableAllProjectMcpServers=e.enableAllProjectMcpServers,o.push(`enableAllProjectMcpServers`)):t&&o.push(`enableAllProjectMcpServers`),n&&e.enabledMcpjsonServers){let t=i.enabledMcpjsonServers||[];a.enabledMcpjsonServers=[...new Set([...t,...e.enabledMcpjsonServers])],o.push(`enabledMcpjsonServers`)}if(r&&e.disabledMcpjsonServers){let t=i.disabledMcpjsonServers||[];a.disabledMcpjsonServers=[...new Set([...t,...e.disabledMcpjsonServers])],o.push(`disabledMcpjsonServers`)}Object.keys(a).length>0&&R(`localSettings`,a),(o.includes(`enableAllProjectMcpServers`)||o.includes(`enabledMcpjsonServers`)||o.includes(`disabledMcpjsonServers`))&&ao(e=>{let{enableAllProjectMcpServers:t,enabledMcpjsonServers:n,disabledMcpjsonServers:r,...i}=e;return i}),G(`tengu_migrate_mcp_approval_fields_success`,{migratedCount:o.length})}catch(e){U(e),G(`tengu_migrate_mcp_approval_fields_error`,{})}}L();function Hd(){if(process.env.USER_TYPE!==`ant`)return;let e=ja(`userSettings`)?.model;typeof e==`string`&&(e.startsWith(`fennec-latest[1m]`)?R(`userSettings`,{model:`opus[1m]`}):e.startsWith(`fennec-latest`)?R(`userSettings`,{model:`opus`}):(e.startsWith(`fennec-fast-latest`)||e.startsWith(`opus-4-5-fast`))&&R(`userSettings`,{model:`opus[1m]`,fastMode:!0}))}W(),V(),Os(),L();function Ud(){if(Qo()!==`firstParty`||!Ds())return;let e=ja(`userSettings`)?.model;e!==`claude-opus-4-20250514`&&e!==`claude-opus-4-1-20250805`&&e!==`claude-opus-4-0`&&e!==`claude-opus-4-1`||(R(`userSettings`,{model:`opus`}),z(e=>({...e,legacyOpusMigrationTimestamp:Date.now()})),G(`tengu_legacy_opus_migration`,{from_model:e}))}W(),as();function Wd(){cs()&&G(`tengu_opus_to_opus1m_migration`,{skipped:!0})}V();function Gd(){z(e=>{let t=e.replBridgeEnabled;if(t===void 0||e.remoteControlAtStartup!==void 0)return e;let n={...e,remoteControlAtStartup:!!t};return delete n.replBridgeEnabled,n})}S(),V(),L();function Kd(){B().sonnet1m45MigrationComplete||(ja(`userSettings`)?.model===`sonnet[1m]`&&R(`userSettings`,{model:`sonnet-4-5-20250929[1m]`}),Fe()===`sonnet[1m]`&&Ne(`sonnet-4-5-20250929[1m]`),z(e=>({...e,sonnet1m45MigrationComplete:!0})))}W(),Uo(),V(),Os(),L();function qd(){if(Qo()!==`firstParty`||!Ho()&&!ns()&&!ds())return;let e=ja(`userSettings`)?.model;if(e!==`claude-sonnet-4-5-20250929`&&e!==`claude-sonnet-4-5-20250929[1m]`&&e!==`sonnet-4-5-20250929`&&e!==`sonnet-4-5-20250929[1m]`)return;let t=e.endsWith(`[1m]`);R(`userSettings`,{model:t?`sonnet[1m]`:`sonnet`}),B().numStartups>1&&z(e=>({...e,sonnet45To46MigrationTimestamp:Date.now()})),G(`tengu_sonnet45_to_46_migration`,{from_model:e,has_1m:t})}W(),V(),xo(),L();function Jd(){if(!B().hasResetAutoModeOptInForDefaultOffer&&Ni()===`enabled`)try{let e=ja(`userSettings`);e?.skipAutoPermissionPrompt&&e?.permissions?.defaultMode!==`auto`&&(R(`userSettings`,{skipAutoPermissionPrompt:void 0}),G(`tengu_migrate_reset_auto_opt_in_for_default_offer`,{})),z(e=>e.hasResetAutoModeOptInForDefaultOffer?e:{...e,hasResetAutoModeOptInForDefaultOffer:!0})}catch(e){U(Error(`Failed to reset auto mode opt-in: ${e}`))}}W(),Uo(),V(),Os(),L();function Yd(){if(!B().opusProMigrationComplete){if(Qo()!==`firstParty`||!Ho()){z(e=>({...e,opusProMigrationComplete:!0})),G(`tengu_reset_pro_to_opus_default`,{skipped:!0});return}if(Na()?.model===void 0){let e=Date.now();z(t=>({...t,opusProMigrationComplete:!0,opusProMigrationTimestamp:e})),G(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!1})}else z(e=>({...e,opusProMigrationComplete:!0})),G(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!0})}}b(),Ce();var Xd=xe(()=>he({session_id:y(),ws_url:y(),work_dir:y().optional()}));Ta(),da();var Zd=class extends Error{constructor(e){super(e),this.name=`DirectConnectError`}};async function Qd({serverUrl:e,authToken:t,cwd:n,dangerouslySkipPermissions:r}){let i={"content-type":`application/json`};t&&(i.authorization=`Bearer ${t}`);let a;try{a=await fetch(`${e}/sessions`,{method:`POST`,headers:i,body:wa({cwd:n,...r&&{dangerously_skip_permissions:!0}})})}catch(t){throw new Zd(`Failed to connect to server at ${e}: ${F(t)}`)}if(!a.ok)throw new Zd(`Failed to create session: ${a.status} ${a.statusText}`);let o=Xd().safeParse(await a.json());if(!o.success)throw new Zd(`Invalid session response: ${o.error.message}`);let s=o.data;return{config:{serverUrl:e,sessionId:s.session_id,wsUrl:s.ws_url,authToken:t},workDir:s.work_dir}}var $d=i({isKairosEnabled:()=>ef});async function ef(){return!1}var tf=n((()=>{}));No(),Io(),Vi(),an(),Uo(),V(),Gc(),O(),To(),da(),W(),S(),fn(),de(),Hc(),f(),lo(),xo(),as(),mt(),Fr(),L(),D(),Qi(),wi(),ya(),ha(),Ta(),it(),Mi(),mo(),kc(),Li(),Sc(),wt(),K(`main_tsx_entry`),Ra(),As();var nf=(Dc(),e(Oc)),rf=(tf(),e($d)),af=(hn(),e(Ut));K(`main_tsx_imports_loaded`);function of(){try{let e=ja(`policySettings`);if(e){let t=Ia(e);G(`tengu_managed_settings_loaded`,{keyCount:t.length,keys:t.join(`,`)})}}catch{}}function sf(){let e=Wo(Ee()??ys());Id(oa(),es(e,Ye())),_i().then(({enabled:e,errors:t})=>{let n=Zn();lr(e,n,Qr()),bi(t,n)}).catch(e=>U(e))}function cf(){let e={};return process.env.NODE_EXTRA_CA_CERTS&&(e.has_node_extra_ca_certs=!0),process.env.CLAUDE_CODE_CLIENT_CERT&&(e.has_client_cert=!0),c(`--use-system-ca`)&&(e.has_use_system_ca=!0),c(`--use-openssl-ca`)&&(e.has_use_openssl_ca=!0),e}async function lf(){if(xc())return;let[e,t,n]=await Promise.all([uo(),fo(),Fd()]);G(`tengu_startup_telemetry`,{is_git:e,worktree_count:t,gh_auth_status:n,sandbox_enabled:ki.isSandboxingEnabled(),are_unsandboxed_commands_allowed:ki.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:ki.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:Za(),prefers_reduced_motion:za().prefersReducedMotion??!1,...cf()})}var uf=11;function df(){B().migrationVersion!==uf&&(Bd(),Vd(),Yd(),Kd(),Ud(),qd(),Wd(),Gd(),Jd(),process.env.USER_TYPE===`ant`&&Hd(),z(e=>e.migrationVersion===uf?e:{...e,migrationVersion:uf})),Ac().catch(()=>{})}function ff(){if(tt()){H(`info`,`prefetch_system_context_non_interactive`),yn();return}eo()?(H(`info`,`prefetch_system_context_has_trust`),yn()):H(`info`,`prefetch_system_context_skipped_no_trust`)}function pf(){d(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||p()||(bc(),ht(),ff(),sl(),d(process.env.CLAUDE_CODE_USE_BEDROCK)&&!d(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&hs(),d(process.env.CLAUDE_CODE_USE_VERTEX)&&!d(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&os(),ec(oa(),AbortSignal.timeout(3e3),[]),rs(),Pi.initialize(),p()||Xc.initialize(),process.env.USER_TYPE===`ant`&&import(`./eventLoopStallDetector-Cg_RXU1q.js`).then(e=>e.startEventLoopStallDetector()))}function mf(e){try{let t=e.trim(),n=t.startsWith(`{`)&&t.endsWith(`}`),r;if(n)ko(t)||(process.stderr.write(v.red(`Error: Invalid JSON provided to --settings
|
|
828
|
-
`)),process.exit(1)),r=
|
|
829
|
-
`),
|
|
826
|
+
Usage: claude mcp add <name> <command> [args...]`);try{let t=Dr(r.scope),n=tr(r.transport);r.xaa&&!Mi()&&q(`Error: --xaa requires CLAUDE_CODE_ENABLE_XAA=1 in your environment`);let o=!!r.xaa;if(o){let e=[];r.clientId||e.push(`--client-id`),r.clientSecret||e.push(`--client-secret`),hr()||e.push(`'claude mcp xaa setup' (settings.xaaIdp not configured)`),e.length&&q(`Error: --xaa requires: ${e.join(`, `)}`)}let s=r.transport!==void 0,c=i.startsWith(`http://`)||i.startsWith(`https://`)||i.startsWith(`localhost`)||i.endsWith(`/sse`)||i.endsWith(`/mcp`);if(G(`tengu_mcp_add`,{type:n,scope:t,source:`command`,transport:n,transportExplicit:s,looksLikeUrl:c}),n===`sse`){i||q(`Error: URL is required for SSE transport.`);let n=r.header?qr(r.header):void 0,a=r.callbackPort?parseInt(r.callbackPort,10):void 0,s=r.clientId||a||o?{...r.clientId?{clientId:r.clientId}:{},...a?{callbackPort:a}:{},...o?{xaa:!0}:{}}:void 0,c=r.clientSecret&&r.clientId?await br():void 0,l={type:`sse`,url:i,headers:n,oauth:s};await T(e,l,t),c&&ii(e,l,c),process.stdout.write(`Added SSE MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${ya(n,null,2)}\n`)}else if(n===`http`){i||q(`Error: URL is required for HTTP transport.`);let n=r.header?qr(r.header):void 0,a=r.callbackPort?parseInt(r.callbackPort,10):void 0,s=r.clientId||a||o?{...r.clientId?{clientId:r.clientId}:{},...a?{callbackPort:a}:{},...o?{xaa:!0}:{}}:void 0,c=r.clientSecret&&r.clientId?await br():void 0,l={type:`http`,url:i,headers:n,oauth:s};await T(e,l,t),c&&ii(e,l,c),process.stdout.write(`Added HTTP MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${ya(n,null,2)}\n`)}else(r.clientId||r.clientSecret||r.callbackPort||r.xaa)&&process.stderr.write(`Warning: --client-id, --client-secret, --callback-port, and --xaa are only supported for HTTP/SSE transports and will be ignored for stdio.
|
|
827
|
+
`),!s&&c&&(process.stderr.write(`\nWarning: The command "${i}" looks like a URL, but is being interpreted as a stdio server as --transport was not specified.\n`),process.stderr.write(`If this is an HTTP server, use: claude mcp add --transport http ${e} ${i}\n`),process.stderr.write(`If this is an SSE server, use: claude mcp add --transport sse ${e} ${i}\n`)),await T(e,{type:`stdio`,command:i,args:a,env:u(r.env)},t),process.stdout.write(`Added stdio MCP server ${e} with command: ${i} ${a.join(` `)} to ${t} config\n`);Tc(`File modified: ${Mr(t)}`)}catch(e){q(e.message)}})}ei(),ba(),L();function xd(e){let t=e.command(`xaa`).description(`Manage the XAA (SEP-990) IdP connection`);t.command(`setup`).description(`Configure the IdP connection (one-time setup for all XAA-enabled servers)`).requiredOption(`--issuer <url>`,`IdP issuer URL (OIDC discovery)`).requiredOption(`--client-id <id>`,`Work Mate's client_id at the IdP`).option(`--client-secret`,`Read IdP client secret from MCP_XAA_IDP_CLIENT_SECRET env var`).option(`--callback-port <port>`,`Fixed loopback callback port (only if IdP does not honor RFC 8252 port-any matching)`).action(e=>{let t;try{t=new URL(e.issuer)}catch{return q(`Error: --issuer must be a valid URL (got "${e.issuer}")`)}if(t.protocol!==`https:`&&!(t.protocol===`http:`&&(t.hostname===`localhost`||t.hostname===`127.0.0.1`||t.hostname===`[::1]`)))return q(`Error: --issuer must use https:// (got "${t.protocol}//${t.host}")`);let n=e.callbackPort?parseInt(e.callbackPort,10):void 0;if(n!==void 0&&(!Number.isInteger(n)||n<=0))return q(`Error: --callback-port must be a positive integer`);let r=e.clientSecret?process.env.MCP_XAA_IDP_CLIENT_SECRET:void 0;if(e.clientSecret&&!r)return q(`Error: --client-secret requires MCP_XAA_IDP_CLIENT_SECRET env var`);let i=hr(),a=i?.issuer,o=i?.clientId,{error:s}=R(`userSettings`,{xaaIdp:{issuer:e.issuer,clientId:e.clientId,callbackPort:n}});if(s)return q(`Error writing settings: ${s.message}`);if(a&&(_r(a)===_r(e.issuer)?o!==e.clientId&&(or(a),Rr(a)):(or(a),Rr(a))),r){let{success:t,warning:n}=Tr(e.issuer,r);if(!t)return q(`Error: settings written but keychain save failed${n?` — ${n}`:``}. Re-run with --client-secret once keychain is available.`)}Tc(`XAA IdP connection configured for ${e.issuer}`)}),t.command(`login`).description(`Cache an IdP id_token so XAA-enabled MCP servers authenticate silently. Default: run the OIDC browser login. With --id-token: write a pre-obtained JWT directly (used by conformance/e2e tests where the mock IdP does not serve /authorize).`).option(`--force`,`Ignore any cached id_token and re-login (useful after IdP-side revocation)`).option(`--id-token <jwt>`,`Write this pre-obtained id_token directly to cache, skipping the OIDC browser login`).action(async e=>{let t=hr();if(!t)return q(`Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.`);if(e.idToken){let n=fi(t.issuer,e.idToken);return Tc(`id_token cached for ${t.issuer} (expires ${new Date(n).toISOString()})`)}if(e.force&&or(t.issuer),si(t.issuer)!==void 0)return Tc(`Already logged in to ${t.issuer} (cached id_token still valid). Use --force to re-login.`);process.stdout.write(`Opening browser for IdP login at ${t.issuer}…\n`);try{await Si({idpIssuer:t.issuer,idpClientId:t.clientId,idpClientSecret:Ei(t.issuer),callbackPort:t.callbackPort,onAuthorizationUrl:e=>{process.stdout.write(`If the browser did not open, visit:\n ${e}\n`)}}),Tc(`Logged in. MCP servers with --xaa will now authenticate silently.`)}catch(e){q(`IdP login failed: ${F(e)}`)}}),t.command(`show`).description(`Show the current IdP connection config`).action(()=>{let e=hr();if(!e)return Tc(`No XAA IdP connection configured.`);let t=Ei(e.issuer)!==void 0,n=si(e.issuer)!==void 0;process.stdout.write(`Issuer: ${e.issuer}\n`),process.stdout.write(`Client ID: ${e.clientId}\n`),e.callbackPort!==void 0&&process.stdout.write(`Callback port: ${e.callbackPort}\n`),process.stdout.write(`Client secret: ${t?`(stored in keychain)`:`(not set — PKCE-only)`}\n`),process.stdout.write(`Logged in: ${n?`yes (id_token cached)`:`no — run 'claude mcp xaa login'`}\n`),Tc()}),t.command(`clear`).description(`Clear the IdP connection config and cached id_token`).action(()=>{let e=hr(),{error:t}=R(`userSettings`,{xaaIdp:void 0});if(t)return q(`Error writing settings: ${t.message}`);e&&(or(e.issuer),Rr(e.issuer)),Tc(`XAA IdP connection cleared`)})}Fr();function Sd(e,t=process.argv){for(let n=0;n<t.length;n++){let r=t[n];if(r?.startsWith(`${e}=`))return r.slice(e.length+1);if(r===e&&n+1<t.length)return t[n+1]}}On(),Gr(),Yn(),W(),V(),ho(),L();function Cd(){if(B().bypassPermissionsModeAccepted)try{ja()||R(`userSettings`,{skipDangerousModePermissionPrompt:!0}),G(`tengu_migrate_bypass_permissions_accepted`,{}),z(e=>{if(!(`bypassPermissionsModeAccepted`in e))return e;let{bypassPermissionsModeAccepted:t,...n}=e;return n})}catch(e){U(Error(`Failed to migrate bypass permissions accepted: ${e}`))}}W(),V(),ho(),L();function wd(){let e=Ya(),t=e.enableAllProjectMcpServers!==void 0,n=e.enabledMcpjsonServers&&e.enabledMcpjsonServers.length>0,r=e.disabledMcpjsonServers&&e.disabledMcpjsonServers.length>0;if(!(!t&&!n&&!r))try{let i=Oa(`localSettings`)||{},a={},o=[];if(t&&i.enableAllProjectMcpServers===void 0?(a.enableAllProjectMcpServers=e.enableAllProjectMcpServers,o.push(`enableAllProjectMcpServers`)):t&&o.push(`enableAllProjectMcpServers`),n&&e.enabledMcpjsonServers){let t=i.enabledMcpjsonServers||[];a.enabledMcpjsonServers=[...new Set([...t,...e.enabledMcpjsonServers])],o.push(`enabledMcpjsonServers`)}if(r&&e.disabledMcpjsonServers){let t=i.disabledMcpjsonServers||[];a.disabledMcpjsonServers=[...new Set([...t,...e.disabledMcpjsonServers])],o.push(`disabledMcpjsonServers`)}Object.keys(a).length>0&&R(`localSettings`,a),(o.includes(`enableAllProjectMcpServers`)||o.includes(`enabledMcpjsonServers`)||o.includes(`disabledMcpjsonServers`))&&$a(e=>{let{enableAllProjectMcpServers:t,enabledMcpjsonServers:n,disabledMcpjsonServers:r,...i}=e;return i}),G(`tengu_migrate_mcp_approval_fields_success`,{migratedCount:o.length})}catch(e){U(e),G(`tengu_migrate_mcp_approval_fields_error`,{})}}L();function Td(){if(process.env.USER_TYPE!==`ant`)return;let e=Oa(`userSettings`)?.model;typeof e==`string`&&(e.startsWith(`fennec-latest[1m]`)?R(`userSettings`,{model:`opus[1m]`}):e.startsWith(`fennec-latest`)?R(`userSettings`,{model:`opus`}):(e.startsWith(`fennec-fast-latest`)||e.startsWith(`opus-4-5-fast`))&&R(`userSettings`,{model:`opus[1m]`,fastMode:!0}))}W(),V(),ts(),L();function Ed(){if(ys()!==`firstParty`||!vs())return;let e=Oa(`userSettings`)?.model;e!==`claude-opus-4-20250514`&&e!==`claude-opus-4-1-20250805`&&e!==`claude-opus-4-0`&&e!==`claude-opus-4-1`||(R(`userSettings`,{model:`opus`}),z(e=>({...e,legacyOpusMigrationTimestamp:Date.now()})),G(`tengu_legacy_opus_migration`,{from_model:e}))}W(),Zo();function Dd(){es()&&G(`tengu_opus_to_opus1m_migration`,{skipped:!0})}V();function Od(){z(e=>{let t=e.replBridgeEnabled;if(t===void 0||e.remoteControlAtStartup!==void 0)return e;let n={...e,remoteControlAtStartup:!!t};return delete n.replBridgeEnabled,n})}Se(),V(),L();function kd(){B().sonnet1m45MigrationComplete||(Oa(`userSettings`)?.model===`sonnet[1m]`&&R(`userSettings`,{model:`sonnet-4-5-20250929[1m]`}),je()===`sonnet[1m]`&&Ae(`sonnet-4-5-20250929[1m]`),z(e=>({...e,sonnet1m45MigrationComplete:!0})))}W(),Io(),V(),ts(),L();function Ad(){if(ys()!==`firstParty`||!Fo()&&!Jo()&&!rs())return;let e=Oa(`userSettings`)?.model;if(e!==`claude-sonnet-4-5-20250929`&&e!==`claude-sonnet-4-5-20250929[1m]`&&e!==`sonnet-4-5-20250929`&&e!==`sonnet-4-5-20250929[1m]`)return;let t=e.endsWith(`[1m]`);R(`userSettings`,{model:t?`sonnet[1m]`:`sonnet`}),B().numStartups>1&&z(e=>({...e,sonnet45To46MigrationTimestamp:Date.now()})),G(`tengu_sonnet45_to_46_migration`,{from_model:e,has_1m:t})}W(),V(),ho(),L();function jd(){if(!B().hasResetAutoModeOptInForDefaultOffer&&Ni()===`enabled`)try{let e=Oa(`userSettings`);e?.skipAutoPermissionPrompt&&e?.permissions?.defaultMode!==`auto`&&(R(`userSettings`,{skipAutoPermissionPrompt:void 0}),G(`tengu_migrate_reset_auto_opt_in_for_default_offer`,{})),z(e=>e.hasResetAutoModeOptInForDefaultOffer?e:{...e,hasResetAutoModeOptInForDefaultOffer:!0})}catch(e){U(Error(`Failed to reset auto mode opt-in: ${e}`))}}W(),Io(),V(),ts(),L();function Md(){if(!B().opusProMigrationComplete){if(ys()!==`firstParty`||!Fo()){z(e=>({...e,opusProMigrationComplete:!0})),G(`tengu_reset_pro_to_opus_default`,{skipped:!0});return}if(Aa()?.model===void 0){let e=Date.now();z(t=>({...t,opusProMigrationComplete:!0,opusProMigrationTimestamp:e})),G(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!1})}else z(e=>({...e,opusProMigrationComplete:!0})),G(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!0})}}be(),xe();var Nd=ye(()=>S({session_id:x(),ws_url:x(),work_dir:x().optional()}));ba(),oa();var Pd=class extends Error{constructor(e){super(e),this.name=`DirectConnectError`}};async function Fd({serverUrl:e,authToken:t,cwd:n,dangerouslySkipPermissions:r}){let i={"content-type":`application/json`};t&&(i.authorization=`Bearer ${t}`);let a;try{a=await fetch(`${e}/sessions`,{method:`POST`,headers:i,body:ya({cwd:n,...r&&{dangerously_skip_permissions:!0}})})}catch(t){throw new Pd(`Failed to connect to server at ${e}: ${F(t)}`)}if(!a.ok)throw new Pd(`Failed to create session: ${a.status} ${a.statusText}`);let o=Nd().safeParse(await a.json());if(!o.success)throw new Pd(`Invalid session response: ${o.error.message}`);let s=o.data;return{config:{serverUrl:e,sessionId:s.session_id,wsUrl:s.ws_url,authToken:t},workDir:s.work_dir}}Eo(),Ao(),D(),Ci(),Io(),V(),Ac(),Sr(),yo(),oa(),W(),Se(),Jn(),le(),Dc(),f(),so(),ho(),Zo(),dt(),Wr(),L(),ot(),mt(),ei(),ma(),ua(),ba(),k(),qi(),ro(),sc(),Fn(),pc(),xt(),K(`main_tsx_entry`),Pa(),bs();var Id=(di(),e(lr));K(`main_tsx_imports_loaded`);function Ld(){try{let e=Oa(`policySettings`);if(e){let t=Ma(e);G(`tengu_managed_settings_loaded`,{keyCount:t.length,keys:t.join(`,`)})}}catch{}}function Rd(){let e=Lo(Te()??ds());yd(ta(),qo(e,Ie())),Qr().then(({enabled:e,errors:t})=>{let n=M();qt(e,n,Fi()),Ft(t,n)}).catch(e=>U(e))}function zd(){let e={};return process.env.NODE_EXTRA_CA_CERTS&&(e.has_node_extra_ca_certs=!0),process.env.CLAUDE_CODE_CLIENT_CERT&&(e.has_client_cert=!0),c(`--use-system-ca`)&&(e.has_use_system_ca=!0),c(`--use-openssl-ca`)&&(e.has_use_openssl_ca=!0),e}async function Bd(){if(fc())return;let[e,t,n]=await Promise.all([oo(),io(),vd()]);G(`tengu_startup_telemetry`,{is_git:e,worktree_count:t,gh_auth_status:n,sandbox_enabled:xn.isSandboxingEnabled(),are_unsandboxed_commands_allowed:xn.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:xn.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:Ga(),prefers_reduced_motion:Fa().prefersReducedMotion??!1,...zd()})}var Vd=11;function Hd(){B().migrationVersion!==Vd&&(Cd(),wd(),Md(),kd(),Ed(),Ad(),Dd(),Od(),jd(),process.env.USER_TYPE===`ant`&&Td(),z(e=>e.migrationVersion===Vd?e:{...e,migrationVersion:Vd}))}function Ud(){if(Qe()){H(`info`,`prefetch_system_context_non_interactive`),mn();return}Ja()?(H(`info`,`prefetch_system_context_has_trust`),mn()):H(`info`,`prefetch_system_context_skipped_no_trust`)}function Wd(){d(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||p()||(dc(),Tt(),Ud(),qc(),d(process.env.CLAUDE_CODE_USE_BEDROCK)&&!d(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&os(),d(process.env.CLAUDE_CODE_USE_VERTEX)&&!d(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&Qo(),Zs(ta(),AbortSignal.timeout(3e3),[]),Yo(),tt.initialize(),p()||Fc.initialize(),process.env.USER_TYPE===`ant`&&import(`./eventLoopStallDetector-Cg_RXU1q.js`).then(e=>e.startEventLoopStallDetector()))}function Gd(e){try{let t=e.trim(),n=t.startsWith(`{`)&&t.endsWith(`}`),r;if(n)Co(t)||(process.stderr.write(b.red(`Error: Invalid JSON provided to --settings
|
|
828
|
+
`)),process.exit(1)),r=Bn(`claude-settings`,`.json`,{contentHash:t}),ra(r,t,`utf8`);else{let{resolvedPath:t}=la(da(),e);try{$c(t,`utf8`)}catch(e){throw sa(e)&&(process.stderr.write(b.red(`Error: Settings file not found: ${t}\n`)),process.exit(1)),e}r=t}Oe(r),C()}catch(e){e instanceof Error&&U(e),process.stderr.write(b.red(`Error processing settings: ${F(e)}\n`)),process.exit(1)}}function Kd(e){try{Re(Ra(e)),C()}catch(e){e instanceof Error&&U(e),process.stderr.write(b.red(`Error processing --setting-sources: ${F(e)}\n`)),process.exit(1)}}function qd(){K(`eagerLoadSettings_start`);let e=Sd(`--settings`);e&&Gd(e);let t=Sd(`--setting-sources`);t!==void 0&&Kd(t),K(`eagerLoadSettings_end`)}function Jd(e){if(process.env.CLAUDE_CODE_ENTRYPOINT)return;let t=process.argv.slice(2),n=t.indexOf(`mcp`);if(n!==-1&&t[n+1]===`serve`){process.env.CLAUDE_CODE_ENTRYPOINT=`mcp`;return}if(d(process.env.CLAUDE_CODE_ACTION)){process.env.CLAUDE_CODE_ENTRYPOINT=`claude-code-github-action`;return}process.env.CLAUDE_CODE_ENTRYPOINT=e?`sdk-cli`:`cli`}var Q={url:void 0,authToken:void 0,dangerouslySkipPermissions:!1},$={host:void 0,cwd:void 0,permissionMode:void 0,dangerouslySkipPermissions:!1,local:!1,extraCliArgs:[],remoteBin:void 0};async function Yd(){K(`main_function_start`),process.env.NoDefaultCurrentDirectoryInExePath=`1`,zl(),process.on(`exit`,()=>{ef();try{let{peekWorkflowService:t}=(Yi(),e(pr));t()?.shutdown()}catch{}}),process.on(`SIGINT`,()=>{process.argv.includes(`-p`)||process.argv.includes(`--print`)||process.exit(0)}),K(`main_warning_handler_initialized`);{let e=process.argv.slice(2),t=e.findIndex(e=>e.startsWith(`cc://`)||e.startsWith(`cc+unix://`));if(t!==-1&&Q){let n=e[t],{parseConnectUrl:r}=await import(`./parseConnectUrl-BiyKR5-x.js`),i=r(n);if(Q.dangerouslySkipPermissions=e.includes(`--dangerously-skip-permissions`),e.includes(`-p`)||e.includes(`--print`)){let r=e.filter((e,n)=>n!==t),i=r.indexOf(`--dangerously-skip-permissions`);i!==-1&&r.splice(i,1),process.argv=[process.argv[0],process.argv[1],`open`,n,...r]}else{Q.url=i.serverUrl,Q.authToken=i.authToken;let n=e.filter((e,n)=>n!==t),r=n.indexOf(`--dangerously-skip-permissions`);r!==-1&&n.splice(r,1),process.argv=[process.argv[0],process.argv[1],...n]}}}{let e=process.argv.indexOf(`--handle-uri`);if(e!==-1&&process.argv[e+1]){let{enableConfigs:t}=await import(`./config-DpOOllGk.js`);t();let n=process.argv[e+1],{handleDeepLinkUri:r}=await import(`./protocolHandler-RNKkhq91.js`),i=await r(n);process.exit(i)}if(process.platform===`darwin`&&process.env.__CFBundleIdentifier===`com.anthropic.claude-code-url-handler`){let{enableConfigs:e}=await import(`./config-DpOOllGk.js`);e();let{handleUrlSchemeLaunch:t}=await import(`./protocolHandler-RNKkhq91.js`),n=await t();process.exit(n??1)}}if($){let e=process.argv.slice(2);if(e[0]===`ssh`){let t=e.indexOf(`--local`);t!==-1&&($.local=!0,e.splice(t,1));let n=e.indexOf(`--dangerously-skip-permissions`);n!==-1&&($.dangerouslySkipPermissions=!0,e.splice(n,1));let r=e.indexOf(`--permission-mode`);r!==-1&&e[r+1]&&!e[r+1].startsWith(`-`)&&($.permissionMode=e[r+1],e.splice(r,2));let i=e.findIndex(e=>e.startsWith(`--permission-mode=`));i!==-1&&($.permissionMode=e[i].split(`=`)[1],e.splice(i,1));let a=(t,n={})=>{let r=e.indexOf(t);if(r!==-1){$.extraCliArgs.push(n.as??t);let i=e[r+1];n.hasValue&&i&&!i.startsWith(`-`)?($.extraCliArgs.push(i),e.splice(r,2)):e.splice(r,1)}let i=e.findIndex(e=>e.startsWith(`${t}=`));i!==-1&&($.extraCliArgs.push(n.as??t,e[i].slice(t.length+1)),e.splice(i,1))},o=e.indexOf(`--remote-bin`);o!==-1&&e[o+1]&&!e[o+1].startsWith(`-`)&&($.remoteBin=e[o+1],e.splice(o,2));let s=e.findIndex(e=>e.startsWith(`--remote-bin=`));s!==-1&&($.remoteBin=e[s].split(`=`).slice(1).join(`=`),e.splice(s,1)),a(`-c`,{as:`--continue`}),a(`--continue`),a(`--resume`,{hasValue:!0}),a(`--model`,{hasValue:!0})}if(e[0]===`ssh`&&e[1]&&!e[1].startsWith(`-`)){$.host=e[1];let t=2;e[2]&&!e[2].startsWith(`-`)&&($.cwd=e[2],t=3);let n=e.slice(t);if(n.includes(`-p`)||n.includes(`--print`)){process.stderr.write(`Error: headless (-p/--print) mode is not supported with claude ssh
|
|
829
|
+
`),_i(1);return}process.argv=[process.argv[0],process.argv[1],...n]}}let t=process.argv.slice(2),n=t.includes(`-p`)||t.includes(`--print`),r=t.includes(`--init-only`),i=t.some(e=>e.startsWith(`--sdk-url`)),a=d(process.env.CLAUDE_CODE_FORCE_INTERACTIVE),o=n||r||i||!a&&!process.stdout.isTTY;o&&Vc(),w(!o),Jd(o);let s=(()=>{if(d(process.env.GITHUB_ACTIONS))return`github-action`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`sdk-ts`)return`sdk-typescript`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`sdk-py`)return`sdk-python`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`sdk-cli`)return`sdk-cli`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`claude-vscode`)return`claude-vscode`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`)return`local-agent`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`claude-desktop`)return`claude-desktop`;let e=process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN||process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;return process.env.CLAUDE_CODE_ENTRYPOINT===`remote`||e?`remote`:`cli`})();Xe(s);let c=process.env.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT;c===`markdown`||c===`html`?Je(c):!s.startsWith(`sdk-`)&&s!==`claude-desktop`&&s!==`local-agent`&&s!==`remote`&&Je(`markdown`),process.env.CLAUDE_CODE_ENVIRONMENT_KIND===`bridge`&&qe(`remote-control`),K(`main_client_type_determined`),qd(),K(`main_before_run`),await Zd(),K(`main_after_run`)}async function Xd(e,t){if(!process.stdin.isTTY&&!process.argv.includes(`mcp`)){if(t===`stream-json`)return process.stdin;process.stdin.setEncoding(`utf8`);let n=``,r=e=>{n+=e};process.stdin.on(`data`,r);let i=await no(process.stdin,3e3);return process.stdin.off(`data`,r),i&&process.stderr.write(`Warning: no stdin data received in 3s, proceeding without it. If piping from a slow command, redirect stdin explicitly: < /dev/null to skip, or wait longer.
|
|
830
830
|
`),[e,n].filter(Boolean).join(`
|
|
831
|
-
`)}return e}async function xf(){K(`run_function_start`);function t(){let e=e=>e.long?.replace(/^--/,``)??e.short?.replace(/^-/,``)??``;return Object.assign({sortSubcommands:!0,sortOptions:!0},{compareOptions:(t,n)=>e(t).localeCompare(e(n))})}let n=new Ml().configureHelp(t()).enablePositionalOptions();K(`run_commander_initialized`),n.hook(`preAction`,async e=>{K(`preAction_start`),await Promise.all([ka(),Ms()]),K(`preAction_after_mdm`),await Vl(),K(`preAction_after_init`),d(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)||(process.title=`claude`);let{initSinks:t}=await import(`./sinks-FevoYQqP.js`);t(),K(`preAction_after_sinks`);let n=e.getOptionValue(`pluginDir`);Array.isArray(n)&&n.length>0&&n.every(e=>typeof e==`string`)&&(Ve(n),Oi(`preAction: --plugin-dir inline plugins`)),df(),K(`preAction_after_migrations`),Pc(),mn(),K(`preAction_after_remote_settings`),K(`preAction_after_settings_sync`)}),n.name(`claude`).description(`Work Mate - starts an interactive session by default, use -p/--print for non-interactive output`).argument(`[prompt]`,`Your prompt`,String).helpOption(`-h, --help`,`Display help for command`).option(`-d, --debug [filter]`,`Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")`,e=>!0).addOption(new J(`--debug-to-stderr`,`Enable debug mode (to stderr)`).argParser(Boolean).hideHelp()).option(`--debug-file <path>`,`Write debug logs to a specific file path (implicitly enables debug mode)`,()=>!0).option(`--verbose`,`Override verbose mode setting from config`,()=>!0).option(`-p, --print`,`Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when Claude is run with the -p mode. Only use this flag in directories you trust.`,()=>!0).option(`--bare`,`Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Anthropic auth is strictly ANTHROPIC_API_KEY or apiKeyHelper via --settings (OAuth and keychain are never read). 3P providers (Bedrock/Vertex/Foundry) use their own credentials. Skills still resolve via /skill-name. Explicitly provide context via: --system-prompt[-file], --append-system-prompt[-file], --add-dir (CLAUDE.md dirs), --mcp-config, --settings, --agents, --plugin-dir.`,()=>!0).addOption(new J(`--init`,`Run Setup hooks with init trigger, then continue`).hideHelp()).addOption(new J(`--init-only`,`Run Setup and SessionStart:startup hooks, then exit`).hideHelp()).addOption(new J(`--maintenance`,`Run Setup hooks with maintenance trigger, then continue`).hideHelp()).addOption(new J(`--output-format <format>`,`Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming)`).choices([`text`,`json`,`stream-json`])).addOption(new J(`--json-schema <schema>`,`JSON Schema for structured output validation. Example: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}`).argParser(String)).option(`--include-hook-events`,`Include all hook lifecycle events in the output stream (only works with --output-format=stream-json)`,()=>!0).option(`--include-partial-messages`,`Include partial message chunks as they arrive (only works with --print and --output-format=stream-json)`,()=>!0).addOption(new J(`--input-format <format>`,`Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input)`).choices([`text`,`stream-json`])).option(`--mcp-debug`,`[DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP server errors)`,()=>!0).option(`--dangerously-skip-permissions`,`Bypass all permission checks. Recommended only for sandboxes with no internet access.`,()=>!0).option(`--allow-dangerously-skip-permissions`,`Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.`,()=>!0).addOption(new J(`--thinking <mode>`,`Thinking mode: enabled (equivalent to adaptive), disabled`).choices([`enabled`,`adaptive`,`disabled`]).hideHelp()).addOption(new J(`--max-thinking-tokens <tokens>`,`[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)`).argParser(Number).hideHelp()).addOption(new J(`--max-turns <turns>`,`Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)`).argParser(Number).hideHelp()).addOption(new J(`--max-budget-usd <amount>`,`Maximum dollar amount to spend on API calls (only works with --print)`).argParser(e=>{let t=Number(e);if(isNaN(t)||t<=0)throw Error(`--max-budget-usd must be a positive number greater than 0`);return t})).addOption(new J(`--task-budget <tokens>`,`API-side task budget in tokens (output_config.task_budget)`).argParser(e=>{let t=Number(e);if(isNaN(t)||t<=0||!Number.isInteger(t))throw Error(`--task-budget must be a positive integer`);return t}).hideHelp()).option(`--replay-user-messages`,`Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)`,()=>!0).addOption(new J(`--enable-auth-status`,`Enable auth status messages in SDK mode`).default(!1).hideHelp()).option(`--allowedTools, --allowed-tools <tools...>`,`Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")`).option(`--tools <tools...>`,`Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").`).option(`--disallowedTools, --disallowed-tools <tools...>`,`Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")`).option(`--mcp-config <configs...>`,`Load MCP servers from JSON files or strings (space-separated)`).addOption(new J(`--permission-prompt-tool <tool>`,`MCP tool to use for permission prompts (only works with --print)`).argParser(String).hideHelp()).addOption(new J(`--system-prompt <prompt>`,`System prompt to use for the session`).argParser(String)).addOption(new J(`--system-prompt-file <file>`,`Read system prompt from a file`).argParser(String).hideHelp()).addOption(new J(`--append-system-prompt <prompt>`,`Append a system prompt to the default system prompt`).argParser(String)).addOption(new J(`--append-system-prompt-file <file>`,`Read system prompt from a file and append to the default system prompt`).argParser(String).hideHelp()).addOption(new J(`--permission-mode <mode>`,`Permission mode to use for the session`).argParser(String).choices(Vo)).option(`-c, --continue`,`Continue the most recent conversation in the current directory`,()=>!0).option(`-r, --resume [value]`,`Resume a conversation by session ID, or open interactive picker with optional search term`,e=>e||!0).option(`--fork-session`,`When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)`,()=>!0).addOption(new J(`--prefill <text>`,`Pre-fill the prompt input with text without submitting it`).hideHelp()).addOption(new J(`--deep-link-origin`,`Signal that this session was launched from a deep link`).hideHelp()).addOption(new J(`--deep-link-repo <slug>`,`Repo slug the deep link ?repo= parameter resolved to the current cwd`).hideHelp()).addOption(new J(`--deep-link-last-fetch <ms>`,`FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline`).argParser(e=>{let t=Number(e);return Number.isFinite(t)?t:void 0}).hideHelp()).option(`--from-pr [value]`,`Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term`,e=>e||!0).option(`--no-session-persistence`,`Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)`).addOption(new J(`--resume-session-at <message id>`,`When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)`).argParser(String).hideHelp()).addOption(new J(`--rewind-files <user-message-id>`,`Restore files to state at the specified user message and exit (requires --resume)`).hideHelp()).option(`--model <model>`,`Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-6').`).option(`--agent <agent>`,`Agent for the current session. Overrides the 'agent' setting.`).option(`--betas <betas...>`,`Beta headers to include in API requests (API key users only)`).option(`--fallback-model <model>`,`Enable automatic fallback to specified model when default model is overloaded (only works with --print)`).addOption(new J(`--workload <tag>`,`Workload tag for billing-header attribution (cc_workload). Process-scoped; set by SDK daemon callers that spawn subprocesses for cron work. (only works with --print)`).hideHelp()).option(`--settings <file-or-json>`,`Path to a settings JSON file or a JSON string to load additional settings from`).option(`--add-dir <directories...>`,`Additional directories to allow tool access to`).option(`--ide`,`Automatically connect to IDE on startup if exactly one valid IDE is available`,()=>!0).option(`--strict-mcp-config`,`Only use MCP servers from --mcp-config, ignoring all other MCP configurations`,()=>!0).option(`--session-id <uuid>`,`Use a specific session ID for the conversation (must be a valid UUID)`).option(`-n, --name <name>`,`Set a display name for this session (shown in /resume and terminal title)`).option(`--agents <json>`,`JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option(`--setting-sources <sources>`,`Comma-separated list of setting sources to load (user, project, local).`).option(`--plugin-dir <path>`,`Load plugins from a directory for this session only (repeatable: --plugin-dir A --plugin-dir B)`,(e,t)=>[...t,e],[]).option(`--disable-slash-commands`,`Disable all skills`,()=>!0).option(`--chrome`,`Enable Claude in Chrome integration`).option(`--no-chrome`,`Disable Claude in Chrome integration`).option(`--file <specs...>`,`File resources to download at startup. Format: file_id:relative_path (e.g., --file file_abc:doc.txt file_def:img.png)`).action(async(t,n)=>{K(`action_handler_start`),n.bare&&(process.env.CLAUDE_CODE_SIMPLE=`1`),t===`code`&&(G(`tengu_code_prompt_ignored`,{}),console.warn(v.yellow("Tip: You can launch Work Mate with just `claude`")),t=void 0),t&&typeof t==`string`&&!/\s/.test(t)&&t.length>0&&G(`tengu_single_word_prompt`,{length:t.length});let r=!1;if(n.assistant&&nf&&nf.markAssistantForced(),nf&&(nf.isAssistantForced()||n.assistant===!0)&&rf){if(!eo())console.warn(v.yellow(`Assistant mode disabled: directory is not trusted. Accept the trust dialog and restart.`));else if(r=nf.isAssistantForced()||await rf.isKairosEnabled(),r){let e=n;e.brief=!0,je(!0)}}let{debug:i=!1,debugToStderr:a=!1,dangerouslySkipPermissions:o,allowDangerouslySkipPermissions:s=!1,tools:c=[],allowedTools:l=[],disallowedTools:u=[],mcpConfig:f=[],permissionMode:m,addDir:ee=[],fallbackModel:h,betas:te=[],ide:ne=!1,sessionId:re,includeHookEvents:ie,includePartialMessages:ae}=n;n.prefill&&rl(n.prefill);let oe,se=n.agents,ce=n.agent;ce&&(process.env.CLAUDE_CODE_AGENT=ce);let g=n.outputFormat,_=n.inputFormat,le=n.verbose??B().verbose,ue=n.print,de=n.init??!1,fe=n.initOnly??!1,pe=n.maintenance??!1,me=n.disableSlashCommands||!1,he=process.env.USER_TYPE===`ant`&&n.tasks,ge=he?typeof he==`string`?he:ur:void 0;process.env.USER_TYPE===`ant`&&ge&&(process.env.CLAUDE_CODE_TASK_LIST_ID=ge);let y=Tc()?n.worktree:void 0,_e=typeof y==`string`?y:void 0,ve=y!==void 0,ye;if(_e){let e=ft(_e);e!==null&&(ye=e,_e=void 0)}let be=Tc()&&n.tmux===!0;be&&(ve||(process.stderr.write(v.red(`Error: --tmux requires --worktree
|
|
832
|
-
`)),process.exit(1)),
|
|
833
|
-
`)),process.exit(1)),await
|
|
834
|
-
`)),process.exit(1)),!
|
|
835
|
-
`)),process.exit(1)),
|
|
836
|
-
`)),process.exit(1));let t=process.env.CLAUDE_CODE_REMOTE_SESSION_ID||
|
|
837
|
-
`)),process.exit(1));let
|
|
838
|
-
`)),process.exit(1));try{
|
|
839
|
-
`)),process.exit(1));try{
|
|
840
|
-
`);I(`--mcp-config validation failed (${n.length} errors): ${e}`,{level:`error`}),process.stderr.write(`Error: Invalid MCP configuration:\n${e}\n`),process.exit(1)}if(Object.keys(t).length>0){let{allowed:e,blocked:n}=
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
831
|
+
`)}return e}async function Zd(){K(`run_function_start`);function e(){let e=e=>e.long?.replace(/^--/,``)??e.short?.replace(/^-/,``)??``;return Object.assign({sortSubcommands:!0,sortOptions:!0},{compareOptions:(t,n)=>e(t).localeCompare(e(n))})}let t=new _l().configureHelp(e()).enablePositionalOptions();K(`run_commander_initialized`),t.hook(`preAction`,async e=>{K(`preAction_start`),await Promise.all([Ea(),Cs()]),K(`preAction_after_mdm`),await El(),K(`preAction_after_init`),d(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)||(process.title=`claude`);let{initSinks:t}=await import(`./sinks-5G_xhc1Q.js`);t(),K(`preAction_after_sinks`);let n=e.getOptionValue(`pluginDir`);Array.isArray(n)&&n.length>0&&n.every(e=>typeof e==`string`)&&(Ce(n),ft(`preAction: --plugin-dir inline plugins`)),Hd(),K(`preAction_after_migrations`),yc(),Di(),K(`preAction_after_remote_settings`),K(`preAction_after_settings_sync`)}),t.name(`claude`).description(`Work Mate - starts an interactive session by default, use -p/--print for non-interactive output`).argument(`[prompt]`,`Your prompt`,String).helpOption(`-h, --help`,`Display help for command`).option(`-d, --debug [filter]`,`Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")`,e=>!0).addOption(new J(`--debug-to-stderr`,`Enable debug mode (to stderr)`).argParser(Boolean).hideHelp()).option(`--debug-file <path>`,`Write debug logs to a specific file path (implicitly enables debug mode)`,()=>!0).option(`--verbose`,`Override verbose mode setting from config`,()=>!0).option(`-p, --print`,`Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when Claude is run with the -p mode. Only use this flag in directories you trust.`,()=>!0).option(`--bare`,`Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Anthropic auth is strictly ANTHROPIC_API_KEY or apiKeyHelper via --settings (OAuth and keychain are never read). 3P providers (Bedrock/Vertex/Foundry) use their own credentials. Skills still resolve via /skill-name. Explicitly provide context via: --system-prompt[-file], --append-system-prompt[-file], --add-dir (CLAUDE.md dirs), --mcp-config, --settings, --agents, --plugin-dir.`,()=>!0).addOption(new J(`--init`,`Run Setup hooks with init trigger, then continue`).hideHelp()).addOption(new J(`--init-only`,`Run Setup and SessionStart:startup hooks, then exit`).hideHelp()).addOption(new J(`--maintenance`,`Run Setup hooks with maintenance trigger, then continue`).hideHelp()).addOption(new J(`--output-format <format>`,`Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming)`).choices([`text`,`json`,`stream-json`])).addOption(new J(`--json-schema <schema>`,`JSON Schema for structured output validation. Example: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}`).argParser(String)).option(`--include-hook-events`,`Include all hook lifecycle events in the output stream (only works with --output-format=stream-json)`,()=>!0).option(`--include-partial-messages`,`Include partial message chunks as they arrive (only works with --print and --output-format=stream-json)`,()=>!0).addOption(new J(`--input-format <format>`,`Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input)`).choices([`text`,`stream-json`])).option(`--mcp-debug`,`[DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP server errors)`,()=>!0).option(`--dangerously-skip-permissions`,`Bypass all permission checks. Recommended only for sandboxes with no internet access.`,()=>!0).option(`--allow-dangerously-skip-permissions`,`Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.`,()=>!0).addOption(new J(`--thinking <mode>`,`Thinking mode: enabled (equivalent to adaptive), disabled`).choices([`enabled`,`adaptive`,`disabled`]).hideHelp()).addOption(new J(`--max-thinking-tokens <tokens>`,`[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)`).argParser(Number).hideHelp()).addOption(new J(`--max-turns <turns>`,`Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)`).argParser(Number).hideHelp()).addOption(new J(`--max-budget-usd <amount>`,`Maximum dollar amount to spend on API calls (only works with --print)`).argParser(e=>{let t=Number(e);if(isNaN(t)||t<=0)throw Error(`--max-budget-usd must be a positive number greater than 0`);return t})).addOption(new J(`--task-budget <tokens>`,`API-side task budget in tokens (output_config.task_budget)`).argParser(e=>{let t=Number(e);if(isNaN(t)||t<=0||!Number.isInteger(t))throw Error(`--task-budget must be a positive integer`);return t}).hideHelp()).option(`--replay-user-messages`,`Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)`,()=>!0).addOption(new J(`--enable-auth-status`,`Enable auth status messages in SDK mode`).default(!1).hideHelp()).option(`--allowedTools, --allowed-tools <tools...>`,`Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")`).option(`--tools <tools...>`,`Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").`).option(`--disallowedTools, --disallowed-tools <tools...>`,`Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")`).option(`--mcp-config <configs...>`,`Load MCP servers from JSON files or strings (space-separated)`).addOption(new J(`--permission-prompt-tool <tool>`,`MCP tool to use for permission prompts (only works with --print)`).argParser(String).hideHelp()).addOption(new J(`--system-prompt <prompt>`,`System prompt to use for the session`).argParser(String)).addOption(new J(`--system-prompt-file <file>`,`Read system prompt from a file`).argParser(String).hideHelp()).addOption(new J(`--append-system-prompt <prompt>`,`Append a system prompt to the default system prompt`).argParser(String)).addOption(new J(`--append-system-prompt-file <file>`,`Read system prompt from a file and append to the default system prompt`).argParser(String).hideHelp()).addOption(new J(`--permission-mode <mode>`,`Permission mode to use for the session`).argParser(String).choices(Ba)).option(`-c, --continue`,`Continue the most recent conversation in the current directory`,()=>!0).option(`-r, --resume [value]`,`Resume a conversation by session ID, or open interactive picker with optional search term`,e=>e||!0).option(`--fork-session`,`When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)`,()=>!0).addOption(new J(`--prefill <text>`,`Pre-fill the prompt input with text without submitting it`).hideHelp()).addOption(new J(`--deep-link-origin`,`Signal that this session was launched from a deep link`).hideHelp()).addOption(new J(`--deep-link-repo <slug>`,`Repo slug the deep link ?repo= parameter resolved to the current cwd`).hideHelp()).addOption(new J(`--deep-link-last-fetch <ms>`,`FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline`).argParser(e=>{let t=Number(e);return Number.isFinite(t)?t:void 0}).hideHelp()).option(`--from-pr [value]`,`Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term`,e=>e||!0).option(`--no-session-persistence`,`Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)`).addOption(new J(`--resume-session-at <message id>`,`When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)`).argParser(String).hideHelp()).addOption(new J(`--rewind-files <user-message-id>`,`Restore files to state at the specified user message and exit (requires --resume)`).hideHelp()).option(`--model <model>`,`Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-6').`).option(`--agent <agent>`,`Agent for the current session. Overrides the 'agent' setting.`).option(`--betas <betas...>`,`Beta headers to include in API requests (API key users only)`).option(`--fallback-model <model>`,`Enable automatic fallback to specified model when default model is overloaded (only works with --print)`).addOption(new J(`--workload <tag>`,`Workload tag for billing-header attribution (cc_workload). Process-scoped; set by SDK daemon callers that spawn subprocesses for cron work. (only works with --print)`).hideHelp()).option(`--settings <file-or-json>`,`Path to a settings JSON file or a JSON string to load additional settings from`).option(`--add-dir <directories...>`,`Additional directories to allow tool access to`).option(`--ide`,`Automatically connect to IDE on startup if exactly one valid IDE is available`,()=>!0).option(`--strict-mcp-config`,`Only use MCP servers from --mcp-config, ignoring all other MCP configurations`,()=>!0).option(`--session-id <uuid>`,`Use a specific session ID for the conversation (must be a valid UUID)`).option(`-n, --name <name>`,`Set a display name for this session (shown in /resume and terminal title)`).option(`--agents <json>`,`JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option(`--setting-sources <sources>`,`Comma-separated list of setting sources to load (user, project, local).`).option(`--plugin-dir <path>`,`Load plugins from a directory for this session only (repeatable: --plugin-dir A --plugin-dir B)`,(e,t)=>[...t,e],[]).option(`--disable-slash-commands`,`Disable all skills`,()=>!0).option(`--chrome`,`Enable Claude in Chrome integration`).option(`--no-chrome`,`Disable Claude in Chrome integration`).option(`--file <specs...>`,`File resources to download at startup. Format: file_id:relative_path (e.g., --file file_abc:doc.txt file_def:img.png)`).action(async(e,t)=>{K(`action_handler_start`),t.bare&&(process.env.CLAUDE_CODE_SIMPLE=`1`),e===`code`&&(G(`tengu_code_prompt_ignored`,{}),console.warn(b.yellow("Tip: You can launch Work Mate with just `claude`")),e=void 0),e&&typeof e==`string`&&!/\s/.test(e)&&e.length>0&&G(`tengu_single_word_prompt`,{length:e.length});let{debug:n=!1,debugToStderr:r=!1,dangerouslySkipPermissions:i,allowDangerouslySkipPermissions:a=!1,tools:o=[],allowedTools:s=[],disallowedTools:c=[],mcpConfig:l=[],permissionMode:u,addDir:f=[],fallbackModel:m,betas:ee=[],ide:h=!1,sessionId:g,includeHookEvents:te,includePartialMessages:ne}=t;t.prefill&&Hc(t.prefill);let re,ie=t.agents,_=t.agent;_&&(process.env.CLAUDE_CODE_AGENT=_);let v=t.outputFormat,y=t.inputFormat,ae=t.verbose??B().verbose,oe=t.print,se=t.init??!1,ce=t.initOnly??!1,le=t.maintenance??!1,ue=t.disableSlashCommands||!1,de=process.env.USER_TYPE===`ant`&&t.tasks,fe=de?typeof de==`string`?de:It:void 0;process.env.USER_TYPE===`ant`&&fe&&(process.env.CLAUDE_CODE_TASK_LIST_ID=fe);let x=mc()?t.worktree:void 0,pe=typeof x==`string`?x:void 0,me=x!==void 0,he;if(pe){let e=at(pe);e!==null&&(he=e,pe=void 0)}let ge=mc()&&t.tmux===!0;ge&&(me||(process.stderr.write(b.red(`Error: --tmux requires --worktree
|
|
832
|
+
`)),process.exit(1)),vo()===`windows`&&(process.stderr.write(b.red(`Error: --tmux is not supported on Windows
|
|
833
|
+
`)),process.exit(1)),await vt()||(process.stderr.write(b.red(`Error: tmux is not installed.\n${Ui()}\n`)),process.exit(1)));let _e=t.sdkUrl??void 0,ve=ne||d(process.env.CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES);(te||d(process.env.CLAUDE_CODE_REMOTE))&&Qn(!0),_e&&(y||(y=`stream-json`),v||(v=`stream-json`),t.verbose===void 0&&(ae=!0),t.print||(oe=!0));let S=t.teleport??null,ye=t.remote,be=ye===!0?``:ye??null,xe=t.remoteControl??t.rc,Se=typeof xe==`string`&&xe.length>0?xe:void 0;if(g&&((t.continue||t.resume)&&!t.forkSession&&(process.stderr.write(b.red(`Error: --session-id can only be used with --continue or --resume if --fork-session is also specified.
|
|
834
|
+
`)),process.exit(1)),!_e)){let e=rt(g);e||(process.stderr.write(b.red(`Error: Invalid session ID. Must be a valid UUID.
|
|
835
|
+
`)),process.exit(1)),kn(e)&&(process.stderr.write(b.red(`Error: Session ID ${e} is already in use.\n`)),process.exit(1))}let Ce=t.file;if(Ce&&Ce.length>0){let e=Ws();e||(process.stderr.write(b.red(`Error: Session token required for file downloads. CLAUDE_CODE_SESSION_ACCESS_TOKEN must be set.
|
|
836
|
+
`)),process.exit(1));let t=process.env.CLAUDE_CODE_REMOTE_SESSION_ID||He(),n=Cr(Ce);n.length>0&&(re=gn(n,{baseUrl:process.env.ANTHROPIC_BASE_URL||Oo().BASE_API_URL,oauthToken:e,sessionId:t}))}let C=Qe();m&&t.model&&m===t.model&&(process.stderr.write(b.red(`Error: Fallback model cannot be the same as the main model. Please specify a different model for --fallback-model.
|
|
837
|
+
`)),process.exit(1));let we=t.systemPrompt;if(t.systemPromptFile){t.systemPrompt&&(process.stderr.write(b.red(`Error: Cannot use both --system-prompt and --system-prompt-file. Please use only one.
|
|
838
|
+
`)),process.exit(1));try{we=$c(Xc(t.systemPromptFile),`utf8`)}catch(e){ia(e)===`ENOENT`&&(process.stderr.write(b.red(`Error: System prompt file not found: ${Xc(t.systemPromptFile)}\n`)),process.exit(1)),process.stderr.write(b.red(`Error reading system prompt file: ${F(e)}\n`)),process.exit(1)}}let Oe=t.appendSystemPrompt;if(t.appendSystemPromptFile){t.appendSystemPrompt&&(process.stderr.write(b.red(`Error: Cannot use both --append-system-prompt and --append-system-prompt-file. Please use only one.
|
|
839
|
+
`)),process.exit(1));try{Oe=$c(Xc(t.appendSystemPromptFile),`utf8`)}catch(e){ia(e)===`ENOENT`&&(process.stderr.write(b.red(`Error: Append system prompt file not found: ${Xc(t.appendSystemPromptFile)}\n`)),process.exit(1)),process.stderr.write(b.red(`Error reading append system prompt file: ${F(e)}\n`)),process.exit(1)}}let{mode:ke,notification:je}=Li({permissionModeCli:u,dangerouslySkipPermissions:i});ze(ke===`bypassPermissions`),(t.enableAutoMode||u===`auto`||ke===`auto`||!u&&nn())&&Id?.setAutoModeFlagCli(!0);let Pe={};if(l&&l.length>0){let e=l.map(e=>e.trim()).filter(e=>e.length>0),t={},n=[];for(let r of e){let e=null,i=[],a=Co(r);if(a){let t=Ot({configObject:a,filePath:`command line`,expandVars:!0,scope:`dynamic`});t.config?e=t.config.mcpServers:i=t.errors}else{let t=jn({filePath:Xc(r),expandVars:!0,scope:`dynamic`});t.config?e=t.config.mcpServers:i=t.errors}i.length>0?n.push(...i):e&&(t={...t,...e})}if(n.length>0){let e=n.map(e=>`${e.path?e.path+`: `:``}${e.message}`).join(`
|
|
840
|
+
`);I(`--mcp-config validation failed (${n.length} errors): ${e}`,{level:`error`}),process.stderr.write(`Error: Invalid MCP configuration:\n${e}\n`),process.exit(1)}if(Object.keys(t).length>0){let{allowed:e,blocked:n}=cn(Mn(t,e=>({...e,scope:`dynamic`})));n.length>0&&process.stderr.write(`Warning: MCP ${No(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),Pe={...Pe,...e}}}let Ie=t.strictMcpConfig||!1;$t()&&(Ie&&(process.stderr.write(b.red(`You cannot use --strict-mcp-config when an enterprise MCP config is present`)),process.exit(1)),Pe&&!Vr(Pe)&&(process.stderr.write(b.red(`You cannot dynamically configure MCP servers when an enterprise MCP config is present`)),process.exit(1))),We(f);let Re=await En({allowedToolsCli:s,disallowedToolsCli:c,baseToolsCli:o,permissionMode:ke,allowDangerouslySkipPermissions:a,addDirs:f}),w=Re.toolPermissionContext,{warnings:Ve,dangerousPermissions:Ge,overlyBroadBashPermissions:qe}=Re;if(process.env.USER_TYPE===`ant`&&qe.length>0){for(let e of qe)I(`Ignoring overly broad shell permission ${e.ruleDisplay} from ${e.sourceDisplay}`);w=Br(w,qe)}Ge.length>0&&(w=Qt(w)),Ve.forEach(e=>{console.error(e)});let Je=C&&!Ie&&!$t()&&!p()?mi().then(e=>{let{allowed:t,blocked:n}=cn(e);return n.length>0&&process.stderr.write(`Warning: claude.ai MCP ${No(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),t}):Promise.resolve({});I(`[STARTUP] Loading MCP configs...`);let Xe=Date.now(),$e,et=(Ie||p()?Promise.resolve({servers:{}}):Nt(Pe)).then(e=>($e=Date.now()-Xe,e));y&&y!==`text`&&y!==`stream-json`&&(console.error(`Error: Invalid input format "${y}".`),process.exit(1)),y===`stream-json`&&v!==`stream-json`&&(console.error(`Error: --input-format=stream-json requires output-format=stream-json.`),process.exit(1)),_e&&(y!==`stream-json`||v!==`stream-json`)&&(console.error(`Error: --sdk-url requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),t.replayUserMessages&&(y!==`stream-json`||v!==`stream-json`)&&(console.error(`Error: --replay-user-messages requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),ve&&(!C||v!==`stream-json`)&&(eo(`Error: --include-partial-messages requires --print and --output-format=stream-json.`),process.exit(1)),t.sessionPersistence===!1&&!C&&(eo(`Error: --no-session-persistence can only be used with --print mode.`),process.exit(1));let T=await Xd(e||``,y??`text`);K(`action_after_input_prompt`),$d(t);let tt=ri(w);K(`action_tools_loaded`);let it;if(As({isNonInteractiveSession:C})&&t.jsonSchema&&(it=na(t.jsonSchema)),it){let e=Ns(it);`tool`in e?(tt=[...tt,e.tool],G(`tengu_structured_output_enabled`,{schema_property_count:Object.keys(it.properties||{}).length,has_required_fields:!!it.required})):G(`tengu_structured_output_failure`,{error:`Invalid JSON schema`})}K(`action_before_setup`),I(`[STARTUP] Running setup()...`);let ot=Date.now(),{setup:lt}=await import(`./setup-DzC22EkN.js`),ut=ta();process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&_d();let dt=lt(ut,ke,a,me,pe,ge,g?rt(g):void 0,he,void 0),ft=me?null:Rn(ut),mt=me?null:Lr(ut);ft?.catch(()=>{}),mt?.catch(()=>{}),await dt,I(`[STARTUP] setup() completed in ${Date.now()-ot}ms`),K(`action_after_setup`);let ht=!!t.replayUserMessages;Qe()&&(jc(),mn(),Tt(),gs());let gt=t.name?.trim();gt&&Hn(gt);let _t=t.model==="default"?ds():t.model,bt=m==="default"?ds():m,xt=me?ta():ut;I(`[STARTUP] Loading commands and agents...`);let St=Date.now(),[Ct,wt]=await Promise.all([ft??Rn(xt),mt??Lr(xt)]);I(`[STARTUP] Commands and agents loaded in ${Date.now()-St}ms`),K(`action_commands_loaded`);let Et=[];if(ie)try{let e=Co(ie);e&&(Et=wr(e,`flagSettings`))}catch(e){U(e)}let Dt=[...wt.allAgents,...Et],kt={...wt,allAgents:Dt,activeAgents:xi(Dt)},At=_??Fa().agent,E;if(At&&(E=kt.activeAgents.find(e=>e.agentType===At),E||I(`Warning: agent "${At}" not found. Available agents: ${kt.activeAgents.map(e=>e.agentType).join(`, `)}. Using default behavior.`)),Ee(E?.agentType),E&&G(`tengu_agent_flag`,{agentType:Ti(E)?E.agentType:`custom`,..._&&{source:`cli`}}),E?.agentType&&kr(E.agentType),C&&E&&!we&&!Ti(E)){let e=E.getSystemPrompt();e&&(we=e)}E?.initialPrompt&&(typeof T==`string`?T=T?`${E.initialPrompt}\n\n${T}`:E.initialPrompt:T||(T=E.initialPrompt));let jt=_t;!jt&&E?.model&&E.model!==`inherit`&&(jt=Lo(E.model)),Ae(jt),Be(as()||null);let Pt=Te(),Ft=Lo(Pt??ds()),D;if(Kr()){let e=yt()?t.advisor:void 0;e&&(I(`[AdvisorTool] --advisor ${e}`),tn(Ft)||(process.stderr.write(b.red(`Error: The model "${Ft}" does not support the advisor tool.\n`)),process.exit(1)),Zt(Go(Lo(e)))||(process.stderr.write(b.red(`Error: The model "${e}" cannot be used as an advisor.\n`)),process.exit(1))),D=yt()?e??sn():e,D&&I(`[AdvisorTool] Advisor model: ${D}`)}if(t.proactive||d(process.env.CLAUDE_CODE_PROACTIVE)){let e=`
|
|
841
|
+
# Proactive Mode
|
|
842
|
+
|
|
843
|
+
You are in proactive mode. Take initiative — explore, act, and make progress without waiting for instructions.
|
|
844
|
+
|
|
845
|
+
Start by briefly greeting the user.
|
|
846
|
+
|
|
847
|
+
You will receive periodic <tick> prompts. These are check-ins. Do whatever seems most useful, or call Sleep if there's nothing to do. The user will see any text you output.`;Oe=Oe?`${Oe}\n\n${e}`:e}let O,k,A;if(!C){let t=Ql(!1);k=t.getFpsMetrics,A=t.stats,process.env.USER_TYPE===`ant`&&Nc();let{createRoot:n}=await import(`./src-CST_jFnT.js`);O=await n(t.renderOptions),G(`tengu_timer`,{event:`startup`,durationMs:Math.round(process.uptime()*1e3)}),I(`[STARTUP] Running showSetupScreens()...`);let r=Date.now(),i=await Zl(O,ke,a,Ct);I(`[STARTUP] showSetupScreens() completed in ${Date.now()-r}ms`),i&&e?.trim().toLowerCase()===`/login`&&(e=``),i&&(vc(),gr(),lc(),import(`./trustedDevice-CjHQtVkO.js`).then(e=>(e.clearTrustedDeviceToken(),e.enrollTrustedDevice())));let o=await fs();o.valid||await X(O,o.message)}if(process.exitCode!==void 0){I(`Graceful shutdown initiated, skipping further initialization`);return}if(fr(),!C){let{errors:e}=La(),t=e.filter(e=>!e.mcpErrorMetadata);t.length>0&&await $l(O,{settingsErrors:t,onExit:()=>_i(1)})}let Rt=B().startupPrefetchedAt??0;p()?(I(`Skipping startup prefetches, last ran ${Math.round((Date.now()-Rt)/1e3)}s ago`),_s()):(I(`Starting background startup prefetches${Rt>0?` last ran ${Math.round((Date.now()-Rt)/1e3)}s ago`:``}`),zi().catch(e=>U(e)),Nl(),ls()),C||Wc();let{servers:zt}=await et;I(`[STARTUP] MCP configs resolved in ${$e}ms (awaited at +${Date.now()-Xe}ms)`);let Bt={...zt,...Pe},Vt={},Kt={};for(let[e,t]of Object.entries(Bt)){let n=t;n.type===`sdk`?Vt[e]=n:Kt[e]=n}K(`action_mcp_configs_loaded`);let qt=C?Promise.resolve({clients:[],tools:[],commands:[]}):nt(Kt),Yt=C?Promise.resolve({clients:[],tools:[],commands:[]}):Je.then(e=>Object.keys(e).length>0?nt(e):{clients:[],tools:[],commands:[]}),en=Promise.all([qt,Yt]).then(([e,t])=>({clients:[...e.clients,...t.clients],tools:Ut([...e.tools,...t.tools],`name`),commands:Ut([...e.commands,...t.commands],`name`)})),on=ce||se||le||C||t.continue||t.resume?null:Ii(`startup`,{agentType:E?.agentType,model:Ft}),ln=[];en.catch(()=>{});let hn=[],_n=[],vn=[],yn=fn(),M=yn===!1?{type:`disabled`}:{type:`adaptive`};if(t.thinking===`adaptive`||t.thinking===`enabled`)yn=!0,M={type:`adaptive`};else if(t.thinking===`disabled`)yn=!1,M={type:`disabled`};else{let e=process.env.MAX_THINKING_TOKENS?parseInt(process.env.MAX_THINKING_TOKENS,10):t.maxThinkingTokens;e!==void 0&&(e>0?(yn=!0,M={type:`enabled`,budgetTokens:e}):e===0&&(yn=!1,M={type:`disabled`}))}H(`info`,`started`,{version:`0.0.8`,is_native_binary:jo()}),_a(async()=>{H(`info`,`exited`)}),Qd({hasInitialPrompt:!!e,hasStdin:!!T,verbose:ae,debug:n,debugToStderr:r,print:oe??!1,outputFormat:v??`text`,inputFormat:y??`text`,numAllowedTools:s.length,numDisallowedTools:c.length,mcpClientCount:Object.keys(Bt).length,worktreeEnabled:me,skipWebFetchPreflight:Fa().skipWebFetchPreflight,githubActionInputs:process.env.GITHUB_ACTION_INPUTS,dangerouslySkipPermissionsPassed:i??!1,permissionMode:ke,modeIsBypass:ke===`bypassPermissions`,allowDangerouslySkipPermissionsPassed:a,systemPromptFlag:we?t.systemPromptFile?`file`:`flag`:void 0,appendSystemPromptFlag:Oe?t.appendSystemPromptFile?`file`:`flag`:void 0,thinkingConfig:M,assistantActivationPath:void 0}),ui(Kt,w),Or(null,`initialization`),Ld(),dn().then(e=>{e&&(gt&&Gt(gt),Hr().then(e=>{e>=2&&G(`tengu_concurrent_sessions`,{num_sessions:e})}))}),p()||(C?(await In(),K(`action_after_plugins_init`),wn().then(()=>yr())):In().then(async()=>{K(`action_after_plugins_init`),await wn(),yr()}));let bn=ce||se?`init`:le?`maintenance`:null;if(ce){jc(),await Ji(`init`,{forceSyncExecution:!0}),await Ii(`startup`,{forceSyncExecution:!0}),_i(0);return}if(C){(v===`stream-json`||v===`json`)&&va(!0),jc(),Dl();let e=t.continue||t.resume||S||bn?void 0:Ii(`startup`);e?.catch(()=>{}),K(`before_validateForceLoginOrg`);let n=await fs();n.valid||(process.stderr.write(n.message+`
|
|
848
|
+
`),process.exit(1));let r=ue?[]:Ct.filter(e=>e.type===`prompt`&&!e.disableNonInteractive||e.type===`local`&&e.supportsNonInteractive),i=ni(),a=Ht({...i,mcp:{...i.mcp,clients:hn,commands:vn,tools:_n},toolPermissionContext:w,...hs()&&{fastMode:Xo(jt??null)},...Kr()&&D&&{advisorModel:D}},Mc);Mt(w,a.getState().fastMode).then(({updateContext:e})=>{a.setState(t=>{let n=e(t.toolPermissionContext);return n===t.toolPermissionContext?t:{...t,toolPermissionContext:n}})}),t.sessionPersistence===!1&&Ue(!0),Ke(Ro(ee));let o=(e,t)=>Object.keys(e).length===0?Promise.resolve():(a.setState(t=>({...t,mcp:{...t.mcp,clients:[...t.mcp.clients,...Object.entries(e).map(([e,t])=>({name:e,type:`pending`,config:t}))]}})),an(({client:e,tools:t,commands:n})=>{a.setState(r=>({...r,mcp:{...r.mcp,clients:r.mcp.clients.some(t=>t.name===e.name)?r.mcp.clients.map(t=>t.name===e.name?e:t):[...r.mcp.clients,e],tools:Ut([...r.mcp.tools,...t],`name`),commands:Ut([...r.mcp.commands,...n],`name`)}}))},e).catch(e=>I(`[MCP] ${t} connect error: ${e}`)));K(`before_connectMcp`),await o(Kt,`regular`),K(`after_connectMcp`);let c=5e3,l=Je.then(e=>{if(Object.keys(e).length>0){let t=new Set;for(let n of Object.values(e)){let e=Zi(n);e&&t.add(e)}let n=new Set;for(let[e,r]of Object.entries(Kt)){if(!e.startsWith(`plugin:`))continue;let i=Zi(r);i&&t.has(i)&&n.add(e)}if(n.size>0){I(`[MCP] Lazy dedup: suppressing ${n.size} plugin server(s) that duplicate claude.ai connectors: ${[...n].join(`, `)}`);for(let e of a.getState().mcp.clients)!n.has(e.name)||e.type!==`connected`||(e.client.onclose=void 0,Sn(e.name,e.config).catch(()=>{}));a.setState(e=>{let{clients:t,tools:r,commands:i,resources:a}=e.mcp;t=t.filter(e=>!n.has(e.name)),r=r.filter(e=>!e.mcpInfo||!n.has(e.mcpInfo.serverName));for(let e of n)i=Pi(i,e),a=Ki(a,e);return{...e,mcp:{...e.mcp,clients:t,tools:r,commands:i,resources:a}}})}}let{servers:t}=Jt(e,Va(Kt,(e,t)=>!t.startsWith(`plugin:`)));return o(t,`claudeai`)}),u,d=await Promise.race([l.then(()=>!1),new Promise(e=>{u=setTimeout(e=>e(!0),c,e)})]);u&&clearTimeout(u),d&&I(`[MCP] claude.ai connectors not ready after ${c}ms — proceeding; background connection continues`),K(`after_connectMcp_claudeai`),p()||(Wd(),import(`./backgroundHousekeeping-VV1V_Y2Z.js`).then(e=>e.startBackgroundHousekeeping()),process.env.USER_TYPE===`ant`&&import(`./sdkHeapDumpMonitor-WdXUV7DV.js`).then(e=>e.startSdkMemoryMonitor())),Rd(),K(`before_print_import`);let{runHeadless:f}=await import(`./print-gyTOCJzk.js`);K(`after_print_import`),f(T,()=>a.getState(),a.setState,r,tt,Vt,kt.activeAgents,{continue:t.continue,resume:t.resume,verbose:ae,outputFormat:v,jsonSchema:it,permissionPromptToolName:t.permissionPromptTool,allowedTools:s,thinkingConfig:M,maxTurns:t.maxTurns,maxBudgetUsd:t.maxBudgetUsd,taskBudget:t.taskBudget?{total:t.taskBudget}:void 0,systemPrompt:we,appendSystemPrompt:Oe,userSpecifiedModel:jt,fallbackModel:bt,teleport:S,sdkUrl:_e,replayUserMessages:ht,includePartialMessages:ve,forkSession:t.forkSession||!1,resumeSessionAt:t.resumeSessionAt||void 0,rewindFiles:t.rewindFiles,enableAuthStatus:t.enableAuthStatus,agent:_,workload:t.workload,setupTrigger:bn??void 0,sessionStartHooksPromise:e});return}G(`tengu_startup_manual_model_config`,{cli_flag:t.model,env_var:process.env.ANTHROPIC_MODEL,settings_file:(Fa()||{}).model,subscriptionType:Bo(),agent:At});let xn=Kc(Ft),Cn=[];if(je&&Cn.push({key:`permission-mode-notification`,text:je,priority:`high`}),xn&&Cn.push({key:`model-deprecation-warning`,text:xn,color:`warning`,priority:`high`}),qe.length>0){let e=za(qe.map(e=>e.ruleDisplay)),t=e.join(`, `),n=za(qe.map(e=>e.sourceDisplay)).join(`, `),r=e.length;Cn.push({key:`overly-broad-bash-notification`,text:`${t} allow ${No(r,`rule`)} from ${n} ${No(r,`was`,`were`)} ignored \u2014 not available for Ants, please use auto-mode instead`,color:`warning`,priority:`high`})}let Tn={...w},Dn=qa()||!1,On={settings:Fa(),tasks:{},agentNameRegistry:new Map,verbose:ae??B().verbose??!1,mainLoopModel:Pt,mainLoopModelForSession:null,isBriefOnly:!1,expandedView:B().showExpandedTodos?`tasks`:`none`,selectedIPAgentIndex:-1,selectedBgAgentIndex:-1,viewSelectionMode:`none`,footerSelection:null,toolPermissionContext:Tn,agent:E?.agentType,agentDefinitions:kt,mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:0},plugins:{enabled:[],disabled:[],commands:[],errors:[],installationStatus:{marketplaces:[],plugins:[]},needsRefresh:!1},statusLineText:void 0,kairosEnabled:!1,remoteSessionUrl:void 0,remoteConnectionStatus:`connecting`,remoteBackgroundTaskCount:0,replBridgeEnabled:Dn||!1,replBridgeExplicit:!1,replBridgeOutboundOnly:!1,replBridgeConnected:!1,replBridgeSessionActive:!1,replBridgeReconnecting:!1,replBridgeConnectUrl:void 0,replBridgeSessionUrl:void 0,replBridgeEnvironmentId:void 0,replBridgeSessionId:void 0,replBridgeError:void 0,replBridgeInitialName:Se,showRemoteCallout:!1,notifications:{current:null,queue:Cn},elicitation:{queue:[]},todos:{},remoteAgentTaskSuggestions:[],fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},attribution:Ri(),thinkingEnabled:yn,promptSuggestionEnabled:dr(),sessionHooks:new Map,inbox:{messages:[]},promptSuggestion:{text:null,promptId:null,shownAt:0,acceptedAt:0,generationRequestId:null},speculation:pi,speculationSessionTimeSavedMs:0,skillImprovement:{suggestion:null},authVersion:0,initialMessage:T?{message:Wt({content:String(T)})}:null,activeOverlays:new Set,fastMode:Xo(Ft),...Kr()&&D&&{advisorModel:D}};T&&Vi(String(T));let An=_n;z(e=>({...e,numStartups:(e.numStartups??0)+1})),setImmediate(()=>{Bd(),Rd()});let Pn=process.env.USER_TYPE===`ant`?import(`./sessionDataUploader-CaCjwsA2.js`):null,Fn=Pn?Pn.then(e=>e.createSessionTurnUploader()).catch(()=>null):null,Ln={debug:n||r,commands:[...Ct,...vn],initialTools:An,mcpClients:hn,autoConnectIdeFlag:h,mainThreadAgentDefinition:E,disableSlashCommands:ue,dynamicMcpConfig:Pe,strictMcpConfig:Ie,systemPrompt:we,appendSystemPrompt:Oe,taskListId:fe,thinkingConfig:M,...Fn&&{onTurnComplete:e=>{Fn.then(t=>t?.(e))}}},zn={mainThreadAgentDefinition:E,agentDefinitions:kt,currentCwd:xt,cliAgents:Et,initialState:On};if(t.continue){let e=!1;try{let n=performance.now(),{clearSessionCaches:r}=await import(`./caches-BZ59_En6.js`);r();let i=await wi(void 0,void 0);if(!i)return G(`tengu_continue`,{success:!1}),await X(O,`No conversation found to continue`);let a=await Pc(i,{forkSession:!!t.forkSession,includeAttribution:!0,transcriptPath:i.fullPath},zn);a.restoredAgentDef&&(E=a.restoredAgentDef),$d(t),G(`tengu_continue`,{success:!0,resume_duration_ms:Math.round(performance.now()-n)}),e=!0,await Al(O,{getFpsMetrics:k,stats:A,initialState:a.initialState},{...Ln,mainThreadAgentDefinition:a.restoredAgentDef??E,initialMessages:a.messages,initialFileHistorySnapshots:a.fileHistorySnapshots,initialContentReplacements:a.contentReplacements,initialAgentName:a.agentName,initialAgentColor:a.agentColor},Xl)}catch(t){e||G(`tengu_continue`,{success:!1}),U(t),process.exit(1)}}else if(Q?.url){let e;try{let t=await Fd({serverUrl:Q.url,authToken:Q.authToken,cwd:Ye(),dangerouslySkipPermissions:Q.dangerouslySkipPermissions});t.workDir&&(Me(t.workDir),Ne(t.workDir)),Ze(Q.url),e=t.config}catch(e){return await X(O,e instanceof Pd?e.message:String(e),()=>j(1))}let t=un(`Connected to server at ${Q.url}\nSession: ${e.sessionId}`,`info`);await Al(O,{getFpsMetrics:k,stats:A,initialState:On},{debug:n||r,commands:Ct,initialTools:[],initialMessages:[t],mcpClients:[],autoConnectIdeFlag:h,mainThreadAgentDefinition:E,disableSlashCommands:ue,directConnectConfig:e,thinkingConfig:M},Xl);return}else if($?.host){let{createSSHSession:e,createLocalSSHSession:t,SSHSessionError:i}=await import(`./createSSHSession-BmHXA2me.js`),a;try{if($.local)process.stderr.write(`Starting local ssh-proxy test session...
|
|
849
|
+
`),a=await t({cwd:$.cwd,permissionMode:$.permissionMode,dangerouslySkipPermissions:$.dangerouslySkipPermissions});else{process.stderr.write(`Connecting to ${$.host}…\n`);let t=process.stderr.isTTY,n=!1;a=await e({host:$.host,cwd:$.cwd,localVersion:`0.0.8`,permissionMode:$.permissionMode,dangerouslySkipPermissions:$.dangerouslySkipPermissions,extraCliArgs:$.extraCliArgs,remoteBin:$.remoteBin},t?{onProgress:e=>{n=!0,process.stderr.write(`\r ${e}\x1b[K`)}}:{}),n&&process.stderr.write(`
|
|
850
|
+
`)}Me(a.remoteCwd),Ne(a.remoteCwd),Ze($.local?`local`:$.host)}catch(e){return await X(O,e instanceof i?e.message:String(e),()=>j(1))}let o=un($.local?`Local ssh-proxy test session\ncwd: ${a.remoteCwd}\nAuth: unix socket → local proxy`:`SSH session to ${$.host}\nRemote cwd: ${a.remoteCwd}\nAuth: unix socket -R → local proxy`,`info`);await Al(O,{getFpsMetrics:k,stats:A,initialState:On},{debug:n||r,commands:Ct,initialTools:[],initialMessages:[o],mcpClients:[],autoConnectIdeFlag:h,mainThreadAgentDefinition:E,disableSlashCommands:ue,sshSession:a,thinkingConfig:M},Xl);return}else if(t.resume||t.fromPr||S||be!==null){let{clearSessionCaches:e}=await import(`./caches-BZ59_En6.js`);e();let i=null,a,o=rt(t.resume),s,c=null,l;if(t.fromPr&&(t.fromPr===!0?l=!0:typeof t.fromPr==`string`&&(l=t.fromPr)),t.resume&&typeof t.resume==`string`&&!o){let e=t.resume.trim();if(e){let t=await Bi(e,{exact:!0});t.length===1?(c=t[0],o=pt(c)??null):s=e}}if((be!==null||S)&&(await ti(),!sr(`allow_remote_sessions`)))return await X(O,`Error: Remote sessions are disabled by your organization's policy.`,()=>j(1));if(be!==null){let e=be.length>0;if(!e)return await X(O,`Error: --remote requires a description.
|
|
851
|
+
Usage: claude --remote "your task description"`,()=>j(1));G(`tengu_remote_create_session`,{has_initial_prompt:String(e)});let t=await ao(),i=await gi(O,e?be:null,new AbortController().signal,t||void 0);if(!i)return G(`tengu_remote_create_session_error`,{error:`unable_to_create_session`}),await X(O,`Error: Unable to create remote session`,()=>j(1));G(`tengu_remote_create_session_success`,{session_id:i.id}),process.stdout.write(`Created remote session: ${i.title}\n`),process.stdout.write(`View: ${rn(i.id)}?m=0\n`),process.stdout.write(`Resume with: claude --teleport ${i.id}\n`),await j(0),process.exit(0),De(!0),Le(Wi(i.id));let a;try{a=await oc()}catch(e){return U(ca(e)),await X(O,`Error: ${F(e)||`Failed to authenticate`}`,()=>j(1))}let{getClaudeAIOAuthTokens:o}=await import(`./auth-CZzP483s.js`),s=Gc(i.id,()=>o()?.accessToken??a.accessToken,a.orgUUID,e),c=`${rn(i.id)}?m=0`,l=un(`/remote-control is active. Code in CLI or at ${c}`,`info`),u=e?Wt({content:be}):null,d={...On,remoteSessionUrl:c},f=ct(Ct);await Al(O,{getFpsMetrics:k,stats:A,initialState:d},{debug:n||r,commands:f,initialTools:[],initialMessages:u?[l,u]:[l],mcpClients:[],autoConnectIdeFlag:h,mainThreadAgentDefinition:E,disableSlashCommands:ue,remoteSessionConfig:s,thinkingConfig:M},Xl);return}else if(S){if(S===!0||S===``){G(`tengu_teleport_interactive_mode`,{}),I(`selectAndResumeTeleportTask: Starting teleport flow...`);let e=await eu(O);e||(await j(0),process.exit(0));let{branchError:t}=await st(e.branch);i=Nn(e.log,t)}else if(typeof S==`string`){G(`tengu_teleport_resume_session`,{mode:`direct`});try{let e=await qn(await cc(S));if(e.status===`mismatch`||e.status===`not_in_repo`){let t=e.sessionRepo;if(t){let e=await Bc(zc(t));if(e.length>0){let n=await tu(O,{targetRepo:t,initialPaths:e});n?(process.chdir(n),Xt(n),Me(n)):await j(0)}else throw new aa(`You must run claude --teleport ${S} from a checkout of ${t}.`,b.red(`You must run claude --teleport ${S} from a checkout of ${b.bold(t)}.\n`))}}else if(e.status===`error`)throw new aa(e.errorMessage||`Failed to validate session`,b.red(`Error: ${e.errorMessage||`Failed to validate session`}\n`));await Lt();let{teleportWithProgress:t}=await import(`./TeleportProgress-C3qyp5zy.js`),n=await t(O,S);Fe({sessionId:S}),i=n.messages}catch(e){e instanceof aa?process.stderr.write(e.formattedMessage+`
|
|
852
|
+
`):(U(e),process.stderr.write(b.red(`Error: ${F(e)}\n`))),await j(1)}}}if(process.env.USER_TYPE===`ant`&&t.resume&&typeof t.resume==`string`&&!o){let e=Xc(t.resume);try{let n=performance.now(),r;try{r=await Un(e)}catch(e){if(!sa(e))throw e}if(r){let e=await wi(r,void 0);e?(a=await Pc(e,{forkSession:!!t.forkSession,transcriptPath:e.fullPath},zn),a.restoredAgentDef&&(E=a.restoredAgentDef),G(`tengu_session_resumed`,{entrypoint:`file`,success:!0,resume_duration_ms:Math.round(performance.now()-n)})):G(`tengu_session_resumed`,{entrypoint:`file`,success:!1})}}catch(e){G(`tengu_session_resumed`,{entrypoint:`file`,success:!1}),U(e),await X(O,`Unable to load transcript from file: ${t.resume}`,()=>j(1))}}if(o){let e=o;try{let n=performance.now(),r=await wi(c??e,void 0);if(!r)return G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),await X(O,`No conversation found with session ID: ${e}`);let i=c?.fullPath??r.fullPath;a=await Pc(r,{forkSession:!!t.forkSession,sessionIdOverride:e,transcriptPath:i},zn),a.restoredAgentDef&&(E=a.restoredAgentDef),G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!0,resume_duration_ms:Math.round(performance.now()-n)})}catch(t){G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),U(t),await X(O,`Failed to resume session ${e}`)}}if(re)try{let e=await re,t=xa(e,e=>!e.success);t>0&&process.stderr.write(b.yellow(`Warning: ${t}/${e.length} file(s) failed to download.\n`))}catch(e){return await X(O,`Error downloading files: ${F(e)}`)}let u=a??(Array.isArray(i)?{messages:i,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:E,initialState:On,contentReplacements:void 0}:void 0);u?($d(t),await Al(O,{getFpsMetrics:k,stats:A,initialState:u.initialState},{...Ln,mainThreadAgentDefinition:u.restoredAgentDef??E,initialMessages:u.messages,initialFileHistorySnapshots:u.fileHistorySnapshots,initialContentReplacements:u.contentReplacements,initialAgentName:u.agentName,initialAgentColor:u.agentColor},Xl)):await nu(O,{getFpsMetrics:k,stats:A,initialState:On},pn(Ye()),{...Ln,initialSearchQuery:s,forkSession:t.forkSession,filterByPr:l})}else{let e=on&&ln.length===0?on:void 0;K(`action_after_hooks`),$d(t);let n=null;t.deepLinkOrigin?(G(`tengu_deep_link_opened`,{has_prefill:!!t.prefill,has_repo:!!t.deepLinkRepo}),n=un(Uc({cwd:ta(),prefillLength:t.prefill?.length,repo:t.deepLinkRepo,lastFetch:t.deepLinkLastFetch===void 0?void 0:new Date(t.deepLinkLastFetch)}),`warning`)):t.prefill&&(n=un(`Launched with a pre-filled prompt — review it before pressing Enter.`,`warning`));let r=n?[n,...ln]:ln.length>0?ln:void 0;await Al(O,{getFpsMetrics:k,stats:A,initialState:On},{...Ln,initialMessages:r,pendingHookMessages:e},Xl)}}).version(`0.0.8 (Work Mate)`,`-v, --version`,`Output the version number`),t.option(`-w, --worktree [name]`,`Create a new git worktree for this session (optionally specify a name)`),t.option(`--tmux`,`Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.`),yt()&&t.addOption(new J(`--advisor <model>`,`Enable the server-side advisor tool with the specified model (alias or full ID).`).hideHelp()),process.env.USER_TYPE===`ant`&&(t.addOption(new J(`--delegate-permissions`,`[ANT-ONLY] Alias for --permission-mode auto.`).implies({permissionMode:`auto`})),t.addOption(new J(`--dangerously-skip-permissions-with-classifiers`,`[ANT-ONLY] Deprecated alias for --permission-mode auto.`).hideHelp().implies({permissionMode:`auto`})),t.addOption(new J(`--afk`,`[ANT-ONLY] Deprecated alias for --permission-mode auto.`).hideHelp().implies({permissionMode:`auto`})),t.addOption(new J(`--tasks [id]`,`[ANT-ONLY] Tasks mode: watch for tasks and auto-process them. Optional id is used as both the task list ID and agent ID (defaults to "tasklist").`).argParser(String).hideHelp()),t.option(`--agent-teams`,`[ANT-ONLY] Force Claude to use multi-agent mode for solving problems`,()=>!0)),t.addOption(new J(`--enable-auto-mode`,`Opt in to auto mode`).hideHelp()),t.addOption(new J(`--proactive`,`Start in proactive autonomous mode`)),t.addOption(new J(`--sdk-url <url>`,`Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)`).hideHelp()),t.addOption(new J(`--teleport [session]`,`Resume a teleport session, optionally specify session ID`).hideHelp()),t.addOption(new J(`--remote [description]`,`Create a remote session with the given description`).hideHelp()),K(`run_main_options_built`);let n=process.argv.includes(`-p`)||process.argv.includes(`--print`),r=process.argv.some(e=>e.startsWith(`cc://`)||e.startsWith(`cc+unix://`));if(n&&!r)return K(`run_before_parse`),await t.parseAsync(process.argv),K(`run_after_parse`),t;let i=t.command(`mcp`).description(`Configure and manage MCP servers`).configureHelp(e()).enablePositionalOptions();i.command(`serve`).description(`Start the Work Mate MCP server`).option(`-d, --debug`,`Enable debug mode`,()=>!0).option(`--verbose`,`Override verbose mode setting from config`,()=>!0).action(async({debug:e,verbose:t})=>{let{mcpServeHandler:n}=await import(`./mcp-COS5RJFS.js`);await n({debug:e,verbose:t})}),bd(i),Mi()&&xd(i),i.command(`remove <name>`).description(`Remove an MCP server`).option(`-s, --scope <scope>`,`Configuration scope (local, user, or project) - if not specified, removes from whichever scope it exists in`).action(async(e,t)=>{let{mcpRemoveHandler:n}=await import(`./mcp-COS5RJFS.js`);await n(e,t)}),i.command(`list`).description(`List configured MCP servers. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.`).action(async()=>{let{mcpListHandler:e}=await import(`./mcp-COS5RJFS.js`);await e()}),i.command(`get <name>`).description(`Get details about an MCP server. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.`).action(async e=>{let{mcpGetHandler:t}=await import(`./mcp-COS5RJFS.js`);await t(e)}),i.command(`add-json <name> <json>`).description(`Add an MCP server (stdio or SSE) with a JSON string`).option(`-s, --scope <scope>`,`Configuration scope (local, user, or project)`,`local`).option(`--client-secret`,`Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)`).action(async(e,t,n)=>{let{mcpAddJsonHandler:r}=await import(`./mcp-COS5RJFS.js`);await r(e,t,n)}),i.command(`add-from-claude-desktop`).description(`Import MCP servers from Claude Desktop (Mac and WSL only)`).option(`-s, --scope <scope>`,`Configuration scope (local, user, or project)`,`local`).action(async e=>{let{mcpAddFromDesktopHandler:t}=await import(`./mcp-COS5RJFS.js`);await t(e)}),i.command(`reset-project-choices`).description(`Reset all approved and rejected project-scoped (.mcp.json) servers within this project`).action(async()=>{let{mcpResetChoicesHandler:e}=await import(`./mcp-COS5RJFS.js`);await e()}),t.command(`server`).description(`Start a Work Mate session server`).option(`--port <number>`,`HTTP port`,`0`).option(`--host <string>`,`Bind address`,`0.0.0.0`).option(`--auth-token <token>`,`Bearer token for auth`).option(`--unix <path>`,`Listen on a unix domain socket`).option(`--workspace <dir>`,`Default working directory for sessions that do not specify cwd`).option(`--idle-timeout <ms>`,`Idle timeout for detached sessions in ms (0 = never expire)`,`600000`).option(`--max-sessions <n>`,`Maximum concurrent sessions (0 = unlimited)`,`32`).action(async e=>{let{randomBytes:t}=await import(`crypto`),{startServer:n}=await import(`./server-LdbAb0sV.js`),{SessionManager:r}=await import(`./sessionManager-CPa049BO.js`),{DangerousBackend:i}=await import(`./dangerousBackend-DwcP0P08.js`),{printBanner:a}=await import(`./serverBanner-BdExKFHT.js`),{createServerLogger:o}=await import(`./serverLog-BFmvyJ93.js`),{writeServerLock:s,removeServerLock:c,probeRunningServer:l}=await import(`./lockfile-D5-j7HOZ.js`),u=await l();u&&(process.stderr.write(`A claude server is already running (pid ${u.pid}) at ${u.httpUrl}\n`),process.exit(1));let d=e.authToken??`sk-ant-cc-${t(16).toString(`base64url`)}`,f={port:parseInt(e.port,10),host:e.host,authToken:d,unix:e.unix,workspace:e.workspace,idleTimeoutMs:parseInt(e.idleTimeout,10),maxSessions:parseInt(e.maxSessions,10)},p=new r(new i,{idleTimeoutMs:f.idleTimeoutMs,maxSessions:f.maxSessions}),m=n(f,p,o()),ee=m.port??f.port;a(f,d,ee),await s({pid:process.pid,port:ee,host:f.host,httpUrl:f.unix?`unix:${f.unix}`:`http://${f.host}:${ee}`,startedAt:Date.now()});let h=!1,g=async()=>{h||(h=!0,m.stop(!0),await p.destroyAll(),await c(),process.exit(0))};process.once(`SIGINT`,()=>void g()),process.once(`SIGTERM`,()=>void g())}),t.command(`ssh <host> [dir]`).description(`Run Work Mate on a remote host over SSH. Deploys the binary and tunnels API auth back through your local machine — no remote setup needed.`).option(`--permission-mode <mode>`,`Permission mode for the remote session`).option(`--dangerously-skip-permissions`,`Skip all permission prompts on the remote (dangerous)`).option(`--remote-bin <command>`,`Custom remote binary command (skips probe/deploy). Example: --remote-bin 'bun /path/to/project/dist/cli.js'`).option(`--local`,`e2e test mode — spawn the child CLI locally (skip ssh/deploy). Exercises the auth proxy and unix-socket plumbing without a remote host.`).action(async()=>{process.stderr.write(`Usage: claude ssh <user@host | ssh-config-alias> [dir]
|
|
846
853
|
|
|
847
854
|
Runs Work Mate on a remote Linux host. You don't need to install
|
|
848
855
|
anything on the remote — the binary is
|
|
849
856
|
deployed over SSH and API auth tunnels back through your local machine.
|
|
850
|
-
`),process.exit(1)}),
|
|
851
|
-
|
|
852
|
-
Attach the REPL as a viewer client to a running bridge session.
|
|
853
|
-
Omit sessionId to discover and pick from available sessions.
|
|
854
|
-
`),process.exit(1)}),n.command(`doctor`).description(`Check the health of your Work Mate auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.`).action(async()=>{let[{doctorHandler:e},{createRoot:t}]=await Promise.all([import(`./util-8EHwfg4A.js`),import(`./src-CST_jFnT.js`)]);await e(await t(Qc(!1)))}),process.env.USER_TYPE===`ant`&&n.command(`up`).description(`[ANT-ONLY] Initialize or upgrade the local dev environment using the "# claude up" section of the nearest CLAUDE.md`).action(async()=>{let{up:e}=await import(`./up-BHkC97_C.js`);await e()}),process.env.USER_TYPE===`ant`&&n.command(`rollback [target]`).description(`[ANT-ONLY] Roll back to a previous release
|
|
857
|
+
`),process.exit(1)}),t.command(`open <cc-url>`).description(`Connect to a Work Mate server (internal — use cc:// URLs)`).option(`-p, --print [prompt]`,`Print mode (headless)`).option(`--output-format <format>`,`Output format: text, json, stream-json`,`text`).action(async(e,t)=>{let{parseConnectUrl:n}=await import(`./parseConnectUrl-BiyKR5-x.js`),{serverUrl:r,authToken:i}=n(e),a;try{let e=await Fd({serverUrl:r,authToken:i,cwd:Ye(),dangerouslySkipPermissions:Q?.dangerouslySkipPermissions});e.workDir&&(Me(e.workDir),Ne(e.workDir)),Ze(r),a=e.config}catch(e){console.error(e instanceof Pd?e.message:String(e)),process.exit(1)}let{runConnectHeadless:o}=await import(`./connectHeadless-CqRoEtrg.js`),s=typeof t.print==`string`?t.print:``,c=t.print===!0;await o(a,s,t.outputFormat,c)});let a=t.command(`auth`).description(`Manage authentication`).configureHelp(e());a.command(`login`).description(`Sign in`).option(`--email <email>`,`Pre-populate email address on the login page`).option(`--sso`,`Force SSO login flow`).option(`--console`,`Use Console (API usage billing) instead of Claude subscription`).option(`--claudeai`,`Use Claude subscription (default)`).action(async({email:e,sso:t,console:n,claudeai:r})=>{let{authLogin:i}=await import(`./auth-DDSBm_Yj.js`);await i({email:e,sso:t,console:n,claudeai:r})}),a.command(`status`).description(`Show authentication status`).option(`--json`,`Output as JSON (default)`).option(`--text`,`Output as human-readable text`).action(async e=>{let{authStatus:t}=await import(`./auth-DDSBm_Yj.js`);await t(e)});let o=()=>new J(`--cowork`,`Use cowork_plugins directory`).hideHelp(),s=t.command(`plugin`).alias(`plugins`).description(`Manage Work Mate plugins`).configureHelp(e());s.command(`validate <path>`).description(`Validate a plugin or marketplace manifest`).addOption(o()).action(async(e,t)=>{let{pluginValidateHandler:n}=await import(`./plugins-DUKNjLq6.js`);await n(e,t)}),s.command(`list`).description(`List installed plugins`).option(`--json`,`Output as JSON`).option(`--available`,`Include available plugins from marketplaces (requires --json)`).addOption(o()).action(async e=>{let{pluginListHandler:t}=await import(`./plugins-DUKNjLq6.js`);await t(e)});let c=s.command(`marketplace`).description(`Manage Work Mate marketplaces`).configureHelp(e());if(c.command(`add <source>`).description(`Add a marketplace from a URL, path, or GitHub repo`).addOption(o()).option(`--sparse <paths...>`,`Limit checkout to specific directories via git sparse-checkout (for monorepos). Example: --sparse .claude-plugin plugins`).option(`--scope <scope>`,`Where to declare the marketplace: user (default), project, or local`).action(async(e,t)=>{let{marketplaceAddHandler:n}=await import(`./plugins-DUKNjLq6.js`);await n(e,t)}),c.command(`list`).description(`List all configured marketplaces`).option(`--json`,`Output as JSON`).addOption(o()).action(async e=>{let{marketplaceListHandler:t}=await import(`./plugins-DUKNjLq6.js`);await t(e)}),c.command(`remove <name>`).alias(`rm`).description(`Remove a configured marketplace`).addOption(o()).action(async(e,t)=>{let{marketplaceRemoveHandler:n}=await import(`./plugins-DUKNjLq6.js`);await n(e,t)}),c.command(`update [name]`).description(`Update marketplace(s) from their source - updates all if no name specified`).addOption(o()).action(async(e,t)=>{let{marketplaceUpdateHandler:n}=await import(`./plugins-DUKNjLq6.js`);await n(e,t)}),s.command(`install <plugin>`).alias(`i`).description(`Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)`).option(`-s, --scope <scope>`,`Installation scope: user, project, or local`,`user`).addOption(o()).action(async(e,t)=>{let{pluginInstallHandler:n}=await import(`./plugins-DUKNjLq6.js`);await n(e,t)}),s.command(`uninstall <plugin>`).alias(`remove`).alias(`rm`).description(`Uninstall an installed plugin`).option(`-s, --scope <scope>`,`Uninstall from scope: user, project, or local`,`user`).option(`--keep-data`,`Preserve the plugin's persistent data directory (~/.claude/plugins/data/{id}/)`).addOption(o()).action(async(e,t)=>{let{pluginUninstallHandler:n}=await import(`./plugins-DUKNjLq6.js`);await n(e,t)}),s.command(`enable <plugin>`).description(`Enable a disabled plugin`).option(`-s, --scope <scope>`,`Installation scope: ${Oc.join(`, `)} (default: auto-detect)`).addOption(o()).action(async(e,t)=>{let{pluginEnableHandler:n}=await import(`./plugins-DUKNjLq6.js`);await n(e,t)}),s.command(`disable [plugin]`).description(`Disable an enabled plugin`).option(`-a, --all`,`Disable all enabled plugins`).option(`-s, --scope <scope>`,`Installation scope: ${Oc.join(`, `)} (default: auto-detect)`).addOption(o()).action(async(e,t)=>{let{pluginDisableHandler:n}=await import(`./plugins-DUKNjLq6.js`);await n(e,t)}),s.command(`update <plugin>`).description(`Update a plugin to the latest version (restart required to apply)`).option(`-s, --scope <scope>`,`Installation scope: ${Ec.join(`, `)} (default: user)`).addOption(o()).action(async(e,t)=>{let{pluginUpdateHandler:n}=await import(`./plugins-DUKNjLq6.js`);await n(e,t)}),t.command(`setup-token`).description(`Set up a long-lived authentication token (requires Claude subscription)`).action(async()=>{let[{setupTokenHandler:e},{createRoot:t}]=await Promise.all([import(`./util-DDtmyq_r.js`),import(`./src-CST_jFnT.js`)]);await e(await t(Lc(!1)))}),t.command(`agents`).description(`List configured agents`).option(`--setting-sources <sources>`,`Comma-separated list of setting sources to load (user, project, local).`).action(async()=>{let{agentsHandler:e}=await import(`./agents-HlKk68Qc.js`);await e(),process.exit(0)}),Gi()!==`disabled`){let e=t.command(`auto-mode`).description(`Inspect auto mode classifier configuration`);e.command(`defaults`).description(`Print the default auto mode environment, allow, and deny rules as JSON`).action(async()=>{let{autoModeDefaultsHandler:e}=await import(`./autoMode-Cr0AhS1G.js`);e(),process.exit(0)}),e.command(`config`).description(`Print the effective auto mode config as JSON: your settings where set, defaults otherwise`).action(async()=>{let{autoModeConfigHandler:e}=await import(`./autoMode-Cr0AhS1G.js`);e(),process.exit(0)}),e.command(`critique`).description(`Get AI feedback on your custom auto mode rules`).option(`--model <model>`,`Override which model is used`).action(async e=>{let{autoModeCritiqueHandler:t}=await import(`./autoMode-Cr0AhS1G.js`);await t(e),process.exit()})}{let e=t.command(`autonomy`).description(`Inspect and manage automatic autonomy runs and flows`);e.command(`status`).description(`Print autonomy run, flow, team, pipe, and remote-control status`).option(`--deep`,`Include teams, pipes, daemon, and remote-control sections`).action(async e=>{let{autonomyStatusHandler:t}=await import(`./autonomy-ARUQt-Lu.js`);await t(e),process.exit(0)}),e.command(`runs [limit]`).description(`List recent autonomy runs`).action(async e=>{let{autonomyRunsHandler:t}=await import(`./autonomy-ARUQt-Lu.js`);await t(e),process.exit(0)}),e.command(`flows [limit]`).description(`List recent autonomy flows`).action(async e=>{let{autonomyFlowsHandler:t}=await import(`./autonomy-ARUQt-Lu.js`);await t(e),process.exit(0)});let n=e.command(`flow <flowId>`).description(`Inspect a single autonomy flow`).action(async e=>{let{autonomyFlowHandler:t}=await import(`./autonomy-ARUQt-Lu.js`);await t(e),process.exit(0)});n.command(`cancel <flowId>`).description(`Cancel a queued, waiting, or running autonomy flow`).action(async e=>{let{autonomyFlowCancelHandler:t}=await import(`./autonomy-ARUQt-Lu.js`);await t(e),process.exit(0)}),n.command(`resume <flowId>`).description(`Resume a waiting autonomy flow`).action(async e=>{let{autonomyFlowResumeHandler:t}=await import(`./autonomy-ARUQt-Lu.js`);await t(e),process.exit(0)})}if(t.command(`doctor`).description(`Check the health of your Work Mate auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.`).action(async()=>{let[{doctorHandler:e},{createRoot:t}]=await Promise.all([import(`./util-DDtmyq_r.js`),import(`./src-CST_jFnT.js`)]);await e(await t(Lc(!1)))}),process.env.USER_TYPE===`ant`&&t.command(`up`).description(`[ANT-ONLY] Initialize or upgrade the local dev environment using the "# claude up" section of the nearest CLAUDE.md`).action(async()=>{let{up:e}=await import(`./up-B8wBSpLg.js`);await e()}),process.env.USER_TYPE===`ant`&&t.command(`rollback [target]`).description(`[ANT-ONLY] Roll back to a previous release
|
|
855
858
|
|
|
856
859
|
Examples:
|
|
857
860
|
claude rollback Go 1 version back from current
|
|
858
861
|
claude rollback 3 Go 3 versions back from current
|
|
859
|
-
claude rollback 2.0.73-dev.20251217.t190658 Roll back to a specific version`).option(`-l, --list`,`List recent published versions with ages`).option(`--dry-run`,`Show what would be installed without installing`).option(`--safe`,`Roll back to the server-pinned safe version (set by oncall during incidents)`).action(async(e,t)=>{let{rollback:n}=await import(`./rollback-BPWRKlIZ.js`);await n(e,t)}),
|
|
862
|
+
claude rollback 2.0.73-dev.20251217.t190658 Roll back to a specific version`).option(`-l, --list`,`List recent published versions with ages`).option(`--dry-run`,`Show what would be installed without installing`).option(`--safe`,`Roll back to the server-pinned safe version (set by oncall during incidents)`).action(async(e,t)=>{let{rollback:n}=await import(`./rollback-BPWRKlIZ.js`);await n(e,t)}),t.command(`install [target]`).description(`Install Work Mate native build. Use [target] to specify version (stable, latest, or specific version)`).option(`--force`,`Force installation even if already installed`).action(async(e,t)=>{let{installHandler:n}=await import(`./util-DDtmyq_r.js`);await n(e,t)}),t.command(`update`).description(`Update workmate (ccb) to the latest version`).action(async()=>{let{updateCCB:e}=await import(`./updateCCB-D_kGQKPT.js`);await e()}),process.env.USER_TYPE===`ant`){if(t.command(`log`).description(`[ANT-ONLY] Manage conversation logs.`).argument(`[number|sessionId]`,`A number (0, 1, 2, etc.) to display a specific log, or the sesssion ID (uuid) of a log`,e=>rt(e)||Number(e)).action(async e=>{let{logHandler:t}=await import(`./ant-DjdvlLOo.js`);await t(e)}),t.command(`error`).description(`[ANT-ONLY] View error logs. Optionally provide a number (0, -1, -2, etc.) to display a specific log.`).argument(`[number]`,`A number (0, 1, 2, etc.) to display a specific log`,parseInt).action(async e=>{let{errorHandler:t}=await import(`./ant-DjdvlLOo.js`);await t(e)}),process.env.USER_TYPE===`ant`){let e=t.command(`task`).description(`[ANT-ONLY] Manage task list tasks`);e.command(`create <subject>`).description(`Create a new task`).option(`-d, --description <text>`,`Task description`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).action(async(e,t)=>{let{taskCreateHandler:n}=await import(`./ant-DjdvlLOo.js`);await n(e,t)}),e.command(`list`).description(`List all tasks`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).option(`--pending`,`Show only pending tasks`).option(`--json`,`Output as JSON`).action(async e=>{let{taskListHandler:t}=await import(`./ant-DjdvlLOo.js`);await t(e)}),e.command(`get <id>`).description(`Get details of a task`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).action(async(e,t)=>{let{taskGetHandler:n}=await import(`./ant-DjdvlLOo.js`);await n(e,t)}),e.command(`update <id>`).description(`Update a task`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).option(`-s, --status <status>`,`Set status (${Kn.join(`, `)})`).option(`--subject <text>`,`Update subject`).option(`-d, --description <text>`,`Update description`).option(`--owner <agentId>`,`Set owner`).option(`--clear-owner`,`Clear owner`).action(async(e,t)=>{let{taskUpdateHandler:n}=await import(`./ant-DjdvlLOo.js`);await n(e,t)}),e.command(`dir`).description(`Show the tasks directory path`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).action(async e=>{let{taskDirHandler:t}=await import(`./ant-DjdvlLOo.js`);await t(e)})}t.command(`completion <shell>`,{hidden:!0}).description(`Generate shell completion script (bash, zsh, or fish)`).option(`--output <file>`,`Write completion script directly to a file instead of stdout`).action(async(e,n)=>{let{completionHandler:r}=await import(`./ant-DjdvlLOo.js`);await r(e,n,t)})}return K(`run_before_parse`),await t.parseAsync(process.argv),K(`run_after_parse`),K(`main_after_run`),wo(),t}async function Qd({hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:i,print:a,outputFormat:o,inputFormat:s,numAllowedTools:c,numDisallowedTools:l,mcpClientCount:u,worktreeEnabled:d,skipWebFetchPreflight:f,githubActionInputs:ee,dangerouslySkipPermissionsPassed:h,permissionMode:g,modeIsBypass:te,allowDangerouslySkipPermissionsPassed:ne,systemPromptFlag:re,appendSystemPromptFlag:ie,thinkingConfig:_,assistantActivationPath:v}){try{G(`tengu_init`,{entrypoint:`claude`,hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:i,print:a,outputFormat:o,inputFormat:s,numAllowedTools:c,numDisallowedTools:l,mcpClientCount:u,worktree:d,skipWebFetchPreflight:f,...ee&&{githubActionInputs:ee},dangerouslySkipPermissionsPassed:h,permissionMode:g,modeIsBypass:te,inProtectedNamespace:m(),allowDangerouslySkipPermissionsPassed:ne,thinkingType:_.type,..._.type===`enabled`&&{thinkingBudgetTokens:_.budgetTokens},...re&&{systemPromptFlag:re},...ie&&{appendSystemPromptFlag:ie},is_simple:p()||void 0,...v&&{assistantActivationPath:v},autoUpdatesChannel:Fa().autoUpdatesChannel??`latest`,...process.env.USER_TYPE===`ant`?(()=>{let e=ta(),t=co(e),n=t?Yc(t,e)||`.`:void 0;return n?{relativeProjectPath:n}:{}})():{}})}catch(e){U(e)}}function $d(t){if(t.proactive||d(process.env.CLAUDE_CODE_PROACTIVE)){let t=(Hs(),e(Us));t.isProactiveActive()||t.activateProactive(`command`)}}function ef(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(ue)}export{Yd as main};
|