@ai.ntellect/core 0.8.3 → 1.1.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 (460) hide show
  1. package/.mocharc.json +2 -1
  2. package/AGENTS.md +50 -0
  3. package/ARCHITECTURE.md +58 -0
  4. package/BENCHMARK.md +38 -0
  5. package/CHANGELOG.md +224 -0
  6. package/README.md +413 -199
  7. package/agent/agent-workflow.ts +569 -0
  8. package/agent/agent.ts +183 -0
  9. package/{modules/agent → agent}/base/executor.ts +11 -8
  10. package/{modules/agent → agent}/base/index.ts +2 -14
  11. package/agent/entity-resolver/confidence.ts +54 -0
  12. package/agent/entity-resolver/entity-index.ts +241 -0
  13. package/agent/entity-resolver/explore-strategy.ts +82 -0
  14. package/agent/entity-resolver/index.ts +22 -0
  15. package/agent/entity-resolver/resolver.ts +193 -0
  16. package/agent/entity-resolver/scorer.ts +211 -0
  17. package/agent/entity-resolver/types.ts +98 -0
  18. package/agent/generic-executor.ts +713 -0
  19. package/agent/handlers/cognitive-handler.ts +197 -0
  20. package/agent/handlers/index.ts +1 -0
  21. package/agent/handoff.ts +58 -0
  22. package/agent/llm-factory.ts +343 -0
  23. package/agent/orchestrator.ts +45 -0
  24. package/{modules/agent → agent}/prompt-builder.ts +1 -1
  25. package/agent/registry.ts +64 -0
  26. package/agent/tools/file-system.ts +471 -0
  27. package/agent/tools/index.ts +23 -0
  28. package/agent/tools/logger.ts +105 -0
  29. package/agent/tools/tool-resolver.ts +104 -0
  30. package/benchmark/cortexflow-workflow.ts +182 -0
  31. package/benchmark/langgraph-workflow.ts +201 -0
  32. package/benchmark/llm-client.ts +76 -0
  33. package/benchmark/run-benchmark.ts +222 -0
  34. package/cli-dev.ts +419 -0
  35. package/dist/agent/agent-workflow.d.ts +41 -0
  36. package/dist/agent/agent-workflow.d.ts.map +1 -0
  37. package/dist/agent/agent-workflow.js +560 -0
  38. package/dist/agent/agent-workflow.js.map +1 -0
  39. package/dist/agent/agent.d.ts +38 -0
  40. package/dist/agent/agent.d.ts.map +1 -0
  41. package/dist/agent/agent.js +149 -0
  42. package/dist/agent/agent.js.map +1 -0
  43. package/dist/{modules/agent → agent}/base/executor.d.ts +3 -3
  44. package/dist/agent/base/executor.d.ts.map +1 -0
  45. package/dist/{modules/agent → agent}/base/executor.js +8 -5
  46. package/dist/agent/base/executor.js.map +1 -0
  47. package/dist/{modules/agent → agent}/base/index.d.ts +1 -1
  48. package/dist/agent/base/index.d.ts.map +1 -0
  49. package/dist/{modules/agent → agent}/base/index.js +0 -12
  50. package/dist/agent/base/index.js.map +1 -0
  51. package/dist/agent/entity-resolver/confidence.d.ts +4 -0
  52. package/dist/agent/entity-resolver/confidence.d.ts.map +1 -0
  53. package/dist/agent/entity-resolver/confidence.js +47 -0
  54. package/dist/agent/entity-resolver/confidence.js.map +1 -0
  55. package/dist/agent/entity-resolver/entity-index.d.ts +40 -0
  56. package/dist/agent/entity-resolver/entity-index.d.ts.map +1 -0
  57. package/dist/agent/entity-resolver/entity-index.js +244 -0
  58. package/dist/agent/entity-resolver/entity-index.js.map +1 -0
  59. package/dist/agent/entity-resolver/explore-strategy.d.ts +13 -0
  60. package/dist/agent/entity-resolver/explore-strategy.d.ts.map +1 -0
  61. package/dist/agent/entity-resolver/explore-strategy.js +109 -0
  62. package/dist/agent/entity-resolver/explore-strategy.js.map +1 -0
  63. package/dist/agent/entity-resolver/index.d.ts +8 -0
  64. package/dist/agent/entity-resolver/index.d.ts.map +1 -0
  65. package/dist/agent/entity-resolver/index.js +16 -0
  66. package/dist/agent/entity-resolver/index.js.map +1 -0
  67. package/dist/agent/entity-resolver/resolver.d.ts +18 -0
  68. package/dist/agent/entity-resolver/resolver.d.ts.map +1 -0
  69. package/dist/agent/entity-resolver/resolver.js +158 -0
  70. package/dist/agent/entity-resolver/resolver.js.map +1 -0
  71. package/dist/agent/entity-resolver/scorer.d.ts +3 -0
  72. package/dist/agent/entity-resolver/scorer.d.ts.map +1 -0
  73. package/dist/agent/entity-resolver/scorer.js +182 -0
  74. package/dist/agent/entity-resolver/scorer.js.map +1 -0
  75. package/dist/agent/entity-resolver/types.d.ts +89 -0
  76. package/dist/agent/entity-resolver/types.d.ts.map +1 -0
  77. package/dist/agent/entity-resolver/types.js +3 -0
  78. package/dist/agent/entity-resolver/types.js.map +1 -0
  79. package/dist/{modules/agent → agent}/generic-executor.d.ts +37 -27
  80. package/dist/agent/generic-executor.d.ts.map +1 -0
  81. package/dist/agent/generic-executor.js +620 -0
  82. package/dist/agent/generic-executor.js.map +1 -0
  83. package/dist/agent/handlers/cognitive-handler.d.ts +44 -0
  84. package/dist/agent/handlers/cognitive-handler.d.ts.map +1 -0
  85. package/dist/agent/handlers/cognitive-handler.js +172 -0
  86. package/dist/agent/handlers/cognitive-handler.js.map +1 -0
  87. package/dist/agent/handlers/index.d.ts +2 -0
  88. package/dist/agent/handlers/index.d.ts.map +1 -0
  89. package/dist/agent/handlers/index.js +7 -0
  90. package/dist/agent/handlers/index.js.map +1 -0
  91. package/dist/agent/handoff.d.ts +12 -0
  92. package/dist/agent/handoff.d.ts.map +1 -0
  93. package/dist/agent/handoff.js +62 -0
  94. package/dist/agent/handoff.js.map +1 -0
  95. package/dist/agent/llm-factory.d.ts.map +1 -0
  96. package/dist/agent/llm-factory.js +297 -0
  97. package/dist/agent/llm-factory.js.map +1 -0
  98. package/dist/agent/orchestrator.d.ts +18 -0
  99. package/dist/agent/orchestrator.d.ts.map +1 -0
  100. package/dist/agent/orchestrator.js +44 -0
  101. package/dist/agent/orchestrator.js.map +1 -0
  102. package/dist/{modules/agent → agent}/prompt-builder.d.ts +1 -1
  103. package/dist/agent/prompt-builder.d.ts.map +1 -0
  104. package/dist/agent/prompt-builder.js.map +1 -0
  105. package/dist/agent/registry.d.ts +19 -0
  106. package/dist/agent/registry.d.ts.map +1 -0
  107. package/dist/agent/registry.js +48 -0
  108. package/dist/agent/registry.js.map +1 -0
  109. package/dist/agent/tools/file-system.d.ts +11 -0
  110. package/dist/agent/tools/file-system.d.ts.map +1 -0
  111. package/dist/agent/tools/file-system.js +528 -0
  112. package/dist/agent/tools/file-system.js.map +1 -0
  113. package/dist/agent/tools/index.d.ts +4 -0
  114. package/dist/agent/tools/index.d.ts.map +1 -0
  115. package/dist/agent/tools/index.js +20 -0
  116. package/dist/agent/tools/index.js.map +1 -0
  117. package/dist/agent/tools/logger.d.ts +33 -0
  118. package/dist/agent/tools/logger.d.ts.map +1 -0
  119. package/dist/agent/tools/logger.js +86 -0
  120. package/dist/agent/tools/logger.js.map +1 -0
  121. package/dist/agent/tools/tool-resolver.d.ts +7 -0
  122. package/dist/agent/tools/tool-resolver.d.ts.map +1 -0
  123. package/dist/agent/tools/tool-resolver.js +122 -0
  124. package/dist/agent/tools/tool-resolver.js.map +1 -0
  125. package/dist/execution/adapters/in-memory-checkpoint.d.ts +11 -0
  126. package/dist/execution/adapters/in-memory-checkpoint.d.ts.map +1 -0
  127. package/dist/execution/adapters/in-memory-checkpoint.js +54 -0
  128. package/dist/execution/adapters/in-memory-checkpoint.js.map +1 -0
  129. package/dist/execution/compiler.d.ts +8 -0
  130. package/dist/execution/compiler.d.ts.map +1 -0
  131. package/dist/execution/compiler.js +50 -0
  132. package/dist/execution/compiler.js.map +1 -0
  133. package/dist/execution/controller.d.ts.map +1 -0
  134. package/dist/execution/controller.js.map +1 -0
  135. package/dist/execution/event-manager.d.ts +29 -0
  136. package/dist/execution/event-manager.d.ts.map +1 -0
  137. package/dist/{graph → execution}/event-manager.js +4 -114
  138. package/dist/execution/event-manager.js.map +1 -0
  139. package/dist/{graph → execution}/index.d.ts +50 -2
  140. package/dist/execution/index.d.ts.map +1 -0
  141. package/dist/execution/index.js +638 -0
  142. package/dist/execution/index.js.map +1 -0
  143. package/dist/execution/logger.d.ts.map +1 -0
  144. package/dist/execution/logger.js.map +1 -0
  145. package/dist/{graph → execution}/node.d.ts +6 -1
  146. package/dist/execution/node.d.ts.map +1 -0
  147. package/dist/{graph → execution}/node.js +83 -10
  148. package/dist/execution/node.js.map +1 -0
  149. package/dist/execution/observer.d.ts.map +1 -0
  150. package/dist/execution/observer.js.map +1 -0
  151. package/dist/execution/planner.d.ts +14 -0
  152. package/dist/execution/planner.d.ts.map +1 -0
  153. package/dist/execution/planner.js +43 -0
  154. package/dist/execution/planner.js.map +1 -0
  155. package/dist/execution/reducer.d.ts +19 -0
  156. package/dist/execution/reducer.d.ts.map +1 -0
  157. package/dist/execution/reducer.js +61 -0
  158. package/dist/execution/reducer.js.map +1 -0
  159. package/dist/execution/registry.d.ts +38 -0
  160. package/dist/execution/registry.d.ts.map +1 -0
  161. package/dist/execution/registry.js +63 -0
  162. package/dist/execution/registry.js.map +1 -0
  163. package/dist/execution/send-api.d.ts +24 -0
  164. package/dist/execution/send-api.d.ts.map +1 -0
  165. package/dist/execution/send-api.js +52 -0
  166. package/dist/execution/send-api.js.map +1 -0
  167. package/dist/execution/types.parallel.d.ts +61 -0
  168. package/dist/execution/types.parallel.d.ts.map +1 -0
  169. package/dist/execution/types.parallel.js +3 -0
  170. package/dist/execution/types.parallel.js.map +1 -0
  171. package/dist/execution/visualizer.d.ts.map +1 -0
  172. package/dist/execution/visualizer.js.map +1 -0
  173. package/dist/index.d.ts +27 -8
  174. package/dist/index.d.ts.map +1 -1
  175. package/dist/index.js +42 -8
  176. package/dist/index.js.map +1 -1
  177. package/dist/interfaces/index.d.ts +32 -1
  178. package/dist/interfaces/index.d.ts.map +1 -1
  179. package/dist/interfaces/index.js.map +1 -1
  180. package/dist/modules/cli/index.d.ts +13 -0
  181. package/dist/modules/cli/index.d.ts.map +1 -0
  182. package/dist/modules/cli/index.js +672 -0
  183. package/dist/modules/cli/index.js.map +1 -0
  184. package/dist/modules/nlp/engine.d.ts.map +1 -1
  185. package/dist/modules/nlp/engine.js +0 -1
  186. package/dist/modules/nlp/engine.js.map +1 -1
  187. package/dist/persistence/index.d.ts +12 -0
  188. package/dist/persistence/index.d.ts.map +1 -0
  189. package/dist/persistence/index.js +24 -0
  190. package/dist/persistence/index.js.map +1 -0
  191. package/dist/persistence/neo4j/driver.d.ts +26 -0
  192. package/dist/persistence/neo4j/driver.d.ts.map +1 -0
  193. package/dist/persistence/neo4j/driver.js +64 -0
  194. package/dist/persistence/neo4j/driver.js.map +1 -0
  195. package/dist/persistence/neo4j/entity-store.d.ts +15 -0
  196. package/dist/persistence/neo4j/entity-store.d.ts.map +1 -0
  197. package/dist/persistence/neo4j/entity-store.js +136 -0
  198. package/dist/persistence/neo4j/entity-store.js.map +1 -0
  199. package/dist/persistence/neo4j/execution-tracer.d.ts +19 -0
  200. package/dist/persistence/neo4j/execution-tracer.d.ts.map +1 -0
  201. package/dist/persistence/neo4j/execution-tracer.js +166 -0
  202. package/dist/persistence/neo4j/execution-tracer.js.map +1 -0
  203. package/dist/persistence/neo4j/memory-adapter.d.ts +35 -0
  204. package/dist/persistence/neo4j/memory-adapter.d.ts.map +1 -0
  205. package/dist/persistence/neo4j/memory-adapter.js +252 -0
  206. package/dist/persistence/neo4j/memory-adapter.js.map +1 -0
  207. package/dist/persistence/neo4j/petri-checkpoint-adapter.d.ts +22 -0
  208. package/dist/persistence/neo4j/petri-checkpoint-adapter.d.ts.map +1 -0
  209. package/dist/persistence/neo4j/petri-checkpoint-adapter.js +141 -0
  210. package/dist/persistence/neo4j/petri-checkpoint-adapter.js.map +1 -0
  211. package/dist/pipeline/agent-pipeline.d.ts +99 -0
  212. package/dist/pipeline/agent-pipeline.d.ts.map +1 -0
  213. package/dist/pipeline/agent-pipeline.js +356 -0
  214. package/dist/pipeline/agent-pipeline.js.map +1 -0
  215. package/dist/routing/checkpoint-adapter.d.ts +30 -0
  216. package/dist/routing/checkpoint-adapter.d.ts.map +1 -0
  217. package/dist/routing/checkpoint-adapter.js +83 -0
  218. package/dist/routing/checkpoint-adapter.js.map +1 -0
  219. package/dist/routing/documentation-generator.d.ts +47 -0
  220. package/dist/routing/documentation-generator.d.ts.map +1 -0
  221. package/dist/routing/documentation-generator.js +320 -0
  222. package/dist/routing/documentation-generator.js.map +1 -0
  223. package/dist/routing/index.d.ts +38 -0
  224. package/dist/routing/index.d.ts.map +1 -0
  225. package/dist/routing/index.js +375 -0
  226. package/dist/routing/index.js.map +1 -0
  227. package/dist/routing/intent-classifier.d.ts +206 -0
  228. package/dist/routing/intent-classifier.d.ts.map +1 -0
  229. package/dist/routing/intent-classifier.js +267 -0
  230. package/dist/routing/intent-classifier.js.map +1 -0
  231. package/dist/routing/matrix.d.ts +6 -0
  232. package/dist/routing/matrix.d.ts.map +1 -0
  233. package/dist/routing/matrix.js +131 -0
  234. package/dist/routing/matrix.js.map +1 -0
  235. package/dist/routing/orchestrator.d.ts +87 -0
  236. package/dist/routing/orchestrator.d.ts.map +1 -0
  237. package/dist/routing/orchestrator.js +425 -0
  238. package/dist/routing/orchestrator.js.map +1 -0
  239. package/dist/routing/postgres-checkpoint-adapter.d.ts +32 -0
  240. package/dist/routing/postgres-checkpoint-adapter.d.ts.map +1 -0
  241. package/dist/routing/postgres-checkpoint-adapter.js +167 -0
  242. package/dist/routing/postgres-checkpoint-adapter.js.map +1 -0
  243. package/dist/routing/redis-checkpoint-adapter.d.ts +34 -0
  244. package/dist/routing/redis-checkpoint-adapter.d.ts.map +1 -0
  245. package/dist/routing/redis-checkpoint-adapter.js +170 -0
  246. package/dist/routing/redis-checkpoint-adapter.js.map +1 -0
  247. package/dist/routing/types.d.ts +49 -0
  248. package/dist/routing/types.d.ts.map +1 -0
  249. package/dist/routing/types.js +3 -0
  250. package/dist/routing/types.js.map +1 -0
  251. package/dist/types/agent.d.ts +144 -88
  252. package/dist/types/agent.d.ts.map +1 -1
  253. package/dist/types/agent.js +49 -0
  254. package/dist/types/agent.js.map +1 -1
  255. package/dist/types/index.d.ts +46 -4
  256. package/dist/types/index.d.ts.map +1 -1
  257. package/dist/utils/generate-action-schema.d.ts +2 -3
  258. package/dist/utils/generate-action-schema.d.ts.map +1 -1
  259. package/dist/utils/generate-action-schema.js +3 -1
  260. package/dist/utils/generate-action-schema.js.map +1 -1
  261. package/dist/utils/logger.d.ts +27 -0
  262. package/dist/utils/logger.d.ts.map +1 -0
  263. package/dist/utils/logger.js +45 -0
  264. package/dist/utils/logger.js.map +1 -0
  265. package/docs/.gitbook/assets/image (1).png +0 -0
  266. package/docs/.gitbook/assets/image (2).png +0 -0
  267. package/docs/.gitbook/assets/image (3).png +0 -0
  268. package/docs/.gitbook/assets/image (4).png +0 -0
  269. package/docs/.gitbook/assets/image (5).png +0 -0
  270. package/docs/.gitbook/assets/image (6).png +0 -0
  271. package/docs/.gitbook/assets/image.png +0 -0
  272. package/docs/README.md +57 -0
  273. package/docs/SUMMARY.md +34 -0
  274. package/docs/cas-dusages.md +69 -0
  275. package/docs/cli/README.md +65 -0
  276. package/docs/concepts-cles.md +50 -0
  277. package/docs/core/architecture.md +87 -0
  278. package/docs/core/benchmark.md +59 -0
  279. package/docs/core/checkpoint.md +72 -0
  280. package/docs/core/documentation.md +55 -0
  281. package/docs/core/graphcontroller.md +63 -0
  282. package/docs/core/graphflow.md +137 -0
  283. package/docs/core/introduction.md +41 -0
  284. package/docs/core/les-evenements.md +95 -0
  285. package/docs/modules/agenda/README.md +63 -0
  286. package/docs/modules/agenda/interface-iagenda.md +170 -0
  287. package/docs/modules/agenda/les-adaptateurs/README.md +237 -0
  288. package/docs/modules/agenda/les-adaptateurs/nodecronadapter.md +91 -0
  289. package/docs/modules/introduction.md +55 -0
  290. package/docs/modules/les-adaptateurs.md +52 -0
  291. package/docs/modules/memoire/README.md +68 -0
  292. package/docs/modules/memoire/interface-imemory.md +183 -0
  293. package/docs/modules/memoire/les-adaptateurs/README.md +209 -0
  294. package/docs/modules/memoire/les-adaptateurs/inmemoryadapter.md +110 -0
  295. package/docs/modules/memoire/les-adaptateurs/meilisearchadapter.md +147 -0
  296. package/docs/modules/memoire/les-adaptateurs/redisadapter.md +212 -0
  297. package/docs/modules/nlp/README.md +44 -0
  298. package/docs/philosophie.md +51 -0
  299. package/docs/tutoriels/ajouter-des-conditions.md +150 -0
  300. package/docs/tutoriels/branching.md +194 -0
  301. package/docs/tutoriels/checkpoint-usage.md +99 -0
  302. package/docs/tutoriels/creer-agent-onchain.md +1041 -0
  303. package/docs/tutoriels/creer-un-agent.md +108 -0
  304. package/docs/tutoriels/creer-un-graphe-simple.md +92 -0
  305. package/docs/tutoriels/gerer-les-erreurs.md +124 -0
  306. package/docs/tutoriels/pour-commencer.md +73 -0
  307. package/docs/tutoriels/retry.md +166 -0
  308. package/execution/adapters/in-memory-checkpoint.ts +35 -0
  309. package/execution/compiler.ts +47 -0
  310. package/{graph → execution}/event-manager.ts +4 -117
  311. package/{graph → execution}/index.ts +376 -8
  312. package/{graph → execution}/node.ts +116 -12
  313. package/execution/planner.ts +40 -0
  314. package/execution/reducer.ts +73 -0
  315. package/execution/registry.ts +86 -0
  316. package/execution/send-api.ts +58 -0
  317. package/execution/types.parallel.ts +81 -0
  318. package/index.ts +35 -8
  319. package/interfaces/index.ts +37 -0
  320. package/modules/cli/index.ts +580 -0
  321. package/modules/nlp/engine.ts +0 -1
  322. package/package.json +50 -16
  323. package/persistence/index.ts +27 -0
  324. package/persistence/neo4j/driver.ts +34 -0
  325. package/persistence/neo4j/entity-store.ts +141 -0
  326. package/persistence/neo4j/execution-tracer.ts +194 -0
  327. package/persistence/neo4j/memory-adapter.ts +281 -0
  328. package/persistence/neo4j/petri-checkpoint-adapter.ts +153 -0
  329. package/pipeline/agent-pipeline.ts +426 -0
  330. package/routing/checkpoint-adapter.ts +79 -0
  331. package/routing/documentation-generator.ts +358 -0
  332. package/routing/index.ts +459 -0
  333. package/routing/intent-classifier.ts +360 -0
  334. package/routing/matrix.ts +138 -0
  335. package/routing/orchestrator.ts +498 -0
  336. package/routing/patterns/data-extraction.json +79 -0
  337. package/routing/patterns/human-approval.json +64 -0
  338. package/routing/patterns/rag-search.json +68 -0
  339. package/routing/postgres-checkpoint-adapter.ts +172 -0
  340. package/routing/redis-checkpoint-adapter.ts +187 -0
  341. package/routing/types.ts +59 -0
  342. package/routing/web-server.ts +260 -0
  343. package/scripts/generate-petri-docs.ts +70 -0
  344. package/scripts/get-gmail-token.js +65 -0
  345. package/scripts/get-gmail-token.ts +65 -0
  346. package/test/agent/agent.test.ts +92 -0
  347. package/test/agent/clone.test.ts +143 -0
  348. package/test/agent/cognitive-handler.test.ts +78 -0
  349. package/test/agent/entity-store.test.ts +80 -0
  350. package/test/agent/generic-executor.test.ts +230 -0
  351. package/test/agent/handoff.test.ts +163 -0
  352. package/test/agent/llm-factory.test.ts +40 -0
  353. package/test/agent/orchestrator.test.ts +156 -0
  354. package/test/agent/registry.test.ts +97 -0
  355. package/test/agent/tools.test.ts +267 -0
  356. package/test/execution/checkpoint.test.ts +811 -0
  357. package/test/{graph → execution}/controller.test.ts +2 -2
  358. package/test/{graph → execution}/event-manager.test.ts +1 -1
  359. package/test/{graph → execution}/index.test.ts +24 -15
  360. package/test/{graph → execution}/node.test.ts +3 -3
  361. package/test/{graph → execution}/observer.test.ts +2 -2
  362. package/test/execution/parallel.test.ts +135 -0
  363. package/test/execution/plan-llm-integration.test.ts +290 -0
  364. package/test/execution/plan-real-onchain.test.ts +226 -0
  365. package/test/execution/send-api.test.ts +121 -0
  366. package/test/modules/cli/index.test.ts +125 -0
  367. package/test/persistence/neo4j-execution-tracer.test.ts +96 -0
  368. package/test/persistence/neo4j-memory-adapter.test.ts +107 -0
  369. package/test/persistence/neo4j-petri-checkpoint.test.ts +89 -0
  370. package/test/pipeline/agent-pipeline.test.ts +118 -0
  371. package/test/routing/checkpoint-persistence.test.ts +58 -0
  372. package/test/routing/documentation-generator.test.ts +76 -0
  373. package/test/routing/integration.test.ts +261 -0
  374. package/test/routing/intent-classifier.test.ts +102 -0
  375. package/test/routing/petri.test.ts +156 -0
  376. package/test/routing/real-llm.test.ts +260 -0
  377. package/test-petri-features.ts +218 -0
  378. package/test-pipeline-api.ts +163 -0
  379. package/tsconfig.json +5 -2
  380. package/types/agent.ts +126 -4
  381. package/types/index.ts +66 -5
  382. package/utils/generate-action-schema.ts +5 -4
  383. package/utils/logger.ts +40 -0
  384. package/dist/graph/controller.d.ts.map +0 -1
  385. package/dist/graph/controller.js.map +0 -1
  386. package/dist/graph/event-manager.d.ts +0 -101
  387. package/dist/graph/event-manager.d.ts.map +0 -1
  388. package/dist/graph/event-manager.js.map +0 -1
  389. package/dist/graph/index.d.ts.map +0 -1
  390. package/dist/graph/index.js +0 -340
  391. package/dist/graph/index.js.map +0 -1
  392. package/dist/graph/logger.d.ts.map +0 -1
  393. package/dist/graph/logger.js.map +0 -1
  394. package/dist/graph/node.d.ts.map +0 -1
  395. package/dist/graph/node.js.map +0 -1
  396. package/dist/graph/observer.d.ts.map +0 -1
  397. package/dist/graph/observer.js.map +0 -1
  398. package/dist/graph/visualizer.d.ts.map +0 -1
  399. package/dist/graph/visualizer.js.map +0 -1
  400. package/dist/modules/agent/agent.d.ts +0 -35
  401. package/dist/modules/agent/agent.d.ts.map +0 -1
  402. package/dist/modules/agent/agent.js +0 -103
  403. package/dist/modules/agent/agent.js.map +0 -1
  404. package/dist/modules/agent/base/executor.d.ts.map +0 -1
  405. package/dist/modules/agent/base/executor.js.map +0 -1
  406. package/dist/modules/agent/base/index.d.ts.map +0 -1
  407. package/dist/modules/agent/base/index.js.map +0 -1
  408. package/dist/modules/agent/generic-assistant.d.ts +0 -20
  409. package/dist/modules/agent/generic-assistant.d.ts.map +0 -1
  410. package/dist/modules/agent/generic-assistant.js +0 -89
  411. package/dist/modules/agent/generic-assistant.js.map +0 -1
  412. package/dist/modules/agent/generic-executor.d.ts.map +0 -1
  413. package/dist/modules/agent/generic-executor.js +0 -189
  414. package/dist/modules/agent/generic-executor.js.map +0 -1
  415. package/dist/modules/agent/llm-factory.d.ts.map +0 -1
  416. package/dist/modules/agent/llm-factory.js +0 -56
  417. package/dist/modules/agent/llm-factory.js.map +0 -1
  418. package/dist/modules/agent/prompt-builder.d.ts.map +0 -1
  419. package/dist/modules/agent/prompt-builder.js.map +0 -1
  420. package/dist/modules/memory/adapters/in-memory/index.d.ts +0 -120
  421. package/dist/modules/memory/adapters/in-memory/index.d.ts.map +0 -1
  422. package/dist/modules/memory/adapters/in-memory/index.js +0 -212
  423. package/dist/modules/memory/adapters/in-memory/index.js.map +0 -1
  424. package/dist/modules/memory/adapters/meilisearch/index.d.ts +0 -110
  425. package/dist/modules/memory/adapters/meilisearch/index.d.ts.map +0 -1
  426. package/dist/modules/memory/adapters/meilisearch/index.js +0 -324
  427. package/dist/modules/memory/adapters/meilisearch/index.js.map +0 -1
  428. package/dist/modules/memory/adapters/redis/index.d.ts +0 -82
  429. package/dist/modules/memory/adapters/redis/index.d.ts.map +0 -1
  430. package/dist/modules/memory/adapters/redis/index.js +0 -160
  431. package/dist/modules/memory/adapters/redis/index.js.map +0 -1
  432. package/dist/modules/memory/index.d.ts +0 -67
  433. package/dist/modules/memory/index.d.ts.map +0 -1
  434. package/dist/modules/memory/index.js +0 -104
  435. package/dist/modules/memory/index.js.map +0 -1
  436. package/modules/agent/agent.ts +0 -107
  437. package/modules/agent/generic-assistant.ts +0 -92
  438. package/modules/agent/generic-executor.ts +0 -252
  439. package/modules/agent/llm-factory.ts +0 -47
  440. package/modules/memory/adapters/in-memory/index.ts +0 -208
  441. package/modules/memory/adapters/meilisearch/index.ts +0 -364
  442. package/modules/memory/adapters/redis/index.ts +0 -165
  443. package/modules/memory/index.ts +0 -93
  444. package/test/modules/memory/adapters/in-memory.test.ts +0 -153
  445. package/test/modules/memory/adapters/meilisearch.test.ts +0 -287
  446. package/test/modules/memory/base.test.ts +0 -230
  447. /package/dist/{modules/agent → agent}/llm-factory.d.ts +0 -0
  448. /package/dist/{modules/agent → agent}/prompt-builder.js +0 -0
  449. /package/dist/{graph → execution}/controller.d.ts +0 -0
  450. /package/dist/{graph → execution}/controller.js +0 -0
  451. /package/dist/{graph → execution}/logger.d.ts +0 -0
  452. /package/dist/{graph → execution}/logger.js +0 -0
  453. /package/dist/{graph → execution}/observer.d.ts +0 -0
  454. /package/dist/{graph → execution}/observer.js +0 -0
  455. /package/dist/{graph → execution}/visualizer.d.ts +0 -0
  456. /package/dist/{graph → execution}/visualizer.js +0 -0
  457. /package/{graph → execution}/controller.ts +0 -0
  458. /package/{graph → execution}/logger.ts +0 -0
  459. /package/{graph → execution}/observer.ts +0 -0
  460. /package/{graph → execution}/visualizer.ts +0 -0
