@ai.ntellect/core 1.0.0 → 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 (435) hide show
  1. package/.mocharc.json +6 -0
  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 +411 -142
  7. package/agent/agent-workflow.ts +569 -0
  8. package/agent/agent.ts +183 -0
  9. package/agent/base/executor.ts +103 -0
  10. package/agent/base/index.ts +87 -0
  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/agent/prompt-builder.ts +78 -0
  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/agent/base/executor.d.ts +51 -0
  44. package/dist/agent/base/executor.d.ts.map +1 -0
  45. package/dist/agent/base/executor.js +69 -0
  46. package/dist/agent/base/executor.js.map +1 -0
  47. package/dist/agent/base/index.d.ts +30 -0
  48. package/dist/agent/base/index.d.ts.map +1 -0
  49. package/dist/agent/base/index.js +88 -0
  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/agent/generic-executor.d.ts +68 -0
  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 +19 -0
  96. package/dist/agent/llm-factory.d.ts.map +1 -0
  97. package/dist/agent/llm-factory.js +297 -0
  98. package/dist/agent/llm-factory.js.map +1 -0
  99. package/dist/agent/orchestrator.d.ts +18 -0
  100. package/dist/agent/orchestrator.d.ts.map +1 -0
  101. package/dist/agent/orchestrator.js +44 -0
  102. package/dist/agent/orchestrator.js.map +1 -0
  103. package/dist/agent/prompt-builder.d.ts +35 -0
  104. package/dist/agent/prompt-builder.d.ts.map +1 -0
  105. package/dist/agent/prompt-builder.js +76 -0
  106. package/dist/agent/prompt-builder.js.map +1 -0
  107. package/dist/agent/registry.d.ts +19 -0
  108. package/dist/agent/registry.d.ts.map +1 -0
  109. package/dist/agent/registry.js +48 -0
  110. package/dist/agent/registry.js.map +1 -0
  111. package/dist/agent/tools/file-system.d.ts +11 -0
  112. package/dist/agent/tools/file-system.d.ts.map +1 -0
  113. package/dist/agent/tools/file-system.js +528 -0
  114. package/dist/agent/tools/file-system.js.map +1 -0
  115. package/dist/agent/tools/index.d.ts +4 -0
  116. package/dist/agent/tools/index.d.ts.map +1 -0
  117. package/dist/agent/tools/index.js +20 -0
  118. package/dist/agent/tools/index.js.map +1 -0
  119. package/dist/agent/tools/logger.d.ts +33 -0
  120. package/dist/agent/tools/logger.d.ts.map +1 -0
  121. package/dist/agent/tools/logger.js +86 -0
  122. package/dist/agent/tools/logger.js.map +1 -0
  123. package/dist/agent/tools/tool-resolver.d.ts +7 -0
  124. package/dist/agent/tools/tool-resolver.d.ts.map +1 -0
  125. package/dist/agent/tools/tool-resolver.js +122 -0
  126. package/dist/agent/tools/tool-resolver.js.map +1 -0
  127. package/dist/execution/adapters/in-memory-checkpoint.d.ts +11 -0
  128. package/dist/execution/adapters/in-memory-checkpoint.d.ts.map +1 -0
  129. package/dist/execution/adapters/in-memory-checkpoint.js +54 -0
  130. package/dist/execution/adapters/in-memory-checkpoint.js.map +1 -0
  131. package/dist/execution/compiler.d.ts +8 -0
  132. package/dist/execution/compiler.d.ts.map +1 -0
  133. package/dist/execution/compiler.js +50 -0
  134. package/dist/execution/compiler.js.map +1 -0
  135. package/dist/execution/controller.d.ts +30 -0
  136. package/dist/execution/controller.d.ts.map +1 -0
  137. package/dist/execution/controller.js +80 -0
  138. package/dist/execution/controller.js.map +1 -0
  139. package/dist/execution/event-manager.d.ts +29 -0
  140. package/dist/execution/event-manager.d.ts.map +1 -0
  141. package/dist/execution/event-manager.js +264 -0
  142. package/dist/execution/event-manager.js.map +1 -0
  143. package/dist/execution/index.d.ts +221 -0
  144. package/dist/execution/index.d.ts.map +1 -0
  145. package/dist/execution/index.js +638 -0
  146. package/dist/execution/index.js.map +1 -0
  147. package/dist/execution/logger.d.ts +46 -0
  148. package/dist/execution/logger.d.ts.map +1 -0
  149. package/dist/execution/logger.js +69 -0
  150. package/dist/execution/logger.js.map +1 -0
  151. package/dist/execution/node.d.ts +65 -0
  152. package/dist/execution/node.d.ts.map +1 -0
  153. package/dist/execution/node.js +250 -0
  154. package/dist/execution/node.js.map +1 -0
  155. package/dist/execution/observer.d.ts +38 -0
  156. package/dist/execution/observer.d.ts.map +1 -0
  157. package/dist/execution/observer.js +111 -0
  158. package/dist/execution/observer.js.map +1 -0
  159. package/dist/execution/planner.d.ts +14 -0
  160. package/dist/execution/planner.d.ts.map +1 -0
  161. package/dist/execution/planner.js +43 -0
  162. package/dist/execution/planner.js.map +1 -0
  163. package/dist/execution/reducer.d.ts +19 -0
  164. package/dist/execution/reducer.d.ts.map +1 -0
  165. package/dist/execution/reducer.js +61 -0
  166. package/dist/execution/reducer.js.map +1 -0
  167. package/dist/execution/registry.d.ts +38 -0
  168. package/dist/execution/registry.d.ts.map +1 -0
  169. package/dist/execution/registry.js +63 -0
  170. package/dist/execution/registry.js.map +1 -0
  171. package/dist/execution/send-api.d.ts +24 -0
  172. package/dist/execution/send-api.d.ts.map +1 -0
  173. package/dist/execution/send-api.js +52 -0
  174. package/dist/execution/send-api.js.map +1 -0
  175. package/dist/execution/types.parallel.d.ts +61 -0
  176. package/dist/execution/types.parallel.d.ts.map +1 -0
  177. package/dist/execution/types.parallel.js +3 -0
  178. package/dist/execution/types.parallel.js.map +1 -0
  179. package/dist/execution/visualizer.d.ts +35 -0
  180. package/dist/execution/visualizer.d.ts.map +1 -0
  181. package/dist/execution/visualizer.js +131 -0
  182. package/dist/execution/visualizer.js.map +1 -0
  183. package/dist/index.d.ts +47 -0
  184. package/dist/index.d.ts.map +1 -0
  185. package/dist/index.js +78 -0
  186. package/dist/index.js.map +1 -0
  187. package/dist/interfaces/index.d.ts +487 -0
  188. package/dist/interfaces/index.d.ts.map +1 -0
  189. package/dist/interfaces/index.js +75 -0
  190. package/dist/interfaces/index.js.map +1 -0
  191. package/dist/modules/agenda/adapters/node-cron/index.d.ts +17 -0
  192. package/dist/modules/agenda/adapters/node-cron/index.d.ts.map +1 -0
  193. package/dist/modules/agenda/adapters/node-cron/index.js +30 -0
  194. package/dist/modules/agenda/adapters/node-cron/index.js.map +1 -0
  195. package/dist/modules/agenda/index.d.ts +63 -0
  196. package/dist/modules/agenda/index.d.ts.map +1 -0
  197. package/dist/modules/agenda/index.js +141 -0
  198. package/dist/modules/agenda/index.js.map +1 -0
  199. package/dist/modules/cli/index.d.ts +13 -0
  200. package/dist/modules/cli/index.d.ts.map +1 -0
  201. package/dist/modules/cli/index.js +672 -0
  202. package/dist/modules/cli/index.js.map +1 -0
  203. package/dist/modules/embedding/adapters/ai/index.d.ts +29 -0
  204. package/dist/modules/embedding/adapters/ai/index.d.ts.map +1 -0
  205. package/dist/modules/embedding/adapters/ai/index.js +58 -0
  206. package/dist/modules/embedding/adapters/ai/index.js.map +1 -0
  207. package/dist/modules/embedding/index.d.ts +36 -0
  208. package/dist/modules/embedding/index.d.ts.map +1 -0
  209. package/dist/modules/embedding/index.js +60 -0
  210. package/dist/modules/embedding/index.js.map +1 -0
  211. package/dist/modules/nlp/engine.d.ts +126 -0
  212. package/dist/modules/nlp/engine.d.ts.map +1 -0
  213. package/dist/modules/nlp/engine.js +299 -0
  214. package/dist/modules/nlp/engine.js.map +1 -0
  215. package/dist/modules/nlp/index.d.ts +27 -0
  216. package/dist/modules/nlp/index.d.ts.map +1 -0
  217. package/dist/modules/nlp/index.js +56 -0
  218. package/dist/modules/nlp/index.js.map +1 -0
  219. package/dist/persistence/index.d.ts +12 -0
  220. package/dist/persistence/index.d.ts.map +1 -0
  221. package/dist/persistence/index.js +24 -0
  222. package/dist/persistence/index.js.map +1 -0
  223. package/dist/persistence/neo4j/driver.d.ts +26 -0
  224. package/dist/persistence/neo4j/driver.d.ts.map +1 -0
  225. package/dist/persistence/neo4j/driver.js +64 -0
  226. package/dist/persistence/neo4j/driver.js.map +1 -0
  227. package/dist/persistence/neo4j/entity-store.d.ts +15 -0
  228. package/dist/persistence/neo4j/entity-store.d.ts.map +1 -0
  229. package/dist/persistence/neo4j/entity-store.js +136 -0
  230. package/dist/persistence/neo4j/entity-store.js.map +1 -0
  231. package/dist/persistence/neo4j/execution-tracer.d.ts +19 -0
  232. package/dist/persistence/neo4j/execution-tracer.d.ts.map +1 -0
  233. package/dist/persistence/neo4j/execution-tracer.js +166 -0
  234. package/dist/persistence/neo4j/execution-tracer.js.map +1 -0
  235. package/dist/persistence/neo4j/memory-adapter.d.ts +35 -0
  236. package/dist/persistence/neo4j/memory-adapter.d.ts.map +1 -0
  237. package/dist/persistence/neo4j/memory-adapter.js +252 -0
  238. package/dist/persistence/neo4j/memory-adapter.js.map +1 -0
  239. package/dist/persistence/neo4j/petri-checkpoint-adapter.d.ts +22 -0
  240. package/dist/persistence/neo4j/petri-checkpoint-adapter.d.ts.map +1 -0
  241. package/dist/persistence/neo4j/petri-checkpoint-adapter.js +141 -0
  242. package/dist/persistence/neo4j/petri-checkpoint-adapter.js.map +1 -0
  243. package/dist/pipeline/agent-pipeline.d.ts +99 -0
  244. package/dist/pipeline/agent-pipeline.d.ts.map +1 -0
  245. package/dist/pipeline/agent-pipeline.js +356 -0
  246. package/dist/pipeline/agent-pipeline.js.map +1 -0
  247. package/dist/routing/checkpoint-adapter.d.ts +30 -0
  248. package/dist/routing/checkpoint-adapter.d.ts.map +1 -0
  249. package/dist/routing/checkpoint-adapter.js +83 -0
  250. package/dist/routing/checkpoint-adapter.js.map +1 -0
  251. package/dist/routing/documentation-generator.d.ts +47 -0
  252. package/dist/routing/documentation-generator.d.ts.map +1 -0
  253. package/dist/routing/documentation-generator.js +320 -0
  254. package/dist/routing/documentation-generator.js.map +1 -0
  255. package/dist/routing/index.d.ts +38 -0
  256. package/dist/routing/index.d.ts.map +1 -0
  257. package/dist/routing/index.js +375 -0
  258. package/dist/routing/index.js.map +1 -0
  259. package/dist/routing/intent-classifier.d.ts +206 -0
  260. package/dist/routing/intent-classifier.d.ts.map +1 -0
  261. package/dist/routing/intent-classifier.js +267 -0
  262. package/dist/routing/intent-classifier.js.map +1 -0
  263. package/dist/routing/matrix.d.ts +6 -0
  264. package/dist/routing/matrix.d.ts.map +1 -0
  265. package/dist/routing/matrix.js +131 -0
  266. package/dist/routing/matrix.js.map +1 -0
  267. package/dist/routing/orchestrator.d.ts +87 -0
  268. package/dist/routing/orchestrator.d.ts.map +1 -0
  269. package/dist/routing/orchestrator.js +425 -0
  270. package/dist/routing/orchestrator.js.map +1 -0
  271. package/dist/routing/postgres-checkpoint-adapter.d.ts +32 -0
  272. package/dist/routing/postgres-checkpoint-adapter.d.ts.map +1 -0
  273. package/dist/routing/postgres-checkpoint-adapter.js +167 -0
  274. package/dist/routing/postgres-checkpoint-adapter.js.map +1 -0
  275. package/dist/routing/redis-checkpoint-adapter.d.ts +34 -0
  276. package/dist/routing/redis-checkpoint-adapter.d.ts.map +1 -0
  277. package/dist/routing/redis-checkpoint-adapter.js +170 -0
  278. package/dist/routing/redis-checkpoint-adapter.js.map +1 -0
  279. package/dist/routing/types.d.ts +49 -0
  280. package/dist/routing/types.d.ts.map +1 -0
  281. package/dist/routing/types.js +3 -0
  282. package/dist/routing/types.js.map +1 -0
  283. package/dist/types/agent.d.ts +289 -0
  284. package/dist/types/agent.d.ts.map +1 -0
  285. package/dist/types/agent.js +78 -0
  286. package/dist/types/agent.js.map +1 -0
  287. package/dist/types/index.d.ts +343 -0
  288. package/dist/types/index.d.ts.map +1 -0
  289. package/dist/types/index.js +3 -0
  290. package/dist/types/index.js.map +1 -0
  291. package/dist/utils/generate-action-schema.d.ts +4 -0
  292. package/dist/utils/generate-action-schema.d.ts.map +1 -0
  293. package/dist/utils/generate-action-schema.js +46 -0
  294. package/dist/utils/generate-action-schema.js.map +1 -0
  295. package/dist/utils/header-builder.d.ts +12 -0
  296. package/dist/utils/header-builder.d.ts.map +1 -0
  297. package/dist/utils/header-builder.js +35 -0
  298. package/dist/utils/header-builder.js.map +1 -0
  299. package/dist/utils/logger.d.ts +27 -0
  300. package/dist/utils/logger.d.ts.map +1 -0
  301. package/dist/utils/logger.js +45 -0
  302. package/dist/utils/logger.js.map +1 -0
  303. package/docs/.gitbook/assets/image (1).png +0 -0
  304. package/docs/.gitbook/assets/image (2).png +0 -0
  305. package/docs/.gitbook/assets/image (3).png +0 -0
  306. package/docs/.gitbook/assets/image (4).png +0 -0
  307. package/docs/.gitbook/assets/image (5).png +0 -0
  308. package/docs/.gitbook/assets/image (6).png +0 -0
  309. package/docs/.gitbook/assets/image.png +0 -0
  310. package/docs/README.md +57 -0
  311. package/docs/SUMMARY.md +34 -0
  312. package/docs/cas-dusages.md +69 -0
  313. package/docs/cli/README.md +65 -0
  314. package/docs/concepts-cles.md +50 -0
  315. package/docs/core/architecture.md +87 -0
  316. package/docs/core/benchmark.md +59 -0
  317. package/docs/core/checkpoint.md +72 -0
  318. package/docs/core/documentation.md +55 -0
  319. package/docs/core/graphcontroller.md +63 -0
  320. package/docs/core/graphflow.md +137 -0
  321. package/docs/core/introduction.md +41 -0
  322. package/docs/core/les-evenements.md +95 -0
  323. package/docs/modules/agenda/README.md +63 -0
  324. package/docs/modules/agenda/interface-iagenda.md +170 -0
  325. package/docs/modules/agenda/les-adaptateurs/README.md +237 -0
  326. package/docs/modules/agenda/les-adaptateurs/nodecronadapter.md +91 -0
  327. package/docs/modules/introduction.md +55 -0
  328. package/docs/modules/les-adaptateurs.md +52 -0
  329. package/docs/modules/memoire/README.md +68 -0
  330. package/docs/modules/memoire/interface-imemory.md +183 -0
  331. package/docs/modules/memoire/les-adaptateurs/README.md +209 -0
  332. package/docs/modules/memoire/les-adaptateurs/inmemoryadapter.md +110 -0
  333. package/docs/modules/memoire/les-adaptateurs/meilisearchadapter.md +147 -0
  334. package/docs/modules/memoire/les-adaptateurs/redisadapter.md +212 -0
  335. package/docs/modules/nlp/README.md +44 -0
  336. package/docs/philosophie.md +51 -0
  337. package/docs/tutoriels/ajouter-des-conditions.md +150 -0
  338. package/docs/tutoriels/branching.md +194 -0
  339. package/docs/tutoriels/checkpoint-usage.md +99 -0
  340. package/docs/tutoriels/creer-agent-onchain.md +1041 -0
  341. package/docs/tutoriels/creer-un-agent.md +108 -0
  342. package/docs/tutoriels/creer-un-graphe-simple.md +92 -0
  343. package/docs/tutoriels/gerer-les-erreurs.md +124 -0
  344. package/docs/tutoriels/pour-commencer.md +73 -0
  345. package/docs/tutoriels/retry.md +166 -0
  346. package/execution/adapters/in-memory-checkpoint.ts +35 -0
  347. package/execution/compiler.ts +47 -0
  348. package/execution/controller.ts +84 -0
  349. package/execution/event-manager.ts +331 -0
  350. package/execution/index.ts +800 -0
  351. package/execution/logger.ts +70 -0
  352. package/execution/node.ts +315 -0
  353. package/execution/observer.ts +192 -0
  354. package/execution/planner.ts +40 -0
  355. package/execution/reducer.ts +73 -0
  356. package/execution/registry.ts +86 -0
  357. package/execution/send-api.ts +58 -0
  358. package/execution/types.parallel.ts +81 -0
  359. package/execution/visualizer.ts +158 -0
  360. package/index.ts +55 -465
  361. package/interfaces/index.ts +597 -0
  362. package/modules/agenda/adapters/node-cron/index.ts +25 -0
  363. package/modules/agenda/index.ts +146 -0
  364. package/modules/cli/index.ts +580 -0
  365. package/modules/embedding/adapters/ai/index.ts +42 -0
  366. package/modules/embedding/index.ts +45 -0
  367. package/modules/nlp/engine.ts +324 -0
  368. package/modules/nlp/index.ts +45 -0
  369. package/package.json +81 -9
  370. package/persistence/index.ts +27 -0
  371. package/persistence/neo4j/driver.ts +34 -0
  372. package/persistence/neo4j/entity-store.ts +141 -0
  373. package/persistence/neo4j/execution-tracer.ts +194 -0
  374. package/persistence/neo4j/memory-adapter.ts +281 -0
  375. package/persistence/neo4j/petri-checkpoint-adapter.ts +153 -0
  376. package/pipeline/agent-pipeline.ts +426 -0
  377. package/routing/checkpoint-adapter.ts +79 -0
  378. package/routing/documentation-generator.ts +358 -0
  379. package/routing/index.ts +459 -0
  380. package/routing/intent-classifier.ts +360 -0
  381. package/routing/matrix.ts +138 -0
  382. package/routing/orchestrator.ts +498 -0
  383. package/routing/patterns/data-extraction.json +79 -0
  384. package/routing/patterns/human-approval.json +64 -0
  385. package/routing/patterns/rag-search.json +68 -0
  386. package/routing/postgres-checkpoint-adapter.ts +172 -0
  387. package/routing/redis-checkpoint-adapter.ts +187 -0
  388. package/routing/types.ts +59 -0
  389. package/routing/web-server.ts +260 -0
  390. package/scripts/generate-petri-docs.ts +70 -0
  391. package/scripts/get-gmail-token.js +65 -0
  392. package/scripts/get-gmail-token.ts +65 -0
  393. package/test/agent/agent.test.ts +92 -0
  394. package/test/agent/clone.test.ts +143 -0
  395. package/test/agent/cognitive-handler.test.ts +78 -0
  396. package/test/agent/entity-store.test.ts +80 -0
  397. package/test/agent/generic-executor.test.ts +230 -0
  398. package/test/agent/handoff.test.ts +163 -0
  399. package/test/agent/llm-factory.test.ts +40 -0
  400. package/test/agent/orchestrator.test.ts +156 -0
  401. package/test/agent/registry.test.ts +97 -0
  402. package/test/agent/tools.test.ts +267 -0
  403. package/test/execution/checkpoint.test.ts +811 -0
  404. package/test/execution/controller.test.ts +236 -0
  405. package/test/execution/event-manager.test.ts +118 -0
  406. package/test/execution/index.test.ts +690 -0
  407. package/test/execution/node.test.ts +464 -0
  408. package/test/execution/observer.test.ts +393 -0
  409. package/test/execution/parallel.test.ts +135 -0
  410. package/test/execution/plan-llm-integration.test.ts +290 -0
  411. package/test/execution/plan-real-onchain.test.ts +226 -0
  412. package/test/execution/send-api.test.ts +121 -0
  413. package/test/modules/agenda/node-cron.test.ts +307 -0
  414. package/test/modules/cli/index.test.ts +125 -0
  415. package/test/persistence/neo4j-execution-tracer.test.ts +96 -0
  416. package/test/persistence/neo4j-memory-adapter.test.ts +107 -0
  417. package/test/persistence/neo4j-petri-checkpoint.test.ts +89 -0
  418. package/test/pipeline/agent-pipeline.test.ts +118 -0
  419. package/test/routing/checkpoint-persistence.test.ts +58 -0
  420. package/test/routing/documentation-generator.test.ts +76 -0
  421. package/test/routing/integration.test.ts +261 -0
  422. package/test/routing/intent-classifier.test.ts +102 -0
  423. package/test/routing/petri.test.ts +156 -0
  424. package/test/routing/real-llm.test.ts +260 -0
  425. package/test-petri-features.ts +218 -0
  426. package/test-pipeline-api.ts +163 -0
  427. package/tsconfig.json +30 -108
  428. package/types/agent.ts +296 -0
  429. package/types/index.ts +387 -0
  430. package/utils/generate-action-schema.ts +47 -0
  431. package/utils/header-builder.ts +40 -0
  432. package/utils/logger.ts +40 -0
  433. package/package copy.json +0 -21
  434. package/types.ts +0 -62
  435. package/utils/executor.ts +0 -42
