@dexto/core 1.5.8 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (640) hide show
  1. package/README.md +19 -8
  2. package/dist/agent/DextoAgent.cjs +293 -154
  3. package/dist/agent/DextoAgent.d.ts +83 -56
  4. package/dist/agent/DextoAgent.d.ts.map +1 -1
  5. package/dist/agent/DextoAgent.js +290 -151
  6. package/dist/{context/compaction/provider.cjs → agent/agent-options.cjs} +2 -2
  7. package/dist/agent/agent-options.d.ts +53 -0
  8. package/dist/agent/agent-options.d.ts.map +1 -0
  9. package/dist/agent/agentCard.cjs +1 -1
  10. package/dist/agent/errors.cjs +2 -2
  11. package/dist/agent/errors.d.ts.map +1 -1
  12. package/dist/agent/index.cjs +1 -6
  13. package/dist/agent/index.d.ts +3 -2
  14. package/dist/agent/index.d.ts.map +1 -1
  15. package/dist/agent/index.js +1 -7
  16. package/dist/{storage/blob/provider.cjs → agent/runtime-config.cjs} +2 -2
  17. package/dist/agent/runtime-config.d.ts +53 -0
  18. package/dist/agent/runtime-config.d.ts.map +1 -0
  19. package/dist/agent/schemas.cjs +2 -104
  20. package/dist/agent/schemas.d.ts +10 -9199
  21. package/dist/agent/schemas.d.ts.map +1 -1
  22. package/dist/agent/schemas.js +1 -109
  23. package/dist/agent/state-manager.d.ts +5 -5
  24. package/dist/agent/state-manager.d.ts.map +1 -1
  25. package/dist/approval/error-codes.cjs +1 -1
  26. package/dist/approval/error-codes.d.ts +1 -1
  27. package/dist/approval/error-codes.d.ts.map +1 -1
  28. package/dist/approval/error-codes.js +1 -1
  29. package/dist/approval/errors.cjs +5 -5
  30. package/dist/approval/errors.d.ts +2 -2
  31. package/dist/approval/errors.d.ts.map +1 -1
  32. package/dist/approval/errors.js +5 -5
  33. package/dist/approval/index.cjs +8 -8
  34. package/dist/approval/index.d.ts +2 -2
  35. package/dist/approval/index.d.ts.map +1 -1
  36. package/dist/approval/index.js +8 -8
  37. package/dist/approval/manager.cjs +77 -57
  38. package/dist/approval/manager.d.ts +41 -43
  39. package/dist/approval/manager.d.ts.map +1 -1
  40. package/dist/approval/manager.js +75 -55
  41. package/dist/approval/schemas.cjs +26 -25
  42. package/dist/approval/schemas.d.ts +35 -15
  43. package/dist/approval/schemas.d.ts.map +1 -1
  44. package/dist/approval/schemas.js +22 -21
  45. package/dist/approval/types.cjs +1 -1
  46. package/dist/approval/types.d.ts +14 -14
  47. package/dist/approval/types.d.ts.map +1 -1
  48. package/dist/approval/types.js +1 -1
  49. package/dist/context/compaction/index.cjs +2 -23
  50. package/dist/context/compaction/index.d.ts +1 -7
  51. package/dist/context/compaction/index.d.ts.map +1 -1
  52. package/dist/context/compaction/index.js +1 -16
  53. package/dist/context/compaction/strategies/noop.cjs +19 -1
  54. package/dist/context/compaction/strategies/noop.d.ts +13 -3
  55. package/dist/context/compaction/strategies/noop.d.ts.map +1 -1
  56. package/dist/context/compaction/strategies/noop.js +19 -1
  57. package/dist/context/compaction/strategies/{reactive-overflow.cjs → reactive-overflow-compaction.cjs} +67 -64
  58. package/dist/context/compaction/strategies/{reactive-overflow.d.ts → reactive-overflow-compaction.d.ts} +19 -36
  59. package/dist/context/compaction/strategies/reactive-overflow-compaction.d.ts.map +1 -0
  60. package/dist/context/compaction/strategies/{reactive-overflow.js → reactive-overflow-compaction.js} +63 -60
  61. package/dist/context/compaction/types.d.ts +40 -8
  62. package/dist/context/compaction/types.d.ts.map +1 -1
  63. package/dist/context/manager.cjs +4 -2
  64. package/dist/context/manager.d.ts +4 -3
  65. package/dist/context/manager.d.ts.map +1 -1
  66. package/dist/context/manager.js +4 -2
  67. package/dist/context/types.d.ts +2 -0
  68. package/dist/context/types.d.ts.map +1 -1
  69. package/dist/context/utils.cjs +2 -2
  70. package/dist/context/utils.d.ts +14 -14
  71. package/dist/context/utils.d.ts.map +1 -1
  72. package/dist/errors/result-bridge.d.ts +2 -2
  73. package/dist/errors/result-bridge.d.ts.map +1 -1
  74. package/dist/errors/types.cjs +1 -1
  75. package/dist/errors/types.d.ts +3 -3
  76. package/dist/errors/types.d.ts.map +1 -1
  77. package/dist/errors/types.js +1 -1
  78. package/dist/events/index.cjs +11 -1
  79. package/dist/events/index.d.ts +43 -7
  80. package/dist/events/index.d.ts.map +1 -1
  81. package/dist/events/index.js +11 -1
  82. package/dist/{plugins → hooks}/builtins/content-policy.cjs +7 -6
  83. package/dist/hooks/builtins/content-policy.d.ts +24 -0
  84. package/dist/hooks/builtins/content-policy.d.ts.map +1 -0
  85. package/dist/{plugins → hooks}/builtins/content-policy.js +6 -5
  86. package/dist/{plugins → hooks}/builtins/response-sanitizer.cjs +3 -3
  87. package/dist/hooks/builtins/response-sanitizer.d.ts +22 -0
  88. package/dist/hooks/builtins/response-sanitizer.d.ts.map +1 -0
  89. package/dist/{plugins → hooks}/builtins/response-sanitizer.js +2 -2
  90. package/dist/hooks/error-codes.cjs +43 -0
  91. package/dist/hooks/error-codes.d.ts +34 -0
  92. package/dist/hooks/error-codes.d.ts.map +1 -0
  93. package/dist/hooks/error-codes.js +20 -0
  94. package/dist/{storage/cache/providers/memory.cjs → hooks/index.cjs} +15 -18
  95. package/dist/hooks/index.d.ts +14 -0
  96. package/dist/hooks/index.d.ts.map +1 -0
  97. package/dist/hooks/index.js +11 -0
  98. package/dist/hooks/manager.cjs +354 -0
  99. package/dist/hooks/manager.d.ts +103 -0
  100. package/dist/hooks/manager.d.ts.map +1 -0
  101. package/dist/hooks/manager.js +331 -0
  102. package/dist/{plugins → hooks}/types.d.ts +36 -34
  103. package/dist/hooks/types.d.ts.map +1 -0
  104. package/dist/index.browser.cjs +13 -12
  105. package/dist/index.browser.d.ts +5 -5
  106. package/dist/index.browser.d.ts.map +1 -1
  107. package/dist/index.browser.js +8 -7
  108. package/dist/index.cjs +5 -7
  109. package/dist/index.d.ts +2 -3
  110. package/dist/index.d.ts.map +1 -1
  111. package/dist/index.js +2 -3
  112. package/dist/llm/errors.cjs +1 -1
  113. package/dist/llm/executor/stream-processor.cjs +131 -11
  114. package/dist/llm/executor/stream-processor.d.ts +7 -5
  115. package/dist/llm/executor/stream-processor.d.ts.map +1 -1
  116. package/dist/llm/executor/stream-processor.js +131 -11
  117. package/dist/llm/executor/turn-executor.cjs +49 -54
  118. package/dist/llm/executor/turn-executor.d.ts +7 -8
  119. package/dist/llm/executor/turn-executor.d.ts.map +1 -1
  120. package/dist/llm/executor/turn-executor.js +49 -54
  121. package/dist/llm/formatters/vercel.cjs +2 -2
  122. package/dist/llm/formatters/vercel.d.ts +2 -2
  123. package/dist/llm/formatters/vercel.d.ts.map +1 -1
  124. package/dist/llm/providers/local/schemas.d.ts +10 -10
  125. package/dist/llm/registry/auto-update.d.ts +2 -2
  126. package/dist/llm/registry/auto-update.d.ts.map +1 -1
  127. package/dist/llm/registry/index.d.ts +3 -3
  128. package/dist/llm/registry/index.d.ts.map +1 -1
  129. package/dist/llm/resolver.cjs +2 -2
  130. package/dist/llm/resolver.d.ts +4 -4
  131. package/dist/llm/resolver.d.ts.map +1 -1
  132. package/dist/llm/schemas.cjs +67 -104
  133. package/dist/llm/schemas.d.ts +6 -145
  134. package/dist/llm/schemas.d.ts.map +1 -1
  135. package/dist/llm/schemas.js +64 -101
  136. package/dist/llm/services/factory.cjs +2 -3
  137. package/dist/llm/services/factory.d.ts +3 -4
  138. package/dist/llm/services/factory.d.ts.map +1 -1
  139. package/dist/llm/services/factory.js +2 -3
  140. package/dist/llm/services/vercel.cjs +7 -14
  141. package/dist/llm/services/vercel.d.ts +6 -7
  142. package/dist/llm/services/vercel.d.ts.map +1 -1
  143. package/dist/llm/services/vercel.js +7 -14
  144. package/dist/llm/validation.cjs +1 -1
  145. package/dist/llm/validation.d.ts +2 -2
  146. package/dist/llm/validation.d.ts.map +1 -1
  147. package/dist/logger/browser.cjs +4 -4
  148. package/dist/logger/browser.d.ts +4 -4
  149. package/dist/logger/browser.d.ts.map +1 -1
  150. package/dist/logger/browser.js +3 -3
  151. package/dist/{context/compaction/providers/noop-provider.cjs → logger/default-logger-factory.cjs} +16 -22
  152. package/dist/logger/default-logger-factory.d.ts +301 -0
  153. package/dist/logger/default-logger-factory.d.ts.map +1 -0
  154. package/dist/logger/default-logger-factory.js +18 -0
  155. package/dist/logger/factory.d.ts +2 -2
  156. package/dist/logger/factory.d.ts.map +1 -1
  157. package/dist/logger/index.cjs +7 -2
  158. package/dist/logger/index.d.ts +5 -3
  159. package/dist/logger/index.d.ts.map +1 -1
  160. package/dist/logger/index.js +8 -2
  161. package/dist/logger/logger.cjs +4 -4
  162. package/dist/logger/logger.d.ts +4 -4
  163. package/dist/logger/logger.d.ts.map +1 -1
  164. package/dist/logger/logger.js +3 -3
  165. package/dist/logger/v2/dexto-logger.d.ts +3 -3
  166. package/dist/logger/v2/dexto-logger.d.ts.map +1 -1
  167. package/dist/logger/v2/schemas.d.ts +12 -12
  168. package/dist/logger/v2/test-utils.d.ts +5 -5
  169. package/dist/logger/v2/test-utils.d.ts.map +1 -1
  170. package/dist/logger/v2/transport-factory.d.ts +3 -3
  171. package/dist/logger/v2/transport-factory.d.ts.map +1 -1
  172. package/dist/logger/v2/transports/console-transport.d.ts +2 -2
  173. package/dist/logger/v2/transports/console-transport.d.ts.map +1 -1
  174. package/dist/logger/v2/transports/file-transport.d.ts +2 -2
  175. package/dist/logger/v2/transports/file-transport.d.ts.map +1 -1
  176. package/dist/logger/v2/transports/silent-transport.d.ts +2 -2
  177. package/dist/logger/v2/transports/silent-transport.d.ts.map +1 -1
  178. package/dist/logger/v2/types.cjs +1 -1
  179. package/dist/logger/v2/types.d.ts +8 -8
  180. package/dist/logger/v2/types.d.ts.map +1 -1
  181. package/dist/logger/v2/types.js +1 -1
  182. package/dist/mcp/errors.cjs +2 -2
  183. package/dist/mcp/errors.d.ts.map +1 -1
  184. package/dist/mcp/manager.cjs +16 -11
  185. package/dist/mcp/manager.d.ts +16 -13
  186. package/dist/mcp/manager.d.ts.map +1 -1
  187. package/dist/mcp/manager.js +17 -12
  188. package/dist/mcp/mcp-client.cjs +25 -20
  189. package/dist/mcp/mcp-client.d.ts +5 -5
  190. package/dist/mcp/mcp-client.d.ts.map +1 -1
  191. package/dist/mcp/mcp-client.js +20 -15
  192. package/dist/mcp/resolver.cjs +1 -1
  193. package/dist/mcp/schemas.cjs +5 -5
  194. package/dist/mcp/schemas.d.ts +4 -4
  195. package/dist/mcp/schemas.js +2 -2
  196. package/dist/mcp/types.d.ts +7 -7
  197. package/dist/mcp/types.d.ts.map +1 -1
  198. package/dist/memory/manager.d.ts +2 -2
  199. package/dist/memory/manager.d.ts.map +1 -1
  200. package/dist/memory/schemas.d.ts +2 -2
  201. package/dist/prompts/errors.cjs +3 -3
  202. package/dist/prompts/errors.d.ts.map +1 -1
  203. package/dist/prompts/prompt-manager.d.ts +3 -3
  204. package/dist/prompts/prompt-manager.d.ts.map +1 -1
  205. package/dist/prompts/providers/config-prompt-provider.cjs +15 -29
  206. package/dist/prompts/providers/config-prompt-provider.d.ts +3 -3
  207. package/dist/prompts/providers/config-prompt-provider.d.ts.map +1 -1
  208. package/dist/prompts/providers/config-prompt-provider.js +15 -29
  209. package/dist/prompts/providers/custom-prompt-provider.d.ts +2 -2
  210. package/dist/prompts/providers/custom-prompt-provider.d.ts.map +1 -1
  211. package/dist/prompts/providers/mcp-prompt-provider.d.ts +2 -2
  212. package/dist/prompts/providers/mcp-prompt-provider.d.ts.map +1 -1
  213. package/dist/prompts/schemas.d.ts +4 -4
  214. package/dist/resources/{internal-provider.cjs → agent-resources-provider.cjs} +16 -16
  215. package/dist/resources/{internal-provider.d.ts → agent-resources-provider.d.ts} +6 -6
  216. package/dist/resources/agent-resources-provider.d.ts.map +1 -0
  217. package/dist/resources/{internal-provider.js → agent-resources-provider.js} +13 -13
  218. package/dist/resources/errors.cjs +2 -2
  219. package/dist/resources/errors.d.ts.map +1 -1
  220. package/dist/resources/handlers/blob-handler.d.ts +2 -2
  221. package/dist/resources/handlers/blob-handler.d.ts.map +1 -1
  222. package/dist/resources/handlers/factory.d.ts +3 -3
  223. package/dist/resources/handlers/factory.d.ts.map +1 -1
  224. package/dist/resources/handlers/filesystem-handler.d.ts +2 -2
  225. package/dist/resources/handlers/filesystem-handler.d.ts.map +1 -1
  226. package/dist/resources/index.cjs +7 -9
  227. package/dist/resources/index.d.ts +3 -3
  228. package/dist/resources/index.d.ts.map +1 -1
  229. package/dist/resources/index.js +5 -10
  230. package/dist/resources/manager.cjs +77 -74
  231. package/dist/resources/manager.d.ts +16 -7
  232. package/dist/resources/manager.d.ts.map +1 -1
  233. package/dist/resources/manager.js +77 -74
  234. package/dist/resources/schemas.cjs +6 -26
  235. package/dist/resources/schemas.d.ts +8 -100
  236. package/dist/resources/schemas.d.ts.map +1 -1
  237. package/dist/resources/schemas.js +4 -23
  238. package/dist/search/search-service.d.ts +2 -2
  239. package/dist/search/search-service.d.ts.map +1 -1
  240. package/dist/session/chat-session.cjs +15 -25
  241. package/dist/session/chat-session.d.ts +7 -5
  242. package/dist/session/chat-session.d.ts.map +1 -1
  243. package/dist/session/chat-session.js +16 -26
  244. package/dist/session/errors.cjs +2 -2
  245. package/dist/session/errors.d.ts.map +1 -1
  246. package/dist/session/history/database.cjs +1 -1
  247. package/dist/session/history/database.d.ts +4 -4
  248. package/dist/session/history/database.d.ts.map +1 -1
  249. package/dist/session/history/factory.d.ts +3 -3
  250. package/dist/session/history/factory.d.ts.map +1 -1
  251. package/dist/session/history/memory.d.ts +4 -4
  252. package/dist/session/history/memory.d.ts.map +1 -1
  253. package/dist/session/history/types.d.ts +2 -2
  254. package/dist/session/history/types.d.ts.map +1 -1
  255. package/dist/session/index.cjs +3 -0
  256. package/dist/session/index.d.ts +2 -0
  257. package/dist/session/index.d.ts.map +1 -1
  258. package/dist/session/index.js +2 -0
  259. package/dist/session/message-queue.d.ts +2 -2
  260. package/dist/session/message-queue.d.ts.map +1 -1
  261. package/dist/session/session-manager.cjs +67 -9
  262. package/dist/session/session-manager.d.ts +46 -7
  263. package/dist/session/session-manager.d.ts.map +1 -1
  264. package/dist/session/session-manager.js +67 -9
  265. package/dist/session/title-generator.cjs +2 -2
  266. package/dist/session/title-generator.d.ts +2 -2
  267. package/dist/session/title-generator.d.ts.map +1 -1
  268. package/dist/storage/blob/index.cjs +0 -40
  269. package/dist/storage/blob/index.d.ts +2 -44
  270. package/dist/storage/blob/index.d.ts.map +1 -1
  271. package/dist/storage/blob/index.js +0 -30
  272. package/dist/storage/cache/index.cjs +0 -37
  273. package/dist/storage/cache/index.d.ts +0 -42
  274. package/dist/storage/cache/index.d.ts.map +1 -1
  275. package/dist/storage/cache/index.js +0 -28
  276. package/dist/storage/database/index.cjs +0 -42
  277. package/dist/storage/database/index.d.ts +0 -43
  278. package/dist/storage/database/index.d.ts.map +1 -1
  279. package/dist/storage/database/index.js +0 -37
  280. package/dist/storage/error-codes.cjs +1 -6
  281. package/dist/storage/error-codes.d.ts +2 -7
  282. package/dist/storage/error-codes.d.ts.map +1 -1
  283. package/dist/storage/error-codes.js +1 -6
  284. package/dist/storage/errors.cjs +18 -82
  285. package/dist/storage/errors.d.ts +4 -24
  286. package/dist/storage/errors.d.ts.map +1 -1
  287. package/dist/storage/errors.js +16 -80
  288. package/dist/storage/index.cjs +8 -69
  289. package/dist/storage/index.d.ts +11 -66
  290. package/dist/storage/index.d.ts.map +1 -1
  291. package/dist/storage/index.js +6 -50
  292. package/dist/storage/storage-manager.cjs +9 -25
  293. package/dist/storage/storage-manager.d.ts +11 -15
  294. package/dist/storage/storage-manager.d.ts.map +1 -1
  295. package/dist/storage/storage-manager.js +8 -23
  296. package/dist/storage/types.d.ts +0 -1
  297. package/dist/storage/types.d.ts.map +1 -1
  298. package/dist/systemPrompt/contributors.d.ts +4 -4
  299. package/dist/systemPrompt/contributors.d.ts.map +1 -1
  300. package/dist/systemPrompt/errors.cjs +2 -2
  301. package/dist/systemPrompt/errors.d.ts.map +1 -1
  302. package/dist/systemPrompt/manager.cjs +1 -5
  303. package/dist/systemPrompt/manager.d.ts +2 -3
  304. package/dist/systemPrompt/manager.d.ts.map +1 -1
  305. package/dist/systemPrompt/manager.js +1 -5
  306. package/dist/telemetry/index.cjs +3 -0
  307. package/dist/telemetry/index.d.ts +2 -0
  308. package/dist/telemetry/index.d.ts.map +1 -1
  309. package/dist/telemetry/index.js +2 -0
  310. package/dist/telemetry/utils.d.ts +4 -4
  311. package/dist/telemetry/utils.d.ts.map +1 -1
  312. package/dist/test-utils/in-memory-storage.cjs +288 -0
  313. package/dist/test-utils/in-memory-storage.js +252 -0
  314. package/dist/tools/confirmation/allowed-tools-provider/factory.d.ts +3 -3
  315. package/dist/tools/confirmation/allowed-tools-provider/factory.d.ts.map +1 -1
  316. package/dist/tools/confirmation/allowed-tools-provider/in-memory.d.ts +2 -2
  317. package/dist/tools/confirmation/allowed-tools-provider/in-memory.d.ts.map +1 -1
  318. package/dist/tools/confirmation/allowed-tools-provider/storage.d.ts +4 -4
  319. package/dist/tools/confirmation/allowed-tools-provider/storage.d.ts.map +1 -1
  320. package/dist/tools/confirmation/allowed-tools-provider/types.d.ts +2 -2
  321. package/dist/tools/confirmation/allowed-tools-provider/types.d.ts.map +1 -1
  322. package/dist/tools/{internal-tools/constants.cjs → define-tool.cjs} +8 -13
  323. package/dist/tools/define-tool.d.ts +11 -0
  324. package/dist/tools/define-tool.d.ts.map +1 -0
  325. package/dist/tools/define-tool.js +7 -0
  326. package/dist/tools/error-codes.cjs +2 -2
  327. package/dist/tools/error-codes.d.ts +2 -2
  328. package/dist/tools/error-codes.d.ts.map +1 -1
  329. package/dist/tools/error-codes.js +2 -2
  330. package/dist/tools/errors.cjs +11 -23
  331. package/dist/tools/errors.d.ts +4 -10
  332. package/dist/tools/errors.d.ts.map +1 -1
  333. package/dist/tools/errors.js +9 -21
  334. package/dist/tools/index.cjs +3 -8
  335. package/dist/tools/index.d.ts +2 -4
  336. package/dist/tools/index.d.ts.map +1 -1
  337. package/dist/tools/index.js +2 -7
  338. package/dist/{storage/blob/providers/index.cjs → tools/pattern-utils.cjs} +11 -9
  339. package/dist/tools/pattern-utils.d.ts +20 -0
  340. package/dist/tools/pattern-utils.d.ts.map +1 -0
  341. package/dist/tools/pattern-utils.js +10 -0
  342. package/dist/tools/schemas.cjs +14 -40
  343. package/dist/tools/schemas.d.ts +6 -50
  344. package/dist/tools/schemas.d.ts.map +1 -1
  345. package/dist/tools/schemas.js +11 -32
  346. package/dist/tools/tool-call-metadata.cjs +3 -3
  347. package/dist/tools/tool-call-metadata.d.ts +1 -1
  348. package/dist/tools/tool-call-metadata.d.ts.map +1 -1
  349. package/dist/tools/tool-call-metadata.js +3 -3
  350. package/dist/tools/tool-manager.cjs +376 -327
  351. package/dist/tools/tool-manager.d.ts +63 -80
  352. package/dist/tools/tool-manager.d.ts.map +1 -1
  353. package/dist/tools/tool-manager.js +376 -331
  354. package/dist/tools/types.d.ts +112 -13
  355. package/dist/tools/types.d.ts.map +1 -1
  356. package/dist/utils/error-conversion.d.ts +2 -2
  357. package/dist/utils/error-conversion.d.ts.map +1 -1
  358. package/dist/utils/path.d.ts +2 -2
  359. package/dist/utils/path.d.ts.map +1 -1
  360. package/dist/utils/result.cjs +1 -1
  361. package/dist/utils/result.d.ts.map +1 -1
  362. package/dist/utils/schema.cjs +9 -5
  363. package/dist/utils/schema.d.ts +4 -2
  364. package/dist/utils/schema.d.ts.map +1 -1
  365. package/dist/utils/schema.js +9 -5
  366. package/dist/utils/service-initializer.cjs +51 -56
  367. package/dist/utils/service-initializer.d.ts +17 -14
  368. package/dist/utils/service-initializer.d.ts.map +1 -1
  369. package/dist/utils/service-initializer.js +51 -56
  370. package/dist/{storage/cache/providers/index.cjs → workspace/error-codes.cjs} +8 -9
  371. package/dist/workspace/error-codes.d.ts +5 -0
  372. package/dist/workspace/error-codes.d.ts.map +1 -0
  373. package/dist/workspace/error-codes.js +7 -0
  374. package/dist/{storage/blob/factory.cjs → workspace/errors.cjs} +20 -14
  375. package/dist/workspace/errors.d.ts +5 -0
  376. package/dist/workspace/errors.d.ts.map +1 -0
  377. package/dist/workspace/errors.js +21 -0
  378. package/dist/{image → workspace}/index.cjs +12 -10
  379. package/dist/workspace/index.d.ts +5 -0
  380. package/dist/workspace/index.d.ts.map +1 -0
  381. package/dist/workspace/index.js +9 -0
  382. package/dist/workspace/manager.cjs +113 -0
  383. package/dist/workspace/manager.d.ts +18 -0
  384. package/dist/workspace/manager.d.ts.map +1 -0
  385. package/dist/workspace/manager.js +90 -0
  386. package/dist/workspace/types.d.ts +14 -0
  387. package/dist/workspace/types.d.ts.map +1 -0
  388. package/package.json +2 -2
  389. package/dist/context/compaction/factory.cjs +0 -57
  390. package/dist/context/compaction/factory.d.ts +0 -17
  391. package/dist/context/compaction/factory.d.ts.map +0 -1
  392. package/dist/context/compaction/factory.js +0 -34
  393. package/dist/context/compaction/provider.d.ts +0 -48
  394. package/dist/context/compaction/provider.d.ts.map +0 -1
  395. package/dist/context/compaction/providers/noop-provider.d.ts +0 -24
  396. package/dist/context/compaction/providers/noop-provider.d.ts.map +0 -1
  397. package/dist/context/compaction/providers/noop-provider.js +0 -24
  398. package/dist/context/compaction/providers/reactive-overflow-provider.cjs +0 -76
  399. package/dist/context/compaction/providers/reactive-overflow-provider.d.ts +0 -51
  400. package/dist/context/compaction/providers/reactive-overflow-provider.d.ts.map +0 -1
  401. package/dist/context/compaction/providers/reactive-overflow-provider.js +0 -52
  402. package/dist/context/compaction/registry.cjs +0 -39
  403. package/dist/context/compaction/registry.d.ts +0 -19
  404. package/dist/context/compaction/registry.d.ts.map +0 -1
  405. package/dist/context/compaction/registry.js +0 -16
  406. package/dist/context/compaction/schemas.cjs +0 -58
  407. package/dist/context/compaction/schemas.d.ts +0 -69
  408. package/dist/context/compaction/schemas.d.ts.map +0 -1
  409. package/dist/context/compaction/schemas.js +0 -34
  410. package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +0 -1
  411. package/dist/image/define-image.cjs +0 -146
  412. package/dist/image/define-image.d.ts +0 -71
  413. package/dist/image/define-image.d.ts.map +0 -1
  414. package/dist/image/define-image.js +0 -121
  415. package/dist/image/index.d.ts +0 -53
  416. package/dist/image/index.d.ts.map +0 -1
  417. package/dist/image/index.js +0 -7
  418. package/dist/image/types.d.ts +0 -246
  419. package/dist/image/types.d.ts.map +0 -1
  420. package/dist/llm/services/test-utils.integration.cjs +0 -237
  421. package/dist/llm/services/test-utils.integration.d.ts +0 -48
  422. package/dist/llm/services/test-utils.integration.d.ts.map +0 -1
  423. package/dist/llm/services/test-utils.integration.js +0 -214
  424. package/dist/plugins/builtins/content-policy.d.ts +0 -26
  425. package/dist/plugins/builtins/content-policy.d.ts.map +0 -1
  426. package/dist/plugins/builtins/response-sanitizer.d.ts +0 -25
  427. package/dist/plugins/builtins/response-sanitizer.d.ts.map +0 -1
  428. package/dist/plugins/error-codes.cjs +0 -43
  429. package/dist/plugins/error-codes.d.ts +0 -34
  430. package/dist/plugins/error-codes.d.ts.map +0 -1
  431. package/dist/plugins/error-codes.js +0 -20
  432. package/dist/plugins/index.cjs +0 -61
  433. package/dist/plugins/index.d.ts +0 -21
  434. package/dist/plugins/index.d.ts.map +0 -1
  435. package/dist/plugins/index.js +0 -30
  436. package/dist/plugins/loader.cjs +0 -171
  437. package/dist/plugins/loader.d.ts +0 -30
  438. package/dist/plugins/loader.d.ts.map +0 -1
  439. package/dist/plugins/loader.js +0 -145
  440. package/dist/plugins/manager.cjs +0 -473
  441. package/dist/plugins/manager.d.ts +0 -106
  442. package/dist/plugins/manager.d.ts.map +0 -1
  443. package/dist/plugins/manager.js +0 -450
  444. package/dist/plugins/registrations/builtins.cjs +0 -51
  445. package/dist/plugins/registrations/builtins.d.ts +0 -17
  446. package/dist/plugins/registrations/builtins.d.ts.map +0 -1
  447. package/dist/plugins/registrations/builtins.js +0 -28
  448. package/dist/plugins/registry.cjs +0 -63
  449. package/dist/plugins/registry.d.ts +0 -101
  450. package/dist/plugins/registry.d.ts.map +0 -1
  451. package/dist/plugins/registry.js +0 -39
  452. package/dist/plugins/schemas.cjs +0 -73
  453. package/dist/plugins/schemas.d.ts +0 -195
  454. package/dist/plugins/schemas.d.ts.map +0 -1
  455. package/dist/plugins/schemas.js +0 -47
  456. package/dist/plugins/types.d.ts.map +0 -1
  457. package/dist/providers/base-registry.cjs +0 -147
  458. package/dist/providers/base-registry.d.ts +0 -147
  459. package/dist/providers/base-registry.d.ts.map +0 -1
  460. package/dist/providers/base-registry.js +0 -123
  461. package/dist/providers/discovery.cjs +0 -109
  462. package/dist/providers/discovery.d.ts +0 -96
  463. package/dist/providers/discovery.d.ts.map +0 -1
  464. package/dist/providers/discovery.js +0 -84
  465. package/dist/providers/index.cjs +0 -24
  466. package/dist/providers/index.d.ts +0 -32
  467. package/dist/providers/index.d.ts.map +0 -1
  468. package/dist/providers/index.js +0 -2
  469. package/dist/resources/internal-provider.d.ts.map +0 -1
  470. package/dist/storage/blob/factory.d.ts +0 -37
  471. package/dist/storage/blob/factory.d.ts.map +0 -1
  472. package/dist/storage/blob/factory.js +0 -15
  473. package/dist/storage/blob/local-blob-store.cjs +0 -496
  474. package/dist/storage/blob/local-blob-store.d.ts +0 -58
  475. package/dist/storage/blob/local-blob-store.d.ts.map +0 -1
  476. package/dist/storage/blob/local-blob-store.js +0 -463
  477. package/dist/storage/blob/memory-blob-store.cjs +0 -326
  478. package/dist/storage/blob/memory-blob-store.d.ts +0 -66
  479. package/dist/storage/blob/memory-blob-store.d.ts.map +0 -1
  480. package/dist/storage/blob/memory-blob-store.js +0 -303
  481. package/dist/storage/blob/provider.d.ts +0 -50
  482. package/dist/storage/blob/provider.d.ts.map +0 -1
  483. package/dist/storage/blob/providers/index.d.ts +0 -8
  484. package/dist/storage/blob/providers/index.d.ts.map +0 -1
  485. package/dist/storage/blob/providers/index.js +0 -7
  486. package/dist/storage/blob/providers/local.cjs +0 -39
  487. package/dist/storage/blob/providers/local.d.ts +0 -17
  488. package/dist/storage/blob/providers/local.d.ts.map +0 -1
  489. package/dist/storage/blob/providers/local.js +0 -16
  490. package/dist/storage/blob/providers/memory.cjs +0 -39
  491. package/dist/storage/blob/providers/memory.d.ts +0 -17
  492. package/dist/storage/blob/providers/memory.d.ts.map +0 -1
  493. package/dist/storage/blob/providers/memory.js +0 -16
  494. package/dist/storage/blob/registry.cjs +0 -50
  495. package/dist/storage/blob/registry.d.ts +0 -42
  496. package/dist/storage/blob/registry.d.ts.map +0 -1
  497. package/dist/storage/blob/registry.js +0 -26
  498. package/dist/storage/blob/schemas.cjs +0 -52
  499. package/dist/storage/blob/schemas.d.ts +0 -85
  500. package/dist/storage/blob/schemas.d.ts.map +0 -1
  501. package/dist/storage/blob/schemas.js +0 -26
  502. package/dist/storage/cache/factory.cjs +0 -38
  503. package/dist/storage/cache/factory.d.ts +0 -37
  504. package/dist/storage/cache/factory.d.ts.map +0 -1
  505. package/dist/storage/cache/factory.js +0 -15
  506. package/dist/storage/cache/memory-cache-store.cjs +0 -107
  507. package/dist/storage/cache/memory-cache-store.d.ts +0 -26
  508. package/dist/storage/cache/memory-cache-store.d.ts.map +0 -1
  509. package/dist/storage/cache/memory-cache-store.js +0 -84
  510. package/dist/storage/cache/provider.cjs +0 -16
  511. package/dist/storage/cache/provider.d.ts +0 -56
  512. package/dist/storage/cache/provider.d.ts.map +0 -1
  513. package/dist/storage/cache/provider.js +0 -0
  514. package/dist/storage/cache/providers/index.d.ts +0 -8
  515. package/dist/storage/cache/providers/index.d.ts.map +0 -1
  516. package/dist/storage/cache/providers/index.js +0 -7
  517. package/dist/storage/cache/providers/memory.d.ts +0 -17
  518. package/dist/storage/cache/providers/memory.d.ts.map +0 -1
  519. package/dist/storage/cache/providers/memory.js +0 -17
  520. package/dist/storage/cache/providers/redis.cjs +0 -66
  521. package/dist/storage/cache/providers/redis.d.ts +0 -20
  522. package/dist/storage/cache/providers/redis.d.ts.map +0 -1
  523. package/dist/storage/cache/providers/redis.js +0 -33
  524. package/dist/storage/cache/redis-store.cjs +0 -173
  525. package/dist/storage/cache/redis-store.d.ts +0 -32
  526. package/dist/storage/cache/redis-store.d.ts.map +0 -1
  527. package/dist/storage/cache/redis-store.js +0 -150
  528. package/dist/storage/cache/registry.cjs +0 -50
  529. package/dist/storage/cache/registry.d.ts +0 -42
  530. package/dist/storage/cache/registry.d.ts.map +0 -1
  531. package/dist/storage/cache/registry.js +0 -26
  532. package/dist/storage/cache/schemas.cjs +0 -81
  533. package/dist/storage/cache/schemas.d.ts +0 -150
  534. package/dist/storage/cache/schemas.d.ts.map +0 -1
  535. package/dist/storage/cache/schemas.js +0 -55
  536. package/dist/storage/database/factory.cjs +0 -38
  537. package/dist/storage/database/factory.d.ts +0 -39
  538. package/dist/storage/database/factory.d.ts.map +0 -1
  539. package/dist/storage/database/factory.js +0 -15
  540. package/dist/storage/database/memory-database-store.cjs +0 -122
  541. package/dist/storage/database/memory-database-store.d.ts +0 -29
  542. package/dist/storage/database/memory-database-store.d.ts.map +0 -1
  543. package/dist/storage/database/memory-database-store.js +0 -99
  544. package/dist/storage/database/postgres-store.cjs +0 -342
  545. package/dist/storage/database/postgres-store.d.ts +0 -55
  546. package/dist/storage/database/postgres-store.d.ts.map +0 -1
  547. package/dist/storage/database/postgres-store.js +0 -319
  548. package/dist/storage/database/provider.cjs +0 -16
  549. package/dist/storage/database/provider.d.ts +0 -56
  550. package/dist/storage/database/provider.d.ts.map +0 -1
  551. package/dist/storage/database/provider.js +0 -0
  552. package/dist/storage/database/providers/index.cjs +0 -34
  553. package/dist/storage/database/providers/index.d.ts +0 -9
  554. package/dist/storage/database/providers/index.d.ts.map +0 -1
  555. package/dist/storage/database/providers/index.js +0 -9
  556. package/dist/storage/database/providers/memory.cjs +0 -40
  557. package/dist/storage/database/providers/memory.d.ts +0 -16
  558. package/dist/storage/database/providers/memory.d.ts.map +0 -1
  559. package/dist/storage/database/providers/memory.js +0 -17
  560. package/dist/storage/database/providers/postgres.cjs +0 -62
  561. package/dist/storage/database/providers/postgres.d.ts +0 -19
  562. package/dist/storage/database/providers/postgres.d.ts.map +0 -1
  563. package/dist/storage/database/providers/postgres.js +0 -29
  564. package/dist/storage/database/providers/sqlite.cjs +0 -66
  565. package/dist/storage/database/providers/sqlite.d.ts +0 -20
  566. package/dist/storage/database/providers/sqlite.d.ts.map +0 -1
  567. package/dist/storage/database/providers/sqlite.js +0 -33
  568. package/dist/storage/database/registry.cjs +0 -50
  569. package/dist/storage/database/registry.d.ts +0 -42
  570. package/dist/storage/database/registry.d.ts.map +0 -1
  571. package/dist/storage/database/registry.js +0 -26
  572. package/dist/storage/database/schemas.cjs +0 -97
  573. package/dist/storage/database/schemas.d.ts +0 -226
  574. package/dist/storage/database/schemas.d.ts.map +0 -1
  575. package/dist/storage/database/schemas.js +0 -70
  576. package/dist/storage/database/sqlite-store.cjs +0 -270
  577. package/dist/storage/database/sqlite-store.d.ts +0 -33
  578. package/dist/storage/database/sqlite-store.d.ts.map +0 -1
  579. package/dist/storage/database/sqlite-store.js +0 -237
  580. package/dist/storage/schemas.cjs +0 -57
  581. package/dist/storage/schemas.d.ts +0 -347
  582. package/dist/storage/schemas.d.ts.map +0 -1
  583. package/dist/storage/schemas.js +0 -37
  584. package/dist/tools/bash-pattern-utils.cjs +0 -91
  585. package/dist/tools/bash-pattern-utils.d.ts +0 -58
  586. package/dist/tools/bash-pattern-utils.d.ts.map +0 -1
  587. package/dist/tools/bash-pattern-utils.js +0 -64
  588. package/dist/tools/custom-tool-registry.cjs +0 -64
  589. package/dist/tools/custom-tool-registry.d.ts +0 -126
  590. package/dist/tools/custom-tool-registry.d.ts.map +0 -1
  591. package/dist/tools/custom-tool-registry.js +0 -40
  592. package/dist/tools/custom-tool-schema-registry.cjs +0 -164
  593. package/dist/tools/custom-tool-schema-registry.d.ts +0 -86
  594. package/dist/tools/custom-tool-schema-registry.d.ts.map +0 -1
  595. package/dist/tools/custom-tool-schema-registry.js +0 -140
  596. package/dist/tools/internal-tools/constants.d.ts +0 -12
  597. package/dist/tools/internal-tools/constants.d.ts.map +0 -1
  598. package/dist/tools/internal-tools/constants.js +0 -12
  599. package/dist/tools/internal-tools/implementations/ask-user-tool.cjs +0 -57
  600. package/dist/tools/internal-tools/implementations/ask-user-tool.d.ts +0 -18
  601. package/dist/tools/internal-tools/implementations/ask-user-tool.d.ts.map +0 -1
  602. package/dist/tools/internal-tools/implementations/ask-user-tool.js +0 -34
  603. package/dist/tools/internal-tools/implementations/delegate-to-url-tool.cjs +0 -192
  604. package/dist/tools/internal-tools/implementations/delegate-to-url-tool.d.ts +0 -33
  605. package/dist/tools/internal-tools/implementations/delegate-to-url-tool.d.ts.map +0 -1
  606. package/dist/tools/internal-tools/implementations/delegate-to-url-tool.js +0 -169
  607. package/dist/tools/internal-tools/implementations/get-resource-tool.cjs +0 -113
  608. package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts +0 -30
  609. package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts.map +0 -1
  610. package/dist/tools/internal-tools/implementations/get-resource-tool.js +0 -90
  611. package/dist/tools/internal-tools/implementations/invoke-skill-tool.cjs +0 -140
  612. package/dist/tools/internal-tools/implementations/invoke-skill-tool.d.ts +0 -24
  613. package/dist/tools/internal-tools/implementations/invoke-skill-tool.d.ts.map +0 -1
  614. package/dist/tools/internal-tools/implementations/invoke-skill-tool.js +0 -117
  615. package/dist/tools/internal-tools/implementations/list-resources-tool.cjs +0 -91
  616. package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts +0 -24
  617. package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts.map +0 -1
  618. package/dist/tools/internal-tools/implementations/list-resources-tool.js +0 -68
  619. package/dist/tools/internal-tools/implementations/search-history-tool.cjs +0 -61
  620. package/dist/tools/internal-tools/implementations/search-history-tool.d.ts +0 -7
  621. package/dist/tools/internal-tools/implementations/search-history-tool.d.ts.map +0 -1
  622. package/dist/tools/internal-tools/implementations/search-history-tool.js +0 -38
  623. package/dist/tools/internal-tools/index.cjs +0 -26
  624. package/dist/tools/internal-tools/index.d.ts +0 -4
  625. package/dist/tools/internal-tools/index.d.ts.map +0 -1
  626. package/dist/tools/internal-tools/index.js +0 -3
  627. package/dist/tools/internal-tools/provider.cjs +0 -324
  628. package/dist/tools/internal-tools/provider.d.ts +0 -116
  629. package/dist/tools/internal-tools/provider.d.ts.map +0 -1
  630. package/dist/tools/internal-tools/provider.js +0 -301
  631. package/dist/tools/internal-tools/registry.cjs +0 -71
  632. package/dist/tools/internal-tools/registry.d.ts +0 -91
  633. package/dist/tools/internal-tools/registry.d.ts.map +0 -1
  634. package/dist/tools/internal-tools/registry.js +0 -47
  635. /package/dist/{context/compaction/provider.js → agent/agent-options.js} +0 -0
  636. /package/dist/{image/types.js → agent/runtime-config.js} +0 -0
  637. /package/dist/{image → hooks}/types.cjs +0 -0
  638. /package/dist/{plugins → hooks}/types.js +0 -0
  639. /package/dist/{plugins → workspace}/types.cjs +0 -0
  640. /package/dist/{storage/blob/provider.js → workspace/types.js} +0 -0
