n8n 2.33.2 → 2.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/active-executions.d.ts +2 -2
- package/dist/active-executions.js +18 -13
- package/dist/active-executions.js.map +1 -1
- package/dist/agent-library-bundle.js +158 -137
- package/dist/auth/auth.service.d.ts +1 -0
- package/dist/auth/auth.service.js +8 -1
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/chat/chat-execution-manager.js +8 -5
- package/dist/chat/chat-execution-manager.js.map +1 -1
- package/dist/commands/base-command.js +3 -2
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/import/workflow.js +1 -1
- package/dist/commands/import/workflow.js.map +1 -1
- package/dist/commands/start.d.ts +0 -1
- package/dist/commands/start.js +4 -32
- package/dist/commands/start.js.map +1 -1
- package/dist/constants/oauth2-triggers.d.ts +2 -0
- package/dist/constants/oauth2-triggers.js +11 -0
- package/dist/constants/oauth2-triggers.js.map +1 -0
- package/dist/controllers/api-keys.controller.js +0 -3
- package/dist/controllers/api-keys.controller.js.map +1 -1
- package/dist/controllers/e2e.controller.d.ts +7 -0
- package/dist/controllers/e2e.controller.js +12 -1
- package/dist/controllers/e2e.controller.js.map +1 -1
- package/dist/crash-journal.js +2 -2
- package/dist/crash-journal.js.map +1 -1
- package/dist/credentials/credentials.controller.d.ts +2 -0
- package/dist/credentials/credentials.controller.js +23 -4
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +5 -1
- package/dist/credentials/credentials.service.js +45 -8
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials-helper.d.ts +3 -1
- package/dist/credentials-helper.js +39 -1
- package/dist/credentials-helper.js.map +1 -1
- package/dist/credentials-overwrites.d.ts +2 -1
- package/dist/credentials-overwrites.js +4 -5
- package/dist/credentials-overwrites.js.map +1 -1
- package/dist/environments.ee/variables/variables.service.ee.d.ts +4 -0
- package/dist/environments.ee/variables/variables.service.ee.js +10 -6
- package/dist/environments.ee/variables/variables.service.ee.js.map +1 -1
- package/dist/errors/http-error-serializers.js +10 -1
- package/dist/errors/http-error-serializers.js.map +1 -1
- package/dist/errors/response-errors/workflow-publish-blocked.error.d.ts +6 -0
- package/dist/errors/response-errors/workflow-publish-blocked.error.js +19 -0
- package/dist/errors/response-errors/workflow-publish-blocked.error.js.map +1 -0
- package/dist/errors/webhook-response-too-large.error.d.ts +7 -0
- package/dist/errors/webhook-response-too-large.error.js +11 -0
- package/dist/errors/webhook-response-too-large.error.js.map +1 -0
- package/dist/eventbus/event-message-classes/event-message-mcp.d.ts +33 -0
- package/dist/eventbus/event-message-classes/event-message-mcp.js +29 -0
- package/dist/eventbus/event-message-classes/event-message-mcp.js.map +1 -0
- package/dist/eventbus/event-message-classes/index.d.ts +6 -3
- package/dist/eventbus/event-message-classes/index.js +7 -1
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/eventbus/message-event-bus/message-event-bus.d.ts +2 -0
- package/dist/eventbus/message-event-bus/message-event-bus.js +4 -0
- package/dist/eventbus/message-event-bus/message-event-bus.js.map +1 -1
- package/dist/eventbus/message-event-bus-writer/message-event-bus-log-writer.js +3 -0
- package/dist/eventbus/message-event-bus-writer/message-event-bus-log-writer.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +18 -1
- package/dist/events/maps/workflow-publication-metrics.event-map.d.ts +5 -0
- package/dist/events/relays/log-streaming.event-relay.d.ts +3 -0
- package/dist/events/relays/log-streaming.event-relay.js +33 -0
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.js +10 -0
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +46 -18
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/executions/enqueued-execution-recovery.service.d.ts +21 -0
- package/dist/executions/enqueued-execution-recovery.service.js +79 -0
- package/dist/executions/enqueued-execution-recovery.service.js.map +1 -0
- package/dist/executions/execution-data/execution-data-json-store.d.ts +3 -6
- package/dist/executions/execution-data/execution-data-json-store.js +2 -15
- package/dist/executions/execution-data/execution-data-json-store.js.map +1 -1
- package/dist/executions/execution-persistence.js.map +1 -1
- package/dist/executions/execution-recovery.service.js +23 -12
- package/dist/executions/execution-recovery.service.js.map +1 -1
- package/dist/external-hooks.d.ts +3 -2
- package/dist/external-hooks.js.map +1 -1
- package/dist/instance-settings-loader/loaders/sso/oidc.instance-settings-loader.js +4 -0
- package/dist/instance-settings-loader/loaders/sso/oidc.instance-settings-loader.js.map +1 -1
- package/dist/interfaces.d.ts +6 -0
- package/dist/metrics/prometheus/scheduler-metrics.service.d.ts +7 -2
- package/dist/metrics/prometheus/scheduler-metrics.service.js +29 -1
- package/dist/metrics/prometheus/scheduler-metrics.service.js.map +1 -1
- package/dist/metrics/prometheus/workflow-publication-metrics.service.d.ts +1 -0
- package/dist/metrics/prometheus/workflow-publication-metrics.service.js +22 -1
- package/dist/metrics/prometheus/workflow-publication-metrics.service.js.map +1 -1
- package/dist/modules/agent-evals/agent-eval-case-generation.service.d.ts +25 -0
- package/dist/modules/agent-evals/agent-eval-case-generation.service.js +192 -0
- package/dist/modules/agent-evals/agent-eval-case-generation.service.js.map +1 -0
- package/dist/modules/agent-evals/agent-eval-rating.service.d.ts +23 -0
- package/dist/modules/agent-evals/agent-eval-rating.service.js +124 -0
- package/dist/modules/agent-evals/agent-eval-rating.service.js.map +1 -0
- package/dist/modules/agent-evals/agent-eval-record-mappers.d.ts +5 -0
- package/dist/modules/agent-evals/agent-eval-record-mappers.js +68 -0
- package/dist/modules/agent-evals/agent-eval-record-mappers.js.map +1 -0
- package/dist/modules/agent-evals/agent-eval-runner.service.d.ts +42 -0
- package/dist/modules/agent-evals/agent-eval-runner.service.js +409 -0
- package/dist/modules/agent-evals/agent-eval-runner.service.js.map +1 -0
- package/dist/modules/agent-evals/agent-eval.service.d.ts +31 -0
- package/dist/modules/agent-evals/agent-eval.service.js +138 -0
- package/dist/modules/agent-evals/agent-eval.service.js.map +1 -0
- package/dist/modules/agent-evals/agent-evals-flag-gate.d.ts +8 -0
- package/dist/{services/trigger-auth-identity-seeder-proxy.service.js → modules/agent-evals/agent-evals-flag-gate.js} +18 -16
- package/dist/modules/agent-evals/agent-evals-flag-gate.js.map +1 -0
- package/dist/modules/agent-evals/agent-evals-required-modules.d.ts +2 -0
- package/dist/modules/agent-evals/agent-evals-required-modules.js +12 -0
- package/dist/modules/agent-evals/agent-evals-required-modules.js.map +1 -0
- package/dist/modules/agent-evals/agent-evals.controller.d.ts +33 -0
- package/dist/modules/agent-evals/agent-evals.controller.js +172 -0
- package/dist/modules/agent-evals/agent-evals.controller.js.map +1 -0
- package/dist/modules/agent-evals/agent-evals.module.d.ts +4 -0
- package/dist/modules/agent-evals/agent-evals.module.js +24 -0
- package/dist/modules/agent-evals/agent-evals.module.js.map +1 -0
- package/dist/modules/agent-evals/case-generation/case-generation-prompt.d.ts +37 -0
- package/dist/modules/agent-evals/case-generation/case-generation-prompt.js +87 -0
- package/dist/modules/agent-evals/case-generation/case-generation-prompt.js.map +1 -0
- package/dist/modules/agent-evals/case-generation/dimensions.d.ts +11 -0
- package/dist/modules/agent-evals/case-generation/dimensions.js +54 -0
- package/dist/modules/agent-evals/case-generation/dimensions.js.map +1 -0
- package/dist/modules/agents/adapters/agents-credential-provider.d.ts +3 -1
- package/dist/modules/agents/adapters/agents-credential-provider.js +15 -0
- package/dist/modules/agents/adapters/agents-credential-provider.js.map +1 -1
- package/dist/modules/agents/agent-chat-attachment.service.d.ts +46 -0
- package/dist/modules/agents/agent-chat-attachment.service.js +144 -0
- package/dist/modules/agents/agent-chat-attachment.service.js.map +1 -0
- package/dist/modules/agents/agent-chat.controller.d.ts +15 -1
- package/dist/modules/agents/agent-chat.controller.js +177 -34
- package/dist/modules/agents/agent-chat.controller.js.map +1 -1
- package/dist/modules/agents/agent-config.service.d.ts +10 -3
- package/dist/modules/agents/agent-config.service.js +44 -5
- package/dist/modules/agents/agent-config.service.js.map +1 -1
- package/dist/modules/agents/agent-custom-tools.service.d.ts +7 -3
- package/dist/modules/agents/agent-custom-tools.service.js +44 -7
- package/dist/modules/agents/agent-custom-tools.service.js.map +1 -1
- package/dist/modules/agents/agent-execution-orchestrator.service.d.ts +14 -2
- package/dist/modules/agents/agent-execution-orchestrator.service.js +85 -9
- package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
- package/dist/modules/agents/agent-execution.service.d.ts +4 -1
- package/dist/modules/agents/agent-execution.service.js +7 -2
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-integration-persistence.service.d.ts +14 -7
- package/dist/modules/agents/agent-integration-persistence.service.js +35 -7
- package/dist/modules/agents/agent-integration-persistence.service.js.map +1 -1
- package/dist/modules/agents/agent-integrations.controller.d.ts +1 -9
- package/dist/modules/agents/agent-integrations.controller.js +12 -16
- package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-file-store.d.ts +24 -0
- package/dist/modules/agents/agent-knowledge-file-store.js +100 -0
- package/dist/modules/agents/agent-knowledge-file-store.js.map +1 -0
- package/dist/modules/agents/agent-knowledge-retrieval.d.ts +3 -1
- package/dist/modules/agents/agent-knowledge-retrieval.js +1 -1
- package/dist/modules/agents/agent-knowledge-retrieval.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-sandbox.service.d.ts +4 -3
- package/dist/modules/agents/agent-knowledge-sandbox.service.js +17 -8
- package/dist/modules/agents/agent-knowledge-sandbox.service.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-storage.d.ts +0 -1
- package/dist/modules/agents/agent-knowledge-storage.js +0 -10
- package/dist/modules/agents/agent-knowledge-storage.js.map +1 -1
- package/dist/modules/agents/agent-knowledge.service.d.ts +3 -4
- package/dist/modules/agents/agent-knowledge.service.js +25 -27
- package/dist/modules/agents/agent-knowledge.service.js.map +1 -1
- package/dist/modules/agents/agent-mcp-access.controller.d.ts +14 -0
- package/dist/modules/agents/agent-mcp-access.controller.js +49 -0
- package/dist/modules/agents/agent-mcp-access.controller.js.map +1 -0
- package/dist/modules/agents/agent-mcp-access.service.d.ts +22 -0
- package/dist/modules/agents/agent-mcp-access.service.js +83 -0
- package/dist/modules/agents/agent-mcp-access.service.js.map +1 -0
- package/dist/modules/agents/agent-message-mapper.js +9 -0
- package/dist/modules/agents/agent-message-mapper.js.map +1 -1
- package/dist/modules/agents/agent-model-catalog.service.d.ts +1 -1
- package/dist/modules/agents/agent-model-catalog.service.js +22 -7
- package/dist/modules/agents/agent-model-catalog.service.js.map +1 -1
- package/dist/modules/agents/agent-modification-telemetry.service.d.ts +25 -0
- package/dist/modules/agents/agent-modification-telemetry.service.js +119 -0
- package/dist/modules/agents/agent-modification-telemetry.service.js.map +1 -0
- package/dist/modules/agents/agent-publish.controller.js +4 -4
- package/dist/modules/agents/agent-publish.controller.js.map +1 -1
- package/dist/modules/agents/agent-publish.service.d.ts +23 -9
- package/dist/modules/agents/agent-publish.service.js +146 -33
- package/dist/modules/agents/agent-publish.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.d.ts +6 -2
- package/dist/modules/agents/agent-runtime-reconstruction.service.js +16 -6
- package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
- package/dist/modules/agents/agent-setup-completion.service.d.ts +19 -0
- package/dist/modules/agents/agent-setup-completion.service.js +79 -0
- package/dist/modules/agents/agent-setup-completion.service.js.map +1 -0
- package/dist/modules/agents/agent-skills.service.d.ts +8 -6
- package/dist/modules/agents/agent-skills.service.js +55 -12
- package/dist/modules/agents/agent-skills.service.js.map +1 -1
- package/dist/modules/agents/agent-sse-stream.js +35 -0
- package/dist/modules/agents/agent-sse-stream.js.map +1 -1
- package/dist/modules/agents/agent-task.service.d.ts +7 -5
- package/dist/modules/agents/agent-task.service.js +56 -21
- package/dist/modules/agents/agent-task.service.js.map +1 -1
- package/dist/modules/agents/agent-tasks.controller.js +18 -6
- package/dist/modules/agents/agent-tasks.controller.js.map +1 -1
- package/dist/modules/agents/agent-test-chat.service.d.ts +3 -1
- package/dist/modules/agents/agent-test-chat.service.js +7 -3
- package/dist/modules/agents/agent-test-chat.service.js.map +1 -1
- package/dist/modules/agents/agent-validation.service.d.ts +5 -2
- package/dist/modules/agents/agent-validation.service.js +22 -4
- package/dist/modules/agents/agent-validation.service.js.map +1 -1
- package/dist/modules/agents/agent-workflow-execution.service.d.ts +1 -1
- package/dist/modules/agents/agent-workflow-execution.service.js +13 -7
- package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
- package/dist/modules/agents/agents-config.controller.d.ts +1 -5
- package/dist/modules/agents/agents-config.controller.js +7 -2
- package/dist/modules/agents/agents-config.controller.js.map +1 -1
- package/dist/modules/agents/agents-skills.controller.js +12 -3
- package/dist/modules/agents/agents-skills.controller.js.map +1 -1
- package/dist/modules/agents/agents-tools.service.js +1 -5
- package/dist/modules/agents/agents-tools.service.js.map +1 -1
- package/dist/modules/agents/agents.controller.js +3 -1
- package/dist/modules/agents/agents.controller.js.map +1 -1
- package/dist/modules/agents/agents.module.d.ts +1 -1
- package/dist/modules/agents/agents.module.js +10 -11
- package/dist/modules/agents/agents.module.js.map +1 -1
- package/dist/modules/agents/agents.service.d.ts +12 -4
- package/dist/modules/agents/agents.service.js +52 -4
- package/dist/modules/agents/agents.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-prompts.d.ts +2 -2
- package/dist/modules/agents/builder/agents-builder-prompts.js +13 -11
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +3 -6
- package/dist/modules/agents/builder/agents-builder-tools.service.js +37 -84
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder.service.d.ts +3 -7
- package/dist/modules/agents/builder/agents-builder.service.js +27 -34
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
- package/dist/modules/agents/builder/builder-config-telemetry.d.ts +1 -10
- package/dist/modules/agents/builder/builder-config-telemetry.js +0 -64
- package/dist/modules/agents/builder/builder-config-telemetry.js.map +1 -1
- package/dist/modules/agents/builder/builder-model-live-lookup.service.d.ts +5 -1
- package/dist/modules/agents/builder/builder-model-live-lookup.service.js +23 -2
- package/dist/modules/agents/builder/builder-model-live-lookup.service.js.map +1 -1
- package/dist/modules/agents/builder/format-preview-context.js +3 -0
- package/dist/modules/agents/builder/format-preview-context.js.map +1 -1
- package/dist/modules/agents/builder/get-resource-locator-options.tool.d.ts +2 -2
- package/dist/modules/agents/builder/interactive/configure-channel.tool.js +6 -5
- package/dist/modules/agents/builder/interactive/configure-channel.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/finish-setup.tool.d.ts +0 -5
- package/dist/modules/agents/builder/interactive/finish-setup.tool.js +28 -45
- package/dist/modules/agents/builder/interactive/finish-setup.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.d.ts +1 -0
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +88 -8
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +1 -1
- package/dist/modules/agents/builder/prompts/initial-build.prompt.d.ts +1 -1
- package/dist/modules/agents/builder/prompts/initial-build.prompt.js +8 -15
- package/dist/modules/agents/builder/prompts/initial-build.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +2 -2
- package/dist/modules/agents/builder/skills/external-services.skill.js +10 -11
- package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
- package/dist/modules/agents/entities/agent-chat-attachment.entity.d.ts +16 -0
- package/dist/modules/agents/entities/agent-chat-attachment.entity.js +70 -0
- package/dist/modules/agents/entities/agent-chat-attachment.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-execution.entity.d.ts +6 -0
- package/dist/modules/agents/entities/agent-execution.entity.js +4 -0
- package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-file.entity.d.ts +3 -2
- package/dist/modules/agents/entities/agent-file.entity.js +6 -3
- package/dist/modules/agents/entities/agent-file.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent.entity.d.ts +2 -0
- package/dist/modules/agents/entities/agent.entity.js +8 -0
- package/dist/modules/agents/entities/agent.entity.js.map +1 -1
- package/dist/modules/agents/execution-log/agent-execution-log-store.d.ts +3 -6
- package/dist/modules/agents/execution-log/agent-execution-log-store.js +2 -15
- package/dist/modules/agents/execution-log/agent-execution-log-store.js.map +1 -1
- package/dist/modules/agents/execution-recorder.d.ts +11 -0
- package/dist/modules/agents/execution-recorder.js +69 -0
- package/dist/modules/agents/execution-recorder.js.map +1 -1
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +6 -2
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +8 -2
- package/dist/modules/agents/integrations/agent-chat-bridge.js +114 -16
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.d.ts +4 -1
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js +40 -7
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +16 -1
- package/dist/modules/agents/integrations/agent-chat-integration.js +1 -0
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-message-context.d.ts +2 -1
- package/dist/modules/agents/integrations/agent-chat-message-context.js +1 -0
- package/dist/modules/agents/integrations/agent-chat-message-context.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.d.ts +2 -0
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.js +27 -12
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-suspension-cards.d.ts +7 -0
- package/dist/modules/agents/integrations/agent-chat-suspension-cards.js +1 -0
- package/dist/modules/agents/integrations/agent-chat-suspension-cards.js.map +1 -1
- package/dist/modules/agents/integrations/callback-store.d.ts +4 -1
- package/dist/modules/agents/integrations/callback-store.js +11 -3
- package/dist/modules/agents/integrations/callback-store.js.map +1 -1
- package/dist/modules/agents/integrations/chat-integration.service.d.ts +10 -4
- package/dist/modules/agents/integrations/chat-integration.service.js +108 -35
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
- package/dist/modules/agents/integrations/integration-action-executor.d.ts +2 -0
- package/dist/modules/agents/integrations/integration-action-executor.js +52 -1
- package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -1
- package/dist/modules/agents/integrations/integration-context-query-executor.js +2 -1
- package/dist/modules/agents/integrations/integration-context-query-executor.js.map +1 -1
- package/dist/modules/agents/integrations/integration-error-codes.d.ts +1 -0
- package/dist/modules/agents/integrations/integration-error-codes.js +1 -0
- package/dist/modules/agents/integrations/integration-error-codes.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-definitions.js +20 -0
- package/dist/modules/agents/integrations/integration-tool-definitions.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-descriptions.js +6 -0
- package/dist/modules/agents/integrations/integration-tool-descriptions.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-execution.js +5 -0
- package/dist/modules/agents/integrations/integration-tool-execution.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-factory.d.ts +7 -7
- package/dist/modules/agents/integrations/integration-tool-factory.js +1 -1
- package/dist/modules/agents/integrations/integration-tool-factory.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-schema.d.ts +11 -8
- package/dist/modules/agents/integrations/integration-tool-schema.js +7 -7
- package/dist/modules/agents/integrations/integration-tool-schema.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-types.d.ts +3 -1
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.d.ts +8 -6
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +39 -14
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -1
- package/dist/modules/agents/integrations/n8n-memory.js +2 -1
- package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack-bridge-behavior.d.ts +6 -1
- package/dist/modules/agents/integrations/platforms/slack-bridge-behavior.js +36 -24
- package/dist/modules/agents/integrations/platforms/slack-bridge-behavior.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack-integration.d.ts +6 -1
- package/dist/modules/agents/integrations/platforms/slack-integration.js +3 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack-tool-definitions.d.ts +15 -2
- package/dist/modules/agents/integrations/platforms/slack-tool-definitions.js +9 -0
- package/dist/modules/agents/integrations/platforms/slack-tool-definitions.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +4 -1
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +22 -2
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
- package/dist/modules/agents/integrations/slack-app-setup.service.d.ts +1 -3
- package/dist/modules/agents/integrations/slack-app-setup.service.js +9 -10
- package/dist/modules/agents/integrations/slack-app-setup.service.js.map +1 -1
- package/dist/modules/agents/json-config/from-json-config.js +4 -3
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
- package/dist/modules/agents/json-config/mcp-client-factory.d.ts +4 -0
- package/dist/modules/agents/json-config/mcp-client-factory.js +12 -0
- package/dist/modules/agents/json-config/mcp-client-factory.js.map +1 -1
- package/dist/modules/agents/json-config/model-config.d.ts +5 -2
- package/dist/modules/agents/json-config/model-config.js +15 -1
- package/dist/modules/agents/json-config/model-config.js.map +1 -1
- package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.js +22 -3
- package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.js.map +1 -1
- package/dist/modules/agents/register-blob-byte-stores.d.ts +8 -0
- package/dist/modules/agents/register-blob-byte-stores.js +21 -0
- package/dist/modules/agents/register-blob-byte-stores.js.map +1 -0
- package/dist/modules/agents/repositories/agent-chat-attachment.repository.d.ts +19 -0
- package/dist/modules/agents/repositories/agent-chat-attachment.repository.js +38 -0
- package/dist/modules/agents/repositories/agent-chat-attachment.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-checkpoint.repository.d.ts +6 -1
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js +22 -3
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent.repository.d.ts +23 -1
- package/dist/modules/agents/repositories/agent.repository.js +85 -5
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
- package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js +60 -1
- package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js.map +1 -1
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.d.ts +12 -3
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js +124 -60
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js.map +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.js +30 -1
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
- package/dist/modules/agents/utils/agent-capabilities.d.ts +14 -0
- package/dist/modules/agents/utils/agent-capabilities.js +35 -0
- package/dist/modules/agents/utils/agent-capabilities.js.map +1 -0
- package/dist/modules/agents/utils/agent-config-hash.d.ts +2 -0
- package/dist/modules/agents/utils/agent-config-hash.js +23 -0
- package/dist/modules/agents/utils/agent-config-hash.js.map +1 -0
- package/dist/modules/agents/utils/agent-execution-counter.d.ts +3 -1
- package/dist/modules/agents/utils/agent-execution-counter.js +4 -1
- package/dist/modules/agents/utils/agent-execution-counter.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 +33 -16
- package/dist/modules/agents/utils/execution-to-message-mapper.js.map +1 -1
- package/dist/modules/agents/utils/inbound-attachments.d.ts +4 -0
- package/dist/modules/agents/utils/inbound-attachments.js +50 -0
- package/dist/modules/agents/utils/inbound-attachments.js.map +1 -0
- package/dist/modules/agents/utils/messages-envelope.js +5 -1
- package/dist/modules/agents/utils/messages-envelope.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.controller.d.ts +5 -2
- package/dist/modules/breaking-changes/breaking-changes.controller.js +16 -2
- package/dist/modules/breaking-changes/breaking-changes.controller.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.migration-registry.service.d.ts +10 -0
- package/dist/modules/breaking-changes/breaking-changes.migration-registry.service.js +42 -0
- package/dist/modules/breaking-changes/breaking-changes.migration-registry.service.js.map +1 -0
- package/dist/modules/breaking-changes/breaking-changes.migration.service.d.ts +31 -0
- package/dist/modules/breaking-changes/breaking-changes.migration.service.js +120 -0
- package/dist/modules/breaking-changes/breaking-changes.migration.service.js.map +1 -0
- package/dist/modules/breaking-changes/breaking-changes.module.js +2 -0
- package/dist/modules/breaking-changes/breaking-changes.module.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.service.d.ts +3 -2
- package/dist/modules/breaking-changes/breaking-changes.service.js +9 -13
- package/dist/modules/breaking-changes/breaking-changes.service.js.map +1 -1
- package/dist/modules/breaking-changes/group-nodes-by-type.d.ts +2 -0
- package/dist/modules/breaking-changes/group-nodes-by-type.js +15 -0
- package/dist/modules/breaking-changes/group-nodes-by-type.js.map +1 -0
- package/dist/modules/breaking-changes/migrations/ai-transform-to-code.migration.d.ts +2 -0
- package/dist/modules/breaking-changes/migrations/ai-transform-to-code.migration.js +24 -0
- package/dist/modules/breaking-changes/migrations/ai-transform-to-code.migration.js.map +1 -0
- package/dist/modules/breaking-changes/migrations/index.d.ts +2 -0
- package/dist/modules/breaking-changes/migrations/index.js +6 -0
- package/dist/modules/breaking-changes/migrations/index.js.map +1 -0
- package/dist/modules/breaking-changes/migrations/node-migration.d.ts +10 -0
- package/dist/modules/breaking-changes/migrations/node-migration.js +3 -0
- package/dist/modules/breaking-changes/migrations/node-migration.js.map +1 -0
- package/dist/modules/breaking-changes/rules/index.d.ts +2 -0
- package/dist/modules/breaking-changes/rules/index.js +2 -0
- package/dist/modules/breaking-changes/rules/index.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/ai-transform-deprecated.rule.d.ts +11 -0
- package/dist/modules/breaking-changes/rules/v3/ai-transform-deprecated.rule.js +53 -0
- package/dist/modules/breaking-changes/rules/v3/ai-transform-deprecated.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-source-modes.rule.d.ts +10 -0
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-source-modes.rule.js +62 -0
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-source-modes.rule.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-execution.service.js +2 -1
- package/dist/modules/chat-hub/chat-hub-execution.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js +0 -3
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.d.ts +4 -2
- package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js +7 -4
- package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets-manager.ee.d.ts +2 -4
- package/dist/modules/external-secrets.ee/external-secrets-manager.ee.js +27 -20
- package/dist/modules/external-secrets.ee/external-secrets-manager.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets-provider-connection-manager.ee.d.ts +24 -6
- package/dist/modules/external-secrets.ee/external-secrets-provider-connection-manager.ee.js +184 -43
- package/dist/modules/external-secrets.ee/external-secrets-provider-connection-manager.ee.js.map +1 -1
- package/dist/modules/insights/insights-collection.service.js +3 -0
- package/dist/modules/insights/insights-collection.service.js.map +1 -1
- package/dist/modules/insights/insights-compaction.service.js +2 -2
- package/dist/modules/insights/insights-compaction.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/agent-execution.service.d.ts +1 -1
- package/dist/modules/instance-ai/eval/agent-execution.service.js +16 -7
- package/dist/modules/instance-ai/eval/agent-execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/execution.service.d.ts +6 -1
- package/dist/modules/instance-ai/eval/execution.service.js +45 -3
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/ledger-snapshot.d.ts +1 -0
- package/dist/modules/instance-ai/eval/ledger-snapshot.js +11 -0
- package/dist/modules/instance-ai/eval/ledger-snapshot.js.map +1 -0
- package/dist/modules/instance-ai/eval/llm-wire-server.js +26 -2
- package/dist/modules/instance-ai/eval/llm-wire-server.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-handler.d.ts +3 -1
- package/dist/modules/instance-ai/eval/mock-handler.js +60 -2
- package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-quirks.js +5 -4
- package/dist/modules/instance-ai/eval/mock-quirks.js.map +1 -1
- package/dist/modules/instance-ai/eval/openai-responses-envelope.js +11 -2
- package/dist/modules/instance-ai/eval/openai-responses-envelope.js.map +1 -1
- package/dist/modules/instance-ai/eval/pin-data-generator.d.ts +2 -1
- package/dist/modules/instance-ai/eval/pin-data-generator.js +28 -12
- package/dist/modules/instance-ai/eval/pin-data-generator.js.map +1 -1
- package/dist/modules/instance-ai/eval/provider-shapes.js +101 -8
- package/dist/modules/instance-ai/eval/provider-shapes.js.map +1 -1
- package/dist/modules/instance-ai/eval/thread-credential-allowlist.service.d.ts +3 -1
- package/dist/modules/instance-ai/eval/thread-credential-allowlist.service.js +8 -1
- package/dist/modules/instance-ai/eval/thread-credential-allowlist.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +2 -0
- package/dist/modules/instance-ai/eval/workflow-analysis.js +9 -0
- package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
- package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js +3 -1
- package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-credit.service.js +2 -1
- package/dist/modules/instance-ai/instance-ai-credit.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-error-reporter.service.d.ts +9 -2
- package/dist/modules/instance-ai/instance-ai-error-reporter.service.js +25 -11
- package/dist/modules/instance-ai/instance-ai-error-reporter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +33 -21
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.js +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.js +160 -38
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/node-definition-resolver.js +1 -5
- package/dist/modules/instance-ai/node-definition-resolver.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.d.ts +2 -0
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js +20 -0
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js.map +1 -1
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js +5 -1
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.d.ts +1 -0
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js +3 -0
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js.map +1 -1
- package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.d.ts +2 -0
- package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.js +7 -2
- package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.js.map +1 -1
- package/dist/modules/ldap.ee/helpers.ee.d.ts +2 -1
- package/dist/modules/ldap.ee/helpers.ee.js +11 -2
- package/dist/modules/ldap.ee/helpers.ee.js.map +1 -1
- package/dist/modules/ldap.ee/ldap.errors.d.ts +5 -0
- package/dist/modules/ldap.ee/ldap.errors.js +11 -0
- package/dist/modules/ldap.ee/ldap.errors.js.map +1 -0
- package/dist/modules/ldap.ee/ldap.service.ee.d.ts +2 -2
- package/dist/modules/ldap.ee/ldap.service.ee.js +29 -7
- package/dist/modules/ldap.ee/ldap.service.ee.js.map +1 -1
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.d.ts +1 -1
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js +10 -2
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js.map +1 -1
- package/dist/modules/mcp/mcp-protected-resource.d.ts +4 -2
- package/dist/modules/mcp/mcp-protected-resource.js +17 -5
- package/dist/modules/mcp/mcp-protected-resource.js.map +1 -1
- package/dist/modules/mcp/mcp-scopes.d.ts +1 -0
- package/dist/modules/mcp/mcp-scopes.js +35 -7
- package/dist/modules/mcp/mcp-scopes.js.map +1 -1
- package/dist/modules/mcp/mcp-tool-availability.d.ts +3 -0
- package/dist/modules/mcp/mcp-tool-availability.js +7 -0
- package/dist/modules/mcp/mcp-tool-availability.js.map +1 -0
- package/dist/modules/mcp/mcp.constants.d.ts +1 -0
- package/dist/modules/mcp/mcp.constants.js +2 -1
- package/dist/modules/mcp/mcp.constants.js.map +1 -1
- package/dist/modules/mcp/mcp.controller.d.ts +1 -1
- package/dist/modules/mcp/mcp.controller.js +10 -18
- package/dist/modules/mcp/mcp.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +6 -2
- package/dist/modules/mcp/mcp.service.js +72 -4
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.settings.controller.d.ts +4 -2
- package/dist/modules/mcp/mcp.settings.controller.js +6 -3
- package/dist/modules/mcp/mcp.settings.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +2 -1
- package/dist/modules/mcp/mcp.types.js.map +1 -1
- package/dist/modules/mcp/tools/agents/agent-reference.d.ts +9 -0
- package/dist/modules/mcp/tools/agents/agent-reference.js +169 -0
- package/dist/modules/mcp/tools/agents/agent-reference.js.map +1 -0
- package/dist/modules/mcp/tools/agents/agent-tools.service.d.ts +87 -0
- package/dist/modules/mcp/tools/agents/agent-tools.service.js +1157 -0
- package/dist/modules/mcp/tools/agents/agent-tools.service.js.map +1 -0
- package/dist/modules/mcp/tools/get-execution.tool.js +4 -4
- package/dist/modules/mcp/tools/get-execution.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-workflow-details.tool.d.ts +1 -1
- package/dist/modules/mcp/tools/get-workflow-details.tool.js +7 -4
- package/dist/modules/mcp/tools/get-workflow-details.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-workflow-version.tool.js +1 -1
- package/dist/modules/mcp/tools/get-workflow-version.tool.js.map +1 -1
- package/dist/modules/mcp/tools/list-credentials.tool.js +1 -1
- package/dist/modules/mcp/tools/list-credentials.tool.js.map +1 -1
- package/dist/modules/mcp/tools/list-tags.tool.js +3 -3
- package/dist/modules/mcp/tools/list-tags.tool.js.map +1 -1
- package/dist/modules/mcp/tools/prepare-workflow-pin-data.tool.js +3 -3
- package/dist/modules/mcp/tools/prepare-workflow-pin-data.tool.js.map +1 -1
- package/dist/modules/mcp/tools/publish-workflow.tool.js +14 -2
- package/dist/modules/mcp/tools/publish-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/schemas.d.ts +381 -0
- package/dist/modules/mcp/tools/schemas.js +25 -1
- package/dist/modules/mcp/tools/schemas.js.map +1 -1
- package/dist/modules/mcp/tools/search-executions.tool.js +3 -3
- package/dist/modules/mcp/tools/search-executions.tool.js.map +1 -1
- package/dist/modules/mcp/tools/search-projects.tool.js +1 -1
- package/dist/modules/mcp/tools/search-projects.tool.js.map +1 -1
- package/dist/modules/mcp/tools/test-workflow.tool.js +2 -2
- package/dist/modules/mcp/tools/test-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/webhook-utils.d.ts +1 -1
- package/dist/modules/mcp/tools/webhook-utils.js +5 -1
- package/dist/modules/mcp/tools/webhook-utils.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +12 -1
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js +55 -29
- package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.d.ts +1 -0
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +27 -3
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.d.ts +10 -1
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js +14 -4
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +119 -15
- 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.js +1 -1
- 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 +15 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +46 -18
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry-search.d.ts +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-search.js +8 -6
- package/dist/modules/mcp-registry/registry/mcp-registry-search.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.service.d.ts +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js +3 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-blocked.error.js +3 -1
- package/dist/modules/n8n-packages/engine/import-blocked.error.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-gates.d.ts +11 -0
- package/dist/modules/n8n-packages/engine/import-gates.js +34 -0
- package/dist/modules/n8n-packages/engine/import-gates.js.map +1 -0
- package/dist/modules/n8n-packages/engine/import-orchestrator.d.ts +17 -8
- package/dist/modules/n8n-packages/engine/import-orchestrator.js +42 -24
- package/dist/modules/n8n-packages/engine/import-orchestrator.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-result.d.ts +16 -4
- package/dist/modules/n8n-packages/engine/import-result.js +56 -20
- package/dist/modules/n8n-packages/engine/import-result.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-telemetry.d.ts +4 -2
- package/dist/modules/n8n-packages/engine/import-telemetry.js +25 -5
- package/dist/modules/n8n-packages/engine/import-telemetry.js.map +1 -1
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js +4 -0
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js.map +1 -1
- package/dist/modules/n8n-packages/engine/package-layout.d.ts +1 -0
- package/dist/modules/n8n-packages/engine/package-layout.js +9 -0
- package/dist/modules/n8n-packages/engine/package-layout.js.map +1 -1
- package/dist/modules/n8n-packages/engine/project-package-importer.d.ts +3 -1
- package/dist/modules/n8n-packages/engine/project-package-importer.js +68 -25
- package/dist/modules/n8n-packages/engine/project-package-importer.js.map +1 -1
- package/dist/modules/n8n-packages/engine/workflow-package-importer.d.ts +3 -1
- package/dist/modules/n8n-packages/engine/workflow-package-importer.js +54 -16
- package/dist/modules/n8n-packages/engine/workflow-package-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/folder/folder.exporter.d.ts +1 -0
- package/dist/modules/n8n-packages/entities/folder/folder.exporter.js +1 -0
- package/dist/modules/n8n-packages/entities/folder/folder.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/project/project-import.types.d.ts +2 -0
- package/dist/modules/n8n-packages/entities/project/project-importer.js +9 -1
- package/dist/modules/n8n-packages/entities/project/project-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/project/project.exporter.d.ts +1 -0
- package/dist/modules/n8n-packages/entities/project/project.exporter.js +2 -0
- package/dist/modules/n8n-packages/entities/project/project.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/project/project.serializer.js +3 -0
- package/dist/modules/n8n-packages/entities/project/project.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/reference.d.ts +6 -0
- package/dist/modules/n8n-packages/entities/reference.js +3 -0
- package/dist/modules/n8n-packages/entities/reference.js.map +1 -0
- package/dist/modules/n8n-packages/entities/requirements.types.d.ts +2 -0
- package/dist/modules/n8n-packages/entities/requirements.types.js +1 -0
- package/dist/modules/n8n-packages/entities/requirements.types.js.map +1 -1
- package/dist/modules/n8n-packages/entities/tag/tag-import-decision.d.ts +24 -0
- package/dist/modules/n8n-packages/entities/tag/tag-import-decision.js +69 -0
- package/dist/modules/n8n-packages/entities/tag/tag-import-decision.js.map +1 -0
- package/dist/modules/n8n-packages/entities/tag/tag-importer.d.ts +14 -0
- package/dist/modules/n8n-packages/entities/tag/tag-importer.js +142 -0
- package/dist/modules/n8n-packages/entities/tag/tag-importer.js.map +1 -0
- package/dist/modules/n8n-packages/entities/tag/tag-requirements.extractor.d.ts +6 -0
- package/dist/modules/n8n-packages/entities/tag/tag-requirements.extractor.js +23 -0
- package/dist/modules/n8n-packages/entities/tag/tag-requirements.extractor.js.map +1 -0
- package/dist/modules/n8n-packages/entities/tag/tag.exporter.d.ts +15 -0
- package/dist/modules/n8n-packages/entities/tag/tag.exporter.js +45 -0
- package/dist/modules/n8n-packages/entities/tag/tag.exporter.js.map +1 -0
- package/dist/modules/n8n-packages/entities/tag/tag.types.d.ts +48 -0
- package/dist/modules/n8n-packages/entities/tag/tag.types.js +10 -0
- package/dist/modules/n8n-packages/entities/tag/tag.types.js.map +1 -0
- package/dist/modules/n8n-packages/entities/variable/variable-importer.d.ts +8 -2
- package/dist/modules/n8n-packages/entities/variable/variable-importer.js +82 -6
- package/dist/modules/n8n-packages/entities/variable/variable-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.d.ts +1 -0
- package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.js +9 -4
- package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.js.map +1 -1
- package/dist/modules/n8n-packages/entities/variable/variable.types.d.ts +31 -1
- package/dist/modules/n8n-packages/entities/variable/variable.types.js +36 -0
- package/dist/modules/n8n-packages/entities/variable/variable.types.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow-resolver.d.ts +1 -0
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow-resolver.js +4 -3
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow-resolver.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.d.ts +4 -1
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.js +10 -6
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/references/caller-ids.reference.d.ts +3 -0
- package/dist/modules/n8n-packages/entities/workflow/references/caller-ids.reference.js +20 -0
- package/dist/modules/n8n-packages/entities/workflow/references/caller-ids.reference.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/references/error-workflow.reference.d.ts +3 -0
- package/dist/modules/n8n-packages/entities/workflow/references/error-workflow.reference.js +25 -0
- package/dist/modules/n8n-packages/entities/workflow/references/error-workflow.reference.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/references/extract-workflow-requirements.d.ts +3 -0
- package/dist/modules/n8n-packages/entities/workflow/references/extract-workflow-requirements.js +16 -0
- package/dist/modules/n8n-packages/entities/workflow/references/extract-workflow-requirements.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/references/sub-workflow-node.reference.d.ts +6 -0
- package/dist/modules/n8n-packages/entities/workflow/references/sub-workflow-node.reference.js +55 -0
- package/dist/modules/n8n-packages/entities/workflow/references/sub-workflow-node.reference.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/references/workflow-references.d.ts +3 -0
- package/dist/modules/n8n-packages/entities/workflow/references/workflow-references.js +12 -0
- package/dist/modules/n8n-packages/entities/workflow/references/workflow-references.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/sub-workflow-ordering.d.ts +4 -0
- package/dist/modules/n8n-packages/entities/workflow/sub-workflow-ordering.js +45 -0
- package/dist/modules/n8n-packages/entities/workflow/sub-workflow-ordering.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-dependency-resolver.d.ts +2 -3
- package/dist/modules/n8n-packages/entities/workflow/workflow-dependency-resolver.js +7 -5
- package/dist/modules/n8n-packages/entities/workflow/workflow-dependency-resolver.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-import.types.d.ts +14 -3
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.d.ts +5 -6
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js +25 -19
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.d.ts +11 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js +17 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-requirement.exporter.d.ts +7 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-requirement.exporter.js +28 -7
- package/dist/modules/n8n-packages/entities/workflow/workflow-requirement.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.d.ts +4 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +11 -5
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +3 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +6 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.service.d.ts +5 -1
- package/dist/modules/n8n-packages/n8n-packages.service.js +32 -9
- package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +49 -4
- package/dist/modules/n8n-packages/n8n-packages.types.js +15 -1
- package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
- package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +95 -11
- package/dist/modules/n8n-packages/spec/manifest.schema.js +2 -0
- package/dist/modules/n8n-packages/spec/manifest.schema.js.map +1 -1
- package/dist/modules/n8n-packages/spec/requirements.schema.d.ts +52 -7
- package/dist/modules/n8n-packages/spec/requirements.schema.js +10 -1
- package/dist/modules/n8n-packages/spec/requirements.schema.js.map +1 -1
- package/dist/modules/n8n-packages/spec/serialized/project.schema.d.ts +18 -0
- package/dist/modules/n8n-packages/spec/serialized/project.schema.js +5 -0
- package/dist/modules/n8n-packages/spec/serialized/project.schema.js.map +1 -1
- package/dist/modules/n8n-packages/spec/serialized/tag.schema.d.ts +12 -0
- package/dist/modules/n8n-packages/spec/serialized/tag.schema.js +11 -0
- package/dist/modules/n8n-packages/spec/serialized/tag.schema.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +3 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +1 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +1 -1
- package/dist/modules/oauth-server/database/entities/oauth-client.entity.d.ts +1 -0
- package/dist/modules/oauth-server/database/entities/oauth-client.entity.js +4 -0
- package/dist/modules/oauth-server/database/entities/oauth-client.entity.js.map +1 -1
- package/dist/modules/oauth-server/database/repositories/oauth-user-consent.repository.d.ts +1 -0
- package/dist/modules/oauth-server/database/repositories/oauth-user-consent.repository.js +13 -1
- package/dist/modules/oauth-server/database/repositories/oauth-user-consent.repository.js.map +1 -1
- package/dist/modules/oauth-server/oauth-flow.service.d.ts +17 -0
- package/dist/modules/oauth-server/oauth-flow.service.js +100 -0
- package/dist/modules/oauth-server/oauth-flow.service.js.map +1 -0
- package/dist/modules/oauth-server/oauth-server.module.js +5 -5
- package/dist/modules/oauth-server/oauth-server.module.js.map +1 -1
- package/dist/modules/oauth-server/oauth-server.service.d.ts +8 -2
- package/dist/modules/oauth-server/oauth-server.service.js +64 -11
- package/dist/modules/oauth-server/oauth-server.service.js.map +1 -1
- package/dist/modules/oauth-server/oauth.controller.js +3 -1
- package/dist/modules/oauth-server/oauth.controller.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-resource.resolver.d.ts +38 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-resource.resolver.js +95 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-resource.resolver.js.map +1 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-test-resource.resolver.d.ts +37 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-test-resource.resolver.js +88 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-test-resource.resolver.js.map +1 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/index.d.ts +1 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/index.js +20 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/index.js.map +1 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/utils.d.ts +5 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/utils.js +16 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/utils.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-test-trigger-resource.resolver.d.ts +19 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-test-trigger-resource.resolver.js +107 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-test-trigger-resource.resolver.js.map +1 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-trigger-resource.resolver.d.ts +21 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-trigger-resource.resolver.js +109 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-trigger-resource.resolver.js.map +1 -0
- package/dist/modules/otel/otel-lifecycle-handler.d.ts +0 -1
- package/dist/modules/otel/otel-lifecycle-handler.js +1 -4
- package/dist/modules/otel/otel-lifecycle-handler.js.map +1 -1
- package/dist/modules/provisioning.ee/provisioning.service.ee.d.ts +4 -0
- package/dist/modules/provisioning.ee/provisioning.service.ee.js +102 -20
- package/dist/modules/provisioning.ee/provisioning.service.ee.js.map +1 -1
- package/dist/modules/provisioning.ee/role-deletion-checker.ee.d.ts +3 -1
- package/dist/modules/provisioning.ee/role-deletion-checker.ee.js +13 -5
- package/dist/modules/provisioning.ee/role-deletion-checker.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +7 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +33 -7
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +8 -0
- package/dist/modules/source-control.ee/source-control.service.ee.d.ts +4 -0
- package/dist/modules/source-control.ee/source-control.service.ee.js +5 -2
- package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/types/import-result.d.ts +2 -0
- package/dist/modules/sso-oidc/constants.d.ts +2 -0
- package/dist/modules/sso-oidc/constants.js +3 -1
- package/dist/modules/sso-oidc/constants.js.map +1 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.d.ts +4 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.js +54 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.js.map +1 -1
- package/dist/modules/sso-oidc/oidc.service.ee.d.ts +9 -2
- package/dist/modules/sso-oidc/oidc.service.ee.js +44 -15
- package/dist/modules/sso-oidc/oidc.service.ee.js.map +1 -1
- package/dist/modules/sso-saml/saml-helpers.js +2 -3
- package/dist/modules/sso-saml/saml-helpers.js.map +1 -1
- package/dist/modules/sso-saml/saml.service.ee.js +2 -3
- package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-feature-gate.service.d.ts +10 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-feature-gate.service.js +54 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-feature-gate.service.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.d.ts +31 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js +219 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-publish-guard.service.d.ts +9 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-publish-guard.service.js +40 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-publish-guard.service.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.d.ts +19 -18
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js +163 -155
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.d.ts +6 -2
- package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.js +29 -4
- package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review.mapper.d.ts +3 -0
- package/dist/modules/workflow-reviews.ee/workflow-review.mapper.js +12 -0
- package/dist/modules/workflow-reviews.ee/workflow-review.mapper.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js +4 -0
- package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js.map +1 -1
- package/dist/node-catalog/node-catalog.service.d.ts +1 -0
- package/dist/node-catalog/node-catalog.service.js +11 -3
- package/dist/node-catalog/node-catalog.service.js.map +1 -1
- package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
- package/dist/permissions.ee/project-scope.service.d.ts +9 -0
- package/dist/permissions.ee/project-scope.service.js +34 -0
- package/dist/permissions.ee/project-scope.service.js.map +1 -0
- package/dist/public-api/types.d.ts +11 -1
- package/dist/public-api/v1/handlers/ldap/ldap.handler.d.ts +10 -0
- package/dist/public-api/v1/handlers/ldap/ldap.handler.js +76 -0
- package/dist/public-api/v1/handlers/ldap/ldap.handler.js.map +1 -0
- package/dist/public-api/v1/handlers/ldap/ldap.mapper.d.ts +17 -0
- package/dist/public-api/v1/handlers/ldap/ldap.mapper.js +35 -0
- package/dist/public-api/v1/handlers/ldap/ldap.mapper.js.map +1 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.d.ts +1 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +4 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/sso-oidc/sso-oidc.handler.d.ts +8 -0
- package/dist/public-api/v1/handlers/sso-oidc/sso-oidc.handler.js +38 -0
- package/dist/public-api/v1/handlers/sso-oidc/sso-oidc.handler.js.map +1 -0
- package/dist/public-api/v1/handlers/sso-oidc/sso-oidc.mapper.d.ts +5 -0
- package/dist/public-api/v1/handlers/sso-oidc/sso-oidc.mapper.js +12 -0
- package/dist/public-api/v1/handlers/sso-oidc/sso-oidc.mapper.js.map +1 -0
- package/dist/public-api/v1/openapi.yml +789 -9
- package/dist/push/index.js +1 -1
- package/dist/push/index.js.map +1 -1
- package/dist/push/origin-validator.d.ts +2 -1
- package/dist/push/origin-validator.js +15 -2
- package/dist/push/origin-validator.js.map +1 -1
- package/dist/push/sse.push.js +2 -0
- package/dist/push/sse.push.js.map +1 -1
- package/dist/scaling/job-processor.d.ts +3 -2
- package/dist/scaling/job-processor.js +17 -14
- package/dist/scaling/job-processor.js.map +1 -1
- package/dist/scaling/scaling.service.d.ts +3 -2
- package/dist/scaling/scaling.service.js +19 -16
- package/dist/scaling/scaling.service.js.map +1 -1
- package/dist/scaling/webhook-response-relay.d.ts +34 -0
- package/dist/scaling/webhook-response-relay.js +323 -0
- package/dist/scaling/webhook-response-relay.js.map +1 -0
- package/dist/scheduling/durable-job-provisioner.d.ts +2 -1
- package/dist/scheduling/durable-job-provisioner.js +21 -3
- package/dist/scheduling/durable-job-provisioner.js.map +1 -1
- package/dist/scheduling/durable-scheduler.js +22 -0
- package/dist/scheduling/durable-scheduler.js.map +1 -1
- package/dist/scheduling/poll-trigger-node/poll-trigger-job-registrar.js +2 -1
- package/dist/scheduling/poll-trigger-node/poll-trigger-job-registrar.js.map +1 -1
- package/dist/scheduling/schedule-trigger-node/schedule-trigger-job-registrar.js +11 -4
- package/dist/scheduling/schedule-trigger-node/schedule-trigger-job-registrar.js.map +1 -1
- package/dist/security-audit/security-audit.service.js +1 -1
- package/dist/security-audit/security-audit.service.js.map +1 -1
- package/dist/services/ai-gateway.service.d.ts +3 -0
- package/dist/services/ai-gateway.service.js +16 -0
- package/dist/services/ai-gateway.service.js.map +1 -1
- package/dist/services/credentials-tester.service.d.ts +7 -0
- package/dist/services/credentials-tester.service.js +69 -9
- package/dist/services/credentials-tester.service.js.map +1 -1
- package/dist/services/frontend.service.js +14 -0
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/oauth2-flow-proxy.service.d.ts +11 -0
- package/dist/services/oauth2-flow-proxy.service.js +34 -0
- package/dist/services/oauth2-flow-proxy.service.js.map +1 -0
- package/dist/services/ownership-transfer/ownership-transfer.manifest.json +5 -0
- package/dist/services/project.service.ee.d.ts +5 -0
- package/dist/services/project.service.ee.js +15 -1
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/protected-resource.registry.d.ts +2 -1
- package/dist/services/protected-resource.registry.js +7 -2
- package/dist/services/protected-resource.registry.js.map +1 -1
- package/dist/services/pruning/workflow-history-compaction.service.js +3 -2
- package/dist/services/pruning/workflow-history-compaction.service.js.map +1 -1
- package/dist/services/tag.service.d.ts +2 -1
- package/dist/services/tag.service.js +14 -31
- package/dist/services/tag.service.js.map +1 -1
- package/dist/sso.ee/sso-helpers.d.ts +1 -0
- package/dist/sso.ee/sso-helpers.js +8 -0
- package/dist/sso.ee/sso-helpers.js.map +1 -1
- package/dist/task-runners/errors/task-request-timeout.error.d.ts +2 -2
- package/dist/task-runners/errors/task-request-timeout.error.js +3 -3
- package/dist/task-runners/errors/task-request-timeout.error.js.map +1 -1
- package/dist/task-runners/task-broker/errors/task-requester-accept-timeout.error.d.ts +4 -0
- package/dist/task-runners/task-broker/errors/task-requester-accept-timeout.error.js +11 -0
- package/dist/task-runners/task-broker/errors/task-requester-accept-timeout.error.js.map +1 -0
- package/dist/task-runners/task-broker/errors/task-runner-unreachable.error.d.ts +4 -0
- package/dist/task-runners/task-broker/errors/task-runner-unreachable.error.js +11 -0
- package/dist/task-runners/task-broker/errors/task-runner-unreachable.error.js.map +1 -0
- package/dist/task-runners/task-broker/task-broker-ws-server.d.ts +9 -1
- package/dist/task-runners/task-broker/task-broker-ws-server.js +61 -32
- package/dist/task-runners/task-broker/task-broker-ws-server.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker.service.d.ts +18 -1
- package/dist/task-runners/task-broker/task-broker.service.js +134 -63
- package/dist/task-runners/task-broker/task-broker.service.js.map +1 -1
- package/dist/task-runners/task-managers/task-requester.d.ts +1 -0
- package/dist/task-runners/task-managers/task-requester.js +4 -1
- package/dist/task-runners/task-managers/task-requester.js.map +1 -1
- package/dist/task-runners/task-runner-module.js +2 -2
- package/dist/task-runners/task-runner-module.js.map +1 -1
- package/dist/telemetry/index.d.ts +3 -1
- package/dist/telemetry/index.js +15 -8
- package/dist/telemetry/index.js.map +1 -1
- package/dist/utils/ai-service-retry.js +2 -4
- package/dist/utils/ai-service-retry.js.map +1 -1
- package/dist/wait-tracker.js +6 -2
- package/dist/wait-tracker.js.map +1 -1
- package/dist/webhooks/test-webhooks.d.ts +1 -0
- package/dist/webhooks/test-webhooks.js +14 -9
- package/dist/webhooks/test-webhooks.js.map +1 -1
- package/dist/webhooks/webhook-helpers.js +69 -16
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/webhooks/webhook.service.d.ts +4 -0
- package/dist/webhooks/webhook.service.js +40 -12
- package/dist/webhooks/webhook.service.js.map +1 -1
- package/dist/workflow-execute-additional-data.js +2 -0
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.d.ts +4 -1
- package/dist/workflow-helpers.js +22 -0
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-runner.d.ts +2 -1
- package/dist/workflow-runner.js +4 -4
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/publication/published-workflow-trigger-deactivator.d.ts +11 -3
- package/dist/workflows/publication/published-workflow-trigger-deactivator.js +66 -23
- package/dist/workflows/publication/published-workflow-trigger-deactivator.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-lifecycle-lock.d.ts +0 -5
- package/dist/workflows/publication/workflow-publication-lifecycle-lock.js +0 -44
- package/dist/workflows/publication/workflow-publication-lifecycle-lock.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-outbox-consumer.js +3 -0
- package/dist/workflows/publication/workflow-publication-outbox-consumer.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-reconciler.service.d.ts +4 -2
- package/dist/workflows/publication/workflow-publication-reconciler.service.js +43 -30
- package/dist/workflows/publication/workflow-publication-reconciler.service.js.map +1 -1
- package/dist/workflows/triggers/trigger-activation-retry.js +2 -1
- package/dist/workflows/triggers/trigger-activation-retry.js.map +1 -1
- package/dist/workflows/triggers/workflow-trigger-activator.js +8 -1
- package/dist/workflows/triggers/workflow-trigger-activator.js.map +1 -1
- package/dist/workflows/workflow-finder.service.d.ts +1 -0
- package/dist/workflows/workflow-finder.service.js +3 -1
- package/dist/workflows/workflow-finder.service.js.map +1 -1
- package/dist/workflows/workflow-publish-guard-proxy.service.d.ts +8 -0
- package/dist/workflows/workflow-publish-guard-proxy.service.js +26 -0
- package/dist/workflows/workflow-publish-guard-proxy.service.js.map +1 -0
- package/dist/workflows/workflow-validation.service.d.ts +1 -0
- package/dist/workflows/workflow-validation.service.js +23 -8
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +7 -3
- package/dist/workflows/workflow.service.ee.d.ts +4 -1
- package/dist/workflows/workflow.service.js +75 -30
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +4 -1
- package/package.json +39 -39
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/index.d.ts +0 -2
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/index.js +0 -19
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/index.js.map +0 -1
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/metadata.d.ts +0 -20
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/metadata.js +0 -12
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/metadata.js.map +0 -1
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-extractor.d.ts +0 -12
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-extractor.js +0 -85
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-extractor.js.map +0 -1
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-seeder.d.ts +0 -10
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-seeder.js +0 -77
- package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-seeder.js.map +0 -1
- package/dist/modules/n8n-packages/entities/workflow/static-sub-workflow-id.d.ts +0 -2
- package/dist/modules/n8n-packages/entities/workflow/static-sub-workflow-id.js +0 -23
- package/dist/modules/n8n-packages/entities/workflow/static-sub-workflow-id.js.map +0 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-requirements.extractor.d.ts +0 -7
- package/dist/modules/n8n-packages/entities/workflow/workflow-requirements.extractor.js +0 -41
- package/dist/modules/n8n-packages/entities/workflow/workflow-requirements.extractor.js.map +0 -1
- package/dist/services/trigger-auth-identity-seeder-proxy.service.d.ts +0 -10
- package/dist/services/trigger-auth-identity-seeder-proxy.service.js.map +0 -1
- package/dist/workflows/publication/published-workflow-enqueuer.d.ts +0 -13
- package/dist/workflows/publication/published-workflow-enqueuer.js +0 -50
- package/dist/workflows/publication/published-workflow-enqueuer.js.map +0 -1
|
@@ -0,0 +1,1157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.McpAgentToolsService = void 0;
|
|
13
|
+
const agent_config_1 = require("@n8n/ai-utilities/agent-config");
|
|
14
|
+
const api_types_1 = require("@n8n/api-types");
|
|
15
|
+
const backend_network_1 = require("@n8n/backend-network");
|
|
16
|
+
const config_1 = require("@n8n/config");
|
|
17
|
+
const di_1 = require("@n8n/di");
|
|
18
|
+
const is_record_1 = require("@n8n/utils/is-record");
|
|
19
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
20
|
+
const zod_1 = require("zod");
|
|
21
|
+
const zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
22
|
+
const credentials_service_1 = require("../../../../credentials/credentials.service");
|
|
23
|
+
const forbidden_error_1 = require("../../../../errors/response-errors/forbidden.error");
|
|
24
|
+
const agent_config_service_1 = require("../../../../modules/agents/agent-config.service");
|
|
25
|
+
const agent_custom_tools_service_1 = require("../../../../modules/agents/agent-custom-tools.service");
|
|
26
|
+
const agent_integration_persistence_service_1 = require("../../../../modules/agents/agent-integration-persistence.service");
|
|
27
|
+
const agent_model_catalog_service_1 = require("../../../../modules/agents/agent-model-catalog.service");
|
|
28
|
+
const agent_publish_service_1 = require("../../../../modules/agents/agent-publish.service");
|
|
29
|
+
const agent_skills_service_1 = require("../../../../modules/agents/agent-skills.service");
|
|
30
|
+
const agent_task_service_1 = require("../../../../modules/agents/agent-task.service");
|
|
31
|
+
const agent_validation_service_1 = require("../../../../modules/agents/agent-validation.service");
|
|
32
|
+
const agents_service_1 = require("../../../../modules/agents/agents.service");
|
|
33
|
+
const attachable_workflows_service_1 = require("../../../../modules/agents/attachable-workflows.service");
|
|
34
|
+
const agent_chat_integration_1 = require("../../../../modules/agents/integrations/agent-chat-integration");
|
|
35
|
+
const chat_integration_service_1 = require("../../../../modules/agents/integrations/chat-integration.service");
|
|
36
|
+
const agent_config_composition_1 = require("../../../../modules/agents/json-config/agent-config-composition");
|
|
37
|
+
const mcp_client_factory_1 = require("../../../../modules/agents/json-config/mcp-client-factory");
|
|
38
|
+
const sanitize_unknown_agent_credentials_1 = require("../../../../modules/agents/json-config/sanitize-unknown-agent-credentials");
|
|
39
|
+
const model_catalog_1 = require("../../../../modules/agents/model-catalog");
|
|
40
|
+
const agent_secure_runtime_1 = require("../../../../modules/agents/runtime/agent-secure-runtime");
|
|
41
|
+
const agent_config_hash_1 = require("../../../../modules/agents/utils/agent-config-hash");
|
|
42
|
+
const agent_credential_provider_1 = require("../../../../modules/agents/utils/agent-credential-provider");
|
|
43
|
+
const mcp_registry_service_1 = require("../../../../modules/mcp-registry/registry/mcp-registry.service");
|
|
44
|
+
const node_types_1 = require("../../../../node-types");
|
|
45
|
+
const oauth_service_1 = require("../../../../oauth/oauth.service");
|
|
46
|
+
const check_access_1 = require("../../../../permissions.ee/check-access");
|
|
47
|
+
const project_scope_service_1 = require("../../../../permissions.ee/project-scope.service");
|
|
48
|
+
const url_service_1 = require("../../../../services/url.service");
|
|
49
|
+
const telemetry_1 = require("../../../../telemetry");
|
|
50
|
+
const ai_proxy_fetch_1 = require("../../../../utils/ai-proxy-fetch");
|
|
51
|
+
const agent_reference_1 = require("./agent-reference");
|
|
52
|
+
const mcp_constants_1 = require("../../mcp.constants");
|
|
53
|
+
const MCP_SERVER_DISCOVERY_LIMIT = 20;
|
|
54
|
+
const INTEGRATIONS_NOT_IN_CONFIG_MESSAGE = "Integrations can't be changed through config.replace or config.patch. Use update_agent_integration to configure or disconnect Slack, Telegram, or Linear. Configuration never publishes the Agent; an unpublished Agent's channel stays inactive until publish_agent is called.";
|
|
55
|
+
const MCP_AGENT_CONFIG_MESSAGES = {
|
|
56
|
+
emptyInstructionsFollowUp: 'retrying the mutation.',
|
|
57
|
+
dynamicSelectorFollowUp: 'Ask the user for the concrete value and write it into nodeParameters as a literal.',
|
|
58
|
+
};
|
|
59
|
+
function integrationsField(config) {
|
|
60
|
+
return (0, is_record_1.isRecord)(config) ? config.integrations : undefined;
|
|
61
|
+
}
|
|
62
|
+
function collectClearedCredentialIds(original, sanitized, ids) {
|
|
63
|
+
if (Array.isArray(original) && Array.isArray(sanitized)) {
|
|
64
|
+
original.forEach((entry, index) => collectClearedCredentialIds(entry, sanitized[index], ids));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (!(0, is_record_1.isRecord)(original) || !(0, is_record_1.isRecord)(sanitized))
|
|
68
|
+
return;
|
|
69
|
+
for (const [key, value] of Object.entries(original)) {
|
|
70
|
+
if (typeof value === 'string' && value !== '' && sanitized[key] === '') {
|
|
71
|
+
ids.add(value);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
collectClearedCredentialIds(value, sanitized[key], ids);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function integrationsChanged(current, next) {
|
|
78
|
+
return (JSON.stringify(current.integrations ?? []) !== JSON.stringify(integrationsField(next) ?? []));
|
|
79
|
+
}
|
|
80
|
+
const TELEGRAM_SETTINGS_JSON_SCHEMA = (0, zod_to_json_schema_1.zodToJsonSchema)(api_types_1.AgentTelegramSettingsSchema);
|
|
81
|
+
const httpUrlSchema = zod_1.z
|
|
82
|
+
.string()
|
|
83
|
+
.url()
|
|
84
|
+
.refine((value) => /^https?:\/\//i.test(value), { message: 'Must be a valid HTTP(S) URL' });
|
|
85
|
+
const agentIdentityShape = {
|
|
86
|
+
agentId: zod_1.z.string().min(1).describe('Agent ID'),
|
|
87
|
+
};
|
|
88
|
+
const getAgentInput = {
|
|
89
|
+
...agentIdentityShape,
|
|
90
|
+
versionId: zod_1.z
|
|
91
|
+
.string()
|
|
92
|
+
.min(1)
|
|
93
|
+
.optional()
|
|
94
|
+
.describe('Read a published version snapshot instead of the draft, e.g. the activeVersionId. Snapshots are read-only, so the response has no configHash.'),
|
|
95
|
+
};
|
|
96
|
+
const publishAgentInput = {
|
|
97
|
+
...agentIdentityShape,
|
|
98
|
+
versionId: zod_1.z
|
|
99
|
+
.string()
|
|
100
|
+
.min(1)
|
|
101
|
+
.optional()
|
|
102
|
+
.describe('Republish a previously published version instead of the current draft. The draft is left untouched.'),
|
|
103
|
+
};
|
|
104
|
+
const revertAgentInput = {
|
|
105
|
+
...agentIdentityShape,
|
|
106
|
+
versionId: zod_1.z
|
|
107
|
+
.string()
|
|
108
|
+
.min(1)
|
|
109
|
+
.optional()
|
|
110
|
+
.describe('Published version to restore the draft from; defaults to the currently published version'),
|
|
111
|
+
};
|
|
112
|
+
const listAgentVersionsInput = {
|
|
113
|
+
...agentIdentityShape,
|
|
114
|
+
limit: zod_1.z.number().int().min(1).max(100).optional().default(20),
|
|
115
|
+
offset: zod_1.z.number().int().min(0).optional().default(0),
|
|
116
|
+
};
|
|
117
|
+
const searchAgentsInput = {
|
|
118
|
+
projectId: zod_1.z.string().min(1).optional().describe('Restrict results to one project'),
|
|
119
|
+
query: zod_1.z.string().optional().describe('Filter by Agent name'),
|
|
120
|
+
publishedOnly: zod_1.z.boolean().optional().default(false),
|
|
121
|
+
excludeAgentId: zod_1.z.string().optional().describe('Agent ID to omit, useful for sub-agent search'),
|
|
122
|
+
limit: zod_1.z.number().int().min(1).max(100).optional().default(50),
|
|
123
|
+
};
|
|
124
|
+
const initialAgentConfigSchema = api_types_1.AgentJsonConfigBaseSchema.omit({
|
|
125
|
+
name: true,
|
|
126
|
+
skills: true,
|
|
127
|
+
tasks: true,
|
|
128
|
+
integrations: true,
|
|
129
|
+
}).superRefine((config, ctx) => {
|
|
130
|
+
if (config.credential?.trim() && (0, api_types_1.isDraftAgentConfig)(config)) {
|
|
131
|
+
ctx.addIssue({
|
|
132
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
133
|
+
path: ['credential'],
|
|
134
|
+
message: 'A credential requires a model to be set',
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
if (config.tools?.some((tool) => tool.type === 'custom')) {
|
|
138
|
+
ctx.addIssue({
|
|
139
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
140
|
+
path: ['tools'],
|
|
141
|
+
message: 'Create custom tools with mutate_agent after creating the Agent',
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
const createAgentInput = {
|
|
146
|
+
projectId: zod_1.z.string().min(1),
|
|
147
|
+
name: zod_1.z.string().trim().min(1).max(128),
|
|
148
|
+
config: initialAgentConfigSchema
|
|
149
|
+
.optional()
|
|
150
|
+
.describe('Optional initial Agent config without name, skills, tasks, or custom tools. The top-level name is injected into the config.'),
|
|
151
|
+
};
|
|
152
|
+
const jsonPatchValueSchema = zod_1.z.union([
|
|
153
|
+
zod_1.z.null(),
|
|
154
|
+
zod_1.z.boolean(),
|
|
155
|
+
zod_1.z.number(),
|
|
156
|
+
zod_1.z.string(),
|
|
157
|
+
zod_1.z.array(zod_1.z.unknown()),
|
|
158
|
+
zod_1.z.record(zod_1.z.unknown()),
|
|
159
|
+
]);
|
|
160
|
+
const jsonPatchOperationSchema = zod_1.z.discriminatedUnion('op', [
|
|
161
|
+
zod_1.z.object({ op: zod_1.z.literal('add'), path: zod_1.z.string(), value: jsonPatchValueSchema }),
|
|
162
|
+
zod_1.z.object({ op: zod_1.z.literal('remove'), path: zod_1.z.string() }),
|
|
163
|
+
zod_1.z.object({ op: zod_1.z.literal('replace'), path: zod_1.z.string(), value: jsonPatchValueSchema }),
|
|
164
|
+
zod_1.z.object({ op: zod_1.z.literal('move'), from: zod_1.z.string(), path: zod_1.z.string() }),
|
|
165
|
+
zod_1.z.object({ op: zod_1.z.literal('copy'), from: zod_1.z.string(), path: zod_1.z.string() }),
|
|
166
|
+
zod_1.z.object({ op: zod_1.z.literal('test'), path: zod_1.z.string(), value: jsonPatchValueSchema }),
|
|
167
|
+
]);
|
|
168
|
+
const mutationOperationSchema = zod_1.z.discriminatedUnion('type', [
|
|
169
|
+
zod_1.z.object({ type: zod_1.z.literal('config.replace'), config: zod_1.z.record(zod_1.z.unknown()) }),
|
|
170
|
+
zod_1.z.object({
|
|
171
|
+
type: zod_1.z.literal('config.patch'),
|
|
172
|
+
patch: zod_1.z.array(jsonPatchOperationSchema).min(1),
|
|
173
|
+
}),
|
|
174
|
+
zod_1.z.object({
|
|
175
|
+
type: zod_1.z.literal('skill.upsert'),
|
|
176
|
+
skillId: zod_1.z.string().optional(),
|
|
177
|
+
skill: api_types_1.agentSkillSchema,
|
|
178
|
+
}),
|
|
179
|
+
zod_1.z.object({ type: zod_1.z.literal('skill.delete'), skillId: zod_1.z.string().min(1) }),
|
|
180
|
+
zod_1.z.object({
|
|
181
|
+
type: zod_1.z.literal('task.upsert'),
|
|
182
|
+
taskId: zod_1.z.string().optional(),
|
|
183
|
+
task: api_types_1.agentTaskSchema,
|
|
184
|
+
enabled: zod_1.z.boolean().optional(),
|
|
185
|
+
}),
|
|
186
|
+
zod_1.z.object({ type: zod_1.z.literal('task.delete'), taskId: zod_1.z.string().min(1) }),
|
|
187
|
+
zod_1.z.object({ type: zod_1.z.literal('customTool.upsert'), code: zod_1.z.string().min(1) }),
|
|
188
|
+
zod_1.z.object({ type: zod_1.z.literal('customTool.delete'), toolId: zod_1.z.string().min(1) }),
|
|
189
|
+
]);
|
|
190
|
+
const mutateAgentInput = {
|
|
191
|
+
...agentIdentityShape,
|
|
192
|
+
baseConfigHash: zod_1.z
|
|
193
|
+
.string()
|
|
194
|
+
.min(1)
|
|
195
|
+
.describe('Latest configHash returned by get_agent or a successful mutation'),
|
|
196
|
+
operation: mutationOperationSchema,
|
|
197
|
+
};
|
|
198
|
+
const discoverAssetsInput = {
|
|
199
|
+
projectId: zod_1.z.string().min(1),
|
|
200
|
+
kind: zod_1.z.enum(['models', 'integrations', 'workflows', 'subagents', 'mcpServers']),
|
|
201
|
+
query: zod_1.z
|
|
202
|
+
.string()
|
|
203
|
+
.trim()
|
|
204
|
+
.min(1)
|
|
205
|
+
.optional()
|
|
206
|
+
.describe('Optional filter for workflows, subagents, or MCP servers'),
|
|
207
|
+
provider: zod_1.z
|
|
208
|
+
.enum(api_types_1.AGENT_MODEL_PROVIDERS)
|
|
209
|
+
.optional()
|
|
210
|
+
.describe('Model provider for kind=models; omit to get a provider summary without model lists'),
|
|
211
|
+
credentialId: zod_1.z
|
|
212
|
+
.string()
|
|
213
|
+
.min(1)
|
|
214
|
+
.optional()
|
|
215
|
+
.describe('Accessible credential used to verify models for the selected provider'),
|
|
216
|
+
excludeAgentId: zod_1.z.string().optional().describe('Agent to omit when kind=subagents'),
|
|
217
|
+
};
|
|
218
|
+
const verifyMcpServerInput = {
|
|
219
|
+
projectId: zod_1.z.string().min(1),
|
|
220
|
+
name: zod_1.z
|
|
221
|
+
.string()
|
|
222
|
+
.min(1)
|
|
223
|
+
.max(64)
|
|
224
|
+
.regex(/^[a-zA-Z0-9_-]+$/),
|
|
225
|
+
url: httpUrlSchema.describe('HTTP(S) MCP server endpoint'),
|
|
226
|
+
transport: zod_1.z.enum(['sse', 'streamableHttp']).optional().default('streamableHttp'),
|
|
227
|
+
authentication: zod_1.z
|
|
228
|
+
.union([api_types_1.McpAuthenticationSchemaTypes, zod_1.z.string().endsWith('McpOAuth2Api')])
|
|
229
|
+
.optional()
|
|
230
|
+
.default('none')
|
|
231
|
+
.describe('Authentication method; every value other than none requires credential'),
|
|
232
|
+
credential: zod_1.z
|
|
233
|
+
.string()
|
|
234
|
+
.min(1)
|
|
235
|
+
.optional()
|
|
236
|
+
.describe('Accessible credential ID; required when authentication is not none'),
|
|
237
|
+
connectionTimeoutMs: zod_1.z.number().int().min(1).max(120_000).optional(),
|
|
238
|
+
};
|
|
239
|
+
const updateIntegrationInput = {
|
|
240
|
+
...agentIdentityShape,
|
|
241
|
+
action: zod_1.z.enum(['connect', 'disconnect']),
|
|
242
|
+
type: zod_1.z.string().min(1).describe('Integration type returned by discover_agent_assets'),
|
|
243
|
+
credentialId: zod_1.z.string().min(1).describe('Accessible credential for this integration'),
|
|
244
|
+
settings: zod_1.z
|
|
245
|
+
.record(zod_1.z.unknown())
|
|
246
|
+
.optional()
|
|
247
|
+
.describe('Integration settings; required for Telegram connect operations'),
|
|
248
|
+
};
|
|
249
|
+
const emptyInput = {};
|
|
250
|
+
function toolResult(data, isError = false) {
|
|
251
|
+
return {
|
|
252
|
+
content: [{ type: 'text', text: JSON.stringify(data) }],
|
|
253
|
+
structuredContent: data,
|
|
254
|
+
...(isError ? { isError: true } : {}),
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
let McpAgentToolsService = class McpAgentToolsService {
|
|
258
|
+
constructor(telemetry, credentialsService, agentsService, agentConfigService, agentValidationService, agentPublishService, agentSkillsService, agentTaskService, agentCustomToolsService, agentSecureRuntime, integrationPersistenceService, chatIntegrationService, chatIntegrationRegistry, agentModelCatalogService, attachableWorkflowsService, mcpRegistryService, nodeTypes, oauthService, outboundHttp, ssrfConfig, ssrfProtectionService, urlService, projectScopeService) {
|
|
259
|
+
this.telemetry = telemetry;
|
|
260
|
+
this.credentialsService = credentialsService;
|
|
261
|
+
this.agentsService = agentsService;
|
|
262
|
+
this.agentConfigService = agentConfigService;
|
|
263
|
+
this.agentValidationService = agentValidationService;
|
|
264
|
+
this.agentPublishService = agentPublishService;
|
|
265
|
+
this.agentSkillsService = agentSkillsService;
|
|
266
|
+
this.agentTaskService = agentTaskService;
|
|
267
|
+
this.agentCustomToolsService = agentCustomToolsService;
|
|
268
|
+
this.agentSecureRuntime = agentSecureRuntime;
|
|
269
|
+
this.integrationPersistenceService = integrationPersistenceService;
|
|
270
|
+
this.chatIntegrationService = chatIntegrationService;
|
|
271
|
+
this.chatIntegrationRegistry = chatIntegrationRegistry;
|
|
272
|
+
this.agentModelCatalogService = agentModelCatalogService;
|
|
273
|
+
this.attachableWorkflowsService = attachableWorkflowsService;
|
|
274
|
+
this.mcpRegistryService = mcpRegistryService;
|
|
275
|
+
this.nodeTypes = nodeTypes;
|
|
276
|
+
this.oauthService = oauthService;
|
|
277
|
+
this.outboundHttp = outboundHttp;
|
|
278
|
+
this.ssrfConfig = ssrfConfig;
|
|
279
|
+
this.ssrfProtectionService = ssrfProtectionService;
|
|
280
|
+
this.urlService = urlService;
|
|
281
|
+
this.projectScopeService = projectScopeService;
|
|
282
|
+
}
|
|
283
|
+
registerTools(server, user, allowedToolNames) {
|
|
284
|
+
const registerIfAllowed = (tool) => {
|
|
285
|
+
if (allowedToolNames && !allowedToolNames.has(tool.name))
|
|
286
|
+
return;
|
|
287
|
+
this.register(server, tool);
|
|
288
|
+
};
|
|
289
|
+
registerIfAllowed(this.searchAgentsTool(user));
|
|
290
|
+
registerIfAllowed(this.getAgentTool(user));
|
|
291
|
+
registerIfAllowed(this.createAgentTool(user));
|
|
292
|
+
registerIfAllowed(this.mutateAgentTool(user));
|
|
293
|
+
registerIfAllowed(this.validateAgentTool(user));
|
|
294
|
+
registerIfAllowed(this.publishAgentTool(user));
|
|
295
|
+
registerIfAllowed(this.unpublishAgentTool(user));
|
|
296
|
+
registerIfAllowed(this.revertAgentTool(user));
|
|
297
|
+
registerIfAllowed(this.listAgentVersionsTool(user));
|
|
298
|
+
registerIfAllowed(this.deleteAgentTool(user));
|
|
299
|
+
registerIfAllowed(this.discoverAssetsTool(user));
|
|
300
|
+
registerIfAllowed(this.verifyMcpServerTool(user));
|
|
301
|
+
registerIfAllowed(this.updateIntegrationTool(user));
|
|
302
|
+
registerIfAllowed(this.referenceTool(user));
|
|
303
|
+
if (allowedToolNames && !allowedToolNames.has('get_agent_builder_reference'))
|
|
304
|
+
return;
|
|
305
|
+
server.resource('agent-builder-reference', agent_reference_1.AGENT_BUILDER_REFERENCE_URI, { description: 'Reference for creating and managing n8n Agents through MCP.' }, () => ({
|
|
306
|
+
contents: [
|
|
307
|
+
{
|
|
308
|
+
uri: agent_reference_1.AGENT_BUILDER_REFERENCE_URI,
|
|
309
|
+
mimeType: 'text/markdown',
|
|
310
|
+
text: agent_reference_1.AGENT_BUILDER_REFERENCE,
|
|
311
|
+
},
|
|
312
|
+
],
|
|
313
|
+
}));
|
|
314
|
+
}
|
|
315
|
+
register(server, tool) {
|
|
316
|
+
server.registerTool(tool.name, tool.config, tool.handler);
|
|
317
|
+
}
|
|
318
|
+
searchAgentsTool(user) {
|
|
319
|
+
return {
|
|
320
|
+
name: 'search_agents',
|
|
321
|
+
config: {
|
|
322
|
+
description: 'Search Agents the current user can access. Use publishedOnly and excludeAgentId to discover saved sub-agents. Other agent tools only operate on agents with availableInMCP: true.',
|
|
323
|
+
inputSchema: searchAgentsInput,
|
|
324
|
+
annotations: {
|
|
325
|
+
title: 'Search Agents',
|
|
326
|
+
readOnlyHint: true,
|
|
327
|
+
destructiveHint: false,
|
|
328
|
+
idempotentHint: true,
|
|
329
|
+
openWorldHint: false,
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
handler: async (input) => await this.run(user, 'search_agents', { projectId: input.projectId }, async () => {
|
|
333
|
+
let projectIds;
|
|
334
|
+
if (input.projectId) {
|
|
335
|
+
await this.assertScope(user, input.projectId, 'agent:list');
|
|
336
|
+
projectIds = [input.projectId];
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
projectIds = await this.projectScopeService.getProjectIds(user, ['agent:list']);
|
|
340
|
+
}
|
|
341
|
+
const agents = await this.agentsService.findSummariesInProjects(projectIds, {
|
|
342
|
+
query: input.query?.trim() || undefined,
|
|
343
|
+
publishedOnly: input.publishedOnly,
|
|
344
|
+
excludeAgentId: input.excludeAgentId,
|
|
345
|
+
limit: input.limit,
|
|
346
|
+
});
|
|
347
|
+
const data = agents.map((agent) => ({
|
|
348
|
+
id: agent.id,
|
|
349
|
+
name: agent.name,
|
|
350
|
+
projectId: agent.projectId,
|
|
351
|
+
published: agent.activeVersionId !== null,
|
|
352
|
+
availableInMCP: agent.availableInMCP,
|
|
353
|
+
updatedAt: agent.updatedAt.toISOString(),
|
|
354
|
+
}));
|
|
355
|
+
return { ok: true, data, count: data.length };
|
|
356
|
+
}),
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
getAgentTool(user) {
|
|
360
|
+
return {
|
|
361
|
+
name: 'get_agent',
|
|
362
|
+
config: {
|
|
363
|
+
description: 'Read an Agent draft, sidecar resources, runnable state, and configHash. Call before mutate_agent. Pass versionId to inspect a published version snapshot instead of the draft.',
|
|
364
|
+
inputSchema: getAgentInput,
|
|
365
|
+
annotations: {
|
|
366
|
+
title: 'Get Agent',
|
|
367
|
+
readOnlyHint: true,
|
|
368
|
+
destructiveHint: false,
|
|
369
|
+
idempotentHint: true,
|
|
370
|
+
openWorldHint: false,
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
handler: async ({ agentId, versionId }) => await this.run(user, 'get_agent', { agentId, ...(versionId ? { versionId } : {}) }, async () => {
|
|
374
|
+
const agent = await this.resolveAgent(user, agentId);
|
|
375
|
+
await this.assertScope(user, agent.projectId, 'agent:read');
|
|
376
|
+
const snapshot = versionId
|
|
377
|
+
? await this.getAgentVersionSnapshot(agent.projectId, agentId, versionId)
|
|
378
|
+
: await this.getAgentSnapshot(user, agent);
|
|
379
|
+
return { ok: true, ...snapshot };
|
|
380
|
+
}),
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
createAgentTool(user) {
|
|
384
|
+
return {
|
|
385
|
+
name: mcp_constants_1.MCP_CREATE_AGENT_TOOL_NAME,
|
|
386
|
+
config: {
|
|
387
|
+
description: 'Create an Agent draft, optionally with its initial model, credential, instructions, and ordinary tool configuration. Returns its n8n editor URL. Use mutate_agent afterward for skills, tasks, and custom tools.',
|
|
388
|
+
inputSchema: createAgentInput,
|
|
389
|
+
annotations: {
|
|
390
|
+
title: 'Create Agent',
|
|
391
|
+
readOnlyHint: false,
|
|
392
|
+
destructiveHint: false,
|
|
393
|
+
idempotentHint: false,
|
|
394
|
+
openWorldHint: false,
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
handler: async ({ projectId, name, config }) => await this.run(user, 'create_agent', { projectId }, async () => {
|
|
398
|
+
await this.assertScope(user, projectId, 'agent:create');
|
|
399
|
+
const initialConfig = config ? { ...config, name } : undefined;
|
|
400
|
+
if (initialConfig) {
|
|
401
|
+
const validation = await this.agentConfigService.validateConfig(initialConfig);
|
|
402
|
+
if (!validation.valid) {
|
|
403
|
+
throw new n8n_workflow_1.UserError(`Invalid initial Agent config: ${validation.error}`);
|
|
404
|
+
}
|
|
405
|
+
await this.assertAccessibleCredentials(initialConfig, user, projectId);
|
|
406
|
+
}
|
|
407
|
+
const agent = await this.agentsService.create(projectId, name, {
|
|
408
|
+
availableInMCP: true,
|
|
409
|
+
});
|
|
410
|
+
let configHash;
|
|
411
|
+
let versionId = agent.versionId;
|
|
412
|
+
try {
|
|
413
|
+
if (initialConfig) {
|
|
414
|
+
const result = await this.agentConfigService.updateConfig(agent.id, projectId, initialConfig, user, { modifiedBy: 'mcp' });
|
|
415
|
+
configHash = (0, agent_config_hash_1.getAgentConfigHash)(result.config);
|
|
416
|
+
versionId = result.versionId;
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
configHash = await this.fetchConfigHash(projectId, agent.id);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
catch (error) {
|
|
423
|
+
await this.agentsService.delete(agent.id, projectId);
|
|
424
|
+
throw error;
|
|
425
|
+
}
|
|
426
|
+
return {
|
|
427
|
+
ok: true,
|
|
428
|
+
agent: {
|
|
429
|
+
id: agent.id,
|
|
430
|
+
name: agent.name,
|
|
431
|
+
projectId: agent.projectId,
|
|
432
|
+
published: false,
|
|
433
|
+
versionId,
|
|
434
|
+
activeVersionId: agent.activeVersionId,
|
|
435
|
+
},
|
|
436
|
+
configHash,
|
|
437
|
+
url: this.getAgentUrl(projectId, agent.id),
|
|
438
|
+
};
|
|
439
|
+
}),
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
mutateAgentTool(user) {
|
|
443
|
+
return {
|
|
444
|
+
name: 'mutate_agent',
|
|
445
|
+
config: {
|
|
446
|
+
description: 'Apply one config, skill, task, or custom-tool mutation to an Agent draft. The operation fields sit directly on the operation object (no value wrapper), e.g. { "type": "config.patch", "patch": [...] }. Returns the next configHash for subsequent mutations.',
|
|
447
|
+
inputSchema: mutateAgentInput,
|
|
448
|
+
annotations: {
|
|
449
|
+
title: 'Mutate Agent',
|
|
450
|
+
readOnlyHint: false,
|
|
451
|
+
destructiveHint: true,
|
|
452
|
+
idempotentHint: false,
|
|
453
|
+
openWorldHint: false,
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
handler: async (input) => await this.run(user, 'mutate_agent', { agentId: input.agentId, type: input.operation.type }, async () => {
|
|
457
|
+
const agent = await this.resolveAgent(user, input.agentId);
|
|
458
|
+
const projectId = agent.projectId;
|
|
459
|
+
await this.assertScope(user, projectId, 'agent:update');
|
|
460
|
+
const config = this.configFromEntity(agent);
|
|
461
|
+
const configHash = (0, agent_config_hash_1.getAgentConfigHash)(config);
|
|
462
|
+
if (configHash !== input.baseConfigHash) {
|
|
463
|
+
return {
|
|
464
|
+
ok: false,
|
|
465
|
+
code: 'stale_config',
|
|
466
|
+
agentId: input.agentId,
|
|
467
|
+
configHash,
|
|
468
|
+
message: 'Call get_agent before retrying the mutation.',
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
const { resource, config: newConfig } = await this.applyMutation(user, input, config, projectId);
|
|
472
|
+
return {
|
|
473
|
+
ok: true,
|
|
474
|
+
agentId: input.agentId,
|
|
475
|
+
operation: input.operation.type,
|
|
476
|
+
configHash: newConfig
|
|
477
|
+
? (0, agent_config_hash_1.getAgentConfigHash)(newConfig)
|
|
478
|
+
: await this.fetchConfigHash(projectId, input.agentId),
|
|
479
|
+
...(resource ? { resource } : {}),
|
|
480
|
+
};
|
|
481
|
+
}),
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
validateAgentTool(user) {
|
|
485
|
+
return {
|
|
486
|
+
name: 'validate_agent',
|
|
487
|
+
config: {
|
|
488
|
+
description: 'Validate an Agent draft, sidecar references, and user-accessible credentials. Returns its n8n editor URL.',
|
|
489
|
+
inputSchema: agentIdentityShape,
|
|
490
|
+
annotations: {
|
|
491
|
+
title: 'Validate Agent',
|
|
492
|
+
readOnlyHint: true,
|
|
493
|
+
destructiveHint: false,
|
|
494
|
+
idempotentHint: true,
|
|
495
|
+
openWorldHint: false,
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
handler: async ({ agentId }) => await this.run(user, 'validate_agent', { agentId }, async () => {
|
|
499
|
+
const agent = await this.resolveAgent(user, agentId);
|
|
500
|
+
await this.assertScope(user, agent.projectId, 'agent:read');
|
|
501
|
+
return {
|
|
502
|
+
ok: true,
|
|
503
|
+
...(await this.validateAgent(user, agent)),
|
|
504
|
+
url: this.getAgentUrl(agent.projectId, agentId),
|
|
505
|
+
};
|
|
506
|
+
}),
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
publishAgentTool(user) {
|
|
510
|
+
return {
|
|
511
|
+
name: 'publish_agent',
|
|
512
|
+
config: {
|
|
513
|
+
description: 'Publish a valid Agent draft and activate its tasks and integrations. Pass versionId to republish a previously published version instead. Only call after the user explicitly requests or confirms publication; completing a build does not imply approval.',
|
|
514
|
+
inputSchema: publishAgentInput,
|
|
515
|
+
annotations: {
|
|
516
|
+
title: 'Publish Agent',
|
|
517
|
+
readOnlyHint: false,
|
|
518
|
+
destructiveHint: false,
|
|
519
|
+
idempotentHint: true,
|
|
520
|
+
openWorldHint: true,
|
|
521
|
+
},
|
|
522
|
+
},
|
|
523
|
+
handler: async ({ agentId, versionId }) => await this.run(user, 'publish_agent', { agentId, ...(versionId ? { versionId } : {}) }, async () => {
|
|
524
|
+
const agent = await this.resolveAgent(user, agentId);
|
|
525
|
+
const projectId = agent.projectId;
|
|
526
|
+
await this.assertScope(user, projectId, 'agent:publish');
|
|
527
|
+
if (!versionId) {
|
|
528
|
+
const validation = await this.validateAgent(user, agent);
|
|
529
|
+
if (!validation.valid) {
|
|
530
|
+
throw new n8n_workflow_1.UserError(`Agent is not runnable: ${[...validation.errors, ...validation.missing].join(', ')}`);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
const { agent: publishedAgent } = await this.agentPublishService.publishAgent(agentId, projectId, user, { by: 'mcp', trigger: 'explicit' }, versionId);
|
|
534
|
+
return {
|
|
535
|
+
ok: true,
|
|
536
|
+
agentId,
|
|
537
|
+
published: true,
|
|
538
|
+
versionId: publishedAgent.versionId,
|
|
539
|
+
activeVersionId: publishedAgent.activeVersionId,
|
|
540
|
+
url: this.getAgentUrl(projectId, agentId),
|
|
541
|
+
};
|
|
542
|
+
}),
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
revertAgentTool(user) {
|
|
546
|
+
return {
|
|
547
|
+
name: 'revert_agent',
|
|
548
|
+
config: {
|
|
549
|
+
description: 'Restore an Agent draft from a published version, overwriting the draft config, skills, tasks, and custom tools. Does not publish. Inspect the version with get_agent first; the response returns the new configHash.',
|
|
550
|
+
inputSchema: revertAgentInput,
|
|
551
|
+
annotations: {
|
|
552
|
+
title: 'Revert Agent',
|
|
553
|
+
readOnlyHint: false,
|
|
554
|
+
destructiveHint: true,
|
|
555
|
+
idempotentHint: true,
|
|
556
|
+
openWorldHint: false,
|
|
557
|
+
},
|
|
558
|
+
},
|
|
559
|
+
handler: async ({ agentId, versionId }) => await this.run(user, 'revert_agent', { agentId, ...(versionId ? { versionId } : {}) }, async () => {
|
|
560
|
+
const { projectId } = await this.resolveAgent(user, agentId);
|
|
561
|
+
await this.assertScope(user, projectId, 'agent:update');
|
|
562
|
+
const agent = versionId
|
|
563
|
+
? await this.agentPublishService.revertToVersion(agentId, projectId, versionId, user, 'mcp')
|
|
564
|
+
: await this.agentPublishService.revertToPublishedAgent(agentId, projectId, user, 'mcp');
|
|
565
|
+
return {
|
|
566
|
+
ok: true,
|
|
567
|
+
agentId,
|
|
568
|
+
versionId: agent.versionId,
|
|
569
|
+
activeVersionId: agent.activeVersionId,
|
|
570
|
+
configHash: (0, agent_config_hash_1.getAgentConfigHash)(this.configFromEntity(agent)),
|
|
571
|
+
url: this.getAgentUrl(projectId, agentId),
|
|
572
|
+
};
|
|
573
|
+
}),
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
listAgentVersionsTool(user) {
|
|
577
|
+
return {
|
|
578
|
+
name: 'list_agent_versions',
|
|
579
|
+
config: {
|
|
580
|
+
description: 'List the publish history of an Agent, newest first. Pass a versionId to get_agent to inspect a version before revert_agent or publish_agent.',
|
|
581
|
+
inputSchema: listAgentVersionsInput,
|
|
582
|
+
annotations: {
|
|
583
|
+
title: 'List Agent Versions',
|
|
584
|
+
readOnlyHint: true,
|
|
585
|
+
destructiveHint: false,
|
|
586
|
+
idempotentHint: true,
|
|
587
|
+
openWorldHint: false,
|
|
588
|
+
},
|
|
589
|
+
},
|
|
590
|
+
handler: async ({ agentId, limit, offset }) => await this.run(user, 'list_agent_versions', { agentId }, async () => {
|
|
591
|
+
const { projectId } = await this.resolveAgent(user, agentId);
|
|
592
|
+
await this.assertScope(user, projectId, 'agent:read');
|
|
593
|
+
const versions = await this.agentPublishService.listPublishHistory(agentId, projectId, limit, offset);
|
|
594
|
+
return { ok: true, data: versions, count: versions.length };
|
|
595
|
+
}),
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
unpublishAgentTool(user) {
|
|
599
|
+
return {
|
|
600
|
+
name: 'unpublish_agent',
|
|
601
|
+
config: {
|
|
602
|
+
description: 'Unpublish an Agent and stop its live tasks and integrations.',
|
|
603
|
+
inputSchema: agentIdentityShape,
|
|
604
|
+
annotations: {
|
|
605
|
+
title: 'Unpublish Agent',
|
|
606
|
+
readOnlyHint: false,
|
|
607
|
+
destructiveHint: true,
|
|
608
|
+
idempotentHint: true,
|
|
609
|
+
openWorldHint: true,
|
|
610
|
+
},
|
|
611
|
+
},
|
|
612
|
+
handler: async ({ agentId }) => await this.run(user, 'unpublish_agent', { agentId }, async () => {
|
|
613
|
+
const { projectId } = await this.resolveAgent(user, agentId);
|
|
614
|
+
await this.assertScope(user, projectId, 'agent:unpublish');
|
|
615
|
+
const agent = await this.agentPublishService.unpublishAgent(agentId, projectId, user, 'mcp');
|
|
616
|
+
return {
|
|
617
|
+
ok: true,
|
|
618
|
+
agentId,
|
|
619
|
+
published: false,
|
|
620
|
+
versionId: agent.versionId,
|
|
621
|
+
activeVersionId: agent.activeVersionId,
|
|
622
|
+
};
|
|
623
|
+
}),
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
deleteAgentTool(user) {
|
|
627
|
+
return {
|
|
628
|
+
name: 'delete_agent',
|
|
629
|
+
config: {
|
|
630
|
+
description: 'Permanently delete an Agent and its associated resources.',
|
|
631
|
+
inputSchema: agentIdentityShape,
|
|
632
|
+
annotations: {
|
|
633
|
+
title: 'Delete Agent',
|
|
634
|
+
readOnlyHint: false,
|
|
635
|
+
destructiveHint: true,
|
|
636
|
+
idempotentHint: true,
|
|
637
|
+
openWorldHint: true,
|
|
638
|
+
},
|
|
639
|
+
},
|
|
640
|
+
handler: async ({ agentId }) => await this.run(user, 'delete_agent', { agentId }, async () => {
|
|
641
|
+
const { projectId } = await this.resolveAgent(user, agentId);
|
|
642
|
+
await this.assertScope(user, projectId, 'agent:delete');
|
|
643
|
+
const deleted = await this.agentsService.delete(agentId, projectId);
|
|
644
|
+
if (!deleted)
|
|
645
|
+
throw new n8n_workflow_1.UserError(`Agent "${agentId}" not found`);
|
|
646
|
+
return { ok: true, deleted: true, agentId };
|
|
647
|
+
}),
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
discoverAssetsTool(user) {
|
|
651
|
+
return {
|
|
652
|
+
name: 'discover_agent_assets',
|
|
653
|
+
config: {
|
|
654
|
+
description: 'Discover model catalogs, chat integrations, attachable workflows, published sub-agents, or MCP registry servers.',
|
|
655
|
+
inputSchema: discoverAssetsInput,
|
|
656
|
+
annotations: {
|
|
657
|
+
title: 'Discover Agent Assets',
|
|
658
|
+
readOnlyHint: true,
|
|
659
|
+
destructiveHint: false,
|
|
660
|
+
idempotentHint: true,
|
|
661
|
+
openWorldHint: true,
|
|
662
|
+
},
|
|
663
|
+
},
|
|
664
|
+
handler: async (input) => await this.run(user, 'discover_agent_assets', { projectId: input.projectId, kind: input.kind }, async () => {
|
|
665
|
+
await this.assertScope(user, input.projectId, 'agent:read');
|
|
666
|
+
return {
|
|
667
|
+
ok: true,
|
|
668
|
+
kind: input.kind,
|
|
669
|
+
data: await this.discoverAssets(user, input),
|
|
670
|
+
};
|
|
671
|
+
}),
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
verifyMcpServerTool(user) {
|
|
675
|
+
return {
|
|
676
|
+
name: 'verify_agent_mcp_server',
|
|
677
|
+
config: {
|
|
678
|
+
description: 'Test an MCP server with a user-accessible credential and return its available tools. Call before writing an mcpServers config entry; validate_agent performs no live MCP check.',
|
|
679
|
+
inputSchema: verifyMcpServerInput,
|
|
680
|
+
annotations: {
|
|
681
|
+
title: 'Verify Agent MCP Server',
|
|
682
|
+
readOnlyHint: true,
|
|
683
|
+
destructiveHint: false,
|
|
684
|
+
idempotentHint: true,
|
|
685
|
+
openWorldHint: true,
|
|
686
|
+
},
|
|
687
|
+
},
|
|
688
|
+
handler: async (input) => await this.run(user, 'verify_agent_mcp_server', { projectId: input.projectId, authentication: input.authentication }, async () => await this.verifyMcpServer(user, input)),
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
updateIntegrationTool(user) {
|
|
692
|
+
return {
|
|
693
|
+
name: 'update_agent_integration',
|
|
694
|
+
config: {
|
|
695
|
+
description: "Configure or disconnect a Slack, Telegram, or Linear conversation integration. This is the only way to manage integrations; config.replace and config.patch can't change them. Configuration never publishes the Agent. If the Agent is already published, connecting starts the channel immediately. Otherwise, the channel stays inactive until publish_agent is called.",
|
|
696
|
+
inputSchema: updateIntegrationInput,
|
|
697
|
+
annotations: {
|
|
698
|
+
title: 'Update Agent Integration',
|
|
699
|
+
readOnlyHint: false,
|
|
700
|
+
destructiveHint: true,
|
|
701
|
+
idempotentHint: true,
|
|
702
|
+
openWorldHint: true,
|
|
703
|
+
},
|
|
704
|
+
},
|
|
705
|
+
handler: async (input) => await this.run(user, 'update_agent_integration', {
|
|
706
|
+
agentId: input.agentId,
|
|
707
|
+
action: input.action,
|
|
708
|
+
type: input.type,
|
|
709
|
+
}, async () => await this.updateIntegration(user, input)),
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
referenceTool(user) {
|
|
713
|
+
return {
|
|
714
|
+
name: 'get_agent_builder_reference',
|
|
715
|
+
config: {
|
|
716
|
+
description: 'Return the required reference for Agent configuration and mutate_agent operations. Read before building an Agent.',
|
|
717
|
+
inputSchema: emptyInput,
|
|
718
|
+
annotations: {
|
|
719
|
+
title: 'Get Agent Builder Reference',
|
|
720
|
+
readOnlyHint: true,
|
|
721
|
+
destructiveHint: false,
|
|
722
|
+
idempotentHint: true,
|
|
723
|
+
openWorldHint: false,
|
|
724
|
+
},
|
|
725
|
+
},
|
|
726
|
+
handler: async () => await this.run(user, 'get_agent_builder_reference', {}, () => ({
|
|
727
|
+
ok: true,
|
|
728
|
+
uri: agent_reference_1.AGENT_BUILDER_REFERENCE_URI,
|
|
729
|
+
guide: agent_reference_1.AGENT_BUILDER_GUIDE,
|
|
730
|
+
configSchema: agent_reference_1.AGENT_CONFIG_JSON_SCHEMA,
|
|
731
|
+
})),
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
async getAgentSnapshot(user, agent) {
|
|
735
|
+
const { id: agentId, projectId } = agent;
|
|
736
|
+
const config = this.configFromEntity(agent);
|
|
737
|
+
const credentialProvider = this.credentialProvider(user, projectId);
|
|
738
|
+
const [runnable, skills, tasks] = await Promise.all([
|
|
739
|
+
this.agentValidationService.validateAgentIsRunnable(agentId, projectId, credentialProvider),
|
|
740
|
+
this.agentSkillsService.listSkills(agentId, projectId),
|
|
741
|
+
this.agentTaskService.list(agentId),
|
|
742
|
+
]);
|
|
743
|
+
const taskEnabled = new Map((config.tasks ?? []).map((task) => [task.id, task.enabled]));
|
|
744
|
+
const { integrations: _integrations, ...editableConfig } = config;
|
|
745
|
+
return {
|
|
746
|
+
agent: {
|
|
747
|
+
id: agent.id,
|
|
748
|
+
name: agent.name,
|
|
749
|
+
projectId: agent.projectId,
|
|
750
|
+
published: agent.activeVersionId !== null,
|
|
751
|
+
versionId: agent.versionId,
|
|
752
|
+
activeVersionId: agent.activeVersionId,
|
|
753
|
+
createdAt: agent.createdAt.toISOString(),
|
|
754
|
+
updatedAt: agent.updatedAt.toISOString(),
|
|
755
|
+
},
|
|
756
|
+
config: editableConfig,
|
|
757
|
+
configHash: (0, agent_config_hash_1.getAgentConfigHash)(config),
|
|
758
|
+
isRunnable: runnable.missing.length === 0,
|
|
759
|
+
missing: runnable.missing,
|
|
760
|
+
skills,
|
|
761
|
+
tasks: tasks.map((task) => ({ ...task, enabled: taskEnabled.get(task.id) ?? false })),
|
|
762
|
+
customTools: Object.entries(agent.tools ?? {}).map(([id, tool]) => ({
|
|
763
|
+
id,
|
|
764
|
+
descriptor: tool.descriptor,
|
|
765
|
+
})),
|
|
766
|
+
integrations: agent.integrations ?? [],
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
async getAgentVersionSnapshot(projectId, agentId, versionId) {
|
|
770
|
+
const { agent, version, tasks } = await this.agentPublishService.getVersion(agentId, projectId, versionId);
|
|
771
|
+
if (!version.schema)
|
|
772
|
+
throw new n8n_workflow_1.UserError(`Version "${versionId}" has no JSON config.`);
|
|
773
|
+
const { integrations: _integrations, ...editableConfig } = version.schema;
|
|
774
|
+
return {
|
|
775
|
+
agent: {
|
|
776
|
+
id: agent.id,
|
|
777
|
+
name: agent.name,
|
|
778
|
+
projectId: agent.projectId,
|
|
779
|
+
published: agent.activeVersionId !== null,
|
|
780
|
+
versionId: agent.versionId,
|
|
781
|
+
activeVersionId: agent.activeVersionId,
|
|
782
|
+
},
|
|
783
|
+
version: {
|
|
784
|
+
versionId: version.versionId,
|
|
785
|
+
author: version.author,
|
|
786
|
+
createdAt: version.createdAt.toISOString(),
|
|
787
|
+
isActive: version.versionId === agent.activeVersionId,
|
|
788
|
+
},
|
|
789
|
+
config: editableConfig,
|
|
790
|
+
skills: version.skills ?? {},
|
|
791
|
+
tasks: tasks.map((task) => ({
|
|
792
|
+
id: task.taskId,
|
|
793
|
+
name: task.name,
|
|
794
|
+
objective: task.objective,
|
|
795
|
+
cronExpression: task.cronExpression,
|
|
796
|
+
enabled: task.enabled,
|
|
797
|
+
})),
|
|
798
|
+
customTools: Object.entries(version.tools ?? {}).map(([id, tool]) => ({
|
|
799
|
+
id,
|
|
800
|
+
descriptor: tool.descriptor,
|
|
801
|
+
})),
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
async fetchConfigHash(projectId, agentId) {
|
|
805
|
+
return (0, agent_config_hash_1.getAgentConfigHash)(await this.agentConfigService.getConfig(agentId, projectId));
|
|
806
|
+
}
|
|
807
|
+
configFromEntity(agent) {
|
|
808
|
+
const config = (0, agent_config_composition_1.composeJsonConfig)(agent);
|
|
809
|
+
if (!config)
|
|
810
|
+
throw new n8n_workflow_1.UserError('Agent has no JSON config yet.');
|
|
811
|
+
return config;
|
|
812
|
+
}
|
|
813
|
+
getAgentUrl(projectId, agentId) {
|
|
814
|
+
return `${this.urlService.getInstanceBaseUrl()}/projects/${encodeURIComponent(projectId)}/agents/${encodeURIComponent(agentId)}`;
|
|
815
|
+
}
|
|
816
|
+
async applyMutation(user, input, config, projectId) {
|
|
817
|
+
const { agentId, operation } = input;
|
|
818
|
+
const telemetryContext = { user, modifiedBy: 'mcp' };
|
|
819
|
+
switch (operation.type) {
|
|
820
|
+
case 'config.replace': {
|
|
821
|
+
if (operation.config.integrations !== undefined) {
|
|
822
|
+
throw new n8n_workflow_1.UserError(INTEGRATIONS_NOT_IN_CONFIG_MESSAGE);
|
|
823
|
+
}
|
|
824
|
+
this.assertSanitizeStable(operation.config, config);
|
|
825
|
+
this.assertPassesConfigGuards(operation.config, config);
|
|
826
|
+
await this.assertAccessibleCredentials(operation.config, user, projectId);
|
|
827
|
+
const result = await this.agentConfigService.updateConfig(agentId, projectId, operation.config, user, { clearOmittedOptionalFields: true, modifiedBy: 'mcp' });
|
|
828
|
+
return { config: result.config };
|
|
829
|
+
}
|
|
830
|
+
case 'config.patch': {
|
|
831
|
+
const jsonpatch = (await import('fast-json-patch')).default;
|
|
832
|
+
const patchError = jsonpatch.validate(operation.patch, config);
|
|
833
|
+
if (patchError)
|
|
834
|
+
throw new n8n_workflow_1.UserError(patchError.message ?? 'Invalid JSON patch');
|
|
835
|
+
const patched = jsonpatch.applyPatch(jsonpatch.deepClone(config), operation.patch).newDocument;
|
|
836
|
+
if (integrationsChanged(config, patched)) {
|
|
837
|
+
throw new n8n_workflow_1.UserError(INTEGRATIONS_NOT_IN_CONFIG_MESSAGE);
|
|
838
|
+
}
|
|
839
|
+
this.assertSanitizeStable(patched, config);
|
|
840
|
+
this.assertPassesConfigGuards(patched, config);
|
|
841
|
+
await this.assertAccessibleCredentials(patched, user, projectId);
|
|
842
|
+
const result = await this.agentConfigService.updateConfig(agentId, projectId, patched, user, {
|
|
843
|
+
clearOmittedOptionalFields: true,
|
|
844
|
+
modifiedBy: 'mcp',
|
|
845
|
+
});
|
|
846
|
+
return { config: result.config };
|
|
847
|
+
}
|
|
848
|
+
case 'skill.upsert':
|
|
849
|
+
if (operation.skillId) {
|
|
850
|
+
const result = await this.agentSkillsService.updateSkill(agentId, projectId, operation.skillId, operation.skill, telemetryContext);
|
|
851
|
+
return { resource: { type: 'skill', id: result.id } };
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
const result = await this.agentSkillsService.createAndAttachSkill(agentId, projectId, operation.skill, telemetryContext);
|
|
855
|
+
return { resource: { type: 'skill', id: result.id } };
|
|
856
|
+
}
|
|
857
|
+
case 'skill.delete':
|
|
858
|
+
await this.agentSkillsService.deleteSkill(agentId, projectId, operation.skillId, telemetryContext);
|
|
859
|
+
return { resource: { type: 'skill', id: operation.skillId } };
|
|
860
|
+
case 'task.upsert':
|
|
861
|
+
if (operation.taskId) {
|
|
862
|
+
const result = await this.agentTaskService.update(agentId, projectId, operation.taskId, operation.task, telemetryContext);
|
|
863
|
+
if (operation.enabled !== undefined) {
|
|
864
|
+
const updated = await this.setTaskEnabled(user, agentId, projectId, operation.taskId, operation.enabled, config);
|
|
865
|
+
return { resource: { type: 'task', id: result.id }, config: updated };
|
|
866
|
+
}
|
|
867
|
+
return { resource: { type: 'task', id: result.id } };
|
|
868
|
+
}
|
|
869
|
+
else {
|
|
870
|
+
const result = await this.agentTaskService.create(agentId, projectId, {
|
|
871
|
+
...operation.task,
|
|
872
|
+
enabled: operation.enabled ?? true,
|
|
873
|
+
}, telemetryContext);
|
|
874
|
+
return { resource: { type: 'task', id: result.id } };
|
|
875
|
+
}
|
|
876
|
+
case 'task.delete':
|
|
877
|
+
await this.agentTaskService.delete(agentId, projectId, operation.taskId, telemetryContext);
|
|
878
|
+
return { resource: { type: 'task', id: operation.taskId } };
|
|
879
|
+
case 'customTool.upsert': {
|
|
880
|
+
const descriptor = await this.agentSecureRuntime.describeToolSecurely(operation.code);
|
|
881
|
+
const isAttached = (config.tools ?? []).some((tool) => tool.type === 'custom' && tool.id === descriptor.name);
|
|
882
|
+
const built = await this.agentCustomToolsService.buildCustomTool(agentId, projectId, operation.code, descriptor, telemetryContext, { recordTelemetry: isAttached });
|
|
883
|
+
if (isAttached) {
|
|
884
|
+
return { resource: { type: 'customTool', id: built.id }, config };
|
|
885
|
+
}
|
|
886
|
+
const next = {
|
|
887
|
+
...config,
|
|
888
|
+
tools: [...(config.tools ?? []), { type: 'custom', id: built.id }],
|
|
889
|
+
};
|
|
890
|
+
await this.assertAccessibleCredentials(next, user, projectId);
|
|
891
|
+
const result = await this.agentConfigService.updateConfig(agentId, projectId, next, user, {
|
|
892
|
+
modifiedBy: 'mcp',
|
|
893
|
+
});
|
|
894
|
+
return { resource: { type: 'customTool', id: built.id }, config: result.config };
|
|
895
|
+
}
|
|
896
|
+
case 'customTool.delete':
|
|
897
|
+
await this.agentCustomToolsService.deleteCustomTool(agentId, projectId, operation.toolId, telemetryContext);
|
|
898
|
+
return { resource: { type: 'customTool', id: operation.toolId } };
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
assertSanitizeStable(config, baseConfig) {
|
|
902
|
+
const sanitized = (0, api_types_1.sanitizeAgentJsonConfig)(config);
|
|
903
|
+
if (JSON.stringify(sanitized) === JSON.stringify(config))
|
|
904
|
+
return;
|
|
905
|
+
if (!(0, is_record_1.isRecord)(config) || !(0, is_record_1.isRecord)(sanitized))
|
|
906
|
+
return;
|
|
907
|
+
const base = baseConfig;
|
|
908
|
+
const fields = Object.keys(config).filter((key) => {
|
|
909
|
+
const submitted = JSON.stringify(config[key]);
|
|
910
|
+
return (submitted !== JSON.stringify(sanitized[key]) && submitted !== JSON.stringify(base[key]));
|
|
911
|
+
});
|
|
912
|
+
if (fields.length === 0)
|
|
913
|
+
return;
|
|
914
|
+
throw new n8n_workflow_1.UserError(`Config contains entries the schema does not support (in: ${fields.join(', ')}); saving would silently drop them. Compare against the config schema from get_agent_builder_reference — e.g. sub-agents belong under subAgents.agents, not tools.`);
|
|
915
|
+
}
|
|
916
|
+
assertPassesConfigGuards(next, baseConfig) {
|
|
917
|
+
const parsed = api_types_1.AgentJsonConfigSchema.safeParse((0, api_types_1.sanitizeAgentJsonConfig)(next));
|
|
918
|
+
if (!parsed.success)
|
|
919
|
+
return;
|
|
920
|
+
const errors = (0, agent_config_1.rejectIfEmptyInstructions)(parsed.data, MCP_AGENT_CONFIG_MESSAGES) ??
|
|
921
|
+
(0, agent_config_1.rejectIfUnsupportedNativeWebSearch)(parsed.data) ??
|
|
922
|
+
(0, agent_config_1.rejectIfDynamicSelectorUsesFromAi)(parsed.data, baseConfig, this.nodeTypes, MCP_AGENT_CONFIG_MESSAGES);
|
|
923
|
+
if (errors) {
|
|
924
|
+
throw new n8n_workflow_1.UserError(errors.map((error) => `${error.path}: ${error.message}`).join('; '));
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
async assertAccessibleCredentials(config, user, projectId) {
|
|
928
|
+
const accessibleIds = new Set((await this.credentialProvider(user, projectId).list()).map((credential) => credential.id));
|
|
929
|
+
const sanitized = (0, sanitize_unknown_agent_credentials_1.sanitizeUnknownAgentCredentials)(config, accessibleIds);
|
|
930
|
+
if (JSON.stringify(sanitized) === JSON.stringify(config))
|
|
931
|
+
return;
|
|
932
|
+
const ids = new Set();
|
|
933
|
+
collectClearedCredentialIds(config, sanitized, ids);
|
|
934
|
+
throw new n8n_workflow_1.UserError(`Config references credentials you cannot use in this project: ${[...ids].join(', ')}. Saving would silently clear them. Use list_credentials to find an accessible credential, or remove the reference.`);
|
|
935
|
+
}
|
|
936
|
+
async setTaskEnabled(user, agentId, projectId, taskId, enabled, config) {
|
|
937
|
+
let found = false;
|
|
938
|
+
const tasks = (config.tasks ?? []).map((task) => {
|
|
939
|
+
if (task.id !== taskId)
|
|
940
|
+
return task;
|
|
941
|
+
found = true;
|
|
942
|
+
return { ...task, enabled };
|
|
943
|
+
});
|
|
944
|
+
if (!found)
|
|
945
|
+
throw new n8n_workflow_1.UserError(`Task "${taskId}" is not attached to the Agent`);
|
|
946
|
+
const next = { ...config, tasks };
|
|
947
|
+
await this.assertAccessibleCredentials(next, user, projectId);
|
|
948
|
+
const result = await this.agentConfigService.updateConfig(agentId, projectId, next, user, {
|
|
949
|
+
modifiedBy: 'mcp',
|
|
950
|
+
});
|
|
951
|
+
return result.config;
|
|
952
|
+
}
|
|
953
|
+
async validateAgent(user, agent) {
|
|
954
|
+
const projectId = agent.projectId;
|
|
955
|
+
const config = this.configFromEntity(agent);
|
|
956
|
+
const credentialProvider = this.credentialProvider(user, projectId);
|
|
957
|
+
const [schema, configuration] = await Promise.all([
|
|
958
|
+
this.agentConfigService.validateConfig(config),
|
|
959
|
+
this.agentValidationService.validateLoadedAgentConfiguration(agent, projectId, credentialProvider, 'publish'),
|
|
960
|
+
]);
|
|
961
|
+
const errors = schema.valid ? [] : [schema.error];
|
|
962
|
+
const missing = [...new Set(configuration.issues.map((issue) => issue.path))];
|
|
963
|
+
return {
|
|
964
|
+
valid: errors.length === 0 && missing.length === 0,
|
|
965
|
+
errors,
|
|
966
|
+
missing,
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
async discoverAssets(user, input) {
|
|
970
|
+
switch (input.kind) {
|
|
971
|
+
case 'models': {
|
|
972
|
+
if (input.provider) {
|
|
973
|
+
return await this.agentModelCatalogService.getProviderModels(user, input.projectId, input.provider, input.credentialId);
|
|
974
|
+
}
|
|
975
|
+
const catalog = (0, model_catalog_1.filterOfferedAgentModelProviders)(await (await import('@n8n/agents')).fetchProviderCatalog());
|
|
976
|
+
return {
|
|
977
|
+
providers: Object.values(catalog).map((provider) => ({
|
|
978
|
+
provider: provider.id,
|
|
979
|
+
name: provider.name,
|
|
980
|
+
modelCount: Object.keys(provider.models).length,
|
|
981
|
+
})),
|
|
982
|
+
hint: 'Pass provider (and optionally credentialId) to list the models of one provider.',
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
case 'integrations':
|
|
986
|
+
return this.integrationPersistenceService.listChatIntegrations().map((integration) => ({
|
|
987
|
+
...integration,
|
|
988
|
+
settingsRequired: integration.type === 'telegram',
|
|
989
|
+
...(integration.type === 'telegram'
|
|
990
|
+
? {
|
|
991
|
+
settingsSchema: TELEGRAM_SETTINGS_JSON_SCHEMA,
|
|
992
|
+
settingsGuidance: 'Pass accessMode=public with allowedUsers=[], or accessMode=private with at least one Telegram user ID or username.',
|
|
993
|
+
}
|
|
994
|
+
: {}),
|
|
995
|
+
}));
|
|
996
|
+
case 'workflows':
|
|
997
|
+
return await this.attachableWorkflowsService.list(user, input.projectId, input.query);
|
|
998
|
+
case 'subagents': {
|
|
999
|
+
const summaries = await this.agentsService.findSummariesInProjects([input.projectId], {
|
|
1000
|
+
query: input.query?.trim() || undefined,
|
|
1001
|
+
publishedOnly: true,
|
|
1002
|
+
excludeAgentId: input.excludeAgentId,
|
|
1003
|
+
});
|
|
1004
|
+
return summaries.map((agent) => ({ agentId: agent.id, name: agent.name }));
|
|
1005
|
+
}
|
|
1006
|
+
case 'mcpServers':
|
|
1007
|
+
return input.query
|
|
1008
|
+
? await this.mcpRegistryService.search([input.query])
|
|
1009
|
+
: await this.mcpRegistryService.list(MCP_SERVER_DISCOVERY_LIMIT);
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
async verifyMcpServer(user, input) {
|
|
1013
|
+
await this.assertScope(user, input.projectId, 'agent:read');
|
|
1014
|
+
const credentialProvider = this.credentialProvider(user, input.projectId);
|
|
1015
|
+
if (input.authentication !== 'none') {
|
|
1016
|
+
if (!input.credential) {
|
|
1017
|
+
throw new n8n_workflow_1.UserError('credential is required when authentication is not none');
|
|
1018
|
+
}
|
|
1019
|
+
await this.requireAccessibleCredential(credentialProvider, input.credential);
|
|
1020
|
+
}
|
|
1021
|
+
const tools = await (0, mcp_client_factory_1.listMcpServerTools)({
|
|
1022
|
+
name: input.name,
|
|
1023
|
+
url: input.url,
|
|
1024
|
+
transport: input.transport,
|
|
1025
|
+
authentication: input.authentication,
|
|
1026
|
+
credential: input.credential,
|
|
1027
|
+
...(input.connectionTimeoutMs !== undefined
|
|
1028
|
+
? { connectionTimeoutMs: input.connectionTimeoutMs }
|
|
1029
|
+
: {}),
|
|
1030
|
+
}, {
|
|
1031
|
+
credentialProvider,
|
|
1032
|
+
oauthService: this.oauthService,
|
|
1033
|
+
projectId: input.projectId,
|
|
1034
|
+
proxyFetch: (0, ai_proxy_fetch_1.createAiMcpFetch)(this.outboundHttp, this.ssrfConfig, this.ssrfProtectionService),
|
|
1035
|
+
});
|
|
1036
|
+
return { ok: true, tools };
|
|
1037
|
+
}
|
|
1038
|
+
async updateIntegration(user, input) {
|
|
1039
|
+
const agent = await this.resolveAgent(user, input.agentId);
|
|
1040
|
+
const projectId = agent.projectId;
|
|
1041
|
+
await this.assertScope(user, projectId, 'agent:update');
|
|
1042
|
+
return input.action === 'disconnect'
|
|
1043
|
+
? await this.disconnectIntegration(user, input, agent)
|
|
1044
|
+
: await this.connectIntegration(user, input, agent, projectId);
|
|
1045
|
+
}
|
|
1046
|
+
async disconnectIntegration(user, input, agent) {
|
|
1047
|
+
const persisted = (agent.integrations ?? []).find((item) => item.type === input.type && item.credentialId === input.credentialId);
|
|
1048
|
+
const parsed = api_types_1.AgentIntegrationSchema.safeParse({
|
|
1049
|
+
type: input.type,
|
|
1050
|
+
credentialId: input.credentialId,
|
|
1051
|
+
});
|
|
1052
|
+
const integration = persisted ?? (parsed.success ? parsed.data : undefined);
|
|
1053
|
+
if (integration) {
|
|
1054
|
+
await this.chatIntegrationService.disconnectChannel(input.agentId, integration);
|
|
1055
|
+
}
|
|
1056
|
+
else {
|
|
1057
|
+
await this.chatIntegrationService.disconnect(input.agentId, {
|
|
1058
|
+
type: input.type,
|
|
1059
|
+
credentialId: input.credentialId,
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
const saved = await this.integrationPersistenceService.removeCredentialIntegration(agent, input.type, input.credentialId, { user, modifiedBy: 'mcp', broadcast: false });
|
|
1063
|
+
return {
|
|
1064
|
+
ok: true,
|
|
1065
|
+
agentId: input.agentId,
|
|
1066
|
+
integration: { type: input.type, credentialId: input.credentialId },
|
|
1067
|
+
connected: false,
|
|
1068
|
+
published: saved.activeVersionId !== null,
|
|
1069
|
+
activeVersionId: saved.activeVersionId,
|
|
1070
|
+
configHash: (0, agent_config_hash_1.getAgentConfigHash)(this.configFromEntity(saved)),
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
async connectIntegration(user, input, agent, projectId) {
|
|
1074
|
+
const candidate = {
|
|
1075
|
+
type: input.type,
|
|
1076
|
+
credentialId: input.credentialId,
|
|
1077
|
+
...(input.settings ? { settings: input.settings } : {}),
|
|
1078
|
+
};
|
|
1079
|
+
const parsed = api_types_1.AgentIntegrationSchema.safeParse(candidate);
|
|
1080
|
+
if (!parsed.success)
|
|
1081
|
+
throw new n8n_workflow_1.UserError(`Invalid integration: ${parsed.error.message}`);
|
|
1082
|
+
if (parsed.data.type === 'telegram' && !parsed.data.settings) {
|
|
1083
|
+
throw new n8n_workflow_1.UserError('Telegram integration settings are required');
|
|
1084
|
+
}
|
|
1085
|
+
const credential = await this.requireAccessibleCredential(this.credentialProvider(user, projectId), input.credentialId);
|
|
1086
|
+
const implementation = this.chatIntegrationRegistry.require(parsed.data.type);
|
|
1087
|
+
if (!implementation.credentialTypes.includes(credential.type)) {
|
|
1088
|
+
throw new n8n_workflow_1.UserError(`${implementation.displayLabel} integrations do not support ${credential.type} credentials`);
|
|
1089
|
+
}
|
|
1090
|
+
const saved = await this.integrationPersistenceService.saveCredentialIntegration(agent, parsed.data, { user, modifiedBy: 'mcp', broadcast: false });
|
|
1091
|
+
const result = {
|
|
1092
|
+
ok: true,
|
|
1093
|
+
agentId: input.agentId,
|
|
1094
|
+
integration: { type: input.type, credentialId: input.credentialId },
|
|
1095
|
+
configured: true,
|
|
1096
|
+
published: saved.activeVersionId !== null,
|
|
1097
|
+
activeVersionId: saved.activeVersionId,
|
|
1098
|
+
configHash: (0, agent_config_hash_1.getAgentConfigHash)(this.configFromEntity(saved)),
|
|
1099
|
+
};
|
|
1100
|
+
if (saved.activeVersionId === null)
|
|
1101
|
+
return { ...result, connected: false };
|
|
1102
|
+
await this.chatIntegrationService.connect(input.agentId, parsed.data, projectId);
|
|
1103
|
+
await this.chatIntegrationService.broadcastIntegrationChange(input.agentId, parsed.data, 'connect');
|
|
1104
|
+
return {
|
|
1105
|
+
...result,
|
|
1106
|
+
connected: true,
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
credentialProvider(user, projectId) {
|
|
1110
|
+
return (0, agent_credential_provider_1.createAgentCredentialProvider)(this.credentialsService, projectId, user);
|
|
1111
|
+
}
|
|
1112
|
+
async requireAccessibleCredential(credentialProvider, credentialId) {
|
|
1113
|
+
const credential = (await credentialProvider.list()).find((item) => item.id === credentialId);
|
|
1114
|
+
if (!credential)
|
|
1115
|
+
throw new n8n_workflow_1.UserError('Credential not found or not accessible');
|
|
1116
|
+
return credential;
|
|
1117
|
+
}
|
|
1118
|
+
async resolveAgent(user, agentId) {
|
|
1119
|
+
const agent = await this.agentsService.findByIdForUser(agentId, user);
|
|
1120
|
+
if (!agent)
|
|
1121
|
+
throw new n8n_workflow_1.UserError(`Agent "${agentId}" not found`);
|
|
1122
|
+
if (!agent.availableInMCP) {
|
|
1123
|
+
throw new n8n_workflow_1.UserError('Agent is not available in MCP. Enable MCP access from the agents list, or from the MCP settings page.');
|
|
1124
|
+
}
|
|
1125
|
+
return agent;
|
|
1126
|
+
}
|
|
1127
|
+
async assertScope(user, projectId, scope) {
|
|
1128
|
+
if (!(await (0, check_access_1.userHasScopes)(user, [scope], false, { projectId }))) {
|
|
1129
|
+
throw new forbidden_error_1.ForbiddenError('You do not have permission to access agents in this project.');
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
async run(user, toolName, parameters, action) {
|
|
1133
|
+
const telemetryPayload = {
|
|
1134
|
+
user_id: user.id,
|
|
1135
|
+
tool_name: toolName,
|
|
1136
|
+
parameters,
|
|
1137
|
+
};
|
|
1138
|
+
try {
|
|
1139
|
+
const data = await action();
|
|
1140
|
+
telemetryPayload.results = { success: data.ok !== false };
|
|
1141
|
+
this.telemetry.track(mcp_constants_1.USER_CALLED_MCP_TOOL_EVENT, telemetryPayload);
|
|
1142
|
+
return toolResult(data, data.ok === false);
|
|
1143
|
+
}
|
|
1144
|
+
catch (error) {
|
|
1145
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1146
|
+
telemetryPayload.results = { success: false, error: message };
|
|
1147
|
+
this.telemetry.track(mcp_constants_1.USER_CALLED_MCP_TOOL_EVENT, telemetryPayload);
|
|
1148
|
+
return toolResult({ ok: false, code: 'agent_tool_error', error: message }, true);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
};
|
|
1152
|
+
exports.McpAgentToolsService = McpAgentToolsService;
|
|
1153
|
+
exports.McpAgentToolsService = McpAgentToolsService = __decorate([
|
|
1154
|
+
(0, di_1.Service)(),
|
|
1155
|
+
__metadata("design:paramtypes", [telemetry_1.Telemetry, credentials_service_1.CredentialsService, agents_service_1.AgentsService, agent_config_service_1.AgentConfigService, agent_validation_service_1.AgentValidationService, agent_publish_service_1.AgentPublishService, agent_skills_service_1.AgentSkillsService, agent_task_service_1.AgentTaskService, agent_custom_tools_service_1.AgentCustomToolsService, agent_secure_runtime_1.AgentSecureRuntime, agent_integration_persistence_service_1.AgentIntegrationPersistenceService, chat_integration_service_1.ChatIntegrationService, agent_chat_integration_1.ChatIntegrationRegistry, agent_model_catalog_service_1.AgentModelCatalogService, attachable_workflows_service_1.AttachableWorkflowsService, mcp_registry_service_1.McpRegistryService, node_types_1.NodeTypes, oauth_service_1.OauthService, backend_network_1.OutboundHttp, config_1.SsrfProtectionConfig, backend_network_1.SsrfProtectionService, url_service_1.UrlService, project_scope_service_1.ProjectScopeService])
|
|
1156
|
+
], McpAgentToolsService);
|
|
1157
|
+
//# sourceMappingURL=agent-tools.service.js.map
|