n8n 2.34.3 → 2.35.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-workflow-manager.js +2 -14
- package/dist/active-workflow-manager.js.map +1 -1
- package/dist/agent-library-bundle.js +6 -6
- package/dist/build.tsbuildinfo +1 -1
- package/dist/controllers/ai.controller.js +3 -0
- package/dist/controllers/ai.controller.js.map +1 -1
- package/dist/controllers/role.controller.d.ts +0 -1
- package/dist/controllers/role.controller.js +6 -14
- package/dist/controllers/role.controller.js.map +1 -1
- package/dist/credentials/credentials.controller.d.ts +1 -1
- package/dist/credentials/credentials.controller.js +7 -1
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +2 -1
- package/dist/credentials/credentials.service.js +24 -0
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials-helper.js +4 -7
- package/dist/credentials-helper.js.map +1 -1
- package/dist/deprecation/deprecation.service.js +5 -0
- package/dist/deprecation/deprecation.service.js.map +1 -1
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +9 -0
- package/dist/events/relays/telemetry.event-relay.d.ts +4 -2
- package/dist/events/relays/telemetry.event-relay.js +23 -7
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execute-error-workflow.js +19 -5
- package/dist/execution-lifecycle/execute-error-workflow.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/executions/execution-persistence.d.ts +6 -4
- package/dist/executions/execution-persistence.js +7 -14
- package/dist/executions/execution-persistence.js.map +1 -1
- package/dist/executions/execution.service.d.ts +31 -2
- package/dist/executions/execution.service.js +108 -1
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/middlewares/body-parser.js +3 -2
- package/dist/middlewares/body-parser.js.map +1 -1
- package/dist/middlewares/cors.js +1 -1
- package/dist/middlewares/cors.js.map +1 -1
- package/dist/modules/agent-evals/agent-eval-rating.service.d.ts +12 -15
- package/dist/modules/agent-evals/agent-eval-rating.service.js +33 -46
- package/dist/modules/agent-evals/agent-eval-rating.service.js.map +1 -1
- package/dist/modules/agent-evals/agent-eval-record-mappers.d.ts +3 -2
- package/dist/modules/agent-evals/agent-eval-record-mappers.js +13 -0
- package/dist/modules/agent-evals/agent-eval-record-mappers.js.map +1 -1
- package/dist/modules/agent-evals/agent-eval-runner.service.js +15 -7
- package/dist/modules/agent-evals/agent-eval-runner.service.js.map +1 -1
- package/dist/modules/agent-evals/agent-eval.service.d.ts +8 -3
- package/dist/modules/agent-evals/agent-eval.service.js +6 -6
- package/dist/modules/agent-evals/agent-eval.service.js.map +1 -1
- package/dist/modules/agent-evals/agent-evals-required-modules.js +2 -2
- package/dist/modules/agent-evals/agent-evals-required-modules.js.map +1 -1
- package/dist/modules/agent-evals/agent-evals.controller.d.ts +12 -4
- package/dist/modules/agent-evals/agent-evals.controller.js +50 -9
- package/dist/modules/agent-evals/agent-evals.controller.js.map +1 -1
- package/dist/modules/agents/agent-chat.controller.d.ts +3 -5
- package/dist/modules/agents/agent-chat.controller.js +19 -25
- package/dist/modules/agents/agent-chat.controller.js.map +1 -1
- package/dist/modules/agents/agent-config.service.d.ts +5 -1
- package/dist/modules/agents/agent-config.service.js +10 -3
- package/dist/modules/agents/agent-config.service.js.map +1 -1
- package/dist/modules/agents/agent-credential-index.listener.d.ts +11 -0
- package/dist/modules/agents/agent-credential-index.listener.js +55 -0
- package/dist/modules/agents/agent-credential-index.listener.js.map +1 -0
- package/dist/modules/agents/agent-credential-index.service.d.ts +14 -0
- package/dist/modules/agents/agent-credential-index.service.js +57 -0
- package/dist/modules/agents/agent-credential-index.service.js.map +1 -0
- package/dist/modules/agents/agent-execution-orchestrator.service.d.ts +5 -0
- package/dist/modules/agents/agent-execution-orchestrator.service.js +89 -23
- package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
- package/dist/modules/agents/agent-execution-update-broadcaster.d.ts +20 -0
- package/dist/modules/agents/agent-execution-update-broadcaster.js +65 -0
- package/dist/modules/agents/agent-execution-update-broadcaster.js.map +1 -0
- package/dist/modules/agents/agent-execution.service.d.ts +30 -4
- package/dist/modules/agents/agent-execution.service.js +217 -46
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-integration-management.service.d.ts +33 -0
- package/dist/modules/agents/agent-integration-management.service.js +80 -0
- package/dist/modules/agents/agent-integration-management.service.js.map +1 -0
- package/dist/modules/agents/agent-integration-persistence.service.d.ts +3 -1
- package/dist/modules/agents/agent-integration-persistence.service.js +6 -2
- package/dist/modules/agents/agent-integration-persistence.service.js.map +1 -1
- package/dist/modules/agents/agent-integrations.controller.d.ts +4 -24
- package/dist/modules/agents/agent-integrations.controller.js +28 -114
- package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
- package/dist/modules/agents/agent-interrupted-execution-sweeper.d.ts +11 -0
- package/dist/modules/agents/agent-interrupted-execution-sweeper.js +63 -0
- package/dist/modules/agents/agent-interrupted-execution-sweeper.js.map +1 -0
- package/dist/modules/agents/agent-model-catalog.service.d.ts +1 -0
- package/dist/modules/agents/agent-model-catalog.service.js +37 -8
- package/dist/modules/agents/agent-model-catalog.service.js.map +1 -1
- package/dist/modules/agents/agent-publish.service.d.ts +3 -1
- package/dist/modules/agents/agent-publish.service.js +8 -2
- package/dist/modules/agents/agent-publish.service.js.map +1 -1
- package/dist/modules/agents/agent-run-tracing.service.d.ts +1 -0
- package/dist/modules/agents/agent-run-tracing.service.js +4 -1
- package/dist/modules/agents/agent-run-tracing.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 +3 -1
- package/dist/modules/agents/agent-runtime-reconstruction.service.js +14 -8
- package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
- package/dist/modules/agents/agent-slack-integrations.controller.d.ts +23 -0
- package/dist/modules/agents/agent-slack-integrations.controller.js +98 -0
- package/dist/modules/agents/agent-slack-integrations.controller.js.map +1 -0
- package/dist/modules/agents/agent-test-run.service.d.ts +134 -0
- package/dist/modules/agents/agent-test-run.service.js +240 -0
- package/dist/modules/agents/agent-test-run.service.js.map +1 -0
- package/dist/modules/agents/agent-validation.service.d.ts +1 -0
- package/dist/modules/agents/agent-validation.service.js +32 -13
- package/dist/modules/agents/agent-validation.service.js.map +1 -1
- package/dist/modules/agents/agent-workflow-execution.service.d.ts +5 -1
- package/dist/modules/agents/agent-workflow-execution.service.js +137 -64
- package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
- package/dist/modules/agents/agents-config.controller.d.ts +8 -0
- package/dist/modules/agents/agents.module.d.ts +3 -1
- package/dist/modules/agents/agents.module.js +35 -1
- package/dist/modules/agents/agents.module.js.map +1 -1
- package/dist/modules/agents/agents.service.d.ts +4 -2
- package/dist/modules/agents/agents.service.js +6 -2
- package/dist/modules/agents/agents.service.js.map +1 -1
- package/dist/modules/agents/attachable-workflows.service.d.ts +1 -0
- package/dist/modules/agents/attachable-workflows.service.js +2 -1
- package/dist/modules/agents/attachable-workflows.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 +26 -7
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +4 -2
- package/dist/modules/agents/builder/agents-builder-tools.service.js +130 -2
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/builder-model-live-lookup.service.d.ts +16 -1
- package/dist/modules/agents/builder/builder-model-live-lookup.service.js +69 -22
- package/dist/modules/agents/builder/builder-model-live-lookup.service.js.map +1 -1
- package/dist/modules/agents/builder/builder-tool-names.d.ts +1 -0
- package/dist/modules/agents/builder/builder-tool-names.js +1 -0
- package/dist/modules/agents/builder/builder-tool-names.js.map +1 -1
- package/dist/modules/agents/builder/get-resource-locator-options.tool.d.ts +2 -2
- package/dist/modules/agents/builder/interactive/finish-setup.tool.d.ts +1 -0
- package/dist/modules/agents/builder/interactive/finish-setup.tool.js +4 -2
- package/dist/modules/agents/builder/interactive/finish-setup.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +68 -2
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +1 -0
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -1
- package/dist/modules/agents/builder/prompts/tools.prompt.js +5 -2
- package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -1
- package/dist/modules/agents/builder/skills/external-services.skill.js +26 -2
- package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
- package/dist/modules/agents/entities/agent-credential-dependency.entity.d.ts +9 -0
- package/dist/modules/agents/entities/agent-credential-dependency.entity.js +40 -0
- package/dist/modules/agents/entities/agent-credential-dependency.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-execution.entity.d.ts +1 -1
- package/dist/modules/agents/entities/agent-execution.entity.js +2 -1
- package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -1
- package/dist/modules/agents/execution-recorder.d.ts +7 -1
- package/dist/modules/agents/execution-recorder.js +64 -8
- package/dist/modules/agents/execution-recorder.js.map +1 -1
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +6 -2
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +24 -3
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +3 -2
- package/dist/modules/agents/integrations/agent-chat-bridge.js +30 -13
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.d.ts +3 -2
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js +25 -12
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +38 -6
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-message-context.js +13 -6
- package/dist/modules/agents/integrations/agent-chat-message-context.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.js +7 -1
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.js.map +1 -1
- package/dist/modules/agents/integrations/callback-store.d.ts +13 -4
- package/dist/modules/agents/integrations/callback-store.js +44 -18
- package/dist/modules/agents/integrations/callback-store.js.map +1 -1
- package/dist/modules/agents/integrations/chat-integration.service.d.ts +7 -3
- package/dist/modules/agents/integrations/chat-integration.service.js +59 -22
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
- package/dist/modules/agents/integrations/component-mapper.d.ts +1 -1
- package/dist/modules/agents/integrations/component-mapper.js +1 -1
- package/dist/modules/agents/integrations/component-mapper.js.map +1 -1
- package/dist/modules/agents/integrations/esm-loader.d.ts +1 -0
- package/dist/modules/agents/integrations/esm-loader.js +4 -0
- package/dist/modules/agents/integrations/esm-loader.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 +74 -20
- package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-definitions.js +35 -2
- package/dist/modules/agents/integrations/integration-tool-definitions.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-execution.js +10 -5
- package/dist/modules/agents/integrations/integration-tool-execution.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-schema.js +8 -2
- package/dist/modules/agents/integrations/integration-tool-schema.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-types.d.ts +2 -0
- package/dist/modules/agents/integrations/n8n-memory.js +6 -7
- package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/discord-gateway.d.ts +32 -0
- package/dist/modules/agents/integrations/platforms/discord-gateway.js +138 -0
- package/dist/modules/agents/integrations/platforms/discord-gateway.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/discord-integration.d.ts +73 -0
- package/dist/modules/agents/integrations/platforms/discord-integration.js +364 -0
- package/dist/modules/agents/integrations/platforms/discord-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/discord-operations.d.ts +64 -0
- package/dist/modules/agents/integrations/platforms/discord-operations.js +176 -0
- package/dist/modules/agents/integrations/platforms/discord-operations.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/{slack-bridge-behavior.d.ts → slack/slack-bridge-behavior.d.ts} +3 -3
- package/dist/modules/agents/integrations/platforms/slack/slack-bridge-behavior.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/{slack-integration.d.ts → slack/slack-integration.d.ts} +11 -6
- package/dist/modules/agents/integrations/platforms/{slack-integration.js → slack/slack-integration.js} +32 -23
- package/dist/modules/agents/integrations/platforms/slack/slack-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-manual-setup.service.d.ts +35 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-manual-setup.service.js +150 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-manual-setup.service.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.d.ts +36 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js +193 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack/slack-operations.d.ts +10 -0
- package/dist/modules/agents/integrations/platforms/{slack-operations.js → slack/slack-operations.js} +1 -57
- package/dist/modules/agents/integrations/platforms/slack/slack-operations.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.js +6 -36
- package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +3 -2
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +14 -5
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/typing-indicator.d.ts +9 -0
- package/dist/modules/agents/integrations/platforms/typing-indicator.js +42 -0
- package/dist/modules/agents/integrations/platforms/typing-indicator.js.map +1 -0
- package/dist/modules/agents/integrations/recording/recording-adapter.js +11 -0
- package/dist/modules/agents/integrations/recording/recording-adapter.js.map +1 -1
- package/dist/modules/agents/json-config/node-tool-ai-gateway.service.d.ts +9 -0
- package/dist/modules/agents/json-config/node-tool-ai-gateway.service.js +34 -0
- package/dist/modules/agents/json-config/node-tool-ai-gateway.service.js.map +1 -0
- package/dist/modules/agents/json-config/reconcile-node-tool-gateway-credentials.d.ts +4 -0
- package/dist/modules/agents/json-config/reconcile-node-tool-gateway-credentials.js +152 -0
- package/dist/modules/agents/json-config/reconcile-node-tool-gateway-credentials.js.map +1 -0
- package/dist/modules/agents/repositories/agent-credential-dependency.repository.d.ts +12 -0
- package/dist/modules/agents/repositories/agent-credential-dependency.repository.js +92 -0
- package/dist/modules/agents/repositories/agent-credential-dependency.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-execution.repository.d.ts +7 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js +20 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent.repository.d.ts +2 -0
- package/dist/modules/agents/repositories/agent.repository.js +18 -0
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.d.ts +2 -0
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js +69 -5
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js.map +1 -1
- package/dist/modules/agents/tools/node-tool-factory.js +5 -1
- package/dist/modules/agents/tools/node-tool-factory.js.map +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.d.ts +7 -4
- package/dist/modules/agents/tools/workflow-tool-factory.js +86 -41
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
- package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.d.ts +14 -0
- package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.js +50 -0
- package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.js.map +1 -0
- package/dist/modules/agents/tools/workflow-tool-workflow-resolver.d.ts +3 -3
- package/dist/modules/agents/tools/workflow-tool-workflow-resolver.js +28 -23
- package/dist/modules/agents/tools/workflow-tool-workflow-resolver.js.map +1 -1
- package/dist/modules/agents/utils/extract-agent-credential-ids.d.ts +1 -0
- package/dist/modules/agents/utils/extract-agent-credential-ids.js +41 -0
- package/dist/modules/agents/utils/extract-agent-credential-ids.js.map +1 -0
- package/dist/modules/agents/utils/node-tool-validation.js +2 -2
- package/dist/modules/agents/utils/node-tool-validation.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.d.ts +6 -2
- package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.js +26 -3
- package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.js.map +1 -1
- package/dist/modules/data-table/data-table-permissions.d.ts +5 -0
- package/dist/modules/data-table/data-table-permissions.js +14 -0
- package/dist/modules/data-table/data-table-permissions.js.map +1 -0
- package/dist/modules/data-table/data-table-proxy.service.js +2 -0
- package/dist/modules/data-table/data-table-proxy.service.js.map +1 -1
- package/dist/modules/data-table/data-table.controller.d.ts +1 -1
- package/dist/modules/data-table/data-table.controller.js +7 -19
- package/dist/modules/data-table/data-table.controller.js.map +1 -1
- package/dist/modules/data-table/data-table.service.d.ts +3 -0
- package/dist/modules/data-table/data-table.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.d.ts +1 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js +8 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.d.ts +1 -0
- package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.js +100 -3
- package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/azure-key-vault/types.d.ts +4 -0
- package/dist/modules/insights/database/repositories/insights-by-period-query.helper.d.ts +2 -1
- package/dist/modules/insights/database/repositories/insights-by-period-query.helper.js +11 -5
- package/dist/modules/insights/database/repositories/insights-by-period-query.helper.js.map +1 -1
- package/dist/modules/insights/database/repositories/insights-by-period.repository.d.ts +6 -3
- package/dist/modules/insights/database/repositories/insights-by-period.repository.js +31 -11
- package/dist/modules/insights/database/repositories/insights-by-period.repository.js.map +1 -1
- package/dist/modules/insights/insights.controller.js +13 -7
- package/dist/modules/insights/insights.controller.js.map +1 -1
- package/dist/modules/insights/insights.service.d.ts +6 -3
- package/dist/modules/insights/insights.service.js +6 -3
- package/dist/modules/insights/insights.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/agent-execution.service.js +10 -3
- package/dist/modules/instance-ai/eval/agent-execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/execution.service.d.ts +1 -0
- package/dist/modules/instance-ai/eval/execution.service.js +37 -3
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/thread-restore.service.d.ts +5 -1
- package/dist/modules/instance-ai/eval/thread-restore.service.js +67 -9
- package/dist/modules/instance-ai/eval/thread-restore.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-model-catalog.service.d.ts +15 -0
- package/dist/modules/instance-ai/instance-ai-model-catalog.service.js +130 -0
- package/dist/modules/instance-ai/instance-ai-model-catalog.service.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +17 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.js +234 -24
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-verification.service.d.ts +20 -0
- package/dist/modules/instance-ai/instance-ai-verification.service.js +232 -0
- package/dist/modules/instance-ai/instance-ai-verification.service.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +4 -0
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +78 -4
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +9 -2
- package/dist/modules/instance-ai/instance-ai.controller.js +84 -2
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.d.ts +1 -0
- package/dist/modules/instance-ai/instance-ai.module.js +3 -7
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +5 -1
- package/dist/modules/instance-ai/instance-ai.service.js +231 -60
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/node-definition-resolver.d.ts +0 -1
- package/dist/modules/instance-ai/node-definition-resolver.js +0 -19
- package/dist/modules/instance-ai/node-definition-resolver.js.map +1 -1
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.d.ts +1 -0
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js +37 -2
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js +6 -6
- package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js.map +1 -1
- package/dist/modules/instance-ai/suspended-run-restorer.service.d.ts +1 -1
- package/dist/modules/instance-ai/suspended-run-restorer.service.js +9 -0
- package/dist/modules/instance-ai/suspended-run-restorer.service.js.map +1 -1
- package/dist/modules/mcp/mcp-protected-resource.d.ts +3 -4
- package/dist/modules/mcp/mcp-protected-resource.js +4 -4
- package/dist/modules/mcp/mcp-protected-resource.js.map +1 -1
- package/dist/modules/mcp/mcp-scopes.js +2 -0
- package/dist/modules/mcp/mcp-scopes.js.map +1 -1
- package/dist/modules/mcp/mcp-server-middleware.service.js +1 -0
- package/dist/modules/mcp/mcp-server-middleware.service.js.map +1 -1
- package/dist/modules/mcp/mcp.constants.d.ts +4 -0
- package/dist/modules/mcp/mcp.constants.js +5 -1
- package/dist/modules/mcp/mcp.constants.js.map +1 -1
- package/dist/modules/mcp/mcp.controller.js +14 -14
- package/dist/modules/mcp/mcp.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +4 -3
- package/dist/modules/mcp/mcp.service.js +49 -34
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +31 -5
- package/dist/modules/mcp/mcp.types.js.map +1 -1
- package/dist/modules/mcp/mcp.utils.d.ts +1 -0
- package/dist/modules/mcp/mcp.utils.js +22 -5
- package/dist/modules/mcp/mcp.utils.js.map +1 -1
- package/dist/modules/mcp/tool-schema.util.d.ts +3 -0
- package/dist/modules/mcp/tool-schema.util.js +32 -0
- package/dist/modules/mcp/tool-schema.util.js.map +1 -0
- package/dist/modules/mcp/tools/agents/agent-reference.d.ts +1 -1
- package/dist/modules/mcp/tools/agents/agent-reference.js +17 -6
- package/dist/modules/mcp/tools/agents/agent-reference.js.map +1 -1
- package/dist/modules/mcp/tools/agents/agent-tools.service.d.ts +9 -8
- package/dist/modules/mcp/tools/agents/agent-tools.service.js +207 -52
- package/dist/modules/mcp/tools/agents/agent-tools.service.js.map +1 -1
- package/dist/modules/mcp/tools/execute-workflow.tool.js +1 -1
- package/dist/modules/mcp/tools/execute-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-workflow-details.tool.d.ts +4 -1
- package/dist/modules/mcp/tools/get-workflow-details.tool.js +60 -23
- package/dist/modules/mcp/tools/get-workflow-details.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/schemas.d.ts +81 -40
- package/dist/modules/mcp/tools/schemas.js +31 -11
- package/dist/modules/mcp/tools/schemas.js.map +1 -1
- package/dist/modules/mcp/tools/search-workflows.tool.js +1 -9
- package/dist/modules/mcp/tools/search-workflows.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.d.ts +1 -1
- package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js +2 -7
- 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 +2 -11
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +2 -2
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js +2 -1
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.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 +17 -5
- package/dist/modules/mcp-registry/registry/mcp-registry-search.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-blocked.error.js +2 -0
- package/dist/modules/n8n-packages/engine/import-blocked.error.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-gates.d.ts +3 -4
- package/dist/modules/n8n-packages/engine/import-gates.js +10 -8
- package/dist/modules/n8n-packages/engine/import-gates.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-orchestrator.d.ts +6 -2
- package/dist/modules/n8n-packages/engine/import-orchestrator.js +36 -8
- package/dist/modules/n8n-packages/engine/import-orchestrator.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-result.d.ts +2 -0
- package/dist/modules/n8n-packages/engine/import-result.js +13 -2
- package/dist/modules/n8n-packages/engine/import-result.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-telemetry.js +8 -2
- package/dist/modules/n8n-packages/engine/import-telemetry.js.map +1 -1
- package/dist/modules/n8n-packages/engine/n8n-package-parser.d.ts +3 -0
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js +29 -0
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js.map +1 -1
- package/dist/modules/n8n-packages/engine/package-layout.d.ts +18 -1
- package/dist/modules/n8n-packages/engine/package-layout.js +36 -7
- package/dist/modules/n8n-packages/engine/package-layout.js.map +1 -1
- package/dist/modules/n8n-packages/engine/project-package-importer.js +28 -16
- package/dist/modules/n8n-packages/engine/project-package-importer.js.map +1 -1
- package/dist/modules/n8n-packages/engine/workflow-package-importer.js +12 -12
- package/dist/modules/n8n-packages/engine/workflow-package-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/project/project-conflict-policy.d.ts +7 -0
- package/dist/modules/n8n-packages/entities/project/project-conflict-policy.js +12 -0
- package/dist/modules/n8n-packages/entities/project/project-conflict-policy.js.map +1 -0
- package/dist/modules/n8n-packages/entities/project/project-import.types.d.ts +13 -3
- package/dist/modules/n8n-packages/entities/project/project-importer.d.ts +3 -3
- package/dist/modules/n8n-packages/entities/project/project-importer.js +58 -29
- package/dist/modules/n8n-packages/entities/project/project-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/tag/tag-import-decision.d.ts +4 -1
- package/dist/modules/n8n-packages/entities/tag/tag-import-decision.js +10 -3
- package/dist/modules/n8n-packages/entities/tag/tag-import-decision.js.map +1 -1
- package/dist/modules/n8n-packages/entities/tag/tag-importer.d.ts +1 -4
- package/dist/modules/n8n-packages/entities/tag/tag-importer.js +22 -10
- package/dist/modules/n8n-packages/entities/tag/tag-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/tag/tag.types.d.ts +13 -0
- package/dist/modules/n8n-packages/entities/tag/tag.types.js +36 -0
- package/dist/modules/n8n-packages/entities/tag/tag.types.js.map +1 -1
- package/dist/modules/n8n-packages/entities/variable/variable-importer.d.ts +6 -5
- package/dist/modules/n8n-packages/entities/variable/variable-importer.js +85 -21
- 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 +8 -3
- package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.js.map +1 -1
- package/dist/modules/n8n-packages/entities/variable/variable.exporter.d.ts +1 -0
- package/dist/modules/n8n-packages/entities/variable/variable.exporter.js +18 -23
- package/dist/modules/n8n-packages/entities/variable/variable.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/variable/variable.types.d.ts +21 -2
- package/dist/modules/n8n-packages/entities/variable/variable.types.js +15 -0
- package/dist/modules/n8n-packages/entities/variable/variable.types.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.d.ts +6 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js +33 -11
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +35 -3
- package/dist/modules/n8n-packages/n8n-packages.types.js +12 -1
- package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
- package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +0 -11
- package/dist/modules/n8n-packages/spec/requirements.schema.d.ts +0 -10
- package/dist/modules/n8n-packages/spec/requirements.schema.js +0 -1
- package/dist/modules/n8n-packages/spec/requirements.schema.js.map +1 -1
- package/dist/modules/n8n-packages/spec/serialized/variable.schema.d.ts +3 -3
- package/dist/modules/n8n-packages/spec/serialized/variable.schema.js +3 -2
- package/dist/modules/n8n-packages/spec/serialized/variable.schema.js.map +1 -1
- package/dist/modules/oauth-server/oauth-server.service.js +2 -2
- package/dist/modules/oauth-server/oauth-server.service.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.d.ts +2 -0
- package/dist/modules/otel/execution-level-tracer.js +4 -0
- package/dist/modules/otel/execution-level-tracer.js.map +1 -1
- package/dist/modules/redaction/redaction-context-hook.d.ts +3 -1
- package/dist/modules/redaction/redaction-context-hook.js +9 -2
- package/dist/modules/redaction/redaction-context-hook.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +4 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +26 -6
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/workflow-index/workflow-dependency-query.service.d.ts +8 -1
- package/dist/modules/workflow-index/workflow-dependency-query.service.js +76 -18
- package/dist/modules/workflow-index/workflow-dependency-query.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-auto-close.service.d.ts +16 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-auto-close.service.js +95 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-auto-close.service.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-decision-eligibility.service.d.ts +15 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-decision-eligibility.service.js +52 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-decision-eligibility.service.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.d.ts +3 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js +10 -4
- package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-publish-guard.service.js +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-publish-guard.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.d.ts +9 -5
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js +71 -40
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js +3 -0
- package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js.map +1 -1
- package/dist/node-execution/ephemeral-node-executor.js +20 -13
- package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
- package/dist/oauth/dcr-managed-fields.d.ts +6 -0
- package/dist/oauth/dcr-managed-fields.js +13 -0
- package/dist/oauth/dcr-managed-fields.js.map +1 -0
- package/dist/oauth/oauth.service.d.ts +1 -0
- package/dist/oauth/oauth.service.js +24 -25
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/posthog/index.d.ts +2 -0
- package/dist/posthog/index.js +19 -0
- package/dist/posthog/index.js.map +1 -1
- package/dist/public-api/public-api-controller.registry.d.ts +1 -0
- package/dist/public-api/public-api-controller.registry.js +36 -35
- package/dist/public-api/public-api-controller.registry.js.map +1 -1
- package/dist/public-api/public-api-route-resolver.d.ts +38 -0
- package/dist/public-api/public-api-route-resolver.js +136 -0
- package/dist/public-api/public-api-route-resolver.js.map +1 -0
- package/dist/public-api/types.d.ts +3 -6
- package/dist/public-api/v1/controllers/index.d.ts +1 -0
- package/dist/public-api/v1/controllers/index.js +1 -0
- package/dist/public-api/v1/controllers/index.js.map +1 -1
- package/dist/public-api/v1/controllers/roles.public.controller.d.ts +11 -0
- package/dist/public-api/v1/controllers/roles.public.controller.js +65 -0
- package/dist/public-api/v1/controllers/roles.public.controller.js.map +1 -0
- package/dist/public-api/v1/controllers/tags.public.controller.js +9 -2
- package/dist/public-api/v1/controllers/tags.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/workflows.public.controller.d.ts +10 -2
- package/dist/public-api/v1/controllers/workflows.public.controller.js +132 -4
- package/dist/public-api/v1/controllers/workflows.public.controller.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js +7 -15
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/decorator-routed.handler.d.ts +2 -0
- package/dist/public-api/v1/handlers/decorator-routed.handler.js +10 -0
- package/dist/public-api/v1/handlers/decorator-routed.handler.js.map +1 -0
- package/dist/public-api/v1/handlers/discover/discover.service.js +54 -49
- package/dist/public-api/v1/handlers/discover/discover.service.js.map +1 -1
- package/dist/public-api/v1/handlers/executions/executions.handler.js +25 -65
- package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +2 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.handler.d.ts +0 -1
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js +44 -122
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
- package/dist/public-api/v1/openapi-gen/decorator-routes.d.ts +18 -0
- package/dist/public-api/v1/openapi-gen/decorator-routes.js +160 -0
- package/dist/public-api/v1/openapi-gen/decorator-routes.js.map +1 -0
- package/dist/public-api/v1/openapi-gen/generate.d.ts +25 -0
- package/dist/public-api/v1/openapi-gen/generate.js +149 -0
- package/dist/public-api/v1/openapi-gen/generate.js.map +1 -0
- package/dist/public-api/v1/openapi-gen/zod-extend.d.ts +1 -0
- package/dist/public-api/v1/openapi-gen/zod-extend.js +6 -0
- package/dist/public-api/v1/openapi-gen/zod-extend.js.map +1 -0
- package/dist/public-api/v1/openapi.yml +625 -166
- package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +1 -3
- package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/constants.js +1 -0
- package/dist/scaling/constants.js.map +1 -1
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +5 -1
- package/dist/scaling/pubsub/pubsub.types.d.ts +2 -1
- package/dist/server.js +1 -0
- package/dist/server.js.map +1 -1
- package/dist/{modules/mcp/tools/workflow-builder → services}/ai-gateway-eligibility.d.ts +1 -0
- package/dist/{modules/mcp/tools/workflow-builder → services}/ai-gateway-eligibility.js +7 -1
- package/dist/services/ai-gateway-eligibility.js.map +1 -0
- package/dist/services/ai-gateway.service.d.ts +2 -0
- package/dist/services/ai-gateway.service.js +17 -3
- package/dist/services/ai-gateway.service.js.map +1 -1
- package/dist/services/cache/cache.service.d.ts +2 -0
- package/dist/services/cache/cache.service.js +21 -0
- package/dist/services/cache/cache.service.js.map +1 -1
- package/dist/services/cache/redis.cache-manager.d.ts +1 -0
- package/dist/services/cache/redis.cache-manager.js +6 -0
- package/dist/services/cache/redis.cache-manager.js.map +1 -1
- package/dist/services/credentials-tester.service.d.ts +5 -1
- package/dist/services/credentials-tester.service.js +9 -3
- package/dist/services/credentials-tester.service.js.map +1 -1
- package/dist/services/folder.service.js.map +1 -1
- package/dist/services/free-ai-credits.service.js +1 -1
- package/dist/services/free-ai-credits.service.js.map +1 -1
- package/dist/services/frontend.service.js +3 -1
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/node-resource-explorer.service.d.ts +13 -0
- package/dist/services/node-resource-explorer.service.js +117 -0
- package/dist/services/node-resource-explorer.service.js.map +1 -1
- package/dist/services/ownership-transfer/ownership-transfer.manifest.json +1 -1
- package/dist/services/project.service.ee.d.ts +3 -3
- package/dist/services/project.service.ee.js +4 -7
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/role-authorization.d.ts +3 -0
- package/dist/services/role-authorization.js +14 -0
- package/dist/services/role-authorization.js.map +1 -0
- package/dist/services/tag.service.d.ts +5 -2
- package/dist/services/tag.service.js +9 -2
- package/dist/services/tag.service.js.map +1 -1
- package/dist/task-runners/task-broker/auth/task-broker-auth.controller.d.ts +1 -0
- package/dist/task-runners/task-broker/auth/task-broker-auth.controller.js +2 -2
- package/dist/task-runners/task-broker/auth/task-broker-auth.controller.js.map +1 -1
- package/dist/task-runners/task-broker/auth/task-broker-auth.service.d.ts +6 -2
- package/dist/task-runners/task-broker/auth/task-broker-auth.service.js +8 -4
- package/dist/task-runners/task-broker/auth/task-broker-auth.service.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker-server.d.ts +1 -0
- package/dist/task-runners/task-broker/task-broker-server.js +13 -3
- package/dist/task-runners/task-broker/task-broker-server.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker-ws-server.d.ts +1 -0
- package/dist/task-runners/task-broker/task-broker-ws-server.js +8 -5
- package/dist/task-runners/task-broker/task-broker-ws-server.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker.service.js +2 -9
- package/dist/task-runners/task-broker/task-broker.service.js.map +1 -1
- package/dist/task-runners/task-runner-lifecycle-events.d.ts +0 -1
- package/dist/task-runners/task-runner-process-base.d.ts +2 -2
- package/dist/task-runners/task-runner-process-base.js +14 -10
- package/dist/task-runners/task-runner-process-base.js.map +1 -1
- package/dist/task-runners/task-runner-process-js.d.ts +1 -2
- package/dist/task-runners/task-runner-process-js.js +4 -4
- package/dist/task-runners/task-runner-process-js.js.map +1 -1
- package/dist/task-runners/task-runner-process-py.d.ts +1 -2
- package/dist/task-runners/task-runner-process-py.js +2 -2
- package/dist/task-runners/task-runner-process-py.js.map +1 -1
- package/dist/utils/node-definition-dirs.d.ts +1 -0
- package/dist/utils/node-definition-dirs.js +24 -0
- package/dist/utils/node-definition-dirs.js.map +1 -0
- package/dist/webhooks/constants.d.ts +1 -0
- package/dist/webhooks/constants.js +2 -1
- package/dist/webhooks/constants.js.map +1 -1
- package/dist/webhooks/live-webhooks.d.ts +4 -2
- package/dist/webhooks/live-webhooks.js +25 -4
- package/dist/webhooks/live-webhooks.js.map +1 -1
- package/dist/webhooks/webhook-execution-context.d.ts +5 -2
- package/dist/webhooks/webhook-execution-context.js +10 -0
- package/dist/webhooks/webhook-execution-context.js.map +1 -1
- package/dist/webhooks/webhook-helpers.js +9 -8
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/webhooks/webhook.service.d.ts +5 -1
- package/dist/webhooks/webhook.service.js +52 -9
- package/dist/webhooks/webhook.service.js.map +1 -1
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/triggers/trigger-execution-context.factory.d.ts +3 -0
- package/dist/workflows/triggers/trigger-execution-context.factory.js +43 -38
- package/dist/workflows/triggers/trigger-execution-context.factory.js.map +1 -1
- package/dist/workflows/triggers/webhook-trigger-registrar.d.ts +0 -1
- package/dist/workflows/triggers/webhook-trigger-registrar.js +1 -16
- package/dist/workflows/triggers/webhook-trigger-registrar.js.map +1 -1
- package/dist/workflows/workflow-finder.service.d.ts +20 -31
- package/dist/workflows/workflow-finder.service.js +42 -9
- package/dist/workflows/workflow-finder.service.js.map +1 -1
- package/dist/workflows/workflow-mutation-hooks-proxy.service.d.ts +14 -0
- package/dist/workflows/workflow-mutation-hooks-proxy.service.js +35 -0
- package/dist/workflows/workflow-mutation-hooks-proxy.service.js.map +1 -0
- package/dist/workflows/workflow-sharing.service.d.ts +4 -1
- package/dist/workflows/workflow-sharing.service.js +14 -2
- package/dist/workflows/workflow-sharing.service.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +9 -6
- package/dist/workflows/workflow.service.ee.d.ts +3 -3
- package/dist/workflows/workflow.service.ee.js +20 -7
- package/dist/workflows/workflow.service.ee.js.map +1 -1
- package/dist/workflows/workflow.service.js +33 -9
- package/dist/workflows/workflow.service.js.map +1 -1
- package/package.json +43 -39
- package/templates/form-shell.handlebars +418 -0
- package/templates/form-trigger.handlebars +30 -1
- package/dist/modules/agents/integrations/platforms/slack-bridge-behavior.js.map +0 -1
- package/dist/modules/agents/integrations/platforms/slack-integration.js.map +0 -1
- package/dist/modules/agents/integrations/platforms/slack-operations.d.ts +0 -17
- package/dist/modules/agents/integrations/platforms/slack-operations.js.map +0 -1
- package/dist/modules/agents/integrations/platforms/slack-tool-definitions.d.ts +0 -48
- package/dist/modules/agents/integrations/platforms/slack-tool-definitions.js +0 -42
- package/dist/modules/agents/integrations/platforms/slack-tool-definitions.js.map +0 -1
- package/dist/modules/agents/integrations/slack-app-setup.service.d.ts +0 -54
- package/dist/modules/agents/integrations/slack-app-setup.service.js +0 -326
- package/dist/modules/agents/integrations/slack-app-setup.service.js.map +0 -1
- package/dist/modules/mcp/tools/workflow-builder/ai-gateway-eligibility.js.map +0 -1
- package/dist/public-api/v1/handlers/executions/executions.service.d.ts +0 -14
- package/dist/public-api/v1/handlers/executions/executions.service.js +0 -49
- package/dist/public-api/v1/handlers/executions/executions.service.js.map +0 -1
- package/dist/public-api/v1/handlers/workflows/workflows.service.d.ts +0 -13
- package/dist/public-api/v1/handlers/workflows/workflows.service.js +0 -98
- package/dist/public-api/v1/handlers/workflows/workflows.service.js.map +0 -1
- /package/dist/modules/agents/integrations/platforms/{slack-bridge-behavior.js → slack/slack-bridge-behavior.js} +0 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.discordSearchChannelsSchema = void 0;
|
|
4
|
+
exports.downloadDiscordAttachment = downloadDiscordAttachment;
|
|
5
|
+
exports.searchDiscordChannels = searchDiscordChannels;
|
|
6
|
+
exports.executeDiscordContextQuery = executeDiscordContextQuery;
|
|
7
|
+
exports.resolveDiscordMessageTargetChannelId = resolveDiscordMessageTargetChannelId;
|
|
8
|
+
exports.settleDiscordActionMessage = settleDiscordActionMessage;
|
|
9
|
+
exports.fetchDiscordApplicationMetadata = fetchDiscordApplicationMetadata;
|
|
10
|
+
const zod_1 = require("zod");
|
|
11
|
+
const integration_helpers_1 = require("../integration-helpers");
|
|
12
|
+
const PLATFORM = 'discord';
|
|
13
|
+
const DISCORD_MESSAGE_CONTENT_LIMIT = 2000;
|
|
14
|
+
const DISCORD_ATTACHMENT_HOST = 'cdn.discordapp.com';
|
|
15
|
+
const POSTABLE_CHANNEL_TYPES = new Set([
|
|
16
|
+
0,
|
|
17
|
+
5,
|
|
18
|
+
]);
|
|
19
|
+
const MAX_GUILDS_SCANNED = 20;
|
|
20
|
+
async function downloadDiscordAttachment(attachmentUrl, httpClient) {
|
|
21
|
+
const url = new URL(attachmentUrl);
|
|
22
|
+
if (url.protocol !== 'https:' ||
|
|
23
|
+
url.username ||
|
|
24
|
+
url.password ||
|
|
25
|
+
url.hostname !== DISCORD_ATTACHMENT_HOST ||
|
|
26
|
+
!url.pathname.startsWith('/attachments/')) {
|
|
27
|
+
throw new Error('Invalid Discord attachment URL');
|
|
28
|
+
}
|
|
29
|
+
const response = await httpClient.request({
|
|
30
|
+
method: 'GET',
|
|
31
|
+
url: url.href,
|
|
32
|
+
encoding: 'arraybuffer',
|
|
33
|
+
returnFullResponse: true,
|
|
34
|
+
ignoreHttpStatusErrors: true,
|
|
35
|
+
disableFollowRedirect: true,
|
|
36
|
+
timeout: 30_000,
|
|
37
|
+
abortSignal: AbortSignal.timeout(30_000),
|
|
38
|
+
});
|
|
39
|
+
if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
40
|
+
throw new Error(`Discord attachment download failed with status ${response.statusCode}`);
|
|
41
|
+
}
|
|
42
|
+
return Buffer.from(response.body);
|
|
43
|
+
}
|
|
44
|
+
exports.discordSearchChannelsSchema = zod_1.z.object({
|
|
45
|
+
query: zod_1.z.string().min(1),
|
|
46
|
+
limit: zod_1.z.number().int().min(1).max(50).default(10),
|
|
47
|
+
cursor: zod_1.z.string().min(1).optional(),
|
|
48
|
+
});
|
|
49
|
+
async function discordApiGet(httpClient, apiUrl, botToken, path) {
|
|
50
|
+
const response = await httpClient.request({
|
|
51
|
+
method: 'GET',
|
|
52
|
+
url: `${apiUrl}${path}`,
|
|
53
|
+
headers: { Authorization: `Bot ${botToken}` },
|
|
54
|
+
json: true,
|
|
55
|
+
returnFullResponse: true,
|
|
56
|
+
ignoreHttpStatusErrors: true,
|
|
57
|
+
sendCredentialsOnCrossOriginRedirect: false,
|
|
58
|
+
});
|
|
59
|
+
if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
60
|
+
throw new Error(`Discord API ${path} failed: ${response.statusCode} ${JSON.stringify(response.body)}`);
|
|
61
|
+
}
|
|
62
|
+
return response.body;
|
|
63
|
+
}
|
|
64
|
+
function normalizeChannelName(value) {
|
|
65
|
+
return value.trim().replace(/^#/, '').toLowerCase();
|
|
66
|
+
}
|
|
67
|
+
async function searchDiscordChannels(params) {
|
|
68
|
+
const { httpClient, apiUrl, botToken, input } = params;
|
|
69
|
+
const searchTerm = normalizeChannelName(input.query);
|
|
70
|
+
const guildParams = new URLSearchParams({ limit: String(MAX_GUILDS_SCANNED) });
|
|
71
|
+
if (input.cursor)
|
|
72
|
+
guildParams.set('after', input.cursor);
|
|
73
|
+
const guilds = await discordApiGet(httpClient, apiUrl, botToken, `/users/@me/guilds?${guildParams.toString()}`);
|
|
74
|
+
const channels = [];
|
|
75
|
+
let lastScannedGuildId;
|
|
76
|
+
for (const guild of guilds) {
|
|
77
|
+
if (channels.length >= input.limit)
|
|
78
|
+
break;
|
|
79
|
+
lastScannedGuildId = guild.id;
|
|
80
|
+
let guildChannels;
|
|
81
|
+
try {
|
|
82
|
+
guildChannels = await discordApiGet(httpClient, apiUrl, botToken, `/guilds/${guild.id}/channels`);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
for (const channel of guildChannels) {
|
|
88
|
+
if (channels.length >= input.limit)
|
|
89
|
+
break;
|
|
90
|
+
if (!POSTABLE_CHANNEL_TYPES.has(channel.type) || !channel.name)
|
|
91
|
+
continue;
|
|
92
|
+
if (!normalizeChannelName(channel.name).includes(searchTerm))
|
|
93
|
+
continue;
|
|
94
|
+
channels.push({
|
|
95
|
+
channelId: `discord:${guild.id}:${channel.id}`,
|
|
96
|
+
name: channel.name,
|
|
97
|
+
guildId: guild.id,
|
|
98
|
+
guildName: guild.name,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const hasUnscannedGuilds = lastScannedGuildId !== undefined && lastScannedGuildId !== guilds.at(-1)?.id;
|
|
103
|
+
const nextCursor = lastScannedGuildId && (hasUnscannedGuilds || guilds.length === MAX_GUILDS_SCANNED)
|
|
104
|
+
? lastScannedGuildId
|
|
105
|
+
: undefined;
|
|
106
|
+
return {
|
|
107
|
+
ok: true,
|
|
108
|
+
channels,
|
|
109
|
+
resultCount: channels.length,
|
|
110
|
+
...(nextCursor ? { nextCursor } : {}),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
async function executeDiscordContextQuery(params) {
|
|
114
|
+
if (params.query !== 'search_channels')
|
|
115
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, params.query);
|
|
116
|
+
if (!params.botToken)
|
|
117
|
+
return (0, integration_helpers_1.connectionUnavailable)();
|
|
118
|
+
return await searchDiscordChannels({
|
|
119
|
+
httpClient: params.httpClient,
|
|
120
|
+
apiUrl: params.apiUrl,
|
|
121
|
+
botToken: params.botToken,
|
|
122
|
+
input: exports.discordSearchChannelsSchema.parse(params.input),
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function resolveDiscordMessageTargetChannelId(threadId) {
|
|
126
|
+
const parts = threadId.split(':');
|
|
127
|
+
if (parts[0] !== 'discord' || parts.length < 3 || !parts[2]) {
|
|
128
|
+
throw new Error(`Invalid Discord thread ID: ${threadId}`);
|
|
129
|
+
}
|
|
130
|
+
return parts[3] || parts[2];
|
|
131
|
+
}
|
|
132
|
+
async function settleDiscordActionMessage(params) {
|
|
133
|
+
const channelId = resolveDiscordMessageTargetChannelId(params.threadId);
|
|
134
|
+
const content = params.content.slice(0, DISCORD_MESSAGE_CONTENT_LIMIT);
|
|
135
|
+
const response = await params.httpClient.request({
|
|
136
|
+
method: 'PATCH',
|
|
137
|
+
url: `${params.apiUrl}/channels/${channelId}/messages/${params.messageId}`,
|
|
138
|
+
headers: { Authorization: `Bot ${params.botToken}` },
|
|
139
|
+
body: {
|
|
140
|
+
content,
|
|
141
|
+
embeds: [],
|
|
142
|
+
components: [],
|
|
143
|
+
allowed_mentions: { parse: [] },
|
|
144
|
+
},
|
|
145
|
+
json: true,
|
|
146
|
+
returnFullResponse: true,
|
|
147
|
+
ignoreHttpStatusErrors: true,
|
|
148
|
+
sendCredentialsOnCrossOriginRedirect: false,
|
|
149
|
+
});
|
|
150
|
+
if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
151
|
+
throw new Error(`Discord API PATCH /channels/${channelId}/messages/${params.messageId} failed: ${response.statusCode}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async function fetchDiscordApplicationMetadata(params) {
|
|
155
|
+
const response = await params.httpClient.request({
|
|
156
|
+
method: 'GET',
|
|
157
|
+
url: `${params.apiUrl}/oauth2/applications/@me`,
|
|
158
|
+
headers: { Authorization: `Bot ${params.botToken}` },
|
|
159
|
+
json: true,
|
|
160
|
+
returnFullResponse: true,
|
|
161
|
+
ignoreHttpStatusErrors: true,
|
|
162
|
+
sendCredentialsOnCrossOriginRedirect: false,
|
|
163
|
+
});
|
|
164
|
+
if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
165
|
+
return { ok: false, kind: 'http', status: response.statusCode };
|
|
166
|
+
}
|
|
167
|
+
const body = response.body;
|
|
168
|
+
if (typeof body.id !== 'string' ||
|
|
169
|
+
!body.id ||
|
|
170
|
+
typeof body.verify_key !== 'string' ||
|
|
171
|
+
!body.verify_key) {
|
|
172
|
+
return { ok: false, kind: 'incomplete' };
|
|
173
|
+
}
|
|
174
|
+
return { ok: true, application: { id: body.id, verify_key: body.verify_key } };
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=discord-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discord-operations.js","sourceRoot":"","sources":["../../../../../src/modules/agents/integrations/platforms/discord-operations.ts"],"names":[],"mappings":";;;;;;;;;AACA,6BAAwB;AAExB,gEAAiF;AAEjF,MAAM,QAAQ,GAAG,SAAS,CAAC;AAG3B,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAE3C,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAMrD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACtC,CAAC;IACD,CAAC;CACD,CAAC,CAAC;AAOH,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAEvB,KAAK,oCACX,aAAqB,EACrB,UAA6B;IAE7B,MAAM,GAAG,GAAG,IAA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,EAAE,IAAI;QACxB,sBAAsB,EAAE,IAAI;QAC5B,oCAAoC,EAAE,KAAK;KAC3C,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,UAAU,GAAG,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE,CAAC;QAC7D,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC;IACjE,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;IAC3B,IACC,OAAO,IAAI,CAAC,EAAE,KAAK,QAAQ;QAC3B,CAAC,IAAI,CAAC,EAAE;QACR,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ;QACnC,CAAC,IAAI,CAAC,UAAU,EACf,CAAC;QACF,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAC1C,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;AAChF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Message, Thread } from 'chat';
|
|
2
|
-
import type { BridgeExecutionContext, BridgeMessageContextParams, BridgeResumeExecutionContext, PlatformAgentContext } from '
|
|
3
|
-
import type { ChatInstance } from '
|
|
4
|
-
import type { ReplyExpectation } from '
|
|
2
|
+
import type { BridgeExecutionContext, BridgeMessageContextParams, BridgeResumeExecutionContext, PlatformAgentContext } from '../../agent-chat-integration';
|
|
3
|
+
import type { ChatInstance } from '../../chat-integration.service';
|
|
4
|
+
import type { ReplyExpectation } from '../../integration-tools';
|
|
5
5
|
export declare function getSlackPlatformAgentContext(chat: ChatInstance): PlatformAgentContext;
|
|
6
6
|
export declare function getSlackReplyExpectation(params: {
|
|
7
7
|
message: Message<unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-bridge-behavior.js","sourceRoot":"","sources":["../../../../../../src/modules/agents/integrations/platforms/slack/slack-bridge-behavior.ts"],"names":[],"mappings":";;;;;;;AAAA,oDAAgD;AAChD,4CAAyC;AAazC,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAC5C,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAExC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AACtC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AACrC,MAAM,+BAA+B,GAAG,IAAI,CAAC;AAC7C,MAAM,oBAAoB,GACzB,2GAA2G,CAAC;AAC7G,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AACxD,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AAE1D,MAAM,2BAA2B,GAChC,oBAAoB,CAAC,MAAM,GAAG,sBAAsB,CAAC,MAAM,GAAG,uBAAuB,CAAC,MAAM,GAAG,CAAC,CAAC;AAiBlG,sCAA6C,IAAkB;IAC9D,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,IAAA,oBAAQ,EAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IAClC,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACnD,OAAO,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3C,CAAC;AAOD,kCAAyC,MAGxC;IAGA,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,KAAK,IAAI;QAAE,OAAO,UAAU,CAAC;IAEhF,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;IAC/B,IAAI,CAAC,IAAA,oBAAQ,EAAC,GAAG,CAAC;QAAE,OAAO,UAAU,CAAC;IAEtC,MAAM,WAAW,GAA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gentRepository } from '../../../repositories/agent.repository';
|
|
4
|
+
import { AgentChatIntegration, type AgentChatIntegrationContext, type BridgeExecutionContext, type BridgeMessageContextParams, type BridgeResumeExecutionContext, type PlatformAgentContext, type PlatformContextQueryParams, type UnauthenticatedWebhookResponse } from '../../agent-chat-integration';
|
|
5
|
+
import type { ChatInstance } from '../../chat-integration.service';
|
|
6
|
+
import type { ReplyExpectation } from '../../integration-tools';
|
|
5
7
|
export declare class SlackIntegration extends AgentChatIntegration {
|
|
8
|
+
private readonly agentRepository?;
|
|
9
|
+
constructor(agentRepository?: AgentRepository | undefined);
|
|
6
10
|
readonly type = "slack";
|
|
7
11
|
readonly credentialTypes: string[];
|
|
8
12
|
readonly displayLabel = "Slack";
|
|
@@ -13,8 +17,10 @@ export declare class SlackIntegration extends AgentChatIntegration {
|
|
|
13
17
|
useNodeToolWhen: string[];
|
|
14
18
|
};
|
|
15
19
|
readonly supportedComponents: readonly RichCardComponentType[];
|
|
16
|
-
readonly contextToolDefinitions: import("
|
|
17
|
-
readonly actionToolDefinitions: import("
|
|
20
|
+
readonly contextToolDefinitions: import("../../integration-tool-types").IntegrationContextQueryDefinition[];
|
|
21
|
+
readonly actionToolDefinitions: import("../../integration-tool-types").IntegrationActionDefinition[];
|
|
22
|
+
onBeforeConnect(ctx: AgentChatIntegrationContext): Promise<void>;
|
|
23
|
+
prepareSentThread(thread: Thread<unknown, unknown>): Promise<void>;
|
|
18
24
|
getPlatformAgentContext(chat: ChatInstance): PlatformAgentContext;
|
|
19
25
|
prepareInboundText(text: string, context: PlatformAgentContext): string;
|
|
20
26
|
getReplyExpectation(params: {
|
|
@@ -30,7 +36,6 @@ export declare class SlackIntegration extends AgentChatIntegration {
|
|
|
30
36
|
agentId: string;
|
|
31
37
|
}): Promise<BridgeResumeExecutionContext>;
|
|
32
38
|
executeContextQuery(params: PlatformContextQueryParams): Promise<unknown>;
|
|
33
|
-
executeAction(params: PlatformActionParams): Promise<IntegrationActionResult | undefined>;
|
|
34
39
|
createAdapter(ctx: AgentChatIntegrationContext): Promise<unknown>;
|
|
35
40
|
handleUnauthenticatedWebhook(body: unknown): UnauthenticatedWebhookResponse | undefined;
|
|
36
41
|
private extractBotToken;
|
|
@@ -5,19 +5,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
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
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
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
|
+
};
|
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
12
|
exports.SlackIntegration = void 0;
|
|
10
13
|
const di_1 = require("@n8n/di");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
14
|
+
const conflict_error_1 = require("../../../../../errors/response-errors/conflict.error");
|
|
15
|
+
const agent_repository_1 = require("../../../repositories/agent.repository");
|
|
16
|
+
const agent_chat_integration_1 = require("../../agent-chat-integration");
|
|
17
|
+
const esm_loader_1 = require("../../esm-loader");
|
|
18
|
+
const integration_tool_definitions_1 = require("../../integration-tool-definitions");
|
|
19
|
+
const integration_helpers_1 = require("../../integration-helpers");
|
|
15
20
|
const slack_bridge_behavior_1 = require("./slack-bridge-behavior");
|
|
16
21
|
const slack_operations_1 = require("./slack-operations");
|
|
17
|
-
const slack_tool_definitions_1 = require("./slack-tool-definitions");
|
|
18
22
|
let SlackIntegration = class SlackIntegration extends agent_chat_integration_1.AgentChatIntegration {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(
|
|
23
|
+
constructor(agentRepository) {
|
|
24
|
+
super();
|
|
25
|
+
this.agentRepository = agentRepository;
|
|
21
26
|
this.type = 'slack';
|
|
22
27
|
this.credentialTypes = ['slackApi'];
|
|
23
28
|
this.displayLabel = 'Slack';
|
|
@@ -58,10 +63,24 @@ let SlackIntegration = class SlackIntegration extends agent_chat_integration_1.A
|
|
|
58
63
|
'search_users',
|
|
59
64
|
'search_channels',
|
|
60
65
|
]);
|
|
61
|
-
this.actionToolDefinitions = [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
this.actionToolDefinitions = (0, integration_tool_definitions_1.resolveIntegrationActionDefinitions)([
|
|
67
|
+
'respond',
|
|
68
|
+
'send_dm',
|
|
69
|
+
'send_channel_message',
|
|
70
|
+
'add_reaction',
|
|
71
|
+
'do_not_respond',
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
async onBeforeConnect(ctx) {
|
|
75
|
+
if (!this.agentRepository)
|
|
76
|
+
return;
|
|
77
|
+
const others = await this.agentRepository.findByIntegrationCredential(this.type, ctx.credentialId, ctx.projectId, ctx.agentId);
|
|
78
|
+
if (others.length > 0) {
|
|
79
|
+
throw new conflict_error_1.ConflictError(`Slack credential is already connected to agent "${others[0].name}"`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async prepareSentThread(thread) {
|
|
83
|
+
await (0, slack_operations_1.subscribeSlackThread)(thread);
|
|
65
84
|
}
|
|
66
85
|
getPlatformAgentContext(chat) {
|
|
67
86
|
return (0, slack_bridge_behavior_1.getSlackPlatformAgentContext)(chat);
|
|
@@ -87,17 +106,6 @@ let SlackIntegration = class SlackIntegration extends agent_chat_integration_1.A
|
|
|
87
106
|
input: params.input,
|
|
88
107
|
});
|
|
89
108
|
}
|
|
90
|
-
async executeAction(params) {
|
|
91
|
-
if (!params.chat)
|
|
92
|
-
return (0, integration_helpers_1.connectionUnavailable)();
|
|
93
|
-
return await (0, slack_operations_1.executeSlackAction)({
|
|
94
|
-
chat: params.chat,
|
|
95
|
-
descriptor: params.descriptor,
|
|
96
|
-
action: params.action,
|
|
97
|
-
input: params.input,
|
|
98
|
-
currentMessageContext: params.currentMessageContext,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
109
|
async createAdapter(ctx) {
|
|
102
110
|
const botToken = this.extractBotToken(ctx.credential);
|
|
103
111
|
const signingSecret = this.extractSigningSecret(ctx.credential);
|
|
@@ -139,6 +147,7 @@ let SlackIntegration = class SlackIntegration extends agent_chat_integration_1.A
|
|
|
139
147
|
};
|
|
140
148
|
exports.SlackIntegration = SlackIntegration;
|
|
141
149
|
exports.SlackIntegration = SlackIntegration = __decorate([
|
|
142
|
-
(0, di_1.Service)()
|
|
150
|
+
(0, di_1.Service)(),
|
|
151
|
+
__metadata("design:paramtypes", [agent_repository_1.AgentRepository])
|
|
143
152
|
], SlackIntegration);
|
|
144
153
|
//# sourceMappingURL=slack-integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-integration.js","sourceRoot":"","sources":["../../../../../../src/modules/agents/integrations/platforms/slack/slack-integration.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAIlC,4EAAwE;AAExE,6EAAyE;AACzE,yEASsC;AAEtC,iDAAoD;AACpD,qFAG4C;AAC5C,mEAAkE;AAElE,mEAMiC;AACjC,yDAAoF;AAQ7E,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,6CAAoB;IACzD,YAA6B,eAAiC;QAC7D,KAAK,EAAE,CAAC;QADoB,oBAAe,GAAf,eAAe,CAAkB;QAIrD,SAAI,GAAG,OAAO,CAAC;QAEf,oBAAe,GAAG,CAAC,UAAU,CAAC,CAAC;QAE/B,iBAAY,GAAG,OAAO,CAAC;QAEvB,gBAAW,GAAG,OAAO,CAAC;QAEtB,oBAAe,GAAG;YAC1B,YAAY,EAAE;gBACb,wDAAwD;gBACxD,0EAA0E;gBAC1E,gFAAgF;gBAChF,4DAA4D;aAC5D;YACD,kBAAkB,EAAE;gBACnB,2GAA2G;gBAC3G,0HAA0H;gBAC1H,yGAAyG;aACzG;YACD,eAAe,EAAE;gBA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SAAS,EAAE,EAAE,CAAC;QAC5D,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC;IAKO,eAAe,CAAC,UAAmC;QAC1D,MAAM,KAAK,GACV,OAAO,UAAU,CAAC,WAAW,KAAK,QAAQ,IAAI,UAAU,CAAC,WAAW;YACnE,CAAC,CAAC,UAAU,CAAC,WAAW;YACxB,CAAC,CAAC,SAAS,CAAC;QAEd,IAAI,CAAC,KAAK,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACd,2DAA2D;gBAC1D,wDAAwD,CACzD,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAChC,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;YAChD,MAAM,IAAI,KAAK,CACd,oCAAoC,MAAM,6EAA6E;gBACtH,uFAAuF,CACxF,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACd,CAAC;IAEO,oBAAoB,CAAC,UAAmC;QAC/D,MAAM,MAAM,GAAG,UAAU,CAAC,eAAe,CAAC;QAC1C,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,EAAE,CAAC;YAC1C,OAAO,MAAM,CAAC;QACf,CAAC;QAED,MAAM,IAAI,KAAK,CACd,8FAA8F;YAC7F,4HAA4H,CAC7H,CAAC;IACH,CAAC;CACD,CAAA;;2BAjLY,gBAAgB;IAD5B,IAAA,YAAO,GAAE;qCAEsC,kCAAe;GADlD,gBAAgB,CAiL5B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CreateSlackAgentAppResponse, SlackAgentAppManifestResponse } from '@n8n/api-types';
|
|
2
|
+
import type { User } from '@n8n/db';
|
|
3
|
+
import { UserRepository } from '@n8n/db';
|
|
4
|
+
import { Cipher } from 'n8n-core';
|
|
5
|
+
import { CacheService } from '../../../../../services/cache/cache.service';
|
|
6
|
+
import { SlackMethodsService } from './slack-methods.service';
|
|
7
|
+
interface CreateSlackAppOptions {
|
|
8
|
+
projectId: string;
|
|
9
|
+
agentId: string;
|
|
10
|
+
appConfigurationToken: string;
|
|
11
|
+
user: User;
|
|
12
|
+
}
|
|
13
|
+
interface GetSlackAppManifestOptions {
|
|
14
|
+
projectId: string;
|
|
15
|
+
agentId: string;
|
|
16
|
+
}
|
|
17
|
+
interface CompleteSlackAppInstallOptions {
|
|
18
|
+
projectId: string;
|
|
19
|
+
agentId: string;
|
|
20
|
+
code: string;
|
|
21
|
+
state: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class SlackManualSetupService {
|
|
24
|
+
private readonly methods;
|
|
25
|
+
private readonly userRepository;
|
|
26
|
+
private readonly cacheService;
|
|
27
|
+
private readonly cipher;
|
|
28
|
+
constructor(methods: SlackMethodsService, userRepository: UserRepository, cacheService: CacheService, cipher: Cipher);
|
|
29
|
+
createApp(options: CreateSlackAppOptions): Promise<CreateSlackAgentAppResponse>;
|
|
30
|
+
getManifest(options: GetSlackAppManifestOptions): Promise<SlackAgentAppManifestResponse>;
|
|
31
|
+
completeInstall(options: CompleteSlackAppInstallOptions): Promise<void>;
|
|
32
|
+
private consumeSession;
|
|
33
|
+
private cacheKey;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,150 @@
|
|
|
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.SlackManualSetupService = void 0;
|
|
13
|
+
const node_crypto_1 = require("node:crypto");
|
|
14
|
+
const db_1 = require("@n8n/db");
|
|
15
|
+
const di_1 = require("@n8n/di");
|
|
16
|
+
const is_record_1 = require("@n8n/utils/is-record");
|
|
17
|
+
const n8n_core_1 = require("n8n-core");
|
|
18
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
19
|
+
const bad_request_error_1 = require("../../../../../errors/response-errors/bad-request.error");
|
|
20
|
+
const not_found_error_1 = require("../../../../../errors/response-errors/not-found.error");
|
|
21
|
+
const cache_service_1 = require("../../../../../services/cache/cache.service");
|
|
22
|
+
const slack_methods_service_1 = require("./slack-methods.service");
|
|
23
|
+
const SLACK_APP_SETUP_CACHE_PREFIX = 'agents:slack-app-setup:';
|
|
24
|
+
const SLACK_APP_SETUP_TTL_MS = 60 * 60 * 1000;
|
|
25
|
+
function hasSessionShape(value) {
|
|
26
|
+
const keys = [
|
|
27
|
+
'projectId',
|
|
28
|
+
'agentId',
|
|
29
|
+
'userId',
|
|
30
|
+
'appId',
|
|
31
|
+
'clientId',
|
|
32
|
+
'clientSecret',
|
|
33
|
+
'signingSecret',
|
|
34
|
+
'redirectUrl',
|
|
35
|
+
];
|
|
36
|
+
return (0, is_record_1.isRecord)(value) && keys.every((key) => typeof value[key] === 'string');
|
|
37
|
+
}
|
|
38
|
+
let SlackManualSetupService = class SlackManualSetupService {
|
|
39
|
+
constructor(methods, userRepository, cacheService, cipher) {
|
|
40
|
+
this.methods = methods;
|
|
41
|
+
this.userRepository = userRepository;
|
|
42
|
+
this.cacheService = cacheService;
|
|
43
|
+
this.cipher = cipher;
|
|
44
|
+
}
|
|
45
|
+
async createApp(options) {
|
|
46
|
+
const appConfigurationToken = options.appConfigurationToken.trim();
|
|
47
|
+
if (!appConfigurationToken) {
|
|
48
|
+
throw new bad_request_error_1.BadRequestError('Slack app configuration token is required');
|
|
49
|
+
}
|
|
50
|
+
const agent = await this.methods.getAgent(options.agentId, options.projectId);
|
|
51
|
+
const redirectUrl = this.methods.callbackUrl(options.projectId, options.agentId);
|
|
52
|
+
const manifest = this.methods.buildManifest(agent.name, options.projectId, options.agentId, {
|
|
53
|
+
redirectUrl,
|
|
54
|
+
});
|
|
55
|
+
const response = await this.methods.callSlackApi('apps.manifest.create', {
|
|
56
|
+
token: appConfigurationToken,
|
|
57
|
+
manifest: JSON.stringify(manifest),
|
|
58
|
+
});
|
|
59
|
+
if (response.ok !== true) {
|
|
60
|
+
throw this.methods.slackError('create the Slack app', response);
|
|
61
|
+
}
|
|
62
|
+
const credentials = this.methods.childRecord(response, 'credentials');
|
|
63
|
+
const appId = this.methods.stringProperty(response, 'app_id');
|
|
64
|
+
const clientId = this.methods.stringProperty(credentials, 'client_id');
|
|
65
|
+
const clientSecret = this.methods.stringProperty(credentials, 'client_secret');
|
|
66
|
+
const signingSecret = this.methods.stringProperty(credentials, 'signing_secret');
|
|
67
|
+
const oauthAuthorizeUrl = this.methods.stringProperty(response, 'oauth_authorize_url');
|
|
68
|
+
if (!appId || !clientId || !clientSecret || !signingSecret || !oauthAuthorizeUrl) {
|
|
69
|
+
throw new bad_request_error_1.BadRequestError('Slack returned an incomplete app setup response');
|
|
70
|
+
}
|
|
71
|
+
const state = (0, node_crypto_1.randomBytes)(32).toString('hex');
|
|
72
|
+
const setupSession = {
|
|
73
|
+
projectId: options.projectId,
|
|
74
|
+
agentId: options.agentId,
|
|
75
|
+
userId: options.user.id,
|
|
76
|
+
appId,
|
|
77
|
+
clientId,
|
|
78
|
+
clientSecret,
|
|
79
|
+
signingSecret,
|
|
80
|
+
redirectUrl,
|
|
81
|
+
};
|
|
82
|
+
await this.cacheService.set(this.cacheKey(state), await this.cipher.encryptV2(JSON.stringify(setupSession)), SLACK_APP_SETUP_TTL_MS);
|
|
83
|
+
return {
|
|
84
|
+
appId,
|
|
85
|
+
installUrl: this.methods.installUrl(oauthAuthorizeUrl, state, redirectUrl),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
async getManifest(options) {
|
|
89
|
+
const agent = await this.methods.getAgent(options.agentId, options.projectId);
|
|
90
|
+
return {
|
|
91
|
+
manifest: this.methods.buildManifest(agent.name, options.projectId, options.agentId),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
async completeInstall(options) {
|
|
95
|
+
const session = await this.consumeSession(options.state);
|
|
96
|
+
if (session.projectId !== options.projectId || session.agentId !== options.agentId) {
|
|
97
|
+
throw new bad_request_error_1.BadRequestError('Slack app setup state does not match this agent');
|
|
98
|
+
}
|
|
99
|
+
const user = await this.userRepository.findOne({
|
|
100
|
+
where: { id: session.userId },
|
|
101
|
+
relations: ['role'],
|
|
102
|
+
});
|
|
103
|
+
if (!user)
|
|
104
|
+
throw new not_found_error_1.NotFoundError(`User "${session.userId}" not found`);
|
|
105
|
+
const agent = await this.methods.getAgent(session.agentId, session.projectId);
|
|
106
|
+
const tokenResponse = await this.methods.callSlackApi('oauth.v2.access', {
|
|
107
|
+
code: options.code,
|
|
108
|
+
redirect_uri: session.redirectUrl,
|
|
109
|
+
}, {
|
|
110
|
+
authorization: `Basic ${Buffer.from(`${session.clientId}:${session.clientSecret}`).toString('base64')}`,
|
|
111
|
+
});
|
|
112
|
+
if (tokenResponse.ok !== true) {
|
|
113
|
+
throw this.methods.slackError('finish Slack app installation', tokenResponse);
|
|
114
|
+
}
|
|
115
|
+
const accessToken = this.methods.stringProperty(tokenResponse, 'access_token');
|
|
116
|
+
if (!accessToken?.startsWith('xoxb-')) {
|
|
117
|
+
throw new bad_request_error_1.BadRequestError('Slack did not return a Bot User OAuth Token');
|
|
118
|
+
}
|
|
119
|
+
await this.methods.createAndConnectBotCredential({
|
|
120
|
+
agent,
|
|
121
|
+
user,
|
|
122
|
+
accessToken,
|
|
123
|
+
signingSecret: session.signingSecret,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
async consumeSession(state) {
|
|
127
|
+
const cached = await this.cacheService.take(this.cacheKey(state));
|
|
128
|
+
if (typeof cached !== 'string') {
|
|
129
|
+
throw new bad_request_error_1.BadRequestError('Slack app setup state has expired or is invalid');
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
const decrypted = await this.cipher.decryptV2(cached);
|
|
133
|
+
const session = (0, n8n_workflow_1.jsonParse)(decrypted, { fallbackValue: null });
|
|
134
|
+
if (hasSessionShape(session))
|
|
135
|
+
return session;
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
}
|
|
139
|
+
throw new bad_request_error_1.BadRequestError('Slack app setup state has expired or is invalid');
|
|
140
|
+
}
|
|
141
|
+
cacheKey(state) {
|
|
142
|
+
return `${SLACK_APP_SETUP_CACHE_PREFIX}${state}`;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
exports.SlackManualSetupService = SlackManualSetupService;
|
|
146
|
+
exports.SlackManualSetupService = SlackManualSetupService = __decorate([
|
|
147
|
+
(0, di_1.Service)(),
|
|
148
|
+
__metadata("design:paramtypes", [slack_methods_service_1.SlackMethodsService, db_1.UserRepository, cache_service_1.CacheService, n8n_core_1.Cipher])
|
|
149
|
+
], SlackManualSetupService);
|
|
150
|
+
//# sourceMappingURL=slack-manual-setup.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-manual-setup.service.js","sourceRoot":"","sources":["../../../../../../src/modules/agents/integrations/platforms/slack/slack-manual-setup.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA0C;AAI1C,gCAAyC;AACzC,gCAAkC;AAClC,oDAAgD;AAChD,uCAAkC;AAClC,+CAAyC;AAEzC,kFAA6E;AAC7E,8EAAyE;AACzE,kEAA8D;AAE9D,mEAA8D;AAE9D,MAAM,4BAA4B,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AC3E,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAChC,MAAM,IAAI,mCAAe,CAAC,iDAAiD,CAAC,CAAC;QAC9E,CAAC;QAED,IAAI,CAAC;YACJ,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACtD,MAAM,OAAO,GAAG,IAAA,wBAAS,EAAU,SAAS,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;YACvE,IAAI,eAAe,CAAC,OAAO,CAAC;gBAAE,OAAO,OAAO,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;QAED,MAAM,IAAI,mCAAe,CAAC,iDAAiD,CAAC,CAAC;IAC9E,CAAC;IAEO,QAAQ,CAAC,KAAa;QAC7B,OAAO,GAAG,4BAA4B,GAAG,KAAK,EAAE,CAAC;IAClD,CAAC;CACD,CAAA;;kCAjIY,uBAAuB;IADnC,IAAA,YAAO,GAAE;qCAGkB,2CAAmB,EACZ,mBAAc,EAChB,4BAAY,EAClB,iBAAM;GALpB,uBAAuB,CAiInC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { SlackAgentAppManifest } from '@n8n/api-types';
|
|
2
|
+
import { OutboundHttp } from '@n8n/backend-network';
|
|
3
|
+
import type { User } from '@n8n/db';
|
|
4
|
+
import { CredentialsService } from '../../../../../credentials/credentials.service';
|
|
5
|
+
import { BadRequestError } from '../../../../../errors/response-errors/bad-request.error';
|
|
6
|
+
import { UrlService } from '../../../../../services/url.service';
|
|
7
|
+
import { AgentIntegrationManagementService } from '../../../agent-integration-management.service';
|
|
8
|
+
import type { Agent } from '../../../entities/agent.entity';
|
|
9
|
+
import { AgentRepository } from '../../../repositories/agent.repository';
|
|
10
|
+
export declare class SlackMethodsService {
|
|
11
|
+
private readonly credentialsService;
|
|
12
|
+
private readonly agentRepository;
|
|
13
|
+
private readonly integrationManagementService;
|
|
14
|
+
private readonly urlService;
|
|
15
|
+
private readonly outboundHttp;
|
|
16
|
+
constructor(credentialsService: CredentialsService, agentRepository: AgentRepository, integrationManagementService: AgentIntegrationManagementService, urlService: UrlService, outboundHttp: OutboundHttp);
|
|
17
|
+
callSlackApi(method: string, params: Record<string, string>, headers?: Record<string, string>): Promise<Record<string, unknown>>;
|
|
18
|
+
slackError(action: string, response: Record<string, unknown>): BadRequestError;
|
|
19
|
+
getAgent(agentId: string, projectId: string): Promise<Agent>;
|
|
20
|
+
buildManifest(agentName: string, projectId: string, agentId: string, options?: {
|
|
21
|
+
redirectUrl?: string;
|
|
22
|
+
}): SlackAgentAppManifest;
|
|
23
|
+
callbackUrl(projectId: string, agentId: string): string;
|
|
24
|
+
installUrl(oauthAuthorizeUrl: string, state: string, redirectUrl: string): string;
|
|
25
|
+
createAndConnectBotCredential(options: {
|
|
26
|
+
agent: Agent;
|
|
27
|
+
user: User;
|
|
28
|
+
accessToken: string;
|
|
29
|
+
signingSecret: string;
|
|
30
|
+
}): Promise<string>;
|
|
31
|
+
childRecord(record: Record<string, unknown>, key: string): Record<string, unknown> | undefined;
|
|
32
|
+
stringProperty(record: Record<string, unknown> | undefined, key: string): string | undefined;
|
|
33
|
+
private webhookUrl;
|
|
34
|
+
private credentialName;
|
|
35
|
+
private sanitiseSlackAppName;
|
|
36
|
+
}
|