n8n 2.39.6 → 2.40.1

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 (1056) hide show
  1. package/dist/agent-library-bundle.js +178 -11
  2. package/dist/auth/auth.service.d.ts +5 -0
  3. package/dist/auth/auth.service.js +35 -2
  4. package/dist/auth/auth.service.js.map +1 -1
  5. package/dist/binary-data/binary-data-access.service.d.ts +1 -1
  6. package/dist/binary-data/binary-data-access.service.js +15 -6
  7. package/dist/binary-data/binary-data-access.service.js.map +1 -1
  8. package/dist/binary-data/database.manager.js +1 -1
  9. package/dist/binary-data/database.manager.js.map +1 -1
  10. package/dist/build.tsbuildinfo +1 -1
  11. package/dist/commands/base-command.d.ts +1 -0
  12. package/dist/commands/base-command.js +11 -1
  13. package/dist/commands/base-command.js.map +1 -1
  14. package/dist/commands/execute-batch.js.map +1 -1
  15. package/dist/commands/list/workflow.js +1 -4
  16. package/dist/commands/list/workflow.js.map +1 -1
  17. package/dist/commands/publish/workflow.js +1 -5
  18. package/dist/commands/publish/workflow.js.map +1 -1
  19. package/dist/commands/start.js +1 -7
  20. package/dist/commands/start.js.map +1 -1
  21. package/dist/commands/ttwf/generate.js +1 -4
  22. package/dist/commands/ttwf/generate.js.map +1 -1
  23. package/dist/commands/unpublish/workflow.js +1 -5
  24. package/dist/commands/unpublish/workflow.js.map +1 -1
  25. package/dist/commands/update/workflow.js +1 -5
  26. package/dist/commands/update/workflow.js.map +1 -1
  27. package/dist/controller.registry.d.ts +1 -1
  28. package/dist/controller.registry.js +3 -3
  29. package/dist/controller.registry.js.map +1 -1
  30. package/dist/controllers/ai-preference.controller.d.ts +17 -0
  31. package/dist/controllers/ai-preference.controller.js +78 -0
  32. package/dist/controllers/ai-preference.controller.js.map +1 -0
  33. package/dist/controllers/change-email.controller.d.ts +31 -0
  34. package/dist/controllers/change-email.controller.js +164 -0
  35. package/dist/controllers/change-email.controller.js.map +1 -0
  36. package/dist/controllers/me.controller.d.ts +3 -2
  37. package/dist/controllers/me.controller.js +10 -42
  38. package/dist/controllers/me.controller.js.map +1 -1
  39. package/dist/credentials/dynamic-credentials-proxy.js.map +1 -1
  40. package/dist/credentials/executing-user-identifier-proxy.d.ts +7 -0
  41. package/dist/credentials/executing-user-identifier-proxy.js +25 -0
  42. package/dist/credentials/executing-user-identifier-proxy.js.map +1 -0
  43. package/dist/credentials/executing-user-identifier.interface.d.ts +4 -0
  44. package/dist/credentials/executing-user-identifier.interface.js +3 -0
  45. package/dist/credentials/executing-user-identifier.interface.js.map +1 -0
  46. package/dist/credentials/mock-node-types.d.ts +5 -0
  47. package/dist/credentials/mock-node-types.js +34 -0
  48. package/dist/credentials/mock-node-types.js.map +1 -0
  49. package/dist/credentials-helper.js +2 -25
  50. package/dist/credentials-helper.js.map +1 -1
  51. package/dist/encryption/key-manager.service.js +3 -1
  52. package/dist/encryption/key-manager.service.js.map +1 -1
  53. package/dist/encryption/key-rotation-flag.js +2 -1
  54. package/dist/encryption/key-rotation-flag.js.map +1 -1
  55. package/dist/errors/pre-execute-blocked.error.d.ts +6 -0
  56. package/dist/errors/pre-execute-blocked.error.js +15 -0
  57. package/dist/errors/pre-execute-blocked.error.js.map +1 -0
  58. package/dist/eventbus/event-message-classes/event-message-audit.js.map +1 -1
  59. package/dist/eventbus/event-message-classes/event-message-generic.js.map +1 -1
  60. package/dist/eventbus/event-message-classes/event-message-mcp.js.map +1 -1
  61. package/dist/eventbus/event-message-classes/event-message-workflow.js.map +1 -1
  62. package/dist/eventbus/message-event-bus/message-event-bus.d.ts +3 -1
  63. package/dist/eventbus/message-event-bus/message-event-bus.js +5 -3
  64. package/dist/eventbus/message-event-bus/message-event-bus.js.map +1 -1
  65. package/dist/eventbus/message-event-bus-writer/message-event-bus-log-writer.js.map +1 -1
  66. package/dist/events/maps/relay.event-map.d.ts +22 -2
  67. package/dist/events/relays/telemetry.event-relay.d.ts +6 -0
  68. package/dist/events/relays/telemetry.event-relay.js +88 -1
  69. package/dist/events/relays/telemetry.event-relay.js.map +1 -1
  70. package/dist/execution-lifecycle/execution-lifecycle-hooks.js +22 -10
  71. package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
  72. package/dist/execution-lifecycle/restore-binary-data-id.js +2 -2
  73. package/dist/execution-lifecycle/restore-binary-data-id.js.map +1 -1
  74. package/dist/executions/enqueued-execution-recovery.service.d.ts +3 -3
  75. package/dist/executions/enqueued-execution-recovery.service.js +6 -6
  76. package/dist/executions/enqueued-execution-recovery.service.js.map +1 -1
  77. package/dist/executions/execution-crash.service.d.ts +12 -0
  78. package/dist/executions/execution-crash.service.js +43 -0
  79. package/dist/executions/execution-crash.service.js.map +1 -0
  80. package/dist/executions/execution-recovery.service.d.ts +3 -1
  81. package/dist/executions/execution-recovery.service.js +6 -4
  82. package/dist/executions/execution-recovery.service.js.map +1 -1
  83. package/dist/executions/execution.service.js.map +1 -1
  84. package/dist/executions/pre-execution-checks/credentials-permission-checker.d.ts +5 -2
  85. package/dist/executions/pre-execution-checks/credentials-permission-checker.js +20 -29
  86. package/dist/executions/pre-execution-checks/credentials-permission-checker.js.map +1 -1
  87. package/dist/executions/pre-execution-checks/index.d.ts +1 -0
  88. package/dist/executions/pre-execution-checks/index.js +3 -1
  89. package/dist/executions/pre-execution-checks/index.js.map +1 -1
  90. package/dist/executions/pre-execution-checks/workflow-pre-execute.d.ts +16 -0
  91. package/dist/executions/pre-execution-checks/workflow-pre-execute.js +96 -0
  92. package/dist/executions/pre-execution-checks/workflow-pre-execute.js.map +1 -0
  93. package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js +25 -3
  94. package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js.map +1 -1
  95. package/dist/license/license-renewal.task.d.ts +13 -0
  96. package/dist/license/license-renewal.task.js +38 -0
  97. package/dist/license/license-renewal.task.js.map +1 -0
  98. package/dist/license.d.ts +1 -2
  99. package/dist/license.js +5 -19
  100. package/dist/license.js.map +1 -1
  101. package/dist/load-nodes-and-credentials.d.ts +1 -0
  102. package/dist/load-nodes-and-credentials.js +7 -2
  103. package/dist/load-nodes-and-credentials.js.map +1 -1
  104. package/dist/metrics/prometheus/encryption-metrics.service.d.ts +10 -0
  105. package/dist/metrics/prometheus/encryption-metrics.service.js +55 -0
  106. package/dist/metrics/prometheus/encryption-metrics.service.js.map +1 -0
  107. package/dist/metrics/prometheus/prometheus.service.d.ts +2 -1
  108. package/dist/metrics/prometheus/prometheus.service.js +4 -2
  109. package/dist/metrics/prometheus/prometheus.service.js.map +1 -1
  110. package/dist/modules/agents/agent-chat.controller.d.ts +11 -2
  111. package/dist/modules/agents/agent-chat.controller.js +42 -2
  112. package/dist/modules/agents/agent-chat.controller.js.map +1 -1
  113. package/dist/modules/agents/agent-checkpoint-pruning.task.d.ts +14 -0
  114. package/dist/modules/agents/agent-checkpoint-pruning.task.js +38 -0
  115. package/dist/modules/agents/agent-checkpoint-pruning.task.js.map +1 -0
  116. package/dist/modules/agents/agent-config.service.d.ts +7 -7
  117. package/dist/modules/agents/agent-config.service.js +13 -3
  118. package/dist/modules/agents/agent-config.service.js.map +1 -1
  119. package/dist/modules/agents/agent-custom-tools.service.d.ts +3 -1
  120. package/dist/modules/agents/agent-custom-tools.service.js +6 -2
  121. package/dist/modules/agents/agent-custom-tools.service.js.map +1 -1
  122. package/dist/modules/agents/agent-execution-orchestrator.service.d.ts +34 -2
  123. package/dist/modules/agents/agent-execution-orchestrator.service.js +143 -16
  124. package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
  125. package/dist/modules/agents/agent-execution-update-broadcaster.d.ts +6 -1
  126. package/dist/modules/agents/agent-execution-update-broadcaster.js +34 -2
  127. package/dist/modules/agents/agent-execution-update-broadcaster.js.map +1 -1
  128. package/dist/modules/agents/agent-execution.service.d.ts +5 -2
  129. package/dist/modules/agents/agent-execution.service.js +2 -1
  130. package/dist/modules/agents/agent-execution.service.js.map +1 -1
  131. package/dist/modules/agents/agent-integration-management.service.d.ts +2 -0
  132. package/dist/modules/agents/agent-integration-management.service.js +4 -0
  133. package/dist/modules/agents/agent-integration-management.service.js.map +1 -1
  134. package/dist/modules/agents/agent-integrations.controller.d.ts +3 -1
  135. package/dist/modules/agents/agent-integrations.controller.js +7 -5
  136. package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
  137. package/dist/modules/agents/agent-interrupted-execution-sweeper.d.ts +3 -1
  138. package/dist/modules/agents/agent-interrupted-execution-sweeper.js +10 -2
  139. package/dist/modules/agents/agent-interrupted-execution-sweeper.js.map +1 -1
  140. package/dist/modules/agents/agent-knowledge-commands.js +2 -2
  141. package/dist/modules/agents/agent-knowledge-commands.js.map +1 -1
  142. package/dist/modules/agents/agent-modification-telemetry.service.d.ts +1 -0
  143. package/dist/modules/agents/agent-modification-telemetry.service.js.map +1 -1
  144. package/dist/modules/agents/agent-publish.controller.d.ts +8 -0
  145. package/dist/modules/agents/agent-publish.controller.js +4 -4
  146. package/dist/modules/agents/agent-publish.controller.js.map +1 -1
  147. package/dist/modules/agents/agent-publish.service.d.ts +7 -5
  148. package/dist/modules/agents/agent-publish.service.js +12 -6
  149. package/dist/modules/agents/agent-publish.service.js.map +1 -1
  150. package/dist/modules/agents/agent-runnable-state.service.d.ts +2 -0
  151. package/dist/modules/agents/agent-runnable-state.service.js +8 -0
  152. package/dist/modules/agents/agent-runnable-state.service.js.map +1 -1
  153. package/dist/modules/agents/agent-runtime-cache.service.d.ts +3 -0
  154. package/dist/modules/agents/agent-runtime-cache.service.js +8 -3
  155. package/dist/modules/agents/agent-runtime-cache.service.js.map +1 -1
  156. package/dist/modules/agents/agent-runtime-reconstruction.service.d.ts +7 -1
  157. package/dist/modules/agents/agent-runtime-reconstruction.service.js +34 -11
  158. package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
  159. package/dist/modules/agents/agent-sandbox-principal.d.ts +2 -2
  160. package/dist/modules/agents/agent-sandbox-principal.js +2 -2
  161. package/dist/modules/agents/agent-sandbox-principal.js.map +1 -1
  162. package/dist/modules/agents/agent-sandbox-runtime.service.js +9 -8
  163. package/dist/modules/agents/agent-sandbox-runtime.service.js.map +1 -1
  164. package/dist/modules/agents/agent-session-langsmith-export.service.js +110 -10
  165. package/dist/modules/agents/agent-session-langsmith-export.service.js.map +1 -1
  166. package/dist/modules/agents/agent-skills.service.d.ts +4 -2
  167. package/dist/modules/agents/agent-skills.service.js +30 -6
  168. package/dist/modules/agents/agent-skills.service.js.map +1 -1
  169. package/dist/modules/agents/agent-sse-stream.js.map +1 -1
  170. package/dist/modules/agents/agent-task.service.d.ts +6 -2
  171. package/dist/modules/agents/agent-task.service.js +79 -91
  172. package/dist/modules/agents/agent-task.service.js.map +1 -1
  173. package/dist/modules/agents/agent-tasks.controller.js +3 -0
  174. package/dist/modules/agents/agent-tasks.controller.js.map +1 -1
  175. package/dist/modules/agents/agent-test-chat.service.js +8 -1
  176. package/dist/modules/agents/agent-test-chat.service.js.map +1 -1
  177. package/dist/modules/agents/agent-test-run.service.d.ts +3 -1
  178. package/dist/modules/agents/agent-test-run.service.js +5 -3
  179. package/dist/modules/agents/agent-test-run.service.js.map +1 -1
  180. package/dist/modules/agents/agent-update-broadcaster.d.ts +22 -0
  181. package/dist/modules/agents/agent-update-broadcaster.js +74 -0
  182. package/dist/modules/agents/agent-update-broadcaster.js.map +1 -0
  183. package/dist/modules/agents/agent-validation.service.js.map +1 -1
  184. package/dist/modules/agents/agent-workflow-execution.service.d.ts +3 -1
  185. package/dist/modules/agents/agent-workflow-execution.service.js +7 -3
  186. package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
  187. package/dist/modules/agents/agent-workflow-tool-resume.service.js +1 -0
  188. package/dist/modules/agents/agent-workflow-tool-resume.service.js.map +1 -1
  189. package/dist/modules/agents/agents-config.controller.d.ts +214 -219
  190. package/dist/modules/agents/agents-config.controller.js +7 -2
  191. package/dist/modules/agents/agents-config.controller.js.map +1 -1
  192. package/dist/modules/agents/agents-skills.controller.js +6 -2
  193. package/dist/modules/agents/agents-skills.controller.js.map +1 -1
  194. package/dist/modules/agents/agents.controller.d.ts +4 -0
  195. package/dist/modules/agents/agents.controller.js +12 -1
  196. package/dist/modules/agents/agents.controller.js.map +1 -1
  197. package/dist/modules/agents/agents.module.d.ts +2 -1
  198. package/dist/modules/agents/agents.module.js +25 -2
  199. package/dist/modules/agents/agents.module.js.map +1 -1
  200. package/dist/modules/agents/agents.service.d.ts +9 -4
  201. package/dist/modules/agents/agents.service.js +29 -7
  202. package/dist/modules/agents/agents.service.js.map +1 -1
  203. package/dist/modules/agents/background/agent-background-job.service.d.ts +16 -3
  204. package/dist/modules/agents/background/agent-background-job.service.js +105 -6
  205. package/dist/modules/agents/background/agent-background-job.service.js.map +1 -1
  206. package/dist/modules/agents/background/agent-wake.service.d.ts +47 -0
  207. package/dist/modules/agents/background/agent-wake.service.js +237 -0
  208. package/dist/modules/agents/background/agent-wake.service.js.map +1 -0
  209. package/dist/modules/agents/background/background-job-messages.d.ts +7 -0
  210. package/dist/modules/agents/background/background-job-messages.js +42 -0
  211. package/dist/modules/agents/background/background-job-messages.js.map +1 -0
  212. package/dist/modules/agents/background/background-job-tools.js +45 -12
  213. package/dist/modules/agents/background/background-job-tools.js.map +1 -1
  214. package/dist/modules/agents/background/sub-agent-background-runner.d.ts +1 -1
  215. package/dist/modules/agents/background/sub-agent-background-runner.js +3 -3
  216. package/dist/modules/agents/background/sub-agent-background-runner.js.map +1 -1
  217. package/dist/modules/agents/builder/agent-builder-preview-path.js +1 -1
  218. package/dist/modules/agents/builder/agent-builder-preview-path.js.map +1 -1
  219. package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +3 -2
  220. package/dist/modules/agents/builder/agents-builder-tools.service.js +29 -17
  221. package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
  222. package/dist/modules/agents/builder/agents-builder.service.d.ts +4 -1
  223. package/dist/modules/agents/builder/agents-builder.service.js +12 -3
  224. package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
  225. package/dist/modules/agents/builder/builder-model-live-lookup.service.d.ts +7 -2
  226. package/dist/modules/agents/builder/builder-model-live-lookup.service.js +21 -3
  227. package/dist/modules/agents/builder/builder-model-live-lookup.service.js.map +1 -1
  228. package/dist/modules/agents/builder/format-preview-context.js +3 -0
  229. package/dist/modules/agents/builder/format-preview-context.js.map +1 -1
  230. package/dist/modules/agents/builder/get-resource-locator-options.tool.d.ts +2 -2
  231. package/dist/modules/agents/builder/prompts/config-rules.prompt.js +2 -3
  232. package/dist/modules/agents/builder/prompts/config-rules.prompt.js.map +1 -1
  233. package/dist/modules/agents/builder/skills/external-services.skill.js +2 -2
  234. package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
  235. package/dist/modules/agents/builder/skills/memory.skill.js +4 -4
  236. package/dist/modules/agents/builder/skills/memory.skill.js.map +1 -1
  237. package/dist/modules/agents/builder/skills/target-skills.skill.js +4 -2
  238. package/dist/modules/agents/builder/skills/target-skills.skill.js.map +1 -1
  239. package/dist/modules/agents/entities/agent-background-job.entity.d.ts +3 -0
  240. package/dist/modules/agents/entities/agent-background-job.entity.js +14 -1
  241. package/dist/modules/agents/entities/agent-background-job.entity.js.map +1 -1
  242. package/dist/modules/agents/entities/agent-execution.entity.d.ts +2 -0
  243. package/dist/modules/agents/entities/agent-execution.entity.js +4 -0
  244. package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -1
  245. package/dist/modules/agents/entities/agent-memory-entry-candidate.entity.d.ts +15 -0
  246. package/dist/modules/agents/entities/agent-memory-entry-candidate.entity.js +70 -0
  247. package/dist/modules/agents/entities/agent-memory-entry-candidate.entity.js.map +1 -0
  248. package/dist/modules/agents/entities/agent-memory-entry-source.entity.d.ts +2 -1
  249. package/dist/modules/agents/entities/agent-memory-entry-source.entity.js +11 -2
  250. package/dist/modules/agents/entities/agent-memory-entry-source.entity.js.map +1 -1
  251. package/dist/modules/agents/entities/agent-message.entity.js +2 -1
  252. package/dist/modules/agents/entities/agent-message.entity.js.map +1 -1
  253. package/dist/modules/agents/episodic-memory.d.ts +2 -2
  254. package/dist/modules/agents/episodic-memory.js +1 -4
  255. package/dist/modules/agents/episodic-memory.js.map +1 -1
  256. package/dist/modules/agents/execution-recorder.d.ts +6 -2
  257. package/dist/modules/agents/execution-recorder.js +17 -6
  258. package/dist/modules/agents/execution-recorder.js.map +1 -1
  259. package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +3 -1
  260. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +5 -4
  261. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
  262. package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +5 -1
  263. package/dist/modules/agents/integrations/agent-chat-bridge.js +53 -13
  264. package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
  265. package/dist/modules/agents/integrations/agent-chat-stream-consumer.d.ts +5 -3
  266. package/dist/modules/agents/integrations/agent-chat-stream-consumer.js +35 -25
  267. package/dist/modules/agents/integrations/agent-chat-stream-consumer.js.map +1 -1
  268. package/dist/modules/agents/integrations/channel-rate-limit.d.ts +14 -0
  269. package/dist/modules/agents/integrations/channel-rate-limit.guard.d.ts +5 -0
  270. package/dist/modules/agents/integrations/channel-rate-limit.guard.js +40 -0
  271. package/dist/modules/agents/integrations/channel-rate-limit.guard.js.map +1 -0
  272. package/dist/modules/agents/integrations/channel-rate-limit.js +69 -0
  273. package/dist/modules/agents/integrations/channel-rate-limit.js.map +1 -0
  274. package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
  275. package/dist/modules/agents/integrations/component-mapper.js.map +1 -1
  276. package/dist/modules/agents/integrations/cron-validation.d.ts +2 -1
  277. package/dist/modules/agents/integrations/cron-validation.js +10 -1
  278. package/dist/modules/agents/integrations/cron-validation.js.map +1 -1
  279. package/dist/modules/agents/integrations/integration-action-executor.d.ts +3 -1
  280. package/dist/modules/agents/integrations/integration-action-executor.js +20 -4
  281. package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -1
  282. package/dist/modules/agents/integrations/integration-context-query-executor.d.ts +3 -1
  283. package/dist/modules/agents/integrations/integration-context-query-executor.js +20 -4
  284. package/dist/modules/agents/integrations/integration-context-query-executor.js.map +1 -1
  285. package/dist/modules/agents/integrations/integration-error-codes.d.ts +1 -0
  286. package/dist/modules/agents/integrations/integration-error-codes.js +1 -0
  287. package/dist/modules/agents/integrations/integration-error-codes.js.map +1 -1
  288. package/dist/modules/agents/integrations/integration-helpers.d.ts +1 -0
  289. package/dist/modules/agents/integrations/integration-helpers.js +4 -0
  290. package/dist/modules/agents/integrations/integration-helpers.js.map +1 -1
  291. package/dist/modules/agents/integrations/integration-tool-factory.js.map +1 -1
  292. package/dist/modules/agents/integrations/n8n-checkpoint-storage.d.ts +3 -14
  293. package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +7 -64
  294. package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -1
  295. package/dist/modules/agents/integrations/n8n-memory.d.ts +14 -10
  296. package/dist/modules/agents/integrations/n8n-memory.js +119 -82
  297. package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
  298. package/dist/modules/agents/integrations/platforms/discord-integration.js +1 -1
  299. package/dist/modules/agents/integrations/platforms/discord-integration.js.map +1 -1
  300. package/dist/modules/agents/integrations/platforms/slack/slack-operations.js.map +1 -1
  301. package/dist/modules/agents/integrations/recording/channel-integration-recorder.js +2 -9
  302. package/dist/modules/agents/integrations/recording/channel-integration-recorder.js.map +1 -1
  303. package/dist/modules/agents/json-config/credential-field-mapping.js.map +1 -1
  304. package/dist/modules/agents/json-config/from-json-config.d.ts +1 -0
  305. package/dist/modules/agents/json-config/from-json-config.js +14 -25
  306. package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
  307. package/dist/modules/agents/json-config/model-config.js.map +1 -1
  308. package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.js +0 -1
  309. package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.js.map +1 -1
  310. package/dist/modules/agents/model-stream-stall-options.d.ts +3 -0
  311. package/dist/modules/agents/model-stream-stall-options.js +21 -0
  312. package/dist/modules/agents/model-stream-stall-options.js.map +1 -0
  313. package/dist/modules/agents/repositories/agent-background-job.repository.d.ts +8 -0
  314. package/dist/modules/agents/repositories/agent-background-job.repository.js +44 -1
  315. package/dist/modules/agents/repositories/agent-background-job.repository.js.map +1 -1
  316. package/dist/modules/agents/repositories/agent-execution.repository.d.ts +1 -0
  317. package/dist/modules/agents/repositories/agent-execution.repository.js +3 -0
  318. package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
  319. package/dist/modules/agents/repositories/agent-memory-entry-candidate.repository.d.ts +22 -0
  320. package/dist/modules/agents/repositories/agent-memory-entry-candidate.repository.js +75 -0
  321. package/dist/modules/agents/repositories/agent-memory-entry-candidate.repository.js.map +1 -0
  322. package/dist/modules/agents/repositories/agent-message.repository.d.ts +1 -0
  323. package/dist/modules/agents/repositories/agent-message.repository.js +11 -0
  324. package/dist/modules/agents/repositories/agent-message.repository.js.map +1 -1
  325. package/dist/modules/agents/repositories/agent.repository.d.ts +2 -0
  326. package/dist/modules/agents/repositories/agent.repository.js +14 -0
  327. package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
  328. package/dist/modules/agents/scheduling/agent-task-job-registrar.d.ts +23 -0
  329. package/dist/modules/agents/scheduling/agent-task-job-registrar.js +146 -0
  330. package/dist/modules/agents/scheduling/agent-task-job-registrar.js.map +1 -0
  331. package/dist/modules/agents/scheduling/agent-task-job.d.ts +7 -0
  332. package/dist/modules/agents/scheduling/agent-task-job.js +12 -0
  333. package/dist/modules/agents/scheduling/agent-task-job.js.map +1 -0
  334. package/dist/modules/agents/scheduling/agent-task-task-handler.d.ts +13 -0
  335. package/dist/modules/agents/scheduling/agent-task-task-handler.js +68 -0
  336. package/dist/modules/agents/scheduling/agent-task-task-handler.js.map +1 -0
  337. package/dist/modules/agents/scheduling/task-timezone.d.ts +2 -0
  338. package/dist/modules/agents/scheduling/task-timezone.js +13 -0
  339. package/dist/modules/agents/scheduling/task-timezone.js.map +1 -0
  340. package/dist/modules/agents/sub-agents/sub-agent-runner.d.ts +3 -1
  341. package/dist/modules/agents/sub-agents/sub-agent-runner.js +14 -5
  342. package/dist/modules/agents/sub-agents/sub-agent-runner.js.map +1 -1
  343. package/dist/modules/agents/tools/node-tool-factory.js.map +1 -1
  344. package/dist/modules/agents/tools/workflow-tool-factory.d.ts +1 -0
  345. package/dist/modules/agents/tools/workflow-tool-factory.js +35 -6
  346. package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
  347. package/dist/modules/agents/utils/agent-config-hash.d.ts +4 -1
  348. package/dist/modules/agents/utils/agent-config-hash.js +10 -3
  349. package/dist/modules/agents/utils/agent-config-hash.js.map +1 -1
  350. package/dist/modules/agents/utils/agent-memory-scope.d.ts +7 -0
  351. package/dist/modules/agents/utils/agent-memory-scope.js +30 -1
  352. package/dist/modules/agents/utils/agent-memory-scope.js.map +1 -1
  353. package/dist/modules/agents/utils/execution-to-message-mapper.d.ts +1 -1
  354. package/dist/modules/agents/utils/execution-to-message-mapper.js +11 -7
  355. package/dist/modules/agents/utils/execution-to-message-mapper.js.map +1 -1
  356. package/dist/modules/agents/utils/mcp-attribution.d.ts +4 -0
  357. package/dist/modules/agents/utils/mcp-attribution.js +34 -0
  358. package/dist/modules/agents/utils/mcp-attribution.js.map +1 -0
  359. package/dist/modules/breaking-changes/rules/index.d.ts +3 -0
  360. package/dist/modules/breaking-changes/rules/index.js +3 -0
  361. package/dist/modules/breaking-changes/rules/index.js.map +1 -1
  362. package/dist/modules/breaking-changes/rules/v3/chat-hub-deprecated.rule.d.ts +9 -0
  363. package/dist/modules/breaking-changes/rules/v3/chat-hub-deprecated.rule.js +59 -0
  364. package/dist/modules/breaking-changes/rules/v3/chat-hub-deprecated.rule.js.map +1 -0
  365. package/dist/modules/breaking-changes/rules/v3/external-secrets-project-roles-default.rule.d.ts +12 -0
  366. package/dist/modules/breaking-changes/rules/v3/external-secrets-project-roles-default.rule.js +70 -0
  367. package/dist/modules/breaking-changes/rules/v3/external-secrets-project-roles-default.rule.js.map +1 -0
  368. package/dist/modules/breaking-changes/rules/v3/pre-execute-error-creates-execution.rule.d.ts +9 -0
  369. package/dist/modules/breaking-changes/rules/v3/pre-execute-error-creates-execution.rule.js +56 -0
  370. package/dist/modules/breaking-changes/rules/v3/pre-execute-error-creates-execution.rule.js.map +1 -0
  371. package/dist/modules/chat-hub/chat-hub-extractor.d.ts +3 -1
  372. package/dist/modules/chat-hub/chat-hub-extractor.js +21 -14
  373. package/dist/modules/chat-hub/chat-hub-extractor.js.map +1 -1
  374. package/dist/modules/chat-hub/chat-hub.attachment.service.js +1 -1
  375. package/dist/modules/chat-hub/chat-hub.attachment.service.js.map +1 -1
  376. package/dist/modules/data-table/data-table-aggregate.controller.js +0 -2
  377. package/dist/modules/data-table/data-table-aggregate.controller.js.map +1 -1
  378. package/dist/modules/data-table/data-table-aggregate.service.d.ts +5 -4
  379. package/dist/modules/data-table/data-table-aggregate.service.js +8 -6
  380. package/dist/modules/data-table/data-table-aggregate.service.js.map +1 -1
  381. package/dist/modules/data-table/data-table-file-cleanup.service.js.map +1 -1
  382. package/dist/modules/data-table/data-table-rows.repository.js +6 -0
  383. package/dist/modules/data-table/data-table-rows.repository.js.map +1 -1
  384. package/dist/modules/data-table/data-table.service.js +12 -0
  385. package/dist/modules/data-table/data-table.service.js.map +1 -1
  386. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.d.ts +4 -1
  387. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js +30 -2
  388. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/n8n-identifier.js.map +1 -1
  389. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js +5 -1
  390. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js.map +1 -1
  391. package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.d.ts +2 -2
  392. package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js +2 -2
  393. package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js.map +1 -1
  394. package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.d.ts +5 -2
  395. package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js +9 -9
  396. package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js.map +1 -1
  397. package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js +1 -1
  398. package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js.map +1 -1
  399. package/dist/modules/engine-v2/engine-control-plane-auth.middleware.d.ts +2 -1
  400. package/dist/modules/engine-v2/engine-control-plane-auth.middleware.js +2 -2
  401. package/dist/modules/engine-v2/engine-control-plane-auth.middleware.js.map +1 -1
  402. package/dist/modules/engine-v2/engine-control-plane-client.d.ts +2 -4
  403. package/dist/modules/engine-v2/engine-control-plane-client.js +4 -13
  404. package/dist/modules/engine-v2/engine-control-plane-client.js.map +1 -1
  405. package/dist/modules/engine-v2/engine-control-plane-server.d.ts +3 -1
  406. package/dist/modules/engine-v2/engine-control-plane-server.js +7 -6
  407. package/dist/modules/engine-v2/engine-control-plane-server.js.map +1 -1
  408. package/dist/modules/engine-v2/engine-control-plane-transport.d.ts +10 -0
  409. package/dist/modules/engine-v2/engine-control-plane-transport.js +38 -0
  410. package/dist/modules/engine-v2/engine-control-plane-transport.js.map +1 -0
  411. package/dist/modules/engine-v2/engine-credentials-client.d.ts +8 -0
  412. package/dist/modules/engine-v2/engine-credentials-client.js +47 -0
  413. package/dist/modules/engine-v2/engine-credentials-client.js.map +1 -0
  414. package/dist/modules/engine-v2/engine-credentials.contract.d.ts +1 -0
  415. package/dist/modules/engine-v2/engine-credentials.contract.js +7 -0
  416. package/dist/modules/engine-v2/engine-credentials.contract.js.map +1 -1
  417. package/dist/modules/engine-v2/engine-credentials.controller.d.ts +7 -0
  418. package/dist/modules/engine-v2/engine-credentials.controller.js +35 -0
  419. package/dist/modules/engine-v2/engine-credentials.controller.js.map +1 -0
  420. package/dist/modules/engine-v2/engine-credentials.service.d.ts +12 -0
  421. package/dist/modules/engine-v2/engine-credentials.service.js +95 -0
  422. package/dist/modules/engine-v2/engine-credentials.service.js.map +1 -0
  423. package/dist/modules/engine-v2/engine-data-plane-client.js.map +1 -1
  424. package/dist/modules/engine-v2/remote-credentials-helper.d.ts +24 -0
  425. package/dist/modules/engine-v2/remote-credentials-helper.js +90 -0
  426. package/dist/modules/engine-v2/remote-credentials-helper.js.map +1 -0
  427. package/dist/modules/insights/database/entities/insights-shared.d.ts +4 -2
  428. package/dist/modules/insights/database/entities/insights-shared.js +1 -0
  429. package/dist/modules/insights/database/entities/insights-shared.js.map +1 -1
  430. package/dist/modules/insights/database/repositories/insights-by-period.repository.d.ts +3 -3
  431. package/dist/modules/insights/database/repositories/insights-by-period.repository.js +8 -2
  432. package/dist/modules/insights/database/repositories/insights-by-period.repository.js.map +1 -1
  433. package/dist/modules/insights/insights-collection.service.js +8 -0
  434. package/dist/modules/insights/insights-collection.service.js.map +1 -1
  435. package/dist/modules/insights/insights-compaction.task.js +1 -2
  436. package/dist/modules/insights/insights-compaction.task.js.map +1 -1
  437. package/dist/modules/insights/insights-pruning.task.js +1 -2
  438. package/dist/modules/insights/insights-pruning.task.js.map +1 -1
  439. package/dist/modules/insights/insights.controller.js +4 -5
  440. package/dist/modules/insights/insights.controller.js.map +1 -1
  441. package/dist/modules/insights/insights.service.d.ts +12 -22
  442. package/dist/modules/insights/insights.service.js +49 -18
  443. package/dist/modules/insights/insights.service.js.map +1 -1
  444. package/dist/modules/instance-ai/browser/browser-local-mcp-server.js +2 -2
  445. package/dist/modules/instance-ai/browser/browser-local-mcp-server.js.map +1 -1
  446. package/dist/modules/instance-ai/drop-rejected-attachments.d.ts +1 -1
  447. package/dist/modules/instance-ai/entities/instance-ai-checkpoint.entity.d.ts +1 -1
  448. package/dist/modules/instance-ai/entities/instance-ai-thread.entity.js +2 -1
  449. package/dist/modules/instance-ai/entities/instance-ai-thread.entity.js.map +1 -1
  450. package/dist/modules/instance-ai/eval/agent-scenario-seed.js +4 -2
  451. package/dist/modules/instance-ai/eval/agent-scenario-seed.js.map +1 -1
  452. package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
  453. package/dist/modules/instance-ai/eval/llm-completion-mock.js +16 -19
  454. package/dist/modules/instance-ai/eval/llm-completion-mock.js.map +1 -1
  455. package/dist/modules/instance-ai/eval/mock-handler.js +3 -2
  456. package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
  457. package/dist/modules/instance-ai/eval/mock-utils.js +2 -4
  458. package/dist/modules/instance-ai/eval/mock-utils.js.map +1 -1
  459. package/dist/modules/instance-ai/eval/openai-envelope.js.map +1 -1
  460. package/dist/modules/instance-ai/eval/openai-responses-envelope.js +9 -11
  461. package/dist/modules/instance-ai/eval/openai-responses-envelope.js.map +1 -1
  462. package/dist/modules/instance-ai/eval/provider-shapes.js +30 -33
  463. package/dist/modules/instance-ai/eval/provider-shapes.js.map +1 -1
  464. package/dist/modules/instance-ai/eval/request-sanitizer.js.map +1 -1
  465. package/dist/modules/instance-ai/eval/structured-output-conformance.js +14 -16
  466. package/dist/modules/instance-ai/eval/structured-output-conformance.js.map +1 -1
  467. package/dist/modules/instance-ai/eval/thread-restore.service.d.ts +13 -3
  468. package/dist/modules/instance-ai/eval/thread-restore.service.js +95 -22
  469. package/dist/modules/instance-ai/eval/thread-restore.service.js.map +1 -1
  470. package/dist/modules/instance-ai/eval/workflow-analysis.js +2 -4
  471. package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
  472. package/dist/modules/instance-ai/event-bus/durable-event-log.d.ts +4 -0
  473. package/dist/modules/instance-ai/event-bus/durable-event-log.js +4 -0
  474. package/dist/modules/instance-ai/event-bus/durable-event-log.js.map +1 -1
  475. package/dist/modules/instance-ai/instance-ai-checkpoint-pruning.task.d.ts +16 -0
  476. package/dist/modules/instance-ai/instance-ai-checkpoint-pruning.task.js +40 -0
  477. package/dist/modules/instance-ai/instance-ai-checkpoint-pruning.task.js.map +1 -0
  478. package/dist/modules/instance-ai/instance-ai-credit.service.js +12 -8
  479. package/dist/modules/instance-ai/instance-ai-credit.service.js.map +1 -1
  480. package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +6 -3
  481. package/dist/modules/instance-ai/instance-ai-memory.service.js +36 -2
  482. package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
  483. package/dist/modules/instance-ai/instance-ai-model.service.js +2 -2
  484. package/dist/modules/instance-ai/instance-ai-model.service.js.map +1 -1
  485. package/dist/modules/instance-ai/instance-ai-pending-agent.service.d.ts +2 -0
  486. package/dist/modules/instance-ai/instance-ai-settings.service.js +8 -8
  487. package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
  488. package/dist/modules/instance-ai/instance-ai-setup-telemetry.service.js +2 -2
  489. package/dist/modules/instance-ai/instance-ai-setup-telemetry.service.js.map +1 -1
  490. package/dist/modules/instance-ai/instance-ai-verification.service.js +3 -4
  491. package/dist/modules/instance-ai/instance-ai-verification.service.js.map +1 -1
  492. package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +8 -4
  493. package/dist/modules/instance-ai/instance-ai.adapter.service.js +192 -73
  494. package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
  495. package/dist/modules/instance-ai/instance-ai.controller.d.ts +7 -1
  496. package/dist/modules/instance-ai/instance-ai.controller.js +37 -5
  497. package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
  498. package/dist/modules/instance-ai/instance-ai.module.d.ts +2 -1
  499. package/dist/modules/instance-ai/instance-ai.module.js +7 -0
  500. package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
  501. package/dist/modules/instance-ai/instance-ai.service.d.ts +13 -18
  502. package/dist/modules/instance-ai/instance-ai.service.js +179 -400
  503. package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
  504. package/dist/modules/instance-ai/instance-context.service.d.ts +48 -0
  505. package/dist/modules/instance-ai/instance-context.service.js +388 -0
  506. package/dist/modules/instance-ai/instance-context.service.js.map +1 -0
  507. package/dist/modules/instance-ai/internal-messages.d.ts +8 -0
  508. package/dist/modules/instance-ai/internal-messages.js +34 -3
  509. package/dist/modules/instance-ai/internal-messages.js.map +1 -1
  510. package/dist/modules/instance-ai/message-parser.d.ts +4 -3
  511. package/dist/modules/instance-ai/message-parser.js.map +1 -1
  512. package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.d.ts +1 -1
  513. package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.d.ts +5 -1
  514. package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js +16 -0
  515. package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js.map +1 -1
  516. package/dist/modules/instance-ai/repositories/instance-ai-thread.repository.d.ts +13 -3
  517. package/dist/modules/instance-ai/repositories/instance-ai-thread.repository.js +59 -4
  518. package/dist/modules/instance-ai/repositories/instance-ai-thread.repository.js.map +1 -1
  519. package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.d.ts +8 -2
  520. package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js +91 -55
  521. package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js.map +1 -1
  522. package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.d.ts +1 -1
  523. package/dist/modules/instance-ai/storage/typeorm-agent-memory.d.ts +6 -2
  524. package/dist/modules/instance-ai/storage/typeorm-agent-memory.js +20 -24
  525. package/dist/modules/instance-ai/storage/typeorm-agent-memory.js.map +1 -1
  526. package/dist/modules/instance-ai/storage/typeorm-observation-log-store.d.ts +1 -2
  527. package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js.map +1 -1
  528. package/dist/modules/instance-ai/stream-transport-error.js +3 -1
  529. package/dist/modules/instance-ai/stream-transport-error.js.map +1 -1
  530. package/dist/modules/instance-ai/suspended-thread-persistence.service.js.map +1 -1
  531. package/dist/modules/instance-ai/web-research/fetch-and-extract.js.map +1 -1
  532. package/dist/modules/instance-ai/workflow-templates.service.js +3 -5
  533. package/dist/modules/instance-ai/workflow-templates.service.js.map +1 -1
  534. package/dist/modules/instance-ai/workflow-verification-obligation-service.d.ts +2 -1
  535. package/dist/modules/instance-ai/workflow-verification-obligation-service.js +11 -3
  536. package/dist/modules/instance-ai/workflow-verification-obligation-service.js.map +1 -1
  537. package/dist/modules/instance-registry/checks/build-check-result.d.ts +13 -0
  538. package/dist/modules/instance-registry/checks/build-check-result.js +19 -0
  539. package/dist/modules/instance-registry/checks/build-check-result.js.map +1 -0
  540. package/dist/modules/instance-registry/checks/hostid-clash.check.js +13 -21
  541. package/dist/modules/instance-registry/checks/hostid-clash.check.js.map +1 -1
  542. package/dist/modules/instance-registry/checks/split-brain.check.js +14 -23
  543. package/dist/modules/instance-registry/checks/split-brain.check.js.map +1 -1
  544. package/dist/modules/instance-registry/checks/version-mismatch.check.js +17 -24
  545. package/dist/modules/instance-registry/checks/version-mismatch.check.js.map +1 -1
  546. package/dist/modules/ldap.ee/ldap.service.ee.js.map +1 -1
  547. package/dist/modules/mcp/mcp.controller.js +8 -6
  548. package/dist/modules/mcp/mcp.controller.js.map +1 -1
  549. package/dist/modules/mcp/mcp.service.d.ts +9 -2
  550. package/dist/modules/mcp/mcp.service.js +28 -8
  551. package/dist/modules/mcp/mcp.service.js.map +1 -1
  552. package/dist/modules/mcp/tools/agents/agent-reference.js +2 -1
  553. package/dist/modules/mcp/tools/agents/agent-reference.js.map +1 -1
  554. package/dist/modules/mcp/tools/agents/agent-tools.service.js +40 -10
  555. package/dist/modules/mcp/tools/agents/agent-tools.service.js.map +1 -1
  556. package/dist/modules/mcp/tools/data-table/get-data-table-rows.tool.d.ts +5 -5
  557. package/dist/modules/mcp/tools/get-workflow-details.tool.js +3 -3
  558. package/dist/modules/mcp/tools/get-workflow-details.tool.js.map +1 -1
  559. package/dist/modules/mcp/tools/get-workflow-versions-diff.tool.js +2 -2
  560. package/dist/modules/mcp/tools/get-workflow-versions-diff.tool.js.map +1 -1
  561. package/dist/modules/mcp/tools/schemas.d.ts +2 -1
  562. package/dist/modules/mcp/tools/schemas.js +6 -2
  563. package/dist/modules/mcp/tools/schemas.js.map +1 -1
  564. package/dist/modules/mcp/tools/webhook-utils.js +8 -6
  565. package/dist/modules/mcp/tools/webhook-utils.js.map +1 -1
  566. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +7 -2
  567. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
  568. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.d.ts +1 -0
  569. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +4 -3
  570. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
  571. package/dist/modules/mcp/tools/workflow-builder/top-level-items-warning.d.ts +13 -0
  572. package/dist/modules/mcp/tools/workflow-builder/top-level-items-warning.js +24 -0
  573. package/dist/modules/mcp/tools/workflow-builder/top-level-items-warning.js.map +1 -0
  574. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +1 -1
  575. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +23 -4
  576. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
  577. package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +7 -9
  578. package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
  579. package/dist/modules/mcp-registry/mcp-registry-connection.js +7 -2
  580. package/dist/modules/mcp-registry/mcp-registry-connection.js.map +1 -1
  581. package/dist/modules/mcp-registry/registry/mcp-registry.types.d.ts +32 -20
  582. package/dist/modules/mcp-registry/registry/mcp-registry.types.js +8 -10
  583. package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -1
  584. package/dist/modules/mcp-registry/registry/mock-servers.js +2 -0
  585. package/dist/modules/mcp-registry/registry/mock-servers.js.map +1 -1
  586. package/dist/modules/n8n-packages/engine/n8n-package-parser.d.ts +1 -0
  587. package/dist/modules/n8n-packages/engine/n8n-package-parser.js +24 -7
  588. package/dist/modules/n8n-packages/engine/n8n-package-parser.js.map +1 -1
  589. package/dist/modules/n8n-packages/entities/folder/folder.exporter.d.ts +2 -0
  590. package/dist/modules/n8n-packages/entities/folder/folder.exporter.js +27 -2
  591. package/dist/modules/n8n-packages/entities/folder/folder.exporter.js.map +1 -1
  592. package/dist/modules/n8n-packages/entities/project/project.exporter.d.ts +2 -0
  593. package/dist/modules/n8n-packages/entities/project/project.exporter.js +28 -8
  594. package/dist/modules/n8n-packages/entities/project/project.exporter.js.map +1 -1
  595. package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.js +1 -1
  596. package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.js.map +1 -1
  597. package/dist/modules/n8n-packages/entities/workflow/workflow-import.types.d.ts +2 -1
  598. package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js +1 -1
  599. package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js.map +1 -1
  600. package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.d.ts +2 -0
  601. package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.js +9 -0
  602. package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.js.map +1 -0
  603. package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.js +2 -0
  604. package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.js.map +1 -1
  605. package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.types.d.ts +1 -1
  606. package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.types.js.map +1 -1
  607. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +1 -1
  608. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -1
  609. package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +2 -0
  610. package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +5 -1
  611. package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -1
  612. package/dist/modules/n8n-packages/io/entity-file-format.d.ts +1 -0
  613. package/dist/modules/n8n-packages/io/entity-file-format.js +7 -0
  614. package/dist/modules/n8n-packages/io/entity-file-format.js.map +1 -0
  615. package/dist/modules/n8n-packages/io/hashing-package-writer.d.ts +10 -0
  616. package/dist/modules/n8n-packages/io/hashing-package-writer.js +25 -0
  617. package/dist/modules/n8n-packages/io/hashing-package-writer.js.map +1 -0
  618. package/dist/modules/n8n-packages/io/manifest-entry.d.ts +38 -0
  619. package/dist/modules/n8n-packages/io/manifest-entry.js +26 -22
  620. package/dist/modules/n8n-packages/io/manifest-entry.js.map +1 -1
  621. package/dist/modules/n8n-packages/n8n-packages.service.d.ts +7 -3
  622. package/dist/modules/n8n-packages/n8n-packages.service.js +10 -3
  623. package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
  624. package/dist/modules/n8n-packages/n8n-packages.types.d.ts +5 -0
  625. package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
  626. package/dist/modules/n8n-packages/spec/constants.d.ts +1 -0
  627. package/dist/modules/n8n-packages/spec/constants.js +2 -1
  628. package/dist/modules/n8n-packages/spec/constants.js.map +1 -1
  629. package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.d.ts +9 -0
  630. package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.js +8 -0
  631. package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.js.map +1 -0
  632. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +0 -3
  633. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +0 -1
  634. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +1 -1
  635. package/dist/modules/oauth-jwe/oauth-jwe-key.service.js.map +1 -1
  636. package/dist/modules/oauth-jwe/oauth-jwe.module.js +2 -4
  637. package/dist/modules/oauth-jwe/oauth-jwe.module.js.map +1 -1
  638. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.js +2 -4
  639. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.js.map +1 -1
  640. package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-resource.resolver.js +2 -4
  641. package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-resource.resolver.js.map +1 -1
  642. package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-test-resource.resolver.js +2 -4
  643. package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-test-resource.resolver.js.map +1 -1
  644. package/dist/modules/oauth-server/protected-resource-resolvers/utils.d.ts +2 -0
  645. package/dist/modules/oauth-server/protected-resource-resolvers/utils.js +8 -0
  646. package/dist/modules/oauth-server/protected-resource-resolvers/utils.js.map +1 -1
  647. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-test-trigger-resource.resolver.js +2 -4
  648. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-test-trigger-resource.resolver.js.map +1 -1
  649. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-trigger-resource.resolver.js +2 -4
  650. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-mcp-trigger-resource.resolver.js.map +1 -1
  651. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-test-trigger-resource.resolver.js +2 -4
  652. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-test-trigger-resource.resolver.js.map +1 -1
  653. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-trigger-resource.resolver.js +2 -4
  654. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-trigger-resource.resolver.js.map +1 -1
  655. package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
  656. package/dist/modules/otel/otel-lifecycle-handler.js +3 -1
  657. package/dist/modules/otel/otel-lifecycle-handler.js.map +1 -1
  658. package/dist/modules/policy-infrastructure/policy-infrastructure.module.js.map +1 -1
  659. package/dist/modules/promotions.ee/base-branch-files.d.ts +67 -0
  660. package/dist/modules/promotions.ee/base-branch-files.js +75 -0
  661. package/dist/modules/promotions.ee/base-branch-files.js.map +1 -0
  662. package/dist/modules/promotions.ee/branch-placement.d.ts +15 -0
  663. package/dist/modules/promotions.ee/branch-placement.js +42 -0
  664. package/dist/modules/promotions.ee/branch-placement.js.map +1 -0
  665. package/dist/modules/{git-connections.ee → promotions.ee}/constants.d.ts +7 -1
  666. package/dist/modules/{git-connections.ee → promotions.ee}/constants.js +5 -2
  667. package/dist/modules/promotions.ee/constants.js.map +1 -0
  668. package/dist/modules/promotions.ee/database/entities/promotion-config.entity.d.ts +11 -0
  669. package/dist/modules/promotions.ee/database/entities/promotion-config.entity.js +44 -0
  670. package/dist/modules/promotions.ee/database/entities/promotion-config.entity.js.map +1 -0
  671. package/dist/modules/promotions.ee/database/entities/promotion-connection-project.entity.d.ts +8 -0
  672. package/dist/modules/{git-connections.ee/database/entities/git-connection-project.entity.js → promotions.ee/database/entities/promotion-connection-project.entity.js} +13 -13
  673. package/dist/modules/promotions.ee/database/entities/promotion-connection-project.entity.js.map +1 -0
  674. package/dist/modules/promotions.ee/database/entities/promotion-connection.entity.d.ts +11 -0
  675. package/dist/modules/promotions.ee/database/entities/promotion-connection.entity.js +45 -0
  676. package/dist/modules/promotions.ee/database/entities/promotion-connection.entity.js.map +1 -0
  677. package/dist/modules/promotions.ee/database/entities/promotion-provider.entity.d.ts +9 -0
  678. package/dist/modules/promotions.ee/database/entities/promotion-provider.entity.js +41 -0
  679. package/dist/modules/promotions.ee/database/entities/promotion-provider.entity.js.map +1 -0
  680. package/dist/modules/promotions.ee/database/promotion-conflict.error.d.ts +6 -0
  681. package/dist/modules/promotions.ee/database/promotion-conflict.error.js +12 -0
  682. package/dist/modules/promotions.ee/database/promotion-conflict.error.js.map +1 -0
  683. package/dist/modules/promotions.ee/database/repositories/promotion-config.repository.d.ts +19 -0
  684. package/dist/modules/promotions.ee/database/repositories/promotion-config.repository.js +67 -0
  685. package/dist/modules/promotions.ee/database/repositories/promotion-config.repository.js.map +1 -0
  686. package/dist/modules/promotions.ee/database/repositories/promotion-connection-project.repository.d.ts +10 -0
  687. package/dist/modules/promotions.ee/database/repositories/promotion-connection-project.repository.js +54 -0
  688. package/dist/modules/promotions.ee/database/repositories/promotion-connection-project.repository.js.map +1 -0
  689. package/dist/modules/promotions.ee/database/repositories/promotion-connection.repository.d.ts +27 -0
  690. package/dist/modules/promotions.ee/database/repositories/promotion-connection.repository.js +77 -0
  691. package/dist/modules/promotions.ee/database/repositories/promotion-connection.repository.js.map +1 -0
  692. package/dist/modules/promotions.ee/database/repositories/promotion-provider.repository.d.ts +19 -0
  693. package/dist/modules/promotions.ee/database/repositories/promotion-provider.repository.js +71 -0
  694. package/dist/modules/promotions.ee/database/repositories/promotion-provider.repository.js.map +1 -0
  695. package/dist/modules/promotions.ee/diff-package-files.d.ts +13 -0
  696. package/dist/modules/promotions.ee/diff-package-files.js +48 -0
  697. package/dist/modules/promotions.ee/diff-package-files.js.map +1 -0
  698. package/dist/modules/promotions.ee/import-manifest-bridge.d.ts +8 -0
  699. package/dist/modules/promotions.ee/import-manifest-bridge.js +254 -0
  700. package/dist/modules/promotions.ee/import-manifest-bridge.js.map +1 -0
  701. package/dist/modules/promotions.ee/promotion-change.service.d.ts +14 -0
  702. package/dist/modules/promotions.ee/promotion-change.service.js +211 -0
  703. package/dist/modules/promotions.ee/promotion-change.service.js.map +1 -0
  704. package/dist/modules/promotions.ee/promotion-changes.controller.d.ts +9 -0
  705. package/dist/modules/promotions.ee/promotion-changes.controller.js +50 -0
  706. package/dist/modules/promotions.ee/promotion-changes.controller.js.map +1 -0
  707. package/dist/modules/promotions.ee/promotion-config-settings.d.ts +6 -0
  708. package/dist/modules/promotions.ee/promotion-config-settings.js +13 -0
  709. package/dist/modules/promotions.ee/promotion-config-settings.js.map +1 -0
  710. package/dist/modules/promotions.ee/promotion-config.resolver.d.ts +16 -0
  711. package/dist/modules/promotions.ee/promotion-config.resolver.js +97 -0
  712. package/dist/modules/promotions.ee/promotion-config.resolver.js.map +1 -0
  713. package/dist/modules/promotions.ee/promotion-conflicts.d.ts +1 -0
  714. package/dist/modules/promotions.ee/promotion-conflicts.js +16 -0
  715. package/dist/modules/promotions.ee/promotion-conflicts.js.map +1 -0
  716. package/dist/modules/promotions.ee/promotion-connections.service.d.ts +70 -0
  717. package/dist/modules/promotions.ee/promotion-connections.service.js +274 -0
  718. package/dist/modules/promotions.ee/promotion-connections.service.js.map +1 -0
  719. package/dist/modules/promotions.ee/promotion-providers.service.d.ts +48 -0
  720. package/dist/modules/promotions.ee/promotion-providers.service.js +166 -0
  721. package/dist/modules/promotions.ee/promotion-providers.service.js.map +1 -0
  722. package/dist/modules/promotions.ee/promotion-working-directory.service.d.ts +19 -0
  723. package/dist/modules/promotions.ee/promotion-working-directory.service.js +82 -0
  724. package/dist/modules/promotions.ee/promotion-working-directory.service.js.map +1 -0
  725. package/dist/modules/promotions.ee/promotions-git.service.d.ts +59 -0
  726. package/dist/modules/promotions.ee/promotions-git.service.js +402 -0
  727. package/dist/modules/promotions.ee/promotions-git.service.js.map +1 -0
  728. package/dist/modules/promotions.ee/promotions-git.utils.d.ts +16 -0
  729. package/dist/modules/{git-connections.ee/git-connections-git.utils.js → promotions.ee/promotions-git.utils.js} +15 -3
  730. package/dist/modules/promotions.ee/promotions-git.utils.js.map +1 -0
  731. package/dist/modules/promotions.ee/promotions.module.d.ts +5 -0
  732. package/dist/modules/promotions.ee/promotions.module.js +35 -0
  733. package/dist/modules/promotions.ee/promotions.module.js.map +1 -0
  734. package/dist/modules/promotions.ee/promotions.service.d.ts +43 -0
  735. package/dist/modules/promotions.ee/promotions.service.js +413 -0
  736. package/dist/modules/promotions.ee/promotions.service.js.map +1 -0
  737. package/dist/modules/promotions.ee/promotions.types.d.ts +61 -0
  738. package/dist/modules/promotions.ee/promotions.types.js +15 -0
  739. package/dist/modules/promotions.ee/promotions.types.js.map +1 -0
  740. package/dist/modules/promotions.ee/working-copy-updater.d.ts +53 -0
  741. package/dist/modules/promotions.ee/working-copy-updater.js +487 -0
  742. package/dist/modules/promotions.ee/working-copy-updater.js.map +1 -0
  743. package/dist/modules/redaction/dynamic-credentials-context-hook.d.ts +13 -0
  744. package/dist/modules/redaction/dynamic-credentials-context-hook.js +68 -0
  745. package/dist/modules/redaction/dynamic-credentials-context-hook.js.map +1 -0
  746. package/dist/modules/redaction/executions/execution-redaction.service.js +11 -1
  747. package/dist/modules/redaction/executions/execution-redaction.service.js.map +1 -1
  748. package/dist/modules/redaction/instance-redaction-enforcement.service.js.map +1 -1
  749. package/dist/modules/redaction/redaction.module.js +2 -1
  750. package/dist/modules/redaction/redaction.module.js.map +1 -1
  751. package/dist/modules/runtime-credentials/runtime-credentials.module.js +2 -4
  752. package/dist/modules/runtime-credentials/runtime-credentials.module.js.map +1 -1
  753. package/dist/modules/source-control.ee/source-control-git.service.ee.js +7 -4
  754. package/dist/modules/source-control.ee/source-control-git.service.ee.js.map +1 -1
  755. package/dist/modules/source-control.ee/source-control-helper.ee.js +3 -6
  756. package/dist/modules/source-control.ee/source-control-helper.ee.js.map +1 -1
  757. package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +7 -4
  758. package/dist/modules/source-control.ee/source-control-import.service.ee.js +40 -9
  759. package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
  760. package/dist/modules/sso-oidc/oidc.service.ee.js.map +1 -1
  761. package/dist/modules/sso-saml/saml-helpers.js.map +1 -1
  762. package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
  763. package/dist/modules/token-exchange/services/jwks-resolver.js.map +1 -1
  764. package/dist/modules/token-exchange/token-exchange.module.js +3 -5
  765. package/dist/modules/token-exchange/token-exchange.module.js.map +1 -1
  766. package/dist/modules/type-availability-policies/available-types.controller.d.ts +10 -0
  767. package/dist/modules/type-availability-policies/available-types.controller.js +57 -0
  768. package/dist/modules/type-availability-policies/available-types.controller.js.map +1 -0
  769. package/dist/modules/type-availability-policies/constants.d.ts +1 -0
  770. package/dist/modules/type-availability-policies/constants.js +5 -0
  771. package/dist/modules/type-availability-policies/constants.js.map +1 -0
  772. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.d.ts +1 -0
  773. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js +11 -0
  774. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js.map +1 -1
  775. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.d.ts +2 -1
  776. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js +18 -5
  777. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js.map +1 -1
  778. package/dist/modules/type-availability-policies/policy-evaluator.d.ts +15 -1
  779. package/dist/modules/type-availability-policies/policy-evaluator.js +74 -5
  780. package/dist/modules/type-availability-policies/policy-evaluator.js.map +1 -1
  781. package/dist/modules/type-availability-policies/policy-rule.types.d.ts +2 -13
  782. package/dist/modules/type-availability-policies/type-availability-policies.module.js +7 -1
  783. package/dist/modules/type-availability-policies/type-availability-policies.module.js.map +1 -1
  784. package/dist/modules/type-availability-policies/type-availability-policy-instance.controller.d.ts +5 -8
  785. package/dist/modules/type-availability-policies/type-availability-policy-instance.controller.js +10 -13
  786. package/dist/modules/type-availability-policies/type-availability-policy-instance.controller.js.map +1 -1
  787. package/dist/modules/type-availability-policies/type-availability-policy-project.controller.d.ts +25 -0
  788. package/dist/modules/type-availability-policies/type-availability-policy-project.controller.js +67 -0
  789. package/dist/modules/type-availability-policies/type-availability-policy-project.controller.js.map +1 -0
  790. package/dist/modules/type-availability-policies/type-availability-policy.service.d.ts +7 -0
  791. package/dist/modules/type-availability-policies/type-availability-policy.service.js +78 -6
  792. package/dist/modules/type-availability-policies/type-availability-policy.service.js.map +1 -1
  793. package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
  794. package/dist/node-types.js +9 -6
  795. package/dist/node-types.js.map +1 -1
  796. package/dist/posthog/index.js +2 -1
  797. package/dist/posthog/index.js.map +1 -1
  798. package/dist/public-api/public-api-controller.registry.js +17 -10
  799. package/dist/public-api/public-api-controller.registry.js.map +1 -1
  800. package/dist/public-api/public-api-route-resolver.d.ts +11 -1
  801. package/dist/public-api/public-api-route-resolver.js +17 -2
  802. package/dist/public-api/public-api-route-resolver.js.map +1 -1
  803. package/dist/public-api/public-api-validation-error.d.ts +1 -1
  804. package/dist/public-api/public-api-validation-error.js.map +1 -1
  805. package/dist/public-api/types.d.ts +1 -29
  806. package/dist/public-api/v1/controllers/credentials.public.controller.d.ts +18 -2
  807. package/dist/public-api/v1/controllers/credentials.public.controller.js +210 -5
  808. package/dist/public-api/v1/controllers/credentials.public.controller.js.map +1 -1
  809. package/dist/public-api/v1/controllers/executions.public.controller.js +6 -17
  810. package/dist/public-api/v1/controllers/executions.public.controller.js.map +1 -1
  811. package/dist/public-api/v1/controllers/index.d.ts +4 -1
  812. package/dist/public-api/v1/controllers/index.js +4 -1
  813. package/dist/public-api/v1/controllers/index.js.map +1 -1
  814. package/dist/public-api/v1/controllers/node-type-policies.public.controller.d.ts +13 -0
  815. package/dist/public-api/v1/controllers/node-type-policies.public.controller.js +141 -0
  816. package/dist/public-api/v1/controllers/node-type-policies.public.controller.js.map +1 -0
  817. package/dist/public-api/v1/controllers/projects.public.controller.d.ts +19 -0
  818. package/dist/public-api/v1/controllers/projects.public.controller.js +231 -0
  819. package/dist/public-api/v1/controllers/projects.public.controller.js.map +1 -0
  820. package/dist/public-api/v1/controllers/promotions.public.controller.d.ts +33 -0
  821. package/dist/public-api/v1/controllers/promotions.public.controller.js +503 -0
  822. package/dist/public-api/v1/controllers/promotions.public.controller.js.map +1 -0
  823. package/dist/public-api/v1/controllers/role-mapping-rules.public.controller.js +3 -3
  824. package/dist/public-api/v1/controllers/role-mapping-rules.public.controller.js.map +1 -1
  825. package/dist/public-api/v1/controllers/roles.public.controller.d.ts +3 -3
  826. package/dist/public-api/v1/controllers/roles.public.controller.js +14 -14
  827. package/dist/public-api/v1/controllers/roles.public.controller.js.map +1 -1
  828. package/dist/public-api/v1/controllers/source-control.public.controller.d.ts +5 -2
  829. package/dist/public-api/v1/controllers/source-control.public.controller.js +50 -4
  830. package/dist/public-api/v1/controllers/source-control.public.controller.js.map +1 -1
  831. package/dist/public-api/v1/controllers/tags.public.controller.d.ts +3 -1
  832. package/dist/public-api/v1/controllers/tags.public.controller.js +56 -6
  833. package/dist/public-api/v1/controllers/tags.public.controller.js.map +1 -1
  834. package/dist/public-api/v1/controllers/variables.public.controller.d.ts +12 -0
  835. package/dist/public-api/v1/controllers/variables.public.controller.js +127 -0
  836. package/dist/public-api/v1/controllers/variables.public.controller.js.map +1 -0
  837. package/dist/public-api/v1/controllers/workflows.public.controller.d.ts +1 -1
  838. package/dist/public-api/v1/controllers/workflows.public.controller.js +20 -29
  839. package/dist/public-api/v1/controllers/workflows.public.controller.js.map +1 -1
  840. package/dist/public-api/v1/handlers/credentials/credentials.handler.d.ts +0 -4
  841. package/dist/public-api/v1/handlers/credentials/credentials.handler.js +0 -159
  842. package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
  843. package/dist/public-api/v1/handlers/credentials/credentials.utils.d.ts +6 -0
  844. package/dist/public-api/v1/handlers/credentials/credentials.utils.js +30 -0
  845. package/dist/public-api/v1/handlers/credentials/credentials.utils.js.map +1 -1
  846. package/dist/public-api/v1/handlers/tags/tags.handler.d.ts +0 -2
  847. package/dist/public-api/v1/handlers/tags/tags.handler.js +0 -27
  848. package/dist/public-api/v1/handlers/tags/tags.handler.js.map +1 -1
  849. package/dist/public-api/v1/openapi-gen/decorator-routes.js +3 -2
  850. package/dist/public-api/v1/openapi-gen/decorator-routes.js.map +1 -1
  851. package/dist/public-api/v1/openapi.yml +4712 -2646
  852. package/dist/public-api/v1/shared/project.mapper.d.ts +3 -0
  853. package/dist/public-api/v1/shared/project.mapper.js +20 -0
  854. package/dist/public-api/v1/shared/project.mapper.js.map +1 -0
  855. package/dist/push/abstract.push.d.ts +3 -1
  856. package/dist/push/abstract.push.js +2 -2
  857. package/dist/push/abstract.push.js.map +1 -1
  858. package/dist/push/index.d.ts +3 -1
  859. package/dist/push/index.js +2 -2
  860. package/dist/push/index.js.map +1 -1
  861. package/dist/requests.d.ts +0 -8
  862. package/dist/scaling/constants.d.ts +2 -2
  863. package/dist/scaling/constants.js +3 -0
  864. package/dist/scaling/constants.js.map +1 -1
  865. package/dist/scaling/job-processor.d.ts +2 -0
  866. package/dist/scaling/job-processor.js +54 -9
  867. package/dist/scaling/job-processor.js.map +1 -1
  868. package/dist/scaling/pubsub/pubsub.event-map.d.ts +13 -0
  869. package/dist/scaling/pubsub/pubsub.types.d.ts +4 -1
  870. package/dist/scaling/scaling.service.d.ts +3 -1
  871. package/dist/scaling/scaling.service.js +5 -3
  872. package/dist/scaling/scaling.service.js.map +1 -1
  873. package/dist/scheduling/poll-trigger-node/poll-trigger-task.d.ts +2 -5
  874. package/dist/scheduling/poll-trigger-node/poll-trigger-task.js +2 -3
  875. package/dist/scheduling/poll-trigger-node/poll-trigger-task.js.map +1 -1
  876. package/dist/scheduling/schedule-trigger-node/schedule-trigger-task-handler.js.map +1 -1
  877. package/dist/scheduling/schedule-trigger-node/schedule-trigger-task.d.ts +2 -5
  878. package/dist/scheduling/schedule-trigger-node/schedule-trigger-task.js +2 -3
  879. package/dist/scheduling/schedule-trigger-node/schedule-trigger-task.js.map +1 -1
  880. package/dist/scheduling/system-tasks/main-system-tasks.d.ts +2 -1
  881. package/dist/scheduling/system-tasks/main-system-tasks.js +19 -2
  882. package/dist/scheduling/system-tasks/main-system-tasks.js.map +1 -1
  883. package/dist/scheduling/system-tasks/system-task-runner.js +3 -3
  884. package/dist/scheduling/system-tasks/system-task-runner.js.map +1 -1
  885. package/dist/scheduling/workflow-node-task-payload.d.ts +5 -0
  886. package/dist/scheduling/workflow-node-task-payload.js +7 -0
  887. package/dist/scheduling/workflow-node-task-payload.js.map +1 -0
  888. package/dist/server.d.ts +2 -0
  889. package/dist/server.js +2 -0
  890. package/dist/server.js.map +1 -1
  891. package/dist/services/ai-preference.service.d.ts +46 -0
  892. package/dist/services/ai-preference.service.js +336 -0
  893. package/dist/services/ai-preference.service.js.map +1 -0
  894. package/dist/services/annotation-tag.service.ee.js.map +1 -1
  895. package/dist/services/credentials-tester.service.js +2 -24
  896. package/dist/services/credentials-tester.service.js.map +1 -1
  897. package/dist/services/dynamic-node-parameters.service.js +3 -1
  898. package/dist/services/dynamic-node-parameters.service.js.map +1 -1
  899. package/dist/services/email-change.service.d.ts +21 -0
  900. package/dist/services/email-change.service.js +84 -0
  901. package/dist/services/email-change.service.js.map +1 -0
  902. package/dist/services/engine-v2-dispatcher.service.js +1 -1
  903. package/dist/services/engine-v2-dispatcher.service.js.map +1 -1
  904. package/dist/services/engine-v2-payload-guard.service.d.ts +13 -0
  905. package/dist/services/engine-v2-payload-guard.service.js +49 -0
  906. package/dist/services/engine-v2-payload-guard.service.js.map +1 -0
  907. package/dist/services/ownership-transfer/ownership-transfer.manifest.json +8 -3
  908. package/dist/services/project.service.ee.js +2 -0
  909. package/dist/services/project.service.ee.js.map +1 -1
  910. package/dist/services/pruning/execution-pruning-soft-delete.task.d.ts +14 -0
  911. package/dist/services/pruning/execution-pruning-soft-delete.task.js +38 -0
  912. package/dist/services/pruning/execution-pruning-soft-delete.task.js.map +1 -0
  913. package/dist/services/pruning/executions-pruning.service.d.ts +0 -2
  914. package/dist/services/pruning/executions-pruning.service.js +5 -11
  915. package/dist/services/pruning/executions-pruning.service.js.map +1 -1
  916. package/dist/services/pruning/workflow-history-compaction-optimize.task.d.ts +14 -0
  917. package/dist/services/pruning/workflow-history-compaction-optimize.task.js +38 -0
  918. package/dist/services/pruning/workflow-history-compaction-optimize.task.js.map +1 -0
  919. package/dist/services/pruning/workflow-history-compaction-trim.task.d.ts +12 -0
  920. package/dist/services/pruning/workflow-history-compaction-trim.task.js +40 -0
  921. package/dist/services/pruning/workflow-history-compaction-trim.task.js.map +1 -0
  922. package/dist/services/pruning/workflow-history-compaction.service.d.ts +7 -10
  923. package/dist/services/pruning/workflow-history-compaction.service.js +41 -59
  924. package/dist/services/pruning/workflow-history-compaction.service.js.map +1 -1
  925. package/dist/services/workflow-statistics.service.d.ts +6 -0
  926. package/dist/services/workflow-statistics.service.js +40 -30
  927. package/dist/services/workflow-statistics.service.js.map +1 -1
  928. package/dist/task-runners/task-broker/task-broker-ws-server.js.map +1 -1
  929. package/dist/task-runners/task-broker/task-broker.service.js.map +1 -1
  930. package/dist/task-runners/task-managers/local-task-requester.js.map +1 -1
  931. package/dist/task-runners/task-runner-module.js.map +1 -1
  932. package/dist/user-management/email/interfaces.d.ts +11 -0
  933. package/dist/user-management/email/templates/email-change-completed.handlebars +183 -0
  934. package/dist/user-management/email/templates/email-change-requested.handlebars +206 -0
  935. package/dist/user-management/email/user-management-mailer.d.ts +4 -2
  936. package/dist/user-management/email/user-management-mailer.js +20 -0
  937. package/dist/user-management/email/user-management-mailer.js.map +1 -1
  938. package/dist/utils/is-billable-execution.d.ts +5 -0
  939. package/dist/utils/is-billable-execution.js +32 -0
  940. package/dist/utils/is-billable-execution.js.map +1 -0
  941. package/dist/utils/object-to-error.js.map +1 -1
  942. package/dist/webhooks/engine-v2-webhooks.d.ts +4 -7
  943. package/dist/webhooks/engine-v2-webhooks.js +6 -24
  944. package/dist/webhooks/engine-v2-webhooks.js.map +1 -1
  945. package/dist/webhooks/webhook-helpers.js +9 -2
  946. package/dist/webhooks/webhook-helpers.js.map +1 -1
  947. package/dist/workflow-execute-additional-data.js +9 -2
  948. package/dist/workflow-execute-additional-data.js.map +1 -1
  949. package/dist/workflow-runner.d.ts +7 -3
  950. package/dist/workflow-runner.js +54 -29
  951. package/dist/workflow-runner.js.map +1 -1
  952. package/dist/workflows/publication/published-workflow-trigger-deactivator.d.ts +1 -0
  953. package/dist/workflows/publication/published-workflow-trigger-deactivator.js +12 -4
  954. package/dist/workflows/publication/published-workflow-trigger-deactivator.js.map +1 -1
  955. package/dist/workflows/publication/trigger-diff.d.ts +4 -1
  956. package/dist/workflows/publication/trigger-diff.js +12 -2
  957. package/dist/workflows/publication/trigger-diff.js.map +1 -1
  958. package/dist/workflows/publication/workflow-publication-applier.js +3 -1
  959. package/dist/workflows/publication/workflow-publication-applier.js.map +1 -1
  960. package/dist/workflows/publication/workflow-publication-lifecycle-lock.d.ts +7 -1
  961. package/dist/workflows/publication/workflow-publication-lifecycle-lock.js +18 -4
  962. package/dist/workflows/publication/workflow-publication-lifecycle-lock.js.map +1 -1
  963. package/dist/workflows/publication/workflow-publication-outbox-cleanup.service.d.ts +3 -10
  964. package/dist/workflows/publication/workflow-publication-outbox-cleanup.service.js +4 -49
  965. package/dist/workflows/publication/workflow-publication-outbox-cleanup.service.js.map +1 -1
  966. package/dist/workflows/publication/workflow-publication-outbox-cleanup.task.d.ts +15 -0
  967. package/dist/workflows/publication/workflow-publication-outbox-cleanup.task.js +38 -0
  968. package/dist/workflows/publication/workflow-publication-outbox-cleanup.task.js.map +1 -0
  969. package/dist/workflows/publication/workflow-publication-outbox-consumer.d.ts +2 -0
  970. package/dist/workflows/publication/workflow-publication-outbox-consumer.js +62 -27
  971. package/dist/workflows/publication/workflow-publication-outbox-consumer.js.map +1 -1
  972. package/dist/workflows/publication/workflow-publication-reconciler.service.d.ts +1 -0
  973. package/dist/workflows/publication/workflow-publication-reconciler.service.js +21 -8
  974. package/dist/workflows/publication/workflow-publication-reconciler.service.js.map +1 -1
  975. package/dist/workflows/triggers/engine-v2-active-triggers.d.ts +16 -0
  976. package/dist/workflows/triggers/engine-v2-active-triggers.js +39 -0
  977. package/dist/workflows/triggers/engine-v2-active-triggers.js.map +1 -0
  978. package/dist/workflows/triggers/trigger-execution-context.factory.d.ts +4 -1
  979. package/dist/workflows/triggers/trigger-execution-context.factory.js +41 -6
  980. package/dist/workflows/triggers/trigger-execution-context.factory.js.map +1 -1
  981. package/dist/workflows/workflow-execution.service.d.ts +8 -3
  982. package/dist/workflows/workflow-execution.service.js +44 -5
  983. package/dist/workflows/workflow-execution.service.js.map +1 -1
  984. package/dist/workflows/workflow-finder.service.d.ts +1 -0
  985. package/dist/workflows/workflow-finder.service.js +6 -2
  986. package/dist/workflows/workflow-finder.service.js.map +1 -1
  987. package/dist/workflows/workflow-history/workflow-history.service.js.map +1 -1
  988. package/package.json +49 -57
  989. package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.d.ts +0 -7
  990. package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.js +0 -38
  991. package/dist/modules/agents/entities/agent-memory-entry-cursor.entity.js.map +0 -1
  992. package/dist/modules/agents/repositories/agent-memory-entry-cursor.repository.d.ts +0 -5
  993. package/dist/modules/agents/repositories/agent-memory-entry-cursor.repository.js +0 -26
  994. package/dist/modules/agents/repositories/agent-memory-entry-cursor.repository.js.map +0 -1
  995. package/dist/modules/git-connections.ee/constants.js.map +0 -1
  996. package/dist/modules/git-connections.ee/database/entities/git-connection-project.entity.d.ts +0 -8
  997. package/dist/modules/git-connections.ee/database/entities/git-connection-project.entity.js.map +0 -1
  998. package/dist/modules/git-connections.ee/database/entities/git-connection.entity.d.ts +0 -14
  999. package/dist/modules/git-connections.ee/database/entities/git-connection.entity.js +0 -61
  1000. package/dist/modules/git-connections.ee/database/entities/git-connection.entity.js.map +0 -1
  1001. package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.d.ts +0 -11
  1002. package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.js +0 -58
  1003. package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.js.map +0 -1
  1004. package/dist/modules/git-connections.ee/database/repositories/git-connection.repository.d.ts +0 -12
  1005. package/dist/modules/git-connections.ee/database/repositories/git-connection.repository.js +0 -37
  1006. package/dist/modules/git-connections.ee/database/repositories/git-connection.repository.js.map +0 -1
  1007. package/dist/modules/git-connections.ee/git-connections-git.service.d.ts +0 -60
  1008. package/dist/modules/git-connections.ee/git-connections-git.service.js +0 -281
  1009. package/dist/modules/git-connections.ee/git-connections-git.service.js.map +0 -1
  1010. package/dist/modules/git-connections.ee/git-connections-git.utils.d.ts +0 -13
  1011. package/dist/modules/git-connections.ee/git-connections-git.utils.js.map +0 -1
  1012. package/dist/modules/git-connections.ee/git-connections.module.d.ts +0 -5
  1013. package/dist/modules/git-connections.ee/git-connections.module.js +0 -32
  1014. package/dist/modules/git-connections.ee/git-connections.module.js.map +0 -1
  1015. package/dist/modules/git-connections.ee/git-connections.service.d.ts +0 -70
  1016. package/dist/modules/git-connections.ee/git-connections.service.js +0 -476
  1017. package/dist/modules/git-connections.ee/git-connections.service.js.map +0 -1
  1018. package/dist/modules/insights/whole-seconds.d.ts +0 -1
  1019. package/dist/modules/insights/whole-seconds.js +0 -7
  1020. package/dist/modules/insights/whole-seconds.js.map +0 -1
  1021. package/dist/modules/type-availability-policies/dto/create-policy-document.dto.d.ts +0 -80
  1022. package/dist/modules/type-availability-policies/dto/create-policy-document.dto.js +0 -11
  1023. package/dist/modules/type-availability-policies/dto/create-policy-document.dto.js.map +0 -1
  1024. package/dist/modules/type-availability-policies/dto/policy-rule.schema.d.ts +0 -108
  1025. package/dist/modules/type-availability-policies/dto/policy-rule.schema.js +0 -30
  1026. package/dist/modules/type-availability-policies/dto/policy-rule.schema.js.map +0 -1
  1027. package/dist/modules/type-availability-policies/dto/policy-selector.schema.d.ts +0 -20
  1028. package/dist/modules/type-availability-policies/dto/policy-selector.schema.js +0 -9
  1029. package/dist/modules/type-availability-policies/dto/policy-selector.schema.js.map +0 -1
  1030. package/dist/modules/type-availability-policies/dto/put-instance-policy.dto.d.ts +0 -85
  1031. package/dist/modules/type-availability-policies/dto/put-instance-policy.dto.js +0 -14
  1032. package/dist/modules/type-availability-policies/dto/put-instance-policy.dto.js.map +0 -1
  1033. package/dist/modules/type-availability-policies/dto/replace-attachments.dto.d.ts +0 -97
  1034. package/dist/modules/type-availability-policies/dto/replace-attachments.dto.js +0 -36
  1035. package/dist/modules/type-availability-policies/dto/replace-attachments.dto.js.map +0 -1
  1036. package/dist/modules/type-availability-policies/dto/update-policy-document.dto.d.ts +0 -83
  1037. package/dist/modules/type-availability-policies/dto/update-policy-document.dto.js +0 -13
  1038. package/dist/modules/type-availability-policies/dto/update-policy-document.dto.js.map +0 -1
  1039. package/dist/public-api/v1/controllers/git-connections.public.controller.d.ts +0 -21
  1040. package/dist/public-api/v1/controllers/git-connections.public.controller.js +0 -302
  1041. package/dist/public-api/v1/controllers/git-connections.public.controller.js.map +0 -1
  1042. package/dist/public-api/v1/handlers/credentials/credentials.mapper.d.ts +0 -6
  1043. package/dist/public-api/v1/handlers/credentials/credentials.mapper.js +0 -19
  1044. package/dist/public-api/v1/handlers/credentials/credentials.mapper.js.map +0 -1
  1045. package/dist/public-api/v1/handlers/credentials/credentials.middleware.d.ts +0 -6
  1046. package/dist/public-api/v1/handlers/credentials/credentials.middleware.js +0 -91
  1047. package/dist/public-api/v1/handlers/credentials/credentials.middleware.js.map +0 -1
  1048. package/dist/public-api/v1/handlers/projects/projects.handler.d.ts +0 -31
  1049. package/dist/public-api/v1/handlers/projects/projects.handler.js +0 -165
  1050. package/dist/public-api/v1/handlers/projects/projects.handler.js.map +0 -1
  1051. package/dist/public-api/v1/handlers/source-control/source-control.handler.d.ts +0 -7
  1052. package/dist/public-api/v1/handlers/source-control/source-control.handler.js +0 -46
  1053. package/dist/public-api/v1/handlers/source-control/source-control.handler.js.map +0 -1
  1054. package/dist/public-api/v1/handlers/variables/variables.handler.d.ts +0 -15
  1055. package/dist/public-api/v1/handlers/variables/variables.handler.js +0 -56
  1056. package/dist/public-api/v1/handlers/variables/variables.handler.js.map +0 -1
