n8n 2.22.4 → 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 (626) 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 -4
  89. package/dist/manual-execution.service.js +3 -0
  90. package/dist/manual-execution.service.js.map +1 -1
  91. package/dist/modules/agents/agent-execution.service.js +5 -5
  92. package/dist/modules/agents/agent-execution.service.js.map +1 -1
  93. package/dist/modules/agents/agent-sse-stream.js +17 -1
  94. package/dist/modules/agents/agent-sse-stream.js.map +1 -1
  95. package/dist/modules/agents/agents-tools.service.js +7 -5
  96. package/dist/modules/agents/agents-tools.service.js.map +1 -1
  97. package/dist/modules/agents/agents.controller.d.ts +29 -3
  98. package/dist/modules/agents/agents.controller.js +88 -7
  99. package/dist/modules/agents/agents.controller.js.map +1 -1
  100. package/dist/modules/agents/agents.module.d.ts +1 -1
  101. package/dist/modules/agents/agents.module.js +12 -6
  102. package/dist/modules/agents/agents.module.js.map +1 -1
  103. package/dist/modules/agents/agents.service.d.ts +7 -8
  104. package/dist/modules/agents/agents.service.js +120 -65
  105. package/dist/modules/agents/agents.service.js.map +1 -1
  106. package/dist/modules/agents/builder/agents-builder-model-recommendations.d.ts +1 -1
  107. package/dist/modules/agents/builder/agents-builder-model-recommendations.js +3 -3
  108. package/dist/modules/agents/builder/agents-builder-model-recommendations.js.map +1 -1
  109. package/dist/modules/agents/builder/agents-builder-prompts.d.ts +9 -17
  110. package/dist/modules/agents/builder/agents-builder-prompts.js +145 -549
  111. package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
  112. package/dist/modules/agents/builder/agents-builder-settings.service.js +2 -2
  113. package/dist/modules/agents/builder/agents-builder-settings.service.js.map +1 -1
  114. package/dist/modules/agents/builder/agents-builder-tools.service.js +10 -10
  115. package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
  116. package/dist/modules/agents/builder/agents-builder.service.d.ts +3 -1
  117. package/dist/modules/agents/builder/agents-builder.service.js +58 -9
  118. package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
  119. package/dist/modules/agents/builder/interactive/ask-credential.tool.js +2 -2
  120. package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -1
  121. package/dist/modules/agents/builder/interactive/ask-llm.tool.js +2 -2
  122. package/dist/modules/agents/builder/interactive/ask-llm.tool.js.map +1 -1
  123. package/dist/modules/agents/builder/interactive/ask-question.tool.js +2 -2
  124. package/dist/modules/agents/builder/interactive/ask-question.tool.js.map +1 -1
  125. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +2 -2
  126. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
  127. package/dist/modules/agents/builder/prompts/config-mutation.prompt.d.ts +1 -0
  128. package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +132 -0
  129. package/dist/modules/agents/builder/prompts/config-mutation.prompt.js.map +1 -0
  130. package/dist/modules/agents/builder/prompts/config-rules.prompt.d.ts +2 -0
  131. package/dist/modules/agents/builder/prompts/config-rules.prompt.js +63 -0
  132. package/dist/modules/agents/builder/prompts/config-rules.prompt.js.map +1 -0
  133. package/dist/modules/agents/builder/prompts/llm-selection.prompt.d.ts +1 -0
  134. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +47 -0
  135. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -0
  136. package/dist/modules/agents/builder/prompts/memory.prompt.d.ts +1 -0
  137. package/dist/modules/agents/builder/prompts/memory.prompt.js +60 -0
  138. package/dist/modules/agents/builder/prompts/memory.prompt.js.map +1 -0
  139. package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -0
  140. package/dist/modules/agents/builder/prompts/tools.prompt.js +81 -0
  141. package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -0
  142. package/dist/modules/agents/builder/skills/index.d.ts +2 -0
  143. package/dist/modules/agents/builder/skills/index.js +12 -0
  144. package/dist/modules/agents/builder/skills/index.js.map +1 -0
  145. package/dist/modules/agents/builder/skills/integrations.skill.d.ts +2 -0
  146. package/dist/modules/agents/builder/skills/integrations.skill.js +53 -0
  147. package/dist/modules/agents/builder/skills/integrations.skill.js.map +1 -0
  148. package/dist/modules/agents/builder/skills/research.skill.d.ts +2 -0
  149. package/dist/modules/agents/builder/skills/research.skill.js +42 -0
  150. package/dist/modules/agents/builder/skills/research.skill.js.map +1 -0
  151. package/dist/modules/agents/builder/skills/target-skills.skill.d.ts +2 -0
  152. package/dist/modules/agents/builder/skills/target-skills.skill.js +59 -0
  153. package/dist/modules/agents/builder/skills/target-skills.skill.js.map +1 -0
  154. package/dist/modules/agents/entities/{agent-published-version.entity.d.ts → agent-history.entity.d.ts} +4 -7
  155. package/dist/modules/agents/entities/{agent-published-version.entity.js → agent-history.entity.js} +22 -34
  156. package/dist/modules/agents/entities/agent-history.entity.js.map +1 -0
  157. package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.d.ts +7 -0
  158. package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.js +38 -0
  159. package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.js.map +1 -0
  160. package/dist/modules/agents/entities/agent-memory-entry-lock.entity.d.ts +7 -0
  161. package/dist/modules/{instance-ai/entities/instance-ai-workflow-snapshot.entity.js → agents/entities/agent-memory-entry-lock.entity.js} +16 -19
  162. package/dist/modules/agents/entities/agent-memory-entry-lock.entity.js.map +1 -0
  163. package/dist/modules/agents/entities/agent-memory-entry-source.entity.d.ts +9 -0
  164. package/dist/modules/agents/entities/agent-memory-entry-source.entity.js +49 -0
  165. package/dist/modules/agents/entities/agent-memory-entry-source.entity.js.map +1 -0
  166. package/dist/modules/agents/entities/agent-memory-entry.entity.d.ts +15 -0
  167. package/dist/modules/agents/entities/agent-memory-entry.entity.js +65 -0
  168. package/dist/modules/agents/entities/agent-memory-entry.entity.js.map +1 -0
  169. package/dist/modules/agents/entities/agent-observation-cursor.entity.d.ts +2 -3
  170. package/dist/modules/agents/entities/agent-observation-cursor.entity.js +5 -4
  171. package/dist/modules/agents/entities/agent-observation-cursor.entity.js.map +1 -1
  172. package/dist/modules/agents/entities/agent-observation-lock.entity.d.ts +2 -3
  173. package/dist/modules/agents/entities/agent-observation-lock.entity.js +5 -4
  174. package/dist/modules/agents/entities/agent-observation-lock.entity.js.map +1 -1
  175. package/dist/modules/agents/entities/agent-observation.entity.d.ts +2 -3
  176. package/dist/modules/agents/entities/agent-observation.entity.js +6 -5
  177. package/dist/modules/agents/entities/agent-observation.entity.js.map +1 -1
  178. package/dist/modules/agents/entities/agent.entity.d.ts +3 -5
  179. package/dist/modules/agents/entities/agent.entity.js +7 -14
  180. package/dist/modules/agents/entities/agent.entity.js.map +1 -1
  181. package/dist/modules/agents/episodic-memory.d.ts +2 -0
  182. package/dist/modules/agents/episodic-memory.js +12 -0
  183. package/dist/modules/agents/episodic-memory.js.map +1 -0
  184. package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +2 -1
  185. package/dist/modules/agents/integrations/agent-chat-bridge.js +19 -5
  186. package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
  187. package/dist/modules/agents/integrations/agent-schedule.service.js +10 -6
  188. package/dist/modules/agents/integrations/agent-schedule.service.js.map +1 -1
  189. package/dist/modules/agents/integrations/chat-integration.service.js +1 -1
  190. package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
  191. package/dist/modules/agents/integrations/n8n-memory.d.ts +41 -18
  192. package/dist/modules/agents/integrations/n8n-memory.js +519 -77
  193. package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
  194. package/dist/modules/agents/integrations/platforms/slack-integration.js +2 -12
  195. package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -1
  196. package/dist/modules/agents/integrations/rich-interaction-tool.d.ts +1 -1
  197. package/dist/modules/agents/integrations/rich-interaction-tool.js +2 -2
  198. package/dist/modules/agents/integrations/rich-interaction-tool.js.map +1 -1
  199. package/dist/modules/agents/integrations/slack-app-setup.service.d.ts +52 -0
  200. package/dist/modules/agents/integrations/slack-app-setup.service.js +316 -0
  201. package/dist/modules/agents/integrations/slack-app-setup.service.js.map +1 -0
  202. package/dist/modules/agents/json-config/from-json-config.d.ts +2 -3
  203. package/dist/modules/agents/json-config/from-json-config.js +76 -61
  204. package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
  205. package/dist/modules/agents/json-config/schema-text-serializer.js +2 -1
  206. package/dist/modules/agents/json-config/schema-text-serializer.js.map +1 -1
  207. package/dist/modules/agents/repositories/agent-history.repository.d.ts +19 -0
  208. package/dist/modules/agents/repositories/agent-history.repository.js +51 -0
  209. package/dist/modules/agents/repositories/agent-history.repository.js.map +1 -0
  210. package/dist/modules/agents/repositories/agent-memory-entry-cursor.repository.d.ts +5 -0
  211. package/dist/modules/{instance-ai/repositories/instance-ai-workflow-snapshot.repository.js → agents/repositories/agent-memory-entry-cursor.repository.js} +8 -8
  212. package/dist/modules/agents/repositories/agent-memory-entry-cursor.repository.js.map +1 -0
  213. package/dist/modules/agents/repositories/agent-memory-entry-lock.repository.d.ts +5 -0
  214. package/dist/modules/{instance-ai/repositories/instance-ai-observational-memory.repository.js → agents/repositories/agent-memory-entry-lock.repository.js} +8 -8
  215. package/dist/modules/agents/repositories/agent-memory-entry-lock.repository.js.map +1 -0
  216. package/dist/modules/agents/repositories/agent-memory-entry-source.repository.d.ts +5 -0
  217. package/dist/modules/agents/repositories/agent-memory-entry-source.repository.js +26 -0
  218. package/dist/modules/agents/repositories/agent-memory-entry-source.repository.js.map +1 -0
  219. package/dist/modules/agents/repositories/agent-memory-entry.repository.d.ts +5 -0
  220. package/dist/modules/agents/repositories/agent-memory-entry.repository.js +26 -0
  221. package/dist/modules/agents/repositories/agent-memory-entry.repository.js.map +1 -0
  222. package/dist/modules/agents/repositories/agent.repository.js +3 -3
  223. package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
  224. package/dist/modules/agents/runtime/agent-secure-runtime.js +5 -5
  225. package/dist/modules/agents/runtime/agent-secure-runtime.js.map +1 -1
  226. package/dist/modules/agents/tools/environment-tool.d.ts +1 -1
  227. package/dist/modules/agents/tools/environment-tool.js +3 -3
  228. package/dist/modules/agents/tools/environment-tool.js.map +1 -1
  229. package/dist/modules/agents/tools/node-tool-factory.js +5 -5
  230. package/dist/modules/agents/tools/node-tool-factory.js.map +1 -1
  231. package/dist/modules/agents/tools/workflow-tool-factory.js +3 -3
  232. package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
  233. package/dist/modules/agents/tracing/builder-telemetry.d.ts +2 -3
  234. package/dist/modules/agents/tracing/builder-telemetry.js +36 -3
  235. package/dist/modules/agents/tracing/builder-telemetry.js.map +1 -1
  236. package/dist/modules/agents/utils/agent-draft.utils.js +1 -2
  237. package/dist/modules/agents/utils/agent-draft.utils.js.map +1 -1
  238. package/dist/modules/agents/utils/agent-memory-scope.d.ts +3 -0
  239. package/dist/modules/agents/utils/agent-memory-scope.js +15 -0
  240. package/dist/modules/agents/utils/agent-memory-scope.js.map +1 -0
  241. package/dist/modules/chat-hub/chat-hub.constants.js +4 -0
  242. package/dist/modules/chat-hub/chat-hub.constants.js.map +1 -1
  243. package/dist/modules/chat-hub/context-limits.js +1 -0
  244. package/dist/modules/chat-hub/context-limits.js.map +1 -1
  245. package/dist/modules/dynamic-credentials.ee/constants.d.ts +3 -0
  246. package/dist/modules/dynamic-credentials.ee/constants.js +7 -0
  247. package/dist/modules/dynamic-credentials.ee/constants.js.map +1 -0
  248. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js +14 -2
  249. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js.map +1 -1
  250. package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.d.ts +2 -2
  251. package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js +18 -4
  252. package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js.map +1 -1
  253. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.d.ts +1 -1
  254. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js +4 -1
  255. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js.map +1 -1
  256. package/dist/modules/dynamic-credentials.ee/errors/system-resolver-modification.error.d.ts +4 -0
  257. package/dist/modules/dynamic-credentials.ee/errors/system-resolver-modification.error.js +11 -0
  258. package/dist/modules/dynamic-credentials.ee/errors/system-resolver-modification.error.js.map +1 -0
  259. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.d.ts +7 -0
  260. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js +40 -0
  261. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js.map +1 -0
  262. package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.d.ts +3 -1
  263. package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js +6 -3
  264. package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js.map +1 -1
  265. package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.d.ts +2 -0
  266. package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js +22 -0
  267. package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js.map +1 -1
  268. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.d.ts +3 -1
  269. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js +7 -3
  270. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js.map +1 -1
  271. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.d.ts +4 -1
  272. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js +11 -3
  273. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js.map +1 -1
  274. package/dist/modules/dynamic-credentials.ee/services/index.d.ts +2 -0
  275. package/dist/modules/dynamic-credentials.ee/services/index.js +2 -0
  276. package/dist/modules/dynamic-credentials.ee/services/index.js.map +1 -1
  277. package/dist/modules/dynamic-credentials.ee/services/n8n-resolver-seeder.service.d.ts +14 -0
  278. package/dist/modules/dynamic-credentials.ee/services/n8n-resolver-seeder.service.js +70 -0
  279. package/dist/modules/dynamic-credentials.ee/services/n8n-resolver-seeder.service.js.map +1 -0
  280. package/dist/modules/insights/insights-collection.service.js +1 -1
  281. package/dist/modules/insights/insights-collection.service.js.map +1 -1
  282. package/dist/modules/instance-ai/entities/index.d.ts +6 -2
  283. package/dist/modules/instance-ai/entities/index.js +9 -5
  284. package/dist/modules/instance-ai/entities/index.js.map +1 -1
  285. package/dist/modules/instance-ai/entities/instance-ai-checkpoint.entity.d.ts +12 -0
  286. package/dist/modules/instance-ai/entities/instance-ai-checkpoint.entity.js +54 -0
  287. package/dist/modules/instance-ai/entities/instance-ai-checkpoint.entity.js.map +1 -0
  288. package/dist/modules/instance-ai/entities/instance-ai-observation-cursor.entity.d.ts +6 -0
  289. package/dist/modules/instance-ai/entities/instance-ai-observation-cursor.entity.js +33 -0
  290. package/dist/modules/instance-ai/entities/instance-ai-observation-cursor.entity.js.map +1 -0
  291. package/dist/modules/instance-ai/entities/instance-ai-observation-lock.entity.d.ts +8 -0
  292. package/dist/modules/instance-ai/entities/instance-ai-observation-lock.entity.js +37 -0
  293. package/dist/modules/instance-ai/entities/instance-ai-observation-lock.entity.js.map +1 -0
  294. package/dist/modules/instance-ai/entities/instance-ai-observation.entity.d.ts +12 -0
  295. package/dist/modules/instance-ai/entities/instance-ai-observation.entity.js +52 -0
  296. package/dist/modules/instance-ai/entities/instance-ai-observation.entity.js.map +1 -0
  297. package/dist/modules/instance-ai/entities/instance-ai-pending-confirmation.entity.d.ts +19 -0
  298. package/dist/modules/instance-ai/entities/instance-ai-pending-confirmation.entity.js +82 -0
  299. package/dist/modules/instance-ai/entities/instance-ai-pending-confirmation.entity.js.map +1 -0
  300. package/dist/modules/instance-ai/entities/instance-ai-run-snapshot.entity.d.ts +2 -0
  301. package/dist/modules/instance-ai/entities/instance-ai-run-snapshot.entity.js +8 -0
  302. package/dist/modules/instance-ai/entities/instance-ai-run-snapshot.entity.js.map +1 -1
  303. package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.d.ts +12 -2
  304. package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js +40 -4
  305. package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js.map +1 -1
  306. package/dist/modules/instance-ai/eval/execution.service.d.ts +8 -2
  307. package/dist/modules/instance-ai/eval/execution.service.js +137 -47
  308. package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
  309. package/dist/modules/instance-ai/eval/llm-wire-server.d.ts +31 -0
  310. package/dist/modules/instance-ai/eval/llm-wire-server.js +127 -0
  311. package/dist/modules/instance-ai/eval/llm-wire-server.js.map +1 -0
  312. package/dist/modules/instance-ai/eval/openai-envelope.d.ts +6 -0
  313. package/dist/modules/instance-ai/eval/openai-envelope.js +96 -0
  314. package/dist/modules/instance-ai/eval/openai-envelope.js.map +1 -0
  315. package/dist/modules/instance-ai/eval/proxy-loopback.d.ts +1 -0
  316. package/dist/modules/instance-ai/eval/proxy-loopback.js +44 -0
  317. package/dist/modules/instance-ai/eval/proxy-loopback.js.map +1 -0
  318. package/dist/modules/instance-ai/eval/sub-agent-eval.service.js +29 -7
  319. package/dist/modules/instance-ai/eval/sub-agent-eval.service.js.map +1 -1
  320. package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +7 -1
  321. package/dist/modules/instance-ai/eval/workflow-analysis.js +178 -3
  322. package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
  323. package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +6 -6
  324. package/dist/modules/instance-ai/instance-ai-memory.service.js +44 -85
  325. package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
  326. package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +2 -1
  327. package/dist/modules/instance-ai/instance-ai-settings.service.js +11 -22
  328. package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
  329. package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +2 -0
  330. package/dist/modules/instance-ai/instance-ai.adapter.service.js +105 -13
  331. package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
  332. package/dist/modules/instance-ai/instance-ai.module.d.ts +1 -1
  333. package/dist/modules/instance-ai/instance-ai.module.js +10 -6
  334. package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
  335. package/dist/modules/instance-ai/instance-ai.service.d.ts +34 -12
  336. package/dist/modules/instance-ai/instance-ai.service.js +724 -264
  337. package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
  338. package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.d.ts +4 -1
  339. package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js +3 -1
  340. package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js.map +1 -1
  341. package/dist/modules/instance-ai/message-parser.d.ts +3 -3
  342. package/dist/modules/instance-ai/message-parser.js +65 -61
  343. package/dist/modules/instance-ai/message-parser.js.map +1 -1
  344. package/dist/modules/instance-ai/node-definition-resolver.js +12 -48
  345. package/dist/modules/instance-ai/node-definition-resolver.js.map +1 -1
  346. package/dist/modules/instance-ai/repositories/index.d.ts +4 -2
  347. package/dist/modules/instance-ai/repositories/index.js +9 -5
  348. package/dist/modules/instance-ai/repositories/index.js.map +1 -1
  349. package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.d.ts +5 -0
  350. package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js +26 -0
  351. package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js.map +1 -0
  352. package/dist/modules/instance-ai/repositories/instance-ai-observation-cursor.repository.d.ts +5 -0
  353. package/dist/modules/instance-ai/repositories/instance-ai-observation-cursor.repository.js +26 -0
  354. package/dist/modules/instance-ai/repositories/instance-ai-observation-cursor.repository.js.map +1 -0
  355. package/dist/modules/instance-ai/repositories/instance-ai-observation-lock.repository.d.ts +5 -0
  356. package/dist/modules/instance-ai/repositories/instance-ai-observation-lock.repository.js +26 -0
  357. package/dist/modules/instance-ai/repositories/instance-ai-observation-lock.repository.js.map +1 -0
  358. package/dist/modules/instance-ai/repositories/instance-ai-observation.repository.d.ts +5 -0
  359. package/dist/modules/{agents/repositories/agent-published-version.repository.js → instance-ai/repositories/instance-ai-observation.repository.js} +8 -17
  360. package/dist/modules/instance-ai/repositories/instance-ai-observation.repository.js.map +1 -0
  361. package/dist/modules/instance-ai/storage/db-snapshot-storage.d.ts +2 -0
  362. package/dist/modules/instance-ai/storage/db-snapshot-storage.js +12 -2
  363. package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -1
  364. package/dist/modules/instance-ai/storage/index.d.ts +2 -3
  365. package/dist/modules/instance-ai/storage/index.js +5 -7
  366. package/dist/modules/instance-ai/storage/index.js.map +1 -1
  367. package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.d.ts +15 -0
  368. package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js +94 -0
  369. package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js.map +1 -0
  370. package/dist/modules/instance-ai/storage/typeorm-agent-memory.d.ts +94 -0
  371. package/dist/modules/instance-ai/storage/typeorm-agent-memory.js +324 -0
  372. package/dist/modules/instance-ai/storage/typeorm-agent-memory.js.map +1 -0
  373. package/dist/modules/instance-ai/storage/typeorm-observation-log-store.d.ts +37 -0
  374. package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js +212 -0
  375. package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js.map +1 -0
  376. package/dist/modules/instance-ai/web-research/fetch-and-extract.js +34 -11
  377. package/dist/modules/instance-ai/web-research/fetch-and-extract.js.map +1 -1
  378. package/dist/modules/mcp/mcp.service.js +5 -5
  379. package/dist/modules/mcp/mcp.service.js.map +1 -1
  380. package/dist/modules/mcp/tools/schemas.d.ts +24 -24
  381. package/dist/modules/mcp/tools/search-projects.tool.js +59 -13
  382. package/dist/modules/mcp/tools/search-projects.tool.js.map +1 -1
  383. package/dist/modules/mcp/tools/test-workflow.tool.d.ts +2 -2
  384. package/dist/modules/mcp/tools/workflow-builder/connection-structure-check.d.ts +35 -0
  385. package/dist/modules/mcp/tools/workflow-builder/connection-structure-check.js +88 -0
  386. package/dist/modules/mcp/tools/workflow-builder/connection-structure-check.js.map +1 -0
  387. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.d.ts +3 -2
  388. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +41 -9
  389. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
  390. package/dist/modules/mcp/tools/workflow-builder/data-table-validation.d.ts +13 -0
  391. package/dist/modules/mcp/tools/workflow-builder/data-table-validation.js +87 -0
  392. package/dist/modules/mcp/tools/workflow-builder/data-table-validation.js.map +1 -0
  393. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +2 -1
  394. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +42 -6
  395. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
  396. package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.d.ts +2 -1
  397. package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +5 -1
  398. package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -1
  399. package/dist/modules/mcp/tools/workflow-validation.utils.js +1 -1
  400. package/dist/modules/mcp/tools/workflow-validation.utils.js.map +1 -1
  401. package/dist/modules/mcp-registry/mcp-registry-test.controller.js +5 -1
  402. package/dist/modules/mcp-registry/mcp-registry-test.controller.js.map +1 -1
  403. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.d.ts +18 -0
  404. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +73 -0
  405. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -0
  406. package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +5 -0
  407. package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +31 -0
  408. package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -0
  409. package/dist/modules/n8n-packages/io/package-writer.d.ts +6 -0
  410. package/dist/{scaling/multi-main-setup.types.js → modules/n8n-packages/io/package-writer.js} +1 -1
  411. package/dist/modules/n8n-packages/io/package-writer.js.map +1 -0
  412. package/dist/modules/n8n-packages/io/slug.utils.d.ts +1 -0
  413. package/dist/modules/n8n-packages/io/slug.utils.js +16 -0
  414. package/dist/modules/n8n-packages/io/slug.utils.js.map +1 -0
  415. package/dist/modules/n8n-packages/io/tar/tar-package-writer.d.ts +9 -0
  416. package/dist/modules/n8n-packages/io/tar/tar-package-writer.js +71 -0
  417. package/dist/modules/n8n-packages/io/tar/tar-package-writer.js.map +1 -0
  418. package/dist/modules/n8n-packages/n8n-packages.controller.d.ts +10 -0
  419. package/dist/modules/n8n-packages/n8n-packages.controller.js +45 -0
  420. package/dist/modules/n8n-packages/n8n-packages.controller.js.map +1 -0
  421. package/dist/modules/{inbound-secrets/inbound-secrets.module.d.ts → n8n-packages/n8n-packages.module.d.ts} +1 -1
  422. package/dist/modules/{inbound-secrets/inbound-secrets.module.js → n8n-packages/n8n-packages.module.js} +12 -16
  423. package/dist/modules/n8n-packages/n8n-packages.module.js.map +1 -0
  424. package/dist/modules/n8n-packages/n8n-packages.service.d.ts +10 -0
  425. package/dist/modules/n8n-packages/n8n-packages.service.js +49 -0
  426. package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -0
  427. package/dist/modules/n8n-packages/n8n-packages.types.d.ts +5 -0
  428. package/dist/modules/n8n-packages/n8n-packages.types.js +3 -0
  429. package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -0
  430. package/dist/modules/n8n-packages/spec/constants.d.ts +1 -0
  431. package/dist/modules/n8n-packages/spec/constants.js +5 -0
  432. package/dist/modules/n8n-packages/spec/constants.js.map +1 -0
  433. package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +55 -0
  434. package/dist/modules/n8n-packages/spec/manifest.schema.js +17 -0
  435. package/dist/modules/n8n-packages/spec/manifest.schema.js.map +1 -0
  436. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +169 -0
  437. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +46 -0
  438. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +1 -0
  439. package/dist/modules/oauth-jwe/oauth-jwe-decrypt.service.d.ts +5 -1
  440. package/dist/modules/oauth-jwe/oauth-jwe-decrypt.service.js +18 -2
  441. package/dist/modules/oauth-jwe/oauth-jwe-decrypt.service.js.map +1 -1
  442. package/dist/modules/oauth-jwe/oauth-jwe.utils.js +27 -2
  443. package/dist/modules/oauth-jwe/oauth-jwe.utils.js.map +1 -1
  444. package/dist/modules/otel/execution-level-tracer.js +1 -0
  445. package/dist/modules/otel/execution-level-tracer.js.map +1 -1
  446. package/dist/modules/otel/execution-level-tracer.types.d.ts +11 -6
  447. package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
  448. package/dist/modules/otel/otel-lifecycle-handler.d.ts +5 -1
  449. package/dist/modules/otel/otel-lifecycle-handler.js +30 -2
  450. package/dist/modules/otel/otel-lifecycle-handler.js.map +1 -1
  451. package/dist/modules/otel/otel.constants.d.ts +1 -0
  452. package/dist/modules/otel/otel.constants.js +1 -0
  453. package/dist/modules/otel/otel.constants.js.map +1 -1
  454. package/dist/modules/runtime-credentials/path-traversal.js.map +1 -0
  455. package/dist/modules/runtime-credentials/runtime-credentials-access.service.d.ts +8 -0
  456. package/dist/modules/runtime-credentials/runtime-credentials-access.service.js +35 -0
  457. package/dist/modules/runtime-credentials/runtime-credentials-access.service.js.map +1 -0
  458. package/dist/modules/{inbound-secrets/inbound-secrets-context-hook.d.ts → runtime-credentials/runtime-credentials-context-hook.d.ts} +4 -5
  459. package/dist/modules/{inbound-secrets/inbound-secrets-context-hook.js → runtime-credentials/runtime-credentials-context-hook.js} +14 -22
  460. package/dist/modules/runtime-credentials/runtime-credentials-context-hook.js.map +1 -0
  461. package/dist/modules/runtime-credentials/runtime-credentials.config.d.ts +3 -0
  462. package/dist/modules/{inbound-secrets/inbound-secrets.config.js → runtime-credentials/runtime-credentials.config.js} +7 -7
  463. package/dist/modules/runtime-credentials/runtime-credentials.config.js.map +1 -0
  464. package/dist/modules/runtime-credentials/runtime-credentials.module.d.ts +4 -0
  465. package/dist/modules/runtime-credentials/runtime-credentials.module.js +65 -0
  466. package/dist/modules/runtime-credentials/runtime-credentials.module.js.map +1 -0
  467. package/dist/modules/runtime-credentials/runtime-credentials.schemas.d.ts +23 -0
  468. package/dist/modules/runtime-credentials/runtime-credentials.schemas.js +10 -0
  469. package/dist/modules/runtime-credentials/runtime-credentials.schemas.js.map +1 -0
  470. package/dist/modules/runtime-credentials/runtime-credentials.service.d.ts +18 -0
  471. package/dist/modules/{inbound-secrets/inbound-secrets.service.js → runtime-credentials/runtime-credentials.service.js} +31 -28
  472. package/dist/modules/runtime-credentials/runtime-credentials.service.js.map +1 -0
  473. package/dist/modules/source-control.ee/source-control-export.service.ee.d.ts +1 -1
  474. package/dist/modules/source-control.ee/source-control-export.service.ee.js +3 -1
  475. package/dist/modules/source-control.ee/source-control-export.service.ee.js.map +1 -1
  476. package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +2 -2
  477. package/dist/modules/source-control.ee/source-control-import.service.ee.js +29 -8
  478. package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
  479. package/dist/modules/source-control.ee/source-control-status.service.ee.js +4 -4
  480. package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -1
  481. package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +2 -2
  482. package/dist/modules/source-control.ee/source-control.service.ee.d.ts +1 -1
  483. package/dist/modules/source-control.ee/types/exportable-workflow.d.ts +2 -1
  484. package/dist/modules/sso-saml/saml.service.ee.js +5 -1
  485. package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
  486. package/dist/modules/workflow-index/workflow-dependency.controller.d.ts +1 -4
  487. package/dist/modules/workflow-index/workflow-dependency.controller.js +2 -13
  488. package/dist/modules/workflow-index/workflow-dependency.controller.js.map +1 -1
  489. package/dist/node-catalog/node-catalog.service.d.ts +1 -2
  490. package/dist/node-catalog/node-catalog.service.js +6 -10
  491. package/dist/node-catalog/node-catalog.service.js.map +1 -1
  492. package/dist/node-execution/ephemeral-node-executor.js +19 -11
  493. package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
  494. package/dist/oauth/oauth-jwe-service.proxy.d.ts +12 -2
  495. package/dist/oauth/oauth-jwe-service.proxy.js +5 -0
  496. package/dist/oauth/oauth-jwe-service.proxy.js.map +1 -1
  497. package/dist/oauth/oauth.service.d.ts +6 -1
  498. package/dist/oauth/oauth.service.js +42 -4
  499. package/dist/oauth/oauth.service.js.map +1 -1
  500. package/dist/permissions.ee/check-access.d.ts +2 -2
  501. package/dist/permissions.ee/check-access.js +15 -11
  502. package/dist/permissions.ee/check-access.js.map +1 -1
  503. package/dist/posthog/index.d.ts +2 -0
  504. package/dist/posthog/index.js +28 -6
  505. package/dist/posthog/index.js.map +1 -1
  506. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.d.ts +10 -0
  507. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +42 -0
  508. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -0
  509. package/dist/public-api/v1/openapi.yml +55 -0
  510. package/dist/requests.d.ts +1 -1
  511. package/dist/scaling/constants.js +3 -0
  512. package/dist/scaling/constants.js.map +1 -1
  513. package/dist/scaling/multi-main-setup.ee.d.ts +12 -7
  514. package/dist/scaling/multi-main-setup.ee.js +125 -22
  515. package/dist/scaling/multi-main-setup.ee.js.map +1 -1
  516. package/dist/server.d.ts +1 -0
  517. package/dist/server.js +3 -4
  518. package/dist/server.js.map +1 -1
  519. package/dist/services/dynamic-node-parameters.service.d.ts +0 -1
  520. package/dist/services/dynamic-node-parameters.service.js +6 -14
  521. package/dist/services/dynamic-node-parameters.service.js.map +1 -1
  522. package/dist/services/frontend.service.js +1 -1
  523. package/dist/services/frontend.service.js.map +1 -1
  524. package/dist/services/import.service.js +3 -1
  525. package/dist/services/import.service.js.map +1 -1
  526. package/dist/services/proxy-token-manager.js +2 -13
  527. package/dist/services/proxy-token-manager.js.map +1 -1
  528. package/dist/services/runtime-credential-proxy.service.d.ts +9 -0
  529. package/dist/services/runtime-credential-proxy.service.js +29 -0
  530. package/dist/services/runtime-credential-proxy.service.js.map +1 -0
  531. package/dist/services/url.service.d.ts +1 -0
  532. package/dist/services/url.service.js +3 -0
  533. package/dist/services/url.service.js.map +1 -1
  534. package/dist/telemetry/index.d.ts +4 -1
  535. package/dist/telemetry/index.js +16 -8
  536. package/dist/telemetry/index.js.map +1 -1
  537. package/dist/utils.d.ts +2 -1
  538. package/dist/utils.js +10 -0
  539. package/dist/utils.js.map +1 -1
  540. package/dist/webhooks/live-webhooks.js +2 -2
  541. package/dist/webhooks/live-webhooks.js.map +1 -1
  542. package/dist/webhooks/webhook-helpers.js +1 -1
  543. package/dist/webhooks/webhook-helpers.js.map +1 -1
  544. package/dist/workflow-execute-additional-data.d.ts +3 -1
  545. package/dist/workflow-execute-additional-data.js +26 -3
  546. package/dist/workflow-execute-additional-data.js.map +1 -1
  547. package/dist/workflow-helpers.d.ts +3 -1
  548. package/dist/workflow-helpers.js +39 -5
  549. package/dist/workflow-helpers.js.map +1 -1
  550. package/dist/workflow-hook-context.service.d.ts +6 -0
  551. package/dist/workflow-hook-context.service.js +32 -0
  552. package/dist/workflow-hook-context.service.js.map +1 -0
  553. package/dist/workflow-runner.js +2 -1
  554. package/dist/workflow-runner.js.map +1 -1
  555. package/dist/workflows/utils.d.ts +3 -0
  556. package/dist/workflows/utils.js +19 -0
  557. package/dist/workflows/utils.js.map +1 -1
  558. package/dist/workflows/workflow-creation.service.js +4 -2
  559. package/dist/workflows/workflow-creation.service.js.map +1 -1
  560. package/dist/workflows/workflow-execution.service.d.ts +4 -3
  561. package/dist/workflows/workflow-execution.service.js +8 -3
  562. package/dist/workflows/workflow-execution.service.js.map +1 -1
  563. package/dist/workflows/workflow-finder.service.d.ts +6 -2
  564. package/dist/workflows/workflow-finder.service.js +18 -0
  565. package/dist/workflows/workflow-finder.service.js.map +1 -1
  566. package/dist/workflows/workflow-history/workflow-history.controller.d.ts +1 -1
  567. package/dist/workflows/workflow-history/workflow-history.service.d.ts +2 -1
  568. package/dist/workflows/workflow-history/workflow-history.service.js +1 -0
  569. package/dist/workflows/workflow-history/workflow-history.service.js.map +1 -1
  570. package/dist/workflows/workflow-validation.service.d.ts +3 -1
  571. package/dist/workflows/workflow-validation.service.js +6 -3
  572. package/dist/workflows/workflow-validation.service.js.map +1 -1
  573. package/dist/workflows/workflow.service.d.ts +3 -3
  574. package/dist/workflows/workflow.service.js +26 -4
  575. package/dist/workflows/workflow.service.js.map +1 -1
  576. package/dist/workflows/workflows.controller.d.ts +31 -21
  577. package/dist/workflows/workflows.controller.js +6 -2
  578. package/dist/workflows/workflows.controller.js.map +1 -1
  579. package/package.json +36 -34
  580. package/dist/modules/agents/entities/agent-published-version.entity.js.map +0 -1
  581. package/dist/modules/agents/repositories/agent-published-version.repository.d.ts +0 -20
  582. package/dist/modules/agents/repositories/agent-published-version.repository.js.map +0 -1
  583. package/dist/modules/inbound-secrets/inbound-secrets-context-hook.js.map +0 -1
  584. package/dist/modules/inbound-secrets/inbound-secrets.config.d.ts +0 -3
  585. package/dist/modules/inbound-secrets/inbound-secrets.config.js.map +0 -1
  586. package/dist/modules/inbound-secrets/inbound-secrets.module.js.map +0 -1
  587. package/dist/modules/inbound-secrets/inbound-secrets.schemas.d.ts +0 -3
  588. package/dist/modules/inbound-secrets/inbound-secrets.schemas.js +0 -6
  589. package/dist/modules/inbound-secrets/inbound-secrets.schemas.js.map +0 -1
  590. package/dist/modules/inbound-secrets/inbound-secrets.service.d.ts +0 -17
  591. package/dist/modules/inbound-secrets/inbound-secrets.service.js.map +0 -1
  592. package/dist/modules/inbound-secrets/path-traversal.js.map +0 -1
  593. package/dist/modules/instance-ai/compaction.service.d.ts +0 -24
  594. package/dist/modules/instance-ai/compaction.service.js +0 -213
  595. package/dist/modules/instance-ai/compaction.service.js.map +0 -1
  596. package/dist/modules/instance-ai/entities/instance-ai-observational-memory.entity.d.ts +0 -33
  597. package/dist/modules/instance-ai/entities/instance-ai-observational-memory.entity.js +0 -145
  598. package/dist/modules/instance-ai/entities/instance-ai-observational-memory.entity.js.map +0 -1
  599. package/dist/modules/instance-ai/entities/instance-ai-workflow-snapshot.entity.d.ts +0 -8
  600. package/dist/modules/instance-ai/entities/instance-ai-workflow-snapshot.entity.js.map +0 -1
  601. package/dist/modules/instance-ai/repositories/instance-ai-observational-memory.repository.d.ts +0 -5
  602. package/dist/modules/instance-ai/repositories/instance-ai-observational-memory.repository.js.map +0 -1
  603. package/dist/modules/instance-ai/repositories/instance-ai-workflow-snapshot.repository.d.ts +0 -5
  604. package/dist/modules/instance-ai/repositories/instance-ai-workflow-snapshot.repository.js.map +0 -1
  605. package/dist/modules/instance-ai/snapshot-pruning.service.d.ts +0 -17
  606. package/dist/modules/instance-ai/snapshot-pruning.service.js +0 -89
  607. package/dist/modules/instance-ai/snapshot-pruning.service.js.map +0 -1
  608. package/dist/modules/instance-ai/storage/typeorm-composite-store.d.ts +0 -9
  609. package/dist/modules/instance-ai/storage/typeorm-composite-store.js +0 -33
  610. package/dist/modules/instance-ai/storage/typeorm-composite-store.js.map +0 -1
  611. package/dist/modules/instance-ai/storage/typeorm-memory-storage.d.ts +0 -96
  612. package/dist/modules/instance-ai/storage/typeorm-memory-storage.js +0 -864
  613. package/dist/modules/instance-ai/storage/typeorm-memory-storage.js.map +0 -1
  614. package/dist/modules/instance-ai/storage/typeorm-workflows-storage.d.ts +0 -44
  615. package/dist/modules/instance-ai/storage/typeorm-workflows-storage.js +0 -156
  616. package/dist/modules/instance-ai/storage/typeorm-workflows-storage.js.map +0 -1
  617. package/dist/scaling/multi-main-setup-legacy.d.ts +0 -25
  618. package/dist/scaling/multi-main-setup-legacy.js +0 -75
  619. package/dist/scaling/multi-main-setup-legacy.js.map +0 -1
  620. package/dist/scaling/multi-main-setup-v2.d.ts +0 -25
  621. package/dist/scaling/multi-main-setup-v2.js +0 -143
  622. package/dist/scaling/multi-main-setup-v2.js.map +0 -1
  623. package/dist/scaling/multi-main-setup.types.d.ts +0 -6
  624. package/dist/scaling/multi-main-setup.types.js.map +0 -1
  625. /package/dist/modules/{inbound-secrets → runtime-credentials}/path-traversal.d.ts +0 -0
  626. /package/dist/modules/{inbound-secrets → runtime-credentials}/path-traversal.js +0 -0
