claude-code-best 2.7.2 → 2.8.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.
Files changed (476) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-V2tF7iCY.js → AddWorkspaceDirectory-DRO4tbYd.js} +1 -1
  2. package/dist/chunks/{App-DLdRpU7c.js → App-DJyiiVKi.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-DPws3jax.js → ApproveApiKey-DygOEAkM.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-oTZKoMvB.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-D6rS0OVe.js → AssistantSessionChooser-C67mOxVi.js} +1 -1
  6. package/dist/chunks/{BackgroundTasksDialog-hGlbm5z5.js → BackgroundTasksDialog-Bqk_Cn3j.js} +1 -1
  7. package/dist/chunks/{BypassPermissionsModeDialog-CuEpdRVd.js → BypassPermissionsModeDialog-C4z7RkFV.js} +1 -1
  8. package/dist/chunks/{ClaudeInChromeOnboarding-CTTKMRbt.js → ClaudeInChromeOnboarding-CyVFdjBe.js} +1 -1
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-5FCT81WS.js +1 -0
  10. package/dist/chunks/{ClaudeMdExternalIncludesDialog-B-GkVoA_.js → ClaudeMdExternalIncludesDialog-IpqqBuJs.js} +1 -1
  11. package/dist/chunks/ConsoleOAuthFlow-BmGziW64.js +1 -0
  12. package/dist/chunks/{DesktopHandoff-BjPylhOT.js → DesktopHandoff-CJpa8Xy-.js} +1 -1
  13. package/dist/chunks/{DevChannelsDialog-c4YVqBX9.js → DevChannelsDialog-CfAuHVRL.js} +1 -1
  14. package/dist/chunks/Dialog-C8eGKH-e.js +1 -0
  15. package/dist/chunks/{DiffDialog-I5wuXw2C.js → DiffDialog-CV3brWsG.js} +1 -1
  16. package/dist/chunks/{Doctor-Cr_MlSPc.js → Doctor-D3GysagF.js} +1 -1
  17. package/dist/chunks/Doctor-DohPtIKu.js +1 -0
  18. package/dist/chunks/{ExitFlow-Bz5grDWv.js → ExitFlow-L2sh80sm.js} +1 -1
  19. package/dist/chunks/{Feedback-COgMI5tY.js → Feedback-DfkBCvva.js} +1 -1
  20. package/dist/chunks/{Grove-m57x4tY1.js → Grove-Bo74aZx-.js} +1 -1
  21. package/dist/chunks/Grove-C_ocvHd3.js +1 -0
  22. package/dist/chunks/{HybridTransport-Bok4-Ptt.js → HybridTransport-BItIDJyC.js} +1 -1
  23. package/dist/chunks/{ITermBackend-BBSP-NNa.js → ITermBackend-3iS8Bvmo.js} +1 -1
  24. package/dist/chunks/{InvalidConfigDialog-uTSuSBvO.js → InvalidConfigDialog-6lPGcuOX.js} +1 -1
  25. package/dist/chunks/{InvalidSettingsDialog-B-Os12-H.js → InvalidSettingsDialog-D8DwHiys.js} +1 -1
  26. package/dist/chunks/ListItem-DDMe4CJ3.js +1 -0
  27. package/dist/chunks/{MCPConnectionManager-y97Inszc.js → MCPConnectionManager-CsPizxTx.js} +1 -1
  28. package/dist/chunks/{McpParsingWarnings-DMFUZw92.js → McpParsingWarnings-Cepe7RPZ.js} +1 -1
  29. package/dist/chunks/{MessageSelector-DwdAC2io.js → MessageSelector-BzUQUeDn.js} +2 -2
  30. package/dist/chunks/{Messages-FEBcX-cT.js → Messages-KmeXIJqL.js} +2 -2
  31. package/dist/chunks/{Onboarding-B8qMJaBh.js → Onboarding-BZUXID6q.js} +1 -1
  32. package/dist/chunks/{OverageCreditUpsell-DnFv5z-z.js → OverageCreditUpsell-Dhm7HBuD.js} +1 -1
  33. package/dist/chunks/{PermissionDialog-_WQPRYHQ.js → PermissionDialog-BrRBxx5o.js} +1 -1
  34. package/dist/chunks/{PluginSettings-B_xVgTTp.js → PluginSettings-BZ-PX9Tg.js} +1 -1
  35. package/dist/chunks/{PressEnterToContinue-BJ58eCFC.js → PressEnterToContinue-DtA_p3X6.js} +1 -1
  36. package/dist/chunks/{PromptInputFooterSuggestions-DhIQ0Nge.js → PromptInputFooterSuggestions-Da8Fty6P.js} +1 -1
  37. package/dist/chunks/{PromptInputHelpMenu-CoMkWchC.js → PromptInputHelpMenu-Bz7EPzzq.js} +1 -1
  38. package/dist/chunks/{QueryEngine-C7r7O-hH.js → QueryEngine-CmJK27jU.js} +1 -1
  39. package/dist/chunks/REPL-BBmn_itf.js +1 -0
  40. package/dist/chunks/{REPL-CmJdJrGO.js → REPL-DxEJZpIp.js} +6 -6
  41. package/dist/chunks/{RemoteCallout-4JOZROfT.js → RemoteCallout-DONJj8l2.js} +1 -1
  42. package/dist/chunks/RemoteSessionManager-BvvNspY8.js +2 -0
  43. package/dist/chunks/{ResumeConversation-CZ2Uedkf.js → ResumeConversation-EpjJdFHu.js} +1 -1
  44. package/dist/chunks/{SSETransport-kEH_p4Yq.js → SSETransport-D51Jfdaj.js} +1 -1
  45. package/dist/chunks/SearchBox-CciJ8giD.js +1 -0
  46. package/dist/chunks/SearchExtraToolsTool-kjVFsFkT.js +1 -0
  47. package/dist/chunks/SentryErrorBoundary-DsrmgmKF.js +1 -0
  48. package/dist/chunks/{SentryErrorBoundary-97iY7Nb7.js → SentryErrorBoundary-nYTimi4l.js} +1 -1
  49. package/dist/chunks/{Settings-CuljH0mu.js → Settings-C2vEJjLx.js} +2 -2
  50. package/dist/chunks/{TeleportProgress-Ctdqi7iS.js → TeleportProgress--jgrqIfW.js} +1 -1
  51. package/dist/chunks/{TeleportRepoMismatchDialog-DyTBg1YD.js → TeleportRepoMismatchDialog-BKDaFT_L.js} +1 -1
  52. package/dist/chunks/{TeleportResumeWrapper-B66clYsG.js → TeleportResumeWrapper-CxlpiHIz.js} +1 -1
  53. package/dist/chunks/{ThemePicker-WKmYvrqz.js → ThemePicker-CYL4C-F-.js} +1 -1
  54. package/dist/chunks/{TmuxBackend-OKX2NP14.js → TmuxBackend-C_N4ww8i.js} +1 -1
  55. package/dist/chunks/{TrustDialog-0anSIf-G.js → TrustDialog-CYdftZ1M.js} +1 -1
  56. package/dist/chunks/{ValidationErrorsList-CfgC1KJb.js → ValidationErrorsList-CaTwOP3f.js} +1 -1
  57. package/dist/chunks/{WelcomeV2-BMHXiNt3.js → WelcomeV2-5rgKm4Mz.js} +1 -1
  58. package/dist/chunks/{WindowsTerminalBackend-fCSGVe4W.js → WindowsTerminalBackend-BzoSs0VA.js} +1 -1
  59. package/dist/chunks/{add-dir-CMtuW667.js → add-dir-RNzFR3XZ.js} +1 -1
  60. package/dist/chunks/{agentDisplay-CgYKW3G7.js → agentDisplay-DgeOQY1E.js} +1 -1
  61. package/dist/chunks/{agents-CdqcGm9o.js → agents-D7cgzb3f.js} +1 -1
  62. package/dist/chunks/{agents-D90TsYOf.js → agents-iMtFurok.js} +1 -1
  63. package/dist/chunks/{ant-DZjimiuz.js → ant-CF1iRpXD.js} +1 -1
  64. package/dist/chunks/{api-CQWbpxLP.js → api-DMbWqJlK.js} +1 -1
  65. package/dist/chunks/api-DkgaFAzq.js +1 -0
  66. package/dist/chunks/artifacts-D2kY_AMp.js +1 -0
  67. package/dist/chunks/{assistant-CyVcFPIR.js → assistant-CZ4VXgzH.js} +1 -1
  68. package/dist/chunks/assistant-CiNV3Q0f.js +1 -0
  69. package/dist/chunks/{assistant-CEmC_DlU.js → assistant-JAqAZqaE.js} +1 -1
  70. package/dist/chunks/{auth-DsQEVs9W.js → auth-BemPA3ot.js} +1 -1
  71. package/dist/chunks/auth-CbQCc9vz.js +1 -0
  72. package/dist/chunks/{autoMode-DEbM9UaE.js → autoMode-CGovMAzJ.js} +1 -1
  73. package/dist/chunks/{autonomy-Clap6Swl.js → autonomy-BVXyNEj0.js} +1 -1
  74. package/dist/chunks/{autonomy-lNpGnyiu.js → autonomy-BnAHLZWH.js} +1 -1
  75. package/dist/chunks/{autonomyPanel-BqEvfI0e.js → autonomyPanel-COMI2iR0.js} +1 -1
  76. package/dist/chunks/{backgroundHousekeeping-KvOpP_4M.js → backgroundHousekeeping-BRtG20l2.js} +2 -2
  77. package/dist/chunks/backgroundHousekeeping-LYpOamcN.js +1 -0
  78. package/dist/chunks/{banner-D9Cq292T.js → banner-D_rqe2XQ.js} +1 -1
  79. package/dist/chunks/{branch-CSYB04xC.js → branch-BnKwIQtC.js} +1 -1
  80. package/dist/chunks/{break-cache-DrIa8RdW.js → break-cache-CDzQDHwY.js} +1 -1
  81. package/dist/chunks/{bridge-DDgASypO.js → bridge-ChVjEHVq.js} +2 -2
  82. package/dist/chunks/bridgeConfig-Budgp2Go.js +1 -0
  83. package/dist/chunks/{bridgeConfig-DjC4oig1.js → bridgeConfig-e0MGfed6.js} +1 -1
  84. package/dist/chunks/{bridgeEnabled-Csn6Ym3k.js → bridgeEnabled-DR-v8AXw.js} +1 -1
  85. package/dist/chunks/bridgeEnabled-DmvmwuUY.js +1 -0
  86. package/dist/chunks/bridgeMain-KYR5iq6H.js +1 -0
  87. package/dist/chunks/{bridgeMain-B5wsmwkN.js → bridgeMain-OsR-_PRp.js} +6 -6
  88. package/dist/chunks/{bridgeMessaging-ChOzzVWj.js → bridgeMessaging-BvBnxgD4.js} +1 -1
  89. package/dist/chunks/{btw-BgjcOoeo.js → btw-_b16RGoh.js} +1 -1
  90. package/dist/chunks/{buddy-C1wE3noR.js → buddy-DJ3QSQyd.js} +1 -1
  91. package/dist/chunks/{bypassPermissionsKillswitch-C0diGLRB.js → bypassPermissionsKillswitch-OhGSWZrB.js} +1 -1
  92. package/dist/chunks/{caches-CIoVGP24.js → caches-Bp4F7tZ5.js} +2 -2
  93. package/dist/chunks/caches-CkH9F-Fd.js +1 -0
  94. package/dist/chunks/{ccrClient-C1msT1E3.js → ccrClient-D7pEGzQa.js} +1 -1
  95. package/dist/chunks/changeDetector-IFbty4jj.js +1 -0
  96. package/dist/chunks/{channelNotification-CWlu9ZWs.js → channelNotification-BZFMAWln.js} +1 -1
  97. package/dist/chunks/channelNotification-CIyWY0hs.js +1 -0
  98. package/dist/chunks/{chrome-Bo9uNZ7s.js → chrome-B5IxDA16.js} +1 -1
  99. package/dist/chunks/clear-BVjSQsUL.js +1 -0
  100. package/dist/chunks/client-BUUsZdSe.js +1 -0
  101. package/dist/chunks/{color-CkzktPHt.js → color-BYVWpzI8.js} +1 -1
  102. package/dist/chunks/commands-pTQdOvN6.js +1 -0
  103. package/dist/chunks/{commitAttribution-csu3NO7Y.js → commitAttribution-ClSlXMPG.js} +1 -1
  104. package/dist/chunks/commitAttribution-QPrKt_BF.js +1 -0
  105. package/dist/chunks/{compact-DNGIVZRN.js → compact-B9c12JXf.js} +1 -1
  106. package/dist/chunks/{companion-Diuav3lA.js → companion-C8e7dVlu.js} +1 -1
  107. package/dist/chunks/completionCache-BB7-y2BX.js +1 -0
  108. package/dist/chunks/{completionCache-C7hDqIDL.js → completionCache-Br6OwASx.js} +1 -1
  109. package/dist/chunks/{config-ODoYZY8i.js → config-Bxgfx_nO.js} +1 -1
  110. package/dist/chunks/{config-B25IrkTA.js → config-C-yz-f4W.js} +1 -1
  111. package/dist/chunks/{context-CZ5enuPE.js → context-Bf5t6C-a.js} +1 -1
  112. package/dist/chunks/{context-noninteractive-62P5EnN5.js → context-noninteractive-CJu7hZCM.js} +1 -1
  113. package/dist/chunks/context-noninteractive-OUTZ6BKj.js +1 -0
  114. package/dist/chunks/{conversation-DyhWeHw2.js → conversation-BYMS5Hqa.js} +1 -1
  115. package/dist/chunks/conversation-Bs8l0KNl.js +1 -0
  116. package/dist/chunks/{copy-9JLr2-Xs.js → copy-C0BZ7Gm0.js} +1 -1
  117. package/dist/chunks/{createSSHSession-B1hTuDpB.js → createSSHSession-DNXCWneI.js} +1 -1
  118. package/dist/chunks/{createSession-fzjzy0aS.js → createSession-DjM6Ev45.js} +1 -1
  119. package/dist/chunks/createSession-DpqtD4ML.js +1 -0
  120. package/dist/chunks/{cronJitterConfig-9OmmYmIT.js → cronJitterConfig-CaFkPXKB.js} +1 -1
  121. package/dist/chunks/{crossProjectResume-B6efoIur.js → crossProjectResume-BCr6jfGz.js} +1 -1
  122. package/dist/chunks/{daemon-BRKR4D1D.js → daemon-Bu0Uy-qG.js} +1 -1
  123. package/dist/chunks/{datadog-SSxsxcC-.js → datadog-ClZjR-jM.js} +1 -1
  124. package/dist/chunks/datadog-DlzPb5oG.js +1 -0
  125. package/dist/chunks/desktop-WH8s-9-6.js +1 -0
  126. package/dist/chunks/{diff-uAwKYa51.js → diff-D9hjPq4W.js} +1 -1
  127. package/dist/chunks/{doctor-CBF0fkBF.js → doctor-4-im_J_h.js} +1 -1
  128. package/dist/chunks/earlyInput-DEZaWwKF.js +1 -0
  129. package/dist/chunks/{effort-F-bhAM2u.js → effort-Bz-9GIpe.js} +1 -1
  130. package/dist/chunks/entry-CEBaLwEG.js +14 -0
  131. package/dist/chunks/{envLessBridgeConfig-Dg0hNsdi.js → envLessBridgeConfig-DW4-nPbZ.js} +1 -1
  132. package/dist/chunks/envLessBridgeConfig-izoVnE8s.js +1 -0
  133. package/dist/chunks/{exit-CqcvZJwI.js → exit-DBNDTR4b.js} +1 -1
  134. package/dist/chunks/{export-c6WoGlsG.js → export-CQHUM_Nv.js} +1 -1
  135. package/dist/chunks/{exportRenderer-CaegIP5N.js → exportRenderer-CuIDQBLH.js} +1 -1
  136. package/dist/chunks/{extra-usage-Cj8fokgc.js → extra-usage-DTr6gExD.js} +1 -1
  137. package/dist/chunks/extra-usage-VSASGlte.js +1 -0
  138. package/dist/chunks/{extra-usage-core-sHzc4eE1.js → extra-usage-core-D3CwYO_8.js} +1 -1
  139. package/dist/chunks/{extra-usage-noninteractive-D0kqrqsg.js → extra-usage-noninteractive-d-QVg1D5.js} +1 -1
  140. package/dist/chunks/{extraUsage-CbkqfG1U.js → extraUsage-BNRQOkgU.js} +1 -1
  141. package/dist/chunks/extractMemories-hQlhiVOD.js +1 -0
  142. package/dist/chunks/fast-2gWrhEFZ.js +1 -0
  143. package/dist/chunks/{fast-DS3iQ1CH.js → fast-bkGXbuHX.js} +1 -1
  144. package/dist/chunks/{feedback-QJynmG5q.js → feedback-BvFgE_FF.js} +1 -1
  145. package/dist/chunks/{firstPartyEventLogger-DlW8BUXq.js → firstPartyEventLogger-D-ifHvWu.js} +1 -1
  146. package/dist/chunks/{flushGate-CK5B9-Zn.js → flushGate-BA24vFBg.js} +1 -1
  147. package/dist/chunks/{fpsMetrics-DKWp7vng.js → fpsMetrics-CBFlAGTS.js} +1 -1
  148. package/dist/chunks/{gates-vlrMjO-X.js → gates-C66Nz9b2.js} +1 -1
  149. package/dist/chunks/gates-dO6m4Hdp.js +1 -0
  150. package/dist/chunks/{gemini-B5ZRjDrh.js → gemini-DuQl4hTA.js} +1 -1
  151. package/dist/chunks/{generateRecap-SgRMdsyN.js → generateRecap-CwBU76xi.js} +1 -1
  152. package/dist/chunks/{generateSessionName-sZFzpwsq.js → generateSessionName-LnmjE9jh.js} +1 -1
  153. package/dist/chunks/{githubRepoPathMapping-DUGvTwPB.js → githubRepoPathMapping-DrreQj47.js} +1 -1
  154. package/dist/chunks/{goal-Dy-GGn9r.js → goal-BIvjF6B7.js} +1 -1
  155. package/dist/chunks/{grok-BG4_buNt.js → grok-KNLYSRBQ.js} +1 -1
  156. package/dist/chunks/{growthbook-Br1dDRtd.js → growthbook-ksjGAskq.js} +1 -1
  157. package/dist/chunks/{heapdump-B9PVKMxa.js → heapdump-Cz8vkcOr.js} +1 -1
  158. package/dist/chunks/{help-BfWF7xij.js → help-Cx9OordP.js} +1 -1
  159. package/dist/chunks/{hooks-KK32pxq3.js → hooks-BW-d9Bdu.js} +1 -1
  160. package/dist/chunks/hooks-BWoN0nQP.js +1 -0
  161. package/dist/chunks/{hostAdapter-TBJav3vX.js → hostAdapter-DLmaB6eN.js} +1 -1
  162. package/dist/chunks/{ide-BU1A79BE.js → ide-CECrIg1r.js} +1 -1
  163. package/dist/chunks/{inboundAttachments-D4tBPCB8.js → inboundAttachments-B0sGIu79.js} +1 -1
  164. package/dist/chunks/inboundAttachments-D8vq1NQO.js +1 -0
  165. package/dist/chunks/{initReplBridge-99sUBVEk.js → initReplBridge-BAEMZEcg.js} +1 -1
  166. package/dist/chunks/{insights-lDHodCMG.js → insights-DeWggLxC.js} +1 -1
  167. package/dist/chunks/{install-github-app-RLbUq5EL.js → install-github-app-DqKEiHQ1.js} +1 -1
  168. package/dist/chunks/{install-Bg4ZgW81.js → install-pxH_HR1p.js} +1 -1
  169. package/dist/chunks/{install-slack-app-CHmIwsbm.js → install-slack-app-P1L9x-YI.js} +1 -1
  170. package/dist/chunks/{instrumentation-BCiV3SKX.js → instrumentation-Dx0s2jzr.js} +3 -3
  171. package/dist/chunks/{job-xOGf0j5Q.js → job-CbxxkPgE.js} +1 -1
  172. package/dist/chunks/{keybindings-DMbReZ4p.js → keybindings-BBPC7FAc.js} +1 -1
  173. package/dist/chunks/{lang-A6LUGP_7.js → lang-CKp0Tn76.js} +1 -1
  174. package/dist/chunks/language-CSDpzbTz.js +1 -0
  175. package/dist/chunks/{language-CGfURU2y.js → language-iERMuOEu.js} +1 -1
  176. package/dist/chunks/{launchAgentsPlatform-Dbpm7Jyo.js → launchAgentsPlatform-DQvKVtl2.js} +1 -1
  177. package/dist/chunks/{launchAutofixPr-RZfqx5eM.js → launchAutofixPr-B7hu9C8h.js} +1 -1
  178. package/dist/chunks/{launchCommand-9eYsPG7W.js → launchCommand-CJsikSlW.js} +1 -1
  179. package/dist/chunks/{launchLocalMemory-DIntbsvg.js → launchLocalMemory-Cpz7L5j5.js} +1 -1
  180. package/dist/chunks/{launchLocalVault-CCUw0ayu.js → launchLocalVault-XLfOQtP7.js} +1 -1
  181. package/dist/chunks/{launchMemoryStores-QJTh8KSP.js → launchMemoryStores-Cz04PaDE.js} +1 -1
  182. package/dist/chunks/{launchOnboarding--Pe30AYd.js → launchOnboarding-XPbUNdHS.js} +1 -1
  183. package/dist/chunks/{launchSchedule-DjN1RbRX.js → launchSchedule-B1VEe3o-.js} +1 -1
  184. package/dist/chunks/{launchSkillStore-CcKmVDz1.js → launchSkillStore-Cy59z5xx.js} +1 -1
  185. package/dist/chunks/{launchTeleport-BKlEo0yF.js → launchTeleport-ZPM_DvzK.js} +1 -1
  186. package/dist/chunks/{launchVault-C7UHA-IG.js → launchVault-BhnTOZq8.js} +1 -1
  187. package/dist/chunks/loadAgentsDir-B-4D2dVE.js +1 -0
  188. package/dist/chunks/{loadAgentsDir-ClTeo0nk.js → loadAgentsDir-CQF8qhne.js} +751 -751
  189. package/dist/chunks/{loadPluginHooks-DVZmzYLl.js → loadPluginHooks-TyULD8KH.js} +1 -1
  190. package/dist/chunks/{localSearch-Koc8naSr.js → localSearch-BNYypHsK.js} +1 -1
  191. package/dist/chunks/localSearch-DsFH9yls.js +1 -0
  192. package/dist/chunks/login-CEJEl2mW.js +1 -0
  193. package/dist/chunks/{login-C3MZQTDL.js → login-CxbcJk9_.js} +1 -1
  194. package/dist/chunks/{logoV2Utils-DAIIwt5R.js → logoV2Utils-Br_w1z39.js} +1 -1
  195. package/dist/chunks/logout-BXr4jzNY.js +1 -0
  196. package/dist/chunks/{magicDocs-C_inI3JJ.js → magicDocs-DnxdS9yV.js} +1 -1
  197. package/dist/chunks/{main-qqcmncHA.js → main-FBmdv32j.js} +139 -60
  198. package/dist/chunks/{mappers-7BSMbYvH.js → mappers-BNI_df3v.js} +1 -1
  199. package/dist/chunks/{mcp-DV8Prhgi.js → mcp-BhAGhDQE.js} +1 -1
  200. package/dist/chunks/{mcp-DRBiobrN.js → mcp-DbqUZ1Cf.js} +1 -1
  201. package/dist/chunks/{mcp-HQ8-nEZ1.js → mcp-esqdO_lV.js} +3 -3
  202. package/dist/chunks/{mcpServer-DS0yRfcu.js → mcpServer-Ct-GVL-y.js} +1 -1
  203. package/dist/chunks/{mcpServer-CLIYAgGs.js → mcpServer-DeL2ADSF.js} +1 -1
  204. package/dist/chunks/{memory-Cz_JaFLF.js → memory-DwapBEsD.js} +1 -1
  205. package/dist/chunks/{mobile-BMglW1NB.js → mobile-D7MSmMhc.js} +1 -1
  206. package/dist/chunks/{modalContext-c5Yqx_CQ.js → modalContext-DxfeT_3m.js} +1 -1
  207. package/dist/chunks/{mode-Kx0kSZkr.js → mode-B5cmHCvz.js} +1 -1
  208. package/dist/chunks/{model-CNXtfiLg.js → model-BePO0VaC.js} +1 -1
  209. package/dist/chunks/model-CgH43-hO.js +1 -0
  210. package/dist/chunks/{onChangeAppState-C4ic-Mib.js → onChangeAppState-B3d5iy6T.js} +1 -1
  211. package/dist/chunks/{openai-CGGSfpPh.js → openai-fRhGOIQq.js} +1 -1
  212. package/dist/chunks/{overageCreditGrant-BqW_6R5v.js → overageCreditGrant-B6sx7IFi.js} +1 -1
  213. package/dist/chunks/{panel-D3wvAEFE.js → panel-CAVG5BOM.js} +1 -1
  214. package/dist/chunks/{panel-BYfvo_mR.js → panel-DU8y_jcf.js} +1 -1
  215. package/dist/chunks/{panelCall-DgPjuhQf.js → panelCall-DUQdjDee.js} +1 -1
  216. package/dist/chunks/{passes-sYE91Vtr.js → passes-CWPPUigp.js} +1 -1
  217. package/dist/chunks/{paths-DO4WOQtD.js → paths-4ZWdjPP4.js} +3 -3
  218. package/dist/chunks/{permissions-BPerbf1I.js → permissions-DW8CRuJp.js} +1 -1
  219. package/dist/chunks/{pipeTransport-CW9zF_UN.js → pipeTransport-CUeYRWJn.js} +1 -1
  220. package/dist/chunks/{plan-CDKBVRw6.js → plan-Cf-tHvGq.js} +1 -1
  221. package/dist/chunks/plugin-DXhCgoNC.js +1 -0
  222. package/dist/chunks/{pluginAutoupdate-BQKtcAhC.js → pluginAutoupdate-CdmKzIRf.js} +1 -1
  223. package/dist/chunks/{pluginBlocklist-B8DKXi0i.js → pluginBlocklist-C9XwbFSo.js} +1 -1
  224. package/dist/chunks/{pluginCliCommands-DWCeXYTl.js → pluginCliCommands-CmY_maYg.js} +1 -1
  225. package/dist/chunks/{pluginFlagging-DFMlWw2P.js → pluginFlagging-DyzxZolj.js} +1 -1
  226. package/dist/chunks/{pluginOperations-CKmwDC3G.js → pluginOperations-mr4I7Jw9.js} +1 -1
  227. package/dist/chunks/{pluginStartupCheck-D6IbyWKe.js → pluginStartupCheck-B6OdK29Z.js} +1 -1
  228. package/dist/chunks/pluginStartupCheck-BFuZqpnX.js +1 -0
  229. package/dist/chunks/{plugins-BwZIRMh_.js → plugins-rdPgpjF8.js} +1 -1
  230. package/dist/chunks/policyLimits-B3dtp_Fe.js +1 -0
  231. package/dist/chunks/{pollConfig-C3NjXYFc.js → pollConfig-DLbuHBse.js} +1 -1
  232. package/dist/chunks/{poor-BHhbua95.js → poor-pmz2b7zu.js} +1 -1
  233. package/dist/chunks/poorMode-BPIUnFFi.js +1 -0
  234. package/dist/chunks/{poorMode-mtlnXU-z.js → poorMode-DD-q_w6Z.js} +1 -1
  235. package/dist/chunks/{print-kxnXkqGc.js → print-luaON-Cg.js} +4 -4
  236. package/dist/chunks/{privacy-settings-DjY1annR.js → privacy-settings-BpigC4oX.js} +1 -1
  237. package/dist/chunks/{processBashCommand-BrqLqSva.js → processBashCommand-f_84bSlP.js} +1 -1
  238. package/dist/chunks/{processSlashCommand-DJGdVGbK.js → processSlashCommand-BkBqV3Jd.js} +1 -1
  239. package/dist/chunks/{projectContext-Cd7V9pES.js → projectContext-fS1t-xRh.js} +1 -1
  240. package/dist/chunks/{prompt-CfM_xGPc.js → prompt-CogZQuTN.js} +1 -1
  241. package/dist/chunks/prompt-CriAIdkT.js +1 -0
  242. package/dist/chunks/prompt-TGc_H1cL.js +1 -0
  243. package/dist/chunks/{promptEditor-FI_ewCpV.js → promptEditor-C___2FFs.js} +1 -1
  244. package/dist/chunks/{protocolHandler-B7ybKpgJ.js → protocolHandler-qwll5gSY.js} +1 -1
  245. package/dist/chunks/{rate-limit-options-DPJMNNou.js → rate-limit-options-nQcTipEp.js} +1 -1
  246. package/dist/chunks/{rcDebugLog-CwU_wJBE.js → rcDebugLog-DOXxIr8l.js} +1 -1
  247. package/dist/chunks/{referral-Da4mpbd3.js → referral-CMPZjf3I.js} +1 -1
  248. package/dist/chunks/{refresh-B6X4xb9r.js → refresh-CP7Dnjp4.js} +1 -1
  249. package/dist/chunks/{registerProtocol-D8fFnceq.js → registerProtocol-DCNuqdCC.js} +1 -1
  250. package/dist/chunks/{registry-y_z3pTg3.js → registry-DLqZJleQ.js} +1 -1
  251. package/dist/chunks/{release-notes--tnd4K56.js → release-notes-BsDW6T9f.js} +1 -1
  252. package/dist/chunks/{releaseNotes-BPA229-J.js → releaseNotes-Tbd018Qz.js} +2 -2
  253. package/dist/chunks/{reload-plugins-yQ7tEUVh.js → reload-plugins-iG9ZE9wF.js} +1 -1
  254. package/dist/chunks/{remote-env-CER5UxTX.js → remote-env-BFntnltf.js} +1 -1
  255. package/dist/chunks/{remoteBridgeCore-Bi31i8gt.js → remoteBridgeCore-Dpko9c-J.js} +1 -1
  256. package/dist/chunks/{remoteControlServer-oUAcWB4i.js → remoteControlServer-D3P82kVF.js} +1 -1
  257. package/dist/chunks/{rename-BTngRRZU.js → rename-Codm2nfB.js} +1 -1
  258. package/dist/chunks/{resume-DZHKfBmm.js → resume-BB1ceL_x.js} +1 -1
  259. package/dist/chunks/{runtimeObserver-B4KekIF0.js → runtimeObserver-BpRn0RiL.js} +1 -1
  260. package/dist/chunks/{runtimeObserver-BUOcYxiK.js → runtimeObserver-D6aF77Dq.js} +2 -2
  261. package/dist/chunks/sandbox-adapter-DrHD1mch.js +1 -0
  262. package/dist/chunks/{sandbox-toggle-DLBL7myN.js → sandbox-toggle-DZ-8qXDS.js} +1 -1
  263. package/dist/chunks/searchExtraTools-Dwg6ZafS.js +1 -0
  264. package/dist/chunks/{sentry-B7ZBc8fA.js → sentry-CVdHlmNQ.js} +1 -1
  265. package/dist/chunks/{session-DWYQk9YN.js → session-B4j1ViVc.js} +1 -1
  266. package/dist/chunks/{sessionDiscovery-BP0nv36F.js → sessionDiscovery-DkIIFsWX.js} +1 -1
  267. package/dist/chunks/sessionFileAccessHooks-n7HcOfZ7.js +1 -0
  268. package/dist/chunks/{sessionMemory-pT4lc1C-.js → sessionMemory-CnT3-Mj7.js} +1 -1
  269. package/dist/chunks/sessionMemory-DVq43VXP.js +1 -0
  270. package/dist/chunks/sessionMemoryUtils-BjkdLRvh.js +1 -0
  271. package/dist/chunks/sessionObserver-CrfmnMzL.js +1 -0
  272. package/dist/chunks/{sessionObserver-D4SV0Ar3.js → sessionObserver-gjdJ91cv.js} +1 -1
  273. package/dist/chunks/sessionStorage-BTbr9wkZ.js +1 -0
  274. package/dist/chunks/{sessionTitle-CkrnWEW1.js → sessionTitle-CSU5-VK9.js} +1 -1
  275. package/dist/chunks/{sessionTracing-Caw-kvQr.js → sessionTracing-BDN64fWh.js} +1 -1
  276. package/dist/chunks/{settingsSync-Dn_lGonC.js → settingsSync-Nixbcaox.js} +1 -1
  277. package/dist/chunks/{setup-Dihjl7jo.js → setup-9nXlu56r.js} +1 -1
  278. package/dist/chunks/{setup-II1titXI.js → setup-CZxLEcQh.js} +1 -1
  279. package/dist/chunks/{setup-DGkOT4DX.js → setup-n3Ixr_gs.js} +3 -2
  280. package/dist/chunks/{shadowedRuleDetection-DASW3j9H.js → shadowedRuleDetection-CCS7R7F1.js} +1 -1
  281. package/dist/chunks/{sideQuestion-C1qbLTAL.js → sideQuestion-MzExGTvn.js} +1 -1
  282. package/dist/chunks/{sink-CqOAfFlL.js → sink-BL75jACh.js} +1 -1
  283. package/dist/chunks/sink-CoUVbLFs.js +1 -0
  284. package/dist/chunks/{sinks-BT_lBY6T.js → sinks-C-gxj_Eu.js} +2 -2
  285. package/dist/chunks/sinks-wuo1yQ_m.js +1 -0
  286. package/dist/chunks/{skill-learning-kh0HKn6u.js → skill-learning-B9Msm4jG.js} +1 -1
  287. package/dist/chunks/{skillChangeDetector-DQuNepIV.js → skillChangeDetector-DlWPJTny.js} +1 -1
  288. package/dist/chunks/{skillGapStore-CFmLJlYm.js → skillGapStore-Cpmbwyo3.js} +1 -1
  289. package/dist/chunks/{skillGapStore-B1gUQXhE.js → skillGapStore-CsADiV5a.js} +2 -2
  290. package/dist/chunks/{skillGenerator-DIAwRpPg.js → skillGenerator-_khb-Gmc.js} +2 -2
  291. package/dist/chunks/skillLearning-CFnZiM5J.js +1 -0
  292. package/dist/chunks/skillLearning-D6mvGN90.js +1 -0
  293. package/dist/chunks/{skillPanel-B9zJLHKV.js → skillPanel-DQmj3Yh1.js} +3 -3
  294. package/dist/chunks/{skillSearchPanel-C1O9sxYS.js → skillSearchPanel-6w_zzoI3.js} +2 -2
  295. package/dist/chunks/{skills-C6_3snFY.js → skills-B3LN9tp9.js} +1 -1
  296. package/dist/chunks/{sprites-59l7vF4l.js → sprites-8JVWnXzp.js} +1 -1
  297. package/dist/chunks/{src-poaoYkuc.js → src-BJM0zMNO.js} +1 -1
  298. package/dist/chunks/{src-Di342QoJ.js → src-KjMLauwe.js} +1 -1
  299. package/dist/chunks/startupProfiler-BmnoJtfF.js +1 -0
  300. package/dist/chunks/{startupProfiler-CAntGAbs.js → startupProfiler-rCtNuhXz.js} +1 -1
  301. package/dist/chunks/{staticRender-C5v46np_.js → staticRender-DboURbK0.js} +1 -1
  302. package/dist/chunks/{stats-BmGdg4nj.js → stats-BDlygx5X.js} +1 -1
  303. package/dist/chunks/status-DlT1tUmc.js +1 -0
  304. package/dist/chunks/{statusNoticeHelpers-DuqyBY-N.js → statusNoticeHelpers-Cd_LDPvn.js} +1 -1
  305. package/dist/chunks/{tag-0vahEnrx.js → tag-BLPgXlQZ.js} +1 -1
  306. package/dist/chunks/tasks-Bf1Nf3WX.js +1 -0
  307. package/dist/chunks/{teamHelpers-CXAmvFco.js → teamHelpers-B-poMJeE.js} +1 -1
  308. package/dist/chunks/teamHelpers-DeQCfdgu.js +1 -0
  309. package/dist/chunks/{teammateModeSnapshot-CdiglTzv.js → teammateModeSnapshot-B1_3D1CQ.js} +1 -1
  310. package/dist/chunks/teammateModeSnapshot-BRuKcJNr.js +1 -0
  311. package/dist/chunks/{teleport-D6PvdjPy.js → teleport-CSo3PT05.js} +1 -1
  312. package/dist/chunks/{templateJobs-Ox5ZTKjW.js → templateJobs-BVebX2BK.js} +1 -1
  313. package/dist/chunks/{terminalSetup-hLCi-2uB.js → terminalSetup-DHWL0gnz.js} +1 -1
  314. package/dist/chunks/{terminalSetup-Dh70ynBX.js → terminalSetup-DZTEKKne.js} +1 -1
  315. package/dist/chunks/{theme-DxgUVq9C.js → theme-BHQSNwSe.js} +1 -1
  316. package/dist/chunks/thinkback-CVYpxAyO.js +1 -0
  317. package/dist/chunks/{thinkback-DWgU7Qhr.js → thinkback-DOzxcgMy.js} +1 -1
  318. package/dist/chunks/{thinkback-play-CDzY6Ux4.js → thinkback-play-CK1C_F7G.js} +1 -1
  319. package/dist/chunks/{toolEventObserver-jO6-mlFU.js → toolEventObserver-BIjUIh4k.js} +1 -1
  320. package/dist/chunks/{toolEventObserver-DPoMAJwr.js → toolEventObserver-XPorjjtG.js} +1 -1
  321. package/dist/chunks/toolPool-CDEeuQd2.js +1 -0
  322. package/dist/chunks/{toolPool-Dgn1Clq8.js → toolPool-hQlvQn-j.js} +1 -1
  323. package/dist/chunks/{trustedDevice-CYR5AgSB.js → trustedDevice-CyfQd_GU.js} +1 -1
  324. package/dist/chunks/{trustedDevice-D35gYkBT.js → trustedDevice-D-L5uAor.js} +1 -1
  325. package/dist/chunks/{tui-DoOiz2RW.js → tui-C7aBeORE.js} +1 -1
  326. package/dist/chunks/{ultrareviewCommand-o4GjzoXK.js → ultrareviewCommand-rnMsUWTn.js} +1 -1
  327. package/dist/chunks/undercover-BviGW-bQ.js +1 -0
  328. package/dist/chunks/{undercover-B4xr62Ux.js → undercover-ClLYK52H.js} +1 -1
  329. package/dist/chunks/{updateCCB-Cthn50OV.js → updateCCB-pqkACWbs.js} +1 -1
  330. package/dist/chunks/upgrade-DAuhXFVI.js +1 -0
  331. package/dist/chunks/{upgrade-D4Id4ebd.js → upgrade-DpfZlPyC.js} +1 -1
  332. package/dist/chunks/{upload-BFDXvdfb.js → upload-D98tqZnO.js} +1 -1
  333. package/dist/chunks/{usage-Csbso5mD.js → usage-BWd5R6DU.js} +1 -1
  334. package/dist/chunks/{usage-DxudeFLL.js → usage-CRquq5_O.js} +1 -1
  335. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-BHi41Ku_.js → useExitOnCtrlCDWithKeybindings-Dkcp6EkA.js} +1 -1
  336. package/dist/chunks/useKeybinding-DOjEx42R.js +1 -0
  337. package/dist/chunks/useMainLoopModel-BZoZdEdj.js +1 -0
  338. package/dist/chunks/{useManagePlugins-BmS3Adja.js → useManagePlugins-DMY74XAk.js} +1 -1
  339. package/dist/chunks/{useMergedTools-wR6Bglqq.js → useMergedTools-NN58Kguw.js} +1 -1
  340. package/dist/chunks/{useSearchInput-BhKAGgEN.js → useSearchInput-CodP_5SB.js} +1 -1
  341. package/dist/chunks/{useSettingsErrors-CjK3P-Ki.js → useSettingsErrors-BRxaYl6B.js} +1 -1
  342. package/dist/chunks/useTerminalSize-mqo2Swmk.js +1 -0
  343. package/dist/chunks/{useVoice-DP1hHBWA.js → useVoice-ByU-q_w4.js} +1 -1
  344. package/dist/chunks/{util-CMSErQoz.js → util-SpgBY5_I.js} +1 -1
  345. package/dist/chunks/utils-CM5oEyAY.js +1 -0
  346. package/dist/chunks/{validatePlugin-_g0AqWZG.js → validatePlugin-CxCXNV8o.js} +1 -1
  347. package/dist/chunks/{vim-8y-2Q09k.js → vim-ByXlYzf9.js} +1 -1
  348. package/dist/chunks/{voice-BJAsr0K-.js → voice-BnLS_SdQ.js} +1 -1
  349. package/dist/chunks/voiceModeEnabled-B3njLfhA.js +1 -0
  350. package/dist/chunks/{voiceModeEnabled-BD9GZhQ3.js → voiceModeEnabled-D070o6QK.js} +1 -1
  351. package/dist/chunks/voiceStreamSTT-BkeyhhFJ.js +1 -0
  352. package/dist/chunks/{voiceStreamSTT-B1T-8adN.js → voiceStreamSTT-vkQ-Aop7.js} +1 -1
  353. package/dist/chunks/{web-tools-DVIvcP41.js → web-tools-1yM0ZBfA.js} +1 -1
  354. package/dist/chunks/{workerRegistry-60_UCyc3.js → workerRegistry-7xGv_sNB.js} +1 -1
  355. package/dist/chunks/worktree-UA9gKCwL.js +1 -0
  356. package/dist/chunks/{xml-CTdKuU6f.js → xml-BUaEXGXx.js} +1 -1
  357. package/dist/cli.js +1 -1
  358. package/package.json +1 -1
  359. package/dist/chunks/ApproveApiKey-B7_TCGwt.js +0 -1
  360. package/dist/chunks/ClaudeMdExternalIncludesDialog-DxJK9NiM.js +0 -1
  361. package/dist/chunks/ConsoleOAuthFlow-LPZ97jsm.js +0 -1
  362. package/dist/chunks/Dialog-91X6ZGg9.js +0 -1
  363. package/dist/chunks/Doctor-hgf3dMAW.js +0 -1
  364. package/dist/chunks/Grove-Bwmghb-e.js +0 -1
  365. package/dist/chunks/ListItem-DCQhApdJ.js +0 -1
  366. package/dist/chunks/REPL-nP7H_-qa.js +0 -1
  367. package/dist/chunks/RemoteSessionManager-jcPnywfY.js +0 -2
  368. package/dist/chunks/SearchBox-CkO4rQ-9.js +0 -1
  369. package/dist/chunks/SearchExtraToolsTool-C64oVFUD.js +0 -1
  370. package/dist/chunks/SentryErrorBoundary-2E2qGV11.js +0 -1
  371. package/dist/chunks/api-quOYYOhi.js +0 -1
  372. package/dist/chunks/assistant-B5_xx00q.js +0 -1
  373. package/dist/chunks/auth-CjtaiRtF.js +0 -1
  374. package/dist/chunks/backgroundHousekeeping-D-jt-ocx.js +0 -1
  375. package/dist/chunks/bridgeConfig-BdZVEqhx.js +0 -1
  376. package/dist/chunks/bridgeEnabled-DLRIH243.js +0 -1
  377. package/dist/chunks/bridgeMain-BN0Sag35.js +0 -1
  378. package/dist/chunks/caches-DMYdTEAr.js +0 -1
  379. package/dist/chunks/changeDetector-DoOBZOt1.js +0 -1
  380. package/dist/chunks/channelNotification-oZ6vG5R5.js +0 -1
  381. package/dist/chunks/clear-BxdX_MUP.js +0 -1
  382. package/dist/chunks/client-BSoJ_vaA.js +0 -1
  383. package/dist/chunks/commands-hyVX9-Lh.js +0 -1
  384. package/dist/chunks/commitAttribution-BwT0TbYF.js +0 -1
  385. package/dist/chunks/completionCache-BQgiR45Q.js +0 -1
  386. package/dist/chunks/context-noninteractive-CjuzL9q5.js +0 -1
  387. package/dist/chunks/conversation-uY-V0SNK.js +0 -1
  388. package/dist/chunks/createSession-Qurw-N4x.js +0 -1
  389. package/dist/chunks/datadog-C-llbwzP.js +0 -1
  390. package/dist/chunks/desktop-CQnMcbex.js +0 -1
  391. package/dist/chunks/earlyInput-D3OhUZ4G.js +0 -1
  392. package/dist/chunks/entry-DHN_Gr1b.js +0 -14
  393. package/dist/chunks/envLessBridgeConfig-CDVtIEWT.js +0 -1
  394. package/dist/chunks/extra-usage-Dk-wcvAu.js +0 -1
  395. package/dist/chunks/extractMemories-BP8Opsbp.js +0 -1
  396. package/dist/chunks/fast-DklfqySb.js +0 -1
  397. package/dist/chunks/gates-6amRNsYl.js +0 -1
  398. package/dist/chunks/hooks-BVrhxysz.js +0 -1
  399. package/dist/chunks/inboundAttachments-DWJplT9p.js +0 -1
  400. package/dist/chunks/language-Bzp5KDCE.js +0 -1
  401. package/dist/chunks/loadAgentsDir-CshktEpX.js +0 -1
  402. package/dist/chunks/localSearch-BtLNJRij.js +0 -1
  403. package/dist/chunks/login-BngE89_j.js +0 -1
  404. package/dist/chunks/logout-CXZBaUen.js +0 -1
  405. package/dist/chunks/model-Bwvn_acH.js +0 -1
  406. package/dist/chunks/plugin-C6US4b8W.js +0 -1
  407. package/dist/chunks/pluginStartupCheck-cYnLsWOs.js +0 -1
  408. package/dist/chunks/policyLimits-CFLBtFh3.js +0 -1
  409. package/dist/chunks/poorMode-CCK7Ek5w.js +0 -1
  410. package/dist/chunks/prompt-BZjXpviP.js +0 -1
  411. package/dist/chunks/prompt-CusKF4-p.js +0 -1
  412. package/dist/chunks/sandbox-adapter-C--j-c76.js +0 -1
  413. package/dist/chunks/searchExtraTools-CBYp5XeI.js +0 -1
  414. package/dist/chunks/sessionFileAccessHooks-DVilA3Mm.js +0 -1
  415. package/dist/chunks/sessionMemory-cMgcTxtP.js +0 -1
  416. package/dist/chunks/sessionMemoryUtils-BgYf2OvX.js +0 -1
  417. package/dist/chunks/sessionObserver-CzyEF7mg.js +0 -1
  418. package/dist/chunks/sessionStorage-CXBgVAx-.js +0 -1
  419. package/dist/chunks/sink-BSPyC453.js +0 -1
  420. package/dist/chunks/sinks-CpuRIC3H.js +0 -1
  421. package/dist/chunks/skillLearning-Bxu1Uzl-.js +0 -1
  422. package/dist/chunks/skillLearning-CxAbHYEk.js +0 -1
  423. package/dist/chunks/startupProfiler-WtUzkMKV.js +0 -1
  424. package/dist/chunks/status-KLPT7uYP.js +0 -1
  425. package/dist/chunks/tasks-zVPemGv7.js +0 -1
  426. package/dist/chunks/teamHelpers-B83RwCCC.js +0 -1
  427. package/dist/chunks/teammateModeSnapshot-AdUFmPGC.js +0 -1
  428. package/dist/chunks/thinkback-C5vFU8dM.js +0 -1
  429. package/dist/chunks/toolPool-BmA-BnAq.js +0 -1
  430. package/dist/chunks/undercover-nakrQDLh.js +0 -1
  431. package/dist/chunks/upgrade-DJTCV8sr.js +0 -1
  432. package/dist/chunks/useKeybinding-DPOUuymz.js +0 -1
  433. package/dist/chunks/useMainLoopModel-CEqP4HOc.js +0 -1
  434. package/dist/chunks/useTerminalSize-Du-EamDN.js +0 -1
  435. package/dist/chunks/utils-CAQfwbv8.js +0 -1
  436. package/dist/chunks/voiceModeEnabled-DZbxaFIg.js +0 -1
  437. package/dist/chunks/voiceStreamSTT-B39XaGOU.js +0 -1
  438. package/dist/chunks/worktree-DNK8NprA.js +0 -1
  439. /package/dist/chunks/{InProcessTransport-B9II3BiO.js → InProcessTransport-DW2ed2Hs.js} +0 -0
  440. /package/dist/chunks/{attributionHooks-VGSpz4mk.js → attributionHooks-COqmxGy1.js} +0 -0
  441. /package/dist/chunks/{attributionTrailer-C8uqiLIb.js → attributionTrailer-Nx8I_ZRK.js} +0 -0
  442. /package/dist/chunks/{autoModeDenials-DlO5g6E9.js → autoModeDenials-BDpcFLb7.js} +0 -0
  443. /package/dist/chunks/{bedrockClient-BUmO2U-X.js → bedrockClient-BfPpXPI0.js} +0 -0
  444. /package/dist/chunks/{ccshareResume-DKwcd0Vc.js → ccshareResume-DPP1blaU.js} +0 -0
  445. /package/dist/chunks/{chromeNativeHost-BldB1Zzi.js → chromeNativeHost-DfYuJafI.js} +0 -0
  446. /package/dist/chunks/{claudeDesktop-BqTW_pbB.js → claudeDesktop-CEQCLZmG.js} +0 -0
  447. /package/dist/chunks/{cleanup-rCLlo4w8.js → cleanup-DUVwlFl7.js} +0 -0
  448. /package/dist/chunks/{connectHeadless-ByewVfOb.js → connectHeadless-DutPm1RT.js} +0 -0
  449. /package/dist/chunks/{dangerousBackend-Dkjtndh1.js → dangerousBackend-BDKHrF6i.js} +0 -0
  450. /package/dist/chunks/{earlyInput-CFYRGxau.js → earlyInput-B3U01GAm.js} +0 -0
  451. /package/dist/chunks/{eventLoopStallDetector-bYy0fesH.js → eventLoopStallDetector-MNrFR4OH.js} +0 -0
  452. /package/dist/chunks/{files-Bdr_PQyV.js → files-BGuNpYgH.js} +0 -0
  453. /package/dist/chunks/{fuse-D3B-UE5Y.js → fuse-D7icKomM.js} +0 -0
  454. /package/dist/chunks/{instinctParser-DOtj1Kni.js → instinctParser-BMtAMLSx.js} +0 -0
  455. /package/dist/chunks/{lockfile-C3JsqLpb.js → lockfile-DEaq0BaL.js} +0 -0
  456. /package/dist/chunks/{main-CfkIGrBF.js → main-SFdnVz-G.js} +0 -0
  457. /package/dist/chunks/{observationStore-rLlDwRtG.js → observationStore-Bi1rRKcD.js} +0 -0
  458. /package/dist/chunks/{openaiShared-C-AuktRP.js → openaiShared-BkVgd2rZ.js} +0 -0
  459. /package/dist/chunks/{output-style-B64-Zum6.js → output-style-F8fBWFZo.js} +0 -0
  460. /package/dist/chunks/{parseConnectUrl-DL390ePs.js → parseConnectUrl-CVT_db9n.js} +0 -0
  461. /package/dist/chunks/{poller-BA1jhG3F.js → poller-DhLgWNxJ.js} +0 -0
  462. /package/dist/chunks/{postCommitAttribution-D8MoHFoz.js → postCommitAttribution-Br4g4R6h.js} +0 -0
  463. /package/dist/chunks/{projectContext-Dn7umMp6.js → projectContext-2Z2w8AI8.js} +0 -0
  464. /package/dist/chunks/{renderOptions-Caca3bCd.js → renderOptions-4HxIPoDZ.js} +0 -0
  465. /package/dist/chunks/{rewind-Djt1zU_3.js → rewind-FKh7loMA.js} +0 -0
  466. /package/dist/chunks/{sanitization-Ds6zRQyx.js → sanitization-B-JlvWcf.js} +0 -0
  467. /package/dist/chunks/{sdkHeapDumpMonitor-DLMMNeqo.js → sdkHeapDumpMonitor-DTHI5WbD.js} +0 -0
  468. /package/dist/chunks/{server-DONKdvGc.js → server-BsxW1FVq.js} +0 -0
  469. /package/dist/chunks/{serverBanner-DIyjgIM-.js → serverBanner-DR3GYXpH.js} +0 -0
  470. /package/dist/chunks/{serverLog-D1N5yx8A.js → serverLog-CH1fCGsD.js} +0 -0
  471. /package/dist/chunks/{sessionDataUploader-CsNePsOb.js → sessionDataUploader-BgmJTXQr.js} +0 -0
  472. /package/dist/chunks/{sessionManager-BOmgJd1l.js → sessionManager-mesT4zIQ.js} +0 -0
  473. /package/dist/chunks/{stickers-DDAm--86.js → stickers-B0P4weWp.js} +0 -0
  474. /package/dist/chunks/{udsClient-CBF_cZFW.js → udsClient-B85rNglp.js} +0 -0
  475. /package/dist/chunks/{upstreamproxy-CLf1UaJv.js → upstreamproxy-D-6vdoIJ.js} +0 -0
  476. /package/dist/chunks/{voice-YtzCcIoM.js → voice-BXg-kzte.js} +0 -0
