mpd-llm-cli 0.1.24 → 0.1.25

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 (468) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +203 -0
  3. package/README.zh-CN.md +206 -0
  4. package/bundle/api.cjs +166773 -0
  5. package/bundle/api.js +166768 -0
  6. package/bundle/gemini.js +281183 -0
  7. package/package.json +79 -66
  8. package/dist/.last_build +0 -0
  9. package/dist/index.d.ts +0 -7
  10. package/dist/index.js +0 -20
  11. package/dist/index.js.map +0 -1
  12. package/dist/package.json +0 -83
  13. package/dist/src/api/index.d.ts +0 -17
  14. package/dist/src/api/index.js +0 -192
  15. package/dist/src/api/index.js.map +0 -1
  16. package/dist/src/api/types.d.ts +0 -32
  17. package/dist/src/api/types.js +0 -2
  18. package/dist/src/api/types.js.map +0 -1
  19. package/dist/src/api/util.d.ts +0 -4
  20. package/dist/src/api/util.js +0 -67
  21. package/dist/src/api/util.js.map +0 -1
  22. package/dist/src/config/auth.d.ts +0 -6
  23. package/dist/src/config/auth.js +0 -42
  24. package/dist/src/config/auth.js.map +0 -1
  25. package/dist/src/config/config.d.ts +0 -13
  26. package/dist/src/config/config.js +0 -248
  27. package/dist/src/config/config.js.map +0 -1
  28. package/dist/src/config/extension.d.ts +0 -21
  29. package/dist/src/config/extension.js +0 -109
  30. package/dist/src/config/extension.js.map +0 -1
  31. package/dist/src/config/mpdaiConfig.d.ts +0 -28
  32. package/dist/src/config/mpdaiConfig.js +0 -84
  33. package/dist/src/config/mpdaiConfig.js.map +0 -1
  34. package/dist/src/config/sandboxConfig.d.ts +0 -13
  35. package/dist/src/config/sandboxConfig.js +0 -75
  36. package/dist/src/config/sandboxConfig.js.map +0 -1
  37. package/dist/src/config/settings.d.ts +0 -72
  38. package/dist/src/config/settings.js +0 -227
  39. package/dist/src/config/settings.js.map +0 -1
  40. package/dist/src/config/startup.d.ts +0 -21
  41. package/dist/src/config/startup.js +0 -118
  42. package/dist/src/config/startup.js.map +0 -1
  43. package/dist/src/gemini.d.ts +0 -6
  44. package/dist/src/gemini.js +0 -300
  45. package/dist/src/gemini.js.map +0 -1
  46. package/dist/src/generated/git-commit.d.ts +0 -6
  47. package/dist/src/generated/git-commit.js +0 -9
  48. package/dist/src/generated/git-commit.js.map +0 -1
  49. package/dist/src/nonInteractiveCli.d.ts +0 -7
  50. package/dist/src/nonInteractiveCli.js +0 -115
  51. package/dist/src/nonInteractiveCli.js.map +0 -1
  52. package/dist/src/services/AuthService.d.ts +0 -110
  53. package/dist/src/services/AuthService.js +0 -258
  54. package/dist/src/services/AuthService.js.map +0 -1
  55. package/dist/src/services/CommandService.d.ts +0 -13
  56. package/dist/src/services/CommandService.js +0 -34
  57. package/dist/src/services/CommandService.js.map +0 -1
  58. package/dist/src/services/EnvConfigManager.d.ts +0 -34
  59. package/dist/src/services/EnvConfigManager.js +0 -141
  60. package/dist/src/services/EnvConfigManager.js.map +0 -1
  61. package/dist/src/services/README.md +0 -114
  62. package/dist/src/services/debug-auth.d.ts +0 -10
  63. package/dist/src/services/debug-auth.js +0 -104
  64. package/dist/src/services/debug-auth.js.map +0 -1
  65. package/dist/src/services/demo.d.ts +0 -10
  66. package/dist/src/services/demo.js +0 -96
  67. package/dist/src/services/demo.js.map +0 -1
  68. package/dist/src/services/test-auth.d.ts +0 -10
  69. package/dist/src/services/test-auth.js +0 -104
  70. package/dist/src/services/test-auth.js.map +0 -1
  71. package/dist/src/services/test-readline.d.ts +0 -6
  72. package/dist/src/services/test-readline.js +0 -32
  73. package/dist/src/services/test-readline.js.map +0 -1
  74. package/dist/src/telemetry/README.md +0 -135
  75. package/dist/src/telemetry/costCalculator.d.ts +0 -401
  76. package/dist/src/telemetry/costCalculator.js +0 -555
  77. package/dist/src/telemetry/costCalculator.js.map +0 -1
  78. package/dist/src/telemetry/dataCollector.d.ts +0 -83
  79. package/dist/src/telemetry/dataCollector.js +0 -392
  80. package/dist/src/telemetry/dataCollector.js.map +0 -1
  81. package/dist/src/telemetry/langfuseClient.d.ts +0 -96
  82. package/dist/src/telemetry/langfuseClient.js +0 -485
  83. package/dist/src/telemetry/langfuseClient.js.map +0 -1
  84. package/dist/src/telemetry/langfuseConfig.d.ts +0 -21
  85. package/dist/src/telemetry/langfuseConfig.js +0 -64
  86. package/dist/src/telemetry/langfuseConfig.js.map +0 -1
  87. package/dist/src/telemetry/langfuseIntegration.d.ts +0 -66
  88. package/dist/src/telemetry/langfuseIntegration.js +0 -238
  89. package/dist/src/telemetry/langfuseIntegration.js.map +0 -1
  90. package/dist/src/telemetry/toolExecutionInterceptor.d.ts +0 -29
  91. package/dist/src/telemetry/toolExecutionInterceptor.js +0 -122
  92. package/dist/src/telemetry/toolExecutionInterceptor.js.map +0 -1
  93. package/dist/src/ui/App.d.ts +0 -14
  94. package/dist/src/ui/App.js +0 -466
  95. package/dist/src/ui/App.js.map +0 -1
  96. package/dist/src/ui/colors.d.ts +0 -7
  97. package/dist/src/ui/colors.js +0 -48
  98. package/dist/src/ui/colors.js.map +0 -1
  99. package/dist/src/ui/commands/clearCommand.d.ts +0 -7
  100. package/dist/src/ui/commands/clearCommand.js +0 -15
  101. package/dist/src/ui/commands/clearCommand.js.map +0 -1
  102. package/dist/src/ui/commands/helpCommand.d.ts +0 -7
  103. package/dist/src/ui/commands/helpCommand.js +0 -18
  104. package/dist/src/ui/commands/helpCommand.js.map +0 -1
  105. package/dist/src/ui/commands/logoutCommand.d.ts +0 -7
  106. package/dist/src/ui/commands/logoutCommand.js +0 -77
  107. package/dist/src/ui/commands/logoutCommand.js.map +0 -1
  108. package/dist/src/ui/commands/memoryCommand.d.ts +0 -7
  109. package/dist/src/ui/commands/memoryCommand.js +0 -81
  110. package/dist/src/ui/commands/memoryCommand.js.map +0 -1
  111. package/dist/src/ui/commands/modelCommand.d.ts +0 -14
  112. package/dist/src/ui/commands/modelCommand.js +0 -58
  113. package/dist/src/ui/commands/modelCommand.js.map +0 -1
  114. package/dist/src/ui/commands/types.d.ts +0 -63
  115. package/dist/src/ui/commands/types.js +0 -7
  116. package/dist/src/ui/commands/types.js.map +0 -1
  117. package/dist/src/ui/components/AboutBox.d.ts +0 -16
  118. package/dist/src/ui/components/AboutBox.js +0 -6
  119. package/dist/src/ui/components/AboutBox.js.map +0 -1
  120. package/dist/src/ui/components/AsciiArt.d.ts +0 -7
  121. package/dist/src/ui/components/AsciiArt.js +0 -25
  122. package/dist/src/ui/components/AsciiArt.js.map +0 -1
  123. package/dist/src/ui/components/AuthDialog.d.ts +0 -15
  124. package/dist/src/ui/components/AuthDialog.js +0 -75
  125. package/dist/src/ui/components/AuthDialog.js.map +0 -1
  126. package/dist/src/ui/components/AuthInProgress.d.ts +0 -11
  127. package/dist/src/ui/components/AuthInProgress.js +0 -27
  128. package/dist/src/ui/components/AuthInProgress.js.map +0 -1
  129. package/dist/src/ui/components/AutoAcceptIndicator.d.ts +0 -12
  130. package/dist/src/ui/components/AutoAcceptIndicator.js +0 -26
  131. package/dist/src/ui/components/AutoAcceptIndicator.js.map +0 -1
  132. package/dist/src/ui/components/ConsolePatcher.d.ts +0 -12
  133. package/dist/src/ui/components/ConsolePatcher.js +0 -38
  134. package/dist/src/ui/components/ConsolePatcher.js.map +0 -1
  135. package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +0 -11
  136. package/dist/src/ui/components/ConsoleSummaryDisplay.js +0 -11
  137. package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +0 -1
  138. package/dist/src/ui/components/ContextSummaryDisplay.d.ts +0 -15
  139. package/dist/src/ui/components/ContextSummaryDisplay.js +0 -41
  140. package/dist/src/ui/components/ContextSummaryDisplay.js.map +0 -1
  141. package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +0 -14
  142. package/dist/src/ui/components/DetailedMessagesDisplay.js +0 -34
  143. package/dist/src/ui/components/DetailedMessagesDisplay.js.map +0 -1
  144. package/dist/src/ui/components/EditorSettingsDialog.d.ts +0 -15
  145. package/dist/src/ui/components/EditorSettingsDialog.js +0 -73
  146. package/dist/src/ui/components/EditorSettingsDialog.js.map +0 -1
  147. package/dist/src/ui/components/Footer.d.ts +0 -20
  148. package/dist/src/ui/components/Footer.js +0 -19
  149. package/dist/src/ui/components/Footer.js.map +0 -1
  150. package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +0 -17
  151. package/dist/src/ui/components/GeminiRespondingSpinner.js +0 -16
  152. package/dist/src/ui/components/GeminiRespondingSpinner.js.map +0 -1
  153. package/dist/src/ui/components/Header.d.ts +0 -12
  154. package/dist/src/ui/components/Header.js +0 -20
  155. package/dist/src/ui/components/Header.js.map +0 -1
  156. package/dist/src/ui/components/Help.d.ts +0 -12
  157. package/dist/src/ui/components/Help.js +0 -10
  158. package/dist/src/ui/components/Help.js.map +0 -1
  159. package/dist/src/ui/components/HistoryItemDisplay.d.ts +0 -18
  160. package/dist/src/ui/components/HistoryItemDisplay.js +0 -17
  161. package/dist/src/ui/components/HistoryItemDisplay.js.map +0 -1
  162. package/dist/src/ui/components/InputPrompt.d.ts +0 -25
  163. package/dist/src/ui/components/InputPrompt.js +0 -280
  164. package/dist/src/ui/components/InputPrompt.js.map +0 -1
  165. package/dist/src/ui/components/LoadingIndicator.d.ts +0 -15
  166. package/dist/src/ui/components/LoadingIndicator.js +0 -20
  167. package/dist/src/ui/components/LoadingIndicator.js.map +0 -1
  168. package/dist/src/ui/components/MemoryUsageDisplay.d.ts +0 -7
  169. package/dist/src/ui/components/MemoryUsageDisplay.js +0 -27
  170. package/dist/src/ui/components/MemoryUsageDisplay.js.map +0 -1
  171. package/dist/src/ui/components/ModelDialog.d.ts +0 -14
  172. package/dist/src/ui/components/ModelDialog.js +0 -34
  173. package/dist/src/ui/components/ModelDialog.js.map +0 -1
  174. package/dist/src/ui/components/ModelStatsDisplay.d.ts +0 -7
  175. package/dist/src/ui/components/ModelStatsDisplay.js +0 -33
  176. package/dist/src/ui/components/ModelStatsDisplay.js.map +0 -1
  177. package/dist/src/ui/components/SessionSummaryDisplay.d.ts +0 -11
  178. package/dist/src/ui/components/SessionSummaryDisplay.js +0 -4
  179. package/dist/src/ui/components/SessionSummaryDisplay.js.map +0 -1
  180. package/dist/src/ui/components/ShellModeIndicator.d.ts +0 -7
  181. package/dist/src/ui/components/ShellModeIndicator.js +0 -5
  182. package/dist/src/ui/components/ShellModeIndicator.js.map +0 -1
  183. package/dist/src/ui/components/ShowMoreLines.d.ts +0 -10
  184. package/dist/src/ui/components/ShowMoreLines.js +0 -24
  185. package/dist/src/ui/components/ShowMoreLines.js.map +0 -1
  186. package/dist/src/ui/components/StatsDisplay.d.ts +0 -12
  187. package/dist/src/ui/components/StatsDisplay.js +0 -42
  188. package/dist/src/ui/components/StatsDisplay.js.map +0 -1
  189. package/dist/src/ui/components/SuggestionsDisplay.d.ts +0 -21
  190. package/dist/src/ui/components/SuggestionsDisplay.js +0 -32
  191. package/dist/src/ui/components/SuggestionsDisplay.js.map +0 -1
  192. package/dist/src/ui/components/ThemeDialog.d.ts +0 -19
  193. package/dist/src/ui/components/ThemeDialog.js +0 -126
  194. package/dist/src/ui/components/ThemeDialog.js.map +0 -1
  195. package/dist/src/ui/components/Tips.d.ts +0 -12
  196. package/dist/src/ui/components/Tips.js +0 -8
  197. package/dist/src/ui/components/Tips.js.map +0 -1
  198. package/dist/src/ui/components/ToolStatsDisplay.d.ts +0 -7
  199. package/dist/src/ui/components/ToolStatsDisplay.js +0 -41
  200. package/dist/src/ui/components/ToolStatsDisplay.js.map +0 -1
  201. package/dist/src/ui/components/UpdateNotification.d.ts +0 -10
  202. package/dist/src/ui/components/UpdateNotification.js +0 -10
  203. package/dist/src/ui/components/UpdateNotification.js.map +0 -1
  204. package/dist/src/ui/components/messages/CompressionMessage.d.ts +0 -11
  205. package/dist/src/ui/components/messages/CompressionMessage.js +0 -16
  206. package/dist/src/ui/components/messages/CompressionMessage.js.map +0 -1
  207. package/dist/src/ui/components/messages/DiffRenderer.d.ts +0 -15
  208. package/dist/src/ui/components/messages/DiffRenderer.js +0 -212
  209. package/dist/src/ui/components/messages/DiffRenderer.js.map +0 -1
  210. package/dist/src/ui/components/messages/ErrorMessage.d.ts +0 -11
  211. package/dist/src/ui/components/messages/ErrorMessage.js +0 -9
  212. package/dist/src/ui/components/messages/ErrorMessage.js.map +0 -1
  213. package/dist/src/ui/components/messages/GeminiMessage.d.ts +0 -14
  214. package/dist/src/ui/components/messages/GeminiMessage.js +0 -10
  215. package/dist/src/ui/components/messages/GeminiMessage.js.map +0 -1
  216. package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +0 -14
  217. package/dist/src/ui/components/messages/GeminiMessageContent.js +0 -15
  218. package/dist/src/ui/components/messages/GeminiMessageContent.js.map +0 -1
  219. package/dist/src/ui/components/messages/InfoMessage.d.ts +0 -11
  220. package/dist/src/ui/components/messages/InfoMessage.js +0 -9
  221. package/dist/src/ui/components/messages/InfoMessage.js.map +0 -1
  222. package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +0 -18
  223. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +0 -307
  224. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +0 -1
  225. package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +0 -18
  226. package/dist/src/ui/components/messages/ToolGroupMessage.js +0 -53
  227. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +0 -1
  228. package/dist/src/ui/components/messages/ToolMessage.d.ts +0 -15
  229. package/dist/src/ui/components/messages/ToolMessage.js +0 -61
  230. package/dist/src/ui/components/messages/ToolMessage.js.map +0 -1
  231. package/dist/src/ui/components/messages/UserMessage.d.ts +0 -11
  232. package/dist/src/ui/components/messages/UserMessage.js +0 -9
  233. package/dist/src/ui/components/messages/UserMessage.js.map +0 -1
  234. package/dist/src/ui/components/messages/UserShellMessage.d.ts +0 -11
  235. package/dist/src/ui/components/messages/UserShellMessage.js +0 -9
  236. package/dist/src/ui/components/messages/UserShellMessage.js.map +0 -1
  237. package/dist/src/ui/components/shared/MaxSizedBox.d.ts +0 -61
  238. package/dist/src/ui/components/shared/MaxSizedBox.js +0 -384
  239. package/dist/src/ui/components/shared/MaxSizedBox.js.map +0 -1
  240. package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +0 -41
  241. package/dist/src/ui/components/shared/RadioButtonSelect.js +0 -52
  242. package/dist/src/ui/components/shared/RadioButtonSelect.js.map +0 -1
  243. package/dist/src/ui/components/shared/text-buffer.d.ts +0 -184
  244. package/dist/src/ui/components/shared/text-buffer.js +0 -1010
  245. package/dist/src/ui/components/shared/text-buffer.js.map +0 -1
  246. package/dist/src/ui/constants.d.ts +0 -8
  247. package/dist/src/ui/constants.js +0 -12
  248. package/dist/src/ui/constants.js.map +0 -1
  249. package/dist/src/ui/contexts/OverflowContext.d.ts +0 -19
  250. package/dist/src/ui/contexts/OverflowContext.js +0 -43
  251. package/dist/src/ui/contexts/OverflowContext.js.map +0 -1
  252. package/dist/src/ui/contexts/SessionContext.d.ts +0 -33
  253. package/dist/src/ui/contexts/SessionContext.js +0 -49
  254. package/dist/src/ui/contexts/SessionContext.js.map +0 -1
  255. package/dist/src/ui/contexts/StreamingContext.d.ts +0 -9
  256. package/dist/src/ui/contexts/StreamingContext.js +0 -15
  257. package/dist/src/ui/contexts/StreamingContext.js.map +0 -1
  258. package/dist/src/ui/editors/editorSettingsManager.d.ts +0 -19
  259. package/dist/src/ui/editors/editorSettingsManager.js +0 -54
  260. package/dist/src/ui/editors/editorSettingsManager.js.map +0 -1
  261. package/dist/src/ui/hooks/atCommandProcessor.d.ts +0 -31
  262. package/dist/src/ui/hooks/atCommandProcessor.js +0 -310
  263. package/dist/src/ui/hooks/atCommandProcessor.js.map +0 -1
  264. package/dist/src/ui/hooks/shellCommandProcessor.d.ts +0 -16
  265. package/dist/src/ui/hooks/shellCommandProcessor.js +0 -261
  266. package/dist/src/ui/hooks/shellCommandProcessor.js.map +0 -1
  267. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +0 -27
  268. package/dist/src/ui/hooks/slashCommandProcessor.js +0 -1129
  269. package/dist/src/ui/hooks/slashCommandProcessor.js.map +0 -1
  270. package/dist/src/ui/hooks/useAuthCommand.d.ts +0 -14
  271. package/dist/src/ui/hooks/useAuthCommand.js +0 -63
  272. package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
  273. package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +0 -10
  274. package/dist/src/ui/hooks/useAutoAcceptIndicator.js +0 -37
  275. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +0 -1
  276. package/dist/src/ui/hooks/useBracketedPaste.d.ts +0 -12
  277. package/dist/src/ui/hooks/useBracketedPaste.js +0 -32
  278. package/dist/src/ui/hooks/useBracketedPaste.js.map +0 -1
  279. package/dist/src/ui/hooks/useCompletion.d.ts +0 -21
  280. package/dist/src/ui/hooks/useCompletion.js +0 -372
  281. package/dist/src/ui/hooks/useCompletion.js.map +0 -1
  282. package/dist/src/ui/hooks/useConsoleMessages.d.ts +0 -12
  283. package/dist/src/ui/hooks/useConsoleMessages.js +0 -60
  284. package/dist/src/ui/hooks/useConsoleMessages.js.map +0 -1
  285. package/dist/src/ui/hooks/useEditorSettings.d.ts +0 -16
  286. package/dist/src/ui/hooks/useEditorSettings.js +0 -43
  287. package/dist/src/ui/hooks/useEditorSettings.js.map +0 -1
  288. package/dist/src/ui/hooks/useGeminiStream.d.ts +0 -23
  289. package/dist/src/ui/hooks/useGeminiStream.js +0 -603
  290. package/dist/src/ui/hooks/useGeminiStream.js.map +0 -1
  291. package/dist/src/ui/hooks/useGitBranchName.d.ts +0 -6
  292. package/dist/src/ui/hooks/useGitBranchName.js +0 -61
  293. package/dist/src/ui/hooks/useGitBranchName.js.map +0 -1
  294. package/dist/src/ui/hooks/useHistoryManager.d.ts +0 -22
  295. package/dist/src/ui/hooks/useHistoryManager.js +0 -72
  296. package/dist/src/ui/hooks/useHistoryManager.js.map +0 -1
  297. package/dist/src/ui/hooks/useInputHistory.d.ts +0 -19
  298. package/dist/src/ui/hooks/useInputHistory.js +0 -84
  299. package/dist/src/ui/hooks/useInputHistory.js.map +0 -1
  300. package/dist/src/ui/hooks/useKeypress.d.ts +0 -29
  301. package/dist/src/ui/hooks/useKeypress.js +0 -86
  302. package/dist/src/ui/hooks/useKeypress.js.map +0 -1
  303. package/dist/src/ui/hooks/useLoadingIndicator.d.ts +0 -10
  304. package/dist/src/ui/hooks/useLoadingIndicator.js +0 -44
  305. package/dist/src/ui/hooks/useLoadingIndicator.js.map +0 -1
  306. package/dist/src/ui/hooks/useLogger.d.ts +0 -10
  307. package/dist/src/ui/hooks/useLogger.js +0 -29
  308. package/dist/src/ui/hooks/useLogger.js.map +0 -1
  309. package/dist/src/ui/hooks/usePhraseCycler.d.ts +0 -14
  310. package/dist/src/ui/hooks/usePhraseCycler.js +0 -189
  311. package/dist/src/ui/hooks/usePhraseCycler.js.map +0 -1
  312. package/dist/src/ui/hooks/usePrivacySettings.d.ts +0 -16
  313. package/dist/src/ui/hooks/usePrivacySettings.js +0 -115
  314. package/dist/src/ui/hooks/usePrivacySettings.js.map +0 -1
  315. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +0 -33
  316. package/dist/src/ui/hooks/useReactToolScheduler.js +0 -186
  317. package/dist/src/ui/hooks/useReactToolScheduler.js.map +0 -1
  318. package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +0 -6
  319. package/dist/src/ui/hooks/useRefreshMemoryCommand.js +0 -7
  320. package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +0 -1
  321. package/dist/src/ui/hooks/useShellHistory.d.ts +0 -11
  322. package/dist/src/ui/hooks/useShellHistory.js +0 -89
  323. package/dist/src/ui/hooks/useShellHistory.js.map +0 -1
  324. package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +0 -9
  325. package/dist/src/ui/hooks/useShowMemoryCommand.js +0 -58
  326. package/dist/src/ui/hooks/useShowMemoryCommand.js.map +0 -1
  327. package/dist/src/ui/hooks/useStateAndRef.d.ts +0 -7
  328. package/dist/src/ui/hooks/useStateAndRef.js +0 -26
  329. package/dist/src/ui/hooks/useStateAndRef.js.map +0 -1
  330. package/dist/src/ui/hooks/useTerminalSize.d.ts +0 -9
  331. package/dist/src/ui/hooks/useTerminalSize.js +0 -27
  332. package/dist/src/ui/hooks/useTerminalSize.js.map +0 -1
  333. package/dist/src/ui/hooks/useThemeCommand.d.ts +0 -15
  334. package/dist/src/ui/hooks/useThemeCommand.js +0 -78
  335. package/dist/src/ui/hooks/useThemeCommand.js.map +0 -1
  336. package/dist/src/ui/hooks/useTimer.d.ts +0 -12
  337. package/dist/src/ui/hooks/useTimer.js +0 -58
  338. package/dist/src/ui/hooks/useTimer.js.map +0 -1
  339. package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +0 -12
  340. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +0 -40
  341. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +0 -1
  342. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +0 -10
  343. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +0 -17
  344. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +0 -1
  345. package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +0 -10
  346. package/dist/src/ui/privacy/GeminiPrivacyNotice.js +0 -17
  347. package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +0 -1
  348. package/dist/src/ui/privacy/PrivacyNotice.d.ts +0 -12
  349. package/dist/src/ui/privacy/PrivacyNotice.js +0 -25
  350. package/dist/src/ui/privacy/PrivacyNotice.js.map +0 -1
  351. package/dist/src/ui/themes/ansi-light.d.ts +0 -7
  352. package/dist/src/ui/themes/ansi-light.js +0 -139
  353. package/dist/src/ui/themes/ansi-light.js.map +0 -1
  354. package/dist/src/ui/themes/ansi.d.ts +0 -7
  355. package/dist/src/ui/themes/ansi.js +0 -149
  356. package/dist/src/ui/themes/ansi.js.map +0 -1
  357. package/dist/src/ui/themes/atom-one-dark.d.ts +0 -7
  358. package/dist/src/ui/themes/atom-one-dark.js +0 -136
  359. package/dist/src/ui/themes/atom-one-dark.js.map +0 -1
  360. package/dist/src/ui/themes/ayu-light.d.ts +0 -7
  361. package/dist/src/ui/themes/ayu-light.js +0 -128
  362. package/dist/src/ui/themes/ayu-light.js.map +0 -1
  363. package/dist/src/ui/themes/ayu.d.ts +0 -7
  364. package/dist/src/ui/themes/ayu.js +0 -102
  365. package/dist/src/ui/themes/ayu.js.map +0 -1
  366. package/dist/src/ui/themes/default-light.d.ts +0 -7
  367. package/dist/src/ui/themes/default-light.js +0 -100
  368. package/dist/src/ui/themes/default-light.js.map +0 -1
  369. package/dist/src/ui/themes/default.d.ts +0 -7
  370. package/dist/src/ui/themes/default.js +0 -143
  371. package/dist/src/ui/themes/default.js.map +0 -1
  372. package/dist/src/ui/themes/dracula.d.ts +0 -7
  373. package/dist/src/ui/themes/dracula.js +0 -113
  374. package/dist/src/ui/themes/dracula.js.map +0 -1
  375. package/dist/src/ui/themes/github-dark.d.ts +0 -7
  376. package/dist/src/ui/themes/github-dark.js +0 -136
  377. package/dist/src/ui/themes/github-dark.js.map +0 -1
  378. package/dist/src/ui/themes/github-light.d.ts +0 -7
  379. package/dist/src/ui/themes/github-light.js +0 -138
  380. package/dist/src/ui/themes/github-light.js.map +0 -1
  381. package/dist/src/ui/themes/googlecode.d.ts +0 -7
  382. package/dist/src/ui/themes/googlecode.js +0 -135
  383. package/dist/src/ui/themes/googlecode.js.map +0 -1
  384. package/dist/src/ui/themes/no-color.d.ts +0 -7
  385. package/dist/src/ui/themes/no-color.js +0 -84
  386. package/dist/src/ui/themes/no-color.js.map +0 -1
  387. package/dist/src/ui/themes/shades-of-purple.d.ts +0 -11
  388. package/dist/src/ui/themes/shades-of-purple.js +0 -302
  389. package/dist/src/ui/themes/shades-of-purple.js.map +0 -1
  390. package/dist/src/ui/themes/theme-manager.d.ts +0 -33
  391. package/dist/src/ui/themes/theme-manager.js +0 -109
  392. package/dist/src/ui/themes/theme-manager.js.map +0 -1
  393. package/dist/src/ui/themes/theme.d.ts +0 -67
  394. package/dist/src/ui/themes/theme.js +0 -304
  395. package/dist/src/ui/themes/theme.js.map +0 -1
  396. package/dist/src/ui/themes/xcode.d.ts +0 -7
  397. package/dist/src/ui/themes/xcode.js +0 -143
  398. package/dist/src/ui/themes/xcode.js.map +0 -1
  399. package/dist/src/ui/types.d.ts +0 -172
  400. package/dist/src/ui/types.js +0 -43
  401. package/dist/src/ui/types.js.map +0 -1
  402. package/dist/src/ui/utils/CodeColorizer.d.ts +0 -14
  403. package/dist/src/ui/utils/CodeColorizer.js +0 -97
  404. package/dist/src/ui/utils/CodeColorizer.js.map +0 -1
  405. package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +0 -16
  406. package/dist/src/ui/utils/InlineMarkdownRenderer.js +0 -104
  407. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +0 -1
  408. package/dist/src/ui/utils/MarkdownDisplay.d.ts +0 -14
  409. package/dist/src/ui/utils/MarkdownDisplay.js +0 -197
  410. package/dist/src/ui/utils/MarkdownDisplay.js.map +0 -1
  411. package/dist/src/ui/utils/TableRenderer.d.ts +0 -17
  412. package/dist/src/ui/utils/TableRenderer.js +0 -84
  413. package/dist/src/ui/utils/TableRenderer.js.map +0 -1
  414. package/dist/src/ui/utils/commandUtils.d.ts +0 -22
  415. package/dist/src/ui/utils/commandUtils.js +0 -25
  416. package/dist/src/ui/utils/commandUtils.js.map +0 -1
  417. package/dist/src/ui/utils/computeStats.d.ts +0 -10
  418. package/dist/src/ui/utils/computeStats.js +0 -55
  419. package/dist/src/ui/utils/computeStats.js.map +0 -1
  420. package/dist/src/ui/utils/displayUtils.d.ts +0 -17
  421. package/dist/src/ui/utils/displayUtils.js +0 -24
  422. package/dist/src/ui/utils/displayUtils.js.map +0 -1
  423. package/dist/src/ui/utils/errorParsing.d.ts +0 -15
  424. package/dist/src/ui/utils/errorParsing.js +0 -79
  425. package/dist/src/ui/utils/errorParsing.js.map +0 -1
  426. package/dist/src/ui/utils/formatters.d.ts +0 -13
  427. package/dist/src/ui/utils/formatters.js +0 -56
  428. package/dist/src/ui/utils/formatters.js.map +0 -1
  429. package/dist/src/ui/utils/markdownUtilities.d.ts +0 -6
  430. package/dist/src/ui/utils/markdownUtilities.js +0 -110
  431. package/dist/src/ui/utils/markdownUtilities.js.map +0 -1
  432. package/dist/src/ui/utils/textUtils.d.ts +0 -22
  433. package/dist/src/ui/utils/textUtils.js +0 -58
  434. package/dist/src/ui/utils/textUtils.js.map +0 -1
  435. package/dist/src/ui/utils/updateCheck.d.ts +0 -6
  436. package/dist/src/ui/utils/updateCheck.js +0 -36
  437. package/dist/src/ui/utils/updateCheck.js.map +0 -1
  438. package/dist/src/utils/cleanup.d.ts +0 -6
  439. package/dist/src/utils/cleanup.js +0 -19
  440. package/dist/src/utils/cleanup.js.map +0 -1
  441. package/dist/src/utils/package.d.ts +0 -12
  442. package/dist/src/utils/package.js +0 -24
  443. package/dist/src/utils/package.js.map +0 -1
  444. package/dist/src/utils/readStdin.d.ts +0 -6
  445. package/dist/src/utils/readStdin.js +0 -34
  446. package/dist/src/utils/readStdin.js.map +0 -1
  447. package/dist/src/utils/sandbox.d.ts +0 -7
  448. package/dist/src/utils/sandbox.js +0 -680
  449. package/dist/src/utils/sandbox.js.map +0 -1
  450. package/dist/src/utils/startupWarnings.d.ts +0 -6
  451. package/dist/src/utils/startupWarnings.js +0 -40
  452. package/dist/src/utils/startupWarnings.js.map +0 -1
  453. package/dist/src/utils/userStartupWarnings.d.ts +0 -6
  454. package/dist/src/utils/userStartupWarnings.js +0 -33
  455. package/dist/src/utils/userStartupWarnings.js.map +0 -1
  456. package/dist/src/utils/version.d.ts +0 -6
  457. package/dist/src/utils/version.js +0 -11
  458. package/dist/src/utils/version.js.map +0 -1
  459. package/dist/tsconfig.tsbuildinfo +0 -1
  460. package/dist/vitest.config.d.ts +0 -7
  461. package/dist/vitest.config.js +0 -35
  462. package/dist/vitest.config.js.map +0 -1
  463. /package/{dist/src/utils → bundle}/sandbox-macos-permissive-closed.sb +0 -0
  464. /package/{dist/src/utils → bundle}/sandbox-macos-permissive-open.sb +0 -0
  465. /package/{dist/src/utils → bundle}/sandbox-macos-permissive-proxied.sb +0 -0
  466. /package/{dist/src/utils → bundle}/sandbox-macos-restrictive-closed.sb +0 -0
  467. /package/{dist/src/utils → bundle}/sandbox-macos-restrictive-open.sb +0 -0
  468. /package/{dist/src/utils → bundle}/sandbox-macos-restrictive-proxied.sb +0 -0