@@ -15,6 +15,7 @@ exports.isAttachmentRejectedByProviderError = isAttachmentRejectedByProviderErro
15
15
  exports.getUserFacingErrorMessage = getUserFacingErrorMessage;
16
16
  exports.isMaskedStreamFailure = isMaskedStreamFailure;
17
17
  const agents_1 = require("@n8n/agents");
18
+ const sandbox_1 = require("@n8n/agents/sandbox");
18
19
  const api_types_1 = require("@n8n/api-types");
19
20
  const backend_common_1 = require("@n8n/backend-common");
20
21
  const backend_network_1 = require("@n8n/backend-network");
@@ -36,9 +37,11 @@ const bad_request_error_1 = require("../../errors/response-errors/bad-request.er
36
37
  const forbidden_error_1 = require("../../errors/response-errors/forbidden.error");
37
38
  const event_service_1 = require("../../events/event.service");
38
39
  const instance_ai_builder_delegate_adapter_1 = require("../../modules/agents/instance-ai-builder-delegate.adapter");
40
+ const model_stream_stall_options_1 = require("../../modules/agents/model-stream-stall-options");
39
41
  const check_access_1 = require("../../permissions.ee/check-access");
40
42
  const publisher_service_1 = require("../../scaling/pubsub/publisher.service");
41
43
  const push_1 = require("../../push");
44
+ const ai_preference_service_1 = require("../../services/ai-preference.service");
42
45
  const ai_service_1 = require("../../services/ai.service");
43
46
  const instance_write_access_service_1 = require("../../services/instance-write-access.service");
44
47
  const proxy_token_manager_1 = require("../../services/proxy-token-manager");
@@ -46,6 +49,7 @@ const url_service_1 = require("../../services/url.service");
46
49
  const telemetry_2 = require("../../telemetry");
47
50
  const utils_1 = require("../../utils");
48
51
  const agent_preview_handoff_1 = require("./agent-preview-handoff");
52
+ const instance_context_service_1 = require("./instance-context.service");
49
53
  const composite_local_mcp_server_1 = require("./browser/composite-local-mcp-server");
50
54
  const instance_ai_browser_session_service_1 = require("./browser/instance-ai-browser-session.service");
51
55
  const canvas_node_context_flag_gate_1 = require("./canvas-node-context-flag-gate");
@@ -75,7 +79,7 @@ const planned_task_action_runner_1 = require("./planned-task-action-runner");
75
79
  const instance_ai_event_log_repository_1 = require("./repositories/instance-ai-event-log.repository");
76
80
  const instance_ai_pending_confirmation_repository_1 = require("./repositories/instance-ai-pending-confirmation.repository");
77
81
  const instance_ai_thread_grant_repository_1 = require("./repositories/instance-ai-thread-grant.repository");
78
- const sandbox_1 = require("./sandbox");
82
+ const sandbox_2 = require("./sandbox");
79
83
  const db_iteration_log_storage_1 = require("./storage/db-iteration-log-storage");
80
84
  const typeorm_agent_checkpoint_store_1 = require("./storage/typeorm-agent-checkpoint-store");
81
85
  const typeorm_agent_memory_1 = require("./storage/typeorm-agent-memory");
@@ -201,7 +205,6 @@ function isTelemetryConfigurableAgent(agent) {
201
205
  agent !== null &&
202
206
  typeof Reflect.get(agent, 'telemetry') === 'function');
203
207
  }