@@ -1,9 +1,8 @@
1
- import { type LanguageModel } from 'ai';
2
- import type { ICompactionStrategy } from '../types.js';
3
1
  import type { InternalMessage } from '../../types.js';
4
- import type { IDextoLogger } from '../../../logger/v2/types.js';
2
+ import { type ModelLimits } from '../overflow.js';
3
+ import type { CompactionRuntimeContext, CompactionSettings, CompactionStrategy } from '../types.js';
5
4
  /**
6
- * Configuration options for ReactiveOverflowStrategy.
5
+ * Configuration options for ReactiveOverflowCompactionStrategy.
7
6
  */
8
7
  export interface ReactiveOverflowOptions {
9
8
  /**
@@ -23,8 +22,14 @@ export interface ReactiveOverflowOptions {
23
22
  */
24
23
  summaryPrompt?: string;
25
24
  }
25
+ export interface ReactiveOverflowCompactionStrategyOptions {
26
+ enabled?: boolean | undefined;
27
+ maxContextTokens?: number | undefined;
28
+ thresholdPercent?: number | undefined;
29
+ strategy?: ReactiveOverflowOptions | undefined;
30
+ }
26
31
  /**
27
- * ReactiveOverflowStrategy implements reactive compaction.
32
+ * ReactiveOverflowCompactionStrategy implements reactive compaction.
28
33
  *
29
34
  * Key behaviors:
30
35
  * - Triggers on overflow (after actual tokens exceed context limit)
@@ -42,53 +47,31 @@ export interface ReactiveOverflowOptions {
42
47
  * and filterCompacted() handles excluding old messages at read-time.
43
48
  * This preserves full history for audit/recovery purposes.
44
49
  */
