n8n 2.23.2 → 2.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/active-workflow-manager.d.ts +8 -4
- package/dist/active-workflow-manager.js +26 -9
- package/dist/active-workflow-manager.js.map +1 -1
- package/dist/auth/auth.service.d.ts +1 -1
- package/dist/auth/auth.service.js +2 -1
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/controllers/ai.controller.js +1 -1
- package/dist/controllers/ai.controller.js.map +1 -1
- package/dist/controllers/api-keys.controller.d.ts +20 -15
- package/dist/controllers/api-keys.controller.js +7 -4
- package/dist/controllers/api-keys.controller.js.map +1 -1
- package/dist/controllers/oauth/oauth1-credential.controller.d.ts +4 -2
- package/dist/controllers/oauth/oauth1-credential.controller.js +15 -5
- package/dist/controllers/oauth/oauth1-credential.controller.js.map +1 -1
- package/dist/controllers/oauth/oauth2-credential.controller.d.ts +4 -2
- package/dist/controllers/oauth/oauth2-credential.controller.js +15 -6
- package/dist/controllers/oauth/oauth2-credential.controller.js.map +1 -1
- package/dist/controllers/project.controller.d.ts +8 -0
- package/dist/controllers/project.controller.js +2 -1
- package/dist/controllers/project.controller.js.map +1 -1
- package/dist/controllers/security-settings.controller.js +18 -1
- package/dist/controllers/security-settings.controller.js.map +1 -1
- package/dist/controllers/telemetry.controller.js +4 -1
- package/dist/controllers/telemetry.controller.js.map +1 -1
- package/dist/credentials/credential-connection-status-provider.interface.d.ts +3 -0
- package/dist/credentials/credential-connection-status-proxy.d.ts +3 -0
- package/dist/credentials/credential-connection-status-proxy.js +10 -0
- package/dist/credentials/credential-connection-status-proxy.js.map +1 -1
- package/dist/credentials/credentials.controller.d.ts +6 -0
- package/dist/credentials/credentials.controller.js +39 -2
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +29 -13
- package/dist/credentials/credentials.service.ee.d.ts +2 -0
- package/dist/credentials/credentials.service.ee.js +3 -0
- package/dist/credentials/credentials.service.ee.js.map +1 -1
- package/dist/credentials/credentials.service.js +27 -6
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials-helper.d.ts +1 -0
- package/dist/credentials-helper.js +14 -4
- package/dist/credentials-helper.js.map +1 -1
- package/dist/errors/credential-missing-id.error.d.ts +4 -0
- package/dist/errors/credential-missing-id.error.js +14 -0
- package/dist/errors/credential-missing-id.error.js.map +1 -0
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +3 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +54 -2
- package/dist/events/relays/log-streaming.event-relay.d.ts +3 -0
- package/dist/events/relays/log-streaming.event-relay.js +39 -1
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +6 -0
- package/dist/events/relays/telemetry.event-relay.js +74 -3
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +6 -5
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/executions/execution-persistence.js +4 -0
- package/dist/executions/execution-persistence.js.map +1 -1
- package/dist/expression-observability/expression-observability.provider.d.ts +3 -1
- package/dist/expression-observability/expression-observability.provider.js +48 -46
- package/dist/expression-observability/expression-observability.provider.js.map +1 -1
- package/dist/interfaces.d.ts +3 -1
- package/dist/modules/agents/agent-execution.service.d.ts +4 -2
- package/dist/modules/agents/agent-execution.service.js +3 -3
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-command.service.d.ts +40 -0
- package/dist/modules/agents/agent-knowledge-command.service.js +221 -0
- package/dist/modules/agents/agent-knowledge-command.service.js.map +1 -0
- package/dist/modules/agents/agent-knowledge.service.d.ts +42 -0
- package/dist/modules/agents/agent-knowledge.service.js +300 -0
- package/dist/modules/agents/agent-knowledge.service.js.map +1 -0
- package/dist/modules/agents/agent-task.service.d.ts +52 -0
- package/dist/modules/agents/agent-task.service.js +487 -0
- package/dist/modules/agents/agent-task.service.js.map +1 -0
- package/dist/modules/agents/agent-upload.middleware.d.ts +7 -0
- package/dist/modules/agents/agent-upload.middleware.js +62 -0
- package/dist/modules/agents/agent-upload.middleware.js.map +1 -0
- package/dist/modules/agents/agents-tools.service.d.ts +1 -1
- package/dist/modules/agents/agents-tools.service.js +12 -3
- package/dist/modules/agents/agents-tools.service.js.map +1 -1
- package/dist/modules/agents/agents.controller.d.ts +138 -45
- package/dist/modules/agents/agents.controller.js +176 -48
- package/dist/modules/agents/agents.controller.js.map +1 -1
- package/dist/modules/agents/agents.module.d.ts +2 -2
- package/dist/modules/agents/agents.module.js +13 -5
- package/dist/modules/agents/agents.module.js.map +1 -1
- package/dist/modules/agents/agents.service.d.ts +43 -7
- package/dist/modules/agents/agents.service.js +341 -57
- package/dist/modules/agents/agents.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-prompts.d.ts +6 -5
- package/dist/modules/agents/builder/agents-builder-prompts.js +92 -18
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +11 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.js +164 -26
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder.service.d.ts +3 -1
- package/dist/modules/agents/builder/agents-builder.service.js +8 -3
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
- package/dist/modules/agents/builder/builder-tool-names.d.ts +3 -0
- package/dist/modules/agents/builder/builder-tool-names.js +3 -0
- package/dist/modules/agents/builder/builder-tool-names.js.map +1 -1
- package/dist/modules/agents/builder/interactive/ask-credential.tool.d.ts +1 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js +25 -4
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/ask-question.tool.js +6 -5
- package/dist/modules/agents/builder/interactive/ask-question.tool.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +20 -5
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js +23 -4
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +18 -1
- 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 +5 -3
- package/dist/modules/agents/builder/prompts/memory.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -1
- package/dist/modules/agents/builder/prompts/tools.prompt.js +11 -2
- package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -1
- package/dist/modules/agents/builder/search-mcp-servers.tool.d.ts +6 -0
- package/dist/modules/agents/builder/search-mcp-servers.tool.js +85 -0
- package/dist/modules/agents/builder/search-mcp-servers.tool.js.map +1 -0
- package/dist/modules/agents/builder/skill-body-template.d.ts +4 -0
- package/dist/modules/agents/builder/skill-body-template.js +31 -0
- package/dist/modules/agents/builder/skill-body-template.js.map +1 -0
- package/dist/modules/agents/builder/skills/index.js +6 -1
- package/dist/modules/agents/builder/skills/index.js.map +1 -1
- package/dist/modules/agents/builder/skills/integrations.skill.js +39 -18
- package/dist/modules/agents/builder/skills/integrations.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/mcp.skill.d.ts +2 -0
- package/dist/modules/agents/builder/skills/mcp.skill.js +110 -0
- package/dist/modules/agents/builder/skills/mcp.skill.js.map +1 -0
- package/dist/modules/agents/builder/skills/research.skill.js +8 -5
- package/dist/modules/agents/builder/skills/research.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-skills.skill.js +41 -13
- package/dist/modules/agents/builder/skills/target-skills.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-tasks.skill.d.ts +2 -0
- package/dist/modules/agents/builder/skills/target-tasks.skill.js +82 -0
- package/dist/modules/agents/builder/skills/target-tasks.skill.js.map +1 -0
- package/dist/modules/agents/builder/task-objective-template.d.ts +3 -0
- package/dist/modules/agents/builder/task-objective-template.js +27 -0
- package/dist/modules/agents/builder/task-objective-template.js.map +1 -0
- package/dist/modules/agents/builder/verify-mcp-server.tool.d.ts +8 -0
- package/dist/modules/agents/builder/verify-mcp-server.tool.js +79 -0
- package/dist/modules/agents/builder/verify-mcp-server.tool.js.map +1 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.d.ts +4 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js +26 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-file.entity.d.ts +11 -0
- package/dist/modules/agents/entities/agent-file.entity.js +48 -0
- package/dist/modules/agents/entities/agent-file.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-task-run-lock.entity.d.ts +10 -0
- package/dist/modules/agents/entities/agent-task-run-lock.entity.js +54 -0
- package/dist/modules/agents/entities/agent-task-run-lock.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-task-snapshot.entity.d.ts +12 -0
- package/dist/modules/agents/entities/agent-task-snapshot.entity.js +70 -0
- package/dist/modules/agents/entities/agent-task-snapshot.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-task.entity.d.ts +11 -0
- package/dist/modules/agents/entities/agent-task.entity.js +64 -0
- package/dist/modules/agents/entities/agent-task.entity.js.map +1 -0
- package/dist/modules/agents/execution-recorder.d.ts +1 -0
- package/dist/modules/agents/execution-recorder.js +9 -5
- package/dist/modules/agents/execution-recorder.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +16 -4
- package/dist/modules/agents/integrations/agent-chat-bridge.js +372 -116
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +27 -2
- package/dist/modules/agents/integrations/agent-chat-integration.js +5 -0
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
- package/dist/modules/agents/integrations/chat-integration.service.d.ts +15 -6
- package/dist/modules/agents/integrations/chat-integration.service.js +9 -10
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
- package/dist/modules/agents/integrations/component-mapper.d.ts +14 -0
- package/dist/modules/agents/integrations/component-mapper.js +9 -1
- package/dist/modules/agents/integrations/component-mapper.js.map +1 -1
- package/dist/modules/agents/integrations/integration-action-executor.d.ts +22 -0
- package/dist/modules/agents/integrations/integration-action-executor.js +171 -0
- package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -0
- package/dist/modules/agents/integrations/integration-context-query-executor.d.ts +18 -0
- package/dist/modules/agents/integrations/integration-context-query-executor.js +58 -0
- package/dist/modules/agents/integrations/integration-context-query-executor.js.map +1 -0
- package/dist/modules/agents/integrations/integration-error-codes.d.ts +13 -0
- package/dist/modules/agents/integrations/integration-error-codes.js +16 -0
- package/dist/modules/agents/integrations/integration-error-codes.js.map +1 -0
- package/dist/modules/agents/integrations/integration-helpers.d.ts +21 -0
- package/dist/modules/agents/integrations/integration-helpers.js +72 -0
- package/dist/modules/agents/integrations/integration-helpers.js.map +1 -0
- package/dist/modules/agents/integrations/integration-message-context.service.d.ts +13 -0
- package/dist/modules/agents/integrations/integration-message-context.service.js +129 -0
- package/dist/modules/agents/integrations/integration-message-context.service.js.map +1 -0
- package/dist/modules/agents/integrations/integration-tools.d.ts +205 -0
- package/dist/modules/agents/integrations/integration-tools.js +955 -0
- package/dist/modules/agents/integrations/integration-tools.js.map +1 -0
- package/dist/modules/agents/integrations/integrations-sync.d.ts +1 -1
- package/dist/modules/agents/integrations/integrations-sync.js +1 -29
- package/dist/modules/agents/integrations/integrations-sync.js.map +1 -1
- package/dist/modules/agents/integrations/n8n-memory.d.ts +2 -0
- package/dist/modules/agents/integrations/n8n-memory.js +18 -11
- package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/linear-integration.d.ts +13 -2
- package/dist/modules/agents/integrations/platforms/linear-integration.js +70 -15
- package/dist/modules/agents/integrations/platforms/linear-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/linear-operations.d.ts +18 -0
- package/dist/modules/agents/integrations/platforms/linear-operations.js +679 -0
- package/dist/modules/agents/integrations/platforms/linear-operations.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.d.ts +11 -1
- package/dist/modules/agents/integrations/platforms/slack-integration.js +53 -1
- package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack-operations.d.ts +17 -0
- package/dist/modules/agents/integrations/platforms/slack-operations.js +288 -0
- package/dist/modules/agents/integrations/platforms/slack-operations.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +9 -2
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +17 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
- package/dist/modules/agents/integrations/slack-app-setup.service.js +7 -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 +4 -2
- package/dist/modules/agents/json-config/from-json-config.js +88 -11
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
- package/dist/modules/agents/json-config/mcp-client-factory.d.ts +16 -0
- package/dist/modules/agents/json-config/mcp-client-factory.js +155 -0
- package/dist/modules/agents/json-config/mcp-client-factory.js.map +1 -0
- package/dist/modules/agents/json-config/native-web-search-provider-tools.d.ts +8 -0
- package/dist/modules/agents/json-config/native-web-search-provider-tools.js +59 -0
- package/dist/modules/agents/json-config/native-web-search-provider-tools.js.map +1 -0
- package/dist/modules/agents/json-config/schema-text-serializer.js +12 -2
- package/dist/modules/agents/json-config/schema-text-serializer.js.map +1 -1
- package/dist/modules/agents/repositories/agent-execution-thread.repository.d.ts +1 -1
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js +5 -3
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-file.repository.d.ts +7 -0
- package/dist/modules/agents/repositories/agent-file.repository.js +35 -0
- package/dist/modules/agents/repositories/agent-file.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-history.repository.d.ts +2 -0
- package/dist/modules/agents/repositories/agent-history.repository.js +18 -0
- package/dist/modules/agents/repositories/agent-history.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-task-run-lock.repository.d.ts +12 -0
- package/dist/modules/agents/repositories/agent-task-run-lock.repository.js +72 -0
- package/dist/modules/agents/repositories/agent-task-run-lock.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-task-snapshot.repository.d.ts +11 -0
- package/dist/modules/agents/repositories/agent-task-snapshot.repository.js +45 -0
- package/dist/modules/agents/repositories/agent-task-snapshot.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-task.repository.d.ts +7 -0
- package/dist/modules/agents/repositories/agent-task.repository.js +32 -0
- package/dist/modules/agents/repositories/agent-task.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent.repository.js +1 -2
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
- package/dist/modules/agents/tools/knowledge/csv-helpers.d.ts +73 -0
- package/dist/modules/agents/tools/knowledge/csv-helpers.js +341 -0
- package/dist/modules/agents/tools/knowledge/csv-helpers.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/csv.operation.d.ts +61 -0
- package/dist/modules/agents/tools/knowledge/csv.operation.js +207 -0
- package/dist/modules/agents/tools/knowledge/csv.operation.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/file-references.d.ts +16 -0
- package/dist/modules/agents/tools/knowledge/file-references.js +35 -0
- package/dist/modules/agents/tools/knowledge/file-references.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/read.operation.d.ts +8 -0
- package/dist/modules/agents/tools/knowledge/read.operation.js +38 -0
- package/dist/modules/agents/tools/knowledge/read.operation.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/schemas.d.ts +1505 -0
- package/dist/modules/agents/tools/knowledge/schemas.js +441 -0
- package/dist/modules/agents/tools/knowledge/schemas.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/search.operation.d.ts +9 -0
- package/dist/modules/agents/tools/knowledge/search.operation.js +332 -0
- package/dist/modules/agents/tools/knowledge/search.operation.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/tool.d.ts +8 -0
- package/dist/modules/agents/tools/knowledge/tool.js +121 -0
- package/dist/modules/agents/tools/knowledge/tool.js.map +1 -0
- package/dist/modules/agents/utils/agent-memory-scope.d.ts +1 -1
- package/dist/modules/agents/utils/agent-memory-scope.js +4 -4
- package/dist/modules/agents/utils/agent-memory-scope.js.map +1 -1
- package/dist/modules/agents/utils/agent-resource-id.d.ts +1 -1
- package/dist/modules/chat-hub/chat-hub.module.d.ts +2 -2
- package/dist/modules/chat-hub/chat-hub.settings.controller.d.ts +4 -4
- package/dist/modules/chat-hub/chat-hub.types.d.ts +5 -5
- package/dist/modules/chat-hub/dto/chat-models-request.dto.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/constants.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/constants.js +2 -1
- package/dist/modules/dynamic-credentials.ee/constants.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.d.ts +9 -2
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +45 -14
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.d.ts +4 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js +16 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js +6 -2
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.d.ts +1 -0
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js +21 -2
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js.map +1 -1
- package/dist/modules/instance-ai/eval/execution.service.d.ts +4 -1
- package/dist/modules/instance-ai/eval/execution.service.js +118 -24
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/llm-wire-server.d.ts +8 -3
- package/dist/modules/instance-ai/eval/llm-wire-server.js +147 -50
- package/dist/modules/instance-ai/eval/llm-wire-server.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-handler.js +45 -8
- package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-quirks.d.ts +4 -2
- package/dist/modules/instance-ai/eval/mock-quirks.js +83 -4
- package/dist/modules/instance-ai/eval/mock-quirks.js.map +1 -1
- package/dist/modules/instance-ai/eval/openai-envelope.d.ts +8 -0
- package/dist/modules/instance-ai/eval/openai-envelope.js +121 -8
- package/dist/modules/instance-ai/eval/openai-envelope.js.map +1 -1
- package/dist/modules/instance-ai/eval/openai-responses-envelope.d.ts +11 -0
- package/dist/modules/instance-ai/eval/openai-responses-envelope.js +238 -0
- package/dist/modules/instance-ai/eval/openai-responses-envelope.js.map +1 -0
- package/dist/modules/instance-ai/eval/request-binary-redactor.d.ts +1 -0
- package/dist/modules/instance-ai/eval/request-binary-redactor.js +74 -0
- package/dist/modules/instance-ai/eval/request-binary-redactor.js.map +1 -0
- package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +19 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.js +159 -76
- package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
- package/dist/modules/instance-ai/extract-resolved-node-parameters.d.ts +7 -0
- package/dist/modules/instance-ai/extract-resolved-node-parameters.js +221 -0
- package/dist/modules/instance-ai/extract-resolved-node-parameters.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +7 -1
- package/dist/modules/instance-ai/instance-ai-memory.service.js +80 -3
- package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.js +1 -16
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +67 -7
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.d.ts +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +24 -1
- package/dist/modules/instance-ai/instance-ai.service.js +400 -26
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.d.ts +1 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js +1 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js.map +1 -1
- package/dist/modules/instance-ai/message-parser.d.ts +2 -0
- package/dist/modules/instance-ai/message-parser.js +165 -36
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.d.ts +2 -0
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js +13 -0
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-pending-confirmation.repository.d.ts +12 -0
- package/dist/modules/instance-ai/repositories/instance-ai-pending-confirmation.repository.js +80 -0
- package/dist/modules/instance-ai/repositories/instance-ai-pending-confirmation.repository.js.map +1 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.d.ts +1 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js +23 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.d.ts +10 -4
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js +49 -37
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js.map +1 -1
- package/dist/modules/instance-ai/web-research/index.d.ts +0 -2
- package/dist/modules/instance-ai/web-research/index.js +1 -5
- package/dist/modules/instance-ai/web-research/index.js.map +1 -1
- package/dist/modules/ldap.ee/helpers.ee.js +6 -2
- package/dist/modules/ldap.ee/helpers.ee.js.map +1 -1
- package/dist/modules/mcp/mcp.controller.js +13 -6
- package/dist/modules/mcp/mcp.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +10 -2
- package/dist/modules/mcp/mcp.service.js +36 -6
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.settings.controller.d.ts +2 -0
- package/dist/modules/mcp/mcp.settings.service.d.ts +2 -0
- package/dist/modules/mcp/mcp.settings.service.js +6 -5
- package/dist/modules/mcp/mcp.settings.service.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +6 -0
- package/dist/modules/mcp/mcp.types.js +9 -0
- package/dist/modules/mcp/mcp.types.js.map +1 -1
- package/dist/modules/mcp/tools/execute-workflow.tool.d.ts +6 -6
- package/dist/modules/mcp/tools/search-workflows.tool.d.ts +2 -1
- package/dist/modules/mcp/tools/search-workflows.tool.js +12 -4
- package/dist/modules/mcp/tools/search-workflows.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +1 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +67 -6
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.d.ts +67 -6
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +51 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -1
- package/dist/modules/mcp-registry/synthesize-type-def.d.ts +2 -0
- package/dist/modules/mcp-registry/synthesize-type-def.js +35 -0
- package/dist/modules/mcp-registry/synthesize-type-def.js.map +1 -0
- package/dist/modules/n8n-packages/engine/import-pipeline.d.ts +24 -0
- package/dist/modules/n8n-packages/engine/import-pipeline.js +206 -0
- package/dist/modules/n8n-packages/engine/import-pipeline.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.d.ts +6 -0
- package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js +33 -0
- package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential.exporter.d.ts +23 -0
- package/dist/modules/n8n-packages/entities/credential/credential.exporter.js +68 -0
- package/dist/modules/n8n-packages/entities/credential/credential.exporter.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.d.ts +5 -0
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.js +25 -0
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential.types.d.ts +6 -0
- package/dist/modules/n8n-packages/entities/credential/credential.types.js +3 -0
- package/dist/modules/n8n-packages/entities/credential/credential.types.js.map +1 -0
- package/dist/modules/n8n-packages/entities/requirements-extractor.d.ts +4 -0
- package/dist/modules/n8n-packages/entities/requirements-extractor.js +3 -0
- package/dist/modules/n8n-packages/entities/requirements-extractor.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.d.ts +12 -3
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +11 -20
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +3 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +10 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/io/package-reader.d.ts +6 -0
- package/dist/modules/n8n-packages/io/package-reader.js +3 -0
- package/dist/modules/n8n-packages/io/package-reader.js.map +1 -0
- package/dist/modules/n8n-packages/io/slug.utils.d.ts +1 -1
- package/dist/modules/n8n-packages/io/slug.utils.js +3 -3
- package/dist/modules/n8n-packages/io/slug.utils.js.map +1 -1
- package/dist/modules/n8n-packages/io/tar/tar-package-reader.d.ts +13 -0
- package/dist/modules/n8n-packages/io/tar/tar-package-reader.js +84 -0
- package/dist/modules/n8n-packages/io/tar/tar-package-reader.js.map +1 -0
- package/dist/modules/n8n-packages/io/unique-filename-allocator.d.ts +7 -0
- package/dist/modules/n8n-packages/io/unique-filename-allocator.js +27 -0
- package/dist/modules/n8n-packages/io/unique-filename-allocator.js.map +1 -0
- package/dist/modules/n8n-packages/n8n-packages.service.d.ts +7 -2
- package/dist/modules/n8n-packages/n8n-packages.service.js +21 -3
- package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +22 -0
- package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +121 -4
- package/dist/modules/n8n-packages/spec/manifest.schema.js +22 -3
- package/dist/modules/n8n-packages/spec/manifest.schema.js.map +1 -1
- package/dist/modules/n8n-packages/spec/requirements.schema.d.ts +51 -0
- package/dist/modules/n8n-packages/spec/requirements.schema.js +14 -0
- package/dist/modules/n8n-packages/spec/requirements.schema.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.d.ts +15 -0
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.js +12 -0
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +4 -4
- package/dist/modules/n8n-packages/utils/import-package-upload.d.ts +13 -0
- package/dist/modules/n8n-packages/utils/import-package-upload.js +59 -0
- package/dist/modules/n8n-packages/utils/import-package-upload.js.map +1 -0
- package/dist/modules/otel/execution-level-tracer.js +15 -6
- package/dist/modules/otel/execution-level-tracer.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.types.d.ts +3 -0
- package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
- package/dist/modules/otel/otel-lifecycle-handler.d.ts +4 -2
- package/dist/modules/otel/otel-lifecycle-handler.js +69 -4
- package/dist/modules/otel/otel-lifecycle-handler.js.map +1 -1
- package/dist/modules/otel/otel.config.d.ts +1 -0
- package/dist/modules/otel/otel.config.js +5 -0
- package/dist/modules/otel/otel.config.js.map +1 -1
- package/dist/modules/otel/otel.constants.d.ts +2 -0
- package/dist/modules/otel/otel.constants.js +2 -0
- package/dist/modules/otel/otel.constants.js.map +1 -1
- package/dist/modules/redaction/instance-redaction-enforcement.service.d.ts +4 -0
- package/dist/modules/redaction/instance-redaction-enforcement.service.js +8 -0
- package/dist/modules/redaction/instance-redaction-enforcement.service.js.map +1 -1
- package/dist/modules/redaction/redaction-context-hook.d.ts +9 -0
- package/dist/modules/redaction/redaction-context-hook.js +57 -0
- package/dist/modules/redaction/redaction-context-hook.js.map +1 -0
- package/dist/modules/redaction/redaction.module.js +1 -0
- package/dist/modules/redaction/redaction.module.js.map +1 -1
- package/dist/modules/source-control.ee/constants.d.ts +1 -0
- package/dist/modules/source-control.ee/constants.js +2 -1
- package/dist/modules/source-control.ee/constants.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-status.service.ee.js +5 -0
- package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +4 -2
- package/dist/modules/source-control.ee/source-control.controller.ee.js +32 -5
- package/dist/modules/source-control.ee/source-control.controller.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.service.ee.js +2 -0
- package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
- package/dist/modules/workflow-builder/workflow-builder-session.repository.js +2 -1
- package/dist/modules/workflow-builder/workflow-builder-session.repository.js.map +1 -1
- package/dist/node-catalog/node-catalog.service.d.ts +2 -0
- package/dist/node-catalog/node-catalog.service.js +38 -2
- package/dist/node-catalog/node-catalog.service.js.map +1 -1
- package/dist/oauth/oauth-browser-binding.service.d.ts +18 -0
- package/dist/oauth/oauth-browser-binding.service.js +68 -0
- package/dist/oauth/oauth-browser-binding.service.js.map +1 -0
- package/dist/oauth/oauth.service.d.ts +10 -4
- package/dist/oauth/oauth.service.js +87 -4
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/oauth/types.d.ts +1 -0
- package/dist/oauth/types.js.map +1 -1
- package/dist/public-api/index.js +5 -1
- package/dist/public-api/index.js.map +1 -1
- package/dist/public-api/types.d.ts +6 -0
- package/dist/public-api/v1/handlers/credentials/credentials.service.js +1 -0
- package/dist/public-api/v1/handlers/credentials/credentials.service.js.map +1 -1
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.d.ts +5 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +22 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +207 -59
- package/dist/requests.d.ts +4 -0
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +5 -2
- package/dist/scaling/pubsub/pubsub.types.d.ts +2 -1
- package/dist/services/ai-workflow-builder.service.d.ts +6 -3
- package/dist/services/ai-workflow-builder.service.js +13 -5
- package/dist/services/ai-workflow-builder.service.js.map +1 -1
- package/dist/services/api-key-auth.strategy.d.ts +4 -1
- package/dist/services/api-key-auth.strategy.js +18 -2
- package/dist/services/api-key-auth.strategy.js.map +1 -1
- package/dist/services/ownership.service.d.ts +1 -0
- package/dist/services/ownership.service.js +7 -0
- package/dist/services/ownership.service.js.map +1 -1
- package/dist/services/project.service.ee.d.ts +6 -2
- package/dist/services/project.service.ee.js +30 -8
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/public-api-key.service.d.ts +21 -14
- package/dist/services/public-api-key.service.js +14 -9
- package/dist/services/public-api-key.service.js.map +1 -1
- package/dist/telemetry/index.d.ts +6 -9
- package/dist/telemetry/index.js +23 -9
- package/dist/telemetry/index.js.map +1 -1
- package/dist/webhooks/constants.js +5 -1
- package/dist/webhooks/constants.js.map +1 -1
- package/dist/webhooks/live-webhooks.d.ts +8 -1
- package/dist/webhooks/live-webhooks.js +37 -22
- package/dist/webhooks/live-webhooks.js.map +1 -1
- package/dist/webhooks/waiting-forms.js +8 -1
- package/dist/webhooks/waiting-forms.js.map +1 -1
- package/dist/webhooks/webhook-helpers.d.ts +1 -1
- package/dist/webhooks/webhook-helpers.js +20 -10
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/webhooks/webhook-request-handler.js +1 -1
- package/dist/webhooks/webhook-request-handler.js.map +1 -1
- package/dist/workflow-helpers.d.ts +6 -1
- package/dist/workflow-helpers.js +9 -1
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflows/workflow-creation.service.d.ts +4 -1
- package/dist/workflows/workflow-creation.service.js +12 -3
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow-finder.service.d.ts +1 -0
- package/dist/workflows/workflow-published-data.service.d.ts +11 -0
- package/dist/workflows/workflow-published-data.service.js +39 -0
- package/dist/workflows/workflow-published-data.service.js.map +1 -0
- package/dist/workflows/workflow-validation.service.d.ts +5 -1
- package/dist/workflows/workflow-validation.service.js +55 -2
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.js +4 -0
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +8 -0
- package/package.json +40 -32
- package/templates/form-trigger-completion.handlebars +12 -1
- package/dist/modules/agents/integrations/agent-schedule.service.d.ts +0 -30
- package/dist/modules/agents/integrations/agent-schedule.service.js +0 -331
- package/dist/modules/agents/integrations/agent-schedule.service.js.map +0 -1
- package/dist/modules/instance-ai/web-research/brave-search.d.ts +0 -10
- package/dist/modules/instance-ai/web-research/brave-search.js +0 -44
- package/dist/modules/instance-ai/web-research/brave-search.js.map +0 -1
- package/dist/modules/instance-ai/web-research/searxng-search.d.ts +0 -6
- package/dist/modules/instance-ai/web-research/searxng-search.js +0 -39
- package/dist/modules/instance-ai/web-research/searxng-search.js.map +0 -1
|
@@ -60,6 +60,7 @@ const conflict_error_1 = require("../../errors/response-errors/conflict.error");
|
|
|
60
60
|
const not_found_error_1 = require("../../errors/response-errors/not-found.error");
|
|
61
61
|
const node_definition_resolver_1 = require("../../modules/instance-ai/node-definition-resolver");
|
|
62
62
|
const node_execution_1 = require("../../node-execution");
|
|
63
|
+
const oauth_service_1 = require("../../oauth/oauth.service");
|
|
63
64
|
const publisher_service_1 = require("../../scaling/pubsub/publisher.service");
|
|
64
65
|
const url_service_1 = require("../../services/url.service");
|
|
65
66
|
const telemetry_1 = require("../../telemetry");
|
|
@@ -75,18 +76,31 @@ const agent_execution_service_1 = require("./agent-execution.service");
|
|
|
75
76
|
const agent_skills_service_1 = require("./agent-skills.service");
|
|
76
77
|
const agents_tools_service_1 = require("./agents-tools.service");
|
|
77
78
|
const builder_tool_names_1 = require("./builder/builder-tool-names");
|
|
79
|
+
const llm_provider_defaults_1 = require("./builder/interactive/llm-provider-defaults");
|
|
80
|
+
const agent_task_entity_1 = require("./entities/agent-task.entity");
|
|
78
81
|
const execution_recorder_1 = require("./execution-recorder");
|
|
79
82
|
const agent_chat_integration_1 = require("./integrations/agent-chat-integration");
|
|
83
|
+
const integration_action_executor_1 = require("./integrations/integration-action-executor");
|
|
84
|
+
const integration_context_query_executor_1 = require("./integrations/integration-context-query-executor");
|
|
85
|
+
const integration_message_context_service_1 = require("./integrations/integration-message-context.service");
|
|
86
|
+
const integration_tools_1 = require("./integrations/integration-tools");
|
|
80
87
|
const integrations_sync_1 = require("./integrations/integrations-sync");
|
|
81
88
|
const n8n_checkpoint_storage_1 = require("./integrations/n8n-checkpoint-storage");
|
|
82
89
|
const n8n_memory_1 = require("./integrations/n8n-memory");
|
|
90
|
+
const environment_tool_1 = require("./tools/environment-tool");
|
|
91
|
+
const rich_interaction_tool_1 = require("./integrations/rich-interaction-tool");
|
|
83
92
|
const agent_config_composition_1 = require("./json-config/agent-config-composition");
|
|
84
93
|
const from_json_config_1 = require("./json-config/from-json-config");
|
|
94
|
+
const mcp_client_factory_1 = require("./json-config/mcp-client-factory");
|
|
85
95
|
const agent_history_repository_1 = require("./repositories/agent-history.repository");
|
|
96
|
+
const agent_task_snapshot_repository_1 = require("./repositories/agent-task-snapshot.repository");
|
|
97
|
+
const agent_task_repository_1 = require("./repositories/agent-task.repository");
|
|
86
98
|
const agent_repository_1 = require("./repositories/agent.repository");
|
|
87
99
|
const agent_secure_runtime_1 = require("./runtime/agent-secure-runtime");
|
|
88
100
|
const tool_registry_1 = require("./tool-registry");
|
|
89
101
|
const chat_integration_service_1 = require("./integrations/chat-integration.service");
|
|
102
|
+
const agent_knowledge_command_service_1 = require("./agent-knowledge-command.service");
|
|
103
|
+
const agent_knowledge_service_1 = require("./agent-knowledge.service");
|
|
90
104
|
function chatThreadId(agentId, userId) {
|
|
91
105
|
const baseThreadId = `${builder_tool_names_1.AGENT_THREAD_PREFIX.TEST}${agentId}`;
|
|
92
106
|
return userId ? `${baseThreadId}:${userId}` : baseThreadId;
|
|
@@ -119,7 +133,10 @@ let AgentsService = class AgentsService {
|
|
|
119
133
|
clearRuntimes(agentId, options = {}) {
|
|
120
134
|
for (const key of this.runtimes.keys()) {
|
|
121
135
|
if (key === agentId || key.startsWith(`${agentId}:`)) {
|
|
136
|
+
const entry = this.runtimes.get(key);
|
|
122
137
|
this.runtimes.delete(key);
|
|
138
|
+
if (entry)
|
|
139
|
+
this.closeAgentResources(entry.agent, agentId);
|
|
123
140
|
}
|
|
124
141
|
}
|
|
125
142
|
if (options.skipBroadcast)
|
|
@@ -140,7 +157,7 @@ let AgentsService = class AgentsService {
|
|
|
140
157
|
handleAgentConfigChanged(payload) {
|
|
141
158
|
this.clearRuntimes(payload.agentId, { skipBroadcast: true });
|
|
142
159
|
}
|
|
143
|
-
constructor(logger, agentRepository, projectRelationRepository, workflowRunner, activeExecutions, executionRepository, workflowRepository, userRepository, workflowFinderService, urlService, n8nCheckpointStorage, secureRuntime, ephemeralNodeExecutor, agentsToolsService, n8nMemory, agentExecutionService, agentHistoryRepository, agentSkillsService, publisher, agentsConfig, globalConfig, telemetry, chatIntegrationService) {
|
|
160
|
+
constructor(logger, agentRepository, projectRelationRepository, workflowRunner, activeExecutions, executionRepository, workflowRepository, userRepository, workflowFinderService, urlService, n8nCheckpointStorage, secureRuntime, ephemeralNodeExecutor, agentsToolsService, n8nMemory, agentExecutionService, agentHistoryRepository, agentSkillsService, agentTaskRepository, agentTaskSnapshotRepository, publisher, agentsConfig, globalConfig, telemetry, chatIntegrationService, agentKnowledgeService, agentKnowledgeCommandService, oauthService) {
|
|
144
161
|
this.logger = logger;
|
|
145
162
|
this.agentRepository = agentRepository;
|
|
146
163
|
this.projectRelationRepository = projectRelationRepository;
|
|
@@ -159,16 +176,32 @@ let AgentsService = class AgentsService {
|
|
|
159
176
|
this.agentExecutionService = agentExecutionService;
|
|
160
177
|
this.agentHistoryRepository = agentHistoryRepository;
|
|
161
178
|
this.agentSkillsService = agentSkillsService;
|
|
179
|
+
this.agentTaskRepository = agentTaskRepository;
|
|
180
|
+
this.agentTaskSnapshotRepository = agentTaskSnapshotRepository;
|
|
162
181
|
this.publisher = publisher;
|
|
163
182
|
this.agentsConfig = agentsConfig;
|
|
164
183
|
this.globalConfig = globalConfig;
|
|
165
184
|
this.telemetry = telemetry;
|
|
166
185
|
this.chatIntegrationService = chatIntegrationService;
|
|
186
|
+
this.agentKnowledgeService = agentKnowledgeService;
|
|
187
|
+
this.agentKnowledgeCommandService = agentKnowledgeCommandService;
|
|
188
|
+
this.oauthService = oauthService;
|
|
167
189
|
this.runtimes = new ttl_map_1.TtlMap(30 * constants_1.Time.minutes.toMilliseconds);
|
|
168
190
|
}
|
|
169
191
|
isNodeToolsModuleEnabled() {
|
|
170
192
|
return this.agentsConfig.modules.includes('node-tools-searcher');
|
|
171
193
|
}
|
|
194
|
+
isKnowledgeBaseModuleEnabled() {
|
|
195
|
+
return this.agentsConfig.modules.includes('knowledge-base');
|
|
196
|
+
}
|
|
197
|
+
closeAgentResources(agent, agentId) {
|
|
198
|
+
agent.close().catch((error) => {
|
|
199
|
+
this.logger.warn('[AgentsService] Failed to close agent resources on eviction', {
|
|
200
|
+
agentId,
|
|
201
|
+
error: error instanceof Error ? error.message : String(error),
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
}
|
|
172
205
|
createAgentExecutionCounter({ agentId, userId, }) {
|
|
173
206
|
const attribution = userId ? { user_id: userId } : {};
|
|
174
207
|
return {
|
|
@@ -200,6 +233,13 @@ let AgentsService = class AgentsService {
|
|
|
200
233
|
label: i.displayLabel,
|
|
201
234
|
icon: i.displayIcon,
|
|
202
235
|
credentialTypes: i.credentialTypes,
|
|
236
|
+
...(i.builderGuidance
|
|
237
|
+
? {
|
|
238
|
+
capabilities: i.builderGuidance.capabilities,
|
|
239
|
+
useIntegrationWhen: i.builderGuidance.useIntegrationWhen,
|
|
240
|
+
useNodeToolWhen: i.builderGuidance.useNodeToolWhen,
|
|
241
|
+
}
|
|
242
|
+
: {}),
|
|
203
243
|
}));
|
|
204
244
|
}
|
|
205
245
|
async create(projectId, name) {
|
|
@@ -279,7 +319,7 @@ let AgentsService = class AgentsService {
|
|
|
279
319
|
});
|
|
280
320
|
return agents.filter((agent) => agent.activeVersionId !== null);
|
|
281
321
|
}
|
|
282
|
-
async publishAgent(agentId, projectId, user, versionId) {
|
|
322
|
+
async publishAgent(agentId, projectId, user, versionId, options = {}) {
|
|
283
323
|
const agent = await this.agentRepository.findByIdAndProjectId(agentId, projectId);
|
|
284
324
|
if (!agent) {
|
|
285
325
|
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
@@ -287,6 +327,9 @@ let AgentsService = class AgentsService {
|
|
|
287
327
|
if (!versionId && agent.versionId !== null && agent.versionId === agent.activeVersionId) {
|
|
288
328
|
return agent;
|
|
289
329
|
}
|
|
330
|
+
if (versionId !== undefined && versionId === agent.activeVersionId) {
|
|
331
|
+
return agent;
|
|
332
|
+
}
|
|
290
333
|
await this.agentRepository.manager.transaction(async (trx) => {
|
|
291
334
|
if (versionId) {
|
|
292
335
|
const existing = await this.agentHistoryRepository.findByVersionAndAgentId(versionId, agentId, trx);
|
|
@@ -295,6 +338,7 @@ let AgentsService = class AgentsService {
|
|
|
295
338
|
}
|
|
296
339
|
agent.activeVersionId = existing.versionId;
|
|
297
340
|
agent.activeVersion = existing;
|
|
341
|
+
agent.versionId = (0, uuid_1.v4)();
|
|
298
342
|
}
|
|
299
343
|
else {
|
|
300
344
|
agent.versionId ??= (0, uuid_1.v4)();
|
|
@@ -306,13 +350,14 @@ let AgentsService = class AgentsService {
|
|
|
306
350
|
skills: this.agentSkillsService.snapshotConfiguredSkills(agent.schema, agent.skills ?? {}),
|
|
307
351
|
publishedBy: user,
|
|
308
352
|
}, trx);
|
|
353
|
+
await this.snapshotConfiguredTasks(trx, agent.versionId, agent.id, agent.schema);
|
|
309
354
|
agent.activeVersionId = agent.versionId;
|
|
310
355
|
}
|
|
311
356
|
await trx.save(agent);
|
|
312
357
|
});
|
|
313
358
|
this.clearRuntimes(agentId);
|
|
314
|
-
const credentialIntegrations =
|
|
315
|
-
if (credentialIntegrations.length > 0) {
|
|
359
|
+
const credentialIntegrations = agent.integrations ?? [];
|
|
360
|
+
if (credentialIntegrations.length > 0 && options.syncIntegrations !== false) {
|
|
316
361
|
const { ChatIntegrationService } = await Promise.resolve().then(() => __importStar(require('./integrations/chat-integration.service')));
|
|
317
362
|
await di_1.Container.get(ChatIntegrationService)
|
|
318
363
|
.syncToConfig(agent, [], credentialIntegrations)
|
|
@@ -321,6 +366,10 @@ let AgentsService = class AgentsService {
|
|
|
321
366
|
error,
|
|
322
367
|
}));
|
|
323
368
|
}
|
|
369
|
+
const { AgentTaskService } = await Promise.resolve().then(() => __importStar(require('./agent-task.service')));
|
|
370
|
+
await di_1.Container.get(AgentTaskService)
|
|
371
|
+
.requestReconcile(agentId)
|
|
372
|
+
.catch((error) => this.logger.warn('Failed to register agent tasks on publish', { agentId, error }));
|
|
324
373
|
this.logger.debug('Published SDK agent', { agentId, projectId, userId: user.id });
|
|
325
374
|
return agent;
|
|
326
375
|
}
|
|
@@ -333,17 +382,15 @@ let AgentsService = class AgentsService {
|
|
|
333
382
|
agent.activeVersionId = null;
|
|
334
383
|
agent.activeVersion = null;
|
|
335
384
|
agent.versionId = (0, uuid_1.v4)();
|
|
336
|
-
const hasActiveSchedule = (agent.integrations ?? []).some((integration) => (0, api_types_1.isAgentScheduleIntegration)(integration) && integration.active);
|
|
337
|
-
if (hasActiveSchedule) {
|
|
338
|
-
agent.integrations = (agent.integrations ?? []).map((integration) => (0, api_types_1.isAgentScheduleIntegration)(integration) ? { ...integration, active: false } : integration);
|
|
339
|
-
}
|
|
340
385
|
await trx.save(agent);
|
|
341
386
|
});
|
|
342
387
|
this.clearRuntimes(agentId);
|
|
343
388
|
const { ChatIntegrationService } = await Promise.resolve().then(() => __importStar(require('./integrations/chat-integration.service')));
|
|
344
389
|
await di_1.Container.get(ChatIntegrationService).disconnect(agentId);
|
|
345
|
-
const {
|
|
346
|
-
di_1.Container.get(
|
|
390
|
+
const { AgentTaskService } = await Promise.resolve().then(() => __importStar(require('./agent-task.service')));
|
|
391
|
+
await di_1.Container.get(AgentTaskService)
|
|
392
|
+
.requestReconcile(agentId)
|
|
393
|
+
.catch((error) => this.logger.warn('Failed to stop agent tasks on unpublish', { agentId, error }));
|
|
347
394
|
this.logger.debug('Unpublished SDK agent', { agentId, projectId });
|
|
348
395
|
return agent;
|
|
349
396
|
}
|
|
@@ -366,24 +413,80 @@ let AgentsService = class AgentsService {
|
|
|
366
413
|
agent.description = agent.schema.description ?? null;
|
|
367
414
|
}
|
|
368
415
|
await trx.save(agent);
|
|
416
|
+
await this.restoreTasksFromSnapshot(trx, agentId, activeVersion.versionId);
|
|
369
417
|
});
|
|
370
418
|
this.clearRuntimes(agentId);
|
|
371
419
|
this.logger.debug('Reverted SDK agent to published version', { agentId, projectId });
|
|
372
420
|
return agent;
|
|
373
421
|
}
|
|
422
|
+
async revertToVersion(agentId, projectId, versionId) {
|
|
423
|
+
const agent = await this.agentRepository.findByIdAndProjectId(agentId, projectId);
|
|
424
|
+
if (!agent) {
|
|
425
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
426
|
+
}
|
|
427
|
+
await this.agentRepository.manager.transaction(async (trx) => {
|
|
428
|
+
const target = await this.agentHistoryRepository.findByVersionAndAgentId(versionId, agentId, trx);
|
|
429
|
+
if (!target) {
|
|
430
|
+
throw new not_found_error_1.NotFoundError(`Version "${versionId}" not found`);
|
|
431
|
+
}
|
|
432
|
+
agent.schema = target.schema ? (0, n8n_workflow_1.deepCopy)(target.schema) : null;
|
|
433
|
+
agent.tools = (0, n8n_workflow_1.deepCopy)(target.tools ?? {});
|
|
434
|
+
agent.skills = (0, n8n_workflow_1.deepCopy)(target.skills ?? {});
|
|
435
|
+
agent.versionId = (0, uuid_1.v4)();
|
|
436
|
+
if (agent.schema) {
|
|
437
|
+
agent.name = agent.schema.name;
|
|
438
|
+
agent.description = agent.schema.description ?? null;
|
|
439
|
+
}
|
|
440
|
+
await trx.save(agent);
|
|
441
|
+
});
|
|
442
|
+
this.clearRuntimes(agentId);
|
|
443
|
+
this.logger.debug('Reverted SDK agent to a specific version', {
|
|
444
|
+
agentId,
|
|
445
|
+
projectId,
|
|
446
|
+
versionId,
|
|
447
|
+
});
|
|
448
|
+
return agent;
|
|
449
|
+
}
|
|
450
|
+
async hasPublishHistory(agentId) {
|
|
451
|
+
return await this.agentHistoryRepository.existsForAgent(agentId);
|
|
452
|
+
}
|
|
453
|
+
async listPublishHistory(agentId, projectId, take, skip) {
|
|
454
|
+
const agent = await this.agentRepository.findByIdAndProjectId(agentId, projectId);
|
|
455
|
+
if (!agent) {
|
|
456
|
+
throw new not_found_error_1.NotFoundError(`Agent "${agentId}" not found`);
|
|
457
|
+
}
|
|
458
|
+
const versions = await this.agentHistoryRepository.findByAgentId(agentId, take, skip);
|
|
459
|
+
return versions.map((v) => ({
|
|
460
|
+
versionId: v.versionId,
|
|
461
|
+
agentId: v.agentId,
|
|
462
|
+
createdAt: v.createdAt.toISOString(),
|
|
463
|
+
updatedAt: v.updatedAt.toISOString(),
|
|
464
|
+
author: v.author,
|
|
465
|
+
isActive: v.versionId === agent.activeVersionId,
|
|
466
|
+
}));
|
|
467
|
+
}
|
|
374
468
|
async delete(agentId, projectId) {
|
|
375
469
|
const agent = await this.agentRepository.findByIdAndProjectId(agentId, projectId);
|
|
376
470
|
if (!agent) {
|
|
377
471
|
return false;
|
|
378
472
|
}
|
|
473
|
+
try {
|
|
474
|
+
await this.agentKnowledgeService.deleteAllFilesForAgent(agentId);
|
|
475
|
+
}
|
|
476
|
+
catch (error) {
|
|
477
|
+
this.logger.warn('Failed to delete knowledge files on agent delete', {
|
|
478
|
+
agentId,
|
|
479
|
+
error: error instanceof Error ? error.message : error,
|
|
480
|
+
});
|
|
481
|
+
}
|
|
379
482
|
await this.agentRepository.remove(agent);
|
|
380
483
|
this.clearRuntimes(agentId);
|
|
381
484
|
try {
|
|
382
|
-
const {
|
|
383
|
-
di_1.Container.get(
|
|
485
|
+
const { AgentTaskService } = await Promise.resolve().then(() => __importStar(require('./agent-task.service')));
|
|
486
|
+
await di_1.Container.get(AgentTaskService).requestReconcile(agentId);
|
|
384
487
|
}
|
|
385
488
|
catch (error) {
|
|
386
|
-
this.logger.warn('Failed to stop
|
|
489
|
+
this.logger.warn('Failed to stop tasks on agent delete', {
|
|
387
490
|
agentId,
|
|
388
491
|
error: error instanceof Error ? error.message : error,
|
|
389
492
|
});
|
|
@@ -478,32 +581,45 @@ let AgentsService = class AgentsService {
|
|
|
478
581
|
};
|
|
479
582
|
}
|
|
480
583
|
async injectRuntimeDependencies(params) {
|
|
481
|
-
const { agent, agentId, projectId, credentialProvider, nodeToolsEnabled, integrationType } = params;
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
agent.tool(createGetEnvironmentTool());
|
|
485
|
-
}
|
|
486
|
-
catch (toolError) {
|
|
487
|
-
this.logger.warn('Failed to inject get_environment tool', {
|
|
488
|
-
agentId,
|
|
489
|
-
error: toolError instanceof Error ? toolError.message : String(toolError),
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
const integration = integrationType
|
|
493
|
-
? di_1.Container.get(agent_chat_integration_1.ChatIntegrationRegistry).get(integrationType)
|
|
494
|
-
: undefined;
|
|
495
|
-
if (integration?.supportedComponents !== undefined) {
|
|
584
|
+
const { agent, agentId, projectId, credentialProvider, nodeToolsEnabled, credentialIntegrations, integrationType, } = params;
|
|
585
|
+
agent.tool((0, environment_tool_1.createGetEnvironmentTool)());
|
|
586
|
+
if (this.isKnowledgeBaseModuleEnabled()) {
|
|
496
587
|
try {
|
|
497
|
-
const {
|
|
498
|
-
agent.tool(
|
|
588
|
+
const { createSearchKnowledgeTool } = await Promise.resolve().then(() => __importStar(require('./tools/knowledge/tool')));
|
|
589
|
+
agent.tool(createSearchKnowledgeTool({
|
|
590
|
+
agentId,
|
|
591
|
+
projectId,
|
|
592
|
+
knowledgeService: this.agentKnowledgeService,
|
|
593
|
+
commandService: this.agentKnowledgeCommandService,
|
|
594
|
+
}));
|
|
499
595
|
}
|
|
500
596
|
catch (toolError) {
|
|
501
|
-
this.logger.warn('Failed to inject
|
|
597
|
+
this.logger.warn('Failed to inject search_knowledge tool', {
|
|
502
598
|
agentId,
|
|
503
599
|
error: toolError instanceof Error ? toolError.message : String(toolError),
|
|
504
600
|
});
|
|
505
601
|
}
|
|
506
602
|
}
|
|
603
|
+
const integrationRegistry = di_1.Container.get(agent_chat_integration_1.ChatIntegrationRegistry);
|
|
604
|
+
const integration = integrationType ? integrationRegistry.get(integrationType) : undefined;
|
|
605
|
+
if (integration?.supportedComponents !== undefined) {
|
|
606
|
+
agent.tool((0, rich_interaction_tool_1.createRichInteractionTool)(integrationType));
|
|
607
|
+
}
|
|
608
|
+
if (credentialIntegrations.length > 0) {
|
|
609
|
+
const messageContextStore = di_1.Container.get(integration_message_context_service_1.IntegrationMessageContextService);
|
|
610
|
+
const actionExecutor = di_1.Container.get(integration_action_executor_1.ChatIntegrationActionExecutor);
|
|
611
|
+
const queryExecutor = di_1.Container.get(integration_context_query_executor_1.ChatIntegrationContextQueryExecutor);
|
|
612
|
+
for (const descriptor of (0, integration_tools_1.getIntegrationToolConnectionDescriptors)(credentialIntegrations, agentId, (integrationConfig) => {
|
|
613
|
+
const integrationDef = integrationRegistry.get(integrationConfig.type);
|
|
614
|
+
return {
|
|
615
|
+
contextQueries: integrationDef?.contextQueries,
|
|
616
|
+
actions: integrationDef?.actions,
|
|
617
|
+
};
|
|
618
|
+
})) {
|
|
619
|
+
agent.tool((0, integration_tools_1.createIntegrationContextTool)({ descriptor, messageContextStore, queryExecutor }));
|
|
620
|
+
agent.tool((0, integration_tools_1.createIntegrationActionTool)({ descriptor, messageContextStore, actionExecutor }));
|
|
621
|
+
}
|
|
622
|
+
}
|
|
507
623
|
if (nodeToolsEnabled) {
|
|
508
624
|
this.attachNodeToolChain(agent, credentialProvider, projectId);
|
|
509
625
|
}
|
|
@@ -590,9 +706,12 @@ let AgentsService = class AgentsService {
|
|
|
590
706
|
missing.push('model');
|
|
591
707
|
}
|
|
592
708
|
let credentialList;
|
|
593
|
-
const
|
|
709
|
+
const findCredential = async (credentialId) => {
|
|
594
710
|
credentialList ??= await credentialProvider.list();
|
|
595
|
-
return credentialList.
|
|
711
|
+
return credentialList.find((credential) => credential.id === credentialId);
|
|
712
|
+
};
|
|
713
|
+
const credentialExists = async (credentialId) => {
|
|
714
|
+
return (await findCredential(credentialId)) !== undefined;
|
|
596
715
|
};
|
|
597
716
|
if (!config.credential?.trim()) {
|
|
598
717
|
missing.push('credential');
|
|
@@ -607,20 +726,67 @@ let AgentsService = class AgentsService {
|
|
|
607
726
|
}
|
|
608
727
|
}
|
|
609
728
|
const episodicMemory = config.memory?.episodicMemory;
|
|
610
|
-
if (config.memory?.enabled
|
|
729
|
+
if (config.memory?.enabled) {
|
|
611
730
|
try {
|
|
612
|
-
|
|
613
|
-
|
|
731
|
+
await this.validateMemoryWorkerModel(config.memory.observationalMemory?.observerModel, 'memory.observationalMemory.observerModel', findCredential, missing);
|
|
732
|
+
await this.validateMemoryWorkerModel(config.memory.observationalMemory?.reflectorModel, 'memory.observationalMemory.reflectorModel', findCredential, missing);
|
|
733
|
+
if (episodicMemory?.enabled === true) {
|
|
734
|
+
if (!(await credentialExists(episodicMemory.credential.trim()))) {
|
|
735
|
+
missing.push('episodicMemory.credential');
|
|
736
|
+
}
|
|
737
|
+
await this.validateMemoryWorkerModel(episodicMemory.extractorModel, 'memory.episodicMemory.extractorModel', findCredential, missing);
|
|
738
|
+
await this.validateMemoryWorkerModel(episodicMemory.reflectorModel, 'memory.episodicMemory.reflectorModel', findCredential, missing);
|
|
614
739
|
}
|
|
615
740
|
}
|
|
616
741
|
catch {
|
|
617
742
|
}
|
|
618
743
|
}
|
|
744
|
+
const webSearch = config.config?.webSearch;
|
|
745
|
+
if (webSearch?.enabled &&
|
|
746
|
+
(webSearch.provider === 'brave' || webSearch.provider === 'searxng')) {
|
|
747
|
+
const webSearchCredentialId = webSearch.credential?.trim();
|
|
748
|
+
if (!webSearchCredentialId) {
|
|
749
|
+
missing.push('webSearch.credential');
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
try {
|
|
753
|
+
if (!(await credentialExists(webSearchCredentialId))) {
|
|
754
|
+
missing.push('webSearch.credential');
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
catch {
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
619
761
|
missing.push(...this.agentSkillsService
|
|
620
762
|
.getMissingSkillIds(config, agentEntity.skills ?? {})
|
|
621
763
|
.map((skillId) => `skill:${skillId}`));
|
|
622
764
|
return { missing };
|
|
623
765
|
}
|
|
766
|
+
async validateMemoryWorkerModel(modelConfig, path, findCredential, missing) {
|
|
767
|
+
if (modelConfig === undefined || modelConfig === null)
|
|
768
|
+
return;
|
|
769
|
+
if (typeof modelConfig === 'string') {
|
|
770
|
+
missing.push(`${path}.credential`);
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
if (!modelConfig.model?.trim() || !api_types_1.AgentModelSchema.safeParse(modelConfig.model).success) {
|
|
774
|
+
missing.push(`${path}.model`);
|
|
775
|
+
}
|
|
776
|
+
const credentialId = modelConfig.credential?.trim();
|
|
777
|
+
if (!credentialId) {
|
|
778
|
+
missing.push(`${path}.credential`);
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
const credential = await findCredential(credentialId);
|
|
782
|
+
if (!credential ||
|
|
783
|
+
!this.workerCredentialSupportsModel(credential.type, modelConfig.model ?? '')) {
|
|
784
|
+
missing.push(`${path}.credential`);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
workerCredentialSupportsModel(credentialType, model) {
|
|
788
|
+
return llm_provider_defaults_1.LLM_PROVIDER_DEFAULTS[credentialType]?.provider === getProviderPrefix(model);
|
|
789
|
+
}
|
|
624
790
|
async *executeForChat(config) {
|
|
625
791
|
const { agentId, projectId, message, userId, memory } = config;
|
|
626
792
|
const runtime = await this.getRuntime({ agentId, projectId, n8nUserId: userId });
|
|
@@ -669,12 +835,12 @@ let AgentsService = class AgentsService {
|
|
|
669
835
|
source: integrationType,
|
|
670
836
|
});
|
|
671
837
|
}
|
|
672
|
-
async *
|
|
673
|
-
const { agentId, projectId, message, memory } = config;
|
|
838
|
+
async *executeForTaskPublished(config) {
|
|
839
|
+
const { agentId, projectId, message, memory, taskId, taskVersionId } = config;
|
|
674
840
|
const runtime = await this.getRuntime({
|
|
675
841
|
agentId,
|
|
676
842
|
projectId,
|
|
677
|
-
integrationType:
|
|
843
|
+
integrationType: 'task',
|
|
678
844
|
usePublishedVersion: true,
|
|
679
845
|
});
|
|
680
846
|
yield* this.streamChatResponse({
|
|
@@ -684,11 +850,28 @@ let AgentsService = class AgentsService {
|
|
|
684
850
|
message,
|
|
685
851
|
memory,
|
|
686
852
|
projectId: runtime.projectId,
|
|
687
|
-
source:
|
|
853
|
+
source: 'task',
|
|
854
|
+
taskId,
|
|
855
|
+
taskVersionId,
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
async *executeForTaskNow(config) {
|
|
859
|
+
const { agentId, projectId, userId, message, memory, taskId } = config;
|
|
860
|
+
const runtime = await this.getRuntime({ agentId, projectId, n8nUserId: userId });
|
|
861
|
+
yield* this.streamChatResponse({
|
|
862
|
+
agentInstance: runtime.agent,
|
|
863
|
+
toolRegistry: runtime.toolRegistry,
|
|
864
|
+
agentId,
|
|
865
|
+
userId,
|
|
866
|
+
message,
|
|
867
|
+
memory,
|
|
868
|
+
projectId: runtime.projectId,
|
|
869
|
+
source: 'task',
|
|
870
|
+
taskId,
|
|
688
871
|
});
|
|
689
872
|
}
|
|
690
873
|
async *streamChatResponse(config) {
|
|
691
|
-
const { agentInstance, toolRegistry, agentId, userId, message, memory, projectId, source } = config;
|
|
874
|
+
const { agentInstance, toolRegistry, agentId, userId, message, memory, projectId, source, taskId, taskVersionId, } = config;
|
|
692
875
|
const { threadId, resourceId } = memory;
|
|
693
876
|
const recorder = new execution_recorder_1.ExecutionRecorder(toolRegistry);
|
|
694
877
|
const resultStream = await agentInstance.stream(message, {
|
|
@@ -731,6 +914,8 @@ let AgentsService = class AgentsService {
|
|
|
731
914
|
record: messageRecord,
|
|
732
915
|
hitlStatus: recorder.suspended ? 'suspended' : undefined,
|
|
733
916
|
source,
|
|
917
|
+
taskId,
|
|
918
|
+
taskVersionId,
|
|
734
919
|
})
|
|
735
920
|
.catch((error) => {
|
|
736
921
|
this.logger.warn('Failed to record agent execution', {
|
|
@@ -873,6 +1058,15 @@ let AgentsService = class AgentsService {
|
|
|
873
1058
|
error: 'config.nodeTools.enabled requires the node-tools-searcher agents module to be enabled.',
|
|
874
1059
|
};
|
|
875
1060
|
}
|
|
1061
|
+
const mcpServers = config.mcpServers ?? [];
|
|
1062
|
+
for (const server of mcpServers) {
|
|
1063
|
+
if (server.authentication !== 'none' && !server.credential) {
|
|
1064
|
+
return {
|
|
1065
|
+
valid: false,
|
|
1066
|
+
error: `MCP server "${server.name}" requires a credential when authentication is not "none".`,
|
|
1067
|
+
};
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
876
1070
|
try {
|
|
877
1071
|
this.validateNodeToolExpressions(config);
|
|
878
1072
|
}
|
|
@@ -905,6 +1099,18 @@ let AgentsService = class AgentsService {
|
|
|
905
1099
|
throw new n8n_workflow_1.UserError(`Invalid agent config: ${result.error}`);
|
|
906
1100
|
}
|
|
907
1101
|
this.validateConfigRefs(result.config, entity);
|
|
1102
|
+
const tasksProvided = result.config.tasks !== undefined;
|
|
1103
|
+
const existingTaskIds = tasksProvided
|
|
1104
|
+
? (await this.agentTaskRepository.findByAgentId(agentId)).map((task) => task.id)
|
|
1105
|
+
: [];
|
|
1106
|
+
if (tasksProvided) {
|
|
1107
|
+
const existingTaskIdSet = new Set(existingTaskIds);
|
|
1108
|
+
for (const ref of result.config.tasks ?? []) {
|
|
1109
|
+
if (!existingTaskIdSet.has(ref.id)) {
|
|
1110
|
+
throw new n8n_workflow_1.UserError(`Invalid agent config: Missing task body: ${ref.id}`);
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
908
1114
|
const previousIntegrations = entity.integrations ?? [];
|
|
909
1115
|
const previousSchema = entity.schema ?? null;
|
|
910
1116
|
const integrationsProvided = result.config.integrations !== undefined;
|
|
@@ -915,6 +1121,7 @@ let AgentsService = class AgentsService {
|
|
|
915
1121
|
const memoryProvided = result.config.memory !== undefined;
|
|
916
1122
|
const providerToolsProvided = result.config.providerTools !== undefined;
|
|
917
1123
|
const configBlockProvided = result.config.config !== undefined;
|
|
1124
|
+
const mcpServersProvided = result.config.mcpServers !== undefined;
|
|
918
1125
|
const { schemaConfig: decomposedSchema, integrations: decomposedIntegrations } = (0, agent_config_composition_1.decomposeJsonConfig)(result.config);
|
|
919
1126
|
const nextIntegrations = integrationsProvided ? decomposedIntegrations : previousIntegrations;
|
|
920
1127
|
const nextSchema = {
|
|
@@ -927,8 +1134,10 @@ let AgentsService = class AgentsService {
|
|
|
927
1134
|
...(memoryProvided ? { memory: decomposedSchema.memory } : {}),
|
|
928
1135
|
...(toolsProvided ? { tools: decomposedSchema.tools } : {}),
|
|
929
1136
|
...(skillsProvided ? { skills: decomposedSchema.skills } : {}),
|
|
1137
|
+
...(tasksProvided ? { tasks: decomposedSchema.tasks } : {}),
|
|
930
1138
|
...(providerToolsProvided ? { providerTools: decomposedSchema.providerTools } : {}),
|
|
931
1139
|
...(configBlockProvided ? { config: decomposedSchema.config } : {}),
|
|
1140
|
+
...(mcpServersProvided ? { mcpServers: decomposedSchema.mcpServers } : {}),
|
|
932
1141
|
};
|
|
933
1142
|
entity.schema = nextSchema;
|
|
934
1143
|
entity.name = result.config.name;
|
|
@@ -955,6 +1164,13 @@ let AgentsService = class AgentsService {
|
|
|
955
1164
|
this.clearRuntimes(agentId);
|
|
956
1165
|
const saved = await this.agentRepository.save(entity);
|
|
957
1166
|
this.logger.debug('Updated agent JSON config', { agentId, projectId });
|
|
1167
|
+
if (tasksProvided) {
|
|
1168
|
+
const referencedTaskIds = new Set((result.config.tasks ?? []).map((ref) => ref.id));
|
|
1169
|
+
const orphanTaskIds = existingTaskIds.filter((id) => !referencedTaskIds.has(id));
|
|
1170
|
+
if (orphanTaskIds.length > 0) {
|
|
1171
|
+
await this.agentTaskRepository.delete(orphanTaskIds);
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
958
1174
|
if (integrationsProvided) {
|
|
959
1175
|
await (0, integrations_sync_1.syncAgentIntegrations)(saved, previousIntegrations, nextIntegrations, this.logger);
|
|
960
1176
|
}
|
|
@@ -964,43 +1180,41 @@ let AgentsService = class AgentsService {
|
|
|
964
1180
|
versionId: saved.versionId,
|
|
965
1181
|
};
|
|
966
1182
|
}
|
|
967
|
-
async saveCredentialIntegration(agent, integration) {
|
|
968
|
-
const parseResult = api_types_1.
|
|
1183
|
+
async saveCredentialIntegration(agent, integration, options = {}) {
|
|
1184
|
+
const parseResult = api_types_1.AgentIntegrationSchema.safeParse(integration);
|
|
969
1185
|
if (!parseResult.success) {
|
|
970
1186
|
throw new n8n_workflow_1.UserError(`Invalid credential integration: ${parseResult.error.message}`);
|
|
971
1187
|
}
|
|
972
1188
|
const validated = parseResult.data;
|
|
973
1189
|
const { type, credentialId } = validated;
|
|
974
1190
|
const existing = agent.integrations ?? [];
|
|
975
|
-
const alreadyExists = existing.some((i) =>
|
|
1191
|
+
const alreadyExists = existing.some((i) => i.type === type && i.credentialId === credentialId);
|
|
976
1192
|
agent.integrations = alreadyExists
|
|
977
|
-
? existing.map((existingIntegration) =>
|
|
978
|
-
existingIntegration.type === type &&
|
|
979
|
-
existingIntegration.credentialId === credentialId
|
|
1193
|
+
? existing.map((existingIntegration) => existingIntegration.type === type && existingIntegration.credentialId === credentialId
|
|
980
1194
|
? validated
|
|
981
1195
|
: existingIntegration)
|
|
982
1196
|
: [...existing, validated];
|
|
1197
|
+
(0, agent_draft_utils_1.markAgentDraftDirty)(agent);
|
|
1198
|
+
this.clearRuntimes(agent.id);
|
|
983
1199
|
const result = await this.agentRepository.save(agent);
|
|
984
|
-
|
|
1200
|
+
if (options.broadcast !== false) {
|
|
1201
|
+
await this.chatIntegrationService.broadcastIntegrationChange(agent.id, integration, 'connect');
|
|
1202
|
+
}
|
|
985
1203
|
return result;
|
|
986
1204
|
}
|
|
987
1205
|
async removeCredentialIntegration(agent, type, credentialId) {
|
|
988
1206
|
if (!agent.integrations?.length)
|
|
989
1207
|
return agent;
|
|
990
|
-
const integration = agent.integrations.find((i) =>
|
|
1208
|
+
const integration = agent.integrations.find((i) => i.type === type && i.credentialId === credentialId);
|
|
991
1209
|
if (!integration)
|
|
992
1210
|
return agent;
|
|
993
1211
|
agent.integrations = agent.integrations.filter((i) => i !== integration);
|
|
1212
|
+
(0, agent_draft_utils_1.markAgentDraftDirty)(agent);
|
|
1213
|
+
this.clearRuntimes(agent.id);
|
|
994
1214
|
const result = await this.agentRepository.save(agent);
|
|
995
1215
|
await this.chatIntegrationService.broadcastIntegrationChange(agent.id, integration, 'disconnect');
|
|
996
1216
|
return result;
|
|
997
1217
|
}
|
|
998
|
-
validateIntegrationRefs(integrations, agent) {
|
|
999
|
-
const activeUnpublishedSchedule = integrations.some((integration) => (0, api_types_1.isAgentScheduleIntegration)(integration) && integration.active);
|
|
1000
|
-
if (activeUnpublishedSchedule && !agent.activeVersionId) {
|
|
1001
|
-
throw new n8n_workflow_1.UserError('Invalid agent config: schedule integration cannot be active until the agent is published');
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
1218
|
async buildCustomTool(agentId, projectId, code, descriptor) {
|
|
1005
1219
|
const entity = await this.agentRepository.findByIdAndProjectId(agentId, projectId);
|
|
1006
1220
|
if (!entity)
|
|
@@ -1089,7 +1303,6 @@ let AgentsService = class AgentsService {
|
|
|
1089
1303
|
if (missingToolIds.length > 0) {
|
|
1090
1304
|
throw new n8n_workflow_1.UserError(`Invalid agent config: Missing custom tool definitions: ${missingToolIds.join(', ')}`);
|
|
1091
1305
|
}
|
|
1092
|
-
this.validateIntegrationRefs(config.integrations ?? [], entity);
|
|
1093
1306
|
}
|
|
1094
1307
|
getMissingCustomToolIds(config, tools) {
|
|
1095
1308
|
const refs = (config?.tools ?? []).filter((ref) => ref.type === 'custom');
|
|
@@ -1121,6 +1334,61 @@ let AgentsService = class AgentsService {
|
|
|
1121
1334
|
}
|
|
1122
1335
|
return snapshot;
|
|
1123
1336
|
}
|
|
1337
|
+
async snapshotConfiguredTasks(trx, versionId, agentId, config) {
|
|
1338
|
+
if (!config)
|
|
1339
|
+
return;
|
|
1340
|
+
const refs = config.tasks ?? [];
|
|
1341
|
+
if (refs.length === 0)
|
|
1342
|
+
return;
|
|
1343
|
+
const bodies = await trx.getRepository(agent_task_entity_1.AgentTask).findBy({ agentId });
|
|
1344
|
+
const byId = new Map(bodies.map((body) => [body.id, body]));
|
|
1345
|
+
const missing = refs.filter((ref) => !byId.has(ref.id)).map((ref) => ref.id);
|
|
1346
|
+
if (missing.length > 0) {
|
|
1347
|
+
throw new n8n_workflow_1.UserError(`Cannot publish agent with missing task bodies: ${missing.join(', ')}`);
|
|
1348
|
+
}
|
|
1349
|
+
await this.agentTaskSnapshotRepository.saveForVersion(refs.map((ref) => {
|
|
1350
|
+
const body = byId.get(ref.id);
|
|
1351
|
+
if (!body) {
|
|
1352
|
+
throw new n8n_workflow_1.UserError(`Cannot publish agent with missing task body: ${ref.id}`);
|
|
1353
|
+
}
|
|
1354
|
+
return {
|
|
1355
|
+
versionId,
|
|
1356
|
+
taskId: ref.id,
|
|
1357
|
+
enabled: ref.enabled,
|
|
1358
|
+
name: body.name,
|
|
1359
|
+
objective: body.objective,
|
|
1360
|
+
cronExpression: body.cronExpression,
|
|
1361
|
+
};
|
|
1362
|
+
}), trx);
|
|
1363
|
+
}
|
|
1364
|
+
async restoreTasksFromSnapshot(trx, agentId, versionId) {
|
|
1365
|
+
const repo = trx.getRepository(agent_task_entity_1.AgentTask);
|
|
1366
|
+
const existing = await repo.findBy({ agentId });
|
|
1367
|
+
const snapshots = await this.agentTaskSnapshotRepository.findByVersionId(versionId, trx);
|
|
1368
|
+
const snapshotIds = new Set(snapshots.map((snapshot) => snapshot.taskId));
|
|
1369
|
+
const orphanIds = existing.filter((row) => !snapshotIds.has(row.id)).map((row) => row.id);
|
|
1370
|
+
if (orphanIds.length > 0)
|
|
1371
|
+
await repo.delete(orphanIds);
|
|
1372
|
+
const existingIds = new Set(existing.map((row) => row.id));
|
|
1373
|
+
for (const snapshot of snapshots) {
|
|
1374
|
+
if (existingIds.has(snapshot.taskId)) {
|
|
1375
|
+
await repo.update(snapshot.taskId, {
|
|
1376
|
+
name: snapshot.name,
|
|
1377
|
+
objective: snapshot.objective,
|
|
1378
|
+
cronExpression: snapshot.cronExpression,
|
|
1379
|
+
});
|
|
1380
|
+
}
|
|
1381
|
+
else {
|
|
1382
|
+
await repo.insert({
|
|
1383
|
+
id: snapshot.taskId,
|
|
1384
|
+
agentId,
|
|
1385
|
+
name: snapshot.name,
|
|
1386
|
+
objective: snapshot.objective,
|
|
1387
|
+
cronExpression: snapshot.cronExpression,
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1124
1392
|
async reconstructFromConfig(agentEntity, credentialProvider, userId, integrationType) {
|
|
1125
1393
|
const config = agentEntity.schema;
|
|
1126
1394
|
if (!config) {
|
|
@@ -1137,6 +1405,11 @@ let AgentsService = class AgentsService {
|
|
|
1137
1405
|
const toolExecutor = this.secureRuntime.createToolExecutor(toolsByName);
|
|
1138
1406
|
const toolResolver = this.makeToolResolver(agentEntity.projectId, userId);
|
|
1139
1407
|
const resolvedTools = [];
|
|
1408
|
+
const buildMcpClient = async (server) => await (0, mcp_client_factory_1.buildMcpClientForServer)(server, {
|
|
1409
|
+
credentialProvider,
|
|
1410
|
+
oauthService: this.oauthService,
|
|
1411
|
+
projectId: agentEntity.projectId,
|
|
1412
|
+
});
|
|
1140
1413
|
const reconstructed = await (0, from_json_config_1.buildFromJson)(config, toolDescriptors, {
|
|
1141
1414
|
toolExecutor,
|
|
1142
1415
|
credentialProvider,
|
|
@@ -1148,6 +1421,7 @@ let AgentsService = class AgentsService {
|
|
|
1148
1421
|
},
|
|
1149
1422
|
skills: agentEntity.skills ?? {},
|
|
1150
1423
|
memoryFactory: this.getMemoryFactory(agentEntity.id),
|
|
1424
|
+
buildMcpClient,
|
|
1151
1425
|
});
|
|
1152
1426
|
await this.injectRuntimeDependencies({
|
|
1153
1427
|
agent: reconstructed,
|
|
@@ -1155,6 +1429,7 @@ let AgentsService = class AgentsService {
|
|
|
1155
1429
|
projectId: agentEntity.projectId,
|
|
1156
1430
|
credentialProvider,
|
|
1157
1431
|
nodeToolsEnabled: this.shouldAttachNodeTools(config.config),
|
|
1432
|
+
credentialIntegrations: agentEntity.integrations ?? [],
|
|
1158
1433
|
integrationType,
|
|
1159
1434
|
});
|
|
1160
1435
|
const toolRegistry = (0, tool_registry_1.buildToolRegistry)(resolvedTools);
|
|
@@ -1188,10 +1463,19 @@ exports.AgentsService = AgentsService = __decorate([
|
|
|
1188
1463
|
agent_execution_service_1.AgentExecutionService,
|
|
1189
1464
|
agent_history_repository_1.AgentHistoryRepository,
|
|
1190
1465
|
agent_skills_service_1.AgentSkillsService,
|
|
1466
|
+
agent_task_repository_1.AgentTaskRepository,
|
|
1467
|
+
agent_task_snapshot_repository_1.AgentTaskSnapshotRepository,
|
|
1191
1468
|
publisher_service_1.Publisher,
|
|
1192
1469
|
config_1.AgentsConfig,
|
|
1193
1470
|
config_1.GlobalConfig,
|
|
1194
1471
|
telemetry_1.Telemetry,
|
|
1195
|
-
chat_integration_service_1.ChatIntegrationService
|
|
1472
|
+
chat_integration_service_1.ChatIntegrationService,
|
|
1473
|
+
agent_knowledge_service_1.AgentKnowledgeService,
|
|
1474
|
+
agent_knowledge_command_service_1.AgentKnowledgeCommandService,
|
|
1475
|
+
oauth_service_1.OauthService])
|
|
1196
1476
|
], AgentsService);
|
|
1477
|
+
function getProviderPrefix(modelId) {
|
|
1478
|
+
const slashIdx = modelId.indexOf('/');
|
|
1479
|
+
return slashIdx === -1 ? '' : modelId.slice(0, slashIdx);
|
|
1480
|
+
}
|
|
1197
1481
|
//# sourceMappingURL=agents.service.js.map
|