n8n 2.32.6 → 2.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/active-workflow-manager.d.ts +4 -1
- package/dist/active-workflow-manager.js +18 -16
- package/dist/active-workflow-manager.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/collaboration/collaboration.service.d.ts +1 -0
- package/dist/collaboration/collaboration.service.js +12 -1
- package/dist/collaboration/collaboration.service.js.map +1 -1
- package/dist/commands/base-command.d.ts +3 -2
- package/dist/commands/base-command.js +31 -23
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/db/revert.js.map +1 -1
- package/dist/commands/import/credentials.d.ts +1 -1
- package/dist/commands/import/credentials.js +91 -25
- package/dist/commands/import/credentials.js.map +1 -1
- package/dist/commands/ldap/reset.js.map +1 -1
- package/dist/commands/start.d.ts +1 -0
- package/dist/commands/start.js +3 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/user-management/reset.js +1 -5
- package/dist/commands/user-management/reset.js.map +1 -1
- package/dist/commands/webhook.d.ts +1 -0
- package/dist/commands/webhook.js +1 -1
- package/dist/commands/webhook.js.map +1 -1
- package/dist/commands/worker.d.ts +1 -0
- package/dist/commands/worker.js +1 -1
- package/dist/commands/worker.js.map +1 -1
- package/dist/constants.js +19 -0
- package/dist/constants.js.map +1 -1
- package/dist/controllers/ai.controller.d.ts +4 -5
- package/dist/controllers/ai.controller.js +5 -22
- package/dist/controllers/ai.controller.js.map +1 -1
- package/dist/controllers/e2e.controller.d.ts +15 -2
- package/dist/controllers/e2e.controller.js +25 -2
- package/dist/controllers/e2e.controller.js.map +1 -1
- package/dist/controllers/oauth/oauth2-credential.controller.js +5 -1
- package/dist/controllers/oauth/oauth2-credential.controller.js.map +1 -1
- package/dist/controllers/project.controller.js.map +1 -1
- package/dist/controllers/role.controller.d.ts +2 -2
- package/dist/controllers/role.controller.js +4 -3
- package/dist/controllers/role.controller.js.map +1 -1
- package/dist/controllers/users.controller.d.ts +5 -0
- package/dist/controllers/users.controller.js +1 -0
- package/dist/controllers/users.controller.js.map +1 -1
- package/dist/credentials/credential-connection-status-proxy.js.map +1 -1
- package/dist/credentials/credential-dependency.service.js.map +1 -1
- package/dist/credentials/credentials-finder.service.d.ts +7 -2
- package/dist/credentials/credentials-finder.service.js +33 -8
- package/dist/credentials/credentials-finder.service.js.map +1 -1
- package/dist/credentials/credentials.controller.d.ts +6 -0
- package/dist/credentials/credentials.controller.js +44 -5
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +38 -5
- package/dist/credentials/credentials.service.ee.d.ts +4 -2
- package/dist/credentials/credentials.service.ee.js +8 -7
- package/dist/credentials/credentials.service.ee.js.map +1 -1
- package/dist/credentials/credentials.service.js +227 -21
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials/instance-credential-broker.d.ts +24 -0
- package/dist/credentials/instance-credential-broker.js +80 -0
- package/dist/credentials/instance-credential-broker.js.map +1 -0
- package/dist/credentials/instance-credential-use.registry.d.ts +14 -0
- package/dist/credentials/instance-credential-use.registry.js +43 -0
- package/dist/credentials/instance-credential-use.registry.js.map +1 -0
- package/dist/credentials-helper.js +4 -0
- package/dist/credentials-helper.js.map +1 -1
- package/dist/credentials-overwrites.js +2 -1
- package/dist/credentials-overwrites.js.map +1 -1
- package/dist/errors/response-errors/workflow-deactivation-bad-request.error.d.ts +9 -0
- package/dist/errors/response-errors/workflow-deactivation-bad-request.error.js +13 -0
- package/dist/errors/response-errors/workflow-deactivation-bad-request.error.js.map +1 -0
- package/dist/evaluation.ee/evaluation-collection.service.d.ts +12 -2
- package/dist/evaluation.ee/evaluation-collection.service.js +132 -20
- package/dist/evaluation.ee/evaluation-collection.service.js.map +1 -1
- package/dist/evaluation.ee/evaluation-collections.controller.ee.d.ts +12 -0
- package/dist/evaluation.ee/evaluation-collections.controller.ee.js +12 -0
- package/dist/evaluation.ee/evaluation-collections.controller.ee.js.map +1 -1
- package/dist/evaluation.ee/insights/eval-insights.service.d.ts +11 -4
- package/dist/evaluation.ee/insights/eval-insights.service.js +136 -30
- package/dist/evaluation.ee/insights/eval-insights.service.js.map +1 -1
- package/dist/evaluation.ee/insights/insights-context-builder.d.ts +59 -0
- package/dist/evaluation.ee/insights/insights-context-builder.js +179 -0
- package/dist/evaluation.ee/insights/insights-context-builder.js.map +1 -0
- package/dist/evaluation.ee/insights/insights-model-resolver.d.ts +16 -0
- package/dist/evaluation.ee/insights/insights-model-resolver.js +65 -0
- package/dist/evaluation.ee/insights/insights-model-resolver.js.map +1 -0
- package/dist/evaluation.ee/metric-scales.d.ts +4 -0
- package/dist/evaluation.ee/metric-scales.js +13 -0
- package/dist/evaluation.ee/metric-scales.js.map +1 -0
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.d.ts +5 -0
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js +40 -4
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js.map +1 -1
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.d.ts +6 -1
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.js +53 -4
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.js.map +1 -1
- package/dist/evaluation.ee/test-runs.controller.ee.d.ts +4 -2
- package/dist/evaluation.ee/test-runs.controller.ee.js +26 -6
- package/dist/evaluation.ee/test-runs.controller.ee.js.map +1 -1
- package/dist/eventbus/message-event-bus/message-event-bus.js.map +1 -1
- package/dist/events/maps/workflow-publication-metrics.event-map.d.ts +2 -0
- package/dist/events/relays/telemetry.event-relay.js +5 -0
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +1 -0
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/executions/execution-data/execution-data-json-store.d.ts +6 -4
- package/dist/executions/execution-data/execution-data-json-store.js +17 -5
- package/dist/executions/execution-data/execution-data-json-store.js.map +1 -1
- package/dist/executions/pre-execution-checks/credentials-permission-checker.d.ts +1 -0
- package/dist/executions/pre-execution-checks/credentials-permission-checker.js +17 -5
- package/dist/executions/pre-execution-checks/credentials-permission-checker.js.map +1 -1
- package/dist/external-hooks.d.ts +44 -10
- package/dist/external-hooks.js +13 -0
- package/dist/external-hooks.js.map +1 -1
- package/dist/license.d.ts +2 -0
- package/dist/license.js +13 -1
- package/dist/license.js.map +1 -1
- package/dist/metrics/prometheus/workflow-info-metrics.service.d.ts +4 -1
- package/dist/metrics/prometheus/workflow-info-metrics.service.js +27 -8
- package/dist/metrics/prometheus/workflow-info-metrics.service.js.map +1 -1
- package/dist/metrics/prometheus/workflow-publication-metrics.service.js +11 -1
- package/dist/metrics/prometheus/workflow-publication-metrics.service.js.map +1 -1
- package/dist/modules/agents/agent-chat.controller.js +10 -2
- package/dist/modules/agents/agent-chat.controller.js.map +1 -1
- package/dist/modules/agents/agent-config.service.js +1 -1
- package/dist/modules/agents/agent-config.service.js.map +1 -1
- package/dist/modules/agents/agent-execution-orchestrator.service.d.ts +7 -1
- package/dist/modules/agents/agent-execution-orchestrator.service.js +84 -43
- package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
- package/dist/modules/agents/agent-execution.service.d.ts +12 -1
- package/dist/modules/agents/agent-execution.service.js +82 -7
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-integration-persistence.service.js +2 -2
- package/dist/modules/agents/agent-integration-persistence.service.js.map +1 -1
- package/dist/modules/agents/agent-integrations.controller.js +4 -2
- package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-sandbox.service.js +5 -3
- package/dist/modules/agents/agent-knowledge-sandbox.service.js.map +1 -1
- package/dist/modules/agents/agent-knowledge.service.d.ts +0 -1
- package/dist/modules/agents/agent-knowledge.service.js +2 -9
- package/dist/modules/agents/agent-knowledge.service.js.map +1 -1
- package/dist/modules/agents/agent-model-catalog.service.js +1 -1
- package/dist/modules/agents/agent-model-catalog.service.js.map +1 -1
- package/dist/modules/agents/agent-publish.controller.js +2 -2
- package/dist/modules/agents/agent-publish.controller.js.map +1 -1
- package/dist/modules/agents/agent-publish.service.d.ts +7 -3
- package/dist/modules/agents/agent-publish.service.js +31 -8
- package/dist/modules/agents/agent-publish.service.js.map +1 -1
- package/dist/modules/agents/agent-run-tracing.service.d.ts +30 -0
- package/dist/modules/agents/agent-run-tracing.service.js +63 -0
- package/dist/modules/agents/agent-run-tracing.service.js.map +1 -0
- package/dist/modules/agents/agent-runtime-instrumentation.d.ts +26 -0
- package/dist/{blob-storage/types.js → modules/agents/agent-runtime-instrumentation.js} +1 -1
- package/dist/modules/agents/agent-runtime-instrumentation.js.map +1 -0
- package/dist/modules/agents/agent-runtime-reconstruction.service.d.ts +3 -1
- package/dist/modules/agents/agent-runtime-reconstruction.service.js +31 -8
- package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
- package/dist/modules/agents/agent-sse-stream.js +31 -6
- package/dist/modules/agents/agent-sse-stream.js.map +1 -1
- package/dist/modules/agents/agent-validation.service.d.ts +2 -1
- package/dist/modules/agents/agent-validation.service.js +21 -6
- package/dist/modules/agents/agent-validation.service.js.map +1 -1
- package/dist/modules/agents/agent-workflow-execution.service.d.ts +5 -3
- package/dist/modules/agents/agent-workflow-execution.service.js +31 -9
- package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
- package/dist/modules/agents/agents-tools.service.js +12 -0
- package/dist/modules/agents/agents-tools.service.js.map +1 -1
- package/dist/modules/agents/agents.module.js +13 -0
- package/dist/modules/agents/agents.module.js.map +1 -1
- package/dist/modules/agents/agents.service.d.ts +3 -1
- package/dist/modules/agents/agents.service.js +5 -2
- package/dist/modules/agents/agents.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-model-recommendations.js +6 -4
- package/dist/modules/agents/builder/agents-builder-model-recommendations.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-prompts.d.ts +5 -4
- package/dist/modules/agents/builder/agents-builder-prompts.js +109 -34
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +16 -2
- package/dist/modules/agents/builder/agents-builder-tools.service.js +201 -39
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder.service.js +7 -2
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
- package/dist/modules/agents/builder/builder-config-telemetry.d.ts +12 -0
- package/dist/modules/agents/builder/builder-config-telemetry.js +67 -0
- package/dist/modules/agents/builder/builder-config-telemetry.js.map +1 -0
- package/dist/modules/agents/builder/builder-tool-names.d.ts +2 -0
- package/dist/modules/agents/builder/builder-tool-names.js +2 -0
- package/dist/modules/agents/builder/builder-tool-names.js.map +1 -1
- package/dist/modules/agents/builder/interactive/ask-credential.tool.d.ts +3 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js +35 -7
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/ask-questions.tool.d.ts +4 -1
- package/dist/modules/agents/builder/interactive/ask-questions.tool.js +13 -1
- package/dist/modules/agents/builder/interactive/ask-questions.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/configure-channel.tool.d.ts +2 -0
- package/dist/modules/agents/builder/interactive/configure-channel.tool.js +7 -1
- package/dist/modules/agents/builder/interactive/configure-channel.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/finish-setup.tool.d.ts +17 -0
- package/dist/modules/agents/builder/interactive/finish-setup.tool.js +316 -0
- package/dist/modules/agents/builder/interactive/finish-setup.tool.js.map +1 -0
- package/dist/modules/agents/builder/interactive/index.d.ts +1 -0
- package/dist/modules/agents/builder/interactive/index.js +3 -1
- package/dist/modules/agents/builder/interactive/index.js.map +1 -1
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.d.ts +8 -0
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +87 -6
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +6 -5
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js +6 -5
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/initial-build.prompt.d.ts +2 -0
- package/dist/modules/agents/builder/prompts/initial-build.prompt.js +56 -0
- package/dist/modules/agents/builder/prompts/initial-build.prompt.js.map +1 -0
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +6 -3
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/memory.prompt.d.ts +1 -1
- package/dist/modules/agents/builder/prompts/memory.prompt.js +2 -2
- package/dist/modules/agents/builder/prompts/memory.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/planner-todos.prompt.d.ts +2 -0
- package/dist/modules/agents/builder/prompts/planner-todos.prompt.js +22 -0
- package/dist/modules/agents/builder/prompts/planner-todos.prompt.js.map +1 -0
- package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -1
- package/dist/modules/agents/builder/prompts/tools.prompt.js +12 -12
- package/dist/modules/agents/builder/resolve-integration.tool.js +1 -1
- package/dist/modules/agents/builder/resolve-integration.tool.js.map +1 -1
- package/dist/modules/agents/builder/skills/external-services.skill.d.ts +2 -0
- package/dist/modules/agents/builder/skills/external-services.skill.js +361 -0
- package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -0
- package/dist/modules/agents/builder/skills/index.js +2 -6
- package/dist/modules/agents/builder/skills/index.js.map +1 -1
- package/dist/modules/agents/builder/skills/memory.skill.js +2 -1
- package/dist/modules/agents/builder/skills/memory.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/resource-locators.skill.js +17 -3
- package/dist/modules/agents/builder/skills/resource-locators.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-skills.skill.js +12 -9
- package/dist/modules/agents/builder/skills/target-skills.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-tasks.skill.js +14 -10
- package/dist/modules/agents/builder/skills/target-tasks.skill.js.map +1 -1
- package/dist/modules/agents/builder/verify-mcp-server.tool.d.ts +4 -0
- package/dist/modules/agents/builder/verify-mcp-server.tool.js +30 -5
- package/dist/modules/agents/builder/verify-mcp-server.tool.js.map +1 -1
- package/dist/modules/agents/entities/agent-execution.entity.d.ts +2 -1
- package/dist/modules/agents/entities/agent-execution.entity.js +4 -0
- package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -1
- package/dist/modules/agents/execution-log/agent-execution-log-store.d.ts +17 -0
- package/dist/modules/agents/execution-log/agent-execution-log-store.js +58 -0
- package/dist/modules/agents/execution-log/agent-execution-log-store.js.map +1 -0
- package/dist/modules/agents/execution-log/agent-execution-log-write.error.d.ts +5 -0
- package/dist/modules/agents/execution-log/agent-execution-log-write.error.js +11 -0
- package/dist/modules/agents/execution-log/agent-execution-log-write.error.js.map +1 -0
- package/dist/modules/agents/execution-log/corrupted-agent-execution-log.error.d.ts +5 -0
- package/dist/modules/agents/execution-log/corrupted-agent-execution-log.error.js +11 -0
- package/dist/modules/agents/execution-log/corrupted-agent-execution-log.error.js.map +1 -0
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +1 -1
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +4 -2
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.js +8 -4
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.d.ts +4 -2
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.js +62 -6
- package/dist/modules/agents/integrations/agent-chat-stream-consumer.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-factory.d.ts +7 -7
- package/dist/modules/agents/integrations/integration-tool-factory.js +13 -10
- package/dist/modules/agents/integrations/integration-tool-factory.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-schema.d.ts +7 -7
- package/dist/modules/agents/integrations/integration-tool-schema.js +7 -7
- package/dist/modules/agents/integrations/integration-tool-schema.js.map +1 -1
- package/dist/modules/agents/integrations/slack-app-setup.service.js +2 -1
- package/dist/modules/agents/integrations/slack-app-setup.service.js.map +1 -1
- package/dist/modules/agents/json-config/from-json-config.d.ts +21 -0
- package/dist/modules/agents/json-config/from-json-config.js +16 -4
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
- package/dist/modules/agents/json-config/mcp-client-factory.d.ts +4 -0
- package/dist/modules/agents/json-config/mcp-client-factory.js +6 -1
- package/dist/modules/agents/json-config/mcp-client-factory.js.map +1 -1
- package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.js +14 -1
- package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.js.map +1 -1
- package/dist/modules/agents/{builder/interactive/llm-provider-defaults.d.ts → llm-provider-defaults.d.ts} +1 -0
- package/dist/modules/agents/{builder/interactive/llm-provider-defaults.js → llm-provider-defaults.js} +14 -1
- package/dist/modules/agents/llm-provider-defaults.js.map +1 -0
- package/dist/modules/agents/repositories/agent-execution.repository.d.ts +4 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js +31 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
- package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js +1 -0
- package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js.map +1 -1
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.d.ts +4 -1
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js +7 -1
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js.map +1 -1
- package/dist/modules/agents/tools/node-tool-factory.d.ts +2 -0
- package/dist/modules/agents/tools/node-tool-factory.js +8 -0
- package/dist/modules/agents/tools/node-tool-factory.js.map +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.d.ts +3 -1
- package/dist/modules/agents/tools/workflow-tool-factory.js +9 -3
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
- package/dist/modules/agents/utils/execution-to-message-mapper.js +4 -2
- package/dist/modules/agents/utils/execution-to-message-mapper.js.map +1 -1
- package/dist/modules/agents/utils/node-tool-validation.js +6 -0
- package/dist/modules/agents/utils/node-tool-validation.js.map +1 -1
- package/dist/modules/breaking-changes/rules/index.d.ts +3 -0
- package/dist/modules/breaking-changes/rules/index.js +3 -0
- package/dist/modules/breaking-changes/rules/index.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/chat-trigger-embedded-json.rule.d.ts +10 -0
- package/dist/modules/breaking-changes/rules/v3/chat-trigger-embedded-json.rule.js +58 -0
- package/dist/modules/breaking-changes/rules/v3/chat-trigger-embedded-json.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/removed-nodes-with-replacements.rule.d.ts +239 -0
- package/dist/modules/breaking-changes/rules/v3/removed-nodes-with-replacements.rule.js +445 -0
- package/dist/modules/breaking-changes/rules/v3/removed-nodes-with-replacements.rule.js.map +1 -0
- package/dist/modules/breaking-changes/rules/v3/removed-nodes.rule.d.ts +11 -0
- package/dist/modules/breaking-changes/rules/v3/removed-nodes.rule.js +61 -0
- package/dist/modules/breaking-changes/rules/v3/removed-nodes.rule.js.map +1 -0
- package/dist/modules/community-packages/installed-nodes.entity.js +1 -1
- package/dist/modules/community-packages/installed-nodes.entity.js.map +1 -1
- package/dist/modules/data-table/data-table-proxy.service.js +13 -0
- package/dist/modules/data-table/data-table-proxy.service.js.map +1 -1
- package/dist/modules/data-table/data-table.controller.js +1 -1
- package/dist/modules/data-table/data-table.controller.js.map +1 -1
- package/dist/modules/data-table/data-table.service.d.ts +1 -1
- package/dist/modules/data-table/data-table.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/database/repositories/dynamic-credential-user-entry.repository.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/agent-execution.service.d.ts +26 -0
- package/dist/modules/instance-ai/eval/agent-execution.service.js +508 -0
- package/dist/modules/instance-ai/eval/agent-execution.service.js.map +1 -0
- package/dist/modules/instance-ai/eval/agent-model-turn-recorder.d.ts +9 -0
- package/dist/modules/instance-ai/eval/agent-model-turn-recorder.js +110 -0
- package/dist/modules/instance-ai/eval/agent-model-turn-recorder.js.map +1 -0
- package/dist/modules/instance-ai/eval/agent-scenario-seed.d.ts +14 -0
- package/dist/modules/instance-ai/eval/agent-scenario-seed.js +98 -0
- package/dist/modules/instance-ai/eval/agent-scenario-seed.js.map +1 -0
- package/dist/modules/instance-ai/eval/execution.service.js +3 -3
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/mcp-mock-fetch.d.ts +28 -0
- package/dist/modules/instance-ai/eval/mcp-mock-fetch.js +265 -0
- package/dist/modules/instance-ai/eval/mcp-mock-fetch.js.map +1 -0
- package/dist/modules/instance-ai/eval/mock-utils.d.ts +4 -0
- package/dist/modules/instance-ai/eval/mock-utils.js +41 -0
- package/dist/modules/instance-ai/eval/mock-utils.js.map +1 -0
- package/dist/modules/instance-ai/eval/request-sanitizer.d.ts +1 -0
- package/dist/modules/instance-ai/eval/request-sanitizer.js +26 -0
- package/dist/modules/instance-ai/eval/request-sanitizer.js.map +1 -1
- package/dist/modules/instance-ai/eval/web-search-mock.d.ts +26 -0
- package/dist/modules/instance-ai/eval/web-search-mock.js +122 -0
- package/dist/modules/instance-ai/eval/web-search-mock.js.map +1 -0
- package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.d.ts +8 -0
- package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js +85 -11
- package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-error-reporter.service.js +13 -0
- package/dist/modules/instance-ai/instance-ai-error-reporter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +3 -3
- package/dist/modules/instance-ai/instance-ai-memory.service.js +5 -11
- package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +42 -14
- package/dist/modules/instance-ai/instance-ai-settings.service.js +650 -174
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-test.controller.js +4 -1
- package/dist/modules/instance-ai/instance-ai-test.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +2 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +26 -2
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +14 -6
- package/dist/modules/instance-ai/instance-ai.controller.js +84 -29
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.js +9 -2
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +10 -1
- package/dist/modules/instance-ai/instance-ai.service.js +146 -45
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.d.ts +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js +6 -5
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js.map +1 -1
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.d.ts +6 -2
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js +55 -14
- package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js.map +1 -1
- package/dist/modules/mcp/mcp-protected-resource.d.ts +1 -0
- package/dist/modules/mcp/mcp-protected-resource.js +4 -0
- package/dist/modules/mcp/mcp-protected-resource.js.map +1 -1
- package/dist/modules/mcp/mcp-server-middleware.service.js +2 -1
- package/dist/modules/mcp/mcp-server-middleware.service.js.map +1 -1
- package/dist/modules/mcp/mcp.controller.d.ts +3 -1
- package/dist/modules/mcp/mcp.controller.js +15 -11
- package/dist/modules/mcp/mcp.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +7 -2
- package/dist/modules/mcp/mcp.service.js +63 -43
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +1 -0
- package/dist/modules/mcp/tools/execution-utils.d.ts +3 -1
- package/dist/modules/mcp/tools/execution-utils.js +6 -4
- package/dist/modules/mcp/tools/execution-utils.js.map +1 -1
- package/dist/modules/mcp/tools/get-workflow-details.tool.d.ts +3 -2
- package/dist/modules/mcp/tools/get-workflow-details.tool.js +6 -6
- package/dist/modules/mcp/tools/get-workflow-details.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-workflow-version.tool.d.ts +3 -2
- package/dist/modules/mcp/tools/get-workflow-version.tool.js +1 -1
- package/dist/modules/mcp/tools/get-workflow-version.tool.js.map +1 -1
- package/dist/modules/mcp/tools/schemas.d.ts +34 -32
- package/dist/modules/mcp/tools/schemas.js +14 -2
- package/dist/modules/mcp/tools/schemas.js.map +1 -1
- package/dist/modules/mcp/tools/test-workflow.tool.d.ts +4 -1
- package/dist/modules/mcp/tools/test-workflow.tool.js +13 -5
- package/dist/modules/mcp/tools/test-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/webhook-utils.d.ts +3 -3
- package/dist/modules/mcp/tools/webhook-utils.js +17 -6
- package/dist/modules/mcp/tools/webhook-utils.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.d.ts +4 -1
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +5 -1
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.d.ts +3 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js +16 -3
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.d.ts +5 -2
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js +17 -10
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.d.ts +6 -1
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +8 -2
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.d.ts +4 -2
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js +8 -1
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +280 -2
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +54 -17
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.d.ts +4 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +58 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.d.ts +51 -5
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +414 -233
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
- package/dist/modules/mcp-registry/mcp-registry-test.controller.js +2 -2
- package/dist/modules/mcp-registry/mcp-registry-test.controller.js.map +1 -1
- package/dist/modules/mcp-registry/mcp-registry.module.js +1 -1
- package/dist/modules/mcp-registry/mcp-registry.module.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-orchestrator.d.ts +11 -1
- package/dist/modules/n8n-packages/engine/import-orchestrator.js +36 -7
- package/dist/modules/n8n-packages/engine/import-orchestrator.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-result.d.ts +3 -2
- package/dist/modules/n8n-packages/engine/import-result.js +2 -1
- package/dist/modules/n8n-packages/engine/import-result.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-telemetry.d.ts +2 -0
- package/dist/modules/n8n-packages/engine/import-telemetry.js +11 -0
- package/dist/modules/n8n-packages/engine/import-telemetry.js.map +1 -1
- package/dist/modules/n8n-packages/engine/project-package-importer.js +11 -0
- package/dist/modules/n8n-packages/engine/project-package-importer.js.map +1 -1
- package/dist/modules/n8n-packages/engine/workflow-package-importer.js +10 -1
- package/dist/modules/n8n-packages/engine/workflow-package-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/requirements.types.d.ts +2 -0
- package/dist/modules/n8n-packages/entities/requirements.types.js +1 -0
- package/dist/modules/n8n-packages/entities/requirements.types.js.map +1 -1
- package/dist/modules/n8n-packages/entities/variable/variable-importer.d.ts +9 -0
- package/dist/modules/n8n-packages/entities/variable/variable-importer.js +55 -0
- package/dist/modules/n8n-packages/entities/variable/variable-importer.js.map +1 -0
- package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.d.ts +3 -0
- package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.js +12 -0
- package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.js.map +1 -0
- package/dist/modules/n8n-packages/entities/variable/variable.types.d.ts +14 -0
- package/dist/modules/n8n-packages/entities/variable/variable.types.js +7 -0
- package/dist/modules/n8n-packages/entities/variable/variable.types.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow-resolver.d.ts +37 -0
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow-resolver.js +165 -0
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow-resolver.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.d.ts +39 -0
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.js +198 -0
- package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/missing-node-type-mode.d.ts +7 -0
- package/dist/modules/n8n-packages/entities/workflow/missing-node-type-mode.js +30 -0
- package/dist/modules/n8n-packages/entities/workflow/missing-node-type-mode.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/node-type-usage.d.ts +11 -0
- package/dist/modules/n8n-packages/entities/workflow/node-type-usage.js +27 -0
- package/dist/modules/n8n-packages/entities/workflow/node-type-usage.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/static-sub-workflow-id.d.ts +2 -0
- package/dist/modules/n8n-packages/entities/workflow/static-sub-workflow-id.js +23 -0
- package/dist/modules/n8n-packages/entities/workflow/static-sub-workflow-id.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-import.types.d.ts +2 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.d.ts +2 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js +5 -4
- package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-publishing-policy.types.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-requirements.extractor.js +2 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-requirements.extractor.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +3 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/io/unique-filename-allocator.d.ts +1 -0
- package/dist/modules/n8n-packages/io/unique-filename-allocator.js +9 -0
- package/dist/modules/n8n-packages/io/unique-filename-allocator.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.service.d.ts +8 -4
- package/dist/modules/n8n-packages/n8n-packages.service.js +81 -36
- package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +40 -3
- package/dist/modules/n8n-packages/n8n-packages.types.js +9 -1
- package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
- package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +51 -0
- package/dist/modules/n8n-packages/spec/requirements.schema.d.ts +45 -0
- package/dist/modules/n8n-packages/spec/requirements.schema.js +10 -1
- package/dist/modules/n8n-packages/spec/requirements.schema.js.map +1 -1
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +1 -1
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +1 -1
- package/dist/modules/oauth-server/database/repositories/oauth-access-token.repository.d.ts +10 -2
- package/dist/modules/oauth-server/database/repositories/oauth-access-token.repository.js +5 -1
- package/dist/modules/oauth-server/database/repositories/oauth-access-token.repository.js.map +1 -1
- package/dist/modules/oauth-server/database/repositories/oauth-refresh-token.repository.d.ts +14 -2
- package/dist/modules/oauth-server/database/repositories/oauth-refresh-token.repository.js +16 -1
- package/dist/modules/oauth-server/database/repositories/oauth-refresh-token.repository.js.map +1 -1
- package/dist/modules/oauth-server/oauth-token.service.d.ts +3 -2
- package/dist/modules/oauth-server/oauth-token.service.js +13 -33
- package/dist/modules/oauth-server/oauth-token.service.js.map +1 -1
- package/dist/modules/oauth-server/oauth.controller.d.ts +3 -0
- package/dist/modules/oauth-server/oauth.controller.js +45 -1
- package/dist/modules/oauth-server/oauth.controller.js.map +1 -1
- package/dist/modules/oauth-server/oauth.helpers.d.ts +1 -0
- package/dist/modules/oauth-server/oauth.helpers.js +7 -0
- package/dist/modules/oauth-server/oauth.helpers.js.map +1 -1
- package/dist/modules/otel/otel-settings.controller.d.ts +2 -2
- package/dist/modules/otel/otel-settings.controller.js +1 -1
- package/dist/modules/otel/otel-settings.controller.js.map +1 -1
- package/dist/modules/redaction/redaction-context-hook.js +4 -2
- package/dist/modules/redaction/redaction-context-hook.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-export.service.ee.js +3 -3
- package/dist/modules/source-control.ee/source-control-export.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +1 -0
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +51 -22
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-scoped.service.js +1 -1
- package/dist/modules/source-control.ee/source-control-scoped.service.js.map +1 -1
- package/dist/modules/source-control.ee/types/exportable-credential.d.ts +2 -0
- package/dist/modules/workflow-index/workflow-dependency-query.service.js +1 -1
- package/dist/modules/workflow-index/workflow-dependency-query.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.d.ts +44 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js +373 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.d.ts +14 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.js +97 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-reviews.module.d.ts +4 -0
- package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js +24 -0
- package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js.map +1 -0
- package/dist/node-execution/ephemeral-node-executor.d.ts +5 -1
- package/dist/node-execution/ephemeral-node-executor.js +7 -4
- package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
- package/dist/node-execution/index.d.ts +1 -0
- package/dist/node-execution/index.js +4 -1
- package/dist/node-execution/index.js.map +1 -1
- package/dist/node-execution/node-tool-operation-support.d.ts +2 -0
- package/dist/node-execution/node-tool-operation-support.js +12 -0
- package/dist/node-execution/node-tool-operation-support.js.map +1 -0
- package/dist/node-types.d.ts +5 -1
- package/dist/node-types.js +53 -20
- package/dist/node-types.js.map +1 -1
- package/dist/oauth/oauth.service.d.ts +5 -1
- package/dist/oauth/oauth.service.js +57 -28
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/permissions.ee/check-access.js +18 -0
- package/dist/permissions.ee/check-access.js.map +1 -1
- package/dist/posthog/index.js +6 -0
- package/dist/posthog/index.js.map +1 -1
- package/dist/public-api/index.d.ts +1 -1
- package/dist/public-api/index.js +40 -11
- package/dist/public-api/index.js.map +1 -1
- package/dist/public-api/types.d.ts +7 -1
- package/dist/public-api/v1/controllers/index.d.ts +2 -0
- package/dist/public-api/v1/controllers/index.js +5 -0
- package/dist/public-api/v1/controllers/index.js.map +1 -0
- package/dist/public-api/v1/controllers/workflows.public.controller.d.ts +9 -0
- package/dist/public-api/v1/controllers/workflows.public.controller.js +81 -0
- package/dist/public-api/v1/controllers/workflows.public.controller.js.map +1 -0
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js +1 -0
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.service.d.ts +1 -0
- package/dist/public-api/v1/handlers/credentials/credentials.service.js +9 -2
- package/dist/public-api/v1/handlers/credentials/credentials.service.js.map +1 -1
- package/dist/public-api/v1/handlers/discover/discover.service.d.ts +1 -0
- package/dist/public-api/v1/handlers/discover/discover.service.js +39 -34
- package/dist/public-api/v1/handlers/discover/discover.service.js.map +1 -1
- 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 +8 -3
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/otel/otel.handler.d.ts +9 -0
- package/dist/public-api/v1/handlers/otel/otel.handler.js +57 -0
- package/dist/public-api/v1/handlers/otel/otel.handler.js.map +1 -0
- package/dist/public-api/v1/handlers/otel/otel.mapper.d.ts +3 -0
- package/dist/public-api/v1/handlers/otel/otel.mapper.js +18 -0
- package/dist/public-api/v1/handlers/otel/otel.mapper.js.map +1 -0
- package/dist/public-api/v1/handlers/tags/tags.handler.d.ts +0 -1
- package/dist/public-api/v1/handlers/tags/tags.handler.js +0 -8
- package/dist/public-api/v1/handlers/tags/tags.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/users/users.service.ee.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.handler.d.ts +2 -0
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js +47 -34
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.service.js +6 -0
- package/dist/public-api/v1/handlers/workflows/workflows.service.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +491 -19
- package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +4 -0
- package/dist/public-api/v1/shared/middlewares/global.middleware.js +9 -1
- package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
- package/dist/public-api/v1/shared/public-api-scope-lookup.d.ts +5 -0
- package/dist/public-api/v1/shared/public-api-scope-lookup.js +60 -0
- package/dist/public-api/v1/shared/public-api-scope-lookup.js.map +1 -0
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +1 -0
- package/dist/scaling/pubsub/pubsub.types.d.ts +2 -1
- package/dist/scheduling/durable-job-provisioner.d.ts +1 -0
- package/dist/scheduling/durable-job-provisioner.js +2 -0
- package/dist/scheduling/durable-job-provisioner.js.map +1 -1
- package/dist/scheduling/durable-scheduler.d.ts +2 -1
- package/dist/scheduling/durable-scheduler.js +4 -2
- package/dist/scheduling/durable-scheduler.js.map +1 -1
- package/dist/scheduling/poll-trigger-node/poll-job-provider.d.ts +11 -0
- package/dist/scheduling/poll-trigger-node/poll-job-provider.js +41 -0
- package/dist/scheduling/poll-trigger-node/poll-job-provider.js.map +1 -0
- package/dist/scheduling/poll-trigger-node/poll-trigger-job-registrar.d.ts +19 -0
- package/dist/scheduling/poll-trigger-node/poll-trigger-job-registrar.js +111 -0
- package/dist/scheduling/poll-trigger-node/poll-trigger-job-registrar.js.map +1 -0
- package/dist/scheduling/poll-trigger-node/poll-trigger-task-handler.d.ts +16 -0
- package/dist/scheduling/poll-trigger-node/poll-trigger-task-handler.js +100 -0
- package/dist/scheduling/poll-trigger-node/poll-trigger-task-handler.js.map +1 -0
- package/dist/scheduling/poll-trigger-node/poll-trigger-task.d.ts +6 -0
- package/dist/scheduling/poll-trigger-node/poll-trigger-task.js +8 -0
- package/dist/scheduling/poll-trigger-node/poll-trigger-task.js.map +1 -0
- package/dist/scheduling/schedule-trigger-node/schedule-trigger-job-registrar.d.ts +1 -0
- package/dist/scheduling/schedule-trigger-node/schedule-trigger-job-registrar.js +7 -1
- package/dist/scheduling/schedule-trigger-node/schedule-trigger-job-registrar.js.map +1 -1
- package/dist/security-audit/risk-reporters/credentials-risk-reporter.d.ts +4 -6
- package/dist/security-audit/risk-reporters/credentials-risk-reporter.js +17 -23
- package/dist/security-audit/risk-reporters/credentials-risk-reporter.js.map +1 -1
- package/dist/security-audit/security-audit.repository.js.map +1 -1
- package/dist/services/export.service.js.map +1 -1
- package/dist/services/folder-finder.service.d.ts +1 -0
- package/dist/services/folder-finder.service.js +30 -0
- package/dist/services/folder-finder.service.js.map +1 -1
- package/dist/services/folder.service.js.map +1 -1
- package/dist/services/free-ai-credits.service.d.ts +32 -0
- package/dist/services/free-ai-credits.service.js +55 -0
- package/dist/services/free-ai-credits.service.js.map +1 -0
- package/dist/services/frontend.service.js +2 -0
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/hooks.service.js.map +1 -1
- package/dist/services/import.service.js +3 -1
- package/dist/services/import.service.js.map +1 -1
- package/dist/services/ownership-transfer/ownership-transfer-handler.registry.js.map +1 -1
- package/dist/services/ownership-transfer/ownership-transfer.manifest.json +5 -0
- package/dist/services/project.service.ee.d.ts +1 -0
- package/dist/services/project.service.ee.js +6 -1
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/public-api-key.service.js.map +1 -1
- package/dist/services/role.service.d.ts +2 -1
- package/dist/services/role.service.js +21 -3
- package/dist/services/role.service.js.map +1 -1
- package/dist/services/tag.service.js.map +1 -1
- package/dist/telemetry/index.d.ts +3 -2
- package/dist/telemetry/index.js +7 -1
- package/dist/telemetry/index.js.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +4 -0
- package/dist/utils.js.map +1 -1
- package/dist/webhooks/live-webhooks.js +1 -1
- package/dist/webhooks/live-webhooks.js.map +1 -1
- package/dist/webhooks/waiting-forms.js +2 -7
- package/dist/webhooks/waiting-forms.js.map +1 -1
- package/dist/webhooks/waiting-webhooks.d.ts +7 -2
- package/dist/webhooks/waiting-webhooks.js +32 -2
- package/dist/webhooks/waiting-webhooks.js.map +1 -1
- package/dist/workflow-helpers.js +8 -62
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-hook-context.service.d.ts +4 -1
- package/dist/workflow-hook-context.service.js +14 -2
- package/dist/workflow-hook-context.service.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-reconciler.service.d.ts +10 -3
- package/dist/workflows/publication/workflow-publication-reconciler.service.js +49 -13
- package/dist/workflows/publication/workflow-publication-reconciler.service.js.map +1 -1
- package/dist/workflows/triggers/non-webhook-trigger-registrar.d.ts +3 -1
- package/dist/workflows/triggers/non-webhook-trigger-registrar.js +5 -2
- package/dist/workflows/triggers/non-webhook-trigger-registrar.js.map +1 -1
- package/dist/workflows/triggers/trigger-execution-context.factory.d.ts +13 -4
- package/dist/workflows/triggers/trigger-execution-context.factory.js +62 -4
- package/dist/workflows/triggers/trigger-execution-context.factory.js.map +1 -1
- package/dist/workflows/workflow-creation.service.d.ts +3 -1
- package/dist/workflows/workflow-creation.service.js +14 -4
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow-finder.service.js +1 -0
- package/dist/workflows/workflow-finder.service.js.map +1 -1
- package/dist/workflows/workflow-history/workflow-history.service.js.map +1 -1
- package/dist/workflows/workflow-sharing.service.js.map +1 -1
- package/dist/workflows/workflow-validation.service.js +1 -1
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +7 -2
- package/dist/workflows/workflow.service.ee.js +1 -0
- package/dist/workflows/workflow.service.ee.js.map +1 -1
- package/dist/workflows/workflow.service.js +70 -15
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.js.map +1 -1
- package/package.json +34 -33
- package/dist/blob-storage/azure-byte-store.ee.d.ts +0 -10
- package/dist/blob-storage/azure-byte-store.ee.js +0 -42
- package/dist/blob-storage/azure-byte-store.ee.js.map +0 -1
- package/dist/blob-storage/fs-byte-store.d.ts +0 -14
- package/dist/blob-storage/fs-byte-store.js +0 -96
- package/dist/blob-storage/fs-byte-store.js.map +0 -1
- package/dist/blob-storage/json-store.d.ts +0 -18
- package/dist/blob-storage/json-store.js +0 -128
- package/dist/blob-storage/json-store.js.map +0 -1
- package/dist/blob-storage/s3-byte-store.ee.d.ts +0 -10
- package/dist/blob-storage/s3-byte-store.ee.js +0 -37
- package/dist/blob-storage/s3-byte-store.ee.js.map +0 -1
- package/dist/blob-storage/skipped-entry-deletion.error.d.ts +0 -5
- package/dist/blob-storage/skipped-entry-deletion.error.js +0 -13
- package/dist/blob-storage/skipped-entry-deletion.error.js.map +0 -1
- package/dist/blob-storage/types.d.ts +0 -23
- package/dist/blob-storage/types.js.map +0 -1
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.js.map +0 -1
- package/dist/modules/agents/builder/skills/integrations.skill.d.ts +0 -2
- package/dist/modules/agents/builder/skills/integrations.skill.js +0 -128
- package/dist/modules/agents/builder/skills/integrations.skill.js.map +0 -1
- package/dist/modules/agents/builder/skills/mcp.skill.d.ts +0 -2
- package/dist/modules/agents/builder/skills/mcp.skill.js +0 -172
- package/dist/modules/agents/builder/skills/mcp.skill.js.map +0 -1
- package/dist/modules/agents/builder/skills/node-tools.skill.d.ts +0 -2
- package/dist/modules/agents/builder/skills/node-tools.skill.js +0 -90
- package/dist/modules/agents/builder/skills/node-tools.skill.js.map +0 -1
|
@@ -10,26 +10,43 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
var InstanceAiSettingsService_1;
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.InstanceAiSettingsService = void 0;
|
|
13
|
+
exports.InstanceAiSettingsService = exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY = exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY = exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY = exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY = void 0;
|
|
14
|
+
const node_util_1 = require("node:util");
|
|
14
15
|
const api_types_1 = require("@n8n/api-types");
|
|
15
16
|
const backend_common_1 = require("@n8n/backend-common");
|
|
16
17
|
const config_1 = require("@n8n/config");
|
|
17
18
|
const db_1 = require("@n8n/db");
|
|
18
19
|
const di_1 = require("@n8n/di");
|
|
20
|
+
const permissions_1 = require("@n8n/permissions");
|
|
21
|
+
const ensure_error_1 = require("@n8n/utils/errors/ensure-error");
|
|
19
22
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
20
23
|
const credentials_finder_service_1 = require("../../credentials/credentials-finder.service");
|
|
21
24
|
const credentials_service_1 = require("../../credentials/credentials.service");
|
|
25
|
+
const instance_credential_broker_1 = require("../../credentials/instance-credential-broker");
|
|
26
|
+
const conflict_error_1 = require("../../errors/response-errors/conflict.error");
|
|
27
|
+
const forbidden_error_1 = require("../../errors/response-errors/forbidden.error");
|
|
22
28
|
const unprocessable_error_1 = require("../../errors/response-errors/unprocessable.error");
|
|
23
29
|
const event_service_1 = require("../../events/event.service");
|
|
24
30
|
const ai_service_1 = require("../../services/ai.service");
|
|
25
31
|
const user_service_1 = require("../../services/user.service");
|
|
26
32
|
const sandbox_provider_1 = require("./sandbox-provider");
|
|
27
33
|
const ADMIN_SETTINGS_KEY = 'instanceAi.settings';
|
|
34
|
+
const N8N_SANDBOX_HEADER_NAME = 'x-api-key';
|
|
35
|
+
const MODEL_PROVIDER_API_KEY_ENV = new Map([
|
|
36
|
+
['anthropic', 'ANTHROPIC_API_KEY'],
|
|
37
|
+
['cohere', 'COHERE_API_KEY'],
|
|
38
|
+
['deepseek', 'DEEPSEEK_API_KEY'],
|
|
39
|
+
['google', 'GOOGLE_GENERATIVE_AI_API_KEY'],
|
|
40
|
+
['groq', 'GROQ_API_KEY'],
|
|
41
|
+
['mistral', 'MISTRAL_API_KEY'],
|
|
42
|
+
['openai', 'OPENAI_API_KEY'],
|
|
43
|
+
['openrouter', 'OPENROUTER_API_KEY'],
|
|
44
|
+
['xai', 'XAI_API_KEY'],
|
|
45
|
+
]);
|
|
28
46
|
const CREDENTIAL_TO_MODEL_PROVIDER = {
|
|
29
47
|
openAiApi: 'openai',
|
|
30
48
|
anthropicApi: 'anthropic',
|
|
31
49
|
googlePalmApi: 'google',
|
|
32
|
-
ollamaApi: 'ollama',
|
|
33
50
|
groqApi: 'groq',
|
|
34
51
|
deepSeekApi: 'deepseek',
|
|
35
52
|
mistralCloudApi: 'mistral',
|
|
@@ -37,33 +54,130 @@ const CREDENTIAL_TO_MODEL_PROVIDER = {
|
|
|
37
54
|
openRouterApi: 'openrouter',
|
|
38
55
|
cohereApi: 'cohere',
|
|
39
56
|
};
|
|
40
|
-
const SUPPORTED_CREDENTIAL_TYPES = Object.keys(CREDENTIAL_TO_MODEL_PROVIDER);
|
|
41
57
|
const URL_FIELD_MAP = {
|
|
42
58
|
openAiApi: 'url',
|
|
43
59
|
anthropicApi: 'url',
|
|
44
60
|
googlePalmApi: 'host',
|
|
45
|
-
ollamaApi: 'baseUrl',
|
|
46
61
|
};
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
62
|
+
function requireConnectionValue(type, data, field) {
|
|
63
|
+
const value = data[field];
|
|
64
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
65
|
+
throw new unprocessable_error_1.UnprocessableRequestError(`The field "${field}" is required for provider connection type "${type}"`);
|
|
66
|
+
}
|
|
67
|
+
return value.trim();
|
|
68
|
+
}
|
|
69
|
+
function requireHttpUrl(type, data, field) {
|
|
70
|
+
const value = requireConnectionValue(type, data, field);
|
|
71
|
+
try {
|
|
72
|
+
const url = new URL(value);
|
|
73
|
+
if (url.protocol === 'http:' || url.protocol === 'https:')
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
catch { }
|
|
77
|
+
throw new unprocessable_error_1.UnprocessableRequestError(`The field "${field}" must be a valid HTTP URL for provider connection type "${type}"`);
|
|
78
|
+
}
|
|
79
|
+
function validateModelCredential({ type, data, }) {
|
|
80
|
+
const apiKey = data.apiKey;
|
|
81
|
+
if (typeof apiKey === 'string' && apiKey.trim().length > 0)
|
|
82
|
+
return;
|
|
83
|
+
const urlField = URL_FIELD_MAP[type];
|
|
84
|
+
const url = urlField === undefined ? undefined : data[urlField];
|
|
85
|
+
if (typeof url === 'string' && url.trim().length > 0)
|
|
86
|
+
return;
|
|
87
|
+
throw new unprocessable_error_1.UnprocessableRequestError(urlField === undefined
|
|
88
|
+
? `The field "apiKey" is required for provider connection type "${type}"`
|
|
89
|
+
: `The field "apiKey" or "${urlField}" is required for provider connection type "${type}"`);
|
|
90
|
+
}
|
|
91
|
+
function modelCredentialHeaders(credentialType, data) {
|
|
92
|
+
const headers = {};
|
|
93
|
+
if (credentialType === 'openAiApi' && typeof data.organizationId === 'string') {
|
|
94
|
+
const organizationId = data.organizationId.trim();
|
|
95
|
+
if (organizationId)
|
|
96
|
+
headers['OpenAI-Organization'] = organizationId;
|
|
97
|
+
}
|
|
98
|
+
if ((credentialType === 'openAiApi' || credentialType === 'anthropicApi') &&
|
|
99
|
+
data.header === true &&
|
|
100
|
+
typeof data.headerName === 'string' &&
|
|
101
|
+
typeof data.headerValue === 'string') {
|
|
102
|
+
const headerName = data.headerName.trim();
|
|
103
|
+
if (headerName)
|
|
104
|
+
headers[headerName] = data.headerValue;
|
|
105
|
+
}
|
|
106
|
+
return Object.keys(headers).length ? headers : undefined;
|
|
107
|
+
}
|
|
108
|
+
function validateSandboxServiceCredential({ type, data, }) {
|
|
109
|
+
const headerName = requireConnectionValue(type, data, 'name').toLowerCase();
|
|
110
|
+
if (headerName !== N8N_SANDBOX_HEADER_NAME) {
|
|
111
|
+
throw new unprocessable_error_1.UnprocessableRequestError(`The credential's header name must be "${N8N_SANDBOX_HEADER_NAME}" but is "${headerName}"`);
|
|
112
|
+
}
|
|
113
|
+
requireConnectionValue(type, data, 'value');
|
|
114
|
+
}
|
|
115
|
+
function validateDaytonaCredential({ type, data, }) {
|
|
116
|
+
requireHttpUrl(type, data, 'apiUrl');
|
|
117
|
+
requireConnectionValue(type, data, 'apiKey');
|
|
118
|
+
}
|
|
119
|
+
function validateSearchCredential({ type, data, }) {
|
|
120
|
+
if (type === 'searXngApi')
|
|
121
|
+
requireHttpUrl(type, data, 'apiUrl');
|
|
122
|
+
else
|
|
123
|
+
requireConnectionValue(type, data, 'apiKey');
|
|
124
|
+
}
|
|
125
|
+
exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY = {
|
|
126
|
+
id: 'instance-ai:model',
|
|
127
|
+
credentialTypes: api_types_1.INSTANCE_AI_MODEL_CREDENTIAL_TYPES,
|
|
128
|
+
validate: validateModelCredential,
|
|
129
|
+
};
|
|
130
|
+
exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY = {
|
|
131
|
+
id: 'instance-ai:sandbox:daytona',
|
|
132
|
+
credentialTypes: ['daytonaApi'],
|
|
133
|
+
validate: validateDaytonaCredential,
|
|
134
|
+
};
|
|
135
|
+
exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY = {
|
|
136
|
+
id: 'instance-ai:sandbox:n8n',
|
|
137
|
+
credentialTypes: ['httpHeaderAuth'],
|
|
138
|
+
validate: validateSandboxServiceCredential,
|
|
139
|
+
};
|
|
140
|
+
exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY = {
|
|
141
|
+
id: 'instance-ai:search',
|
|
142
|
+
credentialTypes: api_types_1.INSTANCE_AI_SEARCH_CREDENTIAL_TYPES,
|
|
143
|
+
validate: validateSearchCredential,
|
|
144
|
+
};
|
|
145
|
+
function validateInstanceAiCredential(policy, credential) {
|
|
146
|
+
if (policy === exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY) {
|
|
147
|
+
validateModelCredential(credential);
|
|
148
|
+
}
|
|
149
|
+
else if (policy === exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY) {
|
|
150
|
+
validateDaytonaCredential(credential);
|
|
151
|
+
}
|
|
152
|
+
else if (policy === exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY) {
|
|
153
|
+
validateSandboxServiceCredential(credential);
|
|
154
|
+
}
|
|
155
|
+
else if (policy === exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY) {
|
|
156
|
+
validateSearchCredential(credential);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
throw new n8n_workflow_1.UnexpectedError(`Unknown instance AI credential policy "${policy.id}"`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
50
162
|
let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSettingsService {
|
|
51
|
-
constructor(globalConfig, settingsRepository, userRepository, userService, aiService, credentialsService, credentialsFinderService, eventService) {
|
|
163
|
+
constructor(globalConfig, dbLockService, settingsRepository, userRepository, userService, aiService, credentialsService, credentialsFinderService, instanceCredentialBroker, eventService) {
|
|
164
|
+
this.dbLockService = dbLockService;
|
|
52
165
|
this.settingsRepository = settingsRepository;
|
|
53
166
|
this.userRepository = userRepository;
|
|
54
167
|
this.userService = userService;
|
|
55
168
|
this.aiService = aiService;
|
|
56
169
|
this.credentialsService = credentialsService;
|
|
57
170
|
this.credentialsFinderService = credentialsFinderService;
|
|
171
|
+
this.instanceCredentialBroker = instanceCredentialBroker;
|
|
58
172
|
this.eventService = eventService;
|
|
59
173
|
this.enabled = true;
|
|
60
174
|
this.mcpAccessEnabled = true;
|
|
61
175
|
this.permissions = { ...api_types_1.DEFAULT_INSTANCE_AI_PERMISSIONS };
|
|
62
|
-
this.
|
|
63
|
-
this.adminN8nSandboxCredentialId = null;
|
|
64
|
-
this.adminSearchCredentialId = null;
|
|
176
|
+
this.adminModelName = null;
|
|
65
177
|
this.config = globalConfig.instanceAi;
|
|
66
178
|
this.deploymentConfig = globalConfig.deployment;
|
|
179
|
+
this.environmentSandboxProvider = (0, sandbox_provider_1.normalizeSandboxProvider)(this.config.sandboxProvider);
|
|
180
|
+
this.config.sandboxProvider = this.environmentSandboxProvider;
|
|
67
181
|
}
|
|
68
182
|
get isCloud() {
|
|
69
183
|
return this.deploymentConfig.type === 'cloud';
|
|
@@ -77,13 +191,7 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
77
191
|
sandboxEnabled: this.config.sandboxEnabled,
|
|
78
192
|
sandboxProvider: this.config.sandboxProvider,
|
|
79
193
|
};
|
|
80
|
-
|
|
81
|
-
if (row) {
|
|
82
|
-
const persisted = (0, n8n_workflow_1.jsonParse)(row.value, {
|
|
83
|
-
fallbackValue: {},
|
|
84
|
-
});
|
|
85
|
-
this.applyAdminSettings(persisted);
|
|
86
|
-
}
|
|
194
|
+
await this.reloadFromDb();
|
|
87
195
|
const c = this.config;
|
|
88
196
|
const overridden = c.sandboxEnabled !== envSnapshot.sandboxEnabled ||
|
|
89
197
|
c.sandboxProvider !== envSnapshot.sandboxProvider;
|
|
@@ -97,62 +205,334 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
97
205
|
logger.warn(`Sandbox unavailable: ${sandboxStatus.unavailableReason}`);
|
|
98
206
|
}
|
|
99
207
|
}
|
|
100
|
-
getAdminSettings() {
|
|
208
|
+
async getAdminSettings() {
|
|
209
|
+
const isManaged = this.isCloud || this.aiService.isProxyEnabled();
|
|
210
|
+
if (isManaged) {
|
|
211
|
+
return this.buildAdminSettingsResponse({
|
|
212
|
+
modelCredentialId: null,
|
|
213
|
+
modelName: null,
|
|
214
|
+
daytonaCredentialId: null,
|
|
215
|
+
n8nSandboxCredentialId: null,
|
|
216
|
+
searchCredentialId: null,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
const [modelSelection, daytonaCredentialId, n8nSandboxCredentialId, searchCredentialId] = await Promise.all([
|
|
220
|
+
this.readAdminModelSelection(),
|
|
221
|
+
this.instanceCredentialBroker.getAssignedCredentialId(exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY),
|
|
222
|
+
this.instanceCredentialBroker.getAssignedCredentialId(exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY),
|
|
223
|
+
this.instanceCredentialBroker.getAssignedCredentialId(exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY),
|
|
224
|
+
]);
|
|
225
|
+
return this.buildAdminSettingsResponse({
|
|
226
|
+
...modelSelection,
|
|
227
|
+
daytonaCredentialId,
|
|
228
|
+
n8nSandboxCredentialId,
|
|
229
|
+
searchCredentialId,
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
buildAdminSettingsResponse(credentialSelection) {
|
|
101
233
|
const c = this.config;
|
|
234
|
+
const modelProviderApiKeyEnv = MODEL_PROVIDER_API_KEY_ENV.get(c.model.split('/', 1)[0] ?? '');
|
|
235
|
+
const isManaged = this.isCloud || this.aiService.isProxyEnabled();
|
|
102
236
|
return {
|
|
103
237
|
enabled: this.enabled,
|
|
104
238
|
permissions: { ...this.permissions },
|
|
105
|
-
mcpServers: c.mcpServers,
|
|
106
239
|
mcpAccessEnabled: this.mcpAccessEnabled,
|
|
107
240
|
sandboxEnabled: c.sandboxEnabled,
|
|
108
|
-
sandboxProvider:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
daytonaCredentialId:
|
|
112
|
-
n8nSandboxCredentialId:
|
|
113
|
-
searchCredentialId:
|
|
241
|
+
sandboxProvider: this.aiService.isProxyEnabled()
|
|
242
|
+
? 'daytona'
|
|
243
|
+
: (0, sandbox_provider_1.normalizeSandboxProvider)(c.sandboxProvider),
|
|
244
|
+
daytonaCredentialId: isManaged ? null : credentialSelection.daytonaCredentialId,
|
|
245
|
+
n8nSandboxCredentialId: isManaged ? null : credentialSelection.n8nSandboxCredentialId,
|
|
246
|
+
searchCredentialId: isManaged ? null : credentialSelection.searchCredentialId,
|
|
247
|
+
modelCredentialId: isManaged ? null : credentialSelection.modelCredentialId,
|
|
248
|
+
modelName: isManaged ? null : credentialSelection.modelName,
|
|
249
|
+
modelEnvConfigured: Boolean(c.modelApiKey.trim() ||
|
|
250
|
+
c.modelUrl.trim() ||
|
|
251
|
+
(modelProviderApiKeyEnv && process.env[modelProviderApiKeyEnv]?.trim())),
|
|
252
|
+
sandboxEnvConfigured: this.environmentSandboxProvider === 'daytona'
|
|
253
|
+
? Boolean(c.daytonaApiKey.trim())
|
|
254
|
+
: Boolean(c.n8nSandboxServiceUrl.trim()),
|
|
255
|
+
searchEnvConfigured: Boolean(c.braveSearchApiKey.trim() || c.searxngUrl.trim()),
|
|
114
256
|
localGatewayDisabled: this.isLocalGatewayDisabled(),
|
|
115
257
|
browserUseEnabled: this.isBrowserUseEnabled(),
|
|
116
258
|
};
|
|
117
259
|
}
|
|
118
|
-
async updateAdminSettings(update) {
|
|
260
|
+
async updateAdminSettings(update, user) {
|
|
119
261
|
this.rejectManagedFields(update, InstanceAiSettingsService_1.MANAGED_ADMIN_FIELDS, this.deploymentLabel());
|
|
120
|
-
this.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
this.
|
|
153
|
-
|
|
262
|
+
if (this.isCloud || this.aiService.isProxyEnabled()) {
|
|
263
|
+
this.rejectManagedFields(update, InstanceAiSettingsService_1.INSTANCE_CREDENTIAL_FIELDS, this.deploymentLabel());
|
|
264
|
+
this.rejectManagedFields(update, ['modelName', 'sandboxProvider'], this.deploymentLabel());
|
|
265
|
+
}
|
|
266
|
+
const { modelCredentialId: initialModelCredentialId, daytonaCredentialId: initialDaytonaCredentialId, n8nSandboxCredentialId: initialN8nSandboxCredentialId, searchCredentialId: initialSearchCredentialId, modelConnection, sandboxConnection, searchConnection, ...settingsUpdate } = update;
|
|
267
|
+
let modelCredentialId = initialModelCredentialId;
|
|
268
|
+
let daytonaCredentialId = initialDaytonaCredentialId;
|
|
269
|
+
let n8nSandboxCredentialId = initialN8nSandboxCredentialId;
|
|
270
|
+
let searchCredentialId = initialSearchCredentialId;
|
|
271
|
+
this.rejectConnectionConflicts(update);
|
|
272
|
+
if (modelConnection !== undefined ||
|
|
273
|
+
sandboxConnection !== undefined ||
|
|
274
|
+
searchConnection !== undefined) {
|
|
275
|
+
if (!user || !(0, permissions_1.hasGlobalScope)(user, 'credential:manageInstance')) {
|
|
276
|
+
throw new forbidden_error_1.ForbiddenError('You do not have permission to manage provider connections');
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (modelConnection) {
|
|
280
|
+
const modelName = settingsUpdate.modelName === undefined
|
|
281
|
+
? (await this.readAdminModelSelection()).modelName
|
|
282
|
+
: settingsUpdate.modelName;
|
|
283
|
+
if (modelName === null) {
|
|
284
|
+
throw new unprocessable_error_1.UnprocessableRequestError('modelName must be set together with modelCredentialId');
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
const [modelPrepared, searchPrepared, sandboxPrepared] = user
|
|
288
|
+
? await Promise.all([
|
|
289
|
+
this.prepareConnection(exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY, 'AI Assistant model', modelConnection),
|
|
290
|
+
this.prepareConnection(exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY, 'AI Assistant web search', searchConnection),
|
|
291
|
+
this.prepareSandboxConnection(sandboxConnection),
|
|
292
|
+
])
|
|
293
|
+
: [undefined, undefined, undefined];
|
|
294
|
+
this.validateAdminSettingsUpdate(update, this.snapshotAdminSettings(), sandboxConnection === null
|
|
295
|
+
? this.environmentSandboxProvider
|
|
296
|
+
: sandboxConnection?.type === 'daytonaApi'
|
|
297
|
+
? 'daytona'
|
|
298
|
+
: sandboxConnection?.type === 'httpHeaderAuth'
|
|
299
|
+
? 'n8n-sandbox'
|
|
300
|
+
: settingsUpdate.sandboxProvider);
|
|
301
|
+
await this.runConnectionHooks([modelPrepared, searchPrepared, sandboxPrepared]);
|
|
302
|
+
const { previous, next, credentialSelection } = await this.dbLockService.withLockContext(1007, async (ctx) => {
|
|
303
|
+
if (user && modelConnection !== undefined) {
|
|
304
|
+
modelCredentialId = await this.upsertConnection(user, exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY, 'AI Assistant model', modelConnection, ctx, modelPrepared);
|
|
305
|
+
}
|
|
306
|
+
if (user && searchConnection !== undefined) {
|
|
307
|
+
searchCredentialId = await this.upsertConnection(user, exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY, 'AI Assistant web search', searchConnection, ctx, searchPrepared);
|
|
308
|
+
}
|
|
309
|
+
if (user && sandboxConnection !== undefined) {
|
|
310
|
+
const sandbox = await this.upsertSandboxConnection(user, sandboxConnection, ctx, sandboxPrepared);
|
|
311
|
+
daytonaCredentialId = sandbox.daytonaCredentialId;
|
|
312
|
+
n8nSandboxCredentialId = sandbox.n8nSandboxCredentialId;
|
|
313
|
+
if (sandbox.sandboxProvider)
|
|
314
|
+
settingsUpdate.sandboxProvider = sandbox.sandboxProvider;
|
|
315
|
+
}
|
|
316
|
+
const updateCredentialAssignment = async (credentialUse, credentialId) => {
|
|
317
|
+
if (credentialId === undefined)
|
|
318
|
+
return;
|
|
319
|
+
if (credentialId === null) {
|
|
320
|
+
await this.instanceCredentialBroker.clearForUse(credentialUse, ctx);
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
await this.instanceCredentialBroker.assignForUse(credentialUse, credentialId, ctx);
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
const persisted = await this.settingsRepository.findByKeyInContext(ADMIN_SETTINGS_KEY, ctx);
|
|
327
|
+
const current = this.mergeAdminSettings(this.snapshotAdminSettings(), this.parsePersistedAdminSettings(persisted?.value));
|
|
328
|
+
const [currentModelCredentialId, currentDaytonaCredentialId, currentN8nCredentialId, currentSearchCredentialId,] = await Promise.all([
|
|
329
|
+
this.instanceCredentialBroker.getAssignedCredentialId(exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY, ctx),
|
|
330
|
+
this.instanceCredentialBroker.getAssignedCredentialId(exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY, ctx),
|
|
331
|
+
this.instanceCredentialBroker.getAssignedCredentialId(exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY, ctx),
|
|
332
|
+
this.instanceCredentialBroker.getAssignedCredentialId(exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY, ctx),
|
|
333
|
+
]);
|
|
334
|
+
const nextDaytonaCredentialId = daytonaCredentialId === undefined ? currentDaytonaCredentialId : daytonaCredentialId;
|
|
335
|
+
const nextN8nCredentialId = n8nSandboxCredentialId === undefined ? currentN8nCredentialId : n8nSandboxCredentialId;
|
|
336
|
+
const nextSearchCredentialId = searchCredentialId === undefined ? currentSearchCredentialId : searchCredentialId;
|
|
337
|
+
const clearsSandboxConnection = (sandboxConnection !== undefined ||
|
|
338
|
+
daytonaCredentialId !== undefined ||
|
|
339
|
+
n8nSandboxCredentialId !== undefined) &&
|
|
340
|
+
nextDaytonaCredentialId === null &&
|
|
341
|
+
nextN8nCredentialId === null;
|
|
342
|
+
this.validateAdminSettingsUpdate(update, current, clearsSandboxConnection
|
|
343
|
+
? this.environmentSandboxProvider
|
|
344
|
+
: settingsUpdate.sandboxProvider);
|
|
345
|
+
const previous = this.snapshotAdminSettings();
|
|
346
|
+
const next = this.mergeAdminSettings(current, settingsUpdate);
|
|
347
|
+
if (clearsSandboxConnection)
|
|
348
|
+
delete next.sandboxProvider;
|
|
349
|
+
const nextModelCredentialId = modelCredentialId === undefined ? currentModelCredentialId : modelCredentialId;
|
|
350
|
+
const nextModelName = settingsUpdate.modelName !== undefined
|
|
351
|
+
? settingsUpdate.modelName
|
|
352
|
+
: modelCredentialId === null
|
|
353
|
+
? null
|
|
354
|
+
: current.modelName;
|
|
355
|
+
if (modelCredentialId !== undefined || settingsUpdate.modelName !== undefined) {
|
|
356
|
+
const hasCredential = nextModelCredentialId !== null && nextModelCredentialId !== undefined;
|
|
357
|
+
const hasModelName = nextModelName !== null && nextModelName !== undefined;
|
|
358
|
+
if (hasCredential && !hasModelName) {
|
|
359
|
+
throw new unprocessable_error_1.UnprocessableRequestError('modelName must be set together with modelCredentialId');
|
|
360
|
+
}
|
|
361
|
+
if (hasModelName && !hasCredential) {
|
|
362
|
+
throw new unprocessable_error_1.UnprocessableRequestError('modelName requires modelCredentialId');
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
next.modelName = nextModelName ?? null;
|
|
366
|
+
await updateCredentialAssignment(exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY, modelCredentialId);
|
|
367
|
+
await updateCredentialAssignment(exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY, daytonaCredentialId);
|
|
368
|
+
await updateCredentialAssignment(exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY, n8nSandboxCredentialId);
|
|
369
|
+
await updateCredentialAssignment(exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY, searchCredentialId);
|
|
370
|
+
if (typeof modelCredentialId === 'string') {
|
|
371
|
+
await this.validateAssignedServiceCredential(exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY, ctx);
|
|
372
|
+
}
|
|
373
|
+
if (typeof daytonaCredentialId === 'string') {
|
|
374
|
+
await this.validateAssignedServiceCredential(exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY, ctx);
|
|
375
|
+
}
|
|
376
|
+
if (typeof n8nSandboxCredentialId === 'string') {
|
|
377
|
+
await this.validateAssignedServiceCredential(exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY, ctx);
|
|
378
|
+
}
|
|
379
|
+
if (typeof searchCredentialId === 'string') {
|
|
380
|
+
await this.validateAssignedServiceCredential(exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY, ctx);
|
|
381
|
+
}
|
|
382
|
+
await this.settingsRepository.upsertByKey(ADMIN_SETTINGS_KEY, JSON.stringify(next), true, ctx);
|
|
383
|
+
return {
|
|
384
|
+
previous,
|
|
385
|
+
next,
|
|
386
|
+
credentialSelection: {
|
|
387
|
+
modelCredentialId: nextModelCredentialId ?? null,
|
|
388
|
+
modelName: next.modelName ?? null,
|
|
389
|
+
daytonaCredentialId: nextDaytonaCredentialId,
|
|
390
|
+
n8nSandboxCredentialId: nextN8nCredentialId,
|
|
391
|
+
searchCredentialId: nextSearchCredentialId,
|
|
392
|
+
},
|
|
393
|
+
};
|
|
154
394
|
});
|
|
155
|
-
|
|
395
|
+
this.applyAdminSettings(next);
|
|
396
|
+
this.emitSettingsUpdated(previous, next);
|
|
397
|
+
return this.buildAdminSettingsResponse(credentialSelection);
|
|
398
|
+
}
|
|
399
|
+
rejectConnectionConflicts(update) {
|
|
400
|
+
const conflicts = [
|
|
401
|
+
['modelConnection', 'modelCredentialId', update.modelCredentialId !== undefined],
|
|
402
|
+
['sandboxConnection', 'daytonaCredentialId', update.daytonaCredentialId !== undefined],
|
|
403
|
+
['sandboxConnection', 'n8nSandboxCredentialId', update.n8nSandboxCredentialId !== undefined],
|
|
404
|
+
['searchConnection', 'searchCredentialId', update.searchCredentialId !== undefined],
|
|
405
|
+
];
|
|
406
|
+
for (const [connectionField, idField, idPresent] of conflicts) {
|
|
407
|
+
const connectionPresent = update[connectionField] !== undefined;
|
|
408
|
+
if (connectionPresent && idPresent) {
|
|
409
|
+
throw new unprocessable_error_1.UnprocessableRequestError(`Cannot combine ${connectionField} with ${idField} in one update`);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
async upsertConnection(user, policy, name, connection, ctx, prepared) {
|
|
414
|
+
if (connection === null)
|
|
415
|
+
return null;
|
|
416
|
+
if (!prepared?.encryptedData) {
|
|
417
|
+
throw new n8n_workflow_1.UnexpectedError('Prepared provider connection is missing encrypted data');
|
|
418
|
+
}
|
|
419
|
+
let current;
|
|
420
|
+
try {
|
|
421
|
+
current = await this.instanceCredentialBroker.resolveForUse(policy, ctx);
|
|
422
|
+
}
|
|
423
|
+
catch (error) {
|
|
424
|
+
if (!(error instanceof unprocessable_error_1.UnprocessableRequestError))
|
|
425
|
+
throw error;
|
|
426
|
+
current = null;
|
|
427
|
+
}
|
|
428
|
+
if ((current?.id ?? null) !== prepared.expectedCredentialId ||
|
|
429
|
+
current?.name !== prepared.expectedCredentialName ||
|
|
430
|
+
current?.type !== prepared.expectedCredentialType ||
|
|
431
|
+
(current !== null &&
|
|
432
|
+
current !== undefined &&
|
|
433
|
+
!(0, node_util_1.isDeepStrictEqual)(current.data, prepared.expectedCredentialData))) {
|
|
434
|
+
throw new conflict_error_1.ConflictError('Provider connection changed; retry');
|
|
435
|
+
}
|
|
436
|
+
const data = connection.data;
|
|
437
|
+
if (current && current.type === connection.type) {
|
|
438
|
+
await this.credentialsService.updateInstanceCredential(user, current.id, { name: current.name, type: current.type, data }, ctx, { skipExternalHooks: true, encryptedData: prepared.encryptedData });
|
|
439
|
+
return current.id;
|
|
440
|
+
}
|
|
441
|
+
const dto = {
|
|
442
|
+
name,
|
|
443
|
+
type: connection.type,
|
|
444
|
+
data: connection.data,
|
|
445
|
+
usageScope: 'instance',
|
|
446
|
+
};
|
|
447
|
+
const created = await this.credentialsService.createInstanceCredential(dto, user, ctx, {
|
|
448
|
+
skipExternalHooks: true,
|
|
449
|
+
encryptedData: prepared.encryptedData,
|
|
450
|
+
});
|
|
451
|
+
return created.id;
|
|
452
|
+
}
|
|
453
|
+
async prepareConnection(policy, name, connection) {
|
|
454
|
+
if (!connection)
|
|
455
|
+
return undefined;
|
|
456
|
+
if (!policy.credentialTypes.includes(connection.type)) {
|
|
457
|
+
throw new unprocessable_error_1.UnprocessableRequestError(`Connection type "${connection.type}" is not supported for "${policy.id}"`);
|
|
458
|
+
}
|
|
459
|
+
let current;
|
|
460
|
+
try {
|
|
461
|
+
current = await this.instanceCredentialBroker.resolveForUse(policy);
|
|
462
|
+
}
|
|
463
|
+
catch (error) {
|
|
464
|
+
if (!(error instanceof unprocessable_error_1.UnprocessableRequestError))
|
|
465
|
+
throw error;
|
|
466
|
+
current = null;
|
|
467
|
+
}
|
|
468
|
+
const data = current?.type === connection.type
|
|
469
|
+
? this.credentialsService.unredact(connection.data, current.data, this.credentialsService.getCredentialTypeProperties(connection.type))
|
|
470
|
+
: connection.data;
|
|
471
|
+
validateInstanceAiCredential(policy, { type: connection.type, data });
|
|
472
|
+
const existing = current?.type === connection.type ? { id: current.id, name: current.name } : null;
|
|
473
|
+
return {
|
|
474
|
+
event: existing ? 'update' : 'create',
|
|
475
|
+
expectedCredentialId: current?.id ?? null,
|
|
476
|
+
expectedCredentialName: current?.name,
|
|
477
|
+
expectedCredentialType: current?.type,
|
|
478
|
+
expectedCredentialData: current?.data,
|
|
479
|
+
credential: {
|
|
480
|
+
id: existing?.id ?? null,
|
|
481
|
+
name: existing?.name ?? name,
|
|
482
|
+
type: connection.type,
|
|
483
|
+
data,
|
|
484
|
+
},
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
async prepareSandboxConnection(connection) {
|
|
488
|
+
if (!connection)
|
|
489
|
+
return undefined;
|
|
490
|
+
const policy = connection.type === 'daytonaApi'
|
|
491
|
+
? exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY
|
|
492
|
+
: connection.type === 'httpHeaderAuth'
|
|
493
|
+
? exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY
|
|
494
|
+
: undefined;
|
|
495
|
+
if (!policy) {
|
|
496
|
+
throw new unprocessable_error_1.UnprocessableRequestError(`Connection type "${connection.type}" is not supported for the sandbox`);
|
|
497
|
+
}
|
|
498
|
+
return await this.prepareConnection(policy, 'AI Assistant sandbox', connection);
|
|
499
|
+
}
|
|
500
|
+
async runConnectionHooks(preparedConnections) {
|
|
501
|
+
for (const prepared of preparedConnections) {
|
|
502
|
+
if (prepared) {
|
|
503
|
+
prepared.encryptedData = await this.credentialsService.runInstanceCredentialHooks(prepared.event, prepared.credential);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
async upsertSandboxConnection(user, connection, ctx, prepared) {
|
|
508
|
+
const name = 'AI Assistant sandbox';
|
|
509
|
+
if (connection === null) {
|
|
510
|
+
return {
|
|
511
|
+
daytonaCredentialId: await this.upsertConnection(user, exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY, name, null, ctx),
|
|
512
|
+
n8nSandboxCredentialId: await this.upsertConnection(user, exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY, name, null, ctx),
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
if (connection.type === 'daytonaApi') {
|
|
516
|
+
return {
|
|
517
|
+
daytonaCredentialId: await this.upsertConnection(user, exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY, name, connection, ctx, prepared),
|
|
518
|
+
n8nSandboxCredentialId: await this.upsertConnection(user, exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY, name, null, ctx),
|
|
519
|
+
sandboxProvider: 'daytona',
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
if (connection.type === 'httpHeaderAuth') {
|
|
523
|
+
return {
|
|
524
|
+
n8nSandboxCredentialId: await this.upsertConnection(user, exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY, name, connection, ctx, prepared),
|
|
525
|
+
daytonaCredentialId: await this.upsertConnection(user, exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY, name, null, ctx),
|
|
526
|
+
sandboxProvider: 'n8n-sandbox',
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
throw new unprocessable_error_1.UnprocessableRequestError(`Connection type "${connection.type}" is not supported for the sandbox`);
|
|
530
|
+
}
|
|
531
|
+
async reloadFromDb() {
|
|
532
|
+
const previous = this.snapshotAdminSettings();
|
|
533
|
+
const persisted = await this.readPersistedAdminSettings();
|
|
534
|
+
this.applyAdminSettings(persisted);
|
|
535
|
+
this.emitSettingsUpdated(previous, this.snapshotAdminSettings());
|
|
156
536
|
}
|
|
157
537
|
async getUserPreferences(user) {
|
|
158
538
|
const prefs = this.readUserPreferences(user);
|
|
@@ -189,100 +569,113 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
189
569
|
user.settings = { ...(user.settings ?? {}), instanceAi: prefs };
|
|
190
570
|
return await this.getUserPreferences(user);
|
|
191
571
|
}
|
|
192
|
-
async
|
|
193
|
-
if (this.aiService.isProxyEnabled())
|
|
572
|
+
async listInstanceModelCredentials() {
|
|
573
|
+
if (this.isCloud || this.aiService.isProxyEnabled())
|
|
194
574
|
return [];
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
]);
|
|
198
|
-
return allCredentials
|
|
199
|
-
.filter((c) => SUPPORTED_CREDENTIAL_TYPES.includes(c.type))
|
|
200
|
-
.map((c) => ({
|
|
575
|
+
const instanceCredentials = await this.instanceCredentialBroker.listForUse(exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY);
|
|
576
|
+
return instanceCredentials.map((c) => ({
|
|
201
577
|
id: c.id,
|
|
202
578
|
name: c.name,
|
|
203
579
|
type: c.type,
|
|
204
|
-
provider: CREDENTIAL_TO_MODEL_PROVIDER[c.type] ?? 'custom',
|
|
205
580
|
}));
|
|
206
581
|
}
|
|
207
|
-
async
|
|
208
|
-
if (this.aiService.isProxyEnabled())
|
|
582
|
+
async listInstanceServiceCredentials() {
|
|
583
|
+
if (this.isCloud || this.aiService.isProxyEnabled())
|
|
209
584
|
return [];
|
|
210
|
-
const
|
|
211
|
-
|
|
585
|
+
const credentials = await Promise.all([
|
|
586
|
+
this.instanceCredentialBroker.listForUse(exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY),
|
|
587
|
+
this.instanceCredentialBroker.listForUse(exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY),
|
|
588
|
+
this.instanceCredentialBroker.listForUse(exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY),
|
|
212
589
|
]);
|
|
213
|
-
return
|
|
214
|
-
.filter((c) => SERVICE_CREDENTIAL_TYPES.includes(c.type))
|
|
215
|
-
.map((c) => ({
|
|
590
|
+
return credentials.flat().map((c) => ({
|
|
216
591
|
id: c.id,
|
|
217
592
|
name: c.name,
|
|
218
593
|
type: c.type,
|
|
219
|
-
provider: c.type,
|
|
220
594
|
}));
|
|
221
595
|
}
|
|
222
|
-
async resolveDaytonaConfig(
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
apiUrl: daytonaApiUrl || undefined,
|
|
228
|
-
apiKey: daytonaApiKey || undefined,
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
const credential = await this.credentialsFinderService.findCredentialForUser(credentialId, user, ['credential:read']);
|
|
232
|
-
if (!credential) {
|
|
233
|
-
return {};
|
|
234
|
-
}
|
|
235
|
-
const data = await this.credentialsService.decrypt(credential, true);
|
|
236
|
-
return {
|
|
237
|
-
apiUrl: typeof data.apiUrl === 'string' ? data.apiUrl : undefined,
|
|
238
|
-
apiKey: typeof data.apiKey === 'string' ? data.apiKey : undefined,
|
|
596
|
+
async resolveDaytonaConfig() {
|
|
597
|
+
const { daytonaApiUrl, daytonaApiKey } = this.config;
|
|
598
|
+
const envConfig = {
|
|
599
|
+
apiUrl: daytonaApiUrl || undefined,
|
|
600
|
+
apiKey: daytonaApiKey || undefined,
|
|
239
601
|
};
|
|
602
|
+
const resolved = await this.resolveServiceCredential(exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY, 'Daytona sandbox');
|
|
603
|
+
if (!resolved)
|
|
604
|
+
return envConfig;
|
|
605
|
+
const { data } = resolved;
|
|
606
|
+
const apiUrl = typeof data.apiUrl === 'string' ? data.apiUrl : undefined;
|
|
607
|
+
const apiKey = typeof data.apiKey === 'string' ? data.apiKey : undefined;
|
|
608
|
+
if (!apiUrl || !apiKey) {
|
|
609
|
+
this.warnCredentialFallback('Daytona sandbox', exports.INSTANCE_AI_DAYTONA_CREDENTIAL_POLICY.id, 'Credential data is incomplete');
|
|
610
|
+
return envConfig;
|
|
611
|
+
}
|
|
612
|
+
return { apiUrl, apiKey };
|
|
240
613
|
}
|
|
241
|
-
async resolveN8nSandboxConfig(
|
|
614
|
+
async resolveN8nSandboxConfig() {
|
|
242
615
|
const { n8nSandboxServiceUrl, n8nSandboxServiceApiKey } = this.config;
|
|
243
|
-
const
|
|
244
|
-
if (!credentialId) {
|
|
245
|
-
return {
|
|
246
|
-
serviceUrl: n8nSandboxServiceUrl || undefined,
|
|
247
|
-
apiKey: n8nSandboxServiceApiKey || undefined,
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
const credential = await this.credentialsFinderService.findCredentialForUser(credentialId, user, ['credential:read']);
|
|
251
|
-
if (!credential) {
|
|
252
|
-
return {
|
|
253
|
-
serviceUrl: n8nSandboxServiceUrl || undefined,
|
|
254
|
-
apiKey: n8nSandboxServiceApiKey || undefined,
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
const data = await this.credentialsService.decrypt(credential, true);
|
|
258
|
-
const headerName = typeof data.name === 'string' ? data.name.trim().toLowerCase() : '';
|
|
259
|
-
const apiKey = typeof data.value === 'string' ? data.value : undefined;
|
|
260
|
-
return {
|
|
616
|
+
const envConfig = {
|
|
261
617
|
serviceUrl: n8nSandboxServiceUrl || undefined,
|
|
262
|
-
apiKey:
|
|
618
|
+
apiKey: n8nSandboxServiceApiKey || undefined,
|
|
263
619
|
};
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
620
|
+
const resolved = await this.resolveServiceCredential(exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY, 'n8n Sandbox');
|
|
621
|
+
if (!resolved)
|
|
622
|
+
return envConfig;
|
|
623
|
+
const { data } = resolved;
|
|
624
|
+
const headerName = typeof data.name === 'string' ? data.name.trim().toLowerCase() : '';
|
|
625
|
+
const apiKey = typeof data.value === 'string' ? data.value : undefined;
|
|
626
|
+
if (headerName !== N8N_SANDBOX_HEADER_NAME) {
|
|
627
|
+
this.warnCredentialFallback('n8n Sandbox', exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY.id, `Credential header must be "${N8N_SANDBOX_HEADER_NAME}" but is "${headerName || '(empty)'}"`);
|
|
628
|
+
return envConfig;
|
|
273
629
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
return
|
|
630
|
+
if (!apiKey) {
|
|
631
|
+
this.warnCredentialFallback('n8n Sandbox', exports.INSTANCE_AI_N8N_SANDBOX_CREDENTIAL_POLICY.id, 'Credential data is incomplete');
|
|
632
|
+
return envConfig;
|
|
277
633
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
634
|
+
return { serviceUrl: n8nSandboxServiceUrl || undefined, apiKey };
|
|
635
|
+
}
|
|
636
|
+
async resolveSearchConfig() {
|
|
637
|
+
const { braveSearchApiKey, searxngUrl } = this.config;
|
|
638
|
+
const envConfig = {
|
|
639
|
+
braveApiKey: braveSearchApiKey || undefined,
|
|
640
|
+
searxngUrl: searxngUrl || undefined,
|
|
641
|
+
};
|
|
642
|
+
const resolved = await this.resolveServiceCredential(exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY, 'search');
|
|
643
|
+
if (!resolved)
|
|
644
|
+
return envConfig;
|
|
645
|
+
const { type, data } = resolved;
|
|
646
|
+
if (type === 'braveSearchApi' && typeof data.apiKey === 'string' && data.apiKey) {
|
|
647
|
+
return { braveApiKey: data.apiKey };
|
|
281
648
|
}
|
|
282
|
-
if (
|
|
283
|
-
return { searxngUrl:
|
|
649
|
+
if (type === 'searXngApi' && typeof data.apiUrl === 'string' && data.apiUrl) {
|
|
650
|
+
return { searxngUrl: data.apiUrl };
|
|
284
651
|
}
|
|
285
|
-
|
|
652
|
+
this.warnCredentialFallback('search', exports.INSTANCE_AI_SEARCH_CREDENTIAL_POLICY.id, 'Credential data is incomplete');
|
|
653
|
+
return envConfig;
|
|
654
|
+
}
|
|
655
|
+
async validateAssignedServiceCredential(policy, ctx) {
|
|
656
|
+
const resolved = await this.instanceCredentialBroker.resolveForUse(policy, ctx);
|
|
657
|
+
if (!resolved)
|
|
658
|
+
return;
|
|
659
|
+
validateInstanceAiCredential(policy, { type: resolved.type, data: resolved.data });
|
|
660
|
+
}
|
|
661
|
+
async resolveServiceCredential(policy, service, ctx) {
|
|
662
|
+
if (this.isCloud || this.aiService.isProxyEnabled())
|
|
663
|
+
return null;
|
|
664
|
+
const resolved = ctx
|
|
665
|
+
? this.instanceCredentialBroker.resolveForUse(policy, ctx)
|
|
666
|
+
: this.instanceCredentialBroker.resolveForUse(policy);
|
|
667
|
+
return await resolved.catch((error) => {
|
|
668
|
+
this.warnCredentialFallback(service, policy.id, (0, ensure_error_1.ensureError)(error).message);
|
|
669
|
+
return null;
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
warnCredentialFallback(service, credentialUseId, reason) {
|
|
673
|
+
di_1.Container.get(backend_common_1.Logger)
|
|
674
|
+
.scoped('instance-ai')
|
|
675
|
+
.warn(`Could not resolve the configured ${service} credential; using environment fallback`, {
|
|
676
|
+
credentialUseId,
|
|
677
|
+
error: reason,
|
|
678
|
+
});
|
|
286
679
|
}
|
|
287
680
|
getPermissions() {
|
|
288
681
|
return { ...this.permissions };
|
|
@@ -310,7 +703,9 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
310
703
|
return this.config.browserUseEnabled;
|
|
311
704
|
}
|
|
312
705
|
getSandboxStatus() {
|
|
313
|
-
const provider =
|
|
706
|
+
const provider = this.aiService.isProxyEnabled()
|
|
707
|
+
? 'daytona'
|
|
708
|
+
: (0, sandbox_provider_1.normalizeSandboxProvider)(this.config.sandboxProvider);
|
|
314
709
|
const unavailableReason = this.getSandboxUnavailableReason(this.config.sandboxEnabled, provider);
|
|
315
710
|
return {
|
|
316
711
|
enabled: this.config.sandboxEnabled,
|
|
@@ -324,10 +719,16 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
324
719
|
}
|
|
325
720
|
resolveModelName(user) {
|
|
326
721
|
const prefs = this.readUserPreferences(user);
|
|
327
|
-
|
|
722
|
+
const adminModelName = this.isCloud || this.aiService.isProxyEnabled() ? null : this.adminModelName;
|
|
723
|
+
return adminModelName ?? prefs.modelName ?? this.extractModelName(this.config.model);
|
|
328
724
|
}
|
|
329
725
|
async resolveModelConfig(user) {
|
|
330
726
|
const prefs = this.readUserPreferences(user);
|
|
727
|
+
const fallbackModelName = prefs.modelName ?? this.extractModelName(this.config.model);
|
|
728
|
+
const adminModelConfig = await this.resolveAdminModelConfig();
|
|
729
|
+
if (adminModelConfig) {
|
|
730
|
+
return adminModelConfig;
|
|
731
|
+
}
|
|
331
732
|
const credentialId = prefs.credentialId ?? null;
|
|
332
733
|
if (!credentialId) {
|
|
333
734
|
return this.envVarModelConfig();
|
|
@@ -336,24 +737,44 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
336
737
|
if (!credential) {
|
|
337
738
|
return this.envVarModelConfig();
|
|
338
739
|
}
|
|
339
|
-
|
|
740
|
+
return ((await this.buildModelConfigFromCredential(credential, fallbackModelName)) ??
|
|
741
|
+
this.envVarModelConfig());
|
|
742
|
+
}
|
|
743
|
+
async resolveAdminModelConfig() {
|
|
744
|
+
if (this.isCloud || this.aiService.isProxyEnabled())
|
|
745
|
+
return null;
|
|
746
|
+
return await this.withPersistedAdminSettings(async (ctx, persisted) => {
|
|
747
|
+
const modelName = persisted.modelName ?? null;
|
|
748
|
+
if (!modelName)
|
|
749
|
+
return null;
|
|
750
|
+
const resolved = await this.resolveServiceCredential(exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY, 'model', ctx);
|
|
751
|
+
if (!resolved)
|
|
752
|
+
return null;
|
|
753
|
+
const config = this.buildModelConfig(resolved.type, resolved.data, modelName);
|
|
754
|
+
if (!config) {
|
|
755
|
+
this.warnCredentialFallback('model', exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY.id, 'Credential data is incomplete');
|
|
756
|
+
}
|
|
757
|
+
return config;
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
async buildModelConfigFromCredential(credential, modelName) {
|
|
761
|
+
const data = await this.credentialsService.decrypt(credential, true);
|
|
762
|
+
return this.buildModelConfig(credential.type, data, modelName);
|
|
763
|
+
}
|
|
764
|
+
buildModelConfig(credentialType, data, modelName) {
|
|
765
|
+
const provider = CREDENTIAL_TO_MODEL_PROVIDER[credentialType];
|
|
340
766
|
if (!provider) {
|
|
341
|
-
return
|
|
767
|
+
return null;
|
|
342
768
|
}
|
|
343
|
-
const data = await this.credentialsService.decrypt(credential, true);
|
|
344
769
|
const apiKey = typeof data.apiKey === 'string' ? data.apiKey : '';
|
|
345
|
-
const urlField = URL_FIELD_MAP[
|
|
770
|
+
const urlField = URL_FIELD_MAP[credentialType];
|
|
346
771
|
const rawUrl = urlField ? data[urlField] : undefined;
|
|
347
772
|
const baseUrl = typeof rawUrl === 'string' ? rawUrl : '';
|
|
348
|
-
const modelName = prefs.modelName ?? this.extractModelName(this.config.model);
|
|
349
773
|
const id = `${provider}/${modelName}`;
|
|
350
|
-
if (baseUrl)
|
|
351
|
-
return
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
return { id, url: '', apiKey };
|
|
355
|
-
}
|
|
356
|
-
return id;
|
|
774
|
+
if (!baseUrl && !apiKey)
|
|
775
|
+
return null;
|
|
776
|
+
const headers = modelCredentialHeaders(credentialType, data);
|
|
777
|
+
return { id, url: baseUrl, ...(apiKey ? { apiKey } : {}), ...(headers ? { headers } : {}) };
|
|
357
778
|
}
|
|
358
779
|
deploymentLabel() {
|
|
359
780
|
if (this.isCloud)
|
|
@@ -369,23 +790,24 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
369
790
|
throw new unprocessable_error_1.UnprocessableRequestError(`Cannot update ${label}-managed fields: ${present.join(', ')}`);
|
|
370
791
|
}
|
|
371
792
|
}
|
|
372
|
-
validateAdminSettingsUpdate(update) {
|
|
373
|
-
const c = this.config;
|
|
793
|
+
validateAdminSettingsUpdate(update, current, sandboxProviderOverride) {
|
|
374
794
|
const touchesSandboxSettings = update.sandboxEnabled !== undefined ||
|
|
375
795
|
update.sandboxProvider !== undefined ||
|
|
376
796
|
update.sandboxImage !== undefined ||
|
|
377
797
|
update.sandboxTimeout !== undefined ||
|
|
378
798
|
update.daytonaCredentialId !== undefined ||
|
|
379
|
-
update.n8nSandboxCredentialId !== undefined
|
|
380
|
-
|
|
799
|
+
update.n8nSandboxCredentialId !== undefined ||
|
|
800
|
+
update.sandboxConnection !== undefined;
|
|
801
|
+
if (!touchesSandboxSettings)
|
|
381
802
|
return;
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
803
|
+
const sandboxProvider = (0, sandbox_provider_1.normalizeSandboxProvider)(sandboxProviderOverride ??
|
|
804
|
+
update.sandboxProvider ??
|
|
805
|
+
current.sandboxProvider ??
|
|
806
|
+
this.environmentSandboxProvider);
|
|
807
|
+
const sandboxEnabled = update.sandboxEnabled ?? current.sandboxEnabled ?? false;
|
|
385
808
|
const unavailableReason = this.getSandboxUnavailableReason(sandboxEnabled, sandboxProvider);
|
|
386
|
-
if (unavailableReason)
|
|
809
|
+
if (unavailableReason)
|
|
387
810
|
throw new unprocessable_error_1.UnprocessableRequestError(unavailableReason);
|
|
388
|
-
}
|
|
389
811
|
}
|
|
390
812
|
getSandboxUnavailableReason(sandboxEnabled, sandboxProvider) {
|
|
391
813
|
if (sandboxEnabled &&
|
|
@@ -431,18 +853,20 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
431
853
|
this.mcpAccessEnabled = persisted.mcpAccessEnabled;
|
|
432
854
|
if (persisted.sandboxEnabled !== undefined)
|
|
433
855
|
c.sandboxEnabled = persisted.sandboxEnabled;
|
|
434
|
-
|
|
435
|
-
|
|
856
|
+
const isProxyEnabled = this.aiService.isProxyEnabled();
|
|
857
|
+
this.sandboxProviderOverride =
|
|
858
|
+
this.isCloud || isProxyEnabled || !persisted.sandboxProvider
|
|
859
|
+
? undefined
|
|
860
|
+
: (0, sandbox_provider_1.normalizeSandboxProvider)(persisted.sandboxProvider);
|
|
861
|
+
c.sandboxProvider = isProxyEnabled
|
|
862
|
+
? 'daytona'
|
|
863
|
+
: (this.sandboxProviderOverride ?? this.environmentSandboxProvider);
|
|
436
864
|
if (persisted.sandboxImage !== undefined)
|
|
437
865
|
c.sandboxImage = persisted.sandboxImage;
|
|
438
866
|
if (persisted.sandboxTimeout !== undefined)
|
|
439
867
|
c.sandboxTimeout = persisted.sandboxTimeout;
|
|
440
|
-
if (persisted.
|
|
441
|
-
this.
|
|
442
|
-
if (persisted.n8nSandboxCredentialId !== undefined)
|
|
443
|
-
this.adminN8nSandboxCredentialId = persisted.n8nSandboxCredentialId;
|
|
444
|
-
if (persisted.searchCredentialId !== undefined)
|
|
445
|
-
this.adminSearchCredentialId = persisted.searchCredentialId;
|
|
868
|
+
if (persisted.modelName !== undefined)
|
|
869
|
+
this.adminModelName = persisted.modelName;
|
|
446
870
|
if (persisted.localGatewayDisabled !== undefined)
|
|
447
871
|
c.localGatewayDisabled = persisted.localGatewayDisabled;
|
|
448
872
|
if (persisted.browserUseEnabled !== undefined)
|
|
@@ -451,36 +875,88 @@ let InstanceAiSettingsService = InstanceAiSettingsService_1 = class InstanceAiSe
|
|
|
451
875
|
readUserPreferences(user) {
|
|
452
876
|
return user.settings?.instanceAi ?? {};
|
|
453
877
|
}
|
|
454
|
-
|
|
878
|
+
snapshotAdminSettings() {
|
|
455
879
|
const c = this.config;
|
|
456
|
-
|
|
880
|
+
return {
|
|
457
881
|
enabled: this.enabled,
|
|
458
882
|
permissions: this.permissions,
|
|
459
883
|
mcpServers: c.mcpServers,
|
|
460
884
|
mcpAccessEnabled: this.mcpAccessEnabled,
|
|
461
885
|
sandboxEnabled: c.sandboxEnabled,
|
|
462
|
-
sandboxProvider:
|
|
886
|
+
...(this.sandboxProviderOverride ? { sandboxProvider: this.sandboxProviderOverride } : {}),
|
|
463
887
|
sandboxImage: c.sandboxImage,
|
|
464
888
|
sandboxTimeout: c.sandboxTimeout,
|
|
465
|
-
|
|
466
|
-
n8nSandboxCredentialId: this.adminN8nSandboxCredentialId,
|
|
467
|
-
searchCredentialId: this.adminSearchCredentialId,
|
|
889
|
+
modelName: this.adminModelName,
|
|
468
890
|
localGatewayDisabled: c.localGatewayDisabled,
|
|
469
891
|
browserUseEnabled: c.browserUseEnabled,
|
|
470
892
|
};
|
|
471
|
-
|
|
893
|
+
}
|
|
894
|
+
mergeAdminSettings(base, update) {
|
|
895
|
+
return {
|
|
896
|
+
...base,
|
|
897
|
+
...update,
|
|
898
|
+
permissions: update.permissions
|
|
899
|
+
? { ...(base.permissions ?? api_types_1.DEFAULT_INSTANCE_AI_PERMISSIONS), ...update.permissions }
|
|
900
|
+
: base.permissions,
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
async readPersistedAdminSettings() {
|
|
904
|
+
const row = await this.settingsRepository.findByKey(ADMIN_SETTINGS_KEY);
|
|
905
|
+
return this.parsePersistedAdminSettings(row?.value);
|
|
906
|
+
}
|
|
907
|
+
async withPersistedAdminSettings(read) {
|
|
908
|
+
return await this.dbLockService.withLockContext(1007, async (ctx) => {
|
|
909
|
+
const row = await this.settingsRepository.findByKeyInContext(ADMIN_SETTINGS_KEY, ctx);
|
|
910
|
+
return await read(ctx, this.parsePersistedAdminSettings(row?.value));
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
async readAdminModelSelection() {
|
|
914
|
+
return await this.withPersistedAdminSettings(async (ctx, persisted) => ({
|
|
915
|
+
modelCredentialId: await this.instanceCredentialBroker.getAssignedCredentialId(exports.INSTANCE_AI_MODEL_CREDENTIAL_POLICY, ctx),
|
|
916
|
+
modelName: persisted.modelName ?? null,
|
|
917
|
+
}));
|
|
918
|
+
}
|
|
919
|
+
parsePersistedAdminSettings(value) {
|
|
920
|
+
if (value === undefined)
|
|
921
|
+
return {};
|
|
922
|
+
const settings = (0, n8n_workflow_1.jsonParse)(value, { fallbackValue: {} });
|
|
923
|
+
delete settings.modelCredentialId;
|
|
924
|
+
delete settings.daytonaCredentialId;
|
|
925
|
+
delete settings.n8nSandboxCredentialId;
|
|
926
|
+
delete settings.searchCredentialId;
|
|
927
|
+
return settings;
|
|
928
|
+
}
|
|
929
|
+
emitSettingsUpdated(previous, current) {
|
|
930
|
+
try {
|
|
931
|
+
this.eventService.emit('instance-ai-settings-updated', {
|
|
932
|
+
mcpSettingsChanged: current.mcpServers !== previous.mcpServers ||
|
|
933
|
+
current.mcpAccessEnabled !== previous.mcpAccessEnabled,
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
catch (error) {
|
|
937
|
+
di_1.Container.get(backend_common_1.Logger)
|
|
938
|
+
.scoped('instance-ai')
|
|
939
|
+
.warn('Failed to apply local settings event', {
|
|
940
|
+
error: (0, ensure_error_1.ensureError)(error).message,
|
|
941
|
+
});
|
|
942
|
+
}
|
|
472
943
|
}
|
|
473
944
|
};
|
|
474
945
|
exports.InstanceAiSettingsService = InstanceAiSettingsService;
|
|
475
946
|
InstanceAiSettingsService.MANAGED_ADMIN_FIELDS = [
|
|
476
947
|
'mcpServers',
|
|
477
948
|
'sandboxEnabled',
|
|
478
|
-
'sandboxProvider',
|
|
479
949
|
'sandboxImage',
|
|
480
950
|
'sandboxTimeout',
|
|
951
|
+
];
|
|
952
|
+
InstanceAiSettingsService.INSTANCE_CREDENTIAL_FIELDS = [
|
|
953
|
+
'modelCredentialId',
|
|
481
954
|
'daytonaCredentialId',
|
|
482
955
|
'n8nSandboxCredentialId',
|
|
483
956
|
'searchCredentialId',
|
|
957
|
+
'modelConnection',
|
|
958
|
+
'sandboxConnection',
|
|
959
|
+
'searchConnection',
|
|
484
960
|
];
|
|
485
961
|
InstanceAiSettingsService.MANAGED_PREFERENCE_FIELDS = [
|
|
486
962
|
'credentialId',
|
|
@@ -488,6 +964,6 @@ InstanceAiSettingsService.MANAGED_PREFERENCE_FIELDS = [
|
|
|
488
964
|
];
|
|
489
965
|
exports.InstanceAiSettingsService = InstanceAiSettingsService = InstanceAiSettingsService_1 = __decorate([
|
|
490
966
|
(0, di_1.Service)(),
|
|
491
|
-
__metadata("design:paramtypes", [config_1.GlobalConfig, db_1.SettingsRepository, db_1.UserRepository, user_service_1.UserService, ai_service_1.AiService, credentials_service_1.CredentialsService, credentials_finder_service_1.CredentialsFinderService, event_service_1.EventService])
|
|
967
|
+
__metadata("design:paramtypes", [config_1.GlobalConfig, db_1.DbLockService, db_1.SettingsRepository, db_1.UserRepository, user_service_1.UserService, ai_service_1.AiService, credentials_service_1.CredentialsService, credentials_finder_service_1.CredentialsFinderService, instance_credential_broker_1.InstanceCredentialBroker, event_service_1.EventService])
|
|
492
968
|
], InstanceAiSettingsService);
|
|
493
969
|
//# sourceMappingURL=instance-ai-settings.service.js.map
|