@vybestack/llxprt-code-core 0.11.0 → 0.12.0-nightly.260910.2aac6841e

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 (417) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/prompt-config/defaults/default-prompts.json +3 -3
  5. package/dist/src/config/agentClientLifecycle.d.ts +4 -3
  6. package/dist/src/config/agentClientLifecycle.js +27 -14
  7. package/dist/src/config/agentClientLifecycle.js.map +1 -1
  8. package/dist/src/config/config.d.ts +2 -5
  9. package/dist/src/config/config.js +10 -23
  10. package/dist/src/config/config.js.map +1 -1
  11. package/dist/src/config/configBase.d.ts +5 -1
  12. package/dist/src/config/configBase.js +27 -6
  13. package/dist/src/config/configBase.js.map +1 -1
  14. package/dist/src/config/configBaseCore.d.ts +26 -8
  15. package/dist/src/config/configBaseCore.js +30 -26
  16. package/dist/src/config/configBaseCore.js.map +1 -1
  17. package/dist/src/config/configMcpRuntime.d.ts +16 -0
  18. package/dist/src/config/configMcpRuntime.js +31 -0
  19. package/dist/src/config/configMcpRuntime.js.map +1 -0
  20. package/dist/src/config/configMediaDefaults.d.ts +10 -0
  21. package/dist/src/config/configMediaDefaults.js +17 -0
  22. package/dist/src/config/configMediaDefaults.js.map +1 -0
  23. package/dist/src/config/configTestHarness.d.ts +4 -0
  24. package/dist/src/config/configTypes.d.ts +4 -54
  25. package/dist/src/config/configTypes.js +6 -82
  26. package/dist/src/config/configTypes.js.map +1 -1
  27. package/dist/src/config/index.d.ts +1 -2
  28. package/dist/src/config/index.js +1 -2
  29. package/dist/src/config/index.js.map +1 -1
  30. package/dist/src/config/models.d.ts +0 -4
  31. package/dist/src/config/models.js +0 -4
  32. package/dist/src/config/models.js.map +1 -1
  33. package/dist/src/config/toolRegistryFactory.d.ts +2 -2
  34. package/dist/src/core/clientContract.d.ts +4 -6
  35. package/dist/src/core/compression/transcriptPathNotice.d.ts +22 -0
  36. package/dist/src/core/compression/transcriptPathNotice.js +29 -0
  37. package/dist/src/core/compression/transcriptPathNotice.js.map +1 -0
  38. package/dist/src/core/contentGenerator.d.ts +2 -5
  39. package/dist/src/core/contentGenerator.js +10 -24
  40. package/dist/src/core/contentGenerator.js.map +1 -1
  41. package/dist/src/core/logger.d.ts +66 -0
  42. package/dist/src/core/logger.js +345 -30
  43. package/dist/src/core/logger.js.map +1 -1
  44. package/dist/src/core/prompts.d.ts +0 -1
  45. package/dist/src/core/prompts.js +5 -79
  46. package/dist/src/core/prompts.js.map +1 -1
  47. package/dist/src/core/turn.d.ts +3 -3
  48. package/dist/src/hooks/hookTranslator.js +5 -4
  49. package/dist/src/hooks/hookTranslator.js.map +1 -1
  50. package/dist/src/index.d.ts +8 -6
  51. package/dist/src/index.js +8 -6
  52. package/dist/src/index.js.map +1 -1
  53. package/dist/src/llm-types/index.d.ts +1 -1
  54. package/dist/src/llm-types/modelEnvelope.d.ts +2 -1
  55. package/dist/src/llm-types/modelEnvelope.js +17 -1
  56. package/dist/src/llm-types/modelEnvelope.js.map +1 -1
  57. package/dist/src/models/schema.d.ts +40 -40
  58. package/dist/src/policy/policies/read-only.toml +0 -5
  59. package/dist/src/prompt-config/TemplateEngine.js +0 -3
  60. package/dist/src/prompt-config/TemplateEngine.js.map +1 -1
  61. package/dist/src/prompt-config/defaults/providers/gemini/core.md +0 -2
  62. package/dist/src/prompt-config/defaults/providers/gemini/models/gemini-2.5-flash/core.md +0 -2
  63. package/dist/src/prompt-config/defaults/providers/gemini/models/gemini-2.5-flash/gemini-2-5-flash/core.md +0 -2
  64. package/dist/src/prompt-config/prompt-loader.d.ts +1 -1
  65. package/dist/src/prompt-config/prompt-loader.js +4 -4
  66. package/dist/src/prompt-config/prompt-loader.js.map +1 -1
  67. package/dist/src/prompt-config/types.d.ts +0 -1
  68. package/dist/src/recording/CheckpointService.d.ts +4 -0
  69. package/dist/src/recording/CheckpointService.js +67 -46
  70. package/dist/src/recording/CheckpointService.js.map +1 -1
  71. package/dist/src/recording/HistoryMutationService.d.ts +1 -1
  72. package/dist/src/recording/HistoryMutationService.js +27 -4
  73. package/dist/src/recording/HistoryMutationService.js.map +1 -1
  74. package/dist/src/recording/RecordingIntegration.d.ts +36 -2
  75. package/dist/src/recording/RecordingIntegration.js +224 -7
  76. package/dist/src/recording/RecordingIntegration.js.map +1 -1
  77. package/dist/src/recording/ReplayEngine.d.ts +8 -10
  78. package/dist/src/recording/ReplayEngine.js +161 -95
  79. package/dist/src/recording/ReplayEngine.js.map +1 -1
  80. package/dist/src/recording/SessionDiscovery.d.ts +4 -2
  81. package/dist/src/recording/SessionDiscovery.js +13 -5
  82. package/dist/src/recording/SessionDiscovery.js.map +1 -1
  83. package/dist/src/recording/SessionRecordingService.d.ts +23 -3
  84. package/dist/src/recording/SessionRecordingService.js +209 -51
  85. package/dist/src/recording/SessionRecordingService.js.map +1 -1
  86. package/dist/src/recording/SessionTransitionService.d.ts +7 -0
  87. package/dist/src/recording/SessionTransitionService.js +66 -13
  88. package/dist/src/recording/SessionTransitionService.js.map +1 -1
  89. package/dist/src/recording/index.d.ts +1 -0
  90. package/dist/src/recording/index.js +1 -0
  91. package/dist/src/recording/index.js.map +1 -1
  92. package/dist/src/recording/janitor/cleanupTypes.d.ts +3 -0
  93. package/dist/src/recording/janitor/cleanupTypes.js.map +1 -1
  94. package/dist/src/recording/janitor/mediaReclamation.d.ts +23 -0
  95. package/dist/src/recording/janitor/mediaReclamation.js +195 -0
  96. package/dist/src/recording/janitor/mediaReclamation.js.map +1 -0
  97. package/dist/src/recording/janitor/sessionJanitor.js +47 -1
  98. package/dist/src/recording/janitor/sessionJanitor.js.map +1 -1
  99. package/dist/src/recording/janitor/sessionScanner.d.ts +12 -9
  100. package/dist/src/recording/janitor/sessionScanner.js +248 -193
  101. package/dist/src/recording/janitor/sessionScanner.js.map +1 -1
  102. package/dist/src/recording/replay-test-helpers.d.ts +10 -1
  103. package/dist/src/recording/replay-test-helpers.js +24 -2
  104. package/dist/src/recording/replay-test-helpers.js.map +1 -1
  105. package/dist/src/recording/replayCheckpointMetadata.d.ts +28 -0
  106. package/dist/src/recording/replayCheckpointMetadata.js +96 -0
  107. package/dist/src/recording/replayCheckpointMetadata.js.map +1 -0
  108. package/dist/src/recording/replayErrorFormatting.d.ts +6 -0
  109. package/dist/src/recording/replayErrorFormatting.js +38 -0
  110. package/dist/src/recording/replayErrorFormatting.js.map +1 -0
  111. package/dist/src/recording/resumeSession.d.ts +3 -0
  112. package/dist/src/recording/resumeSession.js +7 -1
  113. package/dist/src/recording/resumeSession.js.map +1 -1
  114. package/dist/src/recording/semanticMediaPurgeReplayValidation.d.ts +14 -0
  115. package/dist/src/recording/semanticMediaPurgeReplayValidation.js +24 -0
  116. package/dist/src/recording/semanticMediaPurgeReplayValidation.js.map +1 -0
  117. package/dist/src/recording/session-media-package-blobs.d.ts +8 -0
  118. package/dist/src/recording/session-media-package-blobs.js +72 -0
  119. package/dist/src/recording/session-media-package-blobs.js.map +1 -0
  120. package/dist/src/recording/session-media-package-import.d.ts +26 -0
  121. package/dist/src/recording/session-media-package-import.js +124 -0
  122. package/dist/src/recording/session-media-package-import.js.map +1 -0
  123. package/dist/src/recording/session-media-package-state.d.ts +19 -0
  124. package/dist/src/recording/session-media-package-state.js +56 -0
  125. package/dist/src/recording/session-media-package-state.js.map +1 -0
  126. package/dist/src/recording/session-media-package-validation.d.ts +59 -0
  127. package/dist/src/recording/session-media-package-validation.js +286 -0
  128. package/dist/src/recording/session-media-package-validation.js.map +1 -0
  129. package/dist/src/recording/session-media-package-writer.d.ts +18 -0
  130. package/dist/src/recording/session-media-package-writer.js +70 -0
  131. package/dist/src/recording/session-media-package-writer.js.map +1 -0
  132. package/dist/src/recording/session-media-package.d.ts +27 -0
  133. package/dist/src/recording/session-media-package.js +366 -0
  134. package/dist/src/recording/session-media-package.js.map +1 -0
  135. package/dist/src/recording/types.d.ts +34 -2
  136. package/dist/src/recording/types.js.map +1 -1
  137. package/dist/src/runtime/AgentRuntimeContext.d.ts +22 -5
  138. package/dist/src/runtime/AgentRuntimeLoader.d.ts +6 -0
  139. package/dist/src/runtime/AgentRuntimeLoader.js +25 -6
  140. package/dist/src/runtime/AgentRuntimeLoader.js.map +1 -1
  141. package/dist/src/runtime/contracts/PromptEstimation.d.ts +1 -0
  142. package/dist/src/runtime/contracts/PromptEstimation.js.map +1 -1
  143. package/dist/src/runtime/contracts/RuntimeProvider.d.ts +3 -2
  144. package/dist/src/runtime/contracts/RuntimeProviderManager.d.ts +0 -2
  145. package/dist/src/runtime/createAgentRuntimeContext.js +28 -1
  146. package/dist/src/runtime/createAgentRuntimeContext.js.map +1 -1
  147. package/dist/src/runtime/providerRuntimeContext.d.ts +12 -0
  148. package/dist/src/runtime/providerRuntimeContext.js +3 -0
  149. package/dist/src/runtime/providerRuntimeContext.js.map +1 -1
  150. package/dist/src/runtime/runtimeAdapters.js +2 -2
  151. package/dist/src/runtime/runtimeAdapters.js.map +1 -1
  152. package/dist/src/services/history/ContentConverters.d.ts +11 -7
  153. package/dist/src/services/history/ContentConverters.js +11 -7
  154. package/dist/src/services/history/ContentConverters.js.map +1 -1
  155. package/dist/src/services/history/HistoryService.d.ts +18 -180
  156. package/dist/src/services/history/HistoryService.js +53 -523
  157. package/dist/src/services/history/HistoryService.js.map +1 -1
  158. package/dist/src/services/history/HistoryServiceCore.d.ts +278 -0
  159. package/dist/src/services/history/HistoryServiceCore.js +727 -0
  160. package/dist/src/services/history/HistoryServiceCore.js.map +1 -0
  161. package/dist/src/services/history/IContent.d.ts +118 -16
  162. package/dist/src/services/history/IContent.js +284 -4
  163. package/dist/src/services/history/IContent.js.map +1 -1
  164. package/dist/src/services/history/contentSize.js +22 -2
  165. package/dist/src/services/history/contentSize.js.map +1 -1
  166. package/dist/src/services/history/historyChronology.d.ts +7 -0
  167. package/dist/src/services/history/historyChronology.js +35 -3
  168. package/dist/src/services/history/historyChronology.js.map +1 -1
  169. package/dist/src/services/history/historyCloneUtils.d.ts +5 -4
  170. package/dist/src/services/history/historyCloneUtils.js +23 -16
  171. package/dist/src/services/history/historyCloneUtils.js.map +1 -1
  172. package/dist/src/services/history/historyCompressionQueue.d.ts +33 -0
  173. package/dist/src/services/history/historyCompressionQueue.js +81 -0
  174. package/dist/src/services/history/historyCompressionQueue.js.map +1 -0
  175. package/dist/src/services/history/historyEventTypes.d.ts +3 -0
  176. package/dist/src/services/history/historyMutationFailure.d.ts +15 -0
  177. package/dist/src/services/history/historyMutationFailure.js +22 -0
  178. package/dist/src/services/history/historyMutationFailure.js.map +1 -1
  179. package/dist/src/services/history/historyProviderPipeline.d.ts +1 -1
  180. package/dist/src/services/history/historyProviderPipeline.js +15 -5
  181. package/dist/src/services/history/historyProviderPipeline.js.map +1 -1
  182. package/dist/src/services/history/historyTokenEstimation.js +10 -6
  183. package/dist/src/services/history/historyTokenEstimation.js.map +1 -1
  184. package/dist/src/services/history/historyToolNormalization.d.ts +2 -0
  185. package/dist/src/services/history/historyToolNormalization.js +26 -9
  186. package/dist/src/services/history/historyToolNormalization.js.map +1 -1
  187. package/dist/src/services/history/provider-file-binding.d.ts +11 -0
  188. package/dist/src/services/history/provider-file-binding.js +70 -0
  189. package/dist/src/services/history/provider-file-binding.js.map +1 -0
  190. package/dist/src/services/history/semantic-media-purge.d.ts +66 -0
  191. package/dist/src/services/history/semantic-media-purge.js +404 -0
  192. package/dist/src/services/history/semantic-media-purge.js.map +1 -0
  193. package/dist/src/storage/SessionPersistenceService.d.ts +53 -2
  194. package/dist/src/storage/SessionPersistenceService.js +435 -23
  195. package/dist/src/storage/SessionPersistenceService.js.map +1 -1
  196. package/dist/src/storage/history-media-ownership.d.ts +38 -0
  197. package/dist/src/storage/history-media-ownership.js +136 -0
  198. package/dist/src/storage/history-media-ownership.js.map +1 -0
  199. package/dist/src/storage/local-media-store-child.d.ts +6 -0
  200. package/dist/src/storage/local-media-store-child.js +140 -0
  201. package/dist/src/storage/local-media-store-child.js.map +1 -0
  202. package/dist/src/storage/local-media-store-files.d.ts +44 -0
  203. package/dist/src/storage/local-media-store-files.js +460 -0
  204. package/dist/src/storage/local-media-store-files.js.map +1 -0
  205. package/dist/src/storage/local-media-store-lock-recovery.d.ts +15 -0
  206. package/dist/src/storage/local-media-store-lock-recovery.js +112 -0
  207. package/dist/src/storage/local-media-store-lock-recovery.js.map +1 -0
  208. package/dist/src/storage/local-media-store-persistence.d.ts +48 -0
  209. package/dist/src/storage/local-media-store-persistence.js +443 -0
  210. package/dist/src/storage/local-media-store-persistence.js.map +1 -0
  211. package/dist/src/storage/local-media-store-quota.d.ts +6 -0
  212. package/dist/src/storage/local-media-store-quota.js +66 -0
  213. package/dist/src/storage/local-media-store-quota.js.map +1 -0
  214. package/dist/src/storage/local-media-store-reservations.d.ts +55 -0
  215. package/dist/src/storage/local-media-store-reservations.js +377 -0
  216. package/dist/src/storage/local-media-store-reservations.js.map +1 -0
  217. package/dist/src/storage/local-media-store-types.d.ts +110 -0
  218. package/dist/src/storage/local-media-store-types.js +35 -0
  219. package/dist/src/storage/local-media-store-types.js.map +1 -0
  220. package/dist/src/storage/local-media-store-validation.d.ts +34 -0
  221. package/dist/src/storage/local-media-store-validation.js +449 -0
  222. package/dist/src/storage/local-media-store-validation.js.map +1 -0
  223. package/dist/src/storage/local-media-store.d.ts +47 -0
  224. package/dist/src/storage/local-media-store.js +353 -0
  225. package/dist/src/storage/local-media-store.js.map +1 -0
  226. package/dist/src/storage/media-admission-service.d.ts +49 -0
  227. package/dist/src/storage/media-admission-service.js +333 -0
  228. package/dist/src/storage/media-admission-service.js.map +1 -0
  229. package/dist/src/storage/media-lifecycle-metrics.d.ts +75 -0
  230. package/dist/src/storage/media-lifecycle-metrics.js +105 -0
  231. package/dist/src/storage/media-lifecycle-metrics.js.map +1 -0
  232. package/dist/src/storage/media-reference-lifecycle.d.ts +16 -0
  233. package/dist/src/storage/media-reference-lifecycle.js +84 -0
  234. package/dist/src/storage/media-reference-lifecycle.js.map +1 -0
  235. package/dist/src/storage/request-media-resolver.d.ts +67 -0
  236. package/dist/src/storage/request-media-resolver.js +325 -0
  237. package/dist/src/storage/request-media-resolver.js.map +1 -0
  238. package/dist/src/storage/session-media-service-factories.d.ts +19 -0
  239. package/dist/src/storage/session-media-service-factories.js +34 -0
  240. package/dist/src/storage/session-media-service-factories.js.map +1 -0
  241. package/dist/src/storage/session-persistence-helpers.d.ts +10 -0
  242. package/dist/src/storage/session-persistence-helpers.js +46 -0
  243. package/dist/src/storage/session-persistence-helpers.js.map +1 -0
  244. package/dist/src/test-utils/config.d.ts +2 -0
  245. package/dist/src/test-utils/config.js +5 -5
  246. package/dist/src/test-utils/config.js.map +1 -1
  247. package/dist/src/test-utils/runtime.d.ts +2 -0
  248. package/dist/src/test-utils/runtime.js +1 -2
  249. package/dist/src/test-utils/runtime.js.map +1 -1
  250. package/dist/src/tools-adapters/CoreShellToolHostAdapter.js +1 -9
  251. package/dist/src/tools-adapters/CoreShellToolHostAdapter.js.map +1 -1
  252. package/dist/src/tools-adapters/CoreSkillServiceAdapter.d.ts +0 -2
  253. package/dist/src/tools-adapters/CoreSkillServiceAdapter.js +0 -17
  254. package/dist/src/tools-adapters/CoreSkillServiceAdapter.js.map +1 -1
  255. package/dist/src/tools-adapters/CoreToolHostAdapter.d.ts +0 -21
  256. package/dist/src/tools-adapters/CoreToolHostAdapter.js +0 -8
  257. package/dist/src/tools-adapters/CoreToolHostAdapter.js.map +1 -1
  258. package/dist/src/utils/environmentContext.d.ts +8 -9
  259. package/dist/src/utils/environmentContext.js +11 -22
  260. package/dist/src/utils/environmentContext.js.map +1 -1
  261. package/dist/src/utils/errorParsing.d.ts +1 -2
  262. package/dist/src/utils/errorParsing.js +22 -41
  263. package/dist/src/utils/errorParsing.js.map +1 -1
  264. package/dist/src/utils/generateContentResponseUtilities.js +12 -0
  265. package/dist/src/utils/generateContentResponseUtilities.js.map +1 -1
  266. package/dist/src/utils/summarizer.d.ts +1 -2
  267. package/dist/src/utils/summarizer.js +6 -5
  268. package/dist/src/utils/summarizer.js.map +1 -1
  269. package/dist/src/utils/tool-utils.js +7 -1
  270. package/dist/src/utils/tool-utils.js.map +1 -1
  271. package/index.ts +0 -4
  272. package/package.json +38 -30
  273. package/src/config/agentClientLifecycle.ts +53 -22
  274. package/src/config/config.ts +11 -26
  275. package/src/config/configBase.ts +46 -7
  276. package/src/config/configBaseCore.ts +38 -36
  277. package/src/config/configMcpRuntime.ts +46 -0
  278. package/src/config/configMediaDefaults.ts +19 -0
  279. package/src/config/configTypes.ts +13 -53
  280. package/src/config/index.ts +1 -4
  281. package/src/config/models.ts +0 -6
  282. package/src/config/toolRegistryFactory.ts +2 -2
  283. package/src/core/clientContract.ts +4 -6
  284. package/src/core/compression/transcriptPathNotice.ts +31 -0
  285. package/src/core/contentGenerator.ts +15 -39
  286. package/src/core/logger.ts +370 -39
  287. package/src/core/prompts.ts +4 -114
  288. package/src/core/turn.ts +3 -3
  289. package/src/hooks/hookTranslator.ts +6 -4
  290. package/src/index.ts +7 -7
  291. package/src/llm-types/index.ts +5 -0
  292. package/src/llm-types/modelEnvelope.ts +26 -2
  293. package/src/policy/policies/read-only.toml +0 -5
  294. package/src/prompt-config/TemplateEngine.ts +0 -3
  295. package/src/prompt-config/defaults/providers/gemini/core.md +0 -2
  296. package/src/prompt-config/defaults/providers/gemini/models/gemini-2.5-flash/core.md +0 -2
  297. package/src/prompt-config/defaults/providers/gemini/models/gemini-2.5-flash/gemini-2-5-flash/core.md +0 -2
  298. package/src/prompt-config/prompt-loader.ts +7 -8
  299. package/src/prompt-config/types.ts +0 -1
  300. package/src/recording/CheckpointService.ts +110 -45
  301. package/src/recording/HistoryMutationService.ts +28 -3
  302. package/src/recording/RecordingIntegration.ts +258 -11
  303. package/src/recording/ReplayEngine.ts +220 -110
  304. package/src/recording/SessionDiscovery.ts +30 -4
  305. package/src/recording/SessionRecordingService.ts +253 -55
  306. package/src/recording/SessionTransitionService.ts +75 -12
  307. package/src/recording/index.ts +7 -0
  308. package/src/recording/janitor/cleanupTypes.ts +4 -0
  309. package/src/recording/janitor/mediaReclamation.ts +295 -0
  310. package/src/recording/janitor/sessionJanitor.ts +54 -1
  311. package/src/recording/janitor/sessionScanner.ts +319 -227
  312. package/src/recording/replay-test-helpers.ts +33 -2
  313. package/src/recording/replayCheckpointMetadata.ts +115 -0
  314. package/src/recording/replayErrorFormatting.ts +43 -0
  315. package/src/recording/resumeSession.ts +10 -0
  316. package/src/recording/semanticMediaPurgeReplayValidation.ts +35 -0
  317. package/src/recording/session-media-package-blobs.ts +116 -0
  318. package/src/recording/session-media-package-import.ts +189 -0
  319. package/src/recording/session-media-package-state.ts +120 -0
  320. package/src/recording/session-media-package-validation.ts +400 -0
  321. package/src/recording/session-media-package-writer.ts +117 -0
  322. package/src/recording/session-media-package.ts +692 -0
  323. package/src/recording/types.ts +37 -2
  324. package/src/runtime/AgentRuntimeContext.ts +28 -5
  325. package/src/runtime/AgentRuntimeLoader.ts +32 -7
  326. package/src/runtime/contracts/PromptEstimation.ts +1 -0
  327. package/src/runtime/contracts/RuntimeProvider.ts +3 -8
  328. package/src/runtime/contracts/RuntimeProviderManager.ts +0 -2
  329. package/src/runtime/createAgentRuntimeContext.ts +43 -1
  330. package/src/runtime/providerRuntimeContext.ts +22 -0
  331. package/src/runtime/runtimeAdapters.ts +2 -2
  332. package/src/services/history/ContentConverters.ts +11 -7
  333. package/src/services/history/HistoryService.ts +71 -696
  334. package/src/services/history/HistoryServiceCore.ts +1055 -0
  335. package/src/services/history/IContent.ts +460 -20
  336. package/src/services/history/contentSize.ts +22 -2
  337. package/src/services/history/historyChronology.ts +53 -3
  338. package/src/services/history/historyCloneUtils.ts +26 -22
  339. package/src/services/history/historyCompressionQueue.ts +102 -0
  340. package/src/services/history/historyEventTypes.ts +9 -0
  341. package/src/services/history/historyMutationFailure.ts +33 -0
  342. package/src/services/history/historyProviderPipeline.ts +19 -5
  343. package/src/services/history/historyTokenEstimation.ts +9 -5
  344. package/src/services/history/historyToolNormalization.ts +43 -11
  345. package/src/services/history/provider-file-binding.ts +115 -0
  346. package/src/services/history/semantic-media-purge.ts +593 -0
  347. package/src/storage/SessionPersistenceService.ts +667 -30
  348. package/src/storage/history-media-ownership.ts +185 -0
  349. package/src/storage/local-media-store-child.ts +163 -0
  350. package/src/storage/local-media-store-files.ts +643 -0
  351. package/src/storage/local-media-store-lock-recovery.ts +159 -0
  352. package/src/storage/local-media-store-persistence.ts +737 -0
  353. package/src/storage/local-media-store-quota.ts +111 -0
  354. package/src/storage/local-media-store-reservations.ts +485 -0
  355. package/src/storage/local-media-store-types.ts +161 -0
  356. package/src/storage/local-media-store-validation.ts +643 -0
  357. package/src/storage/local-media-store.ts +696 -0
  358. package/src/storage/media-admission-service.ts +512 -0
  359. package/src/storage/media-lifecycle-metrics.ts +228 -0
  360. package/src/storage/media-reference-lifecycle.ts +164 -0
  361. package/src/storage/request-media-resolver.ts +491 -0
  362. package/src/storage/session-media-service-factories.ts +48 -0
  363. package/src/storage/session-persistence-helpers.ts +85 -0
  364. package/src/test-utils/config.ts +7 -5
  365. package/src/test-utils/runtime.ts +3 -2
  366. package/src/tools-adapters/CoreShellToolHostAdapter.ts +1 -11
  367. package/src/tools-adapters/CoreSkillServiceAdapter.ts +0 -23
  368. package/src/tools-adapters/CoreToolHostAdapter.ts +0 -36
  369. package/src/utils/environmentContext.ts +11 -30
  370. package/src/utils/errorParsing.ts +19 -69
  371. package/src/utils/generateContentResponseUtilities.ts +28 -1
  372. package/src/utils/summarizer.ts +8 -10
  373. package/src/utils/tool-utils.ts +7 -1
  374. package/dist/src/code_assist/codeAssist.d.ts +0 -19
  375. package/dist/src/code_assist/codeAssist.js +0 -41
  376. package/dist/src/code_assist/codeAssist.js.map +0 -1
  377. package/dist/src/code_assist/contentGeneratorAdapters.d.ts +0 -49
  378. package/dist/src/code_assist/contentGeneratorAdapters.js +0 -197
  379. package/dist/src/code_assist/contentGeneratorAdapters.js.map +0 -1
  380. package/dist/src/code_assist/converter.d.ts +0 -74
  381. package/dist/src/code_assist/converter.js +0 -158
  382. package/dist/src/code_assist/converter.js.map +0 -1
  383. package/dist/src/code_assist/googleGenAIWrapper.d.ts +0 -27
  384. package/dist/src/code_assist/googleGenAIWrapper.js +0 -46
  385. package/dist/src/code_assist/googleGenAIWrapper.js.map +0 -1
  386. package/dist/src/code_assist/oauth-credential-storage.d.ts +0 -30
  387. package/dist/src/code_assist/oauth-credential-storage.js +0 -135
  388. package/dist/src/code_assist/oauth-credential-storage.js.map +0 -1
  389. package/dist/src/code_assist/server.d.ts +0 -44
  390. package/dist/src/code_assist/server.js +0 -154
  391. package/dist/src/code_assist/server.js.map +0 -1
  392. package/dist/src/code_assist/setup.d.ts +0 -20
  393. package/dist/src/code_assist/setup.js +0 -126
  394. package/dist/src/code_assist/setup.js.map +0 -1
  395. package/dist/src/code_assist/types.d.ts +0 -161
  396. package/dist/src/code_assist/types.js +0 -46
  397. package/dist/src/code_assist/types.js.map +0 -1
  398. package/dist/src/utils/getFolderStructure.d.ts +0 -31
  399. package/dist/src/utils/getFolderStructure.js +0 -240
  400. package/dist/src/utils/getFolderStructure.js.map +0 -1
  401. package/dist/src/utils/installationManager.d.ts +0 -16
  402. package/dist/src/utils/installationManager.js +0 -51
  403. package/dist/src/utils/installationManager.js.map +0 -1
  404. package/dist/src/utils/llm-edit-fixer.d.ts +0 -25
  405. package/dist/src/utils/llm-edit-fixer.js +0 -120
  406. package/dist/src/utils/llm-edit-fixer.js.map +0 -1
  407. package/src/code_assist/codeAssist.ts +0 -59
  408. package/src/code_assist/contentGeneratorAdapters.ts +0 -275
  409. package/src/code_assist/converter.ts +0 -288
  410. package/src/code_assist/googleGenAIWrapper.ts +0 -90
  411. package/src/code_assist/oauth-credential-storage.ts +0 -171
  412. package/src/code_assist/server.ts +0 -263
  413. package/src/code_assist/setup.ts +0 -189
  414. package/src/code_assist/types.ts +0 -201
  415. package/src/utils/getFolderStructure.ts +0 -382
  416. package/src/utils/installationManager.ts +0 -59
  417. package/src/utils/llm-edit-fixer.ts +0 -157
