claude-code-best 2.7.0 → 2.7.2

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 (887) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-V2tF7iCY.js +1 -0
  2. package/dist/chunks/App-DLdRpU7c.js +1 -0
  3. package/dist/chunks/ApproveApiKey-B7_TCGwt.js +1 -0
  4. package/dist/chunks/ApproveApiKey-DPws3jax.js +1 -0
  5. package/dist/chunks/AssistantSessionChooser-D6rS0OVe.js +1 -0
  6. package/dist/chunks/BackgroundTasksDialog-hGlbm5z5.js +2 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-CuEpdRVd.js +1 -0
  8. package/dist/chunks/ClaudeInChromeOnboarding-CTTKMRbt.js +1 -0
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-B-GkVoA_.js +1 -0
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-DxJK9NiM.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-LPZ97jsm.js +1 -0
  12. package/dist/chunks/DesktopHandoff-BjPylhOT.js +1 -0
  13. package/dist/chunks/DevChannelsDialog-c4YVqBX9.js +1 -0
  14. package/dist/chunks/DiffDialog-I5wuXw2C.js +3 -0
  15. package/dist/chunks/Doctor-Cr_MlSPc.js +3 -0
  16. package/dist/chunks/Doctor-hgf3dMAW.js +1 -0
  17. package/dist/chunks/ExitFlow-Bz5grDWv.js +2 -0
  18. package/dist/chunks/Feedback-COgMI5tY.js +2 -0
  19. package/dist/chunks/Grove-Bwmghb-e.js +1 -0
  20. package/dist/chunks/Grove-m57x4tY1.js +11 -0
  21. package/dist/chunks/HybridTransport-Bok4-Ptt.js +4 -0
  22. package/dist/chunks/ITermBackend-BBSP-NNa.js +1 -0
  23. package/dist/chunks/InvalidConfigDialog-uTSuSBvO.js +1 -0
  24. package/dist/chunks/InvalidSettingsDialog-B-Os12-H.js +1 -0
  25. package/dist/chunks/MCPConnectionManager-y97Inszc.js +1 -0
  26. package/dist/chunks/McpParsingWarnings-DMFUZw92.js +1 -0
  27. package/dist/chunks/MessageSelector-DwdAC2io.js +3 -0
  28. package/dist/chunks/Messages-FEBcX-cT.js +11 -0
  29. package/dist/chunks/Onboarding-B8qMJaBh.js +1 -0
  30. package/dist/chunks/OverageCreditUpsell-DnFv5z-z.js +1 -0
  31. package/dist/chunks/PluginSettings-B_xVgTTp.js +17 -0
  32. package/dist/chunks/PromptInputFooterSuggestions-DhIQ0Nge.js +1 -0
  33. package/dist/chunks/PromptInputHelpMenu-CoMkWchC.js +1 -0
  34. package/dist/chunks/QueryEngine-C7r7O-hH.js +1 -0
  35. package/dist/chunks/REPL-CmJdJrGO.js +147 -0
  36. package/dist/chunks/REPL-nP7H_-qa.js +1 -0
  37. package/dist/chunks/RemoteCallout-4JOZROfT.js +1 -0
  38. package/dist/chunks/RemoteSessionManager-jcPnywfY.js +2 -0
  39. package/dist/chunks/ResumeConversation-CZ2Uedkf.js +1 -0
  40. package/dist/chunks/SSETransport-kEH_p4Yq.js +4 -0
  41. package/dist/chunks/SearchExtraToolsTool-C64oVFUD.js +1 -0
  42. package/dist/chunks/SentryErrorBoundary-2E2qGV11.js +1 -0
  43. package/dist/chunks/SentryErrorBoundary-97iY7Nb7.js +2 -0
  44. package/dist/chunks/Settings-CuljH0mu.js +2 -0
  45. package/dist/chunks/TeleportProgress-Ctdqi7iS.js +1 -0
  46. package/dist/chunks/TeleportRepoMismatchDialog-DyTBg1YD.js +1 -0
  47. package/dist/chunks/TeleportResumeWrapper-B66clYsG.js +1 -0
  48. package/dist/chunks/ThemePicker-WKmYvrqz.js +1 -0
  49. package/dist/chunks/TmuxBackend-OKX2NP14.js +9 -0
  50. package/dist/chunks/TrustDialog-0anSIf-G.js +1 -0
  51. package/dist/chunks/TungstenTool-B40YHYXC.js +1 -0
  52. package/dist/chunks/ValidationErrorsList-CfgC1KJb.js +2 -0
  53. package/dist/chunks/WelcomeV2-BMHXiNt3.js +1 -0
  54. package/dist/chunks/WindowsTerminalBackend-fCSGVe4W.js +2 -0
  55. package/dist/chunks/add-dir-CMtuW667.js +1 -0
  56. package/dist/chunks/agentDisplay-CgYKW3G7.js +1 -0
  57. package/dist/chunks/agents-CdqcGm9o.js +103 -0
  58. package/dist/chunks/agents-D90TsYOf.js +2 -0
  59. package/dist/chunks/ant-DZjimiuz.js +1 -0
  60. package/dist/chunks/api-CQWbpxLP.js +1 -0
  61. package/dist/chunks/api-quOYYOhi.js +1 -0
  62. package/dist/chunks/asciicast-C_1Pi99k.js +4 -0
  63. package/dist/chunks/asciicast-DA6TudSH.js +1 -0
  64. package/dist/chunks/assistant-B5_xx00q.js +1 -0
  65. package/dist/chunks/assistant-CEmC_DlU.js +1 -0
  66. package/dist/chunks/assistant-CyVcFPIR.js +1 -0
  67. package/dist/chunks/auth-CjtaiRtF.js +1 -0
  68. package/dist/chunks/auth-DsQEVs9W.js +1 -0
  69. package/dist/chunks/autoMode-DEbM9UaE.js +45 -0
  70. package/dist/chunks/autonomy-Clap6Swl.js +1 -0
  71. package/dist/chunks/autonomy-lNpGnyiu.js +19 -0
  72. package/dist/chunks/autonomyPanel-BqEvfI0e.js +1 -0
  73. package/dist/chunks/backgroundHousekeeping-D-jt-ocx.js +1 -0
  74. package/dist/chunks/backgroundHousekeeping-KvOpP_4M.js +17 -0
  75. package/dist/chunks/banner-D9Cq292T.js +2 -0
  76. package/dist/chunks/bg-CngkAkgc.js +1 -0
  77. package/dist/chunks/bg-DgpgS_VU.js +9 -0
  78. package/dist/chunks/branch-CSYB04xC.js +3 -0
  79. package/dist/chunks/break-cache-DrIa8RdW.js +8 -0
  80. package/dist/chunks/bridge-DDgASypO.js +2 -0
  81. package/dist/chunks/bridgeConfig-BdZVEqhx.js +1 -0
  82. package/dist/chunks/bridgeConfig-DjC4oig1.js +1 -0
  83. package/dist/chunks/bridgeEnabled-Csn6Ym3k.js +1 -0
  84. package/dist/chunks/bridgeEnabled-DLRIH243.js +1 -0
  85. package/dist/chunks/bridgeMain-B5wsmwkN.js +68 -0
  86. package/dist/chunks/bridgeMain-BN0Sag35.js +1 -0
  87. package/dist/chunks/bridgeMessaging-ChOzzVWj.js +1 -0
  88. package/dist/chunks/bridgePointer-Clcvh52n.js +1 -0
  89. package/dist/chunks/browser-Bt-ckCaU.js +1 -0
  90. package/dist/chunks/btw-BgjcOoeo.js +1 -0
  91. package/dist/chunks/buddy-C1wE3noR.js +3 -0
  92. package/dist/chunks/bypassPermissionsKillswitch-C0diGLRB.js +1 -0
  93. package/dist/chunks/caches-CIoVGP24.js +3 -0
  94. package/dist/chunks/caches-DMYdTEAr.js +1 -0
  95. package/dist/chunks/ccrClient-C1msT1E3.js +1 -0
  96. package/dist/chunks/changeDetector-DoOBZOt1.js +1 -0
  97. package/dist/chunks/channelNotification-CWlu9ZWs.js +1 -0
  98. package/dist/chunks/channelNotification-oZ6vG5R5.js +1 -0
  99. package/dist/chunks/chrome-Bo9uNZ7s.js +1 -0
  100. package/dist/chunks/chromeNativeHost-BldB1Zzi.js +1 -0
  101. package/dist/chunks/claudeDesktop-BqTW_pbB.js +1 -0
  102. package/dist/chunks/cleanup-rCLlo4w8.js +1 -0
  103. package/dist/chunks/clear-BxdX_MUP.js +1 -0
  104. package/dist/chunks/cliLaunch-Citfs01Q.js +1 -0
  105. package/dist/chunks/client-BSoJ_vaA.js +1 -0
  106. package/dist/chunks/color-CkzktPHt.js +1 -0
  107. package/dist/chunks/commands-hyVX9-Lh.js +1 -0
  108. package/dist/chunks/commitAttribution-BwT0TbYF.js +1 -0
  109. package/dist/chunks/commitAttribution-csu3NO7Y.js +2 -0
  110. package/dist/chunks/common-Bi4yZBkh.js +1 -0
  111. package/dist/chunks/common-Da57Qwms.js +1 -0
  112. package/dist/chunks/common-NEOWMwtB.js +1 -0
  113. package/dist/chunks/compact-DNGIVZRN.js +3 -0
  114. package/dist/chunks/companion-Diuav3lA.js +1 -0
  115. package/dist/chunks/completionCache-BQgiR45Q.js +1 -0
  116. package/dist/chunks/completionCache-C7hDqIDL.js +4 -0
  117. package/dist/chunks/config-B25IrkTA.js +1 -0
  118. package/dist/chunks/config-ODoYZY8i.js +1 -0
  119. package/dist/chunks/context-CZ5enuPE.js +1 -0
  120. package/dist/chunks/context-noninteractive-62P5EnN5.js +54 -0
  121. package/dist/chunks/context-noninteractive-CjuzL9q5.js +1 -0
  122. package/dist/chunks/conversation-DyhWeHw2.js +1 -0
  123. package/dist/chunks/conversation-uY-V0SNK.js +1 -0
  124. package/dist/chunks/copy-9JLr2-Xs.js +7 -0
  125. package/dist/chunks/createSSHSession-B1hTuDpB.js +6 -0
  126. package/dist/chunks/createSession-Qurw-N4x.js +1 -0
  127. package/dist/chunks/createSession-fzjzy0aS.js +1 -0
  128. package/dist/chunks/cron-DwR6OJuW.js +1 -0
  129. package/dist/chunks/cronJitterConfig-9OmmYmIT.js +6 -0
  130. package/dist/chunks/crossProjectResume-B6efoIur.js +40 -0
  131. package/dist/chunks/daemon-BRKR4D1D.js +2 -0
  132. package/dist/chunks/datadog-C-llbwzP.js +1 -0
  133. package/dist/chunks/datadog-SSxsxcC-.js +1 -0
  134. package/dist/chunks/desktop-CQnMcbex.js +1 -0
  135. package/dist/chunks/detached-C_2ZXr7X.js +5 -0
  136. package/dist/chunks/detectRepository-2ICvGD0U.js +1 -0
  137. package/dist/chunks/detectRepository-BLwSmun2.js +1 -0
  138. package/dist/chunks/detection-0mMj--Bt.js +1 -0
  139. package/dist/chunks/detection-95TCHkW8.js +1 -0
  140. package/dist/chunks/diff-uAwKYa51.js +1 -0
  141. package/dist/chunks/directoryCompletion-DqtWZsoW.js +1 -0
  142. package/dist/chunks/doctor-CBF0fkBF.js +1 -0
  143. package/dist/chunks/earlyInput-CFYRGxau.js +2 -0
  144. package/dist/chunks/earlyInput-D3OhUZ4G.js +1 -0
  145. package/dist/chunks/effort-F-bhAM2u.js +9 -0
  146. package/dist/chunks/entry-DHN_Gr1b.js +14 -0
  147. package/dist/chunks/env-C2A9gV_G.js +1 -0
  148. package/dist/chunks/envLessBridgeConfig-CDVtIEWT.js +1 -0
  149. package/dist/chunks/envLessBridgeConfig-Dg0hNsdi.js +1 -0
  150. package/dist/chunks/execFileNoThrow-azCkYhmF.js +1 -0
  151. package/dist/chunks/executor-BVh1PTF-.js +1561 -0
  152. package/dist/chunks/executor-CvTuHx-k.js +1 -0
  153. package/dist/chunks/exit-CqcvZJwI.js +1 -0
  154. package/dist/chunks/export-c6WoGlsG.js +2 -0
  155. package/dist/chunks/exportRenderer-CaegIP5N.js +1 -0
  156. package/dist/chunks/extra-usage-Cj8fokgc.js +1 -0
  157. package/dist/chunks/extra-usage-Dk-wcvAu.js +1 -0
  158. package/dist/chunks/extra-usage-core-sHzc4eE1.js +1 -0
  159. package/dist/chunks/extra-usage-noninteractive-D0kqrqsg.js +1 -0
  160. package/dist/chunks/extraUsage-CbkqfG1U.js +1 -0
  161. package/dist/chunks/extractMemories-BP8Opsbp.js +1 -0
  162. package/dist/chunks/fast-DS3iQ1CH.js +1 -0
  163. package/dist/chunks/fast-DklfqySb.js +1 -0
  164. package/dist/chunks/featureCheck-CUJ2rPM6.js +1 -0
  165. package/dist/chunks/feedback-QJynmG5q.js +1 -0
  166. package/dist/chunks/fileStateCache-BhVfo23e.js +1 -0
  167. package/dist/chunks/files-Bdr_PQyV.js +2 -0
  168. package/dist/chunks/findExecutable-BHQl4NaS.js +1 -0
  169. package/dist/chunks/firstPartyEventLogger-DlW8BUXq.js +1 -0
  170. package/dist/chunks/flushGate-CK5B9-Zn.js +1 -0
  171. package/dist/chunks/gates-6amRNsYl.js +1 -0
  172. package/dist/chunks/gates-vlrMjO-X.js +1 -0
  173. package/dist/chunks/gemini-B5ZRjDrh.js +1 -0
  174. package/dist/chunks/generateRecap-SgRMdsyN.js +1 -0
  175. package/dist/chunks/generateSessionName-sZFzpwsq.js +1 -0
  176. package/dist/chunks/genericProcessUtils-tJxf3yqB.js +23 -0
  177. package/dist/chunks/git-C0IuvuIy.js +6 -0
  178. package/dist/chunks/git-hSvFiuiG.js +1 -0
  179. package/dist/chunks/githubRepoPathMapping-DUGvTwPB.js +1 -0
  180. package/dist/chunks/goal-Dy-GGn9r.js +3 -0
  181. package/dist/chunks/grok-BG4_buNt.js +1 -0
  182. package/dist/chunks/growthbook-Br1dDRtd.js +1 -0
  183. package/dist/chunks/heapdump-B9PVKMxa.js +5 -0
  184. package/dist/chunks/help-BfWF7xij.js +1 -0
  185. package/dist/chunks/hooks-BVrhxysz.js +1 -0
  186. package/dist/chunks/hooks-KK32pxq3.js +79 -0
  187. package/dist/chunks/hostAdapter-TBJav3vX.js +1 -0
  188. package/dist/chunks/hostGuard-DSOEyH-P.js +1 -0
  189. package/dist/chunks/ide-BU1A79BE.js +2 -0
  190. package/dist/chunks/inboundAttachments-D4tBPCB8.js +1 -0
  191. package/dist/chunks/inboundAttachments-DWJplT9p.js +1 -0
  192. package/dist/chunks/initReplBridge-99sUBVEk.js +1 -0
  193. package/dist/chunks/insights-lDHodCMG.js +822 -0
  194. package/dist/chunks/install-Bg4ZgW81.js +1 -0
  195. package/dist/chunks/install-github-app-RLbUq5EL.js +147 -0
  196. package/dist/chunks/install-slack-app-CHmIwsbm.js +1 -0
  197. package/dist/chunks/instrumentation-BCiV3SKX.js +12 -0
  198. package/dist/chunks/job-xOGf0j5Q.js +2 -0
  199. package/dist/chunks/jwtUtils-BQXXBwqW.js +1 -0
  200. package/dist/chunks/keybindings-DMbReZ4p.js +2 -0
  201. package/dist/chunks/lang-A6LUGP_7.js +1 -0
  202. package/dist/chunks/language-Bzp5KDCE.js +1 -0
  203. package/dist/chunks/language-CGfURU2y.js +1 -0
  204. package/dist/chunks/launchAgentsPlatform-Dbpm7Jyo.js +1 -0
  205. package/dist/chunks/launchAutofixPr-RZfqx5eM.js +18 -0
  206. package/dist/chunks/launchLocalMemory-DIntbsvg.js +3 -0
  207. package/dist/chunks/launchLocalVault-CCUw0ayu.js +3 -0
  208. package/dist/chunks/launchMemoryStores-QJTh8KSP.js +1 -0
  209. package/dist/chunks/launchOnboarding--Pe30AYd.js +8 -0
  210. package/dist/chunks/launchSchedule-DjN1RbRX.js +1 -0
  211. package/dist/chunks/launchSkillStore-CcKmVDz1.js +1 -0
  212. package/dist/chunks/launchTeleport-BKlEo0yF.js +3 -0
  213. package/dist/chunks/launchVault-C7UHA-IG.js +1 -0
  214. package/dist/chunks/loadAgentsDir-ClTeo0nk.js +4697 -0
  215. package/dist/chunks/loadAgentsDir-CshktEpX.js +1 -0
  216. package/dist/chunks/loadPluginHooks-DVZmzYLl.js +1 -0
  217. package/dist/chunks/localSearch-BtLNJRij.js +1 -0
  218. package/dist/chunks/localSearch-Koc8naSr.js +1 -0
  219. package/dist/chunks/log-DSV4Ht5l.js +1 -0
  220. package/dist/chunks/login-BngE89_j.js +1 -0
  221. package/dist/chunks/login-C3MZQTDL.js +1 -0
  222. package/dist/chunks/logoV2Utils-DAIIwt5R.js +1 -0
  223. package/dist/chunks/logout-CXZBaUen.js +1 -0
  224. package/dist/chunks/magicDocs-C_inI3JJ.js +57 -0
  225. package/dist/chunks/main-CfkIGrBF.js +31 -0
  226. package/dist/chunks/main-qqcmncHA.js +1312 -0
  227. package/dist/chunks/mappers-7BSMbYvH.js +1 -0
  228. package/dist/chunks/mcp-DRBiobrN.js +2 -0
  229. package/dist/chunks/mcp-DV8Prhgi.js +1 -0
  230. package/dist/chunks/mcp-HQ8-nEZ1.js +6 -0
  231. package/dist/chunks/mcpServer-CLIYAgGs.js +1 -0
  232. package/dist/chunks/mcpServer-DS0yRfcu.js +1 -0
  233. package/dist/chunks/memoize-DJ1XCN-z.js +1 -0
  234. package/dist/chunks/memory-Cz_JaFLF.js +1 -0
  235. package/dist/chunks/mobile-BMglW1NB.js +2 -0
  236. package/dist/chunks/mode-Kx0kSZkr.js +2 -0
  237. package/dist/chunks/model-Bwvn_acH.js +1 -0
  238. package/dist/chunks/model-CNXtfiLg.js +1 -0
  239. package/dist/chunks/onChangeAppState-C4ic-Mib.js +1 -0
  240. package/dist/chunks/openai-CGGSfpPh.js +10 -0
  241. package/dist/chunks/overageCreditGrant-BqW_6R5v.js +1 -0
  242. package/dist/chunks/panel-BYfvo_mR.js +1 -0
  243. package/dist/chunks/panel-D3wvAEFE.js +1 -0
  244. package/dist/chunks/panelCall-DgPjuhQf.js +1 -0
  245. package/dist/chunks/parser-DGXE1uWd.js +1 -0
  246. package/dist/chunks/passes-sYE91Vtr.js +1 -0
  247. package/dist/chunks/path-BE28AJwZ.js +1 -0
  248. package/dist/chunks/paths-DO4WOQtD.js +36 -0
  249. package/dist/chunks/permissions-BE-1pIly.js +1 -0
  250. package/dist/chunks/permissions-BPerbf1I.js +3 -0
  251. package/dist/chunks/pipeTransport-CW9zF_UN.js +1 -0
  252. package/dist/chunks/plan-CDKBVRw6.js +1 -0
  253. package/dist/chunks/platform-mh9ypxS8.js +2 -0
  254. package/dist/chunks/plugin-C6US4b8W.js +1 -0
  255. package/dist/chunks/pluginAutoupdate-BQKtcAhC.js +1 -0
  256. package/dist/chunks/pluginBlocklist-B8DKXi0i.js +1 -0
  257. package/dist/chunks/pluginCliCommands-DWCeXYTl.js +1 -0
  258. package/dist/chunks/pluginFlagging-DFMlWw2P.js +1 -0
  259. package/dist/chunks/pluginOperations-CKmwDC3G.js +2 -0
  260. package/dist/chunks/pluginStartupCheck-D6IbyWKe.js +1 -0
  261. package/dist/chunks/pluginStartupCheck-cYnLsWOs.js +1 -0
  262. package/dist/chunks/plugins-BwZIRMh_.js +4 -0
  263. package/dist/chunks/policyLimits-CFLBtFh3.js +1 -0
  264. package/dist/chunks/pollConfig-C3NjXYFc.js +1 -0
  265. package/dist/chunks/poller-BA1jhG3F.js +1 -0
  266. package/dist/chunks/poor-BHhbua95.js +1 -0
  267. package/dist/chunks/poorMode-CCK7Ek5w.js +1 -0
  268. package/dist/chunks/poorMode-mtlnXU-z.js +1 -0
  269. package/dist/chunks/print-kxnXkqGc.js +39 -0
  270. package/dist/chunks/privacy-settings-DjY1annR.js +1 -0
  271. package/dist/chunks/processBashCommand-BrqLqSva.js +1 -0
  272. package/dist/chunks/processSlashCommand-DJGdVGbK.js +6 -0
  273. package/dist/chunks/projectContext-Cd7V9pES.js +1 -0
  274. package/dist/chunks/prompt-BZjXpviP.js +1 -0
  275. package/dist/chunks/prompt-CfM_xGPc.js +227 -0
  276. package/dist/chunks/prompt-CusKF4-p.js +1 -0
  277. package/dist/chunks/promptEditor-FI_ewCpV.js +4 -0
  278. package/dist/chunks/protocolHandler-B7ybKpgJ.js +13 -0
  279. package/dist/chunks/rate-limit-options-DPJMNNou.js +1 -0
  280. package/dist/chunks/rcDebugLog-CwU_wJBE.js +11 -0
  281. package/dist/chunks/referral-Da4mpbd3.js +1 -0
  282. package/dist/chunks/refresh-B6X4xb9r.js +1 -0
  283. package/dist/chunks/registerProtocol-D8fFnceq.js +36 -0
  284. package/dist/chunks/registry-y_z3pTg3.js +1 -0
  285. package/dist/chunks/release-notes--tnd4K56.js +4 -0
  286. package/dist/chunks/releaseNotes-BPA229-J.js +2 -0
  287. package/dist/chunks/reload-plugins-yQ7tEUVh.js +1 -0
  288. package/dist/chunks/remote-env-CER5UxTX.js +1 -0
  289. package/dist/chunks/remoteBridgeCore-Bi31i8gt.js +1 -0
  290. package/dist/chunks/remoteControlServer-oUAcWB4i.js +3 -0
  291. package/dist/chunks/rename-BTngRRZU.js +1 -0
  292. package/dist/chunks/renderOptions-Caca3bCd.js +1 -0
  293. package/dist/chunks/resume-DZHKfBmm.js +2 -0
  294. package/dist/chunks/ripgrep-Bzwdi5-K.js +5 -0
  295. package/dist/chunks/ripgrep-DEa1djpJ.js +1 -0
  296. package/dist/chunks/runtimeObserver-B4KekIF0.js +1 -0
  297. package/dist/chunks/runtimeObserver-BUOcYxiK.js +10 -0
  298. package/dist/chunks/sandbox-adapter-C--j-c76.js +1 -0
  299. package/dist/chunks/sandbox-toggle-DLBL7myN.js +1 -0
  300. package/dist/chunks/searchExtraTools-CBYp5XeI.js +1 -0
  301. package/dist/chunks/sentry-B7ZBc8fA.js +13 -0
  302. package/dist/chunks/session-DWYQk9YN.js +2 -0
  303. package/dist/chunks/sessionDiscovery-BP0nv36F.js +1 -0
  304. package/dist/chunks/sessionFileAccessHooks-DVilA3Mm.js +1 -0
  305. package/dist/chunks/sessionMemory-cMgcTxtP.js +1 -0
  306. package/dist/chunks/sessionMemory-pT4lc1C-.js +1 -0
  307. package/dist/chunks/sessionMemoryUtils-BgYf2OvX.js +1 -0
  308. package/dist/chunks/sessionObserver-CzyEF7mg.js +1 -0
  309. package/dist/chunks/sessionObserver-D4SV0Ar3.js +20 -0
  310. package/dist/chunks/sessionStorage-CXBgVAx-.js +1 -0
  311. package/dist/chunks/sessionStoragePortable-CJUZrbIq.js +3 -0
  312. package/dist/chunks/sessionTitle-CkrnWEW1.js +14 -0
  313. package/dist/chunks/sessionTracing-Caw-kvQr.js +11 -0
  314. package/dist/chunks/settingsSync-Dn_lGonC.js +1 -0
  315. package/dist/chunks/setup-DGkOT4DX.js +2 -0
  316. package/dist/chunks/setup-Dihjl7jo.js +9 -0
  317. package/dist/chunks/setup-II1titXI.js +1 -0
  318. package/dist/chunks/shadowedRuleDetection-DASW3j9H.js +1 -0
  319. package/dist/chunks/shellQuote-CBjhlaFO.js +1 -0
  320. package/dist/chunks/sideQuestion-C1qbLTAL.js +20 -0
  321. package/dist/chunks/sink-BSPyC453.js +1 -0
  322. package/dist/chunks/sink-CqOAfFlL.js +1 -0
  323. package/dist/chunks/sinks-BT_lBY6T.js +2 -0
  324. package/dist/chunks/sinks-CpuRIC3H.js +1 -0
  325. package/dist/chunks/skill-learning-kh0HKn6u.js +5 -0
  326. package/dist/chunks/skillChangeDetector-DQuNepIV.js +1 -0
  327. package/dist/chunks/skillGapStore-B1gUQXhE.js +5 -0
  328. package/dist/chunks/skillGapStore-CFmLJlYm.js +1 -0
  329. package/dist/chunks/skillGenerator-DIAwRpPg.js +8 -0
  330. package/dist/chunks/skillLearning-Bxu1Uzl-.js +1 -0
  331. package/dist/chunks/skillLearning-CxAbHYEk.js +1 -0
  332. package/dist/chunks/skillPanel-B9zJLHKV.js +28 -0
  333. package/dist/chunks/skillSearchPanel-C1O9sxYS.js +21 -0
  334. package/dist/chunks/skills-C6_3snFY.js +1 -0
  335. package/dist/chunks/sprites-59l7vF4l.js +1 -0
  336. package/dist/chunks/src-BGzuPZ5q.js +26 -0
  337. package/dist/chunks/src-kgpr3s-l.js +1 -0
  338. package/dist/chunks/startupProfiler-CAntGAbs.js +3 -0
  339. package/dist/chunks/startupProfiler-WtUzkMKV.js +1 -0
  340. package/dist/chunks/stats-BmGdg4nj.js +1 -0
  341. package/dist/chunks/status-KLPT7uYP.js +1 -0
  342. package/dist/chunks/statusNoticeHelpers-DuqyBY-N.js +1 -0
  343. package/dist/chunks/stdio-Cg20AQ5W.js +1 -0
  344. package/dist/chunks/stickers-DDAm--86.js +1 -0
  345. package/dist/chunks/stringUtils-KZoO4GUd.js +4 -0
  346. package/dist/chunks/subprocessEnv-D4Cbyl2J.js +1 -0
  347. package/dist/chunks/systemPromptSections-CVpefuSD.js +1 -0
  348. package/dist/chunks/tag-0vahEnrx.js +11 -0
  349. package/dist/chunks/tasks-zVPemGv7.js +1 -0
  350. package/dist/chunks/teamHelpers-B83RwCCC.js +1 -0
  351. package/dist/chunks/teamHelpers-CXAmvFco.js +1 -0
  352. package/dist/chunks/teammateModeSnapshot-AdUFmPGC.js +1 -0
  353. package/dist/chunks/teammateModeSnapshot-CdiglTzv.js +1 -0
  354. package/dist/chunks/teleport-D6PvdjPy.js +1 -0
  355. package/dist/chunks/templateJobs-Ox5ZTKjW.js +12 -0
  356. package/dist/chunks/terminalSetup-Dh70ynBX.js +1 -0
  357. package/dist/chunks/terminalSetup-hLCi-2uB.js +33 -0
  358. package/dist/chunks/theme-DxgUVq9C.js +1 -0
  359. package/dist/chunks/thinkback-C5vFU8dM.js +1 -0
  360. package/dist/chunks/thinkback-DWgU7Qhr.js +1 -0
  361. package/dist/chunks/thinkback-play-CDzY6Ux4.js +1 -0
  362. package/dist/chunks/tmux-DelKEjda.js +1 -0
  363. package/dist/chunks/toolEventObserver-DPoMAJwr.js +1 -0
  364. package/dist/chunks/toolEventObserver-jO6-mlFU.js +1 -0
  365. package/dist/chunks/toolPool-BmA-BnAq.js +1 -0
  366. package/dist/chunks/toolPool-Dgn1Clq8.js +1 -0
  367. package/dist/chunks/trustedDevice-CYR5AgSB.js +1 -0
  368. package/dist/chunks/trustedDevice-D35gYkBT.js +1 -0
  369. package/dist/chunks/tui-DoOiz2RW.js +6 -0
  370. package/dist/chunks/types-BCy5hsQR.js +1 -0
  371. package/dist/chunks/types-KeqFPzY5.js +17 -0
  372. package/dist/chunks/udsClient-CBF_cZFW.js +1 -0
  373. package/dist/chunks/ultrareviewCommand-o4GjzoXK.js +3 -0
  374. package/dist/chunks/undercover-B4xr62Ux.js +31 -0
  375. package/dist/chunks/undercover-nakrQDLh.js +1 -0
  376. package/dist/chunks/up-DaiW-V1N.js +12 -0
  377. package/dist/chunks/updateCCB-Cthn50OV.js +11 -0
  378. package/dist/chunks/upgrade-D4Id4ebd.js +1 -0
  379. package/dist/chunks/upgrade-DJTCV8sr.js +1 -0
  380. package/dist/chunks/upload-BFDXvdfb.js +1 -0
  381. package/dist/chunks/upstreamproxy-CLf1UaJv.js +11 -0
  382. package/dist/chunks/usage-Csbso5mD.js +1 -0
  383. package/dist/chunks/usage-DxudeFLL.js +1 -0
  384. package/dist/chunks/useExitOnCtrlCDWithKeybindings-BHi41Ku_.js +1 -0
  385. package/dist/chunks/useMainLoopModel-CEqP4HOc.js +1 -0
  386. package/dist/chunks/useManagePlugins-BmS3Adja.js +1 -0
  387. package/dist/chunks/useMergedTools-wR6Bglqq.js +1 -0
  388. package/dist/chunks/useSearchInput-BhKAGgEN.js +1 -0
  389. package/dist/chunks/useSettingsErrors-CjK3P-Ki.js +1 -0
  390. package/dist/chunks/useTerminalSize-Du-EamDN.js +1 -0
  391. package/dist/chunks/useVoice-DP1hHBWA.js +1 -0
  392. package/dist/chunks/util-CMSErQoz.js +1 -0
  393. package/dist/chunks/utils-CAQfwbv8.js +1 -0
  394. package/dist/chunks/validatePlugin-_g0AqWZG.js +1 -0
  395. package/dist/chunks/vim-8y-2Q09k.js +1 -0
  396. package/dist/chunks/voice-BJAsr0K-.js +2 -0
  397. package/dist/chunks/voice-YtzCcIoM.js +8 -0
  398. package/dist/chunks/voiceModeEnabled-BD9GZhQ3.js +1 -0
  399. package/dist/chunks/voiceModeEnabled-DZbxaFIg.js +1 -0
  400. package/dist/chunks/voiceStreamSTT-B1T-8adN.js +1 -0
  401. package/dist/chunks/voiceStreamSTT-B39XaGOU.js +1 -0
  402. package/dist/chunks/web-tools-DVIvcP41.js +1 -0
  403. package/dist/chunks/windowsPaths-BeDSnJ23.js +2 -0
  404. package/dist/chunks/windowsPaths-ttHiMKpR.js +1 -0
  405. package/dist/chunks/workerRegistry-60_UCyc3.js +1 -0
  406. package/dist/chunks/worktree-DNK8NprA.js +1 -0
  407. package/dist/chunks/worktreeModeEnabled-RtizNgNg.js +1 -0
  408. package/dist/chunks/xml-CTdKuU6f.js +1 -0
  409. package/dist/cli.js +1 -1
  410. package/package.json +1 -1
  411. package/dist/chunks/AddWorkspaceDirectory-BqR8LhJq.js +0 -1
  412. package/dist/chunks/App-DkBMWXkK.js +0 -1
  413. package/dist/chunks/ApproveApiKey-5xd0lUV7.js +0 -1
  414. package/dist/chunks/ApproveApiKey-Dmr2VaVA.js +0 -1
  415. package/dist/chunks/AssistantSessionChooser-C7rigDkQ.js +0 -1
  416. package/dist/chunks/BackgroundTasksDialog-RtEwbumC.js +0 -2
  417. package/dist/chunks/BypassPermissionsModeDialog-7s3ULbNF.js +0 -1
  418. package/dist/chunks/ClaudeInChromeOnboarding-Bjv-sERa.js +0 -1
  419. package/dist/chunks/ClaudeMdExternalIncludesDialog-BTysDIlI.js +0 -1
  420. package/dist/chunks/ClaudeMdExternalIncludesDialog-DosNL91g.js +0 -1
  421. package/dist/chunks/ConsoleOAuthFlow-Cc1yaM-M.js +0 -1
  422. package/dist/chunks/DesktopHandoff-Cy89ZB_9.js +0 -1
  423. package/dist/chunks/DevChannelsDialog-ws8prcNK.js +0 -1
  424. package/dist/chunks/DiffDialog-BhqgxA7o.js +0 -3
  425. package/dist/chunks/Doctor-BWouB_9X.js +0 -1
  426. package/dist/chunks/Doctor-Ts5k8hn1.js +0 -3
  427. package/dist/chunks/ExitFlow-BBoImtT_.js +0 -2
  428. package/dist/chunks/Feedback-BVbSMBwY.js +0 -2
  429. package/dist/chunks/Grove-CTQrX7WO.js +0 -1
  430. package/dist/chunks/Grove-ZMHK4CBZ.js +0 -11
  431. package/dist/chunks/HybridTransport-B9g074Y1.js +0 -4
  432. package/dist/chunks/ITermBackend-DaFK8DOH.js +0 -1
  433. package/dist/chunks/InvalidConfigDialog-BkZkVKB4.js +0 -1
  434. package/dist/chunks/InvalidSettingsDialog-Lr60eQWj.js +0 -1
  435. package/dist/chunks/MCPConnectionManager-DmJ6dLOp.js +0 -1
  436. package/dist/chunks/McpParsingWarnings-CE2pQPXV.js +0 -1
  437. package/dist/chunks/MessageSelector-BT1FDbwv.js +0 -3
  438. package/dist/chunks/Messages-DT2gDtrJ.js +0 -11
  439. package/dist/chunks/Onboarding-DsqnXQel.js +0 -1
  440. package/dist/chunks/OverageCreditUpsell-UWtCrOmN.js +0 -1
  441. package/dist/chunks/PluginSettings-OJQz3d5V.js +0 -17
  442. package/dist/chunks/PromptInputFooterSuggestions-BImBB6Yk.js +0 -1
  443. package/dist/chunks/PromptInputHelpMenu-CblAb9vk.js +0 -1
  444. package/dist/chunks/QueryEngine-_re1pGHr.js +0 -1
  445. package/dist/chunks/REPL-eBTeslsR.js +0 -147
  446. package/dist/chunks/REPL-wIg0cBqS.js +0 -1
  447. package/dist/chunks/RemoteCallout-DMQai8_P.js +0 -1
  448. package/dist/chunks/RemoteSessionManager-DQmsHvj_.js +0 -2
  449. package/dist/chunks/ResumeConversation-D81hDeTl.js +0 -1
  450. package/dist/chunks/SSETransport-BbeM6bi9.js +0 -4
  451. package/dist/chunks/SearchExtraToolsTool-QbJQCWXd.js +0 -1
  452. package/dist/chunks/SentryErrorBoundary-BQJXHbWh.js +0 -2
  453. package/dist/chunks/SentryErrorBoundary-Cnw74oVG.js +0 -1
  454. package/dist/chunks/Settings-DiXc-_IG.js +0 -2
  455. package/dist/chunks/TeleportProgress-B3oRJlWH.js +0 -1
  456. package/dist/chunks/TeleportRepoMismatchDialog-GPuEipFy.js +0 -1
  457. package/dist/chunks/TeleportResumeWrapper-CcDuR6o9.js +0 -1
  458. package/dist/chunks/ThemePicker-BjSRjA_L.js +0 -1
  459. package/dist/chunks/TmuxBackend-BE3zsPKE.js +0 -9
  460. package/dist/chunks/TrustDialog-B6Qg0xUr.js +0 -1
  461. package/dist/chunks/TungstenTool-C5IqKVr0.js +0 -1
  462. package/dist/chunks/ValidationErrorsList-C5BoLiye.js +0 -2
  463. package/dist/chunks/WelcomeV2-BJAKZYz1.js +0 -1
  464. package/dist/chunks/WindowsTerminalBackend-BcwpxU2Q.js +0 -2
  465. package/dist/chunks/add-dir-OR7-VVcq.js +0 -1
  466. package/dist/chunks/agentDisplay-CMqTUh0A.js +0 -1
  467. package/dist/chunks/agents-DRtgUZ6t.js +0 -103
  468. package/dist/chunks/agents-EolUGDZB.js +0 -2
  469. package/dist/chunks/ant-Bgl31h7a.js +0 -1
  470. package/dist/chunks/api-BpQPVgif.js +0 -1
  471. package/dist/chunks/api-xFvB7WoB.js +0 -1
  472. package/dist/chunks/asciicast-CJObpRg9.js +0 -1
  473. package/dist/chunks/asciicast-Dr_Div_R.js +0 -4
  474. package/dist/chunks/assistant-CENsWvTb.js +0 -1
  475. package/dist/chunks/assistant-CHawoD04.js +0 -1
  476. package/dist/chunks/assistant-s7XNIA76.js +0 -1
  477. package/dist/chunks/auth-DX12yVM8.js +0 -1
  478. package/dist/chunks/auth-h6VL9BbC.js +0 -1
  479. package/dist/chunks/autoMode-BDzVqEPm.js +0 -45
  480. package/dist/chunks/autonomy-CeqOXzJl.js +0 -19
  481. package/dist/chunks/autonomy-D2YudQnH.js +0 -1
  482. package/dist/chunks/autonomyPanel-B0OQV4lv.js +0 -1
  483. package/dist/chunks/backgroundHousekeeping-CvHD981l.js +0 -17
  484. package/dist/chunks/backgroundHousekeeping-DMkk-QoZ.js +0 -1
  485. package/dist/chunks/banner-DNLUJFS_.js +0 -2
  486. package/dist/chunks/bg-D_H-uZDS.js +0 -9
  487. package/dist/chunks/bg-FtpmvQuT.js +0 -1
  488. package/dist/chunks/branch-D44HjlJp.js +0 -3
  489. package/dist/chunks/break-cache-ByJ7U2Ts.js +0 -8
  490. package/dist/chunks/bridge-4sldfa8u.js +0 -2
  491. package/dist/chunks/bridgeConfig-BM7iHryd.js +0 -1
  492. package/dist/chunks/bridgeConfig-CcCNsSBX.js +0 -1
  493. package/dist/chunks/bridgeEnabled-CYddgTU1.js +0 -1
  494. package/dist/chunks/bridgeEnabled-DoT2l1Oj.js +0 -1
  495. package/dist/chunks/bridgeMain-DaO51duk.js +0 -68
  496. package/dist/chunks/bridgeMain-Dc4-ZK69.js +0 -1
  497. package/dist/chunks/bridgeMessaging-IlSWKGmC.js +0 -1
  498. package/dist/chunks/bridgePointer-fFD_tbSk.js +0 -1
  499. package/dist/chunks/browser-DwnUS505.js +0 -1
  500. package/dist/chunks/btw-CrdUyRUP.js +0 -1
  501. package/dist/chunks/buddy-Ci0hdCf9.js +0 -3
  502. package/dist/chunks/bypassPermissionsKillswitch-BWOlc_sK.js +0 -1
  503. package/dist/chunks/caches-BHRJHGlc.js +0 -1
  504. package/dist/chunks/caches-CitduRKp.js +0 -3
  505. package/dist/chunks/ccrClient-yNKhQYnf.js +0 -1
  506. package/dist/chunks/changeDetector-B1tCH9Pa.js +0 -1
  507. package/dist/chunks/channelNotification-D8NPg8I8.js +0 -1
  508. package/dist/chunks/channelNotification-oE3eipDZ.js +0 -1
  509. package/dist/chunks/chrome-CwAwCY0V.js +0 -1
  510. package/dist/chunks/chromeNativeHost-63xqELw-.js +0 -1
  511. package/dist/chunks/claudeDesktop-CX1AsJie.js +0 -1
  512. package/dist/chunks/cleanup-C0gyKaOb.js +0 -1
  513. package/dist/chunks/clear-B5D08sZ0.js +0 -1
  514. package/dist/chunks/cliLaunch-8aeIk2ts.js +0 -1
  515. package/dist/chunks/client-un1k_6md.js +0 -1
  516. package/dist/chunks/color-BtVvrSvq.js +0 -1
  517. package/dist/chunks/commands--qEK1j9j.js +0 -1
  518. package/dist/chunks/commitAttribution-AEb-sE-t.js +0 -1
  519. package/dist/chunks/commitAttribution-HP_CWP0X.js +0 -2
  520. package/dist/chunks/common-BBRP_KzA.js +0 -1
  521. package/dist/chunks/common-BD4Q7osK.js +0 -1
  522. package/dist/chunks/common-C56I-_O3.js +0 -1
  523. package/dist/chunks/compact-BNhxD2UA.js +0 -3
  524. package/dist/chunks/companion-BlhNrZiL.js +0 -1
  525. package/dist/chunks/completionCache-BHSsdkBs.js +0 -1
  526. package/dist/chunks/completionCache-Daqaxlf3.js +0 -4
  527. package/dist/chunks/config-9z8716kz.js +0 -1
  528. package/dist/chunks/config-f8Cx16Z6.js +0 -1
  529. package/dist/chunks/context-BdOjhAmM.js +0 -1
  530. package/dist/chunks/context-noninteractive-CnaDbgvf.js +0 -54
  531. package/dist/chunks/context-noninteractive-DRM7gbFk.js +0 -1
  532. package/dist/chunks/conversation-B9pq-m4L.js +0 -1
  533. package/dist/chunks/conversation-DUxXVrGj.js +0 -1
  534. package/dist/chunks/copy-Cjl0-hg1.js +0 -7
  535. package/dist/chunks/createSSHSession-CYaHalxc.js +0 -6
  536. package/dist/chunks/createSession-DoR2K7ay.js +0 -1
  537. package/dist/chunks/createSession-VlSLvi7J.js +0 -1
  538. package/dist/chunks/cron-DiW7eIPP.js +0 -1
  539. package/dist/chunks/cronJitterConfig-DjSd7nvj.js +0 -6
  540. package/dist/chunks/crossProjectResume-CDWr5DFl.js +0 -40
  541. package/dist/chunks/daemon-FAp0WyY6.js +0 -2
  542. package/dist/chunks/datadog-CahWdK03.js +0 -1
  543. package/dist/chunks/datadog-DPkKCR8M.js +0 -1
  544. package/dist/chunks/desktop-y3mzgaWo.js +0 -1
  545. package/dist/chunks/detached-Brq3-vHi.js +0 -5
  546. package/dist/chunks/detectRepository-CSN3yxkq.js +0 -1
  547. package/dist/chunks/detectRepository-CbR0WgtE.js +0 -1
  548. package/dist/chunks/detection-BPPZCanO.js +0 -1
  549. package/dist/chunks/detection-DrdKrqbQ.js +0 -1
  550. package/dist/chunks/diff-hpp0dp6U.js +0 -1
  551. package/dist/chunks/directoryCompletion-DAc3u1K2.js +0 -1
  552. package/dist/chunks/doctor-B230p0R_.js +0 -1
  553. package/dist/chunks/earlyInput-BFcdUMaX.js +0 -2
  554. package/dist/chunks/earlyInput-vv9abU2L.js +0 -1
  555. package/dist/chunks/effort-D7i2v6vd.js +0 -9
  556. package/dist/chunks/entry-Du3gtq9o.js +0 -14
  557. package/dist/chunks/env-BH-OBzcA.js +0 -1
  558. package/dist/chunks/envLessBridgeConfig-CKD4eOEe.js +0 -1
  559. package/dist/chunks/envLessBridgeConfig-DI0ouryy.js +0 -1
  560. package/dist/chunks/execFileNoThrow-B_aZH_GP.js +0 -1
  561. package/dist/chunks/executor-BJb5d6mo.js +0 -1
  562. package/dist/chunks/executor-Dmn3RTuI.js +0 -1561
  563. package/dist/chunks/exit-fntBGxEC.js +0 -1
  564. package/dist/chunks/export-Dy9M7FnZ.js +0 -2
  565. package/dist/chunks/exportRenderer-Ckv4v0ye.js +0 -1
  566. package/dist/chunks/extra-usage-DLEvlKzs.js +0 -1
  567. package/dist/chunks/extra-usage-core-3KkeQSve.js +0 -1
  568. package/dist/chunks/extra-usage-noninteractive-DUezD54f.js +0 -1
  569. package/dist/chunks/extra-usage-pU11YXHS.js +0 -1
  570. package/dist/chunks/extraUsage-B-l-oe-7.js +0 -1
  571. package/dist/chunks/extractMemories-CXarlmZp.js +0 -1
  572. package/dist/chunks/fast-BzfzSH7K.js +0 -1
  573. package/dist/chunks/fast-CbLu_WYL.js +0 -1
  574. package/dist/chunks/featureCheck-p7OeCYzj.js +0 -1
  575. package/dist/chunks/feedback-DiyZIbov.js +0 -1
  576. package/dist/chunks/fileStateCache-C7-TxF8G.js +0 -1
  577. package/dist/chunks/files-DYvAZGxp.js +0 -2
  578. package/dist/chunks/firstPartyEventLogger-Dig8Mv7_.js +0 -1
  579. package/dist/chunks/flushGate-Ci3NHOV4.js +0 -1
  580. package/dist/chunks/gates-CtkQH6jy.js +0 -1
  581. package/dist/chunks/gates-xscCu8-N.js +0 -1
  582. package/dist/chunks/gemini-BCuY2aYj.js +0 -1
  583. package/dist/chunks/generateRecap-DA0SNyFR.js +0 -1
  584. package/dist/chunks/generateSessionName-BtQ4NGXP.js +0 -1
  585. package/dist/chunks/genericProcessUtils-D-78JZxz.js +0 -23
  586. package/dist/chunks/git-BZEgupMC.js +0 -1
  587. package/dist/chunks/git-DayFjsvj.js +0 -6
  588. package/dist/chunks/githubRepoPathMapping-C5RkiJWj.js +0 -1
  589. package/dist/chunks/goal-B6GHfd9J.js +0 -3
  590. package/dist/chunks/grok-DDM6xYuy.js +0 -1
  591. package/dist/chunks/growthbook-D-Po5Uxl.js +0 -1
  592. package/dist/chunks/heapdump-DHlUfpVV.js +0 -5
  593. package/dist/chunks/help-BulgC9m7.js +0 -1
  594. package/dist/chunks/hooks-D5AcFnD1.js +0 -1
  595. package/dist/chunks/hooks-jxIrev-X.js +0 -79
  596. package/dist/chunks/hostAdapter-BvraKy0o.js +0 -1
  597. package/dist/chunks/hostGuard-CWijeIyE.js +0 -1
  598. package/dist/chunks/ide-tx4qMFln.js +0 -2
  599. package/dist/chunks/inboundAttachments-C93Q7Dvt.js +0 -1
  600. package/dist/chunks/inboundAttachments-DxcFiX4f.js +0 -1
  601. package/dist/chunks/initReplBridge-BEldrf6f.js +0 -1
  602. package/dist/chunks/insights-HEsEDeCQ.js +0 -822
  603. package/dist/chunks/install-DRsM0bJO.js +0 -1
  604. package/dist/chunks/install-github-app-BVK5Z95c.js +0 -147
  605. package/dist/chunks/install-slack-app-DCw3O2J_.js +0 -1
  606. package/dist/chunks/instrumentation-DJ-R1s8C.js +0 -12
  607. package/dist/chunks/job-CUz_OGIq.js +0 -2
  608. package/dist/chunks/jwtUtils-DVyv2jab.js +0 -1
  609. package/dist/chunks/keybindings-Chr5nGBu.js +0 -2
  610. package/dist/chunks/lang-C7kJlPIh.js +0 -1
  611. package/dist/chunks/language-CQXwoDkI.js +0 -1
  612. package/dist/chunks/language-Lx3WlBN6.js +0 -1
  613. package/dist/chunks/launchAgentsPlatform-Fsslu42L.js +0 -1
  614. package/dist/chunks/launchAutofixPr-Cww8uS_5.js +0 -18
  615. package/dist/chunks/launchLocalMemory-BywmyvSJ.js +0 -3
  616. package/dist/chunks/launchLocalVault-BU3a5NV7.js +0 -3
  617. package/dist/chunks/launchMemoryStores-QUCODCJS.js +0 -1
  618. package/dist/chunks/launchOnboarding-BriZ0oIA.js +0 -8
  619. package/dist/chunks/launchSchedule-uLm7zt_B.js +0 -1
  620. package/dist/chunks/launchSkillStore-DMo2bV8X.js +0 -1
  621. package/dist/chunks/launchTeleport-DgQWSfXM.js +0 -3
  622. package/dist/chunks/launchVault-DfnBBFne.js +0 -1
  623. package/dist/chunks/loadAgentsDir-Br5fGLLI.js +0 -4697
  624. package/dist/chunks/loadAgentsDir-DDYPdQKP.js +0 -1
  625. package/dist/chunks/loadPluginHooks-C4soqr6g.js +0 -1
  626. package/dist/chunks/localSearch-CELyiWF6.js +0 -1
  627. package/dist/chunks/localSearch-DhZMcy5t.js +0 -1
  628. package/dist/chunks/log-DS97_rIr.js +0 -1
  629. package/dist/chunks/login-CvvIpkpq.js +0 -1
  630. package/dist/chunks/login-DjgITOAw.js +0 -1
  631. package/dist/chunks/logoV2Utils-BN_HrHSc.js +0 -1
  632. package/dist/chunks/logout-DOFJpZEJ.js +0 -1
  633. package/dist/chunks/magicDocs-2Zr7bYY_.js +0 -57
  634. package/dist/chunks/main-BafHJuKH.js +0 -31
  635. package/dist/chunks/main-D61CvHRy.js +0 -1312
  636. package/dist/chunks/mappers-BCiceNt3.js +0 -1
  637. package/dist/chunks/mcp-BV4m1Gbl.js +0 -2
  638. package/dist/chunks/mcp-CrAgAK9u.js +0 -1
  639. package/dist/chunks/mcp-DK4m73gO.js +0 -6
  640. package/dist/chunks/mcpServer-7zyXl9Wg.js +0 -1
  641. package/dist/chunks/mcpServer-sa9Z183j.js +0 -1
  642. package/dist/chunks/memoize-CPexXTP7.js +0 -1
  643. package/dist/chunks/memory-BrJPVgxn.js +0 -1
  644. package/dist/chunks/mobile-Cydobb55.js +0 -2
  645. package/dist/chunks/mode-Cr-NTlRa.js +0 -2
  646. package/dist/chunks/model-CCjuMV6k.js +0 -1
  647. package/dist/chunks/model-aJS_plgM.js +0 -1
  648. package/dist/chunks/onChangeAppState-C9EvI3EH.js +0 -1
  649. package/dist/chunks/openai-Cvb_-1A-.js +0 -10
  650. package/dist/chunks/overageCreditGrant-cGQilawd.js +0 -1
  651. package/dist/chunks/panel-ByW1omJn.js +0 -1
  652. package/dist/chunks/panel-DO_faHV-.js +0 -1
  653. package/dist/chunks/panelCall-DqZuxAf0.js +0 -1
  654. package/dist/chunks/parser-DbKSpFRq.js +0 -1
  655. package/dist/chunks/passes-DsrceO14.js +0 -1
  656. package/dist/chunks/path-nCzt96pE.js +0 -1
  657. package/dist/chunks/paths-DfGsIjPm.js +0 -39
  658. package/dist/chunks/permissions-CjPIu4IE.js +0 -3
  659. package/dist/chunks/permissions-Ps_D01ZB.js +0 -1
  660. package/dist/chunks/pipeTransport-C5u1K0wu.js +0 -1
  661. package/dist/chunks/plan-YjMAcn6g.js +0 -1
  662. package/dist/chunks/platform-DYZVoA9J.js +0 -2
  663. package/dist/chunks/plugin-Oux5bBQj.js +0 -1
  664. package/dist/chunks/pluginAutoupdate-Dl9U-fbk.js +0 -1
  665. package/dist/chunks/pluginBlocklist-BzI5DNeN.js +0 -1
  666. package/dist/chunks/pluginCliCommands-CExAcsaR.js +0 -1
  667. package/dist/chunks/pluginFlagging-BeqrbhgG.js +0 -1
  668. package/dist/chunks/pluginOperations-s0FQGOBm.js +0 -2
  669. package/dist/chunks/pluginStartupCheck-BVag9B-T.js +0 -1
  670. package/dist/chunks/pluginStartupCheck-BuorUEEf.js +0 -1
  671. package/dist/chunks/plugins-DTQHVJtY.js +0 -4
  672. package/dist/chunks/policyLimits-zoyF_6O4.js +0 -1
  673. package/dist/chunks/pollConfig-C19GiX7i.js +0 -1
  674. package/dist/chunks/poller-DADqVTWi.js +0 -1
  675. package/dist/chunks/poor-Bx5vvamq.js +0 -1
  676. package/dist/chunks/poorMode-BCoeB5zB.js +0 -1
  677. package/dist/chunks/poorMode-CTd_csCl.js +0 -1
  678. package/dist/chunks/print-UXl3rG8y.js +0 -39
  679. package/dist/chunks/privacy-settings-e43D9a4o.js +0 -1
  680. package/dist/chunks/processBashCommand-CvR9-gf8.js +0 -1
  681. package/dist/chunks/processSlashCommand-CB3wyAX7.js +0 -6
  682. package/dist/chunks/projectContext-D3_u80TY.js +0 -1
  683. package/dist/chunks/prompt-53lRY98R.js +0 -1
  684. package/dist/chunks/prompt-B8M-HLIS.js +0 -227
  685. package/dist/chunks/prompt-CooZNM1u.js +0 -1
  686. package/dist/chunks/promptEditor-CHiopfD7.js +0 -4
  687. package/dist/chunks/protocolHandler-DjivYn8H.js +0 -13
  688. package/dist/chunks/rate-limit-options-B-vndk5W.js +0 -1
  689. package/dist/chunks/rcDebugLog-BoroyfjB.js +0 -11
  690. package/dist/chunks/referral-DOqhciQu.js +0 -1
  691. package/dist/chunks/refresh-C8uLznwm.js +0 -1
  692. package/dist/chunks/registerProtocol-4lQ7O4Cc.js +0 -36
  693. package/dist/chunks/registry-q6v98JYd.js +0 -1
  694. package/dist/chunks/release-notes-C7JHshX3.js +0 -4
  695. package/dist/chunks/releaseNotes-CXY-xAja.js +0 -2
  696. package/dist/chunks/reload-plugins-DLS5lQcc.js +0 -1
  697. package/dist/chunks/remote-env-DhHea8yK.js +0 -1
  698. package/dist/chunks/remoteBridgeCore-BhOLhQIA.js +0 -1
  699. package/dist/chunks/remoteControlServer-CI0F83pg.js +0 -3
  700. package/dist/chunks/rename-DiKWWCzB.js +0 -1
  701. package/dist/chunks/renderOptions-DKe32LfM.js +0 -1
  702. package/dist/chunks/resume-DA4ToJFW.js +0 -2
  703. package/dist/chunks/runtimeObserver-BfVC8KK9.js +0 -1
  704. package/dist/chunks/runtimeObserver-DetZ5Tek.js +0 -10
  705. package/dist/chunks/sandbox-adapter-wh4cKN45.js +0 -1
  706. package/dist/chunks/sandbox-toggle-D8MgV0DT.js +0 -1
  707. package/dist/chunks/searchExtraTools-DbPpcAPw.js +0 -1
  708. package/dist/chunks/sentry-C3sL9nhF.js +0 -13
  709. package/dist/chunks/session-Bd-4QCqc.js +0 -2
  710. package/dist/chunks/sessionDiscovery-D_KPF86E.js +0 -1
  711. package/dist/chunks/sessionFileAccessHooks-COne5L2E.js +0 -1
  712. package/dist/chunks/sessionMemory-0Jqo1_MV.js +0 -1
  713. package/dist/chunks/sessionMemory-BDt_8bNB.js +0 -1
  714. package/dist/chunks/sessionMemoryUtils-BFIJ1nqF.js +0 -1
  715. package/dist/chunks/sessionObserver-CEky1SLb.js +0 -1
  716. package/dist/chunks/sessionObserver-CQxIKV8D.js +0 -20
  717. package/dist/chunks/sessionStorage-D1XhqZyW.js +0 -1
  718. package/dist/chunks/sessionStoragePortable-DJZ_6cL8.js +0 -3
  719. package/dist/chunks/sessionTitle-CB0ZEkS_.js +0 -14
  720. package/dist/chunks/sessionTracing-BIKXLTJZ.js +0 -11
  721. package/dist/chunks/settingsSync-pI3L3CeR.js +0 -1
  722. package/dist/chunks/setup-BSi50fkU.js +0 -1
  723. package/dist/chunks/setup-DjsmjRKQ.js +0 -2
  724. package/dist/chunks/setup-Dq0_SRA1.js +0 -9
  725. package/dist/chunks/shadowedRuleDetection-DvAjOOPL.js +0 -1
  726. package/dist/chunks/shellQuote-D8XPeqkc.js +0 -1
  727. package/dist/chunks/sideQuestion-BrTA8ooG.js +0 -20
  728. package/dist/chunks/sink-CqWxcRl9.js +0 -1
  729. package/dist/chunks/sink-Dkat5kH9.js +0 -1
  730. package/dist/chunks/sinks--frMI4-5.js +0 -2
  731. package/dist/chunks/sinks-CvPAVcMY.js +0 -1
  732. package/dist/chunks/skill-learning-2LV0yuwF.js +0 -5
  733. package/dist/chunks/skillChangeDetector-B5CGPl7e.js +0 -1
  734. package/dist/chunks/skillGapStore-Dc29T-OG.js +0 -1
  735. package/dist/chunks/skillGapStore-KzRf6Ezr.js +0 -5
  736. package/dist/chunks/skillGenerator-BdOHsgc4.js +0 -8
  737. package/dist/chunks/skillLearning-CdcVIG14.js +0 -1
  738. package/dist/chunks/skillLearning-DXWMxSA2.js +0 -1
  739. package/dist/chunks/skillPanel-zMY8o-86.js +0 -28
  740. package/dist/chunks/skillSearchPanel-l8aolUP8.js +0 -21
  741. package/dist/chunks/skills-BeMWJPup.js +0 -1
  742. package/dist/chunks/sprites-qel_EgTP.js +0 -1
  743. package/dist/chunks/src-BIPP3_mo.js +0 -26
  744. package/dist/chunks/src-DJXKJavk.js +0 -1
  745. package/dist/chunks/startupProfiler-CnDpob1v.js +0 -3
  746. package/dist/chunks/startupProfiler-TrMfE6Q4.js +0 -1
  747. package/dist/chunks/stats-CEBfahqM.js +0 -1
  748. package/dist/chunks/status-C9KXyfDk.js +0 -1
  749. package/dist/chunks/statusNoticeHelpers-CxoN9oDh.js +0 -1
  750. package/dist/chunks/stdio-BEEzuxaZ.js +0 -1
  751. package/dist/chunks/stickers-eHrGA1W5.js +0 -1
  752. package/dist/chunks/subprocessEnv-CggQWZCx.js +0 -1
  753. package/dist/chunks/systemPromptSections-DB93ZNWP.js +0 -1
  754. package/dist/chunks/tag-Dvl7Us9y.js +0 -11
  755. package/dist/chunks/tasks-BhiwUF0n.js +0 -1
  756. package/dist/chunks/teamHelpers-COQazluD.js +0 -1
  757. package/dist/chunks/teamHelpers-Mgfrv-Jf.js +0 -1
  758. package/dist/chunks/teammateModeSnapshot-8EWjlA-s.js +0 -1
  759. package/dist/chunks/teammateModeSnapshot-BV-P8s5r.js +0 -1
  760. package/dist/chunks/teleport-U5Zgqw3H.js +0 -1
  761. package/dist/chunks/templateJobs-C3idypN_.js +0 -12
  762. package/dist/chunks/terminalSetup-CmAEgt-5.js +0 -33
  763. package/dist/chunks/terminalSetup-mvAN4no7.js +0 -1
  764. package/dist/chunks/theme-BD2H4vJi.js +0 -1
  765. package/dist/chunks/thinkback-BOByXYp2.js +0 -1
  766. package/dist/chunks/thinkback-Dzu2mnNF.js +0 -1
  767. package/dist/chunks/thinkback-play-BX1K2UMY.js +0 -1
  768. package/dist/chunks/tmux-DruHFjDy.js +0 -1
  769. package/dist/chunks/toolEventObserver-B6cLV_dK.js +0 -1
  770. package/dist/chunks/toolEventObserver-i6it3p2_.js +0 -1
  771. package/dist/chunks/toolPool--2gNFbrz.js +0 -1
  772. package/dist/chunks/toolPool-dNV2JxUI.js +0 -1
  773. package/dist/chunks/trustedDevice-DY8OosTr.js +0 -1
  774. package/dist/chunks/trustedDevice-zya_Ml1N.js +0 -1
  775. package/dist/chunks/tui-KoYD82tT.js +0 -6
  776. package/dist/chunks/types-CQ1wrnQ0.js +0 -1
  777. package/dist/chunks/types-D5R26wwH.js +0 -17
  778. package/dist/chunks/udsClient-RkYuzeZC.js +0 -1
  779. package/dist/chunks/ultrareviewCommand-CCkKby4J.js +0 -3
  780. package/dist/chunks/undercover-CIutVLEO.js +0 -1
  781. package/dist/chunks/undercover-D9O2McNG.js +0 -31
  782. package/dist/chunks/up-BPM85EYl.js +0 -12
  783. package/dist/chunks/updateCCB-Bmn3Y63Y.js +0 -11
  784. package/dist/chunks/upgrade-D3rVOeHO.js +0 -1
  785. package/dist/chunks/upgrade-Dq3l14ZY.js +0 -1
  786. package/dist/chunks/upload-1PmElPfW.js +0 -1
  787. package/dist/chunks/upstreamproxy-BBTSJnad.js +0 -11
  788. package/dist/chunks/usage-B5G8FOZ3.js +0 -1
  789. package/dist/chunks/usage-VtTu7beE.js +0 -1
  790. package/dist/chunks/useMainLoopModel-CaQLIr1V.js +0 -1
  791. package/dist/chunks/useManagePlugins-BvoeOnqq.js +0 -1
  792. package/dist/chunks/useMergedTools-C133BfRp.js +0 -1
  793. package/dist/chunks/useSearchInput-CROB7AbC.js +0 -1
  794. package/dist/chunks/useSettingsErrors-DRxtFXoe.js +0 -1
  795. package/dist/chunks/useVoice-BQ9aSFJe.js +0 -1
  796. package/dist/chunks/util-BZnJgF79.js +0 -1
  797. package/dist/chunks/utils-4gsxQpga.js +0 -1
  798. package/dist/chunks/validatePlugin-DlrnBhPA.js +0 -1
  799. package/dist/chunks/vim-BXQCLoFJ.js +0 -1
  800. package/dist/chunks/voice-CeRmLRHT.js +0 -2
  801. package/dist/chunks/voice-QHyDff3f.js +0 -8
  802. package/dist/chunks/voiceModeEnabled-Bq_rttkL.js +0 -1
  803. package/dist/chunks/voiceModeEnabled-CLAVCVLW.js +0 -1
  804. package/dist/chunks/voiceStreamSTT-BDKenO5F.js +0 -1
  805. package/dist/chunks/voiceStreamSTT-CL52x8wZ.js +0 -1
  806. package/dist/chunks/windowsPaths-43st5EQF.js +0 -1
  807. package/dist/chunks/windowsPaths-DerzGPcz.js +0 -2
  808. package/dist/chunks/workerRegistry-BUD3lBk_.js +0 -1
  809. package/dist/chunks/worktree-C0f9Ke-R.js +0 -1
  810. package/dist/chunks/worktreeModeEnabled-THQb19xR.js +0 -1
  811. package/dist/chunks/xml-DvVQHZ1N.js +0 -1
  812. /package/dist/chunks/{Dialog-DYFGqyDs.js → Dialog-91X6ZGg9.js} +0 -0
  813. /package/dist/chunks/{InProcessTransport-B0mmAoxw.js → InProcessTransport-B9II3BiO.js} +0 -0
  814. /package/dist/chunks/{ListItem-OFARanN7.js → ListItem-DCQhApdJ.js} +0 -0
  815. /package/dist/chunks/{PermissionDialog-5MlJf7ew.js → PermissionDialog-_WQPRYHQ.js} +0 -0
  816. /package/dist/chunks/{PressEnterToContinue-BdA9zDGs.js → PressEnterToContinue-BJ58eCFC.js} +0 -0
  817. /package/dist/chunks/{SearchBox-DfOmUoaI.js → SearchBox-CkO4rQ-9.js} +0 -0
  818. /package/dist/chunks/{TungstenTool-V-Bwqlx3.js → TungstenTool-CnAF4y0E.js} +0 -0
  819. /package/dist/chunks/{attributionHooks-DZJjA8p9.js → attributionHooks-VGSpz4mk.js} +0 -0
  820. /package/dist/chunks/{attributionTrailer-CZY9XTcr.js → attributionTrailer-C8uqiLIb.js} +0 -0
  821. /package/dist/chunks/{autoModeDenials-CGAtAGGf.js → autoModeDenials-DlO5g6E9.js} +0 -0
  822. /package/dist/chunks/{bedrockClient-DZgaJTHp.js → bedrockClient-BUmO2U-X.js} +0 -0
  823. /package/dist/chunks/{capacityWake-BXlUpptF.js → capacityWake-DtmDHwEt.js} +0 -0
  824. /package/dist/chunks/{ccshareResume-CZggHNOf.js → ccshareResume-DKwcd0Vc.js} +0 -0
  825. /package/dist/chunks/{computerUseLock-BoEK9xYv.js → computerUseLock-Diig5B8p.js} +0 -0
  826. /package/dist/chunks/{connectHeadless-KNT0Sg7Z.js → connectHeadless-ByewVfOb.js} +0 -0
  827. /package/dist/chunks/{constants-41VpZw2G.js → constants-BljlAJOX.js} +0 -0
  828. /package/dist/chunks/{controlMessageCompat-BJhFiS7u.js → controlMessageCompat-Ds-CF-sM.js} +0 -0
  829. /package/dist/chunks/{dangerousBackend-ByOAEFld.js → dangerousBackend-Dkjtndh1.js} +0 -0
  830. /package/dist/chunks/{debugUtils-CiEnbhiz.js → debugUtils-l8nsUZ6R.js} +0 -0
  831. /package/dist/chunks/{distRoot-CcxmnzqQ.js → distRoot-BNg_iO5-.js} +0 -0
  832. /package/dist/chunks/{escHotkey-DfdC44i7.js → escHotkey-D8WgbSyj.js} +0 -0
  833. /package/dist/chunks/{esm-C-1qL9Mn.js → esm-vlR7mK5b.js} +0 -0
  834. /package/dist/chunks/{eventLoopStallDetector-l83_98VR.js → eventLoopStallDetector-bYy0fesH.js} +0 -0
  835. /package/dist/chunks/{exit-_obETqBv.js → exit-DOBLl8jN.js} +0 -0
  836. /package/dist/chunks/{featureCheck-Cm0YNDXO.js → featureCheck-j7P30mry.js} +0 -0
  837. /package/dist/chunks/{fpsMetrics-DOI_SIeY.js → fpsMetrics-DKWp7vng.js} +0 -0
  838. /package/dist/chunks/{fuse-Bp7rmZ5x.js → fuse-D3B-UE5Y.js} +0 -0
  839. /package/dist/chunks/{hash-BRmOQc3c.js → hash-CaUkS-30.js} +0 -0
  840. /package/dist/chunks/{index.min-BJnb9GQI.js → index.min-BNgJ2wVD.js} +0 -0
  841. /package/dist/chunks/{instinctParser-Bxhe2LOF.js → instinctParser-DOtj1Kni.js} +0 -0
  842. /package/dist/chunks/{intl-Pse97ORk.js → intl-CLeE9DsD.js} +0 -0
  843. /package/dist/chunks/{launchCommand-Du91jxMC.js → launchCommand-9eYsPG7W.js} +0 -0
  844. /package/dist/chunks/{lazySchema-2sOku3cX.js → lazySchema-B0QShMaQ.js} +0 -0
  845. /package/dist/chunks/{lib-B4Q0Nrpb.js → lib-Cf16LgKj.js} +0 -0
  846. /package/dist/chunks/{lockfile-CeCEBLtN.js → lockfile-C3JsqLpb.js} +0 -0
  847. /package/dist/chunks/{modalContext-CmSKRyea.js → modalContext-c5Yqx_CQ.js} +0 -0
  848. /package/dist/chunks/{normalization-Cox8C0dP.js → normalization-BLfP0Kqt.js} +0 -0
  849. /package/dist/chunks/{observationStore-BaPq7CKI.js → observationStore-rLlDwRtG.js} +0 -0
  850. /package/dist/chunks/{openaiShared-Crt0cZLO.js → openaiShared-C-AuktRP.js} +0 -0
  851. /package/dist/chunks/{output-style-BkOnFmfe.js → output-style-B64-Zum6.js} +0 -0
  852. /package/dist/chunks/{parseConnectUrl-BFNiff4c.js → parseConnectUrl-DL390ePs.js} +0 -0
  853. /package/dist/chunks/{parser-BXWr_mLL.js → parser-aIWfAYnt.js} +0 -0
  854. /package/dist/chunks/{permissions-DXLfdE7b.js → permissions-BsVJvaEe.js} +0 -0
  855. /package/dist/chunks/{postCommitAttribution-CA9Z2sqn.js → postCommitAttribution-D8MoHFoz.js} +0 -0
  856. /package/dist/chunks/{projectContext-CwJlxP2Y.js → projectContext-Dn7umMp6.js} +0 -0
  857. /package/dist/chunks/{prompt-4tea6NJQ.js → prompt-IqfIbvg9.js} +0 -0
  858. /package/dist/chunks/{proxy-nPT6a6QY.js → proxy-CF7ZDxaW.js} +0 -0
  859. /package/dist/chunks/{rewind-DTk4TFYB.js → rewind-Djt1zU_3.js} +0 -0
  860. /package/dist/chunks/{rollback-DbSpxmJE.js → rollback-CtS4yEQx.js} +0 -0
  861. /package/dist/chunks/{sanitization-DD414_3t.js → sanitization-Ds6zRQyx.js} +0 -0
  862. /package/dist/chunks/{sdkHeapDumpMonitor-fNRF2fbK.js → sdkHeapDumpMonitor-DLMMNeqo.js} +0 -0
  863. /package/dist/chunks/{semver-Tw0AFar5.js → semver-Di5OaTd5.js} +0 -0
  864. /package/dist/chunks/{server-DTd90dmm.js → server-DONKdvGc.js} +0 -0
  865. /package/dist/chunks/{serverBanner-B7UaaCCl.js → serverBanner-DIyjgIM-.js} +0 -0
  866. /package/dist/chunks/{serverLog-DRvGpDtt.js → serverLog-D1N5yx8A.js} +0 -0
  867. /package/dist/chunks/{sessionDataUploader-BDsz_1Uy.js → sessionDataUploader-CsNePsOb.js} +0 -0
  868. /package/dist/chunks/{sessionManager-Bh-Z-YXy.js → sessionManager-BOmgJd1l.js} +0 -0
  869. /package/dist/chunks/{slashCommandParsing-Cari0pNg.js → slashCommandParsing-BfanVchF.js} +0 -0
  870. /package/dist/chunks/{sleep-8Eb9j_Ly.js → sleep-C6koP5Ka.js} +0 -0
  871. /package/dist/chunks/{src-x7u_sB6m.js → src-BWpNn6Yz.js} +0 -0
  872. /package/dist/chunks/{src-BRAdBA8A.js → src-C-Ho8kYe.js} +0 -0
  873. /package/dist/chunks/{src-BlLavFUS.js → src-Cu58IYYb.js} +0 -0
  874. /package/dist/chunks/{src-CI_jaaBj.js → src-d2UJ68oX.js} +0 -0
  875. /package/dist/chunks/{state-Ce1HlR-H.js → state-BiRT9RAF.js} +0 -0
  876. /package/dist/chunks/{staticRender-Br64h1E1.js → staticRender-C5v46np_.js} +0 -0
  877. /package/dist/chunks/{stdio-D4cT86R0.js → stdio-Oy68T2eE.js} +0 -0
  878. /package/dist/chunks/{store-DhI7Lcan.js → store-DYC8zeL1.js} +0 -0
  879. /package/dist/chunks/{subprocessEnv-DV6q6o6w.js → subprocessEnv-DIeTJ-xE.js} +0 -0
  880. /package/dist/chunks/{systemPromptSections-BcN_XBTx.js → systemPromptSections-DY7epA2Y.js} +0 -0
  881. /package/dist/chunks/{systemTheme-dDbitcxB.js → systemTheme-eRWGHYSL.js} +0 -0
  882. /package/dist/chunks/{teammate-DMYOtLTK.js → teammate-CbskW5G9.js} +0 -0
  883. /package/dist/chunks/{types-RJTEOuIt.js → types-C0nqJFkV.js} +0 -0
  884. /package/dist/chunks/{useKeybinding-FsOnjW6T.js → useKeybinding-DPOUuymz.js} +0 -0
  885. /package/dist/chunks/{workSecret-qRMNrQy2.js → workSecret-DJu7k30X.js} +0 -0
  886. /package/dist/chunks/{worktreeModeEnabled-Db6b_Iy_.js → worktreeModeEnabled-KtHEqeFA.js} +0 -0
  887. /package/dist/chunks/{xdg-CBxMmQux.js → xdg-BFD9ydDV.js} +0 -0
