claude-code-best 2.6.5 → 2.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (438) hide show
  1. package/README.md +3 -5
  2. package/dist/chunks/{AddWorkspaceDirectory-BYyM_V0q.js → AddWorkspaceDirectory-YmrkKVv2.js} +1 -1
  3. package/dist/chunks/{App-BboadKdn.js → App-IAjCdPUn.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-CAvlRKLr.js +1 -0
  5. package/dist/chunks/{ApproveApiKey-BLp4742y.js → ApproveApiKey-DhsT69v7.js} +1 -1
  6. package/dist/chunks/{AssistantSessionChooser-B88DM0Oq.js → AssistantSessionChooser-DCUVNGfn.js} +1 -1
  7. package/dist/chunks/BackgroundTasksDialog-Di_gH2TW.js +2 -0
  8. package/dist/chunks/BypassPermissionsModeDialog-BeZqE75e.js +1 -0
  9. package/dist/chunks/{ClaudeInChromeOnboarding-B6XNhFqq.js → ClaudeInChromeOnboarding-CZHktpPE.js} +1 -1
  10. package/dist/chunks/{ClaudeMdExternalIncludesDialog-BNhlq7_K.js → ClaudeMdExternalIncludesDialog-Dofr1TYr.js} +1 -1
  11. package/dist/chunks/ClaudeMdExternalIncludesDialog-DrkzPawC.js +1 -0
  12. package/dist/chunks/ConsoleOAuthFlow-CtqOQRDT.js +1 -0
  13. package/dist/chunks/{DesktopHandoff-S-w4bs5T.js → DesktopHandoff-C8_CDNft.js} +1 -1
  14. package/dist/chunks/DevChannelsDialog-DkGWCFpL.js +1 -0
  15. package/dist/chunks/DiffDialog-93P95op8.js +3 -0
  16. package/dist/chunks/Doctor-CheDaF3O.js +1 -0
  17. package/dist/chunks/Doctor-Zd0UaR5d.js +3 -0
  18. package/dist/chunks/{ExitFlow-CSBDxw9H.js → ExitFlow-4edARxmd.js} +2 -2
  19. package/dist/chunks/Feedback-CZY-BikO.js +2 -0
  20. package/dist/chunks/Grove-CbcR0CsI.js +1 -0
  21. package/dist/chunks/{Grove-DSXRnXKv.js → Grove-TYf1glGP.js} +1 -1
  22. package/dist/chunks/{HybridTransport-CuT3KI5e.js → HybridTransport-BNexuwcN.js} +2 -2
  23. package/dist/chunks/{ITermBackend-mokGZVH_.js → ITermBackend-DuomVpsD.js} +1 -1
  24. package/dist/chunks/{InvalidConfigDialog-Bi4RKYlk.js → InvalidConfigDialog-Byury3Zx.js} +1 -1
  25. package/dist/chunks/{InvalidSettingsDialog-0zKo4-so.js → InvalidSettingsDialog-B8_0AvWo.js} +1 -1
  26. package/dist/chunks/MCPConnectionManager-xL_wQCda.js +1 -0
  27. package/dist/chunks/{McpParsingWarnings-EzgsOoHw.js → McpParsingWarnings-C6u4RM2a.js} +1 -1
  28. package/dist/chunks/MessageSelector-DAyH1noQ.js +3 -0
  29. package/dist/chunks/Messages-QH8_sB13.js +11 -0
  30. package/dist/chunks/{Onboarding-odmthwzz.js → Onboarding-XWhelEBr.js} +1 -1
  31. package/dist/chunks/{OverageCreditUpsell-Cpk_5Lv0.js → OverageCreditUpsell-BvPz1jLU.js} +1 -1
  32. package/dist/chunks/PluginSettings-D1YHfrE1.js +17 -0
  33. package/dist/chunks/{PromptInputFooterSuggestions-DrrkNOuS.js → PromptInputFooterSuggestions-rqUoa9Ch.js} +1 -1
  34. package/dist/chunks/{PromptInputHelpMenu-DMsF4D6d.js → PromptInputHelpMenu-OTViHSR0.js} +1 -1
  35. package/dist/chunks/QueryEngine-DigBggXq.js +1 -0
  36. package/dist/chunks/REPL-Cxh0Qnnt.js +1 -0
  37. package/dist/chunks/REPL-D2p-vgct.js +97 -0
  38. package/dist/chunks/{RemoteCallout-CnpCWRPk.js → RemoteCallout-CCIWIrd-.js} +1 -1
  39. package/dist/chunks/{RemoteSessionManager-OWg_Yccq.js → RemoteSessionManager-Dx81p5dH.js} +2 -2
  40. package/dist/chunks/ResumeConversation-73r3Zh5P.js +1 -0
  41. package/dist/chunks/{SSETransport-BpnapvlK.js → SSETransport-C9hd2v-w.js} +1 -1
  42. package/dist/chunks/SearchExtraToolsTool-BNpA8JzR.js +1 -0
  43. package/dist/chunks/SentryErrorBoundary-BFwcMSIK.js +1 -0
  44. package/dist/chunks/{SentryErrorBoundary-C-NlfQZw.js → SentryErrorBoundary-z8tMb-zO.js} +1 -1
  45. package/dist/chunks/Settings-D9qdaMe5.js +2 -0
  46. package/dist/chunks/{TeleportProgress-CYXay2ZL.js → TeleportProgress-CPXN7u3Z.js} +1 -1
  47. package/dist/chunks/{TeleportRepoMismatchDialog-_zbZTvcJ.js → TeleportRepoMismatchDialog-CiyXjTxq.js} +1 -1
  48. package/dist/chunks/{TeleportResumeWrapper-DiHQeZIM.js → TeleportResumeWrapper-Dao8ktHk.js} +1 -1
  49. package/dist/chunks/{ThemePicker-BRh027fA.js → ThemePicker-CFYFNnPp.js} +1 -1
  50. package/dist/chunks/{TmuxBackend-BaX2U7iZ.js → TmuxBackend-B5DBBugq.js} +1 -1
  51. package/dist/chunks/TrustDialog-DtIXHMR_.js +1 -0
  52. package/dist/chunks/{ValidationErrorsList-CdCUgfIl.js → ValidationErrorsList-BK0wOS55.js} +1 -1
  53. package/dist/chunks/{WelcomeV2-DCXcYd2x.js → WelcomeV2-BjUbi9vp.js} +1 -1
  54. package/dist/chunks/WindowsTerminalBackend-DFLLlAOp.js +2 -0
  55. package/dist/chunks/{add-dir-ldGd3Ppz.js → add-dir-JoVgNFOk.js} +1 -1
  56. package/dist/chunks/{agentDisplay-CVnAeURF.js → agentDisplay-B3RjWR-3.js} +1 -1
  57. package/dist/chunks/{agents-DH5fmbVw.js → agents-BUyLUAIu.js} +7 -7
  58. package/dist/chunks/{agents-C08NzRZx.js → agents-UqS5PhD2.js} +1 -1
  59. package/dist/chunks/{ant-DJren1Aa.js → ant-Bq1wIvnP.js} +1 -1
  60. package/dist/chunks/{api-CGOR_Xfl.js → api-O4eHGLTY.js} +1 -1
  61. package/dist/chunks/api-kAjsowcb.js +1 -0
  62. package/dist/chunks/{assistant-aWkDcurV.js → assistant-CMIbt3Ir.js} +1 -1
  63. package/dist/chunks/{assistant-BlzrMSkM.js → assistant-D5Tg_1ry.js} +1 -1
  64. package/dist/chunks/assistant-nOCkNa3_.js +1 -0
  65. package/dist/chunks/auth-CDOk9J9A.js +1 -0
  66. package/dist/chunks/{auth-CSB2RDKF.js → auth-D3SKo0wT.js} +1 -1
  67. package/dist/chunks/{autoMode-CWvZs1jO.js → autoMode-BIVJlkBM.js} +6 -6
  68. package/dist/chunks/{autonomy-DK42aJYt.js → autonomy-BYi6z9LD.js} +1 -1
  69. package/dist/chunks/{autonomy-BkVcSMCZ.js → autonomy-Mi7Fkq1J.js} +7 -7
  70. package/dist/chunks/{autonomyPanel-Cn4IhXgE.js → autonomyPanel-D_GsUMOf.js} +1 -1
  71. package/dist/chunks/backgroundHousekeeping-BG_UYxFF.js +17 -0
  72. package/dist/chunks/backgroundHousekeeping-wHy1eAso.js +1 -0
  73. package/dist/chunks/{branch-juox_fko.js → branch-BC-K45fw.js} +1 -1
  74. package/dist/chunks/{bridge-DudsCZkh.js → bridge-DBteRzgS.js} +2 -2
  75. package/dist/chunks/{bridgeConfig-lRZfQqmA.js → bridgeConfig-C_GoD1k5.js} +1 -1
  76. package/dist/chunks/bridgeConfig-V_pmBzSH.js +1 -0
  77. package/dist/chunks/bridgeEnabled-BxtxHb8R.js +1 -0
  78. package/dist/chunks/{bridgeEnabled-D2IykaHE.js → bridgeEnabled-cSK8a7tN.js} +1 -1
  79. package/dist/chunks/bridgeMain-CMNptMs4.js +1 -0
  80. package/dist/chunks/bridgeMain-QbfEOTqV.js +68 -0
  81. package/dist/chunks/{bridgeMessaging-CqNURC4-.js → bridgeMessaging-CqXQzew4.js} +1 -1
  82. package/dist/chunks/{btw-DKlE3Dea.js → btw-DBtPlEWc.js} +1 -1
  83. package/dist/chunks/{buddy-DQYgHR63.js → buddy-BYwTgNnf.js} +1 -1
  84. package/dist/chunks/{bypassPermissionsKillswitch-Bof-UtM-.js → bypassPermissionsKillswitch-DkYLp9m0.js} +1 -1
  85. package/dist/chunks/caches-B-GiT9hm.js +1 -0
  86. package/dist/chunks/{caches-B5QZDncQ.js → caches-DGW9ovtw.js} +2 -2
  87. package/dist/chunks/{ccrClient-BaWg4E9-.js → ccrClient-B9pi3b8Y.js} +1 -1
  88. package/dist/chunks/changeDetector-S1Jti1bW.js +1 -0
  89. package/dist/chunks/channelNotification-Bx6dpA7I.js +1 -0
  90. package/dist/chunks/{channelNotification-B7A-9DIl.js → channelNotification-n7Avue-9.js} +1 -1
  91. package/dist/chunks/{chrome-jMAks7-w.js → chrome-BwZPfW9Z.js} +1 -1
  92. package/dist/chunks/clear-BXv0Sq3m.js +1 -0
  93. package/dist/chunks/client-DNQukPEE.js +1 -0
  94. package/dist/chunks/color-BsBrog6H.js +1 -0
  95. package/dist/chunks/commands-BK3ugb0u.js +1 -0
  96. package/dist/chunks/commitAttribution-CtQYmnw-.js +1 -0
  97. package/dist/chunks/{commitAttribution-C22a3OCi.js → commitAttribution-q7SEukgl.js} +1 -1
  98. package/dist/chunks/{compact-BWvnb4or.js → compact-DiY1w7pT.js} +3 -3
  99. package/dist/chunks/{companion-Bkn2lSLj.js → companion-D18UNnC7.js} +1 -1
  100. package/dist/chunks/{config-BvpTbJ5p.js → config-CSHnElBp.js} +1 -1
  101. package/dist/chunks/{config-D-dzD6n-.js → config-D3QKcEKz.js} +1 -1
  102. package/dist/chunks/{context-DzNahdyP.js → context-DnyYrN2X.js} +1 -1
  103. package/dist/chunks/context-noninteractive-0YpW67KZ.js +1 -0
  104. package/dist/chunks/{context-noninteractive-yiyJriiw.js → context-noninteractive-CFlod2Eg.js} +2 -2
  105. package/dist/chunks/conversation-CRoOMglD.js +1 -0
  106. package/dist/chunks/conversation-DCG0fiGV.js +1 -0
  107. package/dist/chunks/{copy-9k9JPRqW.js → copy-CHGX-YpC.js} +2 -2
  108. package/dist/chunks/{createSSHSession-BZf-Loo5.js → createSSHSession-Bf-8h3Sw.js} +1 -1
  109. package/dist/chunks/createSession-BYf27ahD.js +1 -0
  110. package/dist/chunks/{createSession-kiTHYXSL.js → createSession-rRZIkjl3.js} +1 -1
  111. package/dist/chunks/{cronJitterConfig-CYP7yrQu.js → cronJitterConfig-DmBBJDTf.js} +3 -3
  112. package/dist/chunks/crossProjectResume-BQxLBpDD.js +40 -0
  113. package/dist/chunks/{datadog-Bg-zL-i7.js → datadog-Bb65d6yd.js} +1 -1
  114. package/dist/chunks/datadog-NnzM1Mu3.js +1 -0
  115. package/dist/chunks/{desktop-DpaStjc-.js → desktop-DiCA6RUU.js} +1 -1
  116. package/dist/chunks/{diff-N_VSBo3Z.js → diff-BvLQ-t8P.js} +1 -1
  117. package/dist/chunks/{doctor-CUWjbh1X.js → doctor-bmTXLycZ.js} +1 -1
  118. package/dist/chunks/{effort-loH1TUvE.js → effort-CSTwkB2B.js} +2 -2
  119. package/dist/chunks/{entry-D58E-E6Y.js → entry-BUwwv2dM.js} +4 -4
  120. package/dist/chunks/{envLessBridgeConfig-SPEr9oqO.js → envLessBridgeConfig-DJJKeDBT.js} +1 -1
  121. package/dist/chunks/envLessBridgeConfig-Dq02Vvx1.js +1 -0
  122. package/dist/chunks/{exit-D-tuPpbx.js → exit-eirVuF-n.js} +1 -1
  123. package/dist/chunks/{export-BIZ_SPXJ.js → export-CcJD8r8U.js} +1 -1
  124. package/dist/chunks/{exportRenderer-CWPSMaqM.js → exportRenderer-DtezFcml.js} +1 -1
  125. package/dist/chunks/{extra-usage-CCMwIa85.js → extra-usage-CBcgeIcJ.js} +1 -1
  126. package/dist/chunks/extra-usage-DhB0NElh.js +1 -0
  127. package/dist/chunks/{extra-usage-core-BNW4VT7o.js → extra-usage-core-DWM0Q56J.js} +1 -1
  128. package/dist/chunks/{extra-usage-noninteractive-B_WjXO1E.js → extra-usage-noninteractive-BvJEi4WX.js} +1 -1
  129. package/dist/chunks/{extraUsage-CNMMTNJi.js → extraUsage-CWde-Mi0.js} +1 -1
  130. package/dist/chunks/extractMemories-wcRNh_jz.js +1 -0
  131. package/dist/chunks/{fast-CG1v3fRr.js → fast-DQyJ7c7s.js} +1 -1
  132. package/dist/chunks/fast-ukzN3wl2.js +1 -0
  133. package/dist/chunks/{feedback-CG4mS_-B.js → feedback-BzBBKT2y.js} +1 -1
  134. package/dist/chunks/{firstPartyEventLogger-Y_jAnHoR.js → firstPartyEventLogger-BOHIpp-w.js} +1 -1
  135. package/dist/chunks/{flushGate-COPcye5f.js → flushGate-DeCDhkKp.js} +1 -1
  136. package/dist/chunks/{gates-CSKxLmMJ.js → gates-CAVdjC23.js} +1 -1
  137. package/dist/chunks/gates-CB_pFChT.js +1 -0
  138. package/dist/chunks/{gemini-B3uSLiNp.js → gemini-CFrOUVS4.js} +1 -1
  139. package/dist/chunks/{generateRecap-D7rG3jIm.js → generateRecap-Bcp5DiiO.js} +1 -1
  140. package/dist/chunks/{generateSessionName-zbqanivg.js → generateSessionName-DeFGkHct.js} +1 -1
  141. package/dist/chunks/{githubRepoPathMapping-B04nEUDG.js → githubRepoPathMapping-B07Wb07_.js} +1 -1
  142. package/dist/chunks/grok-DtidcVWD.js +1 -0
  143. package/dist/chunks/{growthbook-C_EY78Sn.js → growthbook-gLwBDK-r.js} +1 -1
  144. package/dist/chunks/{heapdump-CpmhJ55b.js → heapdump-BxQYlnPR.js} +1 -1
  145. package/dist/chunks/{help-EHn2neTv.js → help-Bi0sABuv.js} +1 -1
  146. package/dist/chunks/hooks-BTBhK9sh.js +1 -0
  147. package/dist/chunks/{hooks-BV6HqbU4.js → hooks-Cc_DxF9N.js} +2 -2
  148. package/dist/chunks/{hostAdapter-_SmFAVNf.js → hostAdapter-D9_d4gU0.js} +1 -1
  149. package/dist/chunks/{ide-DkN0KdTR.js → ide-3wDIOoZF.js} +2 -2
  150. package/dist/chunks/inboundAttachments-DBaPmCTv.js +1 -0
  151. package/dist/chunks/{inboundAttachments-DnGQw7Pf.js → inboundAttachments-DPMETKd6.js} +1 -1
  152. package/dist/chunks/initReplBridge-BWP41EGm.js +1 -0
  153. package/dist/chunks/{insights-Bs9kJDG6.js → insights-w7qM4YyA.js} +24 -24
  154. package/dist/chunks/{install-CFX_ph9z.js → install-N2FgArWv.js} +1 -1
  155. package/dist/chunks/{install-github-app-CvRjY1Wi.js → install-github-app-By39Zi78.js} +2 -2
  156. package/dist/chunks/{install-slack-app-DjhnVSe0.js → install-slack-app-CVwZphU-.js} +1 -1
  157. package/dist/chunks/{instrumentation-c5zlOWom.js → instrumentation-BkLEupDC.js} +3 -3
  158. package/dist/chunks/{job-3QwLq609.js → job-CgBE27O7.js} +1 -1
  159. package/dist/chunks/{keybindings-7mDm3UKD.js → keybindings-DHXJzU3E.js} +2 -2
  160. package/dist/chunks/{lang-DyyjY20G.js → lang-DLneRt1b.js} +1 -1
  161. package/dist/chunks/{language-CPRGmY8Q.js → language-BVAzlrRz.js} +1 -1
  162. package/dist/chunks/language-ZBygqv6V.js +1 -0
  163. package/dist/chunks/{launchAgentsPlatform-CpsMsTqQ.js → launchAgentsPlatform-CtfK0qPa.js} +1 -1
  164. package/dist/chunks/launchAutofixPr-CQBv0rQ0.js +18 -0
  165. package/dist/chunks/{launchLocalMemory-DlYQcEQJ.js → launchLocalMemory-BNE09TKr.js} +2 -2
  166. package/dist/chunks/{launchLocalVault-CP0AyPjj.js → launchLocalVault-Dw_NJUnd.js} +3 -3
  167. package/dist/chunks/{launchMemoryStores-BHoDFkJ5.js → launchMemoryStores-CRRB6Z5A.js} +1 -1
  168. package/dist/chunks/{launchOnboarding-CFTNXcnc.js → launchOnboarding-nMAF5iv7.js} +1 -1
  169. package/dist/chunks/{launchSchedule-5KQr6x_A.js → launchSchedule-Akq1AmK8.js} +1 -1
  170. package/dist/chunks/{launchSkillStore-D0yGuE68.js → launchSkillStore-Zwtasj13.js} +1 -1
  171. package/dist/chunks/{launchTeleport-DRKnXOwY.js → launchTeleport-BzlIYyll.js} +3 -3
  172. package/dist/chunks/{launchVault-XA-zAswX.js → launchVault-BevXlxJB.js} +1 -1
  173. package/dist/chunks/{loadAgentsDir-DI1a76pd.js → loadAgentsDir-DF6FgRn-.js} +812 -785
  174. package/dist/chunks/loadAgentsDir-OIIKHPq9.js +1 -0
  175. package/dist/chunks/loadPluginHooks-DBHkyJaj.js +1 -0
  176. package/dist/chunks/localSearch-DslXIfeC.js +1 -0
  177. package/dist/chunks/{localSearch-CDOJNc_E.js → localSearch-v4itMlCM.js} +1 -1
  178. package/dist/chunks/{login-nwTOoyxv.js → login-CKodBzyZ.js} +1 -1
  179. package/dist/chunks/login-CTIVwgFU.js +1 -0
  180. package/dist/chunks/{logoV2Utils-DDUoPClc.js → logoV2Utils-VebeEs7Y.js} +1 -1
  181. package/dist/chunks/logout-B3MyP8fk.js +1 -0
  182. package/dist/chunks/{magicDocs-CmUlOWjI.js → magicDocs-uX5n3NKh.js} +2 -2
  183. package/dist/chunks/{main-CeG_nUsC.js → main-Cd_i0ZPo.js} +40 -40
  184. package/dist/chunks/{mappers-CJ8IO1o1.js → mappers-CPL2ni36.js} +1 -1
  185. package/dist/chunks/{mcp-CanCqnch.js → mcp-Ci_TbB5m.js} +2 -2
  186. package/dist/chunks/mcp-DeWOD4B4.js +1 -0
  187. package/dist/chunks/mcp-Dhp1SaId.js +6 -0
  188. package/dist/chunks/{mcpServer-lIneUZ5p.js → mcpServer-CPJo2eKm.js} +1 -1
  189. package/dist/chunks/{mcpServer-DPHQVYdC.js → mcpServer-CTuPkyD6.js} +1 -1
  190. package/dist/chunks/{memory-BcWBkKV8.js → memory-enMuKEnU.js} +1 -1
  191. package/dist/chunks/{model-DJLzVvcF.js → model-4f3U2YMu.js} +1 -1
  192. package/dist/chunks/model-BsHyPvD0.js +1 -0
  193. package/dist/chunks/{onChangeAppState-Dxbl8fvk.js → onChangeAppState-DxTGoS7j.js} +1 -1
  194. package/dist/chunks/openai-CwG_KpH1.js +10 -0
  195. package/dist/chunks/openaiShared-Bjrci9n8.js +1 -0
  196. package/dist/chunks/{overageCreditGrant-DLKadMYU.js → overageCreditGrant-CCkJVN9k.js} +1 -1
  197. package/dist/chunks/{passes-BIfuerjL.js → passes-O0VEQz1a.js} +1 -1
  198. package/dist/chunks/{paths-BBvuDQl9.js → paths-o5iA-EnQ.js} +6 -6
  199. package/dist/chunks/permissions-BtYQvivG.js +3 -0
  200. package/dist/chunks/{pipeTransport-DVoIA1uN.js → pipeTransport-BEfqa7Uh.js} +1 -1
  201. package/dist/chunks/{plan--lnWxB3Q.js → plan-Jw4GjVL0.js} +1 -1
  202. package/dist/chunks/{plugin-DWLyrLw4.js → plugin-DZq0voFR.js} +1 -1
  203. package/dist/chunks/{pluginAutoupdate-CGXIWBrb.js → pluginAutoupdate-D19vNoOp.js} +1 -1
  204. package/dist/chunks/{pluginBlocklist-DJrMdzT0.js → pluginBlocklist-DeX8I4dK.js} +1 -1
  205. package/dist/chunks/{pluginCliCommands-C08q9dHk.js → pluginCliCommands-CMgqxOaT.js} +1 -1
  206. package/dist/chunks/{pluginFlagging-Dggxke70.js → pluginFlagging-DFLE5fkh.js} +1 -1
  207. package/dist/chunks/{pluginOperations-CNCImIe8.js → pluginOperations-BTz69m3_.js} +2 -2
  208. package/dist/chunks/{pluginStartupCheck-BW2fjg2P.js → pluginStartupCheck-CWWKwD5F.js} +1 -1
  209. package/dist/chunks/pluginStartupCheck-Non969kz.js +1 -0
  210. package/dist/chunks/{plugins-DQ3CRWWO.js → plugins-BPUnAc0r.js} +4 -4
  211. package/dist/chunks/policyLimits-D6dpS-CU.js +1 -0
  212. package/dist/chunks/{pollConfig-DAQ-ives.js → pollConfig-DyHumJli.js} +1 -1
  213. package/dist/chunks/{poor-DqfrQT61.js → poor-CHHZIPDW.js} +1 -1
  214. package/dist/chunks/{poorMode-DzYT47KW.js → poorMode-7N6J6YN2.js} +1 -1
  215. package/dist/chunks/poorMode-DX4EXe0o.js +1 -0
  216. package/dist/chunks/print-QCXJDmz0.js +39 -0
  217. package/dist/chunks/{privacy-settings-agwqjYJo.js → privacy-settings-DR0_P3JF.js} +1 -1
  218. package/dist/chunks/processBashCommand-CkqKsBSD.js +1 -0
  219. package/dist/chunks/processSlashCommand-DIk_hLHW.js +6 -0
  220. package/dist/chunks/prompt-2ia5b-QO.js +1 -0
  221. package/dist/chunks/prompt-CNtVpGdl.js +1 -0
  222. package/dist/chunks/{prompt-CjFAtm3w.js → prompt-DiHksuOs.js} +1 -1
  223. package/dist/chunks/{promptEditor-EgosPsy-.js → promptEditor-B3S5E5Q7.js} +2 -2
  224. package/dist/chunks/{protocolHandler-mtPUT9U0.js → protocolHandler-D1XT2l3j.js} +1 -1
  225. package/dist/chunks/rate-limit-options-DHh1ksB5.js +1 -0
  226. package/dist/chunks/rcDebugLog-BNojB_eB.js +11 -0
  227. package/dist/chunks/{referral-DeDr9zAE.js → referral-BADm5sBf.js} +1 -1
  228. package/dist/chunks/refresh-D48fjYJ4.js +1 -0
  229. package/dist/chunks/{registerProtocol-BZBH8Zgl.js → registerProtocol-Dzmi6VC4.js} +1 -1
  230. package/dist/chunks/{registry-Dz6AbiYP.js → registry-CEu_N3dS.js} +1 -1
  231. package/dist/chunks/{release-notes-DiUNOrg9.js → release-notes-Dr61jYDO.js} +1 -1
  232. package/dist/chunks/{releaseNotes-CnhQit0y.js → releaseNotes-5SV7C5aV.js} +2 -2
  233. package/dist/chunks/{reload-plugins-Dx52GcaG.js → reload-plugins-BxuE-21F.js} +1 -1
  234. package/dist/chunks/{remote-env-B67Oo3sI.js → remote-env-BaQjT5em.js} +1 -1
  235. package/dist/chunks/{remoteBridgeCore-BzSUgPbt.js → remoteBridgeCore-B8MjcW6f.js} +1 -1
  236. package/dist/chunks/{remoteControlServer-L8smP7Zu.js → remoteControlServer-BvoNcg9D.js} +2 -2
  237. package/dist/chunks/{rename-C4PauyTZ.js → rename-B3q0tgmd.js} +1 -1
  238. package/dist/chunks/{resume-CrSn26xq.js → resume-BSGOqus7.js} +2 -2
  239. package/dist/chunks/{runtimeObserver-YNy3mIb7.js → runtimeObserver-Bb6wSUMJ.js} +1 -1
  240. package/dist/chunks/{runtimeObserver-nAhH4Wca.js → runtimeObserver-BbwUiToa.js} +2 -2
  241. package/dist/chunks/sandbox-adapter-Cr6f6gjf.js +1 -0
  242. package/dist/chunks/{sandbox-toggle-BYqbcI5d.js → sandbox-toggle-L7YPKXba.js} +1 -1
  243. package/dist/chunks/searchExtraTools-DRVIhwVJ.js +1 -0
  244. package/dist/chunks/{sentry-BNVxoVLS.js → sentry-DG3ru8XE.js} +1 -1
  245. package/dist/chunks/{session-BuEmHrqM.js → session-B5wA2K9M.js} +2 -2
  246. package/dist/chunks/{sessionDiscovery-Mcsfa0g-.js → sessionDiscovery-DijWFNjj.js} +1 -1
  247. package/dist/chunks/sessionFileAccessHooks-DnbPctQc.js +1 -0
  248. package/dist/chunks/sessionMemory-BOT9f5f0.js +1 -0
  249. package/dist/chunks/sessionMemory-CeWjRuFL.js +1 -0
  250. package/dist/chunks/sessionMemoryUtils-B47JMJa2.js +1 -0
  251. package/dist/chunks/sessionObserver-BNZflr2e.js +1 -0
  252. package/dist/chunks/{sessionObserver-DG2zQgfi.js → sessionObserver-CsDT2GnB.js} +1 -1
  253. package/dist/chunks/sessionStorage-BUuPrnU0.js +1 -0
  254. package/dist/chunks/{sessionTitle-zUVSAHO7.js → sessionTitle-CxmvZO71.js} +2 -2
  255. package/dist/chunks/{sessionTracing-DoRJ4nSa.js → sessionTracing-Cy5dAplG.js} +1 -1
  256. package/dist/chunks/{settingsSync-B9bz77E1.js → settingsSync-54E8xV8N.js} +1 -1
  257. package/dist/chunks/setup-B5CMpp0c.js +2 -0
  258. package/dist/chunks/{setup-CCOLlRtP.js → setup-GJtdESQj.js} +1 -1
  259. package/dist/chunks/{setup-B1JbPepL.js → setup-KWELOokh.js} +1 -1
  260. package/dist/chunks/{shadowedRuleDetection-BBR3uEgx.js → shadowedRuleDetection-C4NGjljb.js} +1 -1
  261. package/dist/chunks/{sideQuestion-DHW5rgKz.js → sideQuestion-DBrzdgkl.js} +1 -1
  262. package/dist/chunks/{sink-DxDOsLa2.js → sink-BKc24wdw.js} +1 -1
  263. package/dist/chunks/sink-DG0SNHP7.js +1 -0
  264. package/dist/chunks/{sinks-BrrTUxkC.js → sinks-BTS1DWM4.js} +2 -2
  265. package/dist/chunks/sinks-Cbp-8X1S.js +1 -0
  266. package/dist/chunks/{skill-learning-C0nOKZfg.js → skill-learning-C5NrosiL.js} +1 -1
  267. package/dist/chunks/skillChangeDetector-NJrEtU47.js +1 -0
  268. package/dist/chunks/{skillGapStore-_YuJP5KI.js → skillGapStore-D1rkePoo.js} +2 -2
  269. package/dist/chunks/{skillGapStore-Czi5jKjJ.js → skillGapStore-uXpRqLGG.js} +1 -1
  270. package/dist/chunks/{skillGenerator-kbaRbpqJ.js → skillGenerator-Deog7yBO.js} +2 -2
  271. package/dist/chunks/skillLearning-BHjRTDJw.js +1 -0
  272. package/dist/chunks/skillLearning-By7jxHSI.js +1 -0
  273. package/dist/chunks/{skillPanel-BxDvlPzd.js → skillPanel-Bx63GX9w.js} +3 -3
  274. package/dist/chunks/{skillSearchPanel-D-MX6Qgt.js → skillSearchPanel-CM5EZGkH.js} +4 -4
  275. package/dist/chunks/{skills-NpEgFkFZ.js → skills-JvC7Ms0P.js} +1 -1
  276. package/dist/chunks/{sprites-DD4eIkN7.js → sprites-YBiqlYch.js} +1 -1
  277. package/dist/chunks/{stats-xL3NHwhp.js → stats-BJMKNvVK.js} +1 -1
  278. package/dist/chunks/{status-B5E70xRv.js → status-DAJ28yxZ.js} +1 -1
  279. package/dist/chunks/{statusNoticeHelpers-DcssRhLw.js → statusNoticeHelpers-B7nbsqLz.js} +1 -1
  280. package/dist/chunks/{tag-BELr-qIa.js → tag-B4y7cBqH.js} +1 -1
  281. package/dist/chunks/{tasks-CrdWcSt-.js → tasks-CSye58Ap.js} +1 -1
  282. package/dist/chunks/{teamHelpers--3ZyNDlv.js → teamHelpers-BFZ4eVwW.js} +1 -1
  283. package/dist/chunks/teamHelpers-CKBoDEPj.js +1 -0
  284. package/dist/chunks/teammateModeSnapshot-BfOLEMKn.js +1 -0
  285. package/dist/chunks/{teammateModeSnapshot-DOQMTKbQ.js → teammateModeSnapshot-DXc2vyo2.js} +1 -1
  286. package/dist/chunks/teleport-NN6zSxxe.js +1 -0
  287. package/dist/chunks/{templateJobs-8IY2Cgig.js → templateJobs-DAVqqU0g.js} +1 -1
  288. package/dist/chunks/{terminalSetup-Lyg4NbGA.js → terminalSetup-DqL65XR2.js} +1 -1
  289. package/dist/chunks/{terminalSetup-C4psrmpb.js → terminalSetup-jZKBoPTc.js} +1 -1
  290. package/dist/chunks/{theme-B8GNnJ_q.js → theme-DPv2L3ut.js} +1 -1
  291. package/dist/chunks/thinkback-B0OSwcPG.js +1 -0
  292. package/dist/chunks/thinkback-play-D_uOESmO.js +1 -0
  293. package/dist/chunks/thinkback-tcfR5Uod.js +1 -0
  294. package/dist/chunks/{toolEventObserver-DzLd0MSn.js → toolEventObserver-CtApZXry.js} +1 -1
  295. package/dist/chunks/{toolEventObserver-D0TSHm01.js → toolEventObserver-D6ZTtdh_.js} +1 -1
  296. package/dist/chunks/toolPool-DFpa-yul.js +1 -0
  297. package/dist/chunks/toolPool-DqemSx_r.js +1 -0
  298. package/dist/chunks/{trustedDevice-BvYYXfd8.js → trustedDevice-Bxn7WW5C.js} +1 -1
  299. package/dist/chunks/{trustedDevice-1iTu4LEm.js → trustedDevice-DsgCQRsJ.js} +1 -1
  300. package/dist/chunks/{ultrareviewCommand-BTXAN2wP.js → ultrareviewCommand-BfuSrdXz.js} +2 -2
  301. package/dist/chunks/undercover-B-R6dhHB.js +1 -0
  302. package/dist/chunks/{undercover-DvvnEmsX.js → undercover-CM8zTx5g.js} +1 -1
  303. package/dist/chunks/{updateCCB-C-qfLi0j.js → updateCCB-DTArxdyR.js} +4 -4
  304. package/dist/chunks/upgrade-CCrHxXrm.js +1 -0
  305. package/dist/chunks/{upgrade-DTBZSxwv.js → upgrade-CEd1Jxw_.js} +1 -1
  306. package/dist/chunks/{upload-BF8tf_Eo.js → upload-DNo3bZLc.js} +1 -1
  307. package/dist/chunks/{usage-DvSTXEYY.js → usage-DEwRsc7E.js} +1 -1
  308. package/dist/chunks/{usage-BRYRRgNt.js → usage-X4-qec8g.js} +1 -1
  309. package/dist/chunks/useMainLoopModel-2A9HV1H3.js +1 -0
  310. package/dist/chunks/{useManagePlugins-GmnI9K53.js → useManagePlugins-D9MBag8O.js} +1 -1
  311. package/dist/chunks/{useMergedTools-Dah5KDMi.js → useMergedTools-DCYrP_YE.js} +1 -1
  312. package/dist/chunks/{useSearchInput-BV_azHiA.js → useSearchInput-CepwLBvi.js} +1 -1
  313. package/dist/chunks/useSettingsErrors-C8ffWXbY.js +1 -0
  314. package/dist/chunks/{useVoice-DR69NLxp.js → useVoice-vHZVaTAN.js} +1 -1
  315. package/dist/chunks/{util-BpyJ4Bom.js → util-B13MVSse.js} +1 -1
  316. package/dist/chunks/utils-C-vk0zpl.js +1 -0
  317. package/dist/chunks/{validatePlugin-vptAYuYu.js → validatePlugin-Cf_toBOJ.js} +1 -1
  318. package/dist/chunks/{vim-DvOw8dfR.js → vim-6p7eiRPG.js} +1 -1
  319. package/dist/chunks/{voice-B3BZs53f.js → voice-Bvc_BxoI.js} +2 -2
  320. package/dist/chunks/{voiceModeEnabled-DA76xN1Q.js → voiceModeEnabled-BPbOh6jd.js} +1 -1
  321. package/dist/chunks/voiceModeEnabled-JSBux8GA.js +1 -0
  322. package/dist/chunks/{voiceStreamSTT-_w1VjIOs.js → voiceStreamSTT-CzCUhap3.js} +1 -1
  323. package/dist/chunks/voiceStreamSTT-D9ER6Ml3.js +1 -0
  324. package/dist/chunks/{workerRegistry-2_MZVih1.js → workerRegistry-DCtC-WN3.js} +1 -1
  325. package/dist/chunks/worktree-Dv0mPuy_.js +1 -0
  326. package/dist/chunks/{xml-Dx--sNE1.js → xml-CqxiCY4v.js} +1 -1
  327. package/dist/cli.js +1 -1
  328. package/package.json +1 -1
  329. package/dist/chunks/ApproveApiKey-DiEe4eui.js +0 -1
  330. package/dist/chunks/BackgroundTasksDialog-ByraVuXh.js +0 -2
  331. package/dist/chunks/BypassPermissionsModeDialog-BDvmz12S.js +0 -1
  332. package/dist/chunks/ClaudeMdExternalIncludesDialog-B4ocUjev.js +0 -1
  333. package/dist/chunks/ConsoleOAuthFlow-BvaB9b0y.js +0 -1
  334. package/dist/chunks/DevChannelsDialog-BljR0X9X.js +0 -1
  335. package/dist/chunks/DiffDialog-BhQ2QaLW.js +0 -3
  336. package/dist/chunks/Doctor-BXb0qv6n.js +0 -3
  337. package/dist/chunks/Doctor-C5DYPEGl.js +0 -1
  338. package/dist/chunks/Feedback-DwHzc4UT.js +0 -2
  339. package/dist/chunks/Grove-DnTo982-.js +0 -1
  340. package/dist/chunks/MCPConnectionManager-DYGoS1Ht.js +0 -1
  341. package/dist/chunks/MessageSelector-DTmUuEKJ.js +0 -3
  342. package/dist/chunks/Messages-DWiKTx5o.js +0 -11
  343. package/dist/chunks/PluginSettings-eYcWehI8.js +0 -17
  344. package/dist/chunks/QueryEngine-C_KZts4y.js +0 -1
  345. package/dist/chunks/REPL-C6YR0VKU.js +0 -1
  346. package/dist/chunks/REPL-DzHz-LOY.js +0 -97
  347. package/dist/chunks/ResumeConversation-BktSnsCm.js +0 -1
  348. package/dist/chunks/SearchExtraToolsTool-CqFD8vVS.js +0 -1
  349. package/dist/chunks/SentryErrorBoundary-BUirJRWU.js +0 -1
  350. package/dist/chunks/Settings-vfFvcweR.js +0 -2
  351. package/dist/chunks/TrustDialog-CVbzrv6g.js +0 -1
  352. package/dist/chunks/WindowsTerminalBackend-BE9NX5IH.js +0 -2
  353. package/dist/chunks/api-6tcwJlf_.js +0 -1
  354. package/dist/chunks/assistant-CwbhlCM-.js +0 -1
  355. package/dist/chunks/auth-GxZhOvQ1.js +0 -1
  356. package/dist/chunks/backgroundHousekeeping-BIZTAYho.js +0 -17
  357. package/dist/chunks/backgroundHousekeeping-Csh58CxV.js +0 -1
  358. package/dist/chunks/bridgeConfig-D4tpc568.js +0 -1
  359. package/dist/chunks/bridgeEnabled-B8_c_Ppq.js +0 -1
  360. package/dist/chunks/bridgeMain-C5RDihlX.js +0 -68
  361. package/dist/chunks/bridgeMain-D7_lg2iJ.js +0 -1
  362. package/dist/chunks/caches-dGk7xsDu.js +0 -1
  363. package/dist/chunks/changeDetector-DoLfg8a6.js +0 -1
  364. package/dist/chunks/channelNotification-DDErroWn.js +0 -1
  365. package/dist/chunks/clear-OudnCGa7.js +0 -1
  366. package/dist/chunks/client-DxDmXXTh.js +0 -1
  367. package/dist/chunks/color-DG_R5-hl.js +0 -1
  368. package/dist/chunks/commands-BWIOEBPs.js +0 -1
  369. package/dist/chunks/commitAttribution-BA4fcbHf.js +0 -1
  370. package/dist/chunks/context-noninteractive-CM1-lUSe.js +0 -1
  371. package/dist/chunks/conversation-DKlz47xf.js +0 -1
  372. package/dist/chunks/conversation-cUxdb8MN.js +0 -1
  373. package/dist/chunks/createSession-BuJcoBAj.js +0 -1
  374. package/dist/chunks/crossProjectResume-BJisir9Z.js +0 -40
  375. package/dist/chunks/datadog-CVeFkaQu.js +0 -1
  376. package/dist/chunks/envLessBridgeConfig-CT8sdmFu.js +0 -1
  377. package/dist/chunks/extra-usage-rdJ7ecEb.js +0 -1
  378. package/dist/chunks/extractMemories-BrvZVsmM.js +0 -1
  379. package/dist/chunks/fast-CLKKsx2H.js +0 -1
  380. package/dist/chunks/gates-CSHuXnUx.js +0 -1
  381. package/dist/chunks/grok-CDOpos8E.js +0 -1
  382. package/dist/chunks/hooks-BFdX17Za.js +0 -1
  383. package/dist/chunks/inboundAttachments-BVUunfAX.js +0 -1
  384. package/dist/chunks/initReplBridge-tPRGPBq7.js +0 -1
  385. package/dist/chunks/language-Cf6bMI4N.js +0 -1
  386. package/dist/chunks/launchAutofixPr-D9h6YAZY.js +0 -2
  387. package/dist/chunks/loadAgentsDir-DCyiY0MN.js +0 -1
  388. package/dist/chunks/loadPluginHooks-C0Ei-0E2.js +0 -1
  389. package/dist/chunks/localSearch-MBx7KzC2.js +0 -1
  390. package/dist/chunks/login-D8UKKaud.js +0 -1
  391. package/dist/chunks/logout-B0BjqlGi.js +0 -1
  392. package/dist/chunks/mcp-Dq0kxZFx.js +0 -6
  393. package/dist/chunks/mcp-zbxZM9BP.js +0 -1
  394. package/dist/chunks/model-H3rtl6eR.js +0 -1
  395. package/dist/chunks/openai-DkYK4THc.js +0 -10
  396. package/dist/chunks/openaiShared-D5lOejS1.js +0 -16
  397. package/dist/chunks/permissions-S2EvIRKj.js +0 -3
  398. package/dist/chunks/pluginStartupCheck-DpxQPXJE.js +0 -1
  399. package/dist/chunks/policyLimits-BotYrS-v.js +0 -1
  400. package/dist/chunks/poorMode-DEAe3hiK.js +0 -1
  401. package/dist/chunks/print-GGVp62vj.js +0 -39
  402. package/dist/chunks/processBashCommand-DHHN8Ca4.js +0 -1
  403. package/dist/chunks/processSlashCommand-COtIO6Jy.js +0 -6
  404. package/dist/chunks/prompt-CO160cIr.js +0 -1
  405. package/dist/chunks/prompt-GY9hlRvI.js +0 -1
  406. package/dist/chunks/rate-limit-options-C6SFOHue.js +0 -1
  407. package/dist/chunks/rcDebugLog-CPKZCtR8.js +0 -11
  408. package/dist/chunks/refresh-D7pdoY_X.js +0 -1
  409. package/dist/chunks/sandbox-adapter-CzwHes1i.js +0 -1
  410. package/dist/chunks/searchExtraTools-CcpdCO6l.js +0 -1
  411. package/dist/chunks/sessionFileAccessHooks-qnNiGMnE.js +0 -1
  412. package/dist/chunks/sessionMemory-CMahwDdW.js +0 -1
  413. package/dist/chunks/sessionMemory-pFSn4HSN.js +0 -1
  414. package/dist/chunks/sessionMemoryUtils-Du5jUl7M.js +0 -1
  415. package/dist/chunks/sessionObserver-Je868MC9.js +0 -1
  416. package/dist/chunks/sessionStorage-D3FhAADV.js +0 -1
  417. package/dist/chunks/setup-DWkSjA49.js +0 -2
  418. package/dist/chunks/sink-cQOgsnw3.js +0 -1
  419. package/dist/chunks/sinks-Djiz_5-Z.js +0 -1
  420. package/dist/chunks/skillChangeDetector-D8C-uQSQ.js +0 -1
  421. package/dist/chunks/skillLearning-3KWrBczS.js +0 -1
  422. package/dist/chunks/skillLearning-DBbdGbk-.js +0 -1
  423. package/dist/chunks/teamHelpers-CUAiXng3.js +0 -1
  424. package/dist/chunks/teammateModeSnapshot-C6EWhR0X.js +0 -1
  425. package/dist/chunks/teleport-LXFOan9C.js +0 -1
  426. package/dist/chunks/thinkback-DPXwEK3B.js +0 -1
  427. package/dist/chunks/thinkback-DZW3Mcx_.js +0 -1
  428. package/dist/chunks/thinkback-play-BMOE-ceh.js +0 -1
  429. package/dist/chunks/toolPool-DVOfpjDz.js +0 -1
  430. package/dist/chunks/toolPool-Dq-Vtvrj.js +0 -1
  431. package/dist/chunks/undercover-C_44e3oN.js +0 -1
  432. package/dist/chunks/upgrade-CGXa5Dwy.js +0 -1
  433. package/dist/chunks/useMainLoopModel-CwvuTRXn.js +0 -1
  434. package/dist/chunks/useSettingsErrors-C-j_Zt7g.js +0 -1
  435. package/dist/chunks/utils-CrZcpypC.js +0 -1
  436. package/dist/chunks/voiceModeEnabled-DIveLYGb.js +0 -1
  437. package/dist/chunks/voiceStreamSTT-hpzWd_zl.js +0 -1
  438. package/dist/chunks/worktree-CCuDwRmS.js +0 -1
@@ -1,39 +0,0 @@
1
- import{a as e}from"./chunk-DR8-3Aex.js";import{c as t,l as n,s as r,u as i}from"./envUtils-BWeoiL4Y.js";import{n as a,t as o}from"./defineProperty-80gRi2ZW.js";import{B as s,b as c,v as l}from"./server-DzOdtq8A.js";import{Ct as u,F as d,In as f,R as p,Tn as m,Vn as h,_n as g,_r as ee,cn as _,jr as te,ln as v,nr as y,tr as b,tt as x,y as S}from"./state-sIHsFpDu.js";import{Aa as C,Br as w,Bt as ne,C as re,Cr as ie,Dr as ae,El as T,Et as oe,Fa as se,Ki as ce,Ma as E,Ml as le,Na as ue,Ot as D,Pr as O,Rr as de,S as fe,Si as pe,Tl as me,Xn as he,Xo as k,Yn as A,_ as ge,a as _e,bl as ve,c as ye,jl as be,kt as xe,ls as Se,ms as Ce,no as j,on as we,oo as Te,pi as Ee,qi as De,ss as Oe,to as ke,vi as M,xi as Ae,xs as N,yi as je,yl as Me}from"./paths-BBvuDQl9.js";import{E as P,K as Ne,L as F,T as Pe,V as Fe,X as Ie,Y as Le,c as Re,d as I,h as ze,p as Be,s as L,w as R}from"./debug-UI3T040K.js";import{n as Ve,r as z}from"./analytics-DqMQntaB.js";import{n as He,t as Ue}from"./cwd--iizewsn.js";import{i as We,n as B,o as V}from"./process-DMKLUQIO.js";import{F as Ge,I as Ke,P as H}from"./git-CN3qtTb_.js";import{J as qe,K as Je,c as Ye,et as U,i as Xe,o as Ze,s as W}from"./log-CzsijfHZ.js";import{i as Qe,n as $e}from"./path-C4kbwvSH.js";import{s as et,u as tt}from"./types-Csi32ZXh.js";import{C as nt,c as rt,d as it,l as at,m as ot,s as st,x as G}from"./teammate-DMYOtLTK.js";import{n as ct,t as lt}from"./sleep-8Eb9j_Ly.js";import{$A as ut,$r as dt,AD as ft,Ar as pt,Ba as mt,CD as ht,CT as gt,Cn as _t,Cv as vt,Cx as yt,D as bt,DE as xt,DO as St,Di as Ct,Ei as wt,Ex as Tt,F as Et,FD as Dt,FS as Ot,Fc as kt,G as At,GE as jt,GT as Mt,Gi as Nt,HA as Pt,HD as Ft,HT as It,Hi as Lt,ID as Rt,IS as zt,IT as Bt,Ic as Vt,Is as Ht,JT as Ut,Jv as Wt,K as Gt,KE as Kt,KT as K,Ks as qt,Kv as Jt,LC as Yt,LD as Xt,L_ as Zt,Lo as Qt,Ls as $t,MD as en,Ml as tn,My as nn,ND as rn,Nc as an,O as on,OO as sn,Of as cn,Or as ln,PD as un,Pc as dn,Qh as fn,RD as pn,RE as mn,RT as hn,R_ as gn,Ra as _n,S as vn,SC as yn,SD as bn,ST as xn,Sv as Sn,TE as Cn,Tv as wn,Tx as Tn,Us as En,Uu as Dn,VD as On,VT as kn,Vs as An,Vt as jn,Wh as Mn,Wu as Nn,XC as Pn,XD as Fn,XE as In,Xi as Ln,Xv as Rn,YE as zn,Yv as Bn,ZA as Vn,ZE as Hn,_b as Un,_c as Wn,_x as Gn,aE as Kn,ab as qn,as as Jn,au as Yn,bc as Xn,bx as Zn,cE as Qn,cO as q,cj as $n,cs as er,di as tr,ej as nr,ey as rr,fA as ir,fc as ar,fi as or,fs as sr,gA as cr,gE as lr,gc as ur,gi as dr,gx as fr,hE as pr,hO as mr,hc as hr,hi as gr,hv as _r,iA as vr,iC as yr,ip as br,ir as xr,iw as Sr,jD as Cr,jT as wr,jl as Tr,jy as Er,kD as J,kf as Dr,kr as Or,la as kr,lb as Ar,lr as jr,lw as Mr,mO as Nr,mc as Pr,ms as Fr,mw as Ir,mx as Lr,ng as Rr,nu as zr,o as Br,oC as Vr,oE as Hr,oO as Ur,os as Wr,ow as Gr,p as Kr,pO as qr,pc as Jr,po as Yr,qC as Xr,qD as Zr,qE as Qr,qT as $r,qu as ei,rj as ti,rp as ni,ru as ri,rw as ii,s as ai,sC as oi,sE as si,sO as ci,tA as li,tg as ui,ty as di,u as fi,uj as pi,uw as mi,vE as hi,vO as gi,vb as _i,vc as vi,vi as yi,vv as bi,w as xi,wC as Si,wn as Ci,wv as wi,x as Ti,xC as Ei,xO as Di,xc as Oi,yE as ki,yc as Ai,yn as ji,yv as Mi,zD as Ni,zE as Pi,zi as Fi}from"./loadAgentsDir-DI1a76pd.js";import{F as Ii,Hn as Li,Ht as Ri,M as zi,Nt as Bi,Pt as Vi,Vn as Hi,_t as Ui,pn as Wi,vt as Gi,xn as Ki}from"./prompt-CjFAtm3w.js";import{i as qi,o as Ji}from"./xml-Dx--sNE1.js";import{a as Yi,o as Xi,s as Zi}from"./fileStateCache-C7-TxF8G.js";import{A as Qi,C as $i,D as ea,N as ta,O as na,P as ra,Z as ia,_ as aa,d as oa,g as sa,h as ca,m as la,u as ua,v as da,y as fa}from"./rcDebugLog-CPKZCtR8.js";import{c as pa,l as ma}from"./commitAttribution-C22a3OCi.js";import{P as ha,V as ga,a as _a,d as va}from"./teamHelpers--3ZyNDlv.js";import{t as ya}from"./pollConfig-DAQ-ives.js";import{r as ba}from"./inboundAttachments-DnGQw7Pf.js";import{i as xa,n as Sa,s as Ca}from"./mappers-CJ8IO1o1.js";import{n as wa,r as Ta}from"./sessionTitle-zUVSAHO7.js";import{n as Ea,t as Da}from"./ccrClient-BaWg4E9-.js";import{n as Oa,t as ka}from"./HybridTransport-CuT3KI5e.js";import{n as Aa,t as ja}from"./SSETransport-BpnapvlK.js";import{t as Ma}from"./pluginBlocklist-DJrMdzT0.js";import{c as Na,d as Pa,f as Fa,l as Ia,o as La,r as Ra,s as za,u as Ba}from"./channelNotification-B7A-9DIl.js";import{t as Va}from"./onChangeAppState-Dxbl8fvk.js";import{t as Ha}from"./settingsSync-B9bz77E1.js";import{a as Ua,c as Wa,d as Ga,f as Ka,l as qa,m as Ja,o as Ya,p as Xa,r as Za,t as Qa}from"./cronJitterConfig-CYP7yrQu.js";import{i as $a,n as eo}from"./toolPool-Dq-Vtvrj.js";import{n as to,r as no}from"./QueryEngine-C_KZts4y.js";import{n as ro,r as io}from"./sideQuestion-DHW5rgKz.js";import{n as ao,r as oo}from"./context-noninteractive-yiyJriiw.js";import{a as so,o as co,t as lo}from"./skillChangeDetector-D8C-uQSQ.js";import{n as uo,t as fo}from"./refresh-D7pdoY_X.js";import{dirname as po,join as mo}from"path";import{PassThrough as ho}from"stream";import{randomUUID as Y}from"crypto";import{readFile as go,stat as _o}from"fs/promises";import{URL as vo}from"url";import{cwd as X}from"process";a(),_(),He(),Le(),Fe(),R(),ze(),B(),L(),H(),U(),Ze(),Qe(),et(),G(),N(),Te(),se(),E(),De(),O(),A(),lt(),we(),at(),fe(),_e(),Hi(),Ki(),ir(),vr(),mr(),rn(),ht(),Pi(),ta(),lr(),ha(),$r(),wr(),na(),Zt(),oa(),kt(),dn(),Wr(),Qt(),Ln(),pt(),Ci(),ji(),Ha(),r(),Aa();function yo(e,t={},n,r){if(i(process.env.CLAUDE_CODE_USE_CCR_V2)){let i=new vo(e.href);return i.protocol===`wss:`?i.protocol=`https:`:i.protocol===`ws:`&&(i.protocol=`http:`),i.pathname=i.pathname.replace(/\/$/,``)+`/worker/events/stream`,new ja(i,t,n,r)}if(e.protocol===`ws:`||e.protocol===`wss:`)return i(process.env.CLAUDE_CODE_POST_FOR_SESSION_INGRESS_V2)?new ka(e,t,n,r):new Oa(e,t,n,r);throw Error(`Unsupported protocol: ${e.protocol}`)}r(),Aa();var bo=class extends Ga{constructor(e,t,n){let r=new ho({encoding:`utf8`});super(r,n),o(this,`url`,void 0),o(this,`transport`,void 0),o(this,`inputStream`,void 0),o(this,`isBridge`,!1),o(this,`isDebug`,!1),o(this,`ccrClient`,null),o(this,`keepAliveTimer`,null),this.inputStream=r,this.url=new vo(e);let a={},s=ea();s?a.Authorization=`Bearer ${s}`:I(`[remote-io] No session ingress token available`,{level:`error`});let c=process.env.CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION;if(c&&(a[`x-environment-runner-version`]=c),this.transport=yo(this.url,a,u(),()=>{let e={},t=ea();t&&(e.Authorization=`Bearer ${t}`);let n=process.env.CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION;return n&&(e[`x-environment-runner-version`]=n),e}),this.isBridge=process.env.CLAUDE_CODE_ENVIRONMENT_KIND===`bridge`,this.isDebug=Re(),this.transport.setOnData(e=>{this.inputStream.write(e),this.isBridge&&this.isDebug&&V(e.endsWith(`
2
- `)?e:e+`
3
- `)}),this.transport.setOnClose(()=>{this.inputStream.end()}),i(process.env.CLAUDE_CODE_USE_CCR_V2)){if(!(this.transport instanceof ja))throw Error(`CCR v2 requires SSETransport; check getTransportForUrl`);this.ccrClient=new Da(this.transport,this.url);let e=this.ccrClient.initialize();this.restoredWorkerState=e.catch(()=>null),e.catch(e=>{Ge(`error`,`cli_worker_lifecycle_init_failed`,{reason:e instanceof Ea?e.reason:`unknown`}),W(Error(`CCRClient initialization failed: ${F(e)}`)),Mt(1,`other`)}),Ie(async()=>this.ccrClient?.close()),Ct((e,t,n)=>this.ccrClient.writeInternalEvent(e,t,n)),wt(()=>this.ccrClient.readInternalEvents(),()=>this.ccrClient.readSubagentInternalEvents());let t={started:`processing`,completed:`processed`};Dt((e,n)=>{this.ccrClient?.reportDelivery(e,t[n])}),da((e,t)=>{this.ccrClient?.reportState(e,t)}),aa(e=>{this.ccrClient?.reportMetadata(e)},{replayCurrent:!0})}this.transport.connect();let l=ya().session_keepalive_interval_v2_ms;if(this.isBridge&&l>0&&(this.keepAliveTimer=setInterval(()=>{I(`[remote-io] keep_alive sent`),this.write({type:`keep_alive`}).catch(e=>{I(`[remote-io] keep_alive write failed: ${F(e)}`)})},l),this.keepAliveTimer.unref?.()),Ie(async()=>this.close()),t){let e=this.inputStream;(async()=>{for await(let n of t)e.write(String(n).replace(/\n$/,``)+`
4
- `)})()}}flushInternalEvents(){return this.ccrClient?.flushInternalEvents()??Promise.resolve()}get internalEventsPending(){return this.ccrClient?.internalEventsPending??0}async write(e){this.ccrClient?await this.ccrClient.writeEvent(e):await this.transport.write(e),this.isBridge&&(e.type===`control_request`||this.isDebug)&&V(Ka(e)+`
5
- `)}close(){this.keepAliveTimer&&(clearInterval(this.keepAliveTimer),this.keepAliveTimer=null),this.transport.close(),this.inputStream.end()}};Wi(),k(),Ri(),Vi(),[...Bi],Le(),L();var xo=`[stdout-guard]`,So=!1,Z=``,Co=null;function wo(e){if(e.length===0)return!0;try{return JSON.parse(e),!0}catch{return!1}}function To(){So||(So=!0,Co=process.stdout.write.bind(process.stdout),process.stdout.write=function(e,t,n){let r=typeof e==`string`?e:Buffer.from(e).toString(`utf-8`);Z+=r;let i,a=!0;for(;(i=Z.indexOf(`
6
- `))!==-1;){let e=Z.slice(0,i);Z=Z.slice(i+1),wo(e)?a=Co(e+`
7
- `):(process.stderr.write(`${xo} ${e}\n`),I(`streamJsonStdoutGuard diverted non-JSON stdout line: ${e.slice(0,200)}`))}let o=typeof t==`function`?t:n;return o&&queueMicrotask(()=>o()),a},Ie(async()=>{Z.length>0&&(Co&&wo(Z)?Co(Z+`
8
- `):process.stderr.write(`${xo} ${Z}\n`),Z=``),Co&&(process.stdout.write=Co,Co=null),So=!1}))}Me(),Se(),$n(),Vn(),qi(),Gi(),Xi(),ra(),In(),xt(),Mr(),Pn(),di(),Sn(),bi(),ei(),Ai(),An(),sr(),Gt(),Br(),Ba(),Na(),eo(),_r(),Fe(),Ze(),na(),Jt(),L(),$r();function Eo(e){let t=process.env.CLAUDE_CODE_EXIT_AFTER_STOP_DELAY,n=t?parseInt(t,10):null,r=n&&!isNaN(n)&&n>0,i=null,a=0;return{start(){i&&(clearTimeout(i),i=null),r&&(a=Date.now(),i=setTimeout(()=>{let t=Date.now()-a;e()&&t>=n&&(I(`Exiting after ${n}ms of idle time`),K())},n))},stop(){i&&(clearTimeout(i),i=null)}}}be(),me(),M(),St(),jt(),Hr(),gt(),zt(),Un(),Ar(),tn(),_n(),xi(),Ta(),ro();function Do(e){if(e.toLowerCase().endsWith(`.jsonl`))return{sessionId:Y(),ingressUrl:null,isUrl:!1,jsonlFile:e,isJsonlFile:!0};if(gn(e))return{sessionId:e,ingressUrl:null,isUrl:!1,jsonlFile:null,isJsonlFile:!1};try{let t=new URL(e);return{sessionId:Y(),ingressUrl:t.href,isUrl:!0,jsonlFile:null,isJsonlFile:!1}}catch{}return null}s(),D(),Zr(),Ni(),Cr(),ma(),kn(),Ei(),yr(),yt(),Dr(),zr(),Sa(),oo(),L();async function Oo(){try{let e=await go(ur(),`utf-8`),t=Ce().safeParse(Pe(e));return t.success?t.data:(I(`Invalid known_marketplaces.json in zip cache: ${t.error.message}`,{level:`error`}),{})}catch{return{}}}async function ko(e){await ar(ur(),P(e,null,2))}async function Ao(e,t){let n=hr();if(!n)return;let r=await jo(t);r!==null&&await ar(mo(n,Pr(e)),r)}async function jo(e){let t=[mo(e,`.claude-plugin`,`marketplace.json`),mo(e,`marketplace.json`),e];for(let e of t)try{return await go(e,`utf-8`)}catch{}return null}async function Mo(){let e=await En();for(let[t,n]of Object.entries(e))if(n.installLocation)try{await Ao(t,n.installLocation)}catch(e){I(`Failed to save marketplace JSON for ${t}: ${e}`)}await ko({...await Oo(),...e})}Ve(),Le(),L(),H(),Ze(),An(),Ai();async function No(){let e=Oi();I(`installPluginsForHeadless: starting${e?` (zip cache mode)`:``}`);let t=await qt();t&&(Ht(),er(`headlessPluginInstall: seed marketplaces registered`)),e&&(await Be().mkdir(Wn()),await Be().mkdir(vi()));let n=Object.keys($t()).length,r={marketplaces_installed:0,delisted_count:0},i=t;try{if(n===0)I(`installPluginsForHeadless: no marketplaces declared`);else{let t=await Ke(`headless_marketplace_reconcile`,()=>Wa({skip:e?(e,t)=>!Xn(t):void 0,onProgress:e=>{e.type===`installed`?I(`installPluginsForHeadless: installed marketplace ${e.name}`):e.type===`failed`&&I(`installPluginsForHeadless: failed to install marketplace ${e.name}: ${e.error}`)}}),e=>({installed_count:e.installed.length,updated_count:e.updated.length,failed_count:e.failed.length,skipped_count:e.skipped.length}));t.skipped.length>0&&I(`installPluginsForHeadless: skipped ${t.skipped.length} marketplace(s) unsupported by zip cache: ${t.skipped.join(`, `)}`);let n=t.installed.length+t.updated.length;n>0&&(Ht(),er(`headlessPluginInstall: marketplaces reconciled`),i=!0),r.marketplaces_installed=n}e&&await Mo();let t=await Ma();return r.delisted_count=t.length,t.length>0&&(i=!0),i&&er(`headlessPluginInstall: plugins changed`),e&&Ie(Jr),i}catch(e){return W(e),!1}finally{z(`tengu_headless_plugin_install`,r)}}Ve(),L(),H(),rn(),oa(),Ze(),B(),Zt(),$r(),Le(),He(),_(),pt(),Qt(),R(),r(),fo(),sr(),Mn(),_a(),ki(),Er(),ni(),Fe();var Q=(Qn(),e(si)),$=(fa(),e($i)),Po=(Ya(),e(Ua)),Fo=(Za(),e(Qa)),Io=(zi(),e(Ii)),Lo=`<system-reminder>
9
- You are running in non-interactive mode and cannot return a response to the user until your team is shut down.
10
-
11
- You MUST shut down your team before preparing your final response:
12
- 1. Use requestShutdown to ask each team member to shut down gracefully
13
- 2. Wait for shutdown approvals
14
- 3. Use the cleanup operation to clean up the team
15
- 4. Only then provide your final response to the user
16
-
17
- The user cannot receive your response until the team is completely shut down.
18
- </system-reminder>
19
-
20
- Shut down your team and prepare your final response for the user.`,Ro=1e4,zo=new Set,Bo=[];function Vo(e){if(zo.has(e))return!1;if(zo.add(e),Bo.push(e),Bo.length>Ro){let e=Bo.splice(0,Bo.length-Ro);for(let t of e)zo.delete(t)}return!0}function Ho(e){return typeof e==`string`?[{type:`text`,text:e}]:e}function Uo(e){return e.length===1?e[0]:e.every(e=>typeof e==`string`)?e.join(`
21
- `):e.flatMap(Ho)}function Wo(e,t){return t!==void 0&&t.mode===`prompt`&&t.workload===e.workload&&t.isMeta===e.isMeta}async function Go(e,t,n,r,a,o,s,c){if(process.env.USER_TYPE===`ant`&&i(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)&&(process.stderr.write(`\nStartup time: ${Math.round(process.uptime()*1e3)}ms\n`),process.exit(0)),cr.subscribe(e=>{Ot(e,n),Ae()&&n(e=>{let t=e.settings,n=t.fastMode===!0&&!t.fastModePerSessionOptIn;return{...e,fastMode:n}})}),$&&!$.isProactiveActive()&&i(process.env.CLAUDE_CODE_PROACTIVE)&&$.activateProactive(`command`),typeof Bun<`u`&&setInterval(()=>{process.memoryUsage.rss()>350*1024*1024?Bun.gc(!0):Bun.gc(!1)},1e3).unref(),ft(),J(`runHeadless_entry`),await It()&&await hn(),J(`after_grove_check`),re(),c.resumeSessionAt&&!c.resume){process.stderr.write(`Error: --resume-session-at requires --resume
22
- `),K(1);return}if(c.rewindFiles&&!c.resume){process.stderr.write(`Error: --rewind-files requires --resume
23
- `),K(1);return}if(c.rewindFiles&&e){process.stderr.write(`Error: --rewind-files is a standalone operation and cannot be used with a prompt
24
- `),K(1);return}let l=rs(e,c);c.outputFormat===`stream-json`&&To();let d=li.getSandboxUnavailableReason();if(d){if(li.isSandboxRequired()){process.stderr.write(`\nError: sandbox required but unavailable: ${d}\n sandbox.failIfUnavailable is set — refusing to start without a working sandbox.\n\n`),K(1);return}process.stderr.write(`\n⚠ Sandbox disabled: ${d}\n Commands will run WITHOUT sandboxing. Network and filesystem restrictions will NOT be enforced.\n\n`)}else if(li.isSandboxingEnabled())try{await li.initialize(l.createSandboxAskCallback())}catch(e){process.stderr.write(`\n❌ Sandbox Error: ${F(e)}\n`),K(1,`other`);return}c.outputFormat===`stream-json`&&c.verbose&&Vt(e=>{let t=(()=>{switch(e.type){case`started`:return{type:`system`,subtype:`hook_started`,hook_id:e.hookId,hook_name:e.hookName,hook_event:e.hookEvent,uuid:Y(),session_id:u()};case`progress`:return{type:`system`,subtype:`hook_progress`,hook_id:e.hookId,hook_name:e.hookName,hook_event:e.hookEvent,stdout:e.stdout,stderr:e.stderr,output:e.output,uuid:Y(),session_id:u()};case`response`:return{type:`system`,subtype:`hook_response`,hook_id:e.hookId,hook_name:e.hookName,hook_event:e.hookEvent,output:e.output,stdout:e.stdout,stderr:e.stderr,exit_code:e.exitCode,outcome:e.outcome,uuid:Y(),session_id:u()}}})();l.write(t)}),c.setupTrigger&&await wi(c.setupTrigger),J(`before_loadInitialMessages`);let f=t(),{messages:p,turnInterruptionState:m,agentSetting:h}=await ns(n,{continue:c.continue,teleport:c.teleport,resume:c.resume,resumeSessionAt:c.resumeSessionAt,forkSession:c.forkSession,outputFormat:c.outputFormat,sessionStartHooksPromise:c.sessionStartHooksPromise,restoredWorkerState:l.restoredWorkerState}),g=wn();if(g&&l.prependUserMessage(g),!c.agent&&!x()&&h){let{agentDefinition:e}=so(h,void 0,{activeAgents:s,allAgents:s});if(e){if(n(t=>({...t,agent:e.agentType})),!c.systemPrompt&&!ai(e)){let t=e.getSystemPrompt();t&&(c.systemPrompt=t)}gr(e.agentType)}}if(p.length===0&&process.exitCode!==void 0)return;if(c.rewindFiles){let e=p.find(e=>e.uuid===c.rewindFiles);if(!e||e.type!==`user`){process.stderr.write(`Error: --rewind-files requires a user message UUID, but ${c.rewindFiles} is not a user message in this session\n`),K(1);return}let r=t(),i=await Xo(c.rewindFiles,r,n,!1);if(!i.canRewind){process.stderr.write(`Error: ${i.error||`Unexpected error`}\n`),K(1);return}process.stdout.write(`Files rewound to state at message ${c.rewindFiles}\n`),K(0);return}let ee=typeof c.resume==`string`&&(!!gn(c.resume)||c.resume.endsWith(`.jsonl`)),_=!!c.sdkUrl;if(!e&&!ee&&!_){process.stderr.write(`Error: Input must be provided either through stdin or as a prompt argument when using --print
25
- `),K(1);return}if(c.outputFormat===`stream-json`&&!c.verbose){process.stderr.write(`Error: When using --print, --output-format=stream-json requires --verbose
26
- `),K(1);return}let te=Nn(f.mcp.tools,f.toolPermissionContext),v=[...a,...te],y=Jo(c.sdkUrl?`stdio`:c.permissionPromptToolName,l,()=>t().mcp.tools,e=>{n(e=>({...e,attribution:{...e.attribution,permissionPromptCount:e.attribution.permissionPromptCount+1}})),ca(`requires_action`,e)});c.permissionPromptToolName&&(v=v.filter(e=>!Li(e,c.permissionPromptToolName))),We(),J(`after_loadInitialMessages`),await C(),J(`after_modelStrings`);let b=c.outputFormat===`json`&&c.verbose,S=[],w;J(`before_runHeadlessStreaming`);for await(let e of Ko(l,f.mcp.clients,[...r,...f.mcp.commands],v,p,y,o,t,n,s,c,m))c.outputFormat===`stream-json`&&c.verbose&&await l.write(e),e.type!==`control_response`&&e.type!==`control_request`&&e.type!==`control_cancel_request`&&!(e.type===`system`&&(e.subtype===`session_state_changed`||e.subtype===`task_notification`||e.subtype===`task_started`||e.subtype===`task_progress`||e.subtype===`post_turn_summary`))&&e.type!==`stream_event`&&e.type!==`keep_alive`&&e.type!==`streamlined_text`&&e.type!==`streamlined_tool_use_summary`&&e.type!==`prompt_suggestion`&&(b&&S.push(e),w=e);switch(c.outputFormat){case`json`:if(!w||w.type!==`result`)throw Error(`No messages returned`);if(c.verbose){V(P(S)+`
27
- `);break}V(P(w)+`
28
- `);break;case`stream-json`:break;default:if(!w||w.type!==`result`)throw Error(`No messages returned`);switch(w.subtype){case`success`:V(w.result.endsWith(`
29
- `)?w.result:w.result+`
30
- `);break;case`error_during_execution`:V(`Execution error`);break;case`error_max_turns`:V(`Error: Reached max turns (${c.maxTurns}).\nTip: Increase the limit with --max-turns or continue in a new session.`);break;case`error_max_budget_usd`:V(`Error: Exceeded USD budget ($${c.maxBudgetUsd}).\nTip: Increase the limit with --max-budget-usd or start a new session to continue.`);break;case`error_max_structured_output_retries`:V(`Error: Failed to provide valid structured output after maximum retries.
31
- Tip: Simplify your schema or check if the output format matches the expected structure.`)}}if(en(),ye())try{let{drainPendingExtraction:e}=await import(`./extractMemories-BrvZVsmM.js`);await e()}catch{}K(w?.type===`result`&&w?.is_error?1:0)}function Ko(e,r,a,o,s,m,h,g,_,te,v,y){let x=!1,S,C=!1,re=!1,se=null,E,D=e.outbound;process.on(`SIGINT`,()=>{Ge(`info`,`shutdown_signal`,{signal:`SIGINT`}),E&&!E.signal.aborted&&E.abort(),Mt(0)}),Ie(async()=>{let t={};for(let e of hi(g()))nn(e)&&(t[e.type]=(t[e.type]??0)+1);Ge(`info`,`run_state_at_shutdown`,{run_active:x,run_phase:S,worker_status:ua(),internal_events_pending:e.internalEventsPending,bg_tasks:t})}),sa(e=>{(e===`default`||e===`acceptEdits`||e===`bypassPermissions`||e===`plan`||e===`auto`||e===`dontAsk`)&&D.enqueue({type:`system`,subtype:`status`,status:null,permissionMode:e,uuid:Y(),session_id:u()})});let O={abortController:null,inflightPromise:null,lastEmitted:null,pendingSuggestion:null,pendingLastEmittedEntry:null},fe;v.enableAuthStatus&&(fe=ce.getInstance().subscribe(e=>{D.enqueue({type:`auth_status`,isAuthenticating:e.isAuthenticating,output:e.output,error:e.error,uuid:Y(),session_id:u()})}));let me=e=>{let t=Ca(e);t&&D.enqueue({type:`rate_limit_event`,rate_limit_info:t,uuid:Y(),session_id:u()})};sn.add(me);let k=s,A=Cn(s,X(),100),_e=Yi(100),ye=process.env.CLAUDE_CODE_RESUME_INTERRUPTED_TURN;y&&y.kind!==`none`&&ye&&(I(`[print.ts] Auto-resuming interrupted turn (kind: ${y.kind})`),ts(k,y.message),q({mode:`prompt`,value:y.message.message.content,uuid:Y()}));let be=cn().map(e=>{let t=e.value===null?`default`:e.value,n=t===`default`?ie():w(t),r=ut(n),i=pi(n),a=pe(e.value),o=he(n);return{name:t,value:t,displayName:e.label,description:e.description,...r&&{supportsEffort:!0,supportedEffortLevels:nr(n)?[...Pt]:Pt.filter(e=>e!==`max`)},...i&&{supportsAdaptiveThinking:!0},...a&&{supportsFastMode:!0},...o&&{supportsAutoMode:!0}}}),Se=v.userSpecifiedModel;function Ce(e,t){let n=Yr(e,de(t));k.push(...n);for(let e of n)typeof e.message.content==`string`&&e.message.content.includes(`<local-command-stdout>`)&&D.enqueue({type:`user`,content:e.message.content,message:e.message,session_id:u(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!0})}let j=[],we=[],Te=new Set;function Ee(t){for(let n of t){if(n.type!==`connected`||Te.has(n.name)||n.config.type===`sdk`)continue;let t=n.name;try{n.client.setRequestHandler(l,async(n,r)=>{Ye(t,`Elicitation request received in print mode: ${P(n)}`);let i=n.params.mode===`url`?`url`:`form`;z(`tengu_mcp_elicitation_shown`,{mode:i});let a=await Vr(t,n.params,r.signal);if(a)return Ye(t,`Elicitation resolved by hook: ${P(a)}`),z(`tengu_mcp_elicitation_response`,{mode:i,action:a.action}),a;let o=`url`in n.params?n.params.url:void 0,s=`requestedSchema`in n.params?n.params.requestedSchema:void 0,c=`elicitationId`in n.params?n.params.elicitationId:void 0,l=await oi(t,await e.handleElicitation(t,n.params.message,s,r.signal,i,o,c),r.signal,i,c);return z(`tengu_mcp_elicitation_response`,{mode:i,action:l.action}),l}),n.client.setNotificationHandler(c,e=>{let{elicitationId:n}=e.params;Ye(t,`Elicitation completion notification: ${n}`),jn({message:`MCP server "${t}" confirmed elicitation ${n} complete`,notificationType:`elicitation_complete`}),D.enqueue({type:`system`,subtype:`elicitation_complete`,mcp_server_name:t,elicitation_id:n,uuid:Y(),session_id:u()})}),Te.add(t)}catch{}}}async function De(){let t=new Set(Object.keys(h)),n=new Set(j.map(e=>e.name)),r=Array.from(t).some(e=>!n.has(e)),i=Array.from(n).some(e=>!t.has(e)),a=j.some(e=>e.type===`pending`),o=j.some(e=>e.type===`failed`);if(r||i||a||o){for(let e of j)t.has(e.name)||e.type===`connected`&&await e.cleanup();let r=await Tt(h,(t,n)=>e.sendMcpMessage(t,n));j=r.clients,we=r.tools;let i=nt([...n,...t]);_(e=>({...e,mcp:{...e.mcp,tools:[...e.mcp.tools.filter(e=>!i.some(t=>e.name.startsWith(Oe(t)))),...we]}})),Hn(j)}}De();let M={clients:[],tools:[],configs:{}},Ae=e=>{let t=Dn(e.toolPermissionContext,e.mcp.tools),n=ve($a([...o,...we,...M.tools],t,e.toolPermissionContext.mode),`name`);v.permissionPromptToolName&&(n=n.filter(e=>!Li(e,v.permissionPromptToolName)));let r=p();if(r&&!v.jsonSchema){let e=Ui(r);`tool`in e&&(n=[...n,e.tool])}return n},N=null,je=0;function Me(){if(!N)return;let e=Math.min(je,k.length),t=k.slice(e).filter(e=>e.type===`user`||e.type===`assistant`);je=k.length,t.length>0&&N.writeMessages(t)}let Pe=Promise.resolve({response:{added:[],removed:[],errors:{}},sdkServersChanged:!1});function Fe(e){let t=async()=>{let t=new Set(j.map(e=>e.name)),n=await os(e,{configs:h,clients:j,tools:we},M,_);for(let e of Object.keys(h))delete h[e];if(Object.assign(h,n.newSdkState.configs),j=n.newSdkState.clients,we=n.newSdkState.tools,M=n.newDynamicState,n.sdkServersChanged){let e=new Set(j.map(e=>e.name)),n=nt([...t,...e]);_(e=>({...e,mcp:{...e.mcp,tools:[...e.mcp.tools.filter(e=>!n.some(t=>e.name.startsWith(Oe(t)))),...we]}}))}return{response:n.response,sdkServersChanged:n.sdkServersChanged}};return Pe=Pe.then(t,t),Pe}function Le(){let e=g(),t=e.mcp.clients,n=ve([...e.mcp.tools,...M.tools],`name`),r=new Set([...t.map(e=>e.name),...j.map(e=>e.name)]);return[...t,...j,...M.clients.filter(e=>!r.has(e.name))].map(e=>{let t;if(e.config.type===`sse`||e.config.type===`http`)t={type:e.config.type,url:e.config.url,headers:e.config.headers,oauth:e.config.oauth};else if(e.config.type===`claudeai-proxy`)t={type:`claudeai-proxy`,url:e.config.url,id:e.config.id};else if(e.config.type===`stdio`||e.config.type===void 0){let n=e.config;t={type:`stdio`,command:n.command,args:n.args}}let r=e.type===`connected`?Xr(n,e.name).map(e=>({name:e.mcpInfo?.toolName??e.name,annotations:{readOnly:e.isReadOnly({})||void 0,destructive:e.isDestructive?.({})||void 0,openWorld:e.isOpenWorld?.({})||void 0}})):void 0,i;if(e.type===`connected`&&e.capabilities.experimental){let t={...e.capabilities.experimental};t[`claude/channel`]&&(!Fa()||!Pa(e.config.pluginSource))&&delete t[`claude/channel`],Object.keys(t).length>0&&(i={experimental:t})}return{name:e.name,status:e.type,serverInfo:e.type===`connected`?e.serverInfo:void 0,error:e.type===`failed`?e.error:void 0,config:t,scope:e.config.scope,tools:r,capabilities:i}})}async function Re(){try{await Promise.all([Promise.resolve(),Ke(`headless_managed_settings_wait`,()=>Bt())]),await No()&&await He()}catch(e){W(e)}}let ze=null;t()||(i(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)?ze=Re():Re());let Be=Eo(()=>!x),L=a,R=te;async function Ve(){let{agentDefinitions:e}=await uo(_);L=await Nt(X());let t=R.filter(e=>e.source===`flagSettings`);R=[...e.allAgents,...t]}async function He(){let{servers:e}=await Sr(),t={};for(let[n,r]of Object.entries(e)){let e=r.type;(e===void 0||e===`stdio`||e===`sse`||e===`http`||e===`sdk`)&&(t[n]=r)}for(let[e,n]of Object.entries(h))n.type===`sdk`&&!(e in t)&&(t[e]=n);let{response:n,sdkServersChanged:r}=await Fe(t);r&&De(),I(`Headless MCP refresh: added=${n.added.length}, removed=${n.removed.length}`)}let Ue=lo.subscribe(()=>{Fi(),Nt(X()).then(e=>{L=e})}),We=()=>{setTimeout(()=>{!$?.isProactiveActive()||$.isProactivePaused()||C||(async()=>{let e=await Ft({basePrompt:`<${qe}>${new Date().toLocaleTimeString()}</${qe}>`,currentDir:X(),shouldCreate:()=>!C});if(C){await Rt({commands:e});return}for(let t of e)q({...t,uuid:Y()});B()})().catch(e=>{W(e),I(`[Proactive] failed to create headless tick: ${e}`,{level:`error`})})},0)};Di(()=>{E&&qr(`now`).length>0&&E.abort(`interrupt`)});let B=async()=>{if(x)return;if(x=!0,S=void 0,ca(`running`),Be.stop(),J(`run_entry`),await De(),J(`after_updateSdkMcp`),ze){let e=parseInt(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS||``,10);if(e>0){let t=ct(e).then(()=>`timeout`);await Promise.race([ze,t])===`timeout`&&(W(Error(`CLAUDE_CODE_SYNC_PLUGIN_INSTALL: plugin installation timed out after ${e}ms`)),z(`tengu_sync_plugin_install_timeout`,{timeout_ms:e}))}else await ze;ze=null,await Ve();let{setupPluginHookHotReload:t}=await import(`./loadPluginHooks-C0Ei-0E2.js`);t()}let t=e=>e.agentId===void 0;try{let r,i=!1,a=async()=>{for(;r=Ur(t);){if(r.mode!==`prompt`&&r.mode!==`orphaned-permission`&&r.mode!==`task-notification`)throw Error(`only prompt commands are supported in streaming mode`);let i=[r];if(r.mode===`prompt`)for(;Wo(r,gi(t));)i.push(Ur(t));let a=await Xt(i);if(i=a.attachmentCommands,i.length===0)continue;r=i[0],r.mode===`prompt`&&i.length>1&&(r={...r,value:Uo(i.map(e=>e.value)),uuid:i.findLast(e=>e.uuid)?.uuid??r.uuid});let o=i.map(e=>e.uuid).filter(e=>e!==void 0);if(v.replayUserMessages&&i.length>1)for(let e of i)e.uuid&&e.uuid!==r.uuid&&D.enqueue({type:`user`,content:e.value,message:{role:`user`,content:e.value},session_id:u(),parent_tool_use_id:null,uuid:e.uuid,isReplay:!0});let s=g(),c=[...s.mcp.clients,...j,...M.clients];Ee(c);for(let e of c)$o(e);let l=Ae(s);for(let e of o)un(e,`started`);if(r.mode===`task-notification`){let e=typeof r.value==`string`?r.value:``,t=e.match(/<task-id>([^<]+)<\/task-id>/),n=e.match(/<tool-use-id>([^<]+)<\/tool-use-id>/),i=e.match(/<output-file>([^<]+)<\/output-file>/),a=e.match(/<status>([^<]+)<\/status>/),o=e.match(/<summary>([^<]+)<\/summary>/),s=e=>e===`completed`||e===`failed`||e===`stopped`||e===`killed`,c=a?.[1],l=s(c)?c===`killed`?`stopped`:c:`completed`,d=e.match(/<usage>([\s\S]*?)<\/usage>/)?.[1]??``,f=d.match(/<total_tokens>(\d+)<\/total_tokens>/),p=d.match(/<tool_uses>(\d+)<\/tool_uses>/),m=d.match(/<duration_ms>(\d+)<\/duration_ms>/);a&&D.enqueue({type:`system`,subtype:`task_notification`,task_id:t?.[1]??``,tool_use_id:n?.[1],status:l,output_file:i?.[1]??``,summary:o?.[1]??``,usage:f&&p?{total_tokens:parseInt(f[1],10),tool_uses:parseInt(p[1],10),duration_ms:m?parseInt(m[1],10):0}:void 0,session_id:u(),uuid:Y()})}let d=r.value,f=a.claimedCommands;if(e instanceof bo&&r.mode===`prompt`&&z(`tengu_bridge_message_received`,{is_repl:!1}),O.abortController?.abort(),O.abortController=null,O.pendingSuggestion=null,O.pendingLastEmittedEntry=null,O.lastEmitted&&r.mode===`prompt`){let e=typeof d==`string`?d:d.find(e=>e.type===`text`)?.text;typeof e==`string`&&Kt(O.lastEmitted.text,e,O.lastEmitted.emittedAt,O.lastEmitted.promptId,O.lastEmitted.generationRequestId),O.lastEmitted=null}E=bn(),J(`before_ask`),Yn();let h=r,ee=!1;try{if(await xe(h.workload??v.workload,async()=>{for await(let t of to({commands:ve([...L,...s.mcp.commands],`name`),prompt:d,promptUuid:h.uuid,isMeta:h.isMeta,cwd:X(),tools:l,verbose:v.verbose,mcpClients:c,thinkingConfig:v.thinkingConfig,maxTurns:v.maxTurns,maxBudgetUsd:v.maxBudgetUsd,taskBudget:v.taskBudget,canUseTool:m,userSpecifiedModel:Se,fallbackModel:v.fallbackModel,jsonSchema:p()??v.jsonSchema,mutableMessages:k,getReadFileCache:()=>_e.size===0?A:Zi(A,_e),setReadFileCache:e=>{A=e;for(let[e,t]of _e.entries()){let n=A.get(e);(!n||t.timestamp>n.timestamp)&&A.set(e,t)}_e.clear()},customSystemPrompt:v.systemPrompt,appendSystemPrompt:v.appendSystemPrompt,getAppState:g,setAppState:_,abortController:E,replayUserMessages:v.replayUserMessages,includePartialMessages:v.includePartialMessages,handleElicitation:(t,n,r)=>e.handleElicitation(t,n.message,void 0,r,n.mode,n.url,`elicitationId`in n?n.elicitationId:void 0),agents:R,orphanedPermission:h.orphanedPermission,setSDKStatus:e=>{D.enqueue({type:`system`,subtype:`status`,status:e,session_id:u(),uuid:Y()})}}))if(Me(),t.type===`result`){ee=!!t.is_error;for(let e of Qi())D.enqueue(e);hi(g()).some(e=>(e.type===`local_agent`||e.type===`local_workflow`)&&nn(e))?se=t:(se=null,D.enqueue(t))}else{for(let e of Qi())D.enqueue(e);D.enqueue(t)}}),ee)await pn({commands:f,outcome:{type:`failed`,message:`ask() returned an error result`},currentDir:X(),priority:`later`,workload:h.workload??v.workload});else{let e=await pn({commands:f,outcome:{type:`completed`},currentDir:X(),priority:`later`,workload:h.workload??v.workload});for(let t of e)q({...t,uuid:Y()})}}catch(e){throw await pn({commands:f,outcome:{type:`failed`,error:e},currentDir:X(),priority:`later`,workload:h.workload??v.workload}),e}for(let e of o)un(e,`completed`);if(Me(),N?.sendResult(),v.promptSuggestions&&!n(process.env.CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION)){O.abortController?.abort();let e=new AbortController;O.abortController=e;let t=Tr();if(!t)Qr(`sdk_no_params`,void 0,void 0,`sdk`);else{let n={promise:null};n.promise=(async()=>{try{let n=await zn(e,k,g,t,`sdk`);if(!n||e.signal.aborted)return;let r={type:`prompt_suggestion`,suggestion:n.suggestion,uuid:Y(),session_id:u()},i={text:n.suggestion,emittedAt:Date.now(),promptId:n.promptId,generationRequestId:n.generationRequestId};se?(O.pendingSuggestion=r,O.pendingLastEmittedEntry={text:i.text,promptId:i.promptId,generationRequestId:i.generationRequestId}):(O.lastEmitted=i,D.enqueue(r))}catch(e){if(e instanceof Error&&(e.name===`AbortError`||e.name===`APIUserAbortError`)){Qr(`aborted`,void 0,void 0,`sdk`);return}W(Ne(e))}finally{O.inflightPromise===n.promise&&(O.inflightPromise=null)}})(),O.inflightPromise=n.promise}}en(),ri(),ft()}};do{for(let e of Qi())D.enqueue(e);S=`draining_commands`,await a(),i=!1;{let e=hi(g()).some(e=>nn(e)&&e.type!==`in_process_teammate`),n=gi(t)!==void 0;(e||n)&&(i=!0,n||(S=`waiting_for_agents`,await ct(100)))}}while(i);se&&(D.enqueue(se),se=null,O.pendingSuggestion&&(D.enqueue(O.pendingSuggestion),O.pendingLastEmittedEntry&&(O.lastEmitted={...O.pendingLastEmittedEntry,emittedAt:Date.now()},O.pendingLastEmittedEntry=null),O.pendingSuggestion=null))}catch(t){try{await e.write({type:`result`,subtype:`error_during_execution`,duration_ms:0,duration_api_ms:0,is_error:!0,num_turns:0,stop_reason:null,session_id:u(),total_cost_usd:0,usage:ia,modelUsage:{},permission_denials:[],uuid:Y(),errors:[F(t),...Xe().map(e=>e.error)]})}catch{}O.abortController?.abort(),K(1);return}finally{if(S=`finally_flush`,await e.flushInternalEvents(),S=`finally_post_flush`,!Ut()){ca(`idle`);for(let e of Qi())D.enqueue(e)}x=!1,Be.start()}if($?.isProactiveActive()&&!$.isProactivePaused()&&gi(t)===void 0&&!C){We();return}if(gi(t)!==void 0){B();return}{let e=g().teamContext;if(e&&it(e)){let e=`team-lead`;for(;;){let t=g();if(!(st(t)||t.teamContext&&Object.keys(t.teamContext.teammates).length>0)){I(`[print.ts] No more active teammates, stopping poll`);break}let n=await Rr(e,t.teamContext?.teamName);if(n.length>0){I(`[print.ts] Team-lead found ${n.length} unread messages`),await ui(e,t.teamContext?.teamName);let r=t.teamContext?.teamName;for(let e of n){let n=fn(e.text);if(n&&r){let e=n.from;I(`[print.ts] Processing shutdown_approved from ${e}`);let i=t.teamContext?.teammates?Object.entries(t.teamContext.teammates).find(([,t])=>t.name===e)?.[0]:void 0;i&&(va(r,{agentId:i,name:e}),I(`[print.ts] Removed ${e} from team file`),await ga(r,i,e,`shutdown`),_(e=>{if(!e.teamContext?.teammates||!(i in e.teamContext.teammates))return e;let{[i]:t,...n}=e.teamContext.teammates;return{...e,teamContext:{...e.teamContext,teammates:n}}}))}}q({mode:`prompt`,value:n.map(e=>`<${Je} teammate_id="${e.from}"${e.color?` color="${e.color}"`:``}>\n${e.text}\n</${Je}>`).join(`
32
-
33
- `),uuid:Y()}),B();return}if(C&&!re){re=!0,I(`[print.ts] Input closed with active teammates, injecting shutdown prompt`),q({mode:`prompt`,value:Lo,uuid:Y()}),B();return}await ct(500)}}}C&&(await(async()=>{let e=g();rt(e)&&await ot(_,e);let t=g(),n=t.teamContext;return n&&Object.keys(n.teammates).length>0||st(t)})()?(q({mode:`prompt`,value:Lo,uuid:Y()}),B()):(O.inflightPromise&&await Promise.race([O.inflightPromise,ct(5e3)]),O.abortController?.abort(),O.abortController=null,await an(),Ue(),fe?.(),sn.delete(me),D.done()))},V=null;if(Io.isKairosCronEnabled()){let e=e=>{C||(async()=>{let t=await On({basePrompt:e.basePrompt,trigger:`scheduled-task`,currentDir:X(),sourceId:e.sourceId,sourceLabel:e.sourceLabel,workload:oe,shouldCreate:()=>!C});if(t){if(C){await Rt({commands:[t]});return}await e.onSuccess(t)}})().catch(t=>{W(t),I(`[ScheduledTasks] failed to enqueue headless task${e.logSuffix}: ${t}`,{level:`error`})})},t=e=>{q({...e,uuid:Y()}),B()};V=Po.createCronScheduler({onFire:n=>{e({basePrompt:n,sourceId:n,sourceLabel:n,logSuffix:``,onSuccess:t})},onFireTask:n=>{if(n.agentId){e({basePrompt:n.prompt,sourceId:n.id,sourceLabel:n.prompt,logSuffix:` ${n.id}`,onSuccess:async e=>{await Fn(e.autonomy.runId,`No teammate runtime available for scheduled task owner ${n.agentId} in headless mode.`,e.autonomy.rootDir)}});return}e({basePrompt:n.prompt,sourceId:n.id,sourceLabel:n.prompt,logSuffix:` ${n.id}`,onSuccess:t})},isLoading:()=>x||C,getJitterConfig:Fo?.getCronJitterConfig,isKilled:()=>!Io?.isKairosCronEnabled()}),V.start()}let H=function(e,t){D.enqueue({type:`control_response`,response:{subtype:`success`,request_id:e.request_id,response:t}})},U=function(e,t){D.enqueue({type:`control_response`,response:{subtype:`error`,request_id:e.request_id,error:t}})},Ze=new Set;e.setUnexpectedResponseCallback(async e=>{await is({message:e,setAppState:_,handledToolUseIds:Ze,onEnqueued:()=>{B()}})});let Qe=new Map,et=new Map,tt=new Set,at=new Map,G=null;return(async()=>{let t=!1;Ge(`info`,`cli_message_loop_started`);for await(let n of e.structuredInput){let i=`uuid`in n?n.uuid:void 0;if(i&&n.type!==`user`&&n.type!==`control_response`&&un(i,`completed`),n.type===`control_request`){let i=n,o=i.request;if(i.request.subtype===`interrupt`)_(e=>({...e,attribution:{...e.attribution,escapeCount:e.attribution.escapeCount+1}})),E&&E.abort(),O.abortController?.abort(),O.abortController=null,O.lastEmitted=null,O.pendingSuggestion=null,H(i);else if(o.subtype===`end_session`){I(`[print.ts] end_session received, reason=${o.reason??`unspecified`}`),E&&E.abort(),O.abortController?.abort(),O.abortController=null,O.lastEmitted=null,O.pendingSuggestion=null,H(i);break}else if(i.request.subtype===`initialize`){if(i.request.sdkMcpServers&&i.request.sdkMcpServers.length>0)for(let e of i.request.sdkMcpServers)h[e]={type:`sdk`,name:e};await Yo(i.request,i.request_id,t,D,a,be,e,!!v.enableAuthStatus,v,te,g),i.request.promptSuggestions&&_(e=>e.promptSuggestionEnabled?e:{...e,promptSuggestionEnabled:!0}),i.request.agentProgressSummaries&&ge(`tengu_slate_prism`,!0)&&ee(!0),t=!0,Nr()&&B()}else if(i.request.subtype===`set_permission_mode`){let e=i.request;_(t=>({...t,toolPermissionContext:Zo(e,i.request_id,t.toolPermissionContext,D),isUltraplanMode:e.ultraplan??t.isUltraplanMode}))}else if(i.request.subtype===`set_model`){let e=i.request.model??`default`,t=e===`default`?ie():e;Se=t,b(t),la({model:t}),Ce(e,t),H(i)}else if(i.request.subtype===`set_max_thinking_tokens`)i.request.max_thinking_tokens===null?v.thinkingConfig=void 0:i.request.max_thinking_tokens===0?v.thinkingConfig={type:`disabled`}:v.thinkingConfig={type:`enabled`,budgetTokens:i.request.max_thinking_tokens},H(i);else if(i.request.subtype===`mcp_status`)H(i,{mcpServers:Le()});else if(i.request.subtype===`get_context_usage`)try{let e=g();H(i,{...await ao({messages:k,getAppState:g,options:{mainLoopModel:ae(),tools:Ae(e),agentDefinitions:e.agentDefinitions,customSystemPrompt:v.systemPrompt,appendSystemPrompt:v.appendSystemPrompt}})})}catch(e){U(i,F(e))}else if(i.request.subtype===`mcp_message`){let e=i.request,t=j.find(t=>t.name===e.server_name);t&&t.type===`connected`&&t.client?.transport?.onmessage&&t.client.transport.onmessage(e.message),H(i)}else if(i.request.subtype===`rewind_files`){let e=g(),t=await Xo(i.request.user_message_id,e,_,i.request.dry_run??!1);t.canRewind||i.request.dry_run?H(i,t):U(i,t.error??`Unexpected error`)}else if(i.request.subtype===`cancel_async_message`){let e=i.request.message_uuid;H(i,{cancelled:ci(t=>t.uuid===e).length>0})}else if(i.request.subtype===`seed_read_state`){try{let e=$e(i.request.path),t=Math.floor((await _o(e)).mtimeMs);if(t<=i.request.mtime){let n=await go(e,`utf-8`),r=(n.charCodeAt(0)===65279?n.slice(1):n).replaceAll(`\r
34
- `,`
35
- `);_e.set(e,{content:r,timestamp:t,offset:void 0,limit:void 0})}}catch{}H(i)}else if(i.request.subtype===`mcp_set_servers`){let{response:e,sdkServersChanged:t}=await Fe(i.request.servers);H(i,e),t&&De()}else if(i.request.subtype===`reload_plugins`)try{let e=await uo(_),t=R.filter(e=>e.source===`flagSettings`);R=[...e.agentDefinitions.allAgents,...t];let n=[],[r,a,o]=await Promise.allSettled([Nt(X()),He(),Fr()]);r.status===`fulfilled`?L=r.value:W(r.reason),a.status===`rejected`&&W(a.reason),o.status===`fulfilled`?n=o.value.enabled.map(e=>({name:e.name,path:e.path,source:e.source})):W(o.reason),H(i,{commands:L.filter(e=>e.userInvocable!==!1).map(e=>({name:kr(e),description:Lt(e),argumentHint:e.argumentHint||``})),agents:R.map(e=>({name:e.agentType,description:e.whenToUse,model:e.model===`inherit`?void 0:e.model})),plugins:n,mcpServers:Le(),error_count:e.error_count})}catch(e){U(i,F(e))}else if(i.request.subtype===`mcp_reconnect`){let e=g(),{serverName:t}=i.request;Te.delete(t);let n=Gr(t)??r.find(e=>e.name===t)?.config??j.find(e=>e.name===t)?.config??M.clients.find(e=>e.name===t)?.config??e.mcp.clients.find(e=>e.name===t)?.config??null;if(!n)U(i,`Server not found: ${t}`);else{let e=await Tn(t,n),r=Oe(t);_(n=>({...n,mcp:{...n.mcp,clients:n.mcp.clients.map(n=>n.name===t?e.client:n),tools:[...T(n.mcp.tools,e=>e.name?.startsWith(r)),...e.tools],commands:[...T(n.mcp.commands,e=>Yt(e,t)),...e.commands],resources:e.resources&&e.resources.length>0?{...n.mcp.resources,[t]:e.resources}:le(n.mcp.resources,t)}})),M={...M,clients:[...M.clients.filter(e=>e.name!==t),e.client],tools:[...M.tools.filter(e=>!e.name?.startsWith(r)),...e.tools]},e.client.type===`connected`?(Ee([e.client]),$o(e.client),H(i)):U(i,e.client.type===`failed`?e.client.error??`Connection failed`:`Server status: ${e.client.type}`)}}else if(i.request.subtype===`mcp_toggle`){let e=g(),{serverName:t,enabled:n}=i.request;Te.delete(t);let a=Gr(t)??r.find(e=>e.name===t)?.config??j.find(e=>e.name===t)?.config??M.clients.find(e=>e.name===t)?.config??e.mcp.clients.find(e=>e.name===t)?.config??null;if(!a)U(i,`Server not found: ${t}`);else if(n){Ir(t,!0);let e=await Tn(t,a),n=Oe(t);_(r=>({...r,mcp:{...r.mcp,clients:r.mcp.clients.map(n=>n.name===t?e.client:n),tools:[...T(r.mcp.tools,e=>e.name?.startsWith(n)),...e.tools],commands:[...T(r.mcp.commands,e=>Yt(e,t)),...e.commands],resources:e.resources&&e.resources.length>0?{...r.mcp.resources,[t]:e.resources}:le(r.mcp.resources,t)}})),e.client.type===`connected`?(Ee([e.client]),$o(e.client),H(i)):U(i,e.client.type===`failed`?e.client.error??`Connection failed`:`Server status: ${e.client.type}`)}else{Ir(t,!1);let n=[...r,...j,...M.clients,...e.mcp.clients].find(e=>e.name===t);n&&n.type===`connected`&&await fr(t,a);let o=Oe(t);_(e=>({...e,mcp:{...e.mcp,clients:e.mcp.clients.map(e=>e.name===t?{name:t,type:`disabled`,config:a}:e),tools:T(e.mcp.tools,e=>e.name?.startsWith(o)),commands:T(e.mcp.commands,e=>Yt(e,t)),resources:le(e.mcp.resources,t)}})),H(i)}}else if(o.subtype===`channel_enable`){let e=g();Qo(i.request_id,o.serverName,[...e.mcp.clients,...j,...M.clients],D)}else if(o.subtype===`mcp_authenticate`){let e=o.serverName,t=g(),n=Gr(e)??r.find(t=>t.name===e)?.config??t.mcp.clients.find(t=>t.name===e)?.config??null;if(!n)U(i,`Server not found: ${e}`);else if(n.type!==`sse`&&n.type!==`http`)U(i,`Server type "${n.type}" does not support OAuth authentication`);else try{Qe.get(e)?.abort();let t=new AbortController;Qe.set(e,t);let r,a=new Promise(e=>{r=e}),o=yn(e,n,e=>r(e),t.signal,{skipBrowserOpen:!0,onWaitingForCallback:t=>{et.set(e,t)}}),s=await Promise.race([a,o.then(()=>null)]);s?H(i,{authUrl:s,requiresUserAction:!0}):H(i,{requiresUserAction:!1}),at.set(e,o),o.then(async()=>{if(mi(e)||tt.has(e))return;let t=await Tn(e,n),r=Oe(e);_(n=>({...n,mcp:{...n.mcp,clients:n.mcp.clients.map(n=>n.name===e?t.client:n),tools:[...T(n.mcp.tools,e=>e.name?.startsWith(r)),...t.tools],commands:[...T(n.mcp.commands,t=>Yt(t,e)),...t.commands],resources:t.resources&&t.resources.length>0?{...n.mcp.resources,[e]:t.resources}:le(n.mcp.resources,e)}})),M={...M,clients:[...M.clients.filter(t=>t.name!==e),t.client],tools:[...M.tools.filter(e=>!e.name?.startsWith(r)),...t.tools]}}).catch(t=>{I(`MCP OAuth failed for ${e}: ${t}`,{level:`error`})}).finally(()=>{Qe.get(e)===t&&(Qe.delete(e),et.delete(e),tt.delete(e),at.delete(e))})}catch(e){U(i,F(e))}}else if(o.subtype===`mcp_oauth_callback_url`){let e=o.serverName,t=o.callbackUrl,n=et.get(e);if(n){let r=!1;try{let e=new URL(t);r=e.searchParams.has(`code`)||e.searchParams.has(`error`)}catch{}if(!r)U(i,`Invalid callback URL: missing authorization code. Please paste the full redirect URL including the code parameter.`);else{tt.add(e),n(t);let r=at.get(e);if(r)try{await r,H(i)}catch(e){U(i,e instanceof Error?e.message:`OAuth authentication failed`)}else H(i)}}else U(i,`No active OAuth flow for server: ${e}`)}else if(o.subtype===`claude_authenticate`){let e=o.loginWithClaudeAi;G?.service.cleanup(),z(`tengu_oauth_flow_start`,{loginWithClaudeAi:e??!0});let t=new xn,n,r=new Promise(e=>{n=e}),a=t.startOAuthFlow(async(e,t)=>{n({manualUrl:e,automaticUrl:t})},{loginWithClaudeAi:e??!0,skipBrowserOpen:!0}).then(async t=>{await _i(t),z(`tengu_oauth_success`,{loginWithClaudeAi:e??!0})}).finally(()=>{t.cleanup(),G?.service===t&&(G=null)});G={service:t,flow:a},a.catch(e=>I(`claude_authenticate flow ended: ${e}`,{level:`info`}));try{let{manualUrl:e,automaticUrl:t}=await Promise.race([r,a.then(()=>{throw Error(`OAuth flow completed without producing auth URLs`)})]);H(i,{manualUrl:e,automaticUrl:t})}catch(e){U(i,F(e))}}else if(o.subtype===`claude_oauth_callback`||o.subtype===`claude_oauth_wait_for_completion`)if(!G)U(i,`No active claude_authenticate flow`);else{o.subtype===`claude_oauth_callback`&&G.service.handleManualAuthCodeInput({authorizationCode:o.authorizationCode,state:o.state});let{flow:e}=G;e.then(()=>{let e=ne();H(i,{account:{email:e?.email,organization:e?.organization,subscriptionType:e?.subscription,tokenSource:e?.tokenSource,apiKeySource:e?.apiKeySource,apiProvider:ue()}})},e=>U(i,F(e)))}else if(o.subtype===`mcp_clear_auth`){let e=o.serverName,t=g(),n=Gr(e)??r.find(t=>t.name===e)?.config??t.mcp.clients.find(t=>t.name===e)?.config??null;if(!n)U(i,`Server not found: ${e}`);else if(n.type!==`sse`&&n.type!==`http`)U(i,`Cannot clear auth for server type "${n.type}"`);else{await Si(e,n);let t=await Tn(e,n),r=Oe(e);_(n=>({...n,mcp:{...n.mcp,clients:n.mcp.clients.map(n=>n.name===e?t.client:n),tools:[...T(n.mcp.tools,e=>e.name?.startsWith(r)),...t.tools],commands:[...T(n.mcp.commands,t=>Yt(t,e)),...t.commands],resources:t.resources&&t.resources.length>0?{...n.mcp.resources,[e]:t.resources}:le(n.mcp.resources,e)}})),H(i,{})}}else if(i.request.subtype===`apply_flag_settings`){let e=ae(),t=d()??{},n=i.request.settings,r={...t,...n};for(let e of Object.keys(r))r[e]===null&&delete r[e];f(r),cr.notifyChange(`flagSettings`),`model`in n&&(n.model==null?b(void 0):b(String(n.model)));let a=ae();if(a!==e){Se=a;let e=n.model?String(n.model):`default`;la({model:a}),Ce(e,a)}H(i)}else if(i.request.subtype===`get_settings`){let e=g(),t=ae(),n=ut(t)?ti(t,e.effortValue):void 0;H(i,{...ke(),applied:{model:t,effort:typeof n==`string`?n:null}})}else if(i.request.subtype===`stop_task`){let{task_id:e}=i.request;try{await br(e,{getAppState:g,setAppState:_}),H(i,{})}catch(e){U(i,F(e))}}else if(o.subtype===`generate_session_title`){let e=o.description,t=o.persist,n=(E&&!E.signal.aborted?E:bn()).signal;(async()=>{try{let r=await wa(e,n);if(r&&t)try{dr(u(),r)}catch(e){W(e)}H(i,{title:r})}catch(e){U(i,F(e))}})()}else if(o.subtype===`side_question`){let e=o.question;(async()=>{try{let t=Tr();H(i,{response:(await io({question:e,cacheSafeParams:t?{...t,toolUseContext:{...t.toolUseContext,abortController:bn()}}:await no({tools:Ae(g()),commands:L,mcpClients:[...g().mcp.clients,...j,...M.clients],messages:k,readFileState:A,getAppState:g,setAppState:_,customSystemPrompt:v.systemPrompt,appendSystemPrompt:v.appendSystemPrompt,thinkingConfig:v.thinkingConfig,agents:R})})).response})}catch(e){U(i,F(e))}})()}else if(i.request.subtype===`set_proactive`)i.request.enabled?$.isProactiveActive()||($.activateProactive(`command`),We()):$.deactivateProactive(),H(i);else if(o.subtype===`remote_control`)if(o.enabled)if(N)H(i,{session_url:Kn(N.bridgeSessionId,N.sessionIngressUrl),connect_url:qn(N.environmentId,N.sessionIngressUrl),environment_id:N.environmentId});else{let t;try{let{initReplBridge:n}=await import(`./initReplBridge-tPRGPBq7.js`),r=await n({onInboundMessage(e){let t=qa(e);if(!t)return;let{content:n,uuid:r}=t;q({value:n,mode:`prompt`,uuid:r,skipSlashCommands:!0}),B()},onPermissionResponse(t){e.injectControlResponse(t)},onInterrupt(){E?.abort()},onSetModel(e){let t=e===`default`?ie():e;Se=t,b(t)},onSetMaxThinkingTokens(e){e===null?v.thinkingConfig=void 0:e===0?v.thinkingConfig={type:`disabled`}:v.thinkingConfig={type:`enabled`,budgetTokens:e}},onStateChange(e,n){e===`failed`&&(t=n),I(`[bridge:sdk] State change: ${e}${n?` — ${n}`:``}`),D.enqueue({type:`system`,subtype:`bridge_state`,state:e,detail:n,uuid:Y(),session_id:u()})},initialMessages:k.length>0?k:void 0});r?(N=r,je=k.length,e.setOnControlRequestSent(e=>{r.sendControlRequest(e)}),e.setOnControlRequestResolved(e=>{r.sendControlCancelRequest(e)}),H(i,{session_url:Kn(r.bridgeSessionId,r.sessionIngressUrl),connect_url:qn(r.environmentId,r.sessionIngressUrl),environment_id:r.environmentId})):U(i,t??`Remote Control initialization failed`)}catch(e){U(i,F(e))}}else N&&(e.setOnControlRequestSent(void 0),e.setOnControlRequestResolved(void 0),await N.teardown(),N=null),H(i);else U(i,`Unsupported control request subtype: ${i.request.subtype}`);continue}else if(n.type===`control_response`){v.replayUserMessages&&D.enqueue(n);continue}else if(n.type===`keep_alive`)continue;else if(n.type===`update_environment_variables`)continue;else if(n.type===`assistant`||n.type===`system`){let e=xa([n]);k.push(...e),n.type===`assistant`&&v.replayUserMessages&&D.enqueue(n);continue}if(n.type!==`user`)continue;let o=n;if(t=!0,o.uuid){let e=u(),t=await xr(e,o.uuid);if(t||zo.has(o.uuid)){I(`Skipping duplicate user message: ${o.uuid}`),v.replayUserMessages&&(I(`Sending acknowledgment for duplicate user message: ${o.uuid}`),D.enqueue({type:`user`,content:o.message?.content??``,message:o.message,session_id:e,parent_tool_use_id:null,uuid:o.uuid,timestamp:o.timestamp,isReplay:!0})),t&&un(o.uuid,`completed`);continue}Vo(o.uuid)}q({mode:`prompt`,value:await ba(o,o.message.content),uuid:o.uuid,priority:o.priority}),_(e=>({...e,attribution:pa(e.attribution,e=>{dt(e).catch(e=>{I(`Attribution: Failed to save snapshot: ${e}`)})})})),B()}C=!0,V?.stop(),x||(O.inflightPromise&&await Promise.race([O.inflightPromise,ct(5e3)]),O.abortController?.abort(),O.abortController=null,await an(),Ue(),fe?.(),sn.delete(me),D.done())})(),D}function qo(e){let t=async(n,r,i,a,o,s)=>{let c=s??await At(n,r,i,a,o);if(c.behavior===`allow`||c.behavior===`deny`)return c;let{signal:l,cleanup:u}=_t(i.abortController.signal);if(l.aborted)return u(),{behavior:`deny`,message:`Permission prompt was aborted.`,decisionReason:{type:`permissionPromptTool`,permissionPromptToolName:n.name,toolResult:void 0}};let d=new Promise(e=>{l.addEventListener(`abort`,()=>e(`aborted`),{once:!0})}),f=e.call({tool_name:n.name,input:r,tool_use_id:o},i,t,a),p=await Promise.race([f,d]);if(u(),p===`aborted`||l.aborted)return{behavior:`deny`,message:`Permission prompt was aborted.`,decisionReason:{type:`permissionPromptTool`,permissionPromptToolName:n.name,toolResult:void 0}};let m=p,h=e.mapToolResultToToolResultBlockParam(m.data,`1`);if(!h.content||!Array.isArray(h.content)||!h.content[0]||h.content[0].type!==`text`||typeof h.content[0].text!=`string`)throw Error(`Permission prompt tool returned an invalid result. Expected a single text block param with type="text" and a string text value.`);return Ja(Xa().parse(tt(h.content[0].text)),e,r,i)};return t}function Jo(e,t,n,r){if(e===`stdio`)return t.createCanUseTool(r);if(!e)return async(e,t,n,r,i,a)=>a??await At(e,t,n,r,i);let i=null;return async(t,r,a,o,s,c)=>{if(!i){let t=n(),r=t.find(t=>Li(t,e));if(!r){let n=`Error: MCP tool ${e} (passed via --permission-prompt-tool) not found. Available MCP tools: ${t.map(e=>e.name).join(`, `)||`none`}`;throw process.stderr.write(`${n}\n`),K(1),Error(n)}if(!r.inputJSONSchema){let t=`Error: tool ${e} (passed via --permission-prompt-tool) must be an MCP tool`;throw process.stderr.write(`${t}\n`),K(1),Error(t)}i=qo(r)}return i(t,r,a,o,s,c)}}async function Yo(e,t,n,r,i,a,o,s,c,l,d){if(n){r.enqueue({type:`control_response`,response:{subtype:`error`,error:`Already initialized`,request_id:t,pending_permission_requests:o.getPendingPermissionRequests()}});return}if(e.systemPrompt!==void 0&&(c.systemPrompt=e.systemPrompt),e.appendSystemPrompt!==void 0&&(c.appendSystemPrompt=e.appendSystemPrompt),e.promptSuggestions!==void 0&&(c.promptSuggestions=e.promptSuggestions),e.agents){let t=Kr(e.agents,`flagSettings`);l.push(...t)}if(c.agent){let e=x()===c.agent,t=l.find(e=>e.agentType===c.agent);if(t&&!e){if(y(t.agentType),!c.systemPrompt&&!ai(t)){let e=t.getSystemPrompt();e&&(c.systemPrompt=e)}!c.userSpecifiedModel&&t.model&&t.model!==`inherit`&&b(w(t.model)),t.initialPrompt&&o.prependUserMessage(t.initialPrompt)}else t?.initialPrompt&&o.prependUserMessage(t.initialPrompt)}let f=j()?.outputStyle||`default`,p=await Jn(Ue()),m=ne();if(e.hooks){let t={};for(let[n,r]of Object.entries(e.hooks))t[n]=r.map(e=>{let t=e.hookCallbackIds.map(t=>o.createHookCallback(t,e.timeout));return{matcher:e.matcher,hooks:t}});g(t)}e.jsonSchema&&h(e.jsonSchema);let ee={commands:i.filter(e=>e.userInvocable!==!1).map(e=>({name:kr(e),description:Lt(e),argumentHint:e.argumentHint||``})),agents:l.map(e=>({name:e.agentType,description:e.whenToUse,model:e.model===`inherit`?void 0:e.model})),output_style:f,available_output_styles:Object.keys(p),models:a,account:{email:m?.email,organization:m?.organization,subscriptionType:m?.subscription,tokenSource:m?.tokenSource,apiKeySource:m?.apiKeySource,apiProvider:ue()},pid:process.pid};if(Ae()&&je()){let e=d();ee.fast_mode_state=Ee(c.userSpecifiedModel??null,e.fastMode)}if(r.enqueue({type:`control_response`,response:{subtype:`success`,request_id:t,response:ee}}),s){let e=ce.getInstance().getStatus();e&&r.enqueue({type:`auth_status`,isAuthenticating:e.isAuthenticating,output:e.output,error:e.error,uuid:Y(),session_id:u()})}}async function Xo(e,t,n,r){if(!Bn())return{canRewind:!1,error:`File rewinding is not enabled.`,filesChanged:[]};if(!Wt(t.fileHistory,e))return{canRewind:!1,error:`No file checkpoint found for this message.`,filesChanged:[]};if(r){let n=await Rn(t.fileHistory,e);return{canRewind:!0,filesChanged:n?.filesChanged??[],insertions:n?.insertions,deletions:n?.deletions}}try{await rr(e=>n(t=>({...t,fileHistory:e(t.fileHistory)})),e)}catch(e){return{canRewind:!1,error:`Failed to rewind: ${F(e)}`,filesChanged:[]}}return{canRewind:!0,filesChanged:[]}}function Zo(e,t,n,r){if(e.mode===`bypassPermissions`){if(on())return r.enqueue({type:`control_response`,response:{subtype:`error`,request_id:t,error:`Cannot set permission mode to bypassPermissions because it is disabled by settings or configuration`}}),n;if(!n.isBypassPermissionsModeAvailable)return r.enqueue({type:`control_response`,response:{subtype:`error`,request_id:t,error:`Cannot set permission mode to bypassPermissions because the session was not launched with --dangerously-skip-permissions`}}),n}if(e.mode===`auto`&&!bt()){let e=vn();return r.enqueue({type:`control_response`,response:{subtype:`error`,request_id:t,error:e?`Cannot set permission mode to auto: ${Ti(e)}`:`Cannot set permission mode to auto`}}),n}return r.enqueue({type:`control_response`,response:{subtype:`success`,request_id:t,response:{mode:e.mode}}}),{...Et(n.mode,e.mode,n),mode:e.mode}}function Qo(e,t,n,r){let i=t=>r.enqueue({type:`control_response`,response:{subtype:`error`,request_id:e,error:t}}),a=n.find(e=>e.name===t&&e.type===`connected`);if(!a||a.type!==`connected`)return i(`server ${t} is not connected`);let o=a.config.pluginSource,s=o?Ji(o):void 0;if(!s?.marketplace)return i(`server ${t} is not plugin-sourced; channel_enable requires a marketplace plugin`);let c={kind:`plugin`,name:s.name,marketplace:s.marketplace},l=S(),u=l.some(e=>e.kind===`plugin`&&e.name===c.name&&e.marketplace===c.marketplace);u||m([...l,c]);let d=za(t,a.capabilities,o);if(d.action===`skip`)return u||m(l),i(d.reason);let f=`${c.name}@${c.marketplace}`;Ye(t,`Channel notifications registered`),z(`tengu_mcp_channel_enable`,{plugin:f}),a.client.setNotificationHandler(Ra(),async e=>{let{content:n,meta:r}=e.params;Ye(t,`notifications/claude/channel: ${n.slice(0,80)}`),z(`tengu_mcp_channel_message`,{content_length:n.length,meta_key_count:Object.keys(r??{}).length,entry_kind:`plugin`,is_dev:!1,plugin:f}),q({mode:`prompt`,value:Ia(t,n,r),priority:`next`,isMeta:!0,origin:{kind:`channel`,server:t},skipSlashCommands:!0})}),r.enqueue({type:`control_response`,response:{subtype:`success`,request_id:e,response:void 0}})}function $o(e){if(e.type!==`connected`||za(e.name,e.capabilities,e.config.pluginSource).action!==`register`)return;let t=La(e.name,S()),n=t?.kind===`plugin`?`${t.name}@${t.marketplace}`:void 0;Ye(e.name,`Channel notifications re-registered after reconnect`),e.client.setNotificationHandler(Ra(),async r=>{let{content:i,meta:a}=r.params;Ye(e.name,`notifications/claude/channel: ${i.slice(0,80)}`),z(`tengu_mcp_channel_message`,{content_length:i.length,meta_key_count:Object.keys(a??{}).length,entry_kind:t?.kind,is_dev:t?.dev??!1,plugin:n}),q({mode:`prompt`,value:Ia(e.name,i,a),priority:`next`,isMeta:!0,origin:{kind:`channel`,server:e.name},skipSlashCommands:!0})})}function es(e,t){if(t===`stream-json`){let t={type:`result`,subtype:`error_during_execution`,duration_ms:0,duration_api_ms:0,is_error:!0,num_turns:0,stop_reason:null,session_id:u(),total_cost_usd:0,usage:ia,modelUsage:{},permission_denials:[],uuid:Y(),errors:[e]};process.stdout.write(P(t)+`
36
- `)}else process.stderr.write(e+`
37
- `)}function ts(e,t){let n=e.findIndex(e=>e.uuid===t.uuid);n!==-1&&e.splice(n,2)}async function ns(t,n){let r=!v();if(n.continue)try{z(`tengu_continue_print`,{});let i=await Mi(void 0,void 0);if(i){if(Q){let n=Q.matchSessionMode(i.mode);if(n){process.stderr.write(n+`
38
- `);let{getAgentDefinitionsWithOverrides:r,getActiveAgentsFromList:i}=(Br(),e(fi));r.cache.clear?.();let a=await r(Ue());t(e=>({...e,agentDefinitions:{...a,allAgents:a.allAgents,activeAgents:i(a.allAgents)}}))}}return n.forkSession||i.sessionId&&(te(pr(i.sessionId),i.fullPath?po(i.fullPath):null),r&&await tr()),co(i,t),or(n.forkSession?{...i,worktreeSession:void 0}:i),Q&&yi(Q.isCoordinatorMode()?`coordinator`:`normal`),{messages:i.messages,turnInterruptionState:i.turnInterruptionState,agentSetting:i.agentSetting}}}catch(e){return W(e),K(1),{messages:[]}}if(n.teleport)try{if(!mt(`allow_remote_sessions`))throw Error(`Remote sessions are disabled by your organization's policy.`);if(z(`tengu_teleport_print`,{}),typeof n.teleport!=`string`)throw Error(`No session ID provided for teleport`);let{checkOutTeleportedSessionBranch:e,processMessagesForTeleportResume:t,teleportResumeCodeSession:r,validateGitState:i}=await import(`./teleport-LXFOan9C.js`);await i();let a=await r(n.teleport),{branchError:o}=await e(a.branch);return{messages:t(a.log,o)}}catch(e){return W(e),K(1),{messages:[]}}if(n.resume)try{z(`tengu_resume_print`,{});let a=Do(typeof n.resume==`string`?n.resume:``);if(!a){let e=`Error: --resume requires a valid session ID when used with --print. Usage: claude -p --resume <session-id>`;return typeof n.resume==`string`&&(e+=`. Session IDs must be in UUID format (e.g., 550e8400-e29b-41d4-a716-446655440000). Provided value "${n.resume}" is not a valid UUID`),es(e,n.outputFormat),K(1),{messages:[]}}if(i(process.env.CLAUDE_CODE_USE_CCR_V2)){let[,e]=await Promise.all([ln(a.sessionId),n.restoredWorkerState]);e&&(t(Va(e)),typeof e.model==`string`&&b(e.model))}else a.isUrl&&a.ingressUrl&&i(process.env.ENABLE_SESSION_PERSISTENCE)&&await Or(a.sessionId,a.ingressUrl);let o=await Mi(a.sessionId,a.jsonlFile||void 0);if(!o||o.messages.length===0)return a.isUrl||i(process.env.CLAUDE_CODE_USE_CCR_V2)?{messages:await(n.sessionStartHooksPromise??vt(`startup`))}:(es(`No conversation found with session ID: ${a.sessionId}`,n.outputFormat),K(1),{messages:[]});if(n.resumeSessionAt){let e=o.messages.findIndex(e=>e.uuid===n.resumeSessionAt);if(e<0)return es(`No message found with message.uuid of: ${n.resumeSessionAt}`,n.outputFormat),K(1),{messages:[]};o.messages=e>=0?o.messages.slice(0,e+1):[]}if(Q){let n=Q.matchSessionMode(o.mode);if(n){process.stderr.write(n+`
39
- `);let{getAgentDefinitionsWithOverrides:r,getActiveAgentsFromList:i}=(Br(),e(fi));r.cache.clear?.();let a=await r(Ue());t(e=>({...e,agentDefinitions:{...a,allAgents:a.allAgents,activeAgents:i(a.allAgents)}}))}}return!n.forkSession&&o.sessionId&&(te(pr(o.sessionId),o.fullPath?po(o.fullPath):null),r&&await tr()),co(o,t),or(n.forkSession?{...o,worktreeSession:void 0}:o),Q&&yi(Q.isCoordinatorMode()?`coordinator`:`normal`),{messages:o.messages,turnInterruptionState:o.turnInterruptionState,agentSetting:o.agentSetting}}catch(e){return W(e),es(e instanceof Error?`Failed to resume session: ${e.message}`:`Failed to resume session with --print mode`,n.outputFormat),K(1),{messages:[]}}return{messages:await(n.sessionStartHooksPromise??vt(`startup`))}}function rs(e,t){let n;return n=typeof e==`string`?e.trim()===``?mn([]):mn([P({type:`user`,content:e,uuid:``,session_id:``,message:{role:`user`,content:e},parent_tool_use_id:null})]):e,t.sdkUrl?new bo(t.sdkUrl,n,t.replayUserMessages):new Ga(n,t.replayUserMessages)}async function is({message:e,setAppState:t,onEnqueued:n,handledToolUseIds:r}){let i=e.response;if(i?.subtype===`success`&&i.response?.toolUseID&&typeof i.response.toolUseID==`string`){let e=i.response,t=e.toolUseID;if(!t)return!1;if(I(`handleOrphanedPermissionResponse: received orphaned control_response for toolUseID=${t} request_id=${i.request_id}`),r.has(t))return I(`handleOrphanedPermissionResponse: skipping duplicate orphaned permission for toolUseID=${t} (already handled)`),!1;let a=await jr(t);return a?(r.add(t),I(`handleOrphanedPermissionResponse: enqueuing orphaned permission for toolUseID=${t} messageID=${a.message.id}`),q({mode:`orphaned-permission`,value:[],orphanedPermission:{permissionResult:e,assistantMessage:a}}),n?.(),!0):(I(`handleOrphanedPermissionResponse: no unresolved tool_use found for toolUseID=${t} (already resolved in transcript)`),!1)}return!1}function as(e){return{...e,scope:`dynamic`}}async function os(e,t,n,r){let{allowed:i,blocked:a}=ii(e),o={};for(let e of a)o[e]=`Blocked by enterprise policy (allowedMcpServers/deniedMcpServers)`;let s={},c={};for(let[e,t]of Object.entries(i))t.type===`sdk`?s[e]=t:c[e]=t;let l=new Set(Object.keys(t.configs)),u=new Set(Object.keys(s)),d=[],f=[],p={...t.configs},m=[...t.clients],h=[...t.tools];for(let e of l)if(!u.has(e)){let t=m.find(t=>t.name===e);t&&t.type===`connected`&&await t.cleanup(),m=m.filter(t=>t.name!==e);let n=`mcp__${e}__`;h=h.filter(e=>!e.name.startsWith(n)),delete p[e],f.push(e)}for(let[e,t]of Object.entries(s))if(!l.has(e)){p[e]=t;let n={type:`pending`,name:e,config:{...t,scope:`dynamic`}};m=[...m,n],d.push(e)}let g=await ss(c,n,r);return{response:{added:[...d,...g.response.added],removed:[...f,...g.response.removed],errors:{...o,...g.response.errors}},newSdkState:{configs:p,clients:m,tools:h},newDynamicState:g.newState,sdkServersChanged:d.length>0||f.length>0}}async function ss(e,t,n){let r=new Set(Object.keys(t.configs)),i=new Set(Object.keys(e)),a=[...r].filter(e=>!i.has(e)),o=[...i].filter(e=>!r.has(e)),s=[...r].filter(e=>i.has(e)).filter(n=>{let r=t.configs[n],i=e[n];return!r||!i?!0:!Lr(r,as(i))}),c=[],l=[],u={},d=[...t.clients],f=[...t.tools];for(let e of[...a,...s]){let n=d.find(t=>t.name===e),r=t.configs[e];if(n&&r){if(n.type===`connected`)try{await n.cleanup()}catch(e){W(e)}await fr(e,r)}let i=`mcp__${e}__`;f=f.filter(e=>!e.name.startsWith(i)),d=d.filter(t=>t.name!==e),a.includes(e)&&c.push(e)}for(let t of[...o,...s]){let n=e[t];if(!n)continue;let r=as(n);if(n.type===`sdk`){l.push(t);continue}try{let e=await Gn(t,r);if(d.push(e),e.type===`connected`){let t=await Zn(e);f.push(...t)}else e.type===`failed`&&(u[t]=e.error||`Connection failed`);l.push(t)}catch(e){let n=Ne(e);u[t]=n.message,W(n)}}let p={};for(let t of i){let n=e[t];n&&(p[t]=as(n))}let m={clients:d,tools:f,configs:p};return n(e=>{let n=new Set([...Object.keys(t.configs),...Object.keys(p)]),r=e.mcp.tools.filter(e=>{for(let t of n)if(e.name.startsWith(`mcp__${t}__`))return!1;return!0}),i=e.mcp.clients.filter(e=>!n.has(e.name));return{...e,mcp:{...e.mcp,tools:[...r,...f],clients:[...i,...d]}}}),{response:{added:l,removed:c,errors:u},newState:m}}export{Go as runHeadless};
@@ -1 +0,0 @@
1
- import{a as e}from"./chunk-DR8-3Aex.js";import{Rn as t,t as n,x as r}from"./src-Di342QoJ.js";import{t as i}from"./jsx-runtime-D-D469L8.js";import{Ka as a,oo as o}from"./paths-BBvuDQl9.js";import{L as s,N as c,V as l}from"./debug-UI3T040K.js";import{n as u,r as d}from"./analytics-DqMQntaB.js";import{Bm as f,Dg as p,Dm as m,Lo as h,Og as g,Om as _,bo as v,fC as y,go as b,hu as x,mu as S,pC as C,qo as w,yo as T,zm as E}from"./loadAgentsDir-DI1a76pd.js";import{Ft as D,Pt as O}from"./prompt-CjFAtm3w.js";import{r as k,t as A}from"./xml-Dx--sNE1.js";import{randomUUID as j}from"crypto";t(),n(),x(),g(),f();var M=i();function N({input:e,progress:t,verbose:n}){return(0,M.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,M.jsx)(p,{addMargin:!1,param:{text:`<bash-input>${e}</bash-input>`,type:`text`}}),t?(0,M.jsx)(E,{fullOutput:t.fullOutput,output:t.output,elapsedTimeSeconds:t.elapsedTimeSeconds,totalLines:t.totalLines,verbose:n}):S.renderToolUseProgressMessage?.([],{verbose:n,tools:[],terminalSize:void 0})]})}u(),l(),y(),h(),o();function P(){return a().defaultShell??`bash`}x(),O(),k();async function F(t,n,r,i,a){let o=D()&&P()===`powershell`;d(`tengu_input_bash`,{powershell:o});let l=v({content:w({inputString:`<bash-input>${t}</bash-input>`,precedingInputBlocks:n})}),u;a({jsx:(0,M.jsx)(N,{input:t,progress:null,verbose:i.options.verbose}),shouldHidePromptInput:!1});try{let n={...i,setToolJSX:e=>{u=e?.jsx}},s=e=>{a({jsx:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N,{input:t,progress:e.data,verbose:i.options.verbose}),u]}),shouldHidePromptInput:!1,showSpinner:!1})},c=null;o&&(c=(_(),e(m)).PowerShellTool);let d=c??S,f=(c?await c.call({command:t,dangerouslyDisableSandbox:!0},n,void 0,void 0,s):await S.call({command:t,dangerouslyDisableSandbox:!0},n,void 0,void 0,s)).data;if(!f)throw Error(`No result received from shell command`);let p=f.stderr,h=await C(d,{...f,stderr:``},j()),g=typeof h.content==`string`?h.content:A(f.stdout);return{messages:[b(),l,...r,v({content:`<bash-stdout>${g}</bash-stdout><bash-stderr>${A(p)}</bash-stderr>`})],shouldQuery:!1}}catch(e){return e instanceof c?e.interrupted?{messages:[b(),l,T({toolUse:!1}),...r],shouldQuery:!1}:{messages:[b(),l,...r,v({content:`<bash-stdout>${A(e.stdout)}</bash-stdout><bash-stderr>${A(e.stderr)}</bash-stderr>`})],shouldQuery:!1}:{messages:[b(),l,...r,v({content:`<bash-stderr>Command failed: ${A(s(e))}</bash-stderr>`})],shouldQuery:!1}}finally{a(null)}}export{F as processBashCommand};
@@ -1,6 +0,0 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{Ct as r,cn as i,mr as a,t as o}from"./state-sIHsFpDu.js";import{$ as s,As as c,Dt as l,Ot as u,Zc as d,el as f,ks as p,tt as m}from"./paths-BBvuDQl9.js";import{M as h,V as g,d as _,h as v,k as y,p as b,s as x}from"./debug-UI3T040K.js";import{n as S,r as C}from"./analytics-DqMQntaB.js";import{O as w,et as T,k as E,o as D,s as O}from"./log-CzsijfHZ.js";import{n as k,t as ee}from"./sleep-8Eb9j_Ly.js";import{A as te,Al as A,BE as ne,B_ as re,CD as ie,Cl as ae,Dc as oe,ED as se,E_ as ce,Ec as le,Ek as ue,FA as de,G as fe,G_ as pe,Go as me,Gx as he,H_ as j,Ho as ge,IA as M,I_ as N,Jf as P,K as F,L_ as I,Li as L,Lo as _e,Ml as ve,Nl as ye,Ok as be,Ro as xe,SD as Se,TD as Ce,T_ as we,UD as Te,V_ as Ee,Vi as De,WD as Oe,Wi as ke,Xi as Ae,Yf as je,Yi as Me,_o as Ne,bo as R,bw as Pe,cO as Fe,fo as z,go as B,hO as Ie,i_ as V,ik as Le,kc as Re,lO as ze,la as H,qD as Be,qo as U,qx as Ve,r_ as He,sk as Ue,w as We,w_ as Ge,wo as Ke,xl as qe,xw as Je,yo as Ye,yw as Xe,zE as Ze}from"./loadAgentsDir-DI1a76pd.js";import{a as W,i as Qe,o as G}from"./xml-Dx--sNE1.js";import{E as $e,T as et,w as tt}from"./sessionTracing-DoRJ4nSa.js";import{n as nt,t as rt}from"./slashCommandParsing-Cari0pNg.js";import{randomUUID as K}from"crypto";function it(e,t,n,r,i){let a=0;for(let o of p){let s=n[o];if(s)for(let n of s)for(let s of n.hooks){let c=s.once?()=>{_(`Removing one-shot hook for event ${o} in skill '${r}'`),ce(e,t,o,s)}:void 0;Ge(e,t,o,n.matcher||``,s,c,i),a++}}a>0&&_(`Registered ${a} hooks from skill '${r}'`)}var at=e((()=>{c(),x(),we()}));function ot(){return!1}function st(){if(!ot())throw Error(`ToolUseContext.options.allowBackgroundForkedSlashCommands is test-only and cannot be enabled outside NODE_ENV=test.`)}async function q(e,t,n,r,i,a,o){let s=N(),c=e.pluginInfo?G(e.pluginInfo.repository).marketplace:void 0;C(`tengu_slash_command_forked`,{command_name:e.name,invocation_trigger:`user-slash`,...e.pluginInfo&&{_PROTO_plugin_name:e.pluginInfo.pluginManifest.name,...c&&{_PROTO_marketplace_name:c},...j(e.pluginInfo)}});let{skillContent:u,modifiedGetAppState:f,baseAgent:p,promptMessages:m}=await ye(e,t,n),h=e.effort===void 0?p:{...p,effort:e.effort};_(`Executing forked slash command /${e.name} with agent ${h.agentType}`);let g=await n.getAppState();n.options.allowBackgroundForkedSlashCommands===!0&&st();let v=!1;if(g.kairosEnabled&&(v=!0),v){let t=Se(),r=H(e),i=l(),c=e=>ze({value:e,mode:`prompt`,priority:`later`,isMeta:!0,skipSlashCommands:!0,workload:i}),u=async()=>{if(!o?.runId)return;let e=await Te({runId:o.runId,rootDir:o.rootDir,priority:`later`,workload:i});for(let t of e)Fe(t)},d=async e=>{o?.runId&&await Oe({runId:o.runId,rootDir:o.rootDir,error:e instanceof Error?e.message:String(e)})};return(async()=>{let i=Date.now()+$;for(;Date.now()<i&&n.getAppState().mcp.clients.some(e=>e.type===`pending`);)await k(Q);let o=n.options.refreshTools?.()??n.options.tools,l=[];for await(let r of V({agentDefinition:h,promptMessages:m,toolUseContext:{...n,getAppState:f,abortController:t},canUseTool:a,isAsync:!0,querySource:`agent:custom`,model:e.model,availableTools:o,override:{agentId:s}}))l.push(r);let d=A(l,`Command completed`);_(`Background forked command /${r} completed (agent ${s})`),c(`<scheduled-task-result command="/${r}">\n${d}\n</scheduled-task-result>`);try{await u()}catch(e){O(e)}})().catch(async e=>{O(e),c(`<scheduled-task-result command="/${r}" status="failed">\n${e instanceof Error?e.message:String(e)}\n</scheduled-task-result>`),await d(e)}),{messages:[],shouldQuery:!1,command:e,deferAutonomyCompletion:!!o?.runId}}let y=[],b=[],x=`forked-command-${e.name}`,S=0,w=e=>(S++,{type:`progress`,data:{message:e,type:`agent_progress`,prompt:u,agentId:s},parentToolUseID:x,toolUseID:`${x}-${S}`,timestamp:new Date().toISOString(),uuid:K()}),T=()=>{i({jsx:je(b,{tools:n.options.tools,verbose:!1}),shouldHidePromptInput:!1,shouldContinueAnimation:!0,showSpinner:!0})};T();try{for await(let t of V({agentDefinition:h,promptMessages:m,toolUseContext:{...n,getAppState:f},canUseTool:a,isAsync:!1,querySource:`agent:custom`,model:e.model,availableTools:n.options.tools})){y.push(t);let e=me([t]);if(t.type===`assistant`){let r=Le(t);r>0&&n.setResponseLength(e=>e+r);let i=e[0];i&&i.type===`assistant`&&(b.push(w(t)),T())}if(t.type===`user`){let t=e[0];t&&t.type===`user`&&(b.push(w(t)),T())}}}finally{i(null)}let E=A(y,`Command completed`);return _(`Forked slash command /${e.name} completed with agent ${s}`),process.env.USER_TYPE===`ant`&&(E=`[ANT-ONLY] API calls: ${d(Ce(s))}\n${E}`),{messages:[R({content:U({inputString:`/${H(e)} ${t}`.trim(),precedingInputBlocks:r})}),R({content:`<local-command-stdout>\n${E}\n</local-command-stdout>`})],shouldQuery:!1,command:e,resultText:E}}function ct(e){return!/[^a-zA-Z0-9:\-_]/.test(e)}async function lt(e,t,n,r,i,o,s,c,l,u){let d=nt(e);if(!d){C(`tengu_input_slash_missing`,{});let e="Commands are in the form `/command [args]`";return{messages:[B(),...r,R({content:U({inputString:e,precedingInputBlocks:t})})],shouldQuery:!1,resultText:e}}let{commandName:f,args:p,isMcp:m}=d,h=m?`mcp`:L().has(f)?f:`custom`;if(!Me(f,i.options.commands)){let n=!1;try{await b().stat(`/${f}`),n=!0}catch{}if(ct(f)&&!n){C(`tengu_input_slash_invalid`,{input:f});let e=`Unknown skill: ${f}`;return{messages:[B(),...r,R({content:U({inputString:e,precedingInputBlocks:t})}),...p?[Ne(`Args from unknown skill: ${p}`,`warning`)]:[]],shouldQuery:!1,resultText:e}}let i=K();return a(i),C(`tengu_input_prompt`,{}),et(`user_prompt`,{prompt_length:String(e.length),prompt:$e(e),"prompt.id":i}),{messages:[R({content:U({inputString:e,precedingInputBlocks:t}),uuid:s}),...r],shouldQuery:!0}}let{messages:g,shouldQuery:_,allowedTools:v,model:y,effort:x,command:S,resultText:w,nextInput:T,submitNextInput:E,deferAutonomyCompletion:D}=await ut(f,p,o,i,t,n,c,l,s,u);if(g.length===0){let e={input:h};if(S.type===`prompt`&&S.pluginInfo){let{pluginManifest:t,repository:n}=S.pluginInfo,{marketplace:r}=G(n),i=W(r);e._PROTO_plugin_name=t.name,r&&(e._PROTO_marketplace_name=r),e.plugin_repository=i?n:`third-party`,e.plugin_name=i?t.name:`third-party`,i&&t.version&&(e.plugin_version=t.version),Object.assign(e,j(S.pluginInfo))}return C(`tengu_input_command`,{...e,invocation_trigger:`user-slash`,...process.env.USER_TYPE===`ant`&&{skill_name:f,...S.type===`prompt`&&{skill_source:S.source},...S.loadedFrom&&{skill_loaded_from:S.loadedFrom},...S.kind&&{skill_kind:S.kind}}}),{messages:[],shouldQuery:!1,model:y,nextInput:T,submitNextInput:E,deferAutonomyCompletion:D}}if(g.length===2&&g[1].type===`user`&&typeof g[1].message.content==`string`&&g[1].message.content.startsWith(`Unknown command:`))return e.startsWith(`/var`)||e.startsWith(`/tmp`)||e.startsWith(`/private`)||C(`tengu_input_slash_invalid`,{input:f}),{messages:[B(),...g],shouldQuery:_,allowedTools:v,model:y};let O={input:h};if(S.type===`prompt`&&S.pluginInfo){let{pluginManifest:e,repository:t}=S.pluginInfo,{marketplace:n}=G(t),r=W(n);O._PROTO_plugin_name=e.name,n&&(O._PROTO_marketplace_name=n),O.plugin_repository=r?t:`third-party`,O.plugin_name=r?e.name:`third-party`,r&&e.version&&(O.plugin_version=e.version),Object.assign(O,j(S.pluginInfo))}C(`tengu_input_command`,{...O,invocation_trigger:`user-slash`,...process.env.USER_TYPE===`ant`&&{skill_name:f,...S.type===`prompt`&&{skill_source:S.source},...S.loadedFrom&&{skill_loaded_from:S.loadedFrom},...S.kind&&{skill_kind:S.kind}}});let k=g.length>0&&g[0]&&xe(g[0]);return{messages:_||g.every(ge)||k?g:[B(),...g],shouldQuery:_,allowedTools:v,model:y,effort:x,resultText:w,nextInput:T,submitNextInput:E,deferAutonomyCompletion:D}}async function ut(e,t,n,r,i,a,o,s,c,l){let u=ke(e,r.options.commands);if(u.type===`prompt`&&u.userInvocable!==!1&&Ee(e),u.userInvocable===!1)return{messages:[R({content:U({inputString:`/${e}`,precedingInputBlocks:i})}),R({content:`This skill can only be invoked by Claude, not directly by users. Ask Claude to use the "${e}" skill for you.`})],shouldQuery:!1,command:u};try{switch(u.type){case`local-jsx`:return new Promise(e=>{let a=!1,o=(n,r)=>{if(a=!0,r?.display===`skip`){e({messages:[],shouldQuery:!1,command:u,nextInput:r?.nextInput,submitNextInput:r?.submitNextInput});return}let o=(r?.metaMessages??[]).map(e=>R({content:e,isMeta:!0})),s=Ve()&&typeof n==`string`&&n.endsWith(` dismissed`);e({messages:r?.display===`system`?s?o:[z(J(u,t)),z(`<local-command-stdout>${n}</local-command-stdout>`),...o]:[R({content:U({inputString:J(u,t),precedingInputBlocks:i})}),R(n?{content:`<local-command-stdout>${n}</local-command-stdout>`}:{content:`<local-command-stdout>${de}</local-command-stdout>`}),...o],shouldQuery:r?.shouldQuery??!1,command:u,nextInput:r?.nextInput,submitNextInput:r?.submitNextInput})};u.load().then(e=>e.call(o,{...r,canUseTool:s},t)).then(t=>{if(t!=null){if(r.options.isNonInteractiveSession){e({messages:[],shouldQuery:!1,command:u});return}a||n({jsx:t,shouldHidePromptInput:!0,showSpinner:!1,isLocalJSXCommand:!0,isImmediate:u.immediate===!0})}}).catch(t=>{O(t),!a&&(a=!0,n({jsx:null,shouldHidePromptInput:!1,clearLocalJSX:!0}),e({messages:[],shouldQuery:!1,command:u}))})});case`local`:{let e=R({content:U({inputString:J(u,u.isSensitive&&t.trim()?`***`:t),precedingInputBlocks:i})});try{let n=B(),i=await(await u.load()).call(t,r);if(i.type===`skip`)return{messages:[],shouldQuery:!1,command:u};if(i.type===`compact`){let t=[n,e,...i.displayText?[R({content:`<local-command-stdout>${i.displayText}</local-command-stdout>`,timestamp:new Date(Date.now()+100).toISOString()})]:[]],r={...i.compactionResult,messagesToKeep:[...i.compactionResult.messagesToKeep??[],...t]};return be(),{messages:qe(r),shouldQuery:!1,command:u}}return{messages:[e,z(`<local-command-stdout>${i.value}</local-command-stdout>`)],shouldQuery:!1,command:u,resultText:i.value}}catch(t){return O(t),{messages:[e,z(`<local-command-stderr>${String(t)}</local-command-stderr>`)],shouldQuery:!1,command:u}}}case`prompt`:try{return u.context===`fork`?await q(u,t,r,i,n,s??fe,l):await Z(u,t,r,i,a,c)}catch(e){return e instanceof y?{messages:[R({content:U({inputString:J(u,t),precedingInputBlocks:i})}),Ye({toolUse:!1})],shouldQuery:!1,command:u}:{messages:[R({content:U({inputString:J(u,t),precedingInputBlocks:i})}),R({content:`<local-command-stderr>${String(e)}</local-command-stderr>`})],shouldQuery:!1,command:u}}}}catch(e){if(e instanceof h)return{messages:[R({content:U({inputString:e.message,precedingInputBlocks:i})})],shouldQuery:!1,command:u};throw e}}function J(e,t){return Ke(H(e),t)}function Y(e,t=`loading`){return[`<${w}>${e}</${w}>`,`<${E}>${e}</${E}>`,`<skill-format>true</skill-format>`].join(`
2
- `)}function dt(e,t){return[`<${w}>${e}</${w}>`,`<${E}>/${e}</${E}>`,t?`<command-args>${t}</command-args>`:null].filter(Boolean).join(`
3
- `)}function X(e,t){return e.userInvocable===!1&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)?Y(e.name,e.progressMessage):dt(e.name,t)}async function ft(e,t,n,r,i=[]){let a=De(e,n);if(!a)throw new h(`Unknown command: ${e}`);if(a.type!==`prompt`)throw Error(`Unexpected ${a.type} command. Expected 'prompt' command. Use /${e} directly in the main conversation.`);return Z(a,t,r,[],i)}async function Z(e,t,i,a=[],c=[],l){if(n(process.env.CLAUDE_CODE_COORDINATOR_MODE)&&!i.agentId){let n=X(e,t),r=[`Skill "/${e.name}" is available for workers.`];e.description&&r.push(`Description: ${e.description}`),e.whenToUse&&r.push(`When to use: ${e.whenToUse}`);let i=e.allowedTools??[];i.length>0&&r.push(`This skill grants workers additional tool permissions: ${i.join(`, `)}`),r.push(`\nInstruct a worker to use this skill by including "Use the /${e.name} skill" in your Agent prompt. The worker has access to the Skill tool and will receive the skill's content and permissions when it invokes it.`);let a=[{type:`text`,text:r.join(`
4
- `)}];return{messages:[R({content:n,uuid:l}),R({content:a,isMeta:!0})],shouldQuery:!0,model:e.model,effort:e.effort,command:e}}let u=await e.getPromptForCommand(t,i),d=!Pe(`hooks`)||Je(e.source);if(e.hooks&&d){let t=r();it(i.setAppState,t,e.hooks,e.name,e.type===`prompt`?e.skillRoot:void 0)}let f=e.source?`${e.source}:${e.name}`:e.name,p=u.filter(e=>e.type===`text`).map(e=>e.text).join(`
5
-
6
- `);o(e.name,f,p,s()?.agentId??null);let m=X(e,t),h=te(e.allowedTools??[]),g=c.length>0||a.length>0?[...c,...a,...u]:u,_=await ne(oe(u.filter(e=>e.type===`text`).map(e=>e.text).join(` `),i,null,[],i.messages,`repl_main_thread`,{skipSkillDiscovery:!0}));return{messages:[R({content:m,uuid:l}),R({content:g,isMeta:!0}),..._,le({type:`command_permissions`,allowedTools:h,model:e.model})],shouldQuery:!0,allowedTools:h,model:e.model,effort:e.effort,command:e}}var Q,$;e((()=>{i(),Ae(),M(),T(),S(),se(),ae(),ue(),He(),P(),ie(),m(),Re(),x(),t(),g(),f(),ve(),v(),he(),Ze(),at(),D(),Ie(),_e(),We(),F(),Qe(),Xe(),rt(),ee(),re(),tt(),pe(),Ue(),I(),Be(),u(),Q=200,$=1e4}))();export{Y as formatSkillLoadingMetadata,ft as processPromptSlashCommand,lt as processSlashCommand};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./prompt-CjFAtm3w.js";t();export{e as isDeferredTool};
@@ -1 +0,0 @@
1
- import{Hk as e,Jk as t}from"./loadAgentsDir-DI1a76pd.js";t();export{e as clearPromptCache};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,f as r,t as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{$t as o,Da as s,S as c,Zt as l,_ as u,ka as d,on as f,tn as p}from"./paths-BBvuDQl9.js";import{n as m,r as h}from"./analytics-DqMQntaB.js";import{Dx as g,Ig as _,Lg as v,Ox as y,Rg as b,da as x,fa as S,zg as C}from"./loadAgentsDir-DI1a76pd.js";import{n as w,t as T}from"./extra-usage-CCMwIa85.js";import{n as E,t as D}from"./upgrade-DTBZSxwv.js";function O({onDone:e,context:t}){let[n,i]=(0,A.useState)(null),a=v(),c=p(),d=o(),f=l()?.hasExtraUsageEnabled===!0,m=c===`max`&&d===`default_claude_max_20x`,_=c===`team`||c===`enterprise`,y=u(`tengu_jade_anvil_4`,!1),x=(0,A.useMemo)(()=>{let e=[];if(b.isEnabled()){let t=s(),n=_&&!t,r=a.overageDisabledReason===`out_of_credits`||a.overageDisabledReason===`org_level_disabled_until`||a.overageDisabledReason===`org_service_zero_credit_limit`;if(!(n&&r)){let t=a.overageStatus===`rejected`||a.overageStatus===`allowed_warning`,r;r=n?t?`Request more`:`Request extra usage`:f?`Add funds to continue with extra usage`:`Switch to extra usage`,e.push({label:r,value:`extra-usage`})}}!m&&!_&&S.isEnabled()&&e.push({label:`Upgrade your plan`,value:`upgrade`});let t={label:`Stop and wait for limit to reset`,value:`cancel`};return y?[...e,t]:[t,...e]},[y,m,_,f,a.overageStatus,a.overageDisabledReason]);function C(){h(`tengu_rate_limit_options_menu_cancel`,{}),e(void 0,{display:`skip`})}function w(n){n===`upgrade`?(h(`tengu_rate_limit_options_menu_select_upgrade`,{}),D(e,t).then(e=>{e&&i(e)})):n===`extra-usage`?(h(`tengu_rate_limit_options_menu_select_extra_usage`,{}),T(e,t).then(e=>{e&&i(e)})):n===`cancel`&&C()}return n||(0,j.jsx)(r,{title:`What do you want to do?`,onCancel:C,color:`suggestion`,children:(0,j.jsx)(g,{options:x,onChange:w,visibleOptionCount:x.length})})}async function k(e,t){return(0,j.jsx)(O,{onDone:e,context:t})}var A,j;e((()=>{A=t(n(),1),y(),i(),c(),m(),_(),f(),d(),w(),C(),x(),E(),j=a()}))();export{k as call};
@@ -1,11 +0,0 @@
1
- import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{Ct as i,U as a,br as o,cn as s,wt as c}from"./state-sIHsFpDu.js";import{ea as l,na as u,ra as d,ta as f}from"./paths-BBvuDQl9.js";import{L as p,V as m,X as h,Y as g,d as _,h as ee,p as te,s as ne}from"./debug-UI3T040K.js";import{F as v,P as re}from"./git-CN3qtTb_.js";import{join as ie}from"node:path";import{appendFileSync as ae,existsSync as oe,mkdirSync as se}from"node:fs";import{homedir as ce}from"node:os";import{randomUUID as y}from"crypto";var le=e((()=>{})),ue,de=e((()=>{ue={input_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0,output_tokens:0,server_tool_use:{web_search_requests:0,web_fetch_requests:0},service_tier:`standard`,cache_creation:{ephemeral_1h_input_tokens:0,ephemeral_5m_input_tokens:0},inference_geo:``,iterations:[],speed:`standard`}})),fe=e((()=>{}));function pe(e){return e}var me=e((()=>{})),he=e((()=>{le(),de(),fe(),me()}));function ge(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function _e(e){if(process.env.OPENAI_MODEL)return process.env.OPENAI_MODEL;let t=e.replace(/\[1m\]$/,``),n=ge(t);if(n){let e=`OPENAI_DEFAULT_${n.toUpperCase()}_MODEL`,t=process.env[e];if(t)return t;let r=`ANTHROPIC_DEFAULT_${n.toUpperCase()}_MODEL`,i=process.env[r];if(i)return i}return ve[t]??t}var ve,ye=e((()=>{ve={"claude-sonnet-4-20250514":`gpt-4o`,"claude-sonnet-4-5-20250929":`gpt-4o`,"claude-sonnet-4-6":`gpt-4o`,"claude-opus-4-20250514":`o3`,"claude-opus-4-1-20250805":`o3`,"claude-opus-4-5-20251101":`o3`,"claude-opus-4-6":`o3`,"claude-haiku-4-5-20251001":`gpt-4o-mini`,"claude-3-5-haiku-20241022":`gpt-4o-mini`,"claude-3-7-sonnet-20250219":`gpt-4o`,"claude-3-5-sonnet-20241022":`gpt-4o`}}));function be(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function xe(){let e=process.env.GROK_MODEL_MAP;if(!e)return null;try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t))return t}catch{}return null}function Se(e){if(process.env.GROK_MODEL)return process.env.GROK_MODEL;let t=e.replace(/\[1m\]$/,``),n=be(t),r=xe();if(r&&n&&r[n])return r[n];if(n){let e=`GROK_DEFAULT_${n.toUpperCase()}_MODEL`,t=process.env[e];if(t)return t;let r=`ANTHROPIC_DEFAULT_${n.toUpperCase()}_MODEL`,i=process.env[r];if(i)return i}return b[t]?b[t]:n&&x[n]?x[n]:t}var b,x,Ce=e((()=>{b={"claude-sonnet-4-20250514":`grok-3-mini-fast`,"claude-sonnet-4-5-20250929":`grok-3-mini-fast`,"claude-sonnet-4-6":`grok-3-mini-fast`,"claude-opus-4-20250514":`grok-4.20-reasoning`,"claude-opus-4-1-20250805":`grok-4.20-reasoning`,"claude-opus-4-5-20251101":`grok-4.20-reasoning`,"claude-opus-4-6":`grok-4.20-reasoning`,"claude-haiku-4-5-20251001":`grok-3-mini-fast`,"claude-3-5-haiku-20241022":`grok-3-mini-fast`,"claude-3-7-sonnet-20250219":`grok-3-mini-fast`,"claude-3-5-sonnet-20241022":`grok-3-mini-fast`},x={opus:`grok-4.20-reasoning`,sonnet:`grok-3-mini-fast`,haiku:`grok-3-mini-fast`}}));function we(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function Te(e){if(process.env.GEMINI_MODEL)return process.env.GEMINI_MODEL;let t=e.replace(/\[1m\]$/i,``),n=we(t);if(!n)return t;let r=`GEMINI_DEFAULT_${n.toUpperCase()}_MODEL`,i=process.env[r];if(i)return i;let a=`ANTHROPIC_DEFAULT_${n.toUpperCase()}_MODEL`,o=process.env[a];if(o)return o;throw Error(`Gemini provider requires GEMINI_MODEL or ${r} (or ${a} for backward compatibility) to be configured.`)}var Ee=e((()=>{})),S,De=e((()=>{S=`_geminiThoughtSignature`}));function C(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Oe(e,t){let n=[],r=new Map;for(let t of e){if(t.type===`assistant`){let e=Me(t);e.parts.length>0&&n.push(e);let i=t.message.content;if(Array.isArray(i))for(let e of i)typeof e!=`string`&&e.type===`tool_use`&&r.set(e.id,e.name);continue}if(t.type===`user`){let e=Ae(t,r);e.parts.length>0&&n.push(e)}}let i=ke(t);return{contents:n,...i?{systemInstruction:{parts:[{text:i}]}}:{}}}function ke(e){return!e||e.length===0?``:e.filter(Boolean).join(`
2
-
3
- `)}function Ae(e,t){let n=e.message.content;return typeof n==`string`?{role:`user`,parts:w(n)}:Array.isArray(n)?{role:`user`,parts:n.flatMap(e=>je(e,t))}:{role:`user`,parts:[]}}function je(e,t){if(typeof e==`string`)return w(e);if(e.type===`text`)return w(e.text);if(e.type===`tool_result`){let n=e;return[{functionResponse:{name:t.get(n.tool_use_id)??n.tool_use_id,response:Fe(n)}}]}if(e.type===`image`){let t=e.source;if(t?.type===`base64`&&typeof t.data==`string`)return[{inlineData:{mimeType:t.media_type||`image/png`,data:t.data}}];if(t?.type===`url`&&typeof t.url==`string`)return w(`[image: ${t.url}]`)}return[]}function Me(e){let t=e.message.content;if(typeof t==`string`)return{role:`model`,parts:w(t)};if(!Array.isArray(t))return{role:`model`,parts:[]};let n=[];for(let e of t){if(typeof e==`string`){n.push(...w(e));continue}if(e.type===`text`){n.push(...w(e.text,T(e)));continue}if(e.type===`thinking`){let t=Ne(e.thinking,e.signature);t&&n.push(t);continue}if(e.type===`tool_use`){let t=e;n.push({functionCall:{name:t.name,args:Pe(t.input)},...T(e)&&{thoughtSignature:T(e)}})}}return{role:`model`,parts:n}}function w(e,t){return typeof e!=`string`||e.length===0?[]:[{text:e,...t&&{thoughtSignature:t}}]}function Ne(e,t){if(!(typeof e!=`string`||e.length===0))return{text:e,thought:!0,...t&&{thoughtSignature:t}}}function Pe(e){if(typeof e==`string`){let t=C(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:t===null?{}:{value:t}}return e&&typeof e==`object`&&!Array.isArray(e)?e:e===void 0?{}:{value:e}}function Fe(e){let t=Ie(e.content);return t&&typeof t==`object`&&!Array.isArray(t)?e.is_error?{...t,is_error:!0}:t:{result:t,...e.is_error?{is_error:!0}:{}}}function Ie(e){if(typeof e==`string`)return C(e)??e;if(Array.isArray(e)){let t=e.map(e=>typeof e==`string`?e:e&&typeof e==`object`&&`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(`
4
- `);return C(t)??t}return e??``}function T(e){let t=e[S];return typeof t==`string`&&t.length>0?t:void 0}var Le=e((()=>{De()}));function Re(e){if(typeof e==`string`)return D.has(e)?e:void 0;if(Array.isArray(e)){let t=e.filter(e=>typeof e==`string`&&D.has(e)),n=Array.from(new Set(t));return n.length===0?void 0:n.length===1?n[0]:n}}function ze(e){if(e===null)return`null`;if(Array.isArray(e))return`array`;if(typeof e==`string`)return`string`;if(typeof e==`boolean`)return`boolean`;if(typeof e==`number`)return Number.isInteger(e)?`integer`:`number`;if(typeof e==`object`)return`object`}function Be(e){let t=e.map(ze).filter(e=>e!==void 0),n=Array.from(new Set(t));if(n.length!==0)return n.length===1?n[0]:n}function Ve(e){return e===void 0?[`null`]:Array.isArray(e)?e.includes(`null`)?e:[...e,`null`]:e===`null`?e:[e,`null`]}function He(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=Object.entries(e).map(([e,t])=>[e,E(t)]).filter(([,e])=>Object.keys(e).length>0);if(t.length!==0)return Object.fromEntries(t)}function Ue(e){if(!Array.isArray(e))return;let t=e.map(e=>E(e)).filter(e=>Object.keys(e).length>0);return t.length>0?t:void 0}function E(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e,n={},r=Re(t.type);t.const===void 0?Array.isArray(t.enum)&&t.enum.length>0&&(n.enum=t.enum,r=r??Be(t.enum)):(n.enum=[t.const],r=r??ze(t.const)),r||(t.properties&&typeof t.properties==`object`?r=`object`:(t.items!==void 0||t.prefixItems!==void 0)&&(r=`array`)),t.nullable===!0&&(r=Ve(r)),r&&(n.type=r),typeof t.title==`string`&&(n.title=t.title),typeof t.description==`string`&&(n.description=t.description),typeof t.format==`string`&&(n.format=t.format),typeof t.pattern==`string`&&(n.pattern=t.pattern),typeof t.minimum==`number`?n.minimum=t.minimum:typeof t.exclusiveMinimum==`number`&&(n.minimum=t.exclusiveMinimum),typeof t.maximum==`number`?n.maximum=t.maximum:typeof t.exclusiveMaximum==`number`&&(n.maximum=t.exclusiveMaximum),typeof t.minItems==`number`&&(n.minItems=t.minItems),typeof t.maxItems==`number`&&(n.maxItems=t.maxItems),typeof t.minLength==`number`&&(n.minLength=t.minLength),typeof t.maxLength==`number`&&(n.maxLength=t.maxLength),typeof t.minProperties==`number`&&(n.minProperties=t.minProperties),typeof t.maxProperties==`number`&&(n.maxProperties=t.maxProperties);let i=He(t.properties);if(i&&(n.properties=i,n.propertyOrdering=Object.keys(i)),Array.isArray(t.required)){let e=t.required.filter(e=>typeof e==`string`);e.length>0&&(n.required=e)}if(typeof t.additionalProperties==`boolean`)n.additionalProperties=t.additionalProperties;else{let e=E(t.additionalProperties);Object.keys(e).length>0&&(n.additionalProperties=e)}let a=E(t.items);Object.keys(a).length>0&&(n.items=a);let o=Ue(t.prefixItems);o&&(n.prefixItems=o);let s=Ue(t.anyOf??t.oneOf);return s&&(n.anyOf=s),n}function We(e){let t=E(e);return Object.keys(t).length>0?t:{type:`object`,properties:{}}}function Ge(e){let t=e.filter(e=>{let t=e.type;return e.type===`custom`||!(`type`in e)||t!==`server`}).map(e=>{let t=e;return{name:t.name||``,description:t.description||``,parametersJsonSchema:We(t.input_schema??{type:`object`,properties:{}})}});return t.length>0?[{functionDeclarations:t}]:[]}function Ke(e){if(!e||typeof e!=`object`)return;let t=e;switch(t.type){case`auto`:return{mode:`AUTO`};case`any`:return{mode:`ANY`};case`tool`:return{mode:`ANY`,allowedFunctionNames:typeof t.name==`string`?[t.name]:void 0};default:return}}var D,qe=e((()=>{D=new Set([`string`,`number`,`integer`,`boolean`,`object`,`array`,`null`])}));async function*Je(e,t){let n=`msg_${y().replace(/-/g,``).slice(0,24)}`,r=!1,i=!1,a=0,o=null,s=!1,c,l=0,u=0,d=0;for await(let i of e){let e=i.usageMetadata;e&&(l=e.promptTokenCount??l,u=(e.candidatesTokenCount??0)+(e.thoughtsTokenCount??0),d=e.cachedContentTokenCount??d),r||(r=!0,yield{type:`message_start`,message:{id:n,type:`message`,role:`assistant`,content:[],model:t,stop_reason:null,stop_sequence:null,usage:{input_tokens:l,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:d}}});let f=i.candidates?.[0],p=f?.content?.parts??[];for(let e of p){if(e.functionCall){o&&(yield{type:`content_block_stop`,index:o.index},o=null),s=!0;let t=a++;yield{type:`content_block_start`,index:t,content_block:{type:`tool_use`,id:`toolu_${y().replace(/-/g,``).slice(0,24)}`,name:e.functionCall.name||``,input:{}}},e.thoughtSignature&&(yield{type:`content_block_delta`,index:t,delta:{type:`signature_delta`,signature:e.thoughtSignature}}),e.functionCall.args&&Object.keys(e.functionCall.args).length>0&&(yield{type:`content_block_delta`,index:t,delta:{type:`input_json_delta`,partial_json:JSON.stringify(e.functionCall.args)}}),yield{type:`content_block_stop`,index:t};continue}let t=Ye(e);if(t){(!o||o.type!==t)&&(o&&(yield{type:`content_block_stop`,index:o.index}),o={index:a++,type:t},yield{type:`content_block_start`,index:o.index,content_block:t===`thinking`?{type:`thinking`,thinking:``,signature:``}:{type:`text`,text:``}}),e.text&&(yield{type:`content_block_delta`,index:o.index,delta:t===`thinking`?{type:`thinking_delta`,thinking:e.text}:{type:`text_delta`,text:e.text}}),e.thoughtSignature&&(yield{type:`content_block_delta`,index:o.index,delta:{type:`signature_delta`,signature:e.thoughtSignature}});continue}e.thoughtSignature&&o&&(yield{type:`content_block_delta`,index:o.index,delta:{type:`signature_delta`,signature:e.thoughtSignature}})}f?.finishReason&&(c=f.finishReason)}r&&(o&&(yield{type:`content_block_stop`,index:o.index}),i||(yield{type:`message_delta`,delta:{stop_reason:Xe(c,s),stop_sequence:null},usage:{input_tokens:l,output_tokens:u,cache_creation_input_tokens:0,cache_read_input_tokens:d}},yield{type:`message_stop`},i=!0))}function Ye(e){return typeof e.text==`string`?e.thought?`thinking`:`text`:null}function Xe(e,t){switch(e){case`MAX_TOKENS`:return`max_tokens`;default:return t?`tool_use`:`end_turn`}}var Ze=e((()=>{}));function O(e){if(!e||typeof e!=`object`)return null;let t=e,n=0;for(;t&&n<5;){if(t instanceof Error&&`code`in t&&typeof t.code==`string`){let e=t.code,n=rt.has(e);return{code:e,message:t.message,isSSLError:n}}if(t instanceof Error&&`cause`in t&&t.cause!==t)t=t.cause,n++;else break}return null}function Qe(e){let t=O(e);return t?.isSSLError?`SSL certificate error (${t.code}). If you are behind a corporate proxy or TLS-intercepting firewall, set NODE_EXTRA_CA_CERTS to your CA bundle path, or ask IT to allowlist *.anthropic.com. Run /doctor for details.`:null}function k(e){if(e.includes(`<!DOCTYPE html`)||e.includes(`<html`)){let t=e.match(/<title>([^<]+)<\/title>/);return t&&t[1]?t[1].trim():``}return e}function $e(e){let t=e.message;return t?k(t):``}function et(e){return typeof e==`object`&&!!e&&`error`in e&&typeof e.error==`object`&&e.error!==null}function tt(e){if(!et(e))return null;let t=e.error,n=t?.error?.message;if(typeof n==`string`&&n.length>0){let e=k(n);if(e.length>0)return e}let r=t?.message;if(typeof r==`string`&&r.length>0){let e=k(r);if(e.length>0)return e}return null}function nt(e){let t=O(e);if(t){let{code:e,isSSLError:n}=t;if(e===`ETIMEDOUT`)return`Request timed out. Check your internet connection and proxy settings`;if(n)switch(e){case`UNABLE_TO_VERIFY_LEAF_SIGNATURE`:case`UNABLE_TO_GET_ISSUER_CERT`:case`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`:return`Unable to connect to API: SSL certificate verification failed. Check your proxy or corporate SSL certificates`;case`CERT_HAS_EXPIRED`:return`Unable to connect to API: SSL certificate has expired`;case`CERT_REVOKED`:return`Unable to connect to API: SSL certificate has been revoked`;case`DEPTH_ZERO_SELF_SIGNED_CERT`:case`SELF_SIGNED_CERT_IN_CHAIN`:return`Unable to connect to API: Self-signed certificate detected. Check your proxy or corporate SSL certificates`;case`ERR_TLS_CERT_ALTNAME_INVALID`:case`HOSTNAME_MISMATCH`:return`Unable to connect to API: SSL certificate hostname mismatch`;case`CERT_NOT_YET_VALID`:return`Unable to connect to API: SSL certificate is not yet valid`;default:return`Unable to connect to API: SSL error (${e})`}}if(e.message===`Connection error.`)return t?.code?`Unable to connect to API (${t.code})`:`Unable to connect to API. Check your internet connection`;if(!e.message)return tt(e)??`API error (status ${e.status??`unknown`})`;let n=$e(e);return n!==e.message&&n.length>0?n:e.message}var rt,it=e((()=>{rt=new Set([`UNABLE_TO_VERIFY_LEAF_SIGNATURE`,`UNABLE_TO_GET_ISSUER_CERT`,`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`,`CERT_SIGNATURE_FAILURE`,`CERT_NOT_YET_VALID`,`CERT_HAS_EXPIRED`,`CERT_REVOKED`,`CERT_REJECTED`,`CERT_UNTRUSTED`,`DEPTH_ZERO_SELF_SIGNED_CERT`,`SELF_SIGNED_CERT_IN_CHAIN`,`CERT_CHAIN_TOO_LONG`,`PATH_LENGTH_EXCEEDED`,`ERR_TLS_CERT_ALTNAME_INVALID`,`HOSTNAME_MISMATCH`,`ERR_TLS_HANDSHAKE_TIMEOUT`,`ERR_SSL_WRONG_VERSION_NUMBER`,`ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC`])}));function at(e,t,n){let r=[],i=ot(t);i&&r.push({role:`system`,content:i});for(let t of e)switch(t.type){case`user`:r.push(...st(t));break;case`assistant`:r.push(...lt(t));break;default:break}return r}function ot(e){return!e||e.length===0?``:e.filter(Boolean).join(`
5
-
6
- `)}function st(e){let t=[],n=e.message.content;if(typeof n==`string`)t.push({role:`user`,content:n});else if(Array.isArray(n)){let e=[],r=[],i=[];for(let t of n)if(typeof t==`string`)e.push(t);else if(t.type===`text`)e.push(t.text);else if(t.type===`tool_result`)r.push(t);else if(t.type===`image`){let e=ut(t);e&&i.push(e)}for(let e of r)t.push(ct(e));if(i.length>0){let n=[];e.length>0&&n.push({type:`text`,text:e.join(`
7
- `)}),n.push(...i),t.push({role:`user`,content:n})}else e.length>0&&t.push({role:`user`,content:e.join(`
8
- `)})}return t}function ct(e){let t;return t=typeof e.content==`string`?e.content:Array.isArray(e.content)?e.content.map(e=>typeof e==`string`?e:`text`in e?e.text:``).filter(Boolean).join(`
9
- `):``,{role:`tool`,tool_call_id:e.tool_use_id,content:t}}function lt(e){let t=e.message.content;if(typeof t==`string`)return[{role:`assistant`,content:t}];if(!Array.isArray(t))return[{role:`assistant`,content:``}];let n=[],r=[],i=[];for(let e of t)if(typeof e==`string`)n.push(e);else if(e.type===`text`)n.push(e.text);else if(e.type===`tool_use`){let t=e;r.push({id:t.id,type:`function`,function:{name:t.name,arguments:typeof t.input==`string`?t.input:JSON.stringify(t.input)}})}else if(e.type===`thinking`){let t=e.thinking;typeof t==`string`&&i.push(t)}return[{role:`assistant`,content:n.length>0?n.join(`
10
- `):null,...r.length>0&&{tool_calls:r},...i.length>0&&{reasoning_content:i.join(`
11
- `)}}]}function ut(e){let t=e.source;return t?t.type===`base64`&&typeof t.data==`string`?{type:`image_url`,image_url:{url:`data:${t.media_type||`image/png`};base64,${t.data}`}}:t.type===`url`&&typeof t.url==`string`?{type:`image_url`,image_url:{url:t.url}}:null:null}var dt=e((()=>{}));function ft(e){return e.filter(e=>{let t=e.type;return e.type===`custom`||!(`type`in e)||t!==`server`}).map(e=>{let t=e,n=t.name||``,r=t.description||``,i=t.input_schema;return{type:`function`,function:{name:n,description:r,parameters:A(i||{type:`object`,properties:{}})}}})}function A(e){if(!e||typeof e!=`object`)return e;let t={...e};`const`in t&&(t.enum=[t.const],delete t.const);for(let e of[`properties`,`definitions`,`$defs`,`patternProperties`]){let n=t[e];if(n&&typeof n==`object`){let r={};for(let[e,t]of Object.entries(n))r[e]=t&&typeof t==`object`?A(t):t;t[e]=r}}for(let e of[`items`,`additionalProperties`,`not`,`if`,`then`,`else`,`contains`,`propertyNames`]){let n=t[e];n&&typeof n==`object`&&!Array.isArray(n)&&(t[e]=A(n))}for(let e of[`anyOf`,`oneOf`,`allOf`]){let n=t[e];Array.isArray(n)&&(t[e]=n.map(e=>e&&typeof e==`object`?A(e):e))}return t}function pt(e){if(!e||typeof e!=`object`)return;let t=e;switch(t.type){case`auto`:return`auto`;case`any`:return`required`;case`tool`:return{type:`function`,function:{name:t.name}};default:return}}var mt=e((()=>{}));async function*ht(e,t){let n=`msg_${y().replace(/-/g,``).slice(0,24)}`,r=!1,i=-1,a=new Map,o=!1,s=!1,c=0,l=0,u=0,d=new Set,f=null,p=!1;for await(let m of e){let e=m.choices?.[0],h=e?.delta;if(m.usage){c=m.usage.prompt_tokens??c,l=m.usage.completion_tokens??l;let e=m.usage.prompt_tokens_details;e?.cached_tokens!=null&&(u=e.cached_tokens)}if(r||(r=!0,yield{type:`message_start`,message:{id:n,type:`message`,role:`assistant`,content:[],model:t,stop_reason:null,stop_sequence:null,usage:{input_tokens:c,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:u}}}),!h)continue;let g=h.reasoning_content;if(g!=null&&(o||(i++,o=!0,d.add(i),yield{type:`content_block_start`,index:i,content_block:{type:`thinking`,thinking:``,signature:``}}),g!==``&&(yield{type:`content_block_delta`,index:i,delta:{type:`thinking_delta`,thinking:g}})),h.content!=null&&h.content!==``&&(s||(o&&(yield{type:`content_block_stop`,index:i},d.delete(i),o=!1),i++,s=!0,d.add(i),yield{type:`content_block_start`,index:i,content_block:{type:`text`,text:``}}),yield{type:`content_block_delta`,index:i,delta:{type:`text_delta`,text:h.content}}),h.tool_calls)for(let e of h.tool_calls){let t=e.index;if(!a.has(t)){o&&(yield{type:`content_block_stop`,index:i},d.delete(i),o=!1),s&&(yield{type:`content_block_stop`,index:i},d.delete(i),s=!1),i++;let n=e.id||`toolu_${y().replace(/-/g,``).slice(0,24)}`,r=e.function?.name||``;a.set(t,{contentIndex:i,id:n,name:r,arguments:``}),d.add(i),yield{type:`content_block_start`,index:i,content_block:{type:`tool_use`,id:n,name:r,input:{}}}}let n=e.function?.arguments;n&&(a.get(t).arguments+=n,yield{type:`content_block_delta`,index:a.get(t).contentIndex,delta:{type:`input_json_delta`,partial_json:n}})}if(e?.finish_reason){o&&(yield{type:`content_block_stop`,index:i},d.delete(i),o=!1),s&&(yield{type:`content_block_stop`,index:i},d.delete(i),s=!1);for(let[,e]of a)d.has(e.contentIndex)&&(yield{type:`content_block_stop`,index:e.contentIndex},d.delete(e.contentIndex));f=e.finish_reason,p=a.size>0}}for(let e of d)yield{type:`content_block_stop`,index:e};f!==null&&(yield{type:`message_delta`,delta:{stop_reason:f===`length`?`max_tokens`:p?`tool_use`:gt(f),stop_sequence:null},usage:{input_tokens:c,output_tokens:l,cache_read_input_tokens:u,cache_creation_input_tokens:0}},yield{type:`message_stop`})}function gt(e){switch(e){case`stop`:return`end_turn`;case`tool_calls`:return`tool_use`;case`length`:return`max_tokens`;case`content_filter`:return`end_turn`;default:return`end_turn`}}var _t=e((()=>{})),vt=e((()=>{he(),ye(),Ce(),Ee(),Le(),qe(),Ze(),De(),it(),dt(),mt(),_t()}));function j(e){a()&&(M.length>=xt&&M.shift(),M.push(e))}function yt(){return M.length===0?[]:M.splice(0).map(e=>({...e,uuid:y(),session_id:i()}))}function bt(e,t,n){j({type:`system`,subtype:`task_notification`,task_id:e,tool_use_id:n?.toolUseId,status:t,output_file:n?.outputFile??``,summary:n?.summary??``,usage:n?.usage})}var xt,M,St=e((()=>{s(),xt=1e3,M=[]}));function Ct(){let e=c();if(e!==void 0)return e;let t=process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;if(!t){let e=d(process.env.CLAUDE_SESSION_INGRESS_TOKEN_FILE??l,`session ingress token`);return o(e),e}let n=parseInt(t,10);if(Number.isNaN(n))return _(`CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR must be a valid file descriptor number, got: ${t}`,{level:`error`}),o(null),null;try{let e=te(),t=process.platform===`darwin`||process.platform===`freebsd`?`/dev/fd/${n}`:`/proc/self/fd/${n}`,r=e.readFileSync(t,{encoding:`utf8`}).trim();return r?(_(`Successfully read token from file descriptor ${n}`),o(r),u(l,r,`session ingress token`),r):(_(`File descriptor contained empty token`,{level:`error`}),o(null),null)}catch(e){_(`Failed to read token from file descriptor ${n}: ${p(e)}`,{level:`error`});let t=d(process.env.CLAUDE_SESSION_INGRESS_TOKEN_FILE??l,`session ingress token`);return o(t),t}}function wt(){return process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN||Ct()}function Tt(){let e=wt();if(!e)return{};if(e.startsWith(`sk-ant-sid`)){let t={Cookie:`sessionKey=${e}`},n=process.env.CLAUDE_CODE_ORGANIZATION_UUID;return n&&(t[`X-Organization-Uuid`]=n),t}return{Authorization:`Bearer ${e}`}}function Et(e){process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN=e}var Dt=e((()=>{s(),f(),ne(),m(),ee()})),Ot=t({activateProactive:()=>kt,deactivateProactive:()=>At,getActivationSource:()=>Rt,getNextTickAt:()=>Lt,isContextBlocked:()=>Ft,isProactiveActive:()=>P,isProactivePaused:()=>jt,pauseProactive:()=>Mt,resumeProactive:()=>Nt,setContextBlocked:()=>Pt,setNextTickAt:()=>It,shouldTick:()=>Bt,subscribeToProactiveChanges:()=>zt});function N(){for(let e of B)try{e()}catch{}}function P(){return F}function kt(e){F||(F=!0,I=!1,L=!1,z=e,N())}function At(){F&&(F=!1,I=!1,L=!1,R=null,z=void 0,N())}function jt(){return I}function Mt(){!F||I||(I=!0,R=null,N())}function Nt(){!F||!I||(I=!1,N())}function Pt(e){L!==e&&(L=e,e&&(R=null),N())}function Ft(){return L}function It(e){R=e,N()}function Lt(){return!F||I||L?null:R}function Rt(){return z}function zt(e){return B.add(e),()=>{B.delete(e)}}function Bt(){return F&&!I&&!L}var F,I,L,R,z,B,Vt=e((()=>{F=!1,I=!1,L=!1,R=null,B=new Set}));function Ht(e){H=e}function Ut(e,t){if(U=e,!e||!t?.replayCurrent)return;let n=Jt();Object.keys(n).length!==0&&e(n)}function Wt(e){$t=e}function Gt(e){return!e||e.enabled!==!0?null:{enabled:!0,phase:e.phase===`standby`||e.phase===`sleeping`?e.phase:null,next_tick_at:typeof e.next_tick_at==`number`?e.next_tick_at:null,sleep_until:typeof e.sleep_until==`number`?e.sleep_until:null}}function Kt(e){return JSON.stringify(e)}function qt(e){let t={...K};for(let n of Object.keys(e)){let r=e[n];if(r===void 0){delete t[n];continue}t[n]=r}K=t}function Jt(){let e={...K};return G?e.automation_state={...G}:`automation_state`in K&&(e.automation_state=K.automation_state??null),e}function Yt(){return en}function Xt(e,t){en=e,H?.(e,t),e===`requires_action`&&t?(W=!0,V({pending_action:t})):W&&(W=!1,V({pending_action:null})),e===`idle`&&V({task_summary:null}),e!==`idle`&&Zt(P()?{enabled:!0,phase:null,next_tick_at:null,sleep_until:null}:null),r(process.env.CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS)&&j({type:`system`,subtype:`session_state_changed`,state:e})}function V(e){qt(e),U?.(e)}function Zt(e){let t=Gt(e);Kt(t)!==Kt(G)&&(G=t,qt({automation_state:t}),U?.({automation_state:t}))}function Qt(e){$t?.(e)}var H,U,$t,W,en,G,K,tn=e((()=>{Vt(),n(),St(),H=null,U=null,$t=null,W=!1,en=`idle`,G=null,K={}}));function nn(){an(),Z=setInterval(()=>{v(`debug`,`session_keepalive_heartbeat`,{refcount:J}),r(process.env.CLAUDE_CODE_REMOTE_SEND_KEEPALIVES)&&q?.()},fn)}function rn(){an(),q!==null&&(Q=setTimeout(()=>{v(`info`,`session_idle_30s`),Q=null},fn))}function an(){Q!==null&&(clearTimeout(Q),Q=null)}function on(e){q=e,J>0&&Z===null&&nn()}function sn(){q=null,Z!==null&&(clearInterval(Z),Z=null),an()}function cn(){r(process.env.CLAUDE_CODE_REMOTE_SEND_KEEPALIVES)&&q?.()}function ln(){return q!==null}function un(e){J++,Y.set(e,(Y.get(e)??0)+1),J===1&&(X=Date.now(),q!==null&&Z===null&&nn()),pn||(pn=!0,h(async()=>{v(`info`,`session_activity_at_shutdown`,{refcount:J,active:Object.fromEntries(Y),oldest_activity_ms:J>0&&X!==null?Date.now()-X:null})}))}function dn(e){J>0&&J--;let t=(Y.get(e)??0)-1;t>0?Y.set(e,t):Y.delete(e),J===0&&Z!==null&&(clearInterval(Z),Z=null,rn())}var fn,q,J,Y,X,Z,Q,pn,mn=e((()=>{g(),re(),n(),fn=3e4,q=null,J=0,Y=new Map,X=null,Z=null,Q=null,pn=!1}));function hn(){let e=ie(ce(),`.claude`);oe(e)||se(e,{recursive:!0})}function gn(e){try{$||(hn(),ae(_n,`\n===== RC-DEBUG session ${new Date().toISOString()} =====\n`),$=!0),ae(_n,`[${new Date().toISOString().slice(11,23)}] ${e}\n`)}catch{}}var _n,$,vn=e((()=>{_n=ie(ce(),`.claude`,`rc-debug.log`),$=!1}));export{yt as A,nt as B,Ot as C,wt as D,Tt as E,ht as F,Oe as G,Je as H,pt as I,Se as J,S as K,ft as L,j as M,St as N,Dt as O,vt as P,at as R,jt as S,Bt as T,Ke as U,Qe as V,Ge as W,pe as X,_e as Y,ue as Z,Ut as _,on as a,Ft as b,dn as c,tn as d,Zt as f,Wt as g,Xt as h,ln as i,bt as j,Et as k,sn as l,V as m,gn as n,cn as o,Qt as p,Te as q,mn as r,un as s,vn as t,Yt as u,Ht as v,It as w,P as x,Vt as y,O as z};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{cn as t,ot as n}from"./state-sIHsFpDu.js";import{L as r,V as i,d as a,s as o}from"./debug-UI3T040K.js";import{o as s,s as c}from"./log-CzsijfHZ.js";import{Cc as l,Cw as u,Ip as d,Ov as f,Pp as p,Sc as m,_h as h,bh as g,fs as _,hh as v,i as y,kv as b,lc as x,o as S,ps as C,uc as w,ww as T,yh as E}from"./loadAgentsDir-DI1a76pd.js";async function D(e){a(`refreshActivePlugins: clearing all plugin caches`),x(),p();let t=await C(),[i,o]=await Promise.all([m(),y(n())]),{enabled:s,disabled:l,errors:u}=t,[d,f]=await Promise.all([Promise.all(s.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await T(e,u);return t&&(e.mcpServers=t),t?Object.keys(t).length:0})),Promise.all(s.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await g(e,u);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))]),_=d.reduce((e,t)=>e+t,0),v=f.reduce((e,t)=>e+t,0);e(e=>({...e,plugins:{...e.plugins,enabled:s,disabled:l,commands:i,errors:O(e.plugins.errors,u),needsRefresh:!1},agentDefinitions:o,mcp:{...e.mcp,pluginReconnectKey:e.mcp.pluginReconnectKey+1}})),h();let S=!1;try{await b()}catch(e){S=!0,c(e),a(`refreshActivePlugins: loadPluginHooks failed: ${r(e)}`)}let w=s.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return a(`refreshActivePlugins: ${s.length} enabled, ${i.length} commands, ${o.allAgents.length} agents, ${w} hooks, ${_} MCP, ${v} LSP`),{enabled_count:s.length,disabled_count:l.length,command_count:i.length,agent_count:o.allAgents.length,hook_count:w,mcp_count:_,lsp_count:v,error_count:u.length+ +!!S,agentDefinitions:o,pluginCommands:i}}function O(e,t){let n=e.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r=new Set(t.map(k));return[...n.filter(e=>!r.has(k(e))),...t]}function k(e){return e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`}var A=e((()=>{t(),v(),S(),o(),i(),s(),w(),l(),f(),E(),u(),d(),_()}));export{D as n,A as t};
@@ -1 +0,0 @@
1
- import{iA as e,tA as t}from"./loadAgentsDir-DI1a76pd.js";e();export{t as SandboxManager};
@@ -1 +0,0 @@
1
- import{Yc as e,Zc as t}from"./loadAgentsDir-DI1a76pd.js";e();export{t as isSearchExtraToolsEnabled};
@@ -1 +0,0 @@
1
- import{gu as e,vu as t}from"./loadAgentsDir-DI1a76pd.js";e();export{t as registerSessionFileAccessHooks};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{W as r,cn as i}from"./state-sIHsFpDu.js";import{S as a,_ as o,g as s,mc as c,pc as l}from"./paths-BBvuDQl9.js";import{L as u,R as d,V as f,h as ee,p as te}from"./debug-UI3T040K.js";import{n as ne,r as p}from"./analytics-DqMQntaB.js";import{b as m,x as h}from"./teammate-DMYOtLTK.js";import{$O as g,Bc as re,DD as _,Fo as v,GO as y,In as b,JO as x,KO as S,Ln as ie,Lo as ae,Ml as oe,OD as se,Ol as ce,Pl as C,QO as le,Rn as ue,UO as w,VO as T,Vc as E,XO as D,YO as O,ZO as k,bo as A,cl as j,dk as M,dt as N,ek as P,fk as F,fl as I,ft as L,jO as R,kl as z,lk as B,ml as V,ok as H,pk as de,pl as fe,qO as pe,sk as me,sl as he,tk as ge}from"./loadAgentsDir-DI1a76pd.js";import{On as U,jn as _e}from"./prompt-CjFAtm3w.js";import{X as ve}from"./rcDebugLog-CPKZCtR8.js";import{writeFile as W}from"fs/promises";function ye(){return o(`tengu_session_memory`,!1)}function G(){return s(`tengu_sm_config`,{})}function be(e,t){let n=0,r=t==null;for(let i of e){if(!r){i.uuid===t&&(r=!0);continue}if(i.type===`assistant`){let e=i.message.content;Array.isArray(e)&&(n+=m(e,e=>e.type===`tool_use`))}}return n}function K(e){let t=B(e);if(!O()){if(!S(t))return!1;le()}let n=pe(t),r=be(e,X)>=y(),i=v(e);if(n&&r||n&&!i){let t=e[e.length-1];return t?.uuid&&(X=t.uuid),!0}return!1}async function q(e){let t=te(),n=b();await t.mkdir(n,{mode:448});let r=ie();try{await W(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await W(r,await V(),{encoding:`utf-8`,mode:384})}catch(e){if(d(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await re.call({file_path:r},e),a=``,o=i.data;return o.type===`text`&&(a=o.file.content),p(`tengu_session_memory_file_read`,{content_length:a.length}),{memoryPath:r,currentMemory:a}}function xe(){if(r())return;let e=j();process.env.USER_TYPE===`ant`&&p(`tengu_session_memory_init`,{auto_compact_enabled:e}),e&&se($)}async function Se(e,t){if(e.length===0)return{success:!1,error:`No messages to summarize`};k();try{let n=z(t),{memoryPath:r,currentMemory:i}=await q(n),a=await I(i,r),{tools:o,mainLoopModel:s}=t.options,[c,l,u]=await Promise.all([N(o,s),F(),M()]),d=ve(c);return await C({promptMessages:[A({content:a})],cacheSafeParams:{systemPrompt:d,userContext:l,systemContext:u,toolUseContext:n,forkContextMessages:e},canUseTool:J(r),querySource:`session_memory`,forkLabel:`session_memory_manual`,overrides:{readFileState:n.readFileState}}),p(`tengu_session_memory_manual_extraction`,{}),g(B(e)),Y(e),{success:!0,memoryPath:r}}catch(e){return{success:!1,error:u(e)}}finally{D()}}function J(e){return async(t,n)=>{if(t.name===`Edit`&&typeof n==`object`&&n&&`file_path`in n){let t=n.file_path;if(typeof t==`string`&&t===e)return{behavior:`allow`,updatedInput:n}}return{behavior:`deny`,message:`only ${U} on ${e} is allowed`,decisionReason:{type:`other`,reason:`only ${U} on ${e} is allowed`}}}}function Y(e){if(!v(e)){let t=e[e.length-1];t?.uuid&&P(t.uuid)}}var X,Z,Q,$,Ce=e((()=>{n(),i(),L(),de(),_e(),E(),h(),oe(),ee(),_(),ae(),ue(),l(),R(),me(),ne(),he(),fe(),x(),f(),a(),Z=t(()=>{let e=G();ge({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:T.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:T.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:T.toolCallsBetweenUpdates})}),Q=!1,$=c(async function(e){let{messages:t,toolUseContext:n,querySource:r}=e;if(r!==`repl_main_thread`)return;{let{isPoorModeActive:e}=await import(`./poorMode-DEAe3hiK.js`);if(e())return}if(!ye()){process.env.USER_TYPE===`ant`&&!Q&&(Q=!0,p(`tengu_session_memory_gate_disabled`,{}));return}if(Z(),!K(t))return;k();let i=z(n),{memoryPath:a,currentMemory:o}=await q(i);await C({promptMessages:[A({content:await I(o,a)})],cacheSafeParams:ce(e),canUseTool:J(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],c=s?H(s):void 0,l=w();p(`tengu_session_memory_extraction`,{input_tokens:c?.input_tokens,output_tokens:c?.output_tokens,cache_read_input_tokens:c?.cache_read_input_tokens??void 0,cache_creation_input_tokens:c?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:l.minimumMessageTokensToInit,config_min_tokens_between_update:l.minimumTokensBetweenUpdate,config_tool_calls_between_updates:l.toolCallsBetweenUpdates}),g(B(t)),Y(t),D()})}));export{K as a,Se as i,xe as n,Ce as r,J as t};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./sessionMemory-CMahwDdW.js";t();export{e as manuallyExtractSessionMemory};
@@ -1 +0,0 @@
1
- import{JO as e,WO as t}from"./loadAgentsDir-DI1a76pd.js";e();export{t as getSessionMemoryContent};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./sessionObserver-DG2zQgfi.js";e();export{t as heuristicObserverBackend};
@@ -1 +0,0 @@
1
- import{Ar as e,Lr as t,oi as n}from"./loadAgentsDir-DI1a76pd.js";e();export{t as linkSessionToPR,n as recordTranscript};
@@ -1,2 +0,0 @@
1
- import{c as e,s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{In as r,Ln as i}from"./src-Di342QoJ.js";import{Ct as ee,U as a,cn as o,dr as s,jr as c,lr as l,ut as te}from"./state-sIHsFpDu.js";import{Ac as u,Cn as ne,Pc as d,Sc as f,at as p,bc as m,it as h,on as g,rt as _,st as v}from"./paths-BBvuDQl9.js";import{L as y,V as b}from"./debug-UI3T040K.js";import{n as x,r as S}from"./analytics-DqMQntaB.js";import{n as C,t as w}from"./cwd--iizewsn.js";import{F as T,P as E,f as re,n as D,r as O,v as k}from"./git-CN3qtTb_.js";import{a as A,n as j}from"./env-chR0gV31.js";import{o as M,s as N}from"./log-CzsijfHZ.js";import{a as P,n as F}from"./startupProfiler-DnXZaX4A.js";import{Ar as I,Bv as L,Gi as R,Hm as z,Hv as B,LS as V,Mb as H,Mt as U,Mv as W,Nv as G,RS as K,Rb as q,Um as J,Xi as Y,_t as X,bt as Z,gE as ie,gk as ae,hE as oe,vn as se,vt as ce,wt as le,xi as ue,xk as de,yn as fe,zS as pe}from"./loadAgentsDir-DI1a76pd.js";import{l as me,u as he}from"./terminalSetup-Lyg4NbGA.js";import{c as ge,n as _e}from"./releaseNotes-CnhQit0y.js";import{s as ve,u as ye}from"./logoV2Utils-DDUoPClc.js";import{i as be,r as xe}from"./runtimeObserver-nAhH4Wca.js";import{n as Q,r as Se}from"./sessionMemory-CMahwDdW.js";import{t as Ce}from"./sinks-BrrTUxkC.js";import{homedir as we}from"os";import{join as Te}from"path";import{copyFile as Ee,stat as De}from"fs/promises";t(),i(),o(),x(),C(),b(),E(),A(),k(),g(),v(),_(),de(),ie(),K(),he(),W(),z(),Y(),I(),fe(),ge(),be(),Se(),u(),M();function $(){d(e=>({...e,iterm2SetupInProgress:!1}))}function Oe(){let e=f();return{inProgress:e.iterm2SetupInProgress??!1,backupPath:e.iterm2BackupPath||null}}function ke(){return Te(we(),`Library`,`Preferences`,`com.googlecode.iterm2.plist`)}async function Ae(){let{inProgress:e,backupPath:t}=Oe();if(!e)return{status:`no_backup`};if(!t)return $(),{status:`no_backup`};try{await De(t)}catch{return $(),{status:`no_backup`}}try{return await Ee(t,ke()),$(),{status:`restored`}}catch(e){return N(Error(`Failed to restore iTerm2 settings with: ${e}`)),$(),{status:`failed`,backupPath:t}}}u(),M(),ye(),H(),B(),F(),le();async function je(t,i,o,u,d,g,_,v,b){T(`info`,`setup_started`);let x=process.version.match(/^v(\d+)\./)?.[1];if((!x||parseInt(x,10)<18)&&(console.error(r.bold.red(`Error: Claude Code requires Node.js version 18 or higher.`)),process.exit(1)),_&&c(oe(_)),e(),!e()&&h()){let{captureTeammateModeSnapshot:e}=await import(`./teammateModeSnapshot-C6EWhR0X.js`);e()}if(!a()){if(h()){let e=await Ae();e.status===`restored`?console.log(r.yellow(`Detected an interrupted iTerm2 setup. Your original settings have been restored. You may need to restart iTerm2 for the changes to take effect.`)):e.status===`failed`&&console.error(r.red(`Failed to restore iTerm2 settings. Please manually restore your original settings with: defaults import com.googlecode.iterm2 ${e.backupPath}.`))}try{let e=await me();e.status===`restored`?console.log(r.yellow(`Detected an interrupted Terminal.app setup. Your original settings have been restored. You may need to restart Terminal.app for the changes to take effect.`)):e.status===`failed`&&console.error(r.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){N(e)}}J(t);let C=Date.now();if(V(),T(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-C}),G(t),u){let e=se(),n=await re();!e&&!n&&(process.stderr.write(r.red(`Error: Can only use --worktree in a git repository, but ${r.bold(t)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let i=v?`pr-${v}`:d??L(),a;if(n){let e=D(w());e||(process.stderr.write(r.red(`Error: Could not determine the main git repository root.
2
- `)),process.exit(1)),e!==(O(w())??w())&&(T(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),J(e)),a=g?Z(e,U(i)):void 0}else a=g?Z(w(),U(i)):void 0;let o;try{o=await ce(ee(),i,a,v?{prNumber:v}:void 0)}catch(e){process.stderr.write(r.red(`Error creating worktree: ${y(e)}\n`)),process.exit(1)}if(S(`tengu_worktree_created`,{tmux_enabled:g}),g&&a){let e=await X(a,o.worktreePath);e.created?console.log(r.green(`Created tmux session: ${r.bold(a)}\nTo attach: ${r.bold(`tmux attach -t ${a}`)}`)):console.error(r.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(o.worktreePath),J(o.worktreePath),l(w()),s(w()),ue(o),ae(),pe()}T(`info`,`setup_background_jobs_starting`),e()||(Q(),xe()),q(),T(`info`,`setup_background_jobs_launched`),P(`setup_before_prefetch`),T(`info`,`setup_prefetch_starting`);let E=a()&&n(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)||e();if(E||R(te()),import(`./loadPluginHooks-C0Ei-0E2.js`).then(e=>{E||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),e()||(process.env.USER_TYPE===`ant`&&import(`./commitAttribution-BA4fcbHf.js`).then(async e=>{if(await e.isInternalModelRepo()){let{clearSystemPromptSections:e}=await import(`./systemPromptSections-DB93ZNWP.js`);e()}}),setImmediate(()=>{import(`./attributionHooks-PygdohOh.js`).then(({registerAttributionHooks:e})=>{e()})}),import(`./sessionFileAccessHooks-qnNiGMnE.js`).then(e=>e.registerSessionFileAccessHooks())),Ce(),S(`tengu_started`,{}),ne(a()),P(`setup_after_prefetch`),!e()){let{hasReleaseNotes:e}=await _e(f().lastReleaseNotesSeen);e&&await ve()}if((i===`bypassPermissions`||o)&&(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!n(process.env.CLAUDE_CODE_BUBBLEWRAP)&&(console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`),process.exit(1)),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`claude-desktop`)){let[e,t]=await Promise.all([p.getIsDocker(),j.hasInternetAccess()]),n=p.getIsBubblewrapSandbox(),r=process.env.IS_SANDBOX===`1`;(!(e||n||r)||t)&&(console.error(`--dangerously-skip-permissions can only be used in Docker/sandbox containers with no internet access but got Docker: ${e}, Bubblewrap: ${n}, IS_SANDBOX: ${r}, hasInternet: ${t}`),process.exit(1))}let k=m();k.lastCost!==void 0&&k.lastDuration!==void 0&&S(`tengu_exit`,{last_session_cost:k.lastCost,last_session_api_duration:k.lastAPIDuration,last_session_tool_duration:k.lastToolDuration,last_session_duration:k.lastDuration,last_session_lines_added:k.lastLinesAdded,last_session_lines_removed:k.lastLinesRemoved,last_session_total_input_tokens:k.lastTotalInputTokens,last_session_total_output_tokens:k.lastTotalOutputTokens,last_session_total_cache_creation_input_tokens:k.lastTotalCacheCreationInputTokens,last_session_total_cache_read_input_tokens:k.lastTotalCacheReadInputTokens,last_session_fps_average:k.lastFpsAverage,last_session_fps_low_1_pct:k.lastFpsLow1Pct,last_session_id:k.lastSessionId,...k.lastSessionMetrics})}export{je as setup};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./sink-DxDOsLa2.js";t();export{e as initializeAnalyticsSink};
@@ -1 +0,0 @@
1
- import{t as e}from"./sinks-BrrTUxkC.js";export{e as initSinks};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./chokidar-SzksMqYp.js";import{Ct as n,Fr as r,Pr as i,cn as a,et as o,g as s,jr as ee,lr as c,nr as l,tr as te}from"./state-sIHsFpDu.js";import{Br as ne,Pr as re}from"./paths-BBvuDQl9.js";import{X as ie,Y as ae,d as u,h as oe,p as se,s as d}from"./debug-UI3T040K.js";import{n as ce,r as le}from"./analytics-DqMQntaB.js";import{n as ue,t as f}from"./cwd--iizewsn.js";import{$v as de,Ac as fe,Ar as pe,At as p,Cm as m,Hm as h,Hv as g,Lo as me,Pt as he,Ri as ge,Tm as _e,Um as _,Vv as v,Xi as ve,Yn as ye,_m as y,_o as b,cd as x,di as S,ei as C,fi as w,gE as T,gk as E,gn as D,hE as O,i as k,iE as A,kc as j,o as M,pd as N,r as P,rE as be,ty as xe,vi as Se,vm as Ce,wm as we,wt as Te,xi as F,xk as Ee,xm as De,xt as I,yn as Oe,zi as ke}from"./loadAgentsDir-DI1a76pd.js";import{zt as L}from"./prompt-CjFAtm3w.js";import{f as Ae,l as je,t as Me}from"./commitAttribution-C22a3OCi.js";import{F as Ne,P as Pe}from"./teamHelpers--3ZyNDlv.js";import{n as R,r as Fe}from"./systemPromptSections-BcN_XBTx.js";import{r as Ie}from"./asciicast-o5Zg4dJt.js";import*as z from"path";import{dirname as Le}from"path";a(),Fe(),y(),M(),L(),T(),Ee(),je(),x(),ue(),d(),xe(),me(),re(),g(),h(),pe(),Pe(),A(),Te();function Re(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(!r||r.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=be().safeParse(i.todos);return a.success?a.data:[]}return[]}function ze(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&de(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),e.attributionSnapshots&&e.attributionSnapshots.length>0&&Me(e.attributionSnapshots,e=>{t(t=>({...t,attribution:e}))}),!Ne()&&e.messages&&e.messages.length>0){let r=Re(e.messages);if(r.length>0){let e=n();t(t=>({...t,todos:{...t.todos,[e]:r}}))}}}function Be(e){if(e.attributionSnapshots&&e.attributionSnapshots.length>0)return Ae(e.attributionSnapshots)}function B(e,t){if(!(!e&&!t))return{name:e??``,color:t===`default`?void 0:t}}function V(e,t,n){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return l(void 0),{agentDefinition:void 0,agentType:void 0};let r=n.activeAgents.find(t=>t.agentType===e);return r?(l(r.agentType),!o()&&r.model&&r.model!==`inherit`&&te(ne(r.model)),{agentDefinition:r,agentType:r.agentType}):(u(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),l(void 0),{agentDefinition:void 0,agentType:void 0})}async function Ve(e,t,n,r){if(!e)return r;k.cache.clear?.();let i=await k(t),a=[...i.allAgents,...n];return{...i,allAgents:a,activeAgents:P(a)}}function H(e){let t=I();if(t){F(t);return}if(e){try{process.chdir(e.worktreePath)}catch{F(null);return}_(e.worktreePath),c(f()),p(e),E(),R(),v.cache.clear?.()}}function He(){let e=I();if(e){p(null),E(),R(),v.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}_(e.originalCwd),c(f())}}async function Ue(e,t,n){let r;if(r=n.modeApi?.matchSessionMode(e.mode),r&&e.messages.push(b(r,`warning`)),t.forkSession)e.contentReplacements?.length&&await C(e.contentReplacements);else{let n=t.sessionIdOverride??e.sessionId;n&&(ee(O(n),t.transcriptPath?Le(t.transcriptPath):null),await Ie(),await S(),Ce(n))}w(t.forkSession?{...e,worktreeSession:void 0}:e),t.forkSession||(H(e.worktreeSession),ye());let{agentDefinition:i,agentType:a}=V(e.agentSetting,n.mainThreadAgentDefinition,n.agentDefinitions);Se(n.modeApi?.isCoordinatorMode()?`coordinator`:`normal`);let o=t.includeAttribution?Be(e):void 0,s=B(e.agentName,e.agentColor);N(e.agentName);let c=await Ve(!!r,n.currentCwd,n.cliAgents,n.agentDefinitions);return{messages:e.messages,fileHistorySnapshots:e.fileHistorySnapshots,contentReplacements:e.contentReplacements,agentName:e.agentName,agentColor:e.agentColor===`default`?void 0:e.agentColor,restoredAgentDef:i,initialState:{...n.initialState,...a&&{agent:a},...o&&{attribution:o},...s&&{standaloneAgentContext:s},agentDefinitions:c}}}e(),a(),ve(),ce(),we(),j(),ae(),d(),oe(),Oe(),r();var We=1e3,Ge=500,Ke=300,qe=2e3,Je=typeof Bun<`u`,U=null,W=null,G=new Set,K=!1,q=!1,J=!1,Y=null,X=i(),Z=null;async function Ye(){if(K||q)return;K=!0,J||(J=!0,_e(()=>{ge(),X.emit()}));let e=await Ze();e.length!==0&&(u(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),U=t.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Z?.stabilityThreshold??We,pollInterval:Z?.pollInterval??Ge},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(z.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Je,interval:Z?.chokidarInterval??qe,atomic:!0}),U.on(`add`,$),U.on(`change`,$),U.on(`unlink`,$),Y=ie(async()=>{await Q()}))}function Q(){q=!0,Y&&(Y(),Y=null);let e=Promise.resolve();return U&&(e=U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),e}var Xe=X.subscribe;async function Ze(){let e=se(),t=[],n=m(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=m(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=m(`projectSettings`,`skills`);if(i)try{let n=z.resolve(i);await e.stat(n),t.push(n)}catch{}let a=m(`projectSettings`,`commands`);if(a)try{let n=z.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of s()){let r=z.join(n,`.claude`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){u(`Detected skill change: ${e}`),le(`tengu_skill_file_changed`,{source:`chokidar`}),Qe(e)}function Qe(e){G.add(e),W&&clearTimeout(W),W=setTimeout(async()=>{W=null;let e=[...G];if(G.clear(),D(await he(`skills`,e[0]))){u(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}De(),ke(),fe(),X.emit()},Z?.reloadDebounce??Ke)}async function $e(e){U&&(await U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),K=!1,q=!1,Z=e??null}var et={initialize:Ye,dispose:Q,subscribe:Xe,resetForTesting:$e};export{V as a,Ue as i,B as n,ze as o,He as r,H as s,et as t};
@@ -1 +0,0 @@
1
- import"./featureCheck-Cm0YNDXO.js";import"./instinctParser-DHMa8xa0.js";import"./skillGenerator-kbaRbpqJ.js";import{p as e}from"./runtimeObserver-nAhH4Wca.js";import{o as t}from"./observationStore-tvkldXUo.js";import{c as n}from"./projectContext-eXMSfgdZ.js";import"./sessionObserver-DG2zQgfi.js";import"./toolEventObserver-DzLd0MSn.js";import"./skillGapStore-_YuJP5KI.js";import{t as r}from"./skillLearning-DBbdGbk-.js";r();export{e as loadInstincts,t as readObservations,n as resolveProjectContext};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./featureCheck-Cm0YNDXO.js";import{b as n,m as r,o as i}from"./skillGenerator-kbaRbpqJ.js";import{S as a,T as o,f as s,i as c,k as l,u}from"./runtimeObserver-nAhH4Wca.js";import{i as d}from"./observationStore-tvkldXUo.js";import{a as f}from"./projectContext-eXMSfgdZ.js";import{a as p,c as m,d as h,i as g}from"./sessionObserver-DG2zQgfi.js";import{n as _}from"./toolEventObserver-DzLd0MSn.js";import{n as v}from"./skillGapStore-_YuJP5KI.js";var y=e((()=>{t(),a(),n(),s(),d(),u(),f(),c(),h(),p(),l(),o(),_(),g(),v(),i(),r(),m()}));export{y as t};
@@ -1 +0,0 @@
1
- import{a as e,t}from"./teamHelpers--3ZyNDlv.js";e();export{t as cleanupSessionTeams};
@@ -1 +0,0 @@
1
- import{a as e,t}from"./teammateModeSnapshot-DOQMTKbQ.js";e();export{t as captureTeammateModeSnapshot};
@@ -1 +0,0 @@
1
- import{av as e,nv as t,rv as n,sv as r,uv as i}from"./loadAgentsDir-DI1a76pd.js";n();export{t as checkOutTeleportedSessionBranch,e as processMessagesForTeleportResume,r as teleportResumeCodeSession,i as validateGitState};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Lt as n,Rn as r,b as i,f as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{al as l,el as u}from"./paths-BBvuDQl9.js";import{K as d,U as f,V as p,d as m,s as h}from"./debug-UI3T040K.js";import{r as g,t as _}from"./execa-CGue6Z3n.js";import{o as ee,s as v}from"./log-CzsijfHZ.js";import{i as te,o as y}from"./platform-CuyedWpe.js";import{r as b,t as x}from"./execFileNoThrow-CuQN1sz8.js";import{As as S,DA as C,Dx as w,Es as T,Fs as E,Gs as ne,Hs as re,Is as ie,Ox as ae,TA as oe,Vs as se,fs as ce,gy as D,lc as O,my as k,ps as A,uc as j}from"./loadAgentsDir-DI1a76pd.js";import{n as M,r as N}from"./pluginStartupCheck-BW2fjg2P.js";import{a as P,s as F}from"./pluginOperations-CNCImIe8.js";import{join as I}from"path";import{readFile as L}from"fs/promises";function R(){return process.env.USER_TYPE===`ant`?q:oe}function z(){return process.env.USER_TYPE===`ant`?J:Y}function B(){return`thinkback@${R()}`}async function V(){let{enabled:e}=await A(),t=e.find(e=>e.name===`thinkback`||e.source&&e.source.includes(B()));if(!t)return null;let n=I(t.path,`skills`,X);return await l(n)?n:null}async function H(e){let t=I(e,`year_in_review.js`),r=I(e,`player.js`);try{await L(t)}catch(e){return f(e)?{success:!1,message:`No animation found. Run /think-back first to generate one.`}:(v(e),{success:!1,message:`Could not access animation data: ${d(e).message}`})}try{await L(r)}catch(e){return f(e)?{success:!1,message:`Player script not found. The player.js file is missing from the thinkback skill.`}:(v(e),{success:!1,message:`Could not access player script: ${d(e).message}`})}let i=n.get(process.stdout);if(!i)return{success:!1,message:`Failed to access terminal instance`};i.enterAlternateScreen();try{await _(`node`,[r],{stdio:`inherit`,cwd:e,reject:!1})}catch{}finally{i.exitAlternateScreen()}let a=I(e,`year_in_review.html`);if(await l(a)){let e=te();x(e===`macos`?`open`:e===`windows`?`start`:`xdg-open`,[a])}return{success:!0,message:`Year in review animation complete!`}}function U({onReady:e,onError:t}){let[n,r]=(0,G.useState)({phase:`checking`}),[a,o]=(0,G.useState)(``);if((0,G.useEffect)(()=>{async function n(){try{let t=await re(),n=R(),i=z(),a=B(),s=n in t,c=S(a);if(s?c||(r({phase:`installing-marketplace`}),o(`Updating marketplace…`),m(`Refreshing marketplace ${n}`),await ne(n,e=>{o(e)}),ie(),O(),m(`Marketplace ${n} refreshed`)):(r({phase:`installing-marketplace`}),m(`Installing marketplace ${i}`),await E({source:`github`,repo:i},e=>{o(e)}),O(),m(`Marketplace ${n} installed`)),c){let{disabled:e}=await A();if(e.some(e=>e.name===`thinkback`||e.source?.includes(a))){r({phase:`enabling-plugin`}),m(`Enabling plugin ${a}`);let e=await P(a);if(!e.success)throw Error(`Failed to enable plugin: ${e.message}`);O(),m(`Plugin ${a} enabled`)}}else{r({phase:`installing-plugin`}),m(`Installing plugin ${a}`);let e=await N([a]);if(e.failed.length>0){let t=e.failed.map(e=>`${e.name}: ${e.error}`).join(`, `);throw Error(`Failed to install plugin: ${t}`)}O(),m(`Plugin ${a} installed`)}r({phase:`ready`}),e()}catch(e){let n=d(e);v(n),r({phase:`error`,message:n.message}),t(n.message)}}n()},[e,t]),n.phase===`error`)return(0,K.jsx)(s,{flexDirection:`column`,children:(0,K.jsxs)(i,{color:`error`,children:[`Error: `,n.message]})});if(n.phase===`ready`)return null;let c=n.phase===`checking`?`Checking thinkback installation…`:n.phase===`installing-marketplace`?`Installing marketplace…`:n.phase===`enabling-plugin`?`Enabling thinkback plugin…`:`Installing thinkback plugin…`;return(0,K.jsx)(s,{flexDirection:`column`,children:(0,K.jsxs)(s,{children:[(0,K.jsx)(k,{}),(0,K.jsx)(i,{children:a||c})]})})}function W({onDone:e,onAction:t,skillDir:n,hasGenerated:r}){let[o,c]=(0,G.useState)(!1),l=r?[{label:`Play animation`,value:`play`,description:`Watch your year in review`},{label:`Edit content`,value:`edit`,description:`Modify the animation`},{label:`Fix errors`,value:`fix`,description:`Fix validation or rendering issues`},{label:`Regenerate`,value:`regenerate`,description:`Create a new animation from scratch`}]:[{label:`Let's go!`,value:`regenerate`,description:`Generate your personalized animation`}];function u(r){c(!0),r===`play`?H(n).then(()=>{e(void 0,{display:`skip`})}):t(r)}function d(){e(void 0,{display:`skip`})}return o?null:(0,K.jsx)(a,{title:`Think Back on 2025 with Claude Code`,subtitle:`Generate your 2025 Claude Code Think Back (takes a few minutes to run)`,onCancel:d,color:`claude`,children:(0,K.jsxs)(s,{flexDirection:`column`,gap:1,children:[!r&&(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(i,{children:`Relive your year of coding with Claude.`}),(0,K.jsx)(i,{dimColor:!0,children:`We'll create a personalized ASCII animation celebrating your journey.`})]}),(0,K.jsx)(w,{options:l,onChange:u,visibleOptionCount:5})]})})}function le({onDone:e}){let[t,n]=(0,G.useState)(!1),[r,a]=(0,G.useState)(null),[o,c]=(0,G.useState)(null),[u,d]=(0,G.useState)(null);function f(){n(!0)}let p=(0,G.useCallback)(t=>{a(t),e(`Error with thinkback: ${t}. Try running /plugin to manually install the think-back plugin.`,{display:`system`})},[e]);(0,G.useEffect)(()=>{t&&!o&&!r&&V().then(e=>{e?(m(`Thinkback skill directory: ${e}`),c(e)):p(`Could not find thinkback skill directory`)})},[t,o,r,p]),(0,G.useEffect)(()=>{if(!o)return;let e=I(o,`year_in_review.js`);l(e).then(t=>{m(`Checking for ${e}: ${t?`found`:`not found`}`),d(t)})},[o]);function h(t){e({edit:Z,fix:Q,regenerate:$}[t],{display:`user`,shouldQuery:!0})}return r?(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsxs)(i,{color:`error`,children:[`Error: `,r]}),(0,K.jsx)(i,{dimColor:!0,children:`Try running /plugin to manually install the think-back plugin.`})]}):t?!o||u===null?(0,K.jsxs)(s,{children:[(0,K.jsx)(k,{}),(0,K.jsx)(i,{children:`Loading thinkback skill…`})]}):(0,K.jsx)(W,{onDone:e,onAction:h,skillDir:o,hasGenerated:u}):(0,K.jsx)(U,{onReady:f,onError:p})}async function ue(e){return(0,K.jsx)(le,{onDone:e})}var G,K,q,J,Y,X,Z,Q,$,de=e((()=>{g(),r(),G=t(r(),1),ae(),o(),D(),F(),h(),p(),b(),u(),ee(),y(),j(),T(),se(),C(),ce(),M(),K=c(),q=`claude-code-marketplace`,J=`anthropics/claude-code-marketplace`,Y=`anthropics/claude-plugins-official`,X=`thinkback`,Z=`Use the Skill tool to invoke the "thinkback" skill with mode=edit to modify my existing Claude Code year in review animation. Ask me what I want to change. When the animation is ready, tell the user to run /think-back again to play it.`,Q=`Use the Skill tool to invoke the "thinkback" skill with mode=fix to fix validation or rendering errors in my existing Claude Code year in review animation. Run the validator, identify errors, and fix them. When the animation is ready, tell the user to run /think-back again to play it.`,$=`Use the Skill tool to invoke the "thinkback" skill with mode=regenerate to create a completely new Claude Code year in review animation from scratch. Delete the existing animation and start fresh. When the animation is ready, tell the user to run /think-back again to play it.`}));export{de as n,H as r,ue as t};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./thinkback-DPXwEK3B.js";e();export{n as call,t as playAnimation};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{DA as t,Es as n,Ms as r,TA as i}from"./loadAgentsDir-DI1a76pd.js";import{n as a,r as o}from"./thinkback-DPXwEK3B.js";import{join as s}from"path";function c(){return`thinkback@${process.env.USER_TYPE===`ant`?u:i}`}async function l(){let e=r(),t=c(),n=e.plugins[t];if(!n||n.length===0)return{type:`text`,value:`Thinkback plugin not installed. Run /think-back first to install it.`};let i=n[0];return i?.installPath?{type:`text`,value:(await o(s(i.installPath,`skills`,d))).message}:{type:`text`,value:`Thinkback plugin installation path not found.`}}var u,d;e((()=>{n(),t(),a(),u=`claude-code-marketplace`,d=`thinkback`}))();export{l as call};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./toolPool-Dq-Vtvrj.js";e();export{t as applyCoordinatorToolFilter};
@@ -1 +0,0 @@
1
- import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{Dl as n,Ol as r,bl as i,yl as a}from"./paths-BBvuDQl9.js";import{XC as o,ZC as s,cE as c,sE as l}from"./loadAgentsDir-DI1a76pd.js";import{s as u,u as d}from"./prompt-CjFAtm3w.js";function f(e){return h.some(t=>e.endsWith(t))}function p(e){return e.filter(e=>u.has(e.name)||f(e.name))}function m(e,t,n){let[a,o]=r(i([...e,...t],`name`),s),c=(e,t)=>e.name.localeCompare(t.name),l=[...o.sort(c),...a.sort(c)];return g&&g.isCoordinatorMode()?p(l):l}var h,g,_=t((()=>{n(),a(),d(),o(),h=[`subscribe_pr_activity`,`unsubscribe_pr_activity`],g=(c(),e(l))}));export{m as i,_ as n,f as r,p as t};
@@ -1 +0,0 @@
1
- import{i as e,n as t}from"./undercover-DvvnEmsX.js";t();export{e as shouldShowUndercoverAutoNotice};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./upgrade-DTBZSxwv.js";e();export{t as call};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-Di342QoJ.js";import{Br as r,Pr as i,S as a,w as o,wr as s}from"./paths-BBvuDQl9.js";import{MS as c,jS as l}from"./loadAgentsDir-DI1a76pd.js";function u(){let e=c(e=>e.mainLoopModel),t=c(e=>e.mainLoopModelForSession),[,n]=(0,d.useReducer)(e=>e+1,0);return(0,d.useEffect)(()=>o(n),[]),r(t??e??s())}var d,f=e((()=>{d=t(n(),1),a(),l(),i()}));export{u as n,f as t};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-Di342QoJ.js";import{W as r,cn as i}from"./state-sIHsFpDu.js";import{Ab as a,BS as o,OS as s,VS as c,jb as l,kS as u}from"./loadAgentsDir-DI1a76pd.js";function d(){let{addNotification:e,removeNotification:t}=u(),[n,i]=(0,f.useState)(()=>{let{errors:e}=a();return e});return c((0,f.useCallback)(()=>{let{errors:e}=a();i(e)},[])),(0,f.useEffect)(()=>{r()||(n.length>0?e({key:p,text:`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`,color:`warning`,priority:`high`,timeoutMs:6e4}):t(p))},[n,e,t]),n}var f,p,m=e((()=>{f=t(n()),s(),i(),l(),o(),p=`settings-errors`}));export{d as n,m as t};
@@ -1 +0,0 @@
1
- import{Sp as e,yp as t}from"./loadAgentsDir-DI1a76pd.js";e();export{t as clearWebFetchCache};
@@ -1 +0,0 @@
1
- import{a as e,i as t,n}from"./voiceModeEnabled-DA76xN1Q.js";n();export{t as isVoiceGrowthBookEnabled,e as isVoiceModeEnabled};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./voiceStreamSTT-_w1VjIOs.js";t();export{e as isVoiceStreamAvailable};
@@ -1 +0,0 @@
1
- import{wt as e,yt as t}from"./loadAgentsDir-DI1a76pd.js";e();export{t as execIntoTmuxWorktree};