n8n 2.22.3 → 2.23.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 (628) hide show
  1. package/dist/auth/auth.service.d.ts +2 -0
  2. package/dist/auth/auth.service.js +15 -4
  3. package/dist/auth/auth.service.js.map +1 -1
  4. package/dist/build.tsbuildinfo +1 -1
  5. package/dist/chat/chat-service.types.d.ts +4 -4
  6. package/dist/commands/execute.d.ts +2 -2
  7. package/dist/commands/export/workflow.js +1 -0
  8. package/dist/commands/export/workflow.js.map +1 -1
  9. package/dist/commands/license/info.js +4 -4
  10. package/dist/commands/license/info.js.map +1 -1
  11. package/dist/commands/start.js +21 -1
  12. package/dist/commands/start.js.map +1 -1
  13. package/dist/constants.js +1 -0
  14. package/dist/constants.js.map +1 -1
  15. package/dist/controllers/annotation-tags.controller.ee.d.ts +1 -1
  16. package/dist/controllers/e2e.controller.js +1 -0
  17. package/dist/controllers/e2e.controller.js.map +1 -1
  18. package/dist/controllers/oauth/oauth1-credential.controller.d.ts +1 -1
  19. package/dist/controllers/oauth/oauth1-credential.controller.js +4 -7
  20. package/dist/controllers/oauth/oauth1-credential.controller.js.map +1 -1
  21. package/dist/controllers/oauth/oauth2-credential.controller.js +3 -6
  22. package/dist/controllers/oauth/oauth2-credential.controller.js.map +1 -1
  23. package/dist/controllers/redaction-enforcement-mapper.d.ts +3 -0
  24. package/dist/controllers/redaction-enforcement-mapper.js +27 -0
  25. package/dist/controllers/redaction-enforcement-mapper.js.map +1 -0
  26. package/dist/controllers/security-settings.controller.d.ts +8 -2
  27. package/dist/controllers/security-settings.controller.js +35 -25
  28. package/dist/controllers/security-settings.controller.js.map +1 -1
  29. package/dist/credentials/credential-connection-status-provider.interface.d.ts +3 -0
  30. package/dist/credentials/credential-connection-status-provider.interface.js +3 -0
  31. package/dist/credentials/credential-connection-status-provider.interface.js.map +1 -0
  32. package/dist/credentials/credential-connection-status-proxy.d.ts +6 -0
  33. package/dist/credentials/credential-connection-status-proxy.js +25 -0
  34. package/dist/credentials/credential-connection-status-proxy.js.map +1 -0
  35. package/dist/credentials/credential-resolution-provider.interface.d.ts +1 -0
  36. package/dist/credentials/credentials.controller.d.ts +2 -0
  37. package/dist/credentials/credentials.service.d.ts +10 -1
  38. package/dist/credentials/credentials.service.ee.d.ts +2 -0
  39. package/dist/credentials/credentials.service.ee.js +13 -3
  40. package/dist/credentials/credentials.service.ee.js.map +1 -1
  41. package/dist/credentials/credentials.service.js +34 -7
  42. package/dist/credentials/credentials.service.js.map +1 -1
  43. package/dist/credentials/dynamic-credentials-proxy.d.ts +2 -0
  44. package/dist/credentials/dynamic-credentials-proxy.js +9 -0
  45. package/dist/credentials/dynamic-credentials-proxy.js.map +1 -1
  46. package/dist/credentials-helper.js +2 -1
  47. package/dist/credentials-helper.js.map +1 -1
  48. package/dist/errors/feature-not-licensed.error.d.ts +3 -1
  49. package/dist/errors/feature-not-licensed.error.js +2 -2
  50. package/dist/errors/feature-not-licensed.error.js.map +1 -1
  51. package/dist/evaluation.ee/evaluation-collection.service.js +2 -0
  52. package/dist/evaluation.ee/evaluation-collection.service.js.map +1 -1
  53. package/dist/evaluation.ee/insights/eval-insights.controller.ee.d.ts +41 -0
  54. package/dist/evaluation.ee/insights/eval-insights.controller.ee.js +62 -0
  55. package/dist/evaluation.ee/insights/eval-insights.controller.ee.js.map +1 -0
  56. package/dist/evaluation.ee/insights/eval-insights.service.d.ts +25 -0
  57. package/dist/evaluation.ee/insights/eval-insights.service.js +206 -0
  58. package/dist/evaluation.ee/insights/eval-insights.service.js.map +1 -0
  59. package/dist/evaluation.ee/test-runner/test-runner.service.ee.d.ts +3 -2
  60. package/dist/evaluation.ee/test-runner/test-runner.service.ee.js +16 -2
  61. package/dist/evaluation.ee/test-runner/test-runner.service.ee.js.map +1 -1
  62. package/dist/events/relays/telemetry.event-relay.d.ts +3 -1
  63. package/dist/events/relays/telemetry.event-relay.js +9 -3
  64. package/dist/events/relays/telemetry.event-relay.js.map +1 -1
  65. package/dist/execution-lifecycle/execution-lifecycle-hooks.d.ts +1 -1
  66. package/dist/execution-lifecycle/execution-lifecycle-hooks.js +4 -2
  67. package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
  68. package/dist/executions/execution-data/db-store.d.ts +4 -2
  69. package/dist/executions/execution-data/db-store.js +9 -4
  70. package/dist/executions/execution-data/db-store.js.map +1 -1
  71. package/dist/executions/execution-data/missing-execution-data.error.d.ts +5 -0
  72. package/dist/executions/execution-data/missing-execution-data.error.js +11 -0
  73. package/dist/executions/execution-data/missing-execution-data.error.js.map +1 -0
  74. package/dist/executions/execution-data/types.d.ts +3 -2
  75. package/dist/executions/execution-data/types.js.map +1 -1
  76. package/dist/executions/execution-persistence.d.ts +12 -3
  77. package/dist/executions/execution-persistence.js +102 -26
  78. package/dist/executions/execution-persistence.js.map +1 -1
  79. package/dist/external-hooks.d.ts +6 -1
  80. package/dist/external-hooks.js.map +1 -1
  81. package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.d.ts +3 -2
  82. package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js +17 -12
  83. package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js.map +1 -1
  84. package/dist/interfaces.d.ts +1 -0
  85. package/dist/license.d.ts +2 -0
  86. package/dist/license.js +6 -0
  87. package/dist/license.js.map +1 -1
  88. package/dist/load-nodes-and-credentials.d.ts +32 -6
  89. package/dist/load-nodes-and-credentials.js +8 -79
  90. package/dist/load-nodes-and-credentials.js.map +1 -1
  91. package/dist/manual-execution.service.js +3 -0
  92. package/dist/manual-execution.service.js.map +1 -1
  93. package/dist/modules/agents/agent-execution.service.js +5 -5
  94. package/dist/modules/agents/agent-execution.service.js.map +1 -1
  95. package/dist/modules/agents/agent-sse-stream.js +17 -1
  96. package/dist/modules/agents/agent-sse-stream.js.map +1 -1
  97. package/dist/modules/agents/agents-tools.service.js +7 -5
  98. package/dist/modules/agents/agents-tools.service.js.map +1 -1
  99. package/dist/modules/agents/agents.controller.d.ts +29 -3
  100. package/dist/modules/agents/agents.controller.js +88 -7
  101. package/dist/modules/agents/agents.controller.js.map +1 -1
  102. package/dist/modules/agents/agents.module.d.ts +1 -1
  103. package/dist/modules/agents/agents.module.js +12 -6
  104. package/dist/modules/agents/agents.module.js.map +1 -1
  105. package/dist/modules/agents/agents.service.d.ts +7 -8
  106. package/dist/modules/agents/agents.service.js +120 -65
  107. package/dist/modules/agents/agents.service.js.map +1 -1
  108. package/dist/modules/agents/builder/agents-builder-model-recommendations.d.ts +1 -1
  109. package/dist/modules/agents/builder/agents-builder-model-recommendations.js +3 -3
  110. package/dist/modules/agents/builder/agents-builder-model-recommendations.js.map +1 -1
  111. package/dist/modules/agents/builder/agents-builder-prompts.d.ts +9 -17
  112. package/dist/modules/agents/builder/agents-builder-prompts.js +145 -549
  113. package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
  114. package/dist/modules/agents/builder/agents-builder-settings.service.js +2 -2
  115. package/dist/modules/agents/builder/agents-builder-settings.service.js.map +1 -1
  116. package/dist/modules/agents/builder/agents-builder-tools.service.js +10 -10
  117. package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
  118. package/dist/modules/agents/builder/agents-builder.service.d.ts +3 -1
  119. package/dist/modules/agents/builder/agents-builder.service.js +58 -9
  120. package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
  121. package/dist/modules/agents/builder/interactive/ask-credential.tool.js +2 -2
  122. package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -1
  123. package/dist/modules/agents/builder/interactive/ask-llm.tool.js +2 -2
  124. package/dist/modules/agents/builder/interactive/ask-llm.tool.js.map +1 -1
  125. package/dist/modules/agents/builder/interactive/ask-question.tool.js +2 -2
  126. package/dist/modules/agents/builder/interactive/ask-question.tool.js.map +1 -1
  127. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +2 -2
  128. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
  129. package/dist/modules/agents/builder/prompts/config-mutation.prompt.d.ts +1 -0
  130. package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +132 -0
  131. package/dist/modules/agents/builder/prompts/config-mutation.prompt.js.map +1 -0
  132. package/dist/modules/agents/builder/prompts/config-rules.prompt.d.ts +2 -0
  133. package/dist/modules/agents/builder/prompts/config-rules.prompt.js +63 -0
  134. package/dist/modules/agents/builder/prompts/config-rules.prompt.js.map +1 -0
  135. package/dist/modules/agents/builder/prompts/llm-selection.prompt.d.ts +1 -0
  136. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +47 -0
  137. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -0
  138. package/dist/modules/agents/builder/prompts/memory.prompt.d.ts +1 -0
  139. package/dist/modules/agents/builder/prompts/memory.prompt.js +60 -0
  140. package/dist/modules/agents/builder/prompts/memory.prompt.js.map +1 -0
  141. package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -0
  142. package/dist/modules/agents/builder/prompts/tools.prompt.js +81 -0
  143. package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -0
  144. package/dist/modules/agents/builder/skills/index.d.ts +2 -0
  145. package/dist/modules/agents/builder/skills/index.js +12 -0
  146. package/dist/modules/agents/builder/skills/index.js.map +1 -0
  147. package/dist/modules/agents/builder/skills/integrations.skill.d.ts +2 -0
  148. package/dist/modules/agents/builder/skills/integrations.skill.js +53 -0
  149. package/dist/modules/agents/builder/skills/integrations.skill.js.map +1 -0
  150. package/dist/modules/agents/builder/skills/research.skill.d.ts +2 -0
  151. package/dist/modules/agents/builder/skills/research.skill.js +42 -0
  152. package/dist/modules/agents/builder/skills/research.skill.js.map +1 -0
  153. package/dist/modules/agents/builder/skills/target-skills.skill.d.ts +2 -0
  154. package/dist/modules/agents/builder/skills/target-skills.skill.js +59 -0
  155. package/dist/modules/agents/builder/skills/target-skills.skill.js.map +1 -0
  156. package/dist/modules/agents/entities/{agent-published-version.entity.d.ts → agent-history.entity.d.ts} +4 -7
  157. package/dist/modules/agents/entities/{agent-published-version.entity.js → agent-history.entity.js} +22 -34
  158. package/dist/modules/agents/entities/agent-history.entity.js.map +1 -0
  159. package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.d.ts +7 -0
  160. package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.js +38 -0
  161. package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.js.map +1 -0
  162. package/dist/modules/agents/entities/agent-memory-entry-lock.entity.d.ts +7 -0
  163. package/dist/modules/{instance-ai/entities/instance-ai-workflow-snapshot.entity.js → agents/entities/agent-memory-entry-lock.entity.js} +16 -19
  164. package/dist/modules/agents/entities/agent-memory-entry-lock.entity.js.map +1 -0
  165. package/dist/modules/agents/entities/agent-memory-entry-source.entity.d.ts +9 -0
  166. package/dist/modules/agents/entities/agent-memory-entry-source.entity.js +49 -0
  167. package/dist/modules/agents/entities/agent-memory-entry-source.entity.js.map +1 -0
  168. package/dist/modules/agents/entities/agent-memory-entry.entity.d.ts +15 -0
  169. package/dist/modules/agents/entities/agent-memory-entry.entity.js +65 -0
  170. package/dist/modules/agents/entities/agent-memory-entry.entity.js.map +1 -0
  171. package/dist/modules/agents/entities/agent-observation-cursor.entity.d.ts +2 -3
  172. package/dist/modules/agents/entities/agent-observation-cursor.entity.js +5 -4
  173. package/dist/modules/agents/entities/agent-observation-cursor.entity.js.map +1 -1
  174. package/dist/modules/agents/entities/agent-observation-lock.entity.d.ts +2 -3
  175. package/dist/modules/agents/entities/agent-observation-lock.entity.js +5 -4
  176. package/dist/modules/agents/entities/agent-observation-lock.entity.js.map +1 -1
  177. package/dist/modules/agents/entities/agent-observation.entity.d.ts +2 -3
  178. package/dist/modules/agents/entities/agent-observation.entity.js +6 -5
  179. package/dist/modules/agents/entities/agent-observation.entity.js.map +1 -1
  180. package/dist/modules/agents/entities/agent.entity.d.ts +3 -5
  181. package/dist/modules/agents/entities/agent.entity.js +7 -14
  182. package/dist/modules/agents/entities/agent.entity.js.map +1 -1
  183. package/dist/modules/agents/episodic-memory.d.ts +2 -0
  184. package/dist/modules/agents/episodic-memory.js +12 -0
  185. package/dist/modules/agents/episodic-memory.js.map +1 -0
  186. package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +2 -1
  187. package/dist/modules/agents/integrations/agent-chat-bridge.js +19 -5
  188. package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
  189. package/dist/modules/agents/integrations/agent-schedule.service.js +10 -6
  190. package/dist/modules/agents/integrations/agent-schedule.service.js.map +1 -1
  191. package/dist/modules/agents/integrations/chat-integration.service.js +1 -1
  192. package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
  193. package/dist/modules/agents/integrations/n8n-memory.d.ts +41 -18
  194. package/dist/modules/agents/integrations/n8n-memory.js +519 -77
  195. package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
  196. package/dist/modules/agents/integrations/platforms/slack-integration.js +2 -12
  197. package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -1
  198. package/dist/modules/agents/integrations/rich-interaction-tool.d.ts +1 -1
  199. package/dist/modules/agents/integrations/rich-interaction-tool.js +2 -2
  200. package/dist/modules/agents/integrations/rich-interaction-tool.js.map +1 -1
  201. package/dist/modules/agents/integrations/slack-app-setup.service.d.ts +52 -0
  202. package/dist/modules/agents/integrations/slack-app-setup.service.js +316 -0
  203. package/dist/modules/agents/integrations/slack-app-setup.service.js.map +1 -0
  204. package/dist/modules/agents/json-config/from-json-config.d.ts +2 -3
  205. package/dist/modules/agents/json-config/from-json-config.js +76 -61
  206. package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
  207. package/dist/modules/agents/json-config/schema-text-serializer.js +2 -1
  208. package/dist/modules/agents/json-config/schema-text-serializer.js.map +1 -1
  209. package/dist/modules/agents/repositories/agent-history.repository.d.ts +19 -0
  210. package/dist/modules/agents/repositories/agent-history.repository.js +51 -0
  211. package/dist/modules/agents/repositories/agent-history.repository.js.map +1 -0
  212. package/dist/modules/agents/repositories/agent-memory-entry-cursor.repository.d.ts +5 -0
  213. package/dist/modules/{instance-ai/repositories/instance-ai-workflow-snapshot.repository.js → agents/repositories/agent-memory-entry-cursor.repository.js} +8 -8
  214. package/dist/modules/agents/repositories/agent-memory-entry-cursor.repository.js.map +1 -0
  215. package/dist/modules/agents/repositories/agent-memory-entry-lock.repository.d.ts +5 -0
  216. package/dist/modules/{instance-ai/repositories/instance-ai-observational-memory.repository.js → agents/repositories/agent-memory-entry-lock.repository.js} +8 -8
  217. package/dist/modules/agents/repositories/agent-memory-entry-lock.repository.js.map +1 -0
  218. package/dist/modules/agents/repositories/agent-memory-entry-source.repository.d.ts +5 -0
  219. package/dist/modules/agents/repositories/agent-memory-entry-source.repository.js +26 -0
  220. package/dist/modules/agents/repositories/agent-memory-entry-source.repository.js.map +1 -0
  221. package/dist/modules/agents/repositories/agent-memory-entry.repository.d.ts +5 -0
  222. package/dist/modules/agents/repositories/agent-memory-entry.repository.js +26 -0
  223. package/dist/modules/agents/repositories/agent-memory-entry.repository.js.map +1 -0
  224. package/dist/modules/agents/repositories/agent.repository.js +3 -3
  225. package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
  226. package/dist/modules/agents/runtime/agent-secure-runtime.js +5 -5
  227. package/dist/modules/agents/runtime/agent-secure-runtime.js.map +1 -1
  228. package/dist/modules/agents/tools/environment-tool.d.ts +1 -1
  229. package/dist/modules/agents/tools/environment-tool.js +3 -3
  230. package/dist/modules/agents/tools/environment-tool.js.map +1 -1
  231. package/dist/modules/agents/tools/node-tool-factory.js +5 -5
  232. package/dist/modules/agents/tools/node-tool-factory.js.map +1 -1
  233. package/dist/modules/agents/tools/workflow-tool-factory.js +3 -3
  234. package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
  235. package/dist/modules/agents/tracing/builder-telemetry.d.ts +2 -3
  236. package/dist/modules/agents/tracing/builder-telemetry.js +36 -3
  237. package/dist/modules/agents/tracing/builder-telemetry.js.map +1 -1
  238. package/dist/modules/agents/utils/agent-draft.utils.js +1 -2
  239. package/dist/modules/agents/utils/agent-draft.utils.js.map +1 -1
  240. package/dist/modules/agents/utils/agent-memory-scope.d.ts +3 -0
  241. package/dist/modules/agents/utils/agent-memory-scope.js +15 -0
  242. package/dist/modules/agents/utils/agent-memory-scope.js.map +1 -0
  243. package/dist/modules/chat-hub/chat-hub.constants.js +4 -0
  244. package/dist/modules/chat-hub/chat-hub.constants.js.map +1 -1
  245. package/dist/modules/chat-hub/context-limits.js +1 -0
  246. package/dist/modules/chat-hub/context-limits.js.map +1 -1
  247. package/dist/modules/dynamic-credentials.ee/constants.d.ts +3 -0
  248. package/dist/modules/dynamic-credentials.ee/constants.js +7 -0
  249. package/dist/modules/dynamic-credentials.ee/constants.js.map +1 -0
  250. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js +14 -2
  251. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js.map +1 -1
  252. package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.d.ts +2 -2
  253. package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js +18 -4
  254. package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js.map +1 -1
  255. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.d.ts +1 -1
  256. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js +4 -1
  257. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js.map +1 -1
  258. package/dist/modules/dynamic-credentials.ee/errors/system-resolver-modification.error.d.ts +4 -0
  259. package/dist/modules/dynamic-credentials.ee/errors/system-resolver-modification.error.js +11 -0
  260. package/dist/modules/dynamic-credentials.ee/errors/system-resolver-modification.error.js.map +1 -0
  261. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.d.ts +7 -0
  262. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js +40 -0
  263. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js.map +1 -0
  264. package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.d.ts +3 -1
  265. package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js +6 -3
  266. package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js.map +1 -1
  267. package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.d.ts +2 -0
  268. package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js +22 -0
  269. package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js.map +1 -1
  270. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.d.ts +3 -1
  271. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js +7 -3
  272. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js.map +1 -1
  273. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.d.ts +4 -1
  274. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js +11 -3
  275. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js.map +1 -1
  276. package/dist/modules/dynamic-credentials.ee/services/index.d.ts +2 -0
  277. package/dist/modules/dynamic-credentials.ee/services/index.js +2 -0
  278. package/dist/modules/dynamic-credentials.ee/services/index.js.map +1 -1
  279. package/dist/modules/dynamic-credentials.ee/services/n8n-resolver-seeder.service.d.ts +14 -0
  280. package/dist/modules/dynamic-credentials.ee/services/n8n-resolver-seeder.service.js +70 -0
  281. package/dist/modules/dynamic-credentials.ee/services/n8n-resolver-seeder.service.js.map +1 -0
  282. package/dist/modules/insights/insights-collection.service.js +1 -1
  283. package/dist/modules/insights/insights-collection.service.js.map +1 -1
  284. package/dist/modules/instance-ai/entities/index.d.ts +6 -2
  285. package/dist/modules/instance-ai/entities/index.js +9 -5
  286. package/dist/modules/instance-ai/entities/index.js.map +1 -1
  287. package/dist/modules/instance-ai/entities/instance-ai-checkpoint.entity.d.ts +12 -0
  288. package/dist/modules/instance-ai/entities/instance-ai-checkpoint.entity.js +54 -0
  289. package/dist/modules/instance-ai/entities/instance-ai-checkpoint.entity.js.map +1 -0
  290. package/dist/modules/instance-ai/entities/instance-ai-observation-cursor.entity.d.ts +6 -0
  291. package/dist/modules/instance-ai/entities/instance-ai-observation-cursor.entity.js +33 -0
  292. package/dist/modules/instance-ai/entities/instance-ai-observation-cursor.entity.js.map +1 -0
  293. package/dist/modules/instance-ai/entities/instance-ai-observation-lock.entity.d.ts +8 -0
  294. package/dist/modules/instance-ai/entities/instance-ai-observation-lock.entity.js +37 -0
  295. package/dist/modules/instance-ai/entities/instance-ai-observation-lock.entity.js.map +1 -0
  296. package/dist/modules/instance-ai/entities/instance-ai-observation.entity.d.ts +12 -0
  297. package/dist/modules/instance-ai/entities/instance-ai-observation.entity.js +52 -0
  298. package/dist/modules/instance-ai/entities/instance-ai-observation.entity.js.map +1 -0
  299. package/dist/modules/instance-ai/entities/instance-ai-pending-confirmation.entity.d.ts +19 -0
  300. package/dist/modules/instance-ai/entities/instance-ai-pending-confirmation.entity.js +82 -0
  301. package/dist/modules/instance-ai/entities/instance-ai-pending-confirmation.entity.js.map +1 -0
  302. package/dist/modules/instance-ai/entities/instance-ai-run-snapshot.entity.d.ts +2 -0
  303. package/dist/modules/instance-ai/entities/instance-ai-run-snapshot.entity.js +8 -0
  304. package/dist/modules/instance-ai/entities/instance-ai-run-snapshot.entity.js.map +1 -1
  305. package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.d.ts +12 -2
  306. package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js +40 -4
  307. package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js.map +1 -1
  308. package/dist/modules/instance-ai/eval/execution.service.d.ts +8 -2
  309. package/dist/modules/instance-ai/eval/execution.service.js +137 -47
  310. package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
  311. package/dist/modules/instance-ai/eval/llm-wire-server.d.ts +31 -0
  312. package/dist/modules/instance-ai/eval/llm-wire-server.js +127 -0
  313. package/dist/modules/instance-ai/eval/llm-wire-server.js.map +1 -0
  314. package/dist/modules/instance-ai/eval/openai-envelope.d.ts +6 -0
  315. package/dist/modules/instance-ai/eval/openai-envelope.js +96 -0
  316. package/dist/modules/instance-ai/eval/openai-envelope.js.map +1 -0
  317. package/dist/modules/instance-ai/eval/proxy-loopback.d.ts +1 -0
  318. package/dist/modules/instance-ai/eval/proxy-loopback.js +44 -0
  319. package/dist/modules/instance-ai/eval/proxy-loopback.js.map +1 -0
  320. package/dist/modules/instance-ai/eval/sub-agent-eval.service.js +29 -7
  321. package/dist/modules/instance-ai/eval/sub-agent-eval.service.js.map +1 -1
  322. package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +7 -1
  323. package/dist/modules/instance-ai/eval/workflow-analysis.js +178 -3
  324. package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
  325. package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +6 -6
  326. package/dist/modules/instance-ai/instance-ai-memory.service.js +44 -85
  327. package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
  328. package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +2 -1
  329. package/dist/modules/instance-ai/instance-ai-settings.service.js +11 -22
  330. package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
  331. package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +2 -0
  332. package/dist/modules/instance-ai/instance-ai.adapter.service.js +105 -13
  333. package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
  334. package/dist/modules/instance-ai/instance-ai.module.d.ts +1 -1
  335. package/dist/modules/instance-ai/instance-ai.module.js +10 -6
  336. package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
  337. package/dist/modules/instance-ai/instance-ai.service.d.ts +34 -12
  338. package/dist/modules/instance-ai/instance-ai.service.js +724 -264
  339. package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
  340. package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.d.ts +4 -1
  341. package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js +3 -1
  342. package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js.map +1 -1
  343. package/dist/modules/instance-ai/message-parser.d.ts +3 -3
  344. package/dist/modules/instance-ai/message-parser.js +65 -61
  345. package/dist/modules/instance-ai/message-parser.js.map +1 -1
  346. package/dist/modules/instance-ai/node-definition-resolver.js +12 -48
  347. package/dist/modules/instance-ai/node-definition-resolver.js.map +1 -1
  348. package/dist/modules/instance-ai/repositories/index.d.ts +4 -2
  349. package/dist/modules/instance-ai/repositories/index.js +9 -5
  350. package/dist/modules/instance-ai/repositories/index.js.map +1 -1
  351. package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.d.ts +5 -0
  352. package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js +26 -0
  353. package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js.map +1 -0
  354. package/dist/modules/instance-ai/repositories/instance-ai-observation-cursor.repository.d.ts +5 -0
  355. package/dist/modules/instance-ai/repositories/instance-ai-observation-cursor.repository.js +26 -0
  356. package/dist/modules/instance-ai/repositories/instance-ai-observation-cursor.repository.js.map +1 -0
  357. package/dist/modules/instance-ai/repositories/instance-ai-observation-lock.repository.d.ts +5 -0
  358. package/dist/modules/instance-ai/repositories/instance-ai-observation-lock.repository.js +26 -0
  359. package/dist/modules/instance-ai/repositories/instance-ai-observation-lock.repository.js.map +1 -0
  360. package/dist/modules/instance-ai/repositories/instance-ai-observation.repository.d.ts +5 -0
  361. package/dist/modules/{agents/repositories/agent-published-version.repository.js → instance-ai/repositories/instance-ai-observation.repository.js} +8 -17
  362. package/dist/modules/instance-ai/repositories/instance-ai-observation.repository.js.map +1 -0
  363. package/dist/modules/instance-ai/storage/db-snapshot-storage.d.ts +2 -0
  364. package/dist/modules/instance-ai/storage/db-snapshot-storage.js +12 -2
  365. package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -1
  366. package/dist/modules/instance-ai/storage/index.d.ts +2 -3
  367. package/dist/modules/instance-ai/storage/index.js +5 -7
  368. package/dist/modules/instance-ai/storage/index.js.map +1 -1
  369. package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.d.ts +15 -0
  370. package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js +94 -0
  371. package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js.map +1 -0
  372. package/dist/modules/instance-ai/storage/typeorm-agent-memory.d.ts +94 -0
  373. package/dist/modules/instance-ai/storage/typeorm-agent-memory.js +324 -0
  374. package/dist/modules/instance-ai/storage/typeorm-agent-memory.js.map +1 -0
  375. package/dist/modules/instance-ai/storage/typeorm-observation-log-store.d.ts +37 -0
  376. package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js +212 -0
  377. package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js.map +1 -0
  378. package/dist/modules/instance-ai/web-research/fetch-and-extract.js +34 -11
  379. package/dist/modules/instance-ai/web-research/fetch-and-extract.js.map +1 -1
  380. package/dist/modules/mcp/mcp.service.js +5 -5
  381. package/dist/modules/mcp/mcp.service.js.map +1 -1
  382. package/dist/modules/mcp/tools/schemas.d.ts +24 -24
  383. package/dist/modules/mcp/tools/search-projects.tool.js +59 -13
  384. package/dist/modules/mcp/tools/search-projects.tool.js.map +1 -1
  385. package/dist/modules/mcp/tools/test-workflow.tool.d.ts +2 -2
  386. package/dist/modules/mcp/tools/workflow-builder/connection-structure-check.d.ts +35 -0
  387. package/dist/modules/mcp/tools/workflow-builder/connection-structure-check.js +88 -0
  388. package/dist/modules/mcp/tools/workflow-builder/connection-structure-check.js.map +1 -0
  389. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.d.ts +3 -2
  390. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +41 -9
  391. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
  392. package/dist/modules/mcp/tools/workflow-builder/data-table-validation.d.ts +13 -0
  393. package/dist/modules/mcp/tools/workflow-builder/data-table-validation.js +87 -0
  394. package/dist/modules/mcp/tools/workflow-builder/data-table-validation.js.map +1 -0
  395. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +2 -1
  396. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +42 -6
  397. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
  398. package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.d.ts +2 -1
  399. package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +5 -1
  400. package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -1
  401. package/dist/modules/mcp/tools/workflow-validation.utils.js +1 -1
  402. package/dist/modules/mcp/tools/workflow-validation.utils.js.map +1 -1
  403. package/dist/modules/mcp-registry/mcp-registry-test.controller.js +5 -1
  404. package/dist/modules/mcp-registry/mcp-registry-test.controller.js.map +1 -1
  405. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.d.ts +18 -0
  406. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +73 -0
  407. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -0
  408. package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +5 -0
  409. package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +31 -0
  410. package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -0
  411. package/dist/modules/n8n-packages/io/package-writer.d.ts +6 -0
  412. package/dist/{scaling/multi-main-setup.types.js → modules/n8n-packages/io/package-writer.js} +1 -1
  413. package/dist/modules/n8n-packages/io/package-writer.js.map +1 -0
  414. package/dist/modules/n8n-packages/io/slug.utils.d.ts +1 -0
  415. package/dist/modules/n8n-packages/io/slug.utils.js +16 -0
  416. package/dist/modules/n8n-packages/io/slug.utils.js.map +1 -0
  417. package/dist/modules/n8n-packages/io/tar/tar-package-writer.d.ts +9 -0
  418. package/dist/modules/n8n-packages/io/tar/tar-package-writer.js +71 -0
  419. package/dist/modules/n8n-packages/io/tar/tar-package-writer.js.map +1 -0
  420. package/dist/modules/n8n-packages/n8n-packages.controller.d.ts +10 -0
  421. package/dist/modules/n8n-packages/n8n-packages.controller.js +45 -0
  422. package/dist/modules/n8n-packages/n8n-packages.controller.js.map +1 -0
  423. package/dist/modules/{inbound-secrets/inbound-secrets.module.d.ts → n8n-packages/n8n-packages.module.d.ts} +1 -1
  424. package/dist/modules/{inbound-secrets/inbound-secrets.module.js → n8n-packages/n8n-packages.module.js} +12 -16
  425. package/dist/modules/n8n-packages/n8n-packages.module.js.map +1 -0
  426. package/dist/modules/n8n-packages/n8n-packages.service.d.ts +10 -0
  427. package/dist/modules/n8n-packages/n8n-packages.service.js +49 -0
  428. package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -0
  429. package/dist/modules/n8n-packages/n8n-packages.types.d.ts +5 -0
  430. package/dist/modules/n8n-packages/n8n-packages.types.js +3 -0
  431. package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -0
  432. package/dist/modules/n8n-packages/spec/constants.d.ts +1 -0
  433. package/dist/modules/n8n-packages/spec/constants.js +5 -0
  434. package/dist/modules/n8n-packages/spec/constants.js.map +1 -0
  435. package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +55 -0
  436. package/dist/modules/n8n-packages/spec/manifest.schema.js +17 -0
  437. package/dist/modules/n8n-packages/spec/manifest.schema.js.map +1 -0
  438. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +169 -0
  439. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +46 -0
  440. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +1 -0
  441. package/dist/modules/oauth-jwe/oauth-jwe-decrypt.service.d.ts +5 -1
  442. package/dist/modules/oauth-jwe/oauth-jwe-decrypt.service.js +18 -2
  443. package/dist/modules/oauth-jwe/oauth-jwe-decrypt.service.js.map +1 -1
  444. package/dist/modules/oauth-jwe/oauth-jwe.utils.js +27 -2
  445. package/dist/modules/oauth-jwe/oauth-jwe.utils.js.map +1 -1
  446. package/dist/modules/otel/execution-level-tracer.js +1 -0
  447. package/dist/modules/otel/execution-level-tracer.js.map +1 -1
  448. package/dist/modules/otel/execution-level-tracer.types.d.ts +11 -6
  449. package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
  450. package/dist/modules/otel/otel-lifecycle-handler.d.ts +5 -1
  451. package/dist/modules/otel/otel-lifecycle-handler.js +30 -2
  452. package/dist/modules/otel/otel-lifecycle-handler.js.map +1 -1
  453. package/dist/modules/otel/otel.constants.d.ts +1 -0
  454. package/dist/modules/otel/otel.constants.js +1 -0
  455. package/dist/modules/otel/otel.constants.js.map +1 -1
  456. package/dist/modules/runtime-credentials/path-traversal.js.map +1 -0
  457. package/dist/modules/runtime-credentials/runtime-credentials-access.service.d.ts +8 -0
  458. package/dist/modules/runtime-credentials/runtime-credentials-access.service.js +35 -0
  459. package/dist/modules/runtime-credentials/runtime-credentials-access.service.js.map +1 -0
  460. package/dist/modules/{inbound-secrets/inbound-secrets-context-hook.d.ts → runtime-credentials/runtime-credentials-context-hook.d.ts} +4 -5
  461. package/dist/modules/{inbound-secrets/inbound-secrets-context-hook.js → runtime-credentials/runtime-credentials-context-hook.js} +14 -22
  462. package/dist/modules/runtime-credentials/runtime-credentials-context-hook.js.map +1 -0
  463. package/dist/modules/runtime-credentials/runtime-credentials.config.d.ts +3 -0
  464. package/dist/modules/{inbound-secrets/inbound-secrets.config.js → runtime-credentials/runtime-credentials.config.js} +7 -7
  465. package/dist/modules/runtime-credentials/runtime-credentials.config.js.map +1 -0
  466. package/dist/modules/runtime-credentials/runtime-credentials.module.d.ts +4 -0
  467. package/dist/modules/runtime-credentials/runtime-credentials.module.js +65 -0
  468. package/dist/modules/runtime-credentials/runtime-credentials.module.js.map +1 -0
  469. package/dist/modules/runtime-credentials/runtime-credentials.schemas.d.ts +23 -0
  470. package/dist/modules/runtime-credentials/runtime-credentials.schemas.js +10 -0
  471. package/dist/modules/runtime-credentials/runtime-credentials.schemas.js.map +1 -0
  472. package/dist/modules/runtime-credentials/runtime-credentials.service.d.ts +18 -0
  473. package/dist/modules/{inbound-secrets/inbound-secrets.service.js → runtime-credentials/runtime-credentials.service.js} +31 -28
  474. package/dist/modules/runtime-credentials/runtime-credentials.service.js.map +1 -0
  475. package/dist/modules/source-control.ee/source-control-export.service.ee.d.ts +1 -1
  476. package/dist/modules/source-control.ee/source-control-export.service.ee.js +3 -1
  477. package/dist/modules/source-control.ee/source-control-export.service.ee.js.map +1 -1
  478. package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +2 -2
  479. package/dist/modules/source-control.ee/source-control-import.service.ee.js +29 -8
  480. package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
  481. package/dist/modules/source-control.ee/source-control-status.service.ee.js +4 -4
  482. package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -1
  483. package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +2 -2
  484. package/dist/modules/source-control.ee/source-control.service.ee.d.ts +1 -1
  485. package/dist/modules/source-control.ee/types/exportable-workflow.d.ts +2 -1
  486. package/dist/modules/sso-saml/saml.service.ee.js +5 -1
  487. package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
  488. package/dist/modules/workflow-index/workflow-dependency.controller.d.ts +1 -4
  489. package/dist/modules/workflow-index/workflow-dependency.controller.js +2 -13
  490. package/dist/modules/workflow-index/workflow-dependency.controller.js.map +1 -1
  491. package/dist/node-catalog/node-catalog.service.d.ts +1 -2
  492. package/dist/node-catalog/node-catalog.service.js +6 -10
  493. package/dist/node-catalog/node-catalog.service.js.map +1 -1
  494. package/dist/node-execution/ephemeral-node-executor.js +19 -11
  495. package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
  496. package/dist/oauth/oauth-jwe-service.proxy.d.ts +12 -2
  497. package/dist/oauth/oauth-jwe-service.proxy.js +5 -0
  498. package/dist/oauth/oauth-jwe-service.proxy.js.map +1 -1
  499. package/dist/oauth/oauth.service.d.ts +6 -1
  500. package/dist/oauth/oauth.service.js +42 -4
  501. package/dist/oauth/oauth.service.js.map +1 -1
  502. package/dist/permissions.ee/check-access.d.ts +2 -2
  503. package/dist/permissions.ee/check-access.js +15 -11
  504. package/dist/permissions.ee/check-access.js.map +1 -1
  505. package/dist/posthog/index.d.ts +2 -0
  506. package/dist/posthog/index.js +28 -6
  507. package/dist/posthog/index.js.map +1 -1
  508. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.d.ts +10 -0
  509. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +42 -0
  510. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -0
  511. package/dist/public-api/v1/openapi.yml +55 -0
  512. package/dist/requests.d.ts +1 -1
  513. package/dist/scaling/constants.js +3 -0
  514. package/dist/scaling/constants.js.map +1 -1
  515. package/dist/scaling/multi-main-setup.ee.d.ts +12 -7
  516. package/dist/scaling/multi-main-setup.ee.js +125 -22
  517. package/dist/scaling/multi-main-setup.ee.js.map +1 -1
  518. package/dist/server.d.ts +1 -0
  519. package/dist/server.js +3 -4
  520. package/dist/server.js.map +1 -1
  521. package/dist/services/dynamic-node-parameters.service.d.ts +0 -1
  522. package/dist/services/dynamic-node-parameters.service.js +6 -14
  523. package/dist/services/dynamic-node-parameters.service.js.map +1 -1
  524. package/dist/services/frontend.service.js +1 -1
  525. package/dist/services/frontend.service.js.map +1 -1
  526. package/dist/services/import.service.js +3 -1
  527. package/dist/services/import.service.js.map +1 -1
  528. package/dist/services/proxy-token-manager.js +2 -13
  529. package/dist/services/proxy-token-manager.js.map +1 -1
  530. package/dist/services/runtime-credential-proxy.service.d.ts +9 -0
  531. package/dist/services/runtime-credential-proxy.service.js +29 -0
  532. package/dist/services/runtime-credential-proxy.service.js.map +1 -0
  533. package/dist/services/url.service.d.ts +1 -0
  534. package/dist/services/url.service.js +3 -0
  535. package/dist/services/url.service.js.map +1 -1
  536. package/dist/telemetry/index.d.ts +4 -1
  537. package/dist/telemetry/index.js +16 -8
  538. package/dist/telemetry/index.js.map +1 -1
  539. package/dist/utils.d.ts +2 -1
  540. package/dist/utils.js +10 -0
  541. package/dist/utils.js.map +1 -1
  542. package/dist/webhooks/live-webhooks.js +2 -2
  543. package/dist/webhooks/live-webhooks.js.map +1 -1
  544. package/dist/webhooks/webhook-helpers.js +1 -1
  545. package/dist/webhooks/webhook-helpers.js.map +1 -1
  546. package/dist/workflow-execute-additional-data.d.ts +3 -1
  547. package/dist/workflow-execute-additional-data.js +26 -3
  548. package/dist/workflow-execute-additional-data.js.map +1 -1
  549. package/dist/workflow-helpers.d.ts +3 -1
  550. package/dist/workflow-helpers.js +39 -5
  551. package/dist/workflow-helpers.js.map +1 -1
  552. package/dist/workflow-hook-context.service.d.ts +6 -0
  553. package/dist/workflow-hook-context.service.js +32 -0
  554. package/dist/workflow-hook-context.service.js.map +1 -0
  555. package/dist/workflow-runner.js +2 -1
  556. package/dist/workflow-runner.js.map +1 -1
  557. package/dist/workflows/utils.d.ts +3 -0
  558. package/dist/workflows/utils.js +19 -0
  559. package/dist/workflows/utils.js.map +1 -1
  560. package/dist/workflows/workflow-creation.service.js +4 -2
  561. package/dist/workflows/workflow-creation.service.js.map +1 -1
  562. package/dist/workflows/workflow-execution.service.d.ts +4 -3
  563. package/dist/workflows/workflow-execution.service.js +8 -3
  564. package/dist/workflows/workflow-execution.service.js.map +1 -1
  565. package/dist/workflows/workflow-finder.service.d.ts +6 -2
  566. package/dist/workflows/workflow-finder.service.js +18 -0
  567. package/dist/workflows/workflow-finder.service.js.map +1 -1
  568. package/dist/workflows/workflow-history/workflow-history.controller.d.ts +1 -1
  569. package/dist/workflows/workflow-history/workflow-history.service.d.ts +2 -1
  570. package/dist/workflows/workflow-history/workflow-history.service.js +1 -0
  571. package/dist/workflows/workflow-history/workflow-history.service.js.map +1 -1
  572. package/dist/workflows/workflow-validation.service.d.ts +3 -1
  573. package/dist/workflows/workflow-validation.service.js +6 -3
  574. package/dist/workflows/workflow-validation.service.js.map +1 -1
  575. package/dist/workflows/workflow.service.d.ts +3 -3
  576. package/dist/workflows/workflow.service.js +26 -4
  577. package/dist/workflows/workflow.service.js.map +1 -1
  578. package/dist/workflows/workflows.controller.d.ts +31 -21
  579. package/dist/workflows/workflows.controller.js +6 -2
  580. package/dist/workflows/workflows.controller.js.map +1 -1
  581. package/package.json +37 -35
  582. package/dist/modules/agents/entities/agent-published-version.entity.js.map +0 -1
  583. package/dist/modules/agents/repositories/agent-published-version.repository.d.ts +0 -20
  584. package/dist/modules/agents/repositories/agent-published-version.repository.js.map +0 -1
  585. package/dist/modules/inbound-secrets/inbound-secrets-context-hook.js.map +0 -1
  586. package/dist/modules/inbound-secrets/inbound-secrets.config.d.ts +0 -3
  587. package/dist/modules/inbound-secrets/inbound-secrets.config.js.map +0 -1
  588. package/dist/modules/inbound-secrets/inbound-secrets.module.js.map +0 -1
  589. package/dist/modules/inbound-secrets/inbound-secrets.schemas.d.ts +0 -3
  590. package/dist/modules/inbound-secrets/inbound-secrets.schemas.js +0 -6
  591. package/dist/modules/inbound-secrets/inbound-secrets.schemas.js.map +0 -1
  592. package/dist/modules/inbound-secrets/inbound-secrets.service.d.ts +0 -17
  593. package/dist/modules/inbound-secrets/inbound-secrets.service.js.map +0 -1
  594. package/dist/modules/inbound-secrets/path-traversal.js.map +0 -1
  595. package/dist/modules/instance-ai/compaction.service.d.ts +0 -24
  596. package/dist/modules/instance-ai/compaction.service.js +0 -213
  597. package/dist/modules/instance-ai/compaction.service.js.map +0 -1
  598. package/dist/modules/instance-ai/entities/instance-ai-observational-memory.entity.d.ts +0 -33
  599. package/dist/modules/instance-ai/entities/instance-ai-observational-memory.entity.js +0 -145
  600. package/dist/modules/instance-ai/entities/instance-ai-observational-memory.entity.js.map +0 -1
  601. package/dist/modules/instance-ai/entities/instance-ai-workflow-snapshot.entity.d.ts +0 -8
  602. package/dist/modules/instance-ai/entities/instance-ai-workflow-snapshot.entity.js.map +0 -1
  603. package/dist/modules/instance-ai/repositories/instance-ai-observational-memory.repository.d.ts +0 -5
  604. package/dist/modules/instance-ai/repositories/instance-ai-observational-memory.repository.js.map +0 -1
  605. package/dist/modules/instance-ai/repositories/instance-ai-workflow-snapshot.repository.d.ts +0 -5
  606. package/dist/modules/instance-ai/repositories/instance-ai-workflow-snapshot.repository.js.map +0 -1
  607. package/dist/modules/instance-ai/snapshot-pruning.service.d.ts +0 -17
  608. package/dist/modules/instance-ai/snapshot-pruning.service.js +0 -89
  609. package/dist/modules/instance-ai/snapshot-pruning.service.js.map +0 -1
  610. package/dist/modules/instance-ai/storage/typeorm-composite-store.d.ts +0 -9
  611. package/dist/modules/instance-ai/storage/typeorm-composite-store.js +0 -33
  612. package/dist/modules/instance-ai/storage/typeorm-composite-store.js.map +0 -1
  613. package/dist/modules/instance-ai/storage/typeorm-memory-storage.d.ts +0 -96
  614. package/dist/modules/instance-ai/storage/typeorm-memory-storage.js +0 -864
  615. package/dist/modules/instance-ai/storage/typeorm-memory-storage.js.map +0 -1
  616. package/dist/modules/instance-ai/storage/typeorm-workflows-storage.d.ts +0 -44
  617. package/dist/modules/instance-ai/storage/typeorm-workflows-storage.js +0 -156
  618. package/dist/modules/instance-ai/storage/typeorm-workflows-storage.js.map +0 -1
  619. package/dist/scaling/multi-main-setup-legacy.d.ts +0 -25
  620. package/dist/scaling/multi-main-setup-legacy.js +0 -75
  621. package/dist/scaling/multi-main-setup-legacy.js.map +0 -1
  622. package/dist/scaling/multi-main-setup-v2.d.ts +0 -25
  623. package/dist/scaling/multi-main-setup-v2.js +0 -143
  624. package/dist/scaling/multi-main-setup-v2.js.map +0 -1
  625. package/dist/scaling/multi-main-setup.types.d.ts +0 -6
  626. package/dist/scaling/multi-main-setup.types.js.map +0 -1
  627. /package/dist/modules/{inbound-secrets → runtime-credentials}/path-traversal.d.ts +0 -0
  628. /package/dist/modules/{inbound-secrets → runtime-credentials}/path-traversal.js +0 -0
