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{b as t,d as n,r,u as i}from"./client-BWED8Tbu.js";var a=e((()=>{r(),n(),i(),t()}));export{a as t};
@@ -0,0 +1 @@
1
+ var e=()=>{};export{e as startSdkMemoryMonitor};
@@ -0,0 +1 @@
1
+ import{rd as e,td as t}from"./loadAgentsDir-Bz0FfcVt.js";t();export{e as isSearchExtraToolsEnabled};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-DR8-3Aex.js";import{_ as t,a as n,c as r,d as i,f as a,g as o,h as s,i as c,l,m as u,n as d,o as f,p,r as m,s as h,t as g,u as _}from"./satisfies-B7ZvBUQP.js";var v=e(((e,t)=>{var n=p();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),y=e(((e,t)=>{var n=p();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),b=e(((e,t)=>{var n=u();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),x=e(((e,t)=>{var n=p();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),S=e(((e,t)=>{var n=u();t.exports=(e,t)=>new n(e,t).major})),C=e(((e,t)=>{var n=u();t.exports=(e,t)=>new n(e,t).minor})),w=e(((e,t)=>{var n=u();t.exports=(e,t)=>new n(e,t).patch})),T=e(((e,t)=>{var n=p();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),E=e(((e,t)=>{var n=a();t.exports=(e,t,r)=>n(t,e,r)})),D=e(((e,t)=>{var n=a();t.exports=(e,t)=>n(e,t,!0)})),O=e(((e,t)=>{var n=u();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),k=e(((e,t)=>{var n=O();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),A=e(((e,t)=>{var n=O();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),j=e(((e,t)=>{var n=m();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),M=e(((e,t)=>{var n=u(),r=m();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),N=e(((e,t)=>{var n=u(),r=m();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),P=e(((e,t)=>{var n=u(),r=m(),a=i();t.exports=(e,t)=>{e=new r(e,t);let i=new n(`0.0.0`);if(e.test(i)||(i=new n(`0.0.0-0`),e.test(i)))return i;i=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||a(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!i||a(i,o))&&(i=o)}return i&&e.test(i)?i:null}})),F=e(((e,t)=>{var n=m();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),I=e(((e,t)=>{var n=u(),r=d(),{ANY:a}=r,o=m(),s=g(),c=i(),l=_(),p=f(),v=h();t.exports=(e,t,i,u)=>{e=new n(e,u),t=new o(t,u);let d,f,m,h,g;switch(i){case`>`:d=c,f=p,m=l,h=`>`,g=`>=`;break;case`<`:d=l,f=v,m=c,h=`<`,g=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(s(e,t,u))return!1;for(let n=0;n<t.set.length;++n){let i=t.set[n],o=null,s=null;if(i.forEach(e=>{e.semver===a&&(e=new r(`>=0.0.0`)),o=o||e,s=s||e,d(e.semver,o.semver,u)?o=e:m(e.semver,s.semver,u)&&(s=e)}),o.operator===h||o.operator===g||(!s.operator||s.operator===h)&&f(e,s.semver)||s.operator===g&&m(e,s.semver))return!1}return!0}})),L=e(((e,t)=>{var n=I();t.exports=(e,t,r)=>n(e,t,`>`,r)})),R=e(((e,t)=>{var n=I();t.exports=(e,t,r)=>n(e,t,`<`,r)})),z=e(((e,t)=>{var n=m();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),B=e(((e,t)=>{var n=g(),r=a();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||(o=e)):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),V=e(((e,t)=>{var n=m(),r=d(),{ANY:i}=r,o=g(),s=a(),c=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=f(n,e,r);if(i=i||t!==null,t)continue OUTER}if(i)return!1}return!0},l=[new r(`>=0.0.0-0`)],u=[new r(`>=0.0.0`)],f=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?l:u}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=u}let r=new Set,a,c;for(let t of e)t.operator===`>`||t.operator===`>=`?a=p(a,t,n):t.operator===`<`||t.operator===`<=`?c=h(c,t,n):r.add(t.semver);if(r.size>1)return null;let d;if(a&&c&&(d=s(a.semver,c.semver,n),d>0||d===0&&(a.operator!==`>=`||c.operator!==`<=`)))return null;for(let e of r){if(a&&!o(e,String(a),n)||c&&!o(e,String(c),n))return null;for(let r of t)if(!o(e,String(r),n))return!1;return!0}let f,m,g,_,v=c&&!n.includePrerelease&&c.semver.prerelease.length?c.semver:!1,y=a&&!n.includePrerelease&&a.semver.prerelease.length?a.semver:!1;v&&v.prerelease.length===1&&c.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,a){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(f=p(a,e,n),f===e&&f!==a)return!1}else if(a.operator===`>=`&&!o(a.semver,String(e),n))return!1}if(c){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(m=h(c,e,n),m===e&&m!==c)return!1}else if(c.operator===`<=`&&!o(c.semver,String(e),n))return!1}if(!e.operator&&(c||a)&&d!==0)return!1}return!(a&&g&&!c&&d!==0||c&&_&&!a&&d!==0||y||v)},p=(e,t,n)=>{if(!e)return t;let r=s(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},h=(e,t,n)=>{if(!e)return t;let r=s(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=c})),H=e(((e,H)=>{var U=o(),W=t(),G=u(),K=s();H.exports={parse:p(),valid:v(),clean:y(),inc:b(),diff:x(),major:S(),minor:C(),patch:w(),prerelease:T(),compare:a(),rcompare:E(),compareLoose:D(),compareBuild:O(),sort:k(),rsort:A(),gt:i(),lt:_(),eq:l(),neq:r(),gte:h(),lte:f(),cmp:n(),coerce:c(),Comparator:d(),Range:m(),satisfies:g(),toComparators:j(),maxSatisfying:M(),minSatisfying:N(),minVersion:P(),validRange:F(),outside:I(),gtr:L(),ltr:R(),intersects:z(),simplifyRange:B(),subset:V(),SemVer:G,re:U.re,src:U.src,tokens:U.t,SEMVER_SPEC_VERSION:W.SEMVER_SPEC_VERSION,RELEASE_TYPES:W.RELEASE_TYPES,compareIdentifiers:K.compareIdentifiers,rcompareIdentifiers:K.rcompareIdentifiers}}));export{H as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./semver-BsItM2Z4.js";function n(){return o||(o=t()),o}function r(e,t){return typeof Bun<`u`?Bun.semver.order(e,t)===1:n().gt(e,t,{loose:!0})}function i(e,t){return typeof Bun<`u`?Bun.semver.order(e,t)>=0:n().gte(e,t,{loose:!0})}function a(e,t){return typeof Bun<`u`?Bun.semver.order(e,t)===-1:n().lt(e,t,{loose:!0})}var o,s=e((()=>{}));export{a as i,i as n,s as r,r as t};
@@ -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{a as r,i,n as a,r as o,t as s}from"./esm-WONEiurY.js";function c(){if(d)return;let e=process.env.SENTRY_DSN;if(!e){n(`[sentry] SENTRY_DSN not set, skipping initialization`);return}a({dsn:e,release:typeof MACRO<`u`?`2.8.4`:void 0,environment:typeof BUILD_ENV<`u`?BUILD_ENV:`production`,maxBreadcrumbs:20,sampleRate:1,beforeSend(e){let t=e.request;if(t?.headers){let e=[`authorization`,`x-api-key`,`cookie`,`set-cookie`];for(let n of Object.keys(t.headers))e.includes(n.toLowerCase())&&delete t.headers[n]}return e},ignoreErrors:[`ECONNREFUSED`,`ECONNRESET`,`ENOTFOUND`,`ETIMEDOUT`,`AbortError`,`The user aborted a request`,`CancelError`],beforeSendTransaction(e){return null}}),d=!0,n(`[sentry] Initialized successfully`)}function l(e,t){if(d)try{r(n=>{t&&n.setExtras(t),o(e)})}catch{}}async function u(e=2e3){if(d)try{await i(e),n(`[sentry] Closed successfully`)}catch{}}var d,f=e((()=>{s(),t(),d=!1}));export{f as i,u as n,c as r,l as t};
@@ -0,0 +1 @@
1
+ var e=()=>({stop(){}});export{e as startServer};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,t as n}from"./chunk-DR8-3Aex.js";import{Ar as r,Cn as i,Ei as a,It as o,Ln as s,Mn as c,Tn as l,Tt as u,Xn as d,Yn as f,dn as p,kn as m,kt as h,nn as ee,un as g,vt as _,wn as v,wr as te,xt as ne,zt as re}from"./schemas-Bwt-7U5W.js";import{t as ie}from"./v4-DLhvDPkt.js";import{n as ae,t as oe}from"./ajv-CDrSAj3O.js";var se=e((()=>{r()})),ce=e((()=>{r()})),le=e((()=>{})),ue=e((()=>{se(),ce(),le(),ce()})),de=e((()=>{ue()}));function y(e){return!!e._zod}function b(e,t){return y(e)?a(e,t):e.safeParse(t)}function fe(e){if(!e)return;let t;if(t=y(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function pe(e){if(y(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}var me=e((()=>{de()})),he,ge,x,S,_e,ve,ye,be,C,w,T,xe,E,D,O,k,A,Se,Ce,we,Te,Ee,j,M,De,Oe,ke,N,Ae,je,Me,P,F,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,I,Ue,L,We,Ge,R,Ke,z,B,qe,V,H,Je,U,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,W,G,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,K,Wt,Gt,Kt,qt,q,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,J,rn,an,on,Y,X,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Z,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Q,Pn,Fn=e((()=>{ie(),he=`2025-11-25`,ge=[he,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],x=`io.modelcontextprotocol/related-task`,S=o(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),_e=f([s(),i().int()]),ve=s(),p({ttl:i().optional(),pollInterval:i().optional()}),ye=v({ttl:i().optional()}),be=v({taskId:s()}),C=p({progressToken:_e.optional(),[x]:be.optional()}),w=v({_meta:C.optional()}),T=w.extend({task:ye.optional()}),xe=e=>T.safeParse(e).success,E=v({method:s(),params:w.loose().optional()}),D=v({_meta:C.optional()}),O=v({method:s(),params:D.loose().optional()}),k=p({_meta:C.optional()}),A=f([s(),i().int()]),Se=v({jsonrpc:g(`2.0`),id:A,...E.shape}).strict(),Ce=e=>Se.safeParse(e).success,we=v({jsonrpc:g(`2.0`),...O.shape}).strict(),Te=e=>we.safeParse(e).success,Ee=v({jsonrpc:g(`2.0`),id:A,result:k}).strict(),j=e=>Ee.safeParse(e).success,(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(M||(M={})),De=v({jsonrpc:g(`2.0`),id:A.optional(),error:v({code:i().int(),message:s(),data:d().optional()})}).strict(),Oe=e=>De.safeParse(e).success,ke=f([Se,we,Ee,De]),f([Ee,De]),N=k.strict(),Ae=D.extend({requestId:A.optional(),reason:s().optional()}),je=O.extend({method:g(`notifications/cancelled`),params:Ae}),Me=v({src:s(),mimeType:s().optional(),sizes:u(s()).optional(),theme:_([`light`,`dark`]).optional()}),P=v({icons:u(Me).optional()}),F=v({name:s(),title:s().optional()}),Ne=F.extend({...F.shape,...P.shape,version:s(),websiteUrl:s().optional(),description:s().optional()}),Pe=ee(v({applyDefaults:h().optional()}),c(s(),d())),Fe=m(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ee(v({form:Pe.optional(),url:S.optional()}),c(s(),d()).optional())),Ie=p({list:S.optional(),cancel:S.optional(),requests:p({sampling:p({createMessage:S.optional()}).optional(),elicitation:p({create:S.optional()}).optional()}).optional()}),Le=p({list:S.optional(),cancel:S.optional(),requests:p({tools:p({call:S.optional()}).optional()}).optional()}),Re=v({experimental:c(s(),S).optional(),sampling:v({context:S.optional(),tools:S.optional()}).optional(),elicitation:Fe.optional(),roots:v({listChanged:h().optional()}).optional(),tasks:Ie.optional(),extensions:c(s(),S).optional()}),ze=w.extend({protocolVersion:s(),capabilities:Re,clientInfo:Ne}),Be=E.extend({method:g(`initialize`),params:ze}),Ve=v({experimental:c(s(),S).optional(),logging:S.optional(),completions:S.optional(),prompts:v({listChanged:h().optional()}).optional(),resources:v({subscribe:h().optional(),listChanged:h().optional()}).optional(),tools:v({listChanged:h().optional()}).optional(),tasks:Le.optional(),extensions:c(s(),S).optional()}),He=k.extend({protocolVersion:s(),capabilities:Ve,serverInfo:Ne,instructions:s().optional()}),I=O.extend({method:g(`notifications/initialized`),params:D.optional()}),Ue=e=>I.safeParse(e).success,L=E.extend({method:g(`ping`),params:w.optional()}),We=v({progress:i(),total:l(i()),message:l(s())}),Ge=v({...D.shape,...We.shape,progressToken:_e}),R=O.extend({method:g(`notifications/progress`),params:Ge}),Ke=w.extend({cursor:ve.optional()}),z=E.extend({params:Ke.optional()}),B=k.extend({nextCursor:ve.optional()}),qe=_([`working`,`input_required`,`completed`,`failed`,`cancelled`]),V=v({taskId:s(),status:qe,ttl:f([i(),ne()]),createdAt:s(),lastUpdatedAt:s(),pollInterval:l(i()),statusMessage:l(s())}),H=k.extend({task:V}),Je=D.merge(V),U=O.extend({method:g(`notifications/tasks/status`),params:Je}),Ye=E.extend({method:g(`tasks/get`),params:w.extend({taskId:s()})}),Xe=k.merge(V),Ze=E.extend({method:g(`tasks/result`),params:w.extend({taskId:s()})}),k.loose(),Qe=z.extend({method:g(`tasks/list`)}),$e=B.extend({tasks:u(V)}),et=E.extend({method:g(`tasks/cancel`),params:w.extend({taskId:s()})}),tt=k.merge(V),nt=v({uri:s(),mimeType:l(s()),_meta:c(s(),d()).optional()}),rt=nt.extend({text:s()}),it=s().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),at=nt.extend({blob:it}),W=_([`user`,`assistant`]),G=v({audience:u(W).optional(),priority:i().min(0).max(1).optional(),lastModified:te({offset:!0}).optional()}),ot=v({...F.shape,...P.shape,uri:s(),description:l(s()),mimeType:l(s()),size:l(i()),annotations:G.optional(),_meta:l(p({}))}),st=v({...F.shape,...P.shape,uriTemplate:s(),description:l(s()),mimeType:l(s()),annotations:G.optional(),_meta:l(p({}))}),ct=z.extend({method:g(`resources/list`)}),lt=B.extend({resources:u(ot)}),ut=z.extend({method:g(`resources/templates/list`)}),dt=B.extend({resourceTemplates:u(st)}),ft=w.extend({uri:s()}),pt=ft,mt=E.extend({method:g(`resources/read`),params:pt}),ht=k.extend({contents:u(f([rt,at]))}),gt=O.extend({method:g(`notifications/resources/list_changed`),params:D.optional()}),_t=ft,vt=E.extend({method:g(`resources/subscribe`),params:_t}),yt=ft,bt=E.extend({method:g(`resources/unsubscribe`),params:yt}),xt=D.extend({uri:s()}),St=O.extend({method:g(`notifications/resources/updated`),params:xt}),Ct=v({name:s(),description:l(s()),required:l(h())}),wt=v({...F.shape,...P.shape,description:l(s()),arguments:l(u(Ct)),_meta:l(p({}))}),Tt=z.extend({method:g(`prompts/list`)}),Et=B.extend({prompts:u(wt)}),Dt=w.extend({name:s(),arguments:c(s(),s()).optional()}),Ot=E.extend({method:g(`prompts/get`),params:Dt}),kt=v({type:g(`text`),text:s(),annotations:G.optional(),_meta:c(s(),d()).optional()}),At=v({type:g(`image`),data:it,mimeType:s(),annotations:G.optional(),_meta:c(s(),d()).optional()}),jt=v({type:g(`audio`),data:it,mimeType:s(),annotations:G.optional(),_meta:c(s(),d()).optional()}),Mt=v({type:g(`tool_use`),name:s(),id:s(),input:c(s(),d()),_meta:c(s(),d()).optional()}),Nt=v({type:g(`resource`),resource:f([rt,at]),annotations:G.optional(),_meta:c(s(),d()).optional()}),Pt=ot.extend({type:g(`resource_link`)}),Ft=f([kt,At,jt,Pt,Nt]),It=v({role:W,content:Ft}),Lt=k.extend({description:s().optional(),messages:u(It)}),Rt=O.extend({method:g(`notifications/prompts/list_changed`),params:D.optional()}),zt=v({title:s().optional(),readOnlyHint:h().optional(),destructiveHint:h().optional(),idempotentHint:h().optional(),openWorldHint:h().optional()}),Bt=v({taskSupport:_([`required`,`optional`,`forbidden`]).optional()}),Vt=v({...F.shape,...P.shape,description:s().optional(),inputSchema:v({type:g(`object`),properties:c(s(),S).optional(),required:u(s()).optional()}).catchall(d()),outputSchema:v({type:g(`object`),properties:c(s(),S).optional(),required:u(s()).optional()}).catchall(d()).optional(),annotations:zt.optional(),execution:Bt.optional(),_meta:c(s(),d()).optional()}),Ht=z.extend({method:g(`tools/list`)}),Ut=B.extend({tools:u(Vt)}),K=k.extend({content:u(Ft).default([]),structuredContent:c(s(),d()).optional(),isError:h().optional()}),K.or(k.extend({toolResult:d()})),Wt=T.extend({name:s(),arguments:c(s(),d()).optional()}),Gt=E.extend({method:g(`tools/call`),params:Wt}),Kt=O.extend({method:g(`notifications/tools/list_changed`),params:D.optional()}),qt=v({autoRefresh:h().default(!0),debounceMs:i().int().nonnegative().default(300)}),q=_([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Jt=w.extend({level:q}),Yt=E.extend({method:g(`logging/setLevel`),params:Jt}),Xt=D.extend({level:q,logger:s().optional(),data:d()}),Zt=O.extend({method:g(`notifications/message`),params:Xt}),Qt=v({name:s().optional()}),$t=v({hints:u(Qt).optional(),costPriority:i().min(0).max(1).optional(),speedPriority:i().min(0).max(1).optional(),intelligencePriority:i().min(0).max(1).optional()}),en=v({mode:_([`auto`,`required`,`none`]).optional()}),tn=v({type:g(`tool_result`),toolUseId:s().describe(`The unique identifier for the corresponding tool call.`),content:u(Ft).default([]),structuredContent:v({}).loose().optional(),isError:h().optional(),_meta:c(s(),d()).optional()}),nn=re(`type`,[kt,At,jt]),J=re(`type`,[kt,At,jt,Mt,tn]),rn=v({role:W,content:f([J,u(J)]),_meta:c(s(),d()).optional()}),an=T.extend({messages:u(rn),modelPreferences:$t.optional(),systemPrompt:s().optional(),includeContext:_([`none`,`thisServer`,`allServers`]).optional(),temperature:i().optional(),maxTokens:i().int(),stopSequences:u(s()).optional(),metadata:S.optional(),tools:u(Vt).optional(),toolChoice:en.optional()}),on=E.extend({method:g(`sampling/createMessage`),params:an}),Y=k.extend({model:s(),stopReason:l(_([`endTurn`,`stopSequence`,`maxTokens`]).or(s())),role:W,content:nn}),X=k.extend({model:s(),stopReason:l(_([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(s())),role:W,content:f([J,u(J)])}),sn=v({type:g(`boolean`),title:s().optional(),description:s().optional(),default:h().optional()}),cn=v({type:g(`string`),title:s().optional(),description:s().optional(),minLength:i().optional(),maxLength:i().optional(),format:_([`email`,`uri`,`date`,`date-time`]).optional(),default:s().optional()}),ln=v({type:_([`number`,`integer`]),title:s().optional(),description:s().optional(),minimum:i().optional(),maximum:i().optional(),default:i().optional()}),un=v({type:g(`string`),title:s().optional(),description:s().optional(),enum:u(s()),default:s().optional()}),dn=v({type:g(`string`),title:s().optional(),description:s().optional(),oneOf:u(v({const:s(),title:s()})),default:s().optional()}),fn=v({type:g(`string`),title:s().optional(),description:s().optional(),enum:u(s()),enumNames:u(s()).optional(),default:s().optional()}),pn=f([un,dn]),mn=v({type:g(`array`),title:s().optional(),description:s().optional(),minItems:i().optional(),maxItems:i().optional(),items:v({type:g(`string`),enum:u(s())}),default:u(s()).optional()}),hn=v({type:g(`array`),title:s().optional(),description:s().optional(),minItems:i().optional(),maxItems:i().optional(),items:v({anyOf:u(v({const:s(),title:s()}))}),default:u(s()).optional()}),gn=f([mn,hn]),_n=f([fn,pn,gn]),vn=f([_n,sn,cn,ln]),yn=T.extend({mode:g(`form`).optional(),message:s(),requestedSchema:v({type:g(`object`),properties:c(s(),vn),required:u(s()).optional()})}),bn=T.extend({mode:g(`url`),message:s(),elicitationId:s(),url:s().url()}),xn=f([yn,bn]),Sn=E.extend({method:g(`elicitation/create`),params:xn}),Cn=D.extend({elicitationId:s()}),wn=O.extend({method:g(`notifications/elicitation/complete`),params:Cn}),Z=k.extend({action:_([`accept`,`decline`,`cancel`]),content:m(e=>e===null?void 0:e,c(s(),f([s(),i(),h(),u(s())])).optional())}),Tn=v({type:g(`ref/resource`),uri:s()}),En=v({type:g(`ref/prompt`),name:s()}),Dn=w.extend({ref:f([En,Tn]),argument:v({name:s(),value:s()}),context:v({arguments:c(s(),s()).optional()}).optional()}),On=E.extend({method:g(`completion/complete`),params:Dn}),kn=k.extend({completion:p({values:u(s()).max(100),total:l(i().int()),hasMore:l(h())})}),An=v({uri:s().startsWith(`file://`),name:s().optional(),_meta:c(s(),d()).optional()}),jn=E.extend({method:g(`roots/list`),params:w.optional()}),Mn=k.extend({roots:u(An)}),Nn=O.extend({method:g(`notifications/roots/list_changed`),params:D.optional()}),f([L,Be,On,Yt,Ot,Tt,ct,ut,mt,vt,bt,Gt,Ht,Ye,Ze,Qe,et]),f([je,R,I,Nn,U]),f([N,Y,X,Z,Mn,Xe,$e,H]),f([L,on,Sn,jn,Ye,Ze,Qe,et]),f([je,R,Zt,St,gt,Kt,Rt,U,wn]),f([N,He,kn,Lt,Et,lt,dt,ht,K,Ut,Xe,$e,H]),Q=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===M.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Pn(e.elicitations,n)}return new e(t,n,r)}},Pn=class extends Q{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(M.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}}));function $(e){return e===`completed`||e===`failed`||e===`cancelled`}var In=e((()=>{})),Ln=e((()=>{})),Rn=e((()=>{})),zn=e((()=>{})),Bn=e((()=>{})),Vn=e((()=>{})),Hn=e((()=>{})),Un=e((()=>{})),Wn=e((()=>{})),Gn=e((()=>{})),Kn=e((()=>{})),qn=e((()=>{})),Jn=e((()=>{})),Yn=e((()=>{})),Xn=e((()=>{})),Zn=e((()=>{})),Qn=e((()=>{})),$n=e((()=>{})),er=e((()=>{})),tr=e((()=>{})),nr=e((()=>{})),rr=e((()=>{})),ir=e((()=>{})),ar=e((()=>{})),or=e((()=>{})),sr=e((()=>{})),cr=e((()=>{})),lr=e((()=>{})),ur=e((()=>{})),dr=e((()=>{})),fr=e((()=>{})),pr=e((()=>{})),mr=e((()=>{})),hr=e((()=>{})),gr=e((()=>{})),_r=e((()=>{})),vr=e((()=>{})),yr=e((()=>{})),br=e((()=>{})),xr=e((()=>{Ln(),Rn(),zn(),Bn(),vr(),yr(),Vn(),Hn(),Un(),Wn(),Gn(),Kn(),qn(),Jn(),Yn(),Xn(),Zn(),Qn(),tr(),nr(),rr(),ir(),or(),sr(),cr(),lr(),ur(),dr(),gr(),er(),fr(),$n(),pr(),mr(),ar(),hr(),_r(),br()}));function Sr(e){let t=fe(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=pe(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function Cr(e,t){let n=b(e,t);if(!n.success)throw n.error;return n.data}var wr=e((()=>{me(),xr()}));function Tr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Er(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];Tr(a)&&Tr(i)?n[r]={...a,...i}:n[r]=i}return n}var Dr,Or=e((()=>{me(),Fn(),In(),wr(),Dr=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(je,e=>{this._oncancel(e)}),this.setNotificationHandler(R,e=>{this._onprogress(e)}),this.setRequestHandler(L,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Ye,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new Q(M.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(Ze,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r)if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new Q(e.error.code,e.error.message,e.error.data))}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new Q(M.InvalidParams,`Task not found: ${r}`);if(!$(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if($(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[x]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(Qe,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new Q(M.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(et,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new Q(M.InvalidParams,`Task not found: ${e.params.taskId}`);if($(n.status))throw new Q(M.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new Q(M.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof Q?e:new Q(M.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),Q.fromError(M.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),j(e)||Oe(e)?this._onresponse(e):Ce(e)?this._onrequest(e,t):Te(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=Q.fromError(M.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[x]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:M.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=xe(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new Q(M.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:M.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),j(e)?n(e):n(new Q(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(j(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),j(e)?r(e):r(Q.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof Q?e:new Q(M.InternalError,String(e))}}return}let i;try{let r=await this.request(e,H,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new Q(M.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},$(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new Q(M.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new Q(M.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof Q?e:new Q(M.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[x]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof Q?e:new Q(M.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=b(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(Q.fromError(M.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let h=s?.taskId;h?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(h,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},Xe,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},$e,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},tt,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[x]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[x]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[x]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=Sr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=Cr(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=Sr(e);this._notificationHandlers.set(n,n=>{let r=Cr(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&Ce(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new Q(M.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new Q(M.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new Q(M.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new Q(M.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=U.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),$(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new Q(M.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if($(a.status))throw new Q(M.InvalidParams,`Cannot update task "${e}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=U.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),$(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}}})),kr=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:g,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:se,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:v,int32:{type:`number`,validate:re},int64:{type:`number`,validate:ie},float:{type:`number`,validate:ae},double:{type:`number`,validate:ae},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}var r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}var s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}var d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}var h=/\/|:/,ee=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function g(e){return h.test(e)&&ee.test(e)}var _=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function v(e){return _.lastIndex=0,_.test(e)}var te=-(2**31),ne=2**31-1;function re(e){return Number.isInteger(e)&&e<=ne&&e>=te}function ie(e){return Number.isInteger(e)}function ae(){return!0}var oe=/[^\\]\\Z/;function se(e){if(oe.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),Ar=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatLimitDefinition=void 0;var t=oe(),n=ae(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),jr=n(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0});var n=kr(),r=Ar(),i=ae(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s}));function Mr(){let e=new Nr.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Pr.default)(e),e}var Nr,Pr,Fr,Ir=e((()=>{Nr=t(oe(),1),Pr=t(jr(),1),Fr=class{constructor(e){this._ajv=e??Mr()}getValidator(e){let t=`$id`in e&&typeof e.$id==`string`?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return e=>t(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}})),Lr,Rr=e((()=>{Fn(),Lr=class{constructor(e){this._server=e}requestStream(e,t,n){return this._server.requestStream(e,t,n)}createMessageStream(e,t){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw Error(`Client does not support sampling tools capability.`);if(e.messages.length>0){let t=e.messages[e.messages.length-1],n=Array.isArray(t.content)?t.content:[t.content],r=n.some(e=>e.type===`tool_result`),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],o=a.some(e=>e.type===`tool_use`);if(r){if(n.some(e=>e.type!==`tool_result`))throw Error(`The last message must contain only tool_result content if any is present`);if(!o)throw Error(`tool_result blocks are not matching any tool_use from the previous message`)}if(o){let e=new Set(a.filter(e=>e.type===`tool_use`).map(e=>e.id)),t=new Set(n.filter(e=>e.type===`tool_result`).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw Error(`ids of tool_result blocks and tool_use blocks from previous message do not match`)}}return this.requestStream({method:`sampling/createMessage`,params:e},Y,t)}elicitInputStream(e,t){let n=this._server.getClientCapabilities(),r=e.mode??`form`;switch(r){case`url`:if(!n?.elicitation?.url)throw Error(`Client does not support url elicitation.`);break;case`form`:if(!n?.elicitation?.form)throw Error(`Client does not support form elicitation.`);break}let i=r===`form`&&e.mode===void 0?{...e,mode:`form`}:e;return this.requestStream({method:`elicitation/create`,params:i},Z,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,n){return this._server.getTaskResult({taskId:e},t,n)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}}}));function zr(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);switch(t){case`tools/call`:if(!e.tools?.call)throw Error(`${n} does not support task creation for tools/call (required for ${t})`);break;default:break}}function Br(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);switch(t){case`sampling/createMessage`:if(!e.sampling?.createMessage)throw Error(`${n} does not support task creation for sampling/createMessage (required for ${t})`);break;case`elicitation/create`:if(!e.elicitation?.create)throw Error(`${n} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var Vr=e((()=>{})),Hr,Ur=e((()=>{Or(),Fn(),Ir(),me(),Rr(),Vr(),Hr=class extends Dr{constructor(e,t){super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(q.options.map((e,t)=>[e,t])),this.isMessageIgnored=(e,t)=>{let n=this._loggingLevels.get(t);return n?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(n):!1},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Fr,this.setRequestHandler(Be,e=>this._oninitialize(e)),this.setNotificationHandler(I,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Yt,async(e,t)=>{let n=t.sessionId||t.requestInfo?.headers[`mcp-session-id`]||void 0,{level:r}=e.params,i=q.safeParse(r);return i.success&&this._loggingLevels.set(n,i.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Lr(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=Er(this._capabilities,e)}setRequestHandler(e,t){let n=fe(e)?.method;if(!n)throw Error(`Schema is missing a method literal`);let r;if(y(n)){let e=n;r=e._zod?.def?.value??e.value}else{let e=n;r=e._def?.value??e.value}if(typeof r!=`string`)throw Error(`Schema method literal must be a string`);return r===`tools/call`?super.setRequestHandler(e,async(e,n)=>{let r=b(Gt,e);if(!r.success){let e=r.error instanceof Error?r.error.message:String(r.error);throw new Q(M.InvalidParams,`Invalid tools/call request: ${e}`)}let{params:i}=r.data,a=await Promise.resolve(t(e,n));if(i.task){let e=b(H,a);if(!e.success){let t=e.error instanceof Error?e.error.message:String(e.error);throw new Q(M.InvalidParams,`Invalid task creation result: ${t}`)}return e.data}let o=b(K,a);if(!o.success){let e=o.error instanceof Error?o.error.message:String(o.error);throw new Q(M.InvalidParams,`Invalid tools/call result: ${e}`)}return o.data}):super.setRequestHandler(e,t)}assertCapabilityForMethod(e){switch(e){case`sampling/createMessage`:if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case`elicitation/create`:if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case`roots/list`:if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case`ping`:break}}assertNotificationCapability(e){switch(e){case`notifications/message`:if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case`notifications/resources/updated`:case`notifications/resources/list_changed`:if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case`notifications/tools/list_changed`:if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case`notifications/prompts/list_changed`:if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case`notifications/elicitation/complete`:if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case`notifications/cancelled`:break;case`notifications/progress`:break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case`completion/complete`:if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case`logging/setLevel`:if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case`resources/list`:case`resources/templates/list`:case`resources/read`:if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case`tasks/get`:case`tasks/list`:case`tasks/result`:case`tasks/cancel`:if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case`ping`:case`initialize`:break}}assertTaskCapability(e){Br(this._clientCapabilities?.tasks?.requests,e,`Client`)}assertTaskHandlerCapability(e){this._capabilities&&zr(this._capabilities.tasks?.requests,e,`Server`)}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:ge.includes(t)?t:he,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:`ping`},N)}async createMessage(e,t){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw Error(`Client does not support sampling tools capability.`);if(e.messages.length>0){let t=e.messages[e.messages.length-1],n=Array.isArray(t.content)?t.content:[t.content],r=n.some(e=>e.type===`tool_result`),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],o=a.some(e=>e.type===`tool_use`);if(r){if(n.some(e=>e.type!==`tool_result`))throw Error(`The last message must contain only tool_result content if any is present`);if(!o)throw Error(`tool_result blocks are not matching any tool_use from the previous message`)}if(o){let e=new Set(a.filter(e=>e.type===`tool_use`).map(e=>e.id)),t=new Set(n.filter(e=>e.type===`tool_result`).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw Error(`ids of tool_result blocks and tool_use blocks from previous message do not match`)}}return e.tools?this.request({method:`sampling/createMessage`,params:e},X,t):this.request({method:`sampling/createMessage`,params:e},Y,t)}async elicitInput(e,t){switch(e.mode??`form`){case`url`:{if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support url elicitation.`);let n=e;return this.request({method:`elicitation/create`,params:n},Z,t)}case`form`:{if(!this._clientCapabilities?.elicitation?.form)throw Error(`Client does not support form elicitation.`);let n=e.mode===`form`?e:{...e,mode:`form`},r=await this.request({method:`elicitation/create`,params:n},Z,t);if(r.action===`accept`&&r.content&&n.requestedSchema)try{let e=this._jsonSchemaValidator.getValidator(n.requestedSchema)(r.content);if(!e.valid)throw new Q(M.InvalidParams,`Elicitation response content does not match requested schema: ${e.errorMessage}`)}catch(e){throw e instanceof Q?e:new Q(M.InternalError,`Error validating elicitation response: ${e instanceof Error?e.message:String(e)}`)}return r}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for notifications/elicitation/complete)`);return()=>this.notification({method:`notifications/elicitation/complete`,params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:`roots/list`,params:e},Mn,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:`notifications/message`,params:e})}async sendResourceUpdated(e){return this.notification({method:`notifications/resources/updated`,params:e})}async sendResourceListChanged(){return this.notification({method:`notifications/resources/list_changed`})}async sendToolListChanged(){return this.notification({method:`notifications/tools/list_changed`})}async sendPromptListChanged(){return this.notification({method:`notifications/prompts/list_changed`})}}}));export{lt as A,Fn as B,Lt as C,qt as D,he as E,Rt as F,me as G,Ce as H,ht as I,y as K,gt as L,Ht as M,Ut as N,Et as O,Q as P,ge as R,M as S,ke as T,j as U,Ue as V,fe as W,H as _,Vr as a,wn as b,Dr as c,Gt as d,K as f,X as g,Y as h,zr as i,jn as j,dt as k,Or as l,on as m,Ur as n,Fr as o,kn as p,b as q,Br as r,Ir as s,Hr as t,Er as u,Sn as v,He as w,N as x,Z as y,Kt as z};
@@ -0,0 +1 @@
1
+ var e=()=>{};export{e as printBanner};
@@ -0,0 +1 @@
1
+ var e=()=>({});export{e as createServerLogger};
@@ -0,0 +1,2 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,p as i,t as a,tt as o,x as s}from"./src-DNHWYkls.js";import{t as c}from"./jsx-runtime-BTgGEFjL.js";import{l,p as u}from"./debug-CjIaNjpK.js";import{BE as d,zE as f}from"./loadAgentsDir-Bz0FfcVt.js";import{t as p}from"./useKeybinding-DAQL_dB_.js";import{t as m}from"./lib-Ddq71jM5.js";function h({onDone:e}){let t=d(e=>e.remoteSessionUrl),[n,a]=(0,_.useState)(``);if((0,_.useEffect)(()=>{if(!t)return;let e=t;async function n(){a(await(0,g.toString)(e,{type:`utf8`,errorCorrectionLevel:`L`}))}n().catch(e=>{u(`QR code generation failed`,e)})},[t]),o(`confirm:no`,e,{context:`Confirmation`}),!t)return(0,v.jsxs)(i,{children:[(0,v.jsx)(r,{color:`warning`,children:"Not in remote mode. Start with `claude --remote` to use this command."}),(0,v.jsx)(r,{dimColor:!0,children:`(press esc to close)`})]});let c=n.split(`
2
+ `).filter(e=>e.length>0),l=c.length===0;return(0,v.jsxs)(i,{children:[(0,v.jsx)(s,{marginBottom:1,children:(0,v.jsx)(r,{bold:!0,children:`Remote session`})}),l?(0,v.jsx)(r,{dimColor:!0,children:`Generating QR code…`}):c.map((e,t)=>(0,v.jsx)(r,{children:e},t)),(0,v.jsxs)(s,{marginTop:1,children:[(0,v.jsx)(r,{dimColor:!0,children:`Open in browser: `}),(0,v.jsx)(r,{color:`ide`,children:t})]}),(0,v.jsx)(s,{marginTop:1,children:(0,v.jsx)(r,{dimColor:!0,children:`(press esc to close)`})})]})}var g,_,v,y;e((()=>{g=m(),n(),_=t(n(),1),a(),p(),f(),l(),v=c(),y=async e=>(0,v.jsx)(h,{onDone:e})}))();export{y as call};
@@ -0,0 +1 @@
1
+ var e=()=>{};export{e as createSessionTurnUploader};
@@ -0,0 +1 @@
1
+ import{l as e,p as t}from"./debug-CjIaNjpK.js";e();async function n(){let{fetchCodeSessionsFromSessionsAPI:e}=await import(`./api-DvyGR-L7.js`),n;try{n=await e()}catch(e){throw t(`[assistant:discovery] fetchCodeSessionsFromSessionsAPI failed: ${e}`),e}return n.filter(e=>e.status===`idle`||e.status===`working`||e.status===`waiting`).map(e=>({id:e.id,title:e.title||`Untitled`,status:e.status,created_at:e.created_at??``}))}export{n as discoverAssistantSessions};
@@ -0,0 +1 @@
1
+ import{$s as e,tc as t}from"./loadAgentsDir-Bz0FfcVt.js";e();export{t as registerSessionFileAccessHooks};
@@ -0,0 +1 @@
1
+ var e=class{async destroyAll(){}};export{e as SessionManager};
@@ -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{Ht as r,P as i}from"./state-CUZTq6r0.js";import{Qo as a,Zo as o,c as s,l as c,m as l}from"./growthbook-p4aJ_UMv.js";import{B as u,U as d,_ as ee,h as te,z as ne}from"./debug-CjIaNjpK.js";import{D as re,O as f}from"./teammate-C-FiRloZ.js";import{n as p,r as m}from"./analytics-i6X1et4O.js";import{AN as h,BN as ie,CN as g,DN as _,EN as v,Ed as y,En as b,FN as ae,GN as oe,KN as se,MN as ce,NN as x,ON as le,PN as ue,Rd as de,TN as fe,Td as S,Tn as C,UN as w,Ud as T,VN as E,Vd as D,Yc as O,Zc as k,bd as A,cM as j,dN as M,dm as N,jN as P,jc as F,kN as I,nc as L,qN as R,rc as z,sM as B,um as pe,wd as V,wn as me,xN as H,yd as he,zd as U}from"./loadAgentsDir-Bz0FfcVt.js";import{Qn as W,tr as ge}from"./prompt-CsBCtw4l.js";import{H as _e}from"./rcDebugLog-BbHlIxCm.js";import{writeFile as G}from"fs/promises";function ve(){return c(`tengu_session_memory`,!1)}function ye(){return s(`tengu_sm_config`,{})}function be(e,t){let n=0,r=t==null;for(let i of e){if(!r){i.uuid===t&&(r=!0);continue}if(i.type===`assistant`){let e=i.message.content;Array.isArray(e)&&(n+=re(e,e=>e.type===`tool_use`))}}return n}function K(e){let t=w(e);if(!I()){if(!v(t))return!1;ce()}let n=_(t),r=be(e,X)>=fe(),i=O(e);if(n&&r||n&&!i){let t=e[e.length-1];return t?.uuid&&(X=t.uuid),!0}return!1}async function q(e){let t=te(),n=me();await t.mkdir(n,{mode:448});let r=C();try{await G(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await G(r,await y(),{encoding:`utf-8`,mode:384})}catch(e){if(u(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await L.call({file_path:r},e),a=``,o=i.data;return o.type===`text`&&(a=o.file.content),m(`tengu_session_memory_file_read`,{content_length:a.length}),{memoryPath:r,currentMemory:a}}function xe(){if(i())return;let e=A();process.env.USER_TYPE===`ant`&&m(`tengu_session_memory_init`,{auto_compact_enabled:e}),e&&j($)}async function Se(e,t){if(e.length===0)return{success:!1,error:`No messages to summarize`};P();try{let n=U(t),{memoryPath:r,currentMemory:i}=await q(n),a=await V(i,r),{tools:o,mainLoopModel:s}=t.options,[c,l,u]=await Promise.all([pe(o,s),se(),oe()]),d=_e(c);return await T({promptMessages:[F({content:a})],cacheSafeParams:{systemPrompt:d,userContext:l,systemContext:u,toolUseContext:n,forkContextMessages:e},canUseTool:J(r),querySource:`session_memory`,forkLabel:`session_memory_manual`,overrides:{readFileState:n.readFileState}}),m(`tengu_session_memory_manual_extraction`,{}),x(w(e)),Y(e),{success:!0,memoryPath:r}}catch(e){return{success:!1,error:ne(e)}}finally{h()}}function J(e){return async(t,n)=>{if(t.name===`Edit`&&typeof n==`object`&&n&&`file_path`in n){let t=n.file_path;if(typeof t==`string`&&t===e)return{behavior:`allow`,updatedInput:n}}return{behavior:`deny`,message:`only ${W} on ${e} is allowed`,decisionReason:{type:`other`,reason:`only ${W} on ${e} is allowed`}}}}function Y(e){if(!O(e)){let t=e[e.length-1];t?.uuid&&ue(t.uuid)}}var X,Z,Q,$,Ce=e((()=>{n(),r(),N(),R(),ge(),z(),f(),D(),ee(),B(),k(),b(),o(),M(),E(),p(),he(),S(),le(),d(),l(),Z=t(()=>{let e=ye();ae({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:H.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:H.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:H.toolCallsBetweenUpdates})}),Q=!1,$=a(async function(e){let{messages:t,toolUseContext:n,querySource:r}=e;if(r!==`repl_main_thread`)return;{let{isPoorModeActive:e}=await import(`./poorMode-CbZTudtw.js`);if(e())return}if(!ve()){process.env.USER_TYPE===`ant`&&!Q&&(Q=!0,m(`tengu_session_memory_gate_disabled`,{}));return}if(Z(),!K(t))return;P();let i=U(n),{memoryPath:a,currentMemory:o}=await q(i);await T({promptMessages:[F({content:await V(o,a)})],cacheSafeParams:de(e),canUseTool:J(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],c=s?ie(s):void 0,l=g();m(`tengu_session_memory_extraction`,{input_tokens:c?.input_tokens,output_tokens:c?.output_tokens,cache_read_input_tokens:c?.cache_read_input_tokens??void 0,cache_creation_input_tokens:c?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:l.minimumMessageTokensToInit,config_min_tokens_between_update:l.minimumTokensBetweenUpdate,config_tool_calls_between_updates:l.toolCallsBetweenUpdates}),x(w(t)),Y(t),h()})}));export{K as a,Se as i,xe as n,Ce as r,J as t};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./sessionMemory-BA6cdxqP.js";t();export{e as manuallyExtractSessionMemory};
@@ -0,0 +1 @@
1
+ import{ON as e,wN as t}from"./loadAgentsDir-Bz0FfcVt.js";e();export{t as getSessionMemoryContent};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./sessionObserver-SpE_eglb.js";e();export{t as heuristicObserverBackend};
@@ -0,0 +1,20 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{X as t,Z as n,dN as r}from"./loadAgentsDir-Bz0FfcVt.js";import{H as i}from"./rcDebugLog-BbHlIxCm.js";import{i as a,l as o,r as s,t as c,u as l}from"./instinctParser-DxKdI3JC.js";function u(e){g.set(e.name,e),_||(_=e.name)}function d(e){if(!g.has(e))throw Error(`Observer backend "${e}" is not registered`);_=e}function f(){let e=_?g.get(_):void 0;if(!e)throw Error(`No observer backend is active — register one before analyzing observations`);return e}async function p(e,t){return Promise.resolve(f().analyze(e,t))}function m(){let e=process.env.SKILL_LEARNING_OBSERVER_BACKEND?.trim();return e&&g.has(e)?e:void 0}function h(){let e=m();return e&&d(e),f()}var g,_,v=e((()=>{g=new Map})),y,b=e((()=>{y=[`workflow`,`testing`,`debugging`,`code-style`,`security`,`git`,`project`]}));async function x(e,t){if(e.length===0)return[];if(Date.now()<L)return S(e,t);let r=e.slice(-P),a=C(r),s=N(o().llm.timeoutMs),c;try{let e=await n({systemPrompt:i([R]),userPrompt:a,signal:s,options:{querySource:`skill_learning_observer`,enablePromptCaching:!0,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[]}});I=0,c=E(e.message?.content)}catch{return I++,I>=o().llm.failureThreshold&&(L=Date.now()+o().llm.circuitCooldownMs),S(e,t)}let l=D(c,t,r);return l.length===0?(I++,I>=o().llm.failureThreshold&&(L=Date.now()+o().llm.circuitCooldownMs),S(e,t)):l}async function S(e,t){try{let{heuristicObserverBackend:n}=await import(`./sessionObserver-CESI-uVZ.js`),r=n.analyze(e,t);return Array.isArray(r)?r:await r}catch{return[]}}function C(e){return`Observations (chronological, newest last):\n${e.map((e,t)=>w(e,t)).join(`
2
+ `)}\n\nExtract up to ${F} atomic instincts. JSON array only.`}function w(e,t){let n=[`#${t+1}`,`event=${e.event}`];return e.toolName&&n.push(`tool=${e.toolName}`),e.outcome&&n.push(`outcome=${e.outcome}`),e.messageText&&n.push(`text=${JSON.stringify(T(e.messageText,200))}`),e.toolInput&&n.push(`in=${JSON.stringify(T(e.toolInput,120))}`),e.toolOutput&&n.push(`out=${JSON.stringify(T(e.toolOutput,120))}`),n.join(` | `)}function T(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function E(e){if(!Array.isArray(e))return``;let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;e.type===`text`&&typeof e.text==`string`&&t.push(e.text)}return t.join(``).trim()}function D(e,t,n){let r=O(e);if(!r)return[];let i;try{i=JSON.parse(r)}catch{return[]}if(!Array.isArray(i))return[];let a=n.map(e=>e.id),o=[];for(let e of i.slice(0,F)){let n=k(e,t,a);n&&o.push(n)}return o}function O(e){if(!e)return;let t=e.indexOf(`[`),n=e.lastIndexOf(`]`);if(!(t<0||n<=t))return e.slice(t,n+1)}function k(e,t,n){if(!e||typeof e!=`object`)return;let r=e,i=A(r.trigger,80),a=A(r.action,120);if(!i||!a)return;let o=te(r.evidence);if(o.length!==0)return{trigger:i,action:a,confidence:j(r.confidence),domain:M(r.domain),source:`session-observation`,scope:ee(r.scope),projectId:t?.project?.projectId,projectName:t?.project?.projectName,evidence:o,observationIds:n}}function A(e,t){if(typeof e!=`string`)return;let n=e.trim();if(n)return n.length>t?n.slice(0,t):n}function j(e){return typeof e!=`number`||!Number.isFinite(e)?.5:e<0?0:e>1?1:e}function M(e){return typeof e==`string`&&y.includes(e)?e:`project`}function ee(e){return e===`global`?`global`:`project`}function te(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();if(e&&(t.push(e.length>200?`${e.slice(0,200)}…`:e),t.length===3))break}return t}function N(e){return AbortSignal.timeout(e)}var P,F,I,L,R,z,B=e((()=>{t(),r(),l(),b(),P=30,F=3,I=0,L=0,R=`You analyse a short sequence of observations from a coding-assistant session (user messages, tool invocations with outcomes, assistant messages) and extract atomic, reusable "instincts" — behavioural patterns that would help the assistant act correctly in future similar situations.
3
+
4
+ Respond with ONLY a JSON array (no prose, no code fences, no commentary). Each item must match this schema:
5
+
6
+ {
7
+ "trigger": string, // <= 80 chars, short phrase describing WHEN the instinct applies
8
+ "action": string, // <= 120 chars, short phrase describing WHAT to do
9
+ "confidence": number, // 0..1 — how strongly these observations support the pattern
10
+ "domain": "workflow"|"testing"|"debugging"|"code-style"|"security"|"git"|"project",
11
+ "scope": "project"|"global",
12
+ "evidence": string[] // 1..3 short excerpts copied/paraphrased from the observations
13
+ }
14
+
15
+ Rules:
16
+ - Return [] if nothing clearly reusable. No guessing.
17
+ - At most 3 items, highest confidence first.
18
+ - confidence > 0.7 only when observations show the pattern in action (a correction followed by a successful retry, a repeated sequence, an explicit rule).
19
+ - Never include secrets, tokens, full file contents, or personally-identifying data.
20
+ - Scope "global" only when the pattern is obviously project-agnostic (generic testing, git hygiene); default to "project".`,z={name:`llm`,analyze(e,t){return x(e,t)}}}));function V(e,t){return[...W(e),...G(e),...K(e,t),...q(e)]}function H(e,t){let n=f();return(n.name===`heuristic`?V(e,t):U(n.analyze(e))).map(e=>s(e))}function U(e){if(Array.isArray(e))return e;throw Error(`Active observer backend returned a Promise; use analyzeObservationsAsync instead`)}function W(e){return e.flatMap((t,n)=>{if(t.event!==`user_message`||!t.messageText)return[];let r=t.messageText.trim(),i=X(r);return i?[{...c(t),trigger:i.trigger,action:i.action,confidence:.7,domain:Z(r),source:`session-observation`,scope:`project`,evidence:[r],evidenceOutcome:J(e,n),observationIds:[t.id]}]:[]})}function G(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(r.event!==`tool_complete`||r.outcome!==`failure`)continue;let i=e.slice(n+1,n+6).find(e=>e.event===`tool_complete`&&e.outcome===`success`&&e.toolName===r.toolName);!i||!r.toolName||t.push({...c(r),trigger:`When ${r.toolName} fails during this project`,action:`Use the follow-up successful ${r.toolName} invocation as the resolution pattern before retrying blindly.`,confidence:.5,domain:`debugging`,source:`session-observation`,scope:`project`,evidence:[r.toolOutput??`${r.toolName} failed`,i.toolOutput??`${i.toolName} succeeded`],evidenceOutcome:`success`,observationIds:[r.id,i.id]})}return t}function K(e,t){let n=t?.minRepeatedSequenceCount??Q,r=e.filter(e=>e.event===`tool_start`||e.event===`tool_complete`),i=r.map(e=>e.toolName??``),a=[`Grep`,`Read`,`Edit`],o=[],s=0;for(let e=0;e<=i.length-a.length;e++)a.every((t,n)=>i[e+n]===t)&&(s++,o.push(...r.slice(e,e+a.length).map(e=>e.id)));if(s<n)return[];let l=`Observed ${s} repeated Grep -> Read -> Edit workflow sequences.`,u=r.find(e=>o.includes(e.id)),d=o[o.length-1],f=r.find(e=>e.id===d),p=f?.event===`tool_complete`?f.outcome:void 0;return[{...c(u??e[0]),trigger:`When changing code in this project`,action:`Prefer the Grep -> Read -> Edit workflow: locate symbols, inspect context, then apply the smallest edit.`,confidence:s>=3?.65:.5,domain:`workflow`,source:`session-observation`,scope:`project`,evidence:[l],evidenceOutcome:Y(p),observationIds:Array.from(new Set(o))}]}function q(e){return e.flatMap((t,n)=>{if(t.event!==`user_message`||!t.messageText)return[];let r=t.messageText.trim();return/(项目约定|规范|必须|convention|always|must)/i.test(r)?[{...c(t),trigger:`When working in this project`,action:`Follow the project convention: ${r}`,confidence:.4,domain:`project`,source:`session-observation`,scope:`project`,evidence:[r],evidenceOutcome:J(e,n),observationIds:[t.id]}]:[]})}function J(e,t){for(let n=t-1;n>=0;n--){let t=e[n];if(t.event===`tool_complete`)return Y(t.outcome)}}function Y(e){if(e===`success`||e===`failure`||e===`unknown`)return e}function X(e){let t=/(?:不要|别|不应(?:该)?|不要再)\s*(?<avoid>[^,,。.;;]+)[,,\s]*(?:用|使用|改用|应该用|要用)\s*(?<prefer>[^,,。.;;]+)/i,n=/(?:do not|don't|avoid)\s+(?<avoid>[^,.;]+)[,;\s]+(?:use|prefer)\s+(?<prefer>[^,.;]+)/i,r=/(?:你应该|应该先|must|should)\s*(?<prefer>[^,,。.;;]+)/i,i=e.match(t)??e.match(n);if(i?.groups){let e=i.groups.avoid.trim(),t=i.groups.prefer.trim();return{trigger:`When choosing between ${e} and ${t}`,action:`Prefer ${t}; avoid ${e}.`}}let a=e.match(r);return a?.groups?{trigger:`When this user gives a corrective instruction`,action:`Prefer this corrected action: ${a.groups.prefer.trim()}.`}:null}function Z(e){let t=e.toLowerCase();return/test|mock|testing-library|vitest|jest|bun test/.test(t)?`testing`:/git|commit|branch/.test(t)?`git`:/security|secret|token|password/.test(t)?`security`:/style|format|lint|naming/.test(t)?`code-style`:`project`}var Q,$,ne=e((()=>{a(),v(),B(),Q=2,$={name:`heuristic`,analyze(e,t){return V(e)}},u($),u(z)}));export{B as a,b as c,v as d,u as f,ne as i,p as l,d as m,V as n,z as o,h as p,$ as r,y as s,H as t,f as u};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-DR8-3Aex.js";import{Dn as t,En as n,H as r,Ht as i,K as a,Mn as o,Yn as s,at as c}from"./state-CUZTq6r0.js";import{Jr as l,Qo as u,Zo as d,ei as f}from"./growthbook-p4aJ_UMv.js";import{_ as ee,l as p,p as m}from"./debug-CjIaNjpK.js";import{n as h,t as g}from"./cwd-B2guYBbl.js";import{T as te,r as ne,v as re,w as ie}from"./git-Bj8Ow4pJ.js";import{o as _}from"./log-DVv8YiNo.js";import{r as v}from"./execFileNoThrow-DdmR1mBS.js";import{DF as y,EF as b,In as x,NS as S,Oc as C,Ux as w,Wr as T,XN as E,Zc as D,br as O,dA as k,dw as A,eP as j,fi as M,fs as N,ht as P,i as F,kS as I,li as L,lw as R,nS as z,ni as B,o as V,ps as H,r as U,rS as W,ti as G,uA as K,vt as q,wt as J}from"./loadAgentsDir-Bz0FfcVt.js";import{Tn as Y}from"./prompt-CsBCtw4l.js";import{f as ae,l as oe,t as se}from"./commitAttribution-B0cXmbvv.js";import{O as ce,k as le}from"./teamHelpers-CTA_CtTT.js";import{n as ue,r as de}from"./systemPromptSections-BnrxBWdc.js";import{r as fe}from"./asciicast-HG1EoAQe.js";import{n as pe,r as me,t as he}from"./goalStorage-CsuPOQbk.js";import{dirname as ge}from"path";import{randomUUID as _e}from"crypto";import"fs/promises";var X=new Set;function ve(e){return X.add(e),()=>X.delete(e)}i(),h(),p(),v(),ee(),te(),re(),_(),l(),d();var ye=`github.com:anthropics/claude-cli-internal,github.com/anthropics/claude-cli-internal,github.com:anthropics/anthropic,github.com/anthropics/anthropic,github.com:anthropics/apps,github.com/anthropics/apps,github.com:anthropics/casino,github.com/anthropics/casino,github.com:anthropics/dbt,github.com/anthropics/dbt,github.com:anthropics/dotfiles,github.com/anthropics/dotfiles,github.com:anthropics/terraform-config,github.com/anthropics/terraform-config,github.com:anthropics/hex-export,github.com/anthropics/hex-export,github.com:anthropics/feedback-v2,github.com/anthropics/feedback-v2,github.com:anthropics/labs,github.com/anthropics/labs,github.com:anthropics/argo-rollouts,github.com/anthropics/argo-rollouts,github.com:anthropics/starling-configs,github.com/anthropics/starling-configs,github.com:anthropics/ts-tools,github.com/anthropics/ts-tools,github.com:anthropics/ts-capsules,github.com/anthropics/ts-capsules,github.com:anthropics/feldspar-testing,github.com/anthropics/feldspar-testing,github.com:anthropics/trellis,github.com/anthropics/trellis,github.com:anthropics/claude-for-hiring,github.com/anthropics/claude-for-hiring,github.com:anthropics/forge-web,github.com/anthropics/forge-web,github.com:anthropics/infra-manifests,github.com/anthropics/infra-manifests,github.com:anthropics/mycro_manifests,github.com/anthropics/mycro_manifests,github.com:anthropics/mycro_configs,github.com/anthropics/mycro_configs,github.com:anthropics/mobile-apps,github.com/anthropics/mobile-apps`.split(`,`);function be(){return ne(g())??a()}var Z=null;u(async()=>{if(Z!==null)return Z===`internal`;let e=await ie(be());if(!e)return Z=`none`,!1;let t=ye.some(t=>e.includes(t));return Z=t?`internal`:`external`,t});function xe(){return process.env.CLAUDE_CODE_ENTRYPOINT??`cli`}function Se(){return{fileStates:new Map,sessionBaselines:new Map,surface:xe(),startingHeadSha:null,promptCount:0,promptCountAtLastCommit:0,permissionPromptCount:0,permissionPromptCountAtLastCommit:0,escapeCount:0,escapeCountAtLastCommit:0}}function Ce(e,t){let n={};for(let[t,r]of e.fileStates)n[t]=r;return{type:`attribution-snapshot`,messageId:t,surface:e.surface,fileStates:n,promptCount:e.promptCount,promptCountAtLastCommit:e.promptCountAtLastCommit,permissionPromptCount:e.permissionPromptCount,permissionPromptCountAtLastCommit:e.permissionPromptCountAtLastCommit,escapeCount:e.escapeCount,escapeCountAtLastCommit:e.escapeCountAtLastCommit}}function we(e,t){let n={...e,promptCount:e.promptCount+1};return t(Ce(n,_e())),n}w(),p();var Q=[];function Te(e){if(e&&Q.length>0)for(let t of Q.splice(0))e(t)}function Ee(e){}i(),de(),z(),V(),Y(),k(),j(),oe(),I(),h(),p(),A(),D(),l(),y(),N(),O(),ce(),q();function De(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(!r||r.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=me().safeParse(i.todos);return a.success?a.data:[]}return[]}function Oe(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&R(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),e.attributionSnapshots&&e.attributionSnapshots.length>0&&se(e.attributionSnapshots,e=>{t(t=>({...t,attribution:e}))}),!le()&&e.messages&&e.messages.length>0){let n=De(e.messages);if(n.length>0){let e=c();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function ke(e){if(e.attributionSnapshots&&e.attributionSnapshots.length>0)return ae(e.attributionSnapshots)}function Ae(e,t){if(!(!e&&!t))return{name:e??``,color:t===`default`?void 0:t}}function $(e,i,a){if(i)return{agentDefinition:i,agentType:void 0};if(!e)return t(void 0),{agentDefinition:void 0,agentType:void 0};let o=a.activeAgents.find(t=>t.agentType===e);return o?(t(o.agentType),!r()&&o.model&&o.model!==`inherit`&&n(f(o.model)),{agentDefinition:o,agentType:o.agentType}):(m(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),t(void 0),{agentDefinition:void 0,agentType:void 0})}async function je(e,t,n,r){if(!e)return r;F.cache.clear?.();let i=await F(t),a=[...i.allAgents,...n];return{...i,allAgents:a,activeAgents:U(a)}}function Me(e){let t=P();if(t){M(t);return}if(e){try{process.chdir(e.worktreePath)}catch{M(null);return}H(e.worktreePath),o(g()),J(e),E(),ue(),b.cache.clear?.()}}async function Ne(t,n,r){let i;if(i=r.modeApi?.matchSessionMode(t.mode),i&&t.messages.push(C(i,`warning`)),n.forkSession)t.contentReplacements?.length&&await T(t.contentReplacements);else{let e=n.sessionIdOverride??t.sessionId;e&&(s(K(e),n.transcriptPath?ge(n.transcriptPath):null),await fe(),await G(),W(e))}if(B(n.forkSession?{...t,worktreeSession:void 0}:t),t.goal){let{hydrateGoalFromTranscript:r}=(pe(),e(he)),i=new Map,a=n.sessionIdOverride??t.sessionId??c();i.set(a,t.goal),r(i,a)}n.forkSession||(Me(t.worktreeSession),x());let{agentDefinition:a,agentType:o}=$(t.agentSetting,r.mainThreadAgentDefinition,r.agentDefinitions);L(r.modeApi?.isCoordinatorMode()?`coordinator`:`normal`);let l=n.includeAttribution?ke(t):void 0,u=Ae(t.agentName,t.agentColor);S(t.agentName);let d=await je(!!i,r.currentCwd,r.cliAgents,r.agentDefinitions);return{messages:t.messages,fileHistorySnapshots:t.fileHistorySnapshots,contentReplacements:t.contentReplacements,agentName:t.agentName,agentColor:t.agentColor===`default`?void 0:t.agentColor,restoredAgentDef:a,initialState:{...r.initialState,...o&&{agent:o},...l&&{attribution:l},...u&&{standaloneAgentContext:u},agentDefinitions:d}}}export{Ee as a,ve as c,Te as i,$ as n,Se as o,Oe as r,we as s,Ne as t};
@@ -0,0 +1 @@
1
+ import{s as e,u as t}from"./envUtils-CFG7IQID.js";import{C as n,a as r,r as i,w as a}from"./rcDebugLog-BbHlIxCm.js";i(),e(),a();var o=null,s=null,c=null;function l(e){o=e}function u(e,t){if(s=e,!e||!t?.replayCurrent)return;let n=_();Object.keys(n).length!==0&&e(n)}var d=!1,f=null,p={};function m(e){return!e||e.enabled!==!0?null:{enabled:!0,phase:e.phase===`standby`||e.phase===`sleeping`?e.phase:null,next_tick_at:typeof e.next_tick_at==`number`?e.next_tick_at:null,sleep_until:typeof e.sleep_until==`number`?e.sleep_until:null}}function h(e){return JSON.stringify(e)}function g(e){let t={...p};for(let n of Object.keys(e)){let r=e[n];if(r===void 0){delete t[n];continue}t[n]=r}p=t}function _(){let e={...p};return f?e.automation_state={...f}:`automation_state`in p&&(e.automation_state=p.automation_state??null),e}function v(e,i){o?.(e,i),e===`requires_action`&&i?(d=!0,y({pending_action:i})):d&&(d=!1,y({pending_action:null})),e===`idle`&&y({task_summary:null}),e!==`idle`&&b(r()?{enabled:!0,phase:null,next_tick_at:null,sleep_until:null}:null),t(process.env.CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS)&&n({type:`system`,subtype:`session_state_changed`,state:e})}function y(e){g(e),s?.(e)}function b(e){let t=m(e);h(t)!==h(f)&&(f=t,g({automation_state:t}),s?.({automation_state:t}))}function x(e){c?.(e)}export{u as a,v as i,x as n,l as o,y as r,b as t};
@@ -0,0 +1 @@
1
+ import{Xr as e,br as t}from"./loadAgentsDir-Bz0FfcVt.js";t();export{e as recordTranscript};
@@ -0,0 +1 @@
1
+ import{mh as e,uh as t}from"./loadAgentsDir-Bz0FfcVt.js";t();export{e as linkSessionToPR};
@@ -0,0 +1,3 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-CFG7IQID.js";import{i as r,t as i}from"./hash-KW-tVnPp.js";import{join as a}from"path";import{open as o,readdir as s,realpath as c,stat as l}from"fs/promises";import{promisify as u}from"util";import{execFile as d}from"child_process";async function f(e){try{let{stdout:t}=await p(`git`,[`worktree`,`list`,`--porcelain`],{cwd:e,timeout:5e3});return t?t.split(`
2
+ `).filter(e=>e.startsWith(`worktree `)).map(e=>e.slice(9).normalize(`NFC`)):[]}catch{return[]}}var p,m=e((()=>{p=u(d)}));function h(e){return typeof e==`string`&&B.test(e)?e:null}function g(e){if(!e.includes(`\\`))return e;try{return JSON.parse(`"${e}"`)}catch{return e}}function _(e,t){let n=[`"${t}":"`,`"${t}": "`];for(let t of n){let n=e.indexOf(t);if(n<0)continue;let r=n+t.length,i=r;for(;i<e.length;){if(e[i]===`\\`){i+=2;continue}if(e[i]===`"`)return g(e.slice(r,i));i++}}}function v(e,t){let n=[`"${t}":"`,`"${t}": "`],r;for(let t of n){let n=0;for(;;){let i=e.indexOf(t,n);if(i<0)break;let a=i+t.length,o=a;for(;o<e.length;){if(e[o]===`\\`){o+=2;continue}if(e[o]===`"`){r=g(e.slice(a,o));break}o++}n=o+1}}return r}function y(e){let t=0,n=``;for(;t<e.length;){let r=e.indexOf(`
3
+ `,t),i=r>=0?e.slice(t,r):e.slice(t);if(t=r>=0?r+1:e.length,!(!i.includes(`"type":"user"`)&&!i.includes(`"type": "user"`))&&!i.includes(`"tool_result"`)&&!(i.includes(`"isMeta":true`)||i.includes(`"isMeta": true`))&&!(i.includes(`"isCompactSummary":true`)||i.includes(`"isCompactSummary": true`)))try{let e=JSON.parse(i);if(e.type!==`user`)continue;let t=e.message;if(!t)continue;let r=t.content,a=[];if(typeof r==`string`)a.push(r);else if(Array.isArray(r))for(let e of r)e.type===`text`&&typeof e.text==`string`&&a.push(e.text);for(let e of a){let t=e.replace(/\n/g,` `).trim();if(!t)continue;let r=H.exec(t);if(r){n||(n=r[1]);continue}let i=/<bash-input>([\s\S]*?)<\/bash-input>/.exec(t);if(i)return`! ${i[1].trim()}`;if(!V.test(t))return t.length>200&&(t=t.slice(0,200).trim()+`…`),t}}catch{}}return n||``}async function b(e,t,n){try{let r=await o(e,`r`);try{let e=await r.read(n,0,z,0);if(e.bytesRead===0)return{head:``,tail:``};let i=n.toString(`utf8`,0,e.bytesRead),a=Math.max(0,t-z),o=i;if(a>0){let e=await r.read(n,0,z,a);o=n.toString(`utf8`,0,e.bytesRead)}return{head:i,tail:o}}finally{await r.close()}}catch{return{head:``,tail:``}}}async function x(e){try{let t=await o(e,`r`);try{let e=await t.stat(),n=Buffer.allocUnsafe(z),r=await t.read(n,0,z,0);if(r.bytesRead===0)return null;let i=n.toString(`utf8`,0,r.bytesRead),a=Math.max(0,e.size-z),o=i;if(a>0){let e=await t.read(n,0,z,a);o=n.toString(`utf8`,0,e.bytesRead)}return{mtime:e.mtime.getTime(),size:e.size,head:i,tail:o}}finally{await t.close()}}catch{return null}}function S(e){return Math.abs(i(e)).toString(36)}function C(e){let t=e.replace(/[^a-zA-Z0-9]/g,`-`);if(t.length<=200)return t;let n=typeof Bun<`u`?Bun.hash(e).toString(36):S(e);return`${t.slice(0,200)}-${n}`}function w(){return a(t(),`projects`)}function T(e){return a(w(),C(e))}async function E(e){try{return(await c(e)).normalize(`NFC`)}catch{return e.normalize(`NFC`)}}async function D(e){let t=T(e);try{return await s(t),t}catch{let t=C(e);if(t.length<=200)return;let n=t.slice(0,200),r=w();try{let e=(await s(r,{withFileTypes:!0})).find(e=>e.isDirectory()&&e.name.startsWith(n+`-`));return e?a(r,e.name):void 0}catch{return}}}async function O(e,t){let n=`${e}.jsonl`;if(t){let e=await E(t),r=await D(e);if(r){let t=a(r,n);try{let n=await l(t);if(n.size>0)return{filePath:t,projectPath:e,fileSize:n.size}}catch{}}let i;try{i=await f(e)}catch{i=[]}for(let t of i){if(t===e)continue;let r=await D(t);if(!r)continue;let i=a(r,n);try{let e=await l(i);if(e.size>0)return{filePath:i,projectPath:t,fileSize:e.size}}catch{}}return}let r=w(),i;try{i=await s(r)}catch{return}for(let e of i){let t=a(r,e,n);try{let e=await l(t);if(e.size>0)return{filePath:t,projectPath:void 0,fileSize:e.size}}catch{}}}function k(){return G??(G=Buffer.from(`"compact_boundary"`))}function A(e){try{let t=JSON.parse(e);return t.type!==`system`||t.subtype!==`compact_boundary`?null:{hasPreservedSegment:!!t.compactMetadata?.preservedSegment}}catch{return null}}function j(e,t,n,r){let i=r-n;if(!(i<=0)){if(e.len+i>e.buf.length){let t=Buffer.allocUnsafe(Math.min(Math.max(e.buf.length*2,e.len+i),e.cap));e.buf.copy(t,0,0,e.len),e.buf=t}t.copy(e.buf,e.len,n,r),e.len+=i}}function M(e,t,n,r){return r-n>=t.length&&e.compare(t,0,t.length,n,n+t.length)===0}function N(e,t,n){if(e.straddleSnapCarryLen=0,e.straddleSnapTailEnd=0,e.carryLen===0)return 0;let r=e.carryBuf,i=t.indexOf(J);if(i===-1||i>=n)return 0;let a=i+1;if(M(r,K,0,e.carryLen))e.straddleSnapCarryLen=e.carryLen,e.straddleSnapTailEnd=a,e.lastSnapSrc=null;else if(e.carryLen<K.length)return 0;else{if(M(r,q,0,e.carryLen)){let n=A(r.toString(`utf-8`,0,e.carryLen)+t.toString(`utf-8`,0,i));n?.hasPreservedSegment?e.hasPreservedSegment=!0:n&&(e.out.len=0,e.boundaryStartOffset=e.bufFileOff,e.hasPreservedSegment=!1,e.lastSnapSrc=null)}j(e.out,r,0,e.carryLen),j(e.out,t,0,a)}return e.bufFileOff+=e.carryLen+a,e.carryLen=0,a}function P(e,t,n){let r=t.indexOf(n),i=0,a=0,o=-1,s=-1,c=t.indexOf(J);for(;c!==-1;){let l=c+1;if(r!==-1&&r<a&&(r=t.indexOf(n,a)),M(t,K,a,l))j(e.out,t,i,a),o=a,s=l,i=l;else if(r>=a&&r<Math.min(a+X,l)){let s=A(t.toString(`utf-8`,a,c));s?.hasPreservedSegment?e.hasPreservedSegment=!0:s&&(e.out.len=0,e.boundaryStartOffset=e.bufFileOff+a,e.hasPreservedSegment=!1,e.lastSnapSrc=null,o=-1,e.straddleSnapCarryLen=0,i=a),r=t.indexOf(n,r+n.length)}a=l,c=t.indexOf(J,a)}return j(e.out,t,i,a),{lastSnapStart:o,lastSnapEnd:s,trailStart:a}}function F(e,t,n,r,i){r===-1?e.straddleSnapCarryLen>0&&(e.lastSnapLen=e.straddleSnapCarryLen+e.straddleSnapTailEnd,(e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)&&(e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen)),e.carryBuf.copy(e.lastSnapBuf,0,0,e.straddleSnapCarryLen),n.copy(e.lastSnapBuf,e.straddleSnapCarryLen,0,e.straddleSnapTailEnd),e.lastSnapSrc=e.lastSnapBuf):(e.lastSnapLen=i-r,(e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)&&(e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen)),t.copy(e.lastSnapBuf,0,r,i),e.lastSnapSrc=e.lastSnapBuf)}function I(e,t,n){e.carryLen=t.length-n,e.carryLen>0&&((e.carryBuf===void 0||e.carryLen>e.carryBuf.length)&&(e.carryBuf=Buffer.allocUnsafe(e.carryLen)),t.copy(e.carryBuf,0,n,t.length))}function L(e){if(e.carryLen>0){let t=e.carryBuf;M(t,K,0,e.carryLen)?(e.lastSnapSrc=t,e.lastSnapLen=e.carryLen):j(e.out,t,0,e.carryLen)}e.lastSnapSrc&&(e.out.len>0&&e.out.buf[e.out.len-1]!==J&&j(e.out,Y,0,1),j(e.out,e.lastSnapSrc,0,e.lastSnapLen))}async function R(e,t){let n=k(),r=U,i={out:{buf:Buffer.allocUnsafe(Math.min(t,8*1024*1024)),len:0,cap:t+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},a=Buffer.allocUnsafe(r),s=await o(e,`r`);try{let e=0;for(;e<t;){let{bytesRead:o}=await s.read(a,0,Math.min(r,t-e),e);if(o===0)break;e+=o;let c=N(i,a,o),l;if(i.carryLen>0){let e=i.carryLen+(o-c);l=Buffer.allocUnsafe(e),i.carryBuf.copy(l,0,0,i.carryLen),a.copy(l,i.carryLen,c,o)}else l=a.subarray(c,o);let u=P(i,l,n);F(i,l,a,u.lastSnapStart,u.lastSnapEnd),I(i,l,u.trailStart),i.bufFileOff+=u.trailStart}L(i)}finally{await s.close()}return{boundaryStartOffset:i.boundaryStartOffset,postBoundaryBuf:i.out.buf.subarray(0,i.out.len),hasPreservedSegment:i.hasPreservedSegment}}var z,B,V,H,U,W,G,K,q,J,Y,X,Z=e((()=>{n(),m(),r(),z=65536,B=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,V=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,H=/<command-name>(.*?)<\/command-name>/,U=1024*1024,W=5*1024*1024,K=Buffer.from(`{"type":"attribution-snapshot"`),q=Buffer.from(`{"type":"system"`),J=10,Y=Buffer.from([J]),X=256}));export{m as _,_ as a,w as c,x as d,R as f,f as g,h,y as i,Z as l,C as m,W as n,v as o,O as p,E as r,D as s,z as t,b as u};
@@ -0,0 +1,14 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ln as t,wn as n}from"./schemas-Bwt-7U5W.js";import{t as r}from"./v4-DLhvDPkt.js";import{Ht as i,N as a}from"./state-CUZTq6r0.js";import{l as o,p as s}from"./debug-CjIaNjpK.js";import{s as c,u as l}from"./types-BVelRhgb.js";import{n as u,r as d}from"./analytics-i6X1et4O.js";import{n as f,t as p}from"./lazySchema-2sOku3cX.js";import{Pc as m,X as h,Z as g,Zc as _,dN as v}from"./loadAgentsDir-Bz0FfcVt.js";import{H as y}from"./rcDebugLog-BbHlIxCm.js";function b(e){let t=[];for(let n of e){if(n.type!==`user`&&n.type!==`assistant`||`isMeta`in n&&n.isMeta||`origin`in n&&n.origin&&n.origin.kind!==`human`)continue;let e=n.message.content;if(typeof e==`string`)t.push(e);else if(Array.isArray(e))for(let n of e)`type`in n&&n.type===`text`&&`text`in n&&t.push(n.text)}let n=t.join(`
2
+ `);return n.length>S?n.slice(-S):n}async function x(e,t){let n=e.trim();if(!n)return null;try{let e=m((await g({systemPrompt:y([C]),userPrompt:n,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{title:{type:`string`}},required:[`title`],additionalProperties:!1}},signal:t,options:{querySource:`generate_session_title`,agents:[],isNonInteractiveSession:a(),hasAppendSystemPrompt:!1,mcpTools:[]}})).message.content),r=w().safeParse(l(e)),i=r.success&&r.data.title.trim()||null;return d(`tengu_session_title_generated`,{success:i!==null}),i}catch(e){return s(`generateSessionTitle failed: ${e}`,{level:`error`}),d(`tengu_session_title_generated`,{success:!1}),null}}var S,C,w,T=e((()=>{r(),i(),u(),h(),o(),c(),p(),_(),v(),S=1e3,C=`Generate a concise, sentence-case title (3-7 words) that captures the main topic or goal of this coding session. The title should be clear enough that the user recognizes the session in a list. Use sentence case: capitalize only the first word and proper nouns.
3
+
4
+ Return JSON with a single "title" field.
5
+
6
+ Good examples:
7
+ {"title": "Fix login button on mobile"}
8
+ {"title": "Add OAuth authentication"}
9
+ {"title": "Debug failing CI tests"}
10
+ {"title": "Refactor API client error handling"}
11
+
12
+ Bad (too vague): {"title": "Code changes"}
13
+ Bad (too long): {"title": "Investigate and fix the issue where the login button does not respond on mobile devices"}
14
+ Bad (wrong case): {"title": "Fix Login Button On Mobile"}`,w=f(()=>n({title:t()}))}));export{x as n,T as r,b as t};
@@ -0,0 +1,12 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{s as r,u as i}from"./envUtils-CFG7IQID.js";import{n as a,r as o,s}from"./esm-BwzC0MQp.js";import{Ht as c,N as l,at as u}from"./state-CUZTq6r0.js";import{Ha as d,Sr as f,Wa as p,_s as m,l as h,m as g,nt as _,ps as ee,q as te,xr as ne}from"./growthbook-p4aJ_UMv.js";import{D as re,E as ie,O as v,U as ae,_ as oe,h as se,l as ce,p as le}from"./debug-CjIaNjpK.js";import{D as ue,L as de,j as fe,u as pe}from"./state-BQkyHx88.js";import{i as me,t as he}from"./hash-KW-tVnPp.js";import{o as ge,s as y}from"./log-DVv8YiNo.js";import{i as _e,l as ve,n as ye,t as be}from"./teammate-C-FiRloZ.js";import{release as xe}from"os";import"path";import"fs";import{createHash as Se}from"crypto";import{readFile as Ce}from"fs/promises";import{AsyncLocalStorage as we}from"async_hooks";function Te(e){let t=BigInt(58),n=Array(x).fill(b[0]),r=x-1,i=e;for(;i>0n;)n[r]=b[Number(i%t)],i/=t,r--;return n.join(``)}function Ee(e){let t=e.replace(/-/g,``);if(t.length!==32)throw Error(`Invalid UUID hex length: ${t.length}`);return BigInt(`0x`+t)}function De(e,t){return`${e}_${Oe}${Te(Ee(t))}`}var b,Oe,x,ke=e((()=>{b=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,Oe=`01`,x=22}));function S(e){let t=Ae[e],n=process.env[e];return n===void 0?t:i(n)}function C(){let e=ee(),t=fe(),n={"user.id":e};S(`OTEL_METRICS_INCLUDE_SESSION_ID`)&&(n[`session.id`]=t),S(`OTEL_METRICS_INCLUDE_VERSION`)&&(n[`app.version`]=`2.8.4`);let r=te();if(r){let e=r.organizationUuid,t=r.emailAddress,i=r.accountUuid;e&&(n[`organization.id`]=e),t&&(n[`user.email`]=t),i&&S(`OTEL_METRICS_INCLUDE_ACCOUNT_UUID`)&&(n[`user.account_uuid`]=i,n[`user.account_id`]=process.env.CLAUDE_CODE_ACCOUNT_TAGGED_ID||De(`user`,i))}return d.terminal&&(n[`terminal.type`]=d.terminal),n}var Ae,w=e((()=>{de(),_(),m(),p(),r(),ke(),Ae={OTEL_METRICS_INCLUDE_SESSION_ID:!0,OTEL_METRICS_INCLUDE_VERSION:!1,OTEL_METRICS_INCLUDE_ACCOUNT_UUID:!0}}));function je(){return i(process.env.OTEL_LOG_USER_PROMPTS)}function Me(e){return je()?e:`<REDACTED>`}async function T(e,t={}){let n=pe();if(!n){E||(E=!0,le(`[3P telemetry] Event dropped (no event logger initialized): ${e}`,{level:`warn`}));return}let r={...C(),"event.name":e,"event.timestamp":new Date().toISOString(),"event.sequence":Ne++},i=ue();i&&(r[`prompt.id`]=i);let a=process.env.CLAUDE_CODE_WORKSPACE_HOST_PATHS;a&&(r[`workspace.host_paths`]=a.split(`|`));for(let[e,n]of Object.entries(t))n!==void 0&&(r[e]=n);n.emit({body:`claude_code.${e}`,attributes:r})}var Ne,E,Pe=e((()=>{de(),ce(),r(),w(),Ne=0,E=!1})),Fe,Ie,Le=e((()=>{n(),oe(),ge(),Fe=t(()=>{try{if(process.platform===`darwin`)return`macos`;if(process.platform===`win32`)return`windows`;if(process.platform===`linux`){try{let e=se().readFileSync(`/proc/version`,{encoding:`utf8`});if(e.toLowerCase().includes(`microsoft`)||e.toLowerCase().includes(`wsl`))return`wsl`}catch(e){y(e)}return`linux`}return`unknown`}catch(e){return y(e),`unknown`}}),Ie=t(()=>{if(process.platform===`linux`)try{let e=se().readFileSync(`/proc/version`,{encoding:`utf8`}),t=e.match(/WSL(\d+)/i);return t&&t[1]?t[1]:e.toLowerCase().includes(`microsoft`)?`1`:void 0}catch(e){y(e);return}}),t(async()=>{if(process.platform!==`linux`)return;let e={linuxKernel:xe()};try{let t=await Ce(`/etc/os-release`,`utf8`);for(let n of t.split(`
2
+ `)){let t=n.match(/^(ID|VERSION_ID)=(.*)$/);if(t&&t[1]&&t[2]){let n=t[2].replace(/^"|"$/g,``);t[1]===`ID`?e.linuxDistroId=n:e.linuxDistroVersion=n}}}catch{}return e})}));function Re(e){return Math.abs(he(e))||1}function ze(e){let t=R.get(e);return t===void 0?(L++,R.set(e,L),L):t}function D(){let e=be()??u(),t=ye()??`main`,n=_e(),r=F.get(e);if(r)return r;let i={agentId:e,agentName:t,parentAgentId:n,processId:e===u()?1:ze(e),threadId:Re(t)};return F.set(e,i),I++,i}function O(){return(Date.now()-Qe)*1e3}function k(){return`span_${++$e}`}function Be(){let e=process.env.CLAUDE_CODE_PERFETTO_TRACE;le(`[Perfetto] initializePerfettoTracing called, env value: ${e}`)}function Ve(e){j&&(M.push({name:`process_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{name:e.agentName}}),M.push({name:`thread_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:e.threadId,args:{name:e.agentName}}),e.parentAgentId&&M.push({name:`parent_agent`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{parent_agent_id:e.parentAgentId}}))}function A(){return j}function He(e,t,n){if(!j)return;let r={agentId:e,agentName:t,parentAgentId:n,processId:ze(e),threadId:Re(t)};F.set(e,r),I++,Ve(r)}function Ue(e){j&&(F.delete(e),R.delete(e))}function We(e){if(!j)return``;let t=k(),n=D();return P.set(t,{name:`API Call`,category:`api`,startTime:O(),agentInfo:n,args:{model:e.model,prompt_tokens:e.promptTokens,message_id:e.messageId,is_speculative:e.isSpeculative??!1,query_source:e.querySource}}),N.push({name:`API Call`,cat:`api`,ph:`B`,ts:P.get(t).startTime,pid:n.processId,tid:n.threadId,args:P.get(t).args}),t}function Ge(e,t){if(!j||!e)return;let n=P.get(e);if(!n)return;let r=O(),i=r-n.startTime,a=t.promptTokens??n.args.prompt_tokens,o=t.ttftMs,s=t.ttltMs,c=t.outputTokens,l=t.cacheReadTokens,u=o!==void 0&&a!==void 0&&o>0?Math.round(a/(o/1e3)*100)/100:void 0,d=s!==void 0&&o!==void 0?s-o:void 0,f=d!==void 0&&c!==void 0&&d>0?Math.round(c/(d/1e3)*100)/100:void 0,p=l!==void 0&&a!==void 0&&a>0?Math.round(l/a*1e4)/100:void 0,m=t.requestSetupMs,h=t.attemptStartTimes,g={...n.args,ttft_ms:o,ttlt_ms:s,prompt_tokens:a,output_tokens:c,cache_read_tokens:l,cache_creation_tokens:t.cacheCreationTokens,message_id:t.messageId??n.args.message_id,success:t.success??!0,error:t.error,duration_ms:i/1e3,request_setup_ms:m,itps:u,otps:f,cache_hit_rate_pct:p},_=m!==void 0&&m>0?m*1e3:0;if(_>0){let e=n.startTime+_;if(N.push({name:`Request Setup`,cat:`api,setup`,ph:`B`,ts:n.startTime,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{request_setup_ms:m,attempt_count:h?.length??1}}),h&&h.length>1){let e=h[0];for(let t=0;t<h.length-1;t++){let r=n.startTime+(h[t]-e)*1e3,i=n.startTime+(h[t+1]-e)*1e3;N.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`B`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{attempt:t+1}}),N.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`E`,ts:i,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}}N.push({name:`Request Setup`,cat:`api,setup`,ph:`E`,ts:e,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}if(o!==void 0){let e=n.startTime+_,t=e+o*1e3;N.push({name:`First Token`,cat:`api,ttft`,ph:`B`,ts:e,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{ttft_ms:o,prompt_tokens:a,itps:u,cache_hit_rate_pct:p}}),N.push({name:`First Token`,cat:`api,ttft`,ph:`E`,ts:t,pid:n.agentInfo.processId,tid:n.agentInfo.threadId});let r=s===void 0?void 0:s-o-_/1e3;r!==void 0&&r>0&&(N.push({name:`Sampling`,cat:`api,sampling`,ph:`B`,ts:t,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{sampling_ms:r,output_tokens:c,otps:f}}),N.push({name:`Sampling`,cat:`api,sampling`,ph:`E`,ts:t+r*1e3,pid:n.agentInfo.processId,tid:n.agentInfo.threadId}))}N.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:g}),P.delete(e)}function Ke(e,t){if(!j)return``;let n=k(),r=D();return P.set(n,{name:`Tool: ${e}`,category:`tool`,startTime:O(),agentInfo:r,args:{tool_name:e,...t}}),N.push({name:`Tool: ${e}`,cat:`tool`,ph:`B`,ts:P.get(n).startTime,pid:r.processId,tid:r.threadId,args:P.get(n).args}),n}function qe(e,t){if(!j||!e)return;let n=P.get(e);if(!n)return;let r=O(),i=r-n.startTime,a={...n.args,success:t?.success??!0,error:t?.error,result_tokens:t?.resultTokens,duration_ms:i/1e3};N.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),P.delete(e)}function Je(e){if(!j)return``;let t=k(),n=D();return P.set(t,{name:`Waiting for User Input`,category:`user_input`,startTime:O(),agentInfo:n,args:{context:e}}),N.push({name:`Waiting for User Input`,cat:`user_input`,ph:`B`,ts:P.get(t).startTime,pid:n.processId,tid:n.threadId,args:P.get(t).args}),t}function Ye(e,t){if(!j||!e)return;let n=P.get(e);if(!n)return;let r=O(),i=r-n.startTime,a={...n.args,decision:t?.decision,source:t?.source,duration_ms:i/1e3};N.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),P.delete(e)}function Xe(e){if(!j)return``;let t=k(),n=D();return P.set(t,{name:`Interaction`,category:`interaction`,startTime:O(),agentInfo:n,args:{user_prompt_length:e?.length}}),N.push({name:`Interaction`,cat:`interaction`,ph:`B`,ts:P.get(t).startTime,pid:n.processId,tid:n.threadId,args:P.get(t).args}),t}function Ze(e){if(!j||!e)return;let t=P.get(e);if(!t)return;let n=O(),r=n-t.startTime;N.push({name:t.name,cat:t.category,ph:`E`,ts:n,pid:t.agentInfo.processId,tid:t.agentInfo.threadId,args:{...t.args,duration_ms:r/1e3}}),P.delete(e)}var j,M,N,P,F,I,Qe,$e,L,R,et=e((()=>{c(),ce(),r(),ae(),me(),ie(),ve(),j=!1,M=[],N=[],P=new Map,F=new Map,I=0,Qe=0,$e=0,L=1,R=new Map}));function tt(){U.clear(),W.clear()}function z(){return i(process.env.ENABLE_BETA_TRACING_DETAILED)&&process.env.BETA_TRACING_ENDPOINT?process.env.USER_TYPE===`ant`?!0:l()||h(`tengu_trace_lantern`,!1):!1}function B(e,t=ut){return e.length<=t?{content:e,truncated:!1}:{content:e.slice(0,t)+`
3
+
4
+ [TRUNCATED - Content exceeds 60KB limit]`,truncated:!0}}function V(e){return Se(`sha256`).update(e).digest(`hex`).slice(0,12)}function nt(e){return`sp_${V(e)}`}function rt(e){return`msg_${V(v(e.message.content))}`}function H(e){let t=e.trim().match(dt);return t&&t[1]?t[1].trim():null}function it(e){let t=[],n=[];for(let r of e){let e=r.message.content;if(typeof e==`string`){let r=H(e);r?n.push(r):t.push(`[USER]\n${e}`)}else if(Array.isArray(e)){for(let r of e)if(r.type===`text`){let e=H(r.text);e?n.push(e):t.push(`[USER]\n${r.text}`)}else if(r.type===`tool_result`){let e=typeof r.content==`string`?r.content:v(r.content),i=H(e);i?n.push(i):t.push(`[TOOL RESULT: ${r.tool_use_id}]\n${e}`)}}}return{contextParts:t,systemReminders:n}}function at(e,t){if(!z())return;let{content:n,truncated:r}=B(`[USER PROMPT]\n${t}`);e.setAttributes({new_context:n,...r&&{new_context_truncated:!0,new_context_original_length:t.length}})}function ot(e,t,n){if(z()){if(t?.systemPrompt){let n=nt(t.systemPrompt),r=t.systemPrompt.slice(0,500);if(e.setAttribute(`system_prompt_hash`,n),e.setAttribute(`system_prompt_preview`,r),e.setAttribute(`system_prompt_length`,t.systemPrompt.length),!U.has(n)){U.add(n);let{content:e,truncated:r}=B(t.systemPrompt);T(`system_prompt`,{system_prompt_hash:n,system_prompt:e,system_prompt_length:String(t.systemPrompt.length),...r&&{system_prompt_truncated:`true`}})}}if(t?.tools)try{let n=re(t.tools).map(e=>{let t=v(e),n=V(t);return{name:typeof e.name==`string`?e.name:`unknown`,hash:n,json:t}});e.setAttribute(`tools`,v(n.map(({name:e,hash:t})=>({name:e,hash:t})))),e.setAttribute(`tools_count`,n.length);for(let{name:e,hash:t,json:r}of n)if(!U.has(`tool_${t}`)){U.add(`tool_${t}`);let{content:n,truncated:i}=B(r);T(`tool`,{tool_name:f(e),tool_hash:t,tool:n,...i&&{tool_truncated:`true`}})}}catch{e.setAttribute(`tools_parse_error`,!0)}if(n&&n.length>0&&t?.querySource){let r=t.querySource,i=W.get(r),a=0;if(i)for(let e=0;e<n.length;e++){let t=n[e];if(t&&rt(t)===i){a=e+1;break}}let o=n.slice(a).filter(e=>e.type===`user`);if(o.length>0){let{contextParts:t,systemReminders:i}=it(o);if(t.length>0){let n=t.join(`
5
+
6
+ ---
7
+
8
+ `),{content:r,truncated:i}=B(n);e.setAttributes({new_context:r,new_context_message_count:o.length,...i&&{new_context_truncated:!0,new_context_original_length:n.length}})}if(i.length>0){let t=i.join(`
9
+
10
+ ---
11
+
12
+ `),{content:n,truncated:r}=B(t);e.setAttributes({system_reminders:n,system_reminders_count:i.length,...r&&{system_reminders_truncated:!0,system_reminders_original_length:t.length}})}let a=n[n.length-1];a&&W.set(r,rt(a))}}}}function st(e,t){if(!(!z()||!t)){if(t.modelOutput!==void 0){let{content:n,truncated:r}=B(t.modelOutput);e[`response.model_output`]=n,r&&(e[`response.model_output_truncated`]=!0,e[`response.model_output_original_length`]=t.modelOutput.length)}if(process.env.USER_TYPE===`ant`&&t.thinkingOutput!==void 0){let{content:n,truncated:r}=B(t.thinkingOutput);e[`response.thinking_output`]=n,r&&(e[`response.thinking_output_truncated`]=!0,e[`response.thinking_output_original_length`]=t.thinkingOutput.length)}}}function ct(e,t,n){if(!z())return;let{content:r,truncated:i}=B(`[TOOL INPUT: ${t}]\n${n}`);e.setAttributes({tool_input:r,...i&&{tool_input_truncated:!0,tool_input_original_length:n.length}})}function lt(e,t,n){if(!z())return;let{content:r,truncated:i}=B(`[TOOL RESULT: ${t}]\n${n}`);e.new_context=r,i&&(e.new_context_truncated=!0,e.new_context_original_length=n.length)}var U,W,ut,dt,ft=e((()=>{c(),g(),ne(),r(),ie(),Pe(),U=new Set,W=new Map,ut=60*1024,dt=/^<system-reminder>\n?([\s\S]*?)\n?<\/system-reminder>$/}));function G(e){return e.spanContext().spanId||``}function pt(){if(Ot)return;Ot=!0;let e=setInterval(()=>{let e=Date.now()-kt;for(let[t,n]of Z){let r=n.deref();r===void 0?(Z.delete(t),Q.delete(t)):r.startTime<e&&(r.ended||r.span.end(),Z.delete(t),Q.delete(t))}},6e4);typeof e.unref==`function`&&e.unref()}function mt(){return!1}function K(){return mt()||z()}function q(){return o.getTracer(`com.anthropic.claude_code.tracing`,`1.0.0`)}function J(e,t={}){return{...C(),"span.type":e,...t}}function ht(e){pt();let t=A()?Xe(e):void 0;if(!K()){if(t){let e=o.getActiveSpan()||q().startSpan(`dummy`),n=G(e),r={span:e,startTime:Date.now(),attributes:{},perfettoSpanId:t};return Z.set(n,new WeakRef(r)),Y.enterWith(r),e}return o.getActiveSpan()||q().startSpan(`dummy`)}let n=q(),r=i(process.env.OTEL_LOG_USER_PROMPTS)?e:`<REDACTED>`;$++;let a=J(`interaction`,{user_prompt:r,user_prompt_length:e.length,"interaction.sequence":$}),s=n.startSpan(`claude_code.interaction`,{attributes:a});at(s,e);let c=G(s),l={span:s,startTime:Date.now(),attributes:a,perfettoSpanId:t};return Z.set(c,new WeakRef(l)),Y.enterWith(l),s}function gt(){let e=Y.getStore();if(!e||e.ended)return;if(e.perfettoSpanId&&Ze(e.perfettoSpanId),!K()){e.ended=!0,Z.delete(G(e.span)),Y.enterWith(void 0);return}let t=Date.now()-e.startTime;e.span.setAttributes({"interaction.duration_ms":t}),e.span.end(),e.ended=!0,Z.delete(G(e.span)),Y.enterWith(void 0)}function _t(e,t,n,r){let i=A()?We({model:e,querySource:t?.querySource,messageId:void 0}):void 0;if(!K()){if(i){let t=o.getActiveSpan()||q().startSpan(`dummy`),n=G(t),r={span:t,startTime:Date.now(),attributes:{model:e},perfettoSpanId:i};return Z.set(n,new WeakRef(r)),Q.set(n,r),t}return o.getActiveSpan()||q().startSpan(`dummy`)}let a=q(),c=Y.getStore(),l=J(`llm_request`,{model:e,"llm_request.context":c?`interaction`:`standalone`,speed:r?`fast`:`normal`}),u=c?o.setSpan(s.active(),c.span):s.active(),d=a.startSpan(`claude_code.llm_request`,{attributes:l},u);t?.querySource&&d.setAttribute(`query_source`,t.querySource),ot(d,t,n);let f=G(d),p={span:d,startTime:Date.now(),attributes:l,perfettoSpanId:i};return Z.set(f,new WeakRef(p)),Q.set(f,p),d}function vt(e,t,n){let r=A()?Ke(e,t):void 0;if(!K()){if(r){let t=o.getActiveSpan()||q().startSpan(`dummy`),n=G(t),i={span:t,startTime:Date.now(),attributes:{"span.type":`tool`,tool_name:e},perfettoSpanId:r};return Z.set(n,new WeakRef(i)),X.enterWith(i),t}return o.getActiveSpan()||q().startSpan(`dummy`)}let i=q(),a=Y.getStore(),c=J(`tool`,{tool_name:e,...t}),l=a?o.setSpan(s.active(),a.span):s.active(),u=i.startSpan(`claude_code.tool`,{attributes:c},l);n&&ct(u,e,n);let d=G(u),f={span:u,startTime:Date.now(),attributes:c,perfettoSpanId:r};return Z.set(d,new WeakRef(f)),X.enterWith(f),u}function yt(){let e=A()?Je(`tool_permission`):void 0;if(!K()){if(e){let t=o.getActiveSpan()||q().startSpan(`dummy`),n=G(t),r={span:t,startTime:Date.now(),attributes:{"span.type":`tool.blocked_on_user`},perfettoSpanId:e};return Z.set(n,new WeakRef(r)),Q.set(n,r),t}return o.getActiveSpan()||q().startSpan(`dummy`)}let t=q(),n=X.getStore(),r=J(`tool.blocked_on_user`),i=n?o.setSpan(s.active(),n.span):s.active(),a=t.startSpan(`claude_code.tool.blocked_on_user`,{attributes:r},i),c=G(a),l={span:a,startTime:Date.now(),attributes:r,perfettoSpanId:e};return Z.set(c,new WeakRef(l)),Q.set(c,l),a}function bt(e,t){let n=Array.from(Z.values()).findLast(e=>e.deref()?.attributes[`span.type`]===`tool.blocked_on_user`)?.deref();if(!n)return;if(n.perfettoSpanId&&Ye(n.perfettoSpanId,{decision:e,source:t}),!K()){let e=G(n.span);Z.delete(e),Q.delete(e);return}let r={duration_ms:Date.now()-n.startTime};e&&(r.decision=e),t&&(r.source=t),n.span.setAttributes(r),n.span.end();let i=G(n.span);Z.delete(i),Q.delete(i)}function xt(){if(!K())return o.getActiveSpan()||q().startSpan(`dummy`);let e=q(),t=X.getStore(),n=J(`tool.execution`),r=t?o.setSpan(s.active(),t.span):s.active(),i=e.startSpan(`claude_code.tool.execution`,{attributes:n},r),a=G(i),c={span:i,startTime:Date.now(),attributes:n};return Z.set(a,new WeakRef(c)),Q.set(a,c),i}function St(e){if(!K())return;let t=Array.from(Z.values()).findLast(e=>e.deref()?.attributes[`span.type`]===`tool.execution`)?.deref();if(!t)return;let n={duration_ms:Date.now()-t.startTime};e&&(e.success!==void 0&&(n.success=e.success),e.error!==void 0&&(n.error=e.error)),t.span.setAttributes(n),t.span.end();let r=G(t.span);Z.delete(r),Q.delete(r)}function Ct(e,t){let n=X.getStore();if(!n)return;if(n.perfettoSpanId&&qe(n.perfettoSpanId,{success:!0,resultTokens:t}),!K()){let e=G(n.span);Z.delete(e),X.enterWith(void 0);return}let r={duration_ms:Date.now()-n.startTime};e&&lt(r,n.attributes.tool_name||`unknown`,e),t!==void 0&&(r.result_tokens=t),n.span.setAttributes(r),n.span.end();let i=G(n.span);Z.delete(i),X.enterWith(void 0)}function wt(){return i(process.env.OTEL_LOG_TOOL_CONTENT)}function Tt(e,t){if(!K()||!wt())return;let n=X.getStore();if(!n)return;let r={};for(let[e,n]of Object.entries(t))if(typeof n==`string`){let{content:t,truncated:i}=B(n);r[e]=t,i&&(r[`${e}_truncated`]=!0,r[`${e}_original_length`]=n.length)}else r[e]=n;n.span.addEvent(e,r)}function Et(e,t,n,r){if(!z())return o.getActiveSpan()||q().startSpan(`dummy`);let i=q(),a=X.getStore()??Y.getStore(),c=J(`hook`,{hook_event:e,hook_name:t,num_hooks:n,hook_definitions:r}),l=a?o.setSpan(s.active(),a.span):s.active(),u=i.startSpan(`claude_code.hook`,{attributes:c},l),d=G(u),f={span:u,startTime:Date.now(),attributes:c};return Z.set(d,new WeakRef(f)),Q.set(d,f),u}function Dt(e,t){if(!z())return;let n=G(e),r=Z.get(n)?.deref();if(!r)return;let i={duration_ms:Date.now()-r.startTime};t&&(t.numSuccess!==void 0&&(i.num_success=t.numSuccess),t.numBlocking!==void 0&&(i.num_blocking=t.numBlocking),t.numNonBlockingError!==void 0&&(i.num_non_blocking_error=t.numNonBlockingError),t.numCancelled!==void 0&&(i.num_cancelled=t.numCancelled)),r.span.setAttributes(i),r.span.end(),Z.delete(n),Q.delete(n)}var Y,X,Z,Q,$,Ot,kt,At=e((()=>{a(),g(),r(),w(),ft(),et(),Y=new we,X=new we,Z=new Map,Q=new Map,$=0,Ot=!1,kt=1800*1e3}));export{Me as A,He as C,Le as D,Ie as E,w as M,Pe as O,A as S,Fe as T,ft as _,St as a,et as b,mt as c,_t as d,yt as f,tt as g,st as h,bt as i,C as j,T as k,Et as l,vt as m,Dt as n,Ct as o,xt as p,gt as r,At as s,Tt as t,ht as u,z as v,Ue as w,Be as x,Ge as y};
@@ -0,0 +1,9 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{l as t,n,s as r,u as i}from"./envUtils-CFG7IQID.js";import{i as a,t as o}from"./src-58uAJYF_.js";import{Ht as s,M as c,N as ee,tt as te}from"./state-CUZTq6r0.js";import{_s as l,l as u,ls as d,m as f,xs as p}from"./growthbook-p4aJ_UMv.js";import{E as m,K as h,O as g,U as _,l as v,p as y}from"./debug-CjIaNjpK.js";import{n as b,r as x}from"./execFileNoThrow-DdmR1mBS.js";import{i as S,o as ne}from"./platform-BXz_rgpy.js";import{n as re,t as ie}from"./bundledMode-DQNSSQbt.js";import{n as ae,t as oe}from"./distRoot-CJaacAHy.js";import{a as C,c as w,d as T,n as E,r as D,t as O}from"./common-BX7bn3hg.js";import{a as k,i as A}from"./prompt-hnIDYhP4.js";import{homedir as j}from"os";import{join as M}from"path";import{chmod as N,mkdir as P,readFile as F,readdir as I,writeFile as L}from"fs/promises";function se(){return process.env.USER_TYPE===`ant`?[B,V,H]:[B]}async function R(e,t){if(e.length===0)return t?.(`[Claude in Chrome] No browser paths to check`),{isInstalled:!1,browser:null};let n=se();for(let{browser:r,path:i}of e){let e=[];try{e=await I(i,{withFileTypes:!0})}catch(e){if(h(e))continue;throw e}let a=e.filter(e=>e.isDirectory()).filter(e=>e.name===`Default`||e.name.startsWith(`Profile `)).map(e=>e.name);a.length>0&&t?.(`[Claude in Chrome] Found ${r} profiles: ${a.join(`, `)}`);for(let e of a)for(let a of n){let n=M(i,e,`Extensions`,a);try{return await I(n),t?.(`[Claude in Chrome] Extension ${a} found in ${r} ${e}`),{isInstalled:!0,browser:r}}catch{}}}return t?.(`[Claude in Chrome] Extension not found in any browser`),{isInstalled:!1,browser:null}}async function z(e,t){return(await R(e,t)).isInstalled}var B,V,H,U=e((()=>{_(),B=`fcoeoabgfenejglbffodgkkbkcdhcgfn`,V=`dihbgbndebgnbjfmelmegjepbnkhlgni`,H=`dngcpimnedloihjnnfngkgjoidhnaolf`}));function W(e){if(ee()&&e!==!0)return!1;if(e===!0)return!0;if(e===!1)return!1;if(i(process.env.CLAUDE_CODE_ENABLE_CFC))return!0;if(t(process.env.CLAUDE_CODE_ENABLE_CFC))return!1;let n=d();return n.claudeInChromeDefaultEnabled===void 0?!1:n.claudeInChromeDefaultEnabled}function G(){return $===void 0&&($=c()&&ue()&&(process.env.USER_TYPE===`ant`||u(`tengu_chrome_auto_enable`,!1))),$}function K(){let e=re(),t=a.map(e=>`mcp__claude-in-chrome__${e.name}`),n={};te()&&(n.CLAUDE_CHROME_PERMISSION_MODE=`skip_all_permission_checks`);let r=Object.keys(n).length>0;if(e)return J(`"${process.execPath}" --chrome-native-host`).then(e=>q(e)).catch(e=>y(`[Claude in Chrome] Failed to install native host: ${e}`,{level:`error`})),{mcpConfig:{[O]:{type:`stdio`,command:process.execPath,args:[`--claude-in-chrome-mcp`],scope:`dynamic`,...r&&{env:n}}},allowedTools:t,systemPrompt:A()};{let e=M(oe,`cli.js`);return J(`"${process.execPath}" "${e}" --chrome-native-host`).then(e=>q(e)).catch(e=>y(`[Claude in Chrome] Failed to install native host: ${e}`,{level:`error`})),{mcpConfig:{[O]:{type:`stdio`,command:process.execPath,args:[`${e}`,`--claude-in-chrome-mcp`],scope:`dynamic`,...r&&{env:n}}},allowedTools:t,systemPrompt:A()}}}function ce(){if(S()===`windows`){let e=j();return[M(process.env.APPDATA||M(e,`AppData`,`Local`),`Claude Code`,`ChromeNativeHost`)]}return D().map(({path:e})=>e)}async function q(e){let t=ce();if(t.length===0)throw Error(`Claude in Chrome Native Host not supported on this platform`);let n=g({name:Z,description:`Claude Code Browser Extension Native Host`,path:e,type:`stdio`,allowed_origins:[`chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/`,...process.env.USER_TYPE===`ant`?[`chrome-extension://dihbgbndebgnbjfmelmegjepbnkhlgni/`,`chrome-extension://dngcpimnedloihjnnfngkgjoidhnaolf/`]:[]]},null,2),r=!1;for(let e of t){let t=M(e,Q);if(await F(t,`utf-8`).catch(()=>null)!==n)try{await P(e,{recursive:!0}),await L(t,n),y(`[Claude in Chrome] Installed native host manifest at: ${t}`),r=!0}catch(e){y(`[Claude in Chrome] Failed to install manifest at ${t}: ${e}`)}}S()===`windows`&&le(M(t[0],Q)),r&&Y().then(e=>{e?(y(`[Claude in Chrome] First-time install detected, opening reconnect page in browser`),T(X)):y(`[Claude in Chrome] First-time install detected, but extension not installed, skipping reconnect`)})}function le(e){let t=C();for(let{browser:n,key:r}of t){let t=`${r}\\${Z}`;b(`reg`,[`add`,t,`/ve`,`/t`,`REG_SZ`,`/d`,e,`/f`]).then(e=>{e.code===0?y(`[Claude in Chrome] Registered native host for ${n} in Windows registry: ${t}`):y(`[Claude in Chrome] Failed to register native host for ${n} in Windows registry: ${e.stderr}`)})}}async function J(e){let t=S(),r=M(n(),`chrome`),i=t===`windows`?M(r,`chrome-native-host.bat`):M(r,`chrome-native-host`),a=t===`windows`?`@echo off
2
+ REM Chrome native host wrapper script
3
+ REM Generated by Claude Code - do not edit manually
4
+ ${e}
5
+ `:`#!/bin/sh
6
+ # Chrome native host wrapper script
7
+ # Generated by Claude Code - do not edit manually
8
+ exec ${e}
9
+ `;return await F(i,`utf-8`).catch(()=>null)===a?i:(await P(r,{recursive:!0}),await L(i,a),t!==`windows`&&await N(i,493),y(`[Claude in Chrome] Created Chrome native host wrapper script: ${i}`),i)}function ue(){return Y().then(e=>{e&&d().cachedChromeExtensionInstalled!==e&&p(t=>({...t,cachedChromeExtensionInstalled:e}))}),d().cachedChromeExtensionInstalled??!1}async function Y(){let e=E();return e.length===0?(y(`[Claude in Chrome] Unsupported platform for extension detection: ${S()}`),!1):z(e,y)}var X,Z,Q,$,de=e((()=>{o(),s(),f(),ie(),ae(),l(),v(),r(),x(),ne(),m(),w(),k(),U(),X=`https://clau.de/chrome/reconnect`,Z=`com.anthropic.claude_code_browser_extension`,Q=`${Z}.json`}));export{W as a,G as i,Y as n,U as o,K as r,z as s,de as t};
@@ -0,0 +1,4 @@
1
+ import{c as e,n as t,s as n,u as r}from"./envUtils-CFG7IQID.js";import{t as i}from"./semver-BsItM2Z4.js";import{n as a,t as o}from"./axios-Zh7qGPze.js";import{In as s,Ln as c}from"./src-DNHWYkls.js";import{Ht as l,Mn as u,N as d,Pn as f,Y as ee,Yn as te,at as p}from"./state-CUZTq6r0.js";import{Ha as m,Or as h,Wa as ne,_s as g,kr as _,ls as v,nt as y,ss as b,xs as x,yt as S}from"./growthbook-p4aJ_UMv.js";import{J as C,U as w,z as re}from"./debug-CjIaNjpK.js";import{M as T,f as ie,j as ae,n as oe,r as se,v as ce}from"./git-Bj8Ow4pJ.js";import{n as le,r as ue}from"./privacyLevel-CRCHhztk.js";import{o as E,s as D}from"./log-DVv8YiNo.js";import{d as O,f as k}from"./stringUtils-U7kMYMJq.js";import{n as A,r as j}from"./startupProfiler-4P7GdVw6.js";import{a as M,n as N}from"./env-CesrOJJq.js";import{DF as P,Et as F,MO as I,Pi as L,QE as R,TF as z,TO as B,XN as V,ZE as H,br as U,dA as de,dt as fe,eD as pe,eP as me,ew as he,fb as ge,fi as _e,ft as ve,ln as ye,mt as W,pb as G,tw as be,uA as xe,un as Se,vt as Ce,zi as we}from"./loadAgentsDir-Bz0FfcVt.js";import{n as Te,t as K}from"./cwd-BXiaJzLh.js";import{r as Ee,t as q}from"./semver-D3lOjiBN.js";import{l as De,u as Oe}from"./terminalSetup--jwGVap8.js";import{s as ke,u as Ae}from"./logoV2Utils-D5SpeZ3C.js";import{i as je,r as Me}from"./runtimeObserver-CX6vepq9.js";import{n as Ne,r as Pe}from"./sessionMemory-BA6cdxqP.js";import{n as Fe,t as Ie}from"./sink-yBIcxQf1.js";import{t as Le}from"./errorLogSink-Ti4Suoz6.js";import{homedir as Re}from"os";import{dirname as ze,join as J}from"path";import{copyFile as Be,mkdir as Ve,readFile as He,stat as Ue,writeFile as We}from"fs/promises";c(),O(),Te(),o();var Y=i();l(),g(),n(),w(),E(),le(),Ee();var X=5,Ge=`https://raw.githubusercontent.com/anthropics/claude-code/refs/heads/main/CHANGELOG.md`;function Z(){return J(t(),`cache`,`changelog.md`)}var Q=null;async function Ke(){if(d()||ue())return;let e=await a.get(Ge);if(e.status===200){let t=e.data;if(t===Q)return;let n=Z();await Ve(ze(n),{recursive:!0}),await We(n,t,{encoding:`utf-8`}),Q=t;let r=Date.now();x(e=>({...e,changelogLastFetched:r}))}}async function qe(){if(Q!==null)return Q;let e=Z();try{let t=await He(e,`utf-8`);return Q=t,t}catch{return Q=``,``}}function Je(){return Q??``}function Ye(e){try{if(!e)return{};let t={},n=e.split(/^## /gm).slice(1);for(let e of n){let n=e.trim().split(`
2
+ `);if(n.length===0)continue;let r=n[0];if(!r)continue;let i=r.split(` - `)[0]?.trim()||``;if(!i)continue;let a=n.slice(1).filter(e=>e.trim().startsWith(`- `)).map(e=>e.trim().substring(2).trim()).filter(Boolean);a.length>0&&(t[i]=a)}return t}catch(e){return D(C(e)),{}}}function Xe(e,t,n=Je()){try{let r=Ye(n),i=(0,Y.coerce)(e),a=t?(0,Y.coerce)(t):null;if(!a||i&&q(i.version,a.version))return Object.entries(r).filter(([e])=>!a||q(e,a.version)).sort(([e],[t])=>q(e,t)?-1:1).flatMap(([e,t])=>t).filter(Boolean).slice(0,X)}catch(e){return D(C(e)),[]}return[]}async function Ze(e,t=`2.8.4`){if(process.env.USER_TYPE===`ant`)return{hasReleaseNotes:!1,releaseNotes:[]};let n=await qe();(e!==t||!n)&&Ke().catch(e=>D(C(e)));let r=Xe(t,e,n);return{hasReleaseNotes:r.length>0,releaseNotes:r}}ae(),ce(),M(),y(),de(),R(),he(),ge(),we(),U(),Se(),Ie();function Qe(){Le(),Fe()}ne(),h(),me(),Oe(),je(),Pe(),g(),E();function $(){x(e=>({...e,iterm2SetupInProgress:!1}))}function $e(){let e=v();return{inProgress:e.iterm2SetupInProgress??!1,backupPath:e.iterm2BackupPath||null}}function et(){return J(Re(),`Library`,`Preferences`,`com.googlecode.iterm2.plist`)}async function tt(){let{inProgress:e,backupPath:t}=$e();if(!e)return{status:`no_backup`};if(!t)return $(),{status:`no_backup`};try{await Ue(t)}catch{return $(),{status:`no_backup`}}try{return await Be(t,et()),$(),{status:`restored`}}catch(e){return D(Error(`Failed to restore iTerm2 settings with: ${e}`)),$(),{status:`failed`,backupPath:t}}}l(),g(),n(),w(),E(),Ae(),B(),P(),A(),Ce();async function nt(t,n,i,a,o,c,l,h,ne){T(`info`,`setup_started`);let g=process.version.match(/^v(\d+)\./)?.[1];if((!g||parseInt(g,10)<18)&&(console.error(s.bold.red(`Error: Claude Code requires Node.js version 18 or higher.`)),process.exit(1)),l&&te(xe(l)),e(),!e()&&_()){let{captureTeammateModeSnapshot:e}=await import(`./teammateModeSnapshot-DtgsNj1G.js`);e()}if(!d()){if(_()){let e=await tt();e.status===`restored`?console.log(s.yellow(`Detected an interrupted iTerm2 setup. Your original settings have been restored. You may need to restart iTerm2 for the changes to take effect.`)):e.status===`failed`&&console.error(s.red(`Failed to restore iTerm2 settings. Please manually restore your original settings with: defaults import com.googlecode.iterm2 ${e.backupPath}.`))}try{let e=await De();e.status===`restored`?console.log(s.yellow(`Detected an interrupted Terminal.app setup. Your original settings have been restored. You may need to restart Terminal.app for the changes to take effect.`)):e.status===`failed`&&console.error(s.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){D(e)}}G(t);let y=Date.now();if(H(),T(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-y}),be(t),a){let e=ye(),n=await ie();!e&&!n&&(process.stderr.write(s.red(`Error: Can only use --worktree in a git repository, but ${s.bold(t)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let r=h?`pr-${h}`:o??z(),i;if(n){let e=oe(K());e||(process.stderr.write(s.red(`Error: Could not determine the main git repository root.
3
+ `)),process.exit(1)),e!==(se(K())??K())&&(T(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),G(e)),i=c?W(e,F(r)):void 0}else i=c?W(K(),F(r)):void 0;let a;try{a=await ve(p(),r,i,h?{prNumber:h}:void 0)}catch(e){process.stderr.write(s.red(`Error creating worktree: ${re(e)}\n`)),process.exit(1)}if(k(`tengu_worktree_created`,{tmux_enabled:c}),c&&i){let e=await fe(i,a.worktreePath);e.created?console.log(s.green(`Created tmux session: ${s.bold(i)}\nTo attach: ${s.bold(`tmux attach -t ${i}`)}`)):console.error(s.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(a.worktreePath),G(a.worktreePath),u(K()),f(K()),_e(a),V(),pe()}T(`info`,`setup_background_jobs_starting`),e()||(Ne(),Me()),I(),T(`info`,`setup_background_jobs_launched`),j(`setup_before_prefetch`),T(`info`,`setup_prefetch_starting`);let x=d()&&r(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)||e();if(x||L(ee()),import(`./loadPluginHooks-B5SIS2uo.js`).then(e=>{x||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),e()||(process.env.USER_TYPE===`ant`&&import(`./commitAttribution-DRSKRoH6.js`).then(async e=>{if(await e.isInternalModelRepo()){let{clearSystemPromptSections:e}=await import(`./systemPromptSections-Dk6azdAb.js`);e()}}),setImmediate(()=>{import(`./attributionHooks-BUmHrLhB.js`).then(({registerAttributionHooks:e})=>{e()})}),import(`./sessionFileAccessHooks-9lPjspRX.js`).then(e=>e.registerSessionFileAccessHooks())),Qe(),k(`tengu_started`,{}),S(d()),j(`setup_after_prefetch`),!e()){let{hasReleaseNotes:e}=await Ze(v().lastReleaseNotesSeen);e&&await ke()}if(n===`bypassPermissions`||i){if(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!r(process.env.CLAUDE_CODE_BUBBLEWRAP))if(process.stdin.isTTY){console.error(s.bold.red(`WARNING: Running as root/sudo with bypass permissions mode is dangerous.`)),console.error(s.yellow(`Bypass mode skips ALL permission checks. Combined with root, any command (rm -rf /, chmod, dd) executes without review.`));let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout}),t=await new Promise(t=>{e.question(`
4
+ I understand the risks. Continue? [y/N] `,t)});e.close(),t.trim().toLowerCase()!==`y`&&(console.error(`Aborted.`),process.exit(1))}else console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`),process.exit(1);if(process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`claude-desktop`){let[e,t]=await Promise.all([m.getIsDocker(),N.hasInternetAccess()]),n=m.getIsBubblewrapSandbox(),r=process.env.IS_SANDBOX===`1`;(!(e||n||r)||t)&&(console.error(`--dangerously-skip-permissions can only be used in Docker/sandbox containers with no internet access but got Docker: ${e}, Bubblewrap: ${n}, IS_SANDBOX: ${r}, hasInternet: ${t}`),process.exit(1))}}let C=b();C.lastCost!==void 0&&C.lastDuration!==void 0&&k(`tengu_exit`,{last_session_cost:C.lastCost,last_session_api_duration:C.lastAPIDuration,last_session_tool_duration:C.lastToolDuration,last_session_duration:C.lastDuration,last_session_lines_added:C.lastLinesAdded,last_session_lines_removed:C.lastLinesRemoved,last_session_total_input_tokens:C.lastTotalInputTokens,last_session_total_output_tokens:C.lastTotalOutputTokens,last_session_total_cache_creation_input_tokens:C.lastTotalCacheCreationInputTokens,last_session_total_cache_read_input_tokens:C.lastTotalCacheReadInputTokens,last_session_fps_average:C.lastFpsAverage,last_session_fps_low_1_pct:C.lastFpsLow1Pct,last_session_id:C.lastSessionId,...C.lastSessionMetrics})}export{nt as setup};
@@ -0,0 +1 @@
1
+ import{Ic as e,Vc as t}from"./growthbook-p4aJ_UMv.js";import{n,t as r}from"./bundledMode-DQNSSQbt.js";import{o as i,r as a,t as o}from"./common-HfKcqOYK.js";import{n as s,t as c}from"./distRoot-CJaacAHy.js";import{i as l,t as u}from"./src-hjAMxWFj.js";import{i as d,t as f}from"./gates-CmKoQ0O-.js";import{join as p}from"path";u(),t(),r(),s(),i(),d();function m(){let t=l(o,f()).map(t=>e(a,t.name)),r=n()?[`--computer-use-mcp`]:[p(c,`cli.js`),`--computer-use-mcp`];return{mcpConfig:{[a]:{type:`stdio`,command:process.execPath,args:r,scope:`dynamic`}},allowedTools:t}}export{m as setupComputerUseMCP};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{B as t,U as n,V as r,W as i,z as a}from"./loadAgentsDir-Bz0FfcVt.js";import{or as o}from"./prompt-CsBCtw4l.js";function s(e){return e===`projectSettings`||e===`policySettings`||e===`command`}function c(e){return i(e)}function l(e,t,n){let r=c(t.source),i=c(n.source),a=t.ruleValue.toolName;return e===`deny`?`Remove the "${a}" deny rule from ${r}, or remove the specific allow rule from ${i}`:`Remove the "${a}" ask rule from ${r}, or remove the specific allow rule from ${i}`}function u(e,t,n){let{toolName:r,ruleContent:i}=e.ruleValue;if(i===void 0)return{shadowed:!1};let a=t.find(e=>e.ruleValue.toolName===r&&e.ruleValue.ruleContent===void 0);return!a||r===`Bash`&&n.sandboxAutoAllowEnabled&&!s(a.source)?{shadowed:!1}:{shadowed:!0,shadowedBy:a,shadowType:`ask`}}function d(e,t){let{toolName:n,ruleContent:r}=e.ruleValue;if(r===void 0)return{shadowed:!1};let i=t.find(e=>e.ruleValue.toolName===n&&e.ruleValue.ruleContent===void 0);return i?{shadowed:!0,shadowedBy:i,shadowType:`deny`}:{shadowed:!1}}function f(e,n){let i=[],o=a(e),s=t(e),f=r(e);for(let e of o){let t=d(e,f);if(t.shadowed){let n=c(t.shadowedBy.source);i.push({rule:e,reason:`Blocked by "${t.shadowedBy.ruleValue.toolName}" deny rule (from ${n})`,shadowedBy:t.shadowedBy,shadowType:`deny`,fix:l(`deny`,t.shadowedBy,e)});continue}let r=u(e,s,n);if(r.shadowed){let t=c(r.shadowedBy.source);i.push({rule:e,reason:`Shadowed by "${r.shadowedBy.ruleValue.toolName}" ask rule (from ${t})`,shadowedBy:r.shadowedBy,shadowType:`ask`,fix:l(`ask`,r.shadowedBy,e)})}}return i}var p=e((()=>{o(),n()}));export{p as n,f as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,t as n}from"./chunk-DR8-3Aex.js";import{E as r,O as i}from"./debug-CjIaNjpK.js";import{o as a,s as o}from"./log-DVv8YiNo.js";var s=n(((e,t)=>{t.exports=function(e){return e.map(function(e){return e===``?`''`:e&&typeof e==`object`?e.op.replace(/(.)/g,`\\$1`):/["\s\\]/.test(e)&&!/'/.test(e)?`'`+e.replace(/(['])/g,`\\$1`)+`'`:/["'\s]/.test(e)?`"`+e.replace(/(["\\$`!])/g,`\\$1`)+`"`:String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,`$1\\$2`)}).join(` `)}})),c=n(((e,t)=>{for(var n=`(?:`+[`\\|\\|`,`\\&\\&`,`;;`,`\\|\\&`,`\\<\\(`,`\\<\\<\\<`,`>>`,`>\\&`,`<\\&`,`[&;()|<>]`].join(`|`)+`)`,r=RegExp(`^`+n+`$`),i=`|&;()<> \\t`,a=`"((\\\\"|[^"])*?)"`,o=`'((\\\\'|[^'])*?)'`,s=/^#$/,c=`'`,l=`"`,u=`$`,d=``,f=4294967296,p=0;p<4;p++)d+=(f*Math.random()).toString(16);var m=RegExp(`^`+d);function h(e,t){for(var n=t.lastIndex,r=[],i;i=t.exec(e);)r.push(i),t.lastIndex===i.index&&(t.lastIndex+=1);return t.lastIndex=n,r}function g(e,t,n){var r=typeof e==`function`?e(n):e[n];return r===void 0&&n!=``?r=``:r===void 0&&(r=`$`),typeof r==`object`?t+d+JSON.stringify(r)+d:t+r}function _(e,t,d){d||(d={});var f=d.escape||`\\`,p=`(\\`+f+`['"`+i+`]|[^\\s'"`+i+`])+`,m=h(e,new RegExp([`(`+n+`)`,`(`+p+`|`+a+`|`+o+`)+`].join(`|`),`g`));if(m.length===0)return[];t||(t={});var _=!1;return m.map(function(n){var i=n[0];if(!i||_)return;if(r.test(i))return{op:i};var a=!1,o=!1,d=``,p=!1,m;function h(){m+=1;var e,n,r=i.charAt(m);if(r===`{`){if(m+=1,i.charAt(m)===`}`)throw Error(`Bad substitution: `+i.slice(m-2,m+1));if(e=i.indexOf(`}`,m),e<0)throw Error(`Bad substitution: `+i.slice(m));n=i.slice(m,e),m=e}else if(/[*@#?$!_-]/.test(r))n=r,m+=1;else{var a=i.slice(m);e=a.match(/[^\w\d_]/),e?(n=a.slice(0,e.index),m+=e.index-1):(n=a,m=i.length)}return g(t,``,n)}for(m=0;m<i.length;m++){var v=i.charAt(m);if(p=p||!a&&(v===`*`||v===`?`),o)d+=v,o=!1;else if(a)v===a?a=!1:a==c?d+=v:v===f?(m+=1,v=i.charAt(m),v===l||v===f||v===u?d+=v:d+=f+v):v===u?d+=h():d+=v;else if(v===l||v===c)a=v;else if(r.test(v))return{op:i};else if(s.test(v)){_=!0;var y={comment:e.slice(n.index+m+1)};return d.length?[d,y]:[y]}else v===f?o=!0:v===u?d+=h():d+=v}return p?{op:`glob`,pattern:d}:d}).reduce(function(e,t){return t===void 0?e:e.concat(t)},[])}t.exports=function(e,t,n){var r=_(e,t,n);return typeof t==`function`?r.reduce(function(e,t){if(typeof t==`object`)return e.concat(t);var n=t.split(RegExp(`(`+d+`.*?`+d+`)`,`g`));return n.length===1?e.concat(n[0]):e.concat(n.filter(Boolean).map(function(e){return m.test(e)?JSON.parse(e.split(d)[1]):e}))},[]):r}})),l=n((e=>{e.quote=s(),e.parse=c()}));function u(e,t){try{return{success:!0,tokens:(0,h.parse)(e,t)}}catch(e){return e instanceof Error&&o(e),{success:!1,error:e instanceof Error?e.message:`Unknown parse error`}}}function d(e){try{return{success:!0,quoted:(0,h.quote)(e.map((e,t)=>{if(e==null)return String(e);let n=typeof e;if(n===`string`)return e;if(n===`number`||n===`boolean`)return String(e);throw Error(n===`object`?`Cannot quote argument at index ${t}: object values are not supported`:n===`symbol`?`Cannot quote argument at index ${t}: symbol values are not supported`:n===`function`?`Cannot quote argument at index ${t}: function values are not supported`:`Cannot quote argument at index ${t}: unsupported type ${n}`)}))}}catch(e){return e instanceof Error&&o(e),{success:!1,error:e instanceof Error?e.message:`Unknown quote error`}}}function f(e,t){let n=!1,r=!1,i=0,a=0;for(let t=0;t<e.length;t++){let o=e[t];if(o===`\\`&&!n){t++;continue}o===`"`&&!n?(i++,r=!r):o===`'`&&!r&&(a++,n=!n)}if(i%2!=0||a%2!=0)return!0;for(let e of t)if(typeof e==`string`&&((e.match(/{/g)||[]).length!==(e.match(/}/g)||[]).length||(e.match(/\(/g)||[]).length!==(e.match(/\)/g)||[]).length||(e.match(/\[/g)||[]).length!==(e.match(/\]/g)||[]).length||(e.match(/(?<!\\)"/g)||[]).length%2!=0||(e.match(/(?<!\\)'/g)||[]).length%2!=0))return!0;return!1}function p(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&!t){r++;continue}if(i===`"`&&!t){n=!n;continue}if(i===`'`&&!n&&(t=!t,!t)){let t=0,n=r-1;for(;n>=0&&e[n]===`\\`;)t++,n--;if(t>0&&t%2==1||t>0&&t%2==0&&e.indexOf(`'`,r+1)!==-1)return!0}}return!1}function m(e){let t=d([...e]);if(t.success)return t.quoted;try{return(0,h.quote)(e.map(e=>{if(e==null)return String(e);let t=typeof e;return t===`string`||t===`number`||t===`boolean`?String(e):i(e)}))}catch(e){throw e instanceof Error&&o(e),Error(`Failed to quote shell arguments safely`)}}var h,g=e((()=>{h=t(l(),1),a(),r()}));export{u as a,m as i,p as n,l as o,g as r,f as t};
@@ -0,0 +1,20 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Pc as t,Ud as n,Vd as r,Zc as i,jc as a}from"./loadAgentsDir-Bz0FfcVt.js";import{M as o,T as s}from"./rcDebugLog-BbHlIxCm.js";function c(e){let t=[],n=e.matchAll(d);for(let e of n)e.index!==void 0&&t.push({word:e[0],start:e.index,end:e.index+e[0].length});return t}async function l({question:e,cacheSafeParams:t}){let r=await n({promptMessages:[a({content:`<system-reminder>This is a side question from the user. You must answer this question directly in a single response.
2
+
3
+ IMPORTANT CONTEXT:
4
+ - You are a separate, lightweight agent spawned to answer this one question
5
+ - The main agent is NOT interrupted - it continues working independently in the background
6
+ - You share the conversation context but are a completely separate instance
7
+ - Do NOT reference being interrupted or what you were "previously doing" - that framing is incorrect
8
+
9
+ CRITICAL CONSTRAINTS:
10
+ - You have NO tools available - you cannot read files, run commands, search, or take any actions
11
+ - This is a one-off response - there will be no follow-up turns
12
+ - You can ONLY provide information based on what you already know from the conversation context
13
+ - NEVER say things like "Let me try...", "I'll now...", "Let me check...", or promise to take any action
14
+ - If you don't know the answer, say so - do not offer to look it up or investigate
15
+
16
+ Simply answer the question with the information you have.</system-reminder>
17
+
18
+ ${e}`})],cacheSafeParams:t,canUseTool:async()=>({behavior:`deny`,message:`Side questions cannot use tools`,decisionReason:{type:`other`,reason:`side_question`}}),querySource:`side_question`,forkLabel:`side_question`,maxTurns:1,skipCacheWrite:!0});return{response:u(r.messages),usage:r.totalUsage}}function u(e){let n=e.flatMap(e=>e.type===`assistant`?e.message.content:[]);if(n.length>0){let e=t(n,`
19
+
20
+ `).trim();if(e)return e;let r=n.find(e=>e.type===`tool_use`);if(r)return`(The model tried to call ${`name`in r?r.name:`a tool`} instead of answering directly. Try rephrasing or ask in the main conversation.)`}let r=e.find(e=>e.type===`system`&&`subtype`in e&&e.subtype===`api_error`);return r?`(API error: ${o(r.error)})`:null}var d,f=e((()=>{s(),r(),i(),d=/^\/btw\b/gi}));export{f as n,l as r,c as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l,u}from"./isObject-DaxDnPKm.js";import{a as d,c as f,d as p,f as m,g as h,h as g,i as _,l as v,m as y,n as ee,o as te,p as ne,r as re,s as b,t as ie,u as ae}from"./memoize-DNnuA2aU.js";import{i as x,n as oe,r as S,t as se}from"./isSymbol-D7QeUnS5.js";import{randomUUID as ce}from"crypto";function le(){this.__data__=new b,this.size=0}var ue=e((()=>{f()}));function de(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var fe=e((()=>{}));function pe(e){return this.__data__.get(e)}var me=e((()=>{}));function he(e){return this.__data__.has(e)}var ge=e((()=>{}));function _e(e,t){var n=this.__data__;if(n instanceof b){var r=n.__data__;if(!d||r.length<ve-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new re(r)}return n.set(e,t),this.size=n.size,this}var ve,ye=e((()=>{f(),te(),_(),ve=200}));function C(e){this.size=(this.__data__=new b(e)).size}var w=e((()=>{f(),ue(),fe(),me(),ge(),ye(),C.prototype.clear=le,C.prototype.delete=de,C.prototype.get=pe,C.prototype.has=he,C.prototype.set=_e}));function be(e){return this.__data__.set(e,xe),this}var xe,Se=e((()=>{xe=`__lodash_hash_undefined__`}));function Ce(e){return this.__data__.has(e)}var we=e((()=>{}));function T(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new re;++t<n;)this.add(e[t])}var Te=e((()=>{_(),Se(),we(),T.prototype.add=T.prototype.push=be,T.prototype.has=Ce}));function Ee(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var De=e((()=>{}));function Oe(e,t){return e.has(t)}var ke=e((()=>{}));function Ae(e,t,n,r,i,a){var o=n&je,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Me?new T:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!Ee(t,function(e,t){if(!Oe(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}var je,Me,Ne=e((()=>{Te(),De(),ke(),je=1,Me=2})),E,Pe=e((()=>{c(),E=n.Uint8Array}));function Fe(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}var Ie=e((()=>{}));function Le(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Re=e((()=>{}));function ze(e,t,n,r,i,a,o){switch(n){case Qe:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ze:return!(e.byteLength!=t.byteLength||!a(new E(e),new E(t)));case He:case Ue:case Ke:return v(+e,+t);case We:return e.name==t.name&&e.message==t.message;case qe:case Ye:return e==t+``;case Ge:var s=Fe;case Je:var c=r&Be;if(s||(s=Le),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Ve,o.set(e,t);var u=Ae(s(e),s(t),r,i,a,o);return o.delete(e),u;case Xe:if(D)return D.call(e)==D.call(t)}return!1}var Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,D,et=e((()=>{o(),Pe(),ae(),Ne(),Ie(),Re(),Be=1,Ve=2,He=`[object Boolean]`,Ue=`[object Date]`,We=`[object Error]`,Ge=`[object Map]`,Ke=`[object Number]`,qe=`[object RegExp]`,Je=`[object Set]`,Ye=`[object String]`,Xe=`[object Symbol]`,Ze=`[object ArrayBuffer]`,Qe=`[object DataView]`,$e=t?t.prototype:void 0,D=$e?$e.valueOf:void 0}));function tt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var nt=e((()=>{})),O,k=e((()=>{O=Array.isArray}));function rt(e,t,n){var r=t(e);return O(e)?r:tt(r,n(e))}var it=e((()=>{nt(),k()}));function at(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}var ot=e((()=>{}));function st(){return[]}var ct=e((()=>{})),lt,A,j,ut=e((()=>{ot(),ct(),lt=Object.prototype.propertyIsEnumerable,A=Object.getOwnPropertySymbols,j=A?function(e){return e==null?[]:(e=Object(e),at(A(e),function(t){return lt.call(e,t)}))}:st}));function dt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var ft=e((()=>{}));function pt(e){return x(e)&&s(e)==mt}var mt,ht=e((()=>{r(),S(),mt=`[object Arguments]`})),gt,_t,vt,M,yt=e((()=>{ht(),S(),gt=Object.prototype,_t=gt.hasOwnProperty,vt=gt.propertyIsEnumerable,M=pt(function(){return arguments}())?pt:function(e){return x(e)&&_t.call(e,`callee`)&&!vt.call(e,`callee`)}}));function bt(){return!1}var xt=e((()=>{})),St,Ct,wt,N,Tt=e((()=>{c(),xt(),St=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Ct=St&&typeof module==`object`&&module&&!module.nodeType&&module,wt=Ct&&Ct.exports===St?n.Buffer:void 0,N=(wt?wt.isBuffer:void 0)||bt}));function Et(e,t){var n=typeof e;return t=t??Dt,!!t&&(n==`number`||n!=`symbol`&&Ot.test(e))&&e>-1&&e%1==0&&e<t}var Dt,Ot,kt=e((()=>{Dt=9007199254740991,Ot=/^(?:0|[1-9]\d*)$/}));function At(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=jt}var jt,Mt=e((()=>{jt=9007199254740991}));function Nt(e){return x(e)&&At(e.length)&&!!P[s(e)]}var Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,P,an=e((()=>{r(),Mt(),S(),Pt=`[object Arguments]`,Ft=`[object Array]`,It=`[object Boolean]`,Lt=`[object Date]`,Rt=`[object Error]`,zt=`[object Function]`,Bt=`[object Map]`,Vt=`[object Number]`,Ht=`[object Object]`,Ut=`[object RegExp]`,Wt=`[object Set]`,Gt=`[object String]`,Kt=`[object WeakMap]`,qt=`[object ArrayBuffer]`,Jt=`[object DataView]`,Yt=`[object Float32Array]`,Xt=`[object Float64Array]`,Zt=`[object Int8Array]`,Qt=`[object Int16Array]`,$t=`[object Int32Array]`,en=`[object Uint8Array]`,tn=`[object Uint8ClampedArray]`,nn=`[object Uint16Array]`,rn=`[object Uint32Array]`,P={},P[Yt]=P[Xt]=P[Zt]=P[Qt]=P[$t]=P[en]=P[tn]=P[nn]=P[rn]=!0,P[Pt]=P[Ft]=P[qt]=P[It]=P[Jt]=P[Lt]=P[Rt]=P[zt]=P[Bt]=P[Vt]=P[Ht]=P[Ut]=P[Wt]=P[Gt]=P[Kt]=!1}));function on(e){return function(t){return e(t)}}var sn=e((()=>{})),F,I,L,R,cn=e((()=>{u(),F=typeof exports==`object`&&exports&&!exports.nodeType&&exports,I=F&&typeof module==`object`&&module&&!module.nodeType&&module,L=I&&I.exports===F&&i.process,R=function(){try{return I&&I.require&&I.require(`util`).types||L&&L.binding&&L.binding(`util`)}catch{}}()})),z,B,V=e((()=>{an(),sn(),cn(),z=R&&R.isTypedArray,B=z?on(z):Nt}));function ln(e,t){var n=O(e),r=!n&&M(e),i=!n&&!r&&N(e),a=!n&&!r&&!i&&B(e),o=n||r||i||a,s=o?dt(e.length,String):[],c=s.length;for(var l in e)(t||un.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Et(l,c)))&&s.push(l);return s}var un,dn=e((()=>{ft(),yt(),k(),Tt(),kt(),V(),un=Object.prototype.hasOwnProperty}));function fn(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||pn)}var pn,mn=e((()=>{pn=Object.prototype}));function hn(e,t){return function(n){return e(t(n))}}var gn=e((()=>{})),_n,vn=e((()=>{gn(),_n=hn(Object.keys,Object)}));function yn(e){if(!fn(e))return _n(e);var t=[];for(var n in Object(e))bn.call(e,n)&&n!=`constructor`&&t.push(n);return t}var bn,xn=e((()=>{mn(),vn(),bn=Object.prototype.hasOwnProperty}));function Sn(e){return e!=null&&At(e.length)&&!h(e)}var Cn=e((()=>{g(),Mt()}));function H(e){return Sn(e)?ln(e):yn(e)}var wn=e((()=>{dn(),xn(),Cn()}));function Tn(e){return rt(e,H,j)}var En=e((()=>{it(),ut(),wn()}));function Dn(e,t,n,r,i,a){var o=n&On,s=Tn(e),c=s.length;if(c!=Tn(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:kn.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||(m=u==`constructor`)}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var On,kn,An=e((()=>{En(),On=1,kn=Object.prototype.hasOwnProperty})),U,jn=e((()=>{m(),c(),U=p(n,`DataView`)})),W,Mn=e((()=>{m(),c(),W=p(n,`Promise`)})),G,Nn=e((()=>{m(),c(),G=p(n,`Set`)})),K,Pn=e((()=>{m(),c(),K=p(n,`WeakMap`)})),Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,q,J,Kn=e((()=>{jn(),te(),Mn(),Nn(),Pn(),r(),ne(),Fn=`[object Map]`,In=`[object Object]`,Ln=`[object Promise]`,Rn=`[object Set]`,zn=`[object WeakMap]`,Bn=`[object DataView]`,Vn=y(U),Hn=y(d),Un=y(W),Wn=y(G),Gn=y(K),q=s,(U&&q(new U(new ArrayBuffer(1)))!=Bn||d&&q(new d)!=Fn||W&&q(W.resolve())!=Ln||G&&q(new G)!=Rn||K&&q(new K)!=zn)&&(q=function(e){var t=s(e),n=t==In?e.constructor:void 0,r=n?y(n):``;if(r)switch(r){case Vn:return Bn;case Hn:return Fn;case Un:return Ln;case Wn:return Rn;case Gn:return zn}return t}),J=q}));function qn(e,t,n,r,i,a){var o=O(e),s=O(t),c=o?Xn:J(e),l=s?Xn:J(t);c=c==Yn?Y:c,l=l==Yn?Y:l;var u=c==Y,d=l==Y,f=c==l;if(f&&N(e)){if(!N(t))return!1;o=!0,u=!1}if(f&&!u)return a||(a=new C),o||B(e)?Ae(e,t,n,r,i,a):ze(e,t,c,n,r,i,a);if(!(n&Jn)){var p=u&&Zn.call(e,`__wrapped__`),m=d&&Zn.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||(a=new C),i(h,g,n,r,a)}}return f?(a||(a=new C),Dn(e,t,n,r,i,a)):!1}var Jn,Yn,Xn,Y,Zn,Qn=e((()=>{w(),Ne(),et(),An(),Kn(),k(),Tt(),V(),Jn=1,Yn=`[object Arguments]`,Xn=`[object Array]`,Y=`[object Object]`,Zn=Object.prototype.hasOwnProperty}));function X(e,t,n,r,i){return e===t?!0:e==null||t==null||!x(e)&&!x(t)?e!==e&&t!==t:qn(e,t,n,r,X,i)}var $n=e((()=>{Qn(),S()}));function er(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new C;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?X(u,l,tr|nr,r,d):f))return!1}}return!0}var tr,nr,rr=e((()=>{w(),$n(),tr=1,nr=2}));function ir(e){return e===e&&!a(e)}var ar=e((()=>{l()}));function or(e){for(var t=H(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ir(i)]}return t}var sr=e((()=>{ar(),wn()}));function cr(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var lr=e((()=>{}));function ur(e){var t=or(e);return t.length==1&&t[0][2]?cr(t[0][0],t[0][1]):function(n){return n===e||er(n,e,t)}}var dr=e((()=>{rr(),sr(),lr()}));function fr(e,t){if(O(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||oe(e)?!0:mr.test(e)||!pr.test(e)||t!=null&&e in Object(t)}var pr,mr,hr=e((()=>{k(),se(),pr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mr=/^\w*$/}));function gr(e){var t=ee(e,function(e){return n.size===_r&&n.clear(),e}),n=t.cache;return t}var _r,vr=e((()=>{ie(),_r=500})),yr,br,xr,Sr=e((()=>{vr(),yr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,br=/\\(\\)?/g,xr=gr(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(yr,function(e,n,r,i){t.push(r?i.replace(br,`$1`):n||e)}),t})}));function Cr(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var wr=e((()=>{}));function Tr(e){if(typeof e==`string`)return e;if(O(e))return Cr(e,Tr)+``;if(oe(e))return Z?Z.call(e):``;var t=e+``;return t==`0`&&1/e==-Er?`-0`:t}var Er,Dr,Z,Or=e((()=>{o(),wr(),k(),se(),Er=1/0,Dr=t?t.prototype:void 0,Z=Dr?Dr.toString:void 0}));function kr(e){return e==null?``:Tr(e)}var Ar=e((()=>{Or()}));function jr(e,t){return O(e)?e:fr(e,t)?[e]:xr(kr(e))}var Mr=e((()=>{k(),hr(),Sr(),Ar()}));function Q(e){if(typeof e==`string`||oe(e))return e;var t=e+``;return t==`0`&&1/e==-Nr?`-0`:t}var Nr,$=e((()=>{se(),Nr=1/0}));function Pr(e,t){t=jr(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Q(t[n++])];return n&&n==r?e:void 0}var Fr=e((()=>{Mr(),$()}));function Ir(e,t,n){var r=e==null?void 0:Pr(e,t);return r===void 0?n:r}var Lr=e((()=>{Fr()}));function Rr(e,t){return e!=null&&t in Object(e)}var zr=e((()=>{}));function Br(e,t,n){t=jr(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=Q(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&At(i)&&Et(o,i)&&(O(e)||M(e)))}var Vr=e((()=>{Mr(),yt(),k(),kt(),Mt(),$()}));function Hr(e,t){return e!=null&&Br(e,t,Rr)}var Ur=e((()=>{zr(),Vr()}));function Wr(e,t){return fr(e)&&ir(t)?cr(Q(e),t):function(n){var r=Ir(n,e);return r===void 0&&r===t?Hr(n,e):X(t,r,Gr|Kr)}}var Gr,Kr,qr=e((()=>{$n(),Lr(),Ur(),hr(),ar(),lr(),$(),Gr=1,Kr=2}));function Jr(e){return e}var Yr=e((()=>{}));function Xr(e){return function(t){return t?.[e]}}var Zr=e((()=>{}));function Qr(e){return function(t){return Pr(t,e)}}var $r=e((()=>{Fr()}));function ei(e){return fr(e)?Xr(Q(e)):Qr(e)}var ti=e((()=>{Zr(),$r(),hr(),$()}));function ni(e){return typeof e==`function`?e:e==null?Jr:typeof e==`object`?O(e)?Wr(e[0],e[1]):ur(e):ei(e)}var ri=e((()=>{dr(),qr(),Yr(),k(),ti()}));function ii(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==void 0&&(n=n===void 0?a:n+a)}return n}var ai=e((()=>{}));function oi(e,t){return e&&e.length?ii(e,ni(t,2)):0}var si=e((()=>{ri(),ai()})),ci=e((()=>{}));function li(){ui=null,di.clear(),fi.clear()}var ui,di,fi,pi=e((()=>{di=new Map,fi=new Map}));function mi(){let e=new Set;return{subscribe(t){return e.add(t),()=>{e.delete(t)}},emit(...t){for(let n of e)n(...t)},clear(){e.clear()}}}var hi=e((()=>{}));export{j as $,En as A,dn as B,X as C,G as D,Kn as E,gn as F,on as G,B as H,hn as I,Et as J,sn as K,mn as L,H as M,Cn as N,Nn as O,Sn as P,M as Q,fn as R,wr as S,J as T,cn as U,V,R as W,N as X,Tt as Y,yt as Z,jr as _,T as _t,ci as a,rt as at,kr as b,w as bt,oi as c,O as ct,Jr as d,Re as dt,ut as et,Yr as f,Le as ft,Q as g,ke as gt,$ as h,Oe as ht,li as i,ot as it,wn as j,Tn as k,ni as l,tt as lt,Fr as m,Pe as mt,hi as n,st as nt,ce as o,it as ot,Pr as p,E as pt,kt as q,pi as r,at as rt,si as s,k as st,mi as t,ct as tt,ri as u,nt as ut,Mr as v,Te as vt,$n as w,Cr as x,Ar as y,C as yt,ln as z};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./defineProperty-CaCI0a5T.js";import{a as r,i,t as ee}from"./dist-es-Cp--qjOi.js";import{A as te,C as ne,D as re,E as ie,F as ae,I as oe,L as se,M as ce,N as le,O as ue,P as de,R as fe,S as pe,_ as me,a as he,b as ge,c as _e,d as ve,f as ye,g as be,h as xe,i as Se,j as Ce,k as we,l as Te,m as Ee,p as De,r as Oe,s as ke,t as Ae,u as je,v as Me,w as Ne,x as Pe,y as Fe,z as Ie}from"./dist-es-dIP5JtXz.js";import{C as Le,S as Re,c as ze,d as Be,f as Ve,g as He,n as Ue,t as a,v as We}from"./httpAuthSchemes-CgPbtGos.js";import{n as Ge,r as Ke,t as qe}from"./dist-es-BctcPxLN.js";import{i as Je,n as Ye,t as Xe}from"./dist-es-6kjvVbJd.js";import{I as Ze,L as Qe,N as $e,P as et,R as tt,v as o,x as nt,y as s,z as rt}from"./protocols-CpoQzjyI.js";import{n as it,t as at}from"./dist-es-C66BuLgn.js";import{a as ot,d as st,g as ct,h as lt,i as ut,m as dt,n as ft,o as pt,r as mt,t as ht,u as gt}from"./dist-es-Bu21Wvhs.js";import{g as _t,i as vt,p as yt,t as bt}from"./client-CinDjeSq.js";import{n as c,t as xt}from"./dist-es-BismPcTW.js";import{a as St,c as Ct,d as wt,f as Tt,i as Et,n as Dt,o as Ot,s as kt,t as l,u as At}from"./dist-es-C_IHUdzL.js";import{n as jt,t as Mt}from"./package-9IAs5Qf0.js";function Nt(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`signin`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function Pt(e){return{schemeId:`smithy.api#noAuth`}}var Ft,It,Lt,Rt=e((()=>{a(),qe(),Ft=async(e,t,n)=>({operation:Ke(t).operation,region:await Ge(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),It=e=>{let t=[];switch(e.operation){case`CreateOAuth2Token`:t.push(Pt(e));break;default:t.push(Nt(e))}return t},Lt=e=>{let t=Ue(e);return Object.assign(t,{authSchemePreference:Ge(e.authSchemePreference??[])})}})),zt,Bt,Vt=e((()=>{zt=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`signin`}),Bt={UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}})),u,d,f,p,m,h,g,_,v,y,b,x,S,C,Ht,w,Ut,Wt,Gt=e((()=>{gt(),u=`ref`,d=-1,f=!0,p=`isSet`,m=`PartitionResult`,h=`booleanEquals`,g=`getAttr`,_=`stringEquals`,v={[u]:`Endpoint`},y={[u]:m},b={fn:g,argv:[y,`name`]},x={},S=[{[u]:`Region`}],C={conditions:[[p,[v]],[p,S],[`aws.partition`,S,m],[h,[{[u]:`UseFIPS`},f]],[h,[{[u]:`UseDualStack`},f]],[h,[{fn:g,argv:[y,`supportsDualStack`]},f]],[h,[{fn:g,argv:[y,`supportsFIPS`]},f]],[_,[b,`aws`]],[_,[b,`aws-cn`]],[_,[b,`aws-us-gov`]]],results:[[d],[d,`Invalid Configuration: FIPS and custom endpoint are not supported`],[d,`Invalid Configuration: Dualstack and custom endpoint are not supported`],[v,x],[`https://{Region}.signin.aws.amazon.com`,x],[`https://{Region}.signin.amazonaws.cn`,x],[`https://{Region}.signin.amazonaws-us-gov.com`,x],[`https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,x],[d,`FIPS and DualStack are enabled, but this partition does not support one or both`],[`https://signin-fips.{Region}.{PartitionResult#dnsSuffix}`,x],[d,`FIPS is enabled but this partition does not support FIPS`],[`https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}`,x],[d,`DualStack is enabled but this partition does not support DualStack`],[`https://signin.{Region}.{PartitionResult#dnsSuffix}`,x],[d,`Invalid Configuration: Missing Region`]]},Ht=2,w=1e8,Ut=new Int32Array([-1,1,-1,0,15,3,1,4,w+14,2,5,w+14,3,11,6,4,10,7,7,w+4,8,8,w+5,9,9,w+6,w+13,5,w+11,w+12,4,13,12,6,w+9,w+10,5,14,w+8,6,w+7,w+8,3,w+1,16,4,w+2,w+3]),Wt=ct.from(Ut,Ht,C.conditions,C.results)})),Kt,qt,Jt=e((()=>{te(),gt(),Gt(),Kt=new lt({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`]}),qt=(e,t={})=>Kt.get(e,()=>st(Wt,{endpointParams:e,logger:t.logger})),dt.aws=Ce})),T,E=e((()=>{l(),T=class e extends Ct{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),Yt,Xt,Zt,Qt,$t=e((()=>{E(),t(),Yt=class e extends T{constructor(t){super({name:`AccessDeniedException`,$fault:`client`,...t}),n(this,`name`,`AccessDeniedException`),n(this,`$fault`,`client`),n(this,`error`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error}},Xt=class e extends T{constructor(t){super({name:`InternalServerException`,$fault:`server`,...t}),n(this,`name`,`InternalServerException`),n(this,`$fault`,`server`),n(this,`error`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error}},Zt=class e extends T{constructor(t){super({name:`TooManyRequestsError`,$fault:`client`,...t}),n(this,`name`,`TooManyRequestsError`),n(this,`$fault`,`client`),n(this,`error`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error}},Qt=class e extends T{constructor(t){super({name:`ValidationException`,$fault:`client`,...t}),n(this,`name`,`ValidationException`),n(this,`$fault`,`client`),n(this,`error`,void 0),Object.setPrototypeOf(this,e.prototype),this.error=t.error}}})),en,tn,nn,rn,an,on,sn,cn,ln,un,dn,D,O,k,A,j,fn,M,N,P,pn,F,I,L,R,z,B,V,H,U,mn,hn,gn,W,G,K,_n,q,vn,yn,J,bn,xn,Y,Sn,Cn,wn,Tn,En,Dn,X=e((()=>{o(),$t(),E(),en=`AccessDeniedException`,tn=`AccessToken`,nn=`CreateOAuth2Token`,rn=`CreateOAuth2TokenRequest`,an=`CreateOAuth2TokenRequestBody`,on=`CreateOAuth2TokenResponseBody`,sn=`CreateOAuth2TokenResponse`,cn=`InternalServerException`,ln=`RefreshToken`,un=`TooManyRequestsError`,dn=`ValidationException`,D=`accessKeyId`,O=`accessToken`,k=`client`,A=`clientId`,j=`codeVerifier`,fn=`code`,M=`error`,N=`expiresIn`,P=`grantType`,pn=`http`,F=`httpError`,I=`idToken`,L=`jsonName`,R=`message`,z=`refreshToken`,B=`redirectUri`,V=`smithy.ts.sdk.synthetic.com.amazonaws.signin`,H=`secretAccessKey`,U=`sessionToken`,mn=`server`,hn=`tokenInput`,gn=`tokenOutput`,W=`tokenType`,G=`com.amazonaws.signin`,K=s.for(V),_n=[-3,V,`SigninServiceException`,0,[],[]],K.registerError(_n,T),q=s.for(G),vn=[-3,G,en,{[M]:k},[M,R],[0,0],2],q.registerError(vn,Yt),yn=[-3,G,cn,{[M]:mn,[F]:500},[M,R],[0,0],2],q.registerError(yn,Xt),J=[-3,G,un,{[M]:k,[F]:429},[M,R],[0,0],2],q.registerError(J,Zt),bn=[-3,G,dn,{[M]:k,[F]:400},[M,R],[0,0],2],q.registerError(bn,Qt),xn=[K,q],Y=[0,G,ln,8,0],Sn=[3,G,tn,8,[D,H,U],[[0,{[L]:D}],[0,{[L]:H}],[0,{[L]:U}]],3],Cn=[3,G,rn,0,[hn],[[()=>wn,16]],1],wn=[3,G,an,0,[A,P,fn,B,j,z],[[0,{[L]:A}],[0,{[L]:P}],0,[0,{[L]:B}],[0,{[L]:j}],[()=>Y,{[L]:z}]],2],Tn=[3,G,sn,0,[gn],[[()=>En,16]],1],En=[3,G,on,0,[O,W,N,z,I],[[()=>Sn,{[L]:O}],[0,{[L]:W}],[1,{[L]:N}],[()=>Y,{[L]:z}],[0,{[L]:I}]],4],Dn=[9,G,nn,{[pn]:[`POST`,`/v1/token`,200]},()=>Cn,()=>Tn]})),On,kn=e((()=>{a(),he(),Ve(),l(),at(),Qe(),Xe(),Rt(),Jt(),X(),On=e=>({apiVersion:`2023-01-01`,base64Decoder:e?.base64Decoder??rt,base64Encoder:e?.base64Encoder??tt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??qt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??It,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new Be},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new He}],logger:e?.logger??new Dt,protocol:e?.protocol??ke,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.signin`,errorTypeRegistries:xn,version:`2023-01-01`,serviceTarget:`Signin`},serviceId:e?.serviceId??`Signin`,urlParser:e?.urlParser??it,utf8Decoder:e?.utf8Decoder??Je,utf8Encoder:e?.utf8Encoder??Ye})})),An,jn=e((()=>{Mt(),bt(),a(),Ee(),ht(),De(),me(),xt(),$e(),l(),je(),_e(),vt(),kn(),An=e=>{Ot(process.version);let t=Te(e),n=()=>t().then(kt),r=On(e);_t(process.version);let i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:`node`,defaultsMode:t,authSchemePreference:e?.authSchemePreference??c(ze,i),bodyLengthChecker:e?.bodyLengthChecker??ve,defaultUserAgentProvider:e?.defaultUserAgentProvider??be({serviceId:r.serviceId,clientVersion:jt.version}),maxAttempts:e?.maxAttempts??c(Fe,e),region:e?.region??c(ut,{...mt,...i}),requestHandler:Ze.create(e?.requestHandler??n),retryMode:e?.retryMode??c({...ge,default:async()=>(await n()).retryMode||yt},e),sha256:e?.sha256??ye.bind(null,`sha256`),streamCollector:e?.streamCollector??et,useDualstackEndpoint:e?.useDualstackEndpoint??c(pt,i),useFipsEndpoint:e?.useFipsEndpoint??c(ot,i),userAgentAppId:e?.userAgentAppId??c(xe,i)}}})),Mn,Nn,Pn=e((()=>{Mn=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},Nn=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})})),Fn,In=e((()=>{Ae(),ee(),l(),Pn(),Fn=(e,t)=>{let n=Object.assign(Oe(e),Et(e),i(e),Mn(e));return t.forEach(e=>e.configure(n)),Object.assign(e,Se(n),St(n),r(n),Nn(n))}})),Z,Ln=e((()=>{fe(),ae(),le(),ue(),ht(),Ve(),o(),re(),pe(),me(),l(),Rt(),Vt(),jn(),In(),t(),Z=class extends Tt{constructor(...[e]){let t=An(e||{});super(t),n(this,`config`,void 0),this.initConfig=t,this.config=Fn(Lt(ne(Ie(ft(Pe(ce(zt(t))))))),e?.extensions||[]),this.middlewareStack.use(nt(this.config)),this.middlewareStack.use(we(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(ie(this.config)),this.middlewareStack.use(se(this.config)),this.middlewareStack.use(oe(this.config)),this.middlewareStack.use(de(this.config)),this.middlewareStack.use(Le(this.config,{httpAuthSchemeParametersProvider:Ft,identityProviderConfigProvider:async e=>new We({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(Re(this.config))}destroy(){super.destroy()}}})),Q,Rn=e((()=>{pe(),l(),Vt(),X(),Q=class extends wt.classBuilder().ep(Bt).m(function(e,t,n,r){return[Ne(n,e.getEndpointParameterInstructions())]}).s(`Signin`,`CreateOAuth2Token`,{}).n(`SigninClient`,`CreateOAuth2TokenCommand`).sc(Dn).build(){}})),zn,$,Bn=e((()=>{l(),Rn(),Ln(),zn={CreateOAuth2TokenCommand:Q},$=class extends Z{},At(zn,$)})),Vn=e((()=>{Rn()})),Hn=e((()=>{})),Un=e((()=>{}));e((()=>{Ln(),Bn(),Vn(),X(),Hn(),$t(),Un(),E()}))();export{Q as CreateOAuth2TokenCommand,Z as SigninClient};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./sink-yBIcxQf1.js";t();export{e as initializeAnalyticsSink};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{_r as t,fr as n,hr as r,lr as i,m as a,r as o,vr as s}from"./growthbook-p4aJ_UMv.js";import{a as c,n as l,t as u}from"./analytics-i6X1et4O.js";import{i as d,t as f}from"./datadog-BQlp3bTs.js";function p(){if(s(`datadog`))return!1;if(v!==void 0)return v;try{return o(_)}catch{return!1}}function m(e,t){let i=r(e);if(i===0)return;let a=i===null?t:{...t,sample_rate:i};p()&&d(e,c(a)),n(e,a)}function h(e,t){return m(e,t),Promise.resolve()}function g(){u({logEvent:m,logEventAsync:h})}var _,v,y=e((()=>{f(),i(),a(),l(),t(),_=`tengu_log_datadog_events`}));export{g as n,y as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./sink-yBIcxQf1.js";import{t as n}from"./errorLogSink-Ti4Suoz6.js";t();function r(){n(),e()}export{r as initSinks};