@carlonicora/nestjs-neo4jsonapi 1.63.0 → 1.65.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 (288) hide show
  1. package/dist/agents/agents.modules.js +3 -3
  2. package/dist/agents/agents.modules.js.map +1 -1
  3. package/dist/agents/graph/graph.module.d.ts +3 -0
  4. package/dist/agents/graph/graph.module.d.ts.map +1 -0
  5. package/dist/agents/{chatbot/chatbot.module.js → graph/graph.module.js} +12 -16
  6. package/dist/agents/graph/graph.module.js.map +1 -0
  7. package/dist/agents/{chatbot → graph}/interfaces/graph.catalog.interface.d.ts +4 -0
  8. package/dist/agents/graph/interfaces/graph.catalog.interface.d.ts.map +1 -0
  9. package/dist/agents/graph/interfaces/graph.catalog.interface.js.map +1 -0
  10. package/dist/agents/graph/interfaces/graph.node.output.interface.d.ts +30 -0
  11. package/dist/agents/graph/interfaces/graph.node.output.interface.d.ts.map +1 -0
  12. package/dist/agents/graph/interfaces/graph.node.output.interface.js +3 -0
  13. package/dist/agents/graph/interfaces/graph.node.output.interface.js.map +1 -0
  14. package/dist/agents/graph/prompts/graph.node.system.prompt.d.ts +3 -0
  15. package/dist/agents/graph/prompts/graph.node.system.prompt.d.ts.map +1 -0
  16. package/dist/agents/graph/prompts/graph.node.system.prompt.js +66 -0
  17. package/dist/agents/graph/prompts/graph.node.system.prompt.js.map +1 -0
  18. package/dist/agents/graph/repositories/user-modules.repository.d.ts.map +1 -0
  19. package/dist/agents/graph/repositories/user-modules.repository.js.map +1 -0
  20. package/dist/agents/{chatbot → graph}/services/descriptor.source.d.ts +2 -0
  21. package/dist/agents/graph/services/descriptor.source.d.ts.map +1 -0
  22. package/dist/agents/{chatbot → graph}/services/descriptor.source.js +18 -3
  23. package/dist/agents/graph/services/descriptor.source.js.map +1 -0
  24. package/dist/agents/graph/services/field-formatting.d.ts.map +1 -0
  25. package/dist/agents/graph/services/field-formatting.js.map +1 -0
  26. package/dist/agents/{chatbot → graph}/services/graph.catalog.service.d.ts +16 -0
  27. package/dist/agents/graph/services/graph.catalog.service.d.ts.map +1 -0
  28. package/dist/agents/{chatbot → graph}/services/graph.catalog.service.js +63 -1
  29. package/dist/agents/graph/services/graph.catalog.service.js.map +1 -0
  30. package/dist/agents/{chatbot/services/chatbot.index.manager.d.ts → graph/services/graph.index.manager.d.ts} +2 -2
  31. package/dist/agents/graph/services/graph.index.manager.d.ts.map +1 -0
  32. package/dist/agents/{chatbot/services/chatbot.index.manager.js → graph/services/graph.index.manager.js} +9 -9
  33. package/dist/agents/graph/services/graph.index.manager.js.map +1 -0
  34. package/dist/agents/graph/services/graph.search.service.d.ts +69 -0
  35. package/dist/agents/graph/services/graph.search.service.d.ts.map +1 -0
  36. package/dist/agents/graph/services/graph.search.service.js +230 -0
  37. package/dist/agents/graph/services/graph.search.service.js.map +1 -0
  38. package/dist/agents/graph/services/humanize-tool.d.ts.map +1 -0
  39. package/dist/agents/graph/services/humanize-tool.js.map +1 -0
  40. package/dist/agents/graph/services/materialise-bridge.d.ts +36 -0
  41. package/dist/agents/graph/services/materialise-bridge.d.ts.map +1 -0
  42. package/dist/agents/graph/services/materialise-bridge.js +69 -0
  43. package/dist/agents/graph/services/materialise-bridge.js.map +1 -0
  44. package/dist/agents/graph/tools/describe-entity.tool.d.ts.map +1 -0
  45. package/dist/agents/{chatbot → graph}/tools/describe-entity.tool.js +1 -0
  46. package/dist/agents/graph/tools/describe-entity.tool.js.map +1 -0
  47. package/dist/agents/{chatbot → graph}/tools/read-entity.tool.d.ts +5 -1
  48. package/dist/agents/graph/tools/read-entity.tool.d.ts.map +1 -0
  49. package/dist/agents/{chatbot → graph}/tools/read-entity.tool.js +37 -8
  50. package/dist/agents/graph/tools/read-entity.tool.js.map +1 -0
  51. package/dist/agents/{chatbot → graph}/tools/resolve-entity.tool.d.ts +2 -2
  52. package/dist/agents/graph/tools/resolve-entity.tool.d.ts.map +1 -0
  53. package/dist/agents/{chatbot → graph}/tools/resolve-entity.tool.js +2 -2
  54. package/dist/agents/graph/tools/resolve-entity.tool.js.map +1 -0
  55. package/dist/agents/{chatbot → graph}/tools/search-entities.tool.d.ts +6 -2
  56. package/dist/agents/graph/tools/search-entities.tool.d.ts.map +1 -0
  57. package/dist/agents/{chatbot → graph}/tools/search-entities.tool.js +36 -12
  58. package/dist/agents/graph/tools/search-entities.tool.js.map +1 -0
  59. package/dist/agents/{chatbot → graph}/tools/tool.factory.d.ts +7 -0
  60. package/dist/agents/graph/tools/tool.factory.d.ts.map +1 -0
  61. package/dist/agents/{chatbot → graph}/tools/tool.factory.js +57 -3
  62. package/dist/agents/graph/tools/tool.factory.js.map +1 -0
  63. package/dist/agents/{chatbot → graph}/tools/traverse.tool.d.ts +5 -1
  64. package/dist/agents/graph/tools/traverse.tool.d.ts.map +1 -0
  65. package/dist/agents/{chatbot → graph}/tools/traverse.tool.js +38 -15
  66. package/dist/agents/graph/tools/traverse.tool.js.map +1 -0
  67. package/dist/agents/index.d.ts +6 -9
  68. package/dist/agents/index.d.ts.map +1 -1
  69. package/dist/agents/index.js +13 -15
  70. package/dist/agents/index.js.map +1 -1
  71. package/dist/agents/responder/contexts/responder.context.d.ts +75 -1
  72. package/dist/agents/responder/contexts/responder.context.d.ts.map +1 -1
  73. package/dist/agents/responder/contexts/responder.context.js +29 -4
  74. package/dist/agents/responder/contexts/responder.context.js.map +1 -1
  75. package/dist/agents/responder/factories/responder.context.factory.d.ts +4 -5
  76. package/dist/agents/responder/factories/responder.context.factory.d.ts.map +1 -1
  77. package/dist/agents/responder/factories/responder.context.factory.js +28 -8
  78. package/dist/agents/responder/factories/responder.context.factory.js.map +1 -1
  79. package/dist/agents/responder/interfaces/entity.reference.interface.d.ts +7 -0
  80. package/dist/agents/responder/interfaces/entity.reference.interface.d.ts.map +1 -0
  81. package/dist/agents/{chatbot/interfaces/chatbot.response.interface.js → responder/interfaces/entity.reference.interface.js} +1 -1
  82. package/dist/agents/responder/interfaces/entity.reference.interface.js.map +1 -0
  83. package/dist/agents/responder/interfaces/responder.response.interface.d.ts +12 -3
  84. package/dist/agents/responder/interfaces/responder.response.interface.d.ts.map +1 -1
  85. package/dist/agents/responder/interfaces/unified.trace.interface.d.ts +64 -0
  86. package/dist/agents/responder/interfaces/unified.trace.interface.d.ts.map +1 -0
  87. package/dist/agents/responder/interfaces/unified.trace.interface.js +3 -0
  88. package/dist/agents/responder/interfaces/unified.trace.interface.js.map +1 -0
  89. package/dist/agents/responder/nodes/graph.node.service.d.ts +31 -0
  90. package/dist/agents/responder/nodes/graph.node.service.d.ts.map +1 -0
  91. package/dist/agents/responder/nodes/graph.node.service.js +319 -0
  92. package/dist/agents/responder/nodes/graph.node.service.js.map +1 -0
  93. package/dist/agents/responder/nodes/planner.node.service.d.ts +14 -0
  94. package/dist/agents/responder/nodes/planner.node.service.d.ts.map +1 -0
  95. package/dist/agents/responder/nodes/planner.node.service.js +121 -0
  96. package/dist/agents/responder/nodes/planner.node.service.js.map +1 -0
  97. package/dist/agents/responder/nodes/responder.answer.node.service.d.ts +5 -23
  98. package/dist/agents/responder/nodes/responder.answer.node.service.d.ts.map +1 -1
  99. package/dist/agents/responder/nodes/responder.answer.node.service.js +257 -432
  100. package/dist/agents/responder/nodes/responder.answer.node.service.js.map +1 -1
  101. package/dist/agents/responder/responder.module.d.ts.map +1 -1
  102. package/dist/agents/responder/responder.module.js +12 -3
  103. package/dist/agents/responder/responder.module.js.map +1 -1
  104. package/dist/agents/responder/services/responder.service.d.ts +15 -22
  105. package/dist/agents/responder/services/responder.service.d.ts.map +1 -1
  106. package/dist/agents/responder/services/responder.service.js +116 -89
  107. package/dist/agents/responder/services/responder.service.js.map +1 -1
  108. package/dist/bootstrap/bootstrap.options.d.ts +7 -0
  109. package/dist/bootstrap/bootstrap.options.d.ts.map +1 -1
  110. package/dist/common/helpers/define-entity.d.ts.map +1 -1
  111. package/dist/common/helpers/define-entity.js +16 -1
  112. package/dist/common/helpers/define-entity.js.map +1 -1
  113. package/dist/common/interfaces/entity.schema.interface.d.ts +15 -0
  114. package/dist/common/interfaces/entity.schema.interface.d.ts.map +1 -1
  115. package/dist/core/llm/interfaces/llm-call-metadata.interface.d.ts +19 -0
  116. package/dist/core/llm/interfaces/llm-call-metadata.interface.d.ts.map +1 -0
  117. package/dist/core/llm/interfaces/llm-call-metadata.interface.js +3 -0
  118. package/dist/core/llm/interfaces/llm-call-metadata.interface.js.map +1 -0
  119. package/dist/core/llm/llm.module.d.ts +1 -0
  120. package/dist/core/llm/llm.module.d.ts.map +1 -1
  121. package/dist/core/llm/llm.module.js +3 -1
  122. package/dist/core/llm/llm.module.js.map +1 -1
  123. package/dist/core/llm/services/llm-call-dumper.service.d.ts +64 -0
  124. package/dist/core/llm/services/llm-call-dumper.service.d.ts.map +1 -0
  125. package/dist/core/llm/services/llm-call-dumper.service.js +204 -0
  126. package/dist/core/llm/services/llm-call-dumper.service.js.map +1 -0
  127. package/dist/core/llm/services/llm.service.d.ts +4 -1
  128. package/dist/core/llm/services/llm.service.d.ts.map +1 -1
  129. package/dist/core/llm/services/llm.service.js +304 -220
  130. package/dist/core/llm/services/llm.service.js.map +1 -1
  131. package/dist/foundations/assistant/assistant.module.d.ts.map +1 -1
  132. package/dist/foundations/assistant/assistant.module.js +3 -2
  133. package/dist/foundations/assistant/assistant.module.js.map +1 -1
  134. package/dist/foundations/assistant/entities/assistant.d.ts +15 -16
  135. package/dist/foundations/assistant/entities/assistant.d.ts.map +1 -1
  136. package/dist/foundations/assistant/entities/assistant.js +21 -9
  137. package/dist/foundations/assistant/entities/assistant.js.map +1 -1
  138. package/dist/foundations/assistant/repositories/assistant.repository.d.ts +13 -0
  139. package/dist/foundations/assistant/repositories/assistant.repository.d.ts.map +1 -1
  140. package/dist/foundations/assistant/services/assistant.service.d.ts +35 -10
  141. package/dist/foundations/assistant/services/assistant.service.d.ts.map +1 -1
  142. package/dist/foundations/assistant/services/assistant.service.js +132 -17
  143. package/dist/foundations/assistant/services/assistant.service.js.map +1 -1
  144. package/dist/foundations/assistant-message/entities/assistant-message.d.ts +30 -10
  145. package/dist/foundations/assistant-message/entities/assistant-message.d.ts.map +1 -1
  146. package/dist/foundations/assistant-message/entities/assistant-message.js +19 -4
  147. package/dist/foundations/assistant-message/entities/assistant-message.js.map +1 -1
  148. package/dist/foundations/assistant-message/repositories/assistant-message.repository.d.ts +53 -4
  149. package/dist/foundations/assistant-message/repositories/assistant-message.repository.d.ts.map +1 -1
  150. package/dist/foundations/assistant-message/repositories/assistant-message.repository.js +43 -3
  151. package/dist/foundations/assistant-message/repositories/assistant-message.repository.js.map +1 -1
  152. package/dist/foundations/assistant-message/services/assistant-message.service.d.ts +26 -0
  153. package/dist/foundations/assistant-message/services/assistant-message.service.d.ts.map +1 -1
  154. package/dist/foundations/chunk/chunk.module.d.ts.map +1 -1
  155. package/dist/foundations/chunk/chunk.module.js +4 -5
  156. package/dist/foundations/chunk/chunk.module.js.map +1 -1
  157. package/dist/foundations/chunk/entities/chunk.entity.d.ts +19 -4
  158. package/dist/foundations/chunk/entities/chunk.entity.d.ts.map +1 -1
  159. package/dist/foundations/chunk/entities/chunk.entity.js +48 -0
  160. package/dist/foundations/chunk/entities/chunk.entity.js.map +1 -1
  161. package/dist/foundations/chunk/index.d.ts +1 -2
  162. package/dist/foundations/chunk/index.d.ts.map +1 -1
  163. package/dist/foundations/chunk/index.js +3 -3
  164. package/dist/foundations/chunk/index.js.map +1 -1
  165. package/dist/foundations/chunk/repositories/chunk.repository.d.ts.map +1 -1
  166. package/dist/foundations/chunk/repositories/chunk.repository.js +8 -8
  167. package/dist/foundations/chunk/repositories/chunk.repository.js.map +1 -1
  168. package/dist/foundations/chunk/services/chunk.service.d.ts.map +1 -1
  169. package/dist/foundations/chunk/services/chunk.service.js +2 -2
  170. package/dist/foundations/chunk/services/chunk.service.js.map +1 -1
  171. package/dist/foundations/rbac/controllers/rbac-dev.controller.d.ts +50 -0
  172. package/dist/foundations/rbac/controllers/rbac-dev.controller.d.ts.map +1 -0
  173. package/dist/foundations/rbac/controllers/rbac-dev.controller.js +172 -0
  174. package/dist/foundations/rbac/controllers/rbac-dev.controller.js.map +1 -0
  175. package/dist/foundations/rbac/dsl/define-rbac.d.ts +15 -0
  176. package/dist/foundations/rbac/dsl/define-rbac.d.ts.map +1 -0
  177. package/dist/foundations/rbac/dsl/define-rbac.js +19 -0
  178. package/dist/foundations/rbac/dsl/define-rbac.js.map +1 -0
  179. package/dist/foundations/rbac/dsl/index.d.ts +6 -0
  180. package/dist/foundations/rbac/dsl/index.d.ts.map +1 -0
  181. package/dist/foundations/rbac/dsl/index.js +30 -0
  182. package/dist/foundations/rbac/dsl/index.js.map +1 -0
  183. package/dist/foundations/rbac/dsl/perm.d.ts +15 -0
  184. package/dist/foundations/rbac/dsl/perm.d.ts.map +1 -0
  185. package/dist/foundations/rbac/dsl/perm.js +24 -0
  186. package/dist/foundations/rbac/dsl/perm.js.map +1 -0
  187. package/dist/foundations/rbac/dsl/resolver.d.ts +24 -0
  188. package/dist/foundations/rbac/dsl/resolver.d.ts.map +1 -0
  189. package/dist/foundations/rbac/dsl/resolver.js +55 -0
  190. package/dist/foundations/rbac/dsl/resolver.js.map +1 -0
  191. package/dist/foundations/rbac/dsl/to-permissions-json.d.ts +13 -0
  192. package/dist/foundations/rbac/dsl/to-permissions-json.d.ts.map +1 -0
  193. package/dist/foundations/rbac/dsl/to-permissions-json.js +43 -0
  194. package/dist/foundations/rbac/dsl/to-permissions-json.js.map +1 -0
  195. package/dist/foundations/rbac/dsl/types.d.ts +55 -0
  196. package/dist/foundations/rbac/dsl/types.d.ts.map +1 -0
  197. package/dist/foundations/rbac/dsl/types.js +6 -0
  198. package/dist/foundations/rbac/dsl/types.js.map +1 -0
  199. package/dist/foundations/rbac/dump.d.ts +116 -0
  200. package/dist/foundations/rbac/dump.d.ts.map +1 -0
  201. package/dist/foundations/rbac/dump.js +154 -0
  202. package/dist/foundations/rbac/dump.js.map +1 -0
  203. package/dist/foundations/rbac/index.d.ts +6 -0
  204. package/dist/foundations/rbac/index.d.ts.map +1 -1
  205. package/dist/foundations/rbac/index.js +23 -1
  206. package/dist/foundations/rbac/index.js.map +1 -1
  207. package/dist/foundations/rbac/rbac.module.d.ts +4 -1
  208. package/dist/foundations/rbac/rbac.module.d.ts.map +1 -1
  209. package/dist/foundations/rbac/rbac.module.js +25 -11
  210. package/dist/foundations/rbac/rbac.module.js.map +1 -1
  211. package/dist/foundations/rbac/rbac.tokens.d.ts +11 -0
  212. package/dist/foundations/rbac/rbac.tokens.d.ts.map +1 -0
  213. package/dist/foundations/rbac/rbac.tokens.js +14 -0
  214. package/dist/foundations/rbac/rbac.tokens.js.map +1 -0
  215. package/dist/foundations/rbac/serializer/matrix-to-ts.d.ts +13 -0
  216. package/dist/foundations/rbac/serializer/matrix-to-ts.d.ts.map +1 -0
  217. package/dist/foundations/rbac/serializer/matrix-to-ts.js +74 -0
  218. package/dist/foundations/rbac/serializer/matrix-to-ts.js.map +1 -0
  219. package/dist/foundations/rbac/services/rbac-reconciler.service.d.ts +30 -0
  220. package/dist/foundations/rbac/services/rbac-reconciler.service.d.ts.map +1 -0
  221. package/dist/foundations/rbac/services/rbac-reconciler.service.js +192 -0
  222. package/dist/foundations/rbac/services/rbac-reconciler.service.js.map +1 -0
  223. package/dist/tools/generate-rbac-paths/index.js +24 -19
  224. package/package.json +1 -1
  225. package/dist/agents/chatbot/chatbot.module.d.ts +0 -3
  226. package/dist/agents/chatbot/chatbot.module.d.ts.map +0 -1
  227. package/dist/agents/chatbot/chatbot.module.js.map +0 -1
  228. package/dist/agents/chatbot/interfaces/chatbot.response.interface.d.ts +0 -25
  229. package/dist/agents/chatbot/interfaces/chatbot.response.interface.d.ts.map +0 -1
  230. package/dist/agents/chatbot/interfaces/chatbot.response.interface.js.map +0 -1
  231. package/dist/agents/chatbot/interfaces/graph.catalog.interface.d.ts.map +0 -1
  232. package/dist/agents/chatbot/interfaces/graph.catalog.interface.js.map +0 -1
  233. package/dist/agents/chatbot/prompts/chatbot.system.prompt.d.ts +0 -3
  234. package/dist/agents/chatbot/prompts/chatbot.system.prompt.d.ts.map +0 -1
  235. package/dist/agents/chatbot/prompts/chatbot.system.prompt.js +0 -60
  236. package/dist/agents/chatbot/prompts/chatbot.system.prompt.js.map +0 -1
  237. package/dist/agents/chatbot/repositories/user-modules.repository.d.ts.map +0 -1
  238. package/dist/agents/chatbot/repositories/user-modules.repository.js.map +0 -1
  239. package/dist/agents/chatbot/services/chatbot.index.manager.d.ts.map +0 -1
  240. package/dist/agents/chatbot/services/chatbot.index.manager.js.map +0 -1
  241. package/dist/agents/chatbot/services/chatbot.search.service.d.ts +0 -46
  242. package/dist/agents/chatbot/services/chatbot.search.service.d.ts.map +0 -1
  243. package/dist/agents/chatbot/services/chatbot.search.service.js +0 -148
  244. package/dist/agents/chatbot/services/chatbot.search.service.js.map +0 -1
  245. package/dist/agents/chatbot/services/chatbot.service.d.ts +0 -36
  246. package/dist/agents/chatbot/services/chatbot.service.d.ts.map +0 -1
  247. package/dist/agents/chatbot/services/chatbot.service.js +0 -220
  248. package/dist/agents/chatbot/services/chatbot.service.js.map +0 -1
  249. package/dist/agents/chatbot/services/descriptor.source.d.ts.map +0 -1
  250. package/dist/agents/chatbot/services/descriptor.source.js.map +0 -1
  251. package/dist/agents/chatbot/services/field-formatting.d.ts.map +0 -1
  252. package/dist/agents/chatbot/services/field-formatting.js.map +0 -1
  253. package/dist/agents/chatbot/services/graph.catalog.service.d.ts.map +0 -1
  254. package/dist/agents/chatbot/services/graph.catalog.service.js.map +0 -1
  255. package/dist/agents/chatbot/services/humanize-tool.d.ts.map +0 -1
  256. package/dist/agents/chatbot/services/humanize-tool.js.map +0 -1
  257. package/dist/agents/chatbot/tools/describe-entity.tool.d.ts.map +0 -1
  258. package/dist/agents/chatbot/tools/describe-entity.tool.js.map +0 -1
  259. package/dist/agents/chatbot/tools/read-entity.tool.d.ts.map +0 -1
  260. package/dist/agents/chatbot/tools/read-entity.tool.js.map +0 -1
  261. package/dist/agents/chatbot/tools/resolve-entity.tool.d.ts.map +0 -1
  262. package/dist/agents/chatbot/tools/resolve-entity.tool.js.map +0 -1
  263. package/dist/agents/chatbot/tools/search-entities.tool.d.ts.map +0 -1
  264. package/dist/agents/chatbot/tools/search-entities.tool.js.map +0 -1
  265. package/dist/agents/chatbot/tools/tool.factory.d.ts.map +0 -1
  266. package/dist/agents/chatbot/tools/tool.factory.js.map +0 -1
  267. package/dist/agents/chatbot/tools/traverse.tool.d.ts.map +0 -1
  268. package/dist/agents/chatbot/tools/traverse.tool.js.map +0 -1
  269. package/dist/foundations/chunk/entities/chunk.map.d.ts +0 -8
  270. package/dist/foundations/chunk/entities/chunk.map.d.ts.map +0 -1
  271. package/dist/foundations/chunk/entities/chunk.map.js +0 -31
  272. package/dist/foundations/chunk/entities/chunk.map.js.map +0 -1
  273. package/dist/foundations/chunk/entities/chunk.model.d.ts +0 -4
  274. package/dist/foundations/chunk/entities/chunk.model.d.ts.map +0 -1
  275. package/dist/foundations/chunk/entities/chunk.model.js +0 -13
  276. package/dist/foundations/chunk/entities/chunk.model.js.map +0 -1
  277. package/dist/foundations/chunk/serialisers/chunk.serialiser.d.ts +0 -14
  278. package/dist/foundations/chunk/serialisers/chunk.serialiser.d.ts.map +0 -1
  279. package/dist/foundations/chunk/serialisers/chunk.serialiser.js +0 -54
  280. package/dist/foundations/chunk/serialisers/chunk.serialiser.js.map +0 -1
  281. /package/dist/agents/{chatbot → graph}/interfaces/graph.catalog.interface.js +0 -0
  282. /package/dist/agents/{chatbot → graph}/repositories/user-modules.repository.d.ts +0 -0
  283. /package/dist/agents/{chatbot → graph}/repositories/user-modules.repository.js +0 -0
  284. /package/dist/agents/{chatbot → graph}/services/field-formatting.d.ts +0 -0
  285. /package/dist/agents/{chatbot → graph}/services/field-formatting.js +0 -0
  286. /package/dist/agents/{chatbot → graph}/services/humanize-tool.d.ts +0 -0
  287. /package/dist/agents/{chatbot → graph}/services/humanize-tool.js +0 -0
  288. /package/dist/agents/{chatbot → graph}/tools/describe-entity.tool.d.ts +0 -0