@@ -0,0 +1,5 @@
1
+ import { DataSource, Repository } from '@n8n/typeorm';
2
+ import { InstanceAiObservation } from '../entities/instance-ai-observation.entity';
3
+ export declare class InstanceAiObservationRepository extends Repository<InstanceAiObservation> {
4
+ constructor(dataSource: DataSource);
5
+ }
@@ -9,27 +9,18 @@ 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
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AgentPublishedVersionRepository = void 0;
12
+ exports.InstanceAiObservationRepository = void 0;
13
13
  const di_1 = require("@n8n/di");
14
14
  const typeorm_1 = require("@n8n/typeorm");
15
- const agent_published_version_entity_1 = require("../entities/agent-published-version.entity");
16
- let AgentPublishedVersionRepository = class AgentPublishedVersionRepository extends typeorm_1.Repository {
15
+ const instance_ai_observation_entity_1 = require("../entities/instance-ai-observation.entity");
16
+ let InstanceAiObservationRepository = class InstanceAiObservationRepository extends typeorm_1.Repository {
17
17
  constructor(dataSource) {
18
- super(agent_published_version_entity_1.AgentPublishedVersion, dataSource.manager);
19
- }
20
- async savePublishedVersion(data, trx) {
21
- const repo = trx?.getRepository(agent_published_version_entity_1.AgentPublishedVersion) ?? this;
22
- await repo.upsert({ ...data, updatedAt: new Date() }, ['agentId']);
23
- return await repo.findOneByOrFail({ agentId: data.agentId });
24
- }
25
- async deleteByAgentId(agentId, trx) {
26
- const repo = trx?.getRepository(agent_published_version_entity_1.AgentPublishedVersion) ?? this;
27
- await repo.delete({ agentId });
18
+ super(instance_ai_observation_entity_1.InstanceAiObservation, dataSource.manager);
28
19
  }
29
20
  };
30
- exports.AgentPublishedVersionRepository = AgentPublishedVersionRepository;
31
- exports.AgentPublishedVersionRepository = AgentPublishedVersionRepository = __decorate([
21
+ exports.InstanceAiObservationRepository = InstanceAiObservationRepository;
22
+ exports.InstanceAiObservationRepository = InstanceAiObservationRepository = __decorate([
32
23
  (0, di_1.Service)(),
33
24
  __metadata("design:paramtypes", [typeorm_1.DataSource])
34
- ], AgentPublishedVersionRepository);
35
- //# sourceMappingURL=agent-published-version.repository.js.map
25
+ ], InstanceAiObservationRepository);
26
+ //# sourceMappingURL=instance-ai-observation.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance-ai-observation.repository.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/repositories/instance-ai-observation.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAClC,0CAAsD;AAEtD,+FAAmF;AAG5E,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,oBAAiC;IACrF,YAAY,UAAsB;QACjC,KAAK,CAAC,sDAAqB,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;CACD,CAAA;AAJY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,YAAO,GAAE;qCAEe,oBAAU;GADtB,+BAA+B,CAI3C"}
@@ -4,6 +4,8 @@ import { InstanceAiRunSnapshotRepository } from '../repositories/instance-ai-run
4
4
  export interface SaveSnapshotOptions {
5
5
  messageGroupId?: string;
6
6
  runIds?: string[];
7
+ traceId?: string;
8
+ spanId?: string;
7
9
  langsmithRunId?: string;
8
10
  langsmithTraceId?: string;
9
11
  }
@@ -40,6 +40,8 @@ let DbSnapshotStorage = class DbSnapshotStorage {
40
40
  runId: row.runId,
41
41
  messageGroupId: row.messageGroupId ?? undefined,
42
42
  runIds: row.runIds ?? undefined,
43
+ traceId: row.traceId ?? undefined,
44
+ spanId: row.spanId ?? undefined,
43
45
  langsmithRunId: row.langsmithRunId ?? undefined,
44
46
  langsmithTraceId: row.langsmithTraceId ?? undefined,
45
47
  createdAt: row.createdAt,
@@ -47,19 +49,21 @@ let DbSnapshotStorage = class DbSnapshotStorage {
47
49
  };
48
50
  }
49
51
  async save(threadId, agentTree, runId, options = {}) {
50
- const { messageGroupId, runIds, langsmithRunId, langsmithTraceId } = options;
52
+ const { messageGroupId, runIds, traceId, spanId, langsmithRunId, langsmithTraceId } = options;
51
53
  await this.repo.upsert({
52
54
  threadId,
53
55
  runId,
54
56
  messageGroupId: messageGroupId ?? null,
55
57
  runIds: runIds ?? null,
56
58
  tree: JSON.stringify(agentTree),
59
+ traceId: traceId ?? null,
60
+ spanId: spanId ?? null,
57
61
  langsmithRunId: langsmithRunId ?? null,
58
62
  langsmithTraceId: langsmithTraceId ?? null,
59
63
  }, ['threadId', 'runId']);
60
64
  }
61
65
  async updateLast(threadId, agentTree, runId, options = {}) {
62
- const { messageGroupId, runIds, langsmithRunId, langsmithTraceId } = options;
66
+ const { messageGroupId, runIds, traceId, spanId, langsmithRunId, langsmithTraceId } = options;
63
67
  if (messageGroupId) {
64
68
  const existing = await this.repo.findOne({
65
69
  where: { threadId, messageGroupId },
@@ -71,6 +75,8 @@ let DbSnapshotStorage = class DbSnapshotStorage {
71
75
  tree: JSON.stringify(agentTree),
72
76
  messageGroupId,
73
77
  runIds: runIds ?? existing.runIds,
78
+ traceId: traceId ?? existing.traceId,
79
+ spanId: spanId ?? existing.spanId,
74
80
  langsmithRunId: langsmithRunId ?? existing.langsmithRunId,
75
81
  langsmithTraceId: langsmithTraceId ?? existing.langsmithTraceId,
76
82
  });
@@ -83,6 +89,8 @@ let DbSnapshotStorage = class DbSnapshotStorage {
83
89
  tree: JSON.stringify(agentTree),
84
90
  messageGroupId: messageGroupId ?? byRunId.messageGroupId,
85
91
  runIds: runIds ?? byRunId.runIds,
92
+ traceId: traceId ?? byRunId.traceId,
93
+ spanId: spanId ?? byRunId.spanId,
86
94
  langsmithRunId: langsmithRunId ?? byRunId.langsmithRunId,
87
95
  langsmithTraceId: langsmithTraceId ?? byRunId.langsmithTraceId,
88
96
  });
@@ -100,6 +108,8 @@ let DbSnapshotStorage = class DbSnapshotStorage {
100
108
  runId: r.runId,
101
109
  messageGroupId: r.messageGroupId ?? undefined,
102
110
  runIds: r.runIds ?? undefined,
111
+ traceId: r.traceId ?? undefined,
112
+ spanId: r.spanId ?? undefined,
103
113
  langsmithRunId: r.langsmithRunId ?? undefined,
104
114
  langsmithTraceId: r.langsmithTraceId ?? undefined,
105
115
  createdAt: r.createdAt,
@@ -1 +1 @@
1
- {"version":3,"file":"db-snapshot-storage.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/storage/db-snapshot-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,gCAAkC;AAElC,+CAAyC;AAEzC,6GAAsG;AAU/F,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC7B,YAA6B,IAAqC;QAArC,SAAI,GAAJ,IAAI,CAAiC;IAAG,CAAC;IAEtE,KAAK,CAAC,SAAS,CACd,QAAgB,EAChB,UAAuD,EAAE;QAEzD,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1C,MAAM,GAAG,GAAG,cAAc;YACzB,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;gBACxB,KAAK,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE;gBACnC,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE;aAC5B,CAAC;YACH,CAAC,CAAC,KAAK;gBACN,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;oBACxB,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;oBAC1B,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE;iBAC5B,CAAC;gBACH,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;oBACxB,KAAK,EAAE,EAAE,QAAQ,EAAE;oBACnB,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE;iBAC5B,CAAC,CAAC;QAEN,IAAI,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC;QAE3B,OAAO;YACN,IAAI,EAAE,IAAA,wBAAS,EAAsB,GAAG,CAAC,IAAI,CAAC;YAC9C,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,cAAc,EAAE,GAAG,CAAC,cAA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;QACpF,IAAI,CAAC,GAAG,EAAE,cAAc,IAAI,CAAC,GAAG,CAAC,gBAAgB;YAAE,OAAO,SAAS,CAAC;QACpE,OAAO,EAAE,cAAc,EAAE,GAAG,CAAC,cAAc,EAAE,gBAAgB,EAAE,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACvF,CAAC;CACD,CAAA;AA1JY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,YAAO,GAAE;qCAE0B,qEAA+B;GADtD,iBAAiB,CA0J7B"}
@@ -1,5 +1,4 @@
1
- export { TypeORMMemoryStorage } from './typeorm-memory-storage';
2
- export { TypeORMWorkflowsStorage } from './typeorm-workflows-storage';
3
- export { TypeORMCompositeStore } from './typeorm-composite-store';
4
1
  export { DbSnapshotStorage } from './db-snapshot-storage';
5
2
  export { DbIterationLogStorage } from './db-iteration-log-storage';
3
+ export { TypeORMAgentCheckpointStore } from './typeorm-agent-checkpoint-store';
4
+ export { TypeORMAgentMemory } from './typeorm-agent-memory';
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DbIterationLogStorage = exports.DbSnapshotStorage = exports.TypeORMCompositeStore = exports.TypeORMWorkflowsStorage = exports.TypeORMMemoryStorage = void 0;
4
- var typeorm_memory_storage_1 = require("./typeorm-memory-storage");
5
- Object.defineProperty(exports, "TypeORMMemoryStorage", { enumerable: true, get: function () { return typeorm_memory_storage_1.TypeORMMemoryStorage; } });
6
- var typeorm_workflows_storage_1 = require("./typeorm-workflows-storage");
7
- Object.defineProperty(exports, "TypeORMWorkflowsStorage", { enumerable: true, get: function () { return typeorm_workflows_storage_1.TypeORMWorkflowsStorage; } });
8
- var typeorm_composite_store_1 = require("./typeorm-composite-store");
9
- Object.defineProperty(exports, "TypeORMCompositeStore", { enumerable: true, get: function () { return typeorm_composite_store_1.TypeORMCompositeStore; } });
3
+ exports.TypeORMAgentMemory = exports.TypeORMAgentCheckpointStore = exports.DbIterationLogStorage = exports.DbSnapshotStorage = void 0;
10
4
  var db_snapshot_storage_1 = require("./db-snapshot-storage");
11
5
  Object.defineProperty(exports, "DbSnapshotStorage", { enumerable: true, get: function () { return db_snapshot_storage_1.DbSnapshotStorage; } });
12
6
  var db_iteration_log_storage_1 = require("./db-iteration-log-storage");
13
7
  Object.defineProperty(exports, "DbIterationLogStorage", { enumerable: true, get: function () { return db_iteration_log_storage_1.DbIterationLogStorage; } });
8
+ var typeorm_agent_checkpoint_store_1 = require("./typeorm-agent-checkpoint-store");
9
+ Object.defineProperty(exports, "TypeORMAgentCheckpointStore", { enumerable: true, get: function () { return typeorm_agent_checkpoint_store_1.TypeORMAgentCheckpointStore; } });
10
+ var typeorm_agent_memory_1 = require("./typeorm-agent-memory");
11
+ Object.defineProperty(exports, "TypeORMAgentMemory", { enumerable: true, get: function () { return typeorm_agent_memory_1.TypeORMAgentMemory; } });
14
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/storage/index.ts"],"names":[],"mappings":";;;AAAA,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,yEAAsE;AAA7D,oIAAA,uBAAuB,OAAA;AAChC,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/storage/index.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA;AACpC,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA"}
@@ -0,0 +1,15 @@
1
+ import type { CheckpointStore, SerializableAgentState } from '@n8n/instance-ai';
2
+ import { InstanceAiCheckpointRepository } from '../repositories/instance-ai-checkpoint.repository';
3
+ export declare class TypeORMAgentCheckpointStore implements CheckpointStore {
4
+ private readonly checkpointRepo;
5
+ private readonly loadQueues;
6
+ constructor(checkpointRepo: InstanceAiCheckpointRepository);
7
+ save(key: string, state: SerializableAgentState): Promise<void>;
8
+ load(key: string): Promise<SerializableAgentState | undefined>;
9
+ delete(key: string): Promise<void>;
10
+ deleteOlderThan(olderThan: Date): Promise<number>;
11
+ private loadAndDelete;
12
+ private getRunId;
13
+ private supportsPessimisticWriteLock;
14
+ private serializeLoad;
15
+ }
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TypeORMAgentCheckpointStore = void 0;
13
+ const di_1 = require("@n8n/di");
14
+ const typeorm_1 = require("@n8n/typeorm");
15
+ const n8n_workflow_1 = require("n8n-workflow");
16
+ const instance_ai_checkpoint_entity_1 = require("../entities/instance-ai-checkpoint.entity");
17
+ const instance_ai_checkpoint_repository_1 = require("../repositories/instance-ai-checkpoint.repository");
18
+ let TypeORMAgentCheckpointStore = class TypeORMAgentCheckpointStore {
19
+ constructor(checkpointRepo) {
20
+ this.checkpointRepo = checkpointRepo;
21
+ this.loadQueues = new Map();
22
+ }
23
+ async save(key, state) {
24
+ const threadId = state.persistence?.threadId;
25
+ if (!threadId) {
26
+ throw new n8n_workflow_1.UnexpectedError('Instance AI checkpoint state is missing a thread id', {
27
+ extra: { key },
28
+ });
29
+ }
30
+ const checkpoint = this.checkpointRepo.create({
31
+ key,
32
+ runId: this.getRunId(key),
33
+ threadId,
34
+ resourceId: state.persistence?.resourceId ?? null,
35
+ state,
36
+ });
37
+ await this.checkpointRepo.save(checkpoint);
38
+ }
39
+ async load(key) {
40
+ return await this.serializeLoad(key, async () => await this.loadAndDelete(key));
41
+ }
42
+ async delete(key) {
43
+ await this.checkpointRepo.delete({ key });
44
+ }
45
+ async deleteOlderThan(olderThan) {
46
+ const result = await this.checkpointRepo.delete({ updatedAt: (0, typeorm_1.LessThan)(olderThan) });
47
+ return result.affected ?? 0;
48
+ }
49
+ async loadAndDelete(key) {
50
+ return await this.checkpointRepo.manager.transaction(async (manager) => {
51
+ const repo = manager.getRepository(instance_ai_checkpoint_entity_1.InstanceAiCheckpoint);
52
+ const checkpoint = await repo.findOne({
53
+ where: { key },
54
+ ...(this.supportsPessimisticWriteLock(manager)
55
+ ? { lock: { mode: 'pessimistic_write' } }
56
+ : {}),
57
+ });
58
+ if (!checkpoint)
59
+ return undefined;
60
+ const result = await repo.delete({ key });
61
+ if (result.affected === 0)
62
+ return undefined;
63
+ return checkpoint.state ?? undefined;
64
+ });
65
+ }
66
+ getRunId(key) {
67
+ const separatorIndex = key.lastIndexOf(':');
68
+ if (separatorIndex < 0 || separatorIndex === key.length - 1)
69
+ return null;
70
+ return key.slice(separatorIndex + 1);
71
+ }
72
+ supportsPessimisticWriteLock(manager) {
73
+ return manager.connection.options.type === 'postgres';
74
+ }
75
+ async serializeLoad(key, load) {
76
+ const previous = this.loadQueues.get(key) ?? Promise.resolve(undefined);
77
+ const next = previous.catch(() => undefined).then(load);
78
+ this.loadQueues.set(key, next);
79
+ try {
80
+ return await next;
81
+ }
82
+ finally {
83
+ if (this.loadQueues.get(key) === next) {
84
+ this.loadQueues.delete(key);
85
+ }
86
+ }
87
+ }
88
+ };
89
+ exports.TypeORMAgentCheckpointStore = TypeORMAgentCheckpointStore;
90
+ exports.TypeORMAgentCheckpointStore = TypeORMAgentCheckpointStore = __decorate([
91
+ (0, di_1.Service)(),
92
+ __metadata("design:paramtypes", [instance_ai_checkpoint_repository_1.InstanceAiCheckpointRepository])
93
+ ], TypeORMAgentCheckpointStore);
94
+ //# sourceMappingURL=typeorm-agent-checkpoint-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeorm-agent-checkpoint-store.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/storage/typeorm-agent-checkpoint-store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAElC,0CAA4D;AAC5D,+CAA+C;AAE/C,6FAAiF;AACjF,yGAAmG;AAG5F,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAGvC,YAA6B,cAA8C;QAA9C,mBAAc,GAAd,cAAc,CAAgC;QAF1D,eAAU,GAAG,IAAI,GAAG,EAAuD,CAAC;IAEf,CAAC;IAE/E,KAAK,CAAC,IAAI,CAAC,GAAW,EAAE,KAA6B;QACpD,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,EAAE,QAAQ,CAAC;QAC7C,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,MAAM,IAAI,8BAAe,CAAC,qDAAqD,EAAE;gBAChF,KAAK,EAAE,EAAE,GAAG,EAAE;aACd,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;YAC7C,GAAG;YACH,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;YACzB,QAAQ;YACR,UAAU,EAAE,KAAK,CAAC,WAAW,EAAE,UAAU,IAAI,IAAI;YACjD,KAAK;SACL,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;IAED,K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ockStore, type MemoryDescriptor, type NewObservationLogEntry, type ObservationCursor, type ObservationLogEntry, type ObservationLogReadOptions, type ObservationLogReflection, type ObservationLogReflectionResult, type ObservationLogScope, type ObservationLogTaskKind, type ObservationLogTaskLockHandle } from '@n8n/agents';
2
+ import { Logger } from '@n8n/backend-common';
3
+ import type { AgentDbMessage, BuiltMemory, Thread, ThreadPatch } from '@n8n/instance-ai';
4
+ import { InstanceAiMessageRepository } from '../repositories/instance-ai-message.repository';
5
+ import { InstanceAiObservationCursorRepository } from '../repositories/instance-ai-observation-cursor.repository';
6
+ import { InstanceAiObservationLockRepository } from '../repositories/instance-ai-observation-lock.repository';
7
+ import { InstanceAiObservationRepository } from '../repositories/instance-ai-observation.repository';
8
+ import { InstanceAiResourceRepository } from '../repositories/instance-ai-resource.repository';
9
+ import { InstanceAiThreadRepository } from '../repositories/instance-ai-thread.repository';
10
+ export declare class TypeORMAgentMemory implements BuiltMemory, BuiltObservationLogStore, BuiltObservationLogTaskLockStore {
11
+ private readonly threadRepo;
12
+ private readonly messageRepo;
13
+ private readonly resourceRepo;
14
+ private readonly threadMutationQueues;
15
+ private readonly observationLog;
16
+ constructor(threadRepo: InstanceAiThreadRepository, messageRepo: InstanceAiMessageRepository, resourceRepo: InstanceAiResourceRepository, observationRepo: InstanceAiObservationRepository, observationCursorRepo: InstanceAiObservationCursorRepository, observationLockRepo: InstanceAiObservationLockRepository, logger: Logger);
17
+ private readonly logger;
18
+ describe(): MemoryDescriptor;
19
+ getThread(threadId: string): Promise<Thread | null>;
20
+ listThreads(args: {
21
+ filter?: {
22
+ resourceId?: string;
23
+ };
24
+ perPage?: number;
25
+ page?: number;
26
+ orderBy?: {
27
+ field: 'createdAt' | 'updatedAt';
28
+ direction: 'ASC' | 'DESC';
29
+ };
30
+ }): Promise<{
31
+ threads: Thread[];
32
+ total: number;
33
+ page: number;
34
+ hasMore: boolean;
35
+ }>;
36
+ saveThread(thread: Omit<Thread, 'createdAt' | 'updatedAt'>): Promise<Thread>;
37
+ patchThread(args: {
38
+ threadId: string;
39
+ update: (current: Thread) => ThreadPatch | null | undefined;
40
+ }): Promise<Thread | null>;
41
+ deleteThread(threadId: string): Promise<void>;
42
+ deleteThreadsByResourceIdPrefix(resourceIdPrefix: string): Promise<void>;
43
+ getMessages(threadId: string, opts?: {
44
+ limit?: number;
45
+ before?: Date;
46
+ }): Promise<AgentDbMessage[]>;
47
+ listMessages(args: {
48
+ threadId: string;
49
+ limit?: number;
50
+ page?: number;
51
+ }): Promise<{
52
+ messages: AgentDbMessage[];
53
+ }>;
54
+ saveMessages(args: {
55
+ threadId: string;
56
+ resourceId: string;
57
+ messages: AgentDbMessage[];
58
+ }): Promise<void>;
59
+ deleteMessages(messageIds: string[]): Promise<void>;
60
+ getWorkingMemory(params: {
61
+ threadId: string;
62
+ resourceId: string;
63
+ scope: 'resource' | 'thread';
64
+ }): Promise<string | null>;
65
+ saveWorkingMemory(params: {
66
+ threadId: string;
67
+ resourceId: string;
68
+ scope: 'resource' | 'thread';
69
+ }, content: string): Promise<void>;
70
+ appendObservationLogEntries(rows: NewObservationLogEntry[]): Promise<ObservationLogEntry[]>;
71
+ getActiveObservationLog(scope: ObservationLogScope & {
72
+ limit?: number;
73
+ order?: 'asc' | 'desc';
74
+ }): Promise<ObservationLogEntry[]>;
75
+ getObservationLog(opts: ObservationLogReadOptions): Promise<ObservationLogEntry[]>;
76
+ getMessagesForObservationScope(observationScopeId: string, opts?: {
77
+ since?: {
78
+ sinceCreatedAt: Date;
79
+ sinceMessageId: string;
80
+ };
81
+ }): Promise<AgentDbMessage[]>;
82
+ dropObservationLogEntries(ids: string[]): Promise<void>;
83
+ supersedeObservationLogEntries(ids: string[], supersededBy: string): Promise<void>;
84
+ applyObservationLogReflection(scope: ObservationLogScope, reflection: ObservationLogReflection): Promise<ObservationLogReflectionResult>;
85
+ getCursor(observationScopeId: string): Promise<ObservationCursor | null>;
86
+ setCursor(cursor: ObservationCursor): Promise<void>;
87
+ acquireObservationLogTaskLock(observationScopeId: string, taskKind: ObservationLogTaskKind, opts: {
88
+ ttlMs: number;
89
+ holderId: string;
90
+ }): Promise<ObservationLogTaskLockHandle | null>;
91
+ releaseObservationLogTaskLock(handle: ObservationLogTaskLockHandle): Promise<void>;
92
+ private serializeThreadMutation;
93
+ private toAgentMessage;
94
+ }