n8n 2.15.1 → 2.17.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/README.md +1 -1
- package/dist/active-workflow-manager.d.ts +3 -1
- package/dist/active-workflow-manager.js +62 -16
- package/dist/active-workflow-manager.js.map +1 -1
- package/dist/auth/auth.service.d.ts +5 -2
- package/dist/auth/auth.service.js +11 -6
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/base-command.js +13 -1
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/start.d.ts +1 -0
- package/dist/commands/start.js +7 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +5 -1
- package/dist/constants.js.map +1 -1
- package/dist/controllers/ai.controller.d.ts +11 -2
- package/dist/controllers/ai.controller.js +56 -4
- package/dist/controllers/ai.controller.js.map +1 -1
- package/dist/controllers/auth.controller.js +1 -1
- package/dist/controllers/auth.controller.js.map +1 -1
- package/dist/controllers/e2e.controller.js +5 -0
- package/dist/controllers/e2e.controller.js.map +1 -1
- package/dist/controllers/me.controller.d.ts +1 -0
- package/dist/controllers/me.controller.js +12 -0
- package/dist/controllers/me.controller.js.map +1 -1
- package/dist/controllers/project.controller.d.ts +3 -1
- package/dist/controllers/project.controller.js +9 -2
- package/dist/controllers/project.controller.js.map +1 -1
- package/dist/controllers/role.controller.d.ts +6 -4
- package/dist/controllers/role.controller.js +28 -8
- package/dist/controllers/role.controller.js.map +1 -1
- package/dist/controllers/users.controller.d.ts +4 -1
- package/dist/controllers/users.controller.js +8 -2
- package/dist/controllers/users.controller.js.map +1 -1
- package/dist/credentials/credentials.controller.js +4 -1
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +10 -6
- package/dist/credentials/credentials.service.js +98 -26
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials/validation.js +2 -2
- package/dist/credentials/validation.js.map +1 -1
- package/dist/credentials-helper.d.ts +3 -1
- package/dist/credentials-helper.js +21 -3
- package/dist/credentials-helper.js.map +1 -1
- package/dist/errors/http-error-classifier.d.ts +31 -0
- package/dist/errors/http-error-classifier.js +60 -0
- package/dist/errors/http-error-classifier.js.map +1 -0
- package/dist/errors/http-error-serializers.d.ts +18 -0
- package/dist/errors/http-error-serializers.js +64 -0
- package/dist/errors/http-error-serializers.js.map +1 -0
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +10 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +114 -0
- package/dist/events/relays/log-streaming.event-relay.d.ts +10 -0
- package/dist/events/relays/log-streaming.event-relay.js +108 -2
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +5 -0
- package/dist/events/relays/telemetry.event-relay.js +58 -5
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.d.ts +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +24 -9
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/executions/execution.service.js +2 -1
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/instance-settings-loader/instance-settings-loader.service.d.ts +9 -0
- package/dist/instance-settings-loader/instance-settings-loader.service.js +36 -0
- package/dist/instance-settings-loader/instance-settings-loader.service.js.map +1 -0
- package/dist/instance-settings-loader/loaders/owner.instance-settings-loader.d.ts +10 -0
- package/dist/instance-settings-loader/loaders/owner.instance-settings-loader.js +72 -0
- package/dist/instance-settings-loader/loaders/owner.instance-settings-loader.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-workflow.service.d.ts +1 -0
- package/dist/modules/chat-hub/chat-hub-workflow.service.js +18 -2
- package/dist/modules/chat-hub/chat-hub-workflow.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.types.d.ts +5 -0
- package/dist/modules/chat-hub/chat-hub.types.js +1 -0
- package/dist/modules/chat-hub/chat-hub.types.js.map +1 -1
- package/dist/modules/chat-hub/context-limits.js +10 -0
- package/dist/modules/chat-hub/context-limits.js.map +1 -1
- package/dist/modules/chat-hub/stream-capturer.js +3 -0
- package/dist/modules/chat-hub/stream-capturer.js.map +1 -1
- package/dist/modules/community-packages/community-node-types-utils.d.ts +2 -2
- package/dist/modules/community-packages/community-node-types-utils.js +4 -4
- package/dist/modules/community-packages/community-node-types-utils.js.map +1 -1
- package/dist/modules/community-packages/strapi-utils.d.ts +1 -1
- package/dist/modules/data-table/data-table-proxy.service.d.ts +44 -2
- package/dist/modules/data-table/data-table-proxy.service.js +86 -2
- package/dist/modules/data-table/data-table-proxy.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-introspection-identifier.d.ts +2 -2
- package/dist/modules/dynamic-credentials.ee/services/resolver-config-expression.service.js +10 -4
- package/dist/modules/dynamic-credentials.ee/services/resolver-config-expression.service.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets-settings.controller.ee.d.ts +5 -2
- package/dist/modules/external-secrets.ee/external-secrets-settings.controller.ee.js +10 -3
- package/dist/modules/external-secrets.ee/external-secrets-settings.controller.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-connections.controller.ee.js +5 -5
- package/dist/modules/external-secrets.ee/secrets-providers-connections.controller.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.d.ts +6 -6
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.js +14 -9
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-project.controller.ee.js +3 -3
- package/dist/modules/external-secrets.ee/secrets-providers-project.controller.ee.js.map +1 -1
- package/dist/modules/instance-ai/compaction.service.d.ts +19 -0
- package/dist/modules/instance-ai/compaction.service.js +213 -0
- package/dist/modules/instance-ai/compaction.service.js.map +1 -0
- package/dist/modules/instance-ai/entities/index.d.ts +7 -0
- package/dist/modules/instance-ai/entities/index.js +18 -0
- package/dist/modules/instance-ai/entities/index.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-iteration-log.entity.d.ts +7 -0
- package/dist/modules/instance-ai/entities/instance-ai-iteration-log.entity.js +38 -0
- package/dist/modules/instance-ai/entities/instance-ai-iteration-log.entity.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-message.entity.d.ts +9 -0
- package/dist/modules/instance-ai/entities/instance-ai-message.entity.js +47 -0
- package/dist/modules/instance-ai/entities/instance-ai-message.entity.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-observational-memory.entity.d.ts +33 -0
- package/dist/modules/instance-ai/entities/instance-ai-observational-memory.entity.js +145 -0
- package/dist/modules/instance-ai/entities/instance-ai-observational-memory.entity.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-resource.entity.d.ts +6 -0
- package/dist/modules/instance-ai/entities/instance-ai-resource.entity.js +33 -0
- package/dist/modules/instance-ai/entities/instance-ai-resource.entity.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-run-snapshot.entity.d.ts +8 -0
- package/dist/modules/instance-ai/entities/instance-ai-run-snapshot.entity.js +43 -0
- package/dist/modules/instance-ai/entities/instance-ai-run-snapshot.entity.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-thread.entity.d.ts +7 -0
- package/dist/modules/instance-ai/entities/instance-ai-thread.entity.js +38 -0
- package/dist/modules/instance-ai/entities/instance-ai-thread.entity.js.map +1 -0
- package/dist/modules/instance-ai/entities/instance-ai-workflow-snapshot.entity.d.ts +8 -0
- package/dist/modules/instance-ai/entities/instance-ai-workflow-snapshot.entity.js +41 -0
- package/dist/modules/instance-ai/entities/instance-ai-workflow-snapshot.entity.js.map +1 -0
- package/dist/modules/instance-ai/eval/api-docs.d.ts +1 -0
- package/dist/modules/instance-ai/eval/api-docs.js +78 -0
- package/dist/modules/instance-ai/eval/api-docs.js.map +1 -0
- package/dist/modules/instance-ai/eval/execution.service.d.ts +25 -0
- package/dist/modules/instance-ai/eval/execution.service.js +291 -0
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -0
- package/dist/modules/instance-ai/eval/mock-handler.d.ts +9 -0
- package/dist/modules/instance-ai/eval/mock-handler.js +264 -0
- package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -0
- package/dist/modules/instance-ai/eval/node-config.d.ts +2 -0
- package/dist/modules/instance-ai/eval/node-config.js +15 -0
- package/dist/modules/instance-ai/eval/node-config.js.map +1 -0
- package/dist/modules/instance-ai/eval/pin-data-generator.d.ts +12 -0
- package/dist/modules/instance-ai/eval/pin-data-generator.js +301 -0
- package/dist/modules/instance-ai/eval/pin-data-generator.js.map +1 -0
- package/dist/modules/instance-ai/eval/request-sanitizer.d.ts +3 -0
- package/dist/modules/instance-ai/eval/request-sanitizer.js +50 -0
- package/dist/modules/instance-ai/eval/request-sanitizer.js.map +1 -0
- package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +16 -0
- package/dist/modules/instance-ai/eval/workflow-analysis.js +217 -0
- package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -0
- package/dist/modules/instance-ai/event-bus/in-process-event-bus.d.ts +19 -0
- package/dist/modules/instance-ai/event-bus/in-process-event-bus.js +98 -0
- package/dist/modules/instance-ai/event-bus/in-process-event-bus.js.map +1 -0
- package/dist/modules/instance-ai/filesystem/index.d.ts +3 -0
- package/dist/modules/instance-ai/filesystem/index.js +8 -0
- package/dist/modules/instance-ai/filesystem/index.js.map +1 -0
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.d.ts +29 -0
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.js +137 -0
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.js.map +1 -0
- package/dist/modules/instance-ai/filesystem/local-gateway.d.ts +35 -0
- package/dist/modules/instance-ai/filesystem/local-gateway.js +99 -0
- package/dist/modules/instance-ai/filesystem/local-gateway.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +40 -0
- package/dist/modules/instance-ai/instance-ai-memory.service.js +245 -0
- package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +59 -0
- package/dist/modules/instance-ai/instance-ai-settings.service.js +450 -0
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +91 -0
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +1885 -0
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +101 -0
- package/dist/modules/instance-ai/instance-ai.controller.js +670 -0
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai.module.d.ts +12 -0
- package/dist/modules/instance-ai/instance-ai.module.js +118 -0
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai.service.d.ts +133 -0
- package/dist/modules/instance-ai/instance-ai.service.js +1802 -0
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -0
- package/dist/modules/instance-ai/internal-messages.d.ts +2 -0
- package/dist/modules/instance-ai/internal-messages.js +11 -0
- package/dist/modules/instance-ai/internal-messages.js.map +1 -0
- package/dist/modules/instance-ai/message-parser.d.ts +12 -0
- package/dist/modules/instance-ai/message-parser.js +171 -0
- package/dist/modules/instance-ai/message-parser.js.map +1 -0
- package/dist/modules/instance-ai/node-definition-resolver.d.ts +19 -0
- package/dist/modules/instance-ai/node-definition-resolver.js +290 -0
- package/dist/modules/instance-ai/node-definition-resolver.js.map +1 -0
- package/dist/modules/instance-ai/proxy-token-manager.d.ts +15 -0
- package/dist/modules/instance-ai/proxy-token-manager.js +64 -0
- package/dist/modules/instance-ai/proxy-token-manager.js.map +1 -0
- package/dist/modules/instance-ai/repositories/index.d.ts +7 -0
- package/dist/modules/instance-ai/repositories/index.js +18 -0
- package/dist/modules/instance-ai/repositories/index.js.map +1 -0
- package/dist/modules/instance-ai/repositories/instance-ai-iteration-log.repository.d.ts +5 -0
- package/dist/modules/instance-ai/repositories/instance-ai-iteration-log.repository.js +26 -0
- package/dist/modules/instance-ai/repositories/instance-ai-iteration-log.repository.js.map +1 -0
- package/dist/modules/instance-ai/repositories/instance-ai-message.repository.d.ts +5 -0
- package/dist/modules/instance-ai/repositories/instance-ai-message.repository.js +26 -0
- package/dist/modules/instance-ai/repositories/instance-ai-message.repository.js.map +1 -0
- package/dist/modules/instance-ai/repositories/instance-ai-observational-memory.repository.d.ts +5 -0
- package/dist/modules/instance-ai/repositories/instance-ai-observational-memory.repository.js +26 -0
- package/dist/modules/instance-ai/repositories/instance-ai-observational-memory.repository.js.map +1 -0
- package/dist/modules/instance-ai/repositories/instance-ai-resource.repository.d.ts +5 -0
- package/dist/modules/instance-ai/repositories/instance-ai-resource.repository.js +26 -0
- package/dist/modules/instance-ai/repositories/instance-ai-resource.repository.js.map +1 -0
- package/dist/modules/instance-ai/repositories/instance-ai-run-snapshot.repository.d.ts +5 -0
- package/dist/modules/instance-ai/repositories/instance-ai-run-snapshot.repository.js +26 -0
- package/dist/modules/instance-ai/repositories/instance-ai-run-snapshot.repository.js.map +1 -0
- package/dist/modules/instance-ai/repositories/instance-ai-thread.repository.d.ts +5 -0
- package/dist/modules/instance-ai/repositories/instance-ai-thread.repository.js +26 -0
- package/dist/modules/instance-ai/repositories/instance-ai-thread.repository.js.map +1 -0
- package/dist/modules/instance-ai/repositories/instance-ai-workflow-snapshot.repository.d.ts +5 -0
- package/dist/modules/instance-ai/repositories/instance-ai-workflow-snapshot.repository.js +26 -0
- package/dist/modules/instance-ai/repositories/instance-ai-workflow-snapshot.repository.js.map +1 -0
- package/dist/modules/instance-ai/snapshot-pruning.service.d.ts +17 -0
- package/dist/modules/instance-ai/snapshot-pruning.service.js +89 -0
- package/dist/modules/instance-ai/snapshot-pruning.service.js.map +1 -0
- package/dist/modules/instance-ai/storage/db-iteration-log-storage.d.ts +9 -0
- package/dist/modules/instance-ai/storage/db-iteration-log-storage.js +45 -0
- package/dist/modules/instance-ai/storage/db-iteration-log-storage.js.map +1 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.d.ts +14 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js +99 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -0
- package/dist/modules/instance-ai/storage/index.d.ts +5 -0
- package/dist/modules/instance-ai/storage/index.js +14 -0
- package/dist/modules/instance-ai/storage/index.js.map +1 -0
- package/dist/modules/instance-ai/storage/typeorm-composite-store.d.ts +9 -0
- package/dist/modules/instance-ai/storage/typeorm-composite-store.js +33 -0
- package/dist/modules/instance-ai/storage/typeorm-composite-store.js.map +1 -0
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.d.ts +96 -0
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.js +853 -0
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.js.map +1 -0
- package/dist/modules/instance-ai/storage/typeorm-workflows-storage.d.ts +44 -0
- package/dist/modules/instance-ai/storage/typeorm-workflows-storage.js +156 -0
- package/dist/modules/instance-ai/storage/typeorm-workflows-storage.js.map +1 -0
- package/dist/modules/instance-ai/web-research/brave-search.d.ts +10 -0
- package/dist/modules/instance-ai/web-research/brave-search.js +44 -0
- package/dist/modules/instance-ai/web-research/brave-search.js.map +1 -0
- package/dist/modules/instance-ai/web-research/cache.d.ts +13 -0
- package/dist/modules/instance-ai/web-research/cache.js +43 -0
- package/dist/modules/instance-ai/web-research/cache.js.map +1 -0
- package/dist/modules/instance-ai/web-research/fetch-and-extract.d.ts +8 -0
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js +231 -0
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js.map +1 -0
- package/dist/modules/instance-ai/web-research/index.d.ts +7 -0
- package/dist/modules/instance-ai/web-research/index.js +16 -0
- package/dist/modules/instance-ai/web-research/index.js.map +1 -0
- package/dist/modules/instance-ai/web-research/searxng-search.d.ts +6 -0
- package/dist/modules/instance-ai/web-research/searxng-search.js +39 -0
- package/dist/modules/instance-ai/web-research/searxng-search.js.map +1 -0
- package/dist/modules/instance-ai/web-research/ssrf-guard.d.ts +1 -0
- package/dist/modules/instance-ai/web-research/ssrf-guard.js +85 -0
- package/dist/modules/instance-ai/web-research/ssrf-guard.js.map +1 -0
- package/dist/modules/instance-ai/web-research/summarize-content.d.ts +4 -0
- package/dist/modules/instance-ai/web-research/summarize-content.js +34 -0
- package/dist/modules/instance-ai/web-research/summarize-content.js.map +1 -0
- package/dist/modules/instance-registry/instance-registry.types.d.ts +1 -0
- package/dist/modules/instance-registry/instance-registry.types.js +2 -1
- package/dist/modules/instance-registry/instance-registry.types.js.map +1 -1
- package/dist/modules/instance-registry/storage/instance-storage.interface.d.ts +1 -0
- package/dist/modules/instance-registry/storage/lua-scripts.d.ts +4 -0
- package/dist/modules/instance-registry/storage/lua-scripts.js +39 -0
- package/dist/modules/instance-registry/storage/lua-scripts.js.map +1 -0
- package/dist/modules/instance-registry/storage/memory-storage.d.ts +1 -0
- package/dist/modules/instance-registry/storage/memory-storage.js +1 -0
- package/dist/modules/instance-registry/storage/memory-storage.js.map +1 -1
- package/dist/modules/instance-registry/storage/redis-instance-storage.d.ts +25 -0
- package/dist/modules/instance-registry/storage/redis-instance-storage.js +185 -0
- package/dist/modules/instance-registry/storage/redis-instance-storage.js.map +1 -0
- package/dist/modules/instance-version-history/database/entities/instance-version-history.entity.d.ts +7 -0
- package/dist/modules/instance-version-history/database/entities/instance-version-history.entity.js +37 -0
- package/dist/modules/instance-version-history/database/entities/instance-version-history.entity.js.map +1 -0
- package/dist/modules/instance-version-history/database/repositories/instance-version-history.repository.d.ts +5 -0
- package/dist/modules/instance-version-history/database/repositories/instance-version-history.repository.js +26 -0
- package/dist/modules/instance-version-history/database/repositories/instance-version-history.repository.js.map +1 -0
- package/dist/modules/instance-version-history/instance-version-history.controller.d.ts +26 -0
- package/dist/modules/instance-version-history/instance-version-history.controller.js +85 -0
- package/dist/modules/instance-version-history/instance-version-history.controller.js.map +1 -0
- package/dist/modules/instance-version-history/instance-version-history.module.d.ts +5 -0
- package/dist/modules/instance-version-history/instance-version-history.module.js +60 -0
- package/dist/modules/instance-version-history/instance-version-history.module.js.map +1 -0
- package/dist/modules/instance-version-history/instance-version-history.service.d.ts +18 -0
- package/dist/modules/instance-version-history/instance-version-history.service.js +120 -0
- package/dist/modules/instance-version-history/instance-version-history.service.js.map +1 -0
- package/dist/modules/instance-version-history/instance-version-history.types.d.ts +12 -0
- package/dist/modules/instance-version-history/instance-version-history.types.js +27 -0
- package/dist/modules/instance-version-history/instance-version-history.types.js.map +1 -0
- package/dist/modules/log-streaming.ee/log-streaming.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +3 -1
- package/dist/modules/mcp/mcp.service.js +22 -3
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +1 -1
- package/dist/modules/mcp/tools/data-table/add-data-table-column.tool.d.ts +13 -0
- package/dist/modules/mcp/tools/data-table/add-data-table-column.tool.js +69 -0
- package/dist/modules/mcp/tools/data-table/add-data-table-column.tool.js.map +1 -0
- package/dist/modules/mcp/tools/data-table/add-data-table-rows.tool.d.ts +12 -0
- package/dist/modules/mcp/tools/data-table/add-data-table-rows.tool.js +77 -0
- package/dist/modules/mcp/tools/data-table/add-data-table-rows.tool.js.map +1 -0
- package/dist/modules/mcp/tools/data-table/create-data-table.tool.d.ts +21 -0
- package/dist/modules/mcp/tools/data-table/create-data-table.tool.js +92 -0
- package/dist/modules/mcp/tools/data-table/create-data-table.tool.js.map +1 -0
- package/dist/modules/mcp/tools/data-table/delete-data-table-column.tool.d.ts +12 -0
- package/dist/modules/mcp/tools/data-table/delete-data-table-column.tool.js +60 -0
- package/dist/modules/mcp/tools/data-table/delete-data-table-column.tool.js.map +1 -0
- package/dist/modules/mcp/tools/data-table/index.d.ts +7 -0
- package/dist/modules/mcp/tools/data-table/index.js +18 -0
- package/dist/modules/mcp/tools/data-table/index.js.map +1 -0
- package/dist/modules/mcp/tools/data-table/rename-data-table-column.tool.d.ts +13 -0
- package/dist/modules/mcp/tools/data-table/rename-data-table-column.tool.js +70 -0
- package/dist/modules/mcp/tools/data-table/rename-data-table-column.tool.js.map +1 -0
- package/dist/modules/mcp/tools/data-table/rename-data-table.tool.d.ts +12 -0
- package/dist/modules/mcp/tools/data-table/rename-data-table.tool.js +60 -0
- package/dist/modules/mcp/tools/data-table/rename-data-table.tool.js.map +1 -0
- package/dist/modules/mcp/tools/data-table/search-data-tables.tool.d.ts +12 -0
- package/dist/modules/mcp/tools/data-table/search-data-tables.tool.js +93 -0
- package/dist/modules/mcp/tools/data-table/search-data-tables.tool.js.map +1 -0
- package/dist/modules/mcp/tools/execute-workflow.tool.d.ts +3 -4
- package/dist/modules/mcp/tools/execute-workflow.tool.js +10 -25
- package/dist/modules/mcp/tools/execute-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-execution.tool.js +4 -8
- package/dist/modules/mcp/tools/get-execution.tool.js.map +1 -1
- package/dist/modules/mcp/tools/schemas.d.ts +73 -2
- package/dist/modules/mcp/tools/schemas.js +41 -1
- package/dist/modules/mcp/tools/schemas.js.map +1 -1
- package/dist/modules/mcp/tools/search-folders.tool.js +2 -7
- package/dist/modules/mcp/tools/search-folders.tool.js.map +1 -1
- package/dist/modules/mcp/tools/search-projects.tool.js +2 -7
- package/dist/modules/mcp/tools/search-projects.tool.js.map +1 -1
- package/dist/modules/mcp/tools/search-workflows.tool.js +2 -7
- package/dist/modules/mcp/tools/search-workflows.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js +1 -37
- 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.js +1 -37
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js +1 -37
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.d.ts +17 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js +48 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js.map +1 -1
- package/dist/modules/otel/handlers/node-end.handler.d.ts +8 -0
- package/dist/modules/otel/handlers/node-end.handler.js +71 -0
- package/dist/modules/otel/handlers/node-end.handler.js.map +1 -0
- package/dist/modules/otel/handlers/node-start.handler.d.ts +7 -0
- package/dist/modules/otel/handlers/node-start.handler.js +37 -0
- package/dist/modules/otel/handlers/node-start.handler.js.map +1 -0
- package/dist/modules/otel/handlers/workflow-end.handler.d.ts +1 -0
- package/dist/modules/otel/handlers/workflow-end.handler.js +8 -0
- package/dist/modules/otel/handlers/workflow-end.handler.js.map +1 -1
- package/dist/modules/otel/n8n-instrumentation.d.ts +8 -2
- package/dist/modules/otel/n8n-instrumentation.js +32 -1
- package/dist/modules/otel/n8n-instrumentation.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 +7 -0
- package/dist/modules/otel/otel.constants.js +7 -0
- package/dist/modules/otel/otel.constants.js.map +1 -1
- package/dist/modules/otel/otel.service.d.ts +1 -1
- package/dist/modules/otel/otel.service.js +20 -23
- package/dist/modules/otel/otel.service.js.map +1 -1
- package/dist/modules/otel/span-registry.d.ts +1 -0
- package/dist/modules/otel/span-registry.js +11 -0
- package/dist/modules/otel/span-registry.js.map +1 -1
- package/dist/modules/provisioning.ee/provisioning.service.ee.d.ts +17 -3
- package/dist/modules/provisioning.ee/provisioning.service.ee.js +195 -8
- package/dist/modules/provisioning.ee/provisioning.service.ee.js.map +1 -1
- package/dist/modules/provisioning.ee/role-mapping-rule.controller.ee.d.ts +7 -5
- package/dist/modules/provisioning.ee/role-mapping-rule.controller.ee.js +40 -10
- package/dist/modules/provisioning.ee/role-mapping-rule.controller.ee.js.map +1 -1
- package/dist/modules/provisioning.ee/role-mapping-rule.service.ee.d.ts +3 -1
- package/dist/modules/provisioning.ee/role-mapping-rule.service.ee.js +1 -0
- package/dist/modules/provisioning.ee/role-mapping-rule.service.ee.js.map +1 -1
- package/dist/modules/provisioning.ee/role-resolver-types.d.ts +14 -2
- package/dist/modules/provisioning.ee/role-resolver.service.ee.js +16 -6
- package/dist/modules/provisioning.ee/role-resolver.service.ee.js.map +1 -1
- package/dist/modules/redaction/executions/execution-redaction.service.d.ts +3 -2
- package/dist/modules/redaction/executions/execution-redaction.service.js +5 -1
- package/dist/modules/redaction/executions/execution-redaction.service.js.map +1 -1
- package/dist/modules/redaction/redaction.module.js +0 -6
- package/dist/modules/redaction/redaction.module.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-context.factory.d.ts +12 -0
- package/dist/modules/source-control.ee/source-control-context.factory.js +112 -0
- package/dist/modules/source-control.ee/source-control-context.factory.js.map +1 -0
- package/dist/modules/source-control.ee/source-control-export.service.ee.d.ts +2 -2
- package/dist/modules/source-control.ee/source-control-export.service.ee.js +9 -11
- package/dist/modules/source-control.ee/source-control-export.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-git.service.ee.js +3 -3
- package/dist/modules/source-control.ee/source-control-git.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +6 -4
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +29 -85
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-scoped.service.d.ts +4 -4
- package/dist/modules/source-control.ee/source-control-scoped.service.js +9 -40
- package/dist/modules/source-control.ee/source-control-scoped.service.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-status.service.ee.d.ts +3 -1
- package/dist/modules/source-control.ee/source-control-status.service.ee.js +99 -59
- package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.service.ee.d.ts +3 -1
- package/dist/modules/source-control.ee/source-control.service.ee.js +6 -4
- package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/types/source-control-context.d.ts +12 -4
- package/dist/modules/source-control.ee/types/source-control-context.js +32 -6
- package/dist/modules/source-control.ee/types/source-control-context.js.map +1 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.d.ts +4 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.js +39 -3
- package/dist/modules/sso-oidc/oidc.controller.ee.js.map +1 -1
- package/dist/modules/sso-oidc/oidc.service.ee.d.ts +14 -2
- package/dist/modules/sso-oidc/oidc.service.ee.js +86 -8
- package/dist/modules/sso-oidc/oidc.service.ee.js.map +1 -1
- package/dist/modules/sso-oidc/views/oidc-test-result.d.ts +5 -0
- package/dist/modules/sso-oidc/views/oidc-test-result.js +58 -0
- package/dist/modules/sso-oidc/views/oidc-test-result.js.map +1 -0
- package/dist/modules/sso-saml/saml-helpers.d.ts +1 -0
- package/dist/modules/sso-saml/saml-helpers.js +2 -0
- package/dist/modules/sso-saml/saml-helpers.js.map +1 -1
- package/dist/modules/sso-saml/saml.controller.ee.d.ts +2 -3
- package/dist/modules/sso-saml/saml.controller.ee.js +3 -15
- package/dist/modules/sso-saml/saml.controller.ee.js.map +1 -1
- package/dist/modules/sso-saml/saml.service.ee.d.ts +4 -1
- package/dist/modules/sso-saml/saml.service.ee.js +13 -7
- package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
- package/dist/modules/token-exchange/controllers/embed-auth.controller.d.ts +19 -0
- package/dist/modules/token-exchange/controllers/embed-auth.controller.js +106 -0
- package/dist/modules/token-exchange/controllers/embed-auth.controller.js.map +1 -0
- package/dist/modules/token-exchange/controllers/token-exchange.controller.d.ts +9 -0
- package/dist/modules/token-exchange/controllers/token-exchange.controller.js +148 -0
- package/dist/modules/token-exchange/controllers/token-exchange.controller.js.map +1 -0
- package/dist/modules/token-exchange/database/entities/token-exchange-jti.entity.d.ts +5 -0
- package/dist/modules/token-exchange/database/entities/token-exchange-jti.entity.js +33 -0
- package/dist/modules/token-exchange/database/entities/token-exchange-jti.entity.js.map +1 -0
- package/dist/modules/token-exchange/database/entities/trusted-key-source.entity.d.ts +10 -0
- package/dist/modules/token-exchange/database/entities/trusted-key-source.entity.js +45 -0
- package/dist/modules/token-exchange/database/entities/trusted-key-source.entity.js.map +1 -0
- package/dist/modules/token-exchange/database/entities/trusted-key.entity.d.ts +9 -0
- package/dist/modules/token-exchange/database/entities/trusted-key.entity.js +43 -0
- package/dist/modules/token-exchange/database/entities/trusted-key.entity.js.map +1 -0
- package/dist/modules/token-exchange/database/repositories/token-exchange-jti.repository.d.ts +10 -0
- package/dist/modules/token-exchange/database/repositories/token-exchange-jti.repository.js +106 -0
- package/dist/modules/token-exchange/database/repositories/token-exchange-jti.repository.js.map +1 -0
- package/dist/modules/token-exchange/database/repositories/trusted-key-source.repository.d.ts +5 -0
- package/dist/modules/token-exchange/database/repositories/trusted-key-source.repository.js +26 -0
- package/dist/modules/token-exchange/database/repositories/trusted-key-source.repository.js.map +1 -0
- package/dist/modules/token-exchange/database/repositories/trusted-key.repository.d.ts +7 -0
- package/dist/modules/token-exchange/database/repositories/trusted-key.repository.js +32 -0
- package/dist/modules/token-exchange/database/repositories/trusted-key.repository.js.map +1 -0
- package/dist/modules/token-exchange/services/identity-resolution.service.d.ts +23 -0
- package/dist/modules/token-exchange/services/identity-resolution.service.js +195 -0
- package/dist/modules/token-exchange/services/identity-resolution.service.js.map +1 -0
- package/dist/modules/token-exchange/services/jti-cleanup.service.d.ts +18 -0
- package/dist/modules/token-exchange/services/jti-cleanup.service.js +90 -0
- package/dist/modules/token-exchange/services/jti-cleanup.service.js.map +1 -0
- package/dist/modules/token-exchange/services/jti-store.service.d.ts +6 -0
- package/dist/modules/token-exchange/services/jti-store.service.js +30 -0
- package/dist/modules/token-exchange/services/jti-store.service.js.map +1 -0
- package/dist/modules/token-exchange/services/jwks-resolver.d.ts +30 -0
- package/dist/modules/token-exchange/services/jwks-resolver.js +190 -0
- package/dist/modules/token-exchange/services/jwks-resolver.js.map +1 -0
- package/dist/modules/token-exchange/services/scoped-jwt.strategy.d.ts +12 -0
- package/dist/modules/token-exchange/services/scoped-jwt.strategy.js +92 -0
- package/dist/modules/token-exchange/services/scoped-jwt.strategy.js.map +1 -0
- package/dist/modules/token-exchange/services/token-exchange.service.d.ts +31 -0
- package/dist/modules/token-exchange/services/token-exchange.service.js +152 -0
- package/dist/modules/token-exchange/services/token-exchange.service.js.map +1 -0
- package/dist/modules/token-exchange/services/trusted-key.service.d.ts +47 -0
- package/dist/modules/token-exchange/services/trusted-key.service.js +465 -0
- package/dist/modules/token-exchange/services/trusted-key.service.js.map +1 -0
- package/dist/modules/token-exchange/token-exchange.config.d.ts +11 -0
- package/dist/modules/token-exchange/token-exchange.config.js +67 -0
- package/dist/modules/token-exchange/token-exchange.config.js.map +1 -0
- package/dist/modules/token-exchange/token-exchange.module.d.ts +5 -0
- package/dist/modules/token-exchange/token-exchange.module.js +79 -0
- package/dist/modules/token-exchange/token-exchange.module.js.map +1 -0
- package/dist/modules/token-exchange/token-exchange.schemas.d.ts +161 -0
- package/dist/modules/token-exchange/token-exchange.schemas.js +69 -0
- package/dist/modules/token-exchange/token-exchange.schemas.js.map +1 -0
- package/dist/modules/token-exchange/token-exchange.types.d.ts +53 -0
- package/dist/modules/token-exchange/token-exchange.types.js +5 -0
- package/dist/modules/token-exchange/token-exchange.types.js.map +1 -0
- package/dist/oauth/oauth.service.d.ts +1 -0
- package/dist/oauth/oauth.service.js +39 -2
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/public-api/index.js +37 -9
- package/dist/public-api/index.js.map +1 -1
- package/dist/public-api/types.d.ts +28 -1
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.d.ts +19 -0
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.js +71 -0
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.js.map +1 -0
- package/dist/public-api/v1/handlers/community-packages/community-packages.mapper.d.ts +27 -0
- package/dist/public-api/v1/handlers/community-packages/community-packages.mapper.js +35 -0
- package/dist/public-api/v1/handlers/community-packages/community-packages.mapper.js.map +1 -0
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js +7 -12
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.service.d.ts +3 -4
- package/dist/public-api/v1/handlers/credentials/credentials.service.js +21 -33
- package/dist/public-api/v1/handlers/credentials/credentials.service.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js +5 -5
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js +5 -5
- package/dist/public-api/v1/handlers/executions/executions.handler.js +56 -12
- package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/insights/insights.handler.d.ts +6 -0
- package/dist/public-api/v1/handlers/insights/insights.handler.js +57 -0
- package/dist/public-api/v1/handlers/insights/insights.handler.js.map +1 -0
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js +14 -35
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.service.d.ts +6 -4
- package/dist/public-api/v1/handlers/workflows/workflows.service.js +7 -15
- package/dist/public-api/v1/handlers/workflows/workflows.service.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +530 -9
- package/dist/public-api/v1/public-api-error-response.d.ts +2 -0
- package/dist/public-api/v1/public-api-error-response.js +11 -0
- package/dist/public-api/v1/public-api-error-response.js.map +1 -0
- package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +1 -1
- package/dist/public-api/v1/shared/middlewares/global.middleware.js +19 -8
- package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
- package/dist/push/abstract.push.d.ts +1 -0
- package/dist/push/abstract.push.js +3 -0
- package/dist/push/abstract.push.js.map +1 -1
- package/dist/push/sse.push.js +5 -1
- package/dist/push/sse.push.js.map +1 -1
- package/dist/push/websocket.push.js +3 -1
- package/dist/push/websocket.push.js.map +1 -1
- package/dist/response-helper.js +6 -29
- package/dist/response-helper.js.map +1 -1
- package/dist/scaling/pubsub/subscriber.service.d.ts +2 -0
- package/dist/scaling/pubsub/subscriber.service.js +17 -8
- package/dist/scaling/pubsub/subscriber.service.js.map +1 -1
- package/dist/scaling/redis/redis.types.d.ts +1 -1
- package/dist/security-audit/risk-reporters/credentials-risk-reporter.d.ts +2 -3
- package/dist/security-audit/risk-reporters/credentials-risk-reporter.js +2 -5
- package/dist/security-audit/risk-reporters/credentials-risk-reporter.js.map +1 -1
- package/dist/services/ai-gateway.service.d.ts +44 -0
- package/dist/services/ai-gateway.service.js +228 -0
- package/dist/services/ai-gateway.service.js.map +1 -0
- package/dist/services/ai-workflow-builder.service.d.ts +2 -2
- package/dist/services/ai-workflow-builder.service.js +4 -4
- package/dist/services/ai-workflow-builder.service.js.map +1 -1
- package/dist/services/ai.service.d.ts +4 -0
- package/dist/services/ai.service.js +20 -18
- package/dist/services/ai.service.js.map +1 -1
- package/dist/services/api-key-auth.strategy.d.ts +10 -0
- package/dist/services/api-key-auth.strategy.js +71 -0
- package/dist/services/api-key-auth.strategy.js.map +1 -0
- package/dist/services/auth-strategy.registry.d.ts +7 -0
- package/dist/services/auth-strategy.registry.js +32 -0
- package/dist/services/auth-strategy.registry.js.map +1 -0
- package/dist/services/auth-strategy.types.d.ts +4 -0
- package/dist/services/auth-strategy.types.js +3 -0
- package/dist/services/auth-strategy.types.js.map +1 -0
- package/dist/services/credentials-tester.service.js +2 -0
- package/dist/services/credentials-tester.service.js.map +1 -1
- package/dist/services/db-clock.service.d.ts +10 -0
- package/dist/services/db-clock.service.js +48 -0
- package/dist/services/db-clock.service.js.map +1 -0
- package/dist/services/frontend.service.js +9 -0
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/import.service.d.ts +1 -0
- package/dist/services/import.service.js +25 -2
- package/dist/services/import.service.js.map +1 -1
- package/dist/services/ownership.service.d.ts +4 -1
- package/dist/services/ownership.service.js +11 -5
- package/dist/services/ownership.service.js.map +1 -1
- package/dist/services/project.service.ee.js +1 -1
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/pruning/workflow-history-compaction.service.js +4 -4
- package/dist/services/pruning/workflow-history-compaction.service.js.map +1 -1
- package/dist/services/public-api-key.service.d.ts +6 -13
- package/dist/services/public-api-key.service.js +12 -80
- package/dist/services/public-api-key.service.js.map +1 -1
- package/dist/services/user.service.js +6 -0
- package/dist/services/user.service.js.map +1 -1
- package/dist/utils/validate-redirect-url.d.ts +1 -0
- package/dist/utils/validate-redirect-url.js +17 -0
- package/dist/utils/validate-redirect-url.js.map +1 -0
- package/dist/wait-tracker.d.ts +6 -2
- package/dist/wait-tracker.js +94 -63
- package/dist/wait-tracker.js.map +1 -1
- package/dist/webhooks/live-webhooks.js +24 -18
- package/dist/webhooks/live-webhooks.js.map +1 -1
- package/dist/webhooks/test-webhooks.js +96 -78
- package/dist/webhooks/test-webhooks.js.map +1 -1
- package/dist/webhooks/waiting-webhooks.js +27 -21
- package/dist/webhooks/waiting-webhooks.js.map +1 -1
- package/dist/webhooks/webhook-form-data.js +6 -2
- package/dist/webhooks/webhook-form-data.js.map +1 -1
- package/dist/webhooks/webhook-helpers.js +21 -6
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/webhooks/webhook-last-node-response-extractor.d.ts +5 -2
- package/dist/webhooks/webhook-last-node-response-extractor.js +5 -8
- package/dist/webhooks/webhook-last-node-response-extractor.js.map +1 -1
- package/dist/webhooks/webhook.service.js +19 -4
- package/dist/webhooks/webhook.service.js.map +1 -1
- package/dist/workflow-execute-additional-data.js +2 -0
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.d.ts +1 -0
- package/dist/workflow-helpers.js +21 -0
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-runner.js +25 -1
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/workflow-creation.service.d.ts +8 -5
- package/dist/workflows/workflow-creation.service.js +40 -17
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow-execution.service.js +1 -1
- package/dist/workflows/workflow-execution.service.js.map +1 -1
- package/dist/workflows/workflow-history/workflow-history.service.js +1 -0
- package/dist/workflows/workflow-history/workflow-history.service.js.map +1 -1
- package/dist/workflows/workflow-validation.service.js +3 -3
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.ee.js +4 -1
- package/dist/workflows/workflow.service.ee.js.map +1 -1
- package/dist/workflows/workflow.service.js +16 -2
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +4 -4
- package/package.json +32 -30
|
@@ -0,0 +1,98 @@
|
|
|
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.InProcessEventBus = void 0;
|
|
13
|
+
const di_1 = require("@n8n/di");
|
|
14
|
+
const node_events_1 = require("node:events");
|
|
15
|
+
const MAX_EVENTS_PER_THREAD = 500;
|
|
16
|
+
const MAX_BYTES_PER_THREAD = 2 * 1024 * 1024;
|
|
17
|
+
let InProcessEventBus = class InProcessEventBus {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.emitter = new node_events_1.EventEmitter();
|
|
20
|
+
this.store = new Map();
|
|
21
|
+
this.sizeBytes = new Map();
|
|
22
|
+
this.nextId = new Map();
|
|
23
|
+
this.emitter.setMaxListeners(0);
|
|
24
|
+
}
|
|
25
|
+
publish(threadId, event) {
|
|
26
|
+
const events = this.getOrCreateStore(threadId);
|
|
27
|
+
const id = (this.nextId.get(threadId) ?? 0) + 1;
|
|
28
|
+
this.nextId.set(threadId, id);
|
|
29
|
+
const stored = { id, event };
|
|
30
|
+
const eventSize = JSON.stringify(event).length;
|
|
31
|
+
events.push(stored);
|
|
32
|
+
this.sizeBytes.set(threadId, (this.sizeBytes.get(threadId) ?? 0) + eventSize);
|
|
33
|
+
this.evictIfNeeded(threadId, events);
|
|
34
|
+
this.emitter.emit(threadId, stored);
|
|
35
|
+
}
|
|
36
|
+
subscribe(threadId, handler) {
|
|
37
|
+
this.emitter.on(threadId, handler);
|
|
38
|
+
return () => this.emitter.off(threadId, handler);
|
|
39
|
+
}
|
|
40
|
+
getEventsAfter(threadId, afterId) {
|
|
41
|
+
const events = this.store.get(threadId);
|
|
42
|
+
if (!events)
|
|
43
|
+
return [];
|
|
44
|
+
return events.filter((e) => e.id > afterId);
|
|
45
|
+
}
|
|
46
|
+
getEventsForRun(threadId, runId) {
|
|
47
|
+
const events = this.store.get(threadId);
|
|
48
|
+
if (!events)
|
|
49
|
+
return [];
|
|
50
|
+
return events.filter((e) => e.event.runId === runId).map((e) => e.event);
|
|
51
|
+
}
|
|
52
|
+
getEventsForRuns(threadId, runIds) {
|
|
53
|
+
const events = this.store.get(threadId);
|
|
54
|
+
if (!events || runIds.length === 0)
|
|
55
|
+
return [];
|
|
56
|
+
const runIdSet = new Set(runIds);
|
|
57
|
+
return events.filter((e) => runIdSet.has(e.event.runId)).map((e) => e.event);
|
|
58
|
+
}
|
|
59
|
+
getNextEventId(threadId) {
|
|
60
|
+
return (this.nextId.get(threadId) ?? 0) + 1;
|
|
61
|
+
}
|
|
62
|
+
clearThread(threadId) {
|
|
63
|
+
this.store.delete(threadId);
|
|
64
|
+
this.sizeBytes.delete(threadId);
|
|
65
|
+
this.nextId.delete(threadId);
|
|
66
|
+
this.emitter.removeAllListeners(threadId);
|
|
67
|
+
}
|
|
68
|
+
clear() {
|
|
69
|
+
this.store.clear();
|
|
70
|
+
this.sizeBytes.clear();
|
|
71
|
+
this.nextId.clear();
|
|
72
|
+
this.emitter.removeAllListeners();
|
|
73
|
+
}
|
|
74
|
+
evictIfNeeded(threadId, events) {
|
|
75
|
+
let totalSize = this.sizeBytes.get(threadId) ?? 0;
|
|
76
|
+
while (events.length > MAX_EVENTS_PER_THREAD || totalSize > MAX_BYTES_PER_THREAD) {
|
|
77
|
+
const evicted = events.shift();
|
|
78
|
+
if (!evicted)
|
|
79
|
+
break;
|
|
80
|
+
totalSize -= JSON.stringify(evicted.event).length;
|
|
81
|
+
}
|
|
82
|
+
this.sizeBytes.set(threadId, Math.max(0, totalSize));
|
|
83
|
+
}
|
|
84
|
+
getOrCreateStore(threadId) {
|
|
85
|
+
let events = this.store.get(threadId);
|
|
86
|
+
if (!events) {
|
|
87
|
+
events = [];
|
|
88
|
+
this.store.set(threadId, events);
|
|
89
|
+
}
|
|
90
|
+
return events;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
exports.InProcessEventBus = InProcessEventBus;
|
|
94
|
+
exports.InProcessEventBus = InProcessEventBus = __decorate([
|
|
95
|
+
(0, di_1.Service)(),
|
|
96
|
+
__metadata("design:paramtypes", [])
|
|
97
|
+
], InProcessEventBus);
|
|
98
|
+
//# sourceMappingURL=in-process-event-bus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-process-event-bus.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/event-bus/in-process-event-bus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAClC,6CAA2C;AAI3C,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,MAAM,oBAAoB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAGtC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAW7B;QAViB,YAAO,GAAG,IAAI,0BAAY,EAAE,CAAC;QAE7B,UAAK,GAAG,IAAI,GAAG,EAAyB,CAAC;QAGzC,cAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;QAGtC,WAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;QAInD,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,CAAC,QAAgB,EAAE,KAAsB;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAE9B,MAAM,MAAM,GAAgB,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;QAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;QAE/C,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CA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MAAM,CAAC,KAAK,EAAE,CAAC;YAC/B,IAAI,CAAC,OAAO;gBAAE,MAAM;YACpB,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;QACnD,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;IACtD,CAAC;IAEO,gBAAgB,CAAC,QAAgB;QACxC,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,GAAG,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;CACD,CAAA;AAjGY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,YAAO,GAAE;;GACG,iBAAiB,CAiG7B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocalGatewayRegistry = exports.LocalGateway = void 0;
|
|
4
|
+
var local_gateway_1 = require("./local-gateway");
|
|
5
|
+
Object.defineProperty(exports, "LocalGateway", { enumerable: true, get: function () { return local_gateway_1.LocalGateway; } });
|
|
6
|
+
var local_gateway_registry_1 = require("./local-gateway-registry");
|
|
7
|
+
Object.defineProperty(exports, "LocalGatewayRegistry", { enumerable: true, get: function () { return local_gateway_registry_1.LocalGatewayRegistry; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/filesystem/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AAErB,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { InstanceAiGatewayCapabilities, McpToolCallResult, ToolCategory } from '@n8n/api-types';
|
|
2
|
+
import { LocalGateway } from './local-gateway';
|
|
3
|
+
export declare class LocalGatewayRegistry {
|
|
4
|
+
private readonly userGateways;
|
|
5
|
+
private readonly apiKeyToUserId;
|
|
6
|
+
private generateUniqueKey;
|
|
7
|
+
private getOrCreate;
|
|
8
|
+
getUserIdForApiKey(key: string): string | undefined;
|
|
9
|
+
generatePairingToken(userId: string): string;
|
|
10
|
+
getPairingToken(userId: string): string | null;
|
|
11
|
+
consumePairingToken(userId: string, token: string): string | null;
|
|
12
|
+
getActiveSessionKey(userId: string): string | null;
|
|
13
|
+
clearActiveSessionKey(userId: string): void;
|
|
14
|
+
getGateway(userId: string): LocalGateway;
|
|
15
|
+
findGateway(userId: string): LocalGateway | undefined;
|
|
16
|
+
initGateway(userId: string, data: InstanceAiGatewayCapabilities): void;
|
|
17
|
+
resolveGatewayRequest(userId: string, requestId: string, result?: McpToolCallResult, error?: string): boolean;
|
|
18
|
+
disconnectGateway(userId: string): void;
|
|
19
|
+
getGatewayStatus(userId: string): {
|
|
20
|
+
connected: boolean;
|
|
21
|
+
connectedAt: string | null;
|
|
22
|
+
directory: string | null;
|
|
23
|
+
hostIdentifier: string | null;
|
|
24
|
+
toolCategories: ToolCategory[];
|
|
25
|
+
};
|
|
26
|
+
startDisconnectTimer(userId: string, onDisconnect: () => void): void;
|
|
27
|
+
clearDisconnectTimer(userId: string): void;
|
|
28
|
+
disconnectAll(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocalGatewayRegistry = void 0;
|
|
4
|
+
const nanoid_1 = require("nanoid");
|
|
5
|
+
const local_gateway_1 = require("./local-gateway");
|
|
6
|
+
const INITIAL_GRACE_MS = 10_000;
|
|
7
|
+
const MAX_GRACE_MS = 120_000;
|
|
8
|
+
const PAIRING_TOKEN_TTL_MS = 5 * 60 * 1000;
|
|
9
|
+
class LocalGatewayRegistry {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.userGateways = new Map();
|
|
12
|
+
this.apiKeyToUserId = new Map();
|
|
13
|
+
}
|
|
14
|
+
generateUniqueKey(prefix) {
|
|
15
|
+
let key;
|
|
16
|
+
do {
|
|
17
|
+
key = `${prefix}_${(0, nanoid_1.nanoid)(32)}`;
|
|
18
|
+
} while (this.apiKeyToUserId.has(key));
|
|
19
|
+
return key;
|
|
20
|
+
}
|
|
21
|
+
getOrCreate(userId) {
|
|
22
|
+
if (!this.userGateways.has(userId)) {
|
|
23
|
+
this.userGateways.set(userId, {
|
|
24
|
+
gateway: new local_gateway_1.LocalGateway(),
|
|
25
|
+
pairingToken: null,
|
|
26
|
+
activeSessionKey: null,
|
|
27
|
+
disconnectTimer: null,
|
|
28
|
+
reconnectCount: 0,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return this.userGateways.get(userId);
|
|
32
|
+
}
|
|
33
|
+
getUserIdForApiKey(key) {
|
|
34
|
+
return this.apiKeyToUserId.get(key);
|
|
35
|
+
}
|
|
36
|
+
generatePairingToken(userId) {
|
|
37
|
+
const state = this.getOrCreate(userId);
|
|
38
|
+
if (state.activeSessionKey)
|
|
39
|
+
return state.activeSessionKey;
|
|
40
|
+
const existing = this.getPairingToken(userId);
|
|
41
|
+
if (existing)
|
|
42
|
+
return existing;
|
|
43
|
+
const token = this.generateUniqueKey('gw');
|
|
44
|
+
state.pairingToken = { token, createdAt: Date.now() };
|
|
45
|
+
this.apiKeyToUserId.set(token, userId);
|
|
46
|
+
return token;
|
|
47
|
+
}
|
|
48
|
+
getPairingToken(userId) {
|
|
49
|
+
const state = this.userGateways.get(userId);
|
|
50
|
+
if (!state?.pairingToken)
|
|
51
|
+
return null;
|
|
52
|
+
if (Date.now() - state.pairingToken.createdAt > PAIRING_TOKEN_TTL_MS) {
|
|
53
|
+
this.apiKeyToUserId.delete(state.pairingToken.token);
|
|
54
|
+
state.pairingToken = null;
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return state.pairingToken.token;
|
|
58
|
+
}
|
|
59
|
+
consumePairingToken(userId, token) {
|
|
60
|
+
const state = this.userGateways.get(userId);
|
|
61
|
+
const valid = this.getPairingToken(userId);
|
|
62
|
+
if (!state || !valid || valid !== token)
|
|
63
|
+
return null;
|
|
64
|
+
this.apiKeyToUserId.delete(token);
|
|
65
|
+
state.pairingToken = null;
|
|
66
|
+
const sessionKey = this.generateUniqueKey('sess');
|
|
67
|
+
state.activeSessionKey = sessionKey;
|
|
68
|
+
this.apiKeyToUserId.set(sessionKey, userId);
|
|
69
|
+
return sessionKey;
|
|
70
|
+
}
|
|
71
|
+
getActiveSessionKey(userId) {
|
|
72
|
+
return this.userGateways.get(userId)?.activeSessionKey ?? null;
|
|
73
|
+
}
|
|
74
|
+
clearActiveSessionKey(userId) {
|
|
75
|
+
const state = this.userGateways.get(userId);
|
|
76
|
+
if (!state?.activeSessionKey)
|
|
77
|
+
return;
|
|
78
|
+
this.apiKeyToUserId.delete(state.activeSessionKey);
|
|
79
|
+
state.activeSessionKey = null;
|
|
80
|
+
}
|
|
81
|
+
getGateway(userId) {
|
|
82
|
+
return this.getOrCreate(userId).gateway;
|
|
83
|
+
}
|
|
84
|
+
findGateway(userId) {
|
|
85
|
+
return this.userGateways.get(userId)?.gateway;
|
|
86
|
+
}
|
|
87
|
+
initGateway(userId, data) {
|
|
88
|
+
const state = this.getOrCreate(userId);
|
|
89
|
+
this.clearDisconnectTimer(userId);
|
|
90
|
+
state.reconnectCount = 0;
|
|
91
|
+
state.gateway.init(data);
|
|
92
|
+
}
|
|
93
|
+
resolveGatewayRequest(userId, requestId, result, error) {
|
|
94
|
+
return this.userGateways.get(userId)?.gateway.resolveRequest(requestId, result, error) ?? false;
|
|
95
|
+
}
|
|
96
|
+
disconnectGateway(userId) {
|
|
97
|
+
this.userGateways.get(userId)?.gateway.disconnect();
|
|
98
|
+
}
|
|
99
|
+
getGatewayStatus(userId) {
|
|
100
|
+
return (this.userGateways.get(userId)?.gateway.getStatus() ?? {
|
|
101
|
+
connected: false,
|
|
102
|
+
connectedAt: null,
|
|
103
|
+
directory: null,
|
|
104
|
+
hostIdentifier: null,
|
|
105
|
+
toolCategories: [],
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
startDisconnectTimer(userId, onDisconnect) {
|
|
109
|
+
const state = this.getOrCreate(userId);
|
|
110
|
+
this.clearDisconnectTimer(userId);
|
|
111
|
+
const graceMs = Math.min(INITIAL_GRACE_MS * Math.pow(2, state.reconnectCount), MAX_GRACE_MS);
|
|
112
|
+
state.reconnectCount++;
|
|
113
|
+
state.disconnectTimer = setTimeout(() => {
|
|
114
|
+
state.disconnectTimer = null;
|
|
115
|
+
this.disconnectGateway(userId);
|
|
116
|
+
onDisconnect();
|
|
117
|
+
}, graceMs);
|
|
118
|
+
}
|
|
119
|
+
clearDisconnectTimer(userId) {
|
|
120
|
+
const state = this.userGateways.get(userId);
|
|
121
|
+
if (!state?.disconnectTimer)
|
|
122
|
+
return;
|
|
123
|
+
clearTimeout(state.disconnectTimer);
|
|
124
|
+
state.disconnectTimer = null;
|
|
125
|
+
}
|
|
126
|
+
disconnectAll() {
|
|
127
|
+
for (const state of this.userGateways.values()) {
|
|
128
|
+
if (state.disconnectTimer)
|
|
129
|
+
clearTimeout(state.disconnectTimer);
|
|
130
|
+
state.gateway.disconnect();
|
|
131
|
+
}
|
|
132
|
+
this.userGateways.clear();
|
|
133
|
+
this.apiKeyToUserId.clear();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.LocalGatewayRegistry = LocalGatewayRegistry;
|
|
137
|
+
//# sourceMappingURL=local-gateway-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-gateway-registry.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/filesystem/local-gateway-registry.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAQhC,mDAA+C;AAU/C,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAChC,MAAM,YAAY,GAAG,OAAO,CAAC;AAC7B,MAAM,oBAAoB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAO3C,MAAa,oBAAoB;IAAjC;QACkB,iBAAY,GAAG,IAAI,GAAG,EAA4B,CAAC;QAGnD,mBAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;IAgL7D,CAAC;IA7KQ,iBAAiB,CAAC,MAAc;QACvC,IAAI,GAAW,CAAC;QAChB,GAAG,CAAC;YACH,GAAG,GAAG,GAAG,MAAM,IAAI,IAAA,eAAM,EAAC,EAAE,CAAC,EAAE,CAAC;QACjC,CAAC,QAAQ,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACvC,OAAO,GAAG,CAAC;IACZ,CAAC;IAEO,WAAW,CAAC,MAAc;QACjC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE;gBAC7B,OAAO,EAAE,IAAI,4BAAY,EAAE;gBAC3B,YAAY,EAAE,IAAI;gBAClB,gBAAgB,EAAE,IAAI;gBACtB,eAAe,EAAE,IAAI;gBACrB,cAAc,EAAE,CAAC;aACjB,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;IACvC,CAAC;IAGD,kBAAkB,CAAC,GAAW;QAC7B,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IAGD,oBAAoB,CAAC,MAAc;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,WA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c;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,KAAK,EAAE,eAAe;YAAE,OAAO;QACpC,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QACpC,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;IAGD,aAAa;QACZ,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC;YAChD,IAAI,KAAK,CAAC,eAAe;gBAAE,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAC/D,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAC5B,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;CACD;AApLD,oDAoLC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { McpToolCallRequest, McpToolCallResult, McpTool, InstanceAiGatewayCapabilities, ToolCategory } from '@n8n/api-types';
|
|
2
|
+
export interface LocalGatewayEvent {
|
|
3
|
+
type: 'filesystem-request';
|
|
4
|
+
payload: {
|
|
5
|
+
requestId: string;
|
|
6
|
+
toolCall: McpToolCallRequest;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare class LocalGateway {
|
|
10
|
+
private readonly pendingRequests;
|
|
11
|
+
private readonly emitter;
|
|
12
|
+
private _connected;
|
|
13
|
+
private _connectedAt;
|
|
14
|
+
private _rootPath;
|
|
15
|
+
private _hostIdentifier;
|
|
16
|
+
private _toolCategories;
|
|
17
|
+
private _availableTools;
|
|
18
|
+
get isConnected(): boolean;
|
|
19
|
+
get connectedAt(): string | null;
|
|
20
|
+
get rootPath(): string | null;
|
|
21
|
+
getAvailableTools(): McpTool[];
|
|
22
|
+
getToolsByCategory(category: string): McpTool[];
|
|
23
|
+
onRequest(listener: (event: LocalGatewayEvent) => void): () => void;
|
|
24
|
+
init(data: InstanceAiGatewayCapabilities): void;
|
|
25
|
+
resolveRequest(requestId: string, result?: McpToolCallResult, error?: string): boolean;
|
|
26
|
+
disconnect(): void;
|
|
27
|
+
getStatus(): {
|
|
28
|
+
connected: boolean;
|
|
29
|
+
connectedAt: string | null;
|
|
30
|
+
directory: string | null;
|
|
31
|
+
hostIdentifier: string | null;
|
|
32
|
+
toolCategories: ToolCategory[];
|
|
33
|
+
};
|
|
34
|
+
callTool(toolCall: McpToolCallRequest): Promise<McpToolCallResult>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocalGateway = void 0;
|
|
4
|
+
const node_events_1 = require("node:events");
|
|
5
|
+
const nanoid_1 = require("nanoid");
|
|
6
|
+
const REQUEST_TIMEOUT_MS = 60_000;
|
|
7
|
+
class LocalGateway {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.pendingRequests = new Map();
|
|
10
|
+
this.emitter = new node_events_1.EventEmitter();
|
|
11
|
+
this._connected = false;
|
|
12
|
+
this._connectedAt = null;
|
|
13
|
+
this._rootPath = null;
|
|
14
|
+
this._hostIdentifier = null;
|
|
15
|
+
this._toolCategories = [];
|
|
16
|
+
this._availableTools = [];
|
|
17
|
+
}
|
|
18
|
+
get isConnected() {
|
|
19
|
+
return this._connected;
|
|
20
|
+
}
|
|
21
|
+
get connectedAt() {
|
|
22
|
+
return this._connectedAt;
|
|
23
|
+
}
|
|
24
|
+
get rootPath() {
|
|
25
|
+
return this._rootPath;
|
|
26
|
+
}
|
|
27
|
+
getAvailableTools() {
|
|
28
|
+
return this._availableTools;
|
|
29
|
+
}
|
|
30
|
+
getToolsByCategory(category) {
|
|
31
|
+
return this._availableTools.filter((t) => t.annotations?.category === category);
|
|
32
|
+
}
|
|
33
|
+
onRequest(listener) {
|
|
34
|
+
this.emitter.on('filesystem-request', listener);
|
|
35
|
+
return () => this.emitter.off('filesystem-request', listener);
|
|
36
|
+
}
|
|
37
|
+
init(data) {
|
|
38
|
+
this._rootPath = data.rootPath;
|
|
39
|
+
this._hostIdentifier = data.hostIdentifier ?? null;
|
|
40
|
+
this._toolCategories = data.toolCategories ?? [];
|
|
41
|
+
this._availableTools = data.tools;
|
|
42
|
+
this._connected = true;
|
|
43
|
+
this._connectedAt = new Date().toISOString();
|
|
44
|
+
}
|
|
45
|
+
resolveRequest(requestId, result, error) {
|
|
46
|
+
const pending = this.pendingRequests.get(requestId);
|
|
47
|
+
if (!pending)
|
|
48
|
+
return false;
|
|
49
|
+
clearTimeout(pending.timer);
|
|
50
|
+
this.pendingRequests.delete(requestId);
|
|
51
|
+
if (error) {
|
|
52
|
+
pending.reject(new Error(error));
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
pending.resolve(result ?? { content: [] });
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
disconnect() {
|
|
59
|
+
this._connected = false;
|
|
60
|
+
this._connectedAt = null;
|
|
61
|
+
this._rootPath = null;
|
|
62
|
+
this._hostIdentifier = null;
|
|
63
|
+
this._toolCategories = [];
|
|
64
|
+
this._availableTools = [];
|
|
65
|
+
for (const [id, pending] of this.pendingRequests) {
|
|
66
|
+
clearTimeout(pending.timer);
|
|
67
|
+
pending.reject(new Error('Local gateway disconnected'));
|
|
68
|
+
this.pendingRequests.delete(id);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
getStatus() {
|
|
72
|
+
return {
|
|
73
|
+
connected: this._connected,
|
|
74
|
+
connectedAt: this._connectedAt,
|
|
75
|
+
directory: this._rootPath,
|
|
76
|
+
hostIdentifier: this._hostIdentifier,
|
|
77
|
+
toolCategories: this._toolCategories,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
async callTool(toolCall) {
|
|
81
|
+
if (!this._connected) {
|
|
82
|
+
throw new Error('Local gateway is not connected');
|
|
83
|
+
}
|
|
84
|
+
const requestId = `gw_${(0, nanoid_1.nanoid)()}`;
|
|
85
|
+
return await new Promise((resolve, reject) => {
|
|
86
|
+
const timer = setTimeout(() => {
|
|
87
|
+
this.pendingRequests.delete(requestId);
|
|
88
|
+
reject(new Error(`Local gateway request timed out after ${REQUEST_TIMEOUT_MS}ms`));
|
|
89
|
+
}, REQUEST_TIMEOUT_MS);
|
|
90
|
+
this.pendingRequests.set(requestId, { resolve, reject, timer, toolCall });
|
|
91
|
+
this.emitter.emit('filesystem-request', {
|
|
92
|
+
type: 'filesystem-request',
|
|
93
|
+
payload: { requestId, toolCall },
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.LocalGateway = LocalGateway;
|
|
99
|
+
//# sourceMappingURL=local-gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-gateway.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/filesystem/local-gateway.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,mCAAgC;AAShC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAoClC,MAAa,YAAY;IAAzB;QACkB,oBAAe,GAAG,IAAI,GAAG,EAA0B,CAAC;QAEpD,YAAO,GAAG,IAAI,0BAAY,EAAE,CAAC;QAEtC,eAAU,GAAG,KAAK,CAAC;QAEnB,iBAAY,GAAkB,IAAI,CAAC;QAEnC,cAAS,GAAkB,IAAI,CAAC;QAEhC,oBAAe,GAAkB,IAAI,CAAC;QAEtC,oBAAe,GAAmB,EAAE,CAAC;QAErC,oBAAe,GAAc,EAAE,CAAC;IAsHzC,CAAC;IApHA,IAAI,WAAW;QACd,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,IAAI,WAAW;QACd,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAED,IAAI,QAAQ;QACX,OAAO,IAAI,CAAC,SAAS,CAAC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M,EAAE,EAAE;YAC/D,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC7B,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBACvC,MAAM,CAAC,IAAI,KAAK,CAAC,yCAAyC,kBAAkB,IAAI,CAAC,CAAC,CAAC;YACpF,CAAC,EAAE,kBAAkB,CAAC,CAAC;YAEvB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;YAE1E,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE;gBACvC,IAAI,EAAE,oBAAoB;gBAC1B,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE;aACJ,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AArID,oCAqIC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { InstanceAiEnsureThreadResponse, InstanceAiRichMessagesResponse, InstanceAiThreadInfo, InstanceAiThreadListResponse, InstanceAiThreadMessagesResponse } from '@n8n/api-types';
|
|
2
|
+
import { Logger } from '@n8n/backend-common';
|
|
3
|
+
import { GlobalConfig } from '@n8n/config';
|
|
4
|
+
import { type AgentTreeSnapshot } from '@n8n/instance-ai';
|
|
5
|
+
import { DbSnapshotStorage } from './storage/db-snapshot-storage';
|
|
6
|
+
import { TypeORMCompositeStore } from './storage/typeorm-composite-store';
|
|
7
|
+
export declare class InstanceAiMemoryService {
|
|
8
|
+
private readonly logger;
|
|
9
|
+
private readonly compositeStore;
|
|
10
|
+
private readonly dbSnapshotStorage;
|
|
11
|
+
private readonly instanceAiConfig;
|
|
12
|
+
constructor(logger: Logger, globalConfig: GlobalConfig, compositeStore: TypeORMCompositeStore, dbSnapshotStorage: DbSnapshotStorage);
|
|
13
|
+
listThreads(userId: string, page?: number, perPage?: number): Promise<InstanceAiThreadListResponse>;
|
|
14
|
+
ensureThread(userId: string, threadId: string): Promise<InstanceAiEnsureThreadResponse>;
|
|
15
|
+
getThreadMessages(userId: string, threadId: string, options?: {
|
|
16
|
+
limit?: number;
|
|
17
|
+
page?: number;
|
|
18
|
+
}): Promise<InstanceAiThreadMessagesResponse>;
|
|
19
|
+
getRichMessages(userId: string, threadId: string, options?: {
|
|
20
|
+
limit?: number;
|
|
21
|
+
page?: number;
|
|
22
|
+
excludeRunIds?: string[];
|
|
23
|
+
}): Promise<Omit<InstanceAiRichMessagesResponse, 'nextEventId'>>;
|
|
24
|
+
getLatestRunSnapshot(threadId: string, options?: {
|
|
25
|
+
messageGroupId?: string;
|
|
26
|
+
runId?: string;
|
|
27
|
+
}): Promise<AgentTreeSnapshot | undefined>;
|
|
28
|
+
validateThreadOwnership(userId: string, threadId: string): Promise<boolean>;
|
|
29
|
+
checkThreadOwnership(userId: string, threadId: string): Promise<'owned' | 'not_found' | 'other_user'>;
|
|
30
|
+
deleteThread(threadId: string): Promise<void>;
|
|
31
|
+
renameThread(threadId: string, title: string): Promise<InstanceAiThreadInfo>;
|
|
32
|
+
updateThread(threadId: string, updates: {
|
|
33
|
+
title?: string;
|
|
34
|
+
metadata?: Record<string, unknown>;
|
|
35
|
+
}): Promise<InstanceAiThreadInfo>;
|
|
36
|
+
getThreadMetadata(userId: string, threadId: string): Promise<Record<string, unknown> | undefined>;
|
|
37
|
+
cleanupExpiredThreads(onThreadDeleted?: (threadId: string) => Promise<void>): Promise<number>;
|
|
38
|
+
private createMemoryInstance;
|
|
39
|
+
private toThreadInfo;
|
|
40
|
+
}
|