claude-code-best 2.4.4 → 2.6.0
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-Cj5bvJgD.js +1 -0
- package/dist/chunks/App-2tgSv9lb.js +1 -0
- package/dist/chunks/ApproveApiKey-DWa-XTLb.js +1 -0
- package/dist/chunks/ApproveApiKey-SIUwkD8j.js +1 -0
- package/dist/chunks/AssistantSessionChooser-DF9eeJZS.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-DXJdube9.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-BOSW4Zdy.js +1 -0
- package/dist/chunks/ClaudeInChromeOnboarding-BW4XHmkw.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-B8oAAHSI.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-Bz0JyaOG.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-DYhmGSkx.js +1 -0
- package/dist/chunks/DesktopHandoff-CcsM_OAS.js +1 -0
- package/dist/chunks/DevChannelsDialog-DXRgY00D.js +1 -0
- package/dist/chunks/Dialog-DYFGqyDs.js +1 -0
- package/dist/chunks/DiffDialog-PvNZfZby.js +3 -0
- package/dist/chunks/Doctor--B1HUENo.js +1 -0
- package/dist/chunks/Doctor-CE_jL9jC.js +3 -0
- package/dist/chunks/ExitFlow-C4ybxKPn.js +2 -0
- package/dist/chunks/Feedback-B5rPGl_C.js +2 -0
- package/dist/chunks/Grove-C2YjB3zL.js +1 -0
- package/dist/chunks/Grove-CKVpREDU.js +11 -0
- package/dist/chunks/HybridTransport-Byjvz-DL.js +4 -0
- package/dist/chunks/ITermBackend-Co9XpeS4.js +1 -0
- package/dist/chunks/InProcessTransport-DB52dh4f.js +1 -0
- package/dist/chunks/InvalidConfigDialog-CNsqbNU3.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-ClnZaN6b.js +1 -0
- package/dist/chunks/ListItem-OFARanN7.js +1 -0
- package/dist/chunks/MCPConnectionManager-CDsa79pu.js +1 -0
- package/dist/chunks/McpParsingWarnings-DZkzoeZf.js +1 -0
- package/dist/chunks/MessageSelector-CkeGQPNM.js +3 -0
- package/dist/chunks/Messages-PfbzLYOU.js +11 -0
- package/dist/chunks/Onboarding-BwoGQB4g.js +1 -0
- package/dist/chunks/OverageCreditUpsell-Q5g2YjQw.js +1 -0
- package/dist/chunks/PermissionDialog-5MlJf7ew.js +1 -0
- package/dist/chunks/PluginSettings-B2ASJ0Rx.js +17 -0
- package/dist/chunks/PressEnterToContinue-BdA9zDGs.js +1 -0
- package/dist/chunks/PromptInputFooterSuggestions-D4lMVCqj.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-BvLtS6an.js +1 -0
- package/dist/chunks/QueryEngine-Av0G5fze.js +1 -0
- package/dist/chunks/REPL-DCwqua0C.js +1 -0
- package/dist/chunks/REPL-Dh8vzGmF.js +97 -0
- package/dist/chunks/RemoteCallout-BV_hoz98.js +1 -0
- package/dist/chunks/RemoteSessionManager-Cxoy1ud2.js +2 -0
- package/dist/chunks/ResumeConversation-B3WuB8rs.js +1 -0
- package/dist/chunks/SSETransport-pIm26VJq.js +4 -0
- package/dist/chunks/SearchBox-DfOmUoaI.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-D70C-cmA.js +1 -0
- package/dist/chunks/SentryErrorBoundary-B6EWoJml.js +2 -0
- package/dist/chunks/SentryErrorBoundary-oJUBarGg.js +1 -0
- package/dist/chunks/Settings-CreAhCsb.js +2 -0
- package/dist/chunks/TeleportProgress-DPzGpyyM.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-DqWQX6j8.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-DPSO0S49.js +1 -0
- package/dist/chunks/ThemePicker-DueihHcy.js +1 -0
- package/dist/chunks/TmuxBackend-BNaZNAeP.js +9 -0
- package/dist/chunks/TrustDialog-CIzAlGn9.js +1 -0
- package/dist/chunks/TungstenTool-C5IqKVr0.js +1 -0
- package/dist/chunks/TungstenTool-V-Bwqlx3.js +1 -0
- package/dist/chunks/ValidationErrorsList-1k1qbsRo.js +2 -0
- package/dist/chunks/WelcomeV2-CR6TtXXM.js +1 -0
- package/dist/chunks/WindowsTerminalBackend-C5SeTXqC.js +2 -0
- package/dist/chunks/add-dir-DAMizKzF.js +1 -0
- package/dist/chunks/agentDisplay-B9z7i8b_.js +1 -0
- package/dist/chunks/agents-D5u0p1UC.js +103 -0
- package/dist/chunks/agents-DCh_gEvJ.js +2 -0
- package/dist/chunks/ajv-B_OpU_Uh.js +8 -0
- package/dist/chunks/analytics-DqMQntaB.js +1 -0
- package/dist/chunks/ant-DRJq-cEg.js +1 -0
- package/dist/chunks/api-B6URs6nc.js +1 -0
- package/dist/chunks/api-Dz_3z1kl.js +1 -0
- package/dist/chunks/asciicast-aoKFhc7C.js +1 -0
- package/dist/chunks/asciicast-o5Zg4dJt.js +4 -0
- package/dist/chunks/assistant-BRGDWkKB.js +1 -0
- package/dist/chunks/assistant-tPxOUa-Z.js +1 -0
- package/dist/chunks/assistant-zVegFdAO.js +1 -0
- package/dist/chunks/attributionHooks-PygdohOh.js +1 -0
- package/dist/chunks/attributionTrailer-BpvhXgRP.js +1 -0
- package/dist/chunks/auth-CqURlg4d.js +1 -0
- package/dist/chunks/auth-D4isgfuK.js +1 -0
- package/dist/chunks/autoMode-DVt4K4I2.js +45 -0
- package/dist/chunks/autoModeDenials-Cp6VFdsm.js +1 -0
- package/dist/chunks/autonomy-BZzW8QJZ.js +1 -0
- package/dist/chunks/autonomy-Ffv0QIyl.js +19 -0
- package/dist/chunks/autonomyPanel-MwuzDvv_.js +1 -0
- package/dist/chunks/axios-DLnc2dVy.js +1 -0
- package/dist/chunks/axios-DhfaybwJ.js +12 -0
- package/dist/chunks/backgroundHousekeeping-CYnAG60-.js +17 -0
- package/dist/chunks/backgroundHousekeeping-DUmxC6h0.js +1 -0
- package/dist/chunks/banner-CVXH2xts.js +2 -0
- package/dist/chunks/base64-js-DIVSFswY.js +1 -0
- package/dist/chunks/bedrockClient-qi1-JCOK.js +15 -0
- package/dist/chunks/bg-DK0E4ZtW.js +9 -0
- package/dist/chunks/bg-Dbh5z3Y8.js +1 -0
- package/dist/chunks/branch-DXefFdDE.js +3 -0
- package/dist/chunks/break-cache-ByJ7U2Ts.js +8 -0
- package/dist/chunks/bridge-qr4GQW_c.js +2 -0
- package/dist/chunks/bridgeConfig-CJ-KznTS.js +1 -0
- package/dist/chunks/bridgeConfig-CNbOKpAg.js +1 -0
- package/dist/chunks/bridgeEnabled-5vsPrjuq.js +1 -0
- package/dist/chunks/bridgeEnabled-BUJTCUHY.js +1 -0
- package/dist/chunks/bridgeMain-BimZwc2P.js +68 -0
- package/dist/chunks/bridgeMain-DYL4fl6A.js +1 -0
- package/dist/chunks/bridgeMessaging-BiE0CTqq.js +1 -0
- package/dist/chunks/bridgePointer-FvAMj3re.js +1 -0
- package/dist/chunks/browser-fLRXxIsQ.js +1 -0
- package/dist/chunks/btw-FpimqEqk.js +1 -0
- package/dist/chunks/buddy-BA3Cr067.js +3 -0
- package/dist/chunks/bundledMode-kSQejuY4.js +1 -0
- package/dist/chunks/bypassPermissionsKillswitch-CSC9p8mO.js +1 -0
- package/dist/chunks/caches-BUBkfP2Q.js +3 -0
- package/dist/chunks/caches-CTfNpKhW.js +1 -0
- package/dist/chunks/capacityWake-BXlUpptF.js +1 -0
- package/dist/chunks/ccrClient-BOxUn9EJ.js +1 -0
- package/dist/chunks/ccshareResume-DWLjTF22.js +1 -0
- package/dist/chunks/changeDetector-Y9KV5LgG.js +1 -0
- package/dist/chunks/channelNotification-CC7Xb06W.js +1 -0
- package/dist/chunks/channelNotification-l3EXKDNB.js +1 -0
- package/dist/chunks/chokidar-BcI3rIKm.js +1 -0
- package/dist/chunks/chokidar-SzksMqYp.js +1 -0
- package/dist/chunks/chrome-BnKyWWQL.js +1 -0
- package/dist/chunks/chromeNativeHost-4U39yLtd.js +1 -0
- package/dist/chunks/chunk-DR8-3Aex.js +1 -0
- package/dist/chunks/classPrivateFieldSet2-EAQNhHs8.js +1 -0
- package/dist/chunks/claudeDesktop-D0S1eq1F.js +1 -0
- package/dist/chunks/cleanup-Bg_gFgcj.js +1 -0
- package/dist/chunks/clear-OUVFUt8Z.js +1 -0
- package/dist/chunks/cliLaunch-BQa48gsr.js +1 -0
- package/dist/chunks/client-B47ZvTMo.js +1 -0
- package/dist/chunks/client-CPn1wQyc.js +7 -0
- package/dist/chunks/client-_sjL0I7A.js +35 -0
- package/dist/chunks/color-D5MCzz9h.js +1 -0
- package/dist/chunks/color-convert-ULbeSgNC.js +1 -0
- package/dist/chunks/commands-FJGWgQsa.js +1 -0
- package/dist/chunks/commitAttribution-BFshsh2H.js +2 -0
- package/dist/chunks/commitAttribution-DSv9FggK.js +1 -0
- package/dist/chunks/common-B379wT22.js +1 -0
- package/dist/chunks/common-B_BC3eMY.js +1 -0
- package/dist/chunks/common-CMCv4N_v.js +1 -0
- package/dist/chunks/compact-DWNaf1wR.js +3 -0
- package/dist/chunks/companion-CyK_Dr1U.js +1 -0
- package/dist/chunks/completionCache-DHfUBBMH.js +1 -0
- package/dist/chunks/completionCache-DORrtxkS.js +4 -0
- package/dist/chunks/computerUseLock-BjoDJH2h.js +1 -0
- package/dist/chunks/config-BdCuh6eA.js +1 -0
- package/dist/chunks/config-DNz6Eitr.js +1 -0
- package/dist/chunks/connectHeadless-CwsFt-Mh.js +1 -0
- package/dist/chunks/constants-41VpZw2G.js +1 -0
- package/dist/chunks/context-BOjdTj0i.js +1 -0
- package/dist/chunks/context-noninteractive-Bd2HO-vU.js +1 -0
- package/dist/chunks/context-noninteractive-k2ibficU.js +54 -0
- package/dist/chunks/controlMessageCompat-BJhFiS7u.js +1 -0
- package/dist/chunks/conversation-BP0phkOY.js +1 -0
- package/dist/chunks/conversation-Ci8O_eZ-.js +1 -0
- package/dist/chunks/copy-B0VUJ2rH.js +7 -0
- package/dist/chunks/createSSHSession-DqmkCS_k.js +6 -0
- package/dist/chunks/createSession-B9MhWusY.js +1 -0
- package/dist/chunks/createSession-CJEsHz58.js +1 -0
- package/dist/chunks/cron-DiW7eIPP.js +1 -0
- package/dist/chunks/cronJitterConfig-BzPaa52I.js +6 -0
- package/dist/chunks/crossProjectResume-tWsqBUHc.js +40 -0
- package/dist/chunks/cwd--iizewsn.js +1 -0
- package/dist/chunks/cwd-BgpSJxd7.js +1 -0
- package/dist/chunks/daemon-VYRit6Aq.js +2 -0
- package/dist/chunks/dangerousBackend-BU_PHGR2.js +1 -0
- package/dist/chunks/datadog-Bd1s_VFj.js +1 -0
- package/dist/chunks/datadog-DJowkWhh.js +1 -0
- package/dist/chunks/debug-DM5ezCBS.js +1 -0
- package/dist/chunks/debug-UI3T040K.js +5 -0
- package/dist/chunks/debugUtils-BBMFODKH.js +1 -0
- package/dist/chunks/defineProperty-80gRi2ZW.js +1 -0
- package/dist/chunks/desktop-BDowrzvG.js +1 -0
- package/dist/chunks/detached-D300jlhj.js +5 -0
- package/dist/chunks/detect-libc-DNuQfUvI.js +1 -0
- package/dist/chunks/detectRepository-CBk3S2zv.js +1 -0
- package/dist/chunks/detectRepository-DCTvg4p0.js +1 -0
- package/dist/chunks/detection-CQsNad64.js +1 -0
- package/dist/chunks/detection-DJ-vTbBf.js +1 -0
- package/dist/chunks/diff-auU5sUOw.js +1 -0
- package/dist/chunks/directoryCompletion-DP_4B1GL.js +1 -0
- package/dist/chunks/dist-CanSxOZ1.js +5 -0
- package/dist/chunks/dist-Cg1a1Exw.js +29 -0
- package/dist/chunks/dist-Q7YNoZ0H.js +20 -0
- package/dist/chunks/dist-es-4z5T3Jzm.js +1 -0
- package/dist/chunks/dist-es-B2jg52tM2.js +1 -0
- package/dist/chunks/dist-es-B6OXHQ1S.js +1 -0
- package/dist/chunks/dist-es-B8NEy5hc.js +1 -0
- package/dist/chunks/dist-es-BVGppqE4.js +1 -0
- package/dist/chunks/dist-es-Bcw5GZko.js +1 -0
- package/dist/chunks/dist-es-BoIJpncb.js +9 -0
- package/dist/chunks/dist-es-Bu_Fshi1.js +1 -0
- package/dist/chunks/dist-es-C-1vn4OP2.js +1 -0
- package/dist/chunks/dist-es-C41b_0B5.js +1 -0
- package/dist/chunks/dist-es-CCZYybbG2.js +1 -0
- package/dist/chunks/dist-es-CLK1mey-.js +1 -0
- package/dist/chunks/dist-es-CQz2aNf72.js +1 -0
- package/dist/chunks/dist-es-CSfI8B8l.js +1 -0
- package/dist/chunks/dist-es-CUZBYppo.js +1 -0
- package/dist/chunks/dist-es-CZkzHpjF.js +1 -0
- package/dist/chunks/dist-es-Cbf0_D8d.js +5 -0
- package/dist/chunks/dist-es-ChHe-SVL.js +1 -0
- package/dist/chunks/dist-es-ClYOf0My.js +1 -0
- package/dist/chunks/dist-es-D-kJbj4A2.js +1 -0
- package/dist/chunks/dist-es-D1LN6CJd.js +1 -0
- package/dist/chunks/dist-es-DC1sC3ph.js +1 -0
- package/dist/chunks/dist-es-DGn8uOwQ2.js +1 -0
- package/dist/chunks/dist-es-DK5fTeKM2.js +1 -0
- package/dist/chunks/dist-es-DN7otr6F.js +1 -0
- package/dist/chunks/dist-es-DPM0mPK5.js +1 -0
- package/dist/chunks/dist-es-DqZAh3nG.js +1 -0
- package/dist/chunks/dist-es-DuAZyxJ02.js +5 -0
- package/dist/chunks/dist-es-HVQrM0oE.js +1 -0
- package/dist/chunks/dist-es-OVleIB54.js +1 -0
- package/dist/chunks/dist-es-UAs0rdXg.js +1 -0
- package/dist/chunks/dist-es-WvMMuHmx2.js +1 -0
- package/dist/chunks/dist-es-fjXft-jH.js +1 -0
- package/dist/chunks/dist-es-hdN_ShpZ.js +3 -0
- package/dist/chunks/dist-es-neiUvMJb.js +1 -0
- package/dist/chunks/dist-es-yMYpDtui2.js +1 -0
- package/dist/chunks/dist-es-zjcbuB72.js +1 -0
- package/dist/chunks/distRoot-CcxmnzqQ.js +1 -0
- package/dist/chunks/doctor-bKPp6AeL.js +1 -0
- package/dist/chunks/earlyInput-JGJo1zcC.js +1 -0
- package/dist/chunks/earlyInput-tRkbxFv2.js +2 -0
- package/dist/chunks/effort-BQj2QnnA.js +9 -0
- package/dist/chunks/entry-CUu6-QhT.js +14 -0
- package/dist/chunks/env-chR0gV31.js +1 -0
- package/dist/chunks/envLessBridgeConfig-CixkwbRF.js +1 -0
- package/dist/chunks/envLessBridgeConfig-Ju4W58xf.js +1 -0
- package/dist/chunks/envUtils-BWeoiL4Y.js +1 -0
- package/dist/chunks/escHotkey-Cyz0yyh1.js +259 -0
- package/dist/chunks/esm--xjzB1hI.js +1 -0
- package/dist/chunks/esm-B2HIF0XY.js +1 -0
- package/dist/chunks/esm-BGQPWnJy.js +1 -0
- package/dist/chunks/esm-C-1qL9Mn.js +1 -0
- package/dist/chunks/esm-C3jcs1DH.js +1 -0
- package/dist/chunks/esm-C97WL9nC.js +1 -0
- package/dist/chunks/esm-CIL-SKM8.js +1 -0
- package/dist/chunks/esm-CJlBxjtx.js +1 -0
- package/dist/chunks/esm-CsGLyWmS.js +56 -0
- package/dist/chunks/esm-DQHmDm-H.js +1 -0
- package/dist/chunks/esm-DcdOXSzi.js +1 -0
- package/dist/chunks/esm-DhNYgGTV.js +1 -0
- package/dist/chunks/esm-DxPW7qPs.js +1 -0
- package/dist/chunks/esm-FBUWr3vI.js +1 -0
- package/dist/chunks/esm-QgL6y---.js +10 -0
- package/dist/chunks/esm-v0kPjgVS.js +1 -0
- package/dist/chunks/esm-vIn-YV_h.js +1 -0
- package/dist/chunks/event-streams-BV7ngMXu.js +1 -0
- package/dist/chunks/eventLoopStallDetector-Dnh1fc31.js +1 -0
- package/dist/chunks/execAsync-BkA6ogic.js +1 -0
- package/dist/chunks/execFileNoThrow-CuQN1sz8.js +1 -0
- package/dist/chunks/execSyncWrapper-C2XQnFVo.js +1 -0
- package/dist/chunks/execa-CGue6Z3n.js +34 -0
- package/dist/chunks/executor-4EeD8GNm.js +1561 -0
- package/dist/chunks/executor-BHEuNh5F.js +1 -0
- package/dist/chunks/exit-DijkO8eo.js +1 -0
- package/dist/chunks/exit-_obETqBv.js +2 -0
- package/dist/chunks/export-DA-bBZkX.js +2 -0
- package/dist/chunks/exportRenderer-3y4tGdSB.js +1 -0
- package/dist/chunks/extra-usage-CS6VwKJt.js +1 -0
- package/dist/chunks/extra-usage-DGHEQOrY.js +1 -0
- package/dist/chunks/extra-usage-core-DOgT4u4i.js +1 -0
- package/dist/chunks/extra-usage-noninteractive-DYnfiRlV.js +1 -0
- package/dist/chunks/extraUsage-CfxgfpX_.js +1 -0
- package/dist/chunks/extractMemories-jvjCvtpC.js +1 -0
- package/dist/chunks/fast-Bbtx_Bs1.js +1 -0
- package/dist/chunks/fast-CzRUJBTK.js +1 -0
- package/dist/chunks/featureCheck-Cm0YNDXO.js +1 -0
- package/dist/chunks/featureCheck-p7OeCYzj.js +1 -0
- package/dist/chunks/feedback-FoXtdHAV.js +1 -0
- package/dist/chunks/figures-gfT9mM8P.js +1 -0
- package/dist/chunks/fileStateCache-C7-TxF8G.js +1 -0
- package/dist/chunks/files-DYvAZGxp.js +2 -0
- package/dist/chunks/firstPartyEventLogger-KIwaBY-E.js +1 -0
- package/dist/chunks/flushGate-C2Icy43G.js +1 -0
- package/dist/chunks/foundry-sdk-BFN5VDFQ.js +1 -0
- package/dist/chunks/fpsMetrics-DeezdcwV.js +1 -0
- package/dist/chunks/fuse-Ch_OAlm3.js +1 -0
- package/dist/chunks/gates-CbQLZHtm.js +1 -0
- package/dist/chunks/gates-DSI3vpwO.js +1 -0
- package/dist/chunks/gemini-BrNJGX4k.js +1 -0
- package/dist/chunks/generateRecap-B0fvSCjo.js +1 -0
- package/dist/chunks/generateSessionName-DvRYa39O.js +1 -0
- package/dist/chunks/genericProcessUtils-BGvcwuPt.js +23 -0
- package/dist/chunks/getMachineId-bsd-BMtYGBUL.js +1 -0
- package/dist/chunks/getMachineId-darwin-CiLdFH7z.js +2 -0
- package/dist/chunks/getMachineId-linux-Cr27rIeY.js +1 -0
- package/dist/chunks/getMachineId-unsupported-ceiBLwAN.js +1 -0
- package/dist/chunks/getMachineId-win-DFTmsQHq.js +1 -0
- package/dist/chunks/git-CN3qtTb_.js +6 -0
- package/dist/chunks/git-D23Mzu_K.js +1 -0
- package/dist/chunks/githubRepoPathMapping-Dut3d6nn.js +1 -0
- package/dist/chunks/graceful-fs-Cgc0rjGF.js +2 -0
- package/dist/chunks/grok-Ftoheab3.js +1 -0
- package/dist/chunks/growthbook-BynnuVTn.js +1 -0
- package/dist/chunks/hash-BRmOQc3c.js +1 -0
- package/dist/chunks/heapdump-hQ_w0LPC.js +5 -0
- package/dist/chunks/help-DQsHHv6r.js +1 -0
- package/dist/chunks/hooks-BLLL4iPv.js +1 -0
- package/dist/chunks/hooks-BhVDc8yb.js +79 -0
- package/dist/chunks/hostAdapter-D1eWmmhu.js +1 -0
- package/dist/chunks/hostGuard-zim_4F9V.js +1 -0
- package/dist/chunks/httpAuthSchemes-Wq4XWeLL.js +13 -0
- package/dist/chunks/ide-CPmMXLL-.js +2 -0
- package/dist/chunks/inboundAttachments-Bmf6vYsE.js +1 -0
- package/dist/chunks/inboundAttachments-D-p91z3w.js +1 -0
- package/dist/chunks/index.min-BJnb9GQI.js +1 -0
- package/dist/chunks/initReplBridge-BiHXpDEY.js +1 -0
- package/dist/chunks/insights-CTlTyvjj.js +822 -0
- package/dist/chunks/install-IPuD3Lq8.js +1 -0
- package/dist/chunks/install-github-app-Bmu_sA9e.js +147 -0
- package/dist/chunks/install-slack-app-Rfl81Jqo.js +1 -0
- package/dist/chunks/instinctParser-DHMa8xa0.js +1 -0
- package/dist/chunks/instrumentation-DWwmOmr0.js +12 -0
- package/dist/chunks/intl-Pse97ORk.js +1 -0
- package/dist/chunks/isObject-DaxDnPKm.js +1 -0
- package/dist/chunks/isSymbol-Dp3irZaY.js +1 -0
- package/dist/chunks/job-BXEt0izn.js +2 -0
- package/dist/chunks/json-bigint-OxRwRvup.js +8 -0
- package/dist/chunks/jsx-runtime-D-D469L8.js +1 -0
- package/dist/chunks/jws-2vqRyZtR.js +3 -0
- package/dist/chunks/jwtUtils-CpXwh_du.js +1 -0
- package/dist/chunks/keybindings-DRDgVvqz.js +2 -0
- package/dist/chunks/lang-D3ZHlfT6.js +1 -0
- package/dist/chunks/language-B_-BfBT4.js +1 -0
- package/dist/chunks/language-DcSjogBx.js +1 -0
- package/dist/chunks/launchAgentsPlatform-BPm_VMln.js +1 -0
- package/dist/chunks/launchAutofixPr-D2qac07g.js +2 -0
- package/dist/chunks/launchCommand-Du91jxMC.js +1 -0
- package/dist/chunks/launchLocalMemory-D_hBbXKE.js +3 -0
- package/dist/chunks/launchLocalVault-CPzNWvQ9.js +3 -0
- package/dist/chunks/launchMemoryStores-Djq2KhKb.js +1 -0
- package/dist/chunks/launchOnboarding-Bh6E7vdc.js +8 -0
- package/dist/chunks/launchSchedule-C988bQ-5.js +1 -0
- package/dist/chunks/launchSkillStore-DqrP6Gme.js +1 -0
- package/dist/chunks/launchTeleport-DFhybaq_.js +3 -0
- package/dist/chunks/launchVault-p_CSK4ZQ.js +1 -0
- package/dist/chunks/lazySchema-2sOku3cX.js +1 -0
- package/dist/chunks/lib-B4Q0Nrpb.js +14 -0
- package/dist/chunks/lib-Ca3QWJjN.js +2 -0
- package/dist/chunks/lib-inCisXen.js +8 -0
- package/dist/chunks/loadAgentsDir-Ci5mr0vm.js +4601 -0
- package/dist/chunks/loadAgentsDir-vB1QEZ7H.js +1 -0
- package/dist/chunks/loadPluginHooks-xYCEZ6t5.js +1 -0
- package/dist/chunks/loadSso-sDs471GC.js +1 -0
- package/dist/chunks/localSearch-DtVqtfvk.js +1 -0
- package/dist/chunks/localSearch-Vpn6W5aY.js +1 -0
- package/dist/chunks/lockfile-DBwdlC3K.js +1 -0
- package/dist/chunks/log-CzsijfHZ.js +1 -0
- package/dist/chunks/login-D-N78G6r.js +1 -0
- package/dist/chunks/login-D9IWjvza.js +1 -0
- package/dist/chunks/logoV2Utils-SAulcC5x.js +1 -0
- package/dist/chunks/logout-CFggVS-9.js +1 -0
- package/dist/chunks/magicDocs-BfoeYhin.js +57 -0
- package/dist/chunks/main-C6be1KFk.js +31 -0
- package/dist/chunks/main-DhMlhVj3.js +1108 -0
- package/dist/chunks/mappers-uIrAj-Wd.js +1 -0
- package/dist/chunks/mcp-CAYGNxCb.js +1 -0
- package/dist/chunks/mcp-COQap0SM.js +6 -0
- package/dist/chunks/mcp-DlM0OC6R.js +2 -0
- package/dist/chunks/mcpServer-1SnOWb8_.js +1 -0
- package/dist/chunks/mcpServer-DXvS3v4x.js +1 -0
- package/dist/chunks/memoize-DNnuA2aU.js +1 -0
- package/dist/chunks/memoize-DxwLawI2.js +1 -0
- package/dist/chunks/memory-XccPLQLt.js +1 -0
- package/dist/chunks/mobile-umu5P0cM.js +2 -0
- package/dist/chunks/modalContext-CmSKRyea.js +1 -0
- package/dist/chunks/model-CbiDGGJU.js +1 -0
- package/dist/chunks/model-DdbcxKub.js +1 -0
- package/dist/chunks/normalization-Cox8C0dP.js +1 -0
- package/dist/chunks/oauth-CdZEzMww.js +1 -0
- package/dist/chunks/oauth-CmensepG.js +1 -0
- package/dist/chunks/observationStore-tvkldXUo.js +4 -0
- package/dist/chunks/onChangeAppState-Dp0JIXd8.js +1 -0
- package/dist/chunks/open-CDditBQ-.js +1 -0
- package/dist/chunks/openai-6KcHd4Hw.js +10 -0
- package/dist/chunks/openaiShared-D5lOejS1.js +16 -0
- package/dist/chunks/output-style-XDb9-2Kk.js +1 -0
- package/dist/chunks/overageCreditGrant-DYiB4sr-.js +1 -0
- package/dist/chunks/p-map-9Ud1LOrJ.js +1 -0
- package/dist/chunks/p-map-D7WEmnBE.js +1 -0
- package/dist/chunks/package-BhL7chzt.js +1 -0
- package/dist/chunks/panel-ByW1omJn.js +1 -0
- package/dist/chunks/panel-Bz_8td5D.js +1 -0
- package/dist/chunks/parseConnectUrl-BS6i9JPo.js +1 -0
- package/dist/chunks/parser-CmngCwjB.js +1 -0
- package/dist/chunks/parser-SWIZo39J.js +1 -0
- package/dist/chunks/passes-Cbc6T_Tj.js +1 -0
- package/dist/chunks/path-C4kbwvSH.js +1 -0
- package/dist/chunks/paths-Q2255dD7.js +39 -0
- package/dist/chunks/permissions-BLzPHh_3.js +3 -0
- package/dist/chunks/permissions-DXLfdE7b.js +1 -0
- package/dist/chunks/permissions-Ps_D01ZB.js +1 -0
- package/dist/chunks/pipeTransport-D7NIp3aA.js +1 -0
- package/dist/chunks/plan-DloFVJK7.js +1 -0
- package/dist/chunks/platform-CuyedWpe.js +2 -0
- package/dist/chunks/plist-BO4ZqMZc.js +6 -0
- package/dist/chunks/plugin-XR9IBPMM.js +1 -0
- package/dist/chunks/pluginAutoupdate-Cr9hP0zG.js +1 -0
- package/dist/chunks/pluginBlocklist-CM9uP8CY.js +1 -0
- package/dist/chunks/pluginCliCommands-BQkrvES5.js +1 -0
- package/dist/chunks/pluginFlagging-CJ1--2Kw.js +1 -0
- package/dist/chunks/pluginOperations-B0rLuSvo.js +2 -0
- package/dist/chunks/pluginStartupCheck-Bjdc8zhz.js +1 -0
- package/dist/chunks/pluginStartupCheck-Cu2ezD51.js +1 -0
- package/dist/chunks/plugins-BgOP_8TX.js +4 -0
- package/dist/chunks/policyLimits-CKy_gTEt.js +1 -0
- package/dist/chunks/pollConfig-DhptuhFw.js +1 -0
- package/dist/chunks/poller-Ds0Y6Cir.js +1 -0
- package/dist/chunks/poor-DF0aqXDx.js +1 -0
- package/dist/chunks/poorMode-C5Frra4j.js +1 -0
- package/dist/chunks/poorMode-DJvjO2nW.js +1 -0
- package/dist/chunks/postCommitAttribution-Ehmwzzuq.js +1 -0
- package/dist/chunks/print-CPtR0KTa.js +39 -0
- package/dist/chunks/privacy-settings-e-7lc7Un.js +1 -0
- package/dist/chunks/process-CWupreF6.js +1 -0
- package/dist/chunks/process-DMKLUQIO.js +1 -0
- package/dist/chunks/processBashCommand-D5dC6Mya.js +1 -0
- package/dist/chunks/processSlashCommand-DHRUtZ-C.js +6 -0
- package/dist/chunks/projectContext-0fpRKUeH.js +1 -0
- package/dist/chunks/projectContext-eXMSfgdZ.js +1 -0
- package/dist/chunks/prompt-4tea6NJQ.js +54 -0
- package/dist/chunks/prompt-CQC-mh6u.js +1 -0
- package/dist/chunks/prompt-DEPUnJdB.js +222 -0
- package/dist/chunks/prompt-DawxLANl.js +1 -0
- package/dist/chunks/promptEditor-Ci-h04-5.js +4 -0
- package/dist/chunks/protocolHandler-DhqM32qE.js +13 -0
- package/dist/chunks/protocols-CAyQOlkr.js +7 -0
- package/dist/chunks/proxy-CfZp-wce.js +99 -0
- package/dist/chunks/rate-limit-options-B0l29Zx8.js +1 -0
- package/dist/chunks/rcDebugLog-BbPkkigY.js +11 -0
- package/dist/chunks/referral-ByevBJrE.js +1 -0
- package/dist/chunks/refresh-B_CwwIRX.js +1 -0
- package/dist/chunks/registerProtocol-DzhaQH02.js +36 -0
- package/dist/chunks/registry-DkHA4cRu.js +1 -0
- package/dist/chunks/release-notes-CZthYkei.js +4 -0
- package/dist/chunks/releaseNotes-CwKpIsyd.js +2 -0
- package/dist/chunks/reload-plugins-DxWfXvrN.js +1 -0
- package/dist/chunks/remote-env-BiRLWIrh.js +1 -0
- package/dist/chunks/remoteBridgeCore-nz1fPY1U.js +1 -0
- package/dist/chunks/remoteControlServer-FzLUxh2B.js +3 -0
- package/dist/chunks/rename-DmGuyncE.js +1 -0
- package/dist/chunks/renderOptions-BiyC2rj1.js +1 -0
- package/dist/chunks/resume-7GeU7RMS.js +2 -0
- package/dist/chunks/rewind-CXplHgh_.js +1 -0
- package/dist/chunks/rollback-DbSpxmJE.js +11 -0
- package/dist/chunks/runtimeObserver-Duod-ign.js +10 -0
- package/dist/chunks/runtimeObserver-OgM9ZYxZ.js +1 -0
- package/dist/chunks/sandbox-adapter-CxkhKgaa.js +1 -0
- package/dist/chunks/sandbox-toggle-Cc96R6Ox.js +1 -0
- package/dist/chunks/sanitization-CYp-9DbE.js +1 -0
- package/dist/chunks/satisfies-BaHgd_ie.js +1 -0
- package/dist/chunks/schemas-BGAvj1T4.js +40 -0
- package/dist/chunks/sdk-DEtgRZvI.js +1 -0
- package/dist/chunks/sdkHeapDumpMonitor--fevrC5z.js +1 -0
- package/dist/chunks/searchExtraTools-DQ6e601b.js +1 -0
- package/dist/chunks/semver-Cq33BYay.js +1 -0
- package/dist/chunks/semver-Tw0AFar5.js +1 -0
- package/dist/chunks/sentry-BUHYuYGj.js +13 -0
- package/dist/chunks/server-C5XZSlto.js +1 -0
- package/dist/chunks/server-DzOdtq8A.js +1 -0
- package/dist/chunks/serverBanner-WlSYP-f8.js +1 -0
- package/dist/chunks/serverLog-DtsUvDiY.js +1 -0
- package/dist/chunks/session-DgLqm7ZI.js +2 -0
- package/dist/chunks/sessionDataUploader-Ctjo1bgR.js +1 -0
- package/dist/chunks/sessionDiscovery-DgNea6qa.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-7Svz-7S-.js +1 -0
- package/dist/chunks/sessionManager-Dw72ZUTg.js +1 -0
- package/dist/chunks/sessionMemory-DIrR3zvb.js +1 -0
- package/dist/chunks/sessionMemory-_dmj8lcH.js +1 -0
- package/dist/chunks/sessionMemoryUtils-BdQtSkRx.js +1 -0
- package/dist/chunks/sessionObserver-CuWMVPlT.js +20 -0
- package/dist/chunks/sessionObserver-_adufOGQ.js +1 -0
- package/dist/chunks/sessionStorage-W7okgAlQ.js +1 -0
- package/dist/chunks/sessionStoragePortable-BI9q2WcJ.js +3 -0
- package/dist/chunks/sessionTitle-DzkMzHer.js +14 -0
- package/dist/chunks/sessionTracing-DTjmc0EF.js +11 -0
- package/dist/chunks/settingsSync-CfYDkakY.js +1 -0
- package/dist/chunks/setup-BKUG46jQ.js +9 -0
- package/dist/chunks/setup-CmLngvpJ.js +1 -0
- package/dist/chunks/setup-TqJ7-Nxh.js +2 -0
- package/dist/chunks/shadowedRuleDetection-DesT0yKM.js +1 -0
- package/dist/chunks/shellQuote-DgjT8KBA.js +1 -0
- package/dist/chunks/sideQuestion-BAq0YyKY.js +20 -0
- package/dist/chunks/signin-QEeYpJZw.js +1 -0
- package/dist/chunks/sink-B3uP8Cf8.js +1 -0
- package/dist/chunks/sink-CaWMZBw_.js +1 -0
- package/dist/chunks/sinks-COcy5GnB.js +2 -0
- package/dist/chunks/sinks-oFfsKySL.js +1 -0
- package/dist/chunks/skill-learning-DOIMPtWE.js +5 -0
- package/dist/chunks/skillChangeDetector-CA_Tdx8N.js +1 -0
- package/dist/chunks/skillGapStore-CWuw1dYh.js +1 -0
- package/dist/chunks/skillGapStore-DpEoKhn-.js +5 -0
- package/dist/chunks/skillGenerator-9y3Q4YoO.js +8 -0
- package/dist/chunks/skillLearning-BhM09bQD.js +1 -0
- package/dist/chunks/skillLearning-_o2D06yM.js +1 -0
- package/dist/chunks/skillPanel-Dt24mZTZ.js +28 -0
- package/dist/chunks/skillSearchPanel-gaXN64Fu.js +21 -0
- package/dist/chunks/skills-Dx3dMHYk.js +1 -0
- package/dist/chunks/slashCommandParsing-Cari0pNg.js +1 -0
- package/dist/chunks/sleep-8Eb9j_Ly.js +1 -0
- package/dist/chunks/sprites-5OAB-Ui2.js +1 -0
- package/dist/chunks/src-BIPP3_mo.js +26 -0
- package/dist/chunks/src-BJz1KAd_.js +6 -0
- package/dist/chunks/src-BRAdBA8A.js +1 -0
- package/dist/chunks/src-BRC_BuUP.js +1 -0
- package/dist/chunks/src-BaB-bpCj.js +5 -0
- package/dist/chunks/src-BlLavFUS.js +7 -0
- package/dist/chunks/src-C5yhFG0C.js +19 -0
- package/dist/chunks/src-CI_jaaBj.js +2 -0
- package/dist/chunks/src-CRsA-Z4y.js +1 -0
- package/dist/chunks/src-CYLfL70h.js +1 -0
- package/dist/chunks/src-DJXCzwyJ.js +1 -0
- package/dist/chunks/src-DJXKJavk.js +1 -0
- package/dist/chunks/src-Di342QoJ.js +53 -0
- package/dist/chunks/src-DsMd9Q9e.js +2 -0
- package/dist/chunks/src-DzH9IdOo.js +1 -0
- package/dist/chunks/src-hdbPEvzO.js +9 -0
- package/dist/chunks/src-poaoYkuc.js +1 -0
- package/dist/chunks/src-x7u_sB6m.js +1 -0
- package/dist/chunks/sso-oidc-BX1MlBX0.js +1 -0
- package/dist/chunks/startupProfiler-DnXZaX4A.js +3 -0
- package/dist/chunks/startupProfiler-SOE--nM9.js +1 -0
- package/dist/chunks/state-B2GIOsTB.js +1 -0
- package/dist/chunks/state-Ce1HlR-H.js +1 -0
- package/dist/chunks/state-sIHsFpDu.js +1 -0
- package/dist/chunks/staticRender-Br64h1E1.js +1 -0
- package/dist/chunks/stats-TUExo9iU.js +1 -0
- package/dist/chunks/status-Dghaz1my.js +1 -0
- package/dist/chunks/statusNoticeHelpers-DVZSSXeK.js +1 -0
- package/dist/chunks/stdio-BEEzuxaZ.js +1 -0
- package/dist/chunks/stdio-D4cT86R0.js +3 -0
- package/dist/chunks/stickers-2K05wjSp.js +1 -0
- package/dist/chunks/store-DhI7Lcan.js +1 -0
- package/dist/chunks/sts-BDFJ-6QE.js +1 -0
- package/dist/chunks/subprocessEnv-CggQWZCx.js +1 -0
- package/dist/chunks/subprocessEnv-DV6q6o6w.js +1 -0
- package/dist/chunks/supports-color-lkzOMQ6u.js +1 -0
- package/dist/chunks/systemPromptSections-BcN_XBTx.js +1 -0
- package/dist/chunks/systemPromptSections-DB93ZNWP.js +1 -0
- package/dist/chunks/systemTheme-dDbitcxB.js +1 -0
- package/dist/chunks/tag-ZcVkzFjz.js +11 -0
- package/dist/chunks/tasks-DbB33ekt.js +1 -0
- package/dist/chunks/teamHelpers-BmN9nKz-.js +1 -0
- package/dist/chunks/teamHelpers-yeTNtZbb.js +1 -0
- package/dist/chunks/teammate-DMYOtLTK.js +1 -0
- package/dist/chunks/teammateModeSnapshot-CPjJJDL1.js +1 -0
- package/dist/chunks/teammateModeSnapshot-CsNIJTKi.js +1 -0
- package/dist/chunks/teleport-JHgpwZIh.js +1 -0
- package/dist/chunks/templateJobs-Db630FZD.js +12 -0
- package/dist/chunks/terminalSetup-DJqWE8fc.js +33 -0
- package/dist/chunks/terminalSetup-ygKHrVKR.js +1 -0
- package/dist/chunks/theme-MmfFhdTD.js +1 -0
- package/dist/chunks/thinkback-CrNirB0V.js +1 -0
- package/dist/chunks/thinkback-Quc7KPmi.js +1 -0
- package/dist/chunks/thinkback-play-CQ1s7oqg.js +1 -0
- package/dist/chunks/tmux-CvbhsfwG.js +1 -0
- package/dist/chunks/toolEventObserver-BqMplcIk.js +1 -0
- package/dist/chunks/toolEventObserver-DBq2XBYY.js +1 -0
- package/dist/chunks/toolPool-BkCtTKXz.js +1 -0
- package/dist/chunks/toolPool-C7bOwJfR.js +1 -0
- package/dist/chunks/trustedDevice-C9Zevohz.js +1 -0
- package/dist/chunks/trustedDevice-DEuQUTbz.js +1 -0
- package/dist/chunks/tui-BVc2q4Xv.js +6 -0
- package/dist/chunks/turndown.es-Bv06VjMb.js +69 -0
- package/dist/chunks/types-CQ1wrnQ0.js +1 -0
- package/dist/chunks/types-Csi32ZXh.js +17 -0
- package/dist/chunks/types-RJTEOuIt.js +3 -0
- package/dist/chunks/udsClient-BvG_Jip0.js +1 -0
- package/dist/chunks/ultrareviewCommand-DrlfRrXq.js +3 -0
- package/dist/chunks/undercover-CBeHiWUd.js +1 -0
- package/dist/chunks/undercover-DKn95mh9.js +31 -0
- package/dist/chunks/up-D-U4wUCe.js +12 -0
- package/dist/chunks/updateCCB-CJ7dCUan.js +11 -0
- package/dist/chunks/upgrade-Degqbu8S.js +1 -0
- package/dist/chunks/upgrade-ucJ-lnlY.js +1 -0
- package/dist/chunks/upload-pTZQCPLt.js +1 -0
- package/dist/chunks/upstreamproxy-DcLeL2XX.js +11 -0
- package/dist/chunks/usage-D96a7Cke.js +1 -0
- package/dist/chunks/usage-DVQMUMcC.js +1 -0
- package/dist/chunks/useKeybinding-FsOnjW6T.js +1 -0
- package/dist/chunks/useMainLoopModel-B7ch2o9K.js +1 -0
- package/dist/chunks/useManagePlugins-BfGzHMvO.js +1 -0
- package/dist/chunks/useMergedTools-TemEvCrX.js +1 -0
- package/dist/chunks/useSearchInput-B-V4kIa-.js +1 -0
- package/dist/chunks/useSettingsErrors-B2JGz1s8.js +1 -0
- package/dist/chunks/useVoice-BuwYDm2U.js +1 -0
- package/dist/chunks/util-CeIKZmj9.js +1 -0
- package/dist/chunks/utils-CwhszpkT.js +1 -0
- package/dist/chunks/v4-f1i_CNUT.js +1 -0
- package/dist/chunks/validatePlugin-BlVho93x.js +1 -0
- package/dist/chunks/vertex-sdk-CSGw3fvU.js +9 -0
- package/dist/chunks/vim-DUZQCWUP.js +1 -0
- package/dist/chunks/voice-BkRIHZiM.js +2 -0
- package/dist/chunks/voice-DXiiy8HX.js +8 -0
- package/dist/chunks/voiceModeEnabled-CPQUE3PU.js +1 -0
- package/dist/chunks/voiceModeEnabled-DB8GCzAF.js +1 -0
- package/dist/chunks/voiceStreamSTT-DgoDscHn.js +1 -0
- package/dist/chunks/voiceStreamSTT-Dr_wH1Kh.js +1 -0
- package/dist/chunks/which-DqSAIvp2.js +1 -0
- package/dist/chunks/windowsPaths-C9CigqoF.js +1 -0
- package/dist/chunks/windowsPaths-swxCp7bX.js +2 -0
- package/dist/chunks/workSecret-mS2OrpxF.js +1 -0
- package/dist/chunks/workerRegistry-CT7_kjvY.js +1 -0
- package/dist/chunks/worktree-DU3xtwKW.js +1 -0
- package/dist/chunks/worktreeModeEnabled-Db6b_Iy_.js +1 -0
- package/dist/chunks/worktreeModeEnabled-THQb19xR.js +1 -0
- package/dist/chunks/wrapper-BSK0MCQH.js +1 -0
- package/dist/chunks/wrapper-D5qL1aQL.js +6 -0
- package/dist/chunks/xdg-CBxMmQux.js +1 -0
- package/dist/chunks/xml-DD_ldd3X.js +1 -0
- package/dist/chunks/zod-DT6hytkp.js +1 -0
- package/dist/cli.js +1 -10934
- package/package.json +1 -1
|
@@ -0,0 +1,1108 @@
|
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,t as a}from"./chunk-DR8-3Aex.js";import{n as o,t as s}from"./memoize-DNnuA2aU.js";import{c,d as l,f as u,o as d,p as f,s as p,u as m}from"./envUtils-BWeoiL4Y.js";import{n as h,t as ee}from"./defineProperty-80gRi2ZW.js";import{n as g,t as te}from"./axios-DhfaybwJ.js";import{i as ne,t as re}from"./src-BJz1KAd_.js";import{Ln as _,Mn as ie,Mr as ae,Tt as oe,Xn as se,Yn as v,vt as y,wn as ce,xt as le}from"./schemas-BGAvj1T4.js";import{t as ue}from"./v4-f1i_CNUT.js";import{C as de,In as b,Jt as fe,Ln as pe,Q as me,Rn as he,S as ge,b as _e,dn as ve,f as ye,g as be,h as x,t as xe,x as Se}from"./src-Di342QoJ.js";import{t as S}from"./jsx-runtime-D-D469L8.js";import{An as Ce,Cn as we,Cr as Te,Ct as Ee,En as De,Er as Oe,Gn as ke,Hn as Ae,Hr as je,Kn as Me,Ln as Ne,Mn as Pe,Nn as Fe,Rn as Ie,Sr as C,Tn as Le,U as Re,Un as ze,Vr as w,Wn as Be,bt as Ve,cn as T,et as He,hr as Ue,jr as We,kn as Ge,kr as Ke,lr as qe,nr as Je,ot as Ye,rr as Xe,tn as Ze,tr as Qe,vr as $e,vt as et,wr as tt,xr as nt,y as rt,yr as it,z as at}from"./state-sIHsFpDu.js";import{$o as ot,Aa as st,Ac as E,Al as ct,At as lt,Br as ut,C as dt,Cr as ft,D as pt,Di as mt,Dl as ht,Fa as D,Fl as gt,Fr as _t,Gn as vt,Il as yt,Ja as bt,Jt as xt,Ka as St,Ko as Ct,Ln as wt,Lr as Tt,Ma as O,Mc as Et,Na as k,Nc as Dt,Nl as Ot,Nn as kt,Nr as At,Ns as jt,Oc as Mt,Oi as Nt,Ol as Pt,Pc as A,Pl as Ft,Po as It,Pr as Lt,Qa as Rt,Rn as zt,S as Bt,Sc as j,So as Vt,T as Ht,Tn as Ut,Tt as Wt,Vt as Gt,Xi as Kt,Yn as qt,Za as Jt,Zi as Yt,_ as Xt,_c as Zt,_o as Qt,_t as $t,a as M,an as en,ao as tn,bc as nn,bl as rn,bn as an,ct as N,dn as on,dr as sn,eo as cn,gc as ln,gn as un,go as dn,hi as fn,ic as pn,it as mn,jc as hn,jo as gn,jt as _n,kl as vn,lo as P,lt as yn,mr as bn,n as xn,nc as Sn,no as Cn,on as wn,oo as F,or as Tn,ot as I,pa as En,po as Dn,pr as On,qo as kn,rs as An,rt as jn,s as Mn,st as Nn,tn as Pn,ua as Fn,uo as In,vi as Ln,vt as Rn,wn as zn,wt as Bn,x as Vn,xc as Hn,xi as Un,xo as Wn,yl as Gn,yn as Kn,yt as qn,zn as Jn,zr as Yn}from"./paths-Q2255dD7.js";import{E as Xn,F as Zn,K as Qn,L,O as $n,R as er,T as tr,U as nr,V as rr,X as ir,Y as ar,d as R,f as or,h as sr,i as cr,j as lr,p as ur,s as dr,t as fr,w as pr,y as mr}from"./debug-UI3T040K.js";import{n as z,r as B}from"./analytics-DqMQntaB.js";import{n as hr,t as gr}from"./cwd--iizewsn.js";import{a as _r,n as vr,r as yr}from"./process-DMKLUQIO.js";import{F as V,P as br,f as xr,g as Sr,i as Cr,m as wr,r as Tr,v as Er}from"./git-CN3qtTb_.js";import{l as Dr,s as Or,u as kr}from"./oauth-CdZEzMww.js";import{n as Ar,t as jr}from"./bundledMode-kSQejuY4.js";import{r as Mr,t as Nr}from"./execa-CGue6Z3n.js";import{n as Pr,t as Fr}from"./which-DqSAIvp2.js";import{d as Ir,f as Lr,o as Rr,s as H}from"./log-CzsijfHZ.js";import{i as zr,o as Br}from"./platform-CuyedWpe.js";import{i as Vr,n as Hr}from"./windowsPaths-swxCp7bX.js";import{s as Ur,u as Wr}from"./types-Csi32ZXh.js";import{C as Gr,b as Kr,l as qr,x as Jr}from"./teammate-DMYOtLTK.js";import{a as U,f as Yr,n as Xr,o as Zr,x as Qr}from"./startupProfiler-DnXZaX4A.js";import{n as $r,t as ei}from"./lazySchema-2sOku3cX.js";import{r as ti}from"./permissions-DXLfdE7b.js";import{g as ni,n as ri,p as ii,u as ai}from"./proxy-CfZp-wce.js";import{$C as oi,$T as si,$f as ci,$k as li,A as ui,AC as di,AE as fi,AS as pi,Ab as mi,Ar as hi,BC as gi,Ba as _i,Bf as vi,Bi as yi,CC as bi,Ci as xi,Ck as Si,Cv as Ci,Cx as wi,DC as Ti,DO as Ei,Dl as Di,Ds as Oi,Dx as ki,E as Ai,EC as ji,El as Mi,Es as Ni,FC as Pi,FE as Fi,FT as Ii,Fc as Li,Fp as Ri,GE as zi,GT as W,G_ as Bi,Gi as Vi,HC as Hi,HE as Ui,HT as Wi,Ha as Gi,Hm as Ki,IC as qi,IT as Ji,Ip as Yi,JC as Xi,JE as Zi,JO as Qi,JS as $i,Jk as ea,KT as ta,K_ as na,Ka as ra,Kl as ia,Ku as aa,L as oa,LE as sa,L_ as ca,Lc as la,Lo as ua,M as da,MC as fa,MT as pa,Mi as ma,Mk as ha,NC as ga,NT as _a,Ni as va,Nk as ya,Nn as ba,OC as xa,Oo as Sa,Ot as Ca,P as wa,PC as Ta,PT as Ea,QC as Da,QT as Oa,Qg as ka,RA as Aa,RC as ja,R_ as Ma,Ra as Na,Rn as Pa,Si as Fa,St as Ia,Sv as La,Sx as Ra,T as za,TC as Ba,TO as Va,Ts as Ha,Tt as Ua,UE as Wa,Ua as Ga,Um as Ka,VC as qa,VE as Ja,VT as Ya,Va as Xa,WO as Za,Wk as Qa,XC as $a,XT as eo,Xg as to,Xi as no,YA as ro,YS as io,YT as ao,Yr as oo,ZA as so,ZT as co,Zg as lo,Zk as uo,Zn as fo,_a as po,_k as mo,_o as ho,aE as go,aT as _o,af as vo,av as yo,aw as bo,ay as xo,b as So,bo as Co,br as wo,cA as To,cE as Eo,cS as Do,cT as Oo,cc as ko,cd as Ao,cj as jo,cs as Mo,ct as No,cw as Po,cy as Fo,dj as Io,dk as Lo,dp as Ro,dv as zo,dw as Bo,eE as Vo,e_ as Ho,ep as Uo,ew as Wo,fA as Go,fT as Ko,fk as qo,fs as Jo,fv as Yo,fw as Xo,gA as Zo,gE as Qo,ga as G,gh as $o,gv as es,gw as ts,gx as ns,hE as rs,ha as K,hh as is,hi as as,hv as os,i as ss,iA as cs,iT as ls,iy as us,jC as ds,jS as fs,jT as ps,jb as ms,jd as hs,k as gs,kC as _s,lA as vs,lT as ys,lp as bs,lv as xs,lw as Ss,ly as Cs,mS as ws,ms as Ts,mv as Es,n_ as Ds,nj as Os,ns as ks,nv as As,nw as js,o as Ms,oE as Ns,of as Ps,p as Fs,pT as Is,pd as Ls,pk as Rs,pv as zs,qT as Bs,q_ as Vs,qi as Hs,ql as Us,qu as Ws,r as Gs,rv as Ks,rw as qs,s as Js,sE as Ys,sT as Xs,sd as Zs,st as Qs,sw as $s,tA as ec,t_ as tc,ts as nc,tw as rc,uT as ic,uc as ac,ud as oc,uv as sc,uy as cc,va as lc,vh as uc,vi as dc,vv as fc,vw as pc,w as mc,wr as hc,ws as gc,wt as _c,wv as vc,wx as yc,xC as bc,xk as xc,y as Sc,ya as Cc,yk as wc,yv as Tc,zA as Ec,zC as Dc,za as Oc,zf as kc,zn as Ac}from"./loadAgentsDir-Ci5mr0vm.js";import{$t as jc,D as Mc,E as Nc,Kt as Pc,M as Fc,Mt as Ic,P as Lc,Qt as Rc,S as zc,Xt as Bc,Zt as Vc,_t as Hc,jt as Uc,tn as Wc,vt as Gc,w as Kc,yt as qc}from"./prompt-DEPUnJdB.js";import{h as Jc,p as Yc}from"./xml-DD_ldd3X.js";import{C as Xc,D as Zc,O as Qc,y as $c}from"./rcDebugLog-BbPkkigY.js";import{D as el,O as tl,_ as nl,v as rl}from"./sessionTracing-DTjmc0EF.js";import{l as il,r as al}from"./commitAttribution-BFshsh2H.js";import{C as ol,P as sl,S as cl}from"./teamHelpers-BmN9nKz-.js";import{a as ll,n as ul,r as dl,s as fl}from"./detectRepository-CBk3S2zv.js";import{l as pl,o as ml,r as hl}from"./api-B6URs6nc.js";import{i as gl,r as _l}from"./sentry-BUHYuYGj.js";import{c as vl,l as yl,t as bl}from"./common-CMCv4N_v.js";import{c as xl,s as Sl}from"./referral-ByevBJrE.js";import{n as Cl,t as wl}from"./worktreeModeEnabled-Db6b_Iy_.js";import{a as Tl}from"./teammateModeSnapshot-CPjJJDL1.js";import{a as El,r as Dl,t as Ol}from"./prompt-4tea6NJQ.js";import{i as kl,t as Al}from"./assistant-BRGDWkKB.js";import{i as jl,t as Ml}from"./cliLaunch-BQa48gsr.js";import{c as Nl,l as Pl}from"./releaseNotes-CwKpIsyd.js";import{n as Fl,t as q}from"./exit-_obETqBv.js";import{n as Il,t as Ll}from"./pluginOperations-B0rLuSvo.js";import"./pluginCliCommands-BQkrvES5.js";import{n as Rl}from"./onChangeAppState-Dp0JIXd8.js";import{n as zl}from"./asciicast-o5Zg4dJt.js";import{i as Bl,t as Vl}from"./skillChangeDetector-CA_Tdx8N.js";import{a as Hl,i as Ul,r as Wl,t as Gl}from"./setup-BKUG46jQ.js";import{n as Kl}from"./stats-TUExo9iU.js";import{t as ql}from"./renderOptions-BiyC2rj1.js";import{i as Jl,n as Yl,t as Xl}from"./githubRepoPathMapping-Dut3d6nn.js";import{i as Zl,n as Ql}from"./earlyInput-tRkbxFv2.js";import{c as $l,d as eu,n as tu,r as nu,u as ru}from"./RemoteSessionManager-Cxoy1ud2.js";import{n as iu,t as au}from"./sink-B3uP8Cf8.js";import{t as ou}from"./banner-CVXH2xts.js";import{posix as su,relative as cu,resolve as lu,win32 as uu}from"path";import{appendFileSync as du,readFileSync as fu}from"fs";import{open as pu,stat as mu}from"fs/promises";var hu=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})),gu=a((e=>{var{InvalidArgumentError:t}=hu(),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.length>3&&this._name.slice(-3)===`...`&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}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._concatValue(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})),_u=a((e=>{var{humanReadableArgName:t}=gu(),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=[];return 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?`${e.description} (${t.join(`, `)})`: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}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))));s.length>0&&(a=a.concat([t.styleTitle(`Arguments:`),...s,``]));let c=t.visibleOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));if(c.length>0&&(a=a.concat([t.styleTitle(`Options:`),...c,``])),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));n.length>0&&(a=a.concat([t.styleTitle(`Global Options:`),...n,``]))}let l=t.visibleCommands(e).map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));return l.length>0&&(a=a.concat([t.styleTitle(`Commands:`),...l,``])),a.join(`
|
|
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
|
+
`+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
|
|
4
|
+
`)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),vu=a((e=>{var{InvalidArgumentError:t}=hu(),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}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}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}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._concatValue(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())}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?!1:r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
|
|
5
|
+
- a short flag is a single dash and a single character
|
|
6
|
+
- either use a single dash and a single character (for a short flag)
|
|
7
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(t)?Error(`${n}
|
|
8
|
+
- too many short flags`):i.test(t)?Error(`${n}
|
|
9
|
+
- too many long flags`):Error(`${n}
|
|
10
|
+
- unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),yu=a((e=>{var t=3;function n(e,n){if(Math.abs(e.length-n.length)>t)return Math.max(e.length,n.length);let r=[];for(let t=0;t<=e.length;t++)r[t]=[t];for(let e=0;e<=n.length;e++)r[0][e]=e;for(let t=1;t<=n.length;t++)for(let i=1;i<=e.length;i++){let a=1;a=e[i-1]===n[t-1]?0:1,r[i][t]=Math.min(r[i-1][t]+1,r[i][t-1]+1,r[i-1][t-1]+a),i>1&&t>1&&e[i-1]===n[t-2]&&e[i-2]===n[t-1]&&(r[i][t]=Math.min(r[i][t],r[i-2][t-2]+1))}return r[e.length][n.length]}function r(e,r){if(!r||r.length===0)return``;r=Array.from(new Set(r));let i=e.startsWith(`--`);i&&(e=e.slice(2),r=r.map(e=>e.slice(2)));let a=[],o=t;return r.forEach(t=>{if(t.length<=1)return;let r=n(e,t),i=Math.max(e.length,t.length);(i-r)/i>.4&&(r<o?(o=r,a=[t]):r===o&&a.push(t))}),a.sort((e,t)=>e.localeCompare(t)),i&&(a=a.map(e=>`--${e}`)),a.length>1?`\n(Did you mean one of ${a.join(`, `)}?)`:a.length===1?`\n(Did you mean ${a[0]}?)`:``}e.suggestSimilar=r})),bu=a((e=>{var n=t(`node:events`).EventEmitter,r=t(`node:child_process`),i=t(`node:path`),a=t(`node:fs`),o=t(`node:process`),{Argument:s,humanReadableArgName:c}=gu(),{CommanderError:l}=hu(),{Help:u,stripColor:d}=_u(),{Option:f,DualOptions:p}=vu(),{suggestSimilar:m}=yu(),h=class e extends n{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>o.stdout.write(e),writeErr:e=>o.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>o.stdout.isTTY?o.stdout.columns:void 0,getErrHelpWidth:()=>o.stderr.isTTY?o.stderr.columns:void 0,getOutHasColors:()=>g()??(o.stdout.isTTY&&o.stdout.hasColors?.()),getErrHasColors:()=>g()??(o.stderr.isTTY&&o.stderr.hasColors?.()),stripColor:e=>d(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i=i||{};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new u,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
|
|
11
|
+
- specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new s(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,this;e=e??`help [command]`;let[,n,r]=e.match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
|
|
12
|
+
Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new l(e,t,n)),o.exit(e)}action(e){return this._actionHandler=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new f(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
13
|
+
- already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,`default`)}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._concatValue(t,a)),t??(t=e.negate?!1:e.isBoolean()||e.optional?!0:``),this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{r(t,`error: option '${e.flags}' argument '${t}' is invalid.`,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{r(t,`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof f)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error(`call .storeOptionsAsProperties() before adding options`);if(Object.keys(this._optionValues).length)throw Error(`call .storeOptionsAsProperties() before setting option values`);return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t=t||{},e===void 0&&t.from===void 0){o.versions?.electron&&(t.from=`electron`);let e=o.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=o.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:o.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
14
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(a.existsSync(e))return;let r=`'${e}' does not exist
|
|
15
|
+
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
16
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
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=ee(o.execArgv).concat(t),f=r.spawn(o.execPath,t,{stdio:`inherit`})):n?(t.unshift(u),t=ee(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&&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&&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?!1: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,i=e.slice();function a(e){return e.length>1&&e[0]===`-`}let o=null;for(;i.length;){let e=i.shift();if(e===`--`){r===n&&r.push(e),r.push(...i);break}if(o&&!a(e)){this.emit(`option:${o.name()}`,e);continue}if(o=null,a(e)){let t=this._findOption(e);if(t){if(t.required){let e=i.shift();e===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;i.length>0&&!a(i[0])&&(e=i.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(e.length>2&&e[0]===`-`&&e[1]!==`-`){let t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),i.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){let t=e.indexOf(`=`),n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,e.slice(t+1));continue}}if(a(e)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(e)){t.push(e),i.length>0&&n.push(...i);break}else if(this._getHelpCommand()&&e===this._getHelpCommand().name()){t.push(e),i.length>0&&t.push(...i);break}else if(this._defaultCommandName){n.push(e),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){r.push(e),i.length>0&&r.push(...i);break}r.push(e)}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
|
+
`),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in o.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,o.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new p(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=m(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=m(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||`-V, --version`,n=n||`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>c(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}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=this._helpOption??void 0:this._helpOption=null,this):(e=e??`-h, --help`,t=t??`display help for command`,this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=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 ee(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function g(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=h,e.useColor=g})),xu=a((e=>{var{Argument:t}=gu(),{Command:n}=bu(),{CommanderError:r,InvalidArgumentError:i}=hu(),{Help:a}=_u(),{Option:o}=vu();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})),Su=a(((e,t)=>{var n=xu();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(),p(),h(),w(),T(),z(),ar(),rr(),pr(),sr(),vr(),dr(),Xr(),dn(),zt();var{program:Cu,createCommand:wu,createArgument:Tu,createOption:Eu,CommanderError:Du,InvalidArgumentError:Ou,InvalidOptionArgumentError:ku,Command:Au,Argument:ju,Option:J,Help:Mu}=r(Su(),1).default;te(),ue();var Nu=r(he(),1);pe();var Y=S();xe(),gt(),Ot(),vn(),Gn(),hr(),br(),jr(),Mr(),Fr(),Ir(),Rr(),Br(),Hr(),Er(),Ur(),E(),Jr(),Qr(),Sn(),ei(),jt(),An(),gn(),Vt(),Dn(),F(),ni(),ai(),D(),O(),Fn(),Kt(),Lt(),On(),sn(),qt(),wn(),_n(),Bn(),Rn(),N(),jn(),Bt(),M(),Aa(),Yc(),Go(),vs(),li(),Wc(),Bc(),Gc(),xc(),Rs(),Qo(),Ns(),sl(),gl(),Bs(),ps(),vl(),pc(),Ss(),$a(),fa(),bc(),Qc(),wi(),ca(),ka(),is(),wl(),Ao(),Ws(),Ni(),Ha(),Jo(),ua(),Na(),K(),no(),va(),hi(),Pa(),Qs(),kr();var Pu=!1;function Fu(){if(Pu||(Pu=!0,m(process.env.CLAUDE_CODE_USE_BEDROCK)||m(process.env.CLAUDE_CODE_USE_VERTEX)||m(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||Dr().BASE_API_URL;fetch(e,{method:`HEAD`,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}function Iu(){if(process.env.NODE_EXTRA_CA_CERTS)return;let e=Lu();e&&(process.env.NODE_EXTRA_CA_CERTS=e,R(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${e}`))}function Lu(){try{let e=j()?.env,t=Rt(`userSettings`)?.env;R(`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&&R(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${n}`),n}catch(e){R(`CA certs: Config fallback failed: ${e}`,{level:`error`});return}}E(),dr(),ll(),Nn(),p(),Cc(),nl(),tl(),fi();var Ru=!1,zu=o(async()=>{let e=Date.now();V(`info`,`init_started`),U(`init_function_start`);try{let t=Date.now();Zt(),de({loadTheme:()=>j().theme,saveTheme:e=>A(t=>({...t,theme:e}))}),V(`info`,`init_configs_enabled`,{duration_ms:Date.now()-t}),U(`init_configs_enabled`);let n=Date.now();lc(),Iu(),V(`info`,`init_safe_env_vars_applied`,{duration_ms:Date.now()-n}),U(`init_safe_env_vars_applied`),ao(),U(`init_after_graceful_shutdown`),Promise.all([import(`./firstPartyEventLogger-KIwaBY-E.js`),import(`./growthbook-BynnuVTn.js`)]).then(([e,t])=>{e.initialize1PEventLogging(),t.onGrowthBookRefresh(()=>{e.reinitialize1PEventLoggingIfConfigChanged()})}),U(`init_after_1p_event_logging`),import(`./poller-Ds0Y6Cir.js`).then(e=>e.startBalancePolling()),U(`init_after_balance_polling`),En(),U(`init_after_oauth_populate`),I(),U(`init_after_jetbrains_detection`),ul(),_a()&&pa(),Xa()&&Oc(),U(`init_after_remote_settings_check`),Et();let r=Date.now();R(`[init] configureGlobalMTLS starting`),ii(),V(`info`,`init_mtls_configured`,{duration_ms:Date.now()-r}),R(`[init] configureGlobalMTLS complete`);let i=Date.now();if(R(`[init] configureGlobalAgents starting`),ri(),V(`info`,`init_proxy_configured`,{duration_ms:Date.now()-i}),R(`[init] configureGlobalAgents complete`),U(`init_network_configured`),_l(),await $t(),Fi(),ir(sa),Fu(),m(process.env.CLAUDE_CODE_REMOTE))try{let{initUpstreamProxy:e,getUpstreamProxyEnv:t}=await import(`./upstreamproxy-DcLeL2XX.js`),{registerUpstreamProxyEnvFn:n}=await import(`./subprocessEnv-CggQWZCx.js`);n(t),await e()}catch(e){R(`[init] upstreamproxy init failed: ${e instanceof Error?e.message:String(e)}; continuing without proxy`,{level:`warn`})}if(Vr(),ir(uc),ir(async()=>{let{cleanupSessionTeams:e}=await import(`./teamHelpers-yeTNtZbb.js`);await e()}),Ac()){let e=Date.now();await ba(),V(`info`,`init_scratchpad_created`,{duration_ms:Date.now()-e})}V(`info`,`init_completed`,{duration_ms:Date.now()-e}),U(`init_function_end`)}catch(e){if(e instanceof lr){if(Re()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}\n`),ta(1);return}return import(`./InvalidConfigDialog-CNsqbNU3.js`).then(t=>t.showInvalidConfigDialog({error:e}))}else throw e}});function Bu(){_a()?(Re()&&rl()&&Vu().catch(e=>{R(`[3P telemetry] Eager telemetry init failed (beta tracing): ${L(e)}`,{level:`error`})}),R(`[3P telemetry] Waiting for remote managed settings before telemetry init`),Ji().then(async()=>{R(`[3P telemetry] Remote managed settings loaded, initializing telemetry`),po(),await Vu()}).catch(e=>{R(`[3P telemetry] Telemetry init failed (remote settings path): ${L(e)}`,{level:`error`})})):Vu().catch(e=>{R(`[3P telemetry] Telemetry init failed: ${L(e)}`,{level:`error`})})}async function Vu(){if(!Ru){if(!m(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)){Ru=!0,R(`[3P telemetry] Skipped — CLAUDE_CODE_ENABLE_TELEMETRY not set`);return}Ru=!0;try{await Hu()}catch(e){throw Ru=!1,e}}}async function Hu(){let{initializeTelemetry:e}=await import(`./instrumentation-DWwmOmr0.js`),t=await e();t&&(Xe(t,(e,n)=>{let r=t?.createCounter(e,n);return{add(e,t={}){let n={...el(),...t};r?.add(e,n)}}}),Ve()?.add(1))}ws();async function Uu(e,t,n,r){let{App:i}=await import(`./App-2tgSv9lb.js`),{SentryErrorBoundary:a}=await import(`./SentryErrorBoundary-oJUBarGg.js`),{REPL:o}=await import(`./REPL-DCwqua0C.js`);await r(e,(0,Y.jsx)(a,{name:`RootREPLBoundary`,children:(0,Y.jsx)(i,{...t,children:(0,Y.jsx)(o,{...n})})}))}kr(),E(),dr();var Wu=$r(()=>ce({client_data:ie(_(),se()).nullish(),additional_model_options:oe(ce({model:_(),name:_(),description:_()}).transform(({model:e,name:t,description:n})=>({value:e,label:t,description:n}))).nullish()}));async function Gu(){if(Lr())return R(`[Bootstrap] Skipped: Nonessential traffic disabled`),null;if(k()!==`firstParty`)return R(`[Bootstrap] Skipped: 3P provider`),null;let e=Gt();if(!(xt()?.accessToken&&en())&&!e)return R(`[Bootstrap] Skipped: no usable OAuth or API key`),null;let t=`${Dr().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await Wt(async()=>{let n=xt()?.accessToken,r;if(n&&en())r={Authorization:`Bearer ${n}`,"anthropic-beta":Or};else if(e)r={"x-api-key":e};else return R(`[Bootstrap] No auth available on retry, aborting`),null;R(`[Bootstrap] Fetching`);let i=await g.get(t,{headers:{"Content-Type":`application/json`,"User-Agent":lt(),...r},timeout:5e3}),a=Wu().safeParse(i.data);return a.success?(R(`[Bootstrap] Fetch ok`),a.data):(R(`[Bootstrap] Response failed validation: ${a.error.message}`),null)})}catch(e){throw R(`[Bootstrap] Fetch failed: ${g.isAxiosError(e)?e.response?.status??e.code:`unknown`}`),e}}async function Ku(){try{let e=await Gu();if(!e)return;let t=e.client_data??null,n=e.additional_model_options??[],r=j();if(yt(r.clientDataCache,t)&&yt(r.additionalModelOptionsCache,n)){R(`[Bootstrap] Cache unchanged, skipping write`);return}R(`[Bootstrap] Cache updated, persisting to disk`),A(e=>({...e,clientDataCache:t,additionalModelOptionsCache:n}))}catch(e){H(e)}}Ln(),jo(),so(),ml(),os(),Sl(),dr(),p();var qu=new Map;function Ju(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;zr()===`windows`&&(e=e.split(uu.sep).join(su.sep),t=t.split(uu.sep).join(su.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 Yu=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function Xu(e){let t=`${e.name}: ${e.message}`;return Yu.some(e=>e.test(t))}var Zu=null;function Qu(){let e=process.listeners(`warning`);Zu&&e.includes(Zu)||(Ju()||process.removeAllListeners(`warning`),Zu=e=>{try{let t=`${e.name}: ${e.message.slice(0,50)}`,n=qu.get(t)||0;(qu.has(t)||qu.size<1e3)&&qu.set(t,n+1);let r=Xu(e);B(`tengu_node_warning`,{is_internal:+!!r,occurrence_count:n+1,classname:e.name,...process.env.USER_TYPE===`ant`&&{message:e.message}}),m(process.env.CLAUDE_DEBUG)&&R(`${r?`[Internal Warning]`:`[Warning]`} ${e.toString()}`,{level:`warn`})}catch{}},process.on(`warning`,Zu))}Ya(),Is(),ls(),cc(),Fo(),xo(),au(),xe();function $u(){return(0,Y.jsxs)(_e,{children:[`MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the`,` `,(0,Y.jsx)(me,{url:`https://code.claude.com/docs/en/mcp`,children:`MCP documentation`}),`.`]})}z(),F(),xe();function ed({serverName:e,onDone:t}){function n(n){switch(B(`tengu_mcp_dialog_choice`,{choice:n}),n){case`yes`:case`yes_all`:{let r=(Cn()||{}).enabledMcpjsonServers||[];r.includes(e)||P(`localSettings`,{enabledMcpjsonServers:[...r,e]}),n===`yes_all`&&P(`localSettings`,{enableAllProjectMcpServers:!0}),t();break}case`no`:{let n=(Cn()||{}).disabledMcpjsonServers||[];n.includes(e)||P(`localSettings`,{disabledMcpjsonServers:[...n,e]}),t();break}}}return(0,Y.jsxs)(ye,{title:`New MCP server found in .mcp.json: ${e}`,color:`warning`,onCancel:()=>n(`no`),children:[(0,Y.jsx)($u,{}),(0,Y.jsx)(ki,{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`)})]})}ht(),z(),xe(),F(),io();function td({serverNames:e,onDone:t}){function n(n){let r=Cn()||{},i=r.enabledMcpjsonServers||[],a=r.disabledMcpjsonServers||[],[o,s]=Pt(e,e=>n.includes(e));B(`tengu_mcp_multidialog_choice`,{approved:o.length,rejected:s.length}),o.length>0&&P(`localSettings`,{enabledMcpjsonServers:[...new Set([...i,...o])]}),s.length>0&&P(`localSettings`,{disabledMcpjsonServers:[...new Set([...a,...s])]}),t()}let r=(0,Nu.useCallback)(()=>{let n=(Cn()||{}).disabledMcpjsonServers||[];P(`localSettings`,{disabledMcpjsonServers:[...new Set([...n,...e])]}),t()},[e,t]);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(ye,{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)($u,{}),(0,Y.jsx)(Cs,{options:e.map(e=>({label:e,value:e})),defaultValue:e,onSubmit:n,onCancel:r,hideIndexes:!0})]}),(0,Y.jsx)(Se,{paddingX:1,children:(0,Y.jsx)(_e,{dimColor:!0,italic:!0,children:(0,Y.jsxs)(x,{children:[(0,Y.jsx)(be,{shortcut:`Space`,action:`select`}),(0,Y.jsx)(be,{shortcut:`Enter`,action:`confirm`}),(0,Y.jsx)($i,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`reject all`})]})})})]})}fs();async function nd(e){let{servers:t}=$s(`project`),n=Object.keys(t).filter(e=>Xi(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)(pi,{children:(0,Y.jsx)(us,{children:(0,Y.jsx)(ed,{serverName:t,onDone:r})})}))}else e.render((0,Y.jsx)(pi,{children:(0,Y.jsx)(us,{children:(0,Y.jsx)(td,{serverNames:n,onDone:r})})}))})}ya(),Ei(),zi(),il(),Wa(),mc(),E(),dr();var rd={iterm:`iTerm`,"iterm.app":`iTerm`,ghostty:`Ghostty`,kitty:`kitty`,alacritty:`Alacritty`,wezterm:`WezTerm`,apple_terminal:`Terminal`};function id(){if(process.platform!==`darwin`)return;let e=process.env.TERM_PROGRAM;if(!e)return;let t=rd[e.toLowerCase()];t&&j().deepLinkTerminal!==t&&(A(e=>({...e,deepLinkTerminal:t})),R(`Stored deep link terminal preference: ${t}`))}var ad=class{constructor(){ee(this,`frameDurations`,[]),ee(this,`firstRenderTime`,void 0),ee(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}}};z(),Bs(),T(),xe(),xo(),fs(),E(),p(),Cc(),ms(),F();function od(){A(e=>({...e,hasCompletedOnboarding:!0,lastOnboardingVersion:`2.6.0`}))}function sd(e,t){return new Promise(n=>{e.render(t(e=>void n(e)))})}async function X(e,t,n){return cd(e,t,{color:`error`,beforeExit:n})}async function cd(e,t,n){let{Text:r}=await import(`./src-poaoYkuc.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 sd(e,e=>(0,Y.jsx)(ge,{initialState:j().theme,onThemeSave:e=>A(t=>({...t,theme:e})),children:(0,Y.jsx)(pi,{onChangeAppState:n?.onChangeAppState,children:(0,Y.jsx)(us,{children:t(e)})})}))}async function ld(e,t){e.render(t),kp(),await e.waitUntilExit(),await W(0)}async function ud(e,t,n,r,i,a){if(m(!1)||process.env.IS_DEMO)return!1;let o=j(),s=!1;if(!o.theme||!o.hasCompletedOnboarding){s=!0;let{Onboarding:t}=await import(`./Onboarding-BwoGQB4g.js`);await Z(e,e=>(0,Y.jsx)(t,{onDone:()=>{od(),e()}}),{onChangeAppState:Rl})}if(!m(process.env.CLAUBBIT)){if(!ln()){let{TrustDialog:t}=await import(`./TrustDialog-CIzAlGn9.js`);await Z(e,e=>(0,Y.jsx)(t,{commands:r,onDone:e}))}Te(!0),pt(),dt(),Lo();let{errors:t}=mi();if(t.length===0&&await nd(e),await Si()){let t=mo(await wc(!0)),{ClaudeMdExternalIncludesDialog:n}=await import(`./ClaudeMdExternalIncludesDialog-B8oAAHSI.js`);await Z(e,e=>(0,Y.jsx)(n,{onDone:e,isStandaloneDialog:!0,externalIncludes:t}))}}if(Jl(),id(),po(),setImmediate(()=>Bu()),await Wi()){let{GroveDialog:t}=await import(`./Grove-C2YjB3zL.js`);if(await Z(e,e=>(0,Y.jsx)(t,{showIfAlreadyViewed:!1,location:s?`onboarding`:`policy_update_modal`,onDone:e}))===`escape`)return B(`tengu_grove_policy_exited`,{}),ta(0),!1}if(process.env.ANTHROPIC_API_KEY&&!u()){let t=Yt(process.env.ANTHROPIC_API_KEY);if(Hn(t)===`new`){let{ApproveApiKey:n}=await import(`./ApproveApiKey-SIUwkD8j.js`);await Z(e,e=>(0,Y.jsx)(n,{customApiKeyTruncated:t,onDone:e}),{onChangeAppState:Rl})}}if((t===`bypassPermissions`||n)&&!tn()){let{BypassPermissionsModeDialog:t}=await import(`./BypassPermissionsModeDialog-BOSW4Zdy.js`);await Z(e,e=>(0,Y.jsx)(t,{onAccept:e}))}if(a&&a.length>0){let{DevChannelsDialog:t}=await import(`./DevChannelsDialog-DXRgY00D.js`);await Z(e,e=>(0,Y.jsx)(t,{channels:a,onAccept:()=>{Le([...rt(),...a.map(e=>({...e,dev:!0}))]),Ie(!0),e()}}))}if(i&&!j().hasCompletedClaudeInChromeOnboarding){let{ClaudeInChromeOnboarding:t}=await import(`./ClaudeInChromeOnboarding-BW4XHmkw.js`);await Z(e,e=>(0,Y.jsx)(t,{onDone:e}))}return s}function dd(e){let t=0,n=ql(e);n.stdin&&B(`tengu_stdin_interactive`,{});let r=new ad,i=Kl();tt(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&&du(a,JSON.stringify({total:e.durationMs,...e.phases,rss:process.memoryUsage.rss(),cpu:process.cpuUsage()})+`
|
|
20
|
+
`),!fe())for(let n of e.flickers){if(n.reason===`resize`)continue;let e=Date.now();e-t<1e3&&B(`tengu_flicker`,{desiredHeight:n.desiredHeight,actualHeight:n.availableHeight,reason:n.reason}),t=e}}}}}xo();async function fd(e,t){let{InvalidSettingsDialog:n}=await import(`./InvalidSettingsDialog-ClnZaN6b.js`);return Z(e,e=>(0,Y.jsx)(n,{settingsErrors:t.settingsErrors,onContinue:e,onExit:t.onExit}))}async function pd(e,t){let{AssistantSessionChooser:n}=await import(`./AssistantSessionChooser-DF9eeJZS.js`);return Z(e,e=>(0,Y.jsx)(n,{sessions:t.sessions,onSelect:t=>e(t),onCancel:()=>e(null)}))}async function md(e){let{NewInstallWizard:t,computeDefaultInstallDir:n}=await import(`./assistant-tPxOUa-Z.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 hd(e){let{TeleportResumeWrapper:t}=await import(`./TeleportResumeWrapper-DPSO0S49.js`);return Z(e,e=>(0,Y.jsx)(t,{onComplete:e,onCancel:()=>e(null),source:`cliArg`}))}async function gd(e,t){let{TeleportRepoMismatchDialog:n}=await import(`./TeleportRepoMismatchDialog-DqWQX6j8.js`);return Z(e,e=>(0,Y.jsx)(n,{targetRepo:t.targetRepo,initialPaths:t.initialPaths,onSelectPath:e,onCancel:()=>e(null)}))}async function _d(e,t,n,r){let[i,{ResumeConversation:a},{App:o}]=await Promise.all([n,import(`./ResumeConversation-B3WuB8rs.js`),import(`./App-2tgSv9lb.js`)]);await ld(e,(0,Y.jsx)(o,{getFpsMetrics:t.getFpsMetrics,stats:t.stats,initialState:t.initialState,children:(0,Y.jsx)(us,{children:(0,Y.jsx)(a,{...r,worktreePaths:i})})}))}jl();function vd(){let e=Ml([`weixin`,`serve`]);Jc({name:`weixin`,description:"WeChat channel integration. Enables inbound WeChat messages via channels and provides reply/send_typing MCP tools. Configure with `ccb weixin login` and enable for a session with `--channels plugin:weixin@builtin`.",version:`2.6.0`,defaultEnabled:!0,mcpServers:{weixin:{type:`stdio`,command:e.execPath,args:e.args}}})}function yd(){vd()}re(),El(),Gl(),Rc(),Ic();var bd=5,xd=30,Sd=`After you finish implementing the change:
|
|
21
|
+
1. **Simplify** — Invoke the \`${Uc}\` tool with \`skill: "simplify"\` to review and clean up your changes.
|
|
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
|
+
3. **Test end-to-end** — Follow the e2e test recipe from the coordinator's prompt (below). If the recipe says to skip e2e for this unit, skip it.
|
|
24
|
+
4. **Commit and push** — Commit all changes with a clear message, push the branch, and create a PR with \`gh pr create\`. Use a descriptive title. If \`gh\` is not available or the push fails, note it in your final message.
|
|
25
|
+
5. **Report** — End with a single line: \`PR: <url>\` so the coordinator can track it. If no PR was created, end with \`PR: none — <reason>\`.`;function Cd(e){return`# Batch: Parallel Work Orchestration
|
|
26
|
+
|
|
27
|
+
You are orchestrating a large, parallelizable change across this codebase.
|
|
28
|
+
|
|
29
|
+
## User Instruction
|
|
30
|
+
|
|
31
|
+
${e}
|
|
32
|
+
|
|
33
|
+
## Phase 1: Research and Plan (Plan Mode)
|
|
34
|
+
|
|
35
|
+
Call the \`${Vc}\` tool now to enter plan mode, then:
|
|
36
|
+
|
|
37
|
+
1. **Understand the scope.** Launch one or more subagents (in the foreground — you need their results) to deeply research what this instruction touches. Find all the files, patterns, and call sites that need to change. Understand the existing conventions so the migration is consistent.
|
|
38
|
+
|
|
39
|
+
2. **Decompose into independent units.** Break the work into ${bd}–${xd} self-contained units. Each unit must:
|
|
40
|
+
- Be independently implementable in an isolated git worktree (no shared state with sibling units)
|
|
41
|
+
- Be mergeable on its own without depending on another unit's PR landing first
|
|
42
|
+
- Be roughly uniform in size (split large units, merge trivial ones)
|
|
43
|
+
|
|
44
|
+
Scale the count to the actual work: few files → closer to ${bd}; hundreds of files → closer to ${xd}. Prefer per-directory or per-module slicing over arbitrary file lists.
|
|
45
|
+
|
|
46
|
+
3. **Determine the e2e test recipe.** Figure out how a worker can verify its change actually works end-to-end — not just that unit tests pass. Look for:
|
|
47
|
+
- A \`claude-in-chrome\` skill or browser-automation tool (for UI changes: click through the affected flow, screenshot the result)
|
|
48
|
+
- A \`tmux\` or CLI-verifier skill (for CLI changes: launch the app interactively, exercise the changed behavior)
|
|
49
|
+
- A dev-server + curl pattern (for API changes: start the server, hit the affected endpoints)
|
|
50
|
+
- An existing e2e/integration test suite the worker can run
|
|
51
|
+
|
|
52
|
+
If you cannot find a concrete e2e path, use the \`${Pc}\` tool to ask the user how to verify this change end-to-end. Offer 2–3 specific options based on what you found (e.g., "Screenshot via chrome extension", "Run \`bun run dev\` and curl the endpoint", "No e2e — unit tests are sufficient"). Do not skip this — the workers cannot ask the user themselves.
|
|
53
|
+
|
|
54
|
+
Write the recipe as a short, concrete set of steps that a worker can execute autonomously. Include any setup (start a dev server, build first) and the exact command/interaction to verify.
|
|
55
|
+
|
|
56
|
+
4. **Write the plan.** In your plan file, include:
|
|
57
|
+
- A summary of what you found during research
|
|
58
|
+
- A numbered list of work units — for each: a short title, the list of files/directories it covers, and a one-line description of the change
|
|
59
|
+
- The e2e test recipe (or "skip e2e because …" if the user chose that)
|
|
60
|
+
- The exact worker instructions you will give each agent (the shared template)
|
|
61
|
+
|
|
62
|
+
5. Call \`${jc}\` to present the plan for approval.
|
|
63
|
+
|
|
64
|
+
## Phase 2: Spawn Workers (After Plan Approval)
|
|
65
|
+
|
|
66
|
+
Once the plan is approved, spawn one background agent per work unit using the \`${ot}\` tool. **All agents must use \`isolation: "worktree"\` and \`run_in_background: true\`.** Launch them all in a single message block so they run in parallel.
|
|
67
|
+
|
|
68
|
+
For each agent, the prompt must be fully self-contained. Include:
|
|
69
|
+
- The overall goal (the user's instruction)
|
|
70
|
+
- This unit's specific task (title, file list, change description — copied verbatim from your plan)
|
|
71
|
+
- Any codebase conventions you discovered that the worker needs to follow
|
|
72
|
+
- The e2e test recipe from your plan (or "skip e2e because …")
|
|
73
|
+
- The worker instructions below, copied verbatim:
|
|
74
|
+
|
|
75
|
+
\`\`\`
|
|
76
|
+
${Sd}
|
|
77
|
+
\`\`\`
|
|
78
|
+
|
|
79
|
+
Use \`subagent_type: "general-purpose"\` unless a more specific agent type fits.
|
|
80
|
+
|
|
81
|
+
## Phase 3: Track Progress
|
|
82
|
+
|
|
83
|
+
After launching all workers, render an initial status table:
|
|
84
|
+
|
|
85
|
+
| # | Unit | Status | PR |
|
|
86
|
+
|---|------|--------|----|
|
|
87
|
+
| 1 | <title> | running | — |
|
|
88
|
+
| 2 | <title> | running | — |
|
|
89
|
+
|
|
90
|
+
As background-agent completion notifications arrive, parse the \`PR: <url>\` line from each agent's result and re-render the table with updated status (\`done\` / \`failed\`) and PR links. Keep a brief failure note for any agent that did not produce a PR.
|
|
91
|
+
|
|
92
|
+
When all agents have reported, render the final table and a one-line summary (e.g., "22/24 units landed as PRs").
|
|
93
|
+
`}var wd="This is not a git repository. The `/batch` command requires a git repo because it spawns agents in isolated git worktrees and creates PRs from each. Initialize a repo first, or run this from inside an existing one.",Td=`Provide an instruction describing the batch change you want to make.
|
|
94
|
+
|
|
95
|
+
Examples:
|
|
96
|
+
/batch migrate from react to vue
|
|
97
|
+
/batch replace all uses of lodash with native equivalents
|
|
98
|
+
/batch add type annotations to all untyped function parameters`;function Ed(){G({name:`batch`,description:`Research and plan a large-scale change, then execute it in parallel across 5–30 isolated worktree agents that each open a PR.`,whenToUse:`Use when the user wants to make a sweeping, mechanical change across many files (migrations, refactors, bulk renames) that can be decomposed into independent parallel units.`,argumentHint:`<instruction>`,userInvocable:!0,disableModelInvocation:!0,async getPromptForCommand(e){let t=e.trim();return t?await xr()?[{type:`text`,text:Cd(t)}]:[{type:`text`,text:wd}]:[{type:`text`,text:Td}]}})}K();var Dd=ne.map(e=>`mcp__claude-in-chrome__${e.name}`),Od=`
|
|
99
|
+
Now that this skill is invoked, you have access to Chrome browser automation tools. You can now use the mcp__claude-in-chrome__* tools to interact with web pages.
|
|
100
|
+
|
|
101
|
+
IMPORTANT: Start by calling mcp__claude-in-chrome__tabs_context_mcp to get information about the user's current browser tabs.
|
|
102
|
+
`;function kd(){G({name:`claude-in-chrome`,description:`Automates your Chrome browser to interact with web pages - clicking elements, filling forms, capturing screenshots, reading console logs, and navigating sites. Opens pages in new tabs within your existing Chrome session. Requires site-level permissions before executing (configured in the extension).`,whenToUse:`When the user wants to interact with web pages, automate browser tasks, capture screenshots, read console logs, or perform any browser-based actions. Always invoke BEFORE attempting to use any mcp__claude-in-chrome__* tools.`,allowedTools:Dd,userInvocable:!0,isEnabled:()=>Ul(),async getPromptForCommand(e){let t=`${Ol}\n${Od}`;return e&&(t+=`\n## Task\n\n${e}`),[{type:`text`,text:t}]}})}ks(),F(),dr(),rr(),K();var Ad=20,jd=64*1024;function Md(){G({name:`debug`,description:process.env.USER_TYPE===`ant`?`Debug your current Claude Code session by reading the session debug log. Includes all event logging`:`Enable debug logging for this session and help diagnose issues`,allowedTools:[`Read`,`Grep`,`Glob`],argumentHint:`[issue description]`,disableModelInvocation:!0,userInvocable:!0,async getPromptForCommand(e){let t=fr(),n=cr(),r;try{let e=await mu(n),t=Math.min(e.size,jd),i=e.size-t,a=await pu(n,`r`);try{let{buffer:n,bytesRead:o}=await a.read({buffer:Buffer.alloc(t),position:i}),s=n.toString(`utf-8`,0,o).split(`
|
|
103
|
+
`).slice(-Ad).join(`
|
|
104
|
+
`);r=`Log size: ${Yr(e.size)}\n\n### Last ${Ad} lines\n\n\`\`\`\n${s}\n\`\`\``}finally{await a.close()}}catch(e){r=nr(e)?`No debug log exists yet — logging was just enabled.`:`Failed to read last ${Ad} lines of debug log: ${L(e)}`}return[{type:`text`,text:`# Debug Skill
|
|
105
|
+
|
|
106
|
+
Help the user debug an issue they're encountering in this current Claude Code session.
|
|
107
|
+
${t?``:`
|
|
108
|
+
## Debug Logging Just Enabled
|
|
109
|
+
|
|
110
|
+
Debug logging was OFF for this session until now. Nothing prior to this /debug invocation was captured.
|
|
111
|
+
|
|
112
|
+
Tell the user that debug logging is now active at \`${n}\`, ask them to reproduce the issue, then re-read the log. If they can't reproduce, they can also restart with \`claude --debug\` to capture logs from startup.
|
|
113
|
+
`}
|
|
114
|
+
## Session Debug Log
|
|
115
|
+
|
|
116
|
+
The debug log for the current session is at: \`${n}\`
|
|
117
|
+
|
|
118
|
+
${r}
|
|
119
|
+
|
|
120
|
+
For additional context, grep for [ERROR] and [WARN] lines across the full file.
|
|
121
|
+
|
|
122
|
+
## Issue Description
|
|
123
|
+
|
|
124
|
+
${e||`The user did not describe a specific issue. Read the debug log and summarize any errors, warnings, or notable issues.`}
|
|
125
|
+
|
|
126
|
+
## Settings
|
|
127
|
+
|
|
128
|
+
Remember that settings are in:
|
|
129
|
+
* user - ${Jt(`userSettings`)}
|
|
130
|
+
* project - ${Jt(`projectSettings`)}
|
|
131
|
+
* local - ${Jt(`localSettings`)}
|
|
132
|
+
|
|
133
|
+
## Instructions
|
|
134
|
+
|
|
135
|
+
1. Review the user's issue description
|
|
136
|
+
2. The last ${Ad} lines show the debug file format. Look for [ERROR] and [WARN] entries, stack traces, and failure patterns across the file
|
|
137
|
+
3. Consider launching the ${nc} subagent to understand the relevant Claude Code features
|
|
138
|
+
4. Explain what you found in plain language
|
|
139
|
+
5. Suggest concrete fixes or next steps
|
|
140
|
+
`}]}})}ic(),ei();var Nd=[`Global`,`Chat`,`Autocomplete`,`Confirmation`,`Help`,`Transcript`,`HistorySearch`,`Task`,`ThemePicker`,`Settings`,`Tabs`,`Attachments`,`Footer`,`MessageSelector`,`DiffDialog`,`ModelPicker`,`Select`,`Plugin`],Pd={Global:`Active everywhere, regardless of focus`,Chat:`When the chat input is focused`,Autocomplete:`When autocomplete menu is visible`,Confirmation:`When a confirmation/permission dialog is shown`,Help:`When the help overlay is open`,Transcript:`When viewing the transcript`,HistorySearch:`When searching command history (ctrl+r)`,Task:`When a task/agent is running in the foreground`,ThemePicker:`When the theme picker is open`,Settings:`When the settings menu is open`,Tabs:`When tab navigation is active`,Attachments:`When navigating image attachments in a select dialog`,Footer:`When footer indicators are focused`,MessageSelector:`When the message selector (rewind) is open`,DiffDialog:`When the diff dialog is open`,ModelPicker:`When the model picker is open`,Select:`When a select/list component is focused`,Plugin:`When the plugin dialog is open`},Fd=`app:interrupt.app:exit.app:toggleTodos.app:toggleTranscript.app:toggleBrief.app:toggleTeammatePreview.app:toggleTerminal.app:redraw.app:globalSearch.app:quickOpen.history:search.history:previous.history:next.chat:cancel.chat:killAgents.chat:cycleMode.chat:modelPicker.chat:fastMode.chat:thinkingToggle.chat:submit.chat:newline.chat:undo.chat:externalEditor.chat:stash.chat:imagePaste.chat:messageActions.autocomplete:accept.autocomplete:dismiss.autocomplete:previous.autocomplete:next.confirm:yes.confirm:no.confirm:previous.confirm:next.confirm:nextField.confirm:previousField.confirm:cycleMode.confirm:toggle.confirm:toggleExplanation.tabs:next.tabs:previous.transcript:toggleShowAll.transcript:exit.historySearch:next.historySearch:accept.historySearch:cancel.historySearch:execute.task:background.theme:toggleSyntaxHighlighting.help:dismiss.attachments:next.attachments:previous.attachments:remove.attachments:exit.footer:up.footer:down.footer:next.footer:previous.footer:openSelected.footer:clearSelection.footer:close.messageSelector:up.messageSelector:down.messageSelector:top.messageSelector:bottom.messageSelector:select.diff:dismiss.diff:previousSource.diff:nextSource.diff:back.diff:viewDetails.diff:previousFile.diff:nextFile.modelPicker:decreaseEffort.modelPicker:increaseEffort.modelPicker:toggle1M.select:next.select:previous.select:accept.select:cancel.plugin:toggle.plugin:install.permission:toggleDebug.settings:search.settings:retry.settings:close.select:previousValue.select:nextValue.voice:pushToTalk`.split(`.`),Id=$r(()=>ce({context:y(Nd).describe(`UI context where these bindings apply. Global bindings work everywhere.`),bindings:ie(_().describe(`Keystroke pattern (e.g., "ctrl+k", "shift+tab")`),v([y(Fd),_().regex(/^command:[a-zA-Z0-9:\-_]+$/).describe(`Command binding (e.g., "command:help", "command:compact"). Executes the slash command as if typed.`),le().describe(`Set to null to unbind a default shortcut`)]).describe(`Action to trigger, command to invoke, or null to unbind`)).describe(`Map of keystroke patterns to actions`)}).describe(`A block of keybindings for a specific context`));$r(()=>ce({$schema:_().optional().describe(`JSON Schema URL for editor validation`),$docs:_().optional().describe(`Documentation URL`),bindings:oe(Id()).describe(`Array of keybinding blocks by context`)}).describe(`Claude Code keybindings configuration. Customize keyboard shortcuts by context.`)),K();function Ld(){return ef([`Context`,`Description`],Nd.map(e=>[`\`${e}\``,Pd[e]]))}function Rd(){let e={};for(let t of Ko)for(let[n,r]of Object.entries(t.bindings))r&&(e[r]||(e[r]={keys:[],context:t.context}),e[r].keys.push(n));return ef([`Action`,`Default Key(s)`,`Context`],Fd.map(t=>{let n=e[t],r=n?n.keys.map(e=>`\`${e}\``).join(`, `):`(none)`,i=n?n.context:zd(t);return[`\`${t}\``,r,i]}))}function zd(e){return{app:`Global`,history:`Global or Chat`,chat:`Chat`,autocomplete:`Autocomplete`,confirm:`Confirmation`,tabs:`Tabs`,transcript:`Transcript`,historySearch:`HistorySearch`,task:`Task`,theme:`ThemePicker`,help:`Help`,attachments:`Attachments`,footer:`Footer`,messageSelector:`MessageSelector`,diff:`DiffDialog`,modelPicker:`ModelPicker`,select:`Select`,permission:`Confirmation`}[e.split(`:`)[0]??``]??`Unknown`}function Bd(){let e=[];e.push(`### Non-rebindable (errors)`);for(let t of Oo)e.push(`- \`${t.key}\` — ${t.reason}`);e.push(``),e.push(`### Terminal reserved (errors/warnings)`);for(let t of ys)e.push(`- \`${t.key}\` — ${t.reason} (${t.severity===`error`?`will not work`:`may conflict`})`);e.push(``),e.push(`### macOS reserved (errors)`);for(let t of Xs)e.push(`- \`${t.key}\` — ${t.reason}`);return e.join(`
|
|
141
|
+
`)}var Vd={$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.claude.com/docs/en/keybindings`,bindings:[{context:`Chat`,bindings:{"ctrl+e":`chat:externalEditor`}}]},Hd={context:`Chat`,bindings:{"ctrl+s":null}},Ud={context:`Chat`,bindings:{"ctrl+g":null,"ctrl+e":`chat:externalEditor`}},Wd={context:`Global`,bindings:{"ctrl+k ctrl+t":`app:toggleTodos`}},Gd=[`# Keybindings Skill`,``,"Create or modify `~/.claude/keybindings.json` to customize keyboard shortcuts.",``,`## CRITICAL: Read Before Write`,``,"**Always read `~/.claude/keybindings.json` first** (it may not exist yet). Merge changes with existing bindings — never replace the entire file.",``,`- Use **Edit** tool for modifications to existing files`,`- Use **Write** tool only if the file does not exist yet`].join(`
|
|
142
|
+
`),Kd=[`## File Format`,``,"```json",Xn(Vd,null,2),"```",``,"Always include the `$schema` and `$docs` fields."].join(`
|
|
143
|
+
`),qd=[`## Keystroke Syntax`,``,"**Modifiers** (combine with `+`):","- `ctrl` (alias: `control`)","- `alt` (aliases: `opt`, `option`) — note: `alt` and `meta` are identical in terminals","- `shift`","- `meta` (aliases: `cmd`, `command`)",``,"**Special keys**: `escape`/`esc`, `enter`/`return`, `tab`, `space`, `backspace`, `delete`, `up`, `down`, `left`, `right`",``,"**Chords**: Space-separated keystrokes, e.g. `ctrl+k ctrl+s` (1-second timeout between keystrokes)",``,"**Examples**: `ctrl+shift+p`, `alt+enter`, `ctrl+k ctrl+n`"].join(`
|
|
144
|
+
`),Jd=[`## Unbinding Default Shortcuts`,``,"Set a key to `null` to remove its default binding:",``,"```json",Xn(Hd,null,2),"```"].join(`
|
|
145
|
+
`),Yd=[`## How User Bindings Interact with Defaults`,``,`- User bindings are **additive** — they are appended after the default bindings`,"- To **move** a binding to a different key: unbind the old key (`null`) AND add the new binding",`- A context only needs to appear in the user's file if they want to change something in that context`].join(`
|
|
146
|
+
`),Xd=[`## Common Patterns`,``,`### Rebind a key`,"To change the external editor shortcut from `ctrl+g` to `ctrl+e`:","```json",Xn(Ud,null,2),"```",``,`### Add a chord binding`,"```json",Xn(Wd,null,2),"```"].join(`
|
|
147
|
+
`),Zd=[`## Behavioral Rules`,``,`1. Only include contexts the user wants to change (minimal overrides)`,`2. Validate that actions and contexts are from the known lists below`,"3. Warn the user proactively if they choose a key that conflicts with reserved shortcuts or common tools like tmux (`ctrl+b`) and screen (`ctrl+a`)",`4. When adding a new binding for an existing action, the new binding is additive (existing default still works unless explicitly unbound)`,`5. To fully replace a default binding, unbind the old key AND add the new one`].join(`
|
|
148
|
+
`),Qd=[`## Validation with /doctor`,``,'The `/doctor` command includes a "Keybinding Configuration Issues" section that validates `~/.claude/keybindings.json`.',``,`### Common Issues and Fixes`,``,ef([`Issue`,`Cause`,`Fix`],[['`keybindings.json must have a "bindings" array`',`Missing wrapper object`,'Wrap bindings in `{ "bindings": [...] }`'],['`"bindings" must be an array`',"`bindings` is not an array",'Set `"bindings"` to an array: `[{ context: ..., bindings: ... }]`'],['`Unknown context "X"`',`Typo or invalid context name`,`Use exact context names from the Available Contexts table`],['`Duplicate key "X" in Y bindings`',`Same key defined twice in one context`,`Remove the duplicate; JSON uses only the last value`],['`"X" may not work: ...`',`Key conflicts with terminal/OS reserved shortcut`,`Choose a different key (see Reserved Shortcuts section)`],['`Could not parse keystroke "X"`',`Invalid key syntax`,"Check syntax: use `+` between modifiers, valid key names"],['`Invalid action for "X"`',`Action value is not a string or null`,'Actions must be strings like `"app:help"` or `null` to unbind']]),``,`### Example /doctor Output`,``,"```",`Keybinding Configuration Issues`,`Location: ~/.claude/keybindings.json`,` └ [Error] Unknown context "chat"`,` → Valid contexts: Global, Chat, Autocomplete, ...`,` └ [Warning] "ctrl+c" may not work: Terminal interrupt (SIGINT)`,"```",``,`**Errors** prevent bindings from working and must be fixed. **Warnings** indicate potential conflicts but the binding may still work.`].join(`
|
|
149
|
+
`);function $d(){G({name:`keybindings-help`,description:`Use when the user wants to customize keyboard shortcuts, rebind keys, add chord bindings, or modify ~/.claude/keybindings.json. Examples: "rebind ctrl+s", "add a chord shortcut", "change the submit key", "customize keybindings".`,allowedTools:[`Read`],userInvocable:!1,isEnabled:_o,async getPromptForCommand(e){let t=Ld(),n=Rd(),r=[Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,`## Reserved Shortcuts\n\n${Bd()}`,`## Available Contexts\n\n${t}`,`## Available Actions\n\n${n}`];return e&&r.push(`## User Request\n\n${e}`),[{type:`text`,text:r.join(`
|
|
150
|
+
|
|
151
|
+
`)}]}})}function ef(e,t){let n=e.map(()=>`---`);return[`| ${e.join(` | `)} |`,`| ${n.join(` | `)} |`,...t.map(e=>`| ${e.join(` | `)} |`)].join(`
|
|
152
|
+
`)}K();var tf=`the.a.an.I.you.he.she.it.we.they.me.him.her.us.them.my.your.his.its.our.this.that.what.who.is.are.was.were.be.been.have.has.had.do.does.did.will.would.can.could.may.might.must.shall.should.make.made.get.got.go.went.come.came.see.saw.know.take.think.look.want.use.find.give.tell.work.call.try.ask.need.feel.seem.leave.put.time.year.day.way.man.thing.life.hand.part.place.case.point.fact.good.new.first.last.long.great.little.own.other.old.right.big.high.small.large.next.early.young.few.public.bad.same.able.in.on.at.to.for.of.with.from.by.about.like.through.over.before.between.under.since.without.and.or.but.if.than.because.as.until.while.so.though.both.each.when.where.why.how.not.now.just.more.also.here.there.then.only.very.well.back.still.even.much.too.such.never.again.most.once.off.away.down.out.up.test.code.data.file.line.text.word.number.system.program.set.run.value.name.type.state.end.start`.split(`.`);function nf(e){let t=0,n=``;for(;t<e;){let r=10+Math.floor(Math.random()*11),i=0;for(let a=0;a<r&&t<e;a++){let o=tf[Math.floor(Math.random()*tf.length)];n+=o,t++,i++,a===r-1||t>=e?n+=`. `:n+=` `}i>0&&Math.random()<.2&&t<e&&(n+=`
|
|
153
|
+
|
|
154
|
+
`)}return n.trim()}function rf(){process.env.USER_TYPE===`ant`&&G({name:`lorem-ipsum`,description:`Generate filler text for long context testing. Specify token count as argument (e.g., /lorem-ipsum 50000). Outputs approximately the requested number of tokens. Ant-only.`,argumentHint:`[token_count]`,userInvocable:!0,async getPromptForCommand(e){let t=parseInt(e,10);if(e&&(isNaN(t)||t<=0))return[{type:`text`,text:`Invalid token count. Please provide a positive number (e.g., /lorem-ipsum 10000).`}];let n=t||1e4,r=Math.min(n,5e5);return r<n?[{type:`text`,text:`Requested ${n} tokens, but capped at 500,000 for safety.\n\n${nf(r)}`}]:[{type:`text`,text:nf(r)}]}})}K();function af(){process.env.USER_TYPE===`ant`&&G({name:`remember`,description:`Review auto-memory entries and propose promotions to CLAUDE.md, CLAUDE.local.md, or shared memory. Also detects outdated, conflicting, and duplicate entries across memory layers.`,whenToUse:`Use when the user wants to review, organize, or promote their auto-memory entries. Also useful for cleaning up outdated or conflicting entries across CLAUDE.md, CLAUDE.local.md, and auto-memory.`,userInvocable:!0,isEnabled:()=>Mn(),async getPromptForCommand(e){let t=`# Memory Review
|
|
155
|
+
|
|
156
|
+
## Goal
|
|
157
|
+
Review the user's memory landscape and produce a clear report of proposed changes, grouped by action type. Do NOT apply changes — present proposals for user approval.
|
|
158
|
+
|
|
159
|
+
## Steps
|
|
160
|
+
|
|
161
|
+
### 1. Gather all memory layers
|
|
162
|
+
Read CLAUDE.md and CLAUDE.local.md from the project root (if they exist). Your auto-memory content is already in your system prompt — review it there. Note which team memory sections exist, if any.
|
|
163
|
+
|
|
164
|
+
**Success criteria**: You have the contents of all memory layers and can compare them.
|
|
165
|
+
|
|
166
|
+
### 2. Classify each auto-memory entry
|
|
167
|
+
For each substantive entry in auto-memory, determine the best destination:
|
|
168
|
+
|
|
169
|
+
| Destination | What belongs there | Examples |
|
|
170
|
+
|---|---|---|
|
|
171
|
+
| **CLAUDE.md** | Project conventions and instructions for Claude that all contributors should follow | "use bun not npm", "API routes use kebab-case", "test command is bun test", "prefer functional style" |
|
|
172
|
+
| **CLAUDE.local.md** | Personal instructions for Claude specific to this user, not applicable to other contributors | "I prefer concise responses", "always explain trade-offs", "don't auto-commit", "run tests before committing" |
|
|
173
|
+
| **Team memory** | Org-wide knowledge that applies across repositories (only if team memory is configured) | "deploy PRs go through #deploy-queue", "staging is at staging.internal", "platform team owns infra" |
|
|
174
|
+
| **Stay in auto-memory** | Working notes, temporary context, or entries that don't clearly fit elsewhere | Session-specific observations, uncertain patterns |
|
|
175
|
+
|
|
176
|
+
**Important distinctions:**
|
|
177
|
+
- CLAUDE.md and CLAUDE.local.md contain instructions for Claude, not user preferences for external tools (editor theme, IDE keybindings, etc. don't belong in either)
|
|
178
|
+
- Workflow practices (PR conventions, merge strategies, branch naming) are ambiguous — ask the user whether they're personal or team-wide
|
|
179
|
+
- When unsure, ask rather than guess
|
|
180
|
+
|
|
181
|
+
**Success criteria**: Each entry has a proposed destination or is flagged as ambiguous.
|
|
182
|
+
|
|
183
|
+
### 3. Identify cleanup opportunities
|
|
184
|
+
Scan across all layers for:
|
|
185
|
+
- **Duplicates**: Auto-memory entries already captured in CLAUDE.md or CLAUDE.local.md → propose removing from auto-memory
|
|
186
|
+
- **Outdated**: CLAUDE.md or CLAUDE.local.md entries contradicted by newer auto-memory entries → propose updating the older layer
|
|
187
|
+
- **Conflicts**: Contradictions between any two layers → propose resolution, noting which is more recent
|
|
188
|
+
|
|
189
|
+
**Success criteria**: All cross-layer issues identified.
|
|
190
|
+
|
|
191
|
+
### 4. Present the report
|
|
192
|
+
Output a structured report grouped by action type:
|
|
193
|
+
1. **Promotions** — entries to move, with destination and rationale
|
|
194
|
+
2. **Cleanup** — duplicates, outdated entries, conflicts to resolve
|
|
195
|
+
3. **Ambiguous** — entries where you need the user's input on destination
|
|
196
|
+
4. **No action needed** — brief note on entries that should stay put
|
|
197
|
+
|
|
198
|
+
If auto-memory is empty, say so and offer to review CLAUDE.md for cleanup.
|
|
199
|
+
|
|
200
|
+
**Success criteria**: User can review and approve/reject each proposal individually.
|
|
201
|
+
|
|
202
|
+
## Rules
|
|
203
|
+
- Present ALL proposals before making any changes
|
|
204
|
+
- Do NOT modify files without explicit user approval
|
|
205
|
+
- Do NOT create new files unless the target doesn't exist yet
|
|
206
|
+
- Ask about ambiguous entries — don't guess
|
|
207
|
+
`;return e&&(t+=`\n## Additional context from user\n\n${e}`),[{type:`text`,text:t}]}})}An(),K();var of=`# Simplify: Code Review and Cleanup
|
|
208
|
+
|
|
209
|
+
Review all changed files for reuse, quality, and efficiency. Fix any issues found.
|
|
210
|
+
|
|
211
|
+
## Phase 1: Identify Changes
|
|
212
|
+
|
|
213
|
+
Run \`git diff\` (or \`git diff HEAD\` if there are staged changes) to see what changed. If there are no git changes, review the most recently modified files that the user mentioned or that you edited earlier in this conversation.
|
|
214
|
+
|
|
215
|
+
## Phase 2: Launch Three Review Agents in Parallel
|
|
216
|
+
|
|
217
|
+
Use the ${ot} tool to launch all three agents concurrently in a single message. Pass each agent the full diff so it has the complete context.
|
|
218
|
+
|
|
219
|
+
### Agent 1: Code Reuse Review
|
|
220
|
+
|
|
221
|
+
For each change:
|
|
222
|
+
|
|
223
|
+
1. **Search for existing utilities and helpers** that could replace newly written code. Look for similar patterns elsewhere in the codebase — common locations are utility directories, shared modules, and files adjacent to the changed ones.
|
|
224
|
+
2. **Flag any new function that duplicates existing functionality.** Suggest the existing function to use instead.
|
|
225
|
+
3. **Flag any inline logic that could use an existing utility** — hand-rolled string manipulation, manual path handling, custom environment checks, ad-hoc type guards, and similar patterns are common candidates.
|
|
226
|
+
|
|
227
|
+
### Agent 2: Code Quality Review
|
|
228
|
+
|
|
229
|
+
Review the same changes for hacky patterns:
|
|
230
|
+
|
|
231
|
+
1. **Redundant state**: state that duplicates existing state, cached values that could be derived, observers/effects that could be direct calls
|
|
232
|
+
2. **Parameter sprawl**: adding new parameters to a function instead of generalizing or restructuring existing ones
|
|
233
|
+
3. **Copy-paste with slight variation**: near-duplicate code blocks that should be unified with a shared abstraction
|
|
234
|
+
4. **Leaky abstractions**: exposing internal details that should be encapsulated, or breaking existing abstraction boundaries
|
|
235
|
+
5. **Stringly-typed code**: using raw strings where constants, enums (string unions), or branded types already exist in the codebase
|
|
236
|
+
6. **Unnecessary JSX nesting**: wrapper Boxes/elements that add no layout value — check if inner component props (flexShrink, alignItems, etc.) already provide the needed behavior
|
|
237
|
+
7. **Unnecessary comments**: comments explaining WHAT the code does (well-named identifiers already do that), narrating the change, or referencing the task/caller — delete; keep only non-obvious WHY (hidden constraints, subtle invariants, workarounds)
|
|
238
|
+
|
|
239
|
+
### Agent 3: Efficiency Review
|
|
240
|
+
|
|
241
|
+
Review the same changes for efficiency:
|
|
242
|
+
|
|
243
|
+
1. **Unnecessary work**: redundant computations, repeated file reads, duplicate network/API calls, N+1 patterns
|
|
244
|
+
2. **Missed concurrency**: independent operations run sequentially when they could run in parallel
|
|
245
|
+
3. **Hot-path bloat**: new blocking work added to startup or per-request/per-render hot paths
|
|
246
|
+
4. **Recurring no-op updates**: state/store updates inside polling loops, intervals, or event handlers that fire unconditionally — add a change-detection guard so downstream consumers aren't notified when nothing changed. Also: if a wrapper function takes an updater/reducer callback, verify it honors same-reference returns (or whatever the "no change" signal is) — otherwise callers' early-return no-ops are silently defeated
|
|
247
|
+
5. **Unnecessary existence checks**: pre-checking file/resource existence before operating (TOCTOU anti-pattern) — operate directly and handle the error
|
|
248
|
+
6. **Memory**: unbounded data structures, missing cleanup, event listener leaks
|
|
249
|
+
7. **Overly broad operations**: reading entire files when only a portion is needed, loading all items when filtering for one
|
|
250
|
+
|
|
251
|
+
## Phase 3: Fix Issues
|
|
252
|
+
|
|
253
|
+
Wait for all three agents to complete. Aggregate their findings and fix each issue directly. If a finding is a false positive or not worth addressing, note it and move on — do not argue with the finding, just skip it.
|
|
254
|
+
|
|
255
|
+
When done, briefly summarize what was fixed (or confirm the code was already clean).
|
|
256
|
+
`;function sf(){G({name:`simplify`,description:`Review changed code for reuse, quality, and efficiency, then fix any issues found.`,userInvocable:!0,async getPromptForCommand(e){let t=of;return e&&(t+=`\n\n## Additional Focus\n\n${e}`),[{type:`text`,text:t}]}})}Qi(),K();function cf(e){return e.filter(e=>e.type===`user`).map(e=>{let t=e.message?.content;return typeof t==`string`?t:Array.isArray(t)?t.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
257
|
+
`):``}).filter(e=>e.trim().length>0)}var lf=`# Skillify {{userDescriptionBlock}}
|
|
258
|
+
|
|
259
|
+
You are capturing this session's repeatable process as a reusable skill.
|
|
260
|
+
|
|
261
|
+
## Your Session Context
|
|
262
|
+
|
|
263
|
+
Here is the session memory summary:
|
|
264
|
+
<session_memory>
|
|
265
|
+
{{sessionMemory}}
|
|
266
|
+
</session_memory>
|
|
267
|
+
|
|
268
|
+
Here are the user's messages during this session. Pay attention to how they steered the process, to help capture their detailed preferences in the skill:
|
|
269
|
+
<user_messages>
|
|
270
|
+
{{userMessages}}
|
|
271
|
+
</user_messages>
|
|
272
|
+
|
|
273
|
+
## Your Task
|
|
274
|
+
|
|
275
|
+
### Step 1: Analyze the Session
|
|
276
|
+
|
|
277
|
+
Before asking any questions, analyze the session to identify:
|
|
278
|
+
- What repeatable process was performed
|
|
279
|
+
- What the inputs/parameters were
|
|
280
|
+
- The distinct steps (in order)
|
|
281
|
+
- The success artifacts/criteria (e.g. not just "writing code," but "an open PR with CI fully passing") for each step
|
|
282
|
+
- Where the user corrected or steered you
|
|
283
|
+
- What tools and permissions were needed
|
|
284
|
+
- What agents were used
|
|
285
|
+
- What the goals and success artifacts were
|
|
286
|
+
|
|
287
|
+
### Step 2: Interview the User
|
|
288
|
+
|
|
289
|
+
You will use the AskUserQuestion to understand what the user wants to automate. Important notes:
|
|
290
|
+
- Use AskUserQuestion for ALL questions! Never ask questions via plain text.
|
|
291
|
+
- For each round, iterate as much as needed until the user is happy.
|
|
292
|
+
- The user always has a freeform "Other" option to type edits or feedback -- do NOT add your own "Needs tweaking" or "I'll provide edits" option. Just offer the substantive choices.
|
|
293
|
+
|
|
294
|
+
**Round 1: High level confirmation**
|
|
295
|
+
- Suggest a name and description for the skill based on your analysis. Ask the user to confirm or rename.
|
|
296
|
+
- Suggest high-level goal(s) and specific success criteria for the skill.
|
|
297
|
+
|
|
298
|
+
**Round 2: More details**
|
|
299
|
+
- Present the high-level steps you identified as a numbered list. Tell the user you will dig into the detail in the next round.
|
|
300
|
+
- If you think the skill will require arguments, suggest arguments based on what you observed. Make sure you understand what someone would need to provide.
|
|
301
|
+
- If it's not clear, ask if this skill should run inline (in the current conversation) or forked (as a sub-agent with its own context). Forked is better for self-contained tasks that don't need mid-process user input; inline is better when the user wants to steer mid-process.
|
|
302
|
+
- Ask where the skill should be saved. Suggest a default based on context (repo-specific workflows → repo, cross-repo personal workflows → user). Options:
|
|
303
|
+
- **This repo** (\`.claude/skills/<name>/SKILL.md\`) — for workflows specific to this project
|
|
304
|
+
- **Personal** (\`~/.claude/skills/<name>/SKILL.md\`) — follows you across all repos
|
|
305
|
+
|
|
306
|
+
**Round 3: Breaking down each step**
|
|
307
|
+
For each major step, if it's not glaringly obvious, ask:
|
|
308
|
+
- What does this step produce that later steps need? (data, artifacts, IDs)
|
|
309
|
+
- What proves that this step succeeded, and that we can move on?
|
|
310
|
+
- Should the user be asked to confirm before proceeding? (especially for irreversible actions like merging, sending messages, or destructive operations)
|
|
311
|
+
- Are any steps independent and could run in parallel? (e.g., posting to Slack and monitoring CI at the same time)
|
|
312
|
+
- How should the skill be executed? (e.g. always use a Task agent to conduct code review, or invoke an agent team for a set of concurrent steps)
|
|
313
|
+
- What are the hard constraints or hard preferences? Things that must or must not happen?
|
|
314
|
+
|
|
315
|
+
You may do multiple rounds of AskUserQuestion here, one round per step, especially if there are more than 3 steps or many clarification questions. Iterate as much as needed.
|
|
316
|
+
|
|
317
|
+
IMPORTANT: Pay special attention to places where the user corrected you during the session, to help inform your design.
|
|
318
|
+
|
|
319
|
+
**Round 4: Final questions**
|
|
320
|
+
- Confirm when this skill should be invoked, and suggest/confirm trigger phrases too. (e.g. For a cherrypick workflow you could say: Use when the user wants to cherry-pick a PR to a release branch. Examples: 'cherry-pick to release', 'CP this PR', 'hotfix.')
|
|
321
|
+
- You can also ask for any other gotchas or things to watch out for, if it's still unclear.
|
|
322
|
+
|
|
323
|
+
Stop interviewing once you have enough information. IMPORTANT: Don't over-ask for simple processes!
|
|
324
|
+
|
|
325
|
+
### Step 3: Write the SKILL.md
|
|
326
|
+
|
|
327
|
+
Create the skill directory and file at the location the user chose in Round 2.
|
|
328
|
+
|
|
329
|
+
Use this format:
|
|
330
|
+
|
|
331
|
+
\`\`\`markdown
|
|
332
|
+
---
|
|
333
|
+
name: {{skill-name}}
|
|
334
|
+
description: {{one-line description}}
|
|
335
|
+
allowed-tools:
|
|
336
|
+
{{list of tool permission patterns observed during session}}
|
|
337
|
+
when_to_use: {{detailed description of when Claude should automatically invoke this skill, including trigger phrases and example user messages}}
|
|
338
|
+
argument-hint: "{{hint showing argument placeholders}}"
|
|
339
|
+
arguments:
|
|
340
|
+
{{list of argument names}}
|
|
341
|
+
context: {{inline or fork -- omit for inline}}
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
# {{Skill Title}}
|
|
345
|
+
Description of skill
|
|
346
|
+
|
|
347
|
+
## Inputs
|
|
348
|
+
- \`$arg_name\`: Description of this input
|
|
349
|
+
|
|
350
|
+
## Goal
|
|
351
|
+
Clearly stated goal for this workflow. Best if you have clearly defined artifacts or criteria for completion.
|
|
352
|
+
|
|
353
|
+
## Steps
|
|
354
|
+
|
|
355
|
+
### 1. Step Name
|
|
356
|
+
What to do in this step. Be specific and actionable. Include commands when appropriate.
|
|
357
|
+
|
|
358
|
+
**Success criteria**: ALWAYS include this! This shows that the step is done and we can move on. Can be a list.
|
|
359
|
+
|
|
360
|
+
IMPORTANT: see the next section below for the per-step annotations you can optionally include for each step.
|
|
361
|
+
|
|
362
|
+
...
|
|
363
|
+
\`\`\`
|
|
364
|
+
|
|
365
|
+
**Per-step annotations**:
|
|
366
|
+
- **Success criteria** is REQUIRED on every step. This helps the model understand what the user expects from their workflow, and when it should have the confidence to move on.
|
|
367
|
+
- **Execution**: \`Direct\` (default), \`Task agent\` (straightforward subagents), \`Teammate\` (agent with true parallelism and inter-agent communication), or \`[human]\` (user does it). Only needs specifying if not Direct.
|
|
368
|
+
- **Artifacts**: Data this step produces that later steps need (e.g., PR number, commit SHA). Only include if later steps depend on it.
|
|
369
|
+
- **Human checkpoint**: When to pause and ask the user before proceeding. Include for irreversible actions (merging, sending messages), error judgment (merge conflicts), or output review.
|
|
370
|
+
- **Rules**: Hard rules for the workflow. User corrections during the reference session can be especially useful here.
|
|
371
|
+
|
|
372
|
+
**Step structure tips:**
|
|
373
|
+
- Steps that can run concurrently use sub-numbers: 3a, 3b
|
|
374
|
+
- Steps requiring the user to act get \`[human]\` in the title
|
|
375
|
+
- Keep simple skills simple -- a 2-step skill doesn't need annotations on every step
|
|
376
|
+
|
|
377
|
+
**Frontmatter rules:**
|
|
378
|
+
- \`allowed-tools\`: Minimum permissions needed (use patterns like \`Bash(gh:*)\` not \`Bash\`)
|
|
379
|
+
- \`context\`: Only set \`context: fork\` for self-contained skills that don't need mid-process user input.
|
|
380
|
+
- \`when_to_use\` is CRITICAL -- tells the model when to auto-invoke. Start with "Use when..." and include trigger phrases. Example: "Use when the user wants to cherry-pick a PR to a release branch. Examples: 'cherry-pick to release', 'CP this PR', 'hotfix'."
|
|
381
|
+
- \`arguments\` and \`argument-hint\`: Only include if the skill takes parameters. Use \`$name\` in the body for substitution.
|
|
382
|
+
|
|
383
|
+
### Step 4: Confirm and Save
|
|
384
|
+
|
|
385
|
+
Before writing the file, output the complete SKILL.md content as a yaml code block in your response so the user can review it with proper syntax highlighting. Then ask for confirmation using AskUserQuestion with a simple question like "Does this SKILL.md look good to save?" — do NOT use the body field, keep the question concise.
|
|
386
|
+
|
|
387
|
+
After writing, tell the user:
|
|
388
|
+
- Where the skill was saved
|
|
389
|
+
- How to invoke it: \`/{{skill-name}} [arguments]\`
|
|
390
|
+
- That they can edit the SKILL.md directly to refine it
|
|
391
|
+
`;function uf(){process.env.USER_TYPE===`ant`&&G({name:`skillify`,description:`Capture this session's repeatable process into a skill. Call at end of the process you want to capture with an optional description.`,allowedTools:[`Read`,`Write`,`Edit`,`Glob`,`Grep`,`AskUserQuestion`,`Bash(mkdir:*)`],userInvocable:!0,disableModelInvocation:!0,argumentHint:`[description of the process you want to capture]`,async getPromptForCommand(e,t){let n=await Za()??`No session memory available.`,r=cf(Sa(t.messages)),i=e?`The user described this process as: "${e}"`:``;return[{type:`text`,text:lf.replace(`{{sessionMemory}}`,n).replace(`{{userMessages}}`,r.join(`
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
`)).replace(`{{userDescriptionBlock}}`,i)}]}})}K();var df=`# /stuck — diagnose frozen/slow Claude Code sessions
|
|
396
|
+
|
|
397
|
+
The user thinks another Claude Code session on this machine is frozen, stuck, or very slow. Investigate and post a report to #claude-code-feedback.
|
|
398
|
+
|
|
399
|
+
## What to look for
|
|
400
|
+
|
|
401
|
+
Scan for other Claude Code processes (excluding the current one — PID is in \`process.pid\` but for shell commands just exclude the PID you see running this prompt). Process names are typically \`claude\` (installed) or \`cli\` (native dev build).
|
|
402
|
+
|
|
403
|
+
Signs of a stuck session:
|
|
404
|
+
- **High CPU (≥90%) sustained** — likely an infinite loop. Sample twice, 1-2s apart, to confirm it's not a transient spike.
|
|
405
|
+
- **Process state \`D\` (uninterruptible sleep)** — often an I/O hang. The \`state\` column in \`ps\` output; first character matters (ignore modifiers like \`+\`, \`s\`, \`<\`).
|
|
406
|
+
- **Process state \`T\` (stopped)** — user probably hit Ctrl+Z by accident.
|
|
407
|
+
- **Process state \`Z\` (zombie)** — parent isn't reaping.
|
|
408
|
+
- **Very high RSS (≥4GB)** — possible memory leak making the session sluggish.
|
|
409
|
+
- **Stuck child process** — a hung \`git\`, \`node\`, or shell subprocess can freeze the parent. Check \`pgrep -lP <pid>\` for each session.
|
|
410
|
+
|
|
411
|
+
## Investigation steps
|
|
412
|
+
|
|
413
|
+
1. **List all Claude Code processes** (macOS/Linux):
|
|
414
|
+
\`\`\`
|
|
415
|
+
ps -axo pid=,pcpu=,rss=,etime=,state=,comm=,command= | grep -E '(claude|cli)' | grep -v grep
|
|
416
|
+
\`\`\`
|
|
417
|
+
Filter to rows where \`comm\` is \`claude\` or (\`cli\` AND the command path contains "claude").
|
|
418
|
+
|
|
419
|
+
2. **For anything suspicious**, gather more context:
|
|
420
|
+
- Child processes: \`pgrep -lP <pid>\`
|
|
421
|
+
- If high CPU: sample again after 1-2s to confirm it's sustained
|
|
422
|
+
- If a child looks hung (e.g., a git command), note its full command line with \`ps -p <child_pid> -o command=\`
|
|
423
|
+
- Check the session's debug log if you can infer the session ID: \`~/.claude/debug/<session-id>.txt\` (the last few hundred lines often show what it was doing before hanging)
|
|
424
|
+
|
|
425
|
+
3. **Consider a stack dump** for a truly frozen process (advanced, optional):
|
|
426
|
+
- macOS: \`sample <pid> 3\` gives a 3-second native stack sample
|
|
427
|
+
- This is big — only grab it if the process is clearly hung and you want to know *why*
|
|
428
|
+
|
|
429
|
+
## Report
|
|
430
|
+
|
|
431
|
+
**Only post to Slack if you actually found something stuck.** If every session looks healthy, tell the user that directly — do not post an all-clear to the channel.
|
|
432
|
+
|
|
433
|
+
If you did find a stuck/slow session, post to **#claude-code-feedback** (channel ID: \`C07VBSHV7EV\`) using the Slack MCP tool. Use SearchExtraTools to find \`slack_send_message\` if it's not already loaded.
|
|
434
|
+
|
|
435
|
+
**Use a two-message structure** to keep the channel scannable:
|
|
436
|
+
|
|
437
|
+
1. **Top-level message** — one short line: hostname, Claude Code version, and a terse symptom (e.g. "session PID 12345 pegged at 100% CPU for 10min" or "git subprocess hung in D state"). No code blocks, no details.
|
|
438
|
+
2. **Thread reply** — the full diagnostic dump. Pass the top-level message's \`ts\` as \`thread_ts\`. Include:
|
|
439
|
+
- PID, CPU%, RSS, state, uptime, command line, child processes
|
|
440
|
+
- Your diagnosis of what's likely wrong
|
|
441
|
+
- Relevant debug log tail or \`sample\` output if you captured it
|
|
442
|
+
|
|
443
|
+
If Slack MCP isn't available, format the report as a message the user can copy-paste into #claude-code-feedback (and let them know to thread the details themselves).
|
|
444
|
+
|
|
445
|
+
## Notes
|
|
446
|
+
- Don't kill or signal any processes — this is diagnostic only.
|
|
447
|
+
- If the user gave an argument (e.g., a specific PID or symptom), focus there first.
|
|
448
|
+
`;function ff(){process.env.USER_TYPE===`ant`&&G({name:`stuck`,description:`[ANT-ONLY] Investigate frozen/stuck/slow Claude Code sessions on this machine and post a diagnostic report to #claude-code-feedback.`,userInvocable:!0,async getPromptForCommand(e){let t=df;return e&&(t+=`\n## User-provided context\n\n${e}\n`),[{type:`text`,text:t}]}})}Fc(),K();function pf(){G({name:`cron-list`,description:`List all scheduled cron jobs in this session`,whenToUse:`When the user wants to see their scheduled/recurring tasks, check active cron jobs, or review what is currently looping.`,userInvocable:!0,isEnabled:Lc,async getPromptForCommand(){return[{type:`text`,text:`Call ${Nc} to list all scheduled cron jobs. Display the results in a table with columns: ID, Schedule, Prompt, Recurring, Durable. If no jobs exist, say "No scheduled tasks."`}]}})}function mf(){G({name:`cron-delete`,description:`Cancel a scheduled cron job by ID`,whenToUse:`When the user wants to cancel, stop, or remove a scheduled/recurring task or cron job.`,argumentHint:`<job-id>`,userInvocable:!0,isEnabled:Lc,async getPromptForCommand(e){let t=e.trim();return t?[{type:`text`,text:`Call ${Kc} with id "${t}" to cancel that scheduled job. Confirm the result to the user.`}]:[{type:`text`,text:`Usage: /cron-delete <job-id>
|
|
449
|
+
|
|
450
|
+
Provide the job ID to cancel. Use /cron-list to see active jobs and their IDs.`}]}})}Fc(),K();var hf=`10m`,gf=`Usage: /loop [interval] <prompt>
|
|
451
|
+
|
|
452
|
+
Run a prompt or slash command on a recurring interval.
|
|
453
|
+
|
|
454
|
+
Intervals: Ns, Nm, Nh, Nd (e.g. 5m, 30m, 2h, 1d). Minimum granularity is 1 minute.
|
|
455
|
+
If no interval is specified, defaults to ${hf}.
|
|
456
|
+
|
|
457
|
+
Examples:
|
|
458
|
+
/loop 5m /babysit-prs
|
|
459
|
+
/loop 30m check the deploy
|
|
460
|
+
/loop 1h /standup 1
|
|
461
|
+
/loop check the deploy (defaults to ${hf})
|
|
462
|
+
/loop check the deploy every 20m`;function _f(e){return`# /loop — schedule a recurring prompt
|
|
463
|
+
|
|
464
|
+
Parse the input below into \`[interval] <prompt…>\` and schedule it with ${zc}.
|
|
465
|
+
|
|
466
|
+
## Parsing (in priority order)
|
|
467
|
+
|
|
468
|
+
1. **Leading token**: if the first whitespace-delimited token matches \`^\\d+[smhd]$\` (e.g. \`5m\`, \`2h\`), that's the interval; the rest is the prompt.
|
|
469
|
+
2. **Trailing "every" clause**: otherwise, if the input ends with \`every <N><unit>\` or \`every <N> <unit-word>\` (e.g. \`every 20m\`, \`every 5 minutes\`, \`every 2 hours\`), extract that as the interval and strip it from the prompt. Only match when what follows "every" is a time expression — \`check every PR\` has no interval.
|
|
470
|
+
3. **Default**: otherwise, interval is \`${hf}\` and the entire input is the prompt.
|
|
471
|
+
|
|
472
|
+
If the resulting prompt is empty, show usage \`/loop [interval] <prompt>\` and stop — do not call ${zc}.
|
|
473
|
+
|
|
474
|
+
Examples:
|
|
475
|
+
- \`5m /babysit-prs\` → interval \`5m\`, prompt \`/babysit-prs\` (rule 1)
|
|
476
|
+
- \`check the deploy every 20m\` → interval \`20m\`, prompt \`check the deploy\` (rule 2)
|
|
477
|
+
- \`run tests every 5 minutes\` → interval \`5m\`, prompt \`run tests\` (rule 2)
|
|
478
|
+
- \`check the deploy\` → interval \`${hf}\`, prompt \`check the deploy\` (rule 3)
|
|
479
|
+
- \`check every PR\` → interval \`${hf}\`, prompt \`check every PR\` (rule 3 — "every" not followed by time)
|
|
480
|
+
- \`5m\` → empty prompt → show usage
|
|
481
|
+
|
|
482
|
+
## Interval → cron
|
|
483
|
+
|
|
484
|
+
Supported suffixes: \`s\` (seconds, rounded up to nearest minute, min 1), \`m\` (minutes), \`h\` (hours), \`d\` (days). Convert:
|
|
485
|
+
|
|
486
|
+
| Interval pattern | Cron expression | Notes |
|
|
487
|
+
|-----------------------|---------------------|------------------------------------------|
|
|
488
|
+
| \`Nm\` where N ≤ 59 | \`*/N * * * *\` | every N minutes |
|
|
489
|
+
| \`Nm\` where N ≥ 60 | \`0 */H * * *\` | round to hours (H = N/60, must divide 24)|
|
|
490
|
+
| \`Nh\` where N ≤ 23 | \`0 */N * * *\` | every N hours |
|
|
491
|
+
| \`Nd\` | \`0 0 */N * *\` | every N days at midnight local |
|
|
492
|
+
| \`Ns\` | treat as \`ceil(N/60)m\` | cron minimum granularity is 1 minute |
|
|
493
|
+
|
|
494
|
+
**If the interval doesn't cleanly divide its unit** (e.g. \`7m\` → \`*/7 * * * *\` gives uneven gaps at :56→:00; \`90m\` → 1.5h which cron can't express), pick the nearest clean interval and tell the user what you rounded to before scheduling.
|
|
495
|
+
|
|
496
|
+
## Action
|
|
497
|
+
|
|
498
|
+
1. Call ${zc} with:
|
|
499
|
+
- \`cron\`: the expression from the table above
|
|
500
|
+
- \`prompt\`: the parsed prompt from above, verbatim (slash commands are passed through unchanged)
|
|
501
|
+
- \`recurring\`: \`true\`
|
|
502
|
+
2. Briefly confirm: what's scheduled, the cron expression, the human-readable cadence, that recurring tasks auto-expire after ${Mc} days, and that they can cancel sooner with ${Kc} (include the job ID).
|
|
503
|
+
3. **Then immediately execute the parsed prompt now** — don't wait for the first cron fire. If it's a slash command, invoke it via the Skill tool; otherwise act on it directly.
|
|
504
|
+
|
|
505
|
+
## Input
|
|
506
|
+
|
|
507
|
+
${e}`}function vf(){G({name:`loop`,description:`Run a prompt or slash command on a recurring interval (e.g. /loop 5m /foo, defaults to 10m)`,whenToUse:`When the user wants to set up a recurring task, poll for status, or run something repeatedly on an interval (e.g. "check the deploy every 5 minutes", "keep running /babysit-prs"). Do NOT invoke for one-off tasks.`,argumentHint:`[interval] <prompt>`,userInvocable:!0,isEnabled:Lc,async getPromptForCommand(e){let t=e.trim();return t?[{type:`text`,text:_f(t)}]:[{type:`text`,text:gf}]}})}M(),Us(),bs(),T(),K();var yf=`# Dream: Memory Consolidation (manual run)
|
|
508
|
+
|
|
509
|
+
You are performing a manual dream — a reflective pass over your memory files. Unlike the automatic background dream, this run has full tool permissions and the user is watching. Synthesize what you've learned recently into durable, well-organized memories so that future sessions can orient quickly.
|
|
510
|
+
|
|
511
|
+
`;function bf(){G({name:`dream`,description:`Manually trigger memory consolidation — review, organize, and prune your auto-memory files.`,whenToUse:`Use when the user says /dream or wants to manually consolidate memories, organize memory files, or clean up stale entries.`,userInvocable:!0,isEnabled:()=>Mn(),async getPromptForCommand(e){let t=xn(),n=wo(Ye());await Ro();let r=yf+ia(t,n,``);return e&&(r+=`\n\n## Additional context from user\n\n${e}`),[{type:`text`,text:r}]}})}ue(),pr(),K();function xf(){return Xn(ae(Wn(),{io:`input`}),null,2)}var Sf=`## Settings File Locations
|
|
512
|
+
|
|
513
|
+
Choose the appropriate file based on scope:
|
|
514
|
+
|
|
515
|
+
| File | Scope | Git | Use For |
|
|
516
|
+
|------|-------|-----|---------|
|
|
517
|
+
| \`~/.claude/settings.json\` | Global | N/A | Personal preferences for all projects |
|
|
518
|
+
| \`.claude/settings.json\` | Project | Commit | Team-wide hooks, permissions, plugins |
|
|
519
|
+
| \`.claude/settings.local.json\` | Project | Gitignore | Personal overrides for this project |
|
|
520
|
+
|
|
521
|
+
Settings load in order: user → project → local (later overrides earlier).
|
|
522
|
+
|
|
523
|
+
## Settings Schema Reference
|
|
524
|
+
|
|
525
|
+
### Permissions
|
|
526
|
+
\`\`\`json
|
|
527
|
+
{
|
|
528
|
+
"permissions": {
|
|
529
|
+
"allow": ["Bash(npm:*)", "Edit(.claude)", "Read"],
|
|
530
|
+
"deny": ["Bash(rm -rf:*)"],
|
|
531
|
+
"ask": ["Write(/etc/*)"],
|
|
532
|
+
"defaultMode": "default" | "plan" | "acceptEdits" | "dontAsk",
|
|
533
|
+
"additionalDirectories": ["/extra/dir"]
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
\`\`\`
|
|
537
|
+
|
|
538
|
+
**Permission Rule Syntax:**
|
|
539
|
+
- Exact match: \`"Bash(npm run test)"\`
|
|
540
|
+
- Prefix wildcard: \`"Bash(git:*)"\` - matches \`git status\`, \`git commit\`, etc.
|
|
541
|
+
- Tool only: \`"Read"\` - allows all Read operations
|
|
542
|
+
|
|
543
|
+
### Environment Variables
|
|
544
|
+
\`\`\`json
|
|
545
|
+
{
|
|
546
|
+
"env": {
|
|
547
|
+
"DEBUG": "true",
|
|
548
|
+
"MY_API_KEY": "value"
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
\`\`\`
|
|
552
|
+
|
|
553
|
+
### Model & Agent
|
|
554
|
+
\`\`\`json
|
|
555
|
+
{
|
|
556
|
+
"model": "sonnet", // or "opus", "haiku", full model ID
|
|
557
|
+
"agent": "agent-name",
|
|
558
|
+
"alwaysThinkingEnabled": true
|
|
559
|
+
}
|
|
560
|
+
\`\`\`
|
|
561
|
+
|
|
562
|
+
### Attribution (Commits & PRs)
|
|
563
|
+
\`\`\`json
|
|
564
|
+
{
|
|
565
|
+
"attribution": {
|
|
566
|
+
"commit": "Custom commit trailer text",
|
|
567
|
+
"pr": "Custom PR description text"
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
\`\`\`
|
|
571
|
+
Set \`commit\` or \`pr\` to empty string \`""\` to hide that attribution.
|
|
572
|
+
|
|
573
|
+
### MCP Server Management
|
|
574
|
+
\`\`\`json
|
|
575
|
+
{
|
|
576
|
+
"enableAllProjectMcpServers": true,
|
|
577
|
+
"enabledMcpjsonServers": ["server1", "server2"],
|
|
578
|
+
"disabledMcpjsonServers": ["blocked-server"]
|
|
579
|
+
}
|
|
580
|
+
\`\`\`
|
|
581
|
+
|
|
582
|
+
### Plugins
|
|
583
|
+
\`\`\`json
|
|
584
|
+
{
|
|
585
|
+
"enabledPlugins": {
|
|
586
|
+
"formatter@anthropic-tools": true
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
\`\`\`
|
|
590
|
+
Plugin syntax: \`plugin-name@source\` where source is \`claude-code-marketplace\`, \`claude-plugins-official\`, or \`builtin\`.
|
|
591
|
+
|
|
592
|
+
### Other Settings
|
|
593
|
+
- \`language\`: Preferred response language (e.g., "japanese")
|
|
594
|
+
- \`cleanupPeriodDays\`: Days to keep transcripts (default: 30; 0 disables persistence entirely)
|
|
595
|
+
- \`respectGitignore\`: Whether to respect .gitignore (default: true)
|
|
596
|
+
- \`spinnerTipsEnabled\`: Show tips in spinner
|
|
597
|
+
- \`spinnerVerbs\`: Customize spinner verbs (\`{ "mode": "append" | "replace", "verbs": [...] }\`)
|
|
598
|
+
- \`spinnerTipsOverride\`: Override spinner tips (\`{ "excludeDefault": true, "tips": ["Custom tip"] }\`)
|
|
599
|
+
- \`syntaxHighlightingDisabled\`: Disable diff highlighting
|
|
600
|
+
`,Cf=`## Hooks Configuration
|
|
601
|
+
|
|
602
|
+
Hooks run commands at specific points in Claude Code's lifecycle.
|
|
603
|
+
|
|
604
|
+
### Hook Structure
|
|
605
|
+
\`\`\`json
|
|
606
|
+
{
|
|
607
|
+
"hooks": {
|
|
608
|
+
"EVENT_NAME": [
|
|
609
|
+
{
|
|
610
|
+
"matcher": "ToolName|OtherTool",
|
|
611
|
+
"hooks": [
|
|
612
|
+
{
|
|
613
|
+
"type": "command",
|
|
614
|
+
"command": "your-command-here",
|
|
615
|
+
"timeout": 60,
|
|
616
|
+
"statusMessage": "Running..."
|
|
617
|
+
}
|
|
618
|
+
]
|
|
619
|
+
}
|
|
620
|
+
]
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
\`\`\`
|
|
624
|
+
|
|
625
|
+
### Hook Events
|
|
626
|
+
|
|
627
|
+
| Event | Matcher | Purpose |
|
|
628
|
+
|-------|---------|---------|
|
|
629
|
+
| PermissionRequest | Tool name | Run before permission prompt |
|
|
630
|
+
| PreToolUse | Tool name | Run before tool, can block |
|
|
631
|
+
| PostToolUse | Tool name | Run after successful tool |
|
|
632
|
+
| PostToolUseFailure | Tool name | Run after tool fails |
|
|
633
|
+
| Notification | Notification type | Run on notifications |
|
|
634
|
+
| Stop | - | Run when Claude stops (including clear, resume, compact) |
|
|
635
|
+
| PreCompact | "manual"/"auto" | Before compaction |
|
|
636
|
+
| PostCompact | "manual"/"auto" | After compaction (receives summary) |
|
|
637
|
+
| UserPromptSubmit | - | When user submits |
|
|
638
|
+
| SessionStart | - | When session starts |
|
|
639
|
+
|
|
640
|
+
**Common tool matchers:** \`Bash\`, \`Write\`, \`Edit\`, \`Read\`, \`Glob\`, \`Grep\`
|
|
641
|
+
|
|
642
|
+
### Hook Types
|
|
643
|
+
|
|
644
|
+
**1. Command Hook** - Runs a shell command:
|
|
645
|
+
\`\`\`json
|
|
646
|
+
{ "type": "command", "command": "prettier --write $FILE", "timeout": 30 }
|
|
647
|
+
\`\`\`
|
|
648
|
+
|
|
649
|
+
**2. Prompt Hook** - Evaluates a condition with LLM:
|
|
650
|
+
\`\`\`json
|
|
651
|
+
{ "type": "prompt", "prompt": "Is this safe? $ARGUMENTS" }
|
|
652
|
+
\`\`\`
|
|
653
|
+
Only available for tool events: PreToolUse, PostToolUse, PermissionRequest.
|
|
654
|
+
|
|
655
|
+
**3. Agent Hook** - Runs an agent with tools:
|
|
656
|
+
\`\`\`json
|
|
657
|
+
{ "type": "agent", "prompt": "Verify tests pass: $ARGUMENTS" }
|
|
658
|
+
\`\`\`
|
|
659
|
+
Only available for tool events: PreToolUse, PostToolUse, PermissionRequest.
|
|
660
|
+
|
|
661
|
+
### Hook Input (stdin JSON)
|
|
662
|
+
\`\`\`json
|
|
663
|
+
{
|
|
664
|
+
"session_id": "abc123",
|
|
665
|
+
"tool_name": "Write",
|
|
666
|
+
"tool_input": { "file_path": "/path/to/file.txt", "content": "..." },
|
|
667
|
+
"tool_response": { "success": true } // PostToolUse only
|
|
668
|
+
}
|
|
669
|
+
\`\`\`
|
|
670
|
+
|
|
671
|
+
### Hook JSON Output
|
|
672
|
+
|
|
673
|
+
Hooks can return JSON to control behavior:
|
|
674
|
+
|
|
675
|
+
\`\`\`json
|
|
676
|
+
{
|
|
677
|
+
"systemMessage": "Warning shown to user in UI",
|
|
678
|
+
"continue": false,
|
|
679
|
+
"stopReason": "Message shown when blocking",
|
|
680
|
+
"suppressOutput": false,
|
|
681
|
+
"decision": "block",
|
|
682
|
+
"reason": "Explanation for decision",
|
|
683
|
+
"hookSpecificOutput": {
|
|
684
|
+
"hookEventName": "PostToolUse",
|
|
685
|
+
"additionalContext": "Context injected back to model"
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
\`\`\`
|
|
689
|
+
|
|
690
|
+
**Fields:**
|
|
691
|
+
- \`systemMessage\` - Display a message to the user (all hooks)
|
|
692
|
+
- \`continue\` - Set to \`false\` to block/stop (default: true)
|
|
693
|
+
- \`stopReason\` - Message shown when \`continue\` is false
|
|
694
|
+
- \`suppressOutput\` - Hide stdout from transcript (default: false)
|
|
695
|
+
- \`decision\` - "block" for PostToolUse/Stop/UserPromptSubmit hooks (deprecated for PreToolUse, use hookSpecificOutput.permissionDecision instead)
|
|
696
|
+
- \`reason\` - Explanation for decision
|
|
697
|
+
- \`hookSpecificOutput\` - Event-specific output (must include \`hookEventName\`):
|
|
698
|
+
- \`additionalContext\` - Text injected into model context
|
|
699
|
+
- \`permissionDecision\` - "allow", "deny", or "ask" (PreToolUse only)
|
|
700
|
+
- \`permissionDecisionReason\` - Reason for the permission decision (PreToolUse only)
|
|
701
|
+
- \`updatedInput\` - Modified tool input (PreToolUse only)
|
|
702
|
+
|
|
703
|
+
### Common Patterns
|
|
704
|
+
|
|
705
|
+
**Auto-format after writes:**
|
|
706
|
+
\`\`\`json
|
|
707
|
+
{
|
|
708
|
+
"hooks": {
|
|
709
|
+
"PostToolUse": [{
|
|
710
|
+
"matcher": "Write|Edit",
|
|
711
|
+
"hooks": [{
|
|
712
|
+
"type": "command",
|
|
713
|
+
"command": "jq -r '.tool_response.filePath // .tool_input.file_path' | { read -r f; prettier --write \\"$f\\"; } 2>/dev/null || true"
|
|
714
|
+
}]
|
|
715
|
+
}]
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
\`\`\`
|
|
719
|
+
|
|
720
|
+
**Log all bash commands:**
|
|
721
|
+
\`\`\`json
|
|
722
|
+
{
|
|
723
|
+
"hooks": {
|
|
724
|
+
"PreToolUse": [{
|
|
725
|
+
"matcher": "Bash",
|
|
726
|
+
"hooks": [{
|
|
727
|
+
"type": "command",
|
|
728
|
+
"command": "jq -r '.tool_input.command' >> ~/.claude/bash-log.txt"
|
|
729
|
+
}]
|
|
730
|
+
}]
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
\`\`\`
|
|
734
|
+
|
|
735
|
+
**Stop hook that displays message to user:**
|
|
736
|
+
|
|
737
|
+
Command must output JSON with \`systemMessage\` field:
|
|
738
|
+
\`\`\`bash
|
|
739
|
+
# Example command that outputs: {"systemMessage": "Session complete!"}
|
|
740
|
+
echo '{"systemMessage": "Session complete!"}'
|
|
741
|
+
\`\`\`
|
|
742
|
+
|
|
743
|
+
**Run tests after code changes:**
|
|
744
|
+
\`\`\`json
|
|
745
|
+
{
|
|
746
|
+
"hooks": {
|
|
747
|
+
"PostToolUse": [{
|
|
748
|
+
"matcher": "Write|Edit",
|
|
749
|
+
"hooks": [{
|
|
750
|
+
"type": "command",
|
|
751
|
+
"command": "jq -r '.tool_input.file_path // .tool_response.filePath' | grep -E '\\\\.(ts|js)$' && npm test || true"
|
|
752
|
+
}]
|
|
753
|
+
}]
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
\`\`\`
|
|
757
|
+
`,wf='## Constructing a Hook (with verification)\n\nGiven an event, matcher, target file, and desired behavior, follow this flow. Each step catches a different failure class — a hook that silently does nothing is worse than no hook.\n\n1. **Dedup check.** Read the target file. If a hook already exists on the same event+matcher, show the existing command and ask: keep it, replace it, or add alongside.\n\n2. **Construct the command for THIS project — don\'t assume.** The hook receives JSON on stdin. Build a command that:\n - Extracts any needed payload safely — use `jq -r` into a quoted variable or `{ read -r f; ... "$f"; }`, NOT unquoted `| xargs` (splits on spaces)\n - Invokes the underlying tool the way this project runs it (npx/bunx/yarn/pnpm? Makefile target? globally-installed?)\n - Skips inputs the tool doesn\'t handle (formatters often have `--ignore-unknown`; if not, guard by extension)\n - Stays RAW for now — no `|| true`, no stderr suppression. You\'ll wrap it after the pipe-test passes.\n\n3. **Pipe-test the raw command.** Synthesize the stdin payload the hook will receive and pipe it directly:\n - `Pre|PostToolUse` on `Write|Edit`: `echo \'{"tool_name":"Edit","tool_input":{"file_path":"<a real file from this repo>"}}\' | <cmd>`\n - `Pre|PostToolUse` on `Bash`: `echo \'{"tool_name":"Bash","tool_input":{"command":"ls"}}\' | <cmd>`\n - `Stop`/`UserPromptSubmit`/`SessionStart`: most commands don\'t read stdin, so `echo \'{}\' | <cmd>` suffices\n\n Check exit code AND side effect (file actually formatted, test actually ran). If it fails you get a real error — fix (wrong package manager? tool not installed? jq path wrong?) and retest. Once it works, wrap with `2>/dev/null || true` (unless the user wants a blocking check).\n\n4. **Write the JSON.** Merge into the target file (schema shape in the "Hook Structure" section above). If this creates `.claude/settings.local.json` for the first time, add it to .gitignore — the Write tool doesn\'t auto-gitignore it.\n\n5. **Validate syntax + schema in one shot:**\n\n `jq -e \'.hooks.<event>[] | select(.matcher == "<matcher>") | .hooks[] | select(.type == "command") | .command\' <target-file>`\n\n Exit 0 + prints your command = correct. Exit 4 = matcher doesn\'t match. Exit 5 = malformed JSON or wrong nesting. A broken settings.json silently disables ALL settings from that file — fix any pre-existing malformation too.\n\n6. **Prove the hook fires** — only for `Pre|PostToolUse` on a matcher you can trigger in-turn (`Write|Edit` via Edit, `Bash` via Bash). `Stop`/`UserPromptSubmit`/`SessionStart` fire outside this turn — skip to step 7.\n\n For a **formatter** on `PostToolUse`/`Write|Edit`: introduce a detectable violation via Edit (two consecutive blank lines, bad indentation, missing semicolon — something this formatter corrects; NOT trailing whitespace, Edit strips that before writing), re-read, confirm the hook **fixed** it. For **anything else**: temporarily prefix the command in settings.json with `echo "$(date) hook fired" >> /tmp/claude-hook-check.txt; `, trigger the matching tool (Edit for `Write|Edit`, a harmless `true` for `Bash`), read the sentinel file.\n\n **Always clean up** — revert the violation, strip the sentinel prefix — whether the proof passed or failed.\n\n **If proof fails but pipe-test passed and `jq -e` passed**: the settings watcher isn\'t watching `.claude/` — it only watches directories that had a settings file when this session started. The hook is written correctly. Tell the user to open `/hooks` once (reloads config) or restart — you can\'t do this yourself; `/hooks` is a user UI menu and opening it ends this turn.\n\n7. **Handoff.** Tell the user the hook is live (or needs `/hooks`/restart per the watcher caveat). Point them at `/hooks` to review, edit, or disable it later. The UI only shows "Ran N hooks" if a hook errors or is slow — silent success is invisible by design.\n',Tf=`# Update Config Skill
|
|
758
|
+
|
|
759
|
+
Modify Claude Code configuration by updating settings.json files.
|
|
760
|
+
|
|
761
|
+
## When Hooks Are Required (Not Memory)
|
|
762
|
+
|
|
763
|
+
If the user wants something to happen automatically in response to an EVENT, they need a **hook** configured in settings.json. Memory/preferences cannot trigger automated actions.
|
|
764
|
+
|
|
765
|
+
**These require hooks:**
|
|
766
|
+
- "Before compacting, ask me what to preserve" → PreCompact hook
|
|
767
|
+
- "After writing files, run prettier" → PostToolUse hook with Write|Edit matcher
|
|
768
|
+
- "When I run bash commands, log them" → PreToolUse hook with Bash matcher
|
|
769
|
+
- "Always run tests after code changes" → PostToolUse hook
|
|
770
|
+
|
|
771
|
+
**Hook events:** PreToolUse, PostToolUse, PreCompact, PostCompact, Stop, Notification, SessionStart
|
|
772
|
+
|
|
773
|
+
## CRITICAL: Read Before Write
|
|
774
|
+
|
|
775
|
+
**Always read the existing settings file before making changes.** Merge new settings with existing ones - never replace the entire file.
|
|
776
|
+
|
|
777
|
+
## CRITICAL: Use AskUserQuestion for Ambiguity
|
|
778
|
+
|
|
779
|
+
When the user's request is ambiguous, use AskUserQuestion to clarify:
|
|
780
|
+
- Which settings file to modify (user/project/local)
|
|
781
|
+
- Whether to add to existing arrays or replace them
|
|
782
|
+
- Specific values when multiple options exist
|
|
783
|
+
|
|
784
|
+
## Decision: Config Tool vs Direct Edit
|
|
785
|
+
|
|
786
|
+
**Use the Config tool** for these simple settings:
|
|
787
|
+
- \`theme\`, \`editorMode\`, \`verbose\`, \`model\`
|
|
788
|
+
- \`language\`, \`alwaysThinkingEnabled\`
|
|
789
|
+
- \`permissions.defaultMode\`
|
|
790
|
+
|
|
791
|
+
**Edit settings.json directly** for:
|
|
792
|
+
- Hooks (PreToolUse, PostToolUse, etc.)
|
|
793
|
+
- Complex permission rules (allow/deny arrays)
|
|
794
|
+
- Environment variables
|
|
795
|
+
- MCP server configuration
|
|
796
|
+
- Plugin configuration
|
|
797
|
+
|
|
798
|
+
## Workflow
|
|
799
|
+
|
|
800
|
+
1. **Clarify intent** - Ask if the request is ambiguous
|
|
801
|
+
2. **Read existing file** - Use Read tool on the target settings file
|
|
802
|
+
3. **Merge carefully** - Preserve existing settings, especially arrays
|
|
803
|
+
4. **Edit file** - Use Edit tool (if file doesn't exist, ask user to create it first)
|
|
804
|
+
5. **Confirm** - Tell user what was changed
|
|
805
|
+
|
|
806
|
+
## Merging Arrays (Important!)
|
|
807
|
+
|
|
808
|
+
When adding to permission arrays or hook arrays, **merge with existing**, don't replace:
|
|
809
|
+
|
|
810
|
+
**WRONG** (replaces existing permissions):
|
|
811
|
+
\`\`\`json
|
|
812
|
+
{ "permissions": { "allow": ["Bash(npm:*)"] } }
|
|
813
|
+
\`\`\`
|
|
814
|
+
|
|
815
|
+
**RIGHT** (preserves existing + adds new):
|
|
816
|
+
\`\`\`json
|
|
817
|
+
{
|
|
818
|
+
"permissions": {
|
|
819
|
+
"allow": [
|
|
820
|
+
"Bash(git:*)", // existing
|
|
821
|
+
"Edit(.claude)", // existing
|
|
822
|
+
"Bash(npm:*)" // new
|
|
823
|
+
]
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
\`\`\`
|
|
827
|
+
|
|
828
|
+
${Sf}
|
|
829
|
+
|
|
830
|
+
${Cf}
|
|
831
|
+
|
|
832
|
+
${wf}
|
|
833
|
+
|
|
834
|
+
## Example Workflows
|
|
835
|
+
|
|
836
|
+
### Adding a Hook
|
|
837
|
+
|
|
838
|
+
User: "Format my code after Claude writes it"
|
|
839
|
+
|
|
840
|
+
1. **Clarify**: Which formatter? (prettier, gofmt, etc.)
|
|
841
|
+
2. **Read**: \`.claude/settings.json\` (or create if missing)
|
|
842
|
+
3. **Merge**: Add to existing hooks, don't replace
|
|
843
|
+
4. **Result**:
|
|
844
|
+
\`\`\`json
|
|
845
|
+
{
|
|
846
|
+
"hooks": {
|
|
847
|
+
"PostToolUse": [{
|
|
848
|
+
"matcher": "Write|Edit",
|
|
849
|
+
"hooks": [{
|
|
850
|
+
"type": "command",
|
|
851
|
+
"command": "jq -r '.tool_response.filePath // .tool_input.file_path' | { read -r f; prettier --write \\"$f\\"; } 2>/dev/null || true"
|
|
852
|
+
}]
|
|
853
|
+
}]
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
\`\`\`
|
|
857
|
+
|
|
858
|
+
### Adding Permissions
|
|
859
|
+
|
|
860
|
+
User: "Allow npm commands without prompting"
|
|
861
|
+
|
|
862
|
+
1. **Read**: Existing permissions
|
|
863
|
+
2. **Merge**: Add \`Bash(npm:*)\` to allow array
|
|
864
|
+
3. **Result**: Combined with existing allows
|
|
865
|
+
|
|
866
|
+
### Environment Variables
|
|
867
|
+
|
|
868
|
+
User: "Set DEBUG=true"
|
|
869
|
+
|
|
870
|
+
1. **Decide**: User settings (global) or project settings?
|
|
871
|
+
2. **Read**: Target file
|
|
872
|
+
3. **Merge**: Add to env object
|
|
873
|
+
\`\`\`json
|
|
874
|
+
{ "env": { "DEBUG": "true" } }
|
|
875
|
+
\`\`\`
|
|
876
|
+
|
|
877
|
+
## Common Mistakes to Avoid
|
|
878
|
+
|
|
879
|
+
1. **Replacing instead of merging** - Always preserve existing settings
|
|
880
|
+
2. **Wrong file** - Ask user if scope is unclear
|
|
881
|
+
3. **Invalid JSON** - Validate syntax after changes
|
|
882
|
+
4. **Forgetting to read first** - Always read before write
|
|
883
|
+
|
|
884
|
+
## Troubleshooting Hooks
|
|
885
|
+
|
|
886
|
+
If a hook isn't running:
|
|
887
|
+
1. **Check the settings file** - Read ~/.claude/settings.json or .claude/settings.json
|
|
888
|
+
2. **Verify JSON syntax** - Invalid JSON silently fails
|
|
889
|
+
3. **Check the matcher** - Does it match the tool name? (e.g., "Bash", "Write", "Edit")
|
|
890
|
+
4. **Check hook type** - Is it "command", "prompt", or "agent"?
|
|
891
|
+
5. **Test the command** - Run the hook command manually to see if it works
|
|
892
|
+
6. **Use --debug** - Run \`claude --debug\` to see hook execution logs
|
|
893
|
+
`;function Ef(){G({name:`update-config`,description:`Use this skill to configure the Claude Code harness via settings.json. Automated behaviors ("from now on when X", "each time X", "whenever X", "before/after X") require hooks configured in settings.json - the harness executes these, not Claude, so memory/preferences cannot fulfill them. Also use for: permissions ("allow X", "add permission", "move permission to"), env vars ("set X=Y"), hook troubleshooting, or any changes to settings.json/settings.local.json files. Examples: "allow npm commands", "add bq permission to global settings", "move permission to user settings", "set DEBUG=true", "when claude stops show X". For simple settings like theme/model, use Config tool.`,allowedTools:[`Read`],userInvocable:!0,async getPromptForCommand(e){if(e.startsWith(`[hooks-only]`)){let t=e.slice(12).trim(),n=Cf+`
|
|
894
|
+
|
|
895
|
+
`+wf;return t&&(n+=`\n\n## Task\n\n${t}`),[{type:`text`,text:n}]}let t=xf(),n=Tf;return n+=`\n\n## Full Settings JSON Schema\n\n\`\`\`json\n${t}\n\`\`\``,e&&(n+=`\n\n## User Request\n\n${e}`),[{type:`text`,text:n}]}})}var Df=`# CLI
|
|
896
|
+
`,Of=`# Server
|
|
897
|
+
`,kf=`# Skill
|
|
898
|
+
`,Af={"examples/cli.md":Df,"examples/server.md":Of};K();var{frontmatter:jf,content:Mf}=Ec(kf),Nf=typeof jf.description==`string`?jf.description:`Verify a code change does what it should by running the app.`;function Pf(){process.env.USER_TYPE===`ant`&&G({name:`verify`,description:Nf,userInvocable:!0,files:Af,async getPromptForCommand(e){let t=[Mf.trimStart()];return e&&t.push(`## User Request\n\n${e}`),[{type:`text`,text:t.join(`
|
|
899
|
+
|
|
900
|
+
`)}]}})}var Ff=i({registerScheduleRemoteAgentsSkill:()=>Uf});function If(e){if(!e.startsWith(`mcpsrv_`))return null;let t=e.slice(7).slice(2),n=0n;for(let e of t){let t=Wf.indexOf(e);if(t===-1)return null;n=n*58n+BigInt(t)}let r=n.toString(16).padStart(32,`0`);return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20,32)}`}function Lf(e){let t=[];for(let n of e){if(n.type!==`connected`||n.config.type!==`claudeai-proxy`)continue;let e=If(n.config.id);e&&t.push({uuid:e,name:n.name,url:n.config.url})}return t}function Rf(e){return e.replace(/^claude[.\s-]ai[.\s-]/i,``).replace(/[^a-zA-Z0-9_-]/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``)}function zf(e){if(e.length===0)return`No connected MCP connectors found. The user may need to connect servers at https://claude.ai/settings/connectors`;let t=[`Connected connectors (available for triggers):`];for(let n of e){let e=Rf(n.name);t.push(`- ${n.name} (connector_uuid: ${n.uuid}, name: ${e}, url: ${n.url})`)}return t.join(`
|
|
901
|
+
`)}function Bf(e){return`⚠ Heads-up:\n${e.map(e=>`- ${e}`).join(`
|
|
902
|
+
`)}`}async function Vf(){let e=await wr();if(!e)return null;let t=fl(e);return t?`https://${t.host}/${t.owner}/${t.name}`:null}function Hf(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${Bf(o)}\n`:``,u=o.length>0?`${Bf(o)}\n\n${Gf}`:Gf;return`# Schedule Remote Agents
|
|
903
|
+
|
|
904
|
+
You are helping the user schedule, update, list, or run **remote** Claude Code agents. These are NOT local cron jobs — each trigger spawns a fully isolated remote session (CCR) in Anthropic's cloud infrastructure on a cron schedule. The agent runs in a sandboxed environment with its own git checkout, tools, and optional MCP connections.
|
|
905
|
+
|
|
906
|
+
## First Step
|
|
907
|
+
|
|
908
|
+
${c?`The user has already told you what they want (see User Request at the bottom). Skip the initial question and go directly to the matching workflow.`:`Your FIRST action must be a single ${Pc} tool call (no preamble). Use this EXACT string for the \`question\` field — do not paraphrase or shorten it:
|
|
909
|
+
|
|
910
|
+
${Xn(u)}
|
|
911
|
+
|
|
912
|
+
Set \`header: "Action"\` and offer the four actions (create/list/update/run) as options. After the user picks, follow the matching workflow below.`}
|
|
913
|
+
${l}
|
|
914
|
+
|
|
915
|
+
## What You Can Do
|
|
916
|
+
|
|
917
|
+
Use the \`${vo}\` tool (load it first with \`SearchExtraTools select:${vo}\`; auth is handled in-process — do not use curl):
|
|
918
|
+
|
|
919
|
+
- \`{action: "list"}\` — list all triggers
|
|
920
|
+
- \`{action: "get", trigger_id: "..."}\` — fetch one trigger
|
|
921
|
+
- \`{action: "create", body: {...}}\` — create a trigger
|
|
922
|
+
- \`{action: "update", trigger_id: "...", body: {...}}\` — partial update
|
|
923
|
+
- \`{action: "run", trigger_id: "..."}\` — run a trigger now
|
|
924
|
+
|
|
925
|
+
You CANNOT delete triggers. If the user asks to delete, direct them to: https://claude.ai/code/scheduled
|
|
926
|
+
|
|
927
|
+
## Create body shape
|
|
928
|
+
|
|
929
|
+
\`\`\`json
|
|
930
|
+
{
|
|
931
|
+
"name": "AGENT_NAME",
|
|
932
|
+
"cron_expression": "CRON_EXPR",
|
|
933
|
+
"enabled": true,
|
|
934
|
+
"job_config": {
|
|
935
|
+
"ccr": {
|
|
936
|
+
"environment_id": "ENVIRONMENT_ID",
|
|
937
|
+
"session_context": {
|
|
938
|
+
"model": "claude-sonnet-4-6",
|
|
939
|
+
"sources": [
|
|
940
|
+
{"git_repository": {"url": "${r||`https://github.com/ORG/REPO`}"}}
|
|
941
|
+
],
|
|
942
|
+
"allowed_tools": ["Bash", "Read", "Write", "Edit", "Glob", "Grep"]
|
|
943
|
+
},
|
|
944
|
+
"events": [
|
|
945
|
+
{"data": {
|
|
946
|
+
"uuid": "<lowercase v4 uuid>",
|
|
947
|
+
"session_id": "",
|
|
948
|
+
"type": "user",
|
|
949
|
+
"parent_tool_use_id": null,
|
|
950
|
+
"message": {"content": "PROMPT_HERE", "role": "user"}
|
|
951
|
+
}}
|
|
952
|
+
]
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
\`\`\`
|
|
957
|
+
|
|
958
|
+
Generate a fresh lowercase UUID for \`events[].data.uuid\` yourself.
|
|
959
|
+
|
|
960
|
+
## Available MCP Connectors
|
|
961
|
+
|
|
962
|
+
These are the user's currently connected claude.ai MCP connectors:
|
|
963
|
+
|
|
964
|
+
${n}
|
|
965
|
+
|
|
966
|
+
When attaching connectors to a trigger, use the \`connector_uuid\` and \`name\` shown above (the name is already sanitized to only contain letters, numbers, hyphens, and underscores), and the connector's URL. The \`name\` field in \`mcp_connections\` must only contain \`[a-zA-Z0-9_-]\` — dots and spaces are NOT allowed.
|
|
967
|
+
|
|
968
|
+
**Important:** Infer what services the agent needs from the user's description. For example, if they say "check Datadog and Slack me errors," the agent needs both Datadog and Slack connectors. Cross-reference against the list above and warn if any required service isn't connected. If a needed connector is missing, direct the user to https://claude.ai/settings/connectors to connect it first.
|
|
969
|
+
|
|
970
|
+
## Environments
|
|
971
|
+
|
|
972
|
+
Every trigger requires an \`environment_id\` in the job config. This determines where the remote agent runs. Ask the user which environment to use.
|
|
973
|
+
|
|
974
|
+
${i}
|
|
975
|
+
|
|
976
|
+
Use the \`id\` value as the \`environment_id\` in \`job_config.ccr.environment_id\`.
|
|
977
|
+
${a?`\n**Note:** A new environment \`${a.name}\` (id: \`${a.environment_id}\`) was just created for the user because they had none. Use this id for \`job_config.ccr.environment_id\` and mention the creation when you confirm the trigger config.\n`:``}
|
|
978
|
+
|
|
979
|
+
## API Field Reference
|
|
980
|
+
|
|
981
|
+
### Create Trigger — Required Fields
|
|
982
|
+
- \`name\` (string) — A descriptive name
|
|
983
|
+
- \`cron_expression\` (string) — 5-field cron. **Minimum interval is 1 hour.**
|
|
984
|
+
- \`job_config\` (object) — Session configuration (see structure above)
|
|
985
|
+
|
|
986
|
+
### Create Trigger — Optional Fields
|
|
987
|
+
- \`enabled\` (boolean, default: true)
|
|
988
|
+
- \`mcp_connections\` (array) — MCP servers to attach:
|
|
989
|
+
\`\`\`json
|
|
990
|
+
[{"connector_uuid": "uuid", "name": "server-name", "url": "https://..."}]
|
|
991
|
+
\`\`\`
|
|
992
|
+
|
|
993
|
+
### Update Trigger — Optional Fields
|
|
994
|
+
All fields optional (partial update):
|
|
995
|
+
- \`name\`, \`cron_expression\`, \`enabled\`, \`job_config\`
|
|
996
|
+
- \`mcp_connections\` — Replace MCP connections
|
|
997
|
+
- \`clear_mcp_connections\` (boolean) — Remove all MCP connections
|
|
998
|
+
|
|
999
|
+
### Cron Expression Examples
|
|
1000
|
+
|
|
1001
|
+
The user's local timezone is **${t}**. Cron expressions are always in UTC. When the user says a local time, convert it to UTC for the cron expression but confirm with them: "9am ${t} = Xam UTC, so the cron would be \`0 X * * 1-5\`."
|
|
1002
|
+
|
|
1003
|
+
- \`0 9 * * 1-5\` — Every weekday at 9am **UTC**
|
|
1004
|
+
- \`0 */2 * * *\` — Every 2 hours
|
|
1005
|
+
- \`0 0 * * *\` — Daily at midnight **UTC**
|
|
1006
|
+
- \`30 14 * * 1\` — Every Monday at 2:30pm **UTC**
|
|
1007
|
+
- \`0 8 1 * *\` — First of every month at 8am **UTC**
|
|
1008
|
+
|
|
1009
|
+
Minimum interval is 1 hour. \`*/30 * * * *\` will be rejected.
|
|
1010
|
+
|
|
1011
|
+
## Workflow
|
|
1012
|
+
|
|
1013
|
+
### CREATE a new trigger:
|
|
1014
|
+
|
|
1015
|
+
1. **Understand the goal** — Ask what they want the remote agent to do. What repo(s)? What task? Remind them that the agent runs remotely — it won't have access to their local machine, local files, or local environment variables.
|
|
1016
|
+
2. **Craft the prompt** — Help them write an effective agent prompt. Good prompts are:
|
|
1017
|
+
- Specific about what to do and what success looks like
|
|
1018
|
+
- Clear about which files/areas to focus on
|
|
1019
|
+
- Explicit about what actions to take (open PRs, commit, just analyze, etc.)
|
|
1020
|
+
3. **Set the schedule** — Ask when and how often. The user's timezone is ${t}. When they say a time (e.g., "every morning at 9am"), assume they mean their local time and convert to UTC for the cron expression. Always confirm the conversion: "9am ${t} = Xam UTC."
|
|
1021
|
+
4. **Choose the model** — Default to \`claude-sonnet-4-6\`. Tell the user which model you're defaulting to and ask if they want a different one.
|
|
1022
|
+
5. **Validate connections** — Infer what services the agent will need from the user's description. For example, if they say "check Datadog and Slack me errors," the agent needs both Datadog and Slack MCP connectors. Cross-reference with the connectors list above. If any are missing, warn the user and link them to https://claude.ai/settings/connectors to connect first.${r?` The default git repo is already set to \`${r}\`. Ask the user if this is the right repo or if they need a different one.`:` Ask which git repos the remote agent needs cloned into its environment.`}
|
|
1023
|
+
6. **Review and confirm** — Show the full configuration before creating. Let them adjust.
|
|
1024
|
+
7. **Create it** \u2014 Call \`${vo}\` with \`action: "create"\` and show the result. The response includes the trigger ID. Always output a link at the end: \`https://claude.ai/code/scheduled/{TRIGGER_ID}\`
|
|
1025
|
+
|
|
1026
|
+
### UPDATE a trigger:
|
|
1027
|
+
|
|
1028
|
+
1. List triggers first so they can pick one
|
|
1029
|
+
2. Ask what they want to change
|
|
1030
|
+
3. Show current vs proposed value
|
|
1031
|
+
4. Confirm and update
|
|
1032
|
+
|
|
1033
|
+
### LIST triggers:
|
|
1034
|
+
|
|
1035
|
+
1. Fetch and display in a readable format
|
|
1036
|
+
2. Show: name, schedule (human-readable), enabled/disabled, next run, repo(s)
|
|
1037
|
+
|
|
1038
|
+
### RUN NOW:
|
|
1039
|
+
|
|
1040
|
+
1. List triggers if they haven't specified which one
|
|
1041
|
+
2. Confirm which trigger
|
|
1042
|
+
3. Execute and confirm
|
|
1043
|
+
|
|
1044
|
+
## Important Notes
|
|
1045
|
+
|
|
1046
|
+
- These are REMOTE agents — they run in Anthropic's cloud, not on the user's machine. They cannot access local files, local services, or local environment variables.
|
|
1047
|
+
- Always convert cron to human-readable when displaying
|
|
1048
|
+
- Default to \`enabled: true\` unless user says otherwise
|
|
1049
|
+
- Accept GitHub URLs in any format (https://github.com/org/repo, org/repo, etc.) and normalize to the full HTTPS URL (without .git suffix)
|
|
1050
|
+
- The prompt is the most important part — spend time getting it right. The remote agent starts with zero context, so the prompt must be self-contained.
|
|
1051
|
+
- To delete a trigger, direct users to https://claude.ai/code/scheduled
|
|
1052
|
+
${s?`- If the user's request seems to require GitHub repo access (e.g. cloning a repo, opening PRs, reading code), remind them that ${Xt(`tengu_cobalt_lantern`,!1)?`they should run /web-setup to connect their GitHub account (or install the Claude GitHub App on the repo as an alternative) — otherwise the remote agent won't be able to access it`:`they need the Claude GitHub App installed on the repo — otherwise the remote agent won't be able to access it`}.`:``}
|
|
1053
|
+
${c?`\n## User Request\n\nThe user said: "${c}"\n\nStart by understanding their intent and working through the appropriate workflow above.`:``}`}function Uf(){G({name:`schedule`,description:`Create, update, list, or run scheduled remote agents (triggers) that execute on a cron schedule.`,whenToUse:`When the user wants to schedule a recurring remote agent, set up automated tasks, create a cron job for Claude Code, or manage their scheduled agents/triggers.`,userInvocable:!0,isEnabled:()=>Xt(`tengu_surreal_dali`,!1)&&_i(`allow_remote_sessions`),allowedTools:[vo,Pc],async getPromptForCommand(e,t){if(!xt()?.accessToken)return[{type:`text`,text:`You need to authenticate with a claude.ai account first. API accounts are not supported. Run /login, then try /schedule again.`}];let n;try{n=await si()}catch(e){return R(`[schedule] Failed to fetch environments: ${e}`,{level:`warn`}),[{type:`text`,text:`We're having trouble connecting with your remote claude.ai account to set up a scheduled task. Please try /schedule again in a few minutes.`}]}let r=null;if(n.length===0)try{r=await Oa(`claude-code-default`),n=[r]}catch(e){return R(`[schedule] Failed to create environment: ${e}`,{level:`warn`}),[{type:`text`,text:`No remote environments found, and we could not create one automatically. Visit https://claude.ai/code to set one up, then run /schedule again.`}]}let i=[],a=!1,o=await dl();if(o===null)i.push(`Not in a git repo — you'll need to specify a repo URL manually (or skip repos entirely).`);else if(o.host===`github.com`){let{hasAccess:e}=await eo(o.owner,o.name);if(!e){a=!0;let e=Xt(`tengu_cobalt_lantern`,!1)?`GitHub not connected for ${o.owner}/${o.name} \u2014 run /web-setup to sync your GitHub credentials, or install the Claude GitHub App at https://claude.ai/code/onboarding?magic=github-app-setup.`:`Claude GitHub App not installed on ${o.owner}/${o.name} \u2014 install at https://claude.ai/code/onboarding?magic=github-app-setup if your trigger needs this repo.`;i.push(e)}}let s=Lf(t.options.mcpClients);s.length===0&&i.push(`No MCP connectors — connect at https://claude.ai/settings/connectors if needed.`);let c=Intl.DateTimeFormat().resolvedOptions().timeZone,l=zf(s),u=await Vf(),d=[`Available environments:`];for(let e of n)d.push(`- ${e.name} (id: ${e.environment_id}, kind: ${e.kind})`);return[{type:`text`,text:Hf({userTimezone:c,connectorsInfo:l,gitRepoUrl:u,environmentsInfo:d.join(`
|
|
1054
|
+
`),createdEnvironment:r,setupNotes:i,needsGitHubAccessReminder:a,userArgs:e})}]}})}var Wf,Gf,Kf=n((()=>{Bt(),Na(),Bc(),Ps(),wn(),co(),dr(),ll(),Er(),pr(),Vo(),K(),Wf=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,Gf=`What would you like to do with scheduled remote agents?`}));Gl();function qf(){Ef(),$d(),Pf(),Md(),rf(),uf(),af(),sf(),Ed(),ff(),vf(),pf(),mf(),bf();{let{registerScheduleRemoteAgentsSkill:t}=(Kf(),e(Ff));t()}Ul()&&kd()}La(),fc(),Ms();async function Jf(){if(!await Pr(`gh`))return`not_installed`;let{exitCode:e}=await Nr(`gh`,[`auth`,`token`],{stdout:`ignore`,stderr:`ignore`,timeout:5e3,reject:!1});return e===0?`authenticated`:`not_authenticated`}Bi(),Yi(),ac(),z(),ea();async function Yf(e,t){let n=await Hs(e),r=Qa(t);for(let e of n)e.type===`prompt`&&B(`tengu_skill_loaded`,{_PROTO_skill_name:e.name,skill_source:e.source,skill_loaded_from:e.loadedFrom,skill_budget:r,...e.kind&&{skill_kind:e.kind}})}zs(),z(),Ss(),$a(),p(),pr();function Xf(e){e.command(`add <name> <commandOrUrl> [args...]`).description(`Add an MCP server to Claude Code.
|
|
1055
|
+
|
|
1056
|
+
Examples:
|
|
1057
|
+
# Add HTTP server:
|
|
1058
|
+
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
|
|
1059
|
+
|
|
1060
|
+
# Add HTTP server with headers:
|
|
1061
|
+
claude mcp add --transport http corridor https://app.corridor.dev/api/mcp --header "Authorization: Bearer ..."
|
|
1062
|
+
|
|
1063
|
+
# Add stdio server with environment variables:
|
|
1064
|
+
claude mcp add -e API_KEY=xxx my-server -- npx my-mcp-server
|
|
1065
|
+
|
|
1066
|
+
# Add stdio server with subprocess flags:
|
|
1067
|
+
claude mcp add my-server -- my-command --some-flag arg1`).option(`-s, --scope <scope>`,`Configuration scope (local, user, or project)`,`local`).option(`-t, --transport <transport>`,`Transport type (stdio, sse, http). Defaults to stdio if not specified.`).option(`-e, --env <env...>`,`Set environment variables (e.g. -e KEY=value)`).option(`-H, --header <header...>`,`Set WebSocket headers (e.g. -H "X-Api-Key: abc123" -H "X-Custom: value")`).option(`--client-id <clientId>`,`OAuth client ID for HTTP/SSE servers`).option(`--client-secret`,`Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)`).option(`--callback-port <port>`,`Fixed port for OAuth callback (for servers requiring pre-registered redirect URIs)`).helpOption(`-h, --help`,`Display help for command`).addOption(new J(`--xaa`,`Enable XAA (SEP-990) for this server. Requires 'claude mcp xaa setup' first. Also requires --client-id and --client-secret (for the MCP server's AS).`).hideHelp(!ga())).action(async(e,t,n,r)=>{let i=t,a=n;e?i||q(`Error: Command is required when server name is provided.
|
|
1068
|
+
Usage: claude mcp add <name> <command> [args...]`):q(`Error: Server name is required.
|
|
1069
|
+
Usage: claude mcp add <name> <command> [args...]`);try{let t=Dc(r.scope),n=gi(r.transport);r.xaa&&!ga()&&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`),ds()||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(B(`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?Da(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 bi():void 0,l={type:`sse`,url:i,headers:n,oauth:s};await oi(e,l,t),c&&Ba(e,l,c),process.stdout.write(`Added SSE MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${Xn(n,null,2)}\n`)}else if(n===`http`){i||q(`Error: URL is required for HTTP transport.`);let n=r.header?Da(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 bi():void 0,l={type:`http`,url:i,headers:n,oauth:s};await oi(e,l,t),c&&Ba(e,l,c),process.stdout.write(`Added HTTP MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${Xn(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.
|
|
1070
|
+
`),!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 oi(e,{type:`stdio`,command:i,args:a,env:f(r.env)},t),process.stdout.write(`Added stdio MCP server ${e} with command: ${i} ${a.join(` `)} to ${t} config\n`);Fl(`File modified: ${ja(t)}`)}catch(e){q(e.message)}})}fa(),rr(),F();function Zf(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>`,`Claude Code'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=ds(),a=i?.issuer,o=i?.clientId,{error:s}=P(`userSettings`,{xaaIdp:{issuer:e.issuer,clientId:e.clientId,callbackPort:n}});if(s)return q(`Error writing settings: ${s.message}`);if(a&&(Ta(a)===Ta(e.issuer)?o!==e.clientId&&(xa(a),Ti(a)):(xa(a),Ti(a))),r){let{success:t,warning:n}=Pi(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.`)}Fl(`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=ds();if(!t)return q(`Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.`);if(e.idToken){let n=qi(t.issuer,e.idToken);return Fl(`id_token cached for ${t.issuer} (expires ${new Date(n).toISOString()})`)}if(e.force&&xa(t.issuer),_s(t.issuer)!==void 0)return Fl(`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 ji({idpIssuer:t.issuer,idpClientId:t.clientId,idpClientSecret:di(t.issuer),callbackPort:t.callbackPort,onAuthorizationUrl:e=>{process.stdout.write(`If the browser did not open, visit:\n ${e}\n`)}}),Fl(`Logged in. MCP servers with --xaa will now authenticate silently.`)}catch(e){q(`IdP login failed: ${L(e)}`)}}),t.command(`show`).description(`Show the current IdP connection config`).action(()=>{let e=ds();if(!e)return Fl(`No XAA IdP connection configured.`);let t=di(e.issuer)!==void 0,n=_s(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`),Fl()}),t.command(`clear`).description(`Clear the IdP connection config and cached id_token`).action(()=>{let e=ds(),{error:t}=P(`userSettings`,{xaaIdp:void 0});if(t)return q(`Error writing settings: ${t.message}`);e&&(xa(e.issuer),Ti(e.issuer)),Fl(`XAA IdP connection cleared`)})}Mi();function Qf(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]}}cs(),Ki(),Li(),z(),E(),Rr(),F();function $f(){if(j().bypassPermissionsModeAccepted)try{tn()||P(`userSettings`,{skipDangerousModePermissionPrompt:!0}),B(`tengu_migrate_bypass_permissions_accepted`,{}),A(e=>{if(!(`bypassPermissionsModeAccepted`in e))return e;let{bypassPermissionsModeAccepted:t,...n}=e;return n})}catch(e){H(Error(`Failed to migrate bypass permissions accepted: ${e}`))}}z(),E(),Rr(),F();function ep(){let e=nn(),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=Rt(`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&&P(`localSettings`,a),(o.includes(`enableAllProjectMcpServers`)||o.includes(`enabledMcpjsonServers`)||o.includes(`disabledMcpjsonServers`))&&Dt(e=>{let{enableAllProjectMcpServers:t,enabledMcpjsonServers:n,disabledMcpjsonServers:r,...i}=e;return i}),B(`tengu_migrate_mcp_approval_fields_success`,{migratedCount:o.length})}catch(e){H(e),B(`tengu_migrate_mcp_approval_fields_error`,{})}}F();function tp(){if(process.env.USER_TYPE!==`ant`)return;let e=Rt(`userSettings`)?.model;typeof e==`string`&&(e.startsWith(`fennec-latest[1m]`)?P(`userSettings`,{model:`opus[1m]`}):e.startsWith(`fennec-latest`)?P(`userSettings`,{model:`opus`}):(e.startsWith(`fennec-fast-latest`)||e.startsWith(`opus-4-5-fast`))&&P(`userSettings`,{model:`opus[1m]`,fastMode:!0}))}z(),E(),D(),F();function np(){if(k()!==`firstParty`||!_t())return;let e=Rt(`userSettings`)?.model;e!==`claude-opus-4-20250514`&&e!==`claude-opus-4-1-20250805`&&e!==`claude-opus-4-0`&&e!==`claude-opus-4-1`||(P(`userSettings`,{model:`opus`}),A(e=>({...e,legacyOpusMigrationTimestamp:Date.now()})),B(`tengu_legacy_opus_migration`,{from_model:e}))}z(),Lt();function rp(){Tt()&&B(`tengu_opus_to_opus1m_migration`,{skipped:!0})}E();function ip(){A(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})}T(),E(),F();function ap(){j().sonnet1m45MigrationComplete||(Rt(`userSettings`)?.model===`sonnet[1m]`&&P(`userSettings`,{model:`sonnet-4-5-20250929[1m]`}),He()===`sonnet[1m]`&&Qe(`sonnet-4-5-20250929[1m]`),A(e=>({...e,sonnet1m45MigrationComplete:!0})))}z(),wn(),E(),D(),F();function op(){if(k()!==`firstParty`||!Kn()&&!un()&&!an())return;let e=Rt(`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]`);P(`userSettings`,{model:t?`sonnet[1m]`:`sonnet`}),j().numStartups>1&&A(e=>({...e,sonnet45To46MigrationTimestamp:Date.now()})),B(`tengu_sonnet45_to_46_migration`,{from_model:e,has_1m:t})}z(),E(),Rr(),F();function sp(){if(!j().hasResetAutoModeOptInForDefaultOffer&&Sc()===`enabled`)try{let e=Rt(`userSettings`);e?.skipAutoPermissionPrompt&&e?.permissions?.defaultMode!==`auto`&&(P(`userSettings`,{skipAutoPermissionPrompt:void 0}),B(`tengu_migrate_reset_auto_opt_in_for_default_offer`,{})),A(e=>e.hasResetAutoModeOptInForDefaultOffer?e:{...e,hasResetAutoModeOptInForDefaultOffer:!0})}catch(e){H(Error(`Failed to reset auto mode opt-in: ${e}`))}}z(),wn(),E(),D(),F();function cp(){if(!j().opusProMigrationComplete){if(k()!==`firstParty`||!Kn()){A(e=>({...e,opusProMigrationComplete:!0})),B(`tengu_reset_pro_to_opus_default`,{skipped:!0});return}if(Cn()?.model===void 0){let e=Date.now();A(t=>({...t,opusProMigrationComplete:!0,opusProMigrationTimestamp:e})),B(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!1})}else A(e=>({...e,opusProMigrationComplete:!0})),B(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!0})}}ue(),ei();var lp=$r(()=>ce({session_id:_(),ws_url:_(),work_dir:_().optional()}));rr(),pr();var up=class extends Error{constructor(e){super(e),this.name=`DirectConnectError`}};async function dp({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:Xn({cwd:n,...r&&{dangerously_skip_permissions:!0}})})}catch(t){throw new up(`Failed to connect to server at ${e}: ${L(t)}`)}if(!a.ok)throw new up(`Failed to create session: ${a.status} ${a.statusText}`);let o=lp().safeParse(await a.json());if(!o.success)throw new up(`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 fp=i({isKairosEnabled:()=>pp});async function pp(){return!!Xt(`tengu_kairos_assistant`,!1)}var mp=n((()=>{Bt()}));Xr(),kr(),Rs(),Bt(),Na(),ps(),wn(),E(),Cc(),ua(),Br(),pr(),z(),T(),no(),xe(),El(),Gl(),p(),Er(),Rr(),Lt(),mc(),hi(),F(),Ss(),$a(),fa(),ar(),dr(),rr(),Bs(),is(),br(),Nl(),Ks(),Rn(),_c(),U(`main_tsx_entry`),Qt(),Jn();var hp=()=>qr(),gp=()=>hs(),_p=()=>Tl(),vp=(Eo(),e(Ys)),yp=(kl(),e(Al)),bp=(mp(),e(fp)),xp=(vi(),e(kc));U(`main_tsx_imports_loaded`);function Sp(){try{let e=Rt(`policySettings`);if(e){let t=bt(e);B(`tengu_managed_settings_loaded`,{keyCount:t.length,keys:t.join(`,`)})}}catch{}}function Cp(){let e=ut(at()??ft());Yf(gr(),Tn(e,et())),Ts().then(({enabled:e,errors:t})=>{let n=gc();Vs(e,n,uo()),na(t,n)}).catch(e=>H(e))}function wp(){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),d(`--use-system-ca`)&&(e.has_use_system_ca=!0),d(`--use-openssl-ca`)&&(e.has_use_openssl_ca=!0),e}async function Tp(){if(yn())return;let[e,t,n]=await Promise.all([xr(),Sr(),Jf()]);B(`tengu_startup_telemetry`,{is_git:e,worktree_count:t,gh_auth_status:n,sandbox_enabled:ec.isSandboxingEnabled(),are_unsandboxed_commands_allowed:ec.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:ec.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:hn(),prefers_reduced_motion:St().prefersReducedMotion??!1,...wp()})}var Ep=11;function Dp(){j().migrationVersion!==Ep&&($f(),ep(),cp(),ap(),np(),op(),rp(),ip(),sp(),process.env.USER_TYPE===`ant`&&tp(),A(e=>e.migrationVersion===Ep?e:{...e,migrationVersion:Ep})),Pl().catch(()=>{})}function Op(){if(Re()){V(`info`,`prefetch_system_context_non_interactive`),Lo();return}ln()?(V(`info`,`prefetch_system_context_has_trust`),Lo()):V(`info`,`prefetch_system_context_skipped_no_trust`)}function kp(){m(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||c()||($t(),qo(),Op(),nu(),m(process.env.CLAUDE_CODE_USE_BEDROCK)&&!m(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&zn(),m(process.env.CLAUDE_CODE_USE_VERTEX)&&!m(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&Ut(),To(gr(),AbortSignal.timeout(3e3),[]),iu(),bn(),Zo.initialize(),c()||Vl.initialize(),process.env.USER_TYPE===`ant`&&import(`./eventLoopStallDetector-Dnh1fc31.js`).then(e=>e.startEventLoopStallDetector()))}function Ap(e){try{let t=e.trim(),n=t.startsWith(`{`)&&t.endsWith(`}`),r;if(n)Wr(t)||(process.stderr.write(b.red(`Error: Invalid JSON provided to --settings
|
|
1071
|
+
`)),process.exit(1)),r=Yo(`claude-settings`,`.json`,{contentHash:t}),$n(r,t,`utf8`);else{let{resolvedPath:t}=mr(ur(),e);try{fu(t,`utf8`)}catch(e){throw nr(e)&&(process.stderr.write(b.red(`Error: Settings file not found: ${t}\n`)),process.exit(1)),e}r=t}Ne(r),je()}catch(e){e instanceof Error&&H(e),process.stderr.write(b.red(`Error processing settings: ${L(e)}\n`)),process.exit(1)}}function jp(e){try{De(pn(e)),je()}catch(e){e instanceof Error&&H(e),process.stderr.write(b.red(`Error processing --setting-sources: ${L(e)}\n`)),process.exit(1)}}function Mp(){U(`eagerLoadSettings_start`);let e=Qf(`--settings`);e&&Ap(e);let t=Qf(`--setting-sources`);t!==void 0&&jp(t),U(`eagerLoadSettings_end`)}function Np(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(m(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},Pp={sessionId:void 0,discover:!1},$={host:void 0,cwd:void 0,permissionMode:void 0,dangerouslySkipPermissions:!1,local:!1,extraCliArgs:[],remoteBin:void 0};async function Fp(){U(`main_function_start`),process.env.NoDefaultCurrentDirectoryInExePath=`1`,Qu(),process.on(`exit`,()=>{Vp()}),process.on(`SIGINT`,()=>{process.argv.includes(`-p`)||process.argv.includes(`--print`)||process.exit(0)}),U(`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-BS6i9JPo.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-BdCuh6eA.js`);t();let n=process.argv[e+1],{handleDeepLinkUri:r}=await import(`./protocolHandler-DhqM32qE.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-BdCuh6eA.js`);e();let{handleUrlSchemeLaunch:t}=await import(`./protocolHandler-DhqM32qE.js`),n=await t();process.exit(n??1)}}if(Pp){let e=process.argv.slice(2);if(e[0]===`assistant`){let t=e[1];t&&!t.startsWith(`-`)?(Pp.sessionId=t,e.splice(0,2),process.argv=[process.argv[0],process.argv[1],...e]):t||(Pp.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
|
|
1072
|
+
`),ta(1);return}process.argv=[process.argv[0],process.argv[1],...n]}}let e=process.argv.slice(2),t=e.includes(`-p`)||e.includes(`--print`),n=e.includes(`--init-only`),r=e.some(e=>e.startsWith(`--sdk-url`)),i=m(process.env.CLAUDE_CODE_FORCE_INTERACTIVE),a=t||n||r||!i&&!process.stdout.isTTY;a&&Zl(),Be(!a),Np(a);let o=(()=>{if(m(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`})();Ce(o);let s=process.env.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT;s===`markdown`||s===`html`?Ue(s):!o.startsWith(`sdk-`)&&o!==`claude-desktop`&&o!==`local-agent`&&o!==`remote`&&Ue(`markdown`),process.env.CLAUDE_CODE_ENVIRONMENT_KIND===`bridge`&&C(`remote-control`),U(`main_client_type_determined`),Mp(),U(`main_before_run`),await Lp(),U(`main_after_run`)}async function Ip(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 yr(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.
|
|
1073
|
+
`),[e,n].filter(Boolean).join(`
|
|
1074
|
+
`)}return e}async function Lp(){U(`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 Au().configureHelp(t()).enablePositionalOptions();U(`run_commander_initialized`),n.hook(`preAction`,async e=>{U(`preAction_start`),await Promise.all([In(),wt()]),U(`preAction_after_mdm`),await zu(),U(`preAction_after_init`),m(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)||(process.title=`claude`);let{initSinks:t}=await import(`./sinks-oFfsKySL.js`);t(),U(`preAction_after_sinks`);let n=e.getOptionValue(`pluginDir`);Array.isArray(n)&&n.length>0&&n.every(e=>typeof e==`string`)&&(ze(n),Mo(`preAction: --plugin-dir inline plugins`)),Dp(),U(`preAction_after_migrations`),Ea(),Gi(),U(`preAction_after_remote_settings`),U(`preAction_after_settings_sync`)}),n.name(`claude`).description(`Claude Code - 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(ti)).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').`).addOption(new J(`--effort <level>`,`Effort level for the current session (low, medium, high, max)`).argParser(e=>{let t=e.toLowerCase(),n=[`low`,`medium`,`high`,`max`];if(!n.includes(t))throw new Ou(`It must be one of: ${n.join(`, `)}`);return t})).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)=>{U(`action_handler_start`),n.bare&&(process.env.CLAUDE_CODE_SIMPLE=`1`),t===`code`&&(B(`tengu_code_prompt_ignored`,{}),console.warn(b.yellow("Tip: You can launch Claude Code with just `claude`")),t=void 0),t&&typeof t==`string`&&!/\s/.test(t)&&t.length>0&&B(`tengu_single_word_prompt`,{length:t.length});let r=!1,i;if(n.assistant&&yp&&yp.markAssistantForced(),yp&&(yp.isAssistantForced()||n.assistant===!0)&&!n.agentId&&bp){if(!ln())console.warn(b.yellow(`Assistant mode disabled: directory is not trusted. Accept the trust dialog and restart.`));else if(r=yp.isAssistantForced()||await bp.isKairosEnabled(),r){let e=n;e.brief=!0,Me(!0),i=await yp.initializeAssistantTeam()}}let{debug:a=!1,debugToStderr:o=!1,dangerouslySkipPermissions:s,allowDangerouslySkipPermissions:l=!1,tools:u=[],allowedTools:d=[],disallowedTools:f=[],mcpConfig:p=[],permissionMode:h,addDir:ee=[],fallbackModel:g,betas:te=[],ide:ne=!1,sessionId:re,includeHookEvents:_,includePartialMessages:ie}=n;n.prefill&&Ql(n.prefill);let ae,oe=n.agents,se=n.agent;se&&(process.env.CLAUDE_CODE_AGENT=se);let v=n.outputFormat,y=n.inputFormat,ce=n.verbose??j().verbose,le=n.print,ue=n.init??!1,de=n.initOnly??!1,fe=n.maintenance??!1,pe=n.disableSlashCommands||!1,me=process.env.USER_TYPE===`ant`&&n.tasks,he=me?typeof me==`string`?me:cl:void 0;process.env.USER_TYPE===`ant`&&he&&(process.env.CLAUDE_CODE_TASK_LIST_ID=he);let ge=Cl()?n.worktree:void 0,_e=typeof ge==`string`?ge:void 0,ve=ge!==void 0,ye;if(_e){let e=Ca(_e);e!==null&&(ye=e,_e=void 0)}let be=Cl()&&n.tmux===!0;be&&(ve||(process.stderr.write(b.red(`Error: --tmux requires --worktree
|
|
1075
|
+
`)),process.exit(1)),zr()===`windows`&&(process.stderr.write(b.red(`Error: --tmux is not supported on Windows
|
|
1076
|
+
`)),process.exit(1)),await Ua()||(process.stderr.write(b.red(`Error: tmux is not installed.\n${Ia()}\n`)),process.exit(1)));let x;if(mn()){let e=Hp(n);x=e;let t=e.agentId||e.agentName||e.teamName,r=e.agentId&&e.agentName&&e.teamName;t&&!r&&(process.stderr.write(b.red(`Error: --agent-id, --agent-name, and --team-name must all be provided together
|
|
1077
|
+
`)),process.exit(1)),e.agentId&&e.agentName&&e.teamName&&hp().setDynamicTeamContext?.({agentId:e.agentId,agentName:e.agentName,teamName:e.teamName,color:e.agentColor,planModeRequired:e.planModeRequired??!1,parentSessionId:e.parentSessionId}),e.teammateMode&&_p().setCliTeammateModeOverride?.(e.teammateMode)}let xe=n.sdkUrl??void 0,Se=ie||m(process.env.CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES);(_||m(process.env.CLAUDE_CODE_REMOTE))&&la(!0),xe&&(y||(y=`stream-json`),v||(v=`stream-json`),n.verbose===void 0&&(ce=!0),n.print||(le=!0));let S=n.teleport??null,Ce=n.remote,Te=Ce===!0?``:Ce??null,De=n.remoteControl??n.rc,je=!1,Ne=typeof De==`string`&&De.length>0?De:void 0;if(re&&((n.continue||n.resume)&&!n.forkSession&&(process.stderr.write(b.red(`Error: --session-id can only be used with --continue or --resume if --fork-session is also specified.
|
|
1078
|
+
`)),process.exit(1)),!xe)){let e=Ma(re);e||(process.stderr.write(b.red(`Error: Invalid session ID. Must be a valid UUID.
|
|
1079
|
+
`)),process.exit(1)),xi(e)&&(process.stderr.write(b.red(`Error: Session ID ${e} is already in use.\n`)),process.exit(1))}let Ie=n.file;if(Ie&&Ie.length>0){let e=Zc();e||(process.stderr.write(b.red(`Error: Session token required for file downloads. CLAUDE_CODE_SESSION_ACCESS_TOKEN must be set.
|
|
1080
|
+
`)),process.exit(1));let t=process.env.CLAUDE_CODE_REMOTE_SESSION_ID||Ee(),n=es(Ie);n.length>0&&(ae=Es(n,{baseUrl:process.env.ANTHROPIC_BASE_URL||Dr().BASE_API_URL,oauthToken:e,sessionId:t}))}let C=Re();g&&n.model&&g===n.model&&(process.stderr.write(b.red(`Error: Fallback model cannot be the same as the main model. Please specify a different model for --fallback-model.
|
|
1081
|
+
`)),process.exit(1));let ze=n.systemPrompt;if(n.systemPromptFile){n.systemPrompt&&(process.stderr.write(b.red(`Error: Cannot use both --system-prompt and --system-prompt-file. Please use only one.
|
|
1082
|
+
`)),process.exit(1));try{ze=fu(lu(n.systemPromptFile),`utf8`)}catch(e){er(e)===`ENOENT`&&(process.stderr.write(b.red(`Error: System prompt file not found: ${lu(n.systemPromptFile)}\n`)),process.exit(1)),process.stderr.write(b.red(`Error reading system prompt file: ${L(e)}\n`)),process.exit(1)}}let w=n.appendSystemPrompt;if(n.appendSystemPromptFile){n.appendSystemPrompt&&(process.stderr.write(b.red(`Error: Cannot use both --append-system-prompt and --append-system-prompt-file. Please use only one.
|
|
1083
|
+
`)),process.exit(1));try{w=fu(lu(n.appendSystemPromptFile),`utf8`)}catch(e){er(e)===`ENOENT`&&(process.stderr.write(b.red(`Error: Append system prompt file not found: ${lu(n.appendSystemPromptFile)}\n`)),process.exit(1)),process.stderr.write(b.red(`Error reading append system prompt file: ${L(e)}\n`)),process.exit(1)}}if(mn()&&x?.agentId&&x?.agentName&&x?.teamName){let e=gp().TEAMMATE_SYSTEM_PROMPT_ADDENDUM;w=w?`${w}\n\n${e}`:e}let{mode:Be,notification:Ve}=za({permissionModeCli:h,dangerouslySkipPermissions:s});it(Be===`bypassPermissions`),(n.enableAutoMode||h===`auto`||Be===`auto`||!h&&gs())&&xp?.setAutoModeFlagCli(!0);let T={"mcp-chrome":{type:`http`,url:`http://127.0.0.1:12306/mcp`,scope:`dynamic`,headers:{Authorization:`Bearer my-static-token`}}};if(p&&p.length>0){let e=p.map(e=>e.trim()).filter(e=>e.length>0),t={},n=[];for(let r of e){let e=null,i=[],a=Wr(r);if(a){let t=Bo({configObject:a,filePath:`command line`,expandVars:!0,scope:`dynamic`});t.config?e=t.config.mcpServers:i=t.errors}else{let t=Xo({filePath:lu(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(`
|
|
1084
|
+
`);R(`--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 e=Object.entries(t).filter(([,e])=>e.type!==`sdk`).map(([e])=>e),n=null;if(e.some(yl))n=`Invalid MCP configuration: "${bl}" is a reserved MCP name.`;else{let{isComputerUseMCPServer:t,COMPUTER_USE_MCP_SERVER_NAME:r}=await import(`./common-B_BC3eMY.js`);e.some(t)&&(n=`Invalid MCP configuration: "${r}" is a reserved MCP name.`)}n&&(process.stderr.write(`Error: ${n}\n`),process.exit(1));let{allowed:r,blocked:i}=qs(Ft(t,e=>({...e,scope:`dynamic`})));i.length>0&&process.stderr.write(`Warning: MCP ${It(i.length,`server`)} blocked by enterprise policy: ${i.join(`, `)}\n`),T={...T,...r}}}let He=n;Ge(He.chrome);let Ue=Hl(He.chrome)&&(process.env.USER_TYPE===`ant`||on()),Xe=!Ue&&Ul();if(Ue){let e=zr();try{B(`tengu_claude_in_chrome_setup`,{platform:e});let{mcpConfig:t,allowedTools:n,systemPrompt:r}=Wl();T={...T,...t},d.push(...n),r&&(w=w?`${r}\n\n${w}`:r)}catch(t){B(`tengu_claude_in_chrome_setup_failed`,{platform:e}),R(`[Claude in Chrome] Error: ${t}`),H(t),console.error(`Error: Failed to run with Claude in Chrome.`),process.exit(1)}}else if(Xe)try{let{mcpConfig:e}=Wl();T={...T,...e};let t=Dl;w=w?`${w}\n\n${t}`:t}catch(e){R(`[Claude in Chrome] Error (auto-enable): ${e}`)}let et=n.strictMcpConfig||!1;if(js()&&(et&&(process.stderr.write(b.red(`You cannot use --strict-mcp-config when an enterprise MCP config is present`)),process.exit(1)),T&&!Wo(T)&&(process.stderr.write(b.red(`You cannot dynamically configure MCP servers when an enterprise MCP config is present`)),process.exit(1))),zr()!==`unknown`&&!Re())try{let{getChicagoEnabled:e}=await import(`./gates-DSI3vpwO.js`);if(e()){let{setupComputerUseMCP:e}=await import(`./setup-CmLngvpJ.js`),{mcpConfig:t,allowedTools:n}=e();T={...T,...t},d.push(...n)}}catch(e){R(`[Computer Use MCP] Setup failed: ${L(e)}`)}we(ee);let tt,rt=(e,t)=>{let n=[],r=[];for(let t of e)if(t.startsWith(`plugin:`)){let e=t.slice(7),i=e.indexOf(`@`);i<=0||i===e.length-1?r.push(t):n.push({kind:`plugin`,name:e.slice(0,i),marketplace:e.slice(i+1)})}else t.startsWith(`server:`)&&t.length>7?n.push({kind:`server`,name:t.slice(7)}):r.push(t);return r.length>0&&(process.stderr.write(b.red(`${t} entries must be tagged: ${r.join(`, `)}\n plugin:<name>@<marketplace> — plugin-provided channel (allowlist enforced)\n server:<name> — manually configured MCP server\n`)),process.exit(1)),n},ot=n,E=ot.channels,lt=ot.dangerouslyLoadDevelopmentChannels,pt=[];if(E&&E.length>0&&(pt=rt(E,`--channels`),Le(pt)),C||lt&<.length>0&&(tt=rt(lt,`--dangerously-load-development-channels`)),pt.length>0||(tt?.length??0)>0){let e=e=>{let t=e.flatMap(e=>e.kind===`plugin`?[`${e.name}@${e.marketplace}`]:[]);return t.length>0?t.sort().join(`,`):void 0};B(`tengu_mcp_channel_flags`,{channels_count:pt.length,dev_count:tt?.length??0,plugins:e(pt),dev_plugins:e(tt??[])})}if(u.length>0){let{BRIEF_TOOL_NAME:t,LEGACY_BRIEF_TOOL_NAME:n}=(Ct(),e(kn)),{isBriefEntitled:r}=(Uo(),e(ci)),i=ui(u);(i.includes(t)||i.includes(n))&&r()&&Ke(!0)}let ht=await Ai({allowedToolsCli:d,disallowedToolsCli:f,baseToolsCli:u,permissionMode:Be,allowDangerouslySkipPermissions:l,addDirs:ee}),D=ht.toolPermissionContext,{warnings:gt,dangerousPermissions:_t,overlyBroadBashPermissions:yt}=ht;if(process.env.USER_TYPE===`ant`&&yt.length>0){for(let e of yt)R(`Ignoring overly broad shell permission ${e.ruleDisplay} from ${e.sourceDisplay}`);D=da(D,yt)}_t.length>0&&(D=wa(D)),gt.forEach(e=>{console.error(e)});let bt=C&&!et&&!js()&&!c()?ts().then(e=>{let{allowed:t,blocked:n}=qs(e);return n.length>0&&process.stderr.write(`Warning: claude.ai MCP ${It(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),t}):Promise.resolve({});R(`[STARTUP] Loading MCP configs...`);let xt=Date.now(),wt,Tt=(et||c()?Promise.resolve({servers:{}}):bo(T)).then(e=>(wt=Date.now()-xt,e));y&&y!==`text`&&y!==`stream-json`&&(console.error(`Error: Invalid input format "${y}".`),process.exit(1)),y===`stream-json`&&v!==`stream-json`&&(console.error(`Error: --input-format=stream-json requires output-format=stream-json.`),process.exit(1)),xe&&(y!==`stream-json`||v!==`stream-json`)&&(console.error(`Error: --sdk-url requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),n.replayUserMessages&&(y!==`stream-json`||v!==`stream-json`)&&(console.error(`Error: --replay-user-messages requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),Se&&(!C||v!==`stream-json`)&&(_r(`Error: --include-partial-messages requires --print and --output-format=stream-json.`),process.exit(1)),n.sessionPersistence===!1&&!C&&(_r(`Error: --no-session-persistence can only be used with --print mode.`),process.exit(1));let O=await Ip(t||``,y??`text`);U(`action_after_input_prompt`),zp(n);let Et=aa(D);if(m(process.env.CLAUDE_CODE_COORDINATOR_MODE)){let{applyCoordinatorToolFilter:e}=await import(`./toolPool-C7bOwJfR.js`);Et=e(Et)}U(`action_tools_loaded`);let k;if(qc({isNonInteractiveSession:C})&&n.jsonSchema&&(k=tr(n.jsonSchema)),k){let e=Hc(k);`tool`in e?(Et=[...Et,e.tool],B(`tengu_structured_output_enabled`,{schema_property_count:Object.keys(k.properties||{}).length,has_required_fields:!!k.required})):B(`tengu_structured_output_failure`,{error:`Invalid JSON schema`})}U(`action_before_setup`),R(`[STARTUP] Running setup()...`);let Dt=Date.now(),{setup:Ot}=await import(`./setup-TqJ7-Nxh.js`),jt=gr();process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&(yd(),qf());let Pt=Ot(jt,Be,l,ve,_e,be,re?Ma(re):void 0,ye,void 0),Lt=ve?null:Vi(jt),Rt=ve?null:ss(jt);Lt?.catch(()=>{}),Rt?.catch(()=>{}),await Pt,R(`[STARTUP] setup() completed in ${Date.now()-Dt}ms`),U(`action_after_setup`);let zt=!!n.replayUserMessages;Re()&&(po(),Lo(),qo(),st());let Bt=n.name?.trim();Bt&&fo(Bt);let Vt=n.model||process.env.ANTHROPIC_MODEL;process.env.USER_TYPE===`ant`&&Vt&&Vt!==`default`&&!Vn(`tengu_ant_model_override`)&&j().cachedGrowthBookFeatures?.tengu_ant_model_override==null&&await dt();let Ut=n.model===`default`?ft():n.model,Wt=g===`default`?ft():g,Gt=ve?gr():jt;R(`[STARTUP] Loading commands and agents...`);let Kt=Date.now(),[qt,Jt]=await Promise.all([Lt??Vi(Gt),Rt??ss(Gt)]);R(`[STARTUP] Commands and agents loaded in ${Date.now()-Kt}ms`),U(`action_commands_loaded`);let Yt=[];if(oe)try{let e=Wr(oe);e&&(Yt=Fs(e,`flagSettings`))}catch(e){H(e)}let Zt=[...Jt.allAgents,...Yt],Qt={...Jt,allAgents:Zt,activeAgents:Gs(Zt)},$t=se??St().agent,M;if($t&&(M=Qt.activeAgents.find(e=>e.agentType===$t),M||R(`Warning: agent "${$t}" not found. Available agents: ${Qt.activeAgents.map(e=>e.agentType).join(`, `)}. Using default behavior.`)),Je(M?.agentType),M&&B(`tengu_agent_flag`,{agentType:Js(M)?M.agentType:`custom`,...se&&{source:`cli`}}),M?.agentType&&as(M.agentType),C&&M&&!ze&&!Js(M)){let e=M.getSystemPrompt();e&&(ze=e)}M?.initialPrompt&&(typeof O==`string`?O=O?`${M.initialPrompt}\n\n${O}`:M.initialPrompt:O||(O=M.initialPrompt));let en=Ut;!en&&M?.model&&M.model!==`inherit`&&(en=ut(M.model)),Qe(en),Ae(At()||null);let tn=at(),nn=ut(tn??ft()),an;if(Ho()){let e=to()?n.advisor:void 0;e&&(R(`[AdvisorTool] --advisor ${e}`),Ds(nn)||(process.stderr.write(b.red(`Error: The model "${nn}" does not support the advisor tool.\n`)),process.exit(1)),tc(Yn(ut(e)))||(process.stderr.write(b.red(`Error: The model "${e}" cannot be used as an advisor.\n`)),process.exit(1))),an=to()?e??lo():e,an&&R(`[AdvisorTool] Advisor model: ${an}`)}if(mn()&&x?.agentId&&x?.agentName&&x?.teamName&&x?.agentType){let e=Qt.activeAgents.find(e=>e.agentType===x.agentType);if(e){let t;if(e.source===`built-in`?R(`[teammate] Built-in agent ${x.agentType} - skipping custom prompt (not supported)`):t=e.getSystemPrompt(),e.memory&&B(`tengu_agent_memory_loaded`,{...process.env.USER_TYPE===`ant`&&{agent_type:e.agentType},scope:e.memory,source:`teammate`}),t){let e=`\n# Custom Agent Instructions\n${t}`;w=w?`${w}\n\n${e}`:e}}else R(`[teammate] Custom agent ${x.agentType} not found in available agents`)}if(Bp(n),!Re()&&!Ze()&&St().defaultView===`chat`){let{isBriefEntitled:t}=(Uo(),e(ci));t()&&Ke(!0)}if((n.proactive||m(process.env.CLAUDE_CODE_PROACTIVE))&&!vp?.isCoordinatorMode()){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. ${(Uo(),e(ci)).isBriefEnabled()?`Call SendUserMessage at checkpoints to mark where things stand.`:`The user will see any text you output.`}`;w=w?`${w}\n\n${t}`:t}if(r&&yp){let e=yp.getAssistantSystemPromptAddendum();w=w?`${w}\n\n${e}`:e}let N,sn,un;if(!C){let e=dd(!1);sn=e.getFpsMetrics,un=e.stats,process.env.USER_TYPE===`ant`&&zl();let{createRoot:n}=await import(`./src-poaoYkuc.js`);N=await n(e.renderOptions),B(`tengu_timer`,{event:`startup`,durationMs:Math.round(process.uptime()*1e3)}),R(`[STARTUP] Running showSetupScreens()...`);let r=Date.now(),i=await ud(N,Be,l,qt,Ue,tt);if(R(`[STARTUP] showSetupScreens() completed in ${Date.now()-r}ms`),De!==void 0){let{getBridgeDisabledReason:e}=await import(`./bridgeEnabled-BUJTCUHY.js`),t=await e();je=t===null,t&&process.stderr.write(b.yellow(`${t}\n--rc flag ignored.\n`))}i&&t?.trim().toLowerCase()===`/login`&&(t=``),i&&(Ii(),Ga(),qn(),Ht(),import(`./trustedDevice-DEuQUTbz.js`).then(e=>(e.clearTrustedDeviceToken(),e.enrollTrustedDevice())));let a=await kt();a.valid||await X(N,a.message)}if(process.exitCode!==void 0){R(`Graceful shutdown initiated, skipping further initialization`);return}if($o(),!C){let{errors:e}=cn(),t=e.filter(e=>!e.mcpErrorMetadata);t.length>0&&await fd(N,{settingsErrors:t,onExit:()=>ta(1)})}let dn=Xt(`tengu_cicada_nap_ms`,0),pn=j().startupPrefetchedAt??0;c()||dn>0&&Date.now()-pn<dn?(R(`Skipping startup prefetches, last ran ${Math.round((Date.now()-pn)/1e3)}s ago`),Nt()):(R(`Starting background startup prefetches${pn>0?` last ran ${Math.round((Date.now()-pn)/1e3)}s ago`:``}`),Va().catch(e=>H(e)),Ku(),xl(),Xt(`tengu_miraculo_the_bard`,!1)?Nt():mt(),dn>0&&A(e=>({...e,startupPrefetchedAt:Date.now()}))),C||ru();let{servers:hn}=await Tt;R(`[STARTUP] MCP configs resolved in ${wt}ms (awaited at +${Date.now()-xt}ms)`);let gn={...hn,...T},_n={},vn={};for(let[e,t]of Object.entries(gn)){let n=t;n.type===`sdk`?_n[e]=n:vn[e]=n}U(`action_mcp_configs_loaded`);let P=C?Promise.resolve({clients:[],tools:[],commands:[]}):yc(vn),yn=C?Promise.resolve({clients:[],tools:[],commands:[]}):bt.then(e=>Object.keys(e).length>0?yc(e):{clients:[],tools:[],commands:[]}),bn=Promise.all([P,yn]).then(([e,t])=>({clients:[...e.clients,...t.clients],tools:rn([...e.tools,...t.tools],`name`),commands:rn([...e.commands,...t.commands],`name`)})),xn=de||ue||fe||C||n.continue||n.resume?null:Ci(`startup`,{agentType:M?.agentType,model:nn}),Sn=[];bn.catch(()=>{});let Cn=[],wn=[],F=[],Tn=Io(),I=Tn===!1?{type:`disabled`}:{type:`adaptive`};if(n.thinking===`adaptive`||n.thinking===`enabled`)Tn=!0,I={type:`adaptive`};else if(n.thinking===`disabled`)Tn=!1,I={type:`disabled`};else{let e=process.env.MAX_THINKING_TOKENS?parseInt(process.env.MAX_THINKING_TOKENS,10):n.maxThinkingTokens;e!==void 0&&(e>0?(Tn=!0,I={type:`enabled`,budgetTokens:e}):e===0&&(Tn=!1,I={type:`disabled`}))}V(`info`,`started`,{version:`2.6.0`,is_native_binary:Ar()}),ir(async()=>{V(`info`,`exited`)}),Rp({hasInitialPrompt:!!t,hasStdin:!!O,verbose:ce,debug:a,debugToStderr:o,print:le??!1,outputFormat:v??`text`,inputFormat:y??`text`,numAllowedTools:d.length,numDisallowedTools:f.length,mcpClientCount:Object.keys(gn).length,worktreeEnabled:ve,skipWebFetchPreflight:St().skipWebFetchPreflight,githubActionInputs:process.env.GITHUB_ACTION_INPUTS,dangerouslySkipPermissionsPassed:s??!1,permissionMode:Be,modeIsBypass:Be===`bypassPermissions`,allowDangerouslySkipPermissionsPassed:l,systemPromptFlag:ze?n.systemPromptFile?`file`:`flag`:void 0,appendSystemPromptFlag:w?n.appendSystemPromptFile?`file`:`flag`:void 0,thinkingConfig:I,assistantActivationPath:r?yp?.getAssistantActivationPath():void 0}),No(vn,D),Di(null,`initialization`),Sp(),oc().then(e=>{e&&(Bt&&Ls(Bt),Zs().then(e=>{e>=2&&B(`tengu_concurrent_sessions`,{num_sessions:e})}))}),c()||(C?(await Oi(),U(`action_after_plugins_init`),ko().then(()=>Ri())):Oi().then(async()=>{U(`action_after_plugins_init`),await ko(),Ri()}));let En=de||ue?`init`:fe?`maintenance`:null;if(de){po(),await vc(`init`,{forceSyncExecution:!0}),await Ci(`startup`,{forceSyncExecution:!0}),ta(0);return}if(C){(v===`stream-json`||v===`json`)&&or(!0),po(),Bu();let e=n.continue||n.resume||S||En?void 0:Ci(`startup`);e?.catch(()=>{}),U(`before_validateForceLoginOrg`);let t=await kt();t.valid||(process.stderr.write(t.message+`
|
|
1085
|
+
`),process.exit(1));let i=pe?[]:qt.filter(e=>e.type===`prompt`&&!e.disableNonInteractive||e.type===`local`&&e.supportsNonInteractive),a=Ui(),o=ha({...a,mcp:{...a.mcp,clients:Cn,commands:F,tools:wn},toolPermissionContext:D,effortValue:Os(n.effort)??ro(),...Un()&&{fastMode:fn(en??null)},...Ho()&&an&&{advisorModel:an},kairosEnabled:r},Rl);oa(D,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&&nt(!0),$e(vt(te));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}))]}})),Ra(({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:rn([...r.mcp.tools,...t],`name`),commands:rn([...r.mcp.commands,...n],`name`)}}))},e).catch(e=>R(`[MCP] ${t} connect error: ${e}`)));U(`before_connectMcp`),await s(vn,`regular`),U(`after_connectMcp`);let l=5e3,u=bt.then(e=>{if(Object.keys(e).length>0){let t=new Set;for(let n of Object.values(e)){let e=Po(n);e&&t.add(e)}let n=new Set;for(let[e,r]of Object.entries(vn)){if(!e.startsWith(`plugin:`))continue;let i=Po(r);i&&t.has(i)&&n.add(e)}if(n.size>0){R(`[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,ns(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=qa(i,e),a=Hi(a,e);return{...e,mcp:{...e.mcp,clients:t,tools:r,commands:i,resources:a}}})}}let{servers:t}=rc(e,ct(vn,(e,t)=>!t.startsWith(`plugin:`)));return s(t,`claudeai`)}),f,p=await Promise.race([u.then(()=>!1),new Promise(e=>{f=setTimeout(e=>e(!0),l,e)})]);f&&clearTimeout(f),p&&R(`[MCP] claude.ai connectors not ready after ${l}ms — proceeding; background connection continues`),U(`after_connectMcp_claudeai`),c()||(kp(),import(`./backgroundHousekeeping-DUmxC6h0.js`).then(e=>e.startBackgroundHousekeeping()),process.env.USER_TYPE===`ant`&&import(`./sdkHeapDumpMonitor--fevrC5z.js`).then(e=>e.startSdkMemoryMonitor())),Cp(),U(`before_print_import`);let{runHeadless:m}=await import(`./print-CPtR0KTa.js`);U(`after_print_import`),m(O,()=>o.getState(),o.setState,i,Et,_n,Qt.activeAgents,{continue:n.continue,resume:n.resume,verbose:ce,outputFormat:v,jsonSchema:k,permissionPromptToolName:n.permissionPromptTool,allowedTools:d,thinkingConfig:I,maxTurns:n.maxTurns,maxBudgetUsd:n.maxBudgetUsd,taskBudget:n.taskBudget?{total:n.taskBudget}:void 0,systemPrompt:ze,appendSystemPrompt:w,userSpecifiedModel:en,fallbackModel:Wt,teleport:S,sdkUrl:xe,replayUserMessages:zt,includePartialMessages:Se,forkSession:n.forkSession||!1,resumeSessionAt:n.resumeSessionAt||void 0,rewindFiles:n.rewindFiles,enableAuthStatus:n.enableAuthStatus,agent:se,workload:n.workload,setupTrigger:En??void 0,sessionStartHooksPromise:e});return}B(`tengu_startup_manual_model_config`,{cli_flag:n.model,env_var:process.env.ANTHROPIC_MODEL,settings_file:(St()||{}).model,subscriptionType:Pn(),agent:$t});let Dn=$l(nn),On=[];if(Ve&&On.push({key:`permission-mode-notification`,text:Ve,priority:`high`}),Dn&&On.push({key:`model-deprecation-warning`,text:Dn,color:`warning`,priority:`high`}),yt.length>0){let e=Gr(yt.map(e=>e.ruleDisplay)),t=e.join(`, `),n=Gr(yt.map(e=>e.sourceDisplay)).join(`, `),r=e.length;On.push({key:`overly-broad-bash-notification`,text:`${t} allow ${It(r,`rule`)} from ${n} ${It(r,`was`,`were`)} ignored \u2014 not available for Ants, please use auto-mode instead`,color:`warning`,priority:`high`})}let An=hp(),jn={...D,mode:mn()&&An?.isPlanModeRequired?.()?`plan`:D.mode},Mn=Ze(),Nn=je||Mt()||r,Fn={settings:St(),tasks:{},agentNameRegistry:new Map,verbose:ce??j().verbose??!1,mainLoopModel:tn,mainLoopModelForSession:null,isBriefOnly:Mn,expandedView:j().showSpinnerTree?`teammates`:j().showExpandedTodos?`tasks`:`none`,showTeammateMessagePreview:mn()?!1:void 0,selectedIPAgentIndex:-1,selectedBgAgentIndex:-1,coordinatorTaskIndex:-1,viewSelectionMode:`none`,footerSelection:null,toolPermissionContext:jn,agent:M?.agentType,agentDefinitions:Qt,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:Nn||!1,replBridgeExplicit:je,replBridgeOutboundOnly:!1,replBridgeConnected:!1,replBridgeSessionActive:!1,replBridgeReconnecting:!1,replBridgeConnectUrl:void 0,replBridgeSessionUrl:void 0,replBridgeEnvironmentId:void 0,replBridgeSessionId:void 0,replBridgeError:void 0,replBridgeInitialName:Ne,showRemoteCallout:!1,notifications:{current:null,queue:On},elicitation:{queue:[]},todos:{},remoteAgentTaskSuggestions:[],fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},attribution:al(),thinkingEnabled:Tn,promptSuggestionEnabled:Zi(),sessionHooks:new Map,inbox:{messages:[]},promptSuggestion:{text:null,promptId:null,shownAt:0,acceptedAt:0,generationRequestId:null},speculation:Ja,speculationSessionTimeSavedMs:0,skillImprovement:{suggestion:null},workerSandboxPermissions:{queue:[],selectedIndex:0},pendingWorkerRequest:null,pendingSandboxRequest:null,authVersion:0,initialMessage:O?{message:Co({content:String(O)})}:null,effortValue:Os(n.effort)??ro(),activeOverlays:new Set,fastMode:fn(nn),...Ho()&&an&&{advisorModel:an},teamContext:i??eu()};O&&Do(String(O));let In=wn;A(e=>({...e,numStartups:(e.numStartups??0)+1})),setImmediate(()=>{Tp(),Cp()});let Ln=process.env.USER_TYPE===`ant`?import(`./sessionDataUploader-Ctjo1bgR.js`):null,Rn=Ln?Ln.then(e=>e.createSessionTurnUploader()).catch(()=>null):null,zn={debug:a||o,commands:[...qt,...F],initialTools:In,mcpClients:Cn,autoConnectIdeFlag:ne,mainThreadAgentDefinition:M,disableSlashCommands:pe,dynamicMcpConfig:T,strictMcpConfig:et,systemPrompt:ze,appendSystemPrompt:w,taskListId:he,thinkingConfig:I,...Rn&&{onTurnComplete:e=>{Rn.then(t=>t?.(e))}}},Bn={modeApi:vp,mainThreadAgentDefinition:M,agentDefinitions:Qt,currentCwd:Gt,cliAgents:Yt,initialState:Fn};if(n.continue){let e=!1;try{let t=performance.now(),{clearSessionCaches:r}=await import(`./caches-CTfNpKhW.js`);r();let i=await Tc(void 0,void 0);if(!i)return B(`tengu_continue`,{success:!1}),await X(N,`No conversation found to continue`);let a=await Bl(i,{forkSession:!!n.forkSession,includeAttribution:!0,transcriptPath:i.fullPath},Bn);a.restoredAgentDef&&(M=a.restoredAgentDef),zp(n),Bp(n),B(`tengu_continue`,{success:!0,resume_duration_ms:Math.round(performance.now()-t)}),e=!0,await Uu(N,{getFpsMetrics:sn,stats:un,initialState:a.initialState},{...zn,mainThreadAgentDefinition:a.restoredAgentDef??M,initialMessages:a.messages,initialFileHistorySnapshots:a.fileHistorySnapshots,initialContentReplacements:a.contentReplacements,initialAgentName:a.agentName,initialAgentColor:a.agentColor},ld)}catch(t){e||B(`tengu_continue`,{success:!1}),H(t),process.exit(1)}}else if(Q?.url){let e;try{let t=await dp({serverUrl:Q.url,authToken:Q.authToken,cwd:Ye(),dangerouslySkipPermissions:Q.dangerouslySkipPermissions});t.workDir&&(qe(t.workDir),Pe(t.workDir)),Fe(Q.url),e=t.config}catch(e){return await X(N,e instanceof up?e.message:String(e),()=>W(1))}let t=ho(`Connected to server at ${Q.url}\nSession: ${e.sessionId}`,`info`);await Uu(N,{getFpsMetrics:sn,stats:un,initialState:Fn},{debug:a||o,commands:qt,initialTools:[],initialMessages:[t],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:M,disableSlashCommands:pe,directConnectConfig:e,thinkingConfig:I},ld);return}else if($?.host){let{createSSHSession:e,createLocalSSHSession:t,SSHSessionError:n}=await import(`./createSSHSession-DqmkCS_k.js`),r;try{if($.local)process.stderr.write(`Starting local ssh-proxy test session...
|
|
1086
|
+
`),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:`2.6.0`,permissionMode:$.permissionMode,dangerouslySkipPermissions:$.dangerouslySkipPermissions,extraCliArgs:$.extraCliArgs,remoteBin:$.remoteBin},t?{onProgress:e=>{n=!0,process.stderr.write(`\r ${e}\x1b[K`)}}:{}),n&&process.stderr.write(`
|
|
1087
|
+
`)}qe(r.remoteCwd),Pe(r.remoteCwd),Fe($.local?`local`:$.host)}catch(e){return await X(N,e instanceof n?e.message:String(e),()=>W(1))}let i=ho($.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 Uu(N,{getFpsMetrics:sn,stats:un,initialState:Fn},{debug:a||o,commands:qt,initialTools:[],initialMessages:[i],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:M,disableSlashCommands:pe,sshSession:r,thinkingConfig:I},ld);return}else if(Pp&&(Pp.sessionId||Pp.discover)){let{discoverAssistantSessions:e}=await import(`./sessionDiscovery-DgNea6qa.js`),t=Pp.sessionId;if(!t){let n;try{n=await e()}catch(e){return await X(N,`Failed to discover sessions: ${e instanceof Error?e.message:e}`,()=>W(1))}if(n.length===0){let e;try{e=await md(N)}catch(e){return await X(N,`Assistant installation failed: ${e instanceof Error?e.message:e}`,()=>W(1))}return e===null&&(await W(0),process.exit(0)),await cd(N,`Assistant installed in ${e}. The daemon is starting up — run \`claude assistant\` again in a few seconds to connect.`,{exitCode:0,beforeExit:()=>W(0)})}if(n.length===1)t=n[0].id;else{let e=await pd(N,{sessions:n});e||(await W(0),process.exit(0)),t=e}}let{checkAndRefreshOAuthTokenIfNeeded:n,getClaudeAIOAuthTokens:r}=await import(`./auth-CqURlg4d.js`);await n();let i;try{i=await pl()}catch(e){return await X(N,`Error: ${e instanceof Error?e.message:`Failed to authenticate`}`,()=>W(1))}let s=()=>r()?.accessToken??i.accessToken;Me(!0),Ke(!0),ke(!0);let c=tu(t,s,i.orgUUID,!1,!0),l=ho(`Attached to assistant session ${t.slice(0,8)}…`,`info`),u={...Fn,isBriefOnly:!0,kairosEnabled:!1,replBridgeEnabled:!1},d=yi(qt);await Uu(N,{getFpsMetrics:sn,stats:un,initialState:u},{debug:a||o,commands:d,initialTools:[],initialMessages:[l],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:M,disableSlashCommands:pe,remoteSessionConfig:c,thinkingConfig:I},ld);return}else if(n.resume||n.fromPr||S||Te!==null){let{clearSessionCaches:e}=await import(`./caches-CTfNpKhW.js`);e();let t=null,r,i=Ma(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`&&!i){let e=n.resume.trim();if(e){let t=await Fa(e,{exact:!0});t.length===1?(c=t[0],i=hc(c)??null):s=e}}if((Te!==null||S)&&(await ra(),!_i(`allow_remote_sessions`)))return await X(N,`Error: Remote sessions are disabled by your organization's policy.`,()=>W(1));if(Te!==null){let e=Te.length>0,t=Xt(`tengu_remote_backend`,!1);if(!t&&!e)return await X(N,`Error: --remote requires a description.
|
|
1088
|
+
Usage: claude --remote "your task description"`,()=>W(1));B(`tengu_remote_create_session`,{has_initial_prompt:String(e)});let n=await Cr(),r=await xs(N,e?Te:null,new AbortController().signal,n||void 0);if(!r)return B(`tengu_remote_create_session_error`,{error:`unable_to_create_session`}),await X(N,`Error: Unable to create remote session`,()=>W(1));B(`tengu_remote_create_session_success`,{session_id:r.id}),t||(process.stdout.write(`Created remote session: ${r.title}\n`),process.stdout.write(`View: ${go(r.id)}?m=0\n`),process.stdout.write(`Resume with: claude --teleport ${r.id}\n`),await W(0),process.exit(0)),ke(!0),We(rs(r.id));let i;try{i=await pl()}catch(e){return H(Qn(e)),await X(N,`Error: ${L(e)||`Failed to authenticate`}`,()=>W(1))}let{getClaudeAIOAuthTokens:s}=await import(`./auth-CqURlg4d.js`),c=tu(r.id,()=>s()?.accessToken??i.accessToken,i.orgUUID,e),l=`${go(r.id)}?m=0`,u=ho(`/remote-control is active. Code in CLI or at ${l}`,`info`),d=e?Co({content:Te}):null,f={...Fn,remoteSessionUrl:l},p=yi(qt);await Uu(N,{getFpsMetrics:sn,stats:un,initialState:f},{debug:a||o,commands:p,initialTools:[],initialMessages:d?[u,d]:[u],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:M,disableSlashCommands:pe,remoteSessionConfig:c,thinkingConfig:I},ld);return}else if(S){if(S===!0||S===``){B(`tengu_teleport_interactive_mode`,{}),R(`selectAndResumeTeleportTask: Starting teleport flow...`);let e=await hd(N);e||(await W(0),process.exit(0));let{branchError:n}=await As(e.branch);t=yo(e.log,n)}else if(typeof S==`string`){B(`tengu_teleport_resume_session`,{mode:`direct`});try{let e=await zo(await hl(S));if(e.status===`mismatch`||e.status===`not_in_repo`){let t=e.sessionRepo;if(t){let e=await Xl(Yl(t));if(e.length>0){let n=await gd(N,{targetRepo:t,initialPaths:e});n?(process.chdir(n),Ka(n),qe(n)):await W(0)}else throw new Zn(`You must run claude --teleport ${S} from a checkout of ${t}.`,b.red(`You must run claude --teleport ${S} from a checkout of ${b.bold(t)}.\n`))}}else if(e.status===`error`)throw new Zn(e.errorMessage||`Failed to validate session`,b.red(`Error: ${e.errorMessage||`Failed to validate session`}\n`));await sc();let{teleportWithProgress:n}=await import(`./TeleportProgress-DPzGpyyM.js`),r=await n(N,S);Oe({sessionId:S}),t=r.messages}catch(e){e instanceof Zn?process.stderr.write(e.formattedMessage+`
|
|
1089
|
+
`):(H(e),process.stderr.write(b.red(`Error: ${L(e)}\n`))),await W(1)}}}if(process.env.USER_TYPE===`ant`&&n.resume&&typeof n.resume==`string`&&!i){let{parseCcshareId:e,loadCcshare:t}=await import(`./ccshareResume-DWLjTF22.js`),i=e(n.resume);if(i)try{let e=performance.now(),n=await Tc(await t(i),void 0);n?(r=await Bl(n,{forkSession:!0,transcriptPath:n.fullPath},Bn),r.restoredAgentDef&&(M=r.restoredAgentDef),B(`tengu_session_resumed`,{entrypoint:`ccshare`,success:!0,resume_duration_ms:Math.round(performance.now()-e)})):B(`tengu_session_resumed`,{entrypoint:`ccshare`,success:!1})}catch(e){B(`tengu_session_resumed`,{entrypoint:`ccshare`,success:!1}),H(e),await X(N,`Unable to resume from ccshare: ${L(e)}`,()=>W(1))}else{let e=lu(n.resume);try{let t=performance.now(),i;try{i=await oo(e)}catch(e){if(!nr(e))throw e}if(i){let e=await Tc(i,void 0);e?(r=await Bl(e,{forkSession:!!n.forkSession,transcriptPath:e.fullPath},Bn),r.restoredAgentDef&&(M=r.restoredAgentDef),B(`tengu_session_resumed`,{entrypoint:`file`,success:!0,resume_duration_ms:Math.round(performance.now()-t)})):B(`tengu_session_resumed`,{entrypoint:`file`,success:!1})}}catch(e){B(`tengu_session_resumed`,{entrypoint:`file`,success:!1}),H(e),await X(N,`Unable to load transcript from file: ${n.resume}`,()=>W(1))}}}if(i){let e=i;try{let t=performance.now(),i=await Tc(c??e,void 0);if(!i)return B(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),await X(N,`No conversation found with session ID: ${e}`);let a=c?.fullPath??i.fullPath;r=await Bl(i,{forkSession:!!n.forkSession,sessionIdOverride:e,transcriptPath:a},Bn),r.restoredAgentDef&&(M=r.restoredAgentDef),B(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!0,resume_duration_ms:Math.round(performance.now()-t)})}catch(t){B(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),H(t),await X(N,`Failed to resume session ${e}`)}}if(ae)try{let e=await ae,t=Kr(e,e=>!e.success);t>0&&process.stderr.write(b.yellow(`Warning: ${t}/${e.length} file(s) failed to download.\n`))}catch(e){return await X(N,`Error downloading files: ${L(e)}`)}let u=r??(Array.isArray(t)?{messages:t,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:M,initialState:Fn,contentReplacements:void 0}:void 0);u?(zp(n),Bp(n),await Uu(N,{getFpsMetrics:sn,stats:un,initialState:u.initialState},{...zn,mainThreadAgentDefinition:u.restoredAgentDef??M,initialMessages:u.messages,initialFileHistorySnapshots:u.fileHistorySnapshots,initialContentReplacements:u.contentReplacements,initialAgentName:u.agentName,initialAgentColor:u.agentColor},ld)):await _d(N,{getFpsMetrics:sn,stats:un,initialState:Fn},ma(Ye()),{...zn,initialSearchQuery:s,forkSession:n.forkSession,filterByPr:l})}else{let e=xn&&Sn.length===0?xn:void 0;U(`action_after_hooks`),zp(n),Bp(n),dc(vp?.isCoordinatorMode()?`coordinator`:`normal`);let t=null;n.deepLinkOrigin?(B(`tengu_deep_link_opened`,{has_prefill:!!n.prefill,has_repo:!!n.deepLinkRepo}),t=ho(ou({cwd:gr(),prefillLength:n.prefill?.length,repo:n.deepLinkRepo,lastFetch:n.deepLinkLastFetch===void 0?void 0:new Date(n.deepLinkLastFetch)}),`warning`)):n.prefill&&(t=ho(`Launched with a pre-filled prompt — review it before pressing Enter.`,`warning`));let r=t?[t,...Sn]:Sn.length>0?Sn:void 0;await Uu(N,{getFpsMetrics:sn,stats:un,initialState:Fn},{...zn,initialMessages:r,pendingHookMessages:e},ld)}}).version(`2.6.0 (Claude Code)`,`-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.`),to()&&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(`--channels <servers...>`,`MCP servers whose channel notifications (inbound push) should register this session. Space-separated server names.`).hideHelp()),n.addOption(new J(`--dangerously-load-development-channels <servers...>`,`Load channel servers not on the approved allowlist. For local channel development only. Shows a confirmation dialog at startup.`).hideHelp()),n.addOption(new J(`--agent-id <id>`,`Teammate agent ID`).hideHelp()),n.addOption(new J(`--agent-name <name>`,`Teammate display name`).hideHelp()),n.addOption(new J(`--team-name <name>`,`Team name for swarm coordination`).hideHelp()),n.addOption(new J(`--agent-color <color>`,`Teammate UI color`).hideHelp()),n.addOption(new J(`--plan-mode-required`,`Require plan mode before implementation`).hideHelp()),n.addOption(new J(`--parent-session-id <id>`,`Parent session ID for analytics correlation`).hideHelp()),n.addOption(new J(`--teammate-mode <mode>`,`How to spawn teammates: "tmux", "in-process", or "auto"`).choices([`auto`,`tmux`,`in-process`]).hideHelp()),n.addOption(new J(`--agent-type <type>`,`Custom agent type for this teammate`).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()),U(`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 U(`run_before_parse`),await n.parseAsync(process.argv),U(`run_after_parse`),n;let a=n.command(`mcp`).description(`Configure and manage MCP servers`).configureHelp(t()).enablePositionalOptions();a.command(`serve`).description(`Start the Claude Code 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-COQap0SM.js`);await n({debug:e,verbose:t})}),Xf(a),ga()&&Zf(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-COQap0SM.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-COQap0SM.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-COQap0SM.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-COQap0SM.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-COQap0SM.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-COQap0SM.js`);await e()}),n.command(`server`).description(`Start a Claude Code 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-C5XZSlto.js`),{SessionManager:r}=await import(`./sessionManager-Dw72ZUTg.js`),{DangerousBackend:i}=await import(`./dangerousBackend-BU_PHGR2.js`),{printBanner:a}=await import(`./serverBanner-WlSYP-f8.js`),{createServerLogger:o}=await import(`./serverLog-DtsUvDiY.js`),{writeServerLock:s,removeServerLock:c,probeRunningServer:l}=await import(`./lockfile-DBwdlC3K.js`),u=await l();u&&(process.stderr.write(`A claude server is already running (pid ${u.pid}) at ${u.httpUrl}\n`),process.exit(1));let d=e.authToken??`sk-ant-cc-${t(16).toString(`base64url`)}`,f={port:parseInt(e.port,10),host:e.host,authToken:d,unix:e.unix,workspace:e.workspace,idleTimeoutMs:parseInt(e.idleTimeout,10),maxSessions:parseInt(e.maxSessions,10)},p=new r(new i,{idleTimeoutMs:f.idleTimeoutMs,maxSessions:f.maxSessions}),m=n(f,p,o()),h=m.port??f.port;a(f,d,h),await s({pid:process.pid,port:h,host:f.host,httpUrl:f.unix?`unix:${f.unix}`:`http://${f.host}:${h}`,startedAt:Date.now()});let ee=!1,g=async()=>{ee||(ee=!0,m.stop(!0),await p.destroyAll(),await c(),process.exit(0))};process.once(`SIGINT`,()=>void g()),process.once(`SIGTERM`,()=>void g())}),n.command(`ssh <host> [dir]`).description(`Run Claude Code 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]
|
|
1090
|
+
|
|
1091
|
+
Runs Claude Code on a remote Linux host. You don't need to install
|
|
1092
|
+
anything on the remote or run \`claude auth login\` there — the binary is
|
|
1093
|
+
deployed over SSH and API auth tunnels back through your local machine.
|
|
1094
|
+
`),process.exit(1)}),n.command(`open <cc-url>`).description(`Connect to a Claude Code 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-BS6i9JPo.js`),{serverUrl:r,authToken:i}=n(e),a;try{let e=await dp({serverUrl:r,authToken:i,cwd:Ye(),dangerouslySkipPermissions:Q?.dangerouslySkipPermissions});e.workDir&&(qe(e.workDir),Pe(e.workDir)),Fe(r),a=e.config}catch(e){console.error(e instanceof up?e.message:String(e)),process.exit(1)}let{runConnectHeadless:o}=await import(`./connectHeadless-CwsFt-Mh.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 to your Anthropic account`).option(`--email <email>`,`Pre-populate email address on the login page`).option(`--sso`,`Force SSO login flow`).option(`--console`,`Use Anthropic 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-D4isgfuK.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-D4isgfuK.js`);await t(e)}),o.command(`logout`).description(`Log out from your Anthropic account`).action(async()=>{let{authLogout:e}=await import(`./auth-D4isgfuK.js`);await e()});let s=()=>new J(`--cowork`,`Use cowork_plugins directory`).hideHelp(),l=n.command(`plugin`).alias(`plugins`).description(`Manage Claude Code plugins`).configureHelp(t());l.command(`validate <path>`).description(`Validate a plugin or marketplace manifest`).addOption(s()).action(async(e,t)=>{let{pluginValidateHandler:n}=await import(`./plugins-BgOP_8TX.js`);await n(e,t)}),l.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-BgOP_8TX.js`);await t(e)});let u=l.command(`marketplace`).description(`Manage Claude Code marketplaces`).configureHelp(t());if(u.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-BgOP_8TX.js`);await n(e,t)}),u.command(`list`).description(`List all configured marketplaces`).option(`--json`,`Output as JSON`).addOption(s()).action(async e=>{let{marketplaceListHandler:t}=await import(`./plugins-BgOP_8TX.js`);await t(e)}),u.command(`remove <name>`).alias(`rm`).description(`Remove a configured marketplace`).addOption(s()).action(async(e,t)=>{let{marketplaceRemoveHandler:n}=await import(`./plugins-BgOP_8TX.js`);await n(e,t)}),u.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-BgOP_8TX.js`);await n(e,t)}),l.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-BgOP_8TX.js`);await n(e,t)}),l.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-BgOP_8TX.js`);await n(e,t)}),l.command(`enable <plugin>`).description(`Enable a disabled plugin`).option(`-s, --scope <scope>`,`Installation scope: ${Ll.join(`, `)} (default: auto-detect)`).addOption(s()).action(async(e,t)=>{let{pluginEnableHandler:n}=await import(`./plugins-BgOP_8TX.js`);await n(e,t)}),l.command(`disable [plugin]`).description(`Disable an enabled plugin`).option(`-a, --all`,`Disable all enabled plugins`).option(`-s, --scope <scope>`,`Installation scope: ${Ll.join(`, `)} (default: auto-detect)`).addOption(s()).action(async(e,t)=>{let{pluginDisableHandler:n}=await import(`./plugins-BgOP_8TX.js`);await n(e,t)}),l.command(`update <plugin>`).description(`Update a plugin to the latest version (restart required to apply)`).option(`-s, --scope <scope>`,`Installation scope: ${Il.join(`, `)} (default: user)`).addOption(s()).action(async(e,t)=>{let{pluginUpdateHandler:n}=await import(`./plugins-BgOP_8TX.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-CeIKZmj9.js`),import(`./src-poaoYkuc.js`)]);await e(await t(ql(!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-DCh_gEvJ.js`);await e(),process.exit(0)}),So()!==`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-DVt4K4I2.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-DVt4K4I2.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-DVt4K4I2.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-BZzW8QJZ.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-BZzW8QJZ.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-BZzW8QJZ.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-BZzW8QJZ.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-BZzW8QJZ.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-BZzW8QJZ.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-DYL4fl6A.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]
|
|
1095
|
+
|
|
1096
|
+
Attach the REPL as a viewer client to a running bridge session.
|
|
1097
|
+
Omit sessionId to discover and pick from available sessions.
|
|
1098
|
+
`),process.exit(1)}),n.command(`doctor`).description(`Check the health of your Claude Code 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-CeIKZmj9.js`),import(`./src-poaoYkuc.js`)]);await e(await t(ql(!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-D-U4wUCe.js`);await e()}),process.env.USER_TYPE===`ant`&&n.command(`rollback [target]`).description(`[ANT-ONLY] Roll back to a previous release
|
|
1099
|
+
|
|
1100
|
+
Examples:
|
|
1101
|
+
claude rollback Go 1 version back from current
|
|
1102
|
+
claude rollback 3 Go 3 versions back from current
|
|
1103
|
+
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-DbSpxmJE.js`);await n(e,t)}),n.command(`install [target]`).description(`Install Claude Code 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-CeIKZmj9.js`);await n(e,t)}),n.command(`update`).description(`Update claude-code-best (ccb) to the latest version`).action(async()=>{let{updateCCB:e}=await import(`./updateCCB-CJ7dCUan.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=>Ma(e)||Number(e)).action(async e=>{let{logHandler:t}=await import(`./ant-DRJq-cEg.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-DRJq-cEg.js`);await t(e)}),n.command(`export`).description(`[ANT-ONLY] Export a conversation to a text file.`).usage(`<source> <outputFile>`).argument(`<source>`,`Session ID, log index (0, 1, 2...), or path to a .json/.jsonl log file`).argument(`<outputFile>`,`Output file path for the exported text`).addHelpText(`after`,`
|
|
1104
|
+
Examples:
|
|
1105
|
+
$ claude export 0 conversation.txt Export conversation at log index 0
|
|
1106
|
+
$ claude export <uuid> conversation.txt Export conversation by session ID
|
|
1107
|
+
$ claude export input.json output.txt Render JSON log file to text
|
|
1108
|
+
$ claude export <uuid>.jsonl output.txt Render JSONL session file to text`).action(async(e,t)=>{let{exportHandler:n}=await import(`./ant-DRJq-cEg.js`);await n(e,t)}),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-DRJq-cEg.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-DRJq-cEg.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-DRJq-cEg.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 (${ol.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-DRJq-cEg.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-DRJq-cEg.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-DRJq-cEg.js`);await r(e,t,n)})}return U(`run_before_parse`),await n.parseAsync(process.argv),U(`run_after_parse`),U(`main_after_run`),Zr(),n}async function Rp({hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:i,print:a,outputFormat:o,inputFormat:s,numAllowedTools:u,numDisallowedTools:d,mcpClientCount:f,worktreeEnabled:p,skipWebFetchPreflight:m,githubActionInputs:h,dangerouslySkipPermissionsPassed:ee,permissionMode:g,modeIsBypass:te,allowDangerouslySkipPermissionsPassed:ne,systemPromptFlag:re,appendSystemPromptFlag:_,thinkingConfig:ie,assistantActivationPath:ae}){try{B(`tengu_init`,{entrypoint:`claude`,hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:i,print:a,outputFormat:o,inputFormat:s,numAllowedTools:u,numDisallowedTools:d,mcpClientCount:f,worktree:p,skipWebFetchPreflight:m,...h&&{githubActionInputs:h},dangerouslySkipPermissionsPassed:ee,permissionMode:g,modeIsBypass:te,inProtectedNamespace:l(),allowDangerouslySkipPermissionsPassed:ne,thinkingType:ie.type,...ie.type===`enabled`&&{thinkingBudgetTokens:ie.budgetTokens},...re&&{systemPromptFlag:re},..._&&{appendSystemPromptFlag:_},is_simple:c()||void 0,is_coordinator:vp?.isCoordinatorMode()?!0:void 0,...ae&&{assistantActivationPath:ae},autoUpdatesChannel:St().autoUpdatesChannel??`latest`,...process.env.USER_TYPE===`ant`?(()=>{let e=gr(),t=Tr(e),n=t?cu(t,e)||`.`:void 0;return n?{relativeProjectPath:n}:{}})():{}})}catch(e){H(e)}}function zp(t){if(t.proactive||m(process.env.CLAUDE_CODE_PROACTIVE)){let t=($c(),e(Xc));t.isProactiveActive()||t.activateProactive(`command`)}}function Bp(t){let n=t.brief,r=m(process.env.CLAUDE_CODE_BRIEF);if(!n&&!r)return;let{isBriefEntitled:i}=(Uo(),e(ci)),a=i();a&&Ke(!0),B(`tengu_brief_mode_enabled`,{enabled:a,gated:!a,source:r?`env`:`flag`})}function Vp(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(ve)}function Hp(e){if(typeof e!=`object`||!e)return{};let t=e,n=t.teammateMode;return{agentId:typeof t.agentId==`string`?t.agentId:void 0,agentName:typeof t.agentName==`string`?t.agentName:void 0,teamName:typeof t.teamName==`string`?t.teamName:void 0,agentColor:typeof t.agentColor==`string`?t.agentColor:void 0,planModeRequired:typeof t.planModeRequired==`boolean`?t.planModeRequired:void 0,parentSessionId:typeof t.parentSessionId==`string`?t.parentSessionId:void 0,teammateMode:n===`auto`||n===`tmux`||n===`in-process`?n:void 0,agentType:typeof t.agentType==`string`?t.agentType:void 0}}export{Fp as main};
|