n8n 2.40.5 → 2.41.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.
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/import/credentials.js +12 -3
- package/dist/commands/import/credentials.js.map +1 -1
- package/dist/commands/import/workflow.js +4 -4
- package/dist/commands/import/workflow.js.map +1 -1
- package/dist/commands/start.js +5 -2
- package/dist/commands/start.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/controllers/ai-preference.controller.js +1 -1
- package/dist/controllers/ai-preference.controller.js.map +1 -1
- package/dist/controllers/ai.controller.d.ts +1 -0
- package/dist/controllers/dev.controller.d.ts +8 -0
- package/dist/controllers/dev.controller.js +35 -0
- package/dist/controllers/dev.controller.js.map +1 -0
- package/dist/controllers/me.controller.d.ts +2 -4
- package/dist/controllers/me.controller.js +9 -24
- package/dist/controllers/me.controller.js.map +1 -1
- package/dist/controllers/role.controller.js +1 -0
- package/dist/controllers/role.controller.js.map +1 -1
- package/dist/crash-journal.js +1 -1
- package/dist/crash-journal.js.map +1 -1
- package/dist/credentials/credential-dependency.service.d.ts +2 -2
- package/dist/credentials/credential-dependency.service.js +5 -4
- package/dist/credentials/credential-dependency.service.js.map +1 -1
- package/dist/credentials/credentials-finder.service.d.ts +1 -0
- package/dist/credentials/credentials.controller.d.ts +4 -0
- package/dist/credentials/credentials.controller.js +5 -0
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +16 -3
- package/dist/credentials/credentials.service.ee.d.ts +2 -0
- package/dist/credentials/credentials.service.js +112 -30
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials/validation.d.ts +1 -0
- package/dist/credentials/validation.js +11 -0
- package/dist/credentials/validation.js.map +1 -1
- package/dist/credentials-helper.d.ts +3 -2
- package/dist/credentials-helper.js +39 -19
- package/dist/credentials-helper.js.map +1 -1
- package/dist/credentials-overwrites.js +2 -0
- package/dist/credentials-overwrites.js.map +1 -1
- package/dist/errors/response-errors/incompatible-nodes-api-version.error.d.ts +11 -0
- package/dist/errors/response-errors/incompatible-nodes-api-version.error.js +13 -0
- package/dist/errors/response-errors/incompatible-nodes-api-version.error.js.map +1 -0
- package/dist/errors/unsupported-end-user-credential-trigger.error.d.ts +4 -0
- package/dist/errors/unsupported-end-user-credential-trigger.error.js +13 -0
- package/dist/errors/unsupported-end-user-credential-trigger.error.js.map +1 -0
- package/dist/eventbus/event-message-classes/abstract-event-message.d.ts +1 -1
- package/dist/eventbus/event-message-classes/abstract-event-message.js +8 -0
- package/dist/eventbus/event-message-classes/abstract-event-message.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-ai-node.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-ai-node.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-ai-node.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-audit.d.ts +1 -2
- package/dist/eventbus/event-message-classes/event-message-audit.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-audit.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-execution.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-execution.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-execution.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-generic.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-generic.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-generic.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-mcp.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-mcp.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-mcp.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-node.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-node.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-node.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-queue.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-queue.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-queue.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-runner.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-runner.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-runner.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-workflow.d.ts +1 -2
- package/dist/eventbus/event-message-classes/event-message-workflow.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-workflow.js.map +1 -1
- package/dist/events/event.service.d.ts +3 -2
- package/dist/events/event.service.js.map +1 -1
- package/dist/events/maps/mcp-post-save-metrics.event-map.d.ts +7 -0
- package/dist/events/maps/mcp-post-save-metrics.event-map.js +3 -0
- package/dist/events/maps/mcp-post-save-metrics.event-map.js.map +1 -0
- package/dist/events/maps/relay.event-map.d.ts +3 -0
- package/dist/events/maps/system-task-metrics.event-map.d.ts +45 -0
- package/dist/events/maps/system-task-metrics.event-map.js +3 -0
- package/dist/events/maps/system-task-metrics.event-map.js.map +1 -0
- package/dist/events/relays/activity.event-relay.d.ts +9 -3
- package/dist/events/relays/activity.event-relay.js +33 -4
- package/dist/events/relays/activity.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.js +34 -14
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +10 -6
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/execution-lifecycle/shared/shared-hook-functions.d.ts +1 -1
- package/dist/execution-lifecycle/shared/shared-hook-functions.js +2 -1
- package/dist/execution-lifecycle/shared/shared-hook-functions.js.map +1 -1
- package/dist/executions/engine-v2-execution-reader.service.d.ts +26 -0
- package/dist/executions/engine-v2-execution-reader.service.js +58 -13
- package/dist/executions/engine-v2-execution-reader.service.js.map +1 -1
- package/dist/executions/engine-v2-mapping.d.ts +5 -0
- package/dist/executions/engine-v2-mapping.js +30 -0
- package/dist/executions/engine-v2-mapping.js.map +1 -0
- package/dist/executions/execution-cursor.d.ts +51 -0
- package/dist/executions/execution-cursor.js +39 -0
- package/dist/executions/execution-cursor.js.map +1 -0
- package/dist/executions/execution-id.js +2 -2
- package/dist/executions/execution-id.js.map +1 -1
- package/dist/executions/execution-list-v1.service.d.ts +27 -0
- package/dist/executions/execution-list-v1.service.js +98 -0
- package/dist/executions/execution-list-v1.service.js.map +1 -0
- package/dist/executions/execution-list-v2.service.d.ts +25 -0
- package/dist/executions/execution-list-v2.service.js +168 -0
- package/dist/executions/execution-list-v2.service.js.map +1 -0
- package/dist/executions/execution-list.service.d.ts +19 -0
- package/dist/executions/execution-list.service.js +67 -0
- package/dist/executions/execution-list.service.js.map +1 -0
- package/dist/executions/execution-recovery.service.d.ts +1 -2
- package/dist/executions/execution-recovery.service.js +1 -2
- package/dist/executions/execution-recovery.service.js.map +1 -1
- package/dist/executions/execution.service.d.ts +1 -34
- package/dist/executions/execution.service.js +4 -73
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/executions/execution.types.d.ts +4 -2
- package/dist/executions/executions.controller.d.ts +4 -1
- package/dist/executions/executions.controller.js +12 -23
- package/dist/executions/executions.controller.js.map +1 -1
- package/dist/executions/merge-execution-pages.d.ts +10 -0
- package/dist/executions/merge-execution-pages.js +30 -0
- package/dist/executions/merge-execution-pages.js.map +1 -0
- package/dist/executions/parse-range-query.middleware.d.ts +2 -3
- package/dist/executions/parse-range-query.middleware.js +27 -21
- package/dist/executions/parse-range-query.middleware.js.map +1 -1
- package/dist/external-hooks.d.ts +6 -2
- package/dist/load-nodes-and-credentials.d.ts +3 -0
- package/dist/load-nodes-and-credentials.js +37 -15
- package/dist/load-nodes-and-credentials.js.map +1 -1
- package/dist/metrics/prometheus/constant.d.ts +1 -0
- package/dist/metrics/prometheus/constant.js +4 -1
- package/dist/metrics/prometheus/constant.js.map +1 -1
- package/dist/metrics/prometheus/mcp-post-save-metrics.service.d.ts +10 -0
- package/dist/metrics/prometheus/mcp-post-save-metrics.service.js +44 -0
- package/dist/metrics/prometheus/mcp-post-save-metrics.service.js.map +1 -0
- package/dist/metrics/prometheus/prometheus.service.d.ts +3 -1
- package/dist/metrics/prometheus/prometheus.service.js +6 -2
- package/dist/metrics/prometheus/prometheus.service.js.map +1 -1
- package/dist/metrics/prometheus/system-task-metrics.service.d.ts +12 -0
- package/dist/metrics/prometheus/system-task-metrics.service.js +157 -0
- package/dist/metrics/prometheus/system-task-metrics.service.js.map +1 -0
- package/dist/middlewares/list-query/dtos/credentials.select.dto.js +1 -0
- package/dist/middlewares/list-query/dtos/credentials.select.dto.js.map +1 -1
- package/dist/modules/agents/adapters/agents-credential-provider.d.ts +2 -1
- package/dist/modules/agents/adapters/agents-credential-provider.js +3 -1
- package/dist/modules/agents/adapters/agents-credential-provider.js.map +1 -1
- package/dist/modules/agents/agent-chat.controller.js +32 -37
- package/dist/modules/agents/agent-chat.controller.js.map +1 -1
- package/dist/modules/agents/agent-config.service.js +1 -1
- package/dist/modules/agents/agent-config.service.js.map +1 -1
- package/dist/modules/agents/agent-conversation-state.service.d.ts +12 -0
- package/dist/modules/agents/agent-conversation-state.service.js +34 -0
- package/dist/modules/agents/agent-conversation-state.service.js.map +1 -0
- package/dist/modules/agents/agent-custom-tools.service.js +2 -2
- package/dist/modules/agents/agent-custom-tools.service.js.map +1 -1
- package/dist/modules/agents/agent-execution-orchestrator.service.d.ts +13 -6
- package/dist/modules/agents/agent-execution-orchestrator.service.js +284 -417
- package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
- package/dist/modules/agents/agent-execution-recording.error.d.ts +21 -0
- package/dist/modules/agents/agent-execution-recording.error.js +17 -0
- package/dist/modules/agents/agent-execution-recording.error.js.map +1 -0
- package/dist/modules/agents/agent-execution.service.d.ts +1 -1
- package/dist/modules/agents/agent-execution.service.js +51 -20
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-integration-management.service.d.ts +5 -3
- package/dist/modules/agents/agent-integration-management.service.js +9 -6
- package/dist/modules/agents/agent-integration-management.service.js.map +1 -1
- package/dist/modules/agents/agent-integrations.controller.d.ts +1 -3
- package/dist/modules/agents/agent-integrations.controller.js +4 -6
- package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
- package/dist/modules/agents/agent-message-mapper.d.ts +1 -1
- package/dist/modules/agents/agent-message-mapper.js +3 -0
- package/dist/modules/agents/agent-message-mapper.js.map +1 -1
- package/dist/modules/agents/agent-modification-telemetry.service.d.ts +2 -2
- package/dist/modules/agents/agent-modification-telemetry.service.js.map +1 -1
- package/dist/modules/agents/agent-publish.service.js +5 -5
- package/dist/modules/agents/agent-publish.service.js.map +1 -1
- package/dist/modules/agents/agent-runnable-state.service.js +1 -1
- package/dist/modules/agents/agent-runnable-state.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-cache.service.js +1 -1
- package/dist/modules/agents/agent-runtime-cache.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-reconstruction.service.js +1 -1
- package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
- package/dist/modules/agents/agent-skills.service.js +3 -3
- package/dist/modules/agents/agent-skills.service.js.map +1 -1
- package/dist/modules/agents/agent-sse-stream.d.ts +4 -1
- package/dist/modules/agents/agent-sse-stream.js +46 -33
- package/dist/modules/agents/agent-sse-stream.js.map +1 -1
- package/dist/modules/agents/agent-task.service.js +3 -3
- package/dist/modules/agents/agent-task.service.js.map +1 -1
- package/dist/modules/agents/agent-test-run.service.d.ts +24 -41
- package/dist/modules/agents/agent-test-run.service.js +83 -59
- package/dist/modules/agents/agent-test-run.service.js.map +1 -1
- package/dist/modules/agents/agent-turn-execution.service.d.ts +49 -0
- package/dist/modules/agents/agent-turn-execution.service.js +212 -0
- package/dist/modules/agents/agent-turn-execution.service.js.map +1 -0
- package/dist/modules/agents/agent-workflow-execution.service.d.ts +6 -3
- package/dist/modules/agents/agent-workflow-execution.service.js +77 -105
- package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-workflow-tool-resume.service.d.ts +0 -1
- package/dist/modules/agents/agent-workflow-tool-resume.service.js +46 -20
- package/dist/modules/agents/agent-workflow-tool-resume.service.js.map +1 -1
- package/dist/modules/agents/agents-config.controller.js +1 -1
- package/dist/modules/agents/agents-config.controller.js.map +1 -1
- package/dist/modules/agents/background/agent-wake.service.d.ts +3 -5
- package/dist/modules/agents/background/agent-wake.service.js +6 -10
- package/dist/modules/agents/background/agent-wake.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-prompts.d.ts +1 -1
- package/dist/modules/agents/builder/agents-builder-prompts.js +21 -0
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
- package/dist/modules/agents/builder/get-resource-locator-options.tool.d.ts +2 -2
- package/dist/modules/agents/builder/skills/external-services.skill.js +4 -1
- package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
- package/dist/modules/agents/entities/agent-checkpoint.entity.d.ts +1 -0
- package/dist/modules/agents/entities/agent-checkpoint.entity.js +10 -1
- package/dist/modules/agents/entities/agent-checkpoint.entity.js.map +1 -1
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +1 -1
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +3 -3
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +11 -24
- package/dist/modules/agents/integrations/agent-chat-bridge.js +58 -28
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.d.ts +5 -12
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js +8 -3
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +2 -1
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-message-context.d.ts +4 -4
- package/dist/modules/agents/integrations/agent-chat-message-context.js +4 -37
- package/dist/modules/agents/integrations/agent-chat-message-context.js.map +1 -1
- package/dist/modules/agents/integrations/integration-message-context.d.ts +7 -0
- package/dist/modules/agents/integrations/integration-message-context.js +115 -0
- package/dist/modules/agents/integrations/integration-message-context.js.map +1 -0
- package/dist/modules/agents/integrations/integration-message-context.service.d.ts +8 -3
- package/dist/modules/agents/integrations/integration-message-context.service.js +36 -58
- package/dist/modules/agents/integrations/integration-message-context.service.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-definitions.js +1 -1
- package/dist/modules/agents/integrations/integration-tool-definitions.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-execution.d.ts +0 -1
- package/dist/modules/agents/integrations/integration-tool-execution.js +19 -42
- package/dist/modules/agents/integrations/integration-tool-execution.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-factory.d.ts +0 -1
- package/dist/modules/agents/integrations/integration-tool-factory.js +1 -3
- package/dist/modules/agents/integrations/integration-tool-factory.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-types.d.ts +13 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +4 -2
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.d.ts +2 -0
- package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.js +40 -0
- package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +1 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +4 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
- package/dist/modules/agents/repositories/agent-checkpoint.repository.d.ts +1 -1
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js +2 -2
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-execution.repository.d.ts +2 -1
- package/dist/modules/agents/repositories/agent-execution.repository.js +7 -4
- package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
- package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js +3 -0
- package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js.map +1 -1
- package/dist/modules/agents/sub-agents/sub-agent-runner.d.ts +3 -4
- package/dist/modules/agents/sub-agents/sub-agent-runner.js +95 -151
- package/dist/modules/agents/sub-agents/sub-agent-runner.js.map +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.js +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
- package/dist/modules/agents/utils/agent-credential-provider.d.ts +1 -1
- package/dist/modules/agents/utils/agent-credential-provider.js +2 -2
- package/dist/modules/agents/utils/agent-credential-provider.js.map +1 -1
- package/dist/modules/agents/utils/execution-to-message-mapper.d.ts +1 -1
- package/dist/modules/agents/utils/execution-to-message-mapper.js +3 -0
- package/dist/modules/agents/utils/execution-to-message-mapper.js.map +1 -1
- package/dist/modules/agents/utils/mcp-attribution.js +3 -1
- package/dist/modules/agents/utils/mcp-attribution.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.migration-registry.service.d.ts +2 -2
- package/dist/modules/breaking-changes/breaking-changes.migration-registry.service.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.migration.service.d.ts +4 -11
- package/dist/modules/breaking-changes/breaking-changes.migration.service.js +52 -28
- package/dist/modules/breaking-changes/breaking-changes.migration.service.js.map +1 -1
- package/dist/modules/breaking-changes/detection-report.d.ts +5 -0
- package/dist/modules/breaking-changes/detection-report.js +18 -0
- package/dist/modules/breaking-changes/detection-report.js.map +1 -0
- package/dist/modules/breaking-changes/migrations/execute-workflow-each-to-loop.migration.d.ts +2 -0
- package/dist/modules/breaking-changes/migrations/execute-workflow-each-to-loop.migration.js +159 -0
- package/dist/modules/breaking-changes/migrations/execute-workflow-each-to-loop.migration.js.map +1 -0
- package/dist/modules/breaking-changes/migrations/index.d.ts +2 -2
- package/dist/modules/breaking-changes/migrations/index.js +2 -1
- package/dist/modules/breaking-changes/migrations/index.js.map +1 -1
- package/dist/modules/breaking-changes/migrations/node-migration.d.ts +30 -1
- package/dist/modules/breaking-changes/migrations/node-migration.js +12 -0
- package/dist/modules/breaking-changes/migrations/node-migration.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/oauth-callback-auth.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v2/oauth-callback-auth.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/pyodide-removed.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v2/pyodide-removed.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/agent-node-version.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/agent-node-version.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/agent-removed-modes.rule.js +7 -13
- package/dist/modules/breaking-changes/rules/v3/agent-removed-modes.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/ai-transform-deprecated.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/ai-transform-deprecated.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/always-output-data-multi-output.rule.js +6 -13
- package/dist/modules/breaking-changes/rules/v3/always-output-data-multi-output.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/caller-policy-default-any.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/caller-policy-default-any.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/chat-hub-deprecated.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/chat-hub-deprecated.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/chat-trigger-embedded-json.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/chat-trigger-embedded-json.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/compression-node-limits.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/compression-node-limits.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/docker-only-deployment.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/docker-only-deployment.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-each-mode.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-each-mode.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-source-modes.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-source-modes.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/external-secrets-project-roles-default.rule.js +3 -2
- package/dist/modules/breaking-changes/rules/v3/external-secrets-project-roles-default.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/get-paired-item.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/get-paired-item.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/gmail-trigger-version.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/gmail-trigger-version.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/in-memory-binary-data.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/in-memory-binary-data.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/offload-manual-executions.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/offload-manual-executions.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/pre-execute-error-creates-execution.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/pre-execute-error-creates-execution.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/ssrf-default-blocked-ranges.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/ssrf-default-blocked-ranges.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/task-runner-task-timeout.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/task-runner-task-timeout.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-workflow.service.d.ts +1 -0
- package/dist/modules/chat-hub/chat-hub-workflow.service.js +7 -2
- package/dist/modules/chat-hub/chat-hub-workflow.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.attachment.service.js +3 -1
- package/dist/modules/chat-hub/chat-hub.attachment.service.js.map +1 -1
- package/dist/modules/community-packages/community-node-types-utils.d.ts +2 -2
- package/dist/modules/community-packages/community-node-types-utils.js +4 -2
- package/dist/modules/community-packages/community-node-types-utils.js.map +1 -1
- package/dist/modules/community-packages/community-node-types.service.d.ts +1 -0
- package/dist/modules/community-packages/community-node-types.service.js +12 -6
- package/dist/modules/community-packages/community-node-types.service.js.map +1 -1
- package/dist/modules/community-packages/community-packages.config.d.ts +1 -0
- package/dist/modules/community-packages/community-packages.config.js +2 -0
- package/dist/modules/community-packages/community-packages.config.js.map +1 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.d.ts +2 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.js +23 -18
- package/dist/modules/community-packages/community-packages.lifecycle.service.js.map +1 -1
- package/dist/modules/community-packages/community-packages.service.d.ts +1 -0
- package/dist/modules/community-packages/community-packages.service.js +33 -2
- package/dist/modules/community-packages/community-packages.service.js.map +1 -1
- package/dist/modules/engine-v2/engine-data-plane-client.d.ts +2 -1
- package/dist/modules/engine-v2/engine-data-plane-client.js +14 -0
- package/dist/modules/engine-v2/engine-data-plane-client.js.map +1 -1
- package/dist/modules/engine-v2/engine-v2.module.d.ts +1 -0
- package/dist/modules/engine-v2/engine-v2.module.js +11 -2
- package/dist/modules/engine-v2/engine-v2.module.js.map +1 -1
- package/dist/modules/engine-v2/engine-v2.runtime.d.ts +11 -2
- package/dist/modules/engine-v2/engine-v2.runtime.js +29 -11
- package/dist/modules/engine-v2/engine-v2.runtime.js.map +1 -1
- package/dist/modules/external-secrets.ee/constants.d.ts +0 -1
- package/dist/modules/external-secrets.ee/constants.js +1 -2
- package/dist/modules/external-secrets.ee/constants.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets-provider-connection-manager.ee.d.ts +1 -2
- package/dist/modules/external-secrets.ee/external-secrets-provider-connection-manager.ee.js +28 -29
- package/dist/modules/external-secrets.ee/external-secrets-provider-connection-manager.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets.config.d.ts +2 -0
- package/dist/modules/external-secrets.ee/external-secrets.config.js +12 -0
- package/dist/modules/external-secrets.ee/external-secrets.config.js.map +1 -1
- package/dist/modules/external-secrets.ee/provider-lifecycle.service.js +1 -1
- package/dist/modules/external-secrets.ee/provider-lifecycle.service.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/infisical.js +6 -2
- package/dist/modules/external-secrets.ee/providers/infisical.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/vault.d.ts +1 -0
- package/dist/modules/external-secrets.ee/providers/vault.js +43 -13
- package/dist/modules/external-secrets.ee/providers/vault.js.map +1 -1
- package/dist/modules/external-secrets.ee/retry-manager.service.js +9 -1
- package/dist/modules/external-secrets.ee/retry-manager.service.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-cache.service.d.ts +5 -2
- package/dist/modules/external-secrets.ee/secrets-cache.service.js +23 -20
- package/dist/modules/external-secrets.ee/secrets-cache.service.js.map +1 -1
- package/dist/modules/external-secrets.ee/types.d.ts +1 -0
- package/dist/modules/external-secrets.ee/types.js +7 -1
- package/dist/modules/external-secrets.ee/types.js.map +1 -1
- package/dist/modules/external-secrets.ee/with-timeout.d.ts +4 -0
- package/dist/modules/external-secrets.ee/with-timeout.js +21 -0
- package/dist/modules/external-secrets.ee/with-timeout.js.map +1 -0
- package/dist/modules/insights/database/repositories/insights-by-period.repository.d.ts +3 -2
- package/dist/modules/insights/database/repositories/insights-by-period.repository.js +4 -3
- package/dist/modules/insights/database/repositories/insights-by-period.repository.js.map +1 -1
- package/dist/modules/insights/insights-collection.service.js +10 -2
- package/dist/modules/insights/insights-collection.service.js.map +1 -1
- package/dist/modules/insights/insights.module.d.ts +1 -1
- package/dist/modules/instance-ai/computer-use-availability.d.ts +14 -0
- package/dist/modules/instance-ai/computer-use-availability.js +42 -0
- package/dist/modules/instance-ai/computer-use-availability.js.map +1 -0
- package/dist/modules/instance-ai/eval/agent-execution.service.js +1 -1
- package/dist/modules/instance-ai/eval/agent-execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.d.ts +4 -2
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js +17 -3
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js.map +1 -1
- package/dist/modules/instance-ai/eval/execution.service.js +14 -4
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/thread-restore.service.d.ts +9 -3
- package/dist/modules/instance-ai/eval/thread-restore.service.js +75 -7
- package/dist/modules/instance-ai/eval/thread-restore.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +3 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.js +16 -2
- package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-conversation-history.service.js +1 -1
- package/dist/modules/instance-ai/instance-ai-conversation-history.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-execution-wait.d.ts +14 -0
- package/dist/modules/instance-ai/instance-ai-execution-wait.js +66 -0
- package/dist/modules/instance-ai/instance-ai-execution-wait.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-settings.service.js +1 -4
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-step-run.d.ts +32 -0
- package/dist/modules/instance-ai/instance-ai-step-run.js +135 -0
- package/dist/modules/instance-ai/instance-ai-step-run.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +9 -2
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +305 -92
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +1 -0
- package/dist/modules/instance-ai/instance-ai.controller.js +17 -4
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +4 -4
- package/dist/modules/instance-ai/instance-ai.service.js +85 -121
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-context.service.d.ts +39 -10
- package/dist/modules/instance-ai/instance-context.service.js +283 -69
- package/dist/modules/instance-ai/instance-context.service.js.map +1 -1
- package/dist/modules/instance-ai/internal-messages.d.ts +11 -2
- package/dist/modules/instance-ai/internal-messages.js +183 -16
- package/dist/modules/instance-ai/internal-messages.js.map +1 -1
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-registry/instance-registry.module.d.ts +2 -2
- package/dist/modules/instance-registry/instance-registry.module.js +5 -1
- package/dist/modules/instance-registry/instance-registry.module.js.map +1 -1
- package/dist/modules/instance-registry/stale-member-cleanup.task.d.ts +1 -1
- package/dist/modules/instance-registry/stale-member-cleanup.task.js +1 -1
- package/dist/modules/instance-registry/stale-member-cleanup.task.js.map +1 -1
- package/dist/modules/instance-registry/storage/redis-instance-storage.js +2 -10
- package/dist/modules/instance-registry/storage/redis-instance-storage.js.map +1 -1
- package/dist/modules/mcp/mcp-post-save-metrics.service.d.ts +10 -0
- package/dist/modules/mcp/mcp-post-save-metrics.service.js +40 -0
- package/dist/modules/mcp/mcp-post-save-metrics.service.js.map +1 -0
- package/dist/modules/mcp/mcp-protected-resource.d.ts +5 -2
- package/dist/modules/mcp/mcp-protected-resource.js +25 -4
- package/dist/modules/mcp/mcp-protected-resource.js.map +1 -1
- package/dist/modules/mcp/mcp-scopes.d.ts +3 -0
- package/dist/modules/mcp/mcp-scopes.js +21 -1
- package/dist/modules/mcp/mcp-scopes.js.map +1 -1
- package/dist/modules/mcp/mcp-tool-availability.d.ts +7 -0
- package/dist/modules/mcp/mcp-tool-availability.js +11 -0
- package/dist/modules/mcp/mcp-tool-availability.js.map +1 -1
- package/dist/modules/mcp/mcp.config.d.ts +1 -0
- package/dist/modules/mcp/mcp.config.js +5 -0
- package/dist/modules/mcp/mcp.config.js.map +1 -1
- package/dist/modules/mcp/mcp.constants.d.ts +6 -0
- package/dist/modules/mcp/mcp.constants.js +7 -1
- package/dist/modules/mcp/mcp.constants.js.map +1 -1
- package/dist/modules/mcp/mcp.controller.js +3 -6
- package/dist/modules/mcp/mcp.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +11 -7
- package/dist/modules/mcp/mcp.service.js +116 -43
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +0 -1
- package/dist/modules/mcp/tools/get-instance-context.tool.d.ts +29 -0
- package/dist/modules/mcp/tools/get-instance-context.tool.js +109 -0
- package/dist/modules/mcp/tools/get-instance-context.tool.js.map +1 -0
- package/dist/modules/mcp/tools/get-node-usage.tool.d.ts +13 -0
- package/dist/modules/mcp/tools/get-node-usage.tool.js +117 -0
- package/dist/modules/mcp/tools/get-node-usage.tool.js.map +1 -0
- package/dist/modules/mcp/tools/get-user-preferences.tool.d.ts +10 -0
- package/dist/modules/mcp/tools/get-user-preferences.tool.js +108 -0
- package/dist/modules/mcp/tools/get-user-preferences.tool.js.map +1 -0
- package/dist/modules/mcp/tools/instance-activity.tool.d.ts +27 -0
- package/dist/modules/mcp/tools/instance-activity.tool.js +205 -0
- package/dist/modules/mcp/tools/instance-activity.tool.js.map +1 -0
- package/dist/modules/mcp/tools/list-credentials.tool.d.ts +63 -13
- package/dist/modules/mcp/tools/list-credentials.tool.js +8 -1
- package/dist/modules/mcp/tools/list-credentials.tool.js.map +1 -1
- package/dist/modules/mcp/tools/search-executions.tool.d.ts +3 -3
- package/dist/modules/mcp/tools/search-executions.tool.js +22 -14
- package/dist/modules/mcp/tools/search-executions.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.d.ts +8 -4
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +128 -70
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/error-code.utils.d.ts +1 -0
- package/dist/modules/mcp/tools/workflow-builder/error-code.utils.js +22 -0
- package/dist/modules/mcp/tools/workflow-builder/error-code.utils.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.d.ts +1 -3
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js +5 -6
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.d.ts +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js +2 -2
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.d.ts +2 -5
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js +10 -16
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/install-community-node.tool.d.ts +12 -0
- package/dist/modules/mcp/tools/workflow-builder/install-community-node.tool.js +140 -0
- package/dist/modules/mcp/tools/workflow-builder/install-community-node.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +17 -9
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.d.ts +1 -3
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js +2 -6
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.d.ts +1 -1
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js +9 -8
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/uninstalled-node-warnings.d.ts +13 -0
- package/dist/modules/mcp/tools/workflow-builder/uninstalled-node-warnings.js +23 -0
- package/dist/modules/mcp/tools/workflow-builder/uninstalled-node-warnings.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +18 -14
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +200 -87
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.d.ts +1 -4
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +3 -5
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.d.ts +1 -3
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +2 -2
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
- package/dist/modules/mcp-registry/node-description-transform.js +3 -0
- package/dist/modules/mcp-registry/node-description-transform.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry-api.client.js +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry-api.client.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry-capabilities.d.ts +6 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-capabilities.js +34 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-capabilities.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-server.entity.d.ts +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-server.entity.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.service.d.ts +4 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js +20 -9
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.types.d.ts +3 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -1
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js +1 -1
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/variable/variable-requirements.extractor.d.ts +8 -2
- package/dist/modules/n8n-packages/entities/variable/variable-requirements.extractor.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.js +2 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +1 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +4 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/io/directory/package-directory-inventory-reader.d.ts +43 -0
- package/dist/modules/n8n-packages/io/directory/package-directory-inventory-reader.js +177 -0
- package/dist/modules/n8n-packages/io/directory/package-directory-inventory-reader.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.d.ts +3 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.js +1 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.js.map +1 -1
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +0 -3
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +0 -1
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +1 -1
- package/dist/modules/oauth-jwe/oauth-jwe-key.service.d.ts +1 -0
- package/dist/modules/oauth-jwe/oauth-jwe-key.service.js +10 -3
- package/dist/modules/oauth-jwe/oauth-jwe-key.service.js.map +1 -1
- package/dist/modules/oauth-server/oauth-clients.controller.js +1 -1
- package/dist/modules/oauth-server/oauth-clients.controller.js.map +1 -1
- package/dist/modules/oauth-server/oauth-consent.service.d.ts +1 -0
- package/dist/modules/oauth-server/oauth-consent.service.js +21 -10
- package/dist/modules/oauth-server/oauth-consent.service.js.map +1 -1
- package/dist/modules/oauth-server/oauth-server.service.d.ts +1 -1
- package/dist/modules/oauth-server/oauth-server.service.js +2 -2
- package/dist/modules/oauth-server/oauth-server.service.js.map +1 -1
- package/dist/modules/oauth-server/oauth-token.service.d.ts +3 -1
- package/dist/modules/oauth-server/oauth-token.service.js +10 -2
- package/dist/modules/oauth-server/oauth-token.service.js.map +1 -1
- package/dist/modules/policy-infrastructure/policy-decision-audit.d.ts +1 -1
- package/dist/modules/policy-infrastructure/policy-decision-audit.js +8 -1
- package/dist/modules/policy-infrastructure/policy-decision-audit.js.map +1 -1
- package/dist/modules/policy-infrastructure/policy-decision.service.js +1 -0
- package/dist/modules/policy-infrastructure/policy-decision.service.js.map +1 -1
- package/dist/modules/promotions.ee/base-branch-files.d.ts +2 -2
- package/dist/modules/promotions.ee/base-branch-files.js +2 -3
- package/dist/modules/promotions.ee/base-branch-files.js.map +1 -1
- package/dist/modules/promotions.ee/constants.d.ts +1 -0
- package/dist/modules/promotions.ee/constants.js +2 -1
- package/dist/modules/promotions.ee/constants.js.map +1 -1
- package/dist/modules/promotions.ee/database/repositories/promotion-provider.repository.js +1 -14
- package/dist/modules/promotions.ee/database/repositories/promotion-provider.repository.js.map +1 -1
- package/dist/modules/promotions.ee/promotion-binding-preflight.service.d.ts +22 -0
- package/dist/modules/promotions.ee/promotion-binding-preflight.service.js +264 -0
- package/dist/modules/promotions.ee/promotion-binding-preflight.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-change.service.d.ts +8 -3
- package/dist/modules/promotions.ee/promotion-change.service.js +133 -24
- package/dist/modules/promotions.ee/promotion-change.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotion-changes.controller.d.ts +2 -2
- package/dist/modules/promotions.ee/promotion-changes.controller.js +10 -12
- package/dist/modules/promotions.ee/promotion-changes.controller.js.map +1 -1
- package/dist/modules/promotions.ee/promotion-connections.service.d.ts +48 -2
- package/dist/modules/promotions.ee/promotion-connections.service.js +66 -14
- package/dist/modules/promotions.ee/promotion-connections.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotions-git.service.d.ts +8 -1
- package/dist/modules/promotions.ee/promotions-git.service.js +27 -9
- package/dist/modules/promotions.ee/promotions-git.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotions-git.utils.d.ts +8 -2
- package/dist/modules/promotions.ee/promotions-git.utils.js +10 -0
- package/dist/modules/promotions.ee/promotions-git.utils.js.map +1 -1
- package/dist/modules/promotions.ee/promotions.service.d.ts +9 -5
- package/dist/modules/promotions.ee/promotions.service.js +78 -21
- package/dist/modules/promotions.ee/promotions.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotions.types.d.ts +6 -0
- package/dist/modules/promotions.ee/promotions.types.js.map +1 -1
- package/dist/modules/token-exchange/database/repositories/token-exchange-jti.repository.js +1 -0
- package/dist/modules/token-exchange/database/repositories/token-exchange-jti.repository.js.map +1 -1
- package/dist/modules/token-exchange/services/jti-cleanup.task.d.ts +1 -1
- package/dist/modules/token-exchange/services/jti-cleanup.task.js +1 -1
- package/dist/modules/token-exchange/services/jti-cleanup.task.js.map +1 -1
- package/dist/modules/type-availability-policies/constants.d.ts +1 -0
- package/dist/modules/type-availability-policies/constants.js +2 -1
- package/dist/modules/type-availability-policies/constants.js.map +1 -1
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.js +2 -1
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.js.map +1 -1
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.d.ts +2 -1
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js +12 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js.map +1 -1
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.d.ts +5 -1
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js +11 -2
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js.map +1 -1
- package/dist/modules/type-availability-policies/node-type-policy.check.d.ts +17 -0
- package/dist/modules/type-availability-policies/node-type-policy.check.js +87 -0
- package/dist/modules/type-availability-policies/node-type-policy.check.js.map +1 -0
- package/dist/modules/type-availability-policies/package-resolver.d.ts +4 -0
- package/dist/modules/type-availability-policies/package-resolver.js +26 -0
- package/dist/modules/type-availability-policies/package-resolver.js.map +1 -0
- package/dist/modules/type-availability-policies/policy-evaluator.d.ts +6 -4
- package/dist/modules/type-availability-policies/policy-evaluator.js +16 -13
- package/dist/modules/type-availability-policies/policy-evaluator.js.map +1 -1
- package/dist/modules/type-availability-policies/policy-rule.types.d.ts +4 -0
- package/dist/modules/type-availability-policies/policy-shadow-lint.d.ts +2 -1
- package/dist/modules/type-availability-policies/policy-shadow-lint.js +7 -5
- package/dist/modules/type-availability-policies/policy-shadow-lint.js.map +1 -1
- package/dist/modules/type-availability-policies/type-availability-policies.module.d.ts +1 -1
- package/dist/modules/type-availability-policies/type-availability-policies.module.js +1 -0
- package/dist/modules/type-availability-policies/type-availability-policies.module.js.map +1 -1
- package/dist/modules/type-availability-policies/type-availability-policy-instance.controller.js +3 -3
- package/dist/modules/type-availability-policies/type-availability-policy-instance.controller.js.map +1 -1
- package/dist/modules/type-availability-policies/type-availability-policy.service.d.ts +33 -4
- package/dist/modules/type-availability-policies/type-availability-policy.service.js +189 -28
- package/dist/modules/type-availability-policies/type-availability-policy.service.js.map +1 -1
- package/dist/modules/workflow-index/workflow-index.service.js +5 -2
- package/dist/modules/workflow-index/workflow-index.service.js.map +1 -1
- package/dist/node-catalog/index.d.ts +1 -1
- package/dist/node-catalog/index.js.map +1 -1
- package/dist/node-catalog/node-catalog.service.d.ts +28 -4
- package/dist/node-catalog/node-catalog.service.js +202 -7
- package/dist/node-catalog/node-catalog.service.js.map +1 -1
- package/dist/node-catalog/registry-lookup.d.ts +12 -0
- package/dist/node-catalog/registry-lookup.js +68 -0
- package/dist/node-catalog/registry-lookup.js.map +1 -0
- package/dist/node-execution/execute-node.service.d.ts +72 -0
- package/dist/node-execution/execute-node.service.js +297 -0
- package/dist/node-execution/execute-node.service.js.map +1 -0
- package/dist/node-execution/index.d.ts +2 -0
- package/dist/node-execution/index.js +5 -1
- package/dist/node-execution/index.js.map +1 -1
- package/dist/oauth/dcr-managed-fields.d.ts +1 -1
- package/dist/oauth/dcr-managed-fields.js +4 -2
- package/dist/oauth/dcr-managed-fields.js.map +1 -1
- package/dist/policy/policy-enforcement-backend.d.ts +2 -1
- package/dist/policy/policy-enforcement.service.d.ts +3 -1
- package/dist/policy/policy-enforcement.service.js +9 -0
- package/dist/policy/policy-enforcement.service.js.map +1 -1
- package/dist/posthog/index.d.ts +1 -0
- package/dist/posthog/index.js +35 -14
- package/dist/posthog/index.js.map +1 -1
- package/dist/public-api/constants.d.ts +1 -0
- package/dist/public-api/constants.js +5 -0
- package/dist/public-api/constants.js.map +1 -0
- package/dist/public-api/public-api-controller.registry.d.ts +1 -0
- package/dist/public-api/public-api-controller.registry.js +15 -0
- package/dist/public-api/public-api-controller.registry.js.map +1 -1
- package/dist/public-api/types.d.ts +2 -27
- package/dist/public-api/v1/controllers/credentials.public.controller.d.ts +3 -1
- package/dist/public-api/v1/controllers/credentials.public.controller.js +52 -1
- package/dist/public-api/v1/controllers/credentials.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/executions.public.controller.js +3 -3
- package/dist/public-api/v1/controllers/executions.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/folders.public.controller.d.ts +10 -0
- package/dist/public-api/v1/controllers/folders.public.controller.js +121 -0
- package/dist/public-api/v1/controllers/folders.public.controller.js.map +1 -0
- package/dist/public-api/v1/controllers/index.d.ts +2 -0
- package/dist/public-api/v1/controllers/index.js +2 -0
- package/dist/public-api/v1/controllers/index.js.map +1 -1
- package/dist/public-api/v1/controllers/insights.public.controller.d.ts +9 -0
- package/dist/public-api/v1/controllers/insights.public.controller.js +69 -0
- package/dist/public-api/v1/controllers/insights.public.controller.js.map +1 -0
- package/dist/public-api/v1/controllers/node-type-policies.public.controller.d.ts +11 -5
- package/dist/public-api/v1/controllers/node-type-policies.public.controller.js +152 -4
- package/dist/public-api/v1/controllers/node-type-policies.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/promotions.public.controller.d.ts +5 -2
- package/dist/public-api/v1/controllers/promotions.public.controller.js +60 -4
- package/dist/public-api/v1/controllers/promotions.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/roles.public.controller.js +1 -0
- package/dist/public-api/v1/controllers/roles.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/tags.public.controller.d.ts +3 -1
- package/dist/public-api/v1/controllers/tags.public.controller.js +61 -0
- package/dist/public-api/v1/controllers/tags.public.controller.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.utils.d.ts +3 -3
- package/dist/public-api/v1/handlers/credentials/credentials.utils.js +1 -6
- package/dist/public-api/v1/handlers/credentials/credentials.utils.js.map +1 -1
- package/dist/public-api/v1/handlers/folders/folders.handler.d.ts +0 -7
- package/dist/public-api/v1/handlers/folders/folders.handler.js +0 -29
- package/dist/public-api/v1/handlers/folders/folders.handler.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +4051 -2008
- package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +1 -1
- package/dist/public-api/v1/shared/middlewares/global.middleware.js +4 -3
- package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
- package/dist/requests.d.ts +1 -0
- package/dist/scaling/constants.d.ts +2 -0
- package/dist/scaling/constants.js +4 -1
- package/dist/scaling/constants.js.map +1 -1
- package/dist/scaling/pubsub/subscriber.service.d.ts +5 -0
- package/dist/scaling/pubsub/subscriber.service.js +47 -0
- package/dist/scaling/pubsub/subscriber.service.js.map +1 -1
- package/dist/scheduling/durable-job-provisioner.d.ts +10 -1
- package/dist/scheduling/durable-job-provisioner.js +26 -9
- package/dist/scheduling/durable-job-provisioner.js.map +1 -1
- package/dist/scheduling/durable-scheduler.d.ts +2 -1
- package/dist/scheduling/durable-scheduler.js +4 -3
- package/dist/scheduling/durable-scheduler.js.map +1 -1
- package/dist/scheduling/scheduled-job-owner-registry.d.ts +2 -1
- package/dist/scheduling/scheduled-job-owner-registry.js +2 -1
- package/dist/scheduling/scheduled-job-owner-registry.js.map +1 -1
- package/dist/scheduling/system-tasks/emit-system-task-metric.d.ts +3 -0
- package/dist/scheduling/system-tasks/emit-system-task-metric.js +11 -0
- package/dist/scheduling/system-tasks/emit-system-task-metric.js.map +1 -0
- package/dist/scheduling/system-tasks/system-task-handler.d.ts +5 -1
- package/dist/scheduling/system-tasks/system-task-handler.js +9 -8
- package/dist/scheduling/system-tasks/system-task-handler.js.map +1 -1
- package/dist/scheduling/system-tasks/system-task-job-registrar.d.ts +28 -0
- package/dist/scheduling/system-tasks/system-task-job-registrar.js +130 -0
- package/dist/scheduling/system-tasks/system-task-job-registrar.js.map +1 -0
- package/dist/scheduling/system-tasks/system-task-run-observer.d.ts +13 -0
- package/dist/scheduling/system-tasks/system-task-run-observer.js +54 -0
- package/dist/scheduling/system-tasks/system-task-run-observer.js.map +1 -0
- package/dist/scheduling/system-tasks/system-task-runner.d.ts +13 -3
- package/dist/scheduling/system-tasks/system-task-runner.js +85 -15
- package/dist/scheduling/system-tasks/system-task-runner.js.map +1 -1
- package/dist/scheduling/system-tasks/system-task-scheduled-job-owner.d.ts +13 -0
- package/dist/scheduling/system-tasks/system-task-scheduled-job-owner.js +51 -0
- package/dist/scheduling/system-tasks/system-task-scheduled-job-owner.js.map +1 -0
- package/dist/scheduling/system-tasks/system-task-timer.d.ts +3 -1
- package/dist/scheduling/system-tasks/system-task-timer.js +33 -9
- package/dist/scheduling/system-tasks/system-task-timer.js.map +1 -1
- package/dist/scheduling/system-tasks/system-task-version-stamp.d.ts +5 -0
- package/dist/scheduling/system-tasks/system-task-version-stamp.js +14 -0
- package/dist/scheduling/system-tasks/system-task-version-stamp.js.map +1 -0
- package/dist/server.d.ts +0 -1
- package/dist/server.js +4 -2
- package/dist/server.js.map +1 -1
- package/dist/services/ai-gateway.service.d.ts +2 -1
- package/dist/services/ai-gateway.service.js +7 -4
- package/dist/services/ai-gateway.service.js.map +1 -1
- package/dist/services/ai-preference.service.d.ts +29 -5
- package/dist/services/ai-preference.service.js +119 -20
- package/dist/services/ai-preference.service.js.map +1 -1
- package/dist/services/credentials-tester.service.js +12 -0
- package/dist/services/credentials-tester.service.js.map +1 -1
- package/dist/services/engine-data-plane-proxy.service.d.ts +3 -1
- package/dist/services/engine-data-plane-proxy.service.js +5 -0
- package/dist/services/engine-data-plane-proxy.service.js.map +1 -1
- package/dist/services/free-ai-credits.service.d.ts +1 -0
- package/dist/services/frontend.service.js +2 -1
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/protected-resource.registry.d.ts +2 -1
- package/dist/services/protected-resource.registry.js.map +1 -1
- package/dist/services/role.service.js +5 -4
- package/dist/services/role.service.js.map +1 -1
- package/dist/utils/strapi-utils.d.ts +1 -0
- package/dist/utils/strapi-utils.js.map +1 -1
- package/dist/wait-tracker.d.ts +5 -0
- package/dist/wait-tracker.js +130 -20
- package/dist/wait-tracker.js.map +1 -1
- package/dist/webhooks/live-webhooks.js +2 -2
- package/dist/webhooks/live-webhooks.js.map +1 -1
- package/dist/webhooks/test-webhook-registrations.service.d.ts +3 -1
- package/dist/webhooks/test-webhook-registrations.service.js +24 -11
- package/dist/webhooks/test-webhook-registrations.service.js.map +1 -1
- package/dist/webhooks/test-webhooks.d.ts +1 -0
- package/dist/webhooks/test-webhooks.js +9 -4
- package/dist/webhooks/test-webhooks.js.map +1 -1
- package/dist/webhooks/webhook-helpers.d.ts +1 -1
- package/dist/webhooks/webhook-helpers.js +113 -92
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/workflow-helpers.d.ts +1 -1
- package/dist/workflow-helpers.js +10 -3
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-runner.js +104 -7
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +1 -1
- package/package.json +42 -36
- package/dist/controllers/instance-ai-examples.controller.d.ts +0 -31
- package/dist/controllers/instance-ai-examples.controller.js +0 -104
- package/dist/controllers/instance-ai-examples.controller.js.map +0 -1
- package/dist/instance-ai-examples.data.json +0 -277957
- package/dist/public-api/v1/handlers/credentials/credentials.handler.d.ts +0 -8
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js +0 -45
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +0 -1
- package/dist/public-api/v1/handlers/insights/insights.handler.d.ts +0 -7
- package/dist/public-api/v1/handlers/insights/insights.handler.js +0 -62
- package/dist/public-api/v1/handlers/insights/insights.handler.js.map +0 -1
- package/dist/public-api/v1/handlers/tags/tags.handler.d.ts +0 -8
- package/dist/public-api/v1/handlers/tags/tags.handler.js +0 -46
- package/dist/public-api/v1/handlers/tags/tags.handler.js.map +0 -1
|
@@ -25,7 +25,9 @@ const agent_runtime_cache_service_1 = require("./agent-runtime-cache.service");
|
|
|
25
25
|
const agent_sandbox_principal_1 = require("./agent-sandbox-principal");
|
|
26
26
|
const agent_sandbox_runtime_service_1 = require("./agent-sandbox-runtime.service");
|
|
27
27
|
const agent_telemetry_1 = require("./agent-telemetry");
|
|
28
|
-
const
|
|
28
|
+
const agent_turn_execution_service_1 = require("./agent-turn-execution.service");
|
|
29
|
+
const agent_execution_recording_error_1 = require("./agent-execution-recording.error");
|
|
30
|
+
const integration_message_context_1 = require("./integrations/integration-message-context");
|
|
29
31
|
const integration_message_context_service_1 = require("./integrations/integration-message-context.service");
|
|
30
32
|
const n8n_checkpoint_storage_1 = require("./integrations/n8n-checkpoint-storage");
|
|
31
33
|
const model_stream_stall_options_1 = require("./model-stream-stall-options");
|
|
@@ -33,42 +35,7 @@ const agent_repository_1 = require("./repositories/agent.repository");
|
|
|
33
35
|
const agent_execution_counter_1 = require("./utils/agent-execution-counter");
|
|
34
36
|
const agent_published_snapshot_1 = require("./utils/agent-published-snapshot");
|
|
35
37
|
const inbound_attachments_1 = require("./utils/inbound-attachments");
|
|
36
|
-
const agent_stream_1 = require("./utils/agent-stream");
|
|
37
|
-
const mcp_attribution_1 = require("./utils/mcp-attribution");
|
|
38
38
|
const execution_to_message_mapper_1 = require("./utils/execution-to-message-mapper");
|
|
39
|
-
function withApprovalToolDetails(chunk, toolRegistry) {
|
|
40
|
-
if (chunk.type !== 'tool-call-suspended' || !(0, is_record_1.isRecord)(chunk.suspendPayload))
|
|
41
|
-
return chunk;
|
|
42
|
-
if (chunk.suspendPayload.type !== 'approval')
|
|
43
|
-
return chunk;
|
|
44
|
-
const toolName = chunk.suspendPayload.toolName;
|
|
45
|
-
if (typeof toolName !== 'string' || toolName.length === 0)
|
|
46
|
-
return chunk;
|
|
47
|
-
return {
|
|
48
|
-
...chunk,
|
|
49
|
-
suspendPayload: {
|
|
50
|
-
...chunk.suspendPayload,
|
|
51
|
-
details: (0, execution_recorder_1.buildToolCallDetails)(toolRegistry, toolName, chunk.suspendPayload.args),
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function getMaxIterationsChunks() {
|
|
56
|
-
const id = crypto.randomUUID();
|
|
57
|
-
return [
|
|
58
|
-
{ type: 'text-start', id },
|
|
59
|
-
{
|
|
60
|
-
type: 'text-delta',
|
|
61
|
-
id,
|
|
62
|
-
delta: 'The agent has reached the maximum number of iterations and has stopped.',
|
|
63
|
-
},
|
|
64
|
-
{ type: 'text-end', id },
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
function normalizeAbortedMessageRecord(record, abortSignal) {
|
|
68
|
-
if (!abortSignal?.aborted)
|
|
69
|
-
return record;
|
|
70
|
-
return { ...record, finishReason: 'cancelled', error: null };
|
|
71
|
-
}
|
|
72
39
|
function getDelegatedChildCheckpoints(checkpoint, parentAgentId) {
|
|
73
40
|
const childCheckpoints = [];
|
|
74
41
|
const seen = new Set();
|
|
@@ -109,10 +76,11 @@ function getDelegatedChildCheckpoints(checkpoint, parentAgentId) {
|
|
|
109
76
|
return childCheckpoints;
|
|
110
77
|
}
|
|
111
78
|
let AgentExecutionOrchestratorService = class AgentExecutionOrchestratorService {
|
|
112
|
-
constructor(logger, n8nCheckpointStorage, agentExecutionService, telemetry, runtimeCacheService, integrationMessageContextService, agentRunTracingService, externalHooks, agentSandboxRuntimeService, agentRepository, aiConfig) {
|
|
79
|
+
constructor(logger, n8nCheckpointStorage, agentExecutionService, turnExecutionService, telemetry, runtimeCacheService, integrationMessageContextService, agentRunTracingService, externalHooks, agentSandboxRuntimeService, agentRepository, aiConfig) {
|
|
113
80
|
this.logger = logger;
|
|
114
81
|
this.n8nCheckpointStorage = n8nCheckpointStorage;
|
|
115
82
|
this.agentExecutionService = agentExecutionService;
|
|
83
|
+
this.turnExecutionService = turnExecutionService;
|
|
116
84
|
this.telemetry = telemetry;
|
|
117
85
|
this.runtimeCacheService = runtimeCacheService;
|
|
118
86
|
this.integrationMessageContextService = integrationMessageContextService;
|
|
@@ -150,8 +118,8 @@ let AgentExecutionOrchestratorService = class AgentExecutionOrchestratorService
|
|
|
150
118
|
await this.n8nCheckpointStorage.delete(params.runId, params.agentId);
|
|
151
119
|
return true;
|
|
152
120
|
}
|
|
153
|
-
async
|
|
154
|
-
const { agentId, projectId, runId,
|
|
121
|
+
async loadResumeCheckpoint(params) {
|
|
122
|
+
const { agentId, projectId, runId, expectedMemory, user, usePublishedVersion } = params;
|
|
155
123
|
const checkpointStatus = await this.n8nCheckpointStorage.getStatus(runId, agentId);
|
|
156
124
|
if (checkpointStatus.status === 'expired') {
|
|
157
125
|
throw new n8n_workflow_1.UserError(`Checkpoint ${runId} is expired and cannot be resumed`);
|
|
@@ -184,8 +152,20 @@ let AgentExecutionOrchestratorService = class AgentExecutionOrchestratorService
|
|
|
184
152
|
(0, agent_sandbox_principal_1.hashAgentSandboxPrincipal)({ type: 'n8n-user', userId: user.id }))))) {
|
|
185
153
|
throw new n8n_workflow_1.UserError(`Checkpoint ${runId} is unavailable and cannot be resumed`);
|
|
186
154
|
}
|
|
155
|
+
return { memoryScope, sandboxPrincipalHash };
|
|
156
|
+
}
|
|
157
|
+
async *resumeForChat(config) {
|
|
158
|
+
const { agentId, projectId, runId, toolCallId, resumeData, expectedMemory, source, integrationType, user, usePublishedVersion = true, onExecutionRecorded, abortSignal, } = config;
|
|
159
|
+
const { memoryScope, sandboxPrincipalHash } = await this.loadResumeCheckpoint({
|
|
160
|
+
agentId,
|
|
161
|
+
projectId,
|
|
162
|
+
runId,
|
|
163
|
+
expectedMemory,
|
|
164
|
+
user,
|
|
165
|
+
usePublishedVersion,
|
|
166
|
+
});
|
|
187
167
|
const threadId = memoryScope.threadId;
|
|
188
|
-
|
|
168
|
+
yield* this.withRuntimeLease(async () => await this.getRuntimeOrRecordFailure({
|
|
189
169
|
agentId,
|
|
190
170
|
projectId,
|
|
191
171
|
usePublishedVersion,
|
|
@@ -193,113 +173,78 @@ let AgentExecutionOrchestratorService = class AgentExecutionOrchestratorService
|
|
|
193
173
|
user: usePublishedVersion ? undefined : user,
|
|
194
174
|
...(sandboxPrincipalHash ? { sandboxPrincipalHash } : {}),
|
|
195
175
|
previewChat: config.previewChat,
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
this.runtimeCacheService.releaseRuntimeLease(agentInstance);
|
|
215
|
-
throw error;
|
|
216
|
-
}
|
|
217
|
-
try {
|
|
218
|
-
const suspendedExecution = this.agentRunTracingService.enabled && source === undefined
|
|
219
|
-
? await this.agentExecutionService.findLatestSuspendedRun(threadId)
|
|
220
|
-
: undefined;
|
|
221
|
-
executionSource ??= suspendedExecution?.source ?? undefined;
|
|
222
|
-
const tracing = await this.agentRunTracingService.build({
|
|
223
|
-
agentId,
|
|
224
|
-
projectId,
|
|
225
|
-
threadId,
|
|
226
|
-
userId: user?.id,
|
|
227
|
-
source: executionSource ?? 'unknown',
|
|
228
|
-
modelId: (0, agent_run_tracing_service_1.modelIdFromSnapshot)(agentInstance.snapshot.model),
|
|
229
|
-
});
|
|
230
|
-
const resultStream = await agentInstance.resume('stream', resumeData, {
|
|
231
|
-
runId,
|
|
232
|
-
toolCallId,
|
|
233
|
-
executionCounter: (0, agent_execution_counter_1.createAgentExecutionCounter)(this.telemetry, {
|
|
176
|
+
}, { threadId, userMessage: null, source, onExecutionRecorded, abortSignal }), (runtime) => this.turnExecutionService.execute({
|
|
177
|
+
agentInstance: runtime.agent,
|
|
178
|
+
toolRegistry: runtime.toolRegistry,
|
|
179
|
+
mcpServerAttributions: runtime.mcpServerAttributions,
|
|
180
|
+
context: { projectId, agentId, threadId },
|
|
181
|
+
includeHitlToolDetails: !usePublishedVersion,
|
|
182
|
+
onExecutionRecorded,
|
|
183
|
+
onSettled: async (suspended) => {
|
|
184
|
+
if (!suspended)
|
|
185
|
+
await this.requestPendingBackgroundWake(threadId);
|
|
186
|
+
},
|
|
187
|
+
prepare: async () => {
|
|
188
|
+
const suspendedExecution = this.agentRunTracingService.enabled && source === undefined
|
|
189
|
+
? await this.agentExecutionService.findLatestSuspendedRun(threadId)
|
|
190
|
+
: undefined;
|
|
191
|
+
const executionSource = source ?? suspendedExecution?.source ?? undefined;
|
|
192
|
+
const runType = usePublishedVersion ? 'production' : 'test';
|
|
193
|
+
const tracing = await this.agentRunTracingService.build({
|
|
234
194
|
agentId,
|
|
195
|
+
projectId,
|
|
196
|
+
threadId,
|
|
235
197
|
userId: user?.id,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
const startParams = {
|
|
244
|
-
threadId,
|
|
245
|
-
agentId,
|
|
246
|
-
agentName: agentInstance.name,
|
|
247
|
-
projectId,
|
|
248
|
-
userMessage: null,
|
|
249
|
-
...(executionSource !== undefined ? { source: executionSource } : {}),
|
|
250
|
-
telemetry: {
|
|
251
|
-
userId: user?.id,
|
|
252
|
-
runType,
|
|
253
|
-
configuration: runtime.telemetryConfiguration,
|
|
254
|
-
},
|
|
255
|
-
};
|
|
256
|
-
executionId = await this.tryStartExecution(startParams, startedAt, 'Failed to start resumed agent execution recording');
|
|
257
|
-
const attributionTracker = (0, mcp_attribution_1.createAttributionTracker)(runtime.mcpServerAttributions);
|
|
258
|
-
for await (const value of (0, agent_stream_1.streamAgentChunks)(resultStream.stream)) {
|
|
259
|
-
const chunk = usePublishedVersion ? value : withApprovalToolDetails(value, toolRegistry);
|
|
260
|
-
recorder.record(chunk);
|
|
261
|
-
for (const attributionChunk of attributionTracker.observe(chunk)) {
|
|
262
|
-
recorder.record(attributionChunk);
|
|
263
|
-
yield attributionChunk;
|
|
198
|
+
source: executionSource ?? 'unknown',
|
|
199
|
+
modelId: (0, agent_run_tracing_service_1.modelIdFromSnapshot)(runtime.agent.snapshot.model),
|
|
200
|
+
});
|
|
201
|
+
let messageContext = config.messageContext;
|
|
202
|
+
if (messageContext === undefined) {
|
|
203
|
+
messageContext =
|
|
204
|
+
await this.integrationMessageContextService.getForResume(memoryScope);
|
|
264
205
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
206
|
+
else if (messageContext && config.contextConversation) {
|
|
207
|
+
messageContext = (0, integration_message_context_1.inheritIntegrationMessageContext)(messageContext, await this.integrationMessageContextService.getForResume(memoryScope));
|
|
208
|
+
}
|
|
209
|
+
const selectedContext = messageContext;
|
|
210
|
+
const conversation = config.contextConversation;
|
|
211
|
+
return {
|
|
212
|
+
type: 'resume',
|
|
213
|
+
resumeData,
|
|
214
|
+
options: {
|
|
215
|
+
runId,
|
|
216
|
+
toolCallId,
|
|
217
|
+
hostMetadata: (0, integration_message_context_1.encodeIntegrationMessageContext)(selectedContext),
|
|
218
|
+
...(selectedContext && conversation
|
|
219
|
+
? {
|
|
220
|
+
onResumeClaimed: async () => await this.integrationMessageContextService.installIncoming(selectedContext, memoryScope, conversation),
|
|
221
|
+
}
|
|
222
|
+
: {}),
|
|
223
|
+
executionCounter: (0, agent_execution_counter_1.createAgentExecutionCounter)(this.telemetry, {
|
|
224
|
+
agentId,
|
|
225
|
+
userId: user?.id,
|
|
226
|
+
runType,
|
|
227
|
+
}),
|
|
228
|
+
...(0, model_stream_stall_options_1.modelStreamStallOptions)(this.aiConfig),
|
|
229
|
+
...(tracing ? { telemetry: tracing } : {}),
|
|
230
|
+
...(abortSignal ? { abortSignal } : {}),
|
|
231
|
+
},
|
|
232
|
+
recording: {
|
|
281
233
|
threadId,
|
|
282
234
|
agentId,
|
|
283
|
-
agentName:
|
|
235
|
+
agentName: runtime.agent.name,
|
|
284
236
|
projectId,
|
|
285
237
|
userMessage: null,
|
|
286
238
|
...(executionSource !== undefined ? { source: executionSource } : {}),
|
|
287
|
-
record: messageRecord,
|
|
288
|
-
hitlStatus: recorder.suspended ? 'suspended' : 'resumed',
|
|
289
239
|
telemetry: {
|
|
290
240
|
userId: user?.id,
|
|
291
241
|
runType,
|
|
292
242
|
configuration: runtime.telemetryConfiguration,
|
|
293
243
|
},
|
|
294
244
|
},
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
299
|
-
finally {
|
|
300
|
-
this.runtimeCacheService.releaseRuntimeLease(agentInstance);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
245
|
+
};
|
|
246
|
+
},
|
|
247
|
+
}));
|
|
303
248
|
}
|
|
304
249
|
async *executeForChat(config) {
|
|
305
250
|
const { agentId, projectId, message, user, memory, attachments, source, previewChat, onExecutionRecorded, abortSignal, } = config;
|
|
@@ -307,23 +252,31 @@ let AgentExecutionOrchestratorService = class AgentExecutionOrchestratorService
|
|
|
307
252
|
type: 'n8n-user',
|
|
308
253
|
userId: user.id,
|
|
309
254
|
});
|
|
310
|
-
|
|
255
|
+
yield* this.withRuntimeLease(async () => await this.getRuntimeOrRecordFailure({
|
|
311
256
|
agentId,
|
|
312
257
|
projectId,
|
|
313
258
|
integrationType: api_types_1.N8N_CHAT_INTEGRATION_TYPE,
|
|
314
259
|
user,
|
|
315
260
|
sandboxPrincipalHash,
|
|
316
261
|
previewChat,
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
|
|
262
|
+
}, {
|
|
263
|
+
threadId: memory.threadId,
|
|
264
|
+
userMessage: message,
|
|
265
|
+
attachments,
|
|
266
|
+
source,
|
|
267
|
+
onExecutionRecorded,
|
|
268
|
+
abortSignal,
|
|
269
|
+
}), async (runtime) => {
|
|
270
|
+
const messageContext = {
|
|
320
271
|
integrationConnectionId: api_types_1.N8N_CHAT_INTEGRATION_TYPE,
|
|
321
272
|
platform: api_types_1.N8N_CHAT_INTEGRATION_TYPE,
|
|
322
273
|
target: { type: 'dm', userId: user.id, threadId: memory.threadId },
|
|
323
274
|
interactingUserId: user.id,
|
|
324
275
|
updatedAt: new Date().toISOString(),
|
|
325
|
-
}
|
|
326
|
-
|
|
276
|
+
};
|
|
277
|
+
await this.integrationMessageContextService.setLatest(memory.threadId, memory.resourceId, messageContext);
|
|
278
|
+
return this.streamChatResponse({
|
|
279
|
+
messageContext,
|
|
327
280
|
agentInstance: runtime.agent,
|
|
328
281
|
toolRegistry: runtime.toolRegistry,
|
|
329
282
|
mcpServerAttributions: runtime.mcpServerAttributions,
|
|
@@ -343,15 +296,12 @@ let AgentExecutionOrchestratorService = class AgentExecutionOrchestratorService
|
|
|
343
296
|
includeHitlToolDetails: true,
|
|
344
297
|
sandboxPrincipalHash,
|
|
345
298
|
});
|
|
346
|
-
}
|
|
347
|
-
finally {
|
|
348
|
-
this.runtimeCacheService.releaseRuntimeLease(runtime.agent);
|
|
349
|
-
}
|
|
299
|
+
});
|
|
350
300
|
}
|
|
351
301
|
async *executeForChatPublished(config) {
|
|
352
302
|
const { agentId, projectId, message, modelMessage, author, memory, integrationType, attachments, sandboxPrincipalHash, } = config;
|
|
353
303
|
await this.externalHooks.run('agent.preExecute', [agentId]);
|
|
354
|
-
|
|
304
|
+
yield* this.withRuntimeLease(async () => await this.getRuntimeOrRecordFailure({
|
|
355
305
|
agentId,
|
|
356
306
|
projectId,
|
|
357
307
|
integrationType,
|
|
@@ -363,9 +313,14 @@ let AgentExecutionOrchestratorService = class AgentExecutionOrchestratorService
|
|
|
363
313
|
author,
|
|
364
314
|
attachments,
|
|
365
315
|
source: integrationType,
|
|
366
|
-
})
|
|
367
|
-
|
|
368
|
-
|
|
316
|
+
}), async (runtime) => {
|
|
317
|
+
let messageContext = config.messageContext;
|
|
318
|
+
if (messageContext && config.contextConversation) {
|
|
319
|
+
messageContext = (0, integration_message_context_1.inheritIntegrationMessageContext)(messageContext, await this.integrationMessageContextService.getLatestForIncoming(memory.threadId));
|
|
320
|
+
await this.integrationMessageContextService.installIncoming(messageContext, memory, config.contextConversation);
|
|
321
|
+
}
|
|
322
|
+
return this.streamChatResponse({
|
|
323
|
+
messageContext,
|
|
369
324
|
agentInstance: runtime.agent,
|
|
370
325
|
toolRegistry: runtime.toolRegistry,
|
|
371
326
|
mcpServerAttributions: runtime.mcpServerAttributions,
|
|
@@ -383,45 +338,42 @@ let AgentExecutionOrchestratorService = class AgentExecutionOrchestratorService
|
|
|
383
338
|
},
|
|
384
339
|
sandboxPrincipalHash,
|
|
385
340
|
});
|
|
386
|
-
}
|
|
387
|
-
finally {
|
|
388
|
-
this.runtimeCacheService.releaseRuntimeLease(runtime.agent);
|
|
389
|
-
}
|
|
341
|
+
});
|
|
390
342
|
}
|
|
391
343
|
async *executeForTaskPublished(config) {
|
|
392
344
|
const { agentId, projectId, message, memory, taskId, taskVersionId } = config;
|
|
393
345
|
await this.externalHooks.run('agent.preExecute', [agentId]);
|
|
394
346
|
const sandboxPrincipalHash = (0, agent_sandbox_principal_1.hashAgentSandboxPrincipal)({ type: 'scheduled-task', taskId });
|
|
395
|
-
|
|
347
|
+
yield* this.withRuntimeLease(async () => await this.getRuntimeOrRecordFailure({
|
|
396
348
|
agentId,
|
|
397
349
|
projectId,
|
|
398
350
|
integrationType: 'task',
|
|
399
351
|
usePublishedVersion: true,
|
|
400
352
|
sandboxPrincipalHash,
|
|
401
353
|
allowBackgroundTasks: false,
|
|
402
|
-
}, {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}
|
|
354
|
+
}, {
|
|
355
|
+
threadId: memory.threadId,
|
|
356
|
+
userMessage: message,
|
|
357
|
+
source: 'task',
|
|
358
|
+
taskId,
|
|
359
|
+
taskVersionId,
|
|
360
|
+
}), (runtime) => this.streamChatResponse({
|
|
361
|
+
agentInstance: runtime.agent,
|
|
362
|
+
toolRegistry: runtime.toolRegistry,
|
|
363
|
+
mcpServerAttributions: runtime.mcpServerAttributions,
|
|
364
|
+
agentId,
|
|
365
|
+
message,
|
|
366
|
+
memory,
|
|
367
|
+
projectId: runtime.projectId,
|
|
368
|
+
source: 'task',
|
|
369
|
+
taskId,
|
|
370
|
+
taskVersionId,
|
|
371
|
+
telemetry: {
|
|
372
|
+
runType: 'production',
|
|
373
|
+
configuration: runtime.telemetryConfiguration,
|
|
374
|
+
},
|
|
375
|
+
sandboxPrincipalHash,
|
|
376
|
+
}));
|
|
425
377
|
}
|
|
426
378
|
async *executeForTaskNow(config) {
|
|
427
379
|
const { agentId, projectId, user, message, memory, taskId } = config;
|
|
@@ -429,35 +381,29 @@ let AgentExecutionOrchestratorService = class AgentExecutionOrchestratorService
|
|
|
429
381
|
type: 'n8n-user',
|
|
430
382
|
userId: user.id,
|
|
431
383
|
});
|
|
432
|
-
|
|
384
|
+
yield* this.withRuntimeLease(async () => await this.getRuntimeOrRecordFailure({
|
|
433
385
|
agentId,
|
|
434
386
|
projectId,
|
|
435
387
|
user,
|
|
436
388
|
sandboxPrincipalHash,
|
|
437
389
|
allowBackgroundTasks: false,
|
|
438
|
-
})
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
sandboxPrincipalHash,
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
finally {
|
|
459
|
-
this.runtimeCacheService.releaseRuntimeLease(runtime.agent);
|
|
460
|
-
}
|
|
390
|
+
}, { threadId: memory.threadId, userMessage: message, source: 'task', taskId }), (runtime) => this.streamChatResponse({
|
|
391
|
+
agentInstance: runtime.agent,
|
|
392
|
+
toolRegistry: runtime.toolRegistry,
|
|
393
|
+
mcpServerAttributions: runtime.mcpServerAttributions,
|
|
394
|
+
agentId,
|
|
395
|
+
userId: user.id,
|
|
396
|
+
message,
|
|
397
|
+
memory,
|
|
398
|
+
projectId: runtime.projectId,
|
|
399
|
+
source: 'task',
|
|
400
|
+
taskId,
|
|
401
|
+
telemetry: {
|
|
402
|
+
runType: 'test',
|
|
403
|
+
configuration: runtime.telemetryConfiguration,
|
|
404
|
+
},
|
|
405
|
+
sandboxPrincipalHash,
|
|
406
|
+
}));
|
|
461
407
|
}
|
|
462
408
|
async executeForWake(config) {
|
|
463
409
|
const { agentId, projectId, message, memory, identity, abortSignal } = config;
|
|
@@ -465,64 +411,62 @@ let AgentExecutionOrchestratorService = class AgentExecutionOrchestratorService
|
|
|
465
411
|
if (!isDraft)
|
|
466
412
|
await this.externalHooks.run('agent.preExecute', [agentId]);
|
|
467
413
|
const integrationType = isDraft ? api_types_1.N8N_CHAT_INTEGRATION_TYPE : identity.integrationType;
|
|
414
|
+
const messageContext = await this.integrationMessageContextService.getLatest(memory.threadId);
|
|
468
415
|
const delivery = isDraft
|
|
469
416
|
? undefined
|
|
470
|
-
: await this.getWakeDelivery(agentId, integrationType,
|
|
471
|
-
const
|
|
417
|
+
: await this.getWakeDelivery(agentId, integrationType, messageContext);
|
|
418
|
+
const stream = this.withRuntimeLease(async () => await this.getRuntimeOrRecordFailure({
|
|
472
419
|
agentId,
|
|
473
420
|
projectId,
|
|
474
421
|
integrationType,
|
|
475
422
|
usePublishedVersion: !isDraft,
|
|
476
423
|
...(isDraft ? { user: identity.user } : {}),
|
|
477
424
|
sandboxPrincipalHash: identity.principalHash,
|
|
478
|
-
})
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
const chunks = [];
|
|
502
|
-
let runError;
|
|
503
|
-
for await (const chunk of stream) {
|
|
504
|
-
if (delivery)
|
|
505
|
-
chunks.push(chunk);
|
|
506
|
-
if (chunk.type === 'error')
|
|
507
|
-
runError = chunk.error;
|
|
508
|
-
if (chunk.type === 'finish' && chunk.finishReason === 'error')
|
|
509
|
-
runError ??= chunk;
|
|
510
|
-
}
|
|
511
|
-
if (runError !== undefined) {
|
|
512
|
-
throw new n8n_workflow_1.OperationalError('Background job wake failed', {
|
|
513
|
-
cause: runError,
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
abortSignal.throwIfAborted();
|
|
517
|
-
if (delivery)
|
|
518
|
-
await delivery.bridge.deliverWakeResponse(delivery.threadId, chunks);
|
|
519
|
-
}
|
|
520
|
-
finally {
|
|
521
|
-
this.runtimeCacheService.releaseRuntimeLease(runtime.agent);
|
|
425
|
+
}, { threadId: memory.threadId, userMessage: null, source: integrationType, abortSignal }), (runtime) => this.streamWakeResponse(this.streamChatResponse({
|
|
426
|
+
messageContext,
|
|
427
|
+
agentInstance: runtime.agent,
|
|
428
|
+
toolRegistry: runtime.toolRegistry,
|
|
429
|
+
mcpServerAttributions: runtime.mcpServerAttributions,
|
|
430
|
+
agentId,
|
|
431
|
+
...(isDraft ? { userId: identity.user.id } : {}),
|
|
432
|
+
message,
|
|
433
|
+
memory,
|
|
434
|
+
projectId: runtime.projectId,
|
|
435
|
+
source: integrationType,
|
|
436
|
+
telemetry: {
|
|
437
|
+
runType: isDraft ? 'test' : 'production',
|
|
438
|
+
configuration: runtime.telemetryConfiguration,
|
|
439
|
+
},
|
|
440
|
+
abortSignal,
|
|
441
|
+
includeHitlToolDetails: isDraft,
|
|
442
|
+
sandboxPrincipalHash: identity.principalHash,
|
|
443
|
+
hideUserMessageFromTranscript: true,
|
|
444
|
+
isWakeRun: true,
|
|
445
|
+
backgroundJobSignal: config.backgroundJobSignal,
|
|
446
|
+
}), abortSignal, delivery));
|
|
447
|
+
for await (const _chunk of stream) {
|
|
522
448
|
}
|
|
523
449
|
}
|
|
524
|
-
async
|
|
525
|
-
const
|
|
450
|
+
async *streamWakeResponse(stream, abortSignal, delivery) {
|
|
451
|
+
const chunks = [];
|
|
452
|
+
let runError;
|
|
453
|
+
for await (const chunk of stream) {
|
|
454
|
+
if (delivery)
|
|
455
|
+
chunks.push(chunk);
|
|
456
|
+
if (chunk.type === 'error')
|
|
457
|
+
runError = chunk.error;
|
|
458
|
+
if (chunk.type === 'finish' && chunk.finishReason === 'error')
|
|
459
|
+
runError ??= chunk;
|
|
460
|
+
yield chunk;
|
|
461
|
+
}
|
|
462
|
+
if (runError !== undefined) {
|
|
463
|
+
throw new n8n_workflow_1.OperationalError('Background job wake failed', { cause: runError });
|
|
464
|
+
}
|
|
465
|
+
abortSignal.throwIfAborted();
|
|
466
|
+
if (delivery)
|
|
467
|
+
await delivery.bridge.deliverWakeResponse(delivery.threadId, chunks);
|
|
468
|
+
}
|
|
469
|
+
async getWakeDelivery(agentId, integrationType, context) {
|
|
526
470
|
const target = context?.replyTarget ?? context?.target;
|
|
527
471
|
const [platform, credentialId] = context?.integrationConnectionId.split(':') ?? [];
|
|
528
472
|
if (context?.platform !== integrationType ||
|
|
@@ -541,106 +485,77 @@ let AgentExecutionOrchestratorService = class AgentExecutionOrchestratorService
|
|
|
541
485
|
async *streamChatResponse(config) {
|
|
542
486
|
const { agentInstance, toolRegistry, mcpServerAttributions, agentId, userId, message, modelMessage = message, author, attachments, memory, projectId, source, taskId, taskVersionId, telemetry, onExecutionRecorded, abortSignal, includeHitlToolDetails, sandboxPrincipalHash, hideUserMessageFromTranscript, isWakeRun, backgroundJobSignal, } = config;
|
|
543
487
|
const { threadId, resourceId } = memory;
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
? (0, inbound_attachments_1.buildInboundUserMessage)(modelMessage, attachments)
|
|
558
|
-
: modelMessage;
|
|
559
|
-
const hostMetadata = (0, agent_sandbox_principal_1.encodeAgentSandboxHostMetadata)({
|
|
560
|
-
projectId,
|
|
561
|
-
principalHash: sandboxPrincipalHash,
|
|
562
|
-
});
|
|
563
|
-
const resultStream = await agentInstance.stream(input, {
|
|
564
|
-
persistence: { threadId, resourceId, hostMetadata },
|
|
565
|
-
executionCounter: (0, agent_execution_counter_1.createAgentExecutionCounter)(this.telemetry, {
|
|
488
|
+
yield* this.turnExecutionService.execute({
|
|
489
|
+
agentInstance,
|
|
490
|
+
toolRegistry,
|
|
491
|
+
mcpServerAttributions,
|
|
492
|
+
context: { projectId, agentId, threadId },
|
|
493
|
+
backgroundJobSignal,
|
|
494
|
+
includeHitlToolDetails,
|
|
495
|
+
onExecutionRecorded,
|
|
496
|
+
onSettled: isWakeRun
|
|
497
|
+
? undefined
|
|
498
|
+
: async () => await this.requestPendingBackgroundWake(threadId),
|
|
499
|
+
prepare: async () => {
|
|
500
|
+
const tracing = await this.agentRunTracingService.build({
|
|
566
501
|
agentId,
|
|
502
|
+
projectId,
|
|
503
|
+
threadId,
|
|
567
504
|
userId,
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
505
|
+
source: source ?? 'test',
|
|
506
|
+
modelId: (0, agent_run_tracing_service_1.modelIdFromSnapshot)(agentInstance.snapshot.model),
|
|
507
|
+
});
|
|
508
|
+
const input = attachments?.length
|
|
509
|
+
? (0, inbound_attachments_1.buildInboundUserMessage)(modelMessage, attachments)
|
|
510
|
+
: modelMessage;
|
|
511
|
+
const messageContext = config.messageContext === undefined
|
|
512
|
+
? await this.integrationMessageContextService.getLatest(threadId)
|
|
513
|
+
: config.messageContext;
|
|
514
|
+
const hostMetadata = {
|
|
515
|
+
...(0, agent_sandbox_principal_1.encodeAgentSandboxHostMetadata)({
|
|
516
|
+
projectId,
|
|
517
|
+
principalHash: sandboxPrincipalHash,
|
|
518
|
+
}),
|
|
519
|
+
...(0, integration_message_context_1.encodeIntegrationMessageContext)(messageContext),
|
|
520
|
+
};
|
|
521
|
+
return {
|
|
522
|
+
type: 'start',
|
|
523
|
+
input,
|
|
524
|
+
options: {
|
|
525
|
+
persistence: { threadId, resourceId, hostMetadata },
|
|
526
|
+
executionCounter: (0, agent_execution_counter_1.createAgentExecutionCounter)(this.telemetry, {
|
|
527
|
+
agentId,
|
|
528
|
+
userId,
|
|
529
|
+
runType: telemetry.runType,
|
|
530
|
+
}),
|
|
531
|
+
...(0, model_stream_stall_options_1.modelStreamStallOptions)(this.aiConfig),
|
|
532
|
+
...(tracing ? { telemetry: tracing } : {}),
|
|
533
|
+
...(abortSignal ? { abortSignal } : {}),
|
|
534
|
+
},
|
|
535
|
+
recording: {
|
|
536
|
+
threadId,
|
|
597
537
|
agentId,
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
recorder.record({ type: 'error', error });
|
|
617
|
-
recorder.record({ type: 'finish', finishReason: 'error' });
|
|
618
|
-
throw error;
|
|
538
|
+
agentName: agentInstance.name,
|
|
539
|
+
projectId,
|
|
540
|
+
userMessage: hideUserMessageFromTranscript ? null : message,
|
|
541
|
+
author,
|
|
542
|
+
attachments,
|
|
543
|
+
source,
|
|
544
|
+
taskId,
|
|
545
|
+
taskVersionId,
|
|
546
|
+
telemetry: { ...telemetry, userId },
|
|
547
|
+
},
|
|
548
|
+
};
|
|
549
|
+
},
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
async *withRuntimeLease(acquire, use) {
|
|
553
|
+
const runtime = await acquire();
|
|
554
|
+
try {
|
|
555
|
+
yield* await use(runtime);
|
|
619
556
|
}
|
|
620
557
|
finally {
|
|
621
|
-
|
|
622
|
-
await this.persistRecordedExecution({
|
|
623
|
-
executionId,
|
|
624
|
-
onExecutionRecorded,
|
|
625
|
-
failureMessage: 'Failed to record agent execution',
|
|
626
|
-
params: {
|
|
627
|
-
threadId,
|
|
628
|
-
agentId,
|
|
629
|
-
agentName: agentInstance.name,
|
|
630
|
-
projectId,
|
|
631
|
-
userMessage: hideUserMessageFromTranscript ? null : message,
|
|
632
|
-
author,
|
|
633
|
-
attachments,
|
|
634
|
-
record: messageRecord,
|
|
635
|
-
hitlStatus: recorder.suspended ? 'suspended' : undefined,
|
|
636
|
-
source,
|
|
637
|
-
taskId,
|
|
638
|
-
taskVersionId,
|
|
639
|
-
telemetry: { ...telemetry, userId },
|
|
640
|
-
},
|
|
641
|
-
});
|
|
642
|
-
if (!isWakeRun)
|
|
643
|
-
await this.requestPendingBackgroundWake(threadId);
|
|
558
|
+
this.runtimeCacheService.releaseRuntimeLease(runtime.agent);
|
|
644
559
|
}
|
|
645
560
|
}
|
|
646
561
|
async requestPendingBackgroundWake(threadId) {
|
|
@@ -652,94 +567,46 @@ let AgentExecutionOrchestratorService = class AgentExecutionOrchestratorService
|
|
|
652
567
|
this.logger.warn('Failed to request pending background job delivery', { threadId, error });
|
|
653
568
|
}
|
|
654
569
|
}
|
|
655
|
-
async
|
|
570
|
+
async getRuntimeOrRecordFailure(params, session) {
|
|
571
|
+
const { onExecutionRecorded, abortSignal, ...recording } = session;
|
|
572
|
+
abortSignal?.throwIfAborted();
|
|
656
573
|
try {
|
|
657
574
|
return await this.runtimeCacheService.getRuntime(params);
|
|
658
575
|
}
|
|
659
576
|
catch (error) {
|
|
577
|
+
abortSignal?.throwIfAborted();
|
|
578
|
+
const { agentId, projectId } = params;
|
|
579
|
+
let agent;
|
|
660
580
|
try {
|
|
661
|
-
await this.
|
|
581
|
+
agent = await this.agentRepository.findByIdAndProjectId(agentId, projectId);
|
|
662
582
|
}
|
|
663
|
-
catch (
|
|
664
|
-
|
|
665
|
-
agentId: params.agentId,
|
|
666
|
-
threadId: session.threadId,
|
|
667
|
-
error: recordError instanceof Error ? recordError.message : String(recordError),
|
|
668
|
-
});
|
|
583
|
+
catch (cause) {
|
|
584
|
+
throw new agent_execution_recording_error_1.AgentExecutionRecordingError({ phase: 'create', cause, executionError: error });
|
|
669
585
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
telemetry: {
|
|
687
|
-
runType: 'production',
|
|
688
|
-
configuration: (0, agent_telemetry_1.buildAgentConfigurationTelemetry)(published),
|
|
689
|
-
},
|
|
690
|
-
};
|
|
691
|
-
const executionId = await this.tryStartExecution(startParams, recorder.startedAt, 'Failed to start agent execution recording');
|
|
692
|
-
await this.persistRecordedExecution({
|
|
693
|
-
executionId,
|
|
694
|
-
params: { ...startParams, record: recorder.getMessageRecord() },
|
|
695
|
-
failureMessage: 'Failed to record agent execution',
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
createRecorder(toolRegistry, getExecutionId, context, backgroundJobSignal) {
|
|
699
|
-
return new execution_recorder_1.ExecutionRecorder(toolRegistry, (timeline) => {
|
|
700
|
-
const executionId = getExecutionId();
|
|
701
|
-
if (executionId) {
|
|
702
|
-
this.agentExecutionService.recordTimelineSnapshot({
|
|
703
|
-
...context,
|
|
704
|
-
executionId,
|
|
705
|
-
timeline,
|
|
706
|
-
});
|
|
586
|
+
abortSignal?.throwIfAborted();
|
|
587
|
+
if (agent) {
|
|
588
|
+
const selected = params.usePublishedVersion && agent.activeVersion?.schema
|
|
589
|
+
? (0, agent_published_snapshot_1.getPublishedAgentSnapshot)(agent)
|
|
590
|
+
: agent;
|
|
591
|
+
await this.turnExecutionService.recordFailedStart({
|
|
592
|
+
...recording,
|
|
593
|
+
agentId,
|
|
594
|
+
agentName: selected.schema?.name ?? agent.name,
|
|
595
|
+
projectId,
|
|
596
|
+
telemetry: {
|
|
597
|
+
userId: params.user?.id,
|
|
598
|
+
runType: params.usePublishedVersion ? 'production' : 'test',
|
|
599
|
+
configuration: (0, agent_telemetry_1.buildAgentConfigurationTelemetry)(selected),
|
|
600
|
+
},
|
|
601
|
+
}, error, onExecutionRecorded);
|
|
707
602
|
}
|
|
708
|
-
|
|
709
|
-
}
|
|
710
|
-
async tryStartExecution(params, startedAt, failureMessage) {
|
|
711
|
-
try {
|
|
712
|
-
return await this.agentExecutionService.startExecutionRecording(params, startedAt);
|
|
713
|
-
}
|
|
714
|
-
catch (error) {
|
|
715
|
-
this.logger.warn(failureMessage, {
|
|
716
|
-
agentId: params.agentId,
|
|
717
|
-
threadId: params.threadId,
|
|
718
|
-
error: error instanceof Error ? error.message : String(error),
|
|
719
|
-
});
|
|
720
|
-
return undefined;
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
async persistRecordedExecution(args) {
|
|
724
|
-
const { executionId, onExecutionRecorded, params, failureMessage } = args;
|
|
725
|
-
if (!executionId)
|
|
726
|
-
return;
|
|
727
|
-
try {
|
|
728
|
-
const recordedId = await this.agentExecutionService.finalizeExecution(executionId, params);
|
|
729
|
-
onExecutionRecorded?.(recordedId);
|
|
730
|
-
}
|
|
731
|
-
catch (error) {
|
|
732
|
-
this.logger.warn(failureMessage, {
|
|
733
|
-
agentId: params.agentId,
|
|
734
|
-
threadId: params.threadId,
|
|
735
|
-
error: error instanceof Error ? error.message : String(error),
|
|
736
|
-
});
|
|
603
|
+
throw error;
|
|
737
604
|
}
|
|
738
605
|
}
|
|
739
606
|
};
|
|
740
607
|
exports.AgentExecutionOrchestratorService = AgentExecutionOrchestratorService;
|
|
741
608
|
exports.AgentExecutionOrchestratorService = AgentExecutionOrchestratorService = __decorate([
|
|
742
609
|
(0, di_1.Service)(),
|
|
743
|
-
__metadata("design:paramtypes", [backend_common_1.Logger, n8n_checkpoint_storage_1.N8NCheckpointStorage, agent_execution_service_1.AgentExecutionService, telemetry_1.Telemetry, agent_runtime_cache_service_1.AgentRuntimeCacheService, integration_message_context_service_1.IntegrationMessageContextService, agent_run_tracing_service_1.AgentRunTracingService, external_hooks_1.ExternalHooks, agent_sandbox_runtime_service_1.AgentSandboxRuntimeService, agent_repository_1.AgentRepository, config_1.AiConfig])
|
|
610
|
+
__metadata("design:paramtypes", [backend_common_1.Logger, n8n_checkpoint_storage_1.N8NCheckpointStorage, agent_execution_service_1.AgentExecutionService, agent_turn_execution_service_1.AgentTurnExecutionService, telemetry_1.Telemetry, agent_runtime_cache_service_1.AgentRuntimeCacheService, integration_message_context_service_1.IntegrationMessageContextService, agent_run_tracing_service_1.AgentRunTracingService, external_hooks_1.ExternalHooks, agent_sandbox_runtime_service_1.AgentSandboxRuntimeService, agent_repository_1.AgentRepository, config_1.AiConfig])
|
|
744
611
|
], AgentExecutionOrchestratorService);
|
|
745
612
|
//# sourceMappingURL=agent-execution-orchestrator.service.js.map
|