@@ -0,0 +1 @@
1
+ import{i as e,r as t,t as n}from"./permissions-BsVJvaEe.js";e();export{n as EXTERNAL_PERMISSION_MODES,t as PERMISSION_MODES};
@@ -0,0 +1,3 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{F as i,In as a,J as o,Ln as s,Rn as c,Ut as l,_ as u,a as d,b as f,f as p,i as m,n as h,o as g,p as ee,r as te,t as _,tt as ne,x as v,xt as y}from"./src-Di342QoJ.js";import{t as b}from"./jsx-runtime-D-D469L8.js";import{cn as re,ot as x}from"./state-sIHsFpDu.js";import{Ao as S,Do as C,Gs as w,Xa as T,ko as E,oo as D,zs as O}from"./paths-DO4WOQtD.js";import{E as k,O as A}from"./debug-otxXY3j-.js";import{l as j,o as M}from"./stringUtils-KZoO4GUd.js";import{Dp as ie,FA as ae,FD as N,H as oe,ID as se,K as ce,MA as P,Op as le,U as ue,Uo as F,V as de,W as fe,aS as I,bo as L,dS as pe,fC as me,fS as R,jD as z,lC as he,oS as B,q as ge,uC as _e,vu as V,yu as ve}from"./loadAgentsDir-ClTeo0nk.js";import{t as ye}from"./useKeybinding-DPOUuymz.js";import{t as be}from"./useTerminalSize-Du-EamDN.js";import{n as xe,t as Se}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";import{n as Ce,t as we}from"./AddWorkspaceDirectory-V2tF7iCY.js";import{t as Te}from"./SearchBox-CkO4rQ-9.js";import{n as Ee,t as De}from"./useSearchInput-BhKAGgEN.js";import{n as H,t as Oe}from"./shadowedRuleDetection-DASW3j9H.js";import{n as ke,t as Ae}from"./autoModeDenials-DlO5g6E9.js";function je({ruleValue:e}){switch(e.toolName){case V.name:return e.ruleContent?e.ruleContent.endsWith(`:*`)?(0,U.jsxs)(f,{dimColor:!0,children:[`Any Bash command starting with `,(0,U.jsx)(f,{bold:!0,children:e.ruleContent.slice(0,-2)})]}):(0,U.jsxs)(f,{dimColor:!0,children:[`The Bash command `,(0,U.jsx)(f,{bold:!0,children:e.ruleContent})]}):(0,U.jsx)(f,{dimColor:!0,children:`Any Bash command`});default:return e.ruleContent?null:(0,U.jsxs)(f,{dimColor:!0,children:[`Any use of the `,(0,U.jsx)(f,{bold:!0,children:e.toolName}),` tool`]})}}var U,Me=e((()=>{c(),_(),ve(),U=b()}));function Ne(e){switch(e){case`localSettings`:return{label:`Project settings (local)`,description:`Saved in ${T(`localSettings`)}`,value:e};case`projectSettings`:return{label:`Project settings`,description:`Checked in at ${T(`projectSettings`)}`,value:e};case`userSettings`:return{label:`User settings`,description:`Saved in at ~/.claude/settings.json`,value:e}}}function Pe({onAddRules:e,onCancel:t,ruleValues:n,ruleBehavior:r,initialContext:i,setToolPermissionContext:a}){let o=O.map(Ne),s=(0,Fe.useCallback)(o=>{if(o===`cancel`){t();return}else if(O.includes(o)){let t=o,s=z(i,{type:`addRules`,rules:n,behavior:r,destination:t});se({type:`addRules`,rules:n,behavior:r,destination:t}),a(s);let c=n.map(e=>({ruleValue:e,ruleBehavior:r,source:t})),l=Oe(s,{sandboxAutoAllowEnabled:P.isSandboxingEnabled()&&P.isAutoAllowBashIfSandboxedEnabled()}).filter(e=>n.some(t=>t.toolName===e.rule.ruleValue.toolName&&t.ruleContent===e.rule.ruleValue.ruleContent));e(c,l.length>0?l:void 0)}},[e,t,n,r,i,a]);return(0,W.jsxs)(p,{title:`Add ${r} permission ${j(n.length,`rule`)}`,onCancel:t,color:`permission`,children:[(0,W.jsx)(v,{flexDirection:`column`,paddingX:2,children:n.map(e=>(0,W.jsxs)(v,{flexDirection:`column`,children:[(0,W.jsx)(f,{bold:!0,children:S(e)}),(0,W.jsx)(je,{ruleValue:e})]},S(e)))}),(0,W.jsxs)(v,{flexDirection:`column`,marginY:1,children:[(0,W.jsx)(f,{children:n.length===1?`Where should this rule be saved?`:`Where should these rules be saved?`}),(0,W.jsx)(I,{options:o,onChange:s})]})]})}var Fe,W,Ie=e((()=>{c(),Fe=t(c(),1),B(),_(),N(),C(),H(),ae(),w(),D(),M(),Me(),W=b()}));function Le({onCancel:e,onSubmit:t,ruleBehavior:n}){let[a,s]=(0,Re.useState)(``),[c,l]=(0,Re.useState)(0),u=xe();ne(`confirm:no`,e,{context:`Settings`});let{columns:d}=i(),p=d-6;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(v,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`permission`,children:[(0,G.jsxs)(f,{bold:!0,color:`permission`,children:[`Add `,n,` permission rule`]}),(0,G.jsxs)(v,{flexDirection:`column`,children:[(0,G.jsxs)(f,{children:[`Permission rules are a tool name, optionally followed by a specifier in parentheses.`,(0,G.jsx)(o,{}),`e.g., `,(0,G.jsx)(f,{bold:!0,children:S({toolName:ie.name})}),(0,G.jsx)(f,{bold:!1,children:` or `}),(0,G.jsx)(f,{bold:!0,children:S({toolName:V.name,ruleContent:`ls:*`})})]}),(0,G.jsx)(v,{borderDimColor:!0,borderStyle:`round`,marginY:1,paddingLeft:1,children:(0,G.jsx)(pe,{showCursor:!0,value:a,onChange:s,onSubmit:e=>{let r=e.trim();r.length!==0&&t(E(r),n)},placeholder:`Enter permission rule${r.ellipsis}`,columns:p,cursorOffset:c,onChangeCursorOffset:l})})]})]}),(0,G.jsx)(v,{marginLeft:3,children:u.pending?(0,G.jsxs)(f,{dimColor:!0,children:[`Press `,u.keyName,` again to exit`]}):(0,G.jsx)(f,{dimColor:!0,children:`Enter to submit · Esc to cancel`})})]})}var Re,G,ze=e((()=>{n(),c(),Re=t(c(),1),R(),Se(),be(),_(),ye(),ve(),le(),C(),G=b()}));function Be({onHeaderFocusChange:e,onStateChange:t}){let{headerFocused:n,focusHeader:r}=m();(0,K.useEffect)(()=>{e?.(n)},[n,e]);let[i]=(0,K.useState)(()=>Ae()),[a,o]=(0,K.useState)(()=>new Set),[s,c]=(0,K.useState)(()=>new Set),[l,u]=(0,K.useState)(0);(0,K.useEffect)(()=>{t({approved:a,retry:s,denials:i})},[a,s,i,t]);let d=(0,K.useCallback)(e=>{let t=Number(e);o(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),p=(0,K.useCallback)(e=>{u(Number(e))},[]);if(y((e,t)=>{e===`r`&&(c(e=>{let t=new Set(e);return t.has(l)?t.delete(l):t.add(l),t}),o(e=>{if(e.has(l))return e;let t=new Set(e);return t.add(l),t}))},{isActive:i.length>0}),i.length===0)return(0,q.jsx)(f,{dimColor:!0,children:`No recent denials. Commands denied by the auto mode classifier will appear here.`});let h=i.map((e,t)=>{let n=a.has(t),r=s.has(t)?` (retry)`:``;return{label:(0,q.jsxs)(f,{children:[(0,q.jsx)(g,{status:n?`success`:`error`,withSpace:!0}),e.display,(0,q.jsx)(f,{dimColor:!0,children:r})]}),value:String(t)}});return(0,q.jsxs)(v,{flexDirection:`column`,children:[(0,q.jsx)(f,{children:`Commands recently denied by the auto mode classifier.`}),(0,q.jsx)(v,{marginTop:1,children:(0,q.jsx)(I,{options:h,onChange:d,onFocus:p,visibleOptionCount:Math.min(10,h.length),isDisabled:n,onUpFromFirstItem:r})})]})}var K,q,Ve=e((()=>{c(),K=t(c(),1),_(),ke(),B(),q=b()}));function He({directoryPath:e,onRemove:t,onCancel:n,permissionContext:r,setPermissionContext:i}){let a=(0,J.useCallback)(()=>{i(z(r,{type:`removeDirectories`,directories:[e],destination:`session`})),t()},[e,r,i,t]),o=(0,J.useCallback)(e=>{e===`yes`?a():n()},[a,n]);return(0,Y.jsxs)(p,{title:`Remove directory from workspace?`,onCancel:n,color:`error`,children:[(0,Y.jsx)(v,{marginX:2,flexDirection:`column`,children:(0,Y.jsx)(f,{bold:!0,children:e})}),(0,Y.jsx)(f,{children:`Claude Code will no longer have access to files in this directory.`}),(0,Y.jsx)(I,{onChange:o,onCancel:n,options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}]})]})}var J,Y,Ue=e((()=>{c(),J=t(c(),1),B(),_(),N(),Y=b()}));function We({onExit:e,toolPermissionContext:t,onRequestAddDirectory:n,onRequestRemoveDirectory:i,onHeaderFocusChange:a}){let{headerFocused:o,focusHeader:s}=m();(0,X.useEffect)(()=>{a?.(o)},[o,a]);let c=Ge.useMemo(()=>Array.from(t.additionalWorkingDirectories.keys()).map(e=>({path:e,isCurrent:!1,isDeletable:!0})),[t.additionalWorkingDirectories]),l=(0,X.useCallback)(e=>{if(e===`add-directory`){n();return}let t=c.find(t=>t.path===e);t&&t.isDeletable&&i(t.path)},[c,n,i]),u=(0,X.useCallback)(()=>e(`Workspace dialog dismissed`,{display:`system`}),[e]),d=Ge.useMemo(()=>{let e=c.map(e=>({label:e.path,value:e.path}));return e.push({label:`Add directory${r.ellipsis}`,value:`add-directory`}),e},[c]);return(0,Z.jsxs)(v,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(v,{flexDirection:`row`,marginTop:1,marginLeft:2,gap:1,children:[(0,Z.jsx)(f,{children:`- ${x()}`}),(0,Z.jsx)(f,{dimColor:!0,children:`(Original working directory)`})]}),(0,Z.jsx)(I,{options:d,onChange:l,onCancel:u,visibleOptionCount:Math.min(10,d.length),onUpFromFirstItem:s,isDisabled:o})]})}var Ge,X,Z,Ke=e((()=>{n(),Ge=t(c(),1),X=t(c(),1),re(),B(),_(),Z=b()}));function qe({rule:e}){return(0,$.jsx)(f,{dimColor:!0,children:`From ${ge(e.source)}`})}function Je(e){switch(e){case`allow`:return`allowed`;case`deny`:return`denied`;case`ask`:return`ask`}}function Ye({rule:e,onDelete:t,onCancel:n}){let r=xe();ne(`confirm:no`,n,{context:`Confirmation`});let i=(0,$.jsxs)(v,{flexDirection:`column`,marginX:2,children:[(0,$.jsx)(f,{bold:!0,children:S(e.ruleValue)}),(0,$.jsx)(je,{ruleValue:e.ruleValue}),(0,$.jsx)(qe,{rule:e})]}),a=(0,$.jsx)(v,{marginLeft:3,children:r.pending?(0,$.jsxs)(f,{dimColor:!0,children:[`Press `,r.keyName,` again to exit`]}):(0,$.jsx)(f,{dimColor:!0,children:`Esc to cancel`})});return e.source===`policySettings`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(v,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`permission`,children:[(0,$.jsx)(f,{bold:!0,color:`permission`,children:`Rule details`}),i,(0,$.jsxs)(f,{italic:!0,children:[`This rule is configured by managed settings and cannot be modified.`,`
2
+ `,`Contact your system administrator for more information.`]})]}),a]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(v,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`error`,children:[(0,$.jsxs)(f,{bold:!0,color:`error`,children:[`Delete `,Je(e.ruleBehavior),` tool?`]}),i,(0,$.jsx)(f,{children:`Are you sure you want to delete this permission rule?`}),(0,$.jsx)(I,{onChange:e=>e===`yes`?t():n(),onCancel:n,options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}]})]}),a]})}function Xe(e){let{options:t,searchQuery:n,isSearchMode:r,isFocused:i,onSelect:a,onCancel:o,lastFocusedRuleKey:s,cursorOffset:c,onHeaderFocusChange:l}=e,f=d(),{headerFocused:p,focusHeader:h,blurHeader:g}=m();return(0,Q.useEffect)(()=>{r&&p&&g()},[r,p,g]),(0,Q.useEffect)(()=>{l?.(p)},[p,l]),(0,$.jsxs)(v,{flexDirection:`column`,children:[(0,$.jsx)(v,{marginBottom:1,flexDirection:`column`,children:(0,$.jsx)(u,{query:n,isFocused:r&&!p,isTerminalFocused:i,width:f,cursorOffset:c})}),(0,$.jsx)(I,{options:t,onChange:a,onCancel:o,visibleOptionCount:Math.min(10,t.length),isDisabled:r||p,defaultFocusValue:s,onUpFromFirstItem:h})]})}function Ze({tab:e,getRulesOptions:t,handleToolSelect:n,...r}){return(0,$.jsxs)(v,{flexDirection:`column`,flexShrink:e===`allow`?0:void 0,children:[(0,$.jsx)(f,{children:{allow:`Claude Code won't ask before using allowed tools.`,ask:`Claude Code will always ask for confirmation before using these tools.`,deny:`Claude Code will always reject requests to use denied tools.`}[e]}),(0,$.jsx)(Xe,{options:t(e,r.searchQuery).options,onSelect:t=>n(t,e),...r})]})}function Qe({onExit:e,initialTab:t,onRetryDenials:n}){let i=Ae().length>0,o=t??(i?`recent`:`allow`),[s,c]=(0,Q.useState)([]),u=_e(e=>e.toolPermissionContext),d=me(),p=l(),m=(0,Q.useRef)({approved:new Set,retry:new Set,denials:[]}),g=(0,Q.useCallback)(e=>{m.current=e},[]),[_,y]=(0,Q.useState)(),[b,re]=(0,Q.useState)(),[x,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(!1),[ie,ae]=(0,Q.useState)(!0),N=(0,Q.useCallback)(e=>{ae(e)},[]),ce=(0,Q.useMemo)(()=>{let e=new Map;return oe(u).forEach(t=>{e.set(A(t),t)}),e},[u]),P=(0,Q.useMemo)(()=>{let e=new Map;return fe(u).forEach(t=>{e.set(A(t),t)}),e},[u]),le=(0,Q.useMemo)(()=>{let e=new Map;return ue(u).forEach(t=>{e.set(A(t),t)}),e},[u]),F=(0,Q.useCallback)((e,t=``)=>{let n=(()=>{switch(e){case`allow`:return ce;case`deny`:return P;case`ask`:return le;case`workspace`:case`recent`:return new Map}})(),i=[];e!==`workspace`&&e!==`recent`&&!t&&i.push({label:`Add a new rule${r.ellipsis}`,value:`add-new-rule`});let a=Array.from(n.keys()).sort((e,t)=>{let r=n.get(e),i=n.get(t);if(r&&i){let e=S(r.ruleValue).toLowerCase(),t=S(i.ruleValue).toLowerCase();return e.localeCompare(t)}return 0}),o=t.toLowerCase();for(let e of a){let r=n.get(e);if(r){let n=S(r.ruleValue);if(t&&!n.toLowerCase().includes(o))continue;i.push({label:n,value:e})}}return{options:i,rulesByKey:n}},[ce,P,le]),I=xe(),L=!_&&!x&&!w&&!E&&!O,{query:pe,setQuery:R,cursorOffset:he}=Ee({isActive:L&&j,onExit:()=>{M(!1)}}),B=(0,Q.useCallback)(e=>{L&&(j||e.ctrl||e.meta||(e.key===`/`?(e.preventDefault(),M(!0),R(``)):e.key.length===1&&e.key!==`j`&&e.key!==`k`&&e.key!==`m`&&e.key!==`i`&&e.key!==`r`&&e.key!==` `&&(e.preventDefault(),M(!0),R(e.key))))},[L,j,R]),ge=(0,Q.useCallback)((e,t)=>{let{rulesByKey:n}=F(t);if(e===`add-new-rule`){C(t);return}else{y(n.get(e));return}},[F]),V=(0,Q.useCallback)(()=>{C(null)},[]),ve=(0,Q.useCallback)((e,t)=>{T({ruleValue:e,ruleBehavior:t}),C(null)},[]),ye=(0,Q.useCallback)((e,t)=>{T(null);for(let t of e)c(e=>[...e,`Added ${t.ruleBehavior} rule ${a.bold(S(t.ruleValue))}`]);if(t&&t.length>0)for(let e of t){let t=e.shadowType===`deny`?`blocked`:`shadowed`;c(n=>[...n,a.yellow(`${r.warning} Warning: ${S(e.rule.ruleValue)} is ${t}`),a.dim(` ${e.reason}`),a.dim(` Fix: ${e.fix}`)])}},[]),be=(0,Q.useCallback)(()=>{T(null)},[]),Se=(0,Q.useCallback)(()=>D(!0),[]),Ce=(0,Q.useCallback)(e=>k(e),[]),Te=(0,Q.useCallback)(()=>{let t=m.current,r=e=>Array.from(e).map(e=>t.denials[e]).filter(e=>e!==void 0),i=r(t.retry);if(i.length>0){let t=i.map(e=>e.display);n?.(t),e(void 0,{shouldQuery:!0,metaMessages:[`Permission granted for: ${t.join(`, `)}. You may now retry ${t.length===1?`this command`:`these commands`} if you would like.`]});return}let o=r(t.approved);o.length>0||s.length>0?e([...o.length>0?[`Approved ${o.map(e=>a.bold(e.display)).join(`, `)}`]:[],...s].join(`
3
+ `)):e(`Permissions dialog dismissed`,{display:`system`})},[s,e,n]);ne(`confirm:no`,Te,{context:`Settings`,isActive:L&&!j});let De=()=>{if(!_)return;let{options:e}=F(_.ruleBehavior),t=A(_),n=e.filter(e=>e.value!==`add-new-rule`).map(e=>e.value),r=n.indexOf(t),i;r!==-1&&(r<n.length-1?i=n[r+1]:r>0&&(i=n[r-1])),re(i),de({rule:_,initialContext:u,setToolPermissionContext(e){d(t=>({...t,toolPermissionContext:e}))}}),c(e=>[...e,`Deleted ${_.ruleBehavior} rule ${a.bold(S(_.ruleValue))}`]),y(void 0)};if(_)return(0,$.jsx)(Ye,{rule:_,onDelete:De,onCancel:()=>y(void 0)});if(x&&x!==`workspace`&&x!==`recent`)return(0,$.jsx)(Le,{onCancel:V,onSubmit:ve,ruleBehavior:x});if(w)return(0,$.jsx)(Pe,{onAddRules:ye,onCancel:be,ruleValues:[w.ruleValue],ruleBehavior:w.ruleBehavior,initialContext:u,setToolPermissionContext:e=>{d(t=>({...t,toolPermissionContext:e}))}});if(E)return(0,$.jsx)(we,{onAddDirectory:(e,t)=>{let n={type:`addDirectories`,directories:[e],destination:t?`localSettings`:`session`},r=z(u,n);d(e=>({...e,toolPermissionContext:r})),t&&se(n),c(n=>[...n,`Added directory ${a.bold(e)} to workspace${t?` and saved to local settings`:` for this session`}`]),D(!1)},onCancel:()=>D(!1),permissionContext:u});if(O)return(0,$.jsx)(He,{directoryPath:O,onRemove:()=>{c(e=>[...e,`Removed directory ${a.bold(O)} from workspace`]),k(null)},onCancel:()=>k(null),permissionContext:u,setPermissionContext:e=>{d(t=>({...t,toolPermissionContext:e}))}});let H={searchQuery:pe,isSearchMode:j,isFocused:p,onCancel:Te,lastFocusedRuleKey:b,cursorOffset:he,getRulesOptions:F,handleToolSelect:ge,onHeaderFocusChange:N};return(0,$.jsx)(v,{flexDirection:`column`,onKeyDown:B,children:(0,$.jsxs)(ee,{color:`permission`,children:[(0,$.jsxs)(te,{title:`Permissions:`,color:`permission`,defaultTab:o,hidden:!!_||!!x||!!w||E||!!O,initialHeaderFocused:!i,navFromContent:!j,children:[(0,$.jsx)(h,{id:`recent`,title:`Recently denied`,children:(0,$.jsx)(Be,{onHeaderFocusChange:N,onStateChange:g})}),(0,$.jsx)(h,{id:`allow`,title:`Allow`,children:(0,$.jsx)(Ze,{tab:`allow`,...H})}),(0,$.jsx)(h,{id:`ask`,title:`Ask`,children:(0,$.jsx)(Ze,{tab:`ask`,...H})}),(0,$.jsx)(h,{id:`deny`,title:`Deny`,children:(0,$.jsx)(Ze,{tab:`deny`,...H})}),(0,$.jsx)(h,{id:`workspace`,title:`Workspace`,children:(0,$.jsxs)(v,{flexDirection:`column`,children:[(0,$.jsx)(f,{children:`Claude Code can read files in the workspace, and make edits when auto-accept edits is on.`}),(0,$.jsx)(We,{onExit:e,toolPermissionContext:u,onRequestAddDirectory:Se,onRequestRemoveDirectory:Ce,onHeaderFocusChange:N})]})})]}),(0,$.jsx)(v,{marginTop:1,paddingLeft:1,children:(0,$.jsx)(f,{dimColor:!0,children:I.pending?(0,$.jsxs)($.Fragment,{children:[`Press `,I.keyName,` again to exit`]}):ie?(0,$.jsx)($.Fragment,{children:`←/→ tab switch · ↓ return · Esc cancel`}):j?(0,$.jsx)($.Fragment,{children:`Type to filter · Enter/↓ select · ↑ tabs · Esc clear`}):i&&o===`recent`?(0,$.jsx)($.Fragment,{children:`Enter approve · r retry · ↑↓ navigate · ←/→ switch · Esc cancel`}):(0,$.jsx)($.Fragment,{children:`↑↓ navigate · Enter select · Type to search · ←/→ switch · Esc cancel`})})})]})})}var Q,$,$e=e((()=>{s(),n(),c(),Q=t(c(),1),he(),N(),B(),Se(),De(),_(),ye(),ke(),C(),ce(),k(),Te(),Ie(),Ce(),Me(),ze(),Ve(),Ue(),Ke(),$=b()})),et,tt;e((()=>{$e(),F(),et=b(),tt=async(e,t)=>(0,et.jsx)(Qe,{onExit:e,onRetryDenials:e=>{t.setMessages(t=>[...t,L(e)])}})}))();export{tt as call};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{o as r}from"./log-DSV4Ht5l.js";import{a as i,o as a}from"./teamHelpers-CXAmvFco.js";import{join as o}from"path";import"fs/promises";import"net";import"events";function s(e){let t=a(e);if(!t)return[];let n=new Set(t.hiddenPaneIds??[]),r=[];for(let e of t.members){if(e.name===`team-lead`)continue;let t=e.isActive===!1?`idle`:`running`;r.push({name:e.name,agentId:e.agentId,agentType:e.agentType,model:e.model,prompt:e.prompt,status:t,color:e.color,tmuxPaneId:e.tmuxPaneId,cwd:e.cwd,worktreePath:e.worktreePath,isHidden:n.has(e.tmuxPaneId),backendType:e.backendType,mode:e.mode})}return r}var c=e((()=>{i()}));function l(){return o(t(),`pipes`)}function u(e){return e?.pipeIpc??d}var d,f=e((()=>{n(),r(),d={role:`main`,subIndex:null,displayRole:`main`,serverName:null,attachedBy:null,localIp:null,hostname:null,machineId:null,mac:null,statusVisible:!1,selectorOpen:!1,selectedPipes:[],routeMode:`selected`,slaves:{},discoveredPipes:[]}}));export{c as a,s as i,l as n,f as r,u as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,t as r,x as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{cn as o,rn as s}from"./state-sIHsFpDu.js";import{Ax as c,FD as l,hy as u,j as d,jD as f,my as p,vy as m,w as h,zx as g}from"./loadAgentsDir-ClTeo0nk.js";import{a as _,i as v,r as y,t as b}from"./promptEditor-FI_ewCpV.js";import{r as x,t as S}from"./staticRender-C5v46np_.js";function C({planContent:e,planPath:t,editorName:r}){return(0,T.jsxs)(i,{flexDirection:`column`,children:[(0,T.jsx)(n,{bold:!0,children:`Current Plan`}),(0,T.jsx)(n,{dimColor:!0,children:t}),(0,T.jsx)(i,{marginTop:1,children:(0,T.jsx)(n,{children:e})}),r&&(0,T.jsxs)(i,{marginTop:1,children:[(0,T.jsx)(n,{dimColor:!0,children:`"/plan open"`}),(0,T.jsx)(n,{dimColor:!0,children:` to edit this plan in `}),(0,T.jsx)(n,{bold:!0,dimColor:!0,children:r})]})]})}async function w(e,t,n){let{getAppState:r,setAppState:i}=t,a=r().toolPermissionContext.mode;if(a!==`plan`){s(a,`plan`),i(e=>({...e,toolPermissionContext:f(d(e.toolPermissionContext),{type:`setMode`,mode:`plan`,destination:`session`})}));let t=n.trim();return t&&t!==`open`?e(`Enabled plan mode`,{shouldQuery:!0}):e(`Enabled plan mode`),null}let o=p(),c=u();if(!o)return e(`Already in plan mode. No plan written yet.`),null;if(n.trim().split(/\s+/)[0]===`open`){let t=await b(c);return t.error?e(`Failed to open plan in editor: ${t.error}`):e(`Opened plan in editor: ${c}`),null}let l=v();return e(await x((0,T.jsx)(C,{planContent:o,planPath:c,editorName:l?g(l):void 0}))),null}var T;e((()=>{t(),o(),r(),_(),c(),l(),h(),m(),y(),S(),T=a()}))();export{w as call};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{_ as r,h as i}from"./debug-otxXY3j-.js";import{o as a,s as o}from"./log-DSV4Ht5l.js";import{release as s}from"os";import{readFile as c,readdir as l}from"fs/promises";async function u(e){let t=new Set;process.env.P4PORT&&t.add(`perforce`);try{let n=e??i().cwd(),r=new Set(await l(n));for(let[e,n]of h)r.has(e)&&t.add(n)}catch{}return[...t]}var d,f,p,m,h,g=e((()=>{n(),r(),a(),d=[`macos`,`wsl`],f=t(()=>{try{if(process.platform===`darwin`)return`macos`;if(process.platform===`win32`)return`windows`;if(process.platform===`linux`){try{let e=i().readFileSync(`/proc/version`,{encoding:`utf8`});if(e.toLowerCase().includes(`microsoft`)||e.toLowerCase().includes(`wsl`))return`wsl`}catch(e){o(e)}return`linux`}return`unknown`}catch(e){return o(e),`unknown`}}),p=t(()=>{if(process.platform===`linux`)try{let e=i().readFileSync(`/proc/version`,{encoding:`utf8`}),t=e.match(/WSL(\d+)/i);return t&&t[1]?t[1]:e.toLowerCase().includes(`microsoft`)?`1`:void 0}catch(e){o(e);return}}),m=t(async()=>{if(process.platform!==`linux`)return;let e={linuxKernel:s()};try{let t=await c(`/etc/os-release`,`utf8`);for(let n of t.split(`
2
+ `)){let t=n.match(/^(ID|VERSION_ID)=(.*)$/);if(t&&t[1]&&t[2]){let n=t[2].replace(/^"|"$/g,``);t[1]===`ID`?e.linuxDistroId=n:e.linuxDistroVersion=n}}}catch{}return e}),h=[[`.git`,`git`],[`.hg`,`mercurial`],[`.svn`,`svn`],[`.p4config`,`perforce`],[`$tf`,`tfs`],[`.tfvc`,`tfs`],[`.jj`,`jujutsu`],[`.sl`,`sapling`]]}));export{p as a,f as i,u as n,g as o,m as r,d as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,t as i}from"./PluginSettings-B_xVgTTp.js";async function a(e,t,n){return(0,o.jsx)(i,{onComplete:e,args:n})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{ps as t,us as n,wc as r,yc as i}from"./paths-DO4WOQtD.js";import{U as a,l as o,p as s,z as c}from"./debug-otxXY3j-.js";import{o as l,s as u}from"./log-DSV4Ht5l.js";import{Js as d,Ls as f,Ms as p,Ps as m,Us as h,Zs as g,qs as _}from"./loadAgentsDir-ClTeo0nk.js";import{i as v,o as y}from"./xml-CTdKuU6f.js";import{f as b,s as x}from"./pluginOperations-CKmwDC3G.js";function S(e){return O=e,k!==null&&k.length>0&&(e(k),k=null),()=>{O=null}}async function C(){let e=await d(),n=h(),r=new Set;for(let[i,a]of Object.entries(e)){let e=n[i]?.autoUpdate;(e===void 0?t(i,a):e)&&r.add(i.toLowerCase())}return r}async function w(e,t){let n=!1;for(let{scope:r}of t)try{let t=await b(e,r);t.success&&!t.alreadyUpToDate?(n=!0,s(`Plugin autoupdate: updated ${e} from ${t.oldVersion} to ${t.newVersion}`)):t.alreadyUpToDate||s(`Plugin autoupdate: failed to update ${e}: ${t.message}`,{level:`warn`})}catch(t){s(`Plugin autoupdate: error updating ${e}: ${c(t)}`,{level:`warn`})}return n?e:null}async function T(e){let t=f(),n=Object.keys(t.plugins);return n.length===0?[]:(await Promise.allSettled(n.map(async n=>{let{marketplace:r}=y(n);if(!r||!e.has(r.toLowerCase()))return null;let i=t.plugins[n];if(!i||i.length===0)return null;let a=i.filter(m);return a.length===0?null:w(n,a)}))).filter(e=>e.status===`fulfilled`&&e.value!==null).map(e=>e.value)}async function E(e){return T(e)}function D(){(async()=>{if(r()){s(`Plugin autoupdate: skipped (auto-updater disabled)`);return}try{let e=await C();if(e.size===0)return;let t=(await Promise.allSettled(Array.from(e).map(async e=>{try{await g(e,void 0,{disableCredentialHelper:!0})}catch(t){s(`Plugin autoupdate: failed to refresh marketplace ${e}: ${c(t)}`,{level:`warn`})}}))).filter(e=>e.status===`rejected`);t.length>0&&s(`Plugin autoupdate: ${t.length} marketplace refresh(es) failed`,{level:`warn`}),s(`Plugin autoupdate: checking installed plugins`);let n=await E(e);n.length>0&&(O?O(n):k=n)}catch(e){u(e)}})()}var O,k,A=e((()=>{x(),i(),o(),a(),l(),p(),_(),v(),n(),O=null,k=null}));export{T as i,A as n,S as r,D as t};
@@ -0,0 +1 @@
1
+ import{U as e,l as t,p as n,z as r}from"./debug-otxXY3j-.js";import{Ms as i,Rs as a,Ws as o,Ys as s,qs as c}from"./loadAgentsDir-ClTeo0nk.js";import{d as l,s as u}from"./pluginOperations-CKmwDC3G.js";import{i as d,n as f,r as p,t as m}from"./pluginFlagging-DFMlWw2P.js";u(),t(),e(),i(),c(),p();function h(e,t,n){let r=new Set(t.plugins.map(e=>e.name)),i=`@${n}`,a=[];for(let t of Object.keys(e.plugins)){if(!t.endsWith(i))continue;let e=t.slice(0,-i.length);r.has(e)||a.push(t)}return a}async function g(){await d();let e=a(),t=f(),i=await s(),c=[];for(let a of Object.keys(i))try{let i=await o(a);if(!i.forceRemoveDeletedPlugins)continue;let s=h(e,i,a);for(let i of s){if(i in t)continue;let a=e.plugins[i]??[];if(a.some(e=>e.scope===`user`||e.scope===`project`||e.scope===`local`)){for(let e of a){let{scope:t}=e;if(!(t!==`user`&&t!==`project`&&t!==`local`))try{await l(i,t)}catch(e){n(`Failed to auto-uninstall delisted plugin ${i} from ${t}: ${r(e)}`,{level:`error`})}}await m(i),c.push(i)}}}catch(e){n(`Failed to check for delisted plugins in "${a}": ${r(e)}`,{level:`warn`})}return c}export{g as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./figures-gfT9mM8P.js";import{U as n,z as r}from"./debug-otxXY3j-.js";import{n as i,r as a}from"./analytics-DqMQntaB.js";import{n as o,o as s}from"./process-DMKLUQIO.js";import{o as c,s as l}from"./log-DSV4Ht5l.js";import{As as u,SE as d,_v as f,gv as p,js as m,vv as h,wE as g}from"./loadAgentsDir-ClTeo0nk.js";import{i as _,o as v}from"./xml-CTdKuU6f.js";import{a as y,c as b,d as x,f as S,i as C,r as w,s as T}from"./pluginOperations-CKmwDC3G.js";e(),n(),g(),c(),m(),_(),o(),h(),i(),T();function E(e,n,i){l(e);let o=i?`${n} plugin "${i}"`:n===`disable-all`?`disable all plugins`:`${n} plugins`;console.error(`${t.cross} Failed to ${o}: ${r(e)}`);let s=i?(()=>{let{name:e,marketplace:t}=v(i);return{_PROTO_plugin_name:e,...t&&{_PROTO_marketplace_name:t},...p(e,t,u())}})():{};a(`tengu_plugin_command_failed`,{command:n,error_category:f(e),...s}),process.exit(1)}async function D(e,n=`user`){try{console.log(`Installing plugin "${e}"...`);let r=await b(e,n);if(!r.success)throw Error(r.message);console.log(`${t.tick} ${r.message}`);let{name:i,marketplace:o}=v(r.pluginId||e);a(`tengu_plugin_installed_cli`,{_PROTO_plugin_name:i,...o&&{_PROTO_marketplace_name:o},scope:r.scope||n,install_source:`cli-explicit`,...p(i,o,u())}),process.exit(0)}catch(t){E(t,`install`,e)}}async function O(e,n=`user`,r=!1){try{let i=await x(e,n,!r);if(!i.success)throw Error(i.message);console.log(`${t.tick} ${i.message}`);let{name:o,marketplace:s}=v(i.pluginId||e);a(`tengu_plugin_uninstalled_cli`,{_PROTO_plugin_name:o,...s&&{_PROTO_marketplace_name:s},scope:i.scope||n,...p(o,s,u())}),process.exit(0)}catch(t){E(t,`uninstall`,e)}}async function k(e,n){try{let r=await y(e,n);if(!r.success)throw Error(r.message);console.log(`${t.tick} ${r.message}`);let{name:i,marketplace:o}=v(r.pluginId||e);a(`tengu_plugin_enabled_cli`,{_PROTO_plugin_name:i,...o&&{_PROTO_marketplace_name:o},scope:r.scope,...p(i,o,u())}),process.exit(0)}catch(t){E(t,`enable`,e)}}async function A(e,n){try{let r=await C(e,n);if(!r.success)throw Error(r.message);console.log(`${t.tick} ${r.message}`);let{name:i,marketplace:o}=v(r.pluginId||e);a(`tengu_plugin_disabled_cli`,{_PROTO_plugin_name:i,...o&&{_PROTO_marketplace_name:o},scope:r.scope,...p(i,o,u())}),process.exit(0)}catch(t){E(t,`disable`,e)}}async function j(){try{let e=await w();if(!e.success)throw Error(e.message);console.log(`${t.tick} ${e.message}`),a(`tengu_plugin_disabled_all_cli`,{}),process.exit(0)}catch(e){E(e,`disable-all`)}}async function M(e,n){try{s(`Checking for updates for plugin "${e}" at ${n} scope…\n`);let r=await S(e,n);if(!r.success)throw Error(r.message);if(s(`${t.tick} ${r.message}\n`),!r.alreadyUpToDate){let{name:t,marketplace:n}=v(r.pluginId||e);a(`tengu_plugin_updated_cli`,{_PROTO_plugin_name:t,...n&&{_PROTO_marketplace_name:n},old_version:r.oldVersion||`unknown`,new_version:r.newVersion||`unknown`,...p(t,n,u())})}await d(0)}catch(t){E(t,`update`,e)}}export{O as a,D as i,A as n,M as o,k as r,j as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{D as t,E as n,O as r,_ as i,h as a,l as o,p as s}from"./debug-otxXY3j-.js";import{o as c,s as l}from"./log-DSV4Ht5l.js";import{AA as u,kA as d}from"./loadAgentsDir-ClTeo0nk.js";import{join as f}from"path";import{randomBytes as p}from"crypto";import{readFile as m,rename as h,unlink as g,writeFile as _}from"fs/promises";function v(){return f(d(),D)}function y(e){let n=t(e);if(typeof n!=`object`||!n||!(`plugins`in n)||typeof n.plugins!=`object`||n.plugins===null)return{};let r=n.plugins,i={};for(let[e,t]of Object.entries(r))if(t&&typeof t==`object`&&`flaggedAt`in t&&typeof t.flaggedAt==`string`){let n={flaggedAt:t.flaggedAt};`seenAt`in t&&typeof t.seenAt==`string`&&(n.seenAt=t.seenAt),i[e]=n}return i}async function b(){try{return y(await m(v(),{encoding:`utf-8`}))}catch{return{}}}async function x(e){let t=v(),n=`${t}.${p(8).toString(`hex`)}.tmp`;try{await a().mkdir(d()),await _(n,r({plugins:e},null,2),{encoding:`utf-8`,mode:384}),await h(n,t),k=e}catch(e){l(e);try{await g(n)}catch{}}}async function S(){let e=await b(),t=Date.now(),n=!1;for(let[r,i]of Object.entries(e))i.seenAt&&t-new Date(i.seenAt).getTime()>=O&&(delete e[r],n=!0);k=e,n&&await x(e)}function C(){return k??{}}async function w(e){k===null&&(k=await b()),await x({...k,[e]:{flaggedAt:new Date().toISOString()}}),s(`Flagged plugin: ${e}`)}async function T(e){k===null&&(k=await b());let t=new Date().toISOString(),n=!1,r={...k};for(let i of e){let e=r[i];e&&!e.seenAt&&(r[i]={...e,seenAt:t},n=!0)}n&&await x(r)}async function E(e){if(k===null&&(k=await b()),!(e in k))return;let{[e]:t,...n}=k;k=n,await x(n)}var D,O,k,A=e((()=>{o(),i(),c(),n(),u(),D=`flagged-plugins.json`,O=2880*60*1e3,k=null}));export{T as a,S as i,C as n,E as o,A as r,w as t};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{cn as t,ot as n}from"./state-sIHsFpDu.js";import{Qa as r,lo as i,oo as a}from"./paths-DO4WOQtD.js";import{G as o,J as s,U as c,_ as l,h as u}from"./debug-otxXY3j-.js";import{o as d,s as f}from"./log-DSV4Ht5l.js";import{l as p,o as m}from"./stringUtils-KZoO4GUd.js";import{AA as h,Bs as g,Cs as _,EA as v,Es as y,Js as b,Ks as x,Ls as S,Ms as ee,Oh as C,Os as w,Rs as T,Ws as te,_c as E,_s as D,aT as O,gc as k,gs as A,hc as j,hs as ne,ij as re,kh as ie,ks as ae,nj as M,ps as oe,qs as se,rT as ce,rj as N,vs as P,ws as F,xs as I,ys as L,zs as R}from"./loadAgentsDir-ClTeo0nk.js";import{i as z,m as B,o as V,p as H,s as U}from"./xml-CTdKuU6f.js";import{n as W,t as G}from"./pluginStartupCheck-D6IbyWKe.js";import{dirname as le,join as K}from"path";function q(e){if(!Q.includes(e))throw Error(`Invalid scope "${e}". Must be one of: ${Q.join(`, `)}`)}function ue(e){return Q.includes(e)}function J(e){return e===`project`||e===`local`?n():void 0}function de(e){return r(`projectSettings`)?.enabledPlugins?.[e]===!0}function fe(e){let t=e.includes(`@`);for(let n of[`local`,`project`,`user`]){let i=r(U(n))?.enabledPlugins;if(i){for(let r of Object.keys(i))if(t?r===e:r.startsWith(`${e}@`))return{pluginId:r,scope:n}}}return null}function pe(e,t){let{name:n,marketplace:r}=V(e);return t.find(t=>t.name===e||t.name===n?!0:r&&t.source?t.name===n&&t.source.includes(`@${r}`):!1)}function me(e){let{name:t}=V(e),n=T();if(n.plugins[e]?.length)return{pluginId:e,pluginName:t};let r=Object.keys(n.plugins).find(e=>{let{name:r}=V(e);return r===t&&(n.plugins[e]?.length??0)>0});return r?{pluginId:r,pluginName:t}:null}function Y(e){let t=T().plugins[e];if(!t||t.length===0)return{scope:`user`};let r=n(),i=t.find(e=>e.scope===`local`&&e.projectPath===r);if(i)return{scope:i.scope,projectPath:i.projectPath};let a=t.find(e=>e.scope===`project`&&e.projectPath===r);if(a)return{scope:a.scope,projectPath:a.projectPath};let o=t.find(e=>e.scope===`user`);return o?{scope:o.scope}:{scope:t[0].scope,projectPath:t[0].projectPath}}async function he(e,t=`user`){q(t);let{name:n,marketplace:r}=V(e),i,a,o;if(r){let t=await x(e);t&&(i=t.entry,a=r,o=t.marketplaceInstallLocation)}else{let e=await b();for(let[t,r]of Object.entries(e))try{let e=(await te(t)).plugins.find(e=>e.name===n);if(e){i=e,a=t,o=r.installLocation;break}}catch(e){f(s(e))}}if(!i||!a)return{success:!1,message:`Plugin "${n}" not found in ${r?`marketplace "${r}"`:`any configured marketplace`}`};let c=i,l=`${c.name}@${a}`,u=await y({pluginId:l,entry:c,scope:t,marketplaceInstallLocation:o});if(!u.ok){let e=u;switch(e.reason){case`local-source-no-location`:return{success:!1,message:`Cannot install local plugin "${e.pluginName}" without marketplace install location`};case`settings-write-failed`:return{success:!1,message:`Failed to update settings: ${e.message}`};case`resolution-failed`:return{success:!1,message:_(e.resolution)};case`blocked-by-policy`:return{success:!1,message:`Plugin "${e.pluginName}" is blocked by your organization's policy and cannot be installed`};case`dependency-blocked-by-policy`:return{success:!1,message:`Plugin "${e.pluginName}" depends on "${e.blockedDependency}", which is blocked by your organization's policy`}}}return{success:!0,message:`Successfully installed plugin: ${l} (scope: ${t})${u.depNote}`,pluginId:l,pluginName:c.name,scope:t}}async function ge(e,t=`user`,n=!0){q(t);let{enabled:a,disabled:o}=await L(),s=[...a,...o],c=pe(e,s),l=U(t),u=r(l),d,f;if(c)d=Object.keys(u?.enabledPlugins??{}).find(t=>t===e||t===c.name||t.startsWith(`${c.name}@`))??(e.includes(`@`)?e:c.name),f=c.name;else{let t=me(e);if(!t)return{success:!1,message:`Plugin "${e}" not found in installed plugins`};d=t.pluginId,f=t.pluginName}let p=J(t),m=T().plugins[d],h=m?.find(e=>e.scope===t&&e.projectPath===p);if(!h){let{scope:n}=Y(d);return n!==t&&m&&m.length>0?n===`project`?{success:!1,message:`Plugin "${e}" is enabled at project scope (.claude/settings.json, shared with your team). To disable just for you: claude plugin disable ${e} --scope local`}:{success:!1,message:`Plugin "${e}" is installed in ${n} scope, not ${t}. Use --scope ${n} to uninstall.`}:{success:!1,message:`Plugin "${e}" is not installed in ${t} scope. Use --scope to specify the correct scope.`}}let g=h.installPath,_={...u?.enabledPlugins};_[d]=void 0,i(l,{enabledPlugins:_}),j(),R(d,t,p);let y=T().plugins[d],b=!y||y.length===0;b&&g&&await E(g),b&&(ce(d),n&&await v(d));let x=M(d,s),S=N(x);return{success:!0,message:`Successfully uninstalled plugin: ${f} (scope: ${t})${S}`,pluginId:d,pluginName:f,scope:t,reverseDependents:x.length>0?x:void 0}}async function X(e,t,n){let a=t?`enable`:`disable`;if(B(e)){let{error:n}=i(`userSettings`,{enabledPlugins:{...r(`userSettings`)?.enabledPlugins,[e]:t}});if(n)return{success:!1,message:`Failed to ${a} built-in plugin: ${n.message}`};j();let{name:o}=V(e);return{success:!0,message:`Successfully ${a}d built-in plugin: ${o}`,pluginId:e,pluginName:o,scope:`user`}}n&&q(n);let o,s,c=fe(e);if(n)if(s=n,c)o=c.pluginId;else if(e.includes(`@`))o=e;else return{success:!1,message:`Plugin "${e}" not found in settings. Use plugin@marketplace format.`};else if(c)o=c.pluginId,s=c.scope;else if(e.includes(`@`))o=e,s=`user`;else return{success:!1,message:`Plugin "${e}" not found in any editable settings scope. Use plugin@marketplace format.`};if(t&&ie(o))return{success:!1,message:`Plugin "${o}" is blocked by your organization's policy and cannot be enabled`};let l=U(s),u=r(l)?.enabledPlugins?.[o],d={user:0,project:1,local:2},f=n&&c&&d[n]>d[c.scope];if(n&&u===void 0&&c&&c.scope!==n&&!f)return{success:!1,message:`Plugin "${e}" is installed at ${c.scope} scope, not ${n}. Use --scope ${c.scope} or omit --scope to auto-detect.`};if(t===(n&&!f?u===!0:G().has(o)))return{success:!1,message:`Plugin "${e}" is already ${t?`enabled`:`disabled`}${n?` at ${n} scope`:``}`};let p;if(!t){let{enabled:e,disabled:t}=await L(),n=M(o,[...e,...t]);n.length>0&&(p=n)}let{error:m}=i(l,{enabledPlugins:{...r(l)?.enabledPlugins,[o]:t}});if(m)return{success:!1,message:`Failed to ${a} plugin: ${m.message}`};j();let{name:h}=V(o),g=N(p);return{success:!0,message:`Successfully ${a}d plugin: ${h} (scope: ${s})${g}`,pluginId:o,pluginName:h,scope:s,reverseDependents:p}}async function _e(e,t){return X(e,!0,t)}async function ve(e,t){return X(e,!1,t)}async function Z(){let e=G();if(e.size===0)return{success:!0,message:`No enabled plugins to disable`};let t=[],n=[];for(let[r]of e){let e=await X(r,!1);e.success?t.push(r):n.push(`${r}: ${e.message}`)}return n.length>0?{success:!1,message:`Disabled ${t.length} ${p(t.length,`plugin`)}, ${n.length} failed:\n${n.join(`
2
+ `)}`}:{success:!0,message:`Disabled ${t.length} ${p(t.length,`plugin`)}`}}async function ye(e,t){let{name:n,marketplace:r}=V(e),i=r?`${n}@${r}`:e,a=await x(e);if(!a)return{success:!1,message:`Plugin "${n}" not found`,pluginId:i,scope:t};let{entry:o,marketplaceInstallLocation:s}=a,c=S().plugins[i];if(!c||c.length===0)return{success:!1,message:`Plugin "${n}" is not installed`,pluginId:i,scope:t};let l=J(t),u=c.find(e=>e.scope===t&&e.projectPath===l);return u?be({pluginId:i,pluginName:n,entry:o,marketplaceInstallLocation:s,installation:u,scope:t,projectPath:l}):{success:!1,message:`Plugin "${n}" is not installed at scope ${l?`${t} (${l})`:t}`,pluginId:i,scope:t}}async function be({pluginId:e,pluginName:t,entry:n,marketplaceInstallLocation:r,installation:i,scope:a,projectPath:s}){let c=u(),l=i.version,d,f,p=!1,m;if(typeof n.source!=`string`){let t=await oe(n.source,{manifest:{name:n.name}});d=t.path,p=!0,m=t.gitCommitSha,f=await w(e,n.source,t.manifest,t.path,n.version,t.gitCommitSha)}else{let t;try{t=await c.stat(r)}catch(t){if(o(t))return{success:!1,message:`Marketplace directory not found at ${r}`,pluginId:e,scope:a};throw t}d=K(t.isDirectory()?r:le(r),n.source);try{await c.stat(d)}catch(t){if(o(t))return{success:!1,message:`Plugin source not found at ${d}`,pluginId:e,scope:a};throw t}let i,s=K(d,`.claude-plugin`,`plugin.json`);try{i=await I(s,n.name,n.source)}catch{}f=await w(e,n.source,i,d,n.version)}try{let r=A(e,f),o=D(e,f);if(i.version===f||i.installPath===r||i.installPath===o)return{success:!0,message:`${t} is already at the latest version (${f}).`,pluginId:e,newVersion:f,oldVersion:l,alreadyUpToDate:!0,scope:a};r=await ne(d,e,f,n);let c=i.installPath;if(g(e,a,s,r,f,m),c&&c!==r){let e=S();Object.values(e.plugins).some(e=>e.some(e=>e.installPath===c))||await E(c)}let u=s?`${a} (${s})`:a;return{success:!0,message:`Plugin "${t}" updated from ${l||`unknown`} to ${f} for scope ${u}. Restart to apply changes.`,pluginId:e,newVersion:f,oldVersion:l,scope:a}}finally{p&&d!==A(e,f)&&await c.rm(d,{recursive:!0,force:!0})}}var Q,$,xe=e((()=>{t(),H(),c(),l(),d(),k(),re(),ee(),se(),h(),z(),F(),P(),O(),C(),W(),ae(),a(),m(),Q=[`user`,`project`,`local`],$=[`user`,`project`,`local`,`managed`]}));export{_e as a,he as c,ge as d,ye as f,ve as i,ue as l,$ as n,Y as o,Z as r,xe as s,Q as t,de as u};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Qa as t,fs as n,lo as r,oo as i,us as a}from"./paths-DO4WOQtD.js";import{l as o,p as s}from"./debug-otxXY3j-.js";import{n as c,t as l}from"./cwd--iizewsn.js";import{o as u,s as d}from"./log-DSV4Ht5l.js";import{Ds as f,Ks as p,Ms as m,Ss as h,aj as g,oj as _,qs as v,ws as y}from"./loadAgentsDir-ClTeo0nk.js";import{i as b,s as x}from"./xml-CTdKuU6f.js";import{join as S}from"path";function C(){let e=new Map,n=g();for(let[t,r]of Object.entries(n))t.includes(`@`)&&(r===!0?e.set(t,`flag`):r===!1&&e.delete(t));for(let{scope:r,source:i}of[{scope:`managed`,source:`policySettings`},{scope:`user`,source:`userSettings`},{scope:`project`,source:`projectSettings`},{scope:`local`,source:`localSettings`},{scope:`flag`,source:`flagSettings`}]){let a=t(i);if(a?.enabledPlugins)for(let[t,o]of Object.entries(a.enabledPlugins))t.includes(`@`)&&(t in n&&n[t]!==o&&s(`Plugin ${t} from --add-dir (${n[t]}) overridden by ${i} (${o})`),o===!0?e.set(t,r):o===!1&&e.delete(t))}return s(`Found ${e.size} enabled plugins with scopes: ${Array.from(e.entries()).map(([e,t])=>`${e}(${t})`).join(`, `)}`),e}async function w(e,i,a=`user`){let o=a===`user`?void 0:l(),s=x(a),c=t(s),u={...c?.enabledPlugins},m=[],g=[];for(let t=0;t<e.length;t++){let r=e[t];if(r){i&&i(r,t+1,e.length);try{let e=await p(r);if(!e){g.push({name:r,error:`Plugin not found in any marketplace`});continue}let{entry:t,marketplaceInstallLocation:i}=e;n(t.source)?f({pluginId:r,installPath:S(i,t.source),version:t.version},a,o):await h(r,t,a,o),u[r]=!0,m.push(r)}catch(e){let t=e instanceof Error?e.message:String(e);g.push({name:r,error:t}),d(e)}}}return r(s,{...c,enabledPlugins:u}),{installed:m,failed:g}}var T=e((()=>{c(),o(),u(),i(),_(),m(),v(),b(),y(),a()}));export{T as n,w as r,C as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./pluginStartupCheck-D6IbyWKe.js";e();export{t as getPluginEditableScopes};
@@ -0,0 +1,4 @@
1
+ import{n as e,t}from"./figures-gfT9mM8P.js";import{Or as n,cn as r}from"./state-sIHsFpDu.js";import{E as i,O as a,U as o,z as s}from"./debug-otxXY3j-.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{o as u,s as d}from"./log-DSV4Ht5l.js";import{l as f,o as p}from"./stringUtils-KZoO4GUd.js";import{$s as m,Is as h,Js as g,Ms as _,Rs as v,Vs as y,Xs as ee,Zs as te,ac as b,cj as x,dc as S,gc as C,hc as w,nT as T,pc as ne,qs as E,sj as D,tT as O,tc as k,vs as A,ys as j}from"./loadAgentsDir-ClTeo0nk.js";import{i as M,o as N,s as P}from"./xml-CTdKuU6f.js";import{n as F,t as I}from"./exit-DOBLl8jN.js";import{n as L,t as R}from"./pluginOperations-CKmwDC3G.js";import{a as z,i as B,n as V,o as H,r as U,t as W}from"./pluginCliCommands-DWCeXYTl.js";import{a as re,c as G,i as K,n as q,r as J,s as Y,t as X}from"./validatePlugin-_g0AqWZG.js";import{basename as ie,dirname as Z}from"path";e(),r(),c(),x(),o(),u(),C(),G(),_(),S(),E(),O(),K(),M(),A(),X(),i(),p();function Q(e,n){d(e),I(`${t.cross} Failed to ${n}: ${s(e)}`)}function $(e){e.errors.length>0&&(console.log(`${t.cross} Found ${e.errors.length} ${f(e.errors.length,`error`)}:\n`),e.errors.forEach(e=>{console.log(` ${t.pointer} ${e.path}: ${e.message}`)}),console.log(``)),e.warnings.length>0&&(console.log(`${t.warning} Found ${e.warnings.length} ${f(e.warnings.length,`warning`)}:\n`),e.warnings.forEach(e=>{console.log(` ${t.pointer} ${e.path}: ${e.message}`)}),console.log(``))}async function ae(e,r){r.cowork&&n(!0);try{let n=await q(e);console.log(`Validating ${n.fileType} manifest: ${n.filePath}\n`),$(n);let r=[];if(n.fileType===`plugin`){let e=Z(n.filePath);if(ie(e)===`.claude-plugin`){r=await J(Z(e));for(let e of r)console.log(`Validating ${e.fileType}: ${e.filePath}\n`),$(e)}}let i=n.success&&r.every(e=>e.success),a=n.warnings.length>0||r.some(e=>e.warnings.length>0);i?F(a?`${t.tick} Validation passed with warnings`:`${t.tick} Validation passed`):(console.log(`${t.cross} Validation failed`),process.exit(1))}catch(e){d(e),console.error(`${t.cross} Unexpected error during validation: ${s(e)}`),process.exit(2)}}async function oe(e){e.cowork&&n(!0),l(`tengu_plugin_list_command`,{});let r=v(),{getPluginEditableScopes:i}=await import(`./pluginStartupCheck-cYnLsWOs.js`),o=i(),s=Object.keys(r.plugins),{enabled:c,disabled:u,errors:d}=await j(),f=[...c,...u],p=f.filter(e=>e.source.endsWith(`@inline`)),m=d.filter(e=>e.source.endsWith(`@inline`)||e.source.startsWith(`inline[`));if(e.json){let t=new Map(f.map(e=>[e.source,e])),n=[];for(let e of s.sort()){let i=r.plugins[e];if(!i||i.length===0)continue;let a=N(e).name,s=d.filter(t=>t.source===e||`plugin`in t&&t.plugin===a).map(D);for(let r of i){let i=t.get(e),a;if(i){let e=i.mcpServers||await T(i);e&&Object.keys(e).length>0&&(a=e)}n.push({id:e,version:r.version||`unknown`,scope:r.scope,enabled:o.has(e),installPath:r.installPath,installedAt:r.installedAt,lastUpdated:r.lastUpdated,projectPath:r.projectPath,mcpServers:a,errors:s.length>0?s:void 0})}}for(let e of p){let t=e.mcpServers||await T(e),r=m.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name).map(D);n.push({id:e.source,version:e.manifest.version??`unknown`,scope:`session`,enabled:e.enabled!==!1,installPath:e.path,mcpServers:t&&Object.keys(t).length>0?t:void 0,errors:r.length>0?r:void 0})}for(let e of m.filter(e=>e.source.startsWith(`inline[`)))n.push({id:e.source,version:`unknown`,scope:`session`,enabled:!1,installPath:`path`in e?e.path:``,errors:[D(e)]});if(e.available){let e=[];try{let[t,n]=await Promise.all([g(),Y()]),{marketplaces:r}=await ne(t);for(let{name:t,data:i}of r)if(i)for(let r of i.plugins){let i=b(r.name,t);h(i)||e.push({pluginId:i,name:r.name,description:r.description,marketplaceName:t,version:r.version,source:r.source,installCount:n?.get(i)})}}catch{}F(a({installed:n,available:e},null,2))}else F(a(n,null,2))}s.length===0&&p.length===0&&m.length===0&&F("No plugins installed. Use `claude plugin install` to install a plugin."),s.length>0&&console.log(`Installed plugins:
2
+ `);for(let e of s.sort()){let n=r.plugins[e];if(!n||n.length===0)continue;let i=N(e).name,a=d.filter(t=>t.source===e||`plugin`in t&&t.plugin===i);for(let r of n){let n=o.has(e),i=a.length>0?`${t.cross} failed to load`:n?`${t.tick} enabled`:`${t.cross} disabled`,s=r.version||`unknown`,c=r.scope;console.log(` ${t.pointer} ${e}`),console.log(` Version: ${s}`),console.log(` Scope: ${c}`),console.log(` Status: ${i}`);for(let e of a)console.log(` Error: ${D(e)}`);console.log(``)}}if(p.length>0||m.length>0){console.log(`Session-only plugins (--plugin-dir):
3
+ `);for(let e of p){let n=m.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name),r=n.length>0?`${t.cross} loaded with errors`:`${t.tick} loaded`;console.log(` ${t.pointer} ${e.source}`),console.log(` Version: ${e.manifest.version??`unknown`}`),console.log(` Path: ${e.path}`),console.log(` Status: ${r}`);for(let e of n)console.log(` Error: ${D(e)}`);console.log(``)}for(let e of m.filter(e=>e.source.startsWith(`inline[`)))console.log(` ${t.pointer} ${e.source}: ${t.cross} ${D(e)}\n`)}F()}async function se(e,r){r.cowork&&n(!0);try{let n=await re(e);n||I(`${t.cross} Invalid marketplace source format. Try: owner/repo, https://..., or ./path`),`error`in n&&I(`${t.cross} ${n.error}`);let i=r.scope??`user`;i!==`user`&&i!==`project`&&i!==`local`&&I(`${t.cross} Invalid scope '${i}'. Use: user, project, or local`);let a=P(i),o=n;r.sparse&&r.sparse.length>0&&(o.source===`github`||o.source===`git`?o={...o,sparsePaths:r.sparse}:I(`${t.cross} --sparse is only supported for github and git marketplace sources (got: ${o.source})`)),console.log(`Adding marketplace...`);let{name:s,alreadyMaterialized:c,resolvedSource:u}=await y(o,e=>{console.log(e)});k(s,{source:u},a),w();let d=o.source;o.source===`github`&&(d=o.repo),l(`tengu_marketplace_added`,{source_type:d}),F(c?`${t.tick} Marketplace '${s}' already on disk — declared in ${i} settings`:`${t.tick} Successfully added marketplace: ${s} (declared in ${i} settings)`)}catch(e){Q(e,`add marketplace`)}}async function ce(e){e.cowork&&n(!0);try{let n=await g(),r=Object.keys(n);e.json&&F(a(r.sort().map(e=>{let t=n[e],r=t?.source;return{name:e,source:r?.source,...r?.source===`github`&&{repo:r.repo},...r?.source===`git`&&{url:r.url},...r?.source===`url`&&{url:r.url},...r?.source===`directory`&&{path:r.path},...r?.source===`file`&&{path:r.path},installLocation:t?.installLocation}}),null,2)),r.length===0&&F(`No marketplaces configured`),console.log(`Configured marketplaces:
4
+ `),r.forEach(e=>{let r=n[e];if(console.log(` ${t.pointer} ${e}`),r?.source){let e=r.source;e.source===`github`?console.log(` Source: GitHub (${e.repo})`):e.source===`git`?console.log(` Source: Git (${e.url})`):e.source===`url`?console.log(` Source: URL (${e.url})`):e.source===`directory`?console.log(` Source: Directory (${e.path})`):e.source===`file`&&console.log(` Source: File (${e.path})`)}console.log(``)}),F()}catch(e){Q(e,`list marketplaces`)}}async function le(e,r){r.cowork&&n(!0);try{await m(e),w(),l(`tengu_marketplace_removed`,{marketplace_name:e}),F(`${t.tick} Successfully removed marketplace: ${e}`)}catch(e){Q(e,`remove marketplace`)}}async function ue(e,r){r.cowork&&n(!0);try{if(e)console.log(`Updating marketplace: ${e}...`),await te(e,e=>{console.log(e)}),w(),l(`tengu_marketplace_updated`,{marketplace_name:e}),F(`${t.tick} Successfully updated marketplace: ${e}`);else{let e=await g(),n=Object.keys(e);n.length===0&&F(`No marketplaces configured`),console.log(`Updating ${n.length} marketplace(s)...`),await ee(),w(),l(`tengu_marketplace_updated_all`,{count:n.length}),F(`${t.tick} Successfully updated ${n.length} marketplace(s)`)}}catch(e){Q(e,`update marketplace(s)`)}}async function de(e,t){t.cowork&&n(!0);let r=t.scope||`user`;t.cowork&&r!==`user`&&I(`--cowork can only be used with user scope`),R.includes(r)||I(`Invalid scope: ${r}. Must be one of: ${R.join(`, `)}.`);let{name:i,marketplace:a}=N(e);l(`tengu_plugin_install_command`,{_PROTO_plugin_name:i,...a&&{_PROTO_marketplace_name:a},scope:r}),await B(e,r)}async function fe(e,t){t.cowork&&n(!0);let r=t.scope||`user`;t.cowork&&r!==`user`&&I(`--cowork can only be used with user scope`),R.includes(r)||I(`Invalid scope: ${r}. Must be one of: ${R.join(`, `)}.`);let{name:i,marketplace:a}=N(e);l(`tengu_plugin_uninstall_command`,{_PROTO_plugin_name:i,...a&&{_PROTO_marketplace_name:a},scope:r}),await z(e,r,t.keepData)}async function pe(e,t){t.cowork&&n(!0);let r;t.scope&&(R.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${R.join(`, `)}`),r=t.scope),t.cowork&&r!==void 0&&r!==`user`&&I(`--cowork can only be used with user scope`),t.cowork&&r===void 0&&(r=`user`);let{name:i,marketplace:a}=N(e);l(`tengu_plugin_enable_command`,{_PROTO_plugin_name:i,...a&&{_PROTO_marketplace_name:a},scope:r??`auto`}),await U(e,r)}async function me(e,t){if(t.all&&e&&I(`Cannot use --all with a specific plugin`),!t.all&&!e&&I(`Please specify a plugin name or use --all to disable all plugins`),t.cowork&&n(!0),t.all){t.scope&&I(`Cannot use --scope with --all`),l(`tengu_plugin_disable_command`,{}),await W();return}let r;t.scope&&(R.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${R.join(`, `)}`),r=t.scope),t.cowork&&r!==void 0&&r!==`user`&&I(`--cowork can only be used with user scope`),t.cowork&&r===void 0&&(r=`user`);let{name:i,marketplace:a}=N(e);l(`tengu_plugin_disable_command`,{_PROTO_plugin_name:i,...a&&{_PROTO_marketplace_name:a},scope:r??`auto`}),await V(e,r)}async function he(e,t){t.cowork&&n(!0);let{name:r,marketplace:i}=N(e);l(`tengu_plugin_update_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i}});let a=`user`;t.scope&&(L.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${L.join(`, `)}`),a=t.scope),t.cowork&&a!==`user`&&I(`--cowork can only be used with user scope`),await H(e,a)}export{se as marketplaceAddHandler,ce as marketplaceListHandler,le as marketplaceRemoveHandler,ue as marketplaceUpdateHandler,me as pluginDisableHandler,pe as pluginEnableHandler,de as pluginInstallHandler,oe as pluginListHandler,fe as pluginUninstallHandler,he as pluginUpdateHandler,ae as pluginValidateHandler};
@@ -0,0 +1 @@
1
+ import{Ka as e,Qa as t,Wa as n}from"./loadAgentsDir-ClTeo0nk.js";n();export{e as isPolicyAllowed,t as waitForPolicyLimitsToLoad};
@@ -0,0 +1 @@
1
+ import{Cn as e,wn as t}from"./schemas-BGAvj1T4.js";import{t as n}from"./v4-f1i_CNUT.js";import{S as r,v as i}from"./paths-DO4WOQtD.js";import{n as a,t as o}from"./lazySchema-B0QShMaQ.js";n(),o(),r();var s=2e3,c=6e5,l={poll_interval_ms_not_at_capacity:s,poll_interval_ms_at_capacity:c,non_exclusive_heartbeat_interval_ms:0,multisession_poll_interval_ms_not_at_capacity:s,multisession_poll_interval_ms_partial_capacity:s,multisession_poll_interval_ms_at_capacity:c,reclaim_older_than_ms:5e3,session_keepalive_interval_v2_ms:12e4},u={message:`must be 0 (disabled) or ≥100ms`},d=a(()=>t({poll_interval_ms_not_at_capacity:e().int().min(100),poll_interval_ms_at_capacity:e().int().refine(e=>e===0||e>=100,u),non_exclusive_heartbeat_interval_ms:e().int().min(0).default(0),multisession_poll_interval_ms_not_at_capacity:e().int().min(100).default(l.multisession_poll_interval_ms_not_at_capacity),multisession_poll_interval_ms_partial_capacity:e().int().min(100).default(l.multisession_poll_interval_ms_partial_capacity),multisession_poll_interval_ms_at_capacity:e().int().refine(e=>e===0||e>=100,u).default(l.multisession_poll_interval_ms_at_capacity),reclaim_older_than_ms:e().int().min(1).default(5e3),session_keepalive_interval_v2_ms:e().int().min(0).default(12e4)}).refine(e=>e.non_exclusive_heartbeat_interval_ms>0||e.poll_interval_ms_at_capacity>0,{message:`at-capacity liveness requires non_exclusive_heartbeat_interval_ms > 0 or poll_interval_ms_at_capacity > 0`}).refine(e=>e.non_exclusive_heartbeat_interval_ms>0||e.multisession_poll_interval_ms_at_capacity>0,{message:`at-capacity liveness requires non_exclusive_heartbeat_interval_ms > 0 or multisession_poll_interval_ms_at_capacity > 0`}));function f(){let e=i(`tengu_bridge_poll_interval_config`,l,300*1e3),t=d().safeParse(e);return t.success?t.data:l}export{l as n,f as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./store-DYC8zeL1.js";t();function n(){let e=process.env.OPENAI_BASE_URL;return e&&/\bapi\.deepseek\.com\b/i.test(e)?e.replace(/\/+$/,``):process.env.DEEPSEEK_API_KEY?`https://api.deepseek.com`:null}function r(){return process.env.DEEPSEEK_API_KEY||process.env.OPENAI_API_KEY||null}var i={providerId:`deepseek`,isEnabled(){return n()!==null&&r()!==null},async fetchBalance(e){let t=n(),i=r();if(!t||!i)return null;let a;try{a=await fetch(`${t}/user/balance`,{method:`GET`,headers:{Authorization:`Bearer ${i}`,Accept:`application/json`},signal:e})}catch{return null}if(!a.ok)return null;let o;try{o=await a.json()}catch{return null}let s=o?.balance_infos;if(!Array.isArray(s))return null;let c=s.find(e=>typeof e==`object`&&!!e&&e.currency===`USD`)??s[0]??null;if(!c)return null;let l=typeof c.currency==`string`?c.currency:`USD`,u=c.total_balance,d=typeof u==`number`?u:Number(u);return Number.isFinite(d)?{currency:l,remaining:d,updatedAt:Math.floor(Date.now()/1e3)}:null}};function a(e,t){if(!t)return e;let n=t.split(`.`).filter(Boolean),r=e;for(let e of n){if(r==null)return;if(Array.isArray(r)){let t=Number(e);if(!Number.isFinite(t))return;r=r[t]}else if(typeof r==`object`)r=r[e];else return}return r}var o=/^(10\.|192\.168\.|172\.(1[6-9]|2\d|3[01])\.|169\.254\.|127\.|0\.0\.0\.0|fc|fd|\[::1\]|\[fe80:)/;function s(e){let t=new URL(e);if(t.protocol!==`https:`&&t.protocol!==`http:`)throw Error(`unsupported protocol: ${t.protocol}`);if(t.protocol===`http:`&&![`localhost`,`127.0.0.1`,`[::1]`].includes(t.hostname))throw Error(`http only allowed for localhost, got ${t.hostname}`);if(o.test(t.hostname))throw Error(`private/reserved IP not allowed: ${t.hostname}`);return t}var c={providerId:`generic`,isEnabled(){return!!process.env.CLAUDE_CODE_BALANCE_URL},async fetchBalance(e){let t=process.env.CLAUDE_CODE_BALANCE_URL;if(!t)return null;let n;try{n=s(t)}catch{return null}let r=process.env.CLAUDE_CODE_BALANCE_KEY||process.env.OPENAI_API_KEY||process.env.ANTHROPIC_API_KEY||``,i=process.env.CLAUDE_CODE_BALANCE_JSON_PATH||`balance`,o=process.env.CLAUDE_CODE_BALANCE_CURRENCY||`USD`,c;try{c=await fetch(n.href,{method:`GET`,headers:{Accept:`application/json`,...r?{Authorization:`Bearer ${r}`}:{}},signal:e})}catch{return null}if(!c.ok)return null;let l;try{l=await c.json()}catch{return null}let u=a(l,i),d=typeof u==`number`?u:Number(u);return Number.isFinite(d)?{currency:o,remaining:d,updatedAt:Math.floor(Date.now()/1e3)}:null}},l=10,u=[c,i];function d(){return process.env.CLAUDE_CODE_BALANCE_PROVIDER===`none`?null:u.find(e=>e.isEnabled())??null}function f(){let e=process.env.CLAUDE_CODE_BALANCE_POLL_INTERVAL_MINUTES,t=e?Number(e):l;return!Number.isFinite(t)||t<=0?l*6e4:Math.floor(t*6e4)}var p=null,m=null,h=null,g=1e4;async function _(){if(!h)return;m?.abort(),m=new AbortController;let t=setTimeout(()=>m?.abort(),g);try{let t=await h.fetchBalance(m.signal);e(h.providerId,t)}catch{}finally{clearTimeout(t)}}function v(){p===null&&(h=d(),h&&(_(),p=setInterval(()=>{_()},f()),typeof p.unref==`function`&&p.unref()))}export{v as startBalancePolling};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{i as t,n,t as r}from"./poorMode-mtlnXU-z.js";var i;e((()=>{r(),i=async(e,r)=>{let i=!n();return t(i),i?r.setAppState(e=>({...e,promptSuggestionEnabled:!1})):r.setAppState(e=>({...e,promptSuggestionEnabled:!0})),{type:`text`,value:`Poor mode ${i?`ON`:`OFF`} — ${i?`extract_memories and prompt_suggestion are disabled`:`extract_memories and prompt_suggestion are restored`}`}}}))();export{i as call};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./poorMode-mtlnXU-z.js";t();export{e as isPoorModeActive};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{Ka as n,lo as r,oo as i}from"./paths-DO4WOQtD.js";var a=t({isPoorModeActive:()=>o,setPoorMode:()=>s});function o(){return c===null&&(c=n().poorMode===!0),c}function s(e){c=e,r(`userSettings`,{poorMode:e||void 0})}var c,l=e((()=>{i(),c=null}));export{s as i,o as n,a as r,l as t};
@@ -0,0 +1,39 @@
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,Et as oe,Fa as T,Ki as se,Ma as E,Na as ce,Ot as D,Pr as O,Qo as le,Rr as ue,S as de,Si as fe,Xn as pe,Xo as me,Yn as k,_ as he,a as ge,bl as _e,c as ve,cl as ye,hl as A,kt as be,ll as xe,ml as Se,no as Ce,on as j,oo as we,pi as Te,qi as Ee,rs as De,to as Oe,us as M,vi as ke,xi as N,xl as Ae,yi as je,zo as Me}from"./paths-DO4WOQtD.js";import{D as Ne,E as Pe,J as Fe,O as P,Q as Ie,U as Le,Z as Re,_ as ze,h as Be,l as F,p as I,u as L,z as R}from"./debug-otxXY3j-.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-C0IuvuIy.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-DSV4Ht5l.js";import{i as Qe,n as $e}from"./path-BE28AJwZ.js";import{s as et,u as tt}from"./types-KeqFPzY5.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-CbskW5G9.js";import{n as ct,t as lt}from"./sleep-C6koP5Ka.js";import{$C as ut,$D as dt,$T as ft,$v as pt,Ay as mt,BA as ht,Bc as gt,Bf as _t,CD as vt,CE as K,Cc as yt,Cg as bt,Cn as xt,D as St,DD as Ct,DO as wt,Dc as Tt,Dg as Et,Dj as Dt,Dn as Ot,ED as kt,Ec as At,Eg as jt,Ey as Mt,F as Nt,FA as Pt,Fb as Ft,Fr as It,Fw as Lt,G as Rt,GO as zt,Gi as Bt,Gt as Vt,Gv as Ht,Hc as Ut,Hs as Wt,Hw as Gt,IC as Kt,IE as qt,Ij as Jt,Iw as Yt,Ji as Xt,Ju as Zt,Jv as Qt,Jx as $t,K as en,KE as tn,KO as nn,Ka as rn,Kw as an,Kx as on,LE as sn,LO as cn,Ll as ln,MA as un,Mi as dn,Ni as fn,Nr as pn,O as mn,OD as hn,Oj as gn,On as _n,Ow as vn,Pr as yn,QO as bn,Qs as xn,Qv as Sn,Qx as Cn,RC as wn,RE as Tn,RO as En,Rj as Dn,Rl as On,Rw as kn,S as An,SD as jn,SE as Mn,Sc as Nn,Sy as Pn,TE as Fn,Tc as In,Tj as Ln,Tw as Rn,Ty as zn,Uo as Bn,Us as Vn,Vc as Hn,Vw as Un,WA as Wn,WO as Gn,Wa as Kn,XE as qn,Xb as Jn,YE as Yn,YO as Xn,Yb as Zn,Ys as Qn,Yv as $n,Yx as er,Zi as tr,Zu as nr,_i as rr,_p as ir,ak as ar,bc as or,bi as sr,bs as cr,cE as lr,cO as ur,cb as dr,cu as fr,dO as pr,ds as mr,du as hr,dv as gr,eE as _r,eO as vr,ew as yr,ey as br,fO as xr,fs as Sr,gD as Cr,gO as wr,gi as Tr,gj as Er,gp as Dr,hD as Or,hE as kr,hO as Ar,ha as jr,hg as Mr,hw as Nr,iD as Pr,iS as Fr,ii as Ir,ik as Lr,jj as Rr,jy as zr,lO as Br,lr as Vr,lu as Hr,mC as Ur,mO as Wr,mr as Gr,ms as Kr,nD as qr,na as Jr,nw as Yr,o as Xr,oO as q,p as Zr,pC as Qr,pE as $r,pO as ei,qE as ti,qs as ni,qu as ri,rS as ii,s as ai,sO as oi,sb as si,tS as ci,ty as li,u as ui,uO as di,uv as fi,vE as pi,vO as mi,vc as hi,vs as gi,w as _i,wD as vi,wE as yi,wO as bi,wc as xi,wi as Si,wy as Ci,x as wi,xc as Ti,xi as Ei,yE as Di,yO as Oi,yc as ki,yo as Ai,zC as ji,zE as Mi,zO as J,zb as Ni,zc as Pi,zf as Fi}from"./loadAgentsDir-ClTeo0nk.js";import{$n as Ii,$t as Li,F as Ri,Gt as zi,M as Bi,Mn as Vi,Ot as Hi,Qn as Ui,Wt as Wi,kt as Gi,wn as Ki}from"./prompt-CfM_xGPc.js";import{i as qi,o as Ji}from"./xml-CTdKuU6f.js";import{a as Yi,o as Xi,s as Zi}from"./fileStateCache-BhVfo23e.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-CwU_wJBE.js";import{c as pa,l as ma}from"./commitAttribution-csu3NO7Y.js";import{P as ha,V as ga,a as _a,d as va}from"./teamHelpers-CXAmvFco.js";import{t as ya}from"./pollConfig-C3NjXYFc.js";import{r as ba}from"./inboundAttachments-D4tBPCB8.js";import{i as xa,n as Sa,s as Ca}from"./mappers-7BSMbYvH.js";import{n as wa,r as Ta}from"./sessionTitle-CkrnWEW1.js";import{n as Ea,t as Da}from"./ccrClient-C1msT1E3.js";import{n as Oa,t as ka}from"./HybridTransport-Bok4-Ptt.js";import{n as Aa,t as ja}from"./SSETransport-kEH_p4Yq.js";import{t as Ma}from"./pluginBlocklist-B8DKXi0i.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-CWlu9ZWs.js";import{t as Va}from"./onChangeAppState-C4ic-Mib.js";import{t as Ha}from"./settingsSync-Dn_lGonC.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-9OmmYmIT.js";import{i as $a,n as eo}from"./toolPool-Dgn1Clq8.js";import{n as to,r as no}from"./QueryEngine-C7r7O-hH.js";import{n as ro,r as io}from"./sideQuestion-C1qbLTAL.js";import{n as ao,r as oo}from"./context-noninteractive-62P5EnN5.js";import{a as so,o as co,t as lo}from"./skillChangeDetector-DQuNepIV.js";import{n as uo,t as fo}from"./refresh-B6X4xb9r.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(),Re(),Le(),Pe(),ze(),B(),F(),H(),U(),Ze(),Qe(),et(),G(),M(),we(),T(),E(),Ee(),O(),k(),lt(),j(),at(),de(),ge(),Ui(),Vi(),ht(),Pt(),nn(),di(),vr(),Cr(),ta(),ti(),ha(),yi(),lr(),na(),fi(),oa(),Hn(),gt(),Sr(),Bn(),Jr(),It(),_n(),xt(),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=L(),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: ${R(e)}`)),Mn(1,`other`)}),Ie(async()=>this.ccrClient?.close()),fn((e,t,n)=>this.ccrClient.writeInternalEvent(e,t,n)),dn(()=>this.ccrClient.readInternalEvents(),()=>this.ccrClient.readSubagentInternalEvents());let t={started:`processing`,completed:`processed`};xr((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: ${R(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()}};Ki(),Me(),Li(),zi(),[...Wi],Re(),F();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}))}ye(),le(),Jt(),Ln(),qi(),Gi(),Xi(),ra(),Ct(),Pr(),Un(),vn(),zr(),Sn(),Qt(),nr(),In(),ni(),gi(),en(),Xr(),Ba(),Na(),eo(),Ht(),Le(),Ze(),na(),Pn(),F(),yi();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)}}}_e(),Se(),ke(),Lr(),jn(),sn(),_r(),Ur(),Zn(),Ni(),On(),Kn(),_i(),Ta(),ro();function Do(e){if(e.toLowerCase().endsWith(`.jsonl`))return{sessionId:Y(),ingressUrl:null,isUrl:!1,jsonlFile:e,isJsonlFile:!0};if(gr(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(),bi(),wr(),ur(),ma(),pi(),ut(),Kt(),ci(),_t(),fr(),Sa(),oo(),F();async function Oo(){try{let e=await go(Nn(),`utf-8`),t=De().safeParse(Ne(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 hi(Nn(),P(e,null,2))}async function Ao(e,t){let n=Ti();if(!n)return;let r=await jo(t);r!==null&&await hi(mo(n,or(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 Qn();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(),Re(),F(),H(),Ze(),ni(),In();async function No(){let e=Tt();I(`installPluginsForHeadless: starting${e?` (zip cache mode)`:``}`);let t=await xn();t&&(Wt(),Kr(`headlessPluginInstall: seed marketplaces registered`)),e&&(await Be().mkdir(yt()),await Be().mkdir(xi()));let n=Object.keys(Vn()).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)=>!At(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&&(Wt(),Kr(`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&&Kr(`headlessPluginInstall: plugins changed`),e&&Ie(ki),i}catch(e){return W(e),!1}finally{z(`tengu_headless_plugin_install`,r)}}Ve(),F(),H(),di(),oa(),Ze(),B(),fi(),yi(),Re(),He(),_(),It(),Bn(),Pe(),r(),fo(),gi(),Mr(),_a(),qn(),si(),Dr(),Le();var Q=(Mi(),e(Tn)),$=(fa(),e($i)),Po=(Ya(),e(Ua)),Fo=(Za(),e(Qa)),Io=(Bi(),e(Ri)),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)),Wn.subscribe(e=>{Qr(e,n),N()&&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(),oi(),q(`runHeadless_entry`),await Di()&&await kr(),q(`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=un.getSandboxUnavailableReason();if(d){if(un.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(un.isSandboxingEnabled())try{await un.initialize(l.createSandboxAskCallback())}catch(e){process.stderr.write(`\n❌ Sandbox Error: ${R(e)}\n`),K(1,`other`);return}c.outputFormat===`stream-json`&&c.verbose&&Ut(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 br(c.setupTrigger),q(`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=li();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)}sr(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`&&(!!gr(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=Zt(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=>!Ii(e,c.permissionPromptToolName))),We(),q(`after_loadInitialMessages`),await C(),q(`after_modelStrings`);let b=c.outputFormat===`json`&&c.verbose,S=[],w;q(`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(Br(),ve())try{let{drainPendingExtraction:e}=await import(`./extractMemories-BP8Opsbp.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,T=null,E,D=e.outbound;process.on(`SIGINT`,()=>{Ge(`info`,`shutdown_signal`,{signal:`SIGINT`}),E&&!E.signal.aborted&&E.abort(),Mn(0)}),Ie(async()=>{let t={};for(let e of Yn(g()))dr(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},le;v.enableAuthStatus&&(le=se.getInstance().subscribe(e=>{D.enqueue({type:`auth_status`,isAuthenticating:e.isAuthenticating,output:e.output,error:e.error,uuid:Y(),session_id:u()})}));let de=e=>{let t=Ca(e);t&&D.enqueue({type:`rate_limit_event`,rate_limit_info:t,uuid:Y(),session_id:u()})};ar.add(de);let k=s,ge=qr(s,X(),100),_e=Yi(100),ve=process.env.CLAUDE_CODE_RESUME_INTERRUPTED_TURN;y&&y.kind!==`none`&&ve&&(I(`[print.ts] Auto-resuming interrupted turn (kind: ${y.kind})`),ts(k,y.message),J({mode:`prompt`,value:y.message.message.content,uuid:Y()}));let ye=Fi().map(e=>{let t=e.value===null?`default`:e.value,n=t===`default`?ie():w(t),r=Dt(n),i=Dn(n),a=fe(e.value),o=pe(n);return{name:t,value:t,displayName:e.label,description:e.description,...r&&{supportsEffort:!0,supportedEffortLevels:gn(n)?[...Er]:Er.filter(e=>e!==`max`)},...i&&{supportsAdaptiveThinking:!0},...a&&{supportsFastMode:!0},...o&&{supportsAutoMode:!0}}}),Se=v.userSpecifiedModel;function Ce(e,t){let n=Ai(e,ue(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 wn(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 ji(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}`),Vt({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 Fr(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(me(t)))),...we]}})),hn(j)}}De();let M={clients:[],tools:[],configs:{}},ke=e=>{let t=ri(e.toolPermissionContext,e.mcp.tools),n=xe($a([...o,...we,...M.tools],t,e.toolPermissionContext.mode),`name`);v.permissionPromptToolName&&(n=n.filter(e=>!Ii(e,v.permissionPromptToolName)));let r=p();if(r&&!v.jsonSchema){let e=Hi(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 Ne=Promise.resolve({response:{added:[],removed:[],errors:{}},sdkServersChanged:!1});function Pe(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(me(t)))),...we]}}))}return{response:n.response,sdkServersChanged:n.sdkServersChanged}};return Ne=Ne.then(t,t),Ne}function Le(){let e=g(),t=e.mcp.clients,n=xe([...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`?Rn(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`,()=>$r())]),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),F=a,L=te;async function Ve(){let{agentDefinitions:e}=await uo(_);F=await tr(X());let t=L.filter(e=>e.source===`flagSettings`);L=[...e.allAgents,...t]}async function He(){let{servers:e}=await Yt(),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 Pe(t);r&&De(),I(`Headless MCP refresh: added=${n.added.length}, removed=${n.removed.length}`)}let Ue=lo.subscribe(()=>{Bt(),tr(X()).then(e=>{F=e})}),We=()=>{setTimeout(()=>{!$?.isProactiveActive()||$.isProactivePaused()||C||(async()=>{let e=await Oi({basePrompt:`<${qe}>${new Date().toLocaleTimeString()}</${qe}>`,currentDir:X(),shouldCreate:()=>!C});if(C){await ei({commands:e});return}for(let t of e)J({...t,uuid:Y()});B()})().catch(e=>{W(e),I(`[Proactive] failed to create headless tick: ${e}`,{level:`error`})})},0)};bn(()=>{E&&Gn(`now`).length>0&&E.abort(`interrupt`)});let B=async()=>{if(x)return;if(x=!0,S=void 0,ca(`running`),Be.stop(),q(`run_entry`),await De(),q(`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-DVZmzYLl.js`);t()}let t=e=>e.agentId===void 0;try{let r,i=!1,a=async()=>{for(;r=cn(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,Xn(t));)i.push(cn(t));let a=await Wr(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=ke(s);for(let e of o)pr(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`&&vt(O.lastEmitted.text,e,O.lastEmitted.emittedAt,O.lastEmitted.promptId,O.lastEmitted.generationRequestId),O.lastEmitted=null}E=dt(),q(`before_ask`),hr();let h=r,ee=!1;try{if(await be(h.workload??v.workload,async()=>{for await(let t of to({commands:xe([...F,...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?ge:Zi(ge,_e),setReadFileCache:e=>{ge=e;for(let[e,t]of _e.entries()){let n=ge.get(e);(!n||t.timestamp>n.timestamp)&&ge.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:L,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);Yn(g()).some(e=>(e.type===`local_agent`||e.type===`local_workflow`)&&dr(e))?T=t:(T=null,D.enqueue(t))}else{for(let e of Qi())D.enqueue(e);D.enqueue(t)}}),ee)await Ar({commands:f,outcome:{type:`failed`,message:`ask() returned an error result`},currentDir:X(),priority:`later`,workload:h.workload??v.workload});else{let e=await Ar({commands:f,outcome:{type:`completed`},currentDir:X(),priority:`later`,workload:h.workload??v.workload});for(let t of e)J({...t,uuid:Y()})}}catch(e){throw await Ar({commands:f,outcome:{type:`failed`,error:e},currentDir:X(),priority:`later`,workload:h.workload??v.workload}),e}for(let e of o)pr(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=ln();if(!t)vi(`sdk_no_params`,void 0,void 0,`sdk`);else{let n={promise:null};n.promise=(async()=>{try{let n=await kt(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};T?(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`)){vi(`aborted`,void 0,void 0,`sdk`);return}W(Fe(e))}finally{O.inflightPromise===n.promise&&(O.inflightPromise=null)}})(),O.inflightPromise=n.promise}}Br(),Hr(),oi()}};do{for(let e of Qi())D.enqueue(e);S=`draining_commands`,await a(),i=!1;{let e=Yn(g()).some(e=>dr(e)&&e.type!==`in_process_teammate`),n=Xn(t)!==void 0;(e||n)&&(i=!0,n||(S=`waiting_for_agents`,await ct(100)))}}while(i);T&&(D.enqueue(T),T=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:[R(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`,!Fn()){ca(`idle`);for(let e of Qi())D.enqueue(e)}x=!1,Be.start()}if($?.isProactiveActive()&&!$.isProactivePaused()&&Xn(t)===void 0&&!C){We();return}if(Xn(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 Et(e,t.teamContext?.teamName);if(n.length>0){I(`[print.ts] Team-lead found ${n.length} unread messages`),await jt(e,t.teamContext?.teamName);let r=t.teamContext?.teamName;for(let e of n){let n=bt(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}}}))}}J({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`),J({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)})()?(J({mode:`prompt`,value:Lo,uuid:Y()}),B()):(O.inflightPromise&&await Promise.race([O.inflightPromise,ct(5e3)]),O.abortController?.abort(),O.abortController=null,await Pi(),Ue(),le?.(),ar.delete(de),D.done()))},V=null;if(Io.isKairosCronEnabled()){let e=e=>{C||(async()=>{let t=await mi({basePrompt:e.basePrompt,trigger:`scheduled-task`,currentDir:X(),sourceId:e.sourceId,sourceLabel:e.sourceLabel,workload:oe,shouldCreate:()=>!C});if(t){if(C){await ei({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=>{J({...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 wt(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`&&pr(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,ye,e,!!v.enableAuthStatus,v,te,g),i.request.promptSuggestions&&_(e=>e.promptSuggestionEnabled?e:{...e,promptSuggestionEnabled:!0}),i.request.agentProgressSummaries&&he(`tengu_slate_prism`,!0)&&ee(!0),t=!0,zt()&&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:ke(e),agentDefinitions:e.agentDefinitions,customSystemPrompt:v.systemPrompt,appendSystemPrompt:v.appendSystemPrompt}})})}catch(e){U(i,R(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:En(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 Pe(i.request.servers);H(i,e),t&&De()}else if(i.request.subtype===`reload_plugins`)try{let e=await uo(_),t=L.filter(e=>e.source===`flagSettings`);L=[...e.agentDefinitions.allAgents,...t];let n=[],[r,a,o]=await Promise.allSettled([tr(X()),He(),cr()]);r.status===`fulfilled`?F=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:F.filter(e=>e.userInvocable!==!1).map(e=>({name:jr(e),description:Xt(e),argumentHint:e.argumentHint||``})),agents:L.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,R(e))}else if(i.request.subtype===`mcp_reconnect`){let e=g(),{serverName:t}=i.request;Te.delete(t);let n=kn(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 ii(t,n),r=me(t);_(n=>({...n,mcp:{...n.mcp,clients:n.mcp.clients.map(n=>n.name===t?e.client:n),tools:[...A(n.mcp.tools,e=>e.name?.startsWith(r)),...e.tools],commands:[...A(n.mcp.commands,e=>Nr(e,t)),...e.commands],resources:e.resources&&e.resources.length>0?{...n.mcp.resources,[t]:e.resources}:Ae(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=kn(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){an(t,!0);let e=await ii(t,a),n=me(t);_(r=>({...r,mcp:{...r.mcp,clients:r.mcp.clients.map(n=>n.name===t?e.client:n),tools:[...A(r.mcp.tools,e=>e.name?.startsWith(n)),...e.tools],commands:[...A(r.mcp.commands,e=>Nr(e,t)),...e.commands],resources:e.resources&&e.resources.length>0?{...r.mcp.resources,[t]:e.resources}:Ae(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{an(t,!1);let n=[...r,...j,...M.clients,...e.mcp.clients].find(e=>e.name===t);n&&n.type===`connected`&&await $t(t,a);let o=me(t);_(e=>({...e,mcp:{...e.mcp,clients:e.mcp.clients.map(e=>e.name===t?{name:t,type:`disabled`,config:a}:e),tools:A(e.mcp.tools,e=>e.name?.startsWith(o)),commands:A(e.mcp.commands,e=>Nr(e,t)),resources:Ae(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=kn(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=yr(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(Gt(e)||tt.has(e))return;let t=await ii(e,n),r=me(e);_(n=>({...n,mcp:{...n.mcp,clients:n.mcp.clients.map(n=>n.name===e?t.client:n),tools:[...A(n.mcp.tools,e=>e.name?.startsWith(r)),...t.tools],commands:[...A(n.mcp.commands,t=>Nr(t,e)),...t.commands],resources:t.resources&&t.resources.length>0?{...n.mcp.resources,[e]:t.resources}:Ae(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,R(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 ft,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 Jn(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,R(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:ce()}})},e=>U(i,R(e)))}else if(o.subtype===`mcp_clear_auth`){let e=o.serverName,t=g(),n=kn(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 Yr(e,n);let t=await ii(e,n),r=me(e);_(n=>({...n,mcp:{...n.mcp,clients:n.mcp.clients.map(n=>n.name===e?t.client:n),tools:[...A(n.mcp.tools,e=>e.name?.startsWith(r)),...t.tools],commands:[...A(n.mcp.commands,t=>Nr(t,e)),...t.commands],resources:t.resources&&t.resources.length>0?{...n.mcp.resources,[e]:t.resources}:Ae(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),Wn.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=Dt(t)?Rr(t,e.effortValue):void 0;H(i,{...Oe(),applied:{model:t,effort:typeof n==`string`?n:null}})}else if(i.request.subtype===`stop_task`){let{task_id:e}=i.request;try{await ir(e,{getAppState:g,setAppState:_}),H(i,{})}catch(e){U(i,R(e))}}else if(o.subtype===`generate_session_title`){let e=o.description,t=o.persist,n=(E&&!E.signal.aborted?E:dt()).signal;(async()=>{try{let r=await wa(e,n);if(r&&t)try{Ei(u(),r)}catch(e){W(e)}H(i,{title:r})}catch(e){U(i,R(e))}})()}else if(o.subtype===`side_question`){let e=o.question;(async()=>{try{let t=ln();H(i,{response:(await io({question:e,cacheSafeParams:t?{...t,toolUseContext:{...t.toolUseContext,abortController:dt()}}:await no({tools:ke(g()),commands:F,mcpClients:[...g().mcp.clients,...j,...M.clients],messages:k,readFileState:ge,getAppState:g,setAppState:_,customSystemPrompt:v.systemPrompt,appendSystemPrompt:v.appendSystemPrompt,thinkingConfig:v.thinkingConfig,agents:L})})).response})}catch(e){U(i,R(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:qt(N.bridgeSessionId,N.sessionIngressUrl),connect_url:Ft(N.environmentId,N.sessionIngressUrl),environment_id:N.environmentId});else{let t;try{let{initReplBridge:n}=await import(`./initReplBridge-99sUBVEk.js`),r=await n({onInboundMessage(e){let t=qa(e);if(!t)return;let{content:n,uuid:r}=t;J({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:qt(r.bridgeSessionId,r.sessionIngressUrl),connect_url:Ft(r.environmentId,r.sessionIngressUrl),environment_id:r.environmentId})):U(i,t??`Remote Control initialization failed`)}catch(e){U(i,R(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 Vr(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&&pr(o.uuid,`completed`);continue}Vo(o.uuid)}J({mode:`prompt`,value:await ba(o,o.message.content),uuid:o.uuid,priority:o.priority}),_(e=>({...e,attribution:pa(e.attribution,e=>{Ir(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 Pi(),Ue(),le?.(),ar.delete(de),D.done())})(),D}function qo(e){let t=async(n,r,i,a,o,s)=>{let c=s??await Rt(n,r,i,a,o);if(c.behavior===`allow`||c.behavior===`deny`)return c;let{signal:l,cleanup:u}=Ot(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 Rt(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=>Ii(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=Zr(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=Ce()?.outputStyle||`default`,p=await mr(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:jr(e),description:Xt(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:ce()},pid:process.pid};if(N()&&je()){let e=d();ee.fast_mode_state=Te(c.userSpecifiedModel??null,e.fastMode)}if(r.enqueue({type:`control_response`,response:{subtype:`success`,request_id:t,response:ee}}),s){let e=se.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(!zn())return{canRewind:!1,error:`File rewinding is not enabled.`,filesChanged:[]};if(!Ci(t.fileHistory,e))return{canRewind:!1,error:`No file checkpoint found for this message.`,filesChanged:[]};if(r){let n=await Mt(t.fileHistory,e);return{canRewind:!0,filesChanged:n?.filesChanged??[],insertions:n?.insertions,deletions:n?.deletions}}try{await mt(e=>n(t=>({...t,fileHistory:e(t.fileHistory)})),e)}catch(e){return{canRewind:!1,error:`Failed to rewind: ${R(e)}`,filesChanged:[]}}return{canRewind:!0,filesChanged:[]}}function Zo(e,t,n,r){if(e.mode===`bypassPermissions`){if(mn())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`&&!St()){let e=An();return r.enqueue({type:`control_response`,response:{subtype:`error`,request_id:t,error:e?`Cannot set permission mode to auto: ${wi(e)}`:`Cannot set permission mode to auto`}}),n}return r.enqueue({type:`control_response`,response:{subtype:`success`,request_id:t,response:{mode:e.mode}}}),{...Nt(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}),J({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}),J({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 $n(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}=(Xr(),e(ui));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(tn(i.sessionId),i.fullPath?po(i.fullPath):null),r&&await Tr()),co(i,t),rr(n.forkSession?{...i,worktreeSession:void 0}:i),Q&&Si(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(!rn(`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-D6PvdjPy.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([pn(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 yn(a.sessionId,a.ingressUrl);let o=await $n(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??pt(`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}=(Xr(),e(ui));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(tn(o.sessionId),o.fullPath?po(o.fullPath):null),r&&await Tr()),co(o,t),rr(n.forkSession?{...o,worktreeSession:void 0}:o),Q&&Si(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??pt(`startup`))}}function rs(e,t){let n;return n=typeof e==`string`?e.trim()===``?Or([]):Or([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 Gr(t);return a?(r.add(t),I(`handleOrphanedPermissionResponse: enqueuing orphaned permission for toolUseID=${t} messageID=${a.message.id}`),J({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}=Lt(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:!on(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 $t(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 er(t,r);if(d.push(e),e.type===`connected`){let t=await Cn(e);f.push(...t)}else e.type===`failed`&&(u[t]=e.error||`Connection failed`);l.push(t)}catch(e){let n=Fe(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};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,r as i}from"./analytics-DqMQntaB.js";import{_E as a,gE as o,vE as s,yE as c}from"./loadAgentsDir-ClTeo0nk.js";import{n as l,r as u,t as d}from"./Grove-m57x4tY1.js";async function f(e){if(!await c())return e(m),null;let[t,n]=await Promise.all([a(),o()]);if(!t.success)return e(m),null;let r=t.data,s=n.success?n.data:null;async function u(t){if(t===`escape`||t===`defer`){e(`Privacy settings dialog dismissed`,{display:`system`});return}await f()}async function f(){let t=await a();if(!t.success){e(`Unable to retrieve updated privacy settings`,{display:`system`});return}let n=t.data;e(`"Help improve Claude" set to ${n.grove_enabled?`true`:`false`}.`),r.grove_enabled!==null&&r.grove_enabled!==n.grove_enabled&&i(`tengu_grove_policy_toggled`,{state:n.grove_enabled,location:`settings`})}return r.grove_enabled===null?(0,p.jsx)(d,{showIfAlreadyViewed:!0,onDone:u,location:`settings`}):(0,p.jsx)(l,{settings:r,domainExcluded:s?.domain_excluded,onDone:f})}var p,m;e((()=>{t(),u(),r(),s(),p=n(),m=`Review and manage your privacy settings at https://claude.ai/settings/data-privacy-controls`}))();export{f as call};
@@ -0,0 +1 @@
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-DO4WOQtD.js";import{F as s,U as c,z as l}from"./debug-otxXY3j-.js";import{n as u,r as d}from"./analytics-DqMQntaB.js";import{$g as f,$m as p,$o as m,Eo as h,GC as g,Qg as _,Qm as v,So as y,To as b,Uo as x,WC as S,dh as C,uh as w,vu as T,yu as E}from"./loadAgentsDir-ClTeo0nk.js";import{Gt as D,Kt as O}from"./prompt-CfM_xGPc.js";import{r as k,t as A}from"./xml-CTdKuU6f.js";import{randomUUID as j}from"crypto";t(),n(),E(),f(),C();var M=i();function N({input:e,progress:t,verbose:n}){return(0,M.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,M.jsx)(_,{addMargin:!1,param:{text:`<bash-input>${e}</bash-input>`,type:`text`}}),t?(0,M.jsx)(w,{fullOutput:t.fullOutput,output:t.output,elapsedTimeSeconds:t.elapsedTimeSeconds,totalLines:t.totalLines,verbose:n}):T.renderToolUseProgressMessage?.([],{verbose:n,tools:[],terminalSize:void 0})]})}u(),c(),S(),x(),o();function P(){return a().defaultShell??`bash`}E(),D(),k();async function F(t,n,r,i,a){let o=O()&&P()===`powershell`;d(`tengu_input_bash`,{powershell:o});let c=h({content:m({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})},l=null;o&&(l=(p(),e(v)).PowerShellTool);let d=l??T,f=(l?await l.call({command:t,dangerouslyDisableSandbox:!0},n,void 0,void 0,s):await T.call({command:t,dangerouslyDisableSandbox:!0},n,void 0,void 0,s)).data;if(!f)throw Error(`No result received from shell command`);let m=f.stderr,_=await g(d,{...f,stderr:``},j()),b=typeof _.content==`string`?_.content:A(f.stdout);return{messages:[y(),c,...r,h({content:`<bash-stdout>${b}</bash-stdout><bash-stderr>${A(m)}</bash-stderr>`})],shouldQuery:!1}}catch(e){return e instanceof s?e.interrupted?{messages:[y(),c,b({toolUse:!1}),...r],shouldQuery:!1}:{messages:[y(),c,...r,h({content:`<bash-stdout>${A(e.stdout)}</bash-stdout><bash-stderr>${A(e.stderr)}</bash-stderr>`})],shouldQuery:!1}:{messages:[y(),c,...r,h({content:`<bash-stderr>Command failed: ${A(l(e))}</bash-stderr>`})],shouldQuery:!1}}finally{a(null)}}export{F as processBashCommand};
@@ -0,0 +1,6 @@
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,Bc as c,Dt as l,Ot as u,Uc as d,tt as f,vs as p,ys as m}from"./paths-DO4WOQtD.js";import{P as h,U as g,_,h as v,j as y,l as b,p as x}from"./debug-otxXY3j-.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-DSV4Ht5l.js";import{n as k,t as ee}from"./sleep-C6koP5Ka.js";import{$D as te,$_ as ne,$o as A,$w as re,A as ie,Ao as ae,BO as oe,CS as se,Co as ce,Dl as le,Eo as j,Fc as ue,Fk as de,G as fe,Il as M,Jo as pe,K as me,KO as he,Mc as N,Nc as P,O_ as F,Q_ as I,Qw as L,Rk as R,Rl as ge,So as z,TS as _e,To as ve,Ui as ye,Uo as be,Wo as xe,Xi as Se,Z_ as Ce,Zo as we,Zw as Te,_D as Ee,aA as De,bO as Oe,cp as ke,eO as Ae,gD as je,ha as B,hv as V,k_ as H,kl as Me,lj as Ne,lv as Pe,mv as Fe,nO as Ie,na as Le,pv as Re,qi as ze,rA as Be,rO as Ve,sp as He,ta as Ue,uj as We,uv as Ge,vo as U,vv as Ke,w as qe,wO as Je,xO as Ye,zO as Xe,zl as Ze}from"./loadAgentsDir-ClTeo0nk.js";import{a as W,i as Qe,o as G}from"./xml-CTdKuU6f.js";import{E as $e,T as et,w as tt}from"./sessionTracing-Caw-kvQr.js";import{n as nt,t as rt}from"./slashCommandParsing-BfanVchF.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?()=>{x(`Removing one-shot hook for event ${o} in skill '${r}'`),ne(e,t,o,s)}:void 0;Ce(e,t,o,n.matcher||``,s,c,i),a++}}a>0&&x(`Registered ${a} hooks from skill '${r}'`)}var at=e((()=>{m(),b(),I()}));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=Pe(),u=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,...u&&{_PROTO_marketplace_name:u},...V(e.pluginInfo)}});let{skillContent:d,modifiedGetAppState:f,baseAgent:p,promptMessages:m}=await Ze(e,t,n),h=e.effort===void 0?p:{...p,effort:e.effort};x(`Executing forked slash command /${e.name} with agent ${h.agentType}`);let g=await n.getAppState();n.options.allowBackgroundForkedSlashCommands===!0&&st();let _=!1;if(g.kairosEnabled&&(_=!0),_){let t=te(),r=B(e),i=l(),c=e=>oe({value:e,mode:`prompt`,priority:`later`,isMeta:!0,skipSlashCommands:!0,workload:i}),u=async()=>{if(!o?.runId)return;let e=await Oe({runId:o.runId,rootDir:o.rootDir,priority:`later`,workload:i});for(let t of e)Xe(t)},d=async e=>{o?.runId&&await Ye({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 H({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=M(l,`Command completed`);x(`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 v=[],y=[],b=`forked-command-${e.name}`,S=0,w=e=>(S++,{type:`progress`,data:{message:e,type:`agent_progress`,prompt:d,agentId:s},parentToolUseID:b,toolUseID:`${b}-${S}`,timestamp:new Date().toISOString(),uuid:K()}),T=()=>{i({jsx:ke(y,{tools:n.options.tools,verbose:!1}),shouldHidePromptInput:!1,shouldContinueAnimation:!0,showSpinner:!0})};T();try{for await(let t of H({agentDefinition:h,promptMessages:m,toolUseContext:{...n,getAppState:f},canUseTool:a,isAsync:!1,querySource:`agent:custom`,model:e.model,availableTools:n.options.tools})){v.push(t);let e=we([t]);if(t.type===`assistant`){let r=de(t);r>0&&n.setResponseLength(e=>e+r);let i=e[0];i&&i.type===`assistant`&&(y.push(w(t)),T())}if(t.type===`user`){let t=e[0];t&&t.type===`user`&&(y.push(w(t)),T())}}}finally{i(null)}let E=M(v,`Command completed`);return x(`Forked slash command /${e.name} completed with agent ${s}`),process.env.USER_TYPE===`ant`&&(E=`[ANT-ONLY] API calls: ${c(Ie(s))}\n${E}`),{messages:[j({content:A({inputString:`/${B(e)} ${t}`.trim(),precedingInputBlocks:r})}),j({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:[z(),...r,j({content:A({inputString:e,precedingInputBlocks:t})})],shouldQuery:!1,resultText:e}}let{commandName:f,args:p,isMcp:m}=d,h=m?`mcp`:ye().has(f)?f:`custom`;if(!Ue(f,i.options.commands)){let n=!1;try{await v().stat(`/${f}`),n=!0}catch{}if(ct(f)&&!n){C(`tengu_input_slash_invalid`,{input:f});let e=`Unknown skill: ${f}`;return{messages:[z(),...r,j({content:A({inputString:e,precedingInputBlocks:t})}),...p?[ce(`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:[j({content:A({inputString:e,precedingInputBlocks:t}),uuid:s}),...r],shouldQuery:!0}}let{messages:g,shouldQuery:_,allowedTools:y,model:b,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,V(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:b,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:[z(),...g],shouldQuery:_,allowedTools:y,model:b};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,V(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(pe)||k?g:[z(),...g],shouldQuery:_,allowedTools:y,model:b,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=Se(e,r.options.commands);if(u.type===`prompt`&&u.userInvocable!==!1&&Fe(e),u.userInvocable===!1)return{messages:[j({content:A({inputString:`/${e}`,precedingInputBlocks:i})}),j({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=>j({content:e,isMeta:!0})),s=_e()&&typeof n==`string`&&n.endsWith(` dismissed`),c=r?.displayArgs??t;e({messages:r?.display===`system`?s?o:[U(J(u,c)),U(`<local-command-stdout>${n}</local-command-stdout>`),...o]:[j({content:A({inputString:J(u,c),precedingInputBlocks:i})}),j(n?{content:`<local-command-stdout>${n}</local-command-stdout>`}:{content:`<local-command-stdout>${Ne}</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=j({content:A({inputString:J(u,u.isSensitive&&t.trim()?`***`:t),precedingInputBlocks:i})});try{let n=z(),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?[j({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 De(),{messages:le(r),shouldQuery:!1,command:u}}return{messages:[e,U(`<local-command-stdout>${i.value}</local-command-stdout>`)],shouldQuery:!1,command:u,resultText:i.value}}catch(t){return O(t),{messages:[e,U(`<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:[j({content:A({inputString:J(u,t),precedingInputBlocks:i})}),ve({toolUse:!1})],shouldQuery:!1,command:u}:{messages:[j({content:A({inputString:J(u,t),precedingInputBlocks:i})}),j({content:`<local-command-stderr>${String(e)}</local-command-stderr>`})],shouldQuery:!1,command:u}}}}catch(e){if(e instanceof h)return{messages:[j({content:A({inputString:e.message,precedingInputBlocks:i})})],shouldQuery:!1,command:u};throw e}}function J(e,t){return ae(B(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=ze(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:[j({content:n,uuid:l}),j({content:a,isMeta:!0})],shouldQuery:!0,model:e.model,effort:e.effort,command:e}}let u=await e.getPromptForCommand(t,i),d=!L(`hooks`)||re(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=ie(e.allowedTools??[]),g=c.length>0||a.length>0?[...c,...a,...u]:u,_=await Ee(P(u.filter(e=>e.type===`text`).map(e=>e.text).join(` `),i,null,[],i.messages,`repl_main_thread`,{skipSkillDiscovery:!0}));return{messages:[j({content:m,uuid:l}),j({content:g,isMeta:!0}),..._,N({type:`command_permissions`,allowedTools:h,model:e.model})],shouldQuery:!0,allowedTools:h,model:e.model,effort:e.effort,command:e}}var Q,$;e((()=>{i(),Le(),We(),T(),S(),Ve(),Me(),Be(),F(),He(),Ae(),f(),ue(),b(),t(),g(),d(),ge(),_(),se(),je(),at(),D(),he(),be(),qe(),me(),Qe(),Te(),rt(),ee(),Re(),tt(),Ke(),R(),Ge(),Je(),u(),Q=200,$=1e4}))();export{Y as formatSkillLoadingMetadata,ft as processPromptSlashCommand,lt as processSlashCommand};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./projectContext-Dn7umMp6.js";e();export{s as getProjectContextPath,r as getProjectStorageDir,a as getProjectsRegistryPath,n as getSkillLearningRootDir,i as listKnownProjects,o as resetProjectContextCacheForTest,t as resolveProjectContext};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./prompt-CfM_xGPc.js";t();export{e as isDeferredTool};