204
- const INSTANCE_AI_CHECKPOINT_PRUNE_RETRY_MS = 30 * 1000;
205
208
  const WORKFLOW_SETUP_ROUTING_CLAIM_TTL_MS = 15 * 60 * 1000;
206
209
  const CONFIRMATION_EXPIRED_MESSAGE = 'This confirmation has expired. Send a new message to continue.';
207
210
  const RESUME_REJECTED_MESSAGE = 'I could not apply that confirmation. Send a new message to continue.';
@@ -242,7 +245,7 @@ function isAttachmentRejectedByProviderError(error) {
242
245
  const haystack = [(0, get_error_message_1.getErrorMessage)(error), ...collectErrorText(error)].join(' ').toLowerCase();
243
246
  return ATTACHMENT_SUBJECT_PATTERN.test(haystack) && ATTACHMENT_REFUSAL_PATTERN.test(haystack);
244
247
  }
245
- exports.QUOTA_EXHAUSTED_USER_MESSAGE = "You've run out of AI credits. Upgrade your plan to continue using the AI assistant.";
248
+ exports.QUOTA_EXHAUSTED_USER_MESSAGE = "You've run out of AI credits. Upgrade your plan to continue using the n8n Assistant.";
246
249
  const OPERATIONAL_ERROR_USER_MESSAGE = 'I hit an operational error before I could finish that response. Please try again.';