@@ -7,6 +7,7 @@ exports.AgentContextSchema = zod_1.z.object({
7
7
  raw: zod_1.z.string(),
8
8
  embedding: zod_1.z.array(zod_1.z.number()).optional(),
9
9
  }),
10
+ cwd: zod_1.z.string().optional(),
10
11
  actions: zod_1.z.array(zod_1.z.object({
11
12
  name: zod_1.z.string(),
12
13
  parameters: zod_1.z.array(zod_1.z.object({
@@ -25,5 +26,53 @@ exports.AgentContextSchema = zod_1.z.object({
25
26
  timestamp: zod_1.z.string(),
26
27
  }))
27
28
  .optional(),
29
+ iteration: zod_1.z.number().optional(),
30
+ progressed: zod_1.z.boolean().optional(),
31
+ messages: zod_1.z
32
+ .array(zod_1.z.object({
33
+ role: zod_1.z.enum(["user", "assistant"]),
34
+ content: zod_1.z.string(),
35
+ }))
36
+ .optional(),
37
+ toolResults: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
38
+ scratchpad: zod_1.z.array(zod_1.z.object({
39
+ turn: zod_1.z.number(),
40
+ thought: zod_1.z.string(),
41
+ action: zod_1.z.string(),
42
+ observation: zod_1.z.string(),
43
+ timestamp: zod_1.z.string(),
44
+ })).optional().default([]),
45
+ memories: zod_1.z.array(zod_1.z.any()).optional().default([]),
46
+ entityState: zod_1.z.object({
47
+ currentTarget: zod_1.z.string().optional(),
48
+ lastEntityType: zod_1.z.string().nullable().optional(),
49
+ pendingResolutions: zod_1.z.array(zod_1.z.any()).optional(),
50
+ resolutionTrace: zod_1.z.array(zod_1.z.any()).optional(),
51
+ explored: zod_1.z.boolean().optional(),
52
+ handles: zod_1.z.record(zod_1.z.string(), zod_1.z.object({ id: zod_1.z.string(), label: zod_1.z.string(), path: zod_1.z.string(), category: zod_1.z.string() })).optional(),
53
+ }).optional(),
54
+ conversationState: zod_1.z.object({
55
+ currentGoal: zod_1.z.string(),
56
+ currentTarget: zod_1.z.string().nullable(),
57
+ lastResolvedEntity: zod_1.z.string().nullable(),
58
+ lastResolvedType: zod_1.z.string().nullable(),
59
+ pendingTask: zod_1.z.string().nullable(),
60
+ turnCount: zod_1.z.number(),
61
+ pendingIntent: zod_1.z.object({
62
+ action: zod_1.z.string().nullable(),
63
+ unresolvedEntity: zod_1.z.string().nullable(),
64
+ originalInput: zod_1.z.string(),
65
+ turn: zod_1.z.number(),
66
+ failed: zod_1.z.boolean(),
67
+ }).nullable(),
68
+ }).optional(),
69
+ explorationBudget: zod_1.z.object({
70
+ maxSteps: zod_1.z.number(),
71
+ maxExplorations: zod_1.z.number(),
72
+ maxToolCalls: zod_1.z.number(),
73
+ stepsUsed: zod_1.z.number(),
74
+ explorationsUsed: zod_1.z.number(),
75
+ toolCallsUsed: zod_1.z.number(),
76
+ }).optional(),
28
77
  });
29
78
  //# sourceMappingURL=agent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../types/agent.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAyCX,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC;QACd,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;QACf,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;KAC1C,CAAC;IACF,OAAO,EAAE,OAAC,CAAC,KAAK,CACd,OAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,UAAU,EAAE,OAAC,CAAC,KAAK,CACjB,OAAC,CAAC,MAAM,CAAC;YACP,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE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AE;QAClC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;QACrB,aAAa,EAAE,OAAC,CAAC,MAAM,CAAC;YACtB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC7B,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACvC,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;YACzB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;YAChB,MAAM,EAAE,OAAC,CAAC,OAAO,EAAE;SACpB,CAAC,CAAC,QAAQ,EAAE;KACd,CAAC,CAAC,QAAQ,EAAE;IACb,iBAAiB,EAAE,OAAC,CAAC,MAAM,CAAC;QAC1B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;QACpB,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE;QAC3B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;QACxB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;QACrB,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE;QAC5B,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;KAC1B,CAAC,CAAC,QAAQ,EAAE;CACd,CAAC,CAAC"}
@@ -4,9 +4,11 @@ import { IEventEmitter } from "../interfaces";
4
4
  /**
5
5
  * Represents the input structure for creating a memory entry.
6
6
  * @typedef {Object} CreateMemoryInput
7
- * @property {string} query - The query associated with the memory.
8
- * @property {any} data - The data to be stored.
7
+ * @property {string} content - The text content to store.
9
8
  * @property {string} roomId - The room identifier.
9
+ * @property {string} [id] - Optional stable id.
10
+ * @property {Record<string, any>} [metadata] - Optional metadata.
11
+ * @property {number[]} [embedding] - Optional vector embedding.
10
12
  * @property {number} [ttl] - Time-to-live in seconds (optional).
11
13
  */
12
14
  export interface CreateMemoryInput {
@@ -22,8 +24,7 @@ export interface CreateMemoryInput {
22
24
  * Represents a stored memory entry.
23
25
  * @typedef {Object} BaseMemoryType
24
26
  * @property {string} id - Unique identifier of the memory entry.
25
- * @property {string} data - Stored data as a string.
26
- * @property {string} query - The associated query.
27
+ * @property {string} content - Stored text content.
27
28
  * @property {number[] | null} embedding - Vector representation of the data.
28
29
  * @property {string} roomId - The associated room ID.
29
30
  * @property {Date} createdAt - Creation date.
@@ -298,4 +299,45 @@ export type ObserverOptions = {
298
299
  }) => void;
299
300
  onStreamComplete?: () => void;
300
301
  };
302
+ /**
303
+ * Checkpoint metadata for tracking execution state
304
+ */
305
+ export type CheckpointMetadata = {
306
+ createdAt: number;
307
+ interrupted?: boolean;
308
+ awaitingApproval?: boolean;
309
+ rejected?: boolean;
310
+ error?: string;
311
+ };
312
+ /**
313
+ * Configuration for checkpoint behavior during execution
314
+ */
315
+ export type CheckpointConfig = {
316
+ saveEveryNode?: boolean;
317
+ saveOnComplete?: boolean;
318
+ checkpointId?: string;
319
+ breakpoints?: string[];
320
+ runId?: string;
321
+ initialContext?: Record<string, any>;
322
+ };
323
+ /**
324
+ * Result of a human-in-the-loop approval
325
+ */
326
+ export type ApprovalResult = {
327
+ action: "approved" | "rejected";
328
+ contextModifications?: Record<string, any>;
329
+ };
330
+ /**
331
+ * Represents a saved execution state of a graph
332
+ */
333
+ export type Checkpoint<T extends ZodSchema = any> = {
334
+ id: string;
335
+ graphName: string;
336
+ runId?: string;
337
+ nodeName: string;
338
+ nextNodes: string[];
339
+ context: Record<string, any>;
340
+ metadata: CheckpointMetadata;
341
+ };
342
+ export type { ParallelConfig, Send, SendFunction, Command, ReducerFunction, StateReducer, WorkerConfig, ParallelNodeConfig, } from "../execution/types.parallel";
301
343
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;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EG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,SAAS,GAAG,GAAG,IAAI;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,QAAQ,EAAE,kBAAkB,CAAC;CAC9B,CAAC;AAIF,YAAY,EACV,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,kBAAkB,GACnB,MAAM,6BAA6B,CAAC"}
@@ -1,5 +1,4 @@
1
- import { z } from "zod";
2
- import { GraphFlow } from "../graph/index";
1
+ import { GraphFlow } from "../execution/index";
3
2
  export declare const generateActionSchema: (graphs: GraphFlow<any>[]) => string;
4
- export declare const getSchemaString: (schema: z.ZodType) => string;
3
+ export declare const getSchemaString: (schema: any) => string;
5
4
  //# sourceMappingURL=generate-action-schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate-action-schema.d.ts","sourceRoot":"","sources":["../../utils/generate-action-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,eAAO,MAAM,oBAAoB,GAAI,QAAQ,SAAS,CAAC,GAAG,CAAC,EAAE,WAU5D,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,MA8BnD,CAAC"}
1
+ {"version":3,"file":"generate-action-schema.d.ts","sourceRoot":"","sources":["../../utils/generate-action-schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,eAAO,MAAM,oBAAoB,WAAY,SAAS,CAAC,GAAG,CAAC,EAAE,WAU5D,CAAC;AAGF,eAAO,MAAM,eAAe,WAAY,GAAG,KAAG,MA8B7C,CAAC"}
@@ -14,11 +14,13 @@ const generateActionSchema = (graphs) => {
14
14
  .join("\n\n");
15
15
  };
16
16
  exports.generateActionSchema = generateActionSchema;
17
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
18
  const getSchemaString = (schema) => {
18
19
  if (schema instanceof zod_1.z.ZodObject) {
19
20
  const entries = Object.entries(schema.shape);
20
21
  const fields = entries.map(([key, value]) => {
21
- const description = value._def.description;
22
+ var _a;
23
+ const description = (_a = value._def) === null || _a === void 0 ? void 0 : _a.description;
22
24
  const schemaStr = (0, exports.getSchemaString)(value);
23
25
  return description
24
26
  ? `${key}: ${schemaStr} // ${description}`
@@ -1 +1 @@
1
- {"version":3,"file":"generate-action-schema.js","sourceRoot":"","sources":["../../utils/generate-action-schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAGjB,MAAM,oBAAoB,GAAG,CAAC,MAAwB,EAAE,EAAE;IAC/D,OAAO,MAAM;SACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACb,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM;YAC/B,CAAC,CAAC,IAAA,uBAAe,EAAC,QAAQ,CAAC,MAAM,CAAC;YAClC,CAAC,CAAC,eAAe,CAAC;QACpB,OAAO,aAAa,KAAK,CAAC,IAAI,iBAAiB,SAAS,EAAE,CAAC;IAC7D,CAAC,CAAC;SACD,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC,CAAC;AAVW,QAAA,oBAAoB,wBAU/B;AAEK,MAAM,eAAe,GAAG,CAAC,MAAiB,EAAU,EAAE;IAC3D,IAAI,MAAM,YAAY,OAAC,CAAC,SAAS,EAAE,CAA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AAY,OAAC,CAAC,SAAS,EAAE,CAAC;QAClC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,MAAM,YAAY,OAAC,CAAC,SAAS,EAAE,CAAC;QAClC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,MAAM,YAAY,OAAC,CAAC,UAAU,EAAE,CAAC;QACnC,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AA9BW,QAAA,eAAe,mBA8B1B"}
@@ -0,0 +1,27 @@
1
+ import pino from 'pino';
2
+ /**
3
+ * Shared Pino logger for the CortexFlow runtime.
4
+ *
5
+ * Pretty-prints in development with `HH:MM:ss Z` timestamps.
6
+ * Use `logger.child({ sessionId, traceId })` inside every session scope so log
7
+ * lines can be correlated across a full orchestration trace.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * import logger from '../utils/logger';
12
+ *
13
+ * const log = logger.child({ sessionId: 'abc', traceId: 'trace_123' });
14
+ * log.info({ intent: 'FETCH_MAILS' }, 'Intent classified');
15
+ * log.warn({ confidence: 0.4 }, 'Low confidence — requesting clarification');
16
+ * ```
17
+ */
18
+ declare const logger: pino.Logger<never, boolean>;
19
+ /**
20
+ * Creates a child logger pre-bound with session and trace identifiers.
21
+ *
22
+ * @param sessionId - Stable session ID returned by `CortexFlowOrchestrator.startSession()`.
23
+ * @param traceId - Correlation ID propagated through all token data and log entries.
24
+ */
25
+ export declare const createLogger: (sessionId?: string, traceId?: string) => pino.Logger<never, boolean>;
26
+ export default logger;
27
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,MAAM,6BASV,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,YAAY,eAAgB,MAAM,YAAY,MAAM,gCAEhE,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createLogger = void 0;
7
+ const pino_1 = __importDefault(require("pino"));
8
+ /**
9
+ * Shared Pino logger for the CortexFlow runtime.
10
+ *
11
+ * Pretty-prints in development with `HH:MM:ss Z` timestamps.
12
+ * Use `logger.child({ sessionId, traceId })` inside every session scope so log
13
+ * lines can be correlated across a full orchestration trace.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * import logger from '../utils/logger';
18
+ *
19
+ * const log = logger.child({ sessionId: 'abc', traceId: 'trace_123' });
20
+ * log.info({ intent: 'FETCH_MAILS' }, 'Intent classified');
21
+ * log.warn({ confidence: 0.4 }, 'Low confidence — requesting clarification');
22
+ * ```
23
+ */
24
+ const logger = (0, pino_1.default)({
25
+ transport: {
26
+ target: 'pino-pretty',
27
+ options: {
28
+ colorize: true,
29
+ translateTime: 'HH:MM:ss Z',
30
+ ignore: 'pid,hostname',
31
+ },
32
+ },
33
+ });
34
+ /**
35
+ * Creates a child logger pre-bound with session and trace identifiers.
36
+ *
37
+ * @param sessionId - Stable session ID returned by `CortexFlowOrchestrator.startSession()`.
38
+ * @param traceId - Correlation ID propagated through all token data and log entries.
39
+ */
40
+ const createLogger = (sessionId, traceId) => {
41
+ return logger.child({ sessionId, traceId });
42
+ };
43
+ exports.createLogger = createLogger;
44
+ exports.default = logger;
45
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../utils/logger.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,GAAG,IAAA,cAAI,EAAC;IAClB,SAAS,EAAE;QACT,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE;YACP,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,YAAY;YAC3B,MAAM,EAAE,cAAc;SACvB;KACF;CACF,CAAC,CAAC;AAEH;;;;;GAKG;AACI,MAAM,YAAY,GAAG,CAAC,SAAkB,EAAE,OAAgB,EAAE,EAAE;IACnE,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;AAC9C,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEF,kBAAe,MAAM,CAAC"}
Binary file
package/docs/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # Documentation: @ai.ntellect/core
2
+
3
+ Welcome to the official documentation for **@ai.ntellect/core**, the framework for building production-grade LLM agents that don't drift.
4
+
5
+ ## The Core Thesis
6
+ **LLMs are exceptional at generating text, but they are unreliable at controlling systems.**
7
+
8
+ Most AI frameworks treat the LLM as the "brain" that makes every routing decision. As your agent grows in complexity, this leads to:
9
+ - **Routing Hallucinations**: The LLM forgets the rules and calls tools in the wrong order.
10
+ - **Context Bloat**: The prompt grows too large as it tries to explain every possible path.
11
+ - **Unpredictability**: The same input can lead to different execution paths.
12
+
13
+ **@ai.ntellect/core solves this by splitting the brain:**
14
+ 1. **The LLM is the Classifier**: It identifies *intent* once.
15
+ 2. **The System is the Controller**: A verified Petri Net handles the *routing* deterministically.
16
+ 3. **GraphFlow is the Executor**: Typed graphs handle the *execution* without further LLM interference.
17
+
18
+ ---
19
+
20
+ ## 🧭 Navigation Guide
21
+
22
+ ### 🚀 Getting Started
23
+ - [Quick Start Guide](./tutoriels/pour-commencer.md) — From `npm install` to your first workflow in 5 minutes.
24
+ - [The Philosophy](./philosophie.md) — Understand why deterministic control is the only way to scale AI agents.
25
+ - [Key Concepts](./concepts-cles.md) — GraphFlow, CortexFlow, and State Management.
26
+
27
+ ### 🛠️ The Engine
28
+ - [GraphFlow Deep Dive](./core/graphflow.md) — Nodes, Parallelism, and the Send API.
29
+ - [Event-Driven Architectures](./core/les-evenements.md) — Building reactive systems that wait for the world.
30
+ - [Resilience & Checkpoints](./core/checkpoint.md) — Time-travel debugging and human-in-the-loop.
31
+ - [Technical Architecture](./core/architecture.md) — The blueprint of the engine.
32
+
33
+ ### 🧠 AI Orchestration (CortexFlow)
34
+ - [Deterministic Routing](./core/graphflow.md) — How intent classification works.
35
+ - [Formal Verification](./core/architecture.md) — Deadlock detection and reachability analysis.
36
+ - [Hybrid Fallback](./core/architecture.md) — Balancing determinism with conversational flexibility.
37
+
38
+ ### 🧩 Modules & Tooling
39
+ - [Memory Systems](./modules/memoire/) — Pluggable persistence (Redis, Meilisearch).
40
+ - [Agenda & Scheduling](./modules/agenda/) — Cron-based automation.
41
+ - [Interactive CLI](./cli/) — Debugging and running agents from your terminal.
42
+
43
+ ### 📈 Real-World Application
44
+ - [Design Patterns](./cas-dusages.md) — How to model Approval Flows, RAG, and ETL pipelines.
45
+ - [Benchmarks](./core/benchmark.md) — CortexFlow vs LangGraph: Performance and Reliability.
46
+
47
+ ---
48
+
49
+ ## 🛠️ Quick Reference
50
+
51
+ | If you want to... | Go to... |
52
+ | :--- | :--- |
53
+ | Build a simple sequence of tasks | [GraphFlow](./core/graphflow.md) |
54
+ | Create an agent that handles intents | [CortexFlow](./core/graphflow.md) |
55
+ | Make a workflow pause for a human | [Checkpoints](./core/checkpoint.md) |
56
+ | Trigger a workflow via Webhook | [Events](./core/les-evenements.md) |
57
+ | Run an agent in your terminal | [CLI](./cli/) |
@@ -0,0 +1,34 @@
1
+ # Table of Contents
2
+
3
+ * [Welcome](./README.md)
4
+
5
+ ## 🚀 Getting Started
6
+ * [Quick Start Guide](./tutoriels/pour-commencer.md)
7
+ * [The Philosophy](./philosophie.md)
8
+ * [Key Concepts](./concepts-cles.md)
9
+
10
+ ## 🛠️ The Engine (Core)
11
+ * [GraphFlow Deep Dive](./core/graphflow.md)
12
+ * [Event-Driven Architectures](./core/les-evenements.md)
13
+ * [Resilience & Checkpoints](./core/checkpoint.md)
14
+ * [Multi-Graph Orchestration](./core/graphcontroller.md)
15
+ * [Technical Architecture](./core/architecture.md)
16
+ * [Visualizing Your Agents](./core/documentation.md)
17
+ * [Performance Benchmarks](./core/benchmark.md)
18
+
19
+ ## 🧩 Modules & Tooling
20
+ * [Modular Extensions](./modules/introduction.md)
21
+ * [Memory Systems](./modules/memoire/)
22
+ * [Agenda & Scheduling](./modules/agenda/)
23
+ * [Interactive CLI](./cli/README.md)
24
+
25
+ ## 📖 Tutorials
26
+ * [Building Your First Workflow](./tutoriels/creer-un-graphe-simple.md)
27
+ * [Building Tool-Using Agents](./tutoriels/creer-un-agent.md)
28
+ * [Implementing Human-in-the-Loop](./tutoriels/checkpoint-usage.md)
29
+ * [Advanced Branching](./tutoriels/branching.md)
30
+ * [Handling Errors & Retries](./tutoriels/retry.md)
31
+
32
+ ## 🔗 Links
33
+ * [NPM Package](https://www.npmjs.com/package/@ai.ntellect/core)
34
+ * [GitHub Repository](https://github.com/ai-ntellect/core)
@@ -0,0 +1,69 @@
1
+ # Use Cases & Design Patterns
2
+
3
+ `@ai.ntellect/core` is designed for scenarios where **failure is not an option**. While simple chatbots can use raw LLM loops, production systems require structured, predictable execution.
4
+
5
+ Here are the primary patterns you can build with this framework.
6
+
7
+ ---
8
+
9
+ ## 1. Task-Based Assistants (The "Router" Pattern)
10
+ Perfect for applications that provide a suite of specific services.
11
+
12
+ **The Pattern**: `Natural Language` $\rightarrow$ `Intent Classification` $\rightarrow$ `Deterministic Workflow`.
13
+
14
+ - **Example**: A Banking Assistant.
15
+ - "What's my balance?" $\rightarrow$ `GET_BALANCE` intent $\rightarrow$ `fetchBalance` GraphFlow.
16
+ - "Pay my electricity bill" $\rightarrow$ `PAY_BILL` intent $\rightarrow$ `validateAccount` $\rightarrow$ `executePayment` $\rightarrow$ `notifyUser` GraphFlow.
17
+ - **Why this wins**: The LLM cannot "hallucinate" a new payment method or skip the validation step. The path is hardcoded in the Petri Net.
18
+
19
+ ---
20
+
21
+ ## 2. Human-in-the-Loop (The "Approval" Pattern)
22
+ Essential for high-stakes actions that require a human "sanity check."
23
+
24
+ **The Pattern**: `Workflow Execution` $\rightarrow$ `Checkpoint` $\rightarrow$ `Awaiting Approval` $\rightarrow$ `Resume`.
25
+
26
+ - **Example**: Enterprise Expense Approval.
27
+ - Employee submits a \$5,000 expense.
28
+ - GraphFlow processes the request and hits a **Breakpoint**.
29
+ - Execution pauses; state is saved to Redis.
30
+ - Manager receives a notification and calls `/approve`.
31
+ - GraphFlow resumes from the exact same state and completes the payment.
32
+ - **Why this wins**: You don't have to write complex "polling" logic. The system natively supports pausing and resuming long-running processes.
33
+
34
+ ---
35
+
36
+ ## 3. Event-Driven Orchestration (The "Reactive" Pattern)
37
+ For systems that must react to the real world (Webhooks, IoT, Blockchain).
38
+
39
+ **The Pattern**: `Event Trigger` $\rightarrow$ `Context Correlation` $\rightarrow$ `Workflow Trigger`.
40
+
41
+ - **Example**: Crypto Whale Alert & Trade.
42
+ - **Event**: A large transfer is detected on-chain.
43
+ - **Action**: Trigger a GraphFlow that analyzes the wallet history, calculates the impact, and executes a hedge trade.
44
+ - **Why this wins**: By using **Event-Driven Nodes**, your workflows can "sleep" for days and wake up the instant a specific external condition is met.
45
+
46
+ ---
47
+
48
+ ## 4. Financial & Critical Workflows (The "Zero-Failure" Pattern)
49
+ For systems where a single error can result in financial loss or compliance breach.
50
+
51
+ **The Pattern**: `Formal Verification` $\rightarrow$ `Zod Validation` $\rightarrow$ `Atomic Execution`.
52
+
53
+ - **Example**: Automated Compliance Reporting.
54
+ - Collect data from 5 different APIs.
55
+ - Validate each piece of data against a strict Zod schema.
56
+ - Use a **Fork-Join** model to process reports in parallel.
57
+ - Merge results using a custom **Reducer** to ensure no data is lost.
58
+ - **Why this wins**: The use of Petri Nets allows you to prove that the workflow will never enter an invalid state (Deadlock Detection), and Zod ensures that no corrupted data ever reaches your core logic.
59
+
60
+ ---
61
+
62
+ ## 🚀 Summary: When to use what?
63
+
64
+ | If you need... | Use this pattern | Key Primitive |
65
+ | :--- | :--- | :--- |
66
+ | Predictable routing | **Task-Based** | `CortexFlow` (Intent $\rightarrow$ Net) |
67
+ | Safety / Oversight | **Approval** | `Checkpoints` + `Breakpoints` |
68
+ | External triggers | **Reactive** | `Event-Driven Nodes` |
69
+ | Mathematical certainty | **Zero-Failure** | `Petri Net Verification` + `Zod` |
@@ -0,0 +1,65 @@
1
+ # Interactive CLI: Debugging & Control
2
+
3
+ The `@ai.ntellect/core` CLI is not just a runner—it is a **control center** for your agents. It allows you to interact with agents in real-time, inspect their internal state, and manually steer execution using checkpoints.
4
+
5
+ ## 🚀 Getting Started
6
+
7
+ Launch the REPL by specifying your LLM provider and model:
8
+
9
+ ```sh
10
+ pnpm cli -p groq -m llama-3.1-8b-instant # High-speed Groq
11
+ pnpm cli -p openai -m gpt-4o-mini # Versatile OpenAI
12
+ pnpm cli -p ollama -m llama3 # Local Privacy (Ollama)
13
+ ```
14
+
15
+ ### Configuration
16
+ The CLI automatically loads your `.env` file for API keys (`GROQ_API_KEY`, `OPENAI_API_KEY`, etc.), so you don't have to pass them manually.
17
+
18
+ ---
19
+
20
+ ## ⌨️ Control Commands (Slash Commands)
21
+
22
+ While in the interactive session, use these commands to manage the agent's lifecycle:
23
+
24
+ ### 🔍 State Inspection
25
+ - `/status` — View the current execution state and active node.
26
+ - `/history` — Print the full conversation and tool execution history.
27
+ - `/list` — List all available checkpoints for the current session.
28
+
29
+ ### 🕹️ Execution Control
30
+ - `/resume [cpId]` — **Time Travel**: Jump back to a specific checkpoint and continue from there.
31
+ - `/approve` — Signal a "Yes" to a pending human-in-the-loop breakpoint.
32
+ - `/reject` — Signal a "No" to a pending human-in-the-loop breakpoint.
33
+ - `/modify k=v` — **State Injection**: Change a variable in the context *before* resuming execution.
34
+
35
+ ### 🧹 Session Management
36
+ - `/clear` — Reset the current conversation context.
37
+ - `/help` — Show all available commands.
38
+ - `/exit` — Gracefully terminate the session.
39
+
40
+ ---
41
+
42
+ ## 🛑 Human-in-the-Loop (HITL)
43
+
44
+ The CLI is designed for **safe AI deployment**. By default, the agent is configured with a breakpoint before the `think` node (the LLM call).
45
+
46
+ **The Workflow:**
47
+ 1. The agent identifies a need to call a tool.
48
+ 2. The CLI **pauses** execution.
49
+ 3. You review the proposed action.
50
+ 4. You type `/approve` to let it proceed or `/modify` to correct the parameters.
51
+
52
+ This ensures that no destructive action (like a financial transfer or a file deletion) happens without explicit human consent.
53
+
54
+ ## 📖 Example Session
55
+
56
+ ```text
57
+ > /role Financial Assistant
58
+ > Transfer $50 to Alice
59
+ [BREAKPOINT] Agent wants to execute: transfer_funds { amount: 50, to: "Alice" }
60
+ > /approve
61
+ [Executing...]
62
+ Transaction successful. Reference: TX_9921.
63
+ > /status
64
+ Current Node: notify_user | Status: COMPLETED
65
+ ```
@@ -0,0 +1,50 @@
1
+ # Key Concepts
2
+
3
+ To understand `@ai.ntellect/core`, you need to shift your mental model from "autonomous agents" to "deterministic orchestration."
4
+
5
+ ## 🧠 The Classifier-Controller Split
6
+
7
+ The core innovation of this framework is the separation of **Intent Classification** from **Execution Logic**.
8
+
9
+ ### 1. The Classifier (LLM)
10
+ The LLM is used as a high-dimensional pattern matcher. Its only job is to map a user's natural language input to a pre-defined **Intent**.
11
+ - **Input**: "I need to check my balance and transfer $50 to Alice."
12
+ - **Output**: `{ intent: "TRANSFER_FUNDS", confidence: 0.98 }`
13
+
14
+ By restricting the LLM to classification, we eliminate the "routing hallucinations" that occur when the LLM tries to decide the next step in a complex workflow.
15
+
16
+ ### 2. The Controller (Petri Net)
17
+ Once the intent is classified, the **CortexFlow Orchestrator** takes over. It uses a verified Petri Net to determine the exact sequence of steps.
18
+ - **Deterministic**: The same intent always triggers the same path.
19
+ - **Verifiable**: We can mathematically prove the workflow will never deadlock.
20
+ - **Observably**: Every transition is a discrete event that can be logged and audited.
21
+
22
+ ---
23
+
24
+ ## 🏗️ The Execution Engine: GraphFlow
25
+
26
+ While the Controller decides *which* workflow to run, **GraphFlow** is the engine that actually *runs* it.
27
+
28
+ ### Workflow as a Typed Graph
29
+ A `GraphFlow` is a directed graph where each node is a discrete unit of logic. Unlike simple scripts, GraphFlows are:
30
+ - **Strongly Typed**: Every transition is validated via Zod.
31
+ - **Stateful**: They maintain a shared context that evolves as the graph is traversed.
32
+ - **Resilient**: Built-in retry logic and checkpointing allow workflows to survive crashes or wait for human approval.
33
+
34
+ ### Orchestration vs. Automation
35
+ - **Automation**: A linear sequence of "If X then Y." It's brittle and fails when the world changes.
36
+ - **Orchestration**: The coordination of multiple asynchronous processes, handling parallel branches, and reacting to external events.
37
+
38
+ `@ai.ntellect/core` provides **orchestration**, allowing you to build systems that are as flexible as a human operator but as reliable as a compiler.
39
+
40
+ ---
41
+
42
+ ## 🔄 The Lifecycle of a Request
43
+
44
+ 1. **Input**: User sends a message.
45
+ 2. **Classify**: LLM identifies the **Intent**.
46
+ 3. **Route**: The **Petri Net** finds the matching transition.
47
+ 4. **Execute**: The **GraphFlow** associated with that transition runs its nodes.
48
+ 5. **Respond**: The final state is returned to the user.
49
+
50
+ **Total LLM calls for routing: 1.**