kynjal-cli 4.0.0 → 4.0.1

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 (502) hide show
  1. package/dist/src/appliance/gguf-engine.d.ts +91 -0
  2. package/dist/src/appliance/gguf-engine.d.ts.map +1 -0
  3. package/dist/src/appliance/gguf-engine.js +286 -525
  4. package/dist/src/appliance/gguf-engine.js.map +1 -1
  5. package/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
  6. package/dist/src/appliance/ruvllm-bridge.d.ts.map +1 -0
  7. package/dist/src/appliance/ruvllm-bridge.js +203 -403
  8. package/dist/src/appliance/ruvllm-bridge.js.map +1 -1
  9. package/dist/src/appliance/rvfa-builder.d.ts +44 -0
  10. package/dist/src/appliance/rvfa-builder.d.ts.map +1 -0
  11. package/dist/src/appliance/rvfa-builder.js +154 -208
  12. package/dist/src/appliance/rvfa-builder.js.map +1 -1
  13. package/dist/src/appliance/rvfa-distribution.d.ts +97 -0
  14. package/dist/src/appliance/rvfa-distribution.d.ts.map +1 -0
  15. package/dist/src/appliance/rvfa-distribution.js +260 -423
  16. package/dist/src/appliance/rvfa-distribution.js.map +1 -1
  17. package/dist/src/appliance/rvfa-format.d.ts +111 -0
  18. package/dist/src/appliance/rvfa-format.d.ts.map +1 -0
  19. package/dist/src/appliance/rvfa-format.js +128 -200
  20. package/dist/src/appliance/rvfa-format.js.map +1 -1
  21. package/dist/src/appliance/rvfa-runner.d.ts +69 -0
  22. package/dist/src/appliance/rvfa-runner.d.ts.map +1 -0
  23. package/dist/src/appliance/rvfa-runner.js +168 -304
  24. package/dist/src/appliance/rvfa-runner.js.map +1 -1
  25. package/dist/src/appliance/rvfa-signing.d.ts +123 -0
  26. package/dist/src/appliance/rvfa-signing.d.ts.map +1 -0
  27. package/dist/src/appliance/rvfa-signing.js +173 -295
  28. package/dist/src/appliance/rvfa-signing.js.map +1 -1
  29. package/dist/src/benchmarks/pretrain/index.d.ts +58 -0
  30. package/dist/src/benchmarks/pretrain/index.d.ts.map +1 -0
  31. package/dist/src/benchmarks/pretrain/index.js +331 -542
  32. package/dist/src/benchmarks/pretrain/index.js.map +1 -1
  33. package/dist/src/commands/agent.js +574 -697
  34. package/dist/src/commands/agent.js.map +1 -1
  35. package/dist/src/commands/analyze.js +1218 -1548
  36. package/dist/src/commands/analyze.js.map +1 -1
  37. package/dist/src/commands/appliance-advanced.js +158 -267
  38. package/dist/src/commands/appliance-advanced.js.map +1 -1
  39. package/dist/src/commands/appliance.js +318 -493
  40. package/dist/src/commands/appliance.js.map +1 -1
  41. package/dist/src/commands/benchmark.js +372 -523
  42. package/dist/src/commands/benchmark.js.map +1 -1
  43. package/dist/src/commands/claims.js +274 -364
  44. package/dist/src/commands/claims.js.map +1 -1
  45. package/dist/src/commands/cleanup.js +113 -157
  46. package/dist/src/commands/cleanup.js.map +1 -1
  47. package/dist/src/commands/completions.js +477 -118
  48. package/dist/src/commands/completions.js.map +1 -1
  49. package/dist/src/commands/config.js +237 -303
  50. package/dist/src/commands/config.js.map +1 -1
  51. package/dist/src/commands/daemon.js +487 -596
  52. package/dist/src/commands/daemon.js.map +1 -1
  53. package/dist/src/commands/deployment.js +194 -275
  54. package/dist/src/commands/deployment.js.map +1 -1
  55. package/dist/src/commands/doctor.js +504 -686
  56. package/dist/src/commands/doctor.js.map +1 -1
  57. package/dist/src/commands/embeddings.js +1293 -1543
  58. package/dist/src/commands/embeddings.js.map +1 -1
  59. package/dist/src/commands/guidance.js +449 -596
  60. package/dist/src/commands/guidance.js.map +1 -1
  61. package/dist/src/commands/hive-mind.js +854 -938
  62. package/dist/src/commands/hive-mind.js.map +1 -1
  63. package/dist/src/commands/hooks.js +3112 -3519
  64. package/dist/src/commands/hooks.js.map +1 -1
  65. package/dist/src/commands/index.d.ts +115 -0
  66. package/dist/src/commands/index.d.ts.map +1 -0
  67. package/dist/src/commands/index.js +126 -308
  68. package/dist/src/commands/index.js.map +1 -1
  69. package/dist/src/commands/init.js +788 -940
  70. package/dist/src/commands/init.js.map +1 -1
  71. package/dist/src/commands/issues.js +383 -558
  72. package/dist/src/commands/issues.js.map +1 -1
  73. package/dist/src/commands/mcp.js +493 -605
  74. package/dist/src/commands/mcp.js.map +1 -1
  75. package/dist/src/commands/memory.js +833 -1026
  76. package/dist/src/commands/memory.js.map +1 -1
  77. package/dist/src/commands/migrate.js +282 -347
  78. package/dist/src/commands/migrate.js.map +1 -1
  79. package/dist/src/commands/neural.js +1289 -1563
  80. package/dist/src/commands/neural.js.map +1 -1
  81. package/dist/src/commands/performance.js +497 -643
  82. package/dist/src/commands/performance.js.map +1 -1
  83. package/dist/src/commands/plugins.js +668 -841
  84. package/dist/src/commands/plugins.js.map +1 -1
  85. package/dist/src/commands/process.js +392 -447
  86. package/dist/src/commands/process.js.map +1 -1
  87. package/dist/src/commands/progress.js +162 -256
  88. package/dist/src/commands/progress.js.map +1 -1
  89. package/dist/src/commands/providers.js +150 -220
  90. package/dist/src/commands/providers.js.map +1 -1
  91. package/dist/src/commands/route.js +520 -665
  92. package/dist/src/commands/route.js.map +1 -1
  93. package/dist/src/commands/ruvector/backup.js +505 -651
  94. package/dist/src/commands/ruvector/backup.js.map +1 -1
  95. package/dist/src/commands/ruvector/benchmark.js +349 -401
  96. package/dist/src/commands/ruvector/benchmark.js.map +1 -1
  97. package/dist/src/commands/ruvector/import.js +224 -266
  98. package/dist/src/commands/ruvector/import.js.map +1 -1
  99. package/dist/src/commands/ruvector/index.js +37 -75
  100. package/dist/src/commands/ruvector/index.js.map +1 -1
  101. package/dist/src/commands/ruvector/init.js +336 -359
  102. package/dist/src/commands/ruvector/init.js.map +1 -1
  103. package/dist/src/commands/ruvector/migrate.js +335 -322
  104. package/dist/src/commands/ruvector/migrate.js.map +1 -1
  105. package/dist/src/commands/ruvector/optimize.js +375 -431
  106. package/dist/src/commands/ruvector/optimize.js.map +1 -1
  107. package/dist/src/commands/ruvector/setup.js +703 -117
  108. package/dist/src/commands/ruvector/setup.js.map +1 -1
  109. package/dist/src/commands/ruvector/status.js +364 -419
  110. package/dist/src/commands/ruvector/status.js.map +1 -1
  111. package/dist/src/commands/security.js +485 -608
  112. package/dist/src/commands/security.js.map +1 -1
  113. package/dist/src/commands/session.js +504 -626
  114. package/dist/src/commands/session.js.map +1 -1
  115. package/dist/src/commands/start.js +267 -364
  116. package/dist/src/commands/start.js.map +1 -1
  117. package/dist/src/commands/status.js +380 -486
  118. package/dist/src/commands/status.js.map +1 -1
  119. package/dist/src/commands/swarm.js +408 -488
  120. package/dist/src/commands/swarm.js.map +1 -1
  121. package/dist/src/commands/task.js +423 -538
  122. package/dist/src/commands/task.js.map +1 -1
  123. package/dist/src/commands/transfer-store.js +322 -412
  124. package/dist/src/commands/transfer-store.js.map +1 -1
  125. package/dist/src/commands/update.js +196 -291
  126. package/dist/src/commands/update.js.map +1 -1
  127. package/dist/src/commands/workflow.js +386 -486
  128. package/dist/src/commands/workflow.js.map +1 -1
  129. package/dist/src/config-adapter.d.ts +15 -0
  130. package/dist/src/config-adapter.d.ts.map +1 -0
  131. package/dist/src/config-adapter.js +38 -39
  132. package/dist/src/config-adapter.js.map +1 -1
  133. package/dist/src/index.d.ts +77 -0
  134. package/dist/src/index.d.ts.map +1 -0
  135. package/dist/src/index.js +309 -411
  136. package/dist/src/index.js.map +1 -1
  137. package/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
  138. package/dist/src/infrastructure/in-memory-repositories.d.ts.map +1 -0
  139. package/dist/src/infrastructure/in-memory-repositories.js +246 -507
  140. package/dist/src/infrastructure/in-memory-repositories.js.map +1 -1
  141. package/dist/src/init/claudemd-generator.d.ts +25 -0
  142. package/dist/src/init/claudemd-generator.d.ts.map +1 -0
  143. package/dist/src/init/claudemd-generator.js +368 -78
  144. package/dist/src/init/claudemd-generator.js.map +1 -1
  145. package/dist/src/init/executor.d.ts +41 -0
  146. package/dist/src/init/executor.d.ts.map +1 -0
  147. package/dist/src/init/executor.js +1307 -996
  148. package/dist/src/init/executor.js.map +1 -1
  149. package/dist/src/init/helpers-generator.d.ts +60 -0
  150. package/dist/src/init/helpers-generator.d.ts.map +1 -0
  151. package/dist/src/init/helpers-generator.js +657 -12
  152. package/dist/src/init/helpers-generator.js.map +1 -1
  153. package/dist/src/init/index.d.ts +1 -1
  154. package/dist/src/init/index.d.ts.map +1 -1
  155. package/dist/src/init/index.js +1 -1
  156. package/dist/src/init/index.js.map +1 -1
  157. package/dist/src/init/mcp-generator.js +33 -37
  158. package/dist/src/init/mcp-generator.js.map +1 -1
  159. package/dist/src/init/settings-generator.js +76 -77
  160. package/dist/src/init/settings-generator.js.map +1 -1
  161. package/dist/src/init/statusline-generator.js +801 -3
  162. package/dist/src/init/statusline-generator.js.map +1 -1
  163. package/dist/src/init/types.d.ts +1 -1
  164. package/dist/src/init/types.d.ts.map +1 -1
  165. package/dist/src/init/types.js +76 -59
  166. package/dist/src/init/types.js.map +1 -1
  167. package/dist/src/mcp-client.d.ts +92 -0
  168. package/dist/src/mcp-client.d.ts.map +1 -0
  169. package/dist/src/mcp-client.js +81 -125
  170. package/dist/src/mcp-client.js.map +1 -1
  171. package/dist/src/mcp-server.d.ts +161 -0
  172. package/dist/src/mcp-server.d.ts.map +1 -0
  173. package/dist/src/mcp-server.js +470 -757
  174. package/dist/src/mcp-server.js.map +1 -1
  175. package/dist/src/mcp-tools/agent-tools.js +391 -492
  176. package/dist/src/mcp-tools/agent-tools.js.map +1 -1
  177. package/dist/src/mcp-tools/agentdb-tools.js +332 -533
  178. package/dist/src/mcp-tools/agentdb-tools.js.map +1 -1
  179. package/dist/src/mcp-tools/analyze-tools.js +172 -236
  180. package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
  181. package/dist/src/mcp-tools/auto-install.d.ts +83 -0
  182. package/dist/src/mcp-tools/auto-install.d.ts.map +1 -0
  183. package/dist/src/mcp-tools/auto-install.js +80 -142
  184. package/dist/src/mcp-tools/auto-install.js.map +1 -1
  185. package/dist/src/mcp-tools/browser-tools.js +252 -375
  186. package/dist/src/mcp-tools/browser-tools.js.map +1 -1
  187. package/dist/src/mcp-tools/claims-tools.js +473 -565
  188. package/dist/src/mcp-tools/claims-tools.js.map +1 -1
  189. package/dist/src/mcp-tools/config-tools.js +197 -272
  190. package/dist/src/mcp-tools/config-tools.js.map +1 -1
  191. package/dist/src/mcp-tools/coordination-tools.js +500 -572
  192. package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
  193. package/dist/src/mcp-tools/daa-tools.js +286 -364
  194. package/dist/src/mcp-tools/daa-tools.js.map +1 -1
  195. package/dist/src/mcp-tools/embeddings-tools.js +582 -693
  196. package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
  197. package/dist/src/mcp-tools/github-tools.js +260 -311
  198. package/dist/src/mcp-tools/github-tools.js.map +1 -1
  199. package/dist/src/mcp-tools/hive-mind-tools.js +573 -640
  200. package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
  201. package/dist/src/mcp-tools/hooks-tools.js +2215 -2648
  202. package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
  203. package/dist/src/mcp-tools/memory-tools.js +350 -505
  204. package/dist/src/mcp-tools/memory-tools.js.map +1 -1
  205. package/dist/src/mcp-tools/neural-tools.js +315 -412
  206. package/dist/src/mcp-tools/neural-tools.js.map +1 -1
  207. package/dist/src/mcp-tools/performance-tools.js +420 -480
  208. package/dist/src/mcp-tools/performance-tools.js.map +1 -1
  209. package/dist/src/mcp-tools/progress-tools.js +204 -278
  210. package/dist/src/mcp-tools/progress-tools.js.map +1 -1
  211. package/dist/src/mcp-tools/ruvllm-tools.js +163 -279
  212. package/dist/src/mcp-tools/ruvllm-tools.js.map +1 -1
  213. package/dist/src/mcp-tools/security-tools.js +297 -429
  214. package/dist/src/mcp-tools/security-tools.js.map +1 -1
  215. package/dist/src/mcp-tools/session-tools.js +185 -234
  216. package/dist/src/mcp-tools/session-tools.js.map +1 -1
  217. package/dist/src/mcp-tools/swarm-tools.js +207 -260
  218. package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
  219. package/dist/src/mcp-tools/system-tools.js +276 -325
  220. package/dist/src/mcp-tools/system-tools.js.map +1 -1
  221. package/dist/src/mcp-tools/task-tools.js +270 -336
  222. package/dist/src/mcp-tools/task-tools.js.map +1 -1
  223. package/dist/src/mcp-tools/terminal-tools.js +148 -196
  224. package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
  225. package/dist/src/mcp-tools/transfer-tools.js +186 -333
  226. package/dist/src/mcp-tools/transfer-tools.js.map +1 -1
  227. package/dist/src/mcp-tools/types.d.ts +31 -0
  228. package/dist/src/mcp-tools/types.d.ts.map +1 -0
  229. package/dist/src/mcp-tools/wasm-agent-tools.js +133 -280
  230. package/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -1
  231. package/dist/src/mcp-tools/workflow-tools.js +405 -450
  232. package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
  233. package/dist/src/memory/ewc-consolidation.d.ts +295 -0
  234. package/dist/src/memory/ewc-consolidation.d.ts.map +1 -0
  235. package/dist/src/memory/ewc-consolidation.js +190 -303
  236. package/dist/src/memory/ewc-consolidation.js.map +1 -1
  237. package/dist/src/memory/intelligence.d.ts +338 -0
  238. package/dist/src/memory/intelligence.d.ts.map +1 -0
  239. package/dist/src/memory/intelligence.js +569 -794
  240. package/dist/src/memory/intelligence.js.map +1 -1
  241. package/dist/src/memory/memory-bridge.d.ts +407 -0
  242. package/dist/src/memory/memory-bridge.d.ts.map +1 -0
  243. package/dist/src/memory/memory-bridge.js +1170 -1640
  244. package/dist/src/memory/memory-bridge.js.map +1 -1
  245. package/dist/src/memory/memory-initializer.d.ts +412 -0
  246. package/dist/src/memory/memory-initializer.d.ts.map +1 -0
  247. package/dist/src/memory/memory-initializer.js +1836 -1851
  248. package/dist/src/memory/memory-initializer.js.map +1 -1
  249. package/dist/src/memory/sona-optimizer.d.ts +227 -0
  250. package/dist/src/memory/sona-optimizer.d.ts.map +1 -0
  251. package/dist/src/memory/sona-optimizer.js +199 -329
  252. package/dist/src/memory/sona-optimizer.js.map +1 -1
  253. package/dist/src/output.d.ts +2 -2
  254. package/dist/src/output.d.ts.map +1 -1
  255. package/dist/src/output.js +242 -272
  256. package/dist/src/output.js.map +1 -1
  257. package/dist/src/parser.d.ts +51 -0
  258. package/dist/src/parser.d.ts.map +1 -0
  259. package/dist/src/parser.js +140 -187
  260. package/dist/src/parser.js.map +1 -1
  261. package/dist/src/plugins/manager.d.ts +133 -0
  262. package/dist/src/plugins/manager.d.ts.map +1 -0
  263. package/dist/src/plugins/manager.js +285 -521
  264. package/dist/src/plugins/manager.js.map +1 -1
  265. package/dist/src/plugins/store/discovery.d.ts +88 -0
  266. package/dist/src/plugins/store/discovery.d.ts.map +1 -0
  267. package/dist/src/plugins/store/discovery.js +271 -358
  268. package/dist/src/plugins/store/discovery.js.map +1 -1
  269. package/dist/src/plugins/store/index.d.ts +76 -0
  270. package/dist/src/plugins/store/index.d.ts.map +1 -0
  271. package/dist/src/plugins/store/index.js +48 -105
  272. package/dist/src/plugins/store/index.js.map +1 -1
  273. package/dist/src/plugins/store/search.d.ts +46 -0
  274. package/dist/src/plugins/store/search.d.ts.map +1 -0
  275. package/dist/src/plugins/store/search.js +69 -107
  276. package/dist/src/plugins/store/search.js.map +1 -1
  277. package/dist/src/plugins/store/types.d.ts +274 -0
  278. package/dist/src/plugins/store/types.d.ts.map +1 -0
  279. package/dist/src/plugins/tests/demo-plugin-store.js +113 -160
  280. package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -1
  281. package/dist/src/plugins/tests/standalone-test.js +172 -223
  282. package/dist/src/plugins/tests/standalone-test.js.map +1 -1
  283. package/dist/src/plugins/tests/test-plugin-store.js +190 -228
  284. package/dist/src/plugins/tests/test-plugin-store.js.map +1 -1
  285. package/dist/src/production/circuit-breaker.d.ts +101 -0
  286. package/dist/src/production/circuit-breaker.d.ts.map +1 -0
  287. package/dist/src/production/circuit-breaker.js +62 -126
  288. package/dist/src/production/circuit-breaker.js.map +1 -1
  289. package/dist/src/production/error-handler.d.ts +92 -0
  290. package/dist/src/production/error-handler.d.ts.map +1 -0
  291. package/dist/src/production/error-handler.js +86 -156
  292. package/dist/src/production/error-handler.js.map +1 -1
  293. package/dist/src/production/monitoring.d.ts +161 -0
  294. package/dist/src/production/monitoring.d.ts.map +1 -0
  295. package/dist/src/production/monitoring.js +139 -220
  296. package/dist/src/production/monitoring.js.map +1 -1
  297. package/dist/src/production/rate-limiter.d.ts +80 -0
  298. package/dist/src/production/rate-limiter.d.ts.map +1 -0
  299. package/dist/src/production/rate-limiter.js +74 -93
  300. package/dist/src/production/rate-limiter.js.map +1 -1
  301. package/dist/src/production/retry.d.ts +48 -0
  302. package/dist/src/production/retry.d.ts.map +1 -0
  303. package/dist/src/production/retry.js +75 -167
  304. package/dist/src/production/retry.js.map +1 -1
  305. package/dist/src/prompt.d.ts +44 -0
  306. package/dist/src/prompt.d.ts.map +1 -0
  307. package/dist/src/prompt.js +436 -560
  308. package/dist/src/prompt.js.map +1 -1
  309. package/dist/src/runtime/headless.d.ts +60 -0
  310. package/dist/src/runtime/headless.d.ts.map +1 -0
  311. package/dist/src/runtime/headless.js +197 -286
  312. package/dist/src/runtime/headless.js.map +1 -1
  313. package/dist/src/ruvector/agent-wasm.d.ts +182 -0
  314. package/dist/src/ruvector/agent-wasm.d.ts.map +1 -0
  315. package/dist/src/ruvector/agent-wasm.js +156 -351
  316. package/dist/src/ruvector/agent-wasm.js.map +1 -1
  317. package/dist/src/ruvector/ast-analyzer.d.ts +67 -0
  318. package/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
  319. package/dist/src/ruvector/ast-analyzer.js +145 -232
  320. package/dist/src/ruvector/ast-analyzer.js.map +1 -1
  321. package/dist/src/ruvector/coverage-router.d.ts +160 -0
  322. package/dist/src/ruvector/coverage-router.d.ts.map +1 -0
  323. package/dist/src/ruvector/coverage-router.js +287 -419
  324. package/dist/src/ruvector/coverage-router.js.map +1 -1
  325. package/dist/src/ruvector/coverage-tools.js +56 -101
  326. package/dist/src/ruvector/coverage-tools.js.map +1 -1
  327. package/dist/src/ruvector/diff-classifier.d.ts +175 -0
  328. package/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
  329. package/dist/src/ruvector/diff-classifier.js +324 -451
  330. package/dist/src/ruvector/diff-classifier.js.map +1 -1
  331. package/dist/src/ruvector/enhanced-model-router.d.ts +146 -0
  332. package/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -0
  333. package/dist/src/ruvector/enhanced-model-router.js +260 -336
  334. package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
  335. package/dist/src/ruvector/flash-attention.d.ts +195 -0
  336. package/dist/src/ruvector/flash-attention.d.ts.map +1 -0
  337. package/dist/src/ruvector/flash-attention.js +223 -254
  338. package/dist/src/ruvector/flash-attention.js.map +1 -1
  339. package/dist/src/ruvector/graph-analyzer.d.ts +187 -0
  340. package/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
  341. package/dist/src/ruvector/graph-analyzer.js +486 -680
  342. package/dist/src/ruvector/graph-analyzer.js.map +1 -1
  343. package/dist/src/ruvector/index.d.ts +40 -0
  344. package/dist/src/ruvector/index.d.ts.map +1 -0
  345. package/dist/src/ruvector/index.js +36 -106
  346. package/dist/src/ruvector/index.js.map +1 -1
  347. package/dist/src/ruvector/lora-adapter.d.ts +218 -0
  348. package/dist/src/ruvector/lora-adapter.d.ts.map +1 -0
  349. package/dist/src/ruvector/lora-adapter.js +155 -248
  350. package/dist/src/ruvector/lora-adapter.js.map +1 -1
  351. package/dist/src/ruvector/model-router.d.ts +220 -0
  352. package/dist/src/ruvector/model-router.d.ts.map +1 -0
  353. package/dist/src/ruvector/model-router.js +175 -248
  354. package/dist/src/ruvector/model-router.js.map +1 -1
  355. package/dist/src/ruvector/moe-router.d.ts +206 -0
  356. package/dist/src/ruvector/moe-router.d.ts.map +1 -0
  357. package/dist/src/ruvector/moe-router.js +228 -286
  358. package/dist/src/ruvector/moe-router.js.map +1 -1
  359. package/dist/src/ruvector/q-learning-router.d.ts +211 -0
  360. package/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
  361. package/dist/src/ruvector/q-learning-router.js +257 -338
  362. package/dist/src/ruvector/q-learning-router.js.map +1 -1
  363. package/dist/src/ruvector/ruvllm-wasm.d.ts +179 -0
  364. package/dist/src/ruvector/ruvllm-wasm.d.ts.map +1 -0
  365. package/dist/src/ruvector/ruvllm-wasm.js +270 -434
  366. package/dist/src/ruvector/ruvllm-wasm.js.map +1 -1
  367. package/dist/src/ruvector/semantic-router.d.ts +77 -0
  368. package/dist/src/ruvector/semantic-router.d.ts.map +1 -0
  369. package/dist/src/ruvector/semantic-router.js +60 -67
  370. package/dist/src/ruvector/semantic-router.js.map +1 -1
  371. package/dist/src/ruvector/vector-db.d.ts +69 -0
  372. package/dist/src/ruvector/vector-db.d.ts.map +1 -0
  373. package/dist/src/ruvector/vector-db.js +119 -205
  374. package/dist/src/ruvector/vector-db.js.map +1 -1
  375. package/dist/src/services/agentic-flow-bridge.d.ts +50 -0
  376. package/dist/src/services/agentic-flow-bridge.d.ts.map +1 -0
  377. package/dist/src/services/agentic-flow-bridge.js +32 -105
  378. package/dist/src/services/agentic-flow-bridge.js.map +1 -1
  379. package/dist/src/services/claim-service.d.ts +204 -0
  380. package/dist/src/services/claim-service.d.ts.map +1 -0
  381. package/dist/src/services/claim-service.js +615 -940
  382. package/dist/src/services/claim-service.js.map +1 -1
  383. package/dist/src/services/container-worker-pool.d.ts +197 -0
  384. package/dist/src/services/container-worker-pool.d.ts.map +1 -0
  385. package/dist/src/services/container-worker-pool.js +398 -666
  386. package/dist/src/services/container-worker-pool.js.map +1 -1
  387. package/dist/src/services/headless-worker-executor.d.ts +304 -0
  388. package/dist/src/services/headless-worker-executor.d.ts.map +1 -0
  389. package/dist/src/services/headless-worker-executor.js +441 -467
  390. package/dist/src/services/headless-worker-executor.js.map +1 -1
  391. package/dist/src/services/index.d.ts +4 -4
  392. package/dist/src/services/index.d.ts.map +1 -1
  393. package/dist/src/services/index.js +4 -4
  394. package/dist/src/services/index.js.map +1 -1
  395. package/dist/src/services/registry-api.d.ts +58 -0
  396. package/dist/src/services/registry-api.d.ts.map +1 -0
  397. package/dist/src/services/registry-api.js +92 -200
  398. package/dist/src/services/registry-api.js.map +1 -1
  399. package/dist/src/services/ruvector-training.d.ts +222 -0
  400. package/dist/src/services/ruvector-training.d.ts.map +1 -0
  401. package/dist/src/services/ruvector-training.js +257 -337
  402. package/dist/src/services/ruvector-training.js.map +1 -1
  403. package/dist/src/services/worker-daemon.d.ts +228 -0
  404. package/dist/src/services/worker-daemon.d.ts.map +1 -0
  405. package/dist/src/services/worker-daemon.js +591 -849
  406. package/dist/src/services/worker-daemon.js.map +1 -1
  407. package/dist/src/services/worker-queue.d.ts +194 -0
  408. package/dist/src/services/worker-queue.d.ts.map +1 -0
  409. package/dist/src/services/worker-queue.js +331 -548
  410. package/dist/src/services/worker-queue.js.map +1 -1
  411. package/dist/src/suggest.d.ts +53 -0
  412. package/dist/src/suggest.d.ts.map +1 -0
  413. package/dist/src/suggest.js +45 -55
  414. package/dist/src/suggest.js.map +1 -1
  415. package/dist/src/transfer/anonymization/index.js +29 -37
  416. package/dist/src/transfer/anonymization/index.js.map +1 -1
  417. package/dist/src/transfer/deploy-seraphine.js +128 -155
  418. package/dist/src/transfer/deploy-seraphine.js.map +1 -1
  419. package/dist/src/transfer/export.d.ts +25 -0
  420. package/dist/src/transfer/export.d.ts.map +1 -0
  421. package/dist/src/transfer/export.js +84 -142
  422. package/dist/src/transfer/export.js.map +1 -1
  423. package/dist/src/transfer/index.d.ts +1 -1
  424. package/dist/src/transfer/index.d.ts.map +1 -1
  425. package/dist/src/transfer/index.js +0 -2
  426. package/dist/src/transfer/index.js.map +1 -1
  427. package/dist/src/transfer/ipfs/client.d.ts +109 -0
  428. package/dist/src/transfer/ipfs/client.d.ts.map +1 -0
  429. package/dist/src/transfer/ipfs/client.js +187 -337
  430. package/dist/src/transfer/ipfs/client.js.map +1 -1
  431. package/dist/src/transfer/ipfs/upload.d.ts +95 -0
  432. package/dist/src/transfer/ipfs/upload.d.ts.map +1 -0
  433. package/dist/src/transfer/ipfs/upload.js +288 -434
  434. package/dist/src/transfer/ipfs/upload.js.map +1 -1
  435. package/dist/src/transfer/models/seraphine.d.ts +72 -0
  436. package/dist/src/transfer/models/seraphine.d.ts.map +1 -0
  437. package/dist/src/transfer/models/seraphine.js +55 -55
  438. package/dist/src/transfer/models/seraphine.js.map +1 -1
  439. package/dist/src/transfer/serialization/cfp.d.ts +49 -0
  440. package/dist/src/transfer/serialization/cfp.d.ts.map +1 -0
  441. package/dist/src/transfer/serialization/cfp.js +30 -31
  442. package/dist/src/transfer/serialization/cfp.js.map +1 -1
  443. package/dist/src/transfer/storage/gcs.d.ts +82 -0
  444. package/dist/src/transfer/storage/gcs.d.ts.map +1 -0
  445. package/dist/src/transfer/storage/gcs.js +165 -232
  446. package/dist/src/transfer/storage/gcs.js.map +1 -1
  447. package/dist/src/transfer/store/discovery.d.ts +84 -0
  448. package/dist/src/transfer/store/discovery.d.ts.map +1 -0
  449. package/dist/src/transfer/store/discovery.js +239 -349
  450. package/dist/src/transfer/store/discovery.js.map +1 -1
  451. package/dist/src/transfer/store/download.d.ts +70 -0
  452. package/dist/src/transfer/store/download.d.ts.map +1 -0
  453. package/dist/src/transfer/store/download.js +243 -365
  454. package/dist/src/transfer/store/download.js.map +1 -1
  455. package/dist/src/transfer/store/index.d.ts +84 -0
  456. package/dist/src/transfer/store/index.d.ts.map +1 -0
  457. package/dist/src/transfer/store/index.js +63 -130
  458. package/dist/src/transfer/store/index.js.map +1 -1
  459. package/dist/src/transfer/store/publish.d.ts +76 -0
  460. package/dist/src/transfer/store/publish.d.ts.map +1 -0
  461. package/dist/src/transfer/store/publish.js +184 -258
  462. package/dist/src/transfer/store/publish.js.map +1 -1
  463. package/dist/src/transfer/store/registry.js +50 -72
  464. package/dist/src/transfer/store/registry.js.map +1 -1
  465. package/dist/src/transfer/store/search.d.ts +54 -0
  466. package/dist/src/transfer/store/search.d.ts.map +1 -0
  467. package/dist/src/transfer/store/search.js +64 -96
  468. package/dist/src/transfer/store/search.js.map +1 -1
  469. package/dist/src/transfer/store/tests/standalone-test.js +174 -231
  470. package/dist/src/transfer/store/tests/standalone-test.js.map +1 -1
  471. package/dist/src/transfer/test-seraphine.js +95 -130
  472. package/dist/src/transfer/test-seraphine.js.map +1 -1
  473. package/dist/src/transfer/tests/test-store.js +194 -239
  474. package/dist/src/transfer/tests/test-store.js.map +1 -1
  475. package/dist/src/transfer/types.d.ts +245 -0
  476. package/dist/src/transfer/types.d.ts.map +1 -0
  477. package/dist/src/types.d.ts +198 -0
  478. package/dist/src/types.d.ts.map +1 -0
  479. package/dist/src/types.js +26 -55
  480. package/dist/src/types.js.map +1 -1
  481. package/dist/src/update/checker.d.ts +34 -0
  482. package/dist/src/update/checker.d.ts.map +1 -0
  483. package/dist/src/update/checker.js +106 -183
  484. package/dist/src/update/checker.js.map +1 -1
  485. package/dist/src/update/executor.d.ts +32 -0
  486. package/dist/src/update/executor.d.ts.map +1 -0
  487. package/dist/src/update/executor.js +135 -198
  488. package/dist/src/update/executor.js.map +1 -1
  489. package/dist/src/update/index.d.ts +33 -0
  490. package/dist/src/update/index.d.ts.map +1 -0
  491. package/dist/src/update/index.js +38 -85
  492. package/dist/src/update/index.js.map +1 -1
  493. package/dist/src/update/rate-limiter.d.ts +20 -0
  494. package/dist/src/update/rate-limiter.d.ts.map +1 -0
  495. package/dist/src/update/rate-limiter.js +19 -31
  496. package/dist/src/update/rate-limiter.js.map +1 -1
  497. package/dist/src/update/validator.d.ts +17 -0
  498. package/dist/src/update/validator.d.ts.map +1 -0
  499. package/dist/src/update/validator.js +38 -64
  500. package/dist/src/update/validator.js.map +1 -1
  501. package/dist/tsconfig.tsbuildinfo +1 -1
  502. package/package.json +1 -1
