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,130 @@
|
|
|
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.InstanceAiModelCatalogService = void 0;
|
|
13
|
+
const api_types_1 = require("@n8n/api-types");
|
|
14
|
+
const backend_common_1 = require("@n8n/backend-common");
|
|
15
|
+
const di_1 = require("@n8n/di");
|
|
16
|
+
const ensure_error_1 = require("@n8n/utils/errors/ensure-error");
|
|
17
|
+
const CATALOG_CACHE_TTL_MS = 60 * 60 * 1000;
|
|
18
|
+
const CATALOG_FETCH_TIMEOUT_MS = 5000;
|
|
19
|
+
function emptyCatalogResponse() {
|
|
20
|
+
return {
|
|
21
|
+
models: {
|
|
22
|
+
anthropic: [],
|
|
23
|
+
openai: [],
|
|
24
|
+
openrouter: [],
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function compareModels(a, b) {
|
|
29
|
+
const aReleaseTime = a.releaseDate ? Date.parse(a.releaseDate) : Number.NaN;
|
|
30
|
+
const bReleaseTime = b.releaseDate ? Date.parse(b.releaseDate) : Number.NaN;
|
|
31
|
+
const aHasReleaseDate = !Number.isNaN(aReleaseTime);
|
|
32
|
+
const bHasReleaseDate = !Number.isNaN(bReleaseTime);
|
|
33
|
+
if (aHasReleaseDate && bHasReleaseDate && aReleaseTime !== bReleaseTime) {
|
|
34
|
+
return bReleaseTime - aReleaseTime;
|
|
35
|
+
}
|
|
36
|
+
if (aHasReleaseDate !== bHasReleaseDate)
|
|
37
|
+
return aHasReleaseDate ? -1 : 1;
|
|
38
|
+
return a.name.localeCompare(b.name) || a.id.localeCompare(b.id);
|
|
39
|
+
}
|
|
40
|
+
function isEligibleModel(model) {
|
|
41
|
+
const id = typeof model === 'object' && model !== null ? Reflect.get(model, 'id') : undefined;
|
|
42
|
+
const name = typeof model === 'object' && model !== null ? Reflect.get(model, 'name') : undefined;
|
|
43
|
+
const modalities = typeof model === 'object' && model !== null ? Reflect.get(model, 'modalities') : undefined;
|
|
44
|
+
const output = typeof modalities === 'object' && modalities !== null
|
|
45
|
+
? Reflect.get(modalities, 'output')
|
|
46
|
+
: undefined;
|
|
47
|
+
return (typeof model === 'object' &&
|
|
48
|
+
model !== null &&
|
|
49
|
+
Reflect.get(model, 'toolCall') === true &&
|
|
50
|
+
Array.isArray(output) &&
|
|
51
|
+
output.length === 1 &&
|
|
52
|
+
output[0] === 'text' &&
|
|
53
|
+
typeof id === 'string' &&
|
|
54
|
+
id.length > 0 &&
|
|
55
|
+
typeof name === 'string' &&
|
|
56
|
+
name.length > 0);
|
|
57
|
+
}
|
|
58
|
+
let InstanceAiModelCatalogService = class InstanceAiModelCatalogService {
|
|
59
|
+
constructor(logger) {
|
|
60
|
+
this.logger = logger.scoped('instance-ai');
|
|
61
|
+
}
|
|
62
|
+
async getModels() {
|
|
63
|
+
if (this.cached && Date.now() < this.cached.expiresAt)
|
|
64
|
+
return this.cached.value;
|
|
65
|
+
this.fetchPromise ??= this.refresh().finally(() => {
|
|
66
|
+
this.fetchPromise = undefined;
|
|
67
|
+
});
|
|
68
|
+
return await this.fetchPromise;
|
|
69
|
+
}
|
|
70
|
+
async refresh() {
|
|
71
|
+
try {
|
|
72
|
+
const catalog = await this.fetchCatalogWithTimeout();
|
|
73
|
+
const value = this.toResponse(catalog);
|
|
74
|
+
this.cached = { value, expiresAt: Date.now() + CATALOG_CACHE_TTL_MS };
|
|
75
|
+
return value;
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
this.logger.warn('Failed to load the Instance AI model catalog', {
|
|
79
|
+
error: (0, ensure_error_1.ensureError)(error).message,
|
|
80
|
+
});
|
|
81
|
+
return this.cached?.value ?? emptyCatalogResponse();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async fetchCatalogWithTimeout() {
|
|
85
|
+
const abortController = new AbortController();
|
|
86
|
+
let timeout;
|
|
87
|
+
const timeoutPromise = new Promise((_resolve, reject) => {
|
|
88
|
+
timeout = setTimeout(() => {
|
|
89
|
+
reject(new Error('Model catalog request timed out'));
|
|
90
|
+
abortController.abort();
|
|
91
|
+
}, CATALOG_FETCH_TIMEOUT_MS);
|
|
92
|
+
});
|
|
93
|
+
const catalogPromise = this.fetchCatalog(abortController.signal);
|
|
94
|
+
void catalogPromise.catch(() => undefined);
|
|
95
|
+
try {
|
|
96
|
+
return await Promise.race([catalogPromise, timeoutPromise]);
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
if (timeout)
|
|
100
|
+
clearTimeout(timeout);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async fetchCatalog(signal) {
|
|
104
|
+
const { fetchProviderCatalog } = await import('@n8n/agents/catalog');
|
|
105
|
+
return await fetchProviderCatalog({ signal });
|
|
106
|
+
}
|
|
107
|
+
toResponse(catalog) {
|
|
108
|
+
const response = emptyCatalogResponse();
|
|
109
|
+
for (const provider of api_types_1.INSTANCE_AI_CATALOG_PROVIDERS) {
|
|
110
|
+
response.models[provider] = this.getProviderModels(catalog, provider);
|
|
111
|
+
}
|
|
112
|
+
return response;
|
|
113
|
+
}
|
|
114
|
+
getProviderModels(catalog, provider) {
|
|
115
|
+
return Object.values(catalog[provider]?.models ?? {})
|
|
116
|
+
.filter(isEligibleModel)
|
|
117
|
+
.map((model) => ({
|
|
118
|
+
id: model.id,
|
|
119
|
+
name: model.name,
|
|
120
|
+
...(typeof model.releaseDate === 'string' ? { releaseDate: model.releaseDate } : {}),
|
|
121
|
+
}))
|
|
122
|
+
.sort(compareModels);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
exports.InstanceAiModelCatalogService = InstanceAiModelCatalogService;
|
|
126
|
+
exports.InstanceAiModelCatalogService = InstanceAiModelCatalogService = __decorate([
|
|
127
|
+
(0, di_1.Service)(),
|
|
128
|
+
__metadata("design:paramtypes", [backend_common_1.Logger])
|
|
129
|
+
], InstanceAiModelCatalogService);
|
|
130
|
+
//# sourceMappingURL=instance-ai-model-catalog.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instance-ai-model-catalog.service.js","sourceRoot":"","sources":["../../../src/modules/instance-ai/instance-ai-model-catalog.service.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InstanceAiAdminSettingsResponse, InstanceAiAdminSettingsUpdateRequest, InstanceAiUserPreferencesResponse, InstanceAiUserPreferencesUpdateRequest, InstanceAiProviderConnection, InstanceAiPermissions, InstanceAiSandboxProvider } from '@n8n/api-types';
|
|
1
|
+
import type { InstanceAiAdminSettingsResponse, InstanceAiAdminSettingsUpdateRequest, InstanceAiConnectionUpdate, InstanceAiUserPreferencesResponse, InstanceAiUserPreferencesUpdateRequest, InstanceAiProviderConnection, InstanceAiPermissions, InstanceAiSandboxProvider } from '@n8n/api-types';
|
|
2
2
|
import { GlobalConfig } from '@n8n/config';
|
|
3
3
|
import { DbLockService, SettingsRepository, UserRepository } from '@n8n/db';
|
|
4
4
|
import type { User } from '@n8n/db';
|
|
@@ -37,6 +37,9 @@ export declare class InstanceAiSettingsService {
|
|
|
37
37
|
private mcpAccessEnabled;
|
|
38
38
|
private permissions;
|
|
39
39
|
private adminModelName;
|
|
40
|
+
private searchDisabled;
|
|
41
|
+
private adminN8nSandboxServiceUrl;
|
|
42
|
+
private readonly environmentN8nSandboxServiceUrl;
|
|
40
43
|
constructor(globalConfig: GlobalConfig, dbLockService: DbLockService, settingsRepository: SettingsRepository, userRepository: UserRepository, userService: UserService, aiService: AiService, credentialsService: CredentialsService, credentialsFinderService: CredentialsFinderService, instanceCredentialBroker: InstanceCredentialBroker, eventService: EventService);
|
|
41
44
|
private get isCloud();
|
|
42
45
|
isProxyEnabled(): boolean;
|
|
@@ -53,6 +56,10 @@ export declare class InstanceAiSettingsService {
|
|
|
53
56
|
reloadFromDb(): Promise<void>;
|
|
54
57
|
getUserPreferences(user: User): Promise<InstanceAiUserPreferencesResponse>;
|
|
55
58
|
updateUserPreferences(user: User, update: InstanceAiUserPreferencesUpdateRequest): Promise<InstanceAiUserPreferencesResponse>;
|
|
59
|
+
resolveModelConnectionForVerification(connection: InstanceAiConnectionUpdate): Promise<InstanceAiConnectionUpdate>;
|
|
60
|
+
resolveSandboxConnectionForVerification(connection: InstanceAiConnectionUpdate): Promise<InstanceAiConnectionUpdate>;
|
|
61
|
+
resolveSearchConnectionForVerification(connection: InstanceAiConnectionUpdate): Promise<InstanceAiConnectionUpdate>;
|
|
62
|
+
private connectionForVerification;
|
|
56
63
|
listInstanceModelCredentials(): Promise<InstanceAiProviderConnection[]>;
|
|
57
64
|
listInstanceServiceCredentials(): Promise<InstanceAiProviderConnection[]>;
|
|
58
65
|
resolveDaytonaConfig(): Promise<{
|
|
@@ -78,19 +85,28 @@ export declare class InstanceAiSettingsService {
|
|
|
78
85
|
isBrowserUseEnabled(): boolean;
|
|
79
86
|
getSandboxStatus(): InstanceAiSandboxStatus;
|
|
80
87
|
isInstanceAiEnabled(): boolean;
|
|
88
|
+
isSetupCompleted(): Promise<boolean>;
|
|
81
89
|
resolveModelName(user: User): string;
|
|
82
90
|
resolveModelConfig(user: User): Promise<ModelConfig>;
|
|
91
|
+
resolveModelConfigForVerification(user: User, modelName?: string): Promise<ModelConfig>;
|
|
92
|
+
buildModelConfigForConnection(connection: InstanceAiConnectionUpdate, modelName: string): ModelConfig;
|
|
83
93
|
private resolveAdminModelConfig;
|
|
84
94
|
private buildModelConfigFromCredential;
|
|
85
95
|
private buildModelConfig;
|
|
86
96
|
private static readonly MANAGED_ADMIN_FIELDS;
|
|
87
97
|
private static readonly INSTANCE_CREDENTIAL_FIELDS;
|
|
88
98
|
private static readonly MANAGED_PREFERENCE_FIELDS;
|
|
99
|
+
private rejectEnvironmentManagedFields;
|
|
89
100
|
private deploymentLabel;
|
|
90
101
|
private rejectManagedFields;
|
|
91
102
|
private validateAdminSettingsUpdate;
|
|
92
103
|
private getSandboxUnavailableReason;
|
|
93
104
|
private envVarModelConfig;
|
|
105
|
+
private hasEnvironmentModelConnection;
|
|
106
|
+
private hasEnvironmentModelName;
|
|
107
|
+
private hasEnvironmentSandboxConnection;
|
|
108
|
+
private hasEnvironmentSearchConnection;
|
|
109
|
+
private isDirectSelfManaged;
|
|
94
110
|
private envVarModelConfigForModel;
|
|
95
111
|
private extractModelName;
|
|
96
112
|
private applyAdminSettings;
|
|
@@ -174,9 +174,12 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
174
174
|
this.mcpAccessEnabled = true;
|
|
175
175
|
this.permissions = { ...api_types_1.DEFAULT_INSTANCE_AI_PERMISSIONS };
|
|
176
176
|
this.adminModelName = null;
|
|
177
|
+
this.searchDisabled = false;
|
|
178
|
+
this.adminN8nSandboxServiceUrl = null;
|
|
177
179
|
this.config = globalConfig.instanceAi;
|
|
178
180
|
this.deploymentConfig = globalConfig.deployment;
|
|
179
181
|
this.environmentSandboxProvider = (0, sandbox_provider_1.normalizeSandboxProvider)(this.config.sandboxProvider);
|
|
182
|
+
this.environmentN8nSandboxServiceUrl = this.config.n8nSandboxServiceUrl;
|
|
180
183
|
this.config.sandboxProvider = this.environmentSandboxProvider;
|
|
181
184
|
}
|
|
182
185
|
get isCloud() {
|
|
@@ -243,38 +246,80 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
243
246
|
const modelProviderApiKeyEnv = MODEL_PROVIDER_API_KEY_ENV.get(c.model.split('/', 1)[0] ?? '');
|
|
244
247
|
const isProxyEnabled = this.aiService.isProxyEnabled();
|
|
245
248
|
const isManaged = this.isCloud || isProxyEnabled;
|
|
246
|
-
const
|
|
249
|
+
const providerModelApiKeyConfigured = Boolean(modelProviderApiKeyEnv && process.env[modelProviderApiKeyEnv]?.trim());
|
|
250
|
+
const modelConnectionEnvConfigured = Boolean(c.modelApiKey.trim() || c.modelUrl.trim() || providerModelApiKeyConfigured);
|
|
251
|
+
const sandboxEnvConfigured = this.hasEnvironmentSandboxConnection();
|
|
252
|
+
const searchEnvConfigured = this.hasEnvironmentSearchConnection();
|
|
253
|
+
const directEnvironmentConfig = !isManaged;
|
|
254
|
+
const sandboxProvider = (0, sandbox_provider_1.normalizeSandboxProvider)(directEnvironmentConfig && sandboxEnvConfigured
|
|
255
|
+
? this.environmentSandboxProvider
|
|
256
|
+
: c.sandboxProvider);
|
|
247
257
|
return {
|
|
248
258
|
enabled: this.enabled,
|
|
249
259
|
permissions: { ...this.permissions },
|
|
250
260
|
mcpAccessEnabled: this.mcpAccessEnabled,
|
|
251
261
|
sandboxEnabled: c.sandboxEnabled,
|
|
252
262
|
sandboxProvider,
|
|
253
|
-
daytonaCredentialId: isManaged
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
daytonaCredentialId: isManaged || (directEnvironmentConfig && sandboxEnvConfigured)
|
|
264
|
+
? null
|
|
265
|
+
: credentialSelection.daytonaCredentialId,
|
|
266
|
+
n8nSandboxCredentialId: this.isCloud || (directEnvironmentConfig && sandboxEnvConfigured)
|
|
267
|
+
? null
|
|
268
|
+
: credentialSelection.n8nSandboxCredentialId,
|
|
269
|
+
searchCredentialId: isManaged || (directEnvironmentConfig && searchEnvConfigured)
|
|
270
|
+
? null
|
|
271
|
+
: credentialSelection.searchCredentialId,
|
|
272
|
+
modelCredentialId: isManaged || (directEnvironmentConfig && modelConnectionEnvConfigured)
|
|
273
|
+
? null
|
|
274
|
+
: credentialSelection.modelCredentialId,
|
|
275
|
+
modelName: isManaged || this.hasEnvironmentModelName() ? null : credentialSelection.modelName,
|
|
276
|
+
modelEnvConfigured: modelConnectionEnvConfigured,
|
|
277
|
+
sandboxEnvConfigured,
|
|
278
|
+
searchEnvConfigured,
|
|
279
|
+
searchDisabled: directEnvironmentConfig && searchEnvConfigured ? false : this.searchDisabled,
|
|
280
|
+
n8nSandboxServiceUrl: this.environmentN8nSandboxServiceUrl
|
|
281
|
+
? null
|
|
282
|
+
: this.adminN8nSandboxServiceUrl,
|
|
283
|
+
envManaged: {
|
|
284
|
+
model: {
|
|
285
|
+
provider: modelConnectionEnvConfigured,
|
|
286
|
+
apiKey: Boolean(c.modelApiKey.trim() || providerModelApiKeyConfigured),
|
|
287
|
+
baseUrl: Boolean(c.modelUrl.trim()),
|
|
288
|
+
model: Boolean(process.env.N8N_INSTANCE_AI_MODEL?.trim()),
|
|
289
|
+
},
|
|
290
|
+
sandbox: {
|
|
291
|
+
provider: Boolean(process.env.N8N_INSTANCE_AI_SANDBOX_PROVIDER?.trim()),
|
|
292
|
+
serviceUrl: Boolean(this.environmentN8nSandboxServiceUrl.trim()),
|
|
293
|
+
apiKey: sandboxProvider === 'daytona'
|
|
294
|
+
? Boolean(c.daytonaApiKey.trim())
|
|
295
|
+
: Boolean(c.n8nSandboxServiceApiKey.trim()),
|
|
296
|
+
},
|
|
297
|
+
search: {
|
|
298
|
+
provider: Boolean(c.braveSearchApiKey.trim() || c.searxngUrl.trim()),
|
|
299
|
+
apiKey: Boolean(c.braveSearchApiKey.trim()),
|
|
300
|
+
url: Boolean(c.searxngUrl.trim()),
|
|
301
|
+
},
|
|
302
|
+
},
|
|
265
303
|
localGatewayDisabled: this.isLocalGatewayDisabled(),
|
|
266
304
|
browserUseEnabled: this.isBrowserUseEnabled(),
|
|
267
305
|
};
|
|
268
306
|
}
|
|
269
307
|
async updateAdminSettings(update, user) {
|
|
308
|
+
this.rejectEnvironmentManagedFields(update);
|
|
270
309
|
this.rejectManagedFields(update, InstanceAiSettingsService_1.MANAGED_ADMIN_FIELDS, this.deploymentLabel());
|
|
271
310
|
if (this.isCloud) {
|
|
272
311
|
this.rejectManagedFields(update, InstanceAiSettingsService_1.INSTANCE_CREDENTIAL_FIELDS, this.deploymentLabel());
|
|
273
|
-
this.rejectManagedFields(update, [
|
|
312
|
+
this.rejectManagedFields(update, [
|
|
313
|
+
'modelName',
|
|
314
|
+
'sandboxProvider',
|
|
315
|
+
'sandboxEnabled',
|
|
316
|
+
'n8nSandboxServiceUrl',
|
|
317
|
+
'searchDisabled',
|
|
318
|
+
], this.deploymentLabel());
|
|
274
319
|
}
|
|
275
320
|
else if (this.aiService.isProxyEnabled()) {
|
|
276
321
|
this.rejectManagedFields(update, ['modelCredentialId', 'searchCredentialId', 'modelConnection', 'searchConnection'], this.deploymentLabel());
|
|
277
|
-
this.rejectManagedFields(update, ['modelName'], this.deploymentLabel());
|
|
322
|
+
this.rejectManagedFields(update, ['modelName', 'sandboxEnabled', 'n8nSandboxServiceUrl', 'searchDisabled'], this.deploymentLabel());
|
|
278
323
|
if (update.daytonaCredentialId !== null) {
|
|
279
324
|
this.rejectManagedFields(update, ['daytonaCredentialId'], this.deploymentLabel());
|
|
280
325
|
}
|
|
@@ -287,6 +332,15 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
287
332
|
let daytonaCredentialId = initialDaytonaCredentialId;
|
|
288
333
|
let n8nSandboxCredentialId = initialN8nSandboxCredentialId;
|
|
289
334
|
let searchCredentialId = initialSearchCredentialId;
|
|
335
|
+
if (settingsUpdate.searchDisabled === true) {
|
|
336
|
+
if (searchConnection) {
|
|
337
|
+
throw new unprocessable_error_1.UnprocessableRequestError('Cannot disable web search while configuring a search connection');
|
|
338
|
+
}
|
|
339
|
+
searchCredentialId = null;
|
|
340
|
+
}
|
|
341
|
+
else if (searchConnection || typeof searchCredentialId === 'string') {
|
|
342
|
+
settingsUpdate.searchDisabled = false;
|
|
343
|
+
}
|
|
290
344
|
this.rejectConnectionConflicts(update);
|
|
291
345
|
if (modelConnection !== undefined ||
|
|
292
346
|
sandboxConnection !== undefined ||
|
|
@@ -358,7 +412,13 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
358
412
|
n8nSandboxCredentialId !== undefined) &&
|
|
359
413
|
nextDaytonaCredentialId === null &&
|
|
360
414
|
nextN8nCredentialId === null;
|
|
361
|
-
|
|
415
|
+
const assignsSandboxConnection = (sandboxConnection !== undefined ||
|
|
416
|
+
daytonaCredentialId !== undefined ||
|
|
417
|
+
n8nSandboxCredentialId !== undefined) &&
|
|
418
|
+
(nextDaytonaCredentialId !== null || nextN8nCredentialId !== null);
|
|
419
|
+
if (assignsSandboxConnection)
|
|
420
|
+
settingsUpdate.sandboxEnabled = true;
|
|
421
|
+
this.validateAdminSettingsUpdate(settingsUpdate, current, clearsSandboxConnection
|
|
362
422
|
? this.environmentSandboxProvider
|
|
363
423
|
: settingsUpdate.sandboxProvider);
|
|
364
424
|
const previous = this.snapshotAdminSettings();
|
|
@@ -377,7 +437,7 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
377
437
|
if (hasCredential && !hasModelName) {
|
|
378
438
|
throw new unprocessable_error_1.UnprocessableRequestError('modelName must be set together with modelCredentialId');
|
|
379
439
|
}
|
|
380
|
-
if (hasModelName && !hasCredential) {
|
|
440
|
+
if (hasModelName && !hasCredential && !this.hasEnvironmentModelConnection()) {
|
|
381
441
|
throw new unprocessable_error_1.UnprocessableRequestError('modelName requires modelCredentialId');
|
|
382
442
|
}
|
|
383
443
|
}
|
|
@@ -588,6 +648,26 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
588
648
|
user.settings = { ...(user.settings ?? {}), instanceAi: prefs };
|
|
589
649
|
return await this.getUserPreferences(user);
|
|
590
650
|
}
|
|
651
|
+
async resolveModelConnectionForVerification(connection) {
|
|
652
|
+
const prepared = await this.prepareConnection(exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY, 'AI Assistant model', connection);
|
|
653
|
+
return this.connectionForVerification(prepared);
|
|
654
|
+
}
|
|
655
|
+
async resolveSandboxConnectionForVerification(connection) {
|
|
656
|
+
const prepared = await this.prepareSandboxConnection(connection);
|
|
657
|
+
return this.connectionForVerification(prepared);
|
|
658
|
+
}
|
|
659
|
+
async resolveSearchConnectionForVerification(connection) {
|
|
660
|
+
const prepared = await this.prepareConnection(exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY, 'AI Assistant web search', connection);
|
|
661
|
+
return this.connectionForVerification(prepared);
|
|
662
|
+
}
|
|
663
|
+
connectionForVerification(prepared) {
|
|
664
|
+
if (!prepared)
|
|
665
|
+
throw new n8n_workflow_1.UnexpectedError('Prepared provider connection is missing');
|
|
666
|
+
return {
|
|
667
|
+
type: prepared.credential.type,
|
|
668
|
+
data: prepared.credential.data,
|
|
669
|
+
};
|
|
670
|
+
}
|
|
591
671
|
async listInstanceModelCredentials() {
|
|
592
672
|
if (this.isCloud || this.aiService.isProxyEnabled())
|
|
593
673
|
return [];
|
|
@@ -621,6 +701,11 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
621
701
|
apiUrl: daytonaApiUrl || undefined,
|
|
622
702
|
apiKey: daytonaApiKey || undefined,
|
|
623
703
|
};
|
|
704
|
+
if (this.isDirectSelfManaged() &&
|
|
705
|
+
this.environmentSandboxProvider === 'daytona' &&
|
|
706
|
+
this.hasEnvironmentSandboxConnection()) {
|
|
707
|
+
return envConfig;
|
|
708
|
+
}
|
|
624
709
|
const resolved = await this.resolveServiceCredential(exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY, 'Daytona sandbox');
|
|
625
710
|
if (!resolved)
|
|
626
711
|
return envConfig;
|
|
@@ -639,6 +724,11 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
639
724
|
serviceUrl: n8nSandboxServiceUrl || undefined,
|
|
640
725
|
apiKey: n8nSandboxServiceApiKey || undefined,
|
|
641
726
|
};
|
|
727
|
+
if (this.isDirectSelfManaged() &&
|
|
728
|
+
this.environmentSandboxProvider === 'n8n-sandbox' &&
|
|
729
|
+
this.hasEnvironmentSandboxConnection()) {
|
|
730
|
+
return envConfig;
|
|
731
|
+
}
|
|
642
732
|
const resolved = await this.resolveServiceCredential(exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY, 'n8n Sandbox');
|
|
643
733
|
if (!resolved)
|
|
644
734
|
return envConfig;
|
|
@@ -661,6 +751,8 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
661
751
|
braveApiKey: braveSearchApiKey || undefined,
|
|
662
752
|
searxngUrl: searxngUrl || undefined,
|
|
663
753
|
};
|
|
754
|
+
if (this.isDirectSelfManaged() && this.hasEnvironmentSearchConnection())
|
|
755
|
+
return envConfig;
|
|
664
756
|
const resolved = await this.resolveServiceCredential(exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY, 'search');
|
|
665
757
|
if (!resolved)
|
|
666
758
|
return envConfig;
|
|
@@ -739,14 +831,41 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
739
831
|
isInstanceAiEnabled() {
|
|
740
832
|
return this.enabled;
|
|
741
833
|
}
|
|
834
|
+
async isSetupCompleted() {
|
|
835
|
+
if (this.isCloud || this.aiService.isProxyEnabled())
|
|
836
|
+
return true;
|
|
837
|
+
const [modelSelection, daytonaCredentialId, n8nSandboxCredentialId, searchCredentialId] = await Promise.all([
|
|
838
|
+
this.readAdminModelSelection(),
|
|
839
|
+
this.instanceCredentialBroker.getAssignedCredentialId(exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY),
|
|
840
|
+
this.instanceCredentialBroker.getAssignedCredentialId(exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY),
|
|
841
|
+
this.instanceCredentialBroker.getAssignedCredentialId(exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY),
|
|
842
|
+
]);
|
|
843
|
+
const response = this.buildAdminSettingsResponse({
|
|
844
|
+
...modelSelection,
|
|
845
|
+
daytonaCredentialId,
|
|
846
|
+
n8nSandboxCredentialId,
|
|
847
|
+
searchCredentialId,
|
|
848
|
+
});
|
|
849
|
+
const modelConfigured = Boolean(response.modelEnvConfigured || (response.modelCredentialId && response.modelName));
|
|
850
|
+
const sandboxCredentialId = response.sandboxProvider === 'daytona'
|
|
851
|
+
? response.daytonaCredentialId
|
|
852
|
+
: response.n8nSandboxCredentialId;
|
|
853
|
+
const sandboxConfigured = Boolean(response.sandboxEnabled && (response.sandboxEnvConfigured || sandboxCredentialId));
|
|
854
|
+
const searchDecided = Boolean(response.searchEnvConfigured || response.searchCredentialId || response.searchDisabled);
|
|
855
|
+
return modelConfigured && sandboxConfigured && searchDecided;
|
|
856
|
+
}
|
|
742
857
|
resolveModelName(user) {
|
|
743
858
|
const prefs = this.readUserPreferences(user);
|
|
859
|
+
if (this.isDirectSelfManaged() && this.hasEnvironmentModelName())
|
|
860
|
+
return this.extractModelName(this.config.model);
|
|
744
861
|
const adminModelName = this.isCloud || this.aiService.isProxyEnabled() ? null : this.adminModelName;
|
|
745
862
|
return adminModelName ?? prefs.modelName ?? this.extractModelName(this.config.model);
|
|
746
863
|
}
|
|
747
864
|
async resolveModelConfig(user) {
|
|
748
865
|
const prefs = this.readUserPreferences(user);
|
|
749
866
|
const fallbackModelName = prefs.modelName ?? this.extractModelName(this.config.model);
|
|
867
|
+
if (this.isDirectSelfManaged() && this.hasEnvironmentModelConnection())
|
|
868
|
+
return this.envVarModelConfig();
|
|
750
869
|
const adminModelConfig = await this.resolveAdminModelConfig();
|
|
751
870
|
if (adminModelConfig) {
|
|
752
871
|
return adminModelConfig;
|
|
@@ -762,8 +881,37 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
762
881
|
return ((await this.buildModelConfigFromCredential(credential, fallbackModelName)) ??
|
|
763
882
|
this.envVarModelConfig());
|
|
764
883
|
}
|
|
884
|
+
async resolveModelConfigForVerification(user, modelName) {
|
|
885
|
+
const config = await this.resolveModelConfig(user);
|
|
886
|
+
if (!modelName)
|
|
887
|
+
return config;
|
|
888
|
+
if (typeof config === 'string') {
|
|
889
|
+
const provider = config.includes('/') ? config.slice(0, config.indexOf('/')) : 'custom';
|
|
890
|
+
return `${provider}/${modelName}`;
|
|
891
|
+
}
|
|
892
|
+
if ('id' in config && typeof config.id === 'string') {
|
|
893
|
+
const provider = config.id.includes('/')
|
|
894
|
+
? config.id.slice(0, config.id.indexOf('/'))
|
|
895
|
+
: 'custom';
|
|
896
|
+
return { ...config, id: `${provider}/${modelName}` };
|
|
897
|
+
}
|
|
898
|
+
return config;
|
|
899
|
+
}
|
|
900
|
+
buildModelConfigForConnection(connection, modelName) {
|
|
901
|
+
if (!exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY.credentialTypes.includes(connection.type)) {
|
|
902
|
+
throw new unprocessable_error_1.UnprocessableRequestError(`Connection type "${connection.type}" is not supported for the model`);
|
|
903
|
+
}
|
|
904
|
+
validateModelCredential({ type: connection.type, data: connection.data });
|
|
905
|
+
const config = this.buildModelConfig(connection.type, connection.data, modelName);
|
|
906
|
+
if (!config) {
|
|
907
|
+
throw new unprocessable_error_1.UnprocessableRequestError('The model connection is incomplete');
|
|
908
|
+
}
|
|
909
|
+
return config;
|
|
910
|
+
}
|
|
765
911
|
async resolveAdminModelConfig() {
|
|
766
|
-
if (this.isCloud ||
|
|
912
|
+
if (this.isCloud ||
|
|
913
|
+
this.aiService.isProxyEnabled() ||
|
|
914
|
+
(this.isDirectSelfManaged() && this.hasEnvironmentModelConnection()))
|
|
767
915
|
return null;
|
|
768
916
|
return await this.withPersistedAdminSettings(async (ctx, persisted) => {
|
|
769
917
|
const modelName = persisted.modelName ?? null;
|
|
@@ -798,6 +946,23 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
798
946
|
const headers = modelCredentialHeaders(credentialType, data);
|
|
799
947
|
return { id, url: baseUrl, ...(apiKey ? { apiKey } : {}), ...(headers ? { headers } : {}) };
|
|
800
948
|
}
|
|
949
|
+
rejectEnvironmentManagedFields(update) {
|
|
950
|
+
if (!this.isDirectSelfManaged())
|
|
951
|
+
return;
|
|
952
|
+
const managedFields = [];
|
|
953
|
+
if (this.hasEnvironmentModelConnection()) {
|
|
954
|
+
managedFields.push('modelCredentialId', 'modelConnection');
|
|
955
|
+
}
|
|
956
|
+
if (this.hasEnvironmentModelName())
|
|
957
|
+
managedFields.push('modelName');
|
|
958
|
+
if (this.hasEnvironmentSandboxConnection()) {
|
|
959
|
+
managedFields.push('sandboxProvider', 'daytonaCredentialId', 'n8nSandboxCredentialId', 'sandboxConnection', 'n8nSandboxServiceUrl');
|
|
960
|
+
}
|
|
961
|
+
if (this.hasEnvironmentSearchConnection()) {
|
|
962
|
+
managedFields.push('searchCredentialId', 'searchConnection', 'searchDisabled');
|
|
963
|
+
}
|
|
964
|
+
this.rejectManagedFields(update, managedFields, 'environment');
|
|
965
|
+
}
|
|
801
966
|
deploymentLabel() {
|
|
802
967
|
if (this.isCloud)
|
|
803
968
|
return 'cloud';
|
|
@@ -815,6 +980,7 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
815
980
|
validateAdminSettingsUpdate(update, current, sandboxProviderOverride) {
|
|
816
981
|
const touchesSandboxSettings = update.sandboxEnabled !== undefined ||
|
|
817
982
|
update.sandboxProvider !== undefined ||
|
|
983
|
+
update.n8nSandboxServiceUrl !== undefined ||
|
|
818
984
|
update.sandboxImage !== undefined ||
|
|
819
985
|
update.sandboxTimeout !== undefined ||
|
|
820
986
|
update.daytonaCredentialId !== undefined ||
|
|
@@ -827,20 +993,51 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
827
993
|
current.sandboxProvider ??
|
|
828
994
|
this.environmentSandboxProvider);
|
|
829
995
|
const sandboxEnabled = update.sandboxEnabled ?? current.sandboxEnabled ?? false;
|
|
830
|
-
const
|
|
996
|
+
const sandboxServiceUrl = this.environmentN8nSandboxServiceUrl ||
|
|
997
|
+
update.n8nSandboxServiceUrl ||
|
|
998
|
+
current.n8nSandboxServiceUrl ||
|
|
999
|
+
'';
|
|
1000
|
+
const unavailableReason = this.getSandboxUnavailableReason(sandboxEnabled, sandboxProvider, sandboxServiceUrl);
|
|
831
1001
|
if (unavailableReason)
|
|
832
1002
|
throw new unprocessable_error_1.UnprocessableRequestError(unavailableReason);
|
|
833
1003
|
}
|
|
834
|
-
getSandboxUnavailableReason(sandboxEnabled, sandboxProvider) {
|
|
1004
|
+
getSandboxUnavailableReason(sandboxEnabled, sandboxProvider, sandboxServiceUrl = this.config.n8nSandboxServiceUrl) {
|
|
835
1005
|
if (sandboxEnabled &&
|
|
836
1006
|
sandboxProvider === 'n8n-sandbox' &&
|
|
837
|
-
|
|
1007
|
+
sandboxServiceUrl.trim().length === 0) {
|
|
838
1008
|
return sandbox_provider_1.N8N_SANDBOX_SERVICE_URL_REQUIRED_MESSAGE;
|
|
839
1009
|
}
|
|
840
1010
|
return null;
|
|
841
1011
|
}
|
|
842
1012
|
envVarModelConfig() {
|
|
843
|
-
|
|
1013
|
+
const configuredModel = this.config.model;
|
|
1014
|
+
if (this.hasEnvironmentModelName() || !this.adminModelName)
|
|
1015
|
+
return this.envVarModelConfigForModel(configuredModel);
|
|
1016
|
+
const slash = configuredModel.indexOf('/');
|
|
1017
|
+
const provider = slash >= 0 ? configuredModel.slice(0, slash) : 'custom';
|
|
1018
|
+
return this.envVarModelConfigForModel(`${provider}/${this.adminModelName}`);
|
|
1019
|
+
}
|
|
1020
|
+
hasEnvironmentModelConnection() {
|
|
1021
|
+
const provider = this.config.model.split('/', 1)[0] ?? '';
|
|
1022
|
+
const providerApiKeyEnv = MODEL_PROVIDER_API_KEY_ENV.get(provider);
|
|
1023
|
+
return Boolean(this.config.modelApiKey.trim() ||
|
|
1024
|
+
this.config.modelUrl.trim() ||
|
|
1025
|
+
(providerApiKeyEnv && process.env[providerApiKeyEnv]?.trim()));
|
|
1026
|
+
}
|
|
1027
|
+
hasEnvironmentModelName() {
|
|
1028
|
+
return Boolean(process.env.N8N_INSTANCE_AI_MODEL?.trim());
|
|
1029
|
+
}
|
|
1030
|
+
hasEnvironmentSandboxConnection() {
|
|
1031
|
+
if (this.environmentSandboxProvider === 'daytona') {
|
|
1032
|
+
return this.aiService.isProxyEnabled() || Boolean(this.config.daytonaApiKey.trim());
|
|
1033
|
+
}
|
|
1034
|
+
return Boolean(this.environmentN8nSandboxServiceUrl.trim());
|
|
1035
|
+
}
|
|
1036
|
+
hasEnvironmentSearchConnection() {
|
|
1037
|
+
return Boolean(this.config.braveSearchApiKey.trim() || this.config.searxngUrl.trim());
|
|
1038
|
+
}
|
|
1039
|
+
isDirectSelfManaged() {
|
|
1040
|
+
return !this.isCloud && !this.aiService.isProxyEnabled();
|
|
844
1041
|
}
|
|
845
1042
|
envVarModelConfigForModel(model) {
|
|
846
1043
|
const { modelUrl, modelApiKey } = this.config;
|
|
@@ -876,7 +1073,9 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
876
1073
|
if (persisted.sandboxEnabled !== undefined)
|
|
877
1074
|
c.sandboxEnabled = persisted.sandboxEnabled;
|
|
878
1075
|
this.sandboxProviderOverride =
|
|
879
|
-
this.isCloud ||
|
|
1076
|
+
this.isCloud ||
|
|
1077
|
+
(this.isDirectSelfManaged() && this.hasEnvironmentSandboxConnection()) ||
|
|
1078
|
+
!persisted.sandboxProvider
|
|
880
1079
|
? undefined
|
|
881
1080
|
: (0, sandbox_provider_1.normalizeSandboxProvider)(persisted.sandboxProvider);
|
|
882
1081
|
c.sandboxProvider = this.sandboxProviderOverride ?? this.environmentSandboxProvider;
|
|
@@ -886,6 +1085,16 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
886
1085
|
c.sandboxTimeout = persisted.sandboxTimeout;
|
|
887
1086
|
if (persisted.modelName !== undefined)
|
|
888
1087
|
this.adminModelName = persisted.modelName;
|
|
1088
|
+
if (persisted.searchDisabled !== undefined)
|
|
1089
|
+
this.searchDisabled =
|
|
1090
|
+
this.isDirectSelfManaged() && this.hasEnvironmentSearchConnection()
|
|
1091
|
+
? false
|
|
1092
|
+
: persisted.searchDisabled;
|
|
1093
|
+
if (persisted.n8nSandboxServiceUrl !== undefined) {
|
|
1094
|
+
this.adminN8nSandboxServiceUrl = persisted.n8nSandboxServiceUrl;
|
|
1095
|
+
this.config.n8nSandboxServiceUrl =
|
|
1096
|
+
this.environmentN8nSandboxServiceUrl || persisted.n8nSandboxServiceUrl || '';
|
|
1097
|
+
}
|
|
889
1098
|
if (persisted.localGatewayDisabled !== undefined)
|
|
890
1099
|
c.localGatewayDisabled = persisted.localGatewayDisabled;
|
|
891
1100
|
if (persisted.browserUseEnabled !== undefined)
|
|
@@ -906,6 +1115,8 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
906
1115
|
sandboxImage: c.sandboxImage,
|
|
907
1116
|
sandboxTimeout: c.sandboxTimeout,
|
|
908
1117
|
modelName: this.adminModelName,
|
|
1118
|
+
searchDisabled: this.searchDisabled,
|
|
1119
|
+
n8nSandboxServiceUrl: this.adminN8nSandboxServiceUrl,
|
|
909
1120
|
localGatewayDisabled: c.localGatewayDisabled,
|
|
910
1121
|
browserUseEnabled: c.browserUseEnabled,
|
|
911
1122
|
};
|
|
@@ -964,7 +1175,6 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
964
1175
|
exports.InstanceAiSettingsService = InstanceAiSettingsService;
|
|
965
1176
|
InstanceAiSettingsService.MANAGED_ADMIN_FIELDS = [
|
|
966
1177
|
'mcpServers',
|
|
967
|
-
'sandboxEnabled',
|
|
968
1178
|
'sandboxImage',
|
|
969
1179
|
'sandboxTimeout',
|
|
970
1180
|
];
|