@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
@@ -0,0 +1,31 @@
1
+ /**
2
+ * ConfigBaseCore — field declarations and simple single-delegation accessors.
3
+ * ConfigBase extends this and adds abstract methods + complex multi-line logic.
4
+ */
5
+ /** MCP runtime accessors: each reads only the client manager, so they live
6
+ * outside the config class. */
7
+ export function mcpRuntimeStatus(manager) {
8
+ if (manager === undefined)
9
+ return undefined;
10
+ return {
11
+ servers: manager.getMcpServers(),
12
+ discoveryFailures: manager.getDiscoveryFailures(),
13
+ discoveryState: manager.getDiscoveryState(),
14
+ };
15
+ }
16
+ export async function refreshMcpServers(manager, server) {
17
+ if (manager === undefined)
18
+ return;
19
+ if (server === undefined) {
20
+ await manager.restart();
21
+ return;
22
+ }
23
+ await manager.restartServer(server);
24
+ }
25
+ export async function awaitMcpDiscoveryGate(manager) {
26
+ if (manager === undefined)
27
+ return new Map();
28
+ await manager.whenDiscoverySettled();
29
+ return manager.getDiscoveryFailures();
30
+ }
31
+ //# sourceMappingURL=configMcpRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configMcpRuntime.js","sourceRoot":"","sources":["../../../src/config/configMcpRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH;+BAC+B;AAC/B,MAAM,UAAU,gBAAgB,CAC9B,OAAqC;IAErC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5C,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE;QAChC,iBAAiB,EAAE,OAAO,CAAC,oBAAoB,EAAE;QACjD,cAAc,EAAE,OAAO,CAAC,iBAAiB,EAAE;KAC5C,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAAqC,EACrC,MAAe;IAEf,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO;IAClC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IACD,MAAM,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAAqC;IAErC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,GAAG,EAAE,CAAC;IAC5C,MAAM,OAAO,CAAC,oBAAoB,EAAE,CAAC;IACrC,OAAO,OAAO,CAAC,oBAAoB,EAAE,CAAC;AACxC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Vybestack LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export declare abstract class ConfigMediaDefaults {
7
+ getSessionRecordingQueueByteLimit(): number;
8
+ getSessionPersistenceQueueByteLimit(): number;
9
+ getMediaStoreQuotaByteLimit(): number;
10
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Vybestack LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export class ConfigMediaDefaults {
7
+ getSessionRecordingQueueByteLimit() {
8
+ return 16 * 1024 * 1024;
9
+ }
10
+ getSessionPersistenceQueueByteLimit() {
11
+ return 16 * 1024 * 1024;
12
+ }
13
+ getMediaStoreQuotaByteLimit() {
14
+ return 4 * 1024 * 1024 * 1024;
15
+ }
16
+ }
17
+ //# sourceMappingURL=configMediaDefaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configMediaDefaults.js","sourceRoot":"","sources":["../../../src/config/configMediaDefaults.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,OAAgB,mBAAmB;IACvC,iCAAiC;QAC/B,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,mCAAmC;QACjC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,2BAA2B;QACzB,OAAO,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAChC,CAAC;CACF"}
@@ -111,6 +111,8 @@ export declare function buildSettingsMockBody(): {
111
111
  getProtectedSettingKeys: typeof SettingsModule.getProtectedSettingKeys;
112
112
  getProviderConfigKeys: typeof SettingsModule.getProviderConfigKeys;
113
113
  getDirectSettingSpecs: typeof SettingsModule.getDirectSettingSpecs;
114
+ getApplicationOwnedKeys: typeof SettingsModule.getApplicationOwnedKeys;
115
+ isApplicationOwnedKey: typeof SettingsModule.isApplicationOwnedKey;
114
116
  getInternalSettingKeys: typeof SettingsModule.getInternalSettingKeys;
115
117
  isInternalSettingKey: typeof SettingsModule.isInternalSettingKey;
116
118
  isSessionScopedSettingKey: typeof SettingsModule.isSessionScopedSettingKey;
@@ -127,6 +129,8 @@ export declare function buildSettingsMockBody(): {
127
129
  repairCanonicalProfiles: typeof SettingsModule.repairCanonicalProfiles;
128
130
  CORRUPT_PROVIDER: "load-balancer";
129
131
  parseProfile: typeof SettingsModule.parseProfile;
132
+ parseProfileJson: typeof SettingsModule.parseProfileJson;
133
+ MIN_LOAD_BALANCER_MEMBERS: 1;
130
134
  AuthConfigSchema: import("zod").ZodDiscriminatedUnion<"type", [import("zod").ZodObject<{
131
135
  type: import("zod").ZodLiteral<"oauth">;
132
136
  buckets: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
@@ -19,6 +19,7 @@ import type { SkillDefinition } from '../skills/skillManager.js';
19
19
  */
20
20
  import type { BucketFailureReason } from '../runtime/contracts/BucketFailureReason.js';
21
21
  import type { MCPOAuthConfig } from '@vybestack/llxprt-code-mcp';
22
+ import type { MCPServerConfig } from '@vybestack/llxprt-code-mcp/config/mcpServerConfig.js';
22
23
  import type { OutputFormat } from '../utils/output-format.js';
23
24
  import type { FileFilteringOptions } from './constants.js';
24
25
  import type { EventEmitter } from 'node:events';
@@ -35,7 +36,7 @@ import type { AgentClientFactory } from '../core/clientContract.js';
35
36
  import type { ToolSchedulerFactory } from '../core/toolSchedulerContract.js';
36
37
  import type { TaskToolRegistration } from './toolRegistryFactory.js';
37
38
  import type { MessageBus } from '../confirmation-bus/message-bus.js';
38
- export type { MCPOAuthConfig, AnyToolInvocation, SkillDefinition };
39
+ export type { MCPOAuthConfig, MCPServerConfig, AnyToolInvocation, SkillDefinition, };
39
40
  /**
40
41
  * Registration hook for post-skill-discovery tool registration.
41
42
  *
@@ -186,59 +187,8 @@ export declare function normalizeShellReplacement(value: ShellReplacementMode |
186
187
  export declare const DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD = 4000000;
187
188
  export declare const DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES = 1000;
188
189
  export declare const DEFAULT_IMAGE_PAYLOAD_BUDGET_BYTES: number;
189
- export declare class MCPServerConfig {
190
- readonly command?: string | undefined;
191
- readonly args?: string[] | undefined;
192
- readonly env?: Record<string, string> | undefined;
193
- readonly cwd?: string | undefined;
194
- readonly url?: string | undefined;
195
- readonly httpUrl?: string | undefined;
196
- readonly headers?: Record<string, string> | undefined;
197
- readonly tcp?: string | undefined;
198
- /**
199
- * Transport type for URL-based servers.
200
- * When set, disables automatic HTTP→SSE fallback.
201
- * - 'http' → StreamableHTTPClientTransport
202
- * - 'streamable-http' → alias for 'http' (StreamableHTTPClientTransport)
203
- * - 'sse' → SSEClientTransport
204
- * - omitted → defaults to HTTP with SSE fallback (deprecated; add type explicitly)
205
- *
206
- * Note: 'httpUrl' is deprecated; use 'url' + 'type: "http"' instead.
207
- * @plan PLAN-20250219-GMERGE021.R3.P03
208
- * @requirement REQ-GMERGE021-R3-001
209
- */
210
- readonly type?: "sse" | "http" | "streamable-http" | undefined;
211
- readonly timeout?: number | undefined;
212
- readonly trust?: boolean | undefined;
213
- readonly description?: string | undefined;
214
- readonly includeTools?: string[] | undefined;
215
- readonly excludeTools?: string[] | undefined;
216
- readonly extensionName?: string | undefined;
217
- readonly extension?: LlxprtExtension | undefined;
218
- readonly oauth?: MCPOAuthConfig | undefined;
219
- readonly authProviderType?: AuthProviderType | undefined;
220
- readonly targetAudience?: string | undefined;
221
- readonly targetServiceAccount?: string | undefined;
222
- constructor(command?: string | undefined, args?: string[] | undefined, env?: Record<string, string> | undefined, cwd?: string | undefined, url?: string | undefined, httpUrl?: string | undefined, headers?: Record<string, string> | undefined, tcp?: string | undefined,
223
- /**
224
- * Transport type for URL-based servers.
225
- * When set, disables automatic HTTP→SSE fallback.
226
- * - 'http' → StreamableHTTPClientTransport
227
- * - 'streamable-http' → alias for 'http' (StreamableHTTPClientTransport)
228
- * - 'sse' → SSEClientTransport
229
- * - omitted → defaults to HTTP with SSE fallback (deprecated; add type explicitly)
230
- *
231
- * Note: 'httpUrl' is deprecated; use 'url' + 'type: "http"' instead.
232
- * @plan PLAN-20250219-GMERGE021.R3.P03
233
- * @requirement REQ-GMERGE021-R3-001
234
- */
235
- type?: "sse" | "http" | "streamable-http" | undefined, timeout?: number | undefined, trust?: boolean | undefined, description?: string | undefined, includeTools?: string[] | undefined, excludeTools?: string[] | undefined, extensionName?: string | undefined, extension?: LlxprtExtension | undefined, oauth?: MCPOAuthConfig | undefined, authProviderType?: AuthProviderType | undefined, targetAudience?: string | undefined, targetServiceAccount?: string | undefined);
236
- }
237
- export declare enum AuthProviderType {
238
- DYNAMIC_DISCOVERY = "dynamic_discovery",
239
- GOOGLE_CREDENTIALS = "google_credentials",
240
- SERVICE_ACCOUNT_IMPERSONATION = "service_account_impersonation"
241
- }
190
+ import { AuthProviderType } from '@vybestack/llxprt-code-auth/mcp-auth-provider-type.js';
191
+ export { AuthProviderType };
242
192
  export interface SandboxConfig {
243
193
  command: 'docker' | 'podman' | 'sandbox-exec';
244
194
  image: string;
@@ -29,86 +29,10 @@ export function normalizeShellReplacement(value) {
29
29
  export const DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD = 4_000_000;
30
30
  export const DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES = 1000;
31
31
  export const DEFAULT_IMAGE_PAYLOAD_BUDGET_BYTES = 15 * 1024 * 1024;
32
- export class MCPServerConfig {
33
- command;
34
- args;
35
- env;
36
- cwd;
37
- url;
38
- httpUrl;
39
- headers;
40
- tcp;
41
- type;
42
- timeout;
43
- trust;
44
- description;
45
- includeTools;
46
- excludeTools;
47
- extensionName;
48
- extension;
49
- oauth;
50
- authProviderType;
51
- targetAudience;
52
- targetServiceAccount;
53
- constructor(
54
- // For stdio transport
55
- command, args, env, cwd,
56
- // For sse transport
57
- url,
58
- // For streamable http transport
59
- httpUrl, headers,
60
- // For websocket transport
61
- tcp,
62
- /**
63
- * Transport type for URL-based servers.
64
- * When set, disables automatic HTTP→SSE fallback.
65
- * - 'http' → StreamableHTTPClientTransport
66
- * - 'streamable-http' → alias for 'http' (StreamableHTTPClientTransport)
67
- * - 'sse' → SSEClientTransport
68
- * - omitted → defaults to HTTP with SSE fallback (deprecated; add type explicitly)
69
- *
70
- * Note: 'httpUrl' is deprecated; use 'url' + 'type: "http"' instead.
71
- * @plan PLAN-20250219-GMERGE021.R3.P03
72
- * @requirement REQ-GMERGE021-R3-001
73
- */
74
- type,
75
- // Common
76
- timeout, trust,
77
- // Metadata
78
- description, includeTools, excludeTools, extensionName, extension,
79
- // OAuth configuration
80
- oauth, authProviderType,
81
- // Service Account Configuration
82
- /* targetAudience format: CLIENT_ID.apps.googleusercontent.com */
83
- targetAudience,
84
- /* targetServiceAccount format: <service-account-name>@<project-num>.iam.gserviceaccount.com */
85
- targetServiceAccount) {
86
- this.command = command;
87
- this.args = args;
88
- this.env = env;
89
- this.cwd = cwd;
90
- this.url = url;
91
- this.httpUrl = httpUrl;
92
- this.headers = headers;
93
- this.tcp = tcp;
94
- this.type = type;
95
- this.timeout = timeout;
96
- this.trust = trust;
97
- this.description = description;
98
- this.includeTools = includeTools;
99
- this.excludeTools = excludeTools;
100
- this.extensionName = extensionName;
101
- this.extension = extension;
102
- this.oauth = oauth;
103
- this.authProviderType = authProviderType;
104
- this.targetAudience = targetAudience;
105
- this.targetServiceAccount = targetServiceAccount;
106
- }
107
- }
108
- export var AuthProviderType;
109
- (function (AuthProviderType) {
110
- AuthProviderType["DYNAMIC_DISCOVERY"] = "dynamic_discovery";
111
- AuthProviderType["GOOGLE_CREDENTIALS"] = "google_credentials";
112
- AuthProviderType["SERVICE_ACCOUNT_IMPERSONATION"] = "service_account_impersonation";
113
- })(AuthProviderType || (AuthProviderType = {}));
32
+ // Owned by @vybestack/llxprt-code-auth (a dependency-graph leaf) so that
33
+ // @vybestack/llxprt-code-mcp can use it without depending on core, which
34
+ // value-imports mcp (#3305). Re-exported here to keep core's public surface
35
+ // unchanged for existing consumers.
36
+ import { AuthProviderType } from '@vybestack/llxprt-code-auth/mcp-auth-provider-type.js';
37
+ export { AuthProviderType };
114
38
  //# sourceMappingURL=configTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configTypes.js","sourceRoot":"","sources":["../../../src/config/configTypes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8EH,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,sCAAsB,CAAA;IACtB,6BAAa,CAAA;AACf,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AA0HD;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAiD;IAEjD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,WAAW,CAAC,CAAC,+BAA+B;IACrD,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,kDAAkD;IAClD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,MAAM,sCAAsC,GAAG,SAAS,CAAC;AAChE,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,CAAC;AAEvD,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnE,MAAM,OAAO,eAAe;IAGf;IACA;IACA;IACA;IAEA;IAEA;IACA;IAEA;IAaA;IAEA;IACA;IAEA;IACA;IACA;IACA;IACA;IAEA;IACA;IAGA;IAEA;IA1CX;IACE,sBAAsB;IACb,OAAgB,EAChB,IAAe,EACf,GAA4B,EAC5B,GAAY;IACrB,oBAAoB;IACX,GAAY;IACrB,gCAAgC;IACvB,OAAgB,EAChB,OAAgC;IACzC,0BAA0B;IACjB,GAAY;IACrB;;;;;;;;;;;OAWG;IACM,IAAyC;IAClD,SAAS;IACA,OAAgB,EAChB,KAAe;IACxB,WAAW;IACF,WAAoB,EACpB,YAAuB,EACvB,YAAuB,EACvB,aAAsB,EACtB,SAA2B;IACpC,sBAAsB;IACb,KAAsB,EACtB,gBAAmC;IAC5C,gCAAgC;IAChC,iEAAiE;IACxD,cAAuB;IAChC,+FAA+F;IACtF,oBAA6B;QAxC7B,YAAO,GAAP,OAAO,CAAS;QAChB,SAAI,GAAJ,IAAI,CAAW;QACf,QAAG,GAAH,GAAG,CAAyB;QAC5B,QAAG,GAAH,GAAG,CAAS;QAEZ,QAAG,GAAH,GAAG,CAAS;QAEZ,YAAO,GAAP,OAAO,CAAS;QAChB,YAAO,GAAP,OAAO,CAAyB;QAEhC,QAAG,GAAH,GAAG,CAAS;QAaZ,SAAI,GAAJ,IAAI,CAAqC;QAEzC,YAAO,GAAP,OAAO,CAAS;QAChB,UAAK,GAAL,KAAK,CAAU;QAEf,gBAAW,GAAX,WAAW,CAAS;QACpB,iBAAY,GAAZ,YAAY,CAAW;QACvB,iBAAY,GAAZ,YAAY,CAAW;QACvB,kBAAa,GAAb,aAAa,CAAS;QACtB,cAAS,GAAT,SAAS,CAAkB;QAE3B,UAAK,GAAL,KAAK,CAAiB;QACtB,qBAAgB,GAAhB,gBAAgB,CAAmB;QAGnC,mBAAc,GAAd,cAAc,CAAS;QAEvB,yBAAoB,GAApB,oBAAoB,CAAS;IACrC,CAAC;CACL;AAED,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,2DAAuC,CAAA;IACvC,6DAAyC,CAAA;IACzC,mFAA+D,CAAA;AACjE,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B"}
1
+ {"version":3,"file":"configTypes.js","sourceRoot":"","sources":["../../../src/config/configTypes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoFH,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,sCAAsB,CAAA;IACtB,6BAAa,CAAA;AACf,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AA0HD;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAiD;IAEjD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,WAAW,CAAC,CAAC,+BAA+B;IACrD,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,kDAAkD;IAClD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,MAAM,sCAAsC,GAAG,SAAS,CAAC;AAChE,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,CAAC;AAEvD,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnE,yEAAyE;AACzE,yEAAyE;AACzE,4EAA4E;AAC5E,oCAAoC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uDAAuD,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -3,9 +3,8 @@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export { Config, type ConfigParameters, type RedactionConfig, ApprovalMode, type AccessibilitySettings, type BugCommandSettings, type ChatCompressionSettings, type SummarizeToolOutputSettings, type ComplexityAnalyzerSettings, type TelemetrySettings, MCPServerConfig, AuthProviderType, type SandboxConfig, type ActiveExtension, type LlxprtExtension, type FileFilteringOptions, DEFAULT_MEMORY_FILE_FILTERING_OPTIONS, DEFAULT_FILE_FILTERING_OPTIONS, DEFAULT_AUTOCOMPLETE_IGNORE_DIRS, DEFAULT_AUTOCOMPLETE_IGNORE_PATTERNS, DEFAULT_AUTOCOMPLETE_MAX_DEPTH, type MCPOAuthConfig, DEFAULT_GEMINI_FLASH_MODEL, } from './config.js';
6
+ export { Config, type ConfigParameters, type RedactionConfig, ApprovalMode, type AccessibilitySettings, type BugCommandSettings, type ChatCompressionSettings, type SummarizeToolOutputSettings, type ComplexityAnalyzerSettings, type TelemetrySettings, type MCPServerConfig, AuthProviderType, type SandboxConfig, type ActiveExtension, type LlxprtExtension, type FileFilteringOptions, DEFAULT_MEMORY_FILE_FILTERING_OPTIONS, DEFAULT_FILE_FILTERING_OPTIONS, DEFAULT_AUTOCOMPLETE_IGNORE_DIRS, DEFAULT_AUTOCOMPLETE_IGNORE_PATTERNS, DEFAULT_AUTOCOMPLETE_MAX_DEPTH, type MCPOAuthConfig, } from './config.js';
7
7
  export type { Config as ConfigInstance } from './config.js';
8
- export { DEFAULT_GEMINI_FLASH_MODEL as DEFAULT_FLASH_MODEL } from './models.js';
9
8
  /**
10
9
  * @plan:PLAN-20250117-SUBAGENTCONFIG.P15
11
10
  * @requirement:REQ-010
@@ -3,8 +3,7 @@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export { Config, ApprovalMode, MCPServerConfig, AuthProviderType, DEFAULT_MEMORY_FILE_FILTERING_OPTIONS, DEFAULT_FILE_FILTERING_OPTIONS, DEFAULT_AUTOCOMPLETE_IGNORE_DIRS, DEFAULT_AUTOCOMPLETE_IGNORE_PATTERNS, DEFAULT_AUTOCOMPLETE_MAX_DEPTH, DEFAULT_GEMINI_FLASH_MODEL, } from './config.js';
7
- export { DEFAULT_GEMINI_FLASH_MODEL as DEFAULT_FLASH_MODEL } from './models.js';
6
+ export { Config, ApprovalMode, AuthProviderType, DEFAULT_MEMORY_FILE_FILTERING_OPTIONS, DEFAULT_FILE_FILTERING_OPTIONS, DEFAULT_AUTOCOMPLETE_IGNORE_DIRS, DEFAULT_AUTOCOMPLETE_IGNORE_PATTERNS, DEFAULT_AUTOCOMPLETE_MAX_DEPTH, } from './config.js';
8
7
  /**
9
8
  * @plan:PLAN-20250117-SUBAGENTCONFIG.P15
10
9
  * @requirement:REQ-010
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,MAAM,EAGN,YAAY,EAOZ,eAAe,EACf,gBAAgB,EAKhB,qCAAqC,EACrC,8BAA8B,EAC9B,gCAAgC,EAChC,oCAAoC,EACpC,8BAA8B,EAE9B,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,0BAA0B,IAAI,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEhF;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,MAAM,EAGN,YAAY,EAQZ,gBAAgB,EAKhB,qCAAqC,EACrC,8BAA8B,EAC9B,gCAAgC,EAChC,oCAAoC,EACpC,8BAA8B,GAE/B,MAAM,aAAa,CAAC;AAIrB;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
@@ -3,10 +3,6 @@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export declare const DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
7
- export declare const DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
8
- export declare const DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-2.5-flash-lite";
9
- export declare const DEFAULT_GEMINI_EMBEDDING_MODEL = "gemini-embedding-001";
10
6
  export declare const PLACEHOLDER_MODEL = "placeholder-model";
11
7
  /**
12
8
  * Neutral sentinel provider identity used when no provider is configured.
@@ -3,10 +3,6 @@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export const DEFAULT_GEMINI_MODEL = 'gemini-2.5-pro';
7
- export const DEFAULT_GEMINI_FLASH_MODEL = 'gemini-2.5-flash';
8
- export const DEFAULT_GEMINI_FLASH_LITE_MODEL = 'gemini-2.5-flash-lite';
9
- export const DEFAULT_GEMINI_EMBEDDING_MODEL = 'gemini-embedding-001';
10
6
  export const PLACEHOLDER_MODEL = 'placeholder-model';
11
7
  /**
12
8
  * Neutral sentinel provider identity used when no provider is configured.
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/config/models.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AACrD,MAAM,CAAC,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;AAC7D,MAAM,CAAC,MAAM,+BAA+B,GAAG,uBAAuB,CAAC;AAEvE,MAAM,CAAC,MAAM,8BAA8B,GAAG,sBAAsB,CAAC;AAErE,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAEpD;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,OAAO,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,OAAO,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/config/models.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAEpD;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,OAAO,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,OAAO,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC"}
@@ -51,11 +51,11 @@ export interface TaskToolArgs {
51
51
  schedulerFactoryProvider: () => SubagentSchedulerFactory | undefined;
52
52
  getAsyncTaskManager: () => AsyncTaskManager | undefined;
53
53
  /**
54
- * Session/runtime MessageBus threaded into the SubagentOrchestrator so
54
+ * Required session/runtime MessageBus threaded into the SubagentOrchestrator so
55
55
  * non-interactive subagent tool execution can satisfy
56
56
  * Config.getOrCreateScheduler's explicit MessageBus dependency (Issue #2312).
57
57
  */
58
- messageBus: MessageBus | undefined;
58
+ messageBus: MessageBus;
59
59
  }
60
60
  /** Tool record for settings UI */
61
61
  export interface ToolRecord {
@@ -16,11 +16,10 @@
16
16
  * - config/config.ts (initialize, initializeContentGeneratorConfig)
17
17
  * - config/configBaseCore.ts (getAgentClient return type)
18
18
  * - utils/summarizer.ts (generateContent)
19
- * - utils/llm-edit-fixer.ts (generateJson)
19
+ * - agents/src/api/agentImpl.ts (generateJson)
20
20
  * - utils/checkpointUtils.ts (getHistory)
21
21
  * - CLI consumers (14+ files: sendMessageStream, setTools, updateSystemInstruction, etc.)
22
22
  */
23
- import type { UserTierId } from '../code_assist/types.js';
24
23
  import type { ContentGeneratorConfig } from './contentGenerator.js';
25
24
  import type { HistoryService } from '../services/history/HistoryService.js';
26
25
  import type { IContent } from '../services/history/IContent.js';
@@ -75,7 +74,7 @@ export interface AgentChatContract {
75
74
  sendMessageStream(params: AgentClientMessageParams, prompt_id: string): Promise<AsyncGenerator<StreamEvent>>;
76
75
  generateDirectMessage(params: AgentClientMessageParams, prompt_id: string): Promise<ModelOutput>;
77
76
  getHistory(): readonly IContent[];
78
- setHistory(history: readonly IContent[]): void;
77
+ setHistory(history: readonly IContent[]): Promise<void>;
79
78
  clearHistory(): void;
80
79
  getHistoryService(): HistoryService | null;
81
80
  wasRecentlyCompressed(): boolean;
@@ -94,8 +93,8 @@ export interface AgentClientContract {
94
93
  getHistory(): Promise<readonly IContent[]>;
95
94
  getHistoryService(): HistoryService | null;
96
95
  storeHistoryServiceForReuse(service: HistoryService): void;
97
- storeHistoryForLaterUse(history: readonly IContent[]): void;
98
- dispose(): void;
96
+ storeHistoryForLaterUse(history: readonly IContent[]): Promise<void>;
97
+ dispose(): Promise<void>;
99
98
  setTools(): Promise<void>;
100
99
  clearTools(): void;
101
100
  updateSystemInstruction(): Promise<void>;
@@ -114,7 +113,6 @@ export interface AgentClientContract {
114
113
  generateContent(contents: IContent[], generationConfig: AgentClientGenerateConfig, abortSignal: AbortSignal, model: string): Promise<ModelOutput>;
115
114
  generateEmbedding(texts: string[]): Promise<number[][]>;
116
115
  sendMessageStream(initialRequest: AgentRequestInput, signal: AbortSignal, prompt_id: string, turns?: number, isInvalidStreamRetry?: boolean, isPayloadRecoveryRetry?: boolean): AsyncGenerator<ServerAgentStreamEvent, unknown>;
117
- getUserTier(): UserTierId | undefined;
118
116
  getCurrentSequenceModel(): string | null;
119
117
  }
120
118
  /**
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Vybestack LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * Builds the notice appended to a compression request when a session recording
8
+ * has materialized a file on disk. Shared by both LLM compression strategies
9
+ * (OneShotStrategy and MiddleOutStrategy) so the two cannot drift.
10
+ *
11
+ * The wording deliberately avoids calling the file a "full transcript":
12
+ * recording is optional, can be enabled part way through a session (seeding
13
+ * only the history present at that moment), and deactivates on a write
14
+ * failure. It also steers the reader toward searching the file for a specific
15
+ * string, because the journal contains full tool results and reading it whole
16
+ * would burn more context than the compression saved.
17
+ *
18
+ * The notice is part of the compression request, so it asks the summarizing
19
+ * model to carry the path into the summary — that is what makes the pointer
20
+ * outlive the compression that drops the detail.
21
+ */
22
+ export declare function buildTranscriptPathNotice(transcriptPath: string): string;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Vybestack LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * Builds the notice appended to a compression request when a session recording
8
+ * has materialized a file on disk. Shared by both LLM compression strategies
9
+ * (OneShotStrategy and MiddleOutStrategy) so the two cannot drift.
10
+ *
11
+ * The wording deliberately avoids calling the file a "full transcript":
12
+ * recording is optional, can be enabled part way through a session (seeding
13
+ * only the history present at that moment), and deactivates on a write
14
+ * failure. It also steers the reader toward searching the file for a specific
15
+ * string, because the journal contains full tool results and reading it whole
16
+ * would burn more context than the compression saved.
17
+ *
18
+ * The notice is part of the compression request, so it asks the summarizing
19
+ * model to carry the path into the summary — that is what makes the pointer
20
+ * outlive the compression that drops the detail.
21
+ */
22
+ export function buildTranscriptPathNotice(transcriptPath) {
23
+ return (`Note: a JSONL journal of this session is being recorded at: ${transcriptPath}\n` +
24
+ `The journal may be incomplete — recording can begin part way through a session and can stop on a write error. ` +
25
+ `Preserve this path verbatim in your summary, and record that detail dropped by compression may be recoverable by ` +
26
+ `searching that file for the specific text needed. The file holds full tool results and can be very large, so it ` +
27
+ `should be searched, not read whole.`);
28
+ }
29
+ //# sourceMappingURL=transcriptPathNotice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcriptPathNotice.js","sourceRoot":"","sources":["../../../../src/core/compression/transcriptPathNotice.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,yBAAyB,CAAC,cAAsB;IAC9D,OAAO,CACL,+DAA+D,cAAc,IAAI;QACjF,gHAAgH;QAChH,mHAAmH;QACnH,kHAAkH;QAClH,qCAAqC,CACtC,CAAC;AACJ,CAAC"}
@@ -21,19 +21,16 @@ import type { Config } from '../config/config.js';
21
21
  */
22
22
  import type { RuntimeContentGeneratorFactory } from '../runtime/contracts/RuntimeContentGeneratorFactory.js';
23
23
  import type { RuntimeProviderManager } from '../runtime/contracts/RuntimeProviderManager.js';
24
- import type { UserTierId } from '../code_assist/types.js';
25
24
  /**
26
25
  * Neutral ContentGenerator interface. All request/response types come from the
27
26
  * provider-agnostic llm-types layer. Implementations convert to/from their
28
- * native shapes at the provider boundary (e.g. the code_assist enclave for the
29
- * Gemini-backed paths).
27
+ * native shapes at the provider boundary.
30
28
  */
31
29
  export interface ContentGenerator {
32
30
  generateContent(request: ModelGenerationRequest, userPromptId: string): Promise<ModelOutput>;
33
31
  generateContentStream(request: ModelGenerationRequest, userPromptId: string): Promise<AsyncGenerator<ModelStreamChunk>>;
34
32
  countTokens(request: CountTokensRequest): Promise<CountTokensResult>;
35
33
  embedContent(request: EmbedContentRequest): Promise<EmbedContentResult>;
36
- userTier?: UserTierId;
37
34
  }
38
35
  export type ContentGeneratorConfig = {
39
36
  model: string;
@@ -54,4 +51,4 @@ export type ContentGeneratorConfig = {
54
51
  proxy?: string;
55
52
  };
56
53
  export declare function createContentGeneratorConfig(config: Config): ContentGeneratorConfig;
57
- export declare function createContentGenerator(config: ContentGeneratorConfig, gcConfig: Config, _sessionId?: string): Promise<ContentGenerator>;
54
+ export declare function createContentGenerator(config: ContentGeneratorConfig, _gcConfig: Config, _sessionId?: string): Promise<ContentGenerator>;
@@ -4,8 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { PLACEHOLDER_MODEL } from '../config/models.js';
7
- import { GoogleGenAIWrapper } from '../code_assist/googleGenAIWrapper.js';
8
- import { InstallationManager } from '../utils/installationManager.js';
9
7
  function firstNonEmptyEnvironmentValue(primary, fallback) {
10
8
  if (primary !== undefined && primary !== '') {
11
9
  return primary;
@@ -39,33 +37,21 @@ export function createContentGeneratorConfig(config) {
39
37
  }
40
38
  return contentGeneratorConfig;
41
39
  }
42
- export async function createContentGenerator(config, gcConfig, _sessionId) {
40
+ export async function createContentGenerator(config, _gcConfig, _sessionId) {
43
41
  // @plan:PLAN-20260603-ISSUE1584.P05
44
42
  // @requirement:REQ-DEP-001
45
43
  // Prefer factory injection when available — eliminates core→providers construction
46
- if (config.contentGeneratorFactory != null &&
47
- config.providerManager != null) {
48
- return config.contentGeneratorFactory.createContentGenerator(config.providerManager);
49
- }
50
- // @plan:PLAN-20260603-ISSUE1584.P11
51
- // @requirement:REQ-DEP-001
52
- // Core must not construct provider-owned content generators. CLI/providers wiring injects the factory.
53
44
  if (config.providerManager != null) {
45
+ if (config.contentGeneratorFactory != null) {
46
+ return config.contentGeneratorFactory.createContentGenerator(config.providerManager);
47
+ }
54
48
  throw new Error('Provider content generator factory is required when a provider manager is configured');
55
49
  }
56
- const requestOptions = { headers: {} };
57
- if (gcConfig.getUsageStatisticsEnabled()) {
58
- const installationManager = new InstallationManager();
59
- const installationId = installationManager.getInstallationId();
60
- requestOptions.headers['x-gemini-api-privileged-user-id'] =
61
- `${installationId}`;
62
- }
63
- if (config.vertexai === true) {
64
- return new GoogleGenAIWrapper(config, requestOptions);
65
- }
66
- if (!config.apiKey) {
67
- throw new Error('No Gemini authentication configured. Set GEMINI_API_KEY environment variable, use --keyfile, or configure Vertex AI credentials.');
68
- }
69
- return new GoogleGenAIWrapper(config, requestOptions);
50
+ // @plan:PLAN-20260603-ISSUE1584.P11
51
+ // @requirement:REQ-DEP-001
52
+ // Core must not construct provider-owned content generators. The embedding
53
+ // process must compose the providers package instead of falling back to a
54
+ // Gemini implementation in core.
55
+ throw new Error('No provider runtime is composed for this Config. Compose the providers package (see packages/providers/src/composition) before creating a content generator.');
70
56
  }
71
57
  //# sourceMappingURL=contentGenerator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contentGenerator.js","sourceRoot":"","sources":["../../../src/core/contentGenerator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAcxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AA6CtE,SAAS,6BAA6B,CACpC,OAA2B,EAC3B,QAA4B;IAE5B,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;QAC5C,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC;QACpB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,MAAc;IAEd,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,SAAS,CAAC;IAC7D,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,SAAS,CAAC;IAC7D,MAAM,kBAAkB,GAAG,6BAA6B,CACtD,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,EACnC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CACpC,CAAC;IACF,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,SAAS,CAAC;IAE3E,0EAA0E;IAC1E,gEAAgE;IAChE,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,EAAE,IAAI,iBAAiB,CAAC;IAE9D,MAAM,sBAAsB,GAA2B;QACrD,KAAK,EAAE,cAAc;QACrB,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE;KACzB,CAAC;IAEF,IAAI,YAAY,EAAE,CAAC;QACjB,sBAAsB,CAAC,MAAM,GAAG,YAAY,CAAC;QAC7C,sBAAsB,CAAC,QAAQ,GAAG,KAAK,CAAC;QACxC,OAAO,sBAAsB,CAAC;IAChC,CAAC;IAED,IAAI,YAAY,IAAI,CAAC,kBAAkB,IAAI,mBAAmB,CAAC,EAAE,CAAC;QAChE,sBAAsB,CAAC,MAAM,GAAG,YAAY,CAAC;QAC7C,sBAAsB,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvC,OAAO,sBAAsB,CAAC;IAChC,CAAC;IAED,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAA8B,EAC9B,QAAgB,EAChB,UAAmB;IAEnB,oCAAoC;IACpC,2BAA2B;IAC3B,mFAAmF;IACnF,IACE,MAAM,CAAC,uBAAuB,IAAI,IAAI;QACtC,MAAM,CAAC,eAAe,IAAI,IAAI,EAC9B,CAAC;QACD,OAAO,MAAM,CAAC,uBAAuB,CAAC,sBAAsB,CAC1D,MAAM,CAAC,eAAe,CACvB,CAAC;IACJ,CAAC;IAED,oCAAoC;IACpC,2BAA2B;IAC3B,uGAAuG;IACvG,IAAI,MAAM,CAAC,eAAe,IAAI,IAAI,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACb,sFAAsF,CACvF,CAAC;IACJ,CAAC;IAED,MAAM,cAAc,GAAG,EAAE,OAAO,EAAE,EAA4B,EAAE,CAAC;IACjE,IAAI,QAAQ,CAAC,yBAAyB,EAAE,EAAE,CAAC;QACzC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC;QACtD,MAAM,cAAc,GAAG,mBAAmB,CAAC,iBAAiB,EAAE,CAAC;QAC/D,cAAc,CAAC,OAAO,CAAC,iCAAiC,CAAC;YACvD,GAAG,cAAc,EAAE,CAAC;IACxB,CAAC;IAED,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;QAC7B,OAAO,IAAI,kBAAkB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CACb,kIAAkI,CACnI,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,kBAAkB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AACxD,CAAC"}
1
+ {"version":3,"file":"contentGenerator.js","sourceRoot":"","sources":["../../../src/core/contentGenerator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAsDxD,SAAS,6BAA6B,CACpC,OAA2B,EAC3B,QAA4B;IAE5B,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;QAC5C,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC;QACpB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,MAAc;IAEd,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,SAAS,CAAC;IAC7D,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,SAAS,CAAC;IAC7D,MAAM,kBAAkB,GAAG,6BAA6B,CACtD,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,EACnC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CACpC,CAAC;IACF,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,SAAS,CAAC;IAE3E,0EAA0E;IAC1E,gEAAgE;IAChE,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,EAAE,IAAI,iBAAiB,CAAC;IAE9D,MAAM,sBAAsB,GAA2B;QACrD,KAAK,EAAE,cAAc;QACrB,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE;KACzB,CAAC;IAEF,IAAI,YAAY,EAAE,CAAC;QACjB,sBAAsB,CAAC,MAAM,GAAG,YAAY,CAAC;QAC7C,sBAAsB,CAAC,QAAQ,GAAG,KAAK,CAAC;QACxC,OAAO,sBAAsB,CAAC;IAChC,CAAC;IAED,IAAI,YAAY,IAAI,CAAC,kBAAkB,IAAI,mBAAmB,CAAC,EAAE,CAAC;QAChE,sBAAsB,CAAC,MAAM,GAAG,YAAY,CAAC;QAC7C,sBAAsB,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvC,OAAO,sBAAsB,CAAC;IAChC,CAAC;IAED,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAA8B,EAC9B,SAAiB,EACjB,UAAmB;IAEnB,oCAAoC;IACpC,2BAA2B;IAC3B,mFAAmF;IACnF,IAAI,MAAM,CAAC,eAAe,IAAI,IAAI,EAAE,CAAC;QACnC,IAAI,MAAM,CAAC,uBAAuB,IAAI,IAAI,EAAE,CAAC;YAC3C,OAAO,MAAM,CAAC,uBAAuB,CAAC,sBAAsB,CAC1D,MAAM,CAAC,eAAe,CACvB,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CACb,sFAAsF,CACvF,CAAC;IACJ,CAAC;IAED,oCAAoC;IACpC,2BAA2B;IAC3B,2EAA2E;IAC3E,0EAA0E;IAC1E,iCAAiC;IACjC,MAAM,IAAI,KAAK,CACb,8JAA8J,CAC/J,CAAC;AACJ,CAAC"}
@@ -20,12 +20,70 @@ export declare class Logger {
20
20
  private sessionId;
21
21
  private messageId;
22
22
  private initialized;
23
+ private _closed;
23
24
  private logs;
24
25
  private _formatMigrated;
25
26
  private _diskIsLegacy;
26
27
  private _needsNewlineCheck;
27
28
  private _writeQueue;
29
+ private _initPromise;
28
30
  constructor(sessionId: string, storage: Storage);
31
+ /**
32
+ * Acquisition deadline for the advisory log-file lock. The
33
+ * `LLXPRT_LOG_LOCK_TIMEOUT_MS` override is deliberately gated to test runs
34
+ * (bun sets NODE_ENV=test): as an undocumented production knob it could
35
+ * silently degrade every contended append, so production always uses the
36
+ * default.
37
+ */
38
+ private _lockTimeoutMs;
39
+ private _lockFilePath;
40
+ /**
41
+ * Acquire the per-log-file lock via the O_EXCL pattern (`fs.open 'wx'`).
42
+ * Retries with a small fixed backoff until it either wins the race, recovers a
43
+ * stale lock (via an atomic rename-guard claim, so a stale break can never
44
+ * bare-unlink a successor's live lock), or hits the acquisition deadline.
45
+ * The exclusive descriptor stays open for the whole critical section: it pins
46
+ * the lock file's inode so ownership can later be verified by inode identity
47
+ * without reading any file content.
48
+ */
49
+ private _acquireLogLock;
50
+ /**
51
+ * Create the lock file, write a diagnostic payload ({pid, timestamp}), and
52
+ * keep the descriptor open as the ownership proof. Returns the handle when
53
+ * this process now owns the lock, null when another process holds it (EEXIST).
54
+ * If the exclusive create won but finalizing failed, the just-created lock
55
+ * file has no owner and must not be left behind for waiters to trip on.
56
+ */
57
+ private _tryAcquireLogLock;
58
+ /**
59
+ * Try to break a lock whose mtime is past the staleness threshold without ever
60
+ * bare-unlinking the live lock path (POSIX rename overwrites, so a blind unlink
61
+ * could delete a successor's fresh lock). The live name is atomically moved to a
62
+ * unique guard — only one contender can win the rename — then re-verified as
63
+ * stale. A fresh file that was moved by mistake is restored with a hard link
64
+ * (link fails EEXIST rather than overwriting) rather than deleted.
65
+ */
66
+ private _tryBreakStaleLock;
67
+ /**
68
+ * Run `fn` while this process owns `logFilePath`'s advisory lock and release it
69
+ * in `finally`, so reader/writer sequences cannot interleave with other processes.
70
+ * A heartbeat re-stamps the held descriptor's inode (not the lock path, so a
71
+ * broken holder can never refresh a successor's lock) to keep the lease alive
72
+ * during long critical sections such as a slow legacy migration. Never nested:
73
+ * no code inside the wrapped callbacks acquires again.
74
+ */
75
+ private _withLogLock;
76
+ /**
77
+ * Release the lock without a bare unlink and without reading any file
78
+ * content (steady-state appends must stay read-free). The live name is moved
79
+ * to a unique guard; the guard's inode is compared against the descriptor we
80
+ * have pinned since acquisition, which proves ownership race-free. Only our
81
+ * own inode is ever unlinked — a mismatched guard (our lock was broken and a
82
+ * successor owns the path) is restored via a hard link, which fails EEXIST
83
+ * rather than clobbering a newer lock.
84
+ */
85
+ private _releaseLogLock;
86
+ private _guardPath;
29
87
  private _parseLegacyJsonArray;
30
88
  /**
31
89
  * Parse JSONL content, preserving valid entries even when some lines are
@@ -99,6 +157,14 @@ export declare class Logger {
99
157
  private _appendEntry;
100
158
  private _pruneOldBackups;
101
159
  initialize(): Promise<void>;
160
+ private _doInitialize;
161
+ /**
162
+ * Reset the instance's next-id counter to one past the highest id already
163
+ * on disk for this session. Called whenever `this.logs` is (re)populated
164
+ * from disk, so a foreign writer that appended while we held a stale
165
+ * snapshot cannot collide with our next append.
166
+ */
167
+ private _recomputeMessageId;
102
168
  getPreviousUserMessages(): Promise<string[]>;
103
169
  logMessage(type: MessageSenderType, message: string): Promise<void>;
104
170
  close(): Promise<void>;