@readmagic/workmate 0.0.5 → 0.0.6
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-DJRkEz7o.js → AddWorkspaceDirectory-ClHi-Dr6.js} +1 -1
- package/dist/chunks/{App-iJu5qyiF.js → App-BP06lHmf.js} +1 -1
- package/dist/chunks/{ApproveApiKey-CRejTHUw.js → ApproveApiKey-Bsy8kr2a.js} +1 -1
- package/dist/chunks/ApproveApiKey-a2ZonQ3n.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-CBLQ1v-J.js → AssistantSessionChooser-CcocKoTJ.js} +1 -1
- package/dist/chunks/{BackgroundTasksDialog-CyoLEYWH.js → BackgroundTasksDialog-DNeBhGCf.js} +1 -1
- package/dist/chunks/{BypassPermissionsModeDialog-D1FCKVOi.js → BypassPermissionsModeDialog-BKj_3Idm.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-CI0yF6sZ.js → ClaudeMdExternalIncludesDialog-BD-7yAZh.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DFivNFuo.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-CS3zjEPF.js +1 -0
- package/dist/chunks/{DesktopHandoff-D1rrMxeP.js → DesktopHandoff-BmPmCfT3.js} +1 -1
- package/dist/chunks/{DiffDialog-BKcfKx7O.js → DiffDialog-C4XSSjvV.js} +1 -1
- package/dist/chunks/Doctor-BhD-ZzZm.js +1 -0
- package/dist/chunks/{Doctor-Yco1McrL.js → Doctor-DEQe2q16.js} +1 -1
- package/dist/chunks/{ExitFlow-D3csukbB.js → ExitFlow-BttnAv-O.js} +1 -1
- package/dist/chunks/{Feedback-bEUtrHia.js → Feedback-BaYA8-SU.js} +1 -1
- package/dist/chunks/Grove-BJziCbZH.js +11 -0
- package/dist/chunks/Grove-sWm-oLBf.js +1 -0
- package/dist/chunks/{HybridTransport-9fTBC2Pv.js → HybridTransport-B8V6O6rM.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-9M-1nfZ6.js → InvalidConfigDialog-CHzBSJDf.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-B2F6pryH.js → InvalidSettingsDialog-BKenH3bD.js} +1 -1
- package/dist/chunks/{MCPConnectionManager-MWpKjeZT.js → MCPConnectionManager-CNh9dNlk.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-BPBb7Npe.js → McpParsingWarnings-Bj2-YL8o.js} +1 -1
- package/dist/chunks/{MessageSelector-DsQmqFt2.js → MessageSelector-DdR6wJhh.js} +1 -1
- package/dist/chunks/{Messages-B3sGRx5A.js → Messages-Ch6cboMV.js} +2 -2
- package/dist/chunks/{Onboarding-cHcnsBGp.js → Onboarding-BrAJp0aL.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-CWCD_RpM.js → OverageCreditUpsell-Ds1cB7RC.js} +1 -1
- package/dist/chunks/PluginSettings-CGqEzejq.js +17 -0
- package/dist/chunks/{PromptInputFooterSuggestions-D5sAO6y-.js → PromptInputFooterSuggestions-egs9VvUs.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-n6hAdsto.js → PromptInputHelpMenu-SieM5NoY.js} +1 -1
- package/dist/chunks/{QueryEngine-cwdsr4dr.js → QueryEngine-CZZMl3PB.js} +1 -1
- package/dist/chunks/{REPL-CJzScgbZ.js → REPL-CG2N7E4Q.js} +6 -6
- package/dist/chunks/REPL-DvA910N_.js +1 -0
- package/dist/chunks/{RemoteCallout-CiA4rCEs.js → RemoteCallout-Cs-ro8_i.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-zdHfmvfj.js → RemoteSessionManager-B740Dp6m.js} +1 -1
- package/dist/chunks/{ResumeConversation-Rxwd6HAJ.js → ResumeConversation-DzV2zmuX.js} +1 -1
- package/dist/chunks/{SSETransport-BPbhCa2f.js → SSETransport-DtpMDekF.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-C4uO-Zx3.js +1 -0
- package/dist/chunks/{Settings-CxI_KHUj.js → Settings-XKw6FI_m.js} +2 -2
- package/dist/chunks/{TeleportProgress-DrulEQ7z.js → TeleportProgress-rYaHIEfe.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-D3FOLr0P.js → TeleportRepoMismatchDialog-DY97YZMB.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-DI5iRFND.js → TeleportResumeWrapper-jaQzyTCh.js} +1 -1
- package/dist/chunks/{ThemePicker-CQ7dfFtv.js → ThemePicker-BViWzLp3.js} +1 -1
- package/dist/chunks/{TrustDialog-CnVKrdxQ.js → TrustDialog-DGJ_BisZ.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-CPYeuppg.js → ValidationErrorsList-B8pRiGuy.js} +1 -1
- package/dist/chunks/{WelcomeV2-C-UXdIng.js → WelcomeV2-DqnbSdIu.js} +1 -1
- package/dist/chunks/{add-dir-xTz4COgn.js → add-dir-C2Hu3oE4.js} +1 -1
- package/dist/chunks/{agentDisplay-BuSReYxu.js → agentDisplay-XoDJhr03.js} +1 -1
- package/dist/chunks/{agents-Du9KYHqN.js → agents-BIHTGDYh.js} +1 -1
- package/dist/chunks/{agents-CiLlKN2I.js → agents-C4QXeHIJ.js} +1 -1
- package/dist/chunks/{allErrors-P3utlEeA.js → allErrors-1896uQA1.js} +1 -1
- package/dist/chunks/{ant-CBIfqmAb.js → ant-B6k6cBts.js} +1 -1
- package/dist/chunks/api-BsFW57_Q.js +1 -0
- package/dist/chunks/{api-B-5jqiMg.js → api-gqTA-D7n.js} +1 -1
- package/dist/chunks/{assistant-XOnU01yl.js → assistant-DJ9hd4uC.js} +1 -1
- package/dist/chunks/auth-8Vd3_U8t.js +1 -0
- package/dist/chunks/{auth-DT2yxy94.js → auth-BnSrKyJe.js} +1 -1
- package/dist/chunks/auth-DRTjfnGy.js +1 -0
- package/dist/chunks/{autoMode-CEMflt3g.js → autoMode-BNukrVAB.js} +1 -1
- package/dist/chunks/{autonomy-_N8aDaA8.js → autonomy-BEmI7WVW.js} +1 -1
- package/dist/chunks/{autonomy-Cg5zweUa.js → autonomy-DGcy5Rml.js} +1 -1
- package/dist/chunks/{autonomyPanel-I4yCy3Fr.js → autonomyPanel-fhge09AG.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-3i_d_WW5.js +1 -0
- package/dist/chunks/{backgroundHousekeeping-DhF2lrQ9.js → backgroundHousekeeping-BVMf_Tjn.js} +2 -2
- package/dist/chunks/{branch-BIX-pyHp.js → branch-Bpe-gocq.js} +1 -1
- package/dist/chunks/{break-cache-BQfgkNAo.js → break-cache-C_p7Kmx2.js} +3 -3
- package/dist/chunks/{bridge-CYskzVt8.js → bridge-D12Shbkj.js} +2 -2
- package/dist/chunks/{bridgeConfig-5p_w4s5r.js → bridgeConfig-BhxRF2vm.js} +1 -1
- package/dist/chunks/bridgeConfig-CqIQ_rvD.js +1 -0
- package/dist/chunks/bridgeEnabled-D0XC5kNh.js +1 -0
- package/dist/chunks/{bridgeEnabled-DhFrLTbG.js → bridgeEnabled-SbB-6zdY.js} +1 -1
- package/dist/chunks/{bridgeMain-BX2AkLPs.js → bridgeMain-DHUpZFgL.js} +6 -6
- package/dist/chunks/bridgeMain-DUbQjgCp.js +1 -0
- package/dist/chunks/{bridgeMessaging-B5Lbzr8e.js → bridgeMessaging-DHc5dOhB.js} +1 -1
- package/dist/chunks/{btw-CWWFO7u8.js → btw-D9hMM5d2.js} +1 -1
- package/dist/chunks/caches-CWzT7e6Y.js +1 -0
- package/dist/chunks/{caches-DPqPIogk.js → caches-UeVVM3T0.js} +2 -2
- package/dist/chunks/{ccrClient-CTLnU9Y1.js → ccrClient-Iza0L8Zw.js} +1 -1
- package/dist/chunks/{clear-DCAgZwc4.js → clear-B4d38ssF.js} +1 -1
- package/dist/chunks/client-BzKQTXzF.js +1 -0
- package/dist/chunks/{color-CmJGInHL.js → color-D8VOyoYl.js} +1 -1
- package/dist/chunks/commands-DDamMmo4.js +1 -0
- package/dist/chunks/commitAttribution-CgohL8vD.js +1 -0
- package/dist/chunks/{commitAttribution-CGZr7XNO.js → commitAttribution-ChAgixdj.js} +1 -1
- package/dist/chunks/{compact-C6-lMHgn.js → compact-IFHwxjZ9.js} +1 -1
- package/dist/chunks/config-DY5-_kk_.js +1 -0
- package/dist/chunks/{config-3m_9zSrj.js → config-DmomySWC.js} +1 -1
- package/dist/chunks/config-WxgxrQoP.js +1 -0
- package/dist/chunks/{context-C9V4GF0n.js → context-Cl6BJ2vm.js} +1 -1
- package/dist/chunks/{context-noninteractive-BmC4o5xo.js → context-noninteractive-9hELVC29.js} +1 -1
- package/dist/chunks/context-noninteractive-Beij5MfU.js +1 -0
- package/dist/chunks/conversation-BBB91hEw.js +1 -0
- package/dist/chunks/{conversation-CYqqk0o7.js → conversation-BWVTM40Y.js} +1 -1
- package/dist/chunks/{createSSHSession-BL6j0AU5.js → createSSHSession-BM-5pbv6.js} +1 -1
- package/dist/chunks/createSession-CoQtL5Rj.js +1 -0
- package/dist/chunks/{createSession-D_sgO1Xy.js → createSession-Cvl1Q50F.js} +1 -1
- package/dist/chunks/{crossProjectResume-D5hTOfnE.js → crossProjectResume-BasMLl2n.js} +1 -1
- package/dist/chunks/{datadog-UkGdjL8-.js → datadog-CpqEQbHa.js} +1 -1
- package/dist/chunks/{desktop-HbYKh-VK.js → desktop-B_L6T6jI.js} +1 -1
- package/dist/chunks/{diff-nTV17iWX.js → diff-CVzOodeg.js} +1 -1
- package/dist/chunks/doctor-1L0TFuGw.js +1 -0
- package/dist/chunks/{entry-CCFI6-gM.js → entry-DHVYCR26.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-CN0_44-p.js +1 -0
- package/dist/chunks/{envLessBridgeConfig-DXd10GXD.js → envLessBridgeConfig-Ck2-KMq0.js} +1 -1
- package/dist/chunks/{esm-CGoYrggU.js → esm-D5q6s4l8.js} +1 -1
- package/dist/chunks/{exit-ropaQiOr.js → exit-Bm1S_f3i.js} +1 -1
- package/dist/chunks/extra-usage-UHAWtypK.js +1 -0
- package/dist/chunks/{extra-usage-core-DLYHAInT.js → extra-usage-core-BFOolqoi.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-D8iszH3c.js → extra-usage-noninteractive-cUGZy0en.js} +1 -1
- package/dist/chunks/{extra-usage-g2Pw4zt_.js → extra-usage-zDHVtWKZ.js} +1 -1
- package/dist/chunks/{extraUsage-C2Ylufhj.js → extraUsage-Dq66zzqR.js} +1 -1
- package/dist/chunks/extractMemories-BcaklA33.js +1 -0
- package/dist/chunks/fast-DALAHO3d.js +1 -0
- package/dist/chunks/{fast-Dx2fTmWr.js → fast-MS7WZpD8.js} +1 -1
- package/dist/chunks/{feedback-DCQ4pJ3v.js → feedback-Fw4m28ZC.js} +1 -1
- package/dist/chunks/firstPartyEventLogger-CS9jVz6D.js +1 -0
- package/dist/chunks/{firstPartyEventLogger-BNGPPBNP.js → firstPartyEventLogger-CoSUd0a1.js} +2 -2
- package/dist/chunks/{flushGate-XaheIZZT.js → flushGate-De-yppeo.js} +1 -1
- package/dist/chunks/{gemini-BCCLHK3K.js → gemini-BPziscyN.js} +1 -1
- package/dist/chunks/{generateRecap-BhvbixY2.js → generateRecap-jGDLI_wU.js} +1 -1
- package/dist/chunks/{generateSessionName-CN1oh7Fa.js → generateSessionName-hDJ6HBJ1.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-B4AM8luI.js → githubRepoPathMapping-qAoiyj6P.js} +1 -1
- package/dist/chunks/{goal-Bp6fyGqo.js → goal-CFx4eRkf.js} +1 -1
- package/dist/chunks/{grok-ax26ju8y.js → grok-Byblph7F.js} +1 -1
- package/dist/chunks/{grove-DrBVaZSN.js → grove-CpqjcGCb.js} +1 -1
- package/dist/chunks/{heapdump-JseysNDr.js → heapdump-C4kPlqGt.js} +1 -1
- package/dist/chunks/{help-DR9hKneR.js → help-B1h-faJ3.js} +1 -1
- package/dist/chunks/hooks-DPLIIpAD.js +1 -0
- package/dist/chunks/{hooks-C5n23H1E.js → hooks-X6J03MnA.js} +1 -1
- package/dist/chunks/hostGuard-BHI6Q8Mt.js +1 -0
- package/dist/chunks/inboundAttachments-BekVc0W-.js +1 -0
- package/dist/chunks/{inboundAttachments-Cp8XvLMZ.js → inboundAttachments-CUJE3KaU.js} +1 -1
- package/dist/chunks/{initReplBridge-DJs28ZkI.js → initReplBridge-JQ-afRx9.js} +1 -1
- package/dist/chunks/{install-C7qTB0V5.js → install-D5YORIJL.js} +1 -1
- package/dist/chunks/{instrumentation-CLZttr_u.js → instrumentation-Bw3CxPQf.js} +3 -3
- package/dist/chunks/{job-BhiazwPH.js → job-DOWtcltx.js} +1 -1
- package/dist/chunks/{keybindings-CkL8BzUt.js → keybindings-BLw5J-Zj.js} +1 -1
- package/dist/chunks/{language-DIw2871r.js → language-C6Fq-XOZ.js} +1 -1
- package/dist/chunks/language-Cqw5gYJR.js +1 -0
- package/dist/chunks/{launchAgentsPlatform-j-mWpwW1.js → launchAgentsPlatform-jWWf-Lk9.js} +1 -1
- package/dist/chunks/{launchLocalMemory-DmoXp0Xo.js → launchLocalMemory-kHeD0I0y.js} +1 -1
- package/dist/chunks/{launchLocalVault-1uKe0HjA.js → launchLocalVault-DLqkOjmb.js} +1 -1
- package/dist/chunks/{launchMemoryStores-SxDKjHJ3.js → launchMemoryStores-Ct7AVXrO.js} +1 -1
- package/dist/chunks/{launchOnboarding-CTtpnXcs.js → launchOnboarding-Cc6WwPX9.js} +1 -1
- package/dist/chunks/{launchSchedule-BDVnGhaL.js → launchSchedule-ZyvuvjgU.js} +1 -1
- package/dist/chunks/{launchSkillStore-SmMLxp4K.js → launchSkillStore-BejQnLog.js} +1 -1
- package/dist/chunks/{launchTeleport-B472ZSGz.js → launchTeleport-8CuYUfIR.js} +1 -1
- package/dist/chunks/{launchVault-CsyBgxle.js → launchVault-DIvIOuPh.js} +1 -1
- package/dist/chunks/{loadAgentsDir-Clu7Uk6a.js → loadAgentsDir-D206qwP3.js} +47 -47
- package/dist/chunks/loadAgentsDir-TZjwTqdr.js +1 -0
- package/dist/chunks/{loadPluginHooks-Cvd5VdjQ.js → loadPluginHooks-Ddhsyn0_.js} +1 -1
- package/dist/chunks/{localSearch-iA6JTk19.js → localSearch-CzrbOklu.js} +1 -1
- package/dist/chunks/localSearch-DrOAL6f4.js +1 -0
- package/dist/chunks/{logoV2Utils-YHBJLIrC.js → logoV2Utils-8M56V7oN.js} +1 -1
- package/dist/chunks/{magicDocs-Bf1fqnHN.js → magicDocs-DWjL2k7P.js} +1 -1
- package/dist/chunks/{main-gtV_TqXP.js → main-BohPzJFF.js} +16 -16
- package/dist/chunks/{mappers-C8lYERPX.js → mappers-BDMZFgKx.js} +1 -1
- package/dist/chunks/{mcp-Ci0OPVrR.js → mcp-Bt1ITh-Z.js} +1 -1
- package/dist/chunks/{mcp-CNuhEGP6.js → mcp-CwJ-AIpt.js} +2 -2
- package/dist/chunks/{mcp-CwIYauZl.js → mcp-W0LFoyFR.js} +1 -1
- package/dist/chunks/{memory-DCGqfQ1U.js → memory-3wV7m7UU.js} +1 -1
- package/dist/chunks/{mode-DO6g7nkX.js → mode-CUkHFkju.js} +1 -1
- package/dist/chunks/{model-DLXL0CNu.js → model-BY3auM2c.js} +1 -1
- package/dist/chunks/model-CKkOnnnx.js +1 -0
- package/dist/chunks/model-DRXcJyU9.js +1 -0
- package/dist/chunks/{nativeInstaller-OPuO2sm_.js → nativeInstaller-CA5d6_G7.js} +1 -1
- package/dist/chunks/{onChangeAppState-CHhRDkM7.js → onChangeAppState-DBmy2Ow_.js} +1 -1
- package/dist/chunks/{openai-HOebt-8k.js → openai-Cbomn0Ws.js} +1 -1
- package/dist/chunks/{overageCreditGrant-Bi1CTBAx.js → overageCreditGrant-DsUrmeBh.js} +1 -1
- package/dist/chunks/{panel-CrTPqXCv.js → panel-BSZGX6jN.js} +1 -1
- package/dist/chunks/{panelCall-D0eURklm.js → panelCall-BsVoL1uF.js} +1 -1
- package/dist/chunks/{partition-C8RSL3SQ.js → partition-BAakXjvj.js} +1 -1
- package/dist/chunks/{passes-BJci5SM_.js → passes-CLRt7Cvm.js} +1 -1
- package/dist/chunks/{permissions-JU9CGHgI.js → permissions-BVSFuwNP.js} +1 -1
- package/dist/chunks/{pidLock-Bd2e6xuT.js → pidLock-D5rUnDB-.js} +2 -2
- package/dist/chunks/{plan-D4gMsK7i.js → plan-SYZ4DXR8.js} +1 -1
- package/dist/chunks/{plugin-CwCo5Kik.js → plugin-Bfjzhmrk.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-CO-n9bqe.js → pluginAutoupdate-reO2PgtQ.js} +1 -1
- package/dist/chunks/{pluginBlocklist-5qbaTRbV.js → pluginBlocklist-C3H2afWG.js} +1 -1
- package/dist/chunks/{pluginCliCommands-I-lsw_us.js → pluginCliCommands-lqdxdkQp.js} +1 -1
- package/dist/chunks/{pluginFlagging-DNPBbJZo.js → pluginFlagging-D9HKAGBC.js} +1 -1
- package/dist/chunks/{pluginOperations-Cz6eQ0Vu.js → pluginOperations-EN3EKLux.js} +1 -1
- package/dist/chunks/{pluginStartupCheck-DJ9fslCK.js → pluginStartupCheck-BY73BMT2.js} +1 -1
- package/dist/chunks/pluginStartupCheck-CwWOlveD.js +1 -0
- package/dist/chunks/{plugins-CzJIuPfb.js → plugins-Dn6ceWrT.js} +1 -1
- package/dist/chunks/policyLimits-CkTI5KEt.js +1 -0
- package/dist/chunks/{poor-Dha9p9RF.js → poor-j-y-bv8o.js} +1 -1
- package/dist/chunks/{poorMode-1NLYiS3Y.js → poorMode-DhzFKpPl.js} +1 -1
- package/dist/chunks/poorMode-V11s-3cf.js +1 -0
- package/dist/chunks/{print-BL4EUT5Z.js → print-Db_VXmfO.js} +4 -4
- package/dist/chunks/{privacy-settings-6ZWxR4Qt.js → privacy-settings-DHMJREbb.js} +1 -1
- package/dist/chunks/{processBashCommand-BZs9wggV.js → processBashCommand-BcM_fhV9.js} +1 -1
- package/dist/chunks/{processSlashCommand-D8lKLNzM.js → processSlashCommand-DEVo3GPX.js} +1 -1
- package/dist/chunks/{prompt-Bg_1U0gO.js → prompt-BNHtszmZ.js} +1 -1
- package/dist/chunks/prompt-CrX31AGm.js +1 -0
- package/dist/chunks/prompt-IAvMxKDl.js +1 -0
- package/dist/chunks/{promptEditor-BhYDmwdS.js → promptEditor-DeMrXUir.js} +1 -1
- package/dist/chunks/{protocolHandler-Dnb7lITm.js → protocolHandler-BHxBy84Z.js} +1 -1
- package/dist/chunks/{rate-limit-options-DVzT3eWH.js → rate-limit-options-DIudL9fb.js} +1 -1
- package/dist/chunks/{rcDebugLog-VKwMl0yg.js → rcDebugLog-CUy1_F23.js} +1 -1
- package/dist/chunks/{reconciler-BdRXZTJf.js → reconciler-BXpPyfSY.js} +1 -1
- package/dist/chunks/{referral-BlrMpBAV.js → referral-CUaIo_vT.js} +1 -1
- package/dist/chunks/{refresh-jwqnoK2h.js → refresh-CuaVBIQ0.js} +1 -1
- package/dist/chunks/{registerProtocol-CuKZAiCc.js → registerProtocol-B7Fzdofu.js} +1 -1
- package/dist/chunks/{release-notes-BgP8u7NE.js → release-notes-fbfv2DC0.js} +1 -1
- package/dist/chunks/{releaseNotes-CunqVlbU.js → releaseNotes-CxAHFLPl.js} +2 -2
- package/dist/chunks/{reload-plugins-CD9TzvFm.js → reload-plugins-B9IT9CFA.js} +1 -1
- package/dist/chunks/{remote-env-QaP_W_sv.js → remote-env-BOklGlll.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-9-HVMo63.js → remoteBridgeCore-j0bG1zjv.js} +1 -1
- package/dist/chunks/{remoteManagedSettings-jZ6u8ZBT.js → remoteManagedSettings-Cq994lyc.js} +1 -1
- package/dist/chunks/{rename-29qxHf8W.js → rename-Iev7wQsI.js} +1 -1
- package/dist/chunks/{resume-D-SpOy_1.js → resume-y7MCTZHJ.js} +1 -1
- package/dist/chunks/{runtimeObserver-DOEcrylu.js → runtimeObserver-BZcJ1FbH.js} +1 -1
- package/dist/chunks/{runtimeObserver-Dm3LIUMp.js → runtimeObserver-CyzLASla.js} +2 -2
- package/dist/chunks/sandbox-adapter-Cu1FYrkh.js +1 -0
- package/dist/chunks/{sandbox-toggle-B61AeBor.js → sandbox-toggle-CWpBO228.js} +1 -1
- package/dist/chunks/searchExtraTools-BUOUds7p.js +1 -0
- package/dist/chunks/{session-RwJCIIcs.js → session-DL4cA_8l.js} +1 -1
- package/dist/chunks/{sessionDiscovery-dkFeWcA3.js → sessionDiscovery-DAfNKqp1.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-2cgIIxPk.js +1 -0
- package/dist/chunks/{sessionMemory-btARBn8H.js → sessionMemory-BS8_TbKj.js} +1 -1
- package/dist/chunks/sessionMemory-D5fSHXvZ.js +1 -0
- package/dist/chunks/sessionMemoryUtils-BWUztNh6.js +1 -0
- package/dist/chunks/sessionObserver-ChfQtK2m.js +1 -0
- package/dist/chunks/{sessionObserver-CSOYgsvH.js → sessionObserver-ShbCwJ8x.js} +1 -1
- package/dist/chunks/sessionStorage-Cf5wmnyB.js +1 -0
- package/dist/chunks/{sessionTitle-CLOlPZ_M.js → sessionTitle-coed9IuJ.js} +1 -1
- package/dist/chunks/{sessionTracing-D8wr9j4X.js → sessionTracing-D9rUyiq0.js} +1 -1
- package/dist/chunks/{settings-Dlp5JTa_.js → settings-BovzmwMP.js} +2 -2
- package/dist/chunks/{settingsSync-QWA0VZSu.js → settingsSync-PqU9XGJq.js} +1 -1
- package/dist/chunks/{setup-UI9uv2-K.js → setup-B_FOvNpp.js} +2 -2
- package/dist/chunks/{shadowedRuleDetection-CXsmUY2o.js → shadowedRuleDetection-D1wsAdpp.js} +1 -1
- package/dist/chunks/{sideQuestion-CHpOVzY5.js → sideQuestion-wSi38p81.js} +1 -1
- package/dist/chunks/sinks-BpcRrN_T.js +1 -0
- package/dist/chunks/{sinks-1hFrW9HK.js → sinks-C_Dl1p4K.js} +2 -2
- package/dist/chunks/{skill-learning-Ck17rwH8.js → skill-learning-B5tmc7EX.js} +1 -1
- package/dist/chunks/{skillChangeDetector-s0F9Yf9a.js → skillChangeDetector-DNqohXxz.js} +1 -1
- package/dist/chunks/{skillGapStore-BJ1h2LVr.js → skillGapStore-D-kQKVDZ.js} +1 -1
- package/dist/chunks/{skillGapStore-DyqNKuNy.js → skillGapStore-Df5BWAk5.js} +2 -2
- package/dist/chunks/{skillGenerator-BT8NGzXT.js → skillGenerator-DbcdpAkw.js} +2 -2
- package/dist/chunks/skillLearning-C5cXZE6_.js +1 -0
- package/dist/chunks/{skillLearning-Cn9Uw0Kd.js → skillLearning-ClRiDcJH.js} +1 -1
- package/dist/chunks/{skillPanel-N0GoWjIi.js → skillPanel-LBd4E-MM.js} +3 -3
- package/dist/chunks/{skillSearchPanel-CTwtgTzy.js → skillSearchPanel-CErRnUwo.js} +2 -2
- package/dist/chunks/{skills-Bv3lH-aA.js → skills-CBKhfg_a.js} +1 -1
- package/dist/chunks/{stats-C1Ff6w4i.js → stats-BY4dskVg.js} +1 -1
- package/dist/chunks/{status-DyXiBa0m.js → status-BnJIXtKl.js} +2 -2
- package/dist/chunks/{status-FD7HVYS7.js → status-DU-B4SMW.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-kTp9Rdk6.js → statusNoticeHelpers-CzTuGNuC.js} +1 -1
- package/dist/chunks/{tag-RzOSA5T0.js → tag-B-wVW9Aj.js} +1 -1
- package/dist/chunks/{tasks-eJrOcdhB.js → tasks-CBVL005y.js} +1 -1
- package/dist/chunks/{teleport-ABA-hdmP.js → teleport-dtqQXM4x.js} +1 -1
- package/dist/chunks/{templateJobs-BnOBSFtq.js → templateJobs-D6998LcG.js} +1 -1
- package/dist/chunks/{terminalSetup-BfvmoJaK.js → terminalSetup-0SBdyKF5.js} +1 -1
- package/dist/chunks/{terminalSetup-D_P5iZmq.js → terminalSetup-CuV-qU6v.js} +1 -1
- package/dist/chunks/{theme-S0kVMVt4.js → theme-p0AooruD.js} +1 -1
- package/dist/chunks/thinkback-Catprqs_.js +1 -0
- package/dist/chunks/{thinkback-HyW_R_88.js → thinkback-DI2NpvG-.js} +1 -1
- package/dist/chunks/{thinkback-play-H6md4czq.js → thinkback-play-CqrIRx2o.js} +1 -1
- package/dist/chunks/{toolEventObserver-BAFzvePj.js → toolEventObserver-DTccwC3c.js} +1 -1
- package/dist/chunks/{toolEventObserver--Z6jENks.js → toolEventObserver-DlH73w-S.js} +1 -1
- package/dist/chunks/{toolPool-CR61XXm3.js → toolPool-B64V-jmK.js} +1 -1
- package/dist/chunks/{trustedDevice-Dn4rXbxT.js → trustedDevice-BTYoQCkC.js} +1 -1
- package/dist/chunks/trustedDevice-CiwjT_Y6.js +1 -0
- package/dist/chunks/{ultrareviewCommand-mYDTBCFD.js → ultrareviewCommand-BDFUS3hf.js} +1 -1
- package/dist/chunks/undercover-XYapZ_SS.js +1 -0
- package/dist/chunks/{undercover-CdapzvNH.js → undercover-vuTpCnQJ.js} +2 -2
- package/dist/chunks/{updateCCB-DPShheOr.js → updateCCB-DFL5Wt_I.js} +1 -1
- package/dist/chunks/{upgrade-BOeakAP6.js → upgrade-D5qwcaWQ.js} +1 -1
- package/dist/chunks/upgrade-DIg3j929.js +1 -0
- package/dist/chunks/{upload-BXQsDtLW.js → upload-B_yADHX9.js} +1 -1
- package/dist/chunks/{usage-iNQzY960.js → usage-C0SnnC-i.js} +1 -1
- package/dist/chunks/usage-CYJKE8N6.js +1 -0
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CntByfTQ.js → useExitOnCtrlCDWithKeybindings-DKIqRraH.js} +1 -1
- package/dist/chunks/useMainLoopModel-XetDUXd-.js +1 -0
- package/dist/chunks/{useManagePlugins-B8HD0RUh.js → useManagePlugins-B2KhKiu5.js} +1 -1
- package/dist/chunks/{useMergedTools-DfchLQZC.js → useMergedTools-CKvwz_Zt.js} +1 -1
- package/dist/chunks/{useSearchInput-H-8hJeFD.js → useSearchInput-D1Vr2Js1.js} +1 -1
- package/dist/chunks/{useSettingsErrors-BF5i5Xju.js → useSettingsErrors-B7BXHchG.js} +1 -1
- package/dist/chunks/{util-CoicMvOv.js → util-BaDs-wL5.js} +1 -1
- package/dist/chunks/{validatePlugin-z2fcngf8.js → validatePlugin-DtiYlXby.js} +1 -1
- package/dist/chunks/{vim-DdvQlLDm.js → vim-C-icQDz1.js} +1 -1
- package/dist/chunks/{workerRegistry-CzqQwCHC.js → workerRegistry-ChqPPIaO.js} +1 -1
- package/dist/chunks/worktree-DAn8ooa1.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-CKfn7U1R.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-TypH-X8e.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-wGQuFt41.js +0 -1
- package/dist/chunks/Doctor-CcJUwSQn.js +0 -1
- package/dist/chunks/Grove-DPkIjqg8.js +0 -1
- package/dist/chunks/Grove-Dsd7F39b.js +0 -11
- package/dist/chunks/PluginSettings-B0jbwB2M.js +0 -17
- package/dist/chunks/REPL-DlBJIPCw.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-VP87ErGx.js +0 -1
- package/dist/chunks/api-BiwZmmsh.js +0 -1
- package/dist/chunks/auth-BQa4kzQo.js +0 -1
- package/dist/chunks/auth-UAJhZNmZ.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BUUZ7Csq.js +0 -1
- package/dist/chunks/bridgeConfig-DWEqKbXk.js +0 -1
- package/dist/chunks/bridgeEnabled-CjVCMwnq.js +0 -1
- package/dist/chunks/bridgeMain-6lollTtZ.js +0 -1
- package/dist/chunks/caches-C46fa77L.js +0 -1
- package/dist/chunks/client-Bup0Sgcn.js +0 -1
- package/dist/chunks/commands-BdB1eFvP.js +0 -1
- package/dist/chunks/commitAttribution-D6J3NuhB.js +0 -1
- package/dist/chunks/config-Bxt1UH1T.js +0 -1
- package/dist/chunks/config-CjjXZfNi.js +0 -1
- package/dist/chunks/context-noninteractive-DvGo1l7b.js +0 -1
- package/dist/chunks/conversation-CH9ouFai.js +0 -1
- package/dist/chunks/createSession-DUfOAeyE.js +0 -1
- package/dist/chunks/doctor-7fgVhEKL.js +0 -1
- package/dist/chunks/envLessBridgeConfig-B2HYnEKo.js +0 -1
- package/dist/chunks/extra-usage-CLhv1Z4g.js +0 -1
- package/dist/chunks/extractMemories-B2IAvbXM.js +0 -1
- package/dist/chunks/fast-_G6zcFye.js +0 -1
- package/dist/chunks/firstPartyEventLogger-C9LzVy6y.js +0 -1
- package/dist/chunks/hooks-BUJLxdFJ.js +0 -1
- package/dist/chunks/hostGuard-C5xydXZI.js +0 -1
- package/dist/chunks/inboundAttachments-C0nMTtCi.js +0 -1
- package/dist/chunks/language-DfOAuDFc.js +0 -1
- package/dist/chunks/loadAgentsDir-DTbJJff-.js +0 -1
- package/dist/chunks/localSearch-DKv8PRLD.js +0 -1
- package/dist/chunks/model-BQF64tZx.js +0 -1
- package/dist/chunks/model-DvrvG6BB.js +0 -1
- package/dist/chunks/pluginStartupCheck-CoW7073W.js +0 -1
- package/dist/chunks/policyLimits-BkjgMQD0.js +0 -1
- package/dist/chunks/poorMode-qlxqU8Hm.js +0 -1
- package/dist/chunks/prompt-CN7gBNKS.js +0 -1
- package/dist/chunks/prompt-D-zHhqp8.js +0 -1
- package/dist/chunks/sandbox-adapter-LzTcKwBp.js +0 -1
- package/dist/chunks/searchExtraTools-CbJJQqzH.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-B_nNW0zE.js +0 -1
- package/dist/chunks/sessionMemory-C4JAUZ6V.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BlqAy8oR.js +0 -1
- package/dist/chunks/sessionObserver-DMvWci8-.js +0 -1
- package/dist/chunks/sessionStorage-Diyuvt20.js +0 -1
- package/dist/chunks/sinks-CXq8-7Qn.js +0 -1
- package/dist/chunks/skillLearning-1ZfYIzfL.js +0 -1
- package/dist/chunks/thinkback-C6gV2LpU.js +0 -1
- package/dist/chunks/trustedDevice-DUrFWupL.js +0 -1
- package/dist/chunks/undercover-k3JoOKAb.js +0 -1
- package/dist/chunks/upgrade-D7iGU0PQ.js +0 -1
- package/dist/chunks/usage-DbRdMJog.js +0 -1
- package/dist/chunks/useMainLoopModel-DHkRIgNs.js +0 -1
- package/dist/chunks/worktree-DMhP5T0p.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,t as a}from"./rolldown-runtime-DaDcL9Zw.js";import{n as o,t as s}from"./memoize-BK3gG5ob.js";import{a as c,d as l,f as u,l as d,o as f,s as p,u as ee}from"./envUtils-DSxRz_kt.js";import{n as te,t as m}from"./defineProperty-C-QyHrDq.js";import{n as h,t as ne}from"./axios-DaWTGg7G.js";import{B as re,D as ie,I as ae,Lt as oe,P as se,R as ce,T as g,di as _,fi as le,rr as ue,t as de,ui as v,xr as fe,y as pe}from"./src-CDCSSo0U2.js";import{t as me}from"./jsx-runtime-Bb4Xn-E0.js";import{A as he,E as ge,M as y,N as _e,P as ve,d as ye,f as be,h as xe,n as Se,r as b,t as Ce}from"./lazySchema-DcIJE_0i.js";import{An as we,En as Te,F as Ee,Gn as De,Mn as Oe,Nn as ke,Or as Ae,Pn as je,Sn as Me,Un as Ne,Wn as Pe,X as Fe,Zn as Ie,ar as Le,cr as Re,dr as x,en as S,gn as C,gr as ze,ht as Be,jn as Ve,kr as He,lr as Ue,mn as We,mt as Ge,nt as Ke,or as qe,pr as Je,pt as Ye,qt as Xe,rr as w,ur as Ze,vr as Qe,xn as $e,yn as et,z as tt}from"./state-ix0xIunV.js";import{$E as nt,$g as rt,AS as it,A_ as at,Ao as ot,At as st,BD as ct,B_ as lt,By as ut,C as T,Ch as dt,Cr as ft,DD as pt,Ds as mt,Dt as ht,Dy as gt,ED as _t,E_ as vt,Es as yt,Et as bt,Ey as xt,FS as St,F_ as Ct,Fc as wt,Fi as Tt,Fl as Et,Fy as Dt,Ga as Ot,Gd as kt,Gp as At,HS as jt,Ha as Mt,Hi as Nt,Hy as Pt,I as Ft,IS as It,Il as Lt,Iy as Rt,J_ as zt,Jy as Bt,KT as Vt,Ka as Ht,Ky as Ut,LE as Wt,L_ as Gt,Lc as Kt,Ln as E,Ly as qt,ME as Jt,M_ as Yt,N as Xt,NC as Zt,ND as Qt,NE as $t,NS as en,N_ as tn,Nn as D,Ny as nn,O as rn,OC as O,O_ as k,Ob as an,Of as on,PC as sn,PD as cn,PS as ln,P_ as un,Pi as dn,Py as fn,QE as pn,Qi as mn,Ql as hn,RC as gn,RS as _n,Rl as vn,Rn as yn,Ry as bn,SD as xn,Sh as Sn,So as Cn,Sx as wn,T as Tn,TO as En,Ti as Dn,Tl as On,Ts as kn,UE as An,US as jn,U_ as Mn,Ua as Nn,Uy as Pn,VE as Fn,V_ as A,Va as In,Vl as Ln,WT as Rn,W_ as zn,Wa as Bn,Wd as Vn,Wp as Hn,X_ as Un,Xn as Wn,Xr as Gn,Xu as Kn,Ya as qn,Yi as j,Yu as Jn,Zl as Yn,_D as Xn,__ as Zn,_a as Qn,_h as $n,_m as er,_y as tr,a_ as nr,af as rr,at as ir,aw as ar,bC as or,b_ as sr,bm as cr,cC as lr,cD as ur,c_ as dr,cc as fr,cd as pr,cs as mr,cw as hr,cy as gr,dC as _r,d_ as vr,dg as yr,dw as br,ed as xr,f as Sr,fC as Cr,fD as wr,f_ as Tr,fg as Er,fs as Dr,fx as Or,g_ as kr,ga as M,gf as Ar,gi as jr,gw as Mr,gx as Nr,gy as Pr,hC as Fr,hD as Ir,ha as N,hx as Lr,hy as Rr,i as zr,iS as Br,i_ as Vr,if as Hr,ig as Ur,iw as Wr,j as Gr,jE as Kr,jS as qr,j_ as Jr,jr as Yr,k as Xr,kb as Zr,kf as Qr,ky as $r,l_ as ei,ld as ti,mC as ni,mE as ri,m_ as ii,mf as ai,ms as oi,ns as si,o as ci,oC as P,o_ as li,ot as ui,pC as di,p_ as fi,pw as pi,px as mi,qi as hi,qy as gi,r as _i,r_ as vi,rw as yi,s as bi,sC as xi,s_ as Si,sy as Ci,t_ as wi,td as Ti,ts as Ei,uC as Di,uE as Oi,uS as ki,u_ as Ai,uc as ji,ug as Mi,v as Ni,v_ as Pi,va as Fi,vh as Ii,vm as Li,w as Ri,wO as zi,wi as Bi,wl as Vi,ws as Hi,wt as Ui,xC as Wi,xh as Gi,xx as Ki,y as qi,yD as Ji,y_ as Yi,ya as Xi,yh as Zi,yo as Qi,yr as $i,zC as ea,zD as ta,zE as na,zS as ra,z_ as ia,zo as aa,zy as oa}from"./loadAgentsDir-Clu7Uk6a.js";import{n as sa,t as ca}from"./cwd-CYmmnQVS.js";import{C as la,E as ua,F,I as da,N as fa,S as pa,V as ma,W as ha,_ as ga,a as _a,d as va,k as ya,l as I,n as ba,nt as xa,p as Sa,r as Ca,rt as wa,u as Ta,w as Ea,z as Da}from"./debug-BrXObCdR.js";import{C as Oa,D as ka,E as Aa,Ft as ja,G as Ma,K as Na,Q as Pa,_n as Fa,b as Ia,c as La,dn as Ra,f as za,g as L,gn as Ba,h as Va,i as Ha,n as Ua,nt as Wa,pn as Ga,s as Ka,u as qa,y as R,yn as Ja}from"./settings-Dlp5JTa_.js";import{D as Ya,E as Xa,I as Za,P as Qa,_ as $a,b as z,c as B,g as V,j as eo,m as to,n as no,o as ro,r as io,s as ao,v as oo,y as so}from"./config-3m_9zSrj.js";import{a as co,n as lo,r as uo}from"./process-gEbdy6uY.js";import{M as H,_ as fo,d as po,h as mo,i as ho,j as go,p as _o,r as vo}from"./git-Do0wJvux.js";import{c as yo,o as bo}from"./execFileNoThrow-D244NytW.js";import{d as xo,f as So,o as Co,s as U}from"./log-BMCygSzM.js";import{n as wo,t as To}from"./which-CKQnSouy.js";import{i as Eo,o as Do}from"./platform-BrYefG_2.js";import{i as Oo,o as ko}from"./windowsPaths-DtapVxOo.js";import{s as Ao,u as jo}from"./types-C-MRCL8J.js";import{n as W,r as G}from"./analytics-BotDBGh0.js";import{a as Mo,b as No,d as Po,i as K,n as Fo}from"./startupProfiler-xa3NmN7Z.js";import{l as Io,s as Lo,u as Ro}from"./oauth-BqJqV-2M.js";import{n as zo,t as Bo}from"./bundledMode--fG1S62b.js";import{l as Vo,o as Ho}from"./stringUtils-DGLPkqJ4.js";import{r as Uo}from"./permissions-Cn_6f8CB.js";import{$t as Wo,Bt as Go,C as Ko,Dn as qo,Ft as Jo,Jn as Yo,Kn as Xo,Ot as Zo,Rr as Qo,S as $o,Si as es,Tr as ts,Vn as ns,Vr as rs,Xt as is,Yn as as,Z as os,_ as ss,an as cs,ar as ls,b as us,bn as ds,cr as fs,en as ps,et as ms,g as hs,ii as gs,in as _s,ir as vs,jn as ys,lt as bs,o as xs,oi as Ss,or as Cs,pn as ws,rr as Ts,rt as Es,sr as Ds,ut as Os,v as ks,wi as As,wr as js,xn as Ms,xt as Ns,yn as Ps,zt as Fs}from"./model-BQF64tZx.js";import{Bt as Is,Et as Ls,Pt as Rs,Rt as zs,Tt as Bs,Ut as Vs,Vt as Hs,dt as Us,ft as Ws,ut as Gs,zt as Ks}from"./prompt-Bg_1U0gO.js";import{f as qs,h as Js,l as Ys,n as Xs}from"./proxy-CRN7jYIi.js";import{dt as Zs,ft as Qs}from"./esm-CGoYrggU.js";import{n as $s,t as ec}from"./partition-C8RSL3SQ.js";import{a as tc,n as nc}from"./ripgrep-BXmXjAzA.js";import{C as rc,D as ic,O as ac,y as oc}from"./rcDebugLog-VKwMl0yg.js";import{D as sc,O as cc,_ as lc,v as uc}from"./sessionTracing-D8wr9j4X.js";import{l as dc,r as fc}from"./commitAttribution-CGZr7XNO.js";import{i as pc,n as mc,o as hc,r as gc}from"./detectRepository-BPr0VWNO.js";import{l as _c,o as vc,r as yc}from"./api-B-5jqiMg.js";import{d as bc,f as xc,l as Sc,p as Cc,u as wc}from"./firstPartyEventLogger-BNGPPBNP.js";import{c as Tc,s as Ec}from"./referral-BlrMpBAV.js";import{n as Dc,t as Oc}from"./worktreeModeEnabled-BFOYTTTr.js";import{i as kc,t as Ac}from"./assistant-C83quuNj.js";import{c as jc,l as Mc}from"./releaseNotes-CunqVlbU.js";import{a as Nc,o as Pc}from"./grove-DrBVaZSN.js";import{a as Fc,i as Ic,n as Lc,o as Rc,r as zc}from"./remoteManagedSettings-jZ6u8ZBT.js";import{n as Bc,t as Vc}from"./allErrors-P3utlEeA.js";import{n as Hc,t as q}from"./exit-BOhGfSlm.js";import{n as Uc,s as Wc,t as Gc}from"./pluginOperations-Cz6eQ0Vu.js";import"./pluginCliCommands-I-lsw_us.js";import{n as Kc}from"./onChangeAppState-CHhRDkM7.js";import{n as qc}from"./asciicast-CbAjUHT_.js";import{i as Jc,t as Yc}from"./skillChangeDetector-s0F9Yf9a.js";import{n as Xc}from"./stats-C1Ff6w4i.js";import{t as Zc}from"./renderOptions-BUJB9nAm.js";import{i as Qc,n as $c,t as el}from"./githubRepoPathMapping-B4AM8luI.js";import{i as tl,n as nl}from"./earlyInput-BTC_Wucv.js";import{t as rl}from"./banner-CWkrK10u.js";import{c as il,n as al,r as ol,u as sl}from"./RemoteSessionManager-zdHfmvfj.js";import{posix as cl,relative as ll,resolve as ul,win32 as dl}from"path";import{appendFileSync as fl,readFileSync as pl}from"fs";import{open as ml,stat as hl}from"fs/promises";var gl=a((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),_l=a((e=>{var{InvalidArgumentError:t}=gl(),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})),vl=a((e=>{var{humanReadableArgName:t}=_l(),n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,t as a}from"./rolldown-runtime-DaDcL9Zw.js";import{n as o,t as s}from"./memoize-BK3gG5ob.js";import{a as c,d as l,f as u,l as d,o as f,s as p,u as ee}from"./envUtils-DSxRz_kt.js";import{n as te,t as m}from"./defineProperty-C-QyHrDq.js";import{n as h,t as ne}from"./axios-DaWTGg7G.js";import{B as re,D as ie,I as ae,Lt as oe,P as se,R as ce,T as g,di as _,fi as le,rr as ue,t as de,ui as v,xr as fe,y as pe}from"./src-CDCSSo0U2.js";import{t as me}from"./jsx-runtime-Bb4Xn-E0.js";import{A as he,E as ge,M as y,N as _e,P as ve,d as ye,f as be,h as xe,n as Se,r as b,t as Ce}from"./lazySchema-DcIJE_0i.js";import{An as we,En as Te,F as Ee,Gn as De,Mn as Oe,Nn as ke,Or as Ae,Pn as je,Sn as Me,Un as Ne,Wn as Pe,X as Fe,Zn as Ie,ar as Le,cr as Re,dr as x,en as S,gn as C,gr as ze,ht as Be,jn as Ve,kr as He,lr as Ue,mn as We,mt as Ge,nt as Ke,or as qe,pr as Je,pt as Ye,qt as Xe,rr as w,ur as Ze,vr as Qe,xn as $e,yn as et,z as tt}from"./state-ix0xIunV.js";import{$E as nt,$g as rt,AS as it,A_ as at,Ao as ot,At as st,BD as ct,B_ as lt,By as ut,C as T,Ch as dt,Cr as ft,DD as pt,Ds as mt,Dt as ht,Dy as gt,ED as _t,E_ as vt,Es as yt,Et as bt,Ey as xt,FS as St,F_ as Ct,Fc as wt,Fi as Tt,Fl as Et,Fy as Dt,Ga as Ot,Gd as kt,Gp as At,HS as jt,Ha as Mt,Hi as Nt,Hy as Pt,I as Ft,IS as It,Il as Lt,Iy as Rt,J_ as zt,Jy as Bt,KT as Vt,Ka as Ht,Ky as Ut,LE as Wt,L_ as Gt,Lc as Kt,Ln as E,Ly as qt,ME as Jt,M_ as Yt,N as Xt,NC as Zt,ND as Qt,NE as $t,NS as en,N_ as tn,Nn as D,Ny as nn,O as rn,OC as O,O_ as k,Ob as an,Of as on,PC as sn,PD as cn,PS as ln,P_ as un,Pi as dn,Py as fn,QE as pn,Qi as mn,Ql as hn,RC as gn,RS as _n,Rl as vn,Rn as yn,Ry as bn,SD as xn,Sh as Sn,So as Cn,Sx as wn,T as Tn,TO as En,Ti as Dn,Tl as On,Ts as kn,UE as An,US as jn,U_ as Mn,Ua as Nn,Uy as Pn,VE as Fn,V_ as A,Va as In,Vl as Ln,WT as Rn,W_ as zn,Wa as Bn,Wd as Vn,Wp as Hn,X_ as Un,Xn as Wn,Xr as Gn,Xu as Kn,Ya as qn,Yi as j,Yu as Jn,Zl as Yn,_D as Xn,__ as Zn,_a as Qn,_h as $n,_m as er,_y as tr,a_ as nr,af as rr,at as ir,aw as ar,bC as or,b_ as sr,bm as cr,cC as lr,cD as ur,c_ as dr,cc as fr,cd as pr,cs as mr,cw as hr,cy as gr,dC as _r,d_ as vr,dg as yr,dw as br,ed as xr,f as Sr,fC as Cr,fD as wr,f_ as Tr,fg as Er,fs as Dr,fx as Or,g_ as kr,ga as M,gf as Ar,gi as jr,gw as Mr,gx as Nr,gy as Pr,hC as Fr,hD as Ir,ha as N,hx as Lr,hy as Rr,i as zr,iS as Br,i_ as Vr,if as Hr,ig as Ur,iw as Wr,j as Gr,jE as Kr,jS as qr,j_ as Jr,jr as Yr,k as Xr,kb as Zr,kf as Qr,ky as $r,l_ as ei,ld as ti,mC as ni,mE as ri,m_ as ii,mf as ai,ms as oi,ns as si,o as ci,oC as P,o_ as li,ot as ui,pC as di,p_ as fi,pw as pi,px as mi,qi as hi,qy as gi,r as _i,r_ as vi,rw as yi,s as bi,sC as xi,s_ as Si,sy as Ci,t_ as wi,td as Ti,ts as Ei,uC as Di,uE as Oi,uS as ki,u_ as Ai,uc as ji,ug as Mi,v as Ni,v_ as Pi,va as Fi,vh as Ii,vm as Li,w as Ri,wO as zi,wi as Bi,wl as Vi,ws as Hi,wt as Ui,xC as Wi,xh as Gi,xx as Ki,y as qi,yD as Ji,y_ as Yi,ya as Xi,yh as Zi,yo as Qi,yr as $i,zC as ea,zD as ta,zE as na,zS as ra,z_ as ia,zo as aa,zy as oa}from"./loadAgentsDir-D206qwP3.js";import{n as sa,t as ca}from"./cwd-CYmmnQVS.js";import{C as la,E as ua,F,I as da,N as fa,S as pa,V as ma,W as ha,_ as ga,a as _a,d as va,k as ya,l as I,n as ba,nt as xa,p as Sa,r as Ca,rt as wa,u as Ta,w as Ea,z as Da}from"./debug-BrXObCdR.js";import{C as Oa,D as ka,E as Aa,Ft as ja,G as Ma,K as Na,Q as Pa,_n as Fa,b as Ia,c as La,dn as Ra,f as za,g as L,gn as Ba,h as Va,i as Ha,n as Ua,nt as Wa,pn as Ga,s as Ka,u as qa,y as R,yn as Ja}from"./settings-BovzmwMP.js";import{D as Ya,E as Xa,I as Za,P as Qa,_ as $a,b as z,c as B,g as V,j as eo,m as to,n as no,o as ro,r as io,s as ao,v as oo,y as so}from"./config-DmomySWC.js";import{a as co,n as lo,r as uo}from"./process-gEbdy6uY.js";import{M as H,_ as fo,d as po,h as mo,i as ho,j as go,p as _o,r as vo}from"./git-Do0wJvux.js";import{c as yo,o as bo}from"./execFileNoThrow-D244NytW.js";import{d as xo,f as So,o as Co,s as U}from"./log-BMCygSzM.js";import{n as wo,t as To}from"./which-CKQnSouy.js";import{i as Eo,o as Do}from"./platform-BrYefG_2.js";import{i as Oo,o as ko}from"./windowsPaths-DtapVxOo.js";import{s as Ao,u as jo}from"./types-C-MRCL8J.js";import{n as W,r as G}from"./analytics-BotDBGh0.js";import{a as Mo,b as No,d as Po,i as K,n as Fo}from"./startupProfiler-xa3NmN7Z.js";import{l as Io,s as Lo,u as Ro}from"./oauth-BqJqV-2M.js";import{n as zo,t as Bo}from"./bundledMode--fG1S62b.js";import{l as Vo,o as Ho}from"./stringUtils-DGLPkqJ4.js";import{r as Uo}from"./permissions-Cn_6f8CB.js";import{$t as Wo,Bt as Go,C as Ko,Dn as qo,Ft as Jo,Jn as Yo,Kn as Xo,Ot as Zo,Rr as Qo,S as $o,Si as es,Tr as ts,Vn as ns,Vr as rs,Xt as is,Yn as as,Z as os,_ as ss,an as cs,ar as ls,b as us,bn as ds,cr as fs,en as ps,et as ms,g as hs,ii as gs,in as _s,ir as vs,jn as ys,lt as bs,o as xs,oi as Ss,or as Cs,pn as ws,rr as Ts,rt as Es,sr as Ds,ut as Os,v as ks,wi as As,wr as js,xn as Ms,xt as Ns,yn as Ps,zt as Fs}from"./model-CKkOnnnx.js";import{Bt as Is,Et as Ls,Pt as Rs,Rt as zs,Tt as Bs,Ut as Vs,Vt as Hs,dt as Us,ft as Ws,ut as Gs,zt as Ks}from"./prompt-BNHtszmZ.js";import{f as qs,h as Js,l as Ys,n as Xs}from"./proxy-CRN7jYIi.js";import{dt as Zs,ft as Qs}from"./esm-D5q6s4l8.js";import{n as $s,t as ec}from"./partition-BAakXjvj.js";import{a as tc,n as nc}from"./ripgrep-BXmXjAzA.js";import{C as rc,D as ic,O as ac,y as oc}from"./rcDebugLog-CUy1_F23.js";import{D as sc,O as cc,_ as lc,v as uc}from"./sessionTracing-D9rUyiq0.js";import{l as dc,r as fc}from"./commitAttribution-ChAgixdj.js";import{i as pc,n as mc,o as hc,r as gc}from"./detectRepository-BPr0VWNO.js";import{l as _c,o as vc,r as yc}from"./api-gqTA-D7n.js";import{d as bc,f as xc,l as Sc,p as Cc,u as wc}from"./firstPartyEventLogger-CoSUd0a1.js";import{c as Tc,s as Ec}from"./referral-CUaIo_vT.js";import{n as Dc,t as Oc}from"./worktreeModeEnabled-BFOYTTTr.js";import{i as kc,t as Ac}from"./assistant-C83quuNj.js";import{c as jc,l as Mc}from"./releaseNotes-CxAHFLPl.js";import{a as Nc,o as Pc}from"./grove-CpqjcGCb.js";import{a as Fc,i as Ic,n as Lc,o as Rc,r as zc}from"./remoteManagedSettings-Cq994lyc.js";import{n as Bc,t as Vc}from"./allErrors-1896uQA1.js";import{n as Hc,t as q}from"./exit-BOhGfSlm.js";import{n as Uc,s as Wc,t as Gc}from"./pluginOperations-EN3EKLux.js";import"./pluginCliCommands-lqdxdkQp.js";import{n as Kc}from"./onChangeAppState-DBmy2Ow_.js";import{n as qc}from"./asciicast-CbAjUHT_.js";import{i as Jc,t as Yc}from"./skillChangeDetector-DNqohXxz.js";import{n as Xc}from"./stats-BY4dskVg.js";import{t as Zc}from"./renderOptions-BUJB9nAm.js";import{i as Qc,n as $c,t as el}from"./githubRepoPathMapping-qAoiyj6P.js";import{i as tl,n as nl}from"./earlyInput-BTC_Wucv.js";import{t as rl}from"./banner-CWkrK10u.js";import{c as il,n as al,r as ol,u as sl}from"./RemoteSessionManager-B740Dp6m.js";import{posix as cl,relative as ll,resolve as ul,win32 as dl}from"path";import{appendFileSync as fl,readFileSync as pl}from"fs";import{open as ml,stat as hl}from"fs/promises";var gl=a((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),_l=a((e=>{var{InvalidArgumentError:t}=gl(),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})),vl=a((e=>{var{humanReadableArgName:t}=_l(),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})),yl=a((e=>{var{InvalidArgumentError:t}=gl(),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,8 +16,8 @@ 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=m(o.execArgv).concat(t),f=r.spawn(o.execPath,t,{stdio:`inherit`})):n?(t.unshift(u),t=m(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=ee(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=ee(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 m(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=te,e.useColor=h})),Sl=a((e=>{var{Argument:t}=_l(),{Command:n}=xl(),{CommanderError:r,InvalidArgumentError:i}=gl(),{Help:a}=vl(),{Option:o}=yl();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})),Cl=a(((e,t)=>{var n=Sl();e=t.exports={},e.program=new n.Command,e.Argument=n.Argument,e.Command=n.Command,e.CommanderError=n.CommanderError,e.Help=n.Help,e.InvalidArgumentError=n.InvalidArgumentError,e.InvalidOptionArgumentError=n.InvalidArgumentError,e.Option=n.Option,e.createCommand=e=>new n.Command(e),e.createOption=(e,t)=>new n.Option(e,t),e.createArgument=(e,t)=>new n.Argument(e,t)}));s(),f(),te(),Ae(),S(),xa(),Da(),pa(),Sa(),lo(),_a(),W(),Fo(),Aa(),ds();var{program:wl,createCommand:Tl,createArgument:El,createOption:Dl,CommanderError:Ol,InvalidArgumentError:kl,InvalidOptionArgumentError:Al,Command:jl,Argument:Ml,Option:J,Help:Nl}=r(Cl(),1).default;ne();var Pl=r(le(),1);_();var Y=me();de(),b(),sa(),go(),yo(),Co(),To(),fo(),Do(),Oo(),Fa(),Ao(),No(),Ra(),Ce(),Bo(),Wa(),Ho(),Oa(),L(),Qa(),zi(),As(),Xa(),V(),Js(),Ys(),Ss(),Qo(),js(),Ds(),Cs(),Ts(),Yo(),Xo(),ys(),Go(),ss(),ta(),Qt(),tc(),Xn(),Vs(),zs(),Us(),Fn(),$t(),ea(),sn(),O(),xc(),lr(),ac(),Ci(),Un(),A(),k(),Ai(),rt(),yr(),Zi(),er(),Oc(),Kn(),Lt(),yt(),kn(),Dr(),aa(),In(),N(),mn(),Tt(),Yr(),E(),ir(),Ro(),xo();var Fl=!1;function Il(){if(Fl||(Fl=!0,So())||d(process.env.CLAUDE_CODE_USE_BEDROCK)||d(process.env.CLAUDE_CODE_USE_VERTEX)||d(process.env.CLAUDE_CODE_USE_FOUNDRY)||process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||process.env.ANTHROPIC_UNIX_SOCKET||process.env.CLAUDE_CODE_CLIENT_CERT||process.env.CLAUDE_CODE_CLIENT_KEY)return;let e=process.env.ANTHROPIC_BASE_URL||Io().BASE_API_URL;fetch(e,{method:`HEAD`,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}function Ll(){if(process.env.NODE_EXTRA_CA_CERTS)return;let e=Rl();e&&(process.env.NODE_EXTRA_CA_CERTS=e,I(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${e}`))}function Rl(){try{let e=B()?.env,t=La(`userSettings`)?.env;I(`CA certs: Config fallback - globalEnv keys: ${e?Object.keys(e).join(`,`):`none`}, settingsEnv keys: ${t?Object.keys(t).join(`,`):`none`}`);let n=t?.NODE_EXTRA_CA_CERTS||e?.NODE_EXTRA_CA_CERTS;return n&&I(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${n}`),n}catch(e){I(`CA certs: Config fallback failed: ${e}`,{level:`error`});return}}V(),_a(),pc(),Qs(),f(),Xi(),lc(),cc(),wc();var zl=!1,Bl=o(async()=>{let e=Date.now();H(`info`,`init_started`),K(`init_function_start`);try{let t=Date.now();io(),re({loadTheme:()=>B().theme,saveTheme:e=>z(t=>({...t,theme:e}))}),H(`info`,`init_configs_enabled`,{duration_ms:Date.now()-t}),K(`init_configs_enabled`);let n=Date.now();Fi(),Ll(),H(`info`,`init_safe_env_vars_applied`,{duration_ms:Date.now()-n}),K(`init_safe_env_vars_applied`),Di(),K(`init_after_graceful_shutdown`),import(`./firstPartyEventLogger-C9LzVy6y.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`),rs(),K(`init_after_oauth_populate`),Zs(),K(`init_after_jetbrains_detection`),mc(),zc()&&Lc(),Bn()&&Mt(),K(`init_after_remote_settings_check`),oo();let r=Date.now();I(`[init] configureGlobalMTLS starting`),qs(),H(`info`,`init_mtls_configured`,{duration_ms:Date.now()-r}),I(`[init] configureGlobalMTLS complete`);let i=Date.now();if(I(`[init] configureGlobalAgents starting`),Xs(),H(`info`,`init_proxy_configured`,{duration_ms:Date.now()-i}),I(`[init] configureGlobalAgents complete`),K(`init_network_configured`),await Sc(),Il(),d(process.env.CLAUDE_CODE_REMOTE))try{let{initUpstreamProxy:e,getUpstreamProxyEnv:t}=await import(`./upstreamproxy-DyR_eXO8.js`),{registerUpstreamProxyEnvFn:n}=await import(`./subprocessEnv-BSQSomcK.js`);n(t),await e()}catch(e){I(`[init] upstreamproxy init failed: ${e instanceof Error?e.message:String(e)}; continuing without proxy`,{level:`warn`})}if(ko(),wa(cr),yn()){let e=Date.now();await D(),H(`info`,`init_scratchpad_created`,{duration_ms:Date.now()-e})}try{let{getRipgrepStatus:e}=await import(`./ripgrep-BfIpz5uC.js`),t=e();t.note&&process.stderr.write(`[ripgrep] ${t.note}\n`)}catch{I(`[init] ripgrep status check skipped`)}H(`info`,`init_completed`,{duration_ms:Date.now()-e}),K(`init_function_end`)}catch(e){if(e instanceof ya){if(tt()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}\n`),xi(1);return}return import(`./InvalidConfigDialog-9M-1nfZ6.js`).then(t=>t.showInvalidConfigDialog({error:e}))}else throw e}});function Vl(){zc()?(tt()&&uc()&&Hl().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`),Rc().then(async()=>{I(`[3P telemetry] Remote managed settings loaded, initializing telemetry`),Qn(),await Hl()}).catch(e=>{I(`[3P telemetry] Telemetry init failed (remote settings path): ${F(e)}`,{level:`error`})})):Hl().catch(e=>{I(`[3P telemetry] Telemetry init failed: ${F(e)}`,{level:`error`})})}async function Hl(){if(!zl){if(!d(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)){zl=!0,I(`[3P telemetry] Skipped — CLAUDE_CODE_ENABLE_TELEMETRY not set`);return}zl=!0;try{await Ul()}catch(e){throw zl=!1,e}}}async function Ul(){let{initializeTelemetry:e}=await import(`./instrumentation-CLZttr_u.js`),t=await e();t&&(De(t,(e,n)=>{let r=t?.createCounter(e,n);return{add(e,t={}){let n={...sc(),...t};r?.add(e,n)}}}),Ge()?.add(1))}ki();async function Wl(e,t,n,r){let{App:i}=await import(`./App-iJu5qyiF.js`),{REPL:a}=await import(`./REPL-DlBJIPCw.js`);await r(e,(0,Y.jsx)(i,{...t,children:(0,Y.jsx)(a,{...n})}))}Ro(),V(),_a(),xo();var Gl=Se(()=>ge({client_data:he(y(),ve()).nullish(),additional_model_options:xe(ge({model:y(),name:y(),description:y()}).transform(({model:e,name:t,description:n})=>({value:e,label:t,description:n}))).nullish()}));async function Kl(){if(So())return I(`[Bootstrap] Skipped: Nonessential traffic disabled`),null;if(es()!==`firstParty`)return I(`[Bootstrap] Skipped: 3P provider`),null;let e=Ns();if(!(Zo()?.accessToken&&Fs())&&!e)return I(`[Bootstrap] Skipped: no usable OAuth or API key`),null;let t=`${Io().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await vs(async()=>{let n=Zo()?.accessToken,r;if(n&&Fs())r={Authorization:`Bearer ${n}`,"anthropic-beta":Lo};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 h.get(t,{headers:{"Content-Type":`application/json`,"User-Agent":ls(),...r},timeout:5e3}),a=Gl().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: ${h.isAxiosError(e)?e.response?.status??e.code:`unknown`}`),e}}async function ql(){try{let e=await Kl();if(!e)return;let t=e.client_data??null,n=e.additional_model_options??[],r=B();if(fs(r.clientDataCache,t)&&fs(r.additionalModelOptionsCache,n)){I(`[Bootstrap] Cache unchanged, skipping write`);return}I(`[Bootstrap] Cache updated, persisting to disk`),z(e=>({...e,clientDataCache:t,additionalModelOptionsCache:n}))}catch(e){U(e)}}ms(),_t(),vc(),oa(),Ec(),_a(),f();var Jl=new Map;function Yl(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;Eo()===`windows`&&(e=e.split(dl.sep).join(cl.sep),t=t.split(dl.sep).join(cl.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 Xl=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function Zl(e){let t=`${e.name}: ${e.message}`;return Xl.some(e=>e.test(t))}var Ql=null;function $l(){let e=process.listeners(`warning`);Ql&&e.includes(Ql)||(Yl()||process.removeAllListeners(`warning`),Ql=e=>{try{let t=`${e.name}: ${e.message.slice(0,50)}`,n=Jl.get(t)||0;(Jl.has(t)||Jl.size<1e3)&&Jl.set(t,n+1);let r=Zl(e);G(`tengu_node_warning`,{is_internal:+!!r,occurrence_count:n+1,classname:e.name,...process.env.USER_TYPE===`ant`&&{message:e.message}}),d(process.env.CLAUDE_DEBUG)&&I(`${r?`[Internal Warning]`:`[Warning]`} ${e.toString()}`,{level:`warn`})}catch{}},process.on(`warning`,Ql))}ra(),it(),Nr(),Or(),Zr(),Nc(),de();function eu(){return(0,Y.jsxs)(se,{children:[`MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the`,` `,(0,Y.jsx)(oe,{url:`https://code.claude.com/docs/en/mcp`,children:`MCP documentation`}),`.`]})}W(),L(),de();function tu({serverName:e,onDone:t}){function n(n){switch(G(`tengu_mcp_dialog_choice`,{choice:n}),n){case`yes`:case`yes_all`:{let r=(za()||{}).enabledMcpjsonServers||[];r.includes(e)||R(`localSettings`,{enabledMcpjsonServers:[...r,e]}),n===`yes_all`&&R(`localSettings`,{enableAllProjectMcpServers:!0}),t();break}case`no`:{let n=(za()||{}).disabledMcpjsonServers||[];n.includes(e)||R(`localSettings`,{disabledMcpjsonServers:[...n,e]}),t();break}}}return(0,Y.jsxs)(pe,{title:`New MCP server found in .mcp.json: ${e}`,color:`warning`,onCancel:()=>n(`no`),children:[(0,Y.jsx)(eu,{}),(0,Y.jsx)(mi,{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`)})]})}ec(),W(),de(),L(),wn();function nu({serverNames:e,onDone:t}){function n(n){let r=za()||{},i=r.enabledMcpjsonServers||[],a=r.disabledMcpjsonServers||[],[o,s]=$s(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,Pl.useCallback)(()=>{let n=(za()||{}).disabledMcpjsonServers||[];R(`localSettings`,{disabledMcpjsonServers:[...new Set([...n,...e])]}),t()},[e,t]);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(pe,{title:`${e.length} new MCP servers found in .mcp.json`,subtitle:`Select any you wish to enable.`,color:`warning`,onCancel:r,hideInputGuide:!0,children:[(0,Y.jsx)(eu,{}),(0,Y.jsx)(Lr,{options:e.map(e=>({label:e,value:e})),defaultValue:e,onSubmit:n,onCancel:r,hideIndexes:!0})]}),(0,Y.jsx)(ae,{paddingX:1,children:(0,Y.jsx)(se,{dimColor:!0,italic:!0,children:(0,Y.jsxs)(g,{children:[(0,Y.jsx)(ie,{shortcut:`Space`,action:`select`}),(0,Y.jsx)(ie,{shortcut:`Enter`,action:`confirm`}),(0,Y.jsx)(Ki,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`reject all`})]})})})]})}jn();async function ru(e){let{servers:t}=ia(`project`),n=Object.keys(t).filter(e=>vt(e)===`pending`);n.length!==0&&await new Promise(t=>{let r=()=>void t();if(n.length===1&&n[0]!==void 0){let t=n[0];e.render((0,Y.jsx)(jt,{children:(0,Y.jsx)(an,{children:(0,Y.jsx)(tu,{serverName:t,onDone:r})})}))}else e.render((0,Y.jsx)(jt,{children:(0,Y.jsx)(an,{children:(0,Y.jsx)(nu,{serverNames:n,onDone:r})})}))})}ja(),nt(),Vt(),pi(),dc(),hr(),ar(),T(),V(),_a();var iu={iterm:`iTerm`,"iterm.app":`iTerm`,ghostty:`Ghostty`,kitty:`kitty`,alacritty:`Alacritty`,wezterm:`WezTerm`,apple_terminal:`Terminal`};function au(){if(process.platform!==`darwin`)return;let e=process.env.TERM_PROGRAM;if(!e)return;let t=iu[e.toLowerCase()];t&&B().deepLinkTerminal!==t&&(z(e=>({...e,deepLinkTerminal:t})),I(`Stored deep link terminal preference: ${t}`))}var ou=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(),lr(),S(),de(),Zr(),jn(),V(),f(),Xi(),Bc(),L();function su(){z(e=>({...e,hasCompletedOnboarding:!0,lastOnboardingVersion:`0.0.5`}))}function cu(e,t){return new Promise(n=>{e.render(t(e=>void n(e)))})}async function X(e,t,n){return lu(e,t,{color:`error`,beforeExit:n})}async function lu(e,t,n){let{Text:r}=await import(`./src-CST_jFnT.js`),i=n?.color,a=n?.exitCode??1;e.render(i?(0,Y.jsx)(r,{color:i,children:t}):(0,Y.jsx)(r,{children:t})),e.unmount(),await n?.beforeExit?.(),process.exit(a)}function Z(e,t,n){return cu(e,e=>(0,Y.jsx)(ce,{initialState:B().theme,onThemeSave:e=>z(t=>({...t,theme:e})),children:(0,Y.jsx)(jt,{onChangeAppState:n?.onChangeAppState,children:(0,Y.jsx)(an,{children:t(e)})})}))}async function uu(e,t){e.render(t),ff(),await e.waitUntilExit(),await P(0)}async function du(e,t,n,r){if(d(!1)||process.env.IS_DEMO)return!1;let i=B(),a=!1;if(!i.theme||!i.hasCompletedOnboarding){a=!0;let{Onboarding:t}=await import(`./Onboarding-cHcnsBGp.js`);await Z(e,e=>(0,Y.jsx)(t,{onDone:()=>{su(),e()}}),{onChangeAppState:Kc})}if(!d(process.env.CLAUBBIT)){if(!no()){let{TrustDialog:t}=await import(`./TrustDialog-CnVKrdxQ.js`);await Z(e,e=>(0,Y.jsx)(t,{commands:r,onDone:e}))}Ze(!0),Kr();let{errors:t}=Vc();if(t.length===0&&await ru(e),await An()){let t=Wt(await na(!0)),{ClaudeMdExternalIncludesDialog:n}=await import(`./ClaudeMdExternalIncludesDialog-TypH-X8e.js`);await Z(e,e=>(0,Y.jsx)(n,{onDone:e,isStandaloneDialog:!0,externalIncludes:t}))}}if(Qc(),au(),Qn(),setImmediate(()=>Vl()),await Pc()){let{GroveDialog:t}=await import(`./Grove-DPkIjqg8.js`);if(await Z(e,e=>(0,Y.jsx)(t,{showIfAlreadyViewed:!1,location:a?`onboarding`:`policy_update_modal`,onDone:e}))===`escape`)return G(`tengu_grove_policy_exited`,{}),xi(0),!1}if(process.env.ANTHROPIC_API_KEY&&!l()){let t=ts(process.env.ANTHROPIC_API_KEY);if(ao(t)===`new`){let{ApproveApiKey:n}=await import(`./ApproveApiKey-CKfn7U1R.js`);await Z(e,e=>(0,Y.jsx)(n,{customApiKeyTruncated:t,onDone:e}),{onChangeAppState:Kc})}}if((t===`bypassPermissions`||n)&&!Va()){let{BypassPermissionsModeDialog:t}=await import(`./BypassPermissionsModeDialog-D1FCKVOi.js`);await Z(e,e=>(0,Y.jsx)(t,{onAccept:e}))}return a}function fu(e){let t=0,n=Zc(e);n.stdin&&G(`tengu_stdin_interactive`,{});let r=new ou,i=Xc();x(i);let a=process.env.CLAUDE_CODE_FRAME_TIMING_LOG;return{getFpsMetrics:()=>r.getMetrics(),stats:i,renderOptions:{...n,onFrame:e=>{if(r.record(e.durationMs),i.observe(`frame_duration_ms`,e.durationMs),a&&e.phases){let t=JSON.stringify({total:e.durationMs,...e.phases,rss:process.memoryUsage.rss(),cpu:process.cpuUsage()})+`
|
|
20
|
-
`;fl(a,t)}if(!ue())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}}}}}Zr();async function pu(e,t){let{InvalidSettingsDialog:n}=await import(`./InvalidSettingsDialog-
|
|
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 m(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=te,e.useColor=h})),Sl=a((e=>{var{Argument:t}=_l(),{Command:n}=xl(),{CommanderError:r,InvalidArgumentError:i}=gl(),{Help:a}=vl(),{Option:o}=yl();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})),Cl=a(((e,t)=>{var n=Sl();e=t.exports={},e.program=new n.Command,e.Argument=n.Argument,e.Command=n.Command,e.CommanderError=n.CommanderError,e.Help=n.Help,e.InvalidArgumentError=n.InvalidArgumentError,e.InvalidOptionArgumentError=n.InvalidArgumentError,e.Option=n.Option,e.createCommand=e=>new n.Command(e),e.createOption=(e,t)=>new n.Option(e,t),e.createArgument=(e,t)=>new n.Argument(e,t)}));s(),f(),te(),Ae(),S(),xa(),Da(),pa(),Sa(),lo(),_a(),W(),Fo(),Aa(),ds();var{program:wl,createCommand:Tl,createArgument:El,createOption:Dl,CommanderError:Ol,InvalidArgumentError:kl,InvalidOptionArgumentError:Al,Command:jl,Argument:Ml,Option:J,Help:Nl}=r(Cl(),1).default;ne();var Pl=r(le(),1);_();var Y=me();de(),b(),sa(),go(),yo(),Co(),To(),fo(),Do(),Oo(),Fa(),Ao(),No(),Ra(),Ce(),Bo(),Wa(),Ho(),Oa(),L(),Qa(),zi(),As(),Xa(),V(),Js(),Ys(),Ss(),Qo(),js(),Ds(),Cs(),Ts(),Yo(),Xo(),ys(),Go(),ss(),ta(),Qt(),tc(),Xn(),Vs(),zs(),Us(),Fn(),$t(),ea(),sn(),O(),xc(),lr(),ac(),Ci(),Un(),A(),k(),Ai(),rt(),yr(),Zi(),er(),Oc(),Kn(),Lt(),yt(),kn(),Dr(),aa(),In(),N(),mn(),Tt(),Yr(),E(),ir(),Ro(),xo();var Fl=!1;function Il(){if(Fl||(Fl=!0,So())||d(process.env.CLAUDE_CODE_USE_BEDROCK)||d(process.env.CLAUDE_CODE_USE_VERTEX)||d(process.env.CLAUDE_CODE_USE_FOUNDRY)||process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||process.env.ANTHROPIC_UNIX_SOCKET||process.env.CLAUDE_CODE_CLIENT_CERT||process.env.CLAUDE_CODE_CLIENT_KEY)return;let e=process.env.ANTHROPIC_BASE_URL||Io().BASE_API_URL;fetch(e,{method:`HEAD`,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}function Ll(){if(process.env.NODE_EXTRA_CA_CERTS)return;let e=Rl();e&&(process.env.NODE_EXTRA_CA_CERTS=e,I(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${e}`))}function Rl(){try{let e=B()?.env,t=La(`userSettings`)?.env;I(`CA certs: Config fallback - globalEnv keys: ${e?Object.keys(e).join(`,`):`none`}, settingsEnv keys: ${t?Object.keys(t).join(`,`):`none`}`);let n=t?.NODE_EXTRA_CA_CERTS||e?.NODE_EXTRA_CA_CERTS;return n&&I(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${n}`),n}catch(e){I(`CA certs: Config fallback failed: ${e}`,{level:`error`});return}}V(),_a(),pc(),Qs(),f(),Xi(),lc(),cc(),wc();var zl=!1,Bl=o(async()=>{let e=Date.now();H(`info`,`init_started`),K(`init_function_start`);try{let t=Date.now();io(),re({loadTheme:()=>B().theme,saveTheme:e=>z(t=>({...t,theme:e}))}),H(`info`,`init_configs_enabled`,{duration_ms:Date.now()-t}),K(`init_configs_enabled`);let n=Date.now();Fi(),Ll(),H(`info`,`init_safe_env_vars_applied`,{duration_ms:Date.now()-n}),K(`init_safe_env_vars_applied`),Di(),K(`init_after_graceful_shutdown`),import(`./firstPartyEventLogger-CS9jVz6D.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`),rs(),K(`init_after_oauth_populate`),Zs(),K(`init_after_jetbrains_detection`),mc(),zc()&&Lc(),Bn()&&Mt(),K(`init_after_remote_settings_check`),oo();let r=Date.now();I(`[init] configureGlobalMTLS starting`),qs(),H(`info`,`init_mtls_configured`,{duration_ms:Date.now()-r}),I(`[init] configureGlobalMTLS complete`);let i=Date.now();if(I(`[init] configureGlobalAgents starting`),Xs(),H(`info`,`init_proxy_configured`,{duration_ms:Date.now()-i}),I(`[init] configureGlobalAgents complete`),K(`init_network_configured`),await Sc(),Il(),d(process.env.CLAUDE_CODE_REMOTE))try{let{initUpstreamProxy:e,getUpstreamProxyEnv:t}=await import(`./upstreamproxy-DyR_eXO8.js`),{registerUpstreamProxyEnvFn:n}=await import(`./subprocessEnv-BSQSomcK.js`);n(t),await e()}catch(e){I(`[init] upstreamproxy init failed: ${e instanceof Error?e.message:String(e)}; continuing without proxy`,{level:`warn`})}if(ko(),wa(cr),yn()){let e=Date.now();await D(),H(`info`,`init_scratchpad_created`,{duration_ms:Date.now()-e})}try{let{getRipgrepStatus:e}=await import(`./ripgrep-BfIpz5uC.js`),t=e();t.note&&process.stderr.write(`[ripgrep] ${t.note}\n`)}catch{I(`[init] ripgrep status check skipped`)}H(`info`,`init_completed`,{duration_ms:Date.now()-e}),K(`init_function_end`)}catch(e){if(e instanceof ya){if(tt()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}\n`),xi(1);return}return import(`./InvalidConfigDialog-CHzBSJDf.js`).then(t=>t.showInvalidConfigDialog({error:e}))}else throw e}});function Vl(){zc()?(tt()&&uc()&&Hl().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`),Rc().then(async()=>{I(`[3P telemetry] Remote managed settings loaded, initializing telemetry`),Qn(),await Hl()}).catch(e=>{I(`[3P telemetry] Telemetry init failed (remote settings path): ${F(e)}`,{level:`error`})})):Hl().catch(e=>{I(`[3P telemetry] Telemetry init failed: ${F(e)}`,{level:`error`})})}async function Hl(){if(!zl){if(!d(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)){zl=!0,I(`[3P telemetry] Skipped — CLAUDE_CODE_ENABLE_TELEMETRY not set`);return}zl=!0;try{await Ul()}catch(e){throw zl=!1,e}}}async function Ul(){let{initializeTelemetry:e}=await import(`./instrumentation-Bw3CxPQf.js`),t=await e();t&&(De(t,(e,n)=>{let r=t?.createCounter(e,n);return{add(e,t={}){let n={...sc(),...t};r?.add(e,n)}}}),Ge()?.add(1))}ki();async function Wl(e,t,n,r){let{App:i}=await import(`./App-BP06lHmf.js`),{REPL:a}=await import(`./REPL-DvA910N_.js`);await r(e,(0,Y.jsx)(i,{...t,children:(0,Y.jsx)(a,{...n})}))}Ro(),V(),_a(),xo();var Gl=Se(()=>ge({client_data:he(y(),ve()).nullish(),additional_model_options:xe(ge({model:y(),name:y(),description:y()}).transform(({model:e,name:t,description:n})=>({value:e,label:t,description:n}))).nullish()}));async function Kl(){if(So())return I(`[Bootstrap] Skipped: Nonessential traffic disabled`),null;if(es()!==`firstParty`)return I(`[Bootstrap] Skipped: 3P provider`),null;let e=Ns();if(!(Zo()?.accessToken&&Fs())&&!e)return I(`[Bootstrap] Skipped: no usable OAuth or API key`),null;let t=`${Io().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await vs(async()=>{let n=Zo()?.accessToken,r;if(n&&Fs())r={Authorization:`Bearer ${n}`,"anthropic-beta":Lo};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 h.get(t,{headers:{"Content-Type":`application/json`,"User-Agent":ls(),...r},timeout:5e3}),a=Gl().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: ${h.isAxiosError(e)?e.response?.status??e.code:`unknown`}`),e}}async function ql(){try{let e=await Kl();if(!e)return;let t=e.client_data??null,n=e.additional_model_options??[],r=B();if(fs(r.clientDataCache,t)&&fs(r.additionalModelOptionsCache,n)){I(`[Bootstrap] Cache unchanged, skipping write`);return}I(`[Bootstrap] Cache updated, persisting to disk`),z(e=>({...e,clientDataCache:t,additionalModelOptionsCache:n}))}catch(e){U(e)}}ms(),_t(),vc(),oa(),Ec(),_a(),f();var Jl=new Map;function Yl(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;Eo()===`windows`&&(e=e.split(dl.sep).join(cl.sep),t=t.split(dl.sep).join(cl.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 Xl=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function Zl(e){let t=`${e.name}: ${e.message}`;return Xl.some(e=>e.test(t))}var Ql=null;function $l(){let e=process.listeners(`warning`);Ql&&e.includes(Ql)||(Yl()||process.removeAllListeners(`warning`),Ql=e=>{try{let t=`${e.name}: ${e.message.slice(0,50)}`,n=Jl.get(t)||0;(Jl.has(t)||Jl.size<1e3)&&Jl.set(t,n+1);let r=Zl(e);G(`tengu_node_warning`,{is_internal:+!!r,occurrence_count:n+1,classname:e.name,...process.env.USER_TYPE===`ant`&&{message:e.message}}),d(process.env.CLAUDE_DEBUG)&&I(`${r?`[Internal Warning]`:`[Warning]`} ${e.toString()}`,{level:`warn`})}catch{}},process.on(`warning`,Ql))}ra(),it(),Nr(),Or(),Zr(),Nc(),de();function eu(){return(0,Y.jsxs)(se,{children:[`MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the`,` `,(0,Y.jsx)(oe,{url:`https://code.claude.com/docs/en/mcp`,children:`MCP documentation`}),`.`]})}W(),L(),de();function tu({serverName:e,onDone:t}){function n(n){switch(G(`tengu_mcp_dialog_choice`,{choice:n}),n){case`yes`:case`yes_all`:{let r=(za()||{}).enabledMcpjsonServers||[];r.includes(e)||R(`localSettings`,{enabledMcpjsonServers:[...r,e]}),n===`yes_all`&&R(`localSettings`,{enableAllProjectMcpServers:!0}),t();break}case`no`:{let n=(za()||{}).disabledMcpjsonServers||[];n.includes(e)||R(`localSettings`,{disabledMcpjsonServers:[...n,e]}),t();break}}}return(0,Y.jsxs)(pe,{title:`New MCP server found in .mcp.json: ${e}`,color:`warning`,onCancel:()=>n(`no`),children:[(0,Y.jsx)(eu,{}),(0,Y.jsx)(mi,{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`)})]})}ec(),W(),de(),L(),wn();function nu({serverNames:e,onDone:t}){function n(n){let r=za()||{},i=r.enabledMcpjsonServers||[],a=r.disabledMcpjsonServers||[],[o,s]=$s(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,Pl.useCallback)(()=>{let n=(za()||{}).disabledMcpjsonServers||[];R(`localSettings`,{disabledMcpjsonServers:[...new Set([...n,...e])]}),t()},[e,t]);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(pe,{title:`${e.length} new MCP servers found in .mcp.json`,subtitle:`Select any you wish to enable.`,color:`warning`,onCancel:r,hideInputGuide:!0,children:[(0,Y.jsx)(eu,{}),(0,Y.jsx)(Lr,{options:e.map(e=>({label:e,value:e})),defaultValue:e,onSubmit:n,onCancel:r,hideIndexes:!0})]}),(0,Y.jsx)(ae,{paddingX:1,children:(0,Y.jsx)(se,{dimColor:!0,italic:!0,children:(0,Y.jsxs)(g,{children:[(0,Y.jsx)(ie,{shortcut:`Space`,action:`select`}),(0,Y.jsx)(ie,{shortcut:`Enter`,action:`confirm`}),(0,Y.jsx)(Ki,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`reject all`})]})})})]})}jn();async function ru(e){let{servers:t}=ia(`project`),n=Object.keys(t).filter(e=>vt(e)===`pending`);n.length!==0&&await new Promise(t=>{let r=()=>void t();if(n.length===1&&n[0]!==void 0){let t=n[0];e.render((0,Y.jsx)(jt,{children:(0,Y.jsx)(an,{children:(0,Y.jsx)(tu,{serverName:t,onDone:r})})}))}else e.render((0,Y.jsx)(jt,{children:(0,Y.jsx)(an,{children:(0,Y.jsx)(nu,{serverNames:n,onDone:r})})}))})}ja(),nt(),Vt(),pi(),dc(),hr(),ar(),T(),V(),_a();var iu={iterm:`iTerm`,"iterm.app":`iTerm`,ghostty:`Ghostty`,kitty:`kitty`,alacritty:`Alacritty`,wezterm:`WezTerm`,apple_terminal:`Terminal`};function au(){if(process.platform!==`darwin`)return;let e=process.env.TERM_PROGRAM;if(!e)return;let t=iu[e.toLowerCase()];t&&B().deepLinkTerminal!==t&&(z(e=>({...e,deepLinkTerminal:t})),I(`Stored deep link terminal preference: ${t}`))}var ou=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(),lr(),S(),de(),Zr(),jn(),V(),f(),Xi(),Bc(),L();function su(){z(e=>({...e,hasCompletedOnboarding:!0,lastOnboardingVersion:`0.0.6`}))}function cu(e,t){return new Promise(n=>{e.render(t(e=>void n(e)))})}async function X(e,t,n){return lu(e,t,{color:`error`,beforeExit:n})}async function lu(e,t,n){let{Text:r}=await import(`./src-CST_jFnT.js`),i=n?.color,a=n?.exitCode??1;e.render(i?(0,Y.jsx)(r,{color:i,children:t}):(0,Y.jsx)(r,{children:t})),e.unmount(),await n?.beforeExit?.(),process.exit(a)}function Z(e,t,n){return cu(e,e=>(0,Y.jsx)(ce,{initialState:B().theme,onThemeSave:e=>z(t=>({...t,theme:e})),children:(0,Y.jsx)(jt,{onChangeAppState:n?.onChangeAppState,children:(0,Y.jsx)(an,{children:t(e)})})}))}async function uu(e,t){e.render(t),ff(),await e.waitUntilExit(),await P(0)}async function du(e,t,n,r){if(d(!1)||process.env.IS_DEMO)return!1;let i=B(),a=!1;if(!i.theme||!i.hasCompletedOnboarding){a=!0;let{Onboarding:t}=await import(`./Onboarding-BrAJp0aL.js`);await Z(e,e=>(0,Y.jsx)(t,{onDone:()=>{su(),e()}}),{onChangeAppState:Kc})}if(!d(process.env.CLAUBBIT)){if(!no()){let{TrustDialog:t}=await import(`./TrustDialog-DGJ_BisZ.js`);await Z(e,e=>(0,Y.jsx)(t,{commands:r,onDone:e}))}Ze(!0),Kr();let{errors:t}=Vc();if(t.length===0&&await ru(e),await An()){let t=Wt(await na(!0)),{ClaudeMdExternalIncludesDialog:n}=await import(`./ClaudeMdExternalIncludesDialog-DFivNFuo.js`);await Z(e,e=>(0,Y.jsx)(n,{onDone:e,isStandaloneDialog:!0,externalIncludes:t}))}}if(Qc(),au(),Qn(),setImmediate(()=>Vl()),await Pc()){let{GroveDialog:t}=await import(`./Grove-sWm-oLBf.js`);if(await Z(e,e=>(0,Y.jsx)(t,{showIfAlreadyViewed:!1,location:a?`onboarding`:`policy_update_modal`,onDone:e}))===`escape`)return G(`tengu_grove_policy_exited`,{}),xi(0),!1}if(process.env.ANTHROPIC_API_KEY&&!l()){let t=ts(process.env.ANTHROPIC_API_KEY);if(ao(t)===`new`){let{ApproveApiKey:n}=await import(`./ApproveApiKey-a2ZonQ3n.js`);await Z(e,e=>(0,Y.jsx)(n,{customApiKeyTruncated:t,onDone:e}),{onChangeAppState:Kc})}}if((t===`bypassPermissions`||n)&&!Va()){let{BypassPermissionsModeDialog:t}=await import(`./BypassPermissionsModeDialog-BKj_3Idm.js`);await Z(e,e=>(0,Y.jsx)(t,{onAccept:e}))}return a}function fu(e){let t=0,n=Zc(e);n.stdin&&G(`tengu_stdin_interactive`,{});let r=new ou,i=Xc();x(i);let a=process.env.CLAUDE_CODE_FRAME_TIMING_LOG;return{getFpsMetrics:()=>r.getMetrics(),stats:i,renderOptions:{...n,onFrame:e=>{if(r.record(e.durationMs),i.observe(`frame_duration_ms`,e.durationMs),a&&e.phases){let t=JSON.stringify({total:e.durationMs,...e.phases,rss:process.memoryUsage.rss(),cpu:process.cpuUsage()})+`
|
|
20
|
+
`;fl(a,t)}if(!ue())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}}}}}Zr();async function pu(e,t){let{InvalidSettingsDialog:n}=await import(`./InvalidSettingsDialog-BKenH3bD.js`);return Z(e,e=>(0,Y.jsx)(n,{settingsErrors:t.settingsErrors,onContinue:e,onExit:t.onExit}))}async function mu(e,t){let{AssistantSessionChooser:n}=await import(`./AssistantSessionChooser-CcocKoTJ.js`);return Z(e,e=>(0,Y.jsx)(n,{sessions:t.sessions,onSelect:t=>e(t),onCancel:()=>e(null)}))}async function hu(e){let{NewInstallWizard:t,computeDefaultInstallDir:n}=await import(`./assistant-DJ9hd4uC.js`),r=await n(),i,a=new Promise((e,t)=>{i=t}),o=Z(e,e=>(0,Y.jsx)(t,{defaultDir:r,onInstalled:t=>e(t),onCancel:()=>e(null),onError:e=>i(Error(`Installation failed: ${e}`))}));return Promise.race([o,a])}async function gu(e){let{TeleportResumeWrapper:t}=await import(`./TeleportResumeWrapper-jaQzyTCh.js`);return Z(e,e=>(0,Y.jsx)(t,{onComplete:e,onCancel:()=>e(null),source:`cliArg`}))}async function _u(e,t){let{TeleportRepoMismatchDialog:n}=await import(`./TeleportRepoMismatchDialog-DY97YZMB.js`);return Z(e,e=>(0,Y.jsx)(n,{targetRepo:t.targetRepo,initialPaths:t.initialPaths,onSelectPath:e,onCancel:()=>e(null)}))}async function vu(e,t,n,r){let[i,{ResumeConversation:a},{App:o}]=await Promise.all([n,import(`./ResumeConversation-DzV2zmuX.js`),import(`./App-BP06lHmf.js`)]);await uu(e,(0,Y.jsx)(o,{getFpsMetrics:t.getFpsMetrics,stats:t.stats,initialState:t.initialState,children:(0,Y.jsx)(an,{children:(0,Y.jsx)(a,{...r,worktreePaths:i})})}))}Is(),Ls();var yu=5,bu=30,xu=`After you finish implementing the change:
|
|
21
21
|
1. **Simplify** — Invoke the \`${Bs}\` tool with \`skill: "simplify"\` to review and clean up your changes.
|
|
22
22
|
2. **Run unit tests** — Run the project's test suite (check for package.json scripts, Makefile targets, or common commands like \`npm test\`, \`bun test\`, \`pytest\`, \`go test\`). If tests fail, fix them.
|
|
23
23
|
3. **Test end-to-end** — Follow the e2e test recipe from the coordinator's prompt (below). If the recipe says to skip e2e for this unit, skip it.
|
|
@@ -658,7 +658,7 @@ You are performing a manual dream — a reflective pass over your memory files.
|
|
|
658
658
|
`)}function Ed(e){return`⚠ Heads-up:\n${e.map(e=>`- ${e}`).join(`
|
|
659
659
|
`)}`}async function Dd(){let e=await _o();if(!e)return null;let t=hc(e);return t?`https://${t.host}/${t.owner}/${t.name}`:null}function Od(e){let{userTimezone:t,connectorsInfo:n,gitRepoUrl:r,environmentsInfo:i,createdEnvironment:a,setupNotes:o,needsGitHubAccessReminder:s,userArgs:c}=e,l=c&&o.length>0?`\n## Setup Notes\n\n${Ed(o)}\n`:``,u=o.length>0?`${Ed(o)}\n\n${jd}`:jd;return`# Schedule Remote Agents
|
|
660
660
|
|
|
661
|
-
You are helping the user schedule, update, list, or run **remote** Work Mate agents. These are NOT local cron jobs — each trigger spawns a fully isolated remote session (CCR) in
|
|
661
|
+
You are helping the user schedule, update, list, or run **remote** Work Mate agents. These are NOT local cron jobs — each trigger spawns a fully isolated remote session (CCR) in cloud infrastructure on a cron schedule. The agent runs in a sandboxed environment with its own git checkout, tools, and optional MCP connections.
|
|
662
662
|
|
|
663
663
|
## First Step
|
|
664
664
|
|
|
@@ -800,7 +800,7 @@ Minimum interval is 1 hour. \`*/30 * * * *\` will be rejected.
|
|
|
800
800
|
|
|
801
801
|
## Important Notes
|
|
802
802
|
|
|
803
|
-
- These are REMOTE agents — they run in
|
|
803
|
+
- These are REMOTE agents — they run in the cloud, not on the user's machine. They cannot access local files, local services, or local environment variables.
|
|
804
804
|
- Always convert cron to human-readable when displaying
|
|
805
805
|
- Default to \`enabled: true\` unless user says otherwise
|
|
806
806
|
- Accept GitHub URLs in any format (https://github.com/org/repo, org/repo, etc.) and normalize to the full HTTPS URL (without .git suffix)
|
|
@@ -825,10 +825,10 @@ Examples:
|
|
|
825
825
|
Usage: claude mcp add <name> <command> [args...]`):q(`Error: Server name is required.
|
|
826
826
|
Usage: claude mcp add <name> <command> [args...]`);try{let t=Zn(r.scope),n=Pi(r.transport);r.xaa&&!vr()&&q(`Error: --xaa requires CLAUDE_CODE_ENABLE_XAA=1 in your environment`);let o=!!r.xaa;if(o){let e=[];r.clientId||e.push(`--client-id`),r.clientSecret||e.push(`--client-secret`),ei()||e.push(`'claude mcp xaa setup' (settings.xaaIdp not configured)`),e.length&&q(`Error: --xaa requires: ${e.join(`, `)}`)}let s=r.transport!==void 0,c=i.startsWith(`http://`)||i.startsWith(`https://`)||i.startsWith(`localhost`)||i.endsWith(`/sse`)||i.endsWith(`/mcp`);if(G(`tengu_mcp_add`,{type:n,scope:t,source:`command`,transport:n,transportExplicit:s,looksLikeUrl:c}),n===`sse`){i||q(`Error: URL is required for SSE transport.`);let n=r.header?at(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 wi():void 0,l={type:`sse`,url:i,headers:n,oauth:s};await Jr(e,l,t),c&&vi(e,l,c),process.stdout.write(`Added SSE MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${Ea(n,null,2)}\n`)}else if(n===`http`){i||q(`Error: URL is required for HTTP transport.`);let n=r.header?at(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 wi():void 0,l={type:`http`,url:i,headers:n,oauth:s};await Jr(e,l,t),c&&vi(e,l,c),process.stdout.write(`Added HTTP MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${Ea(n,null,2)}\n`)}else(r.clientId||r.clientSecret||r.callbackPort||r.xaa)&&process.stderr.write(`Warning: --client-id, --client-secret, --callback-port, and --xaa are only supported for HTTP/SSE transports and will be ignored for stdio.
|
|
827
827
|
`),!s&&c&&(process.stderr.write(`\nWarning: The command "${i}" looks like a URL, but is being interpreted as a stdio server as --transport was not specified.\n`),process.stderr.write(`If this is an HTTP server, use: claude mcp add --transport http ${e} ${i}\n`),process.stderr.write(`If this is an SSE server, use: claude mcp add --transport sse ${e} ${i}\n`)),await Jr(e,{type:`stdio`,command:i,args:a,env:u(r.env)},t),process.stdout.write(`Added stdio MCP server ${e} with command: ${i} ${a.join(` `)} to ${t} config\n`);Hc(`File modified: ${kr(t)}`)}catch(e){q(e.message)}})}Ai(),Da(),L();function Ld(e){let t=e.command(`xaa`).description(`Manage the XAA (SEP-990) IdP connection`);t.command(`setup`).description(`Configure the IdP connection (one-time setup for all XAA-enabled servers)`).requiredOption(`--issuer <url>`,`IdP issuer URL (OIDC discovery)`).requiredOption(`--client-id <id>`,`Work Mate's client_id at the IdP`).option(`--client-secret`,`Read IdP client secret from MCP_XAA_IDP_CLIENT_SECRET env var`).option(`--callback-port <port>`,`Fixed loopback callback port (only if IdP does not honor RFC 8252 port-any matching)`).action(e=>{let t;try{t=new URL(e.issuer)}catch{return q(`Error: --issuer must be a valid URL (got "${e.issuer}")`)}if(t.protocol!==`https:`&&!(t.protocol===`http:`&&(t.hostname===`localhost`||t.hostname===`127.0.0.1`||t.hostname===`[::1]`)))return q(`Error: --issuer must use https:// (got "${t.protocol}//${t.host}")`);let n=e.callbackPort?parseInt(e.callbackPort,10):void 0;if(n!==void 0&&(!Number.isInteger(n)||n<=0))return q(`Error: --callback-port must be a positive integer`);let r=e.clientSecret?process.env.MCP_XAA_IDP_CLIENT_SECRET:void 0;if(e.clientSecret&&!r)return q(`Error: --client-secret requires MCP_XAA_IDP_CLIENT_SECRET env var`);let i=ei(),a=i?.issuer,o=i?.clientId,{error:s}=R(`userSettings`,{xaaIdp:{issuer:e.issuer,clientId:e.clientId,callbackPort:n}});if(s)return q(`Error writing settings: ${s.message}`);if(a&&(Tr(a)===Tr(e.issuer)?o!==e.clientId&&(li(a),nr(a)):(li(a),nr(a))),r){let{success:t,warning:n}=fi(e.issuer,r);if(!t)return q(`Error: settings written but keychain save failed${n?` — ${n}`:``}. Re-run with --client-secret once keychain is available.`)}Hc(`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=ei();if(!t)return q(`Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.`);if(e.idToken){let n=ii(t.issuer,e.idToken);return Hc(`id_token cached for ${t.issuer} (expires ${new Date(n).toISOString()})`)}if(e.force&&li(t.issuer),Si(t.issuer)!==void 0)return Hc(`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 Vr({idpIssuer:t.issuer,idpClientId:t.clientId,idpClientSecret:dr(t.issuer),callbackPort:t.callbackPort,onAuthorizationUrl:e=>{process.stdout.write(`If the browser did not open, visit:\n ${e}\n`)}}),Hc(`Logged in. MCP servers with --xaa will now authenticate silently.`)}catch(e){q(`IdP login failed: ${F(e)}`)}}),t.command(`show`).description(`Show the current IdP connection config`).action(()=>{let e=ei();if(!e)return Hc(`No XAA IdP connection configured.`);let t=dr(e.issuer)!==void 0,n=Si(e.issuer)!==void 0;process.stdout.write(`Issuer: ${e.issuer}\n`),process.stdout.write(`Client ID: ${e.clientId}\n`),e.callbackPort!==void 0&&process.stdout.write(`Callback port: ${e.callbackPort}\n`),process.stdout.write(`Client secret: ${t?`(stored in keychain)`:`(not set — PKCE-only)`}\n`),process.stdout.write(`Logged in: ${n?`yes (id_token cached)`:`no — run 'claude mcp xaa login'`}\n`),Hc()}),t.command(`clear`).description(`Clear the IdP connection config and cached id_token`).action(()=>{let e=ei(),{error:t}=R(`userSettings`,{xaaIdp:void 0});if(t)return q(`Error writing settings: ${t.message}`);e&&(li(e.issuer),nr(e.issuer)),Hc(`XAA IdP connection cleared`)})}Vi();function Rd(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]}}xn(),Hn(),wt(),W(),V(),Co(),L();function zd(){if(B().bypassPermissionsModeAccepted)try{Va()||R(`userSettings`,{skipDangerousModePermissionPrompt:!0}),G(`tengu_migrate_bypass_permissions_accepted`,{}),z(e=>{if(!(`bypassPermissionsModeAccepted`in e))return e;let{bypassPermissionsModeAccepted:t,...n}=e;return n})}catch(e){U(Error(`Failed to migrate bypass permissions accepted: ${e}`))}}W(),V(),Co(),L();function Bd(){let e=ro(),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=La(`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`))&&so(e=>{let{enableAllProjectMcpServers:t,enabledMcpjsonServers:n,disabledMcpjsonServers:r,...i}=e;return i}),G(`tengu_migrate_mcp_approval_fields_success`,{migratedCount:o.length})}catch(e){U(e),G(`tengu_migrate_mcp_approval_fields_error`,{})}}L();function Vd(){if(process.env.USER_TYPE!==`ant`)return;let e=La(`userSettings`)?.model;typeof e==`string`&&(e.startsWith(`fennec-latest[1m]`)?R(`userSettings`,{model:`opus[1m]`}):e.startsWith(`fennec-latest`)?R(`userSettings`,{model:`opus`}):(e.startsWith(`fennec-fast-latest`)||e.startsWith(`opus-4-5-fast`))&&R(`userSettings`,{model:`opus[1m]`,fastMode:!0}))}W(),V(),As(),L();function Hd(){if(es()!==`firstParty`||!ks())return;let e=La(`userSettings`)?.model;e!==`claude-opus-4-20250514`&&e!==`claude-opus-4-1-20250805`&&e!==`claude-opus-4-0`&&e!==`claude-opus-4-1`||(R(`userSettings`,{model:`opus`}),z(e=>({...e,legacyOpusMigrationTimestamp:Date.now()})),G(`tengu_legacy_opus_migration`,{from_model:e}))}W(),ss();function Ud(){us()&&G(`tengu_opus_to_opus1m_migration`,{skipped:!0})}V();function Wd(){z(e=>{let t=e.replBridgeEnabled;if(t===void 0||e.remoteControlAtStartup!==void 0)return e;let n={...e,remoteControlAtStartup:!!t};return delete n.replBridgeEnabled,n})}S(),V(),L();function Gd(){B().sonnet1m45MigrationComplete||(La(`userSettings`)?.model===`sonnet[1m]`&&R(`userSettings`,{model:`sonnet-4-5-20250929[1m]`}),Fe()===`sonnet[1m]`&&Ne(`sonnet-4-5-20250929[1m]`),z(e=>({...e,sonnet1m45MigrationComplete:!0})))}W(),Go(),V(),As(),L();function Kd(){if(es()!==`firstParty`||!Wo()&&!is()&&!ps())return;let e=La(`userSettings`)?.model;if(e!==`claude-sonnet-4-5-20250929`&&e!==`claude-sonnet-4-5-20250929[1m]`&&e!==`sonnet-4-5-20250929`&&e!==`sonnet-4-5-20250929[1m]`)return;let t=e.endsWith(`[1m]`);R(`userSettings`,{model:t?`sonnet[1m]`:`sonnet`}),B().numStartups>1&&z(e=>({...e,sonnet45To46MigrationTimestamp:Date.now()})),G(`tengu_sonnet45_to_46_migration`,{from_model:e,has_1m:t})}W(),V(),Co(),L();function qd(){if(!B().hasResetAutoModeOptInForDefaultOffer&&Ni()===`enabled`)try{let e=La(`userSettings`);e?.skipAutoPermissionPrompt&&e?.permissions?.defaultMode!==`auto`&&(R(`userSettings`,{skipAutoPermissionPrompt:void 0}),G(`tengu_migrate_reset_auto_opt_in_for_default_offer`,{})),z(e=>e.hasResetAutoModeOptInForDefaultOffer?e:{...e,hasResetAutoModeOptInForDefaultOffer:!0})}catch(e){U(Error(`Failed to reset auto mode opt-in: ${e}`))}}W(),Go(),V(),As(),L();function Jd(){if(!B().opusProMigrationComplete){if(es()!==`firstParty`||!Wo()){z(e=>({...e,opusProMigrationComplete:!0})),G(`tengu_reset_pro_to_opus_default`,{skipped:!0});return}if(za()?.model===void 0){let e=Date.now();z(t=>({...t,opusProMigrationComplete:!0,opusProMigrationTimestamp:e})),G(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!1})}else z(e=>({...e,opusProMigrationComplete:!0})),G(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!0})}}b(),Ce();var Yd=Se(()=>ge({session_id:y(),ws_url:y(),work_dir:y().optional()}));Da(),pa();var Xd=class extends Error{constructor(e){super(e),this.name=`DirectConnectError`}};async function Zd({serverUrl:e,authToken:t,cwd:n,dangerouslySkipPermissions:r}){let i={"content-type":`application/json`};t&&(i.authorization=`Bearer ${t}`);let a;try{a=await fetch(`${e}/sessions`,{method:`POST`,headers:i,body:Ea({cwd:n,...r&&{dangerously_skip_permissions:!0}})})}catch(t){throw new Xd(`Failed to connect to server at ${e}: ${F(t)}`)}if(!a.ok)throw new Xd(`Failed to create session: ${a.status} ${a.statusText}`);let o=Yd().safeParse(await a.json());if(!o.success)throw new Xd(`Invalid session response: ${o.error.message}`);let s=o.data;return{config:{serverUrl:e,sessionId:s.session_id,wsUrl:s.ws_url,authToken:t},workDir:s.work_dir}}var Qd=i({isKairosEnabled:()=>$d});async function $d(){return!1}var ef=n((()=>{}));Fo(),Ro(),$t(),In(),Go(),V(),Xi(),aa(),Do(),pa(),W(),S(),mn(),de(),Wc(),f(),fo(),Co(),ss(),T(),Yr(),L(),A(),k(),Ai(),xa(),_a(),Da(),lr(),er(),go(),jc(),gt(),wc(),bt(),K(`main_tsx_entry`),ka(),Ms();var tf=(kc(),e(Ac)),nf=(ef(),e(Qd)),rf=(kt(),e(Vn));K(`main_tsx_imports_loaded`);function af(){try{let e=La(`policySettings`);if(e){let t=Ha(e);G(`tengu_managed_settings_loaded`,{keyCount:t.length,keys:t.join(`,`)})}}catch{}}function of(){let e=Ko(Ee()??xs());Fd(ca(),ns(e,Ye())),oi().then(({enabled:e,errors:t})=>{let n=Hi();tr(e,n,Ir()),Pr(t,n)}).catch(e=>U(e))}function sf(){let e={};return process.env.NODE_EXTRA_CA_CERTS&&(e.has_node_extra_ca_certs=!0),process.env.CLAUDE_CODE_CLIENT_CERT&&(e.has_client_cert=!0),c(`--use-system-ca`)&&(e.has_use_system_ca=!0),c(`--use-openssl-ca`)&&(e.has_use_openssl_ca=!0),e}async function cf(){if(Cc())return;let[e,t,n]=await Promise.all([po(),mo(),Pd()]);G(`tengu_startup_telemetry`,{is_git:e,worktree_count:t,gh_auth_status:n,sandbox_enabled:Ji.isSandboxingEnabled(),are_unsandboxed_commands_allowed:Ji.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:Ji.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:$a(),prefers_reduced_motion:Ua().prefersReducedMotion??!1,...sf()})}var lf=11;function uf(){B().migrationVersion!==lf&&(zd(),Bd(),Jd(),Gd(),Hd(),Kd(),Ud(),Wd(),qd(),process.env.USER_TYPE===`ant`&&Vd(),z(e=>e.migrationVersion===lf?e:{...e,migrationVersion:lf})),Mc().catch(()=>{})}function df(){if(tt()){H(`info`,`prefetch_system_context_non_interactive`),Kr();return}no()?(H(`info`,`prefetch_system_context_has_trust`),Kr()):H(`info`,`prefetch_system_context_skipped_no_trust`)}function ff(){d(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||p()||(Sc(),Jt(),df(),ol(),d(process.env.CLAUDE_CODE_USE_BEDROCK)&&!d(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&_s(),d(process.env.CLAUDE_CODE_USE_VERTEX)&&!d(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&cs(),nc(ca(),AbortSignal.timeout(3e3),[]),as(),pt.initialize(),p()||Yc.initialize(),process.env.USER_TYPE===`ant`&&import(`./eventLoopStallDetector-Cg_RXU1q.js`).then(e=>e.startEventLoopStallDetector()))}function pf(e){try{let t=e.trim(),n=t.startsWith(`{`)&&t.endsWith(`}`),r;if(n)jo(t)||(process.stderr.write(v.red(`Error: Invalid JSON provided to --settings
|
|
828
|
-
`)),process.exit(1)),r=Rt(`claude-settings`,`.json`,{contentHash:t}),ua(r,t,`utf8`);else{let{resolvedPath:t}=ga(va(),e);try{pl(t,`utf8`)}catch(e){throw ma(e)&&(process.stderr.write(v.red(`Error: Settings file not found: ${t}\n`)),process.exit(1)),e}r=t}Te(r),He()}catch(e){e instanceof Error&&U(e),process.stderr.write(v.red(`Error processing settings: ${F(e)}\n`)),process.exit(1)}}function mf(e){try{C(Ga(e)),He()}catch(e){e instanceof Error&&U(e),process.stderr.write(v.red(`Error processing --setting-sources: ${F(e)}\n`)),process.exit(1)}}function hf(){K(`eagerLoadSettings_start`);let e=Rd(`--settings`);e&&pf(e);let t=Rd(`--setting-sources`);t!==void 0&&mf(t),K(`eagerLoadSettings_end`)}function gf(e){if(process.env.CLAUDE_CODE_ENTRYPOINT)return;let t=process.argv.slice(2),n=t.indexOf(`mcp`);if(n!==-1&&t[n+1]===`serve`){process.env.CLAUDE_CODE_ENTRYPOINT=`mcp`;return}if(d(process.env.CLAUDE_CODE_ACTION)){process.env.CLAUDE_CODE_ENTRYPOINT=`claude-code-github-action`;return}process.env.CLAUDE_CODE_ENTRYPOINT=e?`sdk-cli`:`cli`}var Q={url:void 0,authToken:void 0,dangerouslySkipPermissions:!1},_f={sessionId:void 0,discover:!1},$={host:void 0,cwd:void 0,permissionMode:void 0,dangerouslySkipPermissions:!1,local:!1,extraCliArgs:[],remoteBin:void 0};async function vf(){K(`main_function_start`),process.env.NoDefaultCurrentDirectoryInExePath=`1`,$l(),process.on(`exit`,()=>{wf();try{let{peekWorkflowService:t}=(xr(),e(Ti));t()?.shutdown()}catch{}}),process.on(`SIGINT`,()=>{process.argv.includes(`-p`)||process.argv.includes(`--print`)||process.exit(0)}),K(`main_warning_handler_initialized`);{let e=process.argv.slice(2),t=e.findIndex(e=>e.startsWith(`cc://`)||e.startsWith(`cc+unix://`));if(t!==-1&&Q){let n=e[t],{parseConnectUrl:r}=await import(`./parseConnectUrl-BiyKR5-x.js`),i=r(n);if(Q.dangerouslySkipPermissions=e.includes(`--dangerously-skip-permissions`),e.includes(`-p`)||e.includes(`--print`)){let r=e.filter((e,n)=>n!==t),i=r.indexOf(`--dangerously-skip-permissions`);i!==-1&&r.splice(i,1),process.argv=[process.argv[0],process.argv[1],`open`,n,...r]}else{Q.url=i.serverUrl,Q.authToken=i.authToken;let n=e.filter((e,n)=>n!==t),r=n.indexOf(`--dangerously-skip-permissions`);r!==-1&&n.splice(r,1),process.argv=[process.argv[0],process.argv[1],...n]}}}{let e=process.argv.indexOf(`--handle-uri`);if(e!==-1&&process.argv[e+1]){let{enableConfigs:t}=await import(`./config-
|
|
828
|
+
`)),process.exit(1)),r=Rt(`claude-settings`,`.json`,{contentHash:t}),ua(r,t,`utf8`);else{let{resolvedPath:t}=ga(va(),e);try{pl(t,`utf8`)}catch(e){throw ma(e)&&(process.stderr.write(v.red(`Error: Settings file not found: ${t}\n`)),process.exit(1)),e}r=t}Te(r),He()}catch(e){e instanceof Error&&U(e),process.stderr.write(v.red(`Error processing settings: ${F(e)}\n`)),process.exit(1)}}function mf(e){try{C(Ga(e)),He()}catch(e){e instanceof Error&&U(e),process.stderr.write(v.red(`Error processing --setting-sources: ${F(e)}\n`)),process.exit(1)}}function hf(){K(`eagerLoadSettings_start`);let e=Rd(`--settings`);e&&pf(e);let t=Rd(`--setting-sources`);t!==void 0&&mf(t),K(`eagerLoadSettings_end`)}function gf(e){if(process.env.CLAUDE_CODE_ENTRYPOINT)return;let t=process.argv.slice(2),n=t.indexOf(`mcp`);if(n!==-1&&t[n+1]===`serve`){process.env.CLAUDE_CODE_ENTRYPOINT=`mcp`;return}if(d(process.env.CLAUDE_CODE_ACTION)){process.env.CLAUDE_CODE_ENTRYPOINT=`claude-code-github-action`;return}process.env.CLAUDE_CODE_ENTRYPOINT=e?`sdk-cli`:`cli`}var Q={url:void 0,authToken:void 0,dangerouslySkipPermissions:!1},_f={sessionId:void 0,discover:!1},$={host:void 0,cwd:void 0,permissionMode:void 0,dangerouslySkipPermissions:!1,local:!1,extraCliArgs:[],remoteBin:void 0};async function vf(){K(`main_function_start`),process.env.NoDefaultCurrentDirectoryInExePath=`1`,$l(),process.on(`exit`,()=>{wf();try{let{peekWorkflowService:t}=(xr(),e(Ti));t()?.shutdown()}catch{}}),process.on(`SIGINT`,()=>{process.argv.includes(`-p`)||process.argv.includes(`--print`)||process.exit(0)}),K(`main_warning_handler_initialized`);{let e=process.argv.slice(2),t=e.findIndex(e=>e.startsWith(`cc://`)||e.startsWith(`cc+unix://`));if(t!==-1&&Q){let n=e[t],{parseConnectUrl:r}=await import(`./parseConnectUrl-BiyKR5-x.js`),i=r(n);if(Q.dangerouslySkipPermissions=e.includes(`--dangerously-skip-permissions`),e.includes(`-p`)||e.includes(`--print`)){let r=e.filter((e,n)=>n!==t),i=r.indexOf(`--dangerously-skip-permissions`);i!==-1&&r.splice(i,1),process.argv=[process.argv[0],process.argv[1],`open`,n,...r]}else{Q.url=i.serverUrl,Q.authToken=i.authToken;let n=e.filter((e,n)=>n!==t),r=n.indexOf(`--dangerously-skip-permissions`);r!==-1&&n.splice(r,1),process.argv=[process.argv[0],process.argv[1],...n]}}}{let e=process.argv.indexOf(`--handle-uri`);if(e!==-1&&process.argv[e+1]){let{enableConfigs:t}=await import(`./config-DY5-_kk_.js`);t();let n=process.argv[e+1],{handleDeepLinkUri:r}=await import(`./protocolHandler-BHxBy84Z.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-DY5-_kk_.js`);e();let{handleUrlSchemeLaunch:t}=await import(`./protocolHandler-BHxBy84Z.js`),n=await t();process.exit(n??1)}}if(_f){let e=process.argv.slice(2);if(e[0]===`assistant`){let t=e[1];t&&!t.startsWith(`-`)?(_f.sessionId=t,e.splice(0,2),process.argv=[process.argv[0],process.argv[1],...e]):t||(_f.discover=!0,e.splice(0,1),process.argv=[process.argv[0],process.argv[1],...e])}}if($){let e=process.argv.slice(2);if(e[0]===`ssh`){let t=e.indexOf(`--local`);t!==-1&&($.local=!0,e.splice(t,1));let n=e.indexOf(`--dangerously-skip-permissions`);n!==-1&&($.dangerouslySkipPermissions=!0,e.splice(n,1));let r=e.indexOf(`--permission-mode`);r!==-1&&e[r+1]&&!e[r+1].startsWith(`-`)&&($.permissionMode=e[r+1],e.splice(r,2));let i=e.findIndex(e=>e.startsWith(`--permission-mode=`));i!==-1&&($.permissionMode=e[i].split(`=`)[1],e.splice(i,1));let a=(t,n={})=>{let r=e.indexOf(t);if(r!==-1){$.extraCliArgs.push(n.as??t);let i=e[r+1];n.hasValue&&i&&!i.startsWith(`-`)?($.extraCliArgs.push(i),e.splice(r,2)):e.splice(r,1)}let i=e.findIndex(e=>e.startsWith(`${t}=`));i!==-1&&($.extraCliArgs.push(n.as??t,e[i].slice(t.length+1)),e.splice(i,1))},o=e.indexOf(`--remote-bin`);o!==-1&&e[o+1]&&!e[o+1].startsWith(`-`)&&($.remoteBin=e[o+1],e.splice(o,2));let s=e.findIndex(e=>e.startsWith(`--remote-bin=`));s!==-1&&($.remoteBin=e[s].split(`=`).slice(1).join(`=`),e.splice(s,1)),a(`-c`,{as:`--continue`}),a(`--continue`),a(`--resume`,{hasValue:!0}),a(`--model`,{hasValue:!0})}if(e[0]===`ssh`&&e[1]&&!e[1].startsWith(`-`)){$.host=e[1];let t=2;e[2]&&!e[2].startsWith(`-`)&&($.cwd=e[2],t=3);let n=e.slice(t);if(n.includes(`-p`)||n.includes(`--print`)){process.stderr.write(`Error: headless (-p/--print) mode is not supported with claude ssh
|
|
829
829
|
`),xi(1);return}process.argv=[process.argv[0],process.argv[1],...n]}}let t=process.argv.slice(2),n=t.includes(`-p`)||t.includes(`--print`),r=t.includes(`--init-only`),i=t.some(e=>e.startsWith(`--sdk-url`)),a=d(process.env.CLAUDE_CODE_FORCE_INTERACTIVE),o=n||r||i||!a&&!process.stdout.isTTY;o&&tl(),Oe(!o),gf(o);let s=(()=>{if(d(process.env.GITHUB_ACTIONS))return`github-action`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`sdk-ts`)return`sdk-typescript`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`sdk-py`)return`sdk-python`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`sdk-cli`)return`sdk-cli`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`claude-vscode`)return`claude-vscode`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`)return`local-agent`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`claude-desktop`)return`claude-desktop`;let e=process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN||process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;return process.env.CLAUDE_CODE_ENTRYPOINT===`remote`||e?`remote`:`cli`})();et(s);let c=process.env.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT;c===`markdown`||c===`html`?w(c):!s.startsWith(`sdk-`)&&s!==`claude-desktop`&&s!==`local-agent`&&s!==`remote`&&w(`markdown`),process.env.CLAUDE_CODE_ENVIRONMENT_KIND===`bridge`&&Ue(`remote-control`),K(`main_client_type_determined`),hf(),K(`main_before_run`),await bf(),K(`main_after_run`)}async function yf(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 uo(process.stdin,3e3);return process.stdin.off(`data`,r),i&&process.stderr.write(`Warning: no stdin data received in 3s, proceeding without it. If piping from a slow command, redirect stdin explicitly: < /dev/null to skip, or wait longer.
|
|
830
830
|
`),[e,n].filter(Boolean).join(`
|
|
831
|
-
`)}return e}async function bf(){K(`run_function_start`);function t(){let e=e=>e.long?.replace(/^--/,``)??e.short?.replace(/^-/,``)??``;return Object.assign({sortSubcommands:!0,sortOptions:!0},{compareOptions:(t,n)=>e(t).localeCompare(e(n))})}let n=new jl().configureHelp(t()).enablePositionalOptions();K(`run_commander_initialized`),n.hook(`preAction`,async e=>{K(`preAction_start`),await Promise.all([Ia(),Ps()]),K(`preAction_after_mdm`),await Bl(),K(`preAction_after_init`),d(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)||(process.title=`claude`);let{initSinks:t}=await import(`./sinks-CXq8-7Qn.js`);t(),K(`preAction_after_sinks`);let n=e.getOptionValue(`pluginDir`);Array.isArray(n)&&n.length>0&&n.every(e=>typeof e==`string`)&&(Ve(n),mr(`preAction: --plugin-dir inline plugins`)),uf(),K(`preAction_after_migrations`),Ic(),Ot(),K(`preAction_after_remote_settings`),K(`preAction_after_settings_sync`)}),n.name(`claude`).description(`Work Mate - starts an interactive session by default, use -p/--print for non-interactive output`).argument(`[prompt]`,`Your prompt`,String).helpOption(`-h, --help`,`Display help for command`).option(`-d, --debug [filter]`,`Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")`,e=>!0).addOption(new J(`--debug-to-stderr`,`Enable debug mode (to stderr)`).argParser(Boolean).hideHelp()).option(`--debug-file <path>`,`Write debug logs to a specific file path (implicitly enables debug mode)`,()=>!0).option(`--verbose`,`Override verbose mode setting from config`,()=>!0).option(`-p, --print`,`Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when Claude is run with the -p mode. Only use this flag in directories you trust.`,()=>!0).option(`--bare`,`Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Anthropic auth is strictly ANTHROPIC_API_KEY or apiKeyHelper via --settings (OAuth and keychain are never read). 3P providers (Bedrock/Vertex/Foundry) use their own credentials. Skills still resolve via /skill-name. Explicitly provide context via: --system-prompt[-file], --append-system-prompt[-file], --add-dir (CLAUDE.md dirs), --mcp-config, --settings, --agents, --plugin-dir.`,()=>!0).addOption(new J(`--init`,`Run Setup hooks with init trigger, then continue`).hideHelp()).addOption(new J(`--init-only`,`Run Setup and SessionStart:startup hooks, then exit`).hideHelp()).addOption(new J(`--maintenance`,`Run Setup hooks with maintenance trigger, then continue`).hideHelp()).addOption(new J(`--output-format <format>`,`Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming)`).choices([`text`,`json`,`stream-json`])).addOption(new J(`--json-schema <schema>`,`JSON Schema for structured output validation. Example: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}`).argParser(String)).option(`--include-hook-events`,`Include all hook lifecycle events in the output stream (only works with --output-format=stream-json)`,()=>!0).option(`--include-partial-messages`,`Include partial message chunks as they arrive (only works with --print and --output-format=stream-json)`,()=>!0).addOption(new J(`--input-format <format>`,`Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input)`).choices([`text`,`stream-json`])).option(`--mcp-debug`,`[DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP server errors)`,()=>!0).option(`--dangerously-skip-permissions`,`Bypass all permission checks. Recommended only for sandboxes with no internet access.`,()=>!0).option(`--allow-dangerously-skip-permissions`,`Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.`,()=>!0).addOption(new J(`--thinking <mode>`,`Thinking mode: enabled (equivalent to adaptive), disabled`).choices([`enabled`,`adaptive`,`disabled`]).hideHelp()).addOption(new J(`--max-thinking-tokens <tokens>`,`[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)`).argParser(Number).hideHelp()).addOption(new J(`--max-turns <turns>`,`Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)`).argParser(Number).hideHelp()).addOption(new J(`--max-budget-usd <amount>`,`Maximum dollar amount to spend on API calls (only works with --print)`).argParser(e=>{let t=Number(e);if(isNaN(t)||t<=0)throw Error(`--max-budget-usd must be a positive number greater than 0`);return t})).addOption(new J(`--task-budget <tokens>`,`API-side task budget in tokens (output_config.task_budget)`).argParser(e=>{let t=Number(e);if(isNaN(t)||t<=0||!Number.isInteger(t))throw Error(`--task-budget must be a positive integer`);return t}).hideHelp()).option(`--replay-user-messages`,`Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)`,()=>!0).addOption(new J(`--enable-auth-status`,`Enable auth status messages in SDK mode`).default(!1).hideHelp()).option(`--allowedTools, --allowed-tools <tools...>`,`Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")`).option(`--tools <tools...>`,`Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").`).option(`--disallowedTools, --disallowed-tools <tools...>`,`Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")`).option(`--mcp-config <configs...>`,`Load MCP servers from JSON files or strings (space-separated)`).addOption(new J(`--permission-prompt-tool <tool>`,`MCP tool to use for permission prompts (only works with --print)`).argParser(String).hideHelp()).addOption(new J(`--system-prompt <prompt>`,`System prompt to use for the session`).argParser(String)).addOption(new J(`--system-prompt-file <file>`,`Read system prompt from a file`).argParser(String).hideHelp()).addOption(new J(`--append-system-prompt <prompt>`,`Append a system prompt to the default system prompt`).argParser(String)).addOption(new J(`--append-system-prompt-file <file>`,`Read system prompt from a file and append to the default system prompt`).argParser(String).hideHelp()).addOption(new J(`--permission-mode <mode>`,`Permission mode to use for the session`).argParser(String).choices(Uo)).option(`-c, --continue`,`Continue the most recent conversation in the current directory`,()=>!0).option(`-r, --resume [value]`,`Resume a conversation by session ID, or open interactive picker with optional search term`,e=>e||!0).option(`--fork-session`,`When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)`,()=>!0).addOption(new J(`--prefill <text>`,`Pre-fill the prompt input with text without submitting it`).hideHelp()).addOption(new J(`--deep-link-origin`,`Signal that this session was launched from a deep link`).hideHelp()).addOption(new J(`--deep-link-repo <slug>`,`Repo slug the deep link ?repo= parameter resolved to the current cwd`).hideHelp()).addOption(new J(`--deep-link-last-fetch <ms>`,`FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline`).argParser(e=>{let t=Number(e);return Number.isFinite(t)?t:void 0}).hideHelp()).option(`--from-pr [value]`,`Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term`,e=>e||!0).option(`--no-session-persistence`,`Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)`).addOption(new J(`--resume-session-at <message id>`,`When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)`).argParser(String).hideHelp()).addOption(new J(`--rewind-files <user-message-id>`,`Restore files to state at the specified user message and exit (requires --resume)`).hideHelp()).option(`--model <model>`,`Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-6').`).option(`--agent <agent>`,`Agent for the current session. Overrides the 'agent' setting.`).option(`--betas <betas...>`,`Beta headers to include in API requests (API key users only)`).option(`--fallback-model <model>`,`Enable automatic fallback to specified model when default model is overloaded (only works with --print)`).addOption(new J(`--workload <tag>`,`Workload tag for billing-header attribution (cc_workload). Process-scoped; set by SDK daemon callers that spawn subprocesses for cron work. (only works with --print)`).hideHelp()).option(`--settings <file-or-json>`,`Path to a settings JSON file or a JSON string to load additional settings from`).option(`--add-dir <directories...>`,`Additional directories to allow tool access to`).option(`--ide`,`Automatically connect to IDE on startup if exactly one valid IDE is available`,()=>!0).option(`--strict-mcp-config`,`Only use MCP servers from --mcp-config, ignoring all other MCP configurations`,()=>!0).option(`--session-id <uuid>`,`Use a specific session ID for the conversation (must be a valid UUID)`).option(`-n, --name <name>`,`Set a display name for this session (shown in /resume and terminal title)`).option(`--agents <json>`,`JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option(`--setting-sources <sources>`,`Comma-separated list of setting sources to load (user, project, local).`).option(`--plugin-dir <path>`,`Load plugins from a directory for this session only (repeatable: --plugin-dir A --plugin-dir B)`,(e,t)=>[...t,e],[]).option(`--disable-slash-commands`,`Disable all skills`,()=>!0).option(`--chrome`,`Enable Claude in Chrome integration`).option(`--no-chrome`,`Disable Claude in Chrome integration`).option(`--file <specs...>`,`File resources to download at startup. Format: file_id:relative_path (e.g., --file file_abc:doc.txt file_def:img.png)`).action(async(t,n)=>{K(`action_handler_start`),n.bare&&(process.env.CLAUDE_CODE_SIMPLE=`1`),t===`code`&&(G(`tengu_code_prompt_ignored`,{}),console.warn(v.yellow("Tip: You can launch Work Mate with just `claude`")),t=void 0),t&&typeof t==`string`&&!/\s/.test(t)&&t.length>0&&G(`tengu_single_word_prompt`,{length:t.length});let r=!1;if(n.assistant&&tf&&tf.markAssistantForced(),tf&&(tf.isAssistantForced()||n.assistant===!0)&&nf){if(!no())console.warn(v.yellow(`Assistant mode disabled: directory is not trusted. Accept the trust dialog and restart.`));else if(r=tf.isAssistantForced()||await nf.isKairosEnabled(),r){let e=n;e.brief=!0,je(!0)}}let{debug:i=!1,debugToStderr:a=!1,dangerouslySkipPermissions:o,allowDangerouslySkipPermissions:s=!1,tools:c=[],allowedTools:l=[],disallowedTools:u=[],mcpConfig:f=[],permissionMode:ee,addDir:te=[],fallbackModel:m,betas:h=[],ide:ne=!1,sessionId:re,includeHookEvents:ie,includePartialMessages:ae}=n;n.prefill&&nl(n.prefill);let oe,se=n.agents,ce=n.agent;ce&&(process.env.CLAUDE_CODE_AGENT=ce);let g=n.outputFormat,_=n.inputFormat,le=n.verbose??B().verbose,ue=n.print,de=n.init??!1,fe=n.initOnly??!1,pe=n.maintenance??!1,me=n.disableSlashCommands||!1,he=process.env.USER_TYPE===`ant`&&n.tasks,ge=he?typeof he==`string`?he:or:void 0;process.env.USER_TYPE===`ant`&&ge&&(process.env.CLAUDE_CODE_TASK_LIST_ID=ge);let y=Dc()?n.worktree:void 0,_e=typeof y==`string`?y:void 0,ve=y!==void 0,ye;if(_e){let e=st(_e);e!==null&&(ye=e,_e=void 0)}let be=Dc()&&n.tmux===!0;be&&(ve||(process.stderr.write(v.red(`Error: --tmux requires --worktree
|
|
831
|
+
`)}return e}async function bf(){K(`run_function_start`);function t(){let e=e=>e.long?.replace(/^--/,``)??e.short?.replace(/^-/,``)??``;return Object.assign({sortSubcommands:!0,sortOptions:!0},{compareOptions:(t,n)=>e(t).localeCompare(e(n))})}let n=new jl().configureHelp(t()).enablePositionalOptions();K(`run_commander_initialized`),n.hook(`preAction`,async e=>{K(`preAction_start`),await Promise.all([Ia(),Ps()]),K(`preAction_after_mdm`),await Bl(),K(`preAction_after_init`),d(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)||(process.title=`claude`);let{initSinks:t}=await import(`./sinks-BpcRrN_T.js`);t(),K(`preAction_after_sinks`);let n=e.getOptionValue(`pluginDir`);Array.isArray(n)&&n.length>0&&n.every(e=>typeof e==`string`)&&(Ve(n),mr(`preAction: --plugin-dir inline plugins`)),uf(),K(`preAction_after_migrations`),Ic(),Ot(),K(`preAction_after_remote_settings`),K(`preAction_after_settings_sync`)}),n.name(`claude`).description(`Work Mate - starts an interactive session by default, use -p/--print for non-interactive output`).argument(`[prompt]`,`Your prompt`,String).helpOption(`-h, --help`,`Display help for command`).option(`-d, --debug [filter]`,`Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")`,e=>!0).addOption(new J(`--debug-to-stderr`,`Enable debug mode (to stderr)`).argParser(Boolean).hideHelp()).option(`--debug-file <path>`,`Write debug logs to a specific file path (implicitly enables debug mode)`,()=>!0).option(`--verbose`,`Override verbose mode setting from config`,()=>!0).option(`-p, --print`,`Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when Claude is run with the -p mode. Only use this flag in directories you trust.`,()=>!0).option(`--bare`,`Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Anthropic auth is strictly ANTHROPIC_API_KEY or apiKeyHelper via --settings (OAuth and keychain are never read). 3P providers (Bedrock/Vertex/Foundry) use their own credentials. Skills still resolve via /skill-name. Explicitly provide context via: --system-prompt[-file], --append-system-prompt[-file], --add-dir (CLAUDE.md dirs), --mcp-config, --settings, --agents, --plugin-dir.`,()=>!0).addOption(new J(`--init`,`Run Setup hooks with init trigger, then continue`).hideHelp()).addOption(new J(`--init-only`,`Run Setup and SessionStart:startup hooks, then exit`).hideHelp()).addOption(new J(`--maintenance`,`Run Setup hooks with maintenance trigger, then continue`).hideHelp()).addOption(new J(`--output-format <format>`,`Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming)`).choices([`text`,`json`,`stream-json`])).addOption(new J(`--json-schema <schema>`,`JSON Schema for structured output validation. Example: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}`).argParser(String)).option(`--include-hook-events`,`Include all hook lifecycle events in the output stream (only works with --output-format=stream-json)`,()=>!0).option(`--include-partial-messages`,`Include partial message chunks as they arrive (only works with --print and --output-format=stream-json)`,()=>!0).addOption(new J(`--input-format <format>`,`Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input)`).choices([`text`,`stream-json`])).option(`--mcp-debug`,`[DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP server errors)`,()=>!0).option(`--dangerously-skip-permissions`,`Bypass all permission checks. Recommended only for sandboxes with no internet access.`,()=>!0).option(`--allow-dangerously-skip-permissions`,`Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.`,()=>!0).addOption(new J(`--thinking <mode>`,`Thinking mode: enabled (equivalent to adaptive), disabled`).choices([`enabled`,`adaptive`,`disabled`]).hideHelp()).addOption(new J(`--max-thinking-tokens <tokens>`,`[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)`).argParser(Number).hideHelp()).addOption(new J(`--max-turns <turns>`,`Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)`).argParser(Number).hideHelp()).addOption(new J(`--max-budget-usd <amount>`,`Maximum dollar amount to spend on API calls (only works with --print)`).argParser(e=>{let t=Number(e);if(isNaN(t)||t<=0)throw Error(`--max-budget-usd must be a positive number greater than 0`);return t})).addOption(new J(`--task-budget <tokens>`,`API-side task budget in tokens (output_config.task_budget)`).argParser(e=>{let t=Number(e);if(isNaN(t)||t<=0||!Number.isInteger(t))throw Error(`--task-budget must be a positive integer`);return t}).hideHelp()).option(`--replay-user-messages`,`Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)`,()=>!0).addOption(new J(`--enable-auth-status`,`Enable auth status messages in SDK mode`).default(!1).hideHelp()).option(`--allowedTools, --allowed-tools <tools...>`,`Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")`).option(`--tools <tools...>`,`Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").`).option(`--disallowedTools, --disallowed-tools <tools...>`,`Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")`).option(`--mcp-config <configs...>`,`Load MCP servers from JSON files or strings (space-separated)`).addOption(new J(`--permission-prompt-tool <tool>`,`MCP tool to use for permission prompts (only works with --print)`).argParser(String).hideHelp()).addOption(new J(`--system-prompt <prompt>`,`System prompt to use for the session`).argParser(String)).addOption(new J(`--system-prompt-file <file>`,`Read system prompt from a file`).argParser(String).hideHelp()).addOption(new J(`--append-system-prompt <prompt>`,`Append a system prompt to the default system prompt`).argParser(String)).addOption(new J(`--append-system-prompt-file <file>`,`Read system prompt from a file and append to the default system prompt`).argParser(String).hideHelp()).addOption(new J(`--permission-mode <mode>`,`Permission mode to use for the session`).argParser(String).choices(Uo)).option(`-c, --continue`,`Continue the most recent conversation in the current directory`,()=>!0).option(`-r, --resume [value]`,`Resume a conversation by session ID, or open interactive picker with optional search term`,e=>e||!0).option(`--fork-session`,`When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)`,()=>!0).addOption(new J(`--prefill <text>`,`Pre-fill the prompt input with text without submitting it`).hideHelp()).addOption(new J(`--deep-link-origin`,`Signal that this session was launched from a deep link`).hideHelp()).addOption(new J(`--deep-link-repo <slug>`,`Repo slug the deep link ?repo= parameter resolved to the current cwd`).hideHelp()).addOption(new J(`--deep-link-last-fetch <ms>`,`FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline`).argParser(e=>{let t=Number(e);return Number.isFinite(t)?t:void 0}).hideHelp()).option(`--from-pr [value]`,`Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term`,e=>e||!0).option(`--no-session-persistence`,`Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)`).addOption(new J(`--resume-session-at <message id>`,`When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)`).argParser(String).hideHelp()).addOption(new J(`--rewind-files <user-message-id>`,`Restore files to state at the specified user message and exit (requires --resume)`).hideHelp()).option(`--model <model>`,`Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-6').`).option(`--agent <agent>`,`Agent for the current session. Overrides the 'agent' setting.`).option(`--betas <betas...>`,`Beta headers to include in API requests (API key users only)`).option(`--fallback-model <model>`,`Enable automatic fallback to specified model when default model is overloaded (only works with --print)`).addOption(new J(`--workload <tag>`,`Workload tag for billing-header attribution (cc_workload). Process-scoped; set by SDK daemon callers that spawn subprocesses for cron work. (only works with --print)`).hideHelp()).option(`--settings <file-or-json>`,`Path to a settings JSON file or a JSON string to load additional settings from`).option(`--add-dir <directories...>`,`Additional directories to allow tool access to`).option(`--ide`,`Automatically connect to IDE on startup if exactly one valid IDE is available`,()=>!0).option(`--strict-mcp-config`,`Only use MCP servers from --mcp-config, ignoring all other MCP configurations`,()=>!0).option(`--session-id <uuid>`,`Use a specific session ID for the conversation (must be a valid UUID)`).option(`-n, --name <name>`,`Set a display name for this session (shown in /resume and terminal title)`).option(`--agents <json>`,`JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option(`--setting-sources <sources>`,`Comma-separated list of setting sources to load (user, project, local).`).option(`--plugin-dir <path>`,`Load plugins from a directory for this session only (repeatable: --plugin-dir A --plugin-dir B)`,(e,t)=>[...t,e],[]).option(`--disable-slash-commands`,`Disable all skills`,()=>!0).option(`--chrome`,`Enable Claude in Chrome integration`).option(`--no-chrome`,`Disable Claude in Chrome integration`).option(`--file <specs...>`,`File resources to download at startup. Format: file_id:relative_path (e.g., --file file_abc:doc.txt file_def:img.png)`).action(async(t,n)=>{K(`action_handler_start`),n.bare&&(process.env.CLAUDE_CODE_SIMPLE=`1`),t===`code`&&(G(`tengu_code_prompt_ignored`,{}),console.warn(v.yellow("Tip: You can launch Work Mate with just `claude`")),t=void 0),t&&typeof t==`string`&&!/\s/.test(t)&&t.length>0&&G(`tengu_single_word_prompt`,{length:t.length});let r=!1;if(n.assistant&&tf&&tf.markAssistantForced(),tf&&(tf.isAssistantForced()||n.assistant===!0)&&nf){if(!no())console.warn(v.yellow(`Assistant mode disabled: directory is not trusted. Accept the trust dialog and restart.`));else if(r=tf.isAssistantForced()||await nf.isKairosEnabled(),r){let e=n;e.brief=!0,je(!0)}}let{debug:i=!1,debugToStderr:a=!1,dangerouslySkipPermissions:o,allowDangerouslySkipPermissions:s=!1,tools:c=[],allowedTools:l=[],disallowedTools:u=[],mcpConfig:f=[],permissionMode:ee,addDir:te=[],fallbackModel:m,betas:h=[],ide:ne=!1,sessionId:re,includeHookEvents:ie,includePartialMessages:ae}=n;n.prefill&&nl(n.prefill);let oe,se=n.agents,ce=n.agent;ce&&(process.env.CLAUDE_CODE_AGENT=ce);let g=n.outputFormat,_=n.inputFormat,le=n.verbose??B().verbose,ue=n.print,de=n.init??!1,fe=n.initOnly??!1,pe=n.maintenance??!1,me=n.disableSlashCommands||!1,he=process.env.USER_TYPE===`ant`&&n.tasks,ge=he?typeof he==`string`?he:or:void 0;process.env.USER_TYPE===`ant`&&ge&&(process.env.CLAUDE_CODE_TASK_LIST_ID=ge);let y=Dc()?n.worktree:void 0,_e=typeof y==`string`?y:void 0,ve=y!==void 0,ye;if(_e){let e=st(_e);e!==null&&(ye=e,_e=void 0)}let be=Dc()&&n.tmux===!0;be&&(ve||(process.stderr.write(v.red(`Error: --tmux requires --worktree
|
|
832
832
|
`)),process.exit(1)),Eo()===`windows`&&(process.stderr.write(v.red(`Error: --tmux is not supported on Windows
|
|
833
833
|
`)),process.exit(1)),await ht()||(process.stderr.write(v.red(`Error: tmux is not installed.\n${Ui()}\n`)),process.exit(1)));let xe=n.sdkUrl??void 0,Se=ae||d(process.env.CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES);(ie||d(process.env.CLAUDE_CODE_REMOTE))&&Kt(!0),xe&&(_||(_=`stream-json`),g||(g=`stream-json`),n.verbose===void 0&&(le=!0),n.print||(ue=!0));let b=n.teleport??null,Ce=n.remote,Te=Ce===!0?``:Ce??null,De=n.remoteControl??n.rc,Oe=!1,Ae=typeof De==`string`&&De.length>0?De:void 0;if(re&&((n.continue||n.resume)&&!n.forkSession&&(process.stderr.write(v.red(`Error: --session-id can only be used with --continue or --resume if --fork-session is also specified.
|
|
834
834
|
`)),process.exit(1)),!xe)){let e=gr(re);e||(process.stderr.write(v.red(`Error: Invalid session ID. Must be a valid UUID.
|
|
@@ -837,23 +837,23 @@ Usage: claude mcp add <name> <command> [args...]`);try{let t=Zn(r.scope),n=Pi(r.
|
|
|
837
837
|
`)),process.exit(1));let S=n.systemPrompt;if(n.systemPromptFile){n.systemPrompt&&(process.stderr.write(v.red(`Error: Cannot use both --system-prompt and --system-prompt-file. Please use only one.
|
|
838
838
|
`)),process.exit(1));try{S=pl(ul(n.systemPromptFile),`utf8`)}catch(e){da(e)===`ENOENT`&&(process.stderr.write(v.red(`Error: System prompt file not found: ${ul(n.systemPromptFile)}\n`)),process.exit(1)),process.stderr.write(v.red(`Error reading system prompt file: ${F(e)}\n`)),process.exit(1)}}let C=n.appendSystemPrompt;if(n.appendSystemPromptFile){n.appendSystemPrompt&&(process.stderr.write(v.red(`Error: Cannot use both --append-system-prompt and --append-system-prompt-file. Please use only one.
|
|
839
839
|
`)),process.exit(1));try{C=pl(ul(n.appendSystemPromptFile),`utf8`)}catch(e){da(e)===`ENOENT`&&(process.stderr.write(v.red(`Error: Append system prompt file not found: ${ul(n.appendSystemPromptFile)}\n`)),process.exit(1)),process.stderr.write(v.red(`Error reading append system prompt file: ${F(e)}\n`)),process.exit(1)}}let{mode:Ve,notification:He}=Ri({permissionModeCli:ee,dangerouslySkipPermissions:o});qe(Ve===`bypassPermissions`),(n.enableAutoMode||ee===`auto`||Ve===`auto`||!ee&&rn())&&rf?.setAutoModeFlagCli(!0);let Ue={};if(f&&f.length>0){let e=f.map(e=>e.trim()).filter(e=>e.length>0),t={},n=[];for(let r of e){let e=null,i=[],a=jo(r);if(a){let t=Mn({configObject:a,filePath:`command line`,expandVars:!0,scope:`dynamic`});t.config?e=t.config.mcpServers:i=t.errors}else{let t=zn({filePath:ul(r),expandVars:!0,scope:`dynamic`});t.config?e=t.config.mcpServers:i=t.errors}i.length>0?n.push(...i):e&&(t={...t,...e})}if(n.length>0){let e=n.map(e=>`${e.path?e.path+`: `:``}${e.message}`).join(`
|
|
840
|
-
`);I(`--mcp-config validation failed (${n.length} errors): ${e}`,{level:`error`}),process.stderr.write(`Error: Invalid MCP configuration:\n${e}\n`),process.exit(1)}if(Object.keys(t).length>0){let{allowed:e,blocked:n}=Ct(ct(t,e=>({...e,scope:`dynamic`})));n.length>0&&process.stderr.write(`Warning: MCP ${Vo(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),Ue={...Ue,...e}}}let Ge=n.strictMcpConfig||!1;if(un()&&(Ge&&(process.stderr.write(v.red(`You cannot use --strict-mcp-config when an enterprise MCP config is present`)),process.exit(1)),Ue&&!Yt(Ue)&&(process.stderr.write(v.red(`You cannot dynamically configure MCP servers when an enterprise MCP config is present`)),process.exit(1))),We(te),c.length>0){let{BRIEF_TOOL_NAME:t,LEGACY_BRIEF_TOOL_NAME:n}=(Ma(),e(Na)),{isBriefEntitled:r}=(rr(),e(Hr)),i=Xr(c);(i.includes(t)||i.includes(n))&&r()&&ze(!0)}let Ye=await Tn({allowedToolsCli:l,disallowedToolsCli:u,baseToolsCli:c,permissionMode:Ve,allowDangerouslySkipPermissions:s,addDirs:te}),w=Ye.toolPermissionContext,{warnings:Ze,dangerousPermissions:et,overlyBroadBashPermissions:nt}=Ye;if(process.env.USER_TYPE===`ant`&&nt.length>0){for(let e of nt)I(`Ignoring overly broad shell permission ${e.ruleDisplay} from ${e.sourceDisplay}`);w=Gr(w,nt)}et.length>0&&(w=Xt(w)),Ze.forEach(e=>{console.error(e)});let rt=x&&!Ge&&!un()&&!p()?zt().then(e=>{let{allowed:t,blocked:n}=Ct(e);return n.length>0&&process.stderr.write(`Warning: claude.ai MCP ${Vo(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),t}):Promise.resolve({});I(`[STARTUP] Loading MCP configs...`);let it=Date.now(),at,ot=(Ge||p()?Promise.resolve({servers:{}}):Gt(Ue)).then(e=>(at=Date.now()-it,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)),xe&&(_!==`stream-json`||g!==`stream-json`)&&(console.error(`Error: --sdk-url requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),n.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)),Se&&(!x||g!==`stream-json`)&&(co(`Error: --include-partial-messages requires --print and --output-format=stream-json.`),process.exit(1)),n.sessionPersistence===!1&&!x&&(co(`Error: --no-session-persistence can only be used with --print mode.`),process.exit(1));let T=await yf(t||``,_??`text`);K(`action_after_input_prompt`),Sf(n);let pt=Jn(w);K(`action_tools_loaded`);let gt;if(Ws({isNonInteractiveSession:x})&&n.jsonSchema&&(gt=la(n.jsonSchema)),gt){let e=Gs(gt);`tool`in e?(pt=[...pt,e.tool],G(`tengu_structured_output_enabled`,{schema_property_count:Object.keys(gt.properties||{}).length,has_required_fields:!!gt.required})):G(`tengu_structured_output_failure`,{error:`Invalid JSON schema`})}K(`action_before_setup`),I(`[STARTUP] Running setup()...`);let _t=Date.now(),{setup:vt}=await import(`./setup-
|
|
841
|
-
`),process.exit(1));let i=me?[]:It.filter(e=>e.type===`prompt`&&!e.disableNonInteractive||e.type===`local`&&e.supportsNonInteractive),a=Wr(),o=pn({...a,mcp:{...a.mcp,clients:kn,commands:jn,tools:An},toolPermissionContext:w,...Es()&&{fastMode:os(qt??null)},...Gi()&&en&&{advisorModel:en},kairosEnabled:r},Kc);Ft(w,o.getState().fastMode).then(({updateContext:e})=>{o.setState(t=>{let n=e(t.toolPermissionContext);return n===t.toolPermissionContext?t:{...t,toolPermissionContext:n}})}),n.sessionPersistence===!1&&Re(!0),Le(qo(h));let s=(e,t)=>Object.keys(e).length===0?Promise.resolve():(o.setState(t=>({...t,mcp:{...t.mcp,clients:[...t.mcp.clients,...Object.entries(e).map(([e,t])=>({name:e,type:`pending`,config:t}))]}})),Mi(({client:e,tools:t,commands:n})=>{o.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:cn([...r.mcp.tools,...t],`name`),commands:cn([...r.mcp.commands,...n],`name`)}}))},e).catch(e=>I(`[MCP] ${t} connect error: ${e}`)));K(`before_connectMcp`),await s(hn,`regular`),K(`after_connectMcp`);let c=5e3,u=rt.then(e=>{if(Object.keys(e).length>0){let t=new Set;for(let n of Object.values(e)){let e=lt(n);e&&t.add(e)}let n=new Set;for(let[e,r]of Object.entries(hn)){if(!e.startsWith(`plugin:`))continue;let i=lt(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 o.getState().mcp.clients)!n.has(e.name)||e.type!==`connected`||(e.client.onclose=void 0,Ur(e.name,e.config).catch(()=>{}));o.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=Yi(i,e),a=sr(a,e);return{...e,mcp:{...e.mcp,clients:t,tools:r,commands:i,resources:a}}})}}let{servers:t}=tn(e,Ya(hn,(e,t)=>!t.startsWith(`plugin:`)));return s(t,`claudeai`)}),d,f=await Promise.race([u.then(()=>!1),new Promise(e=>{d=setTimeout(e=>e(!0),c,e)})]);d&&clearTimeout(d),f&&I(`[MCP] claude.ai connectors not ready after ${c}ms — proceeding; background connection continues`),K(`after_connectMcp_claudeai`),p()||(ff(),import(`./backgroundHousekeeping-
|
|
842
|
-
`),r=await t({cwd:$.cwd,permissionMode:$.permissionMode,dangerouslySkipPermissions:$.dangerouslySkipPermissions});else{process.stderr.write(`Connecting to ${$.host}…\n`);let t=process.stderr.isTTY,n=!1;r=await e({host:$.host,cwd:$.cwd,localVersion:`0.0.
|
|
843
|
-
`)}Ie(r.remoteCwd),$e(r.remoteCwd),Me($.local?`local`:$.host)}catch(e){return await X(D,e instanceof n?e.message:String(e),()=>P(1))}let o=Qi($.local?`Local ssh-proxy test session\ncwd: ${r.remoteCwd}\nAuth: unix socket → local proxy`:`SSH session to ${$.host}\nRemote cwd: ${r.remoteCwd}\nAuth: unix socket -R → local proxy`,`info`);await Wl(D,{getFpsMetrics:O,stats:k,initialState:j},{debug:i||a,commands:It,initialTools:[],initialMessages:[o],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:E,disableSlashCommands:me,sshSession:r,thinkingConfig:A},uu);return}else if(_f&&(_f.sessionId||_f.discover)){let{discoverAssistantSessions:e}=await import(`./sessionDiscovery-
|
|
844
|
-
Usage: claude --remote "your task description"`,()=>P(1));G(`tengu_remote_create_session`,{has_initial_prompt:String(e)});let t=await ho(),n=await nn(D,e?Te:null,new AbortController().signal,t||void 0);if(!n)return G(`tengu_remote_create_session_error`,{error:`unable_to_create_session`}),await X(D,`Error: Unable to create remote session`,()=>P(1));G(`tengu_remote_create_session_success`,{session_id:n.id}),process.stdout.write(`Created remote session: ${n.title}\n`),process.stdout.write(`View: ${Zt(n.id)}?m=0\n`),process.stdout.write(`Resume with: claude --teleport ${n.id}\n`),await P(0),process.exit(0),ke(!0),Qe(gn(n.id));let r;try{r=await _c()}catch(e){return U(ha(e)),await X(D,`Error: ${F(e)||`Failed to authenticate`}`,()=>P(1))}let{getClaudeAIOAuthTokens:o}=await import(`./auth-
|
|
845
|
-
`):(U(e),process.stderr.write(v.red(`Error: ${F(e)}\n`))),await P(1)}}}if(process.env.USER_TYPE===`ant`&&n.resume&&typeof n.resume==`string`&&!o){let e=ul(n.resume);try{let t=performance.now(),i;try{i=await Gn(e)}catch(e){if(!ma(e))throw e}if(i){let e=await Pn(i,void 0);e?(r=await Jc(e,{forkSession:!!n.forkSession,transcriptPath:e.fullPath},tr),r.restoredAgentDef&&(E=r.restoredAgentDef),G(`tengu_session_resumed`,{entrypoint:`file`,success:!0,resume_duration_ms:Math.round(performance.now()-t)})):G(`tengu_session_resumed`,{entrypoint:`file`,success:!1})}}catch(e){G(`tengu_session_resumed`,{entrypoint:`file`,success:!1}),U(e),await X(D,`Unable to load transcript from file: ${n.resume}`,()=>P(1))}}if(o){let e=o;try{let t=performance.now(),i=await Pn(c??e,void 0);if(!i)return G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),await X(D,`No conversation found with session ID: ${e}`);let a=c?.fullPath??i.fullPath;r=await Jc(i,{forkSession:!!n.forkSession,sessionIdOverride:e,transcriptPath:a},tr),r.restoredAgentDef&&(E=r.restoredAgentDef),G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!0,resume_duration_ms:Math.round(performance.now()-t)})}catch(t){G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),U(t),await X(D,`Failed to resume session ${e}`)}}if(oe)try{let e=await oe,t=Ba(e,e=>!e.success);t>0&&process.stderr.write(v.yellow(`Warning: ${t}/${e.length} file(s) failed to download.\n`))}catch(e){return await X(D,`Error downloading files: ${F(e)}`)}let u=r??(Array.isArray(t)?{messages:t,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:E,initialState:j,contentReplacements:void 0}:void 0);u?(Sf(n),Cf(n),await Wl(D,{getFpsMetrics:O,stats:k,initialState:u.initialState},{...er,mainThreadAgentDefinition:u.restoredAgentDef??E,initialMessages:u.messages,initialFileHistorySnapshots:u.fileHistorySnapshots,initialContentReplacements:u.contentReplacements,initialAgentName:u.agentName,initialAgentColor:u.agentColor},uu)):await vu(D,{getFpsMetrics:O,stats:k,initialState:j},dn(Ke()),{...er,initialSearchQuery:s,forkSession:n.forkSession,filterByPr:l})}else{let e=wn&&En.length===0?wn:void 0;K(`action_after_hooks`),Sf(n),Cf(n);let t=null;n.deepLinkOrigin?(G(`tengu_deep_link_opened`,{has_prefill:!!n.prefill,has_repo:!!n.deepLinkRepo}),t=Qi(rl({cwd:ca(),prefillLength:n.prefill?.length,repo:n.deepLinkRepo,lastFetch:n.deepLinkLastFetch===void 0?void 0:new Date(n.deepLinkLastFetch)}),`warning`)):n.prefill&&(t=Qi(`Launched with a pre-filled prompt — review it before pressing Enter.`,`warning`));let r=t?[t,...En]:En.length>0?En:void 0;await Wl(D,{getFpsMetrics:O,stats:k,initialState:j},{...er,initialMessages:r,pendingHookMessages:e},uu)}}).version(`0.0.
|
|
840
|
+
`);I(`--mcp-config validation failed (${n.length} errors): ${e}`,{level:`error`}),process.stderr.write(`Error: Invalid MCP configuration:\n${e}\n`),process.exit(1)}if(Object.keys(t).length>0){let{allowed:e,blocked:n}=Ct(ct(t,e=>({...e,scope:`dynamic`})));n.length>0&&process.stderr.write(`Warning: MCP ${Vo(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),Ue={...Ue,...e}}}let Ge=n.strictMcpConfig||!1;if(un()&&(Ge&&(process.stderr.write(v.red(`You cannot use --strict-mcp-config when an enterprise MCP config is present`)),process.exit(1)),Ue&&!Yt(Ue)&&(process.stderr.write(v.red(`You cannot dynamically configure MCP servers when an enterprise MCP config is present`)),process.exit(1))),We(te),c.length>0){let{BRIEF_TOOL_NAME:t,LEGACY_BRIEF_TOOL_NAME:n}=(Ma(),e(Na)),{isBriefEntitled:r}=(rr(),e(Hr)),i=Xr(c);(i.includes(t)||i.includes(n))&&r()&&ze(!0)}let Ye=await Tn({allowedToolsCli:l,disallowedToolsCli:u,baseToolsCli:c,permissionMode:Ve,allowDangerouslySkipPermissions:s,addDirs:te}),w=Ye.toolPermissionContext,{warnings:Ze,dangerousPermissions:et,overlyBroadBashPermissions:nt}=Ye;if(process.env.USER_TYPE===`ant`&&nt.length>0){for(let e of nt)I(`Ignoring overly broad shell permission ${e.ruleDisplay} from ${e.sourceDisplay}`);w=Gr(w,nt)}et.length>0&&(w=Xt(w)),Ze.forEach(e=>{console.error(e)});let rt=x&&!Ge&&!un()&&!p()?zt().then(e=>{let{allowed:t,blocked:n}=Ct(e);return n.length>0&&process.stderr.write(`Warning: claude.ai MCP ${Vo(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),t}):Promise.resolve({});I(`[STARTUP] Loading MCP configs...`);let it=Date.now(),at,ot=(Ge||p()?Promise.resolve({servers:{}}):Gt(Ue)).then(e=>(at=Date.now()-it,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)),xe&&(_!==`stream-json`||g!==`stream-json`)&&(console.error(`Error: --sdk-url requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),n.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)),Se&&(!x||g!==`stream-json`)&&(co(`Error: --include-partial-messages requires --print and --output-format=stream-json.`),process.exit(1)),n.sessionPersistence===!1&&!x&&(co(`Error: --no-session-persistence can only be used with --print mode.`),process.exit(1));let T=await yf(t||``,_??`text`);K(`action_after_input_prompt`),Sf(n);let pt=Jn(w);K(`action_tools_loaded`);let gt;if(Ws({isNonInteractiveSession:x})&&n.jsonSchema&&(gt=la(n.jsonSchema)),gt){let e=Gs(gt);`tool`in e?(pt=[...pt,e.tool],G(`tengu_structured_output_enabled`,{schema_property_count:Object.keys(gt.properties||{}).length,has_required_fields:!!gt.required})):G(`tengu_structured_output_failure`,{error:`Invalid JSON schema`})}K(`action_before_setup`),I(`[STARTUP] Running setup()...`);let _t=Date.now(),{setup:vt}=await import(`./setup-B_FOvNpp.js`),yt=ca();process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&Nd();let bt=vt(yt,Ve,s,ve,_e,be,re?gr(re):void 0,ye,void 0),St=ve?null:hi(yt),wt=ve?null:zr(yt);St?.catch(()=>{}),wt?.catch(()=>{}),await bt,I(`[STARTUP] setup() completed in ${Date.now()-_t}ms`),K(`action_after_setup`);let Tt=!!n.replayUserMessages;tt()&&(Qn(),Kr(),Jt(),gs());let Ot=n.name?.trim();Ot&&Wn(Ot);let kt=n.model==="default"?xs():n.model,jt=m==="default"?xs():m,Mt=ve?ca():yt;I(`[STARTUP] Loading commands and agents...`);let Pt=Date.now(),[It,Lt]=await Promise.all([St??hi(Mt),wt??zr(Mt)]);I(`[STARTUP] Commands and agents loaded in ${Date.now()-Pt}ms`),K(`action_commands_loaded`);let Rt=[];if(se)try{let e=jo(se);e&&(Rt=Sr(e,`flagSettings`))}catch(e){U(e)}let Vt=[...Lt.allAgents,...Rt],Ut={...Lt,allAgents:Vt,activeAgents:_i(Vt)},Wt=ce??Ua().agent,E;if(Wt&&(E=Ut.activeAgents.find(e=>e.agentType===Wt),E||I(`Warning: agent "${Wt}" not found. Available agents: ${Ut.activeAgents.map(e=>e.agentType).join(`, `)}. Using default behavior.`)),Pe(E?.agentType),E&&G(`tengu_agent_flag`,{agentType:bi(E)?E.agentType:`custom`,...ce&&{source:`cli`}}),E?.agentType&&jr(E.agentType),x&&E&&!S&&!bi(E)){let e=E.getSystemPrompt();e&&(S=e)}E?.initialPrompt&&(typeof T==`string`?T=T?`${E.initialPrompt}\n\n${T}`:E.initialPrompt:T||(T=E.initialPrompt));let qt=kt;!qt&&E?.model&&E.model!==`inherit`&&(qt=Ko(E.model)),Ne(qt),we(hs()||null);let Qt=Ee(),$t=Ko(Qt??xs()),en;if(Gi()){let e=$n()?n.advisor:void 0;e&&(I(`[AdvisorTool] --advisor ${e}`),dt($t)||(process.stderr.write(v.red(`Error: The model "${$t}" does not support the advisor tool.\n`)),process.exit(1)),Sn($o(Ko(e)))||(process.stderr.write(v.red(`Error: The model "${e}" cannot be used as an advisor.\n`)),process.exit(1))),en=$n()?e??Ii():e,en&&I(`[AdvisorTool] Advisor model: ${en}`)}if(Cf(n),!tt()&&!Xe()&&Ua().defaultView===`chat`){let{isBriefEntitled:t}=(rr(),e(Hr));t()&&ze(!0)}if(n.proactive||d(process.env.CLAUDE_CODE_PROACTIVE)){let t=`\n# Proactive Mode\n\nYou are in proactive mode. Take initiative — explore, act, and make progress without waiting for instructions.\n\nStart by briefly greeting the user.\n\nYou will receive periodic <tick> prompts. These are check-ins. Do whatever seems most useful, or call Sleep if there's nothing to do. ${(rr(),e(Hr)).isBriefEnabled()?`Call SendUserMessage at checkpoints to mark where things stand.`:`The user will see any text you output.`}`;C=C?`${C}\n\n${t}`:t}if(r&&tf){let e=tf.getAssistantSystemPromptAddendum();C=C?`${C}\n\n${e}`:e}let D,O,k;if(!x){let e=fu(!1);O=e.getFpsMetrics,k=e.stats,process.env.USER_TYPE===`ant`&&qc();let{createRoot:n}=await import(`./src-CST_jFnT.js`);D=await n(e.renderOptions),G(`tengu_timer`,{event:`startup`,durationMs:Math.round(process.uptime()*1e3)}),I(`[STARTUP] Running showSetupScreens()...`);let r=Date.now(),i=await du(D,Ve,s,It);if(I(`[STARTUP] showSetupScreens() completed in ${Date.now()-r}ms`),De!==void 0){let{getBridgeDisabledReason:e}=await import(`./bridgeEnabled-D0XC5kNh.js`),t=await e();Oe=t===null,t&&process.stderr.write(v.yellow(`${t}\n--rc flag ignored.\n`))}i&&t?.trim().toLowerCase()===`/login`&&(t=``),i&&(Fc(),Ht(),bc(),import(`./trustedDevice-CiwjT_Y6.js`).then(e=>(e.clearTrustedDeviceToken(),e.enrollTrustedDevice())));let a=await ws();a.valid||await X(D,a.message)}if(process.exitCode!==void 0){I(`Graceful shutdown initiated, skipping further initialization`);return}if(Li(),!x){let{errors:e}=qa(),t=e.filter(e=>!e.mcpErrorMetadata);t.length>0&&await pu(D,{settingsErrors:t,onExit:()=>xi(1)})}let an=B().startupPrefetchedAt??0;p()?(I(`Skipping startup prefetches, last ran ${Math.round((Date.now()-an)/1e3)}s ago`),Os()):(I(`Starting background startup prefetches${an>0?` last ran ${Math.round((Date.now()-an)/1e3)}s ago`:``}`),Rn().catch(e=>U(e)),ql(),Tc(),bs()),x||sl();let{servers:sn}=await ot;I(`[STARTUP] MCP configs resolved in ${at}ms (awaited at +${Date.now()-it}ms)`);let ln={...sn,...Ue},mn={},hn={};for(let[e,t]of Object.entries(ln)){let n=t;n.type===`sdk`?mn[e]=n:hn[e]=n}K(`action_mcp_configs_loaded`);let _n=x?Promise.resolve({clients:[],tools:[],commands:[]}):Er(hn),yn=x?Promise.resolve({clients:[],tools:[],commands:[]}):rt.then(e=>Object.keys(e).length>0?Er(e):{clients:[],tools:[],commands:[]}),xn=Promise.all([_n,yn]).then(([e,t])=>({clients:[...e.clients,...t.clients],tools:cn([...e.tools,...t.tools],`name`),commands:cn([...e.commands,...t.commands],`name`)})),wn=fe||de||pe||x||n.continue||n.resume?null:gi(`startup`,{agentType:E?.agentType,model:$t}),En=[];xn.catch(()=>{});let kn=[],An=[],jn=[],Fn=br(),A=Fn===!1?{type:`disabled`}:{type:`adaptive`};if(n.thinking===`adaptive`||n.thinking===`enabled`)Fn=!0,A={type:`adaptive`};else if(n.thinking===`disabled`)Fn=!1,A={type:`disabled`};else{let e=process.env.MAX_THINKING_TOKENS?parseInt(process.env.MAX_THINKING_TOKENS,10):n.maxThinkingTokens;e!==void 0&&(e>0?(Fn=!0,A={type:`enabled`,budgetTokens:e}):e===0&&(Fn=!1,A={type:`disabled`}))}H(`info`,`started`,{version:`0.0.6`,is_native_binary:zo()}),wa(async()=>{H(`info`,`exited`)}),xf({hasInitialPrompt:!!t,hasStdin:!!T,verbose:le,debug:i,debugToStderr:a,print:ue??!1,outputFormat:g??`text`,inputFormat:_??`text`,numAllowedTools:l.length,numDisallowedTools:u.length,mcpClientCount:Object.keys(ln).length,worktreeEnabled:ve,skipWebFetchPreflight:Ua().skipWebFetchPreflight,githubActionInputs:process.env.GITHUB_ACTION_INPUTS,dangerouslySkipPermissionsPassed:o??!1,permissionMode:Ve,modeIsBypass:Ve===`bypassPermissions`,allowDangerouslySkipPermissionsPassed:s,systemPromptFlag:S?n.systemPromptFile?`file`:`flag`:void 0,appendSystemPromptFlag:C?n.appendSystemPromptFile?`file`:`flag`:void 0,thinkingConfig:A,assistantActivationPath:r?tf?.getAssistantActivationPath():void 0}),ui(hn,w),On(null,`initialization`),af(),vn().then(e=>{e&&(Ot&&Ln(Ot),Et().then(e=>{e>=2&&G(`tengu_concurrent_sessions`,{num_sessions:e})}))}),p()||(x?(await mt(),K(`action_after_plugins_init`),fr().then(()=>on())):mt().then(async()=>{K(`action_after_plugins_init`),await fr(),on()}));let In=fe||de?`init`:pe?`maintenance`:null;if(fe){Qn(),await Bt(`init`,{forceSyncExecution:!0}),await gi(`startup`,{forceSyncExecution:!0}),xi(0);return}if(x){(g===`stream-json`||g===`json`)&&Ta(!0),Qn(),Vl();let e=n.continue||n.resume||b||In?void 0:gi(`startup`);e?.catch(()=>{}),K(`before_validateForceLoginOrg`);let t=await ws();t.valid||(process.stderr.write(t.message+`
|
|
841
|
+
`),process.exit(1));let i=me?[]:It.filter(e=>e.type===`prompt`&&!e.disableNonInteractive||e.type===`local`&&e.supportsNonInteractive),a=Wr(),o=pn({...a,mcp:{...a.mcp,clients:kn,commands:jn,tools:An},toolPermissionContext:w,...Es()&&{fastMode:os(qt??null)},...Gi()&&en&&{advisorModel:en},kairosEnabled:r},Kc);Ft(w,o.getState().fastMode).then(({updateContext:e})=>{o.setState(t=>{let n=e(t.toolPermissionContext);return n===t.toolPermissionContext?t:{...t,toolPermissionContext:n}})}),n.sessionPersistence===!1&&Re(!0),Le(qo(h));let s=(e,t)=>Object.keys(e).length===0?Promise.resolve():(o.setState(t=>({...t,mcp:{...t.mcp,clients:[...t.mcp.clients,...Object.entries(e).map(([e,t])=>({name:e,type:`pending`,config:t}))]}})),Mi(({client:e,tools:t,commands:n})=>{o.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:cn([...r.mcp.tools,...t],`name`),commands:cn([...r.mcp.commands,...n],`name`)}}))},e).catch(e=>I(`[MCP] ${t} connect error: ${e}`)));K(`before_connectMcp`),await s(hn,`regular`),K(`after_connectMcp`);let c=5e3,u=rt.then(e=>{if(Object.keys(e).length>0){let t=new Set;for(let n of Object.values(e)){let e=lt(n);e&&t.add(e)}let n=new Set;for(let[e,r]of Object.entries(hn)){if(!e.startsWith(`plugin:`))continue;let i=lt(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 o.getState().mcp.clients)!n.has(e.name)||e.type!==`connected`||(e.client.onclose=void 0,Ur(e.name,e.config).catch(()=>{}));o.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=Yi(i,e),a=sr(a,e);return{...e,mcp:{...e.mcp,clients:t,tools:r,commands:i,resources:a}}})}}let{servers:t}=tn(e,Ya(hn,(e,t)=>!t.startsWith(`plugin:`)));return s(t,`claudeai`)}),d,f=await Promise.race([u.then(()=>!1),new Promise(e=>{d=setTimeout(e=>e(!0),c,e)})]);d&&clearTimeout(d),f&&I(`[MCP] claude.ai connectors not ready after ${c}ms — proceeding; background connection continues`),K(`after_connectMcp_claudeai`),p()||(ff(),import(`./backgroundHousekeeping-3i_d_WW5.js`).then(e=>e.startBackgroundHousekeeping()),process.env.USER_TYPE===`ant`&&import(`./sdkHeapDumpMonitor-WdXUV7DV.js`).then(e=>e.startSdkMemoryMonitor())),of(),K(`before_print_import`);let{runHeadless:ee}=await import(`./print-Db_VXmfO.js`);K(`after_print_import`),ee(T,()=>o.getState(),o.setState,i,pt,mn,Ut.activeAgents,{continue:n.continue,resume:n.resume,verbose:le,outputFormat:g,jsonSchema:gt,permissionPromptToolName:n.permissionPromptTool,allowedTools:l,thinkingConfig:A,maxTurns:n.maxTurns,maxBudgetUsd:n.maxBudgetUsd,taskBudget:n.taskBudget?{total:n.taskBudget}:void 0,systemPrompt:S,appendSystemPrompt:C,userSpecifiedModel:qt,fallbackModel:jt,teleport:b,sdkUrl:xe,replayUserMessages:Tt,includePartialMessages:Se,forkSession:n.forkSession||!1,resumeSessionAt:n.resumeSessionAt||void 0,rewindFiles:n.rewindFiles,enableAuthStatus:n.enableAuthStatus,agent:ce,workload:n.workload,setupTrigger:In??void 0,sessionStartHooksPromise:e});return}G(`tengu_startup_manual_model_config`,{cli_flag:n.model,env_var:process.env.ANTHROPIC_MODEL,settings_file:(Ua()||{}).model,subscriptionType:Jo(),agent:Wt});let Bn=il($t),Vn=[];if(He&&Vn.push({key:`permission-mode-notification`,text:He,priority:`high`}),Bn&&Vn.push({key:`model-deprecation-warning`,text:Bn,color:`warning`,priority:`high`}),nt.length>0){let e=Ja(nt.map(e=>e.ruleDisplay)),t=e.join(`, `),n=Ja(nt.map(e=>e.sourceDisplay)).join(`, `),r=e.length;Vn.push({key:`overly-broad-bash-notification`,text:`${t} allow ${Vo(r,`rule`)} from ${n} ${Vo(r,`was`,`were`)} ignored \u2014 not available for Ants, please use auto-mode instead`,color:`warning`,priority:`high`})}let Hn={...w},Un=Xe(),Kn=Oe||to()||r,j={settings:Ua(),tasks:{},agentNameRegistry:new Map,verbose:le??B().verbose??!1,mainLoopModel:Qt,mainLoopModelForSession:null,isBriefOnly:Un,expandedView:B().showExpandedTodos?`tasks`:`none`,selectedIPAgentIndex:-1,selectedBgAgentIndex:-1,viewSelectionMode:`none`,footerSelection:null,toolPermissionContext:Hn,agent:E?.agentType,agentDefinitions:Ut,mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:0},plugins:{enabled:[],disabled:[],commands:[],errors:[],installationStatus:{marketplaces:[],plugins:[]},needsRefresh:!1},statusLineText:void 0,kairosEnabled:r,remoteSessionUrl:void 0,remoteConnectionStatus:`connecting`,remoteBackgroundTaskCount:0,replBridgeEnabled:Kn||!1,replBridgeExplicit:Oe,replBridgeOutboundOnly:!1,replBridgeConnected:!1,replBridgeSessionActive:!1,replBridgeReconnecting:!1,replBridgeConnectUrl:void 0,replBridgeSessionUrl:void 0,replBridgeEnvironmentId:void 0,replBridgeSessionId:void 0,replBridgeError:void 0,replBridgeInitialName:Ae,showRemoteCallout:!1,notifications:{current:null,queue:Vn},elicitation:{queue:[]},todos:{},remoteAgentTaskSuggestions:[],fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},attribution:fc(),thinkingEnabled:Fn,promptSuggestionEnabled:Mr(),sessionHooks:new Map,inbox:{messages:[]},promptSuggestion:{text:null,promptId:null,shownAt:0,acceptedAt:0,generationRequestId:null},speculation:yi,speculationSessionTimeSavedMs:0,skillImprovement:{suggestion:null},authVersion:0,initialMessage:T?{message:Cn({content:String(T)})}:null,activeOverlays:new Set,fastMode:os($t),...Gi()&&en&&{advisorModel:en}};T&&Br(String(T));let Yn=An;z(e=>({...e,numStartups:(e.numStartups??0)+1})),setImmediate(()=>{cf(),of()});let Xn=process.env.USER_TYPE===`ant`?import(`./sessionDataUploader-CaCjwsA2.js`):null,Zn=Xn?Xn.then(e=>e.createSessionTurnUploader()).catch(()=>null):null,er={debug:i||a,commands:[...It,...jn],initialTools:Yn,mcpClients:kn,autoConnectIdeFlag:ne,mainThreadAgentDefinition:E,disableSlashCommands:me,dynamicMcpConfig:Ue,strictMcpConfig:Ge,systemPrompt:S,appendSystemPrompt:C,taskListId:ge,thinkingConfig:A,...Zn&&{onTurnComplete:e=>{Zn.then(t=>t?.(e))}}},tr={mainThreadAgentDefinition:E,agentDefinitions:Ut,currentCwd:Mt,cliAgents:Rt,initialState:j};if(n.continue){let e=!1;try{let t=performance.now(),{clearSessionCaches:r}=await import(`./caches-CWzT7e6Y.js`);r();let i=await Pn(void 0,void 0);if(!i)return G(`tengu_continue`,{success:!1}),await X(D,`No conversation found to continue`);let a=await Jc(i,{forkSession:!!n.forkSession,includeAttribution:!0,transcriptPath:i.fullPath},tr);a.restoredAgentDef&&(E=a.restoredAgentDef),Sf(n),Cf(n),G(`tengu_continue`,{success:!0,resume_duration_ms:Math.round(performance.now()-t)}),e=!0,await Wl(D,{getFpsMetrics:O,stats:k,initialState:a.initialState},{...er,mainThreadAgentDefinition:a.restoredAgentDef??E,initialMessages:a.messages,initialFileHistorySnapshots:a.fileHistorySnapshots,initialContentReplacements:a.contentReplacements,initialAgentName:a.agentName,initialAgentColor:a.agentColor},uu)}catch(t){e||G(`tengu_continue`,{success:!1}),U(t),process.exit(1)}}else if(Q?.url){let e;try{let t=await Zd({serverUrl:Q.url,authToken:Q.authToken,cwd:Ke(),dangerouslySkipPermissions:Q.dangerouslySkipPermissions});t.workDir&&(Ie(t.workDir),$e(t.workDir)),Me(Q.url),e=t.config}catch(e){return await X(D,e instanceof Xd?e.message:String(e),()=>P(1))}let t=Qi(`Connected to server at ${Q.url}\nSession: ${e.sessionId}`,`info`);await Wl(D,{getFpsMetrics:O,stats:k,initialState:j},{debug:i||a,commands:It,initialTools:[],initialMessages:[t],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:E,disableSlashCommands:me,directConnectConfig:e,thinkingConfig:A},uu);return}else if($?.host){let{createSSHSession:e,createLocalSSHSession:t,SSHSessionError:n}=await import(`./createSSHSession-BM-5pbv6.js`),r;try{if($.local)process.stderr.write(`Starting local ssh-proxy test session...
|
|
842
|
+
`),r=await t({cwd:$.cwd,permissionMode:$.permissionMode,dangerouslySkipPermissions:$.dangerouslySkipPermissions});else{process.stderr.write(`Connecting to ${$.host}…\n`);let t=process.stderr.isTTY,n=!1;r=await e({host:$.host,cwd:$.cwd,localVersion:`0.0.6`,permissionMode:$.permissionMode,dangerouslySkipPermissions:$.dangerouslySkipPermissions,extraCliArgs:$.extraCliArgs,remoteBin:$.remoteBin},t?{onProgress:e=>{n=!0,process.stderr.write(`\r ${e}\x1b[K`)}}:{}),n&&process.stderr.write(`
|
|
843
|
+
`)}Ie(r.remoteCwd),$e(r.remoteCwd),Me($.local?`local`:$.host)}catch(e){return await X(D,e instanceof n?e.message:String(e),()=>P(1))}let o=Qi($.local?`Local ssh-proxy test session\ncwd: ${r.remoteCwd}\nAuth: unix socket → local proxy`:`SSH session to ${$.host}\nRemote cwd: ${r.remoteCwd}\nAuth: unix socket -R → local proxy`,`info`);await Wl(D,{getFpsMetrics:O,stats:k,initialState:j},{debug:i||a,commands:It,initialTools:[],initialMessages:[o],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:E,disableSlashCommands:me,sshSession:r,thinkingConfig:A},uu);return}else if(_f&&(_f.sessionId||_f.discover)){let{discoverAssistantSessions:e}=await import(`./sessionDiscovery-DAfNKqp1.js`),t=_f.sessionId;if(!t){let n;try{n=await e()}catch(e){return await X(D,`Failed to discover sessions: ${e instanceof Error?e.message:e}`,()=>P(1))}if(n.length===0){let e;try{e=await hu(D)}catch(e){return await X(D,`Assistant installation failed: ${e instanceof Error?e.message:e}`,()=>P(1))}return e===null&&(await P(0),process.exit(0)),await lu(D,`Assistant installed in ${e}. The daemon is starting up — run \`claude assistant\` again in a few seconds to connect.`,{exitCode:0,beforeExit:()=>P(0)})}if(n.length===1)t=n[0].id;else{let e=await mu(D,{sessions:n});e||(await P(0),process.exit(0)),t=e}}let{checkAndRefreshOAuthTokenIfNeeded:n,getClaudeAIOAuthTokens:r}=await import(`./auth-DRTjfnGy.js`);await n();let o;try{o=await _c()}catch(e){return await X(D,`Error: ${e instanceof Error?e.message:`Failed to authenticate`}`,()=>P(1))}let s=()=>r()?.accessToken??o.accessToken;je(!0),ze(!0),ke(!0);let c=al(t,s,o.orgUUID,!1,!0),l=Qi(`Attached to assistant session ${t.slice(0,8)}…`,`info`),u={...j,isBriefOnly:!0,kairosEnabled:!1,replBridgeEnabled:!1},d=Nt(It);await Wl(D,{getFpsMetrics:O,stats:k,initialState:u},{debug:i||a,commands:d,initialTools:[],initialMessages:[l],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:E,disableSlashCommands:me,remoteSessionConfig:c,thinkingConfig:A},uu);return}else if(n.resume||n.fromPr||b||Te!==null){let{clearSessionCaches:e}=await import(`./caches-CWzT7e6Y.js`);e();let t=null,r,o=gr(n.resume),s,c=null,l;if(n.fromPr&&(n.fromPr===!0?l=!0:typeof n.fromPr==`string`&&(l=n.fromPr)),n.resume&&typeof n.resume==`string`&&!o){let e=n.resume.trim();if(e){let t=await Bi(e,{exact:!0});t.length===1?(c=t[0],o=ft(c)??null):s=e}}if((Te!==null||b)&&(await qn(),!Nn(`allow_remote_sessions`)))return await X(D,`Error: Remote sessions are disabled by your organization's policy.`,()=>P(1));if(Te!==null){let e=Te.length>0;if(!e)return await X(D,`Error: --remote requires a description.
|
|
844
|
+
Usage: claude --remote "your task description"`,()=>P(1));G(`tengu_remote_create_session`,{has_initial_prompt:String(e)});let t=await ho(),n=await nn(D,e?Te:null,new AbortController().signal,t||void 0);if(!n)return G(`tengu_remote_create_session_error`,{error:`unable_to_create_session`}),await X(D,`Error: Unable to create remote session`,()=>P(1));G(`tengu_remote_create_session_success`,{session_id:n.id}),process.stdout.write(`Created remote session: ${n.title}\n`),process.stdout.write(`View: ${Zt(n.id)}?m=0\n`),process.stdout.write(`Resume with: claude --teleport ${n.id}\n`),await P(0),process.exit(0),ke(!0),Qe(gn(n.id));let r;try{r=await _c()}catch(e){return U(ha(e)),await X(D,`Error: ${F(e)||`Failed to authenticate`}`,()=>P(1))}let{getClaudeAIOAuthTokens:o}=await import(`./auth-DRTjfnGy.js`),s=al(n.id,()=>o()?.accessToken??r.accessToken,r.orgUUID,e),c=`${Zt(n.id)}?m=0`,l=Qi(`/remote-control is active. Code in CLI or at ${c}`,`info`),u=e?Cn({content:Te}):null,d={...j,remoteSessionUrl:c},f=Nt(It);await Wl(D,{getFpsMetrics:O,stats:k,initialState:d},{debug:i||a,commands:f,initialTools:[],initialMessages:u?[l,u]:[l],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:E,disableSlashCommands:me,remoteSessionConfig:s,thinkingConfig:A},uu);return}else if(b){if(b===!0||b===``){G(`tengu_teleport_interactive_mode`,{}),I(`selectAndResumeTeleportTask: Starting teleport flow...`);let e=await gu(D);e||(await P(0),process.exit(0));let{branchError:n}=await xt(e.branch);t=$r(e.log,n)}else if(typeof b==`string`){G(`tengu_teleport_resume_session`,{mode:`direct`});try{let e=await Dt(await yc(b));if(e.status===`mismatch`||e.status===`not_in_repo`){let t=e.sessionRepo;if(t){let e=await el($c(t));if(e.length>0){let n=await _u(D,{targetRepo:t,initialPaths:e});n?(process.chdir(n),At(n),Ie(n)):await P(0)}else throw new fa(`You must run claude --teleport ${b} from a checkout of ${t}.`,v.red(`You must run claude --teleport ${b} from a checkout of ${v.bold(t)}.\n`))}}else if(e.status===`error`)throw new fa(e.errorMessage||`Failed to validate session`,v.red(`Error: ${e.errorMessage||`Failed to validate session`}\n`));await fn();let{teleportWithProgress:n}=await import(`./TeleportProgress-rYaHIEfe.js`),r=await n(D,b);Je({sessionId:b}),t=r.messages}catch(e){e instanceof fa?process.stderr.write(e.formattedMessage+`
|
|
845
|
+
`):(U(e),process.stderr.write(v.red(`Error: ${F(e)}\n`))),await P(1)}}}if(process.env.USER_TYPE===`ant`&&n.resume&&typeof n.resume==`string`&&!o){let e=ul(n.resume);try{let t=performance.now(),i;try{i=await Gn(e)}catch(e){if(!ma(e))throw e}if(i){let e=await Pn(i,void 0);e?(r=await Jc(e,{forkSession:!!n.forkSession,transcriptPath:e.fullPath},tr),r.restoredAgentDef&&(E=r.restoredAgentDef),G(`tengu_session_resumed`,{entrypoint:`file`,success:!0,resume_duration_ms:Math.round(performance.now()-t)})):G(`tengu_session_resumed`,{entrypoint:`file`,success:!1})}}catch(e){G(`tengu_session_resumed`,{entrypoint:`file`,success:!1}),U(e),await X(D,`Unable to load transcript from file: ${n.resume}`,()=>P(1))}}if(o){let e=o;try{let t=performance.now(),i=await Pn(c??e,void 0);if(!i)return G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),await X(D,`No conversation found with session ID: ${e}`);let a=c?.fullPath??i.fullPath;r=await Jc(i,{forkSession:!!n.forkSession,sessionIdOverride:e,transcriptPath:a},tr),r.restoredAgentDef&&(E=r.restoredAgentDef),G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!0,resume_duration_ms:Math.round(performance.now()-t)})}catch(t){G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),U(t),await X(D,`Failed to resume session ${e}`)}}if(oe)try{let e=await oe,t=Ba(e,e=>!e.success);t>0&&process.stderr.write(v.yellow(`Warning: ${t}/${e.length} file(s) failed to download.\n`))}catch(e){return await X(D,`Error downloading files: ${F(e)}`)}let u=r??(Array.isArray(t)?{messages:t,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:E,initialState:j,contentReplacements:void 0}:void 0);u?(Sf(n),Cf(n),await Wl(D,{getFpsMetrics:O,stats:k,initialState:u.initialState},{...er,mainThreadAgentDefinition:u.restoredAgentDef??E,initialMessages:u.messages,initialFileHistorySnapshots:u.fileHistorySnapshots,initialContentReplacements:u.contentReplacements,initialAgentName:u.agentName,initialAgentColor:u.agentColor},uu)):await vu(D,{getFpsMetrics:O,stats:k,initialState:j},dn(Ke()),{...er,initialSearchQuery:s,forkSession:n.forkSession,filterByPr:l})}else{let e=wn&&En.length===0?wn:void 0;K(`action_after_hooks`),Sf(n),Cf(n);let t=null;n.deepLinkOrigin?(G(`tengu_deep_link_opened`,{has_prefill:!!n.prefill,has_repo:!!n.deepLinkRepo}),t=Qi(rl({cwd:ca(),prefillLength:n.prefill?.length,repo:n.deepLinkRepo,lastFetch:n.deepLinkLastFetch===void 0?void 0:new Date(n.deepLinkLastFetch)}),`warning`)):n.prefill&&(t=Qi(`Launched with a pre-filled prompt — review it before pressing Enter.`,`warning`));let r=t?[t,...En]:En.length>0?En:void 0;await Wl(D,{getFpsMetrics:O,stats:k,initialState:j},{...er,initialMessages:r,pendingHookMessages:e},uu)}}).version(`0.0.6 (Work Mate)`,`-v, --version`,`Output the version number`),n.option(`-w, --worktree [name]`,`Create a new git worktree for this session (optionally specify a name)`),n.option(`--tmux`,`Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.`),$n()&&n.addOption(new J(`--advisor <model>`,`Enable the server-side advisor tool with the specified model (alias or full ID).`).hideHelp()),process.env.USER_TYPE===`ant`&&(n.addOption(new J(`--delegate-permissions`,`[ANT-ONLY] Alias for --permission-mode auto.`).implies({permissionMode:`auto`})),n.addOption(new J(`--dangerously-skip-permissions-with-classifiers`,`[ANT-ONLY] Deprecated alias for --permission-mode auto.`).hideHelp().implies({permissionMode:`auto`})),n.addOption(new J(`--afk`,`[ANT-ONLY] Deprecated alias for --permission-mode auto.`).hideHelp().implies({permissionMode:`auto`})),n.addOption(new J(`--tasks [id]`,`[ANT-ONLY] Tasks mode: watch for tasks and auto-process them. Optional id is used as both the task list ID and agent ID (defaults to "tasklist").`).argParser(String).hideHelp()),n.option(`--agent-teams`,`[ANT-ONLY] Force Claude to use multi-agent mode for solving problems`,()=>!0)),n.addOption(new J(`--enable-auto-mode`,`Opt in to auto mode`).hideHelp()),n.addOption(new J(`--proactive`,`Start in proactive autonomous mode`)),n.addOption(new J(`--brief`,`Enable SendUserMessage tool for agent-to-user communication`)),n.addOption(new J(`--assistant`,`Force assistant mode (Agent SDK daemon use)`).hideHelp()),n.addOption(new J(`--sdk-url <url>`,`Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)`).hideHelp()),n.addOption(new J(`--teleport [session]`,`Resume a teleport session, optionally specify session ID`).hideHelp()),n.addOption(new J(`--remote [description]`,`Create a remote session with the given description`).hideHelp()),n.addOption(new J(`--remote-control [name]`,`Start an interactive session with Remote Control enabled (optionally named)`).argParser(e=>e||!0).hideHelp()),n.addOption(new J(`--rc [name]`,`Alias for --remote-control`).argParser(e=>e||!0).hideHelp()),K(`run_main_options_built`);let r=process.argv.includes(`-p`)||process.argv.includes(`--print`),i=process.argv.some(e=>e.startsWith(`cc://`)||e.startsWith(`cc+unix://`));if(r&&!i)return K(`run_before_parse`),await n.parseAsync(process.argv),K(`run_after_parse`),n;let a=n.command(`mcp`).description(`Configure and manage MCP servers`).configureHelp(t()).enablePositionalOptions();a.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-CwJ-AIpt.js`);await n({debug:e,verbose:t})}),Id(a),vr()&&Ld(a),a.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-CwJ-AIpt.js`);await n(e,t)}),a.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-CwJ-AIpt.js`);await e()}),a.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-CwJ-AIpt.js`);await t(e)}),a.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-CwJ-AIpt.js`);await r(e,t,n)}),a.command(`add-from-claude-desktop`).description(`Import MCP servers from Claude Desktop (Mac and WSL only)`).option(`-s, --scope <scope>`,`Configuration scope (local, user, or project)`,`local`).action(async e=>{let{mcpAddFromDesktopHandler:t}=await import(`./mcp-CwJ-AIpt.js`);await t(e)}),a.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-CwJ-AIpt.js`);await e()}),n.command(`server`).description(`Start a Work Mate session server`).option(`--port <number>`,`HTTP port`,`0`).option(`--host <string>`,`Bind address`,`0.0.0.0`).option(`--auth-token <token>`,`Bearer token for auth`).option(`--unix <path>`,`Listen on a unix domain socket`).option(`--workspace <dir>`,`Default working directory for sessions that do not specify cwd`).option(`--idle-timeout <ms>`,`Idle timeout for detached sessions in ms (0 = never expire)`,`600000`).option(`--max-sessions <n>`,`Maximum concurrent sessions (0 = unlimited)`,`32`).action(async e=>{let{randomBytes:t}=await import(`crypto`),{startServer:n}=await import(`./server-LdbAb0sV.js`),{SessionManager:r}=await import(`./sessionManager-CPa049BO.js`),{DangerousBackend:i}=await import(`./dangerousBackend-DwcP0P08.js`),{printBanner:a}=await import(`./serverBanner-BdExKFHT.js`),{createServerLogger:o}=await import(`./serverLog-BFmvyJ93.js`),{writeServerLock:s,removeServerLock:c,probeRunningServer:l}=await import(`./lockfile-D5-j7HOZ.js`),u=await l();u&&(process.stderr.write(`A claude server is already running (pid ${u.pid}) at ${u.httpUrl}\n`),process.exit(1));let d=e.authToken??`sk-ant-cc-${t(16).toString(`base64url`)}`,f={port:parseInt(e.port,10),host:e.host,authToken:d,unix:e.unix,workspace:e.workspace,idleTimeoutMs:parseInt(e.idleTimeout,10),maxSessions:parseInt(e.maxSessions,10)},p=new r(new i,{idleTimeoutMs:f.idleTimeoutMs,maxSessions:f.maxSessions}),ee=n(f,p,o()),te=ee.port??f.port;a(f,d,te),await s({pid:process.pid,port:te,host:f.host,httpUrl:f.unix?`unix:${f.unix}`:`http://${f.host}:${te}`,startedAt:Date.now()});let m=!1,h=async()=>{m||(m=!0,ee.stop(!0),await p.destroyAll(),await c(),process.exit(0))};process.once(`SIGINT`,()=>void h()),process.once(`SIGTERM`,()=>void h())}),n.command(`ssh <host> [dir]`).description(`Run Work Mate on a remote host over SSH. Deploys the binary and tunnels API auth back through your local machine — no remote setup needed.`).option(`--permission-mode <mode>`,`Permission mode for the remote session`).option(`--dangerously-skip-permissions`,`Skip all permission prompts on the remote (dangerous)`).option(`--remote-bin <command>`,`Custom remote binary command (skips probe/deploy). Example: --remote-bin 'bun /path/to/project/dist/cli.js'`).option(`--local`,`e2e test mode — spawn the child CLI locally (skip ssh/deploy). Exercises the auth proxy and unix-socket plumbing without a remote host.`).action(async()=>{process.stderr.write(`Usage: claude ssh <user@host | ssh-config-alias> [dir]
|
|
846
846
|
|
|
847
847
|
Runs Work Mate on a remote Linux host. You don't need to install
|
|
848
848
|
anything on the remote — the binary is
|
|
849
849
|
deployed over SSH and API auth tunnels back through your local machine.
|
|
850
|
-
`),process.exit(1)}),n.command(`open <cc-url>`).description(`Connect to a Work Mate server (internal — use cc:// URLs)`).option(`-p, --print [prompt]`,`Print mode (headless)`).option(`--output-format <format>`,`Output format: text, json, stream-json`,`text`).action(async(e,t)=>{let{parseConnectUrl:n}=await import(`./parseConnectUrl-BiyKR5-x.js`),{serverUrl:r,authToken:i}=n(e),a;try{let e=await Zd({serverUrl:r,authToken:i,cwd:Ke(),dangerouslySkipPermissions:Q?.dangerouslySkipPermissions});e.workDir&&(Ie(e.workDir),$e(e.workDir)),Me(r),a=e.config}catch(e){console.error(e instanceof Xd?e.message:String(e)),process.exit(1)}let{runConnectHeadless:o}=await import(`./connectHeadless-CqRoEtrg.js`),s=typeof t.print==`string`?t.print:``,c=t.print===!0;await o(a,s,t.outputFormat,c)});let o=n.command(`auth`).description(`Manage authentication`).configureHelp(t());o.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
|
|
850
|
+
`),process.exit(1)}),n.command(`open <cc-url>`).description(`Connect to a Work Mate server (internal — use cc:// URLs)`).option(`-p, --print [prompt]`,`Print mode (headless)`).option(`--output-format <format>`,`Output format: text, json, stream-json`,`text`).action(async(e,t)=>{let{parseConnectUrl:n}=await import(`./parseConnectUrl-BiyKR5-x.js`),{serverUrl:r,authToken:i}=n(e),a;try{let e=await Zd({serverUrl:r,authToken:i,cwd:Ke(),dangerouslySkipPermissions:Q?.dangerouslySkipPermissions});e.workDir&&(Ie(e.workDir),$e(e.workDir)),Me(r),a=e.config}catch(e){console.error(e instanceof Xd?e.message:String(e)),process.exit(1)}let{runConnectHeadless:o}=await import(`./connectHeadless-CqRoEtrg.js`),s=typeof t.print==`string`?t.print:``,c=t.print===!0;await o(a,s,t.outputFormat,c)});let o=n.command(`auth`).description(`Manage authentication`).configureHelp(t());o.command(`login`).description(`Sign in`).option(`--email <email>`,`Pre-populate email address on the login page`).option(`--sso`,`Force SSO login flow`).option(`--console`,`Use Console (API usage billing) instead of Claude subscription`).option(`--claudeai`,`Use Claude subscription (default)`).action(async({email:e,sso:t,console:n,claudeai:r})=>{let{authLogin:i}=await import(`./auth-8Vd3_U8t.js`);await i({email:e,sso:t,console:n,claudeai:r})}),o.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-8Vd3_U8t.js`);await t(e)});let s=()=>new J(`--cowork`,`Use cowork_plugins directory`).hideHelp(),c=n.command(`plugin`).alias(`plugins`).description(`Manage Work Mate plugins`).configureHelp(t());c.command(`validate <path>`).description(`Validate a plugin or marketplace manifest`).addOption(s()).action(async(e,t)=>{let{pluginValidateHandler:n}=await import(`./plugins-Dn6ceWrT.js`);await n(e,t)}),c.command(`list`).description(`List installed plugins`).option(`--json`,`Output as JSON`).option(`--available`,`Include available plugins from marketplaces (requires --json)`).addOption(s()).action(async e=>{let{pluginListHandler:t}=await import(`./plugins-Dn6ceWrT.js`);await t(e)});let l=c.command(`marketplace`).description(`Manage Work Mate marketplaces`).configureHelp(t());if(l.command(`add <source>`).description(`Add a marketplace from a URL, path, or GitHub repo`).addOption(s()).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-Dn6ceWrT.js`);await n(e,t)}),l.command(`list`).description(`List all configured marketplaces`).option(`--json`,`Output as JSON`).addOption(s()).action(async e=>{let{marketplaceListHandler:t}=await import(`./plugins-Dn6ceWrT.js`);await t(e)}),l.command(`remove <name>`).alias(`rm`).description(`Remove a configured marketplace`).addOption(s()).action(async(e,t)=>{let{marketplaceRemoveHandler:n}=await import(`./plugins-Dn6ceWrT.js`);await n(e,t)}),l.command(`update [name]`).description(`Update marketplace(s) from their source - updates all if no name specified`).addOption(s()).action(async(e,t)=>{let{marketplaceUpdateHandler:n}=await import(`./plugins-Dn6ceWrT.js`);await n(e,t)}),c.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(s()).action(async(e,t)=>{let{pluginInstallHandler:n}=await import(`./plugins-Dn6ceWrT.js`);await n(e,t)}),c.command(`uninstall <plugin>`).alias(`remove`).alias(`rm`).description(`Uninstall an installed plugin`).option(`-s, --scope <scope>`,`Uninstall from scope: user, project, or local`,`user`).option(`--keep-data`,`Preserve the plugin's persistent data directory (~/.claude/plugins/data/{id}/)`).addOption(s()).action(async(e,t)=>{let{pluginUninstallHandler:n}=await import(`./plugins-Dn6ceWrT.js`);await n(e,t)}),c.command(`enable <plugin>`).description(`Enable a disabled plugin`).option(`-s, --scope <scope>`,`Installation scope: ${Gc.join(`, `)} (default: auto-detect)`).addOption(s()).action(async(e,t)=>{let{pluginEnableHandler:n}=await import(`./plugins-Dn6ceWrT.js`);await n(e,t)}),c.command(`disable [plugin]`).description(`Disable an enabled plugin`).option(`-a, --all`,`Disable all enabled plugins`).option(`-s, --scope <scope>`,`Installation scope: ${Gc.join(`, `)} (default: auto-detect)`).addOption(s()).action(async(e,t)=>{let{pluginDisableHandler:n}=await import(`./plugins-Dn6ceWrT.js`);await n(e,t)}),c.command(`update <plugin>`).description(`Update a plugin to the latest version (restart required to apply)`).option(`-s, --scope <scope>`,`Installation scope: ${Uc.join(`, `)} (default: user)`).addOption(s()).action(async(e,t)=>{let{pluginUpdateHandler:n}=await import(`./plugins-Dn6ceWrT.js`);await n(e,t)}),n.command(`setup-token`).description(`Set up a long-lived authentication token (requires Claude subscription)`).action(async()=>{let[{setupTokenHandler:e},{createRoot:t}]=await Promise.all([import(`./util-BaDs-wL5.js`),import(`./src-CST_jFnT.js`)]);await e(await t(Zc(!1)))}),n.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-C4QXeHIJ.js`);await e(),process.exit(0)}),qi()!==`disabled`){let e=n.command(`auto-mode`).description(`Inspect auto mode classifier configuration`);e.command(`defaults`).description(`Print the default auto mode environment, allow, and deny rules as JSON`).action(async()=>{let{autoModeDefaultsHandler:e}=await import(`./autoMode-BNukrVAB.js`);e(),process.exit(0)}),e.command(`config`).description(`Print the effective auto mode config as JSON: your settings where set, defaults otherwise`).action(async()=>{let{autoModeConfigHandler:e}=await import(`./autoMode-BNukrVAB.js`);e(),process.exit(0)}),e.command(`critique`).description(`Get AI feedback on your custom auto mode rules`).option(`--model <model>`,`Override which model is used`).action(async e=>{let{autoModeCritiqueHandler:t}=await import(`./autoMode-BNukrVAB.js`);await t(e),process.exit()})}{let e=n.command(`autonomy`).description(`Inspect and manage automatic autonomy runs and flows`);e.command(`status`).description(`Print autonomy run, flow, team, pipe, and remote-control status`).option(`--deep`,`Include teams, pipes, daemon, and remote-control sections`).action(async e=>{let{autonomyStatusHandler:t}=await import(`./autonomy-BEmI7WVW.js`);await t(e),process.exit(0)}),e.command(`runs [limit]`).description(`List recent autonomy runs`).action(async e=>{let{autonomyRunsHandler:t}=await import(`./autonomy-BEmI7WVW.js`);await t(e),process.exit(0)}),e.command(`flows [limit]`).description(`List recent autonomy flows`).action(async e=>{let{autonomyFlowsHandler:t}=await import(`./autonomy-BEmI7WVW.js`);await t(e),process.exit(0)});let t=e.command(`flow <flowId>`).description(`Inspect a single autonomy flow`).action(async e=>{let{autonomyFlowHandler:t}=await import(`./autonomy-BEmI7WVW.js`);await t(e),process.exit(0)});t.command(`cancel <flowId>`).description(`Cancel a queued, waiting, or running autonomy flow`).action(async e=>{let{autonomyFlowCancelHandler:t}=await import(`./autonomy-BEmI7WVW.js`);await t(e),process.exit(0)}),t.command(`resume <flowId>`).description(`Resume a waiting autonomy flow`).action(async e=>{let{autonomyFlowResumeHandler:t}=await import(`./autonomy-BEmI7WVW.js`);await t(e),process.exit(0)})}if(n.command(`remote-control`,{hidden:!0}).alias(`rc`).description(`Connect your local environment for remote-control sessions via claude.ai/code`).action(async()=>{let{bridgeMain:e}=await import(`./bridgeMain-DUbQjgCp.js`);await e(process.argv.slice(3))}),n.command(`assistant [sessionId]`).description(`Attach the REPL as a client to a running bridge session. Discovers sessions via API if no sessionId given.`).action(()=>{process.stderr.write(`Usage: claude assistant [sessionId]
|
|
851
851
|
|
|
852
852
|
Attach the REPL as a viewer client to a running bridge session.
|
|
853
853
|
Omit sessionId to discover and pick from available sessions.
|
|
854
|
-
`),process.exit(1)}),n.command(`doctor`).description(`Check the health of your Work Mate auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.`).action(async()=>{let[{doctorHandler:e},{createRoot:t}]=await Promise.all([import(`./util-
|
|
854
|
+
`),process.exit(1)}),n.command(`doctor`).description(`Check the health of your Work Mate auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.`).action(async()=>{let[{doctorHandler:e},{createRoot:t}]=await Promise.all([import(`./util-BaDs-wL5.js`),import(`./src-CST_jFnT.js`)]);await e(await t(Zc(!1)))}),process.env.USER_TYPE===`ant`&&n.command(`up`).description(`[ANT-ONLY] Initialize or upgrade the local dev environment using the "# claude up" section of the nearest CLAUDE.md`).action(async()=>{let{up:e}=await import(`./up-BHkC97_C.js`);await e()}),process.env.USER_TYPE===`ant`&&n.command(`rollback [target]`).description(`[ANT-ONLY] Roll back to a previous release
|
|
855
855
|
|
|
856
856
|
Examples:
|
|
857
857
|
claude rollback Go 1 version back from current
|
|
858
858
|
claude rollback 3 Go 3 versions back from current
|
|
859
|
-
claude rollback 2.0.73-dev.20251217.t190658 Roll back to a specific version`).option(`-l, --list`,`List recent published versions with ages`).option(`--dry-run`,`Show what would be installed without installing`).option(`--safe`,`Roll back to the server-pinned safe version (set by oncall during incidents)`).action(async(e,t)=>{let{rollback:n}=await import(`./rollback-BPWRKlIZ.js`);await n(e,t)}),n.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-
|
|
859
|
+
claude rollback 2.0.73-dev.20251217.t190658 Roll back to a specific version`).option(`-l, --list`,`List recent published versions with ages`).option(`--dry-run`,`Show what would be installed without installing`).option(`--safe`,`Roll back to the server-pinned safe version (set by oncall during incidents)`).action(async(e,t)=>{let{rollback:n}=await import(`./rollback-BPWRKlIZ.js`);await n(e,t)}),n.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-BaDs-wL5.js`);await n(e,t)}),n.command(`update`).description(`Update workmate (ccb) to the latest version`).action(async()=>{let{updateCCB:e}=await import(`./updateCCB-DFL5Wt_I.js`);await e()}),process.env.USER_TYPE===`ant`){if(n.command(`log`).description(`[ANT-ONLY] Manage conversation logs.`).argument(`[number|sessionId]`,`A number (0, 1, 2, etc.) to display a specific log, or the sesssion ID (uuid) of a log`,e=>gr(e)||Number(e)).action(async e=>{let{logHandler:t}=await import(`./ant-B6k6cBts.js`);await t(e)}),n.command(`error`).description(`[ANT-ONLY] View error logs. Optionally provide a number (0, -1, -2, etc.) to display a specific log.`).argument(`[number]`,`A number (0, 1, 2, etc.) to display a specific log`,parseInt).action(async e=>{let{errorHandler:t}=await import(`./ant-B6k6cBts.js`);await t(e)}),process.env.USER_TYPE===`ant`){let e=n.command(`task`).description(`[ANT-ONLY] Manage task list tasks`);e.command(`create <subject>`).description(`Create a new task`).option(`-d, --description <text>`,`Task description`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).action(async(e,t)=>{let{taskCreateHandler:n}=await import(`./ant-B6k6cBts.js`);await n(e,t)}),e.command(`list`).description(`List all tasks`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).option(`--pending`,`Show only pending tasks`).option(`--json`,`Output as JSON`).action(async e=>{let{taskListHandler:t}=await import(`./ant-B6k6cBts.js`);await t(e)}),e.command(`get <id>`).description(`Get details of a task`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).action(async(e,t)=>{let{taskGetHandler:n}=await import(`./ant-B6k6cBts.js`);await n(e,t)}),e.command(`update <id>`).description(`Update a task`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).option(`-s, --status <status>`,`Set status (${Wi.join(`, `)})`).option(`--subject <text>`,`Update subject`).option(`-d, --description <text>`,`Update description`).option(`--owner <agentId>`,`Set owner`).option(`--clear-owner`,`Clear owner`).action(async(e,t)=>{let{taskUpdateHandler:n}=await import(`./ant-B6k6cBts.js`);await n(e,t)}),e.command(`dir`).description(`Show the tasks directory path`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).action(async e=>{let{taskDirHandler:t}=await import(`./ant-B6k6cBts.js`);await t(e)})}n.command(`completion <shell>`,{hidden:!0}).description(`Generate shell completion script (bash, zsh, or fish)`).option(`--output <file>`,`Write completion script directly to a file instead of stdout`).action(async(e,t)=>{let{completionHandler:r}=await import(`./ant-B6k6cBts.js`);await r(e,t,n)})}return K(`run_before_parse`),await n.parseAsync(process.argv),K(`run_after_parse`),K(`main_after_run`),Mo(),n}async function xf({hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:i,print:a,outputFormat:o,inputFormat:s,numAllowedTools:c,numDisallowedTools:l,mcpClientCount:u,worktreeEnabled:d,skipWebFetchPreflight:f,githubActionInputs:te,dangerouslySkipPermissionsPassed:m,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:d,skipWebFetchPreflight:f,...te&&{githubActionInputs:te},dangerouslySkipPermissionsPassed:m,permissionMode:h,modeIsBypass:ne,inProtectedNamespace:ee(),allowDangerouslySkipPermissionsPassed:re,thinkingType:oe.type,...oe.type===`enabled`&&{thinkingBudgetTokens:oe.budgetTokens},...ie&&{systemPromptFlag:ie},...ae&&{appendSystemPromptFlag:ae},is_simple:p()||void 0,...se&&{assistantActivationPath:se},autoUpdatesChannel:Ua().autoUpdatesChannel??`latest`,...process.env.USER_TYPE===`ant`?(()=>{let e=ca(),t=vo(e),n=t?ll(t,e)||`.`:void 0;return n?{relativeProjectPath:n}:{}})():{}})}catch(e){U(e)}}function Sf(t){if(t.proactive||d(process.env.CLAUDE_CODE_PROACTIVE)){let t=(oc(),e(rc));t.isProactiveActive()||t.activateProactive(`command`)}}function Cf(t){let n=t.brief,r=d(process.env.CLAUDE_CODE_BRIEF);if(!n&&!r)return;let{isBriefEntitled:i}=(rr(),e(Hr)),a=i();a&&ze(!0),G(`tengu_brief_mode_enabled`,{enabled:a,gated:!a,source:r?`env`:`flag`})}function wf(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(fe)}export{vf as main};
|