n8n 2.20.6 → 2.21.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/abstract-server.d.ts +1 -0
- package/dist/abstract-server.js +10 -3
- package/dist/abstract-server.js.map +1 -1
- package/dist/agent-library-bundle.js +5989 -0
- package/dist/auth/auth.service.js +3 -3
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/execute-batch.d.ts +2 -2
- package/dist/commands/export/workflow.d.ts +2 -2
- package/dist/commands/import/workflow.d.ts +3 -0
- package/dist/commands/import/workflow.js +15 -1
- package/dist/commands/import/workflow.js.map +1 -1
- package/dist/commands/start.js +2 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +6 -1
- package/dist/constants.js.map +1 -1
- package/dist/controller.registry.js +6 -0
- package/dist/controller.registry.js.map +1 -1
- package/dist/controllers/auth.controller.js +7 -2
- package/dist/controllers/auth.controller.js.map +1 -1
- package/dist/controllers/me.controller.d.ts +1 -0
- package/dist/controllers/me.controller.js +4 -1
- package/dist/controllers/me.controller.js.map +1 -1
- package/dist/controllers/users.controller.d.ts +2 -2
- package/dist/credentials/credentials.service.d.ts +1 -0
- package/dist/credentials/credentials.service.js +11 -4
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/evaluation.ee/evaluation-api-error.d.ts +7 -0
- package/dist/evaluation.ee/evaluation-api-error.js +16 -0
- package/dist/evaluation.ee/evaluation-api-error.js.map +1 -0
- package/dist/evaluation.ee/evaluation-config-validator.d.ts +30 -0
- package/dist/evaluation.ee/evaluation-config-validator.js +236 -0
- package/dist/evaluation.ee/evaluation-config-validator.js.map +1 -0
- package/dist/evaluation.ee/evaluation-config.controller.d.ts +24 -0
- package/dist/evaluation.ee/evaluation-config.controller.js +94 -0
- package/dist/evaluation.ee/evaluation-config.controller.js.map +1 -0
- package/dist/evaluation.ee/evaluation-config.service.d.ts +18 -0
- package/dist/evaluation.ee/evaluation-config.service.js +74 -0
- package/dist/evaluation.ee/evaluation-config.service.js.map +1 -0
- package/dist/evaluation.ee/llm-judge-provider-registry.d.ts +13 -0
- package/dist/evaluation.ee/llm-judge-provider-registry.js +122 -0
- package/dist/evaluation.ee/llm-judge-provider-registry.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 +32 -10
- 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 +22 -0
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.js +285 -0
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.js.map +1 -0
- package/dist/evaluation.ee/test-runs.controller.ee.d.ts +3 -0
- package/dist/evaluation.ee/test-runs.controller.ee.js +26 -9
- package/dist/evaluation.ee/test-runs.controller.ee.js.map +1 -1
- package/dist/evaluation.ee/test-runs.types.ee.d.ts +3 -0
- package/dist/eventbus/message-event-bus/message-event-bus.d.ts +2 -0
- package/dist/eventbus/message-event-bus/message-event-bus.js +54 -46
- package/dist/eventbus/message-event-bus/message-event-bus.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +3 -0
- package/dist/instance-settings-loader/instance-settings-loader.service.d.ts +4 -2
- package/dist/instance-settings-loader/instance-settings-loader.service.js +7 -3
- package/dist/instance-settings-loader/instance-settings-loader.service.js.map +1 -1
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.d.ts +20 -0
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.js +235 -0
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.js.map +1 -0
- package/dist/instance-settings-loader/loaders/{sso.instance-settings-loader.d.ts → sso/oidc.instance-settings-loader.d.ts} +4 -10
- package/dist/instance-settings-loader/loaders/sso/oidc.instance-settings-loader.js +98 -0
- package/dist/instance-settings-loader/loaders/sso/oidc.instance-settings-loader.js.map +1 -0
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.d.ts +10 -0
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js +65 -0
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js.map +1 -0
- package/dist/instance-settings-loader/loaders/sso/saml.instance-settings-loader.d.ts +12 -0
- package/dist/instance-settings-loader/loaders/sso/saml.instance-settings-loader.js +75 -0
- package/dist/instance-settings-loader/loaders/sso/saml.instance-settings-loader.js.map +1 -0
- package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.d.ts +15 -0
- package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.js +75 -0
- package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.js.map +1 -0
- package/dist/load-nodes-and-credentials.d.ts +3 -3
- package/dist/load-nodes-and-credentials.js +25 -17
- package/dist/load-nodes-and-credentials.js.map +1 -1
- package/dist/modules/agents/adapters/agents-credential-provider.d.ts +12 -0
- package/dist/modules/agents/adapters/agents-credential-provider.js +63 -0
- package/dist/modules/agents/adapters/agents-credential-provider.js.map +1 -0
- package/dist/modules/agents/agent-execution.service.d.ts +42 -0
- package/dist/modules/agents/agent-execution.service.js +153 -0
- package/dist/modules/agents/agent-execution.service.js.map +1 -0
- package/dist/modules/agents/agent-message-mapper.d.ts +5 -0
- package/dist/modules/agents/agent-message-mapper.js +43 -0
- package/dist/modules/agents/agent-message-mapper.js.map +1 -0
- package/dist/modules/agents/agent-skills.service.d.ts +24 -0
- package/dist/modules/agents/agent-skills.service.js +166 -0
- package/dist/modules/agents/agent-skills.service.js.map +1 -0
- package/dist/modules/agents/agent-sse-stream.d.ts +15 -0
- package/dist/modules/agents/agent-sse-stream.js +194 -0
- package/dist/modules/agents/agent-sse-stream.js.map +1 -0
- package/dist/modules/agents/agents-tools.service.d.ts +18 -0
- package/dist/modules/agents/agents-tools.service.js +193 -0
- package/dist/modules/agents/agents-tools.service.js.map +1 -0
- package/dist/modules/agents/agents.controller.d.ts +260 -0
- package/dist/modules/agents/agents.controller.js +818 -0
- package/dist/modules/agents/agents.controller.js.map +1 -0
- package/dist/modules/agents/agents.module.d.ts +12 -0
- package/dist/modules/agents/agents.module.js +136 -0
- package/dist/modules/agents/agents.module.js.map +1 -0
- package/dist/modules/agents/agents.service.d.ts +151 -0
- package/dist/modules/agents/agents.service.js +1134 -0
- package/dist/modules/agents/agents.service.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder-prompts.d.ts +27 -0
- package/dist/modules/agents/builder/agents-builder-prompts.js +584 -0
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder-settings.controller.d.ts +11 -0
- package/dist/modules/agents/builder/agents-builder-settings.controller.js +61 -0
- package/dist/modules/agents/builder/agents-builder-settings.controller.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder-settings.service.d.ts +31 -0
- package/dist/modules/agents/builder/agents-builder-settings.service.js +199 -0
- package/dist/modules/agents/builder/agents-builder-settings.service.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +31 -0
- package/dist/modules/agents/builder/agents-builder-tools.service.js +420 -0
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder.service.d.ts +26 -0
- package/dist/modules/agents/builder/agents-builder.service.js +164 -0
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -0
- package/dist/modules/agents/builder/builder-model-lookup.service.d.ts +17 -0
- package/dist/modules/agents/builder/builder-model-lookup.service.js +67 -0
- package/dist/modules/agents/builder/builder-model-lookup.service.js.map +1 -0
- package/dist/modules/agents/builder/builder-tool-names.d.ts +14 -0
- package/dist/modules/agents/builder/builder-tool-names.js +17 -0
- package/dist/modules/agents/builder/builder-tool-names.js.map +1 -0
- package/dist/modules/agents/builder/errors.d.ts +6 -0
- package/dist/modules/agents/builder/errors.js +13 -0
- package/dist/modules/agents/builder/errors.js.map +1 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.d.ts +5 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js +29 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -0
- package/dist/modules/agents/builder/interactive/ask-llm.tool.d.ts +2 -0
- package/dist/modules/agents/builder/interactive/ask-llm.tool.js +27 -0
- package/dist/modules/agents/builder/interactive/ask-llm.tool.js.map +1 -0
- package/dist/modules/agents/builder/interactive/ask-question.tool.d.ts +2 -0
- package/dist/modules/agents/builder/interactive/ask-question.tool.js +26 -0
- package/dist/modules/agents/builder/interactive/ask-question.tool.js.map +1 -0
- package/dist/modules/agents/builder/interactive/index.d.ts +4 -0
- package/dist/modules/agents/builder/interactive/index.js +12 -0
- package/dist/modules/agents/builder/interactive/index.js.map +1 -0
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.d.ts +17 -0
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.js +60 -0
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.js.map +1 -0
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.d.ts +13 -0
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +136 -0
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -0
- package/dist/modules/agents/entities/agent-checkpoint.entity.d.ts +9 -0
- package/dist/modules/agents/entities/agent-checkpoint.entity.js +43 -0
- package/dist/modules/agents/entities/agent-checkpoint.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.d.ts +16 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js +74 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-execution.entity.d.ts +26 -0
- package/dist/modules/agents/entities/agent-execution.entity.js +100 -0
- package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-message.entity.d.ts +10 -0
- package/dist/modules/agents/entities/agent-message.entity.js +47 -0
- package/dist/modules/agents/entities/agent-message.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-observation-cursor.entity.d.ts +8 -0
- package/dist/modules/agents/entities/agent-observation-cursor.entity.js +37 -0
- package/dist/modules/agents/entities/agent-observation-cursor.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-observation-lock.entity.d.ts +8 -0
- package/dist/modules/agents/entities/agent-observation-lock.entity.js +37 -0
- package/dist/modules/agents/entities/agent-observation-lock.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-observation.entity.d.ts +10 -0
- package/dist/modules/agents/entities/agent-observation.entity.js +47 -0
- package/dist/modules/agents/entities/agent-observation.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-published-version.entity.d.ts +22 -0
- package/dist/modules/agents/entities/agent-published-version.entity.js +67 -0
- package/dist/modules/agents/entities/agent-published-version.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-resource.entity.d.ts +5 -0
- package/dist/modules/agents/entities/agent-resource.entity.js +29 -0
- package/dist/modules/agents/entities/agent-resource.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-thread.entity.d.ts +6 -0
- package/dist/modules/agents/entities/agent-thread.entity.js +33 -0
- package/dist/modules/agents/entities/agent-thread.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent.entity.d.ts +24 -0
- package/dist/modules/agents/entities/agent.entity.js +74 -0
- package/dist/modules/agents/entities/agent.entity.js.map +1 -0
- package/dist/modules/agents/execution-recorder.d.ts +82 -0
- package/dist/modules/agents/execution-recorder.js +272 -0
- package/dist/modules/agents/execution-recorder.js.map +1 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +62 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.js +540 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -0
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +39 -0
- package/dist/modules/agents/integrations/agent-chat-integration.js +45 -0
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -0
- package/dist/modules/agents/integrations/agent-schedule.service.d.ts +30 -0
- package/dist/modules/agents/integrations/agent-schedule.service.js +327 -0
- package/dist/modules/agents/integrations/agent-schedule.service.js.map +1 -0
- package/dist/modules/agents/integrations/callback-store.d.ts +11 -0
- package/dist/modules/agents/integrations/callback-store.js +30 -0
- package/dist/modules/agents/integrations/callback-store.js.map +1 -0
- package/dist/modules/agents/integrations/chat-integration.service.d.ts +58 -0
- package/dist/modules/agents/integrations/chat-integration.service.js +397 -0
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -0
- package/dist/modules/agents/integrations/component-mapper.d.ts +57 -0
- package/dist/modules/agents/integrations/component-mapper.js +223 -0
- package/dist/modules/agents/integrations/component-mapper.js.map +1 -0
- package/dist/modules/agents/integrations/cron-validation.d.ts +1 -0
- package/dist/modules/agents/integrations/cron-validation.js +8 -0
- package/dist/modules/agents/integrations/cron-validation.js.map +1 -0
- package/dist/modules/agents/integrations/esm-loader.d.ts +5 -0
- package/dist/modules/agents/integrations/esm-loader.js +24 -0
- package/dist/modules/agents/integrations/esm-loader.js.map +1 -0
- package/dist/modules/agents/integrations/integrations-sync.d.ts +4 -0
- package/dist/modules/agents/integrations/integrations-sync.js +78 -0
- package/dist/modules/agents/integrations/integrations-sync.js.map +1 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.d.ts +36 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +148 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -0
- package/dist/modules/agents/integrations/n8n-memory.d.ts +76 -0
- package/dist/modules/agents/integrations/n8n-memory.js +383 -0
- package/dist/modules/agents/integrations/n8n-memory.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/linear-integration.d.ts +14 -0
- package/dist/modules/agents/integrations/platforms/linear-integration.js +83 -0
- package/dist/modules/agents/integrations/platforms/linear-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.d.ts +12 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.js +81 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +30 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +122 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -0
- package/dist/modules/agents/integrations/rich-interaction-tool.d.ts +47 -0
- package/dist/modules/agents/integrations/rich-interaction-tool.js +109 -0
- package/dist/modules/agents/integrations/rich-interaction-tool.js.map +1 -0
- package/dist/modules/agents/integrations/types.d.ts +8 -0
- package/dist/modules/agents/integrations/types.js +12 -0
- package/dist/modules/agents/integrations/types.js.map +1 -0
- package/dist/modules/agents/json-config/agent-config-composition.d.ts +9 -0
- package/dist/modules/agents/json-config/agent-config-composition.js +27 -0
- package/dist/modules/agents/json-config/agent-config-composition.js.map +1 -0
- package/dist/modules/agents/json-config/agent-json-config.d.ts +1022 -0
- package/dist/modules/agents/json-config/agent-json-config.js +128 -0
- package/dist/modules/agents/json-config/agent-json-config.js.map +1 -0
- package/dist/modules/agents/json-config/credential-field-mapping.d.ts +4 -0
- package/dist/modules/agents/json-config/credential-field-mapping.js +41 -0
- package/dist/modules/agents/json-config/credential-field-mapping.js.map +1 -0
- package/dist/modules/agents/json-config/from-json-config.d.ts +18 -0
- package/dist/modules/agents/json-config/from-json-config.js +209 -0
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -0
- package/dist/modules/agents/json-config/integration-config.d.ts +61 -0
- package/dist/modules/agents/json-config/integration-config.js +33 -0
- package/dist/modules/agents/json-config/integration-config.js.map +1 -0
- package/dist/modules/agents/json-config/provider-tool-aliases.d.ts +1 -0
- package/dist/modules/agents/json-config/provider-tool-aliases.js +15 -0
- package/dist/modules/agents/json-config/provider-tool-aliases.js.map +1 -0
- package/dist/modules/agents/json-config/schema-text-serializer.d.ts +2 -0
- package/dist/modules/agents/json-config/schema-text-serializer.js +205 -0
- package/dist/modules/agents/json-config/schema-text-serializer.js.map +1 -0
- package/dist/modules/agents/repositories/agent-checkpoint.repository.d.ts +6 -0
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js +35 -0
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-execution-thread.repository.d.ts +18 -0
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js +120 -0
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-execution.repository.d.ts +10 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js +59 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-message.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-message.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-message.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-observation-cursor.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-observation-cursor.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-observation-cursor.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-observation-lock.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-observation-lock.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-observation-lock.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-observation.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-observation.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-observation.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-published-version.repository.d.ts +20 -0
- package/dist/modules/agents/repositories/agent-published-version.repository.js +35 -0
- package/dist/modules/agents/repositories/agent-published-version.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-resource.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-resource.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-resource.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-thread.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-thread.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-thread.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent.repository.d.ts +9 -0
- package/dist/modules/agents/repositories/agent.repository.js +50 -0
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -0
- package/dist/modules/agents/runtime/agent-isolate-pool.d.ts +48 -0
- package/dist/modules/agents/runtime/agent-isolate-pool.js +246 -0
- package/dist/modules/agents/runtime/agent-isolate-pool.js.map +1 -0
- package/dist/modules/agents/runtime/agent-secure-runtime.d.ts +21 -0
- package/dist/modules/agents/runtime/agent-secure-runtime.js +281 -0
- package/dist/modules/agents/runtime/agent-secure-runtime.js.map +1 -0
- package/dist/modules/agents/runtime/sandbox-polyfills.d.ts +1 -0
- package/dist/modules/agents/runtime/sandbox-polyfills.js +74 -0
- package/dist/modules/agents/runtime/sandbox-polyfills.js.map +1 -0
- package/dist/modules/agents/tool-registry.d.ts +13 -0
- package/dist/modules/agents/tool-registry.js +42 -0
- package/dist/modules/agents/tool-registry.js.map +1 -0
- package/dist/modules/agents/tools/environment-tool.d.ts +3 -0
- package/dist/modules/agents/tools/environment-tool.js +26 -0
- package/dist/modules/agents/tools/environment-tool.js.map +1 -0
- package/dist/modules/agents/tools/node-tool-factory.d.ts +10 -0
- package/dist/modules/agents/tools/node-tool-factory.js +100 -0
- package/dist/modules/agents/tools/node-tool-factory.js.map +1 -0
- package/dist/modules/agents/tools/workflow-tool-factory.d.ts +43 -0
- package/dist/modules/agents/tools/workflow-tool-factory.js +404 -0
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -0
- package/dist/modules/agents/tracing/builder-telemetry.d.ts +12 -0
- package/dist/modules/agents/tracing/builder-telemetry.js +48 -0
- package/dist/modules/agents/tracing/builder-telemetry.js.map +1 -0
- package/dist/modules/agents/types/components.d.ts +71 -0
- package/dist/modules/agents/types/components.js +3 -0
- package/dist/modules/agents/types/components.js.map +1 -0
- package/dist/modules/agents/types/index.d.ts +1 -0
- package/dist/modules/agents/types/index.js +3 -0
- package/dist/modules/agents/types/index.js.map +1 -0
- package/dist/modules/agents/utils/agent-draft.utils.d.ts +2 -0
- package/dist/modules/agents/utils/agent-draft.utils.js +11 -0
- package/dist/modules/agents/utils/agent-draft.utils.js.map +1 -0
- package/dist/modules/agents/utils/agent-resource-id.d.ts +3 -0
- package/dist/modules/agents/utils/agent-resource-id.js +14 -0
- package/dist/modules/agents/utils/agent-resource-id.js.map +1 -0
- 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 +2 -2
- package/dist/modules/chat-hub/dto/chat-models-request.dto.d.ts +1 -1
- package/dist/modules/community-packages/community-packages.config.js +2 -2
- package/dist/modules/community-packages/community-packages.config.js.map +1 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.d.ts +4 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.js +14 -2
- package/dist/modules/community-packages/community-packages.lifecycle.service.js.map +1 -1
- package/dist/modules/community-packages/community-packages.module.d.ts +1 -1
- package/dist/modules/community-packages/community-packages.module.js +10 -5
- package/dist/modules/community-packages/community-packages.module.js.map +1 -1
- package/dist/modules/data-table/data-table.service.js +6 -0
- package/dist/modules/data-table/data-table.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/slack-signature-identifier.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.d.ts +2 -0
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.js +10 -0
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +16 -4
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.d.ts +3 -3
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js +11 -3
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js.map +1 -1
- package/dist/modules/encryption-key-manager/encryption-bootstrap.service.js +4 -2
- package/dist/modules/encryption-key-manager/encryption-bootstrap.service.js.map +1 -1
- package/dist/modules/encryption-key-manager/encryption-key-manager.module.js +5 -2
- package/dist/modules/encryption-key-manager/encryption-key-manager.module.js.map +1 -1
- package/dist/modules/encryption-key-manager/encryption-key.controller.d.ts +3 -3
- package/dist/modules/encryption-key-manager/encryption-key.controller.js +8 -2
- package/dist/modules/encryption-key-manager/encryption-key.controller.js.map +1 -1
- package/dist/modules/encryption-key-manager/key-manager.service.d.ts +5 -1
- package/dist/modules/encryption-key-manager/key-manager.service.js +11 -4
- package/dist/modules/encryption-key-manager/key-manager.service.js.map +1 -1
- package/dist/modules/insights/insights-collection.service.js +1 -0
- package/dist/modules/insights/insights-collection.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-handler.js +17 -49
- package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.d.ts +1 -0
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.js +21 -3
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +3 -2
- package/dist/modules/instance-ai/instance-ai-settings.service.js +10 -9
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-test.controller.d.ts +21 -2
- package/dist/modules/instance-ai/instance-ai-test.controller.js +35 -3
- package/dist/modules/instance-ai/instance-ai-test.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +72 -42
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +2 -0
- package/dist/modules/instance-ai/instance-ai.controller.js +25 -1
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.d.ts +0 -1
- package/dist/modules/instance-ai/instance-ai.module.js +0 -2
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +34 -5
- package/dist/modules/instance-ai/instance-ai.service.js +723 -76
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/liveness/index.d.ts +1 -0
- package/dist/modules/instance-ai/liveness/index.js +7 -0
- package/dist/modules/instance-ai/liveness/index.js.map +1 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.d.ts +72 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js +123 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js.map +1 -0
- package/dist/modules/instance-ai/message-parser.js +85 -6
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js +4 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.js +1 -0
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.js.map +1 -1
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js +23 -7
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +3 -3
- package/dist/modules/mcp/mcp.service.js +12 -9
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/tools/get-execution.tool.js +6 -4
- package/dist/modules/mcp/tools/get-execution.tool.js.map +1 -1
- package/dist/modules/mcp/tools/list-credentials.tool.d.ts +40 -0
- package/dist/modules/mcp/tools/list-credentials.tool.js +148 -0
- package/dist/modules/mcp/tools/list-credentials.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +5 -4
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js +3 -3
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js +2 -2
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js +3 -2
- 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.js +3 -3
- 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 +1 -1
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js +12 -4
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js +12 -5
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +1 -2
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +1 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-validation.utils.d.ts +5 -1
- package/dist/modules/mcp/tools/workflow-validation.utils.js +4 -2
- package/dist/modules/mcp/tools/workflow-validation.utils.js.map +1 -1
- package/dist/modules/mcp-registry/mcp-registry-node-loader.d.ts +27 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.js +105 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.js.map +1 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.test.d.ts +1 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.test.js +244 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.test.js.map +1 -0
- package/dist/modules/mcp-registry/mcp-registry.module.d.ts +4 -0
- package/dist/modules/mcp-registry/mcp-registry.module.js +60 -0
- package/dist/modules/mcp-registry/mcp-registry.module.js.map +1 -0
- package/dist/modules/mcp-registry/node-description-transform.d.ts +8 -0
- package/dist/modules/mcp-registry/node-description-transform.js +133 -0
- package/dist/modules/mcp-registry/node-description-transform.js.map +1 -0
- package/dist/modules/mcp-registry/node-description-transform.test.d.ts +1 -0
- package/dist/modules/mcp-registry/node-description-transform.test.js +286 -0
- package/dist/modules/mcp-registry/node-description-transform.test.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.d.ts +8 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js +31 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.test.d.ts +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.test.js +41 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.test.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.d.ts +36 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js +3 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mock-servers.d.ts +3 -0
- package/dist/modules/mcp-registry/registry/mock-servers.js +80 -0
- package/dist/modules/mcp-registry/registry/mock-servers.js.map +1 -0
- package/dist/modules/otel/execution-level-tracer.d.ts +1 -1
- package/dist/modules/otel/execution-level-tracer.js +24 -9
- package/dist/modules/otel/execution-level-tracer.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.types.d.ts +9 -7
- package/dist/modules/otel/execution-level-tracer.types.js +14 -0
- package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
- package/dist/modules/quick-connect/quick-connect.config.d.ts +176 -0
- package/dist/modules/quick-connect/quick-connect.config.js +8 -0
- package/dist/modules/quick-connect/quick-connect.config.js.map +1 -1
- package/dist/modules/quick-connect/quick-connect.module.d.ts +15 -0
- package/dist/modules/redaction/executions/execution-redaction.service.d.ts +1 -3
- package/dist/modules/redaction/executions/execution-redaction.service.js +2 -6
- package/dist/modules/redaction/executions/execution-redaction.service.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +2 -2
- package/dist/modules/source-control.ee/source-control.service.ee.d.ts +1 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.d.ts +3 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.js +8 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.js.map +1 -1
- package/dist/node-catalog/index.d.ts +1 -0
- package/dist/node-catalog/index.js +6 -0
- package/dist/node-catalog/index.js.map +1 -0
- package/dist/{modules/mcp/tools/workflow-builder/workflow-builder-tools.service.d.ts → node-catalog/node-catalog.service.d.ts} +9 -15
- package/dist/{modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js → node-catalog/node-catalog.service.js} +38 -28
- package/dist/node-catalog/node-catalog.service.js.map +1 -0
- package/dist/node-execution/ephemeral-node-executor.d.ts +47 -0
- package/dist/node-execution/ephemeral-node-executor.js +289 -0
- package/dist/node-execution/ephemeral-node-executor.js.map +1 -0
- package/dist/node-execution/index.d.ts +2 -0
- package/dist/node-execution/index.js +8 -0
- package/dist/node-execution/index.js.map +1 -0
- package/dist/public-api/v1/handlers/audit/audit.handler.d.ts +5 -4
- package/dist/public-api/v1/handlers/audit/audit.handler.js +5 -9
- package/dist/public-api/v1/handlers/audit/audit.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.d.ts +20 -17
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.js +12 -39
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.handler.d.ts +12 -49
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js +6 -5
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.columns.handler.d.ts +8 -19
- package/dist/public-api/v1/handlers/data-tables/data-tables.columns.handler.js +11 -11
- package/dist/public-api/v1/handlers/data-tables/data-tables.columns.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.d.ts +9 -17
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js +19 -23
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.d.ts +9 -23
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js +17 -27
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/discover/discover.handler.d.ts +11 -9
- package/dist/public-api/v1/handlers/discover/discover.handler.js +5 -3
- package/dist/public-api/v1/handlers/discover/discover.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/executions/executions.handler.d.ts +12 -11
- package/dist/public-api/v1/handlers/executions/executions.handler.js +46 -80
- package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/folders/folders.handler.d.ts +12 -17
- package/dist/public-api/v1/handlers/folders/folders.handler.js +17 -20
- package/dist/public-api/v1/handlers/folders/folders.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/insights/insights.handler.d.ts +5 -4
- package/dist/public-api/v1/handlers/insights/insights.handler.js +9 -5
- package/dist/public-api/v1/handlers/insights/insights.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/projects/projects.handler.d.ts +28 -11
- package/dist/public-api/v1/handlers/projects/projects.handler.js +44 -75
- package/dist/public-api/v1/handlers/projects/projects.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/source-control/source-control.handler.d.ts +5 -6
- package/dist/public-api/v1/handlers/source-control/source-control.handler.js +3 -2
- package/dist/public-api/v1/handlers/source-control/source-control.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/tags/tags.handler.d.ts +9 -8
- package/dist/public-api/v1/handlers/tags/tags.handler.js +11 -8
- package/dist/public-api/v1/handlers/tags/tags.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/users/users.handler.ee.d.ts +14 -11
- package/dist/public-api/v1/handlers/users/users.handler.ee.js +7 -8
- package/dist/public-api/v1/handlers/users/users.handler.ee.js.map +1 -1
- package/dist/public-api/v1/handlers/variables/variables.handler.d.ts +13 -7
- package/dist/public-api/v1/handlers/variables/variables.handler.js +5 -3
- package/dist/public-api/v1/handlers/variables/variables.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.handler.d.ts +17 -49
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js +27 -46
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
- package/dist/public-api/v1/shared/handler.types.d.ts +7 -1
- package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +1 -2
- package/dist/public-api/v1/shared/middlewares/global.middleware.js +7 -6
- package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/job-processor.js +2 -0
- package/dist/scaling/job-processor.js.map +1 -1
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +9 -0
- package/dist/scaling/pubsub/pubsub.types.d.ts +3 -1
- package/dist/scaling/scaling.types.d.ts +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +2 -0
- package/dist/server.js.map +1 -1
- package/dist/services/frontend.service.js +7 -14
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/import.service.d.ts +9 -3
- package/dist/services/import.service.js +72 -5
- package/dist/services/import.service.js.map +1 -1
- package/dist/services/proxy-token-manager.js.map +1 -0
- package/dist/services/workflow-statistics.service.js +1 -0
- package/dist/services/workflow-statistics.service.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker.service.d.ts +2 -0
- package/dist/task-runners/task-broker/task-broker.service.js +13 -1
- package/dist/task-runners/task-broker/task-broker.service.js.map +1 -1
- package/dist/utils/ttl-map.d.ts +17 -0
- package/dist/utils/ttl-map.js +80 -0
- package/dist/utils/ttl-map.js.map +1 -0
- package/dist/webhooks/test-webhooks.d.ts +3 -1
- package/dist/webhooks/test-webhooks.js +11 -3
- package/dist/webhooks/test-webhooks.js.map +1 -1
- package/dist/workflow-execute-additional-data.d.ts +2 -1
- package/dist/workflow-execute-additional-data.js +34 -0
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.d.ts +1 -0
- package/dist/workflow-helpers.js +15 -0
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-runner.js +2 -0
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/workflow-creation.service.js +1 -0
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow.service.js +4 -0
- package/dist/workflows/workflow.service.js.map +1 -1
- package/package.json +40 -25
- package/dist/instance-settings-loader/loaders/sso.instance-settings-loader.js +0 -203
- package/dist/instance-settings-loader/loaders/sso.instance-settings-loader.js.map +0 -1
- package/dist/modules/instance-ai/proxy-token-manager.js.map +0 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js.map +0 -1
- /package/dist/{modules/instance-ai → services}/proxy-token-manager.d.ts +0 -0
- /package/dist/{modules/instance-ai → services}/proxy-token-manager.js +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgentObservationRepository = void 0;
|
|
13
|
+
const di_1 = require("@n8n/di");
|
|
14
|
+
const typeorm_1 = require("@n8n/typeorm");
|
|
15
|
+
const agent_observation_entity_1 = require("../entities/agent-observation.entity");
|
|
16
|
+
let AgentObservationRepository = class AgentObservationRepository extends typeorm_1.Repository {
|
|
17
|
+
constructor(dataSource) {
|
|
18
|
+
super(agent_observation_entity_1.AgentObservationEntity, dataSource.manager);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.AgentObservationRepository = AgentObservationRepository;
|
|
22
|
+
exports.AgentObservationRepository = AgentObservationRepository = __decorate([
|
|
23
|
+
(0, di_1.Service)(),
|
|
24
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
25
|
+
], AgentObservationRepository);
|
|
26
|
+
//# sourceMappingURL=agent-observation.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-observation.repository.js","sourceRoot":"","sources":["../../../../src/modules/agents/repositories/agent-observation.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAClC,0CAAsD;AAEtD,mFAA8E;AAGvE,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,oBAAkC;IACjF,YAAY,UAAsB;QACjC,KAAK,CAAC,iDAAsB,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;CACD,CAAA;AAJY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,YAAO,GAAE;qCAEe,oBAAU;GADtB,0BAA0B,CAItC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { EntityManager } from '@n8n/typeorm';
|
|
2
|
+
import { DataSource, Repository } from '@n8n/typeorm';
|
|
3
|
+
import { AgentPublishedVersion } from '../entities/agent-published-version.entity';
|
|
4
|
+
import type { Agent } from '../entities/agent.entity';
|
|
5
|
+
import type { AgentJsonConfig } from '../json-config/agent-json-config';
|
|
6
|
+
export declare class AgentPublishedVersionRepository extends Repository<AgentPublishedVersion> {
|
|
7
|
+
constructor(dataSource: DataSource);
|
|
8
|
+
savePublishedVersion(data: {
|
|
9
|
+
agentId: string;
|
|
10
|
+
schema: AgentJsonConfig | null;
|
|
11
|
+
tools: Agent['tools'] | null;
|
|
12
|
+
skills: Agent['skills'] | null;
|
|
13
|
+
publishedFromVersionId: string;
|
|
14
|
+
model: string | null;
|
|
15
|
+
provider: string | null;
|
|
16
|
+
credentialId: string | null;
|
|
17
|
+
publishedById: string;
|
|
18
|
+
}, trx?: EntityManager): Promise<AgentPublishedVersion>;
|
|
19
|
+
deleteByAgentId(agentId: string, trx?: EntityManager): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgentPublishedVersionRepository = void 0;
|
|
13
|
+
const di_1 = require("@n8n/di");
|
|
14
|
+
const typeorm_1 = require("@n8n/typeorm");
|
|
15
|
+
const agent_published_version_entity_1 = require("../entities/agent-published-version.entity");
|
|
16
|
+
let AgentPublishedVersionRepository = class AgentPublishedVersionRepository extends typeorm_1.Repository {
|
|
17
|
+
constructor(dataSource) {
|
|
18
|
+
super(agent_published_version_entity_1.AgentPublishedVersion, dataSource.manager);
|
|
19
|
+
}
|
|
20
|
+
async savePublishedVersion(data, trx) {
|
|
21
|
+
const repo = trx?.getRepository(agent_published_version_entity_1.AgentPublishedVersion) ?? this;
|
|
22
|
+
await repo.upsert({ ...data, updatedAt: new Date() }, ['agentId']);
|
|
23
|
+
return await repo.findOneByOrFail({ agentId: data.agentId });
|
|
24
|
+
}
|
|
25
|
+
async deleteByAgentId(agentId, trx) {
|
|
26
|
+
const repo = trx?.getRepository(agent_published_version_entity_1.AgentPublishedVersion) ?? this;
|
|
27
|
+
await repo.delete({ agentId });
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.AgentPublishedVersionRepository = AgentPublishedVersionRepository;
|
|
31
|
+
exports.AgentPublishedVersionRepository = AgentPublishedVersionRepository = __decorate([
|
|
32
|
+
(0, di_1.Service)(),
|
|
33
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
34
|
+
], AgentPublishedVersionRepository);
|
|
35
|
+
//# sourceMappingURL=agent-published-version.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-published-version.repository.js","sourceRoot":"","sources":["../../../../src/modules/agents/repositories/agent-published-version.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAElC,0CAAsD;AAGtD,+FAAmF;AAK5E,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,oBAAiC;IACrF,YAAY,UAAsB;QACjC,KAAK,CAAC,sDAAqB,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAQD,KAAK,CAAC,oBAAoB,CACzB,IAUC,EACD,GAAmB;QAEnB,MAAM,IAAI,GAAG,GAAG,EAAE,aAAa,CAAC,sDAAqB,CAAC,IAAI,IAAI,CAAC;QAM/D,MAAM,IAAI,CAAC,MAAM,CAChB,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAmD,EACnF,CAAC,SAAS,CAAC,CACX,CAAC;QACF,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,OAAe,EAAE,GAAmB;QACzD,MAAM,IAAI,GAAG,GAAG,EAAE,aAAa,CAAC,sDAAqB,CAAC,IAAI,IAAI,CAAC;QAC/D,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAChC,CAAC;CACD,CAAA;AA1CY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,YAAO,GAAE;qCAEe,oBAAU;GADtB,+BAA+B,CA0C3C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgentResourceRepository = void 0;
|
|
13
|
+
const di_1 = require("@n8n/di");
|
|
14
|
+
const typeorm_1 = require("@n8n/typeorm");
|
|
15
|
+
const agent_resource_entity_1 = require("../entities/agent-resource.entity");
|
|
16
|
+
let AgentResourceRepository = class AgentResourceRepository extends typeorm_1.Repository {
|
|
17
|
+
constructor(dataSource) {
|
|
18
|
+
super(agent_resource_entity_1.AgentResourceEntity, dataSource.manager);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.AgentResourceRepository = AgentResourceRepository;
|
|
22
|
+
exports.AgentResourceRepository = AgentResourceRepository = __decorate([
|
|
23
|
+
(0, di_1.Service)(),
|
|
24
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
25
|
+
], AgentResourceRepository);
|
|
26
|
+
//# sourceMappingURL=agent-resource.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-resource.repository.js","sourceRoot":"","sources":["../../../../src/modules/agents/repositories/agent-resource.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAClC,0CAAsD;AAEtD,6EAAwE;AAGjE,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,oBAA+B;IAC3E,YAAY,UAAsB;QACjC,KAAK,CAAC,2CAAmB,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;CACD,CAAA;AAJY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,YAAO,GAAE;qCAEe,oBAAU;GADtB,uBAAuB,CAInC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgentThreadRepository = void 0;
|
|
13
|
+
const di_1 = require("@n8n/di");
|
|
14
|
+
const typeorm_1 = require("@n8n/typeorm");
|
|
15
|
+
const agent_thread_entity_1 = require("../entities/agent-thread.entity");
|
|
16
|
+
let AgentThreadRepository = class AgentThreadRepository extends typeorm_1.Repository {
|
|
17
|
+
constructor(dataSource) {
|
|
18
|
+
super(agent_thread_entity_1.AgentThreadEntity, dataSource.manager);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.AgentThreadRepository = AgentThreadRepository;
|
|
22
|
+
exports.AgentThreadRepository = AgentThreadRepository = __decorate([
|
|
23
|
+
(0, di_1.Service)(),
|
|
24
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
25
|
+
], AgentThreadRepository);
|
|
26
|
+
//# sourceMappingURL=agent-thread.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-thread.repository.js","sourceRoot":"","sources":["../../../../src/modules/agents/repositories/agent-thread.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAClC,0CAAsD;AAEtD,yEAAoE;AAG7D,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,oBAA6B;IACvE,YAAY,UAAsB;QACjC,KAAK,CAAC,uCAAiB,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;CACD,CAAA;AAJY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,YAAO,GAAE;qCAEe,oBAAU;GADtB,qBAAqB,CAIjC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataSource, Repository } from '@n8n/typeorm';
|
|
2
|
+
import { Agent } from '../entities/agent.entity';
|
|
3
|
+
export declare class AgentRepository extends Repository<Agent> {
|
|
4
|
+
constructor(dataSource: DataSource);
|
|
5
|
+
findByProjectId(projectId: string): Promise<Agent[]>;
|
|
6
|
+
findByIdAndProjectId(id: string, projectId: string): Promise<Agent | null>;
|
|
7
|
+
findPublished(): Promise<Agent[]>;
|
|
8
|
+
findByIntegrationCredential(type: string, credentialId: string, projectId: string, excludeAgentId: string): Promise<Agent[]>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgentRepository = void 0;
|
|
13
|
+
const api_types_1 = require("@n8n/api-types");
|
|
14
|
+
const di_1 = require("@n8n/di");
|
|
15
|
+
const typeorm_1 = require("@n8n/typeorm");
|
|
16
|
+
const agent_entity_1 = require("../entities/agent.entity");
|
|
17
|
+
let AgentRepository = class AgentRepository extends typeorm_1.Repository {
|
|
18
|
+
constructor(dataSource) {
|
|
19
|
+
super(agent_entity_1.Agent, dataSource.manager);
|
|
20
|
+
}
|
|
21
|
+
async findByProjectId(projectId) {
|
|
22
|
+
return await this.find({
|
|
23
|
+
where: { projectId },
|
|
24
|
+
relations: { publishedVersion: true },
|
|
25
|
+
order: { updatedAt: 'DESC' },
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
async findByIdAndProjectId(id, projectId) {
|
|
29
|
+
return await this.findOne({
|
|
30
|
+
where: { id, projectId },
|
|
31
|
+
relations: { publishedVersion: true },
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
async findPublished() {
|
|
35
|
+
return await this.createQueryBuilder('agent')
|
|
36
|
+
.innerJoinAndSelect('agent.publishedVersion', 'publishedVersion')
|
|
37
|
+
.getMany();
|
|
38
|
+
}
|
|
39
|
+
async findByIntegrationCredential(type, credentialId, projectId, excludeAgentId) {
|
|
40
|
+
const agents = await this.find({ where: { projectId } });
|
|
41
|
+
return agents.filter((agent) => agent.id !== excludeAgentId &&
|
|
42
|
+
(agent.integrations ?? []).some((i) => (0, api_types_1.isAgentCredentialIntegration)(i) && i.type === type && i.credentialId === credentialId));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.AgentRepository = AgentRepository;
|
|
46
|
+
exports.AgentRepository = AgentRepository = __decorate([
|
|
47
|
+
(0, di_1.Service)(),
|
|
48
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
49
|
+
], AgentRepository);
|
|
50
|
+
//# sourceMappingURL=agent.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.repository.js","sourceRoot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AAC,CAAC,IAAI,CAC9B,CAAC,CAAC,EAAE,EAAE,CACL,IAAA,wCAA4B,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,YAAY,KAAK,YAAY,CACtF,CACF,CAAC;IACH,CAAC;CACD,CAAA;AA/DY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,YAAO,GAAE;qCAEe,oBAAU;GADtB,eAAe,CA+D3B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Logger } from '@n8n/backend-common';
|
|
2
|
+
import type ivm from 'isolated-vm';
|
|
3
|
+
export declare class PoolDisposedError extends Error {
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
6
|
+
export declare class PoolExhaustedError extends Error {
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
9
|
+
export declare class AgentIsolateSlot {
|
|
10
|
+
readonly isolate: ivm.Isolate;
|
|
11
|
+
private bundleScript;
|
|
12
|
+
constructor(ivmModule: typeof ivm, memoryLimit: number, libraryBundle: string);
|
|
13
|
+
get isHealthy(): boolean;
|
|
14
|
+
createContext(): ivm.Context;
|
|
15
|
+
dispose(): void;
|
|
16
|
+
}
|
|
17
|
+
export interface AgentIsolatePoolOptions {
|
|
18
|
+
size?: number;
|
|
19
|
+
memoryLimit?: number;
|
|
20
|
+
highWaterMarkRatio?: number;
|
|
21
|
+
maxQueueDepth?: number;
|
|
22
|
+
logger?: Logger;
|
|
23
|
+
}
|
|
24
|
+
export declare class AgentIsolatePool {
|
|
25
|
+
private readonly ivmModule;
|
|
26
|
+
private readonly libraryBundle;
|
|
27
|
+
private slots;
|
|
28
|
+
private waitQueue;
|
|
29
|
+
private disposed;
|
|
30
|
+
private warming;
|
|
31
|
+
private replenishPromises;
|
|
32
|
+
private readonly size;
|
|
33
|
+
private readonly memoryLimit;
|
|
34
|
+
private readonly highWaterMarkRatio;
|
|
35
|
+
private readonly maxQueueDepth;
|
|
36
|
+
private readonly logger;
|
|
37
|
+
private static readonly MAX_REPLENISH_RETRIES;
|
|
38
|
+
private static readonly REPLENISH_RETRY_BASE_MS;
|
|
39
|
+
constructor(ivmModule: typeof ivm, libraryBundle: string, options?: AgentIsolatePoolOptions);
|
|
40
|
+
initialize(): Promise<void>;
|
|
41
|
+
acquire(): Promise<AgentIsolateSlot>;
|
|
42
|
+
release(slot: AgentIsolateSlot): void;
|
|
43
|
+
tryAcquireSync(): AgentIsolateSlot | null;
|
|
44
|
+
dispose(): Promise<void>;
|
|
45
|
+
private isOverHighWaterMark;
|
|
46
|
+
private createSlot;
|
|
47
|
+
private replenish;
|
|
48
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentIsolatePool = exports.AgentIsolateSlot = exports.PoolExhaustedError = exports.PoolDisposedError = void 0;
|
|
4
|
+
const sandbox_polyfills_1 = require("./sandbox-polyfills");
|
|
5
|
+
class PoolDisposedError extends Error {
|
|
6
|
+
constructor() {
|
|
7
|
+
super('Agent isolate pool is disposed');
|
|
8
|
+
this.name = 'PoolDisposedError';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.PoolDisposedError = PoolDisposedError;
|
|
12
|
+
class PoolExhaustedError extends Error {
|
|
13
|
+
constructor() {
|
|
14
|
+
super('Agent isolate pool is exhausted — too many concurrent requests. Try again later.');
|
|
15
|
+
this.name = 'PoolExhaustedError';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.PoolExhaustedError = PoolExhaustedError;
|
|
19
|
+
class AgentIsolateSlot {
|
|
20
|
+
constructor(ivmModule, memoryLimit, libraryBundle) {
|
|
21
|
+
this.isolate = new ivmModule.Isolate({ memoryLimit });
|
|
22
|
+
this.bundleScript = this.isolate.compileScriptSync(libraryBundle);
|
|
23
|
+
}
|
|
24
|
+
get isHealthy() {
|
|
25
|
+
return !this.isolate.isDisposed;
|
|
26
|
+
}
|
|
27
|
+
createContext() {
|
|
28
|
+
const context = this.isolate.createContextSync();
|
|
29
|
+
try {
|
|
30
|
+
const jail = context.global;
|
|
31
|
+
jail.setSync('global', jail.derefInto());
|
|
32
|
+
context.evalSync(sandbox_polyfills_1.SANDBOX_POLYFILLS, { timeout: 5000 });
|
|
33
|
+
context.evalSync(`
|
|
34
|
+
globalThis.__modules = {};
|
|
35
|
+
globalThis.require = function(id) {
|
|
36
|
+
if (globalThis.__modules[id]) {
|
|
37
|
+
return globalThis.__modules[id];
|
|
38
|
+
}
|
|
39
|
+
// Return empty stub for unknown modules (Node built-ins, etc.)
|
|
40
|
+
return new Proxy({}, {
|
|
41
|
+
get: function(target, prop) {
|
|
42
|
+
if (prop === '__esModule') return false;
|
|
43
|
+
if (prop === 'default') return {};
|
|
44
|
+
return function() { return {}; };
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
`, { timeout: 5000 });
|
|
49
|
+
this.bundleScript.runSync(context, { timeout: 10000 });
|
|
50
|
+
return context;
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
context.release();
|
|
54
|
+
throw e;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
dispose() {
|
|
58
|
+
if (this.isHealthy) {
|
|
59
|
+
this.bundleScript.release();
|
|
60
|
+
this.isolate.dispose();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.AgentIsolateSlot = AgentIsolateSlot;
|
|
65
|
+
class AgentIsolatePool {
|
|
66
|
+
constructor(ivmModule, libraryBundle, options = {}) {
|
|
67
|
+
this.ivmModule = ivmModule;
|
|
68
|
+
this.libraryBundle = libraryBundle;
|
|
69
|
+
this.slots = [];
|
|
70
|
+
this.waitQueue = [];
|
|
71
|
+
this.disposed = false;
|
|
72
|
+
this.warming = 0;
|
|
73
|
+
this.replenishPromises = new Set();
|
|
74
|
+
this.size = options.size ?? 2;
|
|
75
|
+
this.memoryLimit = options.memoryLimit ?? 32;
|
|
76
|
+
this.highWaterMarkRatio = options.highWaterMarkRatio ?? 0.8;
|
|
77
|
+
this.maxQueueDepth = options.maxQueueDepth ?? 10;
|
|
78
|
+
this.logger = options.logger;
|
|
79
|
+
}
|
|
80
|
+
async initialize() {
|
|
81
|
+
const results = await Promise.allSettled(Array.from({ length: this.size }, async () => await Promise.resolve(this.createSlot())));
|
|
82
|
+
for (const result of results) {
|
|
83
|
+
if (result.status === 'fulfilled') {
|
|
84
|
+
this.slots.push(result.value);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
this.logger?.warn('[AgentIsolatePool] Failed to create slot during init', {
|
|
88
|
+
error: result.reason instanceof Error ? result.reason.message : String(result.reason),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (this.slots.length === 0) {
|
|
93
|
+
const firstRejection = results.find((r) => r.status === 'rejected');
|
|
94
|
+
const cause = firstRejection?.reason instanceof Error
|
|
95
|
+
? firstRejection.reason
|
|
96
|
+
: new Error(String(firstRejection?.reason));
|
|
97
|
+
throw new Error('AgentIsolatePool: failed to create any isolate slots during initialization', { cause });
|
|
98
|
+
}
|
|
99
|
+
const missing = this.size - this.slots.length;
|
|
100
|
+
for (let i = 0; i < missing; i++) {
|
|
101
|
+
void this.replenish();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async acquire() {
|
|
105
|
+
if (this.disposed)
|
|
106
|
+
throw new PoolDisposedError();
|
|
107
|
+
const slot = this.slots.shift();
|
|
108
|
+
if (slot) {
|
|
109
|
+
void this.replenish();
|
|
110
|
+
return slot;
|
|
111
|
+
}
|
|
112
|
+
if (this.waitQueue.length >= this.maxQueueDepth) {
|
|
113
|
+
this.logger?.warn('[AgentIsolatePool] Pool exhausted — request rejected', {
|
|
114
|
+
queueDepth: this.waitQueue.length,
|
|
115
|
+
maxQueueDepth: this.maxQueueDepth,
|
|
116
|
+
});
|
|
117
|
+
throw new PoolExhaustedError();
|
|
118
|
+
}
|
|
119
|
+
return await new Promise((resolve, reject) => {
|
|
120
|
+
this.waitQueue.push({ resolve, reject });
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
release(slot) {
|
|
124
|
+
if (this.disposed) {
|
|
125
|
+
slot.dispose();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (!slot.isHealthy) {
|
|
129
|
+
this.logger?.warn('[AgentIsolatePool] Slot OOM — discarding and replenishing');
|
|
130
|
+
slot.dispose();
|
|
131
|
+
void this.replenish();
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (this.isOverHighWaterMark(slot)) {
|
|
135
|
+
this.logger?.debug('[AgentIsolatePool] Slot over high-water mark — proactively recycling');
|
|
136
|
+
slot.dispose();
|
|
137
|
+
void this.replenish();
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const waiter = this.waitQueue.shift();
|
|
141
|
+
if (waiter) {
|
|
142
|
+
waiter.resolve(slot);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
this.slots.push(slot);
|
|
146
|
+
}
|
|
147
|
+
tryAcquireSync() {
|
|
148
|
+
if (this.disposed)
|
|
149
|
+
return null;
|
|
150
|
+
const slot = this.slots.shift();
|
|
151
|
+
if (slot) {
|
|
152
|
+
void this.replenish();
|
|
153
|
+
return slot;
|
|
154
|
+
}
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
async dispose() {
|
|
158
|
+
this.disposed = true;
|
|
159
|
+
const error = new PoolDisposedError();
|
|
160
|
+
for (const { reject } of this.waitQueue) {
|
|
161
|
+
reject(error);
|
|
162
|
+
}
|
|
163
|
+
this.waitQueue = [];
|
|
164
|
+
await Promise.all([...this.replenishPromises]);
|
|
165
|
+
for (const slot of this.slots) {
|
|
166
|
+
slot.dispose();
|
|
167
|
+
}
|
|
168
|
+
this.slots = [];
|
|
169
|
+
}
|
|
170
|
+
isOverHighWaterMark(slot) {
|
|
171
|
+
try {
|
|
172
|
+
const stats = slot.isolate.getHeapStatisticsSync();
|
|
173
|
+
const limitBytes = this.memoryLimit * 1024 * 1024;
|
|
174
|
+
return stats.used_heap_size > limitBytes * this.highWaterMarkRatio;
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
this.logger?.warn('[AgentIsolatePool] Failed to get heap statistics — assuming over high-water mark', {
|
|
178
|
+
error: error instanceof Error ? error.message : String(error),
|
|
179
|
+
});
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
createSlot() {
|
|
184
|
+
return new AgentIsolateSlot(this.ivmModule, this.memoryLimit, this.libraryBundle);
|
|
185
|
+
}
|
|
186
|
+
replenish(attempt = 0) {
|
|
187
|
+
if (this.disposed)
|
|
188
|
+
return;
|
|
189
|
+
if (this.slots.length + this.warming >= this.size)
|
|
190
|
+
return;
|
|
191
|
+
this.warming++;
|
|
192
|
+
let promise;
|
|
193
|
+
promise = Promise.resolve()
|
|
194
|
+
.then(() => {
|
|
195
|
+
const slot = this.createSlot();
|
|
196
|
+
this.warming--;
|
|
197
|
+
this.replenishPromises.delete(promise);
|
|
198
|
+
if (this.disposed) {
|
|
199
|
+
slot.dispose();
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
const waiter = this.waitQueue.shift();
|
|
203
|
+
if (waiter) {
|
|
204
|
+
waiter.resolve(slot);
|
|
205
|
+
void this.replenish();
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
this.slots.push(slot);
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
.catch((error) => {
|
|
212
|
+
this.warming--;
|
|
213
|
+
this.replenishPromises.delete(promise);
|
|
214
|
+
if (attempt < AgentIsolatePool.MAX_REPLENISH_RETRIES) {
|
|
215
|
+
const delay = AgentIsolatePool.REPLENISH_RETRY_BASE_MS * 2 ** attempt;
|
|
216
|
+
this.logger?.debug('[AgentIsolatePool] Replenishment failed, retrying', {
|
|
217
|
+
attempt,
|
|
218
|
+
delayMs: delay,
|
|
219
|
+
error: error instanceof Error ? error.message : String(error),
|
|
220
|
+
});
|
|
221
|
+
let retryPromise;
|
|
222
|
+
retryPromise = new Promise((resolve) => {
|
|
223
|
+
setTimeout(resolve, delay).unref();
|
|
224
|
+
}).then(() => {
|
|
225
|
+
this.replenishPromises.delete(retryPromise);
|
|
226
|
+
this.replenish(attempt + 1);
|
|
227
|
+
});
|
|
228
|
+
this.replenishPromises.add(retryPromise);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
this.logger?.warn('[AgentIsolatePool] Replenishment failed after max retries', {
|
|
232
|
+
error: error instanceof Error ? error.message : String(error),
|
|
233
|
+
});
|
|
234
|
+
const waitError = new Error('Isolate slot creation permanently failed — no slots available');
|
|
235
|
+
for (const { reject } of this.waitQueue.splice(0)) {
|
|
236
|
+
reject(waitError);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
this.replenishPromises.add(promise);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
exports.AgentIsolatePool = AgentIsolatePool;
|
|
244
|
+
AgentIsolatePool.MAX_REPLENISH_RETRIES = 3;
|
|
245
|
+
AgentIsolatePool.REPLENISH_RETRY_BASE_MS = 500;
|
|
246
|
+
//# sourceMappingURL=agent-isolate-pool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-isolate-pool.js","sourceRoot":"","sources":["../../../../src/modules/agents/runtime/agent-isolate-pool.ts"],"names":[],"mappings":";;;AAGA,2DAAwD;AAExD,MAAa,iBAAkB,SAAQ,KAAK;IAC3C;QACC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IACjC,CAAC;CACD;AALD,8CAKC;AAED,MAAa,kBAAmB,SAAQ,KAAK;IAC5C;QACC,KAAK,CAAC,kFAAkF,CAAC,CAAC;QAC1F,IAAI,CAAC,IAAI,GAAG,oBAA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AAC,OAAO,CAAC,CAAC;IACrC,CAAC;;AA/PF,4CAgQC;AAzOwB,sCAAqB,GAAG,CAAC,AAAJ,CAAK;AAE1B,wCAAuB,GAAG,GAAG,AAAN,CAAO"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ToolDescriptor } from '@n8n/agents';
|
|
2
|
+
import { Logger } from '@n8n/backend-common';
|
|
3
|
+
import type { ToolExecutor } from '../json-config/from-json-config';
|
|
4
|
+
export declare class AgentSecureRuntime {
|
|
5
|
+
private readonly logger;
|
|
6
|
+
constructor(logger: Logger);
|
|
7
|
+
private pool;
|
|
8
|
+
private poolInitPromise;
|
|
9
|
+
private disposed;
|
|
10
|
+
private libraryBundle;
|
|
11
|
+
private getPool;
|
|
12
|
+
private withIsolate;
|
|
13
|
+
private getLibraryBundle;
|
|
14
|
+
private compileTs;
|
|
15
|
+
private parseSandboxJson;
|
|
16
|
+
private runInContext;
|
|
17
|
+
describeToolSecurely(tsCode: string): Promise<ToolDescriptor>;
|
|
18
|
+
executeToolInIsolate(toolCode: string, input: unknown, ctx: unknown): Promise<unknown>;
|
|
19
|
+
createToolExecutor(toolsByName: Record<string, string>): ToolExecutor;
|
|
20
|
+
dispose(): void;
|
|
21
|
+
}
|