@@ -0,0 +1,218 @@
1
+ import { CortexFlowOrchestrator } from './routing/orchestrator';
2
+ import { IntentClassifier, HybridIntentClassifier } from './routing/intent-classifier';
3
+ import { ToolRegistry } from './execution/registry';
4
+ import { GraphFlow } from './execution/index';
5
+ import { PetriNet } from './routing/index';
6
+ import { z } from 'zod';
7
+ import * as fs from 'fs';
8
+ import * as path from 'path';
9
+
10
+ // Chargement manuel du .env
11
+ const envPath = path.join(__dirname, '.env');
12
+ const envContent = fs.readFileSync(envPath, 'utf-8');
13
+ const envVars: Record<string, string> = {};
14
+ envContent.split('\n').forEach(line => {
15
+ const match = line.match(/^([^=]+)=(.*)$/);
16
+ if (match) envVars[match[1]] = match[2];
17
+ });
18
+
19
+ const GROQ_API_KEY = envVars['GROQ_API_KEY'];
20
+
21
+ async function groqCall(prompt: string): Promise<string> {
22
+ const response = await fetch('https://api.groq.com/openai/v1/chat/completions', {
23
+ method: 'POST',
24
+ headers: {
25
+ 'Authorization': `Bearer ${GROQ_API_KEY}`,
26
+ 'Content-Type': 'application/json',
27
+ },
28
+ body: JSON.stringify({
29
+ model: 'llama-3.1-8b-instant',
30
+ messages: [{ role: 'user', content: prompt }],
31
+ temperature: 0.1,
32
+ }),
33
+ });
34
+ const data = await response.json();
35
+ return data.choices?.[0]?.message?.content || '';
36
+ }
37
+
38
+ // Schéma pour les outils de test
39
+ const TestSchema = z.object({
40
+ query: z.string().default(''),
41
+ data: z.string().default(''),
42
+ result: z.string().default(''),
43
+ message: z.string().default(''),
44
+ fetched: z.boolean().default(false),
45
+ processed: z.boolean().default(false),
46
+ notified: z.boolean().default(false),
47
+ });
48
+
49
+ type TestContext = z.infer<typeof TestSchema>;
50
+
51
+ function createTestTools(): ToolRegistry {
52
+ const registry = new ToolRegistry();
53
+
54
+ const fetchGraph = new GraphFlow<typeof TestSchema>({
55
+ name: 'fetch_data_graph',
56
+ schema: TestSchema,
57
+ context: { query: '', data: '', result: '', message: '', fetched: false, processed: false, notified: false },
58
+ nodes: [
59
+ {
60
+ name: 'fetch_data',
61
+ execute: async (ctx) => {
62
+ console.log(' [Tool] fetch_data exécuté');
63
+ ctx.data = `Données récupérées`;
64
+ ctx.fetched = true;
65
+ },
66
+ },
67
+ ],
68
+ entryNode: 'fetch_data',
69
+ });
70
+ registry.register({ name: 'fetch_data', description: 'Récupère des données', graph: fetchGraph, startNode: 'fetch_data' });
71
+
72
+ const processGraph = new GraphFlow<typeof TestSchema>({
73
+ name: 'process_data_graph',
74
+ schema: TestSchema,
75
+ context: { query: '', data: '', result: '', message: '', fetched: false, processed: false, notified: false },
76
+ nodes: [
77
+ {
78
+ name: 'process_data',
79
+ execute: async (ctx) => {
80
+ console.log(' [Tool] process_data exécuté');
81
+ ctx.result = `Données traitées: ${ctx.data}`;
82
+ ctx.processed = true;
83
+ },
84
+ },
85
+ ],
86
+ entryNode: 'process_data',
87
+ });
88
+ registry.register({ name: 'process_data', description: 'Traite des données', graph: processGraph, startNode: 'process_data' });
89
+
90
+ return registry;
91
+ }
92
+
93
+ function setupPetriNet(orchestrator: CortexFlowOrchestrator) {
94
+ const net = orchestrator.petri;
95
+
96
+ net.addPlace({ id: 'idle', type: 'initial', tokens: [{ id: 'start', data: {}, createdAt: Date.now() }] });
97
+ net.addPlace({ id: 'fetching', type: 'normal', tokens: [] });
98
+ net.addPlace({ id: 'processing', type: 'normal', tokens: [] });
99
+ net.addPlace({ id: 'done', type: 'final', tokens: [] });
100
+
101
+ net.addTransition({
102
+ id: 'do_fetch',
103
+ from: ['idle'],
104
+ to: 'fetching',
105
+ guard: {
106
+ type: 'deterministic',
107
+ condition: "context.intent === 'FETCH_DATA'",
108
+ },
109
+ action: { type: 'graphflow', name: 'fetch_data' } as any,
110
+ });
111
+
112
+ net.addTransition({
113
+ id: 'do_process',
114
+ from: ['idle'],
115
+ to: 'processing',
116
+ guard: {
117
+ type: 'deterministic',
118
+ condition: "context.intent === 'PROCESS_DATA'",
119
+ },
120
+ action: { type: 'graphflow', name: 'process_data' } as any,
121
+ });
122
+
123
+ net.addTransition({ id: 'fetch_to_done', from: ['fetching'], to: 'done' });
124
+ net.addTransition({ id: 'process_to_done', from: ['processing'], to: 'done' });
125
+ }
126
+
127
+ async function testMultiIntents(orchestrator: CortexFlowOrchestrator, sessionId: string) {
128
+ console.log('\n=== TEST 1: Multi-intents ===');
129
+ const message = 'Récupère les données et traite-les';
130
+ console.log(`Message: "${message}"`);
131
+
132
+ const result = await orchestrator.orchestrate(message, sessionId);
133
+ console.log('Intent principal:', result.intent.intent);
134
+ console.log('Confiance:', result.intent.confidence);
135
+ console.log('Multi-intents détectés:', result.intent.intents ? result.intent.intents.map(i => i.intent) : 'aucun');
136
+ console.log('Transition exécutée:', result.transitionResult?.transitionId);
137
+ }
138
+
139
+ async function testSingleIntent(orchestrator: CortexFlowOrchestrator, sessionId: string) {
140
+ console.log('\n=== TEST 2: Single intent ===');
141
+ const message = 'Récupère les données';
142
+ console.log(`Message: "${message}"`);
143
+
144
+ const result = await orchestrator.orchestrate(message, sessionId);
145
+ console.log('Intent:', result.intent.intent);
146
+ console.log('Confiance:', result.intent.confidence);
147
+ console.log('Transition exécutée:', result.transitionResult?.transitionId);
148
+ }
149
+
150
+ async function testFallbackMode(orchestrator: CortexFlowOrchestrator, sessionId: string) {
151
+ console.log('\n=== TEST 3: Fallback Mode (confiance faible) ===');
152
+ const message = 'fais un truc au hasard s\'il te plaît';
153
+ console.log(`Message: "${message}"`);
154
+
155
+ orchestrator.setFallbackLLM(async (message: string, session: any) => {
156
+ console.log(' [Fallback] Message reçu:', message);
157
+ return {
158
+ response: 'Je suis en mode fallback. Je ne peux pas traiter cette demande.',
159
+ shouldReenterPetri: false,
160
+ };
161
+ });
162
+
163
+ const result = await orchestrator.orchestrate(message, sessionId);
164
+ console.log('Intent:', result.intent.intent, '(attendu: UNKNOWN)');
165
+ console.log('Fallback response:', result.fallbackResponse?.substring(0, 60));
166
+ }
167
+
168
+ async function testJsonPattern() {
169
+ console.log('\n=== TEST 4: Chargement pattern JSON ===');
170
+ const patternPath = path.join(__dirname, 'petri', 'patterns', 'human-approval.json');
171
+ const pattern = JSON.parse(fs.readFileSync(patternPath, 'utf-8'));
172
+
173
+ console.log(`Pattern: ${pattern.name}`);
174
+ console.log(`Description: ${pattern.description}`);
175
+ console.log(`Places: ${pattern.places.length}, Transitions: ${pattern.transitions.length}`);
176
+ console.log('✅ Pattern JSON valide');
177
+ }
178
+
179
+ async function main() {
180
+ console.log('🚀 Tests des nouvelles fonctionnalités Petri\n');
181
+
182
+ if (!GROQ_API_KEY) {
183
+ console.error('❌ GROQ_API_KEY manquant');
184
+ return;
185
+ }
186
+
187
+ const registry = createTestTools();
188
+ const orchestrator = new CortexFlowOrchestrator('test', registry);
189
+ orchestrator.setLLMCall(groqCall);
190
+ setupPetriNet(orchestrator);
191
+
192
+ const classifier = new IntentClassifier(groqCall, {
193
+ intents: ['FETCH_DATA', 'PROCESS_DATA', 'UNKNOWN'],
194
+ confidenceThreshold: 0.6,
195
+ });
196
+ orchestrator.setIntentClassifier(IntentClassifier.toFn(classifier), classifier);
197
+ orchestrator.setConfidenceThreshold(0.6);
198
+
199
+ const sessionId = orchestrator.startSession();
200
+
201
+ try {
202
+ await testMultiIntents(orchestrator, sessionId);
203
+ await testSingleIntent(orchestrator, sessionId + '_2');
204
+ await testFallbackMode(orchestrator, sessionId + '_fallback');
205
+ await testJsonPattern();
206
+
207
+ console.log('\n✅ Tests terminés avec succès!');
208
+ console.log('\nFonctionnalités implémentées:');
209
+ console.log('1. ✅ Mode hybride/échappatoire (fallback LLM)');
210
+ console.log('2. ✅ Classifieur multi-intents');
211
+ console.log('3. ✅ Patterns prêts à l\'emploi (JSON)');
212
+ console.log('4. ✅ Adapters de persistance (Redis + Postgres)');
213
+ } catch (error) {
214
+ console.error('\n❌ Erreur:', error);
215
+ }
216
+ }
217
+
218
+ main();
@@ -0,0 +1,163 @@
1
+ import * as fs from "fs";
2
+ import * as path from "path";
3
+
4
+ const envPath = path.resolve(__dirname, ".env");
5
+ if (fs.existsSync(envPath)) {
6
+ for (const line of fs.readFileSync(envPath, "utf-8").split("\n")) {
7
+ const t = line.trim();
8
+ if (!t || t.startsWith("#")) continue;
9
+ const eq = t.indexOf("=");
10
+ if (eq === -1) continue;
11
+ const k = t.slice(0, eq).trim();
12
+ const v = t.slice(eq + 1).trim();
13
+ if (k && !process.env[k]) process.env[k] = v;
14
+ }
15
+ }
16
+
17
+ import { AgentPipeline, priceZone } from "./pipeline/agent-pipeline";
18
+
19
+ // ============================================
20
+ // USE CASE 1: Simple 2-stage pipeline (no human gate)
21
+ // ============================================
22
+ async function testSimplePipeline() {
23
+ console.log("\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
24
+ console.log(" USE CASE 1: Simple 2-stage pipeline (auto)");
25
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
26
+
27
+ const pipeline = new AgentPipeline({
28
+ name: "simple-analysis",
29
+ trigger: priceZone("BTC", 78000, 79000),
30
+ stages: [
31
+ {
32
+ id: "fetch",
33
+ run: async (ctx) => {
34
+ console.log(` [fetch] Fetching data for ${ctx.asset}...`);
35
+ await new Promise(r => setTimeout(r, 500));
36
+ return { price: 78500, volume: 1000 };
37
+ },
38
+ },
39
+ {
40
+ id: "analyze",
41
+ run: async (ctx) => {
42
+ console.log(` [analyze] Analyzing price $${ctx.price}...`);
43
+ await new Promise(r => setTimeout(r, 500));
44
+ return { signal: "BUY", confidence: 0.85 };
45
+ },
46
+ },
47
+ ],
48
+ gate: "auto",
49
+ onApprove: async (ctx) => {
50
+ console.log(` [execute] Signal: ${ctx.signal} @ $${ctx.price}`);
51
+ },
52
+ });
53
+
54
+ console.log(`Initial place: ${pipeline.getPlace()}`);
55
+ console.log("Pipeline created with auto gate (no human approval needed)\n");
56
+ }
57
+
58
+ // ============================================
59
+ // USE CASE 2: Pipeline with human approval
60
+ // ============================================
61
+ async function testHumanGatePipeline() {
62
+ console.log("\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
63
+ console.log(" USE CASE 2: Pipeline with human gate");
64
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
65
+
66
+ const pipeline = new AgentPipeline({
67
+ name: "trading-approval",
68
+ trigger: priceZone("ETH", 2300, 2400),
69
+ stages: [
70
+ {
71
+ id: "alpha",
72
+ run: async (ctx) => {
73
+ console.log(` [@Alpha] Analyzing ${ctx.asset}...`);
74
+ return { signal: "BUY", confidence: 80, entryPrice: 2350 };
75
+ },
76
+ },
77
+ {
78
+ id: "guardian",
79
+ run: async (ctx) => {
80
+ console.log(` [@Guardian] Auditing...`);
81
+ return { verdict: "ACCEPTABLE", score: 5 };
82
+ },
83
+ },
84
+ {
85
+ id: "oracle",
86
+ run: async (ctx) => {
87
+ console.log(` [@Oracle] Deciding...`);
88
+ return { decision: "EXECUTE", action: { side: "BUY", sizeUsd: 50 } };
89
+ },
90
+ },
91
+ ],
92
+ gate: "human",
93
+ onApprove: async (ctx) => {
94
+ console.log(` ✓ Human approved! Executing trade: ${ctx.decision}`);
95
+ console.log(` → ${ctx.action.side} $${ctx.action.sizeUsd}`);
96
+ },
97
+ });
98
+
99
+ console.log(`Initial place: ${pipeline.getPlace()}`);
100
+ console.log("Pipeline created with human gate\n");
101
+ }
102
+
103
+ // ============================================
104
+ // USE CASE 3: Pipeline with conditional logic
105
+ // ============================================
106
+ async function testConditionalPipeline() {
107
+ console.log("\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
108
+ console.log(" USE CASE 3: Pipeline with conditional execution");
109
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
110
+
111
+ const pipeline = new AgentPipeline({
112
+ name: "conditional-trade",
113
+ trigger: priceZone("SOL", 100, 120),
114
+ stages: [
115
+ {
116
+ id: "analyze",
117
+ run: async (ctx) => {
118
+ console.log(` [analyze] Checking market conditions...`);
119
+ const shouldTrade = ctx.price > 110;
120
+ return { shouldTrade, signal: shouldTrade ? "BUY" : "WAIT" };
121
+ },
122
+ },
123
+ {
124
+ id: "execute_if_approved",
125
+ run: async (ctx) => {
126
+ if (!ctx.shouldTrade) {
127
+ console.log(` [skip] Conditions not met, skipping trade`);
128
+ return { skipped: true };
129
+ }
130
+ console.log(` [execute] Placing trade...`);
131
+ return { executed: true, orderId: "12345" };
132
+ },
133
+ },
134
+ ],
135
+ gate: "auto",
136
+ });
137
+
138
+ console.log("Pipeline with conditional logic created");
139
+ console.log("Stage 2 checks ctx.shouldTrade before executing\n");
140
+ }
141
+
142
+ // ============================================
143
+ // Run all use cases
144
+ // ============================================
145
+ async function main() {
146
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
147
+ console.log(" AgentPipeline API — Multiple Use Cases");
148
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
149
+
150
+ await testSimplePipeline();
151
+ await testHumanGatePipeline();
152
+ await testConditionalPipeline();
153
+
154
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
155
+ console.log(" All use cases defined successfully!");
156
+ console.log(" User never sees Petri net, transitions, or fireTransition()");
157
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
158
+ }
159
+
160
+ main().catch((e) => {
161
+ console.error("Error:", e);
162
+ process.exit(1);
163
+ });
package/tsconfig.json CHANGED
@@ -1,112 +1,34 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "target": "es2016",
4
+ "module": "commonjs",
5
+ "declaration": true,
6
+ "declarationMap": true,
7
+ "sourceMap": true,
8
+ "esModuleInterop": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "strict": true,
11
+ "skipLibCheck": true,
12
+ "baseUrl": ".",
3
13
  "outDir": "./dist",
4
- /* Visit https://aka.ms/tsconfig to read more about this file */
5
-
6
- /* Projects */
7
- // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
8
- // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
9
- // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
10
- // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
11
- // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
12
- // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
13
-
14
- /* Language and Environment */
15
- "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
16
- // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
17
- // "jsx": "preserve", /* Specify what JSX code is generated. */
18
- // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
19
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
20
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
21
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
22
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
23
- // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
24
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
25
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
26
- // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
27
-
28
- /* Modules */
29
- "module": "commonjs" /* Specify what module code is generated. */,
30
- // "rootDir": "./", /* Specify the root folder within your source files. */
31
- // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
32
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
33
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
34
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
35
- // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
36
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
37
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
38
- // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
39
- // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
40
- // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
41
- // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
42
- // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
43
- // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
44
- // "noUncheckedSideEffectImports": true, /* Check side effect imports. */
45
- // "resolveJsonModule": true, /* Enable importing .json files. */
46
- // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
47
- // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
48
-
49
- /* JavaScript Support */
50
- // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
51
- // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
52
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
53
-
54
- /* Emit */
55
- // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
56
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
57
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
58
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
59
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
60
- // "noEmit": true, /* Disable emitting files from a compilation. */
61
- // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
62
- // "outDir": "./", /* Specify an output folder for all emitted files. */
63
- // "removeComments": true, /* Disable emitting comments. */
64
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
65
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
66
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
67
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
68
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
69
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
70
- // "newLine": "crlf", /* Set the newline character for emitting files. */
71
- // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
72
- // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
73
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
74
- // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
75
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
76
-
77
- /* Interop Constraints */
78
- // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
79
- // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
80
- // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
81
- // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
82
- "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
83
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
84
- "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
85
-
86
- /* Type Checking */
87
- "strict": true /* Enable all strict type-checking options. */,
88
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
89
- // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
90
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
91
- // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
92
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
93
- // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
94
- // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
95
- // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
96
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
97
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
98
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
99
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
100
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
101
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
102
- // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
103
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
104
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
105
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
106
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
107
-
108
- /* Completeness */
109
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
110
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
111
- }
14
+ "types": ["node", "mocha"],
15
+ "resolveJsonModule": true,
16
+ "paths": {
17
+ "@/*": ["./*"]
18
+ },
19
+ "jsx": "preserve",
20
+ "lib": ["dom", "dom.iterable", "esnext"]
21
+ },
22
+ "include": [
23
+ "index.ts",
24
+ "modules/**/*",
25
+ "execution/**/*",
26
+ "routing/**/*",
27
+ "agent/**/*",
28
+ "persistence/**/*",
29
+ "types/**/*",
30
+ "interfaces/**/*",
31
+ "utils/**/*"
32
+ ],
33
+ "exclude": ["node_modules", "dist", "test", "examples", "routing/web-server.ts"]
112
34
  }