@@ -1,25 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * Checks if a query string potentially represents an '@' command.
8
- * It triggers if the query starts with '@' or contains '@' preceded by whitespace
9
- * and followed by a non-whitespace character.
10
- *
11
- * @param query The input query string.
12
- * @returns True if the query looks like an '@' command, false otherwise.
13
- */
14
- export const isAtCommand = (query) =>
15
- // Check if starts with @ OR has a space, then @
16
- query.startsWith('@') || /\s@/.test(query);
17
- /**
18
- * Checks if a query string potentially represents an '/' command.
19
- * It triggers if the query starts with '/'
20
- *
21
- * @param query The input query string.
22
- * @returns True if the query looks like an '/' command, false otherwise.
23
- */
24
- export const isSlashCommand = (query) => query.startsWith('/');
25
- //# sourceMappingURL=commandUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commandUtils.js","sourceRoot":"","sources":["../../../../src/ui/utils/commandUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAa,EAAW,EAAE;AACpD,gDAAgD;AAChD,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { SessionMetrics, ComputedSessionStats, ModelMetrics } from '../contexts/SessionContext.js';
7
- export declare function calculateErrorRate(metrics: ModelMetrics): number;
8
- export declare function calculateAverageLatency(metrics: ModelMetrics): number;
9
- export declare function calculateCacheHitRate(metrics: ModelMetrics): number;
10
- export declare const computeSessionStats: (metrics: SessionMetrics) => ComputedSessionStats;
@@ -1,55 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- export function calculateErrorRate(metrics) {
7
- if (metrics.api.totalRequests === 0) {
8
- return 0;
9
- }
10
- return (metrics.api.totalErrors / metrics.api.totalRequests) * 100;
11
- }
12
- export function calculateAverageLatency(metrics) {
13
- if (metrics.api.totalRequests === 0) {
14
- return 0;
15
- }
16
- return metrics.api.totalLatencyMs / metrics.api.totalRequests;
17
- }
18
- export function calculateCacheHitRate(metrics) {
19
- if (metrics.tokens.prompt === 0) {
20
- return 0;
21
- }
22
- return (metrics.tokens.cached / metrics.tokens.prompt) * 100;
23
- }
24
- export const computeSessionStats = (metrics) => {
25
- const { models, tools } = metrics;
26
- const totalApiTime = Object.values(models).reduce((acc, model) => acc + model.api.totalLatencyMs, 0);
27
- const totalToolTime = tools.totalDurationMs;
28
- const agentActiveTime = totalApiTime + totalToolTime;
29
- const apiTimePercent = agentActiveTime > 0 ? (totalApiTime / agentActiveTime) * 100 : 0;
30
- const toolTimePercent = agentActiveTime > 0 ? (totalToolTime / agentActiveTime) * 100 : 0;
31
- const totalCachedTokens = Object.values(models).reduce((acc, model) => acc + model.tokens.cached, 0);
32
- const totalPromptTokens = Object.values(models).reduce((acc, model) => acc + model.tokens.prompt, 0);
33
- const cacheEfficiency = totalPromptTokens > 0 ? (totalCachedTokens / totalPromptTokens) * 100 : 0;
34
- const totalDecisions = tools.totalDecisions.accept +
35
- tools.totalDecisions.reject +
36
- tools.totalDecisions.modify;
37
- const successRate = tools.totalCalls > 0 ? (tools.totalSuccess / tools.totalCalls) * 100 : 0;
38
- const agreementRate = totalDecisions > 0
39
- ? (tools.totalDecisions.accept / totalDecisions) * 100
40
- : 0;
41
- return {
42
- totalApiTime,
43
- totalToolTime,
44
- agentActiveTime,
45
- apiTimePercent,
46
- toolTimePercent,
47
- cacheEfficiency,
48
- totalDecisions,
49
- successRate,
50
- agreementRate,
51
- totalCachedTokens,
52
- totalPromptTokens,
53
- };
54
- };
55
- //# sourceMappingURL=computeStats.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"computeStats.js","sourceRoot":"","sources":["../../../../src/ui/utils/computeStats.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,UAAU,kBAAkB,CAAC,OAAqB;IACtD,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,GAAG,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAqB;IAC3D,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAqB;IACzD,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAC/D,CA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AAC,MAAM;QAC3B,KAAK,CAAC,cAAc,CAAC,MAAM;QAC3B,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC;IAC9B,MAAM,WAAW,GACf,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3E,MAAM,aAAa,GACjB,cAAc,GAAG,CAAC;QAChB,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,cAAc,CAAC,GAAG,GAAG;QACtD,CAAC,CAAC,CAAC,CAAC;IAER,OAAO;QACL,YAAY;QACZ,aAAa;QACb,eAAe;QACf,cAAc;QACd,eAAe;QACf,eAAe;QACf,cAAc;QACd,WAAW;QACX,aAAa;QACb,iBAAiB;QACjB,iBAAiB;KAClB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,17 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- export declare const TOOL_SUCCESS_RATE_HIGH = 95;
7
- export declare const TOOL_SUCCESS_RATE_MEDIUM = 85;
8
- export declare const USER_AGREEMENT_RATE_HIGH = 75;
9
- export declare const USER_AGREEMENT_RATE_MEDIUM = 45;
10
- export declare const CACHE_EFFICIENCY_HIGH = 40;
11
- export declare const CACHE_EFFICIENCY_MEDIUM = 15;
12
- export declare const getStatusColor: (value: number, thresholds: {
13
- green: number;
14
- yellow: number;
15
- }, options?: {
16
- defaultColor?: string;
17
- }) => string;
@@ -1,24 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { Colors } from '../colors.js';
7
- // --- Thresholds ---
8
- export const TOOL_SUCCESS_RATE_HIGH = 95;
9
- export const TOOL_SUCCESS_RATE_MEDIUM = 85;
10
- export const USER_AGREEMENT_RATE_HIGH = 75;
11
- export const USER_AGREEMENT_RATE_MEDIUM = 45;
12
- export const CACHE_EFFICIENCY_HIGH = 40;
13
- export const CACHE_EFFICIENCY_MEDIUM = 15;
14
- // --- Color Logic ---
15
- export const getStatusColor = (value, thresholds, options = {}) => {
16
- if (value >= thresholds.green) {
17
- return Colors.AccentGreen;
18
- }
19
- if (value >= thresholds.yellow) {
20
- return Colors.AccentYellow;
21
- }
22
- return options.defaultColor || Colors.AccentRed;
23
- };
24
- //# sourceMappingURL=displayUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"displayUtils.js","sourceRoot":"","sources":["../../../../src/ui/utils/displayUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,qBAAqB;AACrB,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAE3C,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAC3C,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C,sBAAsB;AACtB,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,KAAa,EACb,UAA6C,EAC7C,UAAqC,EAAE,EACvC,EAAE;IACF,IAAI,KAAK,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,WAAW,CAAC;IAC5B,CAAC;IACD,IAAI,KAAK,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC,YAAY,CAAC;IAC7B,CAAC;IACD,OAAO,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC,SAAS,CAAC;AAClD,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { AuthType } from '@google/gemini-cli-core';
7
- export interface ApiError {
8
- error: {
9
- code: number;
10
- message: string;
11
- status: string;
12
- details: unknown[];
13
- };
14
- }
15
- export declare function parseAndFormatApiError(error: unknown, authType?: AuthType): string;
@@ -1,79 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { AuthType } from '@google/gemini-cli-core';
7
- const RATE_LIMIT_ERROR_MESSAGE_GOOGLE = '\nPlease wait and try again later. To increase your limits, upgrade to a plan with higher limits, or use /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey';
8
- const RATE_LIMIT_ERROR_MESSAGE_USE_GEMINI = '\nPlease wait and try again later. To increase your limits, request a quota increase through AI Studio, or switch to another /auth method';
9
- const RATE_LIMIT_ERROR_MESSAGE_VERTEX = '\nPlease wait and try again later. To increase your limits, request a quota increase through Vertex, or switch to another /auth method';
10
- const RATE_LIMIT_ERROR_MESSAGE_DEFAULT = 'Your request has been rate limited. Please wait and try again later.';
11
- function isApiError(error) {
12
- return (typeof error === 'object' &&
13
- error !== null &&
14
- 'error' in error &&
15
- typeof error.error === 'object' &&
16
- 'message' in error.error);
17
- }
18
- function isStructuredError(error) {
19
- return (typeof error === 'object' &&
20
- error !== null &&
21
- 'message' in error &&
22
- typeof error.message === 'string');
23
- }
24
- function getRateLimitMessage(authType) {
25
- switch (authType) {
26
- case AuthType.LOGIN_WITH_GOOGLE:
27
- return RATE_LIMIT_ERROR_MESSAGE_GOOGLE;
28
- case AuthType.USE_GEMINI:
29
- return RATE_LIMIT_ERROR_MESSAGE_USE_GEMINI;
30
- case AuthType.USE_VERTEX_AI:
31
- return RATE_LIMIT_ERROR_MESSAGE_VERTEX;
32
- default:
33
- return RATE_LIMIT_ERROR_MESSAGE_DEFAULT;
34
- }
35
- }
36
- export function parseAndFormatApiError(error, authType) {
37
- if (isStructuredError(error)) {
38
- let text = `[API Error: ${error.message}]`;
39
- if (error.status === 429) {
40
- text += getRateLimitMessage(authType);
41
- }
42
- return text;
43
- }
44
- // The error message might be a string containing a JSON object.
45
- if (typeof error === 'string') {
46
- const jsonStart = error.indexOf('{');
47
- if (jsonStart === -1) {
48
- return `[API Error: ${error}]`; // Not a JSON error, return as is.
49
- }
50
- const jsonString = error.substring(jsonStart);
51
- try {
52
- const parsedError = JSON.parse(jsonString);
53
- if (isApiError(parsedError)) {
54
- let finalMessage = parsedError.error.message;
55
- try {
56
- // See if the message is a stringified JSON with another error
57
- const nestedError = JSON.parse(finalMessage);
58
- if (isApiError(nestedError)) {
59
- finalMessage = nestedError.error.message;
60
- }
61
- }
62
- catch (_e) {
63
- // It's not a nested JSON error, so we just use the message as is.
64
- }
65
- let text = `[API Error: ${finalMessage} (Status: ${parsedError.error.status})]`;
66
- if (parsedError.error.code === 429) {
67
- text += getRateLimitMessage(authType);
68
- }
69
- return text;
70
- }
71
- }
72
- catch (_e) {
73
- // Not a valid JSON, fall through and return the original message.
74
- }
75
- return `[API Error: ${error}]`;
76
- }
77
- return '[API Error: An unknown error occurred.]';
78
- }
79
- //# sourceMappingURL=errorParsing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errorParsing.js","sourceRoot":"","sources":["../../../../src/ui/utils/errorParsing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAmB,MAAM,yBAAyB,CAAC;AAEpE,MAAM,+BAA+B,GACnC,uMAAuM,CAAC;AAC1M,MAAM,mCAAmC,GACvC,2IAA2I,CAAC;AAC9I,MAAM,+BAA+B,GACnC,wIAAwI,CAAC;AAC3I,MAAM,gCAAgC,GACpC,sEAAsE,CAAC;AAWzE,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAO,IAAI,KAAK;QAChB,OAAQ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AAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAY,CAAC;YACtD,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC5B,IAAI,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC;gBAC7C,IAAI,CAAC;oBACH,8DAA8D;oBAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAY,CAAC;oBACxD,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;wBAC5B,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC;oBAC3C,CAAC;gBACH,CAAC;gBAAC,OAAO,EAAE,EAAE,CAAC;oBACZ,kEAAkE;gBACpE,CAAC;gBACD,IAAI,IAAI,GAAG,eAAe,YAAY,aAAa,WAAW,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC;gBAChF,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;oBACnC,IAAI,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;gBACxC,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACZ,kEAAkE;QACpE,CAAC;QACD,OAAO,eAAe,KAAK,GAAG,CAAC;IACjC,CAAC;IAED,OAAO,yCAAyC,CAAC;AACnD,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- export declare const formatMemoryUsage: (bytes: number) => string;
7
- /**
8
- * Formats a duration in milliseconds into a concise, human-readable string (e.g., "1h 5s").
9
- * It omits any time units that are zero.
10
- * @param milliseconds The duration in milliseconds.
11
- * @returns A formatted string representing the duration.
12
- */
13
- export declare const formatDuration: (milliseconds: number) => string;
@@ -1,56 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- export const formatMemoryUsage = (bytes) => {
7
- const gb = bytes / (1024 * 1024 * 1024);
8
- if (bytes < 1024 * 1024) {
9
- return `${(bytes / 1024).toFixed(1)} KB`;
10
- }
11
- if (bytes < 1024 * 1024 * 1024) {
12
- return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
13
- }
14
- return `${gb.toFixed(2)} GB`;
15
- };
16
- /**
17
- * Formats a duration in milliseconds into a concise, human-readable string (e.g., "1h 5s").
18
- * It omits any time units that are zero.
19
- * @param milliseconds The duration in milliseconds.
20
- * @returns A formatted string representing the duration.
21
- */
22
- export const formatDuration = (milliseconds) => {
23
- if (milliseconds <= 0) {
24
- return '0s';
25
- }
26
- if (milliseconds < 1000) {
27
- return `${Math.round(milliseconds)}ms`;
28
- }
29
- const totalSeconds = milliseconds / 1000;
30
- if (totalSeconds < 60) {
31
- return `${totalSeconds.toFixed(1)}s`;
32
- }
33
- const hours = Math.floor(totalSeconds / 3600);
34
- const minutes = Math.floor((totalSeconds % 3600) / 60);
35
- const seconds = Math.floor(totalSeconds % 60);
36
- const parts = [];
37
- if (hours > 0) {
38
- parts.push(`${hours}h`);
39
- }
40
- if (minutes > 0) {
41
- parts.push(`${minutes}m`);
42
- }
43
- if (seconds > 0) {
44
- parts.push(`${seconds}s`);
45
- }
46
- // If all parts are zero (e.g., exactly 1 hour), return the largest unit.
47
- if (parts.length === 0) {
48
- if (hours > 0)
49
- return `${hours}h`;
50
- if (minutes > 0)
51
- return `${minutes}m`;
52
- return `${seconds}s`;
53
- }
54
- return parts.join(' ');
55
- };
56
- //# sourceMappingURL=formatters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../../src/ui/utils/formatters.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAU,EAAE;IACzD,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,IAAI,GAAG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AC,EAAE,CAAC;QACd,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC;IAC5B,CAAC;IACD,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED,yEAAyE;IACzE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,IAAI,KAAK,GAAG,CAAC;YAAE,OAAO,GAAG,KAAK,GAAG,CAAC;QAClC,IAAI,OAAO,GAAG,CAAC;YAAE,OAAO,GAAG,OAAO,GAAG,CAAC;QACtC,OAAO,GAAG,OAAO,GAAG,CAAC;IACvB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- export declare const findLastSafeSplitPoint: (content: string) => number;
@@ -1,110 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /*
7
- **Background & Purpose:**
8
-
9
- The `findSafeSplitPoint` function is designed to address the challenge of displaying or processing large, potentially streaming, pieces of Markdown text. When content (e.g., from an LLM like Gemini) arrives in chunks or grows too large for a single display unit (like a message bubble), it needs to be split. A naive split (e.g., just at a character limit) can break Markdown formatting, especially critical for multi-line elements like code blocks, lists, or blockquotes, leading to incorrect rendering.
10
-
11
- This function aims to find an *intelligent* or "safe" index within the provided `content` string at which to make such a split, prioritizing the preservation of Markdown integrity.
12
-
13
- **Key Expectations & Behavior (Prioritized):**
14
-
15
- 1. **No Split if Short Enough:**
16
- * If `content.length` is less than or equal to `idealMaxLength`, the function should return `content.length` (indicating no split is necessary for length reasons).
17
-
18
- 2. **Code Block Integrity (Highest Priority for Safety):**
19
- * The function must try to avoid splitting *inside* a fenced code block (i.e., between ` ``` ` and ` ``` `).
20
- * If `idealMaxLength` falls within a code block:
21
- * The function will attempt to return an index that splits the content *before* the start of that code block.
22
- * If a code block starts at the very beginning of the `content` and `idealMaxLength` falls within it (meaning the block itself is too long for the first chunk), the function might return `0`. This effectively makes the first chunk empty, pushing the entire oversized code block to the second part of the split.
23
- * When considering splits near code blocks, the function prefers to keep the entire code block intact in one of the resulting chunks.
24
-
25
- 3. **Markdown-Aware Newline Splitting (If Not Governed by Code Block Logic):**
26
- * If `idealMaxLength` does not fall within a code block (or after code block considerations have been made), the function will look for natural break points by scanning backwards from `idealMaxLength`:
27
- * **Paragraph Breaks:** It prioritizes splitting after a double newline (`\n\n`), as this typically signifies the end of a paragraph or a block-level element.
28
- * **Single Line Breaks:** If no double newline is found in a suitable range, it will look for a single newline (`\n`).
29
- * Any newline chosen as a split point must also not be inside a code block.
30
-
31
- 4. **Fallback to `idealMaxLength`:**
32
- * If no "safer" split point (respecting code blocks or finding suitable newlines) is identified before or at `idealMaxLength`, and `idealMaxLength` itself is not determined to be an unsafe split point (e.g., inside a code block), the function may return a length larger than `idealMaxLength`, again it CANNOT break markdown formatting. This could happen with very long lines of text without Markdown block structures or newlines.
33
-
34
- **In essence, `findSafeSplitPoint` tries to be a good Markdown citizen when forced to divide content, preferring structural boundaries over arbitrary character limits, with a strong emphasis on not corrupting code blocks.**
35
- */
36
- /**
37
- * Checks if a given character index within a string is inside a fenced (```) code block.
38
- * @param content The full string content.
39
- * @param indexToTest The character index to test.
40
- * @returns True if the index is inside a code block's content, false otherwise.
41
- */
42
- const isIndexInsideCodeBlock = (content, indexToTest) => {
43
- let fenceCount = 0;
44
- let searchPos = 0;
45
- while (searchPos < content.length) {
46
- const nextFence = content.indexOf('```', searchPos);
47
- if (nextFence === -1 || nextFence >= indexToTest) {
48
- break;
49
- }
50
- fenceCount++;
51
- searchPos = nextFence + 3;
52
- }
53
- return fenceCount % 2 === 1;
54
- };
55
- /**
56
- * Finds the starting index of the code block that encloses the given index.
57
- * Returns -1 if the index is not inside a code block.
58
- * @param content The markdown content.
59
- * @param index The index to check.
60
- * @returns Start index of the enclosing code block or -1.
61
- */
62
- const findEnclosingCodeBlockStart = (content, index) => {
63
- if (!isIndexInsideCodeBlock(content, index)) {
64
- return -1;
65
- }
66
- let currentSearchPos = 0;
67
- while (currentSearchPos < index) {
68
- const blockStartIndex = content.indexOf('```', currentSearchPos);
69
- if (blockStartIndex === -1 || blockStartIndex >= index) {
70
- break;
71
- }
72
- const blockEndIndex = content.indexOf('```', blockStartIndex + 3);
73
- if (blockStartIndex < index) {
74
- if (blockEndIndex === -1 || index < blockEndIndex + 3) {
75
- return blockStartIndex;
76
- }
77
- }
78
- if (blockEndIndex === -1)
79
- break;
80
- currentSearchPos = blockEndIndex + 3;
81
- }
82
- return -1;
83
- };
84
- export const findLastSafeSplitPoint = (content) => {
85
- const enclosingBlockStart = findEnclosingCodeBlockStart(content, content.length);
86
- if (enclosingBlockStart !== -1) {
87
- // The end of the content is contained in a code block. Split right before.
88
- return enclosingBlockStart;
89
- }
90
- // Search for the last double newline (\n\n) not in a code block.
91
- let searchStartIndex = content.length;
92
- while (searchStartIndex >= 0) {
93
- const dnlIndex = content.lastIndexOf('\n\n', searchStartIndex);
94
- if (dnlIndex === -1) {
95
- // No more double newlines found.
96
- break;
97
- }
98
- const potentialSplitPoint = dnlIndex + 2;
99
- if (!isIndexInsideCodeBlock(content, potentialSplitPoint)) {
100
- return potentialSplitPoint;
101
- }
102
- // If potentialSplitPoint was inside a code block,
103
- // the next search should start *before* the \n\n we just found to ensure progress.
104
- searchStartIndex = dnlIndex - 1;
105
- }
106
- // If no safe double newline is found, return content.length
107
- // to keep the entire content as one piece.
108
- return content.length;
109
- };
110
- //# sourceMappingURL=markdownUtilities.js.map
@@ -1 +0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-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * Calculates the maximum width of a multi-line ASCII art string.
8
- * @param asciiArt The ASCII art string.
9
- * @returns The length of the longest line in the ASCII art.
10
- */
11
- export declare const getAsciiArtWidth: (asciiArt: string) => number;
12
- /**
13
- * Checks if a Buffer is likely binary by testing for the presence of a NULL byte.
14
- * The presence of a NULL byte is a strong indicator that the data is not plain text.
15
- * @param data The Buffer to check.
16
- * @param sampleSize The number of bytes from the start of the buffer to test.
17
- * @returns True if a NULL byte is found, false otherwise.
18
- */
19
- export declare function isBinary(data: Buffer | null | undefined, sampleSize?: number): boolean;
20
- export declare function toCodePoints(str: string): string[];
21
- export declare function cpLen(str: string): number;
22
- export declare function cpSlice(str: string, start: number, end?: number): string;
@@ -1,58 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * Calculates the maximum width of a multi-line ASCII art string.
8
- * @param asciiArt The ASCII art string.
9
- * @returns The length of the longest line in the ASCII art.
10
- */
11
- export const getAsciiArtWidth = (asciiArt) => {
12
- if (!asciiArt) {
13
- return 0;
14
- }
15
- const lines = asciiArt.split('\n');
16
- return Math.max(...lines.map((line) => line.length));
17
- };
18
- /**
19
- * Checks if a Buffer is likely binary by testing for the presence of a NULL byte.
20
- * The presence of a NULL byte is a strong indicator that the data is not plain text.
21
- * @param data The Buffer to check.
22
- * @param sampleSize The number of bytes from the start of the buffer to test.
23
- * @returns True if a NULL byte is found, false otherwise.
24
- */
25
- export function isBinary(data, sampleSize = 512) {
26
- if (!data) {
27
- return false;
28
- }
29
- const sample = data.length > sampleSize ? data.subarray(0, sampleSize) : data;
30
- for (const byte of sample) {
31
- // The presence of a NULL byte (0x00) is one of the most reliable
32
- // indicators of a binary file. Text files should not contain them.
33
- if (byte === 0) {
34
- return true;
35
- }
36
- }
37
- // If no NULL bytes were found in the sample, we assume it's text.
38
- return false;
39
- }
40
- /*
41
- * -------------------------------------------------------------------------
42
- * Unicode‑aware helpers (work at the code‑point level rather than UTF‑16
43
- * code units so that surrogate‑pair emoji count as one "column".)
44
- * ---------------------------------------------------------------------- */
45
- export function toCodePoints(str) {
46
- // [...str] or Array.from both iterate by UTF‑32 code point, handling
47
- // surrogate pairs correctly.
48
- return Array.from(str);
49
- }
50
- export function cpLen(str) {
51
- return toCodePoints(str).length;
52
- }
53
- export function cpSlice(str, start, end) {
54
- // Slice by code‑point indices and re‑join.
55
- const arr = toCodePoints(str).slice(start, end);
56
- return arr.join('');
57
- }
58
- //# sourceMappingURL=textUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"textUtils.js","sourceRoot":"","sources":["../../../../src/ui/utils/textUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAgB,EAAU,EAAE;IAC3D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CACtB,IAA+B,EAC/B,UAAU,GAAG,GAAG;IAEhB,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE9E,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,iEAAiE;QACjE,mEAAmE;QACnE,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,kEAAkE;IAClE,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;4EAI4E;AAE5E,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,qEAAqE;IACrE,6BAA6B;IAC7B,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,GAAW;IAC/B,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAW,EAAE,KAAa,EAAE,GAAY;IAC9D,2CAA2C;IAC3C,MAAM,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAChD,OAAO,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- export declare function checkForUpdates(): Promise<string | null>;
@@ -1,36 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import updateNotifier from 'update-notifier';
7
- import semver from 'semver';
8
- import { getPackageJson } from '../../utils/package.js';
9
- export async function checkForUpdates() {
10
- try {
11
- const packageJson = await getPackageJson();
12
- if (!packageJson || !packageJson.name || !packageJson.version) {
13
- return null;
14
- }
15
- const notifier = updateNotifier({
16
- pkg: {
17
- name: packageJson.name,
18
- version: packageJson.version,
19
- },
20
- // check every time
21
- updateCheckInterval: 0,
22
- // allow notifier to run in scripts
23
- shouldNotifyInNpmScript: true,
24
- });
25
- if (notifier.update &&
26
- semver.gt(notifier.update.latest, notifier.update.current)) {
27
- return null;
28
- }
29
- return null;
30
- }
31
- catch (e) {
32
- console.warn('Failed to check for updates: ' + e);
33
- return null;
34
- }
35
- }
36
- //# sourceMappingURL=updateCheck.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateCheck.js","sourceRoot":"","sources":["../../../../src/ui/utils/updateCheck.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAC7C,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;QAC3C,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;YAC9D,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,QAAQ,GAAG,cAAc,CAAC;YAC9B,GAAG,EAAE;gBACH,IAAI,EAAE,WAAW,CAAC,IAAI;gBACtB,OAAO,EAAE,WAAW,CAAC,OAAO;aAC7B;YACD,mBAAmB;YACnB,mBAAmB,EAAE,CAAC;YACtB,mCAAmC;YACnC,uBAAuB,EAAE,IAAI;SAC9B,CAAC,CAAC;QAEH,IACE,QAAQ,CAAC,MAAM;YACf,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAC1D,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,+BAA+B,GAAG,CAAC,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- export declare function cleanupCheckpoints(): Promise<void>;
@@ -1,19 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { promises as fs } from 'fs';
7
- import { join } from 'path';
8
- import { getProjectTempDir } from '@google/gemini-cli-core';
9
- export async function cleanupCheckpoints() {
10
- const tempDir = getProjectTempDir(process.cwd());
11
- const checkpointsDir = join(tempDir, 'checkpoints');
12
- try {
13
- await fs.rm(checkpointsDir, { recursive: true, force: true });
14
- }
15
- catch {
16
- // Ignore errors if the directory doesn't exist or fails to delete.
17
- }
18
- }
19
- //# sourceMappingURL=cleanup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../../src/utils/cleanup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACjD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IACpD,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,mEAAmE;IACrE,CAAC;AACH,CAAC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { type PackageJson as BasePackageJson } from 'read-package-up';
7
- export type PackageJson = BasePackageJson & {
8
- config?: {
9
- sandboxImageUri?: string;
10
- };
11
- };
12
- export declare function getPackageJson(): Promise<PackageJson | undefined>;