@dexto/core 1.4.0 → 1.5.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 (497) hide show
  1. package/README.md +36 -0
  2. package/dist/agent/DextoAgent.cjs +22 -3
  3. package/dist/agent/DextoAgent.d.ts +19 -2
  4. package/dist/agent/DextoAgent.d.ts.map +1 -1
  5. package/dist/agent/DextoAgent.js +23 -4
  6. package/dist/agent/index.cjs +4 -1
  7. package/dist/agent/index.d.ts +1 -1
  8. package/dist/agent/index.d.ts.map +1 -1
  9. package/dist/agent/index.js +5 -1
  10. package/dist/agent/schemas.cjs +90 -71
  11. package/dist/agent/schemas.d.ts +5911 -96
  12. package/dist/agent/schemas.d.ts.map +1 -1
  13. package/dist/agent/schemas.js +87 -66
  14. package/dist/approval/manager.cjs +165 -1
  15. package/dist/approval/manager.d.ts +91 -2
  16. package/dist/approval/manager.d.ts.map +1 -1
  17. package/dist/approval/manager.js +155 -1
  18. package/dist/approval/schemas.cjs +39 -3
  19. package/dist/approval/schemas.d.ts +238 -1
  20. package/dist/approval/schemas.d.ts.map +1 -1
  21. package/dist/approval/schemas.js +35 -3
  22. package/dist/approval/types.cjs +1 -0
  23. package/dist/approval/types.d.ts +26 -1
  24. package/dist/approval/types.d.ts.map +1 -1
  25. package/dist/approval/types.js +1 -0
  26. package/dist/context/compaction/factory.cjs +57 -0
  27. package/dist/context/compaction/factory.d.ts +17 -0
  28. package/dist/context/compaction/factory.d.ts.map +1 -0
  29. package/dist/context/compaction/factory.js +34 -0
  30. package/dist/context/compaction/index.cjs +49 -0
  31. package/dist/context/compaction/index.d.ts +11 -0
  32. package/dist/context/compaction/index.d.ts.map +1 -0
  33. package/dist/context/compaction/index.js +19 -0
  34. package/dist/context/{compression → compaction}/overflow.cjs +3 -3
  35. package/dist/context/{compression → compaction}/overflow.d.ts +4 -4
  36. package/dist/context/compaction/overflow.d.ts.map +1 -0
  37. package/dist/context/{compression → compaction}/overflow.js +2 -2
  38. package/dist/context/compaction/provider.cjs +16 -0
  39. package/dist/context/compaction/provider.d.ts +48 -0
  40. package/dist/context/compaction/provider.d.ts.map +1 -0
  41. package/dist/context/compaction/providers/noop-provider.cjs +48 -0
  42. package/dist/context/compaction/providers/noop-provider.d.ts +24 -0
  43. package/dist/context/compaction/providers/noop-provider.d.ts.map +1 -0
  44. package/dist/context/compaction/providers/noop-provider.js +24 -0
  45. package/dist/context/compaction/providers/reactive-overflow-provider.cjs +61 -0
  46. package/dist/context/compaction/providers/reactive-overflow-provider.d.ts +36 -0
  47. package/dist/context/compaction/providers/reactive-overflow-provider.d.ts.map +1 -0
  48. package/dist/context/compaction/providers/reactive-overflow-provider.js +37 -0
  49. package/dist/context/compaction/registry.cjs +39 -0
  50. package/dist/context/compaction/registry.d.ts +19 -0
  51. package/dist/context/compaction/registry.d.ts.map +1 -0
  52. package/dist/context/compaction/registry.js +16 -0
  53. package/dist/context/compaction/schemas.cjs +38 -0
  54. package/dist/context/compaction/schemas.d.ts +24 -0
  55. package/dist/context/compaction/schemas.d.ts.map +1 -0
  56. package/dist/context/compaction/schemas.js +14 -0
  57. package/dist/context/compaction/strategies/noop.cjs +36 -0
  58. package/dist/context/compaction/strategies/noop.d.ts +18 -0
  59. package/dist/context/compaction/strategies/noop.d.ts.map +1 -0
  60. package/dist/context/compaction/strategies/noop.js +13 -0
  61. package/dist/context/{compression → compaction/strategies}/reactive-overflow.cjs +3 -3
  62. package/dist/context/{compression → compaction/strategies}/reactive-overflow.d.ts +6 -6
  63. package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +1 -0
  64. package/dist/context/{compression → compaction/strategies}/reactive-overflow.js +4 -4
  65. package/dist/context/{compression → compaction}/types.d.ts +4 -4
  66. package/dist/context/compaction/types.d.ts.map +1 -0
  67. package/dist/context/compaction/types.js +0 -0
  68. package/dist/context/error-codes.cjs +4 -0
  69. package/dist/context/error-codes.d.ts +4 -0
  70. package/dist/context/error-codes.d.ts.map +1 -1
  71. package/dist/context/error-codes.js +4 -0
  72. package/dist/context/errors.cjs +40 -0
  73. package/dist/context/errors.d.ts +14 -0
  74. package/dist/context/errors.d.ts.map +1 -1
  75. package/dist/context/errors.js +40 -0
  76. package/dist/context/index.cjs +3 -1
  77. package/dist/context/index.d.ts +1 -0
  78. package/dist/context/index.d.ts.map +1 -1
  79. package/dist/context/index.js +1 -0
  80. package/dist/context/types.d.ts +6 -0
  81. package/dist/context/types.d.ts.map +1 -1
  82. package/dist/context/utils.cjs +27 -7
  83. package/dist/context/utils.d.ts.map +1 -1
  84. package/dist/context/utils.js +27 -7
  85. package/dist/errors/result-bridge.cjs +2 -3
  86. package/dist/errors/result-bridge.d.ts.map +1 -1
  87. package/dist/errors/result-bridge.js +2 -3
  88. package/dist/events/index.cjs +2 -2
  89. package/dist/events/index.d.ts +16 -16
  90. package/dist/events/index.d.ts.map +1 -1
  91. package/dist/events/index.js +2 -2
  92. package/dist/filesystem/filesystem-service.cjs +39 -0
  93. package/dist/filesystem/filesystem-service.d.ts +32 -0
  94. package/dist/filesystem/filesystem-service.d.ts.map +1 -1
  95. package/dist/filesystem/filesystem-service.js +39 -0
  96. package/dist/filesystem/index.d.ts +1 -1
  97. package/dist/filesystem/index.d.ts.map +1 -1
  98. package/dist/filesystem/path-validator.cjs +69 -1
  99. package/dist/filesystem/path-validator.d.ts +43 -2
  100. package/dist/filesystem/path-validator.d.ts.map +1 -1
  101. package/dist/filesystem/path-validator.js +69 -1
  102. package/dist/image/define-image.cjs +146 -0
  103. package/dist/image/define-image.d.ts +71 -0
  104. package/dist/image/define-image.d.ts.map +1 -0
  105. package/dist/image/define-image.js +121 -0
  106. package/dist/image/index.cjs +32 -0
  107. package/dist/image/index.d.ts +53 -0
  108. package/dist/image/index.d.ts.map +1 -0
  109. package/dist/image/index.js +7 -0
  110. package/dist/image/types.cjs +16 -0
  111. package/dist/image/types.d.ts +231 -0
  112. package/dist/image/types.d.ts.map +1 -0
  113. package/dist/image/types.js +0 -0
  114. package/dist/index.cjs +5 -1
  115. package/dist/index.d.ts +2 -0
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +2 -0
  118. package/dist/llm/error-codes.cjs +1 -0
  119. package/dist/llm/error-codes.d.ts +1 -0
  120. package/dist/llm/error-codes.d.ts.map +1 -1
  121. package/dist/llm/error-codes.js +1 -0
  122. package/dist/llm/errors.cjs +24 -0
  123. package/dist/llm/errors.d.ts +19 -6
  124. package/dist/llm/errors.d.ts.map +1 -1
  125. package/dist/llm/errors.js +24 -0
  126. package/dist/llm/executor/stream-processor.cjs +11 -3
  127. package/dist/llm/executor/stream-processor.d.ts.map +1 -1
  128. package/dist/llm/executor/stream-processor.js +11 -3
  129. package/dist/llm/executor/turn-executor.cjs +50 -23
  130. package/dist/llm/executor/turn-executor.d.ts +6 -5
  131. package/dist/llm/executor/turn-executor.d.ts.map +1 -1
  132. package/dist/llm/executor/turn-executor.js +50 -23
  133. package/dist/llm/formatters/vercel.cjs +6 -2
  134. package/dist/llm/formatters/vercel.d.ts.map +1 -1
  135. package/dist/llm/formatters/vercel.js +6 -2
  136. package/dist/llm/index.cjs +18 -1
  137. package/dist/llm/index.d.ts +2 -0
  138. package/dist/llm/index.d.ts.map +1 -1
  139. package/dist/llm/index.js +14 -0
  140. package/dist/llm/providers/local/ai-sdk-adapter.cjs +308 -0
  141. package/dist/llm/providers/local/ai-sdk-adapter.d.ts +29 -0
  142. package/dist/llm/providers/local/ai-sdk-adapter.d.ts.map +1 -0
  143. package/dist/llm/providers/local/ai-sdk-adapter.js +278 -0
  144. package/dist/llm/providers/local/downloader.cjs +291 -0
  145. package/dist/llm/providers/local/downloader.d.ts +82 -0
  146. package/dist/llm/providers/local/downloader.d.ts.map +1 -0
  147. package/dist/llm/providers/local/downloader.js +251 -0
  148. package/dist/llm/providers/local/error-codes.cjs +57 -0
  149. package/dist/llm/providers/local/error-codes.d.ts +66 -0
  150. package/dist/llm/providers/local/error-codes.d.ts.map +1 -0
  151. package/dist/llm/providers/local/error-codes.js +34 -0
  152. package/dist/llm/providers/local/errors.cjs +240 -0
  153. package/dist/llm/providers/local/errors.d.ts +31 -0
  154. package/dist/llm/providers/local/errors.d.ts.map +1 -0
  155. package/dist/llm/providers/local/errors.js +217 -0
  156. package/dist/llm/providers/local/gpu-detector.cjs +214 -0
  157. package/dist/llm/providers/local/gpu-detector.d.ts +28 -0
  158. package/dist/llm/providers/local/gpu-detector.d.ts.map +1 -0
  159. package/dist/llm/providers/local/gpu-detector.js +178 -0
  160. package/dist/llm/providers/local/index.cjs +147 -0
  161. package/dist/llm/providers/local/index.d.ts +21 -0
  162. package/dist/llm/providers/local/index.d.ts.map +1 -0
  163. package/dist/llm/providers/local/index.js +126 -0
  164. package/dist/llm/providers/local/node-llama-provider.cjs +216 -0
  165. package/dist/llm/providers/local/node-llama-provider.d.ts +90 -0
  166. package/dist/llm/providers/local/node-llama-provider.d.ts.map +1 -0
  167. package/dist/llm/providers/local/node-llama-provider.js +176 -0
  168. package/dist/llm/providers/local/ollama-provider.cjs +230 -0
  169. package/dist/llm/providers/local/ollama-provider.d.ts +70 -0
  170. package/dist/llm/providers/local/ollama-provider.d.ts.map +1 -0
  171. package/dist/llm/providers/local/ollama-provider.js +198 -0
  172. package/dist/llm/providers/local/registry.cjs +343 -0
  173. package/dist/llm/providers/local/registry.d.ts +51 -0
  174. package/dist/llm/providers/local/registry.d.ts.map +1 -0
  175. package/dist/llm/providers/local/registry.js +312 -0
  176. package/dist/llm/providers/local/schemas.cjs +169 -0
  177. package/dist/llm/providers/local/schemas.d.ts +395 -0
  178. package/dist/llm/providers/local/schemas.d.ts.map +1 -0
  179. package/dist/llm/providers/local/schemas.js +133 -0
  180. package/dist/llm/providers/local/types.cjs +16 -0
  181. package/dist/llm/providers/local/types.d.ts +219 -0
  182. package/dist/llm/providers/local/types.d.ts.map +1 -0
  183. package/dist/llm/providers/local/types.js +0 -0
  184. package/dist/llm/providers/openrouter-model-registry.cjs +350 -0
  185. package/dist/llm/providers/openrouter-model-registry.d.ts +120 -0
  186. package/dist/llm/providers/openrouter-model-registry.d.ts.map +1 -0
  187. package/dist/llm/providers/openrouter-model-registry.js +309 -0
  188. package/dist/llm/registry.cjs +535 -9
  189. package/dist/llm/registry.d.ts +26 -0
  190. package/dist/llm/registry.d.ts.map +1 -1
  191. package/dist/llm/registry.js +532 -9
  192. package/dist/llm/resolver.cjs +63 -5
  193. package/dist/llm/resolver.d.ts +3 -3
  194. package/dist/llm/resolver.d.ts.map +1 -1
  195. package/dist/llm/resolver.js +69 -6
  196. package/dist/llm/schemas.cjs +90 -80
  197. package/dist/llm/schemas.d.ts +158 -22
  198. package/dist/llm/schemas.d.ts.map +1 -1
  199. package/dist/llm/schemas.js +90 -80
  200. package/dist/llm/services/factory.cjs +87 -13
  201. package/dist/llm/services/factory.d.ts +4 -1
  202. package/dist/llm/services/factory.d.ts.map +1 -1
  203. package/dist/llm/services/factory.js +85 -12
  204. package/dist/llm/services/test-utils.integration.cjs +22 -2
  205. package/dist/llm/services/test-utils.integration.d.ts +7 -1
  206. package/dist/llm/services/test-utils.integration.d.ts.map +1 -1
  207. package/dist/llm/services/test-utils.integration.js +26 -3
  208. package/dist/llm/services/vercel.cjs +5 -2
  209. package/dist/llm/services/vercel.d.ts +3 -2
  210. package/dist/llm/services/vercel.d.ts.map +1 -1
  211. package/dist/llm/services/vercel.js +5 -2
  212. package/dist/llm/types.cjs +11 -1
  213. package/dist/llm/types.d.ts +1 -1
  214. package/dist/llm/types.d.ts.map +1 -1
  215. package/dist/llm/types.js +11 -1
  216. package/dist/mcp/manager.cjs +8 -0
  217. package/dist/mcp/manager.d.ts +17 -0
  218. package/dist/mcp/manager.d.ts.map +1 -1
  219. package/dist/mcp/manager.js +8 -0
  220. package/dist/mcp/mcp-client.cjs +0 -3
  221. package/dist/mcp/mcp-client.d.ts.map +1 -1
  222. package/dist/mcp/mcp-client.js +0 -3
  223. package/dist/memory/schemas.d.ts +1 -1
  224. package/dist/plugins/error-codes.cjs +3 -0
  225. package/dist/plugins/error-codes.d.ts +7 -1
  226. package/dist/plugins/error-codes.d.ts.map +1 -1
  227. package/dist/plugins/error-codes.js +3 -0
  228. package/dist/plugins/index.cjs +7 -0
  229. package/dist/plugins/index.d.ts +4 -2
  230. package/dist/plugins/index.d.ts.map +1 -1
  231. package/dist/plugins/index.js +6 -1
  232. package/dist/plugins/manager.cjs +92 -7
  233. package/dist/plugins/manager.d.ts +10 -3
  234. package/dist/plugins/manager.d.ts.map +1 -1
  235. package/dist/plugins/manager.js +92 -7
  236. package/dist/plugins/registry.cjs +63 -0
  237. package/dist/plugins/registry.d.ts +101 -0
  238. package/dist/plugins/registry.d.ts.map +1 -0
  239. package/dist/plugins/registry.js +39 -0
  240. package/dist/plugins/schemas.cjs +17 -5
  241. package/dist/plugins/schemas.d.ts +62 -5
  242. package/dist/plugins/schemas.d.ts.map +1 -1
  243. package/dist/plugins/schemas.js +15 -4
  244. package/dist/providers/base-registry.cjs +147 -0
  245. package/dist/providers/base-registry.d.ts +147 -0
  246. package/dist/providers/base-registry.d.ts.map +1 -0
  247. package/dist/providers/base-registry.js +123 -0
  248. package/dist/providers/discovery.cjs +95 -0
  249. package/dist/providers/discovery.d.ts +94 -0
  250. package/dist/providers/discovery.d.ts.map +1 -0
  251. package/dist/providers/discovery.js +70 -0
  252. package/dist/providers/index.cjs +24 -0
  253. package/dist/providers/index.d.ts +32 -0
  254. package/dist/providers/index.d.ts.map +1 -0
  255. package/dist/providers/index.js +2 -0
  256. package/dist/resources/reference-parser.cjs +3 -3
  257. package/dist/resources/reference-parser.d.ts.map +1 -1
  258. package/dist/resources/reference-parser.js +3 -3
  259. package/dist/session/chat-session.cjs +20 -3
  260. package/dist/session/chat-session.d.ts.map +1 -1
  261. package/dist/session/chat-session.js +21 -4
  262. package/dist/storage/blob/factory.cjs +8 -11
  263. package/dist/storage/blob/factory.d.ts +32 -6
  264. package/dist/storage/blob/factory.d.ts.map +1 -1
  265. package/dist/storage/blob/factory.js +8 -11
  266. package/dist/storage/blob/index.cjs +56 -0
  267. package/dist/storage/blob/index.d.ts +45 -0
  268. package/dist/storage/blob/index.d.ts.map +1 -0
  269. package/dist/storage/blob/index.js +30 -0
  270. package/dist/storage/blob/provider.cjs +16 -0
  271. package/dist/storage/blob/provider.d.ts +50 -0
  272. package/dist/storage/blob/provider.d.ts.map +1 -0
  273. package/dist/storage/blob/provider.js +0 -0
  274. package/dist/storage/blob/providers/index.cjs +31 -0
  275. package/dist/storage/blob/providers/index.d.ts +8 -0
  276. package/dist/storage/blob/providers/index.d.ts.map +1 -0
  277. package/dist/storage/blob/providers/index.js +7 -0
  278. package/dist/storage/blob/providers/local.cjs +39 -0
  279. package/dist/storage/blob/providers/local.d.ts +17 -0
  280. package/dist/storage/blob/providers/local.d.ts.map +1 -0
  281. package/dist/storage/blob/providers/local.js +16 -0
  282. package/dist/storage/blob/providers/memory.cjs +39 -0
  283. package/dist/storage/blob/providers/memory.d.ts +17 -0
  284. package/dist/storage/blob/providers/memory.d.ts.map +1 -0
  285. package/dist/storage/blob/providers/memory.js +16 -0
  286. package/dist/storage/blob/registry.cjs +50 -0
  287. package/dist/storage/blob/registry.d.ts +42 -0
  288. package/dist/storage/blob/registry.d.ts.map +1 -0
  289. package/dist/storage/blob/registry.js +26 -0
  290. package/dist/storage/blob/schemas.cjs +9 -12
  291. package/dist/storage/blob/schemas.d.ts +39 -34
  292. package/dist/storage/blob/schemas.d.ts.map +1 -1
  293. package/dist/storage/blob/schemas.js +6 -11
  294. package/dist/storage/cache/factory.cjs +8 -36
  295. package/dist/storage/cache/factory.d.ts +32 -7
  296. package/dist/storage/cache/factory.d.ts.map +1 -1
  297. package/dist/storage/cache/factory.js +8 -26
  298. package/dist/storage/cache/index.cjs +53 -0
  299. package/dist/storage/cache/index.d.ts +44 -0
  300. package/dist/storage/cache/index.d.ts.map +1 -0
  301. package/dist/storage/cache/index.js +28 -0
  302. package/dist/storage/cache/provider.cjs +16 -0
  303. package/dist/storage/cache/provider.d.ts +56 -0
  304. package/dist/storage/cache/provider.d.ts.map +1 -0
  305. package/dist/storage/cache/provider.js +0 -0
  306. package/dist/storage/cache/providers/index.cjs +31 -0
  307. package/dist/storage/cache/providers/index.d.ts +8 -0
  308. package/dist/storage/cache/providers/index.d.ts.map +1 -0
  309. package/dist/storage/cache/providers/index.js +7 -0
  310. package/dist/storage/cache/providers/memory.cjs +40 -0
  311. package/dist/storage/cache/providers/memory.d.ts +17 -0
  312. package/dist/storage/cache/providers/memory.d.ts.map +1 -0
  313. package/dist/storage/cache/providers/memory.js +17 -0
  314. package/dist/storage/cache/providers/redis.cjs +66 -0
  315. package/dist/storage/cache/providers/redis.d.ts +20 -0
  316. package/dist/storage/cache/providers/redis.d.ts.map +1 -0
  317. package/dist/storage/cache/providers/redis.js +33 -0
  318. package/dist/storage/cache/registry.cjs +50 -0
  319. package/dist/storage/cache/registry.d.ts +42 -0
  320. package/dist/storage/cache/registry.d.ts.map +1 -0
  321. package/dist/storage/cache/registry.js +26 -0
  322. package/dist/storage/cache/schemas.cjs +6 -2
  323. package/dist/storage/cache/schemas.d.ts +2 -3
  324. package/dist/storage/cache/schemas.d.ts.map +1 -1
  325. package/dist/storage/cache/schemas.js +3 -1
  326. package/dist/storage/database/factory.cjs +8 -47
  327. package/dist/storage/database/factory.d.ts +34 -8
  328. package/dist/storage/database/factory.d.ts.map +1 -1
  329. package/dist/storage/database/factory.js +8 -37
  330. package/dist/storage/database/index.cjs +58 -0
  331. package/dist/storage/database/index.d.ts +45 -0
  332. package/dist/storage/database/index.d.ts.map +1 -0
  333. package/dist/storage/database/index.js +37 -0
  334. package/dist/storage/database/provider.cjs +16 -0
  335. package/dist/storage/database/provider.d.ts +56 -0
  336. package/dist/storage/database/provider.d.ts.map +1 -0
  337. package/dist/storage/database/provider.js +0 -0
  338. package/dist/storage/database/providers/index.cjs +34 -0
  339. package/dist/storage/database/providers/index.d.ts +9 -0
  340. package/dist/storage/database/providers/index.d.ts.map +1 -0
  341. package/dist/storage/database/providers/index.js +9 -0
  342. package/dist/storage/database/providers/memory.cjs +40 -0
  343. package/dist/storage/database/providers/memory.d.ts +16 -0
  344. package/dist/storage/database/providers/memory.d.ts.map +1 -0
  345. package/dist/storage/database/providers/memory.js +17 -0
  346. package/dist/storage/database/providers/postgres.cjs +62 -0
  347. package/dist/storage/database/providers/postgres.d.ts +19 -0
  348. package/dist/storage/database/providers/postgres.d.ts.map +1 -0
  349. package/dist/storage/database/providers/postgres.js +29 -0
  350. package/dist/storage/database/providers/sqlite.cjs +66 -0
  351. package/dist/storage/database/providers/sqlite.d.ts +20 -0
  352. package/dist/storage/database/providers/sqlite.d.ts.map +1 -0
  353. package/dist/storage/database/providers/sqlite.js +33 -0
  354. package/dist/storage/database/registry.cjs +50 -0
  355. package/dist/storage/database/registry.d.ts +42 -0
  356. package/dist/storage/database/registry.d.ts.map +1 -0
  357. package/dist/storage/database/registry.js +26 -0
  358. package/dist/storage/database/schemas.cjs +8 -2
  359. package/dist/storage/database/schemas.d.ts +3 -4
  360. package/dist/storage/database/schemas.d.ts.map +1 -1
  361. package/dist/storage/database/schemas.js +4 -1
  362. package/dist/storage/error-codes.cjs +6 -0
  363. package/dist/storage/error-codes.d.ts +7 -1
  364. package/dist/storage/error-codes.d.ts.map +1 -1
  365. package/dist/storage/error-codes.js +6 -0
  366. package/dist/storage/errors.cjs +80 -0
  367. package/dist/storage/errors.d.ts +24 -0
  368. package/dist/storage/errors.d.ts.map +1 -1
  369. package/dist/storage/errors.js +80 -0
  370. package/dist/storage/index.cjs +47 -4
  371. package/dist/storage/index.d.ts +34 -8
  372. package/dist/storage/index.d.ts.map +1 -1
  373. package/dist/storage/index.js +32 -3
  374. package/dist/storage/schemas.cjs +4 -0
  375. package/dist/storage/schemas.d.ts +17 -50
  376. package/dist/storage/schemas.d.ts.map +1 -1
  377. package/dist/storage/schemas.js +5 -1
  378. package/dist/storage/storage-manager.cjs +6 -6
  379. package/dist/storage/storage-manager.d.ts.map +1 -1
  380. package/dist/storage/storage-manager.js +3 -3
  381. package/dist/systemPrompt/in-built-prompts.cjs +7 -6
  382. package/dist/systemPrompt/in-built-prompts.d.ts +2 -2
  383. package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
  384. package/dist/systemPrompt/in-built-prompts.js +6 -5
  385. package/dist/systemPrompt/registry.cjs +2 -2
  386. package/dist/systemPrompt/registry.d.ts +1 -1
  387. package/dist/systemPrompt/registry.d.ts.map +1 -1
  388. package/dist/systemPrompt/registry.js +2 -2
  389. package/dist/systemPrompt/schemas.cjs +2 -2
  390. package/dist/systemPrompt/schemas.d.ts +13 -13
  391. package/dist/systemPrompt/schemas.js +2 -2
  392. package/dist/tools/custom-tool-registry.cjs +64 -0
  393. package/dist/tools/custom-tool-registry.d.ts +120 -0
  394. package/dist/tools/custom-tool-registry.d.ts.map +1 -0
  395. package/dist/tools/custom-tool-registry.js +40 -0
  396. package/dist/tools/custom-tool-schema-registry.cjs +164 -0
  397. package/dist/tools/custom-tool-schema-registry.d.ts +86 -0
  398. package/dist/tools/custom-tool-schema-registry.d.ts.map +1 -0
  399. package/dist/tools/custom-tool-schema-registry.js +140 -0
  400. package/dist/tools/error-codes.cjs +3 -0
  401. package/dist/tools/error-codes.d.ts +4 -1
  402. package/dist/tools/error-codes.d.ts.map +1 -1
  403. package/dist/tools/error-codes.js +3 -0
  404. package/dist/tools/errors.cjs +41 -0
  405. package/dist/tools/errors.d.ts +17 -0
  406. package/dist/tools/errors.d.ts.map +1 -1
  407. package/dist/tools/errors.js +41 -0
  408. package/dist/tools/index.cjs +13 -1
  409. package/dist/tools/index.d.ts +4 -0
  410. package/dist/tools/index.d.ts.map +1 -1
  411. package/dist/tools/index.js +11 -1
  412. package/dist/tools/internal-tools/constants.cjs +3 -9
  413. package/dist/tools/internal-tools/constants.d.ts +1 -1
  414. package/dist/tools/internal-tools/constants.d.ts.map +1 -1
  415. package/dist/tools/internal-tools/constants.js +3 -9
  416. package/dist/tools/internal-tools/implementations/get-resource-tool.cjs +113 -0
  417. package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts +30 -0
  418. package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts.map +1 -0
  419. package/dist/tools/internal-tools/implementations/get-resource-tool.js +90 -0
  420. package/dist/tools/internal-tools/implementations/list-resources-tool.cjs +91 -0
  421. package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts +24 -0
  422. package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts.map +1 -0
  423. package/dist/tools/internal-tools/implementations/list-resources-tool.js +68 -0
  424. package/dist/tools/internal-tools/provider.cjs +150 -23
  425. package/dist/tools/internal-tools/provider.d.ts +55 -10
  426. package/dist/tools/internal-tools/provider.d.ts.map +1 -1
  427. package/dist/tools/internal-tools/provider.js +150 -23
  428. package/dist/tools/internal-tools/registry.cjs +18 -43
  429. package/dist/tools/internal-tools/registry.d.ts +4 -4
  430. package/dist/tools/internal-tools/registry.d.ts.map +1 -1
  431. package/dist/tools/internal-tools/registry.js +18 -43
  432. package/dist/tools/schemas.cjs +20 -0
  433. package/dist/tools/schemas.d.ts +43 -1
  434. package/dist/tools/schemas.d.ts.map +1 -1
  435. package/dist/tools/schemas.js +16 -0
  436. package/dist/tools/tool-manager.cjs +140 -13
  437. package/dist/tools/tool-manager.d.ts +22 -3
  438. package/dist/tools/tool-manager.d.ts.map +1 -1
  439. package/dist/tools/tool-manager.js +140 -13
  440. package/dist/tools/types.d.ts +43 -0
  441. package/dist/tools/types.d.ts.map +1 -1
  442. package/dist/utils/api-key-resolver.cjs +19 -1
  443. package/dist/utils/api-key-resolver.d.ts.map +1 -1
  444. package/dist/utils/api-key-resolver.js +19 -1
  445. package/dist/utils/index.cjs +0 -2
  446. package/dist/utils/index.d.ts +0 -1
  447. package/dist/utils/index.d.ts.map +1 -1
  448. package/dist/utils/index.js +0 -1
  449. package/dist/utils/redactor.cjs +18 -3
  450. package/dist/utils/redactor.d.ts +0 -7
  451. package/dist/utils/redactor.d.ts.map +1 -1
  452. package/dist/utils/redactor.js +18 -3
  453. package/dist/utils/service-initializer.cjs +9 -35
  454. package/dist/utils/service-initializer.d.ts.map +1 -1
  455. package/dist/utils/service-initializer.js +9 -35
  456. package/package.json +5 -2
  457. package/dist/context/compression/overflow.d.ts.map +0 -1
  458. package/dist/context/compression/reactive-overflow.d.ts.map +0 -1
  459. package/dist/context/compression/types.d.ts.map +0 -1
  460. package/dist/tools/internal-tools/implementations/bash-exec-tool.cjs +0 -130
  461. package/dist/tools/internal-tools/implementations/bash-exec-tool.d.ts +0 -13
  462. package/dist/tools/internal-tools/implementations/bash-exec-tool.d.ts.map +0 -1
  463. package/dist/tools/internal-tools/implementations/bash-exec-tool.js +0 -97
  464. package/dist/tools/internal-tools/implementations/bash-output-tool.cjs +0 -49
  465. package/dist/tools/internal-tools/implementations/bash-output-tool.d.ts +0 -12
  466. package/dist/tools/internal-tools/implementations/bash-output-tool.d.ts.map +0 -1
  467. package/dist/tools/internal-tools/implementations/bash-output-tool.js +0 -26
  468. package/dist/tools/internal-tools/implementations/edit-file-tool.cjs +0 -127
  469. package/dist/tools/internal-tools/implementations/edit-file-tool.d.ts +0 -12
  470. package/dist/tools/internal-tools/implementations/edit-file-tool.d.ts.map +0 -1
  471. package/dist/tools/internal-tools/implementations/edit-file-tool.js +0 -104
  472. package/dist/tools/internal-tools/implementations/glob-files-tool.cjs +0 -70
  473. package/dist/tools/internal-tools/implementations/glob-files-tool.d.ts +0 -12
  474. package/dist/tools/internal-tools/implementations/glob-files-tool.d.ts.map +0 -1
  475. package/dist/tools/internal-tools/implementations/glob-files-tool.js +0 -47
  476. package/dist/tools/internal-tools/implementations/grep-content-tool.cjs +0 -86
  477. package/dist/tools/internal-tools/implementations/grep-content-tool.d.ts +0 -12
  478. package/dist/tools/internal-tools/implementations/grep-content-tool.d.ts.map +0 -1
  479. package/dist/tools/internal-tools/implementations/grep-content-tool.js +0 -63
  480. package/dist/tools/internal-tools/implementations/kill-process-tool.cjs +0 -47
  481. package/dist/tools/internal-tools/implementations/kill-process-tool.d.ts +0 -12
  482. package/dist/tools/internal-tools/implementations/kill-process-tool.d.ts.map +0 -1
  483. package/dist/tools/internal-tools/implementations/kill-process-tool.js +0 -24
  484. package/dist/tools/internal-tools/implementations/read-file-tool.cjs +0 -63
  485. package/dist/tools/internal-tools/implementations/read-file-tool.d.ts +0 -12
  486. package/dist/tools/internal-tools/implementations/read-file-tool.d.ts.map +0 -1
  487. package/dist/tools/internal-tools/implementations/read-file-tool.js +0 -40
  488. package/dist/tools/internal-tools/implementations/write-file-tool.cjs +0 -124
  489. package/dist/tools/internal-tools/implementations/write-file-tool.d.ts +0 -12
  490. package/dist/tools/internal-tools/implementations/write-file-tool.d.ts.map +0 -1
  491. package/dist/tools/internal-tools/implementations/write-file-tool.js +0 -103
  492. package/dist/utils/env-file.cjs +0 -118
  493. package/dist/utils/env-file.d.ts +0 -5
  494. package/dist/utils/env-file.d.ts.map +0 -1
  495. package/dist/utils/env-file.js +0 -85
  496. /package/dist/context/{compression/types.js → compaction/provider.js} +0 -0
  497. /package/dist/context/{compression → compaction}/types.cjs +0 -0
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var reactive_overflow_provider_exports = {};
20
+ __export(reactive_overflow_provider_exports, {
21
+ ReactiveOverflowConfigSchema: () => ReactiveOverflowConfigSchema,
22
+ reactiveOverflowProvider: () => reactiveOverflowProvider
23
+ });
24
+ module.exports = __toCommonJS(reactive_overflow_provider_exports);
25
+ var import_zod = require("zod");
26
+ var import_reactive_overflow = require("../strategies/reactive-overflow.js");
27
+ const ReactiveOverflowConfigSchema = import_zod.z.object({
28
+ type: import_zod.z.literal("reactive-overflow"),
29
+ enabled: import_zod.z.boolean().default(true).describe("Enable or disable compaction"),
30
+ preserveLastNTurns: import_zod.z.number().int().positive().default(2).describe("Number of recent turns (user+assistant pairs) to preserve"),
31
+ maxSummaryTokens: import_zod.z.number().int().positive().default(2e3).describe("Maximum tokens for the summary output"),
32
+ summaryPrompt: import_zod.z.string().optional().describe("Custom summary prompt template. Use {conversation} as placeholder")
33
+ }).strict();
34
+ const reactiveOverflowProvider = {
35
+ type: "reactive-overflow",
36
+ configSchema: ReactiveOverflowConfigSchema,
37
+ metadata: {
38
+ displayName: "Reactive Overflow Compaction",
39
+ description: "Generates summaries when context window overflows, preserving recent turns",
40
+ requiresLLM: true,
41
+ isProactive: false
42
+ },
43
+ create(config, context) {
44
+ if (!context.model) {
45
+ throw new Error("ReactiveOverflowStrategy requires LanguageModel");
46
+ }
47
+ const options = {
48
+ preserveLastNTurns: config.preserveLastNTurns,
49
+ maxSummaryTokens: config.maxSummaryTokens
50
+ };
51
+ if (config.summaryPrompt !== void 0) {
52
+ options.summaryPrompt = config.summaryPrompt;
53
+ }
54
+ return new import_reactive_overflow.ReactiveOverflowStrategy(context.model, options, context.logger);
55
+ }
56
+ };
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ ReactiveOverflowConfigSchema,
60
+ reactiveOverflowProvider
61
+ });
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ import type { CompactionProvider } from '../provider.js';
3
+ /**
4
+ * Configuration schema for reactive overflow compaction
5
+ */
6
+ export declare const ReactiveOverflowConfigSchema: z.ZodObject<{
7
+ type: z.ZodLiteral<"reactive-overflow">;
8
+ enabled: z.ZodDefault<z.ZodBoolean>;
9
+ preserveLastNTurns: z.ZodDefault<z.ZodNumber>;
10
+ maxSummaryTokens: z.ZodDefault<z.ZodNumber>;
11
+ summaryPrompt: z.ZodOptional<z.ZodString>;
12
+ }, "strict", z.ZodTypeAny, {
13
+ type: "reactive-overflow";
14
+ enabled: boolean;
15
+ preserveLastNTurns: number;
16
+ maxSummaryTokens: number;
17
+ summaryPrompt?: string | undefined;
18
+ }, {
19
+ type: "reactive-overflow";
20
+ enabled?: boolean | undefined;
21
+ preserveLastNTurns?: number | undefined;
22
+ maxSummaryTokens?: number | undefined;
23
+ summaryPrompt?: string | undefined;
24
+ }>;
25
+ export type ReactiveOverflowConfig = z.output<typeof ReactiveOverflowConfigSchema>;
26
+ /**
27
+ * Provider for reactive overflow compaction strategy.
28
+ *
29
+ * This strategy triggers compaction when context window overflow is detected:
30
+ * - Generates LLM-powered summaries of older messages
31
+ * - Preserves recent turns for context continuity
32
+ * - Falls back to simple text summary if LLM call fails
33
+ * - Adds summary message to history (read-time filtering excludes old messages)
34
+ */
35
+ export declare const reactiveOverflowProvider: CompactionProvider<'reactive-overflow', ReactiveOverflowConfig>;
36
+ //# sourceMappingURL=reactive-overflow-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactive-overflow-provider.d.ts","sourceRoot":"","sources":["../../../../src/context/compaction/providers/reactive-overflow-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzD;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;EAqB5B,CAAC;AAEd,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEnF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,EAAE,kBAAkB,CACrD,mBAAmB,EACnB,sBAAsB,CA2BzB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import "../../../chunk-PTJYTZNU.js";
2
+ import { z } from "zod";
3
+ import { ReactiveOverflowStrategy } from "../strategies/reactive-overflow.js";
4
+ const ReactiveOverflowConfigSchema = z.object({
5
+ type: z.literal("reactive-overflow"),
6
+ enabled: z.boolean().default(true).describe("Enable or disable compaction"),
7
+ preserveLastNTurns: z.number().int().positive().default(2).describe("Number of recent turns (user+assistant pairs) to preserve"),
8
+ maxSummaryTokens: z.number().int().positive().default(2e3).describe("Maximum tokens for the summary output"),
9
+ summaryPrompt: z.string().optional().describe("Custom summary prompt template. Use {conversation} as placeholder")
10
+ }).strict();
11
+ const reactiveOverflowProvider = {
12
+ type: "reactive-overflow",
13
+ configSchema: ReactiveOverflowConfigSchema,
14
+ metadata: {
15
+ displayName: "Reactive Overflow Compaction",
16
+ description: "Generates summaries when context window overflows, preserving recent turns",
17
+ requiresLLM: true,
18
+ isProactive: false
19
+ },
20
+ create(config, context) {
21
+ if (!context.model) {
22
+ throw new Error("ReactiveOverflowStrategy requires LanguageModel");
23
+ }
24
+ const options = {
25
+ preserveLastNTurns: config.preserveLastNTurns,
26
+ maxSummaryTokens: config.maxSummaryTokens
27
+ };
28
+ if (config.summaryPrompt !== void 0) {
29
+ options.summaryPrompt = config.summaryPrompt;
30
+ }
31
+ return new ReactiveOverflowStrategy(context.model, options, context.logger);
32
+ }
33
+ };
34
+ export {
35
+ ReactiveOverflowConfigSchema,
36
+ reactiveOverflowProvider
37
+ };
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var registry_exports = {};
20
+ __export(registry_exports, {
21
+ compactionRegistry: () => compactionRegistry
22
+ });
23
+ module.exports = __toCommonJS(registry_exports);
24
+ var import_errors = require("../errors.js");
25
+ var import_base_registry = require("../../providers/base-registry.js");
26
+ const compactionErrorFactory = {
27
+ alreadyRegistered: (type) => import_errors.ContextError.compactionProviderAlreadyRegistered(type),
28
+ notFound: (type, availableTypes) => import_errors.ContextError.compactionInvalidType(type, availableTypes)
29
+ };
30
+ class CompactionRegistry extends import_base_registry.BaseRegistry {
31
+ constructor() {
32
+ super(compactionErrorFactory);
33
+ }
34
+ }
35
+ const compactionRegistry = new CompactionRegistry();
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ compactionRegistry
39
+ });
@@ -0,0 +1,19 @@
1
+ import type { CompactionProvider } from './provider.js';
2
+ import { BaseRegistry } from '../../providers/base-registry.js';
3
+ /**
4
+ * Global registry for compaction providers.
5
+ *
6
+ * Follows the same pattern as blob storage and tools registries:
7
+ * - Singleton instance exported
8
+ * - Registration before agent initialization
9
+ * - Type-safe provider lookup
10
+ *
11
+ * Extends BaseRegistry for common registry functionality.
12
+ */
13
+ declare class CompactionRegistry extends BaseRegistry<CompactionProvider<any, any>> {
14
+ constructor();
15
+ }
16
+ /** Global singleton instance */
17
+ export declare const compactionRegistry: CompactionRegistry;
18
+ export {};
19
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/context/compaction/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,EAAE,YAAY,EAA6B,MAAM,kCAAkC,CAAC;AAY3F;;;;;;;;;GASG;AACH,cAAM,kBAAmB,SAAQ,YAAY,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;;CAI1E;AAED,gCAAgC;AAChC,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import "../../chunk-PTJYTZNU.js";
2
+ import { ContextError } from "../errors.js";
3
+ import { BaseRegistry } from "../../providers/base-registry.js";
4
+ const compactionErrorFactory = {
5
+ alreadyRegistered: (type) => ContextError.compactionProviderAlreadyRegistered(type),
6
+ notFound: (type, availableTypes) => ContextError.compactionInvalidType(type, availableTypes)
7
+ };
8
+ class CompactionRegistry extends BaseRegistry {
9
+ constructor() {
10
+ super(compactionErrorFactory);
11
+ }
12
+ }
13
+ const compactionRegistry = new CompactionRegistry();
14
+ export {
15
+ compactionRegistry
16
+ };
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var schemas_exports = {};
20
+ __export(schemas_exports, {
21
+ CompactionConfigSchema: () => CompactionConfigSchema,
22
+ DEFAULT_COMPACTION_CONFIG: () => DEFAULT_COMPACTION_CONFIG
23
+ });
24
+ module.exports = __toCommonJS(schemas_exports);
25
+ var import_zod = require("zod");
26
+ const CompactionConfigSchema = import_zod.z.object({
27
+ type: import_zod.z.string().describe("Compaction provider type"),
28
+ enabled: import_zod.z.boolean().default(true).describe("Enable or disable compaction")
29
+ }).passthrough().describe("Context compaction configuration");
30
+ const DEFAULT_COMPACTION_CONFIG = {
31
+ type: "reactive-overflow",
32
+ enabled: true
33
+ };
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ CompactionConfigSchema,
37
+ DEFAULT_COMPACTION_CONFIG
38
+ });
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Base compaction configuration schema.
4
+ * Uses discriminated union to support different provider types.
5
+ *
6
+ * Each provider registers its own schema with specific validation rules.
7
+ * This schema accepts any configuration with a 'type' field.
8
+ */
9
+ export declare const CompactionConfigSchema: z.ZodObject<{
10
+ type: z.ZodString;
11
+ enabled: z.ZodDefault<z.ZodBoolean>;
12
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13
+ type: z.ZodString;
14
+ enabled: z.ZodDefault<z.ZodBoolean>;
15
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
16
+ type: z.ZodString;
17
+ enabled: z.ZodDefault<z.ZodBoolean>;
18
+ }, z.ZodTypeAny, "passthrough">>;
19
+ export type CompactionConfigInput = z.output<typeof CompactionConfigSchema>;
20
+ /**
21
+ * Default compaction configuration - uses reactive-overflow strategy
22
+ */
23
+ export declare const DEFAULT_COMPACTION_CONFIG: CompactionConfigInput;
24
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/context/compaction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;gCAMc,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,qBAGvC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import "../../chunk-PTJYTZNU.js";
2
+ import { z } from "zod";
3
+ const CompactionConfigSchema = z.object({
4
+ type: z.string().describe("Compaction provider type"),
5
+ enabled: z.boolean().default(true).describe("Enable or disable compaction")
6
+ }).passthrough().describe("Context compaction configuration");
7
+ const DEFAULT_COMPACTION_CONFIG = {
8
+ type: "reactive-overflow",
9
+ enabled: true
10
+ };
11
+ export {
12
+ CompactionConfigSchema,
13
+ DEFAULT_COMPACTION_CONFIG
14
+ };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var noop_exports = {};
20
+ __export(noop_exports, {
21
+ NoOpCompactionStrategy: () => NoOpCompactionStrategy
22
+ });
23
+ module.exports = __toCommonJS(noop_exports);
24
+ class NoOpCompactionStrategy {
25
+ name = "noop";
26
+ /**
27
+ * Does nothing - returns empty array (no summary needed)
28
+ */
29
+ async compact(_history) {
30
+ return [];
31
+ }
32
+ }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ NoOpCompactionStrategy
36
+ });
@@ -0,0 +1,18 @@
1
+ import type { ICompactionStrategy } from '../types.js';
2
+ import type { InternalMessage } from '../../types.js';
3
+ /**
4
+ * No-op compaction strategy that doesn't perform any compaction.
5
+ *
6
+ * Useful for:
7
+ * - Testing without compaction overhead
8
+ * - Disabling compaction temporarily
9
+ * - Contexts where full history is required
10
+ */
11
+ export declare class NoOpCompactionStrategy implements ICompactionStrategy {
12
+ readonly name = "noop";
13
+ /**
14
+ * Does nothing - returns empty array (no summary needed)
15
+ */
16
+ compact(_history: readonly InternalMessage[]): Promise<InternalMessage[]>;
17
+ }
18
+ //# sourceMappingURL=noop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../../../src/context/compaction/strategies/noop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;;;;;;GAOG;AACH,qBAAa,sBAAuB,YAAW,mBAAmB;IAC9D,QAAQ,CAAC,IAAI,UAAU;IAEvB;;OAEG;IACG,OAAO,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAGlF"}
@@ -0,0 +1,13 @@
1
+ import "../../../chunk-PTJYTZNU.js";
2
+ class NoOpCompactionStrategy {
3
+ name = "noop";
4
+ /**
5
+ * Does nothing - returns empty array (no summary needed)
6
+ */
7
+ async compact(_history) {
8
+ return [];
9
+ }
10
+ }
11
+ export {
12
+ NoOpCompactionStrategy
13
+ };
@@ -22,7 +22,7 @@ __export(reactive_overflow_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(reactive_overflow_exports);
24
24
  var import_ai = require("ai");
25
- var import_types = require("../types.js");
25
+ var import_types = require("../../types.js");
26
26
  const DEFAULT_OPTIONS = {
27
27
  preserveLastNTurns: 2,
28
28
  maxSummaryTokens: 2e3,
@@ -58,9 +58,9 @@ class ReactiveOverflowStrategy {
58
58
  * @param history The full conversation history
59
59
  * @returns Array with single summary message to add, or empty if nothing to summarize
60
60
  */
61
- async compress(history) {
61
+ async compact(history) {
62
62
  if (history.length <= 2) {
63
- this.logger.debug("ReactiveOverflowStrategy: History too short, skipping compression");
63
+ this.logger.debug("ReactiveOverflowStrategy: History too short, skipping compaction");
64
64
  return [];
65
65
  }
66
66
  const { toSummarize, toKeep } = this.splitHistory(history);
@@ -1,7 +1,7 @@
1
1
  import { type LanguageModel } from 'ai';
2
- import type { ICompressionStrategy } from './types.js';
3
- import type { InternalMessage } from '../types.js';
4
- import type { IDextoLogger } from '../../logger/v2/types.js';
2
+ import type { ICompactionStrategy } from '../types.js';
3
+ import type { InternalMessage } from '../../types.js';
4
+ import type { IDextoLogger } from '../../../logger/v2/types.js';
5
5
  /**
6
6
  * Configuration options for ReactiveOverflowStrategy.
7
7
  */
@@ -24,7 +24,7 @@ export interface ReactiveOverflowOptions {
24
24
  summaryPrompt?: string;
25
25
  }
26
26
  /**
27
- * ReactiveOverflowStrategy implements reactive compression.
27
+ * ReactiveOverflowStrategy implements reactive compaction.
28
28
  *
29
29
  * Key behaviors:
30
30
  * - Triggers on overflow (after actual tokens exceed context limit)
@@ -42,7 +42,7 @@ export interface ReactiveOverflowOptions {
42
42
  * and filterCompacted() handles excluding old messages at read-time.
43
43
  * This preserves full history for audit/recovery purposes.
44
44
  */
45
- export declare class ReactiveOverflowStrategy implements ICompressionStrategy {
45
+ export declare class ReactiveOverflowStrategy implements ICompactionStrategy {
46
46
  readonly name = "reactive-overflow";
47
47
  private readonly model;
48
48
  private readonly options;
@@ -59,7 +59,7 @@ export declare class ReactiveOverflowStrategy implements ICompressionStrategy {
59
59
  * @param history The full conversation history
60
60
  * @returns Array with single summary message to add, or empty if nothing to summarize
61
61
  */
62
- compress(history: readonly InternalMessage[]): Promise<InternalMessage[]>;
62
+ compact(history: readonly InternalMessage[]): Promise<InternalMessage[]>;
63
63
  /**
64
64
  * Split history into messages to summarize and messages to keep.
65
65
  * Keeps the last N turns (user + assistant pairs) intact.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactive-overflow.d.ts","sourceRoot":"","sources":["../../../../src/context/compaction/strategies/reactive-overflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,IAAI,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAY,MAAM,gBAAgB,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE;;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;AAiBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,wBAAyB,YAAW,mBAAmB;IAChE,QAAQ,CAAC,IAAI,uBAAuB;IAEpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAC5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;gBAE1B,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,uBAAuB,YAAK,EAAE,MAAM,EAAE,YAAY;IAM7F;;;;;;;;;;OAUG;IACG,OAAO,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IA0C9E;;;OAGG;IACH,OAAO,CAAC,YAAY;IA2CpB;;OAEG;YACW,eAAe;IAmB7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA2ChC;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAiChC"}
@@ -1,6 +1,6 @@
1
- import "../../chunk-PTJYTZNU.js";
1
+ import "../../../chunk-PTJYTZNU.js";
2
2
  import { generateText } from "ai";
3
- import { isAssistantMessage, isToolMessage } from "../types.js";
3
+ import { isAssistantMessage, isToolMessage } from "../../types.js";
4
4
  const DEFAULT_OPTIONS = {
5
5
  preserveLastNTurns: 2,
6
6
  maxSummaryTokens: 2e3,
@@ -36,9 +36,9 @@ class ReactiveOverflowStrategy {
36
36
  * @param history The full conversation history
37
37
  * @returns Array with single summary message to add, or empty if nothing to summarize
38
38
  */
39
- async compress(history) {
39
+ async compact(history) {
40
40
  if (history.length <= 2) {
41
- this.logger.debug("ReactiveOverflowStrategy: History too short, skipping compression");
41
+ this.logger.debug("ReactiveOverflowStrategy: History too short, skipping compaction");
42
42
  return [];
43
43
  }
44
44
  const { toSummarize, toKeep } = this.splitHistory(history);
@@ -1,20 +1,20 @@
1
1
  import { InternalMessage } from '../types.js';
2
2
  /**
3
- * Compression strategy interface.
3
+ * Compaction strategy interface.
4
4
  *
5
5
  * Strategies are responsible for reducing conversation history size
6
6
  * when context limits are exceeded. The strategy is called by TurnExecutor
7
7
  * after detecting overflow via actual token usage from the API.
8
8
  */
9
- export interface ICompressionStrategy {
9
+ export interface ICompactionStrategy {
10
10
  /** Human-readable name for logging/UI */
11
11
  readonly name: string;
12
12
  /**
13
- * Compresses the provided message history.
13
+ * Compacts the provided message history.
14
14
  *
15
15
  * @param history The current conversation history.
16
16
  * @returns Summary messages to add to history (filterCompacted handles the rest).
17
17
  */
18
- compress(history: readonly InternalMessage[]): Promise<InternalMessage[]> | InternalMessage[];
18
+ compact(history: readonly InternalMessage[]): Promise<InternalMessage[]> | InternalMessage[];
19
19
  }
20
20
  //# sourceMappingURL=types.d.ts.map
@@ -0,0 +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;;;;;OAKG;IACH,OAAO,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC;CAChG"}
File without changes
@@ -33,6 +33,10 @@ var ContextErrorCode = /* @__PURE__ */ ((ContextErrorCode2) => {
33
33
  ContextErrorCode2["TOKEN_COUNT_FAILED"] = "context_token_count_failed";
34
34
  ContextErrorCode2["PRESERVE_VALUES_NEGATIVE"] = "context_preserve_values_negative";
35
35
  ContextErrorCode2["MIN_MESSAGES_NEGATIVE"] = "context_min_messages_negative";
36
+ ContextErrorCode2["COMPACTION_INVALID_TYPE"] = "context_compaction_invalid_type";
37
+ ContextErrorCode2["COMPACTION_VALIDATION"] = "context_compaction_validation";
38
+ ContextErrorCode2["COMPACTION_MISSING_LLM"] = "context_compaction_missing_llm";
39
+ ContextErrorCode2["COMPACTION_PROVIDER_ALREADY_REGISTERED"] = "context_compaction_provider_already_registered";
36
40
  ContextErrorCode2["MESSAGE_NOT_FOUND"] = "context_message_not_found";
37
41
  ContextErrorCode2["MESSAGE_NOT_ASSISTANT"] = "context_message_not_assistant";
38
42
  ContextErrorCode2["ASSISTANT_CONTENT_NOT_STRING"] = "context_assistant_content_not_string";
@@ -14,6 +14,10 @@ export declare enum ContextErrorCode {
14
14
  TOKEN_COUNT_FAILED = "context_token_count_failed",
15
15
  PRESERVE_VALUES_NEGATIVE = "context_preserve_values_negative",
16
16
  MIN_MESSAGES_NEGATIVE = "context_min_messages_negative",
17
+ COMPACTION_INVALID_TYPE = "context_compaction_invalid_type",
18
+ COMPACTION_VALIDATION = "context_compaction_validation",
19
+ COMPACTION_MISSING_LLM = "context_compaction_missing_llm",
20
+ COMPACTION_PROVIDER_ALREADY_REGISTERED = "context_compaction_provider_already_registered",
17
21
  MESSAGE_NOT_FOUND = "context_message_not_found",
18
22
  MESSAGE_NOT_ASSISTANT = "context_message_not_assistant",
19
23
  ASSISTANT_CONTENT_NOT_STRING = "context_assistant_content_not_string"
@@ -1 +1 @@
1
- {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/context/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,gBAAgB;IAExB,oBAAoB,iCAAiC;IACrD,qBAAqB,kCAAkC;IAGvD,4BAA4B,yCAAyC;IAGrE,2CAA2C,wDAAwD;IACnG,oCAAoC,iDAAiD;IAGrF,2BAA2B,wCAAwC;IACnE,0BAA0B,uCAAuC;IAGjE,8BAA8B,2CAA2C;IAEzE,kBAAkB,+BAA+B;IAMjD,wBAAwB,qCAAqC;IAC7D,qBAAqB,kCAAkC;IAGvD,iBAAiB,8BAA8B;IAC/C,qBAAqB,kCAAkC;IACvD,4BAA4B,yCAAyC;CACxE"}
1
+ {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/context/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,gBAAgB;IAExB,oBAAoB,iCAAiC;IACrD,qBAAqB,kCAAkC;IAGvD,4BAA4B,yCAAyC;IAGrE,2CAA2C,wDAAwD;IACnG,oCAAoC,iDAAiD;IAGrF,2BAA2B,wCAAwC;IACnE,0BAA0B,uCAAuC;IAGjE,8BAA8B,2CAA2C;IAEzE,kBAAkB,+BAA+B;IAMjD,wBAAwB,qCAAqC;IAC7D,qBAAqB,kCAAkC;IACvD,uBAAuB,oCAAoC;IAC3D,qBAAqB,kCAAkC;IACvD,sBAAsB,mCAAmC;IACzD,sCAAsC,mDAAmD;IAGzF,iBAAiB,8BAA8B;IAC/C,qBAAqB,kCAAkC;IACvD,4BAA4B,yCAAyC;CACxE"}
@@ -11,6 +11,10 @@ var ContextErrorCode = /* @__PURE__ */ ((ContextErrorCode2) => {
11
11
  ContextErrorCode2["TOKEN_COUNT_FAILED"] = "context_token_count_failed";
12
12
  ContextErrorCode2["PRESERVE_VALUES_NEGATIVE"] = "context_preserve_values_negative";
13
13
  ContextErrorCode2["MIN_MESSAGES_NEGATIVE"] = "context_min_messages_negative";
14
+ ContextErrorCode2["COMPACTION_INVALID_TYPE"] = "context_compaction_invalid_type";
15
+ ContextErrorCode2["COMPACTION_VALIDATION"] = "context_compaction_validation";
16
+ ContextErrorCode2["COMPACTION_MISSING_LLM"] = "context_compaction_missing_llm";
17
+ ContextErrorCode2["COMPACTION_PROVIDER_ALREADY_REGISTERED"] = "context_compaction_provider_already_registered";
14
18
  ContextErrorCode2["MESSAGE_NOT_FOUND"] = "context_message_not_found";
15
19
  ContextErrorCode2["MESSAGE_NOT_ASSISTANT"] = "context_message_not_assistant";
16
20
  ContextErrorCode2["ASSISTANT_CONTENT_NOT_STRING"] = "context_assistant_content_not_string";
@@ -139,6 +139,46 @@ class ContextError {
139
139
  "Set minMessagesToKeep to zero or positive value"
140
140
  );
141
141
  }
142
+ static compactionInvalidType(type, available) {
143
+ return new import_errors.DextoRuntimeError(
144
+ import_error_codes.ContextErrorCode.COMPACTION_INVALID_TYPE,
145
+ import_types.ErrorScope.CONTEXT,
146
+ import_types.ErrorType.USER,
147
+ `Unknown compaction provider type: '${type}'`,
148
+ { type, available },
149
+ `Use one of the available types: ${available.join(", ")}`
150
+ );
151
+ }
152
+ static compactionValidation(type, errors) {
153
+ return new import_errors.DextoRuntimeError(
154
+ import_error_codes.ContextErrorCode.COMPACTION_VALIDATION,
155
+ import_types.ErrorScope.CONTEXT,
156
+ import_types.ErrorType.USER,
157
+ `Invalid configuration for compaction provider '${type}'`,
158
+ { type, errors },
159
+ "Check the configuration schema for this provider"
160
+ );
161
+ }
162
+ static compactionMissingLLM(type) {
163
+ return new import_errors.DextoRuntimeError(
164
+ import_error_codes.ContextErrorCode.COMPACTION_MISSING_LLM,
165
+ import_types.ErrorScope.CONTEXT,
166
+ import_types.ErrorType.USER,
167
+ `Compaction provider '${type}' requires LLM service but none provided`,
168
+ { type },
169
+ "Ensure LLM service is initialized before creating this compaction provider"
170
+ );
171
+ }
172
+ static compactionProviderAlreadyRegistered(type) {
173
+ return new import_errors.DextoRuntimeError(
174
+ import_error_codes.ContextErrorCode.COMPACTION_PROVIDER_ALREADY_REGISTERED,
175
+ import_types.ErrorScope.CONTEXT,
176
+ import_types.ErrorType.USER,
177
+ `Compaction provider '${type}' is already registered`,
178
+ { type },
179
+ "Each provider type can only be registered once"
180
+ );
181
+ }
142
182
  // Message lookup errors
143
183
  static messageNotFound(messageId) {
144
184
  return new import_errors.DextoRuntimeError(
@@ -17,6 +17,20 @@ export declare class ContextError {
17
17
  cause: string;
18
18
  }>;
19
19
  static minMessagesNegative(): DextoRuntimeError<{}>;
20
+ static compactionInvalidType(type: string, available: string[]): DextoRuntimeError<{
21
+ type: string;
22
+ available: string[];
23
+ }>;
24
+ static compactionValidation(type: string, errors: unknown): DextoRuntimeError<{
25
+ type: string;
26
+ errors: unknown;
27
+ }>;
28
+ static compactionMissingLLM(type: string): DextoRuntimeError<{
29
+ type: string;
30
+ }>;
31
+ static compactionProviderAlreadyRegistered(type: string): DextoRuntimeError<{
32
+ type: string;
33
+ }>;
20
34
  static messageNotFound(messageId: string): DextoRuntimeError<{
21
35
  messageId: string;
22
36
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/context/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD;;;GAGG;AACH,qBAAa,YAAY;IAErB,MAAM,CAAC,kBAAkB;IAWzB,MAAM,CAAC,yBAAyB;IAWhC,MAAM,CAAC,sCAAsC;IAW7C,MAAM,CAAC,gCAAgC;IAWvC,MAAM,CAAC,wBAAwB;IAW/B,MAAM,CAAC,2BAA2B;IAWlC,MAAM,CAAC,uBAAuB;IAW9B,MAAM,CAAC,sBAAsB;IAe7B,MAAM,CAAC,sBAAsB;IAW7B,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM;;;IAWrC,MAAM,CAAC,mBAAmB;IAY1B,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM;;;IAUxC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM;;;IAU5C,MAAM,CAAC,yBAAyB;CASnC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/context/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD;;;GAGG;AACH,qBAAa,YAAY;IAErB,MAAM,CAAC,kBAAkB;IAWzB,MAAM,CAAC,yBAAyB;IAWhC,MAAM,CAAC,sCAAsC;IAW7C,MAAM,CAAC,gCAAgC;IAWvC,MAAM,CAAC,wBAAwB;IAW/B,MAAM,CAAC,2BAA2B;IAWlC,MAAM,CAAC,uBAAuB;IAW9B,MAAM,CAAC,sBAAsB;IAe7B,MAAM,CAAC,sBAAsB;IAW7B,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM;;;IAWrC,MAAM,CAAC,mBAAmB;IAW1B,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE;;;;IAW9D,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;;;;IAWzD,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM;;;IAWxC,MAAM,CAAC,mCAAmC,CAAC,IAAI,EAAE,MAAM;;;IAYvD,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM;;;IAUxC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM;;;IAU5C,MAAM,CAAC,yBAAyB;CASnC"}