247
250
  const GENERIC_ERROR_USER_MESSAGE = 'Something went wrong before I could finish that response. Please try again.';
248
251
  function getUserFacingErrorCode(error) {
@@ -345,7 +348,7 @@ let InstanceAiService = class InstanceAiService {
345
348
  }
346
349
  return this._mcpClientManager;
347
350
  }
348
- constructor(logger, globalConfig, instanceSettings, adapterService, eventBus, eventLog, interruptedRunSweeper, settingsService, gatewayService, browserSessionService, memoryService, agentMemory, checkpointStore, aiService, threadGrantRepo, pendingConfirmationRepo, urlService, eventLogRepository, dbIterationLogStorage, instanceWriteAccess, telemetry, mcpRegistryService, userRepository, temporaryWorkflowService, errorReporter, ssrfProtectionConfig, ssrfProtectionService, eventService, evalCredentialAllowlists, runProbe, modelService, creditService, publisher, instanceAiErrorReporter, canvasNodeContextFlagGate, push, conversationHistoryService) {
351
+ constructor(logger, globalConfig, instanceSettings, adapterService, eventBus, eventLog, interruptedRunSweeper, settingsService, gatewayService, browserSessionService, memoryService, agentMemory, checkpointStore, aiService, threadGrantRepo, pendingConfirmationRepo, urlService, eventLogRepository, dbIterationLogStorage, instanceWriteAccess, telemetry, mcpRegistryService, userRepository, temporaryWorkflowService, errorReporter, ssrfProtectionConfig, ssrfProtectionService, eventService, evalCredentialAllowlists, runProbe, modelService, creditService, publisher, instanceAiErrorReporter, canvasNodeContextFlagGate, push, conversationHistoryService, instanceContext, aiPreferenceService) {
349
352
  this.instanceSettings = instanceSettings;
350
353
  this.adapterService = adapterService;
351
354
  this.eventBus = eventBus;
@@ -378,6 +381,8 @@ let InstanceAiService = class InstanceAiService {
378
381
  this.canvasNodeContextFlagGate = canvasNodeContextFlagGate;
379
382
  this.push = push;
380
383
  this.conversationHistoryService = conversationHistoryService;
384
+ this.instanceContext = instanceContext;
385
+ this.aiPreferenceService = aiPreferenceService;
381
386
  this.runState = new instance_ai_1.RunStateRegistry((user) => user.id);
382
387
  this.memoryTaskRegistry = new instance_ai_1.MemoryTaskRegistry();
383
388
  this.domainAccessTrackersByThread = new Map();
@@ -386,16 +391,15 @@ let InstanceAiService = class InstanceAiService {
386
391
  this.planRequestsByThread = new Map();
387
392
  this.schedulerLocks = new Map();
388
393
  this.failedInternalFollowUpStreaks = new Map();
389
- this.pendingCheckpointReentries = new Map();
390
394
  this.runDebugBuffer = new instance_ai_1.RunDebugBuffer();
391
- this.checkpointPruningStopped = true;
392
395
  this.inFlightExecutions = new Set();
393
396
  this.preserveHitlOnShutdown = new Set();
394
397
  this.logger = logger.scoped('instance-ai');
395
398
  runProbe.registerActiveRunCountProvider(() => this.runState.activeRunCount());
396
- this.workflowObligations = new workflow_verification_obligation_service_1.WorkflowVerificationObligationService(this.agentMemory);
399
+ this.workflowObligations = new workflow_verification_obligation_service_1.WorkflowVerificationObligationService(this.agentMemory, () => this.settingsService.isInstanceAiSetupPanelEnabled());
397
400
  this.taskProjector = new workflow_verification_task_projector_1.WorkflowVerificationTaskProjector(this.agentMemory, this.eventBus, this.logger, this.workflowObligations);
398
401
  this.instanceAiConfig = globalConfig.instanceAi;
402
+ this.aiConfig = globalConfig.ai;
399
403
  this.backgroundTasks = new instance_ai_1.BackgroundTaskManager(MAX_CONCURRENT_BACKGROUND_TASKS_PER_THREAD, this.instanceAiConfig.maxConcurrentSubAgents);
400
404
  this.suspendedThreads = new suspended_thread_persistence_service_1.SuspendedThreadPersistenceService({
401
405
  logger: this.logger,
@@ -438,7 +442,7 @@ let InstanceAiService = class InstanceAiService {
438
442
  eventLog: this.eventLogRepository,
439
443
  aiService: this.aiService,
440
444
  });
441
- this.sandboxService = new sandbox_1.InstanceAiSandboxService({
445
+ this.sandboxService = new sandbox_2.InstanceAiSandboxService({
442
446
  config: this.instanceAiConfig,
443
447
  logger: this.logger,
444
448
  errorReporter: this.errorReporter,
@@ -446,6 +450,13 @@ let InstanceAiService = class InstanceAiService {
446
450
  backgroundTasks: this.backgroundTasks,
447
451
  settingsService: this.settingsService,
448
452
  aiService: this.aiService,
453
+ resolveTracingConfig: async (threadId, userId) => {
454
+ const ownerId = userId ?? (await this.agentMemory.getThread(threadId))?.resourceId;
455
+ if (!ownerId)
456
+ return { userId: 'system' };
457
+ const { tracingProxyConfig } = await this.createProxyRunConfig({ id: ownerId });
458
+ return { userId: ownerId, proxyConfig: tracingProxyConfig };
459
+ },
449
460
  });
450
461
  this.terminalOutcome = new instance_ai_terminal_outcome_service_1.InstanceAiTerminalOutcomeService({
451
462
  eventBus: {
@@ -486,8 +497,6 @@ let InstanceAiService = class InstanceAiService {
486
497
  });
487
498
  });
488
499
  this.liveness.start();
489
- if (this.instanceSettings.isLeader)
490
- this.startCheckpointPruning();
491
500
  }
492
501
  async createProxyRunConfig(user) {
493
502
  if (!this.aiService.isProxyEnabled())
@@ -666,6 +675,7 @@ let InstanceAiService = class InstanceAiService {
666
675
  maxIterations: instance_ai_1.MAX_STEPS.ORCHESTRATOR,
667
676
  abortSignal: signal,
668
677
  recoverUsageOnAbort: true,
678
+ ...(0, model_stream_stall_options_1.modelStreamStallOptions)(this.aiConfig),
669
679
  persistence: {
670
680
  resourceId: user.id,
671
681
  threadId,
@@ -692,6 +702,7 @@ let InstanceAiService = class InstanceAiService {
692
702
  toolCallId,
693
703
  abortSignal: signal,
694
704
  recoverUsageOnAbort: true,
705
+ ...(0, model_stream_stall_options_1.modelStreamStallOptions)(this.aiConfig),
695
706
  persistence: {
696
707
  resourceId: user.id,
697
708
  threadId,
@@ -857,7 +868,7 @@ let InstanceAiService = class InstanceAiService {
857
868
  error,
858
869
  }));
859
870
  }
860
- async applyTaskControlLocally({ threadId, taskId, action, correction, }) {
871
+ async applyTaskControlLocally({ threadId, taskId, action, correction, userId, }) {
861
872
  switch (action) {
862
873
  case 'correct':
863
874
  if (!taskId || correction === undefined)
@@ -876,7 +887,7 @@ let InstanceAiService = class InstanceAiService {
876
887
  this.cancelRun(threadId);
877
888
  return false;
878
889
  case 'clear-thread':
879
- await this.clearThreadState(threadId);
890
+ await this.clearThreadState(threadId, userId);
880
891
  return false;
881
892
  }
882
893
  }
@@ -899,8 +910,12 @@ let InstanceAiService = class InstanceAiService {
899
910
  await this.interruptedRunSweeper.cancelUnfinishedRuns(threadId);
900
911
  }
901
912
  }
902
- async routeClearThreadState(threadId) {
903
- await this.routeTaskControl({ threadId, action: 'clear-thread' });
913
+ async routeClearThreadState(threadId, userId) {
914
+ await this.routeTaskControl({
915
+ threadId,
916
+ action: 'clear-thread',
917
+ ...(userId ? { userId } : {}),
918
+ });
904
919
  }
905
920
  async handleRelayTaskControl(payload) {
906
921
  try {
@@ -1044,7 +1059,7 @@ let InstanceAiService = class InstanceAiService {
1044
1059
  clearTraceEvents(slug) {
1045
1060
  this.tracing.clearTraceEvents(slug);
1046
1061
  }
1047
- async clearThreadState(threadId) {
1062
+ async clearThreadState(threadId, userId) {
1048
1063
  this.liveness.clearThreadState(threadId);
1049
1064
  const { active, suspended } = this.runState.clearThread(threadId);
1050
1065
  if (active) {
@@ -1079,7 +1094,7 @@ let InstanceAiService = class InstanceAiService {
1079
1094
  this.memoryTaskRegistry.clearThread(threadId);
1080
1095
  this.tracing.deleteTraceContextsForThread(threadId);
1081
1096
  await this.deleteAgentBuilderSessions(threadId);
1082
- await this.sandboxService.destroySandbox(threadId);
1097
+ await this.sandboxService.destroySandbox(threadId, 'thread_cleanup', userId);
1083
1098
  await this.temporaryWorkflowService.reapForThreadCleanup(threadId);
1084
1099
  await this.suspendedThreads.dropPendingConfirmationsForThread(threadId);
1085
1100
  this.eventBus.clearThread(threadId);
@@ -1098,7 +1113,6 @@ let InstanceAiService = class InstanceAiService {
1098
1113
  }
1099
1114
  }
1100
1115
  async shutdown() {
1101
- this.stopCheckpointPruning();
1102
1116
  this.liveness.shutdown();
1103
1117
  const { activeRuns, suspendedRuns, pendingThreadIds } = this.runState.shutdown();
1104
1118
  const threadsWithPendingHitl = new Set(pendingThreadIds);
@@ -1124,6 +1138,7 @@ let InstanceAiService = class InstanceAiService {
1124
1138
  status: 'cancelled',
1125
1139
  reason: 'service_shutdown',
1126
1140
  });
1141
+ this.preserveHitlOnShutdown.add(run.runId);
1127
1142
  run.abortController.abort();
1128
1143
  }
1129
1144
  for (const task of this.backgroundTasks.cancelAll()) {
@@ -1151,25 +1166,6 @@ let InstanceAiService = class InstanceAiService {
1151
1166
  await (0, instance_ai_1.shutdownProductTelemetryProviders)();
1152
1167
  this.logger.debug('Instance AI service shut down');
1153
1168
  }
1154
- startCheckpointPruning() {
1155
- if (this.checkpointPruneTimer || this.instanceAiConfig.pruneInterval <= 0)
1156
- return;
1157
- this.checkpointPruningStopped = false;
1158
- this.scheduleCheckpointPrune(0);
1159
- }
1160
- stopCheckpointPruning() {
1161
- this.checkpointPruningStopped = true;
1162
- clearTimeout(this.checkpointPruneTimer);
1163
- this.checkpointPruneTimer = undefined;
1164
- }
1165
- scheduleCheckpointPrune(delayMs = this.instanceAiConfig.pruneInterval) {
1166
- if (this.checkpointPruningStopped)
1167
- return;
1168
- this.checkpointPruneTimer = setTimeout(() => {
1169
- void this.runScheduledPrune();
1170
- }, delayMs);
1171
- this.checkpointPruneTimer.unref();
1172
- }
1173
1169
  trackInFlightExecution(promise) {
1174
1170
  const tracked = promise.finally(() => {
1175
1171
  this.inFlightExecutions.delete(tracked);
@@ -1200,26 +1196,23 @@ let InstanceAiService = class InstanceAiService {
1200
1196
  });
1201
1197
  }
1202
1198
  }
1203
- async runScheduledPrune(now = Date.now()) {
1199
+ async pruneExpiredData(now = Date.now(), signal) {
1204
1200
  const olderThan = new Date(now - this.instanceAiConfig.snapshotRetention);
1205
- try {
1206
- const count = await this.checkpointStore.markExpiredOlderThan(olderThan);
1207
- if (count > 0) {
1208
- this.logger.info('Expired stale Instance AI checkpoints', { count });
1209
- }
1210
- else {
1211
- this.logger.debug('No stale Instance AI checkpoints to expire');
1212
- }
1201
+ const count = await this.checkpointStore.markExpiredOlderThan(olderThan);
1202
+ if (count > 0) {
1203
+ this.logger.info('Expired stale Instance AI checkpoints', { count });
1204
+ }
1205
+ else {
1206
+ this.logger.debug('No stale Instance AI checkpoints to expire');
1207
+ }
1208
+ if (!signal?.aborted)
1213
1209
  await this.hardDeleteExpiredCheckpoints(now);
1210
+ if (!signal?.aborted)
1214
1211
  await this.suspendedThreads.pruneStalePendingConfirmations(now);
1215
- await this.pruneExpiredThreads();
1216
- this.scheduleCheckpointPrune();
1217
- }
1218
- catch (error) {
1219
- this.logger.warn('Failed to expire stale Instance AI checkpoints', {
1220
- error: (0, get_error_message_1.getErrorMessage)(error),
1221
- });
1222
- this.scheduleCheckpointPrune(INSTANCE_AI_CHECKPOINT_PRUNE_RETRY_MS);
1212
+ if (!signal?.aborted)
1213
+ await this.pruneExpiredThreads(signal);
1214
+ if (signal?.aborted) {
1215
+ this.logger.debug('Stopped the Instance AI prune pass early because the run was aborted');
1223
1216
  }
1224
1217
  }
1225
1218
  async hardDeleteExpiredCheckpoints(now) {
@@ -1239,9 +1232,9 @@ let InstanceAiService = class InstanceAiService {
1239
1232
  });
1240
1233
  }
1241
1234
  }
1242
- async pruneExpiredThreads() {
1235
+ async pruneExpiredThreads(signal) {
1243
1236
  try {
1244
- await this.memoryService.cleanupExpiredThreads(async (threadId) => await this.clearThreadState(threadId));
1237
+ await this.memoryService.cleanupExpiredThreads(async (threadId) => await this.clearThreadState(threadId), signal);
1245
1238
  }
1246
1239
  catch (error) {
1247
1240
  this.logger.warn('Failed to clean up expired Instance AI conversation threads', {
@@ -1291,7 +1284,23 @@ let InstanceAiService = class InstanceAiService {
1291
1284
  await workflowTasks.updateBuildOutcome(workItemId, update);
1292
1285
  await sync();
1293
1286
  },
1287
+ beginVerification: async (outcome, state, verificationRunId) => {
1288
+ const resumed = await workflowTasks.beginVerification(outcome, state, verificationRunId);
1289
+ if (resumed)
1290
+ await sync();
1291
+ return resumed;
1292
+ },
1294
1293
  getBuildOutcome: async (workItemId) => await workflowTasks.getBuildOutcome(workItemId),
1294
+ startVerification: async (workItemId, triggerNodeName) => {
1295
+ const previousProgress = await workflowTasks.startVerification(workItemId, triggerNodeName);
1296
+ await sync();
1297
+ return previousProgress;
1298
+ },
1299
+ recordVerification: async (workItemId, verification, previousProgress) => {
1300
+ const claim = await workflowTasks.recordVerification(workItemId, verification, previousProgress);
1301
+ await sync();
1302
+ return claim;
1303
+ },
1295
1304
  getLatestBuildOutcomeForWorkflow: async (workflowId) => await workflowTasks.getLatestBuildOutcomeForWorkflow(workflowId),
1296
1305
  getWorkflowLoopState: async (workItemId) => await workflowTasks.getWorkflowLoopState(workItemId),
1297
1306
  };
@@ -1440,12 +1449,12 @@ let InstanceAiService = class InstanceAiService {
1440
1449
  const localGatewayDisabledForUser = await this.settingsService.isLocalGatewayDisabledForUser(user.id);
1441
1450
  const userGateway = this.gatewayService.findGateway(user.id);
1442
1451
  await this.creditService.ensureQuotaLockApplied(user);
1443
- const { searchProxyConfig, tracingProxyConfig, tokenManager, proxyBaseUrl } = proxyRunConfig ?? (await this.createProxyRunConfig(user));
1452
+ const { searchProxyConfig, tokenManager, proxyBaseUrl } = proxyRunConfig ?? (await this.createProxyRunConfig(user));
1444
1453
  const proxyContext = { runId, threadId };
1445
1454
  const modelId = proxyBaseUrl && tokenManager
1446
1455
  ? await this.modelService.resolveProxyModel(user, proxyBaseUrl, tokenManager, proxyContext)
1447
1456
  : await this.modelService.resolveAgentModelConfig(user, proxyContext);
1448
- const { configEvalsEnabled, mcpConnectionsEnabled, conversationHistoryEnabled, progressiveBuildingEnabled, nodeUsageEnabled, folderExplorationEnabled, } = await this.adapterService.resolveExperimentGates(user);
1457
+ const { configEvalsEnabled, mcpConnectionsEnabled, conversationHistoryEnabled, progressiveBuildingEnabled, nodeUsageEnabled, folderExplorationEnabled, aiPreferencesEnabled, } = await this.adapterService.resolveExperimentGates(user);
1449
1458
  const conversationHistory = conversationHistoryEnabled
1450
1459
  ? this.conversationHistoryService.forContext(user.id, boundProjectId, threadId)
1451
1460
  : undefined;
@@ -1491,7 +1500,23 @@ let InstanceAiService = class InstanceAiService {
1491
1500
  threadId,
1492
1501
  runId,
1493
1502
  agentId: (0, instance_ai_1.orchestratorAgentId)(runId),
1503
+ initialSnapshots: await this.eventLog.getSetupItemsSnapshots(threadId).catch((error) => {
1504
+ this.logger.warn('Failed to read setup panel snapshots', {
1505
+ threadId,
1506
+ error: (0, get_error_message_1.getErrorMessage)(error),
1507
+ });
1508
+ return [];
1509
+ }),
1510
+ readPersistedSnapshot: async (workflowId) => {
1511
+ const snapshots = await this.eventLog.getSetupItemsSnapshots(threadId);
1512
+ return snapshots.find((snapshot) => snapshot.workflowId === workflowId)?.items;
1513
+ },
1494
1514
  });
1515
+ context.markWorkflowSetupHandled = async (workflowId) => {
1516
+ await this.markWorkflowSetupHandled(threadId, workflowId, runId, {
1517
+ requirePersisted: true,
1518
+ });
1519
+ };
1495
1520
  }
1496
1521
  context.browserCredentialSetup = this.createBrowserCredentialSetupTracker(runId, user.id);
1497
1522
  const sessionGrants = await this.loadThreadSessionGrants(threadId, user.id);
@@ -1558,7 +1583,10 @@ let InstanceAiService = class InstanceAiService {
1558
1583
  if (nodeDefDirs.length > 0) {
1559
1584
  (0, workflow_sdk_1.setSchemaBaseDirs)(nodeDefDirs);
1560
1585
  }
1561
- const flagDisabledSkillIds = (0, instance_ai_1.disabledInstanceAiSkillIds)({ configEvalsEnabled });
1586
+ const flagDisabledSkillIds = (0, instance_ai_1.disabledInstanceAiSkillIds)({
1587
+ configEvalsEnabled,
1588
+ instanceContextEnabled: this.instanceAiConfig.instanceContextEnabled,
1589
+ });
1562
1590
  const selectedSkills = await (0, instance_ai_1.loadInstanceAiPromptSkills)(selectedPrompt.profile);
1563
1591
  const selectedRuntimeSkills = selectedSkills.source;
1564
1592
  const allRuntimeSkills = flagDisabledSkillIds.length > 0
@@ -1573,7 +1601,7 @@ let InstanceAiService = class InstanceAiService {
1573
1601
  if (sandboxStatus.workflowBuilderAvailable) {
1574
1602
  const sandboxConfig = await this.instanceAiErrorReporter.withBoundary('instance-ai-sandbox-setup', { threadId, runId, userId: user.id, messageGroupId }, async () => await this.sandboxService.resolveSandboxConfig(user));
1575
1603
  if (sandboxConfig.enabled) {
1576
- workspaceRoot = (0, instance_ai_1.getPromptWorkspaceRoot)(sandboxConfig.provider);
1604
+ workspaceRoot = (0, sandbox_1.getPromptWorkspaceRoot)(sandboxConfig.provider);
1577
1605
  let sandboxEntryPromise;
1578
1606
  const getSandboxEntry = async () => {
1579
1607
  sandboxEntryPromise ??= this.sandboxService
@@ -1590,7 +1618,7 @@ let InstanceAiService = class InstanceAiService {
1590
1618
  const scopeWorkspaceForAgent = async (workspace) => {
1591
1619
  if (!workspace)
1592
1620
  return undefined;
1593
- const root = await (0, instance_ai_1.getWorkspaceRoot)(workspace);
1621
+ const root = await (0, sandbox_1.getWorkspaceRoot)(workspace);
1594
1622
  return (0, agents_1.createScopedWorkspace)(workspace, root);
1595
1623
  };
1596
1624
  runtimeWorkspace = (0, instance_ai_1.createLazyRuntimeWorkspace)({
@@ -1617,7 +1645,6 @@ let InstanceAiService = class InstanceAiService {
1617
1645
  context.trackTelemetry = (eventName, properties) => {
1618
1646
  this.telemetry.track(eventName, (0, telemetry_1.redactTelemetryProperties)(properties));
1619
1647
  };
1620
- const domainTools = (0, instance_ai_1.createAllTools)(context);
1621
1648
  const orchestrationContext = {
1622
1649
  threadId,
1623
1650
  runId,
@@ -1626,9 +1653,10 @@ let InstanceAiService = class InstanceAiService {
1626
1653
  projectId: boundProjectId,
1627
1654
  promptConfiguration: promptMetadata,
1628
1655
  disabledToolNames: new Set(selectedSkills.disabledTools),
1656
+ setupPanelEnabled: (0, instance_ai_1.isSetupPanelEnabled)(context),
1629
1657
  orchestratorAgentId: (0, instance_ai_1.orchestratorAgentId)(runId),
1630
1658
  modelId,
1631
- checkpointStore: this.checkpointStore,
1659
+ modelStreamStallOptions: (0, model_stream_stall_options_1.modelStreamStallOptions)(this.aiConfig),
1632
1660
  eventBus: this.eventBus,
1633
1661
  logger: this.logger,
1634
1662
  trackTelemetry: (eventName, properties) => {
@@ -1655,7 +1683,6 @@ let InstanceAiService = class InstanceAiService {
1655
1683
  });
1656
1684
  }
1657
1685
  },
1658
- domainTools,
1659
1686
  abortSignal,
1660
1687
  taskStorage,
1661
1688
  timeZone: this.defaultTimeZone,
@@ -1665,27 +1692,7 @@ let InstanceAiService = class InstanceAiService {
1665
1692
  oauth2CallbackUrl: this.oauth2CallbackUrl,
1666
1693
  webhookBaseUrl: this.webhookBaseUrl,
1667
1694
  formBaseUrl: this.formBaseUrl,
1668
- waitForConfirmation: async (requestId) => {
1669
- this.runState.touchActiveRun(threadId);
1670
- return await new Promise((resolve) => {
1671
- this.runState.registerPendingConfirmation(requestId, {
1672
- resolve,
1673
- threadId,
1674
- userId: user.id,
1675
- createdAt: Date.now(),
1676
- });
1677
- void this.suspendedThreads.persistPendingConfirmation({
1678
- requestId,
1679
- threadId,
1680
- userId: user.id,
1681
- runId,
1682
- messageGroupId,
1683
- kind: 'inline',
1684
- });
1685
- });
1686
- },
1687
1695
  cancelBackgroundTask: async (taskId) => this.cancelBackgroundTask(threadId, taskId),
1688
- spawnBackgroundTask: (opts) => this.spawnBackgroundTask(runId, opts, messageGroupId),
1689
1696
  touchRun: () => this.runState.touchActiveRun(threadId),
1690
1697
  touchBackgroundTask: (taskId) => this.backgroundTasks.touchTask(threadId, taskId),
1691
1698
  plannedTaskService,
@@ -1697,8 +1704,6 @@ let InstanceAiService = class InstanceAiService {
1697
1704
  workspaceRoot,
1698
1705
  nodeDefinitionDirs: nodeDefDirs.length > 0 ? nodeDefDirs : undefined,
1699
1706
  domainContext: context,
1700
- tracingProxyConfig,
1701
- memory,
1702
1707
  };
1703
1708
  return {
1704
1709
  context,
@@ -1710,6 +1715,7 @@ let InstanceAiService = class InstanceAiService {
1710
1715
  modelId,
1711
1716
  orchestrationContext,
1712
1717
  conversationHistory,
1718
+ aiPreferencesEnabled,
1713
1719
  };
1714
1720
  }
1715
1721
  getAgentExecutionService() {
@@ -1880,37 +1886,26 @@ let InstanceAiService = class InstanceAiService {
1880
1886
  return;
1881
1887
  await this.schedulePlannedTasks(user, task.threadId);
1882
1888
  }
1883
- async maybeStartWorkflowVerificationFollowUp(user, task) {
1884
- if (task.role !== 'workflow-builder' || !task.workItemId)
1885
- return false;
1886
- const obligation = await this.workflowObligations.getObligation(task.threadId, task.workItemId, {
1887
- source: task.plannedTaskId ? 'planned' : 'direct',
1888
- plannedTaskId: task.plannedTaskId,
1889
- });
1890
- if (!obligation)
1891
- return false;
1892
- this.trackWorkflowVerificationObligation(obligation, 'background_task_settled');
1893
- if (obligation.status !== 'ready_to_verify' && obligation.status !== 'verifying') {
1894
- return false;
1889
+ async buildWorkflowSetupStateBlock(context) {
1890
+ const emitter = context.setupItemsEmitter;
1891
+ if (!emitter)
1892
+ return '';
1893
+ const workflowIds = emitter.workflowIds().reverse();
1894
+ if (workflowIds.length === 0)
1895
+ return '';
1896
+ try {
1897
+ const note = (0, instance_ai_1.formatWorkflowSetupStateNote)(await (0, instance_ai_1.observeWorkflowSetupStates)(context, workflowIds));
1898
+ return note
1899
+ ? `${internal_messages_1.WORKFLOW_SETUP_STATE_OPEN_TAG}\n${note}\n${internal_messages_1.WORKFLOW_SETUP_STATE_CLOSE_TAG}`
1900
+ : '';
1901
+ }
1902
+ catch (error) {
1903
+ this.logger.warn('Failed to build the workflow setup state block', {
1904
+ threadId: context.threadId,
1905
+ error: error instanceof Error ? error.message : String(error),
1906
+ });
1907
+ return '';
1895
1908
  }
1896
- const outcome = (0, workflow_verification_obligation_service_1.parseWorkflowBuildOutcome)(task.outcome);
1897
- const startedRunId = await this.startInternalFollowUpRun(user, task.threadId, this.buildWorkflowVerificationFollowUpMessage({
1898
- obligation,
1899
- outcome,
1900
- sourceTask: {
1901
- taskId: task.taskId,
1902
- role: task.role,
1903
- status: task.status,
1904
- result: task.result,
1905
- error: task.error,
1906
- plannedTaskId: task.plannedTaskId,
1907
- workItemId: task.workItemId,
1908
- },
1909
- }), task.messageGroupId, false, undefined, 'workflow_verification');
1910
- this.trackWorkflowVerificationObligation(obligation, 'follow_up_start_attempted', {
1911
- follow_up_started: startedRunId.length > 0,
1912
- });
1913
- return startedRunId.length > 0;
1914
1909
  }
1915
1910
  buildWorkflowSetupFollowUpMessage(obligation) {
1916
1911
  const payload = {
@@ -1928,7 +1923,7 @@ let InstanceAiService = class InstanceAiService {
1928
1923
  return undefined;
1929
1924
  return typeof suspendPayload.workflowId === 'string' ? suspendPayload.workflowId : undefined;
1930
1925
  }
1931
- async markWorkflowSetupHandled(threadId, workflowId, runId) {
1926
+ async markWorkflowSetupHandled(threadId, workflowId, runId, options = {}) {
1932
1927
  const records = await this.listWorkflowLoopRecords(threadId);
1933
1928
  if (records.length === 0)
1934
1929
  return false;
@@ -1955,9 +1950,19 @@ let InstanceAiService = class InstanceAiService {
1955
1950
  const claim = await this.claimWorkItemSetupRouting(threadId, record);
1956
1951
  if (!claim)
1957
1952
  continue;
1958
- const marked = await this.markWorkItemSetupRouted(threadId, record.state.workItemId, claim.claimId);
1953
+ let marked;
1954
+ try {
1955
+ marked = await this.markWorkItemSetupRouted(threadId, record.state.workItemId, claim.claimId);
1956
+ }
1957
+ catch (error) {
1958
+ await this.releaseWorkItemSetupRoutingClaim(threadId, record.state.workItemId, claim.claimId);
1959
+ throw error;
1960
+ }
1959
1961
  if (!marked) {
1960
1962
  await this.releaseWorkItemSetupRoutingClaim(threadId, record.state.workItemId, claim.claimId);
1963
+ if (options.requirePersisted) {
1964
+ throw new n8n_workflow_1.OperationalError('Workflow setup routing marker was not saved');
1965
+ }
1961
1966
  this.logger.warn('Workflow setup completed but routing marker was not saved', {
1962
1967
  threadId,
1963
1968
  workItemId: record.state.workItemId,
@@ -2163,7 +2168,7 @@ let InstanceAiService = class InstanceAiService {
2163
2168
  async doSchedulePlannedTasks(user, threadId) {
2164
2169
  const revalidated = await this.revalidateActiveUser(user.id);
2165
2170
  if (!revalidated) {
2166
- this.logger.warn('Cancelling run: user no longer authorized for AI Assistant', {
2171
+ this.logger.warn('Cancelling run: user no longer authorized for n8n Assistant', {
2167
2172
  userId: user.id,
2168
2173
  threadId,
2169
2174
  });
@@ -2359,7 +2364,7 @@ let InstanceAiService = class InstanceAiService {
2359
2364
  }
2360
2365
  const executionPushRef = this.threadPushRef.get(threadId);
2361
2366
  const environment = await this.createExecutionEnvironment(user, threadId, runId, signal, messageGroupId, executionPushRef, proxyRunConfig);
2362
- const { context, memory, taskStorage, workflowTasks, plannedTaskService, modelId, orchestrationContext, conversationHistory, } = environment;
2367
+ const { context, memory, taskStorage, workflowTasks, plannedTaskService, modelId, orchestrationContext, conversationHistory, aiPreferencesEnabled, } = environment;
2363
2368
  promptVersion = orchestrationContext.promptConfiguration?.version;
2364
2369
  (0, instance_ai_1.setTracePromptVersion)(tracing, promptVersion);
2365
2370
  aiCreatedWorkflowIds = context.aiCreatedWorkflowIds ??= new Set();
@@ -2454,9 +2459,13 @@ let InstanceAiService = class InstanceAiService {
2454
2459
  previewSession: context.agentPreviewSession,
2455
2460
  });
2456
2461
  }
2462
+ else if (handoffContext?.source === 'setup-panel-execute' && (0, instance_ai_1.isSetupPanelEnabled)(context)) {
2463
+ handoffContextBlock = (0, internal_messages_1.buildWorkflowTestRequestBlock)(handoffContext.workflowId);
2464
+ }
2457
2465
  else {
2458
2466
  handoffContextBlock = buildHandoffContextBlock(handoffContext);
2459
2467
  }
2468
+ const setupStateBlock = resumeReason === undefined ? await this.buildWorkflowSetupStateBlock(context) : '';
2460
2469
  const thread = await memory.getThread(threadId);
2461
2470
  const isOpeningTurn = Boolean(thread && !thread.title);
2462
2471
  if (isOpeningTurn) {
@@ -2474,6 +2483,13 @@ let InstanceAiService = class InstanceAiService {
2474
2483
  },
2475
2484
  });
2476
2485
  }
2486
+ const instanceContext = await this.instanceContext.buildBlock({
2487
+ user,
2488
+ ...(context.projectId !== undefined ? { projectId: context.projectId } : {}),
2489
+ cursor: (0, instance_context_service_1.readInstanceContextCursor)(thread?.metadata),
2490
+ isMachineFollowUp: checkpoint?.isCheckpointFollowUp === true ||
2491
+ plannedBuild?.isPlannedBuildFollowUp === true,
2492
+ });
2477
2493
  const existingTasks = await taskStorage.get(threadId);
2478
2494
  if (existingTasks) {
2479
2495
  this.eventBus.publish(threadId, {
@@ -2498,20 +2514,33 @@ let InstanceAiService = class InstanceAiService {
2498
2514
  : attachmentManifest
2499
2515
  ? `${enrichedMessage}\n\n${attachmentManifest}`
2500
2516
  : enrichedMessage;
2501
- const messageWithContext = [contextResourcesBlock, handoffContextBlock, messageBody]
2517
+ const messageWithContext = [
2518
+ contextResourcesBlock,
2519
+ handoffContextBlock,
2520
+ setupStateBlock,
2521
+ instanceContext?.block ?? '',
2522
+ messageBody,
2523
+ ]
2502
2524
  .filter(Boolean)
2503
2525
  .join('\n\n');
2504
- const [projectSection, pastConversationsSection] = await Promise.all([
2505
- this.resolveProjectContextSection(context),
2526
+ const [boundProject, pastConversationsSection] = await Promise.all([
2527
+ this.resolveBoundProject(context),
2506
2528
  isOpeningTurn ? conversationHistory?.getPastConversationsSection() : undefined,
2507
2529
  ]);
2530
+ const projectSection = boundProject ? (0, internal_messages_1.getProjectContextSection)(boundProject) : undefined;
2531
+ const aiPreferencesBlock = isOpeningTurn && aiPreferencesEnabled
2532
+ ? await this.resolveAiPreferencesBlock(user.id, boundProject)
2533
+ : undefined;
2508
2534
  const messageWithProject = projectSection
2509
2535
  ? (0, internal_messages_1.withProjectContext)(messageWithContext, projectSection)
2510
2536
  : messageWithContext;
2511
2537
  const messageWithPastConversations = pastConversationsSection
2512
2538
  ? (0, internal_messages_1.withPastConversations)(messageWithProject, pastConversationsSection)
2513
2539
  : messageWithProject;
2514
- const fullMessage = (0, internal_messages_1.withCurrentDateTime)(messageWithPastConversations, (0, instance_ai_1.getDateTimeSection)(timeZone ?? this.defaultTimeZone));
2540
+ const messageWithPreferences = aiPreferencesBlock
2541
+ ? (0, internal_messages_1.withAiPreferences)(messageWithPastConversations, aiPreferencesBlock)
2542
+ : messageWithPastConversations;
2543
+ const fullMessage = (0, internal_messages_1.withCurrentDateTime)(messageWithPreferences, (0, instance_ai_1.getDateTimeSection)(timeZone ?? this.defaultTimeZone));
2515
2544
  const promptBuildRun = tracing
2516
2545
  ? await tracing.startChildRun(tracing.messageRun, {
2517
2546
  name: 'prepare: prompt',
@@ -2588,6 +2617,19 @@ let InstanceAiService = class InstanceAiService {
2588
2617
  const agent = await this.createAgentFromEnvironment(environment, threadId, runId, user, tracing);
2589
2618
  const streamOptions = this.buildOrchestratorAgentStreamOptions(user, threadId, runId, signal);
2590
2619
  streamReached = true;
2620
+ if (instanceContext) {
2621
+ try {
2622
+ await (0, instance_ai_1.patchThread)(memory, {
2623
+ threadId,
2624
+ update: ({ metadata }) => ({
2625
+ metadata: { ...metadata, [instance_context_service_1.INSTANCE_CONTEXT_CURSOR]: instanceContext.cursor },
2626
+ }),
2627
+ });
2628
+ }
2629
+ catch (error) {
2630
+ this.logger.warn('Failed to store the instance-context cursor', { error });
2631
+ }
2632
+ }
2591
2633
  const result = tracing
2592
2634
  ? await tracing.withActiveSpan(tracing.actorRun, async () => {
2593
2635
  return await (0, instance_ai_1.streamAgentRun)(agent, streamInput, streamOptions, {
@@ -2640,7 +2682,7 @@ let InstanceAiService = class InstanceAiService {
2640
2682
  plannedBuild,
2641
2683
  runHandoff: runControl.state,
2642
2684
  });
2643
- void this.suspendedThreads.persistPendingConfirmation({
2685
+ await this.suspendedThreads.persistPendingConfirmation({
2644
2686
  requestId: result.suspension.requestId,
2645
2687
  threadId,
2646
2688
  userId: user.id,
@@ -2676,6 +2718,8 @@ let InstanceAiService = class InstanceAiService {
2676
2718
  });
2677
2719
  return;
2678
2720
  }
2721
+ if (signal.aborted && !this.shouldPreserveHitlOnShutdown(runId))
2722
+ return;
2679
2723
  if (result.confirmationEvent) {
2680
2724
  this.trackConfirmationRequest(user.id, threadId, result.confirmationEvent);
2681
2725
  this.eventBus.publish(threadId, result.confirmationEvent);
@@ -2913,9 +2957,6 @@ let InstanceAiService = class InstanceAiService {
2913
2957
  else if (reschedule) {
2914
2958
  await this.schedulePlannedTasks(user, threadId);
2915
2959
  }
2916
- if (reschedule) {
2917
- await this.drainPendingCheckpointReentries(user, threadId);
2918
- }
2919
2960
  await this.taskProjector.syncFromWorkflowLoop(threadId, runId);
2920
2961
  if (reschedule) {
2921
2962
  await this.maybeStartWorkflowSetupFollowUp(user, threadId);
@@ -2926,74 +2967,6 @@ let InstanceAiService = class InstanceAiService {
2926
2967
  }
2927
2968
  }
2928
2969
  }
2929
- queuePendingCheckpointReentry(threadId, checkpointTaskId) {
2930
- let set = this.pendingCheckpointReentries.get(threadId);
2931
- if (!set) {
2932
- set = new Set();
2933
- this.pendingCheckpointReentries.set(threadId, set);
2934
- }
2935
- set.add(checkpointTaskId);
2936
- }
2937
- async drainPendingCheckpointReentries(user, threadId) {
2938
- const set = this.pendingCheckpointReentries.get(threadId);
2939
- if (!set || set.size === 0)
2940
- return;
2941
- const snapshot = [...set];
2942
- for (const checkpointTaskId of snapshot) {
2943
- if (this.runState.getActiveRunId(threadId) || this.runState.hasSuspendedRun(threadId)) {
2944
- return;
2945
- }
2946
- const siblings = this.backgroundTasks.getRunningTasksByParentCheckpoint(threadId, checkpointTaskId);
2947
- if (siblings.length > 0)
2948
- continue;
2949
- set.delete(checkpointTaskId);
2950
- await this.reenterCheckpointById(user, threadId, checkpointTaskId);
2951
- }
2952
- if (set.size === 0)
2953
- this.pendingCheckpointReentries.delete(threadId);
2954
- }
2955
- async reenterCheckpointById(user, threadId, checkpointTaskId, messageGroupId) {
2956
- try {
2957
- const { plannedTaskService } = await this.createPlannedTaskState();
2958
- const graph = await plannedTaskService.getGraph(threadId);
2959
- const checkpoint = graph?.tasks.find((t) => t.id === checkpointTaskId);
2960
- if (!graph || !checkpoint || checkpoint.kind !== 'checkpoint')
2961
- return false;
2962
- if (checkpoint.status !== 'running')
2963
- return false;
2964
- const startedRunId = await this.startInternalFollowUpRun(user, threadId, this.buildPlannedTaskFollowUpMessage('checkpoint', graph, { checkpoint }), messageGroupId, false, { isCheckpointFollowUp: true, checkpointTaskId });
2965
- if (!startedRunId)
2966
- return false;
2967
- this.logger.debug('Re-entered checkpoint follow-up', {
2968
- threadId,
2969
- checkpointTaskId,
2970
- messageGroupId,
2971
- });
2972
- return true;
2973
- }
2974
- catch (error) {
2975
- this.logger.error('Failed to re-enter checkpoint follow-up', {
2976
- threadId,
2977
- checkpointTaskId,
2978
- error: error instanceof Error ? error.message : String(error),
2979
- });
2980
- return false;
2981
- }
2982
- }
2983
- async maybeReenterParentCheckpoint(user, threadId, task) {
2984
- const parentCheckpointId = task.parentCheckpointId;
2985
- if (!parentCheckpointId)
2986
- return false;
2987
- const siblings = this.backgroundTasks
2988
- .getRunningTasksByParentCheckpoint(threadId, parentCheckpointId)
2989
- .filter((t) => t.taskId !== task.taskId);
2990
- if (siblings.length > 0)
2991
- return false;
2992
- if (this.runState.getActiveRunId(threadId) || this.runState.hasSuspendedRun(threadId)) {
2993
- return false;
2994
- }
2995
- return await this.reenterCheckpointById(user, threadId, parentCheckpointId, task.messageGroupId);
2996
- }
2997
2970
  async finalizeCheckpointFollowUp(user, threadId, checkpointTaskId, { reschedule = true } = {}) {
2998
2971
  try {
2999
2972
  const { plannedTaskService } = await this.createPlannedTaskState();
@@ -3081,7 +3054,7 @@ let InstanceAiService = class InstanceAiService {
3081
3054
  if (suspended?.user.id === requestingUserId) {
3082
3055
  this.cancelRun(suspended.threadId);
3083
3056
  }
3084
- this.logger.warn('Rejecting confirmation: user no longer authorized for AI Assistant', {
3057
+ this.logger.warn('Rejecting confirmation: user no longer authorized for n8n Assistant', {
3085
3058
  userId: requestingUserId,
3086
3059
  requestId,
3087
3060
  });
@@ -3253,14 +3226,14 @@ let InstanceAiService = class InstanceAiService {
3253
3226
  return null;
3254
3227
  }
3255
3228
  }
3256
- async resolveProjectContextSection(context) {
3229
+ async resolveBoundProject(context) {
3257
3230
  const projectId = context.projectId;
3258
3231
  if (!projectId)
3259
3232
  return undefined;
3260
3233
  try {
3261
3234
  const project = await context.workspaceService?.getProject?.(projectId);
3262
3235
  if (project)
3263
- return (0, internal_messages_1.getProjectContextSection)({ name: project.name, type: project.type });
3236
+ return project;
3264
3237
  this.logger.warn('Instance AI could not name the bound project for this turn', {
3265
3238
  projectId,
3266
3239
  reason: context.workspaceService?.getProject ? 'not-readable' : 'no-workspace-adapter',
@@ -3281,6 +3254,9 @@ let InstanceAiService = class InstanceAiService {
3281
3254
  return undefined;
3282
3255
  }
3283
3256
  }
3257
+ async resolveAiPreferencesBlock(userId, project) {
3258
+ return await this.bestEffort('Instance AI failed to read the AI preferences for this turn', { userId }, async () => (0, ai_preference_service_1.renderAiPreferencesBlock)(await this.aiPreferenceService.getApplicable(userId, project ? [project] : [])));
3259
+ }
3284
3260
  async canAccessAgentPreviewHandoff(user, projectId) {
3285
3261
  const requiredScopes = ['agent:read', 'agent:update'];
3286
3262
  return await (0, check_access_1.userHasScopes)(user, requiredScopes, false, { projectId });
@@ -3333,7 +3309,7 @@ let InstanceAiService = class InstanceAiService {
3333
3309
  }
3334
3310
  const activeUser = await this.revalidateActiveUser(user.id);
3335
3311
  if (!activeUser) {
3336
- this.logger.warn('Cancelling suspended run: user no longer authorized for AI Assistant', {
3312
+ this.logger.warn('Cancelling suspended run: user no longer authorized for n8n Assistant', {
3337
3313
  userId: user.id,
3338
3314
  threadId,
3339
3315
  requestId,
@@ -3543,7 +3519,7 @@ let InstanceAiService = class InstanceAiService {
3543
3519
  plannedBuild: opts.plannedBuild,
3544
3520
  runHandoff: runControl.state,
3545
3521
  });
3546
- void this.suspendedThreads.persistPendingConfirmation({
3522
+ await this.suspendedThreads.persistPendingConfirmation({
3547
3523
  requestId: result.suspension.requestId,
3548
3524
  threadId: opts.threadId,
3549
3525
  userId: opts.user.id,
@@ -3577,6 +3553,8 @@ let InstanceAiService = class InstanceAiService {
3577
3553
  });
3578
3554
  return;
3579
3555
  }
3556
+ if (opts.signal.aborted && !this.shouldPreserveHitlOnShutdown(opts.runId))
3557
+ return;
3580
3558
  if (result.confirmationEvent) {
3581
3559
  this.trackConfirmationRequest(opts.user.id, opts.threadId, result.confirmationEvent);
3582
3560
  this.eventBus.publish(opts.threadId, result.confirmationEvent);
@@ -3826,9 +3804,6 @@ let InstanceAiService = class InstanceAiService {
3826
3804
  else if (reschedule) {
3827
3805
  await this.schedulePlannedTasks(opts.user, opts.threadId);
3828
3806
  }
3829
- if (reschedule) {
3830
- await this.drainPendingCheckpointReentries(opts.user, opts.threadId);
3831
- }
3832
3807
  if (completedSetupWorkflowId) {
3833
3808
  await this.markWorkflowSetupHandled(opts.threadId, completedSetupWorkflowId, opts.runId);
3834
3809
  }
@@ -3930,190 +3905,6 @@ let InstanceAiService = class InstanceAiService {
3930
3905
  return undefined;
3931
3906
  }
3932
3907
  }
3933
- spawnBackgroundTask(runId, opts, messageGroupIdOverride) {
3934
- const outcome = this.backgroundTasks.spawn({
3935
- taskId: opts.taskId,
3936
- threadId: opts.threadId,
3937
- runId,
3938
- role: opts.role,
3939
- agentId: opts.agentId,
3940
- messageGroupId: messageGroupIdOverride ?? this.runState.getMessageGroupId(opts.threadId),
3941
- plannedTaskId: opts.plannedTaskId,
3942
- workItemId: opts.workItemId,
3943
- traceContext: opts.traceContext,
3944
- createTraceContext: opts.createTraceContext,
3945
- dedupeKey: opts.dedupeKey,
3946
- parentCheckpointId: opts.parentCheckpointId,
3947
- run: opts.run,
3948
- onLimitReached: async (errorMessage) => {
3949
- await this.tracing.finalizeDetachedTraceRun(opts.taskId, opts.traceContext, {
3950
- status: 'failed',
3951
- outputs: {
3952
- taskId: opts.taskId,
3953
- agentId: opts.agentId,
3954
- role: opts.role,
3955
- },
3956
- error: errorMessage,
3957
- metadata: {
3958
- ...(opts.plannedTaskId ? { planned_task_id: opts.plannedTaskId } : {}),
3959
- ...(opts.workItemId ? { work_item_id: opts.workItemId } : {}),
3960
- },
3961
- });
3962
- this.eventBus.publish(opts.threadId, {
3963
- type: 'agent-completed',
3964
- runId,
3965
- agentId: opts.agentId,
3966
- payload: {
3967
- role: opts.role,
3968
- result: '',
3969
- error: errorMessage,
3970
- },
3971
- });
3972
- },
3973
- onCompleted: async (task) => {
3974
- await this.tracing.finalizeBackgroundTaskTracing(task, 'completed');
3975
- this.eventBus.publish(opts.threadId, {
3976
- type: 'agent-completed',
3977
- runId,
3978
- agentId: opts.agentId,
3979
- payload: { role: opts.role, result: task.result ?? '' },
3980
- });
3981
- const user = this.runState.getThreadUser(opts.threadId);
3982
- if (user) {
3983
- await this.handlePlannedTaskSettlement(user, task, 'succeeded');
3984
- }
3985
- },
3986
- onFailed: async (task) => {
3987
- await this.tracing.finalizeBackgroundTaskTracing(task, 'failed');
3988
- this.instanceAiErrorReporter.report(new Error(task.error ?? 'Instance AI background task failed'), {
3989
- component: 'instance-ai-background-task',
3990
- threadId: opts.threadId,
3991
- runId,
3992
- tracing: task.traceContext,
3993
- agentId: opts.agentId,
3994
- messageGroupId: task.messageGroupId,
3995
- taskId: task.taskId,
3996
- role: task.role,
3997
- });
3998
- this.eventBus.publish(opts.threadId, {
3999
- type: 'agent-completed',
4000
- runId,
4001
- agentId: opts.agentId,
4002
- payload: { role: opts.role, result: '', error: task.error ?? 'Unknown error' },
4003
- });
4004
- const user = this.runState.getThreadUser(opts.threadId);
4005
- if (user) {
4006
- await this.handlePlannedTaskSettlement(user, task, 'failed');
4007
- }
4008
- },
4009
- onSettled: async (task) => {
4010
- await this.terminalOutcome.recordBackgroundTerminalOutcome(task);
4011
- if (task.plannedTaskId)
4012
- return;
4013
- await this.taskProjector.syncFromBackgroundTask(task);
4014
- const parentCheckpointId = task.parentCheckpointId;
4015
- if (parentCheckpointId) {
4016
- const user = this.runState.getThreadUser(opts.threadId);
4017
- if (!user) {
4018
- this.queuePendingCheckpointReentry(opts.threadId, parentCheckpointId);
4019
- return;
4020
- }
4021
- const reentered = await this.maybeReenterParentCheckpoint(user, opts.threadId, task);
4022
- if (!reentered) {
4023
- this.queuePendingCheckpointReentry(opts.threadId, parentCheckpointId);
4024
- }
4025
- return;
4026
- }
4027
- const remaining = this.backgroundTasks.getRunningTasks(opts.threadId);
4028
- const hasActiveRun = !!this.runState.getActiveRunId(opts.threadId);
4029
- const hasSuspendedRun = this.runState.hasSuspendedRun(opts.threadId);
4030
- if (remaining.length === 0 && !hasActiveRun && !hasSuspendedRun) {
4031
- if (this.liveness.hasTimedOutActiveRunThread(opts.threadId)) {
4032
- this.logger.debug('Skipping background auto-follow-up after active run timeout', {
4033
- threadId: opts.threadId,
4034
- taskId: task.taskId,
4035
- });
4036
- return;
4037
- }
4038
- if (task.timeoutReason) {
4039
- this.logger.debug('Skipping background auto-follow-up after task timeout', {
4040
- threadId: opts.threadId,
4041
- taskId: task.taskId,
4042
- timeoutReason: task.timeoutReason,
4043
- });
4044
- return;
4045
- }
4046
- const user = this.runState.getThreadUser(opts.threadId);
4047
- if (user) {
4048
- const verificationFollowUpStarted = await this.maybeStartWorkflowVerificationFollowUp(user, task);
4049
- if (verificationFollowUpStarted)
4050
- return;
4051
- const setupFollowUpStarted = await this.maybeStartWorkflowSetupFollowUp(user, task.threadId);
4052
- if (setupFollowUpStarted)
4053
- return;
4054
- const payload = JSON.stringify({
4055
- role: opts.role,
4056
- status: task.result ? 'completed' : task.error ? 'failed' : 'finished',
4057
- result: task.result ?? undefined,
4058
- outcome: task.outcome ?? undefined,
4059
- error: task.error ?? undefined,
4060
- }, null, 2);
4061
- await this.startInternalFollowUpRun(user, opts.threadId, `<background-task-completed>\n${payload}\n</background-task-completed>\n\n${internal_messages_1.AUTO_FOLLOW_UP_MESSAGE}`, task.messageGroupId);
4062
- }
4063
- }
4064
- },
4065
- });
4066
- if (outcome.status === 'started') {
4067
- void this.taskProjector.syncFromBackgroundTask(outcome.task);
4068
- return { status: 'started', taskId: outcome.task.taskId, agentId: outcome.task.agentId };
4069
- }
4070
- if (outcome.status === 'duplicate') {
4071
- this.logger.warn('Background task dispatch deduped — task already in flight', {
4072
- threadId: opts.threadId,
4073
- requestedTaskId: opts.taskId,
4074
- existingTaskId: outcome.existing.taskId,
4075
- plannedTaskId: opts.dedupeKey?.plannedTaskId,
4076
- workflowId: opts.dedupeKey?.workflowId,
4077
- role: opts.role,
4078
- });
4079
- void this.tracing.finalizeDetachedTraceRun(opts.taskId, opts.traceContext, {
4080
- status: 'cancelled',
4081
- outputs: {
4082
- taskId: opts.taskId,
4083
- agentId: opts.agentId,
4084
- role: opts.role,
4085
- deduped_to: outcome.existing.taskId,
4086
- },
4087
- metadata: {
4088
- deduped: true,
4089
- existing_task_id: outcome.existing.taskId,
4090
- ...(opts.plannedTaskId ? { planned_task_id: opts.plannedTaskId } : {}),
4091
- ...(opts.workItemId ? { work_item_id: opts.workItemId } : {}),
4092
- },
4093
- });
4094
- this.eventBus.publish(opts.threadId, {
4095
- type: 'agent-completed',
4096
- runId,
4097
- agentId: opts.agentId,
4098
- payload: {
4099
- role: opts.role,
4100
- result: '',
4101
- error: `Deduped: task already in flight as ${outcome.existing.taskId}`,
4102
- },
4103
- });
4104
- return {
4105
- status: 'duplicate',
4106
- existing: {
4107
- taskId: outcome.existing.taskId,
4108
- agentId: outcome.existing.agentId,
4109
- role: outcome.existing.role,
4110
- plannedTaskId: outcome.existing.plannedTaskId,
4111
- workItemId: outcome.existing.workItemId,
4112
- },
4113
- };
4114
- }
4115
- return { status: 'limit-reached' };
4116
- }
4117
3908
  async snapshotAttachedAgents(attachments, orchestrationContext, tracing) {
4118
3909
  const delegate = orchestrationContext.domainContext?.builderDelegate;
4119
3910
  if (!delegate || !tracing)
@@ -4523,20 +4314,8 @@ __decorate([
4523
4314
  __metadata("design:paramtypes", [Object]),
4524
4315
  __metadata("design:returntype", Promise)
4525
4316
  ], InstanceAiService.prototype, "handleRelayTaskControl", null);
4526
- __decorate([
4527
- (0, decorators_1.OnLeaderTakeover)(),
4528
- __metadata("design:type", Function),
4529
- __metadata("design:paramtypes", []),
4530
- __metadata("design:returntype", void 0)
4531
- ], InstanceAiService.prototype, "startCheckpointPruning", null);
4532
- __decorate([
4533
- (0, decorators_1.OnLeaderStepdown)(),
4534
- __metadata("design:type", Function),
4535
- __metadata("design:paramtypes", []),
4536
- __metadata("design:returntype", void 0)
4537
- ], InstanceAiService.prototype, "stopCheckpointPruning", null);
4538
4317
  exports.InstanceAiService = InstanceAiService = __decorate([
4539
4318
  (0, di_1.Service)(),
4540
- __metadata("design:paramtypes", [backend_common_1.Logger, config_1.GlobalConfig, n8n_core_1.InstanceSettings, instance_ai_adapter_service_1.InstanceAiAdapterService, in_process_event_bus_1.InProcessEventBus, durable_event_log_1.DurableEventLog, interrupted_run_sweeper_1.InterruptedRunSweeper, instance_ai_settings_service_1.InstanceAiSettingsService, instance_ai_gateway_service_1.InstanceAiGatewayService, instance_ai_browser_session_service_1.InstanceAiBrowserSessionService, instance_ai_memory_service_1.InstanceAiMemoryService, typeorm_agent_memory_1.TypeORMAgentMemory, typeorm_agent_checkpoint_store_1.TypeORMAgentCheckpointStore, ai_service_1.AiService, instance_ai_thread_grant_repository_1.InstanceAiThreadGrantRepository, instance_ai_pending_confirmation_repository_1.InstanceAiPendingConfirmationRepository, url_service_1.UrlService, instance_ai_event_log_repository_1.InstanceAiEventLogRepository, db_iteration_log_storage_1.DbIterationLogStorage, instance_write_access_service_1.InstanceWriteAccessService, telemetry_2.Telemetry, mcp_1.InstanceAiMcpRegistryService, db_1.UserRepository, instance_ai_temporary_workflow_service_1.InstanceAiTemporaryWorkflowService, n8n_core_1.ErrorReporter, config_1.SsrfProtectionConfig, backend_network_1.SsrfProtectionService, event_service_1.EventService, thread_credential_allowlist_service_1.EvalThreadCredentialAllowlistService, instance_ai_run_probe_1.InstanceAiRunProbe, instance_ai_model_service_1.InstanceAiModelService, instance_ai_credit_service_1.InstanceAiCreditService, publisher_service_1.Publisher, instance_ai_error_reporter_service_1.InstanceAiErrorReporterService, canvas_node_context_flag_gate_1.CanvasNodeContextFlagGate, push_1.Push, instance_ai_conversation_history_service_1.InstanceAiConversationHistoryService])
4319
+ __metadata("design:paramtypes", [backend_common_1.Logger, config_1.GlobalConfig, n8n_core_1.InstanceSettings, instance_ai_adapter_service_1.InstanceAiAdapterService, in_process_event_bus_1.InProcessEventBus, durable_event_log_1.DurableEventLog, interrupted_run_sweeper_1.InterruptedRunSweeper, instance_ai_settings_service_1.InstanceAiSettingsService, instance_ai_gateway_service_1.InstanceAiGatewayService, instance_ai_browser_session_service_1.InstanceAiBrowserSessionService, instance_ai_memory_service_1.InstanceAiMemoryService, typeorm_agent_memory_1.TypeORMAgentMemory, typeorm_agent_checkpoint_store_1.TypeORMAgentCheckpointStore, ai_service_1.AiService, instance_ai_thread_grant_repository_1.InstanceAiThreadGrantRepository, instance_ai_pending_confirmation_repository_1.InstanceAiPendingConfirmationRepository, url_service_1.UrlService, instance_ai_event_log_repository_1.InstanceAiEventLogRepository, db_iteration_log_storage_1.DbIterationLogStorage, instance_write_access_service_1.InstanceWriteAccessService, telemetry_2.Telemetry, mcp_1.InstanceAiMcpRegistryService, db_1.UserRepository, instance_ai_temporary_workflow_service_1.InstanceAiTemporaryWorkflowService, n8n_core_1.ErrorReporter, config_1.SsrfProtectionConfig, backend_network_1.SsrfProtectionService, event_service_1.EventService, thread_credential_allowlist_service_1.EvalThreadCredentialAllowlistService, instance_ai_run_probe_1.InstanceAiRunProbe, instance_ai_model_service_1.InstanceAiModelService, instance_ai_credit_service_1.InstanceAiCreditService, publisher_service_1.Publisher, instance_ai_error_reporter_service_1.InstanceAiErrorReporterService, canvas_node_context_flag_gate_1.CanvasNodeContextFlagGate, push_1.Push, instance_ai_conversation_history_service_1.InstanceAiConversationHistoryService, instance_context_service_1.InstanceContextService, ai_preference_service_1.AiPreferenceService])
4541
4320
  ], InstanceAiService);
4542
4321
  //# sourceMappingURL=instance-ai.service.js.map