claude-code-best 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (614) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-Cj5bvJgD.js +1 -0
  2. package/dist/chunks/App-2tgSv9lb.js +1 -0
  3. package/dist/chunks/ApproveApiKey-DWa-XTLb.js +1 -0
  4. package/dist/chunks/ApproveApiKey-SIUwkD8j.js +1 -0
  5. package/dist/chunks/AssistantSessionChooser-DF9eeJZS.js +1 -0
  6. package/dist/chunks/BackgroundTasksDialog-DXJdube9.js +2 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-BOSW4Zdy.js +1 -0
  8. package/dist/chunks/ClaudeInChromeOnboarding-BW4XHmkw.js +1 -0
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-B8oAAHSI.js +1 -0
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-Bz0JyaOG.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-DYhmGSkx.js +1 -0
  12. package/dist/chunks/DesktopHandoff-CcsM_OAS.js +1 -0
  13. package/dist/chunks/DevChannelsDialog-DXRgY00D.js +1 -0
  14. package/dist/chunks/Dialog-DYFGqyDs.js +1 -0
  15. package/dist/chunks/DiffDialog-PvNZfZby.js +3 -0
  16. package/dist/chunks/Doctor--B1HUENo.js +1 -0
  17. package/dist/chunks/Doctor-CE_jL9jC.js +3 -0
  18. package/dist/chunks/ExitFlow-C4ybxKPn.js +2 -0
  19. package/dist/chunks/Feedback-B5rPGl_C.js +2 -0
  20. package/dist/chunks/Grove-C2YjB3zL.js +1 -0
  21. package/dist/chunks/Grove-CKVpREDU.js +11 -0
  22. package/dist/chunks/HybridTransport-Byjvz-DL.js +4 -0
  23. package/dist/chunks/ITermBackend-Co9XpeS4.js +1 -0
  24. package/dist/chunks/InProcessTransport-DB52dh4f.js +1 -0
  25. package/dist/chunks/InvalidConfigDialog-CNsqbNU3.js +1 -0
  26. package/dist/chunks/InvalidSettingsDialog-ClnZaN6b.js +1 -0
  27. package/dist/chunks/ListItem-OFARanN7.js +1 -0
  28. package/dist/chunks/MCPConnectionManager-CDsa79pu.js +1 -0
  29. package/dist/chunks/McpParsingWarnings-DZkzoeZf.js +1 -0
  30. package/dist/chunks/MessageSelector-CkeGQPNM.js +3 -0
  31. package/dist/chunks/Messages-PfbzLYOU.js +11 -0
  32. package/dist/chunks/Onboarding-BwoGQB4g.js +1 -0
  33. package/dist/chunks/OverageCreditUpsell-Q5g2YjQw.js +1 -0
  34. package/dist/chunks/PermissionDialog-5MlJf7ew.js +1 -0
  35. package/dist/chunks/PluginSettings-B2ASJ0Rx.js +17 -0
  36. package/dist/chunks/PressEnterToContinue-BdA9zDGs.js +1 -0
  37. package/dist/chunks/PromptInputFooterSuggestions-D4lMVCqj.js +1 -0
  38. package/dist/chunks/PromptInputHelpMenu-BvLtS6an.js +1 -0
  39. package/dist/chunks/QueryEngine-Av0G5fze.js +1 -0
  40. package/dist/chunks/REPL-DCwqua0C.js +1 -0
  41. package/dist/chunks/REPL-Dh8vzGmF.js +97 -0
  42. package/dist/chunks/RemoteCallout-BV_hoz98.js +1 -0
  43. package/dist/chunks/RemoteSessionManager-Cxoy1ud2.js +2 -0
  44. package/dist/chunks/ResumeConversation-B3WuB8rs.js +1 -0
  45. package/dist/chunks/SSETransport-pIm26VJq.js +4 -0
  46. package/dist/chunks/SearchBox-DfOmUoaI.js +1 -0
  47. package/dist/chunks/SearchExtraToolsTool-D70C-cmA.js +1 -0
  48. package/dist/chunks/SentryErrorBoundary-B6EWoJml.js +2 -0
  49. package/dist/chunks/SentryErrorBoundary-oJUBarGg.js +1 -0
  50. package/dist/chunks/Settings-CreAhCsb.js +2 -0
  51. package/dist/chunks/TeleportProgress-DPzGpyyM.js +1 -0
  52. package/dist/chunks/TeleportRepoMismatchDialog-DqWQX6j8.js +1 -0
  53. package/dist/chunks/TeleportResumeWrapper-DPSO0S49.js +1 -0
  54. package/dist/chunks/ThemePicker-DueihHcy.js +1 -0
  55. package/dist/chunks/TmuxBackend-BNaZNAeP.js +9 -0
  56. package/dist/chunks/TrustDialog-CIzAlGn9.js +1 -0
  57. package/dist/chunks/TungstenTool-C5IqKVr0.js +1 -0
  58. package/dist/chunks/TungstenTool-V-Bwqlx3.js +1 -0
  59. package/dist/chunks/ValidationErrorsList-1k1qbsRo.js +2 -0
  60. package/dist/chunks/WelcomeV2-CR6TtXXM.js +1 -0
  61. package/dist/chunks/WindowsTerminalBackend-C5SeTXqC.js +2 -0
  62. package/dist/chunks/add-dir-DAMizKzF.js +1 -0
  63. package/dist/chunks/agentDisplay-B9z7i8b_.js +1 -0
  64. package/dist/chunks/agents-D5u0p1UC.js +103 -0
  65. package/dist/chunks/agents-DCh_gEvJ.js +2 -0
  66. package/dist/chunks/ajv-B_OpU_Uh.js +8 -0
  67. package/dist/chunks/analytics-DqMQntaB.js +1 -0
  68. package/dist/chunks/ant-DRJq-cEg.js +1 -0
  69. package/dist/chunks/api-B6URs6nc.js +1 -0
  70. package/dist/chunks/api-Dz_3z1kl.js +1 -0
  71. package/dist/chunks/asciicast-aoKFhc7C.js +1 -0
  72. package/dist/chunks/asciicast-o5Zg4dJt.js +4 -0
  73. package/dist/chunks/assistant-BRGDWkKB.js +1 -0
  74. package/dist/chunks/assistant-tPxOUa-Z.js +1 -0
  75. package/dist/chunks/assistant-zVegFdAO.js +1 -0
  76. package/dist/chunks/attributionHooks-PygdohOh.js +1 -0
  77. package/dist/chunks/attributionTrailer-BpvhXgRP.js +1 -0
  78. package/dist/chunks/auth-CqURlg4d.js +1 -0
  79. package/dist/chunks/auth-D4isgfuK.js +1 -0
  80. package/dist/chunks/autoMode-DVt4K4I2.js +45 -0
  81. package/dist/chunks/autoModeDenials-Cp6VFdsm.js +1 -0
  82. package/dist/chunks/autonomy-BZzW8QJZ.js +1 -0
  83. package/dist/chunks/autonomy-Ffv0QIyl.js +19 -0
  84. package/dist/chunks/autonomyPanel-MwuzDvv_.js +1 -0
  85. package/dist/chunks/axios-DLnc2dVy.js +1 -0
  86. package/dist/chunks/axios-DhfaybwJ.js +12 -0
  87. package/dist/chunks/backgroundHousekeeping-CYnAG60-.js +17 -0
  88. package/dist/chunks/backgroundHousekeeping-DUmxC6h0.js +1 -0
  89. package/dist/chunks/banner-CVXH2xts.js +2 -0
  90. package/dist/chunks/base64-js-DIVSFswY.js +1 -0
  91. package/dist/chunks/bedrockClient-qi1-JCOK.js +15 -0
  92. package/dist/chunks/bg-DK0E4ZtW.js +9 -0
  93. package/dist/chunks/bg-Dbh5z3Y8.js +1 -0
  94. package/dist/chunks/branch-DXefFdDE.js +3 -0
  95. package/dist/chunks/break-cache-ByJ7U2Ts.js +8 -0
  96. package/dist/chunks/bridge-qr4GQW_c.js +2 -0
  97. package/dist/chunks/bridgeConfig-CJ-KznTS.js +1 -0
  98. package/dist/chunks/bridgeConfig-CNbOKpAg.js +1 -0
  99. package/dist/chunks/bridgeEnabled-5vsPrjuq.js +1 -0
  100. package/dist/chunks/bridgeEnabled-BUJTCUHY.js +1 -0
  101. package/dist/chunks/bridgeMain-BimZwc2P.js +68 -0
  102. package/dist/chunks/bridgeMain-DYL4fl6A.js +1 -0
  103. package/dist/chunks/bridgeMessaging-BiE0CTqq.js +1 -0
  104. package/dist/chunks/bridgePointer-FvAMj3re.js +1 -0
  105. package/dist/chunks/browser-fLRXxIsQ.js +1 -0
  106. package/dist/chunks/btw-FpimqEqk.js +1 -0
  107. package/dist/chunks/buddy-BA3Cr067.js +3 -0
  108. package/dist/chunks/bundledMode-kSQejuY4.js +1 -0
  109. package/dist/chunks/bypassPermissionsKillswitch-CSC9p8mO.js +1 -0
  110. package/dist/chunks/caches-BUBkfP2Q.js +3 -0
  111. package/dist/chunks/caches-CTfNpKhW.js +1 -0
  112. package/dist/chunks/capacityWake-BXlUpptF.js +1 -0
  113. package/dist/chunks/ccrClient-BOxUn9EJ.js +1 -0
  114. package/dist/chunks/ccshareResume-DWLjTF22.js +1 -0
  115. package/dist/chunks/changeDetector-Y9KV5LgG.js +1 -0
  116. package/dist/chunks/channelNotification-CC7Xb06W.js +1 -0
  117. package/dist/chunks/channelNotification-l3EXKDNB.js +1 -0
  118. package/dist/chunks/chokidar-BcI3rIKm.js +1 -0
  119. package/dist/chunks/chokidar-SzksMqYp.js +1 -0
  120. package/dist/chunks/chrome-BnKyWWQL.js +1 -0
  121. package/dist/chunks/chromeNativeHost-4U39yLtd.js +1 -0
  122. package/dist/chunks/chunk-DR8-3Aex.js +1 -0
  123. package/dist/chunks/classPrivateFieldSet2-EAQNhHs8.js +1 -0
  124. package/dist/chunks/claudeDesktop-D0S1eq1F.js +1 -0
  125. package/dist/chunks/cleanup-Bg_gFgcj.js +1 -0
  126. package/dist/chunks/clear-OUVFUt8Z.js +1 -0
  127. package/dist/chunks/cliLaunch-BQa48gsr.js +1 -0
  128. package/dist/chunks/client-B47ZvTMo.js +1 -0
  129. package/dist/chunks/client-CPn1wQyc.js +7 -0
  130. package/dist/chunks/client-_sjL0I7A.js +35 -0
  131. package/dist/chunks/color-D5MCzz9h.js +1 -0
  132. package/dist/chunks/color-convert-ULbeSgNC.js +1 -0
  133. package/dist/chunks/commands-FJGWgQsa.js +1 -0
  134. package/dist/chunks/commitAttribution-BFshsh2H.js +2 -0
  135. package/dist/chunks/commitAttribution-DSv9FggK.js +1 -0
  136. package/dist/chunks/common-B379wT22.js +1 -0
  137. package/dist/chunks/common-B_BC3eMY.js +1 -0
  138. package/dist/chunks/common-CMCv4N_v.js +1 -0
  139. package/dist/chunks/compact-DWNaf1wR.js +3 -0
  140. package/dist/chunks/companion-CyK_Dr1U.js +1 -0
  141. package/dist/chunks/completionCache-DHfUBBMH.js +1 -0
  142. package/dist/chunks/completionCache-DORrtxkS.js +4 -0
  143. package/dist/chunks/computerUseLock-BjoDJH2h.js +1 -0
  144. package/dist/chunks/config-BdCuh6eA.js +1 -0
  145. package/dist/chunks/config-DNz6Eitr.js +1 -0
  146. package/dist/chunks/connectHeadless-CwsFt-Mh.js +1 -0
  147. package/dist/chunks/constants-41VpZw2G.js +1 -0
  148. package/dist/chunks/context-BOjdTj0i.js +1 -0
  149. package/dist/chunks/context-noninteractive-Bd2HO-vU.js +1 -0
  150. package/dist/chunks/context-noninteractive-k2ibficU.js +54 -0
  151. package/dist/chunks/controlMessageCompat-BJhFiS7u.js +1 -0
  152. package/dist/chunks/conversation-BP0phkOY.js +1 -0
  153. package/dist/chunks/conversation-Ci8O_eZ-.js +1 -0
  154. package/dist/chunks/copy-B0VUJ2rH.js +7 -0
  155. package/dist/chunks/createSSHSession-DqmkCS_k.js +6 -0
  156. package/dist/chunks/createSession-B9MhWusY.js +1 -0
  157. package/dist/chunks/createSession-CJEsHz58.js +1 -0
  158. package/dist/chunks/cron-DiW7eIPP.js +1 -0
  159. package/dist/chunks/cronJitterConfig-BzPaa52I.js +6 -0
  160. package/dist/chunks/crossProjectResume-tWsqBUHc.js +40 -0
  161. package/dist/chunks/cwd--iizewsn.js +1 -0
  162. package/dist/chunks/cwd-BgpSJxd7.js +1 -0
  163. package/dist/chunks/daemon-VYRit6Aq.js +2 -0
  164. package/dist/chunks/dangerousBackend-BU_PHGR2.js +1 -0
  165. package/dist/chunks/datadog-Bd1s_VFj.js +1 -0
  166. package/dist/chunks/datadog-DJowkWhh.js +1 -0
  167. package/dist/chunks/debug-DM5ezCBS.js +1 -0
  168. package/dist/chunks/debug-UI3T040K.js +5 -0
  169. package/dist/chunks/debugUtils-BBMFODKH.js +1 -0
  170. package/dist/chunks/defineProperty-80gRi2ZW.js +1 -0
  171. package/dist/chunks/desktop-BDowrzvG.js +1 -0
  172. package/dist/chunks/detached-D300jlhj.js +5 -0
  173. package/dist/chunks/detect-libc-DNuQfUvI.js +1 -0
  174. package/dist/chunks/detectRepository-CBk3S2zv.js +1 -0
  175. package/dist/chunks/detectRepository-DCTvg4p0.js +1 -0
  176. package/dist/chunks/detection-CQsNad64.js +1 -0
  177. package/dist/chunks/detection-DJ-vTbBf.js +1 -0
  178. package/dist/chunks/diff-auU5sUOw.js +1 -0
  179. package/dist/chunks/directoryCompletion-DP_4B1GL.js +1 -0
  180. package/dist/chunks/dist-CanSxOZ1.js +5 -0
  181. package/dist/chunks/dist-Cg1a1Exw.js +29 -0
  182. package/dist/chunks/dist-Q7YNoZ0H.js +20 -0
  183. package/dist/chunks/dist-es-4z5T3Jzm.js +1 -0
  184. package/dist/chunks/dist-es-B2jg52tM2.js +1 -0
  185. package/dist/chunks/dist-es-B6OXHQ1S.js +1 -0
  186. package/dist/chunks/dist-es-B8NEy5hc.js +1 -0
  187. package/dist/chunks/dist-es-BVGppqE4.js +1 -0
  188. package/dist/chunks/dist-es-Bcw5GZko.js +1 -0
  189. package/dist/chunks/dist-es-BoIJpncb.js +9 -0
  190. package/dist/chunks/dist-es-Bu_Fshi1.js +1 -0
  191. package/dist/chunks/dist-es-C-1vn4OP2.js +1 -0
  192. package/dist/chunks/dist-es-C41b_0B5.js +1 -0
  193. package/dist/chunks/dist-es-CCZYybbG2.js +1 -0
  194. package/dist/chunks/dist-es-CLK1mey-.js +1 -0
  195. package/dist/chunks/dist-es-CQz2aNf72.js +1 -0
  196. package/dist/chunks/dist-es-CSfI8B8l.js +1 -0
  197. package/dist/chunks/dist-es-CUZBYppo.js +1 -0
  198. package/dist/chunks/dist-es-CZkzHpjF.js +1 -0
  199. package/dist/chunks/dist-es-Cbf0_D8d.js +5 -0
  200. package/dist/chunks/dist-es-ChHe-SVL.js +1 -0
  201. package/dist/chunks/dist-es-ClYOf0My.js +1 -0
  202. package/dist/chunks/dist-es-D-kJbj4A2.js +1 -0
  203. package/dist/chunks/dist-es-D1LN6CJd.js +1 -0
  204. package/dist/chunks/dist-es-DC1sC3ph.js +1 -0
  205. package/dist/chunks/dist-es-DGn8uOwQ2.js +1 -0
  206. package/dist/chunks/dist-es-DK5fTeKM2.js +1 -0
  207. package/dist/chunks/dist-es-DN7otr6F.js +1 -0
  208. package/dist/chunks/dist-es-DPM0mPK5.js +1 -0
  209. package/dist/chunks/dist-es-DqZAh3nG.js +1 -0
  210. package/dist/chunks/dist-es-DuAZyxJ02.js +5 -0
  211. package/dist/chunks/dist-es-HVQrM0oE.js +1 -0
  212. package/dist/chunks/dist-es-OVleIB54.js +1 -0
  213. package/dist/chunks/dist-es-UAs0rdXg.js +1 -0
  214. package/dist/chunks/dist-es-WvMMuHmx2.js +1 -0
  215. package/dist/chunks/dist-es-fjXft-jH.js +1 -0
  216. package/dist/chunks/dist-es-hdN_ShpZ.js +3 -0
  217. package/dist/chunks/dist-es-neiUvMJb.js +1 -0
  218. package/dist/chunks/dist-es-yMYpDtui2.js +1 -0
  219. package/dist/chunks/dist-es-zjcbuB72.js +1 -0
  220. package/dist/chunks/distRoot-CcxmnzqQ.js +1 -0
  221. package/dist/chunks/doctor-bKPp6AeL.js +1 -0
  222. package/dist/chunks/earlyInput-JGJo1zcC.js +1 -0
  223. package/dist/chunks/earlyInput-tRkbxFv2.js +2 -0
  224. package/dist/chunks/effort-BQj2QnnA.js +9 -0
  225. package/dist/chunks/entry-CUu6-QhT.js +14 -0
  226. package/dist/chunks/env-chR0gV31.js +1 -0
  227. package/dist/chunks/envLessBridgeConfig-CixkwbRF.js +1 -0
  228. package/dist/chunks/envLessBridgeConfig-Ju4W58xf.js +1 -0
  229. package/dist/chunks/envUtils-BWeoiL4Y.js +1 -0
  230. package/dist/chunks/escHotkey-Cyz0yyh1.js +259 -0
  231. package/dist/chunks/esm--xjzB1hI.js +1 -0
  232. package/dist/chunks/esm-B2HIF0XY.js +1 -0
  233. package/dist/chunks/esm-BGQPWnJy.js +1 -0
  234. package/dist/chunks/esm-C-1qL9Mn.js +1 -0
  235. package/dist/chunks/esm-C3jcs1DH.js +1 -0
  236. package/dist/chunks/esm-C97WL9nC.js +1 -0
  237. package/dist/chunks/esm-CIL-SKM8.js +1 -0
  238. package/dist/chunks/esm-CJlBxjtx.js +1 -0
  239. package/dist/chunks/esm-CsGLyWmS.js +56 -0
  240. package/dist/chunks/esm-DQHmDm-H.js +1 -0
  241. package/dist/chunks/esm-DcdOXSzi.js +1 -0
  242. package/dist/chunks/esm-DhNYgGTV.js +1 -0
  243. package/dist/chunks/esm-DxPW7qPs.js +1 -0
  244. package/dist/chunks/esm-FBUWr3vI.js +1 -0
  245. package/dist/chunks/esm-QgL6y---.js +10 -0
  246. package/dist/chunks/esm-v0kPjgVS.js +1 -0
  247. package/dist/chunks/esm-vIn-YV_h.js +1 -0
  248. package/dist/chunks/event-streams-BV7ngMXu.js +1 -0
  249. package/dist/chunks/eventLoopStallDetector-Dnh1fc31.js +1 -0
  250. package/dist/chunks/execAsync-BkA6ogic.js +1 -0
  251. package/dist/chunks/execFileNoThrow-CuQN1sz8.js +1 -0
  252. package/dist/chunks/execSyncWrapper-C2XQnFVo.js +1 -0
  253. package/dist/chunks/execa-CGue6Z3n.js +34 -0
  254. package/dist/chunks/executor-4EeD8GNm.js +1561 -0
  255. package/dist/chunks/executor-BHEuNh5F.js +1 -0
  256. package/dist/chunks/exit-DijkO8eo.js +1 -0
  257. package/dist/chunks/exit-_obETqBv.js +2 -0
  258. package/dist/chunks/export-DA-bBZkX.js +2 -0
  259. package/dist/chunks/exportRenderer-3y4tGdSB.js +1 -0
  260. package/dist/chunks/extra-usage-CS6VwKJt.js +1 -0
  261. package/dist/chunks/extra-usage-DGHEQOrY.js +1 -0
  262. package/dist/chunks/extra-usage-core-DOgT4u4i.js +1 -0
  263. package/dist/chunks/extra-usage-noninteractive-DYnfiRlV.js +1 -0
  264. package/dist/chunks/extraUsage-CfxgfpX_.js +1 -0
  265. package/dist/chunks/extractMemories-jvjCvtpC.js +1 -0
  266. package/dist/chunks/fast-Bbtx_Bs1.js +1 -0
  267. package/dist/chunks/fast-CzRUJBTK.js +1 -0
  268. package/dist/chunks/featureCheck-Cm0YNDXO.js +1 -0
  269. package/dist/chunks/featureCheck-p7OeCYzj.js +1 -0
  270. package/dist/chunks/feedback-FoXtdHAV.js +1 -0
  271. package/dist/chunks/figures-gfT9mM8P.js +1 -0
  272. package/dist/chunks/fileStateCache-C7-TxF8G.js +1 -0
  273. package/dist/chunks/files-DYvAZGxp.js +2 -0
  274. package/dist/chunks/firstPartyEventLogger-KIwaBY-E.js +1 -0
  275. package/dist/chunks/flushGate-C2Icy43G.js +1 -0
  276. package/dist/chunks/foundry-sdk-BFN5VDFQ.js +1 -0
  277. package/dist/chunks/fpsMetrics-DeezdcwV.js +1 -0
  278. package/dist/chunks/fuse-Ch_OAlm3.js +1 -0
  279. package/dist/chunks/gates-CbQLZHtm.js +1 -0
  280. package/dist/chunks/gates-DSI3vpwO.js +1 -0
  281. package/dist/chunks/gemini-BrNJGX4k.js +1 -0
  282. package/dist/chunks/generateRecap-B0fvSCjo.js +1 -0
  283. package/dist/chunks/generateSessionName-DvRYa39O.js +1 -0
  284. package/dist/chunks/genericProcessUtils-BGvcwuPt.js +23 -0
  285. package/dist/chunks/getMachineId-bsd-BMtYGBUL.js +1 -0
  286. package/dist/chunks/getMachineId-darwin-CiLdFH7z.js +2 -0
  287. package/dist/chunks/getMachineId-linux-Cr27rIeY.js +1 -0
  288. package/dist/chunks/getMachineId-unsupported-ceiBLwAN.js +1 -0
  289. package/dist/chunks/getMachineId-win-DFTmsQHq.js +1 -0
  290. package/dist/chunks/git-CN3qtTb_.js +6 -0
  291. package/dist/chunks/git-D23Mzu_K.js +1 -0
  292. package/dist/chunks/githubRepoPathMapping-Dut3d6nn.js +1 -0
  293. package/dist/chunks/graceful-fs-Cgc0rjGF.js +2 -0
  294. package/dist/chunks/grok-Ftoheab3.js +1 -0
  295. package/dist/chunks/growthbook-BynnuVTn.js +1 -0
  296. package/dist/chunks/hash-BRmOQc3c.js +1 -0
  297. package/dist/chunks/heapdump-hQ_w0LPC.js +5 -0
  298. package/dist/chunks/help-DQsHHv6r.js +1 -0
  299. package/dist/chunks/hooks-BLLL4iPv.js +1 -0
  300. package/dist/chunks/hooks-BhVDc8yb.js +79 -0
  301. package/dist/chunks/hostAdapter-D1eWmmhu.js +1 -0
  302. package/dist/chunks/hostGuard-zim_4F9V.js +1 -0
  303. package/dist/chunks/httpAuthSchemes-Wq4XWeLL.js +13 -0
  304. package/dist/chunks/ide-CPmMXLL-.js +2 -0
  305. package/dist/chunks/inboundAttachments-Bmf6vYsE.js +1 -0
  306. package/dist/chunks/inboundAttachments-D-p91z3w.js +1 -0
  307. package/dist/chunks/index.min-BJnb9GQI.js +1 -0
  308. package/dist/chunks/initReplBridge-BiHXpDEY.js +1 -0
  309. package/dist/chunks/insights-CTlTyvjj.js +822 -0
  310. package/dist/chunks/install-IPuD3Lq8.js +1 -0
  311. package/dist/chunks/install-github-app-Bmu_sA9e.js +147 -0
  312. package/dist/chunks/install-slack-app-Rfl81Jqo.js +1 -0
  313. package/dist/chunks/instinctParser-DHMa8xa0.js +1 -0
  314. package/dist/chunks/instrumentation-DWwmOmr0.js +12 -0
  315. package/dist/chunks/intl-Pse97ORk.js +1 -0
  316. package/dist/chunks/isObject-DaxDnPKm.js +1 -0
  317. package/dist/chunks/isSymbol-Dp3irZaY.js +1 -0
  318. package/dist/chunks/job-BXEt0izn.js +2 -0
  319. package/dist/chunks/json-bigint-OxRwRvup.js +8 -0
  320. package/dist/chunks/jsx-runtime-D-D469L8.js +1 -0
  321. package/dist/chunks/jws-2vqRyZtR.js +3 -0
  322. package/dist/chunks/jwtUtils-CpXwh_du.js +1 -0
  323. package/dist/chunks/keybindings-DRDgVvqz.js +2 -0
  324. package/dist/chunks/lang-D3ZHlfT6.js +1 -0
  325. package/dist/chunks/language-B_-BfBT4.js +1 -0
  326. package/dist/chunks/language-DcSjogBx.js +1 -0
  327. package/dist/chunks/launchAgentsPlatform-BPm_VMln.js +1 -0
  328. package/dist/chunks/launchAutofixPr-D2qac07g.js +2 -0
  329. package/dist/chunks/launchCommand-Du91jxMC.js +1 -0
  330. package/dist/chunks/launchLocalMemory-D_hBbXKE.js +3 -0
  331. package/dist/chunks/launchLocalVault-CPzNWvQ9.js +3 -0
  332. package/dist/chunks/launchMemoryStores-Djq2KhKb.js +1 -0
  333. package/dist/chunks/launchOnboarding-Bh6E7vdc.js +8 -0
  334. package/dist/chunks/launchSchedule-C988bQ-5.js +1 -0
  335. package/dist/chunks/launchSkillStore-DqrP6Gme.js +1 -0
  336. package/dist/chunks/launchTeleport-DFhybaq_.js +3 -0
  337. package/dist/chunks/launchVault-p_CSK4ZQ.js +1 -0
  338. package/dist/chunks/lazySchema-2sOku3cX.js +1 -0
  339. package/dist/chunks/lib-B4Q0Nrpb.js +14 -0
  340. package/dist/chunks/lib-Ca3QWJjN.js +2 -0
  341. package/dist/chunks/lib-inCisXen.js +8 -0
  342. package/dist/chunks/loadAgentsDir-Ci5mr0vm.js +4601 -0
  343. package/dist/chunks/loadAgentsDir-vB1QEZ7H.js +1 -0
  344. package/dist/chunks/loadPluginHooks-xYCEZ6t5.js +1 -0
  345. package/dist/chunks/loadSso-sDs471GC.js +1 -0
  346. package/dist/chunks/localSearch-DtVqtfvk.js +1 -0
  347. package/dist/chunks/localSearch-Vpn6W5aY.js +1 -0
  348. package/dist/chunks/lockfile-DBwdlC3K.js +1 -0
  349. package/dist/chunks/log-CzsijfHZ.js +1 -0
  350. package/dist/chunks/login-D-N78G6r.js +1 -0
  351. package/dist/chunks/login-D9IWjvza.js +1 -0
  352. package/dist/chunks/logoV2Utils-SAulcC5x.js +1 -0
  353. package/dist/chunks/logout-CFggVS-9.js +1 -0
  354. package/dist/chunks/magicDocs-BfoeYhin.js +57 -0
  355. package/dist/chunks/main-C6be1KFk.js +31 -0
  356. package/dist/chunks/main-DhMlhVj3.js +1108 -0
  357. package/dist/chunks/mappers-uIrAj-Wd.js +1 -0
  358. package/dist/chunks/mcp-CAYGNxCb.js +1 -0
  359. package/dist/chunks/mcp-COQap0SM.js +6 -0
  360. package/dist/chunks/mcp-DlM0OC6R.js +2 -0
  361. package/dist/chunks/mcpServer-1SnOWb8_.js +1 -0
  362. package/dist/chunks/mcpServer-DXvS3v4x.js +1 -0
  363. package/dist/chunks/memoize-DNnuA2aU.js +1 -0
  364. package/dist/chunks/memoize-DxwLawI2.js +1 -0
  365. package/dist/chunks/memory-XccPLQLt.js +1 -0
  366. package/dist/chunks/mobile-umu5P0cM.js +2 -0
  367. package/dist/chunks/modalContext-CmSKRyea.js +1 -0
  368. package/dist/chunks/model-CbiDGGJU.js +1 -0
  369. package/dist/chunks/model-DdbcxKub.js +1 -0
  370. package/dist/chunks/normalization-Cox8C0dP.js +1 -0
  371. package/dist/chunks/oauth-CdZEzMww.js +1 -0
  372. package/dist/chunks/oauth-CmensepG.js +1 -0
  373. package/dist/chunks/observationStore-tvkldXUo.js +4 -0
  374. package/dist/chunks/onChangeAppState-Dp0JIXd8.js +1 -0
  375. package/dist/chunks/open-CDditBQ-.js +1 -0
  376. package/dist/chunks/openai-6KcHd4Hw.js +10 -0
  377. package/dist/chunks/openaiShared-D5lOejS1.js +16 -0
  378. package/dist/chunks/output-style-XDb9-2Kk.js +1 -0
  379. package/dist/chunks/overageCreditGrant-DYiB4sr-.js +1 -0
  380. package/dist/chunks/p-map-9Ud1LOrJ.js +1 -0
  381. package/dist/chunks/p-map-D7WEmnBE.js +1 -0
  382. package/dist/chunks/package-BhL7chzt.js +1 -0
  383. package/dist/chunks/panel-ByW1omJn.js +1 -0
  384. package/dist/chunks/panel-Bz_8td5D.js +1 -0
  385. package/dist/chunks/parseConnectUrl-BS6i9JPo.js +1 -0
  386. package/dist/chunks/parser-CmngCwjB.js +1 -0
  387. package/dist/chunks/parser-SWIZo39J.js +1 -0
  388. package/dist/chunks/passes-Cbc6T_Tj.js +1 -0
  389. package/dist/chunks/path-C4kbwvSH.js +1 -0
  390. package/dist/chunks/paths-Q2255dD7.js +39 -0
  391. package/dist/chunks/permissions-BLzPHh_3.js +3 -0
  392. package/dist/chunks/permissions-DXLfdE7b.js +1 -0
  393. package/dist/chunks/permissions-Ps_D01ZB.js +1 -0
  394. package/dist/chunks/pipeTransport-D7NIp3aA.js +1 -0
  395. package/dist/chunks/plan-DloFVJK7.js +1 -0
  396. package/dist/chunks/platform-CuyedWpe.js +2 -0
  397. package/dist/chunks/plist-BO4ZqMZc.js +6 -0
  398. package/dist/chunks/plugin-XR9IBPMM.js +1 -0
  399. package/dist/chunks/pluginAutoupdate-Cr9hP0zG.js +1 -0
  400. package/dist/chunks/pluginBlocklist-CM9uP8CY.js +1 -0
  401. package/dist/chunks/pluginCliCommands-BQkrvES5.js +1 -0
  402. package/dist/chunks/pluginFlagging-CJ1--2Kw.js +1 -0
  403. package/dist/chunks/pluginOperations-B0rLuSvo.js +2 -0
  404. package/dist/chunks/pluginStartupCheck-Bjdc8zhz.js +1 -0
  405. package/dist/chunks/pluginStartupCheck-Cu2ezD51.js +1 -0
  406. package/dist/chunks/plugins-BgOP_8TX.js +4 -0
  407. package/dist/chunks/policyLimits-CKy_gTEt.js +1 -0
  408. package/dist/chunks/pollConfig-DhptuhFw.js +1 -0
  409. package/dist/chunks/poller-Ds0Y6Cir.js +1 -0
  410. package/dist/chunks/poor-DF0aqXDx.js +1 -0
  411. package/dist/chunks/poorMode-C5Frra4j.js +1 -0
  412. package/dist/chunks/poorMode-DJvjO2nW.js +1 -0
  413. package/dist/chunks/postCommitAttribution-Ehmwzzuq.js +1 -0
  414. package/dist/chunks/print-CPtR0KTa.js +39 -0
  415. package/dist/chunks/privacy-settings-e-7lc7Un.js +1 -0
  416. package/dist/chunks/process-CWupreF6.js +1 -0
  417. package/dist/chunks/process-DMKLUQIO.js +1 -0
  418. package/dist/chunks/processBashCommand-D5dC6Mya.js +1 -0
  419. package/dist/chunks/processSlashCommand-DHRUtZ-C.js +6 -0
  420. package/dist/chunks/projectContext-0fpRKUeH.js +1 -0
  421. package/dist/chunks/projectContext-eXMSfgdZ.js +1 -0
  422. package/dist/chunks/prompt-4tea6NJQ.js +54 -0
  423. package/dist/chunks/prompt-CQC-mh6u.js +1 -0
  424. package/dist/chunks/prompt-DEPUnJdB.js +222 -0
  425. package/dist/chunks/prompt-DawxLANl.js +1 -0
  426. package/dist/chunks/promptEditor-Ci-h04-5.js +4 -0
  427. package/dist/chunks/protocolHandler-DhqM32qE.js +13 -0
  428. package/dist/chunks/protocols-CAyQOlkr.js +7 -0
  429. package/dist/chunks/proxy-CfZp-wce.js +99 -0
  430. package/dist/chunks/rate-limit-options-B0l29Zx8.js +1 -0
  431. package/dist/chunks/rcDebugLog-BbPkkigY.js +11 -0
  432. package/dist/chunks/referral-ByevBJrE.js +1 -0
  433. package/dist/chunks/refresh-B_CwwIRX.js +1 -0
  434. package/dist/chunks/registerProtocol-DzhaQH02.js +36 -0
  435. package/dist/chunks/registry-DkHA4cRu.js +1 -0
  436. package/dist/chunks/release-notes-CZthYkei.js +4 -0
  437. package/dist/chunks/releaseNotes-CwKpIsyd.js +2 -0
  438. package/dist/chunks/reload-plugins-DxWfXvrN.js +1 -0
  439. package/dist/chunks/remote-env-BiRLWIrh.js +1 -0
  440. package/dist/chunks/remoteBridgeCore-nz1fPY1U.js +1 -0
  441. package/dist/chunks/remoteControlServer-FzLUxh2B.js +3 -0
  442. package/dist/chunks/rename-DmGuyncE.js +1 -0
  443. package/dist/chunks/renderOptions-BiyC2rj1.js +1 -0
  444. package/dist/chunks/resume-7GeU7RMS.js +2 -0
  445. package/dist/chunks/rewind-CXplHgh_.js +1 -0
  446. package/dist/chunks/rollback-DbSpxmJE.js +11 -0
  447. package/dist/chunks/runtimeObserver-Duod-ign.js +10 -0
  448. package/dist/chunks/runtimeObserver-OgM9ZYxZ.js +1 -0
  449. package/dist/chunks/sandbox-adapter-CxkhKgaa.js +1 -0
  450. package/dist/chunks/sandbox-toggle-Cc96R6Ox.js +1 -0
  451. package/dist/chunks/sanitization-CYp-9DbE.js +1 -0
  452. package/dist/chunks/satisfies-BaHgd_ie.js +1 -0
  453. package/dist/chunks/schemas-BGAvj1T4.js +40 -0
  454. package/dist/chunks/sdk-DEtgRZvI.js +1 -0
  455. package/dist/chunks/sdkHeapDumpMonitor--fevrC5z.js +1 -0
  456. package/dist/chunks/searchExtraTools-DQ6e601b.js +1 -0
  457. package/dist/chunks/semver-Cq33BYay.js +1 -0
  458. package/dist/chunks/semver-Tw0AFar5.js +1 -0
  459. package/dist/chunks/sentry-BUHYuYGj.js +13 -0
  460. package/dist/chunks/server-C5XZSlto.js +1 -0
  461. package/dist/chunks/server-DzOdtq8A.js +1 -0
  462. package/dist/chunks/serverBanner-WlSYP-f8.js +1 -0
  463. package/dist/chunks/serverLog-DtsUvDiY.js +1 -0
  464. package/dist/chunks/session-DgLqm7ZI.js +2 -0
  465. package/dist/chunks/sessionDataUploader-Ctjo1bgR.js +1 -0
  466. package/dist/chunks/sessionDiscovery-DgNea6qa.js +1 -0
  467. package/dist/chunks/sessionFileAccessHooks-7Svz-7S-.js +1 -0
  468. package/dist/chunks/sessionManager-Dw72ZUTg.js +1 -0
  469. package/dist/chunks/sessionMemory-DIrR3zvb.js +1 -0
  470. package/dist/chunks/sessionMemory-_dmj8lcH.js +1 -0
  471. package/dist/chunks/sessionMemoryUtils-BdQtSkRx.js +1 -0
  472. package/dist/chunks/sessionObserver-CuWMVPlT.js +20 -0
  473. package/dist/chunks/sessionObserver-_adufOGQ.js +1 -0
  474. package/dist/chunks/sessionStorage-W7okgAlQ.js +1 -0
  475. package/dist/chunks/sessionStoragePortable-BI9q2WcJ.js +3 -0
  476. package/dist/chunks/sessionTitle-DzkMzHer.js +14 -0
  477. package/dist/chunks/sessionTracing-DTjmc0EF.js +11 -0
  478. package/dist/chunks/settingsSync-CfYDkakY.js +1 -0
  479. package/dist/chunks/setup-BKUG46jQ.js +9 -0
  480. package/dist/chunks/setup-CmLngvpJ.js +1 -0
  481. package/dist/chunks/setup-TqJ7-Nxh.js +2 -0
  482. package/dist/chunks/shadowedRuleDetection-DesT0yKM.js +1 -0
  483. package/dist/chunks/shellQuote-DgjT8KBA.js +1 -0
  484. package/dist/chunks/sideQuestion-BAq0YyKY.js +20 -0
  485. package/dist/chunks/signin-QEeYpJZw.js +1 -0
  486. package/dist/chunks/sink-B3uP8Cf8.js +1 -0
  487. package/dist/chunks/sink-CaWMZBw_.js +1 -0
  488. package/dist/chunks/sinks-COcy5GnB.js +2 -0
  489. package/dist/chunks/sinks-oFfsKySL.js +1 -0
  490. package/dist/chunks/skill-learning-DOIMPtWE.js +5 -0
  491. package/dist/chunks/skillChangeDetector-CA_Tdx8N.js +1 -0
  492. package/dist/chunks/skillGapStore-CWuw1dYh.js +1 -0
  493. package/dist/chunks/skillGapStore-DpEoKhn-.js +5 -0
  494. package/dist/chunks/skillGenerator-9y3Q4YoO.js +8 -0
  495. package/dist/chunks/skillLearning-BhM09bQD.js +1 -0
  496. package/dist/chunks/skillLearning-_o2D06yM.js +1 -0
  497. package/dist/chunks/skillPanel-Dt24mZTZ.js +28 -0
  498. package/dist/chunks/skillSearchPanel-gaXN64Fu.js +21 -0
  499. package/dist/chunks/skills-Dx3dMHYk.js +1 -0
  500. package/dist/chunks/slashCommandParsing-Cari0pNg.js +1 -0
  501. package/dist/chunks/sleep-8Eb9j_Ly.js +1 -0
  502. package/dist/chunks/sprites-5OAB-Ui2.js +1 -0
  503. package/dist/chunks/src-BIPP3_mo.js +26 -0
  504. package/dist/chunks/src-BJz1KAd_.js +6 -0
  505. package/dist/chunks/src-BRAdBA8A.js +1 -0
  506. package/dist/chunks/src-BRC_BuUP.js +1 -0
  507. package/dist/chunks/src-BaB-bpCj.js +5 -0
  508. package/dist/chunks/src-BlLavFUS.js +7 -0
  509. package/dist/chunks/src-C5yhFG0C.js +19 -0
  510. package/dist/chunks/src-CI_jaaBj.js +2 -0
  511. package/dist/chunks/src-CRsA-Z4y.js +1 -0
  512. package/dist/chunks/src-CYLfL70h.js +1 -0
  513. package/dist/chunks/src-DJXCzwyJ.js +1 -0
  514. package/dist/chunks/src-DJXKJavk.js +1 -0
  515. package/dist/chunks/src-Di342QoJ.js +53 -0
  516. package/dist/chunks/src-DsMd9Q9e.js +2 -0
  517. package/dist/chunks/src-DzH9IdOo.js +1 -0
  518. package/dist/chunks/src-hdbPEvzO.js +9 -0
  519. package/dist/chunks/src-poaoYkuc.js +1 -0
  520. package/dist/chunks/src-x7u_sB6m.js +1 -0
  521. package/dist/chunks/sso-oidc-BX1MlBX0.js +1 -0
  522. package/dist/chunks/startupProfiler-DnXZaX4A.js +3 -0
  523. package/dist/chunks/startupProfiler-SOE--nM9.js +1 -0
  524. package/dist/chunks/state-B2GIOsTB.js +1 -0
  525. package/dist/chunks/state-Ce1HlR-H.js +1 -0
  526. package/dist/chunks/state-sIHsFpDu.js +1 -0
  527. package/dist/chunks/staticRender-Br64h1E1.js +1 -0
  528. package/dist/chunks/stats-TUExo9iU.js +1 -0
  529. package/dist/chunks/status-Dghaz1my.js +1 -0
  530. package/dist/chunks/statusNoticeHelpers-DVZSSXeK.js +1 -0
  531. package/dist/chunks/stdio-BEEzuxaZ.js +1 -0
  532. package/dist/chunks/stdio-D4cT86R0.js +3 -0
  533. package/dist/chunks/stickers-2K05wjSp.js +1 -0
  534. package/dist/chunks/store-DhI7Lcan.js +1 -0
  535. package/dist/chunks/sts-BDFJ-6QE.js +1 -0
  536. package/dist/chunks/subprocessEnv-CggQWZCx.js +1 -0
  537. package/dist/chunks/subprocessEnv-DV6q6o6w.js +1 -0
  538. package/dist/chunks/supports-color-lkzOMQ6u.js +1 -0
  539. package/dist/chunks/systemPromptSections-BcN_XBTx.js +1 -0
  540. package/dist/chunks/systemPromptSections-DB93ZNWP.js +1 -0
  541. package/dist/chunks/systemTheme-dDbitcxB.js +1 -0
  542. package/dist/chunks/tag-ZcVkzFjz.js +11 -0
  543. package/dist/chunks/tasks-DbB33ekt.js +1 -0
  544. package/dist/chunks/teamHelpers-BmN9nKz-.js +1 -0
  545. package/dist/chunks/teamHelpers-yeTNtZbb.js +1 -0
  546. package/dist/chunks/teammate-DMYOtLTK.js +1 -0
  547. package/dist/chunks/teammateModeSnapshot-CPjJJDL1.js +1 -0
  548. package/dist/chunks/teammateModeSnapshot-CsNIJTKi.js +1 -0
  549. package/dist/chunks/teleport-JHgpwZIh.js +1 -0
  550. package/dist/chunks/templateJobs-Db630FZD.js +12 -0
  551. package/dist/chunks/terminalSetup-DJqWE8fc.js +33 -0
  552. package/dist/chunks/terminalSetup-ygKHrVKR.js +1 -0
  553. package/dist/chunks/theme-MmfFhdTD.js +1 -0
  554. package/dist/chunks/thinkback-CrNirB0V.js +1 -0
  555. package/dist/chunks/thinkback-Quc7KPmi.js +1 -0
  556. package/dist/chunks/thinkback-play-CQ1s7oqg.js +1 -0
  557. package/dist/chunks/tmux-CvbhsfwG.js +1 -0
  558. package/dist/chunks/toolEventObserver-BqMplcIk.js +1 -0
  559. package/dist/chunks/toolEventObserver-DBq2XBYY.js +1 -0
  560. package/dist/chunks/toolPool-BkCtTKXz.js +1 -0
  561. package/dist/chunks/toolPool-C7bOwJfR.js +1 -0
  562. package/dist/chunks/trustedDevice-C9Zevohz.js +1 -0
  563. package/dist/chunks/trustedDevice-DEuQUTbz.js +1 -0
  564. package/dist/chunks/tui-BVc2q4Xv.js +6 -0
  565. package/dist/chunks/turndown.es-Bv06VjMb.js +69 -0
  566. package/dist/chunks/types-CQ1wrnQ0.js +1 -0
  567. package/dist/chunks/types-Csi32ZXh.js +17 -0
  568. package/dist/chunks/types-RJTEOuIt.js +3 -0
  569. package/dist/chunks/udsClient-BvG_Jip0.js +1 -0
  570. package/dist/chunks/ultrareviewCommand-DrlfRrXq.js +3 -0
  571. package/dist/chunks/undercover-CBeHiWUd.js +1 -0
  572. package/dist/chunks/undercover-DKn95mh9.js +31 -0
  573. package/dist/chunks/up-D-U4wUCe.js +12 -0
  574. package/dist/chunks/updateCCB-CJ7dCUan.js +11 -0
  575. package/dist/chunks/upgrade-Degqbu8S.js +1 -0
  576. package/dist/chunks/upgrade-ucJ-lnlY.js +1 -0
  577. package/dist/chunks/upload-pTZQCPLt.js +1 -0
  578. package/dist/chunks/upstreamproxy-DcLeL2XX.js +11 -0
  579. package/dist/chunks/usage-D96a7Cke.js +1 -0
  580. package/dist/chunks/usage-DVQMUMcC.js +1 -0
  581. package/dist/chunks/useKeybinding-FsOnjW6T.js +1 -0
  582. package/dist/chunks/useMainLoopModel-B7ch2o9K.js +1 -0
  583. package/dist/chunks/useManagePlugins-BfGzHMvO.js +1 -0
  584. package/dist/chunks/useMergedTools-TemEvCrX.js +1 -0
  585. package/dist/chunks/useSearchInput-B-V4kIa-.js +1 -0
  586. package/dist/chunks/useSettingsErrors-B2JGz1s8.js +1 -0
  587. package/dist/chunks/useVoice-BuwYDm2U.js +1 -0
  588. package/dist/chunks/util-CeIKZmj9.js +1 -0
  589. package/dist/chunks/utils-CwhszpkT.js +1 -0
  590. package/dist/chunks/v4-f1i_CNUT.js +1 -0
  591. package/dist/chunks/validatePlugin-BlVho93x.js +1 -0
  592. package/dist/chunks/vertex-sdk-CSGw3fvU.js +9 -0
  593. package/dist/chunks/vim-DUZQCWUP.js +1 -0
  594. package/dist/chunks/voice-BkRIHZiM.js +2 -0
  595. package/dist/chunks/voice-DXiiy8HX.js +8 -0
  596. package/dist/chunks/voiceModeEnabled-CPQUE3PU.js +1 -0
  597. package/dist/chunks/voiceModeEnabled-DB8GCzAF.js +1 -0
  598. package/dist/chunks/voiceStreamSTT-DgoDscHn.js +1 -0
  599. package/dist/chunks/voiceStreamSTT-Dr_wH1Kh.js +1 -0
  600. package/dist/chunks/which-DqSAIvp2.js +1 -0
  601. package/dist/chunks/windowsPaths-C9CigqoF.js +1 -0
  602. package/dist/chunks/windowsPaths-swxCp7bX.js +2 -0
  603. package/dist/chunks/workSecret-mS2OrpxF.js +1 -0
  604. package/dist/chunks/workerRegistry-CT7_kjvY.js +1 -0
  605. package/dist/chunks/worktree-DU3xtwKW.js +1 -0
  606. package/dist/chunks/worktreeModeEnabled-Db6b_Iy_.js +1 -0
  607. package/dist/chunks/worktreeModeEnabled-THQb19xR.js +1 -0
  608. package/dist/chunks/wrapper-BSK0MCQH.js +1 -0
  609. package/dist/chunks/wrapper-D5qL1aQL.js +6 -0
  610. package/dist/chunks/xdg-CBxMmQux.js +1 -0
  611. package/dist/chunks/xml-DD_ldd3X.js +1 -0
  612. package/dist/chunks/zod-DT6hytkp.js +1 -0
  613. package/dist/cli.js +1 -10978
  614. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-DR8-3Aex.js";import{Mt as t,Rn as n,b as r,o as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{Ka as c,lo as l,oo as u}from"./paths-Q2255dD7.js";import{L as d,V as f,d as p,s as m}from"./debug-UI3T040K.js";import{n as h,r as g}from"./analytics-DqMQntaB.js";import{a as _,n as v}from"./env-chR0gV31.js";import{Ib as y,Lb as b,Mb as x,Nb as S,Pb as C}from"./loadAgentsDir-Ci5mr0vm.js";import{join as w}from"node:path";import{homedir as T}from"node:os";var E=e(n(),1);h(),a(),m(),_(),f(),x(),u();var D=s();function O(){let e=v.platform===`win32`,t=T();return e?w(t,`.local`,`bin`,`claude.exe`).replace(/\//g,`\\`):`~/.local/bin/claude`}function k({messages:e}){return e.length===0?null:(0,D.jsxs)(o,{flexDirection:`column`,gap:0,marginBottom:1,children:[(0,D.jsx)(o,{children:(0,D.jsxs)(r,{color:`warning`,children:[(0,D.jsx)(i,{status:`warning`,withSpace:!0}),`Setup notes:`]})}),e.map((e,t)=>(0,D.jsx)(o,{marginLeft:2,children:(0,D.jsxs)(r,{dimColor:!0,children:[`• `,e]})},t))]})}function A({onDone:e,force:t,target:n}){let[a,s]=(0,E.useState)({type:`checking`});return(0,E.useEffect)(()=>{async function e(){try{p(`Install: Starting installation process (force=${t}, target=${n})`);let e=n||c()?.autoUpdatesChannel||`latest`;s({type:`installing`,version:e}),p(`Install: Calling installLatest(channelOrVersion=${e}, forceReinstall=${t})`);let r=await b(e,t);if(p(`Install: installLatest returned version=${r.latestVersion}, wasUpdated=${r.wasUpdated}, lockFailed=${r.lockFailed}`),r.lockFailed)throw Error(`Could not install - another process is currently installing Claude. Please try again in a moment.`);r.latestVersion||p(`Install: Failed to retrieve version information during install`,{level:`error`}),r.wasUpdated||p(`Install: Already up to date`),s({type:`setting-up`});let i=await S(!0);p(`Install: Setup launcher completed with ${i.length} messages`),i.length>0&&i.forEach(e=>p(`Install: Setup message: ${e.message}`)),p(`Install: Cleaning up npm installations after successful install`);let{removed:a,errors:o,warnings:u}=await C();a>0&&p(`Cleaned up ${a} npm installation(s)`),o.length>0&&p(`Cleanup errors: ${o.join(`, `)}`);let d=await y();d.length>0&&p(`Shell alias cleanup: ${d.map(e=>e.message).join(`; `)}`),g(`tengu_claude_install_command`,{has_version:+!!r.latestVersion,forced:+!!t}),(n===`latest`||n===`stable`)&&(l(`userSettings`,{autoUpdatesChannel:n}),p(`Install: Saved autoUpdatesChannel=${n} to user settings`));let f=[...u,...d.map(e=>e.message)];i.length>0?(s({type:`set-up`,messages:i.map(e=>e.message)}),setTimeout(s,2e3,{type:`success`,version:r.latestVersion||`current`,setupMessages:[...i.map(e=>e.message),...f]})):(p(`Install: Shell PATH already configured`),s({type:`success`,version:r.latestVersion||`current`,setupMessages:f.length>0?f:void 0}))}catch(e){p(`Install command failed: ${e}`,{level:`error`}),s({type:`error`,message:d(e)})}}e()},[t,n]),(0,E.useEffect)(()=>{a.type===`success`?setTimeout(e,2e3,`Claude Code installation completed successfully`,{display:`system`}):a.type===`error`&&setTimeout(e,3e3,`Claude Code installation failed`,{display:`system`})},[a,e]),(0,D.jsxs)(o,{flexDirection:`column`,marginTop:1,children:[a.type===`checking`&&(0,D.jsx)(r,{color:`claude`,children:`Checking installation status...`}),a.type===`cleaning-npm`&&(0,D.jsx)(r,{color:`warning`,children:`Cleaning up old npm installations...`}),a.type===`installing`&&(0,D.jsxs)(r,{color:`claude`,children:[`Installing Claude Code native build `,a.version,`...`]}),a.type===`setting-up`&&(0,D.jsx)(r,{color:`claude`,children:`Setting up launcher and shell integration...`}),a.type===`set-up`&&(0,D.jsx)(k,{messages:a.messages}),a.type===`success`&&(0,D.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(o,{children:[(0,D.jsx)(i,{status:`success`,withSpace:!0}),(0,D.jsx)(r,{color:`success`,bold:!0,children:`Claude Code successfully installed!`})]}),(0,D.jsxs)(o,{marginLeft:2,flexDirection:`column`,gap:1,children:[a.version!==`current`&&(0,D.jsxs)(o,{children:[(0,D.jsx)(r,{dimColor:!0,children:`Version: `}),(0,D.jsx)(r,{color:`claude`,children:a.version})]}),(0,D.jsxs)(o,{children:[(0,D.jsx)(r,{dimColor:!0,children:`Location: `}),(0,D.jsx)(r,{color:`text`,children:O()})]})]}),(0,D.jsx)(o,{marginLeft:2,flexDirection:`column`,gap:1,children:(0,D.jsxs)(o,{marginTop:1,children:[(0,D.jsx)(r,{dimColor:!0,children:`Next: Run `}),(0,D.jsx)(r,{color:`claude`,bold:!0,children:`claude --help`}),(0,D.jsx)(r,{dimColor:!0,children:` to get started`})]})}),a.setupMessages&&(0,D.jsx)(k,{messages:a.setupMessages})]}),a.type===`error`&&(0,D.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(o,{children:[(0,D.jsx)(i,{status:`error`,withSpace:!0}),(0,D.jsx)(r,{color:`error`,children:`Installation failed`})]}),(0,D.jsx)(r,{color:`error`,children:a.message}),(0,D.jsx)(o,{marginTop:1,children:(0,D.jsx)(r,{dimColor:!0,children:`Try running with --force to override checks`})})]})]})}var j={type:`local-jsx`,name:`install`,description:`Install Claude Code native build`,argumentHint:`[options]`,async call(e,n,r){let i=r.includes(`--force`),a=r.filter(e=>!e.startsWith(`--`))[0],{unmount:o}=await t((0,D.jsx)(A,{onDone:(t,n)=>{o(),e(t,n)},force:i,target:a}))}};export{j as install};