@@ -1,4 +1,4 @@
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{Aa as ot,At as st,Br as ct,C as lt,Cc as E,Cl as ut,Cr as dt,D as ft,Di as pt,Fa as mt,Fo as ht,Fr as gt,Gn as _t,Gs as vt,Ho as D,Io as yt,Ja as bt,Jt as xt,Ka as St,Ko as Ct,Ln as wt,Lr as Tt,Ma as Et,Na as Dt,Nn as Ot,Nr as kt,Oi as At,Pr as O,Qa as k,Rn as jt,S as Mt,Sc as Nt,Sl as Pt,So as Ft,Ss as It,T as Lt,Tl as Rt,Tn as zt,Tt as Bt,Vt,Xi as Ht,Yn as Ut,Za as Wt,Zi as Gt,_ as Kt,_c as qt,_l as Jt,_o as Yt,_t as Xt,a as Zt,ac as Qt,an as $t,ao as en,bc as A,bn as tn,cl as nn,ct as rn,dc as j,dn as an,dr as on,eo as sn,gl as M,gn as cn,go as ln,hi as un,it as dn,jt as fn,lc as pn,ll as mn,lo as N,lt as hn,mr as gn,n as _n,no as vn,oc as yn,on as bn,oo as P,or as xn,ot as Sn,pa as Cn,po as wn,pr as Tn,qs as F,rt as En,s as Dn,st as On,tn as kn,ua as An,uc as jn,uo as Mn,vi as Nn,vl as Pn,vt as Fn,wl as In,wn as Ln,wt as Rn,x as zn,xc as Bn,xi as Vn,xo as Hn,yc as I,yl as Un,yn as Wn,yt as Gn,zn as Kn,zr as qn}from"./paths-DO4WOQtD.js";import{A as Jn,B as Yn,D as Xn,E as Zn,G as Qn,J as $n,L as er,N as tr,O as nr,Q as rr,U as ir,Z as ar,_ as or,h as sr,l as cr,m as lr,n as ur,o as dr,p as L,x as fr,z as R}from"./debug-otxXY3j-.js";import{n as z,r as B}from"./analytics-DqMQntaB.js";import{n as pr,t as mr}from"./cwd--iizewsn.js";import{a as hr,n as gr,r as _r}from"./process-DMKLUQIO.js";import{F as V,P as vr,f as yr,g as br,i as xr,m as Sr,r as Cr,v as wr}from"./git-C0IuvuIy.js";import{l as Tr,s as Er,u as Dr}from"./oauth-CdZEzMww.js";import{n as Or,t as kr}from"./bundledMode-kSQejuY4.js";import{r as Ar,t as jr}from"./execa-CGue6Z3n.js";import{n as Mr,t as Nr}from"./which-BnEnzWhs.js";import{d as Pr,f as Fr,o as Ir,s as H}from"./log-DSV4Ht5l.js";import{i as Lr,o as Rr}from"./platform-mh9ypxS8.js";import{i as zr,n as Br}from"./windowsPaths-BeDSnJ23.js";import{s as Vr,u as Hr}from"./types-KeqFPzY5.js";import{C as Ur,b as Wr,l as Gr,x as Kr}from"./teammate-CbskW5G9.js";import{a as U,f as qr,n as Jr,o as Yr,x as Xr}from"./startupProfiler-CAntGAbs.js";import{n as Zr,t as Qr}from"./lazySchema-B0QShMaQ.js";import{r as $r}from"./permissions-BsVJvaEe.js";import{l as ei,o as ti}from"./stringUtils-KZoO4GUd.js";import{g as ni,n as ri,p as ii,u as ai}from"./proxy-CF7ZDxaW.js";import{$C as oi,$f as si,$i as ci,$l as li,$v as ui,A as di,AA as fi,AE as pi,Aj as mi,As as hi,Aw as gi,BA as _i,BS as vi,BT as yi,Bh as bi,Bv as xi,Bw as Si,By as Ci,CE as wi,C_ as Ti,Ca as Ei,Cj as Di,Co as Oi,DC as ki,DE as Ai,D_ as ji,E as Mi,EC as Ni,EE as Pi,E_ as Fi,Eo as Ii,Et as Li,Ew as Ri,FA as zi,FT as Bi,Fr as Vi,Fv as Hi,Fw as Ui,Fy as Wi,Ga as Gi,Gv as Ki,Hd as qi,Hk as Ji,Hn as Yi,Hv as Xi,IE as Zi,IT as Qi,Ij as $i,Ja as ea,Jk as ta,Jp as na,Jv as ra,Jw as ia,Jx as aa,KE as oa,KS as sa,Ka as ca,Ki as la,Kv as ua,L as da,LE as fa,Ln as pa,Lw as ma,M as ha,MA as ga,Ml as _a,Ms as va,Mt as ya,Mv as ba,Mw as xa,Nl as Sa,Ns as Ca,Nv as wa,Nw as Ta,OA as Ea,OE as Da,Oi as Oa,Ot as ka,Ow as Aa,P as ja,Po as Ma,Pw as Na,Py as Pa,Qa as Fa,Qf as Ia,Qk as La,Ql as Ra,Qv as za,RE as Ba,RT as Va,Ri as Ha,Ry as Ua,SD as Wa,SE as W,S_ as Ga,Sa as G,Sp as Ka,T as qa,TA as Ja,TD as Ya,T_ as Xa,Ta as Za,Tj as Qa,Tk as $a,Tr as eo,UT as to,Uc as no,Uh as ro,Uk as io,Un as ao,Uo as oo,Uv as so,Uw as co,VT as lo,Vc as uo,Vh as fo,Vv as po,Vw as mo,WA as ho,WT as go,Wa as _o,Wk as vo,Wv as yo,Ww as bo,Xk as xo,Xu as So,Xw as Co,Ya as wo,Yp as To,Yv as Eo,Zi as Do,Zu as Oo,_f as ko,_w as Ao,aS as jo,aw as Mo,b as No,bD as Po,bi as Fo,bs as Io,bv as Lo,bw as Ro,cC as zo,cE as Bo,cs as Vo,ct as Ho,cw as Uo,cx as Wo,dE as Go,dv as Ko,dw as qo,eA as Jo,eS as Yo,ei as Xo,ey as Zo,fD as Qo,fE as $o,fj as es,fp as ts,fw as ns,gc as rs,gf as is,gw as as,i as os,ik as ss,iw as cs,jE as ls,js as us,jw as ds,k as fs,kE as ps,ki as ms,kr as hs,kt as gs,lA as _s,lC as vs,lE as ys,lw as bs,lx as xs,mD as Ss,mc as Cs,mh as ws,ms as Ts,mw as Es,nS as Ds,na as Os,nd as ks,nk as As,o as js,ow as Ms,p as Ns,pE as Ps,ph as Fs,pj as Is,pp as Ls,pw as Rs,qE as zs,qa as Bs,r as Vs,rw as Hs,s as Us,sD as Ws,ss as Gs,st as Ks,sw as qs,tS as Js,td as Ys,tr as Xs,tw as Zs,uA as Qs,uE as $s,uv as ec,uw as tc,vD as nc,vE as rc,vd as ic,vs as ac,vv as oc,vw as sc,w as cc,wE as lc,wa as uc,wd as dc,wi as fc,wp as pc,xA as mc,x_ as hc,xa as K,xd as gc,xk as _c,y as vc,yD as yc,yE as bc,yd as xc,yv as Sc,yw as Cc,zE as wc,zT as Tc,zi as Ec,zj as Dc,zv as Oc,zw as kc,zy as Ac}from"./loadAgentsDir-ClTeo0nk.js";import{At as jc,D as Mc,E as Nc,Ht as Pc,M as Fc,Ot as Ic,P as Lc,S as Rc,Ut as zc,cn as Bc,fn as Vc,kt as Hc,ln as Uc,rn as Wc,sn as Gc,un as Kc,w as qc}from"./prompt-CfM_xGPc.js";import{h as Jc,p as Yc}from"./xml-CTdKuU6f.js";import{a as Xc,n as Zc}from"./ripgrep-Bzwdi5-K.js";import{C as Qc,D as $c,O as el,y as tl}from"./rcDebugLog-CwU_wJBE.js";import{D as nl,O as rl,_ as il,v as al}from"./sessionTracing-Caw-kvQr.js";import{l as ol,r as sl}from"./commitAttribution-csu3NO7Y.js";import{C as cl,P as ll,S as ul}from"./teamHelpers-CXAmvFco.js";import{a as dl,n as fl,r as pl,s as ml}from"./detectRepository-2ICvGD0U.js";import{l as hl,o as gl,r as _l}from"./api-CQWbpxLP.js";import{i as vl,r as yl}from"./sentry-B7ZBc8fA.js";import{c as bl,l as xl,t as Sl}from"./common-Da57Qwms.js";import{n as Cl,t as wl}from"./worktreeModeEnabled-KtHEqeFA.js";import{a as Tl}from"./teammateModeSnapshot-CdiglTzv.js";import{a as El,r as Dl,t as Ol}from"./prompt-IqfIbvg9.js";import{c as kl,s as Al}from"./referral-Da4mpbd3.js";import{i as jl,t as Ml}from"./assistant-CEmC_DlU.js";import{i as Nl,t as Pl}from"./cliLaunch-Citfs01Q.js";import{c as Fl,l as Il}from"./releaseNotes-BPA229-J.js";import{n as Ll,t as q}from"./exit-DOBLl8jN.js";import{n as Rl,t as zl}from"./pluginOperations-CKmwDC3G.js";import"./pluginCliCommands-DWCeXYTl.js";import{n as Bl}from"./onChangeAppState-C4ic-Mib.js";import{n as Vl}from"./asciicast-C_1Pi99k.js";import{i as Hl,t as Ul}from"./skillChangeDetector-DQuNepIV.js";import{a as Wl,i as Gl,r as Kl,t as ql}from"./setup-Dihjl7jo.js";import{n as Jl}from"./stats-BmGdg4nj.js";import{t as Yl}from"./renderOptions-Caca3bCd.js";import{i as Xl,n as Zl,t as Ql}from"./githubRepoPathMapping-DUGvTwPB.js";import{i as $l,n as eu}from"./earlyInput-CFYRGxau.js";import{c as tu,d as nu,n as ru,r as iu,u as au}from"./RemoteSessionManager-jcPnywfY.js";import{n as ou,t as su}from"./sink-CqOAfFlL.js";import{t as cu}from"./banner-D9Cq292T.js";import{posix as lu,relative as uu,resolve as du,win32 as fu}from"path";import{appendFileSync as pu,readFileSync as mu}from"fs";import{open as hu,stat as gu}from"fs/promises";var _u=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})),vu=a((e=>{var{InvalidArgumentError:t}=_u(),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})),yu=a((e=>{var{humanReadableArgName:t}=vu(),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(`
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 ee,t as te}from"./defineProperty-80gRi2ZW.js";import{n as h,t as ne}from"./axios-DhfaybwJ.js";import{i as re,t as ie}from"./src-BJz1KAd_.js";import{Ln as g,Mn as ae,Mr as oe,Tt as se,Xn as ce,Yn as _,vt as v,wn as le,xt as ue}from"./schemas-BGAvj1T4.js";import{t as de}from"./v4-f1i_CNUT.js";import{C as fe,In as y,Jt as pe,Ln as me,Q as he,Rn as ge,S as _e,b as ve,dn as ye,f as be,g as xe,h as b,t as x,x as Se}from"./src-KjMLauwe.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{Aa as ot,At as st,Br as ct,C as lt,Cc as E,Cl as ut,Cr as dt,D as ft,Di as pt,Fa as mt,Fo as ht,Fr as gt,Gn as _t,Gs as vt,Ho as D,Io as yt,Ja as bt,Jt as xt,Ka as St,Ko as Ct,Ln as wt,Lr as Tt,Ma as Et,Na as Dt,Nn as Ot,Nr as kt,Oi as At,Pr as O,Qa as k,Rn as jt,S as Mt,Sc as Nt,Sl as Pt,So as Ft,Ss as It,T as Lt,Tl as Rt,Tn as zt,Tt as Bt,Vt,Xi as Ht,Yn as Ut,Za as Wt,Zi as Gt,_ as Kt,_c as qt,_l as Jt,_o as Yt,_t as Xt,a as Zt,ac as Qt,an as $t,ao as en,bc as A,bn as tn,cl as nn,ct as rn,dc as j,dn as an,dr as on,eo as sn,gl as M,gn as cn,go as ln,hi as un,it as dn,jt as fn,lc as pn,ll as mn,lo as N,lt as hn,mr as gn,n as _n,no as vn,oc as yn,on as bn,oo as P,or as xn,ot as Sn,pa as Cn,po as wn,pr as Tn,qs as F,rt as En,s as Dn,st as On,tn as kn,ua as An,uc as jn,uo as Mn,vi as Nn,vl as Pn,vt as Fn,wl as In,wn as Ln,wt as Rn,x as zn,xc as Bn,xi as Vn,xo as Hn,yc as I,yl as Un,yn as Wn,yt as Gn,zn as Kn,zr as qn}from"./paths-4ZWdjPP4.js";import{A as Jn,B as Yn,D as Xn,E as Zn,G as Qn,J as $n,L as er,N as tr,O as nr,Q as rr,U as ir,Z as ar,_ as or,h as sr,l as cr,m as lr,n as ur,o as dr,p as L,x as fr,z as R}from"./debug-otxXY3j-.js";import{n as z,r as B}from"./analytics-DqMQntaB.js";import{n as pr,t as mr}from"./cwd--iizewsn.js";import{a as hr,n as gr,r as _r}from"./process-DMKLUQIO.js";import{F as V,P as vr,f as yr,g as br,i as xr,m as Sr,r as Cr,v as wr}from"./git-C0IuvuIy.js";import{l as Tr,s as Er,u as Dr}from"./oauth-CdZEzMww.js";import{n as Or,t as kr}from"./bundledMode-kSQejuY4.js";import{r as Ar,t as jr}from"./execa-CGue6Z3n.js";import{n as Mr,t as Nr}from"./which-BnEnzWhs.js";import{d as Pr,f as Fr,o as Ir,s as H}from"./log-DSV4Ht5l.js";import{i as Lr,o as Rr}from"./platform-mh9ypxS8.js";import{i as zr,n as Br}from"./windowsPaths-BeDSnJ23.js";import{s as Vr,u as Hr}from"./types-KeqFPzY5.js";import{C as Ur,b as Wr,l as Gr,x as Kr}from"./teammate-CbskW5G9.js";import{a as U,f as qr,n as Jr,o as Yr,x as Xr}from"./startupProfiler-rCtNuhXz.js";import{n as Zr,t as Qr}from"./lazySchema-B0QShMaQ.js";import{r as $r}from"./permissions-BsVJvaEe.js";import{l as ei,o as ti}from"./stringUtils-KZoO4GUd.js";import{g as ni,n as ri,p as ii,u as ai}from"./proxy-CF7ZDxaW.js";import{$C as oi,$f as si,$i as ci,$l as li,$v as ui,A as di,AA as fi,AE as pi,Aj as mi,As as hi,Aw as gi,BA as _i,BS as vi,BT as yi,Bh as bi,Bv as xi,Bw as Si,By as Ci,CE as wi,C_ as Ti,Ca as Ei,Cj as Di,Co as Oi,DC as ki,DE as Ai,D_ as ji,E as Mi,EC as Ni,EE as Pi,E_ as Fi,Eo as Ii,Et as Li,Ew as Ri,FA as zi,FT as Bi,Fr as Vi,Fv as Hi,Fw as Ui,Fy as Wi,Ga as Gi,Gv as Ki,Hd as qi,Hk as Ji,Hn as Yi,Hv as Xi,IE as Zi,IT as Qi,Ij as $i,Ja as ea,Jk as ta,Jp as na,Jv as ra,Jw as ia,Jx as aa,KE as oa,KS as sa,Ka as ca,Ki as la,Kv as ua,L as da,LE as fa,Ln as pa,Lw as ma,M as ha,MA as ga,Ml as _a,Ms as va,Mt as ya,Mv as ba,Mw as xa,Nl as Sa,Ns as Ca,Nv as wa,Nw as Ta,OA as Ea,OE as Da,Oi as Oa,Ot as ka,Ow as Aa,P as ja,Po as Ma,Pw as Na,Py as Pa,Qa as Fa,Qf as Ia,Qk as La,Ql as Ra,Qv as za,RE as Ba,RT as Va,Ri as Ha,Ry as Ua,SD as Wa,SE as W,S_ as Ga,Sa as G,Sp as Ka,T as qa,TA as Ja,TD as Ya,T_ as Xa,Ta as Za,Tj as Qa,Tk as $a,Tr as eo,UT as to,Uc as no,Uh as ro,Uk as io,Un as ao,Uo as oo,Uv as so,Uw as co,VT as lo,Vc as uo,Vh as fo,Vv as po,Vw as mo,WA as ho,WT as go,Wa as _o,Wk as vo,Wv as yo,Ww as bo,Xk as xo,Xu as So,Xw as Co,Ya as wo,Yp as To,Yv as Eo,Zi as Do,Zu as Oo,_f as ko,_w as Ao,aS as jo,aw as Mo,b as No,bD as Po,bi as Fo,bs as Io,bv as Lo,bw as Ro,cC as zo,cE as Bo,cs as Vo,ct as Ho,cw as Uo,cx as Wo,dE as Go,dv as Ko,dw as qo,eA as Jo,eS as Yo,ei as Xo,ey as Zo,fD as Qo,fE as $o,fj as es,fp as ts,fw as ns,gc as rs,gf as is,gw as as,i as os,ik as ss,iw as cs,jE as ls,js as us,jw as ds,k as fs,kE as ps,ki as ms,kr as hs,kt as gs,lA as _s,lC as vs,lE as ys,lw as bs,lx as xs,mD as Ss,mc as Cs,mh as ws,ms as Ts,mw as Es,nS as Ds,na as Os,nd as ks,nk as As,o as js,ow as Ms,p as Ns,pE as Ps,ph as Fs,pj as Is,pp as Ls,pw as Rs,qE as zs,qa as Bs,r as Vs,rw as Hs,s as Us,sD as Ws,ss as Gs,st as Ks,sw as qs,tS as Js,td as Ys,tr as Xs,tw as Zs,uA as Qs,uE as $s,uv as ec,uw as tc,vD as nc,vE as rc,vd as ic,vs as ac,vv as oc,vw as sc,w as cc,wE as lc,wa as uc,wd as dc,wi as fc,wp as pc,xA as mc,x_ as hc,xa as K,xd as gc,xk as _c,y as vc,yD as yc,yE as bc,yd as xc,yv as Sc,yw as Cc,zE as wc,zT as Tc,zi as Ec,zj as Dc,zv as Oc,zw as kc,zy as Ac}from"./loadAgentsDir-CQF8qhne.js";import{At as jc,D as Mc,E as Nc,Ht as Pc,M as Fc,Ot as Ic,P as Lc,S as Rc,Ut as zc,cn as Bc,fn as Vc,kt as Hc,ln as Uc,rn as Wc,sn as Gc,un as Kc,w as qc}from"./prompt-CogZQuTN.js";import{h as Jc,p as Yc}from"./xml-BUaEXGXx.js";import{a as Xc,n as Zc}from"./ripgrep-Bzwdi5-K.js";import{C as Qc,D as $c,O as el,y as tl}from"./rcDebugLog-DOXxIr8l.js";import{D as nl,O as rl,_ as il,v as al}from"./sessionTracing-BDN64fWh.js";import{l as ol,r as sl}from"./commitAttribution-ClSlXMPG.js";import{C as cl,P as ll,S as ul}from"./teamHelpers-B-poMJeE.js";import{a as dl,n as fl,r as pl,s as ml}from"./detectRepository-2ICvGD0U.js";import{l as hl,o as gl,r as _l}from"./api-DMbWqJlK.js";import{i as vl,r as yl}from"./sentry-CVdHlmNQ.js";import{c as bl,l as xl,t as Sl}from"./common-Da57Qwms.js";import{n as Cl,t as wl}from"./worktreeModeEnabled-KtHEqeFA.js";import{a as Tl}from"./teammateModeSnapshot-B1_3D1CQ.js";import{a as El,r as Dl,t as Ol}from"./prompt-IqfIbvg9.js";import{c as kl,s as Al}from"./referral-CMPZjf3I.js";import{i as jl,t as Ml}from"./assistant-JAqAZqaE.js";import{i as Nl,t as Pl}from"./cliLaunch-Citfs01Q.js";import{c as Fl,l as Il}from"./releaseNotes-Tbd018Qz.js";import{n as Ll,t as q}from"./exit-DOBLl8jN.js";import{n as Rl,t as zl}from"./pluginOperations-mr4I7Jw9.js";import"./pluginCliCommands-CmY_maYg.js";import{n as Bl}from"./onChangeAppState-B3d5iy6T.js";import{n as Vl}from"./asciicast-C_1Pi99k.js";import{i as Hl,t as Ul}from"./skillChangeDetector-DlWPJTny.js";import{a as Wl,i as Gl,r as Kl,t as ql}from"./setup-9nXlu56r.js";import{n as Jl}from"./stats-BDlygx5X.js";import{t as Yl}from"./renderOptions-4HxIPoDZ.js";import{i as Xl,n as Zl,t as Ql}from"./githubRepoPathMapping-DrreQj47.js";import{i as $l,n as eu}from"./earlyInput-B3U01GAm.js";import{c as tu,d as nu,n as ru,r as iu,u as au}from"./RemoteSessionManager-BvvNspY8.js";import{n as ou,t as su}from"./sink-BL75jACh.js";import{t as cu}from"./banner-D_rqe2XQ.js";import{posix as lu,relative as uu,resolve as du,win32 as fu}from"path";import{appendFileSync as pu,readFileSync as mu}from"fs";import{open as hu,stat as gu}from"fs/promises";var _u=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})),vu=a((e=>{var{InvalidArgumentError:t}=_u(),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})),yu=a((e=>{var{humanReadableArgName:t}=vu(),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
2
  `)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
3
3
  `+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
4
4
  `)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),bu=a((e=>{var{InvalidArgumentError:t}=_u(),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}
@@ -7,17 +7,17 @@ import{a as e,i as t,n,o as r,r as i,t as a}from"./chunk-DR8-3Aex.js";import{n a
7
7
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(t)?Error(`${n}
8
8
  - too many short flags`):i.test(t)?Error(`${n}
9
9
  - too many long flags`):Error(`${n}
10
- - unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),xu=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})),Su=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}=vu(),{CommanderError:l}=_u(),{Help:u,stripColor:d}=yu(),{Option:f,DualOptions:p}=bu(),{suggestSimilar:m}=xu(),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
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})),xu=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})),Su=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}=vu(),{CommanderError:l}=_u(),{Help:u,stripColor:d}=yu(),{Option:f,DualOptions:p}=bu(),{suggestSimilar:m}=xu(),ee=class e extends n{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>o.stdout.write(e),writeErr:e=>o.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>o.stdout.isTTY?o.stdout.columns:void 0,getErrHelpWidth:()=>o.stderr.isTTY?o.stderr.columns:void 0,getOutHasColors:()=>h()??(o.stdout.isTTY&&o.stdout.hasColors?.()),getErrHasColors:()=>h()??(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
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
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
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
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
15
  - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
16
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(`
17
+ - ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let n=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function c(e,t){let n=i.resolve(e,t);if(a.existsSync(n))return n;if(s.includes(i.extname(t)))return;let r=s.find(e=>a.existsSync(`${n}${e}`));if(r)return`${n}${r}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=a.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=i.resolve(i.dirname(e),d)}if(d){let t=c(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=i.basename(this._scriptPath,i.extname(this._scriptPath));n!==this._name&&(t=c(d,`${n}-${e._name}`))}u=t||u}n=s.includes(i.extname(u));let f;o.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=te(o.execArgv).concat(t),f=r.spawn(o.execPath,t,{stdio:`inherit`})):n?(t.unshift(u),t=te(o.execArgv).concat(t),f=r.spawn(o.argv[0],t,{stdio:`inherit`})):f=r.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{o.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e=e??1,p?p(new l(e,`commander.executeSubCommandAsync`,`(close)`)):o.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(u,d,e._name);else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)o.exit(1);else{let e=new l(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e&&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
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})),Cu=a((e=>{var{Argument:t}=vu(),{Command:n}=Su(),{CommanderError:r,InvalidArgumentError:i}=_u(),{Help:a}=yu(),{Option:o}=bu();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})),wu=a(((e,t)=>{var n=Cu();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(),ir(),Zn(),or(),gr(),cr(),Jr(),ln(),jt();var{program:Tu,createCommand:Eu,createArgument:Du,createOption:Ou,CommanderError:ku,InvalidArgumentError:Au,InvalidOptionArgumentError:ju,Command:Mu,Argument:Nu,Option:J,Help:Pu}=r(wu(),1).default;te(),ue();var Fu=r(he(),1);pe();var Y=S();xe(),In(),Pt(),Pn(),nn(),pr(),vr(),kr(),Ar(),Nr(),Ir(),Rr(),Br(),wr(),Vr(),I(),Kr(),Xr(),vt(),Qr(),It(),Ct(),ti(),Ft(),wn(),P(),ni(),ai(),mt(),Et(),An(),Ht(),O(),Tn(),on(),Ut(),bn(),fn(),Rn(),Fn(),rn(),En(),Mt(),Zt(),es(),Yc(),_i(),Xc(),fi(),Vc(),Gc(),Hc(),La(),vo(),zs(),fa(),ll(),vl(),lc(),Bo(),bl(),Co(),mo(),Aa(),tc(),oi(),el(),Js(),ec(),Ti(),bi(),wl(),xc(),Oo(),va(),us(),ac(),oo(),_o(),K(),Os(),Ec(),Vi(),Yi(),Ks(),Dr(),Pr();var Iu=!1;function Lu(){if(Iu||(Iu=!0,Fr())||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||Tr().BASE_API_URL;fetch(e,{method:`HEAD`,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}function Ru(){if(process.env.NODE_EXTRA_CA_CERTS)return;let e=zu();e&&(process.env.NODE_EXTRA_CA_CERTS=e,L(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${e}`))}function zu(){try{let e=j()?.env,t=k(`userSettings`)?.env;L(`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&&L(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${n}`),n}catch(e){L(`CA certs: Config fallback failed: ${e}`,{level:`error`});return}}I(),cr(),dl(),On(),p(),Za(),il(),rl(),Ws();var Bu=!1,Vu=o(async()=>{let e=Date.now();V(`info`,`init_started`),U(`init_function_start`);try{let t=Date.now();yn(),de({loadTheme:()=>j().theme,saveTheme:e=>E(t=>({...t,theme:e}))}),V(`info`,`init_configs_enabled`,{duration_ms:Date.now()-t}),U(`init_configs_enabled`);let n=Date.now();uc(),Ru(),V(`info`,`init_safe_env_vars_applied`,{duration_ms:Date.now()-n}),U(`init_safe_env_vars_applied`),Pi(),U(`init_after_graceful_shutdown`),Promise.all([import(`./firstPartyEventLogger-DlW8BUXq.js`),import(`./growthbook-Br1dDRtd.js`)]).then(([e,t])=>{e.initialize1PEventLogging(),t.onGrowthBookRefresh(()=>{e.reinitialize1PEventLoggingIfConfigChanged()})}),U(`init_after_1p_event_logging`),import(`./poller-BA1jhG3F.js`).then(e=>e.startBalancePolling()),U(`init_after_balance_polling`),Cn(),U(`init_after_oauth_populate`),Sn(),U(`init_after_jetbrains_detection`),fl(),$s()&&ys(),Bs()&&Gi(),U(`init_after_remote_settings_check`),Bn();let r=Date.now();L(`[init] configureGlobalMTLS starting`),ii(),V(`info`,`init_mtls_configured`,{duration_ms:Date.now()-r}),L(`[init] configureGlobalMTLS complete`);let i=Date.now();if(L(`[init] configureGlobalAgents starting`),ri(),V(`info`,`init_proxy_configured`,{duration_ms:Date.now()-i}),L(`[init] configureGlobalAgents complete`),U(`init_network_configured`),yl(),await Xt(),Qo(),rr(Ss),Lu(),m(process.env.CLAUDE_CODE_REMOTE))try{let{initUpstreamProxy:e,getUpstreamProxyEnv:t}=await import(`./upstreamproxy-CLf1UaJv.js`),{registerUpstreamProxyEnvFn:n}=await import(`./subprocessEnv-D4Cbyl2J.js`);n(t),await e()}catch(e){L(`[init] upstreamproxy init failed: ${e instanceof Error?e.message:String(e)}; continuing without proxy`,{level:`warn`})}if(zr(),rr(ro),rr(async()=>{let{cleanupSessionTeams:e}=await import(`./teamHelpers-B83RwCCC.js`);await e()}),ao()){let e=Date.now();await pa(),V(`info`,`init_scratchpad_created`,{duration_ms:Date.now()-e})}try{let{getRipgrepStatus:e}=await import(`./ripgrep-DEa1djpJ.js`),t=e();t.note&&process.stderr.write(`[ripgrep] ${t.note}\n`)}catch{L(`[init] ripgrep status check skipped`)}V(`info`,`init_completed`,{duration_ms:Date.now()-e}),U(`init_function_end`)}catch(e){if(e instanceof tr){if(Re()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}\n`),wi(1);return}return import(`./InvalidConfigDialog-uTSuSBvO.js`).then(t=>t.showInvalidConfigDialog({error:e}))}else throw e}});function Hu(){$s()?(Re()&&al()&&Uu().catch(e=>{L(`[3P telemetry] Eager telemetry init failed (beta tracing): ${R(e)}`,{level:`error`})}),L(`[3P telemetry] Waiting for remote managed settings before telemetry init`),Ps().then(async()=>{L(`[3P telemetry] Remote managed settings loaded, initializing telemetry`),Ei(),await Uu()}).catch(e=>{L(`[3P telemetry] Telemetry init failed (remote settings path): ${R(e)}`,{level:`error`})})):Uu().catch(e=>{L(`[3P telemetry] Telemetry init failed: ${R(e)}`,{level:`error`})})}async function Uu(){if(!Bu){if(!m(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)){Bu=!0,L(`[3P telemetry] Skipped — CLAUDE_CODE_ENABLE_TELEMETRY not set`);return}Bu=!0;try{await Wu()}catch(e){throw Bu=!1,e}}}async function Wu(){let{initializeTelemetry:e}=await import(`./instrumentation-BCiV3SKX.js`),t=await e();t&&(Xe(t,(e,n)=>{let r=t?.createCounter(e,n);return{add(e,t={}){let n={...nl(),...t};r?.add(e,n)}}}),Ve()?.add(1))}sa();async function Gu(e,t,n,r){let{App:i}=await import(`./App-DLdRpU7c.js`),{SentryErrorBoundary:a}=await import(`./SentryErrorBoundary-2E2qGV11.js`),{REPL:o}=await import(`./REPL-nP7H_-qa.js`);await r(e,(0,Y.jsx)(a,{name:`RootREPLBoundary`,children:(0,Y.jsx)(i,{...t,children:(0,Y.jsx)(o,{...n})})}))}Dr(),I(),cr(),Pr();var Ku=Zr(()=>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 qu(){if(Fr())return L(`[Bootstrap] Skipped: Nonessential traffic disabled`),null;if(Dt()!==`firstParty`)return L(`[Bootstrap] Skipped: 3P provider`),null;let e=Vt();if(!(xt()?.accessToken&&$t())&&!e)return L(`[Bootstrap] Skipped: no usable OAuth or API key`),null;let t=`${Tr().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await Bt(async()=>{let n=xt()?.accessToken,r;if(n&&$t())r={Authorization:`Bearer ${n}`,"anthropic-beta":Er};else if(e)r={"x-api-key":e};else return L(`[Bootstrap] No auth available on retry, aborting`),null;L(`[Bootstrap] Fetching`);let i=await g.get(t,{headers:{"Content-Type":`application/json`,"User-Agent":st(),...r},timeout:5e3}),a=Ku().safeParse(i.data);return a.success?(L(`[Bootstrap] Fetch ok`),a.data):(L(`[Bootstrap] Response failed validation: ${a.error.message}`),null)})}catch(e){throw L(`[Bootstrap] Fetch failed: ${g.isAxiosError(e)?e.response?.status??e.code:`unknown`}`),e}}async function Ju(){try{let e=await qu();if(!e)return;let t=e.client_data??null,n=e.additional_model_options??[],r=j();if(Rt(r.clientDataCache,t)&&Rt(r.additionalModelOptionsCache,n)){L(`[Bootstrap] Cache unchanged, skipping write`);return}L(`[Bootstrap] Cache updated, persisting to disk`),E(e=>({...e,clientDataCache:t,additionalModelOptionsCache:n}))}catch(e){H(e)}}Nn(),$i(),Qa(),gl(),Ki(),Al(),cr(),p();var Yu=new Map;function Xu(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;Lr()===`windows`&&(e=e.split(fu.sep).join(lu.sep),t=t.split(fu.sep).join(lu.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 Zu=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function Qu(e){let t=`${e.name}: ${e.message}`;return Zu.some(e=>e.test(t))}var $u=null;function ed(){let e=process.listeners(`warning`);$u&&e.includes($u)||(Xu()||process.removeAllListeners(`warning`),$u=e=>{try{let t=`${e.name}: ${e.message.slice(0,50)}`,n=Yu.get(t)||0;(Yu.has(t)||Yu.size<1e3)&&Yu.set(t,n+1);let r=Qu(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)&&L(`${r?`[Internal Warning]`:`[Warning]`} ${e.toString()}`,{level:`warn`})}catch{}},process.on(`warning`,$u))}rc(),go(),Bi(),Ci(),Ua(),Wi(),su(),xe();function td(){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(),P(),xe();function nd({serverName:e,onDone:t}){function n(n){switch(B(`tengu_mcp_dialog_choice`,{choice:n}),n){case`yes`:case`yes_all`:{let r=(vn()||{}).enabledMcpjsonServers||[];r.includes(e)||N(`localSettings`,{enabledMcpjsonServers:[...r,e]}),n===`yes_all`&&N(`localSettings`,{enableAllProjectMcpServers:!0}),t();break}case`no`:{let n=(vn()||{}).disabledMcpjsonServers||[];n.includes(e)||N(`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)(td,{}),(0,Y.jsx)(jo,{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`)})]})}M(),z(),xe(),P(),ki();function rd({serverNames:e,onDone:t}){function n(n){let r=vn()||{},i=r.enabledMcpjsonServers||[],a=r.disabledMcpjsonServers||[],[o,s]=Jt(e,e=>n.includes(e));B(`tengu_mcp_multidialog_choice`,{approved:o.length,rejected:s.length}),o.length>0&&N(`localSettings`,{enabledMcpjsonServers:[...new Set([...i,...o])]}),s.length>0&&N(`localSettings`,{disabledMcpjsonServers:[...new Set([...a,...s])]}),t()}let r=(0,Fu.useCallback)(()=>{let n=(vn()||{}).disabledMcpjsonServers||[];N(`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)(td,{}),(0,Y.jsx)(Ac,{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)(Ni,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`reject all`})]})})})]})}vs();async function id(e){let{servers:t}=kc(`project`),n=Object.keys(t).filter(e=>Ri(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)(zo,{children:(0,Y.jsx)(Pa,{children:(0,Y.jsx)(nd,{serverName:t,onDone:r})})}))}else e.render((0,Y.jsx)(zo,{children:(0,Y.jsx)(Pa,{children:(0,Y.jsx)(rd,{serverNames:n,onDone:r})})}))})}Qs(),ss(),Wa(),ol(),Po(),cc(),I(),cr();var ad={iterm:`iTerm`,"iterm.app":`iTerm`,ghostty:`Ghostty`,kitty:`kitty`,alacritty:`Alacritty`,wezterm:`WezTerm`,apple_terminal:`Terminal`};function od(){if(process.platform!==`darwin`)return;let e=process.env.TERM_PROGRAM;if(!e)return;let t=ad[e.toLowerCase()];t&&j().deepLinkTerminal!==t&&(E(e=>({...e,deepLinkTerminal:t})),L(`Stored deep link terminal preference: ${t}`))}var sd=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(),lc(),T(),xe(),Wi(),vs(),I(),p(),Za(),xs(),P();function cd(){E(e=>({...e,hasCompletedOnboarding:!0,lastOnboardingVersion:`2.7.2`}))}function ld(e,t){return new Promise(n=>{e.render(t(e=>void n(e)))})}async function X(e,t,n){return ud(e,t,{color:`error`,beforeExit:n})}async function ud(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 ld(e,e=>(0,Y.jsx)(ge,{initialState:j().theme,onThemeSave:e=>E(t=>({...t,theme:e})),children:(0,Y.jsx)(zo,{onChangeAppState:n?.onChangeAppState,children:(0,Y.jsx)(Pa,{children:t(e)})})}))}async function dd(e,t){e.render(t),Np(),await e.waitUntilExit(),await W(0)}async function fd(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-B8qMJaBh.js`);await Z(e,e=>(0,Y.jsx)(t,{onDone:()=>{cd(),e()}}),{onChangeAppState:Bl})}if(!m(process.env.CLAUBBIT)){if(!Qt()){let{TrustDialog:t}=await import(`./TrustDialog-0anSIf-G.js`);await Z(e,e=>(0,Y.jsx)(t,{commands:r,onDone:e}))}Te(!0),ft(),lt(),Ji();let{errors:t}=Wo();if(t.length===0&&await id(e),await Jo()){let t=ta(await xo(!0)),{ClaudeMdExternalIncludesDialog:n}=await import(`./ClaudeMdExternalIncludesDialog-DxJK9NiM.js`);await Z(e,e=>(0,Y.jsx)(n,{onDone:e,isStandaloneDialog:!0,externalIncludes:t}))}}if(Xl(),od(),Ei(),setImmediate(()=>Hu()),await bc()){let{GroveDialog:t}=await import(`./Grove-Bwmghb-e.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`,{}),wi(0),!1}if(process.env.ANTHROPIC_API_KEY&&!u()){let t=Gt(process.env.ANTHROPIC_API_KEY);if(jn(t)===`new`){let{ApproveApiKey:n}=await import(`./ApproveApiKey-B7_TCGwt.js`);await Z(e,e=>(0,Y.jsx)(n,{customApiKeyTruncated:t,onDone:e}),{onChangeAppState:Bl})}}if((t===`bypassPermissions`||n)&&!en()){let{BypassPermissionsModeDialog:t}=await import(`./BypassPermissionsModeDialog-CuEpdRVd.js`);await Z(e,e=>(0,Y.jsx)(t,{onAccept:e}))}if(a&&a.length>0){let{DevChannelsDialog:t}=await import(`./DevChannelsDialog-c4YVqBX9.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-CTTKMRbt.js`);await Z(e,e=>(0,Y.jsx)(t,{onDone:e}))}return s}function pd(e){let t=0,n=Yl(e);n.stdin&&B(`tengu_stdin_interactive`,{});let r=new sd,i=Jl();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&&pu(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}}}}}Wi();async function md(e,t){let{InvalidSettingsDialog:n}=await import(`./InvalidSettingsDialog-B-Os12-H.js`);return Z(e,e=>(0,Y.jsx)(n,{settingsErrors:t.settingsErrors,onContinue:e,onExit:t.onExit}))}async function hd(e,t){let{AssistantSessionChooser:n}=await import(`./AssistantSessionChooser-D6rS0OVe.js`);return Z(e,e=>(0,Y.jsx)(n,{sessions:t.sessions,onSelect:t=>e(t),onCancel:()=>e(null)}))}async function gd(e){let{NewInstallWizard:t,computeDefaultInstallDir:n}=await import(`./assistant-CyVcFPIR.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 _d(e){let{TeleportResumeWrapper:t}=await import(`./TeleportResumeWrapper-B66clYsG.js`);return Z(e,e=>(0,Y.jsx)(t,{onComplete:e,onCancel:()=>e(null),source:`cliArg`}))}async function vd(e,t){let{TeleportRepoMismatchDialog:n}=await import(`./TeleportRepoMismatchDialog-DyTBg1YD.js`);return Z(e,e=>(0,Y.jsx)(n,{targetRepo:t.targetRepo,initialPaths:t.initialPaths,onSelectPath:e,onCancel:()=>e(null)}))}async function yd(e,t,n,r){let[i,{ResumeConversation:a},{App:o}]=await Promise.all([n,import(`./ResumeConversation-CZ2Uedkf.js`),import(`./App-DLdRpU7c.js`)]);await dd(e,(0,Y.jsx)(o,{getFpsMetrics:t.getFpsMetrics,stats:t.stats,initialState:t.initialState,children:(0,Y.jsx)(Pa,{children:(0,Y.jsx)(a,{...r,worktreePaths:i})})}))}Nl();function bd(){let e=Pl([`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.7.2`,defaultEnabled:!0,mcpServers:{weixin:{type:`stdio`,command:e.execPath,args:e.args}}})}function xd(){bd()}re(),El(),ql(),Uc(),zc();var Sd=5,Cd=30,wd=`After you finish implementing the change:
19
+ Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function te(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function h(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=ee,e.useColor=h})),Cu=a((e=>{var{Argument:t}=vu(),{Command:n}=Su(),{CommanderError:r,InvalidArgumentError:i}=_u(),{Help:a}=yu(),{Option:o}=bu();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})),wu=a(((e,t)=>{var n=Cu();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(),ee(),w(),T(),z(),ar(),ir(),Zn(),or(),gr(),cr(),Jr(),ln(),jt();var{program:Tu,createCommand:Eu,createArgument:Du,createOption:Ou,CommanderError:ku,InvalidArgumentError:Au,InvalidOptionArgumentError:ju,Command:Mu,Argument:Nu,Option:J,Help:Pu}=r(wu(),1).default;ne(),de();var Fu=r(ge(),1);me();var Y=S();x(),In(),Pt(),Pn(),nn(),pr(),vr(),kr(),Ar(),Nr(),Ir(),Rr(),Br(),wr(),Vr(),I(),Kr(),Xr(),vt(),Qr(),It(),Ct(),ti(),Ft(),wn(),P(),ni(),ai(),mt(),Et(),An(),Ht(),O(),Tn(),on(),Ut(),bn(),fn(),Rn(),Fn(),rn(),En(),Mt(),Zt(),es(),Yc(),_i(),Xc(),fi(),Vc(),Gc(),Hc(),La(),vo(),zs(),fa(),ll(),vl(),lc(),Bo(),bl(),Co(),mo(),Aa(),tc(),oi(),el(),Js(),ec(),Ti(),bi(),wl(),xc(),Oo(),va(),us(),ac(),oo(),_o(),K(),Os(),Ec(),Vi(),Yi(),Ks(),Dr(),Pr();var Iu=!1;function Lu(){if(Iu||(Iu=!0,Fr())||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||Tr().BASE_API_URL;fetch(e,{method:`HEAD`,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}function Ru(){if(process.env.NODE_EXTRA_CA_CERTS)return;let e=zu();e&&(process.env.NODE_EXTRA_CA_CERTS=e,L(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${e}`))}function zu(){try{let e=j()?.env,t=k(`userSettings`)?.env;L(`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&&L(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${n}`),n}catch(e){L(`CA certs: Config fallback failed: ${e}`,{level:`error`});return}}I(),cr(),dl(),On(),p(),Za(),il(),rl(),Ws();var Bu=!1,Vu=o(async()=>{let e=Date.now();V(`info`,`init_started`),U(`init_function_start`);try{let t=Date.now();yn(),fe({loadTheme:()=>j().theme,saveTheme:e=>E(t=>({...t,theme:e}))}),V(`info`,`init_configs_enabled`,{duration_ms:Date.now()-t}),U(`init_configs_enabled`);let n=Date.now();uc(),Ru(),V(`info`,`init_safe_env_vars_applied`,{duration_ms:Date.now()-n}),U(`init_safe_env_vars_applied`),Pi(),U(`init_after_graceful_shutdown`),Promise.all([import(`./firstPartyEventLogger-D-ifHvWu.js`),import(`./growthbook-ksjGAskq.js`)]).then(([e,t])=>{e.initialize1PEventLogging(),t.onGrowthBookRefresh(()=>{e.reinitialize1PEventLoggingIfConfigChanged()})}),U(`init_after_1p_event_logging`),import(`./poller-DhLgWNxJ.js`).then(e=>e.startBalancePolling()),U(`init_after_balance_polling`),Cn(),U(`init_after_oauth_populate`),Sn(),U(`init_after_jetbrains_detection`),fl(),$s()&&ys(),Bs()&&Gi(),U(`init_after_remote_settings_check`),Bn();let r=Date.now();L(`[init] configureGlobalMTLS starting`),ii(),V(`info`,`init_mtls_configured`,{duration_ms:Date.now()-r}),L(`[init] configureGlobalMTLS complete`);let i=Date.now();if(L(`[init] configureGlobalAgents starting`),ri(),V(`info`,`init_proxy_configured`,{duration_ms:Date.now()-i}),L(`[init] configureGlobalAgents complete`),U(`init_network_configured`),yl(),await Xt(),Qo(),rr(Ss),Lu(),m(process.env.CLAUDE_CODE_REMOTE))try{let{initUpstreamProxy:e,getUpstreamProxyEnv:t}=await import(`./upstreamproxy-D-6vdoIJ.js`),{registerUpstreamProxyEnvFn:n}=await import(`./subprocessEnv-D4Cbyl2J.js`);n(t),await e()}catch(e){L(`[init] upstreamproxy init failed: ${e instanceof Error?e.message:String(e)}; continuing without proxy`,{level:`warn`})}if(zr(),rr(ro),rr(async()=>{let{cleanupSessionTeams:e}=await import(`./teamHelpers-DeQCfdgu.js`);await e()}),ao()){let e=Date.now();await pa(),V(`info`,`init_scratchpad_created`,{duration_ms:Date.now()-e})}try{let{getRipgrepStatus:e}=await import(`./ripgrep-DEa1djpJ.js`),t=e();t.note&&process.stderr.write(`[ripgrep] ${t.note}\n`)}catch{L(`[init] ripgrep status check skipped`)}V(`info`,`init_completed`,{duration_ms:Date.now()-e}),U(`init_function_end`)}catch(e){if(e instanceof tr){if(Re()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}\n`),wi(1);return}return import(`./InvalidConfigDialog-6lPGcuOX.js`).then(t=>t.showInvalidConfigDialog({error:e}))}else throw e}});function Hu(){$s()?(Re()&&al()&&Uu().catch(e=>{L(`[3P telemetry] Eager telemetry init failed (beta tracing): ${R(e)}`,{level:`error`})}),L(`[3P telemetry] Waiting for remote managed settings before telemetry init`),Ps().then(async()=>{L(`[3P telemetry] Remote managed settings loaded, initializing telemetry`),Ei(),await Uu()}).catch(e=>{L(`[3P telemetry] Telemetry init failed (remote settings path): ${R(e)}`,{level:`error`})})):Uu().catch(e=>{L(`[3P telemetry] Telemetry init failed: ${R(e)}`,{level:`error`})})}async function Uu(){if(!Bu){if(!m(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)){Bu=!0,L(`[3P telemetry] Skipped — CLAUDE_CODE_ENABLE_TELEMETRY not set`);return}Bu=!0;try{await Wu()}catch(e){throw Bu=!1,e}}}async function Wu(){let{initializeTelemetry:e}=await import(`./instrumentation-Dx0s2jzr.js`),t=await e();t&&(Xe(t,(e,n)=>{let r=t?.createCounter(e,n);return{add(e,t={}){let n={...nl(),...t};r?.add(e,n)}}}),Ve()?.add(1))}sa();async function Gu(e,t,n,r){let{App:i}=await import(`./App-DJyiiVKi.js`),{SentryErrorBoundary:a}=await import(`./SentryErrorBoundary-DsrmgmKF.js`),{REPL:o}=await import(`./REPL-BBmn_itf.js`);await r(e,(0,Y.jsx)(a,{name:`RootREPLBoundary`,children:(0,Y.jsx)(i,{...t,children:(0,Y.jsx)(o,{...n})})}))}Dr(),I(),cr(),Pr();var Ku=Zr(()=>le({client_data:ae(g(),ce()).nullish(),additional_model_options:se(le({model:g(),name:g(),description:g()}).transform(({model:e,name:t,description:n})=>({value:e,label:t,description:n}))).nullish()}));async function qu(){if(Fr())return L(`[Bootstrap] Skipped: Nonessential traffic disabled`),null;if(Dt()!==`firstParty`)return L(`[Bootstrap] Skipped: 3P provider`),null;let e=Vt();if(!(xt()?.accessToken&&$t())&&!e)return L(`[Bootstrap] Skipped: no usable OAuth or API key`),null;let t=`${Tr().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await Bt(async()=>{let n=xt()?.accessToken,r;if(n&&$t())r={Authorization:`Bearer ${n}`,"anthropic-beta":Er};else if(e)r={"x-api-key":e};else return L(`[Bootstrap] No auth available on retry, aborting`),null;L(`[Bootstrap] Fetching`);let i=await h.get(t,{headers:{"Content-Type":`application/json`,"User-Agent":st(),...r},timeout:5e3}),a=Ku().safeParse(i.data);return a.success?(L(`[Bootstrap] Fetch ok`),a.data):(L(`[Bootstrap] Response failed validation: ${a.error.message}`),null)})}catch(e){throw L(`[Bootstrap] Fetch failed: ${h.isAxiosError(e)?e.response?.status??e.code:`unknown`}`),e}}async function Ju(){try{let e=await qu();if(!e)return;let t=e.client_data??null,n=e.additional_model_options??[],r=j();if(Rt(r.clientDataCache,t)&&Rt(r.additionalModelOptionsCache,n)){L(`[Bootstrap] Cache unchanged, skipping write`);return}L(`[Bootstrap] Cache updated, persisting to disk`),E(e=>({...e,clientDataCache:t,additionalModelOptionsCache:n}))}catch(e){H(e)}}Nn(),$i(),Qa(),gl(),Ki(),Al(),cr(),p();var Yu=new Map;function Xu(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;Lr()===`windows`&&(e=e.split(fu.sep).join(lu.sep),t=t.split(fu.sep).join(lu.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 Zu=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function Qu(e){let t=`${e.name}: ${e.message}`;return Zu.some(e=>e.test(t))}var $u=null;function ed(){let e=process.listeners(`warning`);$u&&e.includes($u)||(Xu()||process.removeAllListeners(`warning`),$u=e=>{try{let t=`${e.name}: ${e.message.slice(0,50)}`,n=Yu.get(t)||0;(Yu.has(t)||Yu.size<1e3)&&Yu.set(t,n+1);let r=Qu(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)&&L(`${r?`[Internal Warning]`:`[Warning]`} ${e.toString()}`,{level:`warn`})}catch{}},process.on(`warning`,$u))}rc(),go(),Bi(),Ci(),Ua(),Wi(),su(),x();function td(){return(0,Y.jsxs)(ve,{children:[`MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the`,` `,(0,Y.jsx)(he,{url:`https://code.claude.com/docs/en/mcp`,children:`MCP documentation`}),`.`]})}z(),P(),x();function nd({serverName:e,onDone:t}){function n(n){switch(B(`tengu_mcp_dialog_choice`,{choice:n}),n){case`yes`:case`yes_all`:{let r=(vn()||{}).enabledMcpjsonServers||[];r.includes(e)||N(`localSettings`,{enabledMcpjsonServers:[...r,e]}),n===`yes_all`&&N(`localSettings`,{enableAllProjectMcpServers:!0}),t();break}case`no`:{let n=(vn()||{}).disabledMcpjsonServers||[];n.includes(e)||N(`localSettings`,{disabledMcpjsonServers:[...n,e]}),t();break}}}return(0,Y.jsxs)(be,{title:`New MCP server found in .mcp.json: ${e}`,color:`warning`,onCancel:()=>n(`no`),children:[(0,Y.jsx)(td,{}),(0,Y.jsx)(jo,{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`)})]})}M(),z(),x(),P(),ki();function rd({serverNames:e,onDone:t}){function n(n){let r=vn()||{},i=r.enabledMcpjsonServers||[],a=r.disabledMcpjsonServers||[],[o,s]=Jt(e,e=>n.includes(e));B(`tengu_mcp_multidialog_choice`,{approved:o.length,rejected:s.length}),o.length>0&&N(`localSettings`,{enabledMcpjsonServers:[...new Set([...i,...o])]}),s.length>0&&N(`localSettings`,{disabledMcpjsonServers:[...new Set([...a,...s])]}),t()}let r=(0,Fu.useCallback)(()=>{let n=(vn()||{}).disabledMcpjsonServers||[];N(`localSettings`,{disabledMcpjsonServers:[...new Set([...n,...e])]}),t()},[e,t]);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(be,{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)(td,{}),(0,Y.jsx)(Ac,{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)(ve,{dimColor:!0,italic:!0,children:(0,Y.jsxs)(b,{children:[(0,Y.jsx)(xe,{shortcut:`Space`,action:`select`}),(0,Y.jsx)(xe,{shortcut:`Enter`,action:`confirm`}),(0,Y.jsx)(Ni,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`reject all`})]})})})]})}vs();async function id(e){let{servers:t}=kc(`project`),n=Object.keys(t).filter(e=>Ri(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)(zo,{children:(0,Y.jsx)(Pa,{children:(0,Y.jsx)(nd,{serverName:t,onDone:r})})}))}else e.render((0,Y.jsx)(zo,{children:(0,Y.jsx)(Pa,{children:(0,Y.jsx)(rd,{serverNames:n,onDone:r})})}))})}Qs(),ss(),Wa(),ol(),Po(),cc(),I(),cr();var ad={iterm:`iTerm`,"iterm.app":`iTerm`,ghostty:`Ghostty`,kitty:`kitty`,alacritty:`Alacritty`,wezterm:`WezTerm`,apple_terminal:`Terminal`};function od(){if(process.platform!==`darwin`)return;let e=process.env.TERM_PROGRAM;if(!e)return;let t=ad[e.toLowerCase()];t&&j().deepLinkTerminal!==t&&(E(e=>({...e,deepLinkTerminal:t})),L(`Stored deep link terminal preference: ${t}`))}var sd=class{constructor(){te(this,`frameDurations`,[]),te(this,`firstRenderTime`,void 0),te(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(),lc(),T(),x(),Wi(),vs(),I(),p(),Za(),xs(),P();function cd(){E(e=>({...e,hasCompletedOnboarding:!0,lastOnboardingVersion:`2.8.0`}))}function ld(e,t){return new Promise(n=>{e.render(t(e=>void n(e)))})}async function X(e,t,n){return ud(e,t,{color:`error`,beforeExit:n})}async function ud(e,t,n){let{Text:r}=await import(`./src-BJM0zMNO.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 ld(e,e=>(0,Y.jsx)(_e,{initialState:j().theme,onThemeSave:e=>E(t=>({...t,theme:e})),children:(0,Y.jsx)(zo,{onChangeAppState:n?.onChangeAppState,children:(0,Y.jsx)(Pa,{children:t(e)})})}))}async function dd(e,t){e.render(t),Fp(),await e.waitUntilExit(),await W(0)}async function fd(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-BZUXID6q.js`);await Z(e,e=>(0,Y.jsx)(t,{onDone:()=>{cd(),e()}}),{onChangeAppState:Bl})}if(!m(process.env.CLAUBBIT)){if(!Qt()){let{TrustDialog:t}=await import(`./TrustDialog-CYdftZ1M.js`);await Z(e,e=>(0,Y.jsx)(t,{commands:r,onDone:e}))}Te(!0),ft(),lt(),Ji();let{errors:t}=Wo();if(t.length===0&&await id(e),await Jo()){let t=ta(await xo(!0)),{ClaudeMdExternalIncludesDialog:n}=await import(`./ClaudeMdExternalIncludesDialog-5FCT81WS.js`);await Z(e,e=>(0,Y.jsx)(n,{onDone:e,isStandaloneDialog:!0,externalIncludes:t}))}}if(Xl(),od(),Ei(),setImmediate(()=>Hu()),await bc()){let{GroveDialog:t}=await import(`./Grove-C_ocvHd3.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`,{}),wi(0),!1}if(process.env.ANTHROPIC_API_KEY&&!u()){let t=Gt(process.env.ANTHROPIC_API_KEY);if(jn(t)===`new`){let{ApproveApiKey:n}=await import(`./ApproveApiKey-oTZKoMvB.js`);await Z(e,e=>(0,Y.jsx)(n,{customApiKeyTruncated:t,onDone:e}),{onChangeAppState:Bl})}}if((t===`bypassPermissions`||n)&&!en()){let{BypassPermissionsModeDialog:t}=await import(`./BypassPermissionsModeDialog-C4z7RkFV.js`);await Z(e,e=>(0,Y.jsx)(t,{onAccept:e}))}if(a&&a.length>0){let{DevChannelsDialog:t}=await import(`./DevChannelsDialog-CfAuHVRL.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-CyVFdjBe.js`);await Z(e,e=>(0,Y.jsx)(t,{onDone:e}))}return s}function pd(e){let t=0,n=Yl(e);n.stdin&&B(`tengu_stdin_interactive`,{});let r=new sd,i=Jl();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&&pu(a,JSON.stringify({total:e.durationMs,...e.phases,rss:process.memoryUsage.rss(),cpu:process.cpuUsage()})+`
20
+ `),!pe())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}}}}}Wi();async function md(e,t){let{InvalidSettingsDialog:n}=await import(`./InvalidSettingsDialog-D8DwHiys.js`);return Z(e,e=>(0,Y.jsx)(n,{settingsErrors:t.settingsErrors,onContinue:e,onExit:t.onExit}))}async function hd(e,t){let{AssistantSessionChooser:n}=await import(`./AssistantSessionChooser-C67mOxVi.js`);return Z(e,e=>(0,Y.jsx)(n,{sessions:t.sessions,onSelect:t=>e(t),onCancel:()=>e(null)}))}async function gd(e){let{NewInstallWizard:t,computeDefaultInstallDir:n}=await import(`./assistant-CZ4VXgzH.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 _d(e){let{TeleportResumeWrapper:t}=await import(`./TeleportResumeWrapper-CxlpiHIz.js`);return Z(e,e=>(0,Y.jsx)(t,{onComplete:e,onCancel:()=>e(null),source:`cliArg`}))}async function vd(e,t){let{TeleportRepoMismatchDialog:n}=await import(`./TeleportRepoMismatchDialog-BKDaFT_L.js`);return Z(e,e=>(0,Y.jsx)(n,{targetRepo:t.targetRepo,initialPaths:t.initialPaths,onSelectPath:e,onCancel:()=>e(null)}))}async function yd(e,t,n,r){let[i,{ResumeConversation:a},{App:o}]=await Promise.all([n,import(`./ResumeConversation-EpjJdFHu.js`),import(`./App-DJyiiVKi.js`)]);await dd(e,(0,Y.jsx)(o,{getFpsMetrics:t.getFpsMetrics,stats:t.stats,initialState:t.initialState,children:(0,Y.jsx)(Pa,{children:(0,Y.jsx)(a,{...r,worktreePaths:i})})}))}Nl();function bd(){let e=Pl([`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.8.0`,defaultEnabled:!0,mcpServers:{weixin:{type:`stdio`,command:e.execPath,args:e.args}}})}function xd(){bd()}ie(),El(),ql(),Uc(),zc();var Sd=5,Cd=30,wd=`After you finish implementing the change:
21
21
  1. **Simplify** — Invoke the \`${Pc}\` tool with \`skill: "simplify"\` to review and clean up your changes.
22
22
  2. **Run unit tests** — Run the project's test suite (check for package.json scripts, Makefile targets, or common commands like \`npm test\`, \`bun test\`, \`pytest\`, \`go test\`). If tests fail, fix them.
23
23
  3. **Test end-to-end** — Follow the e2e test recipe from the coordinator's prompt (below). If the recipe says to skip e2e for this unit, skip it.
@@ -95,7 +95,7 @@ When all agents have reported, render the final table and a one-line summary (e.
95
95
  Examples:
96
96
  /batch migrate from react to vue
97
97
  /batch replace all uses of lodash with native equivalents
98
- /batch add type annotations to all untyped function parameters`;function Od(){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 yr()?[{type:`text`,text:Td(t)}]:[{type:`text`,text:Ed}]:[{type:`text`,text:Dd}]}})}K();var kd=ne.map(e=>`mcp__claude-in-chrome__${e.name}`),Ad=`
98
+ /batch add type annotations to all untyped function parameters`;function Od(){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 yr()?[{type:`text`,text:Td(t)}]:[{type:`text`,text:Ed}]:[{type:`text`,text:Dd}]}})}K();var kd=re.map(e=>`mcp__claude-in-chrome__${e.name}`),Ad=`
99
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
100
 
101
101
  IMPORTANT: Start by calling mcp__claude-in-chrome__tabs_context_mcp to get information about the user's current browser tabs.
@@ -137,7 +137,7 @@ Remember that settings are in:
137
137
  3. Consider launching the ${Gs} subagent to understand the relevant Claude Code features
138
138
  4. Explain what you found in plain language
139
139
  5. Suggest concrete fixes or next steps
140
- `}]}})}lo(),Qr();var Fd=[`Global`,`Chat`,`Autocomplete`,`Confirmation`,`Help`,`Transcript`,`HistorySearch`,`Task`,`ThemePicker`,`Settings`,`Tabs`,`Attachments`,`Footer`,`MessageSelector`,`DiffDialog`,`ModelPicker`,`Select`,`Plugin`],Id={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`},Ld=`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.effortPanel:decrease.effortPanel:increase.effortPanel:home.effortPanel:end.effortPanel:confirm.effortPanel:cancel.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(`.`),Rd=Zr(()=>ce({context:y(Fd).describe(`UI context where these bindings apply. Global bindings work everywhere.`),bindings:ie(_().describe(`Keystroke pattern (e.g., "ctrl+k", "shift+tab")`),v([y(Ld),_().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`));Zr(()=>ce({$schema:_().optional().describe(`JSON Schema URL for editor validation`),$docs:_().optional().describe(`Documentation URL`),bindings:oe(Rd()).describe(`Array of keybinding blocks by context`)}).describe(`Claude Code keybindings configuration. Customize keyboard shortcuts by context.`)),K();function zd(){return nf([`Context`,`Description`],Fd.map(e=>[`\`${e}\``,Id[e]]))}function Bd(){let e={};for(let t of to)for(let[n,r]of Object.entries(t.bindings))r&&(e[r]||(e[r]={keys:[],context:t.context}),e[r].keys.push(n));return nf([`Action`,`Default Key(s)`,`Context`],Ld.map(t=>{let n=e[t],r=n?n.keys.map(e=>`\`${e}\``).join(`, `):`(none)`,i=n?n.context:Vd(t);return[`\`${t}\``,r,i]}))}function Vd(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 Hd(){let e=[];e.push(`### Non-rebindable (errors)`);for(let t of Tc)e.push(`- \`${t.key}\` — ${t.reason}`);e.push(``),e.push(`### Terminal reserved (errors/warnings)`);for(let t of yi)e.push(`- \`${t.key}\` — ${t.reason} (${t.severity===`error`?`will not work`:`may conflict`})`);e.push(``),e.push(`### macOS reserved (errors)`);for(let t of Va)e.push(`- \`${t.key}\` — ${t.reason}`);return e.join(`
140
+ `}]}})}lo(),Qr();var Fd=[`Global`,`Chat`,`Autocomplete`,`Confirmation`,`Help`,`Transcript`,`HistorySearch`,`Task`,`ThemePicker`,`Settings`,`Tabs`,`Attachments`,`Footer`,`MessageSelector`,`DiffDialog`,`ModelPicker`,`Select`,`Plugin`],Id={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`},Ld=`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.effortPanel:decrease.effortPanel:increase.effortPanel:home.effortPanel:end.effortPanel:confirm.effortPanel:cancel.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(`.`),Rd=Zr(()=>le({context:v(Fd).describe(`UI context where these bindings apply. Global bindings work everywhere.`),bindings:ae(g().describe(`Keystroke pattern (e.g., "ctrl+k", "shift+tab")`),_([v(Ld),g().regex(/^command:[a-zA-Z0-9:\-_]+$/).describe(`Command binding (e.g., "command:help", "command:compact"). Executes the slash command as if typed.`),ue().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`));Zr(()=>le({$schema:g().optional().describe(`JSON Schema URL for editor validation`),$docs:g().optional().describe(`Documentation URL`),bindings:se(Rd()).describe(`Array of keybinding blocks by context`)}).describe(`Claude Code keybindings configuration. Customize keyboard shortcuts by context.`)),K();function zd(){return nf([`Context`,`Description`],Fd.map(e=>[`\`${e}\``,Id[e]]))}function Bd(){let e={};for(let t of to)for(let[n,r]of Object.entries(t.bindings))r&&(e[r]||(e[r]={keys:[],context:t.context}),e[r].keys.push(n));return nf([`Action`,`Default Key(s)`,`Context`],Ld.map(t=>{let n=e[t],r=n?n.keys.map(e=>`\`${e}\``).join(`, `):`(none)`,i=n?n.context:Vd(t);return[`\`${t}\``,r,i]}))}function Vd(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 Hd(){let e=[];e.push(`### Non-rebindable (errors)`);for(let t of Tc)e.push(`- \`${t.key}\` — ${t.reason}`);e.push(``),e.push(`### Terminal reserved (errors/warnings)`);for(let t of yi)e.push(`- \`${t.key}\` — ${t.reason} (${t.severity===`error`?`will not work`:`may conflict`})`);e.push(``),e.push(`### macOS reserved (errors)`);for(let t of Va)e.push(`- \`${t.key}\` — ${t.reason}`);return e.join(`
141
141
  `)}var Ud={$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`}}]},Wd={context:`Chat`,bindings:{"ctrl+s":null}},Gd={context:`Chat`,bindings:{"ctrl+g":null,"ctrl+e":`chat:externalEditor`}},Kd={context:`Global`,bindings:{"ctrl+k ctrl+t":`app:toggleTodos`}},qd=[`# 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
142
  `),Jd=[`## File Format`,``,"```json",nr(Ud,null,2),"```",``,"Always include the `$schema` and `$docs` fields."].join(`
143
143
  `),Yd=[`## 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(`
@@ -253,8 +253,87 @@ Review the same changes for efficiency:
253
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
254
 
255
255
  When done, briefly summarize what was fixed (or confirm the code was already clean).
256
- `;function lf(){G({name:`simplify`,description:`Review changed code for reuse, quality, and efficiency, then fix any issues found.`,userInvocable:!0,async getPromptForCommand(e){let t=cf;return e&&(t+=`\n\n## Additional Focus\n\n${e}`),[{type:`text`,text:t}]}})}$a(),K();function uf(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 df=`# Skillify {{userDescriptionBlock}}
256
+ `;function lf(){G({name:`simplify`,description:`Review changed code for reuse, quality, and efficiency, then fix any issues found.`,userInvocable:!0,async getPromptForCommand(e){let t=cf;return e&&(t+=`\n\n## Additional Focus\n\n${e}`),[{type:`text`,text:t}]}})}K();var uf=`# Using Artifacts
257
+
258
+ Artifacts are public HTML pages you upload to a hosting service. They have stable URLs that you can share with the user or open in a browser. Use them to surface work-in-progress, summaries, and reports.
259
+
260
+ ## When to use artifacts
261
+
262
+ **Good artifact content:**
263
+ - Progress panels / kanbans (task list with status)
264
+ - Research reports and analysis (data + findings + recommendations)
265
+ - Design docs / decision records (with context and rationale)
266
+ - Data visualizations (tables, SVG charts, flow diagrams)
267
+ - Final deliverables (the "thing the user asked for" rendered as HTML)
268
+
269
+ **Do NOT use artifacts for:**
270
+ - Code snippets — use files directly
271
+ - One-line answers — keep them in chat
272
+ - Internal debug logs — keep them in chat
273
+ - Large data dumps — link to source files instead
274
+
275
+ ## Cadence — when to upload
276
+
277
+ - **Task start**: if the task is complex (multi-step, research, deliverable), upload a skeleton artifact first as scaffolding (placeholder sections).
278
+ - **Milestones**: when you complete a phase (research done / implementation done / tests pass), update the artifact.
279
+ - **User asks**: upload immediately.
280
+ - **Task end**: ship the final artifact as the deliverable.
281
+
282
+ **Do NOT upload:**
283
+ - After every tool call (noise)
284
+ - Mid-step with no meaningful change (e.g. fixed a typo)
285
+
286
+ ## How to invoke (deferred tool)
287
+
288
+ \`artifact\` is a deferred tool. The first call requires two steps; subsequent calls one step.
289
+
290
+ **First upload (creates a new artifact):**
291
+ \`\`\`
292
+ 1. Use the Write tool to write HTML to a local file (location is your choice).
293
+ 2. SearchExtraTools({ query: "select:artifact" }) // loads the tool schema
294
+ 3. ExecuteExtraTool({ tool_name: "artifact", params: { file_path: "<absolute-path>.html" } })
295
+ 4. Save the returned \`id\` from the tool result — this is the hash.
296
+ \`\`\`
297
+
298
+ **Subsequent updates (overwrites in place, URL stays stable):**
299
+ \`\`\`
300
+ 1. Update the local HTML file.
301
+ 2. ExecuteExtraTool({ tool_name: "artifact", params: { file_path: "<absolute-path>.html", hash: "<id-from-first-call>" } })
302
+ \`\`\`
303
+
304
+ The URL returned on every call is the same when you pass the same \`hash\`. The user can open it at any time to see the latest version.
305
+
306
+ ## Minimal HTML skeleton
307
+
308
+ \`\`\`html
309
+ <!DOCTYPE html>
310
+ <html lang="en">
311
+ <head>
312
+ <meta charset="utf-8">
313
+ <title>Artifact Title</title>
314
+ <style>
315
+ body { font: 14px/1.5 -apple-system, sans-serif; max-width: 800px; margin: 2rem auto; padding: 0 1rem; }
316
+ h1, h2 { color: #1a1a1a; }
317
+ table { border-collapse: collapse; width: 100%; }
318
+ th, td { border: 1px solid #ddd; padding: 6px 10px; text-align: left; }
319
+ </style>
320
+ </head>
321
+ <body>
322
+ <h1>Artifact Title</h1>
323
+ <!-- content here -->
324
+ </body>
325
+ </html>
326
+ \`\`\`
327
+
328
+ The hosting service serves the HTML verbatim (including any \`<script>\` you include), so you can use vanilla JS/SVG/CSS as needed. Do not embed secrets.
329
+
330
+ ## Notes
331
+
332
+ - Artifacts expire (default 7 days; pass \`ttl: 30\` for 30-day retention).
333
+ - Anyone with the URL can view the artifact — treat the URL as the secret.
334
+ - The \`/artifacts\` slash command (user-invoked) shows all artifacts uploaded in the current session.
335
+ `;function df(){G({name:`use-artifacts`,description:`Teach the agent when and how to use the artifact tool: what content belongs in artifacts, when to upload/update, and the SearchExtraTools + ExecuteExtraTool invocation flow for the deferred artifact tool.`,whenToUse:`Use this skill at the start of any complex task that would benefit from a living progress document or a deliverable HTML report.`,userInvocable:!0,argumentHint:`[optional focus note]`,async getPromptForCommand(e){let t=uf;return e&&e.trim().length>0&&(t+=`\n\n## Additional Focus\n\n${e.trim()}\n`),[{type:`text`,text:t}]}})}$a(),K();function ff(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(`
336
+ `):``}).filter(e=>e.trim().length>0)}var pf=`# Skillify {{userDescriptionBlock}}
258
337
 
259
338
  You are capturing this session's repeatable process as a reusable skill.
260
339
 
@@ -388,11 +467,11 @@ After writing, tell the user:
388
467
  - Where the skill was saved
389
468
  - How to invoke it: \`/{{skill-name}} [arguments]\`
390
469
  - That they can edit the SKILL.md directly to refine it
391
- `;function ff(){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 _c()??`No session memory available.`,r=uf(Ma(t.messages)),i=e?`The user described this process as: "${e}"`:``;return[{type:`text`,text:df.replace(`{{sessionMemory}}`,n).replace(`{{userMessages}}`,r.join(`
470
+ `;function mf(){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 _c()??`No session memory available.`,r=ff(Ma(t.messages)),i=e?`The user described this process as: "${e}"`:``;return[{type:`text`,text:pf.replace(`{{sessionMemory}}`,n).replace(`{{userMessages}}`,r.join(`
392
471
 
393
472
  ---
394
473
 
395
- `)).replace(`{{userDescriptionBlock}}`,i)}]}})}K();var pf=`# /stuck — diagnose frozen/slow Claude Code sessions
474
+ `)).replace(`{{userDescriptionBlock}}`,i)}]}})}K();var hf=`# /stuck — diagnose frozen/slow Claude Code sessions
396
475
 
397
476
  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
477
 
@@ -445,7 +524,7 @@ If Slack MCP isn't available, format the report as a message the user can copy-p
445
524
  ## Notes
446
525
  - Don't kill or signal any processes — this is diagnostic only.
447
526
  - If the user gave an argument (e.g., a specific PID or symptom), focus there first.
448
- `;function mf(){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=pf;return e&&(t+=`\n## User-provided context\n\n${e}\n`),[{type:`text`,text:t}]}})}K();var hf=`# /ultracode — Workflow Orchestration Playbook
527
+ `;function gf(){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=hf;return e&&(t+=`\n## User-provided context\n\n${e}\n`),[{type:`text`,text:t}]}})}K();var _f=`# /ultracode — Workflow Orchestration Playbook
449
528
 
450
529
  Execute a workflow script that orchestrates multiple subagents deterministically. Workflows run in the background — this tool returns immediately with a task ID, and a \`<task-notification>\` arrives when the workflow completes. Use \`/workflows\` to watch live progress.
451
530
 
@@ -649,21 +728,21 @@ Use this tool for multi-step orchestration where control flow should be determin
649
728
  ## Resume
650
729
 
651
730
  The tool result includes a runId. To resume after a pause, kill, or script edit, relaunch with \`Workflow({scriptPath, resumeFromRunId})\` — the longest unchanged prefix of agent() calls returns cached results instantly; the first edited/new call and everything after it runs live. Same script + same args → 100% cache hit. Date.now()/Math.random()/new Date() are unavailable in scripts (they would break this) — stamp results after the workflow returns, or pass timestamps via args. Fallback when no journal is available: Read agent-<id>.jsonl files in the transcript directory and hand-author a continuation script.
652
- `;function gf(){G({name:`ultracode`,description:`Enter multi-agent workflow orchestration mode: when to use the Workflow tool, script primitives, quality patterns, determinism constraints, resume/budget, and files/commands.`,whenToUse:`When a task can be decomposed or parallelized, needs multi-perspective confidence (e.g. find then adversarially verify), exceeds a single context (large migrations, broad audits, long-tail enumeration), or needs resume/auditability — orchestrate multiple subagents with the Workflow tool.`,userInvocable:!0,async getPromptForCommand(e){let t=hf;return e&&(t+=`\n## User input\n\n${e}\n`),[{type:`text`,text:t}]}})}Fc(),K();function _f(){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 vf(){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 ${qc} with id "${t}" to cancel that scheduled job. Confirm the result to the user.`}]:[{type:`text`,text:`Usage: /cron-delete <job-id>
731
+ `;function vf(){G({name:`ultracode`,description:`Enter multi-agent workflow orchestration mode: when to use the Workflow tool, script primitives, quality patterns, determinism constraints, resume/budget, and files/commands.`,whenToUse:`When a task can be decomposed or parallelized, needs multi-perspective confidence (e.g. find then adversarially verify), exceeds a single context (large migrations, broad audits, long-tail enumeration), or needs resume/auditability — orchestrate multiple subagents with the Workflow tool.`,userInvocable:!0,async getPromptForCommand(e){let t=_f;return e&&(t+=`\n## User input\n\n${e}\n`),[{type:`text`,text:t}]}})}Fc(),K();function yf(){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 bf(){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 ${qc} with id "${t}" to cancel that scheduled job. Confirm the result to the user.`}]:[{type:`text`,text:`Usage: /cron-delete <job-id>
653
732
 
654
- Provide the job ID to cancel. Use /cron-list to see active jobs and their IDs.`}]}})}Fc(),K();var yf=`10m`,bf=`Usage: /loop [interval] <prompt>
733
+ Provide the job ID to cancel. Use /cron-list to see active jobs and their IDs.`}]}})}Fc(),K();var xf=`10m`,Sf=`Usage: /loop [interval] <prompt>
655
734
 
656
735
  Run a prompt or slash command on a recurring interval.
657
736
 
658
737
  Intervals: Ns, Nm, Nh, Nd (e.g. 5m, 30m, 2h, 1d). Minimum granularity is 1 minute.
659
- If no interval is specified, defaults to ${yf}.
738
+ If no interval is specified, defaults to ${xf}.
660
739
 
661
740
  Examples:
662
741
  /loop 5m /babysit-prs
663
742
  /loop 30m check the deploy
664
743
  /loop 1h /standup 1
665
- /loop check the deploy (defaults to ${yf})
666
- /loop check the deploy every 20m`;function xf(e){return`# /loop — schedule a recurring prompt
744
+ /loop check the deploy (defaults to ${xf})
745
+ /loop check the deploy every 20m`;function Cf(e){return`# /loop — schedule a recurring prompt
667
746
 
668
747
  Parse the input below into \`[interval] <prompt…>\` and schedule it with ${Rc}.
669
748
 
@@ -671,7 +750,7 @@ Parse the input below into \`[interval] <prompt…>\` and schedule it with ${Rc}
671
750
 
672
751
  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.
673
752
  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.
674
- 3. **Default**: otherwise, interval is \`${yf}\` and the entire input is the prompt.
753
+ 3. **Default**: otherwise, interval is \`${xf}\` and the entire input is the prompt.
675
754
 
676
755
  If the resulting prompt is empty, show usage \`/loop [interval] <prompt>\` and stop — do not call ${Rc}.
677
756
 
@@ -679,8 +758,8 @@ Examples:
679
758
  - \`5m /babysit-prs\` → interval \`5m\`, prompt \`/babysit-prs\` (rule 1)
680
759
  - \`check the deploy every 20m\` → interval \`20m\`, prompt \`check the deploy\` (rule 2)
681
760
  - \`run tests every 5 minutes\` → interval \`5m\`, prompt \`run tests\` (rule 2)
682
- - \`check the deploy\` → interval \`${yf}\`, prompt \`check the deploy\` (rule 3)
683
- - \`check every PR\` → interval \`${yf}\`, prompt \`check every PR\` (rule 3 — "every" not followed by time)
761
+ - \`check the deploy\` → interval \`${xf}\`, prompt \`check the deploy\` (rule 3)
762
+ - \`check every PR\` → interval \`${xf}\`, prompt \`check every PR\` (rule 3 — "every" not followed by time)
684
763
  - \`5m\` → empty prompt → show usage
685
764
 
686
765
  ## Interval → cron
@@ -708,11 +787,11 @@ Supported suffixes: \`s\` (seconds, rounded up to nearest minute, min 1), \`m\`
708
787
 
709
788
  ## Input
710
789
 
711
- ${e}`}function Sf(){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:xf(t)}]:[{type:`text`,text:bf}]}})}Zt(),li(),Ka(),T(),K();var Cf=`# Dream: Memory Consolidation (manual run)
790
+ ${e}`}function wf(){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:Cf(t)}]:[{type:`text`,text:Sf}]}})}Zt(),li(),Ka(),T(),K();var Tf=`# Dream: Memory Consolidation (manual run)
712
791
 
713
792
  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.
714
793
 
715
- `;function wf(){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:()=>Dn(),async getPromptForCommand(e){let t=_n(),n=eo(Ye());await pc();let r=Cf+Ra(t,n,``);return e&&(r+=`\n\n## Additional context from user\n\n${e}`),[{type:`text`,text:r}]}})}ue(),Zn(),K();function Tf(){return nr(ae(Hn(),{io:`input`}),null,2)}var Ef=`## Settings File Locations
794
+ `;function Ef(){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:()=>Dn(),async getPromptForCommand(e){let t=_n(),n=eo(Ye());await pc();let r=Tf+Ra(t,n,``);return e&&(r+=`\n\n## Additional context from user\n\n${e}`),[{type:`text`,text:r}]}})}de(),Zn(),K();function Df(){return nr(oe(Hn(),{io:`input`}),null,2)}var Of=`## Settings File Locations
716
795
 
717
796
  Choose the appropriate file based on scope:
718
797
 
@@ -801,7 +880,7 @@ Plugin syntax: \`plugin-name@source\` where source is \`claude-code-marketplace\
801
880
  - \`spinnerVerbs\`: Customize spinner verbs (\`{ "mode": "append" | "replace", "verbs": [...] }\`)
802
881
  - \`spinnerTipsOverride\`: Override spinner tips (\`{ "excludeDefault": true, "tips": ["Custom tip"] }\`)
803
882
  - \`syntaxHighlightingDisabled\`: Disable diff highlighting
804
- `,Df=`## Hooks Configuration
883
+ `,kf=`## Hooks Configuration
805
884
 
806
885
  Hooks run commands at specific points in Claude Code's lifecycle.
807
886
 
@@ -958,7 +1037,7 @@ echo '{"systemMessage": "Session complete!"}'
958
1037
  }
959
1038
  }
960
1039
  \`\`\`
961
- `,Of='## 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',kf=`# Update Config Skill
1040
+ `,Af='## 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',jf=`# Update Config Skill
962
1041
 
963
1042
  Modify Claude Code configuration by updating settings.json files.
964
1043
 
@@ -1029,11 +1108,11 @@ When adding to permission arrays or hook arrays, **merge with existing**, don't
1029
1108
  }
1030
1109
  \`\`\`
1031
1110
 
1032
- ${Ef}
1111
+ ${Of}
1033
1112
 
1034
- ${Df}
1113
+ ${kf}
1035
1114
 
1036
- ${Of}
1115
+ ${Af}
1037
1116
 
1038
1117
  ## Example Workflows
1039
1118
 
@@ -1094,16 +1173,16 @@ If a hook isn't running:
1094
1173
  4. **Check hook type** - Is it "command", "prompt", or "agent"?
1095
1174
  5. **Test the command** - Run the hook command manually to see if it works
1096
1175
  6. **Use --debug** - Run \`claude --debug\` to see hook execution logs
1097
- `;function Af(){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=Df+`
1176
+ `;function Mf(){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=kf+`
1098
1177
 
1099
- `+Of;return t&&(n+=`\n\n## Task\n\n${t}`),[{type:`text`,text:n}]}let t=Tf(),n=kf;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 jf=`# CLI
1100
- `,Mf=`# Server
1101
- `,Nf=`# Skill
1102
- `,Pf={"examples/cli.md":jf,"examples/server.md":Mf};K();var{frontmatter:Ff,content:If}=Is(Nf),Lf=typeof Ff.description==`string`?Ff.description:`Verify a code change does what it should by running the app.`;function Rf(){process.env.USER_TYPE===`ant`&&G({name:`verify`,description:Lf,userInvocable:!0,files:Pf,async getPromptForCommand(e){let t=[If.trimStart()];return e&&t.push(`## User Request\n\n${e}`),[{type:`text`,text:t.join(`
1178
+ `+Af;return t&&(n+=`\n\n## Task\n\n${t}`),[{type:`text`,text:n}]}let t=Df(),n=jf;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 Nf=`# CLI
1179
+ `,Pf=`# Server
1180
+ `,Ff=`# Skill
1181
+ `,If={"examples/cli.md":Nf,"examples/server.md":Pf};K();var{frontmatter:Lf,content:Rf}=Is(Ff),zf=typeof Lf.description==`string`?Lf.description:`Verify a code change does what it should by running the app.`;function Bf(){process.env.USER_TYPE===`ant`&&G({name:`verify`,description:zf,userInvocable:!0,files:If,async getPromptForCommand(e){let t=[Rf.trimStart()];return e&&t.push(`## User Request\n\n${e}`),[{type:`text`,text:t.join(`
1103
1182
 
1104
- `)}]}})}var zf=i({registerScheduleRemoteAgentsSkill:()=>qf});function Bf(e){if(!e.startsWith(`mcpsrv_`))return null;let t=e.slice(7).slice(2),n=0n;for(let e of t){let t=Jf.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 Vf(e){let t=[];for(let n of e){if(n.type!==`connected`||n.config.type!==`claudeai-proxy`)continue;let e=Bf(n.config.id);e&&t.push({uuid:e,name:n.name,url:n.config.url})}return t}function Hf(e){return e.replace(/^claude[.\s-]ai[.\s-]/i,``).replace(/[^a-zA-Z0-9_-]/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``)}function Uf(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=Hf(n.name);t.push(`- ${n.name} (connector_uuid: ${n.uuid}, name: ${e}, url: ${n.url})`)}return t.join(`
1105
- `)}function Wf(e){return`⚠ Heads-up:\n${e.map(e=>`- ${e}`).join(`
1106
- `)}`}async function Gf(){let e=await Sr();if(!e)return null;let t=ml(e);return t?`https://${t.host}/${t.owner}/${t.name}`:null}function Kf(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${Wf(o)}\n`:``,u=o.length>0?`${Wf(o)}\n\n${Yf}`:Yf;return`# Schedule Remote Agents
1183
+ `)}]}})}var Vf=i({registerScheduleRemoteAgentsSkill:()=>Yf});function Hf(e){if(!e.startsWith(`mcpsrv_`))return null;let t=e.slice(7).slice(2),n=0n;for(let e of t){let t=Xf.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 Uf(e){let t=[];for(let n of e){if(n.type!==`connected`||n.config.type!==`claudeai-proxy`)continue;let e=Hf(n.config.id);e&&t.push({uuid:e,name:n.name,url:n.config.url})}return t}function Wf(e){return e.replace(/^claude[.\s-]ai[.\s-]/i,``).replace(/[^a-zA-Z0-9_-]/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``)}function Gf(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=Wf(n.name);t.push(`- ${n.name} (connector_uuid: ${n.uuid}, name: ${e}, url: ${n.url})`)}return t.join(`
1184
+ `)}function Kf(e){return`⚠ Heads-up:\n${e.map(e=>`- ${e}`).join(`
1185
+ `)}`}async function qf(){let e=await Sr();if(!e)return null;let t=ml(e);return t?`https://${t.host}/${t.owner}/${t.name}`:null}function Jf(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${Kf(o)}\n`:``,u=o.length>0?`${Kf(o)}\n\n${Zf}`:Zf;return`# Schedule Remote Agents
1107
1186
 
1108
1187
  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.
1109
1188
 
@@ -1254,8 +1333,8 @@ Minimum interval is 1 hour. \`*/30 * * * *\` will be rejected.
1254
1333
  - 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.
1255
1334
  - To delete a trigger, direct users to https://claude.ai/code/scheduled
1256
1335
  ${s?`- If the user's request seems to require GitHub repo access (e.g. cloning a repo, opening PRs, reading code), remind them that ${Kt(`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`}.`:``}
1257
- ${c?`\n## User Request\n\nThe user said: "${c}"\n\nStart by understanding their intent and working through the appropriate workflow above.`:``}`}function qf(){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:()=>Kt(`tengu_surreal_dali`,!1)&&ca(`allow_remote_sessions`),allowedTools:[is,Wc],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 pi()}catch(e){return L(`[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 ps(`claude-code-default`),n=[r]}catch(e){return L(`[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 pl();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 Ai(o.owner,o.name);if(!e){a=!0;let e=Kt(`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=Vf(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=Uf(s),u=await Gf(),d=[`Available environments:`];for(let e of n)d.push(`- ${e.name} (id: ${e.environment_id}, kind: ${e.kind})`);return[{type:`text`,text:Kf({userTimezone:c,connectorsInfo:l,gitRepoUrl:u,environmentsInfo:d.join(`
1258
- `),createdEnvironment:r,setupNotes:i,needsGitHubAccessReminder:a,userArgs:e})}]}})}var Jf,Yf,Xf=n((()=>{Mt(),_o(),Gc(),ko(),bn(),Da(),cr(),dl(),wr(),Zn(),ls(),K(),Jf=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,Yf=`What would you like to do with scheduled remote agents?`}));ql();function Zf(){Af(),tf(),Rf(),Pd(),of(),ff(),sf(),lf(),Od(),mf(),gf(),Sf(),_f(),vf(),wf();{let{registerScheduleRemoteAgentsSkill:t}=(Xf(),e(zf));t()}Gl()&&jd()}za(),ra(),js();async function Qf(){if(!await Mr(`gh`))return`not_installed`;let{exitCode:e}=await jr(`gh`,[`auth`,`token`],{stdout:`ignore`,stderr:`ignore`,timeout:5e3,reject:!1});return e===0?`authenticated`:`not_authenticated`}oc(),To(),rs(),z(),Ja();async function $f(e,t){let n=await ci(e),r=mc(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}})}so(),z(),mo(),Aa(),p(),Zn();function ep(e){e.command(`add <name> <commandOrUrl> [args...]`).description(`Add an MCP server to Claude Code.
1336
+ ${c?`\n## User Request\n\nThe user said: "${c}"\n\nStart by understanding their intent and working through the appropriate workflow above.`:``}`}function Yf(){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:()=>Kt(`tengu_surreal_dali`,!1)&&ca(`allow_remote_sessions`),allowedTools:[is,Wc],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 pi()}catch(e){return L(`[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 ps(`claude-code-default`),n=[r]}catch(e){return L(`[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 pl();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 Ai(o.owner,o.name);if(!e){a=!0;let e=Kt(`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=Uf(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=Gf(s),u=await qf(),d=[`Available environments:`];for(let e of n)d.push(`- ${e.name} (id: ${e.environment_id}, kind: ${e.kind})`);return[{type:`text`,text:Jf({userTimezone:c,connectorsInfo:l,gitRepoUrl:u,environmentsInfo:d.join(`
1337
+ `),createdEnvironment:r,setupNotes:i,needsGitHubAccessReminder:a,userArgs:e})}]}})}var Xf,Zf,Qf=n((()=>{Mt(),_o(),Gc(),ko(),bn(),Da(),cr(),dl(),wr(),Zn(),ls(),K(),Xf=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,Zf=`What would you like to do with scheduled remote agents?`}));ql();function $f(){Mf(),tf(),Bf(),Pd(),of(),mf(),sf(),lf(),df(),Od(),gf(),vf(),wf(),yf(),bf(),Ef();{let{registerScheduleRemoteAgentsSkill:t}=(Qf(),e(Vf));t()}Gl()&&jd()}za(),ra(),js();async function ep(){if(!await Mr(`gh`))return`not_installed`;let{exitCode:e}=await jr(`gh`,[`auth`,`token`],{stdout:`ignore`,stderr:`ignore`,timeout:5e3,reject:!1});return e===0?`authenticated`:`not_authenticated`}oc(),To(),rs(),z(),Ja();async function tp(e,t){let n=await ci(e),r=mc(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}})}so(),z(),mo(),Aa(),p(),Zn();function np(e){e.command(`add <name> <commandOrUrl> [args...]`).description(`Add an MCP server to Claude Code.
1259
1338
 
1260
1339
  Examples:
1261
1340
  # Add HTTP server:
@@ -1271,42 +1350,42 @@ Examples:
1271
1350
  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(!qo())).action(async(e,t,n,r)=>{let i=t,a=n;e?i||q(`Error: Command is required when server name is provided.
1272
1351
  Usage: claude mcp add <name> <command> [args...]`):q(`Error: Server name is required.
1273
1352
  Usage: claude mcp add <name> <command> [args...]`);try{let t=Ao(r.scope),n=sc(r.transport);r.xaa&&!qo()&&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`),bs()||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?gi(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 Zs():void 0,l={type:`sse`,url:i,headers:n,oauth:s};await ds(e,l,t),c&&Hs(e,l,c),process.stdout.write(`Added SSE MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${nr(n,null,2)}\n`)}else if(n===`http`){i||q(`Error: URL is required for HTTP transport.`);let n=r.header?gi(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 Zs():void 0,l={type:`http`,url:i,headers:n,oauth:s};await ds(e,l,t),c&&Hs(e,l,c),process.stdout.write(`Added HTTP MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${nr(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.
1274
- `),!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 ds(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`);Ll(`File modified: ${as(t)}`)}catch(e){q(e.message)}})}tc(),ir(),P();function tp(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=bs(),a=i?.issuer,o=i?.clientId,{error:s}=N(`userSettings`,{xaaIdp:{issuer:e.issuer,clientId:e.clientId,callbackPort:n}});if(s)return q(`Error writing settings: ${s.message}`);if(a&&(ns(a)===ns(e.issuer)?o!==e.clientId&&(Ms(a),Mo(a)):(Ms(a),Mo(a))),r){let{success:t,warning:n}=Rs(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.`)}Ll(`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=bs();if(!t)return q(`Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.`);if(e.idToken){let n=Es(t.issuer,e.idToken);return Ll(`id_token cached for ${t.issuer} (expires ${new Date(n).toISOString()})`)}if(e.force&&Ms(t.issuer),qs(t.issuer)!==void 0)return Ll(`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 cs({idpIssuer:t.issuer,idpClientId:t.clientId,idpClientSecret:Uo(t.issuer),callbackPort:t.callbackPort,onAuthorizationUrl:e=>{process.stdout.write(`If the browser did not open, visit:\n ${e}\n`)}}),Ll(`Logged in. MCP servers with --xaa will now authenticate silently.`)}catch(e){q(`IdP login failed: ${R(e)}`)}}),t.command(`show`).description(`Show the current IdP connection config`).action(()=>{let e=bs();if(!e)return Ll(`No XAA IdP connection configured.`);let t=Uo(e.issuer)!==void 0,n=qs(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`),Ll()}),t.command(`clear`).description(`Clear the IdP connection config and cached id_token`).action(()=>{let e=bs(),{error:t}=N(`userSettings`,{xaaIdp:void 0});if(t)return q(`Error writing settings: ${t.message}`);e&&(Ms(e.issuer),Mo(e.issuer)),Ll(`XAA IdP connection cleared`)})}_a();function np(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]}}zi(),Fs(),uo(),z(),I(),Ir(),P();function rp(){if(j().bypassPermissionsModeAccepted)try{en()||N(`userSettings`,{skipDangerousModePermissionPrompt:!0}),B(`tengu_migrate_bypass_permissions_accepted`,{}),E(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(),I(),Ir(),P();function ip(){let e=pn(),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=k(`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&&N(`localSettings`,a),(o.includes(`enableAllProjectMcpServers`)||o.includes(`enabledMcpjsonServers`)||o.includes(`disabledMcpjsonServers`))&&Nt(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`,{})}}P();function ap(){if(process.env.USER_TYPE!==`ant`)return;let e=k(`userSettings`)?.model;typeof e==`string`&&(e.startsWith(`fennec-latest[1m]`)?N(`userSettings`,{model:`opus[1m]`}):e.startsWith(`fennec-latest`)?N(`userSettings`,{model:`opus`}):(e.startsWith(`fennec-fast-latest`)||e.startsWith(`opus-4-5-fast`))&&N(`userSettings`,{model:`opus[1m]`,fastMode:!0}))}z(),I(),mt(),P();function op(){if(Dt()!==`firstParty`||!gt())return;let e=k(`userSettings`)?.model;e!==`claude-opus-4-20250514`&&e!==`claude-opus-4-1-20250805`&&e!==`claude-opus-4-0`&&e!==`claude-opus-4-1`||(N(`userSettings`,{model:`opus`}),E(e=>({...e,legacyOpusMigrationTimestamp:Date.now()})),B(`tengu_legacy_opus_migration`,{from_model:e}))}z(),O();function sp(){Tt()&&B(`tengu_opus_to_opus1m_migration`,{skipped:!0})}I();function cp(){E(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(),I(),P();function lp(){j().sonnet1m45MigrationComplete||(k(`userSettings`)?.model===`sonnet[1m]`&&N(`userSettings`,{model:`sonnet-4-5-20250929[1m]`}),He()===`sonnet[1m]`&&Qe(`sonnet-4-5-20250929[1m]`),E(e=>({...e,sonnet1m45MigrationComplete:!0})))}z(),bn(),I(),mt(),P();function up(){if(Dt()!==`firstParty`||!Wn()&&!cn()&&!tn())return;let e=k(`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]`);N(`userSettings`,{model:t?`sonnet[1m]`:`sonnet`}),j().numStartups>1&&E(e=>({...e,sonnet45To46MigrationTimestamp:Date.now()})),B(`tengu_sonnet45_to_46_migration`,{from_model:e,has_1m:t})}z(),I(),Ir(),P();function dp(){if(!j().hasResetAutoModeOptInForDefaultOffer&&vc()===`enabled`)try{let e=k(`userSettings`);e?.skipAutoPermissionPrompt&&e?.permissions?.defaultMode!==`auto`&&(N(`userSettings`,{skipAutoPermissionPrompt:void 0}),B(`tengu_migrate_reset_auto_opt_in_for_default_offer`,{})),E(e=>e.hasResetAutoModeOptInForDefaultOffer?e:{...e,hasResetAutoModeOptInForDefaultOffer:!0})}catch(e){H(Error(`Failed to reset auto mode opt-in: ${e}`))}}z(),bn(),I(),mt(),P();function fp(){if(!j().opusProMigrationComplete){if(Dt()!==`firstParty`||!Wn()){E(e=>({...e,opusProMigrationComplete:!0})),B(`tengu_reset_pro_to_opus_default`,{skipped:!0});return}if(vn()?.model===void 0){let e=Date.now();E(t=>({...t,opusProMigrationComplete:!0,opusProMigrationTimestamp:e})),B(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!1})}else E(e=>({...e,opusProMigrationComplete:!0})),B(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!0})}}ue(),Qr();var pp=Zr(()=>ce({session_id:_(),ws_url:_(),work_dir:_().optional()}));ir(),Zn();var mp=class extends Error{constructor(e){super(e),this.name=`DirectConnectError`}};async function hp({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:nr({cwd:n,...r&&{dangerously_skip_permissions:!0}})})}catch(t){throw new mp(`Failed to connect to server at ${e}: ${R(t)}`)}if(!a.ok)throw new mp(`Failed to create session: ${a.status} ${a.statusText}`);let o=pp().safeParse(await a.json());if(!o.success)throw new mp(`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 gp=i({isKairosEnabled:()=>_p});async function _p(){return!!Kt(`tengu_kairos_assistant`,!1)}var vp=n((()=>{Mt()}));Jr(),Dr(),vo(),Mt(),_o(),Bo(),bn(),I(),Za(),oo(),Rr(),Zn(),z(),T(),Os(),xe(),El(),ql(),p(),wr(),Ir(),O(),cc(),Vi(),P(),mo(),Aa(),tc(),ar(),cr(),ir(),lc(),bi(),vr(),Fl(),wa(),Fn(),ka(),U(`main_tsx_entry`),Yt(),Kn();var yp=()=>Gr(),bp=()=>qi(),xp=()=>Tl(),Sp=(wc(),e(Ba)),Cp=(jl(),e(Ml)),wp=(vp(),e(gp)),Tp=(si(),e(Ia));U(`main_tsx_imports_loaded`);function Ep(){try{let e=k(`policySettings`);if(e){let t=bt(e);B(`tengu_managed_settings_loaded`,{keyCount:t.length,keys:t.join(`,`)})}}catch{}}function Dp(){let e=ct(at()??dt());$f(mr(),xn(e,et())),Io().then(({enabled:e,errors:t})=>{let n=hi();Lo(e,n,Ea()),Sc(t,n)}).catch(e=>H(e))}function Op(){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 kp(){if(hn())return;let[e,t,n]=await Promise.all([yr(),br(),Qf()]);B(`tengu_startup_telemetry`,{is_git:e,worktree_count:t,gh_auth_status:n,sandbox_enabled:ga.isSandboxingEnabled(),are_unsandboxed_commands_allowed:ga.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:ga.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:A(),prefers_reduced_motion:St().prefersReducedMotion??!1,...Op()})}var Ap=11;function jp(){j().migrationVersion!==Ap&&(rp(),ip(),fp(),lp(),op(),up(),sp(),cp(),dp(),process.env.USER_TYPE===`ant`&&ap(),E(e=>e.migrationVersion===Ap?e:{...e,migrationVersion:Ap})),Il().catch(()=>{})}function Mp(){if(Re()){V(`info`,`prefetch_system_context_non_interactive`),Ji();return}Qt()?(V(`info`,`prefetch_system_context_has_trust`),Ji()):V(`info`,`prefetch_system_context_skipped_no_trust`)}function Np(){m(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||c()||(Xt(),io(),Mp(),iu(),m(process.env.CLAUDE_CODE_USE_BEDROCK)&&!m(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&Ln(),m(process.env.CLAUDE_CODE_USE_VERTEX)&&!m(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&zt(),Zc(mr(),AbortSignal.timeout(3e3),[]),ou(),gn(),ho.initialize(),c()||Ul.initialize(),process.env.USER_TYPE===`ant`&&import(`./eventLoopStallDetector-bYy0fesH.js`).then(e=>e.startEventLoopStallDetector()))}function Pp(e){try{let t=e.trim(),n=t.startsWith(`{`)&&t.endsWith(`}`),r;if(n)Hr(t)||(process.stderr.write(b.red(`Error: Invalid JSON provided to --settings
1275
- `)),process.exit(1)),r=Xi(`claude-settings`,`.json`,{contentHash:t}),Jn(r,t,`utf8`);else{let{resolvedPath:t}=fr(sr(),e);try{mu(t,`utf8`)}catch(e){throw Qn(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: ${R(e)}\n`)),process.exit(1)}}function Fp(e){try{De(F(e)),je()}catch(e){e instanceof Error&&H(e),process.stderr.write(b.red(`Error processing --setting-sources: ${R(e)}\n`)),process.exit(1)}}function Ip(){U(`eagerLoadSettings_start`);let e=np(`--settings`);e&&Pp(e);let t=np(`--setting-sources`);t!==void 0&&Fp(t),U(`eagerLoadSettings_end`)}function Lp(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},Rp={sessionId:void 0,discover:!1},$={host:void 0,cwd:void 0,permissionMode:void 0,dangerouslySkipPermissions:!1,local:!1,extraCliArgs:[],remoteBin:void 0};async function zp(){U(`main_function_start`),process.env.NoDefaultCurrentDirectoryInExePath=`1`,ed(),process.on(`exit`,()=>{Gp();try{let{peekWorkflowService:t}=(Ys(),e(ks));t()?.shutdown()}catch{}}),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-DL390ePs.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-ODoYZY8i.js`);t();let n=process.argv[e+1],{handleDeepLinkUri:r}=await import(`./protocolHandler-B7ybKpgJ.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-ODoYZY8i.js`);e();let{handleUrlSchemeLaunch:t}=await import(`./protocolHandler-B7ybKpgJ.js`),n=await t();process.exit(n??1)}}if(Rp){let e=process.argv.slice(2);if(e[0]===`assistant`){let t=e[1];t&&!t.startsWith(`-`)?(Rp.sessionId=t,e.splice(0,2),process.argv=[process.argv[0],process.argv[1],...e]):t||(Rp.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
1276
- `),wi(1);return}process.argv=[process.argv[0],process.argv[1],...n]}}let t=process.argv.slice(2),n=t.includes(`-p`)||t.includes(`--print`),r=t.includes(`--init-only`),i=t.some(e=>e.startsWith(`--sdk-url`)),a=m(process.env.CLAUDE_CODE_FORCE_INTERACTIVE),o=n||r||i||!a&&!process.stdout.isTTY;o&&$l(),Be(!o),Lp(o);let s=(()=>{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(s);let c=process.env.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT;c===`markdown`||c===`html`?Ue(c):!s.startsWith(`sdk-`)&&s!==`claude-desktop`&&s!==`local-agent`&&s!==`remote`&&Ue(`markdown`),process.env.CLAUDE_CODE_ENVIRONMENT_KIND===`bridge`&&C(`remote-control`),U(`main_client_type_determined`),Ip(),U(`main_before_run`),await Vp(),U(`main_after_run`)}async function Bp(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 _r(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.
1353
+ `),!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 ds(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`);Ll(`File modified: ${as(t)}`)}catch(e){q(e.message)}})}tc(),ir(),P();function rp(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=bs(),a=i?.issuer,o=i?.clientId,{error:s}=N(`userSettings`,{xaaIdp:{issuer:e.issuer,clientId:e.clientId,callbackPort:n}});if(s)return q(`Error writing settings: ${s.message}`);if(a&&(ns(a)===ns(e.issuer)?o!==e.clientId&&(Ms(a),Mo(a)):(Ms(a),Mo(a))),r){let{success:t,warning:n}=Rs(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.`)}Ll(`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=bs();if(!t)return q(`Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.`);if(e.idToken){let n=Es(t.issuer,e.idToken);return Ll(`id_token cached for ${t.issuer} (expires ${new Date(n).toISOString()})`)}if(e.force&&Ms(t.issuer),qs(t.issuer)!==void 0)return Ll(`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 cs({idpIssuer:t.issuer,idpClientId:t.clientId,idpClientSecret:Uo(t.issuer),callbackPort:t.callbackPort,onAuthorizationUrl:e=>{process.stdout.write(`If the browser did not open, visit:\n ${e}\n`)}}),Ll(`Logged in. MCP servers with --xaa will now authenticate silently.`)}catch(e){q(`IdP login failed: ${R(e)}`)}}),t.command(`show`).description(`Show the current IdP connection config`).action(()=>{let e=bs();if(!e)return Ll(`No XAA IdP connection configured.`);let t=Uo(e.issuer)!==void 0,n=qs(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`),Ll()}),t.command(`clear`).description(`Clear the IdP connection config and cached id_token`).action(()=>{let e=bs(),{error:t}=N(`userSettings`,{xaaIdp:void 0});if(t)return q(`Error writing settings: ${t.message}`);e&&(Ms(e.issuer),Mo(e.issuer)),Ll(`XAA IdP connection cleared`)})}_a();function ip(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]}}zi(),Fs(),uo(),z(),I(),Ir(),P();function ap(){if(j().bypassPermissionsModeAccepted)try{en()||N(`userSettings`,{skipDangerousModePermissionPrompt:!0}),B(`tengu_migrate_bypass_permissions_accepted`,{}),E(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(),I(),Ir(),P();function op(){let e=pn(),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=k(`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&&N(`localSettings`,a),(o.includes(`enableAllProjectMcpServers`)||o.includes(`enabledMcpjsonServers`)||o.includes(`disabledMcpjsonServers`))&&Nt(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`,{})}}P();function sp(){if(process.env.USER_TYPE!==`ant`)return;let e=k(`userSettings`)?.model;typeof e==`string`&&(e.startsWith(`fennec-latest[1m]`)?N(`userSettings`,{model:`opus[1m]`}):e.startsWith(`fennec-latest`)?N(`userSettings`,{model:`opus`}):(e.startsWith(`fennec-fast-latest`)||e.startsWith(`opus-4-5-fast`))&&N(`userSettings`,{model:`opus[1m]`,fastMode:!0}))}z(),I(),mt(),P();function cp(){if(Dt()!==`firstParty`||!gt())return;let e=k(`userSettings`)?.model;e!==`claude-opus-4-20250514`&&e!==`claude-opus-4-1-20250805`&&e!==`claude-opus-4-0`&&e!==`claude-opus-4-1`||(N(`userSettings`,{model:`opus`}),E(e=>({...e,legacyOpusMigrationTimestamp:Date.now()})),B(`tengu_legacy_opus_migration`,{from_model:e}))}z(),O();function lp(){Tt()&&B(`tengu_opus_to_opus1m_migration`,{skipped:!0})}I();function up(){E(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(),I(),P();function dp(){j().sonnet1m45MigrationComplete||(k(`userSettings`)?.model===`sonnet[1m]`&&N(`userSettings`,{model:`sonnet-4-5-20250929[1m]`}),He()===`sonnet[1m]`&&Qe(`sonnet-4-5-20250929[1m]`),E(e=>({...e,sonnet1m45MigrationComplete:!0})))}z(),bn(),I(),mt(),P();function fp(){if(Dt()!==`firstParty`||!Wn()&&!cn()&&!tn())return;let e=k(`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]`);N(`userSettings`,{model:t?`sonnet[1m]`:`sonnet`}),j().numStartups>1&&E(e=>({...e,sonnet45To46MigrationTimestamp:Date.now()})),B(`tengu_sonnet45_to_46_migration`,{from_model:e,has_1m:t})}z(),I(),Ir(),P();function pp(){if(!j().hasResetAutoModeOptInForDefaultOffer&&vc()===`enabled`)try{let e=k(`userSettings`);e?.skipAutoPermissionPrompt&&e?.permissions?.defaultMode!==`auto`&&(N(`userSettings`,{skipAutoPermissionPrompt:void 0}),B(`tengu_migrate_reset_auto_opt_in_for_default_offer`,{})),E(e=>e.hasResetAutoModeOptInForDefaultOffer?e:{...e,hasResetAutoModeOptInForDefaultOffer:!0})}catch(e){H(Error(`Failed to reset auto mode opt-in: ${e}`))}}z(),bn(),I(),mt(),P();function mp(){if(!j().opusProMigrationComplete){if(Dt()!==`firstParty`||!Wn()){E(e=>({...e,opusProMigrationComplete:!0})),B(`tengu_reset_pro_to_opus_default`,{skipped:!0});return}if(vn()?.model===void 0){let e=Date.now();E(t=>({...t,opusProMigrationComplete:!0,opusProMigrationTimestamp:e})),B(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!1})}else E(e=>({...e,opusProMigrationComplete:!0})),B(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!0})}}de(),Qr();var hp=Zr(()=>le({session_id:g(),ws_url:g(),work_dir:g().optional()}));ir(),Zn();var gp=class extends Error{constructor(e){super(e),this.name=`DirectConnectError`}};async function _p({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:nr({cwd:n,...r&&{dangerously_skip_permissions:!0}})})}catch(t){throw new gp(`Failed to connect to server at ${e}: ${R(t)}`)}if(!a.ok)throw new gp(`Failed to create session: ${a.status} ${a.statusText}`);let o=hp().safeParse(await a.json());if(!o.success)throw new gp(`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 vp=i({isKairosEnabled:()=>yp});async function yp(){return!!Kt(`tengu_kairos_assistant`,!1)}var bp=n((()=>{Mt()}));Jr(),Dr(),vo(),Mt(),_o(),Bo(),bn(),I(),Za(),oo(),Rr(),Zn(),z(),T(),Os(),x(),El(),ql(),p(),wr(),Ir(),O(),cc(),Vi(),P(),mo(),Aa(),tc(),ar(),cr(),ir(),lc(),bi(),vr(),Fl(),wa(),Fn(),ka(),U(`main_tsx_entry`),Yt(),Kn();var xp=()=>Gr(),Sp=()=>qi(),Cp=()=>Tl(),wp=(wc(),e(Ba)),Tp=(jl(),e(Ml)),Ep=(bp(),e(vp)),Dp=(si(),e(Ia));U(`main_tsx_imports_loaded`);function Op(){try{let e=k(`policySettings`);if(e){let t=bt(e);B(`tengu_managed_settings_loaded`,{keyCount:t.length,keys:t.join(`,`)})}}catch{}}function kp(){let e=ct(at()??dt());tp(mr(),xn(e,et())),Io().then(({enabled:e,errors:t})=>{let n=hi();Lo(e,n,Ea()),Sc(t,n)}).catch(e=>H(e))}function Ap(){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 jp(){if(hn())return;let[e,t,n]=await Promise.all([yr(),br(),ep()]);B(`tengu_startup_telemetry`,{is_git:e,worktree_count:t,gh_auth_status:n,sandbox_enabled:ga.isSandboxingEnabled(),are_unsandboxed_commands_allowed:ga.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:ga.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:A(),prefers_reduced_motion:St().prefersReducedMotion??!1,...Ap()})}var Mp=11;function Np(){j().migrationVersion!==Mp&&(ap(),op(),mp(),dp(),cp(),fp(),lp(),up(),pp(),process.env.USER_TYPE===`ant`&&sp(),E(e=>e.migrationVersion===Mp?e:{...e,migrationVersion:Mp})),Il().catch(()=>{})}function Pp(){if(Re()){V(`info`,`prefetch_system_context_non_interactive`),Ji();return}Qt()?(V(`info`,`prefetch_system_context_has_trust`),Ji()):V(`info`,`prefetch_system_context_skipped_no_trust`)}function Fp(){m(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||c()||(Xt(),io(),Pp(),iu(),m(process.env.CLAUDE_CODE_USE_BEDROCK)&&!m(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&Ln(),m(process.env.CLAUDE_CODE_USE_VERTEX)&&!m(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&zt(),Zc(mr(),AbortSignal.timeout(3e3),[]),ou(),gn(),ho.initialize(),c()||Ul.initialize(),process.env.USER_TYPE===`ant`&&import(`./eventLoopStallDetector-MNrFR4OH.js`).then(e=>e.startEventLoopStallDetector()))}function Ip(e){try{let t=e.trim(),n=t.startsWith(`{`)&&t.endsWith(`}`),r;if(n)Hr(t)||(process.stderr.write(y.red(`Error: Invalid JSON provided to --settings
1354
+ `)),process.exit(1)),r=Xi(`claude-settings`,`.json`,{contentHash:t}),Jn(r,t,`utf8`);else{let{resolvedPath:t}=fr(sr(),e);try{mu(t,`utf8`)}catch(e){throw Qn(e)&&(process.stderr.write(y.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(y.red(`Error processing settings: ${R(e)}\n`)),process.exit(1)}}function Lp(e){try{De(F(e)),je()}catch(e){e instanceof Error&&H(e),process.stderr.write(y.red(`Error processing --setting-sources: ${R(e)}\n`)),process.exit(1)}}function Rp(){U(`eagerLoadSettings_start`);let e=ip(`--settings`);e&&Ip(e);let t=ip(`--setting-sources`);t!==void 0&&Lp(t),U(`eagerLoadSettings_end`)}function zp(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},Bp={sessionId:void 0,discover:!1},$={host:void 0,cwd:void 0,permissionMode:void 0,dangerouslySkipPermissions:!1,local:!1,extraCliArgs:[],remoteBin:void 0};async function Vp(){U(`main_function_start`),process.env.NoDefaultCurrentDirectoryInExePath=`1`,ed(),process.on(`exit`,()=>{qp();try{let{peekWorkflowService:t}=(Ys(),e(ks));t()?.shutdown()}catch{}}),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-CVT_db9n.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-Bxgfx_nO.js`);t();let n=process.argv[e+1],{handleDeepLinkUri:r}=await import(`./protocolHandler-qwll5gSY.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-Bxgfx_nO.js`);e();let{handleUrlSchemeLaunch:t}=await import(`./protocolHandler-qwll5gSY.js`),n=await t();process.exit(n??1)}}if(Bp){let e=process.argv.slice(2);if(e[0]===`assistant`){let t=e[1];t&&!t.startsWith(`-`)?(Bp.sessionId=t,e.splice(0,2),process.argv=[process.argv[0],process.argv[1],...e]):t||(Bp.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
1355
+ `),wi(1);return}process.argv=[process.argv[0],process.argv[1],...n]}}let t=process.argv.slice(2),n=t.includes(`-p`)||t.includes(`--print`),r=t.includes(`--init-only`),i=t.some(e=>e.startsWith(`--sdk-url`)),a=m(process.env.CLAUDE_CODE_FORCE_INTERACTIVE),o=n||r||i||!a&&!process.stdout.isTTY;o&&$l(),Be(!o),zp(o);let s=(()=>{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(s);let c=process.env.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT;c===`markdown`||c===`html`?Ue(c):!s.startsWith(`sdk-`)&&s!==`claude-desktop`&&s!==`local-agent`&&s!==`remote`&&Ue(`markdown`),process.env.CLAUDE_CODE_ENVIRONMENT_KIND===`bridge`&&C(`remote-control`),U(`main_client_type_determined`),Rp(),U(`main_before_run`),await Up(),U(`main_after_run`)}async function Hp(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 _r(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.
1277
1356
  `),[e,n].filter(Boolean).join(`
1278
- `)}return e}async function Vp(){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 Mu().configureHelp(t()).enablePositionalOptions();U(`run_commander_initialized`),n.hook(`preAction`,async e=>{U(`preAction_start`),await Promise.all([Mn(),wt()]),U(`preAction_after_mdm`),await Vu(),U(`preAction_after_init`),m(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)||(process.title=`claude`);let{initSinks:t}=await import(`./sinks-CpuRIC3H.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),Ts(`preAction: --plugin-dir inline plugins`)),jp(),U(`preAction_after_migrations`),Go(),ea(),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($r)).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 Au(`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&&Cp&&Cp.markAssistantForced(),Cp&&(Cp.isAssistantForced()||n.assistant===!0)&&!n.agentId&&wp){if(!Qt())console.warn(b.yellow(`Assistant mode disabled: directory is not trusted. Accept the trust dialog and restart.`));else if(r=Cp.isAssistantForced()||await wp.isKairosEnabled(),r){let e=n;e.brief=!0,Me(!0),i=await Cp.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&&eu(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:ul: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=ya(_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
1279
- `)),process.exit(1)),Lr()===`windows`&&(process.stderr.write(b.red(`Error: --tmux is not supported on Windows
1280
- `)),process.exit(1)),await gs()||(process.stderr.write(b.red(`Error: tmux is not installed.\n${Li()}\n`)),process.exit(1)));let x;if(dn()){let e=Kp(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
1281
- `)),process.exit(1)),e.agentId&&e.agentName&&e.teamName&&yp().setDynamicTeamContext?.({agentId:e.agentId,agentName:e.agentName,teamName:e.teamName,color:e.agentColor,planModeRequired:e.planModeRequired??!1,parentSessionId:e.parentSessionId}),e.teammateMode&&xp().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))&&no(!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.
1282
- `)),process.exit(1)),!xe)){let e=Ko(re);e||(process.stderr.write(b.red(`Error: Invalid session ID. Must be a valid UUID.
1283
- `)),process.exit(1)),ms(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=$c();e||(process.stderr.write(b.red(`Error: Session token required for file downloads. CLAUDE_CODE_SESSION_ACCESS_TOKEN must be set.
1284
- `)),process.exit(1));let t=process.env.CLAUDE_CODE_REMOTE_SESSION_ID||Ee(),n=ua(Ie);n.length>0&&(ae=yo(n,{baseUrl:process.env.ANTHROPIC_BASE_URL||Tr().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.
1285
- `)),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.
1286
- `)),process.exit(1));try{ze=mu(du(n.systemPromptFile),`utf8`)}catch(e){Yn(e)===`ENOENT`&&(process.stderr.write(b.red(`Error: System prompt file not found: ${du(n.systemPromptFile)}\n`)),process.exit(1)),process.stderr.write(b.red(`Error reading system prompt file: ${R(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.
1287
- `)),process.exit(1));try{w=mu(du(n.appendSystemPromptFile),`utf8`)}catch(e){Yn(e)===`ENOENT`&&(process.stderr.write(b.red(`Error: Append system prompt file not found: ${du(n.appendSystemPromptFile)}\n`)),process.exit(1)),process.stderr.write(b.red(`Error reading append system prompt file: ${R(e)}\n`)),process.exit(1)}}if(dn()&&x?.agentId&&x?.agentName&&x?.teamName){let e=bp().TEAMMATE_SYSTEM_PROMPT_ADDENDUM;w=w?`${w}\n\n${e}`:e}let{mode:Be,notification:Ve}=qa({permissionModeCli:h,dangerouslySkipPermissions:s});it(Be===`bypassPermissions`),(n.enableAutoMode||h===`auto`||Be===`auto`||!h&&fs())&&Tp?.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=Hr(r);if(a){let t=co({configObject:a,filePath:`command line`,expandVars:!0,scope:`dynamic`});t.config?e=t.config.mcpServers:i=t.errors}else{let t=bo({filePath:du(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(`
1288
- `);L(`--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(xl))n=`Invalid MCP configuration: "${Sl}" is a reserved MCP name.`;else{let{isComputerUseMCPServer:t,COMPUTER_USE_MCP_SERVER_NAME:r}=await import(`./common-Bi4yZBkh.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}=Ui(ut(t,e=>({...e,scope:`dynamic`})));i.length>0&&process.stderr.write(`Warning: MCP ${ei(i.length,`server`)} blocked by enterprise policy: ${i.join(`, `)}\n`),T={...T,...r}}}let He=n;Ge(He.chrome);let Ue=Wl(He.chrome)&&(process.env.USER_TYPE===`ant`||an()),Xe=!Ue&&Gl();if(Ue){let e=Lr();try{B(`tengu_claude_in_chrome_setup`,{platform:e});let{mcpConfig:t,allowedTools:n,systemPrompt:r}=Kl();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}),L(`[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}=Kl();T={...T,...e};let t=Dl;w=w?`${w}\n\n${t}`:t}catch(e){L(`[Claude in Chrome] Error (auto-enable): ${e}`)}let et=n.strictMcpConfig||!1;if(Na()&&(et&&(process.stderr.write(b.red(`You cannot use --strict-mcp-config when an enterprise MCP config is present`)),process.exit(1)),T&&!xa(T)&&(process.stderr.write(b.red(`You cannot dynamically configure MCP servers when an enterprise MCP config is present`)),process.exit(1))),Lr()!==`unknown`&&!Re())try{let{getChicagoEnabled:e}=await import(`./gates-6amRNsYl.js`);if(e()){let{setupComputerUseMCP:e}=await import(`./setup-II1titXI.js`),{mcpConfig:t,allowedTools:n}=e();T={...T,...t},d.push(...n)}}catch(e){L(`[Computer Use MCP] Setup failed: ${R(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},st=n,ft=st.channels,mt=st.dangerouslyLoadDevelopmentChannels,gt=[];if(ft&&ft.length>0&&(gt=rt(ft,`--channels`),Le(gt)),C||mt&&mt.length>0&&(tt=rt(mt,`--dangerously-load-development-channels`)),gt.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:gt.length,dev_count:tt?.length??0,plugins:e(gt),dev_plugins:e(tt??[])})}if(u.length>0){let{BRIEF_TOOL_NAME:t,LEGACY_BRIEF_TOOL_NAME:n}=(ht(),e(yt)),{isBriefEntitled:r}=(Ls(),e(ts)),i=di(u);(i.includes(t)||i.includes(n))&&r()&&Ke(!0)}let vt=await Mi({allowedToolsCli:d,disallowedToolsCli:f,baseToolsCli:u,permissionMode:Be,allowDangerouslySkipPermissions:l,addDirs:ee}),D=vt.toolPermissionContext,{warnings:bt,dangerousPermissions:xt,overlyBroadBashPermissions:Ct}=vt;if(process.env.USER_TYPE===`ant`&&Ct.length>0){for(let e of Ct)L(`Ignoring overly broad shell permission ${e.ruleDisplay} from ${e.sourceDisplay}`);D=ha(D,Ct)}xt.length>0&&(D=ja(D)),bt.forEach(e=>{console.error(e)});let wt=C&&!et&&!Na()&&!c()?ia().then(e=>{let{allowed:t,blocked:n}=Ui(e);return n.length>0&&process.stderr.write(`Warning: claude.ai MCP ${ei(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),t}):Promise.resolve({});L(`[STARTUP] Loading MCP configs...`);let Tt=Date.now(),Et,Dt=(et||c()?Promise.resolve({servers:{}}):ma(T)).then(e=>(Et=Date.now()-Tt,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`)&&(hr(`Error: --include-partial-messages requires --print and --output-format=stream-json.`),process.exit(1)),n.sessionPersistence===!1&&!C&&(hr(`Error: --no-session-persistence can only be used with --print mode.`),process.exit(1));let O=await Bp(t||``,y??`text`);U(`action_after_input_prompt`),Up(n);let k=So(D);if(m(process.env.CLAUDE_CODE_COORDINATOR_MODE)){let{applyCoordinatorToolFilter:e}=await import(`./toolPool-BmA-BnAq.js`);k=e(k)}U(`action_tools_loaded`);let jt;if(jc({isNonInteractiveSession:C})&&n.jsonSchema&&(jt=Xn(n.jsonSchema)),jt){let e=Ic(jt);`tool`in e?(k=[...k,e.tool],B(`tengu_structured_output_enabled`,{schema_property_count:Object.keys(jt.properties||{}).length,has_required_fields:!!jt.required})):B(`tengu_structured_output_failure`,{error:`Invalid JSON schema`})}U(`action_before_setup`),L(`[STARTUP] Running setup()...`);let Mt=Date.now(),{setup:Nt}=await import(`./setup-DGkOT4DX.js`),Pt=mr();process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&(xd(),Zf());let Ft=Nt(Pt,Be,l,ve,_e,be,re?Ko(re):void 0,ye,void 0),It=ve?null:Do(Pt),Rt=ve?null:os(Pt);It?.catch(()=>{}),Rt?.catch(()=>{}),await Ft,L(`[STARTUP] setup() completed in ${Date.now()-Mt}ms`),U(`action_after_setup`);let zt=!!n.replayUserMessages;Re()&&(Ei(),Ji(),io(),ot());let Bt=n.name?.trim();Bt&&Xs(Bt);let Vt=n.model||process.env.ANTHROPIC_MODEL;process.env.USER_TYPE===`ant`&&Vt&&Vt!==`default`&&!zn(`tengu_ant_model_override`)&&j().cachedGrowthBookFeatures?.tengu_ant_model_override==null&&await lt();let Ht=n.model===`default`?dt():n.model,Ut=g===`default`?dt():g,Wt=ve?mr():Pt;L(`[STARTUP] Loading commands and agents...`);let Gt=Date.now(),[Jt,Yt]=await Promise.all([It??Do(Wt),Rt??os(Wt)]);L(`[STARTUP] Commands and agents loaded in ${Date.now()-Gt}ms`),U(`action_commands_loaded`);let Xt=[];if(oe)try{let e=Hr(oe);e&&(Xt=Ns(e,`flagSettings`))}catch(e){H(e)}let Zt=[...Yt.allAgents,...Xt],$t={...Yt,allAgents:Zt,activeAgents:Vs(Zt)},en=se??St().agent,A;if(en&&(A=$t.activeAgents.find(e=>e.agentType===en),A||L(`Warning: agent "${en}" not found. Available agents: ${$t.activeAgents.map(e=>e.agentType).join(`, `)}. Using default behavior.`)),Je(A?.agentType),A&&B(`tengu_agent_flag`,{agentType:Us(A)?A.agentType:`custom`,...se&&{source:`cli`}}),A?.agentType&&Fo(A.agentType),C&&A&&!ze&&!Us(A)){let e=A.getSystemPrompt();e&&(ze=e)}A?.initialPrompt&&(typeof O==`string`?O=O?`${A.initialPrompt}\n\n${O}`:A.initialPrompt:O||(O=A.initialPrompt));let tn=Ht;!tn&&A?.model&&A.model!==`inherit`&&(tn=ct(A.model)),Qe(tn),Ae(kt()||null);let nn=at(),rn=ct(nn??dt()),on;if(Xa()){let e=hc()?n.advisor:void 0;e&&(L(`[AdvisorTool] --advisor ${e}`),ji(rn)||(process.stderr.write(b.red(`Error: The model "${rn}" does not support the advisor tool.\n`)),process.exit(1)),Fi(qn(ct(e)))||(process.stderr.write(b.red(`Error: The model "${e}" cannot be used as an advisor.\n`)),process.exit(1))),on=hc()?e??Ga():e,on&&L(`[AdvisorTool] Advisor model: ${on}`)}if(dn()&&x?.agentId&&x?.agentName&&x?.teamName&&x?.agentType){let e=$t.activeAgents.find(e=>e.agentType===x.agentType);if(e){let t;if(e.source===`built-in`?L(`[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 L(`[teammate] Custom agent ${x.agentType} not found in available agents`)}if(Wp(n),!Re()&&!Ze()&&St().defaultView===`chat`){let{isBriefEntitled:t}=(Ls(),e(ts));t()&&Ke(!0)}if((n.proactive||m(process.env.CLAUDE_CODE_PROACTIVE))&&!Sp?.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. ${(Ls(),e(ts)).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&&Cp){let e=Cp.getAssistantSystemPromptAddendum();w=w?`${w}\n\n${e}`:e}let M,cn,ln;if(!C){let e=pd(!1);cn=e.getFpsMetrics,ln=e.stats,process.env.USER_TYPE===`ant`&&Vl();let{createRoot:n}=await import(`./src-poaoYkuc.js`);M=await n(e.renderOptions),B(`tengu_timer`,{event:`startup`,durationMs:Math.round(process.uptime()*1e3)}),L(`[STARTUP] Running showSetupScreens()...`);let r=Date.now(),i=await fd(M,Be,l,Jt,Ue,tt);if(L(`[STARTUP] showSetupScreens() completed in ${Date.now()-r}ms`),De!==void 0){let{getBridgeDisabledReason:e}=await import(`./bridgeEnabled-DLRIH243.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&&($o(),wo(),Gn(),Lt(),import(`./trustedDevice-CYR5AgSB.js`).then(e=>(e.clearTrustedDeviceToken(),e.enrollTrustedDevice())));let a=await Ot();a.valid||await X(M,a.message)}if(process.exitCode!==void 0){L(`Graceful shutdown initiated, skipping further initialization`);return}if(fo(),!C){let{errors:e}=sn(),t=e.filter(e=>!e.mcpErrorMetadata);t.length>0&&await md(M,{settingsErrors:t,onExit:()=>wi(1)})}let fn=Kt(`tengu_cicada_nap_ms`,0),pn=j().startupPrefetchedAt??0;c()||fn>0&&Date.now()-pn<fn?(L(`Skipping startup prefetches, last ran ${Math.round((Date.now()-pn)/1e3)}s ago`),At()):(L(`Starting background startup prefetches${pn>0?` last ran ${Math.round((Date.now()-pn)/1e3)}s ago`:``}`),As().catch(e=>H(e)),Ju(),kl(),Kt(`tengu_miraculo_the_bard`,!1)?At():pt(),fn>0&&E(e=>({...e,startupPrefetchedAt:Date.now()}))),C||au();let{servers:N}=await Dt;L(`[STARTUP] MCP configs resolved in ${Et}ms (awaited at +${Date.now()-Tt}ms)`);let hn={...N,...T},gn={},_n={};for(let[e,t]of Object.entries(hn)){let n=t;n.type===`sdk`?gn[e]=n:_n[e]=n}U(`action_mcp_configs_loaded`);let vn=C?Promise.resolve({clients:[],tools:[],commands:[]}):Ds(_n),yn=C?Promise.resolve({clients:[],tools:[],commands:[]}):wt.then(e=>Object.keys(e).length>0?Ds(e):{clients:[],tools:[],commands:[]}),bn=Promise.all([vn,yn]).then(([e,t])=>({clients:[...e.clients,...t.clients],tools:mn([...e.tools,...t.tools],`name`),commands:mn([...e.commands,...t.commands],`name`)})),P=de||ue||fe||C||n.continue||n.resume?null:ui(`startup`,{agentType:A?.agentType,model:rn}),xn=[];bn.catch(()=>{});let Sn=[],Cn=[],wn=[],Tn=Dc(),F=Tn===!1?{type:`disabled`}:{type:`adaptive`};if(n.thinking===`adaptive`||n.thinking===`enabled`)Tn=!0,F={type:`adaptive`};else if(n.thinking===`disabled`)Tn=!1,F={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,F={type:`enabled`,budgetTokens:e}):e===0&&(Tn=!1,F={type:`disabled`}))}V(`info`,`started`,{version:`2.7.2`,is_native_binary:Or()}),rr(async()=>{V(`info`,`exited`)}),Hp({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(hn).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:F,assistantActivationPath:r?Cp?.getAssistantActivationPath():void 0}),Ho(_n,D),Sa(null,`initialization`),Ep(),gc().then(e=>{e&&(Bt&&dc(Bt),ic().then(e=>{e>=2&&B(`tengu_concurrent_sessions`,{num_sessions:e})}))}),c()||(C?(await Ca(),U(`action_after_plugins_init`),Cs().then(()=>na())):Ca().then(async()=>{U(`action_after_plugins_init`),await Cs(),na()}));let En=de||ue?`init`:fe?`maintenance`:null;if(de){Ei(),await Zo(`init`,{forceSyncExecution:!0}),await ui(`startup`,{forceSyncExecution:!0}),wi(0);return}if(C){(v===`stream-json`||v===`json`)&&lr(!0),Ei(),Hu();let e=n.continue||n.resume||S||En?void 0:ui(`startup`);e?.catch(()=>{}),U(`before_validateForceLoginOrg`);let t=await Ot();t.valid||(process.stderr.write(t.message+`
1289
- `),process.exit(1));let i=pe?[]:Jt.filter(e=>e.type===`prompt`&&!e.disableNonInteractive||e.type===`local`&&e.supportsNonInteractive),a=yc(),o=_s({...a,mcp:{...a.mcp,clients:Sn,commands:wn,tools:Cn},toolPermissionContext:D,effortValue:mi(n.effort)??Di(),...Vn()&&{fastMode:un(tn??null)},...Xa()&&on&&{advisorModel:on},kairosEnabled:r},Bl);da(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(_t(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}))]}})),Yo(({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:mn([...r.mcp.tools,...t],`name`),commands:mn([...r.mcp.commands,...n],`name`)}}))},e).catch(e=>L(`[MCP] ${t} connect error: ${e}`)));U(`before_connectMcp`),await s(_n,`regular`),U(`after_connectMcp`);let l=5e3,u=wt.then(e=>{if(Object.keys(e).length>0){let t=new Set;for(let n of Object.values(e)){let e=Si(n);e&&t.add(e)}let n=new Set;for(let[e,r]of Object.entries(_n)){if(!e.startsWith(`plugin:`))continue;let i=Si(r);i&&t.has(i)&&n.add(e)}if(n.size>0){L(`[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,aa(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=Cc(i,e),a=Ro(a,e);return{...e,mcp:{...e.mcp,clients:t,tools:r,commands:i,resources:a}}})}}let{servers:t}=Ta(e,Un(_n,(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&&L(`[MCP] claude.ai connectors not ready after ${l}ms — proceeding; background connection continues`),U(`after_connectMcp_claudeai`),c()||(Np(),import(`./backgroundHousekeeping-D-jt-ocx.js`).then(e=>e.startBackgroundHousekeeping()),process.env.USER_TYPE===`ant`&&import(`./sdkHeapDumpMonitor-DLMMNeqo.js`).then(e=>e.startSdkMemoryMonitor())),Dp(),U(`before_print_import`);let{runHeadless:m}=await import(`./print-kxnXkqGc.js`);U(`after_print_import`),m(O,()=>o.getState(),o.setState,i,k,gn,$t.activeAgents,{continue:n.continue,resume:n.resume,verbose:ce,outputFormat:v,jsonSchema:jt,permissionPromptToolName:n.permissionPromptTool,allowedTools:d,thinkingConfig:F,maxTurns:n.maxTurns,maxBudgetUsd:n.maxBudgetUsd,taskBudget:n.taskBudget?{total:n.taskBudget}:void 0,systemPrompt:ze,appendSystemPrompt:w,userSpecifiedModel:tn,fallbackModel:Ut,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:kn(),agent:en});let Dn=tu(rn),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`}),Ct.length>0){let e=Ur(Ct.map(e=>e.ruleDisplay)),t=e.join(`, `),n=Ur(Ct.map(e=>e.sourceDisplay)).join(`, `),r=e.length;On.push({key:`overly-broad-bash-notification`,text:`${t} allow ${ei(r,`rule`)} from ${n} ${ei(r,`was`,`were`)} ignored \u2014 not available for Ants, please use auto-mode instead`,color:`warning`,priority:`high`})}let An=yp(),jn={...D,mode:dn()&&An?.isPlanModeRequired?.()?`plan`:D.mode},Mn=Ze(),Nn=je||qt()||r,Pn={settings:St(),tasks:{},agentNameRegistry:new Map,verbose:ce??j().verbose??!1,mainLoopModel:nn,mainLoopModelForSession:null,isBriefOnly:Mn,expandedView:j().showSpinnerTree?`teammates`:j().showExpandedTodos?`tasks`:`none`,showTeammateMessagePreview:dn()?!1:void 0,selectedIPAgentIndex:-1,selectedBgAgentIndex:-1,coordinatorTaskIndex:-1,viewSelectionMode:`none`,footerSelection:null,toolPermissionContext:jn,agent:A?.agentType,agentDefinitions:$t,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:sl(),thinkingEnabled:Tn,promptSuggestionEnabled:Ya(),sessionHooks:new Map,inbox:{messages:[]},promptSuggestion:{text:null,promptId:null,shownAt:0,acceptedAt:0,generationRequestId:null},speculation:nc,speculationSessionTimeSavedMs:0,skillImprovement:{suggestion:null},workerSandboxPermissions:{queue:[],selectedIndex:0},pendingWorkerRequest:null,pendingSandboxRequest:null,authVersion:0,initialMessage:O?{message:Ii({content:String(O)})}:null,effortValue:mi(n.effort)??Di(),activeOverlays:new Set,fastMode:un(rn),...Xa()&&on&&{advisorModel:on},teamContext:i??nu()};O&&vi(String(O));let Fn=Cn;E(e=>({...e,numStartups:(e.numStartups??0)+1})),setImmediate(()=>{kp(),Dp()});let In=process.env.USER_TYPE===`ant`?import(`./sessionDataUploader-CsNePsOb.js`):null,Ln=In?In.then(e=>e.createSessionTurnUploader()).catch(()=>null):null,Rn={debug:a||o,commands:[...Jt,...wn],initialTools:Fn,mcpClients:Sn,autoConnectIdeFlag:ne,mainThreadAgentDefinition:A,disableSlashCommands:pe,dynamicMcpConfig:T,strictMcpConfig:et,systemPrompt:ze,appendSystemPrompt:w,taskListId:he,thinkingConfig:F,...Ln&&{onTurnComplete:e=>{Ln.then(t=>t?.(e))}}},Bn={modeApi:Sp,mainThreadAgentDefinition:A,agentDefinitions:$t,currentCwd:Wt,cliAgents:Xt,initialState:Pn};if(n.continue){let e=!1;try{let t=performance.now(),{clearSessionCaches:r}=await import(`./caches-DMYdTEAr.js`);r();let i=await Eo(void 0,void 0);if(!i)return B(`tengu_continue`,{success:!1}),await X(M,`No conversation found to continue`);let a=await Hl(i,{forkSession:!!n.forkSession,includeAttribution:!0,transcriptPath:i.fullPath},Bn);a.restoredAgentDef&&(A=a.restoredAgentDef),Up(n),Wp(n),B(`tengu_continue`,{success:!0,resume_duration_ms:Math.round(performance.now()-t)}),e=!0,await Gu(M,{getFpsMetrics:cn,stats:ln,initialState:a.initialState},{...Rn,mainThreadAgentDefinition:a.restoredAgentDef??A,initialMessages:a.messages,initialFileHistorySnapshots:a.fileHistorySnapshots,initialContentReplacements:a.contentReplacements,initialAgentName:a.agentName,initialAgentColor:a.agentColor},dd)}catch(t){e||B(`tengu_continue`,{success:!1}),H(t),process.exit(1)}}else if(Q?.url){let e;try{let t=await hp({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(M,e instanceof mp?e.message:String(e),()=>W(1))}let t=Oi(`Connected to server at ${Q.url}\nSession: ${e.sessionId}`,`info`);await Gu(M,{getFpsMetrics:cn,stats:ln,initialState:Pn},{debug:a||o,commands:Jt,initialTools:[],initialMessages:[t],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:A,disableSlashCommands:pe,directConnectConfig:e,thinkingConfig:F},dd);return}else if($?.host){let{createSSHSession:e,createLocalSSHSession:t,SSHSessionError:n}=await import(`./createSSHSession-B1hTuDpB.js`),r;try{if($.local)process.stderr.write(`Starting local ssh-proxy test session...
1290
- `),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.7.2`,permissionMode:$.permissionMode,dangerouslySkipPermissions:$.dangerouslySkipPermissions,extraCliArgs:$.extraCliArgs,remoteBin:$.remoteBin},t?{onProgress:e=>{n=!0,process.stderr.write(`\r ${e}\x1b[K`)}}:{}),n&&process.stderr.write(`
1291
- `)}qe(r.remoteCwd),Pe(r.remoteCwd),Fe($.local?`local`:$.host)}catch(e){return await X(M,e instanceof n?e.message:String(e),()=>W(1))}let i=Oi($.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 Gu(M,{getFpsMetrics:cn,stats:ln,initialState:Pn},{debug:a||o,commands:Jt,initialTools:[],initialMessages:[i],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:A,disableSlashCommands:pe,sshSession:r,thinkingConfig:F},dd);return}else if(Rp&&(Rp.sessionId||Rp.discover)){let{discoverAssistantSessions:e}=await import(`./sessionDiscovery-BP0nv36F.js`),t=Rp.sessionId;if(!t){let n;try{n=await e()}catch(e){return await X(M,`Failed to discover sessions: ${e instanceof Error?e.message:e}`,()=>W(1))}if(n.length===0){let e;try{e=await gd(M)}catch(e){return await X(M,`Assistant installation failed: ${e instanceof Error?e.message:e}`,()=>W(1))}return e===null&&(await W(0),process.exit(0)),await ud(M,`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 hd(M,{sessions:n});e||(await W(0),process.exit(0)),t=e}}let{checkAndRefreshOAuthTokenIfNeeded:n,getClaudeAIOAuthTokens:r}=await import(`./auth-DsQEVs9W.js`);await n();let i;try{i=await hl()}catch(e){return await X(M,`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=ru(t,s,i.orgUUID,!1,!0),l=Oi(`Attached to assistant session ${t.slice(0,8)}…`,`info`),u={...Pn,isBriefOnly:!0,kairosEnabled:!1,replBridgeEnabled:!1},d=la(Jt);await Gu(M,{getFpsMetrics:cn,stats:ln,initialState:u},{debug:a||o,commands:d,initialTools:[],initialMessages:[l],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:A,disableSlashCommands:pe,remoteSessionConfig:c,thinkingConfig:F},dd);return}else if(n.resume||n.fromPr||S||Te!==null){let{clearSessionCaches:e}=await import(`./caches-DMYdTEAr.js`);e();let t=null,r,i=Ko(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 Oa(e,{exact:!0});t.length===1?(c=t[0],i=hs(c)??null):s=e}}if((Te!==null||S)&&(await Fa(),!ca(`allow_remote_sessions`)))return await X(M,`Error: Remote sessions are disabled by your organization's policy.`,()=>W(1));if(Te!==null){let e=Te.length>0,t=Kt(`tengu_remote_backend`,!1);if(!t&&!e)return await X(M,`Error: --remote requires a description.
1292
- Usage: claude --remote "your task description"`,()=>W(1));B(`tengu_remote_create_session`,{has_initial_prompt:String(e)});let n=await xr(),r=await Oc(M,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(M,`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: ${Zi(r.id)}?m=0\n`),process.stdout.write(`Resume with: claude --teleport ${r.id}\n`),await W(0),process.exit(0)),ke(!0),We(oa(r.id));let i;try{i=await hl()}catch(e){return H($n(e)),await X(M,`Error: ${R(e)||`Failed to authenticate`}`,()=>W(1))}let{getClaudeAIOAuthTokens:s}=await import(`./auth-DsQEVs9W.js`),c=ru(r.id,()=>s()?.accessToken??i.accessToken,i.orgUUID,e),l=`${Zi(r.id)}?m=0`,u=Oi(`/remote-control is active. Code in CLI or at ${l}`,`info`),d=e?Ii({content:Te}):null,f={...Pn,remoteSessionUrl:l},p=la(Jt);await Gu(M,{getFpsMetrics:cn,stats:ln,initialState:f},{debug:a||o,commands:p,initialTools:[],initialMessages:d?[u,d]:[u],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:A,disableSlashCommands:pe,remoteSessionConfig:c,thinkingConfig:F},dd);return}else if(S){if(S===!0||S===``){B(`tengu_teleport_interactive_mode`,{}),L(`selectAndResumeTeleportTask: Starting teleport flow...`);let e=await _d(M);e||(await W(0),process.exit(0));let{branchError:n}=await ba(e.branch);t=Hi(e.log,n)}else if(typeof S==`string`){B(`tengu_teleport_resume_session`,{mode:`direct`});try{let e=await po(await _l(S));if(e.status===`mismatch`||e.status===`not_in_repo`){let t=e.sessionRepo;if(t){let e=await Ql(Zl(t));if(e.length>0){let n=await vd(M,{targetRepo:t,initialPaths:e});n?(process.chdir(n),ws(n),qe(n)):await W(0)}else throw new er(`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 er(e.errorMessage||`Failed to validate session`,b.red(`Error: ${e.errorMessage||`Failed to validate session`}\n`));await xi();let{teleportWithProgress:n}=await import(`./TeleportProgress-Ctdqi7iS.js`),r=await n(M,S);Oe({sessionId:S}),t=r.messages}catch(e){e instanceof er?process.stderr.write(e.formattedMessage+`
1293
- `):(H(e),process.stderr.write(b.red(`Error: ${R(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-DKwcd0Vc.js`),i=e(n.resume);if(i)try{let e=performance.now(),n=await Eo(await t(i),void 0);n?(r=await Hl(n,{forkSession:!0,transcriptPath:n.fullPath},Bn),r.restoredAgentDef&&(A=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(M,`Unable to resume from ccshare: ${R(e)}`,()=>W(1))}else{let e=du(n.resume);try{let t=performance.now(),i;try{i=await Xo(e)}catch(e){if(!Qn(e))throw e}if(i){let e=await Eo(i,void 0);e?(r=await Hl(e,{forkSession:!!n.forkSession,transcriptPath:e.fullPath},Bn),r.restoredAgentDef&&(A=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(M,`Unable to load transcript from file: ${n.resume}`,()=>W(1))}}}if(i){let e=i;try{let t=performance.now(),i=await Eo(c??e,void 0);if(!i)return B(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),await X(M,`No conversation found with session ID: ${e}`);let a=c?.fullPath??i.fullPath;r=await Hl(i,{forkSession:!!n.forkSession,sessionIdOverride:e,transcriptPath:a},Bn),r.restoredAgentDef&&(A=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(M,`Failed to resume session ${e}`)}}if(ae)try{let e=await ae,t=Wr(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(M,`Error downloading files: ${R(e)}`)}let u=r??(Array.isArray(t)?{messages:t,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:A,initialState:Pn,contentReplacements:void 0}:void 0);u?(Up(n),Wp(n),await Gu(M,{getFpsMetrics:cn,stats:ln,initialState:u.initialState},{...Rn,mainThreadAgentDefinition:u.restoredAgentDef??A,initialMessages:u.messages,initialFileHistorySnapshots:u.fileHistorySnapshots,initialContentReplacements:u.contentReplacements,initialAgentName:u.agentName,initialAgentColor:u.agentColor},dd)):await yd(M,{getFpsMetrics:cn,stats:ln,initialState:Pn},Ha(Ye()),{...Rn,initialSearchQuery:s,forkSession:n.forkSession,filterByPr:l})}else{let e=P&&xn.length===0?P:void 0;U(`action_after_hooks`),Up(n),Wp(n),fc(Sp?.isCoordinatorMode()?`coordinator`:`normal`);let t=null;n.deepLinkOrigin?(B(`tengu_deep_link_opened`,{has_prefill:!!n.prefill,has_repo:!!n.deepLinkRepo}),t=Oi(cu({cwd:mr(),prefillLength:n.prefill?.length,repo:n.deepLinkRepo,lastFetch:n.deepLinkLastFetch===void 0?void 0:new Date(n.deepLinkLastFetch)}),`warning`)):n.prefill&&(t=Oi(`Launched with a pre-filled prompt — review it before pressing Enter.`,`warning`));let r=t?[t,...xn]:xn.length>0?xn:void 0;await Gu(M,{getFpsMetrics:cn,stats:ln,initialState:Pn},{...Rn,initialMessages:r,pendingHookMessages:e},dd)}}).version(`2.7.2 (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.`),hc()&&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-HQ8-nEZ1.js`);await n({debug:e,verbose:t})}),ep(a),qo()&&tp(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-HQ8-nEZ1.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-HQ8-nEZ1.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-HQ8-nEZ1.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-HQ8-nEZ1.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-HQ8-nEZ1.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-HQ8-nEZ1.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-DONKdvGc.js`),{SessionManager:r}=await import(`./sessionManager-BOmgJd1l.js`),{DangerousBackend:i}=await import(`./dangerousBackend-Dkjtndh1.js`),{printBanner:a}=await import(`./serverBanner-DIyjgIM-.js`),{createServerLogger:o}=await import(`./serverLog-D1N5yx8A.js`),{writeServerLock:s,removeServerLock:c,probeRunningServer:l}=await import(`./lockfile-C3JsqLpb.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]
1357
+ `)}return e}async function Up(){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 Mu().configureHelp(t()).enablePositionalOptions();U(`run_commander_initialized`),n.hook(`preAction`,async e=>{U(`preAction_start`),await Promise.all([Mn(),wt()]),U(`preAction_after_mdm`),await Vu(),U(`preAction_after_init`),m(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)||(process.title=`claude`);let{initSinks:t}=await import(`./sinks-wuo1yQ_m.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),Ts(`preAction: --plugin-dir inline plugins`)),Np(),U(`preAction_after_migrations`),Go(),ea(),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($r)).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 Au(`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(y.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&&Tp&&Tp.markAssistantForced(),Tp&&(Tp.isAssistantForced()||n.assistant===!0)&&!n.agentId&&Ep){if(!Qt())console.warn(y.yellow(`Assistant mode disabled: directory is not trusted. Accept the trust dialog and restart.`));else if(r=Tp.isAssistantForced()||await Ep.isKairosEnabled(),r){let e=n;e.brief=!0,Me(!0),i=await Tp.initializeAssistantTeam()}}let{debug:a=!1,debugToStderr:o=!1,dangerouslySkipPermissions:s,allowDangerouslySkipPermissions:l=!1,tools:u=[],allowedTools:d=[],disallowedTools:f=[],mcpConfig:p=[],permissionMode:ee,addDir:te=[],fallbackModel:h,betas:ne=[],ide:re=!1,sessionId:ie,includeHookEvents:g,includePartialMessages:ae}=n;n.prefill&&eu(n.prefill);let oe,se=n.agents,ce=n.agent;ce&&(process.env.CLAUDE_CODE_AGENT=ce);let _=n.outputFormat,v=n.inputFormat,le=n.verbose??j().verbose,ue=n.print,de=n.init??!1,fe=n.initOnly??!1,pe=n.maintenance??!1,me=n.disableSlashCommands||!1,he=process.env.USER_TYPE===`ant`&&n.tasks,ge=he?typeof he==`string`?he:ul:void 0;process.env.USER_TYPE===`ant`&&ge&&(process.env.CLAUDE_CODE_TASK_LIST_ID=ge);let _e=Cl()?n.worktree:void 0,ve=typeof _e==`string`?_e:void 0,ye=_e!==void 0,be;if(ve){let e=ya(ve);e!==null&&(be=e,ve=void 0)}let xe=Cl()&&n.tmux===!0;xe&&(ye||(process.stderr.write(y.red(`Error: --tmux requires --worktree
1358
+ `)),process.exit(1)),Lr()===`windows`&&(process.stderr.write(y.red(`Error: --tmux is not supported on Windows
1359
+ `)),process.exit(1)),await gs()||(process.stderr.write(y.red(`Error: tmux is not installed.\n${Li()}\n`)),process.exit(1)));let b;if(dn()){let e=Jp(n);b=e;let t=e.agentId||e.agentName||e.teamName,r=e.agentId&&e.agentName&&e.teamName;t&&!r&&(process.stderr.write(y.red(`Error: --agent-id, --agent-name, and --team-name must all be provided together
1360
+ `)),process.exit(1)),e.agentId&&e.agentName&&e.teamName&&xp().setDynamicTeamContext?.({agentId:e.agentId,agentName:e.agentName,teamName:e.teamName,color:e.agentColor,planModeRequired:e.planModeRequired??!1,parentSessionId:e.parentSessionId}),e.teammateMode&&Cp().setCliTeammateModeOverride?.(e.teammateMode)}let x=n.sdkUrl??void 0,Se=ae||m(process.env.CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES);(g||m(process.env.CLAUDE_CODE_REMOTE))&&no(!0),x&&(v||(v=`stream-json`),_||(_=`stream-json`),n.verbose===void 0&&(le=!0),n.print||(ue=!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(ie&&((n.continue||n.resume)&&!n.forkSession&&(process.stderr.write(y.red(`Error: --session-id can only be used with --continue or --resume if --fork-session is also specified.
1361
+ `)),process.exit(1)),!x)){let e=Ko(ie);e||(process.stderr.write(y.red(`Error: Invalid session ID. Must be a valid UUID.
1362
+ `)),process.exit(1)),ms(e)&&(process.stderr.write(y.red(`Error: Session ID ${e} is already in use.\n`)),process.exit(1))}let Ie=n.file;if(Ie&&Ie.length>0){let e=$c();e||(process.stderr.write(y.red(`Error: Session token required for file downloads. CLAUDE_CODE_SESSION_ACCESS_TOKEN must be set.
1363
+ `)),process.exit(1));let t=process.env.CLAUDE_CODE_REMOTE_SESSION_ID||Ee(),n=ua(Ie);n.length>0&&(oe=yo(n,{baseUrl:process.env.ANTHROPIC_BASE_URL||Tr().BASE_API_URL,oauthToken:e,sessionId:t}))}let C=Re();h&&n.model&&h===n.model&&(process.stderr.write(y.red(`Error: Fallback model cannot be the same as the main model. Please specify a different model for --fallback-model.
1364
+ `)),process.exit(1));let ze=n.systemPrompt;if(n.systemPromptFile){n.systemPrompt&&(process.stderr.write(y.red(`Error: Cannot use both --system-prompt and --system-prompt-file. Please use only one.
1365
+ `)),process.exit(1));try{ze=mu(du(n.systemPromptFile),`utf8`)}catch(e){Yn(e)===`ENOENT`&&(process.stderr.write(y.red(`Error: System prompt file not found: ${du(n.systemPromptFile)}\n`)),process.exit(1)),process.stderr.write(y.red(`Error reading system prompt file: ${R(e)}\n`)),process.exit(1)}}let w=n.appendSystemPrompt;if(n.appendSystemPromptFile){n.appendSystemPrompt&&(process.stderr.write(y.red(`Error: Cannot use both --append-system-prompt and --append-system-prompt-file. Please use only one.
1366
+ `)),process.exit(1));try{w=mu(du(n.appendSystemPromptFile),`utf8`)}catch(e){Yn(e)===`ENOENT`&&(process.stderr.write(y.red(`Error: Append system prompt file not found: ${du(n.appendSystemPromptFile)}\n`)),process.exit(1)),process.stderr.write(y.red(`Error reading append system prompt file: ${R(e)}\n`)),process.exit(1)}}if(dn()&&b?.agentId&&b?.agentName&&b?.teamName){let e=Sp().TEAMMATE_SYSTEM_PROMPT_ADDENDUM;w=w?`${w}\n\n${e}`:e}let{mode:Be,notification:Ve}=qa({permissionModeCli:ee,dangerouslySkipPermissions:s});it(Be===`bypassPermissions`),(n.enableAutoMode||ee===`auto`||Be===`auto`||!ee&&fs())&&Dp?.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=Hr(r);if(a){let t=co({configObject:a,filePath:`command line`,expandVars:!0,scope:`dynamic`});t.config?e=t.config.mcpServers:i=t.errors}else{let t=bo({filePath:du(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(`
1367
+ `);L(`--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(xl))n=`Invalid MCP configuration: "${Sl}" is a reserved MCP name.`;else{let{isComputerUseMCPServer:t,COMPUTER_USE_MCP_SERVER_NAME:r}=await import(`./common-Bi4yZBkh.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}=Ui(ut(t,e=>({...e,scope:`dynamic`})));i.length>0&&process.stderr.write(`Warning: MCP ${ei(i.length,`server`)} blocked by enterprise policy: ${i.join(`, `)}\n`),T={...T,...r}}}let He=n;Ge(He.chrome);let Ue=Wl(He.chrome)&&(process.env.USER_TYPE===`ant`||an()),Xe=!Ue&&Gl();if(Ue){let e=Lr();try{B(`tengu_claude_in_chrome_setup`,{platform:e});let{mcpConfig:t,allowedTools:n,systemPrompt:r}=Kl();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}),L(`[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}=Kl();T={...T,...e};let t=Dl;w=w?`${w}\n\n${t}`:t}catch(e){L(`[Claude in Chrome] Error (auto-enable): ${e}`)}let et=n.strictMcpConfig||!1;if(Na()&&(et&&(process.stderr.write(y.red(`You cannot use --strict-mcp-config when an enterprise MCP config is present`)),process.exit(1)),T&&!xa(T)&&(process.stderr.write(y.red(`You cannot dynamically configure MCP servers when an enterprise MCP config is present`)),process.exit(1))),Lr()!==`unknown`&&!Re())try{let{getChicagoEnabled:e}=await import(`./gates-dO6m4Hdp.js`);if(e()){let{setupComputerUseMCP:e}=await import(`./setup-CZxLEcQh.js`),{mcpConfig:t,allowedTools:n}=e();T={...T,...t},d.push(...n)}}catch(e){L(`[Computer Use MCP] Setup failed: ${R(e)}`)}we(te);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(y.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},st=n,ft=st.channels,mt=st.dangerouslyLoadDevelopmentChannels,gt=[];if(ft&&ft.length>0&&(gt=rt(ft,`--channels`),Le(gt)),C||mt&&mt.length>0&&(tt=rt(mt,`--dangerously-load-development-channels`)),gt.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:gt.length,dev_count:tt?.length??0,plugins:e(gt),dev_plugins:e(tt??[])})}if(u.length>0){let{BRIEF_TOOL_NAME:t,LEGACY_BRIEF_TOOL_NAME:n}=(ht(),e(yt)),{isBriefEntitled:r}=(Ls(),e(ts)),i=di(u);(i.includes(t)||i.includes(n))&&r()&&Ke(!0)}let vt=await Mi({allowedToolsCli:d,disallowedToolsCli:f,baseToolsCli:u,permissionMode:Be,allowDangerouslySkipPermissions:l,addDirs:te}),D=vt.toolPermissionContext,{warnings:bt,dangerousPermissions:xt,overlyBroadBashPermissions:Ct}=vt;if(process.env.USER_TYPE===`ant`&&Ct.length>0){for(let e of Ct)L(`Ignoring overly broad shell permission ${e.ruleDisplay} from ${e.sourceDisplay}`);D=ha(D,Ct)}xt.length>0&&(D=ja(D)),bt.forEach(e=>{console.error(e)});let wt=C&&!et&&!Na()&&!c()?ia().then(e=>{let{allowed:t,blocked:n}=Ui(e);return n.length>0&&process.stderr.write(`Warning: claude.ai MCP ${ei(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),t}):Promise.resolve({});L(`[STARTUP] Loading MCP configs...`);let Tt=Date.now(),Et,Dt=(et||c()?Promise.resolve({servers:{}}):ma(T)).then(e=>(Et=Date.now()-Tt,e));v&&v!==`text`&&v!==`stream-json`&&(console.error(`Error: Invalid input format "${v}".`),process.exit(1)),v===`stream-json`&&_!==`stream-json`&&(console.error(`Error: --input-format=stream-json requires output-format=stream-json.`),process.exit(1)),x&&(v!==`stream-json`||_!==`stream-json`)&&(console.error(`Error: --sdk-url requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),n.replayUserMessages&&(v!==`stream-json`||_!==`stream-json`)&&(console.error(`Error: --replay-user-messages requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),Se&&(!C||_!==`stream-json`)&&(hr(`Error: --include-partial-messages requires --print and --output-format=stream-json.`),process.exit(1)),n.sessionPersistence===!1&&!C&&(hr(`Error: --no-session-persistence can only be used with --print mode.`),process.exit(1));let O=await Hp(t||``,v??`text`);U(`action_after_input_prompt`),Gp(n);let k=So(D);if(m(process.env.CLAUDE_CODE_COORDINATOR_MODE)){let{applyCoordinatorToolFilter:e}=await import(`./toolPool-CDEeuQd2.js`);k=e(k)}U(`action_tools_loaded`);let jt;if(jc({isNonInteractiveSession:C})&&n.jsonSchema&&(jt=Xn(n.jsonSchema)),jt){let e=Ic(jt);`tool`in e?(k=[...k,e.tool],B(`tengu_structured_output_enabled`,{schema_property_count:Object.keys(jt.properties||{}).length,has_required_fields:!!jt.required})):B(`tengu_structured_output_failure`,{error:`Invalid JSON schema`})}U(`action_before_setup`),L(`[STARTUP] Running setup()...`);let Mt=Date.now(),{setup:Nt}=await import(`./setup-n3Ixr_gs.js`),Pt=mr();process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&(xd(),$f());let Ft=Nt(Pt,Be,l,ye,ve,xe,ie?Ko(ie):void 0,be,void 0),It=ye?null:Do(Pt),Rt=ye?null:os(Pt);It?.catch(()=>{}),Rt?.catch(()=>{}),await Ft,L(`[STARTUP] setup() completed in ${Date.now()-Mt}ms`),U(`action_after_setup`);let zt=!!n.replayUserMessages;Re()&&(Ei(),Ji(),io(),ot());let Bt=n.name?.trim();Bt&&Xs(Bt);let Vt=n.model||process.env.ANTHROPIC_MODEL;process.env.USER_TYPE===`ant`&&Vt&&Vt!==`default`&&!zn(`tengu_ant_model_override`)&&j().cachedGrowthBookFeatures?.tengu_ant_model_override==null&&await lt();let Ht=n.model===`default`?dt():n.model,Ut=h===`default`?dt():h,Wt=ye?mr():Pt;L(`[STARTUP] Loading commands and agents...`);let Gt=Date.now(),[Jt,Yt]=await Promise.all([It??Do(Wt),Rt??os(Wt)]);L(`[STARTUP] Commands and agents loaded in ${Date.now()-Gt}ms`),U(`action_commands_loaded`);let Xt=[];if(se)try{let e=Hr(se);e&&(Xt=Ns(e,`flagSettings`))}catch(e){H(e)}let Zt=[...Yt.allAgents,...Xt],$t={...Yt,allAgents:Zt,activeAgents:Vs(Zt)},en=ce??St().agent,A;if(en&&(A=$t.activeAgents.find(e=>e.agentType===en),A||L(`Warning: agent "${en}" not found. Available agents: ${$t.activeAgents.map(e=>e.agentType).join(`, `)}. Using default behavior.`)),Je(A?.agentType),A&&B(`tengu_agent_flag`,{agentType:Us(A)?A.agentType:`custom`,...ce&&{source:`cli`}}),A?.agentType&&Fo(A.agentType),C&&A&&!ze&&!Us(A)){let e=A.getSystemPrompt();e&&(ze=e)}A?.initialPrompt&&(typeof O==`string`?O=O?`${A.initialPrompt}\n\n${O}`:A.initialPrompt:O||(O=A.initialPrompt));let tn=Ht;!tn&&A?.model&&A.model!==`inherit`&&(tn=ct(A.model)),Qe(tn),Ae(kt()||null);let nn=at(),rn=ct(nn??dt()),on;if(Xa()){let e=hc()?n.advisor:void 0;e&&(L(`[AdvisorTool] --advisor ${e}`),ji(rn)||(process.stderr.write(y.red(`Error: The model "${rn}" does not support the advisor tool.\n`)),process.exit(1)),Fi(qn(ct(e)))||(process.stderr.write(y.red(`Error: The model "${e}" cannot be used as an advisor.\n`)),process.exit(1))),on=hc()?e??Ga():e,on&&L(`[AdvisorTool] Advisor model: ${on}`)}if(dn()&&b?.agentId&&b?.agentName&&b?.teamName&&b?.agentType){let e=$t.activeAgents.find(e=>e.agentType===b.agentType);if(e){let t;if(e.source===`built-in`?L(`[teammate] Built-in agent ${b.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 L(`[teammate] Custom agent ${b.agentType} not found in available agents`)}if(Kp(n),!Re()&&!Ze()&&St().defaultView===`chat`){let{isBriefEntitled:t}=(Ls(),e(ts));t()&&Ke(!0)}if((n.proactive||m(process.env.CLAUDE_CODE_PROACTIVE))&&!wp?.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. ${(Ls(),e(ts)).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&&Tp){let e=Tp.getAssistantSystemPromptAddendum();w=w?`${w}\n\n${e}`:e}let M,cn,ln;if(!C){let e=pd(!1);cn=e.getFpsMetrics,ln=e.stats,process.env.USER_TYPE===`ant`&&Vl();let{createRoot:n}=await import(`./src-BJM0zMNO.js`);M=await n(e.renderOptions),B(`tengu_timer`,{event:`startup`,durationMs:Math.round(process.uptime()*1e3)}),L(`[STARTUP] Running showSetupScreens()...`);let r=Date.now(),i=await fd(M,Be,l,Jt,Ue,tt);if(L(`[STARTUP] showSetupScreens() completed in ${Date.now()-r}ms`),De!==void 0){let{getBridgeDisabledReason:e}=await import(`./bridgeEnabled-DmvmwuUY.js`),t=await e();je=t===null,t&&process.stderr.write(y.yellow(`${t}\n--rc flag ignored.\n`))}i&&t?.trim().toLowerCase()===`/login`&&(t=``),i&&($o(),wo(),Gn(),Lt(),import(`./trustedDevice-CyfQd_GU.js`).then(e=>(e.clearTrustedDeviceToken(),e.enrollTrustedDevice())));let a=await Ot();a.valid||await X(M,a.message)}if(process.exitCode!==void 0){L(`Graceful shutdown initiated, skipping further initialization`);return}if(fo(),!C){let{errors:e}=sn(),t=e.filter(e=>!e.mcpErrorMetadata);t.length>0&&await md(M,{settingsErrors:t,onExit:()=>wi(1)})}let fn=Kt(`tengu_cicada_nap_ms`,0),pn=j().startupPrefetchedAt??0;c()||fn>0&&Date.now()-pn<fn?(L(`Skipping startup prefetches, last ran ${Math.round((Date.now()-pn)/1e3)}s ago`),At()):(L(`Starting background startup prefetches${pn>0?` last ran ${Math.round((Date.now()-pn)/1e3)}s ago`:``}`),As().catch(e=>H(e)),Ju(),kl(),Kt(`tengu_miraculo_the_bard`,!1)?At():pt(),fn>0&&E(e=>({...e,startupPrefetchedAt:Date.now()}))),C||au();let{servers:N}=await Dt;L(`[STARTUP] MCP configs resolved in ${Et}ms (awaited at +${Date.now()-Tt}ms)`);let hn={...N,...T},gn={},_n={};for(let[e,t]of Object.entries(hn)){let n=t;n.type===`sdk`?gn[e]=n:_n[e]=n}U(`action_mcp_configs_loaded`);let vn=C?Promise.resolve({clients:[],tools:[],commands:[]}):Ds(_n),yn=C?Promise.resolve({clients:[],tools:[],commands:[]}):wt.then(e=>Object.keys(e).length>0?Ds(e):{clients:[],tools:[],commands:[]}),bn=Promise.all([vn,yn]).then(([e,t])=>({clients:[...e.clients,...t.clients],tools:mn([...e.tools,...t.tools],`name`),commands:mn([...e.commands,...t.commands],`name`)})),P=fe||de||pe||C||n.continue||n.resume?null:ui(`startup`,{agentType:A?.agentType,model:rn}),xn=[];bn.catch(()=>{});let Sn=[],Cn=[],wn=[],Tn=Dc(),F=Tn===!1?{type:`disabled`}:{type:`adaptive`};if(n.thinking===`adaptive`||n.thinking===`enabled`)Tn=!0,F={type:`adaptive`};else if(n.thinking===`disabled`)Tn=!1,F={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,F={type:`enabled`,budgetTokens:e}):e===0&&(Tn=!1,F={type:`disabled`}))}V(`info`,`started`,{version:`2.8.0`,is_native_binary:Or()}),rr(async()=>{V(`info`,`exited`)}),Wp({hasInitialPrompt:!!t,hasStdin:!!O,verbose:le,debug:a,debugToStderr:o,print:ue??!1,outputFormat:_??`text`,inputFormat:v??`text`,numAllowedTools:d.length,numDisallowedTools:f.length,mcpClientCount:Object.keys(hn).length,worktreeEnabled:ye,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:F,assistantActivationPath:r?Tp?.getAssistantActivationPath():void 0}),Ho(_n,D),Sa(null,`initialization`),Op(),gc().then(e=>{e&&(Bt&&dc(Bt),ic().then(e=>{e>=2&&B(`tengu_concurrent_sessions`,{num_sessions:e})}))}),c()||(C?(await Ca(),U(`action_after_plugins_init`),Cs().then(()=>na())):Ca().then(async()=>{U(`action_after_plugins_init`),await Cs(),na()}));let En=fe||de?`init`:pe?`maintenance`:null;if(fe){Ei(),await Zo(`init`,{forceSyncExecution:!0}),await ui(`startup`,{forceSyncExecution:!0}),wi(0);return}if(C){(_===`stream-json`||_===`json`)&&lr(!0),Ei(),Hu();let e=n.continue||n.resume||S||En?void 0:ui(`startup`);e?.catch(()=>{}),U(`before_validateForceLoginOrg`);let t=await Ot();t.valid||(process.stderr.write(t.message+`
1368
+ `),process.exit(1));let i=me?[]:Jt.filter(e=>e.type===`prompt`&&!e.disableNonInteractive||e.type===`local`&&e.supportsNonInteractive),a=yc(),o=_s({...a,mcp:{...a.mcp,clients:Sn,commands:wn,tools:Cn},toolPermissionContext:D,effortValue:mi(n.effort)??Di(),...Vn()&&{fastMode:un(tn??null)},...Xa()&&on&&{advisorModel:on},kairosEnabled:r},Bl);da(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(_t(ne));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}))]}})),Yo(({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:mn([...r.mcp.tools,...t],`name`),commands:mn([...r.mcp.commands,...n],`name`)}}))},e).catch(e=>L(`[MCP] ${t} connect error: ${e}`)));U(`before_connectMcp`),await s(_n,`regular`),U(`after_connectMcp`);let l=5e3,u=wt.then(e=>{if(Object.keys(e).length>0){let t=new Set;for(let n of Object.values(e)){let e=Si(n);e&&t.add(e)}let n=new Set;for(let[e,r]of Object.entries(_n)){if(!e.startsWith(`plugin:`))continue;let i=Si(r);i&&t.has(i)&&n.add(e)}if(n.size>0){L(`[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,aa(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=Cc(i,e),a=Ro(a,e);return{...e,mcp:{...e.mcp,clients:t,tools:r,commands:i,resources:a}}})}}let{servers:t}=Ta(e,Un(_n,(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&&L(`[MCP] claude.ai connectors not ready after ${l}ms — proceeding; background connection continues`),U(`after_connectMcp_claudeai`),c()||(Fp(),import(`./backgroundHousekeeping-LYpOamcN.js`).then(e=>e.startBackgroundHousekeeping()),process.env.USER_TYPE===`ant`&&import(`./sdkHeapDumpMonitor-DTHI5WbD.js`).then(e=>e.startSdkMemoryMonitor())),kp(),U(`before_print_import`);let{runHeadless:m}=await import(`./print-luaON-Cg.js`);U(`after_print_import`),m(O,()=>o.getState(),o.setState,i,k,gn,$t.activeAgents,{continue:n.continue,resume:n.resume,verbose:le,outputFormat:_,jsonSchema:jt,permissionPromptToolName:n.permissionPromptTool,allowedTools:d,thinkingConfig:F,maxTurns:n.maxTurns,maxBudgetUsd:n.maxBudgetUsd,taskBudget:n.taskBudget?{total:n.taskBudget}:void 0,systemPrompt:ze,appendSystemPrompt:w,userSpecifiedModel:tn,fallbackModel:Ut,teleport:S,sdkUrl:x,replayUserMessages:zt,includePartialMessages:Se,forkSession:n.forkSession||!1,resumeSessionAt:n.resumeSessionAt||void 0,rewindFiles:n.rewindFiles,enableAuthStatus:n.enableAuthStatus,agent:ce,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:kn(),agent:en});let Dn=tu(rn),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`}),Ct.length>0){let e=Ur(Ct.map(e=>e.ruleDisplay)),t=e.join(`, `),n=Ur(Ct.map(e=>e.sourceDisplay)).join(`, `),r=e.length;On.push({key:`overly-broad-bash-notification`,text:`${t} allow ${ei(r,`rule`)} from ${n} ${ei(r,`was`,`were`)} ignored \u2014 not available for Ants, please use auto-mode instead`,color:`warning`,priority:`high`})}let An=xp(),jn={...D,mode:dn()&&An?.isPlanModeRequired?.()?`plan`:D.mode},Mn=Ze(),Nn=je||qt()||r,Pn={settings:St(),tasks:{},agentNameRegistry:new Map,verbose:le??j().verbose??!1,mainLoopModel:nn,mainLoopModelForSession:null,isBriefOnly:Mn,expandedView:j().showSpinnerTree?`teammates`:j().showExpandedTodos?`tasks`:`none`,showTeammateMessagePreview:dn()?!1:void 0,selectedIPAgentIndex:-1,selectedBgAgentIndex:-1,coordinatorTaskIndex:-1,viewSelectionMode:`none`,footerSelection:null,toolPermissionContext:jn,agent:A?.agentType,agentDefinitions:$t,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:sl(),thinkingEnabled:Tn,promptSuggestionEnabled:Ya(),sessionHooks:new Map,inbox:{messages:[]},promptSuggestion:{text:null,promptId:null,shownAt:0,acceptedAt:0,generationRequestId:null},speculation:nc,speculationSessionTimeSavedMs:0,skillImprovement:{suggestion:null},workerSandboxPermissions:{queue:[],selectedIndex:0},pendingWorkerRequest:null,pendingSandboxRequest:null,authVersion:0,initialMessage:O?{message:Ii({content:String(O)})}:null,effortValue:mi(n.effort)??Di(),activeOverlays:new Set,fastMode:un(rn),...Xa()&&on&&{advisorModel:on},teamContext:i??nu()};O&&vi(String(O));let Fn=Cn;E(e=>({...e,numStartups:(e.numStartups??0)+1})),setImmediate(()=>{jp(),kp()});let In=process.env.USER_TYPE===`ant`?import(`./sessionDataUploader-BgmJTXQr.js`):null,Ln=In?In.then(e=>e.createSessionTurnUploader()).catch(()=>null):null,Rn={debug:a||o,commands:[...Jt,...wn],initialTools:Fn,mcpClients:Sn,autoConnectIdeFlag:re,mainThreadAgentDefinition:A,disableSlashCommands:me,dynamicMcpConfig:T,strictMcpConfig:et,systemPrompt:ze,appendSystemPrompt:w,taskListId:ge,thinkingConfig:F,...Ln&&{onTurnComplete:e=>{Ln.then(t=>t?.(e))}}},Bn={modeApi:wp,mainThreadAgentDefinition:A,agentDefinitions:$t,currentCwd:Wt,cliAgents:Xt,initialState:Pn};if(n.continue){let e=!1;try{let t=performance.now(),{clearSessionCaches:r}=await import(`./caches-CkH9F-Fd.js`);r();let i=await Eo(void 0,void 0);if(!i)return B(`tengu_continue`,{success:!1}),await X(M,`No conversation found to continue`);let a=await Hl(i,{forkSession:!!n.forkSession,includeAttribution:!0,transcriptPath:i.fullPath},Bn);a.restoredAgentDef&&(A=a.restoredAgentDef),Gp(n),Kp(n),B(`tengu_continue`,{success:!0,resume_duration_ms:Math.round(performance.now()-t)}),e=!0,await Gu(M,{getFpsMetrics:cn,stats:ln,initialState:a.initialState},{...Rn,mainThreadAgentDefinition:a.restoredAgentDef??A,initialMessages:a.messages,initialFileHistorySnapshots:a.fileHistorySnapshots,initialContentReplacements:a.contentReplacements,initialAgentName:a.agentName,initialAgentColor:a.agentColor},dd)}catch(t){e||B(`tengu_continue`,{success:!1}),H(t),process.exit(1)}}else if(Q?.url){let e;try{let t=await _p({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(M,e instanceof gp?e.message:String(e),()=>W(1))}let t=Oi(`Connected to server at ${Q.url}\nSession: ${e.sessionId}`,`info`);await Gu(M,{getFpsMetrics:cn,stats:ln,initialState:Pn},{debug:a||o,commands:Jt,initialTools:[],initialMessages:[t],mcpClients:[],autoConnectIdeFlag:re,mainThreadAgentDefinition:A,disableSlashCommands:me,directConnectConfig:e,thinkingConfig:F},dd);return}else if($?.host){let{createSSHSession:e,createLocalSSHSession:t,SSHSessionError:n}=await import(`./createSSHSession-DNXCWneI.js`),r;try{if($.local)process.stderr.write(`Starting local ssh-proxy test session...
1369
+ `),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.8.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(`
1370
+ `)}qe(r.remoteCwd),Pe(r.remoteCwd),Fe($.local?`local`:$.host)}catch(e){return await X(M,e instanceof n?e.message:String(e),()=>W(1))}let i=Oi($.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 Gu(M,{getFpsMetrics:cn,stats:ln,initialState:Pn},{debug:a||o,commands:Jt,initialTools:[],initialMessages:[i],mcpClients:[],autoConnectIdeFlag:re,mainThreadAgentDefinition:A,disableSlashCommands:me,sshSession:r,thinkingConfig:F},dd);return}else if(Bp&&(Bp.sessionId||Bp.discover)){let{discoverAssistantSessions:e}=await import(`./sessionDiscovery-DkIIFsWX.js`),t=Bp.sessionId;if(!t){let n;try{n=await e()}catch(e){return await X(M,`Failed to discover sessions: ${e instanceof Error?e.message:e}`,()=>W(1))}if(n.length===0){let e;try{e=await gd(M)}catch(e){return await X(M,`Assistant installation failed: ${e instanceof Error?e.message:e}`,()=>W(1))}return e===null&&(await W(0),process.exit(0)),await ud(M,`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 hd(M,{sessions:n});e||(await W(0),process.exit(0)),t=e}}let{checkAndRefreshOAuthTokenIfNeeded:n,getClaudeAIOAuthTokens:r}=await import(`./auth-BemPA3ot.js`);await n();let i;try{i=await hl()}catch(e){return await X(M,`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=ru(t,s,i.orgUUID,!1,!0),l=Oi(`Attached to assistant session ${t.slice(0,8)}…`,`info`),u={...Pn,isBriefOnly:!0,kairosEnabled:!1,replBridgeEnabled:!1},d=la(Jt);await Gu(M,{getFpsMetrics:cn,stats:ln,initialState:u},{debug:a||o,commands:d,initialTools:[],initialMessages:[l],mcpClients:[],autoConnectIdeFlag:re,mainThreadAgentDefinition:A,disableSlashCommands:me,remoteSessionConfig:c,thinkingConfig:F},dd);return}else if(n.resume||n.fromPr||S||Te!==null){let{clearSessionCaches:e}=await import(`./caches-CkH9F-Fd.js`);e();let t=null,r,i=Ko(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 Oa(e,{exact:!0});t.length===1?(c=t[0],i=hs(c)??null):s=e}}if((Te!==null||S)&&(await Fa(),!ca(`allow_remote_sessions`)))return await X(M,`Error: Remote sessions are disabled by your organization's policy.`,()=>W(1));if(Te!==null){let e=Te.length>0,t=Kt(`tengu_remote_backend`,!1);if(!t&&!e)return await X(M,`Error: --remote requires a description.
1371
+ Usage: claude --remote "your task description"`,()=>W(1));B(`tengu_remote_create_session`,{has_initial_prompt:String(e)});let n=await xr(),r=await Oc(M,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(M,`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: ${Zi(r.id)}?m=0\n`),process.stdout.write(`Resume with: claude --teleport ${r.id}\n`),await W(0),process.exit(0)),ke(!0),We(oa(r.id));let i;try{i=await hl()}catch(e){return H($n(e)),await X(M,`Error: ${R(e)||`Failed to authenticate`}`,()=>W(1))}let{getClaudeAIOAuthTokens:s}=await import(`./auth-BemPA3ot.js`),c=ru(r.id,()=>s()?.accessToken??i.accessToken,i.orgUUID,e),l=`${Zi(r.id)}?m=0`,u=Oi(`/remote-control is active. Code in CLI or at ${l}`,`info`),d=e?Ii({content:Te}):null,f={...Pn,remoteSessionUrl:l},p=la(Jt);await Gu(M,{getFpsMetrics:cn,stats:ln,initialState:f},{debug:a||o,commands:p,initialTools:[],initialMessages:d?[u,d]:[u],mcpClients:[],autoConnectIdeFlag:re,mainThreadAgentDefinition:A,disableSlashCommands:me,remoteSessionConfig:c,thinkingConfig:F},dd);return}else if(S){if(S===!0||S===``){B(`tengu_teleport_interactive_mode`,{}),L(`selectAndResumeTeleportTask: Starting teleport flow...`);let e=await _d(M);e||(await W(0),process.exit(0));let{branchError:n}=await ba(e.branch);t=Hi(e.log,n)}else if(typeof S==`string`){B(`tengu_teleport_resume_session`,{mode:`direct`});try{let e=await po(await _l(S));if(e.status===`mismatch`||e.status===`not_in_repo`){let t=e.sessionRepo;if(t){let e=await Ql(Zl(t));if(e.length>0){let n=await vd(M,{targetRepo:t,initialPaths:e});n?(process.chdir(n),ws(n),qe(n)):await W(0)}else throw new er(`You must run claude --teleport ${S} from a checkout of ${t}.`,y.red(`You must run claude --teleport ${S} from a checkout of ${y.bold(t)}.\n`))}}else if(e.status===`error`)throw new er(e.errorMessage||`Failed to validate session`,y.red(`Error: ${e.errorMessage||`Failed to validate session`}\n`));await xi();let{teleportWithProgress:n}=await import(`./TeleportProgress--jgrqIfW.js`),r=await n(M,S);Oe({sessionId:S}),t=r.messages}catch(e){e instanceof er?process.stderr.write(e.formattedMessage+`
1372
+ `):(H(e),process.stderr.write(y.red(`Error: ${R(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-DPP1blaU.js`),i=e(n.resume);if(i)try{let e=performance.now(),n=await Eo(await t(i),void 0);n?(r=await Hl(n,{forkSession:!0,transcriptPath:n.fullPath},Bn),r.restoredAgentDef&&(A=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(M,`Unable to resume from ccshare: ${R(e)}`,()=>W(1))}else{let e=du(n.resume);try{let t=performance.now(),i;try{i=await Xo(e)}catch(e){if(!Qn(e))throw e}if(i){let e=await Eo(i,void 0);e?(r=await Hl(e,{forkSession:!!n.forkSession,transcriptPath:e.fullPath},Bn),r.restoredAgentDef&&(A=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(M,`Unable to load transcript from file: ${n.resume}`,()=>W(1))}}}if(i){let e=i;try{let t=performance.now(),i=await Eo(c??e,void 0);if(!i)return B(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),await X(M,`No conversation found with session ID: ${e}`);let a=c?.fullPath??i.fullPath;r=await Hl(i,{forkSession:!!n.forkSession,sessionIdOverride:e,transcriptPath:a},Bn),r.restoredAgentDef&&(A=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(M,`Failed to resume session ${e}`)}}if(oe)try{let e=await oe,t=Wr(e,e=>!e.success);t>0&&process.stderr.write(y.yellow(`Warning: ${t}/${e.length} file(s) failed to download.\n`))}catch(e){return await X(M,`Error downloading files: ${R(e)}`)}let u=r??(Array.isArray(t)?{messages:t,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:A,initialState:Pn,contentReplacements:void 0}:void 0);u?(Gp(n),Kp(n),await Gu(M,{getFpsMetrics:cn,stats:ln,initialState:u.initialState},{...Rn,mainThreadAgentDefinition:u.restoredAgentDef??A,initialMessages:u.messages,initialFileHistorySnapshots:u.fileHistorySnapshots,initialContentReplacements:u.contentReplacements,initialAgentName:u.agentName,initialAgentColor:u.agentColor},dd)):await yd(M,{getFpsMetrics:cn,stats:ln,initialState:Pn},Ha(Ye()),{...Rn,initialSearchQuery:s,forkSession:n.forkSession,filterByPr:l})}else{let e=P&&xn.length===0?P:void 0;U(`action_after_hooks`),Gp(n),Kp(n),fc(wp?.isCoordinatorMode()?`coordinator`:`normal`);let t=null;n.deepLinkOrigin?(B(`tengu_deep_link_opened`,{has_prefill:!!n.prefill,has_repo:!!n.deepLinkRepo}),t=Oi(cu({cwd:mr(),prefillLength:n.prefill?.length,repo:n.deepLinkRepo,lastFetch:n.deepLinkLastFetch===void 0?void 0:new Date(n.deepLinkLastFetch)}),`warning`)):n.prefill&&(t=Oi(`Launched with a pre-filled prompt — review it before pressing Enter.`,`warning`));let r=t?[t,...xn]:xn.length>0?xn:void 0;await Gu(M,{getFpsMetrics:cn,stats:ln,initialState:Pn},{...Rn,initialMessages:r,pendingHookMessages:e},dd)}}).version(`2.8.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.`),hc()&&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-esqdO_lV.js`);await n({debug:e,verbose:t})}),np(a),qo()&&rp(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-esqdO_lV.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-esqdO_lV.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-esqdO_lV.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-esqdO_lV.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-esqdO_lV.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-esqdO_lV.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-BsxW1FVq.js`),{SessionManager:r}=await import(`./sessionManager-mesT4zIQ.js`),{DangerousBackend:i}=await import(`./dangerousBackend-BDKHrF6i.js`),{printBanner:a}=await import(`./serverBanner-DR3GYXpH.js`),{createServerLogger:o}=await import(`./serverLog-CH1fCGsD.js`),{writeServerLock:s,removeServerLock:c,probeRunningServer:l}=await import(`./lockfile-DEaq0BaL.js`),u=await l();u&&(process.stderr.write(`A claude server is already running (pid ${u.pid}) at ${u.httpUrl}\n`),process.exit(1));let d=e.authToken??`sk-ant-cc-${t(16).toString(`base64url`)}`,f={port:parseInt(e.port,10),host:e.host,authToken:d,unix:e.unix,workspace:e.workspace,idleTimeoutMs:parseInt(e.idleTimeout,10),maxSessions:parseInt(e.maxSessions,10)},p=new r(new i,{idleTimeoutMs:f.idleTimeoutMs,maxSessions:f.maxSessions}),m=n(f,p,o()),ee=m.port??f.port;a(f,d,ee),await s({pid:process.pid,port:ee,host:f.host,httpUrl:f.unix?`unix:${f.unix}`:`http://${f.host}:${ee}`,startedAt:Date.now()});let te=!1,h=async()=>{te||(te=!0,m.stop(!0),await p.destroyAll(),await c(),process.exit(0))};process.once(`SIGINT`,()=>void h()),process.once(`SIGTERM`,()=>void h())}),n.command(`ssh <host> [dir]`).description(`Run 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]
1294
1373
 
1295
1374
  Runs Claude Code on a remote Linux host. You don't need to install
1296
1375
  anything on the remote or run \`claude auth login\` there — the binary is
1297
1376
  deployed over SSH and API auth tunnels back through your local machine.
1298
- `),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-DL390ePs.js`),{serverUrl:r,authToken:i}=n(e),a;try{let e=await hp({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 mp?e.message:String(e)),process.exit(1)}let{runConnectHeadless:o}=await import(`./connectHeadless-ByewVfOb.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-CjtaiRtF.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-CjtaiRtF.js`);await t(e)}),o.command(`logout`).description(`Log out from your Anthropic account`).action(async()=>{let{authLogout:e}=await import(`./auth-CjtaiRtF.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-BwZIRMh_.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-BwZIRMh_.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-BwZIRMh_.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-BwZIRMh_.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-BwZIRMh_.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-BwZIRMh_.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-BwZIRMh_.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-BwZIRMh_.js`);await n(e,t)}),l.command(`enable <plugin>`).description(`Enable a disabled plugin`).option(`-s, --scope <scope>`,`Installation scope: ${zl.join(`, `)} (default: auto-detect)`).addOption(s()).action(async(e,t)=>{let{pluginEnableHandler:n}=await import(`./plugins-BwZIRMh_.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: ${zl.join(`, `)} (default: auto-detect)`).addOption(s()).action(async(e,t)=>{let{pluginDisableHandler:n}=await import(`./plugins-BwZIRMh_.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: ${Rl.join(`, `)} (default: user)`).addOption(s()).action(async(e,t)=>{let{pluginUpdateHandler:n}=await import(`./plugins-BwZIRMh_.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-CMSErQoz.js`),import(`./src-poaoYkuc.js`)]);await e(await t(Yl(!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-D90TsYOf.js`);await e(),process.exit(0)}),No()!==`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-DEbM9UaE.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-DEbM9UaE.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-DEbM9UaE.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-Clap6Swl.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-Clap6Swl.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-Clap6Swl.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-Clap6Swl.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-Clap6Swl.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-Clap6Swl.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-BN0Sag35.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]
1377
+ `),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-CVT_db9n.js`),{serverUrl:r,authToken:i}=n(e),a;try{let e=await _p({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 gp?e.message:String(e)),process.exit(1)}let{runConnectHeadless:o}=await import(`./connectHeadless-DutPm1RT.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-CbQCc9vz.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-CbQCc9vz.js`);await t(e)}),o.command(`logout`).description(`Log out from your Anthropic account`).action(async()=>{let{authLogout:e}=await import(`./auth-CbQCc9vz.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-rdPgpjF8.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-rdPgpjF8.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-rdPgpjF8.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-rdPgpjF8.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-rdPgpjF8.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-rdPgpjF8.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-rdPgpjF8.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-rdPgpjF8.js`);await n(e,t)}),l.command(`enable <plugin>`).description(`Enable a disabled plugin`).option(`-s, --scope <scope>`,`Installation scope: ${zl.join(`, `)} (default: auto-detect)`).addOption(s()).action(async(e,t)=>{let{pluginEnableHandler:n}=await import(`./plugins-rdPgpjF8.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: ${zl.join(`, `)} (default: auto-detect)`).addOption(s()).action(async(e,t)=>{let{pluginDisableHandler:n}=await import(`./plugins-rdPgpjF8.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: ${Rl.join(`, `)} (default: user)`).addOption(s()).action(async(e,t)=>{let{pluginUpdateHandler:n}=await import(`./plugins-rdPgpjF8.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-SpgBY5_I.js`),import(`./src-BJM0zMNO.js`)]);await e(await t(Yl(!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-iMtFurok.js`);await e(),process.exit(0)}),No()!==`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-CGovMAzJ.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-CGovMAzJ.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-CGovMAzJ.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-BVXyNEj0.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-BVXyNEj0.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-BVXyNEj0.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-BVXyNEj0.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-BVXyNEj0.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-BVXyNEj0.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-KYR5iq6H.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]
1299
1378
 
1300
1379
  Attach the REPL as a viewer client to a running bridge session.
1301
1380
  Omit sessionId to discover and pick from available sessions.
1302
- `),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-CMSErQoz.js`),import(`./src-poaoYkuc.js`)]);await e(await t(Yl(!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-DaiW-V1N.js`);await e()}),process.env.USER_TYPE===`ant`&&n.command(`rollback [target]`).description(`[ANT-ONLY] Roll back to a previous release
1381
+ `),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-SpgBY5_I.js`),import(`./src-BJM0zMNO.js`)]);await e(await t(Yl(!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-DaiW-V1N.js`);await e()}),process.env.USER_TYPE===`ant`&&n.command(`rollback [target]`).description(`[ANT-ONLY] Roll back to a previous release
1303
1382
 
1304
1383
  Examples:
1305
1384
  claude rollback Go 1 version back from current
1306
1385
  claude rollback 3 Go 3 versions back from current
1307
- 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-CtS4yEQx.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-CMSErQoz.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-Cthn50OV.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=>Ko(e)||Number(e)).action(async e=>{let{logHandler:t}=await import(`./ant-DZjimiuz.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-DZjimiuz.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`,`
1386
+ 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-CtS4yEQx.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-SpgBY5_I.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-pqkACWbs.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=>Ko(e)||Number(e)).action(async e=>{let{logHandler:t}=await import(`./ant-CF1iRpXD.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-CF1iRpXD.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`,`
1308
1387
  Examples:
1309
1388
  $ claude export 0 conversation.txt Export conversation at log index 0
1310
1389
  $ claude export <uuid> conversation.txt Export conversation by session ID
1311
1390
  $ claude export input.json output.txt Render JSON log file to text
1312
- $ claude export <uuid>.jsonl output.txt Render JSONL session file to text`).action(async(e,t)=>{let{exportHandler:n}=await import(`./ant-DZjimiuz.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-DZjimiuz.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-DZjimiuz.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-DZjimiuz.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 (${cl.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-DZjimiuz.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-DZjimiuz.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-DZjimiuz.js`);await r(e,t,n)})}return U(`run_before_parse`),await n.parseAsync(process.argv),U(`run_after_parse`),U(`main_after_run`),Yr(),n}async function Hp({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:Sp?.isCoordinatorMode()?!0:void 0,...ae&&{assistantActivationPath:ae},autoUpdatesChannel:St().autoUpdatesChannel??`latest`,...process.env.USER_TYPE===`ant`?(()=>{let e=mr(),t=Cr(e),n=t?uu(t,e)||`.`:void 0;return n?{relativeProjectPath:n}:{}})():{}})}catch(e){H(e)}}function Up(t){if(t.proactive||m(process.env.CLAUDE_CODE_PROACTIVE)){let t=(tl(),e(Qc));t.isProactiveActive()||t.activateProactive(`command`)}}function Wp(t){let n=t.brief,r=m(process.env.CLAUDE_CODE_BRIEF);if(!n&&!r)return;let{isBriefEntitled:i}=(Ls(),e(ts)),a=i();a&&Ke(!0),B(`tengu_brief_mode_enabled`,{enabled:a,gated:!a,source:r?`env`:`flag`})}function Gp(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(ve)}function Kp(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{zp as main};
1391
+ $ claude export <uuid>.jsonl output.txt Render JSONL session file to text`).action(async(e,t)=>{let{exportHandler:n}=await import(`./ant-CF1iRpXD.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-CF1iRpXD.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-CF1iRpXD.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-CF1iRpXD.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 (${cl.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-CF1iRpXD.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-CF1iRpXD.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-CF1iRpXD.js`);await r(e,t,n)})}return U(`run_before_parse`),await n.parseAsync(process.argv),U(`run_after_parse`),U(`main_after_run`),Yr(),n}async function Wp({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:ee,dangerouslySkipPermissionsPassed:te,permissionMode:h,modeIsBypass:ne,allowDangerouslySkipPermissionsPassed:re,systemPromptFlag:ie,appendSystemPromptFlag:g,thinkingConfig:ae,assistantActivationPath:oe}){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,...ee&&{githubActionInputs:ee},dangerouslySkipPermissionsPassed:te,permissionMode:h,modeIsBypass:ne,inProtectedNamespace:l(),allowDangerouslySkipPermissionsPassed:re,thinkingType:ae.type,...ae.type===`enabled`&&{thinkingBudgetTokens:ae.budgetTokens},...ie&&{systemPromptFlag:ie},...g&&{appendSystemPromptFlag:g},is_simple:c()||void 0,is_coordinator:wp?.isCoordinatorMode()?!0:void 0,...oe&&{assistantActivationPath:oe},autoUpdatesChannel:St().autoUpdatesChannel??`latest`,...process.env.USER_TYPE===`ant`?(()=>{let e=mr(),t=Cr(e),n=t?uu(t,e)||`.`:void 0;return n?{relativeProjectPath:n}:{}})():{}})}catch(e){H(e)}}function Gp(t){if(t.proactive||m(process.env.CLAUDE_CODE_PROACTIVE)){let t=(tl(),e(Qc));t.isProactiveActive()||t.activateProactive(`command`)}}function Kp(t){let n=t.brief,r=m(process.env.CLAUDE_CODE_BRIEF);if(!n&&!r)return;let{isBriefEntitled:i}=(Ls(),e(ts)),a=i();a&&Ke(!0),B(`tengu_brief_mode_enabled`,{enabled:a,gated:!a,source:r?`env`:`flag`})}function qp(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(ye)}function Jp(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{Vp as main};