45
- export declare class ReactiveOverflowStrategy implements ICompactionStrategy {
50
+ export declare class ReactiveOverflowCompactionStrategy implements CompactionStrategy {
46
51
  readonly name = "reactive-overflow";
47
- private readonly model;
48
- private readonly options;
49
- private readonly logger;
50
- constructor(model: LanguageModel, options: ReactiveOverflowOptions | undefined, logger: IDextoLogger);
51
- /**
52
- * Generate a summary message for the old portion of history.
53
- *
54
- * IMPORTANT: This does NOT replace history. It returns a summary message
55
- * that the caller should ADD to history via contextManager.addMessage().
56
- * Read-time filtering (filterCompacted) will then exclude pre-summary
57
- * messages when formatting for LLM.
58
- *
59
- * @param history The full conversation history
60
- * @returns Array with single summary message to add, or empty if nothing to summarize
61
- */
62
- compact(history: readonly InternalMessage[]): Promise<InternalMessage[]>;
52
+ private readonly settings;
53
+ private readonly strategyOptions;
54
+ constructor(options?: ReactiveOverflowCompactionStrategyOptions);
55
+ getSettings(): CompactionSettings;
56
+ getModelLimits(modelContextWindow: number): ModelLimits;
57
+ shouldCompact(inputTokens: number, modelLimits: ModelLimits): boolean;
58
+ compact(history: readonly InternalMessage[], context: CompactionRuntimeContext): Promise<InternalMessage[]>;
63
59
  /**
64
60
  * Handle re-compaction when there's already a summary in history.
65
61
  * Only summarizes messages AFTER the existing summary, preventing
66
62
  * cascading summaries of summaries.
67
- *
68
- * @param messagesAfterSummary Messages after the existing summary
69
- * @param fullHistory The complete history (for current task detection)
70
- * @param existingSummaryIndex Index of the existing summary in fullHistory
71
- * @returns Array with single summary message, or empty if nothing to summarize
72
63
  */
73
64
  private compactSubset;
74
65
  /**
75
66
  * Find the most recent user message that represents the current task.
76
- * This helps preserve context about what the user is currently asking for.
77
67
  */
78
68
  private findCurrentTaskMessage;
79
69
  /**
80
70
  * Split history into messages to summarize and messages to keep.
81
- * Keeps the last N turns (user + assistant pairs) intact.
82
- *
83
- * For long agentic conversations with many tool calls, this also ensures
84
- * we don't try to keep too many messages even within preserved turns.
85
71
  */
86
72
  private splitHistory;
87
73
  /**
88
74
  * Generate an LLM summary of the messages.
89
- *
90
- * @param messages Messages to summarize
91
- * @param currentTask The most recent user message (current task context)
92
75
  */
93
76
  private generateSummary;
94
77
  /**
@@ -100,4 +83,4 @@ export declare class ReactiveOverflowStrategy implements ICompactionStrategy {
100
83
  */
101
84
  private createFallbackSummary;
102
85
  }
103
- //# sourceMappingURL=reactive-overflow.d.ts.map
86
+ //# sourceMappingURL=reactive-overflow-compaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactive-overflow-compaction.d.ts","sourceRoot":"","sources":["../../../../src/context/compaction/strategies/reactive-overflow-compaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAY,MAAM,gBAAgB,CAAC;AAGhE,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEpG;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,yCAAyC;IACtD,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC;CAClD;AAsCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,kCAAmC,YAAW,kBAAkB;IACzE,QAAQ,CAAC,IAAI,uBAAuB;IAEpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAoC;gBAExD,OAAO,GAAE,yCAA8C;IAYnE,WAAW,IAAI,kBAAkB;IAIjC,cAAc,CAAC,kBAAkB,EAAE,MAAM,GAAG,WAAW;IASvD,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO;IAO/D,OAAO,CACT,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,eAAe,EAAE,CAAC;IA+F7B;;;;OAIG;YACW,aAAa;IA8C3B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAsB9B;;OAEG;IACH,OAAO,CAAC,YAAY;IA8CpB;;OAEG;YACW,eAAe;IAkC7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAuChC;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAyDhC"}
@@ -1,6 +1,7 @@
1
1
  import "../../../chunk-PTJYTZNU.js";
2
2
  import { generateText } from "ai";
3
3
  import { isAssistantMessage, isToolMessage } from "../../types.js";
4
+ import { isOverflow } from "../overflow.js";
4
5
  const DEFAULT_OPTIONS = {
5
6
  preserveLastNTurns: 2,
6
7
  maxSummaryTokens: 2e3,
@@ -36,30 +37,43 @@ IMPORTANT: The assistant will continue working based on this summary. Ensure the
36
37
  Conversation to summarize:
37
38
  {conversation}`
38
39
  };
39
- class ReactiveOverflowStrategy {
40
+ class ReactiveOverflowCompactionStrategy {
40
41
  name = "reactive-overflow";
41
- model;
42
- options;
43
- logger;
44
- constructor(model, options = {}, logger) {
45
- this.model = model;
46
- this.options = { ...DEFAULT_OPTIONS, ...options };
47
- this.logger = logger;
42
+ settings;
43
+ strategyOptions;
44
+ constructor(options = {}) {
45
+ this.settings = {
46
+ enabled: options.enabled ?? true,
47
+ maxContextTokens: options.maxContextTokens,
48
+ thresholdPercent: options.thresholdPercent ?? 0.9
49
+ };
50
+ this.strategyOptions = {
51
+ ...DEFAULT_OPTIONS,
52
+ ...options.strategy ?? {}
53
+ };
48
54
  }
49
- /**
50
- * Generate a summary message for the old portion of history.
51
- *
52
- * IMPORTANT: This does NOT replace history. It returns a summary message
53
- * that the caller should ADD to history via contextManager.addMessage().
54
- * Read-time filtering (filterCompacted) will then exclude pre-summary
55
- * messages when formatting for LLM.
56
- *
57
- * @param history The full conversation history
58
- * @returns Array with single summary message to add, or empty if nothing to summarize
59
- */
60
- async compact(history) {
55
+ getSettings() {
56
+ return this.settings;
57
+ }
58
+ getModelLimits(modelContextWindow) {
59
+ const capped = this.settings.enabled && this.settings.maxContextTokens !== void 0 ? Math.min(modelContextWindow, this.settings.maxContextTokens) : modelContextWindow;
60
+ return { contextWindow: capped };
61
+ }
62
+ shouldCompact(inputTokens, modelLimits) {
63
+ if (!this.settings.enabled) {
64
+ return false;
65
+ }
66
+ return isOverflow({ inputTokens }, modelLimits, this.settings.thresholdPercent);
67
+ }
68
+ async compact(history, context) {
69
+ if (!this.settings.enabled) {
70
+ return [];
71
+ }
72
+ const { model, logger } = context;
61
73
  if (history.length <= 2) {
62
- this.logger.debug("ReactiveOverflowStrategy: History too short, skipping compaction");
74
+ logger.debug(
75
+ "ReactiveOverflowCompactionStrategy: History too short, skipping compaction"
76
+ );
63
77
  return [];
64
78
  }
65
79
  let existingSummaryIndex = -1;
@@ -73,26 +87,32 @@ class ReactiveOverflowStrategy {
73
87
  if (existingSummaryIndex !== -1) {
74
88
  const messagesAfterSummary = history.slice(existingSummaryIndex + 1);
75
89
  if (messagesAfterSummary.length <= 4) {
76
- this.logger.debug(
77
- `ReactiveOverflowStrategy: Only ${messagesAfterSummary.length} messages after existing summary, skipping re-compaction`
90
+ logger.debug(
91
+ `ReactiveOverflowCompactionStrategy: Only ${messagesAfterSummary.length} messages after existing summary, skipping re-compaction`
78
92
  );
79
93
  return [];
80
94
  }
81
- this.logger.info(
82
- `ReactiveOverflowStrategy: Found existing summary at index ${existingSummaryIndex}, working with ${messagesAfterSummary.length} messages after it`
95
+ logger.info(
96
+ `ReactiveOverflowCompactionStrategy: Found existing summary at index ${existingSummaryIndex}, working with ${messagesAfterSummary.length} messages after it`
97
+ );
98
+ return this.compactSubset(
99
+ messagesAfterSummary,
100
+ history,
101
+ existingSummaryIndex,
102
+ model,
103
+ logger
83
104
  );
84
- return this.compactSubset(messagesAfterSummary, history, existingSummaryIndex);
85
105
  }
86
106
  const { toSummarize, toKeep } = this.splitHistory(history);
87
107
  if (toSummarize.length === 0) {
88
- this.logger.debug("ReactiveOverflowStrategy: No messages to summarize");
108
+ logger.debug("ReactiveOverflowCompactionStrategy: No messages to summarize");
89
109
  return [];
90
110
  }
91
111
  const currentTaskMessage = this.findCurrentTaskMessage(history);
92
- this.logger.info(
93
- `ReactiveOverflowStrategy: Summarizing ${toSummarize.length} messages, keeping ${toKeep.length}`
112
+ logger.info(
113
+ `ReactiveOverflowCompactionStrategy: Summarizing ${toSummarize.length} messages, keeping ${toKeep.length}`
94
114
  );
95
- const summary = await this.generateSummary(toSummarize, currentTaskMessage);
115
+ const summary = await this.generateSummary(toSummarize, currentTaskMessage, model, logger);
96
116
  const summaryMessage = {
97
117
  role: "assistant",
98
118
  content: [{ type: "text", text: summary }],
@@ -111,23 +131,18 @@ class ReactiveOverflowStrategy {
111
131
  * Handle re-compaction when there's already a summary in history.
112
132
  * Only summarizes messages AFTER the existing summary, preventing
113
133
  * cascading summaries of summaries.
114
- *
115
- * @param messagesAfterSummary Messages after the existing summary
116
- * @param fullHistory The complete history (for current task detection)
117
- * @param existingSummaryIndex Index of the existing summary in fullHistory
118
- * @returns Array with single summary message, or empty if nothing to summarize
119
134
  */
120
- async compactSubset(messagesAfterSummary, fullHistory, existingSummaryIndex) {
135
+ async compactSubset(messagesAfterSummary, fullHistory, existingSummaryIndex, model, logger) {
121
136
  const { toSummarize, toKeep } = this.splitHistory(messagesAfterSummary);
122
137
  if (toSummarize.length === 0) {
123
- this.logger.debug("ReactiveOverflowStrategy: No messages to summarize in subset");
138
+ logger.debug("ReactiveOverflowCompactionStrategy: No messages to summarize in subset");
124
139
  return [];
125
140
  }
126
141
  const currentTaskMessage = this.findCurrentTaskMessage(fullHistory);
127
- this.logger.info(
128
- `ReactiveOverflowStrategy (re-compact): Summarizing ${toSummarize.length} messages after existing summary, keeping ${toKeep.length}`
142
+ logger.info(
143
+ `ReactiveOverflowCompactionStrategy (re-compact): Summarizing ${toSummarize.length} messages after existing summary, keeping ${toKeep.length}`
129
144
  );
130
- const summary = await this.generateSummary(toSummarize, currentTaskMessage);
145
+ const summary = await this.generateSummary(toSummarize, currentTaskMessage, model, logger);
131
146
  const absoluteOriginalMessageCount = existingSummaryIndex + 1 + toSummarize.length;
132
147
  const summaryMessage = {
133
148
  role: "assistant",
@@ -138,7 +153,6 @@ class ReactiveOverflowStrategy {
138
153
  summarizedAt: Date.now(),
139
154
  originalMessageCount: absoluteOriginalMessageCount,
140
155
  isRecompaction: true,
141
- // Mark that this is a re-compaction
142
156
  originalFirstTimestamp: toSummarize[0]?.timestamp,
143
157
  originalLastTimestamp: toSummarize[toSummarize.length - 1]?.timestamp
144
158
  }
@@ -147,7 +161,6 @@ class ReactiveOverflowStrategy {
147
161
  }
148
162
  /**
149
163
  * Find the most recent user message that represents the current task.
150
- * This helps preserve context about what the user is currently asking for.
151
164
  */
152
165
  findCurrentTaskMessage(history) {
153
166
  for (let i = history.length - 1; i >= 0; i--) {
@@ -169,13 +182,9 @@ class ReactiveOverflowStrategy {
169
182
  }
170
183
  /**
171
184
  * Split history into messages to summarize and messages to keep.
172
- * Keeps the last N turns (user + assistant pairs) intact.
173
- *
174
- * For long agentic conversations with many tool calls, this also ensures
175
- * we don't try to keep too many messages even within preserved turns.
176
185
  */
177
186
  splitHistory(history) {
178
- const turnsToKeep = this.options.preserveLastNTurns;
187
+ const turnsToKeep = this.strategyOptions.preserveLastNTurns;
179
188
  const userMessageIndices = [];
180
189
  for (let i = history.length - 1; i >= 0; i--) {
181
190
  if (history[i]?.role === "user") {
@@ -203,9 +212,6 @@ class ReactiveOverflowStrategy {
203
212
  toKeep: history
204
213
  };
205
214
  }
206
- this.logger.debug(
207
- `splitHistory: Using fallback - keeping last ${keepCount} of ${history.length} messages`
208
- );
209
215
  return {
210
216
  toSummarize: history.slice(0, -keepCount),
211
217
  toKeep: history.slice(-keepCount)
@@ -213,11 +219,8 @@ class ReactiveOverflowStrategy {
213
219
  }
214
220
  /**
215
221
  * Generate an LLM summary of the messages.
216
- *
217
- * @param messages Messages to summarize
218
- * @param currentTask The most recent user message (current task context)
219
222
  */
220
- async generateSummary(messages, currentTask) {
223
+ async generateSummary(messages, currentTask, model, logger) {
221
224
  const formattedConversation = this.formatMessagesForSummary(messages);
222
225
  let conversationWithContext = formattedConversation;
223
226
  if (currentTask) {
@@ -226,21 +229,21 @@ class ReactiveOverflowStrategy {
226
229
  --- CURRENT TASK (most recent user request) ---
227
230
  ${currentTask}`;
228
231
  }
229
- const prompt = this.options.summaryPrompt.replace(
232
+ const prompt = this.strategyOptions.summaryPrompt.replace(
230
233
  "{conversation}",
231
234
  conversationWithContext
232
235
  );
233
236
  try {
234
237
  const result = await generateText({
235
- model: this.model,
238
+ model,
236
239
  prompt,
237
- maxOutputTokens: this.options.maxSummaryTokens
240
+ maxOutputTokens: this.strategyOptions.maxSummaryTokens
238
241
  });
239
242
  return `[Session Compaction Summary]
240
243
  ${result.text}`;
241
244
  } catch (error) {
242
- this.logger.error(
243
- `ReactiveOverflowStrategy: Failed to generate summary - ${error instanceof Error ? error.message : String(error)}`
245
+ logger.error(
246
+ `ReactiveOverflowCompactionStrategy: Failed to generate summary - ${error instanceof Error ? error.message : String(error)}`
244
247
  );
245
248
  return this.createFallbackSummary(messages, currentTask);
246
249
  }
@@ -316,5 +319,5 @@ ${result.text}`;
316
319
  }
317
320
  }
318
321
  export {
319
- ReactiveOverflowStrategy
322
+ ReactiveOverflowCompactionStrategy
320
323
  };
@@ -1,14 +1,45 @@
1
- import { InternalMessage } from '../types.js';
1
+ import type { LanguageModel } from 'ai';
2
+ import type { Logger } from '../../logger/v2/types.js';
3
+ import type { InternalMessage } from '../types.js';
4
+ import type { ModelLimits } from './overflow.js';
5
+ export interface CompactionSettings {
6
+ enabled: boolean;
7
+ /**
8
+ * Optional cap on the model context window used for compaction decisions.
9
+ * When set, compaction will behave as if the model's context window is:
10
+ * `min(modelContextWindow, maxContextTokens)`.
11
+ */
12
+ maxContextTokens?: number | undefined;
13
+ /**
14
+ * Percentage (0.1–1.0) of the effective context window at which compaction triggers.
15
+ * Example: 0.9 triggers at 90% of context usage.
16
+ */
17
+ thresholdPercent: number;
18
+ }
19
+ export interface CompactionRuntimeContext {
20
+ sessionId: string;
21
+ model: LanguageModel;
22
+ logger: Logger;
23
+ }
2
24
  /**
3
- * Compaction strategy interface.
25
+ * Compaction strategy.
4
26
  *
5
- * Strategies are responsible for reducing conversation history size
6
- * when context limits are exceeded. The strategy is called by TurnExecutor
7
- * after detecting overflow via actual token usage from the API.
27
+ * This is the DI surface used by core runtime (TurnExecutor/VercelLLMService) to:
28
+ * - decide when to compact (budget + overflow logic)
29
+ * - execute compaction given per-session runtime context (model, logger, sessionId)
30
+ *
31
+ * Strategies are created by host layers (CLI/server/apps) via image factories.
32
+ * Core does not parse YAML, validate Zod schemas, or switch on `type` strings.
8
33
  */
9
- export interface ICompactionStrategy {
34
+ export type CompactionStrategy = {
10
35
  /** Human-readable name for logging/UI */
11
36
  readonly name: string;
37
+ /** Effective budgeting settings for this strategy */
38
+ getSettings(): CompactionSettings;
39
+ /** Effective model limits after applying any strategy caps */
40
+ getModelLimits(modelContextWindow: number): ModelLimits;
41
+ /** Whether compaction should run given current input token usage */
42
+ shouldCompact(inputTokens: number, modelLimits: ModelLimits): boolean;
12
43
  /**
13
44
  * Compacts the provided message history.
14
45
  *
@@ -25,8 +56,9 @@ export interface ICompactionStrategy {
25
56
  * - `isSessionSummary: true` - Alternative to isSummary for session-level summaries
26
57
  *
27
58
  * @param history The current conversation history.
59
+ * @param context Per-session runtime context (model/logger/sessionId)
28
60
  * @returns Summary messages to add to history. Empty array if nothing to compact.
29
61
  */
30
- compact(history: readonly InternalMessage[]): Promise<InternalMessage[]> | InternalMessage[];
31
- }
62
+ compact(history: readonly InternalMessage[], context: CompactionRuntimeContext): Promise<InternalMessage[]>;
63
+ };
32
64
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/context/compaction/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAChC,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC;CAChG"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/context/compaction/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,wBAAwB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC7B,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,qDAAqD;IACrD,WAAW,IAAI,kBAAkB,CAAC;IAElC,8DAA8D;IAC9D,cAAc,CAAC,kBAAkB,EAAE,MAAM,GAAG,WAAW,CAAC;IAExD,oEAAoE;IACpE,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC;IAEtE;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CACH,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;CACjC,CAAC"}
@@ -34,7 +34,6 @@ module.exports = __toCommonJS(manager_exports);
34
34
  var import_crypto = require("crypto");
35
35
  var import_types2 = require("./types.js");
36
36
  var import_types3 = require("../logger/v2/types.js");
37
- var import_events = require("../events/index.js");
38
37
  var import_utils = require("./utils.js");
39
38
  var import_errors = require("./errors.js");
40
39
  class ContextManager {
@@ -150,7 +149,7 @@ class ContextManager {
150
149
  this.logger.info(
151
150
  `Stored user input as blob: ${blobRef.uri} (${estimatedSize} bytes, ${metadata.mimeType})`
152
151
  );
153
- import_events.eventBus.emit("resource:cache-invalidated", {
152
+ this.resourceManager.emitCacheInvalidated({
154
153
  resourceUri: blobRef.uri,
155
154
  serverName: "internal",
156
155
  action: "blob_stored"
@@ -615,6 +614,9 @@ ${prompt}`);
615
614
  content: sanitizedResult.content,
616
615
  toolCallId,
617
616
  name,
617
+ ...metadata?.toolDisplayName !== void 0 && {
618
+ toolDisplayName: metadata.toolDisplayName
619
+ },
618
620
  // Success status comes from sanitizedResult.meta (single source of truth)
619
621
  success: sanitizedResult.meta.success,
620
622
  // Persist display data for rich rendering on session resume
@@ -1,11 +1,11 @@
1
1
  import { VercelMessageFormatter } from '../llm/formatters/vercel.js';
2
2
  import { LLMContext } from '../llm/types.js';
3
3
  import type { InternalMessage, AssistantMessage, ToolCall } from './types.js';
4
- import type { IDextoLogger } from '../logger/v2/types.js';
4
+ import type { Logger } from '../logger/v2/types.js';
5
5
  import type { SanitizedToolResult } from './types.js';
6
6
  import { DynamicContributorContext } from '../systemPrompt/types.js';
7
7
  import { SystemPromptManager } from '../systemPrompt/manager.js';
8
- import { IConversationHistoryProvider } from '../session/history/types.js';
8
+ import type { ConversationHistoryProvider } from '../session/history/types.js';
9
9
  import { ValidatedLLMConfig } from '../llm/schemas.js';
10
10
  /**
11
11
  * Manages conversation history and provides message formatting capabilities for the LLM context.
@@ -75,7 +75,7 @@ export declare class ContextManager<TMessage = unknown> {
75
75
  * @param resourceManager ResourceManager for resolving blob references in messages
76
76
  * @param logger Logger instance for logging
77
77
  */
78
- constructor(llmConfig: ValidatedLLMConfig, formatter: VercelMessageFormatter, systemPromptManager: SystemPromptManager, maxInputTokens: number, historyProvider: IConversationHistoryProvider, sessionId: string, resourceManager: import('../resources/index.js').ResourceManager, logger: IDextoLogger);
78
+ constructor(llmConfig: ValidatedLLMConfig, formatter: VercelMessageFormatter, systemPromptManager: SystemPromptManager, maxInputTokens: number, historyProvider: ConversationHistoryProvider, sessionId: string, resourceManager: import('../resources/index.js').ResourceManager, logger: Logger);
79
79
  /**
80
80
  * Get the ResourceManager instance
81
81
  */
@@ -254,6 +254,7 @@ export declare class ContextManager<TMessage = unknown> {
254
254
  addToolResult(toolCallId: string, name: string, sanitizedResult: SanitizedToolResult, metadata?: {
255
255
  requireApproval?: boolean;
256
256
  approvalStatus?: 'approved' | 'rejected';
257
+ toolDisplayName?: string;
257
258
  }): Promise<void>;
258
259
  /**
259
260
  * Gets the conversation history formatted for the target LLM provider.
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/context/manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,UAA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,OAAO,CAAA;KAAE,CAAC,GACrF,OAAO,CAAC,MAAM,CAAC;IAwBlB;;;;;;OAMG;IACG,wBAAwB,CAC1B,QAAQ,EAAE,yBAAyB,GACpC,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAKrC;;;OAGG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ3C"}
@@ -2,7 +2,6 @@ import "../chunk-PTJYTZNU.js";
2
2
  import { randomUUID } from "crypto";
3
3
  import { isSystemMessage, isUserMessage, isAssistantMessage, isToolMessage } from "./types.js";
4
4
  import { DextoLogComponent } from "../logger/v2/types.js";
5
- import { eventBus } from "../events/index.js";
6
5
  import {
7
6
  expandBlobReferences,
8
7
  isLikelyBase64String,
@@ -124,7 +123,7 @@ class ContextManager {
124
123
  this.logger.info(
125
124
  `Stored user input as blob: ${blobRef.uri} (${estimatedSize} bytes, ${metadata.mimeType})`
126
125
  );
127
- eventBus.emit("resource:cache-invalidated", {
126
+ this.resourceManager.emitCacheInvalidated({
128
127
  resourceUri: blobRef.uri,
129
128
  serverName: "internal",
130
129
  action: "blob_stored"
@@ -589,6 +588,9 @@ ${prompt}`);
589
588
  content: sanitizedResult.content,
590
589
  toolCallId,
591
590
  name,
591
+ ...metadata?.toolDisplayName !== void 0 && {
592
+ toolDisplayName: metadata.toolDisplayName
593
+ },
592
594
  // Success status comes from sanitizedResult.meta (single source of truth)
593
595
  success: sanitizedResult.meta.success,
594
596
  // Persist display data for rich rendering on session resume
@@ -216,6 +216,8 @@ export interface ToolMessage extends MessageBase {
216
216
  toolCallId: string;
217
217
  /** Name of the tool that produced this result (REQUIRED) */
218
218
  name: string;
219
+ /** Optional user-facing name for the tool (UI convenience) */
220
+ toolDisplayName?: string;
219
221
  /** Whether the tool execution was successful */
220
222
  success?: boolean;
221
223
  /** Whether this tool call required user approval before execution */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context/types.ts"],"names":[],"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Ac,CAAC,EAAE,kBAAkB,CAAC;IAEpC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,WAAW,GAAG,gBAAgB,GAAG,WAAW,CAAC;AAM3F;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,aAAa,CAE1E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,WAAW,CAEtE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,gBAAgB,CAEhF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,WAAW,CAEtE"}
@@ -50,8 +50,8 @@ __export(utils_exports, {
50
50
  module.exports = __toCommonJS(utils_exports);
51
51
  var import_types = require("./types.js");
52
52
  var import_display_types = require("../tools/display-types.js");
53
- var import_registry = require("../llm/registry/index.cjs");
54
- var import_safe_stringify = require("../utils/safe-stringify.cjs");
53
+ var import_registry = require("../llm/registry/index.js");
54
+ var import_safe_stringify = require("../utils/safe-stringify.js");
55
55
  var import_media_helpers = require("./media-helpers.js");
56
56
  const MIN_BASE64_HEURISTIC_LENGTH = 512;
57
57
  const MAX_TOOL_TEXT_CHARS = 8e3;