@@ -0,0 +1,147 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{F as i,Q as a,Rn as o,T as s,b as c,f as l,g as u,h as d,nt as f,t as p,tn as m,tt as h,v as g,x as _}from"./src-Di342QoJ.js";import{t as v}from"./jsx-runtime-D-D469L8.js";import{Ac as y,Mn as b,Pc as x,Po as ee,Vt as te,cn as S,jo as C,on as w}from"./paths-Q2255dD7.js";import{n as T,r as E}from"./analytics-DqMQntaB.js";import{l as ne,v as re}from"./git-CN3qtTb_.js";import{r as ie,t as ae}from"./execa-CGue6Z3n.js";import{o as oe,s as D}from"./log-CzsijfHZ.js";import{r as se,t as O}from"./execFileNoThrow-CuQN1sz8.js";import{CT as ce,Dx as le,JS as ue,Lw as k,Nx as A,Px as j,ST as de,YS as fe,cy as pe,gy as me,ly as he,my as M,uy as ge}from"./loadAgentsDir-Ci5mr0vm.js";import{n as _e,t as ve}from"./browser-fLRXxIsQ.js";import{t as N}from"./useKeybinding-FsOnjW6T.js";import{l as ye,u as be}from"./referral-ByevBJrE.js";function xe(e){return e.pending?(0,F.jsxs)(c,{children:[`Press `,e.keyName,` again to exit`]}):(0,F.jsxs)(d,{children:[(0,F.jsx)(u,{shortcut:`↑↓`,action:`navigate`}),(0,F.jsx)(u,{shortcut:`Space`,action:`toggle`}),(0,F.jsx)(u,{shortcut:`Enter`,action:`confirm`}),(0,F.jsx)(ue,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}function Se({onSubmit:e,defaultSelections:t}){let[n,r]=(0,P.useState)(!1),i=(0,P.useCallback)(t=>{if(t.length===0){r(!0);return}r(!1),e(t)},[e]),o=(0,P.useCallback)(()=>{r(!1)},[]),s=(0,P.useCallback)(()=>{r(!0)},[]);return(0,F.jsxs)(l,{title:`Select GitHub workflows to install`,subtitle:`We'll create a workflow file in your repository for each one you select.`,onCancel:s,inputGuide:xe,children:[(0,F.jsx)(_,{children:(0,F.jsxs)(c,{dimColor:!0,children:[`More workflow examples (issue triage, CI fixes, etc.) at:`,` `,(0,F.jsx)(a,{url:`https://github.com/anthropics/claude-code-action/blob/main/examples/`,children:`https://github.com/anthropics/claude-code-action/blob/main/examples/`})]})}),(0,F.jsx)(he,{options:Ce.map(e=>({label:e.label,value:e.value})),defaultValue:t,onSubmit:i,onChange:o,onCancel:s,hideIndexes:!0}),n&&(0,F.jsx)(_,{children:(0,F.jsx)(c,{color:`error`,children:`You must select at least one workflow to continue`})})]})}var P,F,Ce,we=e((()=>{P=t(o(),1),p(),fe(),ge(),F=v(),Ce=[{value:`claude`,label:`@Claude Code - Tag @claude in issues and PR comments`},{value:`claude-review`,label:`Claude Code Review - Automated code review on new PRs`}]})),Te,I,Ee,De,Oe,L=e((()=>{Te=`Add Claude Code GitHub Workflow`,I=`https://github.com/anthropics/claude-code-action/blob/main/docs/setup.md`,Ee=`name: Claude Code
2
+
3
+ on:
4
+ issue_comment:
5
+ types: [created]
6
+ pull_request_review_comment:
7
+ types: [created]
8
+ issues:
9
+ types: [opened, assigned]
10
+ pull_request_review:
11
+ types: [submitted]
12
+
13
+ jobs:
14
+ claude:
15
+ if: |
16
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17
+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18
+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19
+ (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20
+ runs-on: ubuntu-latest
21
+ permissions:
22
+ contents: read
23
+ pull-requests: read
24
+ issues: read
25
+ id-token: write
26
+ actions: read # Required for Claude to read CI results on PRs
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, 2026-04-25
30
+ with:
31
+ fetch-depth: 1
32
+
33
+ - name: Run Claude Code
34
+ id: claude
35
+ uses: anthropics/claude-code-action@567fe954a4527e81f132d87d1bdbcc94f7737434 # v1, 2026-04-25
36
+ with:
37
+ anthropic_api_key: \${{ secrets.ANTHROPIC_API_KEY }}
38
+
39
+ # This is an optional setting that allows Claude to read CI results on PRs
40
+ additional_permissions: |
41
+ actions: read
42
+
43
+ # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44
+ # prompt: 'Update the pull request description to include a summary of changes.'
45
+
46
+ # Optional: Add claude_args to customize behavior and configuration
47
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48
+ # or https://code.claude.com/docs/en/cli-reference for available options
49
+ # claude_args: '--allowed-tools Bash(gh pr:*)'
50
+
51
+ `,De=`## 🤖 Installing Claude Code GitHub App
52
+
53
+ This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository.
54
+
55
+ ### What is Claude Code?
56
+
57
+ [Claude Code](https://claude.com/claude-code) is an AI coding agent that can help with:
58
+ - Bug fixes and improvements
59
+ - Documentation updates
60
+ - Implementing new features
61
+ - Code reviews and suggestions
62
+ - Writing tests
63
+ - And more!
64
+
65
+ ### How it works
66
+
67
+ Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment.
68
+ Once the workflow is triggered, Claude will analyze the comment and surrounding context, and execute on the request in a GitHub action.
69
+
70
+ ### Important Notes
71
+
72
+ - **This workflow won't take effect until this PR is merged**
73
+ - **@claude mentions won't work until after the merge is complete**
74
+ - The workflow runs automatically whenever Claude is mentioned in PR or issue comments
75
+ - Claude gets access to the entire PR or issue context including files, diffs, and previous comments
76
+
77
+ ### Security
78
+
79
+ - Our Anthropic API key is securely stored as a GitHub Actions secret
80
+ - Only users with write access to the repository can trigger the workflow
81
+ - All Claude runs are stored in the GitHub Actions run history
82
+ - Claude's default tools are limited to reading/writing files and interacting with our repo by creating comments, branches, and commits.
83
+ - We can add more allowed tools by adding them to the workflow file like:
84
+
85
+ \`\`\`
86
+ allowed_tools: Bash(npm install),Bash(npm run build),Bash(npm run lint),Bash(npm run test)
87
+ \`\`\`
88
+
89
+ There's more information in the [Claude Code action repo](https://github.com/anthropics/claude-code-action).
90
+
91
+ After merging this PR, let's try mentioning @claude in a comment on any PR to get started!`,Oe=`name: Claude Code Review
92
+
93
+ on:
94
+ pull_request:
95
+ types: [opened, synchronize, ready_for_review, reopened]
96
+ # Optional: Only run on specific file changes
97
+ # paths:
98
+ # - "src/**/*.ts"
99
+ # - "src/**/*.tsx"
100
+ # - "src/**/*.js"
101
+ # - "src/**/*.jsx"
102
+
103
+ jobs:
104
+ claude-review:
105
+ # Optional: Filter by PR author
106
+ # if: |
107
+ # github.event.pull_request.user.login == 'external-contributor' ||
108
+ # github.event.pull_request.user.login == 'new-developer' ||
109
+ # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
110
+
111
+ runs-on: ubuntu-latest
112
+ permissions:
113
+ contents: read
114
+ pull-requests: read
115
+ issues: read
116
+ id-token: write
117
+
118
+ steps:
119
+ - name: Checkout repository
120
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, 2026-04-25
121
+ with:
122
+ fetch-depth: 1
123
+
124
+ - name: Run Claude Code Review
125
+ id: claude-review
126
+ uses: anthropics/claude-code-action@567fe954a4527e81f132d87d1bdbcc94f7737434 # v1, 2026-04-25
127
+ with:
128
+ anthropic_api_key: \${{ secrets.ANTHROPIC_API_KEY }}
129
+ plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
130
+ plugins: 'code-review@claude-code-plugins'
131
+ prompt: '/code-review:code-review \${{ github.repository }}/pull/\${{ github.event.pull_request.number }}'
132
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
133
+ # or https://code.claude.com/docs/en/cli-reference for available options
134
+
135
+ `}));function ke({existingApiKey:e,apiKeyOrOAuthToken:t,onApiKeyChange:n,onSubmit:r,onToggleUseExistingKey:a,onCreateOAuthToken:o,selectedOption:l=e?`existing`:o?`oauth`:`new`,onSelectOption:u}){let[d,p]=(0,R.useState)(0),m=i(),[h]=s(),v=(0,R.useCallback)(()=>{l===`new`&&o?u?.(`oauth`):l===`oauth`&&e&&(u?.(`existing`),a(!0))},[l,o,e,u,a]),y=(0,R.useCallback)(()=>{l===`existing`?(u?.(o?`oauth`:`new`),a(!1)):l===`oauth`&&u?.(`new`)},[l,o,u,a]),b=(0,R.useCallback)(()=>{l===`oauth`&&o?o():r()},[l,o,r]),x=l===`new`;return f({"confirm:previous":v,"confirm:next":y,"confirm:yes":b},{context:`Confirmation`,isActive:!x}),f({"confirm:previous":v,"confirm:next":y},{context:`Confirmation`,isActive:x}),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,z.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,z.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,z.jsx)(c,{dimColor:!0,children:`Choose API key`})]}),e&&(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`existing`?g(`success`,h)(`> `):` `,`Use your existing Claude Code API key`]})}),o&&(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`oauth`?g(`success`,h)(`> `):` `,`Create a long-lived token with your Claude subscription`]})}),(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`new`?g(`success`,h)(`> `):` `,`Enter a new API key`]})}),l===`new`&&(0,z.jsx)(A,{value:t,onChange:n,onSubmit:r,onPaste:n,focus:!0,placeholder:`sk-ant… (Create a new key at https://platform.claude.com/settings/keys)`,mask:`*`,columns:m.columns,cursorOffset:d,onChangeCursorOffset:p,showCursor:!0})]}),(0,z.jsx)(_,{marginLeft:3,children:(0,z.jsx)(c,{dimColor:!0,children:`↑/↓ to select · Enter to continue`})})]})}var R,z,Ae=e((()=>{R=t(o(),1),j(),k(),p(),N(),z=v()}));function je({useExistingSecret:e,secretName:t,onToggleUseExistingSecret:n,onSecretNameChange:r,onSubmit:a}){let[o,l]=(0,B.useState)(0),u=i(),[d]=s(),p=(0,B.useCallback)(()=>n(!0),[n]),m=(0,B.useCallback)(()=>n(!1),[n]);return f({"confirm:previous":p,"confirm:next":m,"confirm:yes":a},{context:`Confirmation`,isActive:e}),f({"confirm:previous":p,"confirm:next":m},{context:`Confirmation`,isActive:!e}),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,V.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,V.jsx)(c,{dimColor:!0,children:`Setup API key secret`})]}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{color:`warning`,children:`ANTHROPIC_API_KEY already exists in repository secrets!`})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{children:`Would you like to:`})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsxs)(c,{children:[e?g(`success`,d)(`> `):` `,`Use the existing API key`]})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsxs)(c,{children:[e?` `:g(`success`,d)(`> `),`Create a new secret with a different name`]})}),!e&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{children:`Enter new secret name (alphanumeric with underscores):`})}),(0,V.jsx)(A,{value:t,onChange:r,onSubmit:a,focus:!0,placeholder:`e.g., CLAUDE_API_KEY`,columns:u.columns,cursorOffset:o,onChangeCursorOffset:l,showCursor:!0})]})]}),(0,V.jsx)(_,{marginLeft:3,children:(0,V.jsx)(c,{dimColor:!0,children:`↑/↓ to select · Enter to continue`})})]})}var B,V,Me=e((()=>{B=t(o(),1),j(),k(),p(),N(),V=v()}));function Ne(){return(0,Pe.jsx)(c,{children:`Checking GitHub CLI installation…`})}var Pe,Fe=e((()=>{p(),Pe=v()}));function Ie({currentRepo:e,useCurrentRepo:t,repoUrl:n,onRepoUrlChange:r,onSubmit:a,onToggleUseCurrentRepo:o}){let[s,l]=(0,H.useState)(0),[u,d]=(0,H.useState)(!1),p=i().columns,m=(0,H.useCallback)(()=>{if(!(t?e:n)?.trim()){d(!0);return}a()},[t,e,n,a]),h=!t||!e,g=(0,H.useCallback)(()=>{o(!0),d(!1)},[o]),v=(0,H.useCallback)(()=>{o(!1),d(!1)},[o]);return f({"confirm:previous":g,"confirm:next":v,"confirm:yes":m},{context:`Confirmation`,isActive:!h}),f({"confirm:previous":g,"confirm:next":v},{context:`Confirmation`,isActive:h}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,U.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,U.jsx)(c,{dimColor:!0,children:`Select GitHub repository`})]}),e&&(0,U.jsx)(_,{marginBottom:1,children:(0,U.jsxs)(c,{bold:t,color:t?`permission`:void 0,children:[t?`> `:` `,`Use current repository: `,e]})}),(0,U.jsx)(_,{marginBottom:1,children:(0,U.jsxs)(c,{bold:!t||!e,color:!t||!e?`permission`:void 0,children:[!t||!e?`> `:` `,e?`Enter a different repository`:`Enter repository`]})}),(!t||!e)&&(0,U.jsx)(_,{marginLeft:2,marginBottom:1,children:(0,U.jsx)(A,{value:n,onChange:e=>{r(e),d(!1)},onSubmit:m,focus:!0,placeholder:`Enter a repo as owner/repo or https://github.com/owner/repo…`,columns:p,cursorOffset:s,onChangeCursorOffset:l,showCursor:!0})})]}),u&&(0,U.jsx)(_,{marginLeft:3,marginBottom:1,children:(0,U.jsx)(c,{color:`error`,children:`Please enter a repository name to continue`})}),(0,U.jsx)(_,{marginLeft:3,children:(0,U.jsxs)(c,{dimColor:!0,children:[e?`↑/↓ to select · `:``,`Enter to continue`]})})]})}var H,U,Le=e((()=>{H=t(o(),1),j(),k(),p(),N(),U=v()}));function Re({currentWorkflowInstallStep:e,secretExists:t,useExistingSecret:n,secretName:r,skipWorkflow:i=!1,selectedWorkflows:a}){let o=i?[`Getting repository information`,t&&n?`Using existing API key secret`:`Setting up ${r} secret`]:[`Getting repository information`,`Creating branch`,a.length>1?`Creating workflow files`:`Creating workflow file`,t&&n?`Using existing API key secret`:`Setting up ${r} secret`,`Opening pull request page`];return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,W.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,W.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,W.jsx)(c,{dimColor:!0,children:`Create GitHub Actions workflow`})]}),o.map((t,n)=>{let r=`pending`;return n<e?r=`completed`:n===e&&(r=`in-progress`),(0,W.jsx)(_,{children:(0,W.jsxs)(c,{color:r===`completed`?`success`:r===`in-progress`?`warning`:void 0,children:[r===`completed`?`✓ `:``,t,r===`in-progress`?`…`:``]})},n)})]})})}var W,ze=e((()=>{p(),W=v()}));function Be({error:e,errorReason:t,errorInstructions:n}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,G.jsx)(_,{flexDirection:`column`,marginBottom:1,children:(0,G.jsx)(c,{bold:!0,children:`Install GitHub App`})}),(0,G.jsxs)(c,{color:`error`,children:[`Error: `,e]}),t&&(0,G.jsx)(_,{marginTop:1,children:(0,G.jsxs)(c,{dimColor:!0,children:[`Reason: `,t]})}),n&&n.length>0&&(0,G.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,G.jsx)(c,{dimColor:!0,children:`How to fix:`}),n.map((e,t)=>(0,G.jsxs)(_,{marginLeft:2,children:[(0,G.jsx)(c,{dimColor:!0,children:`• `}),(0,G.jsx)(c,{children:e})]},t))]}),(0,G.jsx)(_,{marginTop:1,children:(0,G.jsxs)(c,{dimColor:!0,children:[`For manual setup instructions, see: `,(0,G.jsx)(c,{color:`claude`,children:I})]})})]}),(0,G.jsx)(_,{marginLeft:3,children:(0,G.jsx)(c,{dimColor:!0,children:`Press any key to exit`})})]})}var G,Ve=e((()=>{L(),p(),G=v()}));function He({repoName:e,onSelectAction:t}){return(0,K.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,borderDimColor:!0,paddingX:1,children:[(0,K.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsx)(c,{bold:!0,children:`Existing Workflow Found`}),(0,K.jsxs)(c,{dimColor:!0,children:[`Repository: `,e]})]}),(0,K.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsxs)(c,{children:[`A Claude workflow file already exists at `,(0,K.jsx)(c,{color:`claude`,children:`.github/workflows/claude.yml`})]}),(0,K.jsx)(c,{dimColor:!0,children:`What would you like to do?`})]}),(0,K.jsx)(_,{flexDirection:`column`,children:(0,K.jsx)(le,{options:[{label:`Update workflow file with latest version`,value:`update`},{label:`Skip workflow update (configure secrets only)`,value:`skip`},{label:`Exit without making changes`,value:`exit`}],onChange:e=>{t(e)},onCancel:()=>{t(`exit`)}})}),(0,K.jsx)(_,{marginTop:1,children:(0,K.jsxs)(c,{dimColor:!0,children:[`View the latest workflow template at:`,` `,(0,K.jsx)(c,{color:`claude`,children:`https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml`})]})})]})}var K,Ue=e((()=>{pe(),p(),K=v()}));function We({repoUrl:e,onSubmit:t}){return h(`confirm:yes`,t,{context:`Confirmation`}),(0,q.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,borderDimColor:!0,paddingX:1,children:[(0,q.jsx)(_,{flexDirection:`column`,marginBottom:1,children:(0,q.jsx)(c,{bold:!0,children:`Install the Claude GitHub App`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{children:`Opening browser to install the Claude GitHub App…`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{children:`If your browser doesn't open automatically, visit:`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{underline:!0,children:`https://github.com/apps/claude`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsxs)(c,{children:[`Please install the app for repository: `,(0,q.jsx)(c,{bold:!0,children:e})]})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{dimColor:!0,children:`Important: Make sure to grant access to this specific repository`})}),(0,q.jsx)(_,{children:(0,q.jsxs)(c,{bold:!0,color:`permission`,children:[`Press Enter once you've installed the app`,r.ellipsis]})}),(0,q.jsx)(_,{marginTop:1,children:(0,q.jsxs)(c,{dimColor:!0,children:[`Having trouble? See manual setup instructions at: `,(0,q.jsx)(c,{color:`claude`,children:I})]})})]})}var q,Ge=e((()=>{n(),L(),p(),N(),q=v()}));function Ke({onSuccess:e,onCancel:t}){let[n,r]=(0,J.useState)({state:`starting`}),[o]=(0,J.useState)(()=>new de),[s,l]=(0,J.useState)(``),[d,f]=(0,J.useState)(0),[p,h]=(0,J.useState)(!1),[g,v]=(0,J.useState)(!1),y=(0,J.useRef)(new Set),x=(0,J.useRef)(void 0),ee=i(),te=Math.max(50,ee.columns-30-4);function S(e){n.state===`error`&&(e.preventDefault(),e.key===`return`&&n.toRetry?(l(``),f(0),r({state:`about_to_retry`,nextState:n.toRetry})):t())}async function C(e,t){try{let[n,i]=e.split(`#`);if(!n||!i){r({state:`error`,message:`Invalid code. Please make sure the full code was copied`,toRetry:{state:`waiting_for_login`,url:t}});return}E(`tengu_oauth_manual_entry`,{}),o.handleManualAuthCodeInput({authorizationCode:n,state:i})}catch(e){D(e),r({state:`error`,message:e.message,toRetry:{state:`waiting_for_login`,url:t}})}}let w=(0,J.useCallback)(async()=>{y.current.forEach(e=>clearTimeout(e)),y.current.clear();try{let t=await o.startOAuthFlow(async e=>{r({state:`waiting_for_login`,url:e});let t=setTimeout(h,3e3,!0);y.current.add(t)},{loginWithClaudeAi:!0,inferenceOnly:!0,expiresIn:365*24*60*60});r({state:`processing`}),b(t);let n=setTimeout((e,t,n,r)=>{e({state:`success`,token:t});let i=setTimeout(n,1e3,t);r.current.add(i)},100,r,t.accessToken,e,y);y.current.add(n)}catch(e){let t=e.message;r({state:`error`,message:t,toRetry:{state:`starting`}}),D(e),E(`tengu_oauth_error`,{error:t})}},[o,e]);(0,J.useEffect)(()=>{n.state===`starting`&&w()},[n.state,w]),(0,J.useEffect)(()=>{if(n.state===`about_to_retry`){let e=setTimeout((e,t,n)=>{t(e.state===`waiting_for_login`),n(e)},500,n.nextState,h,r);y.current.add(e)}},[n]),(0,J.useEffect)(()=>{s===`c`&&n.state===`waiting_for_login`&&p&&!g&&(m(n.url).then(e=>{e&&process.stdout.write(e),v(!0),clearTimeout(x.current),x.current=setTimeout(v,2e3,!1)}),l(``))},[s,n,p,g]),(0,J.useEffect)(()=>{let e=y.current;return()=>{o.cleanup(),e.forEach(e=>clearTimeout(e)),e.clear(),clearTimeout(x.current)}},[o]);function T(){switch(n.state){case`starting`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(M,{}),(0,Y.jsx)(c,{children:`Starting authentication…`})]});case`waiting_for_login`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[!p&&(0,Y.jsxs)(_,{children:[(0,Y.jsx)(M,{}),(0,Y.jsx)(c,{children:`Opening browser to sign in with your Claude account…`})]}),p&&(0,Y.jsxs)(_,{children:[(0,Y.jsx)(c,{children:qe}),(0,Y.jsx)(A,{value:s,onChange:l,onSubmit:e=>C(e,n.url),cursorOffset:d,onChangeCursorOffset:f,columns:te})]})]});case`processing`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(M,{}),(0,Y.jsx)(c,{children:`Processing authentication…`})]});case`success`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,Y.jsx)(c,{color:`success`,children:`✓ Authentication token created successfully!`}),(0,Y.jsx)(c,{dimColor:!0,children:`Using token for GitHub Actions setup…`})]});case`error`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,Y.jsxs)(c,{color:`error`,children:[`OAuth error: `,n.message]}),n.toRetry?(0,Y.jsx)(c,{dimColor:!0,children:`Press Enter to try again, or any other key to cancel`}):(0,Y.jsx)(c,{dimColor:!0,children:`Press any key to return to API key selection`})]});case`about_to_retry`:return(0,Y.jsx)(_,{flexDirection:`column`,gap:1,children:(0,Y.jsx)(c,{color:`permission`,children:`Retrying…`})});default:return null}}return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:S,children:[n.state===`starting`&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsx)(c,{bold:!0,children:`Create Authentication Token`}),(0,Y.jsx)(c,{dimColor:!0,children:`Creating a long-lived token for GitHub Actions`})]}),n.state!==`success`&&n.state!==`starting`&&n.state!==`processing`&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsx)(c,{bold:!0,children:`Create Authentication Token`}),(0,Y.jsx)(c,{dimColor:!0,children:`Creating a long-lived token for GitHub Actions`})]},`header`),n.state===`waiting_for_login`&&p&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsxs)(_,{paddingX:1,children:[(0,Y.jsx)(c,{dimColor:!0,children:`Browser didn't open? Use the url below to sign in `}),g?(0,Y.jsx)(c,{color:`success`,children:`(Copied!)`}):(0,Y.jsx)(c,{dimColor:!0,children:(0,Y.jsx)(u,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,Y.jsx)(a,{url:n.url,children:(0,Y.jsx)(c,{dimColor:!0,children:n.url})})]},`urlToCopy`),(0,Y.jsx)(_,{paddingLeft:1,flexDirection:`column`,gap:1,children:T()})]})}var J,Y,qe,Je=e((()=>{J=t(o(),1),T(),p(),me(),j(),k(),ce(),w(),oe(),Y=v(),qe=`Paste code here if prompted > `}));function Ye({secretExists:e,useExistingSecret:t,secretName:n,skipWorkflow:r=!1}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,X.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,X.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,X.jsx)(c,{dimColor:!0,children:`Success`})]}),!r&&(0,X.jsx)(c,{color:`success`,children:`✓ GitHub Actions workflow created!`}),e&&t&&(0,X.jsx)(_,{marginTop:1,children:(0,X.jsx)(c,{color:`success`,children:`✓ Using existing ANTHROPIC_API_KEY secret`})}),(!e||!t)&&(0,X.jsx)(_,{marginTop:1,children:(0,X.jsxs)(c,{color:`success`,children:[`✓ API key saved as `,n,` secret`]})}),(0,X.jsx)(_,{marginTop:1,children:(0,X.jsx)(c,{children:`Next steps:`})}),r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{children:`1. Install the Claude GitHub App if you haven't already`}),(0,X.jsx)(c,{children:`2. Your workflow file was kept unchanged`}),(0,X.jsx)(c,{children:`3. API key is configured and ready to use`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{children:`1. A pre-filled PR page has been created`}),(0,X.jsx)(c,{children:`2. Install the Claude GitHub App if you haven't already`}),(0,X.jsx)(c,{children:`3. Merge the PR to enable Claude PR assistance`})]})]}),(0,X.jsx)(_,{marginLeft:3,children:(0,X.jsx)(c,{dimColor:!0,children:`Press any key to exit`})})]})}var X,Xe=e((()=>{o(),p(),X=v()}));async function Ze(e,t,n,r,i,a,o){let s=await O(`gh`,[`api`,`repos/${e}/contents/${n}`,`--jq`,`.sha`]),c=null;s.code===0&&(c=s.stdout.trim());let l=r;i===`CLAUDE_CODE_OAUTH_TOKEN`?l=r.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,"claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}"):i!==`ANTHROPIC_API_KEY`&&(l=r.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,`anthropic_api_key: \${{ secrets.${i} }}`));let u=Buffer.from(l).toString(`base64`),d=[`api`,`--method`,`PUT`,`repos/${e}/contents/${n}`,`-f`,`message=${c?`"Update ${a}"`:`"${a}"`}`,`-f`,`content=${u}`,`-f`,`branch=${t}`];c&&d.push(`-f`,`sha=${c}`);let f=await O(`gh`,d);if(f.code!==0)throw f.stderr.includes(`422`)&&f.stderr.includes(`sha`)?(E(`tengu_setup_github_actions_failed`,{reason:`failed_to_create_workflow_file`,exit_code:f.code,...o}),Error(`Failed to create workflow file ${n}: A Claude workflow file already exists in this repository. Please remove it first or update it manually.`)):(E(`tengu_setup_github_actions_failed`,{reason:`failed_to_create_workflow_file`,exit_code:f.code,...o}),Error(`Failed to create workflow file ${n}: ${f.stderr}
136
+
137
+ Need help? Common issues:
138
+ · Permission denied → Run: gh auth refresh -h github.com -s repo,workflow
139
+ · Not authorized → Ensure you have admin access to the repository
140
+ · For manual setup → Visit: https://github.com/anthropics/claude-code-action`))}async function Qe(e,t,n,r,i=!1,a,o,s){try{E(`tengu_setup_github_actions_started`,{skip_workflow:i,has_api_key:!!t,using_default_secret_name:n===`ANTHROPIC_API_KEY`,selected_claude_workflow:a.includes(`claude`),selected_claude_review_workflow:a.includes(`claude-review`),...s});let c=await O(`gh`,[`api`,`repos/${e}`,`--jq`,`.id`]);if(c.code!==0)throw E(`tengu_setup_github_actions_failed`,{reason:`repo_not_found`,exit_code:c.code,...s}),Error(`Failed to access repository ${e}: ${c.stderr}`);let l=await O(`gh`,[`api`,`repos/${e}`,`--jq`,`.default_branch`]);if(l.code!==0)throw E(`tengu_setup_github_actions_failed`,{reason:`failed_to_get_default_branch`,exit_code:l.code,...s}),Error(`Failed to get default branch: ${l.stderr}`);let u=l.stdout.trim(),d=await O(`gh`,[`api`,`repos/${e}/git/ref/heads/${u}`,`--jq`,`.object.sha`]);if(d.code!==0)throw E(`tengu_setup_github_actions_failed`,{reason:`failed_to_get_branch_sha`,exit_code:d.code,...s}),Error(`Failed to get branch SHA: ${d.stderr}`);let f=d.stdout.trim(),p=null;if(!i){r(),p=`add-claude-github-actions-${Date.now()}`;let t=await O(`gh`,[`api`,`--method`,`POST`,`repos/${e}/git/refs`,`-f`,`ref=refs/heads/${p}`,`-f`,`sha=${f}`]);if(t.code!==0)throw E(`tengu_setup_github_actions_failed`,{reason:`failed_to_create_branch`,exit_code:t.code,...s}),Error(`Failed to create branch: ${t.stderr}`);r();let i=[];a.includes(`claude`)&&i.push({path:`.github/workflows/claude.yml`,content:Ee,message:`Claude PR Assistant workflow`}),a.includes(`claude-review`)&&i.push({path:`.github/workflows/claude-code-review.yml`,content:Oe,message:`Claude Code Review workflow`});for(let t of i)await Ze(e,p,t.path,t.content,n,t.message,s)}if(r(),t){let r=await O(`gh`,[`secret`,`set`,n,`--body`,t,`--repo`,e]);if(r.code!==0)throw E(`tengu_setup_github_actions_failed`,{reason:`failed_to_set_api_key_secret`,exit_code:r.code,...s}),Error(`Failed to set API key secret: ${r.stderr||`Unknown error`}
141
+
142
+ Need help? Common issues:
143
+ · Permission denied → Run: gh auth refresh -h github.com -s repo
144
+ · Not authorized → Ensure you have admin access to the repository
145
+ · For manual setup → Visit: https://github.com/anthropics/claude-code-action`)}!i&&p&&(r(),await _e(`https://github.com/${e}/compare/${u}...${p}?quick_pull=1&title=${encodeURIComponent(Te)}&body=${encodeURIComponent(De)}`)),E(`tengu_setup_github_actions_completed`,{skip_workflow:i,has_api_key:!!t,auth_type:o,using_default_secret_name:n===`ANTHROPIC_API_KEY`,selected_claude_workflow:a.includes(`claude`),selected_claude_review_workflow:a.includes(`claude-review`),...s}),x(e=>({...e,githubActionSetupCount:(e.githubActionSetupCount??0)+1}))}catch(e){throw(!e||!(e instanceof Error)||!e.message.includes(`Failed to`))&&E(`tengu_setup_github_actions_failed`,{reason:`unexpected_error`,...s}),e instanceof Error&&D(e),e}}var $e=e((()=>{T(),y(),L(),ve(),se(),oe()}));function et({warnings:e,onContinue:t}){return h(`confirm:yes`,t,{context:`Confirmation`}),(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,Z.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(c,{bold:!0,children:[r.warning,` Setup Warnings`]}),(0,Z.jsx)(c,{dimColor:!0,children:`We found some potential issues, but you can continue anyway`})]}),e.map((e,t)=>(0,Z.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsx)(c,{color:`warning`,bold:!0,children:e.title}),(0,Z.jsx)(c,{children:e.message}),e.instructions.length>0&&(0,Z.jsx)(_,{flexDirection:`column`,marginLeft:2,marginTop:1,children:e.instructions.map((e,t)=>(0,Z.jsxs)(c,{dimColor:!0,children:[`• `,e]},t))})]},t)),(0,Z.jsx)(_,{marginTop:1,children:(0,Z.jsx)(c,{bold:!0,color:`permission`,children:`Press Enter to continue anyway, or Ctrl+C to exit and fix issues`})}),(0,Z.jsx)(_,{marginTop:1,children:(0,Z.jsxs)(c,{dimColor:!0,children:[`You can also try the manual setup steps if needed:`,` `,(0,Z.jsx)(c,{color:`claude`,children:I})]})})]})})}var Z,tt=e((()=>{n(),L(),p(),N(),Z=v()}));function nt(e){let[t]=(0,Q.useState)(()=>te()),[n,r]=(0,Q.useState)({...it,useExistingKey:!!t,selectedApiKeyOption:t?`existing`:S()?`oauth`:`new`});be(),Q.useEffect(()=>{E(`tengu_install_github_app_started`,{})},[]);let i=(0,Q.useCallback)(async()=>{let e=[];(await ae(`gh --version`,{shell:!0,reject:!1})).exitCode!==0&&e.push({title:`GitHub CLI not found`,message:`GitHub CLI (gh) does not appear to be installed or accessible.`,instructions:[`Install GitHub CLI from https://cli.github.com/`,`macOS: brew install gh`,`Windows: winget install --id GitHub.cli`,`Linux: See installation instructions at https://github.com/cli/cli#installation`]});let t=await ae(`gh auth status -a`,{shell:!0,reject:!1});if(t.exitCode!==0)e.push({title:`GitHub CLI not authenticated`,message:`GitHub CLI does not appear to be authenticated.`,instructions:[`Run: gh auth login`,`Follow the prompts to authenticate with GitHub`,`Or set up authentication using environment variables or other methods`]});else{let e=t.stdout.match(/Token scopes:.*$/m);if(e){let t=e[0],n=[];if(t.includes(`repo`)||n.push(`repo`),t.includes(`workflow`)||n.push(`workflow`),n.length>0){r(e=>({...e,step:`error`,error:`GitHub CLI is missing required permissions: ${n.join(`, `)}.`,errorReason:`Missing required scopes`,errorInstructions:[`Your GitHub CLI authentication is missing the "${n.join(`" and "`)}" ${ee(n.length,`scope`)} needed to manage GitHub Actions and secrets.`,``,`To fix this, run:`,` gh auth refresh -h github.com -s repo,workflow`,``,`This will add the necessary permissions to manage workflows and secrets.`]}));return}}}let n=await ne()??``;E(`tengu_install_github_app_step_completed`,{step:`check-gh`}),r(t=>({...t,warnings:e,currentRepo:n,selectedRepoName:n,useCurrentRepo:!!n,step:e.length>0?`warnings`:`choose-repo`}))},[]);Q.useEffect(()=>{n.step===`check-gh`&&i()},[n.step,i]);let a=(0,Q.useCallback)(async(e,t)=>{r(e=>({...e,step:`creating`,currentWorkflowInstallStep:0}));try{await Qe(n.selectedRepoName,e,t,()=>{r(e=>({...e,currentWorkflowInstallStep:e.currentWorkflowInstallStep+1}))},n.workflowAction===`skip`,n.selectedWorkflows,n.authType,{useCurrentRepo:n.useCurrentRepo,workflowExists:n.workflowExists,secretExists:n.secretExists}),E(`tengu_install_github_app_step_completed`,{step:`creating`}),r(e=>({...e,step:`success`}))}catch(e){let t=e instanceof Error?e.message:`Failed to set up GitHub Actions`;t.includes(`workflow file already exists`)?(E(`tengu_install_github_app_error`,{reason:`workflow_file_exists`}),r(e=>({...e,step:`error`,error:`A Claude workflow file already exists in this repository.`,errorReason:`Workflow file conflict`,errorInstructions:[`The file .github/workflows/claude.yml already exists`,`You can either:`,` 1. Delete the existing file and run this command again`,` 2. Update the existing file manually using the template from:`,` ${I}`]}))):(E(`tengu_install_github_app_error`,{reason:`setup_github_actions_failed`}),r(e=>({...e,step:`error`,error:t,errorReason:`GitHub Actions setup failed`,errorInstructions:[]})))}},[n.selectedRepoName,n.workflowAction,n.selectedWorkflows,n.useCurrentRepo,n.workflowExists,n.secretExists,n.authType]);async function o(){await _e(`https://github.com/apps/claude`)}async function s(e){try{let t=await O(`gh`,[`api`,`repos/${e}`,`--jq`,`.permissions.admin`]);return t.code===0?{hasAccess:t.stdout.trim()===`true`}:t.stderr.includes(`404`)||t.stderr.includes(`Not Found`)?{hasAccess:!1,error:`repository_not_found`}:{hasAccess:!1}}catch{return{hasAccess:!1}}}async function c(e){return(await O(`gh`,[`api`,`repos/${e}/contents/.github/workflows/claude.yml`,`--jq`,`.sha`])).code===0}async function l(){let e=await O(`gh`,[`secret`,`list`,`--app`,`actions`,`--repo`,n.selectedRepoName]);e.code===0&&e.stdout.split(`
146
+ `).some(e=>/^ANTHROPIC_API_KEY\s+/.test(e))?r(e=>({...e,secretExists:!0,step:`check-existing-secret`})):t?(r(e=>({...e,apiKeyOrOAuthToken:t,useExistingKey:!0})),await a(t,n.secretName)):r(e=>({...e,step:`api-key`}))}let u=async()=>{if(n.step===`warnings`)E(`tengu_install_github_app_step_completed`,{step:`warnings`}),r(e=>({...e,step:`install-app`})),setTimeout(o,0);else if(n.step===`choose-repo`){let e=n.useCurrentRepo?n.currentRepo:n.selectedRepoName;if(!e.trim())return;let t=[];if(e.includes(`github.com`)){let n=e.match(/github\.com[:/]([^/]+\/[^/]+)(\.git)?$/);n?e=n[1]?.replace(/\.git$/,``)||``:t.push({title:`Invalid GitHub URL format`,message:`The repository URL format appears to be invalid.`,instructions:[`Use format: owner/repo or https://github.com/owner/repo`,`Example: anthropics/claude-cli`]})}e.includes(`/`)||t.push({title:`Repository format warning`,message:`Repository should be in format "owner/repo"`,instructions:[`Use format: owner/repo`,`Example: anthropics/claude-cli`]});let i=await s(e);i.error===`repository_not_found`?t.push({title:`Repository not found`,message:`Repository ${e} was not found or you don't have access.`,instructions:[`Check that the repository name is correct: ${e}`,`Ensure you have access to this repository`,`For private repositories, make sure your GitHub token has the "repo" scope`,`You can add the repo scope with: gh auth refresh -h github.com -s repo,workflow`]}):i.hasAccess||t.push({title:`Admin permissions required`,message:`You might need admin permissions on ${e} to set up GitHub Actions.`,instructions:[`Repository admins can install GitHub Apps and set secrets`,`Ask a repository admin to run this command if setup fails`,`Alternatively, you can use the manual setup instructions`]});let a=await c(e);if(t.length>0){let i=[...n.warnings,...t];r(t=>({...t,selectedRepoName:e,workflowExists:a,warnings:i,step:`warnings`}))}else E(`tengu_install_github_app_step_completed`,{step:`choose-repo`}),r(t=>({...t,selectedRepoName:e,workflowExists:a,step:`install-app`})),setTimeout(o,0)}else if(n.step===`install-app`)E(`tengu_install_github_app_step_completed`,{step:`install-app`}),n.workflowExists?r(e=>({...e,step:`check-existing-workflow`})):r(e=>({...e,step:`select-workflows`}));else if(n.step===`check-existing-workflow`)return;else if(n.step===`select-workflows`)return;else if(n.step===`check-existing-secret`)E(`tengu_install_github_app_step_completed`,{step:`check-existing-secret`}),n.useExistingSecret?await a(null,n.secretName):await a(n.apiKeyOrOAuthToken,n.secretName);else if(n.step===`api-key`){if(n.selectedApiKeyOption===`oauth`)return;let e=n.selectedApiKeyOption===`existing`?t:n.apiKeyOrOAuthToken;if(!e){E(`tengu_install_github_app_error`,{reason:`api_key_missing`}),r(e=>({...e,step:`error`,error:`API key is required`}));return}r(t=>({...t,apiKeyOrOAuthToken:e,useExistingKey:n.selectedApiKeyOption===`existing`}));let i=await O(`gh`,[`secret`,`list`,`--app`,`actions`,`--repo`,n.selectedRepoName]);i.code===0&&i.stdout.split(`
147
+ `).some(e=>/^ANTHROPIC_API_KEY\s+/.test(e))?(E(`tengu_install_github_app_step_completed`,{step:`api-key`}),r(e=>({...e,secretExists:!0,step:`check-existing-secret`}))):(E(`tengu_install_github_app_step_completed`,{step:`api-key`}),await a(e,n.secretName))}},d=e=>{r(t=>({...t,selectedRepoName:e}))},f=e=>{r(t=>({...t,apiKeyOrOAuthToken:e}))},p=e=>{r(t=>({...t,selectedApiKeyOption:e}))},m=(0,Q.useCallback)(()=>{E(`tengu_install_github_app_step_completed`,{step:`api-key`}),r(e=>({...e,step:`oauth-flow`}))},[]),h=(0,Q.useCallback)(e=>{E(`tengu_install_github_app_step_completed`,{step:`oauth-flow`}),r(t=>({...t,apiKeyOrOAuthToken:e,useExistingKey:!1,secretName:`CLAUDE_CODE_OAUTH_TOKEN`,authType:`oauth_token`})),a(e,`CLAUDE_CODE_OAUTH_TOKEN`)},[a]),g=(0,Q.useCallback)(()=>{r(e=>({...e,step:`api-key`}))},[]),v=e=>{e&&!/^[a-zA-Z0-9_]+$/.test(e)||r(t=>({...t,secretName:e}))},y=e=>{r(t=>({...t,useCurrentRepo:e,selectedRepoName:e?t.currentRepo:``}))},b=e=>{r(t=>({...t,useExistingKey:e}))},x=e=>{r(t=>({...t,useExistingSecret:e,secretName:e?`ANTHROPIC_API_KEY`:``}))},C=async n=>{if(n===`exit`){e.onDone(`Installation cancelled by user`);return}E(`tengu_install_github_app_step_completed`,{step:`check-existing-workflow`}),r(e=>({...e,workflowAction:n})),(n===`skip`||n===`update`)&&(t?await l():r(e=>({...e,step:`api-key`})))};function w(t){t.preventDefault(),n.step===`success`&&E(`tengu_install_github_app_completed`,{}),e.onDone(n.step===`success`?`GitHub Actions setup complete!`:n.error?`Couldn't install GitHub App: ${n.error}\nFor manual setup instructions, see: ${I}`:`GitHub App installation failed\nFor manual setup instructions, see: ${I}`)}switch(n.step){case`check-gh`:return(0,$.jsx)(Ne,{});case`warnings`:return(0,$.jsx)(et,{warnings:n.warnings,onContinue:u});case`choose-repo`:return(0,$.jsx)(Ie,{currentRepo:n.currentRepo,useCurrentRepo:n.useCurrentRepo,repoUrl:n.selectedRepoName,onRepoUrlChange:d,onToggleUseCurrentRepo:y,onSubmit:u});case`install-app`:return(0,$.jsx)(We,{repoUrl:n.selectedRepoName,onSubmit:u});case`check-existing-workflow`:return(0,$.jsx)(He,{repoName:n.selectedRepoName,onSelectAction:C});case`check-existing-secret`:return(0,$.jsx)(je,{useExistingSecret:n.useExistingSecret,secretName:n.secretName,onToggleUseExistingSecret:x,onSecretNameChange:v,onSubmit:u});case`api-key`:return(0,$.jsx)(ke,{existingApiKey:t,useExistingKey:n.useExistingKey,apiKeyOrOAuthToken:n.apiKeyOrOAuthToken,onApiKeyChange:f,onToggleUseExistingKey:b,onSubmit:u,onCreateOAuthToken:S()?m:void 0,selectedOption:n.selectedApiKeyOption,onSelectOption:p});case`creating`:return(0,$.jsx)(Re,{currentWorkflowInstallStep:n.currentWorkflowInstallStep,secretExists:n.secretExists,useExistingSecret:n.useExistingSecret,secretName:n.secretName,skipWorkflow:n.workflowAction===`skip`,selectedWorkflows:n.selectedWorkflows});case`success`:return(0,$.jsx)(_,{tabIndex:0,autoFocus:!0,onKeyDown:w,children:(0,$.jsx)(Ye,{secretExists:n.secretExists,useExistingSecret:n.useExistingSecret,secretName:n.secretName,skipWorkflow:n.workflowAction===`skip`})});case`error`:return(0,$.jsx)(_,{tabIndex:0,autoFocus:!0,onKeyDown:w,children:(0,$.jsx)(Be,{error:n.error,errorReason:n.errorReason,errorInstructions:n.errorInstructions})});case`select-workflows`:return(0,$.jsx)(Se,{defaultSelections:n.selectedWorkflows,onSubmit:e=>{E(`tengu_install_github_app_step_completed`,{step:`select-workflows`}),r(t=>({...t,selectedWorkflows:e})),t?l():r(e=>({...e,step:`api-key`}))}});case`oauth-flow`:return(0,$.jsx)(Ke,{onSuccess:h,onCancel:g})}}async function rt(e){return(0,$.jsx)(nt,{onDone:e})}var Q,$,it;e((()=>{ie(),Q=t(o(),1),T(),we(),L(),ye(),p(),w(),ve(),se(),re(),C(),Ae(),Me(),Fe(),Le(),ze(),Ve(),Ue(),Ge(),Je(),Xe(),$e(),tt(),$=v(),it={step:`check-gh`,selectedRepoName:``,currentRepo:``,useCurrentRepo:!1,apiKeyOrOAuthToken:``,useExistingKey:!0,currentWorkflowInstallStep:0,warnings:[],secretExists:!1,secretName:`ANTHROPIC_API_KEY`,useExistingSecret:!0,workflowExists:!1,selectedWorkflows:[`claude`,`claude-review`],selectedApiKeyOption:`new`,authType:`api_key`}}))();export{rt as call};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Pc as n}from"./paths-Q2255dD7.js";import{n as r,r as i}from"./analytics-DqMQntaB.js";import{n as a,t as o}from"./browser-fLRXxIsQ.js";async function s(){return i(`tengu_install_slack_app_clicked`,{}),n(e=>({...e,slackAppInstallCount:(e.slackAppInstallCount??0)+1})),await a(c)?{type:`text`,value:`Opening Slack app installation page in browser…`}:{type:`text`,value:`Couldn't open browser. Visit: ${c}`}}var c;e((()=>{r(),o(),t(),c=`https://slack.com/marketplace/A08SF47R6P4-claude`}))();export{s as call};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{createHash as t}from"node:crypto";function n(){return i?{minConfidence:i.minConfidence??r.minConfidence,minClusterSize:i.minClusterSize??r.minClusterSize,llm:{...r.llm,...i.llm}}:r}var r,i,a=e((()=>{r={minConfidence:.75,minClusterSize:3,llm:{timeoutMs:1e4,maxCallsPerSession:20,cooldownMs:3e4,failureThreshold:3,circuitCooldownMs:6e4}}}));function o(e,t=new Date().toISOString()){return s({id:e.id??u(e.trigger,e.action,e.scope),...e,createdAt:t,updatedAt:t,status:e.status??`pending`})}function s(e){let t=Array.from(new Set(e.evidence.filter(Boolean)));return{...e,id:e.id||u(e.trigger,e.action),confidence:p(e.confidence),evidence:t.slice(-m),evidenceOutcome:e.evidenceOutcome,observationIds:e.observationIds?Array.from(new Set(e.observationIds)).slice(-20):void 0}}function c(e){return`${JSON.stringify(s(e),null,2)}\n`}function l(e){return s(JSON.parse(e))}function u(e,n,r=`project`){let i=`${e} ${n}`.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,48),a=t(`sha1`).update(`${r}\n${e}\n${n}`).digest(`hex`).slice(0,10);return`${i||`instinct`}-${a}`}function d(e,t){return{scope:t?.scope??`project`,projectId:t?.projectId??e.projectId,projectName:t?.projectName??e.projectName,source:`session-observation`,evidence:[e.messageText??e.toolOutput??e.toolInput??e.toolName??e.id],observationIds:[e.id]}}function f(e,t){if(e.trigger.toLowerCase()!==t.trigger.toLowerCase())return!1;let n=e.action.toLowerCase(),r=t.action.toLowerCase();return n.includes(`avoid`)!==r.includes(`avoid`)||n.includes(`prefer`)!==r.includes(`prefer`)}function p(e){return Number.isNaN(e)?0:Math.max(0,Math.min(1,Number(e.toFixed(2))))}var m,h=e((()=>{m=10}));export{f as a,c,h as i,n as l,p as n,s as o,o as r,l as s,d as t,a as u};
@@ -0,0 +1,12 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./defineProperty-80gRi2ZW.js";import{n as o,o as s,r as c,x as ee}from"./esm-CJlBxjtx.js";import{Q as te,Z as ne,_ as l,at as u,c as d,i as re,j as f,n as ie,o as p,r as ae,t as m}from"./esm-DcdOXSzi.js";import{n as h,t as oe}from"./esm-BGQPWnJy.js";import{a as g,i as se,l as ce,n as le,r as ue}from"./esm-QgL6y---.js";import{n as de,t as fe}from"./axios-DhfaybwJ.js";import{$ as _,$n as v,Dr as pe,Gt as y,Pn as b,U as me,cn as x,ir as S,nt as he}from"./state-sIHsFpDu.js";import{Ac as C,At as w,Pc as ge,Qt as _e,Sc as T,Tt as ve,an as ye,bt as E,dn as D,dt as be,ft as O,gc as xe,jt as k,mt as A,no as Se,on as j,oo as Ce,pt as we,sn as Te,tn as M,wt as N}from"./paths-Q2255dD7.js";import{E as P,K as Ee,L as F,V as I,X as L,Y as De,a as Oe,d as R,s as z,w as ke}from"./debug-UI3T040K.js";import{d as Ae,f as je,o as B,s as V}from"./log-CzsijfHZ.js";import{a as Me,i as Ne,o as Pe}from"./platform-CuyedWpe.js";import{r as Fe,t as Ie}from"./memoize-DxwLawI2.js";import{a as Le,n as Re}from"./startupProfiler-DnXZaX4A.js";import{b as H,d as ze,g as Be,m as Ve,s as He,u as Ue,v as U,x as We,y as Ge}from"./proxy-CfZp-wce.js";import{_ as Ke,b as qe,c as Je,l as Ye,r as W,v as Xe,y as Ze}from"./sessionTracing-DTjmc0EF.js";import{a as G,i as K,r as Qe,t as $e}from"./esm-C-1qL9Mn.js";async function et(){let e=E();if(e.error)throw Error(`Auth error: ${e.error}`);let t={"Content-Type":`application/json`,"User-Agent":w(),...e.headers};return(await de.get(`https://api.anthropic.com/api/claude_code/organizations/metrics_enabled`,{headers:t,timeout:5e3})).data}async function tt(){if(je())return{enabled:!1,hasError:!1};try{let e=await ve(et,{also403Revoked:!0});return R(`Metrics opt-out API response: enabled=${e.metrics_logging_enabled}`),{enabled:e.metrics_logging_enabled,hasError:!1}}catch(e){return R(`Failed to check metrics opt-out status: ${F(e)}`),V(e),{enabled:!1,hasError:!0}}}async function nt(){let e=await at();if(e.hasError)return e;let t=T().metricsStatusCache;return t!==void 0&&t.enabled===e.enabled&&Date.now()-t.timestamp<q||ge(t=>({...t,metricsStatusCache:{enabled:e.enabled,timestamp:Date.now()}})),e}async function rt(){if(D()&&!ye())return{enabled:!1,hasError:!1};let e=T().metricsStatusCache;return e?(Date.now()-e.timestamp>q&&nt().catch(V),{enabled:e.enabled,hasError:!1}):nt()}var it,q,at,ot=e((()=>{fe(),j(),C(),z(),I(),N(),B(),Ie(),Ae(),k(),it=3600*1e3,q=1440*60*1e3,at=Fe(tt,it)})),st,ct=e((()=>{d(),le(),fe(),ot(),x(),j(),C(),z(),I(),N(),B(),ke(),k(),i(),st=class{constructor(e={}){a(this,`endpoint`,void 0),a(this,`timeout`,void 0),a(this,`pendingExports`,[]),a(this,`isShutdown`,!1),process.env.USER_TYPE===`ant`&&process.env.ANT_CLAUDE_CODE_METRICS_ENDPOINT?this.endpoint=process.env.ANT_CLAUDE_CODE_METRICS_ENDPOINT+`/api/claude_code/metrics`:this.endpoint=`https://api.anthropic.com/api/claude_code/metrics`,this.timeout=e.timeout||5e3}async export(e,t){if(this.isShutdown){t({code:l.FAILED,error:Error(`Exporter has been shutdown`)});return}let n=this.doExport(e,t);this.pendingExports.push(n),n.finally(()=>{let e=this.pendingExports.indexOf(n);e>-1&&this.pendingExports.splice(e,1)})}async doExport(e,t){try{if(!(xe()||me())){R(`BigQuery metrics export: trust not established, skipping`),t({code:l.SUCCESS});return}if(!(await rt()).enabled){R(`Metrics export disabled by organization setting`),t({code:l.SUCCESS});return}let n=this.transformMetricsForInternal(e),r=E();if(r.error){R(`Metrics export failed: ${r.error}`),t({code:l.FAILED,error:Error(r.error)});return}let i={"Content-Type":`application/json`,"User-Agent":w(),...r.headers},a=await de.post(this.endpoint,n,{timeout:this.timeout,headers:i});R(`BigQuery metrics exported successfully`),R(`BigQuery API Response: ${P(a.data,null,2)}`),t({code:l.SUCCESS})}catch(e){R(`BigQuery metrics export failed: ${F(e)}`),V(e),t({code:l.FAILED,error:Ee(e)})}}transformMetricsForInternal(e){let t=e.resource.attributes,n={"service.name":t[`service.name`]||`claude-code`,"service.version":t[`service.version`]||`unknown`,"os.type":t[`os.type`]||`unknown`,"os.version":t[`os.version`]||`unknown`,"host.arch":t[`host.arch`]||`unknown`,"aggregation.temporality":this.selectAggregationTemporality()===ce.DELTA?`delta`:`cumulative`};if(t[`wsl.version`]&&(n[`wsl.version`]=t[`wsl.version`]),D()){n[`user.customer_type`]=`claude_ai`;let e=M();e&&(n[`user.subscription_type`]=e)}else n[`user.customer_type`]=`api`;return{resource_attributes:n,metrics:e.scopeMetrics.flatMap(e=>e.metrics.map(e=>({name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit,data_points:this.extractDataPoints(e)})))}}extractDataPoints(e){return(e.dataPoints||[]).filter(e=>typeof e.value==`number`).map(e=>({attributes:this.convertAttributes(e.attributes),value:e.value,timestamp:this.hrTimeToISOString(e.endTime||e.startTime||[Date.now()/1e3,0])}))}async shutdown(){this.isShutdown=!0,await this.forceFlush(),R(`BigQuery metrics exporter shutdown complete`)}async forceFlush(){await Promise.all(this.pendingExports),R(`BigQuery metrics exporter flush complete`)}convertAttributes(e){let t={};if(e)for(let[n,r]of Object.entries(e))r!=null&&(t[n]=String(r));return t}hrTimeToISOString(e){let[t,n]=e;return new Date(t*1e3+n/1e6).toISOString()}selectAggregationTemporality(){return ce.DELTA}}})),lt,ut=e((()=>{z(),B(),lt=class{error(e,...t){V(Error(e)),R(`[3P telemetry] OTEL diag error: ${e}`,{level:`error`})}warn(e,...t){V(Error(e)),R(`[3P telemetry] OTEL diag warn: ${e}`,{level:`warn`})}info(e,...t){}debug(e,...t){}verbose(e,...t){}}}));function J(e,t){return new Promise((n,r)=>{setTimeout((e,t)=>e(new $(t)),e,r,t).unref()})}function dt(){process.env.USER_TYPE===`ant`&&(process.env.ANT_OTEL_METRICS_EXPORTER&&(process.env.OTEL_METRICS_EXPORTER=process.env.ANT_OTEL_METRICS_EXPORTER),process.env.ANT_OTEL_LOGS_EXPORTER&&(process.env.OTEL_LOGS_EXPORTER=process.env.ANT_OTEL_LOGS_EXPORTER),process.env.ANT_OTEL_TRACES_EXPORTER&&(process.env.OTEL_TRACES_EXPORTER=process.env.ANT_OTEL_TRACES_EXPORTER),process.env.ANT_OTEL_EXPORTER_OTLP_PROTOCOL&&(process.env.OTEL_EXPORTER_OTLP_PROTOCOL=process.env.ANT_OTEL_EXPORTER_OTLP_PROTOCOL),process.env.ANT_OTEL_EXPORTER_OTLP_ENDPOINT&&(process.env.OTEL_EXPORTER_OTLP_ENDPOINT=process.env.ANT_OTEL_EXPORTER_OTLP_ENDPOINT),process.env.ANT_OTEL_EXPORTER_OTLP_HEADERS&&(process.env.OTEL_EXPORTER_OTLP_HEADERS=process.env.ANT_OTEL_EXPORTER_OTLP_HEADERS)),process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE||(process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=`delta`)}function Y(e){return(e||``).trim().split(`,`).filter(Boolean).map(e=>e.trim()).filter(e=>e!==`none`)}async function ft(){let e=Y(process.env.OTEL_METRICS_EXPORTER),n=parseInt(process.env.OTEL_METRIC_EXPORT_INTERVAL||St.toString(),10),r=[];for(let n of e)if(n===`console`){let e=new se,t=e.export.bind(e);e.export=(e,n)=>(e.resource&&e.resource.attributes&&(R(`
2
+ === Resource Attributes ===`),R(P(e.resource.attributes)),R(`===========================
3
+ `)),t(e,n)),r.push(e)}else if(n===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_METRICS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),n=X();switch(e){case`grpc`:{let{OTLPMetricExporter:e}=await import(`./src-BRC_BuUP.js`).then(e=>t(e.default,1));r.push(new e);break}case`http/json`:{let{OTLPMetricExporter:e}=await import(`./esm-B2HIF0XY.js`);r.push(new e(n));break}case`http/protobuf`:{let{OTLPMetricExporter:e}=await import(`./esm-DxPW7qPs.js`);r.push(new e(n));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${e}`)}}else if(n===`prometheus`){let{PrometheusExporter:e}=await import(`./src-DsMd9Q9e.js`).then(e=>t(e.default,1));r.push(new e)}else throw Error(`Unknown exporter type set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${n}`);return r.map(e=>`export`in e?new g({exporter:e,exportIntervalMillis:n}):e)}async function pt(){let e=Y(process.env.OTEL_LOGS_EXPORTER),n=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;R(`[3P telemetry] getOtlpLogExporters: types=${P(e)}, protocol=${n}, endpoint=${r}`);let i=[];for(let r of e)if(r===`console`)i.push(new we);else if(r===`otlp`){let e=X();switch(n){case`grpc`:{let{OTLPLogExporter:e}=await import(`./src-CYLfL70h.js`).then(e=>t(e.default,1));i.push(new e);break}case`http/json`:{let{OTLPLogExporter:t}=await import(`./esm--xjzB1hI.js`);i.push(new t(e));break}case`http/protobuf`:{let{OTLPLogExporter:t}=await import(`./esm-v0kPjgVS.js`);i.push(new t(e));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_LOGS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${n}`)}}else throw Error(`Unknown exporter type set in OTEL_LOGS_EXPORTER env var: ${r}`);return i}async function mt(){let e=Y(process.env.OTEL_TRACES_EXPORTER),n=[];for(let r of e)if(r===`console`)n.push(new Qe);else if(r===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),r=X();switch(e){case`grpc`:{let{OTLPTraceExporter:e}=await import(`./src-DJXCzwyJ.js`).then(e=>t(e.default,1));n.push(new e);break}case`http/json`:{let{OTLPTraceExporter:e}=await import(`./esm-C97WL9nC.js`);n.push(new e(r));break}case`http/protobuf`:{let{OTLPTraceExporter:e}=await import(`./esm-FBUWr3vI.js`);n.push(new e(r));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_TRACES_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${e}`)}}else throw Error(`Unknown exporter type set in OTEL_TRACES_EXPORTER env var: ${r}`);return n}function ht(){return r(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)}function gt(){return new g({exporter:new st,exportIntervalMillis:300*1e3})}function _t(){let e=M(),t=D()&&(e===`enterprise`||e===`team`);return Te()||t}async function vt(e){let t=process.env.BETA_TRACING_ENDPOINT;if(!t)return;let[{OTLPTraceExporter:n},{OTLPLogExporter:r}]=await Promise.all([import(`./esm-C97WL9nC.js`),import(`./esm--xjzB1hI.js`)]),i={url:`${t}/v1/traces`},a={url:`${t}/v1/logs`},o=new K({resource:e,spanProcessors:[new G(new n(i),{scheduledDelayMillis:Q})]});c.setGlobalTracerProvider(o),pe(o);let s=new A({resource:e,processors:[new O(new r(a),{scheduledDelayMillis:Z})]});h.setGlobalLoggerProvider(s),v(s),b(h.getLogger(`com.anthropic.claude_code.events`,`2.6.0`)),process.on(`beforeExit`,async()=>{await s?.forceFlush(),await o?.forceFlush()}),process.on(`exit`,()=>{s?.forceFlush(),o?.forceFlush()})}async function yt(){if(Le(`telemetry_init_start`),dt(),Oe())for(let e of[`OTEL_METRICS_EXPORTER`,`OTEL_LOGS_EXPORTER`,`OTEL_TRACES_EXPORTER`]){let t=process.env[e];t?.includes(`console`)&&(process.env[e]=t.split(`,`).map(e=>e.trim()).filter(e=>e!==`console`).join(`,`))}s.setLogger(new lt,ee.ERROR),qe();let e=[],t=ht();R(`[3P telemetry] isTelemetryEnabled=${t} (CLAUDE_CODE_ENABLE_TELEMETRY=${process.env.CLAUDE_CODE_ENABLE_TELEMETRY})`),t&&e.push(...await ft()),_t()&&e.push(gt());let n=Ne(),r={[ne]:`claude-code`,[te]:`2.6.0`};if(n===`wsl`){let e=Me();e&&(r[`wsl.version`]=e)}let i=p(r),a=p(ie.detect().attributes||{}),o=ae.detect(),l=p(o.attributes?.[`host.arch`]?{[u]:o.attributes[u]}:{}),d=p(re.detect().attributes||{}),f=i.merge(a).merge(l).merge(d);if(Xe()){vt(f).catch(e=>R(`Beta tracing init failed: ${e}`,{level:`error`}));let t=new ue({resource:f,views:[],readers:e});return S(t),L(async()=>{let e=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||`2000`,10);try{W();let n=_(),r=y(),i=[t.shutdown()];n&&i.push(n.forceFlush().then(()=>n.shutdown())),r&&i.push(r.forceFlush().then(()=>r.shutdown())),await Promise.race([Promise.all(i),J(e,`OpenTelemetry shutdown timeout`)])}catch{}}),t.getMeter(`com.anthropic.claude_code`,`2.6.0`)}let m=new ue({resource:f,views:[],readers:e});if(S(m),t){let e=await pt();if(R(`[3P telemetry] Created ${e.length} log exporter(s)`),e.length>0){let t=new A({resource:f,processors:e.map(e=>new O(e,{scheduledDelayMillis:parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||Z.toString(),10)}))});h.setGlobalLoggerProvider(t),v(t),b(h.getLogger(`com.anthropic.claude_code.events`,`2.6.0`)),R(`[3P telemetry] Event logger set successfully`),process.on(`beforeExit`,async()=>{await t?.forceFlush(),await y()?.forceFlush()}),process.on(`exit`,()=>{t?.forceFlush(),y()?.forceFlush()})}}if(t&&Ye()){let e=await mt();if(e.length>0){let t=new K({resource:f,spanProcessors:e.map(e=>new G(e,{scheduledDelayMillis:parseInt(process.env.OTEL_TRACES_EXPORT_INTERVAL||Q.toString(),10)}))});c.setGlobalTracerProvider(t),pe(t)}}return L(async()=>{let e=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||`2000`,10);try{W();let t=[m.shutdown()],n=_();n&&t.push(n.shutdown());let r=y();r&&t.push(r.shutdown()),await Promise.race([Promise.all(t),J(e,`OpenTelemetry shutdown timeout`)])}catch(t){throw t instanceof Error&&t.message.includes(`timeout`)&&R(`
4
+ OpenTelemetry telemetry flush timed out after ${e}ms
5
+
6
+ To resolve this issue, you can:
7
+ 1. Increase the timeout by setting CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS env var (e.g., 5000 for 5 seconds)
8
+ 2. Check if your OpenTelemetry backend is experiencing scalability issues
9
+ 3. Disable OpenTelemetry by unsetting CLAUDE_CODE_ENABLE_TELEMETRY env var
10
+
11
+ Current timeout: ${e}ms
12
+ `,{level:`error`}),t}}),m.getMeter(`com.anthropic.claude_code`,`2.6.0`)}async function bt(){let e=he();if(!e)return;let t=parseInt(process.env.CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS||`5000`,10);try{let n=[e.forceFlush()],r=_();r&&n.push(r.forceFlush());let i=y();i&&n.push(i.forceFlush()),await Promise.race([Promise.all(n),J(t,`OpenTelemetry flush timeout`)]),R(`Telemetry flushed successfully`)}catch(e){e instanceof $?R(`Telemetry flush timed out after ${t}ms. Some metrics may not be exported.`,{level:`warn`}):R(`Telemetry flush failed: ${F(e)}`,{level:`error`})}}function xt(){let e={},t=process.env.OTEL_EXPORTER_OTLP_HEADERS;if(t)for(let n of t.split(`,`)){let[t,...r]=n.split(`=`);t&&r.length>0&&(e[t.trim()]=r.join(`=`).trim())}return e}function X(){let e=He(),t=Ve(),n=Se(),r={},i=xt();n?.otelHeadersHelper?r.headers=async()=>{let e=_e();return{...i,...e}}:Object.keys(i).length>0&&(r.headers=async()=>i);let a=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;if(!e||a&&ze(a)){let e=U();return(t||e)&&(r.httpAgentOptions={...t,...e&&{ca:e}}),r}let o=U();return r.httpAgentOptions=n=>t||o?new H(e,{...t&&{cert:t.cert,key:t.key,passphrase:t.passphrase},...o&&{ca:o}}):new H(e),r}var St,Z,Q,$;e((()=>{o(),oe(),m(),be(),le(),$e(),f(),We(),x(),j(),Pe(),Ge(),De(),z(),n(),I(),Be(),Ue(),Ce(),ke(),Re(),Ke(),ct(),ut(),Ze(),Je(),St=6e4,Z=5e3,Q=5e3,$=class extends Error{}}))();export{bt as flushTelemetry,yt as initializeTelemetry};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";function t(){return c||(c=new Intl.Segmenter(void 0,{granularity:`grapheme`})),c}function n(e){return e?t().segment(e)[Symbol.iterator]().next().value?.segment??``:``}function r(e){if(!e)return``;let n=``;for(let{segment:r}of t().segment(e))n=r;return n}function i(){return l||(l=new Intl.Segmenter(void 0,{granularity:`word`})),l}function a(e,t){let n=`${e}:${t}`,r=u.get(n);return r||(r=new Intl.RelativeTimeFormat(`en`,{style:e,numeric:t}),u.set(n,r)),r}function o(){return d||(d=Intl.DateTimeFormat().resolvedOptions().timeZone),d}function s(){if(f===null)try{let e=Intl.DateTimeFormat().resolvedOptions().locale;f=new Intl.Locale(e).language}catch{f=void 0}return f}var c,l,u,d,f,p=e((()=>{c=null,l=null,u=new Map,d=null,f=null}));export{o as a,r as c,s as i,t as n,i as o,a as r,p as s,n as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";var t,n=e((()=>{t=typeof global==`object`&&global&&global.Object===Object&&global})),r,i,a=e((()=>{n(),r=typeof self==`object`&&self&&self.Object===Object&&self,i=t||r||Function(`return this`)()})),o,s=e((()=>{a(),o=i.Symbol}));function c(e){var t=u.call(e,f),n=e[f];try{e[f]=void 0;var r=!0}catch{}var i=d.call(e);return r&&(t?e[f]=n:delete e[f]),i}var l,u,d,f,p=e((()=>{s(),l=Object.prototype,u=l.hasOwnProperty,d=l.toString,f=o?o.toStringTag:void 0}));function m(e){return h.call(e)}var h,g=e((()=>{h=Object.prototype.toString}));function _(e){return e==null?e===void 0?y:v:b&&b in Object(e)?c(e):m(e)}var v,y,b,x=e((()=>{s(),p(),g(),v=`[object Null]`,y=`[object Undefined]`,b=o?o.toStringTag:void 0}));function S(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var C=e((()=>{}));export{o as a,i as c,x as i,t as l,S as n,s as o,_ as r,a as s,C as t,n as u};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{i as t,r as n}from"./isObject-DaxDnPKm.js";function r(e){return typeof e==`object`&&!!e}var i=e((()=>{}));function a(e){return typeof e==`symbol`||r(e)&&n(e)==o}var o,s=e((()=>{t(),i(),o=`[object Symbol]`}));export{r as i,a as n,i as r,s as t};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";async function t(e,t,n){let r=n?n.trim().split(/\s+/):[],i=r[0]||`list`,a=[],o=console.log,s=console.error;console.log=(...e)=>a.push(e.map(String).join(` `)),console.error=(...e)=>a.push(e.map(String).join(` `));try{let{templatesMain:e}=await import(`./templateJobs-Db630FZD.js`);await e([i,...r.slice(1)])}finally{console.log=o,console.error=s}return e(a.join(`
2
+ `)||`Done.`,{display:`system`}),null}e((()=>{}))();export{t as call};
@@ -0,0 +1,8 @@
1
+ import{t as e}from"./chunk-DR8-3Aex.js";var t=e(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}})),n=e(((e,t)=>{(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,a=Math.floor,o=`[BigNumber Error] `,s=o+`Number primitive has more than 15 significant digits: `,c=0x5af3107a4000,l=14,u=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,0xe8d4a51000,0x9184e72a000],f=1e7,p=1e9;function m(e){var t,n,S,C=L.prototype={constructor:L,toString:null,valueOf:null},w=new L(1),T=20,E=4,D=-7,O=21,k=-1e7,A=1e7,j=!1,M=1,N=0,P={prefix:``,groupSize:3,secondaryGroupSize:0,groupSeparator:`,`,decimalSeparator:`.`,fractionGroupSize:0,fractionGroupSeparator:`\xA0`,suffix:``},F=`0123456789abcdefghijklmnopqrstuvwxyz`,I=!0;function L(e,t){var i,o,c,d,f,p,m,h,g=this;if(!(g instanceof L))return new L(e,t);if(t==null){if(e&&e._isBigNumber===!0){g.s=e.s,!e.c||e.e>A?g.c=g.e=null:e.e<k?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice());return}if((p=typeof e==`number`)&&e*0==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(d=0,f=e;f>=10;f/=10,d++);d>A?g.c=g.e=null:(g.e=d,g.c=[e]);return}h=String(e)}else{if(!r.test(h=String(e)))return S(g,h,p);g.s=h.charCodeAt(0)==45?(h=h.slice(1),-1):1}(d=h.indexOf(`.`))>-1&&(h=h.replace(`.`,``)),(f=h.search(/e/i))>0?(d<0&&(d=f),d+=+h.slice(f+1),h=h.substring(0,f)):d<0&&(d=h.length)}else{if(v(t,2,F.length,`Base`),t==10&&I)return g=new L(e),V(g,T+g.e+1,E);if(h=String(e),p=typeof e==`number`){if(e*0!=0)return S(g,h,p,t);if(g.s=1/e<0?(h=h.slice(1),-1):1,L.DEBUG&&h.replace(/^0\.0*|\./,``).length>15)throw Error(s+e)}else g.s=h.charCodeAt(0)===45?(h=h.slice(1),-1):1;for(i=F.slice(0,t),d=f=0,m=h.length;f<m;f++)if(i.indexOf(o=h.charAt(f))<0){if(o==`.`){if(f>d){d=m;continue}}else if(!c&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){c=!0,f=-1,d=0;continue}return S(g,String(e),p,t)}p=!1,h=n(h,t,10,g.s),(d=h.indexOf(`.`))>-1?h=h.replace(`.`,``):d=h.length}for(f=0;h.charCodeAt(f)===48;f++);for(m=h.length;h.charCodeAt(--m)===48;);if(h=h.slice(f,++m)){if(m-=f,p&&L.DEBUG&&m>15&&(e>u||e!==a(e)))throw Error(s+g.s*e);if((d=d-f-1)>A)g.c=g.e=null;else if(d<k)g.c=[g.e=0];else{if(g.e=d,g.c=[],f=(d+1)%l,d<0&&(f+=l),f<m){for(f&&g.c.push(+h.slice(0,f)),m-=l;f<m;)g.c.push(+h.slice(f,f+=l));f=l-(h=h.slice(f)).length}else f-=m;for(;f--;h+=`0`);g.c.push(+h)}}else g.c=[g.e=0]}L.clone=m,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(e){var t,n;if(e!=null)if(typeof e==`object`){if(e.hasOwnProperty(t=`DECIMAL_PLACES`)&&(n=e[t],v(n,0,p,t),T=n),e.hasOwnProperty(t=`ROUNDING_MODE`)&&(n=e[t],v(n,0,8,t),E=n),e.hasOwnProperty(t=`EXPONENTIAL_AT`)&&(n=e[t],n&&n.pop?(v(n[0],-p,0,t),v(n[1],0,p,t),D=n[0],O=n[1]):(v(n,-p,p,t),D=-(O=n<0?-n:n))),e.hasOwnProperty(t=`RANGE`))if(n=e[t],n&&n.pop)v(n[0],-p,-1,t),v(n[1],1,p,t),k=n[0],A=n[1];else if(v(n,-p,p,t),n)k=-(A=n<0?-n:n);else throw Error(o+t+` cannot be zero: `+n);if(e.hasOwnProperty(t=`CRYPTO`))if(n=e[t],n===!!n)if(n)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))j=n;else throw j=!n,Error(o+`crypto unavailable`);else j=n;else throw Error(o+t+` not true or false: `+n);if(e.hasOwnProperty(t=`MODULO_MODE`)&&(n=e[t],v(n,0,9,t),M=n),e.hasOwnProperty(t=`POW_PRECISION`)&&(n=e[t],v(n,0,p,t),N=n),e.hasOwnProperty(t=`FORMAT`))if(n=e[t],typeof n==`object`)P=n;else throw Error(o+t+` not an object: `+n);if(e.hasOwnProperty(t=`ALPHABET`))if(n=e[t],typeof n==`string`&&!/^.?$|[+\-.\s]|(.).*\1/.test(n))I=n.slice(0,10)==`0123456789`,F=n;else throw Error(o+t+` invalid: `+n)}else throw Error(o+`Object expected: `+e);return{DECIMAL_PLACES:T,ROUNDING_MODE:E,EXPONENTIAL_AT:[D,O],RANGE:[k,A],CRYPTO:j,MODULO_MODE:M,POW_PRECISION:N,FORMAT:P,ALPHABET:F}},L.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!L.DEBUG)return!0;var t,n,r=e.c,i=e.e,s=e.s;out:if({}.toString.call(r)==`[object Array]`){if((s===1||s===-1)&&i>=-p&&i<=p&&i===a(i)){if(r[0]===0){if(i===0&&r.length===1)return!0;break out}if(t=(i+1)%l,t<1&&(t+=l),String(r[0]).length==t){for(t=0;t<r.length;t++)if(n=r[t],n<0||n>=c||n!==a(n))break out;if(n!==0)return!0}}}else if(r===null&&i===null&&(s===null||s===1||s===-1))return!0;throw Error(o+`Invalid BigNumber: `+e)},L.maximum=L.max=function(){return z(arguments,-1)},L.minimum=L.min=function(){return z(arguments,1)},L.random=(function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return a(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,r,s,c,u,f=0,m=[],h=new L(w);if(e==null?e=T:v(e,0,p),c=i(e/l),j)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)u=n[f]*131072+(n[f+1]>>>11),u>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),n[f]=r[0],n[f+1]=r[1]):(m.push(u%0x5af3107a4000),f+=2);f=c/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(c*=7);f<c;)u=(n[f]&31)*281474976710656+n[f+1]*1099511627776+n[f+2]*4294967296+n[f+3]*16777216+(n[f+4]<<16)+(n[f+5]<<8)+n[f+6],u>=9e15?crypto.randomBytes(7).copy(n,f):(m.push(u%0x5af3107a4000),f+=7);f=c/7}else throw j=!1,Error(o+`crypto unavailable`);if(!j)for(;f<c;)u=t(),u<9e15&&(m[f++]=u%0x5af3107a4000);for(c=m[--f],e%=l,c&&e&&(u=d[l-e],m[f]=a(c/u)*u);m[f]===0;m.pop(),f--);if(f<0)m=[s=0];else{for(s=-1;m[0]===0;m.splice(0,1),s-=l);for(f=1,u=m[0];u>=10;u/=10,f++);f<l&&(s-=l-f)}return h.e=s,h.c=m,h}})(),L.sum=function(){for(var e=1,t=arguments,n=new L(t[0]);e<t.length;)n=n.plus(t[e++]);return n},n=(function(){var e=`0123456789`;function n(e,t,n,r){for(var i,a=[0],o,s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(a[i+1]??(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,a,o,s){var c,l,u,d,f,p,m,h,_=r.indexOf(`.`),v=T,y=E;for(_>=0&&(d=N,N=0,r=r.replace(`.`,``),h=new L(i),p=h.pow(r.length-_),N=d,h.c=n(x(g(p.c),p.e,`0`),10,a,e),h.e=h.c.length),m=n(r,i,a,s?(c=F,e):(c=e,F)),u=d=m.length;m[--d]==0;m.pop());if(!m[0])return c.charAt(0);if(_<0?--u:(p.c=m,p.e=u,p.s=o,p=t(p,h,v,y,a),m=p.c,f=p.r,u=p.e),l=u+v+1,_=m[l],d=a/2,f=f||l<0||m[l+1]!=null,f=y<4?(_!=null||f)&&(y==0||y==(p.s<0?3:2)):_>d||_==d&&(y==4||f||y==6&&m[l-1]&1||y==(p.s<0?8:7)),l<1||!m[0])r=f?x(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(m.length=l,f)for(--a;++m[--l]>a;)m[l]=0,l||(++u,m=[1].concat(m));for(d=m.length;!m[--d];);for(_=0,r=``;_<=d;r+=c.charAt(m[_++]));r=x(r,u,c.charAt(0))}return r}})(),t=(function(){function e(e,t,n){var r,i,a,o,s=0,c=e.length,l=t%f,u=t/f|0;for(e=e.slice();c--;)a=e[c]%f,o=e[c]/f|0,r=u*a+o*l,i=l*a+r%f*f+s,s=(i/n|0)+(r/f|0)+u*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=+(e[n]<t[n]),e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,o,s,u){var d,f,p,m,g,_,v,y,b,x,S,C,w,T,E,D,O,k=r.s==i.s?1:-1,A=r.c,j=i.c;if(!A||!A[0]||!j||!j[0])return new L(!r.s||!i.s||(A?j&&A[0]==j[0]:!j)?NaN:A&&A[0]==0||!j?k*0:k/0);for(y=new L(k),b=y.c=[],f=r.e-i.e,k=o+f+1,u||(u=c,f=h(r.e/l)-h(i.e/l),k=k/l|0),p=0;j[p]==(A[p]||0);p++);if(j[p]>(A[p]||0)&&f--,k<0)b.push(1),m=!0;else{for(T=A.length,D=j.length,p=0,k+=2,g=a(u/(j[0]+1)),g>1&&(j=e(j,g,u),A=e(A,g,u),D=j.length,T=A.length),w=D,x=A.slice(0,D),S=x.length;S<D;x[S++]=0);O=j.slice(),O=[0].concat(O),E=j[0],j[1]>=u/2&&E++;do{if(g=0,d=t(j,x,D,S),d<0){if(C=x[0],D!=S&&(C=C*u+(x[1]||0)),g=a(C/E),g>1)for(g>=u&&(g=u-1),_=e(j,g,u),v=_.length,S=x.length;t(_,x,v,S)==1;)g--,n(_,D<v?O:j,v,u),v=_.length,d=1;else g==0&&(d=g=1),_=j.slice(),v=_.length;if(v<S&&(_=[0].concat(_)),n(x,_,S,u),S=x.length,d==-1)for(;t(j,x,D,S)<1;)g++,n(x,D<S?O:j,S,u),S=x.length}else d===0&&(g++,x=[0]);b[p++]=g,x[0]?x[S++]=A[w]||0:(x=[A[w]],S=1)}while((w++<T||x[0]!=null)&&k--);m=x[0]!=null,b[0]||b.splice(0,1)}if(u==c){for(p=1,k=b[0];k>=10;k/=10,p++);V(y,o+(y.e=p+f*l-1)+1,s,m)}else y.e=f,y.r=+m;return y}})();function R(e,t,n,r){var i,a,o,s,c;if(n==null?n=E:v(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,t==null)c=g(e.c),c=r==1||r==2&&(o<=D||o>=O)?b(c,o):x(c,o,`0`);else if(e=V(new L(e),t,n),a=e.e,c=g(e.c),s=c.length,r==1||r==2&&(t<=a||a<=D)){for(;s<t;c+=`0`,s++);c=b(c,a)}else if(t-=o+(r===2&&a>o),c=x(c,a,`0`),a+1>s){if(--t>0)for(c+=`.`;t--;c+=`0`);}else if(t+=a-s,t>0)for(a+1==s&&(c+=`.`);t--;c+=`0`);return e.s<0&&i?`-`+c:c}function z(e,t){for(var n,r,i=1,a=new L(e[0]);i<e.length;i++)r=new L(e[i]),(!r.s||(n=_(a,r))===t||n===0&&a.s===t)&&(a=r);return a}function B(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*l-1)>A?e.c=e.e=null:n<k?e.c=[e.e=0]:(e.e=n,e.c=t),e}S=(function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(a,s,c,l){var u,d=c?s:s.replace(i,``);if(r.test(d))a.s=isNaN(d)?null:d<0?-1:1;else{if(!c&&(d=d.replace(e,function(e,t,n){return u=(n=n.toLowerCase())==`x`?16:n==`b`?2:8,!l||l==u?t:e}),l&&(u=l,d=d.replace(t,`$1`).replace(n,`0.$1`)),s!=d))return new L(d,u);if(L.DEBUG)throw Error(o+`Not a`+(l?` base `+l:``)+` number: `+s);a.s=null}a.c=a.e=null}})();function V(e,t,n,r){var o,s,u,f,p,m,h,g=e.c,_=d;if(g){out:{for(o=1,f=g[0];f>=10;f/=10,o++);if(s=t-o,s<0)s+=l,u=t,p=g[m=0],h=a(p/_[o-u-1]%10);else if(m=i((s+1)/l),m>=g.length)if(r){for(;g.length<=m;g.push(0));p=h=0,o=1,s%=l,u=s-l+1}else break out;else{for(p=f=g[m],o=1;f>=10;f/=10,o++);s%=l,u=s-l+o,h=u<0?0:a(p/_[o-u-1]%10)}if(r=r||t<0||g[m+1]!=null||(u<0?p:p%_[o-u-1]),r=n<4?(h||r)&&(n==0||n==(e.s<0?3:2)):h>5||h==5&&(n==4||r||n==6&&(s>0?u>0?p/_[o-u]:0:g[m-1])%10&1||n==(e.s<0?8:7)),t<1||!g[0])return g.length=0,r?(t-=e.e+1,g[0]=_[(l-t%l)%l],e.e=-t||0):g[0]=e.e=0,e;if(s==0?(g.length=m,f=1,m--):(g.length=m+1,f=_[l-s],g[m]=u>0?a(p/_[o-u]%_[u])*f:0),r)for(;;)if(m==0){for(s=1,u=g[0];u>=10;u/=10,s++);for(u=g[0]+=f,f=1;u>=10;u/=10,f++);s!=f&&(e.e++,g[0]==c&&(g[0]=1));break}else{if(g[m]+=f,g[m]!=c)break;g[m--]=0,f=1}for(s=g.length;g[--s]===0;g.pop());}e.e>A?e.c=e.e=null:e.e<k&&(e.c=[e.e=0])}return e}function H(e){var t,n=e.e;return n===null?e.toString():(t=g(e.c),t=n<=D||n>=O?b(t,n):x(t,n,`0`),e.s<0?`-`+t:t)}return C.absoluteValue=C.abs=function(){var e=new L(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return _(this,new L(e,t))},C.decimalPlaces=C.dp=function(e,t){var n,r,i,a=this;if(e!=null)return v(e,0,p),t==null?t=E:v(t,0,8),V(new L(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-h(this.e/l))*l,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},C.dividedBy=C.div=function(e,n){return t(this,new L(e,n),T,E)},C.dividedToIntegerBy=C.idiv=function(e,n){return t(this,new L(e,n),0,1)},C.exponentiatedBy=C.pow=function(e,t){var n,r,s,c,u,d,f,p,m,h=this;if(e=new L(e),e.c&&!e.isInteger())throw Error(o+`Exponent not an integer: `+H(e));if(t!=null&&(t=new L(t)),d=e.e>14,!h.c||!h.c[0]||h.c[0]==1&&!h.e&&h.c.length==1||!e.c||!e.c[0])return m=new L(H(h)**(d?e.s*(2-y(e)):+H(e))),t?m.mod(t):m;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new L(NaN);r=!f&&h.isInteger()&&t.isInteger(),r&&(h=h.mod(t))}else if(e.e>9&&(h.e>0||h.e<-1||(h.e==0?h.c[0]>1||d&&h.c[1]>=24e7:h.c[0]<8e13||d&&h.c[0]<=9999975e7)))return c=h.s<0&&y(e)?-0:0,h.e>-1&&(c=1/c),new L(f?1/c:c);else N&&(c=i(N/l+2));for(d?(n=new L(.5),f&&(e.s=1),p=y(e)):(s=Math.abs(+H(e)),p=s%2),m=new L(w);;){if(p){if(m=m.times(h),!m.c)break;c?m.c.length>c&&(m.c.length=c):r&&(m=m.mod(t))}if(s){if(s=a(s/2),s===0)break;p=s%2}else if(e=e.times(n),V(e,e.e+1,1),e.e>14)p=y(e);else{if(s=+H(e),s===0)break;p=s%2}h=h.times(h),c?h.c&&h.c.length>c&&(h.c.length=c):r&&(h=h.mod(t))}return r?m:(f&&(m=w.div(m)),t?m.mod(t):c?V(m,N,E,u):m)},C.integerValue=function(e){var t=new L(this);return e==null?e=E:v(e,0,8),V(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return _(this,new L(e,t))===0},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return _(this,new L(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return(t=_(this,new L(e,t)))===1||t===0},C.isInteger=function(){return!!this.c&&h(this.e/l)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return _(this,new L(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return(t=_(this,new L(e,t)))===-1||t===0},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&this.c[0]==0},C.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(e=new L(e,t),t=e.s,!s||!t)return new L(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/l,d=e.e/l,f=o.c,p=e.c;if(!u||!d){if(!f||!p)return f?(e.s=-t,e):new L(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new L(f[0]?o:E==3?-0:0)}if(u=h(u),d=h(d),f=f.slice(),s=u-d){for((a=s<0)?(s=-s,i=f):(d=u,i=p),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(f[t]!=p[t]){a=f[t]<p[t];break}if(a&&(i=f,f=p,p=i,e.s=-e.s),t=(r=p.length)-(n=f.length),t>0)for(;t--;f[n++]=0);for(t=c-1;r>s;){if(f[--r]<p[r]){for(n=r;n&&!f[--n];f[n]=t);--f[n],f[r]+=c}f[r]-=p[r]}for(;f[0]==0;f.splice(0,1),--d);return f[0]?B(e,f,d):(e.s=E==3?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,n){var r,i,a=this;return e=new L(e,n),!a.c||!e.s||e.c&&!e.c[0]?new L(NaN):!e.c||a.c&&!a.c[0]?new L(a):(M==9?(i=e.s,e.s=1,r=t(a,e,0,3),e.s=i,r.s*=i):r=t(a,e,0,M),e=a.minus(r.times(e)),!e.c[0]&&M==1&&(e.s=a.s),e)},C.multipliedBy=C.times=function(e,t){var n,r,i,a,o,s,u,d,p,m,g,_,v,y,b,x=this,S=x.c,C=(e=new L(e,t)).c;if(!S||!C||!S[0]||!C[0])return!x.s||!e.s||S&&!S[0]&&!C||C&&!C[0]&&!S?e.c=e.e=e.s=null:(e.s*=x.s,!S||!C?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(r=h(x.e/l)+h(e.e/l),e.s*=x.s,u=S.length,m=C.length,u<m&&(v=S,S=C,C=v,i=u,u=m,m=i),i=u+m,v=[];i--;v.push(0));for(y=c,b=f,i=m;--i>=0;){for(n=0,g=C[i]%b,_=C[i]/b|0,o=u,a=i+o;a>i;)d=S[--o]%b,p=S[o]/b|0,s=_*d+p*g,d=g*d+s%b*b+v[a]+n,n=(d/y|0)+(s/b|0)+_*p,v[a--]=d%y;v[a]=n}return n?++r:v.splice(0,1),B(e,v,r)},C.negated=function(){var e=new L(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,r=this,i=r.s;if(e=new L(e,t),t=e.s,!i||!t)return new L(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/l,o=e.e/l,s=r.c,u=e.c;if(!a||!o){if(!s||!u)return new L(i/0);if(!s[0]||!u[0])return u[0]?e:new L(s[0]?r:i*0)}if(a=h(a),o=h(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for(i=s.length,t=u.length,i-t<0&&(n=u,u=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/c|0,s[t]=c===s[t]?0:s[t]%c;return i&&(s=[i].concat(s),++o),B(e,s,o)},C.precision=C.sd=function(e,t){var n,r,i,a=this;if(e!=null&&e!==!!e)return v(e,1,p),t==null?t=E:v(t,0,8),V(new L(a),e,t);if(!(n=a.c))return null;if(i=n.length-1,r=i*l+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},C.shiftedBy=function(e){return v(e,-u,u),this.times(`1e`+e)},C.squareRoot=C.sqrt=function(){var e,n,r,i,a,o=this,s=o.c,c=o.s,l=o.e,u=T+4,d=new L(`0.5`);if(c!==1||!s||!s[0])return new L(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(c=Math.sqrt(+H(o)),c==0||c==1/0?(n=g(s),(n.length+l)%2==0&&(n+=`0`),c=Math.sqrt(+n),l=h((l+1)/2)-(l<0||l%2),c==1/0?n=`5e`+l:(n=c.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+l),r=new L(n)):r=new L(c+``),r.c[0]){for(l=r.e,c=l+u,c<3&&(c=0);;)if(a=r,r=d.times(a.plus(t(o,a,u,1))),g(a.c).slice(0,c)===(n=g(r.c)).slice(0,c))if(r.e<l&&--c,n=n.slice(c-3,c+1),n==`9999`||!i&&n==`4999`){if(!i&&(V(a,a.e+T+2,0),a.times(a).eq(o))){r=a;break}u+=4,c+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(V(r,r.e+T+2,1),e=!r.times(r).eq(o));break}}return V(r,r.e+T+1,E,e)},C.toExponential=function(e,t){return e!=null&&(v(e,0,p),e++),R(this,e,t,1)},C.toFixed=function(e,t){return e!=null&&(v(e,0,p),e=e+this.e+1),R(this,e,t)},C.toFormat=function(e,t,n){var r,i=this;if(n==null)e!=null&&t&&typeof t==`object`?(n=t,t=null):e&&typeof e==`object`?(n=e,e=t=null):n=P;else if(typeof n!=`object`)throw Error(o+`Argument not an object: `+n);if(r=i.toFixed(e,t),i.c){var a,s=r.split(`.`),c=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||``,d=s[0],f=s[1],p=i.s<0,m=p?d.slice(1):d,h=m.length;if(l&&(a=c,c=l,l=a,h-=a),c>0&&h>0){for(a=h%c||c,d=m.substr(0,a);a<h;a+=c)d+=u+m.substr(a,c);l>0&&(d+=u+m.slice(a)),p&&(d=`-`+d)}r=f?d+(n.decimalSeparator||``)+((l=+n.fractionGroupSize)?f.replace(RegExp(`\\d{`+l+`}\\B`,`g`),`$&`+(n.fractionGroupSeparator||``)):f):d}return(n.prefix||``)+r+(n.suffix||``)},C.toFraction=function(e){var n,r,i,a,s,c,u,f,p,m,h,_,v=this,y=v.c;if(e!=null&&(u=new L(e),!u.isInteger()&&(u.c||u.s!==1)||u.lt(w)))throw Error(o+`Argument `+(u.isInteger()?`out of range: `:`not an integer: `)+H(u));if(!y)return new L(v);for(n=new L(w),p=r=new L(w),i=f=new L(w),_=g(y),s=n.e=_.length-v.e-1,n.c[0]=d[(c=s%l)<0?l+c:c],e=!e||u.comparedTo(n)>0?s>0?n:p:u,c=A,A=1/0,u=new L(_),f.c[0]=0;m=t(u,n,0,1),a=r.plus(m.times(i)),a.comparedTo(e)!=1;)r=i,i=a,p=f.plus(m.times(a=p)),f=a,n=u.minus(m.times(a=n)),u=a;return a=t(e.minus(r),i,0,1),f=f.plus(a.times(p)),r=r.plus(a.times(i)),f.s=p.s=v.s,s*=2,h=t(p,i,s,E).minus(v).abs().comparedTo(t(f,r,s,E).minus(v).abs())<1?[p,i]:[f,r],A=c,h},C.toNumber=function(){return+H(this)},C.toPrecision=function(e,t){return e!=null&&v(e,1,p),R(this,e,t,2)},C.toString=function(e){var t,r=this,i=r.s,a=r.e;return a===null?i?(t=`Infinity`,i<0&&(t=`-`+t)):t=`NaN`:(e==null?t=a<=D||a>=O?b(g(r.c),a):x(g(r.c),a,`0`):e===10&&I?(r=V(new L(r),T+a+1,E),t=x(g(r.c),r.e,`0`)):(v(e,2,F.length,`Base`),t=n(x(g(r.c),a,`0`),10,e,i,!0)),i<0&&r.c[0]&&(t=`-`+t)),t},C.valueOf=C.toJSON=function(){return H(this)},C._isBigNumber=!0,e!=null&&L.set(e),L}function h(e){var t=e|0;return e>0||e===t?t:t-1}function g(e){for(var t,n,r=1,i=e.length,a=e[0]+``;r<i;){for(t=e[r++]+``,n=l-t.length;n--;t=`0`+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function _(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=c==l,!i||!a)return r?0:!i^n?1:-1;if(!r)return c>l^n?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function v(e,t,n,r){if(e<t||e>n||e!==a(e))throw Error(o+(r||`Argument`)+(typeof e==`number`?e<t||e>n?` out of range: `:` not an integer: `:` not a primitive number: `)+String(e))}function y(e){var t=e.c.length-1;return h(e.e/l)==t&&e.c[t]%2!=0}function b(e,t){return(e.length>1?e.charAt(0)+`.`+e.slice(1):e)+(t<0?`e`:`e+`)+t}function x(e,t,n){var r,i;if(t<0){for(i=n+`.`;++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+`.`+e.slice(t));return e}n=m(),n.default=n.BigNumber=n,typeof define==`function`&&define.amd?define(function(){return n}):t!==void 0&&t.exports?t.exports=n:(e||(e=typeof self<`u`&&self?self:window),e.BigNumber=n)})(e)})),r=e(((e,t)=>{var r=n(),i=t.exports;(function(){var e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,t,n,a={"\b":`\\b`," ":`\\t`,"\n":`\\n`,"\f":`\\f`,"\r":`\\r`,'"':`\\"`,"\\":`\\\\`},o;function s(t){return e.lastIndex=0,e.test(t)?`"`+t.replace(e,function(e){var t=a[e];return typeof t==`string`?t:`\\u`+(`0000`+e.charCodeAt(0).toString(16)).slice(-4)})+`"`:`"`+t+`"`}function c(e,i){var a,l,u,d,f=t,p,m=i[e],h=m!=null&&(m instanceof r||r.isBigNumber(m));switch(m&&typeof m==`object`&&typeof m.toJSON==`function`&&(m=m.toJSON(e)),typeof o==`function`&&(m=o.call(i,e,m)),typeof m){case`string`:return h?m:s(m);case`number`:return isFinite(m)?String(m):`null`;case`boolean`:case`null`:case`bigint`:return String(m);case`object`:if(!m)return`null`;if(t+=n,p=[],Object.prototype.toString.apply(m)===`[object Array]`){for(d=m.length,a=0;a<d;a+=1)p[a]=c(a,m)||`null`;return u=p.length===0?`[]`:t?`[
2
+ `+t+p.join(`,
3
+ `+t)+`
4
+ `+f+`]`:`[`+p.join(`,`)+`]`,t=f,u}if(o&&typeof o==`object`)for(d=o.length,a=0;a<d;a+=1)typeof o[a]==`string`&&(l=o[a],u=c(l,m),u&&p.push(s(l)+(t?`: `:`:`)+u));else Object.keys(m).forEach(function(e){var n=c(e,m);n&&p.push(s(e)+(t?`: `:`:`)+n)});return u=p.length===0?`{}`:t?`{
5
+ `+t+p.join(`,
6
+ `+t)+`
7
+ `+f+`}`:`{`+p.join(`,`)+`}`,t=f,u}}typeof i.stringify!=`function`&&(i.stringify=function(e,r,i){var a;if(t=``,n=``,typeof i==`number`)for(a=0;a<i;a+=1)n+=` `;else typeof i==`string`&&(n=i);if(o=r,r&&typeof r!=`function`&&(typeof r!=`object`||typeof r.length!=`number`))throw Error(`JSON.stringify`);return c(``,{"":e})})})()})),i=e(((e,t)=>{var r=null,i=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,a=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;t.exports=function(e){var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:`error`,constructorAction:`error`};if(e!=null){if(e.strict===!0&&(t.strict=!0),e.storeAsString===!0&&(t.storeAsString=!0),t.alwaysParseAsBig=e.alwaysParseAsBig===!0?e.alwaysParseAsBig:!1,t.useNativeBigInt=e.useNativeBigInt===!0?e.useNativeBigInt:!1,e.constructorAction!==void 0)if(e.constructorAction===`error`||e.constructorAction===`ignore`||e.constructorAction===`preserve`)t.constructorAction=e.constructorAction;else throw Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);if(e.protoAction!==void 0)if(e.protoAction===`error`||e.protoAction===`ignore`||e.protoAction===`preserve`)t.protoAction=e.protoAction;else throw Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`)}var o,s,c={'"':`"`,"\\":`\\`,"/":`/`,b:`\b`,f:`\f`,n:`
8
+ `,r:`\r`,t:` `},l,u=function(e){throw{name:`SyntaxError`,message:e,at:o,text:l}},d=function(e){return e&&e!==s&&u(`Expected '`+e+`' instead of '`+s+`'`),s=l.charAt(o),o+=1,s},f=function(){var e,i=``;for(s===`-`&&(i=`-`,d(`-`));s>=`0`&&s<=`9`;)i+=s,d();if(s===`.`)for(i+=`.`;d()&&s>=`0`&&s<=`9`;)i+=s;if(s===`e`||s===`E`)for(i+=s,d(),(s===`-`||s===`+`)&&(i+=s,d());s>=`0`&&s<=`9`;)i+=s,d();if(e=+i,!isFinite(e))u(`Bad number`);else return r??(r=n()),i.length>15?t.storeAsString?i:t.useNativeBigInt?BigInt(i):new r(i):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new r(e):e},p=function(){var e,t,n=``,r;if(s===`"`)for(var i=o;d();){if(s===`"`)return o-1>i&&(n+=l.substring(i,o-1)),d(),n;if(s===`\\`){if(o-1>i&&(n+=l.substring(i,o-1)),d(),s===`u`){for(r=0,t=0;t<4&&(e=parseInt(d(),16),isFinite(e));t+=1)r=r*16+e;n+=String.fromCharCode(r)}else if(typeof c[s]==`string`)n+=c[s];else break;i=o}}u(`Bad string`)},m=function(){for(;s&&s<=` `;)d()},h=function(){switch(s){case`t`:return d(`t`),d(`r`),d(`u`),d(`e`),!0;case`f`:return d(`f`),d(`a`),d(`l`),d(`s`),d(`e`),!1;case`n`:return d(`n`),d(`u`),d(`l`),d(`l`),null}u(`Unexpected '`+s+`'`)},g,_=function(){var e=[];if(s===`[`){if(d(`[`),m(),s===`]`)return d(`]`),e;for(;s;){if(e.push(g()),m(),s===`]`)return d(`]`),e;d(`,`),m()}}u(`Bad array`)},v=function(){var e,n=Object.create(null);if(s===`{`){if(d(`{`),m(),s===`}`)return d(`}`),n;for(;s;){if(e=p(),m(),d(`:`),t.strict===!0&&Object.hasOwnProperty.call(n,e)&&u(`Duplicate key "`+e+`"`),i.test(e)===!0?t.protoAction===`error`?u(`Object contains forbidden prototype property`):t.protoAction===`ignore`?g():n[e]=g():a.test(e)===!0?t.constructorAction===`error`?u(`Object contains forbidden constructor property`):t.constructorAction===`ignore`?g():n[e]=g():n[e]=g(),m(),s===`}`)return d(`}`),n;d(`,`),m()}}u(`Bad object`)};return g=function(){switch(m(),s){case`{`:return v();case`[`:return _();case`"`:return p();case`-`:return f();default:return s>=`0`&&s<=`9`?f():h()}},function(e,t){var n;return l=e+``,o=0,s=` `,n=g(),m(),s&&u(`Syntax error`),typeof t==`function`?(function e(n,r){var i,a=n[r];return a&&typeof a==`object`&&Object.keys(a).forEach(function(t){i=e(a,t),i===void 0?delete a[t]:a[t]=i}),t.call(n,r,a)})({"":n},``):n}}})),a=e(((e,t)=>{var n=r().stringify,a=i();t.exports=function(e){return{parse:a(e),stringify:n}},t.exports.parse=a(),t.exports.stringify=n}));export{t as n,a as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-DR8-3Aex.js";var t=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),n=e(((e,n)=>{n.exports=t()}));export{n as t};
@@ -0,0 +1,3 @@
1
+ import{i as e,t}from"./chunk-DR8-3Aex.js";var n=t(((t,n)=>{var r=e(`buffer`),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?n.exports=r:(a(r,t),t.Buffer=o);function o(e,t,n){return i(e,t,n)}o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return i(e,t,n)},o.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var r=i(e);return t===void 0?r.fill(0):typeof n==`string`?r.fill(t,n):r.fill(t),r},o.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return i(e)},o.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r.SlowBuffer(e)}})),r=t(((e,t)=>{function n(e){return(e/8|0)+(e%8==0?0:1)}var r={ES256:n(256),ES384:n(384),ES512:n(521)};function i(e){var t=r[e];if(t)return t;throw Error(`Unknown algorithm "`+e+`"`)}t.exports=i})),i=t(((e,t)=>{var i=n().Buffer,a=r(),o=128,s=0,c=32,l=16,u=2,d=l|c|s<<6,f=u|s<<6;function p(e){return e.replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}function m(e){if(i.isBuffer(e))return e;if(typeof e==`string`)return i.from(e,`base64`);throw TypeError(`ECDSA signature must be a Base64 string or a Buffer`)}function h(e,t){e=m(e);var n=a(t),r=n+1,s=e.length,c=0;if(e[c++]!==d)throw Error(`Could not find expected "seq"`);var l=e[c++];if(l===(o|1)&&(l=e[c++]),s-c<l)throw Error(`"seq" specified length of "`+l+`", only "`+(s-c)+`" remaining`);if(e[c++]!==f)throw Error(`Could not find expected "int" for "r"`);var u=e[c++];if(s-c-2<u)throw Error(`"r" specified length of "`+u+`", only "`+(s-c-2)+`" available`);if(r<u)throw Error(`"r" specified length of "`+u+`", max of "`+r+`" is acceptable`);var h=c;if(c+=u,e[c++]!==f)throw Error(`Could not find expected "int" for "s"`);var g=e[c++];if(s-c!==g)throw Error(`"s" specified length of "`+g+`", expected "`+(s-c)+`"`);if(r<g)throw Error(`"s" specified length of "`+g+`", max of "`+r+`" is acceptable`);var _=c;if(c+=g,c!==s)throw Error(`Expected to consume entire buffer, but "`+(s-c)+`" bytes remain`);var v=n-u,y=n-g,b=i.allocUnsafe(v+u+y+g);for(c=0;c<v;++c)b[c]=0;e.copy(b,c,h+Math.max(-v,0),h+u),c=n;for(var x=c;c<x+y;++c)b[c]=0;return e.copy(b,c,_+Math.max(-y,0),_+g),b=b.toString(`base64`),b=p(b),b}function g(e,t,n){for(var r=0;t+r<n&&e[t+r]===0;)++r;return e[t+r]>=o&&--r,r}function _(e,t){e=m(e);var n=a(t),r=e.length;if(r!==n*2)throw TypeError(`"`+t+`" signatures must be "`+n*2+`" bytes, saw "`+r+`"`);var s=g(e,0,n),c=g(e,n,e.length),l=n-s,u=n-c,p=2+l+1+1+u,h=p<o,_=i.allocUnsafe((h?2:3)+p),v=0;return _[v++]=d,h?_[v++]=p:(_[v++]=o|1,_[v++]=p&255),_[v++]=f,_[v++]=l,s<0?(_[v++]=0,v+=e.copy(_,v,0,n)):v+=e.copy(_,v,s,n),_[v++]=f,_[v++]=u,c<0?(_[v++]=0,e.copy(_,v,n)):e.copy(_,v,n+c),_}t.exports={derToJose:h,joseToDer:_}})),a=t(((t,r)=>{var i=n().Buffer,a=e(`stream`),o=e(`util`);function s(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=i.alloc(0),this;if(typeof e.pipe==`function`)return this.buffer=i.alloc(0),e.pipe(this),this;if(e.length||typeof e==`object`)return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit(`end`,e),this.readable=!1,this.emit(`close`)}.bind(this)),this;throw TypeError(`Unexpected data type (`+typeof e+`)`)}o.inherits(s,a),s.prototype.write=function(e){this.buffer=i.concat([this.buffer,i.from(e)]),this.emit(`data`,e)},s.prototype.end=function(e){e&&this.write(e),this.emit(`end`,e),this.emit(`close`),this.writable=!1,this.readable=!1},r.exports=s})),o=t(((t,n)=>{var r=e(`buffer`).Buffer,i=e(`buffer`).SlowBuffer;n.exports=a;function a(e,t){if(!r.isBuffer(e)||!r.isBuffer(t)||e.length!==t.length)return!1;for(var n=0,i=0;i<e.length;i++)n|=e[i]^t[i];return n===0}a.install=function(){r.prototype.equal=i.prototype.equal=function(e){return a(this,e)}};var o=r.prototype.equal,s=i.prototype.equal;a.restore=function(){r.prototype.equal=o,i.prototype.equal=s}})),s=t(((t,r)=>{var a=n().Buffer,s=e(`crypto`),c=i(),l=e(`util`),u=`"%s" is not a valid algorithm.
2
+ Supported algorithms are:
3
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,d=`secret must be a string or buffer`,f=`key must be a string or a buffer`,p=`key must be a string, a buffer or an object`,m=typeof s.createPublicKey==`function`;m&&(f+=` or a KeyObject`,d+=`or a KeyObject`);function h(e){if(!a.isBuffer(e)&&typeof e!=`string`&&(!m||typeof e!=`object`||typeof e.type!=`string`||typeof e.asymmetricKeyType!=`string`||typeof e.export!=`function`))throw b(f)}function g(e){if(!a.isBuffer(e)&&typeof e!=`string`&&typeof e!=`object`)throw b(p)}function _(e){if(!a.isBuffer(e)){if(typeof e==`string`)return e;if(!m||typeof e!=`object`||e.type!==`secret`||typeof e.export!=`function`)throw b(d)}}function v(e){return e.replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}function y(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var n=0;n<t;++n)e+=`=`;return e.replace(/\-/g,`+`).replace(/_/g,`/`)}function b(e){var t=[].slice.call(arguments,1),n=l.format.bind(l,e).apply(null,t);return TypeError(n)}function x(e){return a.isBuffer(e)||typeof e==`string`}function S(e){return x(e)||(e=JSON.stringify(e)),e}function C(e){return function(t,n){_(n),t=S(t);var r=s.createHmac(`sha`+e,n);return v((r.update(t),r.digest(`base64`)))}}var w,T=`timingSafeEqual`in s?function(e,t){return e.byteLength===t.byteLength?s.timingSafeEqual(e,t):!1}:function(e,t){return w||(w=o()),w(e,t)};function E(e){return function(t,n,r){var i=C(e)(t,r);return T(a.from(n),a.from(i))}}function D(e){return function(t,n){g(n),t=S(t);var r=s.createSign(`RSA-SHA`+e);return v((r.update(t),r.sign(n,`base64`)))}}function O(e){return function(t,n,r){h(r),t=S(t),n=y(n);var i=s.createVerify(`RSA-SHA`+e);return i.update(t),i.verify(r,n,`base64`)}}function k(e){return function(t,n){g(n),t=S(t);var r=s.createSign(`RSA-SHA`+e);return v((r.update(t),r.sign({key:n,padding:s.constants.RSA_PKCS1_PSS_PADDING,saltLength:s.constants.RSA_PSS_SALTLEN_DIGEST},`base64`)))}}function A(e){return function(t,n,r){h(r),t=S(t),n=y(n);var i=s.createVerify(`RSA-SHA`+e);return i.update(t),i.verify({key:r,padding:s.constants.RSA_PKCS1_PSS_PADDING,saltLength:s.constants.RSA_PSS_SALTLEN_DIGEST},n,`base64`)}}function j(e){var t=D(e);return function(){var n=t.apply(null,arguments);return n=c.derToJose(n,`ES`+e),n}}function M(e){var t=O(e);return function(n,r,i){return r=c.joseToDer(r,`ES`+e).toString(`base64`),t(n,r,i)}}function N(){return function(){return``}}function P(){return function(e,t){return t===``}}r.exports=function(e){var t={hs:C,rs:D,ps:k,es:j,none:N},n={hs:E,rs:O,ps:A,es:M,none:P},r=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!r)throw b(u,e);var i=(r[1]||r[3]).toLowerCase(),a=r[2];return{sign:t[i](a),verify:n[i](a)}}})),c=t(((t,n)=>{var r=e(`buffer`).Buffer;n.exports=function(e){return typeof e==`string`?e:typeof e==`number`||r.isBuffer(e)?e.toString():JSON.stringify(e)}})),l=t(((t,r)=>{var i=n().Buffer,o=a(),l=s(),u=e(`stream`),d=c(),f=e(`util`);function p(e,t){return i.from(e,t).toString(`base64`).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}function m(e,t,n){n=n||`utf8`;var r=p(d(e),`binary`),i=p(d(t),n);return f.format(`%s.%s`,r,i)}function h(e){var t=e.header,n=e.payload,r=e.secret||e.privateKey,i=e.encoding,a=l(t.alg),o=m(t,n,i),s=a.sign(o,r);return f.format(`%s.%s`,o,s)}function g(e){var t=e.secret;if(t=t??e.privateKey,t=t??e.key,/^hs/i.test(e.header.alg)===!0&&t==null)throw TypeError(`secret must be a string or buffer or a KeyObject`);var n=new o(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=n,this.payload=new o(e.payload),this.secret.once(`close`,function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once(`close`,function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}f.inherits(g,u),g.prototype.sign=function(){try{var e=h({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit(`done`,e),this.emit(`data`,e),this.emit(`end`),this.readable=!1,e}catch(e){this.readable=!1,this.emit(`error`,e),this.emit(`close`)}},g.sign=h,r.exports=g})),u=t(((t,r)=>{var i=n().Buffer,o=a(),l=s(),u=e(`stream`),d=c(),f=e(`util`),p=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function m(e){return Object.prototype.toString.call(e)===`[object Object]`}function h(e){if(m(e))return e;try{return JSON.parse(e)}catch{return}}function g(e){var t=e.split(`.`,1)[0];return h(i.from(t,`base64`).toString(`binary`))}function _(e){return e.split(`.`,2).join(`.`)}function v(e){return e.split(`.`)[2]}function y(e,t){t=t||`utf8`;var n=e.split(`.`)[1];return i.from(n,`base64`).toString(t)}function b(e){return p.test(e)&&!!g(e)}function x(e,t,n){if(!t){var r=Error(`Missing algorithm parameter for jws.verify`);throw r.code=`MISSING_ALGORITHM`,r}e=d(e);var i=v(e),a=_(e);return l(t).verify(a,i,n)}function S(e,t){if(t=t||{},e=d(e),!b(e))return null;var n=g(e);if(!n)return null;var r=y(e);return(n.typ===`JWT`||t.json)&&(r=JSON.parse(r,t.encoding)),{header:n,payload:r,signature:v(e)}}function C(e){e=e||{};var t=e.secret;if(t=t??e.publicKey,t=t??e.key,/^hs/i.test(e.algorithm)===!0&&t==null)throw TypeError(`secret must be a string or buffer or a KeyObject`);var n=new o(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=n,this.signature=new o(e.signature),this.secret.once(`close`,function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once(`close`,function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}f.inherits(C,u),C.prototype.verify=function(){try{var e=x(this.signature.buffer,this.algorithm,this.key.buffer),t=S(this.signature.buffer,this.encoding);return this.emit(`done`,e,t),this.emit(`data`,e),this.emit(`end`),this.readable=!1,e}catch(e){this.readable=!1,this.emit(`error`,e),this.emit(`close`)}},C.decode=S,C.isValid=b,C.verify=x,r.exports=C})),d=t((e=>{var t=l(),n=u();e.ALGORITHMS=[`HS256`,`HS384`,`HS512`,`RS256`,`RS384`,`RS512`,`PS256`,`PS384`,`PS512`,`ES256`,`ES384`,`ES512`],e.sign=t.sign,e.verify=n.verify,e.decode=n.decode,e.isValid=n.isValid,e.createSign=function(e){return new t(e)},e.createVerify=function(e){return new n(e)}}));export{i as n,d as t};
@@ -0,0 +1 @@
1
+ import{L as e,T as t,V as n,d as r,s as i,w as a}from"./debug-UI3T040K.js";import{n as o,r as s}from"./analytics-DqMQntaB.js";import{F as c,P as l}from"./git-CN3qtTb_.js";o(),i(),l(),n(),a();function u(e){if(e<6e4)return`${Math.round(e/1e3)}s`;let t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return n>0?`${t}m ${n}s`:`${t}m`}function d(e){let n=(e.startsWith(`sk-ant-si-`)?e.slice(10):e).split(`.`);if(n.length!==3||!n[1])return null;try{return t(Buffer.from(n[1],`base64url`).toString(`utf8`))}catch{return null}}function f(e){let t=d(e);return typeof t==`object`&&t&&`exp`in t&&typeof t.exp==`number`?t.exp:null}var p=300*1e3,m=1800*1e3,h=3,g=6e4;function _({getAccessToken:t,onRefresh:n,label:i,refreshBufferMs:a=p}){let o=new Map,l=new Map,d=new Map;function _(e){let t=(d.get(e)??0)+1;return d.set(e,t),t}function v(e,t){let n=f(t);if(!n){r(`[${i}:token] Could not decode JWT expiry for sessionId=${e}, token prefix=${t.slice(0,15)}…, keeping existing timer`);return}let s=o.get(e);s&&clearTimeout(s);let c=_(e),l=new Date(n*1e3).toISOString(),d=n*1e3-Date.now()-a;if(d<=0){r(`[${i}:token] Token for sessionId=${e} expires=${l} (past or within buffer), refreshing immediately`),b(e,c);return}r(`[${i}:token] Scheduled token refresh for sessionId=${e} in ${u(d)} (expires=${l}, buffer=${a/1e3}s)`);let p=setTimeout(b,d,e,c);o.set(e,p)}function y(e,t){let n=o.get(e);n&&clearTimeout(n);let s=_(e),c=Math.max(t*1e3-a,3e4);r(`[${i}:token] Scheduled token refresh for sessionId=${e} in ${u(c)} (expires_in=${t}s, buffer=${a/1e3}s)`);let l=setTimeout(b,c,e,s);o.set(e,l)}async function b(a,f){let p;try{p=await t()}catch(t){r(`[${i}:token] getAccessToken threw for sessionId=${a}: ${e(t)}`,{level:`error`})}if(d.get(a)!==f){r(`[${i}:token] doRefresh for sessionId=${a} stale (gen ${f} vs ${d.get(a)}), skipping`);return}if(!p){let e=(l.get(a)??0)+1;if(l.set(a,e),r(`[${i}:token] No OAuth token available for refresh, sessionId=${a} (failure ${e}/${h})`,{level:`error`}),c(`error`,`bridge_token_refresh_no_oauth`),e<h){let e=setTimeout(b,g,a,f);o.set(a,e)}return}l.delete(a),r(`[${i}:token] Refreshing token for sessionId=${a}: new token prefix=${p.slice(0,15)}…`),s(`tengu_bridge_token_refreshed`,{}),n(a,p);let _=setTimeout(b,m,a,f);o.set(a,_),r(`[${i}:token] Scheduled follow-up refresh for sessionId=${a} in ${u(m)}`)}function x(e){_(e);let t=o.get(e);t&&(clearTimeout(t),o.delete(e)),l.delete(e)}function S(){for(let e of d.keys())_(e);for(let e of o.values())clearTimeout(e);o.clear(),l.clear()}return{schedule:v,scheduleFromExpiresIn:y,cancel:x,cancelAll:S}}export{f as n,_ as t};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{E as t,R as n,V as r,w as i}from"./debug-UI3T040K.js";import{aT as a,cT as o,dT as s,fT as c,iT as l,pT as u,rT as d,uT as f}from"./loadAgentsDir-Ci5mr0vm.js";import{r as p,t as m}from"./promptEditor-Ci-h04-5.js";import{dirname as h}from"path";import{mkdir as g,writeFile as _}from"fs/promises";function v(e){let t=new Set(o.map(e=>s(e.key)));return e.map(e=>{let n={};for(let[r,i]of Object.entries(e.bindings))t.has(s(r))||(n[r]=i);return{context:e.context,bindings:n}}).filter(e=>Object.keys(e.bindings).length>0)}function y(){return t({$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.claude.com/docs/en/keybindings`,bindings:v(c)},null,2)+`
2
+ `}var b=e((()=>{i(),u(),f()}));async function x(){if(!a())return{type:`text`,value:`Keybinding customization is not enabled. This feature is currently in preview.`};let e=d(),t=!1;await g(h(e),{recursive:!0});try{await _(e,y(),{encoding:`utf-8`,flag:`wx`})}catch(e){if(n(e)===`EEXIST`)t=!0;else throw e}let r=await m(e);return r.error?{type:`text`,value:`${t?`Opened`:`Created`} ${e}. Could not open in editor: ${r.error}`}:{type:`text`,value:t?`Opened ${e} in your editor.`:`Created ${e} with template. Opened in your editor.`}}e((()=>{l(),b(),r(),p()}))();export{x as call};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Pc as n,Sc as r}from"./paths-Q2255dD7.js";import{n as i,r as a,t as o}from"./language-DcSjogBx.js";async function s(e,t,a){let s=a.trim().toLowerCase();if(!s){let t=r().preferredLanguage??`auto`,n=i(),a=t===`auto`?` → ${o(n)}`:``;return e(`Language: ${o(t)}${a}`,{display:`system`}),null}if(!c.includes(s))return e(`Invalid language "${s}". Use: en, zh, or auto`,{display:`system`}),null;let l=s;n(e=>({...e,preferredLanguage:l}));let u=i(),d=l===`auto`?` → ${o(u)}`:``;return e(`Language set to ${o(l)}${d}`,{display:`system`}),null}var c;e((()=>{t(),a(),c=[`en`,`zh`,`auto`]}))();export{s as call};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./language-DcSjogBx.js";t();export{e as getResolvedLanguage};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Sc as n}from"./paths-Q2255dD7.js";import{i as r,s as i}from"./intl-Pse97ORk.js";function a(){let e=n().preferredLanguage??`auto`;return e===`en`||e===`zh`?e:r()===`zh`?`zh`:`en`}function o(e){return s[e]??e}var s,c=e((()=>{t(),i(),s={auto:`Auto (follow system)`,en:`English`,zh:`中文`}}));export{a as n,c as r,o as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Rn as r,b as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{i as f,n as p,r as m}from"./cron-DiW7eIPP.js";import{o as h,u as g}from"./api-B6URs6nc.js";import{n as _,r as v}from"./hostGuard-zim_4F9V.js";import{n as y,t as b}from"./launchCommand-Du91jxMC.js";function x(e){return new Promise(t=>setTimeout(t,e))}async function S(){let e;try{e=(await g()).apiKey}catch(e){throw new N(e instanceof Error?e.message:String(e),501)}return _(C()),{"x-api-key":e,"anthropic-version":`2023-06-01`,"anthropic-beta":j,"content-type":`application/json`}}function C(){return`${u().BASE_API_URL}/v1/agents`}function w(e){if(t.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new N(`Authentication failed. Please run /login to re-authenticate.`,401);if(t===403)return new N(`Subscription required. Scheduled agents require a Claude Pro/Max/Team subscription.`,403);if(t===404)return new N(`Agent not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``;return new N(`Rate limit exceeded.${t?` Retry after ${t}s.`:``}`,429)}return new N((e.response?.data)?.error?.message??e.message,t)}return e instanceof N?e:new N(e instanceof Error?e.message:String(e),0)}function T(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function E(e){let n;for(let r=0;r<M;r++)try{return await e()}catch(e){let i=w(e);if(i.statusCode>=500){n=i,r<M-1&&await x(T(t.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**r);continue}throw i}throw n??new N(`Request failed after retries`,0)}async function D(){return E(async()=>{let e=await S();return(await t.get(C(),{headers:e})).data.data??[]})}async function O(e,n){return E(async()=>{let r=await S();return(await t.post(C(),{cron_expr:e,prompt:n,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone??`UTC`},{headers:r})).data})}async function k(e){return E(async()=>{let n=await S();await t.delete(`${C()}/${e}`,{headers:n})})}async function A(e){return E(async()=>{let n=await S();return(await t.post(`${C()}/${e}/run`,{},{headers:n})).data})}var j,M,N,P=e((()=>{n(),d(),v(),h(),j=`managed-agents-2026-04-01`,M=3,N=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`AgentsApiError`}}}));function F({agent:e}){let t=p(e.cron_expr,{utc:!0}),n=e.next_run?new Date(e.next_run).toLocaleString():`—`;return(0,L.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,L.jsxs)(o,{children:[(0,L.jsx)(i,{bold:!0,children:e.id}),(0,L.jsx)(i,{dimColor:!0,children:` · `}),(0,L.jsx)(i,{color:`suggestion`,children:e.status})]}),(0,L.jsxs)(i,{children:[`Schedule: `,t]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Prompt: `,e.prompt]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Next run: `,n]})]})}function I(e){if(e.mode===`list`)return e.agents.length===0?(0,L.jsx)(o,{children:(0,L.jsx)(i,{dimColor:!0,children:`No scheduled agents. Use /agents-platform create <cron> <prompt> to create one.`})}):(0,L.jsxs)(o,{flexDirection:`column`,children:[(0,L.jsx)(o,{marginBottom:1,children:(0,L.jsxs)(i,{bold:!0,children:[`Scheduled Agents (`,e.agents.length,`)`]})}),e.agents.map(e=>(0,L.jsx)(F,{agent:e},e.id))]});if(e.mode===`created`){let t=p(e.agent.cron_expr,{utc:!0});return(0,L.jsxs)(o,{flexDirection:`column`,children:[(0,L.jsx)(o,{children:(0,L.jsx)(i,{bold:!0,color:`success`,children:`Agent created`})}),(0,L.jsxs)(i,{children:[`ID: `,e.agent.id]}),(0,L.jsxs)(i,{children:[`Schedule: `,t]}),(0,L.jsxs)(i,{children:[`Prompt: `,e.agent.prompt]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Status: `,e.agent.status]})]})}return e.mode===`deleted`?(0,L.jsx)(o,{children:(0,L.jsxs)(i,{color:`success`,children:[`Agent `,e.id,` deleted.`]})}):e.mode===`ran`?(0,L.jsxs)(o,{flexDirection:`column`,children:[(0,L.jsx)(o,{children:(0,L.jsxs)(i,{color:`success`,children:[`Agent `,e.id,` triggered.`]})}),(0,L.jsxs)(i,{dimColor:!0,children:[`Run ID: `,e.runId]})]}):(0,L.jsx)(o,{children:(0,L.jsx)(i,{color:`error`,children:e.message})})}var L,R=e((()=>{r(),a(),m(),L=s()}));function z(e){let t=e.trim().split(/\s+/);return t.length<6?null:{cron:t.slice(0,5).join(` `),prompt:t.slice(5).join(` `)}}function B(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`create`){if(!i)return{action:`invalid`,reason:`create requires a cron expression and prompt, e.g. create "0 9 * * 1" Run daily standup`};let e=z(i);if(!e)return{action:`invalid`,reason:`create requires at least 5 cron fields followed by a prompt, e.g. create "0 9 * * 1" Run daily standup`};let{cron:t,prompt:n}=e;return n.trim()?{action:`create`,cron:t,prompt:n.trim()}:{action:`invalid`,reason:`prompt cannot be empty`}}if(r===`delete`){if(!i)return{action:`invalid`,reason:`delete requires an agent id`};let e=i.split(/\s+/)[0];return e?{action:`delete`,id:e}:{action:`invalid`,reason:`delete requires an agent id`}}if(r===`run`){if(!i)return{action:`invalid`,reason:`run requires an agent id`};let e=i.split(/\s+/)[0];return e?{action:`run`,id:e}:{action:`invalid`,reason:`run requires an agent id`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". Use: list | create CRON PROMPT | delete ID | run ID`}}var V=e((()=>{}));async function H(e,t){if(e.action===`list`){l(`tengu_agents_platform_list`,{});try{let e=await D();return t(e.length===0?`No scheduled agents found.`:`${e.length} scheduled agent(s).`,{display:`system`}),{mode:`list`,agents:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:n}),t(`Failed to list agents: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`create`){let{cron:n,prompt:r}=e;if(!f(n)){let e=`Invalid cron expression: "${n}". Expected 5 fields (minute hour day month weekday).`;return l(`tengu_agents_platform_failed`,{reason:e}),t(e,{display:`system`}),null}l(`tengu_agents_platform_create`,{cron:n});try{let e=await O(n,r);return t(`Agent created: ${e.id}`,{display:`system`}),{mode:`created`,agent:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:n}),t(`Failed to create agent: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`delete`){let{id:n}=e;l(`tengu_agents_platform_delete`,{id:n});try{return await k(n),t(`Agent ${n} deleted.`,{display:`system`}),{mode:`deleted`,id:n}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:r}),t(`Failed to delete agent ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}let{id:n}=e;l(`tengu_agents_platform_run`,{id:n});try{let e=await A(n);return t(`Agent ${n} triggered. Run ID: ${e.run_id}`,{display:`system`}),{mode:`ran`,id:n,runId:e.run_id}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:r}),t(`Failed to run agent ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}var U;e((()=>{c(),m(),P(),R(),V(),b(),U=y({commandName:`agents-platform`,parseArgs:e=>{l(`tengu_agents_platform_started`,{args:e});let t=B(e);return t.action===`invalid`?(l(`tengu_agents_platform_failed`,{reason:t.reason}),{action:`invalid`,reason:`Usage: /agents-platform list | create CRON PROMPT | delete ID | run ID\n${t.reason}`}):t},dispatch:H,View:I,errorView:e=>null})}))();export{U as callAgentsPlatform};
@@ -0,0 +1,2 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,t as i,x as a}from"./src-Di342QoJ.js";import{t as o}from"./jsx-runtime-D-D469L8.js";import{Ct as s,cn as c}from"./state-sIHsFpDu.js";import{n as l,r as u}from"./analytics-DqMQntaB.js";import{$_ as d,Q_ as f,X_ as p,Y_ as m,Z_ as h,cv as g,rv as _}from"./loadAgentsDir-Ci5mr0vm.js";import{a as v,r as y}from"./detectRepository-CBk3S2zv.js";import{join as b}from"node:path";import{existsSync as x}from"node:fs";import{randomUUID as S}from"node:crypto";function C(e){return D.indexOf(e)}function w({phase:e,target:t,sessionUrl:n,errorMessage:i}){let o=C(e),s=e===`error`;return(0,T.jsxs)(a,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(r,{bold:!0,children:`Autofix PR `}),(0,T.jsx)(r,{color:`claude`,children:t})]}),D.map((e,t)=>{let n=o>t,i=o===t&&!s;return(0,T.jsx)(a,{marginLeft:2,children:(0,T.jsxs)(r,{color:n?`success`:i?`warning`:`subtle`,children:[n?`✓`:i?`→`:`·`,` `,E[e]]})},e)}),s&&i&&(0,T.jsx)(a,{marginLeft:2,marginTop:1,children:(0,T.jsxs)(r,{color:`error`,children:[`✗ `,i]})}),n&&(0,T.jsxs)(a,{marginTop:1,marginLeft:2,children:[(0,T.jsx)(r,{color:`subtle`,children:`Track: `}),(0,T.jsx)(r,{color:`claude`,children:n})]})]})}var T,E,D,O=e((()=>{n(),i(),T=o(),E={detecting:`Detecting repository...`,checking_eligibility:`Checking remote agent eligibility...`,acquiring_lock:`Acquiring monitor lock...`,launching:`Launching remote session...`,registered:`Session registered`,done:`Autofix launched`,error:`Error`},D=[`detecting`,`checking_eligibility`,`acquiring_lock`,`launching`,`registered`,`done`]}));function k(e,t){return{agentId:S(),agentName:`autofix-pr`,teamName:`_autofix`,color:void 0,planModeRequired:!1,parentSessionId:s(),abortController:new AbortController,taskId:S()}}var A=e((()=>{c()}));function j(){return F}function M(e){return F?!1:(F=e,!0)}function N(e){F&&(e&&F.taskId!==e||(F.abortController.abort(),F=null))}function P(e,t,n){return F?.owner===e&&F?.repo===t&&F?.prNumber===n}var F,I=e((()=>{F=null}));function L(e){if(!/^[1-9]\d{0,9}$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function R(e){let t=e.trim();if(!t)return{action:`invalid`,reason:`empty`};if(t===`stop`||t===`off`)return{action:`stop`};let n=L(t);if(n!==null)return{action:`start`,prNumber:n};let r=t.match(/^([\w.-]+)\/([\w.-]+)#(\d+)$/);if(r){let e=L(r[3]);return e===null?{action:`invalid`,reason:`pr_number_out_of_range`}:{action:`start`,owner:r[1],repo:r[2],prNumber:e}}return{action:`freeform`,prompt:t}}var z=e((()=>{}));function B(e){return[`AUTOFIX.md`,`.claude/skills/autofix.md`,`.claude/skills/autofix-pr/SKILL.md`].filter(t=>x(b(e,t)))}function V(e){return e.length===0?``:` Run ${e.join(` and `)} for custom instructions on how to autofix.`}var H=e((()=>{}));function U(e,t){return u(`tengu_autofix_pr_result`,{result:`failed`,error_code:t}),`Autofix PR failed: ${e}`}var W,G;e((()=>{W=t(n(),1),l(),f(),v(),_(),O(),A(),I(),z(),H(),G=async(e,t,n)=>{try{let r=R(n);if(r.action===`stop`){let t=j();return t?(N(),e(`Stopped local monitoring of ${t.repo}#${t.prNumber}. Any already-running remote session continues until it finishes or is cancelled from claude.ai/code.`,{display:`system`}),null):(e(`No active autofix monitor.`,{display:`system`}),null)}if(r.action===`invalid`)return e(`Invalid args: ${r.reason}. Use /autofix-pr <pr-number> | stop | <owner>/<repo>#<n>`,{display:`system`}),null;if(r.action===`freeform`)return e(`Freeform prompt mode not yet supported. Use /autofix-pr <pr-number>.`,{display:`system`}),null;u(`tengu_autofix_pr_started`,{action:`start`,has_pr_number:`true`,has_repo_path:String(!!(r.owner&&r.repo))});let i;try{i=await y()}catch{return e(U(`Cannot detect GitHub repo from current directory.`,`session_create_failed`),{display:`system`}),null}if(!i||i.host!==`github.com`)return e(U(`Cannot detect GitHub repo from current directory.`,`session_create_failed`),{display:`system`}),null;if(r.owner&&r.owner!==i.owner||r.repo&&r.repo!==i.name)return e(U(`Cross-repo autofix is not supported from this directory. Run from ${i.owner}/${i.name} or pass only the PR number.`,`repo_mismatch`),{display:`system`}),null;let a=i.owner,o=i.name,{prNumber:s}=r;if(P(a,o,s))return u(`tengu_autofix_pr_result`,{result:`success_rc`}),e(`Already monitoring ${o}#${s} in background.`,{display:`system`}),null;let c=await m({skipBundle:!0});if(!c.eligible){let t=c.errors.filter(e=>e.type!==`no_remote_environment`);if(t.length>0)return e(U(`Remote agent not available:\n${t.map(p).join(`
2
+ `)}`,`session_create_failed`),{display:`system`}),null}let l=V(B(process.cwd())),f=`${a}/${o}#${s}`,_=`refs/pull/${s}/head`,v=`Auto-fix failing CI checks on PR #${s} in ${a}/${o}.${l}`,b=k(v,f);if(!M({taskId:b.taskId,owner:a,repo:o,prNumber:s,abortController:b.abortController,startedAt:Date.now()})){let t=j();return e(U(`already monitoring ${t?.repo}#${t?.prNumber}. Run /autofix-pr stop first.`,`rc_already_monitoring_other`),{display:`system`}),null}let x,S=e=>{x=e},C=null;try{C=await g({initialMessage:v,source:`autofix_pr`,branchName:_,skipBundle:!0,title:`Autofix PR: ${f}`,useDefaultEnvironment:!0,signal:b.abortController.signal,githubPr:{owner:a,repo:o,number:s},onBundleFail:S,onCreateFail:S})}catch(t){return N(b.taskId),e(U(`teleport failed: ${t instanceof Error?t.message:String(t)}`,`teleport_failed`),{display:`system`}),null}if(!C)return N(b.taskId),e(U(x??`remote session creation failed.`,`session_create_failed`),{display:`system`}),null;try{d({remoteTaskType:`autofix-pr`,session:C,command:`/autofix-pr ${s}`,context:t,isLongRunning:!0,remoteTaskMetadata:{owner:a,repo:o,prNumber:s}})}catch(t){return N(b.taskId),e(U(`task registration failed: ${t instanceof Error?t.message:String(t)}`,`registration_failed`),{display:`system`}),null}let T=h(C.id);return u(`tengu_autofix_pr_result`,{result:`success_rc`}),e(`Autofix launched for ${f}. Track: ${T}`,{display:`system`}),W.createElement(w,{phase:`done`,target:f,sessionUrl:T})}catch(t){let n=t instanceof Error?t.message:String(t);return u(`tengu_autofix_pr_result`,{result:`failed`,error_code:`exception`}),e(`Autofix PR failed: ${n}`,{display:`system`}),null}}}))();export{G as callAutofixPr};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-Di342QoJ.js";function r(e){return async(t,n,r)=>{let o=e.parseArgs(r??``);if(i(o))return t(`Invalid args: ${o.reason}`,{display:`system`}),e.errorView(o.reason);try{let r=await e.dispatch(o,t,n);return r===null?null:a.createElement(e.View,r)}catch(n){let r=n instanceof Error?n.message:String(n);return e.onDispatchError?.(n),t(`${e.commandName} failed: ${r}`,{display:`system`}),e.errorView(r)}}}function i(e){return typeof e==`object`&&!!e&&`action`in e&&e.action===`invalid`}var a,o=e((()=>{a=t(n(),1)}));export{r as n,o as t};
@@ -0,0 +1,3 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,f as i,t as a,x as o,xt as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Cf as l,Nx as u,Px as d,Sf as f,Tf as p,_f as m,bf as h,gf as g,vf as _,wf as v,xf as y,yf as b}from"./loadAgentsDir-Ci5mr0vm.js";import{n as x,t as S}from"./launchCommand-Du91jxMC.js";function C(e){return e.mode===`list`?e.stores.length===0?(0,w.jsx)(o,{children:(0,w.jsx)(r,{dimColor:!0,children:`No memory stores found. Use /local-memory create <store> to create one.`})}):(0,w.jsxs)(o,{flexDirection:`column`,children:[(0,w.jsx)(o,{marginBottom:1,children:(0,w.jsxs)(r,{bold:!0,children:[`Local Memory Stores (`,e.stores.length,`)`]})}),e.stores.map(e=>(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{children:` `}),(0,w.jsx)(r,{color:`success`,children:`◆`}),(0,w.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`created`?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{color:`success`,children:`✓`}),(0,w.jsx)(r,{children:` Store created: `}),(0,w.jsx)(r,{bold:!0,children:e.store})]}):e.mode===`stored`?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{color:`success`,children:`✓`}),(0,w.jsx)(r,{children:` Stored entry `}),(0,w.jsx)(r,{bold:!0,children:e.key}),(0,w.jsx)(r,{children:` in `}),(0,w.jsx)(r,{bold:!0,children:e.store})]}):e.mode===`fetched`?(0,w.jsxs)(o,{flexDirection:`column`,children:[(0,w.jsxs)(o,{marginBottom:1,children:[(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsx)(r,{dimColor:!0,children:`/`}),(0,w.jsx)(r,{bold:!0,children:e.key})]}),(0,w.jsx)(o,{children:(0,w.jsx)(r,{children:e.value})})]}):e.mode===`not-found`?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{color:`error`,children:`Not found: `}),(0,w.jsx)(r,{bold:!0,children:e.store}),e.key?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(r,{dimColor:!0,children:`/`}),(0,w.jsx)(r,{bold:!0,children:e.key})]}):null]}):e.mode===`entries`?e.keys.length===0?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{dimColor:!0,children:`No entries in `}),(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsxs)(r,{dimColor:!0,children:[`. Use /local-memory store `,e.store,` <key> <value> to add one.`]})]}):(0,w.jsxs)(o,{flexDirection:`column`,children:[(0,w.jsxs)(o,{marginBottom:1,children:[(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsxs)(r,{dimColor:!0,children:[` (`,e.keys.length,` entries)`]})]}),e.keys.map(e=>(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{children:` `}),(0,w.jsx)(r,{color:`success`,children:`·`}),(0,w.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`archived`?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{color:`success`,children:`✓`}),(0,w.jsx)(r,{children:` Archived store: `}),(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsxs)(r,{dimColor:!0,children:[` (renamed to `,e.store,`.archived)`]})]}):(0,w.jsx)(o,{children:(0,w.jsxs)(r,{color:`error`,children:[`Error: `,e.message]})})}var w,T=e((()=>{n(),a(),w=c()}));function E(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.split(/\s+/),r=n[0];if(r===`list`)return{action:`list`};if(r===`create`){let e=n[1];return e?{action:`create`,store:e}:{action:`invalid`,reason:`create requires a store name. ${D}`}}if(r===`store`){let e=n[1],t=n[2];if(!e)return{action:`invalid`,reason:`store requires a store name. ${D}`};if(!t)return{action:`invalid`,reason:`store requires a key. ${D}`};let r=n.slice(3).join(` `);return r?{action:`store`,store:e,key:t,value:r}:{action:`invalid`,reason:`store requires a value. ${D}`}}if(r===`fetch`){let e=n[1],t=n[2];return e?t?{action:`fetch`,store:e,key:t}:{action:`invalid`,reason:`fetch requires a key. ${D}`}:{action:`invalid`,reason:`fetch requires a store name. ${D}`}}if(r===`entries`){let e=n[1];return e?{action:`entries`,store:e}:{action:`invalid`,reason:`entries requires a store name. ${D}`}}if(r===`archive`){let e=n[1];return e?{action:`archive`,store:e}:{action:`invalid`,reason:`archive requires a store name. ${D}`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${D}`}}var D,O=e((()=>{D=`Usage: /local-memory list | create STORE | store STORE KEY VALUE | fetch STORE KEY | entries STORE | archive STORE`}));function k(e){return e.length===0?`No memory stores found.`:[`Local Memory Stores`,...e.map(e=>`- ${e}`)].join(`
2
+ `)}function A(e,t){return t.length===0?`No entries in "${e}".`:[`Entries in "${e}"`,...t.map(e=>`- ${e}`)].join(`
3
+ `)}function j({onDone:e}){let[t,n]=N.useState({kind:`menu`}),[a,c]=N.useState(0),[d,v]=N.useState(``),[b,x]=N.useState(0),[S,C]=N.useState(null),w=N.useCallback(e=>{n(e),v(``),x(0),C(null)},[]),T=N.useCallback(t=>e(t,{display:`system`}),[e]),E=N.useCallback((e,t,n,r,i={})=>{try{if(e===`list`){T(k(f()));return}if(e===`about`){T(F);return}if(!t){C(`Internal: missing store`);return}if(e===`create`){m(t),T(`Store created: ${t}`);return}if(e===`entries`){T(A(t,y(t)));return}if(e===`archive`){g(t),T(`Archived store: ${t}`);return}if(e===`fetch`){if(!n){C(`Internal: missing key`);return}let e=_(t,n);if(e===null){T(`Entry not found: ${t}/${n}`);return}T(`Entry fetched: ${t}/${n}\n\n${e}`);return}if(e===`store`){if(!n||r===void 0){C(`Internal: missing key or value`);return}if(!i.confirmedOverwrite&&_(t,n)!==null){w({kind:`confirm-overwrite`,store:t,key:n,value:r});return}l(t,n,r),T(`Stored ${t}/${n} (${r.length} chars)`);return}}catch(e){C(e instanceof Error?e.message:String(e))}},[T,w]);if(s((e,n)=>{if(t.kind!==`menu`)return;if(n.upArrow){c(e=>Math.max(0,e-1));return}if(n.downArrow){c(e=>Math.min(L.length-1,e+1));return}if(n.return){let e=L[a];if(!e)return;if(e.kind===`list`||e.kind===`about`){E(e.kind,void 0,void 0,void 0);return}w({kind:`collect-store`,action:e.kind});return}let r=Number(e);Number.isInteger(r)&&r>=1&&r<=L.length&&c(r-1)},{isActive:t.kind===`menu`}),s((e,n)=>{if(t.kind!==`confirm-archive`&&t.kind!==`confirm-overwrite`)return;if(n.escape){w({kind:`menu`});return}let r=e.toLowerCase();r===`y`||n.return?t.kind===`confirm-archive`?E(`archive`,t.store,void 0,void 0):E(`store`,t.store,t.key,t.value,{confirmedOverwrite:!0}):r===`n`&&w({kind:`menu`})},{isActive:t.kind===`confirm-archive`||t.kind===`confirm-overwrite`}),s((e,n)=>{if(!(t.kind!==`collect-store`&&t.kind!==`collect-key`&&t.kind!==`collect-value`)&&n.escape){if(t.kind===`collect-value`){w({kind:`collect-key`,action:t.action,store:t.store});return}if(t.kind===`collect-key`){w({kind:`collect-store`,action:t.action});return}w({kind:`menu`})}},{isActive:t.kind===`collect-store`||t.kind===`collect-key`||t.kind===`collect-value`}),t.kind===`menu`)return(0,P.jsx)(i,{title:`Local Memory`,subtitle:`${L.length} actions`,onCancel:()=>T(`Local memory panel dismissed`),color:`background`,hideInputGuide:!0,children:(0,P.jsxs)(o,{flexDirection:`column`,children:[L.map((e,t)=>(0,P.jsxs)(o,{flexDirection:`row`,children:[(0,P.jsx)(r,{children:`${t===a?`›`:` `} ${e.label}`.padEnd(I)}),(0,P.jsx)(r,{dimColor:!0,children:e.description})]},e.kind)),(0,P.jsx)(o,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`↑/↓ or 1-7 select · Enter run · Esc close`})})]})});if(t.kind===`confirm-archive`)return(0,P.jsx)(i,{title:`Confirm Archive`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,P.jsxs)(o,{flexDirection:`column`,children:[(0,P.jsxs)(r,{children:[`Archive store "`,t.store,`"? This renames it to *.archived.`]}),(0,P.jsx)(o,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`y/Enter = archive · n/Esc = cancel`})})]})});if(t.kind===`confirm-overwrite`)return(0,P.jsx)(i,{title:`Confirm Overwrite`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,P.jsxs)(o,{flexDirection:`column`,children:[(0,P.jsxs)(r,{children:[`Entry "`,t.store,`/`,t.key,`" already exists. Overwrite with new value (`,t.value.length,` chars)?`]}),(0,P.jsx)(o,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`y/Enter = overwrite · n/Esc = cancel`})})]})});let D=t.kind===`collect-store`?`STORE NAME`:t.kind===`collect-key`?`KEY NAME`:`VALUE`,O=t.kind===`collect-store`?`e.g. my-notes`:t.kind===`collect-key`?`e.g. todo-2026-05-08`:`free text`;return(0,P.jsx)(i,{title:`Local Memory · ${t.kind.replace(`collect-`,``).toUpperCase()}`,onCancel:()=>w({kind:`menu`}),color:`background`,hideInputGuide:!0,children:(0,P.jsxs)(o,{flexDirection:`column`,children:[(0,P.jsx)(o,{children:(0,P.jsx)(r,{dimColor:!0,children:D})}),(0,P.jsxs)(o,{children:[(0,P.jsx)(r,{children:`> `}),(0,P.jsx)(u,{value:d,onChange:e=>{v(e),C(null)},cursorOffset:b,onChangeCursorOffset:x,onSubmit:e=>{let n=e.trim();if(t.kind===`collect-store`){if(!n){C(`Store name required`);return}if(!h(n)){C(`Invalid store name (no /, \\, :, null byte, or leading dot; max 255 chars)`);return}t.action===`create`||t.action===`entries`||t.action===`archive`?t.action===`archive`?w({kind:`confirm-archive`,store:n}):E(t.action,n,void 0,void 0):w({kind:`collect-key`,action:t.action,store:n});return}if(t.kind===`collect-key`){if(!n){C(`Key required`);return}if(!p(n)){C(`Invalid key (allowed: letters/digits/._- only; no leading dot; not a Windows reserved name)`);return}t.action===`fetch`?E(`fetch`,t.store,n,void 0):w({kind:`collect-value`,action:`store`,store:t.store,key:n});return}t.kind===`collect-value`&&E(`store`,t.store,t.key,e)},placeholder:O,columns:70,showCursor:!0})]}),S!==null&&(0,P.jsx)(o,{marginTop:0,children:(0,P.jsxs)(r,{color:`warning`,children:[`✗ `,S]})}),(0,P.jsx)(o,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`Enter = next · Esc = back`})})]})})}async function M(e,t){if(e.action===`list`)return t(k(f()),{display:`system`}),null;if(e.action===`create`){let{store:n}=e;return m(n),t(`Store created: ${n}`,{display:`system`}),null}if(e.action===`store`){let{store:n,key:r,value:i}=e;return l(n,r,i),t(`Stored entry "${r}" in store "${n}".`,{display:`system`}),null}if(e.action===`fetch`){let{store:n,key:r}=e,i=_(n,r);return i===null?(t(`Entry not found: ${n}/${r}`,{display:`system`}),null):(t(`Entry fetched: ${n}/${r}\n${i}`,{display:`system`}),null)}if(e.action===`entries`){let{store:n}=e;return t(A(n,y(n)),{display:`system`}),null}if(e.action===`archive`){let{store:n}=e;return g(n),t(`Archived store: ${n}`,{display:`system`}),null}return t(F,{display:`system`}),null}var N,P,F,I,L,R,z;e((()=>{N=t(n(),1),a(),b(),v(),d(),T(),O(),S(),P=c(),F=`Usage: /local-memory list | create STORE | store STORE KEY VALUE | fetch STORE KEY | entries STORE | archive STORE`,I=26,L=[{kind:`list`,label:`List`,description:`Show all stores`},{kind:`create`,label:`Create`,description:`Create a new memory store`},{kind:`store`,label:`Store`,description:`Write an entry: store name + key + value`},{kind:`fetch`,label:`Fetch`,description:`Read an entry by store name + key`},{kind:`entries`,label:`Entries`,description:`List entry keys in a store`},{kind:`archive`,label:`Archive`,description:`Archive a store (rename to *.archived)`},{kind:`about`,label:`About`,description:`Show command syntax`}],R=x({commandName:`local-memory`,parseArgs:e=>{let t=E(e);return t.action===`invalid`?{action:`invalid`,reason:`${F}\n${t.reason}`}:t},dispatch:M,View:C,errorView:e=>N.createElement(C,{mode:`error`,message:e})}),z=async(e,t,n)=>(n??``).trim()===``?(0,P.jsx)(j,{onDone:e}):R(e,t,n)}))();export{z as callLocalMemory};
@@ -0,0 +1,3 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,f as i,t as a,x as o,xt as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Nx as l,Px as u,Tf as d,df as f,ff as p,hf as m,mf as h,pf as g,uf as _,wf as v}from"./loadAgentsDir-Ci5mr0vm.js";import{n as y,t as b}from"./launchCommand-Du91jxMC.js";function x(e){return e.mode===`list`?e.keys.length===0?(0,S.jsx)(o,{children:(0,S.jsx)(r,{dimColor:!0,children:`No secrets stored. Use /local-vault set <key> <value> to add one.`})}):(0,S.jsxs)(o,{flexDirection:`column`,children:[(0,S.jsx)(o,{marginBottom:1,children:(0,S.jsxs)(r,{bold:!0,children:[`Local Vault Keys (`,e.keys.length,`)`]})}),e.keys.map(e=>(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{children:` `}),(0,S.jsx)(r,{color:`success`,children:`●`}),(0,S.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`set-ok`?(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{color:`success`,children:`✓`}),(0,S.jsx)(r,{children:` Secret stored: `}),(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{dimColor:!0,children:` = [REDACTED]`})]}):e.mode===`get-masked`?(0,S.jsxs)(o,{flexDirection:`column`,children:[(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{dimColor:!0,children:`: `}),(0,S.jsx)(r,{children:e.masked})]}),(0,S.jsx)(o,{marginTop:1,children:(0,S.jsxs)(r,{dimColor:!0,children:[`Use /local-vault get `,e.key,` --reveal to see the full value.`]})})]}):e.mode===`get-revealed`?(0,S.jsxs)(o,{flexDirection:`column`,children:[(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{dimColor:!0,children:`: `}),(0,S.jsx)(r,{color:`warning`,children:e.value})]}),(0,S.jsx)(o,{marginTop:1,children:(0,S.jsx)(r,{dimColor:!0,color:`warning`,children:`⚠ Secret revealed in terminal — clear scrollback if this session is shared.`})})]}):e.mode===`not-found`?(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{color:`error`,children:`Key not found: `}),(0,S.jsx)(r,{bold:!0,children:e.key})]}):e.mode===`deleted`?(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{color:`success`,children:`✓`}),(0,S.jsx)(r,{children:` Deleted: `}),(0,S.jsx)(r,{bold:!0,children:e.key})]}):(0,S.jsx)(o,{children:(0,S.jsxs)(r,{color:`error`,children:[`Error: `,e.message]})})}var S,C=e((()=>{n(),a(),S=c()}));function w(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.split(/\s+/),r=n[0];if(r===`list`)return{action:`list`};if(r===`set`){let e=n[1];if(!e)return{action:`invalid`,reason:`set requires a key name. ${T}`};if(E.test(e))return{action:`invalid`,reason:`Key name must not start with "-" or a hyphen-like character (reserved for flags). ${T}`};let t=n.slice(2).join(` `);return t?{action:`set`,key:e,value:t}:{action:`invalid`,reason:`set requires a value. ${T}`}}if(r===`get`){let e=[`--reveal`],t=n.filter(t=>!e.includes(t))[1];return t?{action:`get`,key:t,reveal:n.includes(`--reveal`)}:{action:`invalid`,reason:`get requires a key name. ${T}`}}if(r===`delete`){let e=n[1];return e?{action:`delete`,key:e}:{action:`invalid`,reason:`delete requires a key name. ${T}`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${T}`}}var T,E,D=e((()=>{T=`Usage: /local-vault list | set KEY VALUE | get KEY [--reveal] | delete KEY`,E=/^[-‐-―−﹘﹣-]/}));function O(e){return e.length===0?`No secrets stored.`:[`Local Vault Keys`,...e.map(e=>`- ${e}`)].join(`
2
+ `)}function k({onDone:e}){let[t,n]=j.useState({kind:`menu`}),[a,c]=j.useState(0),[u,p]=j.useState(``),[v,y]=j.useState(0),[b,x]=j.useState(null),[S,C]=j.useState(!1),w=j.useCallback(e=>{n(e),p(``),y(0),x(null)},[]),T=j.useCallback(t=>e(t,{display:`system`}),[e]);s((e,n)=>{if(t.kind!==`menu`||S)return;if(n.upArrow){c(e=>Math.max(0,e-1));return}if(n.downArrow){c(e=>Math.min(F.length-1,e+1));return}if(n.return){let e=F[a];if(!e)return;if(e.kind===`about`){T(N);return}if(e.kind===`list`){C(!0),g().then(e=>{T(O(e))});return}w({kind:`collect-key`,action:e.kind});return}let r=Number(e);Number.isInteger(r)&&r>=1&&r<=F.length&&c(r-1)},{isActive:t.kind===`menu`&&!S}),s((e,n)=>{if(t.kind!==`confirm-overwrite`&&t.kind!==`confirm-delete`)return;if(n.escape){w({kind:`menu`});return}let r=e.toLowerCase();if(r===`y`||n.return)if(t.kind===`confirm-delete`){C(!0);let e=t.key;_(e).then(t=>{T(t?`Deleted: ${e}`:`Key not found: ${e}`)})}else{C(!0);let e=t.key,n=t.value;m(e,n).then(()=>T(`Secret stored: ${e} = [REDACTED]`)).catch(t=>T(`Failed to store ${e}: ${t instanceof Error?t.message:String(t)}`))}else r===`n`&&w({kind:`menu`})},{isActive:(t.kind===`confirm-overwrite`||t.kind===`confirm-delete`)&&!S}),s((e,n)=>{if(!(t.kind!==`collect-key`&&t.kind!==`collect-value`)&&n.escape){if(t.kind===`collect-value`){w({kind:`collect-key`,action:`set`});return}w({kind:`menu`})}},{isActive:(t.kind===`collect-key`||t.kind===`collect-value`)&&!S});let E=e=>{let n=e.trim();if(!n){x(`Key required`);return}if(!d(n)){x(`Invalid key (allowed: letters/digits/._- only; no leading dot; not a Windows reserved name)`);return}if(t.kind===`collect-key`){if(t.action===`get`){C(!0),f(n).then(e=>{T(e===null?`Key not found: ${n}`:`Key found: ${n} = ${h(e)}`)});return}if(t.action===`delete`){w({kind:`confirm-delete`,key:n});return}if(t.action===`set`){w({kind:`collect-value`,key:n});return}}},D=e=>{if(t.kind!==`collect-value`)return;if(e.length===0){x(`Secret value cannot be empty`);return}let n=t.key;C(!0),f(n).then(t=>{if(t!==null){C(!1),w({kind:`confirm-overwrite`,key:n,value:e});return}return m(n,e).then(()=>T(`Secret stored: ${n} = [REDACTED]`))}).catch(e=>T(`Failed to store ${n}: ${e instanceof Error?e.message:String(e)}`))};if(t.kind===`menu`)return(0,M.jsx)(i,{title:`Local Vault`,subtitle:`${F.length} actions`,onCancel:()=>T(`Local vault panel dismissed`),color:`background`,hideInputGuide:!0,children:(0,M.jsxs)(o,{flexDirection:`column`,children:[F.map((e,t)=>(0,M.jsxs)(o,{flexDirection:`row`,children:[(0,M.jsx)(r,{children:`${t===a?`›`:` `} ${e.label}`.padEnd(P)}),(0,M.jsx)(r,{dimColor:!0,children:e.description})]},e.kind)),S&&(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`Working...`})}),(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`↑/↓ or 1-5 select · Enter run · Esc close`})})]})});if(t.kind===`confirm-delete`)return(0,M.jsx)(i,{title:`Confirm Delete`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,M.jsxs)(o,{flexDirection:`column`,children:[(0,M.jsxs)(r,{children:[`Delete secret "`,t.key,`"? This cannot be undone.`]}),(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`y/Enter = delete · n/Esc = cancel`})}),S&&(0,M.jsx)(r,{dimColor:!0,children:`Deleting...`})]})});if(t.kind===`confirm-overwrite`)return(0,M.jsx)(i,{title:`Confirm Overwrite`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,M.jsxs)(o,{flexDirection:`column`,children:[(0,M.jsxs)(r,{children:[`Secret "`,t.key,`" already exists. Overwrite? Old value is lost.`]}),(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`y/Enter = overwrite · n/Esc = cancel`})}),S&&(0,M.jsx)(r,{dimColor:!0,children:`Storing...`})]})});let k=t.kind===`collect-key`?`KEY NAME`:`SECRET VALUE`,A=t.kind===`collect-key`?`e.g. github-token`:`(masked input — value never displayed)`,I=t.kind===`collect-key`?E:D,L=t.kind===`collect-value`;return(0,M.jsx)(i,{title:`Local Vault · ${t.kind===`collect-key`?`KEY`:`VALUE`}`,onCancel:()=>w({kind:`menu`}),color:`background`,hideInputGuide:!0,children:(0,M.jsxs)(o,{flexDirection:`column`,children:[(0,M.jsx)(o,{children:(0,M.jsx)(r,{dimColor:!0,children:k})}),(0,M.jsxs)(o,{children:[(0,M.jsx)(r,{children:`> `}),(0,M.jsx)(l,{value:u,onChange:e=>{p(e),x(null)},cursorOffset:v,onChangeCursorOffset:y,onSubmit:I,placeholder:A,columns:70,showCursor:!0,mask:L?`*`:void 0})]}),b!==null&&(0,M.jsx)(o,{marginTop:0,children:(0,M.jsxs)(r,{color:`warning`,children:[`✗ `,b]})}),S&&(0,M.jsx)(o,{marginTop:0,children:(0,M.jsx)(r,{dimColor:!0,children:`Working...`})}),(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`Enter = next · Esc = back`})})]})})}async function A(e,t){if(e.action===`list`)return t(O(await g()),{display:`system`}),null;if(e.action===`set`){let{key:n,value:r}=e;return await m(n,r),t(`Secret stored: ${n} = [REDACTED]`,{display:`system`}),null}if(e.action===`get`){let{key:n,reveal:r}=e,i=await f(n);return i===null?(t(`Key not found: ${n}`,{display:`system`}),null):r?(t([`Secret revealed for: ${n}`,`Warning: secret revealed in terminal.`,`${n} = ${i}`].join(`
3
+ `),{display:`system`}),null):(t(`Key found: ${n} = ${h(i)}`,{display:`system`}),null)}if(e.action===`delete`){let{key:n}=e;return await _(n)?(t(`Deleted: ${n}`,{display:`system`}),null):(t(`Key not found: ${n}`,{display:`system`}),null)}return t(N,{display:`system`}),null}var j,M,N,P,F,I,L;e((()=>{j=t(n(),1),a(),p(),v(),u(),C(),D(),b(),M=c(),N=`Usage: /local-vault list | set KEY VALUE | get KEY [--reveal] | delete KEY`,P=26,F=[{kind:`list`,label:`List`,description:`Show stored secret keys`},{kind:`set`,label:`Set`,description:`Store a secret: KEY + VALUE (input is masked)`},{kind:`get`,label:`Get`,description:`Look up a secret (returns masked preview)`},{kind:`delete`,label:`Delete`,description:`Delete a stored secret by KEY`},{kind:`about`,label:`About`,description:`Show command syntax`}],I=y({commandName:`local-vault`,parseArgs:e=>{let t=w(e);return t.action===`invalid`?{action:`invalid`,reason:`${N}\n${t.reason}`}:t},dispatch:A,View:x,errorView:e=>j.createElement(x,{mode:`error`,message:e})}),L=async(e,t,n)=>(n??``).trim()===``?(0,M.jsx)(k,{onDone:e}):I(e,t,n)}))();export{L as callLocalVault};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Rn as r,b as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{o as f,u as p}from"./api-B6URs6nc.js";import{n as m,r as h}from"./hostGuard-zim_4F9V.js";import{n as g,t as _}from"./launchCommand-Du91jxMC.js";function v(e){return new Promise(t=>setTimeout(t,e))}async function y(){let e;try{e=(await p()).apiKey}catch(e){throw new L(e instanceof Error?e.message:String(e),501)}return m(b()),{"x-api-key":e,"anthropic-version":`2023-06-01`,"anthropic-beta":F,"content-type":`application/json`}}function b(){return`${u().BASE_API_URL}/v1/memory_stores`}function x(e){if(t.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new L(`Authentication failed. Please run /login to re-authenticate.`,401);if(t===403)return new L(`Subscription required. Memory stores require a Claude Pro/Max/Team subscription.`,403);if(t===404)return new L(`Memory store or memory not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``;return new L(`Rate limit exceeded.${t?` Retry after ${t}s.`:``}`,429)}return new L((e.response?.data)?.error?.message??e.message,t)}return e instanceof L?e:new L(e instanceof Error?e.message:String(e),0)}function S(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function C(e){let n;for(let r=0;r<I;r++)try{return await e()}catch(e){let i=x(e);if(i.statusCode>=500){n=i,r<I-1&&await v(S(t.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**r);continue}throw i}throw n??new L(`Request failed after retries`,0)}async function w(){return C(async()=>{let e=await y();return(await t.get(b(),{headers:e})).data.data??[]})}async function T(e,n){return C(async()=>{let r=await y(),i={name:e};return n&&(i.namespace=n),(await t.post(b(),i,{headers:r})).data})}async function E(e){return C(async()=>{let n=await y();return(await t.get(`${b()}/${e}`,{headers:n})).data})}async function D(e){return C(async()=>{let n=await y();return(await t.post(`${b()}/${e}/archive`,{},{headers:n})).data})}async function O(e){return C(async()=>{let n=await y();return(await t.get(`${b()}/${e}/memories`,{headers:n})).data.data??[]})}async function k(e,n){return C(async()=>{let r=await y(),i={content:n};return(await t.post(`${b()}/${e}/memories`,i,{headers:r})).data})}async function A(e,n){return C(async()=>{let r=await y();return(await t.get(`${b()}/${e}/memories/${n}`,{headers:r})).data})}async function j(e,n,r){return C(async()=>{let i=await y(),a={content:r};return(await t.patch(`${b()}/${e}/memories/${n}`,a,{headers:i})).data})}async function M(e,n){return C(async()=>{let r=await y();await t.delete(`${b()}/${e}/memories/${n}`,{headers:r})})}async function N(e){return C(async()=>{let n=await y();return(await t.get(`${b()}/${e}/memory_versions`,{headers:n})).data.data??[]})}async function P(e,n){return C(async()=>{let r=await y();return(await t.post(`${b()}/${e}/memory_versions/${n}/redact`,{},{headers:r})).data})}var F,I,L,R=e((()=>{n(),d(),h(),f(),F=`managed-agents-2026-04-01`,I=3,L=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`MemoryStoresApiError`}}}));function z({store:e}){let t=!!e.archived_at,n=e.created_at?new Date(e.created_at).toLocaleString():`—`;return(0,V.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsxs)(o,{children:[(0,V.jsx)(i,{bold:!0,children:e.memory_store_id}),(0,V.jsx)(i,{dimColor:!0,children:` · `}),(0,V.jsx)(i,{color:t?`warning`:`success`,children:t?`archived`:`active`}),e.namespace?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(i,{dimColor:!0,children:` · ns: `}),(0,V.jsx)(i,{children:e.namespace})]}):null]}),(0,V.jsxs)(i,{children:[`Name: `,e.name]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Created: `,n]})]})}function B(e){if(e.mode===`list`)return e.stores.length===0?(0,V.jsx)(o,{children:(0,V.jsx)(i,{dimColor:!0,children:`No memory stores found. Use /memory-stores create <name> to create one.`})}):(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memory Stores (`,e.stores.length,`)`]})}),e.stores.map(e=>(0,V.jsx)(z,{store:e},e.memory_store_id))]});if(e.mode===`detail`){let{store:t}=e,n=!!t.archived_at,r=t.created_at?new Date(t.created_at).toLocaleString():`—`,a=t.archived_at?new Date(t.archived_at).toLocaleString():null;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memory Store: `,t.memory_store_id]})}),(0,V.jsxs)(i,{children:[`Name: `,t.name]}),t.namespace?(0,V.jsxs)(i,{children:[`Namespace: `,t.namespace]}):null,(0,V.jsxs)(i,{children:[`Status:`,` `,(0,V.jsx)(i,{color:n?`warning`:`success`,children:n?`archived`:`active`})]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Created: `,r]}),a?(0,V.jsxs)(i,{dimColor:!0,children:[`Archived: `,a]}):null]})}if(e.mode===`created`){let{store:t}=e;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`success`,children:`Memory store created`})}),(0,V.jsxs)(i,{children:[`ID: `,t.memory_store_id]}),(0,V.jsxs)(i,{children:[`Name: `,t.name]}),t.namespace?(0,V.jsxs)(i,{children:[`Namespace: `,t.namespace]}):null]})}if(e.mode===`archived`){let{store:t}=e,n=t.archived_at?new Date(t.archived_at).toLocaleString():`—`;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`warning`,children:`Memory store archived`})}),(0,V.jsxs)(i,{children:[`ID: `,t.memory_store_id]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Archived at: `,n]})]})}if(e.mode===`memory-list`){let{storeId:t,memories:n}=e;return n.length===0?(0,V.jsx)(o,{children:(0,V.jsxs)(i,{dimColor:!0,children:[`No memories in store `,t,`. Use /memory-stores create-memory `,t,` <content> to add one.`]})}):(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memories in `,t,` (`,n.length,`)`]})}),n.map(e=>(0,V.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsx)(i,{bold:!0,children:e.memory_id}),(0,V.jsx)(i,{dimColor:!0,children:e.content.length>80?`${e.content.slice(0,80)}…`:e.content})]},e.memory_id))]})}if(e.mode===`memory-detail`){let{memory:t}=e,n=t.created_at?new Date(t.created_at).toLocaleString():`—`,r=t.updated_at?new Date(t.updated_at).toLocaleString():`—`;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memory: `,t.memory_id]})}),(0,V.jsxs)(i,{children:[`Store: `,t.memory_store_id]}),(0,V.jsxs)(i,{children:[`Content: `,t.content]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Created: `,n]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Updated: `,r]})]})}if(e.mode===`memory-created`){let{memory:t}=e;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`success`,children:`Memory created`})}),(0,V.jsxs)(i,{children:[`ID: `,t.memory_id]}),(0,V.jsxs)(i,{children:[`Store: `,t.memory_store_id]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Content: `,t.content]})]})}if(e.mode===`memory-updated`){let{memory:t}=e;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`success`,children:`Memory updated`})}),(0,V.jsxs)(i,{children:[`ID: `,t.memory_id]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Content: `,t.content]})]})}if(e.mode===`memory-deleted`)return(0,V.jsx)(o,{children:(0,V.jsxs)(i,{color:`success`,children:[`Memory `,e.memoryId,` deleted from store `,e.storeId,`.`]})});if(e.mode===`versions`){let{storeId:t,versions:n}=e;return n.length===0?(0,V.jsx)(o,{children:(0,V.jsxs)(i,{dimColor:!0,children:[`No memory versions found for store `,t,`.`]})}):(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memory Versions in `,t,` (`,n.length,`)`]})}),n.map(e=>{let t=e.created_at?new Date(e.created_at).toLocaleString():`—`,n=!!e.redacted_at;return(0,V.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsxs)(o,{children:[(0,V.jsx)(i,{bold:!0,children:e.version_id}),n?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(i,{dimColor:!0,children:` · `}),(0,V.jsx)(i,{color:`warning`,children:`redacted`})]}):null]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Created: `,t]})]},e.version_id)})]})}if(e.mode===`redacted`){let{version:t}=e,n=t.redacted_at?new Date(t.redacted_at).toLocaleString():`—`;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`warning`,children:`Version redacted`})}),(0,V.jsxs)(i,{children:[`ID: `,t.version_id]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Redacted at: `,n]})]})}return(0,V.jsx)(o,{children:(0,V.jsx)(i,{color:`error`,children:e.message})})}var V,H=e((()=>{r(),a(),V=s()}));function U(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`get`){if(!i)return{action:`invalid`,reason:`get requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`get`,id:e}:{action:`invalid`,reason:`get requires a store id`}}if(r===`create`)return i?{action:`create`,name:i}:{action:`invalid`,reason:`create requires a store name, e.g. create "My Work Store"`};if(r===`archive`){if(!i)return{action:`invalid`,reason:`archive requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`archive`,id:e}:{action:`invalid`,reason:`archive requires a store id`}}if(r===`memories`){if(!i)return{action:`invalid`,reason:`memories requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`memories`,storeId:e}:{action:`invalid`,reason:`memories requires a store id`}}if(r===`create-memory`){let e=i.split(/\s+/);if(e.length<2||!e[0])return{action:`invalid`,reason:`create-memory requires a store id and content, e.g. create-memory ms_123 "The content"`};let t=e[0],n=e.slice(1).join(` `);return n.trim()?{action:`create-memory`,storeId:t,content:n.trim()}:{action:`invalid`,reason:`create-memory requires non-empty content`}}if(r===`get-memory`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`get-memory requires a store id and memory id, e.g. get-memory ms_123 mem_456`}:{action:`get-memory`,storeId:e[0],memoryId:e[1]}}if(r===`update-memory`){let e=i.split(/\s+/);if(e.length<3||!e[0]||!e[1])return{action:`invalid`,reason:`update-memory requires store id, memory id, and content, e.g. update-memory ms_123 mem_456 "New content"`};let t=e[0],n=e[1],r=e.slice(2).join(` `);return r.trim()?{action:`update-memory`,storeId:t,memoryId:n,content:r.trim()}:{action:`invalid`,reason:`update-memory requires non-empty content`}}if(r===`delete-memory`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`delete-memory requires a store id and memory id, e.g. delete-memory ms_123 mem_456`}:{action:`delete-memory`,storeId:e[0],memoryId:e[1]}}if(r===`versions`){if(!i)return{action:`invalid`,reason:`versions requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`versions`,storeId:e}:{action:`invalid`,reason:`versions requires a store id`}}if(r===`redact`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`redact requires a store id and version id, e.g. redact ms_123 ver_456`}:{action:`redact`,storeId:e[0],versionId:e[1]}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${W}`}}var W,G=e((()=>{W=`Usage: /memory-stores list | get ID | create NAME | archive ID | memories STORE_ID | create-memory STORE_ID CONTENT | get-memory STORE_ID MEMORY_ID | update-memory STORE_ID MEMORY_ID CONTENT | delete-memory STORE_ID MEMORY_ID | versions STORE_ID | redact STORE_ID VERSION_ID`}));async function K(e,t){if(e.action===`list`){l(`tengu_memory_stores_list`,{});try{let e=await w();return t(e.length===0?`No memory stores found.`:`${e.length} memory store(s).`,{display:`system`}),{mode:`list`,stores:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to list memory stores: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`get`){let{id:n}=e;l(`tengu_memory_stores_get`,{id:n});try{let e=await E(n);return t(`Memory store ${n} fetched.`,{display:`system`}),{mode:`detail`,store:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to get memory store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`create`){let{name:n}=e;l(`tengu_memory_stores_create`,{name:n});try{let e=await T(n);return t(`Memory store created: ${e.memory_store_id}`,{display:`system`}),{mode:`created`,store:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to create memory store: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`archive`){let{id:n}=e;l(`tengu_memory_stores_archive`,{id:n});try{let e=await D(n);return t(`Memory store ${n} archived.`,{display:`system`}),{mode:`archived`,store:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to archive memory store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`memories`){let{storeId:n}=e;l(`tengu_memory_stores_list_memories`,{storeId:n});try{let e=await O(n);return t(e.length===0?`No memories in store ${n}.`:`${e.length} memory(ies) in store ${n}.`,{display:`system`}),{mode:`memory-list`,storeId:n,memories:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to list memories in store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`create-memory`){let{storeId:n,content:r}=e;l(`tengu_memory_stores_create_memory`,{storeId:n});try{let e=await k(n,r);return t(`Memory created: ${e.memory_id}`,{display:`system`}),{mode:`memory-created`,memory:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to create memory in store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`get-memory`){let{storeId:n,memoryId:r}=e;l(`tengu_memory_stores_get_memory`,{storeId:n});try{let e=await A(n,r);return t(`Memory ${r} fetched.`,{display:`system`}),{mode:`memory-detail`,memory:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to get memory ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`update-memory`){let{storeId:n,memoryId:r,content:i}=e;l(`tengu_memory_stores_update_memory`,{storeId:n});try{let e=await j(n,r,i);return t(`Memory ${r} updated.`,{display:`system`}),{mode:`memory-updated`,memory:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to update memory ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`delete-memory`){let{storeId:n,memoryId:r}=e;l(`tengu_memory_stores_delete_memory`,{storeId:n});try{return await M(n,r),t(`Memory ${r} deleted.`,{display:`system`}),{mode:`memory-deleted`,storeId:n,memoryId:r}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to delete memory ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`versions`){let{storeId:n}=e;l(`tengu_memory_stores_versions`,{storeId:n});try{let e=await N(n);return t(e.length===0?`No memory versions found for store ${n}.`:`${e.length} version(s) in store ${n}.`,{display:`system`}),{mode:`versions`,storeId:n,versions:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to list versions for store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}let{storeId:n,versionId:r}=e;l(`tengu_memory_stores_redact`,{storeId:n});try{let e=await P(n,r);return t(`Version ${r} redacted.`,{display:`system`}),{mode:`redacted`,version:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to redact version ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}var q,J;e((()=>{c(),R(),H(),G(),_(),q=`Usage: /memory-stores list | get ID | create NAME | archive ID | memories STORE_ID | create-memory STORE_ID CONTENT | get-memory STORE_ID MEMORY_ID | update-memory STORE_ID MEMORY_ID CONTENT | delete-memory STORE_ID MEMORY_ID | versions STORE_ID | redact STORE_ID VERSION_ID`,J=g({commandName:`memory-stores`,parseArgs:e=>{l(`tengu_memory_stores_started`,{args:e});let t=U(e);return t.action===`invalid`?(l(`tengu_memory_stores_failed`,{reason:t.reason}),{action:`invalid`,reason:`${q}\n${t.reason}`}):t},dispatch:K,View:B,errorView:e=>null})}))();export{J as callMemoryStores};