@@ -10,48 +10,11 @@
10
10
  *
11
11
  * @module v3/cli/mcp-tools/agentdb-tools
12
12
  */
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
13
  // ===== Shared validation helpers =====
50
- var MAX_STRING_LENGTH = 100000; // 100KB max for any string input
51
- var MAX_BATCH_SIZE = 500; // Max entries per batch operation
52
- var MAX_TOP_K = 100; // Max results per query
53
- function validateString(value, name, maxLen) {
54
- if (maxLen === void 0) { maxLen = MAX_STRING_LENGTH; }
14
+ const MAX_STRING_LENGTH = 100_000; // 100KB max for any string input
15
+ const MAX_BATCH_SIZE = 500; // Max entries per batch operation
16
+ const MAX_TOP_K = 100; // Max results per query
17
+ function validateString(value, name, maxLen = MAX_STRING_LENGTH) {
55
18
  if (typeof value !== 'string' || value.length === 0)
56
19
  return null;
57
20
  if (value.length > maxLen)
@@ -61,7 +24,7 @@ function validateString(value, name, maxLen) {
61
24
  function validatePositiveInt(value, defaultVal, max) {
62
25
  if (typeof value !== 'number' || !Number.isFinite(value))
63
26
  return defaultVal;
64
- var n = Math.floor(value);
27
+ const n = Math.floor(value);
65
28
  return n > 0 ? Math.min(n, max) : defaultVal;
66
29
  }
67
30
  function validateScore(value, defaultVal) {
@@ -77,91 +40,62 @@ function sanitizeError(error) {
77
40
  return 'Internal error';
78
41
  }
79
42
  // Lazy-cached bridge module
80
- var bridgeModule = null;
81
- function getBridge() {
82
- return __awaiter(this, void 0, void 0, function () {
83
- return __generator(this, function (_a) {
84
- switch (_a.label) {
85
- case 0:
86
- if (!!bridgeModule) return [3 /*break*/, 2];
87
- return [4 /*yield*/, import('../memory/memory-bridge.js')];
88
- case 1:
89
- bridgeModule = _a.sent();
90
- _a.label = 2;
91
- case 2: return [2 /*return*/, bridgeModule];
92
- }
93
- });
94
- });
43
+ let bridgeModule = null;
44
+ async function getBridge() {
45
+ if (!bridgeModule) {
46
+ bridgeModule = await import('../memory/memory-bridge.js');
47
+ }
48
+ return bridgeModule;
95
49
  }
96
50
  // ===== agentdb_health — Controller health check =====
97
- export var agentdbHealth = {
51
+ export const agentdbHealth = {
98
52
  name: 'agentdb_health',
99
53
  description: 'Get AgentDB v3 controller health status including cache stats and attestation count',
100
54
  inputSchema: {
101
55
  type: 'object',
102
- properties: {}
56
+ properties: {},
57
+ },
58
+ handler: async () => {
59
+ try {
60
+ const bridge = await getBridge();
61
+ const health = await bridge.bridgeHealthCheck();
62
+ if (!health)
63
+ return { available: false, error: 'AgentDB bridge not available' };
64
+ return health;
65
+ }
66
+ catch (error) {
67
+ return { available: false, error: sanitizeError(error) };
68
+ }
103
69
  },
104
- handler: function () { return __awaiter(void 0, void 0, void 0, function () {
105
- var bridge, health, error_1;
106
- return __generator(this, function (_a) {
107
- switch (_a.label) {
108
- case 0:
109
- _a.trys.push([0, 3, , 4]);
110
- return [4 /*yield*/, getBridge()];
111
- case 1:
112
- bridge = _a.sent();
113
- return [4 /*yield*/, bridge.bridgeHealthCheck()];
114
- case 2:
115
- health = _a.sent();
116
- if (!health)
117
- return [2 /*return*/, { available: false, error: 'AgentDB bridge not available' }];
118
- return [2 /*return*/, health];
119
- case 3:
120
- error_1 = _a.sent();
121
- return [2 /*return*/, { available: false, error: sanitizeError(error_1) }];
122
- case 4: return [2 /*return*/];
123
- }
124
- });
125
- }); }
126
70
  };
127
71
  // ===== agentdb_controllers — List all controllers =====
128
- export var agentdbControllers = {
72
+ export const agentdbControllers = {
129
73
  name: 'agentdb_controllers',
130
74
  description: 'List all AgentDB v3 controllers and their initialization status',
131
75
  inputSchema: {
132
76
  type: 'object',
133
- properties: {}
77
+ properties: {},
78
+ },
79
+ handler: async () => {
80
+ try {
81
+ const bridge = await getBridge();
82
+ const controllers = await bridge.bridgeListControllers();
83
+ if (!controllers)
84
+ return { available: false, controllers: [], error: 'AgentDB bridge not available — @claude-flow/memory not installed or missing controller-registry. Use memory_store/memory_search tools instead.' };
85
+ return {
86
+ available: true,
87
+ controllers,
88
+ total: controllers.length,
89
+ active: controllers.filter((c) => c.enabled).length,
90
+ };
91
+ }
92
+ catch (error) {
93
+ return { available: false, error: sanitizeError(error) };
94
+ }
134
95
  },
135
- handler: function () { return __awaiter(void 0, void 0, void 0, function () {
136
- var bridge, controllers, error_2;
137
- return __generator(this, function (_a) {
138
- switch (_a.label) {
139
- case 0:
140
- _a.trys.push([0, 3, , 4]);
141
- return [4 /*yield*/, getBridge()];
142
- case 1:
143
- bridge = _a.sent();
144
- return [4 /*yield*/, bridge.bridgeListControllers()];
145
- case 2:
146
- controllers = _a.sent();
147
- if (!controllers)
148
- return [2 /*return*/, { available: false, controllers: [], error: 'AgentDB bridge not available — @claude-flow/memory not installed or missing controller-registry. Use memory_store/memory_search tools instead.' }];
149
- return [2 /*return*/, {
150
- available: true,
151
- controllers: controllers,
152
- total: controllers.length,
153
- active: controllers.filter(function (c) { return c.enabled; }).length
154
- }];
155
- case 3:
156
- error_2 = _a.sent();
157
- return [2 /*return*/, { available: false, error: sanitizeError(error_2) }];
158
- case 4: return [2 /*return*/];
159
- }
160
- });
161
- }); }
162
96
  };
163
97
  // ===== agentdb_pattern_store — Store via ReasoningBank =====
164
- export var agentdbPatternStore = {
98
+ export const agentdbPatternStore = {
165
99
  name: 'agentdb_pattern-store',
166
100
  description: 'Store a pattern directly via ReasoningBank controller',
167
101
  inputSchema: {
@@ -169,41 +103,30 @@ export var agentdbPatternStore = {
169
103
  properties: {
170
104
  pattern: { type: 'string', description: 'Pattern description' },
171
105
  type: { type: 'string', description: 'Pattern type (e.g., task-routing, error-recovery)' },
172
- confidence: { type: 'number', description: 'Confidence score (0-1)' }
106
+ confidence: { type: 'number', description: 'Confidence score (0-1)' },
173
107
  },
174
- required: ['pattern']
108
+ required: ['pattern'],
109
+ },
110
+ handler: async (params) => {
111
+ try {
112
+ const pattern = validateString(params.pattern, 'pattern');
113
+ if (!pattern)
114
+ return { success: false, error: 'pattern is required (non-empty string, max 100KB)' };
115
+ const bridge = await getBridge();
116
+ const result = await bridge.bridgeStorePattern({
117
+ pattern,
118
+ type: validateString(params.type, 'type', 200) ?? 'general',
119
+ confidence: validateScore(params.confidence, 0.8),
120
+ });
121
+ return result ?? { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' };
122
+ }
123
+ catch (error) {
124
+ return { success: false, error: sanitizeError(error) };
125
+ }
175
126
  },
176
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
177
- var pattern, bridge, result, error_3;
178
- var _a;
179
- return __generator(this, function (_b) {
180
- switch (_b.label) {
181
- case 0:
182
- _b.trys.push([0, 3, , 4]);
183
- pattern = validateString(params.pattern, 'pattern');
184
- if (!pattern)
185
- return [2 /*return*/, { success: false, error: 'pattern is required (non-empty string, max 100KB)' }];
186
- return [4 /*yield*/, getBridge()];
187
- case 1:
188
- bridge = _b.sent();
189
- return [4 /*yield*/, bridge.bridgeStorePattern({
190
- pattern: pattern,
191
- type: (_a = validateString(params.type, 'type', 200)) !== null && _a !== void 0 ? _a : 'general',
192
- confidence: validateScore(params.confidence, 0.8)
193
- })];
194
- case 2:
195
- result = _b.sent();
196
- return [2 /*return*/, result !== null && result !== void 0 ? result : { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' }];
197
- case 3:
198
- error_3 = _b.sent();
199
- return [2 /*return*/, { success: false, error: sanitizeError(error_3) }];
200
- case 4: return [2 /*return*/];
201
- }
202
- });
203
- }); }
204
127
  };
205
128
  // ===== agentdb_pattern_search — Search via ReasoningBank =====
206
- export var agentdbPatternSearch = {
129
+ export const agentdbPatternSearch = {
207
130
  name: 'agentdb_pattern-search',
208
131
  description: 'Search patterns via ReasoningBank controller with BM25+semantic hybrid',
209
132
  inputSchema: {
@@ -211,40 +134,30 @@ export var agentdbPatternSearch = {
211
134
  properties: {
212
135
  query: { type: 'string', description: 'Search query' },
213
136
  topK: { type: 'number', description: 'Number of results (default: 5)' },
214
- minConfidence: { type: 'number', description: 'Minimum score threshold (0-1)' }
137
+ minConfidence: { type: 'number', description: 'Minimum score threshold (0-1)' },
215
138
  },
216
- required: ['query']
139
+ required: ['query'],
140
+ },
141
+ handler: async (params) => {
142
+ try {
143
+ const query = validateString(params.query, 'query', 10_000);
144
+ if (!query)
145
+ return { results: [], error: 'query is required (non-empty string, max 10KB)' };
146
+ const bridge = await getBridge();
147
+ const result = await bridge.bridgeSearchPatterns({
148
+ query,
149
+ topK: validatePositiveInt(params.topK, 5, MAX_TOP_K),
150
+ minConfidence: validateScore(params.minConfidence, 0.3),
151
+ });
152
+ return result ?? { results: [], controller: 'unavailable' };
153
+ }
154
+ catch (error) {
155
+ return { results: [], error: sanitizeError(error) };
156
+ }
217
157
  },
218
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
219
- var query, bridge, result, error_4;
220
- return __generator(this, function (_a) {
221
- switch (_a.label) {
222
- case 0:
223
- _a.trys.push([0, 3, , 4]);
224
- query = validateString(params.query, 'query', 10000);
225
- if (!query)
226
- return [2 /*return*/, { results: [], error: 'query is required (non-empty string, max 10KB)' }];
227
- return [4 /*yield*/, getBridge()];
228
- case 1:
229
- bridge = _a.sent();
230
- return [4 /*yield*/, bridge.bridgeSearchPatterns({
231
- query: query,
232
- topK: validatePositiveInt(params.topK, 5, MAX_TOP_K),
233
- minConfidence: validateScore(params.minConfidence, 0.3)
234
- })];
235
- case 2:
236
- result = _a.sent();
237
- return [2 /*return*/, result !== null && result !== void 0 ? result : { results: [], controller: 'unavailable' }];
238
- case 3:
239
- error_4 = _a.sent();
240
- return [2 /*return*/, { results: [], error: sanitizeError(error_4) }];
241
- case 4: return [2 /*return*/];
242
- }
243
- });
244
- }); }
245
158
  };
246
159
  // ===== agentdb_feedback — Record task feedback =====
247
- export var agentdbFeedback = {
160
+ export const agentdbFeedback = {
248
161
  name: 'agentdb_feedback',
249
162
  description: 'Record task feedback for learning via LearningSystem + ReasoningBank controllers',
250
163
  inputSchema: {
@@ -253,42 +166,31 @@ export var agentdbFeedback = {
253
166
  taskId: { type: 'string', description: 'Task identifier' },
254
167
  success: { type: 'boolean', description: 'Whether task succeeded' },
255
168
  quality: { type: 'number', description: 'Quality score (0-1)' },
256
- agent: { type: 'string', description: 'Agent that performed the task' }
169
+ agent: { type: 'string', description: 'Agent that performed the task' },
257
170
  },
258
- required: ['taskId']
171
+ required: ['taskId'],
172
+ },
173
+ handler: async (params) => {
174
+ try {
175
+ const taskId = validateString(params.taskId, 'taskId', 500);
176
+ if (!taskId)
177
+ return { success: false, error: 'taskId is required (non-empty string, max 500 chars)' };
178
+ const bridge = await getBridge();
179
+ const result = await bridge.bridgeRecordFeedback({
180
+ taskId,
181
+ success: params.success === true,
182
+ quality: validateScore(params.quality, 0.85),
183
+ agent: validateString(params.agent, 'agent', 200) ?? undefined,
184
+ });
185
+ return result ?? { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' };
186
+ }
187
+ catch (error) {
188
+ return { success: false, error: sanitizeError(error) };
189
+ }
259
190
  },
260
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
261
- var taskId, bridge, result, error_5;
262
- var _a;
263
- return __generator(this, function (_b) {
264
- switch (_b.label) {
265
- case 0:
266
- _b.trys.push([0, 3, , 4]);
267
- taskId = validateString(params.taskId, 'taskId', 500);
268
- if (!taskId)
269
- return [2 /*return*/, { success: false, error: 'taskId is required (non-empty string, max 500 chars)' }];
270
- return [4 /*yield*/, getBridge()];
271
- case 1:
272
- bridge = _b.sent();
273
- return [4 /*yield*/, bridge.bridgeRecordFeedback({
274
- taskId: taskId,
275
- success: params.success === true,
276
- quality: validateScore(params.quality, 0.85),
277
- agent: (_a = validateString(params.agent, 'agent', 200)) !== null && _a !== void 0 ? _a : undefined
278
- })];
279
- case 2:
280
- result = _b.sent();
281
- return [2 /*return*/, result !== null && result !== void 0 ? result : { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' }];
282
- case 3:
283
- error_5 = _b.sent();
284
- return [2 /*return*/, { success: false, error: sanitizeError(error_5) }];
285
- case 4: return [2 /*return*/];
286
- }
287
- });
288
- }); }
289
191
  };
290
192
  // ===== agentdb_causal_edge — Record causal relationships =====
291
- export var agentdbCausalEdge = {
193
+ export const agentdbCausalEdge = {
292
194
  name: 'agentdb_causal-edge',
293
195
  description: 'Record a causal edge between two memory entries via CausalMemoryGraph',
294
196
  inputSchema: {
@@ -297,127 +199,95 @@ export var agentdbCausalEdge = {
297
199
  sourceId: { type: 'string', description: 'Source entry ID' },
298
200
  targetId: { type: 'string', description: 'Target entry ID' },
299
201
  relation: { type: 'string', description: 'Relationship type (e.g., caused, preceded, succeeded)' },
300
- weight: { type: 'number', description: 'Edge weight (0-1)' }
202
+ weight: { type: 'number', description: 'Edge weight (0-1)' },
301
203
  },
302
- required: ['sourceId', 'targetId', 'relation']
204
+ required: ['sourceId', 'targetId', 'relation'],
205
+ },
206
+ handler: async (params) => {
207
+ try {
208
+ const sourceId = validateString(params.sourceId, 'sourceId', 500);
209
+ const targetId = validateString(params.targetId, 'targetId', 500);
210
+ const relation = validateString(params.relation, 'relation', 200);
211
+ if (!sourceId)
212
+ return { success: false, error: 'sourceId is required (non-empty string)' };
213
+ if (!targetId)
214
+ return { success: false, error: 'targetId is required (non-empty string)' };
215
+ if (!relation)
216
+ return { success: false, error: 'relation is required (non-empty string)' };
217
+ const bridge = await getBridge();
218
+ const result = await bridge.bridgeRecordCausalEdge({
219
+ sourceId,
220
+ targetId,
221
+ relation,
222
+ weight: typeof params.weight === 'number' ? validateScore(params.weight, 0.5) : undefined,
223
+ });
224
+ return result ?? { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' };
225
+ }
226
+ catch (error) {
227
+ return { success: false, error: sanitizeError(error) };
228
+ }
303
229
  },
304
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
305
- var sourceId, targetId, relation, bridge, result, error_6;
306
- return __generator(this, function (_a) {
307
- switch (_a.label) {
308
- case 0:
309
- _a.trys.push([0, 3, , 4]);
310
- sourceId = validateString(params.sourceId, 'sourceId', 500);
311
- targetId = validateString(params.targetId, 'targetId', 500);
312
- relation = validateString(params.relation, 'relation', 200);
313
- if (!sourceId)
314
- return [2 /*return*/, { success: false, error: 'sourceId is required (non-empty string)' }];
315
- if (!targetId)
316
- return [2 /*return*/, { success: false, error: 'targetId is required (non-empty string)' }];
317
- if (!relation)
318
- return [2 /*return*/, { success: false, error: 'relation is required (non-empty string)' }];
319
- return [4 /*yield*/, getBridge()];
320
- case 1:
321
- bridge = _a.sent();
322
- return [4 /*yield*/, bridge.bridgeRecordCausalEdge({
323
- sourceId: sourceId,
324
- targetId: targetId,
325
- relation: relation,
326
- weight: typeof params.weight === 'number' ? validateScore(params.weight, 0.5) : undefined
327
- })];
328
- case 2:
329
- result = _a.sent();
330
- return [2 /*return*/, result !== null && result !== void 0 ? result : { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' }];
331
- case 3:
332
- error_6 = _a.sent();
333
- return [2 /*return*/, { success: false, error: sanitizeError(error_6) }];
334
- case 4: return [2 /*return*/];
335
- }
336
- });
337
- }); }
338
230
  };
339
231
  // ===== agentdb_route — Route via SemanticRouter =====
340
- export var agentdbRoute = {
232
+ export const agentdbRoute = {
341
233
  name: 'agentdb_route',
342
234
  description: 'Route a task via AgentDB SemanticRouter or LearningSystem recommendAlgorithm',
343
235
  inputSchema: {
344
236
  type: 'object',
345
237
  properties: {
346
238
  task: { type: 'string', description: 'Task description to route' },
347
- context: { type: 'string', description: 'Additional context' }
239
+ context: { type: 'string', description: 'Additional context' },
348
240
  },
349
- required: ['task']
241
+ required: ['task'],
242
+ },
243
+ handler: async (params) => {
244
+ try {
245
+ const task = validateString(params.task, 'task', 10_000);
246
+ if (!task)
247
+ return { route: 'general', confidence: 0.5, agents: ['coder'], controller: 'error', error: 'task is required (non-empty string)' };
248
+ const bridge = await getBridge();
249
+ const result = await bridge.bridgeRouteTask({
250
+ task,
251
+ context: validateString(params.context, 'context', 10_000) ?? undefined,
252
+ });
253
+ return result ?? { route: 'general', confidence: 0.5, agents: ['coder'], controller: 'fallback' };
254
+ }
255
+ catch (error) {
256
+ return { route: 'general', confidence: 0.5, agents: ['coder'], controller: 'error', error: sanitizeError(error) };
257
+ }
350
258
  },
351
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
352
- var task, bridge, result, error_7;
353
- var _a;
354
- return __generator(this, function (_b) {
355
- switch (_b.label) {
356
- case 0:
357
- _b.trys.push([0, 3, , 4]);
358
- task = validateString(params.task, 'task', 10000);
359
- if (!task)
360
- return [2 /*return*/, { route: 'general', confidence: 0.5, agents: ['coder'], controller: 'error', error: 'task is required (non-empty string)' }];
361
- return [4 /*yield*/, getBridge()];
362
- case 1:
363
- bridge = _b.sent();
364
- return [4 /*yield*/, bridge.bridgeRouteTask({
365
- task: task,
366
- context: (_a = validateString(params.context, 'context', 10000)) !== null && _a !== void 0 ? _a : undefined
367
- })];
368
- case 2:
369
- result = _b.sent();
370
- return [2 /*return*/, result !== null && result !== void 0 ? result : { route: 'general', confidence: 0.5, agents: ['coder'], controller: 'fallback' }];
371
- case 3:
372
- error_7 = _b.sent();
373
- return [2 /*return*/, { route: 'general', confidence: 0.5, agents: ['coder'], controller: 'error', error: sanitizeError(error_7) }];
374
- case 4: return [2 /*return*/];
375
- }
376
- });
377
- }); }
378
259
  };
379
260
  // ===== agentdb_session_start — Session with ReflexionMemory =====
380
- export var agentdbSessionStart = {
261
+ export const agentdbSessionStart = {
381
262
  name: 'agentdb_session-start',
382
263
  description: 'Start a session with ReflexionMemory episodic replay',
383
264
  inputSchema: {
384
265
  type: 'object',
385
266
  properties: {
386
267
  sessionId: { type: 'string', description: 'Session identifier' },
387
- context: { type: 'string', description: 'Session context for pattern retrieval' }
268
+ context: { type: 'string', description: 'Session context for pattern retrieval' },
388
269
  },
389
- required: ['sessionId']
270
+ required: ['sessionId'],
271
+ },
272
+ handler: async (params) => {
273
+ try {
274
+ const sessionId = validateString(params.sessionId, 'sessionId', 500);
275
+ if (!sessionId)
276
+ return { success: false, error: 'sessionId is required (non-empty string)' };
277
+ const bridge = await getBridge();
278
+ const result = await bridge.bridgeSessionStart({
279
+ sessionId,
280
+ context: validateString(params.context, 'context', 10_000) ?? undefined,
281
+ });
282
+ return result ?? { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' };
283
+ }
284
+ catch (error) {
285
+ return { success: false, error: sanitizeError(error) };
286
+ }
390
287
  },
391
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
392
- var sessionId, bridge, result, error_8;
393
- var _a;
394
- return __generator(this, function (_b) {
395
- switch (_b.label) {
396
- case 0:
397
- _b.trys.push([0, 3, , 4]);
398
- sessionId = validateString(params.sessionId, 'sessionId', 500);
399
- if (!sessionId)
400
- return [2 /*return*/, { success: false, error: 'sessionId is required (non-empty string)' }];
401
- return [4 /*yield*/, getBridge()];
402
- case 1:
403
- bridge = _b.sent();
404
- return [4 /*yield*/, bridge.bridgeSessionStart({
405
- sessionId: sessionId,
406
- context: (_a = validateString(params.context, 'context', 10000)) !== null && _a !== void 0 ? _a : undefined
407
- })];
408
- case 2:
409
- result = _b.sent();
410
- return [2 /*return*/, result !== null && result !== void 0 ? result : { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' }];
411
- case 3:
412
- error_8 = _b.sent();
413
- return [2 /*return*/, { success: false, error: sanitizeError(error_8) }];
414
- case 4: return [2 /*return*/];
415
- }
416
- });
417
- }); }
418
288
  };
419
289
  // ===== agentdb_session_end — End session + NightlyLearner =====
420
- export var agentdbSessionEnd = {
290
+ export const agentdbSessionEnd = {
421
291
  name: 'agentdb_session-end',
422
292
  description: 'End session, persist to ReflexionMemory, trigger NightlyLearner consolidation',
423
293
  inputSchema: {
@@ -425,41 +295,30 @@ export var agentdbSessionEnd = {
425
295
  properties: {
426
296
  sessionId: { type: 'string', description: 'Session identifier' },
427
297
  summary: { type: 'string', description: 'Session summary' },
428
- tasksCompleted: { type: 'number', description: 'Number of tasks completed' }
298
+ tasksCompleted: { type: 'number', description: 'Number of tasks completed' },
429
299
  },
430
- required: ['sessionId']
300
+ required: ['sessionId'],
301
+ },
302
+ handler: async (params) => {
303
+ try {
304
+ const sessionId = validateString(params.sessionId, 'sessionId', 500);
305
+ if (!sessionId)
306
+ return { success: false, error: 'sessionId is required (non-empty string)' };
307
+ const bridge = await getBridge();
308
+ const result = await bridge.bridgeSessionEnd({
309
+ sessionId,
310
+ summary: validateString(params.summary, 'summary', 50_000) ?? undefined,
311
+ tasksCompleted: validatePositiveInt(params.tasksCompleted, 0, 10_000),
312
+ });
313
+ return result ?? { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' };
314
+ }
315
+ catch (error) {
316
+ return { success: false, error: sanitizeError(error) };
317
+ }
431
318
  },
432
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
433
- var sessionId, bridge, result, error_9;
434
- var _a;
435
- return __generator(this, function (_b) {
436
- switch (_b.label) {
437
- case 0:
438
- _b.trys.push([0, 3, , 4]);
439
- sessionId = validateString(params.sessionId, 'sessionId', 500);
440
- if (!sessionId)
441
- return [2 /*return*/, { success: false, error: 'sessionId is required (non-empty string)' }];
442
- return [4 /*yield*/, getBridge()];
443
- case 1:
444
- bridge = _b.sent();
445
- return [4 /*yield*/, bridge.bridgeSessionEnd({
446
- sessionId: sessionId,
447
- summary: (_a = validateString(params.summary, 'summary', 50000)) !== null && _a !== void 0 ? _a : undefined,
448
- tasksCompleted: validatePositiveInt(params.tasksCompleted, 0, 10000)
449
- })];
450
- case 2:
451
- result = _b.sent();
452
- return [2 /*return*/, result !== null && result !== void 0 ? result : { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' }];
453
- case 3:
454
- error_9 = _b.sent();
455
- return [2 /*return*/, { success: false, error: sanitizeError(error_9) }];
456
- case 4: return [2 /*return*/];
457
- }
458
- });
459
- }); }
460
319
  };
461
320
  // ===== agentdb_hierarchical_store — Store to hierarchical memory =====
462
- export var agentdbHierarchicalStore = {
321
+ export const agentdbHierarchicalStore = {
463
322
  name: 'agentdb_hierarchical-store',
464
323
  description: 'Store to hierarchical memory with tier (working, episodic, semantic)',
465
324
  inputSchema: {
@@ -470,46 +329,35 @@ export var agentdbHierarchicalStore = {
470
329
  tier: {
471
330
  type: 'string',
472
331
  description: 'Memory tier (working, episodic, semantic)',
473
- "enum": ['working', 'episodic', 'semantic'],
474
- "default": 'working'
475
- }
332
+ enum: ['working', 'episodic', 'semantic'],
333
+ default: 'working',
334
+ },
476
335
  },
477
- required: ['key', 'value']
336
+ required: ['key', 'value'],
478
337
  },
479
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
480
- var key, value, tier, bridge, result, error_10;
481
- var _a;
482
- return __generator(this, function (_b) {
483
- switch (_b.label) {
484
- case 0:
485
- _b.trys.push([0, 3, , 4]);
486
- key = validateString(params.key, 'key', 1000);
487
- value = validateString(params.value, 'value');
488
- if (!key)
489
- return [2 /*return*/, { success: false, error: 'key is required (non-empty string, max 1KB)' }];
490
- if (!value)
491
- return [2 /*return*/, { success: false, error: 'value is required (non-empty string, max 100KB)' }];
492
- tier = (_a = validateString(params.tier, 'tier', 20)) !== null && _a !== void 0 ? _a : 'working';
493
- if (!['working', 'episodic', 'semantic'].includes(tier)) {
494
- return [2 /*return*/, { success: false, error: "Invalid tier: " + tier + ". Must be working, episodic, or semantic" }];
495
- }
496
- return [4 /*yield*/, getBridge()];
497
- case 1:
498
- bridge = _b.sent();
499
- return [4 /*yield*/, bridge.bridgeHierarchicalStore({ key: key, value: value, tier: tier })];
500
- case 2:
501
- result = _b.sent();
502
- return [2 /*return*/, result !== null && result !== void 0 ? result : { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' }];
503
- case 3:
504
- error_10 = _b.sent();
505
- return [2 /*return*/, { success: false, error: sanitizeError(error_10) }];
506
- case 4: return [2 /*return*/];
338
+ handler: async (params) => {
339
+ try {
340
+ const key = validateString(params.key, 'key', 1000);
341
+ const value = validateString(params.value, 'value');
342
+ if (!key)
343
+ return { success: false, error: 'key is required (non-empty string, max 1KB)' };
344
+ if (!value)
345
+ return { success: false, error: 'value is required (non-empty string, max 100KB)' };
346
+ const tier = validateString(params.tier, 'tier', 20) ?? 'working';
347
+ if (!['working', 'episodic', 'semantic'].includes(tier)) {
348
+ return { success: false, error: `Invalid tier: ${tier}. Must be working, episodic, or semantic` };
507
349
  }
508
- });
509
- }); }
350
+ const bridge = await getBridge();
351
+ const result = await bridge.bridgeHierarchicalStore({ key, value, tier });
352
+ return result ?? { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' };
353
+ }
354
+ catch (error) {
355
+ return { success: false, error: sanitizeError(error) };
356
+ }
357
+ },
510
358
  };
511
359
  // ===== agentdb_hierarchical_recall — Recall from hierarchical memory =====
512
- export var agentdbHierarchicalRecall = {
360
+ export const agentdbHierarchicalRecall = {
513
361
  name: 'agentdb_hierarchical-recall',
514
362
  description: 'Recall from hierarchical memory with optional tier filter',
515
363
  inputSchema: {
@@ -517,79 +365,59 @@ export var agentdbHierarchicalRecall = {
517
365
  properties: {
518
366
  query: { type: 'string', description: 'Recall query' },
519
367
  tier: { type: 'string', description: 'Filter by tier (working, episodic, semantic)' },
520
- topK: { type: 'number', description: 'Number of results (default: 5)' }
368
+ topK: { type: 'number', description: 'Number of results (default: 5)' },
521
369
  },
522
- required: ['query']
370
+ required: ['query'],
523
371
  },
524
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
525
- var query, tier, bridge, result, error_11;
526
- return __generator(this, function (_a) {
527
- switch (_a.label) {
528
- case 0:
529
- _a.trys.push([0, 3, , 4]);
530
- query = validateString(params.query, 'query', 10000);
531
- if (!query)
532
- return [2 /*return*/, { results: [], error: 'query is required (non-empty string, max 10KB)' }];
533
- tier = validateString(params.tier, 'tier', 20);
534
- if (tier && !['working', 'episodic', 'semantic'].includes(tier)) {
535
- return [2 /*return*/, { results: [], error: "Invalid tier: " + tier + ". Must be working, episodic, or semantic" }];
536
- }
537
- return [4 /*yield*/, getBridge()];
538
- case 1:
539
- bridge = _a.sent();
540
- return [4 /*yield*/, bridge.bridgeHierarchicalRecall({
541
- query: query,
542
- tier: tier !== null && tier !== void 0 ? tier : undefined,
543
- topK: validatePositiveInt(params.topK, 5, MAX_TOP_K)
544
- })];
545
- case 2:
546
- result = _a.sent();
547
- return [2 /*return*/, result !== null && result !== void 0 ? result : { results: [], error: 'AgentDB bridge not available. Use memory_search instead.' }];
548
- case 3:
549
- error_11 = _a.sent();
550
- return [2 /*return*/, { results: [], error: sanitizeError(error_11) }];
551
- case 4: return [2 /*return*/];
372
+ handler: async (params) => {
373
+ try {
374
+ const query = validateString(params.query, 'query', 10_000);
375
+ if (!query)
376
+ return { results: [], error: 'query is required (non-empty string, max 10KB)' };
377
+ const tier = validateString(params.tier, 'tier', 20);
378
+ if (tier && !['working', 'episodic', 'semantic'].includes(tier)) {
379
+ return { results: [], error: `Invalid tier: ${tier}. Must be working, episodic, or semantic` };
552
380
  }
553
- });
554
- }); }
381
+ const bridge = await getBridge();
382
+ const result = await bridge.bridgeHierarchicalRecall({
383
+ query,
384
+ tier: tier ?? undefined,
385
+ topK: validatePositiveInt(params.topK, 5, MAX_TOP_K),
386
+ });
387
+ return result ?? { results: [], error: 'AgentDB bridge not available. Use memory_search instead.' };
388
+ }
389
+ catch (error) {
390
+ return { results: [], error: sanitizeError(error) };
391
+ }
392
+ },
555
393
  };
556
394
  // ===== agentdb_consolidate — Run memory consolidation =====
557
- export var agentdbConsolidate = {
395
+ export const agentdbConsolidate = {
558
396
  name: 'agentdb_consolidate',
559
397
  description: 'Run memory consolidation to promote entries across tiers and compress old data',
560
398
  inputSchema: {
561
399
  type: 'object',
562
400
  properties: {
563
401
  minAge: { type: 'number', description: 'Minimum age in hours since store (optional)' },
564
- maxEntries: { type: 'number', description: 'Maximum entries to consolidate (optional)' }
402
+ maxEntries: { type: 'number', description: 'Maximum entries to consolidate (optional)' },
403
+ },
404
+ },
405
+ handler: async (params) => {
406
+ try {
407
+ const bridge = await getBridge();
408
+ const result = await bridge.bridgeConsolidate({
409
+ minAge: typeof params.minAge === 'number' ? Math.max(0, params.minAge) : undefined,
410
+ maxEntries: validatePositiveInt(params.maxEntries, 1000, 10_000),
411
+ });
412
+ return result ?? { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' };
413
+ }
414
+ catch (error) {
415
+ return { success: false, error: sanitizeError(error) };
565
416
  }
566
417
  },
567
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
568
- var bridge, result, error_12;
569
- return __generator(this, function (_a) {
570
- switch (_a.label) {
571
- case 0:
572
- _a.trys.push([0, 3, , 4]);
573
- return [4 /*yield*/, getBridge()];
574
- case 1:
575
- bridge = _a.sent();
576
- return [4 /*yield*/, bridge.bridgeConsolidate({
577
- minAge: typeof params.minAge === 'number' ? Math.max(0, params.minAge) : undefined,
578
- maxEntries: validatePositiveInt(params.maxEntries, 1000, 10000)
579
- })];
580
- case 2:
581
- result = _a.sent();
582
- return [2 /*return*/, result !== null && result !== void 0 ? result : { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' }];
583
- case 3:
584
- error_12 = _a.sent();
585
- return [2 /*return*/, { success: false, error: sanitizeError(error_12) }];
586
- case 4: return [2 /*return*/];
587
- }
588
- });
589
- }); }
590
418
  };
591
419
  // ===== agentdb_batch — Batch operations (insert, update, delete) =====
592
- export var agentdbBatch = {
420
+ export const agentdbBatch = {
593
421
  name: 'agentdb_batch',
594
422
  description: 'Batch operations on memory entries (insert, update, delete)',
595
423
  inputSchema: {
@@ -598,7 +426,7 @@ export var agentdbBatch = {
598
426
  operation: {
599
427
  type: 'string',
600
428
  description: 'Batch operation type',
601
- "enum": ['insert', 'update', 'delete']
429
+ enum: ['insert', 'update', 'delete'],
602
430
  },
603
431
  entries: {
604
432
  type: 'array',
@@ -607,138 +435,109 @@ export var agentdbBatch = {
607
435
  type: 'object',
608
436
  properties: {
609
437
  key: { type: 'string' },
610
- value: { type: 'string' }
438
+ value: { type: 'string' },
611
439
  },
612
- required: ['key']
613
- }
614
- }
440
+ required: ['key'],
441
+ },
442
+ },
615
443
  },
616
- required: ['operation', 'entries']
444
+ required: ['operation', 'entries'],
617
445
  },
618
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
619
- var operation, validatedEntries, i, entry, key, value, bridge, result, error_13;
620
- return __generator(this, function (_a) {
621
- switch (_a.label) {
622
- case 0:
623
- _a.trys.push([0, 3, , 4]);
624
- operation = validateString(params.operation, 'operation', 20);
625
- if (!operation)
626
- return [2 /*return*/, { success: false, error: 'operation is required (string)' }];
627
- if (!['insert', 'update', 'delete'].includes(operation)) {
628
- return [2 /*return*/, { success: false, error: "Invalid operation: " + operation + ". Must be insert, update, or delete" }];
629
- }
630
- if (!Array.isArray(params.entries) || params.entries.length === 0) {
631
- return [2 /*return*/, { success: false, error: 'entries is required (non-empty array)' }];
632
- }
633
- if (params.entries.length > MAX_BATCH_SIZE) {
634
- return [2 /*return*/, { success: false, error: "Too many entries: " + params.entries.length + ". Max is " + MAX_BATCH_SIZE }];
635
- }
636
- validatedEntries = [];
637
- for (i = 0; i < params.entries.length; i++) {
638
- entry = params.entries[i];
639
- if (!entry || typeof entry !== 'object') {
640
- return [2 /*return*/, { success: false, error: "entries[" + i + "] must be an object" }];
641
- }
642
- key = validateString(entry.key, "entries[" + i + "].key", 1000);
643
- if (!key)
644
- return [2 /*return*/, { success: false, error: "entries[" + i + "].key is required (non-empty string)" }];
645
- value = validateString(entry.value, "entries[" + i + "].value");
646
- validatedEntries.push({ key: key, value: value !== null && value !== void 0 ? value : undefined });
647
- }
648
- return [4 /*yield*/, getBridge()];
649
- case 1:
650
- bridge = _a.sent();
651
- return [4 /*yield*/, bridge.bridgeBatchOperation({
652
- operation: operation,
653
- entries: validatedEntries
654
- })];
655
- case 2:
656
- result = _a.sent();
657
- return [2 /*return*/, result !== null && result !== void 0 ? result : { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' }];
658
- case 3:
659
- error_13 = _a.sent();
660
- return [2 /*return*/, { success: false, error: sanitizeError(error_13) }];
661
- case 4: return [2 /*return*/];
446
+ handler: async (params) => {
447
+ try {
448
+ const operation = validateString(params.operation, 'operation', 20);
449
+ if (!operation)
450
+ return { success: false, error: 'operation is required (string)' };
451
+ if (!['insert', 'update', 'delete'].includes(operation)) {
452
+ return { success: false, error: `Invalid operation: ${operation}. Must be insert, update, or delete` };
453
+ }
454
+ if (!Array.isArray(params.entries) || params.entries.length === 0) {
455
+ return { success: false, error: 'entries is required (non-empty array)' };
456
+ }
457
+ if (params.entries.length > MAX_BATCH_SIZE) {
458
+ return { success: false, error: `Too many entries: ${params.entries.length}. Max is ${MAX_BATCH_SIZE}` };
662
459
  }
663
- });
664
- }); }
460
+ // Validate each entry
461
+ const validatedEntries = [];
462
+ for (let i = 0; i < params.entries.length; i++) {
463
+ const entry = params.entries[i];
464
+ if (!entry || typeof entry !== 'object') {
465
+ return { success: false, error: `entries[${i}] must be an object` };
466
+ }
467
+ const key = validateString(entry.key, `entries[${i}].key`, 1000);
468
+ if (!key)
469
+ return { success: false, error: `entries[${i}].key is required (non-empty string)` };
470
+ const value = validateString(entry.value, `entries[${i}].value`);
471
+ validatedEntries.push({ key, value: value ?? undefined });
472
+ }
473
+ const bridge = await getBridge();
474
+ const result = await bridge.bridgeBatchOperation({
475
+ operation,
476
+ entries: validatedEntries,
477
+ });
478
+ return result ?? { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' };
479
+ }
480
+ catch (error) {
481
+ return { success: false, error: sanitizeError(error) };
482
+ }
483
+ },
665
484
  };
666
485
  // ===== agentdb_context_synthesize — Synthesize context from memories =====
667
- export var agentdbContextSynthesize = {
486
+ export const agentdbContextSynthesize = {
668
487
  name: 'agentdb_context-synthesize',
669
488
  description: 'Synthesize context from stored memories for a given query',
670
489
  inputSchema: {
671
490
  type: 'object',
672
491
  properties: {
673
492
  query: { type: 'string', description: 'Query to synthesize context for' },
674
- maxEntries: { type: 'number', description: 'Maximum entries to include (default: 10)' }
493
+ maxEntries: { type: 'number', description: 'Maximum entries to include (default: 10)' },
675
494
  },
676
- required: ['query']
495
+ required: ['query'],
496
+ },
497
+ handler: async (params) => {
498
+ try {
499
+ const query = validateString(params.query, 'query', 10_000);
500
+ if (!query)
501
+ return { success: false, error: 'query is required (non-empty string, max 10KB)' };
502
+ const bridge = await getBridge();
503
+ const result = await bridge.bridgeContextSynthesize({
504
+ query,
505
+ maxEntries: validatePositiveInt(params.maxEntries, 10, MAX_TOP_K),
506
+ });
507
+ return result ?? { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' };
508
+ }
509
+ catch (error) {
510
+ return { success: false, error: sanitizeError(error) };
511
+ }
677
512
  },
678
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
679
- var query, bridge, result, error_14;
680
- return __generator(this, function (_a) {
681
- switch (_a.label) {
682
- case 0:
683
- _a.trys.push([0, 3, , 4]);
684
- query = validateString(params.query, 'query', 10000);
685
- if (!query)
686
- return [2 /*return*/, { success: false, error: 'query is required (non-empty string, max 10KB)' }];
687
- return [4 /*yield*/, getBridge()];
688
- case 1:
689
- bridge = _a.sent();
690
- return [4 /*yield*/, bridge.bridgeContextSynthesize({
691
- query: query,
692
- maxEntries: validatePositiveInt(params.maxEntries, 10, MAX_TOP_K)
693
- })];
694
- case 2:
695
- result = _a.sent();
696
- return [2 /*return*/, result !== null && result !== void 0 ? result : { success: false, error: 'AgentDB bridge not available. Use memory_store/memory_search instead.' }];
697
- case 3:
698
- error_14 = _a.sent();
699
- return [2 /*return*/, { success: false, error: sanitizeError(error_14) }];
700
- case 4: return [2 /*return*/];
701
- }
702
- });
703
- }); }
704
513
  };
705
514
  // ===== agentdb_semantic_route — Route via SemanticRouter =====
706
- export var agentdbSemanticRoute = {
515
+ export const agentdbSemanticRoute = {
707
516
  name: 'agentdb_semantic-route',
708
517
  description: 'Route an input via AgentDB SemanticRouter for intent classification',
709
518
  inputSchema: {
710
519
  type: 'object',
711
520
  properties: {
712
- input: { type: 'string', description: 'Input text to route' }
521
+ input: { type: 'string', description: 'Input text to route' },
713
522
  },
714
- required: ['input']
523
+ required: ['input'],
524
+ },
525
+ handler: async (params) => {
526
+ try {
527
+ const input = validateString(params.input, 'input', 10_000);
528
+ if (!input)
529
+ return { route: null, error: 'input is required (non-empty string, max 10KB)' };
530
+ const bridge = await getBridge();
531
+ const result = await bridge.bridgeSemanticRoute({ input });
532
+ return result ?? { route: null, error: 'AgentDB bridge not available. Use hooks route instead.' };
533
+ }
534
+ catch (error) {
535
+ return { route: null, error: sanitizeError(error) };
536
+ }
715
537
  },
716
- handler: function (params) { return __awaiter(void 0, void 0, void 0, function () {
717
- var input, bridge, result, error_15;
718
- return __generator(this, function (_a) {
719
- switch (_a.label) {
720
- case 0:
721
- _a.trys.push([0, 3, , 4]);
722
- input = validateString(params.input, 'input', 10000);
723
- if (!input)
724
- return [2 /*return*/, { route: null, error: 'input is required (non-empty string, max 10KB)' }];
725
- return [4 /*yield*/, getBridge()];
726
- case 1:
727
- bridge = _a.sent();
728
- return [4 /*yield*/, bridge.bridgeSemanticRoute({ input: input })];
729
- case 2:
730
- result = _a.sent();
731
- return [2 /*return*/, result !== null && result !== void 0 ? result : { route: null, error: 'AgentDB bridge not available. Use hooks route instead.' }];
732
- case 3:
733
- error_15 = _a.sent();
734
- return [2 /*return*/, { route: null, error: sanitizeError(error_15) }];
735
- case 4: return [2 /*return*/];
736
- }
737
- });
738
- }); }
739
538
  };
740
539
  // ===== Export all tools =====
741
- export var agentdbTools = [
540
+ export const agentdbTools = [
742
541
  agentdbHealth,
743
542
  agentdbControllers,
744
543
  agentdbPatternStore,