@@ -0,0 +1,324 @@
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.TypeORMAgentMemory = void 0;
13
+ const backend_common_1 = require("@n8n/backend-common");
14
+ const di_1 = require("@n8n/di");
15
+ const typeorm_1 = require("@n8n/typeorm");
16
+ const typeorm_observation_log_store_1 = require("./typeorm-observation-log-store");
17
+ const instance_ai_message_repository_1 = require("../repositories/instance-ai-message.repository");
18
+ const instance_ai_observation_cursor_repository_1 = require("../repositories/instance-ai-observation-cursor.repository");
19
+ const instance_ai_observation_lock_repository_1 = require("../repositories/instance-ai-observation-lock.repository");
20
+ const instance_ai_observation_repository_1 = require("../repositories/instance-ai-observation.repository");
21
+ const instance_ai_resource_repository_1 = require("../repositories/instance-ai-resource.repository");
22
+ const instance_ai_thread_repository_1 = require("../repositories/instance-ai-thread.repository");
23
+ function parseJsonSafe(text) {
24
+ try {
25
+ return JSON.parse(text);
26
+ }
27
+ catch {
28
+ return undefined;
29
+ }
30
+ }
31
+ function isRecord(value) {
32
+ return typeof value === 'object' && value !== null;
33
+ }
34
+ function isAgentMessage(value) {
35
+ if (!isRecord(value))
36
+ return false;
37
+ if (value.type === 'custom') {
38
+ return 'data' in value;
39
+ }
40
+ return typeof value.role === 'string' && Array.isArray(value.content);
41
+ }
42
+ function toThread(entity) {
43
+ return {
44
+ id: entity.id,
45
+ resourceId: entity.resourceId,
46
+ title: entity.title || undefined,
47
+ createdAt: entity.createdAt,
48
+ updatedAt: entity.updatedAt,
49
+ metadata: entity.metadata ?? undefined,
50
+ };
51
+ }
52
+ function getMessageRole(message) {
53
+ return 'role' in message ? message.role : 'custom';
54
+ }
55
+ function getMessageType(message) {
56
+ if (message.type === 'custom')
57
+ return 'custom';
58
+ if (message.type === 'llm')
59
+ return 'llm';
60
+ return null;
61
+ }
62
+ function toAgentMessage(entity) {
63
+ const parsed = parseJsonSafe(entity.content);
64
+ if (!isAgentMessage(parsed))
65
+ return undefined;
66
+ return { ...parsed, id: entity.id, createdAt: entity.createdAt };
67
+ }
68
+ function workingMemoryKey(params) {
69
+ return params.scope === 'thread' ? `thread:${params.threadId}` : params.resourceId;
70
+ }
71
+ const PATCH_ONLY_METADATA_KEYS = new Set([
72
+ 'instanceAiIterationLog',
73
+ 'instanceAiPlannedTasks',
74
+ 'instanceAiTasks',
75
+ 'instanceAiTerminalOutcomes',
76
+ 'instanceAiWorkflowLoop',
77
+ ]);
78
+ function cloneThreadForPatch(thread) {
79
+ return {
80
+ ...thread,
81
+ metadata: { ...(thread.metadata ?? {}) },
82
+ };
83
+ }
84
+ function mergeSaveThreadMetadata(current, incoming) {
85
+ const safeIncoming = { ...incoming };
86
+ for (const key of PATCH_ONLY_METADATA_KEYS) {
87
+ delete safeIncoming[key];
88
+ }
89
+ return {
90
+ ...(current ?? {}),
91
+ ...safeIncoming,
92
+ };
93
+ }
94
+ let TypeORMAgentMemory = class TypeORMAgentMemory {
95
+ constructor(threadRepo, messageRepo, resourceRepo, observationRepo, observationCursorRepo, observationLockRepo, logger) {
96
+ this.threadRepo = threadRepo;
97
+ this.messageRepo = messageRepo;
98
+ this.resourceRepo = resourceRepo;
99
+ this.threadMutationQueues = new Map();
100
+ this.logger = logger.scoped('instance-ai');
101
+ this.observationLog = new typeorm_observation_log_store_1.TypeORMObservationLogStore(observationRepo, observationCursorRepo, observationLockRepo, this.messageRepo, (entity) => this.toAgentMessage(entity));
102
+ }
103
+ describe() {
104
+ return {
105
+ name: 'typeorm-agent-memory',
106
+ constructorName: this.constructor.name,
107
+ connectionParams: null,
108
+ };
109
+ }
110
+ async getThread(threadId) {
111
+ const thread = await this.threadRepo.findOneBy({ id: threadId });
112
+ return thread ? toThread(thread) : null;
113
+ }
114
+ async listThreads(args) {
115
+ const perPage = args.perPage ?? 100;
116
+ const page = args.page ?? 0;
117
+ const field = args.orderBy?.field ?? 'updatedAt';
118
+ const direction = args.orderBy?.direction ?? 'DESC';
119
+ const [threads, total] = await this.threadRepo.findAndCount({
120
+ where: args.filter?.resourceId ? { resourceId: args.filter.resourceId } : {},
121
+ order: { [field]: direction, id: direction },
122
+ take: perPage,
123
+ skip: page * perPage,
124
+ });
125
+ return {
126
+ threads: threads.map(toThread),
127
+ total,
128
+ page,
129
+ hasMore: (page + 1) * perPage < total,
130
+ };
131
+ }
132
+ async saveThread(thread) {
133
+ return await this.serializeThreadMutation(thread.id, async () => {
134
+ const existing = await this.threadRepo.findOneBy({ id: thread.id });
135
+ if (existing) {
136
+ existing.resourceId = thread.resourceId;
137
+ if (thread.title !== undefined)
138
+ existing.title = thread.title;
139
+ if (thread.metadata !== undefined) {
140
+ existing.metadata = mergeSaveThreadMetadata(existing.metadata, thread.metadata);
141
+ }
142
+ return toThread(await this.threadRepo.save(existing));
143
+ }
144
+ const saved = await this.threadRepo.save(this.threadRepo.create({
145
+ id: thread.id,
146
+ resourceId: thread.resourceId,
147
+ title: thread.title ?? '',
148
+ metadata: thread.metadata ?? null,
149
+ }));
150
+ return toThread(saved);
151
+ });
152
+ }
153
+ async patchThread(args) {
154
+ return await this.serializeThreadMutation(args.threadId, async () => {
155
+ const existing = await this.threadRepo.findOneBy({ id: args.threadId });
156
+ if (!existing)
157
+ return null;
158
+ const current = toThread(existing);
159
+ const patch = args.update(cloneThreadForPatch(current));
160
+ if (!patch)
161
+ return current;
162
+ if (patch.title !== undefined)
163
+ existing.title = patch.title;
164
+ if (patch.metadata !== undefined)
165
+ existing.metadata = patch.metadata;
166
+ return toThread(await this.threadRepo.save(existing));
167
+ });
168
+ }
169
+ async deleteThread(threadId) {
170
+ await this.threadRepo.delete({ id: threadId });
171
+ }
172
+ async deleteThreadsByResourceIdPrefix(resourceIdPrefix) {
173
+ const threads = await this.threadRepo.find({
174
+ where: { resourceId: (0, typeorm_1.Like)(`${resourceIdPrefix}%`) },
175
+ });
176
+ if (threads.length === 0)
177
+ return;
178
+ const threadIds = threads.map((thread) => thread.id);
179
+ const resourceIds = Array.from(new Set(threads.map((thread) => thread.resourceId)));
180
+ await this.resourceRepo.delete({ id: (0, typeorm_1.In)(resourceIds) });
181
+ await this.resourceRepo.delete({
182
+ id: (0, typeorm_1.In)(threadIds.map((threadId) => `thread:${threadId}`)),
183
+ });
184
+ await this.threadRepo.delete({ id: (0, typeorm_1.In)(threadIds) });
185
+ }
186
+ async getMessages(threadId, opts) {
187
+ const where = opts?.before ? { threadId, createdAt: (0, typeorm_1.LessThan)(opts.before) } : { threadId };
188
+ const entities = await this.messageRepo.find({
189
+ where,
190
+ order: opts?.limit ? { createdAt: 'DESC', id: 'DESC' } : { createdAt: 'ASC', id: 'ASC' },
191
+ ...(opts?.limit ? { take: opts.limit } : {}),
192
+ });
193
+ const ordered = opts?.limit ? entities.reverse() : entities;
194
+ return ordered.flatMap((entity) => {
195
+ const message = this.toAgentMessage(entity);
196
+ return message ? [message] : [];
197
+ });
198
+ }
199
+ async listMessages(args) {
200
+ const limit = args.limit ?? 50;
201
+ const page = args.page ?? 0;
202
+ const entities = await this.messageRepo.find({
203
+ where: { threadId: args.threadId },
204
+ order: { createdAt: 'DESC', id: 'DESC' },
205
+ take: limit,
206
+ skip: page * limit,
207
+ });
208
+ return {
209
+ messages: entities.reverse().flatMap((entity) => {
210
+ const message = this.toAgentMessage(entity);
211
+ return message ? [message] : [];
212
+ }),
213
+ };
214
+ }
215
+ async saveMessages(args) {
216
+ if (args.messages.length === 0)
217
+ return;
218
+ const entities = args.messages.map((message) => this.messageRepo.create({
219
+ id: message.id,
220
+ threadId: args.threadId,
221
+ content: JSON.stringify(message),
222
+ role: getMessageRole(message),
223
+ type: getMessageType(message),
224
+ resourceId: args.resourceId,
225
+ createdAt: message.createdAt,
226
+ updatedAt: message.createdAt,
227
+ }));
228
+ await this.messageRepo.save(entities);
229
+ }
230
+ async deleteMessages(messageIds) {
231
+ if (messageIds.length === 0)
232
+ return;
233
+ await this.messageRepo.delete({ id: (0, typeorm_1.In)(messageIds) });
234
+ }
235
+ async getWorkingMemory(params) {
236
+ const resource = await this.resourceRepo.findOneBy({ id: workingMemoryKey(params) });
237
+ return resource?.workingMemory ?? null;
238
+ }
239
+ async saveWorkingMemory(params, content) {
240
+ const id = workingMemoryKey(params);
241
+ const existing = await this.resourceRepo.findOneBy({ id });
242
+ if (existing) {
243
+ existing.workingMemory = content;
244
+ await this.resourceRepo.save(existing);
245
+ return;
246
+ }
247
+ await this.resourceRepo.save(this.resourceRepo.create({
248
+ id,
249
+ workingMemory: content,
250
+ metadata: { scope: params.scope },
251
+ }));
252
+ }
253
+ async appendObservationLogEntries(rows) {
254
+ return await this.observationLog.appendObservationLogEntries(rows);
255
+ }
256
+ async getActiveObservationLog(scope) {
257
+ return await this.observationLog.getActiveObservationLog(scope);
258
+ }
259
+ async getObservationLog(opts) {
260
+ return await this.observationLog.getObservationLog(opts);
261
+ }
262
+ async getMessagesForObservationScope(observationScopeId, opts) {
263
+ return await this.observationLog.getMessagesForObservationScope(observationScopeId, opts);
264
+ }
265
+ async dropObservationLogEntries(ids) {
266
+ return await this.observationLog.dropObservationLogEntries(ids);
267
+ }
268
+ async supersedeObservationLogEntries(ids, supersededBy) {
269
+ return await this.observationLog.supersedeObservationLogEntries(ids, supersededBy);
270
+ }
271
+ async applyObservationLogReflection(scope, reflection) {
272
+ return await this.observationLog.applyObservationLogReflection(scope, reflection);
273
+ }
274
+ async getCursor(observationScopeId) {
275
+ return await this.observationLog.getCursor(observationScopeId);
276
+ }
277
+ async setCursor(cursor) {
278
+ return await this.observationLog.setCursor(cursor);
279
+ }
280
+ async acquireObservationLogTaskLock(observationScopeId, taskKind, opts) {
281
+ return await this.observationLog.acquireObservationLogTaskLock(observationScopeId, taskKind, opts);
282
+ }
283
+ async releaseObservationLogTaskLock(handle) {
284
+ return await this.observationLog.releaseObservationLogTaskLock(handle);
285
+ }
286
+ async serializeThreadMutation(threadId, mutation) {
287
+ const previous = this.threadMutationQueues.get(threadId) ?? Promise.resolve();
288
+ const next = previous.catch(() => undefined).then(mutation);
289
+ this.threadMutationQueues.set(threadId, next);
290
+ try {
291
+ return await next;
292
+ }
293
+ finally {
294
+ if (this.threadMutationQueues.get(threadId) === next) {
295
+ this.threadMutationQueues.delete(threadId);
296
+ }
297
+ }
298
+ }
299
+ toAgentMessage(entity) {
300
+ const message = toAgentMessage(entity);
301
+ if (!message) {
302
+ this.logger.warn('Skipping invalid Instance AI message row', {
303
+ messageId: entity.id,
304
+ threadId: entity.threadId,
305
+ resourceId: entity.resourceId,
306
+ role: entity.role,
307
+ type: entity.type,
308
+ });
309
+ }
310
+ return message;
311
+ }
312
+ };
313
+ exports.TypeORMAgentMemory = TypeORMAgentMemory;
314
+ exports.TypeORMAgentMemory = TypeORMAgentMemory = __decorate([
315
+ (0, di_1.Service)(),
316
+ __metadata("design:paramtypes", [instance_ai_thread_repository_1.InstanceAiThreadRepository,
317
+ instance_ai_message_repository_1.InstanceAiMessageRepository,
318
+ instance_ai_resource_repository_1.InstanceAiResourceRepository,
319
+ instance_ai_observation_repository_1.InstanceAiObservationRepository,
320
+ instance_ai_observation_cursor_repository_1.InstanceAiObservationCursorRepository,
321
+ instance_ai_observation_lock_repository_1.InstanceAiObservationLockRepository,
322
+ backend_common_1.Logger])
323
+ ], TypeORMAgentMemory);
324
+ //# sourceMappingURL=typeorm-agent-memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeorm-agent-memory.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/storage/typeorm-agent-memory.ts"],"names":[],"mappings":";;;;;;;;;;;;AAcA,wDAA6C;AAC7C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1
+ import { type BuiltObservationLogStore, type BuiltObservationLogTaskLockStore, type NewObservationLogEntry, type ObservationCursor, type ObservationLogEntry, type ObservationLogReadOptions, type ObservationLogReflection, type ObservationLogReflectionResult, type ObservationLogScope, type ObservationLogTaskKind, type ObservationLogTaskLockHandle } from '@n8n/agents';
2
+ import type { AgentDbMessage } from '@n8n/instance-ai';
3
+ import type { InstanceAiMessage } from '../entities/instance-ai-message.entity';
4
+ import type { InstanceAiMessageRepository } from '../repositories/instance-ai-message.repository';
5
+ import type { InstanceAiObservationCursorRepository } from '../repositories/instance-ai-observation-cursor.repository';
6
+ import type { InstanceAiObservationLockRepository } from '../repositories/instance-ai-observation-lock.repository';
7
+ import type { InstanceAiObservationRepository } from '../repositories/instance-ai-observation.repository';
8
+ export declare class TypeORMObservationLogStore implements BuiltObservationLogStore, BuiltObservationLogTaskLockStore {
9
+ private readonly observationRepo;
10
+ private readonly observationCursorRepo;
11
+ private readonly observationLockRepo;
12
+ private readonly messageRepo;
13
+ private readonly toAgentMessage;
14
+ constructor(observationRepo: InstanceAiObservationRepository, observationCursorRepo: InstanceAiObservationCursorRepository, observationLockRepo: InstanceAiObservationLockRepository, messageRepo: InstanceAiMessageRepository, toAgentMessage: (entity: InstanceAiMessage) => AgentDbMessage | undefined);
15
+ appendObservationLogEntries(rows: NewObservationLogEntry[]): Promise<ObservationLogEntry[]>;
16
+ getActiveObservationLog(scope: ObservationLogScope & {
17
+ limit?: number;
18
+ order?: 'asc' | 'desc';
19
+ }): Promise<ObservationLogEntry[]>;
20
+ getObservationLog(opts: ObservationLogReadOptions): Promise<ObservationLogEntry[]>;
21
+ getMessagesForObservationScope(observationScopeId: string, opts?: {
22
+ since?: {
23
+ sinceCreatedAt: Date;
24
+ sinceMessageId: string;
25
+ };
26
+ }): Promise<AgentDbMessage[]>;
27
+ dropObservationLogEntries(ids: string[]): Promise<void>;
28
+ supersedeObservationLogEntries(ids: string[], supersededBy: string): Promise<void>;
29
+ applyObservationLogReflection(scope: ObservationLogScope, reflection: ObservationLogReflection): Promise<ObservationLogReflectionResult>;
30
+ getCursor(observationScopeId: string): Promise<ObservationCursor | null>;
31
+ setCursor(cursor: ObservationCursor): Promise<void>;
32
+ acquireObservationLogTaskLock(observationScopeId: string, taskKind: ObservationLogTaskKind, opts: {
33
+ ttlMs: number;
34
+ holderId: string;
35
+ }): Promise<ObservationLogTaskLockHandle | null>;
36
+ releaseObservationLogTaskLock(handle: ObservationLogTaskLockHandle): Promise<void>;
37
+ }
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeORMObservationLogStore = void 0;
4
+ const agents_1 = require("@n8n/agents");
5
+ const typeorm_1 = require("@n8n/typeorm");
6
+ const instance_ai_observation_lock_entity_1 = require("../entities/instance-ai-observation-lock.entity");
7
+ const instance_ai_observation_entity_1 = require("../entities/instance-ai-observation.entity");
8
+ function toObservationLogEntry(entity) {
9
+ return {
10
+ id: entity.id,
11
+ observationScopeId: entity.observationScopeId,
12
+ marker: entity.marker,
13
+ text: entity.text,
14
+ parentId: entity.parentId,
15
+ tokenCount: Number(entity.tokenCount),
16
+ status: entity.status,
17
+ supersededBy: entity.supersededBy,
18
+ createdAt: entity.createdAt,
19
+ };
20
+ }
21
+ class TypeORMObservationLogStore {
22
+ constructor(observationRepo, observationCursorRepo, observationLockRepo, messageRepo, toAgentMessage) {
23
+ this.observationRepo = observationRepo;
24
+ this.observationCursorRepo = observationCursorRepo;
25
+ this.observationLockRepo = observationLockRepo;
26
+ this.messageRepo = messageRepo;
27
+ this.toAgentMessage = toAgentMessage;
28
+ }
29
+ async appendObservationLogEntries(rows) {
30
+ if (rows.length === 0)
31
+ return [];
32
+ const entities = rows.map((row) => this.observationRepo.create({
33
+ observationScopeId: row.observationScopeId,
34
+ marker: row.marker,
35
+ text: row.text,
36
+ parentId: row.parentId ?? null,
37
+ tokenCount: row.tokenCount ?? (0, agents_1.estimateObservationTokens)(row.text),
38
+ ...(0, agents_1.activeLifecycleState)(),
39
+ createdAt: row.createdAt,
40
+ }));
41
+ const saved = await this.observationRepo.save(entities);
42
+ return saved.map((entity) => toObservationLogEntry(entity));
43
+ }
44
+ async getActiveObservationLog(scope) {
45
+ return await this.getObservationLog({ ...scope, status: 'active' });
46
+ }
47
+ async getObservationLog(opts) {
48
+ const baseWhere = {
49
+ observationScopeId: opts.observationScopeId,
50
+ ...(opts.status !== undefined && { status: opts.status }),
51
+ ...(opts.parentId !== undefined && { parentId: opts.parentId ?? (0, typeorm_1.IsNull)() }),
52
+ };
53
+ const entities = await this.observationRepo.find({
54
+ where: [baseWhere],
55
+ order: {
56
+ createdAt: opts.order === 'desc' ? 'DESC' : 'ASC',
57
+ id: opts.order === 'desc' ? 'DESC' : 'ASC',
58
+ },
59
+ ...(opts.limit !== undefined && { take: opts.limit }),
60
+ });
61
+ return entities.map((entity) => toObservationLogEntry(entity));
62
+ }
63
+ async getMessagesForObservationScope(observationScopeId, opts) {
64
+ const baseWhere = {
65
+ threadId: observationScopeId,
66
+ };
67
+ const where = opts?.since
68
+ ? [
69
+ { ...baseWhere, createdAt: (0, typeorm_1.MoreThan)(opts.since.sinceCreatedAt) },
70
+ {
71
+ ...baseWhere,
72
+ createdAt: (0, typeorm_1.Equal)(opts.since.sinceCreatedAt),
73
+ id: (0, typeorm_1.MoreThan)(opts.since.sinceMessageId),
74
+ },
75
+ ]
76
+ : [baseWhere];
77
+ const entities = await this.messageRepo.find({
78
+ where,
79
+ order: { createdAt: 'ASC', id: 'ASC' },
80
+ });
81
+ return entities.flatMap((entity) => {
82
+ const message = this.toAgentMessage(entity);
83
+ return message ? [message] : [];
84
+ });
85
+ }
86
+ async dropObservationLogEntries(ids) {
87
+ if (ids.length === 0)
88
+ return;
89
+ await this.observationRepo.update({ id: (0, typeorm_1.In)(ids) }, (0, agents_1.droppedLifecycleState)());
90
+ }
91
+ async supersedeObservationLogEntries(ids, supersededBy) {
92
+ if (ids.length === 0)
93
+ return;
94
+ await this.observationRepo.update({ id: (0, typeorm_1.In)(ids) }, (0, agents_1.supersededLifecycleState)(supersededBy));
95
+ }
96
+ async applyObservationLogReflection(scope, reflection) {
97
+ return await this.observationRepo.manager.transaction(async (trx) => {
98
+ const repo = trx.getRepository(instance_ai_observation_entity_1.InstanceAiObservation);
99
+ const activeEntries = await repo.find({
100
+ where: {
101
+ observationScopeId: scope.observationScopeId,
102
+ status: 'active',
103
+ },
104
+ order: { createdAt: 'ASC', id: 'ASC' },
105
+ });
106
+ const normalized = (0, agents_1.normalizeObservationLogReflection)(activeEntries.map((entry) => toObservationLogEntry(entry)), reflection);
107
+ const inserted = normalized.merge.length
108
+ ? await repo.save(normalized.merge.map((entry) => repo.create({
109
+ observationScopeId: scope.observationScopeId,
110
+ marker: entry.marker,
111
+ text: entry.text,
112
+ parentId: entry.parentId ?? null,
113
+ tokenCount: entry.tokenCount ?? (0, agents_1.estimateObservationTokens)(entry.text),
114
+ ...(0, agents_1.activeLifecycleState)(),
115
+ createdAt: entry.createdAt,
116
+ })))
117
+ : [];
118
+ if (normalized.drop.length > 0) {
119
+ await repo.update({
120
+ observationScopeId: scope.observationScopeId,
121
+ id: (0, typeorm_1.In)(normalized.drop),
122
+ }, (0, agents_1.droppedLifecycleState)());
123
+ }
124
+ for (const [index, merge] of normalized.merge.entries()) {
125
+ const replacement = inserted[index];
126
+ if (replacement && merge.supersedes.length > 0) {
127
+ await repo.update({
128
+ observationScopeId: scope.observationScopeId,
129
+ id: (0, typeorm_1.In)(merge.supersedes),
130
+ }, (0, agents_1.supersededLifecycleState)(replacement.id));
131
+ }
132
+ }
133
+ return {
134
+ droppedIds: [...normalized.drop],
135
+ supersededIds: normalized.merge.flatMap((entry) => entry.supersedes),
136
+ inserted: inserted.map((entry) => toObservationLogEntry(entry)),
137
+ };
138
+ });
139
+ }
140
+ async getCursor(observationScopeId) {
141
+ const entity = await this.observationCursorRepo.findOneBy({ observationScopeId });
142
+ if (!entity)
143
+ return null;
144
+ return {
145
+ observationScopeId: entity.observationScopeId,
146
+ lastObservedMessageId: entity.lastObservedMessageId,
147
+ lastObservedAt: entity.lastObservedAt,
148
+ updatedAt: entity.updatedAt,
149
+ };
150
+ }
151
+ async setCursor(cursor) {
152
+ await this.observationCursorRepo.upsert({
153
+ observationScopeId: cursor.observationScopeId,
154
+ lastObservedMessageId: cursor.lastObservedMessageId,
155
+ lastObservedAt: cursor.lastObservedAt,
156
+ updatedAt: cursor.updatedAt,
157
+ }, {
158
+ conflictPaths: ['observationScopeId'],
159
+ skipUpdateIfNoValuesChanged: false,
160
+ });
161
+ }
162
+ async acquireObservationLogTaskLock(observationScopeId, taskKind, opts) {
163
+ const now = new Date();
164
+ const heldUntil = new Date(now.getTime() + opts.ttlMs);
165
+ const updateResult = await this.observationLockRepo
166
+ .createQueryBuilder()
167
+ .update(instance_ai_observation_lock_entity_1.InstanceAiObservationLock)
168
+ .set({ taskKind, holderId: opts.holderId, heldUntil })
169
+ .where('"observationScopeId" = :observationScopeId')
170
+ .andWhere('"taskKind" = :taskKind')
171
+ .andWhere('("holderId" = :holderId OR "heldUntil" <= :now)')
172
+ .setParameters({
173
+ observationScopeId,
174
+ taskKind,
175
+ holderId: opts.holderId,
176
+ now,
177
+ })
178
+ .execute();
179
+ if ((updateResult.affected ?? 0) > 0) {
180
+ return { observationScopeId, taskKind, holderId: opts.holderId, heldUntil };
181
+ }
182
+ await this.observationLockRepo
183
+ .createQueryBuilder()
184
+ .insert()
185
+ .into(instance_ai_observation_lock_entity_1.InstanceAiObservationLock)
186
+ .values({
187
+ observationScopeId,
188
+ taskKind,
189
+ holderId: opts.holderId,
190
+ heldUntil,
191
+ })
192
+ .orIgnore()
193
+ .execute();
194
+ const claimed = await this.observationLockRepo.findOneBy({
195
+ observationScopeId,
196
+ taskKind,
197
+ holderId: opts.holderId,
198
+ });
199
+ if (!claimed)
200
+ return null;
201
+ return { observationScopeId, taskKind, holderId: opts.holderId, heldUntil };
202
+ }
203
+ async releaseObservationLogTaskLock(handle) {
204
+ await this.observationLockRepo.delete({
205
+ observationScopeId: handle.observationScopeId,
206
+ taskKind: handle.taskKind,
207
+ holderId: handle.holderId,
208
+ });
209
+ }
210
+ }
211
+ exports.TypeORMObservationLogStore = TypeORMObservationLogStore;
212
+ //# sourceMappingURL=typeorm-observation-log-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeorm-observation-log-store.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/storage/typeorm-observation-log-store.ts"],"names":[],"mappings":";;;AAAA,wCAiBqB;AAErB,0CAAkF;AAGlF,yGAA4F;AAC5F,+FAAmF;AAMnF,SAAS,qBAAqB,CAAC,MAA6B;IAC3D,OAAO;QACN,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;QAC7C,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;QACrC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,SAAS,EAAE,MAAM,CAAC,SAAS;KAC3B,CAAC;AACH,CAAC;AAED,MAAa,0BAA0B;IAGtC,YACkB,eAAgD,EAChD,qBAA4D,EAC5D,mBAAwD,EACxD,WAAwC,EACxC,cAAyE;QAJzE,oBAAe,GAAf,eAAe,CAAiC;QAChD,0BAAqB,GAArB,qBAAqB,CAAuC;QAC5D,wBAAmB,GAAnB,mBAAmB,CAAqC;QACxD,gBAAW,GAAX,WAAW,CAA6B;QACxC,mBAAc,GAAd,cAAc,CAA2D;IACxF,CAAC;IAEJ,KAAK,CAAC,2BAA2B,CAChC,IAA8B;QAE9B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAEjC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CA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