@vybestack/llxprt-code-core 0.1.12

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 (448) hide show
  1. package/dist/.last_build +0 -0
  2. package/dist/index.d.ts +7 -0
  3. package/dist/index.js +8 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/src/__mocks__/fs/promises.d.ts +11 -0
  6. package/dist/src/__mocks__/fs/promises.js +17 -0
  7. package/dist/src/__mocks__/fs/promises.js.map +1 -0
  8. package/dist/src/code_assist/codeAssist.d.ts +9 -0
  9. package/dist/src/code_assist/codeAssist.js +19 -0
  10. package/dist/src/code_assist/codeAssist.js.map +1 -0
  11. package/dist/src/code_assist/converter.d.ts +68 -0
  12. package/dist/src/code_assist/converter.js +125 -0
  13. package/dist/src/code_assist/converter.js.map +1 -0
  14. package/dist/src/code_assist/converter.test.d.ts +6 -0
  15. package/dist/src/code_assist/converter.test.js +229 -0
  16. package/dist/src/code_assist/converter.test.js.map +1 -0
  17. package/dist/src/code_assist/oauth2.d.ts +20 -0
  18. package/dist/src/code_assist/oauth2.js +339 -0
  19. package/dist/src/code_assist/oauth2.js.map +1 -0
  20. package/dist/src/code_assist/oauth2.test.d.ts +6 -0
  21. package/dist/src/code_assist/oauth2.test.js +249 -0
  22. package/dist/src/code_assist/oauth2.test.js.map +1 -0
  23. package/dist/src/code_assist/server.d.ts +39 -0
  24. package/dist/src/code_assist/server.js +191 -0
  25. package/dist/src/code_assist/server.js.map +1 -0
  26. package/dist/src/code_assist/server.test.d.ts +6 -0
  27. package/dist/src/code_assist/server.test.js +123 -0
  28. package/dist/src/code_assist/server.test.js.map +1 -0
  29. package/dist/src/code_assist/setup.d.ts +15 -0
  30. package/dist/src/code_assist/setup.js +67 -0
  31. package/dist/src/code_assist/setup.js.map +1 -0
  32. package/dist/src/code_assist/setup.test.d.ts +6 -0
  33. package/dist/src/code_assist/setup.test.js +62 -0
  34. package/dist/src/code_assist/setup.test.js.map +1 -0
  35. package/dist/src/code_assist/types.d.ts +148 -0
  36. package/dist/src/code_assist/types.js +46 -0
  37. package/dist/src/code_assist/types.js.map +1 -0
  38. package/dist/src/config/config.d.ts +212 -0
  39. package/dist/src/config/config.js +454 -0
  40. package/dist/src/config/config.js.map +1 -0
  41. package/dist/src/config/config.test.d.ts +6 -0
  42. package/dist/src/config/config.test.js +291 -0
  43. package/dist/src/config/config.test.js.map +1 -0
  44. package/dist/src/config/flashFallback.test.d.ts +6 -0
  45. package/dist/src/config/flashFallback.test.js +115 -0
  46. package/dist/src/config/flashFallback.test.js.map +1 -0
  47. package/dist/src/config/models.d.ts +8 -0
  48. package/dist/src/config/models.js +9 -0
  49. package/dist/src/config/models.js.map +1 -0
  50. package/dist/src/core/client.d.ts +59 -0
  51. package/dist/src/core/client.js +503 -0
  52. package/dist/src/core/client.js.map +1 -0
  53. package/dist/src/core/client.test.d.ts +6 -0
  54. package/dist/src/core/client.test.js +1006 -0
  55. package/dist/src/core/client.test.js.map +1 -0
  56. package/dist/src/core/contentGenerator.d.ts +36 -0
  57. package/dist/src/core/contentGenerator.js +79 -0
  58. package/dist/src/core/contentGenerator.js.map +1 -0
  59. package/dist/src/core/contentGenerator.test.d.ts +6 -0
  60. package/dist/src/core/contentGenerator.test.js +92 -0
  61. package/dist/src/core/contentGenerator.test.js.map +1 -0
  62. package/dist/src/core/coreToolScheduler.d.ts +104 -0
  63. package/dist/src/core/coreToolScheduler.js +413 -0
  64. package/dist/src/core/coreToolScheduler.js.map +1 -0
  65. package/dist/src/core/coreToolScheduler.test.d.ts +6 -0
  66. package/dist/src/core/coreToolScheduler.test.js +347 -0
  67. package/dist/src/core/coreToolScheduler.test.js.map +1 -0
  68. package/dist/src/core/geminiChat.d.ts +116 -0
  69. package/dist/src/core/geminiChat.js +513 -0
  70. package/dist/src/core/geminiChat.js.map +1 -0
  71. package/dist/src/core/geminiChat.test.d.ts +6 -0
  72. package/dist/src/core/geminiChat.test.js +424 -0
  73. package/dist/src/core/geminiChat.test.js.map +1 -0
  74. package/dist/src/core/geminiRequest.d.ts +13 -0
  75. package/dist/src/core/geminiRequest.js +45 -0
  76. package/dist/src/core/geminiRequest.js.map +1 -0
  77. package/dist/src/core/geminiRequest.test.d.ts +6 -0
  78. package/dist/src/core/geminiRequest.test.js +72 -0
  79. package/dist/src/core/geminiRequest.test.js.map +1 -0
  80. package/dist/src/core/logger.d.ts +38 -0
  81. package/dist/src/core/logger.js +237 -0
  82. package/dist/src/core/logger.js.map +1 -0
  83. package/dist/src/core/logger.test.d.ts +6 -0
  84. package/dist/src/core/logger.test.js +387 -0
  85. package/dist/src/core/logger.test.js.map +1 -0
  86. package/dist/src/core/modelCheck.d.ts +14 -0
  87. package/dist/src/core/modelCheck.js +55 -0
  88. package/dist/src/core/modelCheck.js.map +1 -0
  89. package/dist/src/core/nonInteractiveToolExecutor.d.ts +12 -0
  90. package/dist/src/core/nonInteractiveToolExecutor.js +93 -0
  91. package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -0
  92. package/dist/src/core/nonInteractiveToolExecutor.test.d.ts +6 -0
  93. package/dist/src/core/nonInteractiveToolExecutor.test.js +180 -0
  94. package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -0
  95. package/dist/src/core/prompts.d.ts +12 -0
  96. package/dist/src/core/prompts.js +418 -0
  97. package/dist/src/core/prompts.js.map +1 -0
  98. package/dist/src/core/prompts.test.d.ts +6 -0
  99. package/dist/src/core/prompts.test.js +97 -0
  100. package/dist/src/core/prompts.test.js.map +1 -0
  101. package/dist/src/core/tokenLimits.d.ts +10 -0
  102. package/dist/src/core/tokenLimits.js +75 -0
  103. package/dist/src/core/tokenLimits.js.map +1 -0
  104. package/dist/src/core/tokenLimits.test.d.ts +6 -0
  105. package/dist/src/core/tokenLimits.test.js +66 -0
  106. package/dist/src/core/tokenLimits.test.js.map +1 -0
  107. package/dist/src/core/turn.d.ts +116 -0
  108. package/dist/src/core/turn.js +131 -0
  109. package/dist/src/core/turn.js.map +1 -0
  110. package/dist/src/core/turn.test.d.ts +6 -0
  111. package/dist/src/core/turn.test.js +237 -0
  112. package/dist/src/core/turn.test.js.map +1 -0
  113. package/dist/src/index.d.ts +57 -0
  114. package/dist/src/index.js +64 -0
  115. package/dist/src/index.js.map +1 -0
  116. package/dist/src/index.test.d.ts +6 -0
  117. package/dist/src/index.test.js +12 -0
  118. package/dist/src/index.test.js.map +1 -0
  119. package/dist/src/providers/ProviderContentGenerator.d.ts +21 -0
  120. package/dist/src/providers/ProviderContentGenerator.js +52 -0
  121. package/dist/src/providers/ProviderContentGenerator.js.map +1 -0
  122. package/dist/src/providers/adapters/GeminiCompatibleWrapper.d.ts +68 -0
  123. package/dist/src/providers/adapters/GeminiCompatibleWrapper.js +549 -0
  124. package/dist/src/providers/adapters/GeminiCompatibleWrapper.js.map +1 -0
  125. package/dist/src/providers/adapters/GeminiCompatibleWrapper.test.d.ts +6 -0
  126. package/dist/src/providers/adapters/GeminiCompatibleWrapper.test.js +253 -0
  127. package/dist/src/providers/adapters/GeminiCompatibleWrapper.test.js.map +1 -0
  128. package/dist/src/providers/types.d.ts +82 -0
  129. package/dist/src/providers/types.js +7 -0
  130. package/dist/src/providers/types.js.map +1 -0
  131. package/dist/src/services/fileDiscoveryService.d.ts +35 -0
  132. package/dist/src/services/fileDiscoveryService.js +91 -0
  133. package/dist/src/services/fileDiscoveryService.js.map +1 -0
  134. package/dist/src/services/fileDiscoveryService.test.d.ts +6 -0
  135. package/dist/src/services/fileDiscoveryService.test.js +102 -0
  136. package/dist/src/services/fileDiscoveryService.test.js.map +1 -0
  137. package/dist/src/services/gitService.d.ts +21 -0
  138. package/dist/src/services/gitService.js +102 -0
  139. package/dist/src/services/gitService.js.map +1 -0
  140. package/dist/src/services/gitService.test.d.ts +6 -0
  141. package/dist/src/services/gitService.test.js +246 -0
  142. package/dist/src/services/gitService.test.js.map +1 -0
  143. package/dist/src/services/ideContext.d.ts +124 -0
  144. package/dist/src/services/ideContext.js +90 -0
  145. package/dist/src/services/ideContext.js.map +1 -0
  146. package/dist/src/services/ideContext.test.d.ts +6 -0
  147. package/dist/src/services/ideContext.test.js +101 -0
  148. package/dist/src/services/ideContext.test.js.map +1 -0
  149. package/dist/src/services/loopDetectionService.d.ts +35 -0
  150. package/dist/src/services/loopDetectionService.js +117 -0
  151. package/dist/src/services/loopDetectionService.js.map +1 -0
  152. package/dist/src/services/loopDetectionService.test.d.ts +6 -0
  153. package/dist/src/services/loopDetectionService.test.js +232 -0
  154. package/dist/src/services/loopDetectionService.test.js.map +1 -0
  155. package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +35 -0
  156. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +424 -0
  157. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -0
  158. package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +47 -0
  159. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +123 -0
  160. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -0
  161. package/dist/src/telemetry/constants.d.ts +20 -0
  162. package/dist/src/telemetry/constants.js +21 -0
  163. package/dist/src/telemetry/constants.js.map +1 -0
  164. package/dist/src/telemetry/index.d.ts +18 -0
  165. package/dist/src/telemetry/index.js +20 -0
  166. package/dist/src/telemetry/index.js.map +1 -0
  167. package/dist/src/telemetry/integration.test.circular.d.ts +6 -0
  168. package/dist/src/telemetry/integration.test.circular.js +53 -0
  169. package/dist/src/telemetry/integration.test.circular.js.map +1 -0
  170. package/dist/src/telemetry/loggers.d.ts +15 -0
  171. package/dist/src/telemetry/loggers.js +229 -0
  172. package/dist/src/telemetry/loggers.js.map +1 -0
  173. package/dist/src/telemetry/loggers.test.circular.d.ts +6 -0
  174. package/dist/src/telemetry/loggers.test.circular.js +100 -0
  175. package/dist/src/telemetry/loggers.test.circular.js.map +1 -0
  176. package/dist/src/telemetry/loggers.test.d.ts +6 -0
  177. package/dist/src/telemetry/loggers.test.js +558 -0
  178. package/dist/src/telemetry/loggers.test.js.map +1 -0
  179. package/dist/src/telemetry/metrics.d.ts +19 -0
  180. package/dist/src/telemetry/metrics.js +144 -0
  181. package/dist/src/telemetry/metrics.js.map +1 -0
  182. package/dist/src/telemetry/metrics.test.d.ts +6 -0
  183. package/dist/src/telemetry/metrics.test.js +162 -0
  184. package/dist/src/telemetry/metrics.test.js.map +1 -0
  185. package/dist/src/telemetry/sdk.d.ts +9 -0
  186. package/dist/src/telemetry/sdk.js +120 -0
  187. package/dist/src/telemetry/sdk.js.map +1 -0
  188. package/dist/src/telemetry/telemetry.test.d.ts +6 -0
  189. package/dist/src/telemetry/telemetry.test.js +52 -0
  190. package/dist/src/telemetry/telemetry.test.js.map +1 -0
  191. package/dist/src/telemetry/types.d.ts +115 -0
  192. package/dist/src/telemetry/types.js +217 -0
  193. package/dist/src/telemetry/types.js.map +1 -0
  194. package/dist/src/telemetry/uiTelemetry.d.ts +67 -0
  195. package/dist/src/telemetry/uiTelemetry.js +131 -0
  196. package/dist/src/telemetry/uiTelemetry.js.map +1 -0
  197. package/dist/src/telemetry/uiTelemetry.test.d.ts +6 -0
  198. package/dist/src/telemetry/uiTelemetry.test.js +412 -0
  199. package/dist/src/telemetry/uiTelemetry.test.js.map +1 -0
  200. package/dist/src/tools/diffOptions.d.ts +7 -0
  201. package/dist/src/tools/diffOptions.js +10 -0
  202. package/dist/src/tools/diffOptions.js.map +1 -0
  203. package/dist/src/tools/edit.d.ts +73 -0
  204. package/dist/src/tools/edit.js +343 -0
  205. package/dist/src/tools/edit.js.map +1 -0
  206. package/dist/src/tools/edit.test.d.ts +6 -0
  207. package/dist/src/tools/edit.test.js +500 -0
  208. package/dist/src/tools/edit.test.js.map +1 -0
  209. package/dist/src/tools/glob.d.ts +58 -0
  210. package/dist/src/tools/glob.js +193 -0
  211. package/dist/src/tools/glob.js.map +1 -0
  212. package/dist/src/tools/glob.test.d.ts +6 -0
  213. package/dist/src/tools/glob.test.js +294 -0
  214. package/dist/src/tools/glob.test.js.map +1 -0
  215. package/dist/src/tools/grep.d.ts +78 -0
  216. package/dist/src/tools/grep.js +422 -0
  217. package/dist/src/tools/grep.js.map +1 -0
  218. package/dist/src/tools/grep.test.d.ts +6 -0
  219. package/dist/src/tools/grep.test.js +188 -0
  220. package/dist/src/tools/grep.test.js.map +1 -0
  221. package/dist/src/tools/ls.d.ts +83 -0
  222. package/dist/src/tools/ls.js +194 -0
  223. package/dist/src/tools/ls.js.map +1 -0
  224. package/dist/src/tools/mcp-client.d.ts +112 -0
  225. package/dist/src/tools/mcp-client.js +332 -0
  226. package/dist/src/tools/mcp-client.js.map +1 -0
  227. package/dist/src/tools/mcp-client.test.d.ts +6 -0
  228. package/dist/src/tools/mcp-client.test.js +227 -0
  229. package/dist/src/tools/mcp-client.test.js.map +1 -0
  230. package/dist/src/tools/mcp-tool.d.ts +23 -0
  231. package/dist/src/tools/mcp-tool.js +119 -0
  232. package/dist/src/tools/mcp-tool.js.map +1 -0
  233. package/dist/src/tools/mcp-tool.test.d.ts +6 -0
  234. package/dist/src/tools/mcp-tool.test.js +173 -0
  235. package/dist/src/tools/mcp-tool.test.js.map +1 -0
  236. package/dist/src/tools/memoryTool.d.ts +28 -0
  237. package/dist/src/tools/memoryTool.js +172 -0
  238. package/dist/src/tools/memoryTool.js.map +1 -0
  239. package/dist/src/tools/memoryTool.test.d.ts +6 -0
  240. package/dist/src/tools/memoryTool.test.js +181 -0
  241. package/dist/src/tools/memoryTool.test.js.map +1 -0
  242. package/dist/src/tools/modifiable-tool.d.ts +29 -0
  243. package/dist/src/tools/modifiable-tool.js +85 -0
  244. package/dist/src/tools/modifiable-tool.js.map +1 -0
  245. package/dist/src/tools/modifiable-tool.test.d.ts +6 -0
  246. package/dist/src/tools/modifiable-tool.test.js +204 -0
  247. package/dist/src/tools/modifiable-tool.test.js.map +1 -0
  248. package/dist/src/tools/read-file.d.ts +35 -0
  249. package/dist/src/tools/read-file.js +106 -0
  250. package/dist/src/tools/read-file.js.map +1 -0
  251. package/dist/src/tools/read-file.test.d.ts +6 -0
  252. package/dist/src/tools/read-file.test.js +181 -0
  253. package/dist/src/tools/read-file.test.js.map +1 -0
  254. package/dist/src/tools/read-many-files.d.ts +59 -0
  255. package/dist/src/tools/read-many-files.js +321 -0
  256. package/dist/src/tools/read-many-files.js.map +1 -0
  257. package/dist/src/tools/read-many-files.test.d.ts +6 -0
  258. package/dist/src/tools/read-many-files.test.js +312 -0
  259. package/dist/src/tools/read-many-files.test.js.map +1 -0
  260. package/dist/src/tools/shell.d.ts +43 -0
  261. package/dist/src/tools/shell.js +435 -0
  262. package/dist/src/tools/shell.js.map +1 -0
  263. package/dist/src/tools/shell.test.d.ts +6 -0
  264. package/dist/src/tools/shell.test.js +407 -0
  265. package/dist/src/tools/shell.test.js.map +1 -0
  266. package/dist/src/tools/todo-read.d.ts +15 -0
  267. package/dist/src/tools/todo-read.js +66 -0
  268. package/dist/src/tools/todo-read.js.map +1 -0
  269. package/dist/src/tools/todo-read.test.d.ts +6 -0
  270. package/dist/src/tools/todo-read.test.js +158 -0
  271. package/dist/src/tools/todo-read.test.js.map +1 -0
  272. package/dist/src/tools/todo-schemas.d.ts +43 -0
  273. package/dist/src/tools/todo-schemas.js +16 -0
  274. package/dist/src/tools/todo-schemas.js.map +1 -0
  275. package/dist/src/tools/todo-schemas.test.d.ts +6 -0
  276. package/dist/src/tools/todo-schemas.test.js +152 -0
  277. package/dist/src/tools/todo-schemas.test.js.map +1 -0
  278. package/dist/src/tools/todo-store.d.ts +15 -0
  279. package/dist/src/tools/todo-store.js +59 -0
  280. package/dist/src/tools/todo-store.js.map +1 -0
  281. package/dist/src/tools/todo-store.test.d.ts +6 -0
  282. package/dist/src/tools/todo-store.test.js +175 -0
  283. package/dist/src/tools/todo-store.test.js.map +1 -0
  284. package/dist/src/tools/todo-write.d.ts +17 -0
  285. package/dist/src/tools/todo-write.js +98 -0
  286. package/dist/src/tools/todo-write.js.map +1 -0
  287. package/dist/src/tools/todo-write.test.d.ts +6 -0
  288. package/dist/src/tools/todo-write.test.js +208 -0
  289. package/dist/src/tools/todo-write.test.js.map +1 -0
  290. package/dist/src/tools/tool-registry.d.ts +67 -0
  291. package/dist/src/tools/tool-registry.js +326 -0
  292. package/dist/src/tools/tool-registry.js.map +1 -0
  293. package/dist/src/tools/tool-registry.test.d.ts +6 -0
  294. package/dist/src/tools/tool-registry.test.js +398 -0
  295. package/dist/src/tools/tool-registry.test.js.map +1 -0
  296. package/dist/src/tools/tools.d.ts +184 -0
  297. package/dist/src/tools/tools.js +88 -0
  298. package/dist/src/tools/tools.js.map +1 -0
  299. package/dist/src/tools/web-fetch.d.ts +29 -0
  300. package/dist/src/tools/web-fetch.js +243 -0
  301. package/dist/src/tools/web-fetch.js.map +1 -0
  302. package/dist/src/tools/web-fetch.test.d.ts +6 -0
  303. package/dist/src/tools/web-fetch.test.js +70 -0
  304. package/dist/src/tools/web-fetch.test.js.map +1 -0
  305. package/dist/src/tools/web-search.d.ts +49 -0
  306. package/dist/src/tools/web-search.js +120 -0
  307. package/dist/src/tools/web-search.js.map +1 -0
  308. package/dist/src/tools/write-file.d.ts +42 -0
  309. package/dist/src/tools/write-file.js +248 -0
  310. package/dist/src/tools/write-file.js.map +1 -0
  311. package/dist/src/tools/write-file.test.d.ts +6 -0
  312. package/dist/src/tools/write-file.test.js +413 -0
  313. package/dist/src/tools/write-file.test.js.map +1 -0
  314. package/dist/src/utils/LruCache.d.ts +13 -0
  315. package/dist/src/utils/LruCache.js +38 -0
  316. package/dist/src/utils/LruCache.js.map +1 -0
  317. package/dist/src/utils/bfsFileSearch.d.ts +22 -0
  318. package/dist/src/utils/bfsFileSearch.js +62 -0
  319. package/dist/src/utils/bfsFileSearch.js.map +1 -0
  320. package/dist/src/utils/bfsFileSearch.test.d.ts +6 -0
  321. package/dist/src/utils/bfsFileSearch.test.js +129 -0
  322. package/dist/src/utils/bfsFileSearch.test.js.map +1 -0
  323. package/dist/src/utils/editCorrector.d.ts +53 -0
  324. package/dist/src/utils/editCorrector.js +546 -0
  325. package/dist/src/utils/editCorrector.js.map +1 -0
  326. package/dist/src/utils/editCorrector.test.d.ts +6 -0
  327. package/dist/src/utils/editCorrector.test.js +564 -0
  328. package/dist/src/utils/editCorrector.test.js.map +1 -0
  329. package/dist/src/utils/editor.d.ts +28 -0
  330. package/dist/src/utils/editor.js +163 -0
  331. package/dist/src/utils/editor.js.map +1 -0
  332. package/dist/src/utils/editor.test.d.ts +6 -0
  333. package/dist/src/utils/editor.test.js +293 -0
  334. package/dist/src/utils/editor.test.js.map +1 -0
  335. package/dist/src/utils/errorReporting.d.ts +14 -0
  336. package/dist/src/utils/errorReporting.js +88 -0
  337. package/dist/src/utils/errorReporting.js.map +1 -0
  338. package/dist/src/utils/errorReporting.test.d.ts +6 -0
  339. package/dist/src/utils/errorReporting.test.js +124 -0
  340. package/dist/src/utils/errorReporting.test.js.map +1 -0
  341. package/dist/src/utils/errors.d.ts +14 -0
  342. package/dist/src/utils/errors.js +54 -0
  343. package/dist/src/utils/errors.js.map +1 -0
  344. package/dist/src/utils/fetch.d.ts +11 -0
  345. package/dist/src/utils/fetch.js +51 -0
  346. package/dist/src/utils/fetch.js.map +1 -0
  347. package/dist/src/utils/fileUtils.d.ts +49 -0
  348. package/dist/src/utils/fileUtils.js +286 -0
  349. package/dist/src/utils/fileUtils.js.map +1 -0
  350. package/dist/src/utils/fileUtils.test.d.ts +6 -0
  351. package/dist/src/utils/fileUtils.test.js +321 -0
  352. package/dist/src/utils/fileUtils.test.js.map +1 -0
  353. package/dist/src/utils/flashFallback.integration.test.d.ts +6 -0
  354. package/dist/src/utils/flashFallback.integration.test.js +112 -0
  355. package/dist/src/utils/flashFallback.integration.test.js.map +1 -0
  356. package/dist/src/utils/generateContentResponseUtilities.d.ts +14 -0
  357. package/dist/src/utils/generateContentResponseUtilities.js +92 -0
  358. package/dist/src/utils/generateContentResponseUtilities.js.map +1 -0
  359. package/dist/src/utils/generateContentResponseUtilities.test.d.ts +6 -0
  360. package/dist/src/utils/generateContentResponseUtilities.test.js +273 -0
  361. package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -0
  362. package/dist/src/utils/getFolderStructure.d.ts +30 -0
  363. package/dist/src/utils/getFolderStructure.js +247 -0
  364. package/dist/src/utils/getFolderStructure.js.map +1 -0
  365. package/dist/src/utils/getFolderStructure.test.d.ts +6 -0
  366. package/dist/src/utils/getFolderStructure.test.js +298 -0
  367. package/dist/src/utils/getFolderStructure.test.js.map +1 -0
  368. package/dist/src/utils/gitIgnoreParser.d.ts +20 -0
  369. package/dist/src/utils/gitIgnoreParser.js +64 -0
  370. package/dist/src/utils/gitIgnoreParser.js.map +1 -0
  371. package/dist/src/utils/gitIgnoreParser.test.d.ts +6 -0
  372. package/dist/src/utils/gitIgnoreParser.test.js +145 -0
  373. package/dist/src/utils/gitIgnoreParser.test.js.map +1 -0
  374. package/dist/src/utils/gitUtils.d.ts +17 -0
  375. package/dist/src/utils/gitUtils.js +61 -0
  376. package/dist/src/utils/gitUtils.js.map +1 -0
  377. package/dist/src/utils/memoryDiscovery.d.ts +14 -0
  378. package/dist/src/utils/memoryDiscovery.js +219 -0
  379. package/dist/src/utils/memoryDiscovery.js.map +1 -0
  380. package/dist/src/utils/memoryDiscovery.test.d.ts +6 -0
  381. package/dist/src/utils/memoryDiscovery.test.js +432 -0
  382. package/dist/src/utils/memoryDiscovery.test.js.map +1 -0
  383. package/dist/src/utils/memoryImportProcessor.d.ts +35 -0
  384. package/dist/src/utils/memoryImportProcessor.js +141 -0
  385. package/dist/src/utils/memoryImportProcessor.js.map +1 -0
  386. package/dist/src/utils/memoryImportProcessor.test.d.ts +6 -0
  387. package/dist/src/utils/memoryImportProcessor.test.js +170 -0
  388. package/dist/src/utils/memoryImportProcessor.test.js.map +1 -0
  389. package/dist/src/utils/messageInspectors.d.ts +8 -0
  390. package/dist/src/utils/messageInspectors.js +16 -0
  391. package/dist/src/utils/messageInspectors.js.map +1 -0
  392. package/dist/src/utils/nextSpeakerChecker.d.ts +12 -0
  393. package/dist/src/utils/nextSpeakerChecker.js +113 -0
  394. package/dist/src/utils/nextSpeakerChecker.js.map +1 -0
  395. package/dist/src/utils/nextSpeakerChecker.test.d.ts +6 -0
  396. package/dist/src/utils/nextSpeakerChecker.test.js +168 -0
  397. package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -0
  398. package/dist/src/utils/paths.d.ts +49 -0
  399. package/dist/src/utils/paths.js +145 -0
  400. package/dist/src/utils/paths.js.map +1 -0
  401. package/dist/src/utils/quotaErrorDetection.d.ts +22 -0
  402. package/dist/src/utils/quotaErrorDetection.js +67 -0
  403. package/dist/src/utils/quotaErrorDetection.js.map +1 -0
  404. package/dist/src/utils/retry.d.ts +21 -0
  405. package/dist/src/utils/retry.js +276 -0
  406. package/dist/src/utils/retry.js.map +1 -0
  407. package/dist/src/utils/retry.test.d.ts +6 -0
  408. package/dist/src/utils/retry.test.js +322 -0
  409. package/dist/src/utils/retry.test.js.map +1 -0
  410. package/dist/src/utils/safeJsonStringify.d.ts +13 -0
  411. package/dist/src/utils/safeJsonStringify.js +25 -0
  412. package/dist/src/utils/safeJsonStringify.js.map +1 -0
  413. package/dist/src/utils/safeJsonStringify.test.d.ts +6 -0
  414. package/dist/src/utils/safeJsonStringify.test.js +61 -0
  415. package/dist/src/utils/safeJsonStringify.test.js.map +1 -0
  416. package/dist/src/utils/schemaValidator.d.ts +23 -0
  417. package/dist/src/utils/schemaValidator.js +142 -0
  418. package/dist/src/utils/schemaValidator.js.map +1 -0
  419. package/dist/src/utils/schemaValidator.test.d.ts +6 -0
  420. package/dist/src/utils/schemaValidator.test.js +146 -0
  421. package/dist/src/utils/schemaValidator.test.js.map +1 -0
  422. package/dist/src/utils/session.d.ts +6 -0
  423. package/dist/src/utils/session.js +8 -0
  424. package/dist/src/utils/session.js.map +1 -0
  425. package/dist/src/utils/summarizer.d.ts +25 -0
  426. package/dist/src/utils/summarizer.js +80 -0
  427. package/dist/src/utils/summarizer.js.map +1 -0
  428. package/dist/src/utils/summarizer.test.d.ts +6 -0
  429. package/dist/src/utils/summarizer.test.js +131 -0
  430. package/dist/src/utils/summarizer.test.js.map +1 -0
  431. package/dist/src/utils/testUtils.d.ts +29 -0
  432. package/dist/src/utils/testUtils.js +70 -0
  433. package/dist/src/utils/testUtils.js.map +1 -0
  434. package/dist/src/utils/user_account.d.ts +9 -0
  435. package/dist/src/utils/user_account.js +99 -0
  436. package/dist/src/utils/user_account.js.map +1 -0
  437. package/dist/src/utils/user_account.test.d.ts +6 -0
  438. package/dist/src/utils/user_account.test.js +153 -0
  439. package/dist/src/utils/user_account.test.js.map +1 -0
  440. package/dist/src/utils/user_id.d.ts +11 -0
  441. package/dist/src/utils/user_id.js +49 -0
  442. package/dist/src/utils/user_id.js.map +1 -0
  443. package/dist/src/utils/user_id.test.d.ts +6 -0
  444. package/dist/src/utils/user_id.test.js +21 -0
  445. package/dist/src/utils/user_id.test.js.map +1 -0
  446. package/dist/tsconfig.tsbuildinfo +1 -0
  447. package/dist/vybestack-llxprt-code-core-0.1.12.tgz +0 -0
  448. package/package.json +62 -0