@@ -8,7 +8,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.AgentsModule = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
- const chatbot_module_1 = require("./chatbot/chatbot.module");
11
+ const graph_module_1 = require("./graph/graph.module");
12
12
  const community_detector_module_1 = require("./community.detector/community.detector.module");
13
13
  const community_summariser_module_1 = require("./community.summariser/community.summariser.module");
14
14
  const contextualiser_module_1 = require("./contextualiser/contextualiser.module");
@@ -27,7 +27,7 @@ exports.AgentsModule = AgentsModule;
27
27
  exports.AgentsModule = AgentsModule = __decorate([
28
28
  (0, common_1.Module)({
29
29
  imports: [
30
- chatbot_module_1.ChatbotModule,
30
+ graph_module_1.GraphModule,
31
31
  community_detector_module_1.CommunityDetectorModule,
32
32
  community_summariser_module_1.CommunitySummariserModule,
33
33
  contextualiser_module_1.ContextualiserModule,
@@ -37,7 +37,7 @@ exports.AgentsModule = AgentsModule = __decorate([
37
37
  summariser_module_1.SummariserModule,
38
38
  ],
39
39
  exports: [
40
- chatbot_module_1.ChatbotModule,
40
+ graph_module_1.GraphModule,
41
41
  community_detector_module_1.CommunityDetectorModule,
42
42
  community_summariser_module_1.CommunitySummariserModule,
43
43
  contextualiser_module_1.ContextualiserModule,
@@ -1 +1 @@
1
- {"version":3,"file":"agents.modules.js","sourceRoot":"","sources":["../../src/agents/agents.modules.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6DAAyD;AACzD,8FAAyF;AACzF,oGAA+F;AAC/F,kFAA8E;AAC9E,uDAAmD;AACnD,+EAA0E;AAC1E,mEAA+D;AAC/D,sEAAkE;AAElE;;;;GAIG;AAuBI,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IAtBxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,8BAAa;YACb,mDAAuB;YACvB,uDAAyB;YACzB,4CAAoB;YACpB,0BAAW;YACX,yCAAkB;YAClB,kCAAe;YACf,oCAAgB;SACjB;QACD,OAAO,EAAE;YACP,8BAAa;YACb,mDAAuB;YACvB,uDAAyB;YACzB,4CAAoB;YACpB,0BAAW;YACX,yCAAkB;YAClB,kCAAe;YACf,oCAAgB;SACjB;KACF,CAAC;GACW,YAAY,CAAG"}
1
+ {"version":3,"file":"agents.modules.js","sourceRoot":"","sources":["../../src/agents/agents.modules.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uDAAmD;AACnD,8FAAyF;AACzF,oGAA+F;AAC/F,kFAA8E;AAC9E,uDAAmD;AACnD,+EAA0E;AAC1E,mEAA+D;AAC/D,sEAAkE;AAElE;;;;GAIG;AAuBI,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IAtBxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,0BAAW;YACX,mDAAuB;YACvB,uDAAyB;YACzB,4CAAoB;YACpB,0BAAW;YACX,yCAAkB;YAClB,kCAAe;YACf,oCAAgB;SACjB;QACD,OAAO,EAAE;YACP,0BAAW;YACX,mDAAuB;YACvB,uDAAyB;YACzB,4CAAoB;YACpB,0BAAW;YACX,yCAAkB;YAClB,kCAAe;YACf,oCAAgB;SACjB;KACF,CAAC;GACW,YAAY,CAAG"}
@@ -0,0 +1,3 @@
1
+ export declare class GraphModule {
2
+ }
3
+ //# sourceMappingURL=graph.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.module.d.ts","sourceRoot":"","sources":["../../../src/agents/graph/graph.module.ts"],"names":[],"mappings":"AAeA,qBAgCa,WAAW;CAAG"}
@@ -6,13 +6,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.ChatbotModule = void 0;
9
+ exports.GraphModule = void 0;
10
+ // packages/nestjs-neo4jsonapi/src/agents/graph/graph.module.ts
10
11
  const common_1 = require("@nestjs/common");
11
12
  const llm_module_1 = require("../../core/llm/llm.module");
12
13
  const user_modules_repository_1 = require("./repositories/user-modules.repository");
13
- const chatbot_index_manager_1 = require("./services/chatbot.index.manager");
14
- const chatbot_search_service_1 = require("./services/chatbot.search.service");
15
- const chatbot_service_1 = require("./services/chatbot.service");
14
+ const graph_index_manager_1 = require("./services/graph.index.manager");
15
+ const graph_search_service_1 = require("./services/graph.search.service");
16
16
  const descriptor_source_1 = require("./services/descriptor.source");
17
17
  const graph_catalog_service_1 = require("./services/graph.catalog.service");
18
18
  const describe_entity_tool_1 = require("./tools/describe-entity.tool");
@@ -21,10 +21,10 @@ const resolve_entity_tool_1 = require("./tools/resolve-entity.tool");
21
21
  const search_entities_tool_1 = require("./tools/search-entities.tool");
22
22
  const tool_factory_1 = require("./tools/tool.factory");
23
23
  const traverse_tool_1 = require("./tools/traverse.tool");
24
- let ChatbotModule = class ChatbotModule {
24
+ let GraphModule = class GraphModule {
25
25
  };
26
- exports.ChatbotModule = ChatbotModule;
27
- exports.ChatbotModule = ChatbotModule = __decorate([
26
+ exports.GraphModule = GraphModule;
27
+ exports.GraphModule = GraphModule = __decorate([
28
28
  (0, common_1.Module)({
29
29
  imports: [llm_module_1.LLMModule],
30
30
  providers: [
@@ -41,14 +41,10 @@ exports.ChatbotModule = ChatbotModule = __decorate([
41
41
  read_entity_tool_1.ReadEntityTool,
42
42
  traverse_tool_1.TraverseTool,
43
43
  user_modules_repository_1.UserModulesRepository,
44
- chatbot_service_1.ChatbotService,
45
- // Per-label fulltext + vector index manager (fires once on module init)
46
- chatbot_index_manager_1.ChatbotIndexManager,
47
- // Cascading search: substring fulltext → Lucene fuzzy → semantic vector
48
- chatbot_search_service_1.ChatbotSearchService,
44
+ graph_index_manager_1.GraphIndexManager,
45
+ graph_search_service_1.GraphSearchService,
49
46
  ],
50
47
  exports: [
51
- chatbot_service_1.ChatbotService,
52
48
  descriptor_source_1.GraphDescriptorRegistry,
53
49
  graph_catalog_service_1.GraphCatalogService,
54
50
  user_modules_repository_1.UserModulesRepository,
@@ -58,8 +54,8 @@ exports.ChatbotModule = ChatbotModule = __decorate([
58
54
  search_entities_tool_1.SearchEntitiesTool,
59
55
  read_entity_tool_1.ReadEntityTool,
60
56
  traverse_tool_1.TraverseTool,
61
- chatbot_search_service_1.ChatbotSearchService,
57
+ graph_search_service_1.GraphSearchService,
62
58
  ],
63
59
  })
64
- ], ChatbotModule);
65
- //# sourceMappingURL=chatbot.module.js.map
60
+ ], GraphModule);
61
+ //# sourceMappingURL=graph.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.module.js","sourceRoot":"","sources":["../../../src/agents/graph/graph.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+DAA+D;AAC/D,2CAAwC;AACxC,0DAAsD;AACtD,oFAA+E;AAC/E,wEAAmE;AACnE,0EAAqE;AACrE,oEAAuE;AACvE,4EAAuE;AACvE,uEAAkE;AAClE,+DAA0D;AAC1D,qEAAgE;AAChE,uEAAkE;AAClE,uDAAmD;AACnD,yDAAqD;AAkC9C,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IAhCvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,sBAAS,CAAC;QACpB,SAAS,EAAE;YACT,2CAAuB;YACvB;gBACE,OAAO,EAAE,2CAAmB;gBAC5B,UAAU,EAAE,CAAC,GAA4B,EAAE,EAAE,CAAC,IAAI,2CAAmB,CAAC,GAAG,CAAC;gBAC1E,MAAM,EAAE,CAAC,2CAAuB,CAAC;aAClC;YACD,0BAAW;YACX,uCAAiB;YACjB,yCAAkB;YAClB,yCAAkB;YAClB,iCAAc;YACd,4BAAY;YACZ,+CAAqB;YACrB,uCAAiB;YACjB,yCAAkB;SACnB;QACD,OAAO,EAAE;YACP,2CAAuB;YACvB,2CAAmB;YACnB,+CAAqB;YACrB,0BAAW;YACX,uCAAiB;YACjB,yCAAkB;YAClB,yCAAkB;YAClB,iCAAc;YACd,4BAAY;YACZ,yCAAkB;SACnB;KACF,CAAC;GACW,WAAW,CAAG"}
@@ -46,5 +46,9 @@ export interface CatalogEntity {
46
46
  nodeName: string;
47
47
  /** Neo4j label name for tool-layer query construction. */
48
48
  labelName: string;
49
+ /** When set, the tool layer auto-materialises these relationships one hop on every read. */
50
+ bridge?: {
51
+ materialiseTo: string[];
52
+ };
49
53
  }
50
54
  //# sourceMappingURL=graph.catalog.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.catalog.interface.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/interfaces/graph.catalog.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AAE/E,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,eAAe,EAAE,KAAK,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,SAAS,EAAE,OAAO,CAAC;IACnB;;;yFAGqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,4FAA4F;IAC5F,MAAM,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CACtC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.catalog.interface.js","sourceRoot":"","sources":["../../../../src/agents/graph/interfaces/graph.catalog.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import type { ToolCallRecord } from "../tools/tool.factory";
2
+ export interface GraphNodeOutput {
3
+ /**
4
+ * Prose reply written by the graph LLM about the data it loaded.
5
+ * The downstream synthesizer treats this as authoritative graph content
6
+ * and weaves it into the unified user-facing answer. May be the empty
7
+ * string when the graph branch was skipped or failed.
8
+ */
9
+ answer: string;
10
+ entities: Array<{
11
+ type: string;
12
+ id: string;
13
+ reason: string;
14
+ foundAtHop: number;
15
+ /**
16
+ * Field values the graph LLM read about this entity that the synthesizer
17
+ * may need to quote (e.g. number, status, name, dates, totals). Optional —
18
+ * empty/missing means the entity was matched only as context.
19
+ */
20
+ fields?: Record<string, unknown>;
21
+ }>;
22
+ toolCalls: ToolCallRecord[];
23
+ tokens: {
24
+ input: number;
25
+ output: number;
26
+ };
27
+ status: "success" | "partial" | "failed" | "skipped_no_modules";
28
+ errorMessage?: string;
29
+ }
30
+ //# sourceMappingURL=graph.node.output.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.node.output.interface.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/interfaces/graph.node.output.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB;;;;WAIG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC,CAAC,CAAC;IACH,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,oBAAoB,CAAC;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=graph.node.output.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.node.output.interface.js","sourceRoot":"","sources":["../../../../src/agents/graph/interfaces/graph.node.output.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export declare const GRAPH_NODE_SYSTEM_PROMPT_BASE = "# Role\n\nYou help a user explore their company's ERP data. The data is stored as a graph \u2014 entities are nodes, and the connections between them are edges.\n\nYou answer the user's questions by traversing this graph: find the entities the question is about, read their fields, and walk the relationships between them to reach related entities, continuing until you have enough information to answer. Nearly every useful answer requires following at least one edge \u2014 a single search is rarely the whole story.\n\nEvery fact in your answer must come from a tool call that returned it. Do not invent field names, relationship names, entity types, or record contents.\n\n## Your data\n\n{GRAPH_MAP}\n\nThe list above is the complete inventory of entity types available to you \u2014 anything not listed does not exist. Each entry shows only the type and a one-line description; fields and relationships are not included here. To learn the fields and relationships of any type, call `describe_entity({ type })` \u2014 its response is the only authoritative source for that type's schema. Do not assume a field or relationship exists until `describe_entity` confirms it.\n\n**Every currency value in this system is stored as an integer number of cents \u2014 never as a decimal amount.** A stored value of `600` means 6.00, `500` means 5.00, and `1234567` means 12,345.67. Fields that carry money are marked `money` in the catalogue above (e.g. `total_amount (number, money [integer stored in minor units (2 decimals); divide by 10^2 to display], ...)`). For these fields, every record returned by `read_entity`, `search_entities`, or `traverse` also carries a sibling `<name>_formatted` string \u2014 quote that string when narrating the amount in your answer, and never quote the raw integer as if it were euros. Filters and sort still target the raw field (pass cents, e.g. `{ field: \"total_amount\", op: \"gt\", value: 10000 }` to mean \"over 100.00\").\n\n## Tools\n\nYou have five tools. Call them in sequence \u2014 a typical question needs two or three.\n\n**Never ask the user a clarifying question.** The user expects an answer, not a follow-up. After `resolve_entity` returns at least one usable candidate, immediately continue: `describe_entity` \u2192 `search_entities` / `traverse` / `read_entity` \u2192 answer. Do not stop the tool chain to confirm what to do next. If multiple candidates of different types could match (e.g. an Account and a Person both named \"Carlo\"), pick the one whose type and connected relationships best fit the user's question \u2014 for \"work orders for X\", an Account that has work orders is a better fit than a Person who happens to share a name. State the assumption you made in the `reason` clause of the entity you return; do not ask the user.\n\nBefore choosing a tool, check the \"Entities already in this conversation\" block that may be provided below. If the user's phrase refers to an entity listed there \u2014 by its exact name, by a partial name, or implicitly (\"them\", \"their\", \"other\", \"these\") \u2014 treat that entity as resolved. Use its `type` and `id` directly with `read_entity` or `traverse`. **A previous-turn record's nested relationships also carry their own `{ type, id }` \u2014 those ids are addressable, so call `read_entity` or `traverse` with them directly.** Do not call `resolve_entity` for a name that is already resolved in context, and do not call `resolve_entity` for a record whose id you already have.\n\nOtherwise, if the user names an entity \u2014 a customer, a person, a product, a project, anything that could correspond to a record in the graph \u2014 your first tool call is `resolve_entity` with the user's literal phrase. Do not guess a type. `resolve_entity` returns candidates across every entity type in one shot; you then pick a candidate and proceed with `describe_entity` + the typed tools.\n\nSome entities in the catalog are marked `(bridge \u2192 \u2026)` in the type index. A bridge is a junction record whose own fields are minimal \u2014 the actionable data lives on the relationships named in the bridge marker. When `traverse`, `read_entity`, or `search_entities` returns a record of a bridge type, the response already contains those relationships' targets inlined as nested objects, alongside a `__materialised: [...]` array listing which keys were filled. Do not call `traverse` on a relationship that already appears in `__materialised` \u2014 its content is already in front of you. If a relationship is in the bridge's `materialiseTo` per `describe_entity` but missing from `__materialised`, the target is gated by your module access; do not retry that traverse \u2014 narrate the gap to the user.\n\n- `resolve_entity(text)` \u2014 look up nodes by name across every entity type in one call. Pass the user's literal phrase verbatim, including words like \"and\", \"&\", or other punctuation that may be part of a name. The response carries a `matchMode`, `items` sorted by `score` descending, and an optional `recommendation`:\n - `exact` or `fuzzy` \u2192\n - **If the response carries `recommendation`, follow it.** It surfaces a deterministic rule already applied to the candidates and is more reliable than re-deriving the rule each turn.\n - Otherwise: if `items[0].summary` equals the user's literal phrase (case-insensitive), `items[0]` is the answer \u2014 pick it without further disambiguation. Words like \"and\", \"&\", or commas inside that phrase are part of the name; never split the phrase into multiple `resolve_entity` calls and never ask the user to clarify between `items[0]` and lower-ranked items just because the phrase looks plural.\n - Otherwise: if `items.length === 1` or `items[0].score - items[1].score \u2265 0.15`, pick `items[0]`.\n - Otherwise: pick the most plausible candidate by name match and continue traversing \u2014 the question still has to be answered. Do not refuse the user when at least one usable candidate exists.\n - `semantic` \u2192 same rules, margin \u2265 0.08. The match is approximate; reflect that in the `reason` clause.\n - `none` \u2192 no record exists; tell the user in your answer and suggest rephrasing.\n\n- `describe_entity(type)` \u2014 inspect one entity type in full: every field with its type, and every relationship with its target type and description. Call this for every type you intend to touch, before searching, reading, or traversing it. The next three tools will refuse to run on a type that has not been described in this turn.\n\n- `search_entities(type, filters?, sort?, limit?)` \u2014 find records of a known type by filter and sort. Use this when you already have the type (from `resolve_entity` or because the user referred to a kind of record without naming a specific one, e.g. \"all orders over 10,000\"). `search_entities` does not search by name \u2014 to find a record by name, call `resolve_entity` first.\n\n- `read_entity(type, id, include?)` \u2014 fetch the full fields of a single node by id. Tool outputs from other tools are summaries; call this to get the complete record before reporting on it.\n\n- `traverse(fromType, fromId, relationship, filters?, sort?, limit?)` \u2014 walk one edge from a known node to its connected nodes. The `relationship` must be one listed under the source type in the catalogue. `filters` and `sort` apply to the target node's fields. This is the only way to cross from one entity type to another.\n\nIf a tool returns `{ error: \"\u2026\" }`, read the message \u2014 it usually lists valid fields or relationships, or tells you to call `describe_entity` first. Pick one of those and call the tool again. Recover within the same turn; do not apologise to the user for a tool error. Never stop on the first error.\n\n## Output\n\nReturn these fields:\n\n- `answer` \u2014 a concise prose reply (2\u20134 sentences for a single record, a markdown bullet list when enumerating) built from the actual field values and traversal results. When you report on a record, use its real field values, not its type name. When you report a money value, quote the `<name>_formatted` string from the record. When you report a date, use the date as it appears in the record.\n\n- `entities` \u2014 every entity that contributes to the meaning of your `answer`, as `{ type, id, reason, fields? }`. An entity contributes when it is the subject the user asked about, or a record the answer reports a fact about. `reason` is one short clause explaining that role (for example \"the account the user asked about\", \"one of the orders listed in the answer\"). Populate `fields` with the values you quoted in `answer`. Do not include entities you retrieved, inspected, and discarded: a `resolve_entity` call that returned three candidates of which you only used one \u2014 the other two are not entities to return; a `traverse` that walked an edge whose target you did not mention \u2014 not an entity. These entities are persisted and re-loaded as context on the next turn, so polluting them with irrelevant records will cause the next turn to confuse them with the actual subject \u2014 be strict.\n\n- `stop` \u2014 set to `true` once `answer` is complete and `entities` is the matching set.\n";
2
+ export declare function renderGraphNodeSystemPrompt(graphMap: string): string;
3
+ //# sourceMappingURL=graph.node.system.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.node.system.prompt.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/prompts/graph.node.system.prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,siSAwDzC,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMpE"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GRAPH_NODE_SYSTEM_PROMPT_BASE = void 0;
4
+ exports.renderGraphNodeSystemPrompt = renderGraphNodeSystemPrompt;
5
+ exports.GRAPH_NODE_SYSTEM_PROMPT_BASE = `# Role
6
+
7
+ You help a user explore their company's ERP data. The data is stored as a graph — entities are nodes, and the connections between them are edges.
8
+
9
+ You answer the user's questions by traversing this graph: find the entities the question is about, read their fields, and walk the relationships between them to reach related entities, continuing until you have enough information to answer. Nearly every useful answer requires following at least one edge — a single search is rarely the whole story.
10
+
11
+ Every fact in your answer must come from a tool call that returned it. Do not invent field names, relationship names, entity types, or record contents.
12
+
13
+ ## Your data
14
+
15
+ {GRAPH_MAP}
16
+
17
+ The list above is the complete inventory of entity types available to you — anything not listed does not exist. Each entry shows only the type and a one-line description; fields and relationships are not included here. To learn the fields and relationships of any type, call \`describe_entity({ type })\` — its response is the only authoritative source for that type's schema. Do not assume a field or relationship exists until \`describe_entity\` confirms it.
18
+
19
+ **Every currency value in this system is stored as an integer number of cents — never as a decimal amount.** A stored value of \`600\` means 6.00, \`500\` means 5.00, and \`1234567\` means 12,345.67. Fields that carry money are marked \`money\` in the catalogue above (e.g. \`total_amount (number, money [integer stored in minor units (2 decimals); divide by 10^2 to display], ...)\`). For these fields, every record returned by \`read_entity\`, \`search_entities\`, or \`traverse\` also carries a sibling \`<name>_formatted\` string — quote that string when narrating the amount in your answer, and never quote the raw integer as if it were euros. Filters and sort still target the raw field (pass cents, e.g. \`{ field: "total_amount", op: "gt", value: 10000 }\` to mean "over 100.00").
20
+
21
+ ## Tools
22
+
23
+ You have five tools. Call them in sequence — a typical question needs two or three.
24
+
25
+ **Never ask the user a clarifying question.** The user expects an answer, not a follow-up. After \`resolve_entity\` returns at least one usable candidate, immediately continue: \`describe_entity\` → \`search_entities\` / \`traverse\` / \`read_entity\` → answer. Do not stop the tool chain to confirm what to do next. If multiple candidates of different types could match (e.g. an Account and a Person both named "Carlo"), pick the one whose type and connected relationships best fit the user's question — for "work orders for X", an Account that has work orders is a better fit than a Person who happens to share a name. State the assumption you made in the \`reason\` clause of the entity you return; do not ask the user.
26
+
27
+ Before choosing a tool, check the "Entities already in this conversation" block that may be provided below. If the user's phrase refers to an entity listed there — by its exact name, by a partial name, or implicitly ("them", "their", "other", "these") — treat that entity as resolved. Use its \`type\` and \`id\` directly with \`read_entity\` or \`traverse\`. **A previous-turn record's nested relationships also carry their own \`{ type, id }\` — those ids are addressable, so call \`read_entity\` or \`traverse\` with them directly.** Do not call \`resolve_entity\` for a name that is already resolved in context, and do not call \`resolve_entity\` for a record whose id you already have.
28
+
29
+ Otherwise, if the user names an entity — a customer, a person, a product, a project, anything that could correspond to a record in the graph — your first tool call is \`resolve_entity\` with the user's literal phrase. Do not guess a type. \`resolve_entity\` returns candidates across every entity type in one shot; you then pick a candidate and proceed with \`describe_entity\` + the typed tools.
30
+
31
+ Some entities in the catalog are marked \`(bridge → …)\` in the type index. A bridge is a junction record whose own fields are minimal — the actionable data lives on the relationships named in the bridge marker. When \`traverse\`, \`read_entity\`, or \`search_entities\` returns a record of a bridge type, the response already contains those relationships' targets inlined as nested objects, alongside a \`__materialised: [...]\` array listing which keys were filled. Do not call \`traverse\` on a relationship that already appears in \`__materialised\` — its content is already in front of you. If a relationship is in the bridge's \`materialiseTo\` per \`describe_entity\` but missing from \`__materialised\`, the target is gated by your module access; do not retry that traverse — narrate the gap to the user.
32
+
33
+ - \`resolve_entity(text)\` — look up nodes by name across every entity type in one call. Pass the user's literal phrase verbatim, including words like "and", "&", or other punctuation that may be part of a name. The response carries a \`matchMode\`, \`items\` sorted by \`score\` descending, and an optional \`recommendation\`:
34
+ - \`exact\` or \`fuzzy\` →
35
+ - **If the response carries \`recommendation\`, follow it.** It surfaces a deterministic rule already applied to the candidates and is more reliable than re-deriving the rule each turn.
36
+ - Otherwise: if \`items[0].summary\` equals the user's literal phrase (case-insensitive), \`items[0]\` is the answer — pick it without further disambiguation. Words like "and", "&", or commas inside that phrase are part of the name; never split the phrase into multiple \`resolve_entity\` calls and never ask the user to clarify between \`items[0]\` and lower-ranked items just because the phrase looks plural.
37
+ - Otherwise: if \`items.length === 1\` or \`items[0].score - items[1].score ≥ 0.15\`, pick \`items[0]\`.
38
+ - Otherwise: pick the most plausible candidate by name match and continue traversing — the question still has to be answered. Do not refuse the user when at least one usable candidate exists.
39
+ - \`semantic\` → same rules, margin ≥ 0.08. The match is approximate; reflect that in the \`reason\` clause.
40
+ - \`none\` → no record exists; tell the user in your answer and suggest rephrasing.
41
+
42
+ - \`describe_entity(type)\` — inspect one entity type in full: every field with its type, and every relationship with its target type and description. Call this for every type you intend to touch, before searching, reading, or traversing it. The next three tools will refuse to run on a type that has not been described in this turn.
43
+
44
+ - \`search_entities(type, filters?, sort?, limit?)\` — find records of a known type by filter and sort. Use this when you already have the type (from \`resolve_entity\` or because the user referred to a kind of record without naming a specific one, e.g. "all orders over 10,000"). \`search_entities\` does not search by name — to find a record by name, call \`resolve_entity\` first.
45
+
46
+ - \`read_entity(type, id, include?)\` — fetch the full fields of a single node by id. Tool outputs from other tools are summaries; call this to get the complete record before reporting on it.
47
+
48
+ - \`traverse(fromType, fromId, relationship, filters?, sort?, limit?)\` — walk one edge from a known node to its connected nodes. The \`relationship\` must be one listed under the source type in the catalogue. \`filters\` and \`sort\` apply to the target node's fields. This is the only way to cross from one entity type to another.
49
+
50
+ If a tool returns \`{ error: "…" }\`, read the message — it usually lists valid fields or relationships, or tells you to call \`describe_entity\` first. Pick one of those and call the tool again. Recover within the same turn; do not apologise to the user for a tool error. Never stop on the first error.
51
+
52
+ ## Output
53
+
54
+ Return these fields:
55
+
56
+ - \`answer\` — a concise prose reply (2–4 sentences for a single record, a markdown bullet list when enumerating) built from the actual field values and traversal results. When you report on a record, use its real field values, not its type name. When you report a money value, quote the \`<name>_formatted\` string from the record. When you report a date, use the date as it appears in the record.
57
+
58
+ - \`entities\` — every entity that contributes to the meaning of your \`answer\`, as \`{ type, id, reason, fields? }\`. An entity contributes when it is the subject the user asked about, or a record the answer reports a fact about. \`reason\` is one short clause explaining that role (for example "the account the user asked about", "one of the orders listed in the answer"). Populate \`fields\` with the values you quoted in \`answer\`. Do not include entities you retrieved, inspected, and discarded: a \`resolve_entity\` call that returned three candidates of which you only used one — the other two are not entities to return; a \`traverse\` that walked an edge whose target you did not mention — not an entity. These entities are persisted and re-loaded as context on the next turn, so polluting them with irrelevant records will cause the next turn to confuse them with the actual subject — be strict.
59
+
60
+ - \`stop\` — set to \`true\` once \`answer\` is complete and \`entities\` is the matching set.
61
+ `;
62
+ function renderGraphNodeSystemPrompt(graphMap) {
63
+ return exports.GRAPH_NODE_SYSTEM_PROMPT_BASE.replace("{GRAPH_MAP}", graphMap ||
64
+ "(No accessible data — the user has no enabled modules with described entities. Do not attempt any tool calls. Respond politely explaining that you have no data to query.)");
65
+ }
66
+ //# sourceMappingURL=graph.node.system.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.node.system.prompt.js","sourceRoot":"","sources":["../../../../src/agents/graph/prompts/graph.node.system.prompt.ts"],"names":[],"mappings":";;;AA0DA,kEAMC;AAhEY,QAAA,6BAA6B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwD5C,CAAC;AAEF,SAAgB,2BAA2B,CAAC,QAAgB;IAC1D,OAAO,qCAA6B,CAAC,OAAO,CAC1C,aAAa,EACb,QAAQ;QACN,4KAA4K,CAC/K,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-modules.repository.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/repositories/user-modules.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAQ1E;;;;;;;;;GASG;AACH,qBACa,qBAAqB;IAGpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFlC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;gBAEpC,KAAK,EAAE,YAAY;IAEhD;;;;;;;;;OASG;IACG,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CA4B9D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-modules.repository.js","sourceRoot":"","sources":["../../../../src/agents/graph/repositories/user-modules.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8EAA0E;AAC1E,mGAA8F;AAO9F;;;;;;;;;GASG;AAEI,IAAM,qBAAqB,6BAA3B,MAAM,qBAAqB;IAGhC,YAA6B,KAAmB;QAAnB,UAAK,GAAL,KAAK,CAAc;QAF/B,WAAM,GAAG,IAAI,eAAM,CAAC,uBAAqB,CAAC,IAAI,CAAC,CAAC;IAEd,CAAC;IAEpD;;;;;;;;;OASG;IACH,KAAK,CAAC,oBAAoB,CAAC,MAAc;QACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAClC;;QAEE,yCAAkB;OACnB,EACD,EAAE,MAAM,EAAE,CACX,CAAC;QAEF,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACpC,MAAM,UAAU,GAAQ,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC7C,MAAM,KAAK,GAAG,UAAU,EAAE,UAAU,CAAC;YACrC,IAAI,CAAC,KAAK;gBAAE,SAAS;YACrB,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;YACpB,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC;YACpC,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,CAAC,EAAE,CAAC,MAAM,IAAI,OAAO,SAAS,KAAK,QAAQ;gBAAE,SAAS;YACpF,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAsB,CAAC;gBACzD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;gBAClD,IAAI,IAAI,EAAE,KAAK,KAAK,IAAI;oBAAE,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC/C,CAAC;YAAC,MAAM,CAAC;gBACP,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,8DAA8D,EAAE,EAAE,CAAC,CAAC;YACvF,CAAC;QACH,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gCAAgC,MAAM,sBAAsB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACzG,OAAO,SAAS,CAAC;IACnB,CAAC;CACF,CAAA;AA3CY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAIyB,4BAAY;GAHrC,qBAAqB,CA2CjC"}
@@ -1,6 +1,8 @@
1
1
  import { DescriptorSource } from "./graph.catalog.service";
2
2
  export declare class GraphDescriptorRegistry implements DescriptorSource {
3
+ private readonly logger;
3
4
  private readonly entries;
5
+ private logged;
4
6
  /**
5
7
  * Register a feature-module's descriptor with the chatbot graph catalog.
6
8
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor.source.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/services/descriptor.source.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAO3D,qBACa,uBAAwB,YAAW,gBAAgB;IAC9D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4C;IACnE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IACjD,OAAO,CAAC,MAAM,CAAS;IAEvB;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,GAAG,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAI7D,OAAO,IAAI,GAAG,EAAE;CA0BjB"}
@@ -5,12 +5,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
+ var GraphDescriptorRegistry_1;
8
9
  Object.defineProperty(exports, "__esModule", { value: true });
9
10
  exports.GraphDescriptorRegistry = void 0;
10
11
  const common_1 = require("@nestjs/common");
11
- let GraphDescriptorRegistry = class GraphDescriptorRegistry {
12
+ let GraphDescriptorRegistry = GraphDescriptorRegistry_1 = class GraphDescriptorRegistry {
12
13
  constructor() {
14
+ this.logger = new common_1.Logger(GraphDescriptorRegistry_1.name);
13
15
  this.entries = [];
16
+ this.logged = false;
14
17
  }
15
18
  /**
16
19
  * Register a feature-module's descriptor with the chatbot graph catalog.
@@ -24,18 +27,30 @@ let GraphDescriptorRegistry = class GraphDescriptorRegistry {
24
27
  this.entries.push({ descriptor: params.descriptor, moduleId: params.moduleId });
25
28
  }
26
29
  loadAll() {
27
- return this.entries.map((e) => ({
30
+ const out = this.entries.map((e) => ({
28
31
  model: e.descriptor.model,
29
32
  description: e.descriptor.description,
30
33
  moduleId: e.moduleId,
31
34
  fields: e.descriptor.fields ?? {},
32
35
  relationships: e.descriptor.relationships ?? {},
33
36
  chat: e.descriptor.chat,
37
+ bridge: e.descriptor.bridge,
34
38
  }));
39
+ if (!this.logged) {
40
+ this.logged = true;
41
+ this.logger.log(`loadAll: ${out.length} descriptors: ` +
42
+ JSON.stringify(out.map((d) => ({
43
+ type: d.model.type,
44
+ moduleId: d.moduleId,
45
+ hasDescription: !!d.description,
46
+ hasBridge: !!d.bridge,
47
+ }))));
48
+ }
49
+ return out;
35
50
  }
36
51
  };
37
52
  exports.GraphDescriptorRegistry = GraphDescriptorRegistry;
38
- exports.GraphDescriptorRegistry = GraphDescriptorRegistry = __decorate([
53
+ exports.GraphDescriptorRegistry = GraphDescriptorRegistry = GraphDescriptorRegistry_1 = __decorate([
39
54
  (0, common_1.Injectable)()
40
55
  ], GraphDescriptorRegistry);
41
56
  //# sourceMappingURL=descriptor.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor.source.js","sourceRoot":"","sources":["../../../../src/agents/graph/services/descriptor.source.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAoD;AAS7C,IAAM,uBAAuB,+BAA7B,MAAM,uBAAuB;IAA7B;QACY,WAAM,GAAG,IAAI,eAAM,CAAC,yBAAuB,CAAC,IAAI,CAAC,CAAC;QAClD,YAAO,GAAsB,EAAE,CAAC;QACzC,WAAM,GAAG,KAAK,CAAC;IAwCzB,CAAC;IAtCC;;;;;;;OAOG;IACH,QAAQ,CAAC,MAA6C;QACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,OAAO;QACL,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACnC,KAAK,EAAE,CAAC,CAAC,UAAU,CAAC,KAAK;YACzB,WAAW,EAAE,CAAC,CAAC,UAAU,CAAC,WAAW;YACrC,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,IAAI,EAAE;YACjC,aAAa,EAAE,CAAC,CAAC,UAAU,CAAC,aAAa,IAAI,EAAE;YAC/C,IAAI,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI;YACvB,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM;SAC5B,CAAC,CAAC,CAAC;QACJ,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,YAAY,GAAG,CAAC,MAAM,gBAAgB;gBACpC,IAAI,CAAC,SAAS,CACZ,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBACd,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI;oBAClB,QAAQ,EAAE,CAAC,CAAC,QAAQ;oBACpB,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW;oBAC/B,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM;iBACtB,CAAC,CAAC,CACJ,CACJ,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF,CAAA;AA3CY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;GACA,uBAAuB,CA2CnC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-formatting.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/services/field-formatting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AAE/E;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAO/E;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EAAE,EACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAazB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-formatting.js","sourceRoot":"","sources":["../../../../src/agents/graph/services/field-formatting.ts"],"names":[],"mappings":";;AASA,4CAOC;AASD,sDAgBC;AAtCD;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,KAAc,EAAE,IAAe;IAC9D,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtE,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC;IACnC,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,EAAE,IAAI,KAAK,CAAC;IAC3B,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,qBAAqB,CACnC,MAAsB,EACtB,MAA+B;IAE/B,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC7B,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,EAAE,CAAC;YAC7B,MAAM,SAAS,GAAG,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;YAClD,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;gBACvB,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,YAAY,CAAC,GAAG,SAAS,CAAC;YACzC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -39,6 +39,9 @@ export interface DescriptorSource {
39
39
  summary?: (d: any) => string;
40
40
  textSearchFields?: string[];
41
41
  };
42
+ bridge?: {
43
+ materialiseTo: string[];
44
+ };
42
45
  }>;
43
46
  }
44
47
  export declare class GraphCatalogService implements OnApplicationBootstrap {
@@ -53,6 +56,19 @@ export declare class GraphCatalogService implements OnApplicationBootstrap {
53
56
  private renderModule;
54
57
  getMapFor(userModuleIds: string[]): string;
55
58
  private filterCrossModule;
59
+ /**
60
+ * Returns a flat type index for the given user modules: one line per accessible
61
+ * entity, in the form `- <type> — <description>`. No fields, no relationships.
62
+ *
63
+ * Used as the lightweight planner catalog and as the slim graph-node prompt body
64
+ * (the LLM fetches per-type schema on demand via `describe_entity`).
65
+ */
66
+ getTypeIndexFor(userModuleIds: string[]): string;
67
+ /**
68
+ * Returns the accessible entity-type names for a user's modules. Used by the
69
+ * tool layer to compute "Did you mean" suggestions for unknown types.
70
+ */
71
+ getAccessibleTypes(userModuleIds: string[]): string[];
56
72
  getAllChatEnabledEntities(): CatalogEntity[];
57
73
  hasType(type: string): boolean;
58
74
  getEntityDetail(type: string, userModuleIds: string[]): CatalogEntity | null;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.catalog.service.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/services/graph.catalog.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAqC,MAAM,uCAAuC,CAAC;AACzG,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AAe/E;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,IAAI,KAAK,CAAC;QACf,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC;QAC7D,WAAW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GAAG,MAAM;IAqB1C,OAAO,CAAC,iBAAiB;IAiBzB;;;;;;OAMG;IACH,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM;IAYhD;;;OAGG;IACH,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAUrD,yBAAyB,IAAI,aAAa,EAAE;IAQ5C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,aAAa,GAAG,IAAI;CAM7E"}
@@ -76,6 +76,7 @@ let GraphCatalogService = GraphCatalogService_1 = class GraphCatalogService {
76
76
  textSearchFields: d.chat?.textSearchFields,
77
77
  nodeName: d.model.nodeName,
78
78
  labelName: d.model.labelName,
79
+ ...(d.bridge ? { bridge: { materialiseTo: [...d.bridge.materialiseTo] } } : {}),
79
80
  });
80
81
  }
81
82
  // Pass 2: materialise reverse relationships on target entities.
@@ -116,7 +117,33 @@ let GraphCatalogService = GraphCatalogService_1 = class GraphCatalogService {
116
117
  for (const [moduleId, list] of byModuleId.entries()) {
117
118
  this.renderedByModuleId.set(moduleId, this.renderModule(moduleId, list));
118
119
  }
119
- this.logger.log(`Graph catalog built: ${this.entities.size} entities, ${byModuleId.size} modules: ${JSON.stringify(Array.from(this.entities.values()).map((e) => ({ type: e.type, moduleId: e.moduleId })))}`);
120
+ // Pass 4: validate bridges against the resolved catalog (cross-type checks).
121
+ // Soft validation: a missing relationship name is a misconfiguration we should
122
+ // surface loudly (throw), but a missing TARGET type just means the target
123
+ // descriptor lacks a top-level description and was filtered out. Drop that
124
+ // name from materialiseTo with a warn, so boot proceeds and the bridge still
125
+ // fanouts to the relationships whose targets ARE in the catalog.
126
+ for (const e of this.entities.values()) {
127
+ if (!e.bridge)
128
+ continue;
129
+ const reachable = [];
130
+ for (const relName of e.bridge.materialiseTo) {
131
+ const rel = e.relationships.find((r) => r.name === relName);
132
+ if (!rel) {
133
+ throw new Error(`Bridge "${e.type}" lists materialiseTo "${relName}", but no such relationship exists on it.`);
134
+ }
135
+ const target = this.entities.get(rel.targetType);
136
+ if (!target) {
137
+ this.logger.warn(`Bridge "${e.type}" materialises to "${relName}" → "${rel.targetType}", ` +
138
+ `but that target type is missing from the catalog (likely a missing description on the target descriptor). ` +
139
+ `Dropping "${relName}" from materialiseTo at runtime.`);
140
+ continue;
141
+ }
142
+ reachable.push(relName);
143
+ }
144
+ e.bridge = { materialiseTo: reachable };
145
+ }
146
+ this.logger.log(`Graph catalog built: ${this.entities.size} entities, ${byModuleId.size} modules: ${JSON.stringify(Array.from(this.entities.values()).map((e) => ({ type: e.type, moduleId: e.moduleId, isBridge: !!e.bridge })))}`);
120
147
  }
121
148
  renderModule(moduleId, list) {
122
149
  const entityBlocks = list.map((e) => {
@@ -189,6 +216,41 @@ let GraphCatalogService = GraphCatalogService_1 = class GraphCatalogService {
189
216
  }
190
217
  return out.join("\n");
191
218
  }
219
+ /**
220
+ * Returns a flat type index for the given user modules: one line per accessible
221
+ * entity, in the form `- <type> — <description>`. No fields, no relationships.
222
+ *
223
+ * Used as the lightweight planner catalog and as the slim graph-node prompt body
224
+ * (the LLM fetches per-type schema on demand via `describe_entity`).
225
+ */
226
+ getTypeIndexFor(userModuleIds) {
227
+ if (!userModuleIds.length)
228
+ return "";
229
+ const accessible = new Set(userModuleIds);
230
+ const lines = [];
231
+ for (const e of this.entities.values()) {
232
+ if (!accessible.has(e.moduleId))
233
+ continue;
234
+ const marker = e.bridge ? ` (bridge → ${e.bridge.materialiseTo.join(", ")})` : "";
235
+ lines.push(`- ${e.type} — ${e.description}${marker}`);
236
+ }
237
+ return lines.join("\n");
238
+ }
239
+ /**
240
+ * Returns the accessible entity-type names for a user's modules. Used by the
241
+ * tool layer to compute "Did you mean" suggestions for unknown types.
242
+ */
243
+ getAccessibleTypes(userModuleIds) {
244
+ if (!userModuleIds.length)
245
+ return [];
246
+ const accessible = new Set(userModuleIds);
247
+ const out = [];
248
+ for (const e of this.entities.values()) {
249
+ if (accessible.has(e.moduleId))
250
+ out.push(e.type);
251
+ }
252
+ return out;
253
+ }
192
254
  getAllChatEnabledEntities() {
193
255
  const out = [];
194
256
  for (const e of this.entities.values()) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.catalog.service.js","sourceRoot":"","sources":["../../../../src/agents/graph/services/graph.catalog.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA4E;AAI5E,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AACtF,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAEzE,SAAS,qBAAqB,CAAC,IAA2B;IACxD,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC;QACjD,OAAO,2CAA2C,KAAK,yBAAyB,MAAM,cAAc,CAAC;IACvG,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AA8BM,IAAM,mBAAmB,2BAAzB,MAAM,mBAAmB;IAM9B,YAA6B,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;QALpC,WAAM,GAAG,IAAI,eAAM,CAAC,qBAAmB,CAAC,IAAI,CAAC,CAAC;QACvD,aAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;QACpD,2EAA2E;QACnE,uBAAkB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEC,CAAC;IA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C,MAAM,EAAE,EAAE,CAAC;YACvC,IAAI,CAAC,CAAC,gBAAgB,EAAE,MAAM;gBAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO,CAAC,IAAY;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,eAAe,CAAC,IAAY,EAAE,aAAuB;QACnD,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QACpB,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;YAAE,OAAO,IAAI,CAAC;QACrD,OAAO,CAAC,CAAC;IACX,CAAC;CACF,CAAA;AAnQY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;;GACA,mBAAmB,CAmQ/B"}
@@ -2,7 +2,7 @@ import { OnApplicationBootstrap } from "@nestjs/common";
2
2
  import { ModelService } from "../../../core/llm/services/model.service";
3
3
  import { Neo4jService } from "../../../core/neo4j/services/neo4j.service";
4
4
  import { GraphCatalogService } from "./graph.catalog.service";
5
- export declare class ChatbotIndexManager implements OnApplicationBootstrap {
5
+ export declare class GraphIndexManager implements OnApplicationBootstrap {
6
6
  private readonly neo4j;
7
7
  private readonly catalog;
8
8
  private readonly models;
@@ -14,4 +14,4 @@ export declare class ChatbotIndexManager implements OnApplicationBootstrap {
14
14
  fulltextIndexName(label: string): string;
15
15
  vectorIndexName(label: string): string;
16
16
  }
17
- //# sourceMappingURL=chatbot.index.manager.d.ts.map
17
+ //# sourceMappingURL=graph.index.manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.index.manager.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/services/graph.index.manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,qBACa,iBAAkB,YAAW,sBAAsB;IAI5D,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IALzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsC;gBAG1C,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,YAAY;IAOjC,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;YAY/B,cAAc;YAed,YAAY;IAkB1B,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIxC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAGvC"}
@@ -8,23 +8,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
- var ChatbotIndexManager_1;
11
+ var GraphIndexManager_1;
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.ChatbotIndexManager = void 0;
13
+ exports.GraphIndexManager = void 0;
14
14
  const common_1 = require("@nestjs/common");
15
15
  const model_service_1 = require("../../../core/llm/services/model.service");
16
16
  const neo4j_service_1 = require("../../../core/neo4j/services/neo4j.service");
17
17
  const graph_catalog_service_1 = require("./graph.catalog.service");
18
- let ChatbotIndexManager = ChatbotIndexManager_1 = class ChatbotIndexManager {
18
+ let GraphIndexManager = GraphIndexManager_1 = class GraphIndexManager {
19
19
  constructor(neo4j, catalog, models) {
20
20
  this.neo4j = neo4j;
21
21
  this.catalog = catalog;
22
22
  this.models = models;
23
- this.logger = new common_1.Logger(ChatbotIndexManager_1.name);
23
+ this.logger = new common_1.Logger(GraphIndexManager_1.name);
24
24
  }
25
25
  // Fires in onApplicationBootstrap (after all onModuleInit). GraphCatalogService
26
26
  // builds its catalog in its own onApplicationBootstrap; because it's declared
27
- // before this manager in chatbot.module.ts, its bootstrap runs first and the
27
+ // before this manager in graph.module.ts, its bootstrap runs first and the
28
28
  // catalog is populated by the time we read it here.
29
29
  async onApplicationBootstrap() {
30
30
  const entities = this.catalog.getAllChatEnabledEntities();
@@ -74,11 +74,11 @@ let ChatbotIndexManager = ChatbotIndexManager_1 = class ChatbotIndexManager {
74
74
  return `${label.toLowerCase()}_chat_embedding`;
75
75
  }
76
76
  };
77
- exports.ChatbotIndexManager = ChatbotIndexManager;
78
- exports.ChatbotIndexManager = ChatbotIndexManager = ChatbotIndexManager_1 = __decorate([
77
+ exports.GraphIndexManager = GraphIndexManager;
78
+ exports.GraphIndexManager = GraphIndexManager = GraphIndexManager_1 = __decorate([
79
79
  (0, common_1.Injectable)(),
80
80
  __metadata("design:paramtypes", [neo4j_service_1.Neo4jService,
81
81
  graph_catalog_service_1.GraphCatalogService,
82
82
  model_service_1.ModelService])
83
- ], ChatbotIndexManager);
84
- //# sourceMappingURL=chatbot.index.manager.js.map
83
+ ], GraphIndexManager);
84
+ //# sourceMappingURL=graph.index.manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.index.manager.js","sourceRoot":"","sources":["../../../../src/agents/graph/services/graph.index.manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA4E;AAC5E,4EAAwE;AACxE,8EAA0E;AAE1E,mEAA8D;AAGvD,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAG5B,YACmB,KAAmB,EACnB,OAA4B,EAC5B,MAAoB;QAFpB,UAAK,GAAL,KAAK,CAAc;QACnB,YAAO,GAAP,OAAO,CAAqB;QAC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