claude-code-zanii 2.8.4

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 (669) hide show
  1. package/README.md +146 -0
  2. package/dist/chunks/AddWorkspaceDirectory-y_rd6sRl.js +1 -0
  3. package/dist/chunks/App-DgWSavG1.js +1 -0
  4. package/dist/chunks/ApproveApiKey-CJKWha-a.js +1 -0
  5. package/dist/chunks/ApproveApiKey-DTs2ExZH.js +1 -0
  6. package/dist/chunks/AssistantSessionChooser-BAhVk4id.js +1 -0
  7. package/dist/chunks/BackgroundTasksDialog-XU_JPh7R.js +2 -0
  8. package/dist/chunks/BypassPermissionsModeDialog-DV0Pi7ys.js +1 -0
  9. package/dist/chunks/ClaudeInChromeOnboarding-6erm_8Fn.js +1 -0
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-CjBvzB5s.js +1 -0
  11. package/dist/chunks/ClaudeMdExternalIncludesDialog-ts0XnWwl.js +1 -0
  12. package/dist/chunks/ConsoleOAuthFlow-DySPdSqQ.js +1 -0
  13. package/dist/chunks/CustomSelect-DqZxzBZP.js +1 -0
  14. package/dist/chunks/DesktopHandoff-5c90JK88.js +1 -0
  15. package/dist/chunks/DevChannelsDialog-DCMderzu.js +1 -0
  16. package/dist/chunks/Dialog-Dgg8bqcG.js +1 -0
  17. package/dist/chunks/DiffDialog-BU765aqh.js +6 -0
  18. package/dist/chunks/Doctor-B73iDB-d.js +3 -0
  19. package/dist/chunks/Doctor-CLZDdNRo.js +1 -0
  20. package/dist/chunks/ExitFlow-DBqn2mUf.js +2 -0
  21. package/dist/chunks/Feedback-D-JHabwi.js +2 -0
  22. package/dist/chunks/Grove-D-uQNMMo.js +11 -0
  23. package/dist/chunks/HybridTransport-B-G4QJcy.js +4 -0
  24. package/dist/chunks/ITermBackend-KP1vKsRN.js +1 -0
  25. package/dist/chunks/InProcessTransport-ByBEKxrQ.js +1 -0
  26. package/dist/chunks/InvalidConfigDialog-CMqiZ5nG.js +1 -0
  27. package/dist/chunks/InvalidSettingsDialog-CjPCKzVZ.js +1 -0
  28. package/dist/chunks/ListItem-B6MyhHvM.js +1 -0
  29. package/dist/chunks/MCPConnectionManager-BJ8PcYPe.js +1 -0
  30. package/dist/chunks/Message-DNxJ_tMS.js +1 -0
  31. package/dist/chunks/MessageSelector-D79Ug71B.js +3 -0
  32. package/dist/chunks/Messages-CtIbkB2M.js +11 -0
  33. package/dist/chunks/Onboarding-DVrgKrI9.js +1 -0
  34. package/dist/chunks/OverageCreditUpsell-D_td1ss4.js +1 -0
  35. package/dist/chunks/PermissionDialog-BCS22yEO.js +1 -0
  36. package/dist/chunks/PermissionDialog-C5O1fL53.js +1 -0
  37. package/dist/chunks/PermissionRequestTitle-CtlbBU9t.js +1 -0
  38. package/dist/chunks/PluginSettings-OPrg-_3N.js +17 -0
  39. package/dist/chunks/PressEnterToContinue-DmzxIgbZ.js +1 -0
  40. package/dist/chunks/PromptInputFooterSuggestions-CcsKj5DK.js +1 -0
  41. package/dist/chunks/PromptInputHelpMenu-JedFdsxU.js +1 -0
  42. package/dist/chunks/REPL-ByhyIRnf.js +1 -0
  43. package/dist/chunks/REPL-Clve-8zC.js +157 -0
  44. package/dist/chunks/RemoteCallout-BZcabEKb.js +1 -0
  45. package/dist/chunks/RemoteSessionManager-C2PIFDHt.js +1 -0
  46. package/dist/chunks/ResumeConversation-D3ZRTFcF.js +1 -0
  47. package/dist/chunks/SSETransport-DmZWnH0k.js +4 -0
  48. package/dist/chunks/SearchBox-DQg2Ph0V.js +1 -0
  49. package/dist/chunks/SearchExtraToolsTool-CLO4nt6N.js +1 -0
  50. package/dist/chunks/SentryErrorBoundary-BVfBaOOU.js +2 -0
  51. package/dist/chunks/SentryErrorBoundary-DIaVFad-.js +1 -0
  52. package/dist/chunks/Settings-rOCxQdS8.js +2 -0
  53. package/dist/chunks/TeleportProgress-CP8IY6bz.js +1 -0
  54. package/dist/chunks/TeleportRepoMismatchDialog-DMmHgBqo.js +1 -0
  55. package/dist/chunks/TeleportResumeWrapper-D5wEAW1-.js +1 -0
  56. package/dist/chunks/ThemePicker-Bgr7yOQB.js +1 -0
  57. package/dist/chunks/TmuxBackend-BzbtUtP1.js +9 -0
  58. package/dist/chunks/TrustDialog-BI5U3BQ0.js +1 -0
  59. package/dist/chunks/TungstenTool-CiQclNwj.js +1 -0
  60. package/dist/chunks/TungstenTool-kMqy-ifa.js +1 -0
  61. package/dist/chunks/ValidationErrorsList-DprGtB2w.js +2 -0
  62. package/dist/chunks/WelcomeV2-C4vfBnIy.js +1 -0
  63. package/dist/chunks/WindowsTerminalBackend-BSoezOCE.js +2 -0
  64. package/dist/chunks/add-dir-DpOmv6kv.js +1 -0
  65. package/dist/chunks/agentDisplay-DuYEwOwO.js +1 -0
  66. package/dist/chunks/agents-BlurXZrF.js +2 -0
  67. package/dist/chunks/agents-DhZf7ftU.js +103 -0
  68. package/dist/chunks/ajv-CDrSAj3O.js +8 -0
  69. package/dist/chunks/analytics-i6X1et4O.js +1 -0
  70. package/dist/chunks/ant-D9hd_iYy.js +1 -0
  71. package/dist/chunks/api-CoaOHwDQ.js +4 -0
  72. package/dist/chunks/api-DvyGR-L7.js +1 -0
  73. package/dist/chunks/api-YHYC4Zdk.js +1 -0
  74. package/dist/chunks/artifacts-BMAYdaqh.js +1 -0
  75. package/dist/chunks/asciicast-DpHRoebc.js +1 -0
  76. package/dist/chunks/asciicast-HG1EoAQe.js +4 -0
  77. package/dist/chunks/assistant-D4-qcNT1.js +1 -0
  78. package/dist/chunks/assistant-DO2ZmZn1.js +1 -0
  79. package/dist/chunks/assistant-Dd86NmJM.js +1 -0
  80. package/dist/chunks/attributionHooks-BUmHrLhB.js +1 -0
  81. package/dist/chunks/attributionTrailer-r2Pbpu2N.js +1 -0
  82. package/dist/chunks/auth-CF3BGNYT.js +1 -0
  83. package/dist/chunks/auth-DwWwG43F.js +1 -0
  84. package/dist/chunks/auth-V_Xk2iea.js +1 -0
  85. package/dist/chunks/autoMode-DUksX5_i.js +45 -0
  86. package/dist/chunks/autoModeDenials-0CPO-Jbu.js +1 -0
  87. package/dist/chunks/autonomy-C5mNhAdz.js +21 -0
  88. package/dist/chunks/autonomy-CLt1dWaC.js +1 -0
  89. package/dist/chunks/autonomyPanel-rioFnrQO.js +1 -0
  90. package/dist/chunks/axios-DPuSPBlH.js +1 -0
  91. package/dist/chunks/axios-Zh7qGPze.js +12 -0
  92. package/dist/chunks/backgroundHousekeeping-BGtfqu-J.js +1 -0
  93. package/dist/chunks/backgroundHousekeeping-BqKZEvy0.js +17 -0
  94. package/dist/chunks/banner-BGLr3KYQ.js +2 -0
  95. package/dist/chunks/base64-js-B1tFNiG0.js +1 -0
  96. package/dist/chunks/bedrockClient-BFzWuhQK.js +15 -0
  97. package/dist/chunks/bg-B-YgGwLj.js +9 -0
  98. package/dist/chunks/bg-IU4gG3jc.js +1 -0
  99. package/dist/chunks/branch-BWY5W7hf.js +3 -0
  100. package/dist/chunks/break-cache-CY-O23fJ.js +8 -0
  101. package/dist/chunks/bridge-CqWd70vK.js +2 -0
  102. package/dist/chunks/bridgeConfig-CWO8AmCY.js +1 -0
  103. package/dist/chunks/bridgeConfig-D38y9eXn.js +1 -0
  104. package/dist/chunks/bridgeConfig-EwUq__ct.js +1 -0
  105. package/dist/chunks/bridgeConfig-GYR-LUiu.js +1 -0
  106. package/dist/chunks/bridgeEnabled-DKqmLnKO.js +1 -0
  107. package/dist/chunks/bridgeEnabled-DZIGDtfY.js +1 -0
  108. package/dist/chunks/bridgeMain-CXVks2ND.js +1 -0
  109. package/dist/chunks/bridgeMain-D4nsECwJ.js +68 -0
  110. package/dist/chunks/bridgeMessaging-BUOZU_ba.js +1 -0
  111. package/dist/chunks/bridgePointer-BpzIEsD_.js +1 -0
  112. package/dist/chunks/browser-D1vC3BNd.js +1 -0
  113. package/dist/chunks/btw-CVXJwoXo.js +1 -0
  114. package/dist/chunks/buddy-BLcvL8lP.js +3 -0
  115. package/dist/chunks/bundledMode-DQNSSQbt.js +1 -0
  116. package/dist/chunks/caches-BrfvzKn5.js +1 -0
  117. package/dist/chunks/caches-CkSv3MfC.js +3 -0
  118. package/dist/chunks/capacityWake-BWCSatN6.js +1 -0
  119. package/dist/chunks/changeDetector-DEZU6tum.js +1 -0
  120. package/dist/chunks/changeDetector-Df7c6U3d.js +1 -0
  121. package/dist/chunks/channelAllowlist-BApjAS0V.js +1 -0
  122. package/dist/chunks/channelNotification-BjWwF85R.js +1 -0
  123. package/dist/chunks/channelNotification-D01YVwNj.js +1 -0
  124. package/dist/chunks/chokidar-DPwMBcWI.js +1 -0
  125. package/dist/chunks/chokidar-DkDXNCTz.js +1 -0
  126. package/dist/chunks/chrome-D7coxEOI.js +1 -0
  127. package/dist/chunks/chromeNativeHost-CPj9M_4-.js +1 -0
  128. package/dist/chunks/chunk-DR8-3Aex.js +1 -0
  129. package/dist/chunks/classPrivateFieldSet2-DZkxcFPS.js +1 -0
  130. package/dist/chunks/claudeAiLimitsHook-ATshVrOH.js +1 -0
  131. package/dist/chunks/claudeDesktop-PVa9tWsM.js +1 -0
  132. package/dist/chunks/cleanup-C-PGmKpV.js +1 -0
  133. package/dist/chunks/clear-CxGE9Ntr.js +1 -0
  134. package/dist/chunks/cliLaunch-CMXoY_LO.js +1 -0
  135. package/dist/chunks/client-BWED8Tbu.js +35 -0
  136. package/dist/chunks/client-CinDjeSq.js +7 -0
  137. package/dist/chunks/client-CpXGg9e0.js +1 -0
  138. package/dist/chunks/color-B3w_VQTn.js +1 -0
  139. package/dist/chunks/color-convert-BQZnVz_5.js +1 -0
  140. package/dist/chunks/commands-DFp48zwy.js +1 -0
  141. package/dist/chunks/commitAttribution-B0cXmbvv.js +2 -0
  142. package/dist/chunks/commitAttribution-DRSKRoH6.js +1 -0
  143. package/dist/chunks/common-BX7bn3hg.js +1 -0
  144. package/dist/chunks/common-Ce3LanTX.js +1 -0
  145. package/dist/chunks/common-DdLQuE2_.js +1 -0
  146. package/dist/chunks/common-HfKcqOYK.js +1 -0
  147. package/dist/chunks/compact-C8ljGMdo.js +3 -0
  148. package/dist/chunks/companion-mD1jw6xX.js +1 -0
  149. package/dist/chunks/completionCache-BqQXVTa9.js +1 -0
  150. package/dist/chunks/completionCache-BtP4vfAi.js +4 -0
  151. package/dist/chunks/computerUseLock-ADE_PhIK.js +1 -0
  152. package/dist/chunks/config-CmyaIIOY.js +1 -0
  153. package/dist/chunks/config-Rl1Y_Dtq.js +1 -0
  154. package/dist/chunks/connectHeadless-MFABhXpz.js +1 -0
  155. package/dist/chunks/constants-BM62Vf_X.js +1 -0
  156. package/dist/chunks/constants-BfXy-5cI.js +1 -0
  157. package/dist/chunks/context-BeiZkUNq.js +1 -0
  158. package/dist/chunks/context-noninteractive-CRdF3iv8.js +54 -0
  159. package/dist/chunks/controlMessageCompat-591iGHUK.js +1 -0
  160. package/dist/chunks/conversation-BoguXZEI.js +1 -0
  161. package/dist/chunks/conversation-yhs7tT-g.js +1 -0
  162. package/dist/chunks/copy-BpeUcqku.js +7 -0
  163. package/dist/chunks/createSSHSession-B3JOB4TE.js +6 -0
  164. package/dist/chunks/createSession-BJSnFBGt.js +1 -0
  165. package/dist/chunks/createSession-CnRHI3RU.js +1 -0
  166. package/dist/chunks/cron-iqTFGIos.js +1 -0
  167. package/dist/chunks/cronScheduler-zRXhgEEU.js +6 -0
  168. package/dist/chunks/cronTasks-CMJldfoP.js +2 -0
  169. package/dist/chunks/crossProjectResume-DxO6TX30.js +40 -0
  170. package/dist/chunks/cwd-B2guYBbl.js +1 -0
  171. package/dist/chunks/cwd-B5bbyUwz.js +1 -0
  172. package/dist/chunks/cwd-BXiaJzLh.js +1 -0
  173. package/dist/chunks/daemon-B3v4OoOu.js +2 -0
  174. package/dist/chunks/dangerousBackend-OmCzoW35.js +1 -0
  175. package/dist/chunks/datadog-3-Vvz0yz.js +1 -0
  176. package/dist/chunks/datadog-BQlp3bTs.js +1 -0
  177. package/dist/chunks/debug-BDBIipC1.js +2 -0
  178. package/dist/chunks/debug-C7tW7DFW.js +1 -0
  179. package/dist/chunks/debug-CjIaNjpK.js +5 -0
  180. package/dist/chunks/debugUtils-Dsg-UHeg.js +1 -0
  181. package/dist/chunks/defineProperty-CaCI0a5T.js +1 -0
  182. package/dist/chunks/desktop-C_SS0068.js +1 -0
  183. package/dist/chunks/detached-B7RNZeyl.js +5 -0
  184. package/dist/chunks/detect-libc-DFFGDzPC.js +1 -0
  185. package/dist/chunks/detectRepository-BnTCJAXR.js +1 -0
  186. package/dist/chunks/detectRepository-Gobn9eFt.js +1 -0
  187. package/dist/chunks/detection-CN_uLGU2.js +1 -0
  188. package/dist/chunks/detection-DW6grIlc.js +1 -0
  189. package/dist/chunks/diff-B8YmRG5T.js +1 -0
  190. package/dist/chunks/directoryCompletion-J560aATd.js +1 -0
  191. package/dist/chunks/dist-B1wOprSs.js +29 -0
  192. package/dist/chunks/dist-DZQOarNX.js +5 -0
  193. package/dist/chunks/dist-HZfkKiUF.js +20 -0
  194. package/dist/chunks/dist-es-4xyrZoNc2.js +1 -0
  195. package/dist/chunks/dist-es-6kjvVbJd.js +1 -0
  196. package/dist/chunks/dist-es-BJldFHbt.js +3 -0
  197. package/dist/chunks/dist-es-BM013UFT.js +1 -0
  198. package/dist/chunks/dist-es-BPPewn1A.js +1 -0
  199. package/dist/chunks/dist-es-BZGG3Hnm.js +1 -0
  200. package/dist/chunks/dist-es-BZjJL64k2.js +1 -0
  201. package/dist/chunks/dist-es-BctcPxLN.js +1 -0
  202. package/dist/chunks/dist-es-Bf2jR30y.js +1 -0
  203. package/dist/chunks/dist-es-BgLoR-hQ.js +1 -0
  204. package/dist/chunks/dist-es-BismPcTW.js +1 -0
  205. package/dist/chunks/dist-es-BrPzXmSP.js +1 -0
  206. package/dist/chunks/dist-es-Bu21Wvhs.js +1 -0
  207. package/dist/chunks/dist-es-BuWNNAXW.js +1 -0
  208. package/dist/chunks/dist-es-Bz11sFiK2.js +1 -0
  209. package/dist/chunks/dist-es-C5VplyPL2.js +5 -0
  210. package/dist/chunks/dist-es-C66BuLgn.js +1 -0
  211. package/dist/chunks/dist-es-CCIzgNln2.js +1 -0
  212. package/dist/chunks/dist-es-CLyx7Kge2.js +1 -0
  213. package/dist/chunks/dist-es-CUbatGdn.js +1 -0
  214. package/dist/chunks/dist-es-CYe_-TbD.js +1 -0
  215. package/dist/chunks/dist-es-C_IHUdzL.js +1 -0
  216. package/dist/chunks/dist-es-Ci_rKlMr.js +1 -0
  217. package/dist/chunks/dist-es-ClDZBAj7.js +1 -0
  218. package/dist/chunks/dist-es-Cp--qjOi.js +1 -0
  219. package/dist/chunks/dist-es-CzE4kW1L.js +9 -0
  220. package/dist/chunks/dist-es-DUg5w7-v.js +1 -0
  221. package/dist/chunks/dist-es-Dl0ZRczY.js +1 -0
  222. package/dist/chunks/dist-es-Do_155z5.js +1 -0
  223. package/dist/chunks/dist-es-DxIM0jd82.js +1 -0
  224. package/dist/chunks/dist-es-Fav2oBDs.js +1 -0
  225. package/dist/chunks/dist-es-TZjwPaGn.js +1 -0
  226. package/dist/chunks/dist-es-W22ud2el2.js +1 -0
  227. package/dist/chunks/dist-es-aU8-02YH.js +1 -0
  228. package/dist/chunks/dist-es-b3yZSGx82.js +1 -0
  229. package/dist/chunks/dist-es-dIP5JtXz.js +5 -0
  230. package/dist/chunks/dist-es-mQ4HvnYs2.js +1 -0
  231. package/dist/chunks/distRoot-CJaacAHy.js +1 -0
  232. package/dist/chunks/doctor-DLZPF4iY.js +1 -0
  233. package/dist/chunks/earlyInput-BTI1CSNt.js +2 -0
  234. package/dist/chunks/earlyInput-BwGtzhhP.js +1 -0
  235. package/dist/chunks/effort-BaHvpBWr.js +9 -0
  236. package/dist/chunks/entry-_e-lyRwv.js +14 -0
  237. package/dist/chunks/env-CesrOJJq.js +1 -0
  238. package/dist/chunks/envLessBridgeConfig-4oys0_9A.js +1 -0
  239. package/dist/chunks/envLessBridgeConfig-DJ1Sts3F.js +1 -0
  240. package/dist/chunks/envUtils-CFG7IQID.js +1 -0
  241. package/dist/chunks/errorLogSink-Ti4Suoz6.js +2 -0
  242. package/dist/chunks/escHotkey-CVn_80xM.js +259 -0
  243. package/dist/chunks/esm-BFnjHW38.js +1 -0
  244. package/dist/chunks/esm-BQg_LX3V.js +1 -0
  245. package/dist/chunks/esm-BtC6CMmM.js +1 -0
  246. package/dist/chunks/esm-BwzC0MQp.js +1 -0
  247. package/dist/chunks/esm-CFybeQ_Q.js +1 -0
  248. package/dist/chunks/esm-CK-5CT5X.js +1 -0
  249. package/dist/chunks/esm-CL1OwlZB.js +1 -0
  250. package/dist/chunks/esm-CMzgSTAl.js +1 -0
  251. package/dist/chunks/esm-CPE_H2Lx.js +1 -0
  252. package/dist/chunks/esm-CcWquv5a.js +10 -0
  253. package/dist/chunks/esm-CeNEpRZt.js +1 -0
  254. package/dist/chunks/esm-D7hykoRB.js +1 -0
  255. package/dist/chunks/esm-DUtcefEV.js +1 -0
  256. package/dist/chunks/esm-DhrUwJBp.js +1 -0
  257. package/dist/chunks/esm-Duu1fRQ8.js +1 -0
  258. package/dist/chunks/esm-Ght2BaU2.js +1 -0
  259. package/dist/chunks/esm-Q6Yz2GMx.js +56 -0
  260. package/dist/chunks/esm-WONEiurY.js +13 -0
  261. package/dist/chunks/event-streams-BumpU1aB.js +1 -0
  262. package/dist/chunks/eventLoopStallDetector-DxyFdg1h.js +1 -0
  263. package/dist/chunks/execAsync-ChKxDZ8C.js +1 -0
  264. package/dist/chunks/execFileNoThrow-DdmR1mBS.js +1 -0
  265. package/dist/chunks/execSyncWrapper-Ch4TNj8u.js +1 -0
  266. package/dist/chunks/execa-BMaINL7N.js +34 -0
  267. package/dist/chunks/executor-C7INr19-.js +1 -0
  268. package/dist/chunks/executor-Dnf3YYma.js +1604 -0
  269. package/dist/chunks/exit-BakzsOD0.js +1 -0
  270. package/dist/chunks/exit-CiDn2tN9.js +2 -0
  271. package/dist/chunks/export-b-6pqMqz.js +2 -0
  272. package/dist/chunks/exportRenderer-RxtEIyTm.js +1 -0
  273. package/dist/chunks/extra-usage-7EPJNjNW.js +1 -0
  274. package/dist/chunks/extra-usage-ChvuewCq.js +1 -0
  275. package/dist/chunks/extra-usage-core-BVhLtoDF.js +1 -0
  276. package/dist/chunks/extra-usage-noninteractive-_Njh6q-q.js +1 -0
  277. package/dist/chunks/extraUsage-qOBMQB6g.js +1 -0
  278. package/dist/chunks/extractMemories-CRBVNiG1.js +1 -0
  279. package/dist/chunks/fast-C4uw_g7o.js +1 -0
  280. package/dist/chunks/fast-CEaIzaPl.js +1 -0
  281. package/dist/chunks/featureCheck-B1GSTyhh.js +1 -0
  282. package/dist/chunks/featureCheck-DKigAPal.js +1 -0
  283. package/dist/chunks/feedback-Bf3TjjuD.js +1 -0
  284. package/dist/chunks/figures-fES5sASd.js +1 -0
  285. package/dist/chunks/fileStateCache-DAsLEZau.js +1 -0
  286. package/dist/chunks/files-B-m_4X8b.js +2 -0
  287. package/dist/chunks/findExecutable-D8vJrFnO.js +1 -0
  288. package/dist/chunks/firstPartyEventLogger-BtrGagNa.js +1 -0
  289. package/dist/chunks/flushGate-2zqab-Pp.js +1 -0
  290. package/dist/chunks/foundry-sdk-CtX8C0x3.js +1 -0
  291. package/dist/chunks/fpsMetrics-ts_jaF3g.js +1 -0
  292. package/dist/chunks/fuse-ivQ_eRwF.js +1 -0
  293. package/dist/chunks/gates-CmKoQ0O-.js +1 -0
  294. package/dist/chunks/gates-_wbPDQ3M.js +1 -0
  295. package/dist/chunks/gemini-DRx495gn.js +3 -0
  296. package/dist/chunks/generateRecap-Cv8gd_QF.js +1 -0
  297. package/dist/chunks/generateSessionName-Dpjg-u_x.js +1 -0
  298. package/dist/chunks/genericProcessUtils-BFJMxLqn.js +23 -0
  299. package/dist/chunks/getMachineId-bsd-C9pL9Ajr.js +1 -0
  300. package/dist/chunks/getMachineId-darwin-Ma4F9rJg.js +2 -0
  301. package/dist/chunks/getMachineId-linux-C0lXMqsj.js +1 -0
  302. package/dist/chunks/getMachineId-unsupported-ByHQTXat.js +1 -0
  303. package/dist/chunks/getMachineId-win-DZsXZmTz.js +1 -0
  304. package/dist/chunks/git-Bj8Ow4pJ.js +6 -0
  305. package/dist/chunks/git-Q_b4oZ17.js +1 -0
  306. package/dist/chunks/githubRepoPathMapping-DGivBX9h.js +1 -0
  307. package/dist/chunks/goal-BrHEJv8o.js +3 -0
  308. package/dist/chunks/goalStorage-CsuPOQbk.js +1 -0
  309. package/dist/chunks/graceful-fs-BuPWC-vB.js +2 -0
  310. package/dist/chunks/grok-CDkDDaY_.js +1 -0
  311. package/dist/chunks/growthbook-D3_Cr9n-.js +1 -0
  312. package/dist/chunks/growthbook-p4aJ_UMv.js +32 -0
  313. package/dist/chunks/hash-KW-tVnPp.js +1 -0
  314. package/dist/chunks/heapdump-CloylIZ9.js +5 -0
  315. package/dist/chunks/help-DpSJlHIc.js +1 -0
  316. package/dist/chunks/hooks-2pogt8nv.js +79 -0
  317. package/dist/chunks/hooks-BBODdwnE.js +1 -0
  318. package/dist/chunks/hostAdapter-B5KTUqhv.js +1 -0
  319. package/dist/chunks/hostGuard-DyWr2TwE.js +1 -0
  320. package/dist/chunks/httpAuthSchemes-CgPbtGos.js +13 -0
  321. package/dist/chunks/ide-CJEcfBZq.js +2 -0
  322. package/dist/chunks/inboundAttachments-RNpYpRTO.js +1 -0
  323. package/dist/chunks/index.min-DCDiLq-j.js +1 -0
  324. package/dist/chunks/initReplBridge-D2E6IM2B.js +1 -0
  325. package/dist/chunks/initReplBridge-p2uwDBPx.js +1 -0
  326. package/dist/chunks/insights-DnpZScKs.js +822 -0
  327. package/dist/chunks/install-D_vTxUlG.js +1 -0
  328. package/dist/chunks/install-github-app-BK8A7g3i.js +147 -0
  329. package/dist/chunks/install-slack-app-C47R9VoI.js +1 -0
  330. package/dist/chunks/instinctParser-DxKdI3JC.js +1 -0
  331. package/dist/chunks/instrumentation-DkdAJFrZ.js +12 -0
  332. package/dist/chunks/intl-Pse97ORk.js +1 -0
  333. package/dist/chunks/isObject-DaxDnPKm.js +1 -0
  334. package/dist/chunks/isSymbol-D7QeUnS5.js +1 -0
  335. package/dist/chunks/job-opl00C4l.js +2 -0
  336. package/dist/chunks/json-bigint-BRRVs1dv.js +8 -0
  337. package/dist/chunks/jsx-runtime-BTgGEFjL.js +1 -0
  338. package/dist/chunks/jws-B_ieuaZg.js +3 -0
  339. package/dist/chunks/jwtUtils-D-tJzoJY.js +1 -0
  340. package/dist/chunks/keybindings-mRf9VSe8.js +2 -0
  341. package/dist/chunks/lang-eH4EJErj.js +1 -0
  342. package/dist/chunks/language-DD9ar6RA.js +1 -0
  343. package/dist/chunks/language-EZLNdETg.js +1 -0
  344. package/dist/chunks/launchAgentsPlatform-Cq0_7-IM.js +1 -0
  345. package/dist/chunks/launchAutofixPr-Bw7aUHUs.js +18 -0
  346. package/dist/chunks/launchCommand-Bk1Fn-qZ.js +1 -0
  347. package/dist/chunks/launchLocalMemory-CLBCUgwd.js +3 -0
  348. package/dist/chunks/launchLocalVault-BfWJWrBg.js +3 -0
  349. package/dist/chunks/launchMemoryStores-DdnSVSDZ.js +1 -0
  350. package/dist/chunks/launchOnboarding-ziCEX3GI.js +8 -0
  351. package/dist/chunks/launchSchedule-G_c7sgmy.js +1 -0
  352. package/dist/chunks/launchSkillStore-Z1Kd7nCg.js +1 -0
  353. package/dist/chunks/launchTeleport-Dp9AFbPx.js +3 -0
  354. package/dist/chunks/launchVault-hwK-Ljek.js +1 -0
  355. package/dist/chunks/lazySchema-2sOku3cX.js +1 -0
  356. package/dist/chunks/lib-BHRYgENJ.js +8 -0
  357. package/dist/chunks/lib-DRyNc7xD.js +2 -0
  358. package/dist/chunks/lib-Ddq71jM5.js +14 -0
  359. package/dist/chunks/loadAgentsDir-Bz0FfcVt.js +5620 -0
  360. package/dist/chunks/loadAgentsDir-CLM0ws7u.js +1 -0
  361. package/dist/chunks/loadPluginHooks-B5SIS2uo.js +1 -0
  362. package/dist/chunks/loadSso-RY87rrJO.js +1 -0
  363. package/dist/chunks/localSearch-BLF6PSv2.js +1 -0
  364. package/dist/chunks/localSearch-CTycGe3E.js +1 -0
  365. package/dist/chunks/localSearch-inDahM8I.js +1 -0
  366. package/dist/chunks/lockfile--gk1HDM6.js +1 -0
  367. package/dist/chunks/log-B-Nj3Yed.js +1 -0
  368. package/dist/chunks/log-DVv8YiNo.js +1 -0
  369. package/dist/chunks/login-BeLvLowc.js +1 -0
  370. package/dist/chunks/login-DUUOeNoz.js +1 -0
  371. package/dist/chunks/logoV2Utils-D5SpeZ3C.js +1 -0
  372. package/dist/chunks/logout-C2QuTBdS.js +1 -0
  373. package/dist/chunks/magicDocs-CUXKi-Wv.js +57 -0
  374. package/dist/chunks/main-CFhpWtpC.js +1420 -0
  375. package/dist/chunks/main-sboa5RKc.js +31 -0
  376. package/dist/chunks/mappers-DLkk0PZz.js +1 -0
  377. package/dist/chunks/mcp-C2f6IgAp.js +2 -0
  378. package/dist/chunks/mcp-Djui9m3_.js +6 -0
  379. package/dist/chunks/mcp-DvTSxrJ4.js +1 -0
  380. package/dist/chunks/mcpServer-DMA0bdFC.js +1 -0
  381. package/dist/chunks/mcpServer-DxEHfW2v.js +1 -0
  382. package/dist/chunks/memoize-Bg2dXTzV.js +1 -0
  383. package/dist/chunks/memoize-DNnuA2aU.js +1 -0
  384. package/dist/chunks/memory-B9io9Zcv.js +1 -0
  385. package/dist/chunks/mobile-CPnnvkQV.js +2 -0
  386. package/dist/chunks/modalContext-B1b0Gsro.js +1 -0
  387. package/dist/chunks/mode-BDgwh_Xb.js +2 -0
  388. package/dist/chunks/model-B6cpEh-s.js +1 -0
  389. package/dist/chunks/model-BcunOCC9.js +1 -0
  390. package/dist/chunks/modelOptions-CHUHQ9WG.js +1 -0
  391. package/dist/chunks/normalization-cjPqid31.js +1 -0
  392. package/dist/chunks/oauth-CnBLewrU.js +1 -0
  393. package/dist/chunks/oauth-DMPGYAoZ.js +1 -0
  394. package/dist/chunks/observationStore-DVBxrSdI.js +4 -0
  395. package/dist/chunks/onChangeAppState-M61XDN6V.js +1 -0
  396. package/dist/chunks/open-CsUNPSNx.js +1 -0
  397. package/dist/chunks/openai-BHvlYW3m.js +2 -0
  398. package/dist/chunks/output-style-BtKuBrs4.js +1 -0
  399. package/dist/chunks/outputStyles-hHuIBkRB.js +84 -0
  400. package/dist/chunks/overageCreditGrant-BLFT-rF3.js +1 -0
  401. package/dist/chunks/p-map-C-WNcN6g.js +1 -0
  402. package/dist/chunks/p-map-CQ2NythB.js +1 -0
  403. package/dist/chunks/package-9IAs5Qf0.js +1 -0
  404. package/dist/chunks/panel-27xLZI7c.js +1 -0
  405. package/dist/chunks/panel-NoDfShEZ.js +1 -0
  406. package/dist/chunks/panelCall-CEOWVNCM.js +1 -0
  407. package/dist/chunks/parseConnectUrl-CxU4IX9o.js +1 -0
  408. package/dist/chunks/parser-DGlAnaNj.js +1 -0
  409. package/dist/chunks/parser-DGoLe2RS.js +1 -0
  410. package/dist/chunks/passes-CExcqu66.js +1 -0
  411. package/dist/chunks/path-uaxlnhva.js +1 -0
  412. package/dist/chunks/permissions-B3PceQul.js +1 -0
  413. package/dist/chunks/permissions-DezIL2xF.js +3 -0
  414. package/dist/chunks/permissions-DnpI8Whh.js +1 -0
  415. package/dist/chunks/pipeTransport-CB_Wq_Kx.js +1 -0
  416. package/dist/chunks/plan-cfZBclh9.js +1 -0
  417. package/dist/chunks/platform-BXz_rgpy.js +2 -0
  418. package/dist/chunks/plist-DLGDWBD6.js +6 -0
  419. package/dist/chunks/plugin-CuhENLRs.js +1 -0
  420. package/dist/chunks/pluginAutoupdate-wTeOXfQe.js +1 -0
  421. package/dist/chunks/pluginBlocklist-D6pkKfXr.js +1 -0
  422. package/dist/chunks/pluginCliCommands-DqxdCwsq.js +1 -0
  423. package/dist/chunks/pluginFlagging-CjH48f-K.js +1 -0
  424. package/dist/chunks/pluginOperations-DMFYB3pK.js +2 -0
  425. package/dist/chunks/pluginStartupCheck-BW3_KfZz.js +1 -0
  426. package/dist/chunks/pluginStartupCheck-Cj2BMjVw.js +1 -0
  427. package/dist/chunks/plugins-CarsG2v8.js +4 -0
  428. package/dist/chunks/policyLimits-DFn1vHkN.js +1 -0
  429. package/dist/chunks/pollConfig-C8nODJY1.js +1 -0
  430. package/dist/chunks/poller-DXZJ-dUP.js +1 -0
  431. package/dist/chunks/poor-C7GQ4a5X.js +1 -0
  432. package/dist/chunks/poorMode-CBe0rfxB.js +1 -0
  433. package/dist/chunks/poorMode-CbZTudtw.js +1 -0
  434. package/dist/chunks/postCommitAttribution--vvAWIqD.js +1 -0
  435. package/dist/chunks/print-CwwtGSbK.js +114 -0
  436. package/dist/chunks/privacy-settings-Bz8cAVp5.js +11 -0
  437. package/dist/chunks/privacyLevel-CRCHhztk.js +1 -0
  438. package/dist/chunks/process-CnhUplBr.js +1 -0
  439. package/dist/chunks/process-X4vCP9x0.js +1 -0
  440. package/dist/chunks/processBashCommand-NL0YEUqW.js +3 -0
  441. package/dist/chunks/processSlashCommand-FPMWElsI.js +6 -0
  442. package/dist/chunks/processSlashCommand-_oJs6_w8.js +6 -0
  443. package/dist/chunks/processUserInput-QAJK0XSn.js +1 -0
  444. package/dist/chunks/projectContext-B21hXj9q.js +1 -0
  445. package/dist/chunks/projectContext-DbTQHQS3.js +1 -0
  446. package/dist/chunks/prompt-C6eleu4x.js +1 -0
  447. package/dist/chunks/prompt-CUdoQXyN.js +1 -0
  448. package/dist/chunks/prompt-CsBCtw4l.js +228 -0
  449. package/dist/chunks/prompt-hnIDYhP4.js +54 -0
  450. package/dist/chunks/promptEditor-CrlVcc17.js +4 -0
  451. package/dist/chunks/protectedNamespace-Cn4901XG.js +1 -0
  452. package/dist/chunks/protocolHandler-DM_w7sJ5.js +13 -0
  453. package/dist/chunks/protocols-CpoQzjyI.js +7 -0
  454. package/dist/chunks/proxy-9WvtUy8E.js +99 -0
  455. package/dist/chunks/rate-limit-options-BehQ3MoX.js +1 -0
  456. package/dist/chunks/rcDebugLog-BbHlIxCm.js +11 -0
  457. package/dist/chunks/referral-BfAZEIZL.js +1 -0
  458. package/dist/chunks/refresh-Bl3Miver.js +1 -0
  459. package/dist/chunks/registerProtocol-BHZ3vZED.js +36 -0
  460. package/dist/chunks/registerSkillHooks-BR7v5qDA.js +1 -0
  461. package/dist/chunks/registry-C2igpRd-.js +1 -0
  462. package/dist/chunks/release-notes-C_Cou6ye.js +4 -0
  463. package/dist/chunks/releaseNotes-DveQShyB.js +2 -0
  464. package/dist/chunks/reload-plugins-D-pAUoB5.js +1 -0
  465. package/dist/chunks/remote-env-C_dBgbgo.js +1 -0
  466. package/dist/chunks/remoteBridgeCore-BxWhTy1u.js +1 -0
  467. package/dist/chunks/remoteControlServer-D3OjUlB-.js +3 -0
  468. package/dist/chunks/rename-f3m0ETSt.js +1 -0
  469. package/dist/chunks/renderOptions-QZLxGnh_.js +1 -0
  470. package/dist/chunks/replBridge-qeVmCJOb.js +1 -0
  471. package/dist/chunks/resume-CM_8p9Iu.js +2 -0
  472. package/dist/chunks/rewind-0cB7o6fx.js +1 -0
  473. package/dist/chunks/ripgrep-BEWqxrpl.js +5 -0
  474. package/dist/chunks/ripgrep-G82m12Ng.js +1 -0
  475. package/dist/chunks/rollback-CVo2gqgR.js +11 -0
  476. package/dist/chunks/runtimeObserver-1EdvvoYw.js +1 -0
  477. package/dist/chunks/runtimeObserver-CX6vepq9.js +10 -0
  478. package/dist/chunks/sandbox-adapter-DzHfW2tH.js +1 -0
  479. package/dist/chunks/sandbox-toggle-N6KgmH2T.js +1 -0
  480. package/dist/chunks/sanitization-CIBpY9KT.js +1 -0
  481. package/dist/chunks/satisfies-B7ZvBUQP.js +1 -0
  482. package/dist/chunks/schemas-Bwt-7U5W.js +40 -0
  483. package/dist/chunks/sdk-Drp69kIx.js +1 -0
  484. package/dist/chunks/sdkHeapDumpMonitor-B9GVkISU.js +1 -0
  485. package/dist/chunks/searchExtraTools-BphNJsl8.js +1 -0
  486. package/dist/chunks/semver-BsItM2Z4.js +1 -0
  487. package/dist/chunks/semver-D3lOjiBN.js +1 -0
  488. package/dist/chunks/sentry-ySzRCXGd.js +1 -0
  489. package/dist/chunks/server-C8nMDji6.js +1 -0
  490. package/dist/chunks/server-XZG51Slr.js +1 -0
  491. package/dist/chunks/serverBanner-D68EBGzH.js +1 -0
  492. package/dist/chunks/serverLog-hv2hc5US.js +1 -0
  493. package/dist/chunks/session-CVoGFb8a.js +2 -0
  494. package/dist/chunks/sessionDataUploader-BaD1Q7v3.js +1 -0
  495. package/dist/chunks/sessionDiscovery-D7g66TX6.js +1 -0
  496. package/dist/chunks/sessionFileAccessHooks-9lPjspRX.js +1 -0
  497. package/dist/chunks/sessionManager-BhOjMNAP.js +1 -0
  498. package/dist/chunks/sessionMemory-BA6cdxqP.js +1 -0
  499. package/dist/chunks/sessionMemory-CtEhIRGF.js +1 -0
  500. package/dist/chunks/sessionMemoryUtils-D_B92ypa.js +1 -0
  501. package/dist/chunks/sessionObserver-CESI-uVZ.js +1 -0
  502. package/dist/chunks/sessionObserver-SpE_eglb.js +20 -0
  503. package/dist/chunks/sessionRestore-DqsqYK4K.js +1 -0
  504. package/dist/chunks/sessionState-Dgky34M4.js +1 -0
  505. package/dist/chunks/sessionStorage-DJb5HKhQ.js +1 -0
  506. package/dist/chunks/sessionStorage-DSMfHTcg.js +1 -0
  507. package/dist/chunks/sessionStoragePortable-DyM_hZnp.js +3 -0
  508. package/dist/chunks/sessionTitle-Bzxk_EW9.js +14 -0
  509. package/dist/chunks/sessionTracing-DR8O0686.js +12 -0
  510. package/dist/chunks/setup-BHNS9sBS.js +9 -0
  511. package/dist/chunks/setup-BafJxZ0F.js +4 -0
  512. package/dist/chunks/setup-MLNNYLi6.js +1 -0
  513. package/dist/chunks/shadowedRuleDetection-Ch9gTxfD.js +1 -0
  514. package/dist/chunks/shellQuote-3s6tV-hK.js +1 -0
  515. package/dist/chunks/sideQuestion-BBn6XIOD.js +20 -0
  516. package/dist/chunks/signal-BTxmab6r.js +1 -0
  517. package/dist/chunks/signin-ChbUAEGq.js +1 -0
  518. package/dist/chunks/sink-B1qICbRh.js +1 -0
  519. package/dist/chunks/sink-yBIcxQf1.js +1 -0
  520. package/dist/chunks/sinks-C7weduDR.js +1 -0
  521. package/dist/chunks/skill-learning-08nEdOJ2.js +5 -0
  522. package/dist/chunks/skillGapStore-CuvWGqFb.js +5 -0
  523. package/dist/chunks/skillGapStore-DmMuDXKO.js +1 -0
  524. package/dist/chunks/skillGenerator-mEMjcmmm.js +8 -0
  525. package/dist/chunks/skillLearning-B3a-8Ys3.js +1 -0
  526. package/dist/chunks/skillLearning-q5T6o0mH.js +1 -0
  527. package/dist/chunks/skillPanel-BuUMhONI.js +28 -0
  528. package/dist/chunks/skillSearchPanel-BUEv7Sm9.js +21 -0
  529. package/dist/chunks/skillUsageTracking-BBTiWOKB.js +1 -0
  530. package/dist/chunks/skills-DvQuQfDW.js +1 -0
  531. package/dist/chunks/slashCommandParsing-BkTC3GRb.js +1 -0
  532. package/dist/chunks/sleep-CC8jykQd.js +1 -0
  533. package/dist/chunks/slowOperations-niPqC54V.js +1 -0
  534. package/dist/chunks/sprites-C5X62Vyh.js +1 -0
  535. package/dist/chunks/src-58uAJYF_.js +6 -0
  536. package/dist/chunks/src-7Y8fx6gl.js +2 -0
  537. package/dist/chunks/src-BuserDTl.js +1 -0
  538. package/dist/chunks/src-CMY4XoRy.js +1 -0
  539. package/dist/chunks/src-CfeAM1FB.js +1 -0
  540. package/dist/chunks/src-CxT2FDXy.js +1 -0
  541. package/dist/chunks/src-CyQf7rVu.js +26 -0
  542. package/dist/chunks/src-DJLbU8sT.js +1 -0
  543. package/dist/chunks/src-DJQlyVK6.js +5 -0
  544. package/dist/chunks/src-DNHWYkls.js +53 -0
  545. package/dist/chunks/src-DU_g0n_Q.js +1 -0
  546. package/dist/chunks/src-DhqzQjMg.js +19 -0
  547. package/dist/chunks/src-Duzv1Znh.js +1 -0
  548. package/dist/chunks/src-OBx6GAig.js +1 -0
  549. package/dist/chunks/src-WjnK2Dbo.js +1 -0
  550. package/dist/chunks/src-hjAMxWFj.js +7 -0
  551. package/dist/chunks/src-lLwoqdC0.js +9 -0
  552. package/dist/chunks/src-yRsWbJp_.js +2 -0
  553. package/dist/chunks/sso-oidc-yfC-A2A2.js +1 -0
  554. package/dist/chunks/startupProfiler-4P7GdVw6.js +3 -0
  555. package/dist/chunks/startupProfiler-CipS0otN.js +1 -0
  556. package/dist/chunks/state-9wSimHaL.js +1 -0
  557. package/dist/chunks/state-BQkyHx88.js +1 -0
  558. package/dist/chunks/state-CEAUTY3A.js +1 -0
  559. package/dist/chunks/state-CUZTq6r0.js +1 -0
  560. package/dist/chunks/state-U0HNbTx8.js +1 -0
  561. package/dist/chunks/staticRender-BB3CisKd.js +1 -0
  562. package/dist/chunks/stats-Dyi2U_mq.js +1 -0
  563. package/dist/chunks/status-CSL-GMou.js +1 -0
  564. package/dist/chunks/statusNoticeHelpers-BaXE951d.js +1 -0
  565. package/dist/chunks/stdio-BuUJYJFs.js +3 -0
  566. package/dist/chunks/stdio-iX0TTmbp.js +1 -0
  567. package/dist/chunks/stickers-2CRSckfH.js +1 -0
  568. package/dist/chunks/store-DdfsZvtr.js +1 -0
  569. package/dist/chunks/stringUtils-U7kMYMJq.js +4 -0
  570. package/dist/chunks/sts-CJmdeT7s.js +1 -0
  571. package/dist/chunks/subprocessEnv-DKTILev5.js +1 -0
  572. package/dist/chunks/subprocessEnv-WjRguKWf.js +1 -0
  573. package/dist/chunks/supports-color-DaytqqjM.js +1 -0
  574. package/dist/chunks/systemPromptSections-BnrxBWdc.js +1 -0
  575. package/dist/chunks/systemPromptSections-Dk6azdAb.js +1 -0
  576. package/dist/chunks/systemTheme-C1GNqIfy.js +1 -0
  577. package/dist/chunks/tag-C4cH016L.js +11 -0
  578. package/dist/chunks/tasks-CEdUW3RQ.js +1 -0
  579. package/dist/chunks/teamHelpers-CTA_CtTT.js +1 -0
  580. package/dist/chunks/teamHelpers-D65qZInv.js +1 -0
  581. package/dist/chunks/teammate-C-FiRloZ.js +1 -0
  582. package/dist/chunks/teammateModeSnapshot-DWRG5-Us.js +1 -0
  583. package/dist/chunks/teammateModeSnapshot-DtgsNj1G.js +1 -0
  584. package/dist/chunks/teleport-C_UgMy0V.js +1 -0
  585. package/dist/chunks/templateJobs-CMbS0tuk.js +12 -0
  586. package/dist/chunks/terminalSetup--jwGVap8.js +33 -0
  587. package/dist/chunks/terminalSetup-zID-wokH.js +1 -0
  588. package/dist/chunks/theme-C6XwTpVy.js +1 -0
  589. package/dist/chunks/thinkback-CVLnmLAT.js +1 -0
  590. package/dist/chunks/thinkback-MeOOO7gf.js +1 -0
  591. package/dist/chunks/thinkback-play-D7G260F4.js +1 -0
  592. package/dist/chunks/tmux-DtYJuTWh.js +1 -0
  593. package/dist/chunks/toolEventObserver-BtC9xDYY.js +1 -0
  594. package/dist/chunks/toolEventObserver-MfsHAt8h.js +1 -0
  595. package/dist/chunks/toolPool-CEi_2xIH.js +1 -0
  596. package/dist/chunks/toolPool-CdYJcCnc.js +1 -0
  597. package/dist/chunks/trustedDevice-CjQTGAa4.js +1 -0
  598. package/dist/chunks/trustedDevice-DADcxAAs.js +1 -0
  599. package/dist/chunks/tui-B8Ijq4Pk.js +6 -0
  600. package/dist/chunks/turndown.es-T-Xe93nc.js +69 -0
  601. package/dist/chunks/types-BVelRhgb.js +17 -0
  602. package/dist/chunks/types-Bqp3meR4.js +1 -0
  603. package/dist/chunks/types-CNmINIu3.js +1 -0
  604. package/dist/chunks/types-DgzOOCDl.js +3 -0
  605. package/dist/chunks/udsClient-ClY_0CKr.js +1 -0
  606. package/dist/chunks/ultrareviewCommand-CqvHj9Io.js +3 -0
  607. package/dist/chunks/undercover-CVCVOSrs.js +1 -0
  608. package/dist/chunks/undercover-CbxiJO2b.js +31 -0
  609. package/dist/chunks/up-CBJhVVbd.js +12 -0
  610. package/dist/chunks/updateCCB-DPPpquAw.js +11 -0
  611. package/dist/chunks/upgrade-DaaHOvft.js +1 -0
  612. package/dist/chunks/upgrade-k7ZvAWZ0.js +1 -0
  613. package/dist/chunks/upload-CEDxwMa1.js +1 -0
  614. package/dist/chunks/upstreamproxy-BtGJ2LRi.js +11 -0
  615. package/dist/chunks/usage-CsUSu4fb.js +1 -0
  616. package/dist/chunks/usage-oABvixCs.js +1 -0
  617. package/dist/chunks/useExitOnCtrlCDWithKeybindings-CBce_-hb.js +1 -0
  618. package/dist/chunks/useExitOnCtrlCDWithKeybindings-CLYjTZXb.js +1 -0
  619. package/dist/chunks/useKeybinding-DAQL_dB_.js +1 -0
  620. package/dist/chunks/useMainLoopModel-QC_H3esG.js +1 -0
  621. package/dist/chunks/useManageMCPConnections-bf-VfJGD.js +1 -0
  622. package/dist/chunks/useManagePlugins-CXdYUpit.js +1 -0
  623. package/dist/chunks/useMergedTools-DERzhQOJ.js +1 -0
  624. package/dist/chunks/useSearchInput-nqhdILI2.js +1 -0
  625. package/dist/chunks/useTerminalSize-DzV4aaTi.js +1 -0
  626. package/dist/chunks/useVoice-CO69xtWC.js +1 -0
  627. package/dist/chunks/util-C8wqPqv0.js +1 -0
  628. package/dist/chunks/utils-CDFsSXHr.js +1 -0
  629. package/dist/chunks/utils-ZO5TryVH.js +1 -0
  630. package/dist/chunks/v4-DLhvDPkt.js +1 -0
  631. package/dist/chunks/validatePlugin-C4cd71Yz.js +1 -0
  632. package/dist/chunks/vertex-sdk-CC3U26o7.js +9 -0
  633. package/dist/chunks/vim-BNiQx5Vf.js +1 -0
  634. package/dist/chunks/voice-BCbnJzYL.js +8 -0
  635. package/dist/chunks/voice-BJyz9KZO.js +8 -0
  636. package/dist/chunks/voice-CP2ULpju.js +2 -0
  637. package/dist/chunks/voiceModeEnabled-C-pa8B3Q.js +1 -0
  638. package/dist/chunks/voiceModeEnabled-CMtRN2pa.js +1 -0
  639. package/dist/chunks/voiceStreamSTT-31b2u0rj.js +1 -0
  640. package/dist/chunks/voiceStreamSTT-Fkhm6Ftg.js +1 -0
  641. package/dist/chunks/voiceStreamSTT-sI-hg-aP.js +1 -0
  642. package/dist/chunks/web-tools-CLmlPgLk.js +1 -0
  643. package/dist/chunks/which-C0ex-06E.js +1 -0
  644. package/dist/chunks/windowsPaths-C5TNvKYu.js +1 -0
  645. package/dist/chunks/windowsPaths-Kue_7s52.js +1 -0
  646. package/dist/chunks/workSecret-Dh5Ayceu.js +1 -0
  647. package/dist/chunks/workerRegistry-B5iWYqpK.js +1 -0
  648. package/dist/chunks/worktree-BypJA0GB.js +1 -0
  649. package/dist/chunks/worktreeModeEnabled-DPTdK3JV.js +1 -0
  650. package/dist/chunks/worktreeModeEnabled-Dtrcn7eD.js +1 -0
  651. package/dist/chunks/wrapper-BDPb4PTV.js +6 -0
  652. package/dist/chunks/wrapper-DRTs77RK.js +1 -0
  653. package/dist/chunks/xdg-BaVL-FHd.js +1 -0
  654. package/dist/chunks/xml-E8VMPwdJ.js +1 -0
  655. package/dist/chunks/zod-B_P2Eo_D.js +1 -0
  656. package/dist/cli-bun.js +2 -0
  657. package/dist/cli-node.js +2 -0
  658. package/dist/cli.js +2 -0
  659. package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
  660. package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
  661. package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
  662. package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
  663. package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
  664. package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
  665. package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
  666. package/package.json +233 -0
  667. package/scripts/postinstall.cjs +389 -0
  668. package/scripts/run-parallel.mjs +10 -0
  669. package/scripts/setup-chrome-mcp.mjs +70 -0
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./figures-fES5sASd.js";import{Rn as r,b as i,o as a,t as o,x as s}from"./src-DNHWYkls.js";import{t as c}from"./jsx-runtime-BTgGEFjL.js";import{Hl as l,Ql as u,Vl as d,Yl as f}from"./growthbook-p4aJ_UMv.js";import{v as p,y as m}from"./startupProfiler-4P7GdVw6.js";import{HS as h,Hc as g,VS as _,Zc as v,ld as y,sd as b}from"./loadAgentsDir-Bz0FfcVt.js";import{Dn as x,Gn as S,On as C,ar as w,ir as T,nr as E,or as D,zn as O}from"./prompt-CsBCtw4l.js";import{n as ee,t as k}from"./staticRender-BB3CisKd.js";function A(e){let t=[];return j(e,t),M(e,t),P(e,t),F(e,t),I(e,t),t.sort((e,t)=>e.severity===t.severity?(t.savingsTokens??0)-(e.savingsTokens??0):e.severity===`warning`?-1:1),t}function j(e,t){e.percentage>=B&&t.push({severity:`warning`,title:`Context is ${e.percentage}% full`,detail:e.isAutoCompactEnabled?`Autocompact will trigger soon, which discards older messages. Use /compact now to control what gets kept.`:`Autocompact is disabled. Use /compact to free space, or enable autocompact in /config.`})}function M(e,t){if(e.messageBreakdown)for(let n of e.messageBreakdown.toolCallsByType){let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100;if(i<L||r<R)continue;let a=N(n.name,r,i);a&&t.push(a)}}function N(e,t,n){let r=p(t);switch(e){case w:return{severity:`warning`,title:`Bash results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Pipe output through head, tail, or grep to reduce result size. Avoid cat on large files — use Read with offset/limit instead.`,savingsTokens:Math.floor(t*.5)};case O:return{severity:`info`,title:`Read results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Use offset and limit parameters to read only the sections you need. Avoid re-reading entire files when you only need a few lines.`,savingsTokens:Math.floor(t*.3)};case E:return{severity:`info`,title:`Grep results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Add more specific patterns or use the glob or type parameter to narrow file types. Consider Glob for file discovery instead of Grep.`,savingsTokens:Math.floor(t*.3)};case x:return{severity:`info`,title:`WebFetch results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Web page content can be very large. Consider extracting only the specific information needed.`,savingsTokens:Math.floor(t*.4)};default:return n>=20?{severity:`info`,title:`${e} using ${r} tokens (${n.toFixed(0)}%)`,detail:`This tool is consuming a significant portion of context.`,savingsTokens:Math.floor(t*.2)}:null}}function P(e,t){if(!e.messageBreakdown)return;let n=e.messageBreakdown.toolCallsByType.find(e=>e.name===O);if(!n)return;let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100,a=n.resultTokens/e.rawMaxTokens*100;i>=L&&r>=R||a>=z&&n.resultTokens>=R&&t.push({severity:`info`,title:`File reads using ${p(n.resultTokens)} tokens (${a.toFixed(0)}%)`,detail:`If you are re-reading files, consider referencing earlier reads. Use offset/limit for large files.`,savingsTokens:Math.floor(n.resultTokens*.3)})}function F(e,t){let n=e.memoryFiles.reduce((e,t)=>e+t.tokens,0),r=n/e.rawMaxTokens*100;if(r>=V&&n>=H){let i=[...e.memoryFiles].sort((e,t)=>t.tokens-e.tokens).slice(0,3).map(e=>`${f(e.path)} (${p(e.tokens)})`).join(`, `);t.push({severity:`info`,title:`Memory files using ${p(n)} tokens (${r.toFixed(0)}%)`,detail:`Largest: ${i}. Use /memory to review and prune stale entries.`,savingsTokens:Math.floor(n*.3)})}}function I(e,t){!e.isAutoCompactEnabled&&e.percentage>=50&&e.percentage<B&&t.push({severity:`info`,title:`Autocompact is disabled`,detail:`Without autocompact, you will hit context limits and lose the conversation. Enable it in /config or use /compact manually.`})}var L,R,z,B,V,H,U=e((()=>{D(),S(),T(),C(),u(),m(),L=15,R=1e4,z=5,B=80,V=5,H=5e3}));function W({suggestions:e}){return e.length===0?null:(0,G.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,G.jsx)(i,{bold:!0,children:`Suggestions`}),e.map((e,t)=>(0,G.jsxs)(s,{flexDirection:`column`,marginTop:t===0?0:1,children:[(0,G.jsxs)(s,{children:[(0,G.jsx)(a,{status:e.severity,withSpace:!0}),(0,G.jsx)(i,{bold:!0,children:e.title}),e.savingsTokens?(0,G.jsxs)(i,{dimColor:!0,children:[` `,n.arrowRight,` save ~`,p(e.savingsTokens)]}):null]}),(0,G.jsx)(s,{marginLeft:2,children:(0,G.jsx)(i,{dimColor:!0,children:e.detail})})]},t))]})}var G,K=e((()=>{t(),r(),o(),m(),G=c()}));function q(){return null}function J(e){let t=new Map;for(let n of e){let e=d(n.source),r=t.get(e)||[];r.push(n),t.set(e,r)}for(let[e,n]of t.entries())t.set(e,n.sort((e,t)=>t.tokens-e.tokens));let n=new Map;for(let e of Q){let r=t.get(e);r&&n.set(e,r)}return n}function Y({data:e}){let{categories:t,totalTokens:n,rawMaxTokens:r,percentage:a,gridRows:o,model:c,memoryFiles:l,mcpTools:u,deferredBuiltinTools:d=[],systemTools:m,systemPromptSections:h,agents:g,skills:_,messageBreakdown:v,cacheHitRate:y,cacheThreshold:b}=e,x=t.filter(e=>e.tokens>0&&e.name!==`Free space`&&e.name!==Z&&!e.isDeferred),S=t.some(e=>e.isDeferred&&e.name.includes(`MCP`)),C=d.length>0,w=t.find(e=>e.name===Z);return(0,X.jsxs)(s,{flexDirection:`column`,paddingLeft:1,children:[(0,X.jsx)(i,{bold:!0,children:`Context Usage`}),(0,X.jsxs)(s,{flexDirection:`row`,gap:2,children:[(0,X.jsx)(s,{flexDirection:`column`,flexShrink:0,children:o.map((e,t)=>(0,X.jsx)(s,{flexDirection:`row`,marginLeft:-1,children:e.map((e,t)=>e.categoryName===`Free space`?(0,X.jsx)(i,{dimColor:!0,children:`⛶ `},t):e.categoryName===Z?(0,X.jsx)(i,{color:e.color,children:`⛝ `},t):(0,X.jsx)(i,{color:e.color,children:e.squareFullness>=.7?`⛁ `:`⛀ `},t))},t))}),(0,X.jsxs)(s,{flexDirection:`column`,gap:0,flexShrink:0,children:[(0,X.jsxs)(i,{dimColor:!0,children:[c,` · `,p(n),`/`,p(r),` tokens (`,a,`%)`]}),(0,X.jsx)(q,{}),y!==void 0&&b!==void 0&&(0,X.jsxs)(i,{color:y<b?`warning`:void 0,children:[`Cache hit rate: `,y.toFixed(0),`%`,y<b?` (below ${b}% threshold)`:``]}),(0,X.jsx)(i,{children:` `}),(0,X.jsx)(i,{dimColor:!0,italic:!0,children:`Estimated usage by category`}),x.map((e,t)=>{let n=p(e.tokens),a=e.isDeferred?`N/A`:`${(e.tokens/r*100).toFixed(1)}%`,o=e.name===Z,c=e.name,l=e.isDeferred?` `:o?`⛝`:`⛁`;return(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{color:e.color,children:l}),(0,X.jsxs)(i,{children:[` `,c,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[n,` tokens (`,a,`)`]})]},t)}),(t.find(e=>e.name===`Free space`)?.tokens??0)>0&&(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{dimColor:!0,children:`⛶`}),(0,X.jsx)(i,{children:` Free space: `}),(0,X.jsxs)(i,{dimColor:!0,children:[p(t.find(e=>e.name===`Free space`)?.tokens||0),` (`,((t.find(e=>e.name===`Free space`)?.tokens||0)/r*100).toFixed(1),`%)`]})]}),w&&w.tokens>0&&(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{color:w.color,children:`⛝`}),(0,X.jsxs)(i,{dimColor:!0,children:[` `,w.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(w.tokens),` tokens (`,(w.tokens/r*100).toFixed(1),`%)`]})]})]})]}),(0,X.jsxs)(s,{flexDirection:`column`,marginLeft:-1,children:[u.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`MCP tools`}),(0,X.jsxs)(i,{dimColor:!0,children:[` · /mcp`,S?` (loaded on-demand)`:``]})]}),u.some(e=>e.isLoaded)&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:`Loaded`}),u.filter(e=>e.isLoaded).map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]}),S&&u.some(e=>!e.isLoaded)&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:`Available`}),u.filter(e=>!e.isLoaded).map((e,t)=>(0,X.jsx)(s,{children:(0,X.jsxs)(i,{dimColor:!0,children:[`└ `,e.name]})},t))]}),!S&&u.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]}),(m&&m.length>0||C)&&process.env.USER_TYPE===`ant`&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] System tools`}),C&&(0,X.jsx)(i,{dimColor:!0,children:` (some loaded on-demand)`})]}),(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:`Loaded`}),m?.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},`sys-${t}`)),d.filter(e=>e.isLoaded).map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},`def-${t}`))]}),C&&d.some(e=>!e.isLoaded)&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:`Available`}),d.filter(e=>!e.isLoaded).map((e,t)=>(0,X.jsx)(s,{children:(0,X.jsxs)(i,{dimColor:!0,children:[`└ `,e.name]})},t))]})]}),h&&h.length>0&&process.env.USER_TYPE===`ant`&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] System prompt sections`}),h.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]}),g.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`Custom agents`}),(0,X.jsx)(i,{dimColor:!0,children:` · /agents`})]}),Array.from(J(g).entries()).map(([e,t])=>(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:e}),t.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.agentType,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]},e))]}),l.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`Memory files`}),(0,X.jsx)(i,{dimColor:!0,children:` · /memory`})]}),l.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,f(e.path),`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]}),_&&_.tokens>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`Skills`}),(0,X.jsx)(i,{dimColor:!0,children:` · /skills`})]}),Array.from(J(_.skillFrontmatter).entries()).map(([e,t])=>(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:e}),t.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]},e))]}),v&&process.env.USER_TYPE===`ant`&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] Message breakdown`}),(0,X.jsxs)(s,{flexDirection:`column`,marginLeft:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`Tool calls: `}),(0,X.jsxs)(i,{dimColor:!0,children:[p(v.toolCallTokens),` tokens`]})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`Tool results: `}),(0,X.jsxs)(i,{dimColor:!0,children:[p(v.toolResultTokens),` tokens`]})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`Attachments: `}),(0,X.jsxs)(i,{dimColor:!0,children:[p(v.attachmentTokens),` tokens`]})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`Assistant messages (non-tool): `}),(0,X.jsxs)(i,{dimColor:!0,children:[p(v.assistantMessageTokens),` tokens`]})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`User messages (non-tool-result): `}),(0,X.jsxs)(i,{dimColor:!0,children:[p(v.userMessageTokens),` tokens`]})]})]}),v.toolCallsByType.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] Top tools`}),v.toolCallsByType.slice(0,5).map((e,t)=>(0,X.jsxs)(s,{marginLeft:1,children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[`calls `,p(e.callTokens),`, results `,p(e.resultTokens)]})]},t))]}),v.attachmentsByType.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] Top attachments`}),v.attachmentsByType.slice(0,5).map((e,t)=>(0,X.jsxs)(s,{marginLeft:1,children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]})]})]}),(0,X.jsx)(W,{suggestions:A(e)})]})}var X,Z,Q,te=e((()=>{r(),o(),U(),u(),m(),l(),K(),X=c(),Z=`Autocompact buffer`,Q=[`Project`,`User`,`Managed`,`Plugin`,`Built-in`]}));function ne(e){return g(e)}async function re(e,t){let{messages:n,getAppState:r,options:{mainLoopModel:i,tools:a}}=t,o=ne(n),{messages:s}=await h(o),c=process.stdout.columns||80,l=r();return e(await ee((0,$.jsx)(Y,{data:await b(s,i,async()=>l.toolPermissionContext,a,l.agentDefinitions,c,t,void 0,o)}))),null}var $;e((()=>{r(),te(),_(),y(),v(),k(),$=c()}))();export{re as call};
@@ -0,0 +1,54 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Hl as t,Vl as n}from"./growthbook-p4aJ_UMv.js";import{v as r,y as i}from"./startupProfiler-4P7GdVw6.js";import{HS as a,Hc as o,VS as s,Zc as c,ld as l,sd as u}from"./loadAgentsDir-Bz0FfcVt.js";async function d(e){let{messages:t,getAppState:n,options:{mainLoopModel:r,tools:i,agentDefinitions:s,customSystemPrompt:c,appendSystemPrompt:l}}=e,d=o(t),{messages:f}=await a(d),p=n();return u(f,r,async()=>p.toolPermissionContext,i,s,void 0,{options:{customSystemPrompt:c,appendSystemPrompt:l}},void 0,d)}async function f(e,t){return{type:`text`,value:p(await d(t))}}function p(e){let{categories:t,totalTokens:i,rawMaxTokens:a,percentage:o,model:s,memoryFiles:c,mcpTools:l,agents:u,skills:d,messageBreakdown:f,systemTools:p,systemPromptSections:m}=e,h=`## Context Usage
2
+
3
+ `;h+=`**Model:** ${s} \n`,h+=`**Tokens:** ${r(i)} / ${r(a)} (${o}%)\n`,h+=`
4
+ `;let g=t.filter(e=>e.tokens>0&&e.name!==`Free space`&&e.name!==`Autocompact buffer`);if(g.length>0){h+=`### Estimated usage by category
5
+
6
+ `,h+=`| Category | Tokens | Percentage |
7
+ `,h+=`|----------|--------|------------|
8
+ `;for(let e of g){let t=(e.tokens/a*100).toFixed(1);h+=`| ${e.name} | ${r(e.tokens)} | ${t}% |\n`}let e=t.find(e=>e.name===`Free space`);if(e&&e.tokens>0){let t=(e.tokens/a*100).toFixed(1);h+=`| Free space | ${r(e.tokens)} | ${t}% |\n`}let n=t.find(e=>e.name===`Autocompact buffer`);if(n&&n.tokens>0){let e=(n.tokens/a*100).toFixed(1);h+=`| Autocompact buffer | ${r(n.tokens)} | ${e}% |\n`}h+=`
9
+ `}if(l.length>0){h+=`### MCP Tools
10
+
11
+ `,h+=`| Tool | Server | Tokens |
12
+ `,h+=`|------|--------|--------|
13
+ `;for(let e of l)h+=`| ${e.name} | ${e.serverName} | ${r(e.tokens)} |\n`;h+=`
14
+ `}if(p&&p.length>0&&process.env.USER_TYPE===`ant`){h+=`### [ANT-ONLY] System Tools
15
+
16
+ `,h+=`| Tool | Tokens |
17
+ `,h+=`|------|--------|
18
+ `;for(let e of p)h+=`| ${e.name} | ${r(e.tokens)} |\n`;h+=`
19
+ `}if(m&&m.length>0&&process.env.USER_TYPE===`ant`){h+=`### [ANT-ONLY] System Prompt Sections
20
+
21
+ `,h+=`| Section | Tokens |
22
+ `,h+=`|---------|--------|
23
+ `;for(let e of m)h+=`| ${e.name} | ${r(e.tokens)} |\n`;h+=`
24
+ `}if(u.length>0){h+=`### Custom Agents
25
+
26
+ `,h+=`| Agent Type | Source | Tokens |
27
+ `,h+=`|------------|--------|--------|
28
+ `;for(let e of u){let t;switch(e.source){case`projectSettings`:t=`Project`;break;case`userSettings`:t=`User`;break;case`localSettings`:t=`Local`;break;case`flagSettings`:t=`Flag`;break;case`policySettings`:t=`Policy`;break;case`plugin`:t=`Plugin`;break;case`built-in`:t=`Built-in`;break;default:t=String(e.source)}h+=`| ${e.agentType} | ${t} | ${r(e.tokens)} |\n`}h+=`
29
+ `}if(c.length>0){h+=`### Memory Files
30
+
31
+ `,h+=`| Type | Path | Tokens |
32
+ `,h+=`|------|------|--------|
33
+ `;for(let e of c)h+=`| ${e.type} | ${e.path} | ${r(e.tokens)} |\n`;h+=`
34
+ `}if(d&&d.tokens>0&&d.skillFrontmatter.length>0){h+=`### Skills
35
+
36
+ `,h+=`| Skill | Source | Tokens |
37
+ `,h+=`|-------|--------|--------|
38
+ `;for(let e of d.skillFrontmatter)h+=`| ${e.name} | ${n(e.source)} | ${r(e.tokens)} |\n`;h+=`
39
+ `}if(f&&process.env.USER_TYPE===`ant`){if(h+=`### [ANT-ONLY] Message Breakdown
40
+
41
+ `,h+=`| Category | Tokens |
42
+ `,h+=`|----------|--------|
43
+ `,h+=`| Tool calls | ${r(f.toolCallTokens)} |\n`,h+=`| Tool results | ${r(f.toolResultTokens)} |\n`,h+=`| Attachments | ${r(f.attachmentTokens)} |\n`,h+=`| Assistant messages (non-tool) | ${r(f.assistantMessageTokens)} |\n`,h+=`| User messages (non-tool-result) | ${r(f.userMessageTokens)} |\n`,h+=`
44
+ `,f.toolCallsByType.length>0){h+=`#### Top Tools
45
+
46
+ `,h+=`| Tool | Call Tokens | Result Tokens |
47
+ `,h+=`|------|-------------|---------------|
48
+ `;for(let e of f.toolCallsByType)h+=`| ${e.name} | ${r(e.callTokens)} | ${r(e.resultTokens)} |\n`;h+=`
49
+ `}if(f.attachmentsByType.length>0){h+=`#### Top Attachments
50
+
51
+ `,h+=`| Attachment | Tokens |
52
+ `,h+=`|------------|--------|
53
+ `;for(let e of f.attachmentsByType)h+=`| ${e.name} | ${r(e.tokens)} |\n`;h+=`
54
+ `}}return h}e((()=>{s(),l(),i(),c(),t()}))();export{f as call,d as collectContextData};
@@ -0,0 +1 @@
1
+ function e(e){if(typeof e!=`object`||!e)return e;let t=e;if(`requestId`in t&&!(`request_id`in t)&&(t.request_id=t.requestId,delete t.requestId),`response`in t&&t.response!==null&&typeof t.response==`object`){let e=t.response;`requestId`in e&&!(`request_id`in e)&&(e.request_id=e.requestId,delete e.requestId)}return e}export{e as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./conversation-yhs7tT-g.js";e();export{t as clearConversation};
@@ -0,0 +1 @@
1
+ import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{B as n,Cn as r,Ht as i,Jt as a,K as o,Zt as s,at as c,bn as l,xn as ee}from"./state-CUZTq6r0.js";import{o as u,s as d}from"./log-DVv8YiNo.js";import{n as f,r as p}from"./analytics-i6X1et4O.js";import{DF as m,GC as h,GS as g,KC as te,KS as ne,MS as _,TT as re,Ut as ie,Wn as v,af as y,bF as b,br as x,dA as S,dp as C,er as w,fS as T,fi as E,fp as D,fs as O,gn as k,hi as A,ht as j,kS as M,lA as N,nn as P,of as F,pS as I,ps as L,ti as ae,un as R,vn as z,vt as B,wT as V,yn as H}from"./loadAgentsDir-Bz0FfcVt.js";import{c as U,d as W}from"./debugUtils-Dsg-UHeg.js";import{l as G,r as K}from"./commitAttribution-B0cXmbvv.js";import{r as q,s as J}from"./rcDebugLog-BbHlIxCm.js";import{n as oe,t as se}from"./caches-CkSv3MfC.js";import{randomUUID as Y}from"crypto";function ce(e){Q=e,_(Z()??null).catch(()=>{})}function X(){return Q}function Z(){let e=X();return e?W(e.bridgeSessionId):void 0}var Q,$=t((()=>{M(),U(),Q=null}));function le(){let e=X();if(!e)return;e.markTranscriptReset?.();let t={type:`status`,subtype:`status`,status:`conversation_cleared`,message:`conversation_cleared`,uuid:Y()};e.writeSdkMessages([t])}async function ue({setMessages:t,readFileState:i,discoveredSkillNames:u,loadedNestedMemoryPaths:f,getAppState:m,setAppState:h,setConversationId:g}){let _=P();await ie(`clear`,{getAppState:m,setAppState:h,signal:AbortSignal.timeout(_),timeoutMs:_});let y=n();y&&p(`tengu_cache_eviction_hint`,{scope:`conversation_clear`,last_request_id:y});let S=new Set,T=[],O=e=>`isBackgrounded`in e&&e.isBackgrounded===!1;if(m)for(let e of Object.values(m().tasks))O(e)||(F(e)?(S.add(e.agentId),T.push(e)):re(e)&&S.add(e.identity.agentId));t(()=>[]),le();{let{setContextBlocked:t}=(q(),e(J));t(!1)}g&&g(Y()),se(S),l(null),ee(null),r(null),s(),ne(null),L(o()),i.clear(),u?.clear(),f?.clear(),h&&h(e=>{let t={};for(let[n,r]of Object.entries(e.tasks)){if(!O(r)){t[n]=r;continue}try{r.status===`running`&&(I(r)&&(r.shellCommand?.kill(),r.shellCommand?.cleanup(),r.cleanupTimeoutId&&clearTimeout(r.cleanupTimeoutId)),`abortController`in r&&r.abortController?.abort(),`unregisterCleanup`in r&&r.unregisterCleanup?.())}catch(e){d(e)}k(n)}return{...e,tasks:t,attribution:K(),standaloneAgentContext:void 0,fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:e.mcp.pluginReconnectKey}}}),b(),v(),a({setCurrentAsParent:!0}),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_SESSION_ID&&(process.env.CLAUDE_CODE_SESSION_ID=c()),await ae();for(let e of T)e.status===`running`&&z(e.id,w(N(e.agentId)));{let{saveMode:t}=(x(),e(A)),{isCoordinatorMode:n}=(D(),e(C));t(n()?`coordinator`:`normal`)}let M=j();M&&E(M);let R=await te(`clear`);R.length>0&&t(()=>R)}var de=t((()=>{$(),i(),f(),V(),y(),T(),S(),g(),G(),R(),u(),m(),O(),h(),x(),H(),B(),oe()}));export{ce as i,de as n,$ as r,ue as t};
@@ -0,0 +1,7 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Cn as n,Rn as r,b as i,g as a,h as o,p as s,t as c,tn as l,x as u}from"./src-DNHWYkls.js";import{t as d}from"./jsx-runtime-BTgGEFjL.js";import{_s as f,ls as p,xs as m}from"./growthbook-p4aJ_UMv.js";import{a as h,n as g}from"./stringUtils-U7kMYMJq.js";import{n as _,r as v}from"./analytics-i6X1et4O.js";import{Pc as y,RT as b,Zc as x,aP as S,oP as C,ul as w,zT as T}from"./loadAgentsDir-Bz0FfcVt.js";import{tmpdir as E}from"os";import{join as D}from"path";import{mkdir as O,writeFile as k}from"fs/promises";function A(e){let t=S.lexer(w(e)),n=[];for(let e of t)if(e.type===`code`){let t=e;n.push({code:t.text,lang:t.lang})}return n}function j(e){let t=[];for(let n=e.length-1;n>=0&&t.length<V;n--){let r=e[n];if(r?.type!==`assistant`||r.isApiErrorMessage)continue;let i=r.message.content;if(!Array.isArray(i))continue;let a=y(i,`
2
+
3
+ `);a&&t.push(a)}return t}function M(e){if(e){let t=e.replace(/[^a-zA-Z0-9]/g,``);if(t&&t!==`plaintext`)return`.${t}`}return`.txt`}async function N(e,t){let n=D(z,t);return await O(z,{recursive:!0}),await k(n,e,`utf-8`),n}async function P(e,t){let n=await l(e);n&&process.stdout.write(n);let r=g(e,`
4
+ `)+1,i=e.length;try{return`Copied to clipboard (${i} characters, ${r} lines)\nAlso written to ${await N(e,t)}`}catch{return`Copied to clipboard (${i} characters, ${r} lines)`}}function F(e,t){let r=e.split(`
5
+ `)[0]??``;if(n(r)<=t)return r;let i=``,a=0,o=t-1;for(let e of r){let t=n(e);if(a+t>o)break;i+=e,a+=t}return i+`…`}function I({fullText:e,codeBlocks:t,messageAge:n,onDone:r}){let c=(0,L.useRef)(`full`),l=[{label:`Full response`,value:`full`,description:`${e.length} chars, ${g(e,`
6
+ `)+1} lines`},...t.map((e,t)=>{let n=g(e.code,`
7
+ `)+1;return{label:F(e.code,60),value:t,description:[e.lang,n>1?`${n} lines`:void 0].filter(Boolean).join(`, `)||void 0}}),{label:`Always copy full response`,value:`always`,description:`Skip this picker in the future (revert via /config)`}];function d(n){if(n===`full`||n===`always`)return{text:e,filename:B};let r=t[n];return{text:r.code,filename:`copy${M(r.lang)}`,blockIndex:n}}async function f(e){let i=d(e);if(e===`always`){p().copyFullResponse||m(e=>({...e,copyFullResponse:!0})),v(`tengu_copy`,{block_count:t.length,always:!0,message_age:n}),r(`${await P(i.text,i.filename)}\nPreference saved. Use /config to change copyFullResponse`);return}v(`tengu_copy`,{selected_block:i.blockIndex,block_count:t.length,message_age:n}),r(await P(i.text,i.filename))}async function h(e){let i=d(e);v(`tengu_copy`,{selected_block:i.blockIndex,block_count:t.length,message_age:n,write_shortcut:!0});try{r(`Written to ${await N(i.text,i.filename)}`)}catch(e){r(`Failed to write file: ${e instanceof Error?e.message:e}`)}}function _(e){e.key===`w`&&(e.preventDefault(),h(c.current))}return(0,R.jsx)(s,{children:(0,R.jsxs)(u,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:_,children:[(0,R.jsx)(i,{dimColor:!0,children:`Select content to copy:`}),(0,R.jsx)(b,{options:l,hideIndexes:!1,onFocus:e=>{c.current=e},onChange:e=>{f(e)},onCancel:()=>{r(`Copy cancelled`,{display:`system`})}}),(0,R.jsx)(i,{dimColor:!0,children:(0,R.jsxs)(o,{children:[(0,R.jsx)(a,{shortcut:`enter`,action:`copy`}),(0,R.jsx)(a,{shortcut:`w`,action:`write to file`}),(0,R.jsx)(a,{shortcut:`esc`,action:`cancel`})]})})]})})}var L,R,z,B,V,H;e((()=>{C(),L=t(r(),1),T(),c(),_(),f(),x(),h(),R=d(),z=D(E(),`claude`),B=`response.md`,V=20,H=async(e,t,n)=>{let r=j(t.messages);if(r.length===0)return e(`No assistant message to copy`),null;let i=0,a=n?.trim();if(a){let t=Number(a);if(!Number.isInteger(t)||t<1)return e(`Usage: /copy [N] where N is 1 (latest), 2, 3, \u2026 Got: ${a}`),null;if(t>r.length)return e(`Only ${r.length} assistant ${r.length===1?`message`:`messages`} available to copy`),null;i=t-1}let o=r[i],s=A(o),c=p();return s.length===0||c.copyFullResponse?(v(`tengu_copy`,{always:c.copyFullResponse,block_count:s.length,message_age:i}),e(await P(o,B)),null):(0,R.jsx)(I,{fullText:o,codeBlocks:s,messageAge:i,onDone:e})}}))();export{H as call,j as collectRecentAssistantTexts,M as fileExtension};
@@ -0,0 +1,6 @@
1
+ import{n as e,t}from"./defineProperty-CaCI0a5T.js";import{es as n,hn as r,on as i,ts as a}from"./growthbook-p4aJ_UMv.js";import{D as o,E as s,O as c,l,p as u}from"./debug-CjIaNjpK.js";import{o as d,r as f}from"./debug-BDBIipC1.js";import{i as p,t as m}from"./cliLaunch-CMXoY_LO.js";import{resolve as h}from"path";import{existsSync as g,unlinkSync as _}from"fs";import{randomUUID as v}from"crypto";l(),s(),e();function y(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}var b=2e3,x=15e3,S=3,C=class{constructor(e,n){t(this,`proc`,void 0),t(this,`options`,void 0),t(this,`connected`,!1),t(this,`disconnected`,!1),t(this,`readLoopAbort`,null),t(this,`reconnectAttempt`,0),t(this,`maxReconnectAttempts`,void 0),t(this,`userInitiatedDisconnect`,!1),t(this,`reconnecting`,!1),this.proc=e,this.options=n,this.maxReconnectAttempts=n.maxReconnectAttempts??S}connect(){this.connected||(this.readLoopAbort=new AbortController,this.startReadLoop(),this.monitorExit(),this.connected=!0,this.options.onConnected())}async startReadLoop(){let e=this.proc.stdout;if(!e){this.options.onError(Error(`SSH process stdout is not available`));return}let t=e.getReader(),n=new TextDecoder,r=``;try{for(;!this.disconnected;){let{done:e,value:i}=await t.read();if(e)break;r+=n.decode(i,{stream:!0});let a=r.split(`
2
+ `);r=a.pop()??``;for(let e of a){let t=e.trim();t&&this.processLine(t)}}}catch(e){this.disconnected||this.options.onError(e instanceof Error?e:Error(String(e)))}finally{t.releaseLock(),!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()}}monitorExit(){if(this.proc.exitCode!==null){this.userInitiatedDisconnect||this.handleProcessExit();return}this.proc.exited.then(()=>{!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()}).catch(()=>{!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()})}async handleProcessExit(){if(!(this.disconnected||this.reconnecting)){if(this.connected=!1,!this.options.reconnect){this.disconnected=!0,this.options.onDisconnected();return}if(this.reconnectAttempt>=this.maxReconnectAttempts){this.disconnected=!0,this.options.onDisconnected();return}this.reconnecting=!0;try{await this.attemptReconnect()}finally{this.reconnecting=!1}}}async attemptReconnect(){let e=this.options.reconnect;for(;this.reconnectAttempt<this.maxReconnectAttempts;){this.reconnectAttempt++,this.options.onReconnecting(this.reconnectAttempt,this.maxReconnectAttempts);let t=Math.min(b*2**(this.reconnectAttempt-1),x);if(await new Promise(e=>setTimeout(e,t)),this.userInitiatedDisconnect)return;try{this.proc=await e(),this.reconnectAttempt=0,this.connected=!0,this.startReadLoop(),this.monitorExit(),this.options.onConnected();return}catch(e){u(`[SSH] reconnect attempt ${this.reconnectAttempt} failed: ${e instanceof Error?e.message:String(e)}`)}}this.disconnected=!0,this.options.onDisconnected()}processLine(e){let t;try{t=o(e)}catch{return}if(!y(t))return;let n=t;if(n.type===`control_request`){let e=n;e.request.subtype===`can_use_tool`?this.options.onPermissionRequest(e.request,e.request_id):(u(`[SSH] Unsupported control request subtype: ${e.request.subtype}`),this.sendErrorResponse(e.request_id,`Unsupported control request subtype: ${e.request.subtype}`));return}n.type!==`control_response`&&n.type!==`keep_alive`&&n.type!==`control_cancel_request`&&n.type!==`streamlined_text`&&n.type!==`streamlined_tool_use_summary`&&!(n.type===`system`&&n.subtype===`post_turn_summary`)&&this.options.onMessage(n)}writeToStdin(e){try{let t=this.proc.stdin;if(!t||typeof t==`number`||this.disconnected)return!1;let n=new TextEncoder().encode(e+`
3
+ `);return t.write(n),t.flush?.(),!0}catch{return!1}}async sendMessage(e){let t=c({type:`user`,message:{role:`user`,content:e},parent_tool_use_id:null,session_id:``});return this.writeToStdin(t)}sendInterrupt(){let e=c({type:`control_request`,request_id:crypto.randomUUID(),request:{subtype:`interrupt`}});this.writeToStdin(e)}respondToPermissionRequest(e,t){let n=c({type:`control_response`,response:{subtype:`success`,request_id:e,response:{behavior:t.behavior,...t.behavior===`allow`?{updatedInput:t.updatedInput}:{message:t.message}}}});this.writeToStdin(n)}sendErrorResponse(e,t){let n=c({type:`control_response`,response:{subtype:`error`,request_id:e,error:t}});this.writeToStdin(n)}disconnect(){if(!this.disconnected){this.userInitiatedDisconnect=!0,this.disconnected=!0,this.connected=!1,this.readLoopAbort?.abort();try{let e=this.proc.stdin;e&&typeof e!=`number`&&e.end?.()}catch{}try{this.proc.kill()}catch{}}}isConnected(){return this.connected&&!this.disconnected}};r(),a(),f();var w=process.platform===`win32`;function T(){let e=process.env.ANTHROPIC_API_KEY;if(e)return{"x-api-key":e};let t=i();return t?.accessToken?{Authorization:`Bearer ${t.accessToken}`}:{}}function E(){return process.env.ANTHROPIC_BASE_URL||n().BASE_API_URL}async function D(e,t){if(t&&e.headers.get(`x-auth-nonce`)!==t)return new Response(`Forbidden`,{status:403});let n=E(),r=new URL(e.url),i=`${n}${r.pathname}${r.search}`,a=T();if(Object.keys(a).length===0)return new Response(JSON.stringify({error:`No API credentials available on local machine`}),{status:401,headers:{"content-type":`application/json`}});let o=new Headers(e.headers);for(let[e,t]of Object.entries(a))o.set(e,t);o.delete(`host`),o.delete(`x-auth-nonce`),d(`[SSHAuthProxy] ${e.method} ${r.pathname} -> ${i}`);try{let t=await fetch(i,{method:e.method,headers:o,body:e.body,duplex:`half`}),n=new Headers(t.headers);return n.delete(`content-encoding`),n.delete(`content-length`),new Response(t.body,{status:t.status,statusText:t.statusText,headers:n})}catch(e){let t=e instanceof Error?e.message:String(e);return d(`[SSHAuthProxy] upstream error: ${t}`),new Response(JSON.stringify({error:`Proxy upstream error: ${t}`}),{status:502,headers:{"content-type":`application/json`}})}}async function O(){let e=v();return w?A(e):k(e)}async function k(e){let t=`/tmp/claude-ssh-auth-${e}.sock`,n=Bun.serve({unix:t,fetch:e=>D(e,null)});return d(`[SSHAuthProxy] listening on unix:${t}`),{proxy:{stop(){n.stop(!0);try{_(t)}catch{}}},localAddress:t,authEnv:{ANTHROPIC_AUTH_SOCKET:t}}}async function A(e){let t=v(),n=Bun.serve({port:0,hostname:`127.0.0.1`,fetch:e=>D(e,t)}),r=n.port;return d(`[SSHAuthProxy] listening on TCP 127.0.0.1:${r} (nonce-protected)`),{proxy:{stop(){n.stop(!0)}},localAddress:`127.0.0.1:${r}`,authEnv:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${r}`,ANTHROPIC_AUTH_NONCE:t}}}f();var j=15e3,M=class extends Error{constructor(e){super(e),this.name=`SSHProbeError`}};async function N(e,t){t?.(`Probing remote host…`);let n=Bun.spawn([`ssh`,`-o`,`BatchMode=yes`,`-o`,`ConnectTimeout=10`,e,`CLAUDE_BIN=$(test -x "$HOME/.local/bin/claude" && echo "$HOME/.local/bin/claude" || command -v claude 2>/dev/null); echo "$CLAUDE_BIN"; $CLAUDE_BIN --version 2>/dev/null; uname -sm; pwd`],{stdin:`ignore`,stdout:`pipe`,stderr:`pipe`}),r=await Promise.race([n.exited,new Promise((e,t)=>setTimeout(()=>t(new M(`SSH probe timed out after ${j/1e3}s`)),j))]),i=await new Response(n.stdout).text(),a=await new Response(n.stderr).text();if(r!==0)throw new M(`SSH probe failed: ${a.trim()||`exit code ${r}`}`);let o=i.split(`
4
+ `).map(e=>e.trim()).filter(Boolean);d(`[SSHProbe] raw lines: ${JSON.stringify(o)}`);let s=o.findIndex(e=>/^(Linux|Darwin)\s/.test(e));if(s===-1)throw new M(`Could not detect remote platform (uname output missing)`);let c=s>=2&&o[s-2]||null,l=s>=1&&o[s-1]||null,u=l&&/^\d+\.\d+/.test(l)?l:null,f=c!==null&&c.startsWith(`/`),p=o[s+1]||`/`,[m,h]=o[s].split(/\s+/),g=m===`Darwin`?`darwin`:`linux`,_=h===`aarch64`||h===`arm64`?`arm64`:`x64`;return t?.(`Detected ${g}/${_}`),{hasBinary:f&&u!==null,remoteVersion:u,remotePlatform:g,remoteArch:_,defaultCwd:p,binaryPath:f?c:null}}f();var P=6e4,F=`~/.local/bin`,I=`claude-code-cli.js`,L=`claude`;async function R(e,t,n=P){let r=Bun.spawn([`ssh`,`-o`,`ConnectTimeout=10`,e,t],{stdout:`pipe`,stderr:`pipe`}),i=setTimeout(()=>r.kill(),n);try{let[e,t]=await Promise.all([new Response(r.stdout).text(),new Response(r.stderr).text()]),n=await r.exited;return{stdout:e.trim(),stderr:t.trim(),exitCode:n}}finally{clearTimeout(i)}}function z(){let e=h(import.meta.dir,`../..`),t=h(e,`dist/cli.js`);if(g(t))return t;let n=h(e,`src/entrypoints/cli.tsx`);if(g(n))return n;throw Error("Cannot find local CLI binary to deploy. Run `bun run build` first.")}async function B(e){let{host:t,remotePlatform:n,remoteArch:r,localVersion:i,onProgress:a}=e;if(n!==`linux`&&n!==`darwin`)throw Error(`Remote platform "${n}" is not supported. Only linux and darwin are supported.`);d(`[SSHDeploy] deploying to ${t} (${n}/${r}, v${i})`);let o=z();d(`[SSHDeploy] local binary: ${o}`),a?.(`Creating remote directory...`);let s=await R(t,`mkdir -p ${F}`);if(s.exitCode!==0)throw Error(`Failed to create remote directory: ${s.stderr}`);a?.(`Uploading binary...`);let c=`${F}/${I}`,l=Bun.spawn([`scp`,`-o`,`ConnectTimeout=10`,o,`${t}:${c}`],{stdout:`pipe`,stderr:`pipe`}),u=setTimeout(()=>l.kill(),P),f=await new Response(l.stderr).text(),p=await l.exited;if(clearTimeout(u),p!==0)throw Error(`SCP upload failed (exit ${p}): ${f.trim()}`);a?.(`Installing wrapper script...`);let m=await R(t,[`cat > ${F}/${L} << 'WRAPPER'`,`#!/bin/sh`,`exec bun ${F}/${I} "$@"`,`WRAPPER`,`chmod +x ${F}/${L}`].join(`
5
+ `));if(m.exitCode!==0)throw Error(`Failed to install wrapper script: ${m.stderr}`);a?.(`Verifying installation...`);let h=await R(t,`${F}/${L} --version`);if(h.exitCode!==0)throw Error(`Binary deployed but verification failed (exit ${h.exitCode}): ${h.stderr}`);return d(`[SSHDeploy] deployed successfully, remote version: ${h.stdout}`),a?.(`Deployed v${h.stdout}`),`${F}/${L}`}p(),l(),s();var V=3e4,H=20,U=class extends Error{constructor(e){super(e),this.name=`SSHSessionError`}};async function W(e,t){let{host:n,localVersion:r,extraCliArgs:i,remoteBin:a}=e,o=t?.onProgress,s,c=`/`;if(a){o?.(`Using custom remote binary, skipping probe/deploy…`),s=a,u(`[SSH] custom remoteBin: ${a}`);try{let e=Bun.spawn([`ssh`,`-o`,`BatchMode=yes`,`-o`,`ConnectTimeout=5`,n,`pwd`],{stdin:`ignore`,stdout:`pipe`,stderr:`ignore`});await e.exited;let t=(await new Response(e.stdout).text()).trim();t.startsWith(`/`)&&(c=t)}catch{}}else{let e=await N(n,o);u(`[SSH] probe result: ${JSON.stringify(e)}`),c=e.defaultCwd,s=e.binaryPath??`~/.local/bin/claude`,(!e.hasBinary||e.remoteVersion!==r)&&(o?.(e.hasBinary?`Updating remote binary (${e.remoteVersion} → ${r})…`:`Deploying binary to remote…`),s=await B({host:n,remotePlatform:e.remotePlatform,remoteArch:e.remoteArch,localVersion:r,onProgress:o}))}let{proxy:l,localAddress:d,authEnv:f}=await O();u(`[SSH] auth proxy listening on ${d}`);let p=v().slice(0,8),m=process.platform===`win32`,h=[];for(let[e,t]of Object.entries(f))h.push(`${e}=${t}`);h.push(s,`--output-format`,`stream-json`,`--input-format`,`stream-json`,`--verbose`,`-p`),e.cwd&&h.push(`--cwd`,e.cwd),e.permissionMode&&h.push(`--permission-mode`,e.permissionMode),e.dangerouslySkipPermissions&&h.push(`--dangerously-skip-permissions`),h.push(...i);let g=[`ssh`];if(m){let e=d.split(`:`)[1],t=1e4+Math.floor(Math.random()*5e4);g.push(`-R`,`${t}:127.0.0.1:${e}`);let n=h.findIndex(e=>e.startsWith(`ANTHROPIC_BASE_URL=`));n!==-1&&(h[n]=`ANTHROPIC_BASE_URL=http://127.0.0.1:${t}`)}else{let e=`/tmp/claude-ssh-auth-${p}.sock`;g.push(`-R`,`${e}:${d}`),g.push(`-o`,`StreamLocalBindUnlink=yes`);let t=h.indexOf(`ANTHROPIC_AUTH_SOCKET=${f.ANTHROPIC_AUTH_SOCKET}`);t!==-1&&(h[t]=`ANTHROPIC_AUTH_SOCKET=${e}`)}g.push(n,h.join(` `)),o?.(`Starting remote session…`),u(`[SSH] spawning: ${g.join(` `)}`);let _;try{_=Bun.spawn(g,{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`})}catch(e){throw l.stop(),new U(`Failed to spawn SSH process: ${e instanceof Error?e.message:String(e)}`)}let y=[];q(_,y);let b;if(a){let t=await Promise.race([_.exited.then(e=>e),new Promise(e=>setTimeout(()=>e(null),3e3))]);if(t!==null){l.stop();let e=y.join(``).trim();throw new U(`Remote process exited immediately (code ${t})${e?`: ${e}`:``}`)}b=e.cwd||c||`/`}else try{b=await K(_,e.cwd||c)}catch(e){throw l.stop(),_.kill(),e}u(`[SSH] remote session initialized, remoteCwd=${b}`);let x=_,S=async()=>{u(`[SSH] reconnect: re-spawning SSH process with --continue`);let e=[...g],t=e.length-1,n=e[t];n.includes(`--continue`)||(e[t]=n.replace(/ -p(?:\s|$)/,` -p --continue `));let r=Bun.spawn(e,{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`}),i=[];return q(r,i),await K(r,b),x=r,y.length=0,y.push(...i),r};return{remoteCwd:b,get proc(){return x},proxy:l,createManager(e){return new C(x,{...e,reconnect:S})},getStderrTail(){return y.slice(-H).join(``)}}}async function G(e){let{proxy:t,authEnv:n}=await O(),r=[`--output-format`,`stream-json`,`--input-format`,`stream-json`,`-p`];e.cwd&&r.push(`--cwd`,e.cwd),e.permissionMode&&r.push(`--permission-mode`,e.permissionMode),e.dangerouslySkipPermissions&&r.push(`--dangerously-skip-permissions`);let i=m(r),a;try{a=Bun.spawn([i.execPath,...i.args],{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`,env:{...i.env,...n}})}catch(e){throw t.stop(),new U(`Failed to spawn local CLI process: ${e instanceof Error?e.message:String(e)}`)}u(`[SSH] local session spawned, waiting for init message...`);let o=[];q(a,o);let s;try{s=await K(a,e.cwd)}catch(e){throw t.stop(),a.kill(),e}u(`[SSH] local session initialized, remoteCwd=${s}`);let c=a,l=async()=>{u(`[SSH] local reconnect: re-spawning CLI with --continue`);let e=[...r];e.includes(`--continue`)||e.push(`--continue`);let t=m(e),i=Bun.spawn([t.execPath,...t.args],{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`,env:{...t.env,...n}}),a=[];return q(i,a),await K(i,s),c=i,o.length=0,o.push(...a),i};return{remoteCwd:s,get proc(){return c},proxy:t,createManager(e){return new C(c,{...e,reconnect:l})},getStderrTail(){return o.slice(-H).join(``)}}}async function K(e,t){let n=e.stdout;if(!n)throw new U(`Child process stdout is not readable`);let r=n.getReader(),i=new TextDecoder,a=``,s=Date.now()+V;try{for(;Date.now()<s;){let e=s-Date.now(),n=await Promise.race([r.read(),new Promise((t,n)=>setTimeout(()=>n(new U(`Remote CLI did not initialize within 30 seconds. Check SSH connectivity and remote binary.`)),e))]);if(n.done)throw new U(`Child process exited before sending init message`);a+=i.decode(n.value,{stream:!0});let c=a.split(`
6
+ `);a=c.pop()??``;for(let e of c){let n=e.trim();if(n)try{let e=o(n);if(e.type===`system`&&e.subtype===`init`)return r.releaseLock(),e.cwd||t||process.cwd()}catch{}}}}catch(e){throw r.releaseLock(),e instanceof U?e:new U(`Error reading init message: ${e instanceof Error?e.message:String(e)}`)}throw r.releaseLock(),new U(`Remote CLI did not initialize within 30 seconds. Check SSH connectivity and remote binary.`)}function q(e,t){let n=e.stderr;if(!n)return;let r=n.getReader(),i=new TextDecoder;(async()=>{try{for(;;){let{done:e,value:n}=await r.read();if(e)break;t.push(i.decode(n,{stream:!0})),t.length>H*2&&t.splice(0,t.length-H)}}catch{}})()}export{U as SSHSessionError,G as createLocalSSHSession,W as createSSHSession};
@@ -0,0 +1 @@
1
+ import{a as e,i as t,n,r}from"./createSession-CnRHI3RU.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{U as t,l as n,p as r,z as i}from"./debug-CjIaNjpK.js";import{c as a,d as o,i as s,o as c}from"./debugUtils-Dsg-UHeg.js";async function l({environmentId:e,title:t,events:n,gitRepoUrl:a,branch:o,signal:c,baseUrl:l,getAccessToken:u,permissionMode:d}){let{getClaudeAIOAuthTokens:f}=await import(`./auth-V_Xk2iea.js`),{getOrganizationUUID:p}=await import(`./client-CpXGg9e0.js`),{getOauthConfig:m}=await import(`./oauth-CnBLewrU.js`),{getOAuthHeaders:h}=await import(`./api-DvyGR-L7.js`),{parseGitHubRepository:g}=await import(`./detectRepository-BnTCJAXR.js`),{getDefaultBranch:_}=await import(`./git-Q_b4oZ17.js`),{getMainLoopModel:v}=await import(`./model-BcunOCC9.js`),{default:y}=await import(`./axios-DPuSPBlH.js`),{isSelfHostedBridge:b}=await import(`./bridgeConfig-D38y9eXn.js`),x=u?.()??f()?.accessToken;if(!x)return r(`[bridge] No access token for session creation`),null;let S=b()?`self-hosted`:await p();if(!S)return r(`[bridge] No org UUID for session creation`),null;let C=null,w=null;if(a){let{parseGitRemote:e}=await import(`./detectRepository-BnTCJAXR.js`),t=e(a);if(t){let{host:e,owner:n,name:r}=t,i=o||await _()||void 0;C={type:`git_repository`,url:`https://${e}/${n}/${r}`,revision:i},w={type:`git_repository`,git_info:{type:`github`,repo:`${n}/${r}`,branches:[`claude/${o||`task`}`]}}}else{let e=g(a);if(e){let[t,n]=e.split(`/`);if(t&&n){let e=o||await _()||void 0;C={type:`git_repository`,url:`https://github.com/${t}/${n}`,revision:e},w={type:`git_repository`,git_info:{type:`github`,repo:`${t}/${n}`,branches:[`claude/${o||`task`}`]}}}}}}let T={...t!==void 0&&{title:t},events:n,session_context:{sources:C?[C]:[],outcomes:w?[w]:[],model:v()},environment_id:e,source:`remote-control`,...d&&{permission_mode:d}},E={...h(x),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":S},D=`${l??m().BASE_API_URL}/v1/sessions`,O;try{O=await y.post(D,T,{headers:E,signal:c,validateStatus:e=>e<500})}catch(e){return r(`[bridge] Session creation request failed: ${i(e)}`),null}if(!(O.status===200||O.status===201)){let e=s(O.data);return r(`[bridge] Session creation failed with status ${O.status}${e?`: ${e}`:``}`),null}let k=O.data;return!k||typeof k!=`object`||!(`id`in k)||typeof k.id!=`string`?(r(`[bridge] No session ID in response`),null):k.id}async function u(e,t){let{getClaudeAIOAuthTokens:n}=await import(`./auth-V_Xk2iea.js`),{getOrganizationUUID:a}=await import(`./client-CpXGg9e0.js`),{getOauthConfig:o}=await import(`./oauth-CnBLewrU.js`),{getOAuthHeaders:c}=await import(`./api-DvyGR-L7.js`),{default:l}=await import(`./axios-DPuSPBlH.js`),{isSelfHostedBridge:u}=await import(`./bridgeConfig-D38y9eXn.js`),d=t?.getAccessToken?.()??n()?.accessToken;if(!d)return r(`[bridge] No access token for session fetch`),null;let f=u()?`self-hosted`:await a();if(!f)return r(`[bridge] No org UUID for session fetch`),null;let p={...c(d),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":f},m=`${t?.baseUrl??o().BASE_API_URL}/v1/sessions/${e}`;r(`[bridge] Fetching session ${e}`);let h;try{h=await l.get(m,{headers:p,timeout:1e4,validateStatus:e=>e<500})}catch(e){return r(`[bridge] Session fetch request failed: ${i(e)}`),null}if(h.status!==200){let e=s(h.data);return r(`[bridge] Session fetch failed with status ${h.status}${e?`: ${e}`:``}`),null}return h.data}async function d(e,t){let{getClaudeAIOAuthTokens:n}=await import(`./auth-V_Xk2iea.js`),{getOrganizationUUID:i}=await import(`./client-CpXGg9e0.js`),{getOauthConfig:a}=await import(`./oauth-CnBLewrU.js`),{getOAuthHeaders:o}=await import(`./api-DvyGR-L7.js`),{default:c}=await import(`./axios-DPuSPBlH.js`),{isSelfHostedBridge:l}=await import(`./bridgeConfig-D38y9eXn.js`),u=t?.getAccessToken?.()??n()?.accessToken;if(!u){r(`[bridge] No access token for session archive`);return}let d=l()?`self-hosted`:await i();if(!d){r(`[bridge] No org UUID for session archive`);return}let f={...o(u),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":d},p=`${t?.baseUrl??a().BASE_API_URL}/v1/sessions/${e}/archive`;r(`[bridge] Archiving session ${e}`);let m=await c.post(p,{},{headers:f,timeout:t?.timeoutMs??1e4,validateStatus:e=>e<500});if(m.status===200)r(`[bridge] Session ${e} archived successfully`);else{let e=s(m.data);r(`[bridge] Session archive failed with status ${m.status}${e?`: ${e}`:``}`)}}async function f(e,t,n){let{getClaudeAIOAuthTokens:a}=await import(`./auth-V_Xk2iea.js`),{getOrganizationUUID:c}=await import(`./client-CpXGg9e0.js`),{getOauthConfig:l}=await import(`./oauth-CnBLewrU.js`),{getOAuthHeaders:u}=await import(`./api-DvyGR-L7.js`),{default:d}=await import(`./axios-DPuSPBlH.js`),{isSelfHostedBridge:f}=await import(`./bridgeConfig-D38y9eXn.js`),p=n?.getAccessToken?.()??a()?.accessToken;if(!p){r(`[bridge] No access token for session title update`);return}let m=f()?`self-hosted`:await c();if(!m){r(`[bridge] No org UUID for session title update`);return}let h={...u(p),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":m},g=o(e),_=`${n?.baseUrl??l().BASE_API_URL}/v1/sessions/${g}`;r(`[bridge] Updating session title: ${g} → ${t}`);try{let e=await d.patch(_,{title:t},{headers:h,timeout:1e4,validateStatus:e=>e<500});if(e.status===200)r(`[bridge] Session title updated successfully`);else{let t=s(e.data);r(`[bridge] Session title update failed with status ${e.status}${t?`: ${t}`:``}`)}}catch(e){r(`[bridge] Session title update request failed: ${i(e)}`)}}var p=e((()=>{n(),t(),c(),a()}));export{f as a,p as i,l as n,u as r,d as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";function t(e,t){let{min:n,max:r}=t,i=new Set;for(let t of e.split(`,`)){let e=t.match(/^\*(?:\/(\d+))?$/);if(e){let t=e[1]?parseInt(e[1],10):1;if(t<1)return null;for(let e=n;e<=r;e+=t)i.add(e);continue}let a=t.match(/^(\d+)-(\d+)(?:\/(\d+))?$/);if(a){let e=parseInt(a[1],10),t=parseInt(a[2],10),o=a[3]?parseInt(a[3],10):1,s=n===0&&r===6;if(e>t||o<1||e<n||t>(s?7:r))return null;for(let n=e;n<=t;n+=o)i.add(s&&n===7?0:n);continue}if(t.match(/^\d+$/)){let e=parseInt(t,10);if(n===0&&r===6&&e===7&&(e=0),e<n||e>r)return null;i.add(e);continue}return null}return i.size===0?null:Array.from(i).sort((e,t)=>e-t)}function n(e){if(typeof e!=`string`)return null;let n=e.trim().split(/\s+/);if(n.length!==5)return null;let r=[];for(let e=0;e<5;e++){let i=t(n[e],s[e]);if(!i)return null;r.push(i)}return{minute:r[0],hour:r[1],dayOfMonth:r[2],month:r[3],dayOfWeek:r[4]}}function r(e,t){let n=new Set(e.minute),r=new Set(e.hour),i=new Set(e.dayOfMonth),a=new Set(e.month),o=new Set(e.dayOfWeek),s=e.dayOfMonth.length===31,c=e.dayOfWeek.length===7,l=new Date(t.getTime());l.setSeconds(0,0),l.setMinutes(l.getMinutes()+1);for(let e=0;e<527040;e++){let e=l.getMonth()+1;if(!a.has(e)){l.setMonth(l.getMonth()+1,1),l.setHours(0,0,0,0);continue}let t=l.getDate(),u=l.getDay();if(!(s&&c||(s?o.has(u):c?i.has(t):i.has(t)||o.has(u)))){l.setDate(l.getDate()+1),l.setHours(0,0,0,0);continue}if(!r.has(l.getHours())){l.setHours(l.getHours()+1,0,0,0);continue}if(!n.has(l.getMinutes())){l.setMinutes(l.getMinutes()+1);continue}return l}return null}function i(e,t){return new Date(2e3,0,1,t,e).toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`})}function a(e,t){let n=new Date;return n.setUTCHours(t,e,0,0),n.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`,timeZoneName:`short`})}function o(e,t){let n=t?.utc??!1,r=e.trim().split(/\s+/);if(r.length!==5)return e;let[o,s,l,u,d]=r,f=o.match(/^\*\/(\d+)$/);if(f&&s===`*`&&l===`*`&&u===`*`&&d===`*`){let e=parseInt(f[1],10);return e===1?`Every minute`:`Every ${e} minutes`}if(o.match(/^\d+$/)&&s===`*`&&l===`*`&&u===`*`&&d===`*`){let e=parseInt(o,10);return e===0?`Every hour`:`Every hour at :${e.toString().padStart(2,`0`)}`}let p=s.match(/^\*\/(\d+)$/);if(o.match(/^\d+$/)&&p&&l===`*`&&u===`*`&&d===`*`){let e=parseInt(p[1],10),t=parseInt(o,10),n=t===0?``:` at :${t.toString().padStart(2,`0`)}`;return e===1?`Every hour${n}`:`Every ${e} hours${n}`}if(!o.match(/^\d+$/)||!s.match(/^\d+$/))return e;let m=parseInt(o,10),h=parseInt(s,10),g=n?a:i;if(l===`*`&&u===`*`&&d===`*`)return`Every day at ${g(m,h)}`;if(l===`*`&&u===`*`&&d.match(/^\d$/)){let e=parseInt(d,10)%7,t;if(n){let n=new Date,r=(e-n.getUTCDay()+7)%7;n.setUTCDate(n.getUTCDate()+r),n.setUTCHours(h,m,0,0),t=c[n.getDay()]}else t=c[e];if(t)return`Every ${t} at ${g(m,h)}`}return l===`*`&&u===`*`&&d===`1-5`?`Weekdays at ${g(m,h)}`:e}var s,c,l=e((()=>{s=[{min:0,max:59},{min:0,max:23},{min:1,max:31},{min:1,max:12},{min:0,max:6}],c=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]}));export{n as i,o as n,l as r,r as t};
@@ -0,0 +1,6 @@
1
+ import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./defineProperty-CaCI0a5T.js";import{Cn as i,Ln as a,Mn as o,Tt as s,Xn as c,Yn as l,kt as u,ln as d,un as f,vt as p,wn as m,wt as h}from"./schemas-Bwt-7U5W.js";import{n as g,t as _}from"./v4-DLhvDPkt.js";import{Ht as v,In as ee,K as y,Q as b,Xt as te,Y as x,at as S,it as ne}from"./state-CUZTq6r0.js";import{Jr as C,Ql as w,Xu as T,Zu as re,_s as ie,el as ae,m as oe,nt as se,nu as ce,qn as le,tl as ue,u as de,yi as fe}from"./growthbook-p4aJ_UMv.js";import{$ as pe,B as E,D as me,E as D,O,Q as he,U as ge,l as k,p as A,z as _e}from"./debug-CjIaNjpK.js";import{t as ve}from"./sdk-Drp69kIx.js";import{n as ye,v as be}from"./git-Bj8Ow4pJ.js";import{o as xe,s as Se}from"./log-DVv8YiNo.js";import{s as Ce,u as we}from"./types-BVelRhgb.js";import{n as Te,r as j}from"./analytics-i6X1et4O.js";import{n as M,t as N}from"./lazySchema-2sOku3cX.js";import{a as Ee,i as De}from"./genericProcessUtils-BFJMxLqn.js";import{$a as Oe,Ab as ke,Ax as Ae,Cx as je,Dx as Me,Ex as P,Fx as Ne,Hv as Pe,Ix as Fe,Jd as Ie,Lt as Le,Mx as Re,Nx as ze,Ob as Be,Ox as Ve,Pk as He,Px as Ue,Rk as We,SP as Ge,Sx as Ke,Tx as qe,UA as Je,Vv as Ye,WA as Xe,X as Ze,XF as Qe,Ya as $e,Yd as et,ZF as tt,bP as nt,bx as rt,cm as it,dM as at,eo as ot,fM as st,jb as ct,jx as lt,kb as ut,kx as dt,lm as ft,qa as pt,un as mt,vP as ht,wx as gt,xx as _t,yx as vt}from"./loadAgentsDir-Bz0FfcVt.js";import{o as F,r as yt}from"./debug-BDBIipC1.js";import{r as bt,t as xt}from"./slowOperations-niPqC54V.js";import{Nt as St,Rt as Ct}from"./prompt-CsBCtw4l.js";import{n as wt,r as Tt}from"./cron-iqTFGIos.js";import{t as Et}from"./controlMessageCompat-591iGHUK.js";import{i as Dt}from"./sessionState-Dgky34M4.js";import{a as Ot,c as kt,d as At,f as jt,i as I,n as Mt,o as Nt,r as Pt,t as L,u as Ft}from"./cronTasks-CMJldfoP.js";import{dirname as It,isAbsolute as Lt,join as Rt,resolve as zt}from"path";import{randomUUID as R}from"crypto";import{mkdir as Bt,readFile as Vt,unlink as z,writeFile as B}from"fs/promises";_(),N(),Fe();var Ht=M(()=>c()),Ut=M(()=>m({matcher:a().optional(),hookCallbackIds:s(a()),timeout:i().optional()}).describe(`Configuration for matching and routing hook callbacks.`)),Wt=M(()=>m({subtype:f(`initialize`),hooks:o(je(),s(Ut())).optional(),sdkMcpServers:s(a()).optional(),jsonSchema:o(a(),c()).optional(),systemPrompt:a().optional(),appendSystemPrompt:a().optional(),agents:o(a(),rt()).optional(),promptSuggestions:u().optional(),agentProgressSummaries:u().optional()}).describe(`Initializes the SDK session with hooks, MCP servers, and agent configuration.`));M(()=>m({commands:s(Ne()),agents:s(_t()),output_style:a(),available_output_styles:s(a()),models:s(Me()),account:vt(),pid:i().optional().describe(`@internal CLI process PID for tmux socket isolation`),fast_mode_state:Ke().optional()}).describe(`Response from session initialization with available commands, models, and account info.`));var Gt=M(()=>m({subtype:f(`interrupt`)}).describe(`Interrupts the currently running conversation turn.`)),Kt=M(()=>m({subtype:f(`can_use_tool`),tool_name:a(),input:o(a(),c()),permission_suggestions:s(dt()).optional(),blocked_path:a().optional(),decision_reason:a().optional(),title:a().optional(),display_name:a().optional(),tool_use_id:a(),agent_id:a().optional(),description:a().optional()}).describe(`Requests permission to use a tool with the given input.`)),qt=M(()=>m({subtype:f(`set_permission_mode`),mode:Ve(),ultraplan:u().optional().describe(`@internal CCR ultraplan session marker.`)}).describe(`Sets the permission mode for tool execution handling.`)),Jt=M(()=>m({subtype:f(`set_model`),model:a().optional()}).describe(`Sets the model to use for subsequent conversation turns.`)),Yt=M(()=>m({subtype:f(`set_max_thinking_tokens`),max_thinking_tokens:i().nullable()}).describe(`Sets the maximum number of thinking tokens for extended thinking.`)),Xt=M(()=>m({subtype:f(`mcp_status`)}).describe(`Requests the current status of all MCP server connections.`));M(()=>m({mcpServers:s(P())}).describe(`Response containing the current status of all MCP server connections.`));var Zt=M(()=>m({subtype:f(`get_context_usage`)}).describe(`Requests a breakdown of current context window usage by category.`)),Qt=M(()=>m({name:a(),tokens:i(),color:a(),isDeferred:u().optional()})),$t=M(()=>m({color:a(),isFilled:u(),categoryName:a(),tokens:i(),percentage:i(),squareFullness:i()}));M(()=>m({categories:s(Qt()),totalTokens:i(),maxTokens:i(),rawMaxTokens:i(),percentage:i(),gridRows:s(s($t())),model:a(),memoryFiles:s(m({path:a(),type:a(),tokens:i()})),mcpTools:s(m({name:a(),serverName:a(),tokens:i(),isLoaded:u().optional()})),deferredBuiltinTools:s(m({name:a(),tokens:i(),isLoaded:u()})).optional(),systemTools:s(m({name:a(),tokens:i()})).optional(),systemPromptSections:s(m({name:a(),tokens:i()})).optional(),agents:s(m({agentType:a(),source:a(),tokens:i()})),slashCommands:m({totalCommands:i(),includedCommands:i(),tokens:i()}).optional(),skills:m({totalSkills:i(),includedSkills:i(),tokens:i(),skillFrontmatter:s(m({name:a(),source:a(),tokens:i()}))}).optional(),autoCompactThreshold:i().optional(),isAutoCompactEnabled:u(),messageBreakdown:m({toolCallTokens:i(),toolResultTokens:i(),attachmentTokens:i(),assistantMessageTokens:i(),userMessageTokens:i(),toolCallsByType:s(m({name:a(),callTokens:i(),resultTokens:i()})),attachmentsByType:s(m({name:a(),tokens:i()}))}).optional(),apiUsage:m({input_tokens:i(),output_tokens:i(),cache_creation_input_tokens:i(),cache_read_input_tokens:i()}).nullable()}).describe(`Breakdown of current context window usage by category (system prompt, tools, messages, etc.).`));var en=M(()=>m({subtype:f(`rewind_files`),user_message_id:a(),dry_run:u().optional()}).describe(`Rewinds file changes made since a specific user message.`));M(()=>m({canRewind:u(),error:a().optional(),filesChanged:s(a()).optional(),insertions:i().optional(),deletions:i().optional()}).describe(`Result of a rewindFiles operation.`));var tn=M(()=>m({subtype:f(`cancel_async_message`),message_uuid:a()}).describe(`Drops a pending async user message from the command queue by uuid. No-op if already dequeued for execution.`));M(()=>m({cancelled:u()}).describe(`Result of a cancel_async_message operation. cancelled=false means the message was not in the queue (already dequeued or never enqueued).`));var nn=M(()=>m({subtype:f(`seed_read_state`),path:a(),mtime:i()}).describe(`Seeds the readFileState cache with a path+mtime entry. Use when a prior Read was removed from context (e.g. by snip) so Edit validation would fail despite the client having observed the Read. The mtime lets the CLI detect if the file changed since the seeded Read — same staleness check as the normal path.`)),rn=M(()=>m({subtype:f(`hook_callback`),callback_id:a(),input:gt(),tool_use_id:a().optional()}).describe(`Delivers a hook callback with its input data.`)),an=M(()=>m({subtype:f(`mcp_message`),server_name:a(),message:Ht()}).describe(`Sends a JSON-RPC message to a specific MCP server.`)),on=M(()=>m({subtype:f(`mcp_set_servers`),servers:o(a(),qe())}).describe(`Replaces the set of dynamically managed MCP servers.`));M(()=>m({added:s(a()),removed:s(a()),errors:o(a(),a())}).describe(`Result of replacing the set of dynamically managed MCP servers.`));var sn=M(()=>m({subtype:f(`reload_plugins`)}).describe(`Reloads plugins from disk and returns the refreshed session components.`));M(()=>m({commands:s(Ne()),agents:s(_t()),plugins:s(m({name:a(),path:a(),source:a().optional()})),mcpServers:s(P()),error_count:i()}).describe(`Refreshed commands, agents, plugins, and MCP server status after reload.`));var cn=M(()=>m({subtype:f(`mcp_reconnect`),serverName:a()}).describe(`Reconnects a disconnected or failed MCP server.`)),ln=M(()=>m({subtype:f(`mcp_toggle`),serverName:a(),enabled:u()}).describe(`Enables or disables an MCP server.`)),un=M(()=>m({subtype:f(`stop_task`),task_id:a()}).describe(`Stops a running task.`)),dn=M(()=>m({subtype:f(`apply_flag_settings`),settings:o(a(),c())}).describe(`Merges the provided settings into the flag settings layer, updating the active configuration.`)),fn=M(()=>m({subtype:f(`get_settings`)}).describe(`Returns the effective merged settings and the raw per-source settings.`));M(()=>m({effective:o(a(),c()),sources:s(m({source:p([`userSettings`,`projectSettings`,`localSettings`,`flagSettings`,`policySettings`]),settings:o(a(),c())})).describe(`Ordered low-to-high priority — later entries override earlier ones.`),applied:m({model:a(),effort:p([`low`,`medium`,`high`,`xhigh`,`max`]).nullable()}).optional().describe("Runtime-resolved values after env overrides, session state, and model-specific defaults are applied. Unlike `effective` (disk merge), these reflect what will actually be sent to the API.")}).describe(`Effective merged settings plus raw per-source settings in merge order.`));var pn=M(()=>m({subtype:f(`elicitation`),mcp_server_name:a(),message:a(),mode:p([`form`,`url`]).optional(),url:a().optional(),elicitation_id:a().optional(),requested_schema:o(a(),c()).optional()}).describe(`Requests the SDK consumer to handle an MCP elicitation (user input request).`)),V=M(()=>m({action:p([`accept`,`decline`,`cancel`]),content:o(a(),c()).optional()}).describe(`Response from the SDK consumer for an elicitation request.`)),mn=M(()=>l([Gt(),Kt(),Wt(),qt(),Jt(),Yt(),Xt(),Zt(),rn(),an(),en(),tn(),nn(),on(),sn(),cn(),ln(),un(),dn(),fn(),pn()])),H=M(()=>m({type:f(`control_request`),request_id:a(),request:mn()})),hn=M(()=>m({subtype:f(`success`),request_id:a(),response:o(a(),c()).optional()})),gn=M(()=>m({subtype:f(`error`),request_id:a(),error:a(),pending_permission_requests:s(d(()=>H())).optional()})),U=M(()=>m({type:f(`control_response`),response:l([hn(),gn()])})),_n=M(()=>m({type:f(`control_cancel_request`),request_id:a()}).describe(`Cancels a currently open control request.`)),vn=M(()=>m({type:f(`keep_alive`)}).describe(`Keep-alive message to maintain WebSocket connection.`)),yn=M(()=>m({type:f(`update_environment_variables`),variables:o(a(),a())}).describe(`Updates environment variables at runtime.`));M(()=>l([Ae(),Re(),ze(),lt(),U(),H(),_n(),vn()])),M(()=>l([Ue(),H(),U(),vn(),yn()])),_(),N(),ke(),Be(),M(()=>m({prompt:a(),message:a(),options:s(m({key:a(),label:a(),description:a().optional()}))}));var bn=M(()=>m({continue:u().describe(`Whether Claude should continue after hook (default: true)`).optional(),suppressOutput:u().describe(`Hide stdout from transcript (default: false)`).optional(),stopReason:a().describe(`Message shown when continue is false`).optional(),decision:p([`approve`,`block`]).optional(),reason:a().describe(`Explanation for the decision`).optional(),systemMessage:a().describe(`Warning message shown to the user`).optional(),hookSpecificOutput:l([m({hookEventName:f(`PreToolUse`),permissionDecision:ct().optional(),permissionDecisionReason:a().optional(),updatedInput:o(a(),c()).optional(),additionalContext:a().optional()}),m({hookEventName:f(`UserPromptSubmit`),additionalContext:a().optional()}),m({hookEventName:f(`SessionStart`),additionalContext:a().optional(),initialUserMessage:a().optional(),watchPaths:s(a()).describe(`Absolute paths to watch for FileChanged hooks`).optional()}),m({hookEventName:f(`Setup`),additionalContext:a().optional()}),m({hookEventName:f(`SubagentStart`),additionalContext:a().optional()}),m({hookEventName:f(`PostToolUse`),additionalContext:a().optional(),updatedMCPToolOutput:c().describe(`Updates the output for MCP tools`).optional()}),m({hookEventName:f(`PostToolUseFailure`),additionalContext:a().optional()}),m({hookEventName:f(`PermissionDenied`),retry:u().optional()}),m({hookEventName:f(`Notification`),additionalContext:a().optional()}),m({hookEventName:f(`PermissionRequest`),decision:l([m({behavior:f(`allow`),updatedInput:o(a(),c()).optional(),updatedPermissions:s(ut()).optional()}),m({behavior:f(`deny`),message:a().optional(),interrupt:u().optional()})])}),m({hookEventName:f(`Elicitation`),action:p([`accept`,`decline`,`cancel`]).optional(),content:o(a(),c()).optional()}),m({hookEventName:f(`ElicitationResult`),action:p([`accept`,`decline`,`cancel`]).optional(),content:o(a(),c()).optional()}),m({hookEventName:f(`CwdChanged`),watchPaths:s(a()).describe(`Absolute paths to watch for FileChanged hooks`).optional()}),m({hookEventName:f(`FileChanged`),watchPaths:s(a()).describe(`Absolute paths to watch for FileChanged hooks`).optional()}),m({hookEventName:f(`WorktreeCreate`),worktreePath:a()})]).optional()})),xn=M(()=>l([m({async:f(!0),asyncTimeout:i().optional()}),bn()]));n(),v(),he(),ve(),D(),yt(),Ct(),Ye(),_(),k(),N(),nt(),it(),M(()=>g.object({tool_name:g.string().describe(`The name of the tool requesting permission`),input:g.record(g.string(),g.unknown()).describe(`The input for the tool`),tool_use_id:g.string().optional().describe(`The unique tool use request ID`)}));var Sn=M(()=>g.enum([`user_temporary`,`user_permanent`,`user_reject`]).optional().catch(void 0)),Cn=M(()=>g.object({behavior:g.literal(`allow`),updatedInput:g.record(g.string(),g.unknown()),updatedPermissions:g.array(ft()).optional().catch(e=>{A(`Malformed updatedPermissions from SDK host ignored: ${e.error.issues[0]?.message??`unknown`}`,{level:`warn`})}),toolUseID:g.string().optional(),decisionClassification:Sn()})),wn=M(()=>g.object({behavior:g.literal(`deny`),message:g.string(),interrupt:g.boolean().optional(),toolUseID:g.string().optional(),decisionClassification:Sn()})),W=M(()=>g.union([Cn(),wn()]));function G(e,t,n,r){let i={type:`permissionPromptTool`,permissionPromptToolName:t.name,toolResult:e};if(e.behavior===`allow`){let t=e.updatedPermissions;t&&(r.setAppState(e=>({...e,toolPermissionContext:ht(e.toolPermissionContext,t)})),Ge(t));let a=Object.keys(e.updatedInput).length>0?e.updatedInput:n;return{...e,updatedInput:a,decisionReason:i}}else e.behavior===`deny`&&e.interrupt&&(A(`SDK permission prompt deny+interrupt: tool=${t.name} message=${e.message}`),r.abortController.abort());return{...e,decisionReason:i}}ge(),xe(),be(),w(),Ce(),ae(),ie(),oe(),xt(),at(),Xe(),He(),et(),mt();var Tn=/\u2028|\u2029/g;function En(e){return e.replace(Tn,e=>e===`\u2028`?`\\u2028`:`\\u2029`)}function Dn(e){return En(O(e))}_(),nt(),D();var On=`SandboxNetworkAccess`;function kn(e){if(e){if(e.type===`classifier`)return e.reason;switch(e.type){case`rule`:case`mode`:case`subcommandResults`:case`permissionPromptTool`:return;case`hook`:case`asyncAgent`:case`sandboxOverride`:case`workingDir`:case`safetyCheck`:case`other`:return e.reason}}}function An(e,t,n,r){let i;try{i=e.getActivityDescription?.(t)??e.getToolUseSummary?.(t)??e.userFacingName(t)}catch{i=e.name}return{tool_name:e.name,action_description:i,tool_use_id:n,request_id:r,input:t}}var jn=1e3,Mn=class{constructor(e,t){r(this,`structuredInput`,void 0),r(this,`pendingRequests`,new Map),r(this,`restoredWorkerState`,Promise.resolve(null)),r(this,`inputClosed`,!1),r(this,`unexpectedResponseCallback`,void 0),r(this,`resolvedToolUseIds`,new Set),r(this,`prependedLines`,[]),r(this,`onControlRequestSent`,void 0),r(this,`onControlRequestResolved`,void 0),r(this,`outbound`,new Ie),this.input=e,this.replayUserMessages=t,this.input=e,this.structuredInput=this.read()}trackResolvedToolUseId(e){let t=e.request;if(t.subtype===`can_use_tool`&&(this.resolvedToolUseIds.add(t.tool_use_id),this.resolvedToolUseIds.size>jn)){let e=this.resolvedToolUseIds.values().next().value;e!==void 0&&this.resolvedToolUseIds.delete(e)}}flushInternalEvents(){return Promise.resolve()}get internalEventsPending(){return 0}prependUserMessage(e){this.prependedLines.push(bt({type:`user`,content:e,uuid:``,session_id:``,message:{role:`user`,content:e},parent_tool_use_id:null})+`
2
+ `)}async*read(){let e=``,t=async function*(){for(;;){this.prependedLines.length>0&&(e=this.prependedLines.join(``)+e,this.prependedLines=[]);let t=e.indexOf(`
3
+ `);if(t===-1)break;let n=e.slice(0,t);e=e.slice(t+1);let r=await this.processLine(n);r&&(Pe(`info`,`cli_stdin_message_parsed`,{type:r.type}),yield r)}}.bind(this);yield*t();for await(let n of this.input)e+=n,yield*t();if(e){let t=await this.processLine(e);t&&(yield t)}this.inputClosed=!0;for(let e of this.pendingRequests.values())e.reject(Error(`Tool permission stream closed before response received`))}getPendingPermissionRequests(){return Array.from(this.pendingRequests.values()).map(e=>e.request).filter(e=>e.request.subtype===`can_use_tool`)}setUnexpectedResponseCallback(e){this.unexpectedResponseCallback=e}injectControlResponse(e){let t=e.response,n=t?.request_id;if(!n)return;let r=this.pendingRequests.get(n);if(r)if(this.trackResolvedToolUseId(r.request),this.pendingRequests.delete(n),this.write({type:`control_cancel_request`,request_id:n}),t.subtype===`error`)r.reject(Error(t.error));else{let e=t.response;if(r.schema)try{r.resolve(r.schema.parse(e))}catch(e){r.reject(e)}else r.resolve({})}}setOnControlRequestSent(e){this.onControlRequestSent=e}setOnControlRequestResolved(e){this.onControlRequestResolved=e}async processLine(e){if(e)try{let t=Et(me(e));if(t.type===`keep_alive`)return;if(t.type===`update_environment_variables`){let e=t.variables??{},n=Object.keys(e);for(let[t,n]of Object.entries(e))process.env[t]=n;F(`[structuredIO] applied update_environment_variables: ${n.join(`, `)}`);return}if(t.type===`control_response`){let e=`uuid`in t&&typeof t.uuid==`string`?t.uuid:void 0;e&&st(e,`completed`);let n=t.response,r=this.pendingRequests.get(n.request_id);if(!r){let e=(n.subtype===`success`?n.response:void 0)?.toolUseID;if(typeof e==`string`&&this.resolvedToolUseIds.has(e)){F(`Ignoring duplicate control_response for already-resolved toolUseID=${e} request_id=${n.request_id}`);return}this.unexpectedResponseCallback&&await this.unexpectedResponseCallback(t);return}if(this.trackResolvedToolUseId(r.request),this.pendingRequests.delete(n.request_id),r.request.request.subtype===`can_use_tool`&&this.onControlRequestResolved&&this.onControlRequestResolved(n.request_id),n.subtype===`error`){r.reject(Error(n.error??`Unknown error`));return}let i=n.response;if(r.schema)try{r.resolve(r.schema.parse(i))}catch(e){r.reject(e)}else r.resolve({});return this.replayUserMessages?t:void 0}if(t.type!==`user`&&t.type!==`control_request`&&t.type!==`assistant`&&t.type!==`system`){F(`Ignoring unknown message type: ${t.type}`,{level:`warn`});return}return t.type===`control_request`?(t.request||Nn(`Error: Missing request on control_request`),t):(t.type===`assistant`||t.type===`system`||t.message?.role!==`user`&&Nn(`Error: Expected message role 'user', got '${t.message?.role}'`),t)}catch(t){console.error(`Error parsing streaming input line: ${e}: ${t}`),process.exit(1)}}async write(e){We(Dn(e)+`
4
+ `)}async sendRequest(e,t,n,r=R()){let i={type:`control_request`,request_id:r,request:e};if(this.inputClosed)throw Error(`Stream closed`);if(n?.aborted)throw Error(`Request aborted`);this.outbound.enqueue(i),e.subtype===`can_use_tool`&&this.onControlRequestSent&&this.onControlRequestSent(i);let a=()=>{this.outbound.enqueue({type:`control_cancel_request`,request_id:r});let e=this.pendingRequests.get(r);e&&(this.trackResolvedToolUseId(e.request),e.reject(new St))};n&&n.addEventListener(`abort`,a,{once:!0});try{return await new Promise((n,i)=>{this.pendingRequests.set(r,{request:{type:`control_request`,request_id:r,request:e},resolve:e=>{n(e)},reject:i,schema:t})})}finally{n&&n.removeEventListener(`abort`,a),this.pendingRequests.delete(r)}}createCanUseTool(e){return async(t,n,r,i,a,o)=>{let s=o??await Je(t,n,r,i,a);if(s.behavior===`allow`||s.behavior===`deny`)return s;let c=new AbortController,l=r.abortController.signal,u=()=>c.abort();l.addEventListener(`abort`,u,{once:!0});try{let i=Pn(t.name,a,n,r,s.suggestions).then(e=>({source:`hook`,decision:e})),o=R();e?.(An(t,n,a,o));let l=this.sendRequest({subtype:`can_use_tool`,tool_name:t.name,input:n,permission_suggestions:s.suggestions,blocked_path:s.blockedPath,decision_reason:kn(s.decisionReason),tool_use_id:a,agent_id:r.agentId},W(),c.signal,o).then(e=>({source:`sdk`,result:e})),u=await Promise.race([i,l]);return u.source===`hook`?u.decision?(l.catch(()=>{}),c.abort(),u.decision):G((await l).result,t,n,r):G(u.result,t,n,r)}catch(e){return G({behavior:`deny`,message:`Tool permission request failed: ${e}`,toolUseID:a},t,n,r)}finally{this.getPendingPermissionRequests().length===0&&Dt(`running`),l.removeEventListener(`abort`,u)}}}createHookCallback(e,t){return{type:`callback`,timeout:t,callback:async(t,n,r)=>{try{return await this.sendRequest({subtype:`hook_callback`,callback_id:e,input:t,tool_use_id:n||void 0},xn(),r)}catch(t){return console.error(`Error in hook callback ${e}:`,t),{}}}}}async handleElicitation(e,t,n,r,i,a,o){try{return await this.sendRequest({subtype:`elicitation`,mcp_server_name:e,message:t,mode:i,url:a,elicitation_id:o,requested_schema:n},V(),r)}catch{return{action:`cancel`}}}createSandboxAskCallback(){return async e=>{try{return(await this.sendRequest({subtype:`can_use_tool`,tool_name:On,input:{host:e.host},tool_use_id:R(),description:`Allow network connection to ${e.host}?`},W())).behavior===`allow`}catch{return!1}}}async sendMcpMessage(e,t){return(await this.sendRequest({subtype:`mcp_message`,server_name:e,message:t},m({mcp_response:h()}))).mcp_response}};function Nn(e){console.error(e),process.exit(1)}async function Pn(e,t,n,r,i){let a=r.getAppState().toolPermissionContext.mode,o=Le(e,t,n,r,a,i,r.abortController.signal);for await(let e of o)if(e.permissionRequestResult&&(e.permissionRequestResult.behavior===`allow`||e.permissionRequestResult.behavior===`deny`)){let t=e.permissionRequestResult;if(t.behavior===`allow`){let e=t.updatedInput||n,i=t.updatedPermissions??[];if(i.length>0){Ge(i);let e=ht(r.getAppState().toolPermissionContext,i);r.setAppState(t=>t.toolPermissionContext===e?t:{...t,toolPermissionContext:e})}return{behavior:`allow`,updatedInput:e,userModified:!1,decisionReason:{type:`hook`,hookName:`PermissionRequest`}}}else return{behavior:`deny`,message:t.message||`Permission denied by PermissionRequest hook`,decisionReason:{type:`hook`,hookName:`PermissionRequest`}}}}T(),k(),Oe();function Fn(e,t,n){let r=[],i=[],a=[];for(let[o,s]of Object.entries(e)){let e=t[o],c=Ln(s.source,n?.projectRoot);e?s.sourceIsFallback||re(c,e.source)?a.push(o):i.push({name:o,declaredSource:c,materializedSource:e.source}):r.push(o)}return{missing:r,sourceChanged:i,upToDate:a}}async function In(e){let t=$e();if(Object.keys(t).length===0)return{installed:[],updated:[],failed:[],upToDate:[],skipped:[]};let n;try{n=await ot()}catch(e){Se(e),n={}}let r=Fn(t,n,{projectRoot:y()}),i=[...r.missing.map(e=>({name:e,source:Ln(t[e].source),action:`install`})),...r.sourceChanged.map(({name:e,declaredSource:t})=>({name:e,source:t,action:`update`}))],a=[],o=[];for(let t of i){if(e?.skip?.(t.name,t.source)){a.push(t.name);continue}if(t.action===`update`&&ue(t.source)&&!await ce(t.source.path)){A(`[reconcile] '${t.name}' declared path does not exist; keeping materialized entry`),a.push(t.name);continue}o.push(t)}if(o.length===0)return{installed:[],updated:[],failed:[],upToDate:r.upToDate,skipped:a};A(`[reconcile] ${o.length} marketplace(s): ${o.map(e=>`${e.name}(${e.action})`).join(`, `)}`);let s=[],c=[],l=[];for(let t=0;t<o.length;t++){let{name:n,source:r,action:i}=o[t];e?.onProgress?.({type:`installing`,name:n,action:i,index:t+1,total:o.length});try{let t=await pt(r);i===`install`?s.push(n):c.push(n),e?.onProgress?.({type:`installed`,name:n,alreadyMaterialized:t.alreadyMaterialized})}catch(t){let r=_e(t);l.push({name:n,error:r}),e?.onProgress?.({type:`failed`,name:n,error:r}),Se(t)}}return{installed:s,updated:c,failed:l,upToDate:r.upToDate,skipped:a}}function Ln(e,t){if((e.source===`directory`||e.source===`file`)&&!Lt(e.path)){let n=t??y(),r=ye(n);return{...e,path:zt(r??n,e.path)}}return e}v(),se(),le(),xe(),C(),Ze(),fe(),tt(),Qe();var Rn=new Set,zn=t({getCronJitterConfig:()=>Bn});function Bn(){let e=de(`tengu_kairos_cron_config`,L,Vn),t=Un().safeParse(e);return t.success?t.data:L}var Vn,K,Hn,Un,Wn=e((()=>{_(),Ot(),N(),Vn=60*1e3,K=1800*1e3,Hn=720*60*60*1e3,Un=M(()=>m({recurringFrac:i().min(0).max(1),recurringCapMs:i().int().min(0).max(K),oneShotMaxMs:i().int().min(0).max(K),oneShotFloorMs:i().int().min(0).max(K),oneShotMinuteMod:i().int().min(1).max(60),recurringMaxAgeMs:i().int().min(0).max(Hn).default(L.recurringMaxAgeMs)}).refine(e=>e.oneShotFloorMs<=e.oneShotMaxMs))}));function q(e){return Rt(e??x(),Jn)}async function Gn(e){let t;try{t=await Vt(q(e),`utf8`)}catch{return}let n=X().safeParse(we(t,!1));return n.success?n.data:void 0}async function Kn(e,t){let n=q(t),r=O(e);try{return await B(n,r,{flag:`wx`}),!0}catch(e){let t=E(e);if(t===`EEXIST`)return!1;if(t===`ENOENT`){await Bt(It(n),{recursive:!0});try{return await B(n,r,{flag:`wx`}),!0}catch(e){if(E(e)===`EEXIST`)return!1;throw e}}throw e}}function J(e){Z?.(),Z=pe(async()=>{await Y(e)})}async function qn(e){let t=e?.dir,n=e?.lockIdentity??S(),r={sessionId:n,pid:process.pid,acquiredAt:Date.now()};if(await Kn(r,t))return Q=void 0,J(e),A(`[ScheduledTasks] acquired scheduler lock (PID ${process.pid})`),!0;let i=await Gn(t);return i?.sessionId===n?(i.pid!==process.pid&&(await B(q(t),O(r)),J(e)),!0):i&&Ee(i.pid)?(Q!==i.sessionId&&(Q=i.sessionId,A(`[ScheduledTasks] scheduler lock held by session ${i.sessionId} (PID ${i.pid})`)),!1):(i&&A(`[ScheduledTasks] recovering stale scheduler lock from PID ${i.pid}`),await z(q(t)).catch(()=>{}),await Kn(r,t)?(Q=void 0,J(e),!0):!1)}async function Y(e){Z?.(),Z=void 0,Q=void 0;let t=e?.dir,n=e?.lockIdentity??S(),r=await Gn(t);if(!(!r||r.sessionId!==n))try{await z(q(t)),A(`[ScheduledTasks] released scheduler lock`)}catch{}}var Jn,X,Z,Q,Yn=e((()=>{_(),v(),k(),ge(),De(),N(),D(),Jn=Rt(`.claude`,`scheduled_tasks.lock`),X=M(()=>m({sessionId:a(),pid:i(),acquiredAt:i()}))})),Xn=t({buildMissedTaskNotification:()=>$n,createCronScheduler:()=>Qn,isRecurringTaskAged:()=>Zn});function Zn(e,t,n){return n===0?!1:!!(e.recurring&&!e.permanent&&t-e.createdAt>=n)}function Qn(e){let{onFire:t,isLoading:n,assistantMode:r=!1,onFireTask:i,onMissed:a,dir:o,lockIdentity:s,getJitterConfig:c,isKilled:l,filter:u}=e,d=o||s?{dir:o,lockIdentity:s}:void 0,f=[],p=new Map,m=new Set,h=new Set,g=null,_=null,v=null,y=null,x=!1,S=!1;async function C(e){let n=await At(o);if(x||(f=n,!e))return;let r=Mt(n,Date.now()).filter(e=>!e.recurring&&!m.has(e.id)&&(!u||u(e)));if(r.length>0){for(let e of r)m.add(e.id),p.set(e.id,1/0);j(`tengu_scheduled_task_missed`,{count:r.length,taskIds:r.map(e=>e.id).join(`,`)}),a?a(r):t($n(r)),jt(r.map(e=>e.id),o).catch(e=>A(`[ScheduledTasks] failed to remove missed tasks: ${e}`)),A(`[ScheduledTasks] surfaced ${r.length} missed one-shot task(s)`)}}function w(){if(l?.()||n()&&!r)return;let e=Date.now(),a=new Set,s=[],d=c?.()??L;function m(n,r){if(u&&!u(n)||(a.add(n.id),h.has(n.id)))return;let c=p.get(n.id);if(c===void 0&&(c=n.recurring?Nt(n.cron,n.lastFiredAt??n.createdAt,n.id,d)??1/0:Ft(n.cron,n.createdAt,n.id,d)??1/0,p.set(n.id,c),A(`[ScheduledTasks] scheduled ${n.id} for ${c===1/0?`never`:new Date(c).toISOString()}`)),e<c)return;A(`[ScheduledTasks] firing ${n.id}${n.recurring?` (recurring)`:``}`),j(`tengu_scheduled_task_fire`,{recurring:n.recurring??!1,taskId:n.id}),i?i(n):t(n.prompt);let l=Zn(n,e,d.recurringMaxAgeMs);if(l){let t=Math.floor((e-n.createdAt)/1e3/60/60);A(`[ScheduledTasks] recurring task ${n.id} aged out (${t}h since creation), deleting after final fire`),j(`tengu_scheduled_task_expired`,{taskId:n.id,ageHours:t})}if(n.recurring&&!l){let t=Nt(n.cron,e,n.id,d)??1/0;p.set(n.id,t),r||s.push(n.id)}else r?(te([n.id]),p.delete(n.id)):(h.add(n.id),jt([n.id],o).catch(e=>A(`[ScheduledTasks] failed to remove task ${n.id}: ${e}`)).finally(()=>h.delete(n.id)),p.delete(n.id))}if(S){for(let e of f)m(e,!1);if(s.length>0){for(let e of s)h.add(e);kt(s,e,o).catch(e=>A(`[ScheduledTasks] failed to persist lastFiredAt: ${e}`)).finally(()=>{for(let e of s)h.delete(e)})}}if(o===void 0)for(let e of ne())m(e,!0);if(a.size===0){p.clear();return}for(let e of p.keys())a.has(e)||p.delete(e)}async function T(){if(x)return;g&&(clearInterval(g),g=null);let{default:e}=await import(`./chokidar-DkDXNCTz.js`);if(x)return;if(S=await qn(d).catch(()=>!1),x){S&&(S=!1,Y(d));return}S||(v=setInterval(()=>{qn(d).then(e=>{if(x){e&&Y(d);return}e&&(S=!0,v&&(clearInterval(v),v=null))}).catch(e=>A(String(e),{level:`error`}))},tr),v.unref?.()),C(!0);let t=Pt(o);y=e.watch(t,{persistent:!1,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:er},ignorePermissionErrors:!0}),y.on(`add`,()=>void C(!1)),y.on(`change`,()=>void C(!1)),y.on(`unlink`,()=>{x||(f=[],p.clear())}),_=setInterval(w,$),_.unref?.()}return{start(){if(x=!1,o!==void 0){A(`[ScheduledTasks] scheduler start() — dir=${o}, hasTasks=${I(o)}`),T();return}if(A(`[ScheduledTasks] scheduler start() — enabled=${b()}, hasTasks=${I()}`),!b()&&(r||I())&&ee(!0),b()){T();return}g=setInterval(e=>{b()&&e()},$,T),g.unref?.()},stop(){x=!0,g&&(clearInterval(g),g=null),_&&(clearInterval(_),_=null),v&&(clearInterval(v),v=null),y?.close(),y=null,S&&(S=!1,Y(d))},getNextFireTime(){let e=1/0;for(let t of p.values())t<e&&(e=t);return e===1/0?null:e}}}function $n(e){let t=e.length>1;return`${`The following one-shot scheduled task${t?`s were`:` was`} missed while Claude was not running. ${t?`They have`:`It has`} already been removed from .claude/scheduled_tasks.json.\n\nDo NOT execute ${t?`these prompts`:`this prompt`} yet. First use the AskUserQuestion tool to ask whether to run ${t?`each one`:`it`} now. Only execute if the user confirms.`}\n\n${e.map(e=>{let t=`[${wt(e.cron)}, created ${new Date(e.createdAt).toLocaleString()}]`,n=(e.prompt.match(/`+/g)??[]).reduce((e,t)=>Math.max(e,t.length),0),r="`".repeat(Math.max(3,n+1));return`${t}\n${r}\n${e.prompt}\n${r}`}).join(`
5
+
6
+ `)}`}var $,er,tr,nr=e((()=>{v(),Te(),Tt(),Ot(),Yn(),k(),$=1e3,er=300,tr=5e3}));export{Bn as a,Fn as c,Mn as d,Dn as f,V as g,xn as h,zn as i,In as l,G as m,Xn as n,Wn as o,W as p,nr as r,Rn as s,Qn as t,On as u};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ht as t,Xt as n,Y as r,it as i}from"./state-CUZTq6r0.js";import{E as a,K as o,O as s,U as c,_ as l,h as u,l as d,p as f}from"./debug-CjIaNjpK.js";import{o as p,s as m}from"./log-DVv8YiNo.js";import{s as h,u as g}from"./types-BVelRhgb.js";import{i as _,r as v,t as y}from"./cron-iqTFGIos.js";import{join as b}from"path";import{readFileSync as x}from"fs";import"crypto";import{mkdir as S,writeFile as C}from"fs/promises";function w(e){return b(e??r(),I)}async function T(e){let t=u(),n;try{n=await t.readFile(w(e),{encoding:`utf-8`})}catch(e){return o(e)||m(e),[]}let r=g(n,!1);if(!r||typeof r!=`object`)return[];let i=r;if(!Array.isArray(i.tasks))return[];let a=[];for(let e of i.tasks){if(!e||typeof e.id!=`string`||typeof e.cron!=`string`||typeof e.prompt!=`string`||typeof e.createdAt!=`number`){f(`[ScheduledTasks] skipping malformed task: ${s(e)}`);continue}if(!_(e.cron)){f(`[ScheduledTasks] skipping task ${e.id} with invalid cron '${e.cron}'`);continue}a.push({id:e.id,cron:e.cron,prompt:e.prompt,createdAt:e.createdAt,...typeof e.lastFiredAt==`number`?{lastFiredAt:e.lastFiredAt}:{},...e.recurring?{recurring:!0}:{},...e.permanent?{permanent:!0}:{}})}return a}function E(e){let t;try{t=x(w(e),`utf-8`)}catch{return!1}let n=g(t,!1);if(!n||typeof n!=`object`)return!1;let r=n.tasks;return Array.isArray(r)&&r.length>0}async function D(e,t){let n=t??r();await S(b(n,`.claude`),{recursive:!0});let i={tasks:e.map(({durable:e,...t})=>t)};await C(w(n),s(i,null,2)+`
2
+ `,`utf-8`)}async function O(e,t){if(e.length===0||t===void 0&&n(e)===e.length)return;let r=new Set(e),i=await T(t),a=i.filter(e=>!r.has(e.id));a.length!==i.length&&await D(a,t)}async function k(e,t,n){if(e.length===0)return;let r=new Set(e),i=await T(n),a=!1;for(let e of i)r.has(e.id)&&(e.lastFiredAt=t,a=!0);a&&await D(i,n)}async function A(e){let t=await T(e);if(e!==void 0)return t;let n=i().map(e=>({...e,durable:!1}));return[...t,...n]}function j(e,t){let n=_(e);if(!n)return null;let r=y(n,new Date(t));return r?r.getTime():null}function M(e){let t=parseInt(e.slice(0,8),16)/4294967296;return Number.isFinite(t)?t:0}function N(e,t,n,r=L){let i=j(e,t);if(i===null)return null;let a=j(e,i);return a===null?i:i+Math.min(M(n)*r.recurringFrac*(a-i),r.recurringCapMs)}function P(e,t,n,r=L){let i=j(e,t);if(i===null)return null;if(new Date(i).getMinutes()%r.oneShotMinuteMod!==0)return i;let a=r.oneShotFloorMs+M(n)*(r.oneShotMaxMs-r.oneShotFloorMs);return Math.max(i-a,t)}function F(e,t){return e.filter(e=>{let n=j(e.cron,e.createdAt);return n!==null&&n<t})}var I,L,R=e((()=>{t(),v(),d(),c(),l(),h(),p(),a(),I=b(`.claude`,`scheduled_tasks.json`),L={recurringFrac:.1,recurringCapMs:900*1e3,oneShotMaxMs:90*1e3,oneShotFloorMs:0,oneShotMinuteMod:30,recurringMaxAgeMs:10080*60*1e3}}));export{R as a,k as c,T as d,O as f,E as i,j as l,F as n,N as o,w as r,A as s,L as t,P as u};
@@ -0,0 +1,40 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-fES5sASd.js";import{Cn as i,F as a,In as o,Ln as s,Mn as c,Rn as l,T as u,Ut as d,_ as f,b as p,g as m,h,l as ee,m as te,t as g,tt as _,x as v,xt as y}from"./src-DNHWYkls.js";import{t as b}from"./jsx-runtime-BTgGEFjL.js";import{Ht as x,K as ne,at as re}from"./state-CUZTq6r0.js";import{Jr as ie,Kr as ae}from"./growthbook-p4aJ_UMv.js";import{D as S,E as oe,l as C,p as w}from"./debug-CjIaNjpK.js";import{i as se,v as ce}from"./git-Bj8Ow4pJ.js";import{a as T,o as le,s as E}from"./log-DVv8YiNo.js";import{D as ue,O as D}from"./teammate-C-FiRloZ.js";import{n as de,r as O}from"./analytics-i6X1et4O.js";import{d as fe,m as pe,w as me,y as k}from"./startupProfiler-4P7GdVw6.js";import{Dh as he,Ew as ge,GT as _e,If as ve,Nr as ye,Oh as be,RT as xe,Rf as Se,Sr as Ce,WT as we,aj as Te,br as Ee,dT as De,fT as Oe,fr as A,ij as ke,ir as Ae,lD as j,si as je,uD as Me,wr as M,ww as Ne,zT as Pe}from"./loadAgentsDir-Bz0FfcVt.js";import{i as Fe,r as N}from"./shellQuote-3s6tV-hK.js";import{t as P}from"./useKeybinding-DAQL_dB_.js";import{t as Ie}from"./useTerminalSize-DzV4aaTi.js";import{n as Le,t as Re}from"./useExitOnCtrlCDWithKeybindings-CBce_-hb.js";import{t as ze}from"./SearchBox-DQg2Ph0V.js";import{n as Be,t as Ve}from"./useSearchInput-nqhdILI2.js";import{n as He,t as F}from"./Messages-CtIbkB2M.js";import{n as Ue,t as We}from"./fuse-ivQ_eRwF.js";import{sep as I}from"path";function Ge({log:e,onExit:t,onSelect:n}){let[r,i]=L.useState(null);L.useEffect(()=>{i(null),M(e)&&ye(e).then(i)},[e]);let a=M(e)&&r===null,o=r??e,s=A(o)||``,c=ve();return _(`confirm:no`,t,{context:`Confirmation`}),_(`confirm:yes`,(0,L.useCallback)(()=>{n(r??e)},[n,r,e]),{context:`Confirmation`}),a?(0,R.jsxs)(v,{flexDirection:`column`,padding:1,children:[(0,R.jsx)(ee,{message:`Loading session…`}),(0,R.jsx)(p,{dimColor:!0,children:(0,R.jsx)(h,{children:(0,R.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})})})]}):(0,R.jsxs)(v,{flexDirection:`column`,children:[(0,R.jsx)(F,{messages:o.messages,tools:c,commands:[],verbose:!0,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:s,screen:`transcript`,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}),(0,R.jsxs)(v,{flexShrink:0,flexDirection:`column`,borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:`single`,paddingLeft:2,children:[(0,R.jsxs)(p,{children:[pe(o.modified),` · `,o.messageCount,` messages`,o.gitBranch?` · ${o.gitBranch}`:``]}),(0,R.jsx)(p,{dimColor:!0,children:(0,R.jsxs)(h,{children:[(0,R.jsx)(m,{shortcut:`Enter`,action:`resume`}),(0,R.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})]})}var L,R,z=e((()=>{L=t(l(),1),g(),P(),Se(),k(),Ee(),Me(),He(),R=b()}));function Ke(e,t){if(e===V)return 3+H;let n=i(e),r=t?Math.min(n,t-H-U):n;return Math.max(0,r)+H+U}function qe(e,t){let n=t-H-U;return i(e)<=n?e:n<=1?e.charAt(0):me(e,n)}function Je({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let i=r?`Resume (All Projects)`:`Resume`,a=i.length+1,o=Math.max(W,G),s=n-a-o-2,c=Math.max(0,Math.min(t,e.length-1)),l=Math.max(20,Math.floor(s/2)),u=e.map(e=>Ke(e,l)),d=0,f=e.length;if(u.reduce((e,t,n)=>e+t+ +(n<u.length-1),0)>s){let t=s-et,n=u[c]??0;for(d=c,f=c+1;d>0||f<e.length;){let r=d>0,i=f<e.length;if(r){let e=(u[d-1]??0)+1;if(n+e<=t){d--,n+=e;continue}}if(i){let e=(u[f]??0)+1;if(n+e<=t){f++,n+=e;continue}}break}}let m=d,h=e.length-f,ee=e.slice(d,f),te=ee.map((e,t)=>d+t);return(0,B.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,B.jsx)(p,{color:`suggestion`,children:i}),m>0&&(0,B.jsxs)(p,{dimColor:!0,children:[Ye,m]}),ee.map((e,t)=>{let n=te[t]===c,r=e===V?e:`#${qe(e,l-H)}`;return(0,B.jsxs)(p,{backgroundColor:n?`suggestion`:void 0,color:n?`inverseText`:void 0,bold:n,children:[` `,r,` `]},e)}),h>0?(0,B.jsxs)(p,{dimColor:!0,children:[Xe,h,Ze]}):(0,B.jsx)(p,{dimColor:!0,children:Qe})]})}var B,V,H,U,Ye,Xe,Ze,Qe,$e,et,W,G,tt=e((()=>{l(),g(),k(),B=b(),V=`All`,H=2,U=1,Ye=`← `,Xe=`→`,Ze=` (tab to cycle)`,Qe=`(tab to cycle)`,$e=2,et=2+$e+1,W=1+$e+15,G=14}));function nt({nodes:e,onSelect:t,onCancel:n,onFocus:r,focusNodeId:i,visibleOptionCount:a,layout:o=`expanded`,isDisabled:s=!1,hideIndexes:c=!1,isNodeExpanded:l,onExpand:u,onCollapse:d,getParentPrefix:f,getChildPrefix:p,onUpFromFirstItem:m}){let[h,ee]=K.useState(new Set),te=K.useRef(!1),g=K.useRef(null),_=K.useCallback(e=>l?l(e):h.has(e),[l,h]),y=K.useMemo(()=>{let t=[];function n(e,r,i){let a=!!e.children&&e.children.length>0,o=_(e.id);if(t.push({node:e,depth:r,isExpanded:o,hasChildren:a,parentId:i}),a&&o&&e.children)for(let t of e.children)n(t,r+1,e.id)}for(let t of e)n(t,0);return t},[e,_]),b=K.useCallback(e=>e?`▼ `:`▶ `,[]),x=K.useCallback(e=>` ▸ `,[]),ne=f??b,re=p??x,ie=K.useCallback(e=>{let t=``;return e.hasChildren?t=ne(e.isExpanded):e.depth>0&&(t=re(e.depth)),t+e.node.label},[ne,re]),ae=K.useMemo(()=>y.map(e=>({label:ie(e),description:e.node.description,dimDescription:e.node.dimDescription??!0,value:e.node.id})),[y,ie]),S=K.useMemo(()=>{let e=new Map;return y.forEach(t=>e.set(t.node.id,t.node)),e},[y]),oe=K.useCallback(e=>y.find(t=>t.node.id===e),[y]),C=K.useCallback((e,t)=>{let n=oe(e);!n||!n.hasChildren||(t?u?u(e):ee(t=>new Set(t).add(e)):d?d(e):ee(t=>{let n=new Set(t);return n.delete(e),n}))},[oe,u,d]);return(0,rt.jsx)(v,{tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(!i||s)return;let t=oe(i);if(t){if(e.key===`right`&&t.hasChildren)e.preventDefault(),C(i,!0);else if(e.key===`left`){if(t.hasChildren&&t.isExpanded)e.preventDefault(),C(i,!1);else if(t.parentId!==void 0&&(e.preventDefault(),te.current=!0,C(t.parentId,!1),r)){let e=S.get(t.parentId);e&&r(e)}}}},children:(0,rt.jsx)(xe,{options:ae,onChange:K.useCallback(e=>{let n=S.get(e);n&&t(n)},[S,t]),onFocus:K.useCallback(e=>{if(te.current){te.current=!1;return}if(g.current!==e&&(g.current=e,r)){let t=S.get(e);t&&r(t)}},[r,S]),onCancel:n,defaultFocusValue:i,visibleOptionCount:a,layout:o,isDisabled:s,hideIndexes:c,onUpFromFirstItem:m})})}var K,rt,it=e((()=>{K=t(l(),1),g(),Pe(),rt=b()}));function at(e,t){return me(e.replace(/\s+/g,` `).trim(),t)}function ot({before:e,match:t,after:n},r){return o.dim(e)+r(t)+o.dim(n)}function st(e,t,n){let r=e.toLowerCase().indexOf(t.toLowerCase());if(r===-1)return null;let i=r+t.length,a=Math.max(0,r-n),o=Math.min(e.length,i+n),s=e.slice(a,r),c=e.slice(r,i),l=e.slice(i,o);return{before:(a>0?`…`:``)+s.replace(/\s+/g,` `).trimStart(),match:c.trim(),after:l.replace(/\s+/g,` `).trimEnd()+(o<e.length?`…`:``)}}function ct(e,t,n){let{isGroupHeader:r=!1,isChild:i=!1,forkCount:a=0}=n||{},o=r&&a>0?ht:i?Y:0,s=r&&a>0?` (+${a} other ${a===1?`session`:`sessions`})`:``,c=e.isSidechain?` (sidechain)`:``,l=t-o-c.length-s.length;return`${at(T(e),l)}${c}${s}`}function lt(e,t){let{isChild:n=!1,showProjectPath:r=!1}=t||{},i=n?` `:``,a=fe(e),o=r&&e.projectPath?` · ${e.projectPath}`:``;return i+a+o}function ut({logs:e,maxHeight:t=1/0,forceWidth:n,onCancel:i,onSelect:o,onLogsChanged:s,onLoadMore:l,initialSearchQuery:ee,showAllProjects:g=!1,onToggleAllProjects:b,onAgenticSearch:x}){let ie=a(),ae=n===void 0?ie.columns:n,S=Le(i),oe=d(),C=Ce(),w=process.env.USER_TYPE===`ant`,[ce]=u(),le=De(ce),E=q.useMemo(()=>e=>c(e,le.warning),[le.warning]),ue=process.env.USER_TYPE===`ant`,[D,de]=q.useState(null),[pe,me]=q.useState(!1),[k,ge]=q.useState(!1),[_e,ve]=q.useState(!1),ye=q.useMemo(()=>ne(),[]),[be,Se]=q.useState(``),[Te,Ee]=q.useState(0),[Oe,ke]=q.useState(new Set),[Me,M]=q.useState(null),[Pe,Fe]=q.useState(1),[N,P]=q.useState(`list`),[Ie,Re]=q.useState(null),ze=q.useRef(null),[Ve,He]=q.useState(0),[F,Ue]=q.useState({status:`idle`}),[I,L]=q.useState(!1),R=q.useRef(null),{query:z,setQuery:Ke,cursorOffset:qe}=Be({isActive:N===`search`&&F.status!==`searching`,onExit:()=>{P(`list`),O(`tengu_session_search_toggled`,{enabled:!1})},onExitUp:()=>{P(`list`),O(`tengu_session_search_toggled`,{enabled:!1})},passthroughCtrlKeys:[`n`],initialQuery:ee||``}),B=q.useDeferredValue(z),[V,H]=q.useState(``);q.useEffect(()=>{if(!B){H(``);return}let e=setTimeout(H,300,B);return()=>clearTimeout(e)},[B]);let[U,Ye]=q.useState(null),[Xe,Ze]=q.useState(!1);q.useEffect(()=>{se().then(e=>de(e)),he(ye).then(e=>{ve(e.length>1)})},[ye]);let Qe=q.useMemo(()=>new Map(e.map(e=>[e,ft(e)])),[e]),$e=q.useMemo(()=>w?new We(e.map(e=>({log:e,searchableText:Qe.get(e)??``})).filter(e=>e.searchableText),{keys:[`searchableText`],threshold:gt,ignoreLocation:!0,includeScore:!0}):null,[e,Qe,w]),et=q.useMemo(()=>mt(e),[e]),W=et.length>0,G=q.useMemo(()=>W?[`All`,...et]:[],[W,et]),tt=G.length>0&&Ve<G.length?Ve:0,K=G[tt],rt=K===`All`?void 0:K,it=+!!W,ut=q.useMemo(()=>{let t=e;return C&&(t=e.filter(e=>{let t=re(),n=A(e);return!!(t&&n===t||e.customTitle||Ae(e.messages)||e.firstPrompt||e.customTitle)})),rt!==void 0&&(t=t.filter(e=>e.tag===rt)),pe&&D&&(t=t.filter(e=>e.gitBranch===D)),_e&&!k&&(t=t.filter(e=>e.projectPath===ye)),t},[e,C,rt,pe,D,_e,k,ye]),dt=q.useMemo(()=>{if(!z)return ut;let e=z.toLowerCase();return ut.filter(t=>{let n=T(t).toLowerCase(),r=(t.gitBranch||``).toLowerCase(),i=(t.tag||``).toLowerCase(),a=t.prNumber?`pr #${t.prNumber} ${t.prRepository||``}`.toLowerCase():``;return n.includes(e)||r.includes(e)||i.includes(e)||a.includes(e)})},[ut,z]);q.useEffect(()=>{w&&B&&B!==V&&Ze(!0)},[B,V,w]),q.useEffect(()=>{if(!w||!V||!$e){Ye(null),Ze(!1);return}let e=setTimeout((e,t,n,r)=>{let i=e.search(t);i.sort((e,t)=>{let n=new Date(e.item.log.modified).getTime(),r=new Date(t.item.log.modified).getTime()-n;return Math.abs(r)>_t?r:(e.score??1)-(t.score??1)}),n({results:i.map(e=>({log:e.item.log,score:e.score,searchableText:e.item.searchableText})),query:t}),r(!1)},0,$e,V,Ye,Ze);return()=>{clearTimeout(e)}},[V,$e,w]);let{filteredLogs:ht,snippets:Y}=q.useMemo(()=>{let e=new Map,t=dt;if(U&&V&&U.query===V){for(let t of U.results)if(t.searchableText){let n=st(t.searchableText,V,vt);n&&e.set(t.log,n)}let n=new Set(t.map(e=>e.messages[0]?.uuid)),r=U.results.map(e=>e.log).filter(e=>!n.has(e.messages[0]?.uuid));t=[...t,...r]}return{filteredLogs:t,snippets:e}},[dt,U,V]),X=q.useMemo(()=>F.status===`results`&&F.results.length>0?F.results:ht,[F,ht]),Z=Math.max(30,ae-4),Q=q.useMemo(()=>{if(!C)return[];let e=pt(X);return Array.from(e.entries()).map(([e,t])=>{let n=t[0],r=X.indexOf(n),i=Y.get(n),a=i?ot(i,E):null;if(t.length===1){let t=lt(n,{showProjectPath:g});return{id:`log:${e}:0`,value:{log:n,indexInFiltered:r},label:ct(n,Z),description:a?`${t}\n ${a}`:t,dimDescription:!0}}let o=t.length-1,s=t.slice(1).map((t,n)=>{let r=X.indexOf(t),i=Y.get(t),a=i?ot(i,E):null,o=lt(t,{isChild:!0,showProjectPath:g});return{id:`log:${e}:${n+1}`,value:{log:t,indexInFiltered:r},label:ct(t,Z,{isChild:!0}),description:a?`${o}\n ${a}`:o,dimDescription:!0}}),c=lt(n,{showProjectPath:g});return{id:`group:${e}`,value:{log:n,indexInFiltered:r},label:ct(n,Z,{isGroupHeader:!0,forkCount:o}),description:a?`${c}\n ${a}`:c,dimDescription:!0,children:s}})},[C,X,Z,g,Y,E]),yt=q.useMemo(()=>C?[]:X.map((e,t)=>{let n=at(T(e)+(e.isSidechain?` (sidechain)`:``),Z),r=fe(e),i=g&&e.projectPath?` · ${e.projectPath}`:``,a=Y.get(e),o=a?ot(a,E):null;return{label:n,description:o?`${r}${i}\n ${o}`:r+i,dimDescription:!0,value:t.toString()}}),[C,X,E,Z,g,Y]),$=Me?.value.log??null,bt=()=>{if(!C||!$)return``;let e=A($);if(!e)return``;let t=X.filter(t=>A(t)===e);if(!(t.length>1))return``;let n=Oe.has(e);return t.indexOf($)>0||n?`← to collapse`:`→ to expand`},xt=q.useCallback(async()=>{let e=$?A($):void 0;if(!$||!e){P(`list`),Se(``);return}be.trim()&&(await je(e,be.trim(),$.fullPath),C&&s&&s()),P(`list`),Se(``)},[$,be,s,C]),St=q.useCallback(()=>{P(`list`),O(`tengu_session_search_toggled`,{enabled:!1})},[]),Ct=q.useCallback(()=>{P(`search`),O(`tengu_session_search_toggled`,{enabled:!0})},[]),wt=q.useCallback(async()=>{if(!z.trim()||!x||!ue)return;R.current?.abort();let t=new AbortController;R.current=t,Ue({status:`searching`}),O(`tengu_agentic_search_started`,{query_length:z.length});try{let n=await x(z,e,t.signal);if(t.signal.aborted)return;Ue({status:`results`,results:n,query:z}),O(`tengu_agentic_search_completed`,{query_length:z.length,results_count:n.length})}catch(e){if(t.signal.aborted)return;Ue({status:`error`,message:e instanceof Error?e.message:`Search failed`}),O(`tengu_agentic_search_error`,{query_length:z.length})}},[z,x,ue,e]);q.useEffect(()=>{F.status!==`idle`&&F.status!==`searching`&&(F.status===`results`&&F.query!==z||F.status===`error`)&&Ue({status:`idle`})},[z,F]),q.useEffect(()=>()=>{R.current?.abort()},[]);let Tt=q.useRef(F.status);q.useEffect(()=>{let e=Tt.current;if(Tt.current=F.status,e===`searching`&&F.status===`results`){if(C&&Q.length>0)M(Q[0]);else if(!C&&X.length>0){let e=X[0];M({id:`0`,value:{log:e,indexInFiltered:0},label:``})}}},[F.status,C,Q,X]);let Et=q.useCallback(e=>{let t=parseInt(e,10),n=X[t];!n||ze.current===t.toString()||(ze.current=t.toString(),M({id:t.toString(),value:{log:n,indexInFiltered:t},label:``}),Fe(t+1))},[X]),Dt=q.useCallback(e=>{M(e);let t=X.findIndex(t=>A(t)===A(e.value.log));t>=0&&Fe(t+1)},[X]);_(`confirm:no`,()=>{R.current?.abort(),Ue({status:`idle`}),O(`tengu_agentic_search_cancelled`,{})},{context:`Confirmation`,isActive:N!==`preview`&&F.status===`searching`}),_(`confirm:no`,()=>{P(`list`),Se(``)},{context:`Settings`,isActive:N===`rename`&&F.status!==`searching`}),_(`confirm:no`,()=>{Ke(``),L(!1),i?.()},{context:`Confirmation`,isActive:N!==`preview`&&N!==`rename`&&N!==`search`&&I&&F.status!==`searching`}),y((e,t)=>{if(N!==`preview`&&F.status!==`searching`&&N!==`rename`)if(N===`search`)e.toLowerCase()===`n`&&t.ctrl?St():(t.return||t.downArrow)&&z.trim()&&x&&ue&&F.status!==`results`&&L(!0);else{if(I){if(t.return){wt(),L(!1);return}else if(t.downArrow){L(!1);return}else if(t.upArrow){P(`search`),L(!1);return}}if(W&&t.tab){let e=t.shift?-1:1;He(t=>{let n=((t<G.length?t:0)+G.length+e)%G.length,r=G[n];return O(`tengu_session_tag_filter_changed`,{is_all:r===`All`,tag_count:et.length}),n});return}let n=!t.ctrl&&!t.meta,r=e.toLowerCase();if(r===`a`&&t.ctrl&&b)b(),O(`tengu_session_all_projects_toggled`,{enabled:!g});else if(r===`b`&&t.ctrl){let e=!pe;me(e),O(`tengu_session_branch_filter_toggled`,{enabled:e})}else if(r===`w`&&t.ctrl&&_e){let e=!k;ge(e),O(`tengu_session_worktree_filter_toggled`,{enabled:e})}else r===`/`&&n?(P(`search`),O(`tengu_session_search_toggled`,{enabled:!0})):r===`r`&&t.ctrl&&$?(P(`rename`),Se(``),O(`tengu_session_rename_started`,{})):r===`v`&&t.ctrl&&$?(Re($),P(`preview`),O(`tengu_session_preview_opened`,{messageCount:$.messageCount})):$&&n&&e.length>0&&!/^\s+$/.test(e)&&(P(`search`),Ke(e),O(`tengu_session_search_toggled`,{enabled:!0}))}},{isActive:!0});let Ot=[];pe&&D&&Ot.push(D),_e&&!k&&Ot.push(`current worktree`);let kt=8+ +(Ot.length>0&&N!==`search`)+it,At=Math.max(1,Math.floor((t-kt-2)/3));return q.useEffect(()=>{l&&Pe+At*2>=X.length&&l(At*3)},[Pe,At,X.length,l]),e.length===0?null:N===`preview`&&Ie&&C?(0,J.jsx)(Ge,{log:Ie,onExit:()=>{P(`list`),Re(null)},onSelect:o}):(0,J.jsxs)(v,{flexDirection:`column`,height:t-1,children:[(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsx)(te,{color:`suggestion`})}),(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsx)(p,{children:` `})}),W?(0,J.jsx)(Je,{tabs:G,selectedIndex:tt,availableWidth:ae,showAllProjects:g}):(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsxs)(p,{bold:!0,color:`suggestion`,children:[`Resume Session`,N===`list`&&X.length>At&&(0,J.jsxs)(p,{dimColor:!0,children:[` `,`(`,Pe,` of `,X.length,`)`]})]})}),(0,J.jsx)(f,{query:z,isFocused:N===`search`,isTerminalFocused:oe,cursorOffset:qe}),Ot.length>0&&N!==`search`&&(0,J.jsx)(v,{flexShrink:0,paddingLeft:2,children:(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsx)(h,{children:Ot})})}),(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsx)(p,{children:` `})}),F.status===`searching`&&(0,J.jsxs)(v,{paddingLeft:1,flexShrink:0,children:[(0,J.jsx)(Ne,{}),(0,J.jsx)(p,{children:` Searching…`})]}),F.status===`results`&&F.results.length>0&&(0,J.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`Claude found these results:`})}),F.status===`results`&&F.results.length===0&&ht.length===0&&(0,J.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),F.status===`error`&&ht.length===0&&(0,J.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),!!z.trim()&&x&&ue&&F.status!==`searching`&&F.status!==`results`&&F.status!==`error`&&(0,J.jsxs)(v,{flexShrink:0,flexDirection:`column`,children:[(0,J.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(p,{color:I?`suggestion`:void 0,children:I?r.pointer:` `}),(0,J.jsx)(p,{color:I?`suggestion`:void 0,bold:I,children:`Search deeply using Claude →`})]}),(0,J.jsx)(v,{height:1})]}),F.status===`searching`?null:N===`rename`&&$?(0,J.jsxs)(v,{paddingLeft:2,flexDirection:`column`,children:[(0,J.jsx)(p,{bold:!0,children:`Rename session:`}),(0,J.jsx)(v,{paddingTop:1,children:(0,J.jsx)(we,{value:be,onChange:Se,onSubmit:xt,placeholder:T($,`Enter new session name`),columns:ae,cursorOffset:Te,onChangeCursorOffset:Ee,showCursor:!0})})]}):C?(0,J.jsx)(nt,{nodes:Q,onSelect:e=>{o(e.value.log)},onFocus:Dt,onCancel:i,focusNodeId:Me?.id,visibleOptionCount:At,layout:`expanded`,isDisabled:N===`search`||I,hideIndexes:!1,isNodeExpanded:e=>{if(N===`search`||pe)return!0;let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;return t?Oe.has(t):!1},onExpand:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&(ke(e=>new Set(e).add(t)),O(`tengu_session_group_expanded`,{}))},onCollapse:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&ke(e=>{let n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:Ct}):(0,J.jsx)(xe,{options:yt,onChange:e=>{let t=X[parseInt(e,10)];t&&o(t)},visibleOptionCount:At,onCancel:i,onFocus:Et,defaultFocusValue:Me?.id.toString(),layout:`expanded`,isDisabled:N===`search`||I,onUpFromFirstItem:Ct}),(0,J.jsx)(v,{paddingLeft:2,children:S.pending?(0,J.jsxs)(p,{dimColor:!0,children:[`Press `,S.keyName,` again to exit`]}):N===`rename`?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(m,{shortcut:`Enter`,action:`save`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):F.status===`searching`?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(p,{children:`Searching with Claude…`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):I?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(m,{shortcut:`Enter`,action:`search`}),(0,J.jsx)(m,{shortcut:`↓`,action:`skip`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):N===`search`?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(p,{children:Xe&&w?`Searching…`:`Type to Search`}),(0,J.jsx)(m,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`clear`})]})}):(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[b&&(0,J.jsx)(m,{shortcut:`Ctrl+A`,action:`show ${g?`current dir`:`all projects`}`}),D&&(0,J.jsx)(m,{shortcut:`Ctrl+B`,action:`toggle branch`}),_e&&(0,J.jsx)(m,{shortcut:`Ctrl+W`,action:`show ${k?`current worktree`:`all worktrees`}`}),(0,J.jsx)(m,{shortcut:`Ctrl+V`,action:`preview`}),(0,J.jsx)(m,{shortcut:`Ctrl+R`,action:`rename`}),(0,J.jsx)(p,{children:`Type to search`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`}),bt()&&(0,J.jsx)(p,{children:bt()})]})})})]})}function dt(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function ft(e){let t=(e.messages.length<=X?e.messages:[...e.messages.slice(0,Z),...e.messages.slice(-Z)]).map(dt).filter(Boolean).join(` `),n=`${[e.customTitle,e.summary,e.firstPrompt,e.gitBranch,e.tag,e.prNumber?`PR #${e.prNumber}`:void 0,e.prRepository].filter(Boolean).join(` `)} ${t}`.trim();return n.length>Q?n.slice(0,Q):n}function pt(e){let t=new Map;for(let n of e){let e=A(n);if(e){let r=t.get(e);r?r.push(n):t.set(e,[n])}}return t.forEach(e=>e.sort((e,t)=>new Date(t.modified).getTime()-new Date(e.modified).getTime())),t}function mt(e){let t=new Set;for(let n of e)n.tag&&t.add(n.tag);return Array.from(t).sort((e,t)=>e.localeCompare(t))}var q,J,ht,Y,X,Z,Q,gt,_t,vt,yt=e((()=>{s(),n(),Ue(),q=t(l(),1),x(),Re(),Ve(),Ie(),g(),P(),de(),k(),be(),ce(),le(),Ee(),Oe(),Me(),Pe(),ze(),z(),ge(),tt(),_e(),it(),J=b(),ht=2,Y=4,X=2e3,Z=1e3,Q=5e4,gt=.3,_t=60*1e3,vt=50}));function $(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function bt(e){if(e.length===0)return``;let t=(e.length<=wt?e:[...e.slice(0,wt/2),...e.slice(-wt/2)]).map($).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();return t.length>Ct?t.slice(0,Ct)+`…`:t}function xt(e,t){return!!(T(e).toLowerCase().includes(t)||e.customTitle?.toLowerCase().includes(t)||e.tag?.toLowerCase().includes(t)||e.gitBranch?.toLowerCase().includes(t)||e.summary?.toLowerCase().includes(t)||e.firstPrompt?.toLowerCase().includes(t)||e.messages&&e.messages.length>0&&bt(e.messages).toLowerCase().includes(t))}async function St(e,t,n){if(!e.trim()||t.length===0)return[];let r=e.toLowerCase(),i=t.filter(e=>xt(e,r)),a;if(i.length>=Tt)a=i.slice(0,Tt);else{let e=t.filter(e=>!xt(e,r)),n=Tt-i.length;a=[...i,...e.slice(0,n)]}w(`Agentic search: ${a.length}/${t.length} logs, query="${e}", matching: ${i.length}, with messages: ${ue(a,e=>e.messages?.length>0)}`);let o=a.map(async e=>{if(M(e))try{return await ye(e)}catch(t){return E(t),e}return e}),s=await Promise.all(o);w(`Agentic search: loaded ${ue(s,e=>e.messages?.length>0)}/${a.length} logs with transcripts`);let c=`Sessions:
2
+ ${s.map((e,t)=>{let n=[`${t}:`],r=T(e);if(n.push(r),e.customTitle&&e.customTitle!==r&&n.push(`[custom title: ${e.customTitle}]`),e.tag&&n.push(`[tag: ${e.tag}]`),e.gitBranch&&n.push(`[branch: ${e.gitBranch}]`),e.summary&&n.push(`- Summary: ${e.summary}`),e.firstPrompt&&e.firstPrompt!==`No prompt`&&n.push(`- First message: ${e.firstPrompt.slice(0,300)}`),e.messages&&e.messages.length>0){let t=bt(e.messages);t&&n.push(`- Transcript: ${t}`)}return n.join(` `)}).join(`
3
+ `)}
4
+
5
+ Search query: "${e}"
6
+
7
+ Find the sessions that are most relevant to this query.`;w(`Agentic search prompt (first 500 chars): ${c.slice(0,500)}...`);try{let e=ae();w(`Agentic search using model: ${e}`);let t=(await Te({model:e,system:Et,messages:[{role:`user`,content:c}],signal:n,querySource:`session_search`})).content.find(e=>e.type===`text`);if(!t||t.type!==`text`)return w(`No text content in agentic search response`),[];w(`Agentic search response: ${t.text}`);let r=t.text.match(/\{[\s\S]*\}/);if(!r)return w(`Could not find JSON in agentic search response`),[];let i=(S(r[0]).relevant_indices||[]).filter(e=>e>=0&&e<s.length).map(e=>s[e]);return w(`Agentic search found ${i.length} relevant sessions`),i}catch(e){return E(e),w(`Agentic search error: ${e}`),[]}}var Ct,wt,Tt,Et,Dt=e((()=>{D(),C(),le(),ie(),Ee(),ke(),oe(),Ct=2e3,wt=100,Tt=100,Et=`Your goal is to find relevant sessions based on a user's search query.
8
+
9
+ You will be given a list of sessions with their metadata and a search query. Identify which sessions are most relevant to the query.
10
+
11
+ Each session may include:
12
+ - Title (display name or custom title)
13
+ - Tag (user-assigned category, shown as [tag: name] - users tag sessions with /tag command to categorize them)
14
+ - Branch (git branch name, shown as [branch: name])
15
+ - Summary (AI-generated summary)
16
+ - First message (beginning of the conversation)
17
+ - Transcript (excerpt of conversation content)
18
+
19
+ IMPORTANT: Tags are user-assigned labels that indicate the session's topic or category. If the query matches a tag exactly or partially, those sessions should be highly prioritized.
20
+
21
+ For each session, consider (in order of priority):
22
+ 1. Exact tag matches (highest priority - user explicitly categorized this session)
23
+ 2. Partial tag matches or tag-related terms
24
+ 3. Title matches (custom titles or first message content)
25
+ 4. Branch name matches
26
+ 5. Summary and transcript content matches
27
+ 6. Semantic similarity and related concepts
28
+
29
+ CRITICAL: Be VERY inclusive in your matching. Include sessions that:
30
+ - Contain the query term anywhere in any field
31
+ - Are semantically related to the query (e.g., "testing" matches sessions about "tests", "unit tests", "QA", etc.)
32
+ - Discuss topics that could be related to the query
33
+ - Have transcripts that mention the concept even in passing
34
+
35
+ When in doubt, INCLUDE the session. It's better to return too many results than too few. The user can easily scan through results, but missing relevant sessions is frustrating.
36
+
37
+ Return sessions ordered by relevance (most relevant first). If truly no sessions have ANY connection to the query, return an empty array - but this should be rare.
38
+
39
+ Respond with ONLY the JSON object, no markdown formatting:
40
+ {"relevant_indices": [2, 5, 0]}`}));function Ot(e,t,n){let r=ne();if(!t||!e.projectPath||e.projectPath===r)return{isCrossProject:!1};if(process.env.USER_TYPE!==`ant`){let t=A(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${Fe([e.projectPath])} && ccb --resume ${t}`,projectPath:e.projectPath}}if(n.some(t=>e.projectPath===t||e.projectPath.startsWith(t+I)))return{isCrossProject:!0,isSameRepoWorktree:!0,projectPath:e.projectPath};let i=A(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${Fe([e.projectPath])} && ccb --resume ${i}`,projectPath:e.projectPath}}var kt=e((()=>{x(),N(),Ee()}));export{ut as a,Dt as i,kt as n,yt as o,St as r,Ot as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ht as t,K as n,w as r}from"./state-CUZTq6r0.js";import{AsyncLocalStorage as i}from"async_hooks";function a(e,t){return c.run(e,t)}function o(){return c.getStore()??r()}function s(){try{return o()}catch{return n()}}var c,l=e((()=>{t(),c=new i}));export{a as i,l as n,o as r,s as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./cwd-BXiaJzLh.js";e();export{t as getCwd};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ht as t,K as n,w as r}from"./state-CUZTq6r0.js";import{AsyncLocalStorage as i}from"async_hooks";function a(e,t){return c.run(e,t)}function o(){return c.getStore()??r()}function s(){try{return o()}catch{return n()}}var c,l=e((()=>{t(),c=new i}));export{a as i,l as n,o as r,s as t};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";async function t(e,t,r){let i=r?r.trim().split(/\s+/):[],a=i[0]||`status`;return a===`attach`?(e("Use `claude daemon attach` from the CLI. Attach is not available inside the REPL.",{display:`system`}),null):(e((await n(async()=>{if(a===`bg`)await(await import(`./bg-IU4gG3jc.js`)).handleBgStart(i.slice(1));else{let{daemonMain:e}=await import(`./main-sboa5RKc.js`);await e([a,...i.slice(1)])}})).join(`
2
+ `)||`Done.`,{display:`system`}),null)}async function n(e){let t=[],n=console.log,r=console.error;console.log=(...e)=>t.push(e.map(String).join(` `)),console.error=(...e)=>t.push(e.map(String).join(` `));try{await e()}finally{console.log=n,console.error=r}return t}e((()=>{}))();export{t as call};
@@ -0,0 +1 @@
1
+ var e=class{};export{e as DangerousBackend};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./datadog-BQlp3bTs.js";t();export{e as shutdownDatadog};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{n as r,t as i}from"./axios-Zh7qGPze.js";import{Ao as a,Ja as o,Jr as s,Pr as c,Wi as l,_s as u,br as d,ko as f,ps as p,qa as m,xr as h,zi as g}from"./growthbook-p4aJ_UMv.js";import{o as _,s as v}from"./log-DVv8YiNo.js";import{createHash as y}from"crypto";function b(e){return e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}async function x(){if(N.length===0)return;let e=N;N=[];try{await r.post(E,e,{headers:{"Content-Type":`application/json`,"DD-API-KEY":D},timeout:A})}catch(e){v(e)}}function S(){P||(P=setTimeout(()=>{P=null,x()},T()).unref())}async function C(){P&&(clearTimeout(P),P=null),await x()}async function w(e,t){if(f()!==`firstParty`)return;let n=F;if(n===null&&(n=await I()),!(!n||!j.has(e)))try{let{envContext:n,...r}=await d({model:t.model,betas:t.betas}),i={...r,...n,...t,userBucket:R()};if(typeof i.toolName==`string`&&i.toolName.startsWith(`mcp__`)&&(i.toolName=`mcp`),process.env.USER_TYPE!==`ant`&&typeof i.model==`string`){let e=c(i.model.replace(/\[1m]$/i,``));i.model=e in g?e:`other`}if(typeof i.version==`string`&&(i.version=i.version.replace(/^(\d+\.\d+\.\d+-dev\.\d{8})\.t\d+\.sha[a-f0-9]+$/,`$1`)),i.status!==void 0&&i.status!==null){let e=String(i.status);i.http_status=e;let t=e.charAt(0);t>=`1`&&t<=`5`&&(i.http_status_range=`${t}xx`),delete i.status}let a=i,o={ddsource:`nodejs`,ddtags:[`event:${e}`,...M.filter(e=>a[e]!==void 0&&a[e]!==null).map(e=>`${b(e)}:${a[e]}`)].join(`,`),message:e,service:`claude-code`,hostname:`claude-code`,env:process.env.USER_TYPE};for(let[e,t]of Object.entries(i))t!=null&&(o[b(e)]=t);N.push(o),N.length>=k?(P&&(clearTimeout(P),P=null),x()):S()}catch(e){v(e)}}function T(){return parseInt(process.env.CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS||``,10)||O}var E,D,O,k,A,j,M,N,P,F,I,L,R,z=e((()=>{i(),n(),u(),_(),s(),a(),l(),m(),h(),E=process.env.DATADOG_LOGS_ENDPOINT??``,D=process.env.DATADOG_API_KEY??``,O=15e3,k=100,A=5e3,j=new Set(`chrome_bridge_connection_succeeded.chrome_bridge_connection_failed.chrome_bridge_disconnected.chrome_bridge_tool_call_completed.chrome_bridge_tool_call_error.chrome_bridge_tool_call_started.chrome_bridge_tool_call_timeout.tengu_api_error.tengu_api_success.tengu_brief_mode_enabled.tengu_brief_mode_toggled.tengu_brief_send.tengu_cancel.tengu_compact_failed.tengu_exit.tengu_flicker.tengu_init.tengu_model_fallback_triggered.tengu_oauth_error.tengu_oauth_success.tengu_oauth_token_refresh_failure.tengu_oauth_token_refresh_success.tengu_oauth_token_refresh_lock_acquiring.tengu_oauth_token_refresh_lock_acquired.tengu_oauth_token_refresh_starting.tengu_oauth_token_refresh_completed.tengu_oauth_token_refresh_lock_releasing.tengu_oauth_token_refresh_lock_released.tengu_query_error.tengu_session_file_read.tengu_started.tengu_tool_use_error.tengu_tool_use_granted_in_prompt_permanent.tengu_tool_use_granted_in_prompt_temporary.tengu_tool_use_rejected_in_prompt.tengu_tool_use_success.tengu_uncaught_exception.tengu_unhandled_rejection.tengu_voice_recording_started.tengu_voice_toggled.tengu_team_mem_sync_pull.tengu_team_mem_sync_push.tengu_team_mem_sync_started.tengu_team_mem_entries_capped`.split(`.`)),M=[`arch`,`clientType`,`errorType`,`http_status_range`,`http_status`,`kairosActive`,`model`,`platform`,`provider`,`skillMode`,`subscriptionType`,`toolName`,`userBucket`,`userType`,`version`,`versionBase`],N=[],P=null,F=null,I=t(async()=>{if(o()||!E||!D)return F=!1,!1;try{return F=!0,!0}catch(e){return v(e),F=!1,!1}}),L=30,R=t(()=>{let e=p(),t=y(`sha256`).update(e).digest(`hex`);return parseInt(t.slice(0,8),16)%L})}));export{w as i,I as n,C as r,z as t};
@@ -0,0 +1,2 @@
1
+ import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./memoize-DNnuA2aU.js";import{n as i,s as a,u as o}from"./envUtils-CFG7IQID.js";import{$ as s,E as c,O as l,Q as u,X as d,Y as f,Z as p,_ as m,h,nt as g,tt as _}from"./debug-CjIaNjpK.js";import{L as v,j as y}from"./state-BQkyHx88.js";import{n as b,r as x}from"./process-CnhUplBr.js";import{dirname as S,join as C,resolve as w}from"path";import{appendFile as T,mkdir as E,symlink as D,unlink as O}from"fs/promises";var k=t({enableDebugLogging:()=>A,flushDebugLogs:()=>L,getDebugFilePath:()=>q,getDebugFilter:()=>G,getDebugLogPath:()=>z,getHasFormattedOutput:()=>N,getMinDebugLogLevel:()=>H,isDebugMode:()=>W,isDebugToStdErr:()=>K,logAntError:()=>B,logForDebugging:()=>R,setHasFormattedOutput:()=>M});function A(){let e=W()||process.env.USER_TYPE===`ant`;return U=!0,W.cache.clear?.(),e}function j(e){return process.env.USER_TYPE!==`ant`&&!W()||typeof process>`u`||process.versions===void 0||process.versions.node===void 0?!1:p(e,G())}function M(e){J=e}function N(){return J}async function P(e,t,n,r){e&&await E(t,{recursive:!0}).catch(()=>{}),await T(n,r),Z()}function F(){}function I(){if(!Y){let e=null;Y=_({writeFn:t=>{let n=z(),r=S(n),i=e!==r;if(e=r,W()){if(i)try{h().mkdirSync(r)}catch{}try{h().appendFileSync(n,t)}catch{try{h().mkdirSync(r),h().appendFileSync(n,t)}catch{}}Z();return}X=X.then(P.bind(null,i,r,n,t)).catch(F)},flushIntervalMs:1e3,maxBufferSize:100,immediateMode:W()}),s(async()=>{Y?.dispose(),await X})}return Y}async function L(){Y?.flush(),await X}function R(e,{level:t}={level:`debug`}){if(V[t]<V[H()]||!j(e))return;J&&e.includes(`
2
+ `)&&(e=l(e));let n=`${new Date().toISOString()} [${t.toUpperCase()}] ${e.trim()}\n`;if(K()){x(n);return}I().write(n)}function z(){return q()??(process.env.CLAUDE_CODE_DEBUG_LOGS_DIR?w(process.env.CLAUDE_CODE_DEBUG_LOGS_DIR):null)??C(i(),`debug`,`${y()}.txt`)}function B(e,t){process.env.USER_TYPE===`ant`&&t instanceof Error&&t.stack&&R(`[ANT-ONLY] ${e} stack trace:\n${t.stack}`,{level:`error`})}var V,H,U,W,G,K,q,J,Y,X,Z,Q=e((()=>{r(),v(),g(),u(),f(),a(),m(),b(),c(),V={verbose:0,debug:1,info:2,warn:3,error:4},H=n(()=>{let e=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return e&&Object.hasOwn(V,e)?e:`debug`}),U=!1,W=n(()=>U||o(process.env.DEBUG)||o(process.env.DEBUG_SDK)||process.argv.includes(`--debug`)||process.argv.includes(`-d`)||K()||process.argv.some(e=>e.startsWith(`--debug=`))||q()!==null),G=n(()=>{let e=process.argv.find(e=>e.startsWith(`--debug=`));return e?d(e.substring(8)):null}),K=n(()=>process.argv.includes(`--debug-to-stderr`)),q=n(()=>{for(let e=0;e<process.argv.length;e++){let t=process.argv[e];if(t.startsWith(`--debug-file=`))return w(t.substring(13));if(t===`--debug-file`&&e+1<process.argv.length)return w(process.argv[e+1])}return null}),J=!1,Y=null,X=Promise.resolve(),Z=n(async()=>{try{let e=z(),t=C(S(e),`latest`);await O(t).catch(()=>{}),await D(e,t)}catch{}})}));export{K as a,W as i,z as n,R as o,Q as r,M as s,k as t};
@@ -0,0 +1 @@
1
+ import{l as e,p as t}from"./debug-CjIaNjpK.js";e();export{t as logForDebugging};
@@ -0,0 +1,5 @@
1
+ import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{a as n,c as r,n as i,o as a,s as o,t as s}from"./isObject-DaxDnPKm.js";import{d as c,f as l,l as u,n as d,t as f,u as p}from"./memoize-DNnuA2aU.js";import{n as ee,s as te,u as ne}from"./envUtils-CFG7IQID.js";import{g as re}from"./client-BWED8Tbu.js";import{n as ie,t as m}from"./defineProperty-CaCI0a5T.js";import{i as ae,r as oe}from"./isSymbol-D7QeUnS5.js";import{$ as se,A as ce,B as le,E as h,F as ue,G as de,I as fe,K as pe,L as me,M as he,N as ge,P as _e,R as ve,T as g,U as ye,W as _,X as be,Y as xe,at as Se,bt as Ce,ct as we,et as Te,j as Ee,k as De,lt as Oe,mt as ke,nt as Ae,ot as je,pt as Me,st as Ne,tt as Pe,ut as Fe,yt as Ie,z as Le}from"./signal-BTxmab6r.js";import{Ht as Re}from"./state-CUZTq6r0.js";import{L as ze,j as Be}from"./state-BQkyHx88.js";import{t as Ve}from"./sdk-Drp69kIx.js";import{n as He,r as Ue}from"./process-CnhUplBr.js";import{homedir as We}from"os";import*as v from"path";import{dirname as Ge,join as Ke,resolve as qe}from"path";import*as y from"fs";import{closeSync as Je,fsyncSync as Ye,openSync as Xe,writeFileSync as Ze}from"fs";import{appendFile as Qe,mkdir as $e,open as b,readFile as et,readdir as tt,rename as nt,rm as rt,rmdir as it,stat as at,symlink as ot,unlink as st}from"fs/promises";var ct,lt,ut=e((()=>{s(),ct=Object.create,lt=function(){function e(){}return function(t){if(!i(t))return{};if(ct)return ct(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}()}));function dt(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var ft=e((()=>{})),x,pt=e((()=>{l(),x=function(){try{var e=c(Object,`defineProperty`);return e({},``,{}),e}catch{}}()}));function mt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var ht=e((()=>{}));function gt(e,t,n){t==`__proto__`&&x?x(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var _t=e((()=>{pt()}));function vt(e,t,n){var r=e[t];(!(yt.call(e,t)&&u(r,n))||n===void 0&&!(t in e))&&gt(e,t,n)}var yt,S=e((()=>{_t(),p(),yt=Object.prototype.hasOwnProperty}));function C(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?gt(n,s,c):vt(n,s,c)}return n}var w=e((()=>{S(),_t()}));function bt(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var xt=e((()=>{}));function St(e){if(!i(e))return bt(e);var t=ve(e),n=[];for(var r in e)r==`constructor`&&(t||!Ct.call(e,r))||n.push(r);return n}var Ct,wt=e((()=>{s(),me(),xt(),Ct=Object.prototype.hasOwnProperty}));function T(e){return _e(e)?Le(e,!0):St(e)}var E=e((()=>{le(),wt(),ge()})),D,O=e((()=>{ue(),D=fe(Object.getPrototypeOf,Object)}));function Tt(e,t){return e&&C(t,he(t),e)}var Et=e((()=>{w(),Ee()}));function Dt(e,t){return e&&C(t,T(t),e)}var Ot=e((()=>{w(),E()}));function kt(e,t){if(t)return e.slice();var n=e.length,r=Nt?Nt(n):new e.constructor(n);return e.copy(r),r}var At,jt,Mt,Nt,Pt=e((()=>{o(),At=typeof exports==`object`&&exports&&!exports.nodeType&&exports,jt=At&&typeof module==`object`&&module&&!module.nodeType&&module,Mt=jt&&jt.exports===At?r.Buffer:void 0,Nt=Mt?Mt.allocUnsafe:void 0}));function Ft(e,t){return C(e,se(e),t)}var It=e((()=>{w(),Te()})),Lt,Rt=e((()=>{Fe(),O(),Te(),Pe(),Lt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Oe(t,se(e)),e=D(e);return t}:Ae}));function zt(e,t){return C(e,Lt(e),t)}var Bt=e((()=>{w(),Rt()}));function Vt(e){return Se(e,T,Lt)}var Ht=e((()=>{je(),Rt(),E()}));function Ut(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&Wt.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}var Wt,Gt=e((()=>{Wt=Object.prototype.hasOwnProperty}));function Kt(e){var t=new e.constructor(e.byteLength);return new Me(t).set(new Me(e)),t}var k=e((()=>{ke()}));function qt(e,t){var n=t?Kt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Jt=e((()=>{k()}));function Yt(e){var t=new e.constructor(e.source,Xt.exec(e));return t.lastIndex=e.lastIndex,t}var Xt,Zt=e((()=>{Xt=/\w*$/}));function Qt(e){return j?Object(j.call(e)):{}}var A,j,$t=e((()=>{a(),A=n?n.prototype:void 0,j=A?A.valueOf:void 0}));function en(e,t){var n=t?Kt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var tn=e((()=>{k()}));function nn(e,t,n){var r=e.constructor;switch(t){case fn:return Kt(e);case rn:case an:return new r(+e);case pn:return qt(e,n);case mn:case hn:case gn:case _n:case vn:case yn:case bn:case xn:case Sn:return en(e,n);case on:return new r;case sn:case un:return new r(e);case cn:return Yt(e);case ln:return new r;case dn:return Qt(e)}}var rn,an,on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn=e((()=>{k(),Jt(),Zt(),$t(),tn(),rn=`[object Boolean]`,an=`[object Date]`,on=`[object Map]`,sn=`[object Number]`,cn=`[object RegExp]`,ln=`[object Set]`,un=`[object String]`,dn=`[object Symbol]`,fn=`[object ArrayBuffer]`,pn=`[object DataView]`,mn=`[object Float32Array]`,hn=`[object Float64Array]`,gn=`[object Int8Array]`,_n=`[object Int16Array]`,vn=`[object Int32Array]`,yn=`[object Uint8Array]`,bn=`[object Uint8ClampedArray]`,xn=`[object Uint16Array]`,Sn=`[object Uint32Array]`}));function wn(e){return typeof e.constructor==`function`&&!ve(e)?lt(D(e)):{}}var Tn=e((()=>{ut(),O(),me()}));function En(e){return ae(e)&&g(e)==Dn}var Dn,On=e((()=>{h(),oe(),Dn=`[object Map]`})),M,kn,An=e((()=>{On(),pe(),ye(),M=_&&_.isMap,kn=M?de(M):En}));function jn(e){return ae(e)&&g(e)==Mn}var Mn,Nn=e((()=>{h(),oe(),Mn=`[object Set]`})),N,Pn,Fn=e((()=>{Nn(),pe(),ye(),N=_&&_.isSet,Pn=N?de(N):jn}));function P(e,t,n,r,a,o){var s,c=t&In,l=t&Ln,u=t&Rn;if(n&&(s=a?n(e,r,a,o):n(e)),s!==void 0)return s;if(!i(e))return e;var d=we(e);if(d){if(s=Ut(e),!c)return dt(e,s)}else{var f=g(e),p=f==I||f==Un;if(be(e))return kt(e,c);if(f==L||f==F||p&&!a){if(s=l||p?{}:wn(e),!c)return l?zt(e,Dt(s,e)):Ft(e,Tt(s,e))}else{if(!R[f])return a?e:{};s=nn(e,f,c)}}o||(o=new Ie);var ee=o.get(e);if(ee)return ee;o.set(e,s),Pn(e)?e.forEach(function(r){s.add(P(r,t,n,r,e,o))}):kn(e)&&e.forEach(function(r,i){s.set(i,P(r,t,n,i,e,o))});var te=d?void 0:(u?l?Vt:De:l?T:he)(e);return mt(te||e,function(r,i){te&&(i=r,r=e[i]),vt(s,i,P(r,t,n,i,e,o))}),s}var In,Ln,Rn,F,zn,Bn,Vn,Hn,I,Un,Wn,Gn,L,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,R,cr=e((()=>{Ce(),ht(),S(),Et(),Ot(),Pt(),ft(),It(),Bt(),ce(),Ht(),h(),Gt(),Cn(),Tn(),Ne(),xe(),An(),s(),Fn(),Ee(),E(),In=1,Ln=2,Rn=4,F=`[object Arguments]`,zn=`[object Array]`,Bn=`[object Boolean]`,Vn=`[object Date]`,Hn=`[object Error]`,I=`[object Function]`,Un=`[object GeneratorFunction]`,Wn=`[object Map]`,Gn=`[object Number]`,L=`[object Object]`,Kn=`[object RegExp]`,qn=`[object Set]`,Jn=`[object String]`,Yn=`[object Symbol]`,Xn=`[object WeakMap]`,Zn=`[object ArrayBuffer]`,Qn=`[object DataView]`,$n=`[object Float32Array]`,er=`[object Float64Array]`,tr=`[object Int8Array]`,nr=`[object Int16Array]`,rr=`[object Int32Array]`,ir=`[object Uint8Array]`,ar=`[object Uint8ClampedArray]`,or=`[object Uint16Array]`,sr=`[object Uint32Array]`,R={},R[F]=R[zn]=R[Zn]=R[Qn]=R[Bn]=R[Vn]=R[$n]=R[er]=R[tr]=R[nr]=R[rr]=R[Wn]=R[Gn]=R[L]=R[Kn]=R[qn]=R[Jn]=R[Yn]=R[ir]=R[ar]=R[or]=R[sr]=!0,R[Hn]=R[I]=R[Xn]=!1}));function lr(e){return P(e,ur|dr)}var ur,dr,fr=e((()=>{cr(),ur=1,dr=4}));function pr({writeFn:e,flushIntervalMs:t=1e3,maxBufferSize:n=100,maxBufferBytes:r=1/0,immediateMode:i=!1}){let a=[],o=0,s=null,c=null;function l(){s&&(clearTimeout(s),s=null)}function u(){c&&(e(c.join(``)),c=null),a.length!==0&&(e(a.join(``)),a=[],o=0,l())}function d(){s||(s=setTimeout(u,t))}function f(){if(c){c.push(...a),a=[],o=0,l();return}let t=a;a=[],o=0,l(),c=t,setImmediate(()=>{let t=c;c=null,t&&e(t.join(``))})}return{write(t){if(i){e(t);return}a.push(t),o+=t.length,d(),(a.length>=n||o>=r)&&f()},flush:u,dispose(){u()}}}var mr=e((()=>{}));function hr(e){return z.add(e),()=>z.delete(e)}async function gr(){await Promise.all(Array.from(z).map(e=>e()))}var z,_r=e((()=>{z=new Set}));function vr(e){let t=[],n=e.match(/^MCP server ["']([^"']+)["']/);if(n&&n[1])t.push(`mcp`),t.push(n[1].toLowerCase());else{let n=e.match(/^([^:[]+):/);n&&n[1]&&t.push(n[1].trim().toLowerCase())}let r=e.match(/^\[([^\]]+)]/);r&&r[1]&&t.push(r[1].trim().toLowerCase()),e.toLowerCase().includes(`1p event:`)&&t.push(`1p`);let i=e.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(i&&i[1]){let e=i[1].trim().toLowerCase();e.length<30&&!e.includes(` `)&&t.push(e)}return Array.from(new Set(t))}function yr(e,t){return t?e.length===0?!1:t.isExclusive?!e.some(e=>t.exclude.includes(e)):e.some(e=>t.include.includes(e)):!0}function br(e,t){return t?yr(vr(e),t):!0}var B,xr=e((()=>{f(),B=d(e=>{if(!e||e.trim()===``)return null;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);if(t.length===0)return null;let n=t.some(e=>e.startsWith(`!`)),r=t.some(e=>!e.startsWith(`!`));if(n&&r)return null;let i=t.map(e=>e.replace(/^!/,``).toLowerCase());return{include:n?[]:i,exclude:n?i:[],isExclusive:n}})}));function Sr(e){return e instanceof Nr||e instanceof re||e instanceof Error&&e.name===`AbortError`}function Cr(e,t){return e instanceof Error&&e.message===t}function wr(e){return e instanceof Error?e:Error(String(e))}function Tr(e){return e instanceof Error?e.message:String(e)}function V(e){if(e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`)return e.code}function Er(e){return V(e)===`ENOENT`}function Dr(e){if(e&&typeof e==`object`&&`path`in e&&typeof e.path==`string`)return e.path}function Or(e,t=5){if(!(e instanceof Error))return String(e);if(!e.stack)return e.message;let n=e.stack.split(`
2
+ `),r=n[0]??e.message,i=n.slice(1).filter(e=>e.trim().startsWith(`at `));return i.length<=t?e.stack:[r,...i.slice(0,t)].join(`
3
+ `)}function kr(e){let t=V(e);return t===`ENOENT`||t===`EACCES`||t===`EPERM`||t===`ENOTDIR`||t===`ELOOP`}function Ar(e){let t=Tr(e);if(!e||typeof e!=`object`||!(`isAxiosError`in e)||!e.isAxiosError)return{kind:`other`,message:t};let n=e,r=n.response?.status;return r===401||r===403?{kind:`auth`,status:r,message:t}:n.code===`ECONNABORTED`?{kind:`timeout`,status:r,message:t}:n.code===`ECONNREFUSED`||n.code===`ENOTFOUND`?{kind:`network`,status:r,message:t}:{kind:`http`,status:r,message:t}}var jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr=e((()=>{Ve(),ie(),jr=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},Mr=class extends Error{},Nr=class extends Error{constructor(e){super(e),this.name=`AbortError`}},Pr=class extends Error{constructor(e,t,n){super(e),m(this,`filePath`,void 0),m(this,`defaultConfig`,void 0),this.name=`ConfigParseError`,this.filePath=t,this.defaultConfig=n}},Fr=class extends Error{constructor(e,t,n,r){super(`Shell command failed`),this.stdout=e,this.stderr=t,this.code=n,this.interrupted=r,this.name=`ShellError`}},Ir=class extends Error{constructor(e,t){super(e),this.formattedMessage=t,this.name=`TeleportOperationError`}},Lr=class extends Error{constructor(e,t){super(e),m(this,`telemetryMessage`,void 0),this.name=`TelemetrySafeError`,this.telemetryMessage=t??e}}}));function zr(){return Ur}function Br(e,t,n){return H`JSON.stringify(${e})`,JSON.stringify(e,t,n)}function Vr(e,t){return H`structuredClone(${e})`,structuredClone(e,t)}function Hr(e,t,n){if(H`fs.writeFileSync(${e}, ${t})`,typeof n==`object`&&n&&`flush`in n&&n.flush===!0){let r=typeof n==`object`&&`encoding`in n?n.encoding:void 0,i=typeof n==`object`&&`mode`in n?n.mode:void 0,a;try{a=Xe(e,`w`,i),Ze(a,t,{encoding:r??void 0}),Ye(a)}finally{a!==void 0&&Je(a)}}else Ze(e,t,n)}var Ur,H,Wr,Gr=e((()=>{Re(),_i(),(()=>{let e=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(e!==void 0){let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t}return process.env.USER_TYPE===`ant`?300:1/0})(),Ur={[Symbol.dispose](){}},H=zr,Wr=(e,t)=>(H`JSON.parse(${e})`,t===void 0?JSON.parse(e):JSON.parse(e,t))}));function Kr(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}var qr=e((()=>{}));function Jr(e,t){if(t.startsWith(`//`)||t.startsWith(`\\\\`))return{resolvedPath:t,isSymlink:!1,isCanonical:!1};try{let n=e.lstatSync(t);if(n.isFIFO()||n.isSocket()||n.isCharacterDevice()||n.isBlockDevice())return{resolvedPath:t,isSymlink:!1,isCanonical:!1};let r=e.realpathSync(t);return{resolvedPath:r,isSymlink:r!==t,isCanonical:!0}}catch{return{resolvedPath:t,isSymlink:!1,isCanonical:!1}}}function Yr(e,t,n){let{resolvedPath:r}=Jr(e,t);return n.has(r)?!0:(n.add(r),!1)}function Xr(e,t){let n=t,r=[];for(;n!==v.dirname(n);){let t;try{t=e.lstatSync(n)}catch{r.unshift(v.basename(n)),n=v.dirname(n);continue}if(t.isSymbolicLink())try{let t=e.realpathSync(n);return r.length===0?t:v.join(t,...r)}catch{let t=e.readlinkSync(n),i=v.isAbsolute(t)?t:v.resolve(v.dirname(n),t);return r.length===0?i:v.join(i,...r)}try{let t=e.realpathSync(n);if(t!==n)return r.length===0?t:v.join(t,...r)}catch{}return}}function Zr(e){let t=e;t===`~`?t=We().normalize(`NFC`):t.startsWith(`~/`)&&(t=v.join(We().normalize(`NFC`),t.slice(2)));let n=new Set,r=U();if(n.add(t),t.startsWith(`//`)||t.startsWith(`\\\\`))return Array.from(n);try{let e=t,i=new Set;for(let a=0;a<40&&!i.has(e);a++){if(i.add(e),!r.existsSync(e)){if(e===t){let e=Xr(r,t);e!==void 0&&n.add(e)}break}let a=r.lstatSync(e);if(a.isFIFO()||a.isSocket()||a.isCharacterDevice()||a.isBlockDevice()||!a.isSymbolicLink())break;let o=r.readlinkSync(e),s=v.isAbsolute(o)?o:v.resolve(v.dirname(e),o);n.add(s),e=s}}catch{}let{resolvedPath:i,isSymlink:a}=Jr(r,t);return a&&i!==t&&n.add(i),Array.from(n)}function U(){return ni}async function Qr(e,t,n){try{var r=Kr();let i=r.a(await b(e,`r`)),a=(await i.stat()).size;if(a<=t)return null;let o=Math.min(a-t,n),s=Buffer.allocUnsafe(o),c=0;for(;c<o;){let{bytesRead:e}=await i.read(s,c,o-c,t+c);if(e===0)break;c+=e}return{content:s.toString(`utf8`,0,c),bytesRead:c,bytesTotal:a}}catch(e){r.e=e}finally{await r.d()}}async function $r(e,t){try{var n=Kr();let r=n.a(await b(e,`r`)),i=(await r.stat()).size;if(i===0)return{content:``,bytesRead:0,bytesTotal:0};let a=Math.max(0,i-t),o=i-a,s=Buffer.allocUnsafe(o),c=0;for(;c<o;){let{bytesRead:e}=await r.read(s,c,o-c,a+c);if(e===0)break;c+=e}return{content:s.toString(`utf8`,0,c),bytesRead:c,bytesTotal:i}}catch(e){n.e=e}finally{await n.d()}}async function*ei(e){let t=1024*4,n=await b(e,`r`);try{let e=(await n.stat()).size,r=Buffer.alloc(0),i=Buffer.alloc(t);for(;e>0;){let a=Math.min(t,e);e-=a,await n.read(i,0,a,e);let o=Buffer.concat([i.subarray(0,a),r]),s=o.indexOf(10);if(s===-1){r=o;continue}r=Buffer.from(o.subarray(0,s));let c=o.toString(`utf8`,s+1).split(`
4
+ `);for(let e=c.length-1;e>=0;e--){let t=c[e];t&&(yield t)}}r.length>0&&(yield r.toString(`utf8`))}finally{await n.close()}}var ti,ni,ri=e((()=>{Rr(),Gr(),qr(),ti={cwd(){return process.cwd()},existsSync(e){return H`fs.existsSync(${e})`,y.existsSync(e)},async stat(e){return at(e)},async readdir(e){return tt(e,{withFileTypes:!0})},async unlink(e){return st(e)},async rmdir(e){return it(e)},async rm(e,t){return rt(e,t)},async mkdir(e,t){try{await $e(e,{recursive:!0,...t})}catch(e){if(V(e)!==`EEXIST`)throw e}},async readFile(e,t){return et(e,{encoding:t.encoding})},async rename(e,t){return nt(e,t)},statSync(e){return H`fs.statSync(${e})`,y.statSync(e)},lstatSync(e){return H`fs.lstatSync(${e})`,y.lstatSync(e)},readFileSync(e,t){return H`fs.readFileSync(${e})`,y.readFileSync(e,{encoding:t.encoding})},readFileBytesSync(e){return H`fs.readFileBytesSync(${e})`,y.readFileSync(e)},readSync(e,t){H`fs.readSync(${e}, ${t.length} bytes)`;let n;try{n=y.openSync(e,`r`);let r=Buffer.alloc(t.length);return{buffer:r,bytesRead:y.readSync(n,r,0,t.length,0)}}finally{n&&y.closeSync(n)}},appendFileSync(e,t,n){if(H`fs.appendFileSync(${e}, ${t.length} chars)`,n?.mode!==void 0)try{let r=y.openSync(e,`ax`,n.mode);try{y.appendFileSync(r,t)}finally{y.closeSync(r)}return}catch(e){if(V(e)!==`EEXIST`)throw e}y.appendFileSync(e,t)},copyFileSync(e,t){H`fs.copyFileSync(${e} → ${t})`,y.copyFileSync(e,t)},unlinkSync(e){H`fs.unlinkSync(${e})`,y.unlinkSync(e)},renameSync(e,t){H`fs.renameSync(${e} → ${t})`,y.renameSync(e,t)},linkSync(e,t){H`fs.linkSync(${e} → ${t})`,y.linkSync(e,t)},symlinkSync(e,t,n){H`fs.symlinkSync(${e} → ${t})`,y.symlinkSync(e,t,n)},readlinkSync(e){return H`fs.readlinkSync(${e})`,y.readlinkSync(e)},realpathSync(e){return H`fs.realpathSync(${e})`,y.realpathSync(e).normalize(`NFC`)},mkdirSync(e,t){H`fs.mkdirSync(${e})`;let n={recursive:!0};t?.mode!==void 0&&(n.mode=t.mode);try{y.mkdirSync(e,n)}catch(e){if(V(e)!==`EEXIST`)throw e}},readdirSync(e){return H`fs.readdirSync(${e})`,y.readdirSync(e,{withFileTypes:!0})},readdirStringSync(e){return H`fs.readdirStringSync(${e})`,y.readdirSync(e)},isDirEmptySync(e){return H`fs.isDirEmptySync(${e})`,this.readdirSync(e).length===0},rmdirSync(e){H`fs.rmdirSync(${e})`,y.rmdirSync(e)},rmSync(e,t){H`fs.rmSync(${e})`,y.rmSync(e,t)},createWriteStream(e){return y.createWriteStream(e)},async readFileBytes(e,t){if(t===void 0)return et(e);let n=await b(e,`r`);try{let{size:e}=await n.stat(),r=Math.min(e,t),i=Buffer.allocUnsafe(r),a=0;for(;a<r;){let{bytesRead:e}=await n.read(i,a,r-a,a);if(e===0)break;a+=e}return a<r?i.subarray(0,a):i}finally{await n.close()}}},ni=ti})),ii=t({enableDebugLogging:()=>ai,flushDebugLogs:()=>fi,getDebugFilePath:()=>X,getDebugFilter:()=>J,getDebugLogPath:()=>W,getHasFormattedOutput:()=>ci,getMinDebugLogLevel:()=>K,isDebugMode:()=>q,isDebugToStdErr:()=>Y,logAntError:()=>mi,logForDebugging:()=>pi,setHasFormattedOutput:()=>si});function ai(){let e=q()||process.env.USER_TYPE===`ant`;return hi=!0,q.cache.clear?.(),e}function oi(e){return process.env.USER_TYPE!==`ant`&&!q()||typeof process>`u`||process.versions===void 0||process.versions.node===void 0?!1:br(e,J())}function si(e){Z=e}function ci(){return Z}async function li(e,t,n,r){e&&await $e(t,{recursive:!0}).catch(()=>{}),await Qe(n,r),gi()}function ui(){}function di(){if(!Q){let e=null;Q=pr({writeFn:t=>{let n=W(),r=Ge(n),i=e!==r;if(e=r,q()){if(i)try{U().mkdirSync(r)}catch{}try{U().appendFileSync(n,t)}catch{try{U().mkdirSync(r),U().appendFileSync(n,t)}catch{}}gi();return}$=$.then(li.bind(null,i,r,n,t)).catch(ui)},flushIntervalMs:1e3,maxBufferSize:100,immediateMode:q()}),hr(async()=>{Q?.dispose(),await $})}return Q}async function fi(){Q?.flush(),await $}function pi(e,{level:t}={level:`debug`}){if(G[t]<G[K()]||!oi(e))return;Z&&e.includes(`
5
+ `)&&(e=Br(e));let n=`${new Date().toISOString()} [${t.toUpperCase()}] ${e.trim()}\n`;if(Y()){Ue(n);return}di().write(n)}function W(){return X()??(process.env.CLAUDE_CODE_DEBUG_LOGS_DIR?qe(process.env.CLAUDE_CODE_DEBUG_LOGS_DIR):null)??Ke(ee(),`debug`,`${Be()}.txt`)}function mi(e,t){process.env.USER_TYPE===`ant`&&t instanceof Error&&t.stack&&pi(`[ANT-ONLY] ${e} stack trace:\n${t.stack}`,{level:`error`})}var G,K,hi,q,J,Y,X,Z,Q,$,gi,_i=e((()=>{f(),ze(),mr(),_r(),xr(),te(),ri(),He(),Gr(),G={verbose:0,debug:1,info:2,warn:3,error:4},K=d(()=>{let e=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return e&&Object.hasOwn(G,e)?e:`debug`}),hi=!1,q=d(()=>hi||ne(process.env.DEBUG)||ne(process.env.DEBUG_SDK)||process.argv.includes(`--debug`)||process.argv.includes(`-d`)||Y()||process.argv.some(e=>e.startsWith(`--debug=`))||X()!==null),J=d(()=>{let e=process.argv.find(e=>e.startsWith(`--debug=`));return e?B(e.substring(8)):null}),Y=d(()=>process.argv.includes(`--debug-to-stderr`)),X=d(()=>{for(let e=0;e<process.argv.length;e++){let t=process.argv[e];if(t.startsWith(`--debug-file=`))return qe(t.substring(13));if(t===`--debug-file`&&e+1<process.argv.length)return qe(process.argv[e+1])}return null}),Z=!1,Q=null,$=Promise.resolve(),gi=d(async()=>{try{let e=W(),t=Ke(Ge(e),`latest`);await st(t).catch(()=>{}),await ot(e,t)}catch{}})}));export{hr as $,Hr as A,V as B,Kr as C,gt as Ct,Wr as D,dt as Dt,Gr as E,pt as Et,Fr as F,Er as G,Cr as H,Lr as I,wr as J,kr as K,Ir as L,jr as M,Pr as N,Br as O,ft as Ot,Mr as P,_r as Q,Ar as R,$r as S,S as St,Vr as T,x as Tt,Rr as U,Dr as V,Sr as W,B as X,xr as Y,br as Z,ri as _,E as _t,J as a,P as at,ei as b,w as bt,K as c,Tn as ct,Y as d,Vt as dt,gr as et,mi as f,Ht as ft,Zr as g,O as gt,U as h,D as ht,X as i,fr as it,Nr as j,H as k,_i as l,en as lt,si as m,Pt as mt,ai as n,mr as nt,W as o,cr as ot,pi as p,kt as pt,Or as q,fi as r,lr as rt,ci as s,wn as st,ii as t,pr as tt,q as u,tn as ut,Yr as v,T as vt,qr as w,_t as wt,Jr as x,vt as xt,Qr as y,C as yt,Tr as z};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{E as n,O as r,U as i,l as a,p as o,z as s}from"./debug-CjIaNjpK.js";import{n as c,r as l}from"./analytics-i6X1et4O.js";var u=t({setCseShimGate:()=>d,toCompatSessionId:()=>f,toInfraSessionId:()=>p});function d(e){m=e}function f(e){return!e.startsWith(`cse_`)||m&&!m()?e:`session_`+e.slice(4)}function p(e){return e.startsWith(`session_`)?`cse_`+e.slice(8):e}var m,h=e((()=>{}));function g(e){return e.replace(w,(e,t,n)=>n.length<T?`"${t}":"[REDACTED]"`:`"${t}":"${`${n.slice(0,8)}...${n.slice(-4)}`}"`)}function _(e){let t=e.replace(/\n/g,`\\n`);return t.length<=C?t:t.slice(0,C)+`... (${t.length} chars)`}function v(e){let t=g(typeof e==`string`?e:r(e));return t.length<=C?t:t.slice(0,C)+`... (${t.length} chars)`}function y(e){let t=s(e);if(e&&typeof e==`object`&&`response`in e){let n=e.response;if(n?.data&&typeof n.data==`object`){let e=n.data,r=typeof e.message==`string`?e.message:typeof e.error==`object`&&e.error&&`message`in e.error&&typeof e.error.message==`string`?e.error.message:void 0;if(r)return`${t}: ${r}`}}return t}function b(e){if(e&&typeof e==`object`&&`response`in e&&e.response&&typeof e.response.status==`number`)return e.response.status}function x(e){if(!(!e||typeof e!=`object`)){if(`message`in e&&typeof e.message==`string`)return e.message;if(`error`in e&&e.error!==null&&typeof e.error==`object`&&`message`in e.error&&typeof e.error.message==`string`)return e.error.message}}function S(e,t,n){t&&o(t),l(`tengu_bridge_repl_skipped`,{reason:e,...n!==void 0&&{v2:n}})}var C,w,T,E=e((()=>{c(),a(),i(),n(),C=2e3,w=RegExp(`"(${[`session_ingress_token`,`environment_secret`,`access_token`,`secret`,`token`].join(`|`)})"\\s*:\\s*"([^"]*)"`,`g`),T=16}));export{b as a,h as c,f as d,p as f,x as i,u as l,_ as n,E as o,y as r,S as s,v as t,d as u};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";function t(e){"@babel/helpers - typeof";return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}var n=e((()=>{}));function r(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}var i=e((()=>{n()}));function a(e){var n=r(e,`string`);return t(n)==`symbol`?n:n+``}var o=e((()=>{n(),i()}));function s(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=e((()=>{o()}));export{n as i,c as n,t as r,s as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-DNHWYkls.js";import{t as n}from"./jsx-runtime-BTgGEFjL.js";import{n as r,t as i}from"./DesktopHandoff-5c90JK88.js";async function a(e){return(0,o.jsx)(i,{onDone:e})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
@@ -0,0 +1,5 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./defineProperty-CaCI0a5T.js";import{i as r,o as i,t as a}from"./cliLaunch-CMXoY_LO.js";import{dirname as o}from"path";import{closeSync as s,createReadStream as c,mkdirSync as l,openSync as u,readSync as d,statSync as f,unwatchFile as p,watchFile as m}from"fs";import{createInterface as h}from"readline";async function g(e){let t=0;try{if(t=f(e).size,t>0){let n=h({input:c(e,{start:0,end:t-1})});for await(let e of n)process.stdout.write(e+`
2
+ `)}}catch{}return console.log(`
3
+ [tail] Watching for new output... (Ctrl+C to detach)
4
+ `),new Promise(n=>{let r=()=>{p(e),process.removeListener(`SIGINT`,r),console.log(`
5
+ [tail] Detached from session.`),n()};process.on(`SIGINT`,r),m(e,{interval:300},()=>{try{let n=f(e);if(n.size<=t)return;let r=u(e,`r`);try{let e=Buffer.alloc(n.size-t);d(r,e,0,e.length,t),process.stdout.write(e),t=n.size}finally{s(r)}}catch{}})})}var _=e((()=>{})),v;e((()=>{r(),_(),t(),v=class{constructor(){n(this,`name`,`detached`),n(this,`supportsInteractiveInput`,!1)}async available(){return!0}async start(e){l(o(e.logPath),{recursive:!0});let t=u(e.logPath,`a`),n=i(a(e.args,{env:{...e.env,CLAUDE_CODE_SESSION_KIND:`bg`,CLAUDE_CODE_SESSION_NAME:e.sessionName,CLAUDE_CODE_SESSION_LOG:e.logPath}}),{detached:!0,stdio:[`ignore`,t,t],cwd:e.cwd});return n.unref(),s(t),{pid:n.pid??0,sessionName:e.sessionName,logPath:e.logPath,engineUsed:`detached`}}async attach(e){if(!e.logPath)throw Error(`Session ${e.sessionId} has no log path.`);await g(e.logPath)}}}))();export{v as DetachedEngine};
@@ -0,0 +1 @@
1
+ import{i as e,t}from"./chunk-DR8-3Aex.js";var n=t(((e,t)=>{var n=()=>process.platform===`linux`,r=null;t.exports={isLinux:n,getReport:()=>{if(!r)if(n()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,r=process.report.getReport(),process.report.excludeNetwork=e}else r={};return r}}})),r=t(((t,n)=>{var r=e(`fs`),i=`/usr/bin/ldd`,a=`/proc/self/exe`,o=2048;n.exports={LDD_PATH:i,SELF_PATH:a,readFileSync:e=>{let t=r.openSync(e,`r`),n=Buffer.alloc(o),i=r.readSync(t,n,0,o,0);return r.close(t,()=>{}),n.subarray(0,i)},readFile:e=>new Promise((t,n)=>{r.open(e,`r`,(e,i)=>{if(e)n(e);else{let e=Buffer.alloc(o);r.read(i,e,0,o,0,(n,a)=>{t(e.subarray(0,a)),r.close(i,()=>{})})}})})}})),i=t(((e,t)=>{t.exports={interpreterPath:e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),n=e.readUInt16LE(54),r=e.readUInt16LE(56);for(let i=0;i<r;i++){let r=t+i*n;if(e.readUInt32LE(r)===3){let t=e.readUInt32LE(r+8),n=e.readUInt32LE(r+32);return e.subarray(t,t+n).toString().replace(/\0.*$/g,``)}}return null}}})),a=t(((t,a)=>{var o=e(`child_process`),{isLinux:s,getReport:c}=n(),{LDD_PATH:l,SELF_PATH:u,readFile:d,readFileSync:f}=r(),{interpreterPath:p}=i(),m,h,g,_=`getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true`,v=``,y=()=>v||new Promise(e=>{o.exec(_,(t,n)=>{v=t?` `:n,e(v)})}),b=()=>{if(!v)try{v=o.execSync(_,{encoding:`utf8`})}catch{v=` `}return v},x=`glibc`,S=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,C=`musl`,w=e=>e.includes(`libc.musl-`)||e.includes(`ld-musl-`),T=()=>{let e=c();return e.header&&e.header.glibcVersionRuntime?x:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(w)?C:null},E=e=>{let[t,n]=e.split(/[\r\n]+/);return t&&t.includes(x)?x:n&&n.includes(C)?C:null},D=e=>{if(e){if(e.includes(`/ld-musl-`))return C;if(e.includes(`/ld-linux-`))return x}return null},O=e=>(e=e.toString(),e.includes(`musl`)?C:e.includes(`GNU C Library`)?x:null),k=async()=>{if(h!==void 0)return h;h=null;try{h=O(await d(l))}catch{}return h},A=()=>{if(h!==void 0)return h;h=null;try{h=O(f(l))}catch{}return h},j=async()=>{if(m!==void 0)return m;m=null;try{m=D(p(await d(u)))}catch{}return m},M=()=>{if(m!==void 0)return m;m=null;try{m=D(p(f(u)))}catch{}return m},N=async()=>{let e=null;return s()&&(e=await j(),e||(e=await k(),e||(e=T()),e||(e=E(await y())))),e},P=()=>{let e=null;return s()&&(e=M(),e||(e=A(),e||(e=T()),e||(e=E(b())))),e},F=async()=>s()&&await N()!==x,I=()=>s()&&P()!==x,L=async()=>{if(g!==void 0)return g;g=null;try{let e=(await d(l)).match(S);e&&(g=e[1])}catch{}return g},R=()=>{if(g!==void 0)return g;g=null;try{let e=f(l).match(S);e&&(g=e[1])}catch{}return g},z=()=>{let e=c();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},B=e=>e.trim().split(/\s+/)[1],V=e=>{let[t,n,r]=e.split(/[\r\n]+/);return t&&t.includes(x)?B(t):n&&r&&n.includes(C)?B(r):null};a.exports={GLIBC:x,MUSL:C,family:N,familySync:P,isNonGlibcLinux:F,isNonGlibcLinuxSync:I,version:async()=>{let e=null;return s()&&(e=await L(),e||(e=z()),e||(e=V(await y()))),e},versionSync:()=>{let e=null;return s()&&(e=R(),e||(e=z()),e||(e=V(b()))),e}}}));export{a as t};
@@ -0,0 +1 @@
1
+ import{a as e,o as t,s as n}from"./detectRepository-Gobn9eFt.js";e();export{t as parseGitHubRepository,n as parseGitRemote};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{l as t,p as n}from"./debug-CjIaNjpK.js";import{n as r,t as i}from"./cwd-B2guYBbl.js";import{m as a,v as o}from"./git-Bj8Ow4pJ.js";function s(){m.clear()}async function c(){let e=await l();return!e||e.host!==`github.com`?null:`${e.owner}/${e.name}`}async function l(){let e=i();if(m.has(e))return m.get(e)??null;try{let t=await a();if(n(`Git remote URL: ${t}`),!t)return n(`No git remote URL found`),m.set(e,null),null;let r=d(t);return n(`Parsed repository: ${r?`${r.host}/${r.owner}/${r.name}`:null} from URL: ${t}`),m.set(e,r),r}catch(t){return n(`Error detecting repository: ${t}`),m.set(e,null),null}}function u(){let e=m.get(i());return!e||e.host!==`github.com`?null:`${e.owner}/${e.name}`}function d(e){let t=e.trim(),n=t.match(/^git@([^:]+):([^/]+)\/([^/]+?)(?:\.git)?$/);if(n?.[1]&&n[2]&&n[3])return p(n[1])?{host:n[1],owner:n[2],name:n[3]}:null;let r=t.match(/^(https?|ssh|git):\/\/(?:[^@]+@)?([^/:]+(?::\d+)?)\/([^/]+)\/([^/]+?)(?:\.git)?$/);if(r?.[1]&&r[2]&&r[3]&&r[4]){let e=r[1],t=r[2],n=t.split(`:`)[0]??``;return p(n)?{host:e===`https`||e===`http`?t:n,owner:r[3],name:r[4]}:null}return null}function f(e){let t=e.trim(),r=d(t);if(r)return r.host===`github.com`?`${r.owner}/${r.name}`:null;if(!t.includes(`://`)&&!t.includes(`@`)&&t.includes(`/`)){let e=t.split(`/`);if(e.length===2&&e[0]&&e[1]){let t=e[1].replace(/\.git$/,``);return`${e[0]}/${t}`}}return n(`Could not parse repository from: ${t}`),null}function p(e){if(!e.includes(`.`))return!1;let t=e.split(`.`).pop();return t?/^[a-zA-Z]+$/.test(t):!1}var m,h=e((()=>{r(),t(),o(),m=new Map}));export{h as a,u as i,c as n,f as o,l as r,d as s,s as t};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,d as n,i as r,l as i,n as a,o,r as s,s as c,t as l,u}from"./detection-DW6grIlc.js";s();export{l as IT2_COMMAND,a as getLeaderPaneId,r as isInITerm2,e as isInWindowsTerminal,o as isInsideTmux,c as isInsideTmuxSync,t as isIt2CliAvailable,i as isTmuxAvailable,u as isWindowsTerminalAvailable,n as resetDetectionCache};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{r as t,t as n}from"./execFileNoThrow-DdmR1mBS.js";import{a as r,n as i}from"./env-CesrOJJq.js";import{c as a,o}from"./constants-BfXy-5cI.js";function s(){return!!g}async function c(){return v===null&&(v=!!g),v}function l(){return _||null}async function u(){return(await n(o,[`-V`])).code===0}async function d(){return process.env.WT_SESSION?!0:(await n(`where.exe`,[`wt.exe`])).code===0}function f(){if(y!==null)return y;let e=process.env.TERM_PROGRAM,t=!!process.env.ITERM_SESSION_ID,n=i.terminal===`iTerm.app`;return y=e===`iTerm.app`||t||n,y}function p(){return b===null&&(b=!!process.env.WT_SESSION),b}async function m(){return(await n(`it2`,[`session`,`list`])).code===0}function h(){v=null,y=null,b=null}var g,_,v,y,b,x,S=e((()=>{r(),t(),a(),g=process.env.TMUX,_=process.env.TMUX_PANE,v=null,y=null,b=null,x=`it2`}));export{p as a,m as c,h as d,f as i,u as l,l as n,c as o,S as r,s,x as t,d as u};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-BTgGEFjL.js";var n,r;e((()=>{n=t(),r=async(e,t)=>{let{DiffDialog:r}=await import(`./DiffDialog-BU765aqh.js`);return(0,n.jsx)(r,{messages:t.messages,onDone:e})}}))();export{r as call};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./index.min-DCDiLq-j.js";import{n as r,r as i}from"./log-B-Nj3Yed.js";import{AA as a,Xy as o,Yy as s,kA as c}from"./loadAgentsDir-Bz0FfcVt.js";import{n as l,t as u}from"./cwd-BXiaJzLh.js";import{basename as d,dirname as f,join as p,sep as m}from"path";function h(e,t){if(!e)return{directory:t||u(),prefix:``};let n=c(e,t);return e.endsWith(`/`)||e.endsWith(m)?{directory:n,prefix:``}:{directory:f(n),prefix:d(e)}}async function g(e){let t=C.get(e);if(t)return t;try{let t=(await s().readdir(e)).filter(e=>e.isDirectory()&&!e.name.startsWith(`.`)).map(t=>({name:t.name,path:p(e,t.name),type:`directory`})).slice(0,100);return C.set(e,t),t}catch(e){return i(e),[]}}async function _(e,t={}){let{basePath:n=u(),maxResults:r=10}=t,{directory:i,prefix:a}=h(e,n),o=await g(i),s=a.toLowerCase();return o.filter(e=>e.name.toLowerCase().startsWith(s)).slice(0,r).map(e=>({id:e.path,displayText:e.name+`/`,description:`directory`,metadata:{type:`directory`}}))}function v(e){return e.startsWith(`~/`)||e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`)||e===`~`||e===`.`||e===`..`}async function y(e,t=!1){let n=`${e}:${t}`,r=w.get(n);if(r)return r;try{let r=(await s().readdir(e)).filter(e=>t||!e.name.startsWith(`.`)).map(t=>({name:t.name,path:p(e,t.name),type:t.isDirectory()?`directory`:`file`})).sort((e,t)=>e.type===`directory`&&t.type!==`directory`?-1:e.type!==`directory`&&t.type===`directory`?1:e.name.localeCompare(t.name)).slice(0,100);return w.set(n,r),r}catch(e){return i(e),[]}}async function b(e,t={}){let{basePath:n=u(),maxResults:r=10,includeFiles:i=!0,includeHidden:a=!1}=t,{directory:o,prefix:s}=h(e,n),c=await y(o,a),l=s.toLowerCase(),d=c.filter(e=>!i&&e.type===`file`?!1:e.name.toLowerCase().startsWith(l)).slice(0,r),f=e.includes(`/`)||e.includes(m),p=``;if(f){let t=e.lastIndexOf(`/`),n=e.lastIndexOf(m),r=Math.max(t,n);p=e.substring(0,r+1)}return(p.startsWith(`./`)||p.startsWith(`.`+m))&&(p=p.slice(2)),d.map(e=>{let t=p+e.name;return{id:t,displayText:e.type===`directory`?t+`/`:t,metadata:{type:e.type}}})}var x,S,C,w,T=e((()=>{t(),l(),o(),r(),a(),x=500,S=300*1e3,C=new n({max:x,ttl:S}),w=new n({max:x,ttl:S})}));export{v as i,b as n,T as r,_ as t};