@@ -205,22 +205,12 @@ export class CoreShellToolHostAdapter implements IShellToolHost {
205
205
  signal: AbortSignal,
206
206
  tokenBudget?: number,
207
207
  ): Promise<string> {
208
- const contentGenConfig = this.config.getContentGeneratorConfig();
209
- if (contentGenConfig?.providerManager === undefined) {
210
- return content;
211
- }
212
-
213
- const serverToolsProvider =
214
- contentGenConfig.providerManager.getServerToolsProvider();
215
- if (serverToolsProvider == null || serverToolsProvider.name !== 'gemini') {
216
- return content;
217
- }
218
-
219
208
  return summarizeToolOutput(
220
209
  content,
221
210
  this.config.getAgentClient(),
222
211
  signal,
223
212
  tokenBudget,
213
+ this.config.getUtilityModel(),
224
214
  );
225
215
  }
226
216
 
@@ -12,7 +12,6 @@ import type {
12
12
  SkillManager as ToolsSkillManager,
13
13
  } from '@vybestack/llxprt-code-tools';
14
14
  import type { Config } from '../config/config.js';
15
- import { getFolderStructure } from '../utils/getFolderStructure.js';
16
15
  import type { SkillDefinition } from '../skills/skillLoader.js';
17
16
 
18
17
  function toSkillInfo(skill: SkillDefinition): SkillInfo {
@@ -24,8 +23,6 @@ function toSkillInfo(skill: SkillDefinition): SkillInfo {
24
23
  }
25
24
 
26
25
  export class CoreSkillServiceAdapter implements ISkillService {
27
- private folderStructureCache = new Map<string, string>();
28
-
29
26
  constructor(private readonly config: Config) {}
30
27
 
31
28
  async activateSkill(name: string): Promise<SkillActivationResult> {
@@ -46,14 +43,12 @@ export class CoreSkillServiceAdapter implements ISkillService {
46
43
  skillManager.activateSkill(name);
47
44
  const resourceDirectory = path.dirname(skill.location);
48
45
  this.config.getWorkspaceContext().addDirectory(resourceDirectory);
49
- const folderStructure = await this.getFolderStructure(name);
50
46
 
51
47
  return {
52
48
  success: true,
53
49
  instructions: skill.body,
54
50
  description: skill.description,
55
51
  location: skill.location,
56
- folderStructure,
57
52
  resourceDirectory,
58
53
  };
59
54
  }
@@ -82,22 +77,4 @@ export class CoreSkillServiceAdapter implements ISkillService {
82
77
  const skill = this.config.getSkillManager().getSkill(name);
83
78
  return skill ? toSkillInfo(skill) : null;
84
79
  }
85
-
86
- async getFolderStructure(skillName: string): Promise<string> {
87
- const cached = this.folderStructureCache.get(skillName);
88
- if (cached !== undefined) {
89
- return cached;
90
- }
91
-
92
- const skill = this.config.getSkillManager().getSkill(skillName);
93
- if (!skill) {
94
- return '';
95
- }
96
-
97
- const folderStructure = await getFolderStructure(
98
- path.dirname(skill.location),
99
- );
100
- this.folderStructureCache.set(skillName, folderStructure);
101
- return folderStructure;
102
- }
103
80
  }
@@ -45,23 +45,6 @@ export interface CoreToolHostConfig {
45
45
  getFileSystemService(): IToolHostFileSystemService;
46
46
  getConversationLoggingEnabled(): boolean;
47
47
  getDebugMode(): boolean;
48
- getContentGeneratorConfig():
49
- | {
50
- providerManager?: {
51
- getServerToolsProvider?():
52
- | {
53
- getServerTools: () => string[];
54
- invokeServerTool: (
55
- name: string,
56
- params: { prompt: string },
57
- options: { signal: AbortSignal },
58
- ) => Promise<unknown>;
59
- }
60
- | null
61
- | undefined;
62
- };
63
- }
64
- | undefined;
65
48
  }
66
49
 
67
50
  export class CoreToolHostAdapter implements IToolHost {
@@ -172,23 +155,4 @@ export class CoreToolHostAdapter implements IToolHost {
172
155
  getDebugMode(): boolean {
173
156
  return this.config.getDebugMode();
174
157
  }
175
-
176
- getServerToolsProvider(): {
177
- getServerTools: () => string[];
178
- invokeServerTool: (
179
- name: string,
180
- params: { prompt: string },
181
- options: { signal: AbortSignal },
182
- ) => Promise<unknown>;
183
- } | null {
184
- return (
185
- this.config
186
- .getContentGeneratorConfig()
187
- ?.providerManager?.getServerToolsProvider?.() ?? null
188
- );
189
- }
190
-
191
- hasProviderManager(): boolean {
192
- return this.config.getContentGeneratorConfig()?.providerManager != null;
193
- }
194
158
  }
@@ -1,34 +1,20 @@
1
1
  /**
2
2
  * @license
3
- * Copyright 2025 Google LLC
3
+ * Copyright 2026 Vybestack LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
7
  import type { Config } from '../config/config.js';
8
- import { getFolderStructure } from './getFolderStructure.js';
9
-
10
- export const INITIAL_HISTORY_LENGTH = 1;
11
8
 
12
9
  /**
13
- * Generates a string describing the current workspace directories and their structures.
14
- * @param {Config} config - The runtime configuration and services.
15
- * @returns {Promise<string>} A promise that resolves to the directory context string.
10
+ * Returns the working-directory preamble for the environment context: a single
11
+ * directory line, or a bulleted list for multiple directories. Folder-tree
12
+ * listing is removed (issue #3072); this only names the working directories.
16
13
  */
17
14
  export async function getDirectoryContextString(
18
15
  config: Config,
19
16
  ): Promise<string> {
20
- const workspaceContext = config.getWorkspaceContext();
21
- const workspaceDirectories = workspaceContext.getDirectories();
22
-
23
- const folderStructures = await Promise.all(
24
- workspaceDirectories.map((dir) =>
25
- getFolderStructure(dir, {
26
- fileService: config.getFileService(),
27
- }),
28
- ),
29
- );
30
-
31
- const folderStructure = folderStructures.join('\n');
17
+ const workspaceDirectories = config.getWorkspaceContext().getDirectories();
32
18
 
33
19
  let workingDirPreamble: string;
34
20
  if (workspaceDirectories.length === 1) {
@@ -38,18 +24,15 @@ export async function getDirectoryContextString(
38
24
  workingDirPreamble = `I'm currently working in the following directories:\n${dirList}`;
39
25
  }
40
26
 
41
- return `${workingDirPreamble}
42
- Here is the folder structure of the current working directories:
43
-
44
- ${folderStructure}`;
27
+ return workingDirPreamble;
45
28
  }
46
29
 
47
30
  /**
48
- * Retrieves environment-related information to be included in the chat context.
49
- * This includes the current working directory, date, operating system, and folder structure.
50
- * Optionally, it can also include the full file context if enabled.
31
+ * Retrieves environment-related information to be included in the chat context:
32
+ * program identity, locale date, platform, working-directory preamble, and
33
+ * environment memory. No folder-tree listing is produced.
51
34
  * @param {Config} config - The runtime configuration and services.
52
- * @returns A promise that resolves to an array of text parts containing environment information.
35
+ * @returns A promise that resolves to a single text part with the environment info.
53
36
  */
54
37
  export async function getEnvironmentContext(
55
38
  config: Config,
@@ -73,7 +56,5 @@ ${directoryContext}
73
56
  ${environmentMemory}
74
57
  `.trim();
75
58
 
76
- const initialParts: Array<{ text: string }> = [{ text: context }];
77
-
78
- return initialParts;
59
+ return [{ text: context }];
79
60
  }
@@ -12,51 +12,31 @@ import {
12
12
  type ApiError,
13
13
  } from './quotaErrorDetection.js';
14
14
  import type { StructuredError } from '../core/turn.js';
15
- import { DEFAULT_GEMINI_MODEL } from '../config/models.js';
16
- import { UserTierId } from '../code_assist/types.js';
17
15
  import { getErrorStatus, STREAM_INTERRUPTED_ERROR_CODE } from './retry.js';
18
16
 
19
- // Shared quota/auth guidance strings
20
- const AUTH_QUOTA_DOC_URL =
17
+ const QUOTA_DOC_URL =
21
18
  'https://github.com/vybestack/llxprt-code/blob/main/docs/getting-started.md';
22
- const AI_STUDIO_KEY_URL = 'https://aistudio.google.com/apikey';
23
- const FREE_TIER_GUIDANCE = `For more information about authentication and quota limits, see ${AUTH_QUOTA_DOC_URL}, or use /auth to switch to using a paid API key from AI Studio at ${AI_STUDIO_KEY_URL}`;
24
- const PAID_TIER_THANKS =
25
- 'We appreciate you for choosing Gemini Code Assist and the Gemini CLI.';
26
- const PAID_TIER_AUTH_HINT = `consider using /auth to switch to using a paid API key from AI Studio at ${AI_STUDIO_KEY_URL}`;
19
+ const QUOTA_GUIDANCE = `For more information about quota limits, see ${QUOTA_DOC_URL}`;
27
20
 
28
21
  // Provider-neutral rate limit message (used when no Google-specific quota detector matches)
29
22
  const GENERIC_RATE_LIMIT_MESSAGE =
30
23
  '\nRate limit exceeded. Please wait a moment and retry, or use /model to switch to a different model.';
31
24
 
32
- const getRateLimitErrorMessageAnthropicFree = () =>
33
- '\nAnthropic rate limit exceeded. LLxprt Code retries rate-limited requests with backoff when possible. Please wait before retrying manually.';
34
-
35
- const getRateLimitErrorMessageAnthropicPaid = () =>
25
+ const getRateLimitErrorMessageAnthropic = () =>
36
26
  '\nAnthropic rate limit exceeded. LLxprt Code retries rate-limited requests with backoff when possible. Please wait before retrying manually or check your Anthropic plan limits.';
37
27
 
38
28
  const getRateLimitErrorMessageGeneric = () =>
39
29
  '\nRate limit exceeded. LLxprt Code retries rate-limited requests with backoff when possible. Please wait before retrying manually.';
40
30
 
41
- // Google Free Tier message functions
42
- const getRateLimitErrorMessageGoogleProQuotaFree = (
43
- currentModel: string = DEFAULT_GEMINI_MODEL,
44
- ) =>
45
- `\nYou have reached your daily ${currentModel} quota limit. ${FREE_TIER_GUIDANCE}`;
46
-
47
- const getRateLimitErrorMessageGoogleGenericQuotaFree = () =>
48
- `\nYou have reached your daily quota limit. ${FREE_TIER_GUIDANCE}`;
31
+ const getRateLimitErrorMessageGoogleProQuota = (
32
+ currentModel: string | undefined,
33
+ ) => {
34
+ const model = currentModel ? `${currentModel} ` : '';
35
+ return `\nYou have reached your daily ${model}quota limit. ${QUOTA_GUIDANCE}`;
36
+ };
49
37
 
50
- // Google Legacy/Standard Tier message functions
51
- const getRateLimitErrorMessageGoogleProQuotaPaid = (
52
- currentModel: string = DEFAULT_GEMINI_MODEL,
53
- ) =>
54
- `\nYou have reached your daily ${currentModel} quota limit. ${PAID_TIER_THANKS} To continue accessing the ${currentModel} model today, ${PAID_TIER_AUTH_HINT}`;
55
-
56
- const getRateLimitErrorMessageGoogleGenericQuotaPaid = (
57
- currentModel: string = DEFAULT_GEMINI_MODEL,
58
- ) =>
59
- `\nYou have reached your daily quota limit. ${PAID_TIER_THANKS} To continue accessing the ${currentModel} model today, ${PAID_TIER_AUTH_HINT}`;
38
+ const getRateLimitErrorMessageGoogleGenericQuota = () =>
39
+ `\nYou have reached your daily quota limit. ${QUOTA_GUIDANCE}`;
60
40
 
61
41
  function buildStatusSuffix(status?: number, statusLabel?: string): string {
62
42
  const parts: string[] = [];
@@ -173,40 +153,25 @@ function getProviderFamily(
173
153
 
174
154
  function getRateLimitMessage(
175
155
  error?: unknown,
176
- userTier?: UserTierId,
177
156
  currentModel?: string,
178
157
  providerName?: string,
179
158
  ): string {
180
- // Determine if user is on a paid tier (Legacy or Standard) - default to FREE if not specified
181
- const isPaidTier =
182
- userTier === UserTierId.LEGACY || userTier === UserTierId.STANDARD;
183
159
  const providerFamily = getProviderFamily(providerName, currentModel);
184
160
 
185
161
  if (providerFamily === 'anthropic') {
186
- return isPaidTier
187
- ? getRateLimitErrorMessageAnthropicPaid()
188
- : getRateLimitErrorMessageAnthropicFree();
162
+ return getRateLimitErrorMessageAnthropic();
189
163
  }
190
164
 
191
165
  if (providerFamily !== undefined && providerFamily !== 'gemini') {
192
166
  return getRateLimitErrorMessageGeneric();
193
167
  }
194
168
 
195
- const effectiveModel =
196
- currentModel === undefined || currentModel === ''
197
- ? DEFAULT_GEMINI_MODEL
198
- : currentModel;
199
-
200
169
  if (isProQuotaExceededError(error)) {
201
- return isPaidTier
202
- ? getRateLimitErrorMessageGoogleProQuotaPaid(effectiveModel)
203
- : getRateLimitErrorMessageGoogleProQuotaFree(effectiveModel);
170
+ return getRateLimitErrorMessageGoogleProQuota(currentModel);
204
171
  }
205
172
 
206
173
  if (isGenericQuotaExceededError(error)) {
207
- return isPaidTier
208
- ? getRateLimitErrorMessageGoogleGenericQuotaPaid(effectiveModel)
209
- : getRateLimitErrorMessageGoogleGenericQuotaFree();
174
+ return getRateLimitErrorMessageGoogleGenericQuota();
210
175
  }
211
176
 
212
177
  return GENERIC_RATE_LIMIT_MESSAGE;
@@ -226,21 +191,19 @@ function formatStreamInterruptedError(error: unknown): string {
226
191
 
227
192
  function formatStructuredApiError(
228
193
  error: StructuredError,
229
- userTier?: UserTierId,
230
194
  currentModel?: string,
231
195
  providerName?: string,
232
196
  ): string {
233
197
  const status = getErrorStatus(error);
234
198
  let text = `[API Error: ${formatErrorMessageWithStatus(error.message, status)}]`;
235
199
  if (status === 429) {
236
- text += getRateLimitMessage(error, userTier, currentModel, providerName);
200
+ text += getRateLimitMessage(error, currentModel, providerName);
237
201
  }
238
202
  return text;
239
203
  }
240
204
 
241
205
  function formatStringApiError(
242
206
  error: string,
243
- userTier?: UserTierId,
244
207
  currentModel?: string,
245
208
  providerName?: string,
246
209
  ): string {
@@ -251,7 +214,6 @@ function formatStringApiError(
251
214
 
252
215
  const parsedMessage = formatEmbeddedJsonApiError(
253
216
  error.substring(jsonStart),
254
- userTier,
255
217
  currentModel,
256
218
  providerName,
257
219
  );
@@ -260,7 +222,6 @@ function formatStringApiError(
260
222
 
261
223
  function formatEmbeddedJsonApiError(
262
224
  jsonString: string,
263
- userTier?: UserTierId,
264
225
  currentModel?: string,
265
226
  providerName?: string,
266
227
  ): string | undefined {
@@ -280,12 +241,7 @@ function formatEmbeddedJsonApiError(
280
241
  );
281
242
  let text = `[API Error: ${finalMessage}${statusSuffix}]`;
282
243
  if (isRateLimitApiError(parsedError)) {
283
- text += getRateLimitMessage(
284
- parsedError,
285
- userTier,
286
- currentModel,
287
- providerName,
288
- );
244
+ text += getRateLimitMessage(parsedError, currentModel, providerName);
289
245
  }
290
246
  return text;
291
247
  }
@@ -325,7 +281,6 @@ function extractNestedApiErrorMessage(message: string): string {
325
281
 
326
282
  export function parseAndFormatApiError(
327
283
  error: unknown,
328
- userTier?: UserTierId,
329
284
  currentModel?: string,
330
285
  providerName?: string,
331
286
  ): string {
@@ -335,16 +290,11 @@ export function parseAndFormatApiError(
335
290
  }
336
291
 
337
292
  if (isStructuredError(error)) {
338
- return formatStructuredApiError(
339
- error,
340
- userTier,
341
- currentModel,
342
- providerName,
343
- );
293
+ return formatStructuredApiError(error, currentModel, providerName);
344
294
  }
345
295
 
346
296
  if (typeof error === 'string') {
347
- return formatStringApiError(error, userTier, currentModel, providerName);
297
+ return formatStringApiError(error, currentModel, providerName);
348
298
  }
349
299
 
350
300
  const fallbackStatus = getErrorStatus(error);
@@ -352,7 +302,7 @@ export function parseAndFormatApiError(
352
302
  if (fallbackStatusSuffix) {
353
303
  let text = `[API Error: An unknown error occurred.${fallbackStatusSuffix}]`;
354
304
  if (fallbackStatus === 429) {
355
- text += getRateLimitMessage(error, userTier, currentModel, providerName);
305
+ text += getRateLimitMessage(error, currentModel, providerName);
356
306
  }
357
307
  return text;
358
308
  }
@@ -225,7 +225,22 @@ interface LegacyPartLike {
225
225
  | { id?: string; name?: string; response?: unknown }
226
226
  | undefined;
227
227
  inlineData?:
228
- | { mimeType?: string; data?: string; displayName?: string }
228
+ | {
229
+ mimeType?: string;
230
+ data?: string;
231
+ displayName?: string;
232
+ originalData?: string;
233
+ originalMimeType?: string;
234
+ originalDimensions?: {
235
+ readonly width: number;
236
+ readonly height: number;
237
+ };
238
+ transformation?: {
239
+ readonly policyId: string;
240
+ readonly policyVersion: number;
241
+ readonly parameters: Readonly<Record<string, number>>;
242
+ };
243
+ }
229
244
  | undefined;
230
245
  fileData?: { fileUri?: string; mimeType?: string } | undefined;
231
246
  }
@@ -318,6 +333,18 @@ function legacyPartToBlocks(part: LegacyPartLike): ContentBlock[] {
318
333
  ...(part.inlineData.displayName
319
334
  ? { filename: part.inlineData.displayName }
320
335
  : {}),
336
+ ...(part.inlineData.originalData === undefined
337
+ ? {}
338
+ : { originalData: part.inlineData.originalData }),
339
+ ...(part.inlineData.originalMimeType === undefined
340
+ ? {}
341
+ : { originalMimeType: part.inlineData.originalMimeType }),
342
+ ...(part.inlineData.originalDimensions === undefined
343
+ ? {}
344
+ : { originalDimensions: part.inlineData.originalDimensions }),
345
+ ...(part.inlineData.transformation === undefined
346
+ ? {}
347
+ : { transformation: part.inlineData.transformation }),
321
348
  },
322
349
  ];
323
350
  }
@@ -10,8 +10,6 @@ import type {
10
10
  AgentClientGenerateConfig,
11
11
  } from '../core/clientContract.js';
12
12
  import type { IContent } from '../services/history/IContent.js';
13
- import { DEFAULT_GEMINI_FLASH_LITE_MODEL } from '../config/models.js';
14
- import { partToString } from './partUtils.js';
15
13
  import { getResponseTextFromBlocks } from './generateContentResponseUtilities.js';
16
14
  import { debugLogger } from './debugLogger.js';
17
15
 
@@ -55,24 +53,24 @@ Text to summarize:
55
53
  Return the summary string which should first contain an overall summarization of text followed by the full stack trace of errors and warnings in the tool output.
56
54
  `;
57
55
 
58
- export const llmSummarizer: Summarizer = (result, agentClient, abortSignal) =>
59
- summarizeToolOutput(
60
- partToString(result.llmContent),
61
- agentClient,
62
- abortSignal,
63
- );
64
-
65
56
  export async function summarizeToolOutput(
66
57
  textToSummarize: string,
67
58
  agentClient: AgentClientContract,
68
59
  abortSignal: AbortSignal,
69
60
  maxOutputTokens: number = 2000,
61
+ utilityModel?: string,
70
62
  ): Promise<string> {
71
63
  // There is going to be a slight difference here since we are comparing length of string with maxOutputTokens.
72
64
  // This is meant to be a ballpark estimation of if we need to summarize the tool output.
73
65
  if (!textToSummarize || textToSummarize.length < maxOutputTokens) {
74
66
  return textToSummarize;
75
67
  }
68
+ if (!utilityModel || utilityModel.trim() === '') {
69
+ debugLogger.log(
70
+ 'summarizeToolOutput enabled but no utilityModel configured — skipping',
71
+ );
72
+ return textToSummarize;
73
+ }
76
74
  const prompt = SUMMARIZE_TOOL_OUTPUT_PROMPT.replace(
77
75
  '{maxOutputTokens}',
78
76
  String(maxOutputTokens),
@@ -89,7 +87,7 @@ export async function summarizeToolOutput(
89
87
  contents,
90
88
  toolOutputSummarizerConfig,
91
89
  abortSignal,
92
- DEFAULT_GEMINI_FLASH_LITE_MODEL,
90
+ utilityModel,
93
91
  );
94
92
  const responseText = getResponseTextFromBlocks(
95
93
  parsedResponse.content.blocks,
@@ -83,7 +83,11 @@ function matchesToolPattern(
83
83
  if (!('command' in invocation.params)) {
84
84
  return false;
85
85
  }
86
- command = String((invocation.params as { command: string }).command);
86
+ const commandValue = (invocation.params as { command?: unknown }).command;
87
+ if (typeof commandValue !== 'string') {
88
+ return false;
89
+ }
90
+ command = commandValue;
87
91
  }
88
92
 
89
93
  // PowerShell command resolution is case-insensitive; Bash is case-sensitive.
@@ -138,6 +142,8 @@ export function isShellInvocationAllowlisted(
138
142
  return true;
139
143
  }
140
144
 
145
+ // AnyToolInvocation.params is an intentionally shape-less `object` boundary, so
146
+ // widen to unknown before structural checks.
141
147
  const params = invocation.params as unknown;
142
148
  if (typeof params !== 'object' || params === null || !('command' in params)) {
143
149
  return false;
@@ -1,19 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import type { ContentGenerator } from '../core/contentGenerator.js';
7
- import { CodeAssistServer } from './server.js';
8
- import type { Config } from '../config/config.js';
9
- export interface CodeAssistServerSource {
10
- getAgentClient(): {
11
- getContentGenerator(): ContentGenerator;
12
- } | null | undefined;
13
- }
14
- export declare function getCodeAssistServer(config: CodeAssistServerSource): CodeAssistServer | undefined;
15
- /**
16
- * Emits a citation event if citation display is enabled for the current user.
17
- * This function integrates with llxprt's provider abstraction to work across all providers.
18
- */
19
- export declare function emitCitationEvent(config: Config, citationText: string): void;
@@ -1,41 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { CodeAssistServer } from './server.js';
7
- import { debugLogger } from '../utils/debugLogger.js';
8
- export function getCodeAssistServer(config) {
9
- const agentClient = config.getAgentClient();
10
- if (!agentClient) {
11
- return undefined;
12
- }
13
- const generator = agentClient.getContentGenerator();
14
- // Direct CodeAssistServer (e.g. in tests or legacy wiring)
15
- if (generator instanceof CodeAssistServer) {
16
- return generator;
17
- }
18
- // Structural fallback: some test mocks and legacy wiring produce plain
19
- // objects that carry projectId. Detect them structurally so the privacy
20
- // settings hook continues to work.
21
- if (typeof generator === 'object' && 'projectId' in generator) {
22
- return generator;
23
- }
24
- return undefined;
25
- }
26
- /**
27
- * Emits a citation event if citation display is enabled for the current user.
28
- * This function integrates with llxprt's provider abstraction to work across all providers.
29
- */
30
- export function emitCitationEvent(config, citationText) {
31
- const providerManager = config.getProviderManager();
32
- if (providerManager) {
33
- try {
34
- debugLogger.debug('Citation event would be emitted:', citationText);
35
- }
36
- catch (error) {
37
- debugLogger.debug('Failed to emit citation event:', error);
38
- }
39
- }
40
- }
41
- //# sourceMappingURL=codeAssist.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codeAssist.js","sourceRoot":"","sources":["../../../src/code_assist/codeAssist.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAWtD,MAAM,UAAU,mBAAmB,CACjC,MAA8B;IAE9B,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC;IAC5C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,SAAS,GAAG,WAAW,CAAC,mBAAmB,EAAE,CAAC;IAEpD,2DAA2D;IAC3D,IAAI,SAAS,YAAY,gBAAgB,EAAE,CAAC;QAC1C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,uEAAuE;IACvE,wEAAwE;IACxE,mCAAmC;IACnC,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,WAAW,IAAI,SAAS,EAAE,CAAC;QAC9D,OAAO,SAAwC,CAAC;IAClD,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,YAAoB;IACpE,MAAM,eAAe,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC;IACpD,IAAI,eAAe,EAAE,CAAC;QACpB,IAAI,CAAC;YACH,WAAW,CAAC,KAAK,CAAC,kCAAkC,EAAE,YAAY,CAAC,CAAC;QACtE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,49 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * Gemini boundary conversion helpers. This file lives inside the code_assist
8
- * enclave, so importing @google/genai is permitted. It converts between the
9
- * neutral llm-types request/response shapes and the Google SDK shapes so that
10
- * the neutral ContentGenerator interface can be implemented without leaking
11
- * Google types to callers.
12
- */
13
- import { type GenerateContentParameters, type CountTokensParameters, type CountTokensResponse, type EmbedContentResponse, type GenerateContentResponse, type Candidate, type Part } from '@google/genai';
14
- import type { ModelGenerationRequest } from '../llm-types/modelRequest.js';
15
- import type { ModelOutput } from '../llm-types/modelEnvelope.js';
16
- import type { CountTokensRequest, CountTokensResult, EmbedContentResult } from '../llm-types/tokensAndEmbeddings.js';
17
- /**
18
- * Convert a neutral ModelGenerationRequest to Google GenerateContentParameters.
19
- *
20
- * Settings are mapped first; modelParams is spread LAST so explicit provider
21
- * extras win over the neutral settings mapping.
22
- */
23
- export declare function toGenerateContentParameters(request: ModelGenerationRequest): GenerateContentParameters;
24
- /**
25
- * Convert a Google GenerateContentResponse to a neutral ModelOutput.
26
- */
27
- export declare function fromGenerateContentResponse(response: GenerateContentResponse): ModelOutput;
28
- /**
29
- * Convert a neutral CountTokensRequest to Google CountTokensParameters.
30
- * model is optional since the neutral type does not carry it.
31
- */
32
- export declare function toCountTokensParameters(request: CountTokensRequest, model?: string): CountTokensParameters;
33
- /**
34
- * Convert a Google CountTokensResponse to neutral CountTokensResult.
35
- */
36
- export declare function fromCountTokensResponse(response: CountTokensResponse): CountTokensResult;
37
- /**
38
- * Convert a Google EmbedContentResponse to neutral EmbedContentResult.
39
- */
40
- export declare function fromEmbedContentResponse(response: EmbedContentResponse): EmbedContentResult;
41
- /**
42
- * Stream wrapper: maps each Google response chunk through
43
- * fromGenerateContentResponse to produce neutral ModelStreamChunk values.
44
- */
45
- export declare function mapGeminiStreamToChunks(stream: AsyncIterable<GenerateContentResponse>): AsyncGenerator<ReturnType<typeof fromGenerateContentResponse>>;
46
- /**
47
- * Helper to extract the raw parts array from a candidate for testing/diagnostics.
48
- */
49
- export declare function extractPartsFromCandidate(candidate: Candidate | undefined): Part[];