@@ -0,0 +1,145 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import path from 'node:path';
7
+ import os from 'os';
8
+ import * as crypto from 'crypto';
9
+ import * as fs from 'fs';
10
+ export const LLXPRT_DIR = '.llxprt';
11
+ export const GOOGLE_ACCOUNTS_FILENAME = 'google_accounts.json';
12
+ const TMP_DIR_NAME = 'tmp';
13
+ export function ensureLlxprtDirExists() {
14
+ const homeDir = os.homedir();
15
+ const llxprtDir = path.join(homeDir, LLXPRT_DIR);
16
+ if (!fs.existsSync(llxprtDir)) {
17
+ fs.mkdirSync(llxprtDir, { recursive: true });
18
+ }
19
+ }
20
+ /**
21
+ * Replaces the home directory with a tilde.
22
+ * @param path - The path to tildeify.
23
+ * @returns The tildeified path.
24
+ */
25
+ export function tildeifyPath(path) {
26
+ const homeDir = os.homedir();
27
+ if (path.startsWith(homeDir)) {
28
+ return path.replace(homeDir, '~');
29
+ }
30
+ return path;
31
+ }
32
+ /**
33
+ * Shortens a path string if it exceeds maxLen, prioritizing the start and end segments.
34
+ * Example: /path/to/a/very/long/file.txt -> /path/.../long/file.txt
35
+ */
36
+ export function shortenPath(filePath, maxLen = 35) {
37
+ if (filePath.length <= maxLen) {
38
+ return filePath;
39
+ }
40
+ const parsedPath = path.parse(filePath);
41
+ const root = parsedPath.root;
42
+ const separator = path.sep;
43
+ // Get segments of the path *after* the root
44
+ const relativePath = filePath.substring(root.length);
45
+ const segments = relativePath.split(separator).filter((s) => s !== ''); // Filter out empty segments
46
+ // Handle cases with no segments after root (e.g., "/", "C:\") or only one segment
47
+ if (segments.length <= 1) {
48
+ // Fallback to simple start/end truncation for very short paths or single segments
49
+ const keepLen = Math.floor((maxLen - 3) / 2);
50
+ // Ensure keepLen is not negative if maxLen is very small
51
+ if (keepLen <= 0) {
52
+ return filePath.substring(0, maxLen - 3) + '...';
53
+ }
54
+ const start = filePath.substring(0, keepLen);
55
+ const end = filePath.substring(filePath.length - keepLen);
56
+ return `${start}...${end}`;
57
+ }
58
+ const firstDir = segments[0];
59
+ const lastSegment = segments[segments.length - 1];
60
+ const startComponent = root + firstDir;
61
+ const endPartSegments = [];
62
+ // Base length: separator + "..." + lastDir
63
+ let currentLength = separator.length + lastSegment.length;
64
+ // Iterate backwards through segments (excluding the first one)
65
+ for (let i = segments.length - 2; i >= 0; i--) {
66
+ const segment = segments[i];
67
+ // Length needed if we add this segment: current + separator + segment
68
+ const lengthWithSegment = currentLength + separator.length + segment.length;
69
+ if (lengthWithSegment <= maxLen) {
70
+ endPartSegments.unshift(segment); // Add to the beginning of the end part
71
+ currentLength = lengthWithSegment;
72
+ }
73
+ else {
74
+ break;
75
+ }
76
+ }
77
+ let result = endPartSegments.join(separator) + separator + lastSegment;
78
+ if (currentLength > maxLen) {
79
+ return result;
80
+ }
81
+ // Construct the final path
82
+ result = startComponent + separator + result;
83
+ // As a final check, if the result is somehow still too long
84
+ // truncate the result string from the beginning, prefixing with "...".
85
+ if (result.length > maxLen) {
86
+ return '...' + result.substring(result.length - maxLen - 3);
87
+ }
88
+ return result;
89
+ }
90
+ /**
91
+ * Calculates the relative path from a root directory to a target path.
92
+ * Ensures both paths are resolved before calculating.
93
+ * Returns '.' if the target path is the same as the root directory.
94
+ *
95
+ * @param targetPath The absolute or relative path to make relative.
96
+ * @param rootDirectory The absolute path of the directory to make the target path relative to.
97
+ * @returns The relative path from rootDirectory to targetPath.
98
+ */
99
+ export function makeRelative(targetPath, rootDirectory) {
100
+ const resolvedTargetPath = path.resolve(targetPath);
101
+ const resolvedRootDirectory = path.resolve(rootDirectory);
102
+ const relativePath = path.relative(resolvedRootDirectory, resolvedTargetPath);
103
+ // If the paths are the same, path.relative returns '', return '.' instead
104
+ return relativePath || '.';
105
+ }
106
+ /**
107
+ * Escapes spaces in a file path.
108
+ */
109
+ export function escapePath(filePath) {
110
+ let result = '';
111
+ for (let i = 0; i < filePath.length; i++) {
112
+ // Only escape spaces that are not already escaped.
113
+ if (filePath[i] === ' ' && (i === 0 || filePath[i - 1] !== '\\')) {
114
+ result += '\\ ';
115
+ }
116
+ else {
117
+ result += filePath[i];
118
+ }
119
+ }
120
+ return result;
121
+ }
122
+ /**
123
+ * Unescapes spaces in a file path.
124
+ */
125
+ export function unescapePath(filePath) {
126
+ return filePath.replace(/\\ /g, ' ');
127
+ }
128
+ /**
129
+ * Generates a unique hash for a project based on its root path.
130
+ * @param projectRoot The absolute path to the project's root directory.
131
+ * @returns A SHA256 hash of the project root path.
132
+ */
133
+ export function getProjectHash(projectRoot) {
134
+ return crypto.createHash('sha256').update(projectRoot).digest('hex');
135
+ }
136
+ /**
137
+ * Generates a unique temporary directory path for a project.
138
+ * @param projectRoot The absolute path to the project's root directory.
139
+ * @returns The path to the project's temporary directory.
140
+ */
141
+ export function getProjectTempDir(projectRoot) {
142
+ const hash = getProjectHash(projectRoot);
143
+ return path.join(os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AAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export interface ApiError {
7
+ error: {
8
+ code: number;
9
+ message: string;
10
+ status: string;
11
+ details: unknown[];
12
+ };
13
+ }
14
+ interface StructuredError {
15
+ message: string;
16
+ status?: number;
17
+ }
18
+ export declare function isApiError(error: unknown): error is ApiError;
19
+ export declare function isStructuredError(error: unknown): error is StructuredError;
20
+ export declare function isProQuotaExceededError(error: unknown): boolean;
21
+ export declare function isGenericQuotaExceededError(error: unknown): boolean;
22
+ export {};
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export function isApiError(error) {
7
+ return (typeof error === 'object' &&
8
+ error !== null &&
9
+ 'error' in error &&
10
+ typeof error.error === 'object' &&
11
+ 'message' in error.error);
12
+ }
13
+ export function isStructuredError(error) {
14
+ return (typeof error === 'object' &&
15
+ error !== null &&
16
+ 'message' in error &&
17
+ typeof error.message === 'string');
18
+ }
19
+ export function isProQuotaExceededError(error) {
20
+ // Check for Pro quota exceeded errors by looking for the specific pattern
21
+ // This will match patterns like:
22
+ // - "Quota exceeded for quota metric 'Gemini 2.5 Pro Requests'"
23
+ // - "Quota exceeded for quota metric 'Gemini 2.5-preview Pro Requests'"
24
+ // We use string methods instead of regex to avoid ReDoS vulnerabilities
25
+ const checkMessage = (message) => message.includes("Quota exceeded for quota metric 'Gemini") &&
26
+ message.includes("Pro Requests'");
27
+ if (typeof error === 'string') {
28
+ return checkMessage(error);
29
+ }
30
+ if (isStructuredError(error)) {
31
+ return checkMessage(error.message);
32
+ }
33
+ if (isApiError(error)) {
34
+ return checkMessage(error.error.message);
35
+ }
36
+ // Check if it's a Gaxios error with response data
37
+ if (error && typeof error === 'object' && 'response' in error) {
38
+ const gaxiosError = error;
39
+ if (gaxiosError.response && gaxiosError.response.data) {
40
+ console.log('[DEBUG] isProQuotaExceededError - checking response data:', gaxiosError.response.data);
41
+ if (typeof gaxiosError.response.data === 'string') {
42
+ return checkMessage(gaxiosError.response.data);
43
+ }
44
+ if (typeof gaxiosError.response.data === 'object' &&
45
+ gaxiosError.response.data !== null &&
46
+ 'error' in gaxiosError.response.data) {
47
+ const errorData = gaxiosError.response.data;
48
+ return checkMessage(errorData.error?.message || '');
49
+ }
50
+ }
51
+ }
52
+ console.log('[DEBUG] isProQuotaExceededError - no matching error format for:', error);
53
+ return false;
54
+ }
55
+ export function isGenericQuotaExceededError(error) {
56
+ if (typeof error === 'string') {
57
+ return error.includes('Quota exceeded for quota metric');
58
+ }
59
+ if (isStructuredError(error)) {
60
+ return error.message.includes('Quota exceeded for quota metric');
61
+ }
62
+ if (isApiError(error)) {
63
+ return error.error.message.includes('Quota exceeded for quota metric');
64
+ }
65
+ return false;
66
+ }
67
+ //# sourceMappingURL=quotaErrorDetection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotaErrorDetection.js","sourceRoot":"","sources":["../../../src/utils/quotaErrorDetection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgBH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAO,IAAI,KAAK;QAChB,OAAQ,KAAkB,CAAC,KAAK,KAAK,QAAQ;QAC7C,SAAS,IAAK,KAAkB,CAAC,KAAK,CACvC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,SAAS,IAAI,KAAK;QAClB,OAAQ,KAAyB,CAAC,OAAO,KAAK,QAAQ,CACvD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACpD,0EAA0E;IAC1E,iCAAiC;IACjC,gEAAgE;IA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Y,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CACT,iEAAiE,EACjE,KAAK,CACN,CAAC;IACF,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,KAAc;IACxD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export interface RetryOptions {
7
+ maxAttempts: number;
8
+ initialDelayMs: number;
9
+ maxDelayMs: number;
10
+ shouldRetry: (error: Error) => boolean;
11
+ onPersistent429?: (authType?: string, error?: unknown) => Promise<string | boolean | null>;
12
+ authType?: string;
13
+ }
14
+ /**
15
+ * Retries a function with exponential backoff and jitter.
16
+ * @param fn The asynchronous function to retry.
17
+ * @param options Optional retry configuration.
18
+ * @returns A promise that resolves with the result of the function if successful.
19
+ * @throws The last error encountered if all attempts fail.
20
+ */
21
+ export declare function retryWithBackoff<T>(fn: () => Promise<T>, options?: Partial<RetryOptions>): Promise<T>;
@@ -0,0 +1,276 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { AuthType } from '../core/contentGenerator.js';
7
+ import { isProQuotaExceededError, isGenericQuotaExceededError, } from './quotaErrorDetection.js';
8
+ const DEFAULT_RETRY_OPTIONS = {
9
+ maxAttempts: 5,
10
+ initialDelayMs: 5000,
11
+ maxDelayMs: 30000, // 30 seconds
12
+ shouldRetry: defaultShouldRetry,
13
+ };
14
+ /**
15
+ * Default predicate function to determine if a retry should be attempted.
16
+ * Retries on 429 (Too Many Requests) and 5xx server errors.
17
+ * @param error The error object.
18
+ * @returns True if the error is a transient error, false otherwise.
19
+ */
20
+ function defaultShouldRetry(error) {
21
+ // Check for common transient error status codes either in message or a status property
22
+ if (error && typeof error.status === 'number') {
23
+ const status = error.status;
24
+ if (status === 429 || (status >= 500 && status < 600)) {
25
+ return true;
26
+ }
27
+ }
28
+ if (error instanceof Error && error.message) {
29
+ if (error.message.includes('429'))
30
+ return true;
31
+ if (error.message.match(/5\d{2}/))
32
+ return true;
33
+ }
34
+ return false;
35
+ }
36
+ /**
37
+ * Delays execution for a specified number of milliseconds.
38
+ * @param ms The number of milliseconds to delay.
39
+ * @returns A promise that resolves after the delay.
40
+ */
41
+ function delay(ms) {
42
+ return new Promise((resolve) => setTimeout(resolve, ms));
43
+ }
44
+ /**
45
+ * Retries a function with exponential backoff and jitter.
46
+ * @param fn The asynchronous function to retry.
47
+ * @param options Optional retry configuration.
48
+ * @returns A promise that resolves with the result of the function if successful.
49
+ * @throws The last error encountered if all attempts fail.
50
+ */
51
+ export async function retryWithBackoff(fn, options) {
52
+ const { maxAttempts, initialDelayMs, maxDelayMs, onPersistent429, authType, shouldRetry, } = {
53
+ ...DEFAULT_RETRY_OPTIONS,
54
+ ...options,
55
+ };
56
+ let attempt = 0;
57
+ let currentDelay = initialDelayMs;
58
+ let consecutive429Count = 0;
59
+ while (attempt < maxAttempts) {
60
+ attempt++;
61
+ try {
62
+ return await fn();
63
+ }
64
+ catch (error) {
65
+ const errorStatus = getErrorStatus(error);
66
+ // Check for Pro quota exceeded error first - immediate fallback for OAuth users
67
+ if (errorStatus === 429 &&
68
+ authType === AuthType.LOGIN_WITH_GOOGLE &&
69
+ isProQuotaExceededError(error) &&
70
+ onPersistent429) {
71
+ try {
72
+ const fallbackModel = await onPersistent429(authType, error);
73
+ if (fallbackModel !== false && fallbackModel !== null) {
74
+ // Reset attempt counter and try with new model
75
+ attempt = 0;
76
+ consecutive429Count = 0;
77
+ currentDelay = initialDelayMs;
78
+ // With the model updated, we continue to the next attempt
79
+ continue;
80
+ }
81
+ else {
82
+ // Fallback handler returned null/false, meaning don't continue - stop retry process
83
+ throw error;
84
+ }
85
+ }
86
+ catch (fallbackError) {
87
+ // If fallback fails, continue with original error
88
+ console.warn('Fallback to Flash model failed:', fallbackError);
89
+ }
90
+ }
91
+ // Check for generic quota exceeded error (but not Pro, which was handled above) - immediate fallback for OAuth users
92
+ if (errorStatus === 429 &&
93
+ authType === AuthType.LOGIN_WITH_GOOGLE &&
94
+ !isProQuotaExceededError(error) &&
95
+ isGenericQuotaExceededError(error) &&
96
+ onPersistent429) {
97
+ try {
98
+ const fallbackModel = await onPersistent429(authType, error);
99
+ if (fallbackModel !== false && fallbackModel !== null) {
100
+ // Reset attempt counter and try with new model
101
+ attempt = 0;
102
+ consecutive429Count = 0;
103
+ currentDelay = initialDelayMs;
104
+ // With the model updated, we continue to the next attempt
105
+ continue;
106
+ }
107
+ else {
108
+ // Fallback handler returned null/false, meaning don't continue - stop retry process
109
+ throw error;
110
+ }
111
+ }
112
+ catch (fallbackError) {
113
+ // If fallback fails, continue with original error
114
+ console.warn('Fallback to Flash model failed:', fallbackError);
115
+ }
116
+ }
117
+ // Track consecutive 429 errors
118
+ if (errorStatus === 429) {
119
+ consecutive429Count++;
120
+ }
121
+ else {
122
+ consecutive429Count = 0;
123
+ }
124
+ // If we have persistent 429s and a fallback callback for OAuth
125
+ if (consecutive429Count >= 2 &&
126
+ onPersistent429 &&
127
+ authType === AuthType.LOGIN_WITH_GOOGLE) {
128
+ try {
129
+ const fallbackModel = await onPersistent429(authType, error);
130
+ if (fallbackModel !== false && fallbackModel !== null) {
131
+ // Reset attempt counter and try with new model
132
+ attempt = 0;
133
+ consecutive429Count = 0;
134
+ currentDelay = initialDelayMs;
135
+ // With the model updated, we continue to the next attempt
136
+ continue;
137
+ }
138
+ else {
139
+ // Fallback handler returned null/false, meaning don't continue - stop retry process
140
+ throw error;
141
+ }
142
+ }
143
+ catch (fallbackError) {
144
+ // If fallback fails, continue with original error
145
+ console.warn('Fallback to Flash model failed:', fallbackError);
146
+ }
147
+ }
148
+ // Check if we've exhausted retries or shouldn't retry
149
+ if (attempt >= maxAttempts || !shouldRetry(error)) {
150
+ throw error;
151
+ }
152
+ const { delayDurationMs, errorStatus: delayErrorStatus } = getDelayDurationAndStatus(error);
153
+ if (delayDurationMs > 0) {
154
+ // Respect Retry-After header if present and parsed
155
+ console.warn(`Attempt ${attempt} failed with status ${delayErrorStatus ?? 'unknown'}. Retrying after explicit delay of ${delayDurationMs}ms...`, error);
156
+ await delay(delayDurationMs);
157
+ // Reset currentDelay for next potential non-429 error, or if Retry-After is not present next time
158
+ currentDelay = initialDelayMs;
159
+ }
160
+ else {
161
+ // Fallback to exponential backoff with jitter
162
+ logRetryAttempt(attempt, error, errorStatus);
163
+ // Add jitter: +/- 30% of currentDelay
164
+ const jitter = currentDelay * 0.3 * (Math.random() * 2 - 1);
165
+ const delayWithJitter = Math.max(0, currentDelay + jitter);
166
+ await delay(delayWithJitter);
167
+ currentDelay = Math.min(maxDelayMs, currentDelay * 2);
168
+ }
169
+ }
170
+ }
171
+ // This line should theoretically be unreachable due to the throw in the catch block.
172
+ // Added for type safety and to satisfy the compiler that a promise is always returned.
173
+ throw new Error('Retry attempts exhausted');
174
+ }
175
+ /**
176
+ * Extracts the HTTP status code from an error object.
177
+ * @param error The error object.
178
+ * @returns The HTTP status code, or undefined if not found.
179
+ */
180
+ function getErrorStatus(error) {
181
+ if (typeof error === 'object' && error !== null) {
182
+ if ('status' in error && typeof error.status === 'number') {
183
+ return error.status;
184
+ }
185
+ // Check for error.response.status (common in axios errors)
186
+ if ('response' in error &&
187
+ typeof error.response === 'object' &&
188
+ error.response !== null) {
189
+ const response = error.response;
190
+ if ('status' in response && typeof response.status === 'number') {
191
+ return response.status;
192
+ }
193
+ }
194
+ }
195
+ return undefined;
196
+ }
197
+ /**
198
+ * Extracts the Retry-After delay from an error object's headers.
199
+ * @param error The error object.
200
+ * @returns The delay in milliseconds, or 0 if not found or invalid.
201
+ */
202
+ function getRetryAfterDelayMs(error) {
203
+ if (typeof error === 'object' && error !== null) {
204
+ // Check for error.response.headers (common in axios errors)
205
+ if ('response' in error &&
206
+ typeof error.response === 'object' &&
207
+ error.response !== null) {
208
+ const response = error.response;
209
+ if ('headers' in response &&
210
+ typeof response.headers === 'object' &&
211
+ response.headers !== null) {
212
+ const headers = response.headers;
213
+ const retryAfterHeader = headers['retry-after'];
214
+ if (typeof retryAfterHeader === 'string') {
215
+ const retryAfterSeconds = parseInt(retryAfterHeader, 10);
216
+ if (!isNaN(retryAfterSeconds)) {
217
+ return retryAfterSeconds * 1000;
218
+ }
219
+ // It might be an HTTP date
220
+ const retryAfterDate = new Date(retryAfterHeader);
221
+ if (!isNaN(retryAfterDate.getTime())) {
222
+ return Math.max(0, retryAfterDate.getTime() - Date.now());
223
+ }
224
+ }
225
+ }
226
+ }
227
+ }
228
+ return 0;
229
+ }
230
+ /**
231
+ * Determines the delay duration based on the error, prioritizing Retry-After header.
232
+ * @param error The error object.
233
+ * @returns An object containing the delay duration in milliseconds and the error status.
234
+ */
235
+ function getDelayDurationAndStatus(error) {
236
+ const errorStatus = getErrorStatus(error);
237
+ let delayDurationMs = 0;
238
+ if (errorStatus === 429) {
239
+ delayDurationMs = getRetryAfterDelayMs(error);
240
+ }
241
+ return { delayDurationMs, errorStatus };
242
+ }
243
+ /**
244
+ * Logs a message for a retry attempt when using exponential backoff.
245
+ * @param attempt The current attempt number.
246
+ * @param error The error that caused the retry.
247
+ * @param errorStatus The HTTP status code of the error, if available.
248
+ */
249
+ function logRetryAttempt(attempt, error, errorStatus) {
250
+ let message = `Attempt ${attempt} failed. Retrying with backoff...`;
251
+ if (errorStatus) {
252
+ message = `Attempt ${attempt} failed with status ${errorStatus}. Retrying with backoff...`;
253
+ }
254
+ if (errorStatus === 429) {
255
+ console.warn(message, error);
256
+ }
257
+ else if (errorStatus && errorStatus >= 500 && errorStatus < 600) {
258
+ console.error(message, error);
259
+ }
260
+ else if (error instanceof Error) {
261
+ // Fallback for errors that might not have a status but have a message
262
+ if (error.message.includes('429')) {
263
+ console.warn(`Attempt ${attempt} failed with 429 error (no Retry-After header). Retrying with backoff...`, error);
264
+ }
265
+ else if (error.message.match(/5\d{2}/)) {
266
+ console.error(`Attempt ${attempt} failed with 5xx error. Retrying with backoff...`, error);
267
+ }
268
+ else {
269
+ console.warn(message, error); // Default to warn for other errors
270
+ }
271
+ }
272
+ else {
273
+ console.warn(message, error); // Default to warn if error type is unknown
274
+ }
275
+ }
276
+ //# sourceMappingURL=retry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.js","sourceRoot":"","sources":["../../../src/utils/retry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAclC,MAAM,qBAAqB,GAAiB;IAC1C,WAAW,EAAE,CAAC;IACd,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,KAAK,EAAE,aAAa;IAChC,WAAW,EAAE,kBAAkB;CAChC,CAAC;AAEF;;;;;GAKG;AACH,SAAS,kBAAkB,CAAC,KAAsB;IAChD,uFAAuF;IACvF,IAAI,KAAK,IAAI,OAAQ,KAA6B,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QACvE,MAAM,MAAM,GAAI,KAA4B,CAAC,MAAM,CAAC;QACpD,IAAI,MAAM,KAAK,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