@readmagic/workmate 0.0.17 → 0.0.19
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-YAhnVwyN.js → AddWorkspaceDirectory-9FcHMKgX.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-Bny8WDwC.js +1 -0
- package/dist/chunks/{AgentsMdExternalIncludesDialog-Ba4GYFl3.js → AgentsMdExternalIncludesDialog-DLnj3JQO.js} +1 -1
- package/dist/chunks/{App-mri25OrC.js → App-NkBqbDbC.js} +1 -1
- package/dist/chunks/ApproveApiKey-BKzkEkW-.js +1 -0
- package/dist/chunks/{ApproveApiKey-DCw6d7dm.js → ApproveApiKey-rgB6AsYD.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-CcViruUO.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-B5QBJTB4.js → BypassPermissionsModeDialog-D254L98G.js} +1 -1
- package/dist/chunks/{DiffDialog-Bd-DcTsK.js → DiffDialog-6Srcz3NW.js} +2 -2
- package/dist/chunks/Doctor-DYEdLRxR.js +1 -0
- package/dist/chunks/Doctor-DiNxlXfC.js +3 -0
- package/dist/chunks/ExitFlow-Bt2De110.js +2 -0
- package/dist/chunks/{Grove-CClEZT2e.js → Grove-DC4jyxeB.js} +1 -1
- package/dist/chunks/{HybridTransport-DyEuslQB.js → HybridTransport-DArmWb1V.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-Wyrk_cXR.js → InvalidConfigDialog-DFiB0Kzc.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-Cr9fmSyh.js → InvalidSettingsDialog-BHNo2__T.js} +1 -1
- package/dist/chunks/MCPConnectionManager-CdpO2Tj9.js +1 -0
- package/dist/chunks/MCPToolListView-Ch4jOk_x.js +1 -0
- package/dist/chunks/{McpParsingWarnings-BF4np2Y3.js → McpParsingWarnings-D4UQ8Q2e.js} +1 -1
- package/dist/chunks/MessageSelector-BgsrdJur.js +3 -0
- package/dist/chunks/Messages-DB1pmDY_.js +10 -0
- package/dist/chunks/{Onboarding-BAJXV7Ay.js → Onboarding-BnjdTwci.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-Cm4WN3qd.js → PromptInputFooterSuggestions-Chg9U-BC.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-ESj8sOpK.js → PromptInputHelpMenu-C0ZSo12s.js} +1 -1
- package/dist/chunks/QueryEngine-bKlupZpA.js +1 -0
- package/dist/chunks/REPL-Cg8UXYpX.js +128 -0
- package/dist/chunks/REPL-yzvMFfaU.js +1 -0
- package/dist/chunks/RemoteSessionManager-CRWOHvKf.js +2 -0
- package/dist/chunks/{ResumeConversation-NSVT3gn7.js → ResumeConversation-Ld7tYLKO.js} +1 -1
- package/dist/chunks/{SSETransport-CDGMGrxN.js → SSETransport-pPrlSZNF.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-CdgQlm--.js +1 -0
- package/dist/chunks/Settings-CsOlPcIW.js +2 -0
- package/dist/chunks/{TeleportProgress-8cS6aHVO.js → TeleportProgress-Di-PMey7.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-B0epkMgp.js → TeleportRepoMismatchDialog-CDv1cbo-.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-Bb14JeEk.js → TeleportResumeWrapper-Bmf13tGU.js} +1 -1
- package/dist/chunks/{ThemePicker-CnX8faYA.js → ThemePicker-B3AO3_jA.js} +1 -1
- package/dist/chunks/{TrustDialog-6wJF3W6K.js → TrustDialog-C0aiR_LU.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-Cuq6W2yc.js → ValidationErrorsList-BfZ5gcIv.js} +1 -1
- package/dist/chunks/add-dir-w1Ay3861.js +1 -0
- package/dist/chunks/{agentDisplay-QqGqcHGz.js → agentDisplay-D01ZlnVX.js} +1 -1
- package/dist/chunks/agents-B_hUgPnR.js +101 -0
- package/dist/chunks/{agents-DFPEienW.js → agents-Bxenhf8S.js} +1 -1
- package/dist/chunks/allErrors-C_iHQOlK.js +1 -0
- package/dist/chunks/{api-B3Wnozaf.js → api-C5ULzZny.js} +1 -1
- package/dist/chunks/api-CB3e0De0.js +1 -0
- package/dist/chunks/auth-CsYEYXBO.js +1 -0
- package/dist/chunks/auth-CubXYcRl.js +1 -0
- package/dist/chunks/{auth-CQGJitIV.js → auth-DvcZHXGk.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-BGKR5cdA.js +17 -0
- package/dist/chunks/backgroundHousekeeping-CykbtljP.js +1 -0
- package/dist/chunks/{banner-HfMnBd03.js → banner-BkUdig-T.js} +1 -1
- package/dist/chunks/{bg-DltfF1_K.js → bg-tGgpwpYx.js} +2 -2
- package/dist/chunks/branch-CqQxCSHG.js +2 -0
- package/dist/chunks/{break-cache-Cd1yQ-0h.js → break-cache-CcwOjTKt.js} +3 -3
- package/dist/chunks/bridgeConfig-Cp2x_wtE.js +1 -0
- package/dist/chunks/{bridgeConfig-B3mR0kJ0.js → bridgeConfig-MxsnEEPx.js} +1 -1
- package/dist/chunks/{bridgeMessaging-wZ5EKxW_.js → bridgeMessaging-Bx5pkkkx.js} +1 -1
- package/dist/chunks/bridgePointer-DfTOjgtX.js +1 -0
- package/dist/chunks/bridgeStatusUtil-B9EcQksI.js +1 -0
- package/dist/chunks/btw-DeznoRrw.js +1 -0
- package/dist/chunks/caches-BiVRgePi.js +1 -0
- package/dist/chunks/caches-CGzKSWiP.js +1 -0
- package/dist/chunks/{capacityWake-LRiPhPeM.js → capacityWake-BpP6c7x3.js} +1 -1
- package/dist/chunks/{ccrClient-EisctZbc.js → ccrClient-CimQTd0b.js} +1 -1
- package/dist/chunks/{claudeDesktop-CB3UCt7U.js → claudeDesktop-DPc_SaVn.js} +1 -1
- package/dist/chunks/{clear-BjtPf2Jb.js → clear-KvoD-lFN.js} +1 -1
- package/dist/chunks/{cliLaunch-xIVvtPZy.js → cliLaunch-DDtwAolw.js} +1 -1
- package/dist/chunks/{client-DNEVh6Wu.js → client-9uHzAmFH.js} +1 -1
- package/dist/chunks/client-BVal_QII.js +1 -0
- package/dist/chunks/{client-Bb2eZnuq.js → client-C_jBL1yC.js} +1 -1
- package/dist/chunks/client-CmnPWgLq.js +1 -0
- package/dist/chunks/client-Dd7CKMRX.js +1 -0
- package/dist/chunks/commands-CrzVgHxp.js +1 -0
- package/dist/chunks/{compact-w8AhLkr6.js → compact-Dgzve3dI.js} +2 -2
- package/dist/chunks/{config-BSkuQZNf.js → config-DRy1I12M.js} +2 -2
- package/dist/chunks/config-Df8jooTW.js +1 -0
- package/dist/chunks/{config-D78R57VA.js → config-e0Goy478.js} +1 -1
- package/dist/chunks/{context-Btn2JU2y.js → context-Dz-bbYCw.js} +1 -1
- package/dist/chunks/{context-noninteractive-044464Vs.js → context-noninteractive-ApbVPU86.js} +5 -5
- package/dist/chunks/context-noninteractive-m4O3VtG7.js +1 -0
- package/dist/chunks/conversation-BYBX07j8.js +1 -0
- package/dist/chunks/conversation-CJ-d0O-U.js +1 -0
- package/dist/chunks/{createSSHSession-C0KSI0fJ.js → createSSHSession-DOz_Ox1_.js} +1 -1
- package/dist/chunks/createSession-C_-ZEQT5.js +1 -0
- package/dist/chunks/{createSession-8ScCWTKb.js → createSession-yR87Rhiv.js} +1 -1
- package/dist/chunks/crossProjectResume-DNnZo3gU.js +40 -0
- package/dist/chunks/cwd-DLK3znO7.js +1 -0
- package/dist/chunks/cwd-Nh5IZNKO.js +1 -0
- package/dist/chunks/{datadog-BqINRWAW.js → datadog-DBgIEaEd.js} +1 -1
- package/dist/chunks/{debug-BQj6h99Q.js → debug-D58GQBDG.js} +1 -1
- package/dist/chunks/{debugUtils-B86DM1Sp.js → debugUtils-DXBRbwCE.js} +1 -1
- package/dist/chunks/{detached--wGwkuHX.js → detached-Biz-xhu0.js} +1 -1
- package/dist/chunks/{detectRepository-Qy3zKoyn.js → detectRepository-CDOJ-M7h.js} +1 -1
- package/dist/chunks/detectRepository-Cv9-k6dg.js +1 -0
- package/dist/chunks/{diff-CcrSQNvQ.js → diff-qOom_T1G.js} +1 -1
- package/dist/chunks/{directoryCompletion-i2oWpaUe.js → directoryCompletion-BDGcGDuv.js} +1 -1
- package/dist/chunks/doctor-CflXjqVK.js +1 -0
- package/dist/chunks/{entry-oVZ7Z59B.js → entry-EmOA7oWN.js} +4 -4
- package/dist/chunks/{esm-BZciQG9N.js → esm-DBMVQDVv.js} +1 -1
- package/dist/chunks/{execFileNoThrow-DYm1GeGn.js → execFileNoThrow-Bmb5HEFz.js} +1 -1
- package/dist/chunks/{execSyncWrapper-CqvQqke-.js → execSyncWrapper-C3ZFV9od.js} +1 -1
- package/dist/chunks/{exit-jikLI2Zh.js → exit-DDrAFCzE.js} +1 -1
- package/dist/chunks/{extraUsage-BT3in1Aj.js → extraUsage-DylXI7Fc.js} +1 -1
- package/dist/chunks/extractMemories-B_8wZpXA.js +1 -0
- package/dist/chunks/fast-4ajfJv-M.js +1 -0
- package/dist/chunks/{fast-CKhtBOx7.js → fast-BCkhj9Dq.js} +1 -1
- package/dist/chunks/{fetchModelList-DmaMgpa2.js → fetchModelList-BbjuFHQT.js} +1 -1
- package/dist/chunks/fetchModelList-V8_e2O1N.js +1 -0
- package/dist/chunks/{fileSuggestions-BfG3sbET.js → fileSuggestions-Ct7vKEpR.js} +2 -2
- package/dist/chunks/{firstPartyEventLogger-Q3fMF0BR.js → firstPartyEventLogger-CxUuXQhL.js} +2 -2
- package/dist/chunks/firstPartyEventLogger-YQm0DoVu.js +1 -0
- package/dist/chunks/flushGate-BZe_QwEz.js +1 -0
- package/dist/chunks/{gemini-L8Gj2B4H.js → gemini-8sSwOtEf.js} +1 -1
- package/dist/chunks/{generateSessionName-cAL5T7pG.js → generateSessionName-vT1khubt.js} +1 -1
- package/dist/chunks/{genericProcessUtils-Bbcbi11g.js → genericProcessUtils-6E7fB1dI.js} +1 -1
- package/dist/chunks/{git-DplvjXEY.js → git-By_J4XJL.js} +1 -1
- package/dist/chunks/git-zJCasBa6.js +1 -0
- package/dist/chunks/githubRepoPathMapping-CzgPGOHQ.js +1 -0
- package/dist/chunks/{goal-D-x2WXm7.js → goal-CznQA1n1.js} +1 -1
- package/dist/chunks/{grok-DtypRM4d.js → grok-cEzUsG-s.js} +1 -1
- package/dist/chunks/{grove-CSivzrhe.js → grove--HtQL4QZ.js} +1 -1
- package/dist/chunks/{help-DKZhC0lL.js → help-B6A_kDQA.js} +1 -1
- package/dist/chunks/hooks-CJY5Vfy6.js +1 -0
- package/dist/chunks/{hooks-D_afUDcs.js → hooks-CN5hLrhi.js} +2 -2
- package/dist/chunks/initReplBridge-BJhmlcVt.js +1 -0
- package/dist/chunks/install-DUOtI2Hq.js +1 -0
- package/dist/chunks/{instrumentation-IljwxX0V.js → instrumentation-DpgB3GFx.js} +4 -4
- package/dist/chunks/{job-N25KhSUu.js → job-DDoX1iFe.js} +1 -1
- package/dist/chunks/{jwtUtils-YCoZL0FW.js → jwtUtils-C_LG1txt.js} +1 -1
- package/dist/chunks/keybindings-BGTuYfk-.js +1 -0
- package/dist/chunks/{launchLocalMemory-DJsuNLIf.js → launchLocalMemory-CoWeLNeP.js} +1 -1
- package/dist/chunks/{launchOnboarding-CVvuxeH-.js → launchOnboarding-CTIBGSLV.js} +1 -1
- package/dist/chunks/{external-CEp-aPkt.js → lazySchema-DULtBUCI.js} +1 -1
- package/dist/chunks/{loadAgentsDir-CbtNPJV3.js → loadAgentsDir-DXOkUcW3.js} +587 -597
- package/dist/chunks/loadAgentsDir-Dxz1vp3F.js +1 -0
- package/dist/chunks/{loadPluginHooks-BxkDBFd6.js → loadPluginHooks-DrNVtTBq.js} +1 -1
- package/dist/chunks/loader-C33o_5kS.js +1 -0
- package/dist/chunks/localSearch-CCs5fOd_.js +1 -0
- package/dist/chunks/{localSearch-B5mTHBwK.js → localSearch-DnT21UkF.js} +1 -1
- package/dist/chunks/{log-BlJ7CcKG.js → log-CZ7ploQm.js} +1 -1
- package/dist/chunks/{logoV2Utils-D5nRpirL.js → logoUtils-YwL3izJt.js} +1 -1
- package/dist/chunks/{magicDocs-C9aIo4Oe.js → magicDocs-rxv0rR8E.js} +2 -2
- package/dist/chunks/{main-DeUt_aE2.js → main-BOvY4O6D.js} +30 -30
- package/dist/chunks/{main-Zh18lf2J.js → main-Blm02_Js.js} +2 -2
- package/dist/chunks/managedEnv-CpgCYISH.js +1 -0
- package/dist/chunks/managedEnv-CrnBYTtQ.js +1 -0
- package/dist/chunks/{mappers-Del1KoA7.js → mappers-DYtq2XVS.js} +1 -1
- package/dist/chunks/mcp-BPvcoKDY.js +1 -0
- package/dist/chunks/mcp-BfqsHRx0.js +2 -0
- package/dist/chunks/mcp-BoU3TNFs.js +6 -0
- package/dist/chunks/{memoize-_2f7NWDv.js → memoize-CumjjK2Q.js} +1 -1
- package/dist/chunks/memory-BPKRdkBb.js +1 -0
- package/dist/chunks/{mode-DPbrxU32.js → mode-CXpXux2s.js} +1 -1
- package/dist/chunks/model-CxPYKiW1.js +1 -0
- package/dist/chunks/model-Cxx3suBa.js +1 -0
- package/dist/chunks/model-aEJ54cMA.js +1 -0
- package/dist/chunks/{modelOptions-SMq3one0.js → modelOptions-BqBHEyiR.js} +1 -1
- package/dist/chunks/{nativeInstaller-DTJ4clp-.js → nativeInstaller-CaXwRpoR.js} +1 -1
- package/dist/chunks/omit-DZUxsClb.js +1 -0
- package/dist/chunks/onChangeAppState-qHXqufwy.js +1 -0
- package/dist/chunks/{openai-D9KvLMrj.js → openai-_FQ9EhuR.js} +2 -2
- package/dist/chunks/{panel-Bg_0PHE6.js → panel-CVd1dzYl.js} +1 -1
- package/dist/chunks/parser-Cq9X7HMP.js +1 -0
- package/dist/chunks/{parser-a2S_eFyE.js → parser-eVu-cTRs.js} +1 -1
- package/dist/chunks/partition-BgwHlPsO.js +1 -0
- package/dist/chunks/permissions-Dv5d5Nu3.js +3 -0
- package/dist/chunks/pidLock-CEhbTkBE.js +3 -0
- package/dist/chunks/{plan-dG2H4eQl.js → plan-DVPBW5OS.js} +1 -1
- package/dist/chunks/{platform-DVeTi9mp.js → platform-DMQxcm4K.js} +1 -1
- package/dist/chunks/plugin-Bh2eBwLW.js +17 -0
- package/dist/chunks/{pluginAutoupdate-B9W_vxOG.js → pluginAutoupdate-C2YbEHrP.js} +1 -1
- package/dist/chunks/{pluginBlocklist-BvdBsnJG.js → pluginBlocklist-B2NAKaB9.js} +1 -1
- package/dist/chunks/{pluginCliCommands-NKIgFTUF.js → pluginCliCommands-Cw5TrYYb.js} +1 -1
- package/dist/chunks/{pluginFlagging-C0PtAJEg.js → pluginFlagging-BDTgCYuC.js} +1 -1
- package/dist/chunks/pluginOperations-BBwGEdfC.js +2 -0
- package/dist/chunks/pluginStartupCheck-CHx379_R.js +1 -0
- package/dist/chunks/{pluginStartupCheck-p0njap1l.js → pluginStartupCheck-DhhMk3dA.js} +1 -1
- package/dist/chunks/{plugins-B9WBqOAW.js → plugins-r0h93GT_.js} +4 -4
- package/dist/chunks/pollConfig-2nFzv6Hy.js +1 -0
- package/dist/chunks/poorMode-BTIe8W_H.js +1 -0
- package/dist/chunks/poorMode-CKQfWf3S.js +1 -0
- package/dist/chunks/print-CDzhHi2F.js +14 -0
- package/dist/chunks/processBashCommand-DmdCAWOR.js +1 -0
- package/dist/chunks/processSlashCommand-B43TkiaI.js +5 -0
- package/dist/chunks/prompt-C50mDqWv.js +1 -0
- package/dist/chunks/{prompt-BRGC5U9Y.js → prompt-DEioJrx_.js} +17 -17
- package/dist/chunks/prompt-WGH9CcXh.js +1 -0
- package/dist/chunks/{promptEditor-CRIw6vJS.js → promptEditor-eJzbtNn4.js} +1 -1
- package/dist/chunks/{protocolHandler--eQQuSyx.js → protocolHandler-C-CFTcUJ.js} +1 -1
- package/dist/chunks/{proxy-C0j74LqT.js → proxy-BhIc7-mj.js} +1 -1
- package/dist/chunks/reconciler-DZP4dJJG.js +1 -0
- package/dist/chunks/refresh-vaY-Sr80.js +1 -0
- package/dist/chunks/{registerProtocol-DrWIX3Lb.js → registerProtocol-Xsq4ldwg.js} +1 -1
- package/dist/chunks/{reload-plugins-Cl6wvT6V.js → reload-plugins-m9CzoIxu.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-DnFZoXaw.js → remoteBridgeCore-C4vSr1gp.js} +1 -1
- package/dist/chunks/remoteManagedSettings-6RAHPt_g.js +1 -0
- package/dist/chunks/{rename-CdzxOzN5.js → rename-DmauGVBX.js} +1 -1
- package/dist/chunks/{renderOptions-CkqTbz6d.js → renderOptions-D-aQZbzS.js} +1 -1
- package/dist/chunks/resume-ut_pBrLN.js +2 -0
- package/dist/chunks/{ripgrep-DsLUmulz.js → ripgrep-C3jtZL7k.js} +1 -1
- package/dist/chunks/ripgrep-CBUbn6Po.js +1 -0
- package/dist/chunks/{runtimeObserver-Dov-m2dl.js → runtimeObserver-C2vjqtCE.js} +2 -2
- package/dist/chunks/{runtimeObserver-CwtRE2cj.js → runtimeObserver-CSroopId.js} +1 -1
- package/dist/chunks/sandbox-adapter-CL0qdcxn.js +1 -0
- package/dist/chunks/{sandbox-toggle-DWCrG9zV.js → sandbox-toggle-BJKd1ZYk.js} +1 -1
- package/dist/chunks/searchExtraTools-ByWuNCGo.js +1 -0
- package/dist/chunks/{session-L5191BSn.js → session-DTin6hOR.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-DorzHolr.js +1 -0
- package/dist/chunks/sessionObserver-Dy6NFlzL.js +1 -0
- package/dist/chunks/{sessionObserver-DpY0DOjI.js → sessionObserver-iAJLH92a.js} +1 -1
- package/dist/chunks/{sessionState-BlbRQ3Y6.js → sessionState-DAcub-HK.js} +2 -2
- package/dist/chunks/sessionStorage-DItJMkwx.js +1 -0
- package/dist/chunks/{sessionTracing-DqVx8aFD.js → sessionTracing-Dvi520eN.js} +1 -1
- package/dist/chunks/{settings-CvhsRFaT.js → settings-3xZ0fsvE.js} +5 -5
- package/dist/chunks/settings-Crx1cI1u.js +1 -0
- package/dist/chunks/settingsSync-aHn3p-6J.js +1 -0
- package/dist/chunks/setup-CK3ybjjM.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-Gerk3t93.js → shadowedRuleDetection-BL7dEv-u.js} +1 -1
- package/dist/chunks/{shellQuote-D3Ocv_U-.js → shellQuote-Ddgr1vif.js} +1 -1
- package/dist/chunks/{sideQuestion-RndkXExy.js → sideQuestion-Ct87yvOR.js} +1 -1
- package/dist/chunks/{sinks-CfzgqLH5.js → sinks-Bmn3li0M.js} +1 -1
- package/dist/chunks/sinks-QQ_6Op7q.js +1 -0
- package/dist/chunks/skillChangeDetector-Bco3UoeW.js +1 -0
- package/dist/chunks/{skillGapStore-CLxhWLyq.js → skillGapStore-MtlRyYmT.js} +2 -2
- package/dist/chunks/{skillLifecycle-CSNX2qOH.js → skillLifecycle-Drs6gEv9.js} +2 -2
- package/dist/chunks/{skillSearchPanel-CsQDjy_E.js → skillSearchPanel-DkvmjNaw.js} +3 -3
- package/dist/chunks/{skills-DM9ACPW-.js → skills-axToWEo0.js} +1 -1
- package/dist/chunks/{startupProfiler-2sjXZkIP.js → startupProfiler-CbzxVmbv.js} +1 -1
- package/dist/chunks/startupProfiler-uHetQush.js +1 -0
- package/dist/chunks/state-BStOuCh4.js +1 -0
- package/dist/chunks/{state-BPFYBqm1.js → state-D5D6QpTX.js} +1 -1
- package/dist/chunks/{stats-Dq-5qizS.js → stats-Ce15gc3E.js} +1 -1
- package/dist/chunks/status-3uevwSMo.js +1 -0
- package/dist/chunks/{status-C5v7KsX4.js → status-CGp4uRlH.js} +2 -2
- package/dist/chunks/{statusNoticeHelpers-BY_8pK19.js → statusNoticeHelpers-BrN_2q7H.js} +1 -1
- package/dist/chunks/{stringUtils-BjnclTLB.js → stringUtils-CKD8qDqx.js} +1 -1
- package/dist/chunks/switcher-99gm2vpe.js +1 -0
- package/dist/chunks/switcher-DJDxjLPQ.js +1 -0
- package/dist/chunks/syncCache-B3OVvp8K.js +1 -0
- package/dist/chunks/{tasks-qVyXOLBf.js → tasks-t5zT_D32.js} +1 -1
- package/dist/chunks/{teleport-Deq_ecN9.js → teleport-CvX_nUjQ.js} +1 -1
- package/dist/chunks/{templateJobs-CntPyct-.js → templateJobs-Bm8bovHx.js} +1 -1
- package/dist/chunks/{terminalSetup-DDvQ0K5e.js → terminalSetup-7PdC4fV5.js} +1 -1
- package/dist/chunks/{terminalSetup-JJiXmszo.js → terminalSetup-kWdZRKWq.js} +1 -1
- package/dist/chunks/{theme-DVWYzSct.js → theme-DzaSXOpQ.js} +1 -1
- package/dist/chunks/{tmux-g0cQ0Buz.js → tmux-CpGd0Aca.js} +1 -1
- package/dist/chunks/{toolEventObserver-BZn8ZJB5.js → toolEventObserver-C_nHI27x.js} +1 -1
- package/dist/chunks/toolPool-CgKK0K8f.js +1 -0
- package/dist/chunks/{trustedDevice-CdLAZK6m.js → trustedDevice-Bb7O8_tj.js} +1 -1
- package/dist/chunks/trustedDevice-C2gnF9Lc.js +1 -0
- package/dist/chunks/{types-BomO8WUz.js → types-APu4OCXJ.js} +2 -2
- package/dist/chunks/{udsClient-DSvRPCvR.js → udsClient-U7MEfYj7.js} +1 -1
- package/dist/chunks/{upstreamproxy-DYoLvdM9.js → upstreamproxy-CTOuotLO.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-YSWYVWk6.js → useExitOnCtrlCDWithKeybindings-D0uqGxGw.js} +1 -1
- package/dist/chunks/useMainLoopModel-BGPOmBkl.js +1 -0
- package/dist/chunks/useManagePlugins-ITVFO9dz.js +1 -0
- package/dist/chunks/{useMergedTools-B4qRVJ8b.js → useMergedTools-rQ19rFvH.js} +1 -1
- package/dist/chunks/{useSearchInput-DfUNYhqC.js → useSearchInput-CXTa-leH.js} +1 -1
- package/dist/chunks/useSettingsErrors-Xc6RYjYF.js +1 -0
- package/dist/chunks/{userAgent-CNPTS7ix.js → userAgent-CJ5Rp9kc.js} +1 -1
- package/dist/chunks/{util-6aJHnBQ_.js → util-CD3ar4of.js} +1 -1
- package/dist/chunks/validatePlugin-CxrlCKc1.js +1 -0
- package/dist/chunks/{vim-s-wmybpU.js → vim-BagKUX4j.js} +1 -1
- package/dist/chunks/{which-BR8YVCCW.js → which-BxQ1hpjp.js} +1 -1
- package/dist/chunks/{windowsPaths-BmXyrasP.js → windowsPaths-BdhjMYTm.js} +1 -1
- package/dist/chunks/windowsPaths-DtGZ83kH.js +1 -0
- package/dist/chunks/{workSecret-BUd8cQ6-.js → workSecret-CaM2yIJD.js} +1 -1
- package/dist/chunks/{workerRegistry-BwJ54Lzk.js → workerRegistry-BGJtgrko.js} +2 -2
- package/dist/chunks/worktree-CanG5GhE.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog--D4BeNAN.js +0 -1
- package/dist/chunks/ApproveApiKey-lv4Sg0RR.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-CZND8e_Z.js +0 -2
- package/dist/chunks/Doctor-C9t7udHN.js +0 -3
- package/dist/chunks/Doctor-V-JLC4e3.js +0 -1
- package/dist/chunks/ExitFlow-CShdrKmr.js +0 -2
- package/dist/chunks/MCPConnectionManager-BnUw0nYN.js +0 -1
- package/dist/chunks/MCPToolListView-CY2EezWF.js +0 -1
- package/dist/chunks/MessageSelector-Dtt2Sf65.js +0 -3
- package/dist/chunks/Messages-D5Uuapmf.js +0 -10
- package/dist/chunks/QueryEngine-B79JLwG4.js +0 -1
- package/dist/chunks/REPL-B7evbhvN.js +0 -1
- package/dist/chunks/REPL-cAXdORs2.js +0 -128
- package/dist/chunks/RemoteSessionManager-C5pAD0Lh.js +0 -2
- package/dist/chunks/SearchExtraToolsTool-CddjJcAH.js +0 -1
- package/dist/chunks/Settings-_b5Yxt_9.js +0 -2
- package/dist/chunks/add-dir-LLAv-rGS.js +0 -1
- package/dist/chunks/agents-C8wRUTNV.js +0 -101
- package/dist/chunks/allErrors-DUYYPpdH.js +0 -1
- package/dist/chunks/api-BAT--5sp.js +0 -1
- package/dist/chunks/auth-DaJXqwN5.js +0 -1
- package/dist/chunks/auth-DkhPycBL.js +0 -1
- package/dist/chunks/backgroundHousekeeping-Bjb_Jc7L.js +0 -17
- package/dist/chunks/backgroundHousekeeping-V-dg2j2E.js +0 -1
- package/dist/chunks/branch-BWq5ynjm.js +0 -2
- package/dist/chunks/bridgeConfig-D31i4BRi.js +0 -1
- package/dist/chunks/bridgePointer-CiHy2tTN.js +0 -1
- package/dist/chunks/bridgeStatusUtil-mvVQSVN-.js +0 -1
- package/dist/chunks/btw-XNgXHnNr.js +0 -1
- package/dist/chunks/caches-ByLjTvdy.js +0 -1
- package/dist/chunks/caches-ckqJ4Qso.js +0 -1
- package/dist/chunks/client-Bl43xcRk.js +0 -1
- package/dist/chunks/client-Pap_HyZZ.js +0 -1
- package/dist/chunks/client-zhozU2ws.js +0 -1
- package/dist/chunks/commands-BDhn7EPO.js +0 -1
- package/dist/chunks/config-CbAvTdZ7.js +0 -1
- package/dist/chunks/context-noninteractive-ulRLlYg5.js +0 -1
- package/dist/chunks/conversation-D08lU377.js +0 -1
- package/dist/chunks/conversation-a82khZ_n.js +0 -1
- package/dist/chunks/createSession-CnlPXXkA.js +0 -1
- package/dist/chunks/crossProjectResume-BCN462Wa.js +0 -40
- package/dist/chunks/cwd-Besi3Os3.js +0 -1
- package/dist/chunks/cwd-DpqwaYHw.js +0 -1
- package/dist/chunks/detectRepository-tRUoPOKy.js +0 -1
- package/dist/chunks/doctor-DRFDBrH1.js +0 -1
- package/dist/chunks/extractMemories-BsQU2bVO.js +0 -1
- package/dist/chunks/fast-B9vVL3sY.js +0 -1
- package/dist/chunks/fetchModelList-BeL40TyR.js +0 -1
- package/dist/chunks/firstPartyEventLogger-6GwZ6VLr.js +0 -1
- package/dist/chunks/flushGate-COa_KO98.js +0 -1
- package/dist/chunks/git-BaSq69E7.js +0 -1
- package/dist/chunks/githubRepoPathMapping-Px3_GeD1.js +0 -1
- package/dist/chunks/hooks-DvVuNKRx.js +0 -1
- package/dist/chunks/initReplBridge-sTaq4a0K.js +0 -1
- package/dist/chunks/install-BWe3Jz4M.js +0 -1
- package/dist/chunks/keybindings-DLEorhlY.js +0 -1
- package/dist/chunks/lazySchema-B4D4qJVE.js +0 -1
- package/dist/chunks/loadAgentsDir-D0gl_H2S.js +0 -1
- package/dist/chunks/localSearch-D3UrYUre.js +0 -1
- package/dist/chunks/managedEnv-ADMKY7-G.js +0 -1
- package/dist/chunks/managedEnv-CDxyrUw1.js +0 -1
- package/dist/chunks/mcp-Bh3MNBIj.js +0 -6
- package/dist/chunks/mcp-D7vMhEOV.js +0 -2
- package/dist/chunks/mcp-nnBVM5Lt.js +0 -1
- package/dist/chunks/memory-DtqQhHu8.js +0 -1
- package/dist/chunks/model-B50j-O5v.js +0 -1
- package/dist/chunks/model-DLG1nrnf.js +0 -1
- package/dist/chunks/model-DlLO7TSx.js +0 -1
- package/dist/chunks/omit-CMldTqqy.js +0 -1
- package/dist/chunks/onChangeAppState-EAnsmOuo.js +0 -1
- package/dist/chunks/parser-x-w3ikxt.js +0 -1
- package/dist/chunks/partition-B8Y4jvjW.js +0 -1
- package/dist/chunks/permissions-cDtIZRM1.js +0 -3
- package/dist/chunks/pidLock-Br3_YNi_.js +0 -3
- package/dist/chunks/plugin-CzQHuIlP.js +0 -17
- package/dist/chunks/pluginOperations-wUUdFpu9.js +0 -2
- package/dist/chunks/pluginStartupCheck-hDT6pEAd.js +0 -1
- package/dist/chunks/pollConfig-BgpfHQPJ.js +0 -1
- package/dist/chunks/poorMode-DD88nPJ4.js +0 -1
- package/dist/chunks/poorMode-wm2WkPF0.js +0 -1
- package/dist/chunks/print-G3DgPTxy.js +0 -14
- package/dist/chunks/processBashCommand-zLWgCRws.js +0 -1
- package/dist/chunks/processSlashCommand-BHBnHBjj.js +0 -5
- package/dist/chunks/prompt-Ct3Ryb3C.js +0 -1
- package/dist/chunks/prompt-TZJKyomz.js +0 -1
- package/dist/chunks/reconciler-DiU1RvGD.js +0 -1
- package/dist/chunks/refresh-DEXe3Lmx.js +0 -1
- package/dist/chunks/remoteManagedSettings-BboLJ46D.js +0 -1
- package/dist/chunks/resume-DgFXYWTN.js +0 -2
- package/dist/chunks/ripgrep-Di-2j8Ws.js +0 -1
- package/dist/chunks/sandbox-adapter-CtEngx-6.js +0 -1
- package/dist/chunks/searchExtraTools-zFMN5MqY.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-C2VjT-PU.js +0 -1
- package/dist/chunks/sessionObserver-BuhXr3FP.js +0 -1
- package/dist/chunks/sessionStorage-CiYSwyY3.js +0 -1
- package/dist/chunks/settings-BgHApyGL.js +0 -1
- package/dist/chunks/settingsSync-BhlegQAU.js +0 -1
- package/dist/chunks/setup-DvnKMqDy.js +0 -3
- package/dist/chunks/sinks-Cf4vx9UX.js +0 -1
- package/dist/chunks/skillChangeDetector-BQx4xe_b.js +0 -1
- package/dist/chunks/startupProfiler-B2fyaBEa.js +0 -1
- package/dist/chunks/state-CsdHk8n-.js +0 -1
- package/dist/chunks/status-C3z0CSBw.js +0 -1
- package/dist/chunks/switcher-C9VsM-ip.js +0 -1
- package/dist/chunks/switcher-CnBKuiNp.js +0 -1
- package/dist/chunks/syncCache-Dff4hbz4.js +0 -1
- package/dist/chunks/toolPool-Dzp1ob3I.js +0 -1
- package/dist/chunks/trustedDevice-1Q4FTNyX.js +0 -1
- package/dist/chunks/useMainLoopModel-C1JRp4zE.js +0 -1
- package/dist/chunks/useManagePlugins-DfuI4Nhd.js +0 -1
- package/dist/chunks/useSettingsErrors-Bls74ocI.js +0 -1
- package/dist/chunks/validatePlugin-BajM6yNf.js +0 -1
- package/dist/chunks/windowsPaths-BybjGW7e.js +0 -1
- package/dist/chunks/worktree-BFP10vim.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,i as t,o as n,t as r}from"./rolldown-runtime-DaDcL9Zw.js";import{n as i,t as a}from"./memoize-BK3gG5ob.js";import{a as o,d as s,f as c,l,o as u,s as d,u as f}from"./envUtils-DcaKZlRU.js";import{n as p,t as m}from"./defineProperty-C-QyHrDq.js";import{n as ee,t as te}from"./axios-DaWTGg7G.js";import{$b as h,$d as ne,Ab as re,Ax as ie,BT as ae,Bn as oe,Ch as se,Ci as ce,Ct as le,Cx as ue,Df as de,Dp as g,Dx as fe,Ec as _,Ef as pe,Et as me,Ex as he,FC as ge,FT as _e,Fd as ve,Fs as ye,Fx as be,Gi as xe,Gx as Se,Hy as Ce,IT as we,Ig as Te,Ix as v,J_ as Ee,Jb as De,Jy as Oe,Kc as ke,Ky as Ae,La as je,Lg as y,Li as Me,Lv as Ne,M as Pe,Mb as Fe,Mi as Ie,Nn as Le,Ns as Re,Nx as ze,Oi as Be,Op as b,Ou as x,Ox as Ve,PC as S,Pi as C,Pn as He,Pv as Ue,Px as We,Qb as w,Qd as Ge,Qs as Ke,Qu as qe,Qw as T,RT as Je,Rx as Ye,S as Xe,ST as Ze,Sa as Qe,Si as $e,So as et,St as tt,Su as nt,T as rt,Tc as it,Tf as at,Th as ot,Tu as st,Tx as ct,UT as E,Ux as lt,VT as ut,WT as dt,Wi as ft,Wy as pt,Xb as mt,Xh as ht,Xp as gt,Xs as _t,Xw as vt,Y_ as yt,Yh as bt,Zd as D,Zp as xt,Zs as St,Zu as Ct,Zw as wt,_c as Tt,_u as Et,_w as Dt,af as Ot,as as kt,av as At,ax as jt,b as Mt,bc as Nt,bo as Pt,br as Ft,bt as It,bu as Lt,cf as Rt,co as zt,cr as Bt,cu as Vt,cx as Ht,dS as Ut,dT as Wt,du as Gt,dx as O,eT as Kt,ec as qt,ed as Jt,ex as Yt,f as Xt,fS as k,f_ as A,ff as j,fi as Zt,fr as Qt,fx as $t,fy as en,gT as tn,g_ as nn,gh as rn,gu as an,hT as on,h_ as sn,hc as cn,hh as ln,hu as un,hx as dn,hy as fn,i as pn,if as mn,ii as hn,io as gn,ix as _n,jb as vn,k as yn,kd as bn,kn as xn,ku as Sn,kx as Cn,lf as wn,lh as Tn,lu as En,lx as Dn,m_ as On,mc as kn,mf as An,mw as M,mx as jn,nT as Mn,nt as Nn,nx as Pn,o as Fn,oT as In,of as Ln,ol as Rn,ov as zn,ox as Bn,pi as Vn,px as Hn,q_ as Un,qc as Wn,r as Gn,rT as Kn,rc as qn,rf as Jn,rs as Yn,rx as Xn,s as Zn,sf as Qn,sl as $n,sp as er,sx as tr,tT as nr,td as rr,tf as ir,tt as ar,tx as or,uT as sr,uh as cr,uo as lr,up as ur,uw as dr,vh as fr,vu as pr,wb as mr,wu as hr,x as gr,xT as _r,xo as vr,xu as yr,xx as br,ya as xr,yo as Sr,yu as Cr,yw as wr,zT as Tr,zx as Er}from"./loadAgentsDir-CbtNPJV3.js";import{B as Dr,D as Or,I as kr,Lt as Ar,P as jr,R as Mr,T as Nr,ai as Pr,di as N,fi as Fr,rr as Ir,t as Lr,xr as Rr,y as zr}from"./src-DL3w8VPk2.js";import{t as Br}from"./jsx-runtime-Bb4Xn-E0.js";import{A as P,M as Vr,O as Hr,j as Ur,l as Wr,p as Gr,u as Kr,w as qr}from"./external-CEp-aPkt.js";import{n as Jr,r as Yr,t as Xr}from"./lazySchema-B4D4qJVE.js";import{$n as Zr,Bn as Qr,Cn as $r,F as ei,J as ti,Jn as ni,Kn as ri,Mn as ii,Nn as ai,Pn as oi,Qn as si,Sn as ci,Wt as li,Yn as ui,Zn as di,_r as fi,bn as pi,dn as mi,dt as hi,er as gi,et as _i,fn as vi,ft as yi,gn as bi,gr as xi,in as Si,ln as Ci,nr as wi,on as Ti,or as Ei,pt as Di,xn as Oi,z as ki}from"./state-BPFYBqm1.js";import{n as Ai,t as ji}from"./cwd-Besi3Os3.js";import{B as Mi,C as Ni,F as Pi,M as Fi,O as Ii,P as F,R as Li,S as Ri,T as zi,U as Bi,c as I,f as Vi,g as Hi,i as Ui,l as Wi,nt as Gi,tt as Ki,u as qi,x as Ji}from"./debug-BQj6h99Q.js";import{Bt as Yi,J as Xi,Ln as Zi,Mt as Qi,O as $i,Q as ea,Rn as ta,S as na,T as ra,c as ia,dn as aa,f as oa,g as L,h as sa,i as ca,k as la,ln as ua,n as da,u as fa,x as R}from"./settings-CvhsRFaT.js";import{M as pa,P as ma,T as ha,_ as ga,c as z,g as _a,h as B,k as va,n as ya,o as ba,p as xa,r as Sa,s as Ca,v as wa,w as Ta,y as V}from"./config-BSkuQZNf.js";import{a as Ea,n as Da,r as Oa}from"./process-gEbdy6uY.js";import{O as ka,f as Aa,i as ja,k as H,l as Ma,m as Na}from"./git-DplvjXEY.js";import{c as Pa,o as Fa}from"./execFileNoThrow-DYm1GeGn.js";import{d as Ia,f as La,o as Ra,s as U}from"./log-BlJ7CcKG.js";import{n as za,t as Ba}from"./which-BR8YVCCW.js";import{i as Va,o as Ha}from"./platform-DVeTi9mp.js";import{i as Ua,o as Wa}from"./windowsPaths-BmXyrasP.js";import{s as Ga,u as Ka}from"./types-BomO8WUz.js";import{n as W,r as G}from"./analytics-DJobLaWP.js";import{i as qa,n as Ja,r as K}from"./startupProfiler-2sjXZkIP.js";import{l as Ya,s as Xa,u as Za}from"./oauth-D38aRTUb.js";import{n as Qa,t as $a}from"./bundledMode--fG1S62b.js";import{l as eo,o as to}from"./stringUtils-BjnclTLB.js";import{$n as no,$r as ro,$t as io,Bn as ao,Br as oo,C as so,Fn as co,G as lo,Hn as uo,J as fo,Jt as po,Nt as mo,Or as ho,Pt as go,Qn as _o,Qt as vo,Rr as yo,S as bo,St as xo,Tn as So,Un as Co,Wt as wo,Xn as To,Z as Eo,Zn as Do,_ as Oo,b as ko,g as Ao,hn as jo,hr as Mo,ht as No,it as Po,jr as Fo,kt as Io,mn as Lo,mr as Ro,o as zo,pn as Bo,qt as Vo,rt as Ho,sn as Uo,ti as Wo,v as Go,xn as Ko}from"./model-DlLO7TSx.js";import{Ft as qo,Jt as Jo,Kt as Yo,Nt as Xo,Pt as Zo,at as Qo,it as $o,kt as es,ot as ts}from"./prompt-BRGC5U9Y.js";import{f as ns,h as rs,l as is,n as as}from"./proxy-C0j74LqT.js";import{n as os,t as ss}from"./userAgent-CNPTS7ix.js";import{C as cs,S as ls,at as us,ut as ds}from"./sessionState-BlbRQ3Y6.js";import{n as fs,t as ps}from"./partition-B8Y4jvjW.js";import{a as ms,n as hs}from"./ripgrep-DsLUmulz.js";import{c as gs}from"./switcher-CnBKuiNp.js";import{dt as _s,ft as vs}from"./esm-BZciQG9N.js";import{C as ys,D as bs,O as xs,S as Ss}from"./sessionTracing-DqVx8aFD.js";import{i as Cs,n as ws}from"./detectRepository-Qy3zKoyn.js";import{c as Ts,o as Es,r as Ds}from"./api-B3Wnozaf.js";import{d as Os,f as ks,l as As,p as js,u as Ms}from"./firstPartyEventLogger-Q3fMF0BR.js";import{n as Ns,t as Ps}from"./worktreeModeEnabled-BFOYTTTr.js";import{a as Fs}from"./grove-CSivzrhe.js";import{a as Is,i as Ls,n as Rs,o as zs,r as Bs}from"./remoteManagedSettings-BboLJ46D.js";import{n as Vs,t as Hs}from"./allErrors-DUYYPpdH.js";import{n as q,t as J}from"./exit-s9XGerrH.js";import{n as Us,s as Ws,t as Gs}from"./pluginOperations-wUUdFpu9.js";import"./pluginCliCommands-NKIgFTUF.js";import{n as Ks,r as qs,t as Js}from"./managedEnv-CDxyrUw1.js";import{n as Ys}from"./onChangeAppState-EAnsmOuo.js";import{i as Xs,t as Zs}from"./skillChangeDetector-BQx4xe_b.js";import{n as Qs}from"./stats-Dq-5qizS.js";import{t as $s}from"./renderOptions-CkqTbz6d.js";import{i as ec,n as tc,t as nc}from"./githubRepoPathMapping-Px3_GeD1.js";import{i as rc,n as ic}from"./earlyInput-IghoCjG5.js";import{t as ac}from"./banner-HfMnBd03.js";import{c as oc,n as sc,o as cc,r as lc}from"./RemoteSessionManager-C5pAD0Lh.js";import{posix as uc,resolve as dc,win32 as fc}from"path";import{appendFileSync as pc,readFileSync as mc}from"fs";var hc=r((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})),gc=r((e=>{var{InvalidArgumentError:t}=hc(),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})),_c=r((e=>{var{humanReadableArgName:t}=gc(),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,o as n,t as r}from"./rolldown-runtime-DaDcL9Zw.js";import{n as i,t as a}from"./memoize-BK3gG5ob.js";import{a as o,d as s,f as c,l,o as u,s as d,u as f}from"./envUtils-DcaKZlRU.js";import{n as p,t as m}from"./defineProperty-C-QyHrDq.js";import{n as ee,t as te}from"./axios-DaWTGg7G.js";import{$b as h,$d as ne,AC as re,AT as ie,Ax as ae,Bn as oe,Bx as se,Ch as ce,Ci as le,Ct as ue,Cx as de,Db as fe,Df as pe,Dp as g,Eb as _,Ec as me,Ef as he,Et as ge,FT as _e,Fd as ve,Fs as ye,Gb as be,Gi as v,Gw as xe,Hy as Se,IT as Ce,Ig as we,J_ as Te,Jb as Ee,Jy as De,Kc as Oe,Kw as ke,Ky as Ae,La as je,Lg as Me,Li as y,Lv as Ne,M as Pe,Mi as Fe,NT as Ie,Nn as Le,Ns as Re,Nx as ze,Oi as Be,Op as Ve,Ou as b,Ox as He,PT as x,Pi as S,Pn as Ue,Pv as We,Px as Ge,Qb as C,Qd as Ke,Qs as qe,Qu as Je,Qw as w,RT as Ye,Rx as Xe,S as Ze,Sa as Qe,Si as $e,So as et,St as tt,Su as nt,Sx as rt,T as it,Tb as at,Tc as ot,Tf as st,Th as ct,Tu as lt,Tx as ut,Ub as dt,Wi as T,Wy as ft,Xb as E,Xh as pt,Xp as mt,Xs as ht,Xw as gt,Y_ as _t,Yb as vt,Yh as yt,Yw as bt,Zb as xt,Zd as D,Zp as St,Zs as Ct,Zu as wt,Zw as Tt,_T as Et,_c as Dt,_u as Ot,aT as kt,af as At,as as jt,av as Mt,aw as Nt,b as Pt,bc as Ft,bo as It,br as Lt,bt as Rt,bu as zt,bx as Bt,cf as Vt,co as Ht,cr as Ut,cu as Wt,cx as Gt,dT as Kt,du as qt,ec as Jt,ed as O,ex as Yt,f as Xt,f_ as Zt,ff as Qt,fi as $t,fr as en,fw as tn,fy as k,gT as A,g_ as nn,gh as rn,gu as an,gx as j,h_ as on,hc as sn,hh as cn,hu as ln,hy as un,i as dn,if as fn,ii as pn,io as mn,ix as hn,jT as gn,jx as _n,k as vn,kC as yn,kd as bn,kn as xn,ku as Sn,kx as Cn,lf as wn,lh as Tn,lu as En,lw as Dn,lx as On,m_ as kn,mc as An,mf as jn,mw as M,nt as Mn,nx as Nn,o as Pn,oS as Fn,oT as In,of as Ln,ol as Rn,ov as zn,ox as Bn,pi as Vn,q_ as Hn,qb as Un,qc as Wn,qw as Gn,r as Kn,rc as qn,rf as Jn,rs as Yn,rx as Xn,s as Zn,sS as Qn,sf as $n,sl as er,sp as tr,sx as nr,tT as rr,td as ir,tf as ar,tt as or,tx as sr,uT as cr,uh as lr,uo as ur,up as dr,ux as fr,vh as pr,vu as mr,vx as hr,wu as gr,wx as _r,x as vr,xo as yr,xu as br,xx as xr,ya as Sr,yb as Cr,yo as wr,yu as Tr,zT as Er}from"./loadAgentsDir-DXOkUcW3.js";import{B as Dr,D as Or,I as kr,Lt as Ar,P as jr,R as Mr,T as Nr,ai as Pr,di as N,fi as Fr,rr as Ir,t as Lr,xr as Rr,y as zr}from"./src-DL3w8VPk2.js";import{t as Br}from"./jsx-runtime-Bb4Xn-E0.js";import{D as Vr,F as Hr,N as P,P as Ur,f as Wr,g as Gr,j as Kr,n as qr,p as Jr,r as Yr,t as Xr}from"./lazySchema-DULtBUCI.js";import{$ as Zr,$n as Qr,Gn as $r,Jn as ei,Mn as ti,Nn as ni,P as ri,Qn as ii,R as ai,Sn as oi,Ut as si,Xn as ci,Zn as li,an as ui,ar as di,bn as fi,cn as pi,dn as mi,dt as hi,ft as gi,gr as _i,hn as vi,hr as yi,jn as bi,q as xi,qn as Si,rn as Ci,tr as wi,un as Ti,ut as Ei,xn as Di,yn as Oi,zn as ki}from"./state-D5D6QpTX.js";import{n as Ai,t as ji}from"./cwd-Nh5IZNKO.js";import{B as Mi,C as Ni,F as Pi,M as Fi,O as Ii,P as F,R as Li,S as Ri,T as zi,U as Bi,c as I,f as Vi,g as Hi,i as Ui,l as Wi,nt as Gi,tt as Ki,u as qi,x as Ji}from"./debug-D58GQBDG.js";import{D as Yi,In as Xi,Ln as Zi,O as Qi,Z as $i,b as L,cn as ea,d as ta,h as R,jt as na,l as ra,m as ia,q as aa,r as oa,s as sa,t as ca,un as la,w as ua,x as da,zt as fa}from"./settings-3xZ0fsvE.js";import{M as pa,P as ma,T as ha,_ as ga,c as z,g as _a,h as B,k as va,n as ya,o as ba,p as xa,r as Sa,s as Ca,v as wa,w as Ta,y as V}from"./config-DRy1I12M.js";import{a as Ea,n as Da,r as Oa}from"./process-gEbdy6uY.js";import{O as ka,f as Aa,i as ja,k as H,l as Ma,m as Na}from"./git-By_J4XJL.js";import{c as Pa,o as Fa}from"./execFileNoThrow-Bmb5HEFz.js";import{d as Ia,f as La,o as Ra,s as U}from"./log-CZ7ploQm.js";import{n as za,t as Ba}from"./which-BxQ1hpjp.js";import{i as Va,o as Ha}from"./platform-DMQxcm4K.js";import{i as Ua,o as Wa}from"./windowsPaths-BdhjMYTm.js";import{s as Ga,u as Ka}from"./types-APu4OCXJ.js";import{n as W,r as G}from"./analytics-DJobLaWP.js";import{i as qa,n as Ja,r as K}from"./startupProfiler-CbzxVmbv.js";import{l as Ya,s as Xa,u as Za}from"./oauth-D38aRTUb.js";import{n as Qa,t as $a}from"./bundledMode--fG1S62b.js";import{l as eo,o as to}from"./stringUtils-CKD8qDqx.js";import{$n as no,$r as ro,$t as io,Bn as ao,Br as oo,C as so,Fn as co,G as lo,Hn as uo,J as fo,Jt as po,Nt as mo,Or as ho,Pt as go,Qn as _o,Qt as vo,Rr as yo,S as bo,St as xo,Tn as So,Un as Co,Wt as wo,Xn as To,Z as Eo,Zn as Do,_ as Oo,b as ko,g as Ao,hn as jo,hr as Mo,ht as No,it as Po,jr as Fo,kt as Io,mn as Lo,mr as Ro,o as zo,pn as Bo,qt as Vo,rt as Ho,sn as Uo,ti as Wo,v as Go,xn as Ko}from"./model-Cxx3suBa.js";import{Ft as qo,Kt as Jo,Nt as Yo,Pt as Xo,at as Zo,it as Qo,kt as $o,ot as es,qt as ts}from"./prompt-DEioJrx_.js";import{f as ns,h as rs,l as is,n as as}from"./proxy-BhIc7-mj.js";import{n as os,t as ss}from"./userAgent-CJ5Rp9kc.js";import{C as cs,S as ls,at as us,ut as ds}from"./sessionState-DAcub-HK.js";import{n as fs,t as ps}from"./partition-BgwHlPsO.js";import{a as ms,n as hs}from"./ripgrep-C3jtZL7k.js";import{a as gs}from"./loader-C33o_5kS.js";import{dt as _s,ft as vs}from"./esm-DBMVQDVv.js";import{C as ys,D as bs,O as xs,S as Ss}from"./sessionTracing-Dvi520eN.js";import{i as Cs,n as ws}from"./detectRepository-CDOJ-M7h.js";import{c as Ts,o as Es,r as Ds}from"./api-C5ULzZny.js";import{d as Os,f as ks,l as As,p as js,u as Ms}from"./firstPartyEventLogger-CxUuXQhL.js";import{n as Ns,t as Ps}from"./worktreeModeEnabled-BFOYTTTr.js";import{a as Fs}from"./grove--HtQL4QZ.js";import{a as Is,i as Ls,n as Rs,o as zs,r as Bs}from"./remoteManagedSettings-6RAHPt_g.js";import{n as Vs,t as Hs}from"./allErrors-C_iHQOlK.js";import{n as q,t as J}from"./exit-s9XGerrH.js";import{n as Us,s as Ws,t as Gs}from"./pluginOperations-BBwGEdfC.js";import"./pluginCliCommands-Cw5TrYYb.js";import{n as Ks,r as qs,t as Js}from"./managedEnv-CpgCYISH.js";import{n as Ys}from"./onChangeAppState-qHXqufwy.js";import{i as Xs,t as Zs}from"./skillChangeDetector-Bco3UoeW.js";import{n as Qs}from"./stats-Ce15gc3E.js";import{t as $s}from"./renderOptions-D-aQZbzS.js";import{i as ec,n as tc,t as nc}from"./githubRepoPathMapping-CzgPGOHQ.js";import{i as rc,n as ic}from"./earlyInput-IghoCjG5.js";import{t as ac}from"./banner-BkUdig-T.js";import{c as oc,n as sc,o as cc,r as lc}from"./RemoteSessionManager-CRWOHvKf.js";import{posix as uc,resolve as dc,win32 as fc}from"path";import{appendFileSync as pc,readFileSync as mc}from"fs";var hc=r((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})),gc=r((e=>{var{InvalidArgumentError:t}=hc(),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})),_c=r((e=>{var{humanReadableArgName:t}=gc(),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
4
|
`)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),vc=r((e=>{var{InvalidArgumentError:t}=hc(),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}
|
|
@@ -16,7 +16,7 @@ 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=te(o.execArgv).concat(t),f=r.spawn(o.execPath,t,{stdio:`inherit`})):n?(t.unshift(u),t=te(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 te(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 h(){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=h})),xc=r((e=>{var{Argument:t}=gc(),{Command:n}=bc(),{CommanderError:r,InvalidArgumentError:i}=hc(),{Help:a}=_c(),{Option:o}=vc();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})),Sc=r(((e,t)=>{var n=xc();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)}));a(),u(),p(),xi(),li(),Ki(),Li(),Ji(),Vi(),Da(),Ui(),W(),Ja(),$i(),Lo();var{program:Cc,createCommand:wc,createArgument:Tc,createOption:Ec,CommanderError:Dc,InvalidArgumentError:Oc,InvalidOptionArgumentError:kc,Command:Ac,Argument:jc,Option:Y,Help:Mc}=n(Sc(),1).default;te(),Fr();var Nc=n(Pr(),1),X=Br();Lr(),Yr(),Ai(),ka(),Pa(),Ra(),Ba(),Na(),Ha(),Ua(),ta(),Ga(),ua(),Xr(),$a(),ea(),to(),ra(),L(),pa(),Wo(),Ta(),B(),rs(),is(),oo(),ho(),Ro(),_o(),os(),To(),uo(),ao(),So(),go(),Oo(),Jo(),_r(),on(),ms(),T(),wr(),k(),Se(),v(),ue(),jt(),De(),cs(),vn(),Ae(),Xo(),Qo(),yt(),y(),ln(),gt(),Jn(),ks(),ne(),Ps(),Wn(),cn(),vr(),Pt(),zt(),je(),ft(),Me(),ce(),Ft(),Le(),ar(),Za(),Ia();var Pc=!1;function Fc(){if(Pc||(Pc=!0,La())||l(process.env.CLAUDE_CODE_USE_BEDROCK)||l(process.env.CLAUDE_CODE_USE_VERTEX)||l(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||Ya().BASE_API_URL;fetch(e,{method:`HEAD`,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}function Ic(){if(process.env.NODE_EXTRA_CA_CERTS)return;let e=Lc();e&&(process.env.NODE_EXTRA_CA_CERTS=e,I(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${e}`))}function Lc(){try{let e=z()?.env,t=ia(`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}}B(),Ui(),Cs(),vs(),u(),qs(),Ss(),xs(),Ms();var Rc=!1,zc=i(async()=>{let e=Date.now();H(`info`,`init_started`),K(`init_function_start`);try{let t=Date.now();Sa(),Dr({loadTheme:()=>z().theme,saveTheme:e=>V(t=>({...t,theme:e}))}),H(`info`,`init_configs_enabled`,{duration_ms:Date.now()-t}),K(`init_configs_enabled`);let n=Date.now();Ks();try{let{restoreActiveProvider:e}=await import(`./switcher-C9VsM-ip.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`})}Ic(),H(`info`,`init_safe_env_vars_applied`,{duration_ms:Date.now()-n}),K(`init_safe_env_vars_applied`),ir(),K(`init_after_graceful_shutdown`),import(`./firstPartyEventLogger-6GwZ6VLr.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`),Fo(),K(`init_after_oauth_populate`),_s(),K(`init_after_jetbrains_detection`),ws(),Bs()&&Rs(),Ln()&&mn(),K(`init_after_remote_settings_check`),ga();let r=Date.now();I(`[init] configureGlobalMTLS starting`),ns(),H(`info`,`init_mtls_configured`,{duration_ms:Date.now()-r}),I(`[init] configureGlobalMTLS complete`);let i=Date.now();if(I(`[init] configureGlobalAgents starting`),as(),H(`info`,`init_proxy_configured`,{duration_ms:Date.now()-i}),I(`[init] configureGlobalAgents complete`),K(`init_network_configured`),await As(),Fc(),l(process.env.CLAUDE_CODE_REMOTE))try{let{initUpstreamProxy:e,getUpstreamProxyEnv:t}=await import(`./upstreamproxy-DYoLvdM9.js`),{registerUpstreamProxyEnvFn:n}=await import(`./subprocessEnv-DtBCqQIo.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(Wa(),Gi(fr),He()){let e=Date.now();await xn(),H(`info`,`init_scratchpad_created`,{duration_ms:Date.now()-e})}try{let{getRipgrepStatus:e}=await import(`./ripgrep-Di-2j8Ws.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 Ii){if(ki()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}\n`),Ge(1);return}return import(`./InvalidConfigDialog-Wyrk_cXR.js`).then(t=>t.showInvalidConfigDialog({error:e}))}else throw e}});function Bc(){Bs()?(ki()&&ys()&&Vc().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`),zs().then(async()=>{I(`[3P telemetry] Remote managed settings loaded, initializing telemetry`),Js(),await Vc()}).catch(e=>{I(`[3P telemetry] Telemetry init failed (remote settings path): ${F(e)}`,{level:`error`})})):Vc().catch(e=>{I(`[3P telemetry] Telemetry init failed: ${F(e)}`,{level:`error`})})}async function Vc(){if(!Rc){if(!l(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)){Rc=!0,I(`[3P telemetry] Skipped — CLAUDE_CODE_ENABLE_TELEMETRY not set`);return}Rc=!0;try{await Hc()}catch(e){throw Rc=!1,e}}}async function Hc(){let{initializeTelemetry:e}=await import(`./instrumentation-IljwxX0V.js`),t=await e();t&&(oi(t,(e,n)=>{let r=t?.createCounter(e,n);return{add(e,t={}){let n={...bs(),...t};r?.add(e,n)}}}),yi()?.add(1))}ve();async function Uc(e,t,n,r){let{App:i}=await import(`./App-mri25OrC.js`),{REPL:a}=await import(`./REPL-B7evbhvN.js`);await r(e,(0,X.jsx)(i,{...t,children:(0,X.jsx)(a,{...n})}))}gs(),Za(),B(),Ui(),Ia();var Wc=Jr(()=>qr({client_data:Hr(P(),Vr()).nullish(),additional_model_options:Gr(qr({model:P(),name:P(),description:P()}).transform(({model:e,name:t,description:n})=>({value:e,label:t,description:n}))).nullish()}));async function Gc(){if(La())return I(`[Bootstrap] Skipped: Nonessential traffic disabled`),null;if(ro()!==`firstParty`)return I(`[Bootstrap] Skipped: 3P provider`),null;let e=No();if(!(xo()?.accessToken&&mo())&&!e)return I(`[Bootstrap] Skipped: no usable OAuth or API key`),null;let t=`${Ya().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await Do(async()=>{let n=xo()?.accessToken,r;if(n&&mo())r={Authorization:`Bearer ${n}`,"anthropic-beta":Xa};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 ee.get(t,{headers:{"Content-Type":`application/json`,"User-Agent":ss(),...r},timeout:5e3}),a=Wc().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: ${ee.isAxiosError(e)?e.response?.status??e.code:`unknown`}`),e}}async function Kc(){try{let e=await Gc();if(!e)return;let t=e.client_data??null,n=e.additional_model_options??[],r=z();if(no(r.clientDataCache,t)&&no(r.additionalModelOptionsCache,n)){I(`[Bootstrap] Cache unchanged, skipping write`);return}I(`[Bootstrap] Cache updated, persisting to disk`),V(e=>({...e,clientDataCache:t,additionalModelOptionsCache:n}))}catch(e){U(e)}}fo(),sr(),yr(),Ui(),u();var qc=new Map;function Jc(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;Va()===`windows`&&(e=e.split(fc.sep).join(uc.sep),t=t.split(fc.sep).join(uc.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 Yc=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function Xc(e){let t=`${e.name}: ${e.message}`;return Yc.some(e=>e.test(t))}var Zc=null;function Qc(){let e=process.listeners(`warning`);Zc&&e.includes(Zc)||(Jc()||process.removeAllListeners(`warning`),Zc=e=>{try{let t=`${e.name}: ${e.message.slice(0,50)}`,n=qc.get(t)||0;(qc.has(t)||qc.size<1e3)&&qc.set(t,n+1);let r=Xc(e);G(`tengu_node_warning`,{is_internal:+!!r,occurrence_count:n+1,classname:e.name}),l(process.env.CLAUDE_DEBUG)&&I(`${r?`[Internal Warning]`:`[Warning]`} ${e.toString()}`,{level:`warn`})}catch{}},process.on(`warning`,Zc))}dt(),_e(),rr(),Ct(),Sn(),Lr();function $c(){return(0,X.jsxs)(jr,{children:[`MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the`,` `,(0,X.jsx)(Ar,{url:`https://code.workmate.com/docs/en/mcp`,children:`MCP documentation`}),`.`]})}W(),L(),Lr();function el({serverName:e,onDone:t}){function n(n){switch(G(`tengu_mcp_dialog_choice`,{choice:n}),n){case`yes`:case`yes_all`:{let r=(oa()||{}).enabledMcpjsonServers||[];r.includes(e)||R(`localSettings`,{enabledMcpjsonServers:[...r,e]}),n===`yes_all`&&R(`localSettings`,{enableAllProjectMcpServers:!0}),t();break}case`no`:{let n=(oa()||{}).disabledMcpjsonServers||[];n.includes(e)||R(`localSettings`,{disabledMcpjsonServers:[...n,e]}),t();break}}}return(0,X.jsxs)(zr,{title:`New MCP server found in .mcp.json: ${e}`,color:`warning`,onCancel:()=>n(`no`),children:[(0,X.jsx)($c,{}),(0,X.jsx)(qe,{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`)})]})}ps(),W(),Lr(),L(),b();function tl({serverNames:e,onDone:t}){function n(n){let r=oa()||{},i=r.enabledMcpjsonServers||[],a=r.disabledMcpjsonServers||[],[o,s]=fs(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,Nc.useCallback)(()=>{let n=(oa()||{}).disabledMcpjsonServers||[];R(`localSettings`,{disabledMcpjsonServers:[...new Set([...n,...e])]}),t()},[e,t]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(zr,{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,X.jsx)($c,{}),(0,X.jsx)(Jt,{options:e.map(e=>({label:e,value:e})),defaultValue:e,onSubmit:n,onCancel:r,hideIndexes:!0})]}),(0,X.jsx)(kr,{paddingX:1,children:(0,X.jsx)(jr,{dimColor:!0,italic:!0,children:(0,X.jsxs)(Nr,{children:[(0,X.jsx)(Or,{shortcut:`Space`,action:`select`}),(0,X.jsx)(Or,{shortcut:`Enter`,action:`confirm`}),(0,X.jsx)(g,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`reject all`})]})})})]})}ht();async function nl(e){let{servers:t}=ze(`project`),n=Object.keys(t).filter(e=>br(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,X.jsx)(bt,{children:(0,X.jsx)(x,{children:(0,X.jsx)(el,{serverName:t,onDone:r})})}))}else e.render((0,X.jsx)(bt,{children:(0,X.jsx)(x,{children:(0,X.jsx)(tl,{serverNames:n,onDone:r})})}))})}Qi(),en(),Ne(),zn(),ot(),er(),qt(),Ke(),Mt(),B(),Ui();var rl={iterm:`iTerm`,"iterm.app":`iTerm`,ghostty:`Ghostty`,kitty:`kitty`,alacritty:`Alacritty`,wezterm:`WezTerm`,apple_terminal:`Terminal`};function il(){if(process.platform!==`darwin`)return;let e=process.env.TERM_PROGRAM;if(!e)return;let t=rl[e.toLowerCase()];t&&z().deepLinkTerminal!==t&&(V(e=>({...e,deepLinkTerminal:t})),I(`Stored deep link terminal preference: ${t}`))}var al=class{constructor(){m(this,`frameDurations`,[]),m(this,`firstRenderTime`,void 0),m(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(),ne(),li(),Lr(),Sn(),ht(),B(),u(),qs(),Vs(),L();function ol(){V(e=>({...e,hasCompletedOnboarding:!0,lastOnboardingVersion:`0.0.17`}))}function sl(e,t){return new Promise(n=>{e.render(t(e=>void n(e)))})}async function Z(e,t,n){return cl(e,t,{color:`error`,beforeExit:n})}async function cl(e,t,n){let{Text:r}=await import(`./src-D3yIF9I42.js`),i=n?.color,a=n?.exitCode??1;e.render(i?(0,X.jsx)(r,{color:i,children:t}):(0,X.jsx)(r,{children:t})),e.unmount(),await n?.beforeExit?.(),process.exit(a)}function Q(e,t,n){return sl(e,e=>(0,X.jsx)(Mr,{initialState:z().theme,onThemeSave:e=>V(t=>({...t,theme:e})),children:(0,X.jsx)(bt,{onChangeAppState:n?.onChangeAppState,children:(0,X.jsx)(x,{children:t(e)})})}))}async function ll(e,t){e.render(t),_u(),await e.waitUntilExit(),await D(0)}async function ul(e,t,n,r){if(l(!1)||process.env.IS_DEMO)return!1;let i=z(),a=!1;if(!i.theme||!i.hasCompletedOnboarding){a=!0;let{Onboarding:t}=await import(`./Onboarding-BAJXV7Ay.js`);await Q(e,e=>(0,X.jsx)(t,{onDone:()=>{ol(),e()}}),{onChangeAppState:Ys})}if(!l(process.env.CLAUBBIT)){if(!ya()){let{TrustDialog:t}=await import(`./TrustDialog-6wJF3W6K.js`);await Q(e,e=>(0,X.jsx)(t,{commands:r,onDone:e}))}Zr(!0),Un();let{errors:t}=Hs();if(t.length===0&&await nl(e),await Oe()){let t=Ce(await pt(!0)),{AgentsMdExternalIncludesDialog:n}=await import(`./AgentsMdExternalIncludesDialog--D4BeNAN.js`);await Q(e,e=>(0,X.jsx)(n,{onDone:e,isStandaloneDialog:!0,externalIncludes:t}))}}if(ec(),il(),Js(),setImmediate(()=>Bc()),await Fs()){let{GroveDialog:t}=await import(`./Grove-CClEZT2e.js`);if(await Q(e,e=>(0,X.jsx)(t,{showIfAlreadyViewed:!1,location:a?`onboarding`:`policy_update_modal`,onDone:e}))===`escape`)return G(`tengu_grove_policy_exited`,{}),Ge(0),!1}if(process.env.ANTHROPIC_API_KEY&&!s()){let t=Mo(process.env.ANTHROPIC_API_KEY);if(Ca(t)===`new`){let{ApproveApiKey:n}=await import(`./ApproveApiKey-lv4Sg0RR.js`);await Q(e,e=>(0,X.jsx)(n,{customApiKeyTruncated:t,onDone:e}),{onChangeAppState:Ys})}}if((t===`bypassPermissions`||n)&&!sa()){let{BypassPermissionsModeDialog:t}=await import(`./BypassPermissionsModeDialog-B5QBJTB4.js`);await Q(e,e=>(0,X.jsx)(t,{onAccept:e}))}return a}function dl(e){let t=0,n=$s(e);n.stdin&&G(`tengu_stdin_interactive`,{});let r=new al,i=Qs();gi(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()})}\n`;pc(a,t)}if(!Ir())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}}}}}Sn();async function fl(e,t){let{InvalidSettingsDialog:n}=await import(`./InvalidSettingsDialog-Cr9fmSyh.js`);return Q(e,e=>(0,X.jsx)(n,{settingsErrors:t.settingsErrors,onContinue:e,onExit:t.onExit}))}async function pl(e){let{TeleportResumeWrapper:t}=await import(`./TeleportResumeWrapper-Bb14JeEk.js`);return Q(e,e=>(0,X.jsx)(t,{onComplete:e,onCancel:()=>e(null),source:`cliArg`}))}async function ml(e,t){let{TeleportRepoMismatchDialog:n}=await import(`./TeleportRepoMismatchDialog-B0epkMgp.js`);return Q(e,e=>(0,X.jsx)(n,{targetRepo:t.targetRepo,initialPaths:t.initialPaths,onSelectPath:e,onCancel:()=>e(null)}))}async function hl(e,t,n,r){let[i,{ResumeConversation:a},{App:o}]=await Promise.all([n,import(`./ResumeConversation-NSVT3gn7.js`),import(`./App-mri25OrC.js`)]);await ll(e,(0,X.jsx)(o,{getFpsMetrics:t.getFpsMetrics,stats:t.stats,initialState:t.initialState,children:(0,X.jsx)(x,{children:(0,X.jsx)(a,{...r,worktreePaths:i})})}))}qo();var gl=5,_l=30,vl="After you finish implementing the change:\n1. **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.\n2. **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.\n3. **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.\n4. **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 yl(e){return`# Batch: Parallel Work Orchestration
|
|
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 te(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 h(){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=h})),xc=r((e=>{var{Argument:t}=gc(),{Command:n}=bc(),{CommanderError:r,InvalidArgumentError:i}=hc(),{Help:a}=_c(),{Option:o}=vc();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})),Sc=r(((e,t)=>{var n=xc();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)}));a(),u(),p(),yi(),si(),Ki(),Li(),Ji(),Vi(),Da(),Ui(),W(),Ja(),Yi(),Lo();var{program:Cc,createCommand:wc,createArgument:Tc,createOption:Ec,CommanderError:Dc,InvalidArgumentError:Oc,InvalidOptionArgumentError:kc,Command:Ac,Argument:jc,Option:Y,Help:Mc}=n(Sc(),1).default;te(),Fr();var Nc=n(Pr(),1),X=Br();Lr(),Yr(),Ai(),ka(),Pa(),Ra(),Ba(),Na(),Ha(),Ua(),Zi(),Ga(),ea(),Xr(),$a(),$i(),to(),ua(),R(),pa(),Wo(),Ta(),B(),rs(),is(),oo(),ho(),Ro(),_o(),os(),To(),uo(),ao(),So(),go(),Oo(),ts(),A(),cr(),ms(),Gn(),M(),Qn(),se(),_n(),hr(),Yt(),dt(),cs(),_(),Ae(),Yo(),Zo(),_t(),Me(),cn(),mt(),Jn(),ks(),ne(),Ps(),Wn(),sn(),yr(),It(),Ht(),je(),T(),y(),le(),Lt(),Le(),or(),Za(),Ia();var Pc=!1;function Fc(){if(Pc||(Pc=!0,La())||l(process.env.CLAUDE_CODE_USE_BEDROCK)||l(process.env.CLAUDE_CODE_USE_VERTEX)||l(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||Ya().BASE_API_URL;fetch(e,{method:`HEAD`,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}function Ic(){if(process.env.NODE_EXTRA_CA_CERTS)return;let e=Lc();e&&(process.env.NODE_EXTRA_CA_CERTS=e,I(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${e}`))}function Lc(){try{let e=z()?.env,t=sa(`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}}B(),Ui(),Cs(),vs(),u(),qs(),Ss(),xs(),Ms();var Rc=!1,zc=i(async()=>{let e=Date.now();H(`info`,`init_started`),K(`init_function_start`);try{let t=Date.now();Sa(),Dr({loadTheme:()=>z().theme,saveTheme:e=>V(t=>({...t,theme:e}))}),H(`info`,`init_configs_enabled`,{duration_ms:Date.now()-t}),K(`init_configs_enabled`);let n=Date.now();Ks();try{let{restoreActiveProvider:e}=await import(`./switcher-DJDxjLPQ.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`})}Ic(),H(`info`,`init_safe_env_vars_applied`,{duration_ms:Date.now()-n}),K(`init_safe_env_vars_applied`),ar(),K(`init_after_graceful_shutdown`),import(`./firstPartyEventLogger-YQm0DoVu.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`),Fo(),K(`init_after_oauth_populate`),_s(),K(`init_after_jetbrains_detection`),ws(),Bs()&&Rs(),Ln()&&fn(),K(`init_after_remote_settings_check`),ga();let r=Date.now();I(`[init] configureGlobalMTLS starting`),ns(),H(`info`,`init_mtls_configured`,{duration_ms:Date.now()-r}),I(`[init] configureGlobalMTLS complete`);let i=Date.now();if(I(`[init] configureGlobalAgents starting`),as(),H(`info`,`init_proxy_configured`,{duration_ms:Date.now()-i}),I(`[init] configureGlobalAgents complete`),K(`init_network_configured`),await As(),Fc(),l(process.env.CLAUDE_CODE_REMOTE))try{let{initUpstreamProxy:e,getUpstreamProxyEnv:t}=await import(`./upstreamproxy-CTOuotLO.js`),{registerUpstreamProxyEnvFn:n}=await import(`./subprocessEnv-DtBCqQIo.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(Wa(),Gi(pr),Ue()){let e=Date.now();await xn(),H(`info`,`init_scratchpad_created`,{duration_ms:Date.now()-e})}try{let{getRipgrepStatus:e}=await import(`./ripgrep-CBUbn6Po.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 Ii){if(ai()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}\n`),Ke(1);return}return import(`./InvalidConfigDialog-DFiB0Kzc.js`).then(t=>t.showInvalidConfigDialog({error:e}))}else throw e}});function Bc(){Bs()?(ai()&&ys()&&Vc().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`),zs().then(async()=>{I(`[3P telemetry] Remote managed settings loaded, initializing telemetry`),Js(),await Vc()}).catch(e=>{I(`[3P telemetry] Telemetry init failed (remote settings path): ${F(e)}`,{level:`error`})})):Vc().catch(e=>{I(`[3P telemetry] Telemetry init failed: ${F(e)}`,{level:`error`})})}async function Vc(){if(!Rc){if(!l(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)){Rc=!0,I(`[3P telemetry] Skipped — CLAUDE_CODE_ENABLE_TELEMETRY not set`);return}Rc=!0;try{await Hc()}catch(e){throw Rc=!1,e}}}async function Hc(){let{initializeTelemetry:e}=await import(`./instrumentation-DpgB3GFx.js`),t=await e();t&&(ni(t,(e,n)=>{let r=t?.createCounter(e,n);return{add(e,t={}){let n={...bs(),...t};r?.add(e,n)}}}),hi()?.add(1))}ve();async function Uc(e,t,n,r){let{App:i}=await import(`./App-NkBqbDbC.js`),{REPL:a}=await import(`./REPL-yzvMFfaU.js`);await r(e,(0,X.jsx)(i,{...t,children:(0,X.jsx)(a,{...n})}))}gs(),Za(),B(),Ui(),Ia();var Wc=qr(()=>Vr({client_data:Kr(P(),Hr()).nullish(),additional_model_options:Gr(Vr({model:P(),name:P(),description:P()}).transform(({model:e,name:t,description:n})=>({value:e,label:t,description:n}))).nullish()}));async function Gc(){if(La())return I(`[Bootstrap] Skipped: Nonessential traffic disabled`),null;if(ro()!==`firstParty`)return I(`[Bootstrap] Skipped: 3P provider`),null;let e=No();if(!(xo()?.accessToken&&mo())&&!e)return I(`[Bootstrap] Skipped: no usable OAuth or API key`),null;let t=`${Ya().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await Do(async()=>{let n=xo()?.accessToken,r;if(n&&mo())r={Authorization:`Bearer ${n}`,"anthropic-beta":Xa};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 ee.get(t,{headers:{"Content-Type":`application/json`,"User-Agent":ss(),...r},timeout:5e3}),a=Wc().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: ${ee.isAxiosError(e)?e.response?.status??e.code:`unknown`}`),e}}async function Kc(){try{let e=await Gc();if(!e)return;let t=e.client_data??null,n=e.additional_model_options??[],r=z();if(no(r.clientDataCache,t)&&no(r.additionalModelOptionsCache,n)){I(`[Bootstrap] Cache unchanged, skipping write`);return}I(`[Bootstrap] Cache updated, persisting to disk`),V(e=>({...e,clientDataCache:t,additionalModelOptionsCache:n}))}catch(e){U(e)}}fo(),kt(),br(),Ui(),u();var qc=new Map;function Jc(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;Va()===`windows`&&(e=e.split(fc.sep).join(uc.sep),t=t.split(fc.sep).join(uc.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 Yc=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function Xc(e){let t=`${e.name}: ${e.message}`;return Yc.some(e=>e.test(t))}var Zc=null;function Qc(){let e=process.listeners(`warning`);Zc&&e.includes(Zc)||(Jc()||process.removeAllListeners(`warning`),Zc=e=>{try{let t=`${e.name}: ${e.message.slice(0,50)}`,n=qc.get(t)||0;(qc.has(t)||qc.size<1e3)&&qc.set(t,n+1);let r=Xc(e);G(`tengu_node_warning`,{is_internal:+!!r,occurrence_count:n+1,classname:e.name}),l(process.env.CLAUDE_DEBUG)&&I(`${r?`[Internal Warning]`:`[Warning]`} ${e.toString()}`,{level:`warn`})}catch{}},process.on(`warning`,Zc))}Er(),ie(),ir(),wt(),Sn(),Lr();function $c(){return(0,X.jsxs)(jr,{children:[`MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the`,` `,(0,X.jsx)(Ar,{url:`https://code.workmate.com/docs/en/mcp`,children:`MCP documentation`}),`.`]})}W(),R(),Lr();function el({serverName:e,onDone:t}){function n(n){switch(G(`tengu_mcp_dialog_choice`,{choice:n}),n){case`yes`:case`yes_all`:{let r=(ta()||{}).enabledMcpjsonServers||[];r.includes(e)||L(`localSettings`,{enabledMcpjsonServers:[...r,e]}),n===`yes_all`&&L(`localSettings`,{enableAllProjectMcpServers:!0}),t();break}case`no`:{let n=(ta()||{}).disabledMcpjsonServers||[];n.includes(e)||L(`localSettings`,{disabledMcpjsonServers:[...n,e]}),t();break}}}return(0,X.jsxs)(zr,{title:`New MCP server found in .mcp.json: ${e}`,color:`warning`,onCancel:()=>n(`no`),children:[(0,X.jsx)($c,{}),(0,X.jsx)(Je,{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`)})]})}ps(),W(),Lr(),R(),Ve();function tl({serverNames:e,onDone:t}){function n(n){let r=ta()||{},i=r.enabledMcpjsonServers||[],a=r.disabledMcpjsonServers||[],[o,s]=fs(e,e=>n.includes(e));G(`tengu_mcp_multidialog_choice`,{approved:o.length,rejected:s.length}),o.length>0&&L(`localSettings`,{enabledMcpjsonServers:[...new Set([...i,...o])]}),s.length>0&&L(`localSettings`,{disabledMcpjsonServers:[...new Set([...a,...s])]}),t()}let r=(0,Nc.useCallback)(()=>{let n=(ta()||{}).disabledMcpjsonServers||[];L(`localSettings`,{disabledMcpjsonServers:[...new Set([...n,...e])]}),t()},[e,t]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(zr,{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,X.jsx)($c,{}),(0,X.jsx)(O,{options:e.map(e=>({label:e,value:e})),defaultValue:e,onSubmit:n,onCancel:r,hideIndexes:!0})]}),(0,X.jsx)(kr,{paddingX:1,children:(0,X.jsx)(jr,{dimColor:!0,italic:!0,children:(0,X.jsxs)(Nr,{children:[(0,X.jsx)(Or,{shortcut:`Space`,action:`select`}),(0,X.jsx)(Or,{shortcut:`Enter`,action:`confirm`}),(0,X.jsx)(g,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`reject all`})]})})})]})}pt();async function nl(e){let{servers:t}=He(`project`),n=Object.keys(t).filter(e=>j(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,X.jsx)(yt,{children:(0,X.jsx)(b,{children:(0,X.jsx)(el,{serverName:t,onDone:r})})}))}else e.render((0,X.jsx)(yt,{children:(0,X.jsx)(b,{children:(0,X.jsx)(tl,{serverNames:n,onDone:r})})}))})}na(),k(),Ne(),zn(),ct(),tr(),Jt(),qe(),Pt(),B(),Ui();var rl={iterm:`iTerm`,"iterm.app":`iTerm`,ghostty:`Ghostty`,kitty:`kitty`,alacritty:`Alacritty`,wezterm:`WezTerm`,apple_terminal:`Terminal`};function il(){if(process.platform!==`darwin`)return;let e=process.env.TERM_PROGRAM;if(!e)return;let t=rl[e.toLowerCase()];t&&z().deepLinkTerminal!==t&&(V(e=>({...e,deepLinkTerminal:t})),I(`Stored deep link terminal preference: ${t}`))}var al=class{constructor(){m(this,`frameDurations`,[]),m(this,`firstRenderTime`,void 0),m(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(),ne(),si(),Lr(),Sn(),pt(),B(),u(),qs(),Vs(),R();function ol(){V(e=>({...e,hasCompletedOnboarding:!0,lastOnboardingVersion:`0.0.19`}))}function sl(e,t){return new Promise(n=>{e.render(t(e=>void n(e)))})}async function Z(e,t,n){return cl(e,t,{color:`error`,beforeExit:n})}async function cl(e,t,n){let{Text:r}=await import(`./src-D3yIF9I42.js`),i=n?.color,a=n?.exitCode??1;e.render(i?(0,X.jsx)(r,{color:i,children:t}):(0,X.jsx)(r,{children:t})),e.unmount(),await n?.beforeExit?.(),process.exit(a)}function Q(e,t,n){return sl(e,e=>(0,X.jsx)(Mr,{initialState:z().theme,onThemeSave:e=>V(t=>({...t,theme:e})),children:(0,X.jsx)(yt,{onChangeAppState:n?.onChangeAppState,children:(0,X.jsx)(b,{children:t(e)})})}))}async function ll(e,t){e.render(t),_u(),await e.waitUntilExit(),await D(0)}async function ul(e,t,n,r){if(l(!1)||process.env.IS_DEMO)return!1;let i=z(),a=!1;if(!i.theme||!i.hasCompletedOnboarding){a=!0;let{Onboarding:t}=await import(`./Onboarding-BnjdTwci.js`);await Q(e,e=>(0,X.jsx)(t,{onDone:()=>{ol(),e()}}),{onChangeAppState:Ys})}if(!l(process.env.CLAUBBIT)){if(!ya()){let{TrustDialog:t}=await import(`./TrustDialog-C0aiR_LU.js`);await Q(e,e=>(0,X.jsx)(t,{commands:r,onDone:e}))}ii(!0),Hn();let{errors:t}=Hs();if(t.length===0&&await nl(e),await De()){let t=Se(await ft(!0)),{AgentsMdExternalIncludesDialog:n}=await import(`./AgentsMdExternalIncludesDialog-Bny8WDwC.js`);await Q(e,e=>(0,X.jsx)(n,{onDone:e,isStandaloneDialog:!0,externalIncludes:t}))}}if(ec(),il(),Js(),setImmediate(()=>Bc()),await Fs()){let{GroveDialog:t}=await import(`./Grove-DC4jyxeB.js`);if(await Q(e,e=>(0,X.jsx)(t,{showIfAlreadyViewed:!1,location:a?`onboarding`:`policy_update_modal`,onDone:e}))===`escape`)return G(`tengu_grove_policy_exited`,{}),Ke(0),!1}if(process.env.ANTHROPIC_API_KEY&&!s()){let t=Mo(process.env.ANTHROPIC_API_KEY);if(Ca(t)===`new`){let{ApproveApiKey:n}=await import(`./ApproveApiKey-BKzkEkW-.js`);await Q(e,e=>(0,X.jsx)(n,{customApiKeyTruncated:t,onDone:e}),{onChangeAppState:Ys})}}if((t===`bypassPermissions`||n)&&!ia()){let{BypassPermissionsModeDialog:t}=await import(`./BypassPermissionsModeDialog-D254L98G.js`);await Q(e,e=>(0,X.jsx)(t,{onAccept:e}))}return a}function dl(e){let t=0,n=$s(e);n.stdin&&G(`tengu_stdin_interactive`,{});let r=new al,i=Qs();Qr(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()})}\n`;pc(a,t)}if(!Ir())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}}}}}Sn();async function fl(e,t){let{InvalidSettingsDialog:n}=await import(`./InvalidSettingsDialog-BHNo2__T.js`);return Q(e,e=>(0,X.jsx)(n,{settingsErrors:t.settingsErrors,onContinue:e,onExit:t.onExit}))}async function pl(e){let{TeleportResumeWrapper:t}=await import(`./TeleportResumeWrapper-Bmf13tGU.js`);return Q(e,e=>(0,X.jsx)(t,{onComplete:e,onCancel:()=>e(null),source:`cliArg`}))}async function ml(e,t){let{TeleportRepoMismatchDialog:n}=await import(`./TeleportRepoMismatchDialog-CDv1cbo-.js`);return Q(e,e=>(0,X.jsx)(n,{targetRepo:t.targetRepo,initialPaths:t.initialPaths,onSelectPath:e,onCancel:()=>e(null)}))}async function hl(e,t,n,r){let[i,{ResumeConversation:a},{App:o}]=await Promise.all([n,import(`./ResumeConversation-Ld7tYLKO.js`),import(`./App-NkBqbDbC.js`)]);await ll(e,(0,X.jsx)(o,{getFpsMetrics:t.getFpsMetrics,stats:t.stats,initialState:t.initialState,children:(0,X.jsx)(b,{children:(0,X.jsx)(a,{...r,worktreePaths:i})})}))}qo();var gl=5,_l=30,vl="After you finish implementing the change:\n1. **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.\n2. **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.\n3. **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.\n4. **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 yl(e){return`# Batch: Parallel Work Orchestration
|
|
20
20
|
|
|
21
21
|
You are orchestrating a large, parallelizable change across this codebase.
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ ${e}
|
|
|
26
26
|
|
|
27
27
|
## Phase 1: Research and Plan (Plan Mode)
|
|
28
28
|
|
|
29
|
-
Call the \`${
|
|
29
|
+
Call the \`${Xo}\` tool now to enter plan mode, then:
|
|
30
30
|
|
|
31
31
|
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.
|
|
32
32
|
|
|
@@ -43,7 +43,7 @@ Call the \`${Zo}\` tool now to enter plan mode, then:
|
|
|
43
43
|
- A dev-server + curl pattern (for API changes: start the server, hit the affected endpoints)
|
|
44
44
|
- An existing e2e/integration test suite the worker can run
|
|
45
45
|
|
|
46
|
-
If you cannot find a concrete e2e path, use the \`${
|
|
46
|
+
If you cannot find a concrete e2e path, use the \`${$o}\` 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.
|
|
47
47
|
|
|
48
48
|
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.
|
|
49
49
|
|
|
@@ -53,11 +53,11 @@ Call the \`${Zo}\` tool now to enter plan mode, then:
|
|
|
53
53
|
- The e2e test recipe (or "skip e2e because …" if the user chose that)
|
|
54
54
|
- The exact worker instructions you will give each agent (the shared template)
|
|
55
55
|
|
|
56
|
-
5. Call \`${
|
|
56
|
+
5. Call \`${Jo}\` to present the plan for approval.
|
|
57
57
|
|
|
58
58
|
## Phase 2: Spawn Workers (After Plan Approval)
|
|
59
59
|
|
|
60
|
-
Once the plan is approved, spawn one background agent per work unit using the \`${
|
|
60
|
+
Once the plan is approved, spawn one background agent per work unit using the \`${aa}\` 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.
|
|
61
61
|
|
|
62
62
|
For each agent, the prompt must be fully self-contained. Include:
|
|
63
63
|
- The overall goal (the user's instruction)
|
|
@@ -89,7 +89,7 @@ When all agents have reported, render the final table and a one-line summary (e.
|
|
|
89
89
|
Examples:
|
|
90
90
|
/batch migrate from react to vue
|
|
91
91
|
/batch replace all uses of lodash with native equivalents
|
|
92
|
-
/batch add type annotations to all untyped function parameters`;function Sl(){
|
|
92
|
+
/batch add type annotations to all untyped function parameters`;function Sl(){v({name:`batch`,description:`调研并规划一次大规模改动,然后并行投放到 5–30 个相互隔离的 worktree 智能体中执行,每个智能体各自开一个 PR。`,whenToUse:`当用户想对大量文件做横向的机械式改动(迁移、重构、批量改名),且这些改动可拆解为互不依赖的并行单元时使用。`,argumentHint:`<instruction>`,userInvocable:!0,disableModelInvocation:!0,async getPromptForCommand(e){let t=e.trim();return t?await Ma()?[{type:`text`,text:yl(t)}]:[{type:`text`,text:bl}]:[{type:`text`,text:xl}]}})}Ce(),Xr();var Cl=[`Global`,`Chat`,`Autocomplete`,`Confirmation`,`Help`,`Transcript`,`HistorySearch`,`Task`,`ThemePicker`,`Settings`,`Tabs`,`Attachments`,`Footer`,`MessageSelector`,`DiffDialog`,`ModelPicker`,`Select`,`Plugin`],wl={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`},Tl=`app:interrupt.app:exit.app:toggleTodos.app:toggleTranscript.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(`.`),El=qr(()=>Vr({context:Wr(Cl).describe(`UI context where these bindings apply. Global bindings work everywhere.`),bindings:Kr(P().describe(`Keystroke pattern (e.g., "ctrl+k", "shift+tab")`),Ur([Wr(Tl),P().regex(/^command:[a-zA-Z0-9:\-_]+$/).describe(`Command binding (e.g., "command:help", "command:compact"). Executes the slash command as if typed.`),Jr().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`));qr(()=>Vr({$schema:P().optional().describe(`JSON Schema URL for editor validation`),$docs:P().optional().describe(`Documentation URL`),bindings:Gr(El()).describe(`Array of keybinding blocks by context`)}).describe(`Work Mate keybindings configuration. Customize keyboard shortcuts by context.`)),T();function Dl(){return Wl([`Context`,`Description`],Cl.map(e=>[`\`${e}\``,wl[e]]))}function Ol(){let e={};for(let t of Ye)for(let[n,r]of Object.entries(t.bindings))r&&(e[r]||(e[r]={keys:[],context:t.context}),e[r].keys.push(n));return Wl([`Action`,`Default Key(s)`,`Context`],Tl.map(t=>{let n=e[t],r=n?n.keys.map(e=>`\`${e}\``).join(`, `):`(none)`,i=n?n.context:kl(t);return[`\`${t}\``,r,i]}))}function kl(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 Al(){let e=[];e.push(`### Non-rebindable (errors)`);for(let t of x)e.push(`- \`${t.key}\` — ${t.reason}`);e.push(``),e.push(`### Terminal reserved (errors/warnings)`);for(let t of _e)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 Ie)e.push(`- \`${t.key}\` — ${t.reason}`);return e.join(`
|
|
93
93
|
`)}var jl={$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.workmate.com/docs/en/keybindings`,bindings:[{context:`Chat`,bindings:{"ctrl+e":`chat:externalEditor`}}]},Ml={context:`Chat`,bindings:{"ctrl+s":null}},Nl={context:`Chat`,bindings:{"ctrl+g":null,"ctrl+e":`chat:externalEditor`}},Pl={context:`Global`,bindings:{"ctrl+k ctrl+t":`app:toggleTodos`}},Fl=[`# Keybindings Skill`,``,"Create or modify `~/.workmate/keybindings.json` to customize keyboard shortcuts.",``,`## CRITICAL: Read Before Write`,``,"**Always read `~/.workmate/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(`
|
|
94
94
|
`),Il=[`## File Format`,``,"```json",Ni(jl,null,2),"```",``,"Always include the `$schema` and `$docs` fields."].join(`
|
|
95
95
|
`),Ll=[`## 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(`
|
|
@@ -98,10 +98,10 @@ Examples:
|
|
|
98
98
|
`),Bl=[`## Common Patterns`,``,`### Rebind a key`,"To change the external editor shortcut from `ctrl+g` to `ctrl+e`:","```json",Ni(Nl,null,2),"```",``,`### Add a chord binding`,"```json",Ni(Pl,null,2),"```"].join(`
|
|
99
99
|
`),Vl=[`## 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(`
|
|
100
100
|
`),Hl=[`## Validation with /doctor`,``,'The `/doctor` command includes a "Keybinding Configuration Issues" section that validates `~/.workmate/keybindings.json`.',``,`### Common Issues and Fixes`,``,Wl([`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: ~/.workmate/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(`
|
|
101
|
-
`);function Ul(){
|
|
101
|
+
`);function Ul(){v({name:`keybindings-help`,description:`当用户想自定义键盘快捷键、重新绑定按键、添加组合键(chord),或修改 ~/.workmate/keybindings.json 时使用。例如:"rebind ctrl+s"、"add a chord shortcut"、"change the submit key"、"customize keybindings"。`,allowedTools:[`Read`],userInvocable:!1,isEnabled:gn,async getPromptForCommand(e){let t=Dl(),n=Ol(),r=[Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,`## Reserved Shortcuts\n\n${Al()}`,`## Available Contexts\n\n${t}`,`## Available Actions\n\n${n}`];return e&&r.push(`## User Request\n\n${e}`),[{type:`text`,text:r.join(`
|
|
102
102
|
|
|
103
103
|
`)}]}})}function Wl(e,t){let n=e.map(()=>`---`);return[`| ${e.join(` | `)} |`,`| ${n.join(` | `)} |`,...t.map(e=>`| ${e.join(` | `)} |`)].join(`
|
|
104
|
-
`)}
|
|
104
|
+
`)}T();var Gl=`# /ultracode — Workflow Orchestration Playbook
|
|
105
105
|
|
|
106
106
|
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.
|
|
107
107
|
|
|
@@ -305,11 +305,11 @@ Use this tool for multi-step orchestration where control flow should be determin
|
|
|
305
305
|
## Resume
|
|
306
306
|
|
|
307
307
|
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.
|
|
308
|
-
`;function Kl(){
|
|
308
|
+
`;function Kl(){v({name:`ultracode`,description:`进入多智能体 workflow 编排模式:何时使用 Workflow 工具、脚本原语、质量模式、确定性约束、resume/预算、以及文件和命令。`,whenToUse:`当任务可拆解或可并行、需要多视角置信度(如先查找再对抗式验证)、超出单一上下文容量(大迁移、广审计、长尾枚举)或需要可恢复/可审计时——用 Workflow 工具编排多个子智能体。`,userInvocable:!0,async getPromptForCommand(e){let t=Gl;return e&&(t+=`\n## User input\n\n${e}\n`),[{type:`text`,text:t}]}})}T();function ql(){v({name:`loop`,description:`在固定时间间隔循环运行某条 prompt 或 slash command(例如 /loop 5m /foo,默认 10m)`,whenToUse:`当用户想设置一个周期性任务、轮询状态,或按固定间隔重复运行某个内容时使用(例如"每 5 分钟检查一次部署状态"、"持续运行 /babysit-prs")。一次性任务不要用本命令。`,argumentHint:`[interval] <prompt>`,userInvocable:!1,isEnabled:()=>!1,async getPromptForCommand(){return[{type:`text`,text:`The /loop command is no longer available.`}]}})}me(),Qt(),si(),T();var Jl=`# Dream: Memory Consolidation (manual run)
|
|
309
309
|
|
|
310
310
|
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.
|
|
311
311
|
|
|
312
|
-
`;function Yl(){
|
|
312
|
+
`;function Yl(){v({name:`dream`,description:`手动触发记忆整合——回顾、整理并修剪自动记忆文件。`,whenToUse:`当用户输入 /dream 或想手动整合记忆、整理记忆文件、清理过期条目时使用。`,userInvocable:!0,isEnabled:()=>ma(),async getPromptForCommand(e){let t=va(),n=Ut(Zr());await jn();let r=Jl+ot(t,n,``);return e&&(r+=`\n\n## Additional context from user\n\n${e}`),[{type:`text`,text:r}]}})}function Xl(){Ul(),Sl(),Kl(),ql(),Yl()}kn(),gr(),Pn();async function Zl(){if(!await za(`gh`))return`not_installed`;let{exitCode:e}=await Fa(`gh`,[`auth`,`token`],{stdout:`ignore`,stderr:`ignore`,timeout:5e3,reject:!1});return e===0?`authenticated`:`not_authenticated`}lr(),st(),jt(),W(),Dn();async function Ql(e,t){let n=await S(e),r=Nt(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}})}Tr(),W(),_n(),hr(),u(),Ji();function $l(e){e.command(`add <name> <commandOrUrl> [args...]`).description(`Add an MCP server to Work Mate.
|
|
313
313
|
|
|
314
314
|
Examples:
|
|
315
315
|
# Add HTTP server:
|
|
@@ -322,35 +322,35 @@ Examples:
|
|
|
322
322
|
claude mcp add -e API_KEY=xxx my-server -- npx my-mcp-server
|
|
323
323
|
|
|
324
324
|
# Add stdio server with subprocess flags:
|
|
325
|
-
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 Y(`--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(!
|
|
325
|
+
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 Y(`--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(!sr())).action(async(e,t,n,r)=>{let i=t,a=n;e?i||J(`Error: Command is required when server name is provided.
|
|
326
326
|
Usage: claude mcp add <name> <command> [args...]`):J(`Error: Server name is required.
|
|
327
|
-
Usage: claude mcp add <name> <command> [args...]`);try{let t
|
|
328
|
-
`),!s&&l&&(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 he(e,{type:`stdio`,command:i,args:a,env:c(r.env)},t),process.stdout.write(`Added stdio MCP server ${e} with command: ${i} ${a.join(` `)} to ${t} config\n`);q(`File modified: ${O(t)}`)}catch(e){J(e.message)}})}jt(),Li(),L();function eu(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 J(`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 J(`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 J(`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 J(`Error: --client-secret requires MCP_XAA_IDP_CLIENT_SECRET env var`);let i=_n(),a=i?.issuer,o=i?.clientId,{error:s}=R(`userSettings`,{xaaIdp:{issuer:e.issuer,clientId:e.clientId,callbackPort:n}});if(s)return J(`Error writing settings: ${s.message}`);if(a&&(tr(a)===tr(e.issuer)?o!==e.clientId&&(or(a),Yt(a)):(or(a),Yt(a))),r){let{success:t,warning:n}=Ht(e.issuer,r);if(!t)return J(`Error: settings written but keychain save failed${n?` — ${n}`:``}. Re-run with --client-secret once keychain is available.`)}q(`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=_n();if(!t)return J(`Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.`);if(e.idToken){let n=Dn(t.issuer,e.idToken);return q(`id_token cached for ${t.issuer} (expires ${new Date(n).toISOString()})`)}if(e.force&&or(t.issuer),Pn(t.issuer)!==void 0)return q(`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 h({idpIssuer:t.issuer,idpClientId:t.clientId,idpClientSecret:Xn(t.issuer),callbackPort:t.callbackPort,onAuthorizationUrl:e=>{process.stdout.write(`If the browser did not open, visit:\n ${e}\n`)}}),q(`Logged in. MCP servers with --xaa will now authenticate silently.`)}catch(e){J(`IdP login failed: ${F(e)}`)}}),t.command(`show`).description(`Show the current IdP connection config`).action(()=>{let e=_n();if(!e)return q(`No XAA IdP connection configured.`);let t=Xn(e.issuer)!==void 0,n=Pn(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`),q()}),t.command(`clear`).description(`Clear the IdP connection config and cached id_token`).action(()=>{let e=_n(),{error:t}=R(`userSettings`,{xaaIdp:void 0});if(t)return J(`Error writing settings: ${t.message}`);e&&(or(e.issuer),Yt(e.issuer)),q(`XAA IdP connection cleared`)})}A();function tu(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]}}In(),S(),Re(),W(),B(),Ra(),L();function nu(){if(z().bypassPermissionsModeAccepted)try{sa()||R(`userSettings`,{skipDangerousModePermissionPrompt:!0}),G(`tengu_migrate_bypass_permissions_accepted`,{}),V(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(),B(),Ra(),L();function ru(){let e=ba(),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=ia(`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`))&&wa(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`,{})}}W(),B(),Wo(),L();function iu(){if(ro()!==`firstParty`||!Go())return;let e=ia(`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`}),V(e=>({...e,legacyOpusMigrationTimestamp:Date.now()})),G(`tengu_legacy_opus_migration`,{from_model:e}))}W(),Oo();function au(){ko()&&G(`tengu_opus_to_opus1m_migration`,{skipped:!0})}B();function ou(){V(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})}li(),B(),L();function su(){z().sonnet1m45MigrationComplete||(ia(`userSettings`)?.model===`sonnet[1m]`&&R(`userSettings`,{model:`sonnet-4-5-20250929[1m]`}),ti()===`sonnet[1m]`&&ii(`sonnet-4-5-20250929[1m]`),V(e=>({...e,sonnet1m45MigrationComplete:!0})))}W(),go(),B(),Wo(),L();function cu(){if(ro()!==`firstParty`||!Vo()&&!wo()&&!po())return;let e=ia(`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`}),z().numStartups>1&&V(e=>({...e,sonnet45To46MigrationTimestamp:Date.now()})),G(`tengu_sonnet45_to_46_migration`,{from_model:e,has_1m:t})}B(),Ra(),L(),W(),go(),B(),Wo(),L();function lu(){if(!z().opusProMigrationComplete){if(ro()!==`firstParty`||!Vo()){V(e=>({...e,opusProMigrationComplete:!0})),G(`tengu_reset_pro_to_opus_default`,{skipped:!0});return}if(oa()?.model===void 0){let e=Date.now();V(t=>({...t,opusProMigrationComplete:!0,opusProMigrationTimestamp:e})),G(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!1})}else V(e=>({...e,opusProMigrationComplete:!0})),G(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!0})}}Ja(),Za(),yt(),Jn(),go(),B(),qs(),Ha(),Ji(),W(),li(),Me(),Lr(),Ws(),u(),Na(),Ra(),Oo(),Mt(),Ft(),L(),v(),ue(),jt(),Ki(),Ui(),Li(),ne(),ln(),ka(),Es(),En(),Ms(),tt(),K(`main_tsx_entry`),la(),jo(),K(`main_tsx_imports_loaded`);function uu(){try{let e=ia(`policySettings`);if(e){let t=ca(e);G(`tengu_managed_settings_loaded`,{keyCount:t.length,keys:t.join(`,`)})}}catch{}}function du(){let e=so(ei()??zo());Ql(ji(),co(e,hi())),lr().then(({enabled:e,errors:t})=>{let n=Sr();de(e,n,Dt()),pe(t,n)}).catch(e=>U(e))}function fu(){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),o(`--use-system-ca`)&&(e.has_use_system_ca=!0),o(`--use-openssl-ca`)&&(e.has_use_openssl_ca=!0),e}async function pu(){if(js())return;let[e,t,n]=await Promise.all([Ma(),Aa(),Zl()]);G(`tengu_startup_telemetry`,{is_git:e,worktree_count:t,gh_auth_status:n,sandbox_enabled:Kn.isSandboxingEnabled(),are_unsandboxed_commands_allowed:Kn.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:Kn.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:_a(),prefers_reduced_motion:da().prefersReducedMotion??!1,...fu()})}var mu=11;function hu(){z().migrationVersion!==mu&&(nu(),ru(),lu(),su(),iu(),cu(),au(),ou(),V(e=>e.migrationVersion===mu?e:{...e,migrationVersion:mu}))}function gu(){if(ki()){H(`info`,`prefetch_system_context_non_interactive`),Un();return}ya()?(H(`info`,`prefetch_system_context_has_trust`),Un()):H(`info`,`prefetch_system_context_skipped_no_trust`)}function _u(){l(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||d()||(As(),Ee(),gu(),lc(),l(process.env.CLAUDE_CODE_USE_BEDROCK)&&!l(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&vo(),l(process.env.CLAUDE_CODE_USE_VERTEX)&&!l(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&io(),hs(ji(),AbortSignal.timeout(3e3),[]),Co(),Wt.initialize(),d()||Zs.initialize())}function vu(e){try{let t=e.trim(),n=t.startsWith(`{`)&&t.endsWith(`}`),r;if(n)Ka(t)||(process.stderr.write(N.red(`Error: Invalid JSON provided to --settings
|
|
329
|
-
`)),process.exit(1)),r=
|
|
330
|
-
`),
|
|
327
|
+
Usage: claude mcp add <name> <command> [args...]`);try{let t=nr(r.scope),n=Gt(r.transport);r.xaa&&!sr()&&J(`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`),h()||e.push(`'claude mcp xaa setup' (settings.xaaIdp not configured)`),e.length&&J(`Error: --xaa requires: ${e.join(`, `)}`)}let s=r.transport!==void 0,l=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:l}),n===`sse`){i||J(`Error: URL is required for SSE transport.`);let n=r.header?Bt(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 be():void 0,l={type:`sse`,url:i,headers:n,oauth:s};await xr(e,l,t),c&&Un(e,l,c),process.stdout.write(`Added SSE MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${Ni(n,null,2)}\n`)}else if(n===`http`){i||J(`Error: URL is required for HTTP transport.`);let n=r.header?Bt(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 be():void 0,l={type:`http`,url:i,headers:n,oauth:s};await xr(e,l,t),c&&Un(e,l,c),process.stdout.write(`Added HTTP MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${Ni(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.
|
|
328
|
+
`),!s&&l&&(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 xr(e,{type:`stdio`,command:i,args:a,env:c(r.env)},t),process.stdout.write(`Added stdio MCP server ${e} with command: ${i} ${a.join(` `)} to ${t} config\n`);q(`File modified: ${Bn(t)}`)}catch(e){J(e.message)}})}Yt(),Li(),R();function eu(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 J(`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 J(`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 J(`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 J(`Error: --client-secret requires MCP_XAA_IDP_CLIENT_SECRET env var`);let i=h(),a=i?.issuer,o=i?.clientId,{error:s}=L(`userSettings`,{xaaIdp:{issuer:e.issuer,clientId:e.clientId,callbackPort:n}});if(s)return J(`Error writing settings: ${s.message}`);if(a&&(Nn(a)===Nn(e.issuer)?o!==e.clientId&&(E(a),vt(a)):(E(a),vt(a))),r){let{success:t,warning:n}=Xn(e.issuer,r);if(!t)return J(`Error: settings written but keychain save failed${n?` — ${n}`:``}. Re-run with --client-secret once keychain is available.`)}q(`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=h();if(!t)return J(`Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.`);if(e.idToken){let n=hn(t.issuer,e.idToken);return q(`id_token cached for ${t.issuer} (expires ${new Date(n).toISOString()})`)}if(e.force&&E(t.issuer),xt(t.issuer)!==void 0)return q(`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 Ee({idpIssuer:t.issuer,idpClientId:t.clientId,idpClientSecret:C(t.issuer),callbackPort:t.callbackPort,onAuthorizationUrl:e=>{process.stdout.write(`If the browser did not open, visit:\n ${e}\n`)}}),q(`Logged in. MCP servers with --xaa will now authenticate silently.`)}catch(e){J(`IdP login failed: ${F(e)}`)}}),t.command(`show`).description(`Show the current IdP connection config`).action(()=>{let e=h();if(!e)return q(`No XAA IdP connection configured.`);let t=C(e.issuer)!==void 0,n=xt(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`),q()}),t.command(`clear`).description(`Clear the IdP connection config and cached id_token`).action(()=>{let e=h(),{error:t}=L(`userSettings`,{xaaIdp:void 0});if(t)return J(`Error writing settings: ${t.message}`);e&&(E(e.issuer),vt(e.issuer)),q(`XAA IdP connection cleared`)})}Zt();function tu(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]}}rr(),yn(),Re(),W(),B(),Ra(),R();function nu(){if(z().bypassPermissionsModeAccepted)try{ia()||L(`userSettings`,{skipDangerousModePermissionPrompt:!0}),G(`tengu_migrate_bypass_permissions_accepted`,{}),V(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(),B(),Ra(),R();function ru(){let e=ba(),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=sa(`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&&L(`localSettings`,a),(o.includes(`enableAllProjectMcpServers`)||o.includes(`enabledMcpjsonServers`)||o.includes(`disabledMcpjsonServers`))&&wa(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`,{})}}W(),B(),Wo(),R();function iu(){if(ro()!==`firstParty`||!Go())return;let e=sa(`userSettings`)?.model;e!==`claude-opus-4-20250514`&&e!==`claude-opus-4-1-20250805`&&e!==`claude-opus-4-0`&&e!==`claude-opus-4-1`||(L(`userSettings`,{model:`opus`}),V(e=>({...e,legacyOpusMigrationTimestamp:Date.now()})),G(`tengu_legacy_opus_migration`,{from_model:e}))}W(),Oo();function au(){ko()&&G(`tengu_opus_to_opus1m_migration`,{skipped:!0})}B();function ou(){V(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})}si(),B(),R();function su(){z().sonnet1m45MigrationComplete||(sa(`userSettings`)?.model===`sonnet[1m]`&&L(`userSettings`,{model:`sonnet-4-5-20250929[1m]`}),xi()===`sonnet[1m]`&&bi(`sonnet-4-5-20250929[1m]`),V(e=>({...e,sonnet1m45MigrationComplete:!0})))}W(),go(),B(),Wo(),R();function cu(){if(ro()!==`firstParty`||!Vo()&&!wo()&&!po())return;let e=sa(`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]`);L(`userSettings`,{model:t?`sonnet[1m]`:`sonnet`}),z().numStartups>1&&V(e=>({...e,sonnet45To46MigrationTimestamp:Date.now()})),G(`tengu_sonnet45_to_46_migration`,{from_model:e,has_1m:t})}B(),Ra(),R(),W(),go(),B(),Wo(),R();function lu(){if(!z().opusProMigrationComplete){if(ro()!==`firstParty`||!Vo()){V(e=>({...e,opusProMigrationComplete:!0})),G(`tengu_reset_pro_to_opus_default`,{skipped:!0});return}if(ta()?.model===void 0){let e=Date.now();V(t=>({...t,opusProMigrationComplete:!0,opusProMigrationTimestamp:e})),G(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!1})}else V(e=>({...e,opusProMigrationComplete:!0})),G(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!0})}}Ja(),Za(),_t(),Jn(),go(),B(),qs(),Ha(),Ji(),W(),si(),y(),Lr(),Ws(),u(),Na(),Ra(),Oo(),Pt(),Lt(),R(),_n(),hr(),Yt(),Ki(),Ui(),Li(),ne(),cn(),ka(),Es(),En(),Ms(),tt(),K(`main_tsx_entry`),Qi(),jo(),K(`main_tsx_imports_loaded`);function uu(){try{let e=sa(`policySettings`);if(e){let t=oa(e);G(`tengu_managed_settings_loaded`,{keyCount:t.length,keys:t.join(`,`)})}}catch{}}function du(){let e=so(ri()??zo());Ql(ji(),co(e,Ei())),ur().then(({enabled:e,errors:t})=>{let n=wr();pe(e,n,tn()),he(t,n)}).catch(e=>U(e))}function fu(){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),o(`--use-system-ca`)&&(e.has_use_system_ca=!0),o(`--use-openssl-ca`)&&(e.has_use_openssl_ca=!0),e}async function pu(){if(js())return;let[e,t,n]=await Promise.all([Ma(),Aa(),Zl()]);G(`tengu_startup_telemetry`,{is_git:e,worktree_count:t,gh_auth_status:n,sandbox_enabled:w.isSandboxingEnabled(),are_unsandboxed_commands_allowed:w.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:w.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:_a(),prefers_reduced_motion:ca().prefersReducedMotion??!1,...fu()})}var mu=11;function hu(){z().migrationVersion!==mu&&(nu(),ru(),lu(),su(),iu(),cu(),au(),ou(),V(e=>e.migrationVersion===mu?e:{...e,migrationVersion:mu}))}function gu(){if(ai()){H(`info`,`prefetch_system_context_non_interactive`),Hn();return}ya()?(H(`info`,`prefetch_system_context_has_trust`),Hn()):H(`info`,`prefetch_system_context_skipped_no_trust`)}function _u(){l(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||d()||(As(),Te(),gu(),lc(),l(process.env.CLAUDE_CODE_USE_BEDROCK)&&!l(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&vo(),l(process.env.CLAUDE_CODE_USE_VERTEX)&&!l(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&io(),hs(ji(),AbortSignal.timeout(3e3),[]),Co(),In.initialize(),d()||Zs.initialize())}function vu(e){try{let t=e.trim(),n=t.startsWith(`{`)&&t.endsWith(`}`),r;if(n)Ka(t)||(process.stderr.write(N.red(`Error: Invalid JSON provided to --settings
|
|
329
|
+
`)),process.exit(1)),r=mr(`claude-settings`,`.json`,{contentHash:t}),zi(r,t,`utf8`);else{let{resolvedPath:t}=Hi(qi(),e);try{mc(t,`utf8`)}catch(e){throw Mi(e)&&(process.stderr.write(N.red(`Error: Settings file not found: ${t}\n`)),process.exit(1)),e}r=t}vi(r),_i()}catch(e){e instanceof Error&&U(e),process.stderr.write(N.red(`Error processing settings: ${F(e)}\n`)),process.exit(1)}}function yu(e){try{ui(la(e)),_i()}catch(e){e instanceof Error&&U(e),process.stderr.write(N.red(`Error processing --setting-sources: ${F(e)}\n`)),process.exit(1)}}function bu(){K(`eagerLoadSettings_start`);let e=tu(`--settings`);e&&vu(e);let t=tu(`--setting-sources`);t!==void 0&&yu(t),K(`eagerLoadSettings_end`)}function xu(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(l(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 $={host:void 0,cwd:void 0,permissionMode:void 0,dangerouslySkipPermissions:!1,local:!1,extraCliArgs:[],remoteBin:void 0};async function Su(){K(`main_function_start`),process.env.NoDefaultCurrentDirectoryInExePath=`1`,Qc(),process.on(`exit`,()=>{Du();try{let{peekWorkflowService:t}=(Rn(),e(er));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.indexOf(`--handle-uri`);if(e!==-1&&process.argv[e+1]){let{enableConfigs:t}=await import(`./config-e0Goy478.js`);t();let n=process.argv[e+1],{handleDeepLinkUri:r}=await import(`./protocolHandler-C-CFTcUJ.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-e0Goy478.js`);e();let{handleUrlSchemeLaunch:t}=await import(`./protocolHandler-C-CFTcUJ.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
|
|
330
|
+
`),Ke(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=l(process.env.CLAUDE_CODE_FORCE_INTERACTIVE),o=n||r||i||!a&&!process.stdout.isTTY;o&&rc(),Di(!o),xu(o);let s=(()=>{if(l(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`})();pi(s);let c=process.env.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT;c===`markdown`||c===`html`?$r(c):!s.startsWith(`sdk-`)&&s!==`claude-desktop`&&s!==`local-agent`&&s!==`remote`&&$r(`markdown`),process.env.CLAUDE_CODE_ENVIRONMENT_KIND===`bridge`&&li(`remote-control`),K(`main_client_type_determined`),bu(),K(`main_before_run`),await wu(),K(`main_after_run`)}async function Cu(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 Oa(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.
|
|
331
331
|
`),[e,n].filter(Boolean).join(`
|
|
332
|
-
`)}return e}async function wu(){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 Ac().configureHelp(e()).enablePositionalOptions();K(`run_commander_initialized`),t.hook(`preAction`,async e=>{K(`preAction_start`),await Promise.all([na(),Bo()]),K(`preAction_after_mdm`),await zc(),K(`preAction_after_init`),l(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)||(process.title=`claude`);let{initSinks:t}=await import(`./sinks-Cf4vx9UX.js`);t(),K(`preAction_after_sinks`);let n=e.getOptionValue(`pluginDir`);Array.isArray(n)&&n.length>0&&n.every(e=>typeof e==`string`)&&(Oi(n),gn(`preAction: --plugin-dir inline plugins`)),hu(),K(`preAction_after_migrations`),Ls(),Qn(),K(`preAction_after_remote_settings`),K(`preAction_after_settings_sync`)}),t.name(`wm`).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 Y(`--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 Work Mate 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 AGENTS.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 (AGENTS.md dirs), --mcp-config, --settings, --agents, --plugin-dir.`,()=>!0).addOption(new Y(`--init`,`Run Setup hooks with init trigger, then continue`).hideHelp()).addOption(new Y(`--init-only`,`Run Setup and SessionStart:startup hooks, then exit`).hideHelp()).addOption(new Y(`--maintenance`,`Run Setup hooks with maintenance trigger, then continue`).hideHelp()).addOption(new Y(`--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 Y(`--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 Y(`--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 Y(`--thinking <mode>`,`Thinking mode: enabled (equivalent to adaptive), disabled`).choices([`enabled`,`adaptive`,`disabled`]).hideHelp()).addOption(new Y(`--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 Y(`--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 Y(`--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 Y(`--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 Y(`--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 Y(`--permission-prompt-tool <tool>`,`MCP tool to use for permission prompts (only works with --print)`).argParser(String).hideHelp()).addOption(new Y(`--system-prompt <prompt>`,`System prompt to use for the session`).argParser(String)).addOption(new Y(`--system-prompt-file <file>`,`Read system prompt from a file`).argParser(String).hideHelp()).addOption(new Y(`--append-system-prompt <prompt>`,`Append a system prompt to the default system prompt`).argParser(String)).addOption(new Y(`--append-system-prompt-file <file>`,`Read system prompt from a file and append to the default system prompt`).argParser(String).hideHelp()).addOption(new Y(`--permission-mode <mode>`,`Permission mode to use for the session`).argParser(String).choices(Yi)).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 Y(`--prefill <text>`,`Pre-fill the prompt input with text without submitting it`).hideHelp()).addOption(new Y(`--deep-link-origin`,`Signal that this session was launched from a deep link`).hideHelp()).addOption(new Y(`--deep-link-repo <slug>`,`Repo slug the deep link ?repo= parameter resolved to the current cwd`).hideHelp()).addOption(new Y(`--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 Y(`--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 Y(`--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 Y(`--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 Work Mate in Chrome integration`).option(`--no-chrome`,`Disable Work Mate 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(N.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:u=[],permissionMode:f,addDir:p=[],fallbackModel:m,betas:ee=[],ide:te=!1,sessionId:h,includeHookEvents:ne,includePartialMessages:ae}=t;t.prefill&&ic(t.prefill);let ce,ue=t.agents,de=t.agent;de&&(process.env.CLAUDE_CODE_AGENT=de);let g=t.outputFormat,_=t.inputFormat,pe=t.verbose??z().verbose,he=t.print,_e=t.init??!1,ve=t.initOnly??!1,xe=t.maintenance??!1,Se=t.disableSlashCommands||!1,Ce=Ns()?t.worktree:void 0,we=typeof Ce==`string`?Ce:void 0,v=Ce!==void 0,De;if(we){let e=me(we);e!==null&&(De=e,we=void 0)}let Oe=Ns()&&t.tmux===!0;Oe&&(v||(process.stderr.write(N.red(`Error: --tmux requires --worktree
|
|
332
|
+
`)}return e}async function wu(){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 Ac().configureHelp(e()).enablePositionalOptions();K(`run_commander_initialized`),t.hook(`preAction`,async e=>{K(`preAction_start`),await Promise.all([da(),Bo()]),K(`preAction_after_mdm`),await zc(),K(`preAction_after_init`),l(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)||(process.title=`claude`);let{initSinks:t}=await import(`./sinks-QQ_6Op7q.js`);t(),K(`preAction_after_sinks`);let n=e.getOptionValue(`pluginDir`);Array.isArray(n)&&n.length>0&&n.every(e=>typeof e==`string`)&&(fi(n),mn(`preAction: --plugin-dir inline plugins`)),hu(),K(`preAction_after_migrations`),Ls(),$n(),K(`preAction_after_remote_settings`),K(`preAction_after_settings_sync`)}),t.name(`wm`).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 Y(`--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 Work Mate 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 AGENTS.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 (AGENTS.md dirs), --mcp-config, --settings, --agents, --plugin-dir.`,()=>!0).addOption(new Y(`--init`,`Run Setup hooks with init trigger, then continue`).hideHelp()).addOption(new Y(`--init-only`,`Run Setup and SessionStart:startup hooks, then exit`).hideHelp()).addOption(new Y(`--maintenance`,`Run Setup hooks with maintenance trigger, then continue`).hideHelp()).addOption(new Y(`--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 Y(`--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 Y(`--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 Y(`--thinking <mode>`,`Thinking mode: enabled (equivalent to adaptive), disabled`).choices([`enabled`,`adaptive`,`disabled`]).hideHelp()).addOption(new Y(`--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 Y(`--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 Y(`--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 Y(`--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 Y(`--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 Y(`--permission-prompt-tool <tool>`,`MCP tool to use for permission prompts (only works with --print)`).argParser(String).hideHelp()).addOption(new Y(`--system-prompt <prompt>`,`System prompt to use for the session`).argParser(String)).addOption(new Y(`--system-prompt-file <file>`,`Read system prompt from a file`).argParser(String).hideHelp()).addOption(new Y(`--append-system-prompt <prompt>`,`Append a system prompt to the default system prompt`).argParser(String)).addOption(new Y(`--append-system-prompt-file <file>`,`Read system prompt from a file and append to the default system prompt`).argParser(String).hideHelp()).addOption(new Y(`--permission-mode <mode>`,`Permission mode to use for the session`).argParser(String).choices(fa)).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 Y(`--prefill <text>`,`Pre-fill the prompt input with text without submitting it`).hideHelp()).addOption(new Y(`--deep-link-origin`,`Signal that this session was launched from a deep link`).hideHelp()).addOption(new Y(`--deep-link-repo <slug>`,`Repo slug the deep link ?repo= parameter resolved to the current cwd`).hideHelp()).addOption(new Y(`--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 Y(`--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 Y(`--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 Y(`--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 Work Mate in Chrome integration`).option(`--no-chrome`,`Disable Work Mate 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(N.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:u=[],permissionMode:f,addDir:p=[],fallbackModel:m,betas:ee=[],ide:te=!1,sessionId:h,includeHookEvents:ne,includePartialMessages:ie}=t;t.prefill&&ic(t.prefill);let se,le=t.agents,pe=t.agent;pe&&(process.env.CLAUDE_CODE_AGENT=pe);let g=t.outputFormat,_=t.inputFormat,me=t.verbose??z().verbose,he=t.print,_e=t.init??!1,ve=t.initOnly??!1,be=t.maintenance??!1,v=t.disableSlashCommands||!1,Se=Ns()?t.worktree:void 0,Ce=typeof Se==`string`?Se:void 0,Ee=Se!==void 0,De;if(Ce){let e=ge(Ce);e!==null&&(De=e,Ce=void 0)}let Ae=Ns()&&t.tmux===!0;Ae&&(Ee||(process.stderr.write(N.red(`Error: --tmux requires --worktree
|
|
333
333
|
`)),process.exit(1)),Va()===`windows`&&(process.stderr.write(N.red(`Error: --tmux is not supported on Windows
|
|
334
|
-
`)),process.exit(1)),await
|
|
335
|
-
`)),process.exit(1)),!
|
|
336
|
-
`)),process.exit(1)),Vn(e)&&(process.stderr.write(N.red(`Error: Session ID ${e} is already in use.\n`)),process.exit(1))}let
|
|
337
|
-
`)),process.exit(1));let t=process.env.CLAUDE_CODE_REMOTE_SESSION_ID||
|
|
338
|
-
`)),process.exit(1));let
|
|
339
|
-
`)),process.exit(1));try{
|
|
340
|
-
`)),process.exit(1));try{
|
|
341
|
-
`);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}=
|
|
334
|
+
`)),process.exit(1)),await ue()||(process.stderr.write(N.red(`Error: tmux is not installed.\n${Rt()}\n`)),process.exit(1)));let je=t.sdkUrl??void 0,Me=ie||l(process.env.CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES);(ne||l(process.env.CLAUDE_CODE_REMOTE))&&ye(!0),je&&(_||(_=`stream-json`),g||(g=`stream-json`),t.verbose===void 0&&(me=!0),t.print||(he=!0));let y=t.teleport??null,Ne=t.remote,Ie=Ne===!0?``:Ne??null,Le=t.remoteControl??t.rc,Re=typeof Le==`string`&&Le.length>0?Le:void 0;if(h&&((t.continue||t.resume)&&!t.forkSession&&(process.stderr.write(N.red(`Error: --session-id can only be used with --continue or --resume if --fork-session is also specified.
|
|
335
|
+
`)),process.exit(1)),!je)){let e=St(h);e||(process.stderr.write(N.red(`Error: Invalid session ID. Must be a valid UUID.
|
|
336
|
+
`)),process.exit(1)),Vn(e)&&(process.stderr.write(N.red(`Error: Session ID ${e} is already in use.\n`)),process.exit(1))}let Ve=t.file;if(Ve&&Ve.length>0){let e=ls();e||(process.stderr.write(N.red(`Error: Session token required for file downloads. CLAUDE_CODE_SESSION_ACCESS_TOKEN must be set.
|
|
337
|
+
`)),process.exit(1));let t=process.env.CLAUDE_CODE_REMOTE_SESSION_ID||gi(),n=nt(Ve);n.length>0&&(se=zt(n,{baseUrl:process.env.ANTHROPIC_BASE_URL||Ya().BASE_API_URL,oauthToken:e,sessionId:t}))}let b=ai();m&&t.model&&m===t.model&&(process.stderr.write(N.red(`Error: Fallback model cannot be the same as the main model. Please specify a different model for --fallback-model.
|
|
338
|
+
`)),process.exit(1));let He=t.systemPrompt;if(t.systemPromptFile){t.systemPrompt&&(process.stderr.write(N.red(`Error: Cannot use both --system-prompt and --system-prompt-file. Please use only one.
|
|
339
|
+
`)),process.exit(1));try{He=mc(dc(t.systemPromptFile),`utf8`)}catch(e){Pi(e)===`ENOENT`&&(process.stderr.write(N.red(`Error: System prompt file not found: ${dc(t.systemPromptFile)}\n`)),process.exit(1)),process.stderr.write(N.red(`Error reading system prompt file: ${F(e)}\n`)),process.exit(1)}}let x=t.appendSystemPrompt;if(t.appendSystemPromptFile){t.appendSystemPrompt&&(process.stderr.write(N.red(`Error: Cannot use both --append-system-prompt and --append-system-prompt-file. Please use only one.
|
|
340
|
+
`)),process.exit(1));try{x=mc(dc(t.appendSystemPromptFile),`utf8`)}catch(e){Pi(e)===`ENOENT`&&(process.stderr.write(N.red(`Error: Append system prompt file not found: ${dc(t.appendSystemPromptFile)}\n`)),process.exit(1)),process.stderr.write(N.red(`Error reading append system prompt file: ${F(e)}\n`)),process.exit(1)}}let{mode:S,notification:Ue}=vr({permissionModeCli:f,dangerouslySkipPermissions:i});ei(S===`bypassPermissions`),(t.enableAutoMode||f===`auto`||S===`auto`||!f&&it())&&un(!0);let C={};if(u&&u.length>0){let e=u.map(e=>e.trim()).filter(e=>e.length>0),t={},n=[];for(let r of e){let e=null,i=[],a=Ka(r);if(a){let t=ze({configObject:a,filePath:`command line`,expandVars:!0,scope:`dynamic`});t.config?e=t.config.mcpServers:i=t.errors}else{let t=Ge({filePath:dc(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(`
|
|
341
|
+
`);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}=ut(Et(t,e=>({...e,scope:`dynamic`})));n.length>0&&process.stderr.write(`Warning: MCP ${eo(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),C={...C,...e}}}let qe=t.strictMcpConfig||!1;_r()&&(qe&&(process.stderr.write(N.red(`You cannot use --strict-mcp-config when an enterprise MCP config is present`)),process.exit(1)),C&&!rt(C)&&(process.stderr.write(N.red(`You cannot dynamically configure MCP servers when an enterprise MCP config is present`)),process.exit(1))),Ci(p);let Je=await Ze({allowedToolsCli:s,disallowedToolsCli:c,baseToolsCli:o,permissionMode:S,allowDangerouslySkipPermissions:a,addDirs:p}),w=Je.toolPermissionContext,{warnings:Ye,dangerousPermissions:tt}=Je;tt.length>0&&(w=vn(w)),Ye.forEach(e=>{console.error(e)});let ot=b&&!qe&&!_r()&&!d()?Xe().then(e=>{let{allowed:t,blocked:n}=ut(e);return n.length>0&&process.stderr.write(`Warning: claude.ai MCP ${eo(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),t}):Promise.resolve({});I(`[STARTUP] Loading MCP configs...`);let st=Date.now(),ct,dt=(qe||d()?Promise.resolve({servers:{}}):ae(C)).then(e=>(ct=Date.now()-st,e));_&&_!==`text`&&_!==`stream-json`&&(console.error(`Error: Invalid input format "${_}".`),process.exit(1)),_===`stream-json`&&g!==`stream-json`&&(console.error(`Error: --input-format=stream-json requires output-format=stream-json.`),process.exit(1)),je&&(_!==`stream-json`||g!==`stream-json`)&&(console.error(`Error: --sdk-url requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),t.replayUserMessages&&(_!==`stream-json`||g!==`stream-json`)&&(console.error(`Error: --replay-user-messages requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),Me&&(!b||g!==`stream-json`)&&(Ea(`Error: --include-partial-messages requires --print and --output-format=stream-json.`),process.exit(1)),t.sessionPersistence===!1&&!b&&(Ea(`Error: --no-session-persistence can only be used with --print mode.`),process.exit(1));let T=await Cu(e||``,_??`text`);K(`action_after_input_prompt`),Eu(t);let ft=Oe(w);K(`action_tools_loaded`);let E;if(es({isNonInteractiveSession:b})&&t.jsonSchema&&(E=Ri(t.jsonSchema)),E){let e=Qo(E);`tool`in e?(ft=[...ft,e.tool],G(`tengu_structured_output_enabled`,{schema_property_count:Object.keys(E.properties||{}).length,has_required_fields:!!E.required})):G(`tengu_structured_output_failure`,{error:`Invalid JSON schema`})}K(`action_before_setup`),I(`[STARTUP] Running setup()...`);let pt=Date.now(),{setup:mt}=await import(`./setup-CK3ybjjM.js`),_t=ji();process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&Xl();let vt=mt(_t,S,a,Ee,Ce,Ae,h?St(h):void 0,De),yt=Ee?null:Fe(_t),xt=Ee?null:dn(_t);yt?.catch(()=>{}),xt?.catch(()=>{}),await vt,I(`[STARTUP] setup() completed in ${Date.now()-pt}ms`),K(`action_after_setup`);let wt=!!t.replayUserMessages;ai()&&(Js(),Hn(),Te(),yo());let kt=t.name?.trim();kt&&oe(kt);let jt=t.model==="default"?zo():t.model,Nt=m==="default"?zo():m,Pt=Ee?ji():_t;I(`[STARTUP] Loading commands and agents...`);let It=Date.now(),[Lt,Bt]=await Promise.all([yt??Fe(Pt),xt??dn(Pt)]);I(`[STARTUP] Commands and agents loaded in ${Date.now()-It}ms`),K(`action_commands_loaded`);let Ht=[];if(le)try{let e=Ka(le);e&&(Ht=Xt(e,`flagSettings`))}catch(e){U(e)}let Ut=[...Bt.allAgents,...Ht],Gt={...Bt,allAgents:Ut,activeAgents:Kn(Ut)},Jt=pe??ca().agent,O;if(Jt&&(O=Gt.activeAgents.find(e=>e.agentType===Jt),O||I(`Warning: agent "${Jt}" not found. Available agents: ${Gt.activeAgents.map(e=>e.agentType).join(`, `)}. Using default behavior.`)),ti(O?.agentType),O&&G(`tengu_agent_flag`,{agentType:Zn(O)?O.agentType:`custom`,...pe&&{source:`cli`}}),O?.agentType&&pn(O.agentType),b&&O&&!He&&!Zn(O)){let e=O.getSystemPrompt();e&&(He=e)}O?.initialPrompt&&(typeof T==`string`?T=T?`${O.initialPrompt}\n\n${T}`:O.initialPrompt:T||(T=O.initialPrompt));let Yt=jt;!Yt&&O?.model&&O.model!==`inherit`&&(Yt=so(O.model)),bi(Yt),Oi(Ao()||null);let Zt=ri(),Qt=so(Zt??zo()),tn;if(bt()){let e=xe()?t.advisor:void 0;e&&(I(`[AdvisorTool] --advisor ${e}`),Tt(Qt)||(process.stderr.write(N.red(`Error: The model "${Qt}" does not support the advisor tool.\n`)),process.exit(1)),gt(bo(so(e)))||(process.stderr.write(N.red(`Error: The model "${e}" cannot be used as an advisor.\n`)),process.exit(1))),tn=xe()?e??ke():e,tn&&I(`[AdvisorTool] Advisor model: ${tn}`)}if(t.proactive||l(process.env.CLAUDE_CODE_PROACTIVE)){let e=`
|
|
342
342
|
# Proactive Mode
|
|
343
343
|
|
|
344
344
|
You are in proactive mode. Take initiative — explore, act, and make progress without waiting for instructions.
|
|
345
345
|
|
|
346
346
|
Start by briefly greeting the user.
|
|
347
347
|
|
|
348
|
-
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.`;S=S?`${S}\n\n${e}`:e}let A,j,$t;if(!b){let t=dl(!1);j=t.getFpsMetrics,$t=t.stats;let{createRoot:n}=await import(`./src-D3yIF9I42.js`);A=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 ul(A,C,a,Pt);I(`[STARTUP] showSetupScreens() completed in ${Date.now()-r}ms`),i&&e?.trim().toLowerCase()===`/login`&&(e=``),i&&(Is(),Rt(),Os(),import(`./trustedDevice-1Q4FTNyX.js`).then(e=>(e.clearTrustedDeviceToken(),e.enrollTrustedDevice())));let o=await Uo();o.valid||await Z(A,o.message)}if(process.exitCode!==void 0){I(`Graceful shutdown initiated, skipping further initialization`);return}if(rn(),!b){let{errors:e}=fa(),t=e.filter(e=>!e.mcpErrorMetadata);t.length>0&&await fl(A,{settingsErrors:t,onExit:()=>Ge(1)})}let en=z().startupPrefetchedAt??0;d()?(I(`Skipping startup prefetches, last ran ${Math.round((Date.now()-en)/1e3)}s ago`),Po()):(I(`Starting background startup prefetches${en>0?` last ran ${Math.round((Date.now()-en)/1e3)}s ago`:``}`),Ue().catch(e=>U(e)),Kc(),Ho()),b||oc();let{servers:on}=await ct;I(`[STARTUP] MCP configs resolved in ${ot}ms (awaited at +${Date.now()-at}ms)`);let cn={...on,...w},ln={},mn={};for(let[e,t]of Object.entries(cn)){let n=t;n.type===`sdk`?ln[e]=n:mn[e]=n}K(`action_mcp_configs_loaded`);let gn=b?Promise.resolve({clients:[],tools:[],commands:[]}):Fe(mn),_n=b?Promise.resolve({clients:[],tools:[],commands:[]}):it.then(e=>Object.keys(e).length>0?Fe(e):{clients:[],tools:[],commands:[]}),vn=Promise.all([gn,_n]).then(([e,t])=>({clients:[...e.clients,...t.clients],tools:tn([...e.tools,...t.tools],`name`),commands:tn([...e.commands,...t.commands],`name`)})),xn=ve||_e||xe||b||t.continue||t.resume?null:sn(`startup`,{agentType:O?.agentType,model:Yt}),Sn=[];vn.catch(()=>{});let En=[],Dn=[],On=[],An=ur(),M=An===!1?{type:`disabled`}:{type:`adaptive`};if(t.thinking===`adaptive`||t.thinking===`enabled`)An=!0,M={type:`adaptive`};else if(t.thinking===`disabled`)An=!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?(An=!0,M={type:`enabled`,budgetTokens:e}):e===0&&(An=!1,M={type:`disabled`}))}H(`info`,`started`,{version:`0.0.17`,is_native_binary:Qa()}),Gi(async()=>{H(`info`,`exited`)}),Tu({hasInitialPrompt:!!e,hasStdin:!!E,verbose:pe,debug:n,debugToStderr:r,print:he??!1,outputFormat:g??`text`,inputFormat:_??`text`,numAllowedTools:s.length,numDisallowedTools:c.length,mcpClientCount:Object.keys(cn).length,worktreeEnabled:v,skipWebFetchPreflight:da().skipWebFetchPreflight,githubActionInputs:process.env.GITHUB_ACTION_INPUTS,dangerouslySkipPermissionsPassed:i??!1,permissionMode:C,modeIsBypass:C===`bypassPermissions`,allowDangerouslySkipPermissionsPassed:a,systemPromptFlag:x?t.systemPromptFile?`file`:`flag`:void 0,appendSystemPromptFlag:S?t.appendSystemPromptFile?`file`:`flag`:void 0,thinkingConfig:M,assistantActivationPath:void 0}),Nn(mn,T),uu(),Tt().then(e=>{e&&(Ct&&Nt(Ct),kn().then(e=>{e>=2&&G(`tengu_concurrent_sessions`,{num_sessions:e})}))}),d()||(b?(await et(),K(`action_after_plugins_init`),Yn().then(()=>Tn())):et().then(async()=>{K(`action_after_plugins_init`),await Yn(),Tn()}));let Pn=ve||_e?`init`:xe?`maintenance`:null;if(ve){Js(),await nn(`init`,{forceSyncExecution:!0}),await sn(`startup`,{forceSyncExecution:!0}),Ge(0);return}if(b){(g===`stream-json`||g===`json`)&&Wi(!0),Js(),Bc();let e=t.continue||t.resume||y||Pn?void 0:sn(`startup`);e?.catch(()=>{}),K(`before_validateForceLoginOrg`);let n=await Uo();n.valid||(process.stderr.write(`${n.message}\n`),process.exit(1));let r=Se?[]:Pt.filter(e=>e.type===`prompt`&&!e.disableNonInteractive||e.type===`local`&&e.supportsNonInteractive),i=St(),a=At({...i,mcp:{...i.mcp,clients:En,commands:On,tools:Dn},toolPermissionContext:T,...Eo()&&{fastMode:lo(qt??null)},...Kt()&&k&&{advisorModel:k}},Ys);Pe(T,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&&di(!0),ni(Ko(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}))]}})),re(({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:tn([...r.mcp.tools,...t],`name`),commands:tn([...r.mcp.commands,...n],`name`)}}))},e).catch(e=>I(`[MCP] ${t} connect error: ${e}`)));K(`before_connectMcp`),await o(mn,`regular`),K(`after_connectMcp`);let c=5e3,l=it.then(e=>{if(Object.keys(e).length>0){let t=new Set;for(let n of Object.values(e)){let e=We(n);e&&t.add(e)}let n=new Set;for(let[e,r]of Object.entries(mn)){if(!e.startsWith(`plugin:`))continue;let i=We(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,mr(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=jn(i,e),a=dn(a,e);return{...e,mcp:{...e.mcp,clients:t,tools:r,commands:i,resources:a}}})}}let{servers:t}=Ve(e,ha(mn,(e,t)=>!t.startsWith(`plugin:`)));return o(t,`claudeai`)}),u,f=await Promise.race([l.then(()=>!1),new Promise(e=>{u=setTimeout(e=>e(!0),c,e)})]);u&&clearTimeout(u),f&&I(`[MCP] claude.ai connectors not ready after ${c}ms — proceeding; background connection continues`),K(`after_connectMcp_claudeai`),d()||(_u(),import(`./backgroundHousekeeping-V-dg2j2E.js`).then(e=>e.startBackgroundHousekeeping())),du(),K(`before_print_import`);let{runHeadless:p}=await import(`./print-G3DgPTxy.js`);K(`after_print_import`),p(E,()=>a.getState(),a.setState,r,ut,ln,Ht.activeAgents,{continue:t.continue,resume:t.resume,verbose:pe,outputFormat:g,jsonSchema:dt,permissionPromptToolName:t.permissionPromptTool,allowedTools:s,thinkingConfig:M,maxTurns:t.maxTurns,maxBudgetUsd:t.maxBudgetUsd,taskBudget:t.taskBudget?{total:t.taskBudget}:void 0,systemPrompt:x,appendSystemPrompt:S,userSpecifiedModel:qt,fallbackModel:kt,teleport:y,sdkUrl:Ae,replayUserMessages:bt,includePartialMessages:je,forkSession:t.forkSession||!1,resumeSessionAt:t.resumeSessionAt||void 0,rewindFiles:t.rewindFiles,enableAuthStatus:t.enableAuthStatus,agent:de,workload:t.workload,setupTrigger:Pn??void 0,sessionStartHooksPromise:e});return}G(`tengu_startup_manual_model_config`,{cli_flag:t.model,env_var:process.env.ANTHROPIC_MODEL,settings_file:da()?.model,subscriptionType:Io(),agent:Wt});let Fn=cc(Yt),In=[];He&&In.push({key:`permission-mode-notification`,text:He,priority:`high`}),Fn&&In.push({key:`model-deprecation-warning`,text:Fn,color:`warning`,priority:`high`});let Ln={...T},Rn=xa(),zn={settings:da(),tasks:{},agentNameRegistry:new Map,verbose:pe??z().verbose??!1,mainLoopModel:Jt,mainLoopModelForSession:null,expandedView:z().showExpandedTodos?`tasks`:`none`,selectedIPAgentIndex:-1,selectedBgAgentIndex:-1,viewSelectionMode:`none`,footerSelection:null,toolPermissionContext:Ln,agent:O?.agentType,agentDefinitions:Ht,mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:0},plugins:{enabled:[],disabled:[],commands:[],errors:[],installationStatus:{marketplaces:[],plugins:[]},needsRefresh:!1},statusLineText:void 0,remoteSessionUrl:void 0,remoteConnectionStatus:`connecting`,remoteBackgroundTaskCount:0,replBridgeEnabled:Rn||!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:Re,showRemoteCallout:!1,notifications:{current:null,queue:In},elicitation:{queue:[]},todos:{},remoteAgentTaskSuggestions:[],fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},attribution:se(),thinkingEnabled:An,promptSuggestionEnabled:qn(),sessionHooks:new Map,inbox:{messages:[]},promptSuggestion:{text:null,promptId:null,shownAt:0,acceptedAt:0,generationRequestId:null},speculation:_t,speculationSessionTimeSavedMs:0,skillImprovement:{suggestion:null},authVersion:0,initialMessage:E?{message:Qe({content:String(E)})}:null,activeOverlays:new Set,fastMode:lo(Yt),...Kt()&&k&&{advisorModel:k}};E&&bn(String(E));let Bn=Dn;V(e=>({...e,numStartups:(e.numStartups??0)+1})),setImmediate(()=>{pu(),du()});let Hn={debug:n||r,commands:[...Pt,...On],initialTools:Bn,mcpClients:En,autoConnectIdeFlag:te,mainThreadAgentDefinition:O,disableSlashCommands:Se,dynamicMcpConfig:w,strictMcpConfig:Ke,systemPrompt:x,appendSystemPrompt:S,thinkingConfig:M},Wn={mainThreadAgentDefinition:O,agentDefinitions:Ht,currentCwd:jt,cliAgents:zt,initialState:zn};if(t.continue){let e=!1;try{let n=performance.now(),{clearSessionCaches:r}=await import(`./caches-ckqJ4Qso.js`);r();let i=await st(void 0,void 0);if(!i)return G(`tengu_continue`,{success:!1}),await Z(A,`No conversation found to continue`);let a=await Xs(i,{forkSession:!!t.forkSession,includeAttribution:!0,transcriptPath:i.fullPath},Wn);a.restoredAgentDef&&(O=a.restoredAgentDef),Eu(t),G(`tengu_continue`,{success:!0,resume_duration_ms:Math.round(performance.now()-n)}),e=!0,await Uc(A,{getFpsMetrics:j,stats:$t,initialState:a.initialState},{...Hn,mainThreadAgentDefinition:a.restoredAgentDef??O,initialMessages:a.messages,initialFileHistorySnapshots:a.fileHistorySnapshots,initialContentReplacements:a.contentReplacements,initialAgentName:a.agentName,initialAgentColor:a.agentColor},ll)}catch(t){e||G(`tengu_continue`,{success:!1}),U(t),process.exit(1)}}else if($?.host){let{createSSHSession:e,createLocalSSHSession:t,SSHSessionError:i}=await import(`./createSSHSession-C0KSI0fJ.js`),a;try{if($.local)process.stderr.write(`Starting local ssh-proxy test session...
|
|
349
|
-
`),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.
|
|
350
|
-
`)}
|
|
351
|
-
Usage: claude --remote "your task description"`,()=>D(1));G(`tengu_remote_create_session`,{has_initial_prompt:String(e)});let t=await ja(),i=await
|
|
348
|
+
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.`;x=x?`${x}\n\n${e}`:e}let k,A,j;if(!b){let t=dl(!1);A=t.getFpsMetrics,j=t.stats;let{createRoot:n}=await import(`./src-D3yIF9I42.js`);k=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 ul(k,S,a,Lt);I(`[STARTUP] showSetupScreens() completed in ${Date.now()-r}ms`),i&&e?.trim().toLowerCase()===`/login`&&(e=``),i&&(Is(),Vt(),Os(),import(`./trustedDevice-C2gnF9Lc.js`).then(e=>(e.clearTrustedDeviceToken(),e.enrollTrustedDevice())));let o=await Uo();o.valid||await Z(k,o.message)}if(process.exitCode!==void 0){I(`Graceful shutdown initiated, skipping further initialization`);return}if(rn(),!b){let{errors:e}=ra(),t=e.filter(e=>!e.mcpErrorMetadata);t.length>0&&await fl(k,{settingsErrors:t,onExit:()=>Ke(1)})}let sn=z().startupPrefetchedAt??0;d()?(I(`Skipping startup prefetches, last ran ${Math.round((Date.now()-sn)/1e3)}s ago`),Po()):(I(`Starting background startup prefetches${sn>0?` last ran ${Math.round((Date.now()-sn)/1e3)}s ago`:``}`),We().catch(e=>U(e)),Kc(),Ho()),b||oc();let{servers:cn}=await dt;I(`[STARTUP] MCP configs resolved in ${ct}ms (awaited at +${Date.now()-st}ms)`);let fn={...cn,...C},mn={},hn={};for(let[e,t]of Object.entries(fn)){let n=t;n.type===`sdk`?mn[e]=n:hn[e]=n}K(`action_mcp_configs_loaded`);let gn=b?Promise.resolve({clients:[],tools:[],commands:[]}):fe(hn),_n=b?Promise.resolve({clients:[],tools:[],commands:[]}):ot.then(e=>Object.keys(e).length>0?fe(e):{clients:[],tools:[],commands:[]}),yn=Promise.all([gn,_n]).then(([e,t])=>({clients:[...e.clients,...t.clients],tools:Kt([...e.tools,...t.tools],`name`),commands:Kt([...e.commands,...t.commands],`name`)})),xn=ve||_e||be||b||t.continue||t.resume?null:on(`startup`,{agentType:O?.agentType,model:Qt}),Sn=[];yn.catch(()=>{});let En=[],Dn=[],kn=[],jn=dr(),M=jn===!1?{type:`disabled`}:{type:`adaptive`};if(t.thinking===`adaptive`||t.thinking===`enabled`)jn=!0,M={type:`adaptive`};else if(t.thinking===`disabled`)jn=!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?(jn=!0,M={type:`enabled`,budgetTokens:e}):e===0&&(jn=!1,M={type:`disabled`}))}H(`info`,`started`,{version:`0.0.19`,is_native_binary:Qa()}),Gi(async()=>{H(`info`,`exited`)}),Tu({hasInitialPrompt:!!e,hasStdin:!!T,verbose:me,debug:n,debugToStderr:r,print:he??!1,outputFormat:g??`text`,inputFormat:_??`text`,numAllowedTools:s.length,numDisallowedTools:c.length,mcpClientCount:Object.keys(fn).length,worktreeEnabled:Ee,skipWebFetchPreflight:ca().skipWebFetchPreflight,githubActionInputs:process.env.GITHUB_ACTION_INPUTS,dangerouslySkipPermissionsPassed:i??!1,permissionMode:S,modeIsBypass:S===`bypassPermissions`,allowDangerouslySkipPermissionsPassed:a,systemPromptFlag:He?t.systemPromptFile?`file`:`flag`:void 0,appendSystemPromptFlag:x?t.appendSystemPromptFile?`file`:`flag`:void 0,thinkingConfig:M,assistantActivationPath:void 0}),Mn(hn,w),uu(),Dt().then(e=>{e&&(kt&&Ft(kt),An().then(e=>{e>=2&&G(`tengu_concurrent_sessions`,{num_sessions:e})}))}),d()||(b?(await et(),K(`action_after_plugins_init`),Yn().then(()=>Tn())):et().then(async()=>{K(`action_after_plugins_init`),await Yn(),Tn()}));let Nn=ve||_e?`init`:be?`maintenance`:null;if(ve){Js(),await nn(`init`,{forceSyncExecution:!0}),await on(`startup`,{forceSyncExecution:!0}),Ke(0);return}if(b){(g===`stream-json`||g===`json`)&&Wi(!0),Js(),Bc();let e=t.continue||t.resume||y||Nn?void 0:on(`startup`);e?.catch(()=>{}),K(`before_validateForceLoginOrg`);let n=await Uo();n.valid||(process.stderr.write(`${n.message}\n`),process.exit(1));let r=v?[]:Lt.filter(e=>e.type===`prompt`&&!e.disableNonInteractive||e.type===`local`&&e.supportsNonInteractive),i=Ct(),a=Mt({...i,mcp:{...i.mcp,clients:En,commands:kn,tools:Dn},toolPermissionContext:w,...Eo()&&{fastMode:lo(Yt??null)},...bt()&&tn&&{advisorModel:tn}},Ys);Pe(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&&ci(!0),Si(Ko(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}))]}})),at(({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:Kt([...r.mcp.tools,...t],`name`),commands:Kt([...r.mcp.commands,...n],`name`)}}))},e).catch(e=>I(`[MCP] ${t} connect error: ${e}`)));K(`before_connectMcp`),await o(hn,`regular`),K(`after_connectMcp`);let c=5e3,l=ot.then(e=>{if(Object.keys(e).length>0){let t=new Set;for(let n of Object.values(e)){let e=Cn(n);e&&t.add(e)}let n=new Set;for(let[e,r]of Object.entries(hn)){if(!e.startsWith(`plugin:`))continue;let i=Cn(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,Cr(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=On(i,e),a=fr(a,e);return{...e,mcp:{...e.mcp,clients:t,tools:r,commands:i,resources:a}}})}}let{servers:t}=de(e,ha(hn,(e,t)=>!t.startsWith(`plugin:`)));return o(t,`claudeai`)}),u,f=await Promise.race([l.then(()=>!1),new Promise(e=>{u=setTimeout(e=>e(!0),c,e)})]);u&&clearTimeout(u),f&&I(`[MCP] claude.ai connectors not ready after ${c}ms — proceeding; background connection continues`),K(`after_connectMcp_claudeai`),d()||(_u(),import(`./backgroundHousekeeping-CykbtljP.js`).then(e=>e.startBackgroundHousekeeping())),du(),K(`before_print_import`);let{runHeadless:p}=await import(`./print-CDzhHi2F.js`);K(`after_print_import`),p(T,()=>a.getState(),a.setState,r,ft,mn,Gt.activeAgents,{continue:t.continue,resume:t.resume,verbose:me,outputFormat:g,jsonSchema:E,permissionPromptToolName:t.permissionPromptTool,allowedTools:s,thinkingConfig:M,maxTurns:t.maxTurns,maxBudgetUsd:t.maxBudgetUsd,taskBudget:t.taskBudget?{total:t.taskBudget}:void 0,systemPrompt:He,appendSystemPrompt:x,userSpecifiedModel:Yt,fallbackModel:Nt,teleport:y,sdkUrl:je,replayUserMessages:wt,includePartialMessages:Me,forkSession:t.forkSession||!1,resumeSessionAt:t.resumeSessionAt||void 0,rewindFiles:t.rewindFiles,enableAuthStatus:t.enableAuthStatus,agent:pe,workload:t.workload,setupTrigger:Nn??void 0,sessionStartHooksPromise:e});return}G(`tengu_startup_manual_model_config`,{cli_flag:t.model,env_var:process.env.ANTHROPIC_MODEL,settings_file:ca()?.model,subscriptionType:Io(),agent:Jt});let Pn=cc(Qt),In=[];Ue&&In.push({key:`permission-mode-notification`,text:Ue,priority:`high`}),Pn&&In.push({key:`model-deprecation-warning`,text:Pn,color:`warning`,priority:`high`});let Ln={...w},Rn=xa(),zn={settings:ca(),tasks:{},agentNameRegistry:new Map,verbose:me??z().verbose??!1,mainLoopModel:Zt,mainLoopModelForSession:null,expandedView:z().showExpandedTodos?`tasks`:`none`,selectedIPAgentIndex:-1,selectedBgAgentIndex:-1,viewSelectionMode:`none`,footerSelection:null,toolPermissionContext:Ln,agent:O?.agentType,agentDefinitions:Gt,mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:0},plugins:{enabled:[],disabled:[],commands:[],errors:[],installationStatus:{marketplaces:[],plugins:[]},needsRefresh:!1},statusLineText:void 0,remoteSessionUrl:void 0,remoteConnectionStatus:`connecting`,remoteBackgroundTaskCount:0,replBridgeEnabled:Rn||!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:Re,showRemoteCallout:!1,notifications:{current:null,queue:In},elicitation:{queue:[]},todos:{},remoteAgentTaskSuggestions:[],fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},attribution:ce(),thinkingEnabled:jn,promptSuggestionEnabled:qn(),sessionHooks:new Map,inbox:{messages:[]},promptSuggestion:{text:null,promptId:null,shownAt:0,acceptedAt:0,generationRequestId:null},speculation:ht,speculationSessionTimeSavedMs:0,skillImprovement:{suggestion:null},authVersion:0,initialMessage:T?{message:Qe({content:String(T)})}:null,activeOverlays:new Set,fastMode:lo(Qt),...bt()&&tn&&{advisorModel:tn}};T&&bn(String(T));let Bn=Dn;V(e=>({...e,numStartups:(e.numStartups??0)+1})),setImmediate(()=>{pu(),du()});let Un={debug:n||r,commands:[...Lt,...kn],initialTools:Bn,mcpClients:En,autoConnectIdeFlag:te,mainThreadAgentDefinition:O,disableSlashCommands:v,dynamicMcpConfig:C,strictMcpConfig:qe,systemPrompt:He,appendSystemPrompt:x,thinkingConfig:M},Wn={mainThreadAgentDefinition:O,agentDefinitions:Gt,currentCwd:Pt,cliAgents:Ht,initialState:zn};if(t.continue){let e=!1;try{let n=performance.now(),{clearSessionCaches:r}=await import(`./caches-CGzKSWiP.js`);r();let i=await lt(void 0,void 0);if(!i)return G(`tengu_continue`,{success:!1}),await Z(k,`No conversation found to continue`);let a=await Xs(i,{forkSession:!!t.forkSession,includeAttribution:!0,transcriptPath:i.fullPath},Wn);a.restoredAgentDef&&(O=a.restoredAgentDef),Eu(t),G(`tengu_continue`,{success:!0,resume_duration_ms:Math.round(performance.now()-n)}),e=!0,await Uc(k,{getFpsMetrics:A,stats:j,initialState:a.initialState},{...Un,mainThreadAgentDefinition:a.restoredAgentDef??O,initialMessages:a.messages,initialFileHistorySnapshots:a.fileHistorySnapshots,initialContentReplacements:a.contentReplacements,initialAgentName:a.agentName,initialAgentColor:a.agentColor},ll)}catch(t){e||G(`tengu_continue`,{success:!1}),U(t),process.exit(1)}}else if($?.host){let{createSSHSession:e,createLocalSSHSession:t,SSHSessionError:i}=await import(`./createSSHSession-DOz_Ox1_.js`),a;try{if($.local)process.stderr.write(`Starting local ssh-proxy test session...
|
|
349
|
+
`),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.19`,permissionMode:$.permissionMode,dangerouslySkipPermissions:$.dangerouslySkipPermissions,extraCliArgs:$.extraCliArgs,remoteBin:$.remoteBin},t?{onProgress:e=>{n=!0,process.stderr.write(`\r ${e}\x1b[K`)}}:{}),n&&process.stderr.write(`
|
|
350
|
+
`)}ki(a.remoteCwd),Ti(a.remoteCwd),mi($.local?`local`:$.host)}catch(e){return await Z(k,e instanceof i?e.message:String(e),()=>D(1))}let o=Sr($.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 Uc(k,{getFpsMetrics:A,stats:j,initialState:zn},{debug:n||r,commands:Lt,initialTools:[],initialMessages:[o],mcpClients:[],autoConnectIdeFlag:te,mainThreadAgentDefinition:O,disableSlashCommands:v,sshSession:a,thinkingConfig:M},ll);return}else if(t.resume||t.fromPr||y||Ie!==null){let{clearSessionCaches:e}=await import(`./caches-CGzKSWiP.js`);e();let i=null,a,o=St(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 $t(e,{exact:!0});t.length===1?(c=t[0],o=en(c)??null):s=e}}if((Ie!==null||y)&&(await wn(),!At(`allow_remote_sessions`)))return await Z(k,`Error: Remote sessions are disabled by your organization's policy.`,()=>D(1));if(Ie!==null){let e=Ie.length>0;if(!e)return await Z(k,`Error: --remote requires a description.
|
|
351
|
+
Usage: claude --remote "your task description"`,()=>D(1));G(`tengu_remote_create_session`,{has_initial_prompt:String(e)});let t=await ja(),i=await ln(k,e?Ie:null,new AbortController().signal,t||void 0);if(!i)return G(`tengu_remote_create_session_error`,{error:`unable_to_create_session`}),await Z(k,`Error: Unable to create remote session`,()=>D(1));G(`tengu_remote_create_session_success`,{session_id:i.id}),process.stdout.write(`Created remote session: ${i.title}\n`),process.stdout.write(`View: ${Fn(i.id)}?m=0\n`),process.stdout.write(`Resume with: claude --teleport ${i.id}\n`),await D(0),process.exit(0),oi(!0),di(we(i.id));let a;try{a=await Ts()}catch(e){return U(Bi(e)),await Z(k,`Error: ${F(e)||`Failed to authenticate`}`,()=>D(1))}let{getClaudeAIOAuthTokens:o}=await import(`./auth-CubXYcRl.js`),s=sc(i.id,()=>o()?.accessToken??a.accessToken,a.orgUUID,e),c=`${Fn(i.id)}?m=0`,l=Sr(`/remote-control is active. Code in CLI or at ${c}`,`info`),u=e?Qe({content:Ie}):null,d={...zn,remoteSessionUrl:c},f=Be(Lt);await Uc(k,{getFpsMetrics:A,stats:j,initialState:d},{debug:n||r,commands:f,initialTools:[],initialMessages:u?[l,u]:[l],mcpClients:[],autoConnectIdeFlag:te,mainThreadAgentDefinition:O,disableSlashCommands:v,remoteSessionConfig:s,thinkingConfig:M},ll);return}else if(y){if(y===!0||y===``){G(`tengu_teleport_interactive_mode`,{}),I(`selectAndResumeTeleportTask: Starting teleport flow...`);let e=await pl(k);e||(await D(0),process.exit(0));let{branchError:t}=await Wt(e.branch);i=qt(e.log,t)}else if(typeof y==`string`){G(`tengu_teleport_resume_session`,{mode:`direct`});try{let e=await Ot(await Ds(y));if(e.status===`mismatch`||e.status===`not_in_repo`){let t=e.sessionRepo;if(t){let e=await nc(tc(t));if(e.length>0){let n=await ml(k,{targetRepo:t,initialPaths:e});n?(process.chdir(n),re(n),ki(n)):await D(0)}else throw new Fi(`You must run claude --teleport ${y} from a checkout of ${t}.`,N.red(`You must run claude --teleport ${y} from a checkout of ${N.bold(t)}.\n`))}}else if(e.status===`error`)throw new Fi(e.errorMessage||`Failed to validate session`,N.red(`Error: ${e.errorMessage||`Failed to validate session`}\n`));await an();let{teleportWithProgress:t}=await import(`./TeleportProgress-Di-PMey7.js`),n=await t(k,y);wi({sessionId:y}),i=n.messages}catch(e){e instanceof Fi?process.stderr.write(`${e.formattedMessage}\n`):(U(e),process.stderr.write(N.red(`Error: ${F(e)}\n`))),await D(1)}}}if(o){let e=o;try{let n=performance.now(),r=await lt(c??e,void 0);if(!r)return G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),await Z(k,`No conversation found with session ID: ${e}`);let i=c?.fullPath??r.fullPath;a=await Xs(r,{forkSession:!!t.forkSession,sessionIdOverride:e,transcriptPath:i},Wn),a.restoredAgentDef&&(O=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 Z(k,`Failed to resume session ${e}`)}}if(se)try{let e=await se,t=Xi(e,e=>!e.success);t>0&&process.stderr.write(N.yellow(`Warning: ${t}/${e.length} file(s) failed to download.\n`))}catch(e){return await Z(k,`Error downloading files: ${F(e)}`)}let u=a??(Array.isArray(i)?{messages:i,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:O,initialState:zn,contentReplacements:void 0}:void 0);u?(Eu(t),await Uc(k,{getFpsMetrics:A,stats:j,initialState:u.initialState},{...Un,mainThreadAgentDefinition:u.restoredAgentDef??O,initialMessages:u.messages,initialFileHistorySnapshots:u.fileHistorySnapshots,initialContentReplacements:u.contentReplacements,initialAgentName:u.agentName,initialAgentColor:u.agentColor},ll)):await hl(k,{getFpsMetrics:A,stats:j,initialState:zn},$e(Zr()),{...Un,initialSearchQuery:s,forkSession:t.forkSession,filterByPr:l})}else{let e=xn&&Sn.length===0?xn:void 0;K(`action_after_hooks`),Eu(t);let n=null;t.deepLinkOrigin?(G(`tengu_deep_link_opened`,{has_prefill:!!t.prefill,has_repo:!!t.deepLinkRepo}),n=Sr(ac({cwd:ji(),prefillLength:t.prefill?.length,repo:t.deepLinkRepo,lastFetch:t.deepLinkLastFetch===void 0?void 0:new Date(t.deepLinkLastFetch)}),`warning`)):t.prefill&&(n=Sr(`Launched with a pre-filled prompt — review it before pressing Enter.`,`warning`));let r=n?[n,...Sn]:Sn.length>0?Sn:void 0;await Uc(k,{getFpsMetrics:A,stats:j,initialState:zn},{...Un,initialMessages:r,pendingHookMessages:e},ll)}}).version(`0.0.19 (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.`),xe()&&t.addOption(new Y(`--advisor <model>`,`Enable the server-side advisor tool with the specified model (alias or full ID).`).hideHelp()),t.addOption(new Y(`--enable-auto-mode`,`Opt in to auto mode`).hideHelp()),t.addOption(new Y(`--proactive`,`Start in proactive autonomous mode`)),t.addOption(new Y(`--sdk-url <url>`,`Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)`).hideHelp()),t.addOption(new Y(`--teleport [session]`,`Resume a teleport session, optionally specify session ID`).hideHelp()),t.addOption(new Y(`--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-BoU3TNFs.js`);await n({debug:e,verbose:t})}),$l(i),sr()&&eu(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-BoU3TNFs.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-BoU3TNFs.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-BoU3TNFs.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-BoU3TNFs.js`);await r(e,t,n)}),i.command(`add-from-claude-desktop`).description(`Import MCP servers from Work Mate 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-BoU3TNFs.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-BoU3TNFs.js`);await e()}),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]
|
|
352
352
|
|
|
353
353
|
Runs Work Mate on a remote Linux host. You don't need to install
|
|
354
354
|
anything on the remote — the binary is
|
|
355
355
|
deployed over SSH and API auth tunnels back through your local machine.
|
|
356
|
-
`),process.exit(1)});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 Work Mate subscription`).option(`--claudeai`,`Use Work Mate subscription (default)`).action(async({email:e,sso:t,console:n,claudeai:r})=>{let{authLogin:i}=await import(`./auth-
|
|
356
|
+
`),process.exit(1)});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 Work Mate subscription`).option(`--claudeai`,`Use Work Mate subscription (default)`).action(async({email:e,sso:t,console:n,claudeai:r})=>{let{authLogin:i}=await import(`./auth-CsYEYXBO.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-CsYEYXBO.js`);await t(e)});let o=()=>new Y(`--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-r0h93GT_.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-r0h93GT_.js`);await t(e)});let c=s.command(`marketplace`).description(`Manage Work Mate marketplaces`).configureHelp(e());return 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-r0h93GT_.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-r0h93GT_.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-r0h93GT_.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-r0h93GT_.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-r0h93GT_.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 (~/.workmate/plugins/data/{id}/)`).addOption(o()).action(async(e,t)=>{let{pluginUninstallHandler:n}=await import(`./plugins-r0h93GT_.js`);await n(e,t)}),s.command(`enable <plugin>`).description(`Enable a disabled plugin`).option(`-s, --scope <scope>`,`Installation scope: ${Gs.join(`, `)} (default: auto-detect)`).addOption(o()).action(async(e,t)=>{let{pluginEnableHandler:n}=await import(`./plugins-r0h93GT_.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: ${Gs.join(`, `)} (default: auto-detect)`).addOption(o()).action(async(e,t)=>{let{pluginDisableHandler:n}=await import(`./plugins-r0h93GT_.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: ${Us.join(`, `)} (default: user)`).addOption(o()).action(async(e,t)=>{let{pluginUpdateHandler:n}=await import(`./plugins-r0h93GT_.js`);await n(e,t)}),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-Bxenhf8S.js`);await e(),process.exit(0)}),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-CD3ar4of.js`),import(`./src-D3yIF9I42.js`)]);await e(await t($s(!1)))}),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-CD3ar4of.js`);await n(e,t)}),K(`run_before_parse`),await t.parseAsync(process.argv),K(`run_after_parse`),K(`main_after_run`),qa(),t}async function Tu({hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:i,print:a,outputFormat:o,inputFormat:s,numAllowedTools:c,numDisallowedTools:l,mcpClientCount:u,worktreeEnabled:p,skipWebFetchPreflight:m,githubActionInputs:ee,dangerouslySkipPermissionsPassed:te,permissionMode:h,modeIsBypass:ne,allowDangerouslySkipPermissionsPassed:re,systemPromptFlag:ie,appendSystemPromptFlag:ae,thinkingConfig:oe,assistantActivationPath:se}){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:p,skipWebFetchPreflight:m,...ee&&{githubActionInputs:ee},dangerouslySkipPermissionsPassed:te,permissionMode:h,modeIsBypass:ne,inProtectedNamespace:f(),allowDangerouslySkipPermissionsPassed:re,thinkingType:oe.type,...oe.type===`enabled`&&{thinkingBudgetTokens:oe.budgetTokens},...ie&&{systemPromptFlag:ie},...ae&&{appendSystemPromptFlag:ae},is_simple:d()||void 0,...se&&{assistantActivationPath:se},autoUpdatesChannel:ca().autoUpdatesChannel??`latest`})}catch(e){U(e)}}function Eu(t){if(t.proactive||l(process.env.CLAUDE_CODE_PROACTIVE)){let t=(us(),e(ds));t.isProactiveActive()||t.activateProactive(`command`)}}function Du(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(Rr